@jingyi0605/codingns4dsh 0.2.0-rc.3 → 0.2.1-beta.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 (377) hide show
  1. package/README.en.md +6 -6
  2. package/README.md +42 -29
  3. package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
  4. package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts.map +1 -1
  5. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js +2 -2
  6. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js.map +1 -1
  7. package/data/build/dist/bootstrap/index.d.ts +1 -1
  8. package/data/build/dist/bootstrap/index.d.ts.map +1 -1
  9. package/data/build/dist/client/bundle.js +3164 -181
  10. package/data/build/dist/client/bundle.js.map +1 -1
  11. package/data/build/dist/client/cli-catalog.d.ts +1 -1
  12. package/data/build/dist/client/cli-catalog.d.ts.map +1 -1
  13. package/data/build/dist/client/cli-catalog.js +3 -3
  14. package/data/build/dist/client/cli-catalog.js.map +1 -1
  15. package/data/build/dist/client/cli-slots.d.ts +4 -0
  16. package/data/build/dist/client/cli-slots.d.ts.map +1 -1
  17. package/data/build/dist/client/cli-slots.js +70 -9
  18. package/data/build/dist/client/cli-slots.js.map +1 -1
  19. package/data/build/dist/client/context-breakdown-dom.d.ts +1 -1
  20. package/data/build/dist/client/context-breakdown-dom.d.ts.map +1 -1
  21. package/data/build/dist/client/context-breakdown-dom.js +1 -1
  22. package/data/build/dist/client/context-breakdown-dom.js.map +1 -1
  23. package/data/build/dist/client/features/assistant-panel.d.ts +5 -0
  24. package/data/build/dist/client/features/assistant-panel.d.ts.map +1 -0
  25. package/data/build/dist/client/features/assistant-panel.js +127 -0
  26. package/data/build/dist/client/features/assistant-panel.js.map +1 -0
  27. package/data/build/dist/client/features/global-voice-assistant.d.ts +10 -0
  28. package/data/build/dist/client/features/global-voice-assistant.d.ts.map +1 -0
  29. package/data/build/dist/client/features/global-voice-assistant.js +330 -0
  30. package/data/build/dist/client/features/global-voice-assistant.js.map +1 -0
  31. package/data/build/dist/client/features/index.d.ts +2 -0
  32. package/data/build/dist/client/features/index.d.ts.map +1 -1
  33. package/data/build/dist/client/features/index.js +4 -0
  34. package/data/build/dist/client/features/index.js.map +1 -1
  35. package/data/build/dist/client/features/lan-access.d.ts.map +1 -1
  36. package/data/build/dist/client/features/lan-access.js +3 -1
  37. package/data/build/dist/client/features/lan-access.js.map +1 -1
  38. package/data/build/dist/client/features/types.d.ts +4 -1
  39. package/data/build/dist/client/features/types.d.ts.map +1 -1
  40. package/data/build/dist/client/features/voice-conversation-dialog.d.ts +20 -0
  41. package/data/build/dist/client/features/voice-conversation-dialog.d.ts.map +1 -0
  42. package/data/build/dist/client/features/voice-conversation-dialog.js +59 -0
  43. package/data/build/dist/client/features/voice-conversation-dialog.js.map +1 -0
  44. package/data/build/dist/client/features/voice-initialization-dialog.d.ts +10 -0
  45. package/data/build/dist/client/features/voice-initialization-dialog.d.ts.map +1 -0
  46. package/data/build/dist/client/features/voice-initialization-dialog.js +90 -0
  47. package/data/build/dist/client/features/voice-initialization-dialog.js.map +1 -0
  48. package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts.map +1 -1
  49. package/data/build/dist/client/features/workspace-session-enhancement-panel.js +57 -2
  50. package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -1
  51. package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
  52. package/data/build/dist/client/features/workspace-session-enhancement.js +27 -0
  53. package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
  54. package/data/build/dist/client/global-voice-runtime-registry.d.ts +27 -0
  55. package/data/build/dist/client/global-voice-runtime-registry.d.ts.map +1 -0
  56. package/data/build/dist/client/global-voice-runtime-registry.js +12 -0
  57. package/data/build/dist/client/global-voice-runtime-registry.js.map +1 -0
  58. package/data/build/dist/client/index.d.ts +1 -1
  59. package/data/build/dist/client/index.d.ts.map +1 -1
  60. package/data/build/dist/client/locale.d.ts.map +1 -1
  61. package/data/build/dist/client/locale.js +185 -1
  62. package/data/build/dist/client/locale.js.map +1 -1
  63. package/data/build/dist/client/locales/terminalAuth.d.ts.map +1 -1
  64. package/data/build/dist/client/locales/terminalAuth.js +2 -0
  65. package/data/build/dist/client/locales/terminalAuth.js.map +1 -1
  66. package/data/build/dist/client/locales/usage.d.ts.map +1 -1
  67. package/data/build/dist/client/locales/usage.js +4 -0
  68. package/data/build/dist/client/locales/usage.js.map +1 -1
  69. package/data/build/dist/client/mobile-session-interaction.d.ts +9 -0
  70. package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -1
  71. package/data/build/dist/client/mobile-session-interaction.js +63 -0
  72. package/data/build/dist/client/mobile-session-interaction.js.map +1 -1
  73. package/data/build/dist/client/model-catalog-cache.d.ts +23 -0
  74. package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -1
  75. package/data/build/dist/client/model-catalog-cache.js +81 -9
  76. package/data/build/dist/client/model-catalog-cache.js.map +1 -1
  77. package/data/build/dist/client/service-tier.d.ts +11 -0
  78. package/data/build/dist/client/service-tier.d.ts.map +1 -1
  79. package/data/build/dist/client/service-tier.js +15 -0
  80. package/data/build/dist/client/service-tier.js.map +1 -1
  81. package/data/build/dist/client/sherpa-voice-adapter.d.ts +46 -0
  82. package/data/build/dist/client/sherpa-voice-adapter.d.ts.map +1 -0
  83. package/data/build/dist/client/sherpa-voice-adapter.js +252 -0
  84. package/data/build/dist/client/sherpa-voice-adapter.js.map +1 -0
  85. package/data/build/dist/client/skill-command.d.ts +10 -0
  86. package/data/build/dist/client/skill-command.d.ts.map +1 -0
  87. package/data/build/dist/client/skill-command.js +258 -0
  88. package/data/build/dist/client/skill-command.js.map +1 -0
  89. package/data/build/dist/client/skill-reference-dom.d.ts +38 -0
  90. package/data/build/dist/client/skill-reference-dom.d.ts.map +1 -0
  91. package/data/build/dist/client/skill-reference-dom.js +187 -0
  92. package/data/build/dist/client/skill-reference-dom.js.map +1 -0
  93. package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
  94. package/data/build/dist/client/subscription-slot.js +51 -3
  95. package/data/build/dist/client/subscription-slot.js.map +1 -1
  96. package/data/build/dist/client/terminal/model.d.ts +40 -2
  97. package/data/build/dist/client/terminal/model.d.ts.map +1 -1
  98. package/data/build/dist/client/terminal/model.js +151 -24
  99. package/data/build/dist/client/terminal/model.js.map +1 -1
  100. package/data/build/dist/client/terminal/styles.d.ts +8 -0
  101. package/data/build/dist/client/terminal/styles.d.ts.map +1 -1
  102. package/data/build/dist/client/terminal/styles.js +23 -2
  103. package/data/build/dist/client/terminal/styles.js.map +1 -1
  104. package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
  105. package/data/build/dist/client/terminal/ui.js +161 -26
  106. package/data/build/dist/client/terminal/ui.js.map +1 -1
  107. package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -1
  108. package/data/build/dist/client/terminal/xterm-view.js +218 -42
  109. package/data/build/dist/client/terminal/xterm-view.js.map +1 -1
  110. package/data/build/dist/client/voice-capture.d.ts +32 -0
  111. package/data/build/dist/client/voice-capture.d.ts.map +1 -0
  112. package/data/build/dist/client/voice-capture.js +158 -0
  113. package/data/build/dist/client/voice-capture.js.map +1 -0
  114. package/data/build/dist/client/voice-device-manager.d.ts +24 -0
  115. package/data/build/dist/client/voice-device-manager.d.ts.map +1 -0
  116. package/data/build/dist/client/voice-device-manager.js +197 -0
  117. package/data/build/dist/client/voice-device-manager.js.map +1 -0
  118. package/data/build/dist/client/voice-output.d.ts +14 -0
  119. package/data/build/dist/client/voice-output.d.ts.map +1 -0
  120. package/data/build/dist/client/voice-output.js +32 -0
  121. package/data/build/dist/client/voice-output.js.map +1 -0
  122. package/data/build/dist/client/voice-security.d.ts +8 -0
  123. package/data/build/dist/client/voice-security.d.ts.map +1 -0
  124. package/data/build/dist/client/voice-security.js +26 -0
  125. package/data/build/dist/client/voice-security.js.map +1 -0
  126. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +12 -1
  127. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
  128. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +32 -0
  129. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
  130. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +15 -0
  131. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
  132. package/data/build/dist/host/cli-adapters/acp-cli-driver.js +39 -9
  133. package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
  134. package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts +39 -2
  135. package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts.map +1 -1
  136. package/data/build/dist/host/cli-adapters/antigravity-driver.js +198 -10
  137. package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
  138. package/data/build/dist/host/cli-adapters/antigravity-subscription.d.ts +121 -0
  139. package/data/build/dist/host/cli-adapters/antigravity-subscription.d.ts.map +1 -0
  140. package/data/build/dist/host/cli-adapters/antigravity-subscription.js +504 -0
  141. package/data/build/dist/host/cli-adapters/antigravity-subscription.js.map +1 -0
  142. package/data/build/dist/host/cli-adapters/claude-driver.d.ts +21 -0
  143. package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
  144. package/data/build/dist/host/cli-adapters/claude-driver.js +173 -7
  145. package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
  146. package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -1
  147. package/data/build/dist/host/cli-adapters/codebuddy-driver.js +4 -0
  148. package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -1
  149. package/data/build/dist/host/cli-adapters/codex-driver.d.ts +28 -2
  150. package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
  151. package/data/build/dist/host/cli-adapters/codex-driver.js +234 -5
  152. package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
  153. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
  154. package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
  155. package/data/build/dist/host/cli-adapters/command-code-subscription.js +7 -4
  156. package/data/build/dist/host/cli-adapters/command-code-subscription.js.map +1 -1
  157. package/data/build/dist/host/cli-adapters/cursor-driver.d.ts +9 -0
  158. package/data/build/dist/host/cli-adapters/cursor-driver.d.ts.map +1 -1
  159. package/data/build/dist/host/cli-adapters/cursor-driver.js +72 -2
  160. package/data/build/dist/host/cli-adapters/cursor-driver.js.map +1 -1
  161. package/data/build/dist/host/cli-adapters/driver.d.ts +21 -1
  162. package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
  163. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
  164. package/data/build/dist/host/cli-adapters/dsh-message-projector.js +15 -3
  165. package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
  166. package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
  167. package/data/build/dist/host/cli-adapters/feature.js +18 -1
  168. package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
  169. package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -1
  170. package/data/build/dist/host/cli-adapters/gemini-driver.js +4 -0
  171. package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
  172. package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
  173. package/data/build/dist/host/cli-adapters/grok-driver.js +4 -0
  174. package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
  175. package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -1
  176. package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -1
  177. package/data/build/dist/host/cli-adapters/kimi-driver.d.ts.map +1 -1
  178. package/data/build/dist/host/cli-adapters/kimi-driver.js +6 -6
  179. package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
  180. package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -1
  181. package/data/build/dist/host/cli-adapters/mcode-driver.js +2 -0
  182. package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
  183. package/data/build/dist/host/cli-adapters/model-catalog.d.ts +49 -0
  184. package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
  185. package/data/build/dist/host/cli-adapters/model-catalog.js +126 -0
  186. package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
  187. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +11 -0
  188. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
  189. package/data/build/dist/host/cli-adapters/opencode-driver.js +92 -8
  190. package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
  191. package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
  192. package/data/build/dist/host/cli-adapters/pi-driver.js +4 -0
  193. package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
  194. package/data/build/dist/host/cli-adapters/process-utils.d.ts +10 -3
  195. package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
  196. package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
  197. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +4 -1
  198. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
  199. package/data/build/dist/host/cli-adapters/provider-subscription.js +8 -1
  200. package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
  201. package/data/build/dist/host/cli-adapters/qoder-driver.d.ts +15 -0
  202. package/data/build/dist/host/cli-adapters/qoder-driver.d.ts.map +1 -1
  203. package/data/build/dist/host/cli-adapters/qoder-driver.js +171 -3
  204. package/data/build/dist/host/cli-adapters/qoder-driver.js.map +1 -1
  205. package/data/build/dist/host/cli-adapters/qoder-subscription.js +3 -1
  206. package/data/build/dist/host/cli-adapters/qoder-subscription.js.map +1 -1
  207. package/data/build/dist/host/cli-adapters/reasoning-content.d.ts +11 -0
  208. package/data/build/dist/host/cli-adapters/reasoning-content.d.ts.map +1 -0
  209. package/data/build/dist/host/cli-adapters/reasoning-content.js +79 -0
  210. package/data/build/dist/host/cli-adapters/reasoning-content.js.map +1 -0
  211. package/data/build/dist/host/cli-adapters/registry.d.ts +24 -1
  212. package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
  213. package/data/build/dist/host/cli-adapters/registry.js +109 -4
  214. package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
  215. package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts +3 -2
  216. package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts.map +1 -1
  217. package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +8 -2
  218. package/data/build/dist/host/cli-adapters/rpc-driver-utils.js.map +1 -1
  219. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +3 -2
  220. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
  221. package/data/build/dist/host/cli-adapters/standard-stream-driver.js +14 -2
  222. package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
  223. package/data/build/dist/host/cli-bridge/injections.d.ts +10 -1
  224. package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
  225. package/data/build/dist/host/cli-bridge/injections.js +28 -8
  226. package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
  227. package/data/build/dist/host/features/assistant-dispatch.d.ts +45 -0
  228. package/data/build/dist/host/features/assistant-dispatch.d.ts.map +1 -0
  229. package/data/build/dist/host/features/assistant-dispatch.js +49 -0
  230. package/data/build/dist/host/features/assistant-dispatch.js.map +1 -0
  231. package/data/build/dist/host/features/assistant-intent.d.ts +46 -0
  232. package/data/build/dist/host/features/assistant-intent.d.ts.map +1 -0
  233. package/data/build/dist/host/features/assistant-intent.js +149 -0
  234. package/data/build/dist/host/features/assistant-intent.js.map +1 -0
  235. package/data/build/dist/host/features/assistant-scope-settings.d.ts +25 -0
  236. package/data/build/dist/host/features/assistant-scope-settings.d.ts.map +1 -0
  237. package/data/build/dist/host/features/assistant-scope-settings.js +33 -0
  238. package/data/build/dist/host/features/assistant-scope-settings.js.map +1 -0
  239. package/data/build/dist/host/features/assistant-scope.d.ts +79 -0
  240. package/data/build/dist/host/features/assistant-scope.d.ts.map +1 -0
  241. package/data/build/dist/host/features/assistant-scope.js +107 -0
  242. package/data/build/dist/host/features/assistant-scope.js.map +1 -0
  243. package/data/build/dist/host/features/assistant-session-index.d.ts +44 -0
  244. package/data/build/dist/host/features/assistant-session-index.d.ts.map +1 -0
  245. package/data/build/dist/host/features/assistant-session-index.js +109 -0
  246. package/data/build/dist/host/features/assistant-session-index.js.map +1 -0
  247. package/data/build/dist/host/features/assistant-summary.d.ts +28 -0
  248. package/data/build/dist/host/features/assistant-summary.d.ts.map +1 -0
  249. package/data/build/dist/host/features/assistant-summary.js +166 -0
  250. package/data/build/dist/host/features/assistant-summary.js.map +1 -0
  251. package/data/build/dist/host/features/assistant-voice-stream.d.ts +10 -0
  252. package/data/build/dist/host/features/assistant-voice-stream.d.ts.map +1 -0
  253. package/data/build/dist/host/features/assistant-voice-stream.js +106 -0
  254. package/data/build/dist/host/features/assistant-voice-stream.js.map +1 -0
  255. package/data/build/dist/host/features/assistant-voice-turn.d.ts +27 -0
  256. package/data/build/dist/host/features/assistant-voice-turn.d.ts.map +1 -0
  257. package/data/build/dist/host/features/assistant-voice-turn.js +54 -0
  258. package/data/build/dist/host/features/assistant-voice-turn.js.map +1 -0
  259. package/data/build/dist/host/features/assistant-waiting-state.d.ts +14 -0
  260. package/data/build/dist/host/features/assistant-waiting-state.d.ts.map +1 -0
  261. package/data/build/dist/host/features/assistant-waiting-state.js +17 -0
  262. package/data/build/dist/host/features/assistant-waiting-state.js.map +1 -0
  263. package/data/build/dist/host/features/global-voice-coordinator.d.ts +55 -0
  264. package/data/build/dist/host/features/global-voice-coordinator.d.ts.map +1 -0
  265. package/data/build/dist/host/features/global-voice-coordinator.js +221 -0
  266. package/data/build/dist/host/features/global-voice-coordinator.js.map +1 -0
  267. package/data/build/dist/host/features/global-voice-rpc.d.ts +25 -0
  268. package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -0
  269. package/data/build/dist/host/features/global-voice-rpc.js +862 -0
  270. package/data/build/dist/host/features/global-voice-rpc.js.map +1 -0
  271. package/data/build/dist/host/features/index.d.ts +10 -0
  272. package/data/build/dist/host/features/index.d.ts.map +1 -1
  273. package/data/build/dist/host/features/index.js +10 -0
  274. package/data/build/dist/host/features/index.js.map +1 -1
  275. package/data/build/dist/host/features/peer-host.d.ts +5 -0
  276. package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
  277. package/data/build/dist/host/features/peer-host.js +232 -2
  278. package/data/build/dist/host/features/peer-host.js.map +1 -1
  279. package/data/build/dist/host/features/sherpa-voice-runtime.d.ts +42 -0
  280. package/data/build/dist/host/features/sherpa-voice-runtime.d.ts.map +1 -0
  281. package/data/build/dist/host/features/sherpa-voice-runtime.js +193 -0
  282. package/data/build/dist/host/features/sherpa-voice-runtime.js.map +1 -0
  283. package/data/build/dist/host/features/types.d.ts +26 -0
  284. package/data/build/dist/host/features/types.d.ts.map +1 -1
  285. package/data/build/dist/host/features/voice-agent-actions.d.ts +26 -0
  286. package/data/build/dist/host/features/voice-agent-actions.d.ts.map +1 -0
  287. package/data/build/dist/host/features/voice-agent-actions.js +128 -0
  288. package/data/build/dist/host/features/voice-agent-actions.js.map +1 -0
  289. package/data/build/dist/host/features/voice-agent-service.d.ts +117 -0
  290. package/data/build/dist/host/features/voice-agent-service.d.ts.map +1 -0
  291. package/data/build/dist/host/features/voice-agent-service.js +243 -0
  292. package/data/build/dist/host/features/voice-agent-service.js.map +1 -0
  293. package/data/build/dist/host/features/voice-model-setup.d.ts +20 -0
  294. package/data/build/dist/host/features/voice-model-setup.d.ts.map +1 -0
  295. package/data/build/dist/host/features/voice-model-setup.js +89 -0
  296. package/data/build/dist/host/features/voice-model-setup.js.map +1 -0
  297. package/data/build/dist/host/index.d.ts +2 -2
  298. package/data/build/dist/host/index.d.ts.map +1 -1
  299. package/data/build/dist/host/index.js +7 -1
  300. package/data/build/dist/host/index.js.map +1 -1
  301. package/data/build/dist/host/lan-access-dsh.js.map +1 -1
  302. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
  303. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +53 -2
  304. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
  305. package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js +15 -1
  306. package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js.map +1 -1
  307. package/data/build/dist/host/native-session-bridge.d.ts +2 -0
  308. package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
  309. package/data/build/dist/host/native-session-bridge.js +1 -0
  310. package/data/build/dist/host/native-session-bridge.js.map +1 -1
  311. package/data/build/dist/host/rpc.d.ts.map +1 -1
  312. package/data/build/dist/host/rpc.js +9 -4
  313. package/data/build/dist/host/rpc.js.map +1 -1
  314. package/data/build/dist/host/settings.d.ts.map +1 -1
  315. package/data/build/dist/host/settings.js +19 -1
  316. package/data/build/dist/host/settings.js.map +1 -1
  317. package/data/build/dist/host/terminal/backends/conpty-backend.js.map +1 -1
  318. package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -1
  319. package/data/build/dist/host/terminal/terminal-controller.js +4 -0
  320. package/data/build/dist/host/terminal/terminal-controller.js.map +1 -1
  321. package/data/build/dist/host/terminal/terminal-service.d.ts +21 -1
  322. package/data/build/dist/host/terminal/terminal-service.d.ts.map +1 -1
  323. package/data/build/dist/host/terminal/terminal-service.js +118 -7
  324. package/data/build/dist/host/terminal/terminal-service.js.map +1 -1
  325. package/data/build/dist/index.d.ts +2 -2
  326. package/data/build/dist/index.d.ts.map +1 -1
  327. package/data/build/dist/index.js +1 -1
  328. package/data/build/dist/index.js.map +1 -1
  329. package/data/build/dist/shared/contracts/assistant.d.ts +70 -0
  330. package/data/build/dist/shared/contracts/assistant.d.ts.map +1 -0
  331. package/data/build/dist/shared/contracts/assistant.js +2 -0
  332. package/data/build/dist/shared/contracts/assistant.js.map +1 -0
  333. package/data/build/dist/shared/contracts/cli-adapter.d.ts +33 -1
  334. package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
  335. package/data/build/dist/shared/contracts/config.d.ts +30 -0
  336. package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
  337. package/data/build/dist/shared/contracts/config.js +20 -0
  338. package/data/build/dist/shared/contracts/config.js.map +1 -1
  339. package/data/build/dist/shared/contracts/errors.d.ts +2 -2
  340. package/data/build/dist/shared/contracts/errors.d.ts.map +1 -1
  341. package/data/build/dist/shared/contracts/subscription.d.ts +30 -0
  342. package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
  343. package/data/build/dist/shared/contracts/subscription.js.map +1 -1
  344. package/data/build/dist/shared/contracts/terminal.d.ts +2 -0
  345. package/data/build/dist/shared/contracts/terminal.d.ts.map +1 -1
  346. package/data/build/dist/shared/contracts/version.d.ts +12 -5
  347. package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
  348. package/data/build/dist/shared/contracts/version.js +11 -4
  349. package/data/build/dist/shared/contracts/version.js.map +1 -1
  350. package/data/build/dist/shared/contracts/voice-runtime.d.ts +90 -0
  351. package/data/build/dist/shared/contracts/voice-runtime.d.ts.map +1 -0
  352. package/data/build/dist/shared/contracts/voice-runtime.js +16 -0
  353. package/data/build/dist/shared/contracts/voice-runtime.js.map +1 -0
  354. package/data/build/dist/shared/index.d.ts +8 -2
  355. package/data/build/dist/shared/index.d.ts.map +1 -1
  356. package/data/build/dist/shared/index.js +5 -1
  357. package/data/build/dist/shared/index.js.map +1 -1
  358. package/data/build/dist/shared/voice-models.d.ts +21 -0
  359. package/data/build/dist/shared/voice-models.d.ts.map +1 -0
  360. package/data/build/dist/shared/voice-models.js +27 -0
  361. package/data/build/dist/shared/voice-models.js.map +1 -0
  362. package/data/build/dist/shared/voice-stream.d.ts +42 -0
  363. package/data/build/dist/shared/voice-stream.d.ts.map +1 -0
  364. package/data/build/dist/shared/voice-stream.js +99 -0
  365. package/data/build/dist/shared/voice-stream.js.map +1 -0
  366. package/data/build/dist/shared/voice-text.d.ts +3 -0
  367. package/data/build/dist/shared/voice-text.d.ts.map +1 -0
  368. package/data/build/dist/shared/voice-text.js +14 -0
  369. package/data/build/dist/shared/voice-text.js.map +1 -0
  370. package/data/build/dist/typert.host.d.ts.map +1 -1
  371. package/data/build/dist/typert.host.js +1 -0
  372. package/data/build/dist/typert.host.js.map +1 -1
  373. package/package.json +56 -26
  374. package/profile/README.md +8 -5
  375. package/profile/package.json +5 -3
  376. package/profile/version.json +3 -3
  377. package/version.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import { spawn, spawnSync } from 'node:child_process';
