@chatcode/chatcode-cli 3.0.2 → 3.0.4-rc.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 (221) hide show
  1. package/README.i18n.yaml +10 -10
  2. package/README.md +26 -1
  3. package/README.zh.md +26 -1
  4. package/lib/bin.js +70 -75
  5. package/lib/{command-errors-CIYn1nnW.js → command-errors-BkCHTQHj.js} +12 -12
  6. package/lib/{command-trees-8o99Bws7.js → command-trees-5HFyC5sI.js} +2 -2
  7. package/lib/{component-identity-CnmIKHEF.js → component-identity-De91VHwW.js} +3 -3
  8. package/lib/{dist-DxjlHHph.js → dist-CsDWUvQ4.js} +238 -232
  9. package/lib/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
  10. package/lib/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
  11. package/lib/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
  12. package/lib/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
  13. package/lib/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
  14. package/lib/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
  15. package/lib/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
  16. package/lib/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
  17. package/lib/dsh-ecosystem-spec/registry/README.md +14 -0
  18. package/lib/dsh-ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
  19. package/lib/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
  20. package/lib/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
  21. package/lib/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
  22. package/lib/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
  23. package/lib/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
  24. package/lib/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -0
  25. package/lib/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
  26. package/lib/dsh-ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
  27. package/lib/dsh-ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
  28. package/lib/dsh-ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
  29. package/lib/{dump-config-BSTrhTT_.js → dump-config-BcH-VYuv.js} +5 -5
  30. package/lib/dump-config-CyopmD85.js +2 -0
  31. package/lib/{dump-config-schema-Cz4A13GB.js → dump-config-schema-DM0fb6Ns.js} +2 -2
  32. package/lib/{extension-events-DciGPKJa.js → extension-events-CdYCRP0o.js} +26 -26
  33. package/lib/{frames-7PAg0Q9b.js → frames-DOX-Jgk8.js} +4 -4
  34. package/lib/headless-compat.js +2 -2
  35. package/lib/{home-migration-DLaSvmfn.js → home-migration-BjDmRwBB.js} +23 -4
  36. package/lib/{host-access-CmD27uhQ.js → host-access-Bk4xps5E.js} +1 -1
  37. package/lib/{keymap-CFChEJ2W.js → keymap-CJ1kvLR2.js} +17 -16
  38. package/lib/{plugin-jvd9PCVt.js → plugin-XR7ncbnW.js} +3767 -2331
  39. package/lib/{plugin-DYHtreEd.js → plugin-eJjD6r12.js} +1 -1
  40. package/lib/{profile-boot-Blq7uqhx.js → profile-boot-BNQry1NM.js} +109 -14
  41. package/lib/profile-boot.js +2 -2
  42. package/lib/{scenes-ai_8sHDs.js → scenes-CAmWncZD.js} +3 -3
  43. package/lib/{settings-sections-QQ1-2lhL.js → settings-sections-CakcvBv9.js} +7 -3
  44. package/lib/startup-diagnostics-C_hRCp-q.js +91 -0
  45. package/lib/statusBarSettings-BPPS_Usm.js +382 -0
  46. package/lib/{supports-color-CcW-FGjr.js → supports-color-DyChQwlI.js} +2 -2
  47. package/lib/{themes-DTzG_9I_.js → themes-OjcUpZzw.js} +13 -13
  48. package/lib/tui-compat-command-trees.js +1 -1
  49. package/lib/tui-compat-extensions.js +4 -4
  50. package/lib/tui-compat-plugin-host.js +5 -5
  51. package/lib/tui-compat-scenes.js +1 -1
  52. package/lib/tui-compat-settings-sections.js +1 -1
  53. package/lib/tui-compat-working-activity.js +4 -4
  54. package/lib/tui-compat-workspaces.js +1 -1
  55. package/lib/tui-compat.js +44 -29
  56. package/lib/types/args.d.ts +2 -0
  57. package/lib/types/home-migration.d.ts +8 -0
  58. package/lib/types/permission-bypass.d.ts +16 -0
  59. package/lib/types/profile-boot.d.ts +12 -0
  60. package/lib/types/startup-diagnostics.d.ts +13 -0
  61. package/lib/types/tui-compat.d.ts +6 -0
  62. package/lib/types/web-browser.d.ts +6 -0
  63. package/lib/types/web-instance.d.ts +42 -0
  64. package/lib/web-browser-Vcgfdsv_.js +46 -0
  65. package/lib/web-instance-B0jec7cq.js +2 -0
  66. package/lib/web-instance-DbP7IHPv.js +280 -0
  67. package/lib/{workspaces-CznCgVHv.js → workspaces-XY7UdfXp.js} +2 -2
  68. package/package.json +40 -32
  69. package/runtime/manifest.json +4 -6
  70. package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +34 -4
  71. package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +9 -0
  72. package/runtime/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +2 -1
  73. package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.js +2 -0
  74. package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/remote-stream.js +4 -0
  75. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +39 -0
  76. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +6 -1
  77. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +10 -3
  78. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +7 -0
  79. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +8 -1
  80. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +10 -0
  81. package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/index.js +28 -1
  82. package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.host.js +39 -0
  83. package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.remote-client.d.ts +2 -0
  84. package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.remote-client.js +32 -0
  85. package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/types/index.d.ts +8 -0
  86. package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/types/index.js +19 -1
  87. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/index.js +28 -0
  88. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/feed.js +17 -0
  89. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +67 -19
  90. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/index.d.ts +1 -1
  91. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/profile-context.d.ts +11 -1
  92. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/worker/profile-resolution-bootstrap.js +22 -3
  93. package/runtime/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +9 -3
  94. package/runtime/node_modules/@deepseek-ai/dsh-base/package.json +2 -1
  95. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +3 -2
  96. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/index.d.ts +2 -2
  97. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +1 -1
  98. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
  99. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +60 -12
  100. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/directory.d.ts +3 -1
  101. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/locales.d.ts +6 -0
  102. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/CodeBlock.module.css +3 -5
  103. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/MarkdownText.module.css +23 -27
  104. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/contract/slots.d.ts +3 -1
  105. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  106. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/index.d.ts +2 -2
  107. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +8 -7
  108. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/SettingsDocumentAction.d.ts +1 -1
  109. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/settings-document-store.d.ts +2 -1
  110. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +33 -12
  111. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/locales.d.ts +2 -0
  112. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
  113. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  114. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
  115. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +8 -1
  116. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/locales.d.ts +2 -0
  117. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +84 -8
  118. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/region.d.ts +9 -0
  119. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/summarizer.d.ts +7 -0
  120. package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/index.js +35 -0
  121. package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.d.ts +11 -0
  122. package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +10 -0
  123. package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.d.ts +28 -0
  124. package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +36 -0
  125. package/runtime/node_modules/@deepseek-ai/dsh-computer-use/package.json +42 -0
  126. package/runtime/node_modules/@deepseek-ai/dsh-config-editor/lib/index.js +102 -14
  127. package/runtime/node_modules/@deepseek-ai/dsh-config-editor/lib/types/index.d.ts +34 -4
  128. package/runtime/node_modules/@deepseek-ai/dsh-config-editor/package.json +1 -0
  129. package/runtime/node_modules/@deepseek-ai/dsh-host-webserver/lib/index.js +2 -1
  130. package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/index.js +21 -8
  131. package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.d.ts +4 -6
  132. package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.js +18 -7
  133. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -8
  134. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/HeaderAction.d.ts +1 -1
  135. package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/index.js +5 -4
  136. package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/index.d.ts +4 -3
  137. package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/index.js +4 -3
  138. package/runtime/node_modules/@deepseek-ai/dsh-skill/lib/types/index.d.ts +1 -1
  139. package/runtime/node_modules/@deepseek-ai/dsh-skill-filesystem/lib/index.js +7 -1
  140. package/runtime/node_modules/@deepseek-ai/dsh-storage/lib/types/backend.d.ts +4 -0
  141. package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/index.js +60 -0
  142. package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/types/domain.d.ts +15 -0
  143. package/runtime/node_modules/@deepseek-ai/dsh-storage-json/lib/index.js +25 -0
  144. package/runtime/node_modules/@deepseek-ai/dsh-storage-json/package.json +1 -0
  145. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/index.js +5472 -0
  146. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/command-args.d.ts +17 -0
  147. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti/cicd.d.ts +8 -0
  148. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti/tianti.d.ts +7 -0
  149. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti-deliver/tianti-deliver.d.ts +8 -0
  150. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/config.d.ts +27 -0
  151. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/index.d.ts +12 -0
  152. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/memory-config.d.ts +10 -0
  153. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/runtime.d.ts +105 -0
  154. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/aliases.d.ts +11 -0
  155. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/auth.d.ts +20 -0
  156. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/client.d.ts +206 -0
  157. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/config.d.ts +20 -0
  158. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/index.d.ts +6 -0
  159. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/log.d.ts +16 -0
  160. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/types.d.ts +136 -0
  161. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/codebase.d.ts +19 -0
  162. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/dynamicWorkflow.d.ts +10 -0
  163. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/engine.d.ts +8 -0
  164. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/executor.d.ts +11 -0
  165. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/executors.d.ts +15 -0
  166. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/index.d.ts +23 -0
  167. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/memorySuggestions.d.ts +12 -0
  168. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/openspec.d.ts +31 -0
  169. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/recommend.d.ts +8 -0
  170. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/render.d.ts +8 -0
  171. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/requirementContext.d.ts +12 -0
  172. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/scenarioUpgrade.d.ts +24 -0
  173. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/state.d.ts +16 -0
  174. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/store.d.ts +33 -0
  175. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/templates.d.ts +8 -0
  176. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/types.d.ts +385 -0
  177. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/writeReviewSync.d.ts +6 -0
  178. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/index.d.ts +29 -0
  179. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/store.d.ts +20 -0
  180. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/types.d.ts +49 -0
  181. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/tools.d.ts +12 -0
  182. package/runtime/node_modules/@deepseek-ai/dsh-tianti/package.json +55 -0
  183. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +57 -13
  184. package/runtime/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +2 -1
  185. package/runtime/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +2 -1
  186. package/runtime/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +2 -1
  187. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-D5kpKf--.css +1 -0
  188. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Dz_cDcce.js +133 -0
  189. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Dz_cDcce.js.map +1 -0
  190. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-apple-touch-icon.png +0 -0
  191. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-icon-32.png +0 -0
  192. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-mask-icon.svg +1 -0
  193. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon-dark.svg +1 -3
  194. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.ico +0 -0
  195. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.svg +1 -3
  196. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +8 -4
  197. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/preview.html +8 -4
  198. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/package.json +2 -1
  199. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/index.js +110 -33
  200. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/entity.d.ts +6 -0
  201. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/entity.js +23 -17
  202. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.d.ts +10 -0
  203. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.js +95 -21
  204. package/lib/dump-config-DBW7YLx-.js +0 -2
  205. package/lib/tuiDisplayPrefs-BCHRRcfe.js +0 -162
  206. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DUvMhLle.css +0 -1
  207. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js +0 -127
  208. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js.map +0 -1
  209. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.md +0 -9
  210. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/bin/system.node +0 -0
  211. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/package.json +0 -31
  212. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/prebuilds.json +0 -6
  213. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.md +0 -9
  214. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-x64/package.json +0 -31
  215. package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-x64/prebuilds.json +0 -6
  216. package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.md +0 -11
  217. package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-arm64/package.json +0 -31
  218. package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-arm64/prebuilds.json +0 -24
  219. package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.md +0 -11
  220. package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-x64/package.json +0 -31
  221. package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-x64/prebuilds.json +0 -24
