@xopcai/xopc 0.0.410 → 0.0.411

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 (686) hide show
  1. package/README.md +12 -6
  2. package/README.zh-CN.md +12 -6
  3. package/dist/browser-ext/dist/assets/{page-context-A5RCibM_.js → page-context-MuzjMBlJ.js} +1 -1
  4. package/dist/browser-ext/dist/background.js +1 -1
  5. package/dist/browser-ext/dist/sidepanel.html +1 -1
  6. package/dist/browser-ext/dist/sidepanel.js +1 -1
  7. package/dist/browser-ext/manifest.json +1 -1
  8. package/dist/extensions/feishu/src/adapters/gateway-setup.js +9 -3
  9. package/dist/extensions/feishu/src/plugin.d.ts +0 -3
  10. package/dist/extensions/feishu/src/plugin.js +1 -11
  11. package/dist/extensions/feishu/src/schema/config-schema.d.ts +0 -2
  12. package/dist/extensions/feishu/src/schema/config-schema.js +9 -21
  13. package/dist/extensions/feishu/src/state/accounts.js +3 -7
  14. package/dist/extensions/telegram/src/plugin.d.ts +0 -3
  15. package/dist/extensions/telegram/src/plugin.js +0 -9
  16. package/dist/extensions/telegram/xopc.extension.json +1 -1
  17. package/dist/extensions/weixin/src/plugin.d.ts +0 -3
  18. package/dist/extensions/weixin/src/plugin.js +1 -12
  19. package/dist/gateway/static/root/assets/agent-avatar-dicebear-sGJnq-SA.js +1 -0
  20. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BI7OTo-T.js +1 -0
  21. package/dist/gateway/static/root/assets/agents-RIXL0p7_.js +77 -0
  22. package/dist/gateway/static/root/assets/{agents-admin-api-D0UyB0Y_.js → agents-admin-api-uGDeJR1f.js} +1 -1
  23. package/dist/gateway/static/root/assets/app-management-settings-panel-BGzhSS6H.js +1 -0
  24. package/dist/gateway/static/root/assets/{appearance-settings-byEnJz9H.js → appearance-settings-DtEZq4b2.js} +1 -1
  25. package/dist/gateway/static/root/assets/apps-page-DZqBof2D.js +1 -0
  26. package/dist/gateway/static/root/assets/{archive-plugin-BXssEuq3.js → archive-plugin-CGdU_E5B.js} +1 -1
  27. package/dist/gateway/static/root/assets/{automation-display-DCkjVzA0.js → automation-display-BFN7zWBg.js} +1 -1
  28. package/dist/gateway/static/root/assets/{automations-page-C-puATkS.js → automations-page-BAPZY56r.js} +1 -1
  29. package/dist/gateway/static/root/assets/automations-workspace-CI-yQnSj.js +8 -0
  30. package/dist/gateway/static/root/assets/{binary-plugins-DBz_2AhG.js → binary-plugins-B0ispXo2.js} +1 -1
  31. package/dist/gateway/static/root/assets/{block-editor-BOO5kjIl.js → block-editor-B9Ci-prO.js} +40 -40
  32. package/dist/gateway/static/root/assets/{browser-automation-inputs-D8bZ9iz2.js → browser-automation-inputs-D4-vQc4g.js} +1 -1
  33. package/dist/gateway/static/root/assets/browser-automations-page-Xzdif447.js +3 -0
  34. package/dist/gateway/static/root/assets/browser-settings-page-Bhu-83eC.js +3 -0
  35. package/dist/gateway/static/root/assets/capabilities-B9b5KCBb.js +1 -0
  36. package/dist/gateway/static/root/assets/capabilities-page-BIc0Zlsw.js +2 -0
  37. package/dist/gateway/static/root/assets/capabilities-settings-panel-CQEfpLdj.js +8 -0
  38. package/dist/gateway/static/root/assets/{capability-header-actions-yfPUz5Wt.js → capability-header-actions-Cic05oWh.js} +1 -1
  39. package/dist/gateway/static/root/assets/channels-DQbEoo_o.js +1 -0
  40. package/dist/gateway/static/root/assets/{chat-terminal-dock-Dlzn80cK.js → chat-terminal-dock-Bm-IGeDe.js} +2 -2
  41. package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-B2HK1psj.js → chunk-KS7C4IRE-BvcCCgTW.js} +2 -2
  42. package/dist/gateway/static/root/assets/computer-settings-page-C9xMfwXK.js +1 -0
  43. package/dist/gateway/static/root/assets/connector-service-page-DcdASUU9.js +1 -0
  44. package/dist/gateway/static/root/assets/connectors-page-eh-xpMPK.js +1 -0
  45. package/dist/gateway/static/root/assets/date-formatters-DukWSVwc.js +1 -0
  46. package/dist/gateway/static/root/assets/{date-picker-DGjpqOKx.js → date-picker-gVLWu9R0.js} +1 -1
  47. package/dist/gateway/static/root/assets/dependency-picker-C0LARyok.js +1 -0
  48. package/dist/gateway/static/root/assets/desktop-pet-settings-B_-j-D4W.js +1 -0
  49. package/dist/gateway/static/root/assets/desktop-pet-v_le3sCs.js +1 -0
  50. package/dist/gateway/static/root/assets/device-pairing-wizard-CxG_FcQ6.js +1 -0
  51. package/dist/gateway/static/root/assets/{directory-picker-path-field-CwT1LcLR.js → directory-picker-path-field-CBefVUPR.js} +1 -1
  52. package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +1 -0
  53. package/dist/gateway/static/root/assets/{extension-debug-page-DX-hX_d0.js → extension-debug-page-CTe7Molh.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-page-Cji87mN9.js → extension-page-C0-oP7S_.js} +1 -1
  55. package/dist/gateway/static/root/assets/{extension-settings-page-BulzpwBD.js → extension-settings-page-DYJmgMUg.js} +1 -1
  56. package/dist/gateway/static/root/assets/files-Bw4SBGdM.js +1 -0
  57. package/dist/gateway/static/root/assets/{gateway-config-swr-CTXr917C.js → gateway-config-swr-BVqYVaGy.js} +1 -1
  58. package/dist/gateway/static/root/assets/gateway-realtime-CY1LBGBS.js +1 -0
  59. package/dist/gateway/static/root/assets/gateway-realtime-store-Dafw95ol.js +1 -0
  60. package/dist/gateway/static/root/assets/gateway-settings-C13P4lQd.js +1 -0
  61. package/dist/gateway/static/root/assets/{gateway-startup-retry-DD2fsxdd.js → gateway-startup-retry-CPKGkr6D.js} +1 -1
  62. package/dist/gateway/static/root/assets/highlight-code-CslBKXdS.js +1 -0
  63. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BgTqMa_d.js → highlighted-body-KQOG7T2V-CN5PNRN3.js} +1 -1
  64. package/dist/gateway/static/root/assets/home-page-B_XrkGmA.js +2 -0
  65. package/dist/gateway/static/root/assets/image-generation-api-DRLXG9Ws.js +1 -0
  66. package/dist/gateway/static/root/assets/imports-page--cuF5vwU.js +1 -0
  67. package/dist/gateway/static/root/assets/index-6YjAt50A.js +710 -0
  68. package/dist/gateway/static/root/assets/index-caRW34rg.css +1 -0
  69. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-5g2PxgBs.js +1 -0
  70. package/dist/gateway/static/root/assets/languages-byq_L2Ae.js +2 -0
  71. package/dist/gateway/static/root/assets/local-app-workbench-page-B6U1HQpp.js +1 -0
  72. package/dist/gateway/static/root/assets/local-apps-page-BChE6nUD.js +1 -0
  73. package/dist/gateway/static/root/assets/{local-session-drafts-TqLFKwYo.js → local-session-drafts-BCaC-1rH.js} +1 -1
  74. package/dist/gateway/static/root/assets/locale-store-DAgpZxAS.js +1 -0
  75. package/dist/gateway/static/root/assets/logs-page-B9mq03SK.js +2 -0
  76. package/dist/gateway/static/root/assets/management-settings-2W_qJsha.js +1 -0
  77. package/dist/gateway/static/root/assets/markdown-editor-phTQ0mox.js +1 -0
  78. package/dist/gateway/static/root/assets/{media-plugins-DQJXvbr_.js → media-plugins-BmLuWkkZ.js} +1 -1
  79. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-61Il2HQR.js +1 -0
  80. package/dist/gateway/static/root/assets/messages-DMXSIJUO.js +3 -0
  81. package/dist/gateway/static/root/assets/note-detail-panel-C4gZsNBL.js +5 -0
  82. package/dist/gateway/static/root/assets/note-image-lightbox-XqJIaaRV.js +1 -0
  83. package/dist/gateway/static/root/assets/notes-page-Chdwrjni.js +8 -0
  84. package/dist/gateway/static/root/assets/page-context-capture-button-B7rDRlS7.js +1 -0
  85. package/dist/gateway/static/root/assets/personal-page-mQl9BftY.js +1 -0
  86. package/dist/gateway/static/root/assets/personal-settings-panel-BgcJLmZN.js +1 -0
  87. package/dist/gateway/static/root/assets/plugin-details-dialog-FvwSxZPB.js +1 -0
  88. package/dist/gateway/static/root/assets/preview-open-alternatives-Z4NM7_Dn.js +1 -0
  89. package/dist/gateway/static/root/assets/product-delivery-BqNm-8S5.js +1 -0
  90. package/dist/gateway/static/root/assets/{product-open-page-Bfqez8Je.js → product-open-page-C5TcIaJj.js} +1 -1
  91. package/dist/gateway/static/root/assets/product-preview-content-5xID6jIj.js +1 -0
  92. package/dist/gateway/static/root/assets/project-detail-page-CGOyx7zX.js +7 -0
  93. package/dist/gateway/static/root/assets/projects-page-Dd11tbRX.js +1 -0
  94. package/dist/gateway/static/root/assets/{registry-api-4NZOh0iz.js → registry-api-B6kqbuw8.js} +1 -1
  95. package/dist/gateway/static/root/assets/remote-access-hub-Bintk9nL.js +1 -0
  96. package/dist/gateway/static/root/assets/runtime-tools-api-CY3R7unQ.js +5 -0
  97. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DSsANtha.js → runtime-tools-settings-panel-CbmiiLsq.js} +1 -1
  98. package/dist/gateway/static/root/assets/{schema-form-vbhv4JE6.js → schema-form-DtPkiYwm.js} +1 -1
  99. package/dist/gateway/static/root/assets/session-api-D6-Vz8xK.js +1 -0
  100. package/dist/gateway/static/root/assets/{session-manager-D2sLfkw-.js → session-manager-DWbcMHcj.js} +3 -3
  101. package/dist/gateway/static/root/assets/sessions-page-BBlEP7y3.js +1 -0
  102. package/dist/gateway/static/root/assets/settings-advanced-gate-BCQUth4g.js +1 -0
  103. package/dist/gateway/static/root/assets/{settings-form-section-4nn0sb6v.js → settings-form-section-DD3iD5t5.js} +1 -1
  104. package/dist/gateway/static/root/assets/{settings-page-_HB9FC08.js → settings-page-iLY3LRDq.js} +1 -1
  105. package/dist/gateway/static/root/assets/setup-status-panel-v4P0IAkG.js +1 -0
  106. package/dist/gateway/static/root/assets/share-preview-page-B8h9lqDL.js +2 -0
  107. package/dist/gateway/static/root/assets/shares-settings-DMzej6z2.js +1 -0
  108. package/dist/gateway/static/root/assets/{skill-api-CyO89DKl.js → skill-api-C9RsrvOp.js} +1 -1
  109. package/dist/gateway/static/root/assets/skill-reload-api-B20x7EE9.js +1 -0
  110. package/dist/gateway/static/root/assets/skills-page-C_ulsnv7.js +2 -0
  111. package/dist/gateway/static/root/assets/source-workspace-editor-BIvi89Zx.js +1 -0
  112. package/dist/gateway/static/root/assets/system-settings-panel-PTRGMKkq.js +1 -0
  113. package/dist/gateway/static/root/assets/task-detail-page-DEPwo4vf.js +2 -0
  114. package/dist/gateway/static/root/assets/task-result-evidence-DjNWPpn_.js +1 -0
  115. package/dist/gateway/static/root/assets/tasks-TVRjEggr.js +1 -0
  116. package/dist/gateway/static/root/assets/tracing-settings-page-CVJt7IXC.js +1 -0
  117. package/dist/gateway/static/root/assets/{tunnel-api-DOUyF9Ew.js → tunnel-api-C6XfsSWy.js} +1 -1
  118. package/dist/gateway/static/root/assets/{usage-page-Bv3fdfw1.js → usage-page-DgqLD8Y5.js} +1 -1
  119. package/dist/gateway/static/root/assets/{use-autosave-D0MhLMD2.js → use-autosave-DO-Twmbm.js} +1 -1
  120. package/dist/gateway/static/root/assets/user-model-page-BwK37aob.js +2 -0
  121. package/dist/gateway/static/root/assets/{vendor-codemirror-DFxP3B9T.js → vendor-codemirror-Qdcjid65.js} +16 -16
  122. package/dist/gateway/static/root/assets/{voice-api-key-field-Ds_ADBQH.js → voice-api-key-field-MGe3HkS_.js} +1 -1
  123. package/dist/gateway/static/root/assets/{voice-config-api-4yGMrp7J.js → voice-config-api-CPKzUb4R.js} +1 -1
  124. package/dist/gateway/static/root/assets/work-discovery-overlay-DptHqYh5.js +1 -0
  125. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Di-oEpCt.js → xopc-cloud-account-card-Y_UIryBH.js} +1 -1
  126. package/dist/gateway/static/root/index.html +27 -35
  127. package/dist/package.js +1 -1
  128. package/dist/packages/endpoint-tools-protocol/src/index.js +1 -1
  129. package/dist/packages/gateway-contract/src/automations.js +0 -12
  130. package/dist/packages/gateway-contract/src/home.js +3 -3
  131. package/dist/packages/gateway-contract/src/product-delivery.js +0 -4
  132. package/dist/packages/gateway-contract/src/project-operating.js +0 -6
  133. package/dist/packages/gateway-contract/src/session-identity.js +0 -1
  134. package/dist/packages/gateway-contract/src/task-runs.js +0 -1
  135. package/dist/packages/gateway-contract/src/tasks.js +0 -6
  136. package/dist/src/activity/types.d.ts +4 -4
  137. package/dist/src/agent/agent-manager.d.ts +0 -3
  138. package/dist/src/agent/agent-manager.js +0 -43
  139. package/dist/src/agent/background-review/run-background-review.js +2 -2
  140. package/dist/src/agent/capabilities/definitions.d.ts +2 -18
  141. package/dist/src/agent/capabilities/definitions.js +0 -17
  142. package/dist/src/agent/child-agent-factory.d.ts +1 -1
  143. package/dist/src/agent/client-error-format.d.ts +1 -1
  144. package/dist/src/agent/client-error-format.js +1 -1
  145. package/dist/src/agent/commands/command-registry.js +1 -1
  146. package/dist/src/agent/context/execution-scope.d.ts +2 -8
  147. package/dist/src/agent/context/execution-scope.js +6 -23
  148. package/dist/src/agent/embedded/index.d.ts +0 -1
  149. package/dist/src/agent/embedded/index.js +1 -2
  150. package/dist/src/agent/embedded/run-turn.js +25 -2
  151. package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +0 -2
  152. package/dist/src/agent/external-tools/gateway-tools.js +6 -6
  153. package/dist/src/agent/mcp/connection-setup.js +2 -2
  154. package/dist/src/agent/memory/compaction-ledger.d.ts +1 -1
  155. package/dist/src/agent/memory/compaction-ledger.js +1 -1
  156. package/dist/src/agent/memory/compaction-promotion.js +1 -1
  157. package/dist/src/agent/memory/source-origin.js +1 -5
  158. package/dist/src/agent/memory/turn-provenance.js +1 -3
  159. package/dist/src/agent/memory/types.d.ts +1 -1
  160. package/dist/src/agent/messaging/command-handler.d.ts +0 -3
  161. package/dist/src/agent/messaging/command-handler.js +1 -4
  162. package/dist/src/agent/prompt/sections/behavior.js +2 -2
  163. package/dist/src/agent/prompt/sections/tooling.js +1 -5
  164. package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
  165. package/dist/src/agent/prompt/voice-presentation.js +1 -1
  166. package/dist/src/agent/service/direct-turn-helpers.js +1 -1
  167. package/dist/src/agent/service/process-direct-streaming.js +0 -6
  168. package/dist/src/agent/service.d.ts +0 -2
  169. package/dist/src/agent/service.js +0 -11
  170. package/dist/src/agent/service.types.d.ts +0 -2
  171. package/dist/src/agent/session/session-config-service.d.ts +0 -2
  172. package/dist/src/agent/session/session-config-service.js +1 -1
  173. package/dist/src/agent/session/session-inspector.d.ts +0 -1
  174. package/dist/src/agent/session/session-inspector.js +0 -1
  175. package/dist/src/agent/skills/required-env-vars.d.ts +1 -1
  176. package/dist/src/agent/skills/required-env-vars.js +1 -1
  177. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  178. package/dist/src/agent/tool-manuals/xopc-use.js +2 -5
  179. package/dist/src/agent/tools/automation-tool.js +1 -1
  180. package/dist/src/agent/tools/factory.d.ts +0 -3
  181. package/dist/src/agent/tools/factory.js +6 -9
  182. package/dist/src/agent/tools/index.d.ts +0 -2
  183. package/dist/src/agent/tools/index.js +1 -3
  184. package/dist/src/agent/tools/knowledge-memory-tool.d.ts +1 -0
  185. package/dist/src/agent/tools/knowledge-memory-tool.js +13 -4
  186. package/dist/src/agent/tools/personal-task-tool.js +8 -22
  187. package/dist/src/agent/tools/search/errors.js +2 -2
  188. package/dist/src/agent/tools/session-recall-tool.js +5 -1
  189. package/dist/src/agent/tools/user-context-tool.js +7 -1
  190. package/dist/src/agent/tools/xopc-use-tool.js +1 -1
  191. package/dist/src/agent-catalog/index.d.ts +0 -1
  192. package/dist/src/agent-catalog/index.js +1 -2
  193. package/dist/src/agent-config/index.js +2 -2
  194. package/dist/src/agent-config/resolver.js +0 -6
  195. package/dist/src/agent-config/schema.d.ts +0 -16
  196. package/dist/src/agent-config/schema.js +2 -9
  197. package/dist/src/agent-matching/selection-repository.d.ts +1 -1
  198. package/dist/src/agent-matching/selection-repository.js +1 -1
  199. package/dist/src/agent-matching/service.d.ts +1 -2
  200. package/dist/src/agent-matching/service.js +3 -7
  201. package/dist/src/ai-assist/text-assist.d.ts +1 -1
  202. package/dist/src/ai-assist/text-assist.js +0 -72
  203. package/dist/src/automations/capabilities/write.d.ts +0 -40
  204. package/dist/src/automations/domain/types.d.ts +0 -15
  205. package/dist/src/automations/domain/validation.d.ts +0 -80
  206. package/dist/src/automations/domain/validation.js +0 -17
  207. package/dist/src/automations/draft/automation-draft-prompt.js +0 -3
  208. package/dist/src/automations/draft/automation-draft-validator.d.ts +0 -20
  209. package/dist/src/automations/draft/automation-draft-validator.js +0 -1
  210. package/dist/src/automations/events/event-catalog.js +0 -6
  211. package/dist/src/automations/service/action-executor.d.ts +0 -1
  212. package/dist/src/automations/service/action-executor.js +1 -110
  213. package/dist/src/automations/service/automation-service.js +0 -2
  214. package/dist/src/automations/storage/automation-run-repository.js +6 -7
  215. package/dist/src/backup/archive.js +1 -1
  216. package/dist/src/bootstrap/application-state.d.ts +2 -10
  217. package/dist/src/bootstrap/application-state.js +5 -18
  218. package/dist/src/channels/manager.d.ts +0 -2
  219. package/dist/src/channels/manager.js +0 -4
  220. package/dist/src/channels/pairing/index.d.ts +2 -1
  221. package/dist/src/channels/pairing/pairing-service.d.ts +0 -1
  222. package/dist/src/chat-commands/context.d.ts +0 -3
  223. package/dist/src/chat-commands/context.js +0 -5
  224. package/dist/src/chat-commands/index.d.ts +0 -1
  225. package/dist/src/chat-commands/index.js +1 -3
  226. package/dist/src/chat-commands/types.d.ts +0 -5
  227. package/dist/src/cli/command-manifest.js +1 -1
  228. package/dist/src/cli/commands/config.js +2 -10
  229. package/dist/src/cli/commands/doctor/checks/database-relations.js +0 -3
  230. package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -25
  231. package/dist/src/cli/commands/gateway/run-foreground.js +1 -1
  232. package/dist/src/cli/commands/setup-shared/prompts.d.ts +2 -2
  233. package/dist/src/cli/commands/setup-shared/prompts.js +2 -2
  234. package/dist/src/cli/commands/tui-runner.js +2 -2
  235. package/dist/src/cli/extension-cli-register.js +1 -1
  236. package/dist/src/cli/index.d.ts +0 -1
  237. package/dist/src/cli/index.js +2 -2
  238. package/dist/src/cli/utils/init-workspace-core.js +3 -6
  239. package/dist/src/config/index.js +2 -2
  240. package/dist/src/config/loader.d.ts +0 -1
  241. package/dist/src/config/loader.js +1 -13
  242. package/dist/src/config/paths.d.ts +1 -1
  243. package/dist/src/config/paths.js +1 -1
  244. package/dist/src/connectors/composio-catalog.js +1 -3
  245. package/dist/src/connectors/composio.js +1 -2
  246. package/dist/src/connectors/connected-source-ingestion.js +1 -1
  247. package/dist/src/connectors/connected-source-understanding.js +1 -1
  248. package/dist/src/connectors/learning-coordinator.js +1 -1
  249. package/dist/src/connectors/principal.js +1 -22
  250. package/dist/src/connectors/{workflow-preflight.d.ts → requirements-preflight.d.ts} +9 -8
  251. package/dist/src/connectors/{workflow-preflight.js → requirements-preflight.js} +2 -10
  252. package/dist/src/connectors/types.d.ts +1 -1
  253. package/dist/src/daemon/types.d.ts +0 -9
  254. package/dist/src/discussions/long-review.js +0 -11
  255. package/dist/src/endpoint-tools/policy.js +13 -14
  256. package/dist/src/extensions/agent-plugins/auth.js +1 -3
  257. package/dist/src/extensions/agent-plugins/formats.js +2 -4
  258. package/dist/src/extensions/agent-plugins/mcp-format.d.ts +1 -1
  259. package/dist/src/extensions/agent-plugins/mcp-format.js +2 -2
  260. package/dist/src/extensions/bundled-extension-activation.d.ts +0 -2
  261. package/dist/src/extensions/bundled-extension-activation.js +1 -3
  262. package/dist/src/extensions/install.js +1 -1
  263. package/dist/src/extensions/types/tui.d.ts +1 -2
  264. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -7
  265. package/dist/src/gateway/agent-builtin-tools.js +0 -7
  266. package/dist/src/gateway/agents-admin.d.ts +0 -1
  267. package/dist/src/gateway/agents-admin.js +0 -1
  268. package/dist/src/gateway/global-defaults-admin.js +1 -1
  269. package/dist/src/gateway/hono/lib/config-payload.d.ts +0 -8
  270. package/dist/src/gateway/hono/lib/config-payload.js +1 -2
  271. package/dist/src/gateway/hono/lib/config-write-lock.d.ts +1 -1
  272. package/dist/src/gateway/hono/lib/config-write-lock.js +1 -1
  273. package/dist/src/gateway/hono/middleware/auth.js +2 -2
  274. package/dist/src/gateway/hono/routes/activity.js +0 -1
  275. package/dist/src/gateway/hono/routes/agents.js +2 -9
  276. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +0 -22
  277. package/dist/src/gateway/hono/routes/chat-model-config.d.ts +0 -1
  278. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -3
  279. package/dist/src/gateway/hono/routes/config.js +2 -21
  280. package/dist/src/gateway/hono/routes/connectors.js +1 -1
  281. package/dist/src/gateway/hono/routes/context-sources.js +1 -1
  282. package/dist/src/gateway/hono/routes/devices.js +2 -2
  283. package/dist/src/gateway/hono/routes/home.js +3 -20
  284. package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -8
  285. package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
  286. package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
  287. package/dist/src/gateway/hono/routes/projects.js +0 -16
  288. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
  289. package/dist/src/gateway/hono/routes/sessions.js +0 -3
  290. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  291. package/dist/src/gateway/hono/routes/user-model.js +1 -1
  292. package/dist/src/gateway/index.js +1 -1
  293. package/dist/src/gateway/run-loop.js +2 -2
  294. package/dist/src/gateway/security/device-request-proof.js +1 -1
  295. package/dist/src/gateway/security/gateway-scopes.js +0 -1
  296. package/dist/src/gateway/service/active-execution.d.ts +1 -1
  297. package/dist/src/gateway/service/active-execution.js +1 -1
  298. package/dist/src/gateway/service/agent-runner.js +1 -1
  299. package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
  300. package/dist/src/gateway/service/sessions-api.d.ts +1 -2
  301. package/dist/src/gateway/service/sessions-api.js +1 -1
  302. package/dist/src/gateway/service/task-conversation-query-service.d.ts +0 -4
  303. package/dist/src/gateway/service/types.d.ts +2 -0
  304. package/dist/src/gateway/service.d.ts +1 -8
  305. package/dist/src/gateway/service.js +17 -64
  306. package/dist/src/history/ctx/format.js +1 -1
  307. package/dist/src/home-intelligence/capability-preflight.js +1 -1
  308. package/dist/src/home-intelligence/host.js +2 -2
  309. package/dist/src/infra/unhandled-rejections.js +2 -2
  310. package/dist/src/infra/update-runner.d.ts +1 -2
  311. package/dist/src/infra/update-runner.js +2 -2
  312. package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
  313. package/dist/src/knowledge/local-folder-adapter.js +2 -5
  314. package/dist/src/knowledge-memory/usage-policy.js +1 -1
  315. package/dist/src/local-apps/service.js +1 -1
  316. package/dist/src/memory-learning/forget-capture.js +3 -2
  317. package/dist/src/memory-learning/forgotten-history.d.ts +10 -0
  318. package/dist/src/memory-learning/forgotten-history.js +117 -13
  319. package/dist/src/memory-learning/owner-directive.d.ts +2 -0
  320. package/dist/src/memory-learning/owner-directive.js +10 -0
  321. package/dist/src/memory-learning/service.js +0 -2
  322. package/dist/src/memory-learning/source-learning.js +1 -1
  323. package/dist/src/memory-learning/task-receipts.js +1 -1
  324. package/dist/src/migrations/index.js +2 -2
  325. package/dist/src/migrations/runner.d.ts +1 -2
  326. package/dist/src/migrations/runner.js +2 -5
  327. package/dist/src/notes/service.js +3 -3
  328. package/dist/src/notes/types.d.ts +1 -2
  329. package/dist/src/personal-agent/communication.d.ts +0 -3
  330. package/dist/src/personal-agent/communication.js +1 -12
  331. package/dist/src/personal-agent/persona.d.ts +0 -4
  332. package/dist/src/personal-agent/persona.js +1 -5
  333. package/dist/src/personal-agent/proactivity/repository.js +2 -6
  334. package/dist/src/personal-agent/prompt-context.js +1 -1
  335. package/dist/src/personal-agent/prompts.d.ts +0 -3
  336. package/dist/src/personal-agent/prompts.js +7 -146
  337. package/dist/src/personal-agent/reply-composer.js +3 -3
  338. package/dist/src/personal-agent/reply-style.d.ts +1 -13
  339. package/dist/src/personal-agent/reply-style.js +3 -123
  340. package/dist/src/personal-agent/request-delivery.d.ts +1 -1
  341. package/dist/src/personal-agent/request-delivery.js +1 -1
  342. package/dist/src/personal-agent/request-service.js +2 -2
  343. package/dist/src/personal-agent/specialist-capabilities.js +0 -1
  344. package/dist/src/personal-agent/task-cancel.js +2 -1
  345. package/dist/src/platform/client.d.ts +0 -1
  346. package/dist/src/platform/contracts.d.ts +0 -1
  347. package/dist/src/platform/contracts.js +1 -4
  348. package/dist/src/projects/index.d.ts +0 -1
  349. package/dist/src/projects/index.js +1 -2
  350. package/dist/src/projects/project-loop.d.ts +2 -12
  351. package/dist/src/projects/project-loop.js +19 -42
  352. package/dist/src/projects/project-store.d.ts +0 -1
  353. package/dist/src/projects/project-store.js +0 -11
  354. package/dist/src/projects/types.d.ts +0 -6
  355. package/dist/src/providers/model-usage.js +0 -5
  356. package/dist/src/realtime/runtime.js +0 -1
  357. package/dist/src/routing/agent-session-key.js +1 -1
  358. package/dist/src/session/manager.js +1 -1
  359. package/dist/src/session/types.d.ts +2 -6
  360. package/dist/src/storage/sqlite/connection-wait-repository.js +0 -33
  361. package/dist/src/storage/sqlite/connection.js +2 -2
  362. package/dist/src/storage/sqlite/device-access-repository.d.ts +2 -2
  363. package/dist/src/storage/sqlite/device-access-repository.js +4 -8
  364. package/dist/src/storage/sqlite/home-attention-repository.d.ts +1 -1
  365. package/dist/src/storage/sqlite/index.d.ts +1 -3
  366. package/dist/src/storage/sqlite/index.js +4 -8
  367. package/dist/src/storage/sqlite/{migrations/conversation-backup.d.ts → offline-access.d.ts} +1 -4
  368. package/dist/src/storage/sqlite/{migrations/conversation-backup.js → offline-access.js} +6 -25
  369. package/dist/src/storage/sqlite/row-mappers.d.ts +0 -8
  370. package/dist/src/storage/sqlite/row-mappers.js +0 -8
  371. package/dist/src/storage/sqlite/{migrations/errors.d.ts → schema-errors.d.ts} +0 -6
  372. package/dist/src/storage/sqlite/schema-errors.js +28 -0
  373. package/dist/src/storage/sqlite/schema.d.ts +4 -5
  374. package/dist/src/storage/sqlite/schema.js +23 -19
  375. package/dist/src/storage/sqlite/schema.sql +1099 -427
  376. package/dist/src/storage/sqlite/session-identity-sql.js +1 -2
  377. package/dist/src/storage/sqlite/session-read-repository.d.ts +1 -1
  378. package/dist/src/storage/sqlite/session-read-repository.js +1 -2
  379. package/dist/src/storage/sqlite/session-repository.js +4 -33
  380. package/dist/src/storage/sqlite/{migrations/conversation-windows-owners.js → windows-database-owners.js} +3 -3
  381. package/dist/src/tasks/attention-governor.d.ts +1 -0
  382. package/dist/src/tasks/attention-governor.js +2 -2
  383. package/dist/src/tasks/capabilities/management.d.ts +0 -1
  384. package/dist/src/tasks/capabilities/relations.d.ts +2 -2
  385. package/dist/src/tasks/execution-context.d.ts +1 -1
  386. package/dist/src/tasks/execution-context.js +0 -2
  387. package/dist/src/tasks/home-query-service.d.ts +2 -16
  388. package/dist/src/tasks/home-query-service.js +37 -67
  389. package/dist/src/tasks/index.d.ts +0 -1
  390. package/dist/src/tasks/index.js +1 -2
  391. package/dist/src/tasks/project-operating-view-service.js +0 -1
  392. package/dist/src/tasks/task-application-service.js +0 -5
  393. package/dist/src/tasks/task-repository.d.ts +1 -1
  394. package/dist/src/tasks/task-run-coordinator.js +4 -2
  395. package/dist/src/tui/backends/embedded-backend.d.ts +1 -4
  396. package/dist/src/tui/backends/embedded-backend.js +3 -59
  397. package/dist/src/tui/backends/gateway-realtime-backend.d.ts +1 -2
  398. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -27
  399. package/dist/src/tui/components/chat-log.d.ts +0 -2
  400. package/dist/src/tui/components/chat-log.js +0 -18
  401. package/dist/src/tui/extension-host/runtime-context.js +0 -1
  402. package/dist/src/tui/tui-backend.d.ts +0 -15
  403. package/dist/src/tui/tui-command-formatters.d.ts +0 -3
  404. package/dist/src/tui/tui-command-formatters.js +1 -28
  405. package/dist/src/tui/tui-commands.d.ts +1 -14
  406. package/dist/src/tui/tui-commands.js +4 -89
  407. package/dist/src/tui/tui-startup-resources.js +0 -2
  408. package/dist/src/tui/tui-startup-text.js +2 -3
  409. package/dist/src/tui/tui.js +1 -49
  410. package/dist/src/user-context/trust-policy.js +1 -1
  411. package/dist/src/user-model/usage-policy.js +1 -1
  412. package/dist/src/utils/index.js +1 -1
  413. package/dist/src/utils/logger/index.js +1 -1
  414. package/dist/src/utils/logger.js +1 -1
  415. package/dist/src/voice/realtime/agentBroker.js +2 -3
  416. package/dist/src/voice/realtime/memory-context.js +2 -2
  417. package/dist/src/work-discovery/incremental-repository.js +1 -1
  418. package/dist/src/work-discovery/service.js +2 -2
  419. package/package.json +6 -7
  420. package/dist/extensions/feishu/src/workflow-progress.d.ts +0 -27
  421. package/dist/extensions/feishu/src/workflow-progress.js +0 -98
  422. package/dist/extensions/telegram/src/workflow-progress.d.ts +0 -24
  423. package/dist/extensions/telegram/src/workflow-progress.js +0 -72
  424. package/dist/extensions/weixin/src/workflow-progress.d.ts +0 -26
  425. package/dist/extensions/weixin/src/workflow-progress.js +0 -98
  426. package/dist/gateway/static/root/assets/agent-avatar-dicebear-ColV_Z1C.js +0 -1
  427. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-rgRXzBCX.js +0 -1
  428. package/dist/gateway/static/root/assets/agents-C1rSl_yE.js +0 -77
  429. package/dist/gateway/static/root/assets/app-link-BV_eGr7l.js +0 -1
  430. package/dist/gateway/static/root/assets/app-management-settings-panel-B-Cl1lzt.js +0 -1
  431. package/dist/gateway/static/root/assets/apps-page-BfVMfjkC.js +0 -1
  432. package/dist/gateway/static/root/assets/automations-workspace-b7MTHd-X.js +0 -6
  433. package/dist/gateway/static/root/assets/browser-automations-page-DMqDOJgO.js +0 -3
  434. package/dist/gateway/static/root/assets/browser-settings-page-KZStwhX7.js +0 -3
  435. package/dist/gateway/static/root/assets/capabilities-CD6PzNK7.js +0 -1
  436. package/dist/gateway/static/root/assets/capabilities-page-DeJuO2rf.js +0 -2
  437. package/dist/gateway/static/root/assets/capabilities-settings-panel-DPxL_3Km.js +0 -8
  438. package/dist/gateway/static/root/assets/channels-Cp4F9zPz.js +0 -1
  439. package/dist/gateway/static/root/assets/code-editor-CXIH8jQw.js +0 -1
  440. package/dist/gateway/static/root/assets/computer-settings-page-BXhmUWbA.js +0 -1
  441. package/dist/gateway/static/root/assets/connector-service-page-B1oJCj74.js +0 -1
  442. package/dist/gateway/static/root/assets/connectors-page-Da_M7h3m.js +0 -1
  443. package/dist/gateway/static/root/assets/dependency-picker-BfWUD3LG.js +0 -1
  444. package/dist/gateway/static/root/assets/desktop-pet-CPEi55Vt.js +0 -1
  445. package/dist/gateway/static/root/assets/desktop-pet-settings-CmQ_H-nM.js +0 -1
  446. package/dist/gateway/static/root/assets/device-pairing-wizard-BeTjXc3C.js +0 -1
  447. package/dist/gateway/static/root/assets/dist-BGTk37IG.js +0 -1
  448. package/dist/gateway/static/root/assets/file-archive-DanfQJNe.js +0 -1
  449. package/dist/gateway/static/root/assets/file-braces-BoAMI_k9.js +0 -1
  450. package/dist/gateway/static/root/assets/gateway-realtime-CP6L2jIR.js +0 -1
  451. package/dist/gateway/static/root/assets/gateway-realtime-store-yXB4a40_.js +0 -1
  452. package/dist/gateway/static/root/assets/gateway-settings-CIdEroWr.js +0 -1
  453. package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +0 -1
  454. package/dist/gateway/static/root/assets/home-page-BSbYrVda.js +0 -2
  455. package/dist/gateway/static/root/assets/image-generation-api-BfPYnMoc.js +0 -1
  456. package/dist/gateway/static/root/assets/imports-page-DYSOfHfw.js +0 -1
  457. package/dist/gateway/static/root/assets/index-D2hEKnTM.js +0 -267
  458. package/dist/gateway/static/root/assets/index-SmKNPEmJ.css +0 -1
  459. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-BwsGM6Yd.js +0 -1
  460. package/dist/gateway/static/root/assets/languages-BFe8nIOO.js +0 -2
  461. package/dist/gateway/static/root/assets/local-app-workbench-page-K6UR6cAx.js +0 -1
  462. package/dist/gateway/static/root/assets/local-apps-page-gkdwtjDE.js +0 -1
  463. package/dist/gateway/static/root/assets/locale-store-D_migb9R.js +0 -1
  464. package/dist/gateway/static/root/assets/logs-page-BAQNYk0e.js +0 -2
  465. package/dist/gateway/static/root/assets/management-settings-CMVRLGox.js +0 -1
  466. package/dist/gateway/static/root/assets/markdown-editor-BhBJANcx.js +0 -1
  467. package/dist/gateway/static/root/assets/markdown-view-Ljt0bhfF.js +0 -324
  468. package/dist/gateway/static/root/assets/markdown-view-ixUWAmoy.css +0 -1
  469. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Cx0bXBqu.js +0 -1
  470. package/dist/gateway/static/root/assets/mermaid-render-604gISVe.js +0 -134
  471. package/dist/gateway/static/root/assets/messages-D__oW2yE.js +0 -3
  472. package/dist/gateway/static/root/assets/note-detail-panel-1GCqp26U.js +0 -5
  473. package/dist/gateway/static/root/assets/note-image-lightbox-B7RA-WsY.js +0 -1
  474. package/dist/gateway/static/root/assets/notes-page-DnjlEdzM.js +0 -8
  475. package/dist/gateway/static/root/assets/page-context-capture-button-BAwI_3uh.js +0 -1
  476. package/dist/gateway/static/root/assets/personal-page-XoLrcR0U.js +0 -1
  477. package/dist/gateway/static/root/assets/personal-settings-panel-DzubCRqj.js +0 -1
  478. package/dist/gateway/static/root/assets/plugin-details-dialog-BjzIp3T5.js +0 -1
  479. package/dist/gateway/static/root/assets/plus-Q2yW6OE7.js +0 -1
  480. package/dist/gateway/static/root/assets/preview-open-alternatives-2YjwlRHu.js +0 -1
  481. package/dist/gateway/static/root/assets/product-delivery-DwmnNJvk.js +0 -1
  482. package/dist/gateway/static/root/assets/product-preview-content-D7wLwrqj.js +0 -1
  483. package/dist/gateway/static/root/assets/project-detail-page-1ueRCmXg.js +0 -1
  484. package/dist/gateway/static/root/assets/projects-page-CDQycMPo.js +0 -1
  485. package/dist/gateway/static/root/assets/remote-access-hub-YvVmZA4K.js +0 -1
  486. package/dist/gateway/static/root/assets/runtime-tools-api-CmEWVrOg.js +0 -5
  487. package/dist/gateway/static/root/assets/session-api-aQLptIs9.js +0 -1
  488. package/dist/gateway/static/root/assets/sessions-page-B3rPljgr.js +0 -1
  489. package/dist/gateway/static/root/assets/settings-advanced-gate-Ch20Ptzp.js +0 -1
  490. package/dist/gateway/static/root/assets/setup-status-panel-L1HHrvzi.js +0 -1
  491. package/dist/gateway/static/root/assets/share-preview-page-C4lC0W3d.js +0 -2
  492. package/dist/gateway/static/root/assets/shares-settings-DtHZ9z5K.js +0 -1
  493. package/dist/gateway/static/root/assets/skill-reload-api-Drg356Pb.js +0 -1
  494. package/dist/gateway/static/root/assets/skills-page-XhCLHKlK.js +0 -2
  495. package/dist/gateway/static/root/assets/source-workspace-editor-DunRD1gY.js +0 -1
  496. package/dist/gateway/static/root/assets/style-DTLpCnuA.js +0 -7
  497. package/dist/gateway/static/root/assets/system-settings-panel-bSogz4S-.js +0 -1
  498. package/dist/gateway/static/root/assets/tab-completion-input.utils-BP3NH_du.js +0 -1
  499. package/dist/gateway/static/root/assets/task-detail-page-CSv2x4q-.js +0 -2
  500. package/dist/gateway/static/root/assets/task-expandable-content-4s_FTl-9.js +0 -1
  501. package/dist/gateway/static/root/assets/tasks-B4bZpO6O.js +0 -1
  502. package/dist/gateway/static/root/assets/tracing-settings-page-CZ5XLQmX.js +0 -1
  503. package/dist/gateway/static/root/assets/user-model-page-BD7WvhI0.js +0 -2
  504. package/dist/gateway/static/root/assets/work-discovery-overlay-CDJp2_l2.js +0 -1
  505. package/dist/gateway/static/root/assets/workflow-run-setup-panel-CR4fRhZZ.js +0 -3
  506. package/dist/gateway/static/root/assets/workflows-page-BeJw5liC.js +0 -6
  507. package/dist/gateway/static/root/assets/x-B_N4OPjy.js +0 -1
  508. package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +0 -3
  509. package/dist/src/agent/embedded/session-manager-init.d.ts +0 -4
  510. package/dist/src/agent/embedded/session-manager-init.js +0 -48
  511. package/dist/src/agent/tools/workflow-manage-tool.d.ts +0 -2
  512. package/dist/src/agent/tools/workflow-manage-tool.js +0 -225
  513. package/dist/src/agent/tools/workflow-tool.d.ts +0 -20
  514. package/dist/src/agent/tools/workflow-tool.js +0 -155
  515. package/dist/src/agent/workflow/agent-progress.d.ts +0 -5
  516. package/dist/src/agent/workflow/agent-progress.js +0 -65
  517. package/dist/src/agent/workflow/builtins/index.d.ts +0 -2
  518. package/dist/src/agent/workflow/builtins/index.js +0 -374
  519. package/dist/src/agent/workflow/catalog.d.ts +0 -52
  520. package/dist/src/agent/workflow/catalog.js +0 -150
  521. package/dist/src/agent/workflow/channel-capability.d.ts +0 -76
  522. package/dist/src/agent/workflow/channel-capability.js +0 -1
  523. package/dist/src/agent/workflow/index.d.ts +0 -10
  524. package/dist/src/agent/workflow/index.js +0 -9
  525. package/dist/src/agent/workflow/progress-broker.d.ts +0 -80
  526. package/dist/src/agent/workflow/progress-broker.js +0 -261
  527. package/dist/src/agent/workflow/snapshot-empty.d.ts +0 -2
  528. package/dist/src/agent/workflow/snapshot-empty.js +0 -17
  529. package/dist/src/agent/workflow/snapshot.d.ts +0 -28
  530. package/dist/src/agent/workflow/snapshot.js +0 -267
  531. package/dist/src/agent/workflow/step-labels.d.ts +0 -8
  532. package/dist/src/agent/workflow/step-labels.js +0 -50
  533. package/dist/src/agent/workflow/structured-output-tool.d.ts +0 -33
  534. package/dist/src/agent/workflow/structured-output-tool.js +0 -56
  535. package/dist/src/agent/workflow/subagent-runner.d.ts +0 -46
  536. package/dist/src/agent/workflow/subagent-runner.js +0 -221
  537. package/dist/src/agent/workflow/types.d.ts +0 -252
  538. package/dist/src/agent/workflow/types.js +0 -1
  539. package/dist/src/agent/workflow/workflow-child-tools.d.ts +0 -4
  540. package/dist/src/agent/workflow/workflow-child-tools.js +0 -38
  541. package/dist/src/agent-catalog/migrations/identity-markdown-cutover.d.ts +0 -5
  542. package/dist/src/agent-catalog/migrations/identity-markdown-cutover.js +0 -94
  543. package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +0 -11
  544. package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +0 -194
  545. package/dist/src/chat-commands/builtins/workflow.d.ts +0 -18
  546. package/dist/src/chat-commands/builtins/workflow.js +0 -249
  547. package/dist/src/gateway/gateway-workflow-host.types.d.ts +0 -23
  548. package/dist/src/gateway/gateway-workflow-host.types.js +0 -1
  549. package/dist/src/gateway/hono/routes/workflows.d.ts +0 -3
  550. package/dist/src/gateway/hono/routes/workflows.js +0 -572
  551. package/dist/src/knowledge-memory/repair-evidence.d.ts +0 -2
  552. package/dist/src/knowledge-memory/repair-evidence.js +0 -57
  553. package/dist/src/migrations/cloud-public-models.d.ts +0 -7
  554. package/dist/src/migrations/cloud-public-models.js +0 -157
  555. package/dist/src/migrations/memory-config.d.ts +0 -2
  556. package/dist/src/migrations/memory-config.js +0 -76
  557. package/dist/src/migrations/retired-local-stt.d.ts +0 -2
  558. package/dist/src/migrations/retired-local-stt.js +0 -52
  559. package/dist/src/projects/workflow-bind.d.ts +0 -1
  560. package/dist/src/projects/workflow-bind.js +0 -15
  561. package/dist/src/storage/sqlite/migrations/218_core_relation_indexes.sql +0 -26
  562. package/dist/src/storage/sqlite/migrations/219_json_contracts.sql +0 -123
  563. package/dist/src/storage/sqlite/migrations/220_normalize_timestamps.sql +0 -339
  564. package/dist/src/storage/sqlite/migrations/221_ai_usage_retention_index.sql +0 -2
  565. package/dist/src/storage/sqlite/migrations/222_session_config_authority.sql +0 -13
  566. package/dist/src/storage/sqlite/migrations/223_session_creation_receipts.sql +0 -59
  567. package/dist/src/storage/sqlite/migrations/224_task_origin_links.sql +0 -8
  568. package/dist/src/storage/sqlite/migrations/225_task_collaboration.sql +0 -32
  569. package/dist/src/storage/sqlite/migrations/226_task_main_updates.sql +0 -9
  570. package/dist/src/storage/sqlite/migrations/227_task_main_update_decisions.sql +0 -8
  571. package/dist/src/storage/sqlite/migrations/228_task_main_agent_links.sql +0 -14
  572. package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +0 -12
  573. package/dist/src/storage/sqlite/migrations/230_personal_agent_onboarding.sql +0 -8
  574. package/dist/src/storage/sqlite/migrations/231_task_result_deliveries.sql +0 -32
  575. package/dist/src/storage/sqlite/migrations/232_personal_requests.sql +0 -28
  576. package/dist/src/storage/sqlite/migrations/233_observability_usage_links.sql +0 -3
  577. package/dist/src/storage/sqlite/migrations/234_task_result_reply.sql +0 -14
  578. package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +0 -3
  579. package/dist/src/storage/sqlite/migrations/236_personal_proactivity.sql +0 -53
  580. package/dist/src/storage/sqlite/migrations/237_personal_strategy_versions.sql +0 -18
  581. package/dist/src/storage/sqlite/migrations/238_browser_record_replay.sql +0 -45
  582. package/dist/src/storage/sqlite/migrations/239_clarification_notifications.sql +0 -26
  583. package/dist/src/storage/sqlite/migrations/240_device_settings.sql +0 -5
  584. package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +0 -13
  585. package/dist/src/storage/sqlite/migrations/242_cloud_usage_receipts.sql +0 -5
  586. package/dist/src/storage/sqlite/migrations/243_voice_opening_greetings.sql +0 -12
  587. package/dist/src/storage/sqlite/migrations/244_device_request_proofs.sql +0 -8
  588. package/dist/src/storage/sqlite/migrations/245_memory_learning.sql +0 -125
  589. package/dist/src/storage/sqlite/migrations/246_personal_session_thinking.sql +0 -22
  590. package/dist/src/storage/sqlite/migrations/247_agent_selection_records.sql +0 -32
  591. package/dist/src/storage/sqlite/migrations/248_next_turn_suggestions.sql +0 -20
  592. package/dist/src/storage/sqlite/migrations/249_task_allocations.sql +0 -17
  593. package/dist/src/storage/sqlite/migrations/250_research_checkpoints.sql +0 -15
  594. package/dist/src/storage/sqlite/migrations/251_personal_result_reads.sql +0 -40
  595. package/dist/src/storage/sqlite/migrations/252_task_work_revisions.sql +0 -15
  596. package/dist/src/storage/sqlite/migrations/253_discussion_processing_recovery.sql +0 -20
  597. package/dist/src/storage/sqlite/migrations/254_discussion_annotations.sql +0 -17
  598. package/dist/src/storage/sqlite/migrations/255_discussion_chapter_progress.sql +0 -10
  599. package/dist/src/storage/sqlite/migrations/256_task_main_update_retries.sql +0 -21
  600. package/dist/src/storage/sqlite/migrations/257_session_composer_history.sql +0 -11
  601. package/dist/src/storage/sqlite/migrations/258_task_phase_changes.sql +0 -20
  602. package/dist/src/storage/sqlite/migrations/259_personal_default_style.sql +0 -10
  603. package/dist/src/storage/sqlite/migrations/discover.d.ts +0 -4
  604. package/dist/src/storage/sqlite/migrations/discover.js +0 -40
  605. package/dist/src/storage/sqlite/migrations/errors.js +0 -40
  606. package/dist/src/storage/sqlite/migrations/runner.d.ts +0 -22
  607. package/dist/src/storage/sqlite/migrations/runner.js +0 -112
  608. package/dist/src/storage/sqlite/migrations/types.d.ts +0 -12
  609. package/dist/src/storage/sqlite/migrations/types.js +0 -1
  610. package/dist/src/tasks/task-workflow-coordinator.d.ts +0 -5
  611. package/dist/src/tasks/task-workflow-coordinator.js +0 -55
  612. package/dist/src/tui/tui-workflow-slash.d.ts +0 -29
  613. package/dist/src/tui/tui-workflow-slash.js +0 -58
  614. package/dist/src/workflows/authoring/index.d.ts +0 -2
  615. package/dist/src/workflows/authoring/index.js +0 -3
  616. package/dist/src/workflows/authoring/workflow-draft-defaults.d.ts +0 -3
  617. package/dist/src/workflows/authoring/workflow-draft-defaults.js +0 -63
  618. package/dist/src/workflows/authoring/workflow-draft-store.d.ts +0 -29
  619. package/dist/src/workflows/authoring/workflow-draft-store.js +0 -52
  620. package/dist/src/workflows/context/workflow-context-snapshot-repository.d.ts +0 -21
  621. package/dist/src/workflows/context/workflow-context-snapshot-repository.js +0 -41
  622. package/dist/src/workflows/context/workflow-context.d.ts +0 -18
  623. package/dist/src/workflows/context/workflow-context.js +0 -164
  624. package/dist/src/workflows/domain/command.d.ts +0 -19
  625. package/dist/src/workflows/domain/command.js +0 -1
  626. package/dist/src/workflows/domain/definition-utils.d.ts +0 -18
  627. package/dist/src/workflows/domain/definition-utils.js +0 -90
  628. package/dist/src/workflows/domain/definition.d.ts +0 -164
  629. package/dist/src/workflows/domain/definition.js +0 -1
  630. package/dist/src/workflows/domain/event.d.ts +0 -88
  631. package/dist/src/workflows/domain/event.js +0 -1
  632. package/dist/src/workflows/domain/index.d.ts +0 -8
  633. package/dist/src/workflows/domain/index.js +0 -5
  634. package/dist/src/workflows/domain/result.d.ts +0 -68
  635. package/dist/src/workflows/domain/result.js +0 -1
  636. package/dist/src/workflows/domain/run.d.ts +0 -257
  637. package/dist/src/workflows/domain/run.js +0 -12
  638. package/dist/src/workflows/domain/schema-validation.d.ts +0 -8
  639. package/dist/src/workflows/domain/schema-validation.js +0 -26
  640. package/dist/src/workflows/domain/validation.d.ts +0 -22
  641. package/dist/src/workflows/domain/validation.js +0 -318
  642. package/dist/src/workflows/engine/index.d.ts +0 -2
  643. package/dist/src/workflows/engine/index.js +0 -3
  644. package/dist/src/workflows/engine/projector.d.ts +0 -3
  645. package/dist/src/workflows/engine/projector.js +0 -276
  646. package/dist/src/workflows/engine/workflow-engine.d.ts +0 -88
  647. package/dist/src/workflows/engine/workflow-engine.js +0 -719
  648. package/dist/src/workflows/index.d.ts +0 -11
  649. package/dist/src/workflows/index.js +0 -19
  650. package/dist/src/workflows/project-presets/project-workflow-preset-repository.d.ts +0 -20
  651. package/dist/src/workflows/project-presets/project-workflow-preset-repository.js +0 -39
  652. package/dist/src/workflows/registry/catalog-workflow-definition-registry.d.ts +0 -9
  653. package/dist/src/workflows/registry/catalog-workflow-definition-registry.js +0 -30
  654. package/dist/src/workflows/registry/index.d.ts +0 -2
  655. package/dist/src/workflows/registry/index.js +0 -2
  656. package/dist/src/workflows/registry/workflow-definition-registry.d.ts +0 -15
  657. package/dist/src/workflows/registry/workflow-definition-registry.js +0 -1
  658. package/dist/src/workflows/runtime/graph-workflow-runtime.d.ts +0 -10
  659. package/dist/src/workflows/runtime/graph-workflow-runtime.js +0 -289
  660. package/dist/src/workflows/runtime/index.d.ts +0 -2
  661. package/dist/src/workflows/runtime/index.js +0 -2
  662. package/dist/src/workflows/runtime/workflow-runtime-port.d.ts +0 -13
  663. package/dist/src/workflows/runtime/workflow-runtime-port.js +0 -1
  664. package/dist/src/workflows/service/run-view-to-snapshot.d.ts +0 -4
  665. package/dist/src/workflows/service/run-view-to-snapshot.js +0 -64
  666. package/dist/src/workflows/service/workflow-run-service.d.ts +0 -63
  667. package/dist/src/workflows/service/workflow-run-service.js +0 -892
  668. package/dist/src/workflows/service/workflow-run-service.types.d.ts +0 -62
  669. package/dist/src/workflows/service/workflow-run-service.types.js +0 -1
  670. package/dist/src/workflows/service/workflow-session-bridge.d.ts +0 -33
  671. package/dist/src/workflows/service/workflow-session-bridge.js +0 -244
  672. package/dist/src/workflows/service/workflow-session-key.d.ts +0 -3
  673. package/dist/src/workflows/service/workflow-session-key.js +0 -19
  674. package/dist/src/workflows/service/workflow-writeback-service.d.ts +0 -9
  675. package/dist/src/workflows/service/workflow-writeback-service.js +0 -107
  676. package/dist/src/workflows/store/event-store.d.ts +0 -16
  677. package/dist/src/workflows/store/event-store.js +0 -38
  678. package/dist/src/workflows/store/paths.d.ts +0 -5
  679. package/dist/src/workflows/store/paths.js +0 -18
  680. package/dist/src/workflows/store/run-index-store.d.ts +0 -9
  681. package/dist/src/workflows/store/run-index-store.js +0 -64
  682. package/dist/src/workflows/store/run-store.d.ts +0 -16
  683. package/dist/src/workflows/store/run-store.js +0 -40
  684. package/skills/engineering/workflow-authoring/SKILL.md +0 -32
  685. /package/dist/gateway/static/root/assets/{style-DLioOiRN.css → project-detail-page-DLioOiRN.css} +0 -0
  686. /package/dist/src/storage/sqlite/{migrations/conversation-windows-owners.d.ts → windows-database-owners.d.ts} +0 -0
