@xopcai/xopc 0.0.114 → 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/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Fp-p7bP1.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-ycbdJRuZ.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-CJzSADJo.js → archive-plugin-CytE5j-e.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BTAB4zGS.js → attachment-load-BvvrN6rF.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DXR1-mct.js → binary-plugins-IBWSitnj.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CzQri9h2.js → block-editor-C-wDpsf-.js} +44 -44
- package/dist/gateway/static/root/assets/channels-settings-Cd3JbeQ1.js +1 -0
- package/dist/gateway/static/root/assets/{config-api-DRqjEvAx.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-BXaZXv1o.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-DSkqMYo7.js → extension-debug-page-BAIyjDlq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-h2dGDbMN.js → extension-page-DEhv2GpC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-hN99RhOi.js → extension-settings-page-DOuAxTDW.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-D9QqUtzZ.js → fetch-CTsREQIe.js} +1 -1
- package/dist/gateway/static/root/assets/{format-interval-label-D6E687rG.js → format-interval-label-D35Bfhtx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CLt_SKTC.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-N7Z_sz7p.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-KnLGpu6h.js +1 -0
- 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-DGPadTw-.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-CEklPQ_r.js → interval-presets-Dq0FXJ65.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Ce_aQ8Iv.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-BMz3xPXO.js → markdown-split-Ca87W8-h.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BalOSoz9.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-C5D1Q5mY.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-CYFR5U9l.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-BQ79Z5IP.js → save-bar-controls-CcdjGcfT.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Bgk6Emue.js → schedule-field-CYr39z76.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DzS36TMa.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-CdjFnSAy.js → settings-collapsible-section-BhzjeGWi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-DZLy_exu.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-_qRDr4g_.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-CbXq97rT.js → use-channel-catalog-BInPrfR5.js} +1 -1
- package/dist/gateway/static/root/assets/{use-settings-tab-guard-DwS3drWK.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-DSuOd9zy.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/gateway/static/root/logo.svg +4 -3
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/session-tool-result-guard.js +8 -1
- package/dist/src/agent/embedded/session-tool-result-guard.js.map +1 -1
- package/dist/src/agent/goals/checklist-judge.d.ts +2 -0
- package/dist/src/agent/goals/checklist-judge.js +4 -3
- package/dist/src/agent/goals/checklist-judge.js.map +1 -1
- package/dist/src/agent/goals/evaluate-turn.d.ts +2 -1
- package/dist/src/agent/goals/evaluate-turn.js +2 -0
- package/dist/src/agent/goals/evaluate-turn.js.map +1 -1
- package/dist/src/agent/goals/post-turn.d.ts +6 -1
- package/dist/src/agent/goals/post-turn.js +20 -4
- package/dist/src/agent/goals/post-turn.js.map +1 -1
- 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/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/factory.js +13 -8
- package/dist/src/agent/tools/factory.js.map +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/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/snapshot.d.ts +10 -0
- package/dist/src/agent/workflow/snapshot.js +136 -1
- package/dist/src/agent/workflow/snapshot.js.map +1 -1
- package/dist/src/channels/catalog/channel-catalog-service.d.ts +2 -1
- package/dist/src/channels/catalog/channel-catalog-service.js +133 -16
- package/dist/src/channels/catalog/channel-catalog-service.js.map +1 -1
- package/dist/src/channels/catalog/channel-catalog-types.d.ts +13 -0
- package/dist/src/cli/commands/doctor/checks/channel-config.js +14 -1
- package/dist/src/cli/commands/doctor/checks/channel-config.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +15 -0
- package/dist/src/config/schema.js +12 -3
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/config/web-patch.d.ts +1 -0
- package/dist/src/config/web-patch.js +1 -0
- package/dist/src/config/web-patch.js.map +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/gateway/hono/app.js +5 -1
- package/dist/src/gateway/hono/app.js.map +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -1
- package/dist/src/gateway/hono/lib/config-payload.js +7 -4
- package/dist/src/gateway/hono/lib/config-payload.js.map +1 -1
- package/dist/src/gateway/hono/middleware/strict-rate-limit.d.ts +4 -0
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +19 -5
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js.map +1 -1
- package/dist/src/gateway/hono/routes/channels.js +18 -14
- package/dist/src/gateway/hono/routes/channels.js.map +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/deps.d.ts +1 -0
- 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/voice.js +14 -1
- package/dist/src/gateway/hono/routes/voice.js.map +1 -1
- package/dist/src/gateway/hono/sse.js.map +1 -1
- package/dist/src/gateway/rate-limit/buckets.d.ts +3 -0
- package/dist/src/gateway/rate-limit/buckets.js +12 -0
- package/dist/src/gateway/rate-limit/buckets.js.map +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/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 +9 -4
- 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/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/types.d.ts +10 -0
- package/dist/src/storage/sqlite/migrations/011_goal_context_messages.sql +8 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +2 -2
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- 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 +3 -3
- package/dist/src/storage/sqlite/schema.sql +9 -0
- package/dist/src/tui/backends/embedded-backend.d.ts +8 -1
- package/dist/src/tui/backends/embedded-backend.js +73 -0
- package/dist/src/tui/backends/embedded-backend.js.map +1 -1
- package/dist/src/tui/backends/gateway-sse-backend.d.ts +2 -1
- package/dist/src/tui/backends/gateway-sse-backend.js +24 -0
- package/dist/src/tui/backends/gateway-sse-backend.js.map +1 -1
- package/dist/src/tui/components/chat-log.d.ts +2 -0
- package/dist/src/tui/components/chat-log.js +19 -0
- package/dist/src/tui/components/chat-log.js.map +1 -1
- package/dist/src/tui/extension-host/autocomplete.d.ts +3 -2
- package/dist/src/tui/extension-host/autocomplete.js +17 -3
- package/dist/src/tui/extension-host/autocomplete.js.map +1 -1
- package/dist/src/tui/extension-host/runtime.d.ts +5 -0
- package/dist/src/tui/extension-host/runtime.js +1 -1
- package/dist/src/tui/extension-host/runtime.js.map +1 -1
- package/dist/src/tui/tui-backend.d.ts +14 -0
- package/dist/src/tui/tui-commands.d.ts +16 -3
- package/dist/src/tui/tui-commands.js +47 -19
- package/dist/src/tui/tui-commands.js.map +1 -1
- package/dist/src/tui/tui-startup-text.js +1 -1
- package/dist/src/tui/tui-startup-text.js.map +1 -1
- package/dist/src/tui/tui.js +72 -1
- package/dist/src/tui/tui.js.map +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 +14 -2
- 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/engine/workflow-engine.js +7 -23
- package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agent-browser-settings-page-CWh7trjd.js +0 -6
- package/dist/gateway/static/root/assets/agent-defaults-tabbed-page-kC8OuLoj.js +0 -1
- package/dist/gateway/static/root/assets/agents-DJWG26Si.js +0 -71
- package/dist/gateway/static/root/assets/app-management-settings-panel-v24i25Oj.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-0V3DXZ7J.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-CIKOkYdO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-settings-ClrDS5jH.js +0 -2
- package/dist/gateway/static/root/assets/cron-page-Chi_4u4P.js +0 -3
- package/dist/gateway/static/root/assets/dreaming-settings-B0_rs2tj.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-1PDi4lI0.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-D_wwXL-t.js +0 -1
- package/dist/gateway/static/root/assets/goals-page-DZ2toZ8y.js +0 -2
- package/dist/gateway/static/root/assets/goals-settings-LFlwtIKE.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BHHAs8ZX.js +0 -1
- package/dist/gateway/static/root/assets/index-DefIdW9q.js +0 -122
- package/dist/gateway/static/root/assets/index-DzmWBkq-.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-j_D2QTuQ.js +0 -2
- package/dist/gateway/static/root/assets/messages-BN_WiUg0.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-panel-CMH_TmZz.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-page-O18BrQPq.js +0 -2
- package/dist/gateway/static/root/assets/notes-page-B_ZYCmY9.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CwKgWixY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-C4fcD-7B.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Ad2OJ86w.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-D2BMY5wo.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-aWwxl_E1.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DUE83uIf.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-mWKJcrog.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-0Sx1Q58n.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-hqaBF5aG.js +0 -1
- package/dist/gateway/static/root/assets/use-agent-defaults-form-zbVIQLOA.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-D6HR0hR2.js +0 -1
- package/dist/gateway/static/root/assets/workflow-page.utils-C0Uq3xyq.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DW0fmWhQ.js +0 -18
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* - source: original article, notes, or talking points
|
|
9
9
|
* - platforms: target platforms (optional)
|
|
10
10
|
*/
|
|
11
|
-
export declare const CONTENT_REPURPOSE_SCRIPT = "export const meta = {\n name: 'content_repurpose',\n description: 'Repurpose one source into platform-specific content (threads, posts, scripts, newsletter).',\n whenToUse: 'User has existing content and wants multi-platform distribution without rewriting from scratch.',\n examplePrompts: [\n { field: 'source', text: '2000-word blog post on building a one-person AI business' },\n { field: 'platforms', text: 'X thread, LinkedIn, 60s video script, newsletter teaser' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u4E00\u4EFD\u6838\u5FC3\u5185\u5BB9\u6539\u7F16\u4E3A\u591A\u5E73\u53F0\u683C\u5F0F\uFF08\u63A8\u6587\u4E32\u3001\u9886\u82F1\u5E16\u3001\u77ED\u89C6\u9891\u811A\u672C\u3001Newsletter \u6458\u8981\uFF09\u3002',\n whenToUse: '\u7528\u6237\u5DF2\u6709\u5185\u5BB9\u7D20\u6750\uFF0C\u9700\u8981\u4E00\u6E90\u591A\u7528\u3001\u591A\u5E73\u53F0\u5206\u53D1\u65F6\u3002',\n examplePrompts: [\n { field: 'source', text: '\u4E00\u7BC7 2000 \u5B57\u5173\u4E8E\u4E00\u4EBA AI \u516C\u53F8\u7684\u535A\u5BA2' },\n { field: 'platforms', text: 'X \u63A8\u6587\u4E32\u3001LinkedIn\u300160 \u79D2\u53E3\u64AD\u7A3F\u3001Newsletter \u5BFC\u8BED' },\n ],\n },\n },\n tags: ['writing', 'content'],\n estimatedAgents: { min: 4, max: 6 },\n phases: [\n { title: 'Extract' },\n { title: 'Adapt' },\n { title: 'Package' },\n ],\n}\n\nconst source = args && typeof args === 'object' && args.source\n ? String(args.source)\n : 'Infer the source content from the most recent user turn.'\n\nconst platformsRaw = args && typeof args === 'object' && args.platforms\n ? String(args.platforms)\n : ''\n\nconst DEFAULT_PLATFORMS = [\n { id: 'x_thread', label: 'X / Twitter thread', format: '5\u20138 tweets, hook-first, one idea per tweet' },\n { id: 'linkedin', label: 'LinkedIn post', format: 'Professional post, 150\u2013250 words, clear CTA' },\n { id: 'short_video', label: 'Short video script', format: '60-second spoken script with hook and CTA' },\n { id: 'newsletter', label: 'Newsletter teaser', format: 'Subject line + 2\u20133 sentence teaser + bullet highlights' },\n]\n\nphase('Extract')\nconst extracted = await agent(\n 'Extract reusable content atoms from this source: core thesis, 3\u20135 key points, best quotes/stats, audience hook, and CTA.\\n\\nSOURCE:\\n' + source,\n {\n label: 'extract',\n schema: {\n type: 'object',\n properties: {\n thesis: { type: 'string' },\n keyPoints: { type: 'array', items: { type: 'string' } },\n hooks: { type: 'array', items: { type: 'string' } },\n quotesOrStats: { type: 'array', items: { type: 'string' } },\n cta: { type: 'string' },\n },\n required: ['thesis', 'keyPoints', 'cta'],\n },\n },\n)\n\nconst targets = platformsRaw\n ? platformsRaw\n .split(/[,\uFF0C\\n]/)\n .map((s) => s.trim())\n .filter(Boolean)\n .map((label, index) => ({\n id: 'custom_' + index,\n label,\n format: 'Native format and length for ' + label,\n }))\n : DEFAULT_PLATFORMS\n\nphase('Adapt')\nconst adaptations = await parallel(\n targets.map((p) => () =>\n agent(\n 'Adapt the extracted content for this platform. Match native tone and length. Return ready-to-publish copy.\\n\\n' +\n 'PLATFORM: ' + p.label + '\\nFORMAT: ' + p.format + '\\n\\n' +\n JSON.stringify(extracted, null, 2),\n {\n label: p.label,\n schema: {\n type: 'object',\n properties: {\n platform: { type: 'string' },\n copy: { type: 'string' },\n notes: { type: 'string' },\n },\n required: ['platform', 'copy'],\n },\n },\n ),\n ),\n)\n\nphase('Package')\nconst packaged = await agent(\n 'Package all platform adaptations with a publishing checklist: suggested order, cross-links between posts, and one optional bonus format (e.g. carousel outline).\\n\\n' +\n JSON.stringify({ extracted, adaptations: adaptations.filter(Boolean) }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n publishingOrder: { type: 'array', items: { type: 'string' } },\n crossLinks: { type: 'array', items: { type: 'string' } },\n bonusFormat: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['publishingOrder', 'summary'],\n },\n },\n)\n\
|
|
11
|
+
export declare const CONTENT_REPURPOSE_SCRIPT = "export const meta = {\n name: 'content_repurpose',\n description: 'Repurpose one source into platform-specific content (threads, posts, scripts, newsletter).',\n whenToUse: 'User has existing content and wants multi-platform distribution without rewriting from scratch.',\n examplePrompts: [\n { field: 'source', text: '2000-word blog post on building a one-person AI business' },\n { field: 'platforms', text: 'X thread, LinkedIn, 60s video script, newsletter teaser' },\n ],\n i18n: {\n zh: {\n description: '\u5C06\u4E00\u4EFD\u6838\u5FC3\u5185\u5BB9\u6539\u7F16\u4E3A\u591A\u5E73\u53F0\u683C\u5F0F\uFF08\u63A8\u6587\u4E32\u3001\u9886\u82F1\u5E16\u3001\u77ED\u89C6\u9891\u811A\u672C\u3001Newsletter \u6458\u8981\uFF09\u3002',\n whenToUse: '\u7528\u6237\u5DF2\u6709\u5185\u5BB9\u7D20\u6750\uFF0C\u9700\u8981\u4E00\u6E90\u591A\u7528\u3001\u591A\u5E73\u53F0\u5206\u53D1\u65F6\u3002',\n examplePrompts: [\n { field: 'source', text: '\u4E00\u7BC7 2000 \u5B57\u5173\u4E8E\u4E00\u4EBA AI \u516C\u53F8\u7684\u535A\u5BA2' },\n { field: 'platforms', text: 'X \u63A8\u6587\u4E32\u3001LinkedIn\u300160 \u79D2\u53E3\u64AD\u7A3F\u3001Newsletter \u5BFC\u8BED' },\n ],\n },\n },\n tags: ['writing', 'content'],\n estimatedAgents: { min: 4, max: 6 },\n phases: [\n { title: 'Extract' },\n { title: 'Adapt' },\n { title: 'Package' },\n ],\n}\n\nconst source = args && typeof args === 'object' && args.source\n ? String(args.source)\n : 'Infer the source content from the most recent user turn.'\n\nconst platformsRaw = args && typeof args === 'object' && args.platforms\n ? String(args.platforms)\n : ''\n\nconst DEFAULT_PLATFORMS = [\n { id: 'x_thread', label: 'X / Twitter thread', format: '5\u20138 tweets, hook-first, one idea per tweet' },\n { id: 'linkedin', label: 'LinkedIn post', format: 'Professional post, 150\u2013250 words, clear CTA' },\n { id: 'short_video', label: 'Short video script', format: '60-second spoken script with hook and CTA' },\n { id: 'newsletter', label: 'Newsletter teaser', format: 'Subject line + 2\u20133 sentence teaser + bullet highlights' },\n]\n\nphase('Extract')\nconst extracted = await agent(\n 'Extract reusable content atoms from this source: core thesis, 3\u20135 key points, best quotes/stats, audience hook, and CTA.\\n\\nSOURCE:\\n' + source,\n {\n label: 'extract',\n schema: {\n type: 'object',\n properties: {\n thesis: { type: 'string' },\n keyPoints: { type: 'array', items: { type: 'string' } },\n hooks: { type: 'array', items: { type: 'string' } },\n quotesOrStats: { type: 'array', items: { type: 'string' } },\n cta: { type: 'string' },\n },\n required: ['thesis', 'keyPoints', 'cta'],\n },\n },\n)\n\nconst targets = platformsRaw\n ? platformsRaw\n .split(/[,\uFF0C\\n]/)\n .map((s) => s.trim())\n .filter(Boolean)\n .map((label, index) => ({\n id: 'custom_' + index,\n label,\n format: 'Native format and length for ' + label,\n }))\n : DEFAULT_PLATFORMS\n\nphase('Adapt')\nconst adaptations = await parallel(\n targets.map((p) => () =>\n agent(\n 'Adapt the extracted content for this platform. Match native tone and length. Return ready-to-publish copy.\\n\\n' +\n 'PLATFORM: ' + p.label + '\\nFORMAT: ' + p.format + '\\n\\n' +\n JSON.stringify(extracted, null, 2),\n {\n label: p.label,\n schema: {\n type: 'object',\n properties: {\n platform: { type: 'string' },\n copy: { type: 'string' },\n notes: { type: 'string' },\n },\n required: ['platform', 'copy'],\n },\n },\n ),\n ),\n)\n\nphase('Package')\nconst packaged = await agent(\n 'Package all platform adaptations with a publishing checklist: suggested order, cross-links between posts, and one optional bonus format (e.g. carousel outline).\\n\\n' +\n JSON.stringify({ extracted, adaptations: adaptations.filter(Boolean) }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n publishingOrder: { type: 'array', items: { type: 'string' } },\n crossLinks: { type: 'array', items: { type: 'string' } },\n bonusFormat: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['publishingOrder', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n extracted,\n adaptations: adaptations.filter(Boolean),\n ...(packaged ?? { publishingOrder: [], summary: 'packaging failed' }),\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'questions', title: 'Publishing order', items: output.publishingOrder },\n { kind: 'questions', title: 'Cross-links', items: output.crossLinks ?? [] },\n { kind: 'json', title: 'Adaptations', value: output.adaptations },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -124,12 +124,21 @@ const packaged = await agent(
|
|
|
124
124
|
},
|
|
125
125
|
)
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
const output = {
|
|
128
128
|
ok: true,
|
|
129
129
|
extracted,
|
|
130
130
|
adaptations: adaptations.filter(Boolean),
|
|
131
131
|
...(packaged ?? { publishingOrder: [], summary: 'packaging failed' }),
|
|
132
132
|
}
|
|
133
|
+
return {
|
|
134
|
+
summary: output.summary,
|
|
135
|
+
sections: [
|
|
136
|
+
{ kind: 'questions', title: 'Publishing order', items: output.publishingOrder },
|
|
137
|
+
{ kind: 'questions', title: 'Cross-links', items: output.crossLinks ?? [] },
|
|
138
|
+
{ kind: 'json', title: 'Adaptations', value: output.adaptations },
|
|
139
|
+
],
|
|
140
|
+
structuredOutput: output,
|
|
141
|
+
}
|
|
133
142
|
`;
|
|
134
143
|
//#endregion
|
|
135
144
|
export { CONTENT_REPURPOSE_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-repurpose.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/content-repurpose.ts"],"sourcesContent":["/**\n * Built-in workflow: `content_repurpose`\n *\n * Repurpose one source piece into multi-platform formats — threads, LinkedIn,\n * short video script, newsletter blurb. For personal-brand solopreneurs.\n *\n * Args:\n * - source: original article, notes, or talking points\n * - platforms: target platforms (optional)\n */\n\nexport const CONTENT_REPURPOSE_SCRIPT = `export const meta = {\n name: 'content_repurpose',\n description: 'Repurpose one source into platform-specific content (threads, posts, scripts, newsletter).',\n whenToUse: 'User has existing content and wants multi-platform distribution without rewriting from scratch.',\n examplePrompts: [\n { field: 'source', text: '2000-word blog post on building a one-person AI business' },\n { field: 'platforms', text: 'X thread, LinkedIn, 60s video script, newsletter teaser' },\n ],\n i18n: {\n zh: {\n description: '将一份核心内容改编为多平台格式(推文串、领英帖、短视频脚本、Newsletter 摘要)。',\n whenToUse: '用户已有内容素材,需要一源多用、多平台分发时。',\n examplePrompts: [\n { field: 'source', text: '一篇 2000 字关于一人 AI 公司的博客' },\n { field: 'platforms', text: 'X 推文串、LinkedIn、60 秒口播稿、Newsletter 导语' },\n ],\n },\n },\n tags: ['writing', 'content'],\n estimatedAgents: { min: 4, max: 6 },\n phases: [\n { title: 'Extract' },\n { title: 'Adapt' },\n { title: 'Package' },\n ],\n}\n\nconst source = args && typeof args === 'object' && args.source\n ? String(args.source)\n : 'Infer the source content from the most recent user turn.'\n\nconst platformsRaw = args && typeof args === 'object' && args.platforms\n ? String(args.platforms)\n : ''\n\nconst DEFAULT_PLATFORMS = [\n { id: 'x_thread', label: 'X / Twitter thread', format: '5–8 tweets, hook-first, one idea per tweet' },\n { id: 'linkedin', label: 'LinkedIn post', format: 'Professional post, 150–250 words, clear CTA' },\n { id: 'short_video', label: 'Short video script', format: '60-second spoken script with hook and CTA' },\n { id: 'newsletter', label: 'Newsletter teaser', format: 'Subject line + 2–3 sentence teaser + bullet highlights' },\n]\n\nphase('Extract')\nconst extracted = await agent(\n 'Extract reusable content atoms from this source: core thesis, 3–5 key points, best quotes/stats, audience hook, and CTA.\\\\n\\\\nSOURCE:\\\\n' + source,\n {\n label: 'extract',\n schema: {\n type: 'object',\n properties: {\n thesis: { type: 'string' },\n keyPoints: { type: 'array', items: { type: 'string' } },\n hooks: { type: 'array', items: { type: 'string' } },\n quotesOrStats: { type: 'array', items: { type: 'string' } },\n cta: { type: 'string' },\n },\n required: ['thesis', 'keyPoints', 'cta'],\n },\n },\n)\n\nconst targets = platformsRaw\n ? platformsRaw\n .split(/[,,\\\\n]/)\n .map((s) => s.trim())\n .filter(Boolean)\n .map((label, index) => ({\n id: 'custom_' + index,\n label,\n format: 'Native format and length for ' + label,\n }))\n : DEFAULT_PLATFORMS\n\nphase('Adapt')\nconst adaptations = await parallel(\n targets.map((p) => () =>\n agent(\n 'Adapt the extracted content for this platform. Match native tone and length. Return ready-to-publish copy.\\\\n\\\\n' +\n 'PLATFORM: ' + p.label + '\\\\nFORMAT: ' + p.format + '\\\\n\\\\n' +\n JSON.stringify(extracted, null, 2),\n {\n label: p.label,\n schema: {\n type: 'object',\n properties: {\n platform: { type: 'string' },\n copy: { type: 'string' },\n notes: { type: 'string' },\n },\n required: ['platform', 'copy'],\n },\n },\n ),\n ),\n)\n\nphase('Package')\nconst packaged = await agent(\n 'Package all platform adaptations with a publishing checklist: suggested order, cross-links between posts, and one optional bonus format (e.g. carousel outline).\\\\n\\\\n' +\n JSON.stringify({ extracted, adaptations: adaptations.filter(Boolean) }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n publishingOrder: { type: 'array', items: { type: 'string' } },\n crossLinks: { type: 'array', items: { type: 'string' } },\n bonusFormat: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['publishingOrder', 'summary'],\n },\n },\n)\n\
|
|
1
|
+
{"version":3,"file":"content-repurpose.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/content-repurpose.ts"],"sourcesContent":["/**\n * Built-in workflow: `content_repurpose`\n *\n * Repurpose one source piece into multi-platform formats — threads, LinkedIn,\n * short video script, newsletter blurb. For personal-brand solopreneurs.\n *\n * Args:\n * - source: original article, notes, or talking points\n * - platforms: target platforms (optional)\n */\n\nexport const CONTENT_REPURPOSE_SCRIPT = `export const meta = {\n name: 'content_repurpose',\n description: 'Repurpose one source into platform-specific content (threads, posts, scripts, newsletter).',\n whenToUse: 'User has existing content and wants multi-platform distribution without rewriting from scratch.',\n examplePrompts: [\n { field: 'source', text: '2000-word blog post on building a one-person AI business' },\n { field: 'platforms', text: 'X thread, LinkedIn, 60s video script, newsletter teaser' },\n ],\n i18n: {\n zh: {\n description: '将一份核心内容改编为多平台格式(推文串、领英帖、短视频脚本、Newsletter 摘要)。',\n whenToUse: '用户已有内容素材,需要一源多用、多平台分发时。',\n examplePrompts: [\n { field: 'source', text: '一篇 2000 字关于一人 AI 公司的博客' },\n { field: 'platforms', text: 'X 推文串、LinkedIn、60 秒口播稿、Newsletter 导语' },\n ],\n },\n },\n tags: ['writing', 'content'],\n estimatedAgents: { min: 4, max: 6 },\n phases: [\n { title: 'Extract' },\n { title: 'Adapt' },\n { title: 'Package' },\n ],\n}\n\nconst source = args && typeof args === 'object' && args.source\n ? String(args.source)\n : 'Infer the source content from the most recent user turn.'\n\nconst platformsRaw = args && typeof args === 'object' && args.platforms\n ? String(args.platforms)\n : ''\n\nconst DEFAULT_PLATFORMS = [\n { id: 'x_thread', label: 'X / Twitter thread', format: '5–8 tweets, hook-first, one idea per tweet' },\n { id: 'linkedin', label: 'LinkedIn post', format: 'Professional post, 150–250 words, clear CTA' },\n { id: 'short_video', label: 'Short video script', format: '60-second spoken script with hook and CTA' },\n { id: 'newsletter', label: 'Newsletter teaser', format: 'Subject line + 2–3 sentence teaser + bullet highlights' },\n]\n\nphase('Extract')\nconst extracted = await agent(\n 'Extract reusable content atoms from this source: core thesis, 3–5 key points, best quotes/stats, audience hook, and CTA.\\\\n\\\\nSOURCE:\\\\n' + source,\n {\n label: 'extract',\n schema: {\n type: 'object',\n properties: {\n thesis: { type: 'string' },\n keyPoints: { type: 'array', items: { type: 'string' } },\n hooks: { type: 'array', items: { type: 'string' } },\n quotesOrStats: { type: 'array', items: { type: 'string' } },\n cta: { type: 'string' },\n },\n required: ['thesis', 'keyPoints', 'cta'],\n },\n },\n)\n\nconst targets = platformsRaw\n ? platformsRaw\n .split(/[,,\\\\n]/)\n .map((s) => s.trim())\n .filter(Boolean)\n .map((label, index) => ({\n id: 'custom_' + index,\n label,\n format: 'Native format and length for ' + label,\n }))\n : DEFAULT_PLATFORMS\n\nphase('Adapt')\nconst adaptations = await parallel(\n targets.map((p) => () =>\n agent(\n 'Adapt the extracted content for this platform. Match native tone and length. Return ready-to-publish copy.\\\\n\\\\n' +\n 'PLATFORM: ' + p.label + '\\\\nFORMAT: ' + p.format + '\\\\n\\\\n' +\n JSON.stringify(extracted, null, 2),\n {\n label: p.label,\n schema: {\n type: 'object',\n properties: {\n platform: { type: 'string' },\n copy: { type: 'string' },\n notes: { type: 'string' },\n },\n required: ['platform', 'copy'],\n },\n },\n ),\n ),\n)\n\nphase('Package')\nconst packaged = await agent(\n 'Package all platform adaptations with a publishing checklist: suggested order, cross-links between posts, and one optional bonus format (e.g. carousel outline).\\\\n\\\\n' +\n JSON.stringify({ extracted, adaptations: adaptations.filter(Boolean) }, null, 2),\n {\n label: 'package',\n schema: {\n type: 'object',\n properties: {\n publishingOrder: { type: 'array', items: { type: 'string' } },\n crossLinks: { type: 'array', items: { type: 'string' } },\n bonusFormat: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['publishingOrder', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n extracted,\n adaptations: adaptations.filter(Boolean),\n ...(packaged ?? { publishingOrder: [], summary: 'packaging failed' }),\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'questions', title: 'Publishing order', items: output.publishingOrder },\n { kind: 'questions', title: 'Cross-links', items: output.crossLinks ?? [] },\n { kind: 'json', title: 'Adaptations', value: output.adaptations },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,2BAA2B"}
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
* - logs: optional log excerpt
|
|
11
11
|
* - context: optional extra context (what changed, when it started)
|
|
12
12
|
*/
|
|
13
|
-
export declare const DEBUG_INCIDENT_SCRIPT = "export const meta = {\n name: 'debug_incident',\n description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',\n whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',\n examplePrompts: [\n { field: 'error', text: 'Triage this stack trace from production' },\n { field: 'error', text: 'Why does the gateway return 502 after deploy?' },\n ],\n i18n: {\n zh: {\n description: '\u5BF9\u9519\u8BEF\u6216\u65E5\u5FD7\u7247\u6BB5\u505A\u5E76\u884C\u5047\u8BBE\u63A8\u6F14\uFF0C\u5E76\u6392\u5E8F\u6839\u56E0\u4E0E\u9A8C\u8BC1\u6B65\u9AA4\u3002',\n whenToUse: '\u7528\u6237\u62A5\u544A bug\u3001\u5D29\u6E83\u3001\u62A5\u9519\u6216\u5F02\u5E38\u884C\u4E3A\uFF0C\u9700\u8981\u7CFB\u7EDF\u5316\u6392\u67E5\u65F6\u3002',\n examplePrompts: [\n { field: 'error', text: '\u6392\u67E5\u751F\u4EA7\u73AF\u5883\u8FD9\u6761\u5806\u6808' },\n { field: 'error', text: '\u90E8\u7F72\u540E\u7F51\u5173\u8FD4\u56DE 502\uFF0C\u53EF\u80FD\u662F\u4EC0\u4E48\u539F\u56E0\uFF1F' },\n ],\n },\n },\n tags: ['debug', 'incident', 'troubleshooting'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Triage' },\n { title: 'Hypotheses' },\n { title: 'Rank' },\n ],\n}\n\nconst READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst error = args && typeof args === 'object' && args.error\n ? String(args.error)\n : 'Infer the primary error from the most recent user message or conversation context.'\n\nconst logs = args && typeof args === 'object' && args.logs\n ? String(args.logs)\n : ''\n\nconst context = args && typeof args === 'object' && args.context\n ? String(args.context)\n : ''\n\nphase('Triage')\nconst triage = await agent(\n 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2\u20133 key facts from logs.\\n\\n' +\n 'ERROR:\\n' + error + '\\n\\n' +\n (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +\n (context ? 'CONTEXT:\\n' + context + '\\n\\n' : '') +\n 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',\n {\n label: 'incident triage',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n errorType: { type: 'string' },\n subsystem: { type: 'string' },\n affectedPaths: { type: 'array', items: { type: 'string' } },\n keyFacts: { type: 'array', items: { type: 'string' } },\n },\n required: ['errorType', 'keyFacts'],\n },\n },\n)\n\nconst HYPOTHESES = [\n { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },\n { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },\n { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },\n { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },\n { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },\n]\n\nphase('Hypotheses')\nconst hypothesisReports = await parallel(\n HYPOTHESES.map((h) => () =>\n agent(\n 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\n\\n' +\n 'HYPOTHESIS: ' + h.key + ' \u2014 ' + h.angle + '\\n\\n' +\n 'TRIAGE:\\n' + JSON.stringify(triage, null, 2) + '\\n\\n' +\n 'ERROR:\\n' + error + '\\n\\n' +\n (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +\n 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',\n {\n label: h.key + ' hypothesis',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n evidence: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n note: { type: 'string' },\n },\n required: ['path', 'note'],\n },\n },\n verificationStep: { type: 'string' },\n },\n required: ['likelihood', 'evidence', 'verificationStep'],\n },\n },\n ),\n ),\n)\n\nphase('Rank')\nconst live = hypothesisReports.filter(Boolean)\nconst byHypothesis = {}\nfor (let i = 0; i < HYPOTHESES.length; i++) {\n byHypothesis[HYPOTHESES[i].key] = live[i] ?? null\n}\n\nconst ranking = await agent(\n 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\n\\n' +\n JSON.stringify({ triage, byHypothesis }, null, 2),\n {\n label: 'root cause ranking',\n schema: {\n type: 'object',\n properties: {\n topCauses: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n hypothesis: { type: 'string' },\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n summary: { type: 'string' },\n nextStep: { type: 'string' },\n },\n required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],\n },\n },\n immediateActions: { type: 'array', items: { type: 'string' } },\n summary: { type: 'string' },\n },\n required: ['topCauses', 'summary'],\n },\n },\n)\n\
|
|
13
|
+
export declare const DEBUG_INCIDENT_SCRIPT = "export const meta = {\n name: 'debug_incident',\n description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',\n whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',\n examplePrompts: [\n { field: 'error', text: 'Triage this stack trace from production' },\n { field: 'error', text: 'Why does the gateway return 502 after deploy?' },\n ],\n i18n: {\n zh: {\n description: '\u5BF9\u9519\u8BEF\u6216\u65E5\u5FD7\u7247\u6BB5\u505A\u5E76\u884C\u5047\u8BBE\u63A8\u6F14\uFF0C\u5E76\u6392\u5E8F\u6839\u56E0\u4E0E\u9A8C\u8BC1\u6B65\u9AA4\u3002',\n whenToUse: '\u7528\u6237\u62A5\u544A bug\u3001\u5D29\u6E83\u3001\u62A5\u9519\u6216\u5F02\u5E38\u884C\u4E3A\uFF0C\u9700\u8981\u7CFB\u7EDF\u5316\u6392\u67E5\u65F6\u3002',\n examplePrompts: [\n { field: 'error', text: '\u6392\u67E5\u751F\u4EA7\u73AF\u5883\u8FD9\u6761\u5806\u6808' },\n { field: 'error', text: '\u90E8\u7F72\u540E\u7F51\u5173\u8FD4\u56DE 502\uFF0C\u53EF\u80FD\u662F\u4EC0\u4E48\u539F\u56E0\uFF1F' },\n ],\n },\n },\n tags: ['debug', 'incident', 'troubleshooting'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Triage' },\n { title: 'Hypotheses' },\n { title: 'Rank' },\n ],\n}\n\nconst READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst error = args && typeof args === 'object' && args.error\n ? String(args.error)\n : 'Infer the primary error from the most recent user message or conversation context.'\n\nconst logs = args && typeof args === 'object' && args.logs\n ? String(args.logs)\n : ''\n\nconst context = args && typeof args === 'object' && args.context\n ? String(args.context)\n : ''\n\nphase('Triage')\nconst triage = await agent(\n 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2\u20133 key facts from logs.\\n\\n' +\n 'ERROR:\\n' + error + '\\n\\n' +\n (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +\n (context ? 'CONTEXT:\\n' + context + '\\n\\n' : '') +\n 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',\n {\n label: 'incident triage',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n errorType: { type: 'string' },\n subsystem: { type: 'string' },\n affectedPaths: { type: 'array', items: { type: 'string' } },\n keyFacts: { type: 'array', items: { type: 'string' } },\n },\n required: ['errorType', 'keyFacts'],\n },\n },\n)\n\nconst HYPOTHESES = [\n { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },\n { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },\n { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },\n { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },\n { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },\n]\n\nphase('Hypotheses')\nconst hypothesisReports = await parallel(\n HYPOTHESES.map((h) => () =>\n agent(\n 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\n\\n' +\n 'HYPOTHESIS: ' + h.key + ' \u2014 ' + h.angle + '\\n\\n' +\n 'TRIAGE:\\n' + JSON.stringify(triage, null, 2) + '\\n\\n' +\n 'ERROR:\\n' + error + '\\n\\n' +\n (logs ? 'LOGS:\\n' + logs + '\\n\\n' : '') +\n 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',\n {\n label: h.key + ' hypothesis',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n evidence: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n note: { type: 'string' },\n },\n required: ['path', 'note'],\n },\n },\n verificationStep: { type: 'string' },\n },\n required: ['likelihood', 'evidence', 'verificationStep'],\n },\n },\n ),\n ),\n)\n\nphase('Rank')\nconst live = hypothesisReports.filter(Boolean)\nconst byHypothesis = {}\nfor (let i = 0; i < HYPOTHESES.length; i++) {\n byHypothesis[HYPOTHESES[i].key] = live[i] ?? null\n}\n\nconst ranking = await agent(\n 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\n\\n' +\n JSON.stringify({ triage, byHypothesis }, null, 2),\n {\n label: 'root cause ranking',\n schema: {\n type: 'object',\n properties: {\n topCauses: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n hypothesis: { type: 'string' },\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n summary: { type: 'string' },\n nextStep: { type: 'string' },\n },\n required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],\n },\n },\n immediateActions: { type: 'array', items: { type: 'string' } },\n summary: { type: 'string' },\n },\n required: ['topCauses', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n triage,\n ...(ranking ?? { topCauses: [], summary: 'ranking failed', immediateActions: [] }),\n byHypothesis,\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'risks', title: 'Top causes', items: output.topCauses.map((item) => ({ title: item.hypothesis, severity: item.likelihood, detail: item.summary, mitigation: item.nextStep })) },\n { kind: 'questions', title: 'Immediate actions', items: output.immediateActions ?? [] },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -156,12 +156,20 @@ const ranking = await agent(
|
|
|
156
156
|
},
|
|
157
157
|
)
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
const output = {
|
|
160
160
|
ok: true,
|
|
161
161
|
triage,
|
|
162
162
|
...(ranking ?? { topCauses: [], summary: 'ranking failed', immediateActions: [] }),
|
|
163
163
|
byHypothesis,
|
|
164
164
|
}
|
|
165
|
+
return {
|
|
166
|
+
summary: output.summary,
|
|
167
|
+
sections: [
|
|
168
|
+
{ kind: 'risks', title: 'Top causes', items: output.topCauses.map((item) => ({ title: item.hypothesis, severity: item.likelihood, detail: item.summary, mitigation: item.nextStep })) },
|
|
169
|
+
{ kind: 'questions', title: 'Immediate actions', items: output.immediateActions ?? [] },
|
|
170
|
+
],
|
|
171
|
+
structuredOutput: output,
|
|
172
|
+
}
|
|
165
173
|
`;
|
|
166
174
|
//#endregion
|
|
167
175
|
export { DEBUG_INCIDENT_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-incident.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/debug-incident.ts"],"sourcesContent":["/**\n * Built-in workflow: `debug_incident`\n *\n * Triage an error, stack trace, or log snippet. Parses the signal, fans out\n * parallel hypotheses (config, race, dependency, data, environment), then\n * ranks likely root causes with verification steps.\n *\n * Args:\n * - error: error message or stack trace\n * - logs: optional log excerpt\n * - context: optional extra context (what changed, when it started)\n */\n\nexport const DEBUG_INCIDENT_SCRIPT = `export const meta = {\n name: 'debug_incident',\n description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',\n whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',\n examplePrompts: [\n { field: 'error', text: 'Triage this stack trace from production' },\n { field: 'error', text: 'Why does the gateway return 502 after deploy?' },\n ],\n i18n: {\n zh: {\n description: '对错误或日志片段做并行假设推演,并排序根因与验证步骤。',\n whenToUse: '用户报告 bug、崩溃、报错或异常行为,需要系统化排查时。',\n examplePrompts: [\n { field: 'error', text: '排查生产环境这条堆栈' },\n { field: 'error', text: '部署后网关返回 502,可能是什么原因?' },\n ],\n },\n },\n tags: ['debug', 'incident', 'troubleshooting'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Triage' },\n { title: 'Hypotheses' },\n { title: 'Rank' },\n ],\n}\n\nconst READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst error = args && typeof args === 'object' && args.error\n ? String(args.error)\n : 'Infer the primary error from the most recent user message or conversation context.'\n\nconst logs = args && typeof args === 'object' && args.logs\n ? String(args.logs)\n : ''\n\nconst context = args && typeof args === 'object' && args.context\n ? String(args.context)\n : ''\n\nphase('Triage')\nconst triage = await agent(\n 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2–3 key facts from logs.\\\\n\\\\n' +\n 'ERROR:\\\\n' + error + '\\\\n\\\\n' +\n (logs ? 'LOGS:\\\\n' + logs + '\\\\n\\\\n' : '') +\n (context ? 'CONTEXT:\\\\n' + context + '\\\\n\\\\n' : '') +\n 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',\n {\n label: 'incident triage',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n errorType: { type: 'string' },\n subsystem: { type: 'string' },\n affectedPaths: { type: 'array', items: { type: 'string' } },\n keyFacts: { type: 'array', items: { type: 'string' } },\n },\n required: ['errorType', 'keyFacts'],\n },\n },\n)\n\nconst HYPOTHESES = [\n { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },\n { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },\n { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },\n { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },\n { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },\n]\n\nphase('Hypotheses')\nconst hypothesisReports = await parallel(\n HYPOTHESES.map((h) => () =>\n agent(\n 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\\\n\\\\n' +\n 'HYPOTHESIS: ' + h.key + ' — ' + h.angle + '\\\\n\\\\n' +\n 'TRIAGE:\\\\n' + JSON.stringify(triage, null, 2) + '\\\\n\\\\n' +\n 'ERROR:\\\\n' + error + '\\\\n\\\\n' +\n (logs ? 'LOGS:\\\\n' + logs + '\\\\n\\\\n' : '') +\n 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',\n {\n label: h.key + ' hypothesis',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n evidence: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n note: { type: 'string' },\n },\n required: ['path', 'note'],\n },\n },\n verificationStep: { type: 'string' },\n },\n required: ['likelihood', 'evidence', 'verificationStep'],\n },\n },\n ),\n ),\n)\n\nphase('Rank')\nconst live = hypothesisReports.filter(Boolean)\nconst byHypothesis = {}\nfor (let i = 0; i < HYPOTHESES.length; i++) {\n byHypothesis[HYPOTHESES[i].key] = live[i] ?? null\n}\n\nconst ranking = await agent(\n 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\\\n\\\\n' +\n JSON.stringify({ triage, byHypothesis }, null, 2),\n {\n label: 'root cause ranking',\n schema: {\n type: 'object',\n properties: {\n topCauses: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n hypothesis: { type: 'string' },\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n summary: { type: 'string' },\n nextStep: { type: 'string' },\n },\n required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],\n },\n },\n immediateActions: { type: 'array', items: { type: 'string' } },\n summary: { type: 'string' },\n },\n required: ['topCauses', 'summary'],\n },\n },\n)\n\
|
|
1
|
+
{"version":3,"file":"debug-incident.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/debug-incident.ts"],"sourcesContent":["/**\n * Built-in workflow: `debug_incident`\n *\n * Triage an error, stack trace, or log snippet. Parses the signal, fans out\n * parallel hypotheses (config, race, dependency, data, environment), then\n * ranks likely root causes with verification steps.\n *\n * Args:\n * - error: error message or stack trace\n * - logs: optional log excerpt\n * - context: optional extra context (what changed, when it started)\n */\n\nexport const DEBUG_INCIDENT_SCRIPT = `export const meta = {\n name: 'debug_incident',\n description: 'Triage an error or log snippet with parallel hypotheses and ranked root-cause analysis.',\n whenToUse: 'User reports a bug, crash, error message, or unexpected behavior and wants systematic triage.',\n examplePrompts: [\n { field: 'error', text: 'Triage this stack trace from production' },\n { field: 'error', text: 'Why does the gateway return 502 after deploy?' },\n ],\n i18n: {\n zh: {\n description: '对错误或日志片段做并行假设推演,并排序根因与验证步骤。',\n whenToUse: '用户报告 bug、崩溃、报错或异常行为,需要系统化排查时。',\n examplePrompts: [\n { field: 'error', text: '排查生产环境这条堆栈' },\n { field: 'error', text: '部署后网关返回 502,可能是什么原因?' },\n ],\n },\n },\n tags: ['debug', 'incident', 'troubleshooting'],\n estimatedAgents: { min: 7, max: 7 },\n phases: [\n { title: 'Triage' },\n { title: 'Hypotheses' },\n { title: 'Rank' },\n ],\n}\n\nconst READ_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst error = args && typeof args === 'object' && args.error\n ? String(args.error)\n : 'Infer the primary error from the most recent user message or conversation context.'\n\nconst logs = args && typeof args === 'object' && args.logs\n ? String(args.logs)\n : ''\n\nconst context = args && typeof args === 'object' && args.context\n ? String(args.context)\n : ''\n\nphase('Triage')\nconst triage = await agent(\n 'Parse this incident signal. Extract: error type, likely subsystem, affected files/modules if identifiable, and 2–3 key facts from logs.\\\\n\\\\n' +\n 'ERROR:\\\\n' + error + '\\\\n\\\\n' +\n (logs ? 'LOGS:\\\\n' + logs + '\\\\n\\\\n' : '') +\n (context ? 'CONTEXT:\\\\n' + context + '\\\\n\\\\n' : '') +\n 'Use read/grep tools to locate relevant code if the workspace may contain the failing path.',\n {\n label: 'incident triage',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n errorType: { type: 'string' },\n subsystem: { type: 'string' },\n affectedPaths: { type: 'array', items: { type: 'string' } },\n keyFacts: { type: 'array', items: { type: 'string' } },\n },\n required: ['errorType', 'keyFacts'],\n },\n },\n)\n\nconst HYPOTHESES = [\n { key: 'config', angle: 'Misconfiguration, missing env vars, wrong defaults, feature flags, stale config cache.' },\n { key: 'race', angle: 'Concurrency, timing, ordering, partial failure under load, missing locks or awaits.' },\n { key: 'dependency', angle: 'Version mismatch, breaking upstream change, network/API failure, timeout, auth expiry.' },\n { key: 'data', angle: 'Bad input, schema drift, null/empty edge case, corrupt state, migration gap.' },\n { key: 'environment', angle: 'OS, permissions, disk, memory, container/network isolation, platform-specific behavior.' },\n]\n\nphase('Hypotheses')\nconst hypothesisReports = await parallel(\n HYPOTHESES.map((h) => () =>\n agent(\n 'Evaluate whether this hypothesis explains the incident. Search the codebase for supporting or refuting evidence.\\\\n\\\\n' +\n 'HYPOTHESIS: ' + h.key + ' — ' + h.angle + '\\\\n\\\\n' +\n 'TRIAGE:\\\\n' + JSON.stringify(triage, null, 2) + '\\\\n\\\\n' +\n 'ERROR:\\\\n' + error + '\\\\n\\\\n' +\n (logs ? 'LOGS:\\\\n' + logs + '\\\\n\\\\n' : '') +\n 'Return: likelihood (low/med/high), evidence (file paths + brief notes), and one verification step.',\n {\n label: h.key + ' hypothesis',\n toolset: READ_TOOLS,\n schema: {\n type: 'object',\n properties: {\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n evidence: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n note: { type: 'string' },\n },\n required: ['path', 'note'],\n },\n },\n verificationStep: { type: 'string' },\n },\n required: ['likelihood', 'evidence', 'verificationStep'],\n },\n },\n ),\n ),\n)\n\nphase('Rank')\nconst live = hypothesisReports.filter(Boolean)\nconst byHypothesis = {}\nfor (let i = 0; i < HYPOTHESES.length; i++) {\n byHypothesis[HYPOTHESES[i].key] = live[i] ?? null\n}\n\nconst ranking = await agent(\n 'Rank root causes by likelihood. Pick the top 3 with confidence and concrete next steps to confirm or fix.\\\\n\\\\n' +\n JSON.stringify({ triage, byHypothesis }, null, 2),\n {\n label: 'root cause ranking',\n schema: {\n type: 'object',\n properties: {\n topCauses: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n hypothesis: { type: 'string' },\n likelihood: { type: 'string', enum: ['low', 'med', 'high'] },\n summary: { type: 'string' },\n nextStep: { type: 'string' },\n },\n required: ['hypothesis', 'likelihood', 'summary', 'nextStep'],\n },\n },\n immediateActions: { type: 'array', items: { type: 'string' } },\n summary: { type: 'string' },\n },\n required: ['topCauses', 'summary'],\n },\n },\n)\n\nconst output = {\n ok: true,\n triage,\n ...(ranking ?? { topCauses: [], summary: 'ranking failed', immediateActions: [] }),\n byHypothesis,\n}\nreturn {\n summary: output.summary,\n sections: [\n { kind: 'risks', title: 'Top causes', items: output.topCauses.map((item) => ({ title: item.hypothesis, severity: item.likelihood, detail: item.summary, mitigation: item.nextStep })) },\n { kind: 'questions', title: 'Immediate actions', items: output.immediateActions ?? [] },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,wBAAwB"}
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
* - options: optional comma-separated or newline-separated option list
|
|
11
11
|
* - criteria: optional evaluation criteria hint
|
|
12
12
|
*/
|
|
13
|
-
export declare const DECISION_COMPARE_SCRIPT = "export const meta = {\n name: 'decision_compare',\n description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',\n whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',\n examplePrompts: [\n { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },\n { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },\n ],\n i18n: {\n zh: {\n description: '\u7531\u591A\u4E2A\u72EC\u7ACB\u8BC4\u5BA1\u7EF4\u5EA6\u5BF9\u6BD4\u9009\u9879\uFF0C\u5E76\u7ED9\u51FA\u542B\u6743\u8861\u7684\u63A8\u8350\u7ED3\u8BBA\u3002',\n whenToUse: '\u7528\u6237\u9762\u4E34\u591A\u4E2A\u53EF\u884C\u65B9\u6848\u7684\u975E\u4EE3\u7801\u51B3\u7B56\uFF0C\u9700\u8981\u7ED3\u6784\u5316\u5BF9\u6BD4\u65F6\u3002',\n examplePrompts: [\n { field: 'question', text: '5 \u4EBA\u8FDC\u7A0B\u56E2\u961F\u9002\u5408\u7528\u54EA\u6B3E\u9879\u76EE\u7BA1\u7406\u5DE5\u5177\uFF1F' },\n { field: 'question', text: '\u6D3B\u52A8\u5E94\u8BE5\u7EBF\u4E0B\u3001\u6DF7\u5408\u8FD8\u662F\u7EAF\u7EBF\u4E0A\u4E3E\u529E\uFF1F' },\n ],\n },\n },\n tags: ['decision-making', 'comparison', 'productivity'],\n estimatedAgents: { min: 4, max: 7 },\n phases: [\n { title: 'Frame' },\n { title: 'Evaluate' },\n { title: 'Recommend' },\n ],\n}\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'Infer the decision question from the most recent user turn.'\n\nconst optionsRaw = args && typeof args === 'object' && args.options\n ? String(args.options)\n : ''\n\nconst criteriaHint = args && typeof args === 'object' && args.criteria\n ? String(args.criteria)\n : ''\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this decision. If options are not provided, propose 3\u20134 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n' +\n (optionsRaw ? 'OPTIONS:\\n' + optionsRaw + '\\n' : '') +\n (criteriaHint ? 'CRITERIA HINT:\\n' + criteriaHint + '\\n' : ''),\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n options: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['name', 'summary'],\n },\n },\n criteria: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n weight: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['name'],\n },\n },\n assumptions: { type: 'array', items: { type: 'string' } },\n },\n required: ['options', 'criteria'],\n },\n },\n)\n\nif (!frame || !frame.options?.length) {\n
|
|
13
|
+
export declare const DECISION_COMPARE_SCRIPT = "export const meta = {\n name: 'decision_compare',\n description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',\n whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',\n examplePrompts: [\n { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },\n { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },\n ],\n i18n: {\n zh: {\n description: '\u7531\u591A\u4E2A\u72EC\u7ACB\u8BC4\u5BA1\u7EF4\u5EA6\u5BF9\u6BD4\u9009\u9879\uFF0C\u5E76\u7ED9\u51FA\u542B\u6743\u8861\u7684\u63A8\u8350\u7ED3\u8BBA\u3002',\n whenToUse: '\u7528\u6237\u9762\u4E34\u591A\u4E2A\u53EF\u884C\u65B9\u6848\u7684\u975E\u4EE3\u7801\u51B3\u7B56\uFF0C\u9700\u8981\u7ED3\u6784\u5316\u5BF9\u6BD4\u65F6\u3002',\n examplePrompts: [\n { field: 'question', text: '5 \u4EBA\u8FDC\u7A0B\u56E2\u961F\u9002\u5408\u7528\u54EA\u6B3E\u9879\u76EE\u7BA1\u7406\u5DE5\u5177\uFF1F' },\n { field: 'question', text: '\u6D3B\u52A8\u5E94\u8BE5\u7EBF\u4E0B\u3001\u6DF7\u5408\u8FD8\u662F\u7EAF\u7EBF\u4E0A\u4E3E\u529E\uFF1F' },\n ],\n },\n },\n tags: ['decision-making', 'comparison', 'productivity'],\n estimatedAgents: { min: 4, max: 7 },\n phases: [\n { title: 'Frame' },\n { title: 'Evaluate' },\n { title: 'Recommend' },\n ],\n}\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'Infer the decision question from the most recent user turn.'\n\nconst optionsRaw = args && typeof args === 'object' && args.options\n ? String(args.options)\n : ''\n\nconst criteriaHint = args && typeof args === 'object' && args.criteria\n ? String(args.criteria)\n : ''\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this decision. If options are not provided, propose 3\u20134 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n' +\n (optionsRaw ? 'OPTIONS:\\n' + optionsRaw + '\\n' : '') +\n (criteriaHint ? 'CRITERIA HINT:\\n' + criteriaHint + '\\n' : ''),\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n options: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['name', 'summary'],\n },\n },\n criteria: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n weight: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['name'],\n },\n },\n assumptions: { type: 'array', items: { type: 'string' } },\n },\n required: ['options', 'criteria'],\n },\n },\n)\n\nif (!frame || !frame.options?.length) {\n const output = { ok: false, reason: 'framing failed', question }\n return {\n summary: output.reason,\n sections: [{ kind: 'json', title: 'Decision framing', value: output }],\n structuredOutput: output,\n }\n}\n\nconst options = frame.options.slice(0, 4)\nconst criteria = frame.criteria ?? []\n\nconst LENSES = [\n { name: 'Benefits', focus: 'Upside, value delivered, and who wins.' },\n { name: 'Risks', focus: 'Downside, failure modes, hidden costs, and regrets.' },\n { name: 'Fit', focus: 'Fit for stated constraints, audience, timeline, and resources.' },\n]\n\nphase('Evaluate')\nconst evaluations = await parallel(\n LENSES.map((lens) => () =>\n agent(\n 'Evaluate every option through this lens. Be specific \u2014 avoid generic pros/cons. Score each option low/med/high for this lens with a one-line rationale.\\n\\n' +\n 'LENS: ' + lens.name + ' \u2014 ' + lens.focus + '\\n' +\n 'QUESTION: ' + question + '\\n' +\n 'OPTIONS:\\n' + JSON.stringify(options, null, 2) + '\\n' +\n 'CRITERIA:\\n' + JSON.stringify(criteria, null, 2),\n {\n label: lens.name,\n schema: {\n type: 'object',\n properties: {\n lens: { type: 'string' },\n scores: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n option: { type: 'string' },\n score: { type: 'string', enum: ['low', 'med', 'high'] },\n rationale: { type: 'string' },\n },\n required: ['option', 'score', 'rationale'],\n },\n },\n },\n required: ['lens', 'scores'],\n },\n },\n ),\n ),\n)\n\nphase('Recommend')\nconst live = evaluations.filter(Boolean)\nconst recommendation = await agent(\n 'Recommend the best option (or a hybrid) from these lens-level evaluations. State trade-offs explicitly, note what would change the recommendation, and give a runner-up.\\n\\n' +\n 'QUESTION:\\n' + question + '\\n\\n' +\n JSON.stringify({ frame, evaluations: live }, null, 2),\n {\n label: 'recommendation',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string' },\n rationale: { type: 'string' },\n tradeoffs: { type: 'array', items: { type: 'string' } },\n runnerUp: { type: 'string' },\n whatWouldChange: { type: 'array', items: { type: 'string' } },\n },\n required: ['recommendation', 'rationale', 'tradeoffs'],\n },\n },\n)\n\nconst output = {\n ok: true,\n question,\n optionCount: options.length,\n ...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),\n}\nreturn {\n summary: output.recommendation,\n sections: [\n { kind: 'text', title: 'Rationale', content: output.rationale },\n { kind: 'questions', title: 'Trade-offs', items: output.tradeoffs },\n { kind: 'questions', title: 'What would change the recommendation', items: output.whatWouldChange ?? [] },\n ],\n structuredOutput: output,\n}\n";
|
|
@@ -91,7 +91,12 @@ const frame = await agent(
|
|
|
91
91
|
)
|
|
92
92
|
|
|
93
93
|
if (!frame || !frame.options?.length) {
|
|
94
|
-
|
|
94
|
+
const output = { ok: false, reason: 'framing failed', question }
|
|
95
|
+
return {
|
|
96
|
+
summary: output.reason,
|
|
97
|
+
sections: [{ kind: 'json', title: 'Decision framing', value: output }],
|
|
98
|
+
structuredOutput: output,
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
const options = frame.options.slice(0, 4)
|
|
@@ -160,12 +165,21 @@ const recommendation = await agent(
|
|
|
160
165
|
},
|
|
161
166
|
)
|
|
162
167
|
|
|
163
|
-
|
|
168
|
+
const output = {
|
|
164
169
|
ok: true,
|
|
165
170
|
question,
|
|
166
171
|
optionCount: options.length,
|
|
167
172
|
...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),
|
|
168
173
|
}
|
|
174
|
+
return {
|
|
175
|
+
summary: output.recommendation,
|
|
176
|
+
sections: [
|
|
177
|
+
{ kind: 'text', title: 'Rationale', content: output.rationale },
|
|
178
|
+
{ kind: 'questions', title: 'Trade-offs', items: output.tradeoffs },
|
|
179
|
+
{ kind: 'questions', title: 'What would change the recommendation', items: output.whatWouldChange ?? [] },
|
|
180
|
+
],
|
|
181
|
+
structuredOutput: output,
|
|
182
|
+
}
|
|
169
183
|
`;
|
|
170
184
|
//#endregion
|
|
171
185
|
export { DECISION_COMPARE_SCRIPT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision-compare.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/decision-compare.ts"],"sourcesContent":["/**\n * Built-in workflow: `decision_compare`\n *\n * Structured comparison of options for everyday decisions — vendors, approaches,\n * purchases, policies, or life choices. Independent evaluators score each option,\n * then a synthesizer recommends with trade-offs spelled out.\n *\n * Args:\n * - question: the decision to make\n * - options: optional comma-separated or newline-separated option list\n * - criteria: optional evaluation criteria hint\n */\n\nexport const DECISION_COMPARE_SCRIPT = `export const meta = {\n name: 'decision_compare',\n description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',\n whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',\n examplePrompts: [\n { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },\n { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },\n ],\n i18n: {\n zh: {\n description: '由多个独立评审维度对比选项,并给出含权衡的推荐结论。',\n whenToUse: '用户面临多个可行方案的非代码决策,需要结构化对比时。',\n examplePrompts: [\n { field: 'question', text: '5 人远程团队适合用哪款项目管理工具?' },\n { field: 'question', text: '活动应该线下、混合还是纯线上举办?' },\n ],\n },\n },\n tags: ['decision-making', 'comparison', 'productivity'],\n estimatedAgents: { min: 4, max: 7 },\n phases: [\n { title: 'Frame' },\n { title: 'Evaluate' },\n { title: 'Recommend' },\n ],\n}\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'Infer the decision question from the most recent user turn.'\n\nconst optionsRaw = args && typeof args === 'object' && args.options\n ? String(args.options)\n : ''\n\nconst criteriaHint = args && typeof args === 'object' && args.criteria\n ? String(args.criteria)\n : ''\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this decision. If options are not provided, propose 3–4 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n' +\n (optionsRaw ? 'OPTIONS:\\\\n' + optionsRaw + '\\\\n' : '') +\n (criteriaHint ? 'CRITERIA HINT:\\\\n' + criteriaHint + '\\\\n' : ''),\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n options: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['name', 'summary'],\n },\n },\n criteria: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n weight: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['name'],\n },\n },\n assumptions: { type: 'array', items: { type: 'string' } },\n },\n required: ['options', 'criteria'],\n },\n },\n)\n\nif (!frame || !frame.options?.length) {\n
|
|
1
|
+
{"version":3,"file":"decision-compare.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/decision-compare.ts"],"sourcesContent":["/**\n * Built-in workflow: `decision_compare`\n *\n * Structured comparison of options for everyday decisions — vendors, approaches,\n * purchases, policies, or life choices. Independent evaluators score each option,\n * then a synthesizer recommends with trade-offs spelled out.\n *\n * Args:\n * - question: the decision to make\n * - options: optional comma-separated or newline-separated option list\n * - criteria: optional evaluation criteria hint\n */\n\nexport const DECISION_COMPARE_SCRIPT = `export const meta = {\n name: 'decision_compare',\n description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',\n whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',\n examplePrompts: [\n { field: 'question', text: 'Which project management tool fits a 5-person remote team?' },\n { field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },\n ],\n i18n: {\n zh: {\n description: '由多个独立评审维度对比选项,并给出含权衡的推荐结论。',\n whenToUse: '用户面临多个可行方案的非代码决策,需要结构化对比时。',\n examplePrompts: [\n { field: 'question', text: '5 人远程团队适合用哪款项目管理工具?' },\n { field: 'question', text: '活动应该线下、混合还是纯线上举办?' },\n ],\n },\n },\n tags: ['decision-making', 'comparison', 'productivity'],\n estimatedAgents: { min: 4, max: 7 },\n phases: [\n { title: 'Frame' },\n { title: 'Evaluate' },\n { title: 'Recommend' },\n ],\n}\n\nconst question = args && typeof args === 'object' && args.question\n ? String(args.question)\n : 'Infer the decision question from the most recent user turn.'\n\nconst optionsRaw = args && typeof args === 'object' && args.options\n ? String(args.options)\n : ''\n\nconst criteriaHint = args && typeof args === 'object' && args.criteria\n ? String(args.criteria)\n : ''\n\nphase('Frame')\nconst frame = await agent(\n 'Frame this decision. If options are not provided, propose 3–4 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n' +\n (optionsRaw ? 'OPTIONS:\\\\n' + optionsRaw + '\\\\n' : '') +\n (criteriaHint ? 'CRITERIA HINT:\\\\n' + criteriaHint + '\\\\n' : ''),\n {\n label: 'framing',\n schema: {\n type: 'object',\n properties: {\n options: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n summary: { type: 'string' },\n },\n required: ['name', 'summary'],\n },\n },\n criteria: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n weight: { type: 'string', enum: ['low', 'med', 'high'] },\n },\n required: ['name'],\n },\n },\n assumptions: { type: 'array', items: { type: 'string' } },\n },\n required: ['options', 'criteria'],\n },\n },\n)\n\nif (!frame || !frame.options?.length) {\n const output = { ok: false, reason: 'framing failed', question }\n return {\n summary: output.reason,\n sections: [{ kind: 'json', title: 'Decision framing', value: output }],\n structuredOutput: output,\n }\n}\n\nconst options = frame.options.slice(0, 4)\nconst criteria = frame.criteria ?? []\n\nconst LENSES = [\n { name: 'Benefits', focus: 'Upside, value delivered, and who wins.' },\n { name: 'Risks', focus: 'Downside, failure modes, hidden costs, and regrets.' },\n { name: 'Fit', focus: 'Fit for stated constraints, audience, timeline, and resources.' },\n]\n\nphase('Evaluate')\nconst evaluations = await parallel(\n LENSES.map((lens) => () =>\n agent(\n 'Evaluate every option through this lens. Be specific — avoid generic pros/cons. Score each option low/med/high for this lens with a one-line rationale.\\\\n\\\\n' +\n 'LENS: ' + lens.name + ' — ' + lens.focus + '\\\\n' +\n 'QUESTION: ' + question + '\\\\n' +\n 'OPTIONS:\\\\n' + JSON.stringify(options, null, 2) + '\\\\n' +\n 'CRITERIA:\\\\n' + JSON.stringify(criteria, null, 2),\n {\n label: lens.name,\n schema: {\n type: 'object',\n properties: {\n lens: { type: 'string' },\n scores: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n option: { type: 'string' },\n score: { type: 'string', enum: ['low', 'med', 'high'] },\n rationale: { type: 'string' },\n },\n required: ['option', 'score', 'rationale'],\n },\n },\n },\n required: ['lens', 'scores'],\n },\n },\n ),\n ),\n)\n\nphase('Recommend')\nconst live = evaluations.filter(Boolean)\nconst recommendation = await agent(\n 'Recommend the best option (or a hybrid) from these lens-level evaluations. State trade-offs explicitly, note what would change the recommendation, and give a runner-up.\\\\n\\\\n' +\n 'QUESTION:\\\\n' + question + '\\\\n\\\\n' +\n JSON.stringify({ frame, evaluations: live }, null, 2),\n {\n label: 'recommendation',\n schema: {\n type: 'object',\n properties: {\n recommendation: { type: 'string' },\n rationale: { type: 'string' },\n tradeoffs: { type: 'array', items: { type: 'string' } },\n runnerUp: { type: 'string' },\n whatWouldChange: { type: 'array', items: { type: 'string' } },\n },\n required: ['recommendation', 'rationale', 'tradeoffs'],\n },\n },\n)\n\nconst output = {\n ok: true,\n question,\n optionCount: options.length,\n ...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),\n}\nreturn {\n summary: output.recommendation,\n sections: [\n { kind: 'text', title: 'Rationale', content: output.rationale },\n { kind: 'questions', title: 'Trade-offs', items: output.tradeoffs },\n { kind: 'questions', title: 'What would change the recommendation', items: output.whatWouldChange ?? [] },\n ],\n structuredOutput: output,\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,0BAA0B"}
|
|
@@ -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"}
|