Commit Graph

10 Commits

Author SHA1 Message Date
Bo
b1d8f41f1c fix: dedupe telegram updates and persist update offset
Signed-off-by: Bo <boironic@gmail.com>
2026-02-20 00:08:05 +08:00
Bo
ba28c5e60f refactor: remove runtime display and led interactions
Signed-off-by: Bo <boironic@gmail.com>
2026-02-20 00:08:05 +08:00
Bo
3232de772a chore: simplify llm serial log.
Signed-off-by: Bo <boironic@gmail.com>
2026-02-18 19:16:00 +08:00
Bo
cba7444b26 fix: fix telegram sent error in cron task.
Signed-off-by: Bo <boironic@gmail.com>
2026-02-18 17:16:00 +08:00
crispyberry
da43c27003 feat: restore NVS runtime config with CLI commands (NVS > build-time priority)
Bring back two-layer configuration: build-time defaults from mimi_secrets.h
with runtime NVS overrides via serial CLI. NVS values take highest priority
so a pre-flashed board can be reconfigured anywhere with just a USB cable.

Restored CLI commands: wifi_set, set_tg_token, set_api_key, set_model,
set_proxy, clear_proxy, set_search_key. Added new commands: config_show
(displays all config with sensitive fields masked), config_reset (clears
all NVS overrides), and help (lists all commands).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:42:10 +08:00
crispyberry
82f93b617b refactor: remove NVS/CLI config, use mimi_secrets.h as sole configuration method
All configuration is now done exclusively through mimi_secrets.h at build time.
Removed NVS read/write logic, CLI config commands (wifi_set, set_tg_token,
set_api_key, set_model, set_proxy, clear_proxy, set_search_key), and setter
functions from all modules. CLI retains debug/maintenance commands only.
Updated all documentation to reflect the change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 23:04:24 +08:00
crispyberry
0e1da79b74 feat: add ReAct agent loop and build-time config (mimi_secrets.h)
Rewrite agent_loop.c with ReAct tool use loop: LLM call → tool
execution → repeat until end_turn (max 10 iterations). Add tool
guidance to system prompt. Add set_search_key CLI command.

Add mimi_secrets.h for build-time credentials with highest priority
over NVS/CLI values. All modules (wifi, telegram, llm, proxy,
web_search) check build-time secrets first, fall back to NVS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 00:37:43 +08:00
crispyberry
3822928e6d feat: add HTTP CONNECT proxy support for Telegram and Claude API
Enable ESP32-S3 to reach api.telegram.org and api.anthropic.com through
an HTTP CONNECT proxy (e.g. Clash Verge), required in regions where
these services are blocked.

- New proxy module (http_proxy.c/h): CONNECT tunnel + TLS via esp_tls
  with pre-connected socket injection (esp_tls_set_conn_sockfd)
- Telegram and LLM modules split into direct/proxy paths
- CLI commands: set_proxy <host> <port>, clear_proxy
- Proxy config persisted in NVS
- Fix TLS buffer: MBEDTLS_SSL_IN_CONTENT_LEN 4096 → 16384
- Increase task stacks for TLS overhead (poll 12KB, agent 12KB, outbound 8KB)
- Default model changed to claude-opus-4-6
- Capture raw error body for non-200 API responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 22:40:28 +08:00
crispyberry
8b5213df87 fix: add TLS certificate bundle for HTTPS connections
All HTTP clients (Telegram, Claude API, OTA) were missing
crt_bundle_attach, causing TLS handshake failures. Add esp-tls
dependency to CMakeLists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:18:21 +08:00
crispyberry
44a82520e2 feat: add Telegram bot with long polling and message splitting
Direct HTTPS long polling against Telegram Bot API (getUpdates),
JSON parsing with cJSON, auto-split at 4096 chars, Markdown
with plain-text fallback.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 18:55:28 +08:00