@xopcai/xopc 0.0.178 → 0.0.179

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 (343) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-BzGX__8I.js → activity-store-A5FUMjeV.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BzxntcaZ.js → agent-avatar-dicebear-NghNiDWx.js} +1 -1
  5. package/dist/gateway/static/root/assets/agents-Baq8Shzy.js +2 -0
  6. package/dist/gateway/static/root/assets/{api-hi6f2Xtp.js → api-Bmzslx0Z.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-fTY1F7ac.js → app-management-settings-panel-DDWS_BBJ.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-BZ-IxQfB.js → appearance-settings-C6znvVtX.js} +1 -1
  9. package/dist/gateway/static/root/assets/apps-page-d-Y0Jbe1.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-ZSLLG8wB.js → archive-plugin-fvTZhPUr.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-D4YktqIF.js → attachment-load-BFEgvg-Q.js} +1 -1
  12. package/dist/gateway/static/root/assets/automations-page-CFYOCBlQ.js +6 -0
  13. package/dist/gateway/static/root/assets/{binary-plugins-BIkPxfxj.js → binary-plugins-CuI2bOc7.js} +1 -1
  14. package/dist/gateway/static/root/assets/{block-editor-Q3v_YQom.js → block-editor-Z_k8W0al.js} +46 -46
  15. package/dist/gateway/static/root/assets/browser-settings-page-CGApoYPr.js +8 -0
  16. package/dist/gateway/static/root/assets/{browser-workflow-inputs-M5lTEW1I.js → browser-workflow-inputs-gs6b5e9-.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-workflows-page-B3T1KYk4.js → browser-workflows-page-Cq5qXStp.js} +2 -2
  18. package/dist/gateway/static/root/assets/capabilities-settings-panel-BC-8n4Hl.js +7 -0
  19. package/dist/gateway/static/root/assets/{capability-presets-api-DE09c0VB.js → capability-presets-api-BTKhPoDC.js} +1 -1
  20. package/dist/gateway/static/root/assets/capability-presets-settings-panel-D7WQ0oBN.js +1 -0
  21. package/dist/gateway/static/root/assets/{channel-recipient-api-CFR5FBfS.js → channel-recipient-api-TwMak0SE.js} +1 -1
  22. package/dist/gateway/static/root/assets/channels-settings-DysELlO_.js +1 -0
  23. package/dist/gateway/static/root/assets/channels-status-swr-BAC-R8IK.js +1 -0
  24. package/dist/gateway/static/root/assets/{connector-logo-B1mD-3pM.js → connector-logo-DBKotvNr.js} +1 -1
  25. package/dist/gateway/static/root/assets/connectors-page-QH-0WnOo.js +2 -0
  26. package/dist/gateway/static/root/assets/desktop-pet-Dwml8znf.js +1 -0
  27. package/dist/gateway/static/root/assets/desktop-pet-settings-CyIg2jJp.js +1 -0
  28. package/dist/gateway/static/root/assets/{directory-picker-path-field-BYQJ2XUS.js → directory-picker-path-field-B6fc_7SL.js} +1 -1
  29. package/dist/gateway/static/root/assets/{dreaming-settings-BXcb8fwx.js → dreaming-settings-CUQxGnDf.js} +3 -3
  30. package/dist/gateway/static/root/assets/{extension-debug-page-O1Xu1r4Q.js → extension-debug-page-AbRNi2ON.js} +1 -1
  31. package/dist/gateway/static/root/assets/{extension-page-C2Jraq8l.js → extension-page-ClYfiLXC.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-settings-page-DcXQDTpG.js → extension-settings-page-BGVP2hw1.js} +1 -1
  33. package/dist/gateway/static/root/assets/{gateway-config-api-DmPIZrvg.js → gateway-config-api-B7GqtklK.js} +1 -1
  34. package/dist/gateway/static/root/assets/gateway-settings-BMeK8igT.js +1 -0
  35. package/dist/gateway/static/root/assets/{gateway-startup-retry-BZEkOdPm.js → gateway-startup-retry-CKKL96r_.js} +1 -1
  36. package/dist/gateway/static/root/assets/goals-settings-Dj0ao2qA.js +1 -0
  37. package/dist/gateway/static/root/assets/{heartbeat-settings-BtKu2NWT.js → heartbeat-settings-CTI2nPKa.js} +1 -1
  38. package/dist/gateway/static/root/assets/{image-generation-api-05Gg8wsU.js → image-generation-api-BY3VQ5Mv.js} +1 -1
  39. package/dist/gateway/static/root/assets/index-B0Tdge_q.css +1 -0
  40. package/dist/gateway/static/root/assets/index-BDzspHrg.js +224 -0
  41. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CfmDR9Sc.js → keyboard-shortcuts-settings-CELtDFz3.js} +1 -1
  42. package/dist/gateway/static/root/assets/local-app-workbench-page-m8CTSGix.js +2 -0
  43. package/dist/gateway/static/root/assets/{local-apps-page-Df8BW1A_.js → local-apps-page-CF5uUd1n.js} +1 -1
  44. package/dist/gateway/static/root/assets/{locale-store-CTwSy7yW.js → locale-store-DIVc0AQs.js} +1 -1
  45. package/dist/gateway/static/root/assets/logs-page-DmH7Tk4k.js +7 -0
  46. package/dist/gateway/static/root/assets/{markdown-split-B3FvKbaP.js → markdown-split-CN85EdB8.js} +1 -1
  47. package/dist/gateway/static/root/assets/{media-plugins-DsjrvvB6.js → media-plugins-CxYEc-b8.js} +1 -1
  48. package/dist/gateway/static/root/assets/messages-DYqBwJAK.js +3 -0
  49. package/dist/gateway/static/root/assets/{notes-page-tuzIwy3c.js → notes-page-Goab4781.js} +1 -1
  50. package/dist/gateway/static/root/assets/notes-workbench-C4jDBVBN.js +4 -0
  51. package/dist/gateway/static/root/assets/outcome-detail-page-DNRfeLZp.js +1 -0
  52. package/dist/gateway/static/root/assets/{page-tabs-ke9s4nYi.js → page-tabs-tQNQcAts.js} +1 -1
  53. package/dist/gateway/static/root/assets/{preview-open-alternatives-Cp1eI4S9.js → preview-open-alternatives-BSTlgsDB.js} +1 -1
  54. package/dist/gateway/static/root/assets/product-delivery-BVG-eWQO.js +1 -0
  55. package/dist/gateway/static/root/assets/{product-open-page-dXQCMAtH.js → product-open-page-iQ5gTCip.js} +1 -1
  56. package/dist/gateway/static/root/assets/project-detail-page-D7anK-eu.js +1 -0
  57. package/dist/gateway/static/root/assets/projects-page-BePESKWy.js +1 -0
  58. package/dist/gateway/static/root/assets/remote-access-hub-CHrzBKIs.js +1 -0
  59. package/dist/gateway/static/root/assets/{save-bar-controls-Bl30zjHc.js → save-bar-controls-BsPf5Gkk.js} +1 -1
  60. package/dist/gateway/static/root/assets/{schedule-field-DqhmXQKo.js → schedule-field-kAytH7mq.js} +1 -1
  61. package/dist/gateway/static/root/assets/{schema-form-DkUCy6vf.js → schema-form-Bbw8l2ri.js} +1 -1
  62. package/dist/gateway/static/root/assets/{schemas-DgQq6Z5S.js → schemas-C6onAggk.js} +2 -2
  63. package/dist/gateway/static/root/assets/sessions-page-He5YAczL.js +1 -0
  64. package/dist/gateway/static/root/assets/settings-advanced-gate-2eAC9GCP.js +1 -0
  65. package/dist/gateway/static/root/assets/{settings-form-section-C6ZbNpdy.js → settings-form-section-BqbibcnJ.js} +1 -1
  66. package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bk58_cr7.js → settings-loading-skeleton-DNLNCEGT.js} +1 -1
  67. package/dist/gateway/static/root/assets/{settings-page-k8iE_NdX.js → settings-page-BR6Ss0bK.js} +1 -1
  68. package/dist/gateway/static/root/assets/{settings-page-layout-DgFSya2e.js → settings-page-layout-Cdb1e2Cz.js} +1 -1
  69. package/dist/gateway/static/root/assets/{setup-status-panel-B_KDlyZA.js → setup-status-panel-moT-D-ia.js} +1 -1
  70. package/dist/gateway/static/root/assets/{share-preview-page-CV7nL_J9.js → share-preview-page-CkrASny2.js} +1 -1
  71. package/dist/gateway/static/root/assets/shares-settings-X49zY21H.js +1 -0
  72. package/dist/gateway/static/root/assets/skill-reload-api-CjpnFfOH.js +1 -0
  73. package/dist/gateway/static/root/assets/skills-page-DEwfSOUE.js +2 -0
  74. package/dist/gateway/static/root/assets/{skills-page.utils-kahBIHg0.js → skills-page.utils-BG5dGkyA.js} +1 -1
  75. package/dist/gateway/static/root/assets/{system-settings-panel-JV3-MG5F.js → system-settings-panel-XdY8eyYf.js} +1 -1
  76. package/dist/gateway/static/root/assets/{theme-store-DFLyzoLO.js → theme-store-DtwI_VLT.js} +1 -1
  77. package/dist/gateway/static/root/assets/time-picker-UghsQu_I.js +1 -0
  78. package/dist/gateway/static/root/assets/{typed-models-lib-60Aqo-UJ.js → typed-models-lib-DOnpwsrE.js} +1 -1
  79. package/dist/gateway/static/root/assets/{use-channel-catalog-CnTkHDnw.js → use-channel-catalog-BWDtfNvQ.js} +1 -1
  80. package/dist/gateway/static/root/assets/user-context-page-BtNBEtKj.js +1 -0
  81. package/dist/gateway/static/root/assets/{voice-api-key-field-CNa8qUgS.js → voice-api-key-field-DP80jW-W.js} +1 -1
  82. package/dist/gateway/static/root/assets/work-copy-hQmivDgT.js +1 -0
  83. package/dist/gateway/static/root/assets/work-discovery-page-CkDOVZBr.js +1 -0
  84. package/dist/gateway/static/root/assets/work-item-detail-page-CqvkcFcR.js +1 -0
  85. package/dist/gateway/static/root/assets/work-page-BL8TZW4Z.js +3 -0
  86. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-yV_x595t.js → workflow-run-setup-panel-BLlVqKdA.js} +2 -2
  87. package/dist/gateway/static/root/assets/workflows-page-BgsdRu3_.js +11 -0
  88. package/dist/gateway/static/root/index.html +9 -10
  89. package/dist/package.js +1 -1
  90. package/dist/packages/gateway-contract/src/outcomes.js +137 -0
  91. package/dist/packages/gateway-contract/src/product-delivery.js +1 -0
  92. package/dist/packages/gateway-contract/src/work-intake.js +85 -0
  93. package/dist/src/activity/service.d.ts +1 -0
  94. package/dist/src/activity/service.js +4 -1
  95. package/dist/src/agent/code-intelligence/binary.js +1 -1
  96. package/dist/src/agent/context/execution-scope.d.ts +1 -1
  97. package/dist/src/agent/context/execution-scope.js +6 -4
  98. package/dist/src/agent/goals/post-turn.js +6 -5
  99. package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
  100. package/dist/src/agent/memory/user-context-coordinator.d.ts +1 -0
  101. package/dist/src/agent/memory/user-context-coordinator.js +17 -1
  102. package/dist/src/agent/outcomes/{task-evaluation.d.ts → execution-evaluation.d.ts} +3 -3
  103. package/dist/src/agent/outcomes/{task-evaluation.js → execution-evaluation.js} +5 -5
  104. package/dist/src/agent/outcomes/execution-verifier.d.ts +29 -0
  105. package/dist/src/agent/outcomes/{task-verifier.js → execution-verifier.js} +4 -4
  106. package/dist/src/agent/service/process-direct-streaming.js +3 -1
  107. package/dist/src/agent/tools/factory.js +16 -1
  108. package/dist/src/agent/tools/goal-tool.js +5 -3
  109. package/dist/src/agent/tools/todo-tool.d.ts +5 -0
  110. package/dist/src/agent/tools/todo-tool.js +16 -4
  111. package/dist/src/agent/tools/update-plan-tool.d.ts +1 -0
  112. package/dist/src/agent/tools/update-plan-tool.js +6 -0
  113. package/dist/src/browser/providers/cloakbrowser.js +2 -2
  114. package/dist/src/channels/attachments/voice-stt-webchat.d.ts +0 -3
  115. package/dist/src/channels/attachments/voice-stt-webchat.js +1 -24
  116. package/dist/src/chat-commands/builtins/goal.js +5 -4
  117. package/dist/src/cli/commands/agents.js +1 -1
  118. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  119. package/dist/src/cli/commands/goal.js +6 -5
  120. package/dist/src/cli/commands/tunnel.js +3 -3
  121. package/dist/src/connectors/learning-coordinator.js +7 -1
  122. package/dist/src/connectors/source-change-publisher.d.ts +17 -0
  123. package/dist/src/connectors/source-change-publisher.js +148 -0
  124. package/dist/src/discussions/analyzer.d.ts +35 -0
  125. package/dist/src/discussions/analyzer.js +127 -0
  126. package/dist/src/discussions/index.d.ts +7 -0
  127. package/dist/src/discussions/index.js +7 -0
  128. package/dist/src/discussions/live-worker.d.ts +33 -0
  129. package/dist/src/discussions/live-worker.js +148 -0
  130. package/dist/src/discussions/pipeline.d.ts +33 -0
  131. package/dist/src/discussions/pipeline.js +205 -0
  132. package/dist/src/discussions/project-inference.d.ts +13 -0
  133. package/dist/src/discussions/project-inference.js +19 -0
  134. package/dist/src/discussions/repository.d.ts +29 -0
  135. package/dist/src/discussions/repository.js +255 -0
  136. package/dist/src/discussions/service.d.ts +51 -0
  137. package/dist/src/discussions/service.js +335 -0
  138. package/dist/src/discussions/transcript.d.ts +3 -0
  139. package/dist/src/discussions/transcript.js +15 -0
  140. package/dist/src/discussions/types.d.ts +116 -0
  141. package/dist/src/discussions/types.js +10 -0
  142. package/dist/src/discussions/worker.d.ts +18 -0
  143. package/dist/src/discussions/worker.js +74 -0
  144. package/dist/src/extensions/activation-context.js +2 -1
  145. package/dist/src/extensions/sdk/testing.js +1 -1
  146. package/dist/src/gateway/agents-admin.js +1 -1
  147. package/dist/src/gateway/chat-stream/mapper.js +53 -3
  148. package/dist/src/gateway/chat-stream/protocol.d.ts +17 -1
  149. package/dist/src/gateway/heartbeat/service.js +1 -1
  150. package/dist/src/gateway/hono/app.js +8 -3
  151. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  152. package/dist/src/gateway/hono/middleware/auth.js +2 -2
  153. package/dist/src/gateway/hono/middleware/logger.js +1 -1
  154. package/dist/src/gateway/hono/middleware/strict-rate-limit.js +1 -1
  155. package/dist/src/gateway/hono/routes/agents.js +1 -1
  156. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
  157. package/dist/src/gateway/hono/routes/connectors.js +79 -0
  158. package/dist/src/gateway/hono/routes/discussions.d.ts +3 -0
  159. package/dist/src/gateway/hono/routes/discussions.js +177 -0
  160. package/dist/src/gateway/hono/routes/execution-receipts.d.ts +3 -0
  161. package/dist/src/gateway/hono/routes/execution-receipts.js +163 -0
  162. package/dist/src/gateway/hono/routes/exposure.js +1 -1
  163. package/dist/src/gateway/hono/routes/goals.js +3 -288
  164. package/dist/src/gateway/hono/routes/home.d.ts +2 -102
  165. package/dist/src/gateway/hono/routes/home.js +8 -424
  166. package/dist/src/gateway/hono/routes/index.js +6 -2
  167. package/dist/src/gateway/hono/routes/memory.js +7 -7
  168. package/dist/src/gateway/hono/routes/notes.js +30 -0
  169. package/dist/src/gateway/hono/routes/projects.js +8 -152
  170. package/dist/src/gateway/hono/routes/shares.js +1 -1
  171. package/dist/src/gateway/hono/routes/status.js +2 -2
  172. package/dist/src/gateway/hono/routes/tunnel.js +3 -3
  173. package/dist/src/gateway/hono/routes/voice.js +1 -1
  174. package/dist/src/gateway/hono/routes/work.d.ts +3 -0
  175. package/dist/src/gateway/hono/routes/work.js +207 -0
  176. package/dist/src/gateway/hono/routes/you.js +12 -14
  177. package/dist/src/gateway/index.js +2 -2
  178. package/dist/src/gateway/runtime-config.js +2 -2
  179. package/dist/src/gateway/security/audit.js +2 -2
  180. package/dist/src/gateway/security/index.js +1 -1
  181. package/dist/src/gateway/service/config-coordinator.js +1 -1
  182. package/dist/src/gateway/service/run-gateway-agent.js +46 -51
  183. package/dist/src/gateway/service.d.ts +8 -1
  184. package/dist/src/gateway/service.js +139 -12
  185. package/dist/src/goals/goal-queue-store.d.ts +1 -0
  186. package/dist/src/goals/goal-queue-store.js +5 -1
  187. package/dist/src/goals/goal-queue-types.d.ts +11 -1
  188. package/dist/src/goals/goal-runner.js +10 -6
  189. package/dist/src/goals/goal-service.d.ts +2 -15
  190. package/dist/src/goals/goal-service.js +9 -42
  191. package/dist/src/goals/goal-store.d.ts +1 -18
  192. package/dist/src/goals/goal-store.js +25 -231
  193. package/dist/src/goals/index.d.ts +0 -4
  194. package/dist/src/goals/index.js +1 -3
  195. package/dist/src/goals/types.d.ts +4 -66
  196. package/dist/src/heartbeat/index.js +1 -1
  197. package/dist/src/notes/agent-context.js +1 -1
  198. package/dist/src/notes/service.d.ts +1 -0
  199. package/dist/src/notes/service.js +9 -0
  200. package/dist/src/notes/types.d.ts +1 -0
  201. package/dist/src/proactive/events/product-event-bridge.d.ts +7 -0
  202. package/dist/src/proactive/events/product-event-bridge.js +84 -0
  203. package/dist/src/proactive/execution/context.d.ts +27 -11
  204. package/dist/src/proactive/execution/context.js +259 -25
  205. package/dist/src/proactive/execution/repository.js +18 -5
  206. package/dist/src/proactive/execution/types.d.ts +7 -1
  207. package/dist/src/proactive/execution/worker.js +7 -6
  208. package/dist/src/proactive/inbox/repository.js +8 -2
  209. package/dist/src/proactive/index.d.ts +4 -2
  210. package/dist/src/proactive/index.js +5 -3
  211. package/dist/src/proactive/temporal/worker.d.ts +16 -0
  212. package/dist/src/proactive/temporal/worker.js +110 -0
  213. package/dist/src/share/share-zip.js +1 -1
  214. package/dist/src/share/site-proxy.js +1 -1
  215. package/dist/src/storage/sqlite/activity-repository.d.ts +1 -0
  216. package/dist/src/storage/sqlite/activity-repository.js +4 -1
  217. package/dist/src/storage/sqlite/connector-sync-policy-repository.d.ts +20 -0
  218. package/dist/src/storage/sqlite/connector-sync-policy-repository.js +50 -0
  219. package/dist/src/storage/sqlite/execution-receipt-repository.d.ts +146 -0
  220. package/dist/src/storage/sqlite/execution-receipt-repository.js +235 -0
  221. package/dist/src/storage/sqlite/index.d.ts +4 -2
  222. package/dist/src/storage/sqlite/index.js +6 -4
  223. package/dist/src/storage/sqlite/knowledge-repository.d.ts +3 -0
  224. package/dist/src/storage/sqlite/knowledge-repository.js +9 -1
  225. package/dist/src/storage/sqlite/memory-records-repository.js +1 -1
  226. package/dist/src/storage/sqlite/migrations/075_connector_sync_policies.sql +13 -0
  227. package/dist/src/storage/sqlite/migrations/076_meeting_preparation_scenario.sql +29 -0
  228. package/dist/src/storage/sqlite/migrations/077_proactive_insight_fingerprints.sql +4 -0
  229. package/dist/src/storage/sqlite/migrations/078_discussion_captures.sql +64 -0
  230. package/dist/src/storage/sqlite/migrations/079_discussion_follow_up_scenario.sql +29 -0
  231. package/dist/src/storage/sqlite/migrations/080_task_outcome_context.sql +15 -0
  232. package/dist/src/storage/sqlite/migrations/081_project_monitoring_policies.sql +10 -0
  233. package/dist/src/storage/sqlite/migrations/082_one_click_live_discussions.sql +100 -0
  234. package/dist/src/storage/sqlite/migrations/083_session_task_plans.sql +9 -0
  235. package/dist/src/storage/sqlite/migrations/084_work_intake_lifecycle.sql +26 -0
  236. package/dist/src/storage/sqlite/migrations/085_task_outcome_projection.sql +19 -0
  237. package/dist/src/storage/sqlite/migrations/086_outcome_aggregates.sql +168 -0
  238. package/dist/src/storage/sqlite/migrations/087_context_snapshots.sql +21 -0
  239. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  240. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  241. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  242. package/dist/src/storage/sqlite/notes-repository.js +9 -0
  243. package/dist/src/storage/sqlite/schema.js +1 -1
  244. package/dist/src/storage/sqlite/schema.sql +89 -44
  245. package/dist/src/storage/sqlite/session-repository.js +1 -1
  246. package/dist/src/storage/sqlite/session-task-plan-repository.d.ts +20 -0
  247. package/dist/src/storage/sqlite/session-task-plan-repository.js +77 -0
  248. package/dist/src/tui/backends/embedded-backend.js +1 -1
  249. package/dist/src/tunnel/frpc-binary.js +1 -1
  250. package/dist/src/tunnel/frpc-extract.js +1 -1
  251. package/dist/src/tunnel/index.js +2 -2
  252. package/dist/src/user-context/context-compiler.d.ts +31 -0
  253. package/dist/src/user-context/context-compiler.js +51 -0
  254. package/dist/src/voice/local/model-files.js +1 -1
  255. package/dist/src/voice/stt/config.d.ts +4 -0
  256. package/dist/src/voice/stt/config.js +26 -0
  257. package/dist/src/voice/stt/index.d.ts +1 -0
  258. package/dist/src/voice/stt/index.js +2 -1
  259. package/dist/src/voice/stt/list-providers.js +1 -1
  260. package/dist/src/work/attention-governor.d.ts +20 -0
  261. package/dist/src/work/attention-governor.js +46 -0
  262. package/dist/src/work/execution-context.d.ts +16 -0
  263. package/dist/src/work/execution-context.js +66 -0
  264. package/dist/src/work/home-query-service.d.ts +118 -0
  265. package/dist/src/work/home-query-service.js +389 -0
  266. package/dist/src/work/index.d.ts +14 -0
  267. package/dist/src/work/index.js +15 -0
  268. package/dist/src/work/outcome-contract-definition.d.ts +8 -0
  269. package/dist/src/work/outcome-contract-definition.js +15 -0
  270. package/dist/src/work/outcome-execution-service.d.ts +27 -0
  271. package/dist/src/work/outcome-execution-service.js +60 -0
  272. package/dist/src/work/outcome-projection-service.d.ts +7 -0
  273. package/dist/src/work/outcome-projection-service.js +51 -0
  274. package/dist/src/work/outcome-receipt-service.d.ts +13 -0
  275. package/dist/src/work/outcome-receipt-service.js +55 -0
  276. package/dist/src/work/outcome-repository.d.ts +50 -0
  277. package/dist/src/work/outcome-repository.js +112 -0
  278. package/dist/src/work/outcome-run-coordinator.d.ts +25 -0
  279. package/dist/src/work/outcome-run-coordinator.js +117 -0
  280. package/dist/src/work/project-monitoring-service.d.ts +21 -0
  281. package/dist/src/work/project-monitoring-service.js +76 -0
  282. package/dist/src/work/project-operating-view-service.d.ts +10 -0
  283. package/dist/src/work/project-operating-view-service.js +46 -0
  284. package/dist/src/work/work-intake-repository.d.ts +49 -0
  285. package/dist/src/work/work-intake-repository.js +97 -0
  286. package/dist/src/work/work-intake-service.d.ts +26 -0
  287. package/dist/src/work/work-intake-service.js +171 -0
  288. package/dist/src/work/work-value-metrics-service.d.ts +4 -0
  289. package/dist/src/work/work-value-metrics-service.js +88 -0
  290. package/dist/src/work-items/work-item-service.d.ts +0 -2
  291. package/dist/src/work-items/work-item-service.js +0 -28
  292. package/dist/src/workflows/service/workflow-run-service.js +1 -1
  293. package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
  294. package/package.json +1 -1
  295. package/dist/gateway/static/root/assets/agents-DC9F12Kw.js +0 -2
  296. package/dist/gateway/static/root/assets/apps-page-5bKr05Fa.js +0 -1
  297. package/dist/gateway/static/root/assets/automation-suggestion-card-B7mxFRtf.js +0 -1
  298. package/dist/gateway/static/root/assets/automations-page-Dg6dmt5g.js +0 -6
  299. package/dist/gateway/static/root/assets/browser-settings-page-BHoo6Rpq.js +0 -8
  300. package/dist/gateway/static/root/assets/capabilities-settings-panel-BlsqN8Fu.js +0 -7
  301. package/dist/gateway/static/root/assets/capability-presets-settings-panel-DJeT8_B4.js +0 -1
  302. package/dist/gateway/static/root/assets/channels-settings-C4VVjYEm.js +0 -1
  303. package/dist/gateway/static/root/assets/channels-status-swr-vdf8kB16.js +0 -1
  304. package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +0 -1
  305. package/dist/gateway/static/root/assets/connectors-page-DNcrDThX.js +0 -2
  306. package/dist/gateway/static/root/assets/desktop-pet-B1urphOZ.js +0 -1
  307. package/dist/gateway/static/root/assets/desktop-pet-settings-DTL6J3EP.js +0 -1
  308. package/dist/gateway/static/root/assets/gateway-settings-DmObBx9b.js +0 -1
  309. package/dist/gateway/static/root/assets/goal-create-dialog-BRhmmBe9.js +0 -1
  310. package/dist/gateway/static/root/assets/goal-detail-page-C1k7_s_O.js +0 -4
  311. package/dist/gateway/static/root/assets/goals-config-api-Fwu1wjEP.js +0 -1
  312. package/dist/gateway/static/root/assets/goals-page-hOu9uA3q.js +0 -2
  313. package/dist/gateway/static/root/assets/goals-settings-DY-JjvHz.js +0 -1
  314. package/dist/gateway/static/root/assets/index-C0CGebQ1.js +0 -212
  315. package/dist/gateway/static/root/assets/index-eqq25gvV.css +0 -1
  316. package/dist/gateway/static/root/assets/local-app-workbench-page-EjsNT7nJ.js +0 -2
  317. package/dist/gateway/static/root/assets/logs-page-Dswjlraa.js +0 -7
  318. package/dist/gateway/static/root/assets/messages-DP6tPKk-.js +0 -3
  319. package/dist/gateway/static/root/assets/notes-workbench-DSh3-hMY.js +0 -4
  320. package/dist/gateway/static/root/assets/product-delivery-BTRT9kCS.js +0 -1
  321. package/dist/gateway/static/root/assets/project-detail-page-D0QPRHR_.js +0 -1
  322. package/dist/gateway/static/root/assets/projects-page-CI5Vz62F.js +0 -1
  323. package/dist/gateway/static/root/assets/remote-access-hub-S1jpzBS5.js +0 -1
  324. package/dist/gateway/static/root/assets/sessions-page-CTm66k7h.js +0 -1
  325. package/dist/gateway/static/root/assets/settings-advanced-gate-CU52AUVD.js +0 -1
  326. package/dist/gateway/static/root/assets/shares-settings-DK6XK95e.js +0 -1
  327. package/dist/gateway/static/root/assets/skill-reload-api-Bvv_u4ii.js +0 -1
  328. package/dist/gateway/static/root/assets/skills-page-BGHvVbay.js +0 -2
  329. package/dist/gateway/static/root/assets/time-picker-XwpxdZFr.js +0 -1
  330. package/dist/gateway/static/root/assets/user-context-page-DBCMk-Vn.js +0 -1
  331. package/dist/gateway/static/root/assets/work-discovery-page-C1UIdsCl.js +0 -1
  332. package/dist/gateway/static/root/assets/work-item-detail-page-DEAQepB8.js +0 -1
  333. package/dist/gateway/static/root/assets/work-page-D5qYmCTq.js +0 -3
  334. package/dist/gateway/static/root/assets/workflows-page-yrK17ZZ5.js +0 -11
  335. package/dist/src/agent/outcomes/task-verifier.d.ts +0 -29
  336. package/dist/src/gateway/hono/routes/task-outcomes.d.ts +0 -3
  337. package/dist/src/gateway/hono/routes/task-outcomes.js +0 -109
  338. package/dist/src/goals/goal-contract-draft.d.ts +0 -15
  339. package/dist/src/goals/goal-contract-draft.js +0 -112
  340. package/dist/src/goals/goal-evidence-review.d.ts +0 -15
  341. package/dist/src/goals/goal-evidence-review.js +0 -89
  342. package/dist/src/storage/sqlite/task-outcome-repository.d.ts +0 -90
  343. package/dist/src/storage/sqlite/task-outcome-repository.js +0 -138