@@ -1,4 +1,4 @@
1
- import { r as INSTALL_ANCHOR, t as CHATCODE_PROFILE_TEMPLATES } from "./profile-boot-Blq7uqhx.js";
1
+ import { r as INSTALL_ANCHOR, t as CHATCODE_PROFILE_TEMPLATES } from "./profile-boot-BNQry1NM.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import { DEFAULT_PROFILE_BUNDLES, initProfile, readProfileCompatibility, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
4
4
  import { join } from "node:path";
@@ -1,8 +1,10 @@
1
1
  import { i as synchronizeLegacyHomeEnvironment, r as resolveChatCodeCliHome } from "./chatcode-home-B93iESZd.js";
2
+ import { n as startStartupPhase, r as traceStartupPlugins } from "./startup-diagnostics-C_hRCp-q.js";
3
+ import { n as registerWebInstance } from "./web-instance-DbP7IHPv.js";
2
4
  import { createRequire } from "node:module";
3
- import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
5
+ import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
4
6
  import { fileURLToPath } from "node:url";
5
- import { PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PluginPackages, boot, bundlePatchPaths, createRuntimeResolution, getDshRuntimeVersion, initProfile, installFailLoud, loadOverlayPatches, loadProfile, readProfilePatches, reportSkippedBundles, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
7
+ import { PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PluginPackages, boot, bundlePatchPaths, createRuntimeResolution, getDshRuntimeVersion, initProfile, installFailLoud, loadOverlayPatches, loadProfile, readProfileManifest, readProfilePatches, reportSkippedBundles, resolveProfileDir, writeProfileManifest } from "@deepseek-ai/dsh-app-boot";
6
8
  import { dirname, extname, join, resolve } from "node:path";
7
9
  import { installProxyFromEnvironment } from "@deepseek-ai/dsh-http-proxy";
8
10
  import { DSH_LAUNCH_ENVIRONMENT_KEY } from "@deepseek-ai/dsh-launch-environment";
@@ -71,6 +73,40 @@ function createProcessShutdown(dispose, forceExit = (code) => {
71
73
  };
72
74
  }
73
75
  //#endregion
76
+ //#region lib/types/permission-bypass.js
77
+ /** Process-local permission overrides for explicitly unrestricted CLI launches. */
78
+ /**
79
+ * Allow tool approval requests and remove file confinement until this root is disposed.
80
+ * Session permission events and saved profile settings remain unchanged, including on resume.
81
+ * ApprovalService still records its asked/decided pair and honors cancellation.
82
+ * @param ctx - profile root, before application plugins mount.
83
+ */
84
+ function installPermissionBypass(ctx) {
85
+ ctx.provide("chatcodePermissionBypass", true);
86
+ ctx.inject(["sandboxPolicy", "approval"], (child) => {
87
+ child.effect(() => {
88
+ const sandbox = child.sandboxPolicy;
89
+ const approval = child.approval;
90
+ const resolveDescriptor = Object.getOwnPropertyDescriptor(sandbox, "resolve");
91
+ const policyDescriptor = Object.getOwnPropertyDescriptor(approval, "overrideOf");
92
+ const resolve = sandbox.resolve.bind(sandbox);
93
+ sandbox.resolve = (request) => ({
94
+ ...resolve(request),
95
+ mode: "danger-full-access"
96
+ });
97
+ approval.overrideOf = () => "ask";
98
+ const releaseAnswerer = child.on("approval/request", (request) => Promise.resolve(request.signal?.aborted ? "cancelled" : "allowed-once"), { prepend: true });
99
+ return () => {
100
+ releaseAnswerer();
101
+ if (resolveDescriptor === void 0) Reflect.deleteProperty(sandbox, "resolve");
102
+ else Object.defineProperty(sandbox, "resolve", resolveDescriptor);
103
+ if (policyDescriptor === void 0) Reflect.deleteProperty(approval, "overrideOf");
104
+ else Object.defineProperty(approval, "overrideOf", policyDescriptor);
105
+ };
106
+ });
107
+ });
108
+ }
109
+ //#endregion
74
110
  //#region lib/types/profile-boot.js
75
111
  /**
76
112
  * Shared profile boot for every ChatCode CLI surface: resolve the profile, stack its
@@ -90,13 +126,15 @@ const CHATCODE_PROFILE_TEMPLATES = {
90
126
  web: { bundles: [
91
127
  "@deepseek-ai/dsh-base",
92
128
  "@deepseek-ai/dsh-web-app",
93
- "dshmarket"
129
+ "dshmarket",
130
+ "dsh-computer-use"
94
131
  ] },
95
132
  cli: { bundles: [
96
133
  "@deepseek-ai/dsh-base",
97
134
  "@deepseek-harness-tui/dsh-tui",
98
135
  "dsh-llm-chatcode-config",
99
- "dshmarket"
136
+ "dshmarket",
137
+ "dsh-computer-use"
100
138
  ] }
101
139
  };
102
140
  /** Exact compatibility bridge for ChatCode-owned releases qualified against this upstream runtime. */
@@ -110,6 +148,7 @@ const CHATCODE_PACKAGE_ALIASES = {
110
148
  "@chatcode/cco-better-sidebar": "dsh-better-sidebar",
111
149
  "@chatcode/cco-builtin-browser": "dsh-builtin-browser",
112
150
  "@chatcode/cco-chat-import": "dsh-chat-import",
151
+ "@chatcode/cco-computer-use": "dsh-computer-use",
113
152
  "@chatcode/cco-llm-chatcode-config": "dsh-llm-chatcode-config",
114
153
  "@chatcode/cco-market": "dshmarket"
115
154
  };
@@ -199,12 +238,20 @@ function homePatchPath() {
199
238
  }
200
239
  /** Absolute path of this dsh installation's package.json (both anchors: src/ and lib/ sit one level under apps/cli). */
201
240
  const INSTALL_ANCHOR = fileURLToPath(new URL("../package.json", import.meta.url));
202
- /** Return one fork-owned package staged inside the published launcher. */
203
- function embeddedRuntimePackageDir(packageName, installAnchor = INSTALL_ANCHOR) {
241
+ /** Read the installation mode once per embedded-runtime lookup or traversal. */
242
+ function embeddedRuntimeRoot(installAnchor) {
204
243
  if (JSON.parse(readFileSync(installAnchor, "utf8")).dependencies?.["@deepseek-ai/dsh-app-boot"]?.startsWith("workspace:") === true) return void 0;
205
- const packageDir = join(dirname(installAnchor), "runtime", "node_modules", ...packageName.split("/"));
244
+ return join(dirname(installAnchor), "runtime", "node_modules");
245
+ }
246
+ function embeddedPackageDir(packageName, runtimeRoot) {
247
+ const packageDir = join(runtimeRoot, ...packageName.split("/"));
206
248
  return existsSync(join(packageDir, "package.json")) ? packageDir : void 0;
207
249
  }
250
+ /** Return one fork-owned package staged inside the published launcher. */
251
+ function embeddedRuntimePackageDir(packageName, installAnchor = INSTALL_ANCHOR) {
252
+ const runtimeRoot = embeddedRuntimeRoot(installAnchor);
253
+ return runtimeRoot === void 0 ? void 0 : embeddedPackageDir(packageName, runtimeRoot);
254
+ }
208
255
  /** Prefer a staged fork manifest while retaining source-checkout and old-package compatibility. */
209
256
  function installedPackageManifest(packageName, installAnchor) {
210
257
  const embedded = embeddedRuntimePackageDir(packageName, installAnchor);
@@ -213,8 +260,10 @@ function installedPackageManifest(packageName, installAnchor) {
213
260
  }
214
261
  /** Re-anchor shipped bundle patches at their staged fork implementations. */
215
262
  function preferEmbeddedProfileLayers(profile, installAnchor = INSTALL_ANCHOR) {
263
+ const runtimeRoot = embeddedRuntimeRoot(installAnchor);
264
+ if (runtimeRoot === void 0) return profile;
216
265
  const layers = profile.layers.map((layer) => {
217
- const packageDir = embeddedRuntimePackageDir(layer.packageName, installAnchor);
266
+ const packageDir = embeddedPackageDir(layer.packageName, runtimeRoot);
218
267
  if (packageDir === void 0 || packageDir === layer.packageDir) return layer;
219
268
  const declaredPatch = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf8")).dsh?.bundle?.patch;
220
269
  if (declaredPatch === void 0) return layer;
@@ -233,9 +282,11 @@ function preferEmbeddedProfileLayers(profile, installAnchor = INSTALL_ANCHOR) {
233
282
  }
234
283
  /** Point the loader interception table at staged fork packages. */
235
284
  function preferEmbeddedRuntimeResolution(resolution, installAnchor = INSTALL_ANCHOR) {
285
+ const runtimeRoot = embeddedRuntimeRoot(installAnchor);
286
+ if (runtimeRoot === void 0) return resolution;
236
287
  let changed = false;
237
288
  const entries = resolution.entries.map((entry) => {
238
- const packageDir = embeddedRuntimePackageDir(entry.name, installAnchor);
289
+ const packageDir = embeddedPackageDir(entry.name, runtimeRoot);
239
290
  if (packageDir === void 0) return entry;
240
291
  const declarer = join(packageDir, "package.json");
241
292
  if (packageDir === entry.packageDir && entry.declarer === declarer && entry.scope === "installation") return entry;
@@ -257,7 +308,7 @@ function preferEmbeddedRuntimeResolution(resolution, installAnchor = INSTALL_ANC
257
308
  const embeddedEntries = [];
258
309
  for (const name of packageNames) {
259
310
  if (known.has(name)) continue;
260
- const packageDir = embeddedRuntimePackageDir(name, installAnchor);
311
+ const packageDir = embeddedPackageDir(name, runtimeRoot);
261
312
  if (packageDir === void 0) continue;
262
313
  const manifest = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf8"));
263
314
  embeddedEntries.push(Object.freeze({
@@ -349,6 +400,21 @@ function chatCodeProfilePatchFiles(profile, installAnchor = INSTALL_ANCHOR) {
349
400
  return path;
350
401
  });
351
402
  }
403
+ /**
404
+ * Deduplicate overlay files shared by startup, YAML dumps, and schema dumps.
405
+ * @param files - product and command-line overlay paths, in application order.
406
+ * @returns absolute paths in first-occurrence order, preserving relative-resource bases;
407
+ * missing files remain in the result for the patch loader to diagnose.
408
+ */
409
+ function uniqueProfilePatchFiles(files) {
410
+ const unique = /* @__PURE__ */ new Map();
411
+ for (const patchFile of files) {
412
+ const file = resolve(patchFile);
413
+ const identity = existsSync(file) ? realpathSync(file) : file;
414
+ if (!unique.has(identity)) unique.set(identity, file);
415
+ }
416
+ return [...unique.values()];
417
+ }
352
418
  /** Resolve embedded compatibility plugins from the active source or built CLI tree. */
353
419
  function resolveEmbeddedHeadlessCompat(patches) {
354
420
  const extension = extname(fileURLToPath(import.meta.url)) === ".ts" ? ".ts" : ".js";
@@ -427,6 +493,20 @@ function prepareProfile(name, userLayer = true, fromDefaultProfile) {
427
493
  const dir = resolveProfileDir(name, home);
428
494
  const template = Object.hasOwn(CHATCODE_PROFILE_TEMPLATES, name) ? CHATCODE_PROFILE_TEMPLATES[name] : void 0;
429
495
  if (template !== void 0 && !existsSync(join(dir, "package.json"))) initProfile(dir, template.bundles);
496
+ if (name === "web" || name === "cli") {
497
+ const manifest = readProfileManifest(NAME, dir);
498
+ const bundles = manifest.dsh?.profile?.bundles;
499
+ if (bundles?.includes("@deepseek-ai/dsh-base") && !bundles.includes("dsh-computer-use")) writeProfileManifest(dir, {
500
+ ...manifest,
501
+ dsh: {
502
+ ...manifest.dsh,
503
+ profile: {
504
+ ...manifest.dsh?.profile,
505
+ bundles: [...bundles, "dsh-computer-use"]
506
+ }
507
+ }
508
+ });
509
+ }
430
510
  const profile = preferEmbeddedProfileLayers(restoreTrustedTuiLayer(loadProfile(NAME, name, INSTALL_ANCHOR, home, {
431
511
  pluginCommand: "chatcode-cli",
432
512
  trustedVersionExemptions: CHATCODE_TRUSTED_VERSION_EXEMPTIONS,
@@ -457,8 +537,7 @@ async function composeProfile(name, patchFiles, fromDefaultProfile, resolvedProf
457
537
  profile
458
538
  };
459
539
  const resolution = preferEmbeddedRuntimeResolution(await createRuntimeResolution(resolutionOptions), resolutionOptions.installAnchor);
460
- const productPatchFiles = resolvedProfile === void 0 ? chatCodeProfilePatchFiles(name, INSTALL_ANCHOR) : [];
461
- const uniquePatchFiles = [...new Set([...productPatchFiles, ...patchFiles].map((file) => resolve(file)))];
540
+ const uniquePatchFiles = uniqueProfilePatchFiles([...resolvedProfile === void 0 ? chatCodeProfilePatchFiles(name, INSTALL_ANCHOR) : [], ...patchFiles]);
462
541
  const ownCompatPatch = resolve(join(dirname(INSTALL_ANCHOR), "headless-compat.cordis.patch.yml"));
463
542
  return {
464
543
  profile,
@@ -478,9 +557,11 @@ async function composeProfile(name, patchFiles, fromDefaultProfile, resolvedProf
478
557
  */
479
558
  async function runProfile(options) {
480
559
  synchronizeLegacyHomeEnvironment();
560
+ const finishProxy = startStartupPhase("proxy-setup");
481
561
  const disposeProxy = await installProxyFromEnvironment(options.environment, (message) => {
482
562
  process.stderr.write(`${NAME}: ${message}\n`);
483
563
  });
564
+ finishProxy();
484
565
  const app = {};
485
566
  let disposal;
486
567
  const dispose = () => disposal ??= (async () => {
@@ -494,7 +575,9 @@ async function runProfile(options) {
494
575
  if (failures.length > 1) throw new AggregateError(failures, "dsh: profile cleanup failed");
495
576
  })();
496
577
  try {
578
+ const finishComposition = startStartupPhase("profile-composition");
497
579
  const composed = await composeProfile(options.profile, options.patchFiles, options.fromDefaultProfile, options.resolvedProfile);
580
+ finishComposition();
498
581
  const appReady = createAppReady();
499
582
  const shutdown = createProcessShutdown(dispose);
500
583
  const signalShutdown = new AbortController();
@@ -522,12 +605,18 @@ async function runProfile(options) {
522
605
  cwd: process.cwd(),
523
606
  home: resolveChatCodeCliHome(),
524
607
  overlays: composed.overlays,
608
+ transformPatches: resolveChatCodePackageAliases,
525
609
  trustedVersionExemptions: CHATCODE_TRUSTED_VERSION_EXEMPTIONS,
526
610
  telemetryDisabledEnv: process.env.DSH_TELEMETRY_DISABLED
527
611
  };
528
- const ctx = await boot(NAME, rootConfig, resolveChatCodePackageAliases(readProfilePatches(NAME, profileContext, composed.profile)), async (hostCtx) => {
612
+ const patches = readProfilePatches(NAME, profileContext, composed.profile);
613
+ const finishActivation = startStartupPhase("plugin-activation");
614
+ let stopPluginTrace;
615
+ const ctx = await boot(NAME, rootConfig, patches, async (hostCtx) => {
616
+ stopPluginTrace = traceStartupPlugins(hostCtx);
529
617
  app.current = hostCtx;
530
618
  installProfileInvocationAccessor(hostCtx);
619
+ if (options.dangerouslySkipPermissions === true) installPermissionBypass(hostCtx);
531
620
  hostCtx.provide("profileContext", profileContext);
532
621
  hostCtx.provide(DSH_LAUNCH_ENVIRONMENT_KEY, options.environment);
533
622
  await hostCtx.plugin(PluginPackages, { resolution: composed.resolution });
@@ -536,9 +625,15 @@ async function runProfile(options) {
536
625
  exit: (code) => void shutdown.shutdown(code),
537
626
  ready: appReady.service
538
627
  });
628
+ }).finally(() => {
629
+ stopPluginTrace?.();
539
630
  });
631
+ finishActivation();
540
632
  app.current = ctx;
541
633
  if (!signalShutdown.signal.aborted && ctx.fiber.state === 2 && ctx.get("loader") !== void 0) appReady.commit();
634
+ if (options.webInstance !== void 0 && !signalShutdown.signal.aborted) await registerWebInstance(ctx, options.webInstance, () => {
635
+ shutdown.interrupt(0);
636
+ });
542
637
  return {
543
638
  ctx,
544
639
  shutdown
@@ -553,4 +648,4 @@ async function runProfile(options) {
553
648
  }
554
649
  }
555
650
  //#endregion
556
- export { chatCodeProfilePatchFiles as a, initializeProfileFromDefault as c, preferEmbeddedRuntimeResolution as d, prepareProfile as f, runProfile as h, PROFILE_ROOT_FILENAME as i, installProfileInvocationAccessor as l, restoreTrustedTuiLayer as m, CHATCODE_TRUSTED_VERSION_EXEMPTIONS as n, embeddedRuntimePackageDir as o, resolveChatCodePackageAliases as p, INSTALL_ANCHOR as r, homePatchPath as s, CHATCODE_PROFILE_TEMPLATES as t, preferEmbeddedProfileLayers as u };
651
+ export { chatCodeProfilePatchFiles as a, initializeProfileFromDefault as c, preferEmbeddedRuntimeResolution as d, prepareProfile as f, uniqueProfilePatchFiles as g, runProfile as h, PROFILE_ROOT_FILENAME as i, installProfileInvocationAccessor as l, restoreTrustedTuiLayer as m, CHATCODE_TRUSTED_VERSION_EXEMPTIONS as n, embeddedRuntimePackageDir as o, resolveChatCodePackageAliases as p, INSTALL_ANCHOR as r, homePatchPath as s, CHATCODE_PROFILE_TEMPLATES as t, preferEmbeddedProfileLayers as u };
@@ -1,2 +1,2 @@
1
- import { a as chatCodeProfilePatchFiles, c as initializeProfileFromDefault, d as preferEmbeddedRuntimeResolution, f as prepareProfile, h as runProfile, i as PROFILE_ROOT_FILENAME, l as installProfileInvocationAccessor, m as restoreTrustedTuiLayer, n as CHATCODE_TRUSTED_VERSION_EXEMPTIONS, o as embeddedRuntimePackageDir, p as resolveChatCodePackageAliases, r as INSTALL_ANCHOR, s as homePatchPath, t as CHATCODE_PROFILE_TEMPLATES, u as preferEmbeddedProfileLayers } from "./profile-boot-Blq7uqhx.js";
2
- export { CHATCODE_PROFILE_TEMPLATES, CHATCODE_TRUSTED_VERSION_EXEMPTIONS, INSTALL_ANCHOR, PROFILE_ROOT_FILENAME, chatCodeProfilePatchFiles, embeddedRuntimePackageDir, homePatchPath, initializeProfileFromDefault, installProfileInvocationAccessor, preferEmbeddedProfileLayers, preferEmbeddedRuntimeResolution, prepareProfile, resolveChatCodePackageAliases, restoreTrustedTuiLayer, runProfile };
1
+ import { a as chatCodeProfilePatchFiles, c as initializeProfileFromDefault, d as preferEmbeddedRuntimeResolution, f as prepareProfile, g as uniqueProfilePatchFiles, h as runProfile, i as PROFILE_ROOT_FILENAME, l as installProfileInvocationAccessor, m as restoreTrustedTuiLayer, n as CHATCODE_TRUSTED_VERSION_EXEMPTIONS, o as embeddedRuntimePackageDir, p as resolveChatCodePackageAliases, r as INSTALL_ANCHOR, s as homePatchPath, t as CHATCODE_PROFILE_TEMPLATES, u as preferEmbeddedProfileLayers } from "./profile-boot-BNQry1NM.js";
2
+ export { CHATCODE_PROFILE_TEMPLATES, CHATCODE_TRUSTED_VERSION_EXEMPTIONS, INSTALL_ANCHOR, PROFILE_ROOT_FILENAME, chatCodeProfilePatchFiles, embeddedRuntimePackageDir, homePatchPath, initializeProfileFromDefault, installProfileInvocationAccessor, preferEmbeddedProfileLayers, preferEmbeddedRuntimeResolution, prepareProfile, resolveChatCodePackageAliases, restoreTrustedTuiLayer, runProfile, uniqueProfilePatchFiles };
@@ -1,7 +1,7 @@
1
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-CmD27uhQ.js";
2
- import { n as componentIdentityOf } from "./component-identity-CnmIKHEF.js";
1
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-Bk4xps5E.js";
2
+ import { n as componentIdentityOf } from "./component-identity-De91VHwW.js";
3
3
  import { Service } from "@deepseek-ai/cordis";
4
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.9_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/scenes.js
4
+ //#region ../../../dsh-TUI/lib/types/dsh-adapter/scenes.js
5
5
  /** Provider-neutral full-screen scene registry for terminal front doors. */
6
6
  const name = "dsh-tui-scenes";
7
7
  /**
@@ -1,6 +1,6 @@
1
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-CmD27uhQ.js";
1
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-Bk4xps5E.js";
2
2
  import { Service } from "@deepseek-ai/cordis";
3
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.9_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/credentialRefGuard.js
3
+ //#region ../../../dsh-TUI/lib/types/dsh-adapter/credentialRefGuard.js
4
4
  /**
5
5
  * Credential-ref reservation guard for the plugin settings-section seam.
6
6
  *
@@ -49,7 +49,7 @@ function vetSectionSecretRefs(section) {
49
49
  };
50
50
  }
51
51
  //#endregion
52
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.9_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/settings-sections.js
52
+ //#region ../../../dsh-TUI/lib/types/dsh-adapter/settings-sections.js
53
53
  /**
54
54
  * Plugin settings-section extension seam for terminal front doors.
55
55
  *
@@ -157,6 +157,10 @@ function registerSection(runtime, section, owner) {
157
157
  path: Object.freeze([...field.path]),
158
158
  descriptions: field.descriptions === void 0 ? void 0 : Object.freeze({ ...field.descriptions }),
159
159
  hintDescriptions: field.hintDescriptions === void 0 ? void 0 : Object.freeze({ ...field.hintDescriptions }),
160
+ confirmEnable: field.confirmEnable === void 0 ? void 0 : Object.freeze({
161
+ ...field.confirmEnable,
162
+ descriptions: field.confirmEnable.descriptions === void 0 ? void 0 : Object.freeze({ ...field.confirmEnable.descriptions })
163
+ }),
160
164
  options: field.options === void 0 ? void 0 : Object.freeze(field.options.map((option) => Object.freeze({
161
165
  ...option,
162
166
  descriptions: option.descriptions === void 0 ? void 0 : Object.freeze({ ...option.descriptions })
@@ -0,0 +1,91 @@
1
+ import { join } from "node:path";
2
+ import { randomUUID } from "node:crypto";
3
+ import { mkdir, writeFile } from "node:fs/promises";
4
+ import { inspect } from "node:util";
5
+ //#region lib/types/startup-diagnostics.js
6
+ /** Save original startup diagnostics while keeping the terminal report concise. */
7
+ /**
8
+ * Trace one startup phase to stderr when CHATCODE_CLI_STARTUP_TRACE=1.
9
+ * @param phase - launcher-owned label; exclude paths, arguments and configuration values.
10
+ * @returns a callback recording the elapsed milliseconds when the phase completes.
11
+ */
12
+ function startStartupPhase(phase) {
13
+ if (process.env.CHATCODE_CLI_STARTUP_TRACE !== "1") return () => {};
14
+ const started = performance.now();
15
+ process.stderr.write(`[cco-startup] ${phase}: begin\n`);
16
+ return () => {
17
+ process.stderr.write(`[cco-startup] ${phase}: ${(performance.now() - started).toFixed(1)} ms\n`);
18
+ };
19
+ }
20
+ /**
21
+ * Trace plugin activation until the launcher's initial boot settles.
22
+ * @param ctx - the root context before profile entries mount.
23
+ * @returns the listener disposer; call before handing control to the interactive surface.
24
+ */
25
+ function traceStartupPlugins(ctx) {
26
+ if (process.env.CHATCODE_CLI_STARTUP_TRACE !== "1") return () => {};
27
+ const pending = /* @__PURE__ */ new Map();
28
+ return ctx.on("internal/status", (fiber) => {
29
+ if (fiber.state === 1) pending.set(fiber, startStartupPhase(`plugin/${fiber.name}`));
30
+ else {
31
+ pending.get(fiber)?.();
32
+ pending.delete(fiber);
33
+ }
34
+ }, { global: true });
35
+ }
36
+ /** Wait for stderr to finish the write before the failed process exits. */
37
+ function writeStderr(text) {
38
+ return new Promise((resolve, reject) => {
39
+ process.stderr.write(text, (error) => {
40
+ if (error) reject(error);
41
+ else resolve();
42
+ });
43
+ });
44
+ }
45
+ /**
46
+ * Print the startup summary and save a private, uniquely named report under DSH_HOME/logs.
47
+ * Failed writes print the complete report to stderr instead of claiming a saved path.
48
+ * @param error - startup audit failure retaining plugin metadata and original errors.
49
+ * @param context - resolved Harness home, application version, and selected profile.
50
+ * @param write - terminal output sink; awaited before returning, defaults to stderr.
51
+ * @returns after saving or printing the report and completing terminal writes.
52
+ */
53
+ async function reportStartupFailure(error, context, write = writeStderr) {
54
+ const now = (/* @__PURE__ */ new Date()).toISOString();
55
+ const report = "WARNING: Raw diagnostics may contain configuration or credential values from plugin errors. Review before sharing.\n\n" + inspect({
56
+ timestamp: now,
57
+ dshVersion: context.version,
58
+ nodeVersion: process.version,
59
+ platform: process.platform,
60
+ arch: process.arch,
61
+ profile: context.profile,
62
+ error
63
+ }, {
64
+ depth: null,
65
+ maxArrayLength: null,
66
+ maxStringLength: null,
67
+ showHidden: true,
68
+ customInspect: false,
69
+ getters: false,
70
+ colors: false
71
+ }) + "\n";
72
+ await write(`${error.message}\n`);
73
+ const logDir = join(context.home, "logs");
74
+ const logPath = join(logDir, `startup-${now.replaceAll(":", "-")}-${randomUUID()}.log`);
75
+ try {
76
+ await mkdir(logDir, {
77
+ recursive: true,
78
+ mode: 448
79
+ });
80
+ await writeFile(logPath, report, {
81
+ flag: "wx",
82
+ mode: 384
83
+ });
84
+ } catch (writeError) {
85
+ await write(`\ndsh: warning: could not write startup diagnostics: ${String(writeError)}\nFull diagnostics:\n${report}`);
86
+ return;
87
+ }
88
+ await write(`\nFull diagnostics: ${logPath}\n`);
89
+ }
90
+ //#endregion
91
+ export { startStartupPhase as n, traceStartupPlugins as r, reportStartupFailure as t };