@mono-agent/agent-app 0.11.2 → 0.11.4

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 (374) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +222 -26
  3. package/dist/adapter-send-tools-main.js +7 -1
  4. package/dist/adapter-send-tools-main.js.map +1 -1
  5. package/dist/adapter-send-tools.d.ts +19 -1
  6. package/dist/adapter-send-tools.d.ts.map +1 -1
  7. package/dist/adapter-send-tools.js +127 -13
  8. package/dist/adapter-send-tools.js.map +1 -1
  9. package/dist/app-config.d.ts.map +1 -1
  10. package/dist/app-config.js +15 -2
  11. package/dist/app-config.js.map +1 -1
  12. package/dist/app-controller-channels.d.ts +8 -0
  13. package/dist/app-controller-channels.d.ts.map +1 -0
  14. package/dist/app-controller-channels.js +207 -0
  15. package/dist/app-controller-channels.js.map +1 -0
  16. package/dist/app-controller-continuation.d.ts +26 -0
  17. package/dist/app-controller-continuation.d.ts.map +1 -0
  18. package/dist/app-controller-continuation.js +198 -0
  19. package/dist/app-controller-continuation.js.map +1 -0
  20. package/dist/app-controller-lifecycle.d.ts +6 -0
  21. package/dist/app-controller-lifecycle.d.ts.map +1 -0
  22. package/dist/app-controller-lifecycle.js +81 -0
  23. package/dist/app-controller-lifecycle.js.map +1 -0
  24. package/dist/app-controller-maintenance.d.ts +13 -0
  25. package/dist/app-controller-maintenance.d.ts.map +1 -0
  26. package/dist/app-controller-maintenance.js +180 -0
  27. package/dist/app-controller-maintenance.js.map +1 -0
  28. package/dist/app-controller-memory-health.d.ts +12 -0
  29. package/dist/app-controller-memory-health.d.ts.map +1 -0
  30. package/dist/app-controller-memory-health.js +160 -0
  31. package/dist/app-controller-memory-health.js.map +1 -0
  32. package/dist/app-controller-memory.d.ts +9 -0
  33. package/dist/app-controller-memory.d.ts.map +1 -0
  34. package/dist/app-controller-memory.js +83 -0
  35. package/dist/app-controller-memory.js.map +1 -0
  36. package/dist/app-controller-responder.d.ts +20 -0
  37. package/dist/app-controller-responder.d.ts.map +1 -0
  38. package/dist/app-controller-responder.js +246 -0
  39. package/dist/app-controller-responder.js.map +1 -0
  40. package/dist/app-controller-traceability.d.ts +25 -0
  41. package/dist/app-controller-traceability.d.ts.map +1 -0
  42. package/dist/app-controller-traceability.js +418 -0
  43. package/dist/app-controller-traceability.js.map +1 -0
  44. package/dist/app-controller-utils.d.ts +38 -0
  45. package/dist/app-controller-utils.d.ts.map +1 -0
  46. package/dist/app-controller-utils.js +185 -0
  47. package/dist/app-controller-utils.js.map +1 -0
  48. package/dist/app-controller.d.ts +400 -0
  49. package/dist/app-controller.d.ts.map +1 -0
  50. package/dist/app-controller.js +336 -0
  51. package/dist/app-controller.js.map +1 -0
  52. package/dist/app.d.ts +7 -115
  53. package/dist/app.d.ts.map +1 -1
  54. package/dist/app.js +6 -1912
  55. package/dist/app.js.map +1 -1
  56. package/dist/artifact-retention.d.ts +4 -0
  57. package/dist/artifact-retention.d.ts.map +1 -1
  58. package/dist/artifact-retention.js +38 -0
  59. package/dist/artifact-retention.js.map +1 -1
  60. package/dist/backfill.d.ts +3 -1
  61. package/dist/backfill.d.ts.map +1 -1
  62. package/dist/backfill.js +5 -1
  63. package/dist/backfill.js.map +1 -1
  64. package/dist/background-runtime.d.ts +27 -0
  65. package/dist/background-runtime.d.ts.map +1 -1
  66. package/dist/background-runtime.js +383 -205
  67. package/dist/background-runtime.js.map +1 -1
  68. package/dist/background-worker-lease.d.ts.map +1 -1
  69. package/dist/background-worker-lease.js +41 -241
  70. package/dist/background-worker-lease.js.map +1 -1
  71. package/dist/background.d.ts +31 -9
  72. package/dist/background.d.ts.map +1 -1
  73. package/dist/background.js +543 -272
  74. package/dist/background.js.map +1 -1
  75. package/dist/channel-drivers/cron.d.ts +11 -0
  76. package/dist/channel-drivers/cron.d.ts.map +1 -0
  77. package/dist/channel-drivers/cron.js +168 -0
  78. package/dist/channel-drivers/cron.js.map +1 -0
  79. package/dist/channel-drivers/live.d.ts +11 -0
  80. package/dist/channel-drivers/live.d.ts.map +1 -0
  81. package/dist/channel-drivers/live.js +47 -0
  82. package/dist/channel-drivers/live.js.map +1 -0
  83. package/dist/channel-drivers/native-notify.d.ts +27 -0
  84. package/dist/channel-drivers/native-notify.d.ts.map +1 -0
  85. package/dist/channel-drivers/native-notify.js +94 -0
  86. package/dist/channel-drivers/native-notify.js.map +1 -0
  87. package/dist/channel-drivers/openai-api.d.ts +7 -0
  88. package/dist/channel-drivers/openai-api.d.ts.map +1 -0
  89. package/dist/channel-drivers/openai-api.js +63 -0
  90. package/dist/channel-drivers/openai-api.js.map +1 -0
  91. package/dist/channel-drivers/shared.d.ts +4 -0
  92. package/dist/channel-drivers/shared.d.ts.map +1 -0
  93. package/dist/channel-drivers/shared.js +5 -0
  94. package/dist/channel-drivers/shared.js.map +1 -0
  95. package/dist/channel-drivers/slack.d.ts +14 -0
  96. package/dist/channel-drivers/slack.d.ts.map +1 -0
  97. package/dist/channel-drivers/slack.js +227 -0
  98. package/dist/channel-drivers/slack.js.map +1 -0
  99. package/dist/channel-drivers/telegram.d.ts +11 -0
  100. package/dist/channel-drivers/telegram.d.ts.map +1 -0
  101. package/dist/channel-drivers/telegram.js +244 -0
  102. package/dist/channel-drivers/telegram.js.map +1 -0
  103. package/dist/channel-drivers/tui.d.ts +15 -0
  104. package/dist/channel-drivers/tui.d.ts.map +1 -0
  105. package/dist/channel-drivers/tui.js +108 -0
  106. package/dist/channel-drivers/tui.js.map +1 -0
  107. package/dist/channel-drivers/webhook.d.ts +7 -0
  108. package/dist/channel-drivers/webhook.d.ts.map +1 -0
  109. package/dist/channel-drivers/webhook.js +115 -0
  110. package/dist/channel-drivers/webhook.js.map +1 -0
  111. package/dist/channels.d.ts +21 -81
  112. package/dist/channels.d.ts.map +1 -1
  113. package/dist/channels.js +11 -1174
  114. package/dist/channels.js.map +1 -1
  115. package/dist/cli-args.d.ts +121 -0
  116. package/dist/cli-args.d.ts.map +1 -0
  117. package/dist/cli-args.js +532 -0
  118. package/dist/cli-args.js.map +1 -0
  119. package/dist/cli-background-command.d.ts +59 -0
  120. package/dist/cli-background-command.d.ts.map +1 -0
  121. package/dist/cli-background-command.js +475 -0
  122. package/dist/cli-background-command.js.map +1 -0
  123. package/dist/cli-cancellation.d.ts +6 -0
  124. package/dist/cli-cancellation.d.ts.map +1 -0
  125. package/dist/cli-cancellation.js +23 -0
  126. package/dist/cli-cancellation.js.map +1 -0
  127. package/dist/cli-commands.d.ts +12 -0
  128. package/dist/cli-commands.d.ts.map +1 -0
  129. package/dist/cli-commands.js +306 -0
  130. package/dist/cli-commands.js.map +1 -0
  131. package/dist/cli-help.d.ts +11 -0
  132. package/dist/cli-help.d.ts.map +1 -0
  133. package/dist/cli-help.js +262 -0
  134. package/dist/cli-help.js.map +1 -0
  135. package/dist/cli-init-command.d.ts +60 -0
  136. package/dist/cli-init-command.d.ts.map +1 -0
  137. package/dist/cli-init-command.js +1910 -0
  138. package/dist/cli-init-command.js.map +1 -0
  139. package/dist/cli-install-skill-command.d.ts +3 -0
  140. package/dist/cli-install-skill-command.d.ts.map +1 -0
  141. package/dist/cli-install-skill-command.js +51 -0
  142. package/dist/cli-install-skill-command.js.map +1 -0
  143. package/dist/cli-sandbox-command.d.ts +10 -0
  144. package/dist/cli-sandbox-command.d.ts.map +1 -0
  145. package/dist/cli-sandbox-command.js +100 -0
  146. package/dist/cli-sandbox-command.js.map +1 -0
  147. package/dist/cli-validate-config-command.d.ts +36 -0
  148. package/dist/cli-validate-config-command.d.ts.map +1 -0
  149. package/dist/cli-validate-config-command.js +317 -0
  150. package/dist/cli-validate-config-command.js.map +1 -0
  151. package/dist/cli.d.ts +6 -248
  152. package/dist/cli.d.ts.map +1 -1
  153. package/dist/cli.js +6 -3792
  154. package/dist/cli.js.map +1 -1
  155. package/dist/config-reference.d.ts +2 -1
  156. package/dist/config-reference.d.ts.map +1 -1
  157. package/dist/config-reference.js +34 -8
  158. package/dist/config-reference.js.map +1 -1
  159. package/dist/configured-agent.d.ts +23 -0
  160. package/dist/configured-agent.d.ts.map +1 -1
  161. package/dist/configured-agent.js +92 -13
  162. package/dist/configured-agent.js.map +1 -1
  163. package/dist/continuation-dispatch-worker.d.ts +21 -0
  164. package/dist/continuation-dispatch-worker.d.ts.map +1 -0
  165. package/dist/continuation-dispatch-worker.js +425 -0
  166. package/dist/continuation-dispatch-worker.js.map +1 -0
  167. package/dist/continuation-http-routes.d.ts +15 -0
  168. package/dist/continuation-http-routes.d.ts.map +1 -0
  169. package/dist/continuation-http-routes.js +265 -0
  170. package/dist/continuation-http-routes.js.map +1 -0
  171. package/dist/continuation-operator-api.d.ts +18 -0
  172. package/dist/continuation-operator-api.d.ts.map +1 -0
  173. package/dist/continuation-operator-api.js +164 -0
  174. package/dist/continuation-operator-api.js.map +1 -0
  175. package/dist/continuation-origin-store.d.ts +19 -0
  176. package/dist/continuation-origin-store.d.ts.map +1 -0
  177. package/dist/continuation-origin-store.js +273 -0
  178. package/dist/continuation-origin-store.js.map +1 -0
  179. package/dist/continuation-service-errors.d.ts +18 -0
  180. package/dist/continuation-service-errors.d.ts.map +1 -0
  181. package/dist/continuation-service-errors.js +35 -0
  182. package/dist/continuation-service-errors.js.map +1 -0
  183. package/dist/continuation-service-helpers.d.ts +39 -0
  184. package/dist/continuation-service-helpers.d.ts.map +1 -0
  185. package/dist/continuation-service-helpers.js +308 -0
  186. package/dist/continuation-service-helpers.js.map +1 -0
  187. package/dist/continuation-service-origin.d.ts +55 -0
  188. package/dist/continuation-service-origin.d.ts.map +1 -0
  189. package/dist/continuation-service-origin.js +325 -0
  190. package/dist/continuation-service-origin.js.map +1 -0
  191. package/dist/continuation-service-types.d.ts +110 -0
  192. package/dist/continuation-service-types.d.ts.map +1 -0
  193. package/dist/continuation-service-types.js +11 -0
  194. package/dist/continuation-service-types.js.map +1 -0
  195. package/dist/continuation-service.d.ts +4 -97
  196. package/dist/continuation-service.d.ts.map +1 -1
  197. package/dist/continuation-service.js +9 -1525
  198. package/dist/continuation-service.js.map +1 -1
  199. package/dist/continuation-store-fs.d.ts +15 -0
  200. package/dist/continuation-store-fs.d.ts.map +1 -0
  201. package/dist/continuation-store-fs.js +247 -0
  202. package/dist/continuation-store-fs.js.map +1 -0
  203. package/dist/continuation-store-policy.d.ts +21 -0
  204. package/dist/continuation-store-policy.d.ts.map +1 -0
  205. package/dist/continuation-store-policy.js +278 -0
  206. package/dist/continuation-store-policy.js.map +1 -0
  207. package/dist/continuation-store-records.d.ts +9 -0
  208. package/dist/continuation-store-records.d.ts.map +1 -0
  209. package/dist/continuation-store-records.js +221 -0
  210. package/dist/continuation-store-records.js.map +1 -0
  211. package/dist/continuation-store-types.d.ts +173 -0
  212. package/dist/continuation-store-types.d.ts.map +1 -0
  213. package/dist/continuation-store-types.js +26 -0
  214. package/dist/continuation-store-types.js.map +1 -0
  215. package/dist/continuation-store.d.ts +4 -138
  216. package/dist/continuation-store.d.ts.map +1 -1
  217. package/dist/continuation-store.js +145 -1049
  218. package/dist/continuation-store.js.map +1 -1
  219. package/dist/doctor.d.ts +10 -5
  220. package/dist/doctor.d.ts.map +1 -1
  221. package/dist/doctor.js +629 -58
  222. package/dist/doctor.js.map +1 -1
  223. package/dist/init.d.ts +2 -0
  224. package/dist/init.d.ts.map +1 -1
  225. package/dist/init.js +92 -239
  226. package/dist/init.js.map +1 -1
  227. package/dist/interaction-bridge.d.ts +19 -0
  228. package/dist/interaction-bridge.d.ts.map +1 -1
  229. package/dist/interaction-bridge.js +130 -0
  230. package/dist/interaction-bridge.js.map +1 -1
  231. package/dist/launchd-logs.d.ts +91 -0
  232. package/dist/launchd-logs.d.ts.map +1 -0
  233. package/dist/launchd-logs.js +1499 -0
  234. package/dist/launchd-logs.js.map +1 -0
  235. package/dist/launchd.d.ts +27 -0
  236. package/dist/launchd.d.ts.map +1 -1
  237. package/dist/launchd.js +89 -10
  238. package/dist/launchd.js.map +1 -1
  239. package/dist/memory-command.d.ts +2 -0
  240. package/dist/memory-command.d.ts.map +1 -1
  241. package/dist/memory-command.js +161 -48
  242. package/dist/memory-command.js.map +1 -1
  243. package/dist/memory-recall-settings.d.ts +64 -0
  244. package/dist/memory-recall-settings.d.ts.map +1 -0
  245. package/dist/memory-recall-settings.js +51 -0
  246. package/dist/memory-recall-settings.js.map +1 -0
  247. package/dist/memory-recall.d.ts +7 -95
  248. package/dist/memory-recall.d.ts.map +1 -1
  249. package/dist/memory-recall.js +8 -143
  250. package/dist/memory-recall.js.map +1 -1
  251. package/dist/memory-rituals.d.ts +3 -3
  252. package/dist/memory-rituals.d.ts.map +1 -1
  253. package/dist/memory-rituals.js +16 -111
  254. package/dist/memory-rituals.js.map +1 -1
  255. package/dist/modules/catalog.js +2 -2
  256. package/dist/modules/catalog.js.map +1 -1
  257. package/dist/modules/known-tools.d.ts +8 -6
  258. package/dist/modules/known-tools.d.ts.map +1 -1
  259. package/dist/modules/known-tools.js +8 -6
  260. package/dist/modules/known-tools.js.map +1 -1
  261. package/dist/notify-destinations.d.ts +5 -0
  262. package/dist/notify-destinations.d.ts.map +1 -1
  263. package/dist/notify-destinations.js +7 -1
  264. package/dist/notify-destinations.js.map +1 -1
  265. package/dist/owner-private-lock.d.ts +95 -0
  266. package/dist/owner-private-lock.d.ts.map +1 -0
  267. package/dist/owner-private-lock.js +566 -0
  268. package/dist/owner-private-lock.js.map +1 -0
  269. package/dist/pi-oauth-login.d.ts +2 -0
  270. package/dist/pi-oauth-login.d.ts.map +1 -1
  271. package/dist/pi-oauth-login.js +39 -5
  272. package/dist/pi-oauth-login.js.map +1 -1
  273. package/dist/posted-message-index.d.ts +35 -16
  274. package/dist/posted-message-index.d.ts.map +1 -1
  275. package/dist/posted-message-index.js +1068 -52
  276. package/dist/posted-message-index.js.map +1 -1
  277. package/dist/posted-reply-history.d.ts +17 -0
  278. package/dist/posted-reply-history.d.ts.map +1 -0
  279. package/dist/posted-reply-history.js +169 -0
  280. package/dist/posted-reply-history.js.map +1 -0
  281. package/dist/proactive-notify.d.ts.map +1 -1
  282. package/dist/proactive-notify.js +6 -4
  283. package/dist/proactive-notify.js.map +1 -1
  284. package/dist/project-skills.d.ts +4 -0
  285. package/dist/project-skills.d.ts.map +1 -1
  286. package/dist/project-skills.js +99 -130
  287. package/dist/project-skills.js.map +1 -1
  288. package/dist/provider-setup.d.ts +0 -1
  289. package/dist/provider-setup.d.ts.map +1 -1
  290. package/dist/provider-setup.js +0 -3
  291. package/dist/provider-setup.js.map +1 -1
  292. package/dist/readiness-probe-worker.d.ts +61 -1
  293. package/dist/readiness-probe-worker.d.ts.map +1 -1
  294. package/dist/readiness-probe-worker.js +54 -58
  295. package/dist/readiness-probe-worker.js.map +1 -1
  296. package/dist/readiness-probe.d.ts +6 -9
  297. package/dist/readiness-probe.d.ts.map +1 -1
  298. package/dist/readiness-probe.js +30 -56
  299. package/dist/readiness-probe.js.map +1 -1
  300. package/dist/redact-secrets.d.ts +15 -0
  301. package/dist/redact-secrets.d.ts.map +1 -0
  302. package/dist/redact-secrets.js +65 -0
  303. package/dist/redact-secrets.js.map +1 -0
  304. package/dist/run-history.js +34 -24
  305. package/dist/run-history.js.map +1 -1
  306. package/dist/runtime-provenance.d.ts +8 -0
  307. package/dist/runtime-provenance.d.ts.map +1 -0
  308. package/dist/runtime-provenance.js +225 -0
  309. package/dist/runtime-provenance.js.map +1 -0
  310. package/dist/sandbox-manager.d.ts +4 -1
  311. package/dist/sandbox-manager.d.ts.map +1 -1
  312. package/dist/sandbox-manager.js +114 -273
  313. package/dist/sandbox-manager.js.map +1 -1
  314. package/dist/secure-file-replace.d.ts +49 -0
  315. package/dist/secure-file-replace.d.ts.map +1 -0
  316. package/dist/secure-file-replace.js +270 -0
  317. package/dist/secure-file-replace.js.map +1 -0
  318. package/dist/seen-conversations.d.ts +32 -5
  319. package/dist/seen-conversations.d.ts.map +1 -1
  320. package/dist/seen-conversations.js +145 -15
  321. package/dist/seen-conversations.js.map +1 -1
  322. package/dist/sessions.d.ts +20 -0
  323. package/dist/sessions.d.ts.map +1 -1
  324. package/dist/sessions.js +41 -6
  325. package/dist/sessions.js.map +1 -1
  326. package/dist/wizard/index.d.ts +2 -2
  327. package/dist/wizard/index.d.ts.map +1 -1
  328. package/dist/wizard/index.js +1 -1
  329. package/dist/wizard/index.js.map +1 -1
  330. package/dist/wizard/presets.d.ts +2 -1
  331. package/dist/wizard/presets.d.ts.map +1 -1
  332. package/dist/wizard/presets.js +2 -1
  333. package/dist/wizard/presets.js.map +1 -1
  334. package/dist/wizard/run.d.ts +0 -26
  335. package/dist/wizard/run.d.ts.map +1 -1
  336. package/dist/wizard/run.js +0 -53
  337. package/dist/wizard/run.js.map +1 -1
  338. package/package.json +22 -17
  339. package/schema/mono-agent.config.schema.json +45 -10
  340. package/skills/mono-agent-composer/SKILL.md +3 -3
  341. package/skills/mono-agent-composer/references/config-blueprint.md +123 -29
  342. package/skills/mono-agent-composer/references/discovery-questions.md +10 -8
  343. package/skills/mono-agent-composer/references/feature-coverage.md +90 -76
  344. package/skills/mono-agent-composer/references/package-map.md +6 -4
  345. package/skills/mono-agent-composer/references/playbooks.md +48 -27
  346. package/skills/mono-agent-composer/references/validation.md +16 -3
  347. package/dist/notify-runtime.d.ts +0 -26
  348. package/dist/notify-runtime.d.ts.map +0 -1
  349. package/dist/notify-runtime.js +0 -27
  350. package/dist/notify-runtime.js.map +0 -1
  351. package/dist/notify-tool.d.ts +0 -51
  352. package/dist/notify-tool.d.ts.map +0 -1
  353. package/dist/notify-tool.js +0 -182
  354. package/dist/notify-tool.js.map +0 -1
  355. package/dist/recipes/base.d.ts +0 -15
  356. package/dist/recipes/base.d.ts.map +0 -1
  357. package/dist/recipes/base.js +0 -51
  358. package/dist/recipes/base.js.map +0 -1
  359. package/dist/recipes/catalog.d.ts +0 -4
  360. package/dist/recipes/catalog.d.ts.map +0 -1
  361. package/dist/recipes/catalog.js +0 -525
  362. package/dist/recipes/catalog.js.map +0 -1
  363. package/dist/recipes/index.d.ts +0 -11
  364. package/dist/recipes/index.d.ts.map +0 -1
  365. package/dist/recipes/index.js +0 -14
  366. package/dist/recipes/index.js.map +0 -1
  367. package/dist/recipes/types.d.ts +0 -70
  368. package/dist/recipes/types.d.ts.map +0 -1
  369. package/dist/recipes/types.js +0 -15
  370. package/dist/recipes/types.js.map +0 -1
  371. package/dist/setup.d.ts +0 -29
  372. package/dist/setup.d.ts.map +0 -1
  373. package/dist/setup.js +0 -97
  374. package/dist/setup.js.map +0 -1
