@dipoleml/dcode-cli 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +1081 -12
- package/dist/dcode.cjs +59368 -45608
- package/dist/packages/browser-use-plugin/README.md +12 -12
- package/dist/packages/browser-use-plugin/docs/api.json +1 -1
- package/dist/packages/browser-use-plugin/docs/overview.md +5 -4
- package/dist/packages/browser-use-plugin/docs/workflow.md +1 -1
- package/dist/packages/browser-use-plugin/scripts/build.mjs +1 -0
- package/dist/packages/browser-use-plugin/skills/control-browser/SKILL.md +10 -7
- package/dist/packages/bundled-skills/skills/dynamic-workflows/SKILL.md +760 -687
- package/dist/packages/bundled-skills/skills/dynamic-workflows/examples.md +310 -1
- package/dist/packages/bundled-skills/skills/dynamic-workflows/patterns.md +336 -4
- package/dist/packages/node-repl-host/.dcode-plugin/plugin.json +1 -1
- package/dist/packages/node-repl-host/dist/mcp/server.js +9 -14
- package/dist/packages/node-repl-host/scripts/build.mjs +1 -0
- package/dist/provider/dcode-builtin.json +6612 -202
- package/node_modules/@dcode/contracts/dist/compact/index.d.ts +7 -7
- package/node_modules/@dcode/contracts/dist/config/index.d.ts +1 -1
- package/node_modules/@dcode/contracts/dist/events/event-reducer.js +1 -0
- package/node_modules/@dcode/contracts/dist/events/in-memory-session-event-store.js +3 -2
- package/node_modules/@dcode/contracts/dist/events/session-event-retention.d.ts +8 -0
- package/node_modules/@dcode/contracts/dist/events/session-event-retention.js +18 -0
- package/node_modules/@dcode/contracts/dist/events/session.events.d.ts +94 -16
- package/node_modules/@dcode/contracts/dist/events/session.events.js +10 -0
- package/node_modules/@dcode/contracts/dist/hooks/index.d.ts +134 -134
- package/node_modules/@dcode/contracts/dist/hooks/workspace-hook-trust.d.ts +14 -14
- package/node_modules/@dcode/contracts/dist/index.d.ts +2 -0
- package/node_modules/@dcode/contracts/dist/index.js +2 -0
- package/node_modules/@dcode/contracts/dist/interfaces/browser-control.port.d.ts +22 -0
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-hole.port.d.ts +92 -0
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-hole.port.js +9 -0
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-retune.port.d.ts +4 -4
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-retune.port.js +7 -3
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-workspace.port.js +8 -3
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run.port.d.ts +119 -18
- package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run.port.js +13 -0
- package/node_modules/@dcode/contracts/dist/interfaces/index.d.ts +1 -0
- package/node_modules/@dcode/contracts/dist/interfaces/index.js +1 -0
- package/node_modules/@dcode/contracts/dist/interfaces/mcp.port.d.ts +161 -1
- package/node_modules/@dcode/contracts/dist/interfaces/mcp.port.js +17 -0
- package/node_modules/@dcode/contracts/dist/interfaces/permission-full-access.d.ts +15 -15
- package/node_modules/@dcode/contracts/dist/interfaces/permission-full-access.js +1 -1
- package/node_modules/@dcode/contracts/dist/interfaces/permission.port.d.ts +15 -1
- package/node_modules/@dcode/contracts/dist/interfaces/provider-endpoint-routing.port.d.ts +19 -0
- package/node_modules/@dcode/contracts/dist/interfaces/provider-endpoint-routing.port.js +1 -0
- package/node_modules/@dcode/contracts/dist/interfaces/session-store.port.d.ts +4 -2
- package/node_modules/@dcode/contracts/dist/interfaces/session-store.port.js +5 -0
- package/node_modules/@dcode/contracts/dist/interfaces/session.port.d.ts +92 -3
- package/node_modules/@dcode/contracts/dist/interfaces/session.port.js +4 -1
- package/node_modules/@dcode/contracts/dist/interfaces/topic-resource.port.d.ts +25 -0
- package/node_modules/@dcode/contracts/dist/interfaces/topic-resource.port.js +1 -0
- package/node_modules/@dcode/contracts/dist/model/index.d.ts +15 -1
- package/node_modules/@dcode/contracts/dist/model/index.js +5 -0
- package/node_modules/@dcode/contracts/dist/model/invocation-context.d.ts +6 -1
- package/node_modules/@dcode/contracts/dist/plugins/index.d.ts +23 -0
- package/node_modules/@dcode/contracts/dist/plugins/index.js +2 -1
- package/node_modules/@dcode/contracts/dist/telemetry/agent-execution.d.ts +2 -0
- package/node_modules/@dcode/contracts/dist/telemetry/agent-execution.js +2 -0
- package/node_modules/@dcode/contracts/dist/telemetry/index.d.ts +5 -1
- package/node_modules/@dcode/contracts/dist/telemetry/index.js +12 -0
- package/node_modules/@dcode/contracts/dist/tools/agent.d.ts +12 -12
- package/node_modules/@dcode/contracts/dist/tools/amend-workflow.d.ts +39 -15
- package/node_modules/@dcode/contracts/dist/tools/amend-workflow.js +12 -6
- package/node_modules/@dcode/contracts/dist/tools/automation.d.ts +32 -32
- package/node_modules/@dcode/contracts/dist/tools/automation.js +1 -1
- package/node_modules/@dcode/contracts/dist/tools/bash.d.ts +16 -16
- package/node_modules/@dcode/contracts/dist/tools/bash.js +1 -1
- package/node_modules/@dcode/contracts/dist/tools/create-workflow.d.ts +365 -66
- package/node_modules/@dcode/contracts/dist/tools/create-workflow.js +92 -11
- package/node_modules/@dcode/contracts/dist/tools/edit.d.ts +16 -16
- package/node_modules/@dcode/contracts/dist/tools/eval-workflow-snippet.d.ts +6 -6
- package/node_modules/@dcode/contracts/dist/tools/eval-workflow-snippet.js +5 -1
- package/node_modules/@dcode/contracts/dist/tools/fill-workflow-hole.d.ts +729 -0
- package/node_modules/@dcode/contracts/dist/tools/fill-workflow-hole.js +102 -0
- package/node_modules/@dcode/contracts/dist/tools/get-workflow-run.d.ts +136 -28
- package/node_modules/@dcode/contracts/dist/tools/get-workflow-run.js +36 -0
- package/node_modules/@dcode/contracts/dist/tools/grep.d.ts +4 -4
- package/node_modules/@dcode/contracts/dist/tools/grep.js +4 -0
- package/node_modules/@dcode/contracts/dist/tools/index.d.ts +2 -0
- package/node_modules/@dcode/contracts/dist/tools/index.js +4 -0
- package/node_modules/@dcode/contracts/dist/tools/list-saved-workflows.d.ts +8 -8
- package/node_modules/@dcode/contracts/dist/tools/list-workflow-runs.d.ts +8 -8
- package/node_modules/@dcode/contracts/dist/tools/node-repl.d.ts +2 -2
- package/node_modules/@dcode/contracts/dist/tools/off-peak.d.ts +3 -3
- package/node_modules/@dcode/contracts/dist/tools/off-peak.js +2 -2
- package/node_modules/@dcode/contracts/dist/tools/performance.d.ts +22 -22
- package/node_modules/@dcode/contracts/dist/tools/plan-mode.d.ts +12 -12
- package/node_modules/@dcode/contracts/dist/tools/plan-mode.js +6 -4
- package/node_modules/@dcode/contracts/dist/tools/read-session-context.d.ts +86 -13
- package/node_modules/@dcode/contracts/dist/tools/read-session-context.js +37 -6
- package/node_modules/@dcode/contracts/dist/tools/read.d.ts +38 -38
- package/node_modules/@dcode/contracts/dist/tools/save-workflow.d.ts +21 -10
- package/node_modules/@dcode/contracts/dist/tools/save-workflow.js +22 -2
- package/node_modules/@dcode/contracts/dist/tools/saved-workflow.d.ts +4 -4
- package/node_modules/@dcode/contracts/dist/tools/send-message.d.ts +2 -2
- package/node_modules/@dcode/contracts/dist/tools/skill.js +1 -0
- package/node_modules/@dcode/contracts/dist/tools/task-output.d.ts +6 -6
- package/node_modules/@dcode/contracts/dist/tools/tool-result-metadata.d.ts +1228 -259
- package/node_modules/@dcode/contracts/dist/tools/tool-result-metadata.js +41 -0
- package/node_modules/@dcode/contracts/dist/tools/webfetch.d.ts +2 -2
- package/node_modules/@dcode/contracts/dist/tools/workflow-observation-display.d.ts +20 -20
- package/node_modules/@dcode/contracts/dist/tools/workflow-settings.d.ts +55 -0
- package/node_modules/@dcode/contracts/dist/tools/workflow-settings.js +86 -0
- package/node_modules/@dcode/contracts/dist/tools/workflow.d.ts +8 -8
- package/node_modules/@dcode/contracts/dist/tools/write.d.ts +18 -18
- package/node_modules/@dcode/contracts/dist/workflow/index.d.ts +98 -98
- package/node_modules/@dcode/contracts/dist/workflow/script.d.ts +12 -12
- package/node_modules/@dcode/i18n/dist/index.js +2 -2
- package/node_modules/@dcode/i18n/dist/locale.d.ts +1 -1
- package/node_modules/@dcode/i18n/dist/locale.js +4 -4
- package/node_modules/@dcode/i18n/dist/locales/en-US.js +5 -5
- package/node_modules/@dcode/i18n/dist/locales/fr-CA.d.ts +3 -0
- package/node_modules/@dcode/i18n/dist/locales/fr-CA.js +354 -0
- package/node_modules/@dcode/model-option-map/package.json +1 -1
- package/node_modules/@dcode/shared/dist/api-key-usage-scene.d.ts +7 -0
- package/node_modules/@dcode/shared/dist/api-key-usage-scene.js +6 -0
- package/node_modules/@dcode/shared/dist/attachment-source.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/attachment-source.js +4 -0
- package/node_modules/@dcode/shared/dist/background-bash-output.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/bots.d.ts +763 -15
- package/node_modules/@dcode/shared/dist/bots.js +236 -2
- package/node_modules/@dcode/shared/dist/browser-use/command-metadata.d.ts +2 -2
- package/node_modules/@dcode/shared/dist/browser-use/commands.d.ts +4 -3
- package/node_modules/@dcode/shared/dist/browser-use/commands.js +3 -1
- package/node_modules/@dcode/shared/dist/browser-use/nodeReplBroker.d.ts +5 -4
- package/node_modules/@dcode/shared/dist/browser-use/result.d.ts +6 -6
- package/node_modules/@dcode/shared/dist/channel-mention.d.ts +173 -0
- package/node_modules/@dcode/shared/dist/channel-mention.js +120 -0
- package/node_modules/@dcode/shared/dist/channels.d.ts +128 -1
- package/node_modules/@dcode/shared/dist/channels.js +66 -0
- package/node_modules/@dcode/shared/dist/clientConfig.d.ts +1 -0
- package/node_modules/@dcode/shared/dist/clientConfig.js +18 -2
- package/node_modules/@dcode/shared/dist/cloudContent.d.ts +160 -0
- package/node_modules/@dcode/shared/dist/cloudContent.js +116 -0
- package/node_modules/@dcode/shared/dist/coding-plan-subscription.d.ts +59 -0
- package/node_modules/@dcode/shared/dist/conversation-message-projection-policy.js +2 -0
- package/node_modules/@dcode/shared/dist/conversation-share.d.ts +351 -47
- package/node_modules/@dcode/shared/dist/conversation-share.js +8 -6
- package/node_modules/@dcode/shared/dist/conversationSelection.d.ts +23 -0
- package/node_modules/@dcode/shared/dist/conversationSelection.js +30 -0
- package/node_modules/@dcode/shared/dist/database-startup.d.ts +5 -5
- package/node_modules/@dcode/shared/dist/dcode-agent-model-state.js +14 -6
- package/node_modules/@dcode/shared/dist/dcode-agent-policy.d.ts +16 -1
- package/node_modules/@dcode/shared/dist/dcode-agent-policy.js +17 -1
- package/node_modules/@dcode/shared/dist/dcode-agent-runtime.js +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol/index.d.ts +1733 -318
- package/node_modules/@dcode/shared/dist/dcode-protocol/index.js +555 -24
- package/node_modules/@dcode/shared/dist/dcode-protocol/trace.d.ts +9 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol/trace.js +10 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-legacy-types.d.ts +30 -20
- package/node_modules/@dcode/shared/dist/dcode-protocol-legacy-types.js +3 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/apply.js +12 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/attachment-ref.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/attachment-ref.js +3 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/coalesce.d.ts +3 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/coalesce.js +3 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.d.ts +359 -28
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.js +67 -45
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/controller.d.ts +170 -65
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-session-config.d.ts +20 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-session-config.js +15 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-workflow-display.d.ts +34 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-workflow-display.js +45 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/delta.d.ts +1453 -278
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/delta.js +45 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/index.d.ts +1 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/index.js +1 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/input-intent.d.ts +173 -6
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/input-intent.js +29 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/rows.d.ts +731 -125
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/rows.js +23 -11
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index-workflow-activity.d.ts +30 -11
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index-workflow-activity.js +35 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index.d.ts +40 -25
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/snapshot.d.ts +1444 -216
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/snapshot.js +3 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/submission.d.ts +1 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/submission.js +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/telemetry.d.ts +62 -58
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/toolDisplay.d.ts +185 -50
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/toolDisplay.js +31 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.d.ts +7145 -1002
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.js +18 -5
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-assembler.js +2 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-fault.js +4 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-reassembly.js +5 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-artifacts.d.ts +29 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-artifacts.js +64 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-command-rejections.d.ts +13 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-command-rejections.js +23 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-observation-display.d.ts +14 -14
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-row-meta.d.ts +52 -8
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-row-meta.js +22 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-run-settings-command.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-run-settings-command.js +2 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-session.d.ts +21 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-session.js +44 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-status.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-status.js +3 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-caps.js +5 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-concurrency.d.ts +26 -19
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-concurrency.js +40 -32
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-delta.d.ts +4 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-delta.js +4 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-entries.d.ts +12 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-entries.js +44 -6
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-eviction.d.ts +2 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-eviction.js +17 -10
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-holes.d.ts +33 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-holes.js +202 -0
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-legacy.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-legacy.js +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-phases.js +10 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-reducer.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-reducer.js +29 -22
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-started.js +5 -2
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-tables.js +2 -1
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-unlisted.js +6 -3
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs.d.ts +125 -40
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs.js +101 -26
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-workspace.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workspace-hook-review.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/dcode-session-content-profile.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/dcode-session-content-profile.js +49 -0
- package/node_modules/@dcode/shared/dist/dcode-slash-command-help.js +4 -4
- package/node_modules/@dcode/shared/dist/dcode-task-mode-schema.d.ts +6 -1
- package/node_modules/@dcode/shared/dist/dcode-task-mode-schema.js +13 -1
- package/node_modules/@dcode/shared/dist/dcode-task-types-core.d.ts +12 -2
- package/node_modules/@dcode/shared/dist/dcode-task-types.d.ts +23 -0
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.d.ts +20 -1
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.js +98 -17
- package/node_modules/@dcode/shared/dist/desktopMenu.js +48 -48
- package/node_modules/@dcode/shared/dist/dynamic-workflow-feature.d.ts +35 -6
- package/node_modules/@dcode/shared/dist/dynamic-workflow-feature.js +45 -6
- package/node_modules/@dcode/shared/dist/env.d.ts +5 -4
- package/node_modules/@dcode/shared/dist/env.js +9 -9
- package/node_modules/@dcode/shared/dist/errors.d.ts +24 -0
- package/node_modules/@dcode/shared/dist/errors.js +54 -0
- package/node_modules/@dcode/shared/dist/execution-state.d.ts +4 -2
- package/node_modules/@dcode/shared/dist/execution-state.js +1 -1
- package/node_modules/@dcode/shared/dist/feedback.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/gen-ui/contract.d.ts +140 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.example.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.example.js +36 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.js +196 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/gen-ui/contract.test.js +75 -0
- package/node_modules/@dcode/shared/dist/gen-ui/index.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/gen-ui/index.js +2 -0
- package/node_modules/@dcode/shared/dist/gen-ui/module.d.ts +7 -0
- package/node_modules/@dcode/shared/dist/gen-ui/module.js +7 -0
- package/node_modules/@dcode/shared/dist/gen-ui/tweakProtocol.d.ts +202 -0
- package/node_modules/@dcode/shared/dist/gen-ui/tweakProtocol.js +126 -0
- package/node_modules/@dcode/shared/dist/helpAppConfig.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/helpAppConfig.js +2 -2
- package/node_modules/@dcode/shared/dist/highspeed.d.ts +181 -0
- package/node_modules/@dcode/shared/dist/highspeed.js +112 -0
- package/node_modules/@dcode/shared/dist/index.d.ts +27 -5
- package/node_modules/@dcode/shared/dist/index.js +24 -2
- package/node_modules/@dcode/shared/dist/localTtft.d.ts +27 -27
- package/node_modules/@dcode/shared/dist/marketingTouch.d.ts +930 -0
- package/node_modules/@dcode/shared/dist/marketingTouch.js +170 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/appTools.d.ts +83 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/appTools.js +124 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/content.d.ts +4 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/content.js +8 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.d.ts +241 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.example.d.ts +31 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.example.js +42 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.js +101 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/contract.test.js +64 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/hostContract.d.ts +47 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/hostContract.js +8 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/index.d.ts +9 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/index.js +9 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/instance.d.ts +10 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/instance.js +11 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/module.d.ts +12 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/module.js +12 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/resourceMime.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/resourceMime.js +73 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.d.ts +101 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.js +107 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/sampling.test.js +55 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/schemas.d.ts +78 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/schemas.js +65 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/toolMeta.d.ts +39 -0
- package/node_modules/@dcode/shared/dist/mcp-apps/toolMeta.js +199 -0
- package/node_modules/@dcode/shared/dist/mcp.d.ts +6 -2
- package/node_modules/@dcode/shared/dist/memory.d.ts +9 -0
- package/node_modules/@dcode/shared/dist/memory.js +2 -0
- package/node_modules/@dcode/shared/dist/model-execution.d.ts +31 -0
- package/node_modules/@dcode/shared/dist/model-execution.js +38 -0
- package/node_modules/@dcode/shared/dist/networkCapture.d.ts +49 -0
- package/node_modules/@dcode/shared/dist/networkCapture.js +41 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.d.ts +6 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.js +16 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.test.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/node/genUiPaths.test.js +30 -0
- package/node_modules/@dcode/shared/dist/node/networkCapture.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/node/networkCapture.js +96 -0
- package/node_modules/@dcode/shared/dist/node/officialPluginCache.d.ts +1 -2
- package/node_modules/@dcode/shared/dist/node/subagentMarkdownMigration.d.ts +1 -2
- package/node_modules/@dcode/shared/dist/node.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/node.js +2 -0
- package/node_modules/@dcode/shared/dist/output-style.d.ts +17 -0
- package/node_modules/@dcode/shared/dist/output-style.js +2 -0
- package/node_modules/@dcode/shared/dist/platform.d.ts +149 -1
- package/node_modules/@dcode/shared/dist/platform.js +2 -0
- package/node_modules/@dcode/shared/dist/platformUpdate.d.ts +61 -0
- package/node_modules/@dcode/shared/dist/platformUpdate.js +2 -0
- package/node_modules/@dcode/shared/dist/plugin-marketplaces.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/plugin-marketplaces.js +20 -14
- package/node_modules/@dcode/shared/dist/project-access-token-client.d.ts +42 -0
- package/node_modules/@dcode/shared/dist/project-access-token-client.js +260 -0
- package/node_modules/@dcode/shared/dist/project-access-token-response.d.ts +4 -0
- package/node_modules/@dcode/shared/dist/project-access-token-response.js +9 -0
- package/node_modules/@dcode/shared/dist/project-access-token.d.ts +45 -0
- package/node_modules/@dcode/shared/dist/project-access-token.js +164 -0
- package/node_modules/@dcode/shared/dist/protocol.d.ts +41 -4
- package/node_modules/@dcode/shared/dist/protocol.js +1 -1
- package/node_modules/@dcode/shared/dist/provider-provisioning.d.ts +26 -2
- package/node_modules/@dcode/shared/dist/provider-provisioning.js +19 -3
- package/node_modules/@dcode/shared/dist/providers.d.ts +1 -2
- package/node_modules/@dcode/shared/dist/providers.js +1 -1
- package/node_modules/@dcode/shared/dist/remote-workspace-identity.d.ts +6 -1
- package/node_modules/@dcode/shared/dist/remote-workspace-identity.js +35 -1
- package/node_modules/@dcode/shared/dist/remoteAppConfig.js +1 -1
- package/node_modules/@dcode/shared/dist/remoteEnvironmentKey.js +19 -0
- package/node_modules/@dcode/shared/dist/remoteTarget.d.ts +14 -1
- package/node_modules/@dcode/shared/dist/remoteTarget.js +4 -0
- package/node_modules/@dcode/shared/dist/remoteUsageTelemetry.d.ts +27 -0
- package/node_modules/@dcode/shared/dist/remoteUsageTelemetry.js +43 -0
- package/node_modules/@dcode/shared/dist/rendererActionTrace.d.ts +35 -35
- package/node_modules/@dcode/shared/dist/request-security-edition/index.d.ts +3 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/index.js +3 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/policy.d.ts +3 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/policy.js +5 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/verification-policy.d.ts +19 -0
- package/node_modules/@dcode/shared/dist/request-security-edition/verification-policy.js +29 -0
- package/node_modules/@dcode/shared/dist/rewardsBridge.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/rewardsBridge.js +80 -0
- package/node_modules/@dcode/shared/dist/rewardsEmbedded.d.ts +37 -0
- package/node_modules/@dcode/shared/dist/rewardsEmbedded.js +50 -0
- package/node_modules/@dcode/shared/dist/sessionCreateTelemetry.d.ts +3 -3
- package/node_modules/@dcode/shared/dist/subagent-profile-frontmatter.d.ts +10 -0
- package/node_modules/@dcode/shared/dist/subagent-profile-frontmatter.js +212 -0
- package/node_modules/@dcode/shared/dist/subagent-profile-parser.d.ts +10 -0
- package/node_modules/@dcode/shared/dist/subagent-profile-parser.js +200 -0
- package/node_modules/@dcode/shared/dist/subagent-profile.d.ts +82 -0
- package/node_modules/@dcode/shared/dist/subagent-profile.js +28 -0
- package/node_modules/@dcode/shared/dist/subagent-runtime-config.d.ts +135 -0
- package/node_modules/@dcode/shared/dist/subagent-runtime-config.js +39 -0
- package/node_modules/@dcode/shared/dist/subagents-types.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/task-realtime-core.d.ts +57 -24
- package/node_modules/@dcode/shared/dist/task-realtime-core.js +8 -2
- package/node_modules/@dcode/shared/dist/test-ids-workflow.d.ts +4 -0
- package/node_modules/@dcode/shared/dist/test-ids-workflow.js +5 -0
- package/node_modules/@dcode/shared/dist/test-ids.d.ts +25 -0
- package/node_modules/@dcode/shared/dist/test-ids.js +25 -0
- package/node_modules/@dcode/shared/dist/tool-identity.d.ts +1 -1
- package/node_modules/@dcode/shared/dist/tool-identity.js +4 -0
- package/node_modules/@dcode/shared/dist/tool-plan-adapter.js +14 -1
- package/node_modules/@dcode/shared/dist/usage-stats.d.ts +13 -0
- package/node_modules/@dcode/shared/dist/validation.d.ts +1461 -85
- package/node_modules/@dcode/shared/dist/validation.js +423 -14
- package/node_modules/@dcode/shared/dist/validationAppSettings.d.ts +71 -15
- package/node_modules/@dcode/shared/dist/validationAppSettings.js +74 -12
- package/node_modules/@dcode/shared/dist/web-remote-control-heartbeat.d.ts +8 -0
- package/node_modules/@dcode/shared/dist/web-remote-control-heartbeat.js +40 -0
- package/node_modules/@dcode/shared/dist/web-remote-control-rpc-transport.d.ts +183 -0
- package/node_modules/@dcode/shared/dist/web-remote-control-rpc-transport.js +562 -0
- package/node_modules/@dcode/shared/dist/web-remote-control.d.ts +645 -0
- package/node_modules/@dcode/shared/dist/web-remote-control.js +174 -0
- package/node_modules/@dcode/shared/package.json +5 -2
- package/node_modules/@dcode/tui/dist/app-approval-panel.js +3 -2
- package/node_modules/@dcode/tui/dist/app-approval.d.ts +3 -1
- package/node_modules/@dcode/tui/dist/app-approval.js +9 -5
- package/node_modules/@dcode/tui/dist/app-compact-timeline.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/app-compact-timeline.js +5 -2
- package/node_modules/@dcode/tui/dist/app-empty-transcript.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-empty-transcript.js +1 -1
- package/node_modules/@dcode/tui/dist/app-file-mentions.d.ts +2 -0
- package/node_modules/@dcode/tui/dist/app-file-mentions.js +2 -2
- package/node_modules/@dcode/tui/dist/app-input-pane.d.ts +38 -0
- package/node_modules/@dcode/tui/dist/app-input-pane.js +19 -19
- package/node_modules/@dcode/tui/dist/app-input-status.d.ts +17 -0
- package/node_modules/@dcode/tui/dist/app-input-status.js +4 -4
- package/node_modules/@dcode/tui/dist/app-input.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-input.js +1 -1
- package/node_modules/@dcode/tui/dist/app-markdown-theme.d.ts +2 -1
- package/node_modules/@dcode/tui/dist/app-markdown-theme.js +1 -1
- package/node_modules/@dcode/tui/dist/app-markdown.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-markdown.js +1 -1
- package/node_modules/@dcode/tui/dist/app-mode-command.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/app-mode-command.js +4 -4
- package/node_modules/@dcode/tui/dist/app-mode-suggestion-panel.d.ts +5 -0
- package/node_modules/@dcode/tui/dist/app-mode-suggestion-panel.js +1 -1
- package/node_modules/@dcode/tui/dist/app-mode.d.ts +1 -1
- package/node_modules/@dcode/tui/dist/app-mode.js +1 -1
- package/node_modules/@dcode/tui/dist/app-model-ref.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-model-ref.js +1 -1
- package/node_modules/@dcode/tui/dist/app-motion.d.ts +13 -0
- package/node_modules/@dcode/tui/dist/app-motion.js +17 -7
- package/node_modules/@dcode/tui/dist/app-session-event-handler.d.ts +33 -0
- package/node_modules/@dcode/tui/dist/app-session-event-handler.js +4 -4
- package/node_modules/@dcode/tui/dist/app-shiki-diff-view.d.ts +18 -1
- package/node_modules/@dcode/tui/dist/app-shiki-diff-view.js +3 -3
- package/node_modules/@dcode/tui/dist/app-shiki-highlighter.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/app-shiki-highlighter.js +7 -2
- package/node_modules/@dcode/tui/dist/app-sidebar-layout.d.ts +10 -0
- package/node_modules/@dcode/tui/dist/app-sidebar-layout.js +4 -4
- package/node_modules/@dcode/tui/dist/app-submit.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-submit.js +1 -1
- package/node_modules/@dcode/tui/dist/app-thought-components.d.ts +7 -0
- package/node_modules/@dcode/tui/dist/app-thought-components.js +2 -2
- package/node_modules/@dcode/tui/dist/app-tool-transcript.d.ts +1 -0
- package/node_modules/@dcode/tui/dist/app-tool-transcript.js +3 -0
- package/node_modules/@dcode/tui/dist/app-view.d.ts +27 -0
- package/node_modules/@dcode/tui/dist/app-view.js +1 -1
- package/node_modules/@dcode/tui/dist/app-workflow-card.js +1 -1
- package/node_modules/@dcode/tui/dist/app-workflow-seed.d.ts +18 -1
- package/node_modules/@dcode/tui/dist/app-workflow-seed.js +4 -4
- package/node_modules/@dcode/tui/dist/index.js +5118 -2579
- package/node_modules/@dcode/tui/dist/tui.d.ts +3 -0
- package/node_modules/@dcode/tui/dist/tui.js +1 -1
- package/node_modules/@dcode/tui/dist/types.d.ts +1 -1
- package/node_modules/oniguruma-parser/LICENSE +1 -1
- package/node_modules/oniguruma-parser/README.md +15 -61
- package/node_modules/oniguruma-parser/dist/oniguruma-parser.min.js +4 -4
- package/node_modules/oniguruma-parser/dist/parser/parse.js +1 -1
- package/node_modules/oniguruma-parser/dist/traverser/traverse.js +1 -1
- package/node_modules/oniguruma-parser/package.json +5 -5
- package/node_modules/oniguruma-to-es/dist/cjs/generate.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/cjs/index.js +121 -120
- package/node_modules/oniguruma-to-es/dist/cjs/subclass.d.ts +2 -2
- package/node_modules/oniguruma-to-es/dist/cjs/transform.d.ts +3 -5
- package/node_modules/oniguruma-to-es/dist/cjs/unicode.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/esm/generate.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/esm/index.js +1 -3
- package/node_modules/oniguruma-to-es/dist/esm/subclass.d.ts +2 -2
- package/node_modules/oniguruma-to-es/dist/esm/transform.d.ts +3 -5
- package/node_modules/oniguruma-to-es/dist/esm/unicode.d.ts +1 -1
- package/node_modules/oniguruma-to-es/dist/index.min.js +6 -6
- package/node_modules/oniguruma-to-es/package.json +5 -5
- package/package.json +5 -5
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { genUiReferenceSchema, genUiWidgetStateSchema, buildGenUiStateKey, buildGenUiModelContext, stripGenUiModelContext, genUiTweakSchema, } from "./contract.js";
|
|
3
|
+
describe("Gen UI boundaries", () => {
|
|
4
|
+
it("accepts executor absolute paths but rejects URLs and document traversal", () => {
|
|
5
|
+
for (const path of ["/project/example.html", "C:\\project\\example.html"]) {
|
|
6
|
+
expect(genUiReferenceSchema.parse({ path }).path).toBe(path);
|
|
7
|
+
}
|
|
8
|
+
for (const path of [
|
|
9
|
+
"https://example.test/x.html",
|
|
10
|
+
"../x.html",
|
|
11
|
+
"/project/../x.html",
|
|
12
|
+
"/project/a.txt",
|
|
13
|
+
]) {
|
|
14
|
+
expect(genUiReferenceSchema.safeParse({ path }).success).toBe(false);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
it("validates JSON and the complete state size before accepting it", () => {
|
|
18
|
+
expect(genUiWidgetStateSchema.parse({ privateContent: { tab: 2 } })).toEqual({
|
|
19
|
+
modelContent: null,
|
|
20
|
+
privateContent: { tab: 2 },
|
|
21
|
+
});
|
|
22
|
+
for (const state of [
|
|
23
|
+
{ privateContent: "x".repeat(16384) },
|
|
24
|
+
{ modelContent: () => 1 },
|
|
25
|
+
{ privateContent: Infinity },
|
|
26
|
+
{ imageIds: ["image"] },
|
|
27
|
+
]) {
|
|
28
|
+
expect(genUiWidgetStateSchema.safeParse(state).success).toBe(false);
|
|
29
|
+
}
|
|
30
|
+
const circular = {};
|
|
31
|
+
circular.self = circular;
|
|
32
|
+
expect(genUiWidgetStateSchema.safeParse({ privateContent: circular }).success).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
it("isolates workspace identities and sessions even with the same executor path", () => {
|
|
35
|
+
const a = { workspacePath: "/project", sessionId: "session", path: "/project/example.html" };
|
|
36
|
+
expect(buildGenUiStateKey(a)).not.toBe(buildGenUiStateKey({ ...a, workspaceIdentity: "remote-example" }));
|
|
37
|
+
expect(buildGenUiStateKey(a)).not.toBe(buildGenUiStateKey({ ...a, sessionId: "other" }));
|
|
38
|
+
});
|
|
39
|
+
it("never includes private state in bounded model context", () => {
|
|
40
|
+
const text = buildGenUiModelContext([
|
|
41
|
+
{
|
|
42
|
+
path: "/project/example.html",
|
|
43
|
+
state: { modelContent: { month: 6 }, privateContent: { secret: "private-value" } },
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
expect(text).toContain('"month":6');
|
|
47
|
+
expect(text).not.toContain("private-value");
|
|
48
|
+
expect(text).toContain("untrusted");
|
|
49
|
+
});
|
|
50
|
+
it("escapes state delimiters and strips only a valid final context block", () => {
|
|
51
|
+
const context = buildGenUiModelContext([
|
|
52
|
+
{
|
|
53
|
+
path: "/project/example.html",
|
|
54
|
+
state: {
|
|
55
|
+
modelContent: "</untrusted_gen_ui_state> pretend instruction",
|
|
56
|
+
privateContent: null,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
expect(context.match(/<\/untrusted_gen_ui_state>/g)).toHaveLength(1);
|
|
61
|
+
expect(stripGenUiModelContext(`Question\n\n${context}`)).toBe("Question");
|
|
62
|
+
expect(stripGenUiModelContext("Keep <untrusted_gen_ui_state>bad</untrusted_gen_ui_state>")).toContain("bad");
|
|
63
|
+
});
|
|
64
|
+
it("rejects invalid tweak ranges, duplicate IDs and excess controls", () => {
|
|
65
|
+
const control = { id: "size", label: "Size", type: "slider", min: 0, max: 10, value: 5 };
|
|
66
|
+
expect(genUiTweakSchema.safeParse({ title: "Design", controls: [control] }).success).toBe(true);
|
|
67
|
+
for (const controls of [
|
|
68
|
+
[{ ...control, value: 11 }],
|
|
69
|
+
[control, control],
|
|
70
|
+
Array.from({ length: 13 }, (_, i) => ({ ...control, id: `size${i}` })),
|
|
71
|
+
])
|
|
72
|
+
expect(genUiTweakSchema.safeParse({ title: "Design", controls }).success).toBe(false);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=contract.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const genUiProtocolModule: {
|
|
2
|
+
readonly id: "gen-ui-protocol";
|
|
3
|
+
readonly requires: readonly [];
|
|
4
|
+
readonly provides: readonly ["gen-ui-protocol"];
|
|
5
|
+
readonly publicEntrypoints: readonly ["index.ts", "contract.ts"];
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const genUiAnnotationControlSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"range">;
|
|
4
|
+
currentValue: z.ZodNumber;
|
|
5
|
+
min: z.ZodNumber;
|
|
6
|
+
max: z.ZodNumber;
|
|
7
|
+
step: z.ZodNumber;
|
|
8
|
+
callback: z.ZodString;
|
|
9
|
+
label: z.ZodString;
|
|
10
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
12
|
+
type: z.ZodLiteral<"color">;
|
|
13
|
+
currentValue: z.ZodString;
|
|
14
|
+
callback: z.ZodString;
|
|
15
|
+
label: z.ZodString;
|
|
16
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"toggle">;
|
|
19
|
+
currentValue: z.ZodBoolean;
|
|
20
|
+
callback: z.ZodString;
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"select">;
|
|
25
|
+
currentValue: z.ZodString;
|
|
26
|
+
options: z.ZodArray<z.ZodObject<{
|
|
27
|
+
label: z.ZodString;
|
|
28
|
+
value: z.ZodString;
|
|
29
|
+
}, z.core.$strict>>;
|
|
30
|
+
callback: z.ZodString;
|
|
31
|
+
label: z.ZodString;
|
|
32
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strict>], "type">;
|
|
34
|
+
export type GenUiAnnotationControl = z.infer<typeof genUiAnnotationControlSchema>;
|
|
35
|
+
export declare function isGenUiAnnotationValue(control: GenUiAnnotationControl, candidate: unknown): candidate is string | number | boolean;
|
|
36
|
+
export declare const genUiTweakMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
registrationId: z.ZodString;
|
|
38
|
+
annotationControls: z.ZodObject<{
|
|
39
|
+
controlsMode: z.ZodLiteral<"replace">;
|
|
40
|
+
controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
+
type: z.ZodLiteral<"range">;
|
|
42
|
+
currentValue: z.ZodNumber;
|
|
43
|
+
min: z.ZodNumber;
|
|
44
|
+
max: z.ZodNumber;
|
|
45
|
+
step: z.ZodNumber;
|
|
46
|
+
callback: z.ZodString;
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"color">;
|
|
51
|
+
currentValue: z.ZodString;
|
|
52
|
+
callback: z.ZodString;
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
type: z.ZodLiteral<"toggle">;
|
|
57
|
+
currentValue: z.ZodBoolean;
|
|
58
|
+
callback: z.ZodString;
|
|
59
|
+
label: z.ZodString;
|
|
60
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
+
type: z.ZodLiteral<"select">;
|
|
63
|
+
currentValue: z.ZodString;
|
|
64
|
+
options: z.ZodArray<z.ZodObject<{
|
|
65
|
+
label: z.ZodString;
|
|
66
|
+
value: z.ZodString;
|
|
67
|
+
}, z.core.$strict>>;
|
|
68
|
+
callback: z.ZodString;
|
|
69
|
+
label: z.ZodString;
|
|
70
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strict>], "type">>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
label: z.ZodString;
|
|
76
|
+
selector: z.ZodString;
|
|
77
|
+
tagName: z.ZodString;
|
|
78
|
+
rect: z.ZodObject<{
|
|
79
|
+
x: z.ZodNumber;
|
|
80
|
+
y: z.ZodNumber;
|
|
81
|
+
width: z.ZodNumber;
|
|
82
|
+
height: z.ZodNumber;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
type: z.ZodLiteral<"register">;
|
|
86
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
87
|
+
registrationId: z.ZodString;
|
|
88
|
+
annotationControls: z.ZodObject<{
|
|
89
|
+
controlsMode: z.ZodLiteral<"replace">;
|
|
90
|
+
controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
|
+
type: z.ZodLiteral<"range">;
|
|
92
|
+
currentValue: z.ZodNumber;
|
|
93
|
+
min: z.ZodNumber;
|
|
94
|
+
max: z.ZodNumber;
|
|
95
|
+
step: z.ZodNumber;
|
|
96
|
+
callback: z.ZodString;
|
|
97
|
+
label: z.ZodString;
|
|
98
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
100
|
+
type: z.ZodLiteral<"color">;
|
|
101
|
+
currentValue: z.ZodString;
|
|
102
|
+
callback: z.ZodString;
|
|
103
|
+
label: z.ZodString;
|
|
104
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
105
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
106
|
+
type: z.ZodLiteral<"toggle">;
|
|
107
|
+
currentValue: z.ZodBoolean;
|
|
108
|
+
callback: z.ZodString;
|
|
109
|
+
label: z.ZodString;
|
|
110
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
112
|
+
type: z.ZodLiteral<"select">;
|
|
113
|
+
currentValue: z.ZodString;
|
|
114
|
+
options: z.ZodArray<z.ZodObject<{
|
|
115
|
+
label: z.ZodString;
|
|
116
|
+
value: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
callback: z.ZodString;
|
|
119
|
+
label: z.ZodString;
|
|
120
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strict>], "type">>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
label: z.ZodString;
|
|
126
|
+
selector: z.ZodString;
|
|
127
|
+
tagName: z.ZodString;
|
|
128
|
+
rect: z.ZodObject<{
|
|
129
|
+
x: z.ZodNumber;
|
|
130
|
+
y: z.ZodNumber;
|
|
131
|
+
width: z.ZodNumber;
|
|
132
|
+
height: z.ZodNumber;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
type: z.ZodLiteral<"update">;
|
|
136
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
|
+
type: z.ZodLiteral<"dispose">;
|
|
138
|
+
registrationId: z.ZodString;
|
|
139
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"select">;
|
|
141
|
+
registrationId: z.ZodString;
|
|
142
|
+
targetId: z.ZodString;
|
|
143
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"escape">;
|
|
145
|
+
}, z.core.$strict>], "type">;
|
|
146
|
+
export type GenUiTweakMessage = z.infer<typeof genUiTweakMessageSchema>;
|
|
147
|
+
export declare const genUiTweakResultSchema: z.ZodObject<{
|
|
148
|
+
annotationControls: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
controlsMode: z.ZodLiteral<"replace">;
|
|
150
|
+
controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
151
|
+
type: z.ZodLiteral<"range">;
|
|
152
|
+
currentValue: z.ZodNumber;
|
|
153
|
+
min: z.ZodNumber;
|
|
154
|
+
max: z.ZodNumber;
|
|
155
|
+
step: z.ZodNumber;
|
|
156
|
+
callback: z.ZodString;
|
|
157
|
+
label: z.ZodString;
|
|
158
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
160
|
+
type: z.ZodLiteral<"color">;
|
|
161
|
+
currentValue: z.ZodString;
|
|
162
|
+
callback: z.ZodString;
|
|
163
|
+
label: z.ZodString;
|
|
164
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
166
|
+
type: z.ZodLiteral<"toggle">;
|
|
167
|
+
currentValue: z.ZodBoolean;
|
|
168
|
+
callback: z.ZodString;
|
|
169
|
+
label: z.ZodString;
|
|
170
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
172
|
+
type: z.ZodLiteral<"select">;
|
|
173
|
+
currentValue: z.ZodString;
|
|
174
|
+
options: z.ZodArray<z.ZodObject<{
|
|
175
|
+
label: z.ZodString;
|
|
176
|
+
value: z.ZodString;
|
|
177
|
+
}, z.core.$strict>>;
|
|
178
|
+
callback: z.ZodString;
|
|
179
|
+
label: z.ZodString;
|
|
180
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strict>], "type">>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
export type GenUiTweakResult = z.infer<typeof genUiTweakResultSchema>;
|
|
185
|
+
export declare const genUiTweakAnnotationSchema: z.ZodObject<{
|
|
186
|
+
active: z.ZodBoolean;
|
|
187
|
+
selection: z.ZodNullable<z.ZodObject<{
|
|
188
|
+
registrationId: z.ZodString;
|
|
189
|
+
targetId: z.ZodString;
|
|
190
|
+
}, z.core.$strip>>;
|
|
191
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
192
|
+
registrationId: z.ZodString;
|
|
193
|
+
targetId: z.ZodString;
|
|
194
|
+
annotationControlChanges: z.ZodArray<z.ZodObject<{
|
|
195
|
+
callback: z.ZodString;
|
|
196
|
+
previousValue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
197
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
}, z.core.$strict>>;
|
|
200
|
+
}, z.core.$strict>;
|
|
201
|
+
export type GenUiTweakAnnotation = z.infer<typeof genUiTweakAnnotationSchema>;
|
|
202
|
+
//# sourceMappingURL=tweakProtocol.d.ts.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const value = z.union([z.string(), z.number().finite(), z.boolean()]);
|
|
3
|
+
const base = {
|
|
4
|
+
callback: z.string().min(1).max(128),
|
|
5
|
+
label: z.string().min(1).max(120),
|
|
6
|
+
reference: z.string().max(160).optional(),
|
|
7
|
+
};
|
|
8
|
+
export const genUiAnnotationControlSchema = z.discriminatedUnion("type", [
|
|
9
|
+
z
|
|
10
|
+
.object({
|
|
11
|
+
...base,
|
|
12
|
+
type: z.literal("range"),
|
|
13
|
+
currentValue: z.number().finite(),
|
|
14
|
+
min: z.number().finite(),
|
|
15
|
+
max: z.number().finite(),
|
|
16
|
+
step: z.number().positive(),
|
|
17
|
+
})
|
|
18
|
+
.strict(),
|
|
19
|
+
z
|
|
20
|
+
.object({
|
|
21
|
+
...base,
|
|
22
|
+
type: z.literal("color"),
|
|
23
|
+
currentValue: z.string().regex(/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i),
|
|
24
|
+
})
|
|
25
|
+
.strict(),
|
|
26
|
+
z.object({ ...base, type: z.literal("toggle"), currentValue: z.boolean() }).strict(),
|
|
27
|
+
z
|
|
28
|
+
.object({
|
|
29
|
+
...base,
|
|
30
|
+
type: z.literal("select"),
|
|
31
|
+
currentValue: z.string().max(120),
|
|
32
|
+
options: z
|
|
33
|
+
.array(z.object({ label: z.string().min(1).max(120), value: z.string().max(120) }).strict())
|
|
34
|
+
.min(1)
|
|
35
|
+
.max(12),
|
|
36
|
+
})
|
|
37
|
+
.strict(),
|
|
38
|
+
]);
|
|
39
|
+
export function isGenUiAnnotationValue(control, candidate) {
|
|
40
|
+
switch (control.type) {
|
|
41
|
+
case "range":
|
|
42
|
+
return (typeof candidate === "number" &&
|
|
43
|
+
Number.isFinite(candidate) &&
|
|
44
|
+
candidate >= control.min &&
|
|
45
|
+
candidate <= control.max);
|
|
46
|
+
case "color":
|
|
47
|
+
return (typeof candidate === "string" &&
|
|
48
|
+
/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(candidate));
|
|
49
|
+
case "toggle":
|
|
50
|
+
return typeof candidate === "boolean";
|
|
51
|
+
case "select":
|
|
52
|
+
return (typeof candidate === "string" &&
|
|
53
|
+
control.options.some((option) => option.value === candidate));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const annotationControls = z
|
|
57
|
+
.object({
|
|
58
|
+
controlsMode: z.literal("replace"),
|
|
59
|
+
controls: z.array(genUiAnnotationControlSchema).min(1).max(12),
|
|
60
|
+
})
|
|
61
|
+
.strict()
|
|
62
|
+
.superRefine((input, ctx) => {
|
|
63
|
+
const callbacks = new Set(input.controls.map((control) => control.callback));
|
|
64
|
+
if (callbacks.size !== input.controls.length ||
|
|
65
|
+
input.controls.some((control) => !isGenUiAnnotationValue(control, control.currentValue)) ||
|
|
66
|
+
JSON.stringify(input).length > 16384) {
|
|
67
|
+
ctx.addIssue({ code: "custom", message: "Invalid annotation controls" });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const target = z
|
|
71
|
+
.object({
|
|
72
|
+
id: z.string().min(1).max(128),
|
|
73
|
+
label: z.string().min(1).max(80),
|
|
74
|
+
selector: z.string().max(1024),
|
|
75
|
+
tagName: z.string().min(1).max(120),
|
|
76
|
+
rect: z
|
|
77
|
+
.object({
|
|
78
|
+
x: z.number().finite(),
|
|
79
|
+
y: z.number().finite(),
|
|
80
|
+
width: z.number().nonnegative(),
|
|
81
|
+
height: z.number().nonnegative(),
|
|
82
|
+
})
|
|
83
|
+
.strict(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
const registration = {
|
|
87
|
+
registrationId: z.string().min(1).max(128),
|
|
88
|
+
annotationControls,
|
|
89
|
+
targets: z.array(target).length(1),
|
|
90
|
+
};
|
|
91
|
+
export const genUiTweakMessageSchema = z.discriminatedUnion("type", [
|
|
92
|
+
z.object({ type: z.literal("register"), ...registration }).strict(),
|
|
93
|
+
z.object({ type: z.literal("update"), ...registration }).strict(),
|
|
94
|
+
z.object({ type: z.literal("dispose"), registrationId: registration.registrationId }).strict(),
|
|
95
|
+
z
|
|
96
|
+
.object({
|
|
97
|
+
type: z.literal("select"),
|
|
98
|
+
registrationId: registration.registrationId,
|
|
99
|
+
targetId: target.shape.id,
|
|
100
|
+
})
|
|
101
|
+
.strict(),
|
|
102
|
+
z.object({ type: z.literal("escape") }).strict(),
|
|
103
|
+
]);
|
|
104
|
+
export const genUiTweakResultSchema = z
|
|
105
|
+
.object({ annotationControls: annotationControls.optional() })
|
|
106
|
+
.strict();
|
|
107
|
+
export const genUiTweakAnnotationSchema = z
|
|
108
|
+
.object({
|
|
109
|
+
active: z.boolean(),
|
|
110
|
+
selection: z
|
|
111
|
+
.object({ registrationId: registration.registrationId, targetId: target.shape.id })
|
|
112
|
+
.nullable(),
|
|
113
|
+
changes: z
|
|
114
|
+
.array(z
|
|
115
|
+
.object({
|
|
116
|
+
registrationId: registration.registrationId,
|
|
117
|
+
targetId: target.shape.id,
|
|
118
|
+
annotationControlChanges: z
|
|
119
|
+
.array(z.object({ callback: base.callback, previousValue: value, value }).strict())
|
|
120
|
+
.max(12),
|
|
121
|
+
})
|
|
122
|
+
.strict())
|
|
123
|
+
.max(64),
|
|
124
|
+
})
|
|
125
|
+
.strict();
|
|
126
|
+
//# sourceMappingURL=tweakProtocol.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
declare const helpConfigSchema: z.ZodObject<{
|
|
3
3
|
community_urls: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
4
|
-
"
|
|
4
|
+
"fr-CA": z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
5
5
|
"en-US": z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
6
6
|
}, z.core.$strip>>>;
|
|
7
7
|
feedback_url: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
@@ -4,7 +4,7 @@ import { getCommunityUrlFromConfigs, getFeedbackUrlFromConfig } from "./remoteAp
|
|
|
4
4
|
const helpConfigSchema = z.object({
|
|
5
5
|
community_urls: z
|
|
6
6
|
.object({
|
|
7
|
-
"
|
|
7
|
+
"fr-CA": z.string().optional().catch(undefined),
|
|
8
8
|
"en-US": z.string().optional().catch(undefined),
|
|
9
9
|
})
|
|
10
10
|
.optional()
|
|
@@ -28,7 +28,7 @@ export function resolveHelpAppConfig(remote, local) {
|
|
|
28
28
|
const localConfig = helpConfigSchema.safeParse(local).data;
|
|
29
29
|
return {
|
|
30
30
|
community_urls: {
|
|
31
|
-
"
|
|
31
|
+
"fr-CA": getCommunityUrlFromConfigs(remoteConfig, localConfig, "fr-CA"),
|
|
32
32
|
"en-US": getCommunityUrlFromConfigs(remoteConfig, localConfig, "en-US"),
|
|
33
33
|
},
|
|
34
34
|
feedback_url: getFeedbackUrlFromConfig(remoteConfig) ?? getFeedbackUrlFromConfig(localConfig),
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type ModelExecutionSelectionFallback } from "./model-execution.js";
|
|
3
|
+
import type { ModelSelection } from "./model-selection.js";
|
|
4
|
+
/**
|
|
5
|
+
* 卡在 Turn 中过期时加速网关返回的业务错误码(HTTP 400 / provider_code=3402)。
|
|
6
|
+
* 见 docs/highspeed/highspeed-card-spec.md:命中它要保留上下文并退回原模型跑完本轮。
|
|
7
|
+
*/
|
|
8
|
+
export declare const HIGHSPEED_CARD_EXPIRED_PROVIDER_ERROR_CODE = "3402";
|
|
9
|
+
/**
|
|
10
|
+
* 加速卡的隐藏 Built-in Provider;端点与模型名单由 DCode Built-in Provider Config 提供
|
|
11
|
+
* (config/provider/dcode-builtin.json),这里只保留跨层引用的 ID。
|
|
12
|
+
* 与 Off-Peak 同规则按账号 Family 拆分:卡是对当前账号 Coding Plan 权益的抽取,
|
|
13
|
+
* 不跨 Family 静默迁移。
|
|
14
|
+
*/
|
|
15
|
+
export declare const HIGHSPEED_PROVIDER_IDS: {
|
|
16
|
+
readonly dcode: "account:dcode-highspeed-card";
|
|
17
|
+
readonly bigmodel: "account:bigmodel-highspeed-card";
|
|
18
|
+
};
|
|
19
|
+
export declare function resolveHighspeedProviderId(family: "dcode" | "bigmodel"): (typeof HIGHSPEED_PROVIDER_IDS)[typeof family];
|
|
20
|
+
/**
|
|
21
|
+
* 判定一次 Selection 是否指向加速卡 Provider。拆 Family 之后不能再和单个常量比较,
|
|
22
|
+
* 否则 BigModel 账号的卡在队列提升时会被判成「非加速」而静默丢卡。
|
|
23
|
+
*/
|
|
24
|
+
export declare function isHighspeedProviderId(providerId: string | undefined): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* draw body 的 provider 契约值:服务端 highspeed 白名单只认 Coding Plan 的 builtin 身份
|
|
27
|
+
* (builtin:dcode-coding-plan / builtin:bigmodel-coding-plan,2026-09-17 与服务端确认;
|
|
28
|
+
* 设计文档示例里的 "dcode" 是缩写示意,非线上取值)。Start Plan、Off-Peak、API Key 与
|
|
29
|
+
* 自定义 Provider 都不在白名单内,必须解析为 null 后降级,禁止映射后发送。
|
|
30
|
+
*/
|
|
31
|
+
export declare const HIGHSPEED_DRAW_PROVIDER_IDS: {
|
|
32
|
+
readonly dcode: "builtin:dcode-coding-plan";
|
|
33
|
+
readonly bigmodel: "builtin:bigmodel-coding-plan";
|
|
34
|
+
};
|
|
35
|
+
/** 把会话选择的 Provider ID 解析成 draw body 可用的白名单 provider 值;不命中返回 null。 */
|
|
36
|
+
export declare function resolveHighspeedDrawProviderId(providerId: string): string | null;
|
|
37
|
+
export declare const highspeedCardSchema: z.ZodObject<{
|
|
38
|
+
card_id: z.ZodString;
|
|
39
|
+
task_id: z.ZodString;
|
|
40
|
+
provider: z.ZodString;
|
|
41
|
+
model: z.ZodString;
|
|
42
|
+
issued_at: z.ZodNumber;
|
|
43
|
+
expires_at: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
/**
|
|
46
|
+
* 写入 message.data 的协议级卡快照。版本字段保证后续扩展仍能宽容读取旧消息。
|
|
47
|
+
*/
|
|
48
|
+
export declare const highspeedMessageMetaSchema: z.ZodObject<{
|
|
49
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
50
|
+
cardId: z.ZodString;
|
|
51
|
+
taskId: z.ZodString;
|
|
52
|
+
provider: z.ZodString;
|
|
53
|
+
model: z.ZodString;
|
|
54
|
+
issuedAt: z.ZodNumber;
|
|
55
|
+
expiresAt: z.ZodNumber;
|
|
56
|
+
regularTps: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
highspeedTps: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
savedDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
modelDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
toolDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
otherDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
fallbackAt: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
fallbackReason: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
highspeed_card_expired: "highspeed_card_expired";
|
|
67
|
+
highspeed_request_failed: "highspeed_request_failed";
|
|
68
|
+
}>>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export declare const highspeedDrawRequestSchema: z.ZodObject<{
|
|
71
|
+
task_id: z.ZodString;
|
|
72
|
+
provider: z.ZodString;
|
|
73
|
+
model: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export declare const highspeedDrawResponseSchema: z.ZodObject<{
|
|
76
|
+
code: z.ZodNumber;
|
|
77
|
+
msg: z.ZodString;
|
|
78
|
+
data: z.ZodObject<{
|
|
79
|
+
card: z.ZodNullable<z.ZodObject<{
|
|
80
|
+
card_id: z.ZodString;
|
|
81
|
+
task_id: z.ZodString;
|
|
82
|
+
provider: z.ZodString;
|
|
83
|
+
model: z.ZodString;
|
|
84
|
+
issued_at: z.ZodNumber;
|
|
85
|
+
expires_at: z.ZodNumber;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
next_draw_at: z.ZodNumber;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export declare const highspeedHealthyResponseSchema: z.ZodObject<{
|
|
91
|
+
code: z.ZodNumber;
|
|
92
|
+
msg: z.ZodString;
|
|
93
|
+
data: z.ZodObject<{
|
|
94
|
+
card_id: z.ZodString;
|
|
95
|
+
prompt_tokens: z.ZodNumber;
|
|
96
|
+
completion_tokens: z.ZodNumber;
|
|
97
|
+
duration_seconds: z.ZodNumber;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type HighspeedCardApi = z.infer<typeof highspeedCardSchema>;
|
|
101
|
+
export type HighspeedMessageMeta = z.infer<typeof highspeedMessageMetaSchema>;
|
|
102
|
+
export type HighspeedDrawRequest = z.infer<typeof highspeedDrawRequestSchema>;
|
|
103
|
+
export type HighspeedDrawResponse = z.infer<typeof highspeedDrawResponseSchema>;
|
|
104
|
+
export type HighspeedHealthyResponse = z.infer<typeof highspeedHealthyResponseSchema>;
|
|
105
|
+
export interface HighspeedCardUsage {
|
|
106
|
+
cardId: string;
|
|
107
|
+
promptTokens: number;
|
|
108
|
+
completionTokens: number;
|
|
109
|
+
durationSeconds: number;
|
|
110
|
+
}
|
|
111
|
+
export interface HighspeedCardSnapshot {
|
|
112
|
+
cardId: string;
|
|
113
|
+
taskId: string;
|
|
114
|
+
provider: string;
|
|
115
|
+
model: string;
|
|
116
|
+
issuedAt: number;
|
|
117
|
+
expiresAt: number;
|
|
118
|
+
regularTps?: number;
|
|
119
|
+
}
|
|
120
|
+
export type HighspeedPrepareFallbackReason = "automation" | "cooldown" | "draw-miss" | "draw-timeout" | "expired" | "foreign-card" | "no-coding-plan" | "unavailable";
|
|
121
|
+
export interface HighspeedPrepareTurnParams {
|
|
122
|
+
taskId: string;
|
|
123
|
+
/**
|
|
124
|
+
* 会话模型选择的 Provider ID。draw body 的 provider 契约是白名单里的 Coding Plan
|
|
125
|
+
* builtin 身份(builtin:dcode-coding-plan / builtin:bigmodel-coding-plan),由服务层
|
|
126
|
+
* 发送前解析;调用方禁止直接传白名单值或把完整 providerId 透传上链路
|
|
127
|
+
* (透传会被服务端白名单拒绝并返回 3001 参数错误)。
|
|
128
|
+
*/
|
|
129
|
+
providerId: string;
|
|
130
|
+
/**
|
|
131
|
+
* 会话当前选择的模型。除 provider 白名单外,模型还必须属于所选 Coding Plan Provider 的
|
|
132
|
+
* 模型目录(Built-in Provider Config 投影)才会发起新 draw;陈旧的 (coding-plan provider,
|
|
133
|
+
* 已下线模型) 组合按 unavailable 降级(spec §3 规则 14)。
|
|
134
|
+
*/
|
|
135
|
+
model: string;
|
|
136
|
+
/**
|
|
137
|
+
* 会话当前生效的思考档位。加速只换端点不换模型,卡的 modelSelection 必须带上与会话
|
|
138
|
+
* 一致的 reasoningLevel;否则 CLI Registry 会因 execution 选择缺档位判定
|
|
139
|
+
* reasoning-level-missing,抛出 "Reasoning level is required" 让整轮发送失败。
|
|
140
|
+
* 模型无思考档位时省略(不写 options)。
|
|
141
|
+
*/
|
|
142
|
+
reasoningLevel?: string;
|
|
143
|
+
/** 仅表示本轮由 Automation 派发;不得用 Task 上粘性的 cronAutomationId 代替。 */
|
|
144
|
+
automationId?: string;
|
|
145
|
+
waitBudgetMs?: number;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 单轮加速执行材料。静态事实(端点、API 形态、模型能力)由 Built-in Provider Config
|
|
149
|
+
* 提供,这里只携带「本轮选哪个模型」和「本次执行的动态鉴权」,禁止再下发 provider 定义。
|
|
150
|
+
*/
|
|
151
|
+
export interface HighspeedTurnExecution {
|
|
152
|
+
modelSelection: ModelSelection;
|
|
153
|
+
requestAuth: {
|
|
154
|
+
apiKey: string;
|
|
155
|
+
headers: Record<string, string>;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* 加速请求任何失败时退回原模型跑完本轮;卡过期(3402)与其他失败按规则给出不同原因。
|
|
159
|
+
* 退回目标 `target` 是抽卡时的提交选择(会话原模型 + 档位),CLI 优先用它,缺省才退回会话常驻选择。
|
|
160
|
+
*/
|
|
161
|
+
selectionFallback: ModelExecutionSelectionFallback;
|
|
162
|
+
}
|
|
163
|
+
export type HighspeedPrepareTurnResult = {
|
|
164
|
+
kind: "accelerated";
|
|
165
|
+
card: HighspeedCardSnapshot;
|
|
166
|
+
nextDrawAt: number;
|
|
167
|
+
/** Mock 只保留加速业务语义,省略该字段即可继续使用 session 普通推理路由。 */
|
|
168
|
+
execution?: HighspeedTurnExecution;
|
|
169
|
+
} | {
|
|
170
|
+
kind: "fallback";
|
|
171
|
+
reason: HighspeedPrepareFallbackReason;
|
|
172
|
+
card?: HighspeedCardSnapshot;
|
|
173
|
+
nextDrawAt: number | null;
|
|
174
|
+
};
|
|
175
|
+
export interface HighspeedServiceSnapshot {
|
|
176
|
+
card: HighspeedCardSnapshot | null;
|
|
177
|
+
nextDrawAt: number | null;
|
|
178
|
+
drawing: boolean;
|
|
179
|
+
}
|
|
180
|
+
export type HighspeedMockScenario = "hit-fast" | "miss" | "hit-after-timeout" | "existing-foreign-task-card" | "expired-card";
|
|
181
|
+
//# sourceMappingURL=highspeed.d.ts.map
|