@jingyi0605/codingns4dsh 0.1.0 → 0.1.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.
Files changed (216) hide show
  1. package/README.en.md +306 -0
  2. package/README.md +190 -993
  3. package/data/build/dist/client/account-bar.d.ts +2 -2
  4. package/data/build/dist/client/account-bar.js +96 -39
  5. package/data/build/dist/client/bundle.js +13722 -3611
  6. package/data/build/dist/client/cli-catalog.js +20 -3
  7. package/data/build/dist/client/cli-slots.d.ts +5 -0
  8. package/data/build/dist/client/cli-slots.js +57 -7
  9. package/data/build/dist/client/debug/ui.d.ts +1 -1
  10. package/data/build/dist/client/debug/ui.js +62 -32
  11. package/data/build/dist/client/dsh-runtime-version.d.ts +9 -2
  12. package/data/build/dist/client/dsh-runtime-version.js +24 -2
  13. package/data/build/dist/client/features/cli-adapters.d.ts +1 -1
  14. package/data/build/dist/client/features/cli-adapters.js +19 -16
  15. package/data/build/dist/client/features/debug.js +2 -2
  16. package/data/build/dist/client/features/index.d.ts +2 -1
  17. package/data/build/dist/client/features/index.js +3 -1
  18. package/data/build/dist/client/features/lan-access-panel.d.ts +1 -1
  19. package/data/build/dist/client/features/lan-access-panel.js +8 -10
  20. package/data/build/dist/client/features/lan-access.js +1 -1
  21. package/data/build/dist/client/features/login-protection-panel.d.ts +1 -1
  22. package/data/build/dist/client/features/login-protection-panel.js +7 -9
  23. package/data/build/dist/client/features/reverse-proxy-panel.d.ts +1 -1
  24. package/data/build/dist/client/features/reverse-proxy-panel.js +99 -11
  25. package/data/build/dist/client/features/reverse-proxy.d.ts +1 -1
  26. package/data/build/dist/client/features/reverse-proxy.js +19 -18
  27. package/data/build/dist/client/features/terminal-enhancement-panel.d.ts +1 -1
  28. package/data/build/dist/client/features/terminal-enhancement-panel.js +62 -55
  29. package/data/build/dist/client/features/terminal-enhancement.d.ts +1 -1
  30. package/data/build/dist/client/features/terminal-enhancement.js +3 -3
  31. package/data/build/dist/client/features/types.d.ts +14 -3
  32. package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts +1 -1
  33. package/data/build/dist/client/features/workspace-session-enhancement-panel.js +31 -9
  34. package/data/build/dist/client/features/workspace-session-enhancement.js +72 -11
  35. package/data/build/dist/client/git-management.d.ts +16 -0
  36. package/data/build/dist/client/git-management.js +757 -0
  37. package/data/build/dist/client/index.d.ts +3 -2
  38. package/data/build/dist/client/index.js +152 -27
  39. package/data/build/dist/client/locale.js +91 -29
  40. package/data/build/dist/client/quick-phrase-layout.d.ts +49 -0
  41. package/data/build/dist/client/quick-phrase-layout.js +95 -0
  42. package/data/build/dist/client/quick-phrase-slot.d.ts +7 -0
  43. package/data/build/dist/client/quick-phrase-slot.js +370 -0
  44. package/data/build/dist/client/remote-web-context.js +1 -1
  45. package/data/build/dist/client/settings-bridge.d.ts +9 -6
  46. package/data/build/dist/client/settings-bridge.js +51 -27
  47. package/data/build/dist/client/settings-section.d.ts +3 -2
  48. package/data/build/dist/client/settings-section.js +33 -19
  49. package/data/build/dist/client/subscription-slot.d.ts +3 -0
  50. package/data/build/dist/client/subscription-slot.js +108 -16
  51. package/data/build/dist/client/terminal/model.d.ts +14 -2
  52. package/data/build/dist/client/terminal/model.js +109 -21
  53. package/data/build/dist/client/terminal/recovery.d.ts +50 -0
  54. package/data/build/dist/client/terminal/recovery.js +101 -0
  55. package/data/build/dist/client/terminal/ui.d.ts +2 -2
  56. package/data/build/dist/client/terminal/ui.js +49 -11
  57. package/data/build/dist/client/terminal/xterm-view.d.ts +2 -2
  58. package/data/build/dist/client/terminal/xterm-view.js +2 -1
  59. package/data/build/dist/client/theme.d.ts +6 -1
  60. package/data/build/dist/client/theme.js +32 -1
  61. package/data/build/dist/client/workspace-session-archive-dom.d.ts +12 -0
  62. package/data/build/dist/client/workspace-session-archive-dom.js +27 -5
  63. package/data/build/dist/client/workspace-session-visibility-dom.d.ts +30 -0
  64. package/data/build/dist/client/workspace-session-visibility-dom.js +604 -0
  65. package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts +50 -0
  66. package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js +139 -0
  67. package/data/build/dist/dsh-capabilities/client/conversation-adapter.d.ts +7 -0
  68. package/data/build/dist/dsh-capabilities/client/conversation-adapter.js +6 -0
  69. package/data/build/dist/dsh-capabilities/client/locale-adapter.d.ts +9 -0
  70. package/data/build/dist/dsh-capabilities/client/locale-adapter.js +4 -0
  71. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +10 -0
  72. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +14 -0
  73. package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.d.ts +8 -0
  74. package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.js +16 -0
  75. package/data/build/dist/dsh-capabilities/client/sidebar-adapter.d.ts +7 -0
  76. package/data/build/dist/dsh-capabilities/client/sidebar-adapter.js +5 -0
  77. package/data/build/dist/dsh-capabilities/client/theme-adapter.d.ts +6 -0
  78. package/data/build/dist/dsh-capabilities/client/theme-adapter.js +4 -0
  79. package/data/build/dist/dsh-capabilities/client/typert-adapter.d.ts +5 -0
  80. package/data/build/dist/dsh-capabilities/client/typert-adapter.js +4 -0
  81. package/data/build/dist/dsh-capabilities/host/config-forms-adapter.d.ts +19 -0
  82. package/data/build/dist/dsh-capabilities/host/config-forms-adapter.js +45 -0
  83. package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.d.ts +19 -0
  84. package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.js +13 -0
  85. package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.d.ts +8 -0
  86. package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.js +47 -0
  87. package/data/build/dist/dsh-capabilities/host/typert-adapter.d.ts +6 -0
  88. package/data/build/dist/dsh-capabilities/host/typert-adapter.js +4 -0
  89. package/data/build/dist/dsh-capabilities/index.d.ts +6 -0
  90. package/data/build/dist/dsh-capabilities/index.js +6 -0
  91. package/data/build/dist/dsh-capabilities/matrix.d.ts +15 -0
  92. package/data/build/dist/dsh-capabilities/matrix.js +32 -0
  93. package/data/build/dist/dsh-capabilities/registry.d.ts +22 -0
  94. package/data/build/dist/dsh-capabilities/registry.js +196 -0
  95. package/data/build/dist/dsh-capabilities/routes.d.ts +10 -0
  96. package/data/build/dist/dsh-capabilities/routes.js +34 -0
  97. package/data/build/dist/dsh-capabilities/settings-store.d.ts +29 -0
  98. package/data/build/dist/dsh-capabilities/settings-store.js +5 -0
  99. package/data/build/dist/dsh-capabilities/types.d.ts +50 -0
  100. package/data/build/dist/dsh-capabilities/types.js +23 -0
  101. package/data/build/dist/features/registry.d.ts +8 -2
  102. package/data/build/dist/features/registry.js +104 -1
  103. package/data/build/dist/host/auth-session.d.ts +8 -1
  104. package/data/build/dist/host/auth-session.js +28 -6
  105. package/data/build/dist/host/cli-adapters/claude-driver.d.ts +2 -0
  106. package/data/build/dist/host/cli-adapters/claude-driver.js +19 -4
  107. package/data/build/dist/host/cli-adapters/claude-model-options.d.ts +14 -0
  108. package/data/build/dist/host/cli-adapters/claude-model-options.js +157 -0
  109. package/data/build/dist/host/cli-adapters/codex-driver.d.ts +11 -0
  110. package/data/build/dist/host/cli-adapters/codex-driver.js +166 -14
  111. package/data/build/dist/host/cli-adapters/driver.d.ts +2 -0
  112. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +15 -0
  113. package/data/build/dist/host/cli-adapters/dsh-message-projector.js +120 -29
  114. package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts +4 -1
  115. package/data/build/dist/host/cli-adapters/dsh-tool-history.js +25 -7
  116. package/data/build/dist/host/cli-adapters/feature.js +74 -8
  117. package/data/build/dist/host/cli-adapters/gemini-driver.js +2 -2
  118. package/data/build/dist/host/cli-adapters/grok-driver.js +2 -2
  119. package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +4 -2
  120. package/data/build/dist/host/cli-adapters/json-rpc-process.js +8 -9
  121. package/data/build/dist/host/cli-adapters/kimi-driver.js +1 -1
  122. package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts +17 -0
  123. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +88 -0
  124. package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts +24 -0
  125. package/data/build/dist/host/cli-adapters/legacy-session-settings.js +162 -0
  126. package/data/build/dist/host/cli-adapters/official-provider-subscription.d.ts +29 -0
  127. package/data/build/dist/host/cli-adapters/official-provider-subscription.js +361 -0
  128. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +2 -0
  129. package/data/build/dist/host/cli-adapters/opencode-driver.js +97 -12
  130. package/data/build/dist/host/cli-adapters/pi-driver.js +69 -23
  131. package/data/build/dist/host/cli-adapters/provider-registry.d.ts +33 -0
  132. package/data/build/dist/host/cli-adapters/provider-registry.js +83 -0
  133. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +25 -3
  134. package/data/build/dist/host/cli-adapters/provider-subscription.js +346 -30
  135. package/data/build/dist/host/cli-adapters/registry.d.ts +6 -0
  136. package/data/build/dist/host/cli-adapters/registry.js +170 -13
  137. package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +10 -0
  138. package/data/build/dist/host/cli-adapters/session-store.d.ts +7 -0
  139. package/data/build/dist/host/cli-adapters/session-store.js +39 -1
  140. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +3 -0
  141. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +3 -0
  142. package/data/build/dist/host/cli-adapters/stream-normalizer.js +22 -2
  143. package/data/build/dist/host/control-api-client.d.ts +3 -3
  144. package/data/build/dist/host/control-api-client.js +2 -1
  145. package/data/build/dist/host/credential-store.js +11 -1
  146. package/data/build/dist/host/dsh-device-runtime.d.ts +4 -0
  147. package/data/build/dist/host/dsh-device-runtime.js +20 -9
  148. package/data/build/dist/host/dsh-runtime-version.d.ts +3 -2
  149. package/data/build/dist/host/dsh-runtime-version.js +71 -2
  150. package/data/build/dist/host/features/auth.js +8 -5
  151. package/data/build/dist/host/features/debug.js +1 -1
  152. package/data/build/dist/host/features/git-management.d.ts +5 -0
  153. package/data/build/dist/host/features/git-management.js +290 -0
  154. package/data/build/dist/host/features/host-status.js +1 -1
  155. package/data/build/dist/host/features/index.d.ts +1 -0
  156. package/data/build/dist/host/features/index.js +3 -0
  157. package/data/build/dist/host/features/terminal-process.js +1 -1
  158. package/data/build/dist/host/features/terminal-status.d.ts +3 -1
  159. package/data/build/dist/host/features/terminal-status.js +3 -1
  160. package/data/build/dist/host/index.d.ts +7 -3
  161. package/data/build/dist/host/index.js +79 -15
  162. package/data/build/dist/host/lan-access-dsh.js +18 -5
  163. package/data/build/dist/host/native-session-bridge.d.ts +23 -1
  164. package/data/build/dist/host/native-session-bridge.js +157 -10
  165. package/data/build/dist/host/rpc-table.d.ts +1 -1
  166. package/data/build/dist/host/rpc.js +60 -10
  167. package/data/build/dist/host/session-migration-repair.d.ts +19 -0
  168. package/data/build/dist/host/session-migration-repair.js +395 -0
  169. package/data/build/dist/host/settings.d.ts +8 -1
  170. package/data/build/dist/host/settings.js +94 -3
  171. package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +1 -0
  172. package/data/build/dist/host/terminal/backends/tmux-backend.js +4 -2
  173. package/data/build/dist/host/terminal/controller-factory.d.ts +4 -0
  174. package/data/build/dist/host/terminal/controller-factory.js +26 -7
  175. package/data/build/dist/host/terminal/runtime-manager.d.ts +2 -1
  176. package/data/build/dist/host/terminal/runtime-manager.js +3 -0
  177. package/data/build/dist/host/terminal/startup.d.ts +2 -0
  178. package/data/build/dist/host/terminal/startup.js +2 -1
  179. package/data/build/dist/host/terminal/terminal-controller.d.ts +10 -3
  180. package/data/build/dist/host/terminal/terminal-controller.js +101 -15
  181. package/data/build/dist/host/terminal/terminal-process-service.js +3 -1
  182. package/data/build/dist/host/terminal/terminal-service.d.ts +2 -0
  183. package/data/build/dist/host/terminal/terminal-service.js +10 -0
  184. package/data/build/dist/index.d.ts +6 -2
  185. package/data/build/dist/index.js +8 -2
  186. package/data/build/dist/shared/contracts/cli-adapter.d.ts +14 -0
  187. package/data/build/dist/shared/contracts/config.d.ts +31 -1
  188. package/data/build/dist/shared/contracts/config.js +25 -0
  189. package/data/build/dist/shared/contracts/dsh-device.d.ts +13 -1
  190. package/data/build/dist/shared/contracts/errors.d.ts +1 -1
  191. package/data/build/dist/shared/contracts/feature.d.ts +6 -0
  192. package/data/build/dist/shared/contracts/git.d.ts +82 -0
  193. package/data/build/dist/shared/contracts/git.js +3 -0
  194. package/data/build/dist/shared/contracts/subscription.d.ts +46 -0
  195. package/data/build/dist/shared/contracts/terminal.d.ts +4 -1
  196. package/data/build/dist/shared/contracts/version.d.ts +2 -2
  197. package/data/build/dist/shared/contracts/version.js +4 -6
  198. package/data/build/dist/shared/debug.d.ts +14 -0
  199. package/data/build/dist/shared/debug.js +53 -0
  200. package/data/build/dist/shared/index.d.ts +7 -4
  201. package/data/build/dist/shared/index.js +2 -1
  202. package/data/build/dist/transport/debug.d.ts +1 -1
  203. package/data/build/dist/transport/debug.js +3 -30
  204. package/data/build/dist/transport/dsh-session.js +3 -3
  205. package/data/build/dist/typert.host.d.ts +1 -1
  206. package/data/build/dist/typert.host.js +6 -3
  207. package/data/build/dist/typert.remote-client.d.ts +11 -0
  208. package/data/build/dist/typert.remote-client.js +7 -0
  209. package/dsh.bundle.patch +1 -1
  210. package/package.json +13 -5
  211. package/profile/README.md +4 -4
  212. package/profile/package.json +6 -4
  213. package/profile/scripts/check-dsh-install.mjs +2 -2
  214. package/profile/version.json +2 -2
  215. package/scripts/check-dsh-install.mjs +2 -2
  216. package/version.json +2 -2