2
- import { randomUUID } from 'node:crypto';
2
+ import { createHash, randomUUID } from 'node:crypto';
3
+ import { readFileSync } from 'node:fs';
3
4
  import { homedir } from 'node:os';
4
5
  import { basename, join, resolve } from 'node:path';
5
6
  import { JsonRpcProcess, JsonRpcRequestError } from './json-rpc-process.js';
@@ -18,7 +19,7 @@ const CODEX_COMPACTION_TIMEOUT_MS = 60_000;
18
19
  const CODEX_APP_SERVER_ARGS = ['app-server', '--disable', 'computer_use'];
19
20
  /** Codex app-server 的 JSON-RPC 驱动,Host 只暴露统一文本流,不暴露线程和 token。 */
20
21
  export class CodexAppServerDriver {
21
- descriptor = { id: 'codex', name: 'Codex', protocol: 'json-rpc', capabilities: ['models', 'stream', 'resume', 'interrupt', 'tool-events', 'reasoning', 'usage', 'permission', 'questions', 'steer'] };
22
+ descriptor = { id: 'codex', name: 'Codex', protocol: 'json-rpc', capabilities: ['models', 'skills', 'stream', 'resume', 'interrupt', 'tool-events', 'reasoning', 'usage', 'permission', 'questions', 'steer'] };
22
23
  // Codex 一个 Provider turn 可能同时包含多个工具调用。只有 assistant item
23
24
  // 切换后才分段,不能在每个工具完成后注入下一 step。
24
25
  supportsSegmentedTurns = true;
@@ -26,6 +27,8 @@ export class CodexAppServerDriver {
26
27
  runSpawnSync;
27
28
  runSpawn;
28
29
  sessionRoots;
30
+ /** Codex 配置根目录;`config.toml` 与 `auth.json` 都位于这里。 */
31
+ codexHome;
29
32
  cachedBinary = null;
30
33
  processes = new Set();
31
34
  sessions = new Map();
@@ -34,8 +37,33 @@ export class CodexAppServerDriver {
34
37
  this.runSpawnSync = options.spawnSync ?? spawnSync;
35
38
  this.runSpawn = options.spawn ?? spawn;
36
39
  const codexHome = process.env.CODEX_HOME ?? join(homedir(), '.codex');
40
+ this.codexHome = codexHome;
37
41
  this.sessionRoots = options.sessionRoots ?? [join(codexHome, 'sessions'), join(codexHome, 'archived_sessions')];
38
42
  }
43
+ /**
44
+ * Codex 目录语义指纹。
45
+ *
46
+ * 目录里的 `officialSubscription` 与 `defaultServiceTier` 完全由 `config.toml`
47
+ * 的 `model_provider` / `openai_base_url` / `service_tier` 和 `auth.json` 的登录
48
+ * 模式决定。用户在 cc-switch 之类的工具里切供应商时,只改写这两个文件,
49
+ * `codex` 可执行文件不变,安装探测指纹也就不会变——若不单独比对它们,
50
+ * 10 分钟 TTL 的目录缓存会把「第三方」判定一直沿用下去,官方订阅的 Fast
51
+ * 档位开关就会长期不出现。
52
+ *
53
+ * 只对解析出的**非敏感字段**做哈希:`auth.json` 里的 token 永远不进入指纹,
54
+ * 因此这里返回的内容不能反推凭据。
55
+ */
56
+ catalogFingerprint() {
57
+ const config = readTextFile(join(this.codexHome, 'config.toml'));
58
+ const auth = readTextFile(join(this.codexHome, 'auth.json'));
59
+ // 两个文件都读不到时返回 undefined,表示无法判断;Registry 不会据此失效缓存,
60
+ // 避免在非标准部署下把目录变成每次都重新探测。
61
+ if (config === undefined && auth === undefined)
62
+ return undefined;
63
+ const configSummary = config === undefined ? 'missing' : summarizeCodexConfig(config);
64
+ const authSummary = auth === undefined ? 'missing' : summarizeCodexAuth(auth);
65
+ return createHash('sha256').update(`${configSummary}\u0000${authSummary}`).digest('hex').slice(0, 16);
66
+ }
39
67
  async detect() {
40
68
  const result = await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync });
41
69
  if (result.installed)
@@ -92,6 +120,27 @@ export class CodexAppServerDriver {
92
120
  },
93
121
  });
