@mono-agent/agent-app 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +674 -0
  2. package/dist/cli.d.ts +3 -3
  3. package/dist/cli.js +4 -4
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config-reference.d.ts.map +1 -1
  6. package/dist/config-reference.js +20 -5
  7. package/dist/config-reference.js.map +1 -1
  8. package/dist/configured-agent.js +3 -1
  9. package/dist/configured-agent.js.map +1 -1
  10. package/dist/doctor.d.ts +5 -5
  11. package/dist/doctor.js +54 -20
  12. package/dist/doctor.js.map +1 -1
  13. package/dist/readiness-probe-worker.d.ts.map +1 -1
  14. package/dist/readiness-probe-worker.js +5 -2
  15. package/dist/readiness-probe-worker.js.map +1 -1
  16. package/dist/readiness-probe.d.ts.map +1 -1
  17. package/dist/readiness-probe.js +7 -0
  18. package/dist/readiness-probe.js.map +1 -1
  19. package/package.json +16 -16
  20. package/schema/mono-agent.config.schema.json +28 -4
  21. package/skills/mono-agent-composer/references/config-blueprint.md +83 -8
  22. package/skills/mono-agent-composer/references/discovery-questions.md +6 -4
  23. package/skills/mono-agent-composer/references/feature-coverage.md +90 -76
  24. package/skills/mono-agent-composer/references/package-map.md +3 -1
  25. package/skills/mono-agent-composer/references/playbooks.md +11 -8
  26. package/dist/notify-runtime.d.ts +0 -26
  27. package/dist/notify-runtime.d.ts.map +0 -1
  28. package/dist/notify-runtime.js +0 -27
  29. package/dist/notify-runtime.js.map +0 -1
  30. package/dist/notify-tool.d.ts +0 -51
  31. package/dist/notify-tool.d.ts.map +0 -1
  32. package/dist/notify-tool.js +0 -182
  33. package/dist/notify-tool.js.map +0 -1
  34. package/dist/recipes/base.d.ts +0 -15
  35. package/dist/recipes/base.d.ts.map +0 -1
  36. package/dist/recipes/base.js +0 -51
  37. package/dist/recipes/base.js.map +0 -1
  38. package/dist/recipes/catalog.d.ts +0 -4
  39. package/dist/recipes/catalog.d.ts.map +0 -1
  40. package/dist/recipes/catalog.js +0 -525
  41. package/dist/recipes/catalog.js.map +0 -1
  42. package/dist/recipes/index.d.ts +0 -11
  43. package/dist/recipes/index.d.ts.map +0 -1
  44. package/dist/recipes/index.js +0 -14
  45. package/dist/recipes/index.js.map +0 -1
  46. package/dist/recipes/types.d.ts +0 -70
  47. package/dist/recipes/types.d.ts.map +0 -1
  48. package/dist/recipes/types.js +0 -15
  49. package/dist/recipes/types.js.map +0 -1
  50. package/dist/setup.d.ts +0 -29
  51. package/dist/setup.d.ts.map +0 -1
  52. package/dist/setup.js +0 -97
  53. package/dist/setup.js.map +0 -1
@@ -1,93 +1,107 @@
1
1
  # Feature Coverage
2
2
 
3
- Every framework capability and how a composed agent reaches it. This table is the **authoritative, exhaustive** answer to "can the config do X?" — answer from it, do not grep the `@mono-agent` package source to confirm. `config` = a `mono-agent.config.json` key (env var override always exists), `cli` = a `mono-agent` CLI flag/command, `auto` = always on when the app runs, `code` = programmatic escape hatch only, `dev` = development/test tooling. A capability that is absent here, or marked `code`, is not reachable through config — that is the answer, not a cue to read source. The repo's `docs/reference/feature-registry.md` (framework checkout only) and the documentation site at <https://mono-agent-docs.vercel.app/> are longer-form human-facing mirrors of this same table.
3
+ Every framework capability and how a composed agent reaches it. This table is the **authoritative, exhaustive** answer to "can the config do X?" — answer from it, do not grep the `@mono-agent` package source to confirm. `config` = declarable in `mono-agent.config.json`; config fields may be JSON-only. Environment-variable overrides are optional: only fields with a documented `MONO_AGENT_*` mapping accept one, so consult the generated config reference's `Env override` column (`--` means none, as for `channels.plugins`) instead of inferring one. `cli` = a `mono-agent` CLI flag/command, `auto` = always on when the app runs, `code` = programmatic escape hatch only, `dev` = development/test tooling. A capability that is absent here, or marked `code`, is not reachable through config — that is the answer, not a cue to read source. The final column maps config-bearing rows back to the repo's canonical registry; multiple ids in one row are an intentional aggregation. The repo's `docs/reference/feature-registry.md` (framework checkout only) and the documentation site at <https://mono-agent-docs.vercel.app/> are longer-form human-facing mirrors of this same table.
4
4
 
5
5
  ## Runtime
6
6
 
