@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,174 @@
|
|
|
1
|
+
export const WEB_REMOTE_CONTROL_WORKSPACE_RECONNECT_TIMEOUT_MS = 120_000;
|
|
2
|
+
export const WEB_REMOTE_CONTROL_OUTBOUND_PAYLOAD_BUFFER_TIMEOUT_MS = 5_000;
|
|
3
|
+
export function createWebRemoteControlConnectionRecoveryTimeoutFailure(message) {
|
|
4
|
+
return {
|
|
5
|
+
// Bugfix: 手机端长时间后台后恢复超时,真实问题是手机连接未恢复,
|
|
6
|
+
// 不能映射成 desktop-disconnected,否则错误页会误导用户以为电脑端离线。
|
|
7
|
+
reason: "connection-recovery-timeout",
|
|
8
|
+
message,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export const WEB_REMOTE_CONTROL_RELAY_AUTH_PROOF_VECTORS = [
|
|
12
|
+
{
|
|
13
|
+
passHash: "dGVzdF9oYXNo",
|
|
14
|
+
nonce: "nonce-1",
|
|
15
|
+
role: "device",
|
|
16
|
+
deviceSid: "device-1",
|
|
17
|
+
proof: "XK0m7u-26VS88uk7ISAX5Z_9pjzq8jqyP77N-HkCsPE",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
passHash: "dGVzdF9oYXNo",
|
|
21
|
+
nonce: "nonce-1",
|
|
22
|
+
role: "terminal",
|
|
23
|
+
deviceSid: "device-1",
|
|
24
|
+
proof: "YkqkJy-p-iZK1g1AcoGd0Q83REOggX1EygWkcxW4oLU",
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
function readNonEmptySearchParam(params, name) {
|
|
28
|
+
const value = params.get(name)?.trim();
|
|
29
|
+
return value ? value : undefined;
|
|
30
|
+
}
|
|
31
|
+
export function isWebRemoteControlThemeSeed(value) {
|
|
32
|
+
return (value === "light" ||
|
|
33
|
+
value === "dark" ||
|
|
34
|
+
value === "dcode-light" ||
|
|
35
|
+
value === "dcode-dark" ||
|
|
36
|
+
value === "system");
|
|
37
|
+
}
|
|
38
|
+
export function resolveWebRemoteControlRoutePathFromBaseUrl(baseUrl) {
|
|
39
|
+
const rawBaseUrl = baseUrl.trim() || "/";
|
|
40
|
+
let pathname = "/";
|
|
41
|
+
try {
|
|
42
|
+
pathname = new URL(rawBaseUrl, "https://dcode.invalid").pathname;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
pathname = rawBaseUrl.startsWith("/") ? rawBaseUrl : `/${rawBaseUrl}`;
|
|
46
|
+
}
|
|
47
|
+
const normalizedPathname = pathname.replace(/\/+$/, "") || "/";
|
|
48
|
+
if (normalizedPathname === "/") {
|
|
49
|
+
return "/remote";
|
|
50
|
+
}
|
|
51
|
+
return normalizedPathname;
|
|
52
|
+
}
|
|
53
|
+
export function matchesWebRemoteControlRoutePath(pathname, routePath) {
|
|
54
|
+
// Bugfix: dev / production 入口可能带 /remote/ 尾斜杠;
|
|
55
|
+
// 路由判断需要接受 /remote 与 /remote/,但不能把 /remote/favicon.ico 当成应用入口。
|
|
56
|
+
const normalizeRoutePath = (value) => value.replace(/\/+$/, "") || "/";
|
|
57
|
+
return normalizeRoutePath(pathname) === normalizeRoutePath(routePath);
|
|
58
|
+
}
|
|
59
|
+
export function buildWebRemoteControlExternalQrUrl({ baseUrl, deviceSid, passHash, timestamp, deviceMid, deviceName, appVersion, theme, }) {
|
|
60
|
+
const url = new URL(baseUrl);
|
|
61
|
+
url.searchParams.set("sid", deviceSid);
|
|
62
|
+
url.searchParams.set("hash", passHash);
|
|
63
|
+
url.searchParams.set("t", String(timestamp));
|
|
64
|
+
if (deviceMid?.trim()) {
|
|
65
|
+
url.searchParams.set("mid", deviceMid);
|
|
66
|
+
}
|
|
67
|
+
if (deviceName?.trim()) {
|
|
68
|
+
url.searchParams.set("name", deviceName);
|
|
69
|
+
}
|
|
70
|
+
if (appVersion?.trim()) {
|
|
71
|
+
url.searchParams.set("app_version", appVersion);
|
|
72
|
+
}
|
|
73
|
+
void theme;
|
|
74
|
+
// Bugfix: 手机端主题现在固定走本地默认 dark,不再通过二维码 URL 透传 theme。
|
|
75
|
+
// 之前 theme 参数会把桌面端主题耦合到手机首次进入行为,后续维护和排障都更复杂。
|
|
76
|
+
// 这里保留入参仅做向后兼容,避免旧调用点一次性改动过大。
|
|
77
|
+
return url.toString();
|
|
78
|
+
}
|
|
79
|
+
export function parseWebRemoteControlExternalQrParams(params) {
|
|
80
|
+
const deviceSid = readNonEmptySearchParam(params, "sid");
|
|
81
|
+
const passHash = readNonEmptySearchParam(params, "hash");
|
|
82
|
+
const rawTimestamp = readNonEmptySearchParam(params, "t");
|
|
83
|
+
const timestamp = rawTimestamp ? Number(rawTimestamp) : Number.NaN;
|
|
84
|
+
const theme = readNonEmptySearchParam(params, "theme");
|
|
85
|
+
if (!deviceSid || !passHash || !Number.isFinite(timestamp)) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
deviceSid,
|
|
90
|
+
passHash,
|
|
91
|
+
timestamp,
|
|
92
|
+
...(readNonEmptySearchParam(params, "mid")
|
|
93
|
+
? { deviceMid: readNonEmptySearchParam(params, "mid") }
|
|
94
|
+
: {}),
|
|
95
|
+
...(readNonEmptySearchParam(params, "name")
|
|
96
|
+
? { deviceName: readNonEmptySearchParam(params, "name") }
|
|
97
|
+
: {}),
|
|
98
|
+
...(readNonEmptySearchParam(params, "app_version")
|
|
99
|
+
? { appVersion: readNonEmptySearchParam(params, "app_version") }
|
|
100
|
+
: {}),
|
|
101
|
+
...(isWebRemoteControlThemeSeed(theme) ? { theme } : {}),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export const WebRemoteControlCloseCodes = {
|
|
105
|
+
SessionNotFound: 4004,
|
|
106
|
+
SessionConflict: 4009,
|
|
107
|
+
DesktopDisconnected: 4010,
|
|
108
|
+
SessionExpired: 4011,
|
|
109
|
+
WorkspaceClosed: 4012,
|
|
110
|
+
InvalidMobileConnection: 4013,
|
|
111
|
+
};
|
|
112
|
+
export function resolveWebRemoteControlFailureReasonFromCloseCode(code) {
|
|
113
|
+
switch (code) {
|
|
114
|
+
case WebRemoteControlCloseCodes.SessionNotFound:
|
|
115
|
+
return "session-not-found";
|
|
116
|
+
case WebRemoteControlCloseCodes.SessionConflict:
|
|
117
|
+
return "session-conflict";
|
|
118
|
+
case WebRemoteControlCloseCodes.DesktopDisconnected:
|
|
119
|
+
return "desktop-disconnected";
|
|
120
|
+
case WebRemoteControlCloseCodes.SessionExpired:
|
|
121
|
+
return "session-expired";
|
|
122
|
+
case WebRemoteControlCloseCodes.WorkspaceClosed:
|
|
123
|
+
return "workspace-closed";
|
|
124
|
+
case WebRemoteControlCloseCodes.InvalidMobileConnection:
|
|
125
|
+
return "invalid-mobile-connection";
|
|
126
|
+
default:
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export function resolveWebRemoteControlWorkspaceKey(target) {
|
|
131
|
+
return target.workspaceIdentity?.trim() || target.workspacePath;
|
|
132
|
+
}
|
|
133
|
+
function isWebRemoteControlBridgeableWorkspaceTarget(workspace) {
|
|
134
|
+
return (workspace.kind !== "remote" || Boolean(workspace.workspaceIdentity && workspace.remoteSessionId));
|
|
135
|
+
}
|
|
136
|
+
export function resolveWebRemoteControlInitialWorkspaceSelection({ workspaces, mobileViewState, initialViewState, }) {
|
|
137
|
+
const bridgeableWorkspaces = workspaces.filter(isWebRemoteControlBridgeableWorkspaceTarget);
|
|
138
|
+
const workspaceKeys = new Set(bridgeableWorkspaces.map((workspace) => resolveWebRemoteControlWorkspaceKey(workspace)));
|
|
139
|
+
const allWorkspaceKeys = new Set(workspaces.map((workspace) => resolveWebRemoteControlWorkspaceKey(workspace)));
|
|
140
|
+
const selectedViewState = mobileViewState ?? initialViewState;
|
|
141
|
+
const selectedWorkspaceKey = selectedViewState?.activeWorkspaceKey;
|
|
142
|
+
if (selectedWorkspaceKey && workspaceKeys.has(selectedWorkspaceKey)) {
|
|
143
|
+
return {
|
|
144
|
+
workspaceKey: selectedWorkspaceKey,
|
|
145
|
+
...(selectedViewState.activeTaskId ? { taskId: selectedViewState.activeTaskId } : {}),
|
|
146
|
+
canBridge: true,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
// Bugfix: 手机端列表会展示已断开的 SSH workspace,但这类项没有 remoteSessionId,
|
|
150
|
+
// 不能作为初始 bridge 目标。否则重连状态尚未同步时会反复进入“尚未连接”的错误页。
|
|
151
|
+
const firstWorkspace = bridgeableWorkspaces[0];
|
|
152
|
+
if (!firstWorkspace) {
|
|
153
|
+
if (selectedWorkspaceKey && allWorkspaceKeys.has(selectedWorkspaceKey)) {
|
|
154
|
+
return {
|
|
155
|
+
workspaceKey: selectedWorkspaceKey,
|
|
156
|
+
...(selectedViewState?.activeTaskId ? { taskId: selectedViewState.activeTaskId } : {}),
|
|
157
|
+
canBridge: false,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const firstDisconnectedWorkspace = workspaces[0];
|
|
161
|
+
if (!firstDisconnectedWorkspace) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
workspaceKey: resolveWebRemoteControlWorkspaceKey(firstDisconnectedWorkspace),
|
|
166
|
+
canBridge: false,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
workspaceKey: resolveWebRemoteControlWorkspaceKey(firstWorkspace),
|
|
171
|
+
canBridge: true,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=web-remote-control.js.map
|
|
@@ -21,11 +21,14 @@
|
|
|
21
21
|
"./workspace-hook-discovery": "./dist/workspace-hook-discovery.js",
|
|
22
22
|
"./workspace-hook-mutation": "./dist/workspace-hook-mutation.js",
|
|
23
23
|
"./workspace-hook-review-monotonicity": "./dist/workspace-hook-review-monotonicity.js",
|
|
24
|
-
"./workspace-hook-trust-store-file": "./dist/workspace-hook-trust-store-file.js"
|
|
24
|
+
"./workspace-hook-trust-store-file": "./dist/workspace-hook-trust-store-file.js",
|
|
25
|
+
"./mcp-apps": "./dist/mcp-apps/index.js",
|
|
26
|
+
"./gen-ui": "./dist/gen-ui/index.js",
|
|
27
|
+
"./request-security": "./dist/request-security-edition/index.js"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
27
30
|
"@dcode/model-option-map": "workspace:*",
|
|
28
31
|
"zod": "4.6.5"
|
|
29
32
|
},
|
|
30
|
-
"version": "1.1
|
|
33
|
+
"version": "1.2.1"
|
|
31
34
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { palette } from "./app-model.js";
|
|
3
|
+
import { decisionsForApproval } from "./app-approval.js";
|
|
3
4
|
import { approvalDecisionLabel, isOfficialCuaProjectApproval, approvalPermissionScopes, approvalRequestDescription, previewPermissionInput, } from "./app-approval.js";
|
|
4
5
|
import { truncateDisplay, wordWrappedLineCount } from "./app-terminal-width.js";
|
|
5
6
|
import { QuestionPanel } from "./app-question-panel.js";
|
|
@@ -48,7 +49,7 @@ function approvalRows(approval, contentWidth) {
|
|
|
48
49
|
if (isOfficialCuaProjectApproval(approval.request)) {
|
|
49
50
|
rows.push(approvalTextRow("computer-use-scope", "Do not ask again for official Computer Use actions in this project", palette.muted, contentWidth));
|
|
50
51
|
}
|
|
51
|
-
for (const decision of
|
|
52
|
+
for (const decision of decisionsForApproval(approval.request)) {
|
|
52
53
|
rows.push(approvalTextRow(decision, `${approval.selectedDecision === decision ? ">" : " "} ${approvalDecisionLabel(decision, approval.request)}`, approval.selectedDecision === decision ? palette.accent : palette.text, contentWidth));
|
|
53
54
|
}
|
|
54
55
|
rows.push(approvalTextRow("help", "Up/Down choose, Enter confirms, Esc denies", palette.muted, contentWidth));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { PermissionBrokerRequest } from "@dcode/contracts";
|
|
1
|
+
import type { PermissionBrokerRequest, PermissionBrokerResult } from "@dcode/contracts";
|
|
2
2
|
import type { KeyEvent } from "@mbears/opentui-core";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import type { ApprovalDecision, ApprovalPrompt } from "./app-model.js";
|
|
5
|
+
export declare function decisionsForApproval(request: PermissionBrokerRequest): ApprovalDecision[];
|
|
5
6
|
export declare function handleApprovalKey(key: KeyEvent, approval: ApprovalPrompt, setApprovalQueue: React.Dispatch<React.SetStateAction<ApprovalPrompt[]>>, setStatus: (status: string) => void): void;
|
|
6
7
|
export declare function approvalDecisionLabel(decision: ApprovalDecision, request?: PermissionBrokerRequest): string;
|
|
7
8
|
export declare function isOfficialCuaProjectApproval(request: PermissionBrokerRequest): boolean;
|
|
@@ -11,4 +12,5 @@ export declare function approvalPermissionScopes(request: PermissionBrokerReques
|
|
|
11
12
|
kind: "exact" | "prefix";
|
|
12
13
|
text: string;
|
|
13
14
|
}>;
|
|
15
|
+
export declare function createApprovalResult(request: PermissionBrokerRequest, decision: ApprovalDecision): PermissionBrokerResult;
|
|
14
16
|
//# sourceMappingURL=app-approval.d.ts.map
|
|
@@ -5,23 +5,26 @@ import { handleQuestionKey } from "./app-question-state.js";
|
|
|
5
5
|
import { asRecord, stringField } from "./state.js";
|
|
6
6
|
const COMMAND_INPUT_FIELD = "command";
|
|
7
7
|
const DESCRIPTION_INPUT_FIELD = "description";
|
|
8
|
+
export function decisionsForApproval(request) {
|
|
9
|
+
return request.approvalMode === "user-once" ? ["allow_once", "deny"] : approvalDecisions;
|
|
10
|
+
}
|
|
8
11
|
export function handleApprovalKey(key, approval, setApprovalQueue, setStatus) {
|
|
9
12
|
if (approval.questionState) {
|
|
10
13
|
handleQuestionKey(key, approval, setApprovalQueue, setStatus);
|
|
11
14
|
return;
|
|
12
15
|
}
|
|
13
16
|
if (key.name === "up" || key.name === "down") {
|
|
17
|
+
const decisions = decisionsForApproval(approval.request);
|
|
14
18
|
const delta = key.name === "up" ? -1 : 1;
|
|
15
19
|
setApprovalQueue((current) => {
|
|
16
20
|
const [first, ...rest] = current;
|
|
17
21
|
if (!first)
|
|
18
22
|
return current;
|
|
19
|
-
const selectedIndex =
|
|
23
|
+
const selectedIndex = decisions.indexOf(first.selectedDecision);
|
|
20
24
|
return [
|
|
21
25
|
{
|
|
22
26
|
...first,
|
|
23
|
-
selectedDecision:
|
|
24
|
-
"deny",
|
|
27
|
+
selectedDecision: decisions[clampIndex(selectedIndex + delta, decisions.length)] ?? "deny",
|
|
25
28
|
},
|
|
26
29
|
...rest,
|
|
27
30
|
];
|
|
@@ -91,8 +94,9 @@ function resolveApproval(approval, decision, setApprovalQueue, setStatus) {
|
|
|
91
94
|
setApprovalQueue((current) => current.filter((item) => item !== approval));
|
|
92
95
|
setStatus(`Permission ${approvalStatusLabel(decision)} for ${approval.request.toolName}.`);
|
|
93
96
|
}
|
|
94
|
-
function createApprovalResult(request, decision) {
|
|
95
|
-
if (decision === "deny"
|
|
97
|
+
export function createApprovalResult(request, decision) {
|
|
98
|
+
if (decision === "deny" ||
|
|
99
|
+
(decision === "allow_project" && request.approvalMode === "user-once")) {
|
|
96
100
|
return {
|
|
97
101
|
decision: "deny",
|
|
98
102
|
reason: "Denied in TUI",
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { Message, TimelineMessage } from "./app-model.js";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
export declare function compactCommandFromText(text: string): string | undefined;
|
|
4
|
+
export declare function isCompactSlashCommand(text: string): boolean;
|
|
4
5
|
export declare function createLocalCompactTimelineMessage(input: {
|
|
5
6
|
command?: string;
|
|
6
7
|
reason?: string;
|
|
7
8
|
status: TimelineMessage["status"];
|
|
8
9
|
}): Message;
|
|
10
|
+
export declare function compactTimelineMessageFromPayload(payload: Record<string, unknown>): Message | null;
|
|
9
11
|
export declare function upsertCompactTimelineMessage(current: Message[], nextMessage: Message): Message[];
|
|
10
12
|
export declare function latestRetryableCompactCommand(messages: readonly Message[]): string | undefined;
|
|
11
13
|
export declare function failLatestStartedCompactTimeline(current: Message[], reason: string): Message[];
|
|
14
|
+
export declare function compactErrorMessage(errorPayload: unknown): string;
|
|
12
15
|
export declare function applyCompactTimelineEvent(payload: Record<string, unknown>, setMessages: React.Dispatch<React.SetStateAction<Message[]>>): void;
|
|
13
16
|
export declare function applyCompactTurnErrorEvent(payload: Record<string, unknown>, setLastError: (message: string | undefined) => void, setMessages: React.Dispatch<React.SetStateAction<Message[]>>): void;
|
|
14
17
|
//# sourceMappingURL=app-compact-timeline.d.ts.map
|
|
@@ -9,6 +9,9 @@ export function compactCommandFromText(text) {
|
|
|
9
9
|
const instructions = match[1]?.trim();
|
|
10
10
|
return instructions ? `/compact ${instructions}` : "/compact";
|
|
11
11
|
}
|
|
12
|
+
export function isCompactSlashCommand(text) {
|
|
13
|
+
return compactCommandFromText(text) !== undefined;
|
|
14
|
+
}
|
|
12
15
|
export function createLocalCompactTimelineMessage(input) {
|
|
13
16
|
localCompactSequence += 1;
|
|
14
17
|
const operationId = `${LOCAL_COMPACT_OPERATION_PREFIX}-${localCompactSequence}`;
|
|
@@ -21,7 +24,7 @@ export function createLocalCompactTimelineMessage(input) {
|
|
|
21
24
|
type: "context_compaction",
|
|
22
25
|
});
|
|
23
26
|
}
|
|
24
|
-
function compactTimelineMessageFromPayload(payload) {
|
|
27
|
+
export function compactTimelineMessageFromPayload(payload) {
|
|
25
28
|
const operationId = stringField(payload, "operationId");
|
|
26
29
|
const status = timelineStatusValue(payload.status ?? payload.timelineStatus);
|
|
27
30
|
if (!operationId || !status) {
|
|
@@ -124,7 +127,7 @@ function timelineStatusValue(value) {
|
|
|
124
127
|
function isRunningCompactTimelineStatus(status) {
|
|
125
128
|
return status === "started" || status === "retrying";
|
|
126
129
|
}
|
|
127
|
-
function compactErrorMessage(errorPayload) {
|
|
130
|
+
export function compactErrorMessage(errorPayload) {
|
|
128
131
|
const payload = asRecord(errorPayload);
|
|
129
132
|
const nestedError = asRecord(payload.error);
|
|
130
133
|
return (stringField(nestedError, "message") ??
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
export declare const DCODE_LOGO_LINES: readonly ["███████╗ ██████╗ ██████╗ ██████╗ ███████╗", " ███╔╝██╔════╝██╔═══██╗██╔══██╗██╔════╝", " ███╔╝ ██║ ██║ ██║██║ ██║█████╗ ", " ███╔╝ ██║ ██║ ██║██║ ██║██╔══╝ ", "███████╗╚██████╗╚██████╔╝██████╔╝███████╗", "╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝"];
|
|
2
3
|
export declare function EmptyTranscriptLogo({ animated, }?: {
|
|
3
4
|
animated?: boolean;
|
|
4
5
|
}): React.ReactElement;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { palette } from "./app-model.js";
|
|
3
3
|
import { ShimmerText, useShimmerFrame } from "./app-motion.js";
|
|
4
4
|
const h = React.createElement;
|
|
5
|
-
const DCODE_LOGO_LINES = [
|
|
5
|
+
export const DCODE_LOGO_LINES = [
|
|
6
6
|
"███████╗ ██████╗ ██████╗ ██████╗ ███████╗",
|
|
7
7
|
" ███╔╝██╔════╝██╔═══██╗██╔══██╗██╔════╝",
|
|
8
8
|
" ███╔╝ ██║ ██║ ██║██║ ██║█████╗ ",
|
|
@@ -31,6 +31,8 @@ export declare function useFileMentionController(options: {
|
|
|
31
31
|
setSlashSelection: React.Dispatch<React.SetStateAction<SlashSelectionState | undefined>>;
|
|
32
32
|
setStatus: React.Dispatch<React.SetStateAction<string>>;
|
|
33
33
|
}): FileMentionController;
|
|
34
|
+
export declare function promptEditorCursorOffset(editor: Pick<PromptInputEditor, "cursorOffset"> | null, fallbackOffset: number): number;
|
|
35
|
+
export declare function resolveActiveFileMention(text: string, cursorOffset?: number): ActiveFileMention | undefined;
|
|
34
36
|
export declare function visibleFileMentionWindow(items: readonly TuiWorkspacePathSuggestion[], selectedIndex: number, maxVisible: number): {
|
|
35
37
|
items: readonly TuiWorkspacePathSuggestion[];
|
|
36
38
|
selectedIndex: number;
|
|
@@ -94,7 +94,7 @@ export function useFileMentionController(options) {
|
|
|
94
94
|
}, [options, state]);
|
|
95
95
|
return { handleKey, state };
|
|
96
96
|
}
|
|
97
|
-
function promptEditorCursorOffset(editor, fallbackOffset) {
|
|
97
|
+
export function promptEditorCursorOffset(editor, fallbackOffset) {
|
|
98
98
|
if (!editor)
|
|
99
99
|
return fallbackOffset;
|
|
100
100
|
try {
|
|
@@ -106,7 +106,7 @@ function promptEditorCursorOffset(editor, fallbackOffset) {
|
|
|
106
106
|
return fallbackOffset;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function resolveActiveFileMention(text, cursorOffset = text.length) {
|
|
109
|
+
export function resolveActiveFileMention(text, cursorOffset = text.length) {
|
|
110
110
|
const normalizedCursorOffset = clampOffset(cursorOffset, text.length);
|
|
111
111
|
const beforeCursor = text.slice(0, normalizedCursorOffset);
|
|
112
112
|
const triggerIndex = beforeCursor.lastIndexOf(FILE_MENTION_SIGIL);
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import type { TextareaRenderable } from "@mbears/opentui-core";
|
|
2
2
|
import type { TuiCopy } from "@dcode/i18n";
|
|
3
3
|
import React from "react";
|
|
4
|
+
export declare const INPUT_DEFAULT_EDITOR_ROWS = 2;
|
|
5
|
+
export declare const INPUT_MIN_EDITOR_ROWS = 2;
|
|
6
|
+
export declare const INPUT_MAX_EDITOR_ROWS = 6;
|
|
7
|
+
export declare const INPUT_PANE_STATUS_ROWS = 1;
|
|
8
|
+
export declare const INPUT_PANE_MIN_HEIGHT: number;
|
|
9
|
+
export declare const INPUT_PANE_MAX_HEIGHT: number;
|
|
10
|
+
export declare const INPUT_PANE_BORDER = true;
|
|
11
|
+
export declare const INPUT_PANE_BORDER_STYLE = "rounded";
|
|
12
|
+
export declare const INPUT_PANE_STATUS_SPACER_STYLE: {
|
|
13
|
+
readonly flexGrow: 1;
|
|
14
|
+
readonly minHeight: 0;
|
|
15
|
+
};
|
|
16
|
+
export declare const PROMPT_TEXTAREA_KEY_BINDINGS: readonly [{
|
|
17
|
+
readonly name: "return";
|
|
18
|
+
readonly action: "submit";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "linefeed";
|
|
21
|
+
readonly action: "submit";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "return";
|
|
24
|
+
readonly shift: true;
|
|
25
|
+
readonly action: "newline";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "linefeed";
|
|
28
|
+
readonly shift: true;
|
|
29
|
+
readonly action: "newline";
|
|
30
|
+
}];
|
|
4
31
|
export type PromptInputEditor = Pick<TextareaRenderable, "cursorOffset" | "deleteRange" | "focus" | "focused" | "gotoBufferEnd" | "insertText" | "logicalCursor" | "plainText" | "setText">;
|
|
32
|
+
type DraftTextarea = Pick<PromptInputEditor, "gotoBufferEnd" | "plainText" | "setText">;
|
|
5
33
|
export declare function InputPane({ busy, contentWidth, copy, focused, mode, model, onInput, onSubmit, editorRef, resetCursorToEndVersion, thoughtLevel, value, }: {
|
|
6
34
|
busy: boolean;
|
|
7
35
|
contentWidth?: number;
|
|
@@ -16,4 +44,14 @@ export declare function InputPane({ busy, contentWidth, copy, focused, mode, mod
|
|
|
16
44
|
thoughtLevel: string;
|
|
17
45
|
value: string;
|
|
18
46
|
}): React.ReactElement;
|
|
47
|
+
export declare function inputPaneTitle(copy: TuiCopy, mode?: string): string;
|
|
48
|
+
export declare function inputPanePlaceholder(copy: TuiCopy, busy: boolean): string;
|
|
49
|
+
export declare function inputPaneEditorRows(value: string, contentWidth?: number): number;
|
|
50
|
+
export declare function inputPaneHeight(editorRows: number): number;
|
|
51
|
+
export declare function inputPaneContainerStyle(focused: boolean, editorRows?: number): Record<string, unknown>;
|
|
52
|
+
export declare function inputPaneTextareaStyle(editorRows: number): Record<string, unknown>;
|
|
53
|
+
export declare function syncTextareaValue(textarea: DraftTextarea, value: string): boolean;
|
|
54
|
+
export declare function shouldEmitTextareaInput(controlledValue: string, editorValue: string): boolean;
|
|
55
|
+
export declare function moveInputCursorToEnd(input: Pick<TextareaRenderable, "gotoBufferEnd">): void;
|
|
56
|
+
export {};
|
|
19
57
|
//# sourceMappingURL=app-input-pane.d.ts.map
|
|
@@ -4,24 +4,24 @@ import { palette } from "./app-model.js";
|
|
|
4
4
|
import { InputComposerStatus } from "./app-input-status.js";
|
|
5
5
|
import { wordWrappedLineCount } from "./app-terminal-width.js";
|
|
6
6
|
const h = React.createElement;
|
|
7
|
-
const INPUT_DEFAULT_EDITOR_ROWS = 2;
|
|
8
|
-
const INPUT_MIN_EDITOR_ROWS = INPUT_DEFAULT_EDITOR_ROWS;
|
|
9
|
-
const INPUT_MAX_EDITOR_ROWS = 6;
|
|
7
|
+
export const INPUT_DEFAULT_EDITOR_ROWS = 2;
|
|
8
|
+
export const INPUT_MIN_EDITOR_ROWS = INPUT_DEFAULT_EDITOR_ROWS;
|
|
9
|
+
export const INPUT_MAX_EDITOR_ROWS = 6;
|
|
10
10
|
const INPUT_FRAME_CHROME_ROWS = 3;
|
|
11
|
-
const INPUT_PANE_STATUS_ROWS = 1;
|
|
11
|
+
export const INPUT_PANE_STATUS_ROWS = 1;
|
|
12
12
|
const INPUT_CHROME_ROWS = INPUT_FRAME_CHROME_ROWS + INPUT_PANE_STATUS_ROWS;
|
|
13
13
|
const INPUT_CONTENT_FALLBACK_WIDTH = 80;
|
|
14
14
|
const INPUT_MIN_CONTENT_WIDTH = 8;
|
|
15
15
|
const INPUT_PANE_HORIZONTAL_CHROME_WIDTH = 4;
|
|
16
|
-
const INPUT_PANE_MIN_HEIGHT = INPUT_MIN_EDITOR_ROWS + INPUT_CHROME_ROWS;
|
|
17
|
-
const INPUT_PANE_MAX_HEIGHT = INPUT_MAX_EDITOR_ROWS + INPUT_CHROME_ROWS;
|
|
18
|
-
const INPUT_PANE_BORDER = true;
|
|
19
|
-
const INPUT_PANE_BORDER_STYLE = "rounded";
|
|
20
|
-
const INPUT_PANE_STATUS_SPACER_STYLE = {
|
|
16
|
+
export const INPUT_PANE_MIN_HEIGHT = INPUT_MIN_EDITOR_ROWS + INPUT_CHROME_ROWS;
|
|
17
|
+
export const INPUT_PANE_MAX_HEIGHT = INPUT_MAX_EDITOR_ROWS + INPUT_CHROME_ROWS;
|
|
18
|
+
export const INPUT_PANE_BORDER = true;
|
|
19
|
+
export const INPUT_PANE_BORDER_STYLE = "rounded";
|
|
20
|
+
export const INPUT_PANE_STATUS_SPACER_STYLE = {
|
|
21
21
|
flexGrow: 1,
|
|
22
22
|
minHeight: 0,
|
|
23
23
|
};
|
|
24
|
-
const PROMPT_TEXTAREA_KEY_BINDINGS = [
|
|
24
|
+
export const PROMPT_TEXTAREA_KEY_BINDINGS = [
|
|
25
25
|
{ name: "return", action: "submit" },
|
|
26
26
|
{ name: "linefeed", action: "submit" },
|
|
27
27
|
{ name: "return", shift: true, action: "newline" },
|
|
@@ -104,21 +104,21 @@ export function InputPane({ busy, contentWidth, copy = DEFAULT_TUI_COPY, focused
|
|
|
104
104
|
thoughtLevel,
|
|
105
105
|
}));
|
|
106
106
|
}
|
|
107
|
-
function inputPaneTitle(copy, mode) {
|
|
107
|
+
export function inputPaneTitle(copy, mode) {
|
|
108
108
|
const title = mode ? formatInputModeLabel(mode) : copy.input.title;
|
|
109
109
|
return ` ${title} `;
|
|
110
110
|
}
|
|
111
|
-
function inputPanePlaceholder(copy, busy) {
|
|
111
|
+
export function inputPanePlaceholder(copy, busy) {
|
|
112
112
|
return busy ? copy.input.busyPlaceholder : copy.input.placeholder;
|
|
113
113
|
}
|
|
114
|
-
function inputPaneEditorRows(value, contentWidth) {
|
|
114
|
+
export function inputPaneEditorRows(value, contentWidth) {
|
|
115
115
|
const contentRows = wordWrappedLineCount(value, normalizeInputContentWidth(contentWidth));
|
|
116
116
|
return normalizeEditorRows(contentRows);
|
|
117
117
|
}
|
|
118
|
-
function inputPaneHeight(editorRows) {
|
|
118
|
+
export function inputPaneHeight(editorRows) {
|
|
119
119
|
return normalizeEditorRows(editorRows) + INPUT_CHROME_ROWS;
|
|
120
120
|
}
|
|
121
|
-
function inputPaneContainerStyle(focused, editorRows = INPUT_MIN_EDITOR_ROWS) {
|
|
121
|
+
export function inputPaneContainerStyle(focused, editorRows = INPUT_MIN_EDITOR_ROWS) {
|
|
122
122
|
const height = inputPaneHeight(editorRows);
|
|
123
123
|
return {
|
|
124
124
|
backgroundColor: palette.panel,
|
|
@@ -133,7 +133,7 @@ function inputPaneContainerStyle(focused, editorRows = INPUT_MIN_EDITOR_ROWS) {
|
|
|
133
133
|
paddingRight: 1,
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
function inputPaneTextareaStyle(editorRows) {
|
|
136
|
+
export function inputPaneTextareaStyle(editorRows) {
|
|
137
137
|
return {
|
|
138
138
|
focusedBackgroundColor: palette.panel,
|
|
139
139
|
focusedTextColor: palette.text,
|
|
@@ -146,17 +146,17 @@ function inputPaneTextareaStyle(editorRows) {
|
|
|
146
146
|
wrapMode: "word",
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function syncTextareaValue(textarea, value) {
|
|
149
|
+
export function syncTextareaValue(textarea, value) {
|
|
150
150
|
if (textarea.plainText === value)
|
|
151
151
|
return false;
|
|
152
152
|
textarea.setText(value);
|
|
153
153
|
moveInputCursorToEnd(textarea);
|
|
154
154
|
return true;
|
|
155
155
|
}
|
|
156
|
-
function shouldEmitTextareaInput(controlledValue, editorValue) {
|
|
156
|
+
export function shouldEmitTextareaInput(controlledValue, editorValue) {
|
|
157
157
|
return editorValue !== controlledValue;
|
|
158
158
|
}
|
|
159
|
-
function moveInputCursorToEnd(input) {
|
|
159
|
+
export function moveInputCursorToEnd(input) {
|
|
160
160
|
// OpenTUI controlled value updates can leave the previous cursor viewport in
|
|
161
161
|
// place after history recall; gotoBufferEnd refreshes both cursor and scroll.
|
|
162
162
|
input.gotoBufferEnd();
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { TuiCopy } from "@dcode/i18n";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { ContextUsage } from "./app-model.js";
|
|
4
|
+
type InputComposerStatusParts = {
|
|
5
|
+
model: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
thought: string;
|
|
8
|
+
};
|
|
4
9
|
export declare function InputActiveStatus({ active, contentWidth, contextUsage, copy, frameMs, }: {
|
|
5
10
|
active: boolean;
|
|
6
11
|
contentWidth?: number;
|
|
@@ -13,4 +18,16 @@ export declare function InputComposerStatus({ contentWidth, model, thoughtLevel,
|
|
|
13
18
|
model: string;
|
|
14
19
|
thoughtLevel: string;
|
|
15
20
|
}): React.ReactElement;
|
|
21
|
+
export declare function inputActiveStatusRow(copy: TuiCopy, frame?: string, options?: {
|
|
22
|
+
contentWidth?: number;
|
|
23
|
+
contextUsage?: ContextUsage;
|
|
24
|
+
}): React.ReactElement;
|
|
25
|
+
export declare function inputComposerStatusRow({ contentWidth, model, thoughtLevel, }: {
|
|
26
|
+
contentWidth?: number;
|
|
27
|
+
model: string;
|
|
28
|
+
thoughtLevel: string;
|
|
29
|
+
}): React.ReactElement;
|
|
30
|
+
export declare function inputComposerStatusParts(modelSelection: string, thoughtLevel: string, maxWidth?: number): InputComposerStatusParts;
|
|
31
|
+
export declare function inputContextUsageBadge(contextUsage?: ContextUsage): string | undefined;
|
|
32
|
+
export {};
|
|
16
33
|
//# sourceMappingURL=app-input-status.d.ts.map
|
|
@@ -36,7 +36,7 @@ export function InputComposerStatus({ contentWidth, model, thoughtLevel, }) {
|
|
|
36
36
|
thoughtLevel,
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function inputActiveStatusRow(copy, frame, options = {}) {
|
|
39
|
+
export function inputActiveStatusRow(copy, frame, options = {}) {
|
|
40
40
|
const contextBadge = fitStatusContextBadge(inputContextUsageBadge(options.contextUsage), activeStatusContextBadgeWidth({
|
|
41
41
|
contentWidth: options.contentWidth,
|
|
42
42
|
copy,
|
|
@@ -53,7 +53,7 @@ function inputActiveStatusRow(copy, frame, options = {}) {
|
|
|
53
53
|
? h("box", { style: { flexDirection: "row", flexShrink: 0 } }, h("text", { style: { fg: palette.accent, flexShrink: 0, width: displayWidth(frame) } }, frame), h("text", { style: { fg: palette.muted } }, " "), h("text", { style: { fg: palette.muted } }, copy.input.activeStatusHint))
|
|
54
54
|
: null, contextBadge ? h("box", { style: { flexGrow: 1, minWidth: 1 } }) : null, contextBadge ? h("text", { style: { fg: palette.muted, flexShrink: 0 } }, contextBadge) : null);
|
|
55
55
|
}
|
|
56
|
-
function inputComposerStatusRow({ contentWidth, model, thoughtLevel, }) {
|
|
56
|
+
export function inputComposerStatusRow({ contentWidth, model, thoughtLevel, }) {
|
|
57
57
|
const parts = inputComposerStatusParts(model, thoughtLevel, composerStatusMetadataWidth(contentWidth));
|
|
58
58
|
return h("box", {
|
|
59
59
|
style: {
|
|
@@ -65,7 +65,7 @@ function inputComposerStatusRow({ contentWidth, model, thoughtLevel, }) {
|
|
|
65
65
|
},
|
|
66
66
|
}, h("box", { style: { flexDirection: "row", flexShrink: 1, minWidth: 1 } }, h("text", { style: { fg: palette.text, flexShrink: 1 } }, parts.model), h("text", { style: { fg: palette.muted } }, ` ${parts.provider} | `), h("text", { style: { fg: palette.warning, flexShrink: 0 } }, parts.thought)));
|
|
67
67
|
}
|
|
68
|
-
function inputComposerStatusParts(modelSelection, thoughtLevel, maxWidth) {
|
|
68
|
+
export function inputComposerStatusParts(modelSelection, thoughtLevel, maxWidth) {
|
|
69
69
|
const modelParts = modelDisplayParts(modelSelection);
|
|
70
70
|
const thought = thoughtLevel.trim();
|
|
71
71
|
return fitComposerStatusParts({
|
|
@@ -73,7 +73,7 @@ function inputComposerStatusParts(modelSelection, thoughtLevel, maxWidth) {
|
|
|
73
73
|
thought: thought || "-",
|
|
74
74
|
}, maxWidth);
|
|
75
75
|
}
|
|
76
|
-
function inputContextUsageBadge(contextUsage) {
|
|
76
|
+
export function inputContextUsageBadge(contextUsage) {
|
|
77
77
|
const used = contextUsage?.contextUsed;
|
|
78
78
|
if (!validContextTokenCount(used))
|
|
79
79
|
return undefined;
|
|
@@ -19,6 +19,7 @@ export declare function visibleModelOptionWindow(models: readonly TuiModelOption
|
|
|
19
19
|
selectedIndex: number;
|
|
20
20
|
startIndex: number;
|
|
21
21
|
};
|
|
22
|
+
export declare function effortCommandQuery(draft: string): string | undefined;
|
|
22
23
|
export declare function filterEffortOptions(draft: string, efforts: readonly TuiEffortOption[]): readonly TuiEffortOption[];
|
|
23
24
|
export declare function reconcileEffortCommandSelection(draft: string, efforts: readonly TuiEffortOption[]): EffortCommandSelectionState | undefined;
|
|
24
25
|
export declare function selectedEffortOption(submittedValue: string, effortSelection: EffortCommandSelectionState | undefined, efforts: readonly TuiEffortOption[]): TuiEffortOption | undefined;
|
|
@@ -91,7 +91,7 @@ export function visibleModelOptionWindow(models, selectedIndex, maxVisible) {
|
|
|
91
91
|
startIndex,
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function effortCommandQuery(draft) {
|
|
94
|
+
export function effortCommandQuery(draft) {
|
|
95
95
|
for (const commandName of EFFORT_COMMAND_NAMES) {
|
|
96
96
|
const commandWithSpace = `${commandName} `;
|
|
97
97
|
if (draft === commandName)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SyntaxStyle } from "@mbears/opentui-core";
|
|
1
|
+
import { SyntaxStyle, type ThemeTokenStyle } from "@mbears/opentui-core";
|
|
2
2
|
import type { TuiThemeTokens } from "./theme/index.js";
|
|
3
|
+
export declare function markdownSyntaxRules(theme: TuiThemeTokens): ThemeTokenStyle[];
|
|
3
4
|
export declare function createMarkdownSyntaxStyle(theme: TuiThemeTokens): SyntaxStyle | undefined;
|
|
4
5
|
//# sourceMappingURL=app-markdown-theme.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SyntaxStyle } from "@mbears/opentui-core";
|
|
2
|
-
function markdownSyntaxRules(theme) {
|
|
2
|
+
export function markdownSyntaxRules(theme) {
|
|
3
3
|
return [
|
|
4
4
|
token(["default"], { foreground: theme.markdownText }),
|
|
5
5
|
token(["markup.heading", "markup.heading.1", "markup.heading.2", "markup.heading.3"], {
|
|
@@ -7,6 +7,7 @@ type MarkdownTextProps = {
|
|
|
7
7
|
mode?: MarkdownRenderMode;
|
|
8
8
|
streaming?: boolean;
|
|
9
9
|
};
|
|
10
|
+
export declare function detectMarkdownRenderMode(components?: Record<string, unknown>): MarkdownRenderMode;
|
|
10
11
|
export declare function MarkdownText({ content, foregroundColor, mode, streaming, }: MarkdownTextProps): React.ReactElement;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=app-markdown.d.ts.map
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { createMarkdownSyntaxStyle } from "./app-markdown-theme.js";
|
|
4
4
|
import { activeTuiTheme } from "./theme/index.js";
|
|
5
5
|
const h = React.createElement;
|
|
6
|
-
function detectMarkdownRenderMode(components = baseComponents) {
|
|
6
|
+
export function detectMarkdownRenderMode(components = baseComponents) {
|
|
7
7
|
if (typeof components.markdown === "function")
|
|
8
8
|
return "markdown";
|
|
9
9
|
if (typeof components.code === "function")
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ModeCommandSelectionState } from "./app-model.js";
|
|
3
3
|
import type { TuiModeOption } from "./types.js";
|
|
4
|
+
export declare function modeCommandQuery(draft: string): string | undefined;
|
|
5
|
+
export declare function filterModeOptions(draft: string): readonly TuiModeOption[];
|
|
6
|
+
export declare function selectedModeOption(submittedValue: string, modeSelection: ModeCommandSelectionState | undefined, modes: readonly TuiModeOption[]): TuiModeOption | undefined;
|
|
4
7
|
export declare function useModeCommandController(draft: string): {
|
|
5
8
|
filteredOptions: readonly TuiModeOption[];
|
|
6
9
|
reconcileDraft: (value: string) => ModeCommandSelectionState | undefined;
|