@jingyi0605/codingns4dsh 0.1.0
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 +1114 -0
- package/assets/provider-icons/claude-code.png +0 -0
- package/assets/provider-icons/codex.png +0 -0
- package/assets/provider-icons/command-code.svg +5 -0
- package/assets/provider-icons/deepseek-harness.svg +9 -0
- package/assets/provider-icons/gemini.png +0 -0
- package/assets/provider-icons/grok.png +0 -0
- package/assets/provider-icons/kimi.png +0 -0
- package/assets/provider-icons/opencode.png +0 -0
- package/assets/provider-icons/pi.svg +7 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +97 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.js +169 -0
- package/data/build/dist/bootstrap/index.d.ts +38 -0
- package/data/build/dist/bootstrap/index.js +44 -0
- package/data/build/dist/client/account-bar.d.ts +9 -0
- package/data/build/dist/client/account-bar.js +398 -0
- package/data/build/dist/client/bundle.js +26167 -0
- package/data/build/dist/client/cli-catalog.d.ts +24 -0
- package/data/build/dist/client/cli-catalog.js +108 -0
- package/data/build/dist/client/cli-slots.d.ts +38 -0
- package/data/build/dist/client/cli-slots.js +297 -0
- package/data/build/dist/client/debug/ui.d.ts +12 -0
- package/data/build/dist/client/debug/ui.js +451 -0
- package/data/build/dist/client/dsh-h5-bootstrap.d.ts +64 -0
- package/data/build/dist/client/dsh-h5-bootstrap.js +293 -0
- package/data/build/dist/client/dsh-runtime-version.d.ts +3 -0
- package/data/build/dist/client/dsh-runtime-version.js +11 -0
- package/data/build/dist/client/external-tool-stream.d.ts +24 -0
- package/data/build/dist/client/external-tool-stream.js +114 -0
- package/data/build/dist/client/features/cli-adapters.d.ts +7 -0
- package/data/build/dist/client/features/cli-adapters.js +215 -0
- package/data/build/dist/client/features/debug.d.ts +4 -0
- package/data/build/dist/client/features/debug.js +24 -0
- package/data/build/dist/client/features/index.d.ts +33 -0
- package/data/build/dist/client/features/index.js +44 -0
- package/data/build/dist/client/features/lan-access-panel.d.ts +5 -0
- package/data/build/dist/client/features/lan-access-panel.js +146 -0
- package/data/build/dist/client/features/lan-access.d.ts +9 -0
- package/data/build/dist/client/features/lan-access.js +30 -0
- package/data/build/dist/client/features/login-protection-panel.d.ts +5 -0
- package/data/build/dist/client/features/login-protection-panel.js +91 -0
- package/data/build/dist/client/features/login-protection-session.d.ts +6 -0
- package/data/build/dist/client/features/login-protection-session.js +25 -0
- package/data/build/dist/client/features/login-protection.d.ts +4 -0
- package/data/build/dist/client/features/login-protection.js +23 -0
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts +9 -0
- package/data/build/dist/client/features/reverse-proxy-panel.js +159 -0
- package/data/build/dist/client/features/reverse-proxy.d.ts +12 -0
- package/data/build/dist/client/features/reverse-proxy.js +112 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts +5 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.js +160 -0
- package/data/build/dist/client/features/terminal-enhancement.d.ts +4 -0
- package/data/build/dist/client/features/terminal-enhancement.js +24 -0
- package/data/build/dist/client/features/types.d.ts +58 -0
- package/data/build/dist/client/features/types.js +2 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts +5 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +66 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts +4 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js +101 -0
- package/data/build/dist/client/h5-bootstrap-entry.d.ts +2 -0
- package/data/build/dist/client/h5-bootstrap-entry.js +17 -0
- package/data/build/dist/client/index.d.ts +31 -0
- package/data/build/dist/client/index.js +98 -0
- package/data/build/dist/client/lan-access.d.ts +28 -0
- package/data/build/dist/client/lan-access.js +68 -0
- package/data/build/dist/client/locale.d.ts +20 -0
- package/data/build/dist/client/locale.js +393 -0
- package/data/build/dist/client/provider-icon-assets.d.ts +2 -0
- package/data/build/dist/client/provider-icon-assets.js +23 -0
- package/data/build/dist/client/provider-icons.d.ts +19 -0
- package/data/build/dist/client/provider-icons.js +39 -0
- package/data/build/dist/client/remote-web-context.d.ts +57 -0
- package/data/build/dist/client/remote-web-context.js +939 -0
- package/data/build/dist/client/session-adapter-cache.d.ts +18 -0
- package/data/build/dist/client/session-adapter-cache.js +84 -0
- package/data/build/dist/client/settings-bridge.d.ts +32 -0
- package/data/build/dist/client/settings-bridge.js +126 -0
- package/data/build/dist/client/settings-section.d.ts +30 -0
- package/data/build/dist/client/settings-section.js +93 -0
- package/data/build/dist/client/subscription-slot.d.ts +18 -0
- package/data/build/dist/client/subscription-slot.js +223 -0
- package/data/build/dist/client/terminal/index.d.ts +4 -0
- package/data/build/dist/client/terminal/index.js +3 -0
- package/data/build/dist/client/terminal/model.d.ts +116 -0
- package/data/build/dist/client/terminal/model.js +435 -0
- package/data/build/dist/client/terminal/styles.d.ts +21 -0
- package/data/build/dist/client/terminal/styles.js +51 -0
- package/data/build/dist/client/terminal/ui.d.ts +19 -0
- package/data/build/dist/client/terminal/ui.js +257 -0
- package/data/build/dist/client/terminal/xterm-view.d.ts +13 -0
- package/data/build/dist/client/terminal/xterm-view.js +213 -0
- package/data/build/dist/client/theme.d.ts +56 -0
- package/data/build/dist/client/theme.js +186 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +29 -0
- package/data/build/dist/client/workspace-session-archive-dom.js +525 -0
- package/data/build/dist/client/workspace-session-fiber.d.ts +3 -0
- package/data/build/dist/client/workspace-session-fiber.js +33 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts +26 -0
- package/data/build/dist/client/workspace-session-logo-dom.js +128 -0
- package/data/build/dist/features/index.d.ts +3 -0
- package/data/build/dist/features/index.js +2 -0
- package/data/build/dist/features/registry.d.ts +74 -0
- package/data/build/dist/features/registry.js +382 -0
- package/data/build/dist/features/resource-scope/index.d.ts +39 -0
- package/data/build/dist/features/resource-scope/index.js +161 -0
- package/data/build/dist/host/auth-session.d.ts +42 -0
- package/data/build/dist/host/auth-session.js +186 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +14 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js +103 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/codex-driver.js +534 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +38 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.js +394 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.js +126 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts +41 -0
- package/data/build/dist/host/cli-adapters/driver.js +2 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +37 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +180 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts +48 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +373 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/feature.js +335 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts +24 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.js +427 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +38 -0
- package/data/build/dist/host/cli-adapters/grok-driver.js +372 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.d.ts +22 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.js +99 -0
- package/data/build/dist/host/cli-adapters/interaction-events.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/interaction-events.js +80 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +65 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +256 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts +21 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js +382 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +22 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js +89 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +55 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.js +728 -0
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts +43 -0
- package/data/build/dist/host/cli-adapters/pi-driver.js +312 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/process-utils.js +27 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +82 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.js +610 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts +95 -0
- package/data/build/dist/host/cli-adapters/registry.js +659 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts +24 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +119 -0
- package/data/build/dist/host/cli-adapters/session-probe.d.ts +20 -0
- package/data/build/dist/host/cli-adapters/session-probe.js +139 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts +68 -0
- package/data/build/dist/host/cli-adapters/session-store.js +180 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +205 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +83 -0
- package/data/build/dist/host/cli-adapters/tool-observation.d.ts +9 -0
- package/data/build/dist/host/cli-adapters/tool-observation.js +39 -0
- package/data/build/dist/host/control-api-client.d.ts +84 -0
- package/data/build/dist/host/control-api-client.js +130 -0
- package/data/build/dist/host/credential-store.d.ts +54 -0
- package/data/build/dist/host/credential-store.js +114 -0
- package/data/build/dist/host/debug.d.ts +79 -0
- package/data/build/dist/host/debug.js +295 -0
- package/data/build/dist/host/dsh-device-runtime.d.ts +39 -0
- package/data/build/dist/host/dsh-device-runtime.js +118 -0
- package/data/build/dist/host/dsh-gateway-feature.d.ts +5 -0
- package/data/build/dist/host/dsh-gateway-feature.js +55 -0
- package/data/build/dist/host/dsh-runtime-version.d.ts +12 -0
- package/data/build/dist/host/dsh-runtime-version.js +69 -0
- package/data/build/dist/host/features/auth.d.ts +11 -0
- package/data/build/dist/host/features/auth.js +273 -0
- package/data/build/dist/host/features/debug.d.ts +5 -0
- package/data/build/dist/host/features/debug.js +90 -0
- package/data/build/dist/host/features/host-status.d.ts +12 -0
- package/data/build/dist/host/features/host-status.js +54 -0
- package/data/build/dist/host/features/index.d.ts +19 -0
- package/data/build/dist/host/features/index.js +29 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts +8 -0
- package/data/build/dist/host/features/lan-access-dsh.js +45 -0
- package/data/build/dist/host/features/terminal-process.d.ts +5 -0
- package/data/build/dist/host/features/terminal-process.js +110 -0
- package/data/build/dist/host/features/terminal-status.d.ts +18 -0
- package/data/build/dist/host/features/terminal-status.js +56 -0
- package/data/build/dist/host/features/types.d.ts +41 -0
- package/data/build/dist/host/features/types.js +2 -0
- package/data/build/dist/host/index.d.ts +43 -0
- package/data/build/dist/host/index.js +135 -0
- package/data/build/dist/host/lan-access-dsh.d.ts +83 -0
- package/data/build/dist/host/lan-access-dsh.js +831 -0
- package/data/build/dist/host/native-session-bridge.d.ts +130 -0
- package/data/build/dist/host/native-session-bridge.js +317 -0
- package/data/build/dist/host/relay-tunnel-runtime.d.ts +97 -0
- package/data/build/dist/host/relay-tunnel-runtime.js +361 -0
- package/data/build/dist/host/remote-web-runtime.d.ts +78 -0
- package/data/build/dist/host/remote-web-runtime.js +559 -0
- package/data/build/dist/host/rpc-table.d.ts +32 -0
- package/data/build/dist/host/rpc-table.js +47 -0
- package/data/build/dist/host/rpc.d.ts +18 -0
- package/data/build/dist/host/rpc.js +248 -0
- package/data/build/dist/host/settings.d.ts +19 -0
- package/data/build/dist/host/settings.js +80 -0
- package/data/build/dist/host/terminal/attachment-registry.d.ts +17 -0
- package/data/build/dist/host/terminal/attachment-registry.js +49 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.d.ts +39 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.js +160 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts +36 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js +178 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +40 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.js +191 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.d.ts +27 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.js +154 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.d.ts +10 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.js +147 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.d.ts +92 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.js +134 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts +37 -0
- package/data/build/dist/host/terminal/controller-factory.js +82 -0
- package/data/build/dist/host/terminal/index.d.ts +17 -0
- package/data/build/dist/host/terminal/index.js +17 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts +77 -0
- package/data/build/dist/host/terminal/runtime-adapter.js +18 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts +41 -0
- package/data/build/dist/host/terminal/runtime-manager.js +179 -0
- package/data/build/dist/host/terminal/shell-detection.d.ts +23 -0
- package/data/build/dist/host/terminal/shell-detection.js +105 -0
- package/data/build/dist/host/terminal/startup.d.ts +33 -0
- package/data/build/dist/host/terminal/startup.js +100 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts +78 -0
- package/data/build/dist/host/terminal/terminal-controller.js +324 -0
- package/data/build/dist/host/terminal/terminal-process-service.d.ts +30 -0
- package/data/build/dist/host/terminal/terminal-process-service.js +194 -0
- package/data/build/dist/host/terminal/terminal-process-store.d.ts +45 -0
- package/data/build/dist/host/terminal/terminal-process-store.js +183 -0
- package/data/build/dist/host/terminal/terminal-service.d.ts +87 -0
- package/data/build/dist/host/terminal/terminal-service.js +528 -0
- package/data/build/dist/host/terminal/terminal-store.d.ts +49 -0
- package/data/build/dist/host/terminal/terminal-store.js +242 -0
- package/data/build/dist/index.d.ts +37 -0
- package/data/build/dist/index.js +26 -0
- package/data/build/dist/shared/contracts/auth.d.ts +122 -0
- package/data/build/dist/shared/contracts/auth.js +8 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +192 -0
- package/data/build/dist/shared/contracts/cli-adapter.js +2 -0
- package/data/build/dist/shared/contracts/command-code.d.ts +5 -0
- package/data/build/dist/shared/contracts/command-code.js +2 -0
- package/data/build/dist/shared/contracts/config.d.ts +113 -0
- package/data/build/dist/shared/contracts/config.js +86 -0
- package/data/build/dist/shared/contracts/debug-config.d.ts +28 -0
- package/data/build/dist/shared/contracts/debug-config.js +78 -0
- package/data/build/dist/shared/contracts/debug.d.ts +75 -0
- package/data/build/dist/shared/contracts/debug.js +121 -0
- package/data/build/dist/shared/contracts/dsh-device.d.ts +72 -0
- package/data/build/dist/shared/contracts/dsh-device.js +2 -0
- package/data/build/dist/shared/contracts/errors.d.ts +33 -0
- package/data/build/dist/shared/contracts/errors.js +41 -0
- package/data/build/dist/shared/contracts/feature.d.ts +71 -0
- package/data/build/dist/shared/contracts/feature.js +2 -0
- package/data/build/dist/shared/contracts/host-status.d.ts +14 -0
- package/data/build/dist/shared/contracts/host-status.js +2 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.d.ts +30 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.js +2 -0
- package/data/build/dist/shared/contracts/peer-host.d.ts +37 -0
- package/data/build/dist/shared/contracts/peer-host.js +9 -0
- package/data/build/dist/shared/contracts/signaling.d.ts +67 -0
- package/data/build/dist/shared/contracts/signaling.js +2 -0
- package/data/build/dist/shared/contracts/subscription.d.ts +69 -0
- package/data/build/dist/shared/contracts/subscription.js +2 -0
- package/data/build/dist/shared/contracts/terminal-process.d.ts +65 -0
- package/data/build/dist/shared/contracts/terminal-process.js +2 -0
- package/data/build/dist/shared/contracts/terminal.d.ts +127 -0
- package/data/build/dist/shared/contracts/terminal.js +2 -0
- package/data/build/dist/shared/contracts/transport.d.ts +45 -0
- package/data/build/dist/shared/contracts/transport.js +3 -0
- package/data/build/dist/shared/contracts/version.d.ts +19 -0
- package/data/build/dist/shared/contracts/version.js +74 -0
- package/data/build/dist/shared/index.d.ts +22 -0
- package/data/build/dist/shared/index.js +9 -0
- package/data/build/dist/transport/carrier.d.ts +38 -0
- package/data/build/dist/transport/carrier.js +268 -0
- package/data/build/dist/transport/debug.d.ts +22 -0
- package/data/build/dist/transport/debug.js +57 -0
- package/data/build/dist/transport/dsh-envelope.d.ts +41 -0
- package/data/build/dist/transport/dsh-envelope.js +107 -0
- package/data/build/dist/transport/dsh-gateway.d.ts +64 -0
- package/data/build/dist/transport/dsh-gateway.js +254 -0
- package/data/build/dist/transport/dsh-session.d.ts +55 -0
- package/data/build/dist/transport/dsh-session.js +256 -0
- package/data/build/dist/transport/dsh-transport.d.ts +57 -0
- package/data/build/dist/transport/dsh-transport.js +125 -0
- package/data/build/dist/transport/frame.d.ts +132 -0
- package/data/build/dist/transport/frame.js +168 -0
- package/data/build/dist/transport/index.d.ts +11 -0
- package/data/build/dist/transport/index.js +11 -0
- package/data/build/dist/transport/multiplexer.d.ts +63 -0
- package/data/build/dist/transport/multiplexer.js +323 -0
- package/data/build/dist/transport/webrtc-client.d.ts +65 -0
- package/data/build/dist/transport/webrtc-client.js +255 -0
- package/data/build/dist/transport/webrtc-host.d.ts +58 -0
- package/data/build/dist/transport/webrtc-host.js +252 -0
- package/data/build/dist/typert.host.d.ts +25 -0
- package/data/build/dist/typert.host.js +150 -0
- package/dsh.bundle.patch +12 -0
- package/package.json +135 -0
- package/profile/README.md +27 -0
- package/profile/cordis.patch.yml +2 -0
- package/profile/package.json +20 -0
- package/profile/scripts/check-dsh-install.mjs +71 -0
- package/profile/version.json +5 -0
- package/scripts/check-dsh-install.mjs +88 -0
- package/version.json +6 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export type FeatureState = 'disabled' | 'enabling' | 'enabled' | 'draining' | 'failed';
|
|
2
|
+
/** 功能模块的承载端:Host 进程、浏览器,或两端都需要。 */
|
|
3
|
+
export type FeatureRuntime = 'host' | 'client' | 'both';
|
|
4
|
+
/** 功能开关的生效时机;未声明时按实时生效处理。 */
|
|
5
|
+
export type FeatureActivation = 'live' | 'restart';
|
|
6
|
+
/**
|
|
7
|
+
* 功能模块在设置界面中的静态描述。
|
|
8
|
+
*
|
|
9
|
+
* 它是设置页渲染卡片的唯一来源:卡片标题、说明文字、排序、初始展开状态和
|
|
10
|
+
* 开关可见性都从这里读取,因此新增模块不需要修改设置页代码。
|
|
11
|
+
*/
|
|
12
|
+
export interface FeatureUiDescriptor {
|
|
13
|
+
/** 设置卡片标题。 */
|
|
14
|
+
label: string;
|
|
15
|
+
/** 设置卡片说明。 */
|
|
16
|
+
description: string;
|
|
17
|
+
/** DSH locale 命名空间中的标题键;未提供时使用 label 原文。 */
|
|
18
|
+
labelKey?: string;
|
|
19
|
+
/** DSH locale 命名空间中的说明键;未提供时使用 description 原文。 */
|
|
20
|
+
descriptionKey?: string;
|
|
21
|
+
/** 排序权重,升序靠前;缺省按 0 处理。 */
|
|
22
|
+
order?: number;
|
|
23
|
+
/** 卡片初始是否展开。 */
|
|
24
|
+
defaultOpen?: boolean;
|
|
25
|
+
/** 启动即生效、不提供关闭入口的模块;设置页只展示当前的启用状态。 */
|
|
26
|
+
alwaysEnabled?: boolean;
|
|
27
|
+
/** 旧版 DSH 仍可运行但能力降级时显示的提示。 */
|
|
28
|
+
legacyFallback?: boolean;
|
|
29
|
+
/** 旧版兼容提示使用的 locale key;未提供时使用通用提示。 */
|
|
30
|
+
legacyFallbackKey?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface FeatureDescriptor {
|
|
33
|
+
/** 稳定标识:同时作为依赖引用名与设置中的启用键。 */
|
|
34
|
+
name: string;
|
|
35
|
+
version: string;
|
|
36
|
+
enabledByDefault: boolean;
|
|
37
|
+
dependencies: string[];
|
|
38
|
+
runtime: FeatureRuntime;
|
|
39
|
+
/** `restart` 表示只保存下次启动意图,当前进程不跟随设置变化启停。 */
|
|
40
|
+
activation?: FeatureActivation;
|
|
41
|
+
/** 模块要求的最低 DSH 版本;低于该版本时不得启动。 */
|
|
42
|
+
minimumDshVersion?: string;
|
|
43
|
+
/** 提供后该模块出现在设置页;缺省表示它没有界面。 */
|
|
44
|
+
ui?: FeatureUiDescriptor;
|
|
45
|
+
}
|
|
46
|
+
/** 模块启动期间可登记的资源释放函数。 */
|
|
47
|
+
export type FeatureDisposer = () => void | Promise<void>;
|
|
48
|
+
/** 以逆序释放模块所拥有资源的集合。 */
|
|
49
|
+
export interface FeatureResourceScope {
|
|
50
|
+
add(disposer: FeatureDisposer): void;
|
|
51
|
+
dispose(): Promise<void>;
|
|
52
|
+
readonly disposed: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 模块的运行上下文。
|
|
56
|
+
*
|
|
57
|
+
* @typeParam S - 宿主创建注册表时注入的服务集合。
|
|
58
|
+
*/
|
|
59
|
+
export interface FeatureContext<S = unknown> {
|
|
60
|
+
readonly descriptor: FeatureDescriptor;
|
|
61
|
+
readonly resources: FeatureResourceScope;
|
|
62
|
+
readonly services: S;
|
|
63
|
+
}
|
|
64
|
+
/** 可由模块注册表管理的功能模块。 */
|
|
65
|
+
export interface FeatureModule<S = unknown> {
|
|
66
|
+
descriptor: FeatureDescriptor;
|
|
67
|
+
start(context: FeatureContext<S>): void | FeatureDisposer | Promise<void | FeatureDisposer>;
|
|
68
|
+
drain?(context: FeatureContext<S>): void | Promise<void>;
|
|
69
|
+
dispose?(context: FeatureContext<S>): void | Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** DSH Host 当前资源与访问链路摘要。 */
|
|
2
|
+
export interface DshHostStatus {
|
|
3
|
+
/** 当前进程采样得到的主机 CPU 使用率(0-100)。 */
|
|
4
|
+
cpuPercent: number;
|
|
5
|
+
/** 当前主机物理内存使用率(0-100)。 */
|
|
6
|
+
memoryPercent: number;
|
|
7
|
+
/** 已使用内存字节数。 */
|
|
8
|
+
memoryUsedBytes: number;
|
|
9
|
+
/** 总内存字节数。 */
|
|
10
|
+
memoryTotalBytes: number;
|
|
11
|
+
/** Host 采样时间戳。 */
|
|
12
|
+
sampledAt: number;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=host-status.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { LoginProtectionScopes } from './config.js';
|
|
2
|
+
/** “局域网访问 DSH”唯一一条监听配置。 */
|
|
3
|
+
export interface LanAccessDshConfig {
|
|
4
|
+
/** 监听地址:本机网卡地址,或 0.0.0.0 监听所有 IPv4 网卡。 */
|
|
5
|
+
listenHost: string;
|
|
6
|
+
/** 局域网访问入口端口,默认 13080;填 0 时由系统分配。 */
|
|
7
|
+
listenPort: number;
|
|
8
|
+
/** 当前 DSH Web 的本地端口。 */
|
|
9
|
+
dshPort: number;
|
|
10
|
+
/** 可选的 Host 侧登录保护;凭据不会进入此配置快照。 */
|
|
11
|
+
login?: LanAccessDshLoginConfig;
|
|
12
|
+
}
|
|
13
|
+
export interface LanAccessDshLoginConfig {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
username: string;
|
|
16
|
+
passwordHash: string;
|
|
17
|
+
passwordSalt: string;
|
|
18
|
+
timeoutSeconds: number;
|
|
19
|
+
scopes: LoginProtectionScopes;
|
|
20
|
+
}
|
|
21
|
+
export type LanAccessDshState = 'stopped' | 'starting' | 'listening' | 'error';
|
|
22
|
+
/** 局域网访问 DSH 的运行快照。 */
|
|
23
|
+
export interface LanAccessDshSnapshot extends Omit<LanAccessDshConfig, 'login'> {
|
|
24
|
+
state: LanAccessDshState;
|
|
25
|
+
actualListenPort: number | null;
|
|
26
|
+
detectedDshPorts: readonly number[];
|
|
27
|
+
error: string | null;
|
|
28
|
+
loginEnabled: boolean;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=lan-access-dsh.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type PeerHostStatus = 'unknown' | 'checking' | 'ready' | 'unreachable' | 'version_mismatch' | 'session_required' | 'disabled';
|
|
2
|
+
export interface PeerHostRecord {
|
|
3
|
+
peerHostId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
status: PeerHostStatus;
|
|
7
|
+
remoteVersion: string | null;
|
|
8
|
+
remoteApiCompatibility: string | null;
|
|
9
|
+
remoteHostFingerprint: string | null;
|
|
10
|
+
lastCheckedAt: string | null;
|
|
11
|
+
lastErrorCode: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface ResourceScopeRef {
|
|
14
|
+
hostId: string;
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
targetHostId: string | null;
|
|
17
|
+
scopeGeneration: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 作用域切换时使用的输入,不允许调用方自行伪造 generation。
|
|
21
|
+
* generation 只能由 ResourceScopeManager 分配。
|
|
22
|
+
*/
|
|
23
|
+
export interface ResourceScopeInput {
|
|
24
|
+
hostId: string;
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
targetHostId: string | null;
|
|
27
|
+
}
|
|
28
|
+
/** 对外暴露的只读作用域快照。 */
|
|
29
|
+
export type ResourceScopeSnapshot = Readonly<ResourceScopeRef>;
|
|
30
|
+
/** 作用域拥有的清理函数。清理函数必须可重复调用而不会产生副作用。 */
|
|
31
|
+
export type ResourceScopeDisposer = () => void | Promise<void>;
|
|
32
|
+
/** 作用域已经失效时统一抛出的错误。 */
|
|
33
|
+
export declare class ResourceScopeStaleError extends Error {
|
|
34
|
+
readonly code: "RESOURCE_SCOPE_STALE";
|
|
35
|
+
constructor(message?: string);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=peer-host.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 作用域已经失效时统一抛出的错误。 */
|
|
2
|
+
export class ResourceScopeStaleError extends Error {
|
|
3
|
+
code = 'RESOURCE_SCOPE_STALE';
|
|
4
|
+
constructor(message = 'Resource scope is stale') {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = 'ResourceScopeStaleError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=peer-host.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface RelayIceServer {
|
|
2
|
+
urls: string | string[];
|
|
3
|
+
username?: string;
|
|
4
|
+
credential?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RelaySignalingTicketRequest {
|
|
7
|
+
tunnelDomain?: string;
|
|
8
|
+
bindingId?: string;
|
|
9
|
+
hostDtlsFingerprint?: string;
|
|
10
|
+
credentialVersion?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface RelaySignalingTicketResponse {
|
|
13
|
+
ticket: string;
|
|
14
|
+
expiresAt: string;
|
|
15
|
+
signalingBaseUrl: string;
|
|
16
|
+
iceServers: RelayIceServer[];
|
|
17
|
+
iceTransportPolicy: 'all' | 'relay';
|
|
18
|
+
hostDtlsFingerprint: string;
|
|
19
|
+
bindingId: string;
|
|
20
|
+
tunnelDomain: string;
|
|
21
|
+
trafficRemainingBytes: string;
|
|
22
|
+
credentialVersion?: number;
|
|
23
|
+
}
|
|
24
|
+
export type RelaySignalingClientMessage = {
|
|
25
|
+
type: 'offer';
|
|
26
|
+
sdp: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'candidate';
|
|
29
|
+
candidate: string;
|
|
30
|
+
mid: string | null;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'ping';
|
|
33
|
+
at: string;
|
|
34
|
+
};
|
|
35
|
+
export type RelaySignalingServerMessage = {
|
|
36
|
+
type: 'registered';
|
|
37
|
+
role: 'client' | 'host';
|
|
38
|
+
bindingId: string;
|
|
39
|
+
sessionId: string | null;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'peer-ready';
|
|
42
|
+
peerRole: 'client' | 'host';
|
|
43
|
+
sessionId: string | null;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'peer-left';
|
|
46
|
+
peerRole: 'client' | 'host';
|
|
47
|
+
sessionId: string | null;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'answer';
|
|
50
|
+
sdp: string;
|
|
51
|
+
senderRole: 'host';
|
|
52
|
+
sessionId: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'candidate';
|
|
55
|
+
candidate: string;
|
|
56
|
+
mid: string | null;
|
|
57
|
+
senderRole: 'host';
|
|
58
|
+
sessionId: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'pong';
|
|
61
|
+
at: string;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'error';
|
|
64
|
+
errorCode: string;
|
|
65
|
+
detail: string;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=signaling.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** 单个 Provider 订阅窗口的脱敏用量。百分比均为 0 到 100。 */
|
|
2
|
+
export interface CliSubscriptionWindow {
|
|
3
|
+
readonly usedPercent: number;
|
|
4
|
+
readonly remainingPercent: number;
|
|
5
|
+
readonly windowDurationMins: number | null;
|
|
6
|
+
readonly resetsAt: number | null;
|
|
7
|
+
readonly remainingCredits?: number;
|
|
8
|
+
readonly totalCredits?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Host 读取 Provider 订阅后返回给 Client 的安全摘要。 */
|
|
11
|
+
export interface CliSubscriptionUsage {
|
|
12
|
+
readonly authenticated: boolean;
|
|
13
|
+
readonly planType: string | null;
|
|
14
|
+
readonly primary: CliSubscriptionWindow | null;
|
|
15
|
+
readonly secondary: CliSubscriptionWindow | null;
|
|
16
|
+
readonly monthly: CliSubscriptionWindow | null;
|
|
17
|
+
readonly rateLimitReachedType: string | null;
|
|
18
|
+
readonly resetCredits: null | {
|
|
19
|
+
readonly availableCount: number;
|
|
20
|
+
readonly credits: readonly {
|
|
21
|
+
readonly id: string | null;
|
|
22
|
+
readonly expiresAt: number | null;
|
|
23
|
+
readonly title: string | null;
|
|
24
|
+
readonly description: string | null;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
readonly capturedAt: string;
|
|
28
|
+
/** 第三方上游的账户余额和用量摘要;原始 API key 永不进入此结构。 */
|
|
29
|
+
readonly sub2api?: Sub2ApiUsage;
|
|
30
|
+
}
|
|
31
|
+
export interface Sub2ApiUsagePoint {
|
|
32
|
+
readonly requests: number;
|
|
33
|
+
readonly inputTokens: number;
|
|
34
|
+
readonly outputTokens: number;
|
|
35
|
+
readonly cacheCreationTokens: number;
|
|
36
|
+
readonly cacheReadTokens: number;
|
|
37
|
+
readonly totalTokens: number;
|
|
38
|
+
readonly cost: number;
|
|
39
|
+
readonly actualCost: number;
|
|
40
|
+
readonly cacheHitRate: number;
|
|
41
|
+
}
|
|
42
|
+
export interface Sub2ApiDailyUsage extends Sub2ApiUsagePoint {
|
|
43
|
+
readonly date: string;
|
|
44
|
+
}
|
|
45
|
+
export interface Sub2ApiModelUsage extends Sub2ApiUsagePoint {
|
|
46
|
+
readonly model: string;
|
|
47
|
+
readonly accountCost: number;
|
|
48
|
+
}
|
|
49
|
+
export interface Sub2ApiUsage {
|
|
50
|
+
readonly upstreamType: 'Sub2API' | 'OneAPI' | '其他';
|
|
51
|
+
/** 已移除 query、fragment、userinfo 的可公开上游地址。 */
|
|
52
|
+
readonly upstreamUrl: string;
|
|
53
|
+
/** Host 侧按需获取并内联的图标;失败时为空字符串。 */
|
|
54
|
+
readonly logoDataUrl?: string;
|
|
55
|
+
readonly logoUrl: string;
|
|
56
|
+
readonly balance: number;
|
|
57
|
+
readonly remaining: number;
|
|
58
|
+
readonly unit: string;
|
|
59
|
+
readonly planName: string | null;
|
|
60
|
+
readonly mode: string | null;
|
|
61
|
+
readonly today: Sub2ApiUsagePoint;
|
|
62
|
+
readonly total: Sub2ApiUsagePoint;
|
|
63
|
+
readonly daily: readonly Sub2ApiDailyUsage[];
|
|
64
|
+
readonly models: readonly Sub2ApiModelUsage[];
|
|
65
|
+
readonly rpm: number | null;
|
|
66
|
+
readonly tpm: number | null;
|
|
67
|
+
readonly averageDurationMs: number | null;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CodingNsTerminalRuntimeType, CodingNsTerminalShell, CodingNsWebTerminalInfo } from './terminal.js';
|
|
2
|
+
/** 终端侧可直接启动的配置;完整调试编排仍由 Spec003 负责。 */
|
|
3
|
+
export interface TerminalLaunchProfile {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly workspaceId: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** 相对于 Workspace 根目录,禁止保存绝对路径。 */
|
|
8
|
+
readonly cwdRelative: string;
|
|
9
|
+
readonly command: string;
|
|
10
|
+
readonly args: readonly string[];
|
|
11
|
+
readonly env: Readonly<Record<string, string>>;
|
|
12
|
+
readonly shell: CodingNsTerminalShell;
|
|
13
|
+
readonly runtimeType: CodingNsTerminalRuntimeType;
|
|
14
|
+
readonly runtimeMode: 'pty';
|
|
15
|
+
readonly revision: number;
|
|
16
|
+
readonly createdAt: string;
|
|
17
|
+
readonly updatedAt: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TerminalLaunchProfileInput {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly workspaceId: string;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly cwdRelative: string;
|
|
24
|
+
readonly command: string;
|
|
25
|
+
readonly args?: readonly string[];
|
|
26
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
27
|
+
readonly shell: CodingNsTerminalShell;
|
|
28
|
+
readonly runtimeType: CodingNsTerminalRuntimeType;
|
|
29
|
+
readonly runtimeMode?: 'pty';
|
|
30
|
+
}
|
|
31
|
+
export type TerminalProcessState = 'starting' | 'running' | 'stopping' | 'exited' | 'failed' | 'lost';
|
|
32
|
+
/** 一次由 Host 创建、并可附着到终端的实际进程记录。 */
|
|
33
|
+
export interface TerminalProcessInstance {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly workspaceId: string;
|
|
36
|
+
readonly profileId: string;
|
|
37
|
+
readonly terminalId: string;
|
|
38
|
+
readonly runtimeSessionKey: string | null;
|
|
39
|
+
readonly state: TerminalProcessState;
|
|
40
|
+
readonly pid: number | null;
|
|
41
|
+
readonly resolvedCommand: {
|
|
42
|
+
readonly command: string;
|
|
43
|
+
readonly args: readonly string[];
|
|
44
|
+
readonly cwd: string;
|
|
45
|
+
};
|
|
46
|
+
readonly exitCode: number | null;
|
|
47
|
+
readonly error?: string;
|
|
48
|
+
readonly startedAt: string | null;
|
|
49
|
+
readonly stoppedAt: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface TerminalProcessLaunchRequest {
|
|
52
|
+
readonly workspaceId: string;
|
|
53
|
+
readonly profileId: string;
|
|
54
|
+
readonly dshSessionId?: string;
|
|
55
|
+
readonly terminalId?: string;
|
|
56
|
+
readonly cols: number;
|
|
57
|
+
readonly rows: number;
|
|
58
|
+
/** 直接启动命令,或先启动 Shell 再把命令写入终端。 */
|
|
59
|
+
readonly commandMode?: 'direct' | 'shell-input';
|
|
60
|
+
}
|
|
61
|
+
export interface TerminalProcessLaunchResult {
|
|
62
|
+
readonly instance: TerminalProcessInstance;
|
|
63
|
+
readonly terminal: CodingNsWebTerminalInfo;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=terminal-process.d.ts.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/** 插件 Sidebar 终端兼容层使用的终端状态。 */
|
|
2
|
+
export type WebTerminalId = string;
|
|
3
|
+
export type TerminalAttachmentId = string;
|
|
4
|
+
export type CodingNsTerminalState = 'starting' | 'running' | 'exited' | 'closing' | 'lost' | 'closed' | 'error';
|
|
5
|
+
/** 持久终端所使用的本机运行时。 */
|
|
6
|
+
export type CodingNsTerminalRuntimeType = 'local-pty' | 'tmux' | 'conpty-powershell' | 'conpty-cmd' | 'conpty-git-bash';
|
|
7
|
+
/**
|
|
8
|
+
* 可跨浏览器、插件 generation 和 DSH 重启恢复的记录。
|
|
9
|
+
*
|
|
10
|
+
* 这里故意不包含 generation、stream、Socket、订阅回调或本机控制凭据;这些
|
|
11
|
+
* 都是一次 attach 的短命资源,不能反过来拥有 tmux/ConPTY 进程。
|
|
12
|
+
*/
|
|
13
|
+
export interface PersistentTerminalRecord {
|
|
14
|
+
readonly hostId: string;
|
|
15
|
+
readonly workspaceId: string;
|
|
16
|
+
/** 最近一次 attach 所在的 DSH session;仅兼容旧记录和诊断,不参与归属或主键。 */
|
|
17
|
+
readonly dshSessionId?: string;
|
|
18
|
+
readonly terminalId: string;
|
|
19
|
+
readonly runtimeSessionKey: string;
|
|
20
|
+
readonly runtimeType: CodingNsTerminalRuntimeType;
|
|
21
|
+
/** 终端 UI 显示的 shell;启动项 PTY 可以另外指定实际命令。 */
|
|
22
|
+
readonly shellPath: string;
|
|
23
|
+
readonly shellProfileId?: CodingNsTerminalShell['profileId'];
|
|
24
|
+
readonly shellName?: string;
|
|
25
|
+
readonly shellArgs?: readonly string[];
|
|
26
|
+
/** 由 Host 直接启动的 PTY 命令;普通交互终端不设置。 */
|
|
27
|
+
readonly commandPath?: string;
|
|
28
|
+
readonly commandArgs?: readonly string[];
|
|
29
|
+
readonly commandEnv?: Readonly<Record<string, string>>;
|
|
30
|
+
readonly launchProfileId?: string;
|
|
31
|
+
readonly cwd: string;
|
|
32
|
+
readonly title: string;
|
|
33
|
+
readonly cols: number;
|
|
34
|
+
readonly rows: number;
|
|
35
|
+
readonly state: CodingNsTerminalState;
|
|
36
|
+
readonly exitCode: number | null;
|
|
37
|
+
readonly error?: string;
|
|
38
|
+
readonly createdAt: string;
|
|
39
|
+
readonly updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
/** 当前连接到持久运行时的一次短命 attach,只保存在内存中。 */
|
|
42
|
+
export interface TerminalAttachmentRecord {
|
|
43
|
+
readonly terminalId: string;
|
|
44
|
+
readonly generation: string;
|
|
45
|
+
readonly streamId: string;
|
|
46
|
+
readonly subscriptionId: string;
|
|
47
|
+
readonly runtimeAttachmentId: string;
|
|
48
|
+
}
|
|
49
|
+
/** 持久终端按 Host 与工作区归属;dshSessionId 只作为本次请求的 attach 上下文。 */
|
|
50
|
+
export interface TerminalOwnerScope {
|
|
51
|
+
readonly hostId: string;
|
|
52
|
+
readonly workspaceId: string;
|
|
53
|
+
readonly dshSessionId?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface TerminalRecordIdentity extends TerminalOwnerScope {
|
|
56
|
+
readonly terminalId: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CodingNsTerminalShell {
|
|
59
|
+
readonly profileId: 'zsh' | 'bash' | 'powershell' | 'cmd' | 'git-bash';
|
|
60
|
+
readonly path: string;
|
|
61
|
+
readonly args: readonly string[];
|
|
62
|
+
readonly name: string;
|
|
63
|
+
}
|
|
64
|
+
/** 与 DSH 0.1.6-alpha.2 `remote.terminal` wire shape 对齐。 */
|
|
65
|
+
export interface CodingNsWebTerminalInfo {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly title: string;
|
|
68
|
+
/** 浏览器 wire 不暴露 Host 内部 profileId。 */
|
|
69
|
+
readonly shell: CodingNsTerminalShellOption;
|
|
70
|
+
readonly cwd: string;
|
|
71
|
+
readonly cols: number;
|
|
72
|
+
readonly rows: number;
|
|
73
|
+
readonly state: 'running' | 'exited' | 'failed';
|
|
74
|
+
readonly exitCode: number | null;
|
|
75
|
+
readonly error?: string;
|
|
76
|
+
readonly controllerId?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface CodingNsTerminalCreateRequest {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly shellPath?: string;
|
|
81
|
+
readonly cols: number;
|
|
82
|
+
readonly rows: number;
|
|
83
|
+
}
|
|
84
|
+
export interface CodingNsTerminalEnvironment {
|
|
85
|
+
readonly cwd: string;
|
|
86
|
+
/** DSH Workspace Registry 的稳定身份;缺失时 Client 仅使用会话级兼容键。 */
|
|
87
|
+
readonly workspaceId?: string;
|
|
88
|
+
readonly maxInputBytes: number;
|
|
89
|
+
readonly maxCols: number;
|
|
90
|
+
readonly maxRows: number;
|
|
91
|
+
readonly scrollback: number;
|
|
92
|
+
}
|
|
93
|
+
export interface CodingNsTerminalShellOption {
|
|
94
|
+
readonly path: string;
|
|
95
|
+
readonly args: readonly string[];
|
|
96
|
+
readonly name: string;
|
|
97
|
+
}
|
|
98
|
+
/** Host 对设置页公开的终端启动状态;只含平台能力,不含本机控制凭据。 */
|
|
99
|
+
export interface CodingNsTerminalStatus {
|
|
100
|
+
readonly platform: 'darwin' | 'linux' | 'win32' | 'unsupported';
|
|
101
|
+
readonly controllerMode: 'baseline' | 'enhanced';
|
|
102
|
+
readonly effectiveEnabled: boolean;
|
|
103
|
+
readonly profiles: readonly {
|
|
104
|
+
readonly profileId: CodingNsTerminalShell['profileId'];
|
|
105
|
+
readonly name: string;
|
|
106
|
+
readonly path: string;
|
|
107
|
+
}[];
|
|
108
|
+
readonly resolvedProfileId: CodingNsTerminalShell['profileId'] | null;
|
|
109
|
+
readonly fallbackReason?: string;
|
|
110
|
+
}
|
|
111
|
+
export type CodingNsTerminalFrame = {
|
|
112
|
+
readonly type: 'snapshot';
|
|
113
|
+
readonly sequence: number;
|
|
114
|
+
readonly screen: string;
|
|
115
|
+
readonly info: CodingNsWebTerminalInfo;
|
|
116
|
+
} | {
|
|
117
|
+
readonly type: 'output';
|
|
118
|
+
readonly sequence: number;
|
|
119
|
+
readonly data: string;
|
|
120
|
+
} | {
|
|
121
|
+
readonly type: 'state';
|
|
122
|
+
readonly info: CodingNsWebTerminalInfo;
|
|
123
|
+
};
|
|
124
|
+
export interface CodingNsTerminalRetentionFrame {
|
|
125
|
+
readonly type: 'retained';
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CodingNsDshErrorCode } from './errors.js';
|
|
2
|
+
/** Codingns4DSH Host RPC 的固定逻辑通道。 */
|
|
3
|
+
export declare const CODINGNS_RPC_CHANNEL = "/codingns";
|
|
4
|
+
export interface CodingNsRpcRequest<TPayload = unknown> {
|
|
5
|
+
method: string;
|
|
6
|
+
payload: TPayload;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export interface CodingNsStreamRequest<TPayload = unknown> {
|
|
10
|
+
method: string;
|
|
11
|
+
payload: TPayload;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
export interface CodingNsTransportGeneration {
|
|
15
|
+
id: number;
|
|
16
|
+
host: {
|
|
17
|
+
home: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface CodingNsTransport {
|
|
21
|
+
rpc<TResponse = unknown, TPayload = unknown>(request: CodingNsRpcRequest<TPayload>): Promise<TResponse>;
|
|
22
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
23
|
+
openStream<TChunk = unknown, TPayload = unknown>(request: CodingNsStreamRequest<TPayload>): AsyncIterable<TChunk>;
|
|
24
|
+
loadBundle(url: string): Promise<void>;
|
|
25
|
+
getGeneration(): CodingNsTransportGeneration | undefined;
|
|
26
|
+
onGenerationChange(listener: (generation: CodingNsTransportGeneration | undefined) => void): () => void;
|
|
27
|
+
reconnect(signal?: AbortSignal): Promise<void>;
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export interface CodingNsTransportHooks {
|
|
31
|
+
rpc?: CodingNsTransport['rpc'];
|
|
32
|
+
fetch?: CodingNsTransport['fetch'];
|
|
33
|
+
openStream?: CodingNsTransport['openStream'];
|
|
34
|
+
loadBundle?: CodingNsTransport['loadBundle'];
|
|
35
|
+
generation?: CodingNsTransport['getGeneration'];
|
|
36
|
+
onGenerationChange?: CodingNsTransport['onGenerationChange'];
|
|
37
|
+
reconnect?: CodingNsTransport['reconnect'];
|
|
38
|
+
close?: CodingNsTransport['close'];
|
|
39
|
+
}
|
|
40
|
+
export interface CodingNsTransportErrorShape {
|
|
41
|
+
code: CodingNsDshErrorCode;
|
|
42
|
+
message: string;
|
|
43
|
+
generationId?: number;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 当前经过完整验证的 DSH 版本;源文件由根目录 version.json 同步。 */
|
|
2
|
+
export declare const DSH_VERSION: "0.1.6-alpha.2";
|
|
3
|
+
/** DSH 测试版本别名,供新代码表达语义,保留 DSH_VERSION 兼容旧调用方。 */
|
|
4
|
+
export declare const DSH_TESTED_VERSION: "0.1.6-alpha.2";
|
|
5
|
+
/** 插件支持的 DSH 版本范围;插件版本与宿主版本独立发布。 */
|
|
6
|
+
export declare const DSH_COMPATIBILITY: ">=0.1.5-rc.3 <0.1.7-0";
|
|
7
|
+
/** DSH Envelope/Tunnel 协议主版本。 */
|
|
8
|
+
export declare const DSH_PROTOCOL_VERSION: 1;
|
|
9
|
+
/** Host 注入到浏览器页面的真实 DSH 版本全局字段。 */
|
|
10
|
+
export declare const CODINGNS_DSH_VERSION_GLOBAL: "__CODINGNS_DSH_VERSION__";
|
|
11
|
+
/** 识别没有 alpha2 Sidebar 扩展 API 的 DSH 旧版运行时。 */
|
|
12
|
+
export declare function isLegacyDshVersion(version: string): boolean;
|
|
13
|
+
/** Codingns4DSH 插件自身的 npm 版本。 */
|
|
14
|
+
export declare const CODINGNS_VERSION: "0.1.0";
|
|
15
|
+
/** 判断宿主版本是否落在当前插件声明的 DSH 兼容范围内。 */
|
|
16
|
+
export declare function isDshVersionCompatible(version: string): boolean;
|
|
17
|
+
/** 判断 DSH 版本是否达到某个功能模块要求的最低版本。 */
|
|
18
|
+
export declare function isDshVersionAtLeast(version: string, minimum: string): boolean;
|
|
19
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** 当前经过完整验证的 DSH 版本;源文件由根目录 version.json 同步。 */
|
|
2
|
+
export const DSH_VERSION = '0.1.6-alpha.2';
|
|
3
|
+
/** DSH 测试版本别名,供新代码表达语义,保留 DSH_VERSION 兼容旧调用方。 */
|
|
4
|
+
export const DSH_TESTED_VERSION = DSH_VERSION;
|
|
5
|
+
/** 插件支持的 DSH 版本范围;插件版本与宿主版本独立发布。 */
|
|
6
|
+
export const DSH_COMPATIBILITY = '>=0.1.5-rc.3 <0.1.7-0';
|
|
7
|
+
/** DSH Envelope/Tunnel 协议主版本。 */
|
|
8
|
+
export const DSH_PROTOCOL_VERSION = 1;
|
|
9
|
+
/** Host 注入到浏览器页面的真实 DSH 版本全局字段。 */
|
|
10
|
+
export const CODINGNS_DSH_VERSION_GLOBAL = '__CODINGNS_DSH_VERSION__';
|
|
11
|
+
/** 识别没有 alpha2 Sidebar 扩展 API 的 DSH 旧版运行时。 */
|
|
12
|
+
export function isLegacyDshVersion(version) {
|
|
13
|
+
return /^0\.1\.5(?:-|$)/u.test(version);
|
|
14
|
+
}
|
|
15
|
+
/** Codingns4DSH 插件自身的 npm 版本。 */
|
|
16
|
+
export const CODINGNS_VERSION = '0.1.0';
|
|
17
|
+
/** 判断宿主版本是否落在当前插件声明的 DSH 兼容范围内。 */
|
|
18
|
+
export function isDshVersionCompatible(version) {
|
|
19
|
+
const match = /^>=([^ ]+) <([^ ]+)$/u.exec(DSH_COMPATIBILITY);
|
|
20
|
+
const actual = parseVersion(version);
|
|
21
|
+
const minimum = parseVersion(match?.[1] ?? '');
|
|
22
|
+
const maximum = parseVersion(match?.[2] ?? '');
|
|
23
|
+
if (!actual || !minimum || !maximum)
|
|
24
|
+
return version === DSH_VERSION;
|
|
25
|
+
if (actual.major === maximum.major && actual.minor === maximum.minor && actual.patch === maximum.patch && actual.prerelease.length > 0)
|
|
26
|
+
return false;
|
|
27
|
+
return compareVersions(actual, minimum) >= 0 && compareVersions(actual, maximum) < 0;
|
|
28
|
+
}
|
|
29
|
+
/** 判断 DSH 版本是否达到某个功能模块要求的最低版本。 */
|
|
30
|
+
export function isDshVersionAtLeast(version, minimum) {
|
|
31
|
+
const actual = parseVersion(version);
|
|
32
|
+
const required = parseVersion(minimum);
|
|
33
|
+
if (!actual || !required)
|
|
34
|
+
return false;
|
|
35
|
+
return compareVersions(actual, required) >= 0;
|
|
36
|
+
}
|
|
37
|
+
function parseVersion(value) {
|
|
38
|
+
const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/u.exec(value);
|
|
39
|
+
if (!match)
|
|
40
|
+
return undefined;
|
|
41
|
+
return {
|
|
42
|
+
major: Number(match[1]),
|
|
43
|
+
minor: Number(match[2]),
|
|
44
|
+
patch: Number(match[3]),
|
|
45
|
+
prerelease: match[4] === undefined ? [] : match[4].split('.').map((part) => /^\d+$/u.test(part) ? Number(part) : part),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function compareVersions(left, right) {
|
|
49
|
+
for (const key of ['major', 'minor', 'patch']) {
|
|
50
|
+
if (left[key] !== right[key])
|
|
51
|
+
return left[key] - right[key];
|
|
52
|
+
}
|
|
53
|
+
if (left.prerelease.length === 0 && right.prerelease.length > 0)
|
|
54
|
+
return 1;
|
|
55
|
+
if (left.prerelease.length > 0 && right.prerelease.length === 0)
|
|
56
|
+
return -1;
|
|
57
|
+
for (let index = 0; index < Math.max(left.prerelease.length, right.prerelease.length); index += 1) {
|
|
58
|
+
const leftPart = left.prerelease[index];
|
|
59
|
+
const rightPart = right.prerelease[index];
|
|
60
|
+
if (leftPart === undefined)
|
|
61
|
+
return -1;
|
|
62
|
+
if (rightPart === undefined)
|
|
63
|
+
return 1;
|
|
64
|
+
if (leftPart === rightPart)
|
|
65
|
+
continue;
|
|
66
|
+
if (typeof leftPart === 'number' && typeof rightPart === 'string')
|
|
67
|
+
return -1;
|
|
68
|
+
if (typeof leftPart === 'string' && typeof rightPart === 'number')
|
|
69
|
+
return 1;
|
|
70
|
+
return leftPart < rightPart ? -1 : 1;
|
|
71
|
+
}
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=version.js.map
|