@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,42 @@
|
|
|
1
|
+
export interface ProjectAccessTokenInput {
|
|
2
|
+
readonly rejectedProjectTokenFingerprint?: string;
|
|
3
|
+
readonly origin: string;
|
|
4
|
+
readonly family: "bigmodel" | "dcode";
|
|
5
|
+
readonly loginToken: string;
|
|
6
|
+
readonly accountId: string;
|
|
7
|
+
/** 保留各调用端既有项目选择;CLI 默认项目不排除团队类型。 */
|
|
8
|
+
readonly personalProjectSelection?: "non-team" | "default";
|
|
9
|
+
readonly team?: {
|
|
10
|
+
readonly organizationId: string;
|
|
11
|
+
readonly projectId: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ProjectAccessTokenMaterial {
|
|
15
|
+
readonly token: string;
|
|
16
|
+
readonly apiKeyId: string;
|
|
17
|
+
readonly organizationId: string;
|
|
18
|
+
readonly projectId: string;
|
|
19
|
+
}
|
|
20
|
+
/** Host/CLI 各自持有实例;网络由已有 adapter 注入,凭据不进入配置或磁盘。 */
|
|
21
|
+
export declare class ProjectAccessTokenClient {
|
|
22
|
+
#private;
|
|
23
|
+
private readonly options;
|
|
24
|
+
constructor(options: {
|
|
25
|
+
request(url: string, init: RequestInit): Promise<unknown>;
|
|
26
|
+
observe?(event: {
|
|
27
|
+
family: string;
|
|
28
|
+
stage: "resolve";
|
|
29
|
+
code: string;
|
|
30
|
+
}): void;
|
|
31
|
+
locationStore?: {
|
|
32
|
+
load(key: string): Promise<string | null>;
|
|
33
|
+
save(key: string, value: string): Promise<void>;
|
|
34
|
+
delete(key: string): Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
now?: () => number;
|
|
37
|
+
random?: () => number;
|
|
38
|
+
});
|
|
39
|
+
clear(): void;
|
|
40
|
+
resolve(input: ProjectAccessTokenInput): Promise<ProjectAccessTokenMaterial>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=project-access-token-client.d.ts.map
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { projectTokenSuccessCodeSchema } from "./project-access-token-response.js";
|
|
3
|
+
import { API_KEY_USAGE_SCENE } from "./api-key-usage-scene.js";
|
|
4
|
+
import { ProjectAccessTokenCache, ProjectAccessTokenError } from "./project-access-token.js";
|
|
5
|
+
import { DCODE_VERSION } from "./version.js";
|
|
6
|
+
const DEFAULT_ORGANIZATION_NAME = "默认机构";
|
|
7
|
+
const DEFAULT_PROJECT_NAME = "默认项目";
|
|
8
|
+
const customerSchema = z.object({
|
|
9
|
+
organizations: z
|
|
10
|
+
.array(z.object({
|
|
11
|
+
organizationId: z.string(),
|
|
12
|
+
organizationName: z.string().nullish(),
|
|
13
|
+
projects: z
|
|
14
|
+
.array(z.object({
|
|
15
|
+
projectId: z.string(),
|
|
16
|
+
projectName: z.string().nullish(),
|
|
17
|
+
projectType: z.union([z.string(), z.number()]).nullish(),
|
|
18
|
+
}))
|
|
19
|
+
.default([]),
|
|
20
|
+
}))
|
|
21
|
+
.default([]),
|
|
22
|
+
});
|
|
23
|
+
const keySchema = z.object({
|
|
24
|
+
apiKey: z.string().trim().min(1),
|
|
25
|
+
name: z.string().nullish(),
|
|
26
|
+
keyType: z.number().nullish(),
|
|
27
|
+
});
|
|
28
|
+
const envelopeSchema = z.object({
|
|
29
|
+
code: projectTokenSuccessCodeSchema,
|
|
30
|
+
data: z.unknown(),
|
|
31
|
+
});
|
|
32
|
+
const locationSchema = z.object({
|
|
33
|
+
organizationId: z.string().min(1),
|
|
34
|
+
projectId: z.string().min(1),
|
|
35
|
+
apiKeyId: z.string().min(1),
|
|
36
|
+
});
|
|
37
|
+
/** Host/CLI 各自持有实例;网络由已有 adapter 注入,凭据不进入配置或磁盘。 */
|
|
38
|
+
export class ProjectAccessTokenClient {
|
|
39
|
+
options;
|
|
40
|
+
#sessions = new Map();
|
|
41
|
+
#generation = 0;
|
|
42
|
+
constructor(options) {
|
|
43
|
+
this.options = options;
|
|
44
|
+
}
|
|
45
|
+
clear() {
|
|
46
|
+
for (const session of this.#sessions.values())
|
|
47
|
+
session.cache.clear();
|
|
48
|
+
this.#sessions.clear();
|
|
49
|
+
}
|
|
50
|
+
async resolve(input) {
|
|
51
|
+
const origin = new URL(input.origin).origin;
|
|
52
|
+
const loginToken = input.loginToken.trim().replace(/^Bearer\s+/i, "");
|
|
53
|
+
if (!loginToken || !input.accountId.trim())
|
|
54
|
+
throw new Error("project_token_login_required");
|
|
55
|
+
const sessionKey = JSON.stringify([origin, input.family]);
|
|
56
|
+
let session = this.#sessions.get(sessionKey);
|
|
57
|
+
if (!session || session.token !== loginToken) {
|
|
58
|
+
session?.cache.clear();
|
|
59
|
+
session = {
|
|
60
|
+
token: loginToken,
|
|
61
|
+
generation: String(++this.#generation),
|
|
62
|
+
locations: new Map(),
|
|
63
|
+
cache: new ProjectAccessTokenCache({
|
|
64
|
+
now: this.options.now,
|
|
65
|
+
random: this.options.random,
|
|
66
|
+
onRefreshDeferred: () => this.options.observe?.({
|
|
67
|
+
family: input.family,
|
|
68
|
+
stage: "resolve",
|
|
69
|
+
code: "project_token_refresh_deferred",
|
|
70
|
+
}),
|
|
71
|
+
}),
|
|
72
|
+
};
|
|
73
|
+
this.#sessions.set(sessionKey, session);
|
|
74
|
+
}
|
|
75
|
+
const current = session;
|
|
76
|
+
const assertCurrent = () => {
|
|
77
|
+
if (this.#sessions.get(sessionKey) !== current)
|
|
78
|
+
throw new ProjectAccessTokenError("project_token_scope_invalidated");
|
|
79
|
+
};
|
|
80
|
+
const headers = {
|
|
81
|
+
Authorization: `Bearer ${loginToken}`,
|
|
82
|
+
"Content-Type": "application/json",
|
|
83
|
+
};
|
|
84
|
+
const request = async (url, init) => {
|
|
85
|
+
assertCurrent();
|
|
86
|
+
const result = await this.options.request(url, init);
|
|
87
|
+
assertCurrent();
|
|
88
|
+
return result;
|
|
89
|
+
};
|
|
90
|
+
try {
|
|
91
|
+
const selection = input.team ? null : (input.personalProjectSelection ?? "non-team");
|
|
92
|
+
const locationKey = JSON.stringify([input.accountId, input.team ?? null, selection]);
|
|
93
|
+
const storageKey = `project-key-location:v1:${encodeURIComponent(JSON.stringify([origin, input.family, input.accountId, input.team ?? null, API_KEY_USAGE_SCENE.CODING_PLAN, selection]))}`;
|
|
94
|
+
let pending = current.locations.get(locationKey);
|
|
95
|
+
if (!pending) {
|
|
96
|
+
pending = (async () => {
|
|
97
|
+
const saved = await this.options.locationStore?.load(storageKey);
|
|
98
|
+
assertCurrent();
|
|
99
|
+
if (saved) {
|
|
100
|
+
let parsed;
|
|
101
|
+
try {
|
|
102
|
+
parsed = JSON.parse(saved);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
/* 损坏记录通过正常元数据流程重建。 */
|
|
106
|
+
}
|
|
107
|
+
const value = locationSchema.safeParse(parsed);
|
|
108
|
+
if (value.success &&
|
|
109
|
+
(!input.team ||
|
|
110
|
+
(value.data.organizationId === input.team.organizationId &&
|
|
111
|
+
value.data.projectId === input.team.projectId)))
|
|
112
|
+
return value.data;
|
|
113
|
+
}
|
|
114
|
+
const result = await this.#resolveLocation(input, origin, loginToken, request);
|
|
115
|
+
assertCurrent();
|
|
116
|
+
await this.options.locationStore?.save(storageKey, JSON.stringify(result));
|
|
117
|
+
assertCurrent();
|
|
118
|
+
return result;
|
|
119
|
+
})();
|
|
120
|
+
current.locations.set(locationKey, pending);
|
|
121
|
+
void pending.catch(() => {
|
|
122
|
+
if (current.locations.get(locationKey) === pending)
|
|
123
|
+
current.locations.delete(locationKey);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const location = await pending;
|
|
127
|
+
assertCurrent();
|
|
128
|
+
const value = await current.cache.resolve({
|
|
129
|
+
origin,
|
|
130
|
+
family: input.family,
|
|
131
|
+
accountId: input.accountId,
|
|
132
|
+
...location,
|
|
133
|
+
usageScene: API_KEY_USAGE_SCENE.CODING_PLAN,
|
|
134
|
+
loginGeneration: current.generation,
|
|
135
|
+
}, async () => {
|
|
136
|
+
const raw = await request(`${keyListUrl(origin, location)}/${encodeURIComponent(location.apiKeyId)}/access_tokens`, {
|
|
137
|
+
method: "POST",
|
|
138
|
+
headers,
|
|
139
|
+
body: JSON.stringify({
|
|
140
|
+
clientType: "dcode",
|
|
141
|
+
clientVersion: DCODE_VERSION,
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
144
|
+
// 仅明确不存在才废弃 ID;权限/网络/开关错误不能触发创建或 Key 回退。
|
|
145
|
+
if (raw && typeof raw === "object" && "code" in raw && raw.code === 404) {
|
|
146
|
+
current.locations.delete(locationKey);
|
|
147
|
+
await this.options.locationStore?.delete(storageKey);
|
|
148
|
+
}
|
|
149
|
+
return raw;
|
|
150
|
+
}, input.rejectedProjectTokenFingerprint);
|
|
151
|
+
assertCurrent();
|
|
152
|
+
if (!value.enabled)
|
|
153
|
+
throw new Error("project_token_disabled");
|
|
154
|
+
return { token: value.token, ...location };
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
// 上游错误体或网络异常可能携带凭据;只传播固定错误码,不保留原始 cause/message。
|
|
158
|
+
const code = error instanceof ProjectAccessTokenError
|
|
159
|
+
? error.code
|
|
160
|
+
: error instanceof Error &&
|
|
161
|
+
[
|
|
162
|
+
"project_token_disabled",
|
|
163
|
+
"project_token_project_unavailable",
|
|
164
|
+
"project_token_invalid_response",
|
|
165
|
+
].includes(error.message)
|
|
166
|
+
? error.message
|
|
167
|
+
: "project_token_request_failed";
|
|
168
|
+
this.options.observe?.({ family: input.family, stage: "resolve", code });
|
|
169
|
+
throw new Error(code);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async #resolveLocation(input, origin, loginToken, request) {
|
|
173
|
+
// 管理接口沿用旧鉴权格式;不能把签发端的 Bearer 约定扩散到所有端点。
|
|
174
|
+
const headers = {
|
|
175
|
+
Authorization: input.family === "dcode" ? `Bearer ${loginToken}` : loginToken,
|
|
176
|
+
"Content-Type": "application/json",
|
|
177
|
+
};
|
|
178
|
+
const customer = customerSchema.safeParse(readData(await request(`${origin}/api/biz/customer/getCustomerInfo`, {
|
|
179
|
+
method: "GET",
|
|
180
|
+
headers,
|
|
181
|
+
})));
|
|
182
|
+
if (!customer.success)
|
|
183
|
+
throw new Error("project_token_invalid_response");
|
|
184
|
+
const organizations = customer.data.organizations;
|
|
185
|
+
let location = input.team;
|
|
186
|
+
if (location) {
|
|
187
|
+
if (!organizations.some((org) => org.organizationId.trim() === location.organizationId.trim() &&
|
|
188
|
+
org.projects.some((p) => p.projectId.trim() === location.projectId.trim())))
|
|
189
|
+
throw new Error("project_token_project_unavailable");
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const personal = input.personalProjectSelection === "default"
|
|
193
|
+
? organizations
|
|
194
|
+
: organizations
|
|
195
|
+
.map((org) => ({
|
|
196
|
+
...org,
|
|
197
|
+
projects: org.projects.filter((p) => String(p.projectType ?? "").trim() !== "2"),
|
|
198
|
+
}))
|
|
199
|
+
.filter((org) => org.organizationId && org.projects.length);
|
|
200
|
+
const org = personal.find((org) => org.organizationName?.includes(DEFAULT_ORGANIZATION_NAME)) ??
|
|
201
|
+
personal[0];
|
|
202
|
+
const project = org?.projects.find((p) => p.projectName?.includes(DEFAULT_PROJECT_NAME)) ??
|
|
203
|
+
org?.projects[0];
|
|
204
|
+
if (!org?.organizationId || !project?.projectId)
|
|
205
|
+
throw new Error("project_token_project_unavailable");
|
|
206
|
+
location = {
|
|
207
|
+
organizationId: org.organizationId,
|
|
208
|
+
projectId: project.projectId,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const url = keyListUrl(origin, location);
|
|
212
|
+
const name = input.team ? "dcode-team-api-key" : "dcode-api-key";
|
|
213
|
+
const keyHeaders = input.team
|
|
214
|
+
? {
|
|
215
|
+
...headers,
|
|
216
|
+
Authorization: loginToken,
|
|
217
|
+
"bigmodel-organization": location.organizationId,
|
|
218
|
+
"bigmodel-project": location.projectId,
|
|
219
|
+
}
|
|
220
|
+
: headers;
|
|
221
|
+
const list = z
|
|
222
|
+
.array(z.unknown())
|
|
223
|
+
.safeParse(readData(await request(url, { method: "GET", headers: keyHeaders })));
|
|
224
|
+
if (!list.success)
|
|
225
|
+
throw new Error("project_token_invalid_response");
|
|
226
|
+
// 列表可能含无关坏条目。个人同名条目缺 ID 时禁止重复创建;团队只复用有效条目。
|
|
227
|
+
const candidate = list.data.find((entry) => {
|
|
228
|
+
if (!entry || typeof entry !== "object" || !("name" in entry) || entry.name !== name)
|
|
229
|
+
return false;
|
|
230
|
+
if (!input.team)
|
|
231
|
+
return true;
|
|
232
|
+
const parsed = keySchema.safeParse(entry);
|
|
233
|
+
return parsed.success && parsed.data.keyType === 2;
|
|
234
|
+
});
|
|
235
|
+
const rawKey = candidate ??
|
|
236
|
+
readData(await request(url, {
|
|
237
|
+
method: "POST",
|
|
238
|
+
headers: keyHeaders,
|
|
239
|
+
body: JSON.stringify({
|
|
240
|
+
name,
|
|
241
|
+
...(input.team ? { keyType: 2 } : {}),
|
|
242
|
+
usageScene: API_KEY_USAGE_SCENE.CODING_PLAN,
|
|
243
|
+
}),
|
|
244
|
+
}));
|
|
245
|
+
const key = keySchema.safeParse(rawKey);
|
|
246
|
+
if (!key.success || (input.team && (key.data.name !== name || key.data.keyType !== 2)))
|
|
247
|
+
throw new Error("project_token_invalid_response");
|
|
248
|
+
return { ...location, apiKeyId: key.data.apiKey };
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function keyListUrl(origin, location) {
|
|
252
|
+
return `${origin}/api/biz/v1/organization/${encodeURIComponent(location.organizationId)}/projects/${encodeURIComponent(location.projectId)}/api_keys`;
|
|
253
|
+
}
|
|
254
|
+
function readData(raw) {
|
|
255
|
+
const value = envelopeSchema.safeParse(raw);
|
|
256
|
+
if (!value.success)
|
|
257
|
+
throw new Error("project_token_invalid_response");
|
|
258
|
+
return value.data.data;
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=project-access-token-client.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** BigModel/DipoleML 管理及 PAT 签发共用的成功 envelope 码;不放宽 Token 内容校验。 */
|
|
3
|
+
export declare const projectTokenSuccessCodeSchema: z.ZodUnion<readonly [z.ZodLiteral<200>, z.ZodLiteral<0>, z.ZodLiteral<"200">, z.ZodLiteral<"0">]>;
|
|
4
|
+
//# sourceMappingURL=project-access-token-response.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** BigModel/DipoleML 管理及 PAT 签发共用的成功 envelope 码;不放宽 Token 内容校验。 */
|
|
3
|
+
export const projectTokenSuccessCodeSchema = z.union([
|
|
4
|
+
z.literal(200),
|
|
5
|
+
z.literal(0),
|
|
6
|
+
z.literal("200"),
|
|
7
|
+
z.literal("0"),
|
|
8
|
+
]);
|
|
9
|
+
//# sourceMappingURL=project-access-token-response.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ApiKeyCreationUsageScene } from "./api-key-usage-scene.js";
|
|
2
|
+
export interface ProjectAccessTokenScope {
|
|
3
|
+
readonly origin: string;
|
|
4
|
+
readonly family: "bigmodel" | "dcode";
|
|
5
|
+
readonly accountId: string;
|
|
6
|
+
readonly organizationId: string;
|
|
7
|
+
readonly projectId: string;
|
|
8
|
+
readonly apiKeyId: string;
|
|
9
|
+
readonly usageScene: ApiKeyCreationUsageScene;
|
|
10
|
+
/** 登录生命周期标识,不能使用 Token 原文或短期 Token 的哈希。 */
|
|
11
|
+
readonly loginGeneration: string;
|
|
12
|
+
}
|
|
13
|
+
export type ProjectAccessTokenResult = {
|
|
14
|
+
readonly enabled: false;
|
|
15
|
+
} | {
|
|
16
|
+
readonly enabled: true;
|
|
17
|
+
readonly token: string;
|
|
18
|
+
readonly expiresAt: number;
|
|
19
|
+
};
|
|
20
|
+
export declare class ProjectAccessTokenError extends Error {
|
|
21
|
+
readonly code: "project_token_invalid_response" | "project_token_scope_invalidated";
|
|
22
|
+
constructor(code: "project_token_invalid_response" | "project_token_scope_invalidated");
|
|
23
|
+
}
|
|
24
|
+
/** I/O adapter 确认的临时故障;不携带原始响应、URL、Token 或 cause。 */
|
|
25
|
+
export declare class ProjectAccessTokenTransientError extends Error {
|
|
26
|
+
constructor();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 账号鉴权 owner 的纯内存状态,不含网络、存储、定时器或全局单例。
|
|
30
|
+
* Host 和 Standalone 分别持有实例;签发由其已有 I/O adapter 注入。
|
|
31
|
+
*/
|
|
32
|
+
export declare class ProjectAccessTokenCache {
|
|
33
|
+
#private;
|
|
34
|
+
constructor(options?: {
|
|
35
|
+
now?: () => number;
|
|
36
|
+
random?: () => number;
|
|
37
|
+
onRefreshDeferred?: () => void;
|
|
38
|
+
});
|
|
39
|
+
resolve(scope: ProjectAccessTokenScope, issue: () => Promise<unknown>, rejectedFingerprint?: string): Promise<ProjectAccessTokenResult>;
|
|
40
|
+
invalidate(scope: ProjectAccessTokenScope): void;
|
|
41
|
+
clear(): void;
|
|
42
|
+
}
|
|
43
|
+
/** 仅用于拒绝某一代 PAT 的比较,不作为账号身份,也不传给模型上游。 */
|
|
44
|
+
export declare function projectAccessTokenFingerprint(token: string): Promise<string>;
|
|
45
|
+
//# sourceMappingURL=project-access-token.d.ts.map
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { projectTokenSuccessCodeSchema } from "./project-access-token-response.js";
|
|
3
|
+
const SECOND_MS = 1_000;
|
|
4
|
+
const REFRESH_LEAD_MS = 120 * SECOND_MS;
|
|
5
|
+
const REFRESH_JITTER_MS = 60 * SECOND_MS;
|
|
6
|
+
const REFRESH_RETRY_BACKOFF_MS = 5 * SECOND_MS;
|
|
7
|
+
const responseSchema = z.preprocess((raw) => {
|
|
8
|
+
if (raw &&
|
|
9
|
+
typeof raw === "object" &&
|
|
10
|
+
"data" in raw &&
|
|
11
|
+
raw.data &&
|
|
12
|
+
typeof raw.data === "object" &&
|
|
13
|
+
!("enable" in raw.data)) {
|
|
14
|
+
return { ...raw, data: { ...raw.data, enable: true } };
|
|
15
|
+
}
|
|
16
|
+
return raw;
|
|
17
|
+
}, z.object({
|
|
18
|
+
code: projectTokenSuccessCodeSchema,
|
|
19
|
+
data: z.discriminatedUnion("enable", [
|
|
20
|
+
z.object({ enable: z.literal(false) }),
|
|
21
|
+
z.object({
|
|
22
|
+
enable: z.literal(true),
|
|
23
|
+
accessToken: z.string().trim().min(1),
|
|
24
|
+
tokenType: z.literal("Bearer"),
|
|
25
|
+
expiresIn: z.number().finite().positive(),
|
|
26
|
+
expiresAt: z.number().finite().positive(),
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
}));
|
|
30
|
+
export class ProjectAccessTokenError extends Error {
|
|
31
|
+
code;
|
|
32
|
+
constructor(code) {
|
|
33
|
+
// 响应包含凭据;不把 zod issues、原始响应或 Token 放进异常/日志。
|
|
34
|
+
super(code);
|
|
35
|
+
this.code = code;
|
|
36
|
+
this.name = "ProjectAccessTokenError";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** I/O adapter 确认的临时故障;不携带原始响应、URL、Token 或 cause。 */
|
|
40
|
+
export class ProjectAccessTokenTransientError extends Error {
|
|
41
|
+
constructor() {
|
|
42
|
+
super("project_token_transient_failure");
|
|
43
|
+
this.name = "ProjectAccessTokenTransientError";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 账号鉴权 owner 的纯内存状态,不含网络、存储、定时器或全局单例。
|
|
48
|
+
* Host 和 Standalone 分别持有实例;签发由其已有 I/O adapter 注入。
|
|
49
|
+
*/
|
|
50
|
+
export class ProjectAccessTokenCache {
|
|
51
|
+
#entries = new Map();
|
|
52
|
+
#now;
|
|
53
|
+
#random;
|
|
54
|
+
#onRefreshDeferred;
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this.#now = options.now ?? Date.now;
|
|
57
|
+
this.#random = options.random ?? Math.random;
|
|
58
|
+
this.#onRefreshDeferred = options.onRefreshDeferred;
|
|
59
|
+
}
|
|
60
|
+
async resolve(scope, issue, rejectedFingerprint) {
|
|
61
|
+
const key = scopeKey(scope);
|
|
62
|
+
let entry = this.#entries.get(key);
|
|
63
|
+
// 仅清理被拒绝的那一代 PAT;迟到的 401 不得废弃新凭据或打断正在进行的换证。
|
|
64
|
+
if (rejectedFingerprint && entry?.fingerprint === rejectedFingerprint) {
|
|
65
|
+
entry.value = undefined;
|
|
66
|
+
entry.refreshAt = undefined;
|
|
67
|
+
}
|
|
68
|
+
if (entry?.pending)
|
|
69
|
+
return entry.pending;
|
|
70
|
+
if (entry?.value && this.#now() < Math.min(entry.refreshAt, entry.value.expiresAt)) {
|
|
71
|
+
return entry.value;
|
|
72
|
+
}
|
|
73
|
+
if (!entry) {
|
|
74
|
+
entry = {};
|
|
75
|
+
this.#entries.set(key, entry);
|
|
76
|
+
}
|
|
77
|
+
const current = entry;
|
|
78
|
+
const startedAt = this.#now();
|
|
79
|
+
// 延迟到微任务执行签发,先登记 pending,确保同步重入也只生成一个请求。
|
|
80
|
+
const pending = Promise.resolve()
|
|
81
|
+
.then(() => {
|
|
82
|
+
// 退出可能先于签发微任务发生;此时连旧登录态的网络请求也不得发出。
|
|
83
|
+
if (this.#entries.get(key) !== current) {
|
|
84
|
+
throw new ProjectAccessTokenError("project_token_scope_invalidated");
|
|
85
|
+
}
|
|
86
|
+
return issue();
|
|
87
|
+
})
|
|
88
|
+
.then(async (raw) => {
|
|
89
|
+
if (this.#entries.get(key) !== current) {
|
|
90
|
+
throw new ProjectAccessTokenError("project_token_scope_invalidated");
|
|
91
|
+
}
|
|
92
|
+
const response = responseSchema.safeParse(raw);
|
|
93
|
+
if (!response.success)
|
|
94
|
+
throw new ProjectAccessTokenError("project_token_invalid_response");
|
|
95
|
+
const data = response.data.data;
|
|
96
|
+
if (!data.enable) {
|
|
97
|
+
this.#entries.delete(key);
|
|
98
|
+
return Object.freeze({ enabled: false });
|
|
99
|
+
}
|
|
100
|
+
// expiresIn 从发出签发请求时保守起算,不能把网络耗时变成额外有效期。
|
|
101
|
+
const expiresAt = Math.min(data.expiresAt * SECOND_MS, startedAt + data.expiresIn * SECOND_MS);
|
|
102
|
+
if (!Number.isFinite(expiresAt) || expiresAt <= this.#now()) {
|
|
103
|
+
throw new ProjectAccessTokenError("project_token_invalid_response");
|
|
104
|
+
}
|
|
105
|
+
const jitter = Math.max(0, Math.min(1, this.#random())) * REFRESH_JITTER_MS;
|
|
106
|
+
const fingerprint = await projectAccessTokenFingerprint(data.accessToken);
|
|
107
|
+
if (this.#entries.get(key) !== current)
|
|
108
|
+
throw new ProjectAccessTokenError("project_token_scope_invalidated");
|
|
109
|
+
current.fingerprint = fingerprint;
|
|
110
|
+
current.value = Object.freeze({
|
|
111
|
+
enabled: true,
|
|
112
|
+
token: data.accessToken,
|
|
113
|
+
expiresAt,
|
|
114
|
+
});
|
|
115
|
+
current.refreshAt = expiresAt - REFRESH_LEAD_MS - jitter;
|
|
116
|
+
return current.value;
|
|
117
|
+
})
|
|
118
|
+
.catch((error) => {
|
|
119
|
+
if (this.#entries.get(key) !== current)
|
|
120
|
+
throw new ProjectAccessTokenError("project_token_scope_invalidated");
|
|
121
|
+
// 只保留仍有效且未被 401 指纹清除的 PAT;认证拒绝和格式错误必须失败。
|
|
122
|
+
// 降级属于同一个 pending,使所有并发调用获得一致结果,不延长原有效期。
|
|
123
|
+
if (error instanceof ProjectAccessTokenTransientError &&
|
|
124
|
+
current.value &&
|
|
125
|
+
this.#now() < current.value.expiresAt) {
|
|
126
|
+
current.refreshAt = Math.min(this.#now() + REFRESH_RETRY_BACKOFF_MS, current.value.expiresAt);
|
|
127
|
+
this.#onRefreshDeferred?.();
|
|
128
|
+
return current.value;
|
|
129
|
+
}
|
|
130
|
+
this.#entries.delete(key);
|
|
131
|
+
throw error;
|
|
132
|
+
})
|
|
133
|
+
.finally(() => {
|
|
134
|
+
if (current.pending === pending)
|
|
135
|
+
current.pending = undefined;
|
|
136
|
+
});
|
|
137
|
+
current.pending = pending;
|
|
138
|
+
return pending;
|
|
139
|
+
}
|
|
140
|
+
invalidate(scope) {
|
|
141
|
+
this.#entries.delete(scopeKey(scope));
|
|
142
|
+
}
|
|
143
|
+
clear() {
|
|
144
|
+
this.#entries.clear();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/** 仅用于拒绝某一代 PAT 的比较,不作为账号身份,也不传给模型上游。 */
|
|
148
|
+
export async function projectAccessTokenFingerprint(token) {
|
|
149
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(token));
|
|
150
|
+
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
151
|
+
}
|
|
152
|
+
function scopeKey(scope) {
|
|
153
|
+
return JSON.stringify([
|
|
154
|
+
scope.origin,
|
|
155
|
+
scope.family,
|
|
156
|
+
scope.accountId,
|
|
157
|
+
scope.organizationId,
|
|
158
|
+
scope.projectId,
|
|
159
|
+
scope.apiKeyId,
|
|
160
|
+
scope.usageScene,
|
|
161
|
+
scope.loginGeneration,
|
|
162
|
+
]);
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=project-access-token.js.map
|
|
@@ -2,7 +2,9 @@ import type { RemoteAssetInstallMode } from "./remoteAssetInstallMode.js";
|
|
|
2
2
|
import type { RemoteResourcePackageSelection } from "./remoteResourcePackages.js";
|
|
3
3
|
import type { ProviderFamilyDomain } from "./model-provider-family.js";
|
|
4
4
|
import type { ProviderFamilyConnectionSelectionSettings } from "./provider-family-connection-selection.js";
|
|
5
|
+
import type { DCodeProvider } from "./dcode-task-types-core.js";
|
|
5
6
|
import type { WorkspacePurpose } from "./workspacePurpose.js";
|
|
7
|
+
import type { DynamicWorkflowMode } from "./dynamic-workflow-feature.js";
|
|
6
8
|
import type { EmbeddedBrowserViewportPreference } from "./browser-use/command-metadata.js";
|
|
7
9
|
export interface FileEntry {
|
|
8
10
|
name: string;
|
|
@@ -59,8 +61,8 @@ export interface SystemInfo {
|
|
|
59
61
|
homedir: string;
|
|
60
62
|
platform: string;
|
|
61
63
|
}
|
|
62
|
-
/**
|
|
63
|
-
export type Locale = "
|
|
64
|
+
/** 支持的语言(DipoleML 品牌语言面:英语 + 法语) */
|
|
65
|
+
export type Locale = "fr-CA" | "en-US";
|
|
64
66
|
/** 界面语言偏好;system 表示跟随当前运行端系统语言。 */
|
|
65
67
|
export type LocalePreference = "system" | Locale;
|
|
66
68
|
/** DCode 运行中继续输入时的交互行为 */
|
|
@@ -129,7 +131,19 @@ export interface DockerRemoteTargetSnapshot {
|
|
|
129
131
|
kind: "docker";
|
|
130
132
|
container: string;
|
|
131
133
|
}
|
|
132
|
-
export
|
|
134
|
+
export interface ServerRemoteTargetSnapshot {
|
|
135
|
+
kind: "server";
|
|
136
|
+
url: string;
|
|
137
|
+
name?: string;
|
|
138
|
+
workspacePath?: string;
|
|
139
|
+
serverId?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Server token 不写入 setting.json。
|
|
142
|
+
* 这里只保存 credentialService 的键名,恢复时再读取真实 token。
|
|
143
|
+
*/
|
|
144
|
+
tokenCredentialKey?: string;
|
|
145
|
+
}
|
|
146
|
+
export type RemoteTargetSnapshot = SSHRemoteTargetSnapshot | WSLRemoteTargetSnapshot | DockerRemoteTargetSnapshot | ServerRemoteTargetSnapshot;
|
|
133
147
|
export interface RemoteWorkspaceSessionSnapshot {
|
|
134
148
|
/** 远程 workspace 的真实绝对路径 */
|
|
135
149
|
workspacePath: string;
|
|
@@ -232,12 +246,18 @@ export interface AppSettings {
|
|
|
232
246
|
taskAutoArchiveEnabled?: boolean;
|
|
233
247
|
/** 自动归档阈值;当任务最后更新时间早于该天数时允许被归档 */
|
|
234
248
|
taskAutoArchiveOlderThanDays?: number;
|
|
235
|
-
/** Windows
|
|
249
|
+
/** 桌面端关闭窗口时隐藏到托盘驻留(Windows/Linux;spec:docs/desktop/linux-close-to-tray.md) */
|
|
236
250
|
closeToTrayOnWindows?: boolean;
|
|
237
251
|
/** 存在执行中的闲时任务时阻止系统闲置休眠(手动开关,防不了合盖)。 */
|
|
238
252
|
keepAwakeWhileRunning?: boolean;
|
|
239
253
|
/** Windows 关闭到托盘默认值是否已执行过一次性迁移;只用于设置迁移,不参与业务判断。 */
|
|
240
254
|
closeToTrayOnWindowsMigrationInitialized?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Linux 关闭到托盘默认值(关)是否已执行过一次性归位迁移。
|
|
257
|
+
* shared 迁移无平台概念、曾把存量 Linux 用户归为 true,而 Linux 此前无设置入口,
|
|
258
|
+
* main 进程 bootstrap 借此标记把首次启动的 Linux 用户一次性归位为默认关。
|
|
259
|
+
*/
|
|
260
|
+
closeToTrayLinuxMigrationInitialized?: boolean;
|
|
241
261
|
/** 桌面端全局页面缩放档位;用于重启后恢复界面缩放,Web/手机端忽略。 */
|
|
242
262
|
desktopZoomLevel?: number;
|
|
243
263
|
/** 桌面主窗口最近一次非最大化宽高及最大化状态;Web/手机端忽略。 */
|
|
@@ -266,6 +286,13 @@ export interface AppSettings {
|
|
|
266
286
|
askUserQuestionAutoResolutionEnabled?: boolean;
|
|
267
287
|
/** 是否完整保留 Model I/O;开启后不轮转、不限额重置、不压缩或裁剪,鉴权信息仍会脱敏。 */
|
|
268
288
|
modelIoFullRetentionEnabled?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* 用户选的动态工作流模式(docs/dynamic-workflow/launch.md「The user's choice」)。缺席 = 跟随服务端
|
|
291
|
+
* 提供的模式;只在功能已提供时生效。选回提供的模式时删除该字段,未改动的安装继续跟随服务端翻转。
|
|
292
|
+
*/
|
|
293
|
+
dynamicWorkflowMode?: DynamicWorkflowMode;
|
|
294
|
+
/** 已启用的内置 Agent CLI;UI 对外仍展示为“Install”,底层语义保持为启用内置能力。 */
|
|
295
|
+
enabledBuiltinAgentCliProviders?: DCodeProvider[];
|
|
269
296
|
/** 设置页中每个 Provider Family 当前唯一的结构化连接选择。 */
|
|
270
297
|
providerFamilyConnectionSelections?: ProviderFamilyConnectionSelectionSettings;
|
|
271
298
|
/**
|
|
@@ -312,6 +339,16 @@ export interface AppSettings {
|
|
|
312
339
|
skippedElectronUpdateVersions?: Partial<Record<ElectronReleaseChannel, string>>;
|
|
313
340
|
/** 首次启动设置同步提示是否已消费;只表示弹窗不再出现,不代表导入成功。 */
|
|
314
341
|
settingsSyncFirstRunPromptHandled?: boolean;
|
|
342
|
+
/** 外部 Web 远控 relay 的非敏感设备身份;passHash 必须存 credentialService。 */
|
|
343
|
+
webRemoteControlExternalRelayDevice?: {
|
|
344
|
+
deviceSid: string;
|
|
345
|
+
};
|
|
346
|
+
/** 上次成功开启 Web 远控时的目标;缺失表示用户已明确关闭,不自动恢复。 */
|
|
347
|
+
webRemoteControlLastEnabledContext?: {
|
|
348
|
+
workspacePath: string;
|
|
349
|
+
workspaceIdentity?: string;
|
|
350
|
+
initialTaskId?: string;
|
|
351
|
+
};
|
|
315
352
|
/** 设置页里的临时 endpoint override;正式/测试默认 base url 由 DCODE_BASE_URL env 管理。 */
|
|
316
353
|
dcodeEndpointOrigin?: string;
|
|
317
354
|
}
|