@@ -11,7 +11,7 @@
11
11
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
12
12
  <link rel="manifest" href="/site.webmanifest?v=20260713-1" />
13
13
  <title>XOPC — Turn goals into loops. Keep what matters moving.</title>
14
- <script type="module" crossorigin src="/assets/index-C0CGebQ1.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-BDzspHrg.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
@@ -22,19 +22,18 @@
22
22
  <link rel="modulepreload" crossorigin href="/assets/vendor-swr-BIWyz7Rc.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DPHK1VkS.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
25
- <link rel="modulepreload" crossorigin href="/assets/circle-alert-BEjgurr2.js">
26
25
  <link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
27
- <link rel="modulepreload" crossorigin href="/assets/messages-DP6tPKk-.js">
28
- <link rel="modulepreload" crossorigin href="/assets/locale-store-CTwSy7yW.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/messages-DYqBwJAK.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/locale-store-DIVc0AQs.js">
29
28
  <link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
30
- <link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
31
- <link rel="modulepreload" crossorigin href="/assets/product-delivery-BTRT9kCS.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/schemas-C6onAggk.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/product-delivery-BVG-eWQO.js">
32
31
  <link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
33
32
  <link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
34
- <link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-BZEkOdPm.js">
35
- <link rel="modulepreload" crossorigin href="/assets/activity-store-BzGX__8I.js">
36
- <link rel="modulepreload" crossorigin href="/assets/theme-store-DFLyzoLO.js">
37
- <link rel="stylesheet" crossorigin href="/assets/index-eqq25gvV.css">
33
+ <link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-CKKL96r_.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/activity-store-A5FUMjeV.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/theme-store-DtwI_VLT.js">
36
+ <link rel="stylesheet" crossorigin href="/assets/index-B0Tdge_q.css">
38
37
  </head>
