@xopcai/xopc 0.0.142 → 0.0.143

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 (543) hide show
  1. package/README.md +1 -1
  2. package/dist/browser-ext/manifest.json +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/activity-center-store-jITiX2vJ.js +1 -0
  5. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BawPxiu5.js → agent-avatar-dicebear-DiME9u_P.js} +1 -1
  6. package/dist/gateway/static/root/assets/agents-DzBXhZXO.js +2 -0
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-81xd1p9R.js → app-management-settings-panel-Cuo7SbUP.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-DYeQsYU8.js → appearance-settings-DUfdNQqk.js} +1 -1
  9. package/dist/gateway/static/root/assets/apps-page-CKuKK5AU.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-D_oa7oti.js → archive-plugin-B-Qk6cGr.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-Cd-bwI2N.js → attachment-load-Di6EEbQX.js} +1 -1
  12. package/dist/gateway/static/root/assets/automation-suggestion-card-DGxvRxtO.js +1 -0
  13. package/dist/gateway/static/root/assets/automations-page-D-FF_WKV.js +4 -0
  14. package/dist/gateway/static/root/assets/{binary-plugins-O8svLKWw.js → binary-plugins-ZaOZDH2I.js} +1 -1
  15. package/dist/gateway/static/root/assets/block-editor-BTFhjWfg.js +184 -0
  16. package/dist/gateway/static/root/assets/browser-settings-page-BvKLdEQt.js +8 -0
  17. package/dist/gateway/static/root/assets/{capability-presets-api-dJy1Eqgx.js → capability-presets-api-BU-pVZiZ.js} +1 -1
  18. package/dist/gateway/static/root/assets/capability-presets-settings-panel-DgyeEwzh.js +2 -0
  19. package/dist/gateway/static/root/assets/{channel-recipient-api-Bfuhp2ty.js → channel-recipient-api-DuulnhIj.js} +1 -1
  20. package/dist/gateway/static/root/assets/channels-settings-BbVsdD_I.js +1 -0
  21. package/dist/gateway/static/root/assets/channels-status-swr-B5lVrUsN.js +1 -0
  22. package/dist/gateway/static/root/assets/check-BODqo66o.js +1 -0
  23. package/dist/gateway/static/root/assets/chunk-QUQL4437-DXsxWP7r.js +4 -0
  24. package/dist/gateway/static/root/assets/circle-alert-RzVebuX2.js +1 -0
  25. package/dist/gateway/static/root/assets/connectors-page-B8QqVy3I.js +2 -0
  26. package/dist/gateway/static/root/assets/{desktop-pet-DFMfIb5F.js → desktop-pet---yzVxVR.js} +1 -1
  27. package/dist/gateway/static/root/assets/desktop-pet-settings-Dc3gqBJE.js +1 -0
  28. package/dist/gateway/static/root/assets/{directory-picker-path-field-BrYt1gAr.js → directory-picker-path-field-DCmOGLtK.js} +1 -1
  29. package/dist/gateway/static/root/assets/dreaming-settings-BgT5KZVe.js +3 -0
  30. package/dist/gateway/static/root/assets/{extension-debug-page-Bh630pLD.js → extension-debug-page-ByaKTTq4.js} +1 -1
  31. package/dist/gateway/static/root/assets/extension-page-BmRzHAZr.js +1 -0
  32. package/dist/gateway/static/root/assets/extension-settings-page-JUtwIhbF.js +1 -0
  33. package/dist/gateway/static/root/assets/{fetch-B1WtuprY.js → fetch-8QNN25Sh.js} +1 -1
  34. package/dist/gateway/static/root/assets/{gateway-config-api-De2N821l.js → gateway-config-api-CxicF50_.js} +1 -1
  35. package/dist/gateway/static/root/assets/gateway-settings-Bz2I_EO5.js +1 -0
  36. package/dist/gateway/static/root/assets/{gateway-startup-retry-nEujFSDj.js → gateway-startup-retry-5YBnS9Fj.js} +1 -1
  37. package/dist/gateway/static/root/assets/goal-create-dialog-VcoyuZGN.js +1 -0
  38. package/dist/gateway/static/root/assets/goal-detail-page-Cilkap2G.js +4 -0
  39. package/dist/gateway/static/root/assets/{goals-config-api-DUy3eEse.js → goals-config-api-CwcHRdC0.js} +1 -1
  40. package/dist/gateway/static/root/assets/goals-page-C6eoni4z.js +2 -0
  41. package/dist/gateway/static/root/assets/goals-settings-o4i-qAOS.js +1 -0
  42. package/dist/gateway/static/root/assets/heartbeat-settings-DQQkETX8.js +1 -0
  43. package/dist/gateway/static/root/assets/index-BKRqeRHm.js +257 -0
  44. package/dist/gateway/static/root/assets/index-CphxClbs.css +1 -0
  45. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CVIwwM15.js → keyboard-shortcuts-settings-LT6qB-ua.js} +1 -1
  46. package/dist/gateway/static/root/assets/logs-page-Dli2e3fS.js +7 -0
  47. package/dist/gateway/static/root/assets/{markdown-split-B_6us9j7.js → markdown-split-Dw-yE2-y.js} +1 -1
  48. package/dist/gateway/static/root/assets/{media-plugins-D_fryIyj.js → media-plugins-D9NNNUgE.js} +1 -1
  49. package/dist/gateway/static/root/assets/messages-CzKxM6I4.js +5 -0
  50. package/dist/gateway/static/root/assets/models-hub-panel-DVn2Q1Ik.js +2 -0
  51. package/dist/gateway/static/root/assets/notes-page-CRgbJGgk.js +1 -0
  52. package/dist/gateway/static/root/assets/notes-workbench-BxZRHLWx.js +2 -0
  53. package/dist/gateway/static/root/assets/{page-tabs-D_8jGlqx.js → page-tabs-D4hkWVt_.js} +1 -1
  54. package/dist/gateway/static/root/assets/{preview-open-alternatives-BBLMK8Mp.js → preview-open-alternatives-CIckv0uy.js} +1 -1
  55. package/dist/gateway/static/root/assets/project-detail-page-Doz53xLn.js +1 -0
  56. package/dist/gateway/static/root/assets/projects-page-DoMtcRLg.js +1 -0
  57. package/dist/gateway/static/root/assets/remote-access-hub-BeHVEgrm.js +1 -0
  58. package/dist/gateway/static/root/assets/{save-bar-controls-DVS3FR5r.js → save-bar-controls-B0b42kB2.js} +1 -1
  59. package/dist/gateway/static/root/assets/{schedule-field-D6vKd6-T.js → schedule-field-BtjEkczK.js} +1 -1
  60. package/dist/gateway/static/root/assets/{schema-form-BPy4lbIh.js → schema-form-Bf0bk3i6.js} +1 -1
  61. package/dist/gateway/static/root/assets/sessions-page-Bk4bQsBe.js +1 -0
  62. package/dist/gateway/static/root/assets/settings-advanced-gate-DdFyaRMm.js +1 -0
  63. package/dist/gateway/static/root/assets/{settings-collapsible-section-WzdikxPt.js → settings-collapsible-section-BTKTdTNX.js} +1 -1
  64. package/dist/gateway/static/root/assets/{settings-form-section-CvfzhBV-.js → settings-form-section-DL4P0sAj.js} +1 -1
  65. package/dist/gateway/static/root/assets/{settings-loading-skeleton-BxR-Ulhi.js → settings-loading-skeleton-BV6KFNj4.js} +1 -1
  66. package/dist/gateway/static/root/assets/settings-page-B_4DsX5W.js +1 -0
  67. package/dist/gateway/static/root/assets/{settings-page-layout-CKefvbYi.js → settings-page-layout-CyGlrInB.js} +1 -1
  68. package/dist/gateway/static/root/assets/setup-status-panel-DJ1_MLgX.js +1 -0
  69. package/dist/gateway/static/root/assets/share-preview-page-BQBV7YrV.js +2 -0
  70. package/dist/gateway/static/root/assets/shares-settings-0VuFLBeU.js +1 -0
  71. package/dist/gateway/static/root/assets/skill-reload-api-DO87Ckeo.js +1 -0
  72. package/dist/gateway/static/root/assets/skills-page-D3VdtxAn.js +2 -0
  73. package/dist/gateway/static/root/assets/{system-settings-panel-BokgAgf7.js → system-settings-panel-D85fBBuI.js} +1 -1
  74. package/dist/gateway/static/root/assets/{typed-models-lib-BwHlNL3L.js → typed-models-lib-CwEuYrHX.js} +1 -1
  75. package/dist/gateway/static/root/assets/{use-channel-catalog-DR11ap3A.js → use-channel-catalog-COXIfXcl.js} +1 -1
  76. package/dist/gateway/static/root/assets/user-context-page-m9JVQ73F.js +1 -0
  77. package/dist/gateway/static/root/assets/user-profile-fields-editor-DtQiuY7E.js +1 -0
  78. package/dist/gateway/static/root/assets/user-profile-settings-panel-CWM0fEpb.js +1 -0
  79. package/dist/gateway/static/root/assets/{utils-BKUWB-TT.js → utils--BO6xT3u.js} +1 -1
  80. package/dist/gateway/static/root/assets/voice-api-key-field-LoT3wgZ9.js +1 -0
  81. package/dist/gateway/static/root/assets/with-selector-aYPsXwdl.js +1 -0
  82. package/dist/gateway/static/root/assets/work-item-detail-page-DSTMz_mO.js +1 -0
  83. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CL_rnAUB.js → workflow-run-setup-panel-B35lJzvm.js} +2 -2
  84. package/dist/gateway/static/root/assets/workflows-page-BfSm9oR8.js +11 -0
  85. package/dist/gateway/static/root/assets/workflows-page-DLioOiRN.css +1 -0
  86. package/dist/gateway/static/root/connector-icons/README.md +11 -0
  87. package/dist/gateway/static/root/connector-icons/airtable.svg +13 -0
  88. package/dist/gateway/static/root/connector-icons/asana.svg +15 -0
  89. package/dist/gateway/static/root/connector-icons/brave-search.svg +1 -0
  90. package/dist/gateway/static/root/connector-icons/clickup.svg +19 -0
  91. package/dist/gateway/static/root/connector-icons/composio.svg +266 -0
  92. package/dist/gateway/static/root/connector-icons/discord.svg +15 -0
  93. package/dist/gateway/static/root/connector-icons/dropbox.svg +152 -0
  94. package/dist/gateway/static/root/connector-icons/excel.svg +56 -0
  95. package/dist/gateway/static/root/connector-icons/fetch.svg +6 -0
  96. package/dist/gateway/static/root/connector-icons/figma.svg +178 -0
  97. package/dist/gateway/static/root/connector-icons/filesystem.svg +6 -0
  98. package/dist/gateway/static/root/connector-icons/github.svg +10 -0
  99. package/dist/gateway/static/root/connector-icons/gmail.svg +3 -0
  100. package/dist/gateway/static/root/connector-icons/google-calendar.svg +3 -0
  101. package/dist/gateway/static/root/connector-icons/google-docs.svg +25 -0
  102. package/dist/gateway/static/root/connector-icons/google-drive.svg +25 -0
  103. package/dist/gateway/static/root/connector-icons/google-sheets.svg +1 -0
  104. package/dist/gateway/static/root/connector-icons/hubspot.svg +142 -0
  105. package/dist/gateway/static/root/connector-icons/jira.svg +15 -0
  106. package/dist/gateway/static/root/connector-icons/linear.svg +5 -0
  107. package/dist/gateway/static/root/connector-icons/memory.svg +5 -0
  108. package/dist/gateway/static/root/connector-icons/microsoft-teams.svg +33 -0
  109. package/dist/gateway/static/root/connector-icons/notion.svg +5 -0
  110. package/dist/gateway/static/root/connector-icons/one-drive.svg +13 -0
  111. package/dist/gateway/static/root/connector-icons/outlook.svg +76 -0
  112. package/dist/gateway/static/root/connector-icons/playwright.svg +9 -0
  113. package/dist/gateway/static/root/connector-icons/salesforce.svg +17 -0
  114. package/dist/gateway/static/root/connector-icons/sequential-thinking.svg +8 -0
  115. package/dist/gateway/static/root/connector-icons/shopify.svg +5 -0
  116. package/dist/gateway/static/root/connector-icons/slack.svg +9 -0
  117. package/dist/gateway/static/root/connector-icons/spotify.svg +43 -0
  118. package/dist/gateway/static/root/connector-icons/stripe.svg +11 -0
  119. package/dist/gateway/static/root/connector-icons/telegram.svg +130 -0
  120. package/dist/gateway/static/root/connector-icons/time.svg +6 -0
  121. package/dist/gateway/static/root/connector-icons/todoist.svg +277 -0
  122. package/dist/gateway/static/root/connector-icons/trello.svg +19 -0
  123. package/dist/gateway/static/root/connector-icons/twitter.svg +128 -0
  124. package/dist/gateway/static/root/connector-icons/whatsapp.svg +61 -0
  125. package/dist/gateway/static/root/connector-icons/youtube.svg +11 -0
  126. package/dist/gateway/static/root/index.html +9 -6
  127. package/dist/package.js +1 -1
  128. package/dist/src/agent/agent-manager.d.ts +2 -0
  129. package/dist/src/agent/agent-manager.js +8 -0
  130. package/dist/src/agent/agent-manager.js.map +1 -1
  131. package/dist/src/agent/background-review/prompts.d.ts +1 -1
  132. package/dist/src/agent/background-review/prompts.js +3 -2
  133. package/dist/src/agent/background-review/prompts.js.map +1 -1
  134. package/dist/src/agent/embedded/session-tool-result-guard.js +1 -1
  135. package/dist/src/agent/embedded/xopc-tools-bridge.d.ts +9 -0
  136. package/dist/src/agent/embedded/xopc-tools-bridge.js +71 -3
  137. package/dist/src/agent/embedded/xopc-tools-bridge.js.map +1 -1
  138. package/dist/src/agent/goals/post-turn.js +5 -4
  139. package/dist/src/agent/goals/post-turn.js.map +1 -1
  140. package/dist/src/agent/mcp/mcp-transport.js +4 -1
  141. package/dist/src/agent/mcp/mcp-transport.js.map +1 -1
  142. package/dist/src/agent/memory/context/planner.d.ts +1 -0
  143. package/dist/src/agent/memory/context/planner.js +60 -14
  144. package/dist/src/agent/memory/context/planner.js.map +1 -1
  145. package/dist/src/agent/memory/context/types.d.ts +3 -1
  146. package/dist/src/agent/memory/lifecycle.d.ts +11 -0
  147. package/dist/src/agent/memory/lifecycle.js +50 -0
  148. package/dist/src/agent/memory/lifecycle.js.map +1 -0
  149. package/dist/src/agent/memory/source-origin.d.ts +3 -0
  150. package/dist/src/agent/memory/source-origin.js +19 -0
  151. package/dist/src/agent/memory/source-origin.js.map +1 -0
  152. package/dist/src/agent/memory/understanding/service.js +5 -0
  153. package/dist/src/agent/memory/understanding/service.js.map +1 -1
  154. package/dist/src/agent/memory/user-context-coordinator.js +7 -2
  155. package/dist/src/agent/memory/user-context-coordinator.js.map +1 -1
  156. package/dist/src/agent/prompt/sections/behavior.d.ts +2 -0
  157. package/dist/src/agent/prompt/sections/behavior.js +30 -1
  158. package/dist/src/agent/prompt/sections/behavior.js.map +1 -1
  159. package/dist/src/agent/prompt/sections/tooling.js +1 -1
  160. package/dist/src/agent/prompt/sections/tooling.js.map +1 -1
  161. package/dist/src/agent/prompt/service-prompt-builder.js +8 -1
  162. package/dist/src/agent/prompt/service-prompt-builder.js.map +1 -1
  163. package/dist/src/agent/prompt/system-prompt.d.ts +2 -0
  164. package/dist/src/agent/prompt/system-prompt.js +6 -3
  165. package/dist/src/agent/prompt/system-prompt.js.map +1 -1
  166. package/dist/src/agent/service/process-direct-streaming.js +22 -0
  167. package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
  168. package/dist/src/agent/service.d.ts +2 -0
  169. package/dist/src/agent/service.js +9 -3
  170. package/dist/src/agent/service.js.map +1 -1
  171. package/dist/src/agent/starter-agents.js +1 -1
  172. package/dist/src/agent/starter-agents.js.map +1 -1
  173. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  174. package/dist/src/agent/tool-manuals/xopc-use.js +1 -1
  175. package/dist/src/agent/tool-manuals/xopc-use.js.map +1 -1
  176. package/dist/src/agent/tools/composio-tool.d.ts +18 -5
  177. package/dist/src/agent/tools/composio-tool.js +252 -35
  178. package/dist/src/agent/tools/composio-tool.js.map +1 -1
  179. package/dist/src/agent/tools/factory.js +7 -3
  180. package/dist/src/agent/tools/factory.js.map +1 -1
  181. package/dist/src/agent/tools/index.d.ts +1 -1
  182. package/dist/src/agent/tools/index.js +2 -2
  183. package/dist/src/agent/tools/workflow-tool.d.ts +0 -1
  184. package/dist/src/agent/tools/workflow-tool.js +3 -16
  185. package/dist/src/agent/tools/workflow-tool.js.map +1 -1
  186. package/dist/src/agent/workflow/builtins/index.d.ts +2 -28
  187. package/dist/src/agent/workflow/builtins/index.js +226 -41
  188. package/dist/src/agent/workflow/builtins/index.js.map +1 -1
  189. package/dist/src/agent/workflow/catalog.d.ts +32 -34
  190. package/dist/src/agent/workflow/catalog.js +158 -154
  191. package/dist/src/agent/workflow/catalog.js.map +1 -1
  192. package/dist/src/agent/workflow/index.d.ts +4 -6
  193. package/dist/src/agent/workflow/index.js +2 -5
  194. package/dist/src/agent/workflow/snapshot.d.ts +2 -2
  195. package/dist/src/agent/workflow/snapshot.js +2 -2
  196. package/dist/src/agent/workflow/snapshot.js.map +1 -1
  197. package/dist/src/agent/workflow/structured-output-tool.d.ts +2 -2
  198. package/dist/src/agent/workflow/structured-output-tool.js +2 -2
  199. package/dist/src/agent/workflow/structured-output-tool.js.map +1 -1
  200. package/dist/src/agent/workflow/subagent-runner.js +1 -1
  201. package/dist/src/agent/workflow/types.d.ts +31 -26
  202. package/dist/src/agent-manifest/index.d.ts +1 -0
  203. package/dist/src/agent-manifest/index.js +3 -1
  204. package/dist/src/agent-manifest/index.js.map +1 -1
  205. package/dist/src/agent-manifest/preset-chain.d.ts +10 -0
  206. package/dist/src/agent-manifest/preset-chain.js +32 -0
  207. package/dist/src/agent-manifest/preset-chain.js.map +1 -0
  208. package/dist/src/agent-manifest/resolver.js +3 -10
  209. package/dist/src/agent-manifest/resolver.js.map +1 -1
  210. package/dist/src/agent-manifest/schema.d.ts +4 -4
  211. package/dist/src/automations/api/routes.js +13 -1
  212. package/dist/src/automations/api/routes.js.map +1 -1
  213. package/dist/src/automations/domain/validation.d.ts +14 -14
  214. package/dist/src/automations/draft/automation-draft-validator.d.ts +3 -3
  215. package/dist/src/browser/providers/browser-ext-install.d.ts +11 -1
  216. package/dist/src/browser/providers/browser-ext-install.js +39 -14
  217. package/dist/src/browser/providers/browser-ext-install.js.map +1 -1
  218. package/dist/src/capabilities/store-connector.d.ts +0 -1
  219. package/dist/src/capabilities/store-connector.js +3 -5
  220. package/dist/src/capabilities/store-connector.js.map +1 -1
  221. package/dist/src/chat-commands/builtins/review.js +72 -73
  222. package/dist/src/chat-commands/builtins/review.js.map +1 -1
  223. package/dist/src/chat-commands/builtins/workflow.js +9 -54
  224. package/dist/src/chat-commands/builtins/workflow.js.map +1 -1
  225. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  226. package/dist/src/cli/commands/extension-create.js +2 -2
  227. package/dist/src/cli/commands/extension-create.js.map +1 -1
  228. package/dist/src/cli/commands/extension-marketplace.js +42 -36
  229. package/dist/src/cli/commands/extension-marketplace.js.map +1 -1
  230. package/dist/src/cli/commands/extension-pack.d.ts +6 -0
  231. package/dist/src/cli/commands/extension-pack.js +3 -2
  232. package/dist/src/cli/commands/extension-pack.js.map +1 -1
  233. package/dist/src/commands/agents.config.d.ts +1 -0
  234. package/dist/src/commands/agents.config.js +1 -0
  235. package/dist/src/commands/agents.config.js.map +1 -1
  236. package/dist/src/config/schema.d.ts +6 -6
  237. package/dist/src/config/schema.js +6 -22
  238. package/dist/src/config/schema.js.map +1 -1
  239. package/dist/src/config/web-patch.d.ts +1 -1
  240. package/dist/src/connectors/approval.d.ts +2 -0
  241. package/dist/src/connectors/approval.js +33 -0
  242. package/dist/src/connectors/approval.js.map +1 -0
  243. package/dist/src/connectors/auth-provider-registry.d.ts +9 -0
  244. package/dist/src/connectors/auth-provider-registry.js +17 -0
  245. package/dist/src/connectors/auth-provider-registry.js.map +1 -0
  246. package/dist/src/connectors/builtin-catalog.js +55 -116
  247. package/dist/src/connectors/builtin-catalog.js.map +1 -1
  248. package/dist/src/connectors/catalog.js +7 -2
  249. package/dist/src/connectors/catalog.js.map +1 -1
  250. package/dist/src/connectors/composio-catalog.d.ts +19 -0
  251. package/dist/src/connectors/composio-catalog.js +237 -0
  252. package/dist/src/connectors/composio-catalog.js.map +1 -0
  253. package/dist/src/connectors/composio-logo.d.ts +1 -0
  254. package/dist/src/connectors/composio-logo.js +51 -0
  255. package/dist/src/connectors/composio-logo.js.map +1 -0
  256. package/dist/src/connectors/composio-sessions.d.ts +116 -0
  257. package/dist/src/connectors/composio-sessions.js +296 -0
  258. package/dist/src/connectors/composio-sessions.js.map +1 -0
  259. package/dist/src/connectors/composio-triggers.d.ts +17 -0
  260. package/dist/src/connectors/composio-triggers.js +48 -5
  261. package/dist/src/connectors/composio-triggers.js.map +1 -1
  262. package/dist/src/connectors/composio.d.ts +31 -2
  263. package/dist/src/connectors/composio.js +374 -151
  264. package/dist/src/connectors/composio.js.map +1 -1
  265. package/dist/src/connectors/connector-memory-sync.d.ts +15 -0
  266. package/dist/src/connectors/connector-memory-sync.js +90 -0
  267. package/dist/src/connectors/connector-memory-sync.js.map +1 -0
  268. package/dist/src/connectors/install.js +35 -92
  269. package/dist/src/connectors/install.js.map +1 -1
  270. package/dist/src/connectors/instances.js +6 -2
  271. package/dist/src/connectors/instances.js.map +1 -1
  272. package/dist/src/connectors/integration-strategy.d.ts +3 -0
  273. package/dist/src/connectors/integration-strategy.js +29 -0
  274. package/dist/src/connectors/integration-strategy.js.map +1 -0
  275. package/dist/src/connectors/policy.d.ts +13 -0
  276. package/dist/src/connectors/policy.js +48 -0
  277. package/dist/src/connectors/policy.js.map +1 -0
  278. package/dist/src/connectors/providers.js +1 -1
  279. package/dist/src/connectors/runtime-adapter-registry.d.ts +25 -0
  280. package/dist/src/connectors/runtime-adapter-registry.js +154 -0
  281. package/dist/src/connectors/runtime-adapter-registry.js.map +1 -0
  282. package/dist/src/connectors/types.d.ts +113 -4
  283. package/dist/src/connectors/workflow-preflight.d.ts +20 -0
  284. package/dist/src/connectors/workflow-preflight.js +70 -0
  285. package/dist/src/connectors/workflow-preflight.js.map +1 -0
  286. package/dist/src/extensions/install-transaction.d.ts +16 -0
  287. package/dist/src/extensions/install-transaction.js +76 -0
  288. package/dist/src/extensions/install-transaction.js.map +1 -0
  289. package/dist/src/extensions/install.d.ts +2 -0
  290. package/dist/src/extensions/install.js +23 -1
  291. package/dist/src/extensions/install.js.map +1 -1
  292. package/dist/src/gateway/agents-admin.d.ts +2 -0
  293. package/dist/src/gateway/agents-admin.js +7 -0
  294. package/dist/src/gateway/agents-admin.js.map +1 -1
  295. package/dist/src/gateway/capability-presets-admin.d.ts +11 -0
  296. package/dist/src/gateway/capability-presets-admin.js +11 -4
  297. package/dist/src/gateway/capability-presets-admin.js.map +1 -1
  298. package/dist/src/gateway/chat-stream/mapper.js +17 -0
  299. package/dist/src/gateway/chat-stream/mapper.js.map +1 -1
  300. package/dist/src/gateway/chat-stream/protocol.d.ts +18 -1
  301. package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -3
  302. package/dist/src/gateway/hono/routes/agents.js +3 -0
  303. package/dist/src/gateway/hono/routes/agents.js.map +1 -1
  304. package/dist/src/gateway/hono/routes/capability-presets.js +19 -1
  305. package/dist/src/gateway/hono/routes/capability-presets.js.map +1 -1
  306. package/dist/src/gateway/hono/routes/connectors.js +188 -25
  307. package/dist/src/gateway/hono/routes/connectors.js.map +1 -1
  308. package/dist/src/gateway/hono/routes/goals.js +22 -3
  309. package/dist/src/gateway/hono/routes/goals.js.map +1 -1
  310. package/dist/src/gateway/hono/routes/home.d.ts +60 -1
  311. package/dist/src/gateway/hono/routes/home.js +244 -18
  312. package/dist/src/gateway/hono/routes/home.js.map +1 -1
  313. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  314. package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
  315. package/dist/src/gateway/hono/routes/memory.js +14 -1
  316. package/dist/src/gateway/hono/routes/memory.js.map +1 -1
  317. package/dist/src/gateway/hono/routes/projects.js +103 -2
  318. package/dist/src/gateway/hono/routes/projects.js.map +1 -1
  319. package/dist/src/gateway/hono/routes/public-gateway.js +93 -0
  320. package/dist/src/gateway/hono/routes/public-gateway.js.map +1 -1
  321. package/dist/src/gateway/hono/routes/workflows.js +137 -22
  322. package/dist/src/gateway/hono/routes/workflows.js.map +1 -1
  323. package/dist/src/gateway/hono/routes/you.d.ts +23 -0
  324. package/dist/src/gateway/hono/routes/you.js +538 -0
  325. package/dist/src/gateway/hono/routes/you.js.map +1 -0
  326. package/dist/src/gateway/hono/sse.d.ts +2 -1
  327. package/dist/src/gateway/hono/sse.js +2 -1
  328. package/dist/src/gateway/hono/sse.js.map +1 -1
  329. package/dist/src/gateway/service/marketplace-service.d.ts +13 -1
  330. package/dist/src/gateway/service/marketplace-service.js +96 -40
  331. package/dist/src/gateway/service/marketplace-service.js.map +1 -1
  332. package/dist/src/gateway/service.d.ts +2 -0
  333. package/dist/src/gateway/service.js +7 -1
  334. package/dist/src/gateway/service.js.map +1 -1
  335. package/dist/src/goals/goal-service.d.ts +7 -5
  336. package/dist/src/goals/goal-service.js +25 -13
  337. package/dist/src/goals/goal-service.js.map +1 -1
  338. package/dist/src/goals/goal-store.js +46 -7
  339. package/dist/src/goals/goal-store.js.map +1 -1
  340. package/dist/src/goals/types.d.ts +24 -0
  341. package/dist/src/storage/sqlite/connector-repository.d.ts +49 -0
  342. package/dist/src/storage/sqlite/connector-repository.js +385 -0
  343. package/dist/src/storage/sqlite/connector-repository.js.map +1 -0
  344. package/dist/src/storage/sqlite/index.d.ts +3 -0
  345. package/dist/src/storage/sqlite/index.js +4 -1
  346. package/dist/src/storage/sqlite/migrations/030_connectors.sql +94 -0
  347. package/dist/src/storage/sqlite/migrations/031_connector_approvals.sql +24 -0
  348. package/dist/src/storage/sqlite/migrations/032_connector_webhook_deliveries.sql +15 -0
  349. package/dist/src/storage/sqlite/migrations/033_user_trust_policies.sql +6 -0
  350. package/dist/src/storage/sqlite/migrations/034_allow_global_auto_trust.sql +14 -0
  351. package/dist/src/storage/sqlite/migrations/035_user_profile_prompt_state.sql +7 -0
  352. package/dist/src/storage/sqlite/migrations/036_goal_outcome_metric.sql +12 -0
  353. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  354. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  355. package/dist/src/storage/sqlite/migrations/runner.js.map +1 -1
  356. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  357. package/dist/src/storage/sqlite/schema.js +1 -1
  358. package/dist/src/storage/sqlite/user-profile-setup-repository.d.ts +3 -0
  359. package/dist/src/storage/sqlite/user-profile-setup-repository.js +34 -0
  360. package/dist/src/storage/sqlite/user-profile-setup-repository.js.map +1 -0
  361. package/dist/src/storage/sqlite/user-trust-repository.d.ts +3 -0
  362. package/dist/src/storage/sqlite/user-trust-repository.js +34 -0
  363. package/dist/src/storage/sqlite/user-trust-repository.js.map +1 -0
  364. package/dist/src/tui/components/assistant-message.js +15 -0
  365. package/dist/src/tui/components/assistant-message.js.map +1 -1
  366. package/dist/src/tui/tui-agent-events.js +85 -1
  367. package/dist/src/tui/tui-agent-events.js.map +1 -1
  368. package/dist/src/tui/tui-command-formatters.js +7 -7
  369. package/dist/src/tui/tui-command-formatters.js.map +1 -1
  370. package/dist/src/tui/tui-commands.js +1 -1
  371. package/dist/src/tui/tui-startup-resources.js +1 -1
  372. package/dist/src/user-context/import.d.ts +12 -0
  373. package/dist/src/user-context/import.js +48 -0
  374. package/dist/src/user-context/import.js.map +1 -0
  375. package/dist/src/user-context/profile.d.ts +37 -0
  376. package/dist/src/user-context/profile.js +165 -0
  377. package/dist/src/user-context/profile.js.map +1 -0
  378. package/dist/src/user-context/projection.d.ts +54 -0
  379. package/dist/src/user-context/projection.js +121 -0
  380. package/dist/src/user-context/projection.js.map +1 -0
  381. package/dist/src/user-context/source-recommendations.d.ts +13 -0
  382. package/dist/src/user-context/source-recommendations.js +86 -0
  383. package/dist/src/user-context/source-recommendations.js.map +1 -0
  384. package/dist/src/user-context/trust-policy.d.ts +11 -0
  385. package/dist/src/user-context/trust-policy.js +31 -0
  386. package/dist/src/user-context/trust-policy.js.map +1 -0
  387. package/dist/src/workflows/authoring/index.d.ts +1 -0
  388. package/dist/src/workflows/authoring/index.js +2 -0
  389. package/dist/src/workflows/authoring/workflow-draft-store.d.ts +33 -0
  390. package/dist/src/workflows/authoring/workflow-draft-store.js +74 -0
  391. package/dist/src/workflows/authoring/workflow-draft-store.js.map +1 -0
  392. package/dist/src/workflows/domain/definition-utils.d.ts +6 -4
  393. package/dist/src/workflows/domain/definition-utils.js +28 -26
  394. package/dist/src/workflows/domain/definition-utils.js.map +1 -1
  395. package/dist/src/workflows/domain/definition.d.ts +79 -6
  396. package/dist/src/workflows/domain/event.d.ts +18 -2
  397. package/dist/src/workflows/domain/index.js +3 -3
  398. package/dist/src/workflows/domain/run.d.ts +16 -2
  399. package/dist/src/workflows/domain/run.js.map +1 -1
  400. package/dist/src/workflows/domain/validation.d.ts +9 -5
  401. package/dist/src/workflows/domain/validation.js +183 -40
  402. package/dist/src/workflows/domain/validation.js.map +1 -1
  403. package/dist/src/workflows/draft/workflow-draft-prompt.d.ts +2 -3
  404. package/dist/src/workflows/draft/workflow-draft-prompt.js +31 -73
  405. package/dist/src/workflows/draft/workflow-draft-prompt.js.map +1 -1
  406. package/dist/src/workflows/draft/workflow-draft-service.js +4 -8
  407. package/dist/src/workflows/draft/workflow-draft-service.js.map +1 -1
  408. package/dist/src/workflows/draft/workflow-draft-validator.js +29 -37
  409. package/dist/src/workflows/draft/workflow-draft-validator.js.map +1 -1
  410. package/dist/src/workflows/draft/workflow-draft.types.d.ts +4 -4
  411. package/dist/src/workflows/engine/projector.js +43 -1
  412. package/dist/src/workflows/engine/projector.js.map +1 -1
  413. package/dist/src/workflows/engine/workflow-engine.d.ts +2 -3
  414. package/dist/src/workflows/engine/workflow-engine.js +24 -4
  415. package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
  416. package/dist/src/workflows/index.js +4 -7
  417. package/dist/src/workflows/registry/catalog-workflow-definition-registry.js +1 -9
  418. package/dist/src/workflows/registry/catalog-workflow-definition-registry.js.map +1 -1
  419. package/dist/src/workflows/runtime/graph-workflow-runtime.d.ts +10 -0
  420. package/dist/src/workflows/runtime/graph-workflow-runtime.js +295 -0
  421. package/dist/src/workflows/runtime/graph-workflow-runtime.js.map +1 -0
  422. package/dist/src/workflows/runtime/index.d.ts +1 -2
  423. package/dist/src/workflows/runtime/index.js +2 -5
  424. package/dist/src/workflows/runtime/workflow-runtime-port.d.ts +5 -8
  425. package/dist/src/workflows/service/workflow-run-service.js +15 -1
  426. package/dist/src/workflows/service/workflow-run-service.js.map +1 -1
  427. package/dist/src/workflows/service/workflow-run-service.types.d.ts +2 -1
  428. package/package.json +4 -3
  429. package/dist/gateway/static/root/assets/agents-CyvCIHnB.js +0 -2
  430. package/dist/gateway/static/root/assets/apps-page-DK_Vx6nl.js +0 -1
  431. package/dist/gateway/static/root/assets/automation-suggestion-card-B1LV3YYv.js +0 -1
  432. package/dist/gateway/static/root/assets/automations-page-fzrovqhv.js +0 -4
  433. package/dist/gateway/static/root/assets/block-editor-Dhj5f4Bx.js +0 -184
  434. package/dist/gateway/static/root/assets/browser-settings-page-BDn-n-UB.js +0 -8
  435. package/dist/gateway/static/root/assets/capability-presets-settings-panel-Co5ipo_Q.js +0 -1
  436. package/dist/gateway/static/root/assets/channels-settings-BWlpaxg9.js +0 -1
  437. package/dist/gateway/static/root/assets/channels-status-swr-D_jkIZLV.js +0 -1
  438. package/dist/gateway/static/root/assets/connectors-page-BcekbW4q.js +0 -2
  439. package/dist/gateway/static/root/assets/desktop-pet-settings-BJCUuL8Y.js +0 -1
  440. package/dist/gateway/static/root/assets/dreaming-settings-BN1Z2mIo.js +0 -3
  441. package/dist/gateway/static/root/assets/extension-page-B-1KxvVy.js +0 -1
  442. package/dist/gateway/static/root/assets/extension-settings-page-BF9NACI3.js +0 -1
  443. package/dist/gateway/static/root/assets/gateway-settings-DN9sNREz.js +0 -1
  444. package/dist/gateway/static/root/assets/goal-create-dialog-BpoQW8cD.js +0 -1
  445. package/dist/gateway/static/root/assets/goal-detail-page-CBRSPd0b.js +0 -4
  446. package/dist/gateway/static/root/assets/goals-page-BCcBi407.js +0 -2
  447. package/dist/gateway/static/root/assets/goals-settings-pkTXzXkh.js +0 -1
  448. package/dist/gateway/static/root/assets/heartbeat-settings-ezsufgLQ.js +0 -1
  449. package/dist/gateway/static/root/assets/index-B8s8Pq5U.css +0 -1
  450. package/dist/gateway/static/root/assets/index-DcUaXYeb.js +0 -262
  451. package/dist/gateway/static/root/assets/logs-page-DQtTRXtj.js +0 -7
  452. package/dist/gateway/static/root/assets/messages-BXNELNBa.js +0 -3
  453. package/dist/gateway/static/root/assets/models-hub-panel-BP2M9n6Q.js +0 -2
  454. package/dist/gateway/static/root/assets/notes-page-CspveYaO.js +0 -1
  455. package/dist/gateway/static/root/assets/notes-workbench-BHwzJ0OC.js +0 -2
  456. package/dist/gateway/static/root/assets/project-detail-page-Dy3rsobs.js +0 -1
  457. package/dist/gateway/static/root/assets/projects-page-CWKpPE0L.js +0 -1
  458. package/dist/gateway/static/root/assets/remote-access-hub-CqNRyXEo.js +0 -1
  459. package/dist/gateway/static/root/assets/sessions-page-MEME7ivF.js +0 -1
  460. package/dist/gateway/static/root/assets/settings-advanced-gate-JVd0qaSF.js +0 -1
  461. package/dist/gateway/static/root/assets/settings-page-DYEbB1EV.js +0 -1
  462. package/dist/gateway/static/root/assets/setup-status-panel-dWN8BJ3z.js +0 -1
  463. package/dist/gateway/static/root/assets/share-preview-page-D8foINzP.js +0 -2
  464. package/dist/gateway/static/root/assets/shares-settings-Tgbv1s7G.js +0 -1
  465. package/dist/gateway/static/root/assets/skill-reload-api-D_YK0b_Z.js +0 -1
  466. package/dist/gateway/static/root/assets/skills-page-DGytfoZK.js +0 -2
  467. package/dist/gateway/static/root/assets/toast-z0toXu32.js +0 -1
  468. package/dist/gateway/static/root/assets/user-profile-settings-panel-8YtygcJp.js +0 -1
  469. package/dist/gateway/static/root/assets/voice-api-key-field-BVH71EFf.js +0 -1
  470. package/dist/gateway/static/root/assets/work-item-detail-page-JeTE7XNM.js +0 -1
  471. package/dist/gateway/static/root/assets/workflow-start-dialog-_u8Uc1ze.js +0 -1
  472. package/dist/gateway/static/root/assets/workflows-page-ixgk_y1l.js +0 -18
  473. package/dist/src/agent/workflow/builtins/audit-repo.d.ts +0 -13
  474. package/dist/src/agent/workflow/builtins/audit-repo.js +0 -183
  475. package/dist/src/agent/workflow/builtins/audit-repo.js.map +0 -1
  476. package/dist/src/agent/workflow/builtins/client-proposal.d.ts +0 -12
  477. package/dist/src/agent/workflow/builtins/client-proposal.js +0 -164
  478. package/dist/src/agent/workflow/builtins/client-proposal.js.map +0 -1
  479. package/dist/src/agent/workflow/builtins/competitor-scan.d.ts +0 -12
  480. package/dist/src/agent/workflow/builtins/competitor-scan.js +0 -164
  481. package/dist/src/agent/workflow/builtins/competitor-scan.js.map +0 -1
  482. package/dist/src/agent/workflow/builtins/content-draft.d.ts +0 -13
  483. package/dist/src/agent/workflow/builtins/content-draft.js +0 -159
  484. package/dist/src/agent/workflow/builtins/content-draft.js.map +0 -1
  485. package/dist/src/agent/workflow/builtins/content-repurpose.d.ts +0 -11
  486. package/dist/src/agent/workflow/builtins/content-repurpose.js +0 -146
  487. package/dist/src/agent/workflow/builtins/content-repurpose.js.map +0 -1
  488. package/dist/src/agent/workflow/builtins/debug-incident.d.ts +0 -13
  489. package/dist/src/agent/workflow/builtins/debug-incident.js +0 -177
  490. package/dist/src/agent/workflow/builtins/debug-incident.js.map +0 -1
  491. package/dist/src/agent/workflow/builtins/decision-compare.d.ts +0 -13
  492. package/dist/src/agent/workflow/builtins/decision-compare.js +0 -187
  493. package/dist/src/agent/workflow/builtins/decision-compare.js.map +0 -1
  494. package/dist/src/agent/workflow/builtins/implementation-plan.d.ts +0 -12
  495. package/dist/src/agent/workflow/builtins/implementation-plan.js +0 -185
  496. package/dist/src/agent/workflow/builtins/implementation-plan.js.map +0 -1
  497. package/dist/src/agent/workflow/builtins/inbox-triage.d.ts +0 -11
  498. package/dist/src/agent/workflow/builtins/inbox-triage.js +0 -158
  499. package/dist/src/agent/workflow/builtins/inbox-triage.js.map +0 -1
  500. package/dist/src/agent/workflow/builtins/meeting-prep.d.ts +0 -12
  501. package/dist/src/agent/workflow/builtins/meeting-prep.js +0 -152
  502. package/dist/src/agent/workflow/builtins/meeting-prep.js.map +0 -1
  503. package/dist/src/agent/workflow/builtins/multi-perspective-review.d.ts +0 -14
  504. package/dist/src/agent/workflow/builtins/multi-perspective-review.js +0 -171
  505. package/dist/src/agent/workflow/builtins/multi-perspective-review.js.map +0 -1
  506. package/dist/src/agent/workflow/builtins/offer-design.d.ts +0 -12
  507. package/dist/src/agent/workflow/builtins/offer-design.js +0 -170
  508. package/dist/src/agent/workflow/builtins/offer-design.js.map +0 -1
  509. package/dist/src/agent/workflow/builtins/pr-review.d.ts +0 -12
  510. package/dist/src/agent/workflow/builtins/pr-review.js +0 -178
  511. package/dist/src/agent/workflow/builtins/pr-review.js.map +0 -1
  512. package/dist/src/agent/workflow/builtins/release-check.d.ts +0 -11
  513. package/dist/src/agent/workflow/builtins/release-check.js +0 -174
  514. package/dist/src/agent/workflow/builtins/release-check.js.map +0 -1
  515. package/dist/src/agent/workflow/builtins/research.d.ts +0 -13
  516. package/dist/src/agent/workflow/builtins/research.js +0 -188
  517. package/dist/src/agent/workflow/builtins/research.js.map +0 -1
  518. package/dist/src/agent/workflow/builtins/weekly-review.d.ts +0 -12
  519. package/dist/src/agent/workflow/builtins/weekly-review.js +0 -139
  520. package/dist/src/agent/workflow/builtins/weekly-review.js.map +0 -1
  521. package/dist/src/agent/workflow/last-run-memory.d.ts +0 -42
  522. package/dist/src/agent/workflow/last-run-memory.js +0 -60
  523. package/dist/src/agent/workflow/last-run-memory.js.map +0 -1
  524. package/dist/src/agent/workflow/lint.d.ts +0 -38
  525. package/dist/src/agent/workflow/lint.js +0 -74
  526. package/dist/src/agent/workflow/lint.js.map +0 -1
  527. package/dist/src/agent/workflow/meta-locale.d.ts +0 -12
  528. package/dist/src/agent/workflow/meta-locale.js +0 -62
  529. package/dist/src/agent/workflow/meta-locale.js.map +0 -1
  530. package/dist/src/agent/workflow/parser.d.ts +0 -20
  531. package/dist/src/agent/workflow/parser.js +0 -152
  532. package/dist/src/agent/workflow/parser.js.map +0 -1
  533. package/dist/src/agent/workflow/runtime.d.ts +0 -34
  534. package/dist/src/agent/workflow/runtime.js +0 -402
  535. package/dist/src/agent/workflow/runtime.js.map +0 -1
  536. package/dist/src/connectors/oauth.d.ts +0 -22
  537. package/dist/src/connectors/oauth.js +0 -99
  538. package/dist/src/connectors/oauth.js.map +0 -1
  539. package/dist/src/workflows/runtime/script-runtime.d.ts +0 -3
  540. package/dist/src/workflows/runtime/script-runtime.js +0 -3
  541. package/dist/src/workflows/runtime/script-workflow-runtime.d.ts +0 -5
  542. package/dist/src/workflows/runtime/script-workflow-runtime.js +0 -15
  543. package/dist/src/workflows/runtime/script-workflow-runtime.js.map +0 -1