94
122
  }
123
+ /**
124
+ * 读取 Codex 当前工作目录的 Skill 目录。
125
+ *
126
+ * Skill 路径和内容只在本驱动缓存,Client 只能拿到可展示的摘要;这样既能
127
+ * 给 DSH `/skills` 提供目录,也不会把任意本地绝对路径变成浏览器输入。
128
+ */
129
+ async listSkills(input) {
130
+ const command = this.cachedBinary ?? (await this.detect()).command;
131
+ if (command === null)
132
+ return [];
133
+ const sessionInput = {
134
+ sessionId: input.sessionId,
135
+ messages: [],
136
+ prompt: '',
137
+ ...(input.cwd === undefined ? {} : { cwd: input.cwd }),
138
+ ...(input.signal === undefined ? {} : { signal: input.signal }),
139
+ };
140
+ const session = await this.getSession(sessionInput, command);
141
+ await this.refreshSkillCatalog(session, input.cwd, input.forceReload === true, input.signal);
142
+ return [...session.skills.values()].map(({ path: _path, ...descriptor }) => descriptor);
143
+ }
95
144
  async *executeTurn(input) {
96
145
  const command = this.cachedBinary ?? (await this.detect()).command;
97
146
  if (command === null)
@@ -516,16 +565,50 @@ export class CodexAppServerDriver {
516
565
  }
517
566
  /** turn/start 遇到上下文超限时压缩一次并重试,兼容关闭自动压缩的 Codex 配置。 */
518
567
  async startTurn(session, input) {
568
+ await this.prepareSkillInputs(session, input);
519
569
  try {
520
- return await session.rpc.request('turn/start', codexTurnStartParams(input, session.threadId), { signal: input.signal, killOnAbort: false });
570
+ return await session.rpc.request('turn/start', codexTurnStartParams(input, session.threadId, session.skills), { signal: input.signal, killOnAbort: false });
521
571
  }
522
572
  catch (error) {
523
573
  if (!isContextWindowError(error))
524
574
  throw error;
525
575
  await this.compactThread(session, input);
526
- return session.rpc.request('turn/start', codexTurnStartParams(input, session.threadId), { signal: input.signal, killOnAbort: false });
576
+ return session.rpc.request('turn/start', codexTurnStartParams(input, session.threadId, session.skills), { signal: input.signal, killOnAbort: false });
527
577
  }
528
578
  }
579
+ /** 只为显式 `/skill-name` 或 `$skill-name` 预取目录;没有显式调用时保留 Codex 自己的隐式匹配。 */
580
+ async prepareSkillInputs(session, input) {
581
+ const names = codexSkillNames(input.prompt);
582
+ if (names.length === 0)
583
+ return;
584
+ const cwd = input.cwd ?? process.cwd();
585
+ if (session.skillsCwd !== cwd)
586
+ session.skills.clear();
587
+ if (session.skillsCwd !== cwd || session.skills.size === 0) {
588
+ try {
589
+ await this.refreshSkillCatalog(session, cwd, false, input.signal);
590
+ }
591
+ catch (error) {
592
+ // 旧版 app-server 可能还没有 skills/list;保留原始 Skill 文本,让 Codex
593
+ // 继续走它自己的解析路径,而不是把一次能力探测失败变成整轮失败。
594
+ if (!isMethodNotFound(error))
595
+ throw error;
596
+ return;
597
+ }
598
+ }
599
+ }
600
+ async refreshSkillCatalog(session, cwd, forceReload, signal) {
601
+ const resolvedCwd = cwd ?? process.cwd();
602
+ const response = await session.rpc.request('skills/list', {
603
+ cwds: [resolvedCwd],
604
+ ...(forceReload ? { forceReload: true } : {}),
605
+ }, { signal, killOnAbort: false });
606
+ const entries = parseCodexSkills(response, resolvedCwd);
607
+ session.skills.clear();
608
+ for (const entry of entries)
609
+ session.skills.set(entry.name, entry);
610
+ session.skillsCwd = resolvedCwd;
611
+ }
529
612
  /** thread/compact/start 立即返回,真正完成由 contextCompaction turn 的终态通知表示。 */
530
613
  async compactThread(session, input) {
531
614
  if (session.compacting !== undefined)
@@ -754,9 +837,18 @@ export class CodexAppServerDriver {
754
837
  suppressedCompactionTurnIds: new Set(),
755
838
  pendingCompactionEvents: [],
756
839
  autoCompaction: undefined,
840
+ skillsCwd: undefined,
841
+ skills: new Map(),
757
842
  };
758
843
  this.processes.add(rpc);
759
844
  this.sessions.set(input.sessionId, session);
845
+ // Codex 目录发生变化时丢弃 Host 侧路径缓存;下一次显式调用会重新读取目录。
846
+ rpc.addNotificationListener((message) => {
847
+ if (message.method !== 'skills/changed')
848
+ return;
849
+ session.skills.clear();
850
+ session.skillsCwd = undefined;
851
+ });
760
852
  await rpc.request('initialize', { clientInfo: { name: 'codingns4dsh', version: '0.1.1' }, capabilities: { experimentalApi: true } }, { signal: input.signal, killOnAbort: false });
761
853
  rpc.notify('initialized', {});
762
854
  rpc.setServerRequestHandler((request) => {
@@ -944,6 +1036,76 @@ async function readCodexOfficialSubscription(rpc, signal) {
944
1036
  return undefined;
945
1037
  }
946
1038
  }
1039
+ /** 同步读取文本文件;不存在或不可读时返回 undefined,调用方按“无法判断”处理。 */
1040
+ function readTextFile(path) {
1041
+ try {
1042
+ return readFileSync(path, 'utf8');
1043
+ }
1044
+ catch {
1045
+ return undefined;
1046
+ }
1047
+ }
1048
+ /**
1049
+ * 从 `config.toml` 摘出影响目录语义的字段。
1050
+ *
1051
+ * 这里刻意不做完整 TOML 解析:只需覆盖两种常见写法——顶层 `key = "value"`,
1052
+ * 以及 `[model_providers.xxx]` 段内的 `base_url`。手写正则比引入解析依赖更稳,
1053
+ * 也不会因为 Codex 新增字段而改变指纹。凭据不在 config.toml 中,无需脱敏。
1054
+ */
1055
+ function summarizeCodexConfig(config) {
1056
+ const fields = [];
1057
+ let section = '';
1058
+ for (const rawLine of config.split(/\r?\n/u)) {
1059
+ const line = rawLine.trim();
1060
+ if (line === '' || line.startsWith('#'))
1061
+ continue;
1062
+ const sectionMatch = line.match(/^\[(?<name>[^\]]+)\]$/u);
1063
+ if (sectionMatch !== null) {
1064
+ section = sectionMatch.groups?.name?.trim() ?? '';
1065
+ continue;
1066
+ }
1067
+ const assignment = line.match(/^(?<key>[A-Za-z0-9_.-]+)\s*=\s*(?<value>.*)$/u);
1068
+ if (assignment === null)
1069
+ continue;
1070
+ const key = assignment.groups?.key ?? '';
1071
+ const value = (assignment.groups?.value ?? '').trim();
1072
+ // 顶层:决定 Provider 与档位;Provider 段内:只有 base_url 影响上游身份。
1073
+ const topLevelKeys = ['model_provider', 'model', 'service_tier', 'openai_base_url', 'profile'];
1074
+ const isTopLevel = section === '' && topLevelKeys.includes(key);
1075
+ const isProviderBaseUrl = section.startsWith('model_providers.') && key === 'base_url';
1076
+ if (!isTopLevel && !isProviderBaseUrl)
1077
+ continue;
1078
+ fields.push(`${section}.${key}=${value}`);
1079
+ }
1080
+ return fields.join('\n');
1081
+ }
1082
+ /**
1083
+ * 从 `auth.json` 摘出登录模式,**不读取任何凭据**。
1084
+ *
1085
+ * 官方订阅与 API key 两种登录方式的 `auth_mode` 不同;`OPENAI_API_KEY` 只取
1086
+ * 「有没有设置」这一位布尔信息,token 与 key 原文永远不进入指纹。
1087
+ */
1088
+ function summarizeCodexAuth(auth) {
1089
+ let parsed;
1090
+ try {
1091
+ parsed = JSON.parse(auth);
1092
+ }
1093
+ catch {
1094
+ // auth.json 不是合法 JSON(例如切换过程中被截断):用长度当指纹,
1095
+ // 下一次读取到完整文件时指纹自然变化并触发失效。
1096
+ return `invalid:${auth.length}`;
1097
+ }
1098
+ if (!isRecord(parsed))
1099
+ return 'invalid:not-object';
1100
+ const mode = typeof parsed.auth_mode === 'string' ? parsed.auth_mode : 'unknown';
1101
+ const hasApiKey = typeof parsed.OPENAI_API_KEY === 'string' && parsed.OPENAI_API_KEY.trim() !== '';
1102
+ // 只比较 token 的“有无”与 account_id 是否变化,不比较 token 内容:
1103
+ // 官方订阅每次刷新都会轮换 access_token,把 token 纳入指纹会让目录每次刷新都失效。
1104
+ const tokens = isRecord(parsed.tokens) ? parsed.tokens : undefined;
1105
+ const hasTokens = tokens !== undefined && typeof tokens.refresh_token === 'string';
1106
+ const accountId = tokens !== undefined && typeof tokens.account_id === 'string' ? tokens.account_id : '';
1107
+ return `${mode}|apiKey=${hasApiKey}|tokens=${hasTokens}|account=${accountId}`;
1108
+ }
947
1109
  function codexMessageToChunk(message) {
948
1110
  const params = isRecord(message.params) ? message.params : message;
949
1111
  const item = isRecord(params.item) ? params.item : params;
@@ -1464,7 +1626,7 @@ function codexServiceTier(value) {
1464
1626
  const tier = value?.trim();
1465
1627
  return tier === undefined || tier === '' ? undefined : tier;
1466
1628
  }
1467
- function codexTurnStartParams(input, threadId) {
1629
+ function codexTurnStartParams(input, threadId, skills) {
1468
1630
  const cwd = resolve(input.cwd ?? process.cwd());
1469
1631
  const inputBlocks = [];
1470
1632
  const attachments = input.attachments ?? [];
@@ -1474,6 +1636,12 @@ function codexTurnStartParams(input, threadId) {
1474
1636
  if (attachment.kind === 'image')
1475
1637
  inputBlocks.push({ type: 'localImage', path: attachment.path });
1476
1638
  }
1639
+ for (const name of codexSkillNames(input.prompt)) {
1640
+ const skill = skills.get(name);
1641
+ if (skill?.enabled !== true || skill.path === undefined)
1642
+ continue;
1643
+ inputBlocks.push({ type: 'skill', name: skill.name, path: skill.path });
1644
+ }
1477
1645
  return {
1478
1646
  threadId,
1479
1647
  input: inputBlocks,
@@ -1483,6 +1651,67 @@ function codexTurnStartParams(input, threadId) {
1483
1651
  ...(input.effortId ? { effort: input.effortId } : {}),
1484
1652
  };
1485
1653
  }
1654
+ /** 从用户文本提取显式 Skill mention,兼容 DSH 原生 `/name` 与旧版 `$name` 写法。 */
1655
+ function codexSkillNames(prompt) {
1656
+ const names = [];
1657
+ const seen = new Set();
1658
+ for (const match of prompt.matchAll(/(?:^|\s)(?:\$|\/)([A-Za-z0-9][A-Za-z0-9._-]*)(?=\s|$)/gu)) {
1659
+ const name = match[1]?.trim();
1660
+ if (name === undefined || name === '' || seen.has(name))
1661
+ continue;
1662
+ seen.add(name);
1663
+ names.push(name);
1664
+ }
1665
+ return names;
1666
+ }
1667
+ /** 兼容不同 Codex app-server 版本的 `skills/list` 响应包装。 */
1668
+ function parseCodexSkills(value, cwd) {
1669
+ const root = isRecord(value) && Array.isArray(value.data) ? value.data : [];
1670
+ const normalizedCwd = resolve(cwd);
1671
+ const scoped = root
1672
+ .filter(isRecord)
1673
+ .find((item) => typeof item.cwd === 'string' && resolve(item.cwd) === normalizedCwd);
1674
+ // 当前请求只传了一个 cwd。部分 Codex 版本会返回规范化前后的路径,
1675
+ // 甚至省略 cwd;此时唯一作用域就是本次请求的结果,不能把它误判成空目录。
1676
+ const singleScope = root.length === 1 && isRecord(root[0]) && Array.isArray(root[0].skills);
1677
+ const rawSkills = Array.isArray(scoped?.skills)
1678
+ ? scoped.skills
1679
+ : singleScope
1680
+ ? root[0].skills
1681
+ : root.every((item) => isRecord(item) && typeof item.name === 'string')
1682
+ ? root
1683
+ : [];
1684
+ const result = [];
1685
+ for (const raw of rawSkills) {
1686
+ if (!isRecord(raw))
1687
+ continue;
1688
+ const name = typeof raw.name === 'string' ? raw.name.trim() : '';
1689
+ if (name === '')
1690
+ continue;
1691
+ const interfaceInfo = isRecord(raw.interface) ? raw.interface : null;
1692
+ const description = firstNonEmptyString(raw.description, interfaceInfo?.shortDescription, interfaceInfo?.displayName, name) ?? name;
1693
+ const displayName = firstNonEmptyString(interfaceInfo?.displayName);
1694
+ const path = firstNonEmptyString(raw.path, raw.skillPath);
1695
+ if (result.some((item) => item.name === name))
1696
+ continue;
1697
+ result.push({
1698
+ id: name,
1699
+ name,
1700
+ description,
1701
+ enabled: raw.enabled !== false,
1702
+ ...(displayName === undefined ? {} : { displayName }),
1703
+ ...(path === undefined ? {} : { path }),
1704
+ });
1705
+ }
1706
+ return result;
1707
+ }
1708
+ function firstNonEmptyString(...values) {
1709
+ for (const value of values) {
1710
+ if (typeof value === 'string' && value.trim() !== '')
1711
+ return value.trim();
1712
+ }
1713
+ return undefined;
1714
+ }
1486
1715
  /**
1487
1716
  * 由 DSH 会话权限状态派生 Codex 原生沙箱模式。
1488
1717
  *