@mono-agent/agent-app 0.14.0 → 0.15.1

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 (164) hide show
  1. package/README.md +3 -7
  2. package/dist/app-config.d.ts.map +1 -1
  3. package/dist/app-config.js +3 -0
  4. package/dist/app-config.js.map +1 -1
  5. package/dist/app-controller-channels.d.ts +41 -7
  6. package/dist/app-controller-channels.d.ts.map +1 -1
  7. package/dist/app-controller-channels.js +2 -3
  8. package/dist/app-controller-channels.js.map +1 -1
  9. package/dist/app-controller-continuation.d.ts +43 -11
  10. package/dist/app-controller-continuation.d.ts.map +1 -1
  11. package/dist/app-controller-continuation.js.map +1 -1
  12. package/dist/app-controller-lifecycle.d.ts +34 -5
  13. package/dist/app-controller-lifecycle.d.ts.map +1 -1
  14. package/dist/app-controller-lifecycle.js.map +1 -1
  15. package/dist/app-controller-maintenance.d.ts +45 -8
  16. package/dist/app-controller-maintenance.d.ts.map +1 -1
  17. package/dist/app-controller-maintenance.js.map +1 -1
  18. package/dist/app-controller-memory-health.d.ts +39 -10
  19. package/dist/app-controller-memory-health.d.ts.map +1 -1
  20. package/dist/app-controller-memory-health.js.map +1 -1
  21. package/dist/app-controller-memory.d.ts +27 -5
  22. package/dist/app-controller-memory.d.ts.map +1 -1
  23. package/dist/app-controller-memory.js +0 -1
  24. package/dist/app-controller-memory.js.map +1 -1
  25. package/dist/app-controller-responder.d.ts +53 -7
  26. package/dist/app-controller-responder.d.ts.map +1 -1
  27. package/dist/app-controller-responder.js +1 -4
  28. package/dist/app-controller-responder.js.map +1 -1
  29. package/dist/app-controller-traceability.d.ts +63 -14
  30. package/dist/app-controller-traceability.d.ts.map +1 -1
  31. package/dist/app-controller-traceability.js.map +1 -1
  32. package/dist/app-controller-types.d.ts +63 -0
  33. package/dist/app-controller-types.d.ts.map +1 -0
  34. package/dist/app-controller-types.js +2 -0
  35. package/dist/app-controller-types.js.map +1 -0
  36. package/dist/app-controller-utils.d.ts +1 -1
  37. package/dist/app-controller-utils.d.ts.map +1 -1
  38. package/dist/app-controller.d.ts +5 -62
  39. package/dist/app-controller.d.ts.map +1 -1
  40. package/dist/app-controller.js +0 -6
  41. package/dist/app-controller.js.map +1 -1
  42. package/dist/background-lifecycle-utils.d.ts +27 -0
  43. package/dist/background-lifecycle-utils.d.ts.map +1 -0
  44. package/dist/background-lifecycle-utils.js +69 -0
  45. package/dist/background-lifecycle-utils.js.map +1 -0
  46. package/dist/background-log-maintenance.d.ts +6 -0
  47. package/dist/background-log-maintenance.d.ts.map +1 -0
  48. package/dist/background-log-maintenance.js +185 -0
  49. package/dist/background-log-maintenance.js.map +1 -0
  50. package/dist/background.d.ts +2 -4
  51. package/dist/background.d.ts.map +1 -1
  52. package/dist/background.js +3 -263
  53. package/dist/background.js.map +1 -1
  54. package/dist/channel-drivers/telegram.d.ts.map +1 -1
  55. package/dist/channel-drivers/telegram.js +4 -0
  56. package/dist/channel-drivers/telegram.js.map +1 -1
  57. package/dist/channel-plugins.d.ts +2 -11
  58. package/dist/channel-plugins.d.ts.map +1 -1
  59. package/dist/channel-plugins.js +63 -60
  60. package/dist/channel-plugins.js.map +1 -1
  61. package/dist/channel-status-display.js +2 -6
  62. package/dist/channel-status-display.js.map +1 -1
  63. package/dist/channels.d.ts +5 -6
  64. package/dist/channels.d.ts.map +1 -1
  65. package/dist/channels.js +7 -5
  66. package/dist/channels.js.map +1 -1
  67. package/dist/cli-args.d.ts.map +1 -1
  68. package/dist/cli-args.js +50 -0
  69. package/dist/cli-args.js.map +1 -1
  70. package/dist/cli-background-command.js +1 -1
  71. package/dist/cli-background-command.js.map +1 -1
  72. package/dist/cli-validate-config-command.d.ts.map +1 -1
  73. package/dist/cli-validate-config-command.js +12 -8
  74. package/dist/cli-validate-config-command.js.map +1 -1
  75. package/dist/config-reference.d.ts +4 -1
  76. package/dist/config-reference.d.ts.map +1 -1
  77. package/dist/config-reference.js +254 -65
  78. package/dist/config-reference.js.map +1 -1
  79. package/dist/configured-agent.d.ts +2 -8
  80. package/dist/configured-agent.d.ts.map +1 -1
  81. package/dist/configured-agent.js +3 -25
  82. package/dist/configured-agent.js.map +1 -1
  83. package/dist/consumer-contract.d.ts.map +1 -1
  84. package/dist/consumer-contract.js +2 -4
  85. package/dist/consumer-contract.js.map +1 -1
  86. package/dist/doctor-observability.d.ts +7 -0
  87. package/dist/doctor-observability.d.ts.map +1 -0
  88. package/dist/doctor-observability.js +80 -0
  89. package/dist/doctor-observability.js.map +1 -0
  90. package/dist/doctor-types.d.ts +17 -0
  91. package/dist/doctor-types.d.ts.map +1 -0
  92. package/dist/doctor-types.js +2 -0
  93. package/dist/doctor-types.js.map +1 -0
  94. package/dist/doctor.d.ts +2 -12
  95. package/dist/doctor.d.ts.map +1 -1
  96. package/dist/doctor.js +7 -106
  97. package/dist/doctor.js.map +1 -1
  98. package/dist/first-run-readiness.d.ts +1 -1
  99. package/dist/first-run-readiness.d.ts.map +1 -1
  100. package/dist/first-run-readiness.js +1 -1
  101. package/dist/first-run-readiness.js.map +1 -1
  102. package/dist/index.d.ts +0 -2
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +0 -1
  105. package/dist/index.js.map +1 -1
  106. package/dist/managed-web-logs.d.ts +16 -0
  107. package/dist/managed-web-logs.d.ts.map +1 -0
  108. package/dist/managed-web-logs.js +153 -0
  109. package/dist/managed-web-logs.js.map +1 -0
  110. package/dist/posted-reply-history.d.ts.map +1 -1
  111. package/dist/posted-reply-history.js +3 -0
  112. package/dist/posted-reply-history.js.map +1 -1
  113. package/dist/web-command.d.ts +4 -1
  114. package/dist/web-command.d.ts.map +1 -1
  115. package/dist/web-command.js +31 -1
  116. package/dist/web-command.js.map +1 -1
  117. package/package.json +16 -16
  118. package/schema/mono-agent.config.schema.json +300 -162
  119. package/skills/mono-agent-composer/references/config-blueprint.md +7 -12
  120. package/skills/mono-agent-composer/references/discovery-questions.md +1 -1
  121. package/skills/mono-agent-composer/references/feature-coverage.md +5 -6
  122. package/skills/mono-agent-composer/references/package-map.md +4 -5
  123. package/skills/mono-agent-composer/references/playbooks.md +2 -2
  124. package/skills/mono-agent-composer/references/validation.md +1 -1
  125. package/dist/broadcast-recorder.d.ts +0 -27
  126. package/dist/broadcast-recorder.d.ts.map +0 -1
  127. package/dist/broadcast-recorder.js +0 -104
  128. package/dist/broadcast-recorder.js.map +0 -1
  129. package/dist/channel-drivers/live.d.ts +0 -12
  130. package/dist/channel-drivers/live.d.ts.map +0 -1
  131. package/dist/channel-drivers/live.js +0 -48
  132. package/dist/channel-drivers/live.js.map +0 -1
  133. package/dist/notify-runtime.d.ts +0 -26
  134. package/dist/notify-runtime.d.ts.map +0 -1
  135. package/dist/notify-runtime.js +0 -27
  136. package/dist/notify-runtime.js.map +0 -1
  137. package/dist/notify-tool.d.ts +0 -51
  138. package/dist/notify-tool.d.ts.map +0 -1
  139. package/dist/notify-tool.js +0 -182
  140. package/dist/notify-tool.js.map +0 -1
  141. package/dist/recipes/base.d.ts +0 -15
  142. package/dist/recipes/base.d.ts.map +0 -1
  143. package/dist/recipes/base.js +0 -51
  144. package/dist/recipes/base.js.map +0 -1
  145. package/dist/recipes/catalog.d.ts +0 -4
  146. package/dist/recipes/catalog.d.ts.map +0 -1
  147. package/dist/recipes/catalog.js +0 -525
  148. package/dist/recipes/catalog.js.map +0 -1
  149. package/dist/recipes/index.d.ts +0 -11
  150. package/dist/recipes/index.d.ts.map +0 -1
  151. package/dist/recipes/index.js +0 -14
  152. package/dist/recipes/index.js.map +0 -1
  153. package/dist/recipes/types.d.ts +0 -70
  154. package/dist/recipes/types.d.ts.map +0 -1
  155. package/dist/recipes/types.js +0 -15
  156. package/dist/recipes/types.js.map +0 -1
  157. package/dist/sessions-command.d.ts +0 -53
  158. package/dist/sessions-command.d.ts.map +0 -1
  159. package/dist/sessions-command.js +0 -309
  160. package/dist/sessions-command.js.map +0 -1
  161. package/dist/setup.d.ts +0 -29
  162. package/dist/setup.d.ts.map +0 -1
  163. package/dist/setup.js +0 -97
  164. package/dist/setup.js.map +0 -1