7
- | Capability | Coverage | Where |
8
- | --- | --- | --- |
9
- | Model backends: claude (sdk/cli), codex (cli direct fallback), pi sdk providers (OpenAI, OpenAI-Codex preferred when Pi auth exists, Copilot, OpenRouter, OpenCode-through-Pi, Ollama, LM Studio, ...), plus hand-authored opencode runtime refs (cli, `opencode:<provider>:<model>` via the OpenCode server) | config | `runtime.model` |
10
- | Backup models on retryable provider failure | config | `runtime.fallbackModels` |
11
- | Execution mode (sdk/cli), effort, max turns, workspace | config + cli | `runtime.executionMode`, `runtime.effort` (`mono-agent init --effort <level>`; unsupported for direct OpenCode SDK 1.x), `runtime.maxTurns`, `runtime.workspace` |
12
- | Tool-permission posture for CLI backends (direct OpenCode asks/rejects unanswered by default; configure explicitly) | config | `runtime.permissionMode` |
13
- | Continuous provider sessions with idle eviction | config | `runtime.session.{mode,idleTimeoutMs}` |
14
- | Local providers (Ollama / LM Studio / OpenAI-compatible) | config | `providers.local[]` |
15
- | Pi OAuth credentials | config | `providers.piAuthPath` |
16
- | Tool-output bloat guard, cost tracking | auto | built into every run |
17
- | Context handling / auto-compaction | provider + auto | delegated to the provider; the pi bridge drives `AgentHarness.compact()` (proactive before a near-window turn + reactive recovery on overflow). Runs report `context_compaction_applied: true` / `false` / `null` |
18
- | Structured output (JSON schema), live input steering | code | harness `runtimeOptions` |
19
- | Tool approval gates (risk tiers, timeouts, always-allow) | code | `createMonoRuntime({ onToolApprovalRequest, ... })`needs a host UI |
20
- | Fully custom runtime | code | `startMonoAgentApp({ runtime })` |
7
+ | Capability | Coverage | Where | Registry config ids |
8
+ | --- | --- | --- | --- |
9
+ | Model backends: claude (sdk/cli), codex (cli direct fallback), pi sdk providers (OpenAI, OpenAI-Codex preferred when Pi auth exists, Copilot, OpenRouter, OpenCode-through-Pi, Ollama, LM Studio, ...), plus hand-authored opencode runtime refs (cli, `opencode:<provider>:<model>` via the OpenCode server) | config | `runtime.model` | `runtime.multi-backend` |
10
+ | Backup models on retryable provider failure | config | `runtime.fallbackModels` | `runtime.fallback-models` |
11
+ | Route-safety contract for primary and fallback models | config | `runtime.routeSafety`: `uniform` (default) or `per-route-native` | `runtime.route-safety` |
12
+ | Execution mode (sdk/cli), effort, max turns, workspace | config + cli | `runtime.executionMode`, `runtime.effort` (`none` / `minimal` / `low` / `medium` / `high` / `xhigh` / `max` / `ultra`; `mono-agent init --effort <level>`; unsupported for direct OpenCode SDK 1.x), `runtime.maxTurns`, `runtime.workspace` | `runtime.execution-modes`, `runtime.effort`, `runtime.max-turns`, `runtime.workspace` |
13
+ | Tool-permission posture for CLI backends (direct OpenCode asks/rejects unanswered by default; configure explicitly) | config | `runtime.permissionMode` | `runtime.permission-mode` |
14
+ | Continuous provider sessions with idle eviction and optional daily rollover | config | `runtime.session.{mode,idleTimeoutMs,rollover,rolloverTimezone,rolloverNotice}` | `runtime.provider-sessions` |
15
+ | Per-channel run admission/execution bounds | config | `concurrency.maxConcurrentRuns`, `concurrency.maxPendingRuns` | `runtime.concurrency` |
16
+ | Local providers (Ollama / LM Studio / OpenAI-compatible) | config | `providers.local[]` | `runtime.local-providers` |
17
+ | Pi OAuth credentials | config | `providers.piAuthPath` | `runtime.pi-credentials` |
18
+ | Pi-native transport, retry, and durable provider-session tuning | config | `providers.piNative.{transport,piMaxRetries,maxRetryDelayMs,piSessionsRoot}` | `runtime.pi-native-tuning` |
19
+ | Tool-output bloat guard, cost tracking | auto | built into every run | — |
20
+ | Context handling / auto-compaction | provider + auto | delegated to the provider; the pi bridge drives `AgentHarness.compact()` (proactive before a near-window turn + reactive recovery on overflow). Runs report `context_compaction_applied: true` / `false` / `null` | — |
21
+ | Structured output (JSON schema), live input steering | code | harness `runtimeOptions` | — |
22
+ | Tool approval gates (risk tiers, timeouts, always-allow) | code | `createMonoRuntime({ onToolApprovalRequest, ... })` — needs a host UI | — |
23
+ | Fully custom runtime | code | `startMonoAgentApp({ runtime })` | — |
21
24
 
22
25
  ## Context, skills, memory
23
26
 
