@xopcai/xopc 0.0.87 → 0.0.88

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 (385) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  3. package/dist/extensions/feishu/src/workflow-progress.js +1 -1
  4. package/dist/extensions/telegram/src/plugin.js +1 -1
  5. package/dist/extensions/telegram/src/routing-integration.js +2 -2
  6. package/dist/extensions/telegram/src/workflow-progress.js +1 -1
  7. package/dist/extensions/telegram/xopc.extension.json +1 -1
  8. package/dist/extensions/weixin/src/api/api.js +2 -2
  9. package/dist/extensions/weixin/src/auth/accounts.js +1 -1
  10. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  11. package/dist/extensions/weixin/src/media/data-url.js +1 -1
  12. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  13. package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
  14. package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
  15. package/dist/extensions/weixin/src/plugin.js +1 -1
  16. package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
  17. package/dist/extensions/weixin/src/workflow-progress.js +1 -1
  18. package/dist/gateway/static/root/assets/agents-CRxETUZx.js +222 -0
  19. package/dist/gateway/static/root/assets/{apps-page-Dg8R-Szf.js → apps-page-wKWf3l57.js} +1 -1
  20. package/dist/gateway/static/root/assets/channels-settings-DDbqVNkx.js +1 -0
  21. package/dist/gateway/static/root/assets/{channels-status-swr-BSHqqCF1.js → channels-status-swr-DIsl75Y3.js} +1 -1
  22. package/dist/gateway/static/root/assets/copy-SxMW6Xpc.js +1 -0
  23. package/dist/gateway/static/root/assets/{cron-api-0h_QT8U3.js → cron-api-N9hvuRrn.js} +1 -1
  24. package/dist/gateway/static/root/assets/{cron-page-BkfKFfFk.js → cron-page-tlNGNxhP.js} +1 -1
  25. package/dist/gateway/static/root/assets/{dist-Cmjp2APP.js → dist-CJwfHYvT.js} +1 -1
  26. package/dist/gateway/static/root/assets/{extension-debug-page-CFa9z_1N.js → extension-debug-page-BVJohZoZ.js} +1 -1
  27. package/dist/gateway/static/root/assets/{extension-page-BI8eaTPq.js → extension-page-BT2tmElC.js} +1 -1
  28. package/dist/gateway/static/root/assets/extension-settings-page-BSS47c2j.js +1 -0
  29. package/dist/gateway/static/root/assets/{fetch-DRqwef_Q.js → fetch-BaFNUtkE.js} +1 -1
  30. package/dist/gateway/static/root/assets/{field-primitives-BiNHBo2Y.js → field-primitives-QwYEq6Hz.js} +1 -1
  31. package/dist/gateway/static/root/assets/{heartbeat-config-api-ZRb8qhuz.js → heartbeat-config-api-BVSidEDJ.js} +1 -1
  32. package/dist/gateway/static/root/assets/index-CqZzHNEg.css +1 -0
  33. package/dist/gateway/static/root/assets/{index-Cu7bKuUi.js → index-qNrVJp-y.js} +97 -97
  34. package/dist/gateway/static/root/assets/{logs-page-BFZ8GgCv.js → logs-page-DDonPVLn.js} +1 -1
  35. package/dist/gateway/static/root/assets/sessions-page-DKt-Wmib.js +1 -0
  36. package/dist/gateway/static/root/assets/{settings-form-section-DiqqVs6m.js → settings-form-section-B8N3A3Zo.js} +1 -1
  37. package/dist/gateway/static/root/assets/settings-page-DcJjvvw4.js +3 -0
  38. package/dist/gateway/static/root/assets/{share-preview-page-n1Gprylk.js → share-preview-page-Q7KqkO-u.js} +1 -1
  39. package/dist/gateway/static/root/assets/skills-page-DuJ4BTO3.js +2 -0
  40. package/dist/gateway/static/root/assets/{theme-store-CZOh1nT3.js → theme-store-BbRc5ugR.js} +1 -1
  41. package/dist/gateway/static/root/assets/url-D6jvVYIA.js +7 -0
  42. package/dist/gateway/static/root/assets/{utils-CkWBfxs4.js → utils-CxDGduqK.js} +1 -1
  43. package/dist/gateway/static/root/assets/voice-api-key-field-CTyHz7L_.js +1 -0
  44. package/dist/gateway/static/root/assets/workflows-page-GacJ41Fv.js +27 -0
  45. package/dist/gateway/static/root/index.html +6 -5
  46. package/dist/package.js +1 -1
  47. package/dist/src/agent/agent-manager.js +7 -7
  48. package/dist/src/agent/agent-scope.js +1 -1
  49. package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
  50. package/dist/src/agent/child-agent-factory.d.ts +15 -0
  51. package/dist/src/agent/child-agent-factory.js +35 -2
  52. package/dist/src/agent/child-agent-factory.js.map +1 -1
  53. package/dist/src/agent/client-error-format.d.ts +20 -0
  54. package/dist/src/agent/client-error-format.js +97 -0
  55. package/dist/src/agent/client-error-format.js.map +1 -0
  56. package/dist/src/agent/context/workspace-seed.js +2 -2
  57. package/dist/src/agent/embedded/run-turn.js +23 -4
  58. package/dist/src/agent/embedded/run-turn.js.map +1 -1
  59. package/dist/src/agent/goals/goal-locale.d.ts +1 -1
  60. package/dist/src/agent/goals/goal-run-store.js +4 -4
  61. package/dist/src/agent/goals/persistent-goal-service.js +1 -1
  62. package/dist/src/agent/goals/post-turn.js +2 -2
  63. package/dist/src/agent/image/load-image-media.js +2 -2
  64. package/dist/src/agent/inbound/turn-dispatcher.js +1 -1
  65. package/dist/src/agent/inbound/turn-dispatcher.js.map +1 -1
  66. package/dist/src/agent/ipc/bus.js +1 -1
  67. package/dist/src/agent/ipc/inbox.js +2 -2
  68. package/dist/src/agent/ipc/socket.js +1 -1
  69. package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
  70. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  71. package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
  72. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  73. package/dist/src/agent/memory/builtin-memory-store.js +1 -1
  74. package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
  75. package/dist/src/agent/memory/dreaming/events.js +1 -1
  76. package/dist/src/agent/memory/dreaming/last-run.js +1 -1
  77. package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
  78. package/dist/src/agent/memory/dreaming/preview.js +1 -1
  79. package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
  80. package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
  81. package/dist/src/agent/memory/dreaming/utils.js +1 -1
  82. package/dist/src/agent/memory/plugin-discovery.js +1 -1
  83. package/dist/src/agent/models/manager.js +1 -1
  84. package/dist/src/agent/orchestration/llm-turn-retry.d.ts +2 -0
  85. package/dist/src/agent/orchestration/llm-turn-retry.js +9 -1
  86. package/dist/src/agent/orchestration/llm-turn-retry.js.map +1 -1
  87. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  88. package/dist/src/agent/reply/post-compaction-context.js +1 -1
  89. package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
  90. package/dist/src/agent/sandbox/path-policy.js +2 -2
  91. package/dist/src/agent/service/build-direct-message-content.js +1 -1
  92. package/dist/src/agent/service/process-direct-streaming.js +19 -3
  93. package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
  94. package/dist/src/agent/service/webchat-tts.d.ts +1 -2
  95. package/dist/src/agent/service/webchat-tts.js +1 -1
  96. package/dist/src/agent/service/webchat-tts.js.map +1 -1
  97. package/dist/src/agent/service.js +4 -4
  98. package/dist/src/agent/session/session-inspector.js +1 -1
  99. package/dist/src/agent/skills/config.js +1 -1
  100. package/dist/src/agent/skills/hub-hash.js +2 -2
  101. package/dist/src/agent/skills/hub-lock.js +1 -1
  102. package/dist/src/agent/skills/hub-pull.js +2 -2
  103. package/dist/src/agent/skills/index.js +1 -1
  104. package/dist/src/agent/skills/managed-store.js +1 -1
  105. package/dist/src/agent/skills/scanner.js +1 -1
  106. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  107. package/dist/src/agent/skills/skill-manager.js +1 -1
  108. package/dist/src/agent/tools/dreaming-tool.js +1 -1
  109. package/dist/src/agent/tools/factory.js +1 -1
  110. package/dist/src/agent/tools/image-generate-tool.js +1 -1
  111. package/dist/src/agent/tools/send-media.js +1 -1
  112. package/dist/src/agent/tools/skill-manage-tool.js +1 -1
  113. package/dist/src/agent/tools/workflow-tool.js +64 -16
  114. package/dist/src/agent/tools/workflow-tool.js.map +1 -1
  115. package/dist/src/agent/tools/write.js +1 -1
  116. package/dist/src/agent/workflow/agent-progress.d.ts +5 -0
  117. package/dist/src/agent/workflow/agent-progress.js +65 -0
  118. package/dist/src/agent/workflow/agent-progress.js.map +1 -0
  119. package/dist/src/agent/workflow/builtins/audit-repo.d.ts +1 -1
  120. package/dist/src/agent/workflow/builtins/audit-repo.js +14 -0
  121. package/dist/src/agent/workflow/builtins/audit-repo.js.map +1 -1
  122. package/dist/src/agent/workflow/builtins/debug-incident.d.ts +1 -1
  123. package/dist/src/agent/workflow/builtins/debug-incident.js +14 -0
  124. package/dist/src/agent/workflow/builtins/debug-incident.js.map +1 -1
  125. package/dist/src/agent/workflow/builtins/implementation-plan.d.ts +12 -0
  126. package/dist/src/agent/workflow/builtins/implementation-plan.js +175 -0
  127. package/dist/src/agent/workflow/builtins/implementation-plan.js.map +1 -0
  128. package/dist/src/agent/workflow/builtins/index.d.ts +3 -1
  129. package/dist/src/agent/workflow/builtins/index.js +11 -1
  130. package/dist/src/agent/workflow/builtins/index.js.map +1 -1
  131. package/dist/src/agent/workflow/builtins/multi-perspective-review.d.ts +1 -1
  132. package/dist/src/agent/workflow/builtins/multi-perspective-review.js +14 -0
  133. package/dist/src/agent/workflow/builtins/multi-perspective-review.js.map +1 -1
  134. package/dist/src/agent/workflow/builtins/pr-review.d.ts +1 -1
  135. package/dist/src/agent/workflow/builtins/pr-review.js +14 -0
  136. package/dist/src/agent/workflow/builtins/pr-review.js.map +1 -1
  137. package/dist/src/agent/workflow/builtins/release-check.d.ts +11 -0
  138. package/dist/src/agent/workflow/builtins/release-check.js +165 -0
  139. package/dist/src/agent/workflow/builtins/release-check.js.map +1 -0
  140. package/dist/src/agent/workflow/builtins/research.d.ts +1 -1
  141. package/dist/src/agent/workflow/builtins/research.js +14 -0
  142. package/dist/src/agent/workflow/builtins/research.js.map +1 -1
  143. package/dist/src/agent/workflow/catalog.js +1 -1
  144. package/dist/src/agent/workflow/index.d.ts +2 -1
  145. package/dist/src/agent/workflow/index.js +3 -2
  146. package/dist/src/agent/workflow/meta-locale.d.ts +12 -0
  147. package/dist/src/agent/workflow/meta-locale.js +62 -0
  148. package/dist/src/agent/workflow/meta-locale.js.map +1 -0
  149. package/dist/src/agent/workflow/parser.js +3 -0
  150. package/dist/src/agent/workflow/parser.js.map +1 -1
  151. package/dist/src/agent/workflow/runtime.d.ts +2 -2
  152. package/dist/src/agent/workflow/runtime.js +21 -14
  153. package/dist/src/agent/workflow/runtime.js.map +1 -1
  154. package/dist/src/agent/workflow/snapshot.js +2 -12
  155. package/dist/src/agent/workflow/snapshot.js.map +1 -1
  156. package/dist/src/agent/workflow/step-labels.d.ts +8 -0
  157. package/dist/src/agent/workflow/step-labels.js +48 -0
  158. package/dist/src/agent/workflow/step-labels.js.map +1 -0
  159. package/dist/src/agent/workflow/subagent-runner.js +46 -1
  160. package/dist/src/agent/workflow/subagent-runner.js.map +1 -1
  161. package/dist/src/agent/workflow/types.d.ts +74 -1
  162. package/dist/src/auth/credentials.d.ts +5 -0
  163. package/dist/src/auth/credentials.js +12 -3
  164. package/dist/src/auth/credentials.js.map +1 -1
  165. package/dist/src/auth/profiles/store.js +1 -1
  166. package/dist/src/auth/sync-provider-auth.js +1 -1
  167. package/dist/src/browser/cache-dir-policy.js +1 -1
  168. package/dist/src/browser/cdp-local-launcher.js +2 -2
  169. package/dist/src/browser/providers/browser-ext-install.js +3 -3
  170. package/dist/src/browser/providers/cloakbrowser.js +4 -4
  171. package/dist/src/browser/providers/playwright-doctor.js +1 -1
  172. package/dist/src/browser/stealth.js +1 -1
  173. package/dist/src/channels/attachments/inbound-persist.js +1 -1
  174. package/dist/src/channels/attachments/outbound-tts-persist.js +1 -1
  175. package/dist/src/channels/outbound/persist-store.js +1 -1
  176. package/dist/src/channels/pairing/allow-from-file.js +1 -1
  177. package/dist/src/channels/pairing/pairing-store.js +2 -2
  178. package/dist/src/chat-commands/builtins/config.js +2 -2
  179. package/dist/src/chat-commands/context.js +1 -1
  180. package/dist/src/cli/commands/config.js +1 -1
  181. package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
  182. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  183. package/dist/src/cli/commands/doctor/checks/session-integrity.js +1 -1
  184. package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
  185. package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
  186. package/dist/src/cli/commands/extension-dev.js +1 -1
  187. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  188. package/dist/src/cli/commands/extension-pack.js +1 -1
  189. package/dist/src/cli/commands/gateway/logs.js +1 -1
  190. package/dist/src/cli/commands/image.js +1 -1
  191. package/dist/src/cli/commands/init.js +4 -4
  192. package/dist/src/cli/commands/onboard.js +1 -1
  193. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  194. package/dist/src/config/agent-profile.js +1 -1
  195. package/dist/src/config/agent-typed-models.d.ts +18 -0
  196. package/dist/src/config/agent-typed-models.js +53 -0
  197. package/dist/src/config/agent-typed-models.js.map +1 -0
  198. package/dist/src/config/gateway-bind.js +1 -1
  199. package/dist/src/config/index.js +6 -6
  200. package/dist/src/config/loader.js +2 -2
  201. package/dist/src/config/models-json.js +2 -2
  202. package/dist/src/config/paths-state.js +1 -1
  203. package/dist/src/config/profile.js +2 -2
  204. package/dist/src/config/schema.d.ts +52 -0
  205. package/dist/src/config/schema.js +39 -3
  206. package/dist/src/config/schema.js.map +1 -1
  207. package/dist/src/config/voice.d.ts +3 -28
  208. package/dist/src/config/voice.js +27 -261
  209. package/dist/src/config/voice.js.map +1 -1
  210. package/dist/src/config/workspace-path.js +1 -1
  211. package/dist/src/cron/executor.js +2 -2
  212. package/dist/src/cron/persistence.js +1 -1
  213. package/dist/src/cron/run-log-store.js +1 -1
  214. package/dist/src/daemon/constants.js +1 -1
  215. package/dist/src/daemon/install-plan.js +2 -2
  216. package/dist/src/daemon/launchd.js +2 -2
  217. package/dist/src/daemon/schtasks.js +2 -2
  218. package/dist/src/daemon/systemd.js +2 -2
  219. package/dist/src/extensions/bundle-mcp.js +1 -1
  220. package/dist/src/extensions/discover-extensions.js +1 -1
  221. package/dist/src/extensions/health.js +1 -1
  222. package/dist/src/extensions/loader.js +1 -1
  223. package/dist/src/extensions/lockfile.js +2 -2
  224. package/dist/src/gateway/agents-admin.d.ts +9 -0
  225. package/dist/src/gateway/agents-admin.js +18 -2
  226. package/dist/src/gateway/agents-admin.js.map +1 -1
  227. package/dist/src/gateway/config-tools-web.js +3 -2
  228. package/dist/src/gateway/config-tools-web.js.map +1 -1
  229. package/dist/src/gateway/file-path-classifier.js +2 -2
  230. package/dist/src/gateway/hono/lib/agent-model.d.ts +7 -0
  231. package/dist/src/gateway/hono/lib/agent-model.js +36 -1
  232. package/dist/src/gateway/hono/lib/agent-model.js.map +1 -1
  233. package/dist/src/gateway/hono/lib/config-payload.js +28 -5
  234. package/dist/src/gateway/hono/lib/config-payload.js.map +1 -1
  235. package/dist/src/gateway/hono/lib/extension-store.js +2 -2
  236. package/dist/src/gateway/hono/lib/mask-secret-length.d.ts +6 -0
  237. package/dist/src/gateway/hono/lib/mask-secret-length.js +16 -0
  238. package/dist/src/gateway/hono/lib/mask-secret-length.js.map +1 -0
  239. package/dist/src/gateway/hono/lib/safe-providers-config.d.ts +1 -1
  240. package/dist/src/gateway/hono/lib/safe-providers-config.js +2 -1
  241. package/dist/src/gateway/hono/lib/safe-providers-config.js.map +1 -1
  242. package/dist/src/gateway/hono/lib/safe-voice-config.js +2 -1
  243. package/dist/src/gateway/hono/lib/safe-voice-config.js.map +1 -1
  244. package/dist/src/gateway/hono/lib/static-ui.js +2 -2
  245. package/dist/src/gateway/hono/oauth.js +1 -1
  246. package/dist/src/gateway/hono/routes/agents.js +2 -2
  247. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  248. package/dist/src/gateway/hono/routes/config-patch/agents.js +8 -2
  249. package/dist/src/gateway/hono/routes/config-patch/agents.js.map +1 -1
  250. package/dist/src/gateway/hono/routes/config-patch/gateway.js +3 -2
  251. package/dist/src/gateway/hono/routes/config-patch/gateway.js.map +1 -1
  252. package/dist/src/gateway/hono/routes/config-patch/misc.js +8 -3
  253. package/dist/src/gateway/hono/routes/config-patch/misc.js.map +1 -1
  254. package/dist/src/gateway/hono/routes/config.js +59 -0
  255. package/dist/src/gateway/hono/routes/config.js.map +1 -1
  256. package/dist/src/gateway/hono/routes/dreaming.js +1 -1
  257. package/dist/src/gateway/hono/routes/host-fs.js +2 -2
  258. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  259. package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
  260. package/dist/src/gateway/hono/routes/models.js +75 -12
  261. package/dist/src/gateway/hono/routes/models.js.map +1 -1
  262. package/dist/src/gateway/hono/routes/shares.js +1 -1
  263. package/dist/src/gateway/hono/routes/voice.js +75 -0
  264. package/dist/src/gateway/hono/routes/voice.js.map +1 -1
  265. package/dist/src/gateway/hono/routes/workflows.d.ts +3 -0
  266. package/dist/src/gateway/hono/routes/workflows.js +347 -0
  267. package/dist/src/gateway/hono/routes/workflows.js.map +1 -0
  268. package/dist/src/gateway/hono/routes/workspace.js +4 -4
  269. package/dist/src/gateway/lock.js +3 -3
  270. package/dist/src/gateway/ports.js +1 -1
  271. package/dist/src/gateway/service/agent-runner.js +2 -2
  272. package/dist/src/gateway/service/marketplace-service.js +2 -2
  273. package/dist/src/gateway/service/run-gateway-agent.js +2 -20
  274. package/dist/src/gateway/service/run-gateway-agent.js.map +1 -1
  275. package/dist/src/gateway/service.d.ts +3 -0
  276. package/dist/src/gateway/service.js +7 -1
  277. package/dist/src/gateway/service.js.map +1 -1
  278. package/dist/src/gateway/workspace-fs-file-list.js +1 -1
  279. package/dist/src/infra/restart.js +2 -2
  280. package/dist/src/infra/update-check.js +1 -1
  281. package/dist/src/infra/update-global.js +1 -1
  282. package/dist/src/infra/update-lock.js +3 -3
  283. package/dist/src/infra/update-runner.js +1 -1
  284. package/dist/src/infra/update-startup.js +2 -2
  285. package/dist/src/infra/write-file-atomic.js +2 -2
  286. package/dist/src/mcp/channel-bridge.js +1 -1
  287. package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
  288. package/dist/src/providers/index.js +2 -2
  289. package/dist/src/providers/model-registry.js +1 -1
  290. package/dist/src/session/config-store.js +2 -2
  291. package/dist/src/session/init-session-turn.js +2 -2
  292. package/dist/src/session/parity/jsonl-transcript-io.js +2 -2
  293. package/dist/src/session/parity/sessions-json-file.js +1 -1
  294. package/dist/src/session/parity/transcript-file-lock.js +2 -2
  295. package/dist/src/session/parity/transcript-paths.js +1 -1
  296. package/dist/src/session/resolve-session.js +4 -4
  297. package/dist/src/session/search-index-cache.js +1 -1
  298. package/dist/src/session/search-index.js +1 -1
  299. package/dist/src/session/session-title.js +2 -2
  300. package/dist/src/session/store.js +5 -5
  301. package/dist/src/share/share-auto.js +2 -2
  302. package/dist/src/share/share-store.js +3 -3
  303. package/dist/src/share/share-thumbnail.js +2 -2
  304. package/dist/src/share/share-zip.js +1 -1
  305. package/dist/src/share/site-share-store.js +3 -3
  306. package/dist/src/share/site-static-serve.js +1 -1
  307. package/dist/src/tui/clipboard-image.js +3 -3
  308. package/dist/src/tui/theme-manager.js +1 -1
  309. package/dist/src/tui/tui-agent-events.js +2 -1
  310. package/dist/src/tui/tui-agent-events.js.map +1 -1
  311. package/dist/src/tui/tui-keybindings-file.js +1 -1
  312. package/dist/src/tui/tui-scoped-models.js +2 -2
  313. package/dist/src/tui/tui-settings.js +1 -1
  314. package/dist/src/tui/tui.js +3 -3
  315. package/dist/src/tunnel/frpc-binary.js +3 -3
  316. package/dist/src/tunnel/frpc-config.js +1 -1
  317. package/dist/src/tunnel/frpc-extract.js +1 -1
  318. package/dist/src/tunnel/tunnel-state.js +1 -1
  319. package/dist/src/utils/logger/audit.js +1 -1
  320. package/dist/src/utils/logger/log-store.js +1 -1
  321. package/dist/src/utils/logger/rotation.js +1 -1
  322. package/dist/src/voice/metadata/builtin.d.ts +2 -0
  323. package/dist/src/voice/metadata/builtin.js +420 -0
  324. package/dist/src/voice/metadata/builtin.js.map +1 -0
  325. package/dist/src/voice/metadata/index.d.ts +4 -0
  326. package/dist/src/voice/metadata/index.js +3 -0
  327. package/dist/src/voice/metadata/registry.d.ts +5 -0
  328. package/dist/src/voice/metadata/registry.js +34 -0
  329. package/dist/src/voice/metadata/registry.js.map +1 -0
  330. package/dist/src/voice/metadata/types.d.ts +41 -0
  331. package/dist/src/voice/metadata/types.js +1 -0
  332. package/dist/src/voice/stt/list-providers.d.ts +3 -3
  333. package/dist/src/voice/stt/list-providers.js +41 -6
  334. package/dist/src/voice/stt/list-providers.js.map +1 -1
  335. package/dist/src/voice/tts/audio.js +1 -1
  336. package/dist/src/voice/tts/list-providers.d.ts +3 -3
  337. package/dist/src/voice/tts/list-providers.js +41 -6
  338. package/dist/src/voice/tts/list-providers.js.map +1 -1
  339. package/dist/src/voice/tts/providers/edge-speech.js +2 -2
  340. package/dist/src/workflows/domain/command.d.ts +18 -0
  341. package/dist/src/workflows/domain/command.js +1 -0
  342. package/dist/src/workflows/domain/definition.d.ts +62 -0
  343. package/dist/src/workflows/domain/definition.js +1 -0
  344. package/dist/src/workflows/domain/event.d.ts +67 -0
  345. package/dist/src/workflows/domain/event.js +1 -0
  346. package/dist/src/workflows/domain/index.d.ts +5 -0
  347. package/dist/src/workflows/domain/index.js +2 -0
  348. package/dist/src/workflows/domain/result.d.ts +65 -0
  349. package/dist/src/workflows/domain/result.js +1 -0
  350. package/dist/src/workflows/domain/run.d.ts +120 -0
  351. package/dist/src/workflows/domain/run.js +14 -0
  352. package/dist/src/workflows/domain/run.js.map +1 -0
  353. package/dist/src/workflows/engine/index.d.ts +2 -0
  354. package/dist/src/workflows/engine/index.js +3 -0
  355. package/dist/src/workflows/engine/projector.d.ts +3 -0
  356. package/dist/src/workflows/engine/projector.js +205 -0
  357. package/dist/src/workflows/engine/projector.js.map +1 -0
  358. package/dist/src/workflows/engine/workflow-engine.d.ts +31 -0
  359. package/dist/src/workflows/engine/workflow-engine.js +188 -0
  360. package/dist/src/workflows/engine/workflow-engine.js.map +1 -0
  361. package/dist/src/workflows/index.d.ts +6 -0
  362. package/dist/src/workflows/index.js +11 -0
  363. package/dist/src/workflows/runtime/index.d.ts +1 -0
  364. package/dist/src/workflows/runtime/index.js +4 -0
  365. package/dist/src/workflows/runtime/script-runtime.d.ts +3 -0
  366. package/dist/src/workflows/runtime/script-runtime.js +3 -0
  367. package/dist/src/workflows/store/event-store.d.ts +17 -0
  368. package/dist/src/workflows/store/event-store.js +83 -0
  369. package/dist/src/workflows/store/event-store.js.map +1 -0
  370. package/dist/src/workflows/store/paths.d.ts +7 -0
  371. package/dist/src/workflows/store/paths.js +26 -0
  372. package/dist/src/workflows/store/paths.js.map +1 -0
  373. package/dist/src/workflows/store/run-store.d.ts +13 -0
  374. package/dist/src/workflows/store/run-store.js +68 -0
  375. package/dist/src/workflows/store/run-store.js.map +1 -0
  376. package/package.json +5 -5
  377. package/dist/gateway/static/root/assets/agents-BEAbXpuP.js +0 -222
  378. package/dist/gateway/static/root/assets/channels-settings-yohw9YSu.js +0 -1
  379. package/dist/gateway/static/root/assets/extension-settings-page-x4BB7q1X.js +0 -1
  380. package/dist/gateway/static/root/assets/index-a5gWIdZQ.css +0 -1
  381. package/dist/gateway/static/root/assets/sessions-page-CD7AfB-2.js +0 -1
  382. package/dist/gateway/static/root/assets/settings-page-BBOjEQW3.js +0 -3
  383. package/dist/gateway/static/root/assets/skills-page-CcN_gj--.js +0 -2
  384. package/dist/gateway/static/root/assets/url-Dd8Q7kZZ.js +0 -3
  385. package/dist/gateway/static/root/assets/voice-api-key-field-O6awz9hi.js +0 -1