@@ -18,7 +18,8 @@ Every framework capability and how a composed agent reaches it. This table is th
18
18
  | Pi-native transport, retry, and durable provider-session tuning | config | `providers.piNative.{transport,piMaxRetries,maxRetryDelayMs,piSessionsRoot}` | `runtime.pi-native-tuning` |
19
19
  | Tool-output bloat guard, cost tracking | auto | built into every run | — |
20
20
  | Context handling / auto-compaction | config + provider | `runtime.compaction.*` (matching `MONO_AGENT_COMPACTION_*`) controls adaptive Pi compaction. Omitted budgets derive from the active model window; reactive recovery re-prompts exactly once only after a verified reduction, and persistent `context_limit` advances to a configured fallback | `runtime.context-compaction` |
21
- | Structured output (JSON schema), live input steering | code | harness `runtimeOptions` | — |
21
+ | Structured output (JSON schema) | code | harness `runtimeOptions.outputSchema` | — |
22
+ | Live input steering | auto + code | built into ordinary Slack, Telegram, and web-console turns, including completed safe-preview `Steered` activity after provider acknowledgement; custom hosts use `runtimeOptions.liveInput` | — |
22
23
  | Tool approval gates (risk tiers, timeouts, always-allow) | code | `createMonoRuntime({ onToolApprovalRequest, ... })` — needs a host UI | — |
