@deepseek-harness-tui/dsh-tui 0.10.0 → 0.10.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/README.md +146 -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 +227 -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/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/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +36 -8
- 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/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 +60 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/binding-events.js +159 -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 +34 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/input-delivery.js +241 -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 +184 -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 +121 -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 +132 -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 +27 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.js +183 -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 +750 -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 +3 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.js +23 -0
- 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/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 +25 -14
- package/lib/types/dsh-adapter/sessions/types.d.ts +2 -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/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 +103 -4
- 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/modelGroups.d.ts +1 -1
- package/lib/types/modelGroups.d.ts.map +1 -1
- package/lib/types/modelRoute.js +1 -1
- 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 +71 -9
- 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 +124 -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,108 @@
|
|
|
1
|
+
import { createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
|
|
3
|
+
import { writeActivityFrames } from '../../activityPrefs.js';
|
|
4
|
+
import { isPresetName, normalizeActivityPreset } from '../../components/activityFrames.js';
|
|
5
|
+
import { t } from '../../i18n.js';
|
|
6
|
+
import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
|
|
7
|
+
import { LOCAL_OUTPUT_LIMIT, preview } from './transcript.js';
|
|
8
|
+
/** Owns local-only transcript mutations, shell output, and live subagent queries. */
|
|
9
|
+
export function createLocalActions(deps) {
|
|
10
|
+
const { ctx, owner, binding, state, rowIds, projector, subagents, jobs, foldBack, workspace, shell, notify } = deps;
|
|
11
|
+
const current = (capture) => owner.current() && binding.isCurrent(capture);
|
|
12
|
+
return {
|
|
13
|
+
loadOlder() {
|
|
14
|
+
const restored = foldBack(state.rows, snapshotLiveSessionEvents(binding.agent.session), { call: projector.presentCallView, result: projector.presentResultView });
|
|
15
|
+
if (restored > 0)
|
|
16
|
+
state.emit();
|
|
17
|
+
return restored;
|
|
18
|
+
},
|
|
19
|
+
clear() {
|
|
20
|
+
state.rows.length = 0;
|
|
21
|
+
markChannelReadDirty(state.rows);
|
|
22
|
+
rowIds.value = 0;
|
|
23
|
+
projector.reset();
|
|
24
|
+
subagents.dropRows();
|
|
25
|
+
jobs.dropRows();
|
|
26
|
+
state.activeToolCount = 0;
|
|
27
|
+
state.responseChars = 0;
|
|
28
|
+
state.rows.push({ id: rowIds.value++, kind: 'notice', text: 'Session cleared' });
|
|
29
|
+
state.emit();
|
|
30
|
+
},
|
|
31
|
+
pushLocal(title, lines) {
|
|
32
|
+
state.rows.push({ id: rowIds.value++, kind: 'local', text: title });
|
|
33
|
+
for (const line of lines)
|
|
34
|
+
state.rows.push({ id: rowIds.value++, kind: 'local-output', text: preview(line, LOCAL_OUTPUT_LIMIT) });
|
|
35
|
+
state.emit();
|
|
36
|
+
},
|
|
37
|
+
setActivityFrames(name) {
|
|
38
|
+
// A retired preset id normalizes to the current default, so the
|
|
39
|
+
// in-memory state, the persisted preference and the toast agree instead
|
|
40
|
+
// of diverging until restart.
|
|
41
|
+
const preset = normalizeActivityPreset(name) ?? name;
|
|
42
|
+
if (!isPresetName(preset)) {
|
|
43
|
+
notify(t('unknown-activity-preset', { name }), { color: 'error' });
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (preset === state.activityFrames) {
|
|
47
|
+
notify(t('activity-indicator-already', { name: preset }), { color: 'success' });
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (!writeActivityFrames(preset)) {
|
|
51
|
+
notify(t('activity-pref-write-failed'), { color: 'error' });
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
state.activityFrames = preset;
|
|
55
|
+
state.emit();
|
|
56
|
+
notify(t('activity-indicator-switched', { name: preset }));
|
|
57
|
+
return true;
|
|
58
|
+
},
|
|
59
|
+
async listSubagents() {
|
|
60
|
+
const service = ctx.get('subagents');
|
|
61
|
+
if (!service)
|
|
62
|
+
return [t('subagent-not-mounted')];
|
|
63
|
+
const capture = binding.capture();
|
|
64
|
+
try {
|
|
65
|
+
const children = await service.listChildren(binding.agent.session.id);
|
|
66
|
+
if (!current(capture))
|
|
67
|
+
throw new Error('dsh-tui: Channel lifetime has ended');
|
|
68
|
+
if (children.length === 0)
|
|
69
|
+
return [t('subagent-none')];
|
|
70
|
+
return children.map(child => {
|
|
71
|
+
const id = typeof child.id === 'string' ? child.id : (child.id.value ?? '');
|
|
72
|
+
return t('subagent-row', { mode: child.mode === 'continuable' ? t('subagent-resumable') : t('subagent-oneshot'), label: child.label ? `「${child.label}」` : '', activity: child.activity === 'running' ? t('subagent-running') : t('subagent-archived'), id: id.slice(0, 8) });
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
if (!current(capture))
|
|
77
|
+
throw error;
|
|
78
|
+
return [t('subagent-query-failed', { err: error instanceof Error ? error.message : String(error) })];
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
async runLocalCommand(command, includeInContext) {
|
|
82
|
+
const capture = binding.capture();
|
|
83
|
+
const cwd = state.cwd;
|
|
84
|
+
const target = workspace.describe(cwd);
|
|
85
|
+
state.rows.push({ id: rowIds.value++, kind: 'local', text: command, executionTarget: target.kind === 'local' ? target.badge : `${target.badge} · ${target.label}` });
|
|
86
|
+
state.emit();
|
|
87
|
+
let output = '(no output)';
|
|
88
|
+
const executor = await workspace.commandShell(cwd) ?? shell;
|
|
89
|
+
if (!current(capture))
|
|
90
|
+
return;
|
|
91
|
+
if (executor) {
|
|
92
|
+
try {
|
|
93
|
+
const result = await executor.run(executor.resolve({ command, workdir: cwd, timeoutMs: 30000 }));
|
|
94
|
+
output = result.stdout.text.trim() || result.stderr.text.trim() || (result.timedOut ? '(timed out)' : '(no output)');
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
output = error instanceof Error ? error.message : String(error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (!current(capture))
|
|
101
|
+
return;
|
|
102
|
+
state.rows.push({ id: rowIds.value++, kind: 'local-output', text: preview(output, LOCAL_OUTPUT_LIMIT) });
|
|
103
|
+
state.emit();
|
|
104
|
+
if (includeInContext)
|
|
105
|
+
binding.agent.followup(createUserMessage({ content: [{ type: 'text', text: `<bash-stdout>\n${output}\n</bash-stdout>` }], source: { kind: 'user' } }));
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { MentionAttachments, MentionExpansion, MentionFs, MentionImageBlock, MentionImageMediaType, ResolvedMention } from './types.js';
|
|
3
|
+
/** One attached file's contribution is capped so an absent-minded `@` of a
|
|
4
|
+
* huge file cannot blow the context window. */
|
|
5
|
+
export declare const MENTION_MAX_FILE_CHARS = 50000;
|
|
6
|
+
/** Total budget across all attachments in one message. */
|
|
7
|
+
export declare const MENTION_MAX_TOTAL_CHARS = 200000;
|
|
8
|
+
/** A directory mention contributes a shallow listing, capped at this many
|
|
9
|
+
* entries. */
|
|
10
|
+
export declare const MENTION_MAX_DIR_ENTRIES = 200;
|
|
11
|
+
/** The leaf's fs service in the shape mention expansion needs; undefined
|
|
12
|
+
* when the plugin is not mounted (mentions then stay literal text). */
|
|
13
|
+
export declare function mentionFs(ctx: Context): MentionFs | undefined;
|
|
14
|
+
export declare function mentionAttachments(ctx: Context): MentionAttachments | undefined;
|
|
15
|
+
export declare const MENTION_IMAGE_MEDIA_TYPES: Readonly<Record<string, MentionImageMediaType>>;
|
|
16
|
+
export declare function mentionImageMediaType(path: string): MentionImageMediaType | undefined;
|
|
17
|
+
/** Resolve+stat one candidate path; undefined when it throws OR stats
|
|
18
|
+
* absent — both are a miss for strip-first mention resolution (issue #359). */
|
|
19
|
+
export declare function tryResolveMention(fs: MentionFs, absolute: string): Promise<ResolvedMention | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Expand a submitted text's `@` mentions (issue #15) into model-facing
|
|
22
|
+
* attachment blocks: supported image files become durable image blocks,
|
|
23
|
+
* other files contribute capped text, and directories contribute a shallow
|
|
24
|
+
* listing. Reads always go through the active fs service, so provider-owned
|
|
25
|
+
* workspaces keep their routing semantics. The typed text stays first and
|
|
26
|
+
* verbatim. Best-effort failures degrade to `missing`, never a failed send.
|
|
27
|
+
*/
|
|
28
|
+
export declare function expandMentions(fs: MentionFs | undefined, cwd: string, text: string, attachments?: MentionAttachments, stagedImages?: ReadonlyMap<string, MentionImageBlock['attachment']>): Promise<MentionExpansion>;
|
|
29
|
+
//# sourceMappingURL=mentions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mentions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5I;gDACgD;AAChD,eAAO,MAAM,sBAAsB,QAAS,CAAA;AAE5C,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,SAAU,CAAA;AAE9C;eACe;AACf,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C;wEACwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAE/E;AAED,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAMrF,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAErF;AAED;+EAC+E;AAC/E,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAS7G;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,kBAAkB,EAChC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAqL3B"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { extname, isAbsolute, join } from 'node:path';
|
|
2
|
+
import { extractMentions } from '../../utils/mentions.js';
|
|
3
|
+
import { basename } from './paths.js';
|
|
4
|
+
import { COMPOSER_IMAGE_TOKEN } from './composer-images.js';
|
|
5
|
+
/** One attached file's contribution is capped so an absent-minded `@` of a
|
|
6
|
+
* huge file cannot blow the context window. */
|
|
7
|
+
export const MENTION_MAX_FILE_CHARS = 50_000;
|
|
8
|
+
/** Total budget across all attachments in one message. */
|
|
9
|
+
export const MENTION_MAX_TOTAL_CHARS = 200_000;
|
|
10
|
+
/** A directory mention contributes a shallow listing, capped at this many
|
|
11
|
+
* entries. */
|
|
12
|
+
export const MENTION_MAX_DIR_ENTRIES = 200;
|
|
13
|
+
/** The leaf's fs service in the shape mention expansion needs; undefined
|
|
14
|
+
* when the plugin is not mounted (mentions then stay literal text). */
|
|
15
|
+
export function mentionFs(ctx) {
|
|
16
|
+
return ctx.get('fs');
|
|
17
|
+
}
|
|
18
|
+
export function mentionAttachments(ctx) {
|
|
19
|
+
return ctx.get('attachments');
|
|
20
|
+
}
|
|
21
|
+
export const MENTION_IMAGE_MEDIA_TYPES = {
|
|
22
|
+
'.png': 'image/png',
|
|
23
|
+
'.jpg': 'image/jpeg',
|
|
24
|
+
'.jpeg': 'image/jpeg',
|
|
25
|
+
'.webp': 'image/webp',
|
|
26
|
+
'.gif': 'image/gif',
|
|
27
|
+
};
|
|
28
|
+
export function mentionImageMediaType(path) {
|
|
29
|
+
return MENTION_IMAGE_MEDIA_TYPES[extname(path).toLowerCase()];
|
|
30
|
+
}
|
|
31
|
+
/** Resolve+stat one candidate path; undefined when it throws OR stats
|
|
32
|
+
* absent — both are a miss for strip-first mention resolution (issue #359). */
|
|
33
|
+
export async function tryResolveMention(fs, absolute) {
|
|
34
|
+
try {
|
|
35
|
+
const target = await fs.resolve(absolute);
|
|
36
|
+
const info = await fs.stat(target);
|
|
37
|
+
if (info === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
return { target, info };
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Expand a submitted text's `@` mentions (issue #15) into model-facing
|
|
47
|
+
* attachment blocks: supported image files become durable image blocks,
|
|
48
|
+
* other files contribute capped text, and directories contribute a shallow
|
|
49
|
+
* listing. Reads always go through the active fs service, so provider-owned
|
|
50
|
+
* workspaces keep their routing semantics. The typed text stays first and
|
|
51
|
+
* verbatim. Best-effort failures degrade to `missing`, never a failed send.
|
|
52
|
+
*/
|
|
53
|
+
export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
|
|
54
|
+
const blocks = [{ type: 'text', text }];
|
|
55
|
+
const attached = [];
|
|
56
|
+
const missing = [];
|
|
57
|
+
const mentions = extractMentions(text);
|
|
58
|
+
let budget = MENTION_MAX_TOTAL_CHARS;
|
|
59
|
+
let imageCount = 0;
|
|
60
|
+
let imageBytes = 0;
|
|
61
|
+
const references = fs === undefined
|
|
62
|
+
? []
|
|
63
|
+
: mentions.map(mention => ({ kind: 'mention', start: mention.start, mention }));
|
|
64
|
+
if (stagedImages !== undefined) {
|
|
65
|
+
const seen = new Set();
|
|
66
|
+
for (const match of text.matchAll(COMPOSER_IMAGE_TOKEN)) {
|
|
67
|
+
const token = match[0];
|
|
68
|
+
if (seen.has(token))
|
|
69
|
+
continue;
|
|
70
|
+
seen.add(token);
|
|
71
|
+
const attachment = stagedImages.get(token);
|
|
72
|
+
if (attachment === undefined)
|
|
73
|
+
continue;
|
|
74
|
+
references.push({
|
|
75
|
+
kind: 'staged-image',
|
|
76
|
+
start: match.index,
|
|
77
|
+
token,
|
|
78
|
+
attachment,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
references.sort((a, b) => a.start - b.start);
|
|
83
|
+
// `@image` files and staged `[Image #N]` capabilities share one admission
|
|
84
|
+
// queue. The earliest reference in the user's text wins both the per-
|
|
85
|
+
// message count and byte budgets, and image blocks preserve that order.
|
|
86
|
+
for (const reference of references) {
|
|
87
|
+
if (reference.kind === 'staged-image') {
|
|
88
|
+
const { attachment, token } = reference;
|
|
89
|
+
// A referenced-but-dropped staged image must be loud: silently sending
|
|
90
|
+
// the bare token would leave the user believing the image reached the
|
|
91
|
+
// model. Reuse the missing-mention warning channel.
|
|
92
|
+
if (attachments === undefined) {
|
|
93
|
+
missing.push(token);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const limits = attachments.imageLimits;
|
|
97
|
+
if (imageCount >= limits.maxImagesPerMessage
|
|
98
|
+
|| imageBytes + attachment.bytes > limits.maxMessageImageBytes
|
|
99
|
+
|| !limits.mediaTypes.includes(attachment.mediaType)) {
|
|
100
|
+
missing.push(token);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
blocks.push({ type: 'image', attachment });
|
|
104
|
+
imageCount += 1;
|
|
105
|
+
imageBytes += attachment.bytes;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (fs === undefined)
|
|
109
|
+
continue;
|
|
110
|
+
const { mention } = reference;
|
|
111
|
+
const display = mention.literal ?? mention.path;
|
|
112
|
+
const imageMediaType = mentionImageMediaType(mention.path);
|
|
113
|
+
// A depleted text budget must not hide a later image reference: image
|
|
114
|
+
// admission has independent limits and still follows source order.
|
|
115
|
+
if (budget <= 0 && imageMediaType === undefined)
|
|
116
|
+
continue;
|
|
117
|
+
// Mentions resolve against the session cwd, same as the model-facing fs
|
|
118
|
+
// tools; absolute paths pass through untouched. A `#L12-14` line suffix
|
|
119
|
+
// (issue #359) is stripped before resolution; when the stripped path
|
|
120
|
+
// misses, the typed literal (suffix intact) gets ONE fallback try so
|
|
121
|
+
// filenames genuinely containing `#L…` still resolve as whole files.
|
|
122
|
+
const absolute = isAbsolute(mention.path) ? mention.path : join(cwd, mention.path);
|
|
123
|
+
let resolved = await tryResolveMention(fs, absolute);
|
|
124
|
+
let literalFallback = false;
|
|
125
|
+
if (resolved === undefined && mention.literal !== undefined) {
|
|
126
|
+
const literalPath = isAbsolute(mention.literal) ? mention.literal : join(cwd, mention.literal);
|
|
127
|
+
resolved = await tryResolveMention(fs, literalPath);
|
|
128
|
+
literalFallback = resolved !== undefined;
|
|
129
|
+
}
|
|
130
|
+
if (resolved === undefined) {
|
|
131
|
+
missing.push(display);
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const { target, info } = resolved;
|
|
135
|
+
// On a literal-fallback hit the attached file IS the typed name — the
|
|
136
|
+
// model must see that path, not the suffix-stripped one.
|
|
137
|
+
const shownPath = literalFallback ? display : mention.path;
|
|
138
|
+
// …and judge image-ness by the typed extension in that case too.
|
|
139
|
+
const imageType = literalFallback && mention.literal !== undefined
|
|
140
|
+
? mentionImageMediaType(mention.literal)
|
|
141
|
+
: imageMediaType;
|
|
142
|
+
if (info?.type === 'file') {
|
|
143
|
+
if (imageType !== undefined && attachments !== undefined && fs.readBytes !== undefined) {
|
|
144
|
+
const limits = attachments.imageLimits;
|
|
145
|
+
if (!limits.mediaTypes.includes(imageType) || imageCount >= limits.maxImagesPerMessage) {
|
|
146
|
+
missing.push(display);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
const data = await fs.readBytes(target, undefined, limits.maxImageBytes);
|
|
151
|
+
if (imageBytes + data.byteLength > limits.maxMessageImageBytes) {
|
|
152
|
+
missing.push(display);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const attachment = await attachments.saveImage({
|
|
156
|
+
data,
|
|
157
|
+
mediaType: imageType,
|
|
158
|
+
name: basename(target.displayPath),
|
|
159
|
+
});
|
|
160
|
+
blocks.push({ type: 'image', attachment });
|
|
161
|
+
imageCount += 1;
|
|
162
|
+
imageBytes += data.byteLength;
|
|
163
|
+
attached.push(display);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
missing.push(display);
|
|
167
|
+
}
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
const cap = Math.min(MENTION_MAX_FILE_CHARS, budget);
|
|
172
|
+
const content = await fs.readText(target);
|
|
173
|
+
let body = content;
|
|
174
|
+
let truncated = false;
|
|
175
|
+
let header = `<attached-file path="${shownPath}">`;
|
|
176
|
+
if (mention.startLine !== undefined && !literalFallback) {
|
|
177
|
+
// Line-range slice (issue #359): 1-based inclusive. An endLine
|
|
178
|
+
// past EOF clamps to the file; a startLine past EOF falls back
|
|
179
|
+
// to the whole file with an in-band note — never a silent
|
|
180
|
+
// empty attach. Line ranges never apply to literal-fallback
|
|
181
|
+
// hits (those files really are named `…#L…`, no suffix typed).
|
|
182
|
+
const lines = content.split('\n');
|
|
183
|
+
if (mention.startLine > lines.length) {
|
|
184
|
+
header = `<attached-file path="${shownPath}" lines="${mention.startLine}-${mention.endLine}" note="requested lines beyond EOF (file has ${lines.length} line${lines.length === 1 ? '' : 's'}); whole file attached">`;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
const endLine = Math.min(mention.endLine ?? mention.startLine, lines.length);
|
|
188
|
+
header = `<attached-file path="${shownPath}" lines="${mention.startLine}${endLine === mention.startLine ? '' : `-${endLine}`}">`;
|
|
189
|
+
body = lines.slice(mention.startLine - 1, endLine).join('\n');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (body.length > cap) {
|
|
193
|
+
body = body.slice(0, cap);
|
|
194
|
+
truncated = true;
|
|
195
|
+
}
|
|
196
|
+
budget -= body.length;
|
|
197
|
+
blocks.push({
|
|
198
|
+
type: 'text',
|
|
199
|
+
text: `${header}\n${body}${truncated ? '\n[… truncated]' : ''}\n</attached-file>`,
|
|
200
|
+
});
|
|
201
|
+
attached.push(display);
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
// Binary/undecodable or unreadable — report it like a miss.
|
|
205
|
+
missing.push(display);
|
|
206
|
+
}
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (info?.type === 'directory') {
|
|
210
|
+
try {
|
|
211
|
+
const entries = await fs.listDir(target);
|
|
212
|
+
const listing = entries
|
|
213
|
+
.slice(0, MENTION_MAX_DIR_ENTRIES)
|
|
214
|
+
.map(entry => (entry.type === 'directory' ? `${entry.name}/` : entry.name));
|
|
215
|
+
if (entries.length > MENTION_MAX_DIR_ENTRIES) {
|
|
216
|
+
listing.push(`… (${entries.length - MENTION_MAX_DIR_ENTRIES} more)`);
|
|
217
|
+
}
|
|
218
|
+
const body = listing.join('\n');
|
|
219
|
+
budget -= body.length;
|
|
220
|
+
blocks.push({
|
|
221
|
+
type: 'text',
|
|
222
|
+
text: `<attached-directory path="${shownPath}">\n${body}\n</attached-directory>`,
|
|
223
|
+
});
|
|
224
|
+
attached.push(display);
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
missing.push(display);
|
|
228
|
+
}
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
// Absent (stat → undefined) or a special file.
|
|
232
|
+
missing.push(display);
|
|
233
|
+
}
|
|
234
|
+
return { blocks, attached, missing };
|
|
235
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import { type SessionModeSpec } from '../../sessionModes.js';
|
|
5
|
+
import { type AdapterRuntimeOptions } from '../../adapter/kernel/runtime.js';
|
|
6
|
+
import type { ChannelState } from './types.js';
|
|
7
|
+
import type { createChannelBinding } from './binding.js';
|
|
8
|
+
type Binding = ReturnType<typeof createChannelBinding>;
|
|
9
|
+
type ModeState = Pick<ChannelState, 'mode' | 'modeIndex' | 'emit'>;
|
|
10
|
+
/** Durable session-mode folds and transitions. Construction is inert; root wires it after state construction. */
|
|
11
|
+
export declare function createModeActions(ctx: Context, state: ModeState, deps: {
|
|
12
|
+
owner: {
|
|
13
|
+
current(): boolean;
|
|
14
|
+
};
|
|
15
|
+
runtime: AdapterRuntimeOptions;
|
|
16
|
+
binding: Pick<Binding, 'agent' | 'capture' | 'isCurrent'>;
|
|
17
|
+
sessionModes: readonly SessionModeSpec[];
|
|
18
|
+
commandService?: {
|
|
19
|
+
find(agent: Agent, name: string): unknown;
|
|
20
|
+
};
|
|
21
|
+
executeRegistryCommand(name: string, input: string): Promise<string | undefined>;
|
|
22
|
+
notify: ChannelState['notify'];
|
|
23
|
+
}): {
|
|
24
|
+
refreshMode: () => void;
|
|
25
|
+
cycleMode: () => Promise<void>;
|
|
26
|
+
applyMode: (spec: SessionModeSpec, capture?: import("./binding.js").BindingCapture) => Promise<void>;
|
|
27
|
+
onSessionEvent: (session: Agent["session"], event: SessionEvent) => void;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=mode-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mode-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAExD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACtD,KAAK,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC,CAAA;AAElE,iHAAiH;AACjH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE;IACJ,KAAK,EAAE;QAAE,OAAO,IAAI,OAAO,CAAA;KAAE,CAAA;IAC7B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC,CAAA;IACzD,YAAY,EAAE,SAAS,eAAe,EAAE,CAAA;IACxC,cAAc,CAAC,EAAE;QAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;IAC9D,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAChF,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B;uBAyDqB,IAAI;qBAkJE,OAAO,CAAC,IAAI,CAAC;sBAlEV,eAAe,sDAAgC,OAAO,CAAC,IAAI,CAAC;8BAyE1D,KAAK,CAAC,SAAS,CAAC,SAAS,YAAY,KAAG,IAAI;EA4B9E"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { t } from '../../i18n.js';
|
|
2
|
+
import { modeDisplayName } from '../../sessionModes.js';
|
|
3
|
+
import { assertShadowPolicy } from '../../adapter/kernel/runtime.js';
|
|
4
|
+
import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
|
|
5
|
+
/** Durable session-mode folds and transitions. Construction is inert; root wires it after state construction. */
|
|
6
|
+
export function createModeActions(ctx, state, deps) {
|
|
7
|
+
const { owner, runtime, binding, sessionModes, commandService, executeRegistryCommand, notify } = deps;
|
|
8
|
+
const current = (capture) => owner.current() && binding.isCurrent(capture);
|
|
9
|
+
const capturedSession = (capture) => capture.agent.session;
|
|
10
|
+
// Session-mode folds: last-wins projections over the session log. The
|
|
11
|
+
// event types are registered by dsh-plan-mode / dsh-sandbox-policy /
|
|
12
|
+
// dsh-user-approval and are NOT in this package's typed SessionEvent
|
|
13
|
+
// union, so they are matched by name through casts — the same pattern as
|
|
14
|
+
// `agent-preset/selected` in renderEvent and the goal projection above.
|
|
15
|
+
const foldPlanActive = (events) => {
|
|
16
|
+
let active = false;
|
|
17
|
+
for (const event of events) {
|
|
18
|
+
if (event.type === 'plan/mode') {
|
|
19
|
+
active = event.data.active === true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return active;
|
|
23
|
+
};
|
|
24
|
+
const foldSandboxMode = (events) => {
|
|
25
|
+
let mode;
|
|
26
|
+
for (const event of events) {
|
|
27
|
+
if (event.type === 'sandbox/mode') {
|
|
28
|
+
const value = event.data.mode;
|
|
29
|
+
if (typeof value === 'string')
|
|
30
|
+
mode = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return mode;
|
|
34
|
+
};
|
|
35
|
+
const foldApprovalPolicy = (events) => {
|
|
36
|
+
let policy;
|
|
37
|
+
for (const event of events) {
|
|
38
|
+
if (event.type === 'approval/policy') {
|
|
39
|
+
const value = event.data.policy;
|
|
40
|
+
if (typeof value === 'string')
|
|
41
|
+
policy = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return policy;
|
|
45
|
+
};
|
|
46
|
+
/** First configured mode whose declared atoms all match the folds;
|
|
47
|
+
* undeclared atoms are wildcards; no match → index 0 (the base mode).
|
|
48
|
+
* Matching is exact: a fresh session has no `approval/policy` event, so
|
|
49
|
+
* a mode declaring `approval: 'ask'` never falsely matches it. */
|
|
50
|
+
const deriveModeIndex = (events) => {
|
|
51
|
+
const index = sessionModes.findIndex(spec => (spec.plan === undefined || foldPlanActive(events) === spec.plan) &&
|
|
52
|
+
(spec.sandbox === undefined || foldSandboxMode(events) === spec.sandbox) &&
|
|
53
|
+
(spec.approval === undefined || foldApprovalPolicy(events) === spec.approval));
|
|
54
|
+
return index >= 0 ? index : 0;
|
|
55
|
+
};
|
|
56
|
+
/** Re-derive the current mode from the live session log (boot, every
|
|
57
|
+
* agent re-bind, and after mode-affecting session events). */
|
|
58
|
+
const refreshMode = () => {
|
|
59
|
+
state.modeIndex = deriveModeIndex(snapshotLiveSessionEvents(binding.agent.session));
|
|
60
|
+
state.mode = sessionModes[state.modeIndex];
|
|
61
|
+
};
|
|
62
|
+
// Session.append rejects observer reentry; restore after publication
|
|
63
|
+
// unwinds. These are channel-scoped so a disposed/recreated Channel cannot
|
|
64
|
+
// inherit deferred work from a former owner.
|
|
65
|
+
const pendingPlanExitRestores = new Map();
|
|
66
|
+
const prePlanModes = new WeakMap();
|
|
67
|
+
// An in-turn /plan off commits at pre-step, after the command has returned.
|
|
68
|
+
const explicitPlanExits = new WeakSet();
|
|
69
|
+
const modePermissions = (events) => {
|
|
70
|
+
const sandbox = foldSandboxMode(events);
|
|
71
|
+
const approval = foldApprovalPolicy(events);
|
|
72
|
+
return {
|
|
73
|
+
id: 'restore',
|
|
74
|
+
...(sandbox === 'read-only' || sandbox === 'workspace-write' || sandbox === 'danger-full-access'
|
|
75
|
+
? { sandbox } : {}),
|
|
76
|
+
...(approval === 'ask' || approval === 'never' ? { approval } : {}),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/** Recover a resumed plan's snapshot before /plan ran, not before its
|
|
80
|
+
* deferred plan/mode event. Unknown historical atoms stay untouched. */
|
|
81
|
+
const prePlanModeSpec = (log) => {
|
|
82
|
+
let active = false;
|
|
83
|
+
let start = -1;
|
|
84
|
+
let command;
|
|
85
|
+
for (let index = 0; index < log.length - 1; index += 1) {
|
|
86
|
+
const event = log[index];
|
|
87
|
+
const type = event.type;
|
|
88
|
+
const data = event.data;
|
|
89
|
+
if (!active && type === 'command/run' && data.name === 'plan' && typeof data.args === 'string') {
|
|
90
|
+
if (data.args.trim() === 'off')
|
|
91
|
+
command = undefined;
|
|
92
|
+
else
|
|
93
|
+
command ??= { index, id: data.commandId };
|
|
94
|
+
}
|
|
95
|
+
if (type === 'command/done' && data.commandId === command?.id && data.kind !== 'success') {
|
|
96
|
+
command = undefined;
|
|
97
|
+
}
|
|
98
|
+
if (type === 'plan/mode') {
|
|
99
|
+
if (data.active === true && !active)
|
|
100
|
+
start = command?.index ?? index;
|
|
101
|
+
active = data.active === true;
|
|
102
|
+
command = undefined;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return active && start >= 0 ? modePermissions(log.slice(0, start)) : undefined;
|
|
106
|
+
};
|
|
107
|
+
const applyModeAtoms = (spec, capture) => {
|
|
108
|
+
if (!current(capture))
|
|
109
|
+
return;
|
|
110
|
+
const agent = capture.agent;
|
|
111
|
+
const session = capturedSession(capture);
|
|
112
|
+
// The durable sandbox override is one session event (dsh-sandbox-policy's
|
|
113
|
+
// own write path); the session/event arm picks it up immediately.
|
|
114
|
+
if (spec.sandbox !== undefined && foldSandboxMode(snapshotLiveSessionEvents(session)) !== spec.sandbox) {
|
|
115
|
+
;
|
|
116
|
+
session.append('sandbox/mode', { mode: spec.sandbox });
|
|
117
|
+
}
|
|
118
|
+
if (!current(capture))
|
|
119
|
+
return;
|
|
120
|
+
// Prefer the approval service (it narrates the switch to the model);
|
|
121
|
+
// the raw durable event is the fallback when it is unmounted.
|
|
122
|
+
if (spec.approval !== undefined && foldApprovalPolicy(snapshotLiveSessionEvents(session)) !== spec.approval) {
|
|
123
|
+
const approval = ctx.get('approval');
|
|
124
|
+
approval?.setPolicy(agent, spec.approval);
|
|
125
|
+
if (!current(capture))
|
|
126
|
+
return;
|
|
127
|
+
// The service may no-op when its configured default already matches.
|
|
128
|
+
if (foldApprovalPolicy(snapshotLiveSessionEvents(session)) !== spec.approval) {
|
|
129
|
+
;
|
|
130
|
+
session.append('approval/policy', { policy: spec.approval });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
/** Apply the configured atoms; an explicit exit owns its target mode. */
|
|
135
|
+
const applyMode = async (spec, capture = binding.capture()) => {
|
|
136
|
+
if (!current(capture))
|
|
137
|
+
return;
|
|
138
|
+
// This action writes durable session policy. The runtime snapshot comes
|
|
139
|
+
// from composition and is immutable for this Channel lifetime, so an
|
|
140
|
+
// observed plan exit cannot bypass the renderer/Port shadow guard.
|
|
141
|
+
assertShadowPolicy('mutate', runtime.mode);
|
|
142
|
+
const agent = capture.agent;
|
|
143
|
+
const session = capturedSession(capture);
|
|
144
|
+
pendingPlanExitRestores.delete(session);
|
|
145
|
+
const planMode = ctx.get('planMode');
|
|
146
|
+
const planActive = foldPlanActive(snapshotLiveSessionEvents(session));
|
|
147
|
+
// Reconcile a stale explicit-exit marker before acting. The marker only
|
|
148
|
+
// legitimately survives while a deferred exit awaits its plan/mode:false
|
|
149
|
+
// (foldPlanActive && pending === false). If plan is still logged active
|
|
150
|
+
// with no pending intent, that awaited event was abandoned (e.g. an
|
|
151
|
+
// aborted pre-step) — drop the orphan so it cannot suppress a later restore
|
|
152
|
+
// such as an approved exit_plan_mode.
|
|
153
|
+
if (planActive && planMode?.get?.(agent).pending === undefined) {
|
|
154
|
+
explicitPlanExits.delete(session);
|
|
155
|
+
}
|
|
156
|
+
if (spec.plan !== undefined && (planMode?.get?.(agent).pending ?? planActive) !== spec.plan) {
|
|
157
|
+
if (commandService?.find(agent, 'plan') === undefined) {
|
|
158
|
+
notify(t('mode-plan-unavailable'), { color: 'warning' });
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (spec.plan && !planActive && !prePlanModes.has(session)) {
|
|
162
|
+
const previous = modePermissions(snapshotLiveSessionEvents(session));
|
|
163
|
+
const sandbox = ctx.get('sandboxPolicy');
|
|
164
|
+
const approval = ctx.get('approval');
|
|
165
|
+
const base = previous.sandbox === undefined && previous.approval === undefined ? sessionModes[0] : undefined;
|
|
166
|
+
previous.sandbox ??= sandbox?.defaultMode ?? base?.sandbox;
|
|
167
|
+
previous.approval ??= approval?.effectivePolicy?.(session) ?? base?.approval;
|
|
168
|
+
prePlanModes.set(session, previous);
|
|
169
|
+
// Persist missing defaults before /plan, so resume can recover them.
|
|
170
|
+
applyModeAtoms(previous, capture);
|
|
171
|
+
}
|
|
172
|
+
if (!spec.plan)
|
|
173
|
+
explicitPlanExits.add(session);
|
|
174
|
+
try {
|
|
175
|
+
const text = await executeRegistryCommand('plan', spec.plan ? '' : ' off');
|
|
176
|
+
if (!current(capture) || session !== capturedSession(capture))
|
|
177
|
+
return;
|
|
178
|
+
if (text === undefined) {
|
|
179
|
+
notify(t('mode-plan-unavailable'), { color: 'warning' });
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
if (current(capture) && session === capturedSession(capture)) {
|
|
185
|
+
const pending = planMode?.get?.(agent).pending;
|
|
186
|
+
if (!foldPlanActive(snapshotLiveSessionEvents(session)) || pending !== false)
|
|
187
|
+
explicitPlanExits.delete(session);
|
|
188
|
+
if (!foldPlanActive(snapshotLiveSessionEvents(session)) && pending !== true)
|
|
189
|
+
prePlanModes.delete(session);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (!current(capture))
|
|
194
|
+
return;
|
|
195
|
+
applyModeAtoms(spec, capture);
|
|
196
|
+
if (!current(capture))
|
|
197
|
+
return;
|
|
198
|
+
refreshMode();
|
|
199
|
+
if (!current(capture))
|
|
200
|
+
return;
|
|
201
|
+
notify(t('mode-switched', { name: modeDisplayName(state.mode) }));
|
|
202
|
+
state.emit();
|
|
203
|
+
};
|
|
204
|
+
/** Shift+Tab: advance to the next configured session mode. Cycling starts
|
|
205
|
+
* from the mode DERIVED from the session log (never a stored index), so
|
|
206
|
+
* manual `/plan` use can never desync the cycle. */
|
|
207
|
+
const cycleMode = async () => {
|
|
208
|
+
const capture = binding.capture();
|
|
209
|
+
if (!current(capture))
|
|
210
|
+
return;
|
|
211
|
+
const index = deriveModeIndex(snapshotLiveSessionEvents(capturedSession(capture)));
|
|
212
|
+
await applyMode(sessionModes[(index + 1) % sessionModes.length], capture);
|
|
213
|
+
};
|
|
214
|
+
const onSessionEvent = (session, event) => {
|
|
215
|
+
const capture = binding.capture();
|
|
216
|
+
if (!current(capture) || session !== capturedSession(capture))
|
|
217
|
+
return;
|
|
218
|
+
const eventType = event.type;
|
|
219
|
+
if (eventType === 'plan/mode' || eventType === 'sandbox/mode' || eventType === 'approval/policy') {
|
|
220
|
+
refreshMode();
|
|
221
|
+
}
|
|
222
|
+
if (eventType !== 'plan/mode' || event.data.active !== false)
|
|
223
|
+
return;
|
|
224
|
+
const target = prePlanModes.get(session) ?? prePlanModeSpec(snapshotLiveSessionEvents(session));
|
|
225
|
+
prePlanModes.delete(session);
|
|
226
|
+
if (explicitPlanExits.delete(session) || target === undefined)
|
|
227
|
+
return;
|
|
228
|
+
const queued = pendingPlanExitRestores.has(session);
|
|
229
|
+
pendingPlanExitRestores.set(session, { capture, target });
|
|
230
|
+
if (queued)
|
|
231
|
+
return;
|
|
232
|
+
queueMicrotask(() => {
|
|
233
|
+
const restore = pendingPlanExitRestores.get(session);
|
|
234
|
+
pendingPlanExitRestores.delete(session);
|
|
235
|
+
if (restore === undefined || !current(restore.capture) || session !== capturedSession(restore.capture) || foldPlanActive(snapshotLiveSessionEvents(session)))
|
|
236
|
+
return;
|
|
237
|
+
// Shadow still projects the observed plan/mode event above, but never
|
|
238
|
+
// schedules a compensating sandbox/approval write into the real log.
|
|
239
|
+
if (runtime.mode === 'passive-shadow' || runtime.mode === 'replay-shadow')
|
|
240
|
+
return;
|
|
241
|
+
applyMode(restore.target, restore.capture).catch(error => {
|
|
242
|
+
ctx.logger.warn(`dsh-tui: plan-exit mode restore failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
return { refreshMode, cycleMode, applyMode, onSessionEvent };
|
|
247
|
+
}
|