@deepseek-harness-tui/dsh-tui 0.10.0 → 0.10.2
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/README.md +5 -2
- package/bin/dsh-tui.js +99 -33
- package/cordis.patch.yml +25 -5
- package/lib/types/adapter/channel/actions.d.ts +17 -0
- package/lib/types/adapter/channel/actions.d.ts.map +1 -0
- package/lib/types/adapter/channel/actions.js +28 -0
- package/lib/types/adapter/channel/consumer.d.ts +34 -0
- package/lib/types/adapter/channel/consumer.d.ts.map +1 -0
- package/lib/types/adapter/channel/consumer.js +87 -0
- package/lib/types/adapter/channel/features.d.ts +12 -0
- package/lib/types/adapter/channel/features.d.ts.map +1 -0
- package/lib/types/adapter/channel/features.js +41 -0
- package/lib/types/adapter/channel/host-registry.d.ts +40 -0
- package/lib/types/adapter/channel/host-registry.d.ts.map +1 -0
- package/lib/types/adapter/channel/host-registry.js +120 -0
- package/lib/types/adapter/channel/index.d.ts +22 -0
- package/lib/types/adapter/channel/index.d.ts.map +1 -0
- package/lib/types/adapter/channel/index.js +21 -0
- package/lib/types/adapter/channel/internal-token.d.ts +12 -0
- package/lib/types/adapter/channel/internal-token.d.ts.map +1 -0
- package/lib/types/adapter/channel/internal-token.js +11 -0
- package/lib/types/adapter/channel/plugins.d.ts +17 -0
- package/lib/types/adapter/channel/plugins.d.ts.map +1 -0
- package/lib/types/adapter/channel/plugins.js +47 -0
- package/lib/types/adapter/channel/projection.d.ts +15 -0
- package/lib/types/adapter/channel/projection.d.ts.map +1 -0
- package/lib/types/adapter/channel/projection.js +59 -0
- package/lib/types/adapter/channel/provider.d.ts +52 -0
- package/lib/types/adapter/channel/provider.d.ts.map +1 -0
- package/lib/types/adapter/channel/provider.js +231 -0
- package/lib/types/adapter/channel/read-view.d.ts +4 -0
- package/lib/types/adapter/channel/read-view.d.ts.map +1 -0
- package/lib/types/adapter/channel/read-view.js +132 -0
- package/lib/types/adapter/channel/session-projection.d.ts +56 -0
- package/lib/types/adapter/channel/session-projection.d.ts.map +1 -0
- package/lib/types/adapter/channel/session-projection.js +247 -0
- package/lib/types/adapter/channel/state.d.ts +11 -0
- package/lib/types/adapter/channel/state.d.ts.map +1 -0
- package/lib/types/adapter/channel/state.js +55 -0
- package/lib/types/adapter/channel/transcript.d.ts +15 -0
- package/lib/types/adapter/channel/transcript.d.ts.map +1 -0
- package/lib/types/adapter/channel/transcript.js +22 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +106 -0
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -0
- package/lib/types/adapter/channel/ui-policy.js +166 -0
- package/lib/types/adapter/channel/ui.d.ts +16 -0
- package/lib/types/adapter/channel/ui.d.ts.map +1 -0
- package/lib/types/adapter/channel/ui.js +168 -0
- package/lib/types/adapter/index.d.ts +20 -0
- package/lib/types/adapter/index.d.ts.map +1 -0
- package/lib/types/adapter/index.js +19 -0
- package/lib/types/adapter/kernel/contract-catalog.d.ts +12 -0
- package/lib/types/adapter/kernel/contract-catalog.d.ts.map +1 -0
- package/lib/types/adapter/kernel/contract-catalog.js +11 -0
- package/lib/types/adapter/kernel/diagnostics.d.ts +18 -0
- package/lib/types/adapter/kernel/diagnostics.d.ts.map +1 -0
- package/lib/types/adapter/kernel/diagnostics.js +16 -0
- package/lib/types/adapter/kernel/driver-types.d.ts +16 -0
- package/lib/types/adapter/kernel/driver-types.d.ts.map +1 -0
- package/lib/types/adapter/kernel/driver-types.js +8 -0
- package/lib/types/adapter/kernel/host-facade.d.ts +65 -0
- package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -0
- package/lib/types/adapter/kernel/host-facade.js +215 -0
- package/lib/types/adapter/kernel/host-probe-access.d.ts +71 -0
- package/lib/types/adapter/kernel/host-probe-access.d.ts.map +1 -0
- package/lib/types/adapter/kernel/host-probe-access.js +121 -0
- package/lib/types/adapter/kernel/index.d.ts +20 -0
- package/lib/types/adapter/kernel/index.d.ts.map +1 -0
- package/lib/types/adapter/kernel/index.js +19 -0
- package/lib/types/adapter/kernel/kernel-runtime.d.ts +138 -0
- package/lib/types/adapter/kernel/kernel-runtime.d.ts.map +1 -0
- package/lib/types/adapter/kernel/kernel-runtime.js +572 -0
- package/lib/types/adapter/kernel/ledger.d.ts +55 -0
- package/lib/types/adapter/kernel/ledger.d.ts.map +1 -0
- package/lib/types/adapter/kernel/ledger.js +33 -0
- package/lib/types/adapter/kernel/legacy-facade.d.ts +22 -0
- package/lib/types/adapter/kernel/legacy-facade.d.ts.map +1 -0
- package/lib/types/adapter/kernel/legacy-facade.js +34 -0
- package/lib/types/adapter/kernel/lifecycle.d.ts +38 -0
- package/lib/types/adapter/kernel/lifecycle.d.ts.map +1 -0
- package/lib/types/adapter/kernel/lifecycle.js +53 -0
- package/lib/types/adapter/kernel/replay-isolation.d.ts +27 -0
- package/lib/types/adapter/kernel/replay-isolation.d.ts.map +1 -0
- package/lib/types/adapter/kernel/replay-isolation.js +45 -0
- package/lib/types/adapter/kernel/replay.d.ts +132 -0
- package/lib/types/adapter/kernel/replay.d.ts.map +1 -0
- package/lib/types/adapter/kernel/replay.js +425 -0
- package/lib/types/adapter/kernel/runtime-context.d.ts +15 -0
- package/lib/types/adapter/kernel/runtime-context.d.ts.map +1 -0
- package/lib/types/adapter/kernel/runtime-context.js +24 -0
- package/lib/types/adapter/kernel/runtime.d.ts +70 -0
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -0
- package/lib/types/adapter/kernel/runtime.js +325 -0
- package/lib/types/adapter/kernel/slices/channel.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/channel.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/channel.js +8 -0
- package/lib/types/adapter/kernel/slices/decisions.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/decisions.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/decisions.js +10 -0
- package/lib/types/adapter/kernel/slices/extensions.d.ts +8 -0
- package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/extensions.js +43 -0
- package/lib/types/adapter/kernel/slices/index.d.ts +19 -0
- package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/index.js +36 -0
- package/lib/types/adapter/kernel/slices/presentation.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/presentation.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/presentation.js +14 -0
- package/lib/types/adapter/kernel/slices/scenes.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/scenes.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/scenes.js +14 -0
- package/lib/types/adapter/kernel/slices/settings.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/settings.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/settings.js +12 -0
- package/lib/types/adapter/kernel/slices/types.d.ts +20 -0
- package/lib/types/adapter/kernel/slices/types.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/types.js +12 -0
- package/lib/types/adapter/kernel/slices/workspace.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/workspace.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/workspace.js +15 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts +90 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-catalog.js +2 -0
- package/lib/types/adapter/ports/channel-display.d.ts +90 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-display.js +2 -0
- package/lib/types/adapter/ports/channel-session.d.ts +229 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-session.js +2 -0
- package/lib/types/adapter/ports/channel-settings.d.ts +273 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-settings.js +1 -0
- package/lib/types/adapter/ports/channel-ui.d.ts +569 -0
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-ui.js +1 -0
- package/lib/types/adapter/ports/channel-view.d.ts +609 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-view.js +2 -0
- package/lib/types/adapter/ports/channel-workspace.d.ts +45 -0
- package/lib/types/adapter/ports/channel-workspace.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-workspace.js +2 -0
- package/lib/types/adapter/ports/channel.d.ts +145 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel.js +22 -0
- package/lib/types/adapter/ports/decisions.d.ts +18 -0
- package/lib/types/adapter/ports/decisions.d.ts.map +1 -0
- package/lib/types/adapter/ports/decisions.js +9 -0
- package/lib/types/adapter/ports/descriptor.d.ts +25 -0
- package/lib/types/adapter/ports/descriptor.d.ts.map +1 -0
- package/lib/types/adapter/ports/descriptor.js +11 -0
- package/lib/types/adapter/ports/extensions.d.ts +86 -0
- package/lib/types/adapter/ports/extensions.d.ts.map +1 -0
- package/lib/types/adapter/ports/extensions.js +9 -0
- package/lib/types/adapter/ports/index.d.ts +23 -0
- package/lib/types/adapter/ports/index.d.ts.map +1 -0
- package/lib/types/adapter/ports/index.js +14 -0
- package/lib/types/adapter/ports/owner.d.ts +19 -0
- package/lib/types/adapter/ports/owner.d.ts.map +1 -0
- package/lib/types/adapter/ports/owner.js +9 -0
- package/lib/types/adapter/ports/presentation.d.ts +81 -0
- package/lib/types/adapter/ports/presentation.d.ts.map +1 -0
- package/lib/types/adapter/ports/presentation.js +10 -0
- package/lib/types/adapter/ports/scenes.d.ts +24 -0
- package/lib/types/adapter/ports/scenes.d.ts.map +1 -0
- package/lib/types/adapter/ports/scenes.js +8 -0
- package/lib/types/adapter/ports/settings.d.ts +44 -0
- package/lib/types/adapter/ports/settings.d.ts.map +1 -0
- package/lib/types/adapter/ports/settings.js +9 -0
- package/lib/types/adapter/ports/workspace.d.ts +60 -0
- package/lib/types/adapter/ports/workspace.d.ts.map +1 -0
- package/lib/types/adapter/ports/workspace.js +8 -0
- package/lib/types/adapter/spec/index.d.ts +11 -0
- package/lib/types/adapter/spec/index.d.ts.map +1 -0
- package/lib/types/adapter/spec/index.js +10 -0
- package/lib/types/adapter/spec/profile.d.ts +10 -0
- package/lib/types/adapter/spec/profile.d.ts.map +1 -0
- package/lib/types/adapter/spec/profile.js +9 -0
- package/lib/types/adapter/spec/protocol-constants.d.ts +60 -0
- package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -0
- package/lib/types/adapter/spec/protocol-constants.js +129 -0
- package/lib/types/adapter/spec/tui-contributions.d.ts +18 -0
- package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -0
- package/lib/types/adapter/spec/tui-contributions.js +19 -0
- package/lib/types/adapter/standard/admission.d.ts +11 -0
- package/lib/types/adapter/standard/admission.d.ts.map +1 -0
- package/lib/types/adapter/standard/admission.js +10 -0
- package/lib/types/adapter/standard/descriptor.d.ts +74 -0
- package/lib/types/adapter/standard/descriptor.d.ts.map +1 -0
- package/lib/types/adapter/standard/descriptor.js +356 -0
- package/lib/types/{dsh-adapter → adapter/standard}/grants.d.ts +8 -3
- package/lib/types/adapter/standard/grants.d.ts.map +1 -0
- package/lib/types/{dsh-adapter → adapter/standard}/grants.js +14 -8
- package/lib/types/adapter/standard/index.d.ts +25 -0
- package/lib/types/adapter/standard/index.d.ts.map +1 -0
- package/lib/types/adapter/standard/index.js +24 -0
- package/lib/types/adapter/standard/negotiate.d.ts.map +1 -0
- package/lib/types/{plugin-spec → adapter/standard}/permission-scope.d.ts +3 -8
- package/lib/types/adapter/standard/permission-scope.d.ts.map +1 -0
- package/lib/types/{plugin-spec → adapter/standard}/permission-scope.js +4 -26
- package/lib/types/adapter/standard/protocols.d.ts +12 -0
- package/lib/types/adapter/standard/protocols.d.ts.map +1 -0
- package/lib/types/adapter/standard/protocols.js +11 -0
- package/lib/types/adapter/standard/registry.d.ts.map +1 -0
- package/lib/types/{plugin-spec → adapter/standard}/registry.js +3 -15
- package/lib/types/adapter/standard/schema-check.d.ts.map +1 -0
- package/lib/types/{plugin-spec → adapter/standard}/schema-check.js +4 -2
- package/lib/types/adapter/standard/tui-extension.d.ts +25 -0
- package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -0
- package/lib/types/adapter/standard/tui-extension.js +45 -0
- package/lib/types/{plugin-spec → adapter/standard}/types.d.ts +3 -9
- package/lib/types/adapter/standard/types.d.ts.map +1 -0
- package/lib/types/{plugin-spec → adapter/standard}/validate.d.ts +3 -3
- package/lib/types/adapter/standard/validate.d.ts.map +1 -0
- package/lib/types/{plugin-spec → adapter/standard}/validate.js +14 -13
- package/lib/types/adapter/upstream/channel-driver.d.ts +22 -0
- package/lib/types/adapter/upstream/channel-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/channel-driver.js +424 -0
- package/lib/types/adapter/upstream/decisions-driver.d.ts +15 -0
- package/lib/types/adapter/upstream/decisions-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/decisions-driver.js +141 -0
- package/lib/types/adapter/upstream/detection.d.ts +26 -0
- package/lib/types/adapter/upstream/detection.d.ts.map +1 -0
- package/lib/types/adapter/upstream/detection.js +9 -0
- package/lib/types/adapter/upstream/driver.d.ts +50 -0
- package/lib/types/adapter/upstream/driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/driver.js +8 -0
- package/lib/types/adapter/upstream/extensions-driver.d.ts +24 -0
- package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/extensions-driver.js +697 -0
- package/lib/types/adapter/upstream/host-descriptor-driver.d.ts +45 -0
- package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/host-descriptor-driver.js +606 -0
- package/lib/types/adapter/upstream/index.d.ts +18 -0
- package/lib/types/adapter/upstream/index.d.ts.map +1 -0
- package/lib/types/adapter/upstream/index.js +15 -0
- package/lib/types/adapter/upstream/presentation-driver.d.ts +17 -0
- package/lib/types/adapter/upstream/presentation-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/presentation-driver.js +129 -0
- package/lib/types/adapter/upstream/scenes-driver.d.ts +18 -0
- package/lib/types/adapter/upstream/scenes-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/scenes-driver.js +170 -0
- package/lib/types/adapter/upstream/settings-driver.d.ts +20 -0
- package/lib/types/adapter/upstream/settings-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/settings-driver.js +173 -0
- package/lib/types/adapter/upstream/workspace-driver.d.ts +19 -0
- package/lib/types/adapter/upstream/workspace-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/workspace-driver.js +190 -0
- package/lib/types/api.d.ts +1 -1
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/commands.d.ts +2 -41
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +1 -1
- package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
- package/lib/types/components/Chat/JobCard.js +8 -1
- package/lib/types/components/GoalTodoPanel.d.ts +2 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +7 -5
- package/lib/types/components/Markdown.d.ts +2 -2
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +28 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +46 -17
- package/lib/types/components/ModelPicker.d.ts +1 -1
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +8 -4
- package/lib/types/components/OverlayAbove.d.ts +22 -1
- package/lib/types/components/OverlayAbove.d.ts.map +1 -1
- package/lib/types/components/OverlayAbove.js +74 -5
- package/lib/types/components/PromptInput.d.ts +2 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +14 -6
- package/lib/types/components/SkillsPicker.d.ts.map +1 -1
- package/lib/types/components/SkillsPicker.js +6 -4
- package/lib/types/components/Spinner/spinnerMode.d.ts +1 -5
- package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +61 -9
- package/lib/types/components/design-system/ThemedBox.d.ts +4 -2
- package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedBox.js +2 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +69 -25
- package/lib/types/components/overlayBudget.d.ts +39 -0
- package/lib/types/components/overlayBudget.d.ts.map +1 -0
- package/lib/types/components/overlayBudget.js +43 -0
- package/lib/types/deepseekBalance.d.ts +2 -36
- package/lib/types/deepseekBalance.d.ts.map +1 -1
- package/lib/types/deepseekBalance.js +0 -14
- package/lib/types/deepseekPricing.d.ts +2 -1
- package/lib/types/deepseekPricing.d.ts.map +1 -1
- package/lib/types/deepseekPricing.js +8 -1
- package/lib/types/dsh-adapter/approvals.d.ts +11 -1
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +32 -12
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/action-readiness.js +83 -0
- package/lib/types/dsh-adapter/channel/activity.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/activity.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/activity.js +113 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +64 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +295 -0
- package/lib/types/dsh-adapter/channel/background-action.d.ts +41 -0
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/background-action.js +86 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +65 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/binding-events.js +169 -0
- package/lib/types/dsh-adapter/channel/binding.d.ts +41 -0
- package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/binding.js +227 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts +29 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/command-completions.js +94 -0
- package/lib/types/dsh-adapter/channel/commands.d.ts +8 -0
- package/lib/types/dsh-adapter/channel/commands.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/commands.js +9 -0
- package/lib/types/dsh-adapter/channel/compaction.d.ts +19 -0
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/compaction.js +116 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +57 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/composer-images.js +217 -0
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts +15 -0
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/composer-mentions.js +200 -0
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +26 -0
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +30 -0
- package/lib/types/dsh-adapter/channel/decisions.d.ts +19 -0
- package/lib/types/dsh-adapter/channel/decisions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/decisions.js +90 -0
- package/lib/types/dsh-adapter/channel/emitter.d.ts +10 -0
- package/lib/types/dsh-adapter/channel/emitter.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/emitter.js +71 -0
- package/lib/types/dsh-adapter/channel/external-commands.d.ts +31 -0
- package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/external-commands.js +187 -0
- package/lib/types/dsh-adapter/channel/file-actions.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/file-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/file-actions.js +45 -0
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +13 -0
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/input-actions.js +135 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +37 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/input-delivery.js +305 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts +28 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/job-projection.js +150 -0
- package/lib/types/dsh-adapter/channel/lifetime-resources.d.ts +9 -0
- package/lib/types/dsh-adapter/channel/lifetime-resources.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/lifetime-resources.js +33 -0
- package/lib/types/dsh-adapter/channel/loaded-context.d.ts +40 -0
- package/lib/types/dsh-adapter/channel/loaded-context.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/loaded-context.js +62 -0
- package/lib/types/dsh-adapter/channel/local-actions.d.ts +70 -0
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/local-actions.js +108 -0
- package/lib/types/dsh-adapter/channel/mentions.d.ts +29 -0
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/mentions.js +235 -0
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts +30 -0
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/mode-actions.js +247 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +35 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +199 -0
- package/lib/types/dsh-adapter/channel/mode-permission.d.ts +58 -0
- package/lib/types/dsh-adapter/channel/mode-permission.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/mode-permission.js +240 -0
- package/lib/types/dsh-adapter/channel/mode-roster.d.ts +51 -0
- package/lib/types/dsh-adapter/channel/mode-roster.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/mode-roster.js +119 -0
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +46 -0
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/model-actions.js +275 -0
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +32 -0
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/model-switch.js +98 -0
- package/lib/types/dsh-adapter/channel/notifications.d.ts +9 -0
- package/lib/types/dsh-adapter/channel/notifications.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/notifications.js +24 -0
- package/lib/types/dsh-adapter/channel/owner.d.ts +18 -0
- package/lib/types/dsh-adapter/channel/owner.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/owner.js +73 -0
- package/lib/types/dsh-adapter/channel/paths.d.ts +31 -0
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/paths.js +147 -0
- package/lib/types/dsh-adapter/channel/permissions.d.ts +40 -0
- package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/permissions.js +187 -0
- package/lib/types/dsh-adapter/channel/preferences.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/preferences.js +103 -0
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts +13 -0
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/projection-helpers.js +63 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts +40 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/projection.js +1021 -0
- package/lib/types/dsh-adapter/channel/reports.d.ts +32 -0
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/reports.js +171 -0
- package/lib/types/dsh-adapter/channel/session-actions.d.ts +13 -0
- package/lib/types/dsh-adapter/channel/session-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-actions.js +29 -0
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts +32 -0
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-adoption.js +35 -0
- package/lib/types/dsh-adapter/channel/session-fork.d.ts +19 -0
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-fork.js +85 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +32 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +62 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +81 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-metadata.js +209 -0
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +11 -0
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-reset.js +44 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +56 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-resume.js +240 -0
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +19 -0
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-rewind.js +128 -0
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +19 -0
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +138 -0
- package/lib/types/dsh-adapter/channel/session-tree.d.ts +10 -0
- package/lib/types/dsh-adapter/channel/session-tree.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-tree.js +503 -0
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +4 -0
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/settings-host.js +256 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts +33 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.js +215 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +46 -0
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/state.js +31 -0
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +47 -0
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/subagent-projection.js +140 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts +73 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/transcript.js +312 -0
- package/lib/types/dsh-adapter/channel/types.d.ts +162 -0
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/types.js +1 -0
- package/lib/types/dsh-adapter/channel/usage.d.ts +13 -0
- package/lib/types/dsh-adapter/channel/usage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/usage.js +48 -0
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/workspace-actions.js +56 -0
- package/lib/types/dsh-adapter/channel-facade-actions.d.ts +25 -0
- package/lib/types/dsh-adapter/channel-facade-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel-facade-actions.js +55 -0
- package/lib/types/dsh-adapter/channel-scene-outlet.d.ts +6 -0
- package/lib/types/dsh-adapter/channel-scene-outlet.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel-scene-outlet.js +13 -0
- package/lib/types/dsh-adapter/channel-ui.d.ts +9 -0
- package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel-ui.js +128 -0
- package/lib/types/dsh-adapter/channel.d.ts +9 -1525
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +753 -8145
- package/lib/types/dsh-adapter/command-trees.d.ts +1 -0
- package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -1
- package/lib/types/dsh-adapter/command-trees.js +20 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +8 -4
- package/lib/types/dsh-adapter/compat/liveSession.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.js +28 -3
- package/lib/types/dsh-adapter/compat/persistence.d.ts +21 -0
- package/lib/types/dsh-adapter/compat/persistence.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/persistence.js +17 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +50 -11
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +325 -36
- package/lib/types/dsh-adapter/component-identity.d.ts +1 -1
- package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -1
- package/lib/types/dsh-adapter/component-identity.js +1 -1
- package/lib/types/dsh-adapter/contract.d.ts +11 -9
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +19 -12
- package/lib/types/dsh-adapter/decision-guard.d.ts +56 -12
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/decision-guard.js +134 -22
- package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/dialogs.js +13 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts +5 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +53 -15
- package/lib/types/dsh-adapter/extension-events.d.ts +2 -9
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extension-events.js +0 -20
- package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extensions.js +3 -2
- package/lib/types/dsh-adapter/host-grants.d.ts +23 -0
- package/lib/types/dsh-adapter/host-grants.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-grants.js +45 -0
- package/lib/types/dsh-adapter/jobs.d.ts +2 -46
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +0 -25
- package/lib/types/dsh-adapter/message-observer.d.ts +15 -2
- package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -1
- package/lib/types/dsh-adapter/message-observer.js +157 -28
- package/lib/types/dsh-adapter/plugin-host.d.ts +80 -11
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-host.js +438 -41
- package/lib/types/dsh-adapter/plugin-storage.d.ts +11 -1
- package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-storage.js +150 -11
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +75 -34
- package/lib/types/dsh-adapter/plugins-info.d.ts +2 -2
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +11 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +3 -2
- package/lib/types/dsh-adapter/providerWizard.d.ts +2 -159
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.d.ts +8 -0
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +18 -0
- package/lib/types/dsh-adapter/recap.d.ts +1 -9
- package/lib/types/dsh-adapter/recap.d.ts.map +1 -1
- package/lib/types/dsh-adapter/recap.js +0 -14
- package/lib/types/dsh-adapter/renderers.d.ts +1 -0
- package/lib/types/dsh-adapter/renderers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/renderers.js +26 -1
- package/lib/types/dsh-adapter/scenes.d.ts +3 -1
- package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/scenes.js +31 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts +14 -95
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessionTree.js +51 -36
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +40 -19
- package/lib/types/dsh-adapter/sessions/frames.js +2 -0
- package/lib/types/dsh-adapter/sessions/index.d.ts +1 -1
- package/lib/types/dsh-adapter/sessions/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/index.js +1 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts +23 -0
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +28 -17
- package/lib/types/dsh-adapter/sessions/store.d.ts +2 -2
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +12 -11
- package/lib/types/dsh-adapter/sessions/types.d.ts +4 -128
- package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/types.js +0 -13
- package/lib/types/dsh-adapter/settings-sections.d.ts +4 -95
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +50 -13
- package/lib/types/dsh-adapter/settingsEditor.d.ts +2 -36
- package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settingsEditor.js +0 -18
- package/lib/types/dsh-adapter/shortcuts.d.ts +5 -0
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
- package/lib/types/dsh-adapter/shortcuts.js +49 -0
- package/lib/types/dsh-adapter/status.d.ts +5 -0
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +29 -0
- package/lib/types/dsh-adapter/subagents.d.ts +9 -49
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +92 -1
- package/lib/types/dsh-adapter/themes.d.ts +1 -0
- package/lib/types/dsh-adapter/themes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/themes.js +29 -0
- package/lib/types/dsh-adapter/toast.d.ts +13 -0
- package/lib/types/dsh-adapter/toast.d.ts.map +1 -1
- package/lib/types/dsh-adapter/toast.js +31 -1
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +2 -1
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/aggregate.js +2 -1
- package/lib/types/dsh-adapter/trajectory/guards.d.ts +37 -18
- package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/guards.js +43 -5
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts +2 -2
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/projection.d.ts +31 -13
- package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/projection.js +71 -14
- package/lib/types/dsh-adapter/trajectory/types.d.ts +1 -1
- package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/transcript-images.d.ts +2 -19
- package/lib/types/dsh-adapter/transcript-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.d.ts +2 -49
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.js +23 -3
- package/lib/types/i18n.d.ts +19 -7
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +8 -3
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +30 -33
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +32 -64
- package/lib/types/ink/get-max-width.d.ts +7 -15
- package/lib/types/ink/get-max-width.d.ts.map +1 -1
- package/lib/types/ink/get-max-width.js +7 -20
- package/lib/types/ink/ink.d.ts +1 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +22 -3
- package/lib/types/ink/layout/node.d.ts +2 -0
- package/lib/types/ink/layout/node.d.ts.map +1 -1
- package/lib/types/ink/layout/yoga.d.ts +1 -0
- package/lib/types/ink/layout/yoga.d.ts.map +1 -1
- package/lib/types/ink/layout/yoga.js +3 -0
- package/lib/types/ink/node-cache.d.ts +11 -0
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/node-cache.js +3 -0
- package/lib/types/ink/output.d.ts +6 -1
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +55 -65
- package/lib/types/ink/render-node-to-output.d.ts +24 -1
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +195 -71
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +14 -2
- package/lib/types/ink/styles.d.ts +12 -0
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/tabstops.d.ts +3 -2
- package/lib/types/ink/tabstops.d.ts.map +1 -1
- package/lib/types/ink/tabstops.js +5 -4
- package/lib/types/ink/wrap-text.js +2 -2
- package/lib/types/modelGroups.d.ts +1 -1
- package/lib/types/modelGroups.d.ts.map +1 -1
- package/lib/types/modelRoute.js +1 -1
- package/lib/types/native-ts/yoga-layout/index.d.ts +8 -3
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.js +23 -8
- package/lib/types/plugin-host.d.ts +3 -4
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/plugin-host.js +8 -6
- package/lib/types/screens/AgentView.d.ts +1 -1
- package/lib/types/screens/AgentView.d.ts.map +1 -1
- package/lib/types/screens/Chat.d.ts +3 -2
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +91 -17
- package/lib/types/screens/SessionBrowser.d.ts +1 -1
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionTree.d.ts +1 -1
- package/lib/types/screens/SessionTree.d.ts.map +1 -1
- package/lib/types/screens/Settings.d.ts +1 -1
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.d.ts +1 -1
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +40 -1
- package/lib/types/screens/TrajectoryScene.d.ts +1 -1
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
- package/lib/types/sessionModes.d.ts +11 -15
- package/lib/types/sessionModes.d.ts.map +1 -1
- package/lib/types/sessionModes.js +11 -0
- package/lib/types/tuiDisplayPrefs.d.ts +2 -68
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +5 -1
- package/lib/types/utils/credentials.d.ts +13 -0
- package/lib/types/utils/credentials.d.ts.map +1 -0
- package/lib/types/utils/credentials.js +41 -0
- package/lib/types/utils/fileSuggestions.d.ts +2 -9
- package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
- package/lib/types/utils/fold-long-lines.d.ts +38 -0
- package/lib/types/utils/fold-long-lines.d.ts.map +1 -0
- package/lib/types/utils/fold-long-lines.js +91 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/pi-ai.d.ts +1 -1
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +4 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.js +15 -2
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +10 -10
- package/package.json +125 -81
- package/presets/liangshen/.dsh-tui-managed.json +1 -1
- package/presets/liangshen/agent.cordis.yml +20 -4
- package/presets/liangshen/compaction-epoch.mjs +3 -1
- package/presets/liangshen/instruction-hint.mjs +2 -1
- package/presets/liangshen/session-events.mjs +8 -0
- package/lib/types/dsh-adapter/grants.d.ts.map +0 -1
- package/lib/types/dsh-adapter/host-descriptor.d.ts +0 -24
- package/lib/types/dsh-adapter/host-descriptor.d.ts.map +0 -1
- package/lib/types/dsh-adapter/host-descriptor.js +0 -169
- package/lib/types/dsh-adapter/plugin-test-utils.d.ts +0 -62
- package/lib/types/dsh-adapter/plugin-test-utils.d.ts.map +0 -1
- package/lib/types/dsh-adapter/plugin-test-utils.js +0 -61
- package/lib/types/plugin-spec/negotiate.d.ts.map +0 -1
- package/lib/types/plugin-spec/permission-scope.d.ts.map +0 -1
- package/lib/types/plugin-spec/registry.d.ts.map +0 -1
- package/lib/types/plugin-spec/schema-check.d.ts.map +0 -1
- package/lib/types/plugin-spec/tui-extension.d.ts +0 -16
- package/lib/types/plugin-spec/tui-extension.d.ts.map +0 -1
- package/lib/types/plugin-spec/tui-extension.js +0 -79
- package/lib/types/plugin-spec/types.d.ts.map +0 -1
- package/lib/types/plugin-spec/validate.d.ts.map +0 -1
- package/lib/types/test-utils.d.ts +0 -2
- package/lib/types/test-utils.d.ts.map +0 -1
- package/lib/types/test-utils.js +0 -8
- /package/lib/types/{plugin-spec → adapter/standard}/negotiate.d.ts +0 -0
- /package/lib/types/{plugin-spec → adapter/standard}/negotiate.js +0 -0
- /package/lib/types/{plugin-spec → adapter/standard}/registry.d.ts +0 -0
- /package/lib/types/{plugin-spec → adapter/standard}/schema-check.d.ts +0 -0
- /package/lib/types/{plugin-spec → adapter/standard}/types.js +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { ChannelUi } from '../../adapter/ports/channel-ui.js';
|
|
2
|
+
import type { ChatRow, ToolCallView, ToolResultView, NotificationItem, TodoPanelItem, PendingMessage } from '../../adapter/ports/channel-view.js';
|
|
3
|
+
export type { ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobRow, TokenUsage, TokenBucket, NotificationItem, ActivityStatus, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, JobControl, StagedImageInput, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult } from '../../adapter/ports/channel-view.js';
|
|
4
|
+
import { type ContentBlock, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
5
|
+
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
6
|
+
import { type BackgroundJobState } from '../jobs.js';
|
|
7
|
+
import { type TuiSceneDescriptor } from '../scenes.js';
|
|
8
|
+
import { type SubagentState } from '../subagents.js';
|
|
9
|
+
/** dsh-llm LlmRuntime as the side-question needs it: one streaming call. */
|
|
10
|
+
export type SideQuestionLlm = {
|
|
11
|
+
stream(options: object): AsyncIterable<StreamChunk>;
|
|
12
|
+
};
|
|
13
|
+
export type PermissionPresetService = {
|
|
14
|
+
names?: unknown;
|
|
15
|
+
current?: (events: readonly SessionEvent[]) => unknown;
|
|
16
|
+
optionOf?: (name: string) => unknown;
|
|
17
|
+
};
|
|
18
|
+
export type ChannelImageBlock = Extract<ContentBlock, {
|
|
19
|
+
type: 'image';
|
|
20
|
+
}>;
|
|
21
|
+
export type ChannelImageMediaType = ChannelImageBlock['attachment']['mediaType'];
|
|
22
|
+
/** The dsh-tools registry seam dsh-tui reads presentations through. The
|
|
23
|
+
* registry lives on the host plane; `get` takes the live agent as the
|
|
24
|
+
* scope so a preset's own tool definitions resolve (dsh-host-apiproxy's
|
|
25
|
+
* presenter pattern). */
|
|
26
|
+
export interface ToolsRegistryLike {
|
|
27
|
+
get(name: string, scope?: unknown): {
|
|
28
|
+
presentCall?(args: unknown): unknown;
|
|
29
|
+
presentResult?(args: unknown, result: unknown): unknown;
|
|
30
|
+
} | undefined;
|
|
31
|
+
}
|
|
32
|
+
/** Re-derives the presentation views foldRows dropped, threaded into
|
|
33
|
+
* foldBack (module-level, no ctx access) by the channel. */
|
|
34
|
+
export interface ToolViewPresenter {
|
|
35
|
+
call(name: string, rawArgs: string): ToolCallView | undefined;
|
|
36
|
+
result(name: string, rawArgs: string, data: SessionEvent<'tool/result'>['data']): ToolResultView | undefined;
|
|
37
|
+
}
|
|
38
|
+
/** Raw host implementation; the renderer receives ChannelUi instead. */
|
|
39
|
+
export interface Channel extends Omit<ChannelUi, 'pluginScene' | 'traceEvents'> {
|
|
40
|
+
readonly pluginScene: TuiSceneDescriptor | undefined;
|
|
41
|
+
traceEvents(): readonly SessionEvent[];
|
|
42
|
+
releaseContributions(): void;
|
|
43
|
+
}
|
|
44
|
+
type MutableChannelView = {
|
|
45
|
+
-readonly [K in keyof ChannelUi]: ChannelUi[K];
|
|
46
|
+
};
|
|
47
|
+
/** Internal writable store; command signatures are owned once by ChannelUi. */
|
|
48
|
+
export interface ChannelState extends Omit<MutableChannelView, 'rows' | 'notifications' | 'todos' | 'pending' | 'tpsSamples' | 'subagents' | 'backgroundJobs' | 'pluginScene' | 'traceEvents'> {
|
|
49
|
+
rows: ChatRow[];
|
|
50
|
+
notifications: NotificationItem[];
|
|
51
|
+
/** Per-turn tps samples (sparkline history), oldest first. */
|
|
52
|
+
tpsSamples: {
|
|
53
|
+
tps: number;
|
|
54
|
+
at: number;
|
|
55
|
+
}[];
|
|
56
|
+
/** Latest todo-list snapshot (see the public Channel type). */
|
|
57
|
+
todos: TodoPanelItem[];
|
|
58
|
+
/** Messages submitted while working, awaiting their turn/step boundary.
|
|
59
|
+
* Driven by agent inbox events (inserted/claimed/discarded). */
|
|
60
|
+
pending: PendingMessage[];
|
|
61
|
+
/** Open plugin scene mirrored from the scenes runtime (see the public Channel type). */
|
|
62
|
+
pluginScene: TuiSceneDescriptor | undefined;
|
|
63
|
+
/** Active subagents roster (see the public Channel type). */
|
|
64
|
+
subagents: readonly SubagentState[];
|
|
65
|
+
/** Background jobs of the current session (see the public Channel type). */
|
|
66
|
+
backgroundJobs: readonly BackgroundJobState[];
|
|
67
|
+
/** @internal event bump (the public `notify(text)` posts a notification). */
|
|
68
|
+
emit(): void;
|
|
69
|
+
/** @internal frame-aligned emit for high-frequency streaming deltas:
|
|
70
|
+
* version bumps synchronously but listeners fire at most once per 16ms
|
|
71
|
+
* window (trailing edge). */
|
|
72
|
+
emitStream(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Bind the plugin's approval store (post-construction): row derivation
|
|
75
|
+
* reads its parked ask ids for the "needs input" state, and its emits
|
|
76
|
+
* re-publish as agent-view changes.
|
|
77
|
+
*/
|
|
78
|
+
bindApprovalStore(store: {
|
|
79
|
+
pendingAgentIds(): readonly string[];
|
|
80
|
+
pendingAgentDetail(agentId: string): {
|
|
81
|
+
toolName: string;
|
|
82
|
+
reason?: string;
|
|
83
|
+
command?: string;
|
|
84
|
+
} | undefined;
|
|
85
|
+
subscribe(listener: () => void): () => void;
|
|
86
|
+
}): void;
|
|
87
|
+
/** See {@link Channel.releaseContributions}. */
|
|
88
|
+
releaseContributions(): void;
|
|
89
|
+
/** Live session event log (see the public Channel type, `/trace`). */
|
|
90
|
+
traceEvents(): readonly SessionEvent[];
|
|
91
|
+
}
|
|
92
|
+
export type FileSuggestionFs = {
|
|
93
|
+
resolve(path: string): Promise<{
|
|
94
|
+
displayPath: string;
|
|
95
|
+
}>;
|
|
96
|
+
listDir(target: {
|
|
97
|
+
displayPath: string;
|
|
98
|
+
}): Promise<Array<{
|
|
99
|
+
name: string;
|
|
100
|
+
type: 'file' | 'directory' | 'other';
|
|
101
|
+
target?: {
|
|
102
|
+
displayPath: string;
|
|
103
|
+
};
|
|
104
|
+
}>>;
|
|
105
|
+
};
|
|
106
|
+
/** The fs-service surface `@`-mention expansion consumes (dsh-fs-local). */
|
|
107
|
+
export interface MentionFs {
|
|
108
|
+
resolve(path: string): Promise<{
|
|
109
|
+
displayPath: string;
|
|
110
|
+
}>;
|
|
111
|
+
stat(target: {
|
|
112
|
+
displayPath: string;
|
|
113
|
+
}): Promise<{
|
|
114
|
+
type: 'file' | 'directory' | 'other';
|
|
115
|
+
} | undefined>;
|
|
116
|
+
readText(target: {
|
|
117
|
+
displayPath: string;
|
|
118
|
+
}): Promise<string>;
|
|
119
|
+
readBytes?(target: {
|
|
120
|
+
displayPath: string;
|
|
121
|
+
}, signal: AbortSignal | undefined, maxBytes: number): Promise<Uint8Array>;
|
|
122
|
+
listDir(target: {
|
|
123
|
+
displayPath: string;
|
|
124
|
+
}): Promise<Array<{
|
|
125
|
+
name: string;
|
|
126
|
+
type: 'file' | 'directory' | 'other';
|
|
127
|
+
}>>;
|
|
128
|
+
}
|
|
129
|
+
export type MentionImageBlock = ChannelImageBlock;
|
|
130
|
+
export type MentionImageMediaType = ChannelImageMediaType;
|
|
131
|
+
/** Attachment subset used to turn an image path into a durable user block. */
|
|
132
|
+
export interface MentionAttachments {
|
|
133
|
+
readonly imageLimits: {
|
|
134
|
+
readonly maxImageBytes: number;
|
|
135
|
+
readonly maxImagesPerMessage: number;
|
|
136
|
+
readonly maxMessageImageBytes: number;
|
|
137
|
+
readonly mediaTypes: readonly MentionImageMediaType[];
|
|
138
|
+
};
|
|
139
|
+
saveImage(input: {
|
|
140
|
+
data: Uint8Array;
|
|
141
|
+
mediaType: MentionImageMediaType;
|
|
142
|
+
name?: string;
|
|
143
|
+
}): Promise<MentionImageBlock['attachment']>;
|
|
144
|
+
}
|
|
145
|
+
/** One mention target that resolved and stat'ed to something attachable. */
|
|
146
|
+
export interface ResolvedMention {
|
|
147
|
+
target: {
|
|
148
|
+
displayPath: string;
|
|
149
|
+
};
|
|
150
|
+
info: {
|
|
151
|
+
type: 'file' | 'directory' | 'other';
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export interface MentionExpansion {
|
|
155
|
+
/** Model-facing blocks: the typed text first, one block per attachment. */
|
|
156
|
+
blocks: ContentBlock[];
|
|
157
|
+
/** Paths that resolved and were attached (for the confirmation notice). */
|
|
158
|
+
attached: string[];
|
|
159
|
+
/** Mention tokens that failed to resolve (kept literal, warned about). */
|
|
160
|
+
missing: string[];
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import type { TokenUsage } from './types.js';
|
|
3
|
+
/** 全零 token 累计(新会话 / 复位用)。 */
|
|
4
|
+
export declare function emptyTokenUsage(): TokenUsage;
|
|
5
|
+
/** Context-bar token estimate (pi-nano-context: ~4 chars per token). */
|
|
6
|
+
export declare function estimateTokens(text: string): number;
|
|
7
|
+
/** Whether one stream chunk advances the first-token/decode boundary. */
|
|
8
|
+
export declare function isTokenDelta(chunk: StreamChunk): boolean;
|
|
9
|
+
/** Character payload of one token-bearing stream delta for the live fallback. */
|
|
10
|
+
export declare function tokenDeltaChars(chunk: StreamChunk): number;
|
|
11
|
+
/** Provider output count when usable; durable imports may predate strict validation. */
|
|
12
|
+
export declare function usageOutputTokens(usage: unknown): number | undefined;
|
|
13
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,8BAA8B;AAC9B,wBAAgB,eAAe,IAAI,UAAU,CAS5C;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAUxD;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAU1D;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMpE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** 全零 token 累计(新会话 / 复位用)。 */
|
|
2
|
+
export function emptyTokenUsage() {
|
|
3
|
+
return {
|
|
4
|
+
input: 0,
|
|
5
|
+
output: 0,
|
|
6
|
+
cacheRead: 0,
|
|
7
|
+
cacheWrite: 0,
|
|
8
|
+
peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
9
|
+
idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** Context-bar token estimate (pi-nano-context: ~4 chars per token). */
|
|
13
|
+
export function estimateTokens(text) {
|
|
14
|
+
return Math.ceil(text.length / 4);
|
|
15
|
+
}
|
|
16
|
+
/** Whether one stream chunk advances the first-token/decode boundary. */
|
|
17
|
+
export function isTokenDelta(chunk) {
|
|
18
|
+
switch (chunk.type) {
|
|
19
|
+
case 'text-delta':
|
|
20
|
+
case 'reasoning-delta':
|
|
21
|
+
return chunk.text !== '';
|
|
22
|
+
case 'tool-call-delta':
|
|
23
|
+
return chunk.argumentsDelta !== '' || chunk.name !== undefined;
|
|
24
|
+
default:
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Character payload of one token-bearing stream delta for the live fallback. */
|
|
29
|
+
export function tokenDeltaChars(chunk) {
|
|
30
|
+
switch (chunk.type) {
|
|
31
|
+
case 'text-delta':
|
|
32
|
+
case 'reasoning-delta':
|
|
33
|
+
return chunk.text.length;
|
|
34
|
+
case 'tool-call-delta':
|
|
35
|
+
return (chunk.name?.length ?? 0) + chunk.argumentsDelta.length;
|
|
36
|
+
default:
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Provider output count when usable; durable imports may predate strict validation. */
|
|
41
|
+
export function usageOutputTokens(usage) {
|
|
42
|
+
if (typeof usage !== 'object' || usage === null)
|
|
43
|
+
return undefined;
|
|
44
|
+
const value = usage.outputTokens;
|
|
45
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0
|
|
46
|
+
? value
|
|
47
|
+
: undefined;
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TuiWorkspaceHost, TuiWorkspaceTarget } from '../workspaces.js';
|
|
2
|
+
import type { ChannelOwner } from './owner.js';
|
|
3
|
+
import type { NewSessionTarget } from './session-resume.js';
|
|
4
|
+
import type { ChannelState } from './types.js';
|
|
5
|
+
/** Workspace command/query surface. The selected cwd is published only by a successful session adoption. */
|
|
6
|
+
export declare function createWorkspaceActions(state: Pick<ChannelState, 'cwd' | 'displayCwd' | 'working' | 'emit'>, deps: {
|
|
7
|
+
owner: Pick<ChannelOwner, 'assertActive'>;
|
|
8
|
+
service: TuiWorkspaceHost;
|
|
9
|
+
newSession(target?: NewSessionTarget): Promise<boolean>;
|
|
10
|
+
refreshGitBranch(): void;
|
|
11
|
+
notify: ChannelState['notify'];
|
|
12
|
+
}): {
|
|
13
|
+
listWorkspaces: () => Promise<readonly TuiWorkspaceTarget[]>;
|
|
14
|
+
resolveWorkspace: (uri: string) => Promise<TuiWorkspaceTarget | undefined>;
|
|
15
|
+
switchWorkspace: (target: TuiWorkspaceTarget) => Promise<boolean>;
|
|
16
|
+
renameWorkspace: (title: string) => Promise<boolean>;
|
|
17
|
+
workspaceCommands: () => readonly Pick<import("../workspaces.js").TuiWorkspaceCommand, "name" | "description" | "aliases">[];
|
|
18
|
+
runWorkspaceCommand: (name: string, input: string) => Promise<import("../workspaces.js").TuiWorkspaceCommandResult | undefined>;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=workspace-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/workspace-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,4GAA4G;AAC5G,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,EACpE,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAA;IACzC,OAAO,EAAE,gBAAgB,CAAA;IACzB,UAAU,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACvD,gBAAgB,IAAI,IAAI,CAAA;IACxB,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B;;4BAI8B,MAAM;8BACE,kBAAkB,KAAG,OAAO,CAAC,OAAO,CAAC;6BAsBtC,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;;gCAauF,MAAM,SAAS,MAAM;EAC5K"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { t } from '../../i18n.js';
|
|
3
|
+
/** Workspace command/query surface. The selected cwd is published only by a successful session adoption. */
|
|
4
|
+
export function createWorkspaceActions(state, deps) {
|
|
5
|
+
const { service, notify } = deps;
|
|
6
|
+
const listWorkspaces = () => service.list(state.cwd);
|
|
7
|
+
const resolveWorkspace = (uri) => service.resolve(uri, state.cwd);
|
|
8
|
+
const switchWorkspace = async (target) => {
|
|
9
|
+
deps.owner.assertActive();
|
|
10
|
+
if (state.working) {
|
|
11
|
+
notify(t('workspace-switch-working'), { color: 'warning' });
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (target.kind === 'local') {
|
|
15
|
+
try {
|
|
16
|
+
if (!statSync(target.cwd).isDirectory())
|
|
17
|
+
throw new Error('not a directory');
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
notify(t('workspace-open-invalid', { target: target.label }), { color: 'error', timeoutMs: 8000 });
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Keep the target private to the guarded create/adopt transaction. In
|
|
25
|
+
// particular, do not speculate into shared cwd/displayCwd and then try to
|
|
26
|
+
// roll it back: a slower failed request must never erase a newer success.
|
|
27
|
+
try {
|
|
28
|
+
const switched = await deps.newSession({ cwd: target.cwd, displayCwd: target.description ?? target.uri });
|
|
29
|
+
if (!switched)
|
|
30
|
+
return false;
|
|
31
|
+
deps.refreshGitBranch();
|
|
32
|
+
notify(t('workspace-switched', { target: target.label }));
|
|
33
|
+
state.emit();
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
notify(t('workspace-command-failed', { err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const renameWorkspace = async (title) => {
|
|
42
|
+
deps.owner.assertActive();
|
|
43
|
+
try {
|
|
44
|
+
const renamed = await service.rename(state.cwd, title);
|
|
45
|
+
state.displayCwd = renamed.description ?? renamed.uri;
|
|
46
|
+
notify(t('workspace-renamed', { title: renamed.label }));
|
|
47
|
+
state.emit();
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
notify(t('workspace-rename-failed', { err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return { listWorkspaces, resolveWorkspace, switchWorkspace, renameWorkspace, workspaceCommands: () => service.commands(), runWorkspaceCommand: (name, input) => service.runCommand(name, input, state.cwd) };
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T1 Channel-facade action helpers.
|
|
3
|
+
*
|
|
4
|
+
* These helpers route production Channel notifications/submits through the
|
|
5
|
+
* shadow-guarded `HostFacade.channel.actions` when available. In
|
|
6
|
+
* passive/replay shadow modes they never fall back to the native Channel:
|
|
7
|
+
* if the facade is missing or the shadow policy rejects the action, the call
|
|
8
|
+
* is dropped instead of bypassing the guard.
|
|
9
|
+
*/
|
|
10
|
+
import type { AdapterRuntimeOptions } from '../adapter/kernel/runtime.js';
|
|
11
|
+
export interface ChannelFacadeNotifyOptions {
|
|
12
|
+
readonly color?: 'error' | 'warning' | 'success';
|
|
13
|
+
readonly timeoutMs?: number;
|
|
14
|
+
}
|
|
15
|
+
export type ChannelFacadeRuntime = AdapterRuntimeOptions;
|
|
16
|
+
export type ChannelFacadeActionOutcome = 'facade' | 'native' | 'dropped';
|
|
17
|
+
/** Route a notification through HostFacade.channel when safely possible. */
|
|
18
|
+
export declare function notifyViaChannelFacade(pluginHost: unknown, nativeChannel: {
|
|
19
|
+
notify(text: string, options?: ChannelFacadeNotifyOptions): unknown;
|
|
20
|
+
}, runtime: ChannelFacadeRuntime, text: string, options?: ChannelFacadeNotifyOptions): ChannelFacadeActionOutcome;
|
|
21
|
+
/** Route a submit through HostFacade.channel when safely possible. */
|
|
22
|
+
export declare function submitViaChannelFacade(pluginHost: unknown, nativeChannel: {
|
|
23
|
+
submit(text: string): void;
|
|
24
|
+
}, runtime: ChannelFacadeRuntime, text: string): ChannelFacadeActionOutcome;
|
|
25
|
+
//# sourceMappingURL=channel-facade-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-facade-actions.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/channel-facade-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAGzE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAA;AAExD,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAMxE,4EAA4E;AAC5E,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,OAAO,EACnB,aAAa,EAAE;IAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAA;CAAE,EACtF,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,0BAA0B,GACnC,0BAA0B,CAiB5B;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,OAAO,EACnB,aAAa,EAAE;IAAE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAC7C,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,MAAM,GACX,0BAA0B,CAe5B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T1 Channel-facade action helpers.
|
|
3
|
+
*
|
|
4
|
+
* These helpers route production Channel notifications/submits through the
|
|
5
|
+
* shadow-guarded `HostFacade.channel.actions` when available. In
|
|
6
|
+
* passive/replay shadow modes they never fall back to the native Channel:
|
|
7
|
+
* if the facade is missing or the shadow policy rejects the action, the call
|
|
8
|
+
* is dropped instead of bypassing the guard.
|
|
9
|
+
*/
|
|
10
|
+
import { getHostFacade } from './plugin-host.js';
|
|
11
|
+
function isShadowAdapterRuntime(runtime) {
|
|
12
|
+
return runtime.mode === 'passive-shadow' || runtime.mode === 'replay-shadow';
|
|
13
|
+
}
|
|
14
|
+
/** Route a notification through HostFacade.channel when safely possible. */
|
|
15
|
+
export function notifyViaChannelFacade(pluginHost, nativeChannel, runtime, text, options) {
|
|
16
|
+
const facade = getHostFacade(pluginHost);
|
|
17
|
+
if (facade?.channel !== undefined) {
|
|
18
|
+
try {
|
|
19
|
+
facade.channel.actions.notify(text, options);
|
|
20
|
+
return 'facade';
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (isShadowAdapterRuntime(runtime))
|
|
24
|
+
return 'dropped';
|
|
25
|
+
// Non-shadow: a facade that exists but throws is not a "not mounted"
|
|
26
|
+
// condition; surface it instead of silently falling back to native.
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (isShadowAdapterRuntime(runtime)) {
|
|
31
|
+
return 'dropped';
|
|
32
|
+
}
|
|
33
|
+
nativeChannel.notify(text, options);
|
|
34
|
+
return 'native';
|
|
35
|
+
}
|
|
36
|
+
/** Route a submit through HostFacade.channel when safely possible. */
|
|
37
|
+
export function submitViaChannelFacade(pluginHost, nativeChannel, runtime, text) {
|
|
38
|
+
const facade = getHostFacade(pluginHost);
|
|
39
|
+
if (facade?.channel !== undefined) {
|
|
40
|
+
try {
|
|
41
|
+
facade.channel.actions.submit(text);
|
|
42
|
+
return 'facade';
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (isShadowAdapterRuntime(runtime))
|
|
46
|
+
return 'dropped';
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else if (isShadowAdapterRuntime(runtime)) {
|
|
51
|
+
return 'dropped';
|
|
52
|
+
}
|
|
53
|
+
nativeChannel.submit(text);
|
|
54
|
+
return 'native';
|
|
55
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChannelUi } from '../adapter/ports/channel-ui.js';
|
|
3
|
+
import type { TuiSceneDescriptor } from './scenes.js';
|
|
4
|
+
/** Renderer-only outlet. Component identity stays in the existing scene registry. */
|
|
5
|
+
export declare function createChannelSceneOutlet(current: () => TuiSceneDescriptor | undefined): (id: string, channel: ChannelUi) => React.ReactNode;
|
|
6
|
+
//# sourceMappingURL=channel-scene-outlet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-scene-outlet.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/channel-scene-outlet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,qFAAqF;AACrF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,kBAAkB,GAAG,SAAS,IAC5E,IAAI,MAAM,EAAE,SAAS,SAAS,KAAG,KAAK,CAAC,SAAS,CAOzD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as ui from '../ui.js';
|
|
3
|
+
/** Renderer-only outlet. Component identity stays in the existing scene registry. */
|
|
4
|
+
export function createChannelSceneOutlet(current) {
|
|
5
|
+
return (id, channel) => {
|
|
6
|
+
const scene = current();
|
|
7
|
+
if (scene?.id !== id)
|
|
8
|
+
throw new Error(`Scene unavailable: ${id}`);
|
|
9
|
+
return React.createElement(scene.component, {
|
|
10
|
+
React, ui, channel, close: () => channel.closePluginScene(),
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Production assembly for the in-process Channel renderer capability. */
|
|
2
|
+
import type { ChannelState } from './channel.js';
|
|
3
|
+
import type { ChannelUi } from '../adapter/channel/ui-policy.js';
|
|
4
|
+
import type { AdapterMode } from '../adapter/kernel/runtime.js';
|
|
5
|
+
export declare function mountChannelUi(ctx: unknown, channel: ChannelState, pluginHost: unknown, mode: AdapterMode): {
|
|
6
|
+
channel: ChannelUi;
|
|
7
|
+
dispose(): void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=channel-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-ui.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/channel-ui.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAY/D,wBAAgB,cAAc,CAC5B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,WAAW,GAChB;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,OAAO,IAAI,IAAI,CAAA;CAAE,CAkGzC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { bindChannelOwner, disposeChannelOwner, onChannelOwnerDispose } from './channel/owner.js';
|
|
2
|
+
import { createChannelUi, createChannelUiLease } from '../adapter/channel/ui.js';
|
|
3
|
+
import { getHostFacade } from './plugin-host.js';
|
|
4
|
+
import { getTuiChannelRegistration, onTuiChannelRegistration } from '../adapter/channel/host-registry.js';
|
|
5
|
+
function throwCleanupFailures(failures, message) {
|
|
6
|
+
if (failures.length === 1)
|
|
7
|
+
throw failures[0];
|
|
8
|
+
if (failures.length > 1)
|
|
9
|
+
throw new AggregateError(failures, message);
|
|
10
|
+
}
|
|
11
|
+
/** Re-probe interval while the kernel's channel slice is still absent. */
|
|
12
|
+
const FACADE_PROBE_MS = 250;
|
|
13
|
+
export function mountChannelUi(ctx, channel, pluginHost, mode) {
|
|
14
|
+
// A registration, rather than Channel object equality, is the authority for
|
|
15
|
+
// this mount. Re-registering the same Channel revokes retained UI handles.
|
|
16
|
+
const registration = getTuiChannelRegistration(ctx);
|
|
17
|
+
let ownerActive = true;
|
|
18
|
+
const lease = createChannelUiLease(() => ownerActive && getTuiChannelRegistration(ctx) === registration);
|
|
19
|
+
const releaseOwnerLease = onChannelOwnerDispose(channel, () => {
|
|
20
|
+
ownerActive = false;
|
|
21
|
+
lease.dispose();
|
|
22
|
+
});
|
|
23
|
+
const unsubscribe = onTuiChannelRegistration(ctx, next => {
|
|
24
|
+
if (next === registration)
|
|
25
|
+
return;
|
|
26
|
+
// Even a throwing notification cleanup cannot skip owner teardown.
|
|
27
|
+
try {
|
|
28
|
+
lease.dispose();
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
// Same-object registration only revokes this capability, not its successor.
|
|
32
|
+
if (next?.channel !== channel)
|
|
33
|
+
disposeChannelOwner(channel);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const local = createChannelUi(channel, mode, {
|
|
37
|
+
own: lease.own,
|
|
38
|
+
assertActive() {
|
|
39
|
+
lease.assertActive();
|
|
40
|
+
const current = resolve();
|
|
41
|
+
if (current !== local)
|
|
42
|
+
void current.version;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
// Before async kernel mount (or with the channel slice disabled), use
|
|
46
|
+
// the identical guarded local capability. Never downgrade after binding.
|
|
47
|
+
let mounted;
|
|
48
|
+
let mountedView;
|
|
49
|
+
// `getHostFacade()` builds a fresh facade graph on every call (KernelRuntime
|
|
50
|
+
// facade() allocates a new descriptor port + shadow-guarded wrapper), and
|
|
51
|
+
// `resolve()` runs on EVERY `channel.X` read — Chat reads ~70-90 properties
|
|
52
|
+
// per render, so re-resolving per read cost ~2.3us each (~0.2-0.4ms/frame)
|
|
53
|
+
// for a value that only ever changes when the kernel mounts the channel
|
|
54
|
+
// slice. Probe at most every FACADE_PROBE_MS while the slice is absent;
|
|
55
|
+
// once the facade exposes the channel UI, it stays that way for the
|
|
56
|
+
// kernel's lifetime (a re-registration disposes this mount's lease).
|
|
57
|
+
let facadeProbe;
|
|
58
|
+
let facadeProbeAt = 0;
|
|
59
|
+
let facadeProbeLocked = false;
|
|
60
|
+
const facadeNow = () => {
|
|
61
|
+
if (facadeProbeLocked)
|
|
62
|
+
return facadeProbe;
|
|
63
|
+
const now = Date.now();
|
|
64
|
+
if (facadeProbe !== undefined && now - facadeProbeAt < FACADE_PROBE_MS)
|
|
65
|
+
return facadeProbe;
|
|
66
|
+
facadeProbeAt = now;
|
|
67
|
+
facadeProbe = getHostFacade(pluginHost);
|
|
68
|
+
if (facadeProbe?.channel !== undefined)
|
|
69
|
+
facadeProbeLocked = true;
|
|
70
|
+
return facadeProbe;
|
|
71
|
+
};
|
|
72
|
+
const resolve = () => {
|
|
73
|
+
lease.assertActive();
|
|
74
|
+
const facade = facadeNow();
|
|
75
|
+
const ui = facade?.channel?.projection.ui;
|
|
76
|
+
if (ui === undefined) {
|
|
77
|
+
if (mounted !== undefined)
|
|
78
|
+
throw new Error('dsh-tui: mounted HostFacade lost Channel UI');
|
|
79
|
+
return local;
|
|
80
|
+
}
|
|
81
|
+
const next = ui();
|
|
82
|
+
if (next !== mounted) {
|
|
83
|
+
mounted = next;
|
|
84
|
+
mountedView = createChannelUi(next, mode, lease);
|
|
85
|
+
}
|
|
86
|
+
return mountedView;
|
|
87
|
+
};
|
|
88
|
+
// This external check does not resolve UI: owner.current() is called by
|
|
89
|
+
// leases, so resolving here would recurse through the owner guard.
|
|
90
|
+
bindChannelOwner(channel, () => ownerActive && getTuiChannelRegistration(ctx) === registration);
|
|
91
|
+
const view = Object.create(null);
|
|
92
|
+
for (const key of Object.keys(local)) {
|
|
93
|
+
Object.defineProperty(view, key, {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get() {
|
|
96
|
+
const value = resolve()[key];
|
|
97
|
+
if (typeof value !== 'function')
|
|
98
|
+
return value;
|
|
99
|
+
return (...args) => {
|
|
100
|
+
lease.assertActive();
|
|
101
|
+
const current = resolve();
|
|
102
|
+
return Reflect.apply(current[key], current, args);
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
channel: Object.freeze(view),
|
|
109
|
+
dispose() {
|
|
110
|
+
const failures = [];
|
|
111
|
+
const releaseOwner = () => {
|
|
112
|
+
const current = getTuiChannelRegistration(ctx);
|
|
113
|
+
// An old mount's late cleanup must not dispose a newer mount of A.
|
|
114
|
+
if (current === registration || current?.channel !== channel)
|
|
115
|
+
disposeChannelOwner(channel);
|
|
116
|
+
};
|
|
117
|
+
for (const cleanup of [unsubscribe, () => lease.dispose(), releaseOwnerLease, releaseOwner]) {
|
|
118
|
+
try {
|
|
119
|
+
cleanup();
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
failures.push(error);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
throwCleanupFailures(failures, 'dsh-tui: Channel UI cleanup failed');
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|