23
24
  | Fully custom runtime | code | `startMonoAgentApp({ runtime })` | — |
24
25
 
@@ -38,7 +39,7 @@ Every framework capability and how a composed agent reaches it. This table is th
38
39
  | 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` |
39
40
  | 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` |
40
41
  | 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}` (five-field UTC, default `0 */2 * * *`, no hashed `H`); env `MONO_AGENT_MEMORY_CONSOLIDATION_CRON`, `MONO_AGENT_MEMORY_CONSOLIDATION_ENABLED` | `memory.bujo-consolidation` |
41
- | Memory maintenance CLI | cli | `mono-agent memory <subcommand>` from the agent folder (stats/today/show/search/top/audit/inspect/rebuild/rollback/…). The standalone `memory-bujo <subcommand> <root>` CLI was removed — its bin now prints a redirect and exits non-zero; routine BuJo consolidation runs via the in-app scheduler | — |
42
+ | Memory maintenance CLI | cli | `mono-agent memory <subcommand>` from the agent folder (stats/today/show/search/top/audit/inspect/rebuild/rollback/…). The standalone `memory-bujo <subcommand> <root>` CLI and bin were removed; routine BuJo consolidation runs via the in-app scheduler | — |
42
43
  | Config-aware memory preview CLI (stats/today/show/search/top plus metadata-only audit; remains available when the live recall tool is disabled; 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]` | — |
43
44
  | 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` | — |
44
45
  | 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` |
@@ -67,7 +68,7 @@ Every framework capability and how a composed agent reaches it. This table is th
67
68
  | --- | --- | --- | --- |
68
69
  | Webhook (sync/async HTTP invoke + status polling + optional bearer) | config | `webhook` section; `apiKey` protects invoke/status and is required with non-loopback opt-in; endpoint overrides at `webhook.endpoints[].{model,effort,maxRunMs}`; endpoint `maxRunMs` wins over the `webhook.maxRunMs` fallback and `0` disables that endpoint watchdog | `webhook.http-invoke`, `webhook.run-watchdog` |
69
70
  | OpenAI-compatible API (/v1/models, /v1/chat/completions, SSE, bearer) | config | `openaiApi` section; sampling fields remain request metadata, while non-default values are ignored with a `runtime_warning` and runtime config stays authoritative | `openai-api.chat-completions` |
70
- | Telegram long polling and chat allowlist | config | `telegram` section | `telegram.long-polling` |
71
+ | Telegram long polling, chat allowlist, and group trigger boundary | config | `telegram` section; `telegram.groupMode` (`any` or `mention`) and `telegram.stripMentionText` | `telegram.long-polling` |
71
72
  | Telegram runtime/command/reaction/button/file interactivity | config + code | built-in per-chat `/model` and `/effort` use configured primary/fallback models (no Telegram config key); `telegram.commands[]`, `telegram.reactions`, `telegram.quietHours`; `AskUser`, non-blocking `TelegramSendMessage.reply_options`, and `TelegramSendFile` | `telegram.interactive` |
72
73
  | 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` |
73
74
  | Slack (Socket Mode, channel allowlist, mention handling, native runtime controls) | config + code | `slack` section; built-in Block Kit controls use configured primary/fallback choices through DM-wide/thread-local `@agent /model` and `@agent /effort`, plus channel-wide workspace commands `/<bot>-model` and `/<bot>-effort` derived from `auth.test.user` (Slack app registration + `commands` scope; no mono-agent config key) | `slack.socket-mode` |
@@ -78,7 +79,6 @@ Every framework capability and how a composed agent reaches it. This table is th
78
79
  | A2A provider (Agent Card, JSON-RPC + REST, streaming, bearer, configurable request-body limit, opt-in durable dispatch identity) | config | `channels.plugins[].package: "@mono-agent/a2a-adapter"` plus plugin `config.provider` (including `maxRequestBytes` and `idempotency.{namespace,stateDir,retentionMs,maxRecords}`), `config.agent`, `config.skill`; `config.enabled` is canonical | `a2a.provider` |
79
80
  | 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` |
