Files
tai/taicpp/docs/wiring/misc.md
T
2026-10-25 05:06:43 +01:00

37 lines
2.4 KiB
Markdown

# wiring: hooks the integrator must apply for the misc modules
Do not edit these modules; bind them. Include dirs: `src/skills src/sched src/telegram src/rag src/install`
(file names are unique across them). Link: `-lsqlite3 -lcurl -lz -lpthread`. Sources: add the five dirs to
`ALL_SRCS` (the Makefile `find src -name '*.cpp'` already picks them up). `tests/misc.mk` is the standalone build
and `tests/misc_diff.py` the differential test; fold them into `make test`.
## CLI flags (src/cli, main.cpp)
| flag | binding |
|---|---|
| `--install` | `Installer::install_self()`; context: `script_path` = path of the running binary, `script_needs_interpreter=false`, `version_reader` for the native binary |
| `--install-telegram` | `Installer::install_telegram()` |
| `--uninstall-telegram` | `Installer::uninstall_telegram()` |
| `--telegram` | after boot: `TelegramBot(agent_port, nullptr, &box, log).run_telegram_bot()`; default profile `telegram` |
| `--scheduler` | print `scheduler online, press Ctrl-C to stop`, then `Scheduler::run_scheduler_loop(StopFlag)` |
| `--eval-retrieval` | `RetrievalEval::run_eval(db, FtsSearch, profile, sealed)`, print, exit 0 |
| `--stats-rag` | no tai.py counterpart; leave unbound or remove from the parser |
| `--update-models` | not in this area |
## Ports to implement on the other side
- `AgentPort` (sched): running_agents, spawn_agent (throw `AgentsFull`), poll_agent. `ScheduleHost`, `SkillHost`,
`RagHost`, `AuditHost`, `ReleaseHost`: the Tools object supplies approval, profile, store and skills refresh.
- `SealPort`/`TagPort` over the foundation Store; register the `tai_dec` SQL function when sealed (`implicit_pairs`).
- `ContainerPort` (install) and `BoxPort` (telegram): container engine, box state, ensure_box, box_transcribe.
- `LogSink`: forward to the DebugLog (`event`, `set_context`, `clear_context`).
- `TelegramAgent`: profile, bot, home, reset_history, run_turn(capture=True), start_scheduler.
## Tool table
Register handlers: `load_skill`, `create_skill`, `install_skill` -> `SkillTool`; `schedule`, `unschedule`,
`schedules` -> `ScheduleTool`; `search` -> `RagTool`; `audit`, `restore`, `tags` -> `AuditTool`; `release` ->
`ReleaseTool`; `install` -> `Installer::run_install` (refresh skills after a non-status skills action).
At boot call `SelfRelease::ensure_self_backup`; system prompt uses `SkillFiles::skill_catalog`.
`INSTALL_TARGETS` is `InstallConsts::INSTALL_TARGETS()`; the `skills` target is `Installer::op_skills`.