24
- | Capability | Coverage | Where |
25
- | --- | --- | --- |
26
- | Identity + optional soul documents; wizard Role has one explicit destination and created/preserved outcome | config + cli | `context.identityPath`, `context.soulPath`; guided Role is `IDENTITY.md` → `## Role`, and an existing identity is never overwritten |
27
- | Selected skills from a skills root | config | `context.skillsRoot`, `context.selectedSkills` |
28
- | Generated project configuration skills with progressive disclosure | config + cli | init selects `mono-agent-configure` + `mono-agent-memory` under `./skills` with `context.skillDisclosure: "index"`; drift: `mono-agent install-skill --project --check\|--update` |
29
- | Per-skill byte cap | config | `context.skillMaxBytes` |
30
- | Conversation history (owner-only durable store) | auto | 64 messages per exact conversation id independent of `runtime.maxTurns`; aggregate defaults 256 MiB / 10,000 conversations / 365 inactive days; staged atomic publication and post-commit pruning; custom store via code |
31
- | Lite memory (FTS keyword recall + rapid-log capture; no external deps) | config | `memory.mode: "lite"`, `path`, `maxBytes`, `writeMode` |
32
- | Journal memory (hybrid recall BM25+vector + salience decay; needs configured embeddings) | config | `memory.mode: "journal"`, `path`, `memory.embeddings.{provider,endpoint,model,dim,apiKeyEnv}` (`provider: "ollama" | "lmstudio" | "openai"`; exclusive, no cross-provider fallback) |
33
- | BuJo memory (journal + LLM capture/reconcile ADD/UPDATE/SUPERSEDE/NOOP + entity graph + auto-scheduled consolidation; needs embeddings + an app-level `memory.llm`) | config | `memory.mode: "bujo"`, `path`; selected Ollama/LM Studio/OpenAI embeddings are independent from explicit `memory.llm` with `provider: "ollama"` (`model`, optional `endpoint`) or `provider: "agent-host"` (`model` is an SDK runtime model ref, optional `executionMode: "sdk"`) see `docs/memory/index.md` |
34
- | BuJo consolidation auto-scheduler (lightweight decay + duplicate superseding; in-app, no external cron needed) | config | `memory.consolidation.{enabled,cron}` (default `0 */2 * * *`); env `MONO_AGENT_MEMORY_CONSOLIDATION_CRON`, `MONO_AGENT_MEMORY_CONSOLIDATION_ENABLED` |
35
- | Memory out-of-band maintenance CLI (rebuild/recall/index/legacy reflect/migrate) | cli | `memory-bujo <subcommand> <root>`; opt-in `MONO_AGENT_MEMORY_EMBEDDINGS_PROVIDER` (`ollama`/`lmstudio`/`openai`), `_MODEL`, and `_DIM` for semantic recall; advanced `migrate` remains Ollama-only, outside guided init, and requires `MONO_AGENT_MEMORY_LLM_MODEL` (optional `_ENDPOINT`) |
36
- | Config-aware memory preview CLI (stats/today/show/search/top plus metadata-only audit; local search warns and falls back to FTS-only when embeddings are down) | cli | `mono-agent memory stats\|today\|show <date>\|search <query>\|top\|audit [--limit <n>] [--json]` |
37
- | Memory liveness check (managed tier/provider/model/dimension identity; provider-native typed discovery plus real finite-vector/dimension probe for Ollama or LM Studio; declared auth env; BuJo LLM config + consolidation cadence; no cross-provider fallback) | cli | `mono-agent validate` |
38
- | Host summaries appended after runs | config | `memory.writeMode: "append-host-summary"` |
39
- | Auto-provisioned read-only `MemoryRecall` tool exposed for every configured memory tier; no chat LLM | config | `config.memory.recallTool.enabled` (`MONO_AGENT_MEMORY_RECALL_TOOL_ENABLED`, default on; explicit false opts out) |
27
+ | Capability | Coverage | Where | Registry config ids |
28
+ | --- | --- | --- | --- |
29
+ | Public name plus identity and optional soul documents; wizard Role has one explicit destination and created/preserved outcome | config + cli | `agent.name`, `context.identityPath`, `context.soulPath`; guided Role is `IDENTITY.md` → `## Role`, and an existing identity is never overwritten | `agent.public-name`, `context.identity`, `context.soul` |
30
+ | Selected skills from a skills root | config | `context.skillsRoot`, `context.selectedSkills` | `skills.selected-activation` |
31
+ | Generated project configuration skills with progressive disclosure | config + cli | init selects `mono-agent-configure` + `mono-agent-memory` under `./skills` with `context.skillDisclosure: "index"`; drift: `mono-agent install-skill --project --check\|--update` | `app.managed-project-skills` |
32
+ | Per-skill byte cap | config | `context.skillMaxBytes` | `skills.byte-capping` |
33
+ | Conversation history (owner-only durable store) | auto | 64 messages per exact conversation id independent of `runtime.maxTurns`; aggregate defaults 256 MiB / 10,000 conversations / 365 inactive days; staged atomic publication and post-commit pruning; custom store via code | — |
34
+ | Lite memory (FTS keyword recall + rapid-log capture; no external deps) | config | `memory.mode: "lite"`, `path`, `maxBytes`, `writeMode` | `memory.lite` |
35
+ | Semantic embedding provider selection for Journal/BuJo | config + cli | `memory.embeddings.{provider,endpoint,model,dim,apiKeyEnv}`; guided init supports exclusive Ollama or LM Studio discovery and proof | `memory.embeddings-config` |
36
+ | Journal memory (hybrid recall BM25+vector + static canonical salience; needs configured embeddings) | config | `memory.mode: "journal"`, `path`, `memory.embeddings.{provider,endpoint,model,dim,apiKeyEnv}` (`provider: "ollama" \| "lmstudio" \| "openai"`; exclusive, no cross-provider fallback) | `memory.journal` |
37
+ | BuJo memory (journal + LLM capture/reconcile ADD/UPDATE/SUPERSEDE/NOOP + entity graph + auto-scheduled consolidation; needs embeddings + an app-level `memory.llm`) | config | `memory.mode: "bujo"`, `path`; selected Ollama/LM Studio/OpenAI embeddings are independent from explicit `memory.llm` with `provider: "ollama"` (`model`, optional `endpoint`) or `provider: "agent-host"` (`model` is an SDK runtime model ref, optional `executionMode: "sdk"`) see `docs/memory/index.md` | `memory.bujo` |
38
+ | Supermemory external backend (server-side extraction/consolidation; async ingestion; explicitly installed plugin) | config | `memory.backend: "supermemory"`, `memory.writeMode`, `memory.supermemory.{baseUrl,apiKey,apiKeyEnv,container,timeoutMs,exposeMcpServer}`; install the exact matching `@mono-agent/memory-supermemory` version | `memory.backend-supermemory` |
39
+ | BuJo consolidation auto-scheduler (projection-only `index.md` refresh + empty `future-log.md` stub + duplicate-group reporting; in-app, no external cron needed) | config | `memory.consolidation.{enabled,cron}` (default `0 */2 * * *`); env `MONO_AGENT_MEMORY_CONSOLIDATION_CRON`, `MONO_AGENT_MEMORY_CONSOLIDATION_ENABLED` | `memory.bujo-consolidation` |
40
+ | Memory out-of-band maintenance CLI (rebuild/recall/index/legacy reflect/migrate) | cli | `memory-bujo <subcommand> <root>`; opt-in `MONO_AGENT_MEMORY_EMBEDDINGS_PROVIDER` (`ollama`/`lmstudio`/`openai`), `_MODEL`, and `_DIM` for semantic recall; advanced `migrate` remains Ollama-only, outside guided init, and requires `MONO_AGENT_MEMORY_LLM_MODEL` (optional `_ENDPOINT`) | |
41
+ | Config-aware memory preview CLI (stats/today/show/search/top plus metadata-only audit; local search warns and falls back to FTS-only when embeddings are down) | cli | `mono-agent memory stats\|today\|show <date>\|search <query>\|top\|audit [--limit <n>] [--json]` | — |
42
+ | Memory liveness check (managed tier/provider/model/dimension identity; provider-native typed discovery plus real finite-vector/dimension probe for Ollama or LM Studio; declared auth env; BuJo LLM config + consolidation cadence; no cross-provider fallback) | cli | `mono-agent validate` | — |
43
+ | Memory write modes and per-turn BuJo capture | config | `memory.writeMode`: `disabled`, `append-host-summary`, or `capture`; capture requires `memory.mode: "bujo"` | `memory.write-mode`, `memory.per-turn-capture` |
44
+ | Auto-provisioned read-only `MemoryRecall` tool exposed for every configured memory tier; no chat LLM | config | `config.memory.recallTool.enabled` (`MONO_AGENT_MEMORY_RECALL_TOOL_ENABLED`, default on; explicit false opts out) | `memory.recall-tool` |
45
+ | In-app memory LLM call timeout | config | `memory.llm.timeoutMs` (`MONO_AGENT_MEMORY_LLM_TIMEOUT_MS`, default 60000) | `memory.llm-timeout` |
40
46
 
41
47
  ## Tools, MCP, sandbox
42
48
 