80
81
  | TUI stream endpoint (operator console transport) | config | `tui.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback | `tui.stream-endpoint` |
81
- | Live event relay (read-only run-event SSE for web) | config | `live.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback | `live.event-relay` |
82
82
  | Cron jobs (five-field expressions, timezones, stable job-id-seeded `H`; agent-app pins overlap to skip) | config + code | `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/`); queue/replace controls are programmatic-only `startCronAdapter` options | `cron.scheduled-prompts` |
83
83
  | Cron per-run watchdog | config + code | `cron.jobs[].maxRunMs` or `maxRunMs` frontmatter; programmatic adapter fallback via `startCronAdapter({ maxRunMs })` | `cron.run-watchdog` |
84
84
  | Per-request runtime model and effort overrides | config + code | `cron.jobs[].{model,effort}`; `webhook.endpoints[].{model,effort}` plus request body `{model,effort}` (request wins); Telegram `/model` and `/effort`; Slack Block Kit selectors through thread-local `@agent /model` / `@agent /effort` and channel-wide `/<bot>-model` / `/<bot>-effort`, all over configured primary/fallback models | `runtime.per-trigger-model` |
@@ -90,13 +90,12 @@ Every framework capability and how a composed agent reaches it. This table is th
90
90
 
91
91
  | Capability | Coverage | Where | Registry config ids |
92
92
  | --- | --- | --- | --- |
93
- | JSONL run artifacts (events + summaries; strings capped; non-numeric values under sensitive-looking object keys are redacted; numeric values under matched keys are retained; free text is not content-scanned) | config | `artifacts.dir`, `artifacts.retention`, `artifacts.memoryRetention` | `observability.jsonl-artifacts` |
93
+ | JSONL run artifacts (events + summaries; strings capped; non-numeric values under sensitive-looking object keys are redacted; numeric values under matched keys are retained; retained free text is scanned for a closed set of high-confidence credential shapes) | config | `artifacts.dir`, `artifacts.retention`, `artifacts.memoryRetention` | `observability.jsonl-artifacts` |
94
94
  | Trace-source registry (heartbeat manifests `mono-agent status` reads) | config | `traceability.{registryDir,sourceId,sourceLabel,heartbeatMs,staleAfterMs,globalDiscovery}` | `observability.trace-registry` |
95
95
  | Phoenix trace viewer (best-effort terminal-batched OTLP exporter; independent local JSONL has bounded terminal snapshots and can lose RAM-buffered events on crash) | config | `observability.exporters` (phoenix entry) | `observability.phoenix-exporter` |
96
96
  | 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) | — |
97
97
  | Always-on multi-agent web console (persistent conversations and same-thread quotes, fixed compact/expanded rail, offline-agent filtering that always preserves pinned/selected agents, alive-page/PWA response notifications, attachments, model/effort selection, reasoning/tools, hidden telemetry-backed cumulative context usage, cancellation) | cli | `mono-agent web start\|stop\|restart\|status\|logs\|run`; bare `mono-agent web` is read-only status/help; default `0.0.0.0:5050`, `--loopback` narrows to `127.0.0.1`; notifications require explicit per-origin browser permission plus a secure context and do not use Web Push; package `@mono-agent/web`; no app authentication, so LAN/Tailnet reachability is the access boundary | — |
98
98
  | Managed proposal-only SELF-CONFIG conversation | cli + tool | macOS `mono-agent tui --configure` attaches to the authoritative background agent; persistent marker and capability map; stable configuration conversation with a fresh proposal capability after each checkpoint; host-gated `ProposeAgentConfiguration`; approval restarts and waits for readiness, failed start rolls files/agent back; only quitting exits. `--local` is ordinary chat only; off macOS configuration is manual | — |
99
- | Session Recorder web PWA (read-only run browser) | cli | Command removed — use `mono-agent tui` (recorded-run replay) or `mono-agent web` (live console); the `@mono-agent/session-web` package still ships without a CLI launcher, and `MONO_AGENT_WEB_AUTH_TOKEN` is no longer read by any code (its only reader, the removed `sessions` command, is gone) | — |
100
99
  | Setup presets (saved answer-sets: generate config + `.env.example` + checklist) | cli | `mono-agent presets list\|show <id>`, `mono-agent init --preset <id> --yes` (the `recipes` command and `--recipe` alias were removed) | — |
101
100
  | 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 persistent SELF-CONFIG) | 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 | — |
102
101
  | 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 | — |
