@xopcai/xopc 0.0.89 → 0.0.91
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 +36 -12
- package/README.zh-CN.md +36 -12
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/Combination-HAlzriaz.js +41 -0
- package/dist/gateway/static/root/assets/agents-bVWUlrlD.js +222 -0
- package/dist/gateway/static/root/assets/apps-page-CIC8bmvZ.js +1 -0
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-CpyoFbs4.js → attachment-preview-renderer-DBAxQXb-.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-process-heavy-CqVriadb.js → attachment-process-heavy-Csq3TrrP.js} +4 -4
- package/dist/gateway/static/root/assets/channels-settings-C8G8RAAP.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-DaHGkRF1.js → channels-status-swr-CYWL5DLD.js} +1 -1
- package/dist/gateway/static/root/assets/circle-check-C23XjkUj.js +1 -0
- package/dist/gateway/static/root/assets/copy-Dv6d4Dvw.js +1 -0
- package/dist/gateway/static/root/assets/cron-api-TVqLlGAC.js +1 -0
- package/dist/gateway/static/root/assets/cron-dreaming-jobs-Ip703-qM.js +2 -0
- package/dist/gateway/static/root/assets/cron-page-BtcFYlvv.js +1 -0
- package/dist/gateway/static/root/assets/dist-CUV1uY5f.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CtuKJ9tE.js → extension-debug-page-mTLHRDp1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-ykzjOkR5.js → extension-page-iI8BI7WK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Ce2qrdpO.js → extension-settings-page-ByXcdubM.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-C9FFJjuH.js → fetch-BWtQq_Ys.js} +1 -1
- package/dist/gateway/static/root/assets/{field-primitives-BFcrNeTU.js → field-primitives-BsZ-4VT5.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-config-api-CEg4Vr9R.js → heartbeat-config-api-WjTsRLCU.js} +1 -1
- package/dist/gateway/static/root/assets/{index-CZfy9oxs.js → index-CKkR-v9U.js} +101 -97
- package/dist/gateway/static/root/assets/index-VlELBY99.css +1 -0
- package/dist/gateway/static/root/assets/logs-page-ClnIpxfd.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-page-B91pLkEI.css +1 -0
- package/dist/gateway/static/root/assets/note-detail-page-DJ2Mb4x7.js +179 -0
- package/dist/gateway/static/root/assets/note-time-JLBPSLzK.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-BE-75qz9.js +1 -0
- package/dist/gateway/static/root/assets/{pdf-BnEvgIXZ.js → pdf-epILhEOn.js} +1 -1
- package/dist/gateway/static/root/assets/preload-helper-zJ_50EbN.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-bJJkWtTl.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BqdzA28u.js → settings-form-section-DSYCknxM.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-WcMXLq2U.js +3 -0
- package/dist/gateway/static/root/assets/share-preview-page-awRqs4hV.js +2 -0
- package/dist/gateway/static/root/assets/skills-page-Lu-i1JG7.js +2 -0
- package/dist/gateway/static/root/assets/{theme-store-CNqbmTNV.js → theme-store-BC-42BoZ.js} +1 -1
- package/dist/gateway/static/root/assets/toast-z0toXu32.js +1 -0
- package/dist/gateway/static/root/assets/url-CY1RQKTU.js +3 -0
- package/dist/gateway/static/root/assets/{utils-BWm2tG2w.js → utils-DX3TQuap.js} +1 -1
- package/dist/gateway/static/root/assets/vendor-codemirror-DYoKfS8f.js +45 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-B5uKlDqA.js +1 -0
- package/dist/gateway/static/root/assets/workflow-page.utils-ClC37yEp.js +1 -0
- package/dist/gateway/static/root/assets/workflows-page-C7VhIXtR.js +27 -0
- package/dist/gateway/static/root/index.html +11 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.js +20 -18
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.js.map +1 -1
- package/dist/src/agent/tools/cronjob-tool.d.ts +6 -0
- package/dist/src/agent/tools/cronjob-tool.js +74 -9
- package/dist/src/agent/tools/cronjob-tool.js.map +1 -1
- package/dist/src/agent/tools/edit.d.ts +5 -1
- package/dist/src/agent/tools/edit.js +7 -5
- package/dist/src/agent/tools/edit.js.map +1 -1
- package/dist/src/agent/tools/factory.js +2 -2
- package/dist/src/agent/tools/factory.js.map +1 -1
- package/dist/src/agent/tools/write.d.ts +5 -1
- package/dist/src/agent/tools/write.js +7 -5
- package/dist/src/agent/tools/write.js.map +1 -1
- package/dist/src/agent/workflow/agent-progress.js +2 -0
- package/dist/src/agent/workflow/agent-progress.js.map +1 -1
- package/dist/src/agent/workflow/builtins/client-proposal.d.ts +12 -0
- package/dist/src/agent/workflow/builtins/client-proposal.js +155 -0
- package/dist/src/agent/workflow/builtins/client-proposal.js.map +1 -0
- package/dist/src/agent/workflow/builtins/competitor-scan.d.ts +12 -0
- package/dist/src/agent/workflow/builtins/competitor-scan.js +150 -0
- package/dist/src/agent/workflow/builtins/competitor-scan.js.map +1 -0
- package/dist/src/agent/workflow/builtins/content-draft.d.ts +13 -0
- package/dist/src/agent/workflow/builtins/content-draft.js +146 -0
- package/dist/src/agent/workflow/builtins/content-draft.js.map +1 -0
- package/dist/src/agent/workflow/builtins/content-repurpose.d.ts +11 -0
- package/dist/src/agent/workflow/builtins/content-repurpose.js +137 -0
- package/dist/src/agent/workflow/builtins/content-repurpose.js.map +1 -0
- package/dist/src/agent/workflow/builtins/decision-compare.d.ts +13 -0
- package/dist/src/agent/workflow/builtins/decision-compare.js +173 -0
- package/dist/src/agent/workflow/builtins/decision-compare.js.map +1 -0
- package/dist/src/agent/workflow/builtins/inbox-triage.d.ts +11 -0
- package/dist/src/agent/workflow/builtins/inbox-triage.js +148 -0
- package/dist/src/agent/workflow/builtins/inbox-triage.js.map +1 -0
- package/dist/src/agent/workflow/builtins/index.d.ts +10 -1
- package/dist/src/agent/workflow/builtins/index.js +46 -1
- package/dist/src/agent/workflow/builtins/index.js.map +1 -1
- package/dist/src/agent/workflow/builtins/meeting-prep.d.ts +12 -0
- package/dist/src/agent/workflow/builtins/meeting-prep.js +144 -0
- package/dist/src/agent/workflow/builtins/meeting-prep.js.map +1 -0
- package/dist/src/agent/workflow/builtins/offer-design.d.ts +12 -0
- package/dist/src/agent/workflow/builtins/offer-design.js +161 -0
- package/dist/src/agent/workflow/builtins/offer-design.js.map +1 -0
- package/dist/src/agent/workflow/builtins/weekly-review.d.ts +12 -0
- package/dist/src/agent/workflow/builtins/weekly-review.js +131 -0
- package/dist/src/agent/workflow/builtins/weekly-review.js.map +1 -0
- package/dist/src/agent/workflow/step-labels.js +2 -2
- package/dist/src/agent/workflow/step-labels.js.map +1 -1
- package/dist/src/agent/workflow/subagent-runner.js +3 -1
- package/dist/src/agent/workflow/subagent-runner.js.map +1 -1
- package/dist/src/agent/workflow/types.d.ts +4 -0
- package/dist/src/chat-commands/agent-edit.d.ts +4 -0
- package/dist/src/chat-commands/agent-edit.js +136 -0
- package/dist/src/chat-commands/agent-edit.js.map +1 -0
- package/dist/src/chat-commands/index.d.ts +1 -0
- package/dist/src/chat-commands/index.js +3 -1
- package/dist/src/chat-commands/index.js.map +1 -1
- package/dist/src/cli/bin.js +2 -0
- package/dist/src/cli/bin.js.map +1 -1
- package/dist/src/cli/commands/cron.js +42 -3
- package/dist/src/cli/commands/cron.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +79 -56
- package/dist/src/cli/commands/doctor/checks/session-integrity.js.map +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/update.js +86 -79
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/commands/agents.config.d.ts +3 -2
- package/dist/src/commands/agents.config.js +5 -2
- package/dist/src/commands/agents.config.js.map +1 -1
- package/dist/src/config/agent-typed-models.d.ts +2 -7
- package/dist/src/config/agent-typed-models.js +3 -14
- package/dist/src/config/agent-typed-models.js.map +1 -1
- package/dist/src/config/localized-text.d.ts +6 -0
- package/dist/src/config/localized-text.js +42 -0
- package/dist/src/config/localized-text.js.map +1 -0
- package/dist/src/config/models-json.d.ts +6 -6
- package/dist/src/config/schema.d.ts +6 -21
- package/dist/src/config/schema.js +4 -4
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/cron/executor.d.ts +2 -0
- package/dist/src/cron/executor.js +111 -1
- package/dist/src/cron/executor.js.map +1 -1
- package/dist/src/cron/types.d.ts +8 -1
- package/dist/src/cron/validation.d.ts +4 -0
- package/dist/src/cron/validation.js +4 -3
- package/dist/src/cron/validation.js.map +1 -1
- package/dist/src/cron/workflow-run-completion.d.ts +23 -0
- package/dist/src/cron/workflow-run-completion.js +72 -0
- package/dist/src/cron/workflow-run-completion.js.map +1 -0
- package/dist/src/extensions/update.d.ts +51 -0
- package/dist/src/extensions/update.js +260 -0
- package/dist/src/extensions/update.js.map +1 -0
- package/dist/src/gateway/agents-admin.d.ts +15 -8
- package/dist/src/gateway/agents-admin.js +77 -28
- package/dist/src/gateway/agents-admin.js.map +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +6 -0
- package/dist/src/gateway/hono/lib/config-payload.js +3 -1
- package/dist/src/gateway/hono/lib/config-payload.js.map +1 -1
- package/dist/src/gateway/hono/middleware/auth.d.ts +2 -0
- package/dist/src/gateway/hono/middleware/auth.js +11 -7
- package/dist/src/gateway/hono/middleware/auth.js.map +1 -1
- package/dist/src/gateway/hono/routes/agents.js +55 -12
- package/dist/src/gateway/hono/routes/agents.js.map +1 -1
- package/dist/src/gateway/hono/routes/config-patch/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +2 -2
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +12 -0
- package/dist/src/gateway/hono/routes/config-patch/gateway.js.map +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
- package/dist/src/gateway/hono/routes/notes.d.ts +3 -0
- package/dist/src/gateway/hono/routes/notes.js +274 -0
- package/dist/src/gateway/hono/routes/notes.js.map +1 -0
- package/dist/src/gateway/hono/routes/sessions.js.map +1 -1
- package/dist/src/gateway/hono/routes/update.js +55 -107
- package/dist/src/gateway/hono/routes/update.js.map +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +3 -1
- package/dist/src/gateway/hono/routes/workflows.js.map +1 -1
- package/dist/src/gateway/server.js +2 -0
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +12 -1
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/workspace-ripgrep.d.ts +6 -0
- package/dist/src/gateway/workspace-ripgrep.js +62 -11
- package/dist/src/gateway/workspace-ripgrep.js.map +1 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/brew.d.ts +4 -0
- package/dist/src/infra/brew.js +20 -0
- package/dist/src/infra/brew.js.map +1 -0
- package/dist/src/infra/package-json.d.ts +2 -0
- package/dist/src/infra/package-json.js +23 -0
- package/dist/src/infra/package-json.js.map +1 -0
- package/dist/src/infra/package-update-steps.d.ts +35 -0
- package/dist/src/infra/package-update-steps.js +304 -0
- package/dist/src/infra/package-update-steps.js.map +1 -0
- package/dist/src/infra/path-env.d.ts +11 -0
- package/dist/src/infra/path-env.js +90 -0
- package/dist/src/infra/path-env.js.map +1 -0
- package/dist/src/infra/path-prepend.d.ts +7 -0
- package/dist/src/infra/path-prepend.js +44 -0
- package/dist/src/infra/path-prepend.js.map +1 -0
- package/dist/src/infra/stable-node-path.d.ts +2 -0
- package/dist/src/infra/stable-node-path.js +28 -0
- package/dist/src/infra/stable-node-path.js.map +1 -0
- package/dist/src/infra/update-global.d.ts +30 -23
- package/dist/src/infra/update-global.js +113 -64
- package/dist/src/infra/update-global.js.map +1 -1
- package/dist/src/infra/update-log.d.ts +1 -0
- package/dist/src/infra/update-log.js +12 -0
- package/dist/src/infra/update-log.js.map +1 -0
- package/dist/src/infra/update-restart.d.ts +20 -0
- package/dist/src/infra/update-restart.js +165 -0
- package/dist/src/infra/update-restart.js.map +1 -0
- package/dist/src/infra/update-runner.d.ts +89 -1
- package/dist/src/infra/update-runner.js +604 -173
- package/dist/src/infra/update-runner.js.map +1 -1
- package/dist/src/infra/update-startup.d.ts +3 -0
- package/dist/src/infra/update-startup.js +8 -4
- package/dist/src/infra/update-startup.js.map +1 -1
- package/dist/src/notes/attachment-ref.d.ts +9 -0
- package/dist/src/notes/attachment-ref.js +27 -0
- package/dist/src/notes/attachment-ref.js.map +1 -0
- package/dist/src/notes/index.d.ts +4 -0
- package/dist/src/notes/index.js +4 -0
- package/dist/src/notes/note-attachment-sync.d.ts +7 -0
- package/dist/src/notes/note-attachment-sync.js +46 -0
- package/dist/src/notes/note-attachment-sync.js.map +1 -0
- package/dist/src/notes/note-index-meta.d.ts +14 -0
- package/dist/src/notes/note-index-meta.js +87 -0
- package/dist/src/notes/note-index-meta.js.map +1 -0
- package/dist/src/notes/paths.d.ts +5 -0
- package/dist/src/notes/paths.js +23 -0
- package/dist/src/notes/paths.js.map +1 -0
- package/dist/src/notes/service.d.ts +42 -0
- package/dist/src/notes/service.js +331 -0
- package/dist/src/notes/service.js.map +1 -0
- package/dist/src/notes/store.d.ts +33 -0
- package/dist/src/notes/store.js +317 -0
- package/dist/src/notes/store.js.map +1 -0
- package/dist/src/notes/types.d.ts +162 -0
- package/dist/src/notes/types.js +1 -0
- package/dist/src/routing/resolve-route.d.ts +3 -1
- package/dist/src/routing/resolve-route.js.map +1 -1
- package/dist/src/session/store.d.ts +5 -3
- package/dist/src/session/store.js +66 -20
- package/dist/src/session/store.js.map +1 -1
- package/dist/src/utils/logger/stats.d.ts +1 -1
- package/dist/src/workflows/domain/event.d.ts +3 -0
- package/dist/src/workflows/domain/run.d.ts +3 -0
- package/dist/src/workflows/domain/run.js.map +1 -1
- package/dist/src/workflows/engine/projector.js +17 -0
- package/dist/src/workflows/engine/projector.js.map +1 -1
- package/dist/src/workflows/engine/workflow-engine.js +127 -0
- package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
- package/dist/src/workflows/index.js +1 -1
- package/dist/src/workflows/service/run-view-to-snapshot.js +3 -1
- package/dist/src/workflows/service/run-view-to-snapshot.js.map +1 -1
- package/dist/src/workflows/service/workflow-run-service.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +4 -1
- package/dist/src/workflows/service/workflow-run-service.js.map +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-B6PJB07W.js +0 -222
- package/dist/gateway/static/root/assets/apps-page-BOr0B1wv.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-BelUKggl.js +0 -1
- package/dist/gateway/static/root/assets/cron-api-CjOg-BIj.js +0 -1
- package/dist/gateway/static/root/assets/cron-dreaming-jobs-DueM3rBz.js +0 -2
- package/dist/gateway/static/root/assets/cron-page-DhoZmZXb.js +0 -1
- package/dist/gateway/static/root/assets/dist-6LecgDx5.js +0 -1
- package/dist/gateway/static/root/assets/dist-BTWC-BTN.js +0 -45
- package/dist/gateway/static/root/assets/index-CiN1cQiQ.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-BwWLfqvd.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DV5WN8uk.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-CfOBRbPX.js +0 -3
- package/dist/gateway/static/root/assets/share-preview-page-Di5Bzh4g.js +0 -2
- package/dist/gateway/static/root/assets/skills-page-D0H5Kaxg.js +0 -2
- package/dist/gateway/static/root/assets/url-aYn-Rj1C.js +0 -7
- package/dist/gateway/static/root/assets/vendor-codemirror-D0yxdRpg.js +0 -58
- package/dist/gateway/static/root/assets/voice-api-key-field-X2UfnHeq.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-BOPpO3NG.js +0 -27
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
//#region src/agent/workflow/builtins/decision-compare.ts
|
|
2
|
+
/**
|
|
3
|
+
* Built-in workflow: `decision_compare`
|
|
4
|
+
*
|
|
5
|
+
* Structured comparison of options for everyday decisions — vendors, approaches,
|
|
6
|
+
* purchases, policies, or life choices. Independent evaluators score each option,
|
|
7
|
+
* then a synthesizer recommends with trade-offs spelled out.
|
|
8
|
+
*
|
|
9
|
+
* Args:
|
|
10
|
+
* - question: the decision to make
|
|
11
|
+
* - options: optional comma-separated or newline-separated option list
|
|
12
|
+
* - criteria: optional evaluation criteria hint
|
|
13
|
+
*/
|
|
14
|
+
const DECISION_COMPARE_SCRIPT = `export const meta = {
|
|
15
|
+
name: 'decision_compare',
|
|
16
|
+
description: 'Compare options across independent evaluators, then recommend with explicit trade-offs.',
|
|
17
|
+
whenToUse: 'User faces a non-code decision with multiple viable options and wants a structured comparison.',
|
|
18
|
+
examplePrompts: [
|
|
19
|
+
{ field: 'question', text: 'Which project management tool fits a 5-person remote team?' },
|
|
20
|
+
{ field: 'question', text: 'Should we host the event in-person, hybrid, or fully virtual?' },
|
|
21
|
+
],
|
|
22
|
+
i18n: {
|
|
23
|
+
zh: {
|
|
24
|
+
description: '由多个独立评审维度对比选项,并给出含权衡的推荐结论。',
|
|
25
|
+
whenToUse: '用户面临多个可行方案的非代码决策,需要结构化对比时。',
|
|
26
|
+
examplePrompts: [
|
|
27
|
+
{ field: 'question', text: '5 人远程团队适合用哪款项目管理工具?' },
|
|
28
|
+
{ field: 'question', text: '活动应该线下、混合还是纯线上举办?' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
tags: ['decision-making', 'comparison', 'productivity'],
|
|
33
|
+
estimatedAgents: { min: 4, max: 7 },
|
|
34
|
+
phases: [
|
|
35
|
+
{ title: 'Frame' },
|
|
36
|
+
{ title: 'Evaluate' },
|
|
37
|
+
{ title: 'Recommend' },
|
|
38
|
+
],
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const question = args && typeof args === 'object' && args.question
|
|
42
|
+
? String(args.question)
|
|
43
|
+
: 'Infer the decision question from the most recent user turn.'
|
|
44
|
+
|
|
45
|
+
const optionsRaw = args && typeof args === 'object' && args.options
|
|
46
|
+
? String(args.options)
|
|
47
|
+
: ''
|
|
48
|
+
|
|
49
|
+
const criteriaHint = args && typeof args === 'object' && args.criteria
|
|
50
|
+
? String(args.criteria)
|
|
51
|
+
: ''
|
|
52
|
+
|
|
53
|
+
phase('Frame')
|
|
54
|
+
const frame = await agent(
|
|
55
|
+
'Frame this decision. If options are not provided, propose 3–4 realistic options. Return evaluation criteria (weighted if helpful), assumptions, and non-goals.\\n\\n' +
|
|
56
|
+
'QUESTION:\\n' + question + '\\n' +
|
|
57
|
+
(optionsRaw ? 'OPTIONS:\\n' + optionsRaw + '\\n' : '') +
|
|
58
|
+
(criteriaHint ? 'CRITERIA HINT:\\n' + criteriaHint + '\\n' : ''),
|
|
59
|
+
{
|
|
60
|
+
label: 'framing',
|
|
61
|
+
schema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
options: {
|
|
65
|
+
type: 'array',
|
|
66
|
+
items: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
name: { type: 'string' },
|
|
70
|
+
summary: { type: 'string' },
|
|
71
|
+
},
|
|
72
|
+
required: ['name', 'summary'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
criteria: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {
|
|
80
|
+
name: { type: 'string' },
|
|
81
|
+
weight: { type: 'string', enum: ['low', 'med', 'high'] },
|
|
82
|
+
},
|
|
83
|
+
required: ['name'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
assumptions: { type: 'array', items: { type: 'string' } },
|
|
87
|
+
},
|
|
88
|
+
required: ['options', 'criteria'],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
if (!frame || !frame.options?.length) {
|
|
94
|
+
return { ok: false, reason: 'framing failed', question }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const options = frame.options.slice(0, 4)
|
|
98
|
+
const criteria = frame.criteria ?? []
|
|
99
|
+
|
|
100
|
+
const LENSES = [
|
|
101
|
+
{ name: 'Benefits', focus: 'Upside, value delivered, and who wins.' },
|
|
102
|
+
{ name: 'Risks', focus: 'Downside, failure modes, hidden costs, and regrets.' },
|
|
103
|
+
{ name: 'Fit', focus: 'Fit for stated constraints, audience, timeline, and resources.' },
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
phase('Evaluate')
|
|
107
|
+
const evaluations = await parallel(
|
|
108
|
+
LENSES.map((lens) => () =>
|
|
109
|
+
agent(
|
|
110
|
+
'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' +
|
|
111
|
+
'LENS: ' + lens.name + ' — ' + lens.focus + '\\n' +
|
|
112
|
+
'QUESTION: ' + question + '\\n' +
|
|
113
|
+
'OPTIONS:\\n' + JSON.stringify(options, null, 2) + '\\n' +
|
|
114
|
+
'CRITERIA:\\n' + JSON.stringify(criteria, null, 2),
|
|
115
|
+
{
|
|
116
|
+
label: lens.name,
|
|
117
|
+
schema: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
properties: {
|
|
120
|
+
lens: { type: 'string' },
|
|
121
|
+
scores: {
|
|
122
|
+
type: 'array',
|
|
123
|
+
items: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
option: { type: 'string' },
|
|
127
|
+
score: { type: 'string', enum: ['low', 'med', 'high'] },
|
|
128
|
+
rationale: { type: 'string' },
|
|
129
|
+
},
|
|
130
|
+
required: ['option', 'score', 'rationale'],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
required: ['lens', 'scores'],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
),
|
|
138
|
+
),
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
phase('Recommend')
|
|
142
|
+
const live = evaluations.filter(Boolean)
|
|
143
|
+
const recommendation = await agent(
|
|
144
|
+
'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' +
|
|
145
|
+
'QUESTION:\\n' + question + '\\n\\n' +
|
|
146
|
+
JSON.stringify({ frame, evaluations: live }, null, 2),
|
|
147
|
+
{
|
|
148
|
+
label: 'recommendation',
|
|
149
|
+
schema: {
|
|
150
|
+
type: 'object',
|
|
151
|
+
properties: {
|
|
152
|
+
recommendation: { type: 'string' },
|
|
153
|
+
rationale: { type: 'string' },
|
|
154
|
+
tradeoffs: { type: 'array', items: { type: 'string' } },
|
|
155
|
+
runnerUp: { type: 'string' },
|
|
156
|
+
whatWouldChange: { type: 'array', items: { type: 'string' } },
|
|
157
|
+
},
|
|
158
|
+
required: ['recommendation', 'rationale', 'tradeoffs'],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
ok: true,
|
|
165
|
+
question,
|
|
166
|
+
optionCount: options.length,
|
|
167
|
+
...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
//#endregion
|
|
171
|
+
export { DECISION_COMPARE_SCRIPT };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=decision-compare.js.map
|
|
@@ -0,0 +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 return { ok: false, reason: 'framing failed', question }\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\nreturn {\n ok: true,\n question,\n optionCount: options.length,\n ...(recommendation ?? { recommendation: 'recommendation failed', rationale: '', tradeoffs: [] }),\n}\n`\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,0BAA0B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in workflow: `inbox_triage`
|
|
3
|
+
*
|
|
4
|
+
* Triage messy inbox input — emails, messages, todos, ideas — into prioritized
|
|
5
|
+
* action buckets for a solo operator with limited hours.
|
|
6
|
+
*
|
|
7
|
+
* Args:
|
|
8
|
+
* - inbox: pasted items to triage
|
|
9
|
+
* - priorities: this week's focus (optional)
|
|
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\nreturn {\n ok: true,\n classified,\n prioritized,\n ...(actionList ?? { focusTheme: 'triage failed', topThree: [] }),\n}\n";
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
//#region src/agent/workflow/builtins/inbox-triage.ts
|
|
2
|
+
/**
|
|
3
|
+
* Built-in workflow: `inbox_triage`
|
|
4
|
+
*
|
|
5
|
+
* Triage messy inbox input — emails, messages, todos, ideas — into prioritized
|
|
6
|
+
* action buckets for a solo operator with limited hours.
|
|
7
|
+
*
|
|
8
|
+
* Args:
|
|
9
|
+
* - inbox: pasted items to triage
|
|
10
|
+
* - priorities: this week's focus (optional)
|
|
11
|
+
*/
|
|
12
|
+
const INBOX_TRIAGE_SCRIPT = `export const meta = {
|
|
13
|
+
name: 'inbox_triage',
|
|
14
|
+
description: 'Sort messy inbox input into today-must-do, delegate/automate, defer, and drop — with priorities.',
|
|
15
|
+
whenToUse: 'Solo operator starting the day with emails, messages, and todos to sort in limited time.',
|
|
16
|
+
examplePrompts: [
|
|
17
|
+
{ field: 'inbox', text: 'Client email re: deadline, newsletter idea, tax reminder, Slack ping, bug report' },
|
|
18
|
+
{ field: 'priorities', text: 'Ship v1 landing page and close one sales call this week' },
|
|
19
|
+
],
|
|
20
|
+
i18n: {
|
|
21
|
+
zh: {
|
|
22
|
+
description: '将邮件、消息、待办等杂乱输入分拣为今日必做、可委派/自动化、延后、可删除,并排序。',
|
|
23
|
+
whenToUse: '超级个体开工前需要理清信息、任务优先级,且时间有限时。',
|
|
24
|
+
examplePrompts: [
|
|
25
|
+
{ field: 'inbox', text: '客户催进度邮件、newsletter 灵感、报税提醒、Slack @、一个 bug 反馈' },
|
|
26
|
+
{ field: 'priorities', text: '本周要上线 v1 落地页并完成一次销售通话' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
tags: ['productivity', 'brainstorm'],
|
|
31
|
+
estimatedAgents: { min: 3, max: 4 },
|
|
32
|
+
phases: [
|
|
33
|
+
{ title: 'Classify' },
|
|
34
|
+
{ title: 'Prioritize' },
|
|
35
|
+
{ title: 'Action list' },
|
|
36
|
+
],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const inbox = args && typeof args === 'object' && args.inbox
|
|
40
|
+
? String(args.inbox)
|
|
41
|
+
: 'Infer inbox items from the most recent user turn.'
|
|
42
|
+
|
|
43
|
+
const priorities = args && typeof args === 'object' && args.priorities
|
|
44
|
+
? String(args.priorities)
|
|
45
|
+
: ''
|
|
46
|
+
|
|
47
|
+
phase('Classify')
|
|
48
|
+
const classified = await agent(
|
|
49
|
+
'Classify each inbox item. Buckets: do_today, schedule_later, delegate_or_automate, drop, idea_parking. Extract implicit tasks and estimated minutes.\\n\\n' +
|
|
50
|
+
'INBOX:\\n' + inbox + '\\nWEEKLY PRIORITIES:\\n' + (priorities || '(not specified)'),
|
|
51
|
+
{
|
|
52
|
+
label: 'classify',
|
|
53
|
+
schema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
items: {
|
|
57
|
+
type: 'array',
|
|
58
|
+
items: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
raw: { type: 'string' },
|
|
62
|
+
bucket: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
enum: ['do_today', 'schedule_later', 'delegate_or_automate', 'drop', 'idea_parking'],
|
|
65
|
+
},
|
|
66
|
+
task: { type: 'string' },
|
|
67
|
+
minutes: { type: 'number' },
|
|
68
|
+
},
|
|
69
|
+
required: ['raw', 'bucket', 'task'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ['items'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
phase('Prioritize')
|
|
79
|
+
const prioritized = await agent(
|
|
80
|
+
'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' +
|
|
81
|
+
JSON.stringify({ priorities, classified }, null, 2),
|
|
82
|
+
{
|
|
83
|
+
label: 'prioritize',
|
|
84
|
+
schema: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
rankedToday: {
|
|
88
|
+
type: 'array',
|
|
89
|
+
items: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
task: { type: 'string' },
|
|
93
|
+
rank: { type: 'number' },
|
|
94
|
+
impact: { type: 'string', enum: ['low', 'med', 'high'] },
|
|
95
|
+
reason: { type: 'string' },
|
|
96
|
+
},
|
|
97
|
+
required: ['task', 'rank', 'impact'],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
conflicts: { type: 'array', items: { type: 'string' } },
|
|
101
|
+
batchSuggestions: { type: 'array', items: { type: 'string' } },
|
|
102
|
+
},
|
|
103
|
+
required: ['rankedToday'],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
phase('Action list')
|
|
109
|
+
const actionList = await agent(
|
|
110
|
+
'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' +
|
|
111
|
+
JSON.stringify({ classified, prioritized }, null, 2),
|
|
112
|
+
{
|
|
113
|
+
label: 'action list',
|
|
114
|
+
schema: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {
|
|
117
|
+
focusTheme: { type: 'string' },
|
|
118
|
+
topThree: {
|
|
119
|
+
type: 'array',
|
|
120
|
+
items: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
properties: {
|
|
123
|
+
task: { type: 'string' },
|
|
124
|
+
timeBlock: { type: 'string' },
|
|
125
|
+
},
|
|
126
|
+
required: ['task'],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
quickWins: { type: 'array', items: { type: 'string' } },
|
|
130
|
+
delegateOrAutomate: { type: 'array', items: { type: 'string' } },
|
|
131
|
+
parkingLot: { type: 'array', items: { type: 'string' } },
|
|
132
|
+
},
|
|
133
|
+
required: ['focusTheme', 'topThree'],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
ok: true,
|
|
140
|
+
classified,
|
|
141
|
+
prioritized,
|
|
142
|
+
...(actionList ?? { focusTheme: 'triage failed', topThree: [] }),
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
//#endregion
|
|
146
|
+
export { INBOX_TRIAGE_SCRIPT };
|
|
147
|
+
|
|
148
|
+
//# sourceMappingURL=inbox-triage.js.map
|
|
@@ -0,0 +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\nreturn {\n ok: true,\n classified,\n prioritized,\n ...(actionList ?? { focusTheme: 'triage failed', topThree: [] }),\n}\n`\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,sBAAsB"}
|
|
@@ -5,15 +5,24 @@
|
|
|
5
5
|
* not authority.
|
|
6
6
|
*/
|
|
7
7
|
import { AUDIT_REPO_SCRIPT } from './audit-repo.js';
|
|
8
|
+
import { CLIENT_PROPOSAL_SCRIPT } from './client-proposal.js';
|
|
9
|
+
import { COMPETITOR_SCAN_SCRIPT } from './competitor-scan.js';
|
|
10
|
+
import { CONTENT_DRAFT_SCRIPT } from './content-draft.js';
|
|
11
|
+
import { CONTENT_REPURPOSE_SCRIPT } from './content-repurpose.js';
|
|
8
12
|
import { DEBUG_INCIDENT_SCRIPT } from './debug-incident.js';
|
|
13
|
+
import { DECISION_COMPARE_SCRIPT } from './decision-compare.js';
|
|
9
14
|
import { IMPLEMENTATION_PLAN_SCRIPT } from './implementation-plan.js';
|
|
15
|
+
import { INBOX_TRIAGE_SCRIPT } from './inbox-triage.js';
|
|
16
|
+
import { MEETING_PREP_SCRIPT } from './meeting-prep.js';
|
|
10
17
|
import { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from './multi-perspective-review.js';
|
|
18
|
+
import { OFFER_DESIGN_SCRIPT } from './offer-design.js';
|
|
11
19
|
import { PR_REVIEW_SCRIPT } from './pr-review.js';
|
|
12
20
|
import { RELEASE_CHECK_SCRIPT } from './release-check.js';
|
|
13
21
|
import { RESEARCH_SCRIPT } from './research.js';
|
|
22
|
+
import { WEEKLY_REVIEW_SCRIPT } from './weekly-review.js';
|
|
14
23
|
export interface BuiltinWorkflow {
|
|
15
24
|
name: string;
|
|
16
25
|
script: string;
|
|
17
26
|
}
|
|
18
27
|
export declare const BUILTIN_WORKFLOWS: readonly BuiltinWorkflow[];
|
|
19
|
-
export { AUDIT_REPO_SCRIPT, DEBUG_INCIDENT_SCRIPT, IMPLEMENTATION_PLAN_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, PR_REVIEW_SCRIPT, RELEASE_CHECK_SCRIPT, RESEARCH_SCRIPT, };
|
|
28
|
+
export { AUDIT_REPO_SCRIPT, CLIENT_PROPOSAL_SCRIPT, COMPETITOR_SCAN_SCRIPT, CONTENT_DRAFT_SCRIPT, CONTENT_REPURPOSE_SCRIPT, DEBUG_INCIDENT_SCRIPT, DECISION_COMPARE_SCRIPT, IMPLEMENTATION_PLAN_SCRIPT, INBOX_TRIAGE_SCRIPT, MEETING_PREP_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, OFFER_DESIGN_SCRIPT, PR_REVIEW_SCRIPT, RELEASE_CHECK_SCRIPT, RESEARCH_SCRIPT, WEEKLY_REVIEW_SCRIPT, };
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { AUDIT_REPO_SCRIPT } from "./audit-repo.js";
|
|
2
|
+
import { CLIENT_PROPOSAL_SCRIPT } from "./client-proposal.js";
|
|
3
|
+
import { COMPETITOR_SCAN_SCRIPT } from "./competitor-scan.js";
|
|
4
|
+
import { CONTENT_DRAFT_SCRIPT } from "./content-draft.js";
|
|
5
|
+
import { CONTENT_REPURPOSE_SCRIPT } from "./content-repurpose.js";
|
|
2
6
|
import { DEBUG_INCIDENT_SCRIPT } from "./debug-incident.js";
|
|
7
|
+
import { DECISION_COMPARE_SCRIPT } from "./decision-compare.js";
|
|
3
8
|
import { IMPLEMENTATION_PLAN_SCRIPT } from "./implementation-plan.js";
|
|
9
|
+
import { INBOX_TRIAGE_SCRIPT } from "./inbox-triage.js";
|
|
10
|
+
import { MEETING_PREP_SCRIPT } from "./meeting-prep.js";
|
|
4
11
|
import { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from "./multi-perspective-review.js";
|
|
12
|
+
import { OFFER_DESIGN_SCRIPT } from "./offer-design.js";
|
|
5
13
|
import { PR_REVIEW_SCRIPT } from "./pr-review.js";
|
|
6
14
|
import { RELEASE_CHECK_SCRIPT } from "./release-check.js";
|
|
7
15
|
import { RESEARCH_SCRIPT } from "./research.js";
|
|
16
|
+
import { WEEKLY_REVIEW_SCRIPT } from "./weekly-review.js";
|
|
8
17
|
//#region src/agent/workflow/builtins/index.ts
|
|
9
18
|
/**
|
|
10
19
|
* Bundled workflow templates. These are shipped with xopc and discoverable
|
|
@@ -17,18 +26,50 @@ const BUILTIN_WORKFLOWS = Object.freeze([
|
|
|
17
26
|
name: "audit_repo",
|
|
18
27
|
script: AUDIT_REPO_SCRIPT
|
|
19
28
|
},
|
|
29
|
+
{
|
|
30
|
+
name: "client_proposal",
|
|
31
|
+
script: CLIENT_PROPOSAL_SCRIPT
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "competitor_scan",
|
|
35
|
+
script: COMPETITOR_SCAN_SCRIPT
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "content_draft",
|
|
39
|
+
script: CONTENT_DRAFT_SCRIPT
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "content_repurpose",
|
|
43
|
+
script: CONTENT_REPURPOSE_SCRIPT
|
|
44
|
+
},
|
|
20
45
|
{
|
|
21
46
|
name: "debug_incident",
|
|
22
47
|
script: DEBUG_INCIDENT_SCRIPT
|
|
23
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: "decision_compare",
|
|
51
|
+
script: DECISION_COMPARE_SCRIPT
|
|
52
|
+
},
|
|
24
53
|
{
|
|
25
54
|
name: "implementation_plan",
|
|
26
55
|
script: IMPLEMENTATION_PLAN_SCRIPT
|
|
27
56
|
},
|
|
57
|
+
{
|
|
58
|
+
name: "inbox_triage",
|
|
59
|
+
script: INBOX_TRIAGE_SCRIPT
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "meeting_prep",
|
|
63
|
+
script: MEETING_PREP_SCRIPT
|
|
64
|
+
},
|
|
28
65
|
{
|
|
29
66
|
name: "multi_perspective_review",
|
|
30
67
|
script: MULTI_PERSPECTIVE_REVIEW_SCRIPT
|
|
31
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: "offer_design",
|
|
71
|
+
script: OFFER_DESIGN_SCRIPT
|
|
72
|
+
},
|
|
32
73
|
{
|
|
33
74
|
name: "pr_review",
|
|
34
75
|
script: PR_REVIEW_SCRIPT
|
|
@@ -40,9 +81,13 @@ const BUILTIN_WORKFLOWS = Object.freeze([
|
|
|
40
81
|
{
|
|
41
82
|
name: "research",
|
|
42
83
|
script: RESEARCH_SCRIPT
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "weekly_review",
|
|
87
|
+
script: WEEKLY_REVIEW_SCRIPT
|
|
43
88
|
}
|
|
44
89
|
]);
|
|
45
90
|
//#endregion
|
|
46
|
-
export { AUDIT_REPO_SCRIPT, BUILTIN_WORKFLOWS, DEBUG_INCIDENT_SCRIPT, IMPLEMENTATION_PLAN_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, PR_REVIEW_SCRIPT, RELEASE_CHECK_SCRIPT, RESEARCH_SCRIPT };
|
|
91
|
+
export { AUDIT_REPO_SCRIPT, BUILTIN_WORKFLOWS, CLIENT_PROPOSAL_SCRIPT, COMPETITOR_SCAN_SCRIPT, CONTENT_DRAFT_SCRIPT, CONTENT_REPURPOSE_SCRIPT, DEBUG_INCIDENT_SCRIPT, DECISION_COMPARE_SCRIPT, IMPLEMENTATION_PLAN_SCRIPT, INBOX_TRIAGE_SCRIPT, MEETING_PREP_SCRIPT, MULTI_PERSPECTIVE_REVIEW_SCRIPT, OFFER_DESIGN_SCRIPT, PR_REVIEW_SCRIPT, RELEASE_CHECK_SCRIPT, RESEARCH_SCRIPT, WEEKLY_REVIEW_SCRIPT };
|
|
47
92
|
|
|
48
93
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/index.ts"],"sourcesContent":["/**\n * Bundled workflow templates. These are shipped with xopc and discoverable\n * via the catalog alongside user workflows in `~/.xopc/workflows/`. A user\n * workflow with the same `name` always wins — built-ins are starting points,\n * not authority.\n */\n\nimport { AUDIT_REPO_SCRIPT } from './audit-repo.js';\nimport { DEBUG_INCIDENT_SCRIPT } from './debug-incident.js';\nimport { IMPLEMENTATION_PLAN_SCRIPT } from './implementation-plan.js';\nimport { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from './multi-perspective-review.js';\nimport { PR_REVIEW_SCRIPT } from './pr-review.js';\nimport { RELEASE_CHECK_SCRIPT } from './release-check.js';\nimport { RESEARCH_SCRIPT } from './research.js';\n\nexport interface BuiltinWorkflow {\n name: string;\n script: string;\n}\n\nexport const BUILTIN_WORKFLOWS: readonly BuiltinWorkflow[] = Object.freeze([\n { name: 'audit_repo', script: AUDIT_REPO_SCRIPT },\n { name: 'debug_incident', script: DEBUG_INCIDENT_SCRIPT },\n { name: 'implementation_plan', script: IMPLEMENTATION_PLAN_SCRIPT },\n { name: 'multi_perspective_review', script: MULTI_PERSPECTIVE_REVIEW_SCRIPT },\n { name: 'pr_review', script: PR_REVIEW_SCRIPT },\n { name: 'release_check', script: RELEASE_CHECK_SCRIPT },\n { name: 'research', script: RESEARCH_SCRIPT },\n]);\n\nexport {\n AUDIT_REPO_SCRIPT,\n DEBUG_INCIDENT_SCRIPT,\n IMPLEMENTATION_PLAN_SCRIPT,\n MULTI_PERSPECTIVE_REVIEW_SCRIPT,\n PR_REVIEW_SCRIPT,\n RELEASE_CHECK_SCRIPT,\n RESEARCH_SCRIPT,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/agent/workflow/builtins/index.ts"],"sourcesContent":["/**\n * Bundled workflow templates. These are shipped with xopc and discoverable\n * via the catalog alongside user workflows in `~/.xopc/workflows/`. A user\n * workflow with the same `name` always wins — built-ins are starting points,\n * not authority.\n */\n\nimport { AUDIT_REPO_SCRIPT } from './audit-repo.js';\nimport { CLIENT_PROPOSAL_SCRIPT } from './client-proposal.js';\nimport { COMPETITOR_SCAN_SCRIPT } from './competitor-scan.js';\nimport { CONTENT_DRAFT_SCRIPT } from './content-draft.js';\nimport { CONTENT_REPURPOSE_SCRIPT } from './content-repurpose.js';\nimport { DEBUG_INCIDENT_SCRIPT } from './debug-incident.js';\nimport { DECISION_COMPARE_SCRIPT } from './decision-compare.js';\nimport { IMPLEMENTATION_PLAN_SCRIPT } from './implementation-plan.js';\nimport { INBOX_TRIAGE_SCRIPT } from './inbox-triage.js';\nimport { MEETING_PREP_SCRIPT } from './meeting-prep.js';\nimport { MULTI_PERSPECTIVE_REVIEW_SCRIPT } from './multi-perspective-review.js';\nimport { OFFER_DESIGN_SCRIPT } from './offer-design.js';\nimport { PR_REVIEW_SCRIPT } from './pr-review.js';\nimport { RELEASE_CHECK_SCRIPT } from './release-check.js';\nimport { RESEARCH_SCRIPT } from './research.js';\nimport { WEEKLY_REVIEW_SCRIPT } from './weekly-review.js';\n\nexport interface BuiltinWorkflow {\n name: string;\n script: string;\n}\n\nexport const BUILTIN_WORKFLOWS: readonly BuiltinWorkflow[] = Object.freeze([\n { name: 'audit_repo', script: AUDIT_REPO_SCRIPT },\n { name: 'client_proposal', script: CLIENT_PROPOSAL_SCRIPT },\n { name: 'competitor_scan', script: COMPETITOR_SCAN_SCRIPT },\n { name: 'content_draft', script: CONTENT_DRAFT_SCRIPT },\n { name: 'content_repurpose', script: CONTENT_REPURPOSE_SCRIPT },\n { name: 'debug_incident', script: DEBUG_INCIDENT_SCRIPT },\n { name: 'decision_compare', script: DECISION_COMPARE_SCRIPT },\n { name: 'implementation_plan', script: IMPLEMENTATION_PLAN_SCRIPT },\n { name: 'inbox_triage', script: INBOX_TRIAGE_SCRIPT },\n { name: 'meeting_prep', script: MEETING_PREP_SCRIPT },\n { name: 'multi_perspective_review', script: MULTI_PERSPECTIVE_REVIEW_SCRIPT },\n { name: 'offer_design', script: OFFER_DESIGN_SCRIPT },\n { name: 'pr_review', script: PR_REVIEW_SCRIPT },\n { name: 'release_check', script: RELEASE_CHECK_SCRIPT },\n { name: 'research', script: RESEARCH_SCRIPT },\n { name: 'weekly_review', script: WEEKLY_REVIEW_SCRIPT },\n]);\n\nexport {\n AUDIT_REPO_SCRIPT,\n CLIENT_PROPOSAL_SCRIPT,\n COMPETITOR_SCAN_SCRIPT,\n CONTENT_DRAFT_SCRIPT,\n CONTENT_REPURPOSE_SCRIPT,\n DEBUG_INCIDENT_SCRIPT,\n DECISION_COMPARE_SCRIPT,\n IMPLEMENTATION_PLAN_SCRIPT,\n INBOX_TRIAGE_SCRIPT,\n MEETING_PREP_SCRIPT,\n MULTI_PERSPECTIVE_REVIEW_SCRIPT,\n OFFER_DESIGN_SCRIPT,\n PR_REVIEW_SCRIPT,\n RELEASE_CHECK_SCRIPT,\n RESEARCH_SCRIPT,\n WEEKLY_REVIEW_SCRIPT,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,oBAAgD,OAAO,OAAO;CACzE;EAAE,MAAM;EAAc,QAAQ;EAAmB;CACjD;EAAE,MAAM;EAAmB,QAAQ;EAAwB;CAC3D;EAAE,MAAM;EAAmB,QAAQ;EAAwB;CAC3D;EAAE,MAAM;EAAiB,QAAQ;EAAsB;CACvD;EAAE,MAAM;EAAqB,QAAQ;EAA0B;CAC/D;EAAE,MAAM;EAAkB,QAAQ;EAAuB;CACzD;EAAE,MAAM;EAAoB,QAAQ;EAAyB;CAC7D;EAAE,MAAM;EAAuB,QAAQ;EAA4B;CACnE;EAAE,MAAM;EAAgB,QAAQ;EAAqB;CACrD;EAAE,MAAM;EAAgB,QAAQ;EAAqB;CACrD;EAAE,MAAM;EAA4B,QAAQ;EAAiC;CAC7E;EAAE,MAAM;EAAgB,QAAQ;EAAqB;CACrD;EAAE,MAAM;EAAa,QAAQ;EAAkB;CAC/C;EAAE,MAAM;EAAiB,QAAQ;EAAsB;CACvD;EAAE,MAAM;EAAY,QAAQ;EAAiB;CAC7C;EAAE,MAAM;EAAiB,QAAQ;EAAsB;CACxD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in workflow: `meeting_prep`
|
|
3
|
+
*
|
|
4
|
+
* Prepares for a meeting by building context, an agenda, and talking points.
|
|
5
|
+
* Useful for 1:1s, client calls, interviews, or team syncs — no code required.
|
|
6
|
+
*
|
|
7
|
+
* Args:
|
|
8
|
+
* - meeting_topic: what the meeting is about
|
|
9
|
+
* - attendees: who is involved (optional)
|
|
10
|
+
* - goal: desired outcome (optional)
|
|
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\nreturn {\n ok: true,\n meetingTopic,\n attendees,\n goal,\n context,\n agenda,\n talkingPoints,\n}\n";
|