@mono-agent/agent-app 0.11.3 → 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 (345) hide show
  1. package/README.md +222 -26
  2. package/dist/adapter-send-tools-main.js +7 -1
  3. package/dist/adapter-send-tools-main.js.map +1 -1
  4. package/dist/adapter-send-tools.d.ts +19 -1
  5. package/dist/adapter-send-tools.d.ts.map +1 -1
  6. package/dist/adapter-send-tools.js +127 -13
  7. package/dist/adapter-send-tools.js.map +1 -1
  8. package/dist/app-config.d.ts.map +1 -1
  9. package/dist/app-config.js +15 -2
  10. package/dist/app-config.js.map +1 -1
  11. package/dist/app-controller-channels.d.ts +8 -0
  12. package/dist/app-controller-channels.d.ts.map +1 -0
  13. package/dist/app-controller-channels.js +207 -0
  14. package/dist/app-controller-channels.js.map +1 -0
  15. package/dist/app-controller-continuation.d.ts +26 -0
  16. package/dist/app-controller-continuation.d.ts.map +1 -0
  17. package/dist/app-controller-continuation.js +198 -0
  18. package/dist/app-controller-continuation.js.map +1 -0
  19. package/dist/app-controller-lifecycle.d.ts +6 -0
  20. package/dist/app-controller-lifecycle.d.ts.map +1 -0
  21. package/dist/app-controller-lifecycle.js +81 -0
  22. package/dist/app-controller-lifecycle.js.map +1 -0
  23. package/dist/app-controller-maintenance.d.ts +13 -0
  24. package/dist/app-controller-maintenance.d.ts.map +1 -0
  25. package/dist/app-controller-maintenance.js +180 -0
  26. package/dist/app-controller-maintenance.js.map +1 -0
  27. package/dist/app-controller-memory-health.d.ts +12 -0
  28. package/dist/app-controller-memory-health.d.ts.map +1 -0
  29. package/dist/app-controller-memory-health.js +160 -0
  30. package/dist/app-controller-memory-health.js.map +1 -0
  31. package/dist/app-controller-memory.d.ts +9 -0
  32. package/dist/app-controller-memory.d.ts.map +1 -0
  33. package/dist/app-controller-memory.js +83 -0
  34. package/dist/app-controller-memory.js.map +1 -0
  35. package/dist/app-controller-responder.d.ts +20 -0
  36. package/dist/app-controller-responder.d.ts.map +1 -0
  37. package/dist/app-controller-responder.js +246 -0
  38. package/dist/app-controller-responder.js.map +1 -0
  39. package/dist/app-controller-traceability.d.ts +25 -0
  40. package/dist/app-controller-traceability.d.ts.map +1 -0
  41. package/dist/app-controller-traceability.js +418 -0
  42. package/dist/app-controller-traceability.js.map +1 -0
  43. package/dist/app-controller-utils.d.ts +38 -0
  44. package/dist/app-controller-utils.d.ts.map +1 -0
  45. package/dist/app-controller-utils.js +185 -0
  46. package/dist/app-controller-utils.js.map +1 -0
  47. package/dist/app-controller.d.ts +400 -0
  48. package/dist/app-controller.d.ts.map +1 -0
  49. package/dist/app-controller.js +336 -0
  50. package/dist/app-controller.js.map +1 -0
  51. package/dist/app.d.ts +7 -115
  52. package/dist/app.d.ts.map +1 -1
  53. package/dist/app.js +6 -1912
  54. package/dist/app.js.map +1 -1
  55. package/dist/artifact-retention.d.ts +4 -0
  56. package/dist/artifact-retention.d.ts.map +1 -1
  57. package/dist/artifact-retention.js +38 -0
  58. package/dist/artifact-retention.js.map +1 -1
  59. package/dist/backfill.d.ts +3 -1
  60. package/dist/backfill.d.ts.map +1 -1
  61. package/dist/backfill.js +5 -1
  62. package/dist/backfill.js.map +1 -1
  63. package/dist/background-runtime.d.ts +27 -0
  64. package/dist/background-runtime.d.ts.map +1 -1
  65. package/dist/background-runtime.js +383 -205
  66. package/dist/background-runtime.js.map +1 -1
  67. package/dist/background-worker-lease.d.ts.map +1 -1
  68. package/dist/background-worker-lease.js +41 -241
  69. package/dist/background-worker-lease.js.map +1 -1
  70. package/dist/background.d.ts +31 -9
  71. package/dist/background.d.ts.map +1 -1
  72. package/dist/background.js +543 -272
  73. package/dist/background.js.map +1 -1
  74. package/dist/channel-drivers/cron.d.ts +11 -0
  75. package/dist/channel-drivers/cron.d.ts.map +1 -0
  76. package/dist/channel-drivers/cron.js +168 -0
  77. package/dist/channel-drivers/cron.js.map +1 -0
  78. package/dist/channel-drivers/live.d.ts +11 -0
  79. package/dist/channel-drivers/live.d.ts.map +1 -0
  80. package/dist/channel-drivers/live.js +47 -0
  81. package/dist/channel-drivers/live.js.map +1 -0
  82. package/dist/channel-drivers/native-notify.d.ts +27 -0
  83. package/dist/channel-drivers/native-notify.d.ts.map +1 -0
  84. package/dist/channel-drivers/native-notify.js +94 -0
  85. package/dist/channel-drivers/native-notify.js.map +1 -0
  86. package/dist/channel-drivers/openai-api.d.ts +7 -0
  87. package/dist/channel-drivers/openai-api.d.ts.map +1 -0
  88. package/dist/channel-drivers/openai-api.js +63 -0
  89. package/dist/channel-drivers/openai-api.js.map +1 -0
  90. package/dist/channel-drivers/shared.d.ts +4 -0
  91. package/dist/channel-drivers/shared.d.ts.map +1 -0
  92. package/dist/channel-drivers/shared.js +5 -0
  93. package/dist/channel-drivers/shared.js.map +1 -0
  94. package/dist/channel-drivers/slack.d.ts +14 -0
  95. package/dist/channel-drivers/slack.d.ts.map +1 -0
  96. package/dist/channel-drivers/slack.js +227 -0
  97. package/dist/channel-drivers/slack.js.map +1 -0
  98. package/dist/channel-drivers/telegram.d.ts +11 -0
  99. package/dist/channel-drivers/telegram.d.ts.map +1 -0
  100. package/dist/channel-drivers/telegram.js +244 -0
  101. package/dist/channel-drivers/telegram.js.map +1 -0
  102. package/dist/channel-drivers/tui.d.ts +15 -0
  103. package/dist/channel-drivers/tui.d.ts.map +1 -0
  104. package/dist/channel-drivers/tui.js +108 -0
  105. package/dist/channel-drivers/tui.js.map +1 -0
  106. package/dist/channel-drivers/webhook.d.ts +7 -0
  107. package/dist/channel-drivers/webhook.d.ts.map +1 -0
  108. package/dist/channel-drivers/webhook.js +115 -0
  109. package/dist/channel-drivers/webhook.js.map +1 -0
  110. package/dist/channels.d.ts +21 -81
  111. package/dist/channels.d.ts.map +1 -1
  112. package/dist/channels.js +11 -1174
  113. package/dist/channels.js.map +1 -1
  114. package/dist/cli-args.d.ts +121 -0
  115. package/dist/cli-args.d.ts.map +1 -0
  116. package/dist/cli-args.js +532 -0
  117. package/dist/cli-args.js.map +1 -0
  118. package/dist/cli-background-command.d.ts +59 -0
  119. package/dist/cli-background-command.d.ts.map +1 -0
  120. package/dist/cli-background-command.js +475 -0
  121. package/dist/cli-background-command.js.map +1 -0
  122. package/dist/cli-cancellation.d.ts +6 -0
  123. package/dist/cli-cancellation.d.ts.map +1 -0
  124. package/dist/cli-cancellation.js +23 -0
  125. package/dist/cli-cancellation.js.map +1 -0
  126. package/dist/cli-commands.d.ts +12 -0
  127. package/dist/cli-commands.d.ts.map +1 -0
  128. package/dist/cli-commands.js +306 -0
  129. package/dist/cli-commands.js.map +1 -0
  130. package/dist/cli-help.d.ts +11 -0
  131. package/dist/cli-help.d.ts.map +1 -0
  132. package/dist/cli-help.js +262 -0
  133. package/dist/cli-help.js.map +1 -0
  134. package/dist/cli-init-command.d.ts +60 -0
  135. package/dist/cli-init-command.d.ts.map +1 -0
  136. package/dist/cli-init-command.js +1910 -0
  137. package/dist/cli-init-command.js.map +1 -0
  138. package/dist/cli-install-skill-command.d.ts +3 -0
  139. package/dist/cli-install-skill-command.d.ts.map +1 -0
  140. package/dist/cli-install-skill-command.js +51 -0
  141. package/dist/cli-install-skill-command.js.map +1 -0
  142. package/dist/cli-sandbox-command.d.ts +10 -0
  143. package/dist/cli-sandbox-command.d.ts.map +1 -0
  144. package/dist/cli-sandbox-command.js +100 -0
  145. package/dist/cli-sandbox-command.js.map +1 -0
  146. package/dist/cli-validate-config-command.d.ts +36 -0
  147. package/dist/cli-validate-config-command.d.ts.map +1 -0
  148. package/dist/cli-validate-config-command.js +317 -0
  149. package/dist/cli-validate-config-command.js.map +1 -0
  150. package/dist/cli.d.ts +6 -248
  151. package/dist/cli.d.ts.map +1 -1
  152. package/dist/cli.js +6 -3792
  153. package/dist/cli.js.map +1 -1
  154. package/dist/config-reference.d.ts +2 -1
  155. package/dist/config-reference.d.ts.map +1 -1
  156. package/dist/config-reference.js +14 -3
  157. package/dist/config-reference.js.map +1 -1
  158. package/dist/configured-agent.d.ts +23 -0
  159. package/dist/configured-agent.d.ts.map +1 -1
  160. package/dist/configured-agent.js +89 -12
  161. package/dist/configured-agent.js.map +1 -1
  162. package/dist/continuation-dispatch-worker.d.ts +21 -0
  163. package/dist/continuation-dispatch-worker.d.ts.map +1 -0
  164. package/dist/continuation-dispatch-worker.js +425 -0
  165. package/dist/continuation-dispatch-worker.js.map +1 -0
  166. package/dist/continuation-http-routes.d.ts +15 -0
  167. package/dist/continuation-http-routes.d.ts.map +1 -0
  168. package/dist/continuation-http-routes.js +265 -0
  169. package/dist/continuation-http-routes.js.map +1 -0
  170. package/dist/continuation-operator-api.d.ts +18 -0
  171. package/dist/continuation-operator-api.d.ts.map +1 -0
  172. package/dist/continuation-operator-api.js +164 -0
  173. package/dist/continuation-operator-api.js.map +1 -0
  174. package/dist/continuation-origin-store.d.ts +19 -0
  175. package/dist/continuation-origin-store.d.ts.map +1 -0
  176. package/dist/continuation-origin-store.js +273 -0
  177. package/dist/continuation-origin-store.js.map +1 -0
  178. package/dist/continuation-service-errors.d.ts +18 -0
  179. package/dist/continuation-service-errors.d.ts.map +1 -0
  180. package/dist/continuation-service-errors.js +35 -0
  181. package/dist/continuation-service-errors.js.map +1 -0
  182. package/dist/continuation-service-helpers.d.ts +39 -0
  183. package/dist/continuation-service-helpers.d.ts.map +1 -0
  184. package/dist/continuation-service-helpers.js +308 -0
  185. package/dist/continuation-service-helpers.js.map +1 -0
  186. package/dist/continuation-service-origin.d.ts +55 -0
  187. package/dist/continuation-service-origin.d.ts.map +1 -0
  188. package/dist/continuation-service-origin.js +325 -0
  189. package/dist/continuation-service-origin.js.map +1 -0
  190. package/dist/continuation-service-types.d.ts +110 -0
  191. package/dist/continuation-service-types.d.ts.map +1 -0
  192. package/dist/continuation-service-types.js +11 -0
  193. package/dist/continuation-service-types.js.map +1 -0
  194. package/dist/continuation-service.d.ts +4 -97
  195. package/dist/continuation-service.d.ts.map +1 -1
  196. package/dist/continuation-service.js +9 -1525
  197. package/dist/continuation-service.js.map +1 -1
  198. package/dist/continuation-store-fs.d.ts +15 -0
  199. package/dist/continuation-store-fs.d.ts.map +1 -0
  200. package/dist/continuation-store-fs.js +247 -0
  201. package/dist/continuation-store-fs.js.map +1 -0
  202. package/dist/continuation-store-policy.d.ts +21 -0
  203. package/dist/continuation-store-policy.d.ts.map +1 -0
  204. package/dist/continuation-store-policy.js +278 -0
  205. package/dist/continuation-store-policy.js.map +1 -0
  206. package/dist/continuation-store-records.d.ts +9 -0
  207. package/dist/continuation-store-records.d.ts.map +1 -0
  208. package/dist/continuation-store-records.js +221 -0
  209. package/dist/continuation-store-records.js.map +1 -0
  210. package/dist/continuation-store-types.d.ts +173 -0
  211. package/dist/continuation-store-types.d.ts.map +1 -0
  212. package/dist/continuation-store-types.js +26 -0
  213. package/dist/continuation-store-types.js.map +1 -0
  214. package/dist/continuation-store.d.ts +4 -138
  215. package/dist/continuation-store.d.ts.map +1 -1
  216. package/dist/continuation-store.js +145 -1049
  217. package/dist/continuation-store.js.map +1 -1
  218. package/dist/doctor.d.ts +5 -0
  219. package/dist/doctor.d.ts.map +1 -1
  220. package/dist/doctor.js +575 -38
  221. package/dist/doctor.js.map +1 -1
  222. package/dist/init.d.ts +2 -0
  223. package/dist/init.d.ts.map +1 -1
  224. package/dist/init.js +92 -239
  225. package/dist/init.js.map +1 -1
  226. package/dist/interaction-bridge.d.ts +19 -0
  227. package/dist/interaction-bridge.d.ts.map +1 -1
  228. package/dist/interaction-bridge.js +130 -0
  229. package/dist/interaction-bridge.js.map +1 -1
  230. package/dist/launchd-logs.d.ts +91 -0
  231. package/dist/launchd-logs.d.ts.map +1 -0
  232. package/dist/launchd-logs.js +1499 -0
  233. package/dist/launchd-logs.js.map +1 -0
  234. package/dist/launchd.d.ts +27 -0
  235. package/dist/launchd.d.ts.map +1 -1
  236. package/dist/launchd.js +89 -10
  237. package/dist/launchd.js.map +1 -1
  238. package/dist/memory-command.d.ts +2 -0
  239. package/dist/memory-command.d.ts.map +1 -1
  240. package/dist/memory-command.js +161 -48
  241. package/dist/memory-command.js.map +1 -1
  242. package/dist/memory-recall-settings.d.ts +64 -0
  243. package/dist/memory-recall-settings.d.ts.map +1 -0
  244. package/dist/memory-recall-settings.js +51 -0
  245. package/dist/memory-recall-settings.js.map +1 -0
  246. package/dist/memory-recall.d.ts +7 -95
  247. package/dist/memory-recall.d.ts.map +1 -1
  248. package/dist/memory-recall.js +8 -143
  249. package/dist/memory-recall.js.map +1 -1
  250. package/dist/memory-rituals.d.ts +3 -3
  251. package/dist/memory-rituals.d.ts.map +1 -1
  252. package/dist/memory-rituals.js +16 -111
  253. package/dist/memory-rituals.js.map +1 -1
  254. package/dist/modules/catalog.js +2 -2
  255. package/dist/modules/catalog.js.map +1 -1
  256. package/dist/modules/known-tools.d.ts +8 -6
  257. package/dist/modules/known-tools.d.ts.map +1 -1
  258. package/dist/modules/known-tools.js +8 -6
  259. package/dist/modules/known-tools.js.map +1 -1
  260. package/dist/notify-destinations.d.ts +5 -0
  261. package/dist/notify-destinations.d.ts.map +1 -1
  262. package/dist/notify-destinations.js +7 -1
  263. package/dist/notify-destinations.js.map +1 -1
  264. package/dist/owner-private-lock.d.ts +95 -0
  265. package/dist/owner-private-lock.d.ts.map +1 -0
  266. package/dist/owner-private-lock.js +566 -0
  267. package/dist/owner-private-lock.js.map +1 -0
  268. package/dist/pi-oauth-login.d.ts +2 -0
  269. package/dist/pi-oauth-login.d.ts.map +1 -1
  270. package/dist/pi-oauth-login.js +39 -5
  271. package/dist/pi-oauth-login.js.map +1 -1
  272. package/dist/posted-message-index.d.ts +35 -16
  273. package/dist/posted-message-index.d.ts.map +1 -1
  274. package/dist/posted-message-index.js +1068 -52
  275. package/dist/posted-message-index.js.map +1 -1
  276. package/dist/posted-reply-history.d.ts +17 -0
  277. package/dist/posted-reply-history.d.ts.map +1 -0
  278. package/dist/posted-reply-history.js +169 -0
  279. package/dist/posted-reply-history.js.map +1 -0
  280. package/dist/proactive-notify.d.ts.map +1 -1
  281. package/dist/proactive-notify.js +6 -4
  282. package/dist/proactive-notify.js.map +1 -1
  283. package/dist/project-skills.d.ts +4 -0
  284. package/dist/project-skills.d.ts.map +1 -1
  285. package/dist/project-skills.js +99 -130
  286. package/dist/project-skills.js.map +1 -1
  287. package/dist/provider-setup.d.ts +0 -1
  288. package/dist/provider-setup.d.ts.map +1 -1
  289. package/dist/provider-setup.js +0 -3
  290. package/dist/provider-setup.js.map +1 -1
  291. package/dist/readiness-probe-worker.d.ts +61 -1
  292. package/dist/readiness-probe-worker.d.ts.map +1 -1
  293. package/dist/readiness-probe-worker.js +49 -56
  294. package/dist/readiness-probe-worker.js.map +1 -1
  295. package/dist/readiness-probe.d.ts +6 -9
  296. package/dist/readiness-probe.d.ts.map +1 -1
  297. package/dist/readiness-probe.js +23 -56
  298. package/dist/readiness-probe.js.map +1 -1
  299. package/dist/redact-secrets.d.ts +15 -0
  300. package/dist/redact-secrets.d.ts.map +1 -0
  301. package/dist/redact-secrets.js +65 -0
  302. package/dist/redact-secrets.js.map +1 -0
  303. package/dist/run-history.js +34 -24
  304. package/dist/run-history.js.map +1 -1
  305. package/dist/runtime-provenance.d.ts +8 -0
  306. package/dist/runtime-provenance.d.ts.map +1 -0
  307. package/dist/runtime-provenance.js +225 -0
  308. package/dist/runtime-provenance.js.map +1 -0
  309. package/dist/sandbox-manager.d.ts +4 -1
  310. package/dist/sandbox-manager.d.ts.map +1 -1
  311. package/dist/sandbox-manager.js +114 -273
  312. package/dist/sandbox-manager.js.map +1 -1
  313. package/dist/secure-file-replace.d.ts +49 -0
  314. package/dist/secure-file-replace.d.ts.map +1 -0
  315. package/dist/secure-file-replace.js +270 -0
  316. package/dist/secure-file-replace.js.map +1 -0
  317. package/dist/seen-conversations.d.ts +32 -5
  318. package/dist/seen-conversations.d.ts.map +1 -1
  319. package/dist/seen-conversations.js +145 -15
  320. package/dist/seen-conversations.js.map +1 -1
  321. package/dist/sessions.d.ts +20 -0
  322. package/dist/sessions.d.ts.map +1 -1
  323. package/dist/sessions.js +41 -6
  324. package/dist/sessions.js.map +1 -1
  325. package/dist/wizard/index.d.ts +2 -2
  326. package/dist/wizard/index.d.ts.map +1 -1
  327. package/dist/wizard/index.js +1 -1
  328. package/dist/wizard/index.js.map +1 -1
  329. package/dist/wizard/presets.d.ts +2 -1
  330. package/dist/wizard/presets.d.ts.map +1 -1
  331. package/dist/wizard/presets.js +2 -1
  332. package/dist/wizard/presets.js.map +1 -1
  333. package/dist/wizard/run.d.ts +0 -26
  334. package/dist/wizard/run.d.ts.map +1 -1
  335. package/dist/wizard/run.js +0 -53
  336. package/dist/wizard/run.js.map +1 -1
  337. package/package.json +21 -16
  338. package/schema/mono-agent.config.schema.json +17 -6
  339. package/skills/mono-agent-composer/SKILL.md +3 -3
  340. package/skills/mono-agent-composer/references/config-blueprint.md +41 -22
  341. package/skills/mono-agent-composer/references/discovery-questions.md +4 -4
  342. package/skills/mono-agent-composer/references/feature-coverage.md +14 -14
  343. package/skills/mono-agent-composer/references/package-map.md +3 -3
  344. package/skills/mono-agent-composer/references/playbooks.md +38 -20
  345. package/skills/mono-agent-composer/references/validation.md +16 -3