@@ -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"}
@@ -1,182 +0,0 @@
1
- import { createServer } from "node:http";
2
- import { randomBytes, timingSafeEqual } from "node:crypto";
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
5
- import * as z from "zod/v4";
6
- /**
7
- * In-process MCP server that exposes the proactive-notification tools to the agent.
8
- *
9
- * Unlike `memory_recall`/the adapter send tools (stdio children that re-derive
10
- * everything from config/disk), notification delivery has to run a real turn on a
11
- * destination channel's LIVE session, so the handler must reach the app's running
12
- * channel registry — which only exists in this process. We therefore host the
13
- * tools over loopback HTTP (the one MCP transport the runtime's client supports
14
- * for an in-process server) and close over app-supplied delivery/discovery hooks.
15
- *
16
- * Two tools, both intended for proactive cron/webhook turns (the runtime extension
17
- * only injects this server for those):
18
- * - `list_notify_destinations` — discover the conversations the agent may notify
19
- * (answers "how do I get a conversationId?" when there is no triggering payload).
20
- * - `notify_conversation` — deliver a message as a real turn into one of them.
21
- */
22
- export const NOTIFY_TOOLS_MCP_SERVER_NAME = "mono-agent-notify";
23
- const MCP_PATH = "/mcp";
24
- /**
25
- * Start the in-process notify MCP server on an ephemeral loopback port. Stateless:
26
- * each request gets a fresh `McpServer`+transport (the tools are pure request/response),
27
- * which sidesteps session bookkeeping and concurrent-trigger races.
28
- */
29
- export async function startNotifyToolsServer(deps) {
30
- const token = randomBytes(24).toString("hex");
31
- const expectedAuth = `Bearer ${token}`;
32
- const httpServer = createServer((req, res) => {
33
- void handleHttpRequest(req, res, expectedAuth, deps);
34
- });
35
- await new Promise((resolve, reject) => {
36
- const onError = (error) => reject(error);
37
- httpServer.once("error", onError);
38
- httpServer.listen(0, "127.0.0.1", () => {
39
- httpServer.removeListener("error", onError);
40
- resolve();
41
- });
42
- });
43
- const address = httpServer.address();
44
- if (address === null || typeof address === "string") {
45
- httpServer.close();
46
- throw new Error("notify tools server: failed to bind a loopback port.");
47
- }
48
- const url = `http://127.0.0.1:${address.port}${MCP_PATH}`;
49
- return {
50
- url,
51
- token,
52
- close: () => new Promise((resolve) => {
53
- httpServer.close(() => resolve());
54
- }),
55
- };
56
- }
57
- async function handleHttpRequest(req, res, expectedAuth, deps) {
58
- if (!isAuthorized(req, expectedAuth)) {
59
- res.writeHead(401, { "content-type": "application/json" });
60
- res.end(JSON.stringify({ error: "unauthorized" }));
61
- return;
62
- }
63
- if (req.url?.split("?", 1)[0] !== MCP_PATH) {
64
- res.writeHead(404, { "content-type": "application/json" });
65
- res.end(JSON.stringify({ error: "not found" }));
66
- return;
67
- }
68
- // Stateless: only POST carries JSON-RPC. The single tool round-trips are
69
- // request/response, so reject the optional GET/DELETE session streams.
70
- if (req.method !== "POST") {
71
- res.writeHead(405, { "content-type": "application/json", allow: "POST" });
72
- res.end(JSON.stringify({ error: "method not allowed" }));
73
- return;
74
- }
75
- const server = buildMcpServer(deps);
76
- // Stateless: omitting sessionIdGenerator runs the transport without session
77
- // tracking, so a fresh server+transport per request is the correct pattern and
78
- // concurrent triggers never share state.
79
- const transport = new StreamableHTTPServerTransport({});
80
- // Idempotent: with HTTP keep-alive the response can `finish` without firing
81
- // `close`, so bind both and guard against a double-close leaking nothing.
82
- let cleaned = false;
83
- const cleanup = () => {
84
- if (cleaned)
85
- return;
86
- cleaned = true;
87
- void transport.close();
88
- void server.close();
89
- };
90
- res.on("close", cleanup);
91
- res.on("finish", cleanup);
92
- try {
93
- // The transport implements the SDK Transport interface at runtime; the cast
94
- // bridges an exactOptionalPropertyTypes mismatch in the SDK's own typings.
95
- await server.connect(transport);
96
- await transport.handleRequest(req, res);
97
- }
98
- catch (error) {
99
- deps.logger?.error?.("notify tools server: request failed.", { reason: reasonOf(error) });
100
- if (!res.headersSent) {
101
- res.writeHead(500, { "content-type": "application/json" });
102
- res.end(JSON.stringify({ error: "internal error" }));
103
- }
104
- }
105
- }
106
- function isAuthorized(req, expectedAuth) {
107
- const header = req.headers.authorization;
108
- if (typeof header !== "string") {
109
- return false;
110
- }
111
- const a = Buffer.from(header);
112
- const b = Buffer.from(expectedAuth);
113
- return a.length === b.length && timingSafeEqual(a, b);
114
- }
115
- function buildMcpServer(deps) {
116
- const server = new McpServer({ name: "agent-notify-tools", version: "0.1.0" });
117
- server.registerTool("list_notify_destinations", {
118
- title: "List notification destinations",
119
- description: "List the conversations you can proactively deliver a message to with notify_conversation. " +
120
- "Use this when you have no triggering conversationId in hand (e.g. a scheduled/cron run) to " +
121
- "discover where to reach the user. Each entry's `conversationId` is what notify_conversation " +
122
- "expects — read its description for how delivery works (the destination turn's reply is what is sent).",
123
- inputSchema: {},
124
- }, async () => {
125
- const destinations = await deps.listDestinations();
126
- const lines = destinations.length === 0
127
- ? ["(no known destinations yet — the agent has not handled any push-channel conversation and no single allowlisted destination is configured)"]
128
- : destinations.map((d) => `- ${d.conversationId}${d.lastSeen === undefined ? "" : ` (last active ${d.lastSeen})`}${d.fromAllowlist === true ? " (allowlisted, not yet used)" : ""}`);
129
- return {
130
- content: [{ type: "text", text: ["Conversations you can notify:", ...lines].join("\n") }],
131
- structuredContent: { destinations },
132
- };
133
- });
134
- server.registerTool("notify_conversation", {
135
- title: "Notify a conversation",
136
- description: "Proactively deliver a message into a conversation you are not currently handling. The message " +
137
- "runs as a real turn on that conversation's own session and THAT TURN'S REPLY is what the user " +
138
- "receives (so the user sees it natively and the conversation remembers it). Use this to follow up " +
139
- "from a cron job or an inbound webhook callback.\n\n" +
140
- "How `text` is delivered (read carefully — this is the #1 mistake):\n" +
141
- "- `text` is the stimulus the destination conversation acts on; it is NOT posted verbatim. The " +
142
- "destination agent reads `text` and composes the user-facing reply with its own context, and that " +
143
- "reply is delivered automatically.\n" +
144
- "- To deliver pre-composed or exact content (e.g. a digest), phrase `text` as an explicit reply " +
145
- "instruction, e.g.: \"Reply with the text below exactly as written, adding nothing, and do not call " +
146
- "any tools — your reply is delivered automatically:\\n\\n<your content>\".\n" +
147
- "- The destination must NOT call its own send tools (e.g. slack_send_message) — its reply is already " +
148
- "delivered, so sending again posts the message twice.\n\n" +
149
- "How to choose `conversationId`:\n" +
150
- "- Webhook/async callback: pass the `conversationId` carried in the triggering request payload.\n" +
151
- "- Otherwise (e.g. a scheduled run): call list_notify_destinations first and pick from it.\n\n" +
152
- "Delivery is bounded by the channel allowlist and may return delivered:false (e.g. unknown/disallowed " +
153
- "id, channel offline). The call blocks until the destination turn replies, so keep that turn to a single " +
154
- "reply — a turn that re-scans, recalls, or hunts for a send tool is slow and can hit the request timeout. " +
155
- "If you receive delivered:false, do not assume it was also delivered some other way.",
156
- inputSchema: {
157
- conversationId: z
158
- .string()
159
- .min(1)
160
- .describe("Destination conversationId, e.g. telegram:42 or slack:C123 (or slack:C123:1718.99 for a thread)."),
161
- text: z
162
- .string()
163
- .min(1)
164
- .describe("What to deliver. The destination conversation runs this as a turn and its reply is delivered; " +
165
- "to deliver exact content, phrase this as a reply-verbatim, no-tools instruction (see the tool description)."),
166
- },
167
- }, async (args) => {
168
- const result = await deps.deliver(args.conversationId, args.text);
169
- const summary = result.delivered
170
- ? `Delivered to ${args.conversationId}.`
171
- : `Not delivered to ${args.conversationId}${result.reason === undefined ? "" : `: ${result.reason}`}.`;
172
- return {
173
- content: [{ type: "text", text: summary }],
174
- structuredContent: { delivered: result.delivered, ...(result.reason === undefined ? {} : { reason: result.reason }) },
175
- };
176
- });
177
- return server;
178
- }
179
- function reasonOf(error) {
180
- return error instanceof Error ? error.message : String(error);
181
- }
182
- //# sourceMappingURL=notify-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notify-tool.js","sourceRoot":"","sources":["../src/notify-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAK5B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AA8BhE,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAAqB;IAChE,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,UAAU,KAAK,EAAE,CAAC;IAEvC,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3C,KAAK,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,CAAC,KAAY,EAAQ,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtD,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClC,UAAU,CAAC,MAAM,CAA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Q,CACP,gGAAgG;gBAC9F,6GAA6G,CAChH;SACJ;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS;YAC9B,CAAC,CAAC,gBAAgB,IAAI,CAAC,cAAc,GAAG;YACxC,CAAC,CAAC,oBAAoB,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;QACzG,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;YAC1C,iBAAiB,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;SACtH,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { MonoAgentConfigJson } from "@mono-agent/config";
2
- import type { RecipeInput, RecipeInputValues } from "./types.js";
3
- export declare const DEFAULT_MODEL = "claude:claude-sonnet-4-6";
4
- /** The model input every recipe shares; overridable from `--model`. */
5
- export declare const MODEL_INPUT: RecipeInput;
6
- /**
7
- * The adapter-neutral skeleton every recipe extends: runtime model, identity,
8
- * empty tool policy, local artifacts, and the trace registry. Recipes spread
9
- * this and add their channel / memory / sandbox / observability blocks. Mirrors
10
- * `init.ts`'s scaffold so a recipe-built folder matches a hand-init'd one.
11
- */
12
- export declare function baseConfig(input: RecipeInputValues): MonoAgentConfigJson;
13
- /** A `memory` block for the given tier, rooted at the standard memory path. */
14
- export declare function memoryBlock(mode: "lite" | "journal" | "bujo"): NonNullable<MonoAgentConfigJson["memory"]>;
15
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/recipes/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjE,eAAO,MAAM,aAAa,6BAA6B,CAAC;AAExD,uEAAuE;AACvE,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,mBAAmB,CA0BxE;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAChC,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAM5C"}
@@ -1,51 +0,0 @@
1
- import { monoAgentConfigWithSchema } from "../config-reference.js";
2
- export const DEFAULT_MODEL = "claude:claude-sonnet-4-6";
3
- /** The model input every recipe shares; overridable from `--model`. */
4
- export const MODEL_INPUT = {
5
- id: "model",
6
- label: "Model",
7
- description: "Primary runtime model reference, e.g. claude:claude-sonnet-4-6, codex:gpt-5.5, pi:ollama:gemma4:31b.",
8
- default: DEFAULT_MODEL,
9
- };
10
- /**
11
- * The adapter-neutral skeleton every recipe extends: runtime model, identity,
12
- * empty tool policy, local artifacts, and the trace registry. Recipes spread
13
- * this and add their channel / memory / sandbox / observability blocks. Mirrors
14
- * `init.ts`'s scaffold so a recipe-built folder matches a hand-init'd one.
15
- */
16
- export function baseConfig(input) {
17
- return monoAgentConfigWithSchema({
18
- runtime: {
19
- model: input.model ?? DEFAULT_MODEL,
20
- workspace: ".",
21
- },
22
- context: {
23
- identityPath: "./IDENTITY.md",
24
- selectedSkills: [],
25
- },
26
- tools: {
27
- allowedTools: [],
28
- disallowedTools: [],
29
- },
30
- artifacts: {
31
- dir: "./.mono-agent/artifacts",
32
- retention: {
33
- maxAgeDays: 365,
34
- maxCount: 50000,
35
- dryRun: false,
36
- },
37
- },
38
- traceability: {
39
- registryDir: "./.mono-agent/trace-sources",
40
- },
41
- });
42
- }
43
- /** A `memory` block for the given tier, rooted at the standard memory path. */
44
- export function memoryBlock(mode) {
45
- return {
46
- mode,
47
- path: "./.mono-agent/memory",
48
- writeMode: mode === "bujo" ? "capture" : "append-host-summary",
49
- };
50
- }
51
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/recipes/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;AAExD,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,sGAAsG;IACnH,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAwB;IACjD,OAAO,yBAAyB,CAAC;QAC/B,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,aAAa;YACnC,SAAS,EAAE,GAAG;SACf;QACD,OAAO,EAAE;YACP,YAAY,EAAE,eAAe;YAC7B,cAAc,EAAE,EAAE;SACnB;QACD,KAAK,EAAE;YACL,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,EAAE;SACpB;QACD,SAAS,EAAE;YACT,GAAG,EAAE,yBAAyB;YAC9B,SAAS,EAAE;gBACT,UAAU,EAAE,GAAG;gBACf,QAAQ,EAAE,KAAK;gBACf,MAAM,EAAE,KAAK;aACd;SACF;QACD,YAAY,EAAE;YACZ,WAAW,EAAE,6BAA6B;SAC3C;KACqB,CAAC,CAAC;AAC5B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CACzB,IAAiC;IAEjC,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,sBAAsB;QAC5B,SAAS,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB;KAC/D,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { AgentRecipe } from "./types.js";
2
- /** Ordered catalog — starter recipes first, then the two full blueprints. */
3
- export declare const RECIPE_CATALOG: readonly AgentRecipe[];
4
- //# sourceMappingURL=catalog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/recipes/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,YAAY,CAAC;AAqhBjE,6EAA6E;AAC7E,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAchD,CAAC"}