39
38
  <body>
40
39
  <div id="root"></div>
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.0.178";
2
+ var version = "0.0.179";
3
3
  //#endregion
4
4
  export { version };
@@ -0,0 +1,137 @@
1
+ import { z } from "zod";
2
+ //#region packages/gateway-contract/src/outcomes.ts
3
+ const OutcomeUserStatusSchema = z.enum([
4
+ "running",
5
+ "needs_user",
6
+ "completed"
7
+ ]);
8
+ const OutcomeInternalStatusSchema = z.enum([
9
+ "captured",
10
+ "planning",
11
+ "running",
12
+ "verifying",
13
+ "continuing",
14
+ "needs_user",
15
+ "blocked",
16
+ "paused",
17
+ "completed",
18
+ "cancelled"
19
+ ]);
20
+ const OutcomeImportanceSchema = z.enum([
21
+ "low",
22
+ "normal",
23
+ "high",
24
+ "critical"
25
+ ]);
26
+ const OutcomeContractSchema = z.object({
27
+ outcomeId: z.string(),
28
+ version: z.number().int().positive(),
29
+ objective: z.string(),
30
+ deliverables: z.array(z.string()),
31
+ acceptanceCriteria: z.array(z.string()),
32
+ constraints: z.array(z.string()),
33
+ approvalRequired: z.array(z.string()),
34
+ contextSnapshotId: z.string().optional(),
35
+ createdBy: z.enum(["user", "system"]),
36
+ createdAt: z.number()
37
+ });
38
+ const OutcomeSchema = z.object({
39
+ id: z.string(),
40
+ objective: z.string(),
41
+ userStatus: OutcomeUserStatusSchema,
42
+ internalStatus: OutcomeInternalStatusSchema,
43
+ importance: OutcomeImportanceSchema,
44
+ dueAt: z.number().optional(),
45
+ latestContractVersion: z.number().int().positive(),
46
+ latestReceiptRunId: z.string().optional(),
47
+ contract: OutcomeContractSchema.optional(),
48
+ createdAt: z.number(),
49
+ updatedAt: z.number()
50
+ });
51
+ z.object({
52
+ ok: z.literal(true),
53
+ items: z.array(OutcomeSchema)
54
+ });
55
+ const OutcomeActionSchema = z.enum([
56
+ "run",
57
+ "pause",
58
+ "resume",
59
+ "cancel"
60
+ ]);
61
+ const OutcomeActionRequestSchema = z.object({ action: OutcomeActionSchema });
62
+ const OutcomeReceiptStatusSchema = z.enum([
63
+ "running",
64
+ "completed",
65
+ "partial",
66
+ "needs_user",
67
+ "failed",
68
+ "cancelled"
69
+ ]);
70
+ const OutcomeEvidenceSchema = z.object({
71
+ kind: z.enum([
72
+ "artifact",
73
+ "test",
74
+ "state",
75
+ "source"
76
+ ]),
77
+ title: z.string(),
78
+ summary: z.string(),
79
+ uri: z.string().optional(),
80
+ verifies: z.array(z.string()).optional()
81
+ });
82
+ const OutcomeReceiptSchema = z.object({
83
+ runId: z.string(),
84
+ outcomeId: z.string().optional(),
85
+ contractVersion: z.number().int().positive().optional(),
86
+ sessionKey: z.string(),
87
+ objective: z.string(),
88
+ status: OutcomeReceiptStatusSchema,
89
+ summary: z.string(),
90
+ projectId: z.string().optional(),
91
+ goalId: z.string().optional(),
92
+ workItemId: z.string().optional(),
93
+ origin: z.string().optional(),
94
+ triggerKind: z.string().optional(),
95
+ changes: z.array(OutcomeEvidenceSchema),
96
+ evidence: z.array(OutcomeEvidenceSchema),
97
+ verification: z.object({
98
+ status: z.enum([
99
+ "passed",
100
+ "failed",
101
+ "unverified"
102
+ ]),
103
+ checks: z.array(z.object({
104
+ criterion: z.string(),
105
+ status: z.enum([
106
+ "passed",
107
+ "failed",
108
+ "unverified"
109
+ ]),
110
+ evidenceTitles: z.array(z.string())
111
+ }))
112
+ }),
113
+ remainingWork: z.array(z.string()),
114
+ nextAction: z.string().optional(),
115
+ needsUser: z.boolean(),
116
+ completionVerdict: z.enum([
117
+ "achieved",
118
+ "partial",
119
+ "not_achieved"
120
+ ]).optional(),
121
+ correctionText: z.string().optional(),
122
+ contextTraceId: z.string().optional(),
123
+ startedAt: z.number(),
124
+ completedAt: z.number().optional(),
125
+ feedback: z.object({
126
+ outcome: z.enum(["helpful", "not_helpful"]),
127
+ reason: z.string().optional(),
128
+ needsCorrection: z.boolean().optional(),
129
+ supportFit: z.boolean().optional()
130
+ }).optional()
131
+ });
132
+ z.object({
133
+ ok: z.literal(true),
134
+ items: z.array(OutcomeReceiptSchema)
135
+ });
136
+ //#endregion
137
+ export { OutcomeActionRequestSchema, OutcomeUserStatusSchema };
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  const ProductReferenceKindSchema = z.enum([
3
+ "outcome",
3
4
  "project",
4
5
  "note",
5
6
  "work_item",
@@ -0,0 +1,85 @@
1
+ import { z } from "zod";
2
+ //#region packages/gateway-contract/src/work-intake.ts
3
+ const WorkExecutionModeSchema = z.enum(["create_only", "run_now"]);
4
+ const WorkExecutionStatusSchema = z.enum([
5
+ "not_started",
6
+ "queued",
7
+ "running",
8
+ "retry_waiting",
9
+ "succeeded",
10
+ "failed",
11
+ "skipped"
12
+ ]);
13
+ const MonitoringModeSchema = z.enum([
14
+ "observe",
15
+ "ask_before_action",
16
+ "auto_low_risk"
17
+ ]);
18
+ const QuietHoursSchema = z.object({
19
+ startHour: z.number().int().min(0).max(23),
20
+ endHour: z.number().int().min(0).max(23),
21
+ timezone: z.string().min(1)
22
+ });
23
+ z.object({
24
+ projectId: z.string(),
25
+ mode: MonitoringModeSchema,
26
+ quietHours: QuietHoursSchema.optional(),
27
+ allowedActions: z.array(z.string()),
28
+ confidenceThreshold: z.number().min(0).max(1),
29
+ scenarios: z.array(z.string()),
30
+ configured: z.boolean(),
31
+ updatedAt: z.number().optional()
32
+ });
33
+ const ProjectMonitoringUpdateSchema = z.object({
34
+ mode: MonitoringModeSchema.optional(),
35
+ quietHours: QuietHoursSchema.nullable().optional(),
36
+ allowedActions: z.array(z.string()).optional(),
37
+ confidenceThreshold: z.number().min(0).max(1).optional(),
38
+ scenarios: z.array(z.string()).optional()
39
+ });
40
+ z.object({
41
+ id: z.string(),
42
+ objective: z.string(),
43
+ projectId: z.string().optional(),
44
+ planningContext: z.object({
45
+ supportMode: z.enum([
46
+ "efficient",
47
+ "coach",
48
+ "companion",
49
+ "auto"
50
+ ]),
51
+ proactiveEnabled: z.boolean()
52
+ }),
53
+ outcomeContract: z.object({
54
+ objective: z.string(),
55
+ deliverables: z.array(z.string()),
56
+ acceptanceCriteria: z.array(z.string()),
57
+ constraints: z.array(z.string()),
58
+ approvalRequired: z.array(z.string())
59
+ }),
60
+ expiresAt: z.number()
61
+ });
62
+ const WorkIntakeCreateRequestSchema = z.object({
63
+ idempotencyKey: z.string().min(1).max(200),
64
+ objective: z.string().min(1).max(12e3),
65
+ projectId: z.string().min(1).optional(),
66
+ sessionKey: z.string().min(1).optional(),
67
+ agentId: z.string().min(1).optional()
68
+ });
69
+ const WorkIntakeConfirmRequestSchema = z.object({
70
+ executionMode: WorkExecutionModeSchema,
71
+ projectId: z.string().min(1).optional()
72
+ });
73
+ z.object({
74
+ outcomeId: z.string(),
75
+ projectId: z.string().optional(),
76
+ goalId: z.string(),
77
+ sessionKey: z.string().optional(),
78
+ execution: z.object({
79
+ mode: WorkExecutionModeSchema,
80
+ status: WorkExecutionStatusSchema,
81
+ queueId: z.string().optional()
82
+ })
83
+ });
84
+ //#endregion
85
+ export { ProjectMonitoringUpdateSchema, WorkIntakeConfirmRequestSchema, WorkIntakeCreateRequestSchema };
@@ -9,4 +9,5 @@ export declare class ActivityService {
9
9
  export declare class ObjectLinkService {
10
10
  create(input: CreateObjectLinkInput): ObjectLink;
11
11
  listForObject(object: ActivityObjectRef): ObjectLink[];
12
+ delete(id: string): boolean;
12
13
  }
@@ -1,4 +1,4 @@
1
- import { createObjectLinkRecord, getActivityEventRecord, listActivityRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, recordActivityEvent } from "../storage/sqlite/activity-repository.js";
1
+ import { createObjectLinkRecord, deleteObjectLinkRecord, getActivityEventRecord, listActivityRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, recordActivityEvent } from "../storage/sqlite/activity-repository.js";
2
2
  import "../storage/sqlite/index.js";
3
3
  import { randomUUID } from "node:crypto";
4
4
  //#region src/activity/service.ts
@@ -52,6 +52,9 @@ var ObjectLinkService = class {
52
52
  listForObject(object) {
53
53
  return listObjectLinkRecords(object);
54
54
  }
55
+ delete(id) {
56
+ return deleteObjectLinkRecord(id);
57
+ }
55
58
  };
56
59
  //#endregion
57
60
  export { ActivityService, ObjectLinkService };
@@ -9,8 +9,8 @@ import { accessSync, chmodSync, constants, copyFileSync, createReadStream, creat
9
9
  import { execFile } from "node:child_process";
10
10
  import { createHash, randomBytes } from "node:crypto";
11
11
  import { promisify } from "node:util";
12
- import { Readable } from "node:stream";
13
12
  import { pipeline } from "node:stream/promises";
13
+ import { Readable } from "node:stream";
14
14
  import lockfile from "proper-lockfile";
15
15
  //#region src/agent/code-intelligence/binary.ts
16
16
  init_paths();
@@ -6,7 +6,7 @@ export type ExecutionObjective = {
6
6
  status: string;
7
7
  scopeBoundary?: string;
8
8
  acceptanceCriteria: string[];
9
- evidencePlan: string[];
9
+ deliverables: string[];
10
10
  nextAction?: string;
11
11
  blockedReason?: string;
12
12
  } | {
@@ -2,6 +2,7 @@ import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
2
2
  import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
3
3
  import "../../storage/sqlite/index.js";
4
4
  import { GoalService } from "../../goals/goal-service.js";
5
+ import { OutcomeRepository } from "../../work/outcome-repository.js";
5
6
  import "../../goals/index.js";
6
7
  import { sanitizeForPromptLiteral } from "../prompt/sanitize-for-prompt.js";
7
8
  import { buildActiveProjectContextForPrompt } from "./project-context.js";
@@ -14,15 +15,16 @@ function bounded(value, max = MAX_OBJECTIVE_TEXT) {
14
15
  return text.length <= max ? text : `${text.slice(0, max - 1).trimEnd()}…`;
15
16
  }
16
17
  function goalObjective(goal) {
18
+ const contract = new OutcomeRepository().getContract(goal.outcomeId, goal.outcomeContractVersion);
17
19
  return {
18
20
  kind: "goal",
19
21
  id: goal.id,
20
22
  title: goal.title,
21
- objective: goal.contract?.objective?.trim() || goal.title,
23
+ objective: contract?.objective.trim() || goal.title,
22
24
  status: goal.status,
23
- scopeBoundary: bounded(goal.contract?.scopeBoundary),
25
+ scopeBoundary: bounded(contract?.constraints.join("\n")),
24
26
  acceptanceCriteria: goal.checklist.slice(0, MAX_CRITERIA).map((item) => item.text),
25
- evidencePlan: goal.contract?.evidencePlan.slice(0, MAX_CRITERIA) ?? [],
27
+ deliverables: contract?.deliverables.slice(0, MAX_CRITERIA) ?? [],
26
28
  nextAction: bounded(goal.nextAction),
27
29
  blockedReason: bounded(goal.blockedReason)
28
30
  };
@@ -69,7 +71,7 @@ function formatCurrentWorkForPrompt(scope) {
69
71
  if (objective.kind === "goal") {
70
72
  if (objective.scopeBoundary) lines.push("", "## Scope Boundary", sanitizeForPromptLiteral(objective.scopeBoundary));
71
73
  if (objective.acceptanceCriteria.length > 0) lines.push("", "## Acceptance Criteria", ...objective.acceptanceCriteria.map((item) => `- ${sanitizeForPromptLiteral(item)}`));
72
- if (objective.evidencePlan.length > 0) lines.push("", "## Completion Evidence", ...objective.evidencePlan.map((item) => `- ${sanitizeForPromptLiteral(item)}`));
74
+ if (objective.deliverables.length > 0) lines.push("", "## Deliverables", ...objective.deliverables.map((item) => `- ${sanitizeForPromptLiteral(item)}`));
73
75
  if (objective.nextAction) lines.push("", "Next action:", sanitizeForPromptLiteral(objective.nextAction));
74
76
  if (objective.blockedReason) lines.push("", "Blocked reason:", sanitizeForPromptLiteral(objective.blockedReason));
75
77
  }
@@ -3,6 +3,7 @@ import { init_logger } from "../../utils/logger.js";
3
3
  import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
4
4
  import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
5
5
  import { GoalService } from "../../goals/goal-service.js";
6
+ import { OutcomeRepository } from "../../work/outcome-repository.js";
6
7
  import { resolveGoalUiLocale } from "./goal-locale.js";
7
8
  import { evaluateAfterTurnHermesLike } from "./evaluate-turn.js";
8
9
  import "../../goals/index.js";
@@ -22,9 +23,10 @@ function buildHistoryExcerpt(messages, maxChars) {
22
23
  }
23
24
  }
24
25
  function buildGoalContextText(goal) {
25
- const lines = [`Title: ${goal.contract?.objective || goal.title}`];
26
- if (goal.contract?.scopeBoundary) lines.push(`Scope boundary:\n${goal.contract.scopeBoundary}`);
27
- if (goal.contract?.evidencePlan.length) lines.push(`Expected completion evidence:\n${goal.contract.evidencePlan.map((item) => `- ${item}`).join("\n")}`);
26
+ const contract = new OutcomeRepository().getContract(goal.outcomeId, goal.outcomeContractVersion);
27
+ const lines = [`Outcome: ${contract?.objective ?? goal.title}`];
28
+ if (contract?.constraints.length) lines.push(`Constraints:\n${contract.constraints.map((item) => `- ${item}`).join("\n")}`);
29
+ if (contract?.deliverables.length) lines.push(`Deliverables:\n${contract.deliverables.map((item) => `- ${item}`).join("\n")}`);
28
30
  if (goal.contextMessage?.text.trim()) lines.push(`Context:\n${goal.contextMessage.text.trim()}`);
29
31
  if (goal.contextMessage?.attachments.length) lines.push(["Attachments:", ...goal.contextMessage.attachments.map((attachment) => `- ${attachment.name} (${attachment.mimeType}, ${attachment.size} bytes) ${attachment.uri}`)].join("\n"));
30
32
  return lines.join("\n\n");
@@ -101,8 +103,7 @@ async function handlePersistentGoalPostTurn(opts) {
101
103
  goalContextExcerpt: buildGoalContextText(goal),
102
104
  uiLocale: resolveGoalUiLocale(state)
103
105
  });
104
- const completionReadiness = goalService.getCompletionReadiness(goal.id);
105
- const executionGaps = completionReadiness ? [...completionReadiness.missingEvidence, ...completionReadiness.pendingOutcome] : [];
106
+ const executionGaps = goalService.getCompletionReadiness(goal.id)?.pendingCriteria ?? [];
106
107
  if (decision.verdict === "done" && executionGaps.length > 0 && decision.newState) {
107
108
  const reason = `Completion evidence or outcome still needed: ${executionGaps.join("; ")}`;
108
109
  decision = {
@@ -1,7 +1,7 @@
1
1
  import { killProcessTree } from "../../process/kill-tree.js";
2
2
  import { spawn } from "node:child_process";
3
- import process from "node:process";
4
3
  import { PassThrough } from "node:stream";
4
+ import process from "node:process";
5
5
  import { getDefaultEnvironment } from "@modelcontextprotocol/sdk/client/stdio.js";
6
6
  import { ReadBuffer, serializeMessage } from "@modelcontextprotocol/sdk/shared/stdio.js";
7
7
  //#region src/agent/mcp/mcp-stdio-transport.ts
@@ -14,6 +14,7 @@ export declare class UserContextCoordinator {
14
14
  private readonly userTurn;
15
15
  private readonly correctionTargets;
16
16
  private readonly planner;
17
+ private readonly contextCompiler;
17
18
  constructor(options: UserContextCoordinatorOptions);
18
19
  forgetSession(sessionKey: string): void;
19
20
  clear(): void;
@@ -2,6 +2,7 @@ import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { setLatestMemoryInjectFeedback } from "../../storage/sqlite/memory-records-repository.js";
4
4
  import "../../storage/sqlite/index.js";
5
+ import { ContextCompiler } from "../../user-context/context-compiler.js";
5
6
  import { shouldPlanUserContextThisTurn } from "./memory-config.js";
6
7
  import { UserContextPlanner } from "./context/planner.js";
7
8
  import { isExplicitUnderstandingCorrection } from "./understanding/correction.js";
@@ -13,6 +14,7 @@ var UserContextCoordinator = class {
13
14
  userTurn = /* @__PURE__ */ new Map();
14
15
  correctionTargets = /* @__PURE__ */ new Map();
15
16
  planner = new UserContextPlanner();
17
+ contextCompiler = new ContextCompiler();
16
18
  constructor(options) {
17
19
  this.options = options;
18
20
  }
@@ -61,7 +63,7 @@ var UserContextCoordinator = class {
61
63
  const turn = (this.userTurn.get(sessionKey) ?? 0) + 1;
62
64
  this.userTurn.set(sessionKey, turn);
63
65
  if (!shouldPlanUserContextThisTurn(config, turn)) return empty();
64
- return this.planner.plan({
66
+ const plan = await this.planner.plan({
65
67
  memoryManager: this.options.getMemoryManagerForSession(sessionKey),
66
68
  agentId: this.options.getAgentIdForSession(sessionKey),
67
69
  sessionKey,
@@ -69,6 +71,20 @@ var UserContextCoordinator = class {
69
71
  userMessage,
70
72
  excludedRecordIds
71
73
  });
74
+ if (plan.traceId) try {
75
+ this.contextCompiler.capture({
76
+ sessionKey,
77
+ query,
78
+ plan
79
+ });
80
+ } catch (err) {
81
+ log.debug({
82
+ err,
83
+ sessionKey,
84
+ traceId: plan.traceId
85
+ }, "Context snapshot was not persisted");
86
+ }
87
+ return plan;
72
88
  }
73
89
  async afterTurn(sessionKey, userPlainText) {
74
90
  if (!this.options.isEnabledForSession(sessionKey)) return void 0;
@@ -1,5 +1,5 @@
1
- import type { TaskOutcome } from '../../storage/sqlite/task-outcome-repository.js';
2
- export interface TaskEvaluationReplay {
1
+ import type { ExecutionReceipt } from '../../storage/sqlite/execution-receipt-repository.js';
2
+ export interface ExecutionEvaluationReplay {
3
3
  total: number;
4
4
  falseCompletions: number;
5
5
  verificationDrift: number;
@@ -17,4 +17,4 @@ export interface TaskEvaluationReplay {
17
17
  replayedVerification: string;
18
18
  }>;
19
19
  }
20
- export declare function replayTaskEvaluation(outcomes: TaskOutcome[]): TaskEvaluationReplay;
20
+ export declare function replayExecutionEvaluation(outcomes: ExecutionReceipt[]): ExecutionEvaluationReplay;
@@ -1,13 +1,13 @@
1
- import { verifyTaskCompletion } from "./task-verifier.js";
2
- //#region src/agent/outcomes/task-evaluation.ts
3
- function replayTaskEvaluation(outcomes) {
1
+ import { verifyExecutionCompletion } from "./execution-verifier.js";
2
+ //#region src/agent/outcomes/execution-evaluation.ts
3
+ function replayExecutionEvaluation(outcomes) {
4
4
  const completed = outcomes.filter((outcome) => outcome.status !== "running");
5
5
  const byChannel = {};
6
6
  const cases = [];
7
7
  let falseCompletions = 0;
8
8
  let supportMismatches = 0;
9
9
  for (const outcome of completed) {
10
- const replayed = verifyTaskCompletion({
10
+ const replayed = verifyExecutionCompletion({
11
11
  status: outcome.status,
12
12
  acceptanceCriteria: outcome.contract?.acceptanceCriteria ?? [],
13
13
  evidence: outcome.evidence
@@ -45,4 +45,4 @@ function replayTaskEvaluation(outcomes) {
45
45
  };
46
46
  }
47
47
  //#endregion
48
- export { replayTaskEvaluation };
48
+ export { replayExecutionEvaluation };
@@ -0,0 +1,29 @@
1
+ export type ExecutionVerificationStatus = 'passed' | 'failed' | 'unverified';
2
+ export type ExecutionFailurePhase = 'planning' | 'execution' | 'verification' | 'approval' | 'runtime';
3
+ export type ExecutionFailureCode = 'cancelled' | 'timeout' | 'tool_failed' | 'verification_failed' | 'approval_required' | 'conflict' | 'model_failed' | 'unknown';
4
+ export type ExecutionRecoveryAction = 'replan' | 'retry_with_changed_strategy' | 'request_user_input' | 'none';
5
+ export interface ExecutionVerification {
6
+ status: ExecutionVerificationStatus;
7
+ checks: Array<{
8
+ criterion: string;
9
+ status: ExecutionVerificationStatus;
10
+ evidenceTitles: string[];
11
+ }>;
12
+ }
13
+ export interface ExecutionFailureDiagnosis {
14
+ code: ExecutionFailureCode;
15
+ phase: ExecutionFailurePhase;
16
+ recoveryAction: ExecutionRecoveryAction;
17
+ }
18
+ export declare function verifyExecutionCompletion(input: {
19
+ status: 'succeeded' | 'failed' | 'cancelled';
20
+ acceptanceCriteria: string[];
21
+ evidence: Array<{
22
+ title: string;
23
+ verifies?: string[];
24
+ }>;
25
+ }): ExecutionVerification;
26
+ export declare function diagnoseExecutionFailure(input: {
27
+ status: 'failed' | 'cancelled';
28
+ summary: string;
29
+ }): ExecutionFailureDiagnosis;
@@ -1,5 +1,5 @@
1
- //#region src/agent/outcomes/task-verifier.ts
2
- function verifyTaskCompletion(input) {
1
+ //#region src/agent/outcomes/execution-verifier.ts
2
+ function verifyExecutionCompletion(input) {
3
3
  const checks = input.acceptanceCriteria.map((criterion) => {
4
4
  const evidenceTitles = input.evidence.filter((evidence) => evidence.verifies?.includes(criterion)).map((evidence) => evidence.title);
5
5
  return {
@@ -24,7 +24,7 @@ function verifyTaskCompletion(input) {
24
24
  checks
25
25
  };
26
26
  }
27
- function diagnoseTaskFailure(input) {
27
+ function diagnoseExecutionFailure(input) {
28
28
  const text = input.summary.toLocaleLowerCase();
29
29
  if (input.status === "cancelled") return {
30
30
  code: "cancelled",
@@ -68,4 +68,4 @@ function diagnoseTaskFailure(input) {
68
68
  };
69
69
  }
70
70
  //#endregion
71
- export { diagnoseTaskFailure, verifyTaskCompletion };
71
+ export { diagnoseExecutionFailure, verifyExecutionCompletion };
@@ -4,8 +4,10 @@ import { formatAgentRunErrorForClient } from "../client-error-format.js";
4
4
  import { resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel } from "../../session/thinking-resolve.js";
5
5
  import { initSessionTurn } from "../../session/init-session-turn.js";
6
6
  import "../../session/index.js";
7
- import { isVoiceLikeAttachment, mergeSttConfigFromAppConfig, mergeVoiceTranscriptsIntoUserText } from "../../channels/attachments/voice-stt-webchat.js";
7
+ import { mergeSttConfigFromAppConfig } from "../../voice/stt/config.js";
8
+ import "../../voice/stt/index.js";
8
9
  import { abortEmbeddedRun } from "../embedded/runs.js";
10
+ import { isVoiceLikeAttachment, mergeVoiceTranscriptsIntoUserText } from "../../channels/attachments/voice-stt-webchat.js";
9
11
  import { applyReasoningVisibilityToSseEvent } from "../streaming/reasoning-visibility-sse.js";
10
12
  import { injectSourceContextIntoUserMessage } from "../source-context/injector.js";
11
13
  import { isSessionSourceBinding } from "../source-context/types.js";
@@ -1,5 +1,8 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
4
+ import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
5
+ import "../../storage/sqlite/index.js";
3
6
  import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
4
7
  import { createReadFileTool } from "./read.js";
5
8
  import { createWriteFileTool } from "./write.js";
@@ -217,7 +220,19 @@ var AgentToolsFactory = class {
217
220
  if (!CLARIFY_SUPPORTED_CHANNELS.has(ctx.channel)) return null;
218
221
  return (r) => req(ctx.sessionKey, r);
219
222
  } }),
220
- createTodoTool({ getSessionKey: () => this.deps.getCurrentContext()?.sessionKey }),
223
+ createTodoTool({
224
+ getSessionKey: () => this.deps.getCurrentContext()?.sessionKey,
225
+ repository: {
226
+ isAvailable: isXopcDatabaseOpen,
227
+ read: (sessionKey) => getSessionTaskPlan(sessionKey)?.items ?? [],
228
+ write: (sessionKey, items) => {
229
+ setSessionTaskPlan({
230
+ sessionKey,
231
+ items
232
+ });
233
+ }
234
+ }
235
+ }),
221
236
  createUpdatePlanTool(),
222
237
  ...getSkillMgr ? [
223
238
  createSkillsListTool({
@@ -3,6 +3,8 @@ import "../../storage/sqlite/index.js";
3
3
  import { GoalService } from "../../goals/goal-service.js";
4
4
  import "../../goals/index.js";
5
5
  import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
6
+ import { OutcomeExecutionService } from "../../work/outcome-execution-service.js";
7
+ import "../../work/index.js";
6
8
  import { Type } from "@sinclair/typebox";
7
9
  //#region src/agent/tools/goal-tool.ts
8
10
  const GoalToolSchema = Type.Object({
@@ -92,8 +94,8 @@ function createGoalTool(options = {}) {
92
94
  if (!title) return textResult("Error: title is required.");
93
95
  const sessionKey = params.sessionKey?.trim() || options.getCurrentSessionKey?.()?.trim();
94
96
  const projectId = params.projectId?.trim() || (sessionKey ? getSessionMetadata(sessionKey)?.projectId : void 0);
95
- const goal = goals.create({
96
- title,
97
+ const goal = new OutcomeExecutionService().create({
98
+ objective: title,
97
99
  description: params.description,
98
100
  agentId: params.agentId,
99
101
  sessionKey,
@@ -103,7 +105,7 @@ function createGoalTool(options = {}) {
103
105
  judgeModelRef: params.judgeModelRef,
104
106
  maxTurns: params.maxTurns,
105
107
  source: "workflow"
106
- });
108
+ }).goal;
107
109
  return textResult(`Created goal ${goal.id}\n${goal.title}`, {
108
110
  goal,
109
111
  delivery: goalDelivery(goal, "created")
@@ -16,6 +16,11 @@ export declare class TodoStore {
16
16
  export interface CreateTodoToolOptions {
17
17
  /** Resolve session key for isolated lists; defaults to a single in-memory list. */
18
18
  getSessionKey?: () => string | null | undefined;
19
+ repository?: {
20
+ isAvailable?: () => boolean;
21
+ read: (sessionKey: string) => TodoItem[];
22
+ write: (sessionKey: string, items: TodoItem[]) => void;
23
+ };
19
24
  }
20
25
  /**
21
26
  * In-session task list for multi-step work. One {@link TodoStore} per session key.