@@ -6,12 +6,14 @@
6
6
  */
7
7
  import { AUDIT_REPO_SCRIPT } from './audit-repo.js';
8
8
  import { DEBUG_INCIDENT_SCRIPT } from './debug-incident.js';
9
+ import { IMPLEMENTATION_PLAN_SCRIPT } from './implementation-plan.js';
9
10
  import { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from './multi-perspective-review.js';
10
11
  import { PR_REVIEW_SCRIPT } from './pr-review.js';
12
+ import { RELEASE_CHECK_SCRIPT } from './release-check.js';
11
13
  import { RESEARCH_SCRIPT } from './research.js';
12
14
  export interface BuiltinWorkflow {
13
15
  name: string;
14
16
  script: string;
15
17
  }
16
18
  export declare const BUILTIN_WORKFLOWS: readonly BuiltinWorkflow[];
17
- export { AUDIT_REPO_SCRIPT, DEBUG_INCIDENT_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, PR_REVIEW_SCRIPT, RESEARCH_SCRIPT, };
19
+ export { AUDIT_REPO_SCRIPT, DEBUG_INCIDENT_SCRIPT, IMPLEMENTATION_PLAN_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, PR_REVIEW_SCRIPT, RELEASE_CHECK_SCRIPT, RESEARCH_SCRIPT, };
@@ -1,7 +1,9 @@
1
1
  import { AUDIT_REPO_SCRIPT } from "./audit-repo.js";
2
2
  import { DEBUG_INCIDENT_SCRIPT } from "./debug-incident.js";
3
+ import { IMPLEMENTATION_PLAN_SCRIPT } from "./implementation-plan.js";
3
4
  import { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from "./multi-perspective-review.js";
4
5
  import { PR_REVIEW_SCRIPT } from "./pr-review.js";
6
+ import { RELEASE_CHECK_SCRIPT } from "./release-check.js";
5
7
  import { RESEARCH_SCRIPT } from "./research.js";
6
8
  //#region src/agent/workflow/builtins/index.ts
7
9
  /**
@@ -19,6 +21,10 @@ const BUILTIN_WORKFLOWS = Object.freeze([
19
21
  name: "debug_incident",
20
22
  script: DEBUG_INCIDENT_SCRIPT
21
23
  },
24
+ {
25
+ name: "implementation_plan",
26
+ script: IMPLEMENTATION_PLAN_SCRIPT
27
+ },
22
28
  {
23
29
  name: "multi_perspective_review",
24
30
  script: MULTI_PERSPECTIVE_REVIEW_SCRIPT
@@ -27,12 +33,16 @@ const BUILTIN_WORKFLOWS = Object.freeze([
27
33
  name: "pr_review",
28
34
  script: PR_REVIEW_SCRIPT
29
35
  },
36
+ {
37
+ name: "release_check",
38
+ script: RELEASE_CHECK_SCRIPT
39
+ },
30
40
  {
31
41
  name: "research",
32
42
  script: RESEARCH_SCRIPT
33
43
  }
34
44
  ]);
35
45
  //#endregion
36
- export { AUDIT_REPO_SCRIPT, BUILTIN_WORKFLOWS, DEBUG_INCIDENT_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, PR_REVIEW_SCRIPT, RESEARCH_SCRIPT };
46
+ export { AUDIT_REPO_SCRIPT, BUILTIN_WORKFLOWS, DEBUG_INCIDENT_SCRIPT, IMPLEMENTATION_PLAN_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, PR_REVIEW_SCRIPT, RELEASE_CHECK_SCRIPT, RESEARCH_SCRIPT };
37
47
 
38
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/index.ts"],"sourcesContent":["/**\n * Bundled workflow templates. These are shipped with xopc and discoverable\n * via the catalog alongside user workflows in `~/.xopc/workflows/`. A user\n * workflow with the same `name` always wins — built-ins are starting points,\n * not authority.\n */\n\nimport { AUDIT_REPO_SCRIPT } from './audit-repo.js';\nimport { DEBUG_INCIDENT_SCRIPT } from './debug-incident.js';\nimport { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from './multi-perspective-review.js';\nimport { PR_REVIEW_SCRIPT } from './pr-review.js';\nimport { RESEARCH_SCRIPT } from './research.js';\n\nexport interface BuiltinWorkflow {\n name: string;\n script: string;\n}\n\nexport const BUILTIN_WORKFLOWS: readonly BuiltinWorkflow[] = Object.freeze([\n { name: 'audit_repo', script: AUDIT_REPO_SCRIPT },\n { name: 'debug_incident', script: DEBUG_INCIDENT_SCRIPT },\n { name: 'multi_perspective_review', script: MULTI_PERSPECTIVE_REVIEW_SCRIPT },\n { name: 'pr_review', script: PR_REVIEW_SCRIPT },\n { name: 'research', script: RESEARCH_SCRIPT },\n]);\n\nexport {\n AUDIT_REPO_SCRIPT,\n DEBUG_INCIDENT_SCRIPT,\n MULTI_PERSPECTIVE_REVIEW_SCRIPT,\n PR_REVIEW_SCRIPT,\n RESEARCH_SCRIPT,\n};\n"],"mappings":";;;;;;;;;;;;AAkBA,MAAa,oBAAgD,OAAO,OAAO;CACzE;EAAE,MAAM;EAAc,QAAQ;EAAmB;CACjD;EAAE,MAAM;EAAkB,QAAQ;EAAuB;CACzD;EAAE,MAAM;EAA4B,QAAQ;EAAiC;CAC7E;EAAE,MAAM;EAAa,QAAQ;EAAkB;CAC/C;EAAE,MAAM;EAAY,QAAQ;EAAiB;CAC9C,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/index.ts"],"sourcesContent":["/**\n * Bundled workflow templates. These are shipped with xopc and discoverable\n * via the catalog alongside user workflows in `~/.xopc/workflows/`. A user\n * workflow with the same `name` always wins — built-ins are starting points,\n * not authority.\n */\n\nimport { AUDIT_REPO_SCRIPT } from './audit-repo.js';\nimport { DEBUG_INCIDENT_SCRIPT } from './debug-incident.js';\nimport { IMPLEMENTATION_PLAN_SCRIPT } from './implementation-plan.js';\nimport { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from './multi-perspective-review.js';\nimport { PR_REVIEW_SCRIPT } from './pr-review.js';\nimport { RELEASE_CHECK_SCRIPT } from './release-check.js';\nimport { RESEARCH_SCRIPT } from './research.js';\n\nexport interface BuiltinWorkflow {\n name: string;\n script: string;\n}\n\nexport const BUILTIN_WORKFLOWS: readonly BuiltinWorkflow[] = Object.freeze([\n { name: 'audit_repo', script: AUDIT_REPO_SCRIPT },\n { name: 'debug_incident', script: DEBUG_INCIDENT_SCRIPT },\n { name: 'implementation_plan', script: IMPLEMENTATION_PLAN_SCRIPT },\n { name: 'multi_perspective_review', script: MULTI_PERSPECTIVE_REVIEW_SCRIPT },\n { name: 'pr_review', script: PR_REVIEW_SCRIPT },\n { name: 'release_check', script: RELEASE_CHECK_SCRIPT },\n { name: 'research', script: RESEARCH_SCRIPT },\n]);\n\nexport {\n AUDIT_REPO_SCRIPT,\n DEBUG_INCIDENT_SCRIPT,\n IMPLEMENTATION_PLAN_SCRIPT,\n MULTI_PERSPECTIVE_REVIEW_SCRIPT,\n PR_REVIEW_SCRIPT,\n RELEASE_CHECK_SCRIPT,\n RESEARCH_SCRIPT,\n};\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,oBAAgD,OAAO,OAAO;CACzE;EAAE,MAAM;EAAc,QAAQ;EAAmB;CACjD;EAAE,MAAM;EAAkB,QAAQ;EAAuB;CACzD;EAAE,MAAM;EAAuB,QAAQ;EAA4B;CACnE;EAAE,MAAM;EAA4B,QAAQ;EAAiC;CAC7E;EAAE,MAAM;EAAa,QAAQ;EAAkB;CAC/C;EAAE,MAAM;EAAiB,QAAQ;EAAsB;CACvD;EAAE,MAAM;EAAY,QAAQ;EAAiB;CAC9C,CAAC"}
@@ -11,4 +11,4 @@
11
11
  * - lenses: optional array of { name, angle } to override default lenses
12
12
  * - skipAdversarial: when true, skip the adversarial judge phase
13
13
  */
14
- export declare const MULTI_PERSPECTIVE_REVIEW_SCRIPT = "export const meta = {\n name: 'multi_perspective_review',\n description: 'Review a target from N independent perspectives, then adversarially judge what would actually break.',\n whenToUse: 'User wants a stress-test of a design, plan, PR, or proposal before committing to it.',\n tags: ['review', 'planning', 'decision'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Lenses' },\n { title: 'Adversarial' },\n { title: 'Synthesize' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst target = args && typeof args === 'object' && args.target\n ? String(args.target)\n : 'No explicit target was provided. Treat the currently focused file or recent context as the target.'\n\nconst skipAdversarial = Boolean(args && typeof args === 'object' && args.skipAdversarial)\n\nconst DEFAULT_LENSES = [\n { name: 'User', angle: 'How a real user experiences this. Friction, confusion, surprise paths, accessibility.' },\n { name: 'Operator', angle: 'How an on-call engineer experiences this in production. Failure modes, observability, rollback.' },\n { name: 'Skeptic', angle: 'Hidden assumptions. What is being implied but not stated. What would break under load or weird input.' },\n { name: 'Maintainer', angle: 'Six-month-later view. Clarity, naming, layering, ease of changing nearby code.' },\n]\n\nlet lenses = DEFAULT_LENSES\nif (args && typeof args === 'object' && Array.isArray(args.lenses) && args.lenses.length) {\n lenses = args.lenses\n .filter((l) => l && typeof l === 'object' && l.name && l.angle)\n .map((l) => ({ name: String(l.name), angle: String(l.angle) }))\n if (!lenses.length) lenses = DEFAULT_LENSES\n}\n\nphase('Lenses')\nconst lensViews = await parallel(\n lenses.map((l) => () =>\n agent(\n 'Review the following target through the ' + l.name + ' lens.\\n' +\n 'Lens focus: ' + l.angle + '\\n\\n' +\n 'TARGET:\\n' + target + '\\n\\n' +\n 'Return 3\u20137 concrete observations. Each entry: title (5\u201310 words), why-it-matters (1 sentence), risk (low/med/high).',\n {\n label: l.name + ' lens',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n observations: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n why: { type: 'string' },\n risk: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['title', 'why', 'risk'],\n },\n },\n },\n required: ['observations'],\n },\n },\n ),\n ),\n)\n\nconst valid = lensViews.filter(Boolean)\nconst allObs = valid.flatMap((v, i) =>\n (v?.observations ?? []).map((o) => ({ lens: lenses[i].name, ...o })),\n)\n\nlet verdict = null\nif (!skipAdversarial) {\n phase('Adversarial')\n verdict = await agent(\n 'You are an adversarial judge. Given these multi-lens observations of a target, decide which would actually cause real harm if shipped as-is. ' +\n 'Default to realRisk=false unless an observation has clear, mechanism-level evidence. ' +\n 'Rate evidenceStrength as weak | moderate | strong.\\n\\n' +\n JSON.stringify(allObs, null, 2),\n {\n label: 'adversarial verdict',\n schema: {\n type: 'object',\n properties: {\n verdicts: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n lens: { type: 'string' },\n realRisk: { type: 'boolean' },\n evidenceStrength: { type: 'string', enum: ['weak', 'moderate', 'strong'] },\n reason: { type: 'string' },\n },\n required: ['title', 'lens', 'realRisk', 'evidenceStrength', 'reason'],\n },\n },\n },\n required: ['verdicts'],\n },\n },\n )\n}\n\nphase('Synthesize')\nconst confirmed = (verdict?.verdicts ?? []).filter((v) => v.realRisk)\nconst goNoGo = skipAdversarial\n ? (allObs.some((o) => o.risk === 'high') ? 'fix_first' : 'ship')\n : confirmed.some((v) => v.evidenceStrength === 'strong')\n ? 'fix_first'\n : confirmed.length\n ? 'fix_first'\n : 'ship'\n\nreturn {\n ok: true,\n target,\n lenses: lenses.map((l) => l.name),\n skipAdversarial,\n observationCount: allObs.length,\n confirmedRiskCount: confirmed.length,\n goNoGo,\n topRisks: confirmed.slice(0, 10),\n allVerdicts: verdict?.verdicts ?? [],\n}\n";
14
+ export declare const MULTI_PERSPECTIVE_REVIEW_SCRIPT = "export const meta = {\n name: 'multi_perspective_review',\n description: 'Review a target from N independent perspectives, then adversarially judge what would actually break.',\n whenToUse: 'User wants a stress-test of a design, plan, PR, or proposal before committing to it.',\n examplePrompts: [\n { field: 'target', text: 'Stress-test this API redesign before we ship' },\n { field: 'target', text: 'Review the migration plan from multiple angles' },\n ],\n i18n: {\n zh: {\n description: '\u4ECE\u591A\u4E2A\u72EC\u7ACB\u89C6\u89D2\u8BC4\u5BA1\u76EE\u6807\uFF0C\u5E76\u7531\u5BF9\u6297\u6027\u8BC4\u5BA1\u5224\u65AD\u5B9E\u9645\u4F1A\u51FA\u4EC0\u4E48\u95EE\u9898\u3002',\n whenToUse: '\u7528\u6237\u60F3\u5728\u843D\u5730\u524D\u5BF9\u8BBE\u8BA1\u3001\u65B9\u6848\u3001PR \u6216\u63D0\u6848\u505A\u538B\u529B\u6D4B\u8BD5\u65F6\u3002',\n examplePrompts: [\n { field: 'target', text: '\u4E0A\u7EBF\u524D\u4ECE\u591A\u89D2\u5EA6\u538B\u529B\u6D4B\u8BD5\u8FD9\u4E2A API redesign' },\n { field: 'target', text: '\u4ECE\u591A\u4E2A\u89C6\u89D2\u8BC4\u5BA1\u8FD9\u4EFD\u8FC1\u79FB\u65B9\u6848' },\n ],\n },\n },\n tags: ['review', 'planning', 'decision'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Lenses' },\n { title: 'Adversarial' },\n { title: 'Synthesize' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst target = args && typeof args === 'object' && args.target\n ? String(args.target)\n : 'No explicit target was provided. Treat the currently focused file or recent context as the target.'\n\nconst skipAdversarial = Boolean(args && typeof args === 'object' && args.skipAdversarial)\n\nconst DEFAULT_LENSES = [\n { name: 'User', angle: 'How a real user experiences this. Friction, confusion, surprise paths, accessibility.' },\n { name: 'Operator', angle: 'How an on-call engineer experiences this in production. Failure modes, observability, rollback.' },\n { name: 'Skeptic', angle: 'Hidden assumptions. What is being implied but not stated. What would break under load or weird input.' },\n { name: 'Maintainer', angle: 'Six-month-later view. Clarity, naming, layering, ease of changing nearby code.' },\n]\n\nlet lenses = DEFAULT_LENSES\nif (args && typeof args === 'object' && Array.isArray(args.lenses) && args.lenses.length) {\n lenses = args.lenses\n .filter((l) => l && typeof l === 'object' && l.name && l.angle)\n .map((l) => ({ name: String(l.name), angle: String(l.angle) }))\n if (!lenses.length) lenses = DEFAULT_LENSES\n}\n\nphase('Lenses')\nconst lensViews = await parallel(\n lenses.map((l) => () =>\n agent(\n 'Review the following target through the ' + l.name + ' lens.\\n' +\n 'Lens focus: ' + l.angle + '\\n\\n' +\n 'TARGET:\\n' + target + '\\n\\n' +\n 'Return 3\u20137 concrete observations. Each entry: title (5\u201310 words), why-it-matters (1 sentence), risk (low/med/high).',\n {\n label: l.name + ' lens',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n observations: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n why: { type: 'string' },\n risk: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['title', 'why', 'risk'],\n },\n },\n },\n required: ['observations'],\n },\n },\n ),\n ),\n)\n\nconst valid = lensViews.filter(Boolean)\nconst allObs = valid.flatMap((v, i) =>\n (v?.observations ?? []).map((o) => ({ lens: lenses[i].name, ...o })),\n)\n\nlet verdict = null\nif (!skipAdversarial) {\n phase('Adversarial')\n verdict = await agent(\n 'You are an adversarial judge. Given these multi-lens observations of a target, decide which would actually cause real harm if shipped as-is. ' +\n 'Default to realRisk=false unless an observation has clear, mechanism-level evidence. ' +\n 'Rate evidenceStrength as weak | moderate | strong.\\n\\n' +\n JSON.stringify(allObs, null, 2),\n {\n label: 'adversarial verdict',\n schema: {\n type: 'object',\n properties: {\n verdicts: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n lens: { type: 'string' },\n realRisk: { type: 'boolean' },\n evidenceStrength: { type: 'string', enum: ['weak', 'moderate', 'strong'] },\n reason: { type: 'string' },\n },\n required: ['title', 'lens', 'realRisk', 'evidenceStrength', 'reason'],\n },\n },\n },\n required: ['verdicts'],\n },\n },\n )\n}\n\nphase('Synthesize')\nconst confirmed = (verdict?.verdicts ?? []).filter((v) => v.realRisk)\nconst goNoGo = skipAdversarial\n ? (allObs.some((o) => o.risk === 'high') ? 'fix_first' : 'ship')\n : confirmed.some((v) => v.evidenceStrength === 'strong')\n ? 'fix_first'\n : confirmed.length\n ? 'fix_first'\n : 'ship'\n\nreturn {\n ok: true,\n target,\n lenses: lenses.map((l) => l.name),\n skipAdversarial,\n observationCount: allObs.length,\n confirmedRiskCount: confirmed.length,\n goNoGo,\n topRisks: confirmed.slice(0, 10),\n allVerdicts: verdict?.verdicts ?? [],\n}\n";
@@ -16,6 +16,20 @@ const MULTI_PERSPECTIVE_REVIEW_SCRIPT = `export const meta = {
16
16
  name: 'multi_perspective_review',
17
17
  description: 'Review a target from N independent perspectives, then adversarially judge what would actually break.',
18
18
  whenToUse: 'User wants a stress-test of a design, plan, PR, or proposal before committing to it.',
19
+ examplePrompts: [
20
+ { field: 'target', text: 'Stress-test this API redesign before we ship' },
21
+ { field: 'target', text: 'Review the migration plan from multiple angles' },
22
+ ],
23
+ i18n: {
24
+ zh: {
25
+ description: '从多个独立视角评审目标,并由对抗性评审判断实际会出什么问题。',
26
+ whenToUse: '用户想在落地前对设计、方案、PR 或提案做压力测试时。',
27
+ examplePrompts: [
28
+ { field: 'target', text: '上线前从多角度压力测试这个 API redesign' },
29
+ { field: 'target', text: '从多个视角评审这份迁移方案' },
30
+ ],
31
+ },
32
+ },
19
33
  tags: ['review', 'planning', 'decision'],
20
34
  estimatedAgents: { min: 5, max: 6 },
21
35
  phases: [
@@ -1 +1 @@
1
- {"version":3,"file":"multi-perspective-review.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/multi-perspective-review.ts"],"sourcesContent":["/**\n * Built-in workflow: `multi_perspective_review`\n *\n * Reviews a target (file, PR, design doc, plan — passed via args.target) from\n * several independent perspectives, then asks an adversarial judge to decide\n * what would actually break in practice. Useful for sanity-checking decisions\n * before they ship.\n *\n * Args:\n * - target: what to review\n * - lenses: optional array of { name, angle } to override default lenses\n * - skipAdversarial: when true, skip the adversarial judge phase\n */\n\nexport const MULTI_PERSPECTIVE_REVIEW_SCRIPT = `export const meta = {\n name: 'multi_perspective_review',\n description: 'Review a target from N independent perspectives, then adversarially judge what would actually break.',\n whenToUse: 'User wants a stress-test of a design, plan, PR, or proposal before committing to it.',\n tags: ['review', 'planning', 'decision'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Lenses' },\n { title: 'Adversarial' },\n { title: 'Synthesize' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst target = args && typeof args === 'object' && args.target\n ? String(args.target)\n : 'No explicit target was provided. Treat the currently focused file or recent context as the target.'\n\nconst skipAdversarial = Boolean(args && typeof args === 'object' && args.skipAdversarial)\n\nconst DEFAULT_LENSES = [\n { name: 'User', angle: 'How a real user experiences this. Friction, confusion, surprise paths, accessibility.' },\n { name: 'Operator', angle: 'How an on-call engineer experiences this in production. Failure modes, observability, rollback.' },\n { name: 'Skeptic', angle: 'Hidden assumptions. What is being implied but not stated. What would break under load or weird input.' },\n { name: 'Maintainer', angle: 'Six-month-later view. Clarity, naming, layering, ease of changing nearby code.' },\n]\n\nlet lenses = DEFAULT_LENSES\nif (args && typeof args === 'object' && Array.isArray(args.lenses) && args.lenses.length) {\n lenses = args.lenses\n .filter((l) => l && typeof l === 'object' && l.name && l.angle)\n .map((l) => ({ name: String(l.name), angle: String(l.angle) }))\n if (!lenses.length) lenses = DEFAULT_LENSES\n}\n\nphase('Lenses')\nconst lensViews = await parallel(\n lenses.map((l) => () =>\n agent(\n 'Review the following target through the ' + l.name + ' lens.\\\\n' +\n 'Lens focus: ' + l.angle + '\\\\n\\\\n' +\n 'TARGET:\\\\n' + target + '\\\\n\\\\n' +\n 'Return 3–7 concrete observations. Each entry: title (5–10 words), why-it-matters (1 sentence), risk (low/med/high).',\n {\n label: l.name + ' lens',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n observations: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n why: { type: 'string' },\n risk: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['title', 'why', 'risk'],\n },\n },\n },\n required: ['observations'],\n },\n },\n ),\n ),\n)\n\nconst valid = lensViews.filter(Boolean)\nconst allObs = valid.flatMap((v, i) =>\n (v?.observations ?? []).map((o) => ({ lens: lenses[i].name, ...o })),\n)\n\nlet verdict = null\nif (!skipAdversarial) {\n phase('Adversarial')\n verdict = await agent(\n 'You are an adversarial judge. Given these multi-lens observations of a target, decide which would actually cause real harm if shipped as-is. ' +\n 'Default to realRisk=false unless an observation has clear, mechanism-level evidence. ' +\n 'Rate evidenceStrength as weak | moderate | strong.\\\\n\\\\n' +\n JSON.stringify(allObs, null, 2),\n {\n label: 'adversarial verdict',\n schema: {\n type: 'object',\n properties: {\n verdicts: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n lens: { type: 'string' },\n realRisk: { type: 'boolean' },\n evidenceStrength: { type: 'string', enum: ['weak', 'moderate', 'strong'] },\n reason: { type: 'string' },\n },\n required: ['title', 'lens', 'realRisk', 'evidenceStrength', 'reason'],\n },\n },\n },\n required: ['verdicts'],\n },\n },\n )\n}\n\nphase('Synthesize')\nconst confirmed = (verdict?.verdicts ?? []).filter((v) => v.realRisk)\nconst goNoGo = skipAdversarial\n ? (allObs.some((o) => o.risk === 'high') ? 'fix_first' : 'ship')\n : confirmed.some((v) => v.evidenceStrength === 'strong')\n ? 'fix_first'\n : confirmed.length\n ? 'fix_first'\n : 'ship'\n\nreturn {\n ok: true,\n target,\n lenses: lenses.map((l) => l.name),\n skipAdversarial,\n observationCount: allObs.length,\n confirmedRiskCount: confirmed.length,\n goNoGo,\n topRisks: confirmed.slice(0, 10),\n allVerdicts: verdict?.verdicts ?? [],\n}\n`\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAa,kCAAkC"}
1
+ {"version":3,"file":"multi-perspective-review.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/multi-perspective-review.ts"],"sourcesContent":["/**\n * Built-in workflow: `multi_perspective_review`\n *\n * Reviews a target (file, PR, design doc, plan — passed via args.target) from\n * several independent perspectives, then asks an adversarial judge to decide\n * what would actually break in practice. Useful for sanity-checking decisions\n * before they ship.\n *\n * Args:\n * - target: what to review\n * - lenses: optional array of { name, angle } to override default lenses\n * - skipAdversarial: when true, skip the adversarial judge phase\n */\n\nexport const MULTI_PERSPECTIVE_REVIEW_SCRIPT = `export const meta = {\n name: 'multi_perspective_review',\n description: 'Review a target from N independent perspectives, then adversarially judge what would actually break.',\n whenToUse: 'User wants a stress-test of a design, plan, PR, or proposal before committing to it.',\n examplePrompts: [\n { field: 'target', text: 'Stress-test this API redesign before we ship' },\n { field: 'target', text: 'Review the migration plan from multiple angles' },\n ],\n i18n: {\n zh: {\n description: '从多个独立视角评审目标,并由对抗性评审判断实际会出什么问题。',\n whenToUse: '用户想在落地前对设计、方案、PR 或提案做压力测试时。',\n examplePrompts: [\n { field: 'target', text: '上线前从多角度压力测试这个 API redesign' },\n { field: 'target', text: '从多个视角评审这份迁移方案' },\n ],\n },\n },\n tags: ['review', 'planning', 'decision'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Lenses' },\n { title: 'Adversarial' },\n { title: 'Synthesize' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst target = args && typeof args === 'object' && args.target\n ? String(args.target)\n : 'No explicit target was provided. Treat the currently focused file or recent context as the target.'\n\nconst skipAdversarial = Boolean(args && typeof args === 'object' && args.skipAdversarial)\n\nconst DEFAULT_LENSES = [\n { name: 'User', angle: 'How a real user experiences this. Friction, confusion, surprise paths, accessibility.' },\n { name: 'Operator', angle: 'How an on-call engineer experiences this in production. Failure modes, observability, rollback.' },\n { name: 'Skeptic', angle: 'Hidden assumptions. What is being implied but not stated. What would break under load or weird input.' },\n { name: 'Maintainer', angle: 'Six-month-later view. Clarity, naming, layering, ease of changing nearby code.' },\n]\n\nlet lenses = DEFAULT_LENSES\nif (args && typeof args === 'object' && Array.isArray(args.lenses) && args.lenses.length) {\n lenses = args.lenses\n .filter((l) => l && typeof l === 'object' && l.name && l.angle)\n .map((l) => ({ name: String(l.name), angle: String(l.angle) }))\n if (!lenses.length) lenses = DEFAULT_LENSES\n}\n\nphase('Lenses')\nconst lensViews = await parallel(\n lenses.map((l) => () =>\n agent(\n 'Review the following target through the ' + l.name + ' lens.\\\\n' +\n 'Lens focus: ' + l.angle + '\\\\n\\\\n' +\n 'TARGET:\\\\n' + target + '\\\\n\\\\n' +\n 'Return 3–7 concrete observations. Each entry: title (5–10 words), why-it-matters (1 sentence), risk (low/med/high).',\n {\n label: l.name + ' lens',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n observations: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n why: { type: 'string' },\n risk: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['title', 'why', 'risk'],\n },\n },\n },\n required: ['observations'],\n },\n },\n ),\n ),\n)\n\nconst valid = lensViews.filter(Boolean)\nconst allObs = valid.flatMap((v, i) =>\n (v?.observations ?? []).map((o) => ({ lens: lenses[i].name, ...o })),\n)\n\nlet verdict = null\nif (!skipAdversarial) {\n phase('Adversarial')\n verdict = await agent(\n 'You are an adversarial judge. Given these multi-lens observations of a target, decide which would actually cause real harm if shipped as-is. ' +\n 'Default to realRisk=false unless an observation has clear, mechanism-level evidence. ' +\n 'Rate evidenceStrength as weak | moderate | strong.\\\\n\\\\n' +\n JSON.stringify(allObs, null, 2),\n {\n label: 'adversarial verdict',\n schema: {\n type: 'object',\n properties: {\n verdicts: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n lens: { type: 'string' },\n realRisk: { type: 'boolean' },\n evidenceStrength: { type: 'string', enum: ['weak', 'moderate', 'strong'] },\n reason: { type: 'string' },\n },\n required: ['title', 'lens', 'realRisk', 'evidenceStrength', 'reason'],\n },\n },\n },\n required: ['verdicts'],\n },\n },\n )\n}\n\nphase('Synthesize')\nconst confirmed = (verdict?.verdicts ?? []).filter((v) => v.realRisk)\nconst goNoGo = skipAdversarial\n ? (allObs.some((o) => o.risk === 'high') ? 'fix_first' : 'ship')\n : confirmed.some((v) => v.evidenceStrength === 'strong')\n ? 'fix_first'\n : confirmed.length\n ? 'fix_first'\n : 'ship'\n\nreturn {\n ok: true,\n target,\n lenses: lenses.map((l) => l.name),\n skipAdversarial,\n observationCount: allObs.length,\n confirmedRiskCount: confirmed.length,\n goNoGo,\n topRisks: confirmed.slice(0, 10),\n allVerdicts: verdict?.verdicts ?? [],\n}\n`\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAa,kCAAkC"}
@@ -9,4 +9,4 @@
9
9
  * - target: PR description, diff, commit range, or file list
10
10
  * - diff: alias for target
11
11
  */
12
- export declare const PR_REVIEW_SCRIPT = "export const meta = {\n name: 'pr_review',\n description: 'Review a PR/diff/commit range with parallel focused reviewers and a ship/block verdict.',\n whenToUse: 'User asks to review a PR, diff, specific changes, or commit range (not the whole repo).',\n tags: ['code-review', 'pr'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Scope' },\n { title: 'Review' },\n { title: 'Verdict' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object'\n ? String(args.target ?? args.diff ?? '')\n : ''\nconst reviewTarget = target.trim()\n ? target\n : 'Recent changes in the working tree or the diff/context from the current conversation.'\n\nconst REVIEWERS = [\n { key: 'correctness', focus: 'Logic bugs, edge cases, error handling, null safety, race conditions in changed code.' },\n { key: 'security', focus: 'Auth/authz regressions, input validation, secret exposure, injection, unsafe deserialization in the diff.' },\n { key: 'tests', focus: 'Missing tests for changed behavior, brittle assertions, untested edge cases introduced by this change.' },\n { key: 'api_compat', focus: 'Breaking public API changes, schema migrations, backward compatibility, deprecation handling.' },\n { key: 'perf', focus: 'Regressions in hot paths, accidental N+1, sync I/O, unbounded loops or allocations in changed code.' },\n]\n\nphase('Scope')\nconst scope = await agent(\n 'Identify what changed for this review target. List changed files, blast radius (what depends on them), and the apparent intent of the change. Be concise.\\n\\nTARGET:\\n' +\n reviewTarget,\n {\n label: 'change scope',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n changedFiles: { type: 'array', items: { type: 'string' } },\n intent: { type: 'string' },\n blastRadius: { type: 'string' },\n },\n required: ['changedFiles', 'intent'],\n },\n },\n)\n\nphase('Review')\nconst reviews = await parallel(\n REVIEWERS.map((r) => () =>\n agent(\n 'Review these changes through the ' + r.key + ' lens.\\n' +\n 'Focus: ' + r.focus + '\\n\\n' +\n 'TARGET:\\n' + reviewTarget + '\\n\\n' +\n 'SCOPE:\\n' + JSON.stringify(scope, null, 2) + '\\n\\n' +\n 'Return findings: file, severity (low/med/high/blocker), title, fix suggestion. Blocker = must fix before merge.',\n {\n label: r.key,\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string', enum: ['low', 'med', 'high', 'blocker'] },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'severity', 'title', 'fix'],\n },\n },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Verdict')\nconst live = reviews.filter(Boolean)\nconst byReviewer = {}\nfor (let i = 0; i < REVIEWERS.length; i++) {\n byReviewer[REVIEWERS[i].key] = live[i]?.findings ?? []\n}\n\nconst verdict = await agent(\n 'Synthesize a PR review verdict. Separate blockers from suggestions. Deduplicate. Recommend ship | fix_first | block.\\n\\n' +\n JSON.stringify(byReviewer, null, 2),\n {\n label: 'verdict',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string', enum: ['ship', 'fix_first', 'block'] },\n summary: { type: 'string' },\n blockers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n suggestions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string' },\n title: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n },\n required: ['recommendation', 'summary', 'blockers'],\n },\n },\n)\n\nreturn {\n ok: true,\n target: reviewTarget,\n scope,\n ...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),\n byReviewer,\n}\n";
12
+ export declare const PR_REVIEW_SCRIPT = "export const meta = {\n name: 'pr_review',\n description: 'Review a PR/diff/commit range with parallel focused reviewers and a ship/block verdict.',\n whenToUse: 'User asks to review a PR, diff, specific changes, or commit range (not the whole repo).',\n examplePrompts: [\n { field: 'target', text: 'Review the changes on this branch' },\n { field: 'target', text: 'Review PR #42 for ship/block verdict' },\n ],\n i18n: {\n zh: {\n description: '\u5E76\u884C\u805A\u7126\u5BA1\u67E5 PR\u3001diff \u6216\u63D0\u4EA4\u8303\u56F4\uFF0C\u5E76\u7ED9\u51FA\u53EF\u5408\u5E76/\u5E94\u62E6\u622A\u7684\u7ED3\u8BBA\u3002',\n whenToUse: '\u7528\u6237\u8981\u5BA1\u67E5 PR\u3001diff\u3001\u7279\u5B9A\u6539\u52A8\u6216\u63D0\u4EA4\u8303\u56F4\uFF08\u800C\u975E\u6574\u5E93\uFF09\u65F6\u3002',\n examplePrompts: [\n { field: 'target', text: '\u5BA1\u67E5\u5F53\u524D\u5206\u652F\u4E0A\u7684\u6539\u52A8' },\n { field: 'target', text: '\u5BA1\u67E5 PR #42\uFF0C\u7ED9\u51FA\u662F\u5426\u53EF\u5408\u5E76\u7684\u7ED3\u8BBA' },\n ],\n },\n },\n tags: ['code-review', 'pr'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Scope' },\n { title: 'Review' },\n { title: 'Verdict' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object'\n ? String(args.target ?? args.diff ?? '')\n : ''\nconst reviewTarget = target.trim()\n ? target\n : 'Recent changes in the working tree or the diff/context from the current conversation.'\n\nconst REVIEWERS = [\n { key: 'correctness', focus: 'Logic bugs, edge cases, error handling, null safety, race conditions in changed code.' },\n { key: 'security', focus: 'Auth/authz regressions, input validation, secret exposure, injection, unsafe deserialization in the diff.' },\n { key: 'tests', focus: 'Missing tests for changed behavior, brittle assertions, untested edge cases introduced by this change.' },\n { key: 'api_compat', focus: 'Breaking public API changes, schema migrations, backward compatibility, deprecation handling.' },\n { key: 'perf', focus: 'Regressions in hot paths, accidental N+1, sync I/O, unbounded loops or allocations in changed code.' },\n]\n\nphase('Scope')\nconst scope = await agent(\n 'Identify what changed for this review target. List changed files, blast radius (what depends on them), and the apparent intent of the change. Be concise.\\n\\nTARGET:\\n' +\n reviewTarget,\n {\n label: 'change scope',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n changedFiles: { type: 'array', items: { type: 'string' } },\n intent: { type: 'string' },\n blastRadius: { type: 'string' },\n },\n required: ['changedFiles', 'intent'],\n },\n },\n)\n\nphase('Review')\nconst reviews = await parallel(\n REVIEWERS.map((r) => () =>\n agent(\n 'Review these changes through the ' + r.key + ' lens.\\n' +\n 'Focus: ' + r.focus + '\\n\\n' +\n 'TARGET:\\n' + reviewTarget + '\\n\\n' +\n 'SCOPE:\\n' + JSON.stringify(scope, null, 2) + '\\n\\n' +\n 'Return findings: file, severity (low/med/high/blocker), title, fix suggestion. Blocker = must fix before merge.',\n {\n label: r.key,\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string', enum: ['low', 'med', 'high', 'blocker'] },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'severity', 'title', 'fix'],\n },\n },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Verdict')\nconst live = reviews.filter(Boolean)\nconst byReviewer = {}\nfor (let i = 0; i < REVIEWERS.length; i++) {\n byReviewer[REVIEWERS[i].key] = live[i]?.findings ?? []\n}\n\nconst verdict = await agent(\n 'Synthesize a PR review verdict. Separate blockers from suggestions. Deduplicate. Recommend ship | fix_first | block.\\n\\n' +\n JSON.stringify(byReviewer, null, 2),\n {\n label: 'verdict',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string', enum: ['ship', 'fix_first', 'block'] },\n summary: { type: 'string' },\n blockers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n suggestions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string' },\n title: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n },\n required: ['recommendation', 'summary', 'blockers'],\n },\n },\n)\n\nreturn {\n ok: true,\n target: reviewTarget,\n scope,\n ...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),\n byReviewer,\n}\n";
@@ -14,6 +14,20 @@ const PR_REVIEW_SCRIPT = `export const meta = {
14
14
  name: 'pr_review',
15
15
  description: 'Review a PR/diff/commit range with parallel focused reviewers and a ship/block verdict.',
16
16
  whenToUse: 'User asks to review a PR, diff, specific changes, or commit range (not the whole repo).',
17
+ examplePrompts: [
18
+ { field: 'target', text: 'Review the changes on this branch' },
19
+ { field: 'target', text: 'Review PR #42 for ship/block verdict' },
20
+ ],
21
+ i18n: {
22
+ zh: {
23
+ description: '并行聚焦审查 PR、diff 或提交范围,并给出可合并/应拦截的结论。',
24
+ whenToUse: '用户要审查 PR、diff、特定改动或提交范围(而非整库)时。',
25
+ examplePrompts: [
26
+ { field: 'target', text: '审查当前分支上的改动' },
27
+ { field: 'target', text: '审查 PR #42,给出是否可合并的结论' },
28
+ ],
29
+ },
30
+ },
17
31
  tags: ['code-review', 'pr'],
18
32
  estimatedAgents: { min: 7, max: 7 },
19
33
  phases: [
@@ -1 +1 @@
1
- {"version":3,"file":"pr-review.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/pr-review.ts"],"sourcesContent":["/**\n * Built-in workflow: `pr_review`\n *\n * Focused review of a PR, diff, or commit range — lighter than full repo audit.\n * Parallel reviewers cover correctness, security, tests, API compat, and perf;\n * final phase produces a ship/block verdict with blockers vs suggestions.\n *\n * Args:\n * - target: PR description, diff, commit range, or file list\n * - diff: alias for target\n */\n\nexport const PR_REVIEW_SCRIPT = `export const meta = {\n name: 'pr_review',\n description: 'Review a PR/diff/commit range with parallel focused reviewers and a ship/block verdict.',\n whenToUse: 'User asks to review a PR, diff, specific changes, or commit range (not the whole repo).',\n tags: ['code-review', 'pr'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Scope' },\n { title: 'Review' },\n { title: 'Verdict' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object'\n ? String(args.target ?? args.diff ?? '')\n : ''\nconst reviewTarget = target.trim()\n ? target\n : 'Recent changes in the working tree or the diff/context from the current conversation.'\n\nconst REVIEWERS = [\n { key: 'correctness', focus: 'Logic bugs, edge cases, error handling, null safety, race conditions in changed code.' },\n { key: 'security', focus: 'Auth/authz regressions, input validation, secret exposure, injection, unsafe deserialization in the diff.' },\n { key: 'tests', focus: 'Missing tests for changed behavior, brittle assertions, untested edge cases introduced by this change.' },\n { key: 'api_compat', focus: 'Breaking public API changes, schema migrations, backward compatibility, deprecation handling.' },\n { key: 'perf', focus: 'Regressions in hot paths, accidental N+1, sync I/O, unbounded loops or allocations in changed code.' },\n]\n\nphase('Scope')\nconst scope = await agent(\n 'Identify what changed for this review target. List changed files, blast radius (what depends on them), and the apparent intent of the change. Be concise.\\\\n\\\\nTARGET:\\\\n' +\n reviewTarget,\n {\n label: 'change scope',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n changedFiles: { type: 'array', items: { type: 'string' } },\n intent: { type: 'string' },\n blastRadius: { type: 'string' },\n },\n required: ['changedFiles', 'intent'],\n },\n },\n)\n\nphase('Review')\nconst reviews = await parallel(\n REVIEWERS.map((r) => () =>\n agent(\n 'Review these changes through the ' + r.key + ' lens.\\\\n' +\n 'Focus: ' + r.focus + '\\\\n\\\\n' +\n 'TARGET:\\\\n' + reviewTarget + '\\\\n\\\\n' +\n 'SCOPE:\\\\n' + JSON.stringify(scope, null, 2) + '\\\\n\\\\n' +\n 'Return findings: file, severity (low/med/high/blocker), title, fix suggestion. Blocker = must fix before merge.',\n {\n label: r.key,\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string', enum: ['low', 'med', 'high', 'blocker'] },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'severity', 'title', 'fix'],\n },\n },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Verdict')\nconst live = reviews.filter(Boolean)\nconst byReviewer = {}\nfor (let i = 0; i < REVIEWERS.length; i++) {\n byReviewer[REVIEWERS[i].key] = live[i]?.findings ?? []\n}\n\nconst verdict = await agent(\n 'Synthesize a PR review verdict. Separate blockers from suggestions. Deduplicate. Recommend ship | fix_first | block.\\\\n\\\\n' +\n JSON.stringify(byReviewer, null, 2),\n {\n label: 'verdict',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string', enum: ['ship', 'fix_first', 'block'] },\n summary: { type: 'string' },\n blockers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n suggestions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string' },\n title: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n },\n required: ['recommendation', 'summary', 'blockers'],\n },\n },\n)\n\nreturn {\n ok: true,\n target: reviewTarget,\n scope,\n ...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),\n byReviewer,\n}\n`\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,mBAAmB"}
1
+ {"version":3,"file":"pr-review.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/pr-review.ts"],"sourcesContent":["/**\n * Built-in workflow: `pr_review`\n *\n * Focused review of a PR, diff, or commit range — lighter than full repo audit.\n * Parallel reviewers cover correctness, security, tests, API compat, and perf;\n * final phase produces a ship/block verdict with blockers vs suggestions.\n *\n * Args:\n * - target: PR description, diff, commit range, or file list\n * - diff: alias for target\n */\n\nexport const PR_REVIEW_SCRIPT = `export const meta = {\n name: 'pr_review',\n description: 'Review a PR/diff/commit range with parallel focused reviewers and a ship/block verdict.',\n whenToUse: 'User asks to review a PR, diff, specific changes, or commit range (not the whole repo).',\n examplePrompts: [\n { field: 'target', text: 'Review the changes on this branch' },\n { field: 'target', text: 'Review PR #42 for ship/block verdict' },\n ],\n i18n: {\n zh: {\n description: '并行聚焦审查 PR、diff 或提交范围,并给出可合并/应拦截的结论。',\n whenToUse: '用户要审查 PR、diff、特定改动或提交范围(而非整库)时。',\n examplePrompts: [\n { field: 'target', text: '审查当前分支上的改动' },\n { field: 'target', text: '审查 PR #42,给出是否可合并的结论' },\n ],\n },\n },\n tags: ['code-review', 'pr'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Scope' },\n { title: 'Review' },\n { title: 'Verdict' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object'\n ? String(args.target ?? args.diff ?? '')\n : ''\nconst reviewTarget = target.trim()\n ? target\n : 'Recent changes in the working tree or the diff/context from the current conversation.'\n\nconst REVIEWERS = [\n { key: 'correctness', focus: 'Logic bugs, edge cases, error handling, null safety, race conditions in changed code.' },\n { key: 'security', focus: 'Auth/authz regressions, input validation, secret exposure, injection, unsafe deserialization in the diff.' },\n { key: 'tests', focus: 'Missing tests for changed behavior, brittle assertions, untested edge cases introduced by this change.' },\n { key: 'api_compat', focus: 'Breaking public API changes, schema migrations, backward compatibility, deprecation handling.' },\n { key: 'perf', focus: 'Regressions in hot paths, accidental N+1, sync I/O, unbounded loops or allocations in changed code.' },\n]\n\nphase('Scope')\nconst scope = await agent(\n 'Identify what changed for this review target. List changed files, blast radius (what depends on them), and the apparent intent of the change. Be concise.\\\\n\\\\nTARGET:\\\\n' +\n reviewTarget,\n {\n label: 'change scope',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n changedFiles: { type: 'array', items: { type: 'string' } },\n intent: { type: 'string' },\n blastRadius: { type: 'string' },\n },\n required: ['changedFiles', 'intent'],\n },\n },\n)\n\nphase('Review')\nconst reviews = await parallel(\n REVIEWERS.map((r) => () =>\n agent(\n 'Review these changes through the ' + r.key + ' lens.\\\\n' +\n 'Focus: ' + r.focus + '\\\\n\\\\n' +\n 'TARGET:\\\\n' + reviewTarget + '\\\\n\\\\n' +\n 'SCOPE:\\\\n' + JSON.stringify(scope, null, 2) + '\\\\n\\\\n' +\n 'Return findings: file, severity (low/med/high/blocker), title, fix suggestion. Blocker = must fix before merge.',\n {\n label: r.key,\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string', enum: ['low', 'med', 'high', 'blocker'] },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'severity', 'title', 'fix'],\n },\n },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Verdict')\nconst live = reviews.filter(Boolean)\nconst byReviewer = {}\nfor (let i = 0; i < REVIEWERS.length; i++) {\n byReviewer[REVIEWERS[i].key] = live[i]?.findings ?? []\n}\n\nconst verdict = await agent(\n 'Synthesize a PR review verdict. Separate blockers from suggestions. Deduplicate. Recommend ship | fix_first | block.\\\\n\\\\n' +\n JSON.stringify(byReviewer, null, 2),\n {\n label: 'verdict',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string', enum: ['ship', 'fix_first', 'block'] },\n summary: { type: 'string' },\n blockers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n title: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n suggestions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n file: { type: 'string' },\n severity: { type: 'string' },\n title: { type: 'string' },\n },\n required: ['file', 'title'],\n },\n },\n },\n required: ['recommendation', 'summary', 'blockers'],\n },\n },\n)\n\nreturn {\n ok: true,\n target: reviewTarget,\n scope,\n ...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),\n byReviewer,\n}\n`\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,mBAAmB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Built-in workflow: `release_check`
3
+ *
4
+ * Runs a release-readiness review for a finished change. It inspects the diff,
5
+ * validates risk areas in parallel, and produces a go/no-go checklist.
6
+ *
7
+ * Args:
8
+ * - target: release candidate, branch, commit range, or feature summary
9
+ * - checks: optional subset of check keys
10
+ */
11
+ export declare const RELEASE_CHECK_SCRIPT = "export const meta = {\n name: 'release_check',\n description: 'Assess whether a change is ready to release with parallel risk checks and a go/no-go verdict.',\n whenToUse: 'User is near the end of implementation and wants a release-quality readiness check before shipping.',\n examplePrompts: [\n { field: 'target', text: 'Is this repo ready to release v1.2?' },\n { field: 'target', text: 'Pre-release readiness check for the current branch' },\n ],\n i18n: {\n zh: {\n description: '\u5E76\u884C\u68C0\u67E5\u53D1\u5E03\u98CE\u9669\uFF0C\u5224\u65AD\u53D8\u66F4\u662F\u5426\u8FBE\u5230\u53EF\u53D1\u5E03\u6807\u51C6\u3002',\n whenToUse: '\u7528\u6237\u63A5\u8FD1\u5F00\u53D1\u5C3E\u58F0\uFF0C\u60F3\u5728\u53D1\u5E03\u524D\u505A\u53D1\u5E03\u8D28\u91CF/\u5C31\u7EEA\u68C0\u67E5\u65F6\u3002',\n examplePrompts: [\n { field: 'target', text: '\u8FD9\u4E2A\u4ED3\u5E93\u662F\u5426\u51C6\u5907\u597D\u53D1\u5E03 v1.2\uFF1F' },\n { field: 'target', text: '\u5BF9\u5F53\u524D\u5206\u652F\u505A\u53D1\u5E03\u524D\u5C31\u7EEA\u68C0\u67E5' },\n ],\n },\n },\n tags: ['release', 'quality', 'validation'],\n estimatedAgents: { min: 6, max: 7 },\n phases: [\n { title: 'Scope' },\n { title: 'Checks' },\n { title: 'Verdict' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object' && args.target\n ? String(args.target)\n : 'Current working tree or release candidate from the conversation context.'\n\nconst ALL_CHECKS = [\n { key: 'regression', focus: 'Behavior changes, compatibility breaks, edge cases, and accidental scope creep.' },\n { key: 'tests', focus: 'Relevant automated tests, missing regression cases, flaky or weak assertions, and manual coverage gaps.' },\n { key: 'build', focus: 'Typecheck, lint, build, packaging, lazy imports, generated assets, and dependency correctness.' },\n { key: 'security', focus: 'Secrets, auth/authz, input validation, unsafe shell/file/network access, and data exposure.' },\n { key: 'ops', focus: 'Logging, observability, migrations, persistence, rollback, failure modes, and supportability.' },\n]\n\nlet checks = ALL_CHECKS\nif (args && typeof args === 'object' && Array.isArray(args.checks) && args.checks.length) {\n const selected = new Set(args.checks.map((check) => String(check)))\n checks = ALL_CHECKS.filter((check) => selected.has(check.key))\n if (!checks.length) checks = ALL_CHECKS\n}\n\nphase('Scope')\nconst scope = await agent(\n 'Identify the release candidate scope. Inspect the working tree or target if useful. Return changed areas, user-visible behavior, and likely blast radius.\\n\\n' +\n 'TARGET:\\n' + target,\n {\n label: 'release scope',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n changedAreas: { type: 'array', items: { type: 'string' } },\n userVisibleChanges: { type: 'array', items: { type: 'string' } },\n blastRadius: { type: 'string' },\n },\n required: ['changedAreas', 'blastRadius'],\n },\n },\n)\n\nphase('Checks')\nconst reports = await parallel(\n checks.map((check) => () =>\n agent(\n 'Run a release-readiness check through the ' + check.key + ' lens.\\n' +\n 'Focus: ' + check.focus + '\\n\\n' +\n 'TARGET:\\n' + target + '\\n\\n' +\n 'SCOPE:\\n' + JSON.stringify(scope, null, 2) + '\\n\\n' +\n 'Return blockers, warnings, evidence, and concrete fixes. Prefer specific files/commands over generic statements.',\n {\n label: check.key + ' check',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n blockers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n evidence: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['title', 'evidence', 'fix'],\n },\n },\n warnings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n evidence: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['title', 'evidence'],\n },\n },\n recommendedCommands: { type: 'array', items: { type: 'string' } },\n },\n required: ['blockers', 'warnings'],\n },\n },\n ),\n ),\n)\n\nphase('Verdict')\nconst byCheck = {}\nfor (let i = 0; i < checks.length; i++) {\n byCheck[checks[i].key] = reports[i] ?? { blockers: [], warnings: [], recommendedCommands: [] }\n}\n\nconst verdict = await agent(\n 'Synthesize a release go/no-go verdict. Block if any credible blocker remains. If not blocked, distinguish ship_now from ship_after_checks. ' +\n 'Deduplicate issues and produce the shortest checklist that would make this release safe.\\n\\n' +\n JSON.stringify({ target, scope, byCheck }, null, 2),\n {\n label: 'release verdict',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string', enum: ['ship_now', 'ship_after_checks', 'block'] },\n summary: { type: 'string' },\n blockers: { type: 'array', items: { type: 'string' } },\n finalChecklist: { type: 'array', items: { type: 'string' } },\n commandsToRun: { type: 'array', items: { type: 'string' } },\n },\n required: ['recommendation', 'summary', 'blockers', 'finalChecklist'],\n },\n },\n)\n\nreturn {\n ok: true,\n target,\n checks: checks.map((check) => check.key),\n scope,\n ...(verdict ?? { recommendation: 'ship_after_checks', summary: 'verdict failed', blockers: [], finalChecklist: [] }),\n byCheck,\n}\n";
@@ -0,0 +1,165 @@
1
+ //#region src/agent/workflow/builtins/release-check.ts
2
+ /**
3
+ * Built-in workflow: `release_check`
4
+ *
5
+ * Runs a release-readiness review for a finished change. It inspects the diff,
6
+ * validates risk areas in parallel, and produces a go/no-go checklist.
7
+ *
8
+ * Args:
9
+ * - target: release candidate, branch, commit range, or feature summary
10
+ * - checks: optional subset of check keys
11
+ */
12
+ const RELEASE_CHECK_SCRIPT = `export const meta = {
13
+ name: 'release_check',
14
+ description: 'Assess whether a change is ready to release with parallel risk checks and a go/no-go verdict.',
15
+ whenToUse: 'User is near the end of implementation and wants a release-quality readiness check before shipping.',
16
+ examplePrompts: [
17
+ { field: 'target', text: 'Is this repo ready to release v1.2?' },
18
+ { field: 'target', text: 'Pre-release readiness check for the current branch' },
19
+ ],
20
+ i18n: {
21
+ zh: {
22
+ description: '并行检查发布风险,判断变更是否达到可发布标准。',
23
+ whenToUse: '用户接近开发尾声,想在发布前做发布质量/就绪检查时。',
24
+ examplePrompts: [
25
+ { field: 'target', text: '这个仓库是否准备好发布 v1.2?' },
26
+ { field: 'target', text: '对当前分支做发布前就绪检查' },
27
+ ],
28
+ },
29
+ },
30
+ tags: ['release', 'quality', 'validation'],
31
+ estimatedAgents: { min: 6, max: 7 },
32
+ phases: [
33
+ { title: 'Scope' },
34
+ { title: 'Checks' },
35
+ { title: 'Verdict' },
36
+ ],
37
+ }
38
+
39
+ const READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']
40
+
41
+ const target = args && typeof args === 'object' && args.target
42
+ ? String(args.target)
43
+ : 'Current working tree or release candidate from the conversation context.'
44
+
45
+ const ALL_CHECKS = [
46
+ { key: 'regression', focus: 'Behavior changes, compatibility breaks, edge cases, and accidental scope creep.' },
47
+ { key: 'tests', focus: 'Relevant automated tests, missing regression cases, flaky or weak assertions, and manual coverage gaps.' },
48
+ { key: 'build', focus: 'Typecheck, lint, build, packaging, lazy imports, generated assets, and dependency correctness.' },
49
+ { key: 'security', focus: 'Secrets, auth/authz, input validation, unsafe shell/file/network access, and data exposure.' },
50
+ { key: 'ops', focus: 'Logging, observability, migrations, persistence, rollback, failure modes, and supportability.' },
51
+ ]
52
+
53
+ let checks = ALL_CHECKS
54
+ if (args && typeof args === 'object' && Array.isArray(args.checks) && args.checks.length) {
55
+ const selected = new Set(args.checks.map((check) => String(check)))
56
+ checks = ALL_CHECKS.filter((check) => selected.has(check.key))
57
+ if (!checks.length) checks = ALL_CHECKS
58
+ }
59
+
60
+ phase('Scope')
61
+ const scope = await agent(
62
+ 'Identify the release candidate scope. Inspect the working tree or target if useful. Return changed areas, user-visible behavior, and likely blast radius.\\n\\n' +
63
+ 'TARGET:\\n' + target,
64
+ {
65
+ label: 'release scope',
66
+ toolset: READ_ONLY_TOOLS,
67
+ schema: {
68
+ type: 'object',
69
+ properties: {
70
+ changedAreas: { type: 'array', items: { type: 'string' } },
71
+ userVisibleChanges: { type: 'array', items: { type: 'string' } },
72
+ blastRadius: { type: 'string' },
73
+ },
74
+ required: ['changedAreas', 'blastRadius'],
75
+ },
76
+ },
77
+ )
78
+
79
+ phase('Checks')
80
+ const reports = await parallel(
81
+ checks.map((check) => () =>
82
+ agent(
83
+ 'Run a release-readiness check through the ' + check.key + ' lens.\\n' +
84
+ 'Focus: ' + check.focus + '\\n\\n' +
85
+ 'TARGET:\\n' + target + '\\n\\n' +
86
+ 'SCOPE:\\n' + JSON.stringify(scope, null, 2) + '\\n\\n' +
87
+ 'Return blockers, warnings, evidence, and concrete fixes. Prefer specific files/commands over generic statements.',
88
+ {
89
+ label: check.key + ' check',
90
+ toolset: READ_ONLY_TOOLS,
91
+ schema: {
92
+ type: 'object',
93
+ properties: {
94
+ blockers: {
95
+ type: 'array',
96
+ items: {
97
+ type: 'object',
98
+ properties: {
99
+ title: { type: 'string' },
100
+ evidence: { type: 'string' },
101
+ fix: { type: 'string' },
102
+ },
103
+ required: ['title', 'evidence', 'fix'],
104
+ },
105
+ },
106
+ warnings: {
107
+ type: 'array',
108
+ items: {
109
+ type: 'object',
110
+ properties: {
111
+ title: { type: 'string' },
112
+ evidence: { type: 'string' },
113
+ fix: { type: 'string' },
114
+ },
115
+ required: ['title', 'evidence'],
116
+ },
117
+ },
118
+ recommendedCommands: { type: 'array', items: { type: 'string' } },
119
+ },
120
+ required: ['blockers', 'warnings'],
121
+ },
122
+ },
123
+ ),
124
+ ),
125
+ )
126
+
127
+ phase('Verdict')
128
+ const byCheck = {}
129
+ for (let i = 0; i < checks.length; i++) {
130
+ byCheck[checks[i].key] = reports[i] ?? { blockers: [], warnings: [], recommendedCommands: [] }
131
+ }
132
+
133
+ const verdict = await agent(
134
+ 'Synthesize a release go/no-go verdict. Block if any credible blocker remains. If not blocked, distinguish ship_now from ship_after_checks. ' +
135
+ 'Deduplicate issues and produce the shortest checklist that would make this release safe.\\n\\n' +
136
+ JSON.stringify({ target, scope, byCheck }, null, 2),
137
+ {
138
+ label: 'release verdict',
139
+ schema: {
140
+ type: 'object',
141
+ properties: {
142
+ recommendation: { type: 'string', enum: ['ship_now', 'ship_after_checks', 'block'] },
143
+ summary: { type: 'string' },
144
+ blockers: { type: 'array', items: { type: 'string' } },
145
+ finalChecklist: { type: 'array', items: { type: 'string' } },
146
+ commandsToRun: { type: 'array', items: { type: 'string' } },
147
+ },
148
+ required: ['recommendation', 'summary', 'blockers', 'finalChecklist'],
149
+ },
150
+ },
151
+ )
152
+
153
+ return {
154
+ ok: true,
155
+ target,
156
+ checks: checks.map((check) => check.key),
157
+ scope,
158
+ ...(verdict ?? { recommendation: 'ship_after_checks', summary: 'verdict failed', blockers: [], finalChecklist: [] }),
159
+ byCheck,
160
+ }
161
+ `;
162
+ //#endregion
163
+ export { RELEASE_CHECK_SCRIPT };
164
+
165
+ //# sourceMappingURL=release-check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-check.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/release-check.ts"],"sourcesContent":["/**\n * Built-in workflow: `release_check`\n *\n * Runs a release-readiness review for a finished change. It inspects the diff,\n * validates risk areas in parallel, and produces a go/no-go checklist.\n *\n * Args:\n * - target: release candidate, branch, commit range, or feature summary\n * - checks: optional subset of check keys\n */\n\nexport const RELEASE_CHECK_SCRIPT = `export const meta = {\n name: 'release_check',\n description: 'Assess whether a change is ready to release with parallel risk checks and a go/no-go verdict.',\n whenToUse: 'User is near the end of implementation and wants a release-quality readiness check before shipping.',\n examplePrompts: [\n { field: 'target', text: 'Is this repo ready to release v1.2?' },\n { field: 'target', text: 'Pre-release readiness check for the current branch' },\n ],\n i18n: {\n zh: {\n description: '并行检查发布风险,判断变更是否达到可发布标准。',\n whenToUse: '用户接近开发尾声,想在发布前做发布质量/就绪检查时。',\n examplePrompts: [\n { field: 'target', text: '这个仓库是否准备好发布 v1.2?' },\n { field: 'target', text: '对当前分支做发布前就绪检查' },\n ],\n },\n },\n tags: ['release', 'quality', 'validation'],\n estimatedAgents: { min: 6, max: 7 },\n phases: [\n { title: 'Scope' },\n { title: 'Checks' },\n { title: 'Verdict' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object' && args.target\n ? String(args.target)\n : 'Current working tree or release candidate from the conversation context.'\n\nconst ALL_CHECKS = [\n { key: 'regression', focus: 'Behavior changes, compatibility breaks, edge cases, and accidental scope creep.' },\n { key: 'tests', focus: 'Relevant automated tests, missing regression cases, flaky or weak assertions, and manual coverage gaps.' },\n { key: 'build', focus: 'Typecheck, lint, build, packaging, lazy imports, generated assets, and dependency correctness.' },\n { key: 'security', focus: 'Secrets, auth/authz, input validation, unsafe shell/file/network access, and data exposure.' },\n { key: 'ops', focus: 'Logging, observability, migrations, persistence, rollback, failure modes, and supportability.' },\n]\n\nlet checks = ALL_CHECKS\nif (args && typeof args === 'object' && Array.isArray(args.checks) && args.checks.length) {\n const selected = new Set(args.checks.map((check) => String(check)))\n checks = ALL_CHECKS.filter((check) => selected.has(check.key))\n if (!checks.length) checks = ALL_CHECKS\n}\n\nphase('Scope')\nconst scope = await agent(\n 'Identify the release candidate scope. Inspect the working tree or target if useful. Return changed areas, user-visible behavior, and likely blast radius.\\\\n\\\\n' +\n 'TARGET:\\\\n' + target,\n {\n label: 'release scope',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n changedAreas: { type: 'array', items: { type: 'string' } },\n userVisibleChanges: { type: 'array', items: { type: 'string' } },\n blastRadius: { type: 'string' },\n },\n required: ['changedAreas', 'blastRadius'],\n },\n },\n)\n\nphase('Checks')\nconst reports = await parallel(\n checks.map((check) => () =>\n agent(\n 'Run a release-readiness check through the ' + check.key + ' lens.\\\\n' +\n 'Focus: ' + check.focus + '\\\\n\\\\n' +\n 'TARGET:\\\\n' + target + '\\\\n\\\\n' +\n 'SCOPE:\\\\n' + JSON.stringify(scope, null, 2) + '\\\\n\\\\n' +\n 'Return blockers, warnings, evidence, and concrete fixes. Prefer specific files/commands over generic statements.',\n {\n label: check.key + ' check',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n blockers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n evidence: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['title', 'evidence', 'fix'],\n },\n },\n warnings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n evidence: { type: 'string' },\n fix: { type: 'string' },\n },\n required: ['title', 'evidence'],\n },\n },\n recommendedCommands: { type: 'array', items: { type: 'string' } },\n },\n required: ['blockers', 'warnings'],\n },\n },\n ),\n ),\n)\n\nphase('Verdict')\nconst byCheck = {}\nfor (let i = 0; i < checks.length; i++) {\n byCheck[checks[i].key] = reports[i] ?? { blockers: [], warnings: [], recommendedCommands: [] }\n}\n\nconst verdict = await agent(\n 'Synthesize a release go/no-go verdict. Block if any credible blocker remains. If not blocked, distinguish ship_now from ship_after_checks. ' +\n 'Deduplicate issues and produce the shortest checklist that would make this release safe.\\\\n\\\\n' +\n JSON.stringify({ target, scope, byCheck }, null, 2),\n {\n label: 'release verdict',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string', enum: ['ship_now', 'ship_after_checks', 'block'] },\n summary: { type: 'string' },\n blockers: { type: 'array', items: { type: 'string' } },\n finalChecklist: { type: 'array', items: { type: 'string' } },\n commandsToRun: { type: 'array', items: { type: 'string' } },\n },\n required: ['recommendation', 'summary', 'blockers', 'finalChecklist'],\n },\n },\n)\n\nreturn {\n ok: true,\n target,\n checks: checks.map((check) => check.key),\n scope,\n ...(verdict ?? { recommendation: 'ship_after_checks', summary: 'verdict failed', blockers: [], finalChecklist: [] }),\n byCheck,\n}\n`\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,uBAAuB"}
@@ -10,4 +10,4 @@
10
10
  * - question: research question
11
11
  * - depth: 'quick' (2 angles) | 'standard' (4) | 'deep' (6)
12
12
  */
13
- export declare const RESEARCH_SCRIPT = "export const meta = {\n name: 'research',\n description: 'Multi-angle research on a question with parallel exploration and a cited synthesis.',\n whenToUse: 'User asks a non-trivial research question that benefits from multiple search angles or source reads.',\n tags: ['research', 'investigation'],\n estimatedAgents: { min: 4, max: 8 },\n phases: [\n { title: 'Frame' },\n { title: 'Sweep' },\n { title: 'Synthesize' },\n ],\n}\n\nconst RESEARCH_TOOLS = ['web_search', 'web_fetch', 'read_file', 'grep', 'find', 'list_dir']\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'No explicit question supplied; infer from the most recent user turn.'\n\nconst depth = args && typeof args === 'object' && args.depth\n ? String(args.depth)\n : 'standard'\nconst maxAngles = depth === 'quick' ? 2 : depth === 'deep' ? 6 : 4\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this research question. Return exactly ' + maxAngles + ' distinct angles worth investigating, ' +\n 'each with the single most decisive sub-question. Be concrete.\\n\\nQUESTION:\\n' +\n question,\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n angles: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n key_question: { type: 'string' },\n },\n required: ['title', 'key_question'],\n },\n },\n },\n required: ['angles'],\n },\n },\n)\n\nif (!frame || !frame.angles?.length) {\n return { ok: false, reason: 'framing failed', question, depth }\n}\n\nconst angles = frame.angles.slice(0, maxAngles)\n\nphase('Sweep')\nconst angleReports = await parallel(\n angles.map((a) => () =>\n agent(\n 'Investigate this angle. Use search and source-read tools liberally. Distinguish what you can confirm from what is conjecture.\\n\\n' +\n 'ANGLE: ' + a.title + '\\n' +\n 'KEY QUESTION: ' + a.key_question + '\\n\\n' +\n 'Return: 3\u20136 grounded findings (each with a 1-line claim and a source URL or file path), plus the strongest counter-evidence.',\n {\n label: a.title,\n toolset: RESEARCH_TOOLS,\n maxIterations: depth === 'deep' ? 40 : 30,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n confidence: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['claim', 'source', 'confidence'],\n },\n },\n counterEvidence: { type: 'string' },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Synthesize')\nconst live = angleReports.filter(Boolean)\nconst synthesis = await agent(\n 'Synthesize a cited research report from these angle-level findings. Drop unsupported or duplicate claims. Use the highest-confidence source per claim. ' +\n 'Explicitly list contradictions where angles disagree. Return: an executive summary (max 5 sentences), top findings with inline source URLs, open questions, and contradictions.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n\\n' +\n JSON.stringify({ angles, reports: live }, null, 2),\n {\n label: 'synthesis',\n schema: {\n type: 'object',\n properties: {\n executiveSummary: { type: 'string' },\n topFindings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n },\n required: ['claim', 'source'],\n },\n },\n openQuestions: { type: 'array', items: { type: 'string' } },\n contradictions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n topic: { type: 'string' },\n sides: { type: 'array', items: { type: 'string' } },\n },\n required: ['topic', 'sides'],\n },\n },\n },\n required: ['executiveSummary', 'topFindings'],\n },\n },\n)\n\nreturn {\n ok: true,\n question,\n depth,\n angleCount: angles.length,\n ...(synthesis ?? { executiveSummary: 'synthesis failed', topFindings: [], contradictions: [] }),\n}\n";
13
+ export declare const RESEARCH_SCRIPT = "export const meta = {\n name: 'research',\n description: 'Multi-angle research on a question with parallel exploration and a cited synthesis.',\n whenToUse: 'User asks a non-trivial research question that benefits from multiple search angles or source reads.',\n examplePrompts: [\n { field: 'question', text: 'Compare Bun vs Node startup performance' },\n { field: 'question', text: 'What are the trade-offs of SQLite vs Postgres for this app?' },\n ],\n i18n: {\n zh: {\n description: '\u591A\u89D2\u5EA6\u5E76\u884C\u8C03\u7814\u4E00\u4E2A\u95EE\u9898\uFF0C\u5E76\u4EA7\u51FA\u5E26\u5F15\u7528\u7684\u7EFC\u5408\u62A5\u544A\u3002',\n whenToUse: '\u7528\u6237\u63D0\u51FA\u9700\u8981\u591A\u89D2\u5EA6\u68C0\u7D22\u3001\u9605\u8BFB\u6765\u6E90\u7684\u975E\u5E73\u51E1\u8C03\u7814\u95EE\u9898\u65F6\u3002',\n examplePrompts: [\n { field: 'question', text: '\u6BD4\u8F83 Bun \u4E0E Node \u7684\u542F\u52A8\u6027\u80FD' },\n { field: 'question', text: '\u8FD9\u4E2A\u5E94\u7528\u7528 SQLite \u8FD8\u662F Postgres \u5404\u6709\u4EC0\u4E48\u6743\u8861\uFF1F' },\n ],\n },\n },\n tags: ['research', 'investigation'],\n estimatedAgents: { min: 4, max: 8 },\n phases: [\n { title: 'Frame' },\n { title: 'Sweep' },\n { title: 'Synthesize' },\n ],\n}\n\nconst RESEARCH_TOOLS = ['web_search', 'web_fetch', 'read_file', 'grep', 'find', 'list_dir']\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'No explicit question supplied; infer from the most recent user turn.'\n\nconst depth = args && typeof args === 'object' && args.depth\n ? String(args.depth)\n : 'standard'\nconst maxAngles = depth === 'quick' ? 2 : depth === 'deep' ? 6 : 4\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this research question. Return exactly ' + maxAngles + ' distinct angles worth investigating, ' +\n 'each with the single most decisive sub-question. Be concrete.\\n\\nQUESTION:\\n' +\n question,\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n angles: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n key_question: { type: 'string' },\n },\n required: ['title', 'key_question'],\n },\n },\n },\n required: ['angles'],\n },\n },\n)\n\nif (!frame || !frame.angles?.length) {\n return { ok: false, reason: 'framing failed', question, depth }\n}\n\nconst angles = frame.angles.slice(0, maxAngles)\n\nphase('Sweep')\nconst angleReports = await parallel(\n angles.map((a) => () =>\n agent(\n 'Investigate this angle. Use search and source-read tools liberally. Distinguish what you can confirm from what is conjecture.\\n\\n' +\n 'ANGLE: ' + a.title + '\\n' +\n 'KEY QUESTION: ' + a.key_question + '\\n\\n' +\n 'Return: 3\u20136 grounded findings (each with a 1-line claim and a source URL or file path), plus the strongest counter-evidence.',\n {\n label: a.title,\n toolset: RESEARCH_TOOLS,\n maxIterations: depth === 'deep' ? 40 : 30,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n confidence: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['claim', 'source', 'confidence'],\n },\n },\n counterEvidence: { type: 'string' },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Synthesize')\nconst live = angleReports.filter(Boolean)\nconst synthesis = await agent(\n 'Synthesize a cited research report from these angle-level findings. Drop unsupported or duplicate claims. Use the highest-confidence source per claim. ' +\n 'Explicitly list contradictions where angles disagree. Return: an executive summary (max 5 sentences), top findings with inline source URLs, open questions, and contradictions.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n\\n' +\n JSON.stringify({ angles, reports: live }, null, 2),\n {\n label: 'synthesis',\n schema: {\n type: 'object',\n properties: {\n executiveSummary: { type: 'string' },\n topFindings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n },\n required: ['claim', 'source'],\n },\n },\n openQuestions: { type: 'array', items: { type: 'string' } },\n contradictions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n topic: { type: 'string' },\n sides: { type: 'array', items: { type: 'string' } },\n },\n required: ['topic', 'sides'],\n },\n },\n },\n required: ['executiveSummary', 'topFindings'],\n },\n },\n)\n\nreturn {\n ok: true,\n question,\n depth,\n angleCount: angles.length,\n ...(synthesis ?? { executiveSummary: 'synthesis failed', topFindings: [], contradictions: [] }),\n}\n";
@@ -15,6 +15,20 @@ const RESEARCH_SCRIPT = `export const meta = {
15
15
  name: 'research',
16
16
  description: 'Multi-angle research on a question with parallel exploration and a cited synthesis.',
17
17
  whenToUse: 'User asks a non-trivial research question that benefits from multiple search angles or source reads.',
18
+ examplePrompts: [
19
+ { field: 'question', text: 'Compare Bun vs Node startup performance' },
20
+ { field: 'question', text: 'What are the trade-offs of SQLite vs Postgres for this app?' },
21
+ ],
22
+ i18n: {
23
+ zh: {
24
+ description: '多角度并行调研一个问题,并产出带引用的综合报告。',
25
+ whenToUse: '用户提出需要多角度检索、阅读来源的非平凡调研问题时。',
26
+ examplePrompts: [
27
+ { field: 'question', text: '比较 Bun 与 Node 的启动性能' },
28
+ { field: 'question', text: '这个应用用 SQLite 还是 Postgres 各有什么权衡?' },
29
+ ],
30
+ },
31
+ },
18
32
  tags: ['research', 'investigation'],
19
33
  estimatedAgents: { min: 4, max: 8 },
20
34
  phases: [
@@ -1 +1 @@
1
- {"version":3,"file":"research.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/research.ts"],"sourcesContent":["/**\n * Built-in workflow: `research`\n *\n * Multi-modal research sweep on a question (args.question). Fans out search /\n * exploration / source-reading angles in parallel, then synthesises a cited\n * report. Each angle is its own subagent so source reading does not pollute the\n * parent context.\n *\n * Args:\n * - question: research question\n * - depth: 'quick' (2 angles) | 'standard' (4) | 'deep' (6)\n */\n\nexport const RESEARCH_SCRIPT = `export const meta = {\n name: 'research',\n description: 'Multi-angle research on a question with parallel exploration and a cited synthesis.',\n whenToUse: 'User asks a non-trivial research question that benefits from multiple search angles or source reads.',\n tags: ['research', 'investigation'],\n estimatedAgents: { min: 4, max: 8 },\n phases: [\n { title: 'Frame' },\n { title: 'Sweep' },\n { title: 'Synthesize' },\n ],\n}\n\nconst RESEARCH_TOOLS = ['web_search', 'web_fetch', 'read_file', 'grep', 'find', 'list_dir']\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'No explicit question supplied; infer from the most recent user turn.'\n\nconst depth = args && typeof args === 'object' && args.depth\n ? String(args.depth)\n : 'standard'\nconst maxAngles = depth === 'quick' ? 2 : depth === 'deep' ? 6 : 4\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this research question. Return exactly ' + maxAngles + ' distinct angles worth investigating, ' +\n 'each with the single most decisive sub-question. Be concrete.\\\\n\\\\nQUESTION:\\\\n' +\n question,\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n angles: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n key_question: { type: 'string' },\n },\n required: ['title', 'key_question'],\n },\n },\n },\n required: ['angles'],\n },\n },\n)\n\nif (!frame || !frame.angles?.length) {\n return { ok: false, reason: 'framing failed', question, depth }\n}\n\nconst angles = frame.angles.slice(0, maxAngles)\n\nphase('Sweep')\nconst angleReports = await parallel(\n angles.map((a) => () =>\n agent(\n 'Investigate this angle. Use search and source-read tools liberally. Distinguish what you can confirm from what is conjecture.\\\\n\\\\n' +\n 'ANGLE: ' + a.title + '\\\\n' +\n 'KEY QUESTION: ' + a.key_question + '\\\\n\\\\n' +\n 'Return: 3–6 grounded findings (each with a 1-line claim and a source URL or file path), plus the strongest counter-evidence.',\n {\n label: a.title,\n toolset: RESEARCH_TOOLS,\n maxIterations: depth === 'deep' ? 40 : 30,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n confidence: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['claim', 'source', 'confidence'],\n },\n },\n counterEvidence: { type: 'string' },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Synthesize')\nconst live = angleReports.filter(Boolean)\nconst synthesis = await agent(\n 'Synthesize a cited research report from these angle-level findings. Drop unsupported or duplicate claims. Use the highest-confidence source per claim. ' +\n 'Explicitly list contradictions where angles disagree. Return: an executive summary (max 5 sentences), top findings with inline source URLs, open questions, and contradictions.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n\\\\n' +\n JSON.stringify({ angles, reports: live }, null, 2),\n {\n label: 'synthesis',\n schema: {\n type: 'object',\n properties: {\n executiveSummary: { type: 'string' },\n topFindings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n },\n required: ['claim', 'source'],\n },\n },\n openQuestions: { type: 'array', items: { type: 'string' } },\n contradictions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n topic: { type: 'string' },\n sides: { type: 'array', items: { type: 'string' } },\n },\n required: ['topic', 'sides'],\n },\n },\n },\n required: ['executiveSummary', 'topFindings'],\n },\n },\n)\n\nreturn {\n ok: true,\n question,\n depth,\n angleCount: angles.length,\n ...(synthesis ?? { executiveSummary: 'synthesis failed', topFindings: [], contradictions: [] }),\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,kBAAkB"}
1
+ {"version":3,"file":"research.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/research.ts"],"sourcesContent":["/**\n * Built-in workflow: `research`\n *\n * Multi-modal research sweep on a question (args.question). Fans out search /\n * exploration / source-reading angles in parallel, then synthesises a cited\n * report. Each angle is its own subagent so source reading does not pollute the\n * parent context.\n *\n * Args:\n * - question: research question\n * - depth: 'quick' (2 angles) | 'standard' (4) | 'deep' (6)\n */\n\nexport const RESEARCH_SCRIPT = `export const meta = {\n name: 'research',\n description: 'Multi-angle research on a question with parallel exploration and a cited synthesis.',\n whenToUse: 'User asks a non-trivial research question that benefits from multiple search angles or source reads.',\n examplePrompts: [\n { field: 'question', text: 'Compare Bun vs Node startup performance' },\n { field: 'question', text: 'What are the trade-offs of SQLite vs Postgres for this app?' },\n ],\n i18n: {\n zh: {\n description: '多角度并行调研一个问题,并产出带引用的综合报告。',\n whenToUse: '用户提出需要多角度检索、阅读来源的非平凡调研问题时。',\n examplePrompts: [\n { field: 'question', text: '比较 Bun 与 Node 的启动性能' },\n { field: 'question', text: '这个应用用 SQLite 还是 Postgres 各有什么权衡?' },\n ],\n },\n },\n tags: ['research', 'investigation'],\n estimatedAgents: { min: 4, max: 8 },\n phases: [\n { title: 'Frame' },\n { title: 'Sweep' },\n { title: 'Synthesize' },\n ],\n}\n\nconst RESEARCH_TOOLS = ['web_search', 'web_fetch', 'read_file', 'grep', 'find', 'list_dir']\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'No explicit question supplied; infer from the most recent user turn.'\n\nconst depth = args && typeof args === 'object' && args.depth\n ? String(args.depth)\n : 'standard'\nconst maxAngles = depth === 'quick' ? 2 : depth === 'deep' ? 6 : 4\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this research question. Return exactly ' + maxAngles + ' distinct angles worth investigating, ' +\n 'each with the single most decisive sub-question. Be concrete.\\\\n\\\\nQUESTION:\\\\n' +\n question,\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n angles: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n key_question: { type: 'string' },\n },\n required: ['title', 'key_question'],\n },\n },\n },\n required: ['angles'],\n },\n },\n)\n\nif (!frame || !frame.angles?.length) {\n return { ok: false, reason: 'framing failed', question, depth }\n}\n\nconst angles = frame.angles.slice(0, maxAngles)\n\nphase('Sweep')\nconst angleReports = await parallel(\n angles.map((a) => () =>\n agent(\n 'Investigate this angle. Use search and source-read tools liberally. Distinguish what you can confirm from what is conjecture.\\\\n\\\\n' +\n 'ANGLE: ' + a.title + '\\\\n' +\n 'KEY QUESTION: ' + a.key_question + '\\\\n\\\\n' +\n 'Return: 3–6 grounded findings (each with a 1-line claim and a source URL or file path), plus the strongest counter-evidence.',\n {\n label: a.title,\n toolset: RESEARCH_TOOLS,\n maxIterations: depth === 'deep' ? 40 : 30,\n schema: {\n type: 'object',\n properties: {\n findings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n confidence: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['claim', 'source', 'confidence'],\n },\n },\n counterEvidence: { type: 'string' },\n },\n required: ['findings'],\n },\n },\n ),\n ),\n)\n\nphase('Synthesize')\nconst live = angleReports.filter(Boolean)\nconst synthesis = await agent(\n 'Synthesize a cited research report from these angle-level findings. Drop unsupported or duplicate claims. Use the highest-confidence source per claim. ' +\n 'Explicitly list contradictions where angles disagree. Return: an executive summary (max 5 sentences), top findings with inline source URLs, open questions, and contradictions.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n\\\\n' +\n JSON.stringify({ angles, reports: live }, null, 2),\n {\n label: 'synthesis',\n schema: {\n type: 'object',\n properties: {\n executiveSummary: { type: 'string' },\n topFindings: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n claim: { type: 'string' },\n source: { type: 'string' },\n },\n required: ['claim', 'source'],\n },\n },\n openQuestions: { type: 'array', items: { type: 'string' } },\n contradictions: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n topic: { type: 'string' },\n sides: { type: 'array', items: { type: 'string' } },\n },\n required: ['topic', 'sides'],\n },\n },\n },\n required: ['executiveSummary', 'topFindings'],\n },\n },\n)\n\nreturn {\n ok: true,\n question,\n depth,\n angleCount: angles.length,\n ...(synthesis ?? { executiveSummary: 'synthesis failed', topFindings: [], contradictions: [] }),\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,kBAAkB"}
@@ -1,8 +1,8 @@
1
1
  import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
2
2
  import { BUILTIN_WORKFLOWS } from "./builtins/index.js";
3
3
  import { parseWorkflowScript } from "./parser.js";
4
- import { join } from "node:path";
5
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
5
+ import { join } from "node:path";
6
6
  //#region src/agent/workflow/catalog.ts
7
7
  /**
8
8
  * Catalog for named workflows.
@@ -1,3 +1,4 @@
1
+ export { applySubagentProgress } from './agent-progress.js';
1
2
  export { BUILTIN_WORKFLOWS, type BuiltinWorkflow } from './builtins/index.js';
2
3
  export { createWorkflowCatalog, defaultUserDir, type CatalogEntry, type LoadedWorkflow, type WorkflowCatalog, type WorkflowSource, } from './catalog.js';
3
4
  export { getLastWorkflowMemory, _resetLastWorkflowMemoryForTests, type LastWorkflowEntry, type LastWorkflowMemory, } from './last-run-memory.js';
@@ -8,4 +9,4 @@ export { emptySnapshotFor, runWorkflow, type RunWorkflowDeps, } from './runtime.
8
9
  export { createWorkflowSnapshot, previewValue, recomputeCounts, renderWorkflowText, type RenderOptions, } from './snapshot.js';
9
10
  export { createStructuredOutputTool, STRUCTURED_OUTPUT_TOOL_NAME, type CreateStructuredOutputToolOptions, type StructuredOutputCapture, } from './structured-output-tool.js';
10
11
  export { DelegateSubagentRunner, type DelegateSubagentRunnerDeps, } from './subagent-runner.js';
11
- export type { AgentScriptOptions, JsonSchema, SubagentRunner, SubagentRunOptions, WorkflowAgentSnapshot, WorkflowAgentStatus, WorkflowMeta, WorkflowMetaEstimatedAgents, WorkflowMetaPhase, WorkflowRunOptions, WorkflowRunResult, WorkflowSnapshot, } from './types.js';
12
+ export type { AgentScriptOptions, JsonSchema, SubagentRunner, SubagentRunOptions, SubagentProgressEvent, WorkflowAgentSnapshot, WorkflowAgentStatus, WorkflowAgentStep, WorkflowMeta, WorkflowMetaEstimatedAgents, WorkflowMetaPhase, WorkflowRunOptions, WorkflowRunResult, WorkflowSnapshot, } from './types.js';
@@ -1,10 +1,11 @@
1
+ import { applySubagentProgress } from "./agent-progress.js";
1
2
  import { BUILTIN_WORKFLOWS } from "./builtins/index.js";
2
3
  import { parseWorkflowScript } from "./parser.js";
3
4
  import { createWorkflowCatalog, defaultUserDir } from "./catalog.js";
4
5
  import { _resetLastWorkflowMemoryForTests, getLastWorkflowMemory } from "./last-run-memory.js";
6
+ import { emptySnapshotFor, runWorkflow } from "./runtime.js";
5
7
  import { createWorkflowSnapshot, previewValue, recomputeCounts, renderWorkflowText } from "./snapshot.js";
6
8
  import { WorkflowProgressBroker, _resetWorkflowProgressBrokerForTests, getWorkflowProgressBroker } from "./progress-broker.js";
7
- import { emptySnapshotFor, runWorkflow } from "./runtime.js";
8
9
  import { STRUCTURED_OUTPUT_TOOL_NAME, createStructuredOutputTool } from "./structured-output-tool.js";
9
10
  import { DelegateSubagentRunner } from "./subagent-runner.js";
10
- export { BUILTIN_WORKFLOWS, DelegateSubagentRunner, STRUCTURED_OUTPUT_TOOL_NAME, WorkflowProgressBroker, _resetLastWorkflowMemoryForTests, _resetWorkflowProgressBrokerForTests, createStructuredOutputTool, createWorkflowCatalog, createWorkflowSnapshot, defaultUserDir, emptySnapshotFor, getLastWorkflowMemory, getWorkflowProgressBroker, parseWorkflowScript, previewValue, recomputeCounts, renderWorkflowText, runWorkflow };
11
+ export { BUILTIN_WORKFLOWS, DelegateSubagentRunner, STRUCTURED_OUTPUT_TOOL_NAME, WorkflowProgressBroker, _resetLastWorkflowMemoryForTests, _resetWorkflowProgressBrokerForTests, applySubagentProgress, createStructuredOutputTool, createWorkflowCatalog, createWorkflowSnapshot, defaultUserDir, emptySnapshotFor, getLastWorkflowMemory, getWorkflowProgressBroker, parseWorkflowScript, previewValue, recomputeCounts, renderWorkflowText, runWorkflow };
@@ -0,0 +1,12 @@
1
+ import type { WorkflowMeta, WorkflowMetaExamplePrompt, WorkflowMetaLocale } from './types.js';
2
+ export type WorkflowLocaleCode = 'en' | 'zh';
3
+ export declare function normalizeWorkflowLocale(language: string | undefined): WorkflowLocaleCode;
4
+ export interface WorkflowLocalizedCopy {
5
+ description: string;
6
+ whenToUse?: string;
7
+ examplePrompts: WorkflowMetaExamplePrompt[];
8
+ }
9
+ export declare function resolveWorkflowLocalizedCopy(meta: Pick<WorkflowMeta, 'description' | 'whenToUse' | 'examplePrompts' | 'i18n'>, locale: WorkflowLocaleCode): WorkflowLocalizedCopy;
10
+ export declare function validateExamplePrompts(value: unknown, path: string): WorkflowMetaExamplePrompt[] | undefined;
11
+ export declare function validateMetaLocale(value: unknown, path: string): WorkflowMetaLocale;
12
+ export declare function validateMetaI18n(value: unknown): Record<string, WorkflowMetaLocale> | undefined;