@xopcai/xopc 0.0.115 → 0.0.116
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 +5 -4
- package/README.zh-CN.md +5 -4
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/feishu/src/workflow-progress.js +1 -1
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/src/routing-integration.js +2 -2
- package/dist/extensions/telegram/src/update-offset-store.js +1 -1
- package/dist/extensions/telegram/src/workflow-progress.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -1
- package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
- package/dist/extensions/weixin/src/workflow-progress.js +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DVnBfANm.js → agent-avatar-dicebear-CWM1UU5P.js} +1 -1
- package/dist/gateway/static/root/assets/agent-browser-settings-page-D1SyFYeh.js +6 -0
- package/dist/gateway/static/root/assets/agent-defaults-tabbed-page-C9YxgvuI.js +1 -0
- package/dist/gateway/static/root/assets/agents-CteVs3UO.js +71 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-yXSXY_bu.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-BQpPSTHD.js → appearance-settings-DjY1P_ug.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CVQ1M8Ax.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CXu-Csep.js → archive-plugin-CytE5j-e.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BAjgOoGY.js → attachment-load-BvvrN6rF.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-BSBgB2hO.js → binary-plugins-IBWSitnj.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BpXw9TTR.js → block-editor-C-wDpsf-.js} +3 -3
- package/dist/gateway/static/root/assets/{channels-settings-BbPUpzWB.js → channels-settings-Cd3JbeQ1.js} +1 -1
- package/dist/gateway/static/root/assets/{config-api-NOoPiIYz.js → config-api-C4RAtTKW.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-MsMa5qBr.js +2 -0
- package/dist/gateway/static/root/assets/{cron-api-C9BOqAXd.js → cron-api-sJNMqB6P.js} +1 -1
- package/dist/gateway/static/root/assets/cron-page-D30CSwkn.js +3 -0
- package/dist/gateway/static/root/assets/dreaming-settings-6fCUWRQf.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-D9kgUHCc.js → extension-debug-page-BAIyjDlq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CGyhXqzR.js → extension-page-DEhv2GpC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DL8Xquqd.js → extension-settings-page-DOuAxTDW.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-D0VXA932.js → fetch-CTsREQIe.js} +1 -1
- package/dist/gateway/static/root/assets/{format-interval-label-Be8SmgUw.js → format-interval-label-D35Bfhtx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C-xjn__h.js → gateway-config-api-C6989a-W.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BpF26t91.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DERUH61L.js → gateway-startup-retry-C1KAHrd2.js} +1 -1
- package/dist/gateway/static/root/assets/goal-detail-page-DOjhmRyf.js +1 -0
- package/dist/gateway/static/root/assets/{goals-config-api-BPmqWk90.js → goals-config-api-KnLGpu6h.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-Xl9_wrFc.js +2 -0
- package/dist/gateway/static/root/assets/goals-settings-DtPtqZi8.js +1 -0
- package/dist/gateway/static/root/assets/{heartbeat-config-api-Bfdzr8oV.js → heartbeat-config-api-uKw1f0IG.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DN9vEj9P.js +1 -0
- package/dist/gateway/static/root/assets/index-C8ytlAF2.js +122 -0
- package/dist/gateway/static/root/assets/index-CVpJW2NS.css +1 -0
- package/dist/gateway/static/root/assets/{interval-presets-utKbuCRY.js → interval-presets-Dq0FXJ65.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CjqS6c6V.js → keyboard-shortcuts-settings-C9_t4m7t.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-SNkWzidV.js +2 -0
- package/dist/gateway/static/root/assets/{markdown-split-DW8C47iB.js → markdown-split-Ca87W8-h.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-D6HwDhDT.js → media-plugins-BAcUjPRJ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BqzIDrlr.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-panel-BO4o-GmO.js +2 -0
- package/dist/gateway/static/root/assets/note-detail-page-DLV_XDmT.js +2 -0
- package/dist/gateway/static/root/assets/{note-image-lightbox-pJM35Pz5.js → note-image-lightbox-hnSX5SSn.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-ycsDlkFA.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CVwHuyN6.js → preview-open-alternatives-CNgM20H5.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DQpnE8K9.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-Ba-UEk7x.js → save-bar-controls-CcdjGcfT.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-CNN9595U.js → schedule-field-CYr39z76.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DnNMmtD5.js → schema-form-BRAJgZQ2.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BZui7iAY.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DEfzZ1ax.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-CmOz80i5.js → settings-collapsible-section-BhzjeGWi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-BmK7JJOV.js → settings-form-section-Cz3Pcr9b.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-CLuSsu1-.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-Cq4qpXLi.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Dp2qGrHC.js → share-preview-page-DL4y9K5e.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-B9F3HyYQ.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Bp9UPPwm.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BIoBsfSV.js +2 -0
- package/dist/gateway/static/root/assets/system-settings-panel-FD2jxRZ3.js +1 -0
- package/dist/gateway/static/root/assets/use-agent-defaults-form-Cz2_pPzu.js +1 -0
- package/dist/gateway/static/root/assets/{use-channel-catalog-CHlO8J9G.js → use-channel-catalog-BInPrfR5.js} +1 -1
- package/dist/gateway/static/root/assets/{use-settings-tab-guard-CW5JORnl.js → use-settings-tab-guard-nuHMmZQv.js} +1 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BUIrKb8s.js +1 -0
- package/dist/gateway/static/root/assets/{voice-player-store-DDDWYHvg.js → voice-player-store-1U3vFppm.js} +1 -1
- package/dist/gateway/static/root/assets/workflows-page-qE3SexnO.js +18 -0
- package/dist/gateway/static/root/index.html +5 -5
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +6 -6
- package/dist/src/agent/agent-scope.js +1 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
- package/dist/src/agent/bootstrap/project-agents-context.js +1 -1
- package/dist/src/agent/context/workspace-seed.js +2 -2
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/context/workspace.js +1 -1
- package/dist/src/agent/goals/checklist-judge.d.ts +1 -0
- package/dist/src/agent/goals/checklist-judge.js +1 -1
- package/dist/src/agent/goals/checklist-judge.js.map +1 -1
- package/dist/src/agent/goals/evaluate-turn.d.ts +1 -0
- package/dist/src/agent/goals/evaluate-turn.js +1 -0
- package/dist/src/agent/goals/evaluate-turn.js.map +1 -1
- package/dist/src/agent/goals/goal-locale.js +2 -2
- package/dist/src/agent/goals/post-turn.js +11 -4
- package/dist/src/agent/goals/post-turn.js.map +1 -1
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/image/understanding/pi-ai-provider.js +5 -2
- package/dist/src/agent/image/understanding/pi-ai-provider.js.map +1 -1
- package/dist/src/agent/image/understanding/provider-registry.d.ts +1 -0
- package/dist/src/agent/image/understanding/provider-registry.js +16 -2
- package/dist/src/agent/image/understanding/provider-registry.js.map +1 -1
- package/dist/src/agent/ipc/inbox.js +3 -3
- package/dist/src/agent/ipc/socket.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/memory/builtin-memory-store.js +1 -1
- package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
- package/dist/src/agent/memory/dreaming/events.js +1 -1
- package/dist/src/agent/memory/dreaming/last-run.js +1 -1
- package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
- package/dist/src/agent/memory/dreaming/preview.js +1 -1
- package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
- package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
- package/dist/src/agent/memory/dreaming/utils.js +1 -1
- package/dist/src/agent/memory/memory-flush.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/models/manager.js +1 -1
- package/dist/src/agent/prompt/memory/index.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/reply/post-compaction-context.js +1 -1
- package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +2 -2
- package/dist/src/agent/service.js +4 -4
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +2 -2
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/index.js +2 -2
- package/dist/src/agent/skills/installer.js +2 -2
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-view-path.js +1 -1
- package/dist/src/agent/skills/test-framework.js +1 -1
- package/dist/src/agent/starter-agents.js +1 -1
- package/dist/src/agent/tools/composio-tool.d.ts +8 -0
- package/dist/src/agent/tools/composio-tool.js +46 -0
- package/dist/src/agent/tools/composio-tool.js.map +1 -0
- package/dist/src/agent/tools/dreaming-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -8
- package/dist/src/agent/tools/factory.js.map +1 -1
- package/dist/src/agent/tools/find.js +1 -1
- package/dist/src/agent/tools/grep.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/workflow/builtins/audit-repo.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/audit-repo.js +15 -2
- package/dist/src/agent/workflow/builtins/audit-repo.js.map +1 -1
- package/dist/src/agent/workflow/builtins/client-proposal.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/client-proposal.js +10 -1
- package/dist/src/agent/workflow/builtins/client-proposal.js.map +1 -1
- package/dist/src/agent/workflow/builtins/competitor-scan.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/competitor-scan.js +16 -2
- package/dist/src/agent/workflow/builtins/competitor-scan.js.map +1 -1
- package/dist/src/agent/workflow/builtins/content-draft.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/content-draft.js +15 -2
- package/dist/src/agent/workflow/builtins/content-draft.js.map +1 -1
- package/dist/src/agent/workflow/builtins/content-repurpose.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/content-repurpose.js +10 -1
- package/dist/src/agent/workflow/builtins/content-repurpose.js.map +1 -1
- package/dist/src/agent/workflow/builtins/debug-incident.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/debug-incident.js +9 -1
- package/dist/src/agent/workflow/builtins/debug-incident.js.map +1 -1
- package/dist/src/agent/workflow/builtins/decision-compare.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/decision-compare.js +16 -2
- package/dist/src/agent/workflow/builtins/decision-compare.js.map +1 -1
- package/dist/src/agent/workflow/builtins/implementation-plan.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/implementation-plan.js +11 -1
- package/dist/src/agent/workflow/builtins/implementation-plan.js.map +1 -1
- package/dist/src/agent/workflow/builtins/inbox-triage.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/inbox-triage.js +11 -1
- package/dist/src/agent/workflow/builtins/inbox-triage.js.map +1 -1
- package/dist/src/agent/workflow/builtins/meeting-prep.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/meeting-prep.js +9 -1
- package/dist/src/agent/workflow/builtins/meeting-prep.js.map +1 -1
- package/dist/src/agent/workflow/builtins/multi-perspective-review.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/multi-perspective-review.js +9 -1
- package/dist/src/agent/workflow/builtins/multi-perspective-review.js.map +1 -1
- package/dist/src/agent/workflow/builtins/offer-design.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/offer-design.js +10 -1
- package/dist/src/agent/workflow/builtins/offer-design.js.map +1 -1
- package/dist/src/agent/workflow/builtins/pr-review.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/pr-review.js +9 -1
- package/dist/src/agent/workflow/builtins/pr-review.js.map +1 -1
- package/dist/src/agent/workflow/builtins/release-check.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/release-check.js +10 -1
- package/dist/src/agent/workflow/builtins/release-check.js.map +1 -1
- package/dist/src/agent/workflow/builtins/research.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/research.js +16 -2
- package/dist/src/agent/workflow/builtins/research.js.map +1 -1
- package/dist/src/agent/workflow/builtins/weekly-review.d.ts +1 -1
- package/dist/src/agent/workflow/builtins/weekly-review.js +9 -1
- package/dist/src/agent/workflow/builtins/weekly-review.js.map +1 -1
- package/dist/src/agent/workflow/catalog.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +2 -2
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/cdp-local-launcher.js +2 -2
- package/dist/src/browser/pipeline/source.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +4 -4
- package/dist/src/browser/providers/cloakbrowser.js +5 -5
- package/dist/src/browser/providers/playwright-doctor.js +1 -1
- package/dist/src/browser/stealth.js +1 -1
- package/dist/src/channels/catalog/channel-catalog-service.js +1 -1
- package/dist/src/channels/outbound/persist-store.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/chat-commands/agent-edit.js +2 -2
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-create.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +2 -2
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension-pack.js +2 -2
- package/dist/src/cli/commands/extension.js +3 -3
- package/dist/src/cli/commands/gateway/logs.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +2 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/skills-test.js +1 -1
- package/dist/src/cli/templates.js +1 -1
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/agent-typed-models.js +1 -1
- package/dist/src/config/gateway-bind.js +1 -1
- package/dist/src/config/index.js +8 -8
- package/dist/src/config/loader.js +4 -4
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/paths-state.js +1 -1
- package/dist/src/config/paths.js +1 -1
- package/dist/src/config/profile.js +1 -1
- package/dist/src/config/reload.js +1 -1
- package/dist/src/config/schema.d.ts +7 -0
- package/dist/src/config/schema.js +5 -3
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/connectors/composio-triggers.d.ts +10 -0
- package/dist/src/connectors/composio-triggers.js +32 -0
- package/dist/src/connectors/composio-triggers.js.map +1 -0
- package/dist/src/connectors/composio.d.ts +54 -0
- package/dist/src/connectors/composio.js +334 -0
- package/dist/src/connectors/composio.js.map +1 -0
- package/dist/src/connectors/health.js +16 -1
- package/dist/src/connectors/health.js.map +1 -1
- package/dist/src/connectors/install.d.ts +2 -1
- package/dist/src/connectors/install.js +50 -13
- package/dist/src/connectors/install.js.map +1 -1
- package/dist/src/connectors/instances.js +57 -6
- package/dist/src/connectors/instances.js.map +1 -1
- package/dist/src/connectors/lifecycle.d.ts +3 -0
- package/dist/src/connectors/lifecycle.js +23 -0
- package/dist/src/connectors/lifecycle.js.map +1 -0
- package/dist/src/connectors/materialize.js +2 -1
- package/dist/src/connectors/materialize.js.map +1 -1
- package/dist/src/connectors/providers.d.ts +1 -0
- package/dist/src/connectors/providers.js +10 -2
- package/dist/src/connectors/providers.js.map +1 -1
- package/dist/src/connectors/registries/modelscope.d.ts +2 -0
- package/dist/src/connectors/registries/modelscope.js +205 -0
- package/dist/src/connectors/registries/modelscope.js.map +1 -0
- package/dist/src/connectors/registries/official-mcp.d.ts +2 -0
- package/dist/src/connectors/registries/official-mcp.js +142 -0
- package/dist/src/connectors/registries/official-mcp.js.map +1 -0
- package/dist/src/connectors/registries/search.d.ts +12 -0
- package/dist/src/connectors/registries/search.js +89 -0
- package/dist/src/connectors/registries/search.js.map +1 -0
- package/dist/src/connectors/registries/smithery.d.ts +2 -0
- package/dist/src/connectors/registries/smithery.js +98 -0
- package/dist/src/connectors/registries/smithery.js.map +1 -0
- package/dist/src/connectors/registries/types.d.ts +20 -0
- package/dist/src/connectors/registries/types.js +1 -0
- package/dist/src/connectors/secret-store.js +4 -2
- package/dist/src/connectors/secret-store.js.map +1 -1
- package/dist/src/connectors/setup-secrets.d.ts +15 -0
- package/dist/src/connectors/setup-secrets.js +64 -0
- package/dist/src/connectors/setup-secrets.js.map +1 -0
- package/dist/src/connectors/supervisor.d.ts +15 -0
- package/dist/src/connectors/supervisor.js +73 -0
- package/dist/src/connectors/supervisor.js.map +1 -0
- package/dist/src/connectors/types.d.ts +27 -3
- package/dist/src/connectors/usage.js +6 -1
- package/dist/src/connectors/usage.js.map +1 -1
- package/dist/src/cron/executor.js +1 -1
- package/dist/src/cron/service.js +1 -1
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +2 -2
- package/dist/src/daemon/launchd.js +2 -2
- package/dist/src/daemon/schtasks.js +2 -2
- package/dist/src/daemon/systemd.js +2 -2
- package/dist/src/extensions/bundle-mcp.js +1 -1
- package/dist/src/extensions/discover-extensions.js +2 -2
- package/dist/src/extensions/health.js +1 -1
- package/dist/src/extensions/install.js +2 -2
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +3 -3
- package/dist/src/extensions/security.js +1 -1
- package/dist/src/extensions/update.js +2 -2
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/lib/extension-store.js +2 -2
- package/dist/src/gateway/hono/lib/static-ui.js +2 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +230 -3
- package/dist/src/gateway/hono/routes/connectors.js.map +1 -1
- package/dist/src/gateway/hono/routes/dreaming.js +1 -1
- package/dist/src/gateway/hono/routes/goals.js +52 -5
- package/dist/src/gateway/hono/routes/goals.js.map +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +14 -1
- package/dist/src/gateway/hono/routes/voice.js.map +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +2 -2
- package/dist/src/gateway/hono/sse.js.map +1 -1
- package/dist/src/gateway/lock.js +3 -3
- package/dist/src/gateway/ports.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +5 -12
- package/dist/src/gateway/service/agent-runner.js +8 -8
- package/dist/src/gateway/service/agent-runner.js.map +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.d.ts +2 -10
- package/dist/src/gateway/service/run-gateway-agent.js.map +1 -1
- package/dist/src/gateway/service.d.ts +1 -1
- package/dist/src/gateway/service.js +13 -8
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/user-turn-input.d.ts +18 -0
- package/dist/src/gateway/user-turn-input.js +16 -0
- package/dist/src/gateway/user-turn-input.js.map +1 -0
- package/dist/src/gateway/workspace-fs-file-list.js +1 -1
- package/dist/src/goals/goal-queue-store.d.ts +2 -1
- package/dist/src/goals/goal-queue-store.js +2 -2
- package/dist/src/goals/goal-queue-store.js.map +1 -1
- package/dist/src/goals/goal-queue-types.d.ts +4 -3
- package/dist/src/goals/goal-runner.js +25 -3
- package/dist/src/goals/goal-runner.js.map +1 -1
- package/dist/src/goals/goal-service.d.ts +6 -1
- package/dist/src/goals/goal-service.js +9 -2
- package/dist/src/goals/goal-service.js.map +1 -1
- package/dist/src/goals/goal-store.d.ts +7 -1
- package/dist/src/goals/goal-store.js +42 -0
- package/dist/src/goals/goal-store.js.map +1 -1
- package/dist/src/goals/goal-workflow-judge.js +2 -2
- package/dist/src/goals/types.d.ts +10 -0
- package/dist/src/i18n/goals-bundle.js +1 -1
- package/dist/src/i18n/index.js +1 -1
- package/dist/src/i18n/share-tool-bundle.js +2 -2
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/package-json.js +1 -1
- package/dist/src/infra/package-update-steps.js +1 -1
- package/dist/src/infra/path-env.js +2 -2
- package/dist/src/infra/restart.js +1 -1
- package/dist/src/infra/stable-node-path.js +1 -1
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-lock.js +2 -2
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/media/store.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/notes/store.js +2 -2
- package/dist/src/project-trust/trust-store.js +2 -2
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/index.js +1 -1
- package/dist/src/providers/model-registry.js +4 -4
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/session-title.js +2 -2
- package/dist/src/session/store.js +1 -1
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.js +3 -3
- package/dist/src/share/share-thumbnail.js +2 -2
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-share-store.js +3 -3
- package/dist/src/share/site-static-serve.js +1 -1
- package/dist/src/storage/sqlite/connection.js +1 -1
- package/dist/src/storage/sqlite/memory-index-repository.js +2 -2
- package/dist/src/storage/sqlite/migrations/011_goal_context_messages.sql +8 -0
- package/dist/src/storage/sqlite/migrations/discover.js +1 -1
- package/dist/src/storage/sqlite/migrations/runner.d.ts +2 -2
- package/dist/src/storage/sqlite/migrations/runner.js +5 -5
- package/dist/src/storage/sqlite/migrations/runner.js.map +1 -1
- package/dist/src/storage/sqlite/migrations/runner.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +4 -4
- package/dist/src/storage/sqlite/schema.sql +9 -0
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/clipboard-image.js +3 -3
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/theme-manager.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +4 -4
- package/dist/src/tui/tui-commands.js +2 -2
- package/dist/src/tui/tui-keybindings-file.js +1 -1
- package/dist/src/tui/tui-scoped-models.js +2 -2
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +6 -6
- package/dist/src/tunnel/frpc-binary.js +4 -4
- package/dist/src/tunnel/frpc-config.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +1 -1
- package/dist/src/tunnel/tunnel-state.js +1 -1
- package/dist/src/utils/logger/audit.js +1 -1
- package/dist/src/utils/logger/log-store.js +1 -1
- package/dist/src/utils/logger/rotation.js +1 -1
- package/dist/src/utils/logger/streams.js +1 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/openai-compatible-speech.d.ts +1 -1
- package/dist/src/voice/tts/openai-compatible-speech.js.map +1 -1
- package/dist/src/voice/tts/providers/edge-speech.js +15 -3
- package/dist/src/voice/tts/providers/edge-speech.js.map +1 -1
- package/dist/src/voice/tts/speak-core.js +3 -3
- package/dist/src/voice/tts/speak-core.js.map +1 -1
- package/dist/src/voice/tts/speech-provider-types.d.ts +2 -2
- package/dist/src/voice/tts/types.js +1 -1
- package/dist/src/voice/tts/types.js.map +1 -1
- package/dist/src/workflows/domain/result.d.ts +0 -1
- package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
- package/dist/src/workflows/engine/workflow-engine.js +7 -23
- package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/store/event-store.js +1 -1
- package/dist/src/workflows/store/run-store.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agent-browser-settings-page-DPXc4hz8.js +0 -6
- package/dist/gateway/static/root/assets/agent-defaults-tabbed-page-CTJ0YnRQ.js +0 -1
- package/dist/gateway/static/root/assets/agents-zJXQfJ_W.js +0 -71
- package/dist/gateway/static/root/assets/app-management-settings-panel-DzGbdr04.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-CPjfyzSD.js +0 -1
- package/dist/gateway/static/root/assets/connectors-settings-CAXYMOdp.js +0 -2
- package/dist/gateway/static/root/assets/cron-page-DuUbBeKI.js +0 -3
- package/dist/gateway/static/root/assets/dreaming-settings-DQ4DtiK1.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BMPwIjKI.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-BJsyjJnF.js +0 -1
- package/dist/gateway/static/root/assets/goals-page-BerDgIhw.js +0 -2
- package/dist/gateway/static/root/assets/goals-settings-ByTjeAto.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-TbHgcjTn.js +0 -1
- package/dist/gateway/static/root/assets/index-AkTrf6Pb.js +0 -122
- package/dist/gateway/static/root/assets/index-fh5sXTj9.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-DGXuPf5B.js +0 -2
- package/dist/gateway/static/root/assets/messages-upgxw6Ub.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-panel-Bot16nn7.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-page-Brlyou8M.js +0 -2
- package/dist/gateway/static/root/assets/notes-page-DvZ4pwc-.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BZEDmxbZ.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DdGGlsfn.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DlkEkPf9.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-DFPTrsPF.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CYCCfgh4.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Bff1pGd0.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CJGKpBur.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-C6ocduTD.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-5jrIEr5b.js +0 -1
- package/dist/gateway/static/root/assets/use-agent-defaults-form-BuiXLIs5.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DDoQyghO.js +0 -1
- package/dist/gateway/static/root/assets/workflow-page.utils-CKjeEGqx.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-B604ehHG.js +0 -18
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* - request: feature, bugfix, or refactor request
|
|
10
10
|
* - scope: optional repo path or subsystem hint
|
|
11
11
|
*/
|
|
12
|
-
export declare const IMPLEMENTATION_PLAN_SCRIPT = "export const meta = {\n name: 'implementation_plan',\n description: 'Create an actionable implementation plan from a feature, refactor, or bugfix request.',\n whenToUse: 'User wants a technical plan before coding, especially for multi-file or unfamiliar code changes.',\n examplePrompts: [\n { field: 'request', text: 'Plan a refactor of the session store' },\n { field: 'request', text: 'Design implementation steps for OAuth login' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u529F\u80FD\u3001\u91CD\u6784\u6216\u4FEE\u590D\u9700\u6C42\u8F6C\u5316\u4E3A\u53EF\u6267\u884C\u7684\u5B9E\u73B0\u8BA1\u5212\u3002',\n whenToUse: '\u7528\u6237\u60F3\u5728\u52A8\u624B\u5199\u4EE3\u7801\u524D\u62FF\u5230\u6280\u672F\u65B9\u6848\uFF0C\u5C24\u5176\u662F\u591A\u6587\u4EF6\u6216\u4E0D\u719F\u6089\u4EE3\u7801\u7684\u6539\u52A8\u3002',\n examplePrompts: [\n { field: 'request', text: '\u89C4\u5212 session store \u7684\u91CD\u6784\u6B65\u9AA4' },\n { field: 'request', text: '\u8BBE\u8BA1 OAuth \u767B\u5F55\u7684\u5B9E\u73B0\u6B65\u9AA4' },\n ],\n },\n },\n tags: ['planning', 'implementation', 'architecture'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Frame' },\n { title: 'Explore' },\n { title: 'Plan' },\n { title: 'Validate' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst request = args && typeof args === 'object' && args.request\n ? String(args.request)\n : 'Infer the implementation request from the current conversation context.'\n\nconst scope = args && typeof args === 'object' && args.scope\n ? String(args.scope)\n : '.'\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this implementation request. Identify the desired outcome, non-goals, likely affected domains, and open questions. Be concrete and avoid generic advice.\\n\\n' +\n 'REQUEST:\\n' + request + '\\n\\nSCOPE HINT:\\n' + scope,\n {\n label: 'request framing',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n outcome: { type: 'string' },\n nonGoals: { type: 'array', items: { type: 'string' } },\n affectedDomains: { type: 'array', items: { type: 'string' } },\n openQuestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['outcome', 'affectedDomains'],\n },\n },\n)\n\nconst AREAS = [\n { key: 'entrypoints', focus: 'Routes, commands, UI pages, public APIs, and user-facing surfaces that must change.' },\n { key: 'domain', focus: 'Core domain model, state transitions, stores, services, and invariants.' },\n { key: 'integration', focus: 'Cross-module dependencies, config, events, async jobs, persistence, and external APIs.' },\n { key: 'validation', focus: 'Existing tests, missing regression tests, build/type/lint commands, and release validation.' },\n]\n\nphase('Explore')\nconst explorations = await parallel(\n AREAS.map((area) => () =>\n agent(\n 'Explore the repository for this implementation plan through the ' + area.key + ' lens.\\n' +\n 'Focus: ' + area.focus + '\\n\\n' +\n 'REQUEST:\\n' + request + '\\n\\n' +\n 'FRAME:\\n' + JSON.stringify(frame, null, 2) + '\\n\\n' +\n 'Return concrete files/functions/modules to inspect or modify, existing patterns to follow, and constraints that affect the plan.',\n {\n label: area.key + ' exploration',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n targets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['path', 'reason'],\n },\n },\n patterns: { type: 'array', items: { type: 'string' } },\n constraints: { type: 'array', items: { type: 'string' } },\n },\n required: ['targets', 'constraints'],\n },\n },\n ),\n ),\n)\n\nphase('Plan')\nconst plan = await agent(\n 'Synthesize an implementation plan from the framing and explorations. Make it executable by an engineer or coding agent. ' +\n 'Use phased tasks, name the concrete files/modules, include sequencing/dependencies, and call out decisions that need user confirmation.\\n\\n' +\n JSON.stringify({ request, scope, frame, explorations }, null, 2),\n {\n label: 'plan synthesis',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n phases: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n tasks: { type: 'array', items: { type: 'string' } },\n files: { type: 'array', items: { type: 'string' } },\n },\n required: ['title', 'tasks'],\n },\n },\n decisions: { type: 'array', items: { type: 'string' } },\n risks: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'phases', 'risks'],\n },\n },\n)\n\nphase('Validate')\nconst validation = await agent(\n 'Create a validation checklist for this implementation plan. Include targeted tests, full commands, manual UI/API checks if relevant, and rollback/recovery notes.\\n\\n' +\n JSON.stringify({ request, plan }, null, 2),\n {\n label: 'validation checklist',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n testCommands: { type: 'array', items: { type: 'string' } },\n manualChecks: { type: 'array', items: { type: 'string' } },\n rollbackNotes: { type: 'array', items: { type: 'string' } },\n },\n required: ['testCommands', 'manualChecks'],\n },\n },\n)\n\
|
|
12
|
+
export declare const IMPLEMENTATION_PLAN_SCRIPT = "export const meta = {\n name: 'implementation_plan',\n description: 'Create an actionable implementation plan from a feature, refactor, or bugfix request.',\n whenToUse: 'User wants a technical plan before coding, especially for multi-file or unfamiliar code changes.',\n examplePrompts: [\n { field: 'request', text: 'Plan a refactor of the session store' },\n { field: 'request', text: 'Design implementation steps for OAuth login' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u529F\u80FD\u3001\u91CD\u6784\u6216\u4FEE\u590D\u9700\u6C42\u8F6C\u5316\u4E3A\u53EF\u6267\u884C\u7684\u5B9E\u73B0\u8BA1\u5212\u3002',\n whenToUse: '\u7528\u6237\u60F3\u5728\u52A8\u624B\u5199\u4EE3\u7801\u524D\u62FF\u5230\u6280\u672F\u65B9\u6848\uFF0C\u5C24\u5176\u662F\u591A\u6587\u4EF6\u6216\u4E0D\u719F\u6089\u4EE3\u7801\u7684\u6539\u52A8\u3002',\n examplePrompts: [\n { field: 'request', text: '\u89C4\u5212 session store \u7684\u91CD\u6784\u6B65\u9AA4' },\n { field: 'request', text: '\u8BBE\u8BA1 OAuth \u767B\u5F55\u7684\u5B9E\u73B0\u6B65\u9AA4' },\n ],\n },\n },\n tags: ['planning', 'implementation', 'architecture'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Frame' },\n { title: 'Explore' },\n { title: 'Plan' },\n { title: 'Validate' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst request = args && typeof args === 'object' && args.request\n ? String(args.request)\n : 'Infer the implementation request from the current conversation context.'\n\nconst scope = args && typeof args === 'object' && args.scope\n ? String(args.scope)\n : '.'\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this implementation request. Identify the desired outcome, non-goals, likely affected domains, and open questions. Be concrete and avoid generic advice.\\n\\n' +\n 'REQUEST:\\n' + request + '\\n\\nSCOPE HINT:\\n' + scope,\n {\n label: 'request framing',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n outcome: { type: 'string' },\n nonGoals: { type: 'array', items: { type: 'string' } },\n affectedDomains: { type: 'array', items: { type: 'string' } },\n openQuestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['outcome', 'affectedDomains'],\n },\n },\n)\n\nconst AREAS = [\n { key: 'entrypoints', focus: 'Routes, commands, UI pages, public APIs, and user-facing surfaces that must change.' },\n { key: 'domain', focus: 'Core domain model, state transitions, stores, services, and invariants.' },\n { key: 'integration', focus: 'Cross-module dependencies, config, events, async jobs, persistence, and external APIs.' },\n { key: 'validation', focus: 'Existing tests, missing regression tests, build/type/lint commands, and release validation.' },\n]\n\nphase('Explore')\nconst explorations = await parallel(\n AREAS.map((area) => () =>\n agent(\n 'Explore the repository for this implementation plan through the ' + area.key + ' lens.\\n' +\n 'Focus: ' + area.focus + '\\n\\n' +\n 'REQUEST:\\n' + request + '\\n\\n' +\n 'FRAME:\\n' + JSON.stringify(frame, null, 2) + '\\n\\n' +\n 'Return concrete files/functions/modules to inspect or modify, existing patterns to follow, and constraints that affect the plan.',\n {\n label: area.key + ' exploration',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n targets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['path', 'reason'],\n },\n },\n patterns: { type: 'array', items: { type: 'string' } },\n constraints: { type: 'array', items: { type: 'string' } },\n },\n required: ['targets', 'constraints'],\n },\n },\n ),\n ),\n)\n\nphase('Plan')\nconst plan = await agent(\n 'Synthesize an implementation plan from the framing and explorations. Make it executable by an engineer or coding agent. ' +\n 'Use phased tasks, name the concrete files/modules, include sequencing/dependencies, and call out decisions that need user confirmation.\\n\\n' +\n JSON.stringify({ request, scope, frame, explorations }, null, 2),\n {\n label: 'plan synthesis',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n phases: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n tasks: { type: 'array', items: { type: 'string' } },\n files: { type: 'array', items: { type: 'string' } },\n },\n required: ['title', 'tasks'],\n },\n },\n decisions: { type: 'array', items: { type: 'string' } },\n risks: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'phases', 'risks'],\n },\n },\n)\n\nphase('Validate')\nconst validation = await agent(\n 'Create a validation checklist for this implementation plan. Include targeted tests, full commands, manual UI/API checks if relevant, and rollback/recovery notes.\\n\\n' +\n JSON.stringify({ request, plan }, null, 2),\n {\n label: 'validation checklist',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n testCommands: { type: 'array', items: { type: 'string' } },\n manualChecks: { type: 'array', items: { type: 'string' } },\n rollbackNotes: { type: 'array', items: { type: 'string' } },\n },\n required: ['testCommands', 'manualChecks'],\n },\n },\n)\n\nconst output = {\n ok: true,\n request,\n scope,\n ...(plan ?? { summary: 'plan synthesis failed', phases: [], decisions: [], risks: [] }),\n validation: validation ?? { testCommands: [], manualChecks: [], rollbackNotes: [] },\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'json', title: 'Plan phases', value: output.phases },\n { kind: 'questions', title: 'Decisions', items: output.decisions ?? [] },\n { kind: 'risks', title: 'Risks', items: output.risks.map((title) => ({ title })) },\n { kind: 'json', title: 'Validation', value: output.validation },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -161,13 +161,23 @@ const validation = await agent(
|
|
|
161
161
|
},
|
|
162
162
|
)
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
const output = {
|
|
165
165
|
ok: true,
|
|
166
166
|
request,
|
|
167
167
|
scope,
|
|
168
168
|
...(plan ?? { summary: 'plan synthesis failed', phases: [], decisions: [], risks: [] }),
|
|
169
169
|
validation: validation ?? { testCommands: [], manualChecks: [], rollbackNotes: [] },
|
|
170
170
|
}
|
|
171
|
+
return {
|
|
172
|
+
summary: output.summary,
|
|
173
|
+
sections: [
|
|
174
|
+
{ kind: 'json', title: 'Plan phases', value: output.phases },
|
|
175
|
+
{ kind: 'questions', title: 'Decisions', items: output.decisions ?? [] },
|
|
176
|
+
{ kind: 'risks', title: 'Risks', items: output.risks.map((title) => ({ title })) },
|
|
177
|
+
{ kind: 'json', title: 'Validation', value: output.validation },
|
|
178
|
+
],
|
|
179
|
+
structuredOutput: output,
|
|
180
|
+
}
|
|
171
181
|
`;
|
|
172
182
|
//#endregion
|
|
173
183
|
export { IMPLEMENTATION_PLAN_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation-plan.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/implementation-plan.ts"],"sourcesContent":["/**\n * Built-in workflow: `implementation_plan`\n *\n * Turns a feature or refactor request into an actionable implementation plan.\n * It first frames the goal, then explores relevant code areas in parallel, and\n * finally synthesizes phased tasks with risks and validation steps.\n *\n * Args:\n * - request: feature, bugfix, or refactor request\n * - scope: optional repo path or subsystem hint\n */\n\nexport const IMPLEMENTATION_PLAN_SCRIPT = `export const meta = {\n name: 'implementation_plan',\n description: 'Create an actionable implementation plan from a feature, refactor, or bugfix request.',\n whenToUse: 'User wants a technical plan before coding, especially for multi-file or unfamiliar code changes.',\n examplePrompts: [\n { field: 'request', text: 'Plan a refactor of the session store' },\n { field: 'request', text: 'Design implementation steps for OAuth login' },\n ],\n i18n: {\n zh: {\n description: '将功能、重构或修复需求转化为可执行的实现计划。',\n whenToUse: '用户想在动手写代码前拿到技术方案,尤其是多文件或不熟悉代码的改动。',\n examplePrompts: [\n { field: 'request', text: '规划 session store 的重构步骤' },\n { field: 'request', text: '设计 OAuth 登录的实现步骤' },\n ],\n },\n },\n tags: ['planning', 'implementation', 'architecture'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Frame' },\n { title: 'Explore' },\n { title: 'Plan' },\n { title: 'Validate' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst request = args && typeof args === 'object' && args.request\n ? String(args.request)\n : 'Infer the implementation request from the current conversation context.'\n\nconst scope = args && typeof args === 'object' && args.scope\n ? String(args.scope)\n : '.'\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this implementation request. Identify the desired outcome, non-goals, likely affected domains, and open questions. Be concrete and avoid generic advice.\\\\n\\\\n' +\n 'REQUEST:\\\\n' + request + '\\\\n\\\\nSCOPE HINT:\\\\n' + scope,\n {\n label: 'request framing',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n outcome: { type: 'string' },\n nonGoals: { type: 'array', items: { type: 'string' } },\n affectedDomains: { type: 'array', items: { type: 'string' } },\n openQuestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['outcome', 'affectedDomains'],\n },\n },\n)\n\nconst AREAS = [\n { key: 'entrypoints', focus: 'Routes, commands, UI pages, public APIs, and user-facing surfaces that must change.' },\n { key: 'domain', focus: 'Core domain model, state transitions, stores, services, and invariants.' },\n { key: 'integration', focus: 'Cross-module dependencies, config, events, async jobs, persistence, and external APIs.' },\n { key: 'validation', focus: 'Existing tests, missing regression tests, build/type/lint commands, and release validation.' },\n]\n\nphase('Explore')\nconst explorations = await parallel(\n AREAS.map((area) => () =>\n agent(\n 'Explore the repository for this implementation plan through the ' + area.key + ' lens.\\\\n' +\n 'Focus: ' + area.focus + '\\\\n\\\\n' +\n 'REQUEST:\\\\n' + request + '\\\\n\\\\n' +\n 'FRAME:\\\\n' + JSON.stringify(frame, null, 2) + '\\\\n\\\\n' +\n 'Return concrete files/functions/modules to inspect or modify, existing patterns to follow, and constraints that affect the plan.',\n {\n label: area.key + ' exploration',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n targets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['path', 'reason'],\n },\n },\n patterns: { type: 'array', items: { type: 'string' } },\n constraints: { type: 'array', items: { type: 'string' } },\n },\n required: ['targets', 'constraints'],\n },\n },\n ),\n ),\n)\n\nphase('Plan')\nconst plan = await agent(\n 'Synthesize an implementation plan from the framing and explorations. Make it executable by an engineer or coding agent. ' +\n 'Use phased tasks, name the concrete files/modules, include sequencing/dependencies, and call out decisions that need user confirmation.\\\\n\\\\n' +\n JSON.stringify({ request, scope, frame, explorations }, null, 2),\n {\n label: 'plan synthesis',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n phases: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n tasks: { type: 'array', items: { type: 'string' } },\n files: { type: 'array', items: { type: 'string' } },\n },\n required: ['title', 'tasks'],\n },\n },\n decisions: { type: 'array', items: { type: 'string' } },\n risks: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'phases', 'risks'],\n },\n },\n)\n\nphase('Validate')\nconst validation = await agent(\n 'Create a validation checklist for this implementation plan. Include targeted tests, full commands, manual UI/API checks if relevant, and rollback/recovery notes.\\\\n\\\\n' +\n JSON.stringify({ request, plan }, null, 2),\n {\n label: 'validation checklist',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n testCommands: { type: 'array', items: { type: 'string' } },\n manualChecks: { type: 'array', items: { type: 'string' } },\n rollbackNotes: { type: 'array', items: { type: 'string' } },\n },\n required: ['testCommands', 'manualChecks'],\n },\n },\n)\n\
|
|
1
|
+
{"version":3,"file":"implementation-plan.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/implementation-plan.ts"],"sourcesContent":["/**\n * Built-in workflow: `implementation_plan`\n *\n * Turns a feature or refactor request into an actionable implementation plan.\n * It first frames the goal, then explores relevant code areas in parallel, and\n * finally synthesizes phased tasks with risks and validation steps.\n *\n * Args:\n * - request: feature, bugfix, or refactor request\n * - scope: optional repo path or subsystem hint\n */\n\nexport const IMPLEMENTATION_PLAN_SCRIPT = `export const meta = {\n name: 'implementation_plan',\n description: 'Create an actionable implementation plan from a feature, refactor, or bugfix request.',\n whenToUse: 'User wants a technical plan before coding, especially for multi-file or unfamiliar code changes.',\n examplePrompts: [\n { field: 'request', text: 'Plan a refactor of the session store' },\n { field: 'request', text: 'Design implementation steps for OAuth login' },\n ],\n i18n: {\n zh: {\n description: '将功能、重构或修复需求转化为可执行的实现计划。',\n whenToUse: '用户想在动手写代码前拿到技术方案,尤其是多文件或不熟悉代码的改动。',\n examplePrompts: [\n { field: 'request', text: '规划 session store 的重构步骤' },\n { field: 'request', text: '设计 OAuth 登录的实现步骤' },\n ],\n },\n },\n tags: ['planning', 'implementation', 'architecture'],\n estimatedAgents: { min: 5, max: 6 },\n phases: [\n { title: 'Frame' },\n { title: 'Explore' },\n { title: 'Plan' },\n { title: 'Validate' },\n ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir']\n\nconst request = args && typeof args === 'object' && args.request\n ? String(args.request)\n : 'Infer the implementation request from the current conversation context.'\n\nconst scope = args && typeof args === 'object' && args.scope\n ? String(args.scope)\n : '.'\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this implementation request. Identify the desired outcome, non-goals, likely affected domains, and open questions. Be concrete and avoid generic advice.\\\\n\\\\n' +\n 'REQUEST:\\\\n' + request + '\\\\n\\\\nSCOPE HINT:\\\\n' + scope,\n {\n label: 'request framing',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n outcome: { type: 'string' },\n nonGoals: { type: 'array', items: { type: 'string' } },\n affectedDomains: { type: 'array', items: { type: 'string' } },\n openQuestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['outcome', 'affectedDomains'],\n },\n },\n)\n\nconst AREAS = [\n { key: 'entrypoints', focus: 'Routes, commands, UI pages, public APIs, and user-facing surfaces that must change.' },\n { key: 'domain', focus: 'Core domain model, state transitions, stores, services, and invariants.' },\n { key: 'integration', focus: 'Cross-module dependencies, config, events, async jobs, persistence, and external APIs.' },\n { key: 'validation', focus: 'Existing tests, missing regression tests, build/type/lint commands, and release validation.' },\n]\n\nphase('Explore')\nconst explorations = await parallel(\n AREAS.map((area) => () =>\n agent(\n 'Explore the repository for this implementation plan through the ' + area.key + ' lens.\\\\n' +\n 'Focus: ' + area.focus + '\\\\n\\\\n' +\n 'REQUEST:\\\\n' + request + '\\\\n\\\\n' +\n 'FRAME:\\\\n' + JSON.stringify(frame, null, 2) + '\\\\n\\\\n' +\n 'Return concrete files/functions/modules to inspect or modify, existing patterns to follow, and constraints that affect the plan.',\n {\n label: area.key + ' exploration',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n targets: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['path', 'reason'],\n },\n },\n patterns: { type: 'array', items: { type: 'string' } },\n constraints: { type: 'array', items: { type: 'string' } },\n },\n required: ['targets', 'constraints'],\n },\n },\n ),\n ),\n)\n\nphase('Plan')\nconst plan = await agent(\n 'Synthesize an implementation plan from the framing and explorations. Make it executable by an engineer or coding agent. ' +\n 'Use phased tasks, name the concrete files/modules, include sequencing/dependencies, and call out decisions that need user confirmation.\\\\n\\\\n' +\n JSON.stringify({ request, scope, frame, explorations }, null, 2),\n {\n label: 'plan synthesis',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n phases: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n tasks: { type: 'array', items: { type: 'string' } },\n files: { type: 'array', items: { type: 'string' } },\n },\n required: ['title', 'tasks'],\n },\n },\n decisions: { type: 'array', items: { type: 'string' } },\n risks: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'phases', 'risks'],\n },\n },\n)\n\nphase('Validate')\nconst validation = await agent(\n 'Create a validation checklist for this implementation plan. Include targeted tests, full commands, manual UI/API checks if relevant, and rollback/recovery notes.\\\\n\\\\n' +\n JSON.stringify({ request, plan }, null, 2),\n {\n label: 'validation checklist',\n toolset: READ_ONLY_TOOLS,\n schema: {\n type: 'object',\n properties: {\n testCommands: { type: 'array', items: { type: 'string' } },\n manualChecks: { type: 'array', items: { type: 'string' } },\n rollbackNotes: { type: 'array', items: { type: 'string' } },\n },\n required: ['testCommands', 'manualChecks'],\n },\n },\n)\n\nconst output = {\n ok: true,\n request,\n scope,\n ...(plan ?? { summary: 'plan synthesis failed', phases: [], decisions: [], risks: [] }),\n validation: validation ?? { testCommands: [], manualChecks: [], rollbackNotes: [] },\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'json', title: 'Plan phases', value: output.phases },\n { kind: 'questions', title: 'Decisions', items: output.decisions ?? [] },\n { kind: 'risks', title: 'Risks', items: output.risks.map((title) => ({ title })) },\n { kind: 'json', title: 'Validation', value: output.validation },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,6BAA6B"}
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* - inbox: pasted items to triage
|
|
9
9
|
* - priorities: this week's focus (optional)
|
|
10
10
|
*/
|
|
11
|
-
export declare const INBOX_TRIAGE_SCRIPT = "export const meta = {\n name: 'inbox_triage',\n description: 'Sort messy inbox input into today-must-do, delegate/automate, defer, and drop \u2014 with priorities.',\n whenToUse: 'Solo operator starting the day with emails, messages, and todos to sort in limited time.',\n examplePrompts: [\n { field: 'inbox', text: 'Client email re: deadline, newsletter idea, tax reminder, Slack ping, bug report' },\n { field: 'priorities', text: 'Ship v1 landing page and close one sales call this week' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u90AE\u4EF6\u3001\u6D88\u606F\u3001\u5F85\u529E\u7B49\u6742\u4E71\u8F93\u5165\u5206\u62E3\u4E3A\u4ECA\u65E5\u5FC5\u505A\u3001\u53EF\u59D4\u6D3E/\u81EA\u52A8\u5316\u3001\u5EF6\u540E\u3001\u53EF\u5220\u9664\uFF0C\u5E76\u6392\u5E8F\u3002',\n whenToUse: '\u8D85\u7EA7\u4E2A\u4F53\u5F00\u5DE5\u524D\u9700\u8981\u7406\u6E05\u4FE1\u606F\u3001\u4EFB\u52A1\u4F18\u5148\u7EA7\uFF0C\u4E14\u65F6\u95F4\u6709\u9650\u65F6\u3002',\n examplePrompts: [\n { field: 'inbox', text: '\u5BA2\u6237\u50AC\u8FDB\u5EA6\u90AE\u4EF6\u3001newsletter \u7075\u611F\u3001\u62A5\u7A0E\u63D0\u9192\u3001Slack @\u3001\u4E00\u4E2A bug \u53CD\u9988' },\n { field: 'priorities', text: '\u672C\u5468\u8981\u4E0A\u7EBF v1 \u843D\u5730\u9875\u5E76\u5B8C\u6210\u4E00\u6B21\u9500\u552E\u901A\u8BDD' },\n ],\n },\n },\n tags: ['productivity', 'brainstorm'],\n estimatedAgents: { min: 3, max: 4 },\n phases: [\n { title: 'Classify' },\n { title: 'Prioritize' },\n { title: 'Action list' },\n ],\n}\n\nconst inbox = args && typeof args === 'object' && args.inbox\n ? String(args.inbox)\n : 'Infer inbox items from the most recent user turn.'\n\nconst priorities = args && typeof args === 'object' && args.priorities\n ? String(args.priorities)\n : ''\n\nphase('Classify')\nconst classified = await agent(\n 'Classify each inbox item. Buckets: do_today, schedule_later, delegate_or_automate, drop, idea_parking. Extract implicit tasks and estimated minutes.\\n\\n' +\n 'INBOX:\\n' + inbox + '\\nWEEKLY PRIORITIES:\\n' + (priorities || '(not specified)'),\n {\n label: 'classify',\n schema: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n raw: { type: 'string' },\n bucket: {\n type: 'string',\n enum: ['do_today', 'schedule_later', 'delegate_or_automate', 'drop', 'idea_parking'],\n },\n task: { type: 'string' },\n minutes: { type: 'number' },\n },\n required: ['raw', 'bucket', 'task'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Prioritize')\nconst prioritized = await agent(\n 'Prioritize do_today items for a solo operator with ~4\u20136 focused hours. Rank by impact vs effort. Flag conflicts with weekly priorities. Suggest what to batch.\\n\\n' +\n JSON.stringify({ priorities, classified }, null, 2),\n {\n label: 'prioritize',\n schema: {\n type: 'object',\n properties: {\n rankedToday: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n rank: { type: 'number' },\n impact: { type: 'string', enum: ['low', 'med', 'high'] },\n reason: { type: 'string' },\n },\n required: ['task', 'rank', 'impact'],\n },\n },\n conflicts: { type: 'array', items: { type: 'string' } },\n batchSuggestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['rankedToday'],\n },\n },\n)\n\nphase('Action list')\nconst actionList = await agent(\n 'Produce a concrete action list: top 3 for today with time blocks, quick wins under 15 min, delegate/automate suggestions, and parking lot for ideas. End with one sentence focus theme for the day.\\n\\n' +\n JSON.stringify({ classified, prioritized }, null, 2),\n {\n label: 'action list',\n schema: {\n type: 'object',\n properties: {\n focusTheme: { type: 'string' },\n topThree: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n timeBlock: { type: 'string' },\n },\n required: ['task'],\n },\n },\n quickWins: { type: 'array', items: { type: 'string' } },\n delegateOrAutomate: { type: 'array', items: { type: 'string' } },\n parkingLot: { type: 'array', items: { type: 'string' } },\n },\n required: ['focusTheme', 'topThree'],\n },\n },\n)\n\
|
|
11
|
+
export declare const INBOX_TRIAGE_SCRIPT = "export const meta = {\n name: 'inbox_triage',\n description: 'Sort messy inbox input into today-must-do, delegate/automate, defer, and drop \u2014 with priorities.',\n whenToUse: 'Solo operator starting the day with emails, messages, and todos to sort in limited time.',\n examplePrompts: [\n { field: 'inbox', text: 'Client email re: deadline, newsletter idea, tax reminder, Slack ping, bug report' },\n { field: 'priorities', text: 'Ship v1 landing page and close one sales call this week' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u90AE\u4EF6\u3001\u6D88\u606F\u3001\u5F85\u529E\u7B49\u6742\u4E71\u8F93\u5165\u5206\u62E3\u4E3A\u4ECA\u65E5\u5FC5\u505A\u3001\u53EF\u59D4\u6D3E/\u81EA\u52A8\u5316\u3001\u5EF6\u540E\u3001\u53EF\u5220\u9664\uFF0C\u5E76\u6392\u5E8F\u3002',\n whenToUse: '\u8D85\u7EA7\u4E2A\u4F53\u5F00\u5DE5\u524D\u9700\u8981\u7406\u6E05\u4FE1\u606F\u3001\u4EFB\u52A1\u4F18\u5148\u7EA7\uFF0C\u4E14\u65F6\u95F4\u6709\u9650\u65F6\u3002',\n examplePrompts: [\n { field: 'inbox', text: '\u5BA2\u6237\u50AC\u8FDB\u5EA6\u90AE\u4EF6\u3001newsletter \u7075\u611F\u3001\u62A5\u7A0E\u63D0\u9192\u3001Slack @\u3001\u4E00\u4E2A bug \u53CD\u9988' },\n { field: 'priorities', text: '\u672C\u5468\u8981\u4E0A\u7EBF v1 \u843D\u5730\u9875\u5E76\u5B8C\u6210\u4E00\u6B21\u9500\u552E\u901A\u8BDD' },\n ],\n },\n },\n tags: ['productivity', 'brainstorm'],\n estimatedAgents: { min: 3, max: 4 },\n phases: [\n { title: 'Classify' },\n { title: 'Prioritize' },\n { title: 'Action list' },\n ],\n}\n\nconst inbox = args && typeof args === 'object' && args.inbox\n ? String(args.inbox)\n : 'Infer inbox items from the most recent user turn.'\n\nconst priorities = args && typeof args === 'object' && args.priorities\n ? String(args.priorities)\n : ''\n\nphase('Classify')\nconst classified = await agent(\n 'Classify each inbox item. Buckets: do_today, schedule_later, delegate_or_automate, drop, idea_parking. Extract implicit tasks and estimated minutes.\\n\\n' +\n 'INBOX:\\n' + inbox + '\\nWEEKLY PRIORITIES:\\n' + (priorities || '(not specified)'),\n {\n label: 'classify',\n schema: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n raw: { type: 'string' },\n bucket: {\n type: 'string',\n enum: ['do_today', 'schedule_later', 'delegate_or_automate', 'drop', 'idea_parking'],\n },\n task: { type: 'string' },\n minutes: { type: 'number' },\n },\n required: ['raw', 'bucket', 'task'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Prioritize')\nconst prioritized = await agent(\n 'Prioritize do_today items for a solo operator with ~4\u20136 focused hours. Rank by impact vs effort. Flag conflicts with weekly priorities. Suggest what to batch.\\n\\n' +\n JSON.stringify({ priorities, classified }, null, 2),\n {\n label: 'prioritize',\n schema: {\n type: 'object',\n properties: {\n rankedToday: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n rank: { type: 'number' },\n impact: { type: 'string', enum: ['low', 'med', 'high'] },\n reason: { type: 'string' },\n },\n required: ['task', 'rank', 'impact'],\n },\n },\n conflicts: { type: 'array', items: { type: 'string' } },\n batchSuggestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['rankedToday'],\n },\n },\n)\n\nphase('Action list')\nconst actionList = await agent(\n 'Produce a concrete action list: top 3 for today with time blocks, quick wins under 15 min, delegate/automate suggestions, and parking lot for ideas. End with one sentence focus theme for the day.\\n\\n' +\n JSON.stringify({ classified, prioritized }, null, 2),\n {\n label: 'action list',\n schema: {\n type: 'object',\n properties: {\n focusTheme: { type: 'string' },\n topThree: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n timeBlock: { type: 'string' },\n },\n required: ['task'],\n },\n },\n quickWins: { type: 'array', items: { type: 'string' } },\n delegateOrAutomate: { type: 'array', items: { type: 'string' } },\n parkingLot: { type: 'array', items: { type: 'string' } },\n },\n required: ['focusTheme', 'topThree'],\n },\n },\n)\n\nconst output = {\n ok: true,\n classified,\n prioritized,\n ...(actionList ?? { focusTheme: 'triage failed', topThree: [] }),\n}\nreturn {\n summary: output.focusTheme,\n sections: [\n { kind: 'json', title: 'Top three', value: output.topThree },\n { kind: 'questions', title: 'Quick wins', items: output.quickWins ?? [] },\n { kind: 'questions', title: 'Delegate or automate', items: output.delegateOrAutomate ?? [] },\n { kind: 'questions', title: 'Parking lot', items: output.parkingLot ?? [] },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -135,12 +135,22 @@ const actionList = await agent(
|
|
|
135
135
|
},
|
|
136
136
|
)
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
const output = {
|
|
139
139
|
ok: true,
|
|
140
140
|
classified,
|
|
141
141
|
prioritized,
|
|
142
142
|
...(actionList ?? { focusTheme: 'triage failed', topThree: [] }),
|
|
143
143
|
}
|
|
144
|
+
return {
|
|
145
|
+
summary: output.focusTheme,
|
|
146
|
+
sections: [
|
|
147
|
+
{ kind: 'json', title: 'Top three', value: output.topThree },
|
|
148
|
+
{ kind: 'questions', title: 'Quick wins', items: output.quickWins ?? [] },
|
|
149
|
+
{ kind: 'questions', title: 'Delegate or automate', items: output.delegateOrAutomate ?? [] },
|
|
150
|
+
{ kind: 'questions', title: 'Parking lot', items: output.parkingLot ?? [] },
|
|
151
|
+
],
|
|
152
|
+
structuredOutput: output,
|
|
153
|
+
}
|
|
144
154
|
`;
|
|
145
155
|
//#endregion
|
|
146
156
|
export { INBOX_TRIAGE_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox-triage.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/inbox-triage.ts"],"sourcesContent":["/**\n * Built-in workflow: `inbox_triage`\n *\n * Triage messy inbox input — emails, messages, todos, ideas — into prioritized\n * action buckets for a solo operator with limited hours.\n *\n * Args:\n * - inbox: pasted items to triage\n * - priorities: this week's focus (optional)\n */\n\nexport const INBOX_TRIAGE_SCRIPT = `export const meta = {\n name: 'inbox_triage',\n description: 'Sort messy inbox input into today-must-do, delegate/automate, defer, and drop — with priorities.',\n whenToUse: 'Solo operator starting the day with emails, messages, and todos to sort in limited time.',\n examplePrompts: [\n { field: 'inbox', text: 'Client email re: deadline, newsletter idea, tax reminder, Slack ping, bug report' },\n { field: 'priorities', text: 'Ship v1 landing page and close one sales call this week' },\n ],\n i18n: {\n zh: {\n description: '将邮件、消息、待办等杂乱输入分拣为今日必做、可委派/自动化、延后、可删除,并排序。',\n whenToUse: '超级个体开工前需要理清信息、任务优先级,且时间有限时。',\n examplePrompts: [\n { field: 'inbox', text: '客户催进度邮件、newsletter 灵感、报税提醒、Slack @、一个 bug 反馈' },\n { field: 'priorities', text: '本周要上线 v1 落地页并完成一次销售通话' },\n ],\n },\n },\n tags: ['productivity', 'brainstorm'],\n estimatedAgents: { min: 3, max: 4 },\n phases: [\n { title: 'Classify' },\n { title: 'Prioritize' },\n { title: 'Action list' },\n ],\n}\n\nconst inbox = args && typeof args === 'object' && args.inbox\n ? String(args.inbox)\n : 'Infer inbox items from the most recent user turn.'\n\nconst priorities = args && typeof args === 'object' && args.priorities\n ? String(args.priorities)\n : ''\n\nphase('Classify')\nconst classified = await agent(\n 'Classify each inbox item. Buckets: do_today, schedule_later, delegate_or_automate, drop, idea_parking. Extract implicit tasks and estimated minutes.\\\\n\\\\n' +\n 'INBOX:\\\\n' + inbox + '\\\\nWEEKLY PRIORITIES:\\\\n' + (priorities || '(not specified)'),\n {\n label: 'classify',\n schema: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n raw: { type: 'string' },\n bucket: {\n type: 'string',\n enum: ['do_today', 'schedule_later', 'delegate_or_automate', 'drop', 'idea_parking'],\n },\n task: { type: 'string' },\n minutes: { type: 'number' },\n },\n required: ['raw', 'bucket', 'task'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Prioritize')\nconst prioritized = await agent(\n 'Prioritize do_today items for a solo operator with ~4–6 focused hours. Rank by impact vs effort. Flag conflicts with weekly priorities. Suggest what to batch.\\\\n\\\\n' +\n JSON.stringify({ priorities, classified }, null, 2),\n {\n label: 'prioritize',\n schema: {\n type: 'object',\n properties: {\n rankedToday: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n rank: { type: 'number' },\n impact: { type: 'string', enum: ['low', 'med', 'high'] },\n reason: { type: 'string' },\n },\n required: ['task', 'rank', 'impact'],\n },\n },\n conflicts: { type: 'array', items: { type: 'string' } },\n batchSuggestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['rankedToday'],\n },\n },\n)\n\nphase('Action list')\nconst actionList = await agent(\n 'Produce a concrete action list: top 3 for today with time blocks, quick wins under 15 min, delegate/automate suggestions, and parking lot for ideas. End with one sentence focus theme for the day.\\\\n\\\\n' +\n JSON.stringify({ classified, prioritized }, null, 2),\n {\n label: 'action list',\n schema: {\n type: 'object',\n properties: {\n focusTheme: { type: 'string' },\n topThree: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n timeBlock: { type: 'string' },\n },\n required: ['task'],\n },\n },\n quickWins: { type: 'array', items: { type: 'string' } },\n delegateOrAutomate: { type: 'array', items: { type: 'string' } },\n parkingLot: { type: 'array', items: { type: 'string' } },\n },\n required: ['focusTheme', 'topThree'],\n },\n },\n)\n\
|
|
1
|
+
{"version":3,"file":"inbox-triage.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/inbox-triage.ts"],"sourcesContent":["/**\n * Built-in workflow: `inbox_triage`\n *\n * Triage messy inbox input — emails, messages, todos, ideas — into prioritized\n * action buckets for a solo operator with limited hours.\n *\n * Args:\n * - inbox: pasted items to triage\n * - priorities: this week's focus (optional)\n */\n\nexport const INBOX_TRIAGE_SCRIPT = `export const meta = {\n name: 'inbox_triage',\n description: 'Sort messy inbox input into today-must-do, delegate/automate, defer, and drop — with priorities.',\n whenToUse: 'Solo operator starting the day with emails, messages, and todos to sort in limited time.',\n examplePrompts: [\n { field: 'inbox', text: 'Client email re: deadline, newsletter idea, tax reminder, Slack ping, bug report' },\n { field: 'priorities', text: 'Ship v1 landing page and close one sales call this week' },\n ],\n i18n: {\n zh: {\n description: '将邮件、消息、待办等杂乱输入分拣为今日必做、可委派/自动化、延后、可删除,并排序。',\n whenToUse: '超级个体开工前需要理清信息、任务优先级,且时间有限时。',\n examplePrompts: [\n { field: 'inbox', text: '客户催进度邮件、newsletter 灵感、报税提醒、Slack @、一个 bug 反馈' },\n { field: 'priorities', text: '本周要上线 v1 落地页并完成一次销售通话' },\n ],\n },\n },\n tags: ['productivity', 'brainstorm'],\n estimatedAgents: { min: 3, max: 4 },\n phases: [\n { title: 'Classify' },\n { title: 'Prioritize' },\n { title: 'Action list' },\n ],\n}\n\nconst inbox = args && typeof args === 'object' && args.inbox\n ? String(args.inbox)\n : 'Infer inbox items from the most recent user turn.'\n\nconst priorities = args && typeof args === 'object' && args.priorities\n ? String(args.priorities)\n : ''\n\nphase('Classify')\nconst classified = await agent(\n 'Classify each inbox item. Buckets: do_today, schedule_later, delegate_or_automate, drop, idea_parking. Extract implicit tasks and estimated minutes.\\\\n\\\\n' +\n 'INBOX:\\\\n' + inbox + '\\\\nWEEKLY PRIORITIES:\\\\n' + (priorities || '(not specified)'),\n {\n label: 'classify',\n schema: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n raw: { type: 'string' },\n bucket: {\n type: 'string',\n enum: ['do_today', 'schedule_later', 'delegate_or_automate', 'drop', 'idea_parking'],\n },\n task: { type: 'string' },\n minutes: { type: 'number' },\n },\n required: ['raw', 'bucket', 'task'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Prioritize')\nconst prioritized = await agent(\n 'Prioritize do_today items for a solo operator with ~4–6 focused hours. Rank by impact vs effort. Flag conflicts with weekly priorities. Suggest what to batch.\\\\n\\\\n' +\n JSON.stringify({ priorities, classified }, null, 2),\n {\n label: 'prioritize',\n schema: {\n type: 'object',\n properties: {\n rankedToday: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n rank: { type: 'number' },\n impact: { type: 'string', enum: ['low', 'med', 'high'] },\n reason: { type: 'string' },\n },\n required: ['task', 'rank', 'impact'],\n },\n },\n conflicts: { type: 'array', items: { type: 'string' } },\n batchSuggestions: { type: 'array', items: { type: 'string' } },\n },\n required: ['rankedToday'],\n },\n },\n)\n\nphase('Action list')\nconst actionList = await agent(\n 'Produce a concrete action list: top 3 for today with time blocks, quick wins under 15 min, delegate/automate suggestions, and parking lot for ideas. End with one sentence focus theme for the day.\\\\n\\\\n' +\n JSON.stringify({ classified, prioritized }, null, 2),\n {\n label: 'action list',\n schema: {\n type: 'object',\n properties: {\n focusTheme: { type: 'string' },\n topThree: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n task: { type: 'string' },\n timeBlock: { type: 'string' },\n },\n required: ['task'],\n },\n },\n quickWins: { type: 'array', items: { type: 'string' } },\n delegateOrAutomate: { type: 'array', items: { type: 'string' } },\n parkingLot: { type: 'array', items: { type: 'string' } },\n },\n required: ['focusTheme', 'topThree'],\n },\n },\n)\n\nconst output = {\n ok: true,\n classified,\n prioritized,\n ...(actionList ?? { focusTheme: 'triage failed', topThree: [] }),\n}\nreturn {\n summary: output.focusTheme,\n sections: [\n { kind: 'json', title: 'Top three', value: output.topThree },\n { kind: 'questions', title: 'Quick wins', items: output.quickWins ?? [] },\n { kind: 'questions', title: 'Delegate or automate', items: output.delegateOrAutomate ?? [] },\n { kind: 'questions', title: 'Parking lot', items: output.parkingLot ?? [] },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,sBAAsB"}
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* - attendees: who is involved (optional)
|
|
10
10
|
* - goal: desired outcome (optional)
|
|
11
11
|
*/
|
|
12
|
-
export declare const MEETING_PREP_SCRIPT = "export const meta = {\n name: 'meeting_prep',\n description: 'Build meeting context, a tight agenda, and prioritized talking points.',\n whenToUse: 'User has an upcoming meeting and wants prep \u2014 agenda, questions, and key messages.',\n examplePrompts: [\n { field: 'meeting_topic', text: 'Prep for a quarterly business review with leadership' },\n { field: 'meeting_topic', text: 'Prepare talking points for a vendor negotiation call' },\n ],\n i18n: {\n zh: {\n description: '\u6574\u7406\u4F1A\u8BAE\u80CC\u666F\u3001\u7D27\u51D1\u8BAE\u7A0B\u4E0E\u4F18\u5148\u53D1\u8A00\u8981\u70B9\u3002',\n whenToUse: '\u7528\u6237\u5373\u5C06\u53C2\u52A0\u4F1A\u8BAE\uFF0C\u9700\u8981\u8BAE\u7A0B\u3001\u63D0\u95EE\u4E0E\u5173\u952E\u4FE1\u606F\u51C6\u5907\u65F6\u3002',\n examplePrompts: [\n { field: 'meeting_topic', text: '\u51C6\u5907\u4E0E\u9886\u5BFC\u5C42\u7684\u5B63\u5EA6\u4E1A\u52A1\u590D\u76D8\u4F1A' },\n { field: 'meeting_topic', text: '\u51C6\u5907\u4F9B\u5E94\u5546\u8C08\u5224\u7535\u8BDD\u7684\u53D1\u8A00\u8981\u70B9' },\n ],\n },\n },\n tags: ['meeting', 'productivity'],\n estimatedAgents: { min: 3, max: 5 },\n phases: [\n { title: 'Context' },\n { title: 'Agenda' },\n { title: 'Talking points' },\n ],\n}\n\nconst meetingTopic = args && typeof args === 'object' && args.meeting_topic\n ? String(args.meeting_topic)\n : 'Infer the meeting topic from the most recent user turn.'\n\nconst attendees = args && typeof args === 'object' && args.attendees\n ? String(args.attendees)\n : 'not specified'\n\nconst goal = args && typeof args === 'object' && args.goal\n ? String(args.goal)\n : 'achieve a clear outcome and aligned next steps'\n\nphase('Context')\nconst context = await agent(\n 'Summarize meeting context. Identify stakeholder interests, likely tensions, information gaps, and success criteria.\\n\\n' +\n 'MEETING:\\n' + meetingTopic + '\\nATTENDEES:\\n' + attendees + '\\nGOAL:\\n' + goal,\n {\n label: 'context',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n stakeholderInterests: { type: 'array', items: { type: 'string' } },\n tensions: { type: 'array', items: { type: 'string' } },\n informationGaps: { type: 'array', items: { type: 'string' } },\n successCriteria: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'successCriteria'],\n },\n },\n)\n\nphase('Agenda')\nconst agenda = await agent(\n 'Draft a time-boxed agenda (30\u201360 min unless context suggests otherwise). Each item needs an owner hint and desired output. Prioritize decisions over status updates.\\n\\n' +\n JSON.stringify({ meetingTopic, attendees, goal, context }, null, 2),\n {\n label: 'agenda',\n schema: {\n type: 'object',\n properties: {\n durationMin: { type: 'number' },\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n minutes: { type: 'number' },\n owner: { type: 'string' },\n output: { type: 'string' },\n },\n required: ['title', 'minutes', 'output'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Talking points')\nconst talkingPoints = await agent(\n 'Produce prioritized talking points: opening line, 3\u20135 key messages, smart questions to ask, objections to anticipate with responses, and a crisp closing ask.\\n\\n' +\n JSON.stringify({ meetingTopic, context, agenda }, null, 2),\n {\n label: 'talking points',\n schema: {\n type: 'object',\n properties: {\n openingLine: { type: 'string' },\n keyMessages: { type: 'array', items: { type: 'string' } },\n questionsToAsk: { type: 'array', items: { type: 'string' } },\n objections: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n objection: { type: 'string' },\n response: { type: 'string' },\n },\n required: ['objection', 'response'],\n },\n },\n closingAsk: { type: 'string' },\n },\n required: ['keyMessages', 'closingAsk'],\n },\n },\n)\n\
|
|
12
|
+
export declare const MEETING_PREP_SCRIPT = "export const meta = {\n name: 'meeting_prep',\n description: 'Build meeting context, a tight agenda, and prioritized talking points.',\n whenToUse: 'User has an upcoming meeting and wants prep \u2014 agenda, questions, and key messages.',\n examplePrompts: [\n { field: 'meeting_topic', text: 'Prep for a quarterly business review with leadership' },\n { field: 'meeting_topic', text: 'Prepare talking points for a vendor negotiation call' },\n ],\n i18n: {\n zh: {\n description: '\u6574\u7406\u4F1A\u8BAE\u80CC\u666F\u3001\u7D27\u51D1\u8BAE\u7A0B\u4E0E\u4F18\u5148\u53D1\u8A00\u8981\u70B9\u3002',\n whenToUse: '\u7528\u6237\u5373\u5C06\u53C2\u52A0\u4F1A\u8BAE\uFF0C\u9700\u8981\u8BAE\u7A0B\u3001\u63D0\u95EE\u4E0E\u5173\u952E\u4FE1\u606F\u51C6\u5907\u65F6\u3002',\n examplePrompts: [\n { field: 'meeting_topic', text: '\u51C6\u5907\u4E0E\u9886\u5BFC\u5C42\u7684\u5B63\u5EA6\u4E1A\u52A1\u590D\u76D8\u4F1A' },\n { field: 'meeting_topic', text: '\u51C6\u5907\u4F9B\u5E94\u5546\u8C08\u5224\u7535\u8BDD\u7684\u53D1\u8A00\u8981\u70B9' },\n ],\n },\n },\n tags: ['meeting', 'productivity'],\n estimatedAgents: { min: 3, max: 5 },\n phases: [\n { title: 'Context' },\n { title: 'Agenda' },\n { title: 'Talking points' },\n ],\n}\n\nconst meetingTopic = args && typeof args === 'object' && args.meeting_topic\n ? String(args.meeting_topic)\n : 'Infer the meeting topic from the most recent user turn.'\n\nconst attendees = args && typeof args === 'object' && args.attendees\n ? String(args.attendees)\n : 'not specified'\n\nconst goal = args && typeof args === 'object' && args.goal\n ? String(args.goal)\n : 'achieve a clear outcome and aligned next steps'\n\nphase('Context')\nconst context = await agent(\n 'Summarize meeting context. Identify stakeholder interests, likely tensions, information gaps, and success criteria.\\n\\n' +\n 'MEETING:\\n' + meetingTopic + '\\nATTENDEES:\\n' + attendees + '\\nGOAL:\\n' + goal,\n {\n label: 'context',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n stakeholderInterests: { type: 'array', items: { type: 'string' } },\n tensions: { type: 'array', items: { type: 'string' } },\n informationGaps: { type: 'array', items: { type: 'string' } },\n successCriteria: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'successCriteria'],\n },\n },\n)\n\nphase('Agenda')\nconst agenda = await agent(\n 'Draft a time-boxed agenda (30\u201360 min unless context suggests otherwise). Each item needs an owner hint and desired output. Prioritize decisions over status updates.\\n\\n' +\n JSON.stringify({ meetingTopic, attendees, goal, context }, null, 2),\n {\n label: 'agenda',\n schema: {\n type: 'object',\n properties: {\n durationMin: { type: 'number' },\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n minutes: { type: 'number' },\n owner: { type: 'string' },\n output: { type: 'string' },\n },\n required: ['title', 'minutes', 'output'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Talking points')\nconst talkingPoints = await agent(\n 'Produce prioritized talking points: opening line, 3\u20135 key messages, smart questions to ask, objections to anticipate with responses, and a crisp closing ask.\\n\\n' +\n JSON.stringify({ meetingTopic, context, agenda }, null, 2),\n {\n label: 'talking points',\n schema: {\n type: 'object',\n properties: {\n openingLine: { type: 'string' },\n keyMessages: { type: 'array', items: { type: 'string' } },\n questionsToAsk: { type: 'array', items: { type: 'string' } },\n objections: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n objection: { type: 'string' },\n response: { type: 'string' },\n },\n required: ['objection', 'response'],\n },\n },\n closingAsk: { type: 'string' },\n },\n required: ['keyMessages', 'closingAsk'],\n },\n },\n)\n\nconst output = {\n ok: true,\n meetingTopic,\n attendees,\n goal,\n context,\n agenda,\n talkingPoints,\n}\nreturn {\n summary: output.talkingPoints?.closingAsk ?? output.goal,\n sections: [\n { kind: 'json', title: 'Agenda', value: output.agenda },\n { kind: 'json', title: 'Talking points', value: output.talkingPoints },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -128,7 +128,7 @@ const talkingPoints = await agent(
|
|
|
128
128
|
},
|
|
129
129
|
)
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
const output = {
|
|
132
132
|
ok: true,
|
|
133
133
|
meetingTopic,
|
|
134
134
|
attendees,
|
|
@@ -137,6 +137,14 @@ return {
|
|
|
137
137
|
agenda,
|
|
138
138
|
talkingPoints,
|
|
139
139
|
}
|
|
140
|
+
return {
|
|
141
|
+
summary: output.talkingPoints?.closingAsk ?? output.goal,
|
|
142
|
+
sections: [
|
|
143
|
+
{ kind: 'json', title: 'Agenda', value: output.agenda },
|
|
144
|
+
{ kind: 'json', title: 'Talking points', value: output.talkingPoints },
|
|
145
|
+
],
|
|
146
|
+
structuredOutput: output,
|
|
147
|
+
}
|
|
140
148
|
`;
|
|
141
149
|
//#endregion
|
|
142
150
|
export { MEETING_PREP_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meeting-prep.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/meeting-prep.ts"],"sourcesContent":["/**\n * Built-in workflow: `meeting_prep`\n *\n * Prepares for a meeting by building context, an agenda, and talking points.\n * Useful for 1:1s, client calls, interviews, or team syncs — no code required.\n *\n * Args:\n * - meeting_topic: what the meeting is about\n * - attendees: who is involved (optional)\n * - goal: desired outcome (optional)\n */\n\nexport const MEETING_PREP_SCRIPT = `export const meta = {\n name: 'meeting_prep',\n description: 'Build meeting context, a tight agenda, and prioritized talking points.',\n whenToUse: 'User has an upcoming meeting and wants prep — agenda, questions, and key messages.',\n examplePrompts: [\n { field: 'meeting_topic', text: 'Prep for a quarterly business review with leadership' },\n { field: 'meeting_topic', text: 'Prepare talking points for a vendor negotiation call' },\n ],\n i18n: {\n zh: {\n description: '整理会议背景、紧凑议程与优先发言要点。',\n whenToUse: '用户即将参加会议,需要议程、提问与关键信息准备时。',\n examplePrompts: [\n { field: 'meeting_topic', text: '准备与领导层的季度业务复盘会' },\n { field: 'meeting_topic', text: '准备供应商谈判电话的发言要点' },\n ],\n },\n },\n tags: ['meeting', 'productivity'],\n estimatedAgents: { min: 3, max: 5 },\n phases: [\n { title: 'Context' },\n { title: 'Agenda' },\n { title: 'Talking points' },\n ],\n}\n\nconst meetingTopic = args && typeof args === 'object' && args.meeting_topic\n ? String(args.meeting_topic)\n : 'Infer the meeting topic from the most recent user turn.'\n\nconst attendees = args && typeof args === 'object' && args.attendees\n ? String(args.attendees)\n : 'not specified'\n\nconst goal = args && typeof args === 'object' && args.goal\n ? String(args.goal)\n : 'achieve a clear outcome and aligned next steps'\n\nphase('Context')\nconst context = await agent(\n 'Summarize meeting context. Identify stakeholder interests, likely tensions, information gaps, and success criteria.\\\\n\\\\n' +\n 'MEETING:\\\\n' + meetingTopic + '\\\\nATTENDEES:\\\\n' + attendees + '\\\\nGOAL:\\\\n' + goal,\n {\n label: 'context',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n stakeholderInterests: { type: 'array', items: { type: 'string' } },\n tensions: { type: 'array', items: { type: 'string' } },\n informationGaps: { type: 'array', items: { type: 'string' } },\n successCriteria: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'successCriteria'],\n },\n },\n)\n\nphase('Agenda')\nconst agenda = await agent(\n 'Draft a time-boxed agenda (30–60 min unless context suggests otherwise). Each item needs an owner hint and desired output. Prioritize decisions over status updates.\\\\n\\\\n' +\n JSON.stringify({ meetingTopic, attendees, goal, context }, null, 2),\n {\n label: 'agenda',\n schema: {\n type: 'object',\n properties: {\n durationMin: { type: 'number' },\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n minutes: { type: 'number' },\n owner: { type: 'string' },\n output: { type: 'string' },\n },\n required: ['title', 'minutes', 'output'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Talking points')\nconst talkingPoints = await agent(\n 'Produce prioritized talking points: opening line, 3–5 key messages, smart questions to ask, objections to anticipate with responses, and a crisp closing ask.\\\\n\\\\n' +\n JSON.stringify({ meetingTopic, context, agenda }, null, 2),\n {\n label: 'talking points',\n schema: {\n type: 'object',\n properties: {\n openingLine: { type: 'string' },\n keyMessages: { type: 'array', items: { type: 'string' } },\n questionsToAsk: { type: 'array', items: { type: 'string' } },\n objections: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n objection: { type: 'string' },\n response: { type: 'string' },\n },\n required: ['objection', 'response'],\n },\n },\n closingAsk: { type: 'string' },\n },\n required: ['keyMessages', 'closingAsk'],\n },\n },\n)\n\
|
|
1
|
+
{"version":3,"file":"meeting-prep.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/meeting-prep.ts"],"sourcesContent":["/**\n * Built-in workflow: `meeting_prep`\n *\n * Prepares for a meeting by building context, an agenda, and talking points.\n * Useful for 1:1s, client calls, interviews, or team syncs — no code required.\n *\n * Args:\n * - meeting_topic: what the meeting is about\n * - attendees: who is involved (optional)\n * - goal: desired outcome (optional)\n */\n\nexport const MEETING_PREP_SCRIPT = `export const meta = {\n name: 'meeting_prep',\n description: 'Build meeting context, a tight agenda, and prioritized talking points.',\n whenToUse: 'User has an upcoming meeting and wants prep — agenda, questions, and key messages.',\n examplePrompts: [\n { field: 'meeting_topic', text: 'Prep for a quarterly business review with leadership' },\n { field: 'meeting_topic', text: 'Prepare talking points for a vendor negotiation call' },\n ],\n i18n: {\n zh: {\n description: '整理会议背景、紧凑议程与优先发言要点。',\n whenToUse: '用户即将参加会议,需要议程、提问与关键信息准备时。',\n examplePrompts: [\n { field: 'meeting_topic', text: '准备与领导层的季度业务复盘会' },\n { field: 'meeting_topic', text: '准备供应商谈判电话的发言要点' },\n ],\n },\n },\n tags: ['meeting', 'productivity'],\n estimatedAgents: { min: 3, max: 5 },\n phases: [\n { title: 'Context' },\n { title: 'Agenda' },\n { title: 'Talking points' },\n ],\n}\n\nconst meetingTopic = args && typeof args === 'object' && args.meeting_topic\n ? String(args.meeting_topic)\n : 'Infer the meeting topic from the most recent user turn.'\n\nconst attendees = args && typeof args === 'object' && args.attendees\n ? String(args.attendees)\n : 'not specified'\n\nconst goal = args && typeof args === 'object' && args.goal\n ? String(args.goal)\n : 'achieve a clear outcome and aligned next steps'\n\nphase('Context')\nconst context = await agent(\n 'Summarize meeting context. Identify stakeholder interests, likely tensions, information gaps, and success criteria.\\\\n\\\\n' +\n 'MEETING:\\\\n' + meetingTopic + '\\\\nATTENDEES:\\\\n' + attendees + '\\\\nGOAL:\\\\n' + goal,\n {\n label: 'context',\n schema: {\n type: 'object',\n properties: {\n summary: { type: 'string' },\n stakeholderInterests: { type: 'array', items: { type: 'string' } },\n tensions: { type: 'array', items: { type: 'string' } },\n informationGaps: { type: 'array', items: { type: 'string' } },\n successCriteria: { type: 'array', items: { type: 'string' } },\n },\n required: ['summary', 'successCriteria'],\n },\n },\n)\n\nphase('Agenda')\nconst agenda = await agent(\n 'Draft a time-boxed agenda (30–60 min unless context suggests otherwise). Each item needs an owner hint and desired output. Prioritize decisions over status updates.\\\\n\\\\n' +\n JSON.stringify({ meetingTopic, attendees, goal, context }, null, 2),\n {\n label: 'agenda',\n schema: {\n type: 'object',\n properties: {\n durationMin: { type: 'number' },\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: { type: 'string' },\n minutes: { type: 'number' },\n owner: { type: 'string' },\n output: { type: 'string' },\n },\n required: ['title', 'minutes', 'output'],\n },\n },\n },\n required: ['items'],\n },\n },\n)\n\nphase('Talking points')\nconst talkingPoints = await agent(\n 'Produce prioritized talking points: opening line, 3–5 key messages, smart questions to ask, objections to anticipate with responses, and a crisp closing ask.\\\\n\\\\n' +\n JSON.stringify({ meetingTopic, context, agenda }, null, 2),\n {\n label: 'talking points',\n schema: {\n type: 'object',\n properties: {\n openingLine: { type: 'string' },\n keyMessages: { type: 'array', items: { type: 'string' } },\n questionsToAsk: { type: 'array', items: { type: 'string' } },\n objections: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n objection: { type: 'string' },\n response: { type: 'string' },\n },\n required: ['objection', 'response'],\n },\n },\n closingAsk: { type: 'string' },\n },\n required: ['keyMessages', 'closingAsk'],\n },\n },\n)\n\nconst output = {\n ok: true,\n meetingTopic,\n attendees,\n goal,\n context,\n agenda,\n talkingPoints,\n}\nreturn {\n summary: output.talkingPoints?.closingAsk ?? output.goal,\n sections: [\n { kind: 'json', title: 'Agenda', value: output.agenda },\n { kind: 'json', title: 'Talking points', value: output.talkingPoints },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,sBAAsB"}
|
|
@@ -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 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\
|
|
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\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";
|
|
@@ -145,7 +145,7 @@ const goNoGo = skipAdversarial
|
|
|
145
145
|
? 'fix_first'
|
|
146
146
|
: 'ship'
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
const output = {
|
|
149
149
|
ok: true,
|
|
150
150
|
target,
|
|
151
151
|
lenses: lenses.map((l) => l.name),
|
|
@@ -156,6 +156,14 @@ return {
|
|
|
156
156
|
topRisks: confirmed.slice(0, 10),
|
|
157
157
|
allVerdicts: verdict?.verdicts ?? [],
|
|
158
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
|
+
}
|
|
159
167
|
`;
|
|
160
168
|
//#endregion
|
|
161
169
|
export { MULTI_PERSPECTIVE_REVIEW_SCRIPT };
|
|
@@ -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 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\
|
|
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"}
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* - audience: target customers
|
|
10
10
|
* - constraints: time or revenue goals (optional)
|
|
11
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\
|
|
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";
|
|
@@ -147,13 +147,22 @@ const positioning = await agent(
|
|
|
147
147
|
},
|
|
148
148
|
)
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
const output = {
|
|
151
151
|
ok: true,
|
|
152
152
|
inventory,
|
|
153
153
|
packages,
|
|
154
154
|
pricing,
|
|
155
155
|
...(positioning ?? { valueProp: 'positioning failed', launchChecklist: [] }),
|
|
156
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
|
+
}
|
|
157
166
|
`;
|
|
158
167
|
//#endregion
|
|
159
168
|
export { OFFER_DESIGN_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
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\
|
|
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"}
|
|
@@ -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 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\
|
|
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\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";
|
|
@@ -156,13 +156,21 @@ const verdict = await agent(
|
|
|
156
156
|
},
|
|
157
157
|
)
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
const output = {
|
|
160
160
|
ok: true,
|
|
161
161
|
target: reviewTarget,
|
|
162
162
|
scope,
|
|
163
163
|
...(verdict ?? { recommendation: 'fix_first', summary: 'verdict failed', blockers: [], suggestions: [] }),
|
|
164
164
|
byReviewer,
|
|
165
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
|
+
}
|
|
166
174
|
`;
|
|
167
175
|
//#endregion
|
|
168
176
|
export { PR_REVIEW_SCRIPT };
|
|
@@ -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 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\
|
|
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\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"}
|