@@ -1,146 +0,0 @@
1
- //#region src/agent/workflow/builtins/content-repurpose.ts
2
- /**
3
- * Built-in workflow: `content_repurpose`
4
- *
5
- * Repurpose one source piece into multi-platform formats — threads, LinkedIn,
6
- * short video script, newsletter blurb. For personal-brand solopreneurs.
7
- *
8
- * Args:
9
- * - source: original article, notes, or talking points
10
- * - platforms: target platforms (optional)
11
- */
12
- const CONTENT_REPURPOSE_SCRIPT = `export const meta = {
13
- name: 'content_repurpose',
14
- description: 'Repurpose one source into platform-specific content (threads, posts, scripts, newsletter).',
15
- whenToUse: 'User has existing content and wants multi-platform distribution without rewriting from scratch.',
16
- examplePrompts: [
17
- { field: 'source', text: '2000-word blog post on building a one-person AI business' },
18
- { field: 'platforms', text: 'X thread, LinkedIn, 60s video script, newsletter teaser' },
19
- ],
20
- i18n: {
21
- zh: {
22
- description: '将一份核心内容改编为多平台格式(推文串、领英帖、短视频脚本、Newsletter 摘要)。',
23
- whenToUse: '用户已有内容素材,需要一源多用、多平台分发时。',
24
- examplePrompts: [
25
- { field: 'source', text: '一篇 2000 字关于一人 AI 公司的博客' },
26
- { field: 'platforms', text: 'X 推文串、LinkedIn、60 秒口播稿、Newsletter 导语' },
27
- ],
28
- },
29
- },
30
- tags: ['writing', 'content'],
31
- estimatedAgents: { min: 4, max: 6 },
32
- phases: [
33
- { title: 'Extract' },
34
- { title: 'Adapt' },
35
- { title: 'Package' },
36
- ],
37
- }
38
-
39
- const source = args && typeof args === 'object' && args.source
40
- ? String(args.source)
41
- : 'Infer the source content from the most recent user turn.'
42
-
43
- const platformsRaw = args && typeof args === 'object' && args.platforms
44
- ? String(args.platforms)
45
- : ''
46
-
47
- const DEFAULT_PLATFORMS = [
48
- { id: 'x_thread', label: 'X / Twitter thread', format: '5–8 tweets, hook-first, one idea per tweet' },
49
- { id: 'linkedin', label: 'LinkedIn post', format: 'Professional post, 150–250 words, clear CTA' },
50
- { id: 'short_video', label: 'Short video script', format: '60-second spoken script with hook and CTA' },
51
- { id: 'newsletter', label: 'Newsletter teaser', format: 'Subject line + 2–3 sentence teaser + bullet highlights' },
52
- ]
53
-
54
- phase('Extract')
55
- const extracted = await agent(
56
- 'Extract reusable content atoms from this source: core thesis, 3–5 key points, best quotes/stats, audience hook, and CTA.\\n\\nSOURCE:\\n' + source,
57
- {
58
- label: 'extract',
59
- schema: {
60
- type: 'object',
61
- properties: {
62
- thesis: { type: 'string' },
63
- keyPoints: { type: 'array', items: { type: 'string' } },
64
- hooks: { type: 'array', items: { type: 'string' } },
65
- quotesOrStats: { type: 'array', items: { type: 'string' } },
66
- cta: { type: 'string' },
67
- },
68
- required: ['thesis', 'keyPoints', 'cta'],
69
- },
70
- },
71
- )
72
-
73
- const targets = platformsRaw
74
- ? platformsRaw
75
- .split(/[,,\\n]/)
76
- .map((s) => s.trim())
77
- .filter(Boolean)
78
- .map((label, index) => ({
79
- id: 'custom_' + index,
80
- label,
81
- format: 'Native format and length for ' + label,
82
- }))
83
- : DEFAULT_PLATFORMS
84
-
85
- phase('Adapt')
86
- const adaptations = await parallel(
87
- targets.map((p) => () =>
88
- agent(
89
- 'Adapt the extracted content for this platform. Match native tone and length. Return ready-to-publish copy.\\n\\n' +
90
- 'PLATFORM: ' + p.label + '\\nFORMAT: ' + p.format + '\\n\\n' +
91
- JSON.stringify(extracted, null, 2),
92
- {
93
- label: p.label,
94
- schema: {
95
- type: 'object',
96
- properties: {
97
- platform: { type: 'string' },
98
- copy: { type: 'string' },
99
- notes: { type: 'string' },
100
- },
101
- required: ['platform', 'copy'],
102
- },
103
- },
104
- ),
105
- ),
106
- )
107
-
108
- phase('Package')
109
- const packaged = await agent(
110
- 'Package all platform adaptations with a publishing checklist: suggested order, cross-links between posts, and one optional bonus format (e.g. carousel outline).\\n\\n' +
111
- JSON.stringify({ extracted, adaptations: adaptations.filter(Boolean) }, null, 2),
112
- {
113
- label: 'package',
114
- schema: {
115
- type: 'object',
116
- properties: {
117
- publishingOrder: { type: 'array', items: { type: 'string' } },
118
- crossLinks: { type: 'array', items: { type: 'string' } },
119
- bonusFormat: { type: 'string' },
120
- summary: { type: 'string' },
121
- },
122
- required: ['publishingOrder', 'summary'],
123
- },
124
- },
125
- )
126
-
127
- const output = {
128
- ok: true,
129
- extracted,
130
- adaptations: adaptations.filter(Boolean),
131
- ...(packaged ?? { publishingOrder: [], summary: 'packaging failed' }),
132
- }
133
- return {
134
- summary: output.summary,
135
- sections: [
136
- { kind: 'questions', title: 'Publishing order', items: output.publishingOrder },
137
- { kind: 'questions', title: 'Cross-links', items: output.crossLinks ?? [] },
138
- { kind: 'json', title: 'Adaptations', value: output.adaptations },
139
- ],
140
- structuredOutput: output,
141
- }
142
- `;
143
- //#endregion
144
- export { CONTENT_REPURPOSE_SCRIPT };
145
-
146
- //# sourceMappingURL=content-repurpose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-repurpose.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/content-repurpose.ts"],"sourcesContent":["/**\n * Built-in workflow: `content_repurpose`\n *\n * Repurpose one source piece into multi-platform formats — threads, LinkedIn,\n * short video script, newsletter blurb. For personal-brand solopreneurs.\n *\n * Args:\n * - source: original article, notes, or talking points\n * - platforms: target platforms (optional)\n */\n\nexport const CONTENT_REPURPOSE_SCRIPT = `export const meta = {\n name: 'content_repurpose',\n description: 'Repurpose one source into platform-specific content (threads, posts, scripts, newsletter).',\n whenToUse: 'User has existing content and wants multi-platform distribution without rewriting from scratch.',\n examplePrompts: [\n { field: 'source', text: '2000-word blog post on building a one-person AI business' },\n { field: 'platforms', text: 'X thread, LinkedIn, 60s video script, newsletter teaser' },\n ],\n i18n: {\n zh: {\n description: '将一份核心内容改编为多平台格式(推文串、领英帖、短视频脚本、Newsletter 摘要)。',\n whenToUse: '用户已有内容素材,需要一源多用、多平台分发时。',\n examplePrompts: [\n { field: 'source', text: '一篇 2000 字关于一人 AI 公司的博客' },\n { field: 'platforms', text: 'X 推文串、LinkedIn、60 秒口播稿、Newsletter 导语' },\n ],\n },\n },\n tags: ['writing', 'content'],\n estimatedAgents: { min: 4, max: 6 },\n phases: [\n { title: 'Extract' },\n { title: 'Adapt' },\n { title: 'Package' },\n ],\n}\n\nconst source = args && typeof args === 'object' && args.source\n ? String(args.source)\n : 'Infer the source content from the most recent user turn.'\n\nconst platformsRaw = args && typeof args === 'object' && args.platforms\n ? String(args.platforms)\n : ''\n\nconst DEFAULT_PLATFORMS = [\n { id: 'x_thread', label: 'X / Twitter thread', format: '5–8 tweets, hook-first, one idea per tweet' },\n { id: 'linkedin', label: 'LinkedIn post', format: 'Professional post, 150–250 words, clear CTA' },\n { id: 'short_video', label: 'Short video script', format: '60-second spoken script with hook and CTA' },\n { id: 'newsletter', label: 'Newsletter teaser', format: 'Subject line + 2–3 sentence teaser + bullet highlights' },\n]\n\nphase('Extract')\nconst extracted = await agent(\n 'Extract reusable content atoms from this source: core thesis, 3–5 key points, best quotes/stats, audience hook, and CTA.\\\\n\\\\nSOURCE:\\\\n' + source,\n {\n label: 'extract',\n schema: {\n type: 'object',\n properties: {\n thesis: { type: 'string' },\n keyPoints: { type: 'array', items: { type: 'string' } },\n hooks: { type: 'array', items: { type: 'string' } },\n quotesOrStats: { type: 'array', items: { type: 'string' } },\n cta: { type: 'string' },\n },\n required: ['thesis', 'keyPoints', 'cta'],\n },\n },\n)\n\nconst targets = platformsRaw\n ? platformsRaw\n .split(/[,,\\\\n]/)\n .map((s) => s.trim())\n .filter(Boolean)\n .map((label, index) => ({\n id: 'custom_' + index,\n label,\n format: 'Native format and length for ' + label,\n }))\n : DEFAULT_PLATFORMS\n\nphase('Adapt')\nconst adaptations = await parallel(\n targets.map((p) => () =>\n agent(\n 'Adapt the extracted content for this platform. Match native tone and length. Return ready-to-publish copy.\\\\n\\\\n' +\n 'PLATFORM: ' + p.label + '\\\\nFORMAT: ' + p.format + '\\\\n\\\\n' +\n JSON.stringify(extracted, null, 2),\n {\n label: p.label,\n schema: {\n type: 'object',\n properties: {\n platform: { type: 'string' },\n copy: { type: 'string' },\n notes: { type: 'string' },\n },\n required: ['platform', 'copy'],\n },\n },\n ),\n ),\n)\n\nphase('Package')\nconst packaged = await agent(\n 'Package all platform adaptations with a publishing checklist: suggested order, cross-links between posts, and one optional bonus format (e.g. carousel outline).\\\\n\\\\n' +\n JSON.stringify({ extracted, adaptations: adaptations.filter(Boolean) }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n publishingOrder: { type: 'array', items: { type: 'string' } },\n crossLinks: { type: 'array', items: { type: 'string' } },\n bonusFormat: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['publishingOrder', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n extracted,\n adaptations: adaptations.filter(Boolean),\n ...(packaged ?? { publishingOrder: [], summary: 'packaging failed' }),\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'questions', title: 'Publishing order', items: output.publishingOrder },\n { kind: 'questions', title: 'Cross-links', items: output.crossLinks ?? [] },\n { kind: 'json', title: 'Adaptations', value: output.adaptations },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,2BAA2B"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Built-in workflow: `debug_incident`
3
- *
4
- * Triage an error, stack trace, or log snippet. Parses the signal, fans out
5
- * parallel hypotheses (config, race, dependency, data, environment), then
6
- * ranks likely root causes with verification steps.
7
- *
8
- * Args:
9
- * - error: error message or stack trace
10
- * - logs: optional log excerpt
11
- * - context: optional extra context (what changed, when it started)
12
- */
13
- export declare const DEBUG_INCIDENT_SCRIPT = "export const meta = {\n name: 'debug_incident',\n description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',\n whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',\n examplePrompts: [\n { field: 'error', text: 'Triage this stack trace from production' },\n { field: 'error', text: 'Why does the gateway return 502 after deploy?' },\n ],\n i18n: {\n zh: {\n description: '\u5BF9\u9519\u8BEF\u6216\u65E5\u5FD7\u7247\u6BB5\u505A\u5E76\u884C\u5047\u8BBE\u63A8\u6F14\uFF0C\u5E76\u6392\u5E8F\u6839\u56E0\u4E0E\u9A8C\u8BC1\u6B65\u9AA4\u3002',\n whenToUse: '\u7528\u6237\u62A5\u544A bug\u3001\u5D29\u6E83\u3001\u62A5\u9519\u6216\u5F02\u5E38\u884C\u4E3A\uFF0C\u9700\u8981\u7CFB\u7EDF\u5316\u6392\u67E5\u65F6\u3002',\n examplePrompts: [\n { field: 'error', text: '\u6392\u67E5\u751F\u4EA7\u73AF\u5883\u8FD9\u6761\u5806\u6808' },\n { field: 'error', text: '\u90E8\u7F72\u540E\u7F51\u5173\u8FD4\u56DE 502\uFF0C\u53EF\u80FD\u662F\u4EC0\u4E48\u539F\u56E0\uFF1F' },\n ],\n },\n },\n tags: ['debug', 'incident', 'troubleshooting'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Triage' },\n { title: 'Hypotheses' },\n { title: 'Rank' },\n ],\n}\n\nconst READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'exec_command']\n\nconst error = args && typeof args === 'object' && args.error\n ? String(args.error)\n : 'Infer the primary error from the most recent user message or conversation context.'\n\nconst logs = args && typeof args === 'object' && args.logs\n ? String(args.logs)\n : ''\n\nconst context = args && typeof args === 'object' && args.context\n ? String(args.context)\n : ''\n\nphase('Triage')\nconst triage = await agent(\n 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2\u20133 key facts from logs.\\n\\n' +\n 'ERROR:\\n' + error + '\\n\\n' +\n (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +\n (context ? 'CONTEXT:\\n' + context + '\\n\\n' : '') +\n 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',\n {\n label: 'incident triage',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n errorType: { type: 'string' },\n subsystem: { type: 'string' },\n affectedPaths: { type: 'array', items: { type: 'string' } },\n keyFacts: { type: 'array', items: { type: 'string' } },\n },\n required: ['errorType', 'keyFacts'],\n },\n },\n)\n\nconst HYPOTHESES = [\n { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },\n { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },\n { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },\n { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },\n { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },\n]\n\nphase('Hypotheses')\nconst hypothesisReports = await parallel(\n HYPOTHESES.map((h) => () =>\n agent(\n 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\n\\n' +\n 'HYPOTHESIS: ' + h.key + ' \u2014 ' + h.angle + '\\n\\n' +\n 'TRIAGE:\\n' + JSON.stringify(triage, null, 2) + '\\n\\n' +\n 'ERROR:\\n' + error + '\\n\\n' +\n (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +\n 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',\n {\n label: h.key + ' hypothesis',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n evidence: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n note: { type: 'string' },\n },\n required: ['path', 'note'],\n },\n },\n verificationStep: { type: 'string' },\n },\n required: ['likelihood', 'evidence', 'verificationStep'],\n },\n },\n ),\n ),\n)\n\nphase('Rank')\nconst live = hypothesisReports.filter(Boolean)\nconst byHypothesis = {}\nfor (let i = 0; i < HYPOTHESES.length; i++) {\n byHypothesis[HYPOTHESES[i].key] = live[i] ?? null\n}\n\nconst ranking = await agent(\n 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\n\\n' +\n JSON.stringify({ triage, byHypothesis }, null, 2),\n {\n label: 'root cause ranking',\n schema: {\n type: 'object',\n properties: {\n topCauses: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n hypothesis: { type: 'string' },\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n summary: { type: 'string' },\n nextStep: { type: 'string' },\n },\n required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],\n },\n },\n immediateActions: { type: 'array', items: { type: 'string' } },\n summary: { type: 'string' },\n },\n required: ['topCauses', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n triage,\n ...(ranking ?? { topCauses: [], summary: 'ranking failed', immediateActions: [] }),\n byHypothesis,\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'risks', title: 'Top causes', items: output.topCauses.map((item) => ({ title: item.hypothesis, severity: item.likelihood, detail: item.summary, mitigation: item.nextStep })) },\n { kind: 'questions', title: 'Immediate actions', items: output.immediateActions ?? [] },\n ],\n structuredOutput: output,\n}\n";
@@ -1,177 +0,0 @@
1
- //#region src/agent/workflow/builtins/debug-incident.ts
2
- /**
3
- * Built-in workflow: `debug_incident`
4
- *
5
- * Triage an error, stack trace, or log snippet. Parses the signal, fans out
6
- * parallel hypotheses (config, race, dependency, data, environment), then
7
- * ranks likely root causes with verification steps.
8
- *
9
- * Args:
10
- * - error: error message or stack trace
11
- * - logs: optional log excerpt
12
- * - context: optional extra context (what changed, when it started)
13
- */
14
- const DEBUG_INCIDENT_SCRIPT = `export const meta = {
15
- name: 'debug_incident',
16
- description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',
17
- whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',
18
- examplePrompts: [
19
- { field: 'error', text: 'Triage this stack trace from production' },
20
- { field: 'error', text: 'Why does the gateway return 502 after deploy?' },
21
- ],
22
- i18n: {
23
- zh: {
24
- description: '对错误或日志片段做并行假设推演,并排序根因与验证步骤。',
25
- whenToUse: '用户报告 bug、崩溃、报错或异常行为,需要系统化排查时。',
26
- examplePrompts: [
27
- { field: 'error', text: '排查生产环境这条堆栈' },
28
- { field: 'error', text: '部署后网关返回 502,可能是什么原因?' },
29
- ],
30
- },
31
- },
32
- tags: ['debug', 'incident', 'troubleshooting'],
33
- estimatedAgents: { min: 7, max: 7 },
34
- phases: [
35
- { title: 'Triage' },
36
- { title: 'Hypotheses' },
37
- { title: 'Rank' },
38
- ],
39
- }
40
-
41
- const READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'exec_command']
42
-
43
- const error = args && typeof args === 'object' && args.error
44
- ? String(args.error)
45
- : 'Infer the primary error from the most recent user message or conversation context.'
46
-
47
- const logs = args && typeof args === 'object' && args.logs
48
- ? String(args.logs)
49
- : ''
50
-
51
- const context = args && typeof args === 'object' && args.context
52
- ? String(args.context)
53
- : ''
54
-
55
- phase('Triage')
56
- const triage = await agent(
57
- 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2–3 key facts from logs.\\n\\n' +
58
- 'ERROR:\\n' + error + '\\n\\n' +
59
- (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +
60
- (context ? 'CONTEXT:\\n' + context + '\\n\\n' : '') +
61
- 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',
62
- {
63
- label: 'incident triage',
64
- toolset: READ_TOOLS,
65
- schema: {
66
- type: 'object',
67
- properties: {
68
- errorType: { type: 'string' },
69
- subsystem: { type: 'string' },
70
- affectedPaths: { type: 'array', items: { type: 'string' } },
71
- keyFacts: { type: 'array', items: { type: 'string' } },
72
- },
73
- required: ['errorType', 'keyFacts'],
74
- },
75
- },
76
- )
77
-
78
- const HYPOTHESES = [
79
- { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },
80
- { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },
81
- { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },
82
- { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },
83
- { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },
84
- ]
85
-
86
- phase('Hypotheses')
87
- const hypothesisReports = await parallel(
88
- HYPOTHESES.map((h) => () =>
89
- agent(
90
- 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\n\\n' +
91
- 'HYPOTHESIS: ' + h.key + ' — ' + h.angle + '\\n\\n' +
92
- 'TRIAGE:\\n' + JSON.stringify(triage, null, 2) + '\\n\\n' +
93
- 'ERROR:\\n' + error + '\\n\\n' +
94
- (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +
95
- 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',
96
- {
97
- label: h.key + ' hypothesis',
98
- toolset: READ_TOOLS,
99
- schema: {
100
- type: 'object',
101
- properties: {
102
- likelihood: { type: 'string', enum: ['low', 'med', 'high'] },
103
- evidence: {
104
- type: 'array',
105
- items: {
106
- type: 'object',
107
- properties: {
108
- path: { type: 'string' },
109
- note: { type: 'string' },
110
- },
111
- required: ['path', 'note'],
112
- },
113
- },
114
- verificationStep: { type: 'string' },
115
- },
116
- required: ['likelihood', 'evidence', 'verificationStep'],
117
- },
118
- },
119
- ),
120
- ),
121
- )
122
-
123
- phase('Rank')
124
- const live = hypothesisReports.filter(Boolean)
125
- const byHypothesis = {}
126
- for (let i = 0; i < HYPOTHESES.length; i++) {
127
- byHypothesis[HYPOTHESES[i].key] = live[i] ?? null
128
- }
129
-
130
- const ranking = await agent(
131
- 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\n\\n' +
132
- JSON.stringify({ triage, byHypothesis }, null, 2),
133
- {
134
- label: 'root cause ranking',
135
- schema: {
136
- type: 'object',
137
- properties: {
138
- topCauses: {
139
- type: 'array',
140
- items: {
141
- type: 'object',
142
- properties: {
143
- hypothesis: { type: 'string' },
144
- likelihood: { type: 'string', enum: ['low', 'med', 'high'] },
145
- summary: { type: 'string' },
146
- nextStep: { type: 'string' },
147
- },
148
- required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],
149
- },
150
- },
151
- immediateActions: { type: 'array', items: { type: 'string' } },
152
- summary: { type: 'string' },
153
- },
154
- required: ['topCauses', 'summary'],
155
- },
156
- },
157
- )
158
-
159
- const output = {
160
- ok: true,
161
- triage,
162
- ...(ranking ?? { topCauses: [], summary: 'ranking failed', immediateActions: [] }),
163
- byHypothesis,
164
- }
165
- return {
166
- summary: output.summary,
167
- sections: [
168
- { kind: 'risks', title: 'Top causes', items: output.topCauses.map((item) => ({ title: item.hypothesis, severity: item.likelihood, detail: item.summary, mitigation: item.nextStep })) },
169
- { kind: 'questions', title: 'Immediate actions', items: output.immediateActions ?? [] },
170
- ],
171
- structuredOutput: output,
172
- }
173
- `;
174
- //#endregion
175
- export { DEBUG_INCIDENT_SCRIPT };
176
-
177
- //# sourceMappingURL=debug-incident.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-incident.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/debug-incident.ts"],"sourcesContent":["/**\n * Built-in workflow: `debug_incident`\n *\n * Triage an error, stack trace, or log snippet. Parses the signal, fans out\n * parallel hypotheses (config, race, dependency, data, environment), then\n * ranks likely root causes with verification steps.\n *\n * Args:\n * - error: error message or stack trace\n * - logs: optional log excerpt\n * - context: optional extra context (what changed, when it started)\n */\n\nexport const DEBUG_INCIDENT_SCRIPT = `export const meta = {\n name: 'debug_incident',\n description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',\n whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',\n examplePrompts: [\n { field: 'error', text: 'Triage this stack trace from production' },\n { field: 'error', text: 'Why does the gateway return 502 after deploy?' },\n ],\n i18n: {\n zh: {\n description: '对错误或日志片段做并行假设推演,并排序根因与验证步骤。',\n whenToUse: '用户报告 bug、崩溃、报错或异常行为,需要系统化排查时。',\n examplePrompts: [\n { field: 'error', text: '排查生产环境这条堆栈' },\n { field: 'error', text: '部署后网关返回 502,可能是什么原因?' },\n ],\n },\n },\n tags: ['debug', 'incident', 'troubleshooting'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Triage' },\n { title: 'Hypotheses' },\n { title: 'Rank' },\n ],\n}\n\nconst READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'exec_command']\n\nconst error = args && typeof args === 'object' && args.error\n ? String(args.error)\n : 'Infer the primary error from the most recent user message or conversation context.'\n\nconst logs = args && typeof args === 'object' && args.logs\n ? String(args.logs)\n : ''\n\nconst context = args && typeof args === 'object' && args.context\n ? String(args.context)\n : ''\n\nphase('Triage')\nconst triage = await agent(\n 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2–3 key facts from logs.\\\\n\\\\n' +\n 'ERROR:\\\\n' + error + '\\\\n\\\\n' +\n (logs ? 'LOGS:\\\\n' + logs + '\\\\n\\\\n' : '') +\n (context ? 'CONTEXT:\\\\n' + context + '\\\\n\\\\n' : '') +\n 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',\n {\n label: 'incident triage',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n errorType: { type: 'string' },\n subsystem: { type: 'string' },\n affectedPaths: { type: 'array', items: { type: 'string' } },\n keyFacts: { type: 'array', items: { type: 'string' } },\n },\n required: ['errorType', 'keyFacts'],\n },\n },\n)\n\nconst HYPOTHESES = [\n { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },\n { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },\n { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },\n { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },\n { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },\n]\n\nphase('Hypotheses')\nconst hypothesisReports = await parallel(\n HYPOTHESES.map((h) => () =>\n agent(\n 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\\\n\\\\n' +\n 'HYPOTHESIS: ' + h.key + ' — ' + h.angle + '\\\\n\\\\n' +\n 'TRIAGE:\\\\n' + JSON.stringify(triage, null, 2) + '\\\\n\\\\n' +\n 'ERROR:\\\\n' + error + '\\\\n\\\\n' +\n (logs ? 'LOGS:\\\\n' + logs + '\\\\n\\\\n' : '') +\n 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',\n {\n label: h.key + ' hypothesis',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n evidence: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n note: { type: 'string' },\n },\n required: ['path', 'note'],\n },\n },\n verificationStep: { type: 'string' },\n },\n required: ['likelihood', 'evidence', 'verificationStep'],\n },\n },\n ),\n ),\n)\n\nphase('Rank')\nconst live = hypothesisReports.filter(Boolean)\nconst byHypothesis = {}\nfor (let i = 0; i < HYPOTHESES.length; i++) {\n byHypothesis[HYPOTHESES[i].key] = live[i] ?? null\n}\n\nconst ranking = await agent(\n 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\\\n\\\\n' +\n JSON.stringify({ triage, byHypothesis }, null, 2),\n {\n label: 'root cause ranking',\n schema: {\n type: 'object',\n properties: {\n topCauses: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n hypothesis: { type: 'string' },\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n summary: { type: 'string' },\n nextStep: { type: 'string' },\n },\n required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],\n },\n },\n immediateActions: { type: 'array', items: { type: 'string' } },\n summary: { type: 'string' },\n },\n required: ['topCauses', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n triage,\n ...(ranking ?? { topCauses: [], summary: 'ranking failed', immediateActions: [] }),\n byHypothesis,\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'risks', title: 'Top causes', items: output.topCauses.map((item) => ({ title: item.hypothesis, severity: item.likelihood, detail: item.summary, mitigation: item.nextStep })) },\n { kind: 'questions', title: 'Immediate actions', items: output.immediateActions ?? [] },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,wBAAwB"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Built-in workflow: `decision_compare`
3
- *
4
- * Structured comparison of options for everyday decisions — vendors, approaches,
5
- * purchases, policies, or life choices. Independent evaluators score each option,
6
- * then a synthesizer recommends with trade-offs spelled out.
7
- *
8
- * Args:
9
- * - question: the decision to make
10
- * - options: optional comma-separated or newline-separated option list
11
- * - criteria: optional evaluation criteria hint
12
- */
13
- export declare const DECISION_COMPARE_SCRIPT = "export const meta = {\n name: 'decision_compare',\n description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',\n whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',\n examplePrompts: [\n { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },\n { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },\n ],\n i18n: {\n zh: {\n description: '\u7531\u591A\u4E2A\u72EC\u7ACB\u8BC4\u5BA1\u7EF4\u5EA6\u5BF9\u6BD4\u9009\u9879\uFF0C\u5E76\u7ED9\u51FA\u542B\u6743\u8861\u7684\u63A8\u8350\u7ED3\u8BBA\u3002',\n whenToUse: '\u7528\u6237\u9762\u4E34\u591A\u4E2A\u53EF\u884C\u65B9\u6848\u7684\u975E\u4EE3\u7801\u51B3\u7B56\uFF0C\u9700\u8981\u7ED3\u6784\u5316\u5BF9\u6BD4\u65F6\u3002',\n examplePrompts: [\n { field: 'question', text: '5 \u4EBA\u8FDC\u7A0B\u56E2\u961F\u9002\u5408\u7528\u54EA\u6B3E\u9879\u76EE\u7BA1\u7406\u5DE5\u5177\uFF1F' },\n { field: 'question', text: '\u6D3B\u52A8\u5E94\u8BE5\u7EBF\u4E0B\u3001\u6DF7\u5408\u8FD8\u662F\u7EAF\u7EBF\u4E0A\u4E3E\u529E\uFF1F' },\n ],\n },\n },\n tags: ['decision-making', 'comparison', 'productivity'],\n estimatedAgents: { min: 4, max: 7 },\n phases: [\n { title: 'Frame' },\n { title: 'Evaluate' },\n { title: 'Recommend' },\n ],\n}\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'Infer the decision question from the most recent user turn.'\n\nconst optionsRaw = args && typeof args === 'object' && args.options\n ? String(args.options)\n : ''\n\nconst criteriaHint = args && typeof args === 'object' && args.criteria\n ? String(args.criteria)\n : ''\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this decision. If options are not provided, propose 3\u20134 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n' +\n (optionsRaw ? 'OPTIONS:\\n' + optionsRaw + '\\n' : '') +\n (criteriaHint ? 'CRITERIA HINT:\\n' + criteriaHint + '\\n' : ''),\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n options: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['name', 'summary'],\n },\n },\n criteria: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n weight: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['name'],\n },\n },\n assumptions: { type: 'array', items: { type: 'string' } },\n },\n required: ['options', 'criteria'],\n },\n },\n)\n\nif (!frame || !frame.options?.length) {\n const output = { ok: false, reason: 'framing failed', question }\n return {\n summary: output.reason,\n sections: [{ kind: 'json', title: 'Decision framing', value: output }],\n structuredOutput: output,\n }\n}\n\nconst options = frame.options.slice(0, 4)\nconst criteria = frame.criteria ?? []\n\nconst LENSES = [\n { name: 'Benefits', focus: 'Upside, value delivered, and who wins.' },\n { name: 'Risks', focus: 'Downside, failure modes, hidden costs, and regrets.' },\n { name: 'Fit', focus: 'Fit for stated constraints, audience, timeline, and resources.' },\n]\n\nphase('Evaluate')\nconst evaluations = await parallel(\n LENSES.map((lens) => () =>\n agent(\n 'Evaluate every option through this lens. Be specific \u2014 avoid generic pros/cons. Score each option low/med/high for this lens with a one-line rationale.\\n\\n' +\n 'LENS: ' + lens.name + ' \u2014 ' + lens.focus + '\\n' +\n 'QUESTION: ' + question + '\\n' +\n 'OPTIONS:\\n' + JSON.stringify(options, null, 2) + '\\n' +\n 'CRITERIA:\\n' + JSON.stringify(criteria, null, 2),\n {\n label: lens.name,\n schema: {\n type: 'object',\n properties: {\n lens: { type: 'string' },\n scores: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n option: { type: 'string' },\n score: { type: 'string', enum: ['low', 'med', 'high'] },\n rationale: { type: 'string' },\n },\n required: ['option', 'score', 'rationale'],\n },\n },\n },\n required: ['lens', 'scores'],\n },\n },\n ),\n ),\n)\n\nphase('Recommend')\nconst live = evaluations.filter(Boolean)\nconst recommendation = await agent(\n 'Recommend the best option (or a hybrid) from these lens-level evaluations. State trade-offs explicitly, note what would change the recommendation, and give a runner-up.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n\\n' +\n JSON.stringify({ frame, evaluations: live }, null, 2),\n {\n label: 'recommendation',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string' },\n rationale: { type: 'string' },\n tradeoffs: { type: 'array', items: { type: 'string' } },\n runnerUp: { type: 'string' },\n whatWouldChange: { type: 'array', items: { type: 'string' } },\n },\n required: ['recommendation', 'rationale', 'tradeoffs'],\n },\n },\n)\n\nconst output = {\n ok: true,\n question,\n optionCount: options.length,\n ...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),\n}\nreturn {\n summary: output.recommendation,\n sections: [\n { kind: 'text', title: 'Rationale', content: output.rationale },\n { kind: 'questions', title: 'Trade-offs', items: output.tradeoffs },\n { kind: 'questions', title: 'What would change the recommendation', items: output.whatWouldChange ?? [] },\n ],\n structuredOutput: output,\n}\n";
@@ -1,187 +0,0 @@
1
- //#region src/agent/workflow/builtins/decision-compare.ts
2
- /**
3
- * Built-in workflow: `decision_compare`
4
- *
5
- * Structured comparison of options for everyday decisions — vendors, approaches,
6
- * purchases, policies, or life choices. Independent evaluators score each option,
7
- * then a synthesizer recommends with trade-offs spelled out.
8
- *
9
- * Args:
10
- * - question: the decision to make
11
- * - options: optional comma-separated or newline-separated option list
12
- * - criteria: optional evaluation criteria hint
13
- */
14
- const DECISION_COMPARE_SCRIPT = `export const meta = {
15
- name: 'decision_compare',
16
- description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',
17
- whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',
18
- examplePrompts: [
19
- { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },
20
- { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },
21
- ],
22
- i18n: {
23
- zh: {
24
- description: '由多个独立评审维度对比选项,并给出含权衡的推荐结论。',
25
- whenToUse: '用户面临多个可行方案的非代码决策,需要结构化对比时。',
26
- examplePrompts: [
27
- { field: 'question', text: '5 人远程团队适合用哪款项目管理工具?' },
28
- { field: 'question', text: '活动应该线下、混合还是纯线上举办?' },
29
- ],
30
- },
31
- },
32
- tags: ['decision-making', 'comparison', 'productivity'],
33
- estimatedAgents: { min: 4, max: 7 },
34
- phases: [
35
- { title: 'Frame' },
36
- { title: 'Evaluate' },
37
- { title: 'Recommend' },
38
- ],
39
- }
40
-
41
- const question = args && typeof args === 'object' && args.question
42
- ? String(args.question)
43
- : 'Infer the decision question from the most recent user turn.'
44
-
45
- const optionsRaw = args && typeof args === 'object' && args.options
46
- ? String(args.options)
47
- : ''
48
-
49
- const criteriaHint = args && typeof args === 'object' && args.criteria
50
- ? String(args.criteria)
51
- : ''
52
-
53
- phase('Frame')
54
- const frame = await agent(
55
- 'Frame this decision. If options are not provided, propose 3–4 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\n\\n' +
56
- 'QUESTION:\\n' + question + '\\n' +
57
- (optionsRaw ? 'OPTIONS:\\n' + optionsRaw + '\\n' : '') +
58
- (criteriaHint ? 'CRITERIA HINT:\\n' + criteriaHint + '\\n' : ''),
59
- {
60
- label: 'framing',
61
- schema: {
62
- type: 'object',
63
- properties: {
64
- options: {
65
- type: 'array',
66
- items: {
67
- type: 'object',
68
- properties: {
69
- name: { type: 'string' },
70
- summary: { type: 'string' },
71
- },
72
- required: ['name', 'summary'],
73
- },
74
- },
75
- criteria: {
76
- type: 'array',
77
- items: {
78
- type: 'object',
79
- properties: {
80
- name: { type: 'string' },
81
- weight: { type: 'string', enum: ['low', 'med', 'high'] },
82
- },
83
- required: ['name'],
84
- },
85
- },
86
- assumptions: { type: 'array', items: { type: 'string' } },
87
- },
88
- required: ['options', 'criteria'],
89
- },
90
- },
91
- )
92
-
93
- if (!frame || !frame.options?.length) {
94
- const output = { ok: false, reason: 'framing failed', question }
95
- return {
96
- summary: output.reason,
97
- sections: [{ kind: 'json', title: 'Decision framing', value: output }],
98
- structuredOutput: output,
99
- }
100
- }
101
-
102
- const options = frame.options.slice(0, 4)
103
- const criteria = frame.criteria ?? []
104
-
105
- const LENSES = [
106
- { name: 'Benefits', focus: 'Upside, value delivered, and who wins.' },
107
- { name: 'Risks', focus: 'Downside, failure modes, hidden costs, and regrets.' },
108
- { name: 'Fit', focus: 'Fit for stated constraints, audience, timeline, and resources.' },
109
- ]
110
-
111
- phase('Evaluate')
112
- const evaluations = await parallel(
113
- LENSES.map((lens) => () =>
114
- agent(
115
- 'Evaluate every option through this lens. Be specific — avoid generic pros/cons. Score each option low/med/high for this lens with a one-line rationale.\\n\\n' +
116
- 'LENS: ' + lens.name + ' — ' + lens.focus + '\\n' +
117
- 'QUESTION: ' + question + '\\n' +
118
- 'OPTIONS:\\n' + JSON.stringify(options, null, 2) + '\\n' +
119
- 'CRITERIA:\\n' + JSON.stringify(criteria, null, 2),
120
- {
121
- label: lens.name,
122
- schema: {
123
- type: 'object',
124
- properties: {
125
- lens: { type: 'string' },
126
- scores: {
127
- type: 'array',
128
- items: {
129
- type: 'object',
130
- properties: {
131
- option: { type: 'string' },
132
- score: { type: 'string', enum: ['low', 'med', 'high'] },
133
- rationale: { type: 'string' },
134
- },
135
- required: ['option', 'score', 'rationale'],
136
- },
137
- },
138
- },
139
- required: ['lens', 'scores'],
140
- },
141
- },
142
- ),
143
- ),
144
- )
145
-
146
- phase('Recommend')
147
- const live = evaluations.filter(Boolean)
148
- const recommendation = await agent(
149
- 'Recommend the best option (or a hybrid) from these lens-level evaluations. State trade-offs explicitly, note what would change the recommendation, and give a runner-up.\\n\\n' +
150
- 'QUESTION:\\n' + question + '\\n\\n' +
151
- JSON.stringify({ frame, evaluations: live }, null, 2),
152
- {
153
- label: 'recommendation',
154
- schema: {
155
- type: 'object',
156
- properties: {
157
- recommendation: { type: 'string' },
158
- rationale: { type: 'string' },
159
- tradeoffs: { type: 'array', items: { type: 'string' } },
160
- runnerUp: { type: 'string' },
161
- whatWouldChange: { type: 'array', items: { type: 'string' } },
162
- },
163
- required: ['recommendation', 'rationale', 'tradeoffs'],
164
- },
165
- },
166
- )
167
-
168
- const output = {
169
- ok: true,
170
- question,
171
- optionCount: options.length,
172
- ...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),
173
- }
174
- return {
175
- summary: output.recommendation,
176
- sections: [
177
- { kind: 'text', title: 'Rationale', content: output.rationale },
178
- { kind: 'questions', title: 'Trade-offs', items: output.tradeoffs },
179
- { kind: 'questions', title: 'What would change the recommendation', items: output.whatWouldChange ?? [] },
180
- ],
181
- structuredOutput: output,
182
- }
183
- `;
184
- //#endregion
185
- export { DECISION_COMPARE_SCRIPT };
186
-
187
- //# sourceMappingURL=decision-compare.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decision-compare.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/decision-compare.ts"],"sourcesContent":["/**\n * Built-in workflow: `decision_compare`\n *\n * Structured comparison of options for everyday decisions — vendors, approaches,\n * purchases, policies, or life choices. Independent evaluators score each option,\n * then a synthesizer recommends with trade-offs spelled out.\n *\n * Args:\n * - question: the decision to make\n * - options: optional comma-separated or newline-separated option list\n * - criteria: optional evaluation criteria hint\n */\n\nexport const DECISION_COMPARE_SCRIPT = `export const meta = {\n name: 'decision_compare',\n description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',\n whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',\n examplePrompts: [\n { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },\n { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },\n ],\n i18n: {\n zh: {\n description: '由多个独立评审维度对比选项,并给出含权衡的推荐结论。',\n whenToUse: '用户面临多个可行方案的非代码决策,需要结构化对比时。',\n examplePrompts: [\n { field: 'question', text: '5 人远程团队适合用哪款项目管理工具?' },\n { field: 'question', text: '活动应该线下、混合还是纯线上举办?' },\n ],\n },\n },\n tags: ['decision-making', 'comparison', 'productivity'],\n estimatedAgents: { min: 4, max: 7 },\n phases: [\n { title: 'Frame' },\n { title: 'Evaluate' },\n { title: 'Recommend' },\n ],\n}\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'Infer the decision question from the most recent user turn.'\n\nconst optionsRaw = args && typeof args === 'object' && args.options\n ? String(args.options)\n : ''\n\nconst criteriaHint = args && typeof args === 'object' && args.criteria\n ? String(args.criteria)\n : ''\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this decision. If options are not provided, propose 3–4 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n' +\n (optionsRaw ? 'OPTIONS:\\\\n' + optionsRaw + '\\\\n' : '') +\n (criteriaHint ? 'CRITERIA HINT:\\\\n' + criteriaHint + '\\\\n' : ''),\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n options: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['name', 'summary'],\n },\n },\n criteria: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n weight: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['name'],\n },\n },\n assumptions: { type: 'array', items: { type: 'string' } },\n },\n required: ['options', 'criteria'],\n },\n },\n)\n\nif (!frame || !frame.options?.length) {\n const output = { ok: false, reason: 'framing failed', question }\n return {\n summary: output.reason,\n sections: [{ kind: 'json', title: 'Decision framing', value: output }],\n structuredOutput: output,\n }\n}\n\nconst options = frame.options.slice(0, 4)\nconst criteria = frame.criteria ?? []\n\nconst LENSES = [\n { name: 'Benefits', focus: 'Upside, value delivered, and who wins.' },\n { name: 'Risks', focus: 'Downside, failure modes, hidden costs, and regrets.' },\n { name: 'Fit', focus: 'Fit for stated constraints, audience, timeline, and resources.' },\n]\n\nphase('Evaluate')\nconst evaluations = await parallel(\n LENSES.map((lens) => () =>\n agent(\n 'Evaluate every option through this lens. Be specific — avoid generic pros/cons. Score each option low/med/high for this lens with a one-line rationale.\\\\n\\\\n' +\n 'LENS: ' + lens.name + ' — ' + lens.focus + '\\\\n' +\n 'QUESTION: ' + question + '\\\\n' +\n 'OPTIONS:\\\\n' + JSON.stringify(options, null, 2) + '\\\\n' +\n 'CRITERIA:\\\\n' + JSON.stringify(criteria, null, 2),\n {\n label: lens.name,\n schema: {\n type: 'object',\n properties: {\n lens: { type: 'string' },\n scores: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n option: { type: 'string' },\n score: { type: 'string', enum: ['low', 'med', 'high'] },\n rationale: { type: 'string' },\n },\n required: ['option', 'score', 'rationale'],\n },\n },\n },\n required: ['lens', 'scores'],\n },\n },\n ),\n ),\n)\n\nphase('Recommend')\nconst live = evaluations.filter(Boolean)\nconst recommendation = await agent(\n 'Recommend the best option (or a hybrid) from these lens-level evaluations. State trade-offs explicitly, note what would change the recommendation, and give a runner-up.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n\\\\n' +\n JSON.stringify({ frame, evaluations: live }, null, 2),\n {\n label: 'recommendation',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string' },\n rationale: { type: 'string' },\n tradeoffs: { type: 'array', items: { type: 'string' } },\n runnerUp: { type: 'string' },\n whatWouldChange: { type: 'array', items: { type: 'string' } },\n },\n required: ['recommendation', 'rationale', 'tradeoffs'],\n },\n },\n)\n\nconst output = {\n ok: true,\n question,\n optionCount: options.length,\n ...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),\n}\nreturn {\n summary: output.recommendation,\n sections: [\n { kind: 'text', title: 'Rationale', content: output.rationale },\n { kind: 'questions', title: 'Trade-offs', items: output.tradeoffs },\n { kind: 'questions', title: 'What would change the recommendation', items: output.whatWouldChange ?? [] },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,0BAA0B"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Built-in workflow: `implementation_plan`
3
- *
4
- * Turns a feature or refactor request into an actionable implementation plan.
5
- * It first frames the goal, then explores relevant code areas in parallel, and
6
- * finally synthesizes phased tasks with risks and validation steps.
7
- *
8
- * Args:
9
- * - request: feature, bugfix, or refactor request
10
- * - scope: optional repo path or subsystem hint
11
- */
12
- export declare const IMPLEMENTATION_PLAN_SCRIPT = "export const meta = {\n name: 'implementation_plan',\n description: 'Create an actionable implementation plan from a feature, refactor, or bugfix request.',\n whenToUse: 'User wants a technical plan before coding, especially for multi-file or unfamiliar code changes.',\n examplePrompts: [\n { field: 'request', text: 'Plan a refactor of the session store' },\n { field: 'request', text: 'Design implementation steps for OAuth login' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u529F\u80FD\u3001\u91CD\u6784\u6216\u4FEE\u590D\u9700\u6C42\u8F6C\u5316\u4E3A\u53EF\u6267\u884C\u7684\u5B9E\u73B0\u8BA1\u5212\u3002',\n whenToUse: '\u7528\u6237\u60F3\u5728\u52A8\u624B\u5199\u4EE3\u7801\u524D\u62FF\u5230\u6280\u672F\u65B9\u6848\uFF0C\u5C24\u5176\u662F\u591A\u6587\u4EF6\u6216\u4E0D\u719F\u6089\u4EE3\u7801\u7684\u6539\u52A8\u3002',\n examplePrompts: [\n { field: 'request', text: '\u89C4\u5212 session store \u7684\u91CD\u6784\u6B65\u9AA4' },\n { field: 'request', text: '\u8BBE\u8BA1 OAuth \u767B\u5F55\u7684\u5B9E\u73B0\u6B65\u9AA4' },\n ],\n },\n },\n tags: ['planning', 'implementation', 'architecture'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Frame' },\n { title: 'Explore' },\n { title: 'Plan' },\n { title: 'Validate' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst request = args && typeof args === 'object' && args.request\n ? String(args.request)\n : 'Infer the implementation request from the current conversation context.'\n\nconst scope = args && typeof args === 'object' && args.scope\n ? String(args.scope)\n : '.'\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this implementation request. Identify the desired outcome, non-goals, likely affected domains, and open questions. Be concrete and avoid generic advice.\\n\\n' +\n 'REQUEST:\\n' + request + '\\n\\nSCOPE HINT:\\n' + scope,\n {\n label: 'request framing',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n outcome: { type: 'string' },\n nonGoals: { type: 'array', items: { type: 'string' } },\n affectedDomains: { type: 'array', items: { type: 'string' } },\n openQuestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['outcome', 'affectedDomains'],\n },\n },\n)\n\nconst AREAS = [\n { key: 'entrypoints', focus: 'Routes, commands, UI pages, public APIs, and user-facing surfaces that must change.' },\n { key: 'domain', focus: 'Core domain model, state transitions, stores, services, and invariants.' },\n { key: 'integration', focus: 'Cross-module dependencies, config, events, async jobs, persistence, and external APIs.' },\n { key: 'validation', focus: 'Existing tests, missing regression tests, build/type/lint commands, and release validation.' },\n]\n\nphase('Explore')\nconst explorations = await parallel(\n AREAS.map((area) => () =>\n agent(\n 'Explore the repository for this implementation plan through the ' + area.key + ' lens.\\n' +\n 'Focus: ' + area.focus + '\\n\\n' +\n 'REQUEST:\\n' + request + '\\n\\n' +\n 'FRAME:\\n' + JSON.stringify(frame, null, 2) + '\\n\\n' +\n 'Return concrete files/functions/modules to inspect or modify, existing patterns to follow, and constraints that affect the plan.',\n {\n label: area.key + ' exploration',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n targets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['path', 'reason'],\n },\n },\n patterns: { type: 'array', items: { type: 'string' } },\n constraints: { type: 'array', items: { type: 'string' } },\n },\n required: ['targets', 'constraints'],\n },\n },\n ),\n ),\n)\n\nphase('Plan')\nconst plan = await agent(\n 'Synthesize an implementation plan from the framing and explorations. Make it executable by an engineer or coding agent. ' +\n 'Use phased tasks, name the concrete files/modules, include sequencing/dependencies, and call out decisions that need user confirmation.\\n\\n' +\n JSON.stringify({ request, scope, frame, explorations }, null, 2),\n {\n label: 'plan synthesis',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n phases: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n tasks: { type: 'array', items: { type: 'string' } },\n files: { type: 'array', items: { type: 'string' } },\n },\n required: ['title', 'tasks'],\n },\n },\n decisions: { type: 'array', items: { type: 'string' } },\n risks: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'phases', 'risks'],\n },\n },\n)\n\nphase('Validate')\nconst validation = await agent(\n 'Create a validation checklist for this implementation plan. Include targeted tests, full commands, manual UI/API checks if relevant, and rollback/recovery notes.\\n\\n' +\n JSON.stringify({ request, plan }, null, 2),\n {\n label: 'validation checklist',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n testCommands: { type: 'array', items: { type: 'string' } },\n manualChecks: { type: 'array', items: { type: 'string' } },\n rollbackNotes: { type: 'array', items: { type: 'string' } },\n },\n required: ['testCommands', 'manualChecks'],\n },\n },\n)\n\nconst output = {\n ok: true,\n request,\n scope,\n ...(plan ?? { summary: 'plan synthesis failed', phases: [], decisions: [], risks: [] }),\n validation: validation ?? { testCommands: [], manualChecks: [], rollbackNotes: [] },\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'json', title: 'Plan phases', value: output.phases },\n { kind: 'questions', title: 'Decisions', items: output.decisions ?? [] },\n { kind: 'risks', title: 'Risks', items: output.risks.map((title) => ({ title })) },\n { kind: 'json', title: 'Validation', value: output.validation },\n ],\n structuredOutput: output,\n}\n";