@@ -1,80 +0,0 @@
1
- /**
2
- * WorkflowProgressBroker — the single seam that turns mid-run `workflow`
3
- * snapshots into IM messages (Telegram today, more channels later).
4
- *
5
- * Architecture:
6
- *
7
- * pi-agent ──tool_execution_update──▶ AgentEventHandler / SessionEventBus
8
- * │
9
- * attachTo(handler) │
10
- * ▼
11
- * WorkflowProgressBroker
12
- * │
13
- * per-(conversationId, toolCallId) state
14
- * │
15
- * ┌───────────────────┼───────────────────┐
16
- * ▼ ▼ ▼
17
- * Telegram cap Feishu cap WeChat cap
18
- *
19
- * Why broker + capability instead of "each channel subscribes the bus"?
20
- * - DRY snapshot aggregation and key-event detection.
21
- * - Per-channel throttling is enforced by the broker, so a slow / rate-limited
22
- * channel can't block a fast one.
23
- * - Adding a new channel = one capability + one register call. Broker code
24
- * never grows.
25
- */
26
- import type { AgentEvent } from '@earendil-works/pi-agent-core';
27
- import type { Config } from '../../config/schema.js';
28
- import type { ChannelProgressCapability } from './channel-capability.js';
29
- import type { WorkflowSnapshot } from './types.js';
30
- export interface BrokerListenerHandle {
31
- /** Detach broker from the session bus and clear all in-flight state. */
32
- dispose(): void;
33
- }
34
- /**
35
- * Tiny façade onto the AgentEventHandler. We don't import the concrete class to
36
- * keep this module test-friendly — a stub listener pump is fine for unit tests.
37
- */
38
- export interface SessionBusLike {
39
- registerListener(type: AgentEvent['type'] | 'all', listener: (event: AgentEvent, context: {
40
- conversationId: string;
41
- }) => void): () => void;
42
- }
43
- export declare class WorkflowProgressBroker {
44
- private readonly opts;
45
- private subscribers;
46
- private states;
47
- /** Now() factory — overridable in tests for deterministic time. */
48
- private readonly now;
49
- /** Cached resolved settings per (channelId), invalidated on registration. */
50
- private resolved;
51
- constructor(opts?: {
52
- getConfig?: () => Config | undefined;
53
- now?: () => number;
54
- });
55
- registerChannel(cap: ChannelProgressCapability): () => void;
56
- attachTo(bus: SessionBusLike): BrokerListenerHandle;
57
- /** Visible for tests — direct entry path bypassing the SessionBus glue. */
58
- onUpdate(conversationId: string, toolCallId: string, snapshot: WorkflowSnapshot): void;
59
- /** Visible for tests — direct entry path bypassing the SessionBus glue. */
60
- onEnd(conversationId: string, toolCallId: string, snapshot: WorkflowSnapshot | null): void;
61
- private dispatchToChannel;
62
- private sendNow;
63
- private cancelPending;
64
- private disposeAllPending;
65
- private getOrCreateState;
66
- private getOrCreateChannelState;
67
- /** Resolved (enabled / throttleMs / mode) for a channel, with config overrides. */
68
- private resolveChannelSettings;
69
- /** Drop any cached config so the next dispatch re-reads. Call after config reload. */
70
- invalidateConfigCache(): void;
71
- /** @internal — for tests only. */
72
- _stateCount(): number;
73
- }
74
- /**
75
- * Process-wide broker singleton. Channels register against this one; the
76
- * service wires it to the session bus during startup.
77
- */
78
- export declare function getWorkflowProgressBroker(): WorkflowProgressBroker;
79
- /** Test-only — reset the singleton between cases. */
80
- export declare function _resetWorkflowProgressBrokerForTests(): void;
@@ -1,261 +0,0 @@
1
- import { createLogger } from "../../utils/logger/index.js";
2
- import { init_logger } from "../../utils/logger.js";
3
- import { renderWorkflowText } from "./snapshot.js";
4
- //#region src/agent/workflow/progress-broker.ts
5
- init_logger();
6
- const log = createLogger("Agent:WorkflowProgress");
7
- const WORKFLOW_TOOL_NAME = "workflow";
8
- const RENDER_MAX_AGENTS_PER_PHASE = 4;
9
- const RENDER_MAX_LOGS = 2;
10
- var WorkflowProgressBroker = class {
11
- subscribers = [];
12
- states = /* @__PURE__ */ new Map();
13
- /** Now() factory — overridable in tests for deterministic time. */
14
- now;
15
- /** Cached resolved settings per (channelId), invalidated on registration. */
16
- resolved = /* @__PURE__ */ new Map();
17
- constructor(opts = {}) {
18
- this.opts = opts;
19
- this.now = opts.now ?? (() => Date.now());
20
- }
21
- registerChannel(cap) {
22
- if (this.subscribers.some((s) => s.channelId === cap.channelId)) {
23
- log.warn({ channelId: cap.channelId }, "channel capability already registered; replacing");
24
- this.subscribers = this.subscribers.filter((s) => s.channelId !== cap.channelId);
25
- }
26
- this.subscribers.push(cap);
27
- this.resolved.delete(cap.channelId);
28
- return () => {
29
- this.subscribers = this.subscribers.filter((s) => s !== cap);
30
- this.resolved.delete(cap.channelId);
31
- };
32
- }
33
- attachTo(bus) {
34
- const offUpdate = bus.registerListener("tool_execution_update", (event, ctx) => {
35
- const e = event;
36
- if (e.toolName !== WORKFLOW_TOOL_NAME) return;
37
- const snap = extractWorkflowSnapshot(e.partialResult);
38
- if (!snap) return;
39
- this.onUpdate(ctx.conversationId, e.toolCallId, snap);
40
- });
41
- const offEnd = bus.registerListener("tool_execution_end", (event, ctx) => {
42
- const e = event;
43
- if (e.toolName !== WORKFLOW_TOOL_NAME) return;
44
- const snap = extractWorkflowSnapshot(e.result, { fromResultEnvelope: true });
45
- this.onEnd(ctx.conversationId, e.toolCallId, snap);
46
- });
47
- return { dispose: () => {
48
- offUpdate();
49
- offEnd();
50
- this.disposeAllPending();
51
- } };
52
- }
53
- /** Visible for tests — direct entry path bypassing the SessionBus glue. */
54
- onUpdate(conversationId, toolCallId, snapshot) {
55
- const key = stateKey(conversationId, toolCallId);
56
- const state = this.getOrCreateState(key, snapshot);
57
- state.prevSnapshot = state.snapshot;
58
- state.snapshot = snapshot;
59
- const isKey = isKeyEvent(state.prevSnapshot, snapshot);
60
- for (const cap of this.subscribers) this.dispatchToChannel(state, conversationId, cap, {
61
- isFinal: false,
62
- isKey
63
- });
64
- }
65
- /** Visible for tests — direct entry path bypassing the SessionBus glue. */
66
- onEnd(conversationId, toolCallId, snapshot) {
67
- const key = stateKey(conversationId, toolCallId);
68
- const state = this.states.get(key);
69
- if (!state) return;
70
- if (snapshot) state.snapshot = snapshot;
71
- for (const cap of this.subscribers) {
72
- this.cancelPending(state, cap.channelId);
73
- this.dispatchToChannel(state, conversationId, cap, {
74
- isFinal: true,
75
- isKey: true
76
- });
77
- }
78
- setTimeout(() => this.states.delete(key), 2e3);
79
- }
80
- dispatchToChannel(state, conversationId, cap, flags) {
81
- const cfg = this.resolveChannelSettings(cap);
82
- if (!cfg.enabled) return;
83
- if (cfg.mode === "final-only" && !flags.isFinal) return;
84
- const chState = this.getOrCreateChannelState(state, cap.channelId);
85
- if (flags.isFinal || flags.isKey) {
86
- this.cancelPending(state, cap.channelId);
87
- this.sendNow(state, conversationId, cap, cfg, flags.isFinal);
88
- return;
89
- }
90
- const elapsed = this.now() - chState.lastSentAt;
91
- const wait = Math.max(0, cfg.throttleMs - elapsed);
92
- if (wait === 0) {
93
- this.sendNow(state, conversationId, cap, cfg, false);
94
- return;
95
- }
96
- if (chState.pendingTimer) return;
97
- chState.pendingTimer = setTimeout(() => {
98
- chState.pendingTimer = void 0;
99
- this.sendNow(state, conversationId, cap, cfg, false);
100
- }, wait);
101
- }
102
- async sendNow(state, conversationId, cap, cfg, isFinal) {
103
- const chState = this.getOrCreateChannelState(state, cap.channelId);
104
- if (chState.inflight) await chState.inflight.catch(() => void 0);
105
- const text = renderWorkflowText(state.snapshot, isFinal, {
106
- maxAgentsPerPhase: RENDER_MAX_AGENTS_PER_PHASE,
107
- maxLogs: RENDER_MAX_LOGS,
108
- showResultPreviews: isFinal
109
- });
110
- const previousMessageId = cfg.mode === "edit" ? chState.lastMessageId : void 0;
111
- const task = cap.postProgress({
112
- conversationId,
113
- text,
114
- previousMessageId,
115
- isFinal,
116
- mode: cfg.mode
117
- }).then((r) => {
118
- chState.lastMessageId = r.messageId;
119
- chState.lastSentAt = this.now();
120
- }).catch((err) => {
121
- const msg = err instanceof Error ? err.message : String(err);
122
- log.warn({
123
- err,
124
- errorMessage: msg,
125
- channelId: cap.channelId,
126
- conversationId
127
- }, `workflow progress postProgress failed: ${msg}`);
128
- }).finally(() => {
129
- chState.inflight = void 0;
130
- });
131
- chState.inflight = task;
132
- await task;
133
- }
134
- cancelPending(state, channelId) {
135
- const chState = state.perChannel.get(channelId);
136
- if (chState?.pendingTimer) {
137
- clearTimeout(chState.pendingTimer);
138
- chState.pendingTimer = void 0;
139
- }
140
- }
141
- disposeAllPending() {
142
- for (const state of this.states.values()) for (const ch of state.perChannel.values()) if (ch.pendingTimer) clearTimeout(ch.pendingTimer);
143
- this.states.clear();
144
- }
145
- getOrCreateState(key, snapshot) {
146
- let state = this.states.get(key);
147
- if (!state) {
148
- state = {
149
- snapshot,
150
- perChannel: /* @__PURE__ */ new Map()
151
- };
152
- this.states.set(key, state);
153
- }
154
- return state;
155
- }
156
- getOrCreateChannelState(state, channelId) {
157
- let ch = state.perChannel.get(channelId);
158
- if (!ch) {
159
- ch = { lastSentAt: 0 };
160
- state.perChannel.set(channelId, ch);
161
- }
162
- return ch;
163
- }
164
- /** Resolved (enabled / throttleMs / mode) for a channel, with config overrides. */
165
- resolveChannelSettings(cap) {
166
- const cached = this.resolved.get(cap.channelId);
167
- if (cached) return cached;
168
- const override = readChannelConfig(this.opts.getConfig?.(), cap.channelId);
169
- const resolved = {
170
- enabled: override?.enabled ?? true,
171
- throttleMs: override?.throttleMs ?? cap.defaultThrottleMs,
172
- mode: override?.mode ?? cap.defaultMode
173
- };
174
- this.resolved.set(cap.channelId, resolved);
175
- return resolved;
176
- }
177
- /** Drop any cached config so the next dispatch re-reads. Call after config reload. */
178
- invalidateConfigCache() {
179
- this.resolved.clear();
180
- }
181
- /** @internal — for tests only. */
182
- _stateCount() {
183
- return this.states.size;
184
- }
185
- };
186
- let singleton = null;
187
- /**
188
- * Process-wide broker singleton. Channels register against this one; the
189
- * service wires it to the session bus during startup.
190
- */
191
- function getWorkflowProgressBroker() {
192
- if (!singleton) singleton = new WorkflowProgressBroker();
193
- return singleton;
194
- }
195
- /** Test-only — reset the singleton between cases. */
196
- function _resetWorkflowProgressBrokerForTests() {
197
- singleton = null;
198
- }
199
- function stateKey(conversationId, toolCallId) {
200
- return `${conversationId}${toolCallId ?? ""}`;
201
- }
202
- /**
203
- * Compare two snapshots and decide whether the new one is "key" — i.e. worth
204
- * bypassing the per-channel throttle. Anything visible to the user as a
205
- * progress milestone qualifies; counts ticking by alone do not.
206
- */
207
- function isKeyEvent(prev, next) {
208
- if (!prev) return true;
209
- if (prev.currentPhase !== next.currentPhase) return true;
210
- if (next.errorCount > prev.errorCount) return true;
211
- if (next.skippedCount > prev.skippedCount) return true;
212
- if (prev.phases.length !== next.phases.length) return true;
213
- if (hasNewFailedAgent(prev.agents, next.agents)) return true;
214
- return false;
215
- }
216
- function hasNewFailedAgent(prev, next) {
217
- const prevBad = new Set(prev.filter((a) => a.status === "error" || a.status === "skipped").map((a) => a.id));
218
- for (const a of next) if ((a.status === "error" || a.status === "skipped") && !prevBad.has(a.id)) return true;
219
- return false;
220
- }
221
- /**
222
- * Pull a {@link WorkflowSnapshot} out of an AgentToolResult-shaped value.
223
- * Returns null when the payload is not snapshot-shaped (text-only updates,
224
- * non-workflow tools, etc.).
225
- *
226
- * `fromResultEnvelope = true` (used for `tool_end.result`) tolerates the
227
- * `{ content, details }` wrapper.
228
- */
229
- function extractWorkflowSnapshot(payload, opts = {}) {
230
- if (!payload || typeof payload !== "object") return null;
231
- const rec = payload;
232
- if (opts.fromResultEnvelope) {
233
- const details = rec.details;
234
- if (details && typeof details === "object") return coerce(details);
235
- return null;
236
- }
237
- if ("details" in rec) {
238
- const details = rec.details;
239
- if (details && typeof details === "object") return coerce(details);
240
- return null;
241
- }
242
- return coerce(rec);
243
- }
244
- function coerce(value) {
245
- if (!value || typeof value !== "object") return null;
246
- const rec = value;
247
- if (typeof rec.name !== "string") return null;
248
- if (!Array.isArray(rec.agents)) return null;
249
- return value;
250
- }
251
- function readChannelConfig(config, channelId) {
252
- const channels = config?.channels;
253
- if (!channels) return void 0;
254
- const cfg = channels[channelId];
255
- if (!cfg || typeof cfg !== "object") return void 0;
256
- const wf = cfg.workflowProgress;
257
- if (!wf || typeof wf !== "object") return void 0;
258
- return wf;
259
- }
260
- //#endregion
261
- export { WorkflowProgressBroker, _resetWorkflowProgressBrokerForTests, getWorkflowProgressBroker };
@@ -1,2 +0,0 @@
1
- import type { WorkflowSnapshot } from './types.js';
2
- export declare function emptySnapshotFor(name: string, description?: string, phaseTitles?: string[]): WorkflowSnapshot;
@@ -1,17 +0,0 @@
1
- //#region src/agent/workflow/snapshot-empty.ts
2
- function emptySnapshotFor(name, description, phaseTitles) {
3
- return {
4
- name,
5
- description,
6
- phases: phaseTitles ? [...phaseTitles] : [],
7
- logs: [],
8
- agents: [],
9
- agentCount: 0,
10
- runningCount: 0,
11
- doneCount: 0,
12
- errorCount: 0,
13
- skippedCount: 0
14
- };
15
- }
16
- //#endregion
17
- export { emptySnapshotFor };
@@ -1,28 +0,0 @@
1
- /**
2
- * Workflow progress snapshot model + text renderers.
3
- *
4
- * The runtime emits per-event callbacks (`onPhase`, `onAgentStart`, `onAgentEnd`,
5
- * `onLog`). The workflow tool wraps those callbacks to mutate a snapshot and push
6
- * a text rendering through `onUpdate` — keeping TUI / Gateway / IM consumers in
7
- * lock-step from a single source of truth.
8
- */
9
- import type { WorkflowSnapshotDefinition, WorkflowSnapshot } from './types.js';
10
- export declare function createWorkflowSnapshot(definition: WorkflowSnapshotDefinition): WorkflowSnapshot;
11
- export declare function recomputeCounts(snapshot: WorkflowSnapshot): void;
12
- export interface RenderOptions {
13
- maxAgentsPerPhase?: number;
14
- maxLogs?: number;
15
- showResultPreviews?: boolean;
16
- }
17
- export type WorkflowPanelStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'timeout' | string;
18
- export interface WorkflowPanelOptions {
19
- status?: WorkflowPanelStatus;
20
- maxActiveAgents?: number;
21
- maxRecentAgents?: number;
22
- maxErrors?: number;
23
- nowMs?: number;
24
- }
25
- export declare function renderWorkflowText(snapshot: WorkflowSnapshot, completed?: boolean, options?: RenderOptions): string;
26
- export declare function previewValue(value: unknown, max?: number): string;
27
- export declare function renderWorkflowPanel(snapshot: WorkflowSnapshot, options?: WorkflowPanelOptions): string;
28
- export declare function renderWorkflowFinalSummary(snapshot: WorkflowSnapshot, options?: WorkflowPanelOptions): string;
@@ -1,267 +0,0 @@
1
- import { emptySnapshotFor } from "./snapshot-empty.js";
2
- //#region src/agent/workflow/snapshot.ts
3
- function createWorkflowSnapshot(definition) {
4
- return emptySnapshotFor(definition.name, definition.description, definition.phases?.map((phase) => phase.title));
5
- }
6
- function recomputeCounts(snapshot) {
7
- let running = 0;
8
- let done = 0;
9
- let error = 0;
10
- let skipped = 0;
11
- for (const agent of snapshot.agents) switch (agent.status) {
12
- case "running":
13
- running++;
14
- break;
15
- case "done":
16
- done++;
17
- break;
18
- case "error":
19
- error++;
20
- break;
21
- case "skipped":
22
- skipped++;
23
- break;
24
- }
25
- snapshot.agentCount = snapshot.agents.length;
26
- snapshot.runningCount = running;
27
- snapshot.doneCount = done;
28
- snapshot.errorCount = error;
29
- snapshot.skippedCount = skipped;
30
- }
31
- function renderWorkflowText(snapshot, completed = false, options = {}) {
32
- const maxAgentsPerPhase = options.maxAgentsPerPhase ?? 6;
33
- const maxLogs = options.maxLogs ?? 2;
34
- const showPreviews = options.showResultPreviews ?? false;
35
- const state = stateSuffix(snapshot);
36
- const lines = [completed ? `◆ workflow ✓ ${snapshot.name} (${snapshot.doneCount}/${snapshot.agentCount} done${state})` : `◆ workflow: ${snapshot.name} (${snapshot.doneCount}/${snapshot.agentCount} done${state})`];
37
- const phaseNames = uniqueOrdered([
38
- ...snapshot.phases,
39
- ...snapshot.currentPhase ? [snapshot.currentPhase] : [],
40
- ...snapshot.agents.map((a) => a.phase).filter((p) => Boolean(p))
41
- ]);
42
- const rendered = /* @__PURE__ */ new Set();
43
- for (const phase of phaseNames) {
44
- const agents = snapshot.agents.filter((a) => a.phase === phase);
45
- if (agents.length === 0 && snapshot.currentPhase !== phase) continue;
46
- for (const a of agents) rendered.add(a);
47
- const counts = countAgents(agents);
48
- const completeHere = agents.length > 0 && counts.done + counts.error + counts.skipped === agents.length;
49
- const marker = counts.running > 0 || !completeHere && snapshot.currentPhase === phase ? "▶" : completeHere ? "✓" : " ";
50
- const tail = (counts.running ? ` · ${counts.running} running` : "") + (counts.error ? ` · ${counts.error} errors` : "") + (counts.skipped ? ` · ${counts.skipped} skipped` : "");
51
- lines.push(` ${marker} ${phase} ${counts.done}/${agents.length}${tail}`);
52
- const visible = agents.slice(-maxAgentsPerPhase);
53
- for (const agent of visible) {
54
- const previewText = showPreviews && agent.resultPreview ? ` — ${agent.resultPreview}` : "";
55
- lines.push(` #${agent.id} ${statusIcon(agent.status)} ${shorten(agent.label, 56)}${previewText}`);
56
- }
57
- if (agents.length > visible.length) lines.push(` … ${agents.length - visible.length} earlier agents`);
58
- }
59
- const unphased = snapshot.agents.filter((a) => !rendered.has(a));
60
- if (unphased.length > 0) {
61
- lines.push(" unphased");
62
- for (const agent of unphased.slice(-maxAgentsPerPhase)) {
63
- const previewText = showPreviews && agent.resultPreview ? ` — ${agent.resultPreview}` : "";
64
- lines.push(` #${agent.id} ${statusIcon(agent.status)} ${shorten(agent.label, 56)}${previewText}`);
65
- }
66
- }
67
- const visibleLogs = snapshot.logs.slice(-maxLogs);
68
- if (visibleLogs.length > 0) {
69
- lines.push("");
70
- for (const log of visibleLogs) lines.push(` log: ${shorten(log, 80)}`);
71
- }
72
- return lines.join("\n");
73
- }
74
- function previewValue(value, max = 80) {
75
- if (value === null || value === void 0) return "";
76
- const text = typeof value === "string" ? value : safeStringify(value);
77
- if (!text) return "";
78
- return text.length > max ? `${text.slice(0, max - 1)}…` : text;
79
- }
80
- function renderWorkflowPanel(snapshot, options = {}) {
81
- const status = options.status ?? inferPanelStatus(snapshot);
82
- const activeAgents = snapshot.agents.filter((agent) => agent.status === "running");
83
- const queuedAgents = snapshot.agents.filter((agent) => agent.status === "queued");
84
- const activeLimit = options.maxActiveAgents ?? 4;
85
- const recentLimit = options.maxRecentAgents ?? 4;
86
- const durationText = formatDuration(resolveElapsedMs(snapshot, options.nowMs));
87
- const counts = formatRunCounts(snapshot);
88
- const lines = [`◆ ${snapshot.name} ${statusText(status)} ${counts}${durationText ? ` ${durationText}` : ""}`];
89
- const phaseLines = renderPanelPhaseLines(snapshot);
90
- if (phaseLines.length > 0) lines.push("", "Phase", ...phaseLines);
91
- const visibleActive = activeAgents.length > 0 ? activeAgents : queuedAgents;
92
- if (visibleActive.length > 0) {
93
- lines.push("", activeAgents.length > 0 ? "Active" : "Queued");
94
- for (const agent of visibleActive.slice(0, activeLimit)) lines.push(...renderActiveAgentLines(agent));
95
- if (visibleActive.length > activeLimit) lines.push(` … ${visibleActive.length - activeLimit} more`);
96
- }
97
- const recent = recentCompletedAgents(snapshot).slice(0, recentLimit);
98
- if (recent.length > 0) {
99
- lines.push("", "Recent");
100
- for (const agent of recent) lines.push(renderRecentAgentLine(agent));
101
- }
102
- const errors = snapshot.agents.filter((agent) => agent.status === "error" || agent.error);
103
- if (errors.length > 0) {
104
- lines.push("", "Errors");
105
- for (const agent of errors.slice(0, options.maxErrors ?? 3)) lines.push(` ✗ #${agent.id} ${shorten(agent.label, 28)}${agent.error ? `: ${shorten(agent.error, 96)}` : ""}`);
106
- if (errors.length > (options.maxErrors ?? 3)) lines.push(` … ${errors.length - (options.maxErrors ?? 3)} more`);
107
- }
108
- return lines.join("\n");
109
- }
110
- function renderWorkflowFinalSummary(snapshot, options = {}) {
111
- const status = options.status ?? inferPanelStatus(snapshot);
112
- const durationText = formatDuration(resolveElapsedMs(snapshot, options.nowMs));
113
- const lines = [`◆ ${snapshot.name} ${statusText(status)} ${formatRunCounts(snapshot)}${durationText ? ` ${durationText}` : ""}`];
114
- const result = previewValue(snapshot.result, 280);
115
- if (result) lines.push("", "Result", ` ${result}`);
116
- else {
117
- const fallback = recentCompletedAgents(snapshot).map((agent) => agent.resultPreview).find((value) => Boolean(value));
118
- if (fallback) lines.push("", "Result", ` ${shorten(fallback, 280)}`);
119
- }
120
- const errors = snapshot.agents.filter((agent) => agent.status === "error" || agent.error);
121
- if (errors.length > 0) {
122
- lines.push("", "Errors");
123
- for (const agent of errors.slice(0, options.maxErrors ?? 5)) lines.push(` ✗ #${agent.id} ${shorten(agent.label, 32)}${agent.error ? `: ${shorten(agent.error, 120)}` : ""}`);
124
- }
125
- const recent = recentCompletedAgents(snapshot).slice(0, options.maxRecentAgents ?? 5);
126
- if (recent.length > 0) {
127
- lines.push("", "Completed");
128
- for (const agent of recent) lines.push(renderRecentAgentLine(agent));
129
- }
130
- return lines.join("\n");
131
- }
132
- function countAgents(agents) {
133
- let done = 0;
134
- let running = 0;
135
- let error = 0;
136
- let skipped = 0;
137
- for (const a of agents) if (a.status === "done") done++;
138
- else if (a.status === "running") running++;
139
- else if (a.status === "error") error++;
140
- else if (a.status === "skipped") skipped++;
141
- return {
142
- done,
143
- running,
144
- error,
145
- skipped
146
- };
147
- }
148
- function statusIcon(status) {
149
- switch (status) {
150
- case "queued": return "○";
151
- case "running": return "●";
152
- case "done": return "✓";
153
- case "error": return "✗";
154
- case "skipped": return "-";
155
- }
156
- }
157
- function statusText(status) {
158
- switch (status) {
159
- case "queued": return "queued";
160
- case "running": return "running";
161
- case "succeeded": return "✓ completed";
162
- case "failed": return "✗ failed";
163
- case "cancelled": return "cancelled";
164
- case "timeout": return "timeout";
165
- default: return String(status || "running");
166
- }
167
- }
168
- function inferPanelStatus(snapshot) {
169
- if (snapshot.errorCount > 0) return "failed";
170
- if (snapshot.runningCount > 0) return "running";
171
- if (snapshot.doneCount + snapshot.skippedCount >= snapshot.agentCount && snapshot.agentCount > 0) return "succeeded";
172
- return "queued";
173
- }
174
- function formatRunCounts(snapshot) {
175
- const parts = [`${snapshot.doneCount}/${snapshot.agentCount} done`];
176
- if (snapshot.runningCount > 0) parts.push(`${snapshot.runningCount} running`);
177
- if (snapshot.errorCount > 0) parts.push(`${snapshot.errorCount} errors`);
178
- if (snapshot.skippedCount > 0) parts.push(`${snapshot.skippedCount} skipped`);
179
- return parts.join(" · ");
180
- }
181
- function resolveElapsedMs(snapshot, nowMs = Date.now()) {
182
- if (snapshot.durationMs != null) return snapshot.durationMs;
183
- const starts = snapshot.agents.map((agent) => agent.startedAtMs).filter((value) => typeof value === "number" && Number.isFinite(value));
184
- if (starts.length === 0) return void 0;
185
- return Math.max(0, nowMs - Math.min(...starts));
186
- }
187
- function formatDuration(ms) {
188
- if (ms == null || !Number.isFinite(ms)) return "";
189
- const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
190
- const minutes = Math.floor(totalSeconds / 60);
191
- const seconds = totalSeconds % 60;
192
- if (minutes < 60) return `${minutes}:${String(seconds).padStart(2, "0")}`;
193
- const hours = Math.floor(minutes / 60);
194
- const restMinutes = minutes % 60;
195
- return `${hours}:${String(restMinutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
196
- }
197
- function renderPanelPhaseLines(snapshot) {
198
- const phaseNames = uniqueOrdered([
199
- ...snapshot.phases,
200
- ...snapshot.currentPhase ? [snapshot.currentPhase] : [],
201
- ...snapshot.agents.map((a) => a.phase).filter((p) => Boolean(p))
202
- ]);
203
- const out = [];
204
- for (const phase of phaseNames) {
205
- const agents = snapshot.agents.filter((agent) => agent.phase === phase);
206
- const counts = countAgents(agents);
207
- const complete = agents.length > 0 && counts.done + counts.error + counts.skipped === agents.length;
208
- const marker = counts.running > 0 || !complete && snapshot.currentPhase === phase ? "▶" : complete ? "✓" : "○";
209
- const tail = [
210
- counts.running > 0 ? `${counts.running} running` : "",
211
- counts.error > 0 ? `${counts.error} errors` : "",
212
- counts.skipped > 0 ? `${counts.skipped} skipped` : ""
213
- ].filter(Boolean).join(" · ");
214
- out.push(` ${marker} ${phase} ${counts.done}/${agents.length}${tail ? ` · ${tail}` : ""}`);
215
- }
216
- return out;
217
- }
218
- function renderActiveAgentLines(agent) {
219
- const step = agent.currentStep || latestStepSummary(agent);
220
- const iteration = agent.iteration != null && agent.maxIterations != null ? ` [${agent.iteration}/${agent.maxIterations}]` : "";
221
- const head = ` ${agent.status === "running" ? "●" : "○"} #${agent.id} ${shorten(agent.label, 32)}${iteration}`;
222
- return step ? [head, ` ${shorten(step, 96)}`] : [head];
223
- }
224
- function renderRecentAgentLine(agent) {
225
- const preview = agent.error || agent.resultPreview || latestStepResult(agent);
226
- return ` ${statusIcon(agent.status)} #${agent.id} ${shorten(agent.label, 32)}${preview ? ` — ${shorten(preview, 96)}` : ""}`;
227
- }
228
- function recentCompletedAgents(snapshot) {
229
- return [...snapshot.agents].filter((agent) => agent.status === "done" || agent.status === "error" || agent.status === "skipped").reverse();
230
- }
231
- function latestStepSummary(agent) {
232
- const step = [...agent.steps ?? []].reverse().find((entry) => entry.status === "running") ?? agent.steps?.[agent.steps.length - 1];
233
- if (!step) return "";
234
- return step.detail ? `${step.label}: ${step.detail}` : step.label;
235
- }
236
- function latestStepResult(agent) {
237
- const step = [...agent.steps ?? []].reverse().find((entry) => entry.resultPreview || entry.error);
238
- return step?.error || step?.resultPreview || "";
239
- }
240
- function stateSuffix(snapshot) {
241
- if (snapshot.errorCount > 0) return `, ${snapshot.errorCount} errors`;
242
- if (snapshot.skippedCount > 0) return `, ${snapshot.skippedCount} skipped`;
243
- if (snapshot.runningCount > 0) return `, ${snapshot.runningCount} running`;
244
- return "";
245
- }
246
- function uniqueOrdered(values) {
247
- const seen = /* @__PURE__ */ new Set();
248
- const out = [];
249
- for (const v of values) if (!seen.has(v)) {
250
- seen.add(v);
251
- out.push(v);
252
- }
253
- return out;
254
- }
255
- function shorten(value, max) {
256
- const text = value.replace(/\s+/g, " ").trim();
257
- return text.length > max ? `${text.slice(0, max - 1)}…` : text;
258
- }
259
- function safeStringify(value) {
260
- try {
261
- return JSON.stringify(value);
262
- } catch {
263
- return String(value);
264
- }
265
- }
266
- //#endregion
267
- export { createWorkflowSnapshot, previewValue, recomputeCounts, renderWorkflowFinalSummary, renderWorkflowPanel, renderWorkflowText };
@@ -1,8 +0,0 @@
1
- /**
2
- * Human-readable labels for workflow subagent tool steps (server-side snapshot).
3
- * Mirrors the web `tool-friendly-title` rules so IM/TUI and gateway stay aligned.
4
- */
5
- export declare function workflowStepLabel(toolName: string, args: Record<string, unknown>): {
6
- label: string;
7
- detail?: string;
8
- };