@dipoleml/dcode-cli 1.1.0 → 1.2.1
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/dist/THIRD-PARTY-NOTICES.md +1081 -12
- package/dist/dcode.cjs +59368 -45608
- package/dist/packages/browser-use-plugin/README.md +12 -12
- package/dist/packages/browser-use-plugin/docs/api.json +1 -1
- package/dist/packages/browser-use-plugin/docs/overview.md +5 -4
- package/dist/packages/browser-use-plugin/docs/workflow.md +1 -1
- package/dist/packages/browser-use-plugin/scripts/build.mjs +1 -0
- package/dist/packages/browser-use-plugin/skills/control-browser/SKILL.md +10 -7
- package/dist/packages/bundled-skills/skills/dynamic-workflows/SKILL.md +760 -687
- package/dist/packages/bundled-skills/skills/dynamic-workflows/examples.md +310 -1
- package/dist/packages/bundled-skills/skills/dynamic-workflows/patterns.md +336 -4
- package/dist/packages/node-repl-host/.dcode-plugin/plugin.json +1 -1
- package/dist/packages/node-repl-host/dist/mcp/server.js +9 -14
- package/dist/packages/node-repl-host/scripts/build.mjs +1 -0
- package/dist/provider/dcode-builtin.json +6612 -202
- package/node_modules/@dcode/contracts/dist/compact/index.d.ts +7 -7
- package/node_modules/@dcode/contracts/dist/config/index.d.ts +1 -1
- package/node_modules/@dcode/contracts/dist/events/event-reducer.js +1 -0
- package/node_modules/@dcode/contracts/dist/events/in-memory-session-event-store.js +3 -2
- package/node_modules/@dcode/contracts/dist/events/session-event-retention.d.ts +8 -0
- package/node_modules/@dcode/contracts/dist/events/session-event-retention.js +18 -0
- package/node_modules/@dcode/contracts/dist/events/session.events.d.ts +94 -16
- package/node_modules/@dcode/contracts/dist/events/session.events.js +10 -0
- package/node_modules/@dcode/contracts/dist/hooks/index.d.ts +134 -134
- package/node_modules/@dcode/contracts/dist/hooks/workspace-hook-trust.d.ts +14 -14
- package/node_modules/@dcode/contracts/dist/index.d.ts +2 -0
- package/node_modules/@dcode/contracts/dist/index.js +2 -0
- package/node_modules/@dcode/contracts/dist/interfaces/browser-control.port.d.ts +22 -0
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-hole.port.d.ts +92 -0
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-hole.port.js +9 -0
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-retune.port.d.ts +4 -4
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-retune.port.js +7 -3
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-workspace.port.js +8 -3
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run.port.d.ts +119 -18
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run.port.js +13 -0
- package/node_modules/@dcode/contracts/dist/interfaces/index.d.ts +1 -0
- package/node_modules/@dcode/contracts/dist/interfaces/index.js +1 -0
- package/node_modules/@dcode/contracts/dist/interfaces/mcp.port.d.ts +161 -1
- package/node_modules/@dcode/contracts/dist/interfaces/mcp.port.js +17 -0
- package/node_modules/@dcode/contracts/dist/interfaces/permission-full-access.d.ts +15 -15
- package/node_modules/@dcode/contracts/dist/interfaces/permission-full-access.js +1 -1
- package/node_modules/@dcode/contracts/dist/interfaces/permission.port.d.ts +15 -1
- package/node_modules/@dcode/contracts/dist/interfaces/provider-endpoint-routing.port.d.ts +19 -0
- package/node_modules/@dcode/contracts/dist/interfaces/provider-endpoint-routing.port.js +1 -0
- package/node_modules/@dcode/contracts/dist/interfaces/session-store.port.d.ts +4 -2
- package/node_modules/@dcode/contracts/dist/interfaces/session-store.port.js +5 -0
- package/node_modules/@dcode/contracts/dist/interfaces/session.port.d.ts +92 -3
- package/node_modules/@dcode/contracts/dist/interfaces/session.port.js +4 -1
- package/node_modules/@dcode/contracts/dist/interfaces/topic-resource.port.d.ts +25 -0
- package/node_modules/@dcode/contracts/dist/interfaces/topic-resource.port.js +1 -0
- package/node_modules/@dcode/contracts/dist/model/index.d.ts +15 -1
- package/node_modules/@dcode/contracts/dist/model/index.js +5 -0
- package/node_modules/@dcode/contracts/dist/model/invocation-context.d.ts +6 -1
- package/node_modules/@dcode/contracts/dist/plugins/index.d.ts +23 -0
- package/node_modules/@dcode/contracts/dist/plugins/index.js +2 -1
- package/node_modules/@dcode/contracts/dist/telemetry/agent-execution.d.ts +2 -0
- package/node_modules/@dcode/contracts/dist/telemetry/agent-execution.js +2 -0
- package/node_modules/@dcode/contracts/dist/telemetry/index.d.ts +5 -1
- package/node_modules/@dcode/contracts/dist/telemetry/index.js +12 -0
- package/node_modules/@dcode/contracts/dist/tools/agent.d.ts +12 -12
- package/node_modules/@dcode/contracts/dist/tools/amend-workflow.d.ts +39 -15
- package/node_modules/@dcode/contracts/dist/tools/amend-workflow.js +12 -6
- package/node_modules/@dcode/contracts/dist/tools/automation.d.ts +32 -32
- package/node_modules/@dcode/contracts/dist/tools/automation.js +1 -1
- package/node_modules/@dcode/contracts/dist/tools/bash.d.ts +16 -16
- package/node_modules/@dcode/contracts/dist/tools/bash.js +1 -1
- package/node_modules/@dcode/contracts/dist/tools/create-workflow.d.ts +365 -66
- package/node_modules/@dcode/contracts/dist/tools/create-workflow.js +92 -11
- package/node_modules/@dcode/contracts/dist/tools/edit.d.ts +16 -16
- package/node_modules/@dcode/contracts/dist/tools/eval-workflow-snippet.d.ts +6 -6
- package/node_modules/@dcode/contracts/dist/tools/eval-workflow-snippet.js +5 -1
- package/node_modules/@dcode/contracts/dist/tools/fill-workflow-hole.d.ts +729 -0
- package/node_modules/@dcode/contracts/dist/tools/fill-workflow-hole.js +102 -0
- package/node_modules/@dcode/contracts/dist/tools/get-workflow-run.d.ts +136 -28
- package/node_modules/@dcode/contracts/dist/tools/get-workflow-run.js +36 -0
- package/node_modules/@dcode/contracts/dist/tools/grep.d.ts +4 -4
- package/node_modules/@dcode/contracts/dist/tools/grep.js +4 -0
- package/node_modules/@dcode/contracts/dist/tools/index.d.ts +2 -0
- package/node_modules/@dcode/contracts/dist/tools/index.js +4 -0
- package/node_modules/@dcode/contracts/dist/tools/list-saved-workflows.d.ts +8 -8
- package/node_modules/@dcode/contracts/dist/tools/list-workflow-runs.d.ts +8 -8
- package/node_modules/@dcode/contracts/dist/tools/node-repl.d.ts +2 -2
- package/node_modules/@dcode/contracts/dist/tools/off-peak.d.ts +3 -3
- package/node_modules/@dcode/contracts/dist/tools/off-peak.js +2 -2
- package/node_modules/@dcode/contracts/dist/tools/performance.d.ts +22 -22
- package/node_modules/@dcode/contracts/dist/tools/plan-mode.d.ts +12 -12
- package/node_modules/@dcode/contracts/dist/tools/plan-mode.js +6 -4
- package/node_modules/@dcode/contracts/dist/tools/read-session-context.d.ts +86 -13
- package/node_modules/@dcode/contracts/dist/tools/read-session-context.js +37 -6
- package/node_modules/@dcode/contracts/dist/tools/read.d.ts +38 -38
- package/node_modules/@dcode/contracts/dist/tools/save-workflow.d.ts +21 -10
- package/node_modules/@dcode/contracts/dist/tools/save-workflow.js +22 -2
- package/node_modules/@dcode/contracts/dist/tools/saved-workflow.d.ts +4 -4
- package/node_modules/@dcode/contracts/dist/tools/send-message.d.ts +2 -2
- package/node_modules/@dcode/contracts/dist/tools/skill.js +1 -0
- package/node_modules/@dcode/contracts/dist/tools/task-output.d.ts +6 -6
- package/node_modules/@dcode/contracts/dist/tools/tool-result-metadata.d.ts +1228 -259
- package/node_modules/@dcode/contracts/dist/tools/tool-result-metadata.js +41 -0
- package/node_modules/@dcode/contracts/dist/tools/webfetch.d.ts +2 -2
- package/node_modules/@dcode/contracts/dist/tools/workflow-observation-display.d.ts +20 -20
- package/node_modules/@dcode/contracts/dist/tools/workflow-settings.d.ts +55 -0
- package/node_modules/@dcode/contracts/dist/tools/workflow-settings.js +86 -0
- package/node_modules/@dcode/contracts/dist/tools/workflow.d.ts +8 -8
- package/node_modules/@dcode/contracts/dist/tools/write.d.ts +18 -18
- package/node_modules/@dcode/contracts/dist/workflow/index.d.ts +98 -98
- package/node_modules/@dcode/contracts/dist/workflow/script.d.ts +12 -12
- package/node_modules/@dcode/i18n/dist/index.js +2 -2
- package/node_modules/@dcode/i18n/dist/locale.d.ts +1 -1
- package/node_modules/@dcode/i18n/dist/locale.js +4 -4
- package/node_modules/@dcode/i18n/dist/locales/en-US.js +5 -5
- package/node_modules/@dcode/i18n/dist/locales/fr-CA.d.ts +3 -0
- package/node_modules/@dcode/i18n/dist/locales/fr-CA.js +354 -0
- package/node_modules/@dcode/model-option-map/package.json +1 -1
- package/node_modules/@dcode/shared/dist/api-key-usage-scene.d.ts +7 -0
- package/node_modules/@dcode/shared/dist/api-key-usage-scene.js +6 -0
- package/node_modules/@dcode/shared/dist/attachment-source.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/attachment-source.js +4 -0
- package/node_modules/@dcode/shared/dist/background-bash-output.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/bots.d.ts +763 -15
- package/node_modules/@dcode/shared/dist/bots.js +236 -2
- package/node_modules/@dcode/shared/dist/browser-use/command-metadata.d.ts +2 -2
- package/node_modules/@dcode/shared/dist/browser-use/commands.d.ts +4 -3
- package/node_modules/@dcode/shared/dist/browser-use/commands.js +3 -1
- package/node_modules/@dcode/shared/dist/browser-use/nodeReplBroker.d.ts +5 -4
- package/node_modules/@dcode/shared/dist/browser-use/result.d.ts +6 -6
- package/node_modules/@dcode/shared/dist/channel-mention.d.ts +173 -0
- package/node_modules/@dcode/shared/dist/channel-mention.js +120 -0
- package/node_modules/@dcode/shared/dist/channels.d.ts +128 -1
- package/node_modules/@dcode/shared/dist/channels.js +66 -0
- package/node_modules/@dcode/shared/dist/clientConfig.d.ts +1 -0
- package/node_modules/@dcode/shared/dist/clientConfig.js +18 -2
- package/node_modules/@dcode/shared/dist/cloudContent.d.ts +160 -0
- package/node_modules/@dcode/shared/dist/cloudContent.js +116 -0
- package/node_modules/@dcode/shared/dist/coding-plan-subscription.d.ts +59 -0
- package/node_modules/@dcode/shared/dist/conversation-message-projection-policy.js +2 -0
- package/node_modules/@dcode/shared/dist/conversation-share.d.ts +351 -47
- package/node_modules/@dcode/shared/dist/conversation-share.js +8 -6
- package/node_modules/@dcode/shared/dist/conversationSelection.d.ts +23 -0
- package/node_modules/@dcode/shared/dist/conversationSelection.js +30 -0
- package/node_modules/@dcode/shared/dist/database-startup.d.ts +5 -5
- package/node_modules/@dcode/shared/dist/dcode-agent-model-state.js +14 -6
- package/node_modules/@dcode/shared/dist/dcode-agent-policy.d.ts +16 -1
- package/node_modules/@dcode/shared/dist/dcode-agent-policy.js +17 -1
- package/node_modules/@dcode/shared/dist/dcode-agent-runtime.js +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol/index.d.ts +1733 -318
- package/node_modules/@dcode/shared/dist/dcode-protocol/index.js +555 -24
- package/node_modules/@dcode/shared/dist/dcode-protocol/trace.d.ts +9 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol/trace.js +10 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-legacy-types.d.ts +30 -20
- package/node_modules/@dcode/shared/dist/dcode-protocol-legacy-types.js +3 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/apply.js +12 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/attachment-ref.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/attachment-ref.js +3 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/coalesce.d.ts +3 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/coalesce.js +3 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.d.ts +359 -28
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.js +67 -45
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/controller.d.ts +170 -65
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-session-config.d.ts +20 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-session-config.js +15 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-workflow-display.d.ts +34 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-workflow-display.js +45 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/delta.d.ts +1453 -278
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/delta.js +45 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/index.d.ts +1 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/index.js +1 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/input-intent.d.ts +173 -6
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/input-intent.js +29 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/rows.d.ts +731 -125
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/rows.js +23 -11
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index-workflow-activity.d.ts +30 -11
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index-workflow-activity.js +35 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index.d.ts +40 -25
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/snapshot.d.ts +1444 -216
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/snapshot.js +3 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/submission.d.ts +1 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/submission.js +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/telemetry.d.ts +62 -58
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/toolDisplay.d.ts +185 -50
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/toolDisplay.js +31 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.d.ts +7145 -1002
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.js +18 -5
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-assembler.js +2 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-fault.js +4 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-reassembly.js +5 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-artifacts.d.ts +29 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-artifacts.js +64 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-command-rejections.d.ts +13 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-command-rejections.js +23 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-observation-display.d.ts +14 -14
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-row-meta.d.ts +52 -8
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-row-meta.js +22 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-run-settings-command.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-run-settings-command.js +2 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-session.d.ts +21 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-session.js +44 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-status.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-status.js +3 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-caps.js +5 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-concurrency.d.ts +26 -19
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-concurrency.js +40 -32
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-delta.d.ts +4 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-delta.js +4 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-entries.d.ts +12 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-entries.js +44 -6
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-eviction.d.ts +2 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-eviction.js +17 -10
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-holes.d.ts +33 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-holes.js +202 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-legacy.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-legacy.js +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-phases.js +10 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-reducer.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-reducer.js +29 -22
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-started.js +5 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-tables.js +2 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-unlisted.js +6 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs.d.ts +125 -40
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs.js +101 -26
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-workspace.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workspace-hook-review.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-session-content-profile.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/dcode-session-content-profile.js +49 -0
- package/node_modules/@dcode/shared/dist/dcode-slash-command-help.js +4 -4
- package/node_modules/@dcode/shared/dist/dcode-task-mode-schema.d.ts +6 -1
- package/node_modules/@dcode/shared/dist/dcode-task-mode-schema.js +13 -1
- package/node_modules/@dcode/shared/dist/dcode-task-types-core.d.ts +12 -2
- package/node_modules/@dcode/shared/dist/dcode-task-types.d.ts +23 -0
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.d.ts +20 -1
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.js +98 -17
- package/node_modules/@dcode/shared/dist/desktopMenu.js +48 -48
- package/node_modules/@dcode/shared/dist/dynamic-workflow-feature.d.ts +35 -6
- package/node_modules/@dcode/shared/dist/dynamic-workflow-feature.js +45 -6
- package/node_modules/@dcode/shared/dist/env.d.ts +5 -4
- package/node_modules/@dcode/shared/dist/env.js +9 -9
- package/node_modules/@dcode/shared/dist/errors.d.ts +24 -0
- package/node_modules/@dcode/shared/dist/errors.js +54 -0
- package/node_modules/@dcode/shared/dist/execution-state.d.ts +4 -2
- package/node_modules/@dcode/shared/dist/execution-state.js +1 -1
- package/node_modules/@dcode/shared/dist/feedback.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/gen-ui/contract.d.ts +140 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.example.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.example.js +36 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.js +196 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.test.js +75 -0
- package/node_modules/@dcode/shared/dist/gen-ui/index.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/gen-ui/index.js +2 -0
- package/node_modules/@dcode/shared/dist/gen-ui/module.d.ts +7 -0
- package/node_modules/@dcode/shared/dist/gen-ui/module.js +7 -0
- package/node_modules/@dcode/shared/dist/gen-ui/tweakProtocol.d.ts +202 -0
- package/node_modules/@dcode/shared/dist/gen-ui/tweakProtocol.js +126 -0
- package/node_modules/@dcode/shared/dist/helpAppConfig.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/helpAppConfig.js +2 -2
- package/node_modules/@dcode/shared/dist/highspeed.d.ts +181 -0
- package/node_modules/@dcode/shared/dist/highspeed.js +112 -0
- package/node_modules/@dcode/shared/dist/index.d.ts +27 -5
- package/node_modules/@dcode/shared/dist/index.js +24 -2
- package/node_modules/@dcode/shared/dist/localTtft.d.ts +27 -27
- package/node_modules/@dcode/shared/dist/marketingTouch.d.ts +930 -0
- package/node_modules/@dcode/shared/dist/marketingTouch.js +170 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/appTools.d.ts +83 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/appTools.js +124 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/content.d.ts +4 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/content.js +8 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.d.ts +241 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.example.d.ts +31 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.example.js +42 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.js +101 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.test.js +64 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/hostContract.d.ts +47 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/hostContract.js +8 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/index.d.ts +9 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/index.js +9 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/instance.d.ts +10 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/instance.js +11 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/module.d.ts +12 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/module.js +12 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/resourceMime.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/resourceMime.js +73 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.d.ts +101 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.js +107 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.test.js +55 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/schemas.d.ts +78 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/schemas.js +65 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/toolMeta.d.ts +39 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/toolMeta.js +199 -0
- package/node_modules/@dcode/shared/dist/mcp.d.ts +6 -2
- package/node_modules/@dcode/shared/dist/memory.d.ts +9 -0
- package/node_modules/@dcode/shared/dist/memory.js +2 -0
- package/node_modules/@dcode/shared/dist/model-execution.d.ts +31 -0
- package/node_modules/@dcode/shared/dist/model-execution.js +38 -0
- package/node_modules/@dcode/shared/dist/networkCapture.d.ts +49 -0
- package/node_modules/@dcode/shared/dist/networkCapture.js +41 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.d.ts +6 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.js +16 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.test.js +30 -0
- package/node_modules/@dcode/shared/dist/node/networkCapture.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/node/networkCapture.js +96 -0
- package/node_modules/@dcode/shared/dist/node/officialPluginCache.d.ts +1 -2
- package/node_modules/@dcode/shared/dist/node/subagentMarkdownMigration.d.ts +1 -2
- package/node_modules/@dcode/shared/dist/node.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/node.js +2 -0
- package/node_modules/@dcode/shared/dist/output-style.d.ts +17 -0
- package/node_modules/@dcode/shared/dist/output-style.js +2 -0
- package/node_modules/@dcode/shared/dist/platform.d.ts +149 -1
- package/node_modules/@dcode/shared/dist/platform.js +2 -0
- package/node_modules/@dcode/shared/dist/platformUpdate.d.ts +61 -0
- package/node_modules/@dcode/shared/dist/platformUpdate.js +2 -0
- package/node_modules/@dcode/shared/dist/plugin-marketplaces.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/plugin-marketplaces.js +20 -14
- package/node_modules/@dcode/shared/dist/project-access-token-client.d.ts +42 -0
- package/node_modules/@dcode/shared/dist/project-access-token-client.js +260 -0
- package/node_modules/@dcode/shared/dist/project-access-token-response.d.ts +4 -0
- package/node_modules/@dcode/shared/dist/project-access-token-response.js +9 -0
- package/node_modules/@dcode/shared/dist/project-access-token.d.ts +45 -0
- package/node_modules/@dcode/shared/dist/project-access-token.js +164 -0
- package/node_modules/@dcode/shared/dist/protocol.d.ts +41 -4
- package/node_modules/@dcode/shared/dist/protocol.js +1 -1
- package/node_modules/@dcode/shared/dist/provider-provisioning.d.ts +26 -2
- package/node_modules/@dcode/shared/dist/provider-provisioning.js +19 -3
- package/node_modules/@dcode/shared/dist/providers.d.ts +1 -2
- package/node_modules/@dcode/shared/dist/providers.js +1 -1
- package/node_modules/@dcode/shared/dist/remote-workspace-identity.d.ts +6 -1
- package/node_modules/@dcode/shared/dist/remote-workspace-identity.js +35 -1
- package/node_modules/@dcode/shared/dist/remoteAppConfig.js +1 -1
- package/node_modules/@dcode/shared/dist/remoteEnvironmentKey.js +19 -0
- package/node_modules/@dcode/shared/dist/remoteTarget.d.ts +14 -1
- package/node_modules/@dcode/shared/dist/remoteTarget.js +4 -0
- package/node_modules/@dcode/shared/dist/remoteUsageTelemetry.d.ts +27 -0
- package/node_modules/@dcode/shared/dist/remoteUsageTelemetry.js +43 -0
- package/node_modules/@dcode/shared/dist/rendererActionTrace.d.ts +35 -35
- package/node_modules/@dcode/shared/dist/request-security-edition/index.d.ts +3 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/index.js +3 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/policy.d.ts +3 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/policy.js +5 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/verification-policy.d.ts +19 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/verification-policy.js +29 -0
- package/node_modules/@dcode/shared/dist/rewardsBridge.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/rewardsBridge.js +80 -0
- package/node_modules/@dcode/shared/dist/rewardsEmbedded.d.ts +37 -0
- package/node_modules/@dcode/shared/dist/rewardsEmbedded.js +50 -0
- package/node_modules/@dcode/shared/dist/sessionCreateTelemetry.d.ts +3 -3
- package/node_modules/@dcode/shared/dist/subagent-profile-frontmatter.d.ts +10 -0
- package/node_modules/@dcode/shared/dist/subagent-profile-frontmatter.js +212 -0
- package/node_modules/@dcode/shared/dist/subagent-profile-parser.d.ts +10 -0
- package/node_modules/@dcode/shared/dist/subagent-profile-parser.js +200 -0
- package/node_modules/@dcode/shared/dist/subagent-profile.d.ts +82 -0
- package/node_modules/@dcode/shared/dist/subagent-profile.js +28 -0
- package/node_modules/@dcode/shared/dist/subagent-runtime-config.d.ts +135 -0
- package/node_modules/@dcode/shared/dist/subagent-runtime-config.js +39 -0
- package/node_modules/@dcode/shared/dist/subagents-types.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/task-realtime-core.d.ts +57 -24
- package/node_modules/@dcode/shared/dist/task-realtime-core.js +8 -2
- package/node_modules/@dcode/shared/dist/test-ids-workflow.d.ts +4 -0
- package/node_modules/@dcode/shared/dist/test-ids-workflow.js +5 -0
- package/node_modules/@dcode/shared/dist/test-ids.d.ts +25 -0
- package/node_modules/@dcode/shared/dist/test-ids.js +25 -0
- package/node_modules/@dcode/shared/dist/tool-identity.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/tool-identity.js +4 -0
- package/node_modules/@dcode/shared/dist/tool-plan-adapter.js +14 -1
- package/node_modules/@dcode/shared/dist/usage-stats.d.ts +13 -0
- package/node_modules/@dcode/shared/dist/validation.d.ts +1461 -85
- package/node_modules/@dcode/shared/dist/validation.js +423 -14
- package/node_modules/@dcode/shared/dist/validationAppSettings.d.ts +71 -15
- package/node_modules/@dcode/shared/dist/validationAppSettings.js +74 -12
- package/node_modules/@dcode/shared/dist/web-remote-control-heartbeat.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/web-remote-control-heartbeat.js +40 -0
- package/node_modules/@dcode/shared/dist/web-remote-control-rpc-transport.d.ts +183 -0
- package/node_modules/@dcode/shared/dist/web-remote-control-rpc-transport.js +562 -0
- package/node_modules/@dcode/shared/dist/web-remote-control.d.ts +645 -0
- package/node_modules/@dcode/shared/dist/web-remote-control.js +174 -0
- package/node_modules/@dcode/shared/package.json +5 -2
- package/node_modules/@dcode/tui/dist/app-approval-panel.js +3 -2
- package/node_modules/@dcode/tui/dist/app-approval.d.ts +3 -1
- package/node_modules/@dcode/tui/dist/app-approval.js +9 -5
- package/node_modules/@dcode/tui/dist/app-compact-timeline.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/app-compact-timeline.js +5 -2
- package/node_modules/@dcode/tui/dist/app-empty-transcript.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-empty-transcript.js +1 -1
- package/node_modules/@dcode/tui/dist/app-file-mentions.d.ts +2 -0
- package/node_modules/@dcode/tui/dist/app-file-mentions.js +2 -2
- package/node_modules/@dcode/tui/dist/app-input-pane.d.ts +38 -0
- package/node_modules/@dcode/tui/dist/app-input-pane.js +19 -19
- package/node_modules/@dcode/tui/dist/app-input-status.d.ts +17 -0
- package/node_modules/@dcode/tui/dist/app-input-status.js +4 -4
- package/node_modules/@dcode/tui/dist/app-input.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-input.js +1 -1
- package/node_modules/@dcode/tui/dist/app-markdown-theme.d.ts +2 -1
- package/node_modules/@dcode/tui/dist/app-markdown-theme.js +1 -1
- package/node_modules/@dcode/tui/dist/app-markdown.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-markdown.js +1 -1
- package/node_modules/@dcode/tui/dist/app-mode-command.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/app-mode-command.js +4 -4
- package/node_modules/@dcode/tui/dist/app-mode-suggestion-panel.d.ts +5 -0
- package/node_modules/@dcode/tui/dist/app-mode-suggestion-panel.js +1 -1
- package/node_modules/@dcode/tui/dist/app-mode.d.ts +1 -1
- package/node_modules/@dcode/tui/dist/app-mode.js +1 -1
- package/node_modules/@dcode/tui/dist/app-model-ref.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-model-ref.js +1 -1
- package/node_modules/@dcode/tui/dist/app-motion.d.ts +13 -0
- package/node_modules/@dcode/tui/dist/app-motion.js +17 -7
- package/node_modules/@dcode/tui/dist/app-session-event-handler.d.ts +33 -0
- package/node_modules/@dcode/tui/dist/app-session-event-handler.js +4 -4
- package/node_modules/@dcode/tui/dist/app-shiki-diff-view.d.ts +18 -1
- package/node_modules/@dcode/tui/dist/app-shiki-diff-view.js +3 -3
- package/node_modules/@dcode/tui/dist/app-shiki-highlighter.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/app-shiki-highlighter.js +7 -2
- package/node_modules/@dcode/tui/dist/app-sidebar-layout.d.ts +10 -0
- package/node_modules/@dcode/tui/dist/app-sidebar-layout.js +4 -4
- package/node_modules/@dcode/tui/dist/app-submit.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-submit.js +1 -1
- package/node_modules/@dcode/tui/dist/app-thought-components.d.ts +7 -0
- package/node_modules/@dcode/tui/dist/app-thought-components.js +2 -2
- package/node_modules/@dcode/tui/dist/app-tool-transcript.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-tool-transcript.js +3 -0
- package/node_modules/@dcode/tui/dist/app-view.d.ts +27 -0
- package/node_modules/@dcode/tui/dist/app-view.js +1 -1
- package/node_modules/@dcode/tui/dist/app-workflow-card.js +1 -1
- package/node_modules/@dcode/tui/dist/app-workflow-seed.d.ts +18 -1
- package/node_modules/@dcode/tui/dist/app-workflow-seed.js +4 -4
- package/node_modules/@dcode/tui/dist/index.js +5118 -2579
- package/node_modules/@dcode/tui/dist/tui.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/tui.js +1 -1
- package/node_modules/@dcode/tui/dist/types.d.ts +1 -1
- package/node_modules/oniguruma-parser/LICENSE +1 -1
- package/node_modules/oniguruma-parser/README.md +15 -61
- package/node_modules/oniguruma-parser/dist/oniguruma-parser.min.js +4 -4
- package/node_modules/oniguruma-parser/dist/parser/parse.js +1 -1
- package/node_modules/oniguruma-parser/dist/traverser/traverse.js +1 -1
- package/node_modules/oniguruma-parser/package.json +5 -5
- package/node_modules/oniguruma-to-es/dist/cjs/generate.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/cjs/index.js +121 -120
- package/node_modules/oniguruma-to-es/dist/cjs/subclass.d.ts +2 -2
- package/node_modules/oniguruma-to-es/dist/cjs/transform.d.ts +3 -5
- package/node_modules/oniguruma-to-es/dist/cjs/unicode.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/esm/generate.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/esm/index.js +1 -3
- package/node_modules/oniguruma-to-es/dist/esm/subclass.d.ts +2 -2
- package/node_modules/oniguruma-to-es/dist/esm/transform.d.ts +3 -5
- package/node_modules/oniguruma-to-es/dist/esm/unicode.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/index.min.js +6 -6
- package/node_modules/oniguruma-to-es/package.json +5 -5
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Worked dynamic-workflow examples
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Seven complete scripts, end to end. Each is a whole arc — world read, topology, loop or
|
|
4
4
|
fan-out, salvage, artifacts, return shape — so read one when you want to see how the pieces
|
|
5
5
|
sit together rather than looking up a single shape (`patterns.md` is for that).
|
|
6
6
|
|
|
@@ -258,6 +258,7 @@ if (scan.findings.length === 0) {
|
|
|
258
258
|
// candidate is confirmed the moment its judge rules, not after every judge has. What the
|
|
259
259
|
// confirmer cannot reproduce is kept and labelled, not dropped.
|
|
260
260
|
phase("Judge each candidate and confirm the real ones as they are judged");
|
|
261
|
+
// One join: the planner below needs every real finding before it can plan.
|
|
261
262
|
const outcomes = await Promise.all(
|
|
262
263
|
scan.findings.map(async (finding): Promise<ReportedFinding | undefined> => {
|
|
263
264
|
const judgement = await agent(`judge-${finding.testId}`).ask<Judgement>(
|
|
@@ -428,6 +429,7 @@ const MIGRATOR = {
|
|
|
428
429
|
// One migrator per file: the edits are disjoint, so they can run at once, and a fresh
|
|
429
430
|
// context per file keeps one file's oddities from leaking into another's rewrite.
|
|
430
431
|
phase("Migrate each file and verify the result");
|
|
432
|
+
// One join: the whole-tree suite below needs every file migrated first.
|
|
431
433
|
const results = await Promise.all(
|
|
432
434
|
paths.map(async (path) => {
|
|
433
435
|
try {
|
|
@@ -799,3 +801,310 @@ reviewer, and they start the moment their file's triage is done: with twelve fil
|
|
|
799
801
|
slow reviewer, eleven files' findings are confirmed and reported while it is still reading.
|
|
800
802
|
Nothing gets a second reader on top: each finding was confirmed, and the editor's job is
|
|
801
803
|
merging and writing up, not re-checking.
|
|
804
|
+
|
|
805
|
+
## 6. Fact-finding pipeline with a fresh verifier per fact
|
|
806
|
+
|
|
807
|
+
Research a topic from five angles at once, check every fact as it arrives with a verifier
|
|
808
|
+
that did not do the research, then write the report from the facts that held. The hand-off
|
|
809
|
+
from research to verification is a channel, so the first verifier starts while four
|
|
810
|
+
researchers are still reading; the writer sits after the one join, because it needs every
|
|
811
|
+
verified fact.
|
|
812
|
+
|
|
813
|
+
<!-- compile -->
|
|
814
|
+
```ts
|
|
815
|
+
interface Fact {
|
|
816
|
+
/** Stable id built from the angle and a sequence number: "tests-3". */
|
|
817
|
+
id: string;
|
|
818
|
+
/** One sentence that can be checked against the repository. */
|
|
819
|
+
claim: string;
|
|
820
|
+
/** Where the researcher saw it: a path with a line, or a command and its output. */
|
|
821
|
+
source: string;
|
|
822
|
+
/** The research angle it came from. */
|
|
823
|
+
angle: string;
|
|
824
|
+
}
|
|
825
|
+
interface Research {
|
|
826
|
+
facts: { claim: string; source: string }[];
|
|
827
|
+
}
|
|
828
|
+
interface Verdict {
|
|
829
|
+
/** True only when you confirmed the claim yourself from the source given. */
|
|
830
|
+
holds: boolean;
|
|
831
|
+
/** What you did to check, one sentence. */
|
|
832
|
+
note: string;
|
|
833
|
+
}
|
|
834
|
+
interface Finding {
|
|
835
|
+
/** Where the fact lives: the source the verifier confirmed. */
|
|
836
|
+
where: string;
|
|
837
|
+
/** The fact, one sentence. */
|
|
838
|
+
what: string;
|
|
839
|
+
/** How the verifier confirmed it. */
|
|
840
|
+
evidence: string;
|
|
841
|
+
/** Every finding here was confirmed by a verifier that did not do the research. */
|
|
842
|
+
status: "verified";
|
|
843
|
+
}
|
|
844
|
+
interface Draft {
|
|
845
|
+
/** The report in markdown, for the user. */
|
|
846
|
+
markdown: string;
|
|
847
|
+
/** Two or three sentences a reader can act on. */
|
|
848
|
+
summary: string;
|
|
849
|
+
}
|
|
850
|
+
interface WorkflowReport {
|
|
851
|
+
/** Two or three sentences answering what the user asked for. */
|
|
852
|
+
conclusion: string;
|
|
853
|
+
findings: Finding[];
|
|
854
|
+
/** What the run checked and how. */
|
|
855
|
+
verified: string[];
|
|
856
|
+
/** What the run did not look at or could not check, and why. */
|
|
857
|
+
notCovered: string[];
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const topic = String(args.topic ?? "this repository");
|
|
861
|
+
const angles = ["architecture", "data flow", "error handling", "tests", "history"];
|
|
862
|
+
|
|
863
|
+
// The hand-off between research and verification: a researcher that is still reading keeps
|
|
864
|
+
// sending while verifiers already work on what has landed. The research stage owns the close.
|
|
865
|
+
const facts = channel<Fact>("facts");
|
|
866
|
+
const passed: Finding[] = [];
|
|
867
|
+
const rejected: string[] = [];
|
|
868
|
+
|
|
869
|
+
const research = future(async () => {
|
|
870
|
+
phase("Research the topic from five angles");
|
|
871
|
+
try {
|
|
872
|
+
await Promise.all(
|
|
873
|
+
angles.map(async (angle) => {
|
|
874
|
+
const found = await agent(
|
|
875
|
+
`researcher-${angle}`,
|
|
876
|
+
"You research a codebase and state only what you saw, each fact with the place you saw it.",
|
|
877
|
+
).ask<Research>(
|
|
878
|
+
`Research ${topic} from the angle of ${angle}. Return up to eight facts, each with its source.`,
|
|
879
|
+
);
|
|
880
|
+
found.facts.forEach((fact, index) => facts.send({ ...fact, id: `${angle}-${index + 1}`, angle }));
|
|
881
|
+
log(`${angle}: ${found.facts.length} facts found`);
|
|
882
|
+
}),
|
|
883
|
+
);
|
|
884
|
+
} finally {
|
|
885
|
+
facts.close(); // a failed researcher still ends the stream for the verifiers
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
const verify = future(async () => {
|
|
890
|
+
phase("Check each fact as it arrives");
|
|
891
|
+
// A fresh verifier per fact, named after it: cache identity stays per fact on a revised
|
|
892
|
+
// run, and the name says which fact each card is about.
|
|
893
|
+
const checks: Promise<void>[] = [];
|
|
894
|
+
for await (const fact of facts) {
|
|
895
|
+
checks.push(
|
|
896
|
+
future(async () => {
|
|
897
|
+
const verdict = await agent(
|
|
898
|
+
`verifier-${fact.id}`,
|
|
899
|
+
"You check one claim about a codebase against its source. Do not edit any file.",
|
|
900
|
+
).ask<Verdict>(`Does this hold? Read the source yourself.\n${JSON.stringify(fact)}`);
|
|
901
|
+
if (verdict.holds) {
|
|
902
|
+
const finding: Finding = { where: fact.source, what: fact.claim, evidence: verdict.note, status: "verified" };
|
|
903
|
+
passed.push(finding);
|
|
904
|
+
report(finding); // published now, so it survives a later failure
|
|
905
|
+
} else {
|
|
906
|
+
rejected.push(`${fact.claim} (${verdict.note})`);
|
|
907
|
+
}
|
|
908
|
+
}),
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
// The join is what tells this stage it is done: without it the stage ends when the channel
|
|
912
|
+
// closes, with checks still running and half the results missing.
|
|
913
|
+
await Promise.all(checks);
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
// Start both, then join once. No await in between: while the script awaits one stage, a
|
|
917
|
+
// failure in the other has no listener and surfaces as an unhandled rejection instead of
|
|
918
|
+
// failing the run with its error.
|
|
919
|
+
await Promise.all([research, verify]);
|
|
920
|
+
log(`${passed.length} facts verified, ${rejected.length} did not hold`);
|
|
921
|
+
|
|
922
|
+
phase("Write the report from the verified facts");
|
|
923
|
+
const draft = await agent(
|
|
924
|
+
"writer",
|
|
925
|
+
"You write short technical reports for engineers from verified facts only.",
|
|
926
|
+
).ask<Draft>(`Write a report on ${topic} from these verified facts:\n${JSON.stringify(passed)}`);
|
|
927
|
+
await artifact.markdown("report", draft.markdown, { title: `What we know about ${topic}` });
|
|
928
|
+
|
|
929
|
+
const result: WorkflowReport = {
|
|
930
|
+
conclusion: draft.summary,
|
|
931
|
+
findings: passed,
|
|
932
|
+
verified: [`${passed.length} facts each re-checked against their source by a separate subagent`],
|
|
933
|
+
notCovered: rejected.length > 0 ? rejected.map((claim) => `did not hold on re-check: ${claim}`) : [],
|
|
934
|
+
};
|
|
935
|
+
return result;
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
Two stages as futures, one channel, one join. Each future opens with its own phase marker,
|
|
939
|
+
and stamping is lexical, so the two stages that run at the same time keep their own steps on
|
|
940
|
+
the timeline. The research stage owns `facts.close()` in a `finally`: a researcher that fails
|
|
941
|
+
still ends the stream, so the verifiers finish instead of parking on a channel nobody will
|
|
942
|
+
send to. The verifiers are fresh and named per fact rather than pooled, because the facts are
|
|
943
|
+
independent and a revised run should miss the cache for one changed fact, not for the whole
|
|
944
|
+
pool. The `checks` array is the part people forget: the verify stage is done when its
|
|
945
|
+
verifiers are, not when the channel closes, and the deadlock detector cannot catch a stage that
|
|
946
|
+
returns early with work still in flight.
|
|
947
|
+
|
|
948
|
+
---
|
|
949
|
+
|
|
950
|
+
## 7. Repository guide grown step by step through tail holes
|
|
951
|
+
|
|
952
|
+
The task — "write a guide to this repository" — has no workflow until the repository has
|
|
953
|
+
been looked at. So the script does the one thing it can plan, the survey, and ends in a tail
|
|
954
|
+
hole. Two fills later the run has six chapter writers, an independent reader, a reviser and a
|
|
955
|
+
published guide, none of which the seed script named. (`SKILL.md` §15.)
|
|
956
|
+
|
|
957
|
+
The seed script, submitted with `CreateWorkflow`:
|
|
958
|
+
|
|
959
|
+
<!-- compile -->
|
|
960
|
+
```ts
|
|
961
|
+
interface Dir {
|
|
962
|
+
/** Workspace-relative path of a top-level entry. */
|
|
963
|
+
path: string;
|
|
964
|
+
/** One sentence: what it is for. */
|
|
965
|
+
purpose: string;
|
|
966
|
+
}
|
|
967
|
+
interface Survey {
|
|
968
|
+
dirs: Dir[];
|
|
969
|
+
}
|
|
970
|
+
interface Chapter {
|
|
971
|
+
title: string;
|
|
972
|
+
/** Paths the chapter actually covers. */
|
|
973
|
+
covers: string[];
|
|
974
|
+
/** Body, Markdown, for a first-time reader. */
|
|
975
|
+
body: string;
|
|
976
|
+
}
|
|
977
|
+
interface Guide {
|
|
978
|
+
title: string;
|
|
979
|
+
chapters: Chapter[];
|
|
980
|
+
notCovered: string[];
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
phase("盘点仓库顶层目录");
|
|
984
|
+
const surveyor = agent("勘察员", "你快速摸清一个仓库的结构:实际查看目录和关键文件,如实汇报。");
|
|
985
|
+
const survey = await surveyor.ask<Survey>("列出顶层目录(跳过 .venv、.dcode 等产物),各用一句话说明作用。");
|
|
986
|
+
log(`盘点完成:${survey.dirs.length} 个条目`);
|
|
987
|
+
|
|
988
|
+
return await hole<Guide>(
|
|
989
|
+
"第1步:决定导览结构",
|
|
990
|
+
`盘点:\n${survey.dirs.map((d) => `- ${d.path}:${d.purpose}`).join("\n")}`,
|
|
991
|
+
);
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
The run reaches the hole and the notification carries the survey in the prompt. The first
|
|
995
|
+
fill (the statements only, sent as `script`) decides the chapters, fans out a writer per
|
|
996
|
+
directory and leaves the next hole:
|
|
997
|
+
|
|
998
|
+
```ts
|
|
999
|
+
phase("分章并行撰写初稿");
|
|
1000
|
+
// The critic in the next step reads every chapter at once, so this join waits for all.
|
|
1001
|
+
const drafts = await Promise.all(
|
|
1002
|
+
survey.dirs.map((d) =>
|
|
1003
|
+
agent(`写手·${d.path}`, "你只写自己打开核实过的内容。").ask<Chapter>(
|
|
1004
|
+
`写《仓库导览》的「${d.path}」一章(200–400 字 Markdown):${d.purpose}。covers 如实填写。`,
|
|
1005
|
+
),
|
|
1006
|
+
),
|
|
1007
|
+
);
|
|
1008
|
+
log(`${drafts.length} 章初稿完成`);
|
|
1009
|
+
return await hole<Guide>(
|
|
1010
|
+
"第2步:审读与交付",
|
|
1011
|
+
`${drafts.length} 章初稿已就绪:${drafts.map((d) => d.title).join("、")}`,
|
|
1012
|
+
);
|
|
1013
|
+
```
|
|
1014
|
+
|
|
1015
|
+
The second fill reads `drafts` from the enclosing scope, adds an independent read and a
|
|
1016
|
+
revision, publishes the guide and returns it, which closes the chain:
|
|
1017
|
+
|
|
1018
|
+
```ts
|
|
1019
|
+
phase("独立审读初稿");
|
|
1020
|
+
const critique = await agent("审读员", "你只依据文本挑毛病,不读仓库,不夸奖。").ask<string>(
|
|
1021
|
+
`逐章挑毛病:\n${drafts.map((d) => `## ${d.title}\n${d.body}`).join("\n\n")}`,
|
|
1022
|
+
);
|
|
1023
|
+
phase("按审读意见修订并交付");
|
|
1024
|
+
const chapters = await agent("修订编辑").ask<Chapter[]>(
|
|
1025
|
+
`按意见修订,保持章序:${critique}\n\n${JSON.stringify(drafts)}`,
|
|
1026
|
+
);
|
|
1027
|
+
const guide: Guide = { title: "仓库导览", chapters, notCovered: [".venv、.dcode 等产物目录未纳入"] };
|
|
1028
|
+
await artifact.markdown("guide", chapters.map((c) => `## ${c.title}\n\n${c.body}`).join("\n\n"), {
|
|
1029
|
+
title: guide.title,
|
|
1030
|
+
description: "按目录分章的仓库导览。",
|
|
1031
|
+
primary: true,
|
|
1032
|
+
});
|
|
1033
|
+
return guide;
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
After both fills the run's draft holds the effective script — the seed with each body spliced
|
|
1037
|
+
in as the last argument of its hole — which is what a resume replays and an amend revises:
|
|
1038
|
+
|
|
1039
|
+
<!-- compile -->
|
|
1040
|
+
```ts
|
|
1041
|
+
interface Dir {
|
|
1042
|
+
/** Workspace-relative path of a top-level entry. */
|
|
1043
|
+
path: string;
|
|
1044
|
+
/** One sentence: what it is for. */
|
|
1045
|
+
purpose: string;
|
|
1046
|
+
}
|
|
1047
|
+
interface Survey {
|
|
1048
|
+
dirs: Dir[];
|
|
1049
|
+
}
|
|
1050
|
+
interface Chapter {
|
|
1051
|
+
title: string;
|
|
1052
|
+
/** Paths the chapter actually covers. */
|
|
1053
|
+
covers: string[];
|
|
1054
|
+
/** Body, Markdown, for a first-time reader. */
|
|
1055
|
+
body: string;
|
|
1056
|
+
}
|
|
1057
|
+
interface Guide {
|
|
1058
|
+
title: string;
|
|
1059
|
+
chapters: Chapter[];
|
|
1060
|
+
notCovered: string[];
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
phase("盘点仓库顶层目录");
|
|
1064
|
+
const surveyor = agent("勘察员", "你快速摸清一个仓库的结构:实际查看目录和关键文件,如实汇报。");
|
|
1065
|
+
const survey = await surveyor.ask<Survey>("列出顶层目录(跳过 .venv、.dcode 等产物),各用一句话说明作用。");
|
|
1066
|
+
log(`盘点完成:${survey.dirs.length} 个条目`);
|
|
1067
|
+
|
|
1068
|
+
return await hole<Guide>(
|
|
1069
|
+
"第1步:决定导览结构",
|
|
1070
|
+
`盘点:\n${survey.dirs.map((d) => `- ${d.path}:${d.purpose}`).join("\n")}`, async () => {
|
|
1071
|
+
phase("分章并行撰写初稿");
|
|
1072
|
+
// The critic in the next step reads every chapter at once, so this join waits for all.
|
|
1073
|
+
const drafts = await Promise.all(
|
|
1074
|
+
survey.dirs.map((d) =>
|
|
1075
|
+
agent(`写手·${d.path}`, "你只写自己打开核实过的内容。").ask<Chapter>(
|
|
1076
|
+
`写《仓库导览》的「${d.path}」一章(200–400 字 Markdown):${d.purpose}。covers 如实填写。`,
|
|
1077
|
+
),
|
|
1078
|
+
),
|
|
1079
|
+
);
|
|
1080
|
+
log(`${drafts.length} 章初稿完成`);
|
|
1081
|
+
return await hole<Guide>(
|
|
1082
|
+
"第2步:审读与交付",
|
|
1083
|
+
`${drafts.length} 章初稿已就绪:${drafts.map((d) => d.title).join("、")}`, async () => {
|
|
1084
|
+
phase("独立审读初稿");
|
|
1085
|
+
const critique = await agent("审读员", "你只依据文本挑毛病,不读仓库,不夸奖。").ask<string>(
|
|
1086
|
+
`逐章挑毛病:\n${drafts.map((d) => `## ${d.title}\n${d.body}`).join("\n\n")}`,
|
|
1087
|
+
);
|
|
1088
|
+
phase("按审读意见修订并交付");
|
|
1089
|
+
const chapters = await agent("修订编辑").ask<Chapter[]>(
|
|
1090
|
+
`按意见修订,保持章序:${critique}\n\n${JSON.stringify(drafts)}`,
|
|
1091
|
+
);
|
|
1092
|
+
const guide: Guide = { title: "仓库导览", chapters, notCovered: [".venv、.dcode 等产物目录未纳入"] };
|
|
1093
|
+
await artifact.markdown("guide", chapters.map((c) => `## ${c.title}\n\n${c.body}`).join("\n\n"), {
|
|
1094
|
+
title: guide.title,
|
|
1095
|
+
description: "按目录分章的仓库导览。",
|
|
1096
|
+
primary: true,
|
|
1097
|
+
});
|
|
1098
|
+
return guide;
|
|
1099
|
+
},
|
|
1100
|
+
);
|
|
1101
|
+
},
|
|
1102
|
+
);
|
|
1103
|
+
```
|
|
1104
|
+
|
|
1105
|
+
What to notice: each step's hole has its own name, because a hole is a phase and two holes
|
|
1106
|
+
with one name would be one phase; the prompts carry only what the next author needs, since
|
|
1107
|
+
the bindings carry the data; and the chain closed at step two because the author decided it
|
|
1108
|
+
was done, not because anything ran out. The writers are named per directory inside the
|
|
1109
|
+
`map`, so a revised run that changes one directory's chapter misses the cache for that one
|
|
1110
|
+
writer only.
|