@@ -105,7 +105,7 @@ Communication adapters are edge packages. They accept an `AgentResponder` and ow
105
105
  | Slack | `@mono-agent/slack-adapter` | Allowed channel or DM gets the final reply |
106
106
  | WhatsApp | `@mono-agent/whatsapp-adapter` (external channel plugin) | Allowed sender/group trigger produces a reply |
107
107
  | OpenAI-compatible API | `@mono-agent/openai-api-adapter` | `curl /v1/models` and `/v1/chat/completions` |
108
- | Operator endpoints | `@mono-agent/operator-adapter` | `mono-agent tui` and `mono-agent web` connect for chat; the read-only `live` relay feeds operator tooling such as the `@mono-agent/session-web` PWA |
108
+ | Operator endpoint | `@mono-agent/operator-adapter` | `mono-agent tui` and `mono-agent web` connect for chat |
109
109
  | A2A provider/consumer | `@mono-agent/a2a-adapter` (external channel plugin) | Send text to the Agent Card URL |
110
110
  | Webhook | `@mono-agent/webhook-adapter` | `curl` the configured invocation path (with `Authorization: Bearer ...` when `apiKey` is set) |
111
111
  | Cron | `@mono-agent/cron-adapter` | One scheduled or manually triggered invocation |
@@ -116,13 +116,12 @@ Adapters must not import the harness, runtime adapter, memory package (`@mono-ag
116
116
 
117
117
  Use:
118
118
 
119
- - `@mono-agent/tui` for the pi-tui operator console (`mono-agent tui`): live chat with structured stream-event insight, recorded-run replay, and config view. Remote event frames have a strict 256 KiB UTF-8 NDJSON cap: assistant-thought/tool-call payload fields are reduced and remeasured, while another oversized variant or a reducible event whose minimal form still does not fit becomes a bounded `oversized_event` marker. Other frame kinds are unaffected, and replay contains only key-redacted, capped events that reached terminal JSONL persistence.
119
+ - `@mono-agent/tui` for the pi-tui operator console (`mono-agent tui`): live chat with structured stream-event insight, recorded-run replay, and config view. Remote event frames have a strict 256 KiB UTF-8 NDJSON cap: assistant-thought/tool-call payload fields are reduced and remeasured, while another oversized variant or a reducible event whose minimal form still does not fit becomes a bounded `oversized_event` marker. Other frame kinds are unaffected, and replay contains only sensitive-key-redacted, credential-scanned, capped events that reached terminal JSONL persistence.
120
120
  - `@mono-agent/web` for the assistant-ui always-on browser console (`mono-agent web`): persistent multi-agent conversations and same-thread quotes, fixed compact/expanded agent navigation with offline filtering, explicit alive-page/PWA response notifications, device-local file picking, streamed reasoning/tools, internal telemetry-backed cumulative context usage, cancellation, LAN-default HTTP on port 5050, and conflict-safe optional Tailscale Serve HTTPS. It has no app login; network reachability is the access boundary.
121
- - `@mono-agent/session-web` for the read-only Session Recorder PWA. Its `sessions` launcher command was removed (use `mono-agent tui` for recorded-run replay or `mono-agent web` for the live console); the package still ships without a CLI command and full retirement is pending. Local artifact paging and live relay aggregation stay on its port 4599 surface.
122
- - `@mono-agent/operator-adapter` for the loopback NDJSON stream endpoint the TUI and web chat console connect to (`tui` config section, on by default) and the read-only live SSE endpoint operator tooling observes (`live` config section, on by default).
121
+ - `@mono-agent/operator-adapter` for the loopback NDJSON stream endpoint the TUI and web chat console connect to (`tui` config section, on by default).
123
122
  - `@mono-agent/observability` for JSONL event artifacts, summaries, trace-source registration, and the `@mono-agent/observability/otel` Phoenix OTLP exporter configured via `observability.exporters`.
124
123
 
125
- Traceability is local-first. A running host registers a source manifest; `mono-agent status` reads the trace-source registry to report live sources, and artifacts are keyed by `(sourceId, runId)` so duplicate run ids do not collide. Phoenix is the recommended trace viewer when an `observability.exporters` (phoenix) entry is configured; its terminal-batched export is best-effort. Independently, the local recorder writes empty events plus a `running` summary at start and a key-redacted, capped snapshot at finish/fail. Events stay in RAM between those boundaries, so a crash can lose them. Without Phoenix, those bounded terminal JSONL snapshots are the only local run record.
124
+ Traceability is local-first. A running host registers a source manifest; `mono-agent status` reads the trace-source registry to report live sources, and artifacts are keyed by `(sourceId, runId)` so duplicate run ids do not collide. Phoenix is the recommended trace viewer when an `observability.exporters` (phoenix) entry is configured; its terminal-batched export is best-effort. Independently, the local recorder writes empty events plus a `running` summary at start and a sensitive-key-redacted, credential-scanned, capped snapshot at finish/fail. Events stay in RAM between those boundaries, so a crash can lose them. Without Phoenix, those bounded terminal JSONL snapshots are the only local run record.
126
125
 
127
126
  ## Multi-Agent Join
128
127
 
@@ -190,7 +190,7 @@ const orchestrator = await createConfiguredAgentResponder({
190
190
 
191
191
  ## 10. Phoenix-observed agent with the TUI
192
192
  **For:** an agent builder evaluating runs in a tracing dashboard.
193
- **Goal:** run locally with the TUI, attempt a best-effort terminal-batched Phoenix export, and retain a key-redacted, capped local JSONL snapshot after terminal persistence. A pre-terminal crash can omit the Phoenix batch and lose RAM-buffered JSONL events.
193
+ **Goal:** run locally with the TUI, attempt a best-effort terminal-batched Phoenix export, and retain a sensitive-key-redacted, credential-scanned, capped local JSONL snapshot after terminal persistence. A pre-terminal crash can omit the Phoenix batch and lose RAM-buffered JSONL events.
194
194
  **Features:** `observability.phoenix-exporter`, `observability.jsonl-artifacts`, `observability.trace-registry`, `tui.chat`.
195
195
 
196
196
  ```json
@@ -202,7 +202,7 @@ const orchestrator = await createConfiguredAgentResponder({
202
202
  }
203
203
  ```
204
204
  **Steps:** start Phoenix (6006) → `init` → add artifacts/traceability/exporter → `validate` (POSTs an empty protobuf) → `start` (prints the Phoenix endpoint) → `mono-agent tui`.
205
- **Smoke:** complete a TUI prompt; confirm a JSONL artifact AND a Phoenix trace with merged tool spans under the project. Artifact/export strings are capped; non-numeric values under sensitive-looking object keys are redacted; numeric values under matched keys are retained; free text is not content-scanned or scrubbed.
205
+ **Smoke:** complete a TUI prompt; confirm a JSONL artifact AND a Phoenix trace with merged tool spans under the project. Strings are capped. For local artifacts, non-numeric values under sensitive-looking object keys are redacted; numeric values under matched keys are retained; retained free text is scanned for a closed set of high-confidence credential shapes. Phoenix applies that scan only when `contentPatternRedaction` is true.
206
206
 
207
207
  ## 11. Backfill historical runs to Phoenix
208
208
  **For:** an ops engineer onboarding observability after the fact.
@@ -124,7 +124,7 @@ pnpm run test:demo
124
124
  | A2A | Send text to the Agent Card URL with `sendA2AMessage()`. |
125
125
  | Webhook | `curl` the invocation path and inspect the response body/status. |
126
126
  | Cron | Run a one-off scheduled invocation or wait for one tick. |
127
- | Observability | Confirm a run writes a JSONL artifact with strings capped: non-numeric values under sensitive-looking object keys are redacted; numeric values under matched keys are retained; free text is not content-scanned. If an `observability.exporters` Phoenix entry is set, confirm the trace appears in Phoenix. |
127
+ | Observability | Confirm a run writes a JSONL artifact with strings capped: non-numeric values under sensitive-looking object keys are redacted; numeric values under matched keys are retained; retained free text is scanned for a closed set of high-confidence credential shapes. If an `observability.exporters` Phoenix entry is set, confirm the trace appears in Phoenix. |
128
128
  | Memory recall tool | With any memory tier configured (`memory.recallTool.enabled` defaults on), ask the agent to recall an old note and confirm `MemoryRecall` appears separately from action-tool allowlists and returns it. |
129
129
  | Semantic memory search | With `memory.embeddings` set, first prove the configured provider only: Ollama model advertises `embedding` through `/api/show` and answers `/api/embed`, or LM Studio model has exact `type: "embedding"` in `/api/v1/models` and answers `/v1/embeddings`. Verify the finite vector dimension matches config, then ask a paraphrased question about an old note and confirm `MemoryRecall` returns it. Never accept a cross-provider fallback as proof. |
130
130
 
@@ -1,27 +0,0 @@
1
- import type { RunEventSink } from "@mono-agent/agent-contracts";
2
- import type { RunRecorder } from "@mono-agent/observability";
3
- /** Stable run context stamped onto every broadcast frame. */
4
- export interface BroadcastRunContext {
5
- readonly runId: string;
6
- readonly conversationId: string;
7
- /** Producing instance's trace-source id (empty when the host has none). */
8
- readonly sourceId: string;
9
- readonly sourceLabel?: string;
10
- /** Trigger channel, e.g. "cron" | "webhook" | "chat" | "memory". */
11
- readonly source?: string;
12
- /** Trigger detail (cron job id / webhook endpoint name). */
13
- readonly sourceDetail?: string;
14
- }
15
- /**
16
- * Wrap a {@link RunRecorder} so every run start/event/finish is ALSO published to
17
- * a {@link RunEventSink} (the in-process live bus), giving operator surfaces
18
- * sub-run visibility the on-disk recorder can't (it flushes only at start/finish).
19
- *
20
- * Broadcast is best-effort and additive, exactly like the Phoenix exporter path:
21
- * the inner recorder is the source of truth for the returned summary, and a
22
- * publish failure never changes the run outcome (publish is wrapped and the bus's
23
- * own `publish` is contracted never to throw). `seq` is left 0 here — the bus
24
- * stamps a process-wide monotonic value on publish.
25
- */
26
- export declare function createBroadcastRunRecorder(inner: RunRecorder, sink: RunEventSink, ctx: BroadcastRunContext): RunRecorder;
27
- //# sourceMappingURL=broadcast-recorder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcast-recorder.d.ts","sourceRoot":"","sources":["../src/broadcast-recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAmD,MAAM,2BAA2B,CAAC;AAE9G,6DAA6D;AAC7D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,mBAAmB,GACvB,WAAW,CAyFb"}
@@ -1,104 +0,0 @@
1
- import { LIVE_EVENT_SCHEMA } from "@mono-agent/agent-contracts";
2
- import { redactJsonValue } from "@mono-agent/observability";
3
- /**
4
- * Wrap a {@link RunRecorder} so every run start/event/finish is ALSO published to
5
- * a {@link RunEventSink} (the in-process live bus), giving operator surfaces
6
- * sub-run visibility the on-disk recorder can't (it flushes only at start/finish).
7
- *
8
- * Broadcast is best-effort and additive, exactly like the Phoenix exporter path:
9
- * the inner recorder is the source of truth for the returned summary, and a
10
- * publish failure never changes the run outcome (publish is wrapped and the bus's
11
- * own `publish` is contracted never to throw). `seq` is left 0 here — the bus
12
- * stamps a process-wide monotonic value on publish.
13
- */
14
- export function createBroadcastRunRecorder(inner, sink, ctx) {
15
- let eventIndex = 0;
16
- let terminalStarted = false;
17
- let terminalPromise;
18
- const publish = (frame) => {
19
- try {
20
- sink.publish(frame);
21
- }
22
- catch {
23
- // Broadcast is best-effort; a sink failure must never break the run.
24
- }
25
- };
26
- const finished = async (summary) => {
27
- const redactedSummary = redactJsonValue(summary);
28
- publish({
29
- t: "run_finished",
30
- schema: LIVE_EVENT_SCHEMA,
31
- sourceId: ctx.sourceId,
32
- runId: ctx.runId,
33
- status: redactedSummary.status,
34
- summary: redactedSummary,
35
- seq: 0,
36
- });
37
- return summary;
38
- };
39
- const recorder = {
40
- onEvent(event) {
41
- // Terminal is a hard boundary in the live protocol. Events accepted after
42
- // commit starts could otherwise appear after `run_finished` or be absent
43
- // from the authoritative summary/export.
44
- if (terminalStarted)
45
- return;
46
- inner.onEvent(event);
47
- const redactedEvent = redactJsonValue(event);
48
- publish({
49
- t: "event",
50
- schema: LIVE_EVENT_SCHEMA,
51
- sourceId: ctx.sourceId,
52
- runId: ctx.runId,
53
- eventIndex: eventIndex++,
54
- event: redactedEvent,
55
- seq: 0,
56
- });
57
- },
58
- async prepareFinish(result) {
59
- await inner.prepareFinish?.(result);
60
- },
61
- async commitFinish(result) {
62
- if (terminalPromise === undefined) {
63
- terminalStarted = true;
64
- terminalPromise = (async () => await finished(inner.commitFinish === undefined ? await inner.finish(result) : await inner.commitFinish(result)))();
65
- }
66
- return await terminalPromise;
67
- },
68
- async finish(result) {
69
- await recorder.prepareFinish?.(result);
70
- return await recorder.commitFinish(result);
71
- },
72
- async fail(error) {
73
- if (terminalPromise === undefined) {
74
- terminalStarted = true;
75
- terminalPromise = (async () => await finished(await inner.fail(error)))();
76
- }
77
- return await terminalPromise;
78
- },
79
- };
80
- // `start` is optional on RunRecorder — only expose (and emit run_started) when
81
- // the inner recorder has one, so callers that probe `recorder.start?.()` behave
82
- // identically to the unwrapped recorder.
83
- if (inner.start !== undefined) {
84
- const innerStart = inner.start.bind(inner);
85
- recorder.start = async () => {
86
- const summary = await innerStart();
87
- publish({
88
- t: "run_started",
89
- schema: LIVE_EVENT_SCHEMA,
90
- sourceId: ctx.sourceId,
91
- ...(ctx.sourceLabel === undefined ? {} : { sourceLabel: ctx.sourceLabel }),
92
- runId: ctx.runId,
93
- conversationId: ctx.conversationId,
94
- ...(ctx.source === undefined ? {} : { source: ctx.source }),
95
- ...(ctx.sourceDetail === undefined ? {} : { sourceDetail: ctx.sourceDetail }),
96
- startedAt: summary.startedAt ?? new Date().toISOString(),
97
- seq: 0,
98
- });
99
- return summary;
100
- };
101
- }
102
- return recorder;
103
- }
104
- //# sourceMappingURL=broadcast-recorder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcast-recorder.js","sourceRoot":"","sources":["../src/broadcast-recorder.ts"],"names":[],"mappings":"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"}
@@ -1,12 +0,0 @@
1
- import type { LiveAdapterConfig, LiveAdapterHandle, LiveAdapterOptions } from "@mono-agent/operator-adapter";
2
- import type { ChannelDriver } from "../channels.js";
3
- export interface LiveChannelOverrides {
4
- readonly adapterFactory?: (options: LiveAdapterOptions) => Promise<LiveAdapterHandle>;
5
- }
6
- /**
7
- * The live event relay is enabled by default on loopback so read-only operator
8
- * surfaces (the `@mono-agent/session-web` PWA) can observe a running agent
9
- * without a per-agent config edit.
10
- */
11
- export declare function createLiveChannelDriver(overrides?: LiveChannelOverrides): ChannelDriver<LiveAdapterConfig>;
12
- //# sourceMappingURL=live.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../src/channel-drivers/live.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACvF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,oBAAyB,GACnC,aAAa,CAAC,iBAAiB,CAAC,CAsClC"}
@@ -1,48 +0,0 @@
1
- import { buildChannelConfigView } from "../channel-config-view.js";
2
- let liveModule;
3
- const loadLiveModule = async () => (liveModule ??= await import("@mono-agent/operator-adapter"));
4
- /**
5
- * The live event relay is enabled by default on loopback so read-only operator
6
- * surfaces (the `@mono-agent/session-web` PWA) can observe a running agent
7
- * without a per-agent config edit.
8
- */
9
- export function createLiveChannelDriver(overrides = {}) {
10
- return {
11
- id: "live",
12
- label: "Live",
13
- async configView(input) {
14
- const adapter = await loadLiveModule();
15
- return await buildChannelConfigView(this, adapter.LIVE_CONFIG_FIELDS, input, { jsonKey: "live" });
16
- },
17
- async loadConfig(input) {
18
- const adapter = await loadLiveModule();
19
- return await adapter.loadLiveAdapterConfig({ env: input.env, jsonPath: input.configPath });
20
- },
21
- isConfigError(error) {
22
- return liveModule !== undefined && error instanceof liveModule.LiveAdapterError;
23
- },
24
- disabledReason(config) {
25
- return config.enabled ? undefined : "Live event relay is disabled.";
26
- },
27
- async start(input) {
28
- const adapterModule = await loadLiveModule();
29
- const adapterFactory = overrides.adapterFactory ?? adapterModule.startLiveAdapter;
30
- const bus = input.liveEventBus ?? adapterModule.createLiveEventBus();
31
- const adapter = await adapterFactory({
32
- bus,
33
- host: input.config.host,
34
- port: input.config.port,
35
- basePath: input.config.basePath,
36
- allowNonLoopback: input.config.allowNonLoopback,
37
- ...(input.config.apiKey === undefined ? {} : { apiKey: input.config.apiKey }),
38
- onServerError: (reason) => input.onFailure(reason),
39
- ...(input.logger === undefined ? {} : { logger: input.logger }),
40
- });
41
- return {
42
- summary: { baseUrl: adapter.baseUrl },
43
- stop: () => adapter.stop(),
44
- };
45
- },
46
- };
47
- }
48
- //# sourceMappingURL=live.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"live.js","sourceRoot":"","sources":["../../src/channel-drivers/live.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAKnE,IAAI,UAAyC,CAAC;AAC9C,MAAM,cAAc,GAAG,KAAK,IAAgC,EAAE,CAC5D,CAAC,UAAU,KAAK,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAkC,EAAE;IAEpC,OAAO;QACL,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,KAAK,CAAC,UAAU,CAAC,KAAK;YACpB,MAAM,OAAO,GAAG,MAAM,cAAc,EAAE,CAAC;YACvC,OAAO,MAAM,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACpG,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,KAAK;YACpB,MAAM,OAAO,GAAG,MAAM,cAAc,EAAE,CAAC;YACvC,OAAO,MAAM,OAAO,CAAC,qBAAqB,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,aAAa,CAAC,KAAK;YACjB,OAAO,UAAU,KAAK,SAAS,IAAI,KAAK,YAAY,UAAU,CAAC,gBAAgB,CAAC;QAClF,CAAC;QACD,cAAc,CAAC,MAAM;YACnB,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC;QACtE,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,KAAK;YACf,MAAM,aAAa,GAAG,MAAM,cAAc,EAAE,CAAC;YAC7C,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,IAAI,aAAa,CAAC,gBAAgB,CAAC;YAClF,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,IAAI,aAAa,CAAC,kBAAkB,EAAE,CAAC;YACrE,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC;gBACnC,GAAG;gBACH,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;gBACvB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;gBACvB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;gBAC/B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB;gBAC/C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC7E,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;gBAClD,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;aAChE,CAAC,CAAC;YACH,OAAO;gBACL,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;aAC3B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -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"}