@xopcai/xopc 0.0.142 → 0.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/activity-center-store-jITiX2vJ.js +1 -0
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BawPxiu5.js → agent-avatar-dicebear-DiME9u_P.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DzBXhZXO.js +2 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-81xd1p9R.js → app-management-settings-panel-Cuo7SbUP.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DYeQsYU8.js → appearance-settings-DUfdNQqk.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CKuKK5AU.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D_oa7oti.js → archive-plugin-B-Qk6cGr.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Cd-bwI2N.js → attachment-load-Di6EEbQX.js} +1 -1
- package/dist/gateway/static/root/assets/automation-suggestion-card-DGxvRxtO.js +1 -0
- package/dist/gateway/static/root/assets/automations-page-D-FF_WKV.js +4 -0
- package/dist/gateway/static/root/assets/{binary-plugins-O8svLKWw.js → binary-plugins-ZaOZDH2I.js} +1 -1
- package/dist/gateway/static/root/assets/block-editor-BTFhjWfg.js +184 -0
- package/dist/gateway/static/root/assets/browser-settings-page-BvKLdEQt.js +8 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-dJy1Eqgx.js → capability-presets-api-BU-pVZiZ.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DgyeEwzh.js +2 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-Bfuhp2ty.js → channel-recipient-api-DuulnhIj.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-BbVsdD_I.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-B5lVrUsN.js +1 -0
- package/dist/gateway/static/root/assets/check-BODqo66o.js +1 -0
- package/dist/gateway/static/root/assets/chunk-QUQL4437-DXsxWP7r.js +4 -0
- package/dist/gateway/static/root/assets/circle-alert-RzVebuX2.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-B8QqVy3I.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DFMfIb5F.js → desktop-pet---yzVxVR.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Dc3gqBJE.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BrYt1gAr.js → directory-picker-path-field-DCmOGLtK.js} +1 -1
- package/dist/gateway/static/root/assets/dreaming-settings-BgT5KZVe.js +3 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-Bh630pLD.js → extension-debug-page-ByaKTTq4.js} +1 -1
- package/dist/gateway/static/root/assets/extension-page-BmRzHAZr.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-JUtwIhbF.js +1 -0
- package/dist/gateway/static/root/assets/{fetch-B1WtuprY.js → fetch-8QNN25Sh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-De2N821l.js → gateway-config-api-CxicF50_.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-Bz2I_EO5.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-nEujFSDj.js → gateway-startup-retry-5YBnS9Fj.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-VcoyuZGN.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-Cilkap2G.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-DUy3eEse.js → goals-config-api-CwcHRdC0.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-C6eoni4z.js +2 -0
- package/dist/gateway/static/root/assets/goals-settings-o4i-qAOS.js +1 -0
- package/dist/gateway/static/root/assets/heartbeat-settings-DQQkETX8.js +1 -0
- package/dist/gateway/static/root/assets/index-BKRqeRHm.js +257 -0
- package/dist/gateway/static/root/assets/index-CphxClbs.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CVIwwM15.js → keyboard-shortcuts-settings-LT6qB-ua.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Dli2e3fS.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-B_6us9j7.js → markdown-split-Dw-yE2-y.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-D_fryIyj.js → media-plugins-D9NNNUgE.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CzKxM6I4.js +5 -0
- package/dist/gateway/static/root/assets/models-hub-panel-DVn2Q1Ik.js +2 -0
- package/dist/gateway/static/root/assets/notes-page-CRgbJGgk.js +1 -0
- package/dist/gateway/static/root/assets/notes-workbench-BxZRHLWx.js +2 -0
- package/dist/gateway/static/root/assets/{page-tabs-D_8jGlqx.js → page-tabs-D4hkWVt_.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BBLMK8Mp.js → preview-open-alternatives-CIckv0uy.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Doz53xLn.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DoMtcRLg.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BeHVEgrm.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-DVS3FR5r.js → save-bar-controls-B0b42kB2.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-D6vKd6-T.js → schedule-field-BtjEkczK.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BPy4lbIh.js → schema-form-Bf0bk3i6.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Bk4bQsBe.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DdFyaRMm.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-WzdikxPt.js → settings-collapsible-section-BTKTdTNX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-CvfzhBV-.js → settings-form-section-DL4P0sAj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BxR-Ulhi.js → settings-loading-skeleton-BV6KFNj4.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-B_4DsX5W.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-CKefvbYi.js → settings-page-layout-CyGlrInB.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DJ1_MLgX.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BQBV7YrV.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-0VuFLBeU.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DO87Ckeo.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-D3VdtxAn.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-BokgAgf7.js → system-settings-panel-D85fBBuI.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-BwHlNL3L.js → typed-models-lib-CwEuYrHX.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-DR11ap3A.js → use-channel-catalog-COXIfXcl.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-m9JVQ73F.js +1 -0
- package/dist/gateway/static/root/assets/user-profile-fields-editor-DtQiuY7E.js +1 -0
- package/dist/gateway/static/root/assets/user-profile-settings-panel-CWM0fEpb.js +1 -0
- package/dist/gateway/static/root/assets/{utils-BKUWB-TT.js → utils--BO6xT3u.js} +1 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-LoT3wgZ9.js +1 -0
- package/dist/gateway/static/root/assets/with-selector-aYPsXwdl.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-DSTMz_mO.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CL_rnAUB.js → workflow-run-setup-panel-B35lJzvm.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BfSm9oR8.js +11 -0
- package/dist/gateway/static/root/assets/workflows-page-DLioOiRN.css +1 -0
- package/dist/gateway/static/root/connector-icons/README.md +11 -0
- package/dist/gateway/static/root/connector-icons/airtable.svg +13 -0
- package/dist/gateway/static/root/connector-icons/asana.svg +15 -0
- package/dist/gateway/static/root/connector-icons/brave-search.svg +1 -0
- package/dist/gateway/static/root/connector-icons/clickup.svg +19 -0
- package/dist/gateway/static/root/connector-icons/composio.svg +266 -0
- package/dist/gateway/static/root/connector-icons/discord.svg +15 -0
- package/dist/gateway/static/root/connector-icons/dropbox.svg +152 -0
- package/dist/gateway/static/root/connector-icons/excel.svg +56 -0
- package/dist/gateway/static/root/connector-icons/fetch.svg +6 -0
- package/dist/gateway/static/root/connector-icons/figma.svg +178 -0
- package/dist/gateway/static/root/connector-icons/filesystem.svg +6 -0
- package/dist/gateway/static/root/connector-icons/github.svg +10 -0
- package/dist/gateway/static/root/connector-icons/gmail.svg +3 -0
- package/dist/gateway/static/root/connector-icons/google-calendar.svg +3 -0
- package/dist/gateway/static/root/connector-icons/google-docs.svg +25 -0
- package/dist/gateway/static/root/connector-icons/google-drive.svg +25 -0
- package/dist/gateway/static/root/connector-icons/google-sheets.svg +1 -0
- package/dist/gateway/static/root/connector-icons/hubspot.svg +142 -0
- package/dist/gateway/static/root/connector-icons/jira.svg +15 -0
- package/dist/gateway/static/root/connector-icons/linear.svg +5 -0
- package/dist/gateway/static/root/connector-icons/memory.svg +5 -0
- package/dist/gateway/static/root/connector-icons/microsoft-teams.svg +33 -0
- package/dist/gateway/static/root/connector-icons/notion.svg +5 -0
- package/dist/gateway/static/root/connector-icons/one-drive.svg +13 -0
- package/dist/gateway/static/root/connector-icons/outlook.svg +76 -0
- package/dist/gateway/static/root/connector-icons/playwright.svg +9 -0
- package/dist/gateway/static/root/connector-icons/salesforce.svg +17 -0
- package/dist/gateway/static/root/connector-icons/sequential-thinking.svg +8 -0
- package/dist/gateway/static/root/connector-icons/shopify.svg +5 -0
- package/dist/gateway/static/root/connector-icons/slack.svg +9 -0
- package/dist/gateway/static/root/connector-icons/spotify.svg +43 -0
- package/dist/gateway/static/root/connector-icons/stripe.svg +11 -0
- package/dist/gateway/static/root/connector-icons/telegram.svg +130 -0
- package/dist/gateway/static/root/connector-icons/time.svg +6 -0
- package/dist/gateway/static/root/connector-icons/todoist.svg +277 -0
- package/dist/gateway/static/root/connector-icons/trello.svg +19 -0
- package/dist/gateway/static/root/connector-icons/twitter.svg +128 -0
- package/dist/gateway/static/root/connector-icons/whatsapp.svg +61 -0
- package/dist/gateway/static/root/connector-icons/youtube.svg +11 -0
- package/dist/gateway/static/root/index.html +9 -6
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +2 -0
- package/dist/src/agent/agent-manager.js +8 -0
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +3 -2
- package/dist/src/agent/background-review/prompts.js.map +1 -1
- package/dist/src/agent/embedded/session-tool-result-guard.js +1 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.d.ts +9 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +71 -3
- package/dist/src/agent/embedded/xopc-tools-bridge.js.map +1 -1
- package/dist/src/agent/goals/post-turn.js +5 -4
- package/dist/src/agent/goals/post-turn.js.map +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +4 -1
- package/dist/src/agent/mcp/mcp-transport.js.map +1 -1
- package/dist/src/agent/memory/context/planner.d.ts +1 -0
- package/dist/src/agent/memory/context/planner.js +60 -14
- package/dist/src/agent/memory/context/planner.js.map +1 -1
- package/dist/src/agent/memory/context/types.d.ts +3 -1
- package/dist/src/agent/memory/lifecycle.d.ts +11 -0
- package/dist/src/agent/memory/lifecycle.js +50 -0
- package/dist/src/agent/memory/lifecycle.js.map +1 -0
- package/dist/src/agent/memory/source-origin.d.ts +3 -0
- package/dist/src/agent/memory/source-origin.js +19 -0
- package/dist/src/agent/memory/source-origin.js.map +1 -0
- package/dist/src/agent/memory/understanding/service.js +5 -0
- package/dist/src/agent/memory/understanding/service.js.map +1 -1
- package/dist/src/agent/memory/user-context-coordinator.js +7 -2
- package/dist/src/agent/memory/user-context-coordinator.js.map +1 -1
- package/dist/src/agent/prompt/sections/behavior.d.ts +2 -0
- package/dist/src/agent/prompt/sections/behavior.js +30 -1
- package/dist/src/agent/prompt/sections/behavior.js.map +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js.map +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +8 -1
- package/dist/src/agent/prompt/service-prompt-builder.js.map +1 -1
- package/dist/src/agent/prompt/system-prompt.d.ts +2 -0
- package/dist/src/agent/prompt/system-prompt.js +6 -3
- package/dist/src/agent/prompt/system-prompt.js.map +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +22 -0
- package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +9 -3
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/starter-agents.js +1 -1
- package/dist/src/agent/starter-agents.js.map +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js.map +1 -1
- package/dist/src/agent/tools/composio-tool.d.ts +18 -5
- package/dist/src/agent/tools/composio-tool.js +252 -35
- package/dist/src/agent/tools/composio-tool.js.map +1 -1
- package/dist/src/agent/tools/factory.js +7 -3
- package/dist/src/agent/tools/factory.js.map +1 -1
- package/dist/src/agent/tools/index.d.ts +1 -1
- package/dist/src/agent/tools/index.js +2 -2
- package/dist/src/agent/tools/workflow-tool.d.ts +0 -1
- package/dist/src/agent/tools/workflow-tool.js +3 -16
- package/dist/src/agent/tools/workflow-tool.js.map +1 -1
- package/dist/src/agent/workflow/builtins/index.d.ts +2 -28
- package/dist/src/agent/workflow/builtins/index.js +226 -41
- package/dist/src/agent/workflow/builtins/index.js.map +1 -1
- package/dist/src/agent/workflow/catalog.d.ts +32 -34
- package/dist/src/agent/workflow/catalog.js +158 -154
- package/dist/src/agent/workflow/catalog.js.map +1 -1
- package/dist/src/agent/workflow/index.d.ts +4 -6
- package/dist/src/agent/workflow/index.js +2 -5
- package/dist/src/agent/workflow/snapshot.d.ts +2 -2
- package/dist/src/agent/workflow/snapshot.js +2 -2
- package/dist/src/agent/workflow/snapshot.js.map +1 -1
- package/dist/src/agent/workflow/structured-output-tool.d.ts +2 -2
- package/dist/src/agent/workflow/structured-output-tool.js +2 -2
- package/dist/src/agent/workflow/structured-output-tool.js.map +1 -1
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent/workflow/types.d.ts +31 -26
- package/dist/src/agent-manifest/index.d.ts +1 -0
- package/dist/src/agent-manifest/index.js +3 -1
- package/dist/src/agent-manifest/index.js.map +1 -1
- package/dist/src/agent-manifest/preset-chain.d.ts +10 -0
- package/dist/src/agent-manifest/preset-chain.js +32 -0
- package/dist/src/agent-manifest/preset-chain.js.map +1 -0
- package/dist/src/agent-manifest/resolver.js +3 -10
- package/dist/src/agent-manifest/resolver.js.map +1 -1
- package/dist/src/agent-manifest/schema.d.ts +4 -4
- package/dist/src/automations/api/routes.js +13 -1
- package/dist/src/automations/api/routes.js.map +1 -1
- package/dist/src/automations/domain/validation.d.ts +14 -14
- package/dist/src/automations/draft/automation-draft-validator.d.ts +3 -3
- package/dist/src/browser/providers/browser-ext-install.d.ts +11 -1
- package/dist/src/browser/providers/browser-ext-install.js +39 -14
- package/dist/src/browser/providers/browser-ext-install.js.map +1 -1
- package/dist/src/capabilities/store-connector.d.ts +0 -1
- package/dist/src/capabilities/store-connector.js +3 -5
- package/dist/src/capabilities/store-connector.js.map +1 -1
- package/dist/src/chat-commands/builtins/review.js +72 -73
- package/dist/src/chat-commands/builtins/review.js.map +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +9 -54
- package/dist/src/chat-commands/builtins/workflow.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-create.js +2 -2
- package/dist/src/cli/commands/extension-create.js.map +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +42 -36
- package/dist/src/cli/commands/extension-marketplace.js.map +1 -1
- package/dist/src/cli/commands/extension-pack.d.ts +6 -0
- package/dist/src/cli/commands/extension-pack.js +3 -2
- package/dist/src/cli/commands/extension-pack.js.map +1 -1
- package/dist/src/commands/agents.config.d.ts +1 -0
- package/dist/src/commands/agents.config.js +1 -0
- package/dist/src/commands/agents.config.js.map +1 -1
- package/dist/src/config/schema.d.ts +6 -6
- package/dist/src/config/schema.js +6 -22
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/config/web-patch.d.ts +1 -1
- package/dist/src/connectors/approval.d.ts +2 -0
- package/dist/src/connectors/approval.js +33 -0
- package/dist/src/connectors/approval.js.map +1 -0
- package/dist/src/connectors/auth-provider-registry.d.ts +9 -0
- package/dist/src/connectors/auth-provider-registry.js +17 -0
- package/dist/src/connectors/auth-provider-registry.js.map +1 -0
- package/dist/src/connectors/builtin-catalog.js +55 -116
- package/dist/src/connectors/builtin-catalog.js.map +1 -1
- package/dist/src/connectors/catalog.js +7 -2
- package/dist/src/connectors/catalog.js.map +1 -1
- package/dist/src/connectors/composio-catalog.d.ts +19 -0
- package/dist/src/connectors/composio-catalog.js +237 -0
- package/dist/src/connectors/composio-catalog.js.map +1 -0
- package/dist/src/connectors/composio-logo.d.ts +1 -0
- package/dist/src/connectors/composio-logo.js +51 -0
- package/dist/src/connectors/composio-logo.js.map +1 -0
- package/dist/src/connectors/composio-sessions.d.ts +116 -0
- package/dist/src/connectors/composio-sessions.js +296 -0
- package/dist/src/connectors/composio-sessions.js.map +1 -0
- package/dist/src/connectors/composio-triggers.d.ts +17 -0
- package/dist/src/connectors/composio-triggers.js +48 -5
- package/dist/src/connectors/composio-triggers.js.map +1 -1
- package/dist/src/connectors/composio.d.ts +31 -2
- package/dist/src/connectors/composio.js +374 -151
- package/dist/src/connectors/composio.js.map +1 -1
- package/dist/src/connectors/connector-memory-sync.d.ts +15 -0
- package/dist/src/connectors/connector-memory-sync.js +90 -0
- package/dist/src/connectors/connector-memory-sync.js.map +1 -0
- package/dist/src/connectors/install.js +35 -92
- package/dist/src/connectors/install.js.map +1 -1
- package/dist/src/connectors/instances.js +6 -2
- package/dist/src/connectors/instances.js.map +1 -1
- package/dist/src/connectors/integration-strategy.d.ts +3 -0
- package/dist/src/connectors/integration-strategy.js +29 -0
- package/dist/src/connectors/integration-strategy.js.map +1 -0
- package/dist/src/connectors/policy.d.ts +13 -0
- package/dist/src/connectors/policy.js +48 -0
- package/dist/src/connectors/policy.js.map +1 -0
- package/dist/src/connectors/providers.js +1 -1
- package/dist/src/connectors/runtime-adapter-registry.d.ts +25 -0
- package/dist/src/connectors/runtime-adapter-registry.js +154 -0
- package/dist/src/connectors/runtime-adapter-registry.js.map +1 -0
- package/dist/src/connectors/types.d.ts +113 -4
- package/dist/src/connectors/workflow-preflight.d.ts +20 -0
- package/dist/src/connectors/workflow-preflight.js +70 -0
- package/dist/src/connectors/workflow-preflight.js.map +1 -0
- package/dist/src/extensions/install-transaction.d.ts +16 -0
- package/dist/src/extensions/install-transaction.js +76 -0
- package/dist/src/extensions/install-transaction.js.map +1 -0
- package/dist/src/extensions/install.d.ts +2 -0
- package/dist/src/extensions/install.js +23 -1
- package/dist/src/extensions/install.js.map +1 -1
- package/dist/src/gateway/agents-admin.d.ts +2 -0
- package/dist/src/gateway/agents-admin.js +7 -0
- package/dist/src/gateway/agents-admin.js.map +1 -1
- package/dist/src/gateway/capability-presets-admin.d.ts +11 -0
- package/dist/src/gateway/capability-presets-admin.js +11 -4
- package/dist/src/gateway/capability-presets-admin.js.map +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +17 -0
- package/dist/src/gateway/chat-stream/mapper.js.map +1 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +18 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -3
- package/dist/src/gateway/hono/routes/agents.js +3 -0
- package/dist/src/gateway/hono/routes/agents.js.map +1 -1
- package/dist/src/gateway/hono/routes/capability-presets.js +19 -1
- package/dist/src/gateway/hono/routes/capability-presets.js.map +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +188 -25
- package/dist/src/gateway/hono/routes/connectors.js.map +1 -1
- package/dist/src/gateway/hono/routes/goals.js +22 -3
- package/dist/src/gateway/hono/routes/goals.js.map +1 -1
- package/dist/src/gateway/hono/routes/home.d.ts +60 -1
- package/dist/src/gateway/hono/routes/home.js +244 -18
- package/dist/src/gateway/hono/routes/home.js.map +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
- package/dist/src/gateway/hono/routes/memory.js +14 -1
- package/dist/src/gateway/hono/routes/memory.js.map +1 -1
- package/dist/src/gateway/hono/routes/projects.js +103 -2
- package/dist/src/gateway/hono/routes/projects.js.map +1 -1
- package/dist/src/gateway/hono/routes/public-gateway.js +93 -0
- package/dist/src/gateway/hono/routes/public-gateway.js.map +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +137 -22
- package/dist/src/gateway/hono/routes/workflows.js.map +1 -1
- package/dist/src/gateway/hono/routes/you.d.ts +23 -0
- package/dist/src/gateway/hono/routes/you.js +538 -0
- package/dist/src/gateway/hono/routes/you.js.map +1 -0
- package/dist/src/gateway/hono/sse.d.ts +2 -1
- package/dist/src/gateway/hono/sse.js +2 -1
- package/dist/src/gateway/hono/sse.js.map +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +13 -1
- package/dist/src/gateway/service/marketplace-service.js +96 -40
- package/dist/src/gateway/service/marketplace-service.js.map +1 -1
- package/dist/src/gateway/service.d.ts +2 -0
- package/dist/src/gateway/service.js +7 -1
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/goals/goal-service.d.ts +7 -5
- package/dist/src/goals/goal-service.js +25 -13
- package/dist/src/goals/goal-service.js.map +1 -1
- package/dist/src/goals/goal-store.js +46 -7
- package/dist/src/goals/goal-store.js.map +1 -1
- package/dist/src/goals/types.d.ts +24 -0
- package/dist/src/storage/sqlite/connector-repository.d.ts +49 -0
- package/dist/src/storage/sqlite/connector-repository.js +385 -0
- package/dist/src/storage/sqlite/connector-repository.js.map +1 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -0
- package/dist/src/storage/sqlite/index.js +4 -1
- package/dist/src/storage/sqlite/migrations/030_connectors.sql +94 -0
- package/dist/src/storage/sqlite/migrations/031_connector_approvals.sql +24 -0
- package/dist/src/storage/sqlite/migrations/032_connector_webhook_deliveries.sql +15 -0
- package/dist/src/storage/sqlite/migrations/033_user_trust_policies.sql +6 -0
- package/dist/src/storage/sqlite/migrations/034_allow_global_auto_trust.sql +14 -0
- package/dist/src/storage/sqlite/migrations/035_user_profile_prompt_state.sql +7 -0
- package/dist/src/storage/sqlite/migrations/036_goal_outcome_metric.sql +12 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.js.map +1 -1
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/user-profile-setup-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/user-profile-setup-repository.js +34 -0
- package/dist/src/storage/sqlite/user-profile-setup-repository.js.map +1 -0
- package/dist/src/storage/sqlite/user-trust-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/user-trust-repository.js +34 -0
- package/dist/src/storage/sqlite/user-trust-repository.js.map +1 -0
- package/dist/src/tui/components/assistant-message.js +15 -0
- package/dist/src/tui/components/assistant-message.js.map +1 -1
- package/dist/src/tui/tui-agent-events.js +85 -1
- package/dist/src/tui/tui-agent-events.js.map +1 -1
- package/dist/src/tui/tui-command-formatters.js +7 -7
- package/dist/src/tui/tui-command-formatters.js.map +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/user-context/import.d.ts +12 -0
- package/dist/src/user-context/import.js +48 -0
- package/dist/src/user-context/import.js.map +1 -0
- package/dist/src/user-context/profile.d.ts +37 -0
- package/dist/src/user-context/profile.js +165 -0
- package/dist/src/user-context/profile.js.map +1 -0
- package/dist/src/user-context/projection.d.ts +54 -0
- package/dist/src/user-context/projection.js +121 -0
- package/dist/src/user-context/projection.js.map +1 -0
- package/dist/src/user-context/source-recommendations.d.ts +13 -0
- package/dist/src/user-context/source-recommendations.js +86 -0
- package/dist/src/user-context/source-recommendations.js.map +1 -0
- package/dist/src/user-context/trust-policy.d.ts +11 -0
- package/dist/src/user-context/trust-policy.js +31 -0
- package/dist/src/user-context/trust-policy.js.map +1 -0
- package/dist/src/workflows/authoring/index.d.ts +1 -0
- package/dist/src/workflows/authoring/index.js +2 -0
- package/dist/src/workflows/authoring/workflow-draft-store.d.ts +33 -0
- package/dist/src/workflows/authoring/workflow-draft-store.js +74 -0
- package/dist/src/workflows/authoring/workflow-draft-store.js.map +1 -0
- package/dist/src/workflows/domain/definition-utils.d.ts +6 -4
- package/dist/src/workflows/domain/definition-utils.js +28 -26
- package/dist/src/workflows/domain/definition-utils.js.map +1 -1
- package/dist/src/workflows/domain/definition.d.ts +79 -6
- package/dist/src/workflows/domain/event.d.ts +18 -2
- package/dist/src/workflows/domain/index.js +3 -3
- package/dist/src/workflows/domain/run.d.ts +16 -2
- package/dist/src/workflows/domain/run.js.map +1 -1
- package/dist/src/workflows/domain/validation.d.ts +9 -5
- package/dist/src/workflows/domain/validation.js +183 -40
- package/dist/src/workflows/domain/validation.js.map +1 -1
- package/dist/src/workflows/draft/workflow-draft-prompt.d.ts +2 -3
- package/dist/src/workflows/draft/workflow-draft-prompt.js +31 -73
- package/dist/src/workflows/draft/workflow-draft-prompt.js.map +1 -1
- package/dist/src/workflows/draft/workflow-draft-service.js +4 -8
- package/dist/src/workflows/draft/workflow-draft-service.js.map +1 -1
- package/dist/src/workflows/draft/workflow-draft-validator.js +29 -37
- package/dist/src/workflows/draft/workflow-draft-validator.js.map +1 -1
- package/dist/src/workflows/draft/workflow-draft.types.d.ts +4 -4
- package/dist/src/workflows/engine/projector.js +43 -1
- package/dist/src/workflows/engine/projector.js.map +1 -1
- package/dist/src/workflows/engine/workflow-engine.d.ts +2 -3
- package/dist/src/workflows/engine/workflow-engine.js +24 -4
- package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
- package/dist/src/workflows/index.js +4 -7
- package/dist/src/workflows/registry/catalog-workflow-definition-registry.js +1 -9
- package/dist/src/workflows/registry/catalog-workflow-definition-registry.js.map +1 -1
- package/dist/src/workflows/runtime/graph-workflow-runtime.d.ts +10 -0
- package/dist/src/workflows/runtime/graph-workflow-runtime.js +295 -0
- package/dist/src/workflows/runtime/graph-workflow-runtime.js.map +1 -0
- package/dist/src/workflows/runtime/index.d.ts +1 -2
- package/dist/src/workflows/runtime/index.js +2 -5
- package/dist/src/workflows/runtime/workflow-runtime-port.d.ts +5 -8
- package/dist/src/workflows/service/workflow-run-service.js +15 -1
- package/dist/src/workflows/service/workflow-run-service.js.map +1 -1
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +2 -1
- package/package.json +4 -3
- package/dist/gateway/static/root/assets/agents-CyvCIHnB.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-DK_Vx6nl.js +0 -1
- package/dist/gateway/static/root/assets/automation-suggestion-card-B1LV3YYv.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-fzrovqhv.js +0 -4
- package/dist/gateway/static/root/assets/block-editor-Dhj5f4Bx.js +0 -184
- package/dist/gateway/static/root/assets/browser-settings-page-BDn-n-UB.js +0 -8
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Co5ipo_Q.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-BWlpaxg9.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-D_jkIZLV.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BcekbW4q.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-settings-BJCUuL8Y.js +0 -1
- package/dist/gateway/static/root/assets/dreaming-settings-BN1Z2mIo.js +0 -3
- package/dist/gateway/static/root/assets/extension-page-B-1KxvVy.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BF9NACI3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DN9sNREz.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-BpoQW8cD.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-CBRSPd0b.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BCcBi407.js +0 -2
- package/dist/gateway/static/root/assets/goals-settings-pkTXzXkh.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-ezsufgLQ.js +0 -1
- package/dist/gateway/static/root/assets/index-B8s8Pq5U.css +0 -1
- package/dist/gateway/static/root/assets/index-DcUaXYeb.js +0 -262
- package/dist/gateway/static/root/assets/logs-page-DQtTRXtj.js +0 -7
- package/dist/gateway/static/root/assets/messages-BXNELNBa.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-panel-BP2M9n6Q.js +0 -2
- package/dist/gateway/static/root/assets/notes-page-CspveYaO.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-BHwzJ0OC.js +0 -2
- package/dist/gateway/static/root/assets/project-detail-page-Dy3rsobs.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CWKpPE0L.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CqNRyXEo.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-MEME7ivF.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-JVd0qaSF.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-DYEbB1EV.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-dWN8BJ3z.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-D8foINzP.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Tgbv1s7G.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-D_YK0b_Z.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DGytfoZK.js +0 -2
- package/dist/gateway/static/root/assets/toast-z0toXu32.js +0 -1
- package/dist/gateway/static/root/assets/user-profile-settings-panel-8YtygcJp.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BVH71EFf.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-JeTE7XNM.js +0 -1
- package/dist/gateway/static/root/assets/workflow-start-dialog-_u8Uc1ze.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-ixgk_y1l.js +0 -18
- package/dist/src/agent/workflow/builtins/audit-repo.d.ts +0 -13
- package/dist/src/agent/workflow/builtins/audit-repo.js +0 -183
- package/dist/src/agent/workflow/builtins/audit-repo.js.map +0 -1
- package/dist/src/agent/workflow/builtins/client-proposal.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/client-proposal.js +0 -164
- package/dist/src/agent/workflow/builtins/client-proposal.js.map +0 -1
- package/dist/src/agent/workflow/builtins/competitor-scan.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/competitor-scan.js +0 -164
- package/dist/src/agent/workflow/builtins/competitor-scan.js.map +0 -1
- package/dist/src/agent/workflow/builtins/content-draft.d.ts +0 -13
- package/dist/src/agent/workflow/builtins/content-draft.js +0 -159
- package/dist/src/agent/workflow/builtins/content-draft.js.map +0 -1
- package/dist/src/agent/workflow/builtins/content-repurpose.d.ts +0 -11
- package/dist/src/agent/workflow/builtins/content-repurpose.js +0 -146
- package/dist/src/agent/workflow/builtins/content-repurpose.js.map +0 -1
- package/dist/src/agent/workflow/builtins/debug-incident.d.ts +0 -13
- package/dist/src/agent/workflow/builtins/debug-incident.js +0 -177
- package/dist/src/agent/workflow/builtins/debug-incident.js.map +0 -1
- package/dist/src/agent/workflow/builtins/decision-compare.d.ts +0 -13
- package/dist/src/agent/workflow/builtins/decision-compare.js +0 -187
- package/dist/src/agent/workflow/builtins/decision-compare.js.map +0 -1
- package/dist/src/agent/workflow/builtins/implementation-plan.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/implementation-plan.js +0 -185
- package/dist/src/agent/workflow/builtins/implementation-plan.js.map +0 -1
- package/dist/src/agent/workflow/builtins/inbox-triage.d.ts +0 -11
- package/dist/src/agent/workflow/builtins/inbox-triage.js +0 -158
- package/dist/src/agent/workflow/builtins/inbox-triage.js.map +0 -1
- package/dist/src/agent/workflow/builtins/meeting-prep.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/meeting-prep.js +0 -152
- package/dist/src/agent/workflow/builtins/meeting-prep.js.map +0 -1
- package/dist/src/agent/workflow/builtins/multi-perspective-review.d.ts +0 -14
- package/dist/src/agent/workflow/builtins/multi-perspective-review.js +0 -171
- package/dist/src/agent/workflow/builtins/multi-perspective-review.js.map +0 -1
- package/dist/src/agent/workflow/builtins/offer-design.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/offer-design.js +0 -170
- package/dist/src/agent/workflow/builtins/offer-design.js.map +0 -1
- package/dist/src/agent/workflow/builtins/pr-review.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/pr-review.js +0 -178
- package/dist/src/agent/workflow/builtins/pr-review.js.map +0 -1
- package/dist/src/agent/workflow/builtins/release-check.d.ts +0 -11
- package/dist/src/agent/workflow/builtins/release-check.js +0 -174
- package/dist/src/agent/workflow/builtins/release-check.js.map +0 -1
- package/dist/src/agent/workflow/builtins/research.d.ts +0 -13
- package/dist/src/agent/workflow/builtins/research.js +0 -188
- package/dist/src/agent/workflow/builtins/research.js.map +0 -1
- package/dist/src/agent/workflow/builtins/weekly-review.d.ts +0 -12
- package/dist/src/agent/workflow/builtins/weekly-review.js +0 -139
- package/dist/src/agent/workflow/builtins/weekly-review.js.map +0 -1
- package/dist/src/agent/workflow/last-run-memory.d.ts +0 -42
- package/dist/src/agent/workflow/last-run-memory.js +0 -60
- package/dist/src/agent/workflow/last-run-memory.js.map +0 -1
- package/dist/src/agent/workflow/lint.d.ts +0 -38
- package/dist/src/agent/workflow/lint.js +0 -74
- package/dist/src/agent/workflow/lint.js.map +0 -1
- package/dist/src/agent/workflow/meta-locale.d.ts +0 -12
- package/dist/src/agent/workflow/meta-locale.js +0 -62
- package/dist/src/agent/workflow/meta-locale.js.map +0 -1
- package/dist/src/agent/workflow/parser.d.ts +0 -20
- package/dist/src/agent/workflow/parser.js +0 -152
- package/dist/src/agent/workflow/parser.js.map +0 -1
- package/dist/src/agent/workflow/runtime.d.ts +0 -34
- package/dist/src/agent/workflow/runtime.js +0 -402
- package/dist/src/agent/workflow/runtime.js.map +0 -1
- package/dist/src/connectors/oauth.d.ts +0 -22
- package/dist/src/connectors/oauth.js +0 -99
- package/dist/src/connectors/oauth.js.map +0 -1
- package/dist/src/workflows/runtime/script-runtime.d.ts +0 -3
- package/dist/src/workflows/runtime/script-runtime.js +0 -3
- package/dist/src/workflows/runtime/script-workflow-runtime.d.ts +0 -5
- package/dist/src/workflows/runtime/script-workflow-runtime.js +0 -15
- package/dist/src/workflows/runtime/script-workflow-runtime.js.map +0 -1
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
//#region src/agent/workflow/builtins/multi-perspective-review.ts
|
|
2
|
-
/**
|
|
3
|
-
* Built-in workflow: `multi_perspective_review`
|
|
4
|
-
*
|
|
5
|
-
* Reviews a target (file, PR, design doc, plan — passed via args.target) from
|
|
6
|
-
* several independent perspectives, then asks an adversarial judge to decide
|
|
7
|
-
* what would actually break in practice. Useful for sanity-checking decisions
|
|
8
|
-
* before they ship.
|
|
9
|
-
*
|
|
10
|
-
* Args:
|
|
11
|
-
* - target: what to review
|
|
12
|
-
* - lenses: optional array of { name, angle } to override default lenses
|
|
13
|
-
* - skipAdversarial: when true, skip the adversarial judge phase
|
|
14
|
-
*/
|
|
15
|
-
const MULTI_PERSPECTIVE_REVIEW_SCRIPT = `export const meta = {
|
|
16
|
-
name: 'multi_perspective_review',
|
|
17
|
-
description: 'Review a target from N independent perspectives, then adversarially judge what would actually break.',
|
|
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
|
-
},
|
|
33
|
-
tags: ['review', 'planning', 'decision'],
|
|
34
|
-
estimatedAgents: { min: 5, max: 6 },
|
|
35
|
-
phases: [
|
|
36
|
-
{ title: 'Lenses' },
|
|
37
|
-
{ title: 'Adversarial' },
|
|
38
|
-
{ title: 'Synthesize' },
|
|
39
|
-
],
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']
|
|
43
|
-
|
|
44
|
-
const target = args && typeof args === 'object' && args.target
|
|
45
|
-
? String(args.target)
|
|
46
|
-
: 'No explicit target was provided. Treat the currently focused file or recent context as the target.'
|
|
47
|
-
|
|
48
|
-
const skipAdversarial = Boolean(args && typeof args === 'object' && args.skipAdversarial)
|
|
49
|
-
|
|
50
|
-
const DEFAULT_LENSES = [
|
|
51
|
-
{ name: 'User', angle: 'How a real user experiences this. Friction, confusion, surprise paths, accessibility.' },
|
|
52
|
-
{ name: 'Operator', angle: 'How an on-call engineer experiences this in production. Failure modes, observability, rollback.' },
|
|
53
|
-
{ name: 'Skeptic', angle: 'Hidden assumptions. What is being implied but not stated. What would break under load or weird input.' },
|
|
54
|
-
{ name: 'Maintainer', angle: 'Six-month-later view. Clarity, naming, layering, ease of changing nearby code.' },
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
let lenses = DEFAULT_LENSES
|
|
58
|
-
if (args && typeof args === 'object' && Array.isArray(args.lenses) && args.lenses.length) {
|
|
59
|
-
lenses = args.lenses
|
|
60
|
-
.filter((l) => l && typeof l === 'object' && l.name && l.angle)
|
|
61
|
-
.map((l) => ({ name: String(l.name), angle: String(l.angle) }))
|
|
62
|
-
if (!lenses.length) lenses = DEFAULT_LENSES
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
phase('Lenses')
|
|
66
|
-
const lensViews = await parallel(
|
|
67
|
-
lenses.map((l) => () =>
|
|
68
|
-
agent(
|
|
69
|
-
'Review the following target through the ' + l.name + ' lens.\\n' +
|
|
70
|
-
'Lens focus: ' + l.angle + '\\n\\n' +
|
|
71
|
-
'TARGET:\\n' + target + '\\n\\n' +
|
|
72
|
-
'Return 3–7 concrete observations. Each entry: title (5–10 words), why-it-matters (1 sentence), risk (low/med/high).',
|
|
73
|
-
{
|
|
74
|
-
label: l.name + ' lens',
|
|
75
|
-
toolset: READ_ONLY_TOOLS,
|
|
76
|
-
schema: {
|
|
77
|
-
type: 'object',
|
|
78
|
-
properties: {
|
|
79
|
-
observations: {
|
|
80
|
-
type: 'array',
|
|
81
|
-
items: {
|
|
82
|
-
type: 'object',
|
|
83
|
-
properties: {
|
|
84
|
-
title: { type: 'string' },
|
|
85
|
-
why: { type: 'string' },
|
|
86
|
-
risk: { type: 'string', enum: ['low', 'med', 'high'] },
|
|
87
|
-
},
|
|
88
|
-
required: ['title', 'why', 'risk'],
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
required: ['observations'],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
),
|
|
96
|
-
),
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
const valid = lensViews.filter(Boolean)
|
|
100
|
-
const allObs = valid.flatMap((v, i) =>
|
|
101
|
-
(v?.observations ?? []).map((o) => ({ lens: lenses[i].name, ...o })),
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
let verdict = null
|
|
105
|
-
if (!skipAdversarial) {
|
|
106
|
-
phase('Adversarial')
|
|
107
|
-
verdict = await agent(
|
|
108
|
-
'You are an adversarial judge. Given these multi-lens observations of a target, decide which would actually cause real harm if shipped as-is. ' +
|
|
109
|
-
'Default to realRisk=false unless an observation has clear, mechanism-level evidence. ' +
|
|
110
|
-
'Rate evidenceStrength as weak | moderate | strong.\\n\\n' +
|
|
111
|
-
JSON.stringify(allObs, null, 2),
|
|
112
|
-
{
|
|
113
|
-
label: 'adversarial verdict',
|
|
114
|
-
schema: {
|
|
115
|
-
type: 'object',
|
|
116
|
-
properties: {
|
|
117
|
-
verdicts: {
|
|
118
|
-
type: 'array',
|
|
119
|
-
items: {
|
|
120
|
-
type: 'object',
|
|
121
|
-
properties: {
|
|
122
|
-
title: { type: 'string' },
|
|
123
|
-
lens: { type: 'string' },
|
|
124
|
-
realRisk: { type: 'boolean' },
|
|
125
|
-
evidenceStrength: { type: 'string', enum: ['weak', 'moderate', 'strong'] },
|
|
126
|
-
reason: { type: 'string' },
|
|
127
|
-
},
|
|
128
|
-
required: ['title', 'lens', 'realRisk', 'evidenceStrength', 'reason'],
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
required: ['verdicts'],
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
phase('Synthesize')
|
|
139
|
-
const confirmed = (verdict?.verdicts ?? []).filter((v) => v.realRisk)
|
|
140
|
-
const goNoGo = skipAdversarial
|
|
141
|
-
? (allObs.some((o) => o.risk === 'high') ? 'fix_first' : 'ship')
|
|
142
|
-
: confirmed.some((v) => v.evidenceStrength === 'strong')
|
|
143
|
-
? 'fix_first'
|
|
144
|
-
: confirmed.length
|
|
145
|
-
? 'fix_first'
|
|
146
|
-
: 'ship'
|
|
147
|
-
|
|
148
|
-
const output = {
|
|
149
|
-
ok: true,
|
|
150
|
-
target,
|
|
151
|
-
lenses: lenses.map((l) => l.name),
|
|
152
|
-
skipAdversarial,
|
|
153
|
-
observationCount: allObs.length,
|
|
154
|
-
confirmedRiskCount: confirmed.length,
|
|
155
|
-
goNoGo,
|
|
156
|
-
topRisks: confirmed.slice(0, 10),
|
|
157
|
-
allVerdicts: verdict?.verdicts ?? [],
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
summary: output.goNoGo === 'ship' ? 'No confirmed blocking risks.' : 'Confirmed risks need attention before shipping.',
|
|
161
|
-
sections: [
|
|
162
|
-
{ kind: 'risks', title: 'Top risks', items: output.topRisks.map((item) => ({ title: item.title, severity: item.evidenceStrength === 'strong' ? 'high' : 'medium', detail: item.reason })) },
|
|
163
|
-
{ kind: 'json', title: 'All verdicts', value: output.allVerdicts },
|
|
164
|
-
],
|
|
165
|
-
structuredOutput: output,
|
|
166
|
-
}
|
|
167
|
-
`;
|
|
168
|
-
//#endregion
|
|
169
|
-
export { MULTI_PERSPECTIVE_REVIEW_SCRIPT };
|
|
170
|
-
|
|
171
|
-
//# sourceMappingURL=multi-perspective-review.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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\nconst output = {\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}\nreturn {\n summary: output.goNoGo === 'ship' ? 'No confirmed blocking risks.' : 'Confirmed risks need attention before shipping.',\n sections: [\n { kind: 'risks', title: 'Top risks', items: output.topRisks.map((item) => ({ title: item.title, severity: item.evidenceStrength === 'strong' ? 'high' : 'medium', detail: item.reason })) },\n { kind: 'json', title: 'All verdicts', value: output.allVerdicts },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAa,kCAAkC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in workflow: `offer_design`
|
|
3
|
-
*
|
|
4
|
-
* Package skills and time into sellable offers — tiers, pricing, delivery
|
|
5
|
-
* boundaries, and positioning for solopreneurs.
|
|
6
|
-
*
|
|
7
|
-
* Args:
|
|
8
|
-
* - skills: what you can do
|
|
9
|
-
* - audience: target customers
|
|
10
|
-
* - constraints: time or revenue goals (optional)
|
|
11
|
-
*/
|
|
12
|
-
export declare const OFFER_DESIGN_SCRIPT = "export const meta = {\n name: 'offer_design',\n description: 'Package your skills into sellable offers with tiers, pricing, boundaries, and positioning.',\n whenToUse: 'Solo operator turning expertise into productized services or subscription offers.',\n examplePrompts: [\n { field: 'skills', text: 'Notion systems, light automations, async consulting for creators' },\n { field: 'audience', text: 'Solo creators doing $3k\u201315k/month' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u4E2A\u4EBA\u80FD\u529B\u6253\u5305\u4E3A\u53EF\u552E\u5356\u7684\u4EA7\u54C1/\u670D\u52A1\uFF1A\u5C42\u7EA7\u3001\u5B9A\u4EF7\u3001\u4EA4\u4ED8\u8FB9\u754C\u4E0E\u5B9A\u4F4D\u3002',\n whenToUse: '\u8D85\u7EA7\u4E2A\u4F53\u60F3\u628A\u4E13\u957F\u4EA7\u54C1\u5316\u3001\u8BBE\u8BA1\u62A5\u4EF7\u4E0E\u5957\u9910\u65F6\u3002',\n examplePrompts: [\n { field: 'skills', text: 'Notion \u7CFB\u7EDF\u642D\u5EFA\u3001\u8F7B\u91CF\u81EA\u52A8\u5316\u3001\u9762\u5411\u521B\u4F5C\u8005\u7684\u5F02\u6B65\u54A8\u8BE2' },\n { field: 'audience', text: '\u6708\u5165 2\u201310 \u4E07\u7684\u72EC\u7ACB\u521B\u4F5C\u8005' },\n ],\n },\n },\n tags: ['planning', 'architecture'],\n estimatedAgents: { min: 4, max: 5 },\n phases: [\n { title: 'Inventory' },\n { title: 'Package' },\n { title: 'Price' },\n { title: 'Position' },\n ],\n}\n\nconst skills = args && typeof args === 'object' && args.skills\n ? String(args.skills)\n : 'Infer your skills from the most recent user turn.'\n\nconst audience = args && typeof args === 'object' && args.audience\n ? String(args.audience)\n : 'Infer target audience from context.'\n\nconst constraints = args && typeof args === 'object' && args.constraints\n ? String(args.constraints)\n : ''\n\nphase('Inventory')\nconst inventory = await agent(\n 'Inventory sellable capabilities for a solo operator. Separate high-leverage repeatable work from custom work. Note time sinks to avoid.\\n\\n' +\n 'SKILLS:\\n' + skills + '\\nAUDIENCE:\\n' + audience +\n (constraints ? '\\nCONSTRAINTS:\\n' + constraints : ''),\n {\n label: 'inventory',\n schema: {\n type: 'object',\n properties: {\n coreCapabilities: { type: 'array', items: { type: 'string' } },\n repeatable: { type: 'array', items: { type: 'string' } },\n customOnly: { type: 'array', items: { type: 'string' } },\n avoid: { type: 'array', items: { type: 'string' } },\n },\n required: ['coreCapabilities', 'repeatable'],\n },\n },\n)\n\nphase('Package')\nconst packages = await agent(\n 'Design 2\u20133 offer tiers (e.g. starter / core / premium) with clear deliverables, boundaries, and who each tier is for. Fit solo capacity \u2014 no fake scale.\\n\\n' +\n JSON.stringify({ skills, audience, constraints, inventory }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n tiers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n forWho: { type: 'string' },\n deliverables: { type: 'array', items: { type: 'string' } },\n boundaries: { type: 'array', items: { type: 'string' } },\n timeCommitment: { type: 'string' },\n },\n required: ['name', 'deliverables', 'boundaries'],\n },\n },\n },\n required: ['tiers'],\n },\n },\n)\n\nphase('Price')\nconst pricing = await agent(\n 'Recommend pricing for each tier: price range, pricing model (fixed / retainer / subscription), rationale, and upsell path. Be realistic for solo operators.\\n\\n' +\n JSON.stringify({ audience, constraints, packages }, null, 2),\n {\n label: 'price',\n schema: {\n type: 'object',\n properties: {\n tiers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n priceRange: { type: 'string' },\n model: { type: 'string' },\n rationale: { type: 'string' },\n },\n required: ['name', 'priceRange', 'model'],\n },\n },\n upsellPath: { type: 'string' },\n },\n required: ['tiers'],\n },\n },\n)\n\nphase('Position')\nconst positioning = await agent(\n 'Write positioning: one-line value prop, differentiation vs DIY and vs agencies, ideal customer profile, and launch checklist (first 3 steps).\\n\\n' +\n JSON.stringify({ inventory, packages, pricing }, null, 2),\n {\n label: 'position',\n schema: {\n type: 'object',\n properties: {\n valueProp: { type: 'string' },\n differentiation: { type: 'array', items: { type: 'string' } },\n idealCustomer: { type: 'string' },\n launchChecklist: { type: 'array', items: { type: 'string' } },\n },\n required: ['valueProp', 'idealCustomer', 'launchChecklist'],\n },\n },\n)\n\nconst output = {\n ok: true,\n inventory,\n packages,\n pricing,\n ...(positioning ?? { valueProp: 'positioning failed', launchChecklist: [] }),\n}\nreturn {\n summary: output.valueProp,\n sections: [\n { kind: 'json', title: 'Packages', value: output.packages },\n { kind: 'json', title: 'Pricing', value: output.pricing },\n { kind: 'questions', title: 'Launch checklist', items: output.launchChecklist },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
//#region src/agent/workflow/builtins/offer-design.ts
|
|
2
|
-
/**
|
|
3
|
-
* Built-in workflow: `offer_design`
|
|
4
|
-
*
|
|
5
|
-
* Package skills and time into sellable offers — tiers, pricing, delivery
|
|
6
|
-
* boundaries, and positioning for solopreneurs.
|
|
7
|
-
*
|
|
8
|
-
* Args:
|
|
9
|
-
* - skills: what you can do
|
|
10
|
-
* - audience: target customers
|
|
11
|
-
* - constraints: time or revenue goals (optional)
|
|
12
|
-
*/
|
|
13
|
-
const OFFER_DESIGN_SCRIPT = `export const meta = {
|
|
14
|
-
name: 'offer_design',
|
|
15
|
-
description: 'Package your skills into sellable offers with tiers, pricing, boundaries, and positioning.',
|
|
16
|
-
whenToUse: 'Solo operator turning expertise into productized services or subscription offers.',
|
|
17
|
-
examplePrompts: [
|
|
18
|
-
{ field: 'skills', text: 'Notion systems, light automations, async consulting for creators' },
|
|
19
|
-
{ field: 'audience', text: 'Solo creators doing $3k–15k/month' },
|
|
20
|
-
],
|
|
21
|
-
i18n: {
|
|
22
|
-
zh: {
|
|
23
|
-
description: '将个人能力打包为可售卖的产品/服务:层级、定价、交付边界与定位。',
|
|
24
|
-
whenToUse: '超级个体想把专长产品化、设计报价与套餐时。',
|
|
25
|
-
examplePrompts: [
|
|
26
|
-
{ field: 'skills', text: 'Notion 系统搭建、轻量自动化、面向创作者的异步咨询' },
|
|
27
|
-
{ field: 'audience', text: '月入 2–10 万的独立创作者' },
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
tags: ['planning', 'architecture'],
|
|
32
|
-
estimatedAgents: { min: 4, max: 5 },
|
|
33
|
-
phases: [
|
|
34
|
-
{ title: 'Inventory' },
|
|
35
|
-
{ title: 'Package' },
|
|
36
|
-
{ title: 'Price' },
|
|
37
|
-
{ title: 'Position' },
|
|
38
|
-
],
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const skills = args && typeof args === 'object' && args.skills
|
|
42
|
-
? String(args.skills)
|
|
43
|
-
: 'Infer your skills from the most recent user turn.'
|
|
44
|
-
|
|
45
|
-
const audience = args && typeof args === 'object' && args.audience
|
|
46
|
-
? String(args.audience)
|
|
47
|
-
: 'Infer target audience from context.'
|
|
48
|
-
|
|
49
|
-
const constraints = args && typeof args === 'object' && args.constraints
|
|
50
|
-
? String(args.constraints)
|
|
51
|
-
: ''
|
|
52
|
-
|
|
53
|
-
phase('Inventory')
|
|
54
|
-
const inventory = await agent(
|
|
55
|
-
'Inventory sellable capabilities for a solo operator. Separate high-leverage repeatable work from custom work. Note time sinks to avoid.\\n\\n' +
|
|
56
|
-
'SKILLS:\\n' + skills + '\\nAUDIENCE:\\n' + audience +
|
|
57
|
-
(constraints ? '\\nCONSTRAINTS:\\n' + constraints : ''),
|
|
58
|
-
{
|
|
59
|
-
label: 'inventory',
|
|
60
|
-
schema: {
|
|
61
|
-
type: 'object',
|
|
62
|
-
properties: {
|
|
63
|
-
coreCapabilities: { type: 'array', items: { type: 'string' } },
|
|
64
|
-
repeatable: { type: 'array', items: { type: 'string' } },
|
|
65
|
-
customOnly: { type: 'array', items: { type: 'string' } },
|
|
66
|
-
avoid: { type: 'array', items: { type: 'string' } },
|
|
67
|
-
},
|
|
68
|
-
required: ['coreCapabilities', 'repeatable'],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
phase('Package')
|
|
74
|
-
const packages = await agent(
|
|
75
|
-
'Design 2–3 offer tiers (e.g. starter / core / premium) with clear deliverables, boundaries, and who each tier is for. Fit solo capacity — no fake scale.\\n\\n' +
|
|
76
|
-
JSON.stringify({ skills, audience, constraints, inventory }, null, 2),
|
|
77
|
-
{
|
|
78
|
-
label: 'package',
|
|
79
|
-
schema: {
|
|
80
|
-
type: 'object',
|
|
81
|
-
properties: {
|
|
82
|
-
tiers: {
|
|
83
|
-
type: 'array',
|
|
84
|
-
items: {
|
|
85
|
-
type: 'object',
|
|
86
|
-
properties: {
|
|
87
|
-
name: { type: 'string' },
|
|
88
|
-
forWho: { type: 'string' },
|
|
89
|
-
deliverables: { type: 'array', items: { type: 'string' } },
|
|
90
|
-
boundaries: { type: 'array', items: { type: 'string' } },
|
|
91
|
-
timeCommitment: { type: 'string' },
|
|
92
|
-
},
|
|
93
|
-
required: ['name', 'deliverables', 'boundaries'],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
required: ['tiers'],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
phase('Price')
|
|
103
|
-
const pricing = await agent(
|
|
104
|
-
'Recommend pricing for each tier: price range, pricing model (fixed / retainer / subscription), rationale, and upsell path. Be realistic for solo operators.\\n\\n' +
|
|
105
|
-
JSON.stringify({ audience, constraints, packages }, null, 2),
|
|
106
|
-
{
|
|
107
|
-
label: 'price',
|
|
108
|
-
schema: {
|
|
109
|
-
type: 'object',
|
|
110
|
-
properties: {
|
|
111
|
-
tiers: {
|
|
112
|
-
type: 'array',
|
|
113
|
-
items: {
|
|
114
|
-
type: 'object',
|
|
115
|
-
properties: {
|
|
116
|
-
name: { type: 'string' },
|
|
117
|
-
priceRange: { type: 'string' },
|
|
118
|
-
model: { type: 'string' },
|
|
119
|
-
rationale: { type: 'string' },
|
|
120
|
-
},
|
|
121
|
-
required: ['name', 'priceRange', 'model'],
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
upsellPath: { type: 'string' },
|
|
125
|
-
},
|
|
126
|
-
required: ['tiers'],
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
phase('Position')
|
|
132
|
-
const positioning = await agent(
|
|
133
|
-
'Write positioning: one-line value prop, differentiation vs DIY and vs agencies, ideal customer profile, and launch checklist (first 3 steps).\\n\\n' +
|
|
134
|
-
JSON.stringify({ inventory, packages, pricing }, null, 2),
|
|
135
|
-
{
|
|
136
|
-
label: 'position',
|
|
137
|
-
schema: {
|
|
138
|
-
type: 'object',
|
|
139
|
-
properties: {
|
|
140
|
-
valueProp: { type: 'string' },
|
|
141
|
-
differentiation: { type: 'array', items: { type: 'string' } },
|
|
142
|
-
idealCustomer: { type: 'string' },
|
|
143
|
-
launchChecklist: { type: 'array', items: { type: 'string' } },
|
|
144
|
-
},
|
|
145
|
-
required: ['valueProp', 'idealCustomer', 'launchChecklist'],
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
const output = {
|
|
151
|
-
ok: true,
|
|
152
|
-
inventory,
|
|
153
|
-
packages,
|
|
154
|
-
pricing,
|
|
155
|
-
...(positioning ?? { valueProp: 'positioning failed', launchChecklist: [] }),
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
summary: output.valueProp,
|
|
159
|
-
sections: [
|
|
160
|
-
{ kind: 'json', title: 'Packages', value: output.packages },
|
|
161
|
-
{ kind: 'json', title: 'Pricing', value: output.pricing },
|
|
162
|
-
{ kind: 'questions', title: 'Launch checklist', items: output.launchChecklist },
|
|
163
|
-
],
|
|
164
|
-
structuredOutput: output,
|
|
165
|
-
}
|
|
166
|
-
`;
|
|
167
|
-
//#endregion
|
|
168
|
-
export { OFFER_DESIGN_SCRIPT };
|
|
169
|
-
|
|
170
|
-
//# sourceMappingURL=offer-design.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offer-design.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/offer-design.ts"],"sourcesContent":["/**\n * Built-in workflow: `offer_design`\n *\n * Package skills and time into sellable offers — tiers, pricing, delivery\n * boundaries, and positioning for solopreneurs.\n *\n * Args:\n * - skills: what you can do\n * - audience: target customers\n * - constraints: time or revenue goals (optional)\n */\n\nexport const OFFER_DESIGN_SCRIPT = `export const meta = {\n name: 'offer_design',\n description: 'Package your skills into sellable offers with tiers, pricing, boundaries, and positioning.',\n whenToUse: 'Solo operator turning expertise into productized services or subscription offers.',\n examplePrompts: [\n { field: 'skills', text: 'Notion systems, light automations, async consulting for creators' },\n { field: 'audience', text: 'Solo creators doing $3k–15k/month' },\n ],\n i18n: {\n zh: {\n description: '将个人能力打包为可售卖的产品/服务:层级、定价、交付边界与定位。',\n whenToUse: '超级个体想把专长产品化、设计报价与套餐时。',\n examplePrompts: [\n { field: 'skills', text: 'Notion 系统搭建、轻量自动化、面向创作者的异步咨询' },\n { field: 'audience', text: '月入 2–10 万的独立创作者' },\n ],\n },\n },\n tags: ['planning', 'architecture'],\n estimatedAgents: { min: 4, max: 5 },\n phases: [\n { title: 'Inventory' },\n { title: 'Package' },\n { title: 'Price' },\n { title: 'Position' },\n ],\n}\n\nconst skills = args && typeof args === 'object' && args.skills\n ? String(args.skills)\n : 'Infer your skills from the most recent user turn.'\n\nconst audience = args && typeof args === 'object' && args.audience\n ? String(args.audience)\n : 'Infer target audience from context.'\n\nconst constraints = args && typeof args === 'object' && args.constraints\n ? String(args.constraints)\n : ''\n\nphase('Inventory')\nconst inventory = await agent(\n 'Inventory sellable capabilities for a solo operator. Separate high-leverage repeatable work from custom work. Note time sinks to avoid.\\\\n\\\\n' +\n 'SKILLS:\\\\n' + skills + '\\\\nAUDIENCE:\\\\n' + audience +\n (constraints ? '\\\\nCONSTRAINTS:\\\\n' + constraints : ''),\n {\n label: 'inventory',\n schema: {\n type: 'object',\n properties: {\n coreCapabilities: { type: 'array', items: { type: 'string' } },\n repeatable: { type: 'array', items: { type: 'string' } },\n customOnly: { type: 'array', items: { type: 'string' } },\n avoid: { type: 'array', items: { type: 'string' } },\n },\n required: ['coreCapabilities', 'repeatable'],\n },\n },\n)\n\nphase('Package')\nconst packages = await agent(\n 'Design 2–3 offer tiers (e.g. starter / core / premium) with clear deliverables, boundaries, and who each tier is for. Fit solo capacity — no fake scale.\\\\n\\\\n' +\n JSON.stringify({ skills, audience, constraints, inventory }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n tiers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n forWho: { type: 'string' },\n deliverables: { type: 'array', items: { type: 'string' } },\n boundaries: { type: 'array', items: { type: 'string' } },\n timeCommitment: { type: 'string' },\n },\n required: ['name', 'deliverables', 'boundaries'],\n },\n },\n },\n required: ['tiers'],\n },\n },\n)\n\nphase('Price')\nconst pricing = await agent(\n 'Recommend pricing for each tier: price range, pricing model (fixed / retainer / subscription), rationale, and upsell path. Be realistic for solo operators.\\\\n\\\\n' +\n JSON.stringify({ audience, constraints, packages }, null, 2),\n {\n label: 'price',\n schema: {\n type: 'object',\n properties: {\n tiers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n priceRange: { type: 'string' },\n model: { type: 'string' },\n rationale: { type: 'string' },\n },\n required: ['name', 'priceRange', 'model'],\n },\n },\n upsellPath: { type: 'string' },\n },\n required: ['tiers'],\n },\n },\n)\n\nphase('Position')\nconst positioning = await agent(\n 'Write positioning: one-line value prop, differentiation vs DIY and vs agencies, ideal customer profile, and launch checklist (first 3 steps).\\\\n\\\\n' +\n JSON.stringify({ inventory, packages, pricing }, null, 2),\n {\n label: 'position',\n schema: {\n type: 'object',\n properties: {\n valueProp: { type: 'string' },\n differentiation: { type: 'array', items: { type: 'string' } },\n idealCustomer: { type: 'string' },\n launchChecklist: { type: 'array', items: { type: 'string' } },\n },\n required: ['valueProp', 'idealCustomer', 'launchChecklist'],\n },\n },\n)\n\nconst output = {\n ok: true,\n inventory,\n packages,\n pricing,\n ...(positioning ?? { valueProp: 'positioning failed', launchChecklist: [] }),\n}\nreturn {\n summary: output.valueProp,\n sections: [\n { kind: 'json', title: 'Packages', value: output.packages },\n { kind: 'json', title: 'Pricing', value: output.pricing },\n { kind: 'questions', title: 'Launch checklist', items: output.launchChecklist },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,sBAAsB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in workflow: `pr_review`
|
|
3
|
-
*
|
|
4
|
-
* Focused review of a PR, diff, or commit range — lighter than full repo audit.
|
|
5
|
-
* Parallel reviewers cover correctness, security, tests, API compat, and perf;
|
|
6
|
-
* final phase produces a ship/block verdict with blockers vs suggestions.
|
|
7
|
-
*
|
|
8
|
-
* Args:
|
|
9
|
-
* - target: PR description, diff, commit range, or file list
|
|
10
|
-
* - diff: alias for target
|
|
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 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', 'exec_command']\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\nconst output = {\n ok: true,\n target: reviewTarget,\n scope,\n ...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),\n byReviewer,\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'findings', title: 'Blockers', items: output.blockers.map((item) => ({ title: item.title, severity: 'high', file: item.file, detail: item.fix })) },\n { kind: 'findings', title: 'Suggestions', items: output.suggestions.map((item) => ({ title: item.title, severity: item.severity, file: item.file })) },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
//#region src/agent/workflow/builtins/pr-review.ts
|
|
2
|
-
/**
|
|
3
|
-
* Built-in workflow: `pr_review`
|
|
4
|
-
*
|
|
5
|
-
* Focused review of a PR, diff, or commit range — lighter than full repo audit.
|
|
6
|
-
* Parallel reviewers cover correctness, security, tests, API compat, and perf;
|
|
7
|
-
* final phase produces a ship/block verdict with blockers vs suggestions.
|
|
8
|
-
*
|
|
9
|
-
* Args:
|
|
10
|
-
* - target: PR description, diff, commit range, or file list
|
|
11
|
-
* - diff: alias for target
|
|
12
|
-
*/
|
|
13
|
-
const PR_REVIEW_SCRIPT = `export const meta = {
|
|
14
|
-
name: 'pr_review',
|
|
15
|
-
description: 'Review a PR/diff/commit range with parallel focused reviewers and a ship/block verdict.',
|
|
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
|
-
},
|
|
31
|
-
tags: ['code-review', 'pr'],
|
|
32
|
-
estimatedAgents: { min: 7, max: 7 },
|
|
33
|
-
phases: [
|
|
34
|
-
{ title: 'Scope' },
|
|
35
|
-
{ title: 'Review' },
|
|
36
|
-
{ title: 'Verdict' },
|
|
37
|
-
],
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'exec_command']
|
|
41
|
-
|
|
42
|
-
const target = args && typeof args === 'object'
|
|
43
|
-
? String(args.target ?? args.diff ?? '')
|
|
44
|
-
: ''
|
|
45
|
-
const reviewTarget = target.trim()
|
|
46
|
-
? target
|
|
47
|
-
: 'Recent changes in the working tree or the diff/context from the current conversation.'
|
|
48
|
-
|
|
49
|
-
const REVIEWERS = [
|
|
50
|
-
{ key: 'correctness', focus: 'Logic bugs, edge cases, error handling, null safety, race conditions in changed code.' },
|
|
51
|
-
{ key: 'security', focus: 'Auth/authz regressions, input validation, secret exposure, injection, unsafe deserialization in the diff.' },
|
|
52
|
-
{ key: 'tests', focus: 'Missing tests for changed behavior, brittle assertions, untested edge cases introduced by this change.' },
|
|
53
|
-
{ key: 'api_compat', focus: 'Breaking public API changes, schema migrations, backward compatibility, deprecation handling.' },
|
|
54
|
-
{ key: 'perf', focus: 'Regressions in hot paths, accidental N+1, sync I/O, unbounded loops or allocations in changed code.' },
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
phase('Scope')
|
|
58
|
-
const scope = await agent(
|
|
59
|
-
'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' +
|
|
60
|
-
reviewTarget,
|
|
61
|
-
{
|
|
62
|
-
label: 'change scope',
|
|
63
|
-
toolset: READ_ONLY_TOOLS,
|
|
64
|
-
schema: {
|
|
65
|
-
type: 'object',
|
|
66
|
-
properties: {
|
|
67
|
-
changedFiles: { type: 'array', items: { type: 'string' } },
|
|
68
|
-
intent: { type: 'string' },
|
|
69
|
-
blastRadius: { type: 'string' },
|
|
70
|
-
},
|
|
71
|
-
required: ['changedFiles', 'intent'],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
phase('Review')
|
|
77
|
-
const reviews = await parallel(
|
|
78
|
-
REVIEWERS.map((r) => () =>
|
|
79
|
-
agent(
|
|
80
|
-
'Review these changes through the ' + r.key + ' lens.\\n' +
|
|
81
|
-
'Focus: ' + r.focus + '\\n\\n' +
|
|
82
|
-
'TARGET:\\n' + reviewTarget + '\\n\\n' +
|
|
83
|
-
'SCOPE:\\n' + JSON.stringify(scope, null, 2) + '\\n\\n' +
|
|
84
|
-
'Return findings: file, severity (low/med/high/blocker), title, fix suggestion. Blocker = must fix before merge.',
|
|
85
|
-
{
|
|
86
|
-
label: r.key,
|
|
87
|
-
toolset: READ_ONLY_TOOLS,
|
|
88
|
-
schema: {
|
|
89
|
-
type: 'object',
|
|
90
|
-
properties: {
|
|
91
|
-
findings: {
|
|
92
|
-
type: 'array',
|
|
93
|
-
items: {
|
|
94
|
-
type: 'object',
|
|
95
|
-
properties: {
|
|
96
|
-
file: { type: 'string' },
|
|
97
|
-
severity: { type: 'string', enum: ['low', 'med', 'high', 'blocker'] },
|
|
98
|
-
title: { type: 'string' },
|
|
99
|
-
fix: { type: 'string' },
|
|
100
|
-
},
|
|
101
|
-
required: ['file', 'severity', 'title', 'fix'],
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
required: ['findings'],
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
),
|
|
109
|
-
),
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
phase('Verdict')
|
|
113
|
-
const live = reviews.filter(Boolean)
|
|
114
|
-
const byReviewer = {}
|
|
115
|
-
for (let i = 0; i < REVIEWERS.length; i++) {
|
|
116
|
-
byReviewer[REVIEWERS[i].key] = live[i]?.findings ?? []
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const verdict = await agent(
|
|
120
|
-
'Synthesize a PR review verdict. Separate blockers from suggestions. Deduplicate. Recommend ship | fix_first | block.\\n\\n' +
|
|
121
|
-
JSON.stringify(byReviewer, null, 2),
|
|
122
|
-
{
|
|
123
|
-
label: 'verdict',
|
|
124
|
-
schema: {
|
|
125
|
-
type: 'object',
|
|
126
|
-
properties: {
|
|
127
|
-
recommendation: { type: 'string', enum: ['ship', 'fix_first', 'block'] },
|
|
128
|
-
summary: { type: 'string' },
|
|
129
|
-
blockers: {
|
|
130
|
-
type: 'array',
|
|
131
|
-
items: {
|
|
132
|
-
type: 'object',
|
|
133
|
-
properties: {
|
|
134
|
-
file: { type: 'string' },
|
|
135
|
-
title: { type: 'string' },
|
|
136
|
-
fix: { type: 'string' },
|
|
137
|
-
},
|
|
138
|
-
required: ['file', 'title'],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
suggestions: {
|
|
142
|
-
type: 'array',
|
|
143
|
-
items: {
|
|
144
|
-
type: 'object',
|
|
145
|
-
properties: {
|
|
146
|
-
file: { type: 'string' },
|
|
147
|
-
severity: { type: 'string' },
|
|
148
|
-
title: { type: 'string' },
|
|
149
|
-
},
|
|
150
|
-
required: ['file', 'title'],
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
required: ['recommendation', 'summary', 'blockers'],
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
const output = {
|
|
160
|
-
ok: true,
|
|
161
|
-
target: reviewTarget,
|
|
162
|
-
scope,
|
|
163
|
-
...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),
|
|
164
|
-
byReviewer,
|
|
165
|
-
}
|
|
166
|
-
return {
|
|
167
|
-
summary: output.summary,
|
|
168
|
-
sections: [
|
|
169
|
-
{ kind: 'findings', title: 'Blockers', items: output.blockers.map((item) => ({ title: item.title, severity: 'high', file: item.file, detail: item.fix })) },
|
|
170
|
-
{ kind: 'findings', title: 'Suggestions', items: output.suggestions.map((item) => ({ title: item.title, severity: item.severity, file: item.file })) },
|
|
171
|
-
],
|
|
172
|
-
structuredOutput: output,
|
|
173
|
-
}
|
|
174
|
-
`;
|
|
175
|
-
//#endregion
|
|
176
|
-
export { PR_REVIEW_SCRIPT };
|
|
177
|
-
|
|
178
|
-
//# sourceMappingURL=pr-review.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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', 'exec_command']\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\nconst output = {\n ok: true,\n target: reviewTarget,\n scope,\n ...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),\n byReviewer,\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'findings', title: 'Blockers', items: output.blockers.map((item) => ({ title: item.title, severity: 'high', file: item.file, detail: item.fix })) },\n { kind: 'findings', title: 'Suggestions', items: output.suggestions.map((item) => ({ title: item.title, severity: item.severity, file: item.file })) },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,mBAAmB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
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', 'exec_command']\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\nconst output = {\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}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'risks', title: 'Blockers', items: output.blockers.map((title) => ({ title, severity: 'high' })) },\n { kind: 'questions', title: 'Final checklist', items: output.finalChecklist },\n { kind: 'questions', title: 'Commands to run', items: output.commandsToRun ?? [] },\n ],\n structuredOutput: output,\n}\n";
|