@dipoleml/dcode-cli 1.0.0 → 1.2.0
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 +59155 -45279
- 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 +6544 -183
- 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 +759 -11
- 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 +378 -74
- 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 +3215 -1800
- 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 +388 -57
- 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 +208 -103
- 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 +7728 -1585
- 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 +22 -1
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.js +102 -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 +46 -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 +1542 -166
- package/node_modules/@dcode/shared/dist/validation.js +423 -14
- package/node_modules/@dcode/shared/dist/validationAppSettings.d.ts +70 -14
- 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 +5117 -2578
- 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
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// workflowRuns 归约的留白分支:`hole-reached` / `hole-filled`,以及阶段表上的留白下标
|
|
3
|
+
// ============================================================
|
|
4
|
+
// 从 workflow-runs-reducer.ts 拆出(max-lines 门,与 phases / started 同一先例)。
|
|
5
|
+
// 契约见 docs/dynamic-workflow/presentation.md「Holes on the timeline」的「The model」一段与
|
|
6
|
+
// apps/dcode-cli/packages/dynamic-workflow/docs/execution-engine.md「Holes」。
|
|
7
|
+
import { WORKFLOW_RUNS_LIMITS, } from "./workflow-runs.js";
|
|
8
|
+
import { boundedPhaseName, nonEmptyString } from "./workflow-runs-entries.js";
|
|
9
|
+
/**
|
|
10
|
+
* 留白的站点 id:`hole#` 加 8 位十六进制,键是留白的**名字**,与嵌套深度无关(CLI 的
|
|
11
|
+
* analysis/hole-id.ts 铸造;apps/dcode-cli/packages/dynamic-workflow/docs/analysis.md「Sites」)。
|
|
12
|
+
* id 里不再写嵌套关系:一个留白在哪个留白里面,看它自己的阶段 / 站上的 `fill`。
|
|
13
|
+
*/
|
|
14
|
+
export const WORKFLOW_HOLE_SITE_ID_PATTERN = /^hole#[0-9a-f]{8}$/u;
|
|
15
|
+
function readEpoch(value) {
|
|
16
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0
|
|
17
|
+
? Math.floor(value)
|
|
18
|
+
: undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* `run-launched.holes` / `hole-filled.holes` 的搬运:下标指向**被接受的**那张 `phaseNames`,所以
|
|
22
|
+
* 越界、非整数、重复一律丢——越界的下标会让侧栏把一盏虚线灯画到一个不存在的站上。一项都不剩时
|
|
23
|
+
* 返回 `undefined`:键不建。
|
|
24
|
+
*/
|
|
25
|
+
export function readPhaseHoles(raw, count) {
|
|
26
|
+
if (!Array.isArray(raw))
|
|
27
|
+
return undefined;
|
|
28
|
+
const out = [];
|
|
29
|
+
for (const value of raw) {
|
|
30
|
+
if (typeof value !== "number" || !Number.isInteger(value))
|
|
31
|
+
continue;
|
|
32
|
+
if (value < 0 || value >= count || out.includes(value))
|
|
33
|
+
continue;
|
|
34
|
+
out.push(value);
|
|
35
|
+
if (out.length >= WORKFLOW_RUNS_LIMITS.maxPhases)
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return out.length === 0 ? undefined : out;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 载荷上的声明阶段表(`run-launched` 与 `hole-filled` 同形):按声明序、裁到与 `phases` 同一对界。
|
|
42
|
+
* 空表返回 `undefined`,调用方据此不动已有的表。
|
|
43
|
+
*/
|
|
44
|
+
export function readPhaseNames(raw) {
|
|
45
|
+
if (!Array.isArray(raw))
|
|
46
|
+
return undefined;
|
|
47
|
+
const names = [];
|
|
48
|
+
for (const value of raw) {
|
|
49
|
+
if (typeof value !== "string")
|
|
50
|
+
continue;
|
|
51
|
+
const name = value.slice(0, WORKFLOW_RUNS_LIMITS.maxPhaseNameLength);
|
|
52
|
+
if (name.length === 0)
|
|
53
|
+
continue;
|
|
54
|
+
names.push(name);
|
|
55
|
+
if (names.length >= WORKFLOW_RUNS_LIMITS.maxPhases)
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return names.length === 0 ? undefined : names;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* `hole-reached`:run 走到一个开着的留白,那条分支停驻。按**站点 id** upsert——循环里同一站点会停驻
|
|
62
|
+
* 第二个 ordinal,表里只留最新的;重放同一条事件逐字节无变化(顶层的结构比对随即返回 null)。
|
|
63
|
+
* `name` 是这条记录存在的全部理由(每个面都按名字标它),缺席只抬水位。触界与 nodes / actors 同族:
|
|
64
|
+
* 拒绝新条目、已有条目照常更新、置 truncated。
|
|
65
|
+
*/
|
|
66
|
+
/** 提示语截到上限:超长时留 499 字加 `…`,总长仍是 500。 */
|
|
67
|
+
function boundedHolePrompt(raw) {
|
|
68
|
+
if (raw === undefined)
|
|
69
|
+
return undefined;
|
|
70
|
+
const max = WORKFLOW_RUNS_LIMITS.maxHolePromptLength;
|
|
71
|
+
return raw.length <= max ? raw : `${raw.slice(0, max - 1)}…`;
|
|
72
|
+
}
|
|
73
|
+
export function reduceHoleReached(run, payload) {
|
|
74
|
+
const instance = payload.instance;
|
|
75
|
+
if (typeof instance !== "object" || instance === null)
|
|
76
|
+
return run;
|
|
77
|
+
const siteId = nonEmptyString(instance.siteId);
|
|
78
|
+
const ordinalRaw = instance.ordinal;
|
|
79
|
+
const ordinal = typeof ordinalRaw === "number" && Number.isInteger(ordinalRaw) ? ordinalRaw : 0;
|
|
80
|
+
const name = boundedPhaseName(nonEmptyString(payload.name));
|
|
81
|
+
if (siteId === undefined || name === undefined)
|
|
82
|
+
return run;
|
|
83
|
+
const type = nonEmptyString(payload.type)?.slice(0, WORKFLOW_RUNS_LIMITS.maxHoleTypeLength);
|
|
84
|
+
const prompt = boundedHolePrompt(nonEmptyString(payload.prompt));
|
|
85
|
+
// 到达时刻只能由事件携带(本模块无时钟);两个键名都认:`reachedAt` 是通知载荷的词,`since` 是投影的词。
|
|
86
|
+
const since = readEpoch(payload.reachedAt) ?? readEpoch(payload.since);
|
|
87
|
+
const entry = {
|
|
88
|
+
siteId,
|
|
89
|
+
ordinal,
|
|
90
|
+
name,
|
|
91
|
+
...(type === undefined ? {} : { type }),
|
|
92
|
+
...(prompt === undefined ? {} : { prompt }),
|
|
93
|
+
state: "waiting",
|
|
94
|
+
...(since === undefined ? {} : { since }),
|
|
95
|
+
};
|
|
96
|
+
const existing = run.holes ?? [];
|
|
97
|
+
const index = existing.findIndex((hole) => hole.siteId === siteId);
|
|
98
|
+
if (index >= 0) {
|
|
99
|
+
// 已有记录(含补全过又被重新到达的——那是 resume 重放到一个还没补的站点):换成 waiting,
|
|
100
|
+
// 类型缺席时沿用记过的那个。
|
|
101
|
+
const previous = existing[index];
|
|
102
|
+
const merged = {
|
|
103
|
+
...entry,
|
|
104
|
+
...(entry.type === undefined && previous.type !== undefined ? { type: previous.type } : {}),
|
|
105
|
+
...(entry.prompt === undefined && previous.prompt !== undefined
|
|
106
|
+
? { prompt: previous.prompt }
|
|
107
|
+
: {}),
|
|
108
|
+
};
|
|
109
|
+
return { ...run, holes: existing.map((hole, i) => (i === index ? merged : hole)) };
|
|
110
|
+
}
|
|
111
|
+
if (existing.length >= WORKFLOW_RUNS_LIMITS.maxHoles)
|
|
112
|
+
return { ...run, truncated: true };
|
|
113
|
+
return { ...run, holes: [...existing, entry] };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* `hole-filled`:主代理的补全接进了 run。三件事一步做完——那条记录翻成 filled、阶段表换成补全后的
|
|
117
|
+
* 声明表(超集:留白的体在留白的位置展开)、留白下标表整张换新。「同时在跑」表按插入位置右移:
|
|
118
|
+
* 补全只在留白那一站之后插入 k 站,旧表里 > h 的下标一律 +k;表的形状对不上(不是这种插入)就丢掉,
|
|
119
|
+
* 宁可侧栏少画双线段,也不把它连到错的站上。
|
|
120
|
+
*/
|
|
121
|
+
export function reduceHoleFilled(run, payload) {
|
|
122
|
+
const siteId = nonEmptyString(payload.siteId);
|
|
123
|
+
if (siteId === undefined)
|
|
124
|
+
return run;
|
|
125
|
+
const filledAt = readEpoch(payload.filledAt);
|
|
126
|
+
const filledBy = nonEmptyString(payload.filledBy)?.slice(0, 128);
|
|
127
|
+
let next = run;
|
|
128
|
+
const existing = run.holes ?? [];
|
|
129
|
+
const index = existing.findIndex((hole) => hole.siteId === siteId);
|
|
130
|
+
if (index >= 0) {
|
|
131
|
+
// 提示语只为等待体而存在:补全后丢掉,已结算的 run 状态不背着它。
|
|
132
|
+
const { prompt: _prompt, ...reached } = existing[index];
|
|
133
|
+
void _prompt;
|
|
134
|
+
const filled = {
|
|
135
|
+
...reached,
|
|
136
|
+
state: "filled",
|
|
137
|
+
...(filledAt === undefined ? {} : { filledAt }),
|
|
138
|
+
...(filledBy === undefined ? {} : { filledBy }),
|
|
139
|
+
};
|
|
140
|
+
next = { ...next, holes: existing.map((hole, i) => (i === index ? filled : hole)) };
|
|
141
|
+
}
|
|
142
|
+
const phaseNames = readPhaseNames(payload.phaseNames);
|
|
143
|
+
if (phaseNames === undefined)
|
|
144
|
+
return next;
|
|
145
|
+
const phaseHoles = readPhaseHoles(payload.holes, phaseNames.length);
|
|
146
|
+
const phaseAlongside = shiftPhaseAlongside(run, phaseNames);
|
|
147
|
+
const { phaseAlongside: _stale, phaseHoles: _staleHoles, ...rest } = next;
|
|
148
|
+
void [_stale, _staleHoles];
|
|
149
|
+
return {
|
|
150
|
+
...rest,
|
|
151
|
+
phaseNames,
|
|
152
|
+
...(phaseAlongside === undefined ? {} : { phaseAlongside }),
|
|
153
|
+
...(phaseHoles === undefined ? {} : { phaseHoles }),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/** 旧表 + 「留白位置之后插入 k 站」 → 新表上的「同时在跑」下标;形状对不上返回 undefined。 */
|
|
157
|
+
function shiftPhaseAlongside(run, names) {
|
|
158
|
+
const old = run.phaseNames;
|
|
159
|
+
const alongside = run.phaseAlongside;
|
|
160
|
+
if (old === undefined || alongside === undefined)
|
|
161
|
+
return undefined;
|
|
162
|
+
const inserted = names.length - old.length;
|
|
163
|
+
if (inserted < 0)
|
|
164
|
+
return undefined;
|
|
165
|
+
// 找插入点 h:前缀 old[0..h] 与后缀 old[h+1..] 都逐字相同。
|
|
166
|
+
let h = -1;
|
|
167
|
+
for (let i = 0; i < old.length; i += 1) {
|
|
168
|
+
if (old[i] !== names[i])
|
|
169
|
+
break;
|
|
170
|
+
h = i;
|
|
171
|
+
}
|
|
172
|
+
if (h < 0)
|
|
173
|
+
return undefined;
|
|
174
|
+
for (let i = h + 1; i < old.length; i += 1) {
|
|
175
|
+
if (old[i] !== names[i + inserted])
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
const shift = (i) => (i <= h ? i : i + inserted);
|
|
179
|
+
const out = [];
|
|
180
|
+
for (let i = 0; i < names.length; i += 1) {
|
|
181
|
+
const source = i <= h ? i : i - inserted;
|
|
182
|
+
const entry = i > h && i <= h + inserted ? [] : (alongside[source] ?? []);
|
|
183
|
+
out.push(entry.map(shift));
|
|
184
|
+
}
|
|
185
|
+
return out.some((entry) => entry.length > 0) ? out : undefined;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* 剥掉 waiting 记录(新的一世 / 终态):真相是进程内的停驻 deferred,与 pendingQuestions 同一条理由——
|
|
189
|
+
* 一个已停的 run 没有人在等补全;resume 重跑到那个站点会再发一条 `hole-reached`。filled 记录跨世保留:
|
|
190
|
+
* 那是接进 run 的代码,不是残影。一条不剩时整个键摘掉。
|
|
191
|
+
*/
|
|
192
|
+
export function withoutWaitingHoles(run) {
|
|
193
|
+
if (run.holes === undefined)
|
|
194
|
+
return run;
|
|
195
|
+
const kept = run.holes.filter((hole) => hole.state === "filled");
|
|
196
|
+
if (kept.length === run.holes.length)
|
|
197
|
+
return run;
|
|
198
|
+
const { holes: _dropped, ...rest } = run;
|
|
199
|
+
void _dropped;
|
|
200
|
+
return kept.length === 0 ? rest : { ...rest, holes: kept };
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=workflow-runs-holes.js.map
|
|
@@ -3,7 +3,7 @@ import { type WorkflowRunsState } from "./workflow-runs.js";
|
|
|
3
3
|
* 按旧界裁剪;裁过的 run 置 `truncated: true`(读面据它显示「仅展示 N/M 步的详情」)。
|
|
4
4
|
*
|
|
5
5
|
* **不裁别的**:旧消费者认不出的新可选键是无害的(容器非 strict,多余的键被剥掉而已),
|
|
6
|
-
* 而为了"干净"
|
|
6
|
+
* 而为了"干净"去剥它们反而要维护第二份字段表——那正是 2026-09-04 事故的形状。
|
|
7
7
|
*
|
|
8
8
|
* 无需裁剪时返回**同一个对象**:这个函数在每次 flush 上都会跑一遍,白白造一份新状态会让
|
|
9
9
|
* 下游所有按引用 memo 的地方失效。
|
|
@@ -15,7 +15,7 @@ import { WORKFLOW_RUNS_LEGACY_LIMITS, } from "./workflow-runs.js";
|
|
|
15
15
|
* 按旧界裁剪;裁过的 run 置 `truncated: true`(读面据它显示「仅展示 N/M 步的详情」)。
|
|
16
16
|
*
|
|
17
17
|
* **不裁别的**:旧消费者认不出的新可选键是无害的(容器非 strict,多余的键被剥掉而已),
|
|
18
|
-
* 而为了"干净"
|
|
18
|
+
* 而为了"干净"去剥它们反而要维护第二份字段表——那正是 2026-09-04 事故的形状。
|
|
19
19
|
*
|
|
20
20
|
* 无需裁剪时返回**同一个对象**:这个函数在每次 flush 上都会跑一遍,白白造一份新状态会让
|
|
21
21
|
* 下游所有按引用 memo 的地方失效。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WORKFLOW_RUNS_LIMITS, } from "./workflow-runs.js";
|
|
2
|
+
import { readPhaseHoles } from "./workflow-runs-holes.js";
|
|
2
3
|
/**
|
|
3
4
|
* `phase-entered` 的归约:控制流经过了
|
|
4
5
|
* 一个 `phase("…")` 标记。住在 reducer 主文件之外与并发观察同一个理由——主文件的 max-lines 门。
|
|
@@ -34,7 +35,15 @@ export function reduceRunLaunched(run, payload) {
|
|
|
34
35
|
if (phaseNames.length === 0)
|
|
35
36
|
return run;
|
|
36
37
|
const phaseAlongside = readPhaseAlongside(payload.phaseAlongside, phaseNames.length);
|
|
37
|
-
|
|
38
|
+
// 留白下标表(docs/dynamic-workflow/presentation.md「Holes on the timeline」)与「同时在跑」表同一姿态:
|
|
39
|
+
// 搭声明表的车,下标按被接受的那张表裁。
|
|
40
|
+
const phaseHoles = readPhaseHoles(payload.holes, phaseNames.length);
|
|
41
|
+
return {
|
|
42
|
+
...run,
|
|
43
|
+
phaseNames,
|
|
44
|
+
...(phaseAlongside === undefined ? {} : { phaseAlongside }),
|
|
45
|
+
...(phaseHoles === undefined ? {} : { phaseHoles }),
|
|
46
|
+
};
|
|
38
47
|
}
|
|
39
48
|
/**
|
|
40
49
|
* 「同时在跑」表的搬运,只在 `phaseNames` 被接受之后调用。
|
|
@@ -24,7 +24,7 @@ export interface WorkflowRunProgressEnvelope {
|
|
|
24
24
|
* 内容逐字节相同。调用方据此决定不发 `state.updated` / 不刷 UI——revision 因此只在真有
|
|
25
25
|
* 变化时抬升(幂等重放不抬 revision)。
|
|
26
26
|
*
|
|
27
|
-
* `previous` 缺席等价于空态 `{ revision: 0, runs: [] }`。`limits`
|
|
27
|
+
* `previous` 缺席等价于空态 `{ revision: 0, runs: [] }`。`limits` 只为测试留的注入口,默认就是
|
|
28
28
|
* {@link WORKFLOW_RUNS_LIMITS}(生产上没有第二套界)。
|
|
29
29
|
*/
|
|
30
30
|
export declare function reduceWorkflowRunsState(previous: WorkflowRunsState | undefined, envelope: WorkflowRunProgressEnvelope, limits?: WorkflowRunEntryLimits): WorkflowRunsState | null;
|
|
@@ -18,22 +18,25 @@
|
|
|
18
18
|
// `executing` / `waiting` 是 driver 的观察:
|
|
19
19
|
// 模型请求真的发出去了 / 在等进程级槽位或退避;两者在 dispatched 之后来回切换。
|
|
20
20
|
// 2. resume 的完结命中短路**直接发 node-settled**,不经 node-queued(ask 在 scheduler.ts 的
|
|
21
|
-
// releaseCachedAsk / tryImportedSettle,world-read 在 engine-world.ts
|
|
22
|
-
//
|
|
23
|
-
//
|
|
21
|
+
// releaseCachedAsk / tryImportedSettle,world-read 在 engine-world.ts 的重放与导入命中)。
|
|
22
|
+
// ask 的那一条重发出生事实(kind / actor / actorSeq / instructionsHead),world-read 的不带,
|
|
23
|
+
// 更早的 journal 里的也不带——所以 node.kind 与 actor ref 是可缺省的,不是漏填。
|
|
24
|
+
// 3. run 级用量(docs/dynamic-workflow/authoring.md):`usage-updated` 直接携带已花 token 总量;
|
|
24
25
|
// `nodesUsed` 由 `node-dispatched` 的首次相位跃迁计数(同一实例重放不重复计数),
|
|
25
26
|
// 没有任何上限可供反算,也不需要。
|
|
26
27
|
import { WORKFLOW_RUNS_LIMITS, } from "./workflow-runs.js";
|
|
27
28
|
import { serializeWorkflowArtifact } from "./workflow-artifact.js";
|
|
29
|
+
import { actorsWithTranscriptSession } from "./workflow-runs-actor-session.js";
|
|
28
30
|
import { withDerivedWorkflowActorStatuses } from "./workflow-runs-actor-status.js";
|
|
29
31
|
import { countTaggedReport, upsertBoundedByArtifactId, workflowArtifactSummary, } from "./workflow-runs-artifacts.js";
|
|
30
32
|
import { countUnlistedInstance, discountUnlistedInstance, evictForEntryBudget, } from "./workflow-runs-caps.js";
|
|
31
33
|
import { absorbRefusedActor, absorbRefusedSettledNode, admitsNewEntry, seatWorkflowNode, withRoomForActor, } from "./workflow-runs-eviction.js";
|
|
32
34
|
import { reduceConcurrencyChanged, reduceRunCapsChanged, withoutCooldown, } from "./workflow-runs-concurrency.js";
|
|
33
|
-
import { boundedActorName, boundedPhaseName, nonEmptyString, workflowActorEntry, } from "./workflow-runs-entries.js";
|
|
35
|
+
import { boundedActorName, boundedPhaseName, nonEmptyString, workflowActorEntry, workflowInstanceRef, } from "./workflow-runs-entries.js";
|
|
34
36
|
import { canonicalWorkflowRun, workflowRunUnchanged } from "./workflow-runs-delta.js";
|
|
35
37
|
import { readRunIdField, readWorkflowRunStopReason } from "./workflow-runs-lineage.js";
|
|
36
38
|
import { carryNodeProgress, reduceNodeProgress } from "./workflow-runs-node-progress.js";
|
|
39
|
+
import { reduceHoleFilled, reduceHoleReached, withoutWaitingHoles } from "./workflow-runs-holes.js";
|
|
37
40
|
import { reducePhaseEntered, reduceRunLaunched } from "./workflow-runs-phases.js";
|
|
38
41
|
import { reduceRunStarted } from "./workflow-runs-started.js";
|
|
39
42
|
import { upsertBoundedByInstance, upsertBoundedByQid } from "./workflow-runs-tables.js";
|
|
@@ -57,7 +60,7 @@ const NODE_EVENT_PHASE = {
|
|
|
57
60
|
* 内容逐字节相同。调用方据此决定不发 `state.updated` / 不刷 UI——revision 因此只在真有
|
|
58
61
|
* 变化时抬升(幂等重放不抬 revision)。
|
|
59
62
|
*
|
|
60
|
-
* `previous` 缺席等价于空态 `{ revision: 0, runs: [] }`。`limits`
|
|
63
|
+
* `previous` 缺席等价于空态 `{ revision: 0, runs: [] }`。`limits` 只为测试留的注入口,默认就是
|
|
61
64
|
* {@link WORKFLOW_RUNS_LIMITS}(生产上没有第二套界)。
|
|
62
65
|
*/
|
|
63
66
|
export function reduceWorkflowRunsState(previous, envelope, limits = WORKFLOW_RUNS_LIMITS) {
|
|
@@ -124,10 +127,11 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
124
127
|
const ref = workflowInstanceRef(payload.actor);
|
|
125
128
|
if (!ref)
|
|
126
129
|
return run;
|
|
127
|
-
//
|
|
130
|
+
// 出生阶段(追记 2026-09-09):`actor-created` 是 actor 的出生事件,戳只在这里到,
|
|
128
131
|
// 没有后续事件可以携带或改写它。
|
|
129
132
|
const phaseName = boundedPhaseName(nonEmptyString(payload.phaseName));
|
|
130
|
-
const
|
|
133
|
+
const { actorSessionId } = derived;
|
|
134
|
+
const actor = workflowActorEntry(ref, payload.name, phaseName, actorSessionId, payload.model);
|
|
131
135
|
// 表满时给这个活的新人腾位(workflow-runs-eviction.ts);腾不出位就照旧拒新。
|
|
132
136
|
// 重放的事件既不腾位也不入座(后者只在**溢出过的** run 上收紧,见 admitsNewEntry)。
|
|
133
137
|
const seated = derived.advancesWaterMark ? withRoomForActor(run, ref, derived.limits) : run;
|
|
@@ -161,11 +165,12 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
161
165
|
// ——它早已计进 nodesUnlisted,再列一次就是既列又计。
|
|
162
166
|
const born = eventType === "node-queued" || (eventType === "node-settled" && payload.cached === true);
|
|
163
167
|
const actorRef = workflowInstanceRef(payload.actor);
|
|
164
|
-
// 带出生事实的 `node-dispatched
|
|
168
|
+
// 带出生事实的 `node-dispatched`(docs/dynamic-workflow/presentation.md「Reduction」的
|
|
169
|
+
// activation):引擎在派发那一刻重发这条实例的 `node-queued` 与它子代理的 `actor-created`
|
|
165
170
|
// 携带过的同一份事实,于是表外的实例可以在**被派活的那一刻**连人带活回到表上。
|
|
166
171
|
// 缺 actor ref 即老 journal 或 world-read 的裸派发,照旧处理。
|
|
167
172
|
const dispatchActor = eventType === "node-dispatched" && actorRef !== null
|
|
168
|
-
? workflowActorEntry(actorRef, payload.actorName, boundedPhaseName(nonEmptyString(payload.actorPhaseName)), derived.actorSessionId)
|
|
173
|
+
? workflowActorEntry(actorRef, payload.actorName, boundedPhaseName(nonEmptyString(payload.actorPhaseName)), derived.actorSessionId, payload.actorModel)
|
|
169
174
|
: null;
|
|
170
175
|
// 腾位、B2 的拒绝与 activation 三件事的唯一入口(workflow-runs-eviction.ts)。
|
|
171
176
|
const seating = seatWorkflowNode(run, {
|
|
@@ -211,7 +216,7 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
211
216
|
// dispatched 之后的相位,不再计数——归约必须幂等(顶层靠结构比对判「无变化」)。
|
|
212
217
|
// 触界被拒的实例查不到 previousNode,会照常计数:步数是 run 级事实,不受展示界约束。
|
|
213
218
|
// 也正因为它查不到 previousNode,相位这道去重对它无效——重放那条 dispatched 会把步数
|
|
214
|
-
//
|
|
219
|
+
// 越推越高(property 测试逮到的)。所以在**溢出过的** run 上这条计数与 nodesUnlisted 同规,
|
|
215
220
|
// 只认抬过水位的事件;界之下每条实例都有自己那行,相位去重够用,一个字节都不必变。
|
|
216
221
|
const firstDispatch = eventType === "node-dispatched" &&
|
|
217
222
|
admitsNewEntry(run, derived.advancesWaterMark) &&
|
|
@@ -233,6 +238,8 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
233
238
|
: seated;
|
|
234
239
|
return withDerivedWorkflowActorStatuses({
|
|
235
240
|
...absorbed,
|
|
241
|
+
// 转录在哪条会话里(workflow-runs-actor-session.ts):缓存命中的结算与派发各说一次。
|
|
242
|
+
actors: actorsWithTranscriptSession(absorbed.actors, eventType, payload, actorRef, derived.actorSessionId),
|
|
236
243
|
...(usage === seated.usage ? {} : { usage }),
|
|
237
244
|
nodes: upsertedNodes.list,
|
|
238
245
|
...(upsertedNodes.truncated || seated.truncated ? { truncated: true } : {}),
|
|
@@ -399,7 +406,8 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
399
406
|
case "concurrency-changed":
|
|
400
407
|
return reduceConcurrencyChanged(run, payload);
|
|
401
408
|
/**
|
|
402
|
-
* run-caps-changed:run **在飞时**它自己的那条并发界被改了(只改 `max_concurrency`
|
|
409
|
+
* run-caps-changed:run **在飞时**它自己的那条并发界被改了(只改 `max_concurrency` 的修订
|
|
410
|
+
* 就地生效,不停这次 run、不另起一次;docs/dynamic-workflow/concurrency.md)。载荷与
|
|
403
411
|
* `run-started` 同形,规则也是同一条,所以与它同住 workflow-runs-concurrency.ts。
|
|
404
412
|
* 同样不碰 `nodes[]` 与 actor 状态:界是闸门,不是任何节点的事。
|
|
405
413
|
*/
|
|
@@ -410,6 +418,14 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
410
418
|
return reducePhaseEntered(run, payload);
|
|
411
419
|
case "run-launched":
|
|
412
420
|
return reduceRunLaunched(run, payload);
|
|
421
|
+
/**
|
|
422
|
+
* hole-reached / hole-filled:留白的停驻与补全(docs/dynamic-workflow/presentation.md「Holes on the
|
|
423
|
+
* timeline」)。不碰 nodes / actors——留白没有节点行;规则在同族的 workflow-runs-holes.ts。
|
|
424
|
+
*/
|
|
425
|
+
case "hole-reached":
|
|
426
|
+
return reduceHoleReached(run, payload);
|
|
427
|
+
case "hole-filled":
|
|
428
|
+
return reduceHoleFilled(run, payload);
|
|
413
429
|
case "run-settled": {
|
|
414
430
|
const status = payload.status;
|
|
415
431
|
const error = isPlainRecord(payload.error) ? payload.error : undefined;
|
|
@@ -421,7 +437,8 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
421
437
|
// 若还挂着 pending,那也只是一条永远不会有下文的残影。
|
|
422
438
|
// 冷却是"新派发被冻结到何时",终态 run 不再派发任何东西——留着它只会让状态头显示一个
|
|
423
439
|
// 没有对象的倒计时。cap / ceiling 照留:它们是这次 run 跑在什么并发下的历史事实。
|
|
424
|
-
|
|
440
|
+
// 停驻中的留白与停驻问题同命:真相是进程内的 deferred,终态 run 没有人在等补全;补上了的照留。
|
|
441
|
+
const cleared = withoutWaitingHoles(withoutCooldown(withoutPendingQuestions(run, () => false)));
|
|
425
442
|
// actor 三态里 waiting / completed 的分界看 run 是否终态,所以终态要重新派生一遍:
|
|
426
443
|
// 一个建了却没被 ask 过的 actor 在 run 结束那一刻从「等待」变成「已完成」。
|
|
427
444
|
// 三终态词;`stopReason` 只在 stopped 时搬运,
|
|
@@ -454,16 +471,6 @@ function applyWorkflowRunEvent(base, eventType, payload, derived) {
|
|
|
454
471
|
return run;
|
|
455
472
|
}
|
|
456
473
|
}
|
|
457
|
-
/** 引擎的 `InstanceRef` / `ActorRef` 同构:站点 id × 序号。缺任一即无法定位,返回 null。 */
|
|
458
|
-
function workflowInstanceRef(value) {
|
|
459
|
-
if (!isPlainRecord(value))
|
|
460
|
-
return null;
|
|
461
|
-
const siteId = nonEmptyString(value.siteId);
|
|
462
|
-
const ordinal = value.ordinal;
|
|
463
|
-
if (siteId === undefined || typeof ordinal !== "number")
|
|
464
|
-
return null;
|
|
465
|
-
return { siteId, ordinal };
|
|
466
|
-
}
|
|
467
474
|
/**
|
|
468
475
|
* 按谓词保留停驻问题,并在**一条不剩时把整个键摘掉**(而不是留一个空数组)。
|
|
469
476
|
*
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
// 从 workflow-runs-reducer.ts 拆出(max-lines 门):主归约只剩 switch 的分派,与
|
|
5
5
|
// `concurrency-changed` / `phase-entered` 同一条先例。这条事件要说的事最多——resume 的
|
|
6
6
|
// 重臂语义、lineage 指针、本 run 自己的并发界——而三者彼此相关:同一个 runId 的第二条
|
|
7
|
-
// `run-started` 既要清掉上一世的结算残影,又不能把进程里已经学到的共享 cap
|
|
7
|
+
// `run-started` 既要清掉上一世的结算残影,又不能把进程里已经学到的共享 cap 抹回默认并发。
|
|
8
8
|
import { reduceRunStartedConcurrency } from "./workflow-runs-concurrency.js";
|
|
9
9
|
import { workflowRunTablesForNewLife } from "./workflow-runs-eviction.js";
|
|
10
|
+
import { withoutWaitingHoles } from "./workflow-runs-holes.js";
|
|
10
11
|
import { readRunIdField } from "./workflow-runs-lineage.js";
|
|
11
12
|
import { WORKFLOW_RUNS_LIMITS } from "./workflow-runs.js";
|
|
12
13
|
/**
|
|
@@ -60,8 +61,10 @@ export function reduceRunStarted(run, payload) {
|
|
|
60
61
|
// 这条事件到达。读不出就退回已知值——老 CLI 不发这个键,而把已经显示出来的模型抹掉是退化里
|
|
61
62
|
// 最坏的一种:run 看上去换了模型,其实只是少了一个字段。缺席即整个键不在(不是 undefined)。
|
|
62
63
|
const subagentModel = readSubagentModel(payload.subagentModel) ?? rebased.subagentModel;
|
|
64
|
+
// 停驻中的留白与停驻问题同属上一世的残影(workflow-runs-holes.ts):resume 重跑到那个站点会再发
|
|
65
|
+
// 一条 `hole-reached`;补上了的留白是接进 run 的代码,跨世保留。
|
|
63
66
|
return reduceRunStartedConcurrency({
|
|
64
|
-
...rebased,
|
|
67
|
+
...withoutWaitingHoles(rebased),
|
|
65
68
|
...(resumedFrom === undefined ? {} : { resumedFrom }),
|
|
66
69
|
...(subagentModel === undefined ? {} : { subagentModel }),
|
|
67
70
|
status: "running",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// workflowRuns 里几张**有界表**的 upsert 语义
|
|
3
3
|
// ============================================================
|
|
4
|
-
//
|
|
4
|
+
// 从 workflow-runs-reducer.ts 拆出(max-lines 门),与 -started.ts / -phases.ts / -eviction.ts
|
|
5
|
+
// 同一条先例,也同一条纪律:纯函数、无时钟、无 I/O。
|
|
5
6
|
//
|
|
6
7
|
// 这两个函数说的是同一句话的两半:一张表怎么认「这是同一条记录」,以及装不下时怎么办。
|
|
7
8
|
// 触界的语义是**拒新、仍更新已有**——把一个正在跑的实例的相位冻结在 "queued" 上,比少列一个
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// 表外条目的归属账:`unlistedByPhase` 的每一格怎么加、怎么减、什么时候整格消失
|
|
3
3
|
// ============================================================
|
|
4
|
-
//
|
|
4
|
+
// 从 workflow-runs-eviction.ts 拆出(主文件的 max-lines 门),也同一条纪律:纯函数、无时钟、
|
|
5
|
+
// 无 I/O。淘汰说的是「谁离开表」,这里说的是「离开之后它还怎么被数出来」。
|
|
5
6
|
//
|
|
6
|
-
//
|
|
7
|
+
// 读面是按**站**画的(docs/dynamic-workflow/presentation.md「Past six participants」):一个站点
|
|
7
8
|
// 的花名册、计数环和「N more」都得把自己那一格的表外条目加回去。run 级的两个计数器
|
|
8
9
|
// (workflow-runs-caps.ts)说得出一条 run 总共少列了多少,说不出少在哪一站——这张格子表就是
|
|
9
10
|
// 那个缺口。
|
|
@@ -18,7 +19,9 @@
|
|
|
18
19
|
//
|
|
19
20
|
// 每次改动之后整格夹到 `actorsFailed ≤ actorsSettled ≤ actors`,这是这一格的**法律**而不是
|
|
20
21
|
// 一道补丁:它正是让 `actorsSettled` 既能涨也能落的那条规则。它必须能落——一个子代理在它两次
|
|
21
|
-
// ask
|
|
22
|
+
// ask 之间看上去就是「已完成」,淘汰于是给它盖了个已结束的戳,而它的下一次派发又把它接回表上
|
|
23
|
+
// (曾经这里写着 actorsSettled「只增不减,因为已经结束的子代理不会再被派活回表」,那句话对
|
|
24
|
+
// 多次 ask 的子代理是错的)。可是这一格记不住**是谁**回来了,所以在 activation 那一刻去减
|
|
22
25
|
// `actorsSettled` 只能靠猜,而在宽 fan-out 里会猜得离谱:那个阶段有几百个子代理是**出生时**
|
|
23
26
|
// 就被拒的、根本没结算过,每一次回表都会去扣一笔不属于它的账。夹取只在一格拥挤时错,而且是
|
|
24
27
|
// 暂时的——回表的那个已完成子代理把自己的已结束标记留给同阶段另一个未列出的子代理,直到这一格
|