@@ -0,0 +1,336 @@
1
+ // Internal host implementation; `app.ts` remains the stable public facade.
2
+ import { resolve } from "node:path";
3
+ import { createLiveEventBus } from "@mono-agent/agent-contracts";
4
+ import { resolveChannelDrivers } from "./channels.js";
5
+ import { createSeenNotifyDestinationCache } from "./seen-conversations.js";
6
+ import { sandboxStatusFromState } from "./app-controller-utils.js";
7
+ import * as lifecycleOperations from "./app-controller-lifecycle.js";
8
+ import * as traceabilityOperations from "./app-controller-traceability.js";
9
+ import * as memory_healthOperations from "./app-controller-memory-health.js";
10
+ import * as continuationOperations from "./app-controller-continuation.js";
11
+ import * as maintenanceOperations from "./app-controller-maintenance.js";
12
+ import * as channelsOperations from "./app-controller-channels.js";
13
+ import * as responderOperations from "./app-controller-responder.js";
14
+ import * as memoryOperations from "./app-controller-memory.js";
15
+ /**
16
+ * Starts a config-first mono-agent host in `cwd`: traceability first, then every
17
+ * configured channel in parallel. Channels with incomplete config report
18
+ * `waiting_for_config` instead of blocking the rest. The host runs headless;
19
+ * config changes take effect on the next restart.
20
+ */
21
+ export async function startMonoAgentApp(options = {}) {
22
+ const cwd = resolve(options.cwd ?? process.cwd());
23
+ const configPath = resolve(cwd, options.configPath ?? "mono-agent.config.json");
24
+ const configReadPath = resolve(cwd, options.configReadPath ?? configPath);
25
+ const env = options.env ?? process.env;
26
+ const drivers = options.drivers ?? await resolveChannelDrivers({ env, cwd, configPath: configReadPath });
27
+ const controller = new MonoAgentAppController({
28
+ cwd,
29
+ configPath,
30
+ configReadPath,
31
+ env,
32
+ drivers,
33
+ ...(options.logger === undefined ? {} : { logger: options.logger }),
34
+ ...(options.runtime === undefined ? {} : { runtime: options.runtime }),
35
+ ...(options.sandboxEngine === undefined ? {} : { sandboxEngine: options.sandboxEngine }),
36
+ ...(options.traceDefaults === undefined ? {} : { traceDefaults: options.traceDefaults }),
37
+ ...(options.backgroundSnapshot === undefined ? {} : { backgroundSnapshot: options.backgroundSnapshot }),
38
+ });
39
+ await controller.refreshSandboxStatus("startup");
40
+ await controller.startTraceability("startup");
41
+ await controller.startExporters("startup");
42
+ await controller.startContinuationServiceIfConfigured("startup");
43
+ await Promise.all(drivers.map((driver) => controller?.startChannelIfConfigured(driver.id, "startup")));
44
+ await controller.startMemoryRitualsIfConfigured("startup");
45
+ await controller.refreshMemoryHealthAfterLifecycle("startup-complete");
46
+ return controller;
47
+ }
48
+ const DEFAULT_SANDBOX_STATUS = sandboxStatusFromState({
49
+ configured: false,
50
+ configuredMode: undefined,
51
+ effective: "off",
52
+ engine: undefined,
53
+ engineAvailable: undefined,
54
+ fallback: undefined,
55
+ fallbackActive: false,
56
+ unsafeAllowHostProcess: false,
57
+ });
58
+ /** Strict memory audits scan durable state; never run them at sub-second trace-heartbeat cadence. */
59
+ const MIN_MEMORY_HEALTH_REFRESH_INTERVAL_MS = 30_000;
60
+ export class MonoAgentAppController {
61
+ configPath;
62
+ cwd;
63
+ configReadPath;
64
+ env;
65
+ drivers;
66
+ driversById;
67
+ logger;
68
+ runtime;
69
+ sandboxEngine;
70
+ traceDefaults;
71
+ backgroundSnapshot;
72
+ activeRuntimes = [];
73
+ statuses = new Map();
74
+ running = new Map();
75
+ startsInFlight = new Map();
76
+ /** Captured at construction (~process start): the cutoff for reclaiming orphaned "running" runs. */
77
+ processStartMs = Date.now();
78
+ staleRunsReconciled = false;
79
+ traceabilityStatusValue = {
80
+ kind: "disabled",
81
+ reason: "Traceability has not started yet.",
82
+ };
83
+ exporterStatusValue = {
84
+ kind: "disabled",
85
+ reason: "No observability exporter configured.",
86
+ };
87
+ sandboxStatusValue = DEFAULT_SANDBOX_STATUS;
88
+ memoryHealthValue = {
89
+ backend: "none",
90
+ status: "unknown",
91
+ checkedAt: new Date().toISOString(),
92
+ };
93
+ memoryHealthRefreshInFlight;
94
+ memoryHealthRefreshTimer;
95
+ memoryHealthRefreshLoopActive = false;
96
+ memoryHealthRefreshIntervalMs = MIN_MEMORY_HEALTH_REFRESH_INTERVAL_MS;
97
+ /** Monotonic completion time for the current generation's cached full audit. */
98
+ memoryHealthLastCompletedAtMs;
99
+ /** One bounded forced refresh reserved by a due timer tick. */
100
+ memoryHealthRefreshDue = false;
101
+ memoryHealthGeneration = 0;
102
+ selectedSkillsValue;
103
+ sessionMetadataValue;
104
+ /** The exporter the responder threads into agent-host (first configured exporter). */
105
+ resolvedExporter;
106
+ traceSource;
107
+ /**
108
+ * Whole-publication single flight. A slow health probe must not let periodic
109
+ * heartbeat ticks build an unbounded promise tail behind it.
110
+ */
111
+ traceRefreshInFlight;
112
+ traceRefreshDirty = false;
113
+ traceRefreshLatestReason;
114
+ // Best-effort mirror of `traceSource` into the machine-wide global registry,
115
+ // present only when `shouldMirrorTraceSourceGlobally` gates it on (see
116
+ // `startTraceability`). Kept in lockstep with `traceSource` on every
117
+ // refresh/stop so both manifests describe the same instance identically.
118
+ globalTraceSource;
119
+ artifactRetentionScheduler;
120
+ artifactRetentionGeneration = 0;
121
+ memoryRituals;
122
+ // One shared memory store across all channel responders + the ritual scheduler, so there is a single
123
+ // memory.db handle (not one per channel plus one for rituals). Rebuilt on config reload, closed on stop.
124
+ sharedMemory = undefined;
125
+ sharedMemoryRetrieval;
126
+ sharedMemoryBuilt = false;
127
+ sharedMemoryBuild;
128
+ configApplyTail = Promise.resolve();
129
+ stopped = false;
130
+ // Interaction bridge (AskUser + tool progress): lazily started once and shared
131
+ // by every channel. Its master bearer stays app-owned and is never exported
132
+ // through the generic host/process environment.
133
+ interactionBridge;
134
+ interactionBridgeStart;
135
+ continuationService;
136
+ continuationServiceStart;
137
+ // Shared in-process run-event bus: every run's recorder publishes to it (via the
138
+ // broadcast recorder threaded as `runEventSink`), and the `live` channel relays
139
+ // it over SSE. One instance for the app's lifetime — cheap, bounded ring buffer,
140
+ // and it must exist before any responder is built (like the interaction bridge).
141
+ liveEventBus = createLiveEventBus();
142
+ /** One bounded scan cache for artifact-derived native-notify destinations. */
143
+ seenNotifyDestinations = createSeenNotifyDestinationCache();
144
+ constructor(input) {
145
+ this.cwd = input.cwd;
146
+ this.configPath = input.configPath;
147
+ this.configReadPath = input.configReadPath;
148
+ this.env = input.env;
149
+ this.drivers = input.drivers;
150
+ this.driversById = new Map(input.drivers.map((driver) => [driver.id, driver]));
151
+ this.logger = input.logger;
152
+ this.runtime = input.runtime;
153
+ this.sandboxEngine = input.sandboxEngine;
154
+ this.traceDefaults = input.traceDefaults;
155
+ this.backgroundSnapshot = input.backgroundSnapshot;
156
+ for (const driver of input.drivers) {
157
+ this.statuses.set(driver.id, {
158
+ kind: "waiting_for_config",
159
+ reason: `${driver.label} has not been configured yet.`,
160
+ });
161
+ }
162
+ }
163
+ get traceabilityStatus() {
164
+ return this.traceabilityStatusValue;
165
+ }
166
+ get exporterStatus() {
167
+ return this.exporterStatusValue;
168
+ }
169
+ get sandboxStatus() {
170
+ return this.sandboxStatusValue;
171
+ }
172
+ get memoryHealth() {
173
+ return this.memoryHealthValue;
174
+ }
175
+ get selectedSkills() {
176
+ return this.selectedSkillsValue;
177
+ }
178
+ channelStatus(id) {
179
+ const status = this.statuses.get(id);
180
+ if (status === undefined) {
181
+ return { kind: "disabled", reason: `Channel ${id} is not registered with this app.` };
182
+ }
183
+ return status;
184
+ }
185
+ channelStatuses() {
186
+ return new Map(this.statuses);
187
+ }
188
+ async continuationHealth() {
189
+ return await this.continuationService?.health();
190
+ }
191
+ async listContinuations() {
192
+ return await this.continuationService?.list() ?? [];
193
+ }
194
+ async capturedContinuationText(id) {
195
+ return await this.requireContinuationService().capturedText(id);
196
+ }
197
+ async retryContinuation(id, options) {
198
+ return await this.requireContinuationService().retry(id, options);
199
+ }
200
+ async cancelContinuation(id) {
201
+ return await this.requireContinuationService().cancel(id);
202
+ }
203
+ async resolveContinuationDelivery(id, outcome) {
204
+ return await this.requireContinuationService().resolveUnknown(id, outcome);
205
+ }
206
+ async applyConfigChange(reason) { return lifecycleOperations.applyConfigChange(this, reason); }
207
+ async startChannelIfConfigured(id, reason) { return lifecycleOperations.startChannelIfConfigured(this, id, reason); }
208
+ async startTraceability(reason) { return traceabilityOperations.startTraceability(this, reason); }
209
+ async refreshSandboxStatus(reason) { return traceabilityOperations.refreshSandboxStatus(this, reason); }
210
+ /**
211
+ * One-shot at startup: a process that crashed mid-run leaves its summary stuck at "running"
212
+ * forever (a ghost run in `status`/observability). Reclaim those — any "running" summary that
213
+ * began before THIS process started — by rewriting them to "interrupted". Gated so a config
214
+ * reload (which re-runs startTraceability) does not repeat the scan. Best-effort: never fatal.
215
+ */
216
+ async reconcileStaleRunsOnce(artifactDir) { return traceabilityOperations.reconcileStaleRunsOnce(this, artifactDir); }
217
+ /**
218
+ * Resolve the configured observability exporter(s) and publish the export
219
+ * status. No reachability probe runs here — Phoenix may start after the agent,
220
+ * so an unreachable endpoint must not block startup (that probe runs in
221
+ * `validate`). A present-but-invalid exporter config surfaces as `failed`.
222
+ */
223
+ async startExporters(reason) { return traceabilityOperations.startExporters(this, reason); }
224
+ /** Record a best-effort export warning so `status` can surface it without failing the run. */
225
+ recordExporterWarning(warning) { return traceabilityOperations.recordExporterWarning(this, warning); }
226
+ refreshTraceSource(reason) { return traceabilityOperations.refreshTraceSource(this, reason); }
227
+ /**
228
+ * Refresh the content-free memory snapshot once for all concurrent trace
229
+ * publishers. The cached value is the only memory state read by synchronous
230
+ * manifest composition; provider/native errors collapse to a closed unknown
231
+ * shape and never escape into registry metadata.
232
+ */
233
+ refreshMemoryHealthSnapshot(reason, lifecycleForce = false) { return memory_healthOperations.refreshMemoryHealthSnapshot(this, reason, lifecycleForce); }
234
+ async computeMemoryHealth() { return memory_healthOperations.computeMemoryHealth(this); }
235
+ startMemoryHealthRefreshLoop(intervalMs) { return memory_healthOperations.startMemoryHealthRefreshLoop(this, intervalMs); }
236
+ scheduleMemoryHealthRefresh(delayOverrideMs) { return memory_healthOperations.scheduleMemoryHealthRefresh(this, delayOverrideMs); }
237
+ recordMemoryHealthCompletion(generation) { return memory_healthOperations.recordMemoryHealthCompletion(this, generation); }
238
+ refreshMemoryHealthOnTimer() { return memory_healthOperations.refreshMemoryHealthOnTimer(this); }
239
+ /**
240
+ * Re-audit after channel responders and the shared memory store have started.
241
+ * The trace source is registered first, so its registration audit can only
242
+ * observe the previous/stopped runtime snapshot. This one lifecycle force is
243
+ * generation-fenced and uses the same health/trace single-flights as timer
244
+ * work; ordinary session and trace events continue to reuse the 30s cache.
245
+ */
246
+ async refreshMemoryHealthAfterLifecycle(reason) { return memory_healthOperations.refreshMemoryHealthAfterLifecycle(this, reason); }
247
+ clearMemoryHealthRefreshTimer() { return memory_healthOperations.clearMemoryHealthRefreshTimer(this); }
248
+ invalidateMemoryHealthRefresh() { return memory_healthOperations.invalidateMemoryHealthRefresh(this); }
249
+ /**
250
+ * Start the interaction bridge once, when a blocking ask tool is allowed by
251
+ * the tool policy, a request-context MCP needs scoped progress, or the operator
252
+ * configured the `interaction` block. The master bearer remains app-owned.
253
+ */
254
+ ensureInteractionBridge(coreConfig) { return continuationOperations.ensureInteractionBridge(this, coreConfig); }
255
+ async stopInteractionBridge() { return continuationOperations.stopInteractionBridge(this); }
256
+ /** Start one durable continuation service shared by all channel responders. */
257
+ ensureContinuationService(coreConfig) { return continuationOperations.ensureContinuationService(this, coreConfig); }
258
+ async startContinuationServiceIfConfigured(reason) { return continuationOperations.startContinuationServiceIfConfigured(this, reason); }
259
+ async stopContinuationService() { return continuationOperations.stopContinuationService(this); }
260
+ requireContinuationService() { return continuationOperations.requireContinuationService(this); }
261
+ async synthesizeContinuation(input) { return continuationOperations.synthesizeContinuation(this, input); }
262
+ continuationSynthesisAvailability(input) { return continuationOperations.continuationSynthesisAvailability(this, input); }
263
+ async deliverContinuation(conversationId, text, deliveryKey) { return continuationOperations.deliverContinuation(this, conversationId, text, deliveryKey); }
264
+ async recordContinuationHistory(conversationId, text, deliveryKey) { return continuationOperations.recordContinuationHistory(this, conversationId, text, deliveryKey); }
265
+ async stop() { return lifecycleOperations.stop(this); }
266
+ async startMemoryRitualsIfConfigured(reason) { return maintenanceOperations.startMemoryRitualsIfConfigured(this, reason); }
267
+ stopMemoryRituals() { return maintenanceOperations.stopMemoryRituals(this); }
268
+ restartArtifactRetentionScheduler(artifactDir, reason) { return maintenanceOperations.restartArtifactRetentionScheduler(this, artifactDir, reason); }
269
+ stopArtifactRetentionScheduler() { return maintenanceOperations.stopArtifactRetentionScheduler(this); }
270
+ /**
271
+ * Deliver a native cron/webhook notification to whichever running channel owns
272
+ * the destination conversationId. With `verbatim`, the channel posts `text`
273
+ * unchanged (no model call) and records it to history; otherwise it runs `text`
274
+ * as a turn. Best-effort: an unavailable/unsupported destination is warned and
275
+ * skipped, never thrown back to the cron/webhook trigger.
276
+ */
277
+ async notifyDestination(conversationId, text, options) { return maintenanceOperations.notifyDestination(this, conversationId, text, options); }
278
+ /**
279
+ * Candidate destinations for native cron/webhook notification delivery, used to
280
+ * infer a target when a job/endpoint sets no explicit `notifyConversationId`.
281
+ */
282
+ async listNotifyDestinations() { return maintenanceOperations.listNotifyDestinations(this); }
283
+ async startChannel(driver, reason) { return channelsOperations.startChannel(this, driver, reason); }
284
+ async stopChannel(id, reason) { return channelsOperations.stopChannel(this, id, reason); }
285
+ async buildResponder(coreConfig) { return responderOperations.buildResponder(this, coreConfig); }
286
+ /**
287
+ * Per-request extension that applies a cron/webhook/tui per-trigger model +
288
+ * effort override (validated, warn-and-ignore on bad input). Threads the
289
+ * configured local providers so a LOCAL-model override recomputes its endpoint
290
+ * block for the OVERRIDE model (see request-model-override doc). Composed
291
+ * alongside the memory/adapter extensions.
292
+ */
293
+ requestModelOverrideRuntimeOptions(coreConfig, compatibility) { return responderOperations.requestModelOverrideRuntimeOptions(this, coreConfig, compatibility); }
294
+ /**
295
+ * Memoized factory for runtimes bound to a per-request override model. Reuses
296
+ * createConfiguredAgentRuntime so the override becomes the fallback-chain
297
+ * primary with the configured backups after it (override + keep fallbacks).
298
+ * Built runtimes register in `activeRuntimes`, which is disposed on `stop()`
299
+ * (config reload rebuilds the responder but does not drain prior runtimes —
300
+ * same lifetime as the base runtime built in `buildResponder`).
301
+ */
302
+ buildRuntimeForModel(coreConfig) { return responderOperations.buildRuntimeForModel(this, coreConfig); }
303
+ /**
304
+ * Run-identifying context threaded onto exported spans (Phoenix shows the same
305
+ * source/run identifiers as the local trace-source registry, so local artifact
306
+ * lookup stays possible). Resolved with the same source-id/label resolvers the
307
+ * trace source uses.
308
+ */
309
+ async observabilityContext() { return traceabilityOperations.observabilityContext(this); }
310
+ reportMemoryRecallStatus(coreConfig, service) { return traceabilityOperations.reportMemoryRecallStatus(this, coreConfig, service); }
311
+ /**
312
+ * Optional CLOUD-ONLY escape hatch: when `memory.supermemory.exposeMcpServer` is on, ALSO inject
313
+ * Supermemory's hosted MCP server alongside the in-app `MemoryRecall` tool. The hosted MCP cannot
314
+ * point at a self-hosted instance, so self-hosters rely on the in-app recall tool; this just adds
315
+ * the cloud server's richer tools for cloud deployments. Requires an apiKey (skipped + warned if
316
+ * absent).
317
+ */
318
+ supermemoryMcpRuntimeOptions(coreConfig) { return responderOperations.supermemoryMcpRuntimeOptions(this, coreConfig); }
319
+ async adapterSendToolsRuntimeOptions(coreConfig) { return responderOperations.adapterSendToolsRuntimeOptions(this, coreConfig); }
320
+ /** Build the configured memory store once and share it across responders + the ritual scheduler. */
321
+ async memoryStore(coreConfig) { return memoryOperations.memoryStore(this, coreConfig); }
322
+ /** Close + clear the shared memory store (on config reload or stop) so the next build is fresh. */
323
+ async resetSharedMemory() { return memoryOperations.resetSharedMemory(this); }
324
+ /** @internal Test-only seam: seed the shared memory store without going through config. */
325
+ __setSharedMemoryForTest(store) { return memoryOperations.__setSharedMemoryForTest(this, store); }
326
+ ensureSharedMemoryRetrieval(coreConfig, store) { return memoryOperations.ensureSharedMemoryRetrieval(this, coreConfig, store); }
327
+ setStatus(id, status) { return channelsOperations.setStatus(this, id, status); }
328
+ applyResult() { return channelsOperations.applyResult(this); }
329
+ async stopTraceSource(reason) { return traceabilityOperations.stopTraceSource(this, reason); }
330
+ activeTransports() { return channelsOperations.activeTransports(this); }
331
+ async refreshSelectedSkillsSnapshot(reason) { return traceabilityOperations.refreshSelectedSkillsSnapshot(this, reason); }
332
+ rememberSelectedSkills(coreConfig) { return traceabilityOperations.rememberSelectedSkills(this, coreConfig); }
333
+ recordSessionEvent(event, coreConfig) { return traceabilityOperations.recordSessionEvent(this, event, coreConfig); }
334
+ traceMetadata(reason) { return traceabilityOperations.traceMetadata(this, reason); }
335
+ }
336
+ //# sourceMappingURL=app-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-controller.js","sourceRoot":"","sources":["../src/app-controller.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AASjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAuBtD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,sBAAsB,CAAC,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAErI,kBAAkB,CAAC,KAAkC,EAAE,UAA2B,IAAU,OAAO,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAExK,aAAa,CAAC,MAAc,IAA6B,OAAO,sBAAsB,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CACtH"}
package/dist/app.d.ts CHANGED
@@ -1,118 +1,10 @@
1
- import type { TraceSourceMemoryHealth } from "@mono-agent/observability";
2
- import type { MonoRuntimeLike } from "@mono-agent/runtime-adapter";
3
- import type { SandboxEffectiveState, SandboxEngine } from "@mono-agent/runtime-adapter";
4
- import type { AppTraceDefaults } from "./app-config.js";
5
- import type { ChannelDriver, ChannelId, ChannelStatus, MonoAgentAppLogger } from "./channels.js";
6
- import type { ContinuationHealthSnapshot, ContinuationStatusSnapshot } from "./continuations.js";
7
- import type { BackgroundSnapshot } from "./background-snapshot.js";
8
1
  /**
9
- * Outcome of a live config re-apply (`applyConfigChange`). Consumed by callers
10
- * that trigger a reload and by demos that surface the result.
2
+ * Stable config-first host surface.
3
+ *
4
+ * The controller implementation lives in `app-controller.ts`; consumers keep
5
+ * importing `./app.js` while lifecycle collaborators are extracted behind this
6
+ * boundary in focused, behavior-preserving changes.
11
7
  */
