@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,44 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// actor 的 `sessionId`:持有这个子代理转录的那条会话(workflowRuns 归约的一条规则)
|
|
3
|
+
// ============================================================
|
|
4
|
+
// 住在归约主文件之外,与 workflow-runs-actor-status.ts 同一个理由(主文件的 max-lines 门),
|
|
5
|
+
// 也同一条纪律:纯函数、无时钟、无 I/O。
|
|
6
|
+
//
|
|
7
|
+
// 为什么 sessionId 会动(docs/dynamic-workflow/presentation.md「Subagent transcripts」):
|
|
8
|
+
// `actor-created` 给的是 run service 为本 run 铸的会话,而修订 run 里一个答案全部来自导入命中的
|
|
9
|
+
// 子代理从没建过这条会话——命中不建会话,那些交换只活在前驱的会话里。transcript 面板照
|
|
10
|
+
// `sessionId` 订阅,指向一条不存在的会话就只剩 error + retry;所以这个字段要跟着「转录此刻
|
|
11
|
+
// 在哪」走,而不是停在铸出来的那个 id 上。
|
|
12
|
+
import { boundedSessionId } from "./workflow-runs-entries.js";
|
|
13
|
+
/**
|
|
14
|
+
* 一条节点事件之后,它点名的子代理的 actor 表(没变即原引用)。
|
|
15
|
+
*
|
|
16
|
+
* 只有两种 ask 事件说「这个子代理的转录在哪条会话里」:
|
|
17
|
+
* - **缓存命中的结算**:载荷带 `sourceSessionId` 即答案读自前驱的那条会话(导入命中,或修订
|
|
18
|
+
* run resume 时对一条导入行的重放);不带即答案在本 run 里产生过,信封上的 `actorSessionId`
|
|
19
|
+
* (本 run 的会话)就是它;
|
|
20
|
+
* - **派发**:子代理开始 live 跑,本 run 的会话此刻已经建好——导入过前缀的已经播了种。
|
|
21
|
+
*
|
|
22
|
+
* 最后一条说了算。同一个子代理的 ask 按序结算,而导入分歧是单调的:导入命中在前、指向前驱的
|
|
23
|
+
* 会话;从第一次 live 派发起,本 run 的会话持有全部,抄进来的前缀也在里面。其余事件、没有
|
|
24
|
+
* actor ref 的事件(world-read)、两个 id 都读不出的老载荷、以及不在表上的子代理:一律不动。
|
|
25
|
+
*/
|
|
26
|
+
export function actorsWithTranscriptSession(actors, eventType, payload, actorRef, envelopeSessionId) {
|
|
27
|
+
if (actorRef === null)
|
|
28
|
+
return actors;
|
|
29
|
+
const sessionId = eventType === "node-settled" && payload.cached === true
|
|
30
|
+
? (boundedSessionId(payload.sourceSessionId) ?? boundedSessionId(envelopeSessionId))
|
|
31
|
+
: eventType === "node-dispatched"
|
|
32
|
+
? boundedSessionId(envelopeSessionId)
|
|
33
|
+
: undefined;
|
|
34
|
+
if (sessionId === undefined)
|
|
35
|
+
return actors;
|
|
36
|
+
const index = actors.findIndex((actor) => actor.siteId === actorRef.siteId && actor.ordinal === actorRef.ordinal);
|
|
37
|
+
// 没变的保持引用:键级增量按引用先判「这条变了吗」(workflow-runs-delta.ts)。
|
|
38
|
+
if (index < 0 || actors[index].sessionId === sessionId)
|
|
39
|
+
return actors;
|
|
40
|
+
const next = actors.slice();
|
|
41
|
+
next[index] = { ...actors[index], sessionId };
|
|
42
|
+
return next;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=workflow-runs-actor-session.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WorkflowRunState } from "./workflow-runs.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 三态推导(docs/dynamic-workflow/concurrency.md「Protocol state」):
|
|
4
4
|
* running 有节点在 executing / repairing / nudged(模型请求已发出、正在跑)
|
|
5
5
|
* waiting 有 live 节点(queued / dispatched / waiting),或尚无任何节点且 run 未终态
|
|
6
6
|
* completed 其余:全部节点已结算,或 run 已终态(终态压过一切:一个终态 run 里没有任何人
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// actor 三态的**派生**(workflowRuns 归约的一条规则)
|
|
3
3
|
// ============================================================
|
|
4
|
-
//
|
|
4
|
+
// 住在归约主文件之外,与 workflow-runs-concurrency.ts / -phases.ts / -started.ts / -caps.ts
|
|
5
|
+
// 同一个理由(主文件的 max-lines 门),也同一条纪律:纯函数、无时钟、无 I/O。
|
|
5
6
|
//
|
|
6
7
|
// 为什么必须派生:引擎的 Boundary C 除了 `actor-created` 之外**不发任何 actor 生命周期事件**,
|
|
7
8
|
// 所以「这个子代理在动吗、在等吗、干完了吗」没有事件可搬,只能由它名下节点的相位与 run 的
|
|
@@ -15,7 +16,7 @@ function actorKey(siteId, ordinal) {
|
|
|
15
16
|
return `${siteId}\0${ordinal}`;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* 三态推导(docs/dynamic-workflow/concurrency.md「Protocol state」):
|
|
19
20
|
* running 有节点在 executing / repairing / nudged(模型请求已发出、正在跑)
|
|
20
21
|
* waiting 有 live 节点(queued / dispatched / waiting),或尚无任何节点且 run 未终态
|
|
21
22
|
* completed 其余:全部节点已结算,或 run 已终态(终态压过一切:一个终态 run 里没有任何人
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// 界留下的痕迹:被拒实例的计数器、整键的条目预算、以及读面唯一的步数读法
|
|
3
3
|
// ============================================================
|
|
4
|
-
//
|
|
4
|
+
// 住在归约主文件之外,与 workflow-runs-concurrency.ts / -phases.ts / -started.ts 同一个理由
|
|
5
|
+
// (主文件的 max-lines 门),也同一条纪律:纯函数、无时钟、无 I/O。
|
|
5
6
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
7
|
+
// 这三件事是同一件事的三面。触界的语义是**拒新**(已有条目照常更新),所以一个宽到撞界的 run
|
|
8
|
+
// 里总有些实例永远不在表上:
|
|
8
9
|
// - 计数器让它们**可数**——`truncated` 只说得出「有东西没进来」,说不出多少;
|
|
9
10
|
// - 条目预算让整个状态键**有界**——单条 run 的界乘以 maxRuns 离快照上限太近;
|
|
10
11
|
// - workflowRunStepCounts 是唯一允许的步数读法——表内 + 表外,读面三处(run 卡、时间线摘要、
|
|
11
|
-
// TUI
|
|
12
|
+
// TUI 镜像)曾经各数各的,于是同一条 run 在三个地方显示三个步数。
|
|
12
13
|
import { WORKFLOW_RUNS_LIMITS, } from "./workflow-runs.js";
|
|
13
14
|
/**
|
|
14
15
|
* 把一条**被拒**实例的事件记进 usage 的两个计数器。
|
|
@@ -2,41 +2,48 @@ import { type WorkflowRunState } from "./workflow-runs.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* `concurrency-changed` → `run.concurrency`。
|
|
4
4
|
*
|
|
5
|
-
* ceiling
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* `ceiling` 是默认并发 D(docs/dynamic-workflow/concurrency.md「Protocol state」):`run-started` 已把它
|
|
6
|
+
* 记在 `run.concurrencyCeiling` 上时一律取那一个。共享桶的自动增长可以到 2D、被抬高的 run 还能更高,
|
|
7
|
+
* 所以「见过的最大 previous / next」早已不是 D——它只是**老 CLI**(不发 `concurrencyCeiling`)时的
|
|
8
|
+
* 退路:那时桶从天花板起步、只降不升,最大值恰好就是天花板。`cooldownMs` 只在带 Retry-After 的
|
|
9
|
+
* 限流上在场;`idle_reset` 清掉它。`next` 读不动(缺席 / 非正整数)时整条只抬水位:没有 cap 就没有
|
|
10
|
+
* 可显示的东西。
|
|
9
11
|
*
|
|
10
12
|
* `limit` 照搬:它是本 run 自己的界(`run-started` 带来的),与共享桶的涨落无关——治理器压低
|
|
11
13
|
* 或放开一个 provider key,不会改变用户给这次 run 定的上限。
|
|
12
14
|
*/
|
|
13
15
|
export declare function reduceConcurrencyChanged(run: WorkflowRunState, payload: Record<string, unknown>): WorkflowRunState;
|
|
14
16
|
/**
|
|
15
|
-
* `run-started` → `run.concurrency.limit`:本 run
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* `run-started` → `run.concurrency.limit`:本 run **自己的**那条界
|
|
18
|
+
* (docs/dynamic-workflow/concurrency.md「Two bounds on a run」)。载荷带引擎的
|
|
19
|
+
* `caps.maxConcurrency` 与 CLI 在铸载荷那一刻算出的 `concurrencyCeiling`——默认并发 D(线上键名
|
|
20
|
+
* 早于「默认并发」这个概念,为兼容旧端保留)。D 是进程事实,不是引擎事实,所以它由 CLI 拼进
|
|
21
|
+
* 载荷,与 `resumedFrom` 同一先例。
|
|
18
22
|
*
|
|
19
|
-
* 只在 `maxConcurrency
|
|
20
|
-
*
|
|
23
|
+
* 只在 `maxConcurrency ≠ D` 时记——**高于或低于**都记:D 是起点不是上限,用户可以把一个 run 调得
|
|
24
|
+
* 比默认更并行。跑在默认上的 run 与从前逐字节相同,一个键都不多。老 CLI 不发 `concurrencyCeiling`,
|
|
25
|
+
* 读不出 D 就无从判断这个 run 有没有自己的界——什么都不改。
|
|
21
26
|
*
|
|
22
27
|
* 共享桶那一侧(`cap` / `key` / `cooldownMs`)原样留着:resume 会为同一个 runId 再发一条
|
|
23
|
-
* `run-started`,而那时进程里很可能已经学到了一个被限流压低的 cap
|
|
24
|
-
*
|
|
28
|
+
* `run-started`,而那时进程里很可能已经学到了一个被限流压低的 cap,用 D 把它盖掉就是把读数
|
|
29
|
+
* 抬回一个假值。
|
|
25
30
|
*/
|
|
26
31
|
export declare function reduceRunStartedConcurrency(run: WorkflowRunState, payload: Record<string, unknown>): WorkflowRunState;
|
|
27
32
|
/**
|
|
28
|
-
* `run-caps-changed` → `run.concurrency.limit`:run
|
|
33
|
+
* `run-caps-changed` → `run.concurrency.limit`:run **在飞时**它自己的那条界被改了
|
|
34
|
+
* (docs/dynamic-workflow/concurrency.md)。只改 `max_concurrency` 的修订就地生效——不停这次 run、
|
|
29
35
|
* 不另起一次——引擎改完 caps 发这条事件,载荷与 `run-started` 同形(引擎的 `caps.maxConcurrency`
|
|
30
|
-
* 加 CLI 拼进来的 `concurrencyCeiling
|
|
31
|
-
*
|
|
36
|
+
* 加 CLI 拼进来的 `concurrencyCeiling`,即默认并发 D)。所以这里与 `reduceRunStartedConcurrency`
|
|
37
|
+
* 读同两个字段、守同一条「只在 ≠ D 时记」:同一个数经两条路进来不能得出两份读数。
|
|
32
38
|
*
|
|
33
|
-
*
|
|
39
|
+
* D 按「载荷 → 本 run 已知值」取。它是进程事实、整条 run 恒定,`run-started` 已经把它记在
|
|
34
40
|
* `run.concurrencyCeiling` 上了,所以这条事件比 `run-started` 多一层退路;两个都没有才无从判断
|
|
35
|
-
*
|
|
41
|
+
* 这个数是不是默认,什么都不改。`caps` 读不动同理。
|
|
36
42
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
43
|
+
* 调回 D 要把 `limit` **摘掉**而不是写成 D:跑在默认上的 run 按协议没有自己的界。摘完若共享桶
|
|
44
|
+
* 那一侧也无话可说(cap 不低于 D、不在冷却——长到 D 之上的 cap 对一个默认 run 同样无话可说,
|
|
45
|
+
* 读数是 `min(cap, D)`),整个 `concurrency` 键随之缺席——与一个从没调过界的 run 逐字节相同。
|
|
46
|
+
* 本来就没有 `limit` 时一个字不动(幂等的支点)。
|
|
40
47
|
*/
|
|
41
48
|
export declare function reduceRunCapsChanged(run: WorkflowRunState, payload: Record<string, unknown>): WorkflowRunState;
|
|
42
49
|
/**
|
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
// `concurrency-changed` 的规则住在这里。与主归约同一条纪律:纯函数、无时钟——事件上的
|
|
6
6
|
// `cooldownMs` 是相对量,deadline 由 UI 按收到状态的时刻推算。
|
|
7
7
|
import { WORKFLOW_RUNS_LIMITS, } from "./workflow-runs.js";
|
|
8
|
-
/** 事件里的 `reason`
|
|
8
|
+
/** 事件里的 `reason` 值:桶空闲重置回默认并发——它不是冷却,收到即清掉旧的 cooldown。 */
|
|
9
9
|
const CONCURRENCY_IDLE_RESET_REASON = "idle_reset";
|
|
10
10
|
/**
|
|
11
11
|
* `concurrency-changed` → `run.concurrency`。
|
|
12
12
|
*
|
|
13
|
-
* ceiling
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* `ceiling` 是默认并发 D(docs/dynamic-workflow/concurrency.md「Protocol state」):`run-started` 已把它
|
|
14
|
+
* 记在 `run.concurrencyCeiling` 上时一律取那一个。共享桶的自动增长可以到 2D、被抬高的 run 还能更高,
|
|
15
|
+
* 所以「见过的最大 previous / next」早已不是 D——它只是**老 CLI**(不发 `concurrencyCeiling`)时的
|
|
16
|
+
* 退路:那时桶从天花板起步、只降不升,最大值恰好就是天花板。`cooldownMs` 只在带 Retry-After 的
|
|
17
|
+
* 限流上在场;`idle_reset` 清掉它。`next` 读不动(缺席 / 非正整数)时整条只抬水位:没有 cap 就没有
|
|
18
|
+
* 可显示的东西。
|
|
17
19
|
*
|
|
18
20
|
* `limit` 照搬:它是本 run 自己的界(`run-started` 带来的),与共享桶的涨落无关——治理器压低
|
|
19
21
|
* 或放开一个 provider key,不会改变用户给这次 run 定的上限。
|
|
@@ -23,7 +25,7 @@ export function reduceConcurrencyChanged(run, payload) {
|
|
|
23
25
|
if (next === undefined)
|
|
24
26
|
return run;
|
|
25
27
|
const previous = positiveInteger(payload.previous) ?? next;
|
|
26
|
-
const ceiling = Math.max(run.concurrency?.ceiling ?? 0, previous, next);
|
|
28
|
+
const ceiling = run.concurrencyCeiling ?? Math.max(run.concurrency?.ceiling ?? 0, previous, next);
|
|
27
29
|
const key = nonEmptyString(payload.key);
|
|
28
30
|
const limit = run.concurrency?.limit;
|
|
29
31
|
const cooldownMs = payload.reason === CONCURRENCY_IDLE_RESET_REASON
|
|
@@ -41,16 +43,19 @@ export function reduceConcurrencyChanged(run, payload) {
|
|
|
41
43
|
return { ...run, concurrency };
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
|
-
* `run-started` → `run.concurrency.limit`:本 run
|
|
45
|
-
*
|
|
46
|
-
*
|
|
46
|
+
* `run-started` → `run.concurrency.limit`:本 run **自己的**那条界
|
|
47
|
+
* (docs/dynamic-workflow/concurrency.md「Two bounds on a run」)。载荷带引擎的
|
|
48
|
+
* `caps.maxConcurrency` 与 CLI 在铸载荷那一刻算出的 `concurrencyCeiling`——默认并发 D(线上键名
|
|
49
|
+
* 早于「默认并发」这个概念,为兼容旧端保留)。D 是进程事实,不是引擎事实,所以它由 CLI 拼进
|
|
50
|
+
* 载荷,与 `resumedFrom` 同一先例。
|
|
47
51
|
*
|
|
48
|
-
* 只在 `maxConcurrency
|
|
49
|
-
*
|
|
52
|
+
* 只在 `maxConcurrency ≠ D` 时记——**高于或低于**都记:D 是起点不是上限,用户可以把一个 run 调得
|
|
53
|
+
* 比默认更并行。跑在默认上的 run 与从前逐字节相同,一个键都不多。老 CLI 不发 `concurrencyCeiling`,
|
|
54
|
+
* 读不出 D 就无从判断这个 run 有没有自己的界——什么都不改。
|
|
50
55
|
*
|
|
51
56
|
* 共享桶那一侧(`cap` / `key` / `cooldownMs`)原样留着:resume 会为同一个 runId 再发一条
|
|
52
|
-
* `run-started`,而那时进程里很可能已经学到了一个被限流压低的 cap
|
|
53
|
-
*
|
|
57
|
+
* `run-started`,而那时进程里很可能已经学到了一个被限流压低的 cap,用 D 把它盖掉就是把读数
|
|
58
|
+
* 抬回一个假值。
|
|
54
59
|
*/
|
|
55
60
|
export function reduceRunStartedConcurrency(run, payload) {
|
|
56
61
|
const limit = positiveInteger(plainRecord(payload.caps)?.maxConcurrency);
|
|
@@ -58,36 +63,38 @@ export function reduceRunStartedConcurrency(run, payload) {
|
|
|
58
63
|
const ceiling = readCeiling !== undefined && readCeiling <= WORKFLOW_RUNS_LIMITS.maxConcurrencyCeiling
|
|
59
64
|
? readCeiling
|
|
60
65
|
: undefined;
|
|
61
|
-
//
|
|
62
|
-
//
|
|
66
|
+
// D 本身单独记一份(`run.concurrencyCeiling`):「配置」弹层要写「默认 N」、判「等于默认 = 不设
|
|
67
|
+
// 自己的界」,而跑在默认上的 run 没有 `concurrency` 可挂。读不出就沿用已知值——与 subagentModel
|
|
68
|
+
// 同一条退化规则。
|
|
63
69
|
const withCeiling = ceiling === undefined || run.concurrencyCeiling === ceiling
|
|
64
70
|
? run
|
|
65
71
|
: { ...run, concurrencyCeiling: ceiling };
|
|
66
|
-
if (limit === undefined || ceiling === undefined || limit
|
|
72
|
+
if (limit === undefined || ceiling === undefined || limit === ceiling)
|
|
67
73
|
return withCeiling;
|
|
68
74
|
const existing = withCeiling.concurrency;
|
|
69
75
|
const concurrency = {
|
|
70
|
-
// 没有共享桶读数时,cap
|
|
71
|
-
// 推导 ceiling 的那条依据)。
|
|
76
|
+
// 没有共享桶读数时,cap 从 D 起步——桶本来就是从那里开始的。
|
|
72
77
|
...(existing ?? { cap: ceiling }),
|
|
73
|
-
ceiling
|
|
78
|
+
ceiling,
|
|
74
79
|
limit,
|
|
75
80
|
};
|
|
76
81
|
return { ...withCeiling, concurrency };
|
|
77
82
|
}
|
|
78
83
|
/**
|
|
79
|
-
* `run-caps-changed` → `run.concurrency.limit`:run
|
|
84
|
+
* `run-caps-changed` → `run.concurrency.limit`:run **在飞时**它自己的那条界被改了
|
|
85
|
+
* (docs/dynamic-workflow/concurrency.md)。只改 `max_concurrency` 的修订就地生效——不停这次 run、
|
|
80
86
|
* 不另起一次——引擎改完 caps 发这条事件,载荷与 `run-started` 同形(引擎的 `caps.maxConcurrency`
|
|
81
|
-
* 加 CLI 拼进来的 `concurrencyCeiling
|
|
82
|
-
*
|
|
87
|
+
* 加 CLI 拼进来的 `concurrencyCeiling`,即默认并发 D)。所以这里与 `reduceRunStartedConcurrency`
|
|
88
|
+
* 读同两个字段、守同一条「只在 ≠ D 时记」:同一个数经两条路进来不能得出两份读数。
|
|
83
89
|
*
|
|
84
|
-
*
|
|
90
|
+
* D 按「载荷 → 本 run 已知值」取。它是进程事实、整条 run 恒定,`run-started` 已经把它记在
|
|
85
91
|
* `run.concurrencyCeiling` 上了,所以这条事件比 `run-started` 多一层退路;两个都没有才无从判断
|
|
86
|
-
*
|
|
92
|
+
* 这个数是不是默认,什么都不改。`caps` 读不动同理。
|
|
87
93
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
94
|
+
* 调回 D 要把 `limit` **摘掉**而不是写成 D:跑在默认上的 run 按协议没有自己的界。摘完若共享桶
|
|
95
|
+
* 那一侧也无话可说(cap 不低于 D、不在冷却——长到 D 之上的 cap 对一个默认 run 同样无话可说,
|
|
96
|
+
* 读数是 `min(cap, D)`),整个 `concurrency` 键随之缺席——与一个从没调过界的 run 逐字节相同。
|
|
97
|
+
* 本来就没有 `limit` 时一个字不动(幂等的支点)。
|
|
91
98
|
*/
|
|
92
99
|
export function reduceRunCapsChanged(run, payload) {
|
|
93
100
|
const maxConcurrency = positiveInteger(plainRecord(payload.caps)?.maxConcurrency);
|
|
@@ -102,23 +109,24 @@ export function reduceRunCapsChanged(run, payload) {
|
|
|
102
109
|
if (maxConcurrency === undefined || ceiling === undefined)
|
|
103
110
|
return withCeiling;
|
|
104
111
|
const existing = withCeiling.concurrency;
|
|
105
|
-
if (maxConcurrency
|
|
112
|
+
if (maxConcurrency !== ceiling) {
|
|
106
113
|
const concurrency = {
|
|
107
|
-
// 没有共享桶读数时 cap
|
|
114
|
+
// 没有共享桶读数时 cap 从 D 起步——与 reduceRunStartedConcurrency 同一条依据。
|
|
108
115
|
...(existing ?? { cap: ceiling }),
|
|
109
|
-
ceiling
|
|
116
|
+
ceiling,
|
|
110
117
|
limit: maxConcurrency,
|
|
111
118
|
};
|
|
112
119
|
return { ...withCeiling, concurrency };
|
|
113
120
|
}
|
|
114
121
|
if (existing?.limit === undefined)
|
|
115
122
|
return withCeiling;
|
|
116
|
-
const { limit: _lifted, ...
|
|
123
|
+
const { limit: _lifted, ...rest } = existing;
|
|
124
|
+
const shared = { ...rest, ceiling };
|
|
117
125
|
return shared.cooldownMs === undefined && shared.cap >= shared.ceiling
|
|
118
126
|
? withoutConcurrency(withCeiling)
|
|
119
127
|
: { ...withCeiling, concurrency: shared };
|
|
120
128
|
}
|
|
121
|
-
/** 摘掉整个 `concurrency`
|
|
129
|
+
/** 摘掉整个 `concurrency` 键(不是留一个空对象):协议上「跑在默认上、无话可说」就是这个键不在。 */
|
|
122
130
|
function withoutConcurrency(run) {
|
|
123
131
|
const { concurrency: _cleared, ...rest } = run;
|
|
124
132
|
return rest;
|
|
@@ -62,15 +62,16 @@ export declare function applyWorkflowRunRemoved(state: WorkflowRunsState | undef
|
|
|
62
62
|
* 每次淘汰都让出一个位子,一个够宽的 flush 窗口里被删掉的不同键因此可以多于 1024 条。
|
|
63
63
|
* 淘汰之前这不可能:表只增不减,一世之内被碰过的不同键最多就是表界那么多。
|
|
64
64
|
*
|
|
65
|
-
*
|
|
65
|
+
* 超界的载荷不会被剥掉一个键,它让整个 patch 解析失败、整帧被丢、那条订阅从此静默
|
|
66
|
+
* (workflow-runs.ts 记的那次事故的形状),而 publisher 的两道兜底(500 op / 1 MiB)在这个
|
|
66
67
|
* 量级上都不会响。四张表都查是因为这道闸很便宜,而且不该依赖上面那条论证一直成立。
|
|
67
68
|
*
|
|
68
69
|
* 合并是**优化**,所以拒绝合并永远是安全的:两条 op 各自都在界内,逐条投递的终态一个字节都不差。
|
|
69
70
|
*/
|
|
70
71
|
export declare function workflowRunUpdateWithinWireBounds(delta: WorkflowRunUpdatedDelta, limits?: WorkflowRunWireBounds): boolean;
|
|
71
72
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
73
|
+
* 条目表的线上界。只为测试留的注入口(默认就是 {@link WORKFLOW_RUNS_LIMITS}):真界是 1024,
|
|
74
|
+
* 而「合并被拒」这条路径在小界下才走得到,property 测试需要它真的被走到。
|
|
74
75
|
*/
|
|
75
76
|
export interface WorkflowRunWireBounds {
|
|
76
77
|
readonly maxActors: number;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// diff 的第一道闸是引用比较,深比较只发生在真正动过的那条 run 上。
|
|
15
15
|
// 3. 正确性绝不依赖引用:引用相等只是快路径,不等时一律退回结构比较。
|
|
16
16
|
//
|
|
17
|
-
//
|
|
17
|
+
// 契约(被 property 测试钉住):对任意一对 reducer 产出的 (prior, next),
|
|
18
18
|
// `JSON.stringify(applyAll(带 prior 的快照, diff(prior, next)).workflowRuns) === JSON.stringify(next)`
|
|
19
19
|
// ——**逐字节**,不只是深相等。键序因此是本模块的一等公民,见 {@link canonicalWorkflowRun}。
|
|
20
20
|
import { WORKFLOW_RUNS_LIMITS, workflowRunSchema, } from "./workflow-runs.js";
|
|
@@ -26,7 +26,7 @@ import { WORKFLOW_RUNS_LIMITS, workflowRunSchema, } from "./workflow-runs.js";
|
|
|
26
26
|
* 重建 run 时没有那段历史。两边各自按这张表重排一次,序就对齐了——这也是为什么 reducer 的
|
|
27
27
|
* 出口同样要走一遍本函数(那是一处,不是两处)。
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* 从 schema 派生而不是手抄:手抄一份 run 字段表曾经酿成过事故(见 delta.ts 的 header 注释)。
|
|
30
30
|
*/
|
|
31
31
|
const WORKFLOW_RUN_KEYS = Object.keys(workflowRunSchema.shape);
|
|
32
32
|
const WORKFLOW_RUN_KEY_SET = new Set(WORKFLOW_RUN_KEYS);
|
|
@@ -378,7 +378,8 @@ function upsertWorkflowRunEntries(current, incoming) {
|
|
|
378
378
|
* 每次淘汰都让出一个位子,一个够宽的 flush 窗口里被删掉的不同键因此可以多于 1024 条。
|
|
379
379
|
* 淘汰之前这不可能:表只增不减,一世之内被碰过的不同键最多就是表界那么多。
|
|
380
380
|
*
|
|
381
|
-
*
|
|
381
|
+
* 超界的载荷不会被剥掉一个键,它让整个 patch 解析失败、整帧被丢、那条订阅从此静默
|
|
382
|
+
* (workflow-runs.ts 记的那次事故的形状),而 publisher 的两道兜底(500 op / 1 MiB)在这个
|
|
382
383
|
* 量级上都不会响。四张表都查是因为这道闸很便宜,而且不该依赖上面那条论证一直成立。
|
|
383
384
|
*
|
|
384
385
|
* 合并是**优化**,所以拒绝合并永远是安全的:两条 op 各自都在界内,逐条投递的终态一个字节都不差。
|
|
@@ -9,15 +9,25 @@ import { type WorkflowRunActor } from "./workflow-runs.js";
|
|
|
9
9
|
export declare function workflowActorEntry(ref: {
|
|
10
10
|
siteId: string;
|
|
11
11
|
ordinal: number;
|
|
12
|
-
}, name: unknown, phaseName: string | undefined, sessionId: string | undefined): WorkflowRunActor;
|
|
12
|
+
}, name: unknown, phaseName: string | undefined, sessionId: string | undefined, model: unknown): WorkflowRunActor;
|
|
13
13
|
/** 子代理展示名的线上界(见文件头那次订阅失效)。 */
|
|
14
14
|
export declare function boundedActorName(name: string | undefined): string | undefined;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* 实例出生阶段名的线上界(docs/dynamic-workflow/presentation.md)。与 {@link boundedActorName}
|
|
17
17
|
* 同族、同理由,但**直接截断、不加省略号**——这个字段不是给人读的文本而是一个关联键,
|
|
18
18
|
* UI 的 `phaseNameMatches` 正是按前缀把截断的名字关联回 display 阶段。
|
|
19
19
|
*/
|
|
20
20
|
export declare function boundedPhaseName(name: string | undefined): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* 会话 id 的线上读法:界内的非空串原样收下,其余一律当缺席。**不截断**——与子代理模型串同理,
|
|
23
|
+
* 一个被砍短的 id 指向的是另一条会话,宁可不认。
|
|
24
|
+
*/
|
|
25
|
+
export declare function boundedSessionId(value: unknown): string | undefined;
|
|
21
26
|
/** 空串按缺席处理:协议线上只有「键在场」与「键缺席」两态。 */
|
|
22
27
|
export declare function nonEmptyString(value: unknown): string | undefined;
|
|
28
|
+
/** 引擎的 `InstanceRef` / `ActorRef` 同构:站点 id × 序号。缺任一即无法定位,返回 null。 */
|
|
29
|
+
export declare function workflowInstanceRef(value: unknown): {
|
|
30
|
+
siteId: string;
|
|
31
|
+
ordinal: number;
|
|
32
|
+
} | null;
|
|
23
33
|
//# sourceMappingURL=workflow-runs-entries.d.ts.map
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// ============================================================
|
|
2
|
+
// 出生事实的读法:脚本作者写的那些字符串怎么按线上界落成一个 actor 条目
|
|
3
|
+
// ============================================================
|
|
4
|
+
// 从 workflow-runs-reducer.ts 拆出(主文件的 max-lines 门),与 -caps.ts / -eviction.ts /
|
|
5
|
+
// -started.ts 同一条先例,也同一条纪律:纯函数、无时钟、无 I/O。
|
|
3
6
|
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
7
|
+
// 这几个界不是展示预算而是**安全界**。名字与阶段名都是脚本作者任意拼出来的
|
|
8
|
+
// (`agent("reader-" + paths.join("+"))`、`phase("检查 " + file)`),而 CLI 不校验出站帧、
|
|
9
|
+
// 渲染端对每一帧做严格校验——2026-09-04 一个 131 字的子代理名让父会话在那个 actor 出现之后的
|
|
10
|
+
// 每一帧(online / recovery / initial 快照)全部被拒,订阅以 `fault.subscription.recoveryFailed`
|
|
11
|
+
// 永久失效。所以生产者按 schema 界裁剪,线上永远合法;完整值仍在 journal 里。
|
|
6
12
|
import { WORKFLOW_RUNS_LIMITS } from "./workflow-runs.js";
|
|
7
13
|
/**
|
|
8
14
|
* 一个 actor 条目的铸造。两处调用必须**逐字同形**:`actor-created`,以及带出生事实的
|
|
@@ -11,31 +17,63 @@ import { WORKFLOW_RUNS_LIMITS } from "./workflow-runs.js";
|
|
|
11
17
|
*
|
|
12
18
|
* `status` 落的是占位值:紧接着的 `withDerivedWorkflowActorStatuses` 会按节点与 run 终态重算。
|
|
13
19
|
*/
|
|
14
|
-
export function workflowActorEntry(ref, name, phaseName, sessionId) {
|
|
20
|
+
export function workflowActorEntry(ref, name, phaseName, sessionId, model) {
|
|
15
21
|
const bounded = boundedActorName(nonEmptyString(name));
|
|
22
|
+
const canonical = boundedActorModel(nonEmptyString(model));
|
|
16
23
|
return {
|
|
17
24
|
siteId: ref.siteId,
|
|
18
25
|
ordinal: ref.ordinal,
|
|
19
26
|
...(bounded === undefined ? {} : { name: bounded }),
|
|
20
27
|
...(sessionId ? { sessionId } : {}),
|
|
21
28
|
...(phaseName === undefined ? {} : { phaseName }),
|
|
29
|
+
...(canonical === undefined ? {} : { model: canonical }),
|
|
22
30
|
status: "waiting",
|
|
23
31
|
};
|
|
24
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* 子代理模型的线上界:超界**整个丢掉**而不截断——截断的规范串是另一个(不存在的)模型,
|
|
35
|
+
* 画出来就是一句假话;缺席只是退回「跑在 run 的子代理模型上」那一格。
|
|
36
|
+
*/
|
|
37
|
+
function boundedActorModel(model) {
|
|
38
|
+
return model === undefined || model.length > WORKFLOW_RUNS_LIMITS.maxSubagentModelLength
|
|
39
|
+
? undefined
|
|
40
|
+
: model;
|
|
41
|
+
}
|
|
25
42
|
/** 子代理展示名的线上界(见文件头那次订阅失效)。 */
|
|
26
43
|
export function boundedActorName(name) {
|
|
27
44
|
return name === undefined ? undefined : name.slice(0, WORKFLOW_RUNS_LIMITS.maxActorNameLength);
|
|
28
45
|
}
|
|
29
46
|
/**
|
|
30
|
-
*
|
|
47
|
+
* 实例出生阶段名的线上界(docs/dynamic-workflow/presentation.md)。与 {@link boundedActorName}
|
|
31
48
|
* 同族、同理由,但**直接截断、不加省略号**——这个字段不是给人读的文本而是一个关联键,
|
|
32
49
|
* UI 的 `phaseNameMatches` 正是按前缀把截断的名字关联回 display 阶段。
|
|
33
50
|
*/
|
|
34
51
|
export function boundedPhaseName(name) {
|
|
35
52
|
return name === undefined ? undefined : name.slice(0, WORKFLOW_RUNS_LIMITS.maxPhaseNameLength);
|
|
36
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* 会话 id 的线上读法:界内的非空串原样收下,其余一律当缺席。**不截断**——与子代理模型串同理,
|
|
56
|
+
* 一个被砍短的 id 指向的是另一条会话,宁可不认。
|
|
57
|
+
*/
|
|
58
|
+
export function boundedSessionId(value) {
|
|
59
|
+
const text = nonEmptyString(value);
|
|
60
|
+
return text !== undefined && text.length <= WORKFLOW_RUNS_LIMITS.maxSessionIdLength
|
|
61
|
+
? text
|
|
62
|
+
: undefined;
|
|
63
|
+
}
|
|
37
64
|
/** 空串按缺席处理:协议线上只有「键在场」与「键缺席」两态。 */
|
|
38
65
|
export function nonEmptyString(value) {
|
|
39
66
|
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
40
67
|
}
|
|
68
|
+
/** 引擎的 `InstanceRef` / `ActorRef` 同构:站点 id × 序号。缺任一即无法定位,返回 null。 */
|
|
69
|
+
export function workflowInstanceRef(value) {
|
|
70
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
71
|
+
return null;
|
|
72
|
+
const record = value;
|
|
73
|
+
const siteId = nonEmptyString(record.siteId);
|
|
74
|
+
const ordinal = record.ordinal;
|
|
75
|
+
if (siteId === undefined || typeof ordinal !== "number")
|
|
76
|
+
return null;
|
|
77
|
+
return { siteId, ordinal };
|
|
78
|
+
}
|
|
41
79
|
//# sourceMappingURL=workflow-runs-entries.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type WorkflowRunActor, type WorkflowRunNode, type WorkflowRunState } from "./workflow-runs.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* 归约要用到的三条条目界。本包的默认值就是 {@link WORKFLOW_RUNS_LIMITS};单独定义成接口是为了
|
|
4
|
+
* 让测试能注入小界——1024 条要三千多条事件才撞得到,而这里的规则与界的**大小**无关。
|
|
5
5
|
*/
|
|
6
6
|
export interface WorkflowRunEntryLimits {
|
|
7
7
|
readonly maxActors: number;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// 表满时腾位:谁可以让位、什么时候入座、以及被腾掉的东西怎么继续可数
|
|
3
3
|
// ============================================================
|
|
4
|
-
//
|
|
4
|
+
// 住在归约主文件之外,与 workflow-runs-caps.ts / -concurrency.ts / -phases.ts / -started.ts
|
|
5
|
+
// 同一个理由(主文件的 max-lines 门),也同一条纪律:纯函数、无时钟、无 I/O。格子表的加减法
|
|
6
|
+
// 在同族的 workflow-runs-unlisted.ts。
|
|
5
7
|
//
|
|
6
8
|
// 为什么要腾位。触界的老语义是**拒新**,而读面画的是「此刻哪些子代理在跑」——于是一个宽
|
|
7
9
|
// fan-out 的 run 跑过 1024 之后,新起的子代理一个都进不来,run 卡与站点花名册永远停在最早
|
|
8
10
|
// 那批**已经结束**的身上,恰好把这个特性存在的理由抹掉。腾位把它反过来:终态的条目让位。
|
|
9
11
|
//
|
|
10
|
-
//
|
|
12
|
+
// 只腾位还不够,2026-09-20 的事故(5 × 2000 个子代理、并发 13)说的正是剩下那一半:一个阶段
|
|
11
13
|
// 在头几秒里把**全部** actor-created 与**全部** node-queued 发完,头 1024 条还排着队就把两张表
|
|
12
14
|
// 塞满,一条终态都没有,于是后面 976 个连人带活全被拒;调度器随后按 FIFO 派活,从第 1025 个
|
|
13
15
|
// 开始每一个**正在跑**的子代理都不在表上。一个子代理变重要是在它**被派活**的那一刻,不是在
|
|
@@ -78,15 +80,19 @@ export function seatWorkflowNode(run, seat, limits = WORKFLOW_RUNS_LIMITS) {
|
|
|
78
80
|
if (seat.eventType === "node-dispatched" && seat.actor !== null && run.truncated === true) {
|
|
79
81
|
return activateInstance(run, seat.ref, seat.actor, limits);
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
if (
|
|
83
|
+
// B2:溢出过的 run 里,一条认不出主人的**出生**连位子都不该占——它画不出徽章(pill 按
|
|
84
|
+
// run.actors 过滤),而后面被派下去的活正需要那个位子。两条出生都算:`node-queued`,以及
|
|
85
|
+
// 重发了出生事实的缓存结算。后者放进来还会**卡死**:点名了 actor 的节点不是游离节点,而组是按
|
|
86
|
+
// 已列 actor 建的,于是它哪一类受害者都不是,永远淘汰不掉。游离节点(world-read)不在此列。
|
|
87
|
+
if (seat.born &&
|
|
88
|
+
run.truncated === true &&
|
|
86
89
|
seat.actorRef !== null &&
|
|
87
90
|
!run.actors.some((actor) => sameInstance(actor, seat.actorRef))) {
|
|
88
91
|
return { run, admitNew: false, activated: false };
|
|
89
92
|
}
|
|
93
|
+
// 出生即结算的缓存命中从不腾位(它没跑过,没有要展示的进行态);腾位只给活的新人。
|
|
94
|
+
if (seat.eventType !== "node-queued")
|
|
95
|
+
return { run, admitNew: byBirth, activated: false };
|
|
90
96
|
return {
|
|
91
97
|
run: withRoomForNode(run, seat.ref, seat.actorRef, limits),
|
|
92
98
|
admitNew: byBirth,
|
|
@@ -217,8 +223,9 @@ function pickGroupVictim(run, owner, allowZeroNode) {
|
|
|
217
223
|
groups.filter((group) => group.idle).at(-1) ??
|
|
218
224
|
// 零节点 actor 同理取最靠后的,而且是最后一档:它没有节点、没有分数、表里也没有历史,
|
|
219
225
|
// 淘汰它读者看不见任何损失,而它自己下一次被派活时会带着事实回来。少了这一档,一次
|
|
220
|
-
// resume 之后的宽 fan-out 会卡死——空表重开、前缀把 2000 个 actor
|
|
221
|
-
//
|
|
226
|
+
// resume 之后的宽 fan-out 会卡死——空表重开、前缀把 2000 个 actor 重新建出来,而它们的
|
|
227
|
+
// 第一问还没回来(老 journal 里命中缓存的结算又不带 actor),于是一张全是零节点 actor 的表
|
|
228
|
+
// 谁都淘汰不动,此后每一次派发都被拒。
|
|
222
229
|
(allowZeroNode ? groups.filter((group) => group.zeroNode).at(-1) : undefined));
|
|
223
230
|
}
|
|
224
231
|
function spareGroups(run, owner) {
|
|
@@ -299,7 +306,7 @@ function listedGroups(run) {
|
|
|
299
306
|
});
|
|
300
307
|
return groups;
|
|
301
308
|
}
|
|
302
|
-
/** 游离节点:没有 actor 的已列节点(world-read
|
|
309
|
+
/** 游离节点:没有 actor 的已列节点(world-read,或老 journal 的缓存命中)。只有已结算的才是候选。 */
|
|
303
310
|
function looseSettledNodes(run) {
|
|
304
311
|
const candidates = [];
|
|
305
312
|
run.nodes.forEach((node, index) => {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type WorkflowRunState } from "./workflow-runs.js";
|
|
2
|
+
/**
|
|
3
|
+
* 留白的站点 id:`hole#` 加 8 位十六进制,键是留白的**名字**,与嵌套深度无关(CLI 的
|
|
4
|
+
* analysis/hole-id.ts 铸造;apps/dcode-cli/packages/dynamic-workflow/docs/analysis.md「Sites」)。
|
|
5
|
+
* id 里不再写嵌套关系:一个留白在哪个留白里面,看它自己的阶段 / 站上的 `fill`。
|
|
6
|
+
*/
|
|
7
|
+
export declare const WORKFLOW_HOLE_SITE_ID_PATTERN: RegExp;
|
|
8
|
+
/**
|
|
9
|
+
* `run-launched.holes` / `hole-filled.holes` 的搬运:下标指向**被接受的**那张 `phaseNames`,所以
|
|
10
|
+
* 越界、非整数、重复一律丢——越界的下标会让侧栏把一盏虚线灯画到一个不存在的站上。一项都不剩时
|
|
11
|
+
* 返回 `undefined`:键不建。
|
|
12
|
+
*/
|
|
13
|
+
export declare function readPhaseHoles(raw: unknown, count: number): number[] | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* 载荷上的声明阶段表(`run-launched` 与 `hole-filled` 同形):按声明序、裁到与 `phases` 同一对界。
|
|
16
|
+
* 空表返回 `undefined`,调用方据此不动已有的表。
|
|
17
|
+
*/
|
|
18
|
+
export declare function readPhaseNames(raw: unknown): string[] | undefined;
|
|
19
|
+
export declare function reduceHoleReached(run: WorkflowRunState, payload: Record<string, unknown>): WorkflowRunState;
|
|
20
|
+
/**
|
|
21
|
+
* `hole-filled`:主代理的补全接进了 run。三件事一步做完——那条记录翻成 filled、阶段表换成补全后的
|
|
22
|
+
* 声明表(超集:留白的体在留白的位置展开)、留白下标表整张换新。「同时在跑」表按插入位置右移:
|
|
23
|
+
* 补全只在留白那一站之后插入 k 站,旧表里 > h 的下标一律 +k;表的形状对不上(不是这种插入)就丢掉,
|
|
24
|
+
* 宁可侧栏少画双线段,也不把它连到错的站上。
|
|
25
|
+
*/
|
|
26
|
+
export declare function reduceHoleFilled(run: WorkflowRunState, payload: Record<string, unknown>): WorkflowRunState;
|
|
27
|
+
/**
|
|
28
|
+
* 剥掉 waiting 记录(新的一世 / 终态):真相是进程内的停驻 deferred,与 pendingQuestions 同一条理由——
|
|
29
|
+
* 一个已停的 run 没有人在等补全;resume 重跑到那个站点会再发一条 `hole-reached`。filled 记录跨世保留:
|
|
30
|
+
* 那是接进 run 的代码,不是残影。一条不剩时整个键摘掉。
|
|
31
|
+
*/
|
|
32
|
+
export declare function withoutWaitingHoles(run: WorkflowRunState): WorkflowRunState;
|
|
33
|
+
//# sourceMappingURL=workflow-runs-holes.d.ts.map
|