@@ -36,6 +36,8 @@ export interface CodingNsCliSessionConfig {
36
36
  readonly adapterId: CodingNsCliAdapterId;
37
37
  readonly modelId?: string;
38
38
  readonly effortId?: string;
39
+ /** DSH 原生模型提供商,例如 deepseek-official、glor;不包含凭据。 */
40
+ readonly providerId?: string;
39
41
  /** 外部运行时会话标识,只保存在 Host 会话表中。 */
40
42
  readonly providerSessionId?: string;
41
43
  readonly rawStoreRef?: string;
@@ -77,6 +79,8 @@ export interface CodingNsCliTurnInput {
77
79
  readonly signal?: AbortSignal;
78
80
  readonly providerSessionId?: string;
79
81
  readonly rawStoreRef?: string;
82
+ /** 仅由 Host 的 DSH 分段桥接使用;让支持的 Provider 在工具完成处结束当前 step。 */
83
+ readonly splitToolSteps?: boolean;
80
84
  }
81
85
  export interface CodingNsAgentPermissionResponse {
82
86
  readonly requestId: string;
@@ -146,15 +150,25 @@ export interface CodingNsAgentToolEvent {
146
150
  export type CodingNsAgentEvent = {
147
151
  readonly type: 'reasoning-delta';
148
152
  readonly text: string;
153
+ readonly messageId?: string;
149
154
  } | {
150
155
  readonly type: 'reasoning-snapshot';
151
156
  readonly text: string;
152
157
  } | {
153
158
  readonly type: 'text-delta';
154
159
  readonly text: string;
160
+ readonly messageId?: string;
155
161
  } | {
156
162
  readonly type: 'text-snapshot';
157
163
  readonly text: string;
164
+ } | {
165
+ /** Provider 在同一回合中切换 assistant item 时的内容块边界。 */
166
+ readonly type: 'message-boundary';
167
+ readonly channel: 'reasoning' | 'text';
168
+ readonly messageId: string;
169
+ } | {
170
+ /** Provider 已完成一个外部工具,Host 应在当前流结束后注入下一个 DSH step。 */
171
+ readonly type: 'step-boundary';
158
172
  } | CodingNsAgentToolEvent | {
159
173
  readonly type: 'usage';
160
174
  /** Command Code 的 inputTokens 是包含缓存读写的完整输入。 */
@@ -30,6 +30,12 @@ export interface CodingNsSettings {
30
30
  /** 适配器级最近选择;新建会话时作为默认模型和思考强度。 */
31
31
  agentAdapterPreferences?: Record<string, CodingNsCliAdapterPreference>;
32
32
  }
33
+ /** 0.1.7 ConfigForm 面向用户的持久化配置;Host-only 会话索引不在其中。 */
34
+ export type CodingNsConfig = Omit<CodingNsSettings, 'cliSessions'>;
35
+ /** Host 运行时状态,与可编辑配置分离,避免泄露到 Client 配置表单。 */
36
+ export interface CodingNsRuntimeState {
37
+ readonly cliSessions: CodingNsCliSessionRecord[];
38
+ }
33
39
  /** 跨平台终端 profile;`system` 由 Host 根据平台和已安装 shell 解析。 */
34
40
  export type TerminalProfileId = 'system' | 'zsh' | 'bash' | 'powershell' | 'cmd' | 'git-bash';
35
41
  /** 终端持久记录的归属范围;工作区模式允许不同 DSH 会话共享终端。 */
@@ -60,9 +66,26 @@ export interface WorkspaceSessionEnhancementSettings {
60
66
  showAdapterLogo: boolean;
61
67
  /** 是否在每个有归档会话的工作区中显示归档入口。 */
62
68
  showArchivedSessions: boolean;
69
+ /** 是否在工作区菜单提供隐藏与恢复工作区入口。 */
70
+ showWorkspaceHiding: boolean;
71
+ /** 插件本地隐藏的工作区 ID;不改变 DSH 原生工作区数据。 */
72
+ hiddenWorkspaceIds: string[];
63
73
  /** 是否在对话底部显示订阅与上游用量检测。 */
64
74
  showSubscriptionUsage: boolean;
75
+ /** 是否在输入工具区显示快捷会话入口。 */
76
+ showQuickPhrases: boolean;
77
+ /** 插件本地保存的快捷会话条目。 */
78
+ quickPhrases: QuickPhrase[];
79
+ /** 内置快捷会话是否已经完成首次初始化;仅用于兼容旧配置。 */
80
+ quickPhrasesSeeded: boolean;
81
+ }
82
+ /** 可复用的快捷会话文本。 */
83
+ export interface QuickPhrase {
84
+ id: string;
85
+ text: string;
65
86
  }
87
+ /** 首次启用快捷会话时提供的内置指令。 */
88
+ export declare const DEFAULT_QUICK_PHRASES: QuickPhrase[];
66
89
  /** 局域网访问 DSH 的持久化配置;dshPort 为 0 表示启动时自动探测。 */
67
90
  export interface LanAccessDshSettings {
68
91
  autoStart: boolean;
@@ -73,7 +96,7 @@ export interface LanAccessDshSettings {
73
96
  export interface LoginProtectionScopes {
74
97
  /** 局域网网卡入口。 */
75
98
  lan: boolean;
76
- /** DSH-Codingns4DSH 中继入口。 */
99
+ /** Codingns4DSH 中继入口。 */
77
100
  relay: boolean;
78
101
  }
79
102
  /** 登录保护的公开设置;密码哈希仅保存在 Host 私有凭据文件中。 */
@@ -85,6 +108,9 @@ export interface LanAccessDshLoginSettings {
85
108
  scopes: LoginProtectionScopes;
86
109
  }
87
110
  export declare const CODINGNS_SETTINGS_NAMESPACE = "codingns";
111
+ /** DSH 配置表单可能使用的插件 entry id;scoped 包名是当前 Bundle 的正式 ID。 */
112
+ export declare const CODINGNS_SETTINGS_ENTRY_IDS: readonly ["@jingyi0605/codingns4dsh", "codingns4dsh", "codingns"];
113
+ export declare function isCodingNsSettingsEntryId(value: unknown): value is typeof CODINGNS_SETTINGS_ENTRY_IDS[number];
88
114
  export declare const CODINGNS_CONTROL_BASE_URL_FIELD = "controlBaseUrl";
89
115
  export declare const CODINGNS_CONTROL_BASE_URLS_FIELD = "controlBaseUrls";
90
116
  export declare const CODINGNS_MODULES_FIELD = "modules";
@@ -93,6 +119,10 @@ export declare const CODINGNS_TERMINAL_ENHANCEMENT_FIELD = "terminalEnhancement"
93
119
  export declare const CODINGNS_WORKSPACE_SESSION_ENHANCEMENT_FIELD = "workspaceSessionEnhancement";
94
120
  export declare const DEFAULT_CODINGNS_CONTROL_BASE_URL = "https://channel.codingns.com:1443";
95
121
  export declare const DEFAULT_CODINGNS_CONTROL_BASE_URLS: string[];
122
+ /** 控制站的网页登录地址,用于注册 Codingns4DSH 账号。 */
123
+ export declare const CODINGNS_CONTROL_STATION_URL = "https://channel.codingns.com:1443";
124
+ /** 独立 H5 登录页面地址;登录控制站后可从设置页复制给其他设备。 */
125
+ export declare const CODINGNS_H5_LOGIN_URL = "https://dsh.codingns.com";
96
126
  export declare const DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS: TerminalEnhancementSettings;
97
127
  export declare const DEFAULT_WORKSPACE_SESSION_ENHANCEMENT_SETTINGS: WorkspaceSessionEnhancementSettings;
98
128
  export declare const DEFAULT_CODINGNS_SETTINGS: CodingNsSettings;
@@ -1,5 +1,21 @@
1
1
  import { isDshVersionAtLeast } from './version.js';
2
+ /** 首次启用快捷会话时提供的内置指令。 */
3
+ export const DEFAULT_QUICK_PHRASES = [
4
+ { id: 'builtin-quick-1', text: '请将本次会话变更的所有代码提交到git暂存区,然后总结一条中文的提交信息' },
5
+ { id: 'builtin-quick-2', text: '分析本项目模块的代码实现,并分析存在的问题' },
6
+ { id: 'builtin-quick-3', text: '分析当前项目中的未提交文件,按照功能模块进行分类提交,提交信息格式请参考我最近的提交记录' },
7
+ { id: 'builtin-quick-4', text: '请给出完整的开发提示词,我将在新的页面中继续开发' },
8
+ ];
2
9
  export const CODINGNS_SETTINGS_NAMESPACE = 'codingns';
10
+ /** DSH 配置表单可能使用的插件 entry id;scoped 包名是当前 Bundle 的正式 ID。 */
11
+ export const CODINGNS_SETTINGS_ENTRY_IDS = [
12
+ '@jingyi0605/codingns4dsh',
13
+ 'codingns4dsh',
14
+ CODINGNS_SETTINGS_NAMESPACE,
15
+ ];
16
+ export function isCodingNsSettingsEntryId(value) {
17
+ return typeof value === 'string' && CODINGNS_SETTINGS_ENTRY_IDS.includes(value);
18
+ }
3
19
  export const CODINGNS_CONTROL_BASE_URL_FIELD = 'controlBaseUrl';
4
20
  export const CODINGNS_CONTROL_BASE_URLS_FIELD = 'controlBaseUrls';
5
21
  export const CODINGNS_MODULES_FIELD = 'modules';
@@ -8,6 +24,10 @@ export const CODINGNS_TERMINAL_ENHANCEMENT_FIELD = 'terminalEnhancement';
8
24
  export const CODINGNS_WORKSPACE_SESSION_ENHANCEMENT_FIELD = 'workspaceSessionEnhancement';
9
25
  export const DEFAULT_CODINGNS_CONTROL_BASE_URL = 'https://channel.codingns.com:1443';
10
26
  export const DEFAULT_CODINGNS_CONTROL_BASE_URLS = [DEFAULT_CODINGNS_CONTROL_BASE_URL];
27
+ /** 控制站的网页登录地址,用于注册 Codingns4DSH 账号。 */
28
+ export const CODINGNS_CONTROL_STATION_URL = 'https://channel.codingns.com:1443';
29
+ /** 独立 H5 登录页面地址;登录控制站后可从设置页复制给其他设备。 */
30
+ export const CODINGNS_H5_LOGIN_URL = 'https://dsh.codingns.com';
11
31
  export const DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS = {
12
32
  bindingScope: 'workspace',
13
33
  defaultProfile: 'system',
@@ -27,7 +47,12 @@ export const DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS = {
27
47
  export const DEFAULT_WORKSPACE_SESSION_ENHANCEMENT_SETTINGS = {
28
48
  showAdapterLogo: true,
29
49
  showArchivedSessions: true,
50
+ showWorkspaceHiding: true,
51
+ hiddenWorkspaceIds: [],
30
52
  showSubscriptionUsage: true,
53
+ showQuickPhrases: true,
54
+ quickPhrases: DEFAULT_QUICK_PHRASES.map((phrase) => ({ ...phrase })),
55
+ quickPhrasesSeeded: true,
31
56
  };
32
57
  export const DEFAULT_CODINGNS_SETTINGS = {
33
58
  controlBaseUrl: DEFAULT_CODINGNS_CONTROL_BASE_URL,
@@ -1,11 +1,15 @@
1
1
  import type { RelayIceServer, RelaySignalingTicketResponse } from './signaling.js';
2
- /** DSH-Codingns4DSH 自己的设备记录,不与 Codingns4DSH Host binding 共用身份。 */
2
+ /** Codingns4DSH 自己的设备记录,不与 Codingns4DSH Host binding 共用身份。 */
3
3
  export interface DshDeviceSummary {
4
4
  /** DSH 独立设备身份;不能与 Codingns4DSH host bindingId 混用。 */
5
5
  dshDeviceId: string;
6
6
  /** 旧 DTO 兼容字段,服务端迁移期间可存在。 */
7
7
  deviceId?: string;
8
8
  displayName: string;
9
+ /** 当前 Host 运行的 DSH 应用版本。 */
10
+ dshVersion?: string;
11
+ /** Host 所在操作系统返回的计算机名。 */
12
+ computerName?: string;
9
13
  protocolVersion: string;
10
14
  capabilities: string[];
11
15
  dtlsFingerprint: string;
@@ -18,6 +22,8 @@ export interface DshDeviceSummary {
18
22
  }
19
23
  export interface DshDeviceRegistrationRequest {
20
24
  displayName: string;
25
+ dshVersion?: string;
26
+ computerName?: string;
21
27
  devicePublicKey: string;
22
28
  dtlsFingerprint: string;
23
29
  protocolVersion: string;
@@ -36,6 +42,10 @@ export interface DshDeviceHeartbeatResponse {
36
42
  device: DshDeviceSummary;
37
43
  credentialVersion: number;
38
44
  }
45
+ export interface DshDeviceHeartbeatRequest {
46
+ dshVersion?: string;
47
+ computerName?: string;
48
+ }
39
49
  export interface DshRelayTicketRequest {
40
50
  dshDeviceId: string;
41
51
  deviceCredential: string;
@@ -67,6 +77,8 @@ export interface DshDeviceCredentialRecord {
67
77
  dtlsFingerprint: string;
68
78
  tunnelDomain: string | null;
69
79
  displayName: string;
80
+ dshVersion?: string;
81
+ computerName?: string;
70
82
  savedAt: string;
71
83
  }
72
84
  //# sourceMappingURL=dsh-device.d.ts.map
@@ -21,7 +21,7 @@ export declare const CODINGNS_DSH_ERROR_CODES: {
21
21
  readonly DEBUG_DSH_HOST_API_UNAVAILABLE: "DEBUG_DSH_HOST_API_UNAVAILABLE";
22
22
  };
23
23
  export declare const SUPPORTED_DSH_VERSION: "0.1.6-alpha.2";
24
- export declare const SUPPORTED_DSH_COMPATIBILITY: ">=0.1.5-rc.3 <0.1.7-0";
24
+ export declare const SUPPORTED_DSH_COMPATIBILITY: ">=0.1.5-rc.3 <=0.1.7-rc.2";
25
25
  export type CodingNsDshErrorCode = typeof CODINGNS_DSH_ERROR_CODES[keyof typeof CODINGNS_DSH_ERROR_CODES];
26
26
  /** 统一错误形状;阶段 0 只定义,不主动产生这些业务错误。 */
27
27
  export declare class CodingNsDshError extends Error {
@@ -1,4 +1,6 @@
1
+ import type { DshCapabilityDiagnostic, FeatureCapabilityRequirement } from '../../dsh-capabilities/types.js';
1
2
  export type FeatureState = 'disabled' | 'enabling' | 'enabled' | 'draining' | 'failed';
3
+ export type { FeatureCapabilityRequirement };
2
4
  /** 功能模块的承载端:Host 进程、浏览器,或两端都需要。 */
3
5
  export type FeatureRuntime = 'host' | 'client' | 'both';
4
6
  /** 功能开关的生效时机;未声明时按实时生效处理。 */
@@ -40,6 +42,8 @@ export interface FeatureDescriptor {
40
42
  activation?: FeatureActivation;
41
43
  /** 模块要求的最低 DSH 版本;低于该版本时不得启动。 */
42
44
  minimumDshVersion?: string;
45
+ /** 模块依赖的宿主能力;版本差异由能力注册表负责路由。 */
46
+ requires?: readonly FeatureCapabilityRequirement[];
43
47
  /** 提供后该模块出现在设置页;缺省表示它没有界面。 */
44
48
  ui?: FeatureUiDescriptor;
45
49
  }
@@ -60,6 +64,8 @@ export interface FeatureContext<S = unknown> {
60
64
  readonly descriptor: FeatureDescriptor;
61
65
  readonly resources: FeatureResourceScope;
62
66
  readonly services: S;
67
+ /** 本次启动解析出的能力诊断,供模块记录降级原因。 */
68
+ readonly capabilityDiagnostics?: readonly DshCapabilityDiagnostic[];
63
69
  }
64
70
  /** 可由模块注册表管理的功能模块。 */
65
71
  export interface FeatureModule<S = unknown> {
@@ -0,0 +1,82 @@
1
+ /** Git 工作区面板在 Host 与 Client 之间传输的稳定契约。 */
2
+ export interface GitRepoSnapshot {
3
+ readonly workspaceId: string;
4
+ readonly repoRoot: string;
5
+ /** 当前工作区是否已经初始化为 Git 仓库;旧 Host 未提供时按 true 兼容。 */
6
+ readonly enabled?: boolean;
7
+ readonly branch: string;
8
+ readonly ahead: number;
9
+ readonly behind: number;
10
+ readonly hasRemote: boolean;
11
+ readonly isDirty: boolean;
12
+ readonly lastFetchedAt: string | null;
13
+ }
14
+ export interface GitChangeItem {
15
+ readonly path: string;
16
+ readonly status: string;
17
+ readonly staged: boolean;
18
+ readonly oldPath: string | null;
19
+ readonly binary: boolean;
20
+ readonly stagedStatus: string | null;
21
+ readonly worktreeStatus: string | null;
22
+ }
23
+ export interface GitStatus {
24
+ readonly snapshot: GitRepoSnapshot;
25
+ readonly changes: readonly GitChangeItem[];
26
+ }
27
+ export interface GitDiff {
28
+ readonly workspaceId: string;
29
+ readonly path: string;
30
+ readonly staged: boolean;
31
+ readonly binary: boolean;
32
+ readonly truncated: boolean;
33
+ readonly content: string;
34
+ }
35
+ export interface GitHistoryItem {
36
+ readonly commitHash: string;
37
+ readonly authorName: string;
38
+ readonly authoredAt: string;
39
+ readonly subject: string;
40
+ readonly body: string;
41
+ readonly refs: readonly GitHistoryRef[];
42
+ }
43
+ export interface GitHistoryRef {
44
+ readonly name: string;
45
+ readonly kind: 'head' | 'local' | 'remote';
46
+ readonly remoteName: string | null;
47
+ }
48
+ export interface GitHistoryPage {
49
+ readonly items: readonly GitHistoryItem[];
50
+ readonly cursor: string | null;
51
+ readonly nextCursor: string | null;
52
+ readonly totalCount: number;
53
+ }
54
+ export interface GitBranchItem {
55
+ readonly name: string;
56
+ readonly current: boolean;
57
+ readonly upstream: string | null;
58
+ readonly remote: boolean;
59
+ }
60
+ export interface GitBranchSnapshot {
61
+ readonly currentBranch: string;
62
+ readonly local: readonly GitBranchItem[];
63
+ readonly remote: readonly GitBranchItem[];
64
+ }
65
+ export interface GitCommitResult {
66
+ readonly commitHash: string;
67
+ readonly summary: string;
68
+ }
69
+ export interface GitCommitChangedFile {
70
+ readonly path: string;
71
+ readonly oldPath: string | null;
72
+ readonly status: string;
73
+ readonly binary: boolean;
74
+ }
75
+ export interface GitCommitDiff {
76
+ readonly commitHash: string;
77
+ /** 旧版 Host 未提供时由 Client 从 diff 头部回退解析。 */
78
+ readonly files?: readonly GitCommitChangedFile[];
79
+ readonly content: string;
80
+ readonly truncated: boolean;
81
+ }
82
+ //# sourceMappingURL=git.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Git 工作区面板在 Host 与 Client 之间传输的稳定契约。 */
2
+ export {};
3
+ //# sourceMappingURL=git.js.map
@@ -25,8 +25,54 @@ export interface CliSubscriptionUsage {
25
25
  }[];
26
26
  };
27
27
  readonly capturedAt: string;
28
+ /** 统一模型提供商摘要;同一提供商可被多个 Agent 复用。 */
29
+ readonly provider?: CliSubscriptionProvider;
28
30
  /** 第三方上游的账户余额和用量摘要;原始 API key 永不进入此结构。 */
29
31
  readonly sub2api?: Sub2ApiUsage;
32
+ /** 官方 DeepSeek API 的账户余额摘要;原始 API key 永不进入此结构。 */
33
+ readonly deepseek?: DeepseekUsage;
34
+ /** 其他官方模型提供商的账户余额/用量摘要;原始 API key 永不进入此结构。 */
35
+ readonly providerBalance?: ProviderBalanceUsage;
36
+ }
37
+ /** 订阅归属的模型提供商,不包含任何凭据。 */
38
+ export interface CliSubscriptionProvider {
39
+ readonly id: string;
40
+ readonly displayName: string;
41
+ readonly baseUrl: string;
42
+ readonly capability: 'official-balance' | 'official-usage' | 'subscription-window' | 'sub2api' | 'unsupported';
43
+ readonly logoUrl: string;
44
+ readonly logoDataUrl?: string;
45
+ }
46
+ /** 官方 DeepSeek API 返回的单个币种余额。金额单位由 currency 指定。 */
47
+ export interface DeepseekBalance {
48
+ readonly currency: string;
49
+ readonly totalBalance: number;
50
+ readonly grantedBalance: number;
51
+ readonly toppedUpBalance: number;
52
+ }
53
+ /** 官方 DeepSeek API 的安全余额摘要。 */
54
+ export interface DeepseekUsage {
55
+ readonly upstreamUrl: string;
56
+ readonly isAvailable: boolean | null;
57
+ readonly balances: readonly DeepseekBalance[];
58
+ }
59
+ /** 官方提供商账户余额或 Coding Plan 余量的统一安全摘要。 */
60
+ export interface ProviderBalanceUsage {
61
+ readonly upstreamUrl: string;
62
+ readonly currency: string | null;
63
+ readonly unit: string | null;
64
+ readonly balance: number | null;
65
+ readonly remaining: number | null;
66
+ readonly used: number | null;
67
+ readonly total: number | null;
68
+ readonly requests: number | null;
69
+ readonly inputTokens: number | null;
70
+ readonly outputTokens: number | null;
71
+ readonly planName: string | null;
72
+ readonly details: readonly {
73
+ readonly label: string;
74
+ readonly value: string | number;
75
+ }[];
30
76
  }
31
77
  export interface Sub2ApiUsagePoint {
32
78
  readonly requests: number;
@@ -61,7 +61,7 @@ export interface CodingNsTerminalShell {
61
61
  readonly args: readonly string[];
62
62
  readonly name: string;
63
63
  }
64
- /** 与 DSH 0.1.6-alpha.2 `remote.terminal` wire shape 对齐。 */
64
+ /** 与 DSH 0.1.6-alpha.2 官方终端 wire shape 对齐,但由 Codingns4DSH 独立命名空间承载。 */
65
65
  export interface CodingNsWebTerminalInfo {
66
66
  readonly id: string;
67
67
  readonly title: string;
@@ -100,6 +100,9 @@ export interface CodingNsTerminalStatus {
100
100
  readonly platform: 'darwin' | 'linux' | 'win32' | 'unsupported';
101
101
  readonly controllerMode: 'baseline' | 'enhanced';
102
102
  readonly effectiveEnabled: boolean;
103
+ /** 当前 Host 实际注册的 backend;调试启动必须以此为准。 */
104
+ readonly runtimeTypes?: readonly CodingNsTerminalRuntimeType[];
105
+ readonly runtimeWarning?: string;
103
106
  readonly profiles: readonly {
104
107
  readonly profileId: CodingNsTerminalShell['profileId'];
105
108
  readonly name: string;
@@ -3,7 +3,7 @@ export declare const DSH_VERSION: "0.1.6-alpha.2";
3
3
  /** DSH 测试版本别名,供新代码表达语义,保留 DSH_VERSION 兼容旧调用方。 */
4
4
  export declare const DSH_TESTED_VERSION: "0.1.6-alpha.2";
5
5
  /** 插件支持的 DSH 版本范围;插件版本与宿主版本独立发布。 */
6
- export declare const DSH_COMPATIBILITY: ">=0.1.5-rc.3 <0.1.7-0";
6
+ export declare const DSH_COMPATIBILITY: ">=0.1.5-rc.3 <=0.1.7-rc.2";
7
7
  /** DSH Envelope/Tunnel 协议主版本。 */
8
8
  export declare const DSH_PROTOCOL_VERSION: 1;
9
9
  /** Host 注入到浏览器页面的真实 DSH 版本全局字段。 */
@@ -11,7 +11,7 @@ export declare const CODINGNS_DSH_VERSION_GLOBAL: "__CODINGNS_DSH_VERSION__";
11
11
  /** 识别没有 alpha2 Sidebar 扩展 API 的 DSH 旧版运行时。 */
12
12
  export declare function isLegacyDshVersion(version: string): boolean;
13
13
  /** Codingns4DSH 插件自身的 npm 版本。 */
14
- export declare const CODINGNS_VERSION: "0.1.0";
14
+ export declare const CODINGNS_VERSION: "0.1.1";
15
15
  /** 判断宿主版本是否落在当前插件声明的 DSH 兼容范围内。 */
16
16
  export declare function isDshVersionCompatible(version: string): boolean;
17
17
  /** 判断 DSH 版本是否达到某个功能模块要求的最低版本。 */
@@ -3,7 +3,7 @@ export const DSH_VERSION = '0.1.6-alpha.2';
3
3
  /** DSH 测试版本别名,供新代码表达语义,保留 DSH_VERSION 兼容旧调用方。 */
4
4
  export const DSH_TESTED_VERSION = DSH_VERSION;
5
5
  /** 插件支持的 DSH 版本范围;插件版本与宿主版本独立发布。 */
6
- export const DSH_COMPATIBILITY = '>=0.1.5-rc.3 <0.1.7-0';
6
+ export const DSH_COMPATIBILITY = '>=0.1.5-rc.3 <=0.1.7-rc.2';
7
7
  /** DSH Envelope/Tunnel 协议主版本。 */
8
8
  export const DSH_PROTOCOL_VERSION = 1;
9
9
  /** Host 注入到浏览器页面的真实 DSH 版本全局字段。 */
@@ -13,18 +13,16 @@ export function isLegacyDshVersion(version) {
13
13
  return /^0\.1\.5(?:-|$)/u.test(version);
14
14
  }
15
15
  /** Codingns4DSH 插件自身的 npm 版本。 */
16
- export const CODINGNS_VERSION = '0.1.0';
16
+ export const CODINGNS_VERSION = '0.1.1';
17
17
  /** 判断宿主版本是否落在当前插件声明的 DSH 兼容范围内。 */
18
18
  export function isDshVersionCompatible(version) {
19
- const match = /^>=([^ ]+) <([^ ]+)$/u.exec(DSH_COMPATIBILITY);
19
+ const match = /^>=([^ ]+) <=([^ ]+)$/u.exec(DSH_COMPATIBILITY);
20
20
  const actual = parseVersion(version);
21
21
  const minimum = parseVersion(match?.[1] ?? '');
22
22
  const maximum = parseVersion(match?.[2] ?? '');
23
23
  if (!actual || !minimum || !maximum)
24
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;
25
+ return compareVersions(actual, minimum) >= 0 && compareVersions(actual, maximum) <= 0;
28
26
  }
29
27
  /** 判断 DSH 版本是否达到某个功能模块要求的最低版本。 */
30
28
  export function isDshVersionAtLeast(version, minimum) {
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Codingns4DSH 调试日志开关。
3
+ *
4
+ * 调试输出默认关闭。需要查看启动或 RPC 追踪时,使用
5
+ * `CODINGNS4DSH_DEBUG=1 dsh ...` 启动 DSH;浏览器侧同时支持 `?dshDebug=1`。
6
+ */
7
+ export declare const CODINGNS4DSH_DEBUG_ENV = "CODINGNS4DSH_DEBUG";
8
+ /** 当前运行环境是否明确要求输出调试日志。 */
9
+ export declare function resolveCodingNsDebugEnabled(): boolean;
10
+ /** 输出受统一开关控制的调试信息。 */
11
+ export declare function debugInfo(message: unknown, ...args: unknown[]): void;
12
+ /** 输出受统一开关控制的调试警告。 */
13
+ export declare function debugWarn(message: unknown, ...args: unknown[]): void;
14
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Codingns4DSH 调试日志开关。
3
+ *
4
+ * 调试输出默认关闭。需要查看启动或 RPC 追踪时,使用
5
+ * `CODINGNS4DSH_DEBUG=1 dsh ...` 启动 DSH;浏览器侧同时支持 `?dshDebug=1`。
6
+ */
7
+ export const CODINGNS4DSH_DEBUG_ENV = 'CODINGNS4DSH_DEBUG';
8
+ const LEGACY_DEBUG_ENV = 'CODINGNS4DSH_TUNNEL_DEBUG';
9
+ /** 当前运行环境是否明确要求输出调试日志。 */
10
+ export function resolveCodingNsDebugEnabled() {
11
+ const globals = globalThis;
12
+ const globalValue = globals.__CODINGNS4DSH_DEBUG_ENABLED__ ?? globals.__CODINGNS4DSH_TUNNEL_DEBUG__;
13
+ if (globalValue !== undefined)
14
+ return parseDebugValue(globalValue);
15
+ if (typeof location !== 'undefined') {
16
+ const queryValue = new URL(location.href).searchParams.get('dshDebug');
17
+ if (queryValue !== null)
18
+ return parseDebugValue(queryValue);
19
+ }
20
+ if (typeof localStorage !== 'undefined') {
21
+ try {
22
+ const stored = localStorage.getItem('codingns4dsh-debug')
23
+ ?? localStorage.getItem('codingns4dsh-tunnel-debug');
24
+ if (stored !== null)
25
+ return parseDebugValue(stored);
26
+ }
27
+ catch {
28
+ // 隐私模式或受限 iframe 可能禁止读取 localStorage,继续检查进程环境变量。
29
+ }
30
+ }
31
+ if (typeof process !== 'undefined') {
32
+ return parseDebugValue(process.env[CODINGNS4DSH_DEBUG_ENV] ?? process.env[LEGACY_DEBUG_ENV]);
33
+ }
34
+ return false;
35
+ }
36
+ /** 输出受统一开关控制的调试信息。 */
37
+ export function debugInfo(message, ...args) {
38
+ if (resolveCodingNsDebugEnabled())
39
+ console.info(message, ...args);
40
+ }
41
+ /** 输出受统一开关控制的调试警告。 */
42
+ export function debugWarn(message, ...args) {
43
+ if (resolveCodingNsDebugEnabled())
44
+ console.warn(message, ...args);
45
+ }
46
+ function parseDebugValue(value) {
47
+ if (typeof value === 'boolean')
48
+ return value;
49
+ if (typeof value !== 'string')
50
+ return false;
51
+ return /^(1|true|yes|on)$/iu.test(value.trim());
52
+ }
53
+ //# sourceMappingURL=debug.js.map
@@ -1,5 +1,6 @@
1
- export { CODINGNS_CONTROL_BASE_URL_FIELD, CODINGNS_CONTROL_BASE_URLS_FIELD, CODINGNS_LAN_ACCESS_DSH_FIELD, CODINGNS_TERMINAL_ENHANCEMENT_FIELD, CODINGNS_WORKSPACE_SESSION_ENHANCEMENT_FIELD, CODINGNS_MODULES_FIELD, CODINGNS_SETTINGS_NAMESPACE, DEFAULT_CODINGNS_CONTROL_BASE_URL, DEFAULT_CODINGNS_CONTROL_BASE_URLS, DEFAULT_CODINGNS_SETTINGS, DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS, DEFAULT_WORKSPACE_SESSION_ENHANCEMENT_SETTINGS, captureRestartFeatureStates, enabledFeatureNames, isFeatureDshVersionCompatible, isFeatureEnabled, type CodingNsSettings, type CodingNsCliAdapterPreference, type LanAccessDshSettings, type LanAccessDshLoginSettings, type LoginProtectionScopes, type RestartFeatureStates, type TerminalAppearanceSettings, type TerminalAppearanceTheme, type TerminalBindingScope, type TerminalCursorStyle, type TerminalEnhancementSettings, type TerminalProfileId, type WorkspaceSessionEnhancementSettings, } from './contracts/config.js';
2
- export type { FeatureContext, FeatureActivation, FeatureDescriptor, FeatureDisposer, FeatureModule, FeatureResourceScope, FeatureRuntime, FeatureState, FeatureUiDescriptor, } from './contracts/feature.js';
1
+ export { CODINGNS_CONTROL_BASE_URL_FIELD, CODINGNS_CONTROL_BASE_URLS_FIELD, CODINGNS_CONTROL_STATION_URL, CODINGNS_H5_LOGIN_URL, CODINGNS_LAN_ACCESS_DSH_FIELD, CODINGNS_TERMINAL_ENHANCEMENT_FIELD, CODINGNS_WORKSPACE_SESSION_ENHANCEMENT_FIELD, CODINGNS_MODULES_FIELD, CODINGNS_SETTINGS_NAMESPACE, CODINGNS_SETTINGS_ENTRY_IDS, DEFAULT_CODINGNS_CONTROL_BASE_URL, DEFAULT_CODINGNS_CONTROL_BASE_URLS, DEFAULT_CODINGNS_SETTINGS, DEFAULT_QUICK_PHRASES, DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS, DEFAULT_WORKSPACE_SESSION_ENHANCEMENT_SETTINGS, captureRestartFeatureStates, enabledFeatureNames, isFeatureDshVersionCompatible, isFeatureEnabled, isCodingNsSettingsEntryId, type CodingNsSettings, type CodingNsConfig, type CodingNsRuntimeState, type CodingNsCliAdapterPreference, type LanAccessDshSettings, type LanAccessDshLoginSettings, type LoginProtectionScopes, type RestartFeatureStates, type TerminalAppearanceSettings, type TerminalAppearanceTheme, type TerminalBindingScope, type TerminalCursorStyle, type TerminalEnhancementSettings, type TerminalProfileId, type QuickPhrase, type WorkspaceSessionEnhancementSettings, } from './contracts/config.js';
2
+ export type { FeatureContext, FeatureActivation, FeatureDescriptor, FeatureCapabilityRequirement, FeatureDisposer, FeatureModule, FeatureResourceScope, FeatureRuntime, FeatureState, FeatureUiDescriptor, } from './contracts/feature.js';
3
+ export type { DshCapabilityDiagnostic, DshCapabilityId, DshCapabilityProfile, DshCapabilityResolution, DshCapabilityResolutionStatus, DshCapabilityRoute, DshCapabilityRouteStatus, DshCapabilityRuntime, } from '../dsh-capabilities/types.js';
3
4
  export { CODINGNS_DSH_ERROR_CODES, CodingNsDshError, SUPPORTED_DSH_COMPATIBILITY, SUPPORTED_DSH_VERSION, assertSupportedDshVersion, type CodingNsDshErrorCode, } from './contracts/errors.js';
4
5
  export { CODINGNS_VERSION, DSH_COMPATIBILITY, DSH_PROTOCOL_VERSION, CODINGNS_DSH_VERSION_GLOBAL, DSH_TESTED_VERSION, DSH_VERSION, isDshVersionAtLeast, isLegacyDshVersion, isDshVersionCompatible, } from './contracts/version.js';
5
6
  export type { CodingNsRpcRequest, CodingNsStreamRequest, CodingNsTransport, CodingNsTransportErrorShape, CodingNsTransportGeneration, CodingNsTransportHooks, } from './contracts/transport.js';
@@ -7,16 +8,18 @@ export { DSH_ENVELOPE_PROTOCOL, DSH_ENVELOPE_VERSION, DEFAULT_MAX_DSH_ENVELOPE_B
7
8
  export { CODINGNS_RPC_CHANNEL } from './contracts/transport.js';
8
9
  export type { CodingNsCliAdapterDescriptor, CodingNsCliAdapterId, CodingNsCliCapability, CodingNsAgentEvent, CodingNsAgentQuestion, CodingNsAgentQuestionResponse, CodingNsAgentToolEvent, CodingNsCliMessage, CodingNsCliModel, CodingNsCliModelCatalog, CodingNsCliModelGroup, CodingNsAgentPermissionResponse, CodingNsCliSessionConfig, CodingNsCliSessionRecord, CodingNsCliProviderSessionState, CodingNsCliSessionStatus, CodingNsSessionAdapterBinding, CodingNsCliTurnInput, } from './contracts/cli-adapter.js';
9
10
  export type { CommandCodeSubscriptionUsage, CommandCodeSubscriptionWindow, } from './contracts/command-code.js';
10
- export type { CliSubscriptionUsage, CliSubscriptionWindow, Sub2ApiDailyUsage, Sub2ApiModelUsage, Sub2ApiUsage, Sub2ApiUsagePoint, } from './contracts/subscription.js';
11
+ export type { GitBranchItem, GitBranchSnapshot, GitChangeItem, GitCommitResult, GitDiff, GitHistoryItem, GitHistoryPage, GitHistoryRef, GitRepoSnapshot, GitStatus, } from './contracts/git.js';
12
+ export type { CliSubscriptionProvider, CliSubscriptionUsage, CliSubscriptionWindow, DeepseekBalance, DeepseekUsage, ProviderBalanceUsage, Sub2ApiDailyUsage, Sub2ApiModelUsage, Sub2ApiUsage, Sub2ApiUsagePoint, } from './contracts/subscription.js';
11
13
  export type { PeerHostRecord, PeerHostStatus, ResourceScopeDisposer, ResourceScopeInput, ResourceScopeRef, ResourceScopeSnapshot, } from './contracts/peer-host.js';
12
14
  export { ResourceScopeStaleError } from './contracts/peer-host.js';
13
15
  export { DEBUG_ERROR_CODES, DEBUG_RPC_ENDPOINTS, parseDebugMutationScope, parseDebugPtyLaunchRequest, parseDebugRpcScope, type DebugAiFallbackState, type DebugCompatibilityLevel, type DebugErrorCode, type DebugMutationScope, type DebugPortState, type DebugProcessInstance, type DebugProcessOwnership, type DebugPlanState, type DebugProxyProtocol, type DebugPtyLaunchRequest, type DebugRpcEndpoint, type DebugRpcScope, type DebugRuntimeMode, type DebugRuntimeState, } from './contracts/debug.js';
14
16
  export type { LanAccessDshConfig, LanAccessDshLoginConfig, LanAccessDshSnapshot, LanAccessDshState, } from './contracts/lan-access-dsh.js';
15
17
  export type { CodingNsTerminalCreateRequest, CodingNsTerminalEnvironment, CodingNsTerminalFrame, CodingNsTerminalRetentionFrame, CodingNsTerminalRuntimeType, CodingNsTerminalShell, CodingNsTerminalShellOption, CodingNsTerminalStatus, CodingNsTerminalState, CodingNsWebTerminalInfo, PersistentTerminalRecord, TerminalAttachmentRecord, TerminalOwnerScope, TerminalRecordIdentity, } from './contracts/terminal.js';
16
18
  export { EMPTY_DEBUG_CONFIG, parseDebugConfig, type DebugConfig, type DebugProfile, type DebugProxyConfig, type DebugRuntimeType, type DebugShell, } from './contracts/debug-config.js';
17
- export type { DshDeviceSummary, DshDeviceRegistrationRequest, DshDeviceRegistrationResponse, DshDeviceListResponse, DshDeviceHeartbeatResponse, DshRelayTicketRequest, DshRelayTicketResponse, DshRelayTicketLike, DshIceServer, DshDeviceCredentialRecord, } from './contracts/dsh-device.js';
19
+ export type { DshDeviceSummary, DshDeviceRegistrationRequest, DshDeviceRegistrationResponse, DshDeviceListResponse, DshDeviceHeartbeatResponse, DshDeviceHeartbeatRequest, DshRelayTicketRequest, DshRelayTicketResponse, DshRelayTicketLike, DshIceServer, DshDeviceCredentialRecord, } from './contracts/dsh-device.js';
18
20
  export type { TerminalLaunchProfile, TerminalProcessInstance, TerminalProcessLaunchRequest, TerminalProcessLaunchResult, TerminalProcessState, } from './contracts/terminal-process.js';
19
21
  export type { AccountProfile, AuthClientType, AuthDeviceManagementSnapshotDto, AuthDeviceViewDto, CodingNsAuthLoginResult, CodingNsAuthSessionSnapshot, CodingNsAuthStatus, HostBindRequest, HostBindResponse, HostBindingsResponse, HostLabelAvailabilityResponse, HostUnbindResponse, LoginByEmailRequest, TunnelBindingSummary, } from './contracts/auth.js';
20
22
  export type { RelayIceServer, RelaySignalingTicketRequest, RelaySignalingClientMessage, RelaySignalingServerMessage, RelaySignalingTicketResponse, } from './contracts/signaling.js';
21
23
  export type { DshHostStatus } from './contracts/host-status.js';
24
+ export { CODINGNS4DSH_DEBUG_ENV, debugInfo, debugWarn, resolveCodingNsDebugEnabled, } from './debug.js';
22
25
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- export { CODINGNS_CONTROL_BASE_URL_FIELD, CODINGNS_CONTROL_BASE_URLS_FIELD, CODINGNS_LAN_ACCESS_DSH_FIELD, CODINGNS_TERMINAL_ENHANCEMENT_FIELD, CODINGNS_WORKSPACE_SESSION_ENHANCEMENT_FIELD, CODINGNS_MODULES_FIELD, CODINGNS_SETTINGS_NAMESPACE, DEFAULT_CODINGNS_CONTROL_BASE_URL, DEFAULT_CODINGNS_CONTROL_BASE_URLS, DEFAULT_CODINGNS_SETTINGS, DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS, DEFAULT_WORKSPACE_SESSION_ENHANCEMENT_SETTINGS, captureRestartFeatureStates, enabledFeatureNames, isFeatureDshVersionCompatible, isFeatureEnabled, } from './contracts/config.js';
1
+ export { CODINGNS_CONTROL_BASE_URL_FIELD, CODINGNS_CONTROL_BASE_URLS_FIELD, CODINGNS_CONTROL_STATION_URL, CODINGNS_H5_LOGIN_URL, CODINGNS_LAN_ACCESS_DSH_FIELD, CODINGNS_TERMINAL_ENHANCEMENT_FIELD, CODINGNS_WORKSPACE_SESSION_ENHANCEMENT_FIELD, CODINGNS_MODULES_FIELD, CODINGNS_SETTINGS_NAMESPACE, CODINGNS_SETTINGS_ENTRY_IDS, DEFAULT_CODINGNS_CONTROL_BASE_URL, DEFAULT_CODINGNS_CONTROL_BASE_URLS, DEFAULT_CODINGNS_SETTINGS, DEFAULT_QUICK_PHRASES, DEFAULT_TERMINAL_ENHANCEMENT_SETTINGS, DEFAULT_WORKSPACE_SESSION_ENHANCEMENT_SETTINGS, captureRestartFeatureStates, enabledFeatureNames, isFeatureDshVersionCompatible, isFeatureEnabled, isCodingNsSettingsEntryId, } from './contracts/config.js';
2
2
  export { CODINGNS_DSH_ERROR_CODES, CodingNsDshError, SUPPORTED_DSH_COMPATIBILITY, SUPPORTED_DSH_VERSION, assertSupportedDshVersion, } from './contracts/errors.js';
3
3
  export { CODINGNS_VERSION, DSH_COMPATIBILITY, DSH_PROTOCOL_VERSION, CODINGNS_DSH_VERSION_GLOBAL, DSH_TESTED_VERSION, DSH_VERSION, isDshVersionAtLeast, isLegacyDshVersion, isDshVersionCompatible, } from './contracts/version.js';
4
4
  export { DSH_ENVELOPE_PROTOCOL, DSH_ENVELOPE_VERSION, DEFAULT_MAX_DSH_ENVELOPE_BYTES, DEFAULT_MAX_DSH_META_BYTES, decodeDshEnvelope, encodeDshEnvelope, validateDshEnvelope, } from '../transport/dsh-envelope.js';
@@ -6,4 +6,5 @@ export { CODINGNS_RPC_CHANNEL } from './contracts/transport.js';
6
6
  export { ResourceScopeStaleError } from './contracts/peer-host.js';
7
7
  export { DEBUG_ERROR_CODES, DEBUG_RPC_ENDPOINTS, parseDebugMutationScope, parseDebugPtyLaunchRequest, parseDebugRpcScope, } from './contracts/debug.js';
8
8
  export { EMPTY_DEBUG_CONFIG, parseDebugConfig, } from './contracts/debug-config.js';
9
+ export { CODINGNS4DSH_DEBUG_ENV, debugInfo, debugWarn, resolveCodingNsDebugEnabled, } from './debug.js';
9
10
  //# sourceMappingURL=index.js.map
@@ -17,6 +17,6 @@ export interface DshTransportDebugOptions {
17
17
  }
18
18
  /** 创建一个可注入测试 sink 的调试 logger。默认开关由当前运行环境决定。 */
19
19
  export declare function createDshTransportDebugLogger(options?: DshTransportDebugOptions): DshTransportDebugLogger;
20
- /** 解析 Host 环境变量、H5 URL/localStorage 和调试全局变量。 */
20
+ /** 解析统一的 Codingns4DSH 调试开关,保留旧隧道变量作为兼容别名。 */
21
21
  export declare function resolveDshTransportDebugEnabled(): boolean;
22
22
  //# sourceMappingURL=debug.d.ts.map
@@ -1,4 +1,4 @@
1
- const DEBUG_ENV = 'CODINGNS4DSH_TUNNEL_DEBUG';
1
+ import { resolveCodingNsDebugEnabled } from '../shared/debug.js';
2
2
  /** 创建一个可注入测试 sink 的调试 logger。默认开关由当前运行环境决定。 */
3
3
  export function createDshTransportDebugLogger(options = {}) {
4
4
  const enabled = options.enabled ?? resolveDshTransportDebugEnabled();
@@ -23,35 +23,8 @@ export function createDshTransportDebugLogger(options = {}) {
23
23
  },
24
24
  };
25
25
  }
26
- /** 解析 Host 环境变量、H5 URL/localStorage 和调试全局变量。 */
26
+ /** 解析统一的 Codingns4DSH 调试开关,保留旧隧道变量作为兼容别名。 */
27
27
  export function resolveDshTransportDebugEnabled() {
28
- const globalValue = globalThis.__CODINGNS4DSH_TUNNEL_DEBUG__;
29
- if (globalValue !== undefined)
30
- return parseDebugValue(globalValue);
31
- if (typeof location !== 'undefined') {
32
- const queryValue = new URL(location.href).searchParams.get('dshDebug');
33
- if (queryValue !== null)
34
- return parseDebugValue(queryValue);
35
- }
36
- if (typeof localStorage !== 'undefined') {
37
- try {
38
- const stored = localStorage.getItem('codingns4dsh-tunnel-debug');
39
- if (stored !== null)
40
- return parseDebugValue(stored);
41
- }
42
- catch {
43
- // 隐私模式或受限 iframe 可能禁止读取 localStorage,继续检查其他来源。
44
- }
45
- }
46
- if (typeof process !== 'undefined')
47
- return parseDebugValue(process.env[DEBUG_ENV]);
48
- return false;
49
- }
50
- function parseDebugValue(value) {
51
- if (typeof value === 'boolean')
52
- return value;
53
- if (typeof value !== 'string')
54
- return false;
55
- return /^(1|true|yes|on)$/iu.test(value.trim());
28
+ return resolveCodingNsDebugEnabled();
56
29
  }
57
30
  //# sourceMappingURL=debug.js.map