12
- export type ConfigApplyResult = {
13
- readonly kind: "applied";
14
- readonly message: string;
15
- readonly transports: readonly string[];
16
- } | {
17
- readonly kind: "waiting_for_config";
18
- readonly message: string;
19
- readonly transports: readonly string[];
20
- } | {
21
- readonly kind: "failed";
22
- readonly message: string;
23
- readonly transports: readonly string[];
24
- };
25
- export interface MonoAgentAppOptions {
26
- readonly env?: Record<string, string | undefined>;
27
- readonly cwd?: string;
28
- /** Path to mono-agent.config.json; defaults to <cwd>/mono-agent.config.json. */
29
- readonly configPath?: string;
30
- /**
31
- * Optional immutable read source for managed workers. The public app and
32
- * trace metadata continue to identify `configPath`; every runtime/channel
33
- * config loader reads this path instead.
34
- */
35
- readonly configReadPath?: string;
36
- readonly logger?: MonoAgentAppLogger;
37
- /** Channel drivers to run. Defaults to every built-in channel. */
38
- readonly drivers?: readonly ChannelDriver[];
39
- /** Shared runtime override (testing / advanced composition). */
40
- readonly runtime?: MonoRuntimeLike;
41
- /** Sandbox engine override (testing / advanced composition). */
42
- readonly sandboxEngine?: SandboxEngine;
43
- readonly traceDefaults?: AppTraceDefaults;
44
- /** Secret-free proof of the durable files/environment observed by this worker. */
45
- readonly backgroundSnapshot?: BackgroundSnapshot;
46
- }
47
- export type TraceabilityStatus = {
48
- readonly kind: "running";
49
- readonly sourceId: string;
50
- readonly registryDir: string;
51
- readonly artifactDir: string;
52
- } | {
53
- readonly kind: "disabled";
54
- readonly reason: string;
55
- } | {
56
- readonly kind: "failed";
57
- readonly reason: string;
58
- };
59
- /**
60
- * Best-effort observability exporter status. `configured` does not assert
61
- * reachability (Phoenix may start later — only `validate` probes); export
62
- * failures during runs surface as `lastWarning`/`lastError` without changing the
63
- * run outcome.
64
- */
65
- export type ExporterStatus = {
66
- readonly kind: "configured";
67
- readonly endpoint: string;
68
- readonly includeSensitiveData: boolean;
69
- readonly lastWarning?: string;
70
- readonly lastError?: string;
71
- } | {
72
- readonly kind: "disabled";
73
- readonly reason: string;
74
- } | {
75
- readonly kind: "failed";
76
- readonly reason: string;
77
- };
78
- export interface SandboxStatus extends SandboxEffectiveState {
79
- readonly detail: string;
80
- readonly warning?: string;
81
- readonly resolutionError?: string;
82
- }
83
- export interface MonoAgentApp {
84
- readonly configPath: string;
85
- readonly traceabilityStatus: TraceabilityStatus;
86
- readonly exporterStatus: ExporterStatus;
87
- readonly sandboxStatus: SandboxStatus;
88
- readonly memoryHealth?: TraceSourceMemoryHealth;
89
- readonly selectedSkills: readonly string[] | undefined;
90
- channelStatus(id: ChannelId): ChannelStatus;
91
- channelStatuses(): ReadonlyMap<ChannelId, ChannelStatus>;
92
- continuationHealth?(): Promise<ContinuationHealthSnapshot | undefined>;
93
- listContinuations?(): Promise<readonly ContinuationStatusSnapshot[]>;
94
- capturedContinuationText?(id: string): Promise<string | undefined>;
95
- retryContinuation?(id: string, options?: {
96
- readonly allowUnknown?: boolean;
97
- }): Promise<ContinuationStatusSnapshot>;
98
- cancelContinuation?(id: string): Promise<ContinuationStatusSnapshot>;
99
- resolveContinuationDelivery?(id: string, outcome: {
100
- readonly kind: "delivered";
101
- readonly deliveryId?: string;
102
- } | {
103
- readonly kind: "not_delivered";
104
- } | {
105
- readonly kind: "dead_lettered";
106
- }): Promise<ContinuationStatusSnapshot>;
107
- startChannelIfConfigured(id: ChannelId, reason: string): Promise<ChannelStatus>;
108
- applyConfigChange(reason: string): Promise<ConfigApplyResult>;
109
- stop(): Promise<void>;
110
- }
111
- /**
112
- * Starts a config-first mono-agent host in `cwd`: traceability first, then every
113
- * configured channel in parallel. Channels with incomplete config report
114
- * `waiting_for_config` instead of blocking the rest. The host runs headless;
115
- * config changes take effect on the next restart.
116
- */
117
- export declare function startMonoAgentApp(options?: MonoAgentAppOptions): Promise<MonoAgentApp>;
8
+ export { startMonoAgentApp } from "./app-controller.js";
9
+ export type { ConfigApplyResult, ExporterStatus, MonoAgentApp, MonoAgentAppOptions, SandboxStatus, TraceabilityStatus, } from "./app-controller.js";
118
10
  //# sourceMappingURL=app.d.ts.map
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,uBAAuB,EAGxB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,6BAA6B,CAAC;AAM1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAiBxF,OAAO,KAAK,EAAE,gBAAgB,EAA6C,MAAM,iBAAiB,C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