43
- | Capability | Coverage | Where |
44
- | --- | --- | --- |
45
- | Allow-all tool policy (omitted / `["*"]` = all tools; `[]` = none) | config | default `tools.allowedTools`; the harness no-policy safety net is `failClosedToolPolicy()` |
46
- | Tool allow/deny lists (deny wins, even under allow-all; pi doesn't deny external MCP tools) | config | `tools.allowedTools`, `tools.disallowedTools` |
47
- | MCP servers (stdio/sse/http) from a JSON file | config | `tools.mcpConfigPath` |
48
- | Durable origin-bound continuations for trusted stdio/loopback-HTTP MCP services | config + auto | `tools.continuationServers` + `continuations.*`; interactive claims pin a bounded immutable origin snapshot before commit, exact rollover buckets are preserved, v3 state is restart-safe, and unavailable/legacy snapshots use a fixed zero-model fallback |
49
- | Adapter-derived send tools for enabled Slack/Telegram adapters | config | auto-available under allow-all once the channel is enabled; a **specific** `tools.allowedTools` must include `SlackSendMessage` / `TelegramSendMessage`; valid `slack.*` / `telegram.*` config and existing adapter allowlists provide credentials and destination bounds |
50
- | Sandbox on/off + srt engine (Pi-owned tools; direct Codex has its own sandbox, Claude/direct OpenCode reject native mono policy) | config | `sandbox.mode` |
51
- | Network policy (none/localhost/allowlist/all) | config | `sandbox.network.{mode,allowlist}` |
52
- | Filesystem scopes (readable/writable roots, deny-write globs) | config | `sandbox.readableRoots`, `sandbox.writableRoots`, `sandbox.denyWrite` |
53
- | Fallback behavior when srt is unavailable | config | `sandbox.fallback`, `sandbox.unsafeAllowHostProcess` |
54
- | Request-scoped policies only tighten, never widen | auto | harness merge |
49
+ | Capability | Coverage | Where | Registry config ids |
50
+ | --- | --- | --- | --- |
51
+ | Allow-all tool policy (omitted / `["*"]` = all tools; `[]` = none) | config | default `tools.allowedTools`; the harness no-policy safety net is `failClosedToolPolicy()` | `tool-policy.allow-all` |
52
+ | Built-in tool allow/deny lists (deny wins, even under allow-all; pi doesn't deny external MCP tools) | config | `tools.allowedTools`, `tools.disallowedTools`; built-ins are Read/Write/Edit/Glob/Grep/Bash/WebFetch/WebSearch | `tool-policy.allowlist`, `tool-policy.denylist`, `runtime.builtin-tools` |
53
+ | MCP servers (stdio/sse/http) from a JSON file | config | `tools.mcpConfigPath` | `tool-policy.mcp-servers` |
54
+ | Durable origin-bound continuations for trusted stdio/loopback-HTTP MCP services | config + auto | `tools.continuationServers` + `continuations.*`; interactive claims pin a bounded immutable origin snapshot before commit, exact rollover buckets are preserved, v3 state is restart-safe, and unavailable/legacy snapshots use a fixed zero-model fallback | `agent-app.durable-continuations` |
55
+ | Adapter-derived send tools for enabled Slack/Telegram adapters | config | auto-available under allow-all once the channel is enabled; a **specific** `tools.allowedTools` must include `SlackSendMessage` / `TelegramSendMessage`; valid `slack.*` / `telegram.*` config and existing adapter allowlists provide credentials and destination bounds | `agent-app.adapter-send-tools` |
56
+ | Human-in-the-loop interaction bridge for blocking asks and MCP progress | config + auto | `interaction.bridge.{host,port}`, `interaction.askUser.timeoutMs`, `interaction.progress.enabled`; env `MONO_AGENT_INTERACTION_BRIDGE_HOST`, `MONO_AGENT_INTERACTION_BRIDGE_PORT`, `MONO_AGENT_ASK_USER_TIMEOUT_MS`, `MONO_AGENT_PROGRESS_ENABLED`. It auto-starts when `AskUser` or `TelegramAskButtons` is allowed, when an `interaction` block or interaction env override is configured, or when `interaction.progress.enabled` resolves true and `tools.mcpRequestContextServers` names at least one opted project stdio MCP server. | `interaction.bridge` |
57
+ | Sandbox on/off + srt engine (Pi-owned tools; direct Codex has its own sandbox, Claude/direct OpenCode reject native mono policy) | config | `sandbox.mode` | `sandbox.mode` |
58
+ | Network policy (none/localhost/allowlist/all) | config | `sandbox.network.{mode,allowlist}` | `sandbox.network-policy` |
59
+ | Filesystem scopes (readable/writable roots, deny-write globs) | config | `sandbox.readableRoots`, `sandbox.writableRoots`, `sandbox.denyWrite` | `sandbox.filesystem-scopes` |
60
+ | Fallback behavior when srt is unavailable | config | `sandbox.fallback`, `sandbox.unsafeAllowHostProcess` | `sandbox.fallback` |
61
+ | Request-scoped policies only tighten, never widen | auto | harness merge | — |
55
62
 
56
63
  ## Channels
57
64
 
58
- | Capability | Coverage | Where |
59
- | --- | --- | --- |
60
- | Webhook (sync/async HTTP invoke + status polling) | config | `webhook` section |
61
- | OpenAI-compatible API (/v1/models, /v1/chat/completions, SSE, bearer) | config | `openaiApi` section |
62
- | Telegram (long polling, chat allowlist) | config | `telegram` section |
63
- | Slack (Socket Mode, channel allowlist, mention handling) | config | `slack` section |
64
- | External channel plugins | config | `channels.plugins[]: { package, id?, label?, config? }`; package must export `createChannelDriver(options)` or a default driver factory |
65
- | WhatsApp (Baileys, QR login, group mention/any triggers) | config | `channels.plugins[].package: "@mono-agent/whatsapp-adapter"` plus plugin `config.{enabled,allowedChatJids,allowAllChats,groupMode,botJids,mentionTextAliases,stripMentionText}` |
66
- | A2A provider (Agent Card, JSON-RPC + REST, streaming, bearer, opt-in durable dispatch identity) | config | `channels.plugins[].package: "@mono-agent/a2a-adapter"` plus plugin `config.provider` (including `idempotency.{namespace,stateDir,retentionMs,maxRecords}`), `config.agent`, `config.skill`; `config.enabled` is canonical |
67
- | A2A consumer settings (remote agent URLs, timeouts) and calls | config + code | same A2A plugin entry's `config.consumer`; calls via `sendA2AMessage({ idempotencyKey })` or `createA2AConsumerResponder({ idempotencyKeyForRequest })` |
68
- | TUI stream endpoint (operator console transport) | config | `tui.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback |
69
- | Live event relay (read-only run-event SSE for web) | config | `live.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback |
70
- | Cron jobs (five-field expressions, timezones, overlap skip) | config | `cron.jobs[]`, single-job `MONO_AGENT_CRON_*`, or one markdown file per job in `cron.dir` / `MONO_AGENT_CRON_DIR` (default `cron/`) |
71
- | Channel message texts / stream tuning (welcome, debounce, ...) | code | channel driver overrides |
72
- | Custom transports | code | implement `ChannelDriver`, pass via `startMonoAgentApp({ drivers })` |
65
+ | Capability | Coverage | Where | Registry config ids |
66
+ | --- | --- | --- | --- |
67
+ | Webhook (sync/async HTTP invoke + status polling) | config | `webhook` section; endpoint overrides at `webhook.endpoints[].{model,effort}`; `webhook.maxRunMs` bounds each run | `webhook.http-invoke`, `webhook.run-watchdog` |
68
+ | OpenAI-compatible API (/v1/models, /v1/chat/completions, SSE, bearer) | config | `openaiApi` section | `openai-api.chat-completions` |
69
+ | Telegram long polling and chat allowlist | config | `telegram` section | `telegram.long-polling` |
70
+ | Telegram command/reaction/button/file interactivity | config | `telegram.commands[]`, `telegram.reactions`, `telegram.quietHours`; `TelegramAskButtons` / `TelegramSendFile` through `tools.allowedTools` | `telegram.interactive` |
71
+ | Telegram inbound audio transcription | config | `telegram.transcription.{endpoint,model,language,timeoutMs}`; opt-in OpenAI-compatible transcription endpoint for voice notes, audio files, and round-video attachments | `telegram.transcription` |
72
+ | Slack (Socket Mode, channel allowlist, mention handling) | config | `slack` section | `slack.socket-mode` |
73
+ | Slack global/message shortcuts | config | `slack.shortcuts[]: {callbackId, prompt, channelId?, ackText?, threadReply?}`; JSON-only | `slack.shortcuts` |
74
+ | Slack App Home actions | config | `slack.homeTab: {enabled?, headerText?, buttons?:[{actionId, label, prompt, channelId?, ackText?, threadReply?}]}`; `enabled` defaults to `false`, `buttons` defaults to `[]`; JSON-only | `slack.app-home` |
75
+ | External channel plugins | config | `channels.plugins[]: { package, id?, label?, config? }`; package must export `createChannelDriver(options)` or a default driver factory | `channel.plugins` |
76
+ | WhatsApp (Baileys, QR login, group mention/any triggers) | config | `channels.plugins[].package: "@mono-agent/whatsapp-adapter"` plus plugin `config.{enabled,allowedChatJids,allowAllChats,groupMode,botJids,mentionTextAliases,stripMentionText}` | `whatsapp.baileys` |
77
+ | A2A provider (Agent Card, JSON-RPC + REST, streaming, bearer, opt-in durable dispatch identity) | config | `channels.plugins[].package: "@mono-agent/a2a-adapter"` plus plugin `config.provider` (including `idempotency.{namespace,stateDir,retentionMs,maxRecords}`), `config.agent`, `config.skill`; `config.enabled` is canonical | `a2a.provider` |
78
+ | A2A consumer settings (remote agent URLs, timeouts) and calls | config + code | same A2A plugin entry's `config.consumer`; calls via `sendA2AMessage({ idempotencyKey })` or `createA2AConsumerResponder({ idempotencyKeyForRequest })` | `a2a.consumer` |
79
+ | TUI stream endpoint (operator console transport) | config | `tui.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback | `tui.stream-endpoint` |
80
+ | Live event relay (read-only run-event SSE for web) | config | `live.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback | `live.event-relay` |
81
+ | Cron jobs (five-field expressions, timezones, overlap skip) | config | `cron.jobs[]`, including per-job `model` / `effort`; single-job `MONO_AGENT_CRON_*`, or one markdown file per job in `cron.dir` / `MONO_AGENT_CRON_DIR` (default `cron/`) | `cron.scheduled-prompts` |
82
+ | Cron per-run watchdog | config + code | `cron.jobs[].maxRunMs` or `maxRunMs` frontmatter; programmatic adapter fallback via `startCronAdapter({ maxRunMs })` | `cron.run-watchdog` |
83
+ | Per-trigger runtime model and effort overrides | config + code | `cron.jobs[].{model,effort}`; `webhook.endpoints[].{model,effort}` plus request body `{model,effort}` (request wins) | `runtime.per-trigger-model` |
84
+ | Native final-answer notification for cron/webhook | config | Per job/endpoint `notify`; explicit `notifyConversationId` wins, otherwise inference occurs only with exactly one notify-capable Telegram/Slack candidate. With 0 or 2+ candidates delivery is skipped with a warning. Cron model-exhaustion notices require an explicit `notifyConversationId` and never infer; `notifyFailureCooldownHours` rate-limits them. | `channel.native-notify` |
85
+ | Channel message texts / stream tuning (welcome, debounce, ...) | code | channel driver overrides | — |
86
+ | Custom transports | config + code | implement `ChannelDriver` and expose it through `channels.plugins[]`, or pass it via `startMonoAgentApp({ drivers })` | `channel.custom` |
73
87
 
74
88
  ## Observability, operator surfaces, composition
75
89
 
76
- | Capability | Coverage | Where |
77
- | --- | --- | --- |
78
- | JSONL run artifacts (events + summaries, secrets redacted) | config | `artifacts.dir`, `artifacts.retention`, `artifacts.memoryRetention` |
79
- | Trace-source registry (heartbeat manifests `mono-agent status` reads) | config | `traceability.{registryDir,sourceId,sourceLabel,heartbeatMs,staleAfterMs,globalDiscovery}` |
80
- | Phoenix trace viewer (OTLP exporter; local JSONL artifacts are the fallback) | config | `observability.exporters` (phoenix entry) |
81
- | Operator console (live chat with thinking/tool/telemetry insight, run replay, config view) | cli | `mono-agent tui [--agent <label>]`; agents serve the `tui` stream endpoint by default (`tui.enabled`, loopback) |
82
- | Managed proposal-only configuration conversation | cli + tool | macOS `mono-agent tui --configure` attaches to the authoritative background agent; `/configure`; separate configuration/ordinary conversation ids; host-gated `ProposeAgentConfiguration`; approval restarts and waits for readiness, failed start rolls files/agent back. `--local` is ordinary chat only; off macOS configuration is manual |
83
- | Session Recorder web PWA (read-only run browser) | cli | `mono-agent web [--host] [--port] [--no-open] [--allow-non-loopback] [--include-memory]`; consumes the default-on `live` relay and local artifacts; memory runs are opt-in |
84
- | Setup presets (saved answer-sets: generate config + `.env.example` + checklist) | cli | `mono-agent presets list\|show <id>`, `mono-agent init --preset <id> --yes` (`recipes`/`--recipe` deprecated aliases) |
85
- | Interactive setup wizard (preset/custom; exact `IDENTITY.md` → `## Role` prompt/outcome; walks model→channels→memory→tools→sandbox→observability; Journal/BuJo explicitly choose Ollama or LM Studio service root/model/dimension/optional auth env using typed discovery and a real probe; macOS starts the background agent before temporary configuration) | cli | `mono-agent init` (no flags, on a TTY; `setup` alias); manual embedding entry still requires readiness probe; flags/non-TTY stay scaffold-only; unsupported platforms use manual configuration/foreground start/ordinary TUI |
86
- | Tools reporting + no-tools guardrail (allow-all → `All tools allowed`; explicit empty `allowedTools: []` → `waiting`; unknown-tool "did you mean"; send-tool/channel cross-checks) | cli | part of `mono-agent validate`/`doctor`; the wizard's tools step |
87
- | Resolved config view (every field tagged env/json/default) | cli | `mono-agent config` |
88
- | Scaffold / validate / start / install-skill | cli | `mono-agent init [--model <ref>] [--fallback-models <csv>] [--effort <level>] [--auth]\|validate [--consumer <path>]\|config\|presets\|start\|install-skill` |
89
- | Preset capability check (selected preset live?) | cli | `mono-agent validate --preset <id>` |
90
- | `.env` auto-loading | cli | automatic; `--env-file <path>` |
91
- | Explicit failure objects (no fake success) | auto | harness |
92
- | Per-request runtime options, custom memory/history stores | code | `createConfiguredAgentResponder` options |
93
- | Multi-agent delegation (`AskCollaborator` loopback MCP tool) | code | `@mono-agent/agent-orchestrator` |
90
+ | Capability | Coverage | Where | Registry config ids |
91
+ | --- | --- | --- | --- |
92
+ | JSONL run artifacts (events + summaries, secrets redacted) | config | `artifacts.dir`, `artifacts.retention`, `artifacts.memoryRetention` | `observability.jsonl-artifacts` |
93
+ | Trace-source registry (heartbeat manifests `mono-agent status` reads) | config | `traceability.{registryDir,sourceId,sourceLabel,heartbeatMs,staleAfterMs,globalDiscovery}` | `observability.trace-registry` |
94
+ | Phoenix trace viewer (OTLP exporter; local JSONL artifacts are the fallback) | config | `observability.exporters` (phoenix entry) | `observability.phoenix-exporter` |
95
+ | Operator console (live chat with thinking/tool/telemetry insight, run replay, config view) | cli | `mono-agent tui [--agent <label>]`; agents serve the `tui` stream endpoint by default (`tui.enabled`, loopback) | — |
96
+ | Managed proposal-only configuration conversation | cli + tool | macOS `mono-agent tui --configure` attaches to the authoritative background agent; `/configure`; separate configuration/ordinary conversation ids; host-gated `ProposeAgentConfiguration`; approval restarts and waits for readiness, failed start rolls files/agent back. `--local` is ordinary chat only; off macOS configuration is manual | — |
97
+ | Session Recorder web PWA (read-only run browser) | cli | `mono-agent web [--host <addr>] [--port <n>] [--no-open] [--allow-non-loopback] [--show-auth-url] [--include-memory] [--max-runs <n>] [--config <path>] [--env-file <path>]`; package `@mono-agent/session-web`; non-loopback/non-interactive auth uses `MONO_AGENT_WEB_AUTH_TOKEN` | |
98
+ | Setup presets (saved answer-sets: generate config + `.env.example` + checklist) | cli | `mono-agent presets list\|show <id>`, `mono-agent init --preset <id> --yes` (`recipes`/`--recipe` deprecated aliases) | — |
99
+ | Interactive setup wizard (preset/custom; exact `IDENTITY.md` → `## Role` prompt/outcome; walks model→channels→memory→tools→sandbox→observability; Journal/BuJo explicitly choose Ollama or LM Studio service root/model/dimension/optional auth env using typed discovery and a real probe; macOS starts the background agent before temporary configuration) | cli | `mono-agent init` (no flags, on a TTY; `setup` alias); manual embedding entry still requires readiness probe; flags/non-TTY stay scaffold-only; unsupported platforms use manual configuration/foreground start/ordinary TUI | — |
100
+ | Tools reporting + no-tools guardrail (allow-all → `All tools allowed`; explicit empty `allowedTools: []` → `waiting`; unknown-tool "did you mean"; send-tool/channel cross-checks) | cli | part of `mono-agent validate`/`doctor`; the wizard's tools step | — |
101
+ | Resolved config view (every field tagged env/json/default) | cli | `mono-agent config` | — |
102
+ | Scaffold / validate / start / install-skill | cli | `mono-agent init [--model <ref>] [--fallback-models <csv>] [--effort <level>] [--auth]\|validate [--consumer <path>]\|config\|presets\|start\|install-skill` | — |
103
+ | Preset capability check (selected preset live?) | cli | `mono-agent validate --preset <id>` | — |
104
+ | `.env` auto-loading | cli | automatic; `--env-file <path>` | — |
105
+ | Explicit failure objects (no fake success) | auto | harness | — |
106
+ | Per-request runtime options, custom memory/history stores | code | `createConfiguredAgentResponder` options | — |
107
+ | Multi-agent delegation (`AskCollaborator` loopback MCP tool) | code | `@mono-agent/agent-orchestrator` | — |
@@ -49,8 +49,9 @@ Use this path when the agent needs identity, selected skills, history, and optio
49
49
  | Prompt assembly | `@mono-agent/agent-harness` | Load identity/SOUL/skills/history/memory into deterministic prompt context |
50
50
  | Selected skill bodies | `@mono-agent/agent-harness` | Load only configured skills from `<skillsRoot>/<name>/SKILL.md` |
51
51
  | Memory substrate (schema, migrations, FTS+vector db, RRF) | `@mono-agent/memory/store` | SQLite storage, BM25 FTS, optional vector index, hybrid recall; re-exports `MemoryStore`/`MemoryBlock`/`MemoryWriteResult` from `@mono-agent/agent-contracts` |
52
- | Memory engine (all tiers: lite/journal/bujo) | `@mono-agent/memory/bujo` | `BujoMemoryStore` — tier-aware: FTS recall (lite), hybrid recall + decay (journal), LLM capture/reconcile + entity graph + scheduled consolidation (bujo) |
52
+ | Memory engine (all tiers: lite/journal/bujo) | `@mono-agent/memory/bujo` | `BujoMemoryStore` — tier-aware: FTS recall (lite), hybrid recall + static salience (journal), LLM capture/reconcile + entity graph + projection-only scheduled consolidation (bujo) |
53
53
  | Embedding providers | `@mono-agent/memory/search` | Exclusive Ollama/LM Studio/OpenAI embedding providers used by the store subpath for vector recall; `agent-app` owns guided typed discovery and the real readiness probe |
54
+ | External Supermemory backend | `@mono-agent/memory-supermemory` (optional plugin) | Explicitly installed lockstep package selected by `memory.backend: "supermemory"`; proxies the shared `MemoryStore` / `MemoryRecall` contracts to local or hosted Supermemory for server-side extraction, consolidation, and hybrid recall |
54
55
  | Recall tool surface | `@mono-agent/agent-app` (bundled) | Auto-provisions read-only `MemoryRecall` for every configured tier and direct configured responder; automatic/tool recall share the same store and per-turn query cache |
55
56
 
56
57
  Mono-agent selected skills are not auto-selected by description. The host chooses `context.selectedSkills`, and the harness loads those exact bodies.
@@ -110,6 +111,7 @@ Adapters must not import the harness, runtime adapter, memory package (`@mono-ag
110
111
  Use:
111
112
 
112
113
  - `@mono-agent/tui` for the pi-tui operator console (`mono-agent tui`): live chat with full stream-event insight, recorded-run replay, config view.
114
+ - `@mono-agent/session-web` for the read-only Session Recorder web PWA served by `mono-agent web`, including local artifact paging and live relay aggregation.
113
115
  - `@mono-agent/operator-adapter` for the loopback NDJSON stream endpoint the console connects to (`tui` config section, on by default) and the live SSE endpoint `mono-agent web` observes (`live` config section, on by default).
114
116
  - `@mono-agent/observability` for JSONL event artifacts, summaries, trace-source registration, and the `@mono-agent/observability/otel` Phoenix OTLP exporter configured via `observability.exporters`.
115
117
 
@@ -98,21 +98,22 @@ Flow, check whether one of these fits and adapt it. Verify every key against
98
98
  **Steps:** `mono-agent init` (webhook already enabled) → add `endpoints[]` (or `webhook/*.md` files; unique names AND paths) → `validate` → `start`.
99
99
  **Smoke:** `POST /webhook/invoke` for an immediate body; `POST /webhook/jobs` → 202 + status URL → poll until the result returns.
100
100
 
101
- ## 6. Cron digest with proactive Slack notify
101
+ ## 6. Cron digest with native notify
102
102
  **For:** a data analyst wanting a scheduled briefing pushed to the team.
103
- **Goal:** a timezone-aware cron job that builds a daily digest with shared history and posts it to Slack.
104
- **Features:** `cron.scheduled-prompts`, `agent-app.adapter-send-tools`, `slack.socket-mode`, `memory.journal`.
103
+ **Goal:** a timezone-aware cron job that builds a daily digest with shared history and delivers its final answer verbatim through native notification.
104
+ **Features:** `cron.scheduled-prompts`, `channel.native-notify`, `slack.socket-mode`, `memory.journal`.
105
+
106
+ **Destination resolution:** an explicit `notifyConversationId` wins; otherwise mono-agent infers only when exactly one notify-capable Telegram/Slack candidate exists. With 0 or 2+ candidates delivery is skipped with a warning. Cron model-exhaustion notices require an explicit `notifyConversationId` and never infer a destination.
105
107
 
106
108
  ```json
107
109
  {
108
110
  "runtime": { "model": "claude:claude-sonnet-4-6" },
109
111
  "slack": { "enabled": true, "botToken": "xoxb-...", "appToken": "xapp-...", "allowedChannelIds": ["C012345"] },
110
- "tools": { "allowedTools": ["SlackSendMessage", "WebSearch"] },
111
- "cron": { "jobs": [{ "id": "morning-digest", "enabled": true, "expression": "0 9 * * *", "timezone": "America/New_York", "prompt": "Build the morning digest and post it to #team via SlackSendMessage.", "conversationId": "daily-digest" }] }
112
+ "cron": { "jobs": [{ "id": "morning-digest", "enabled": true, "expression": "0 9 * * *", "timezone": "America/New_York", "prompt": "Build the morning digest. Your final answer is the digest to notify.", "conversationId": "daily-digest", "notify": true, "notifyConversationId": "slack:C012345" }] }
112
113
  }
113
114
  ```
114
- **Steps:** `mono-agent init` → add slack + `SlackSendMessage` → add the cron job (or `cron/morning-digest.md`) with `conversationId` + IANA timezone → `validate` → `start`.
115
- **Smoke:** trigger a one-off tick; confirm `SlackSendMessage` posts the digest to the allowed channel and `conversationId` shares context across ticks.
115
+ **Steps:** `mono-agent init` → add the destination adapter and allowlist → add the cron job (or `cron/morning-digest.md`) with `conversationId`, IANA timezone, `notify: true`, and optional `notifyConversationId` → `validate` → `start`.
116
+ **Smoke:** trigger a one-off tick; confirm the final answer lands verbatim in the allowed destination with no tool call and `conversationId` shares context across ticks. Return `NOTHING_TO_REPORT` to test the silent path.
116
117
 
117
118
  ## 7. A2A provider + consumer pair
118
119
  **For:** a platform integrator connecting two agents over A2A.
@@ -208,7 +209,7 @@ const ext = createCollaboratorToolRuntimeExtension({
208
209
  ```json
209
210
  {
210
211
  "runtime": { "model": "claude:claude-sonnet-4-6", "fallbackModels": ["pi:openai-codex:gpt-5.5", "pi:ollama:gemma4:31b"], "session": { "mode": "continuous" } },
211
- "providers": { "local": [{ "id": "ollama", "type": "ollama", "baseUrl": "http://localhost:11434", "enabled": true }], "piNative": { "piMaxRetries": 2, "maxRetryDelayMs": 60000, "piSessionsRoot": ".mono-agent/sessions" } }
212
+ "providers": { "local": [{ "id": "ollama", "type": "ollama", "baseUrl": "http://localhost:11434", "enabled": true }], "piNative": { "transport": "auto", "piMaxRetries": 2, "maxRetryDelayMs": 60000, "piSessionsRoot": ".mono-agent/sessions" } }
212
213
  }
213
214
  ```
214
215
  **Steps:** `ollama pull gemma4:31b` → `mono-agent init --model claude:claude-sonnet-4-6 --fallback-models pi:openai-codex:gpt-5.5,pi:ollama:gemma4:31b` → add `providers.local` + `piNative.piSessionsRoot` → `validate` → `start`.
@@ -256,6 +257,8 @@ const ext = createCollaboratorToolRuntimeExtension({
256
257
  **Goal:** one Telegram agent uses `AskUser`, long-running MCP tool progress, a self-hosted Bot API server, and `TelegramSendFile`.
257
258
  **Features:** `telegram.long-polling`, `agent-app.adapter-send-tools`, `interaction.ask-user`, `interaction.progress`, `tool-policy.mcp-servers`.
258
259
 
260
+ **Bridge startup:** the loopback interaction bridge auto-starts when `AskUser` or `TelegramAskButtons` is allowed, when the `interaction` block or an interaction env override is configured, or when `interaction.progress.enabled` resolves true and `tools.mcpRequestContextServers` names at least one opted project MCP server.
261
+
259
262
  ```json
260
263
  {
261
264
  "runtime": { "model": "pi:openai-codex:gpt-5.5", "executionMode": "sdk" },
@@ -1,26 +0,0 @@
1
- import { type NotifyToolsServer } from "./notify-tool.js";
2
- /**
3
- * Per-request input the harness hands each runtime-options extension. We only
4
- * need the request's metadata to decide whether this is a proactive trigger.
5
- */
6
- interface NotifyRuntimeExtensionInput {
7
- readonly request: {
8
- readonly metadata?: Record<string, unknown> | undefined;
9
- };
10
- }
11
- interface NotifyRuntimeExtensionResult {
12
- readonly runtimeOptions: {
13
- readonly mcpServers?: Record<string, unknown>;
14
- };
15
- readonly cleanup: () => Promise<void>;
16
- }
17
- /**
18
- * Runtime extension that exposes the `notify_conversation`/`list_notify_destinations`
19
- * tools, but ONLY on proactive trigger turns — cron and webhook — identified by the
20
- * request metadata (`metadata.cron`/`metadata.webhook`, robust regardless of how the
21
- * turn's conversationId is scoped). Live channel turns (telegram/slack/etc.) never see
22
- * these tools: a live turn is already in its conversation and just replies.
23
- */
24
- export declare function createNotifyToolsRuntimeExtension(server: Pick<NotifyToolsServer, "url" | "token">): (input: NotifyRuntimeExtensionInput) => Promise<NotifyRuntimeExtensionResult>;
25
- export {};
26
- //# sourceMappingURL=notify-runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notify-runtime.d.ts","sourceRoot":"","sources":["../src/notify-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAExF;;;GAGG;AACH,UAAU,2BAA2B;IACnC,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;KAAE,CAAC;CAC/E;AAED,UAAU,4BAA4B;IACpC,QAAQ,CAAC,cAAc,EAAE;QAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAID;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,OAAO,CAAC,GAC/C,CAAC,KAAK,EAAE,2BAA2B,KAAK,OAAO,CAAC,4BAA4B,CAAC,CAa/E"}
@@ -1,27 +0,0 @@
1
- import { NOTIFY_TOOLS_MCP_SERVER_NAME } from "./notify-tool.js";
2
- const EMPTY = { runtimeOptions: {}, cleanup: async () => { } };
3
- /**
4
- * Runtime extension that exposes the `notify_conversation`/`list_notify_destinations`
5
- * tools, but ONLY on proactive trigger turns — cron and webhook — identified by the
6
- * request metadata (`metadata.cron`/`metadata.webhook`, robust regardless of how the
7
- * turn's conversationId is scoped). Live channel turns (telegram/slack/etc.) never see
8
- * these tools: a live turn is already in its conversation and just replies.
9
- */
10
- export function createNotifyToolsRuntimeExtension(server) {
11
- const entry = {
12
- [NOTIFY_TOOLS_MCP_SERVER_NAME]: {
13
- type: "http",
14
- url: server.url,
15
- headers: { Authorization: `Bearer ${server.token}` },
16
- },
17
- };
18
- return async (input) => {
19
- return isProactiveTrigger(input.request.metadata)
20
- ? { runtimeOptions: { mcpServers: entry }, cleanup: async () => { } }
21
- : EMPTY;
22
- };
23
- }
24
- function isProactiveTrigger(metadata) {
25
- return metadata !== undefined && (metadata.cron !== undefined || metadata.webhook !== undefined);
26
- }
27
- //# sourceMappingURL=notify-runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notify-runtime.js","sourceRoot":"","sources":["../src/notify-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAA0B,MAAM,kBAAkB,CAAC;AAexF,MAAM,KAAK,GAAiC,EAAE,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAAgD;IAEhD,MAAM,KAAK,GAAG;QACZ,CAAC,4BAA4B,CAAC,EAAE;YAC9B,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE;SACrD;KACF,CAAC;IACF,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,OAAO,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC/C,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE;YACpE,CAAC,CAAC,KAAK,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAA6C;IACvE,OAAO,QAAQ,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;AACnG,CAAC"}
@@ -1,51 +0,0 @@
1
- import type { MonoAgentAppLogger } from "./channels.js";
2
- import type { NotifyDeliveryResult } from "./proactive-notify.js";
3
- /**
4
- * In-process MCP server that exposes the proactive-notification tools to the agent.
5
- *
6
- * Unlike `memory_recall`/the adapter send tools (stdio children that re-derive
7
- * everything from config/disk), notification delivery has to run a real turn on a
8
- * destination channel's LIVE session, so the handler must reach the app's running
9
- * channel registry — which only exists in this process. We therefore host the
10
- * tools over loopback HTTP (the one MCP transport the runtime's client supports
11
- * for an in-process server) and close over app-supplied delivery/discovery hooks.
12
- *
13
- * Two tools, both intended for proactive cron/webhook turns (the runtime extension
14
- * only injects this server for those):
15
- * - `list_notify_destinations` — discover the conversations the agent may notify
16
- * (answers "how do I get a conversationId?" when there is no triggering payload).
17
- * - `notify_conversation` — deliver a message as a real turn into one of them.
18
- */
19
- export declare const NOTIFY_TOOLS_MCP_SERVER_NAME = "mono-agent-notify";
20
- /** A conversation the agent may proactively notify, surfaced to the model for discovery. */
21
- export interface NotifyToolDestination {
22
- /** Destination conversationId to pass to `notify_conversation`, e.g. `telegram:42`. */
23
- readonly conversationId: string;
24
- /** Owning channel id (telegram/slack). */
25
- readonly channelId: string;
26
- /** ISO timestamp of the most recent turn on this conversation, if known. */
27
- readonly lastSeen?: string;
28
- /** True when this is an allowlisted destination the agent has not yet conversed with. */
29
- readonly fromAllowlist?: boolean;
30
- }
31
- export interface NotifyToolsDeps {
32
- /** Deliver `text` as a real turn into `conversationId` (allowlist-enforced by the owning channel). */
33
- readonly deliver: (conversationId: string, text: string) => Promise<NotifyDeliveryResult>;
34
- /** The conversations the agent may notify right now (seen + single-allowlist destinations). */
35
- readonly listDestinations: () => Promise<readonly NotifyToolDestination[]>;
36
- readonly logger?: MonoAgentAppLogger | undefined;
37
- }
38
- export interface NotifyToolsServer {
39
- /** Loopback URL the runtime's MCP client connects to (`http://127.0.0.1:<port>/mcp`). */
40
- readonly url: string;
41
- /** Bearer token required on every request. */
42
- readonly token: string;
43
- close(): Promise<void>;
44
- }
45
- /**
46
- * Start the in-process notify MCP server on an ephemeral loopback port. Stateless:
47
- * each request gets a fresh `McpServer`+transport (the tools are pure request/response),
48
- * which sidesteps session bookkeeping and concurrent-trigger races.
49
- */
50
- export declare function startNotifyToolsServer(deps: NotifyToolsDeps): Promise<NotifyToolsServer>;
51
- //# sourceMappingURL=notify-tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notify-tool.d.ts","sourceRoot":"","sources":["../src/notify-tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAEhE,4FAA4F;AAC5F,MAAM,WAAW,qBAAqB;IACpC,uFAAuF;IACvF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,sGAAsG;IACtG,QAAQ,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1F,+FAA+F;IAC/F,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAAC;IAC3E,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,iBAAiB;IAChC,yFAAyF;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAID;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAgC9F"}