@askdkc/dsh-cli 0.11.3

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 (1978) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +321 -0
  3. package/bin/dsh-tui.js +1366 -0
  4. package/cordis.patch.yml +482 -0
  5. package/cordis.yml +250 -0
  6. package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
  7. package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
  8. package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
  9. package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
  10. package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
  11. package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
  12. package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
  13. package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
  14. package/dsh-ecosystem-spec/registry/README.md +14 -0
  15. package/dsh-ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
  16. package/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
  17. package/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
  18. package/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
  19. package/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
  20. package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
  21. package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -0
  22. package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
  23. package/dsh-ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
  24. package/dsh-ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
  25. package/dsh-ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
  26. package/lib/types/activityPrefs.d.ts +63 -0
  27. package/lib/types/activityPrefs.d.ts.map +1 -0
  28. package/lib/types/activityPrefs.js +126 -0
  29. package/lib/types/adapter/channel/actions.d.ts +17 -0
  30. package/lib/types/adapter/channel/actions.d.ts.map +1 -0
  31. package/lib/types/adapter/channel/actions.js +28 -0
  32. package/lib/types/adapter/channel/consumer.d.ts +34 -0
  33. package/lib/types/adapter/channel/consumer.d.ts.map +1 -0
  34. package/lib/types/adapter/channel/consumer.js +87 -0
  35. package/lib/types/adapter/channel/features.d.ts +12 -0
  36. package/lib/types/adapter/channel/features.d.ts.map +1 -0
  37. package/lib/types/adapter/channel/features.js +41 -0
  38. package/lib/types/adapter/channel/host-registry.d.ts +40 -0
  39. package/lib/types/adapter/channel/host-registry.d.ts.map +1 -0
  40. package/lib/types/adapter/channel/host-registry.js +120 -0
  41. package/lib/types/adapter/channel/index.d.ts +22 -0
  42. package/lib/types/adapter/channel/index.d.ts.map +1 -0
  43. package/lib/types/adapter/channel/index.js +21 -0
  44. package/lib/types/adapter/channel/internal-token.d.ts +12 -0
  45. package/lib/types/adapter/channel/internal-token.d.ts.map +1 -0
  46. package/lib/types/adapter/channel/internal-token.js +11 -0
  47. package/lib/types/adapter/channel/plugins.d.ts +17 -0
  48. package/lib/types/adapter/channel/plugins.d.ts.map +1 -0
  49. package/lib/types/adapter/channel/plugins.js +47 -0
  50. package/lib/types/adapter/channel/projection.d.ts +15 -0
  51. package/lib/types/adapter/channel/projection.d.ts.map +1 -0
  52. package/lib/types/adapter/channel/projection.js +59 -0
  53. package/lib/types/adapter/channel/provider.d.ts +52 -0
  54. package/lib/types/adapter/channel/provider.d.ts.map +1 -0
  55. package/lib/types/adapter/channel/provider.js +231 -0
  56. package/lib/types/adapter/channel/read-view.d.ts +4 -0
  57. package/lib/types/adapter/channel/read-view.d.ts.map +1 -0
  58. package/lib/types/adapter/channel/read-view.js +132 -0
  59. package/lib/types/adapter/channel/session-projection.d.ts +56 -0
  60. package/lib/types/adapter/channel/session-projection.d.ts.map +1 -0
  61. package/lib/types/adapter/channel/session-projection.js +249 -0
  62. package/lib/types/adapter/channel/state.d.ts +11 -0
  63. package/lib/types/adapter/channel/state.d.ts.map +1 -0
  64. package/lib/types/adapter/channel/state.js +57 -0
  65. package/lib/types/adapter/channel/transcript.d.ts +15 -0
  66. package/lib/types/adapter/channel/transcript.d.ts.map +1 -0
  67. package/lib/types/adapter/channel/transcript.js +22 -0
  68. package/lib/types/adapter/channel/ui-policy.d.ts +109 -0
  69. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -0
  70. package/lib/types/adapter/channel/ui-policy.js +170 -0
  71. package/lib/types/adapter/channel/ui.d.ts +16 -0
  72. package/lib/types/adapter/channel/ui.d.ts.map +1 -0
  73. package/lib/types/adapter/channel/ui.js +173 -0
  74. package/lib/types/adapter/index.d.ts +20 -0
  75. package/lib/types/adapter/index.d.ts.map +1 -0
  76. package/lib/types/adapter/index.js +19 -0
  77. package/lib/types/adapter/kernel/contract-catalog.d.ts +12 -0
  78. package/lib/types/adapter/kernel/contract-catalog.d.ts.map +1 -0
  79. package/lib/types/adapter/kernel/contract-catalog.js +11 -0
  80. package/lib/types/adapter/kernel/diagnostics.d.ts +18 -0
  81. package/lib/types/adapter/kernel/diagnostics.d.ts.map +1 -0
  82. package/lib/types/adapter/kernel/diagnostics.js +16 -0
  83. package/lib/types/adapter/kernel/driver-types.d.ts +16 -0
  84. package/lib/types/adapter/kernel/driver-types.d.ts.map +1 -0
  85. package/lib/types/adapter/kernel/driver-types.js +8 -0
  86. package/lib/types/adapter/kernel/host-facade.d.ts +65 -0
  87. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -0
  88. package/lib/types/adapter/kernel/host-facade.js +216 -0
  89. package/lib/types/adapter/kernel/host-probe-access.d.ts +71 -0
  90. package/lib/types/adapter/kernel/host-probe-access.d.ts.map +1 -0
  91. package/lib/types/adapter/kernel/host-probe-access.js +121 -0
  92. package/lib/types/adapter/kernel/index.d.ts +20 -0
  93. package/lib/types/adapter/kernel/index.d.ts.map +1 -0
  94. package/lib/types/adapter/kernel/index.js +19 -0
  95. package/lib/types/adapter/kernel/kernel-runtime.d.ts +138 -0
  96. package/lib/types/adapter/kernel/kernel-runtime.d.ts.map +1 -0
  97. package/lib/types/adapter/kernel/kernel-runtime.js +572 -0
  98. package/lib/types/adapter/kernel/ledger.d.ts +55 -0
  99. package/lib/types/adapter/kernel/ledger.d.ts.map +1 -0
  100. package/lib/types/adapter/kernel/ledger.js +33 -0
  101. package/lib/types/adapter/kernel/legacy-facade.d.ts +22 -0
  102. package/lib/types/adapter/kernel/legacy-facade.d.ts.map +1 -0
  103. package/lib/types/adapter/kernel/legacy-facade.js +34 -0
  104. package/lib/types/adapter/kernel/lifecycle.d.ts +38 -0
  105. package/lib/types/adapter/kernel/lifecycle.d.ts.map +1 -0
  106. package/lib/types/adapter/kernel/lifecycle.js +53 -0
  107. package/lib/types/adapter/kernel/replay-isolation.d.ts +27 -0
  108. package/lib/types/adapter/kernel/replay-isolation.d.ts.map +1 -0
  109. package/lib/types/adapter/kernel/replay-isolation.js +45 -0
  110. package/lib/types/adapter/kernel/replay.d.ts +132 -0
  111. package/lib/types/adapter/kernel/replay.d.ts.map +1 -0
  112. package/lib/types/adapter/kernel/replay.js +428 -0
  113. package/lib/types/adapter/kernel/runtime-context.d.ts +15 -0
  114. package/lib/types/adapter/kernel/runtime-context.d.ts.map +1 -0
  115. package/lib/types/adapter/kernel/runtime-context.js +24 -0
  116. package/lib/types/adapter/kernel/runtime.d.ts +70 -0
  117. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -0
  118. package/lib/types/adapter/kernel/runtime.js +327 -0
  119. package/lib/types/adapter/kernel/slices/channel.d.ts +3 -0
  120. package/lib/types/adapter/kernel/slices/channel.d.ts.map +1 -0
  121. package/lib/types/adapter/kernel/slices/channel.js +8 -0
  122. package/lib/types/adapter/kernel/slices/decisions.d.ts +3 -0
  123. package/lib/types/adapter/kernel/slices/decisions.d.ts.map +1 -0
  124. package/lib/types/adapter/kernel/slices/decisions.js +10 -0
  125. package/lib/types/adapter/kernel/slices/extensions.d.ts +8 -0
  126. package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -0
  127. package/lib/types/adapter/kernel/slices/extensions.js +43 -0
  128. package/lib/types/adapter/kernel/slices/index.d.ts +19 -0
  129. package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -0
  130. package/lib/types/adapter/kernel/slices/index.js +36 -0
  131. package/lib/types/adapter/kernel/slices/presentation.d.ts +3 -0
  132. package/lib/types/adapter/kernel/slices/presentation.d.ts.map +1 -0
  133. package/lib/types/adapter/kernel/slices/presentation.js +14 -0
  134. package/lib/types/adapter/kernel/slices/scenes.d.ts +3 -0
  135. package/lib/types/adapter/kernel/slices/scenes.d.ts.map +1 -0
  136. package/lib/types/adapter/kernel/slices/scenes.js +14 -0
  137. package/lib/types/adapter/kernel/slices/settings.d.ts +3 -0
  138. package/lib/types/adapter/kernel/slices/settings.d.ts.map +1 -0
  139. package/lib/types/adapter/kernel/slices/settings.js +12 -0
  140. package/lib/types/adapter/kernel/slices/types.d.ts +20 -0
  141. package/lib/types/adapter/kernel/slices/types.d.ts.map +1 -0
  142. package/lib/types/adapter/kernel/slices/types.js +12 -0
  143. package/lib/types/adapter/kernel/slices/workspace.d.ts +3 -0
  144. package/lib/types/adapter/kernel/slices/workspace.d.ts.map +1 -0
  145. package/lib/types/adapter/kernel/slices/workspace.js +16 -0
  146. package/lib/types/adapter/ports/channel-catalog.d.ts +90 -0
  147. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -0
  148. package/lib/types/adapter/ports/channel-catalog.js +2 -0
  149. package/lib/types/adapter/ports/channel-display.d.ts +90 -0
  150. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -0
  151. package/lib/types/adapter/ports/channel-display.js +2 -0
  152. package/lib/types/adapter/ports/channel-session.d.ts +229 -0
  153. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -0
  154. package/lib/types/adapter/ports/channel-session.js +2 -0
  155. package/lib/types/adapter/ports/channel-settings.d.ts +279 -0
  156. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -0
  157. package/lib/types/adapter/ports/channel-settings.js +1 -0
  158. package/lib/types/adapter/ports/channel-ui.d.ts +593 -0
  159. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -0
  160. package/lib/types/adapter/ports/channel-ui.js +1 -0
  161. package/lib/types/adapter/ports/channel-view.d.ts +663 -0
  162. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -0
  163. package/lib/types/adapter/ports/channel-view.js +2 -0
  164. package/lib/types/adapter/ports/channel-workspace.d.ts +68 -0
  165. package/lib/types/adapter/ports/channel-workspace.d.ts.map +1 -0
  166. package/lib/types/adapter/ports/channel-workspace.js +2 -0
  167. package/lib/types/adapter/ports/channel.d.ts +148 -0
  168. package/lib/types/adapter/ports/channel.d.ts.map +1 -0
  169. package/lib/types/adapter/ports/channel.js +22 -0
  170. package/lib/types/adapter/ports/decisions.d.ts +18 -0
  171. package/lib/types/adapter/ports/decisions.d.ts.map +1 -0
  172. package/lib/types/adapter/ports/decisions.js +9 -0
  173. package/lib/types/adapter/ports/descriptor.d.ts +25 -0
  174. package/lib/types/adapter/ports/descriptor.d.ts.map +1 -0
  175. package/lib/types/adapter/ports/descriptor.js +11 -0
  176. package/lib/types/adapter/ports/extensions.d.ts +86 -0
  177. package/lib/types/adapter/ports/extensions.d.ts.map +1 -0
  178. package/lib/types/adapter/ports/extensions.js +9 -0
  179. package/lib/types/adapter/ports/index.d.ts +23 -0
  180. package/lib/types/adapter/ports/index.d.ts.map +1 -0
  181. package/lib/types/adapter/ports/index.js +14 -0
  182. package/lib/types/adapter/ports/owner.d.ts +19 -0
  183. package/lib/types/adapter/ports/owner.d.ts.map +1 -0
  184. package/lib/types/adapter/ports/owner.js +9 -0
  185. package/lib/types/adapter/ports/presentation.d.ts +81 -0
  186. package/lib/types/adapter/ports/presentation.d.ts.map +1 -0
  187. package/lib/types/adapter/ports/presentation.js +10 -0
  188. package/lib/types/adapter/ports/scenes.d.ts +24 -0
  189. package/lib/types/adapter/ports/scenes.d.ts.map +1 -0
  190. package/lib/types/adapter/ports/scenes.js +8 -0
  191. package/lib/types/adapter/ports/settings.d.ts +44 -0
  192. package/lib/types/adapter/ports/settings.d.ts.map +1 -0
  193. package/lib/types/adapter/ports/settings.js +9 -0
  194. package/lib/types/adapter/ports/workspace.d.ts +62 -0
  195. package/lib/types/adapter/ports/workspace.d.ts.map +1 -0
  196. package/lib/types/adapter/ports/workspace.js +8 -0
  197. package/lib/types/adapter/spec/index.d.ts +11 -0
  198. package/lib/types/adapter/spec/index.d.ts.map +1 -0
  199. package/lib/types/adapter/spec/index.js +10 -0
  200. package/lib/types/adapter/spec/profile.d.ts +10 -0
  201. package/lib/types/adapter/spec/profile.d.ts.map +1 -0
  202. package/lib/types/adapter/spec/profile.js +9 -0
  203. package/lib/types/adapter/spec/protocol-constants.d.ts +60 -0
  204. package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -0
  205. package/lib/types/adapter/spec/protocol-constants.js +129 -0
  206. package/lib/types/adapter/spec/tui-contributions.d.ts +18 -0
  207. package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -0
  208. package/lib/types/adapter/spec/tui-contributions.js +19 -0
  209. package/lib/types/adapter/standard/admission.d.ts +11 -0
  210. package/lib/types/adapter/standard/admission.d.ts.map +1 -0
  211. package/lib/types/adapter/standard/admission.js +10 -0
  212. package/lib/types/adapter/standard/descriptor.d.ts +74 -0
  213. package/lib/types/adapter/standard/descriptor.d.ts.map +1 -0
  214. package/lib/types/adapter/standard/descriptor.js +356 -0
  215. package/lib/types/adapter/standard/grants.d.ts +30 -0
  216. package/lib/types/adapter/standard/grants.d.ts.map +1 -0
  217. package/lib/types/adapter/standard/grants.js +219 -0
  218. package/lib/types/adapter/standard/index.d.ts +25 -0
  219. package/lib/types/adapter/standard/index.d.ts.map +1 -0
  220. package/lib/types/adapter/standard/index.js +24 -0
  221. package/lib/types/adapter/standard/negotiate.d.ts +11 -0
  222. package/lib/types/adapter/standard/negotiate.d.ts.map +1 -0
  223. package/lib/types/adapter/standard/negotiate.js +97 -0
  224. package/lib/types/adapter/standard/permission-scope.d.ts +27 -0
  225. package/lib/types/adapter/standard/permission-scope.d.ts.map +1 -0
  226. package/lib/types/adapter/standard/permission-scope.js +68 -0
  227. package/lib/types/adapter/standard/protocols.d.ts +12 -0
  228. package/lib/types/adapter/standard/protocols.d.ts.map +1 -0
  229. package/lib/types/adapter/standard/protocols.js +11 -0
  230. package/lib/types/adapter/standard/registry.d.ts +23 -0
  231. package/lib/types/adapter/standard/registry.d.ts.map +1 -0
  232. package/lib/types/adapter/standard/registry.js +240 -0
  233. package/lib/types/adapter/standard/schema-check.d.ts +17 -0
  234. package/lib/types/adapter/standard/schema-check.d.ts.map +1 -0
  235. package/lib/types/adapter/standard/schema-check.js +167 -0
  236. package/lib/types/adapter/standard/tui-extension.d.ts +25 -0
  237. package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -0
  238. package/lib/types/adapter/standard/tui-extension.js +45 -0
  239. package/lib/types/adapter/standard/types.d.ts +108 -0
  240. package/lib/types/adapter/standard/types.d.ts.map +1 -0
  241. package/lib/types/adapter/standard/types.js +10 -0
  242. package/lib/types/adapter/standard/validate.d.ts +21 -0
  243. package/lib/types/adapter/standard/validate.d.ts.map +1 -0
  244. package/lib/types/adapter/standard/validate.js +139 -0
  245. package/lib/types/adapter/upstream/channel-driver.d.ts +22 -0
  246. package/lib/types/adapter/upstream/channel-driver.d.ts.map +1 -0
  247. package/lib/types/adapter/upstream/channel-driver.js +424 -0
  248. package/lib/types/adapter/upstream/decisions-driver.d.ts +15 -0
  249. package/lib/types/adapter/upstream/decisions-driver.d.ts.map +1 -0
  250. package/lib/types/adapter/upstream/decisions-driver.js +141 -0
  251. package/lib/types/adapter/upstream/detection.d.ts +26 -0
  252. package/lib/types/adapter/upstream/detection.d.ts.map +1 -0
  253. package/lib/types/adapter/upstream/detection.js +9 -0
  254. package/lib/types/adapter/upstream/driver.d.ts +50 -0
  255. package/lib/types/adapter/upstream/driver.d.ts.map +1 -0
  256. package/lib/types/adapter/upstream/driver.js +8 -0
  257. package/lib/types/adapter/upstream/extensions-driver.d.ts +24 -0
  258. package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -0
  259. package/lib/types/adapter/upstream/extensions-driver.js +697 -0
  260. package/lib/types/adapter/upstream/host-descriptor-driver.d.ts +45 -0
  261. package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -0
  262. package/lib/types/adapter/upstream/host-descriptor-driver.js +606 -0
  263. package/lib/types/adapter/upstream/index.d.ts +18 -0
  264. package/lib/types/adapter/upstream/index.d.ts.map +1 -0
  265. package/lib/types/adapter/upstream/index.js +15 -0
  266. package/lib/types/adapter/upstream/presentation-driver.d.ts +17 -0
  267. package/lib/types/adapter/upstream/presentation-driver.d.ts.map +1 -0
  268. package/lib/types/adapter/upstream/presentation-driver.js +129 -0
  269. package/lib/types/adapter/upstream/scenes-driver.d.ts +18 -0
  270. package/lib/types/adapter/upstream/scenes-driver.d.ts.map +1 -0
  271. package/lib/types/adapter/upstream/scenes-driver.js +170 -0
  272. package/lib/types/adapter/upstream/settings-driver.d.ts +20 -0
  273. package/lib/types/adapter/upstream/settings-driver.d.ts.map +1 -0
  274. package/lib/types/adapter/upstream/settings-driver.js +173 -0
  275. package/lib/types/adapter/upstream/workspace-driver.d.ts +19 -0
  276. package/lib/types/adapter/upstream/workspace-driver.d.ts.map +1 -0
  277. package/lib/types/adapter/upstream/workspace-driver.js +198 -0
  278. package/lib/types/api.d.ts +7 -0
  279. package/lib/types/api.d.ts.map +1 -0
  280. package/lib/types/api.js +1 -0
  281. package/lib/types/bootstrap/state.d.ts +11 -0
  282. package/lib/types/bootstrap/state.d.ts.map +1 -0
  283. package/lib/types/bootstrap/state.js +10 -0
  284. package/lib/types/command-trees.d.ts +4 -0
  285. package/lib/types/command-trees.d.ts.map +1 -0
  286. package/lib/types/command-trees.js +4 -0
  287. package/lib/types/commands.d.ts +87 -0
  288. package/lib/types/commands.d.ts.map +1 -0
  289. package/lib/types/commands.js +218 -0
  290. package/lib/types/components/ActivityLine.d.ts +34 -0
  291. package/lib/types/components/ActivityLine.d.ts.map +1 -0
  292. package/lib/types/components/ActivityLine.js +39 -0
  293. package/lib/types/components/ActivityPicker.d.ts +16 -0
  294. package/lib/types/components/ActivityPicker.d.ts.map +1 -0
  295. package/lib/types/components/ActivityPicker.js +23 -0
  296. package/lib/types/components/AutoRecapRow.d.ts +23 -0
  297. package/lib/types/components/AutoRecapRow.d.ts.map +1 -0
  298. package/lib/types/components/AutoRecapRow.js +23 -0
  299. package/lib/types/components/BalanceReportRow.d.ts +24 -0
  300. package/lib/types/components/BalanceReportRow.d.ts.map +1 -0
  301. package/lib/types/components/BalanceReportRow.js +87 -0
  302. package/lib/types/components/BtwPanel.d.ts +16 -0
  303. package/lib/types/components/BtwPanel.d.ts.map +1 -0
  304. package/lib/types/components/BtwPanel.js +47 -0
  305. package/lib/types/components/Chat/JobCard.d.ts +23 -0
  306. package/lib/types/components/Chat/JobCard.d.ts.map +1 -0
  307. package/lib/types/components/Chat/JobCard.js +93 -0
  308. package/lib/types/components/Chat/SubagentMessage.d.ts +20 -0
  309. package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -0
  310. package/lib/types/components/Chat/SubagentMessage.js +83 -0
  311. package/lib/types/components/ColorPicker.d.ts +17 -0
  312. package/lib/types/components/ColorPicker.d.ts.map +1 -0
  313. package/lib/types/components/ColorPicker.js +20 -0
  314. package/lib/types/components/CommandSuggestions.d.ts +34 -0
  315. package/lib/types/components/CommandSuggestions.d.ts.map +1 -0
  316. package/lib/types/components/CommandSuggestions.js +61 -0
  317. package/lib/types/components/ContextBarView.d.ts +41 -0
  318. package/lib/types/components/ContextBarView.d.ts.map +1 -0
  319. package/lib/types/components/ContextBarView.js +50 -0
  320. package/lib/types/components/EffortChargeGlyph.d.ts +26 -0
  321. package/lib/types/components/EffortChargeGlyph.d.ts.map +1 -0
  322. package/lib/types/components/EffortChargeGlyph.js +70 -0
  323. package/lib/types/components/EffortInputBorder.d.ts +47 -0
  324. package/lib/types/components/EffortInputBorder.d.ts.map +1 -0
  325. package/lib/types/components/EffortInputBorder.js +90 -0
  326. package/lib/types/components/EffortSlider.d.ts +18 -0
  327. package/lib/types/components/EffortSlider.d.ts.map +1 -0
  328. package/lib/types/components/EffortSlider.js +19 -0
  329. package/lib/types/components/EffortTierBadge.d.ts +26 -0
  330. package/lib/types/components/EffortTierBadge.d.ts.map +1 -0
  331. package/lib/types/components/EffortTierBadge.js +97 -0
  332. package/lib/types/components/ExtensionDialog.d.ts +40 -0
  333. package/lib/types/components/ExtensionDialog.d.ts.map +1 -0
  334. package/lib/types/components/ExtensionDialog.js +253 -0
  335. package/lib/types/components/FileActionsPanel.d.ts +22 -0
  336. package/lib/types/components/FileActionsPanel.d.ts.map +1 -0
  337. package/lib/types/components/FileActionsPanel.js +28 -0
  338. package/lib/types/components/FileSuggestions.d.ts +18 -0
  339. package/lib/types/components/FileSuggestions.d.ts.map +1 -0
  340. package/lib/types/components/FileSuggestions.js +78 -0
  341. package/lib/types/components/GoalTodoPanel.d.ts +38 -0
  342. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -0
  343. package/lib/types/components/GoalTodoPanel.js +131 -0
  344. package/lib/types/components/HelpMenu.d.ts +29 -0
  345. package/lib/types/components/HelpMenu.d.ts.map +1 -0
  346. package/lib/types/components/HelpMenu.js +39 -0
  347. package/lib/types/components/HistorySearchDialog.d.ts +18 -0
  348. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -0
  349. package/lib/types/components/HistorySearchDialog.js +47 -0
  350. package/lib/types/components/ImagePreviewOverlay.d.ts +51 -0
  351. package/lib/types/components/ImagePreviewOverlay.d.ts.map +1 -0
  352. package/lib/types/components/ImagePreviewOverlay.js +269 -0
  353. package/lib/types/components/JobsPanel.d.ts +17 -0
  354. package/lib/types/components/JobsPanel.d.ts.map +1 -0
  355. package/lib/types/components/JobsPanel.js +111 -0
  356. package/lib/types/components/LangPicker.d.ts +14 -0
  357. package/lib/types/components/LangPicker.d.ts.map +1 -0
  358. package/lib/types/components/LangPicker.js +17 -0
  359. package/lib/types/components/LoadedContextPanel.d.ts +20 -0
  360. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -0
  361. package/lib/types/components/LoadedContextPanel.js +32 -0
  362. package/lib/types/components/LogoV2.d.ts +48 -0
  363. package/lib/types/components/LogoV2.d.ts.map +1 -0
  364. package/lib/types/components/LogoV2.js +239 -0
  365. package/lib/types/components/Markdown.d.ts +46 -0
  366. package/lib/types/components/Markdown.d.ts.map +1 -0
  367. package/lib/types/components/Markdown.js +178 -0
  368. package/lib/types/components/MarkdownTable.d.ts +13 -0
  369. package/lib/types/components/MarkdownTable.d.ts.map +1 -0
  370. package/lib/types/components/MarkdownTable.js +155 -0
  371. package/lib/types/components/MermaidDiagram.d.ts +13 -0
  372. package/lib/types/components/MermaidDiagram.d.ts.map +1 -0
  373. package/lib/types/components/MermaidDiagram.js +61 -0
  374. package/lib/types/components/MessageList.d.ts +144 -0
  375. package/lib/types/components/MessageList.d.ts.map +1 -0
  376. package/lib/types/components/MessageList.js +1170 -0
  377. package/lib/types/components/MigratePicker.d.ts +30 -0
  378. package/lib/types/components/MigratePicker.d.ts.map +1 -0
  379. package/lib/types/components/MigratePicker.js +38 -0
  380. package/lib/types/components/ModelPicker.d.ts +42 -0
  381. package/lib/types/components/ModelPicker.d.ts.map +1 -0
  382. package/lib/types/components/ModelPicker.js +51 -0
  383. package/lib/types/components/OverlayAbove.d.ts +48 -0
  384. package/lib/types/components/OverlayAbove.d.ts.map +1 -0
  385. package/lib/types/components/OverlayAbove.js +98 -0
  386. package/lib/types/components/PageMargin.d.ts +58 -0
  387. package/lib/types/components/PageMargin.d.ts.map +1 -0
  388. package/lib/types/components/PageMargin.js +38 -0
  389. package/lib/types/components/PermissionsPicker.d.ts +20 -0
  390. package/lib/types/components/PermissionsPicker.d.ts.map +1 -0
  391. package/lib/types/components/PermissionsPicker.js +33 -0
  392. package/lib/types/components/PlanPicker.d.ts +15 -0
  393. package/lib/types/components/PlanPicker.d.ts.map +1 -0
  394. package/lib/types/components/PlanPicker.js +18 -0
  395. package/lib/types/components/PluginSceneBoundary.d.ts +31 -0
  396. package/lib/types/components/PluginSceneBoundary.d.ts.map +1 -0
  397. package/lib/types/components/PluginSceneBoundary.js +29 -0
  398. package/lib/types/components/PluginStatusViewBoundary.d.ts +26 -0
  399. package/lib/types/components/PluginStatusViewBoundary.d.ts.map +1 -0
  400. package/lib/types/components/PluginStatusViewBoundary.js +22 -0
  401. package/lib/types/components/PresetPicker.d.ts +20 -0
  402. package/lib/types/components/PresetPicker.d.ts.map +1 -0
  403. package/lib/types/components/PresetPicker.js +24 -0
  404. package/lib/types/components/PromptEditor.d.ts +48 -0
  405. package/lib/types/components/PromptEditor.d.ts.map +1 -0
  406. package/lib/types/components/PromptEditor.js +75 -0
  407. package/lib/types/components/PromptInput.d.ts +163 -0
  408. package/lib/types/components/PromptInput.d.ts.map +1 -0
  409. package/lib/types/components/PromptInput.js +3503 -0
  410. package/lib/types/components/RecapPanel.d.ts +25 -0
  411. package/lib/types/components/RecapPanel.d.ts.map +1 -0
  412. package/lib/types/components/RecapPanel.js +55 -0
  413. package/lib/types/components/RewindPicker.d.ts +37 -0
  414. package/lib/types/components/RewindPicker.d.ts.map +1 -0
  415. package/lib/types/components/RewindPicker.js +66 -0
  416. package/lib/types/components/ScrollbarGutter.d.ts +43 -0
  417. package/lib/types/components/ScrollbarGutter.d.ts.map +1 -0
  418. package/lib/types/components/ScrollbarGutter.js +197 -0
  419. package/lib/types/components/SearchBox.d.ts +24 -0
  420. package/lib/types/components/SearchBox.d.ts.map +1 -0
  421. package/lib/types/components/SearchBox.js +132 -0
  422. package/lib/types/components/Select.d.ts +29 -0
  423. package/lib/types/components/Select.d.ts.map +1 -0
  424. package/lib/types/components/Select.js +21 -0
  425. package/lib/types/components/SkillsPicker.d.ts +21 -0
  426. package/lib/types/components/SkillsPicker.d.ts.map +1 -0
  427. package/lib/types/components/SkillsPicker.js +52 -0
  428. package/lib/types/components/Spinner/GlimmerMessage.d.ts +16 -0
  429. package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -0
  430. package/lib/types/components/Spinner/GlimmerMessage.js +57 -0
  431. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +33 -0
  432. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -0
  433. package/lib/types/components/Spinner/SpinnerAnimationRow.js +168 -0
  434. package/lib/types/components/Spinner/SpinnerGlyph.d.ts +16 -0
  435. package/lib/types/components/Spinner/SpinnerGlyph.d.ts.map +1 -0
  436. package/lib/types/components/Spinner/SpinnerGlyph.js +36 -0
  437. package/lib/types/components/Spinner/spinnerMode.d.ts +2 -0
  438. package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -0
  439. package/lib/types/components/Spinner/spinnerMode.js +1 -0
  440. package/lib/types/components/Spinner/spinnerUtils.d.ts +36 -0
  441. package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -0
  442. package/lib/types/components/Spinner/spinnerUtils.js +94 -0
  443. package/lib/types/components/Spinner/useStalledAnimation.d.ts +16 -0
  444. package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -0
  445. package/lib/types/components/Spinner/useStalledAnimation.js +52 -0
  446. package/lib/types/components/SplitDiffView.d.ts +25 -0
  447. package/lib/types/components/SplitDiffView.d.ts.map +1 -0
  448. package/lib/types/components/SplitDiffView.js +279 -0
  449. package/lib/types/components/StreamingMarkdown.d.ts +6 -0
  450. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -0
  451. package/lib/types/components/StreamingMarkdown.js +279 -0
  452. package/lib/types/components/SubagentCard.d.ts +10 -0
  453. package/lib/types/components/SubagentCard.d.ts.map +1 -0
  454. package/lib/types/components/SubagentCard.js +39 -0
  455. package/lib/types/components/SubagentDashboard.d.ts +17 -0
  456. package/lib/types/components/SubagentDashboard.d.ts.map +1 -0
  457. package/lib/types/components/SubagentDashboard.js +58 -0
  458. package/lib/types/components/SubagentDetailScene.d.ts +16 -0
  459. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -0
  460. package/lib/types/components/SubagentDetailScene.js +147 -0
  461. package/lib/types/components/SuggestionCard.d.ts +65 -0
  462. package/lib/types/components/SuggestionCard.d.ts.map +1 -0
  463. package/lib/types/components/SuggestionCard.js +77 -0
  464. package/lib/types/components/SyntaxText.d.ts +15 -0
  465. package/lib/types/components/SyntaxText.d.ts.map +1 -0
  466. package/lib/types/components/SyntaxText.js +34 -0
  467. package/lib/types/components/ThemePicker.d.ts +27 -0
  468. package/lib/types/components/ThemePicker.d.ts.map +1 -0
  469. package/lib/types/components/ThemePicker.js +55 -0
  470. package/lib/types/components/ThinkingToggle.d.ts +13 -0
  471. package/lib/types/components/ThinkingToggle.d.ts.map +1 -0
  472. package/lib/types/components/ThinkingToggle.js +25 -0
  473. package/lib/types/components/TimelineRail.d.ts +53 -0
  474. package/lib/types/components/TimelineRail.d.ts.map +1 -0
  475. package/lib/types/components/TimelineRail.js +197 -0
  476. package/lib/types/components/TipsPanel.d.ts +14 -0
  477. package/lib/types/components/TipsPanel.d.ts.map +1 -0
  478. package/lib/types/components/TipsPanel.js +37 -0
  479. package/lib/types/components/ToolUseLoader.d.ts +18 -0
  480. package/lib/types/components/ToolUseLoader.d.ts.map +1 -0
  481. package/lib/types/components/ToolUseLoader.js +51 -0
  482. package/lib/types/components/Tooltip.d.ts +67 -0
  483. package/lib/types/components/Tooltip.d.ts.map +1 -0
  484. package/lib/types/components/Tooltip.js +266 -0
  485. package/lib/types/components/TurnInterruptedRow.d.ts +6 -0
  486. package/lib/types/components/TurnInterruptedRow.d.ts.map +1 -0
  487. package/lib/types/components/TurnInterruptedRow.js +9 -0
  488. package/lib/types/components/Whale.d.ts +42 -0
  489. package/lib/types/components/Whale.d.ts.map +1 -0
  490. package/lib/types/components/Whale.js +108 -0
  491. package/lib/types/components/WorkingSpinner.d.ts +26 -0
  492. package/lib/types/components/WorkingSpinner.d.ts.map +1 -0
  493. package/lib/types/components/WorkingSpinner.js +67 -0
  494. package/lib/types/components/WorkspaceFlowPicker.d.ts +20 -0
  495. package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -0
  496. package/lib/types/components/WorkspaceFlowPicker.js +21 -0
  497. package/lib/types/components/WorkspaceMenuPicker.d.ts +19 -0
  498. package/lib/types/components/WorkspaceMenuPicker.d.ts.map +1 -0
  499. package/lib/types/components/WorkspaceMenuPicker.js +19 -0
  500. package/lib/types/components/WorkspacePicker.d.ts +12 -0
  501. package/lib/types/components/WorkspacePicker.d.ts.map +1 -0
  502. package/lib/types/components/WorkspacePicker.js +13 -0
  503. package/lib/types/components/activityFrames.d.ts +23 -0
  504. package/lib/types/components/activityFrames.d.ts.map +1 -0
  505. package/lib/types/components/activityFrames.js +31 -0
  506. package/lib/types/components/approvals/ApprovalPanel.d.ts +24 -0
  507. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -0
  508. package/lib/types/components/approvals/ApprovalPanel.js +53 -0
  509. package/lib/types/components/bigfont.d.ts +28 -0
  510. package/lib/types/components/bigfont.d.ts.map +1 -0
  511. package/lib/types/components/bigfont.js +91 -0
  512. package/lib/types/components/design-system/Byline.d.ts +14 -0
  513. package/lib/types/components/design-system/Byline.d.ts.map +1 -0
  514. package/lib/types/components/design-system/Byline.js +17 -0
  515. package/lib/types/components/design-system/Divider.d.ts +61 -0
  516. package/lib/types/components/design-system/Divider.d.ts.map +1 -0
  517. package/lib/types/components/design-system/Divider.js +115 -0
  518. package/lib/types/components/design-system/HintLine.d.ts +11 -0
  519. package/lib/types/components/design-system/HintLine.d.ts.map +1 -0
  520. package/lib/types/components/design-system/HintLine.js +14 -0
  521. package/lib/types/components/design-system/ListItem.d.ts +42 -0
  522. package/lib/types/components/design-system/ListItem.d.ts.map +1 -0
  523. package/lib/types/components/design-system/ListItem.js +84 -0
  524. package/lib/types/components/design-system/LoadingState.d.ts +19 -0
  525. package/lib/types/components/design-system/LoadingState.d.ts.map +1 -0
  526. package/lib/types/components/design-system/LoadingState.js +22 -0
  527. package/lib/types/components/design-system/Pane.d.ts +17 -0
  528. package/lib/types/components/design-system/Pane.d.ts.map +1 -0
  529. package/lib/types/components/design-system/Pane.js +15 -0
  530. package/lib/types/components/design-system/ProgressBar.d.ts +21 -0
  531. package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -0
  532. package/lib/types/components/design-system/ProgressBar.js +26 -0
  533. package/lib/types/components/design-system/StatusIcon.d.ts +15 -0
  534. package/lib/types/components/design-system/StatusIcon.d.ts.map +1 -0
  535. package/lib/types/components/design-system/StatusIcon.js +20 -0
  536. package/lib/types/components/design-system/ThemeProvider.d.ts +21 -0
  537. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -0
  538. package/lib/types/components/design-system/ThemeProvider.js +256 -0
  539. package/lib/types/components/design-system/ThemedBox.d.ts +60 -0
  540. package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -0
  541. package/lib/types/components/design-system/ThemedBox.js +29 -0
  542. package/lib/types/components/design-system/ThemedText.d.ts +61 -0
  543. package/lib/types/components/design-system/ThemedText.d.ts.map +1 -0
  544. package/lib/types/components/design-system/ThemedText.js +42 -0
  545. package/lib/types/components/listWindow.d.ts +26 -0
  546. package/lib/types/components/listWindow.d.ts.map +1 -0
  547. package/lib/types/components/listWindow.js +47 -0
  548. package/lib/types/components/messages/AssistantTextMessage.d.ts +20 -0
  549. package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -0
  550. package/lib/types/components/messages/AssistantTextMessage.js +18 -0
  551. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +40 -0
  552. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -0
  553. package/lib/types/components/messages/AssistantThinkingMessage.js +84 -0
  554. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +72 -0
  555. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -0
  556. package/lib/types/components/messages/AssistantToolUseMessage.js +517 -0
  557. package/lib/types/components/messages/MessageMetadata.d.ts +14 -0
  558. package/lib/types/components/messages/MessageMetadata.d.ts.map +1 -0
  559. package/lib/types/components/messages/MessageMetadata.js +19 -0
  560. package/lib/types/components/messages/TranscriptImages.d.ts +21 -0
  561. package/lib/types/components/messages/TranscriptImages.d.ts.map +1 -0
  562. package/lib/types/components/messages/TranscriptImages.js +83 -0
  563. package/lib/types/components/messages/UserPromptMessage.d.ts +18 -0
  564. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -0
  565. package/lib/types/components/messages/UserPromptMessage.js +28 -0
  566. package/lib/types/components/messages/imageInspection.d.ts +33 -0
  567. package/lib/types/components/messages/imageInspection.d.ts.map +1 -0
  568. package/lib/types/components/messages/imageInspection.js +107 -0
  569. package/lib/types/components/messages/originalImage.d.ts +5 -0
  570. package/lib/types/components/messages/originalImage.d.ts.map +1 -0
  571. package/lib/types/components/messages/originalImage.js +56 -0
  572. package/lib/types/components/messages/transcriptImageDecode.d.ts +9 -0
  573. package/lib/types/components/messages/transcriptImageDecode.d.ts.map +1 -0
  574. package/lib/types/components/messages/transcriptImageDecode.js +144 -0
  575. package/lib/types/components/messages/useImageInspection.d.ts +10 -0
  576. package/lib/types/components/messages/useImageInspection.d.ts.map +1 -0
  577. package/lib/types/components/messages/useImageInspection.js +91 -0
  578. package/lib/types/components/overlayBudget.d.ts +39 -0
  579. package/lib/types/components/overlayBudget.d.ts.map +1 -0
  580. package/lib/types/components/overlayBudget.js +43 -0
  581. package/lib/types/components/promptDraftCache.d.ts +102 -0
  582. package/lib/types/components/promptDraftCache.d.ts.map +1 -0
  583. package/lib/types/components/promptDraftCache.js +76 -0
  584. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +94 -0
  585. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -0
  586. package/lib/types/components/questions/AskUserQuestionPanel.js +527 -0
  587. package/lib/types/components/questions/PlanReviewPanel.d.ts +55 -0
  588. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -0
  589. package/lib/types/components/questions/PlanReviewPanel.js +351 -0
  590. package/lib/types/components/questions/QuestionMinimizedBar.d.ts +12 -0
  591. package/lib/types/components/questions/QuestionMinimizedBar.d.ts.map +1 -0
  592. package/lib/types/components/questions/QuestionMinimizedBar.js +43 -0
  593. package/lib/types/components/sessions/SessionListRow.d.ts +58 -0
  594. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -0
  595. package/lib/types/components/sessions/SessionListRow.js +108 -0
  596. package/lib/types/components/sessions/SessionPreview.d.ts +25 -0
  597. package/lib/types/components/sessions/SessionPreview.d.ts.map +1 -0
  598. package/lib/types/components/sessions/SessionPreview.js +62 -0
  599. package/lib/types/components/sessions/WorkspaceListRow.d.ts +17 -0
  600. package/lib/types/components/sessions/WorkspaceListRow.d.ts.map +1 -0
  601. package/lib/types/components/sessions/WorkspaceListRow.js +27 -0
  602. package/lib/types/components/shimmer.d.ts +35 -0
  603. package/lib/types/components/shimmer.d.ts.map +1 -0
  604. package/lib/types/components/shimmer.js +43 -0
  605. package/lib/types/components/smoothReveal.d.ts +57 -0
  606. package/lib/types/components/smoothReveal.d.ts.map +1 -0
  607. package/lib/types/components/smoothReveal.js +305 -0
  608. package/lib/types/components/trajectory/HotspotView.d.ts +20 -0
  609. package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -0
  610. package/lib/types/components/trajectory/HotspotView.js +89 -0
  611. package/lib/types/components/trajectory/Inspector.d.ts +31 -0
  612. package/lib/types/components/trajectory/Inspector.d.ts.map +1 -0
  613. package/lib/types/components/trajectory/Inspector.js +67 -0
  614. package/lib/types/components/trajectory/Ledger.d.ts +28 -0
  615. package/lib/types/components/trajectory/Ledger.d.ts.map +1 -0
  616. package/lib/types/components/trajectory/Ledger.js +130 -0
  617. package/lib/types/components/trajectory/MiniWake.d.ts +24 -0
  618. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -0
  619. package/lib/types/components/trajectory/MiniWake.js +99 -0
  620. package/lib/types/components/trajectory/WaveBand.d.ts +42 -0
  621. package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -0
  622. package/lib/types/components/trajectory/WaveBand.js +150 -0
  623. package/lib/types/components/whaleFrames.d.ts +81 -0
  624. package/lib/types/components/whaleFrames.d.ts.map +1 -0
  625. package/lib/types/components/whaleFrames.js +768 -0
  626. package/lib/types/components/whaleIdle.d.ts +66 -0
  627. package/lib/types/components/whaleIdle.d.ts.map +1 -0
  628. package/lib/types/components/whaleIdle.js +174 -0
  629. package/lib/types/components/whaleLayers.d.ts +28 -0
  630. package/lib/types/components/whaleLayers.d.ts.map +1 -0
  631. package/lib/types/components/whaleLayers.js +90 -0
  632. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +49 -0
  633. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -0
  634. package/lib/types/components/workspaces/HomeWorkspaceRow.js +50 -0
  635. package/lib/types/customTheme.d.ts +108 -0
  636. package/lib/types/customTheme.d.ts.map +1 -0
  637. package/lib/types/customTheme.js +281 -0
  638. package/lib/types/deepseekBalance.d.ts +19 -0
  639. package/lib/types/deepseekBalance.d.ts.map +1 -0
  640. package/lib/types/deepseekBalance.js +72 -0
  641. package/lib/types/deepseekPricing.d.ts +83 -0
  642. package/lib/types/deepseekPricing.d.ts.map +1 -0
  643. package/lib/types/deepseekPricing.js +140 -0
  644. package/lib/types/dsh-adapter/activity-store.d.ts +221 -0
  645. package/lib/types/dsh-adapter/activity-store.d.ts.map +1 -0
  646. package/lib/types/dsh-adapter/activity-store.js +359 -0
  647. package/lib/types/dsh-adapter/agent-view.d.ts +66 -0
  648. package/lib/types/dsh-adapter/agent-view.d.ts.map +1 -0
  649. package/lib/types/dsh-adapter/agent-view.js +153 -0
  650. package/lib/types/dsh-adapter/approvals.d.ts +225 -0
  651. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -0
  652. package/lib/types/dsh-adapter/approvals.js +465 -0
  653. package/lib/types/dsh-adapter/bundled-presets.d.ts +10 -0
  654. package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -0
  655. package/lib/types/dsh-adapter/bundled-presets.js +80 -0
  656. package/lib/types/dsh-adapter/channel/action-readiness.d.ts +20 -0
  657. package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -0
  658. package/lib/types/dsh-adapter/channel/action-readiness.js +86 -0
  659. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +64 -0
  660. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -0
  661. package/lib/types/dsh-adapter/channel/agent-view-projection.js +312 -0
  662. package/lib/types/dsh-adapter/channel/background-action.d.ts +41 -0
  663. package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -0
  664. package/lib/types/dsh-adapter/channel/background-action.js +110 -0
  665. package/lib/types/dsh-adapter/channel/binding-events.d.ts +67 -0
  666. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -0
  667. package/lib/types/dsh-adapter/channel/binding-events.js +170 -0
  668. package/lib/types/dsh-adapter/channel/binding.d.ts +58 -0
  669. package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -0
  670. package/lib/types/dsh-adapter/channel/binding.js +287 -0
  671. package/lib/types/dsh-adapter/channel/command-completions.d.ts +29 -0
  672. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -0
  673. package/lib/types/dsh-adapter/channel/command-completions.js +94 -0
  674. package/lib/types/dsh-adapter/channel/commands.d.ts +8 -0
  675. package/lib/types/dsh-adapter/channel/commands.d.ts.map +1 -0
  676. package/lib/types/dsh-adapter/channel/commands.js +9 -0
  677. package/lib/types/dsh-adapter/channel/compaction.d.ts +18 -0
  678. package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -0
  679. package/lib/types/dsh-adapter/channel/compaction.js +114 -0
  680. package/lib/types/dsh-adapter/channel/composer-images.d.ts +62 -0
  681. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -0
  682. package/lib/types/dsh-adapter/channel/composer-images.js +316 -0
  683. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts +15 -0
  684. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -0
  685. package/lib/types/dsh-adapter/channel/composer-mentions.js +200 -0
  686. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +34 -0
  687. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -0
  688. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +31 -0
  689. package/lib/types/dsh-adapter/channel/decisions.d.ts +19 -0
  690. package/lib/types/dsh-adapter/channel/decisions.d.ts.map +1 -0
  691. package/lib/types/dsh-adapter/channel/decisions.js +90 -0
  692. package/lib/types/dsh-adapter/channel/emitter.d.ts +10 -0
  693. package/lib/types/dsh-adapter/channel/emitter.d.ts.map +1 -0
  694. package/lib/types/dsh-adapter/channel/emitter.js +71 -0
  695. package/lib/types/dsh-adapter/channel/external-commands.d.ts +31 -0
  696. package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -0
  697. package/lib/types/dsh-adapter/channel/external-commands.js +187 -0
  698. package/lib/types/dsh-adapter/channel/file-actions.d.ts +20 -0
  699. package/lib/types/dsh-adapter/channel/file-actions.d.ts.map +1 -0
  700. package/lib/types/dsh-adapter/channel/file-actions.js +45 -0
  701. package/lib/types/dsh-adapter/channel/ide-selection.d.ts +58 -0
  702. package/lib/types/dsh-adapter/channel/ide-selection.d.ts.map +1 -0
  703. package/lib/types/dsh-adapter/channel/ide-selection.js +226 -0
  704. package/lib/types/dsh-adapter/channel/input-actions.d.ts +13 -0
  705. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -0
  706. package/lib/types/dsh-adapter/channel/input-actions.js +135 -0
  707. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +42 -0
  708. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -0
  709. package/lib/types/dsh-adapter/channel/input-delivery.js +313 -0
  710. package/lib/types/dsh-adapter/channel/job-projection.d.ts +28 -0
  711. package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -0
  712. package/lib/types/dsh-adapter/channel/job-projection.js +150 -0
  713. package/lib/types/dsh-adapter/channel/lifetime-resources.d.ts +9 -0
  714. package/lib/types/dsh-adapter/channel/lifetime-resources.d.ts.map +1 -0
  715. package/lib/types/dsh-adapter/channel/lifetime-resources.js +33 -0
  716. package/lib/types/dsh-adapter/channel/loaded-context.d.ts +40 -0
  717. package/lib/types/dsh-adapter/channel/loaded-context.d.ts.map +1 -0
  718. package/lib/types/dsh-adapter/channel/loaded-context.js +62 -0
  719. package/lib/types/dsh-adapter/channel/local-actions.d.ts +54 -0
  720. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -0
  721. package/lib/types/dsh-adapter/channel/local-actions.js +109 -0
  722. package/lib/types/dsh-adapter/channel/mentions.d.ts +29 -0
  723. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -0
  724. package/lib/types/dsh-adapter/channel/mentions.js +235 -0
  725. package/lib/types/dsh-adapter/channel/mode-actions.d.ts +30 -0
  726. package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -0
  727. package/lib/types/dsh-adapter/channel/mode-actions.js +247 -0
  728. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +35 -0
  729. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -0
  730. package/lib/types/dsh-adapter/channel/mode-permission-actions.js +199 -0
  731. package/lib/types/dsh-adapter/channel/mode-permission.d.ts +58 -0
  732. package/lib/types/dsh-adapter/channel/mode-permission.d.ts.map +1 -0
  733. package/lib/types/dsh-adapter/channel/mode-permission.js +240 -0
  734. package/lib/types/dsh-adapter/channel/mode-roster.d.ts +51 -0
  735. package/lib/types/dsh-adapter/channel/mode-roster.d.ts.map +1 -0
  736. package/lib/types/dsh-adapter/channel/mode-roster.js +119 -0
  737. package/lib/types/dsh-adapter/channel/model-actions.d.ts +49 -0
  738. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -0
  739. package/lib/types/dsh-adapter/channel/model-actions.js +351 -0
  740. package/lib/types/dsh-adapter/channel/model-switch.d.ts +31 -0
  741. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -0
  742. package/lib/types/dsh-adapter/channel/model-switch.js +116 -0
  743. package/lib/types/dsh-adapter/channel/notifications.d.ts +9 -0
  744. package/lib/types/dsh-adapter/channel/notifications.d.ts.map +1 -0
  745. package/lib/types/dsh-adapter/channel/notifications.js +24 -0
  746. package/lib/types/dsh-adapter/channel/owner.d.ts +18 -0
  747. package/lib/types/dsh-adapter/channel/owner.d.ts.map +1 -0
  748. package/lib/types/dsh-adapter/channel/owner.js +73 -0
  749. package/lib/types/dsh-adapter/channel/paths.d.ts +31 -0
  750. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -0
  751. package/lib/types/dsh-adapter/channel/paths.js +147 -0
  752. package/lib/types/dsh-adapter/channel/permissions.d.ts +40 -0
  753. package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -0
  754. package/lib/types/dsh-adapter/channel/permissions.js +187 -0
  755. package/lib/types/dsh-adapter/channel/preferences.d.ts +3 -0
  756. package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -0
  757. package/lib/types/dsh-adapter/channel/preferences.js +103 -0
  758. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts +13 -0
  759. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -0
  760. package/lib/types/dsh-adapter/channel/projection-helpers.js +63 -0
  761. package/lib/types/dsh-adapter/channel/projection.d.ts +44 -0
  762. package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -0
  763. package/lib/types/dsh-adapter/channel/projection.js +1031 -0
  764. package/lib/types/dsh-adapter/channel/reports.d.ts +32 -0
  765. package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -0
  766. package/lib/types/dsh-adapter/channel/reports.js +163 -0
  767. package/lib/types/dsh-adapter/channel/session-actions.d.ts +13 -0
  768. package/lib/types/dsh-adapter/channel/session-actions.d.ts.map +1 -0
  769. package/lib/types/dsh-adapter/channel/session-actions.js +29 -0
  770. package/lib/types/dsh-adapter/channel/session-adoption.d.ts +32 -0
  771. package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -0
  772. package/lib/types/dsh-adapter/channel/session-adoption.js +36 -0
  773. package/lib/types/dsh-adapter/channel/session-fork.d.ts +19 -0
  774. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -0
  775. package/lib/types/dsh-adapter/channel/session-fork.js +109 -0
  776. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +35 -0
  777. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -0
  778. package/lib/types/dsh-adapter/channel/session-live-adoption.js +64 -0
  779. package/lib/types/dsh-adapter/channel/session-metadata.d.ts +91 -0
  780. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -0
  781. package/lib/types/dsh-adapter/channel/session-metadata.js +220 -0
  782. package/lib/types/dsh-adapter/channel/session-reset.d.ts +11 -0
  783. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -0
  784. package/lib/types/dsh-adapter/channel/session-reset.js +43 -0
  785. package/lib/types/dsh-adapter/channel/session-resume.d.ts +65 -0
  786. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -0
  787. package/lib/types/dsh-adapter/channel/session-resume.js +438 -0
  788. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +19 -0
  789. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -0
  790. package/lib/types/dsh-adapter/channel/session-rewind.js +146 -0
  791. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +19 -0
  792. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -0
  793. package/lib/types/dsh-adapter/channel/session-tree-actions.js +154 -0
  794. package/lib/types/dsh-adapter/channel/session-tree.d.ts +10 -0
  795. package/lib/types/dsh-adapter/channel/session-tree.d.ts.map +1 -0
  796. package/lib/types/dsh-adapter/channel/session-tree.js +503 -0
  797. package/lib/types/dsh-adapter/channel/settings-host.d.ts +4 -0
  798. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -0
  799. package/lib/types/dsh-adapter/channel/settings-host.js +257 -0
  800. package/lib/types/dsh-adapter/channel/skill-catalog.d.ts +33 -0
  801. package/lib/types/dsh-adapter/channel/skill-catalog.d.ts.map +1 -0
  802. package/lib/types/dsh-adapter/channel/skill-catalog.js +215 -0
  803. package/lib/types/dsh-adapter/channel/state.d.ts +51 -0
  804. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -0
  805. package/lib/types/dsh-adapter/channel/state.js +31 -0
  806. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +67 -0
  807. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -0
  808. package/lib/types/dsh-adapter/channel/subagent-projection.js +307 -0
  809. package/lib/types/dsh-adapter/channel/transcript.d.ts +73 -0
  810. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -0
  811. package/lib/types/dsh-adapter/channel/transcript.js +306 -0
  812. package/lib/types/dsh-adapter/channel/types.d.ts +167 -0
  813. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -0
  814. package/lib/types/dsh-adapter/channel/types.js +1 -0
  815. package/lib/types/dsh-adapter/channel/usage.d.ts +13 -0
  816. package/lib/types/dsh-adapter/channel/usage.d.ts.map +1 -0
  817. package/lib/types/dsh-adapter/channel/usage.js +48 -0
  818. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts +23 -0
  819. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -0
  820. package/lib/types/dsh-adapter/channel/workspace-actions.js +96 -0
  821. package/lib/types/dsh-adapter/channel-facade-actions.d.ts +25 -0
  822. package/lib/types/dsh-adapter/channel-facade-actions.d.ts.map +1 -0
  823. package/lib/types/dsh-adapter/channel-facade-actions.js +55 -0
  824. package/lib/types/dsh-adapter/channel-scene-outlet.d.ts +6 -0
  825. package/lib/types/dsh-adapter/channel-scene-outlet.d.ts.map +1 -0
  826. package/lib/types/dsh-adapter/channel-scene-outlet.js +13 -0
  827. package/lib/types/dsh-adapter/channel-ui.d.ts +9 -0
  828. package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -0
  829. package/lib/types/dsh-adapter/channel-ui.js +128 -0
  830. package/lib/types/dsh-adapter/channel.d.ts +23 -0
  831. package/lib/types/dsh-adapter/channel.d.ts.map +1 -0
  832. package/lib/types/dsh-adapter/channel.js +999 -0
  833. package/lib/types/dsh-adapter/childStderr.d.ts +63 -0
  834. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -0
  835. package/lib/types/dsh-adapter/childStderr.js +180 -0
  836. package/lib/types/dsh-adapter/command-attribution.d.ts +51 -0
  837. package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -0
  838. package/lib/types/dsh-adapter/command-attribution.js +93 -0
  839. package/lib/types/dsh-adapter/command-errors.d.ts +42 -0
  840. package/lib/types/dsh-adapter/command-errors.d.ts.map +1 -0
  841. package/lib/types/dsh-adapter/command-errors.js +63 -0
  842. package/lib/types/dsh-adapter/command-trees.d.ts +34 -0
  843. package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -0
  844. package/lib/types/dsh-adapter/command-trees.js +111 -0
  845. package/lib/types/dsh-adapter/compat/index.d.ts +29 -0
  846. package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -0
  847. package/lib/types/dsh-adapter/compat/index.js +28 -0
  848. package/lib/types/dsh-adapter/compat/liveSession.d.ts +79 -0
  849. package/lib/types/dsh-adapter/compat/liveSession.d.ts.map +1 -0
  850. package/lib/types/dsh-adapter/compat/liveSession.js +223 -0
  851. package/lib/types/dsh-adapter/compat/messages.d.ts +15 -0
  852. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -0
  853. package/lib/types/dsh-adapter/compat/messages.js +15 -0
  854. package/lib/types/dsh-adapter/compat/persistence.d.ts +21 -0
  855. package/lib/types/dsh-adapter/compat/persistence.d.ts.map +1 -0
  856. package/lib/types/dsh-adapter/compat/persistence.js +17 -0
  857. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +309 -0
  858. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -0
  859. package/lib/types/dsh-adapter/compat/sessionLog.js +1177 -0
  860. package/lib/types/dsh-adapter/compat/settings.d.ts +35 -0
  861. package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -0
  862. package/lib/types/dsh-adapter/compat/settings.js +57 -0
  863. package/lib/types/dsh-adapter/compat/shell.d.ts +25 -0
  864. package/lib/types/dsh-adapter/compat/shell.d.ts.map +1 -0
  865. package/lib/types/dsh-adapter/compat/shell.js +11 -0
  866. package/lib/types/dsh-adapter/component-identity.d.ts +33 -0
  867. package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -0
  868. package/lib/types/dsh-adapter/component-identity.js +108 -0
  869. package/lib/types/dsh-adapter/contract.d.ts +91 -0
  870. package/lib/types/dsh-adapter/contract.d.ts.map +1 -0
  871. package/lib/types/dsh-adapter/contract.js +276 -0
  872. package/lib/types/dsh-adapter/credentialRefGuard.d.ts +40 -0
  873. package/lib/types/dsh-adapter/credentialRefGuard.d.ts.map +1 -0
  874. package/lib/types/dsh-adapter/credentialRefGuard.js +43 -0
  875. package/lib/types/dsh-adapter/decision-guard.d.ts +128 -0
  876. package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -0
  877. package/lib/types/dsh-adapter/decision-guard.js +460 -0
  878. package/lib/types/dsh-adapter/dialogs.d.ts +145 -0
  879. package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -0
  880. package/lib/types/dsh-adapter/dialogs.js +329 -0
  881. package/lib/types/dsh-adapter/effect-ledger.d.ts +96 -0
  882. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -0
  883. package/lib/types/dsh-adapter/effect-ledger.js +290 -0
  884. package/lib/types/dsh-adapter/extension-events.d.ts +186 -0
  885. package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -0
  886. package/lib/types/dsh-adapter/extension-events.js +187 -0
  887. package/lib/types/dsh-adapter/extensions.d.ts +36 -0
  888. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -0
  889. package/lib/types/dsh-adapter/extensions.js +51 -0
  890. package/lib/types/dsh-adapter/host-access.d.ts +37 -0
  891. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -0
  892. package/lib/types/dsh-adapter/host-access.js +652 -0
  893. package/lib/types/dsh-adapter/host-grants.d.ts +23 -0
  894. package/lib/types/dsh-adapter/host-grants.d.ts.map +1 -0
  895. package/lib/types/dsh-adapter/host-grants.js +45 -0
  896. package/lib/types/dsh-adapter/ide-channel.d.ts +224 -0
  897. package/lib/types/dsh-adapter/ide-channel.d.ts.map +1 -0
  898. package/lib/types/dsh-adapter/ide-channel.js +556 -0
  899. package/lib/types/dsh-adapter/index.d.ts +151 -0
  900. package/lib/types/dsh-adapter/index.d.ts.map +1 -0
  901. package/lib/types/dsh-adapter/index.js +119 -0
  902. package/lib/types/dsh-adapter/inject-channel.d.ts +108 -0
  903. package/lib/types/dsh-adapter/inject-channel.d.ts.map +1 -0
  904. package/lib/types/dsh-adapter/inject-channel.js +247 -0
  905. package/lib/types/dsh-adapter/invariant.d.ts +20 -0
  906. package/lib/types/dsh-adapter/invariant.d.ts.map +1 -0
  907. package/lib/types/dsh-adapter/invariant.js +26 -0
  908. package/lib/types/dsh-adapter/jobs.d.ts +101 -0
  909. package/lib/types/dsh-adapter/jobs.d.ts.map +1 -0
  910. package/lib/types/dsh-adapter/jobs.js +177 -0
  911. package/lib/types/dsh-adapter/message-observer.d.ts +186 -0
  912. package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -0
  913. package/lib/types/dsh-adapter/message-observer.js +682 -0
  914. package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts +3 -0
  915. package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts.map +1 -0
  916. package/lib/types/dsh-adapter/migrate/adapters/claude-code.js +191 -0
  917. package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts +3 -0
  918. package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts.map +1 -0
  919. package/lib/types/dsh-adapter/migrate/adapters/codex.js +133 -0
  920. package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts +3 -0
  921. package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts.map +1 -0
  922. package/lib/types/dsh-adapter/migrate/adapters/grok-build.js +175 -0
  923. package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts +3 -0
  924. package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts.map +1 -0
  925. package/lib/types/dsh-adapter/migrate/adapters/omp.js +132 -0
  926. package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts +6 -0
  927. package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts.map +1 -0
  928. package/lib/types/dsh-adapter/migrate/adapters/scan.js +38 -0
  929. package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts +3 -0
  930. package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts.map +1 -0
  931. package/lib/types/dsh-adapter/migrate/adapters/zcode.js +107 -0
  932. package/lib/types/dsh-adapter/migrate/bin-path.d.ts +6 -0
  933. package/lib/types/dsh-adapter/migrate/bin-path.d.ts.map +1 -0
  934. package/lib/types/dsh-adapter/migrate/bin-path.js +30 -0
  935. package/lib/types/dsh-adapter/migrate/cli.d.ts +9 -0
  936. package/lib/types/dsh-adapter/migrate/cli.d.ts.map +1 -0
  937. package/lib/types/dsh-adapter/migrate/cli.js +105 -0
  938. package/lib/types/dsh-adapter/migrate/index.d.ts +29 -0
  939. package/lib/types/dsh-adapter/migrate/index.d.ts.map +1 -0
  940. package/lib/types/dsh-adapter/migrate/index.js +108 -0
  941. package/lib/types/dsh-adapter/migrate/picker.d.ts +64 -0
  942. package/lib/types/dsh-adapter/migrate/picker.d.ts.map +1 -0
  943. package/lib/types/dsh-adapter/migrate/picker.js +86 -0
  944. package/lib/types/dsh-adapter/migrate/recent-agents.d.ts +40 -0
  945. package/lib/types/dsh-adapter/migrate/recent-agents.d.ts.map +1 -0
  946. package/lib/types/dsh-adapter/migrate/recent-agents.js +100 -0
  947. package/lib/types/dsh-adapter/migrate/sessionize.d.ts +19 -0
  948. package/lib/types/dsh-adapter/migrate/sessionize.d.ts.map +1 -0
  949. package/lib/types/dsh-adapter/migrate/sessionize.js +101 -0
  950. package/lib/types/dsh-adapter/migrate/types.d.ts +52 -0
  951. package/lib/types/dsh-adapter/migrate/types.d.ts.map +1 -0
  952. package/lib/types/dsh-adapter/migrate/types.js +11 -0
  953. package/lib/types/dsh-adapter/migrate/uuid.d.ts +7 -0
  954. package/lib/types/dsh-adapter/migrate/uuid.d.ts.map +1 -0
  955. package/lib/types/dsh-adapter/migrate/uuid.js +25 -0
  956. package/lib/types/dsh-adapter/packaged-presets.d.ts +22 -0
  957. package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -0
  958. package/lib/types/dsh-adapter/packaged-presets.js +94 -0
  959. package/lib/types/dsh-adapter/plugin-host.d.ts +205 -0
  960. package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -0
  961. package/lib/types/dsh-adapter/plugin-host.js +762 -0
  962. package/lib/types/dsh-adapter/plugin-storage.d.ts +118 -0
  963. package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -0
  964. package/lib/types/dsh-adapter/plugin-storage.js +536 -0
  965. package/lib/types/dsh-adapter/plugin.d.ts +70 -0
  966. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -0
  967. package/lib/types/dsh-adapter/plugin.js +2140 -0
  968. package/lib/types/dsh-adapter/plugins-info.d.ts +43 -0
  969. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -0
  970. package/lib/types/dsh-adapter/plugins-info.js +293 -0
  971. package/lib/types/dsh-adapter/preset-resolution.d.ts +57 -0
  972. package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -0
  973. package/lib/types/dsh-adapter/preset-resolution.js +52 -0
  974. package/lib/types/dsh-adapter/presets.d.ts +110 -0
  975. package/lib/types/dsh-adapter/presets.d.ts.map +1 -0
  976. package/lib/types/dsh-adapter/presets.js +161 -0
  977. package/lib/types/dsh-adapter/promptDebug.d.ts +4 -0
  978. package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -0
  979. package/lib/types/dsh-adapter/promptDebug.js +163 -0
  980. package/lib/types/dsh-adapter/providerGuard.d.ts +75 -0
  981. package/lib/types/dsh-adapter/providerGuard.d.ts.map +1 -0
  982. package/lib/types/dsh-adapter/providerGuard.js +104 -0
  983. package/lib/types/dsh-adapter/providerWizard.d.ts +42 -0
  984. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -0
  985. package/lib/types/dsh-adapter/providerWizard.js +921 -0
  986. package/lib/types/dsh-adapter/questions-answerer.d.ts +51 -0
  987. package/lib/types/dsh-adapter/questions-answerer.d.ts.map +1 -0
  988. package/lib/types/dsh-adapter/questions-answerer.js +64 -0
  989. package/lib/types/dsh-adapter/questions.d.ts +130 -0
  990. package/lib/types/dsh-adapter/questions.d.ts.map +1 -0
  991. package/lib/types/dsh-adapter/questions.js +282 -0
  992. package/lib/types/dsh-adapter/recap.d.ts +41 -0
  993. package/lib/types/dsh-adapter/recap.d.ts.map +1 -0
  994. package/lib/types/dsh-adapter/recap.js +111 -0
  995. package/lib/types/dsh-adapter/renderers.d.ts +58 -0
  996. package/lib/types/dsh-adapter/renderers.d.ts.map +1 -0
  997. package/lib/types/dsh-adapter/renderers.js +198 -0
  998. package/lib/types/dsh-adapter/sanitize.d.ts +45 -0
  999. package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -0
  1000. package/lib/types/dsh-adapter/sanitize.js +84 -0
  1001. package/lib/types/dsh-adapter/scenes.d.ts +87 -0
  1002. package/lib/types/dsh-adapter/scenes.d.ts.map +1 -0
  1003. package/lib/types/dsh-adapter/scenes.js +223 -0
  1004. package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts +53 -0
  1005. package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts.map +1 -0
  1006. package/lib/types/dsh-adapter/session-mount-heartbeat.js +100 -0
  1007. package/lib/types/dsh-adapter/sessionTree.d.ts +232 -0
  1008. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -0
  1009. package/lib/types/dsh-adapter/sessionTree.js +984 -0
  1010. package/lib/types/dsh-adapter/sessions/digest.d.ts +54 -0
  1011. package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -0
  1012. package/lib/types/dsh-adapter/sessions/digest.js +478 -0
  1013. package/lib/types/dsh-adapter/sessions/frames.d.ts +103 -0
  1014. package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -0
  1015. package/lib/types/dsh-adapter/sessions/frames.js +263 -0
  1016. package/lib/types/dsh-adapter/sessions/header.d.ts +56 -0
  1017. package/lib/types/dsh-adapter/sessions/header.d.ts.map +1 -0
  1018. package/lib/types/dsh-adapter/sessions/header.js +85 -0
  1019. package/lib/types/dsh-adapter/sessions/index.d.ts +17 -0
  1020. package/lib/types/dsh-adapter/sessions/index.d.ts.map +1 -0
  1021. package/lib/types/dsh-adapter/sessions/index.js +15 -0
  1022. package/lib/types/dsh-adapter/sessions/list.d.ts +64 -0
  1023. package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -0
  1024. package/lib/types/dsh-adapter/sessions/list.js +331 -0
  1025. package/lib/types/dsh-adapter/sessions/recovery.d.ts +17 -0
  1026. package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -0
  1027. package/lib/types/dsh-adapter/sessions/recovery.js +109 -0
  1028. package/lib/types/dsh-adapter/sessions/store.d.ts +60 -0
  1029. package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -0
  1030. package/lib/types/dsh-adapter/sessions/store.js +221 -0
  1031. package/lib/types/dsh-adapter/sessions/types.d.ts +21 -0
  1032. package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -0
  1033. package/lib/types/dsh-adapter/sessions/types.js +1 -0
  1034. package/lib/types/dsh-adapter/settings-sections.d.ts +48 -0
  1035. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -0
  1036. package/lib/types/dsh-adapter/settings-sections.js +253 -0
  1037. package/lib/types/dsh-adapter/settingsEditor.d.ts +100 -0
  1038. package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -0
  1039. package/lib/types/dsh-adapter/settingsEditor.js +238 -0
  1040. package/lib/types/dsh-adapter/sharp.d.ts +10 -0
  1041. package/lib/types/dsh-adapter/sharp.d.ts.map +1 -0
  1042. package/lib/types/dsh-adapter/sharp.js +59 -0
  1043. package/lib/types/dsh-adapter/shortcuts.d.ts +82 -0
  1044. package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -0
  1045. package/lib/types/dsh-adapter/shortcuts.js +252 -0
  1046. package/lib/types/dsh-adapter/sideQuestion.d.ts +36 -0
  1047. package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -0
  1048. package/lib/types/dsh-adapter/sideQuestion.js +59 -0
  1049. package/lib/types/dsh-adapter/status.d.ts +148 -0
  1050. package/lib/types/dsh-adapter/status.d.ts.map +1 -0
  1051. package/lib/types/dsh-adapter/status.js +435 -0
  1052. package/lib/types/dsh-adapter/subagents.d.ts +64 -0
  1053. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -0
  1054. package/lib/types/dsh-adapter/subagents.js +366 -0
  1055. package/lib/types/dsh-adapter/themes.d.ts +52 -0
  1056. package/lib/types/dsh-adapter/themes.d.ts.map +1 -0
  1057. package/lib/types/dsh-adapter/themes.js +307 -0
  1058. package/lib/types/dsh-adapter/toast.d.ts +80 -0
  1059. package/lib/types/dsh-adapter/toast.d.ts.map +1 -0
  1060. package/lib/types/dsh-adapter/toast.js +171 -0
  1061. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +47 -0
  1062. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -0
  1063. package/lib/types/dsh-adapter/trajectory/aggregate.js +208 -0
  1064. package/lib/types/dsh-adapter/trajectory/guards.d.ts +196 -0
  1065. package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -0
  1066. package/lib/types/dsh-adapter/trajectory/guards.js +273 -0
  1067. package/lib/types/dsh-adapter/trajectory/index.d.ts +16 -0
  1068. package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -0
  1069. package/lib/types/dsh-adapter/trajectory/index.js +15 -0
  1070. package/lib/types/dsh-adapter/trajectory/inspect.d.ts +40 -0
  1071. package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -0
  1072. package/lib/types/dsh-adapter/trajectory/inspect.js +160 -0
  1073. package/lib/types/dsh-adapter/trajectory/projection.d.ts +146 -0
  1074. package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -0
  1075. package/lib/types/dsh-adapter/trajectory/projection.js +710 -0
  1076. package/lib/types/dsh-adapter/trajectory/types.d.ts +232 -0
  1077. package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -0
  1078. package/lib/types/dsh-adapter/trajectory/types.js +70 -0
  1079. package/lib/types/dsh-adapter/trajectory/wave.d.ts +45 -0
  1080. package/lib/types/dsh-adapter/trajectory/wave.d.ts.map +1 -0
  1081. package/lib/types/dsh-adapter/trajectory/wave.js +210 -0
  1082. package/lib/types/dsh-adapter/transcript-images.d.ts +17 -0
  1083. package/lib/types/dsh-adapter/transcript-images.d.ts.map +1 -0
  1084. package/lib/types/dsh-adapter/transcript-images.js +96 -0
  1085. package/lib/types/dsh-adapter/types.d.ts +23 -0
  1086. package/lib/types/dsh-adapter/types.d.ts.map +1 -0
  1087. package/lib/types/dsh-adapter/types.js +1 -0
  1088. package/lib/types/dsh-adapter/workspace.d.ts +22 -0
  1089. package/lib/types/dsh-adapter/workspace.d.ts.map +1 -0
  1090. package/lib/types/dsh-adapter/workspace.js +16 -0
  1091. package/lib/types/dsh-adapter/workspaces.d.ts +125 -0
  1092. package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -0
  1093. package/lib/types/dsh-adapter/workspaces.js +543 -0
  1094. package/lib/types/effortPrefs.d.ts +48 -0
  1095. package/lib/types/effortPrefs.d.ts.map +1 -0
  1096. package/lib/types/effortPrefs.js +95 -0
  1097. package/lib/types/extensions.d.ts +18 -0
  1098. package/lib/types/extensions.d.ts.map +1 -0
  1099. package/lib/types/extensions.js +27 -0
  1100. package/lib/types/force-production-react.d.ts +1 -0
  1101. package/lib/types/force-production-react.d.ts.map +1 -0
  1102. package/lib/types/force-production-react.js +12 -0
  1103. package/lib/types/herdr.d.ts +28 -0
  1104. package/lib/types/herdr.d.ts.map +1 -0
  1105. package/lib/types/herdr.js +133 -0
  1106. package/lib/types/history.d.ts +39 -0
  1107. package/lib/types/history.d.ts.map +1 -0
  1108. package/lib/types/history.js +177 -0
  1109. package/lib/types/homePrefs.d.ts +15 -0
  1110. package/lib/types/homePrefs.d.ts.map +1 -0
  1111. package/lib/types/homePrefs.js +53 -0
  1112. package/lib/types/hooks/useBlink.d.ts +10 -0
  1113. package/lib/types/hooks/useBlink.d.ts.map +1 -0
  1114. package/lib/types/hooks/useBlink.js +19 -0
  1115. package/lib/types/hooks/useExternalVersion.d.ts +32 -0
  1116. package/lib/types/hooks/useExternalVersion.d.ts.map +1 -0
  1117. package/lib/types/hooks/useExternalVersion.js +53 -0
  1118. package/lib/types/hooks/useRevealVersion.d.ts +21 -0
  1119. package/lib/types/hooks/useRevealVersion.d.ts.map +1 -0
  1120. package/lib/types/hooks/useRevealVersion.js +33 -0
  1121. package/lib/types/hooks/useRuntimeThemeSnapshot.d.ts +10 -0
  1122. package/lib/types/hooks/useRuntimeThemeSnapshot.d.ts.map +1 -0
  1123. package/lib/types/hooks/useRuntimeThemeSnapshot.js +32 -0
  1124. package/lib/types/i18n.d.ts +4433 -0
  1125. package/lib/types/i18n.d.ts.map +1 -0
  1126. package/lib/types/i18n.js +1493 -0
  1127. package/lib/types/index.d.ts +3 -0
  1128. package/lib/types/index.d.ts.map +1 -0
  1129. package/lib/types/index.js +4 -0
  1130. package/lib/types/ink/Ansi.d.ts +9 -0
  1131. package/lib/types/ink/Ansi.d.ts.map +1 -0
  1132. package/lib/types/ink/Ansi.js +45 -0
  1133. package/lib/types/ink/bidi.d.ts +18 -0
  1134. package/lib/types/ink/bidi.d.ts.map +1 -0
  1135. package/lib/types/ink/bidi.js +119 -0
  1136. package/lib/types/ink/clearTerminal.d.ts +22 -0
  1137. package/lib/types/ink/clearTerminal.d.ts.map +1 -0
  1138. package/lib/types/ink/clearTerminal.js +72 -0
  1139. package/lib/types/ink/colorize.d.ts +43 -0
  1140. package/lib/types/ink/colorize.d.ts.map +1 -0
  1141. package/lib/types/ink/colorize.js +233 -0
  1142. package/lib/types/ink/components/AlternateScreen.d.ts +8 -0
  1143. package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -0
  1144. package/lib/types/ink/components/AlternateScreen.js +29 -0
  1145. package/lib/types/ink/components/App.d.ts +149 -0
  1146. package/lib/types/ink/components/App.d.ts.map +1 -0
  1147. package/lib/types/ink/components/App.js +1027 -0
  1148. package/lib/types/ink/components/AppContext.d.ts +17 -0
  1149. package/lib/types/ink/components/AppContext.d.ts.map +1 -0
  1150. package/lib/types/ink/components/AppContext.js +12 -0
  1151. package/lib/types/ink/components/Box.d.ts +85 -0
  1152. package/lib/types/ink/components/Box.d.ts.map +1 -0
  1153. package/lib/types/ink/components/Box.js +22 -0
  1154. package/lib/types/ink/components/Button.d.ts +37 -0
  1155. package/lib/types/ink/components/Button.d.ts.map +1 -0
  1156. package/lib/types/ink/components/Button.js +23 -0
  1157. package/lib/types/ink/components/ClockContext.d.ts +17 -0
  1158. package/lib/types/ink/components/ClockContext.d.ts.map +1 -0
  1159. package/lib/types/ink/components/ClockContext.js +99 -0
  1160. package/lib/types/ink/components/CursorDeclarationContext.d.ts +30 -0
  1161. package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -0
  1162. package/lib/types/ink/components/CursorDeclarationContext.js +6 -0
  1163. package/lib/types/ink/components/ErrorOverview.d.ts +7 -0
  1164. package/lib/types/ink/components/ErrorOverview.d.ts.map +1 -0
  1165. package/lib/types/ink/components/ErrorOverview.js +49 -0
  1166. package/lib/types/ink/components/Image.d.ts +28 -0
  1167. package/lib/types/ink/components/Image.d.ts.map +1 -0
  1168. package/lib/types/ink/components/Image.js +44 -0
  1169. package/lib/types/ink/components/Link.d.ts +8 -0
  1170. package/lib/types/ink/components/Link.d.ts.map +1 -0
  1171. package/lib/types/ink/components/Link.js +7 -0
  1172. package/lib/types/ink/components/Newline.d.ts +7 -0
  1173. package/lib/types/ink/components/Newline.d.ts.map +1 -0
  1174. package/lib/types/ink/components/Newline.js +5 -0
  1175. package/lib/types/ink/components/NoSelect.d.ts +9 -0
  1176. package/lib/types/ink/components/NoSelect.d.ts.map +1 -0
  1177. package/lib/types/ink/components/NoSelect.js +6 -0
  1178. package/lib/types/ink/components/RawAnsi.d.ts +9 -0
  1179. package/lib/types/ink/components/RawAnsi.d.ts.map +1 -0
  1180. package/lib/types/ink/components/RawAnsi.js +7 -0
  1181. package/lib/types/ink/components/ScrollBox.d.ts +78 -0
  1182. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -0
  1183. package/lib/types/ink/components/ScrollBox.js +309 -0
  1184. package/lib/types/ink/components/Spacer.d.ts +4 -0
  1185. package/lib/types/ink/components/Spacer.d.ts.map +1 -0
  1186. package/lib/types/ink/components/Spacer.js +6 -0
  1187. package/lib/types/ink/components/StdinContext.d.ts +32 -0
  1188. package/lib/types/ink/components/StdinContext.d.ts.map +1 -0
  1189. package/lib/types/ink/components/StdinContext.js +16 -0
  1190. package/lib/types/ink/components/TerminalFocusContext.d.ts +11 -0
  1191. package/lib/types/ink/components/TerminalFocusContext.d.ts.map +1 -0
  1192. package/lib/types/ink/components/TerminalFocusContext.js +11 -0
  1193. package/lib/types/ink/components/TerminalSizeContext.d.ts +6 -0
  1194. package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -0
  1195. package/lib/types/ink/components/TerminalSizeContext.js +2 -0
  1196. package/lib/types/ink/components/Text.d.ts +64 -0
  1197. package/lib/types/ink/components/Text.d.ts.map +1 -0
  1198. package/lib/types/ink/components/Text.js +19 -0
  1199. package/lib/types/ink/constants.d.ts +12 -0
  1200. package/lib/types/ink/constants.d.ts.map +1 -0
  1201. package/lib/types/ink/constants.js +11 -0
  1202. package/lib/types/ink/cursor.d.ts +11 -0
  1203. package/lib/types/ink/cursor.d.ts.map +1 -0
  1204. package/lib/types/ink/cursor.js +1 -0
  1205. package/lib/types/ink/devtools.d.ts +7 -0
  1206. package/lib/types/ink/devtools.d.ts.map +1 -0
  1207. package/lib/types/ink/devtools.js +1 -0
  1208. package/lib/types/ink/dom.d.ts +194 -0
  1209. package/lib/types/ink/dom.d.ts.map +1 -0
  1210. package/lib/types/ink/dom.js +424 -0
  1211. package/lib/types/ink/events/click-event.d.ts +23 -0
  1212. package/lib/types/ink/events/click-event.d.ts.map +1 -0
  1213. package/lib/types/ink/events/click-event.js +33 -0
  1214. package/lib/types/ink/events/context-menu-event.d.ts +19 -0
  1215. package/lib/types/ink/events/context-menu-event.d.ts.map +1 -0
  1216. package/lib/types/ink/events/context-menu-event.js +20 -0
  1217. package/lib/types/ink/events/dispatcher.d.ts +63 -0
  1218. package/lib/types/ink/events/dispatcher.d.ts.map +1 -0
  1219. package/lib/types/ink/events/dispatcher.js +194 -0
  1220. package/lib/types/ink/events/drag-event.d.ts +44 -0
  1221. package/lib/types/ink/events/drag-event.d.ts.map +1 -0
  1222. package/lib/types/ink/events/drag-event.js +39 -0
  1223. package/lib/types/ink/events/emitter.d.ts +20 -0
  1224. package/lib/types/ink/events/emitter.d.ts.map +1 -0
  1225. package/lib/types/ink/events/emitter.js +43 -0
  1226. package/lib/types/ink/events/event-handlers.d.ts +65 -0
  1227. package/lib/types/ink/events/event-handlers.d.ts.map +1 -0
  1228. package/lib/types/ink/events/event-handlers.js +40 -0
  1229. package/lib/types/ink/events/event.d.ts +19 -0
  1230. package/lib/types/ink/events/event.d.ts.map +1 -0
  1231. package/lib/types/ink/events/event.js +22 -0
  1232. package/lib/types/ink/events/focus-event.d.ts +19 -0
  1233. package/lib/types/ink/events/focus-event.d.ts.map +1 -0
  1234. package/lib/types/ink/events/focus-event.js +21 -0
  1235. package/lib/types/ink/events/input-event.d.ts +72 -0
  1236. package/lib/types/ink/events/input-event.d.ts.map +1 -0
  1237. package/lib/types/ink/events/input-event.js +185 -0
  1238. package/lib/types/ink/events/keyboard-event.d.ts +40 -0
  1239. package/lib/types/ink/events/keyboard-event.d.ts.map +1 -0
  1240. package/lib/types/ink/events/keyboard-event.js +65 -0
  1241. package/lib/types/ink/events/paste-event.d.ts +11 -0
  1242. package/lib/types/ink/events/paste-event.d.ts.map +1 -0
  1243. package/lib/types/ink/events/paste-event.js +13 -0
  1244. package/lib/types/ink/events/pointer-event.d.ts +61 -0
  1245. package/lib/types/ink/events/pointer-event.d.ts.map +1 -0
  1246. package/lib/types/ink/events/pointer-event.js +61 -0
  1247. package/lib/types/ink/events/resize-event.d.ts +13 -0
  1248. package/lib/types/ink/events/resize-event.d.ts.map +1 -0
  1249. package/lib/types/ink/events/resize-event.js +16 -0
  1250. package/lib/types/ink/events/terminal-event.d.ts +112 -0
  1251. package/lib/types/ink/events/terminal-event.d.ts.map +1 -0
  1252. package/lib/types/ink/events/terminal-event.js +131 -0
  1253. package/lib/types/ink/events/terminal-focus-event.d.ts +21 -0
  1254. package/lib/types/ink/events/terminal-focus-event.d.ts.map +1 -0
  1255. package/lib/types/ink/events/terminal-focus-event.js +18 -0
  1256. package/lib/types/ink/events/wheel-event.d.ts +17 -0
  1257. package/lib/types/ink/events/wheel-event.d.ts.map +1 -0
  1258. package/lib/types/ink/events/wheel-event.js +20 -0
  1259. package/lib/types/ink/flush-tick.d.ts +26 -0
  1260. package/lib/types/ink/flush-tick.d.ts.map +1 -0
  1261. package/lib/types/ink/flush-tick.js +31 -0
  1262. package/lib/types/ink/focus.d.ts +74 -0
  1263. package/lib/types/ink/focus.d.ts.map +1 -0
  1264. package/lib/types/ink/focus.js +188 -0
  1265. package/lib/types/ink/frame.d.ts +128 -0
  1266. package/lib/types/ink/frame.d.ts.map +1 -0
  1267. package/lib/types/ink/frame.js +43 -0
  1268. package/lib/types/ink/geometry-trace.d.ts +51 -0
  1269. package/lib/types/ink/geometry-trace.d.ts.map +1 -0
  1270. package/lib/types/ink/geometry-trace.js +83 -0
  1271. package/lib/types/ink/get-max-width.d.ts +12 -0
  1272. package/lib/types/ink/get-max-width.d.ts.map +1 -0
  1273. package/lib/types/ink/get-max-width.js +12 -0
  1274. package/lib/types/ink/hit-test.d.ts +181 -0
  1275. package/lib/types/ink/hit-test.d.ts.map +1 -0
  1276. package/lib/types/ink/hit-test.js +540 -0
  1277. package/lib/types/ink/hooks/use-animation-frame.d.ts +27 -0
  1278. package/lib/types/ink/hooks/use-animation-frame.d.ts.map +1 -0
  1279. package/lib/types/ink/hooks/use-animation-frame.js +48 -0
  1280. package/lib/types/ink/hooks/use-app.d.ts +7 -0
  1281. package/lib/types/ink/hooks/use-app.d.ts.map +1 -0
  1282. package/lib/types/ink/hooks/use-app.js +7 -0
  1283. package/lib/types/ink/hooks/use-copy-on-select.d.ts +26 -0
  1284. package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -0
  1285. package/lib/types/ink/hooks/use-copy-on-select.js +54 -0
  1286. package/lib/types/ink/hooks/use-declared-cursor.d.ts +31 -0
  1287. package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -0
  1288. package/lib/types/ink/hooks/use-declared-cursor.js +65 -0
  1289. package/lib/types/ink/hooks/use-input.d.ts +41 -0
  1290. package/lib/types/ink/hooks/use-input.d.ts.map +1 -0
  1291. package/lib/types/ink/hooks/use-input.js +81 -0
  1292. package/lib/types/ink/hooks/use-interval.d.ts +23 -0
  1293. package/lib/types/ink/hooks/use-interval.d.ts.map +1 -0
  1294. package/lib/types/ink/hooks/use-interval.js +58 -0
  1295. package/lib/types/ink/hooks/use-search-highlight.d.ts +34 -0
  1296. package/lib/types/ink/hooks/use-search-highlight.d.ts.map +1 -0
  1297. package/lib/types/ink/hooks/use-search-highlight.js +35 -0
  1298. package/lib/types/ink/hooks/use-selection.d.ts +44 -0
  1299. package/lib/types/ink/hooks/use-selection.d.ts.map +1 -0
  1300. package/lib/types/ink/hooks/use-selection.js +64 -0
  1301. package/lib/types/ink/hooks/use-stdin.d.ts +8 -0
  1302. package/lib/types/ink/hooks/use-stdin.d.ts.map +1 -0
  1303. package/lib/types/ink/hooks/use-stdin.js +8 -0
  1304. package/lib/types/ink/hooks/use-tab-status.d.ts +18 -0
  1305. package/lib/types/ink/hooks/use-tab-status.d.ts.map +1 -0
  1306. package/lib/types/ink/hooks/use-tab-status.js +58 -0
  1307. package/lib/types/ink/hooks/use-terminal-focus.d.ts +11 -0
  1308. package/lib/types/ink/hooks/use-terminal-focus.d.ts.map +1 -0
  1309. package/lib/types/ink/hooks/use-terminal-focus.js +15 -0
  1310. package/lib/types/ink/hooks/use-terminal-images.d.ts +14 -0
  1311. package/lib/types/ink/hooks/use-terminal-images.d.ts.map +1 -0
  1312. package/lib/types/ink/hooks/use-terminal-images.js +22 -0
  1313. package/lib/types/ink/hooks/use-terminal-size.d.ts +6 -0
  1314. package/lib/types/ink/hooks/use-terminal-size.d.ts.map +1 -0
  1315. package/lib/types/ink/hooks/use-terminal-size.js +12 -0
  1316. package/lib/types/ink/hooks/use-terminal-title.d.ts +14 -0
  1317. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -0
  1318. package/lib/types/ink/hooks/use-terminal-title.js +30 -0
  1319. package/lib/types/ink/hooks/use-terminal-viewport.d.ts +32 -0
  1320. package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
  1321. package/lib/types/ink/hooks/use-terminal-viewport.js +79 -0
  1322. package/lib/types/ink/ink.d.ts +571 -0
  1323. package/lib/types/ink/ink.d.ts.map +1 -0
  1324. package/lib/types/ink/ink.js +2818 -0
  1325. package/lib/types/ink/input-suppression.d.ts +20 -0
  1326. package/lib/types/ink/input-suppression.d.ts.map +1 -0
  1327. package/lib/types/ink/input-suppression.js +26 -0
  1328. package/lib/types/ink/instances.d.ts +10 -0
  1329. package/lib/types/ink/instances.d.ts.map +1 -0
  1330. package/lib/types/ink/instances.js +13 -0
  1331. package/lib/types/ink/kitty-graphics.d.ts +41 -0
  1332. package/lib/types/ink/kitty-graphics.d.ts.map +1 -0
  1333. package/lib/types/ink/kitty-graphics.js +229 -0
  1334. package/lib/types/ink/layout/engine.d.ts +7 -0
  1335. package/lib/types/ink/layout/engine.d.ts.map +1 -0
  1336. package/lib/types/ink/layout/engine.js +8 -0
  1337. package/lib/types/ink/layout/geometry.d.ts +86 -0
  1338. package/lib/types/ink/layout/geometry.d.ts.map +1 -0
  1339. package/lib/types/ink/layout/geometry.js +95 -0
  1340. package/lib/types/ink/layout/node.d.ts +153 -0
  1341. package/lib/types/ink/layout/node.d.ts.map +1 -0
  1342. package/lib/types/ink/layout/node.js +72 -0
  1343. package/lib/types/ink/layout/yoga.d.ts +70 -0
  1344. package/lib/types/ink/layout/yoga.d.ts.map +1 -0
  1345. package/lib/types/ink/layout/yoga.js +252 -0
  1346. package/lib/types/ink/line-width-cache.d.ts +9 -0
  1347. package/lib/types/ink/line-width-cache.d.ts.map +1 -0
  1348. package/lib/types/ink/line-width-cache.js +45 -0
  1349. package/lib/types/ink/log-update.d.ts +57 -0
  1350. package/lib/types/ink/log-update.d.ts.map +1 -0
  1351. package/lib/types/ink/log-update.js +1000 -0
  1352. package/lib/types/ink/measure-element.d.ts +19 -0
  1353. package/lib/types/ink/measure-element.d.ts.map +1 -0
  1354. package/lib/types/ink/measure-element.js +10 -0
  1355. package/lib/types/ink/measure-text.d.ts +13 -0
  1356. package/lib/types/ink/measure-text.d.ts.map +1 -0
  1357. package/lib/types/ink/measure-text.js +38 -0
  1358. package/lib/types/ink/node-cache.d.ts +54 -0
  1359. package/lib/types/ink/node-cache.d.ts.map +1 -0
  1360. package/lib/types/ink/node-cache.js +45 -0
  1361. package/lib/types/ink/optimizer.d.ts +18 -0
  1362. package/lib/types/ink/optimizer.d.ts.map +1 -0
  1363. package/lib/types/ink/optimizer.js +83 -0
  1364. package/lib/types/ink/output.d.ts +300 -0
  1365. package/lib/types/ink/output.d.ts.map +1 -0
  1366. package/lib/types/ink/output.js +1205 -0
  1367. package/lib/types/ink/parse-keypress.d.ts +217 -0
  1368. package/lib/types/ink/parse-keypress.d.ts.map +1 -0
  1369. package/lib/types/ink/parse-keypress.js +1550 -0
  1370. package/lib/types/ink/reconciler.d.ts +43 -0
  1371. package/lib/types/ink/reconciler.d.ts.map +1 -0
  1372. package/lib/types/ink/reconciler.js +414 -0
  1373. package/lib/types/ink/render-border.d.ts +41 -0
  1374. package/lib/types/ink/render-border.d.ts.map +1 -0
  1375. package/lib/types/ink/render-border.js +159 -0
  1376. package/lib/types/ink/render-node-to-output.d.ts +199 -0
  1377. package/lib/types/ink/render-node-to-output.d.ts.map +1 -0
  1378. package/lib/types/ink/render-node-to-output.js +1758 -0
  1379. package/lib/types/ink/render-to-screen.d.ts +65 -0
  1380. package/lib/types/ink/render-to-screen.d.ts.map +1 -0
  1381. package/lib/types/ink/render-to-screen.js +189 -0
  1382. package/lib/types/ink/renderer.d.ts +34 -0
  1383. package/lib/types/ink/renderer.d.ts.map +1 -0
  1384. package/lib/types/ink/renderer.js +181 -0
  1385. package/lib/types/ink/root.d.ts +109 -0
  1386. package/lib/types/ink/root.d.ts.map +1 -0
  1387. package/lib/types/ink/root.js +96 -0
  1388. package/lib/types/ink/screen.d.ts +545 -0
  1389. package/lib/types/ink/screen.d.ts.map +1 -0
  1390. package/lib/types/ink/screen.js +1607 -0
  1391. package/lib/types/ink/selection.d.ts +529 -0
  1392. package/lib/types/ink/selection.d.ts.map +1 -0
  1393. package/lib/types/ink/selection.js +1292 -0
  1394. package/lib/types/ink/sixel-codec.d.ts +41 -0
  1395. package/lib/types/ink/sixel-codec.d.ts.map +1 -0
  1396. package/lib/types/ink/sixel-codec.js +128 -0
  1397. package/lib/types/ink/sixel-graphics.d.ts +74 -0
  1398. package/lib/types/ink/sixel-graphics.d.ts.map +1 -0
  1399. package/lib/types/ink/sixel-graphics.js +498 -0
  1400. package/lib/types/ink/sixel-worker.d.ts +2 -0
  1401. package/lib/types/ink/sixel-worker.d.ts.map +1 -0
  1402. package/lib/types/ink/sixel-worker.js +12 -0
  1403. package/lib/types/ink/squash-text-nodes.d.ts +30 -0
  1404. package/lib/types/ink/squash-text-nodes.d.ts.map +1 -0
  1405. package/lib/types/ink/squash-text-nodes.js +63 -0
  1406. package/lib/types/ink/stringWidth.d.ts +3 -0
  1407. package/lib/types/ink/stringWidth.d.ts.map +1 -0
  1408. package/lib/types/ink/stringWidth.js +248 -0
  1409. package/lib/types/ink/styles.d.ts +346 -0
  1410. package/lib/types/ink/styles.d.ts.map +1 -0
  1411. package/lib/types/ink/styles.js +307 -0
  1412. package/lib/types/ink/supports-hyperlinks.d.ts +20 -0
  1413. package/lib/types/ink/supports-hyperlinks.d.ts.map +1 -0
  1414. package/lib/types/ink/supports-hyperlinks.js +44 -0
  1415. package/lib/types/ink/tabstops.d.ts +10 -0
  1416. package/lib/types/ink/tabstops.d.ts.map +1 -0
  1417. package/lib/types/ink/tabstops.js +47 -0
  1418. package/lib/types/ink/terminal-focus-state.d.ts +35 -0
  1419. package/lib/types/ink/terminal-focus-state.d.ts.map +1 -0
  1420. package/lib/types/ink/terminal-focus-state.js +57 -0
  1421. package/lib/types/ink/terminal-image-protocol.d.ts +4 -0
  1422. package/lib/types/ink/terminal-image-protocol.d.ts.map +1 -0
  1423. package/lib/types/ink/terminal-image-protocol.js +8 -0
  1424. package/lib/types/ink/terminal-image.d.ts +102 -0
  1425. package/lib/types/ink/terminal-image.d.ts.map +1 -0
  1426. package/lib/types/ink/terminal-image.js +223 -0
  1427. package/lib/types/ink/terminal-querier.d.ts +203 -0
  1428. package/lib/types/ink/terminal-querier.d.ts.map +1 -0
  1429. package/lib/types/ink/terminal-querier.js +286 -0
  1430. package/lib/types/ink/terminal.d.ts +192 -0
  1431. package/lib/types/ink/terminal.d.ts.map +1 -0
  1432. package/lib/types/ink/terminal.js +436 -0
  1433. package/lib/types/ink/termio/ansi.d.ts +75 -0
  1434. package/lib/types/ink/termio/ansi.d.ts.map +1 -0
  1435. package/lib/types/ink/termio/ansi.js +79 -0
  1436. package/lib/types/ink/termio/csi.d.ts +263 -0
  1437. package/lib/types/ink/termio/csi.d.ts.map +1 -0
  1438. package/lib/types/ink/termio/csi.js +367 -0
  1439. package/lib/types/ink/termio/dec.d.ts +61 -0
  1440. package/lib/types/ink/termio/dec.d.ts.map +1 -0
  1441. package/lib/types/ink/termio/dec.js +76 -0
  1442. package/lib/types/ink/termio/esc.d.ts +15 -0
  1443. package/lib/types/ink/termio/esc.d.ts.map +1 -0
  1444. package/lib/types/ink/termio/esc.js +57 -0
  1445. package/lib/types/ink/termio/osc.d.ts +198 -0
  1446. package/lib/types/ink/termio/osc.d.ts.map +1 -0
  1447. package/lib/types/ink/termio/osc.js +475 -0
  1448. package/lib/types/ink/termio/parser.d.ts +46 -0
  1449. package/lib/types/ink/termio/parser.d.ts.map +1 -0
  1450. package/lib/types/ink/termio/parser.js +366 -0
  1451. package/lib/types/ink/termio/sgr.d.ts +17 -0
  1452. package/lib/types/ink/termio/sgr.d.ts.map +1 -0
  1453. package/lib/types/ink/termio/sgr.js +300 -0
  1454. package/lib/types/ink/termio/tokenize.d.ts +56 -0
  1455. package/lib/types/ink/termio/tokenize.d.ts.map +1 -0
  1456. package/lib/types/ink/termio/tokenize.js +290 -0
  1457. package/lib/types/ink/termio/types.d.ts +211 -0
  1458. package/lib/types/ink/termio/types.d.ts.map +1 -0
  1459. package/lib/types/ink/termio/types.js +68 -0
  1460. package/lib/types/ink/termio.d.ts +25 -0
  1461. package/lib/types/ink/termio.d.ts.map +1 -0
  1462. package/lib/types/ink/termio.js +24 -0
  1463. package/lib/types/ink/timeline-rail.d.ts +134 -0
  1464. package/lib/types/ink/timeline-rail.d.ts.map +1 -0
  1465. package/lib/types/ink/timeline-rail.js +175 -0
  1466. package/lib/types/ink/transcript-highlight.d.ts +25 -0
  1467. package/lib/types/ink/transcript-highlight.d.ts.map +1 -0
  1468. package/lib/types/ink/transcript-highlight.js +82 -0
  1469. package/lib/types/ink/truncateToWidth.d.ts +7 -0
  1470. package/lib/types/ink/truncateToWidth.d.ts.map +1 -0
  1471. package/lib/types/ink/truncateToWidth.js +18 -0
  1472. package/lib/types/ink/update-overflow-guard.d.ts +62 -0
  1473. package/lib/types/ink/update-overflow-guard.d.ts.map +1 -0
  1474. package/lib/types/ink/update-overflow-guard.js +164 -0
  1475. package/lib/types/ink/useTerminalNotification.d.ts +45 -0
  1476. package/lib/types/ink/useTerminalNotification.d.ts.map +1 -0
  1477. package/lib/types/ink/useTerminalNotification.js +70 -0
  1478. package/lib/types/ink/warn.d.ts +7 -0
  1479. package/lib/types/ink/warn.d.ts.map +1 -0
  1480. package/lib/types/ink/warn.js +15 -0
  1481. package/lib/types/ink/widest-line.d.ts +7 -0
  1482. package/lib/types/ink/widest-line.d.ts.map +1 -0
  1483. package/lib/types/ink/widest-line.js +19 -0
  1484. package/lib/types/ink/wrap-text.d.ts +10 -0
  1485. package/lib/types/ink/wrap-text.d.ts.map +1 -0
  1486. package/lib/types/ink/wrap-text.js +103 -0
  1487. package/lib/types/ink/wrapAnsi.d.ts +17 -0
  1488. package/lib/types/ink/wrapAnsi.d.ts.map +1 -0
  1489. package/lib/types/ink/wrapAnsi.js +38 -0
  1490. package/lib/types/jsx-runtime.d.ts +2 -0
  1491. package/lib/types/jsx-runtime.d.ts.map +1 -0
  1492. package/lib/types/jsx-runtime.js +13 -0
  1493. package/lib/types/migrationPrefs.d.ts +60 -0
  1494. package/lib/types/migrationPrefs.d.ts.map +1 -0
  1495. package/lib/types/migrationPrefs.js +97 -0
  1496. package/lib/types/minimalMode.d.ts +13 -0
  1497. package/lib/types/minimalMode.d.ts.map +1 -0
  1498. package/lib/types/minimalMode.js +17 -0
  1499. package/lib/types/modelGroups.d.ts +72 -0
  1500. package/lib/types/modelGroups.d.ts.map +1 -0
  1501. package/lib/types/modelGroups.js +97 -0
  1502. package/lib/types/modelPrefs.d.ts +37 -0
  1503. package/lib/types/modelPrefs.d.ts.map +1 -0
  1504. package/lib/types/modelPrefs.js +66 -0
  1505. package/lib/types/modelRecents.d.ts +39 -0
  1506. package/lib/types/modelRecents.d.ts.map +1 -0
  1507. package/lib/types/modelRecents.js +97 -0
  1508. package/lib/types/modelRoute.d.ts +87 -0
  1509. package/lib/types/modelRoute.d.ts.map +1 -0
  1510. package/lib/types/modelRoute.js +125 -0
  1511. package/lib/types/native-ts/yoga-layout/enums.d.ts +183 -0
  1512. package/lib/types/native-ts/yoga-layout/enums.d.ts.map +1 -0
  1513. package/lib/types/native-ts/yoga-layout/enums.js +150 -0
  1514. package/lib/types/native-ts/yoga-layout/index.d.ts +804 -0
  1515. package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -0
  1516. package/lib/types/native-ts/yoga-layout/index.js +2614 -0
  1517. package/lib/types/oauth.d.ts +15 -0
  1518. package/lib/types/oauth.d.ts.map +1 -0
  1519. package/lib/types/oauth.js +14 -0
  1520. package/lib/types/plugin-host.d.ts +14 -0
  1521. package/lib/types/plugin-host.d.ts.map +1 -0
  1522. package/lib/types/plugin-host.js +19 -0
  1523. package/lib/types/presetPrefs.d.ts +30 -0
  1524. package/lib/types/presetPrefs.d.ts.map +1 -0
  1525. package/lib/types/presetPrefs.js +66 -0
  1526. package/lib/types/reload.d.ts +109 -0
  1527. package/lib/types/reload.d.ts.map +1 -0
  1528. package/lib/types/reload.js +118 -0
  1529. package/lib/types/scenes.d.ts +4 -0
  1530. package/lib/types/scenes.d.ts.map +1 -0
  1531. package/lib/types/scenes.js +4 -0
  1532. package/lib/types/screens/Chat.d.ts +82 -0
  1533. package/lib/types/screens/Chat.d.ts.map +1 -0
  1534. package/lib/types/screens/Chat.js +4299 -0
  1535. package/lib/types/screens/SessionSupervisor.d.ts +84 -0
  1536. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -0
  1537. package/lib/types/screens/SessionSupervisor.js +350 -0
  1538. package/lib/types/screens/SessionTree.d.ts +27 -0
  1539. package/lib/types/screens/SessionTree.d.ts.map +1 -0
  1540. package/lib/types/screens/SessionTree.js +583 -0
  1541. package/lib/types/screens/Settings.d.ts +22 -0
  1542. package/lib/types/screens/Settings.d.ts.map +1 -0
  1543. package/lib/types/screens/Settings.js +592 -0
  1544. package/lib/types/screens/StatusLine.d.ts +48 -0
  1545. package/lib/types/screens/StatusLine.d.ts.map +1 -0
  1546. package/lib/types/screens/StatusLine.js +453 -0
  1547. package/lib/types/screens/StatusMetrics.d.ts +176 -0
  1548. package/lib/types/screens/StatusMetrics.d.ts.map +1 -0
  1549. package/lib/types/screens/StatusMetrics.js +372 -0
  1550. package/lib/types/screens/TrajectoryScene.d.ts +16 -0
  1551. package/lib/types/screens/TrajectoryScene.d.ts.map +1 -0
  1552. package/lib/types/screens/TrajectoryScene.js +374 -0
  1553. package/lib/types/screens/chatOverlay.d.ts +267 -0
  1554. package/lib/types/screens/chatOverlay.d.ts.map +1 -0
  1555. package/lib/types/screens/chatOverlay.js +132 -0
  1556. package/lib/types/screens/sessionSupervisor/model.d.ts +83 -0
  1557. package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -0
  1558. package/lib/types/screens/sessionSupervisor/model.js +69 -0
  1559. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +120 -0
  1560. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -0
  1561. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +639 -0
  1562. package/lib/types/sessionHistory.d.ts +59 -0
  1563. package/lib/types/sessionHistory.d.ts.map +1 -0
  1564. package/lib/types/sessionHistory.js +223 -0
  1565. package/lib/types/sessionModes.d.ts +83 -0
  1566. package/lib/types/sessionModes.d.ts.map +1 -0
  1567. package/lib/types/sessionModes.js +141 -0
  1568. package/lib/types/sessionMounts.d.ts +272 -0
  1569. package/lib/types/sessionMounts.d.ts.map +1 -0
  1570. package/lib/types/sessionMounts.js +706 -0
  1571. package/lib/types/sessionPins.d.ts +33 -0
  1572. package/lib/types/sessionPins.d.ts.map +1 -0
  1573. package/lib/types/sessionPins.js +181 -0
  1574. package/lib/types/sessions/format.d.ts +125 -0
  1575. package/lib/types/sessions/format.d.ts.map +1 -0
  1576. package/lib/types/sessions/format.js +276 -0
  1577. package/lib/types/sessions/resumeFailure.d.ts +38 -0
  1578. package/lib/types/sessions/resumeFailure.d.ts.map +1 -0
  1579. package/lib/types/sessions/resumeFailure.js +58 -0
  1580. package/lib/types/sessions/view.d.ts +162 -0
  1581. package/lib/types/sessions/view.d.ts.map +1 -0
  1582. package/lib/types/sessions/view.js +350 -0
  1583. package/lib/types/settings-sections.d.ts +4 -0
  1584. package/lib/types/settings-sections.d.ts.map +1 -0
  1585. package/lib/types/settings-sections.js +4 -0
  1586. package/lib/types/terminal-utils/cliHighlight.d.ts +20 -0
  1587. package/lib/types/terminal-utils/cliHighlight.d.ts.map +1 -0
  1588. package/lib/types/terminal-utils/cliHighlight.js +53 -0
  1589. package/lib/types/terminal-utils/figures.d.ts +26 -0
  1590. package/lib/types/terminal-utils/figures.d.ts.map +1 -0
  1591. package/lib/types/terminal-utils/figures.js +36 -0
  1592. package/lib/types/terminal-utils/format.d.ts +35 -0
  1593. package/lib/types/terminal-utils/format.d.ts.map +1 -0
  1594. package/lib/types/terminal-utils/format.js +63 -0
  1595. package/lib/types/terminal-utils/hash.d.ts +25 -0
  1596. package/lib/types/terminal-utils/hash.d.ts.map +1 -0
  1597. package/lib/types/terminal-utils/hash.js +41 -0
  1598. package/lib/types/terminal-utils/hyperlink.d.ts +27 -0
  1599. package/lib/types/terminal-utils/hyperlink.d.ts.map +1 -0
  1600. package/lib/types/terminal-utils/hyperlink.js +70 -0
  1601. package/lib/types/terminal-utils/markdown.d.ts +58 -0
  1602. package/lib/types/terminal-utils/markdown.d.ts.map +1 -0
  1603. package/lib/types/terminal-utils/markdown.js +441 -0
  1604. package/lib/types/terminal-utils/mermaid.d.ts +44 -0
  1605. package/lib/types/terminal-utils/mermaid.d.ts.map +1 -0
  1606. package/lib/types/terminal-utils/mermaid.js +83 -0
  1607. package/lib/types/terminal-utils/sessionColors.d.ts +27 -0
  1608. package/lib/types/terminal-utils/sessionColors.d.ts.map +1 -0
  1609. package/lib/types/terminal-utils/sessionColors.js +39 -0
  1610. package/lib/types/terminal-utils/spinnerVerbs.d.ts +3 -0
  1611. package/lib/types/terminal-utils/spinnerVerbs.d.ts.map +1 -0
  1612. package/lib/types/terminal-utils/spinnerVerbs.js +21 -0
  1613. package/lib/types/terminal-utils/syntaxRuns.d.ts +16 -0
  1614. package/lib/types/terminal-utils/syntaxRuns.d.ts.map +1 -0
  1615. package/lib/types/terminal-utils/syntaxRuns.js +79 -0
  1616. package/lib/types/terminal-utils/syntaxTheme.d.ts +12 -0
  1617. package/lib/types/terminal-utils/syntaxTheme.d.ts.map +1 -0
  1618. package/lib/types/terminal-utils/syntaxTheme.js +76 -0
  1619. package/lib/types/theme.d.ts +201 -0
  1620. package/lib/types/theme.d.ts.map +1 -0
  1621. package/lib/types/theme.js +525 -0
  1622. package/lib/types/themeCatalog.d.ts +36 -0
  1623. package/lib/types/themeCatalog.d.ts.map +1 -0
  1624. package/lib/types/themeCatalog.js +159 -0
  1625. package/lib/types/themePrefs.d.ts +28 -0
  1626. package/lib/types/themePrefs.d.ts.map +1 -0
  1627. package/lib/types/themePrefs.js +59 -0
  1628. package/lib/types/tips.d.ts +30 -0
  1629. package/lib/types/tips.d.ts.map +1 -0
  1630. package/lib/types/tips.js +899 -0
  1631. package/lib/types/trajectory/effortIgnition.d.ts +66 -0
  1632. package/lib/types/trajectory/effortIgnition.d.ts.map +1 -0
  1633. package/lib/types/trajectory/effortIgnition.js +142 -0
  1634. package/lib/types/trajectory/format.d.ts +100 -0
  1635. package/lib/types/trajectory/format.d.ts.map +1 -0
  1636. package/lib/types/trajectory/format.js +213 -0
  1637. package/lib/types/trajectory/motion.d.ts +99 -0
  1638. package/lib/types/trajectory/motion.d.ts.map +1 -0
  1639. package/lib/types/trajectory/motion.js +143 -0
  1640. package/lib/types/trajectory/query.d.ts +83 -0
  1641. package/lib/types/trajectory/query.d.ts.map +1 -0
  1642. package/lib/types/trajectory/query.js +187 -0
  1643. package/lib/types/trajectoryPrefs.d.ts +36 -0
  1644. package/lib/types/trajectoryPrefs.d.ts.map +1 -0
  1645. package/lib/types/trajectoryPrefs.js +65 -0
  1646. package/lib/types/tuiDisplayPrefs.d.ts +49 -0
  1647. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -0
  1648. package/lib/types/tuiDisplayPrefs.js +168 -0
  1649. package/lib/types/ui.d.ts +29 -0
  1650. package/lib/types/ui.d.ts.map +1 -0
  1651. package/lib/types/ui.js +25 -0
  1652. package/lib/types/update.d.ts +550 -0
  1653. package/lib/types/update.d.ts.map +1 -0
  1654. package/lib/types/update.js +1751 -0
  1655. package/lib/types/utils/clipboard.d.ts +122 -0
  1656. package/lib/types/utils/clipboard.d.ts.map +1 -0
  1657. package/lib/types/utils/clipboard.js +577 -0
  1658. package/lib/types/utils/credentials.d.ts +13 -0
  1659. package/lib/types/utils/credentials.d.ts.map +1 -0
  1660. package/lib/types/utils/credentials.js +41 -0
  1661. package/lib/types/utils/debug.d.ts +18 -0
  1662. package/lib/types/utils/debug.d.ts.map +1 -0
  1663. package/lib/types/utils/debug.js +37 -0
  1664. package/lib/types/utils/earlyInput.d.ts +6 -0
  1665. package/lib/types/utils/earlyInput.d.ts.map +1 -0
  1666. package/lib/types/utils/earlyInput.js +5 -0
  1667. package/lib/types/utils/env.d.ts +8 -0
  1668. package/lib/types/utils/env.d.ts.map +1 -0
  1669. package/lib/types/utils/env.js +7 -0
  1670. package/lib/types/utils/envUtils.d.ts +8 -0
  1671. package/lib/types/utils/envUtils.d.ts.map +1 -0
  1672. package/lib/types/utils/envUtils.js +13 -0
  1673. package/lib/types/utils/execFileNoThrow.d.ts +17 -0
  1674. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -0
  1675. package/lib/types/utils/execFileNoThrow.js +65 -0
  1676. package/lib/types/utils/externalEditor.d.ts +116 -0
  1677. package/lib/types/utils/externalEditor.d.ts.map +1 -0
  1678. package/lib/types/utils/externalEditor.js +270 -0
  1679. package/lib/types/utils/fileSuggestions.d.ts +12 -0
  1680. package/lib/types/utils/fileSuggestions.d.ts.map +1 -0
  1681. package/lib/types/utils/fileSuggestions.js +40 -0
  1682. package/lib/types/utils/fileTarget.d.ts +46 -0
  1683. package/lib/types/utils/fileTarget.d.ts.map +1 -0
  1684. package/lib/types/utils/fileTarget.js +178 -0
  1685. package/lib/types/utils/fold-long-lines.d.ts +38 -0
  1686. package/lib/types/utils/fold-long-lines.d.ts.map +1 -0
  1687. package/lib/types/utils/fold-long-lines.js +91 -0
  1688. package/lib/types/utils/fullscreen.d.ts +7 -0
  1689. package/lib/types/utils/fullscreen.d.ts.map +1 -0
  1690. package/lib/types/utils/fullscreen.js +9 -0
  1691. package/lib/types/utils/imageResize.d.ts +90 -0
  1692. package/lib/types/utils/imageResize.d.ts.map +1 -0
  1693. package/lib/types/utils/imageResize.js +272 -0
  1694. package/lib/types/utils/intl.d.ts +7 -0
  1695. package/lib/types/utils/intl.d.ts.map +1 -0
  1696. package/lib/types/utils/intl.js +9 -0
  1697. package/lib/types/utils/keymap.d.ts +138 -0
  1698. package/lib/types/utils/keymap.d.ts.map +1 -0
  1699. package/lib/types/utils/keymap.js +351 -0
  1700. package/lib/types/utils/loaded-context.d.ts +25 -0
  1701. package/lib/types/utils/loaded-context.d.ts.map +1 -0
  1702. package/lib/types/utils/loaded-context.js +72 -0
  1703. package/lib/types/utils/log.d.ts +7 -0
  1704. package/lib/types/utils/log.d.ts.map +1 -0
  1705. package/lib/types/utils/log.js +9 -0
  1706. package/lib/types/utils/mentions.d.ts +53 -0
  1707. package/lib/types/utils/mentions.d.ts.map +1 -0
  1708. package/lib/types/utils/mentions.js +133 -0
  1709. package/lib/types/utils/modifiers.d.ts +43 -0
  1710. package/lib/types/utils/modifiers.d.ts.map +1 -0
  1711. package/lib/types/utils/modifiers.js +45 -0
  1712. package/lib/types/utils/narration.d.ts +11 -0
  1713. package/lib/types/utils/narration.d.ts.map +1 -0
  1714. package/lib/types/utils/narration.js +16 -0
  1715. package/lib/types/utils/openExternal.d.ts +50 -0
  1716. package/lib/types/utils/openExternal.d.ts.map +1 -0
  1717. package/lib/types/utils/openExternal.js +170 -0
  1718. package/lib/types/utils/pastedImagePath.d.ts +51 -0
  1719. package/lib/types/utils/pastedImagePath.d.ts.map +1 -0
  1720. package/lib/types/utils/pastedImagePath.js +194 -0
  1721. package/lib/types/utils/paths.d.ts +16 -0
  1722. package/lib/types/utils/paths.d.ts.map +1 -0
  1723. package/lib/types/utils/paths.js +19 -0
  1724. package/lib/types/utils/semver.d.ts +9 -0
  1725. package/lib/types/utils/semver.d.ts.map +1 -0
  1726. package/lib/types/utils/semver.js +24 -0
  1727. package/lib/types/utils/shellQuote.d.ts +14 -0
  1728. package/lib/types/utils/shellQuote.d.ts.map +1 -0
  1729. package/lib/types/utils/shellQuote.js +39 -0
  1730. package/lib/types/utils/sliceAnsi.d.ts +12 -0
  1731. package/lib/types/utils/sliceAnsi.d.ts.map +1 -0
  1732. package/lib/types/utils/sliceAnsi.js +79 -0
  1733. package/lib/types/utils/truncateMiddle.d.ts +9 -0
  1734. package/lib/types/utils/truncateMiddle.d.ts.map +1 -0
  1735. package/lib/types/utils/truncateMiddle.js +28 -0
  1736. package/lib/types/utils/urlGuard.d.ts +28 -0
  1737. package/lib/types/utils/urlGuard.d.ts.map +1 -0
  1738. package/lib/types/utils/urlGuard.js +21 -0
  1739. package/lib/types/utils/workspaceRoot.d.ts +21 -0
  1740. package/lib/types/utils/workspaceRoot.d.ts.map +1 -0
  1741. package/lib/types/utils/workspaceRoot.js +47 -0
  1742. package/lib/types/working-activity.d.ts +32 -0
  1743. package/lib/types/working-activity.d.ts.map +1 -0
  1744. package/lib/types/working-activity.js +38 -0
  1745. package/lib/types/workspaces.d.ts +5 -0
  1746. package/lib/types/workspaces.d.ts.map +1 -0
  1747. package/lib/types/workspaces.js +4 -0
  1748. package/node_modules/@askdkc/dsh-auth/LICENSE +21 -0
  1749. package/node_modules/@askdkc/dsh-auth/README.ja.md +164 -0
  1750. package/node_modules/@askdkc/dsh-auth/README.md +163 -0
  1751. package/node_modules/@askdkc/dsh-auth/cordis.patch.yml +11 -0
  1752. package/node_modules/@askdkc/dsh-auth/dsh-plugin.json +44 -0
  1753. package/node_modules/@askdkc/dsh-auth/lib/command.d.ts +14 -0
  1754. package/node_modules/@askdkc/dsh-auth/lib/command.js +70 -0
  1755. package/node_modules/@askdkc/dsh-auth/lib/credentials.d.ts +63 -0
  1756. package/node_modules/@askdkc/dsh-auth/lib/credentials.js +204 -0
  1757. package/node_modules/@askdkc/dsh-auth/lib/custom-profiles.d.ts +26 -0
  1758. package/node_modules/@askdkc/dsh-auth/lib/custom-profiles.js +142 -0
  1759. package/node_modules/@askdkc/dsh-auth/lib/index.d.ts +96 -0
  1760. package/node_modules/@askdkc/dsh-auth/lib/index.js +263 -0
  1761. package/node_modules/@askdkc/dsh-auth/lib/interaction.d.ts +68 -0
  1762. package/node_modules/@askdkc/dsh-auth/lib/interaction.js +193 -0
  1763. package/node_modules/@askdkc/dsh-auth/lib/nous-oauth.d.ts +5 -0
  1764. package/node_modules/@askdkc/dsh-auth/lib/nous-oauth.js +112 -0
  1765. package/node_modules/@askdkc/dsh-auth/lib/opener.d.ts +32 -0
  1766. package/node_modules/@askdkc/dsh-auth/lib/opener.js +101 -0
  1767. package/node_modules/@askdkc/dsh-auth/lib/pi-ai.d.ts +23 -0
  1768. package/node_modules/@askdkc/dsh-auth/lib/pi-ai.js +27 -0
  1769. package/node_modules/@askdkc/dsh-auth/lib/profiles.d.ts +45 -0
  1770. package/node_modules/@askdkc/dsh-auth/lib/profiles.js +110 -0
  1771. package/node_modules/@askdkc/dsh-auth/lib/service.d.ts +80 -0
  1772. package/node_modules/@askdkc/dsh-auth/lib/service.js +224 -0
  1773. package/node_modules/@askdkc/dsh-auth/package.json +70 -0
  1774. package/node_modules/@dsh-std/command/CHANGELOG.md +8 -0
  1775. package/node_modules/@dsh-std/command/LICENSE +21 -0
  1776. package/node_modules/@dsh-std/command/README.md +26 -0
  1777. package/node_modules/@dsh-std/command/README.zh.md +28 -0
  1778. package/node_modules/@dsh-std/command/lib/index.d.ts +144 -0
  1779. package/node_modules/@dsh-std/command/lib/index.d.ts.map +1 -0
  1780. package/node_modules/@dsh-std/command/lib/index.js +252 -0
  1781. package/node_modules/@dsh-std/command/lib/index.js.map +1 -0
  1782. package/node_modules/@dsh-std/command/package.json +22 -0
  1783. package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
  1784. package/node_modules/@dsh-std/connection/LICENSE +21 -0
  1785. package/node_modules/@dsh-std/connection/README.md +42 -0
  1786. package/node_modules/@dsh-std/connection/README.zh.md +42 -0
  1787. package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  1788. package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  1789. package/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  1790. package/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  1791. package/node_modules/@dsh-std/connection/lib/index.js +158 -0
  1792. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  1793. package/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  1794. package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  1795. package/node_modules/@dsh-std/connection/lib/memory.js +258 -0
  1796. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  1797. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  1798. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  1799. package/node_modules/@dsh-std/connection/package.json +20 -0
  1800. package/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1801. package/node_modules/@dsh-std/core/LICENSE +21 -0
  1802. package/node_modules/@dsh-std/core/README.md +13 -0
  1803. package/node_modules/@dsh-std/core/README.zh.md +13 -0
  1804. package/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1805. package/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1806. package/node_modules/@dsh-std/core/lib/index.js +424 -0
  1807. package/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1808. package/node_modules/@dsh-std/core/package.json +21 -0
  1809. package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
  1810. package/node_modules/@dsh-std/manifest/LICENSE +21 -0
  1811. package/node_modules/@dsh-std/manifest/README.md +5 -0
  1812. package/node_modules/@dsh-std/manifest/README.zh.md +5 -0
  1813. package/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
  1814. package/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
  1815. package/node_modules/@dsh-std/manifest/lib/index.js +625 -0
  1816. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
  1817. package/node_modules/@dsh-std/manifest/package.json +20 -0
  1818. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
  1819. package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -0
  1820. package/node_modules/@dsh-std/messages/LICENSE +21 -0
  1821. package/node_modules/@dsh-std/messages/README.md +5 -0
  1822. package/node_modules/@dsh-std/messages/README.zh.md +7 -0
  1823. package/node_modules/@dsh-std/messages/lib/index.d.ts +50 -0
  1824. package/node_modules/@dsh-std/messages/lib/index.d.ts.map +1 -0
  1825. package/node_modules/@dsh-std/messages/lib/index.js +151 -0
  1826. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -0
  1827. package/node_modules/@dsh-std/messages/package.json +20 -0
  1828. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -0
  1829. package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
  1830. package/node_modules/@dsh-std/presentation/LICENSE +21 -0
  1831. package/node_modules/@dsh-std/presentation/README.md +27 -0
  1832. package/node_modules/@dsh-std/presentation/README.zh.md +29 -0
  1833. package/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
  1834. package/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
  1835. package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
  1836. package/node_modules/@dsh-std/presentation/lib/index.d.ts +262 -0
  1837. package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
  1838. package/node_modules/@dsh-std/presentation/lib/index.js +550 -0
  1839. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
  1840. package/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
  1841. package/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
  1842. package/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
  1843. package/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
  1844. package/node_modules/@dsh-std/presentation/package.json +25 -0
  1845. package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -0
  1846. package/node_modules/@dsh-std/storage/LICENSE +21 -0
  1847. package/node_modules/@dsh-std/storage/README.md +5 -0
  1848. package/node_modules/@dsh-std/storage/README.zh.md +7 -0
  1849. package/node_modules/@dsh-std/storage/lib/index.d.ts +48 -0
  1850. package/node_modules/@dsh-std/storage/lib/index.d.ts.map +1 -0
  1851. package/node_modules/@dsh-std/storage/lib/index.js +104 -0
  1852. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -0
  1853. package/node_modules/@dsh-std/storage/package.json +20 -0
  1854. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -0
  1855. package/package.json +492 -0
  1856. package/presets/liangshen/.dsh-tui-managed.json +5 -0
  1857. package/presets/liangshen/agent.cordis.yml +425 -0
  1858. package/presets/liangshen/compaction-epoch.mjs +83 -0
  1859. package/presets/liangshen/custom-bash.mjs +301 -0
  1860. package/presets/liangshen/instruction-hint.mjs +190 -0
  1861. package/presets/liangshen/preset.yml +3 -0
  1862. package/presets/liangshen/session-events.mjs +8 -0
  1863. package/presets/liangshen/skill-search.mjs +141 -0
  1864. package/presets/liangshen/tool-bootstrap.mjs +300 -0
  1865. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
  1866. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -0
  1867. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -0
  1868. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -0
  1869. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  1870. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  1871. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  1872. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  1873. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js +158 -0
  1874. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  1875. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  1876. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  1877. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +258 -0
  1878. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  1879. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  1880. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  1881. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -0
  1882. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1883. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -0
  1884. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -0
  1885. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -0
  1886. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1887. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1888. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js +424 -0
  1889. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1890. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -0
  1891. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
  1892. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -0
  1893. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -0
  1894. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -0
  1895. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
  1896. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
  1897. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js +625 -0
  1898. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
  1899. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -0
  1900. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
  1901. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
  1902. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -0
  1903. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -0
  1904. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -0
  1905. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
  1906. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
  1907. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
  1908. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +262 -0
  1909. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
  1910. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +550 -0
  1911. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
  1912. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
  1913. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
  1914. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
  1915. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
  1916. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -0
  1917. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1918. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -0
  1919. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -0
  1920. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -0
  1921. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1922. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1923. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js +424 -0
  1924. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1925. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -0
  1926. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1927. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -0
  1928. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -0
  1929. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -0
  1930. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1931. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1932. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js +424 -0
  1933. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1934. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -0
  1935. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1936. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -0
  1937. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -0
  1938. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -0
  1939. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1940. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1941. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js +424 -0
  1942. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1943. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -0
  1944. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
  1945. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -0
  1946. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -0
  1947. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -0
  1948. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  1949. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  1950. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  1951. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  1952. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js +158 -0
  1953. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  1954. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  1955. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  1956. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +258 -0
  1957. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  1958. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  1959. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  1960. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -0
  1961. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1962. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -0
  1963. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -0
  1964. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -0
  1965. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1966. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1967. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js +424 -0
  1968. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1969. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -0
  1970. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  1971. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -0
  1972. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -0
  1973. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -0
  1974. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  1975. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  1976. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js +424 -0
  1977. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  1978. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -0
@@ -0,0 +1,1751 @@
1
+ import { execFileSync, spawn } from 'node:child_process';
2
+ import { createHash } from 'node:crypto';
3
+ import { appendFileSync, chmodSync, copyFileSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
4
+ import { homedir } from 'node:os';
5
+ import { dirname, join, resolve, sep } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { gte, gt, lt, valid } from 'semver';
8
+ import { shellQuote } from './utils/shellQuote.js';
9
+ import { DATA_DIR } from './utils/paths.js';
10
+ // Re-exported for scripts/verify-update.mjs and the bin launcher, which reads
11
+ // the compiled copy at lib/types/utils/shellQuote.js.
12
+ export { shellQuote };
13
+ const PACKAGE_NAME = 'dsh-cli';
14
+ const DEFAULT_REGISTRY = 'https://registry.npmjs.org';
15
+ const GITHUB_REPO = 'askdkc/dsh-TUI-fork';
16
+ const UPDATE_CHECK_TIMEOUT_MS = 4000;
17
+ const STANDALONE_DOWNLOAD_TIMEOUT_MS = 300000;
18
+ /**
19
+ * Hard cap on a single release asset the updater will accept, checked against
20
+ * the declared content-length BEFORE the body is buffered, and enforced as a
21
+ * mid-stream abort while the body downloads (a chunked response with no
22
+ * content-length header is interrupted at the cap instead of buffered whole —
23
+ * a hostile mirror must not be able to pin the process in an unbounded
24
+ * arrayBuffer() and OOM it).
25
+ */
26
+ const MAX_ASSET_BYTES = 512 * 1024 * 1024;
27
+ /** The SHA256SUMS manifest itself is plain text; anything past this is broken. */
28
+ const MAX_CHECKSUM_MANIFEST_BYTES = 1024 * 1024;
29
+ /** env marker set on the /update restart; the new process verifies it at boot. */
30
+ const UPDATED_FROM_ENV = 'DSH_TUI_UPDATED_FROM';
31
+ /**
32
+ * env marker set on the /restart replacement: its boot logs to restart.log
33
+ * (ordinary launches stay silent, so the file is restart-only evidence).
34
+ */
35
+ const RESTART_CHILD_ENV = 'DSH_TUI_RESTART_CHILD';
36
+ /**
37
+ * Field-diagnosis log for the /restart terminal handoff, appended by BOTH
38
+ * processes: the exiting TUI logs the funnel path, the spawned replacement
39
+ * logs its boot progress, and every line carries pid + timestamp — so a
40
+ * handoff that dies at any stage (loader entry, TTY gate, session resume,
41
+ * even after the parent's survival window) leaves breadcrumbs on disk even
42
+ * when nothing reaches the already-confused terminal. Diagnosis only: every
43
+ * write is best effort and must never break the handoff itself.
44
+ */
45
+ const RESTART_LOG = join(DATA_DIR, 'restart.log');
46
+ /** Cap so a long debugging streak cannot grow the log unbounded. */
47
+ const RESTART_LOG_MAX_BYTES = 256 * 1024;
48
+ function writeRestartLine(line) {
49
+ try {
50
+ mkdirSync(DATA_DIR, { recursive: true });
51
+ appendFileSync(RESTART_LOG, `${new Date().toISOString()} pid=${process.pid} ${line}\n`);
52
+ }
53
+ catch {
54
+ // Diagnosis only.
55
+ }
56
+ }
57
+ /**
58
+ * Append a /restart handoff event to ~/.dsh-tui/restart.log.
59
+ * @param event - Short stable event name.
60
+ * @param data - Small JSON-safe detail (never credentials or session text).
61
+ */
62
+ export function logRestartEvent(event, data) {
63
+ writeRestartLine(`${event}${data === undefined ? '' : ` ${JSON.stringify(data)}`}`);
64
+ }
65
+ /** Start a fresh, clearly delimited /restart attempt block in the log. */
66
+ export function beginRestartAttempt(sessionId) {
67
+ try {
68
+ mkdirSync(DATA_DIR, { recursive: true });
69
+ let size = 0;
70
+ try {
71
+ size = statSync(RESTART_LOG).size;
72
+ }
73
+ catch {
74
+ size = 0;
75
+ }
76
+ if (size > RESTART_LOG_MAX_BYTES)
77
+ writeFileSync(RESTART_LOG, '');
78
+ }
79
+ catch {
80
+ // Diagnosis only.
81
+ }
82
+ writeRestartLine(`--- /restart attempt session=${sessionId} ---`);
83
+ }
84
+ /**
85
+ * Write a handoff notice to stderr synchronously: process.exit() right after
86
+ * an async stream write skips the flush, and a vanished diagnosis is
87
+ * indistinguishable from a silent failure.
88
+ */
89
+ export function writeHandoffNotice(text) {
90
+ try {
91
+ writeFileSync(2, text);
92
+ }
93
+ catch {
94
+ process.stderr.write(text);
95
+ }
96
+ }
97
+ /** Read the version from either the compiled package or the source checkout. */
98
+ export function installedTuiVersion() {
99
+ const here = dirname(fileURLToPath(import.meta.url));
100
+ for (const relativePath of ['../../package.json', '../package.json']) {
101
+ try {
102
+ const parsed = JSON.parse(readFileSync(join(here, relativePath), 'utf8'));
103
+ if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)) {
104
+ const packageJson = parsed;
105
+ const version = packageJson.version;
106
+ if (packageJson.name === PACKAGE_NAME && typeof version === 'string' && valid(version) !== null) {
107
+ return version;
108
+ }
109
+ }
110
+ }
111
+ catch {
112
+ // Try the source-layout fallback after the compiled-layout path.
113
+ }
114
+ }
115
+ return undefined;
116
+ }
117
+ /**
118
+ * The profile this TUI was booted with (`dsh --profile <name>`), read from
119
+ * the launcher argv the process inherited. dsh sets no profile env var, and
120
+ * its launcher parses its own flags first, so the first `--profile` token in
121
+ * argv is the launcher's. Undefined for non-profile launches (source
122
+ * checkouts, `--config` overlays) — there is no profile installation for
123
+ * `/update` to act on, so the command must stay disabled there.
124
+ */
125
+ export function resolveDshProfileName(argv = process.argv) {
126
+ for (let i = 0; i < argv.length; i++) {
127
+ const arg = argv[i];
128
+ if (arg === '--profile') {
129
+ const value = argv[i + 1];
130
+ return value !== undefined && value !== '' && !value.startsWith('-') ? value : undefined;
131
+ }
132
+ if (arg.startsWith('--profile=')) {
133
+ const value = arg.slice('--profile='.length);
134
+ return value !== '' ? value : undefined;
135
+ }
136
+ }
137
+ return undefined;
138
+ }
139
+ /**
140
+ * Resolve the registry base URL the way npm/pnpm would: `NPM_CONFIG_REGISTRY`
141
+ * (both spellings) over the `registry=` line in ~/.npmrc over npmjs.org, so
142
+ * mirror users see the same `latest` their package manager would install.
143
+ */
144
+ export function resolveRegistryBase() {
145
+ const fromEnv = process.env.NPM_CONFIG_REGISTRY ?? process.env.npm_config_registry;
146
+ if (fromEnv !== undefined && fromEnv !== '')
147
+ return fromEnv.replace(/\/+$/, '');
148
+ try {
149
+ const npmrc = readFileSync(join(homedir(), '.npmrc'), 'utf8');
150
+ const match = /^\s*registry\s*=\s*(\S+)\s*$/m.exec(npmrc);
151
+ if (match !== null)
152
+ return match[1].replace(/\/+$/, '');
153
+ }
154
+ catch {
155
+ // No readable user .npmrc — the default registry applies.
156
+ }
157
+ return DEFAULT_REGISTRY;
158
+ }
159
+ /** True when `current` is a strictly newer valid version than `previous`. */
160
+ export function isVersionNewer(current, previous) {
161
+ const a = valid(current);
162
+ const b = valid(previous);
163
+ return a !== null && b !== null && gt(a, b);
164
+ }
165
+ /**
166
+ * Versions whose compiled plugin hard-injects `tuiWorkspaces`
167
+ * ('0.7.0'–'0.7.1'; removed in 0.7.2). Installing one while the globally
168
+ * installed launcher copy predates the `dsh-tui-workspaces` patch row
169
+ * deadlocks boot forever at "pending (waiting for service: tuiWorkspaces)"
170
+ * (issues #183/#307) — and /update reaching such a target is exactly how
171
+ * stale-mirror installs stranded users. /update must refuse them.
172
+ * @param version - the candidate install target.
173
+ * @returns true for the known boot-deadlock version range.
174
+ */
175
+ export function isBootDeadlockTarget(version) {
176
+ const v = valid(version);
177
+ return v !== null && gte(v, '0.7.0') && lt(v, '0.7.2');
178
+ }
179
+ function isRecord(value) {
180
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
181
+ }
182
+ /** Fetch `latest` from a registry; undefined on any failure. */
183
+ async function fetchLatestVersion(registryBase) {
184
+ const controller = new AbortController();
185
+ const timeout = setTimeout(() => controller.abort(), UPDATE_CHECK_TIMEOUT_MS);
186
+ try {
187
+ const response = await fetch(`${registryBase}/${PACKAGE_NAME}/latest`, {
188
+ headers: { accept: 'application/json' },
189
+ signal: controller.signal,
190
+ });
191
+ if (!response.ok)
192
+ return undefined;
193
+ const payload = await response.json();
194
+ const latest = isRecord(payload) && typeof payload.version === 'string'
195
+ ? valid(payload.version)
196
+ : null;
197
+ return latest ?? undefined;
198
+ }
199
+ catch {
200
+ return undefined;
201
+ }
202
+ finally {
203
+ clearTimeout(timeout);
204
+ }
205
+ }
206
+ /**
207
+ * Detect whether the current process is running in standalone / portable package mode.
208
+ *
209
+ * @returns `true` when running inside a standalone binary distribution, `false` otherwise.
210
+ */
211
+ export function isStandaloneRuntime() {
212
+ return (process.env.DSH_TUI_STANDALONE === '1' ||
213
+ process.env.DSH_TUI_STANDALONE_BINARY !== undefined ||
214
+ (typeof process.env.DSH_HOME === 'string' && process.env.DSH_HOME.includes('dsh-tui-standalone')));
215
+ }
216
+ /**
217
+ * Get the path to the current standalone executable binary.
218
+ *
219
+ * @returns The resolved executable path from environment or `process.execPath`.
220
+ */
221
+ export function getStandaloneBinaryPath() {
222
+ return process.env.DSH_TUI_STANDALONE_BINARY ?? process.execPath;
223
+ }
224
+ /**
225
+ * Get the expected release asset file name for the current platform and architecture.
226
+ *
227
+ * @param platform - Node.js platform identifier (e.g. `'linux'`, `'win32'`, `'darwin'`).
228
+ * @param arch - Node.js architecture identifier (e.g. `'x64'`, `'arm64'`).
229
+ * @returns The archive file name matching the target platform.
230
+ */
231
+ export function getStandaloneAssetName(platform = process.platform, arch = process.arch) {
232
+ if (platform === 'win32') {
233
+ return 'dsh-tui-standalone-win-x64.zip';
234
+ }
235
+ if (platform === 'darwin') {
236
+ return arch === 'arm64'
237
+ ? 'dsh-tui-standalone-darwin-arm64.tar.gz'
238
+ : 'dsh-tui-standalone-darwin-x64.tar.gz';
239
+ }
240
+ return arch === 'arm64'
241
+ ? 'dsh-tui-standalone-linux-arm64.tar.gz'
242
+ : 'dsh-tui-standalone-linux-x64.tar.gz';
243
+ }
244
+ /**
245
+ * Locate the release's checksum manifest among its assets: the aggregator
246
+ * `SHA256SUMS` file first, then a single-asset `<asset>.sha256` sidecar —
247
+ * and nothing else. A name-blind `endsWith('.sha256')` fallback (removed,
248
+ * external review) could claim ANOTHER asset's sidecar (e.g. the win zip's
249
+ * digest next to a linux update), whose mismatch then fail-closed innocent
250
+ * users' updates; an unrecognized layout resolves to undefined so the
251
+ * transition-period warning path applies instead.
252
+ * @param assets - Parsed release asset objects.
253
+ * @param assetName - The main asset whose sidecar, if any, is exact-named.
254
+ * @returns The manifest's browser_download_url, or undefined when the release
255
+ * publishes none (the transition-period warning path).
256
+ */
257
+ function findChecksumAssetUrl(assets, assetName) {
258
+ const urlOf = (a) => isRecord(a) && typeof a.name === 'string' && typeof a.browser_download_url === 'string';
259
+ const byName = (name) => assets.find(a => urlOf(a) && a.name === name);
260
+ const sums = byName('SHA256SUMS');
261
+ if (sums !== undefined)
262
+ return sums.browser_download_url;
263
+ const exact = byName(`${assetName}.sha256`);
264
+ return exact === undefined ? undefined : exact.browser_download_url;
265
+ }
266
+ /**
267
+ * Fixed-name SHA256SUMS download URL for a release version — the
268
+ * mirror-fallback counterpart of {@link findChecksumAssetUrl}: when the
269
+ * GitHub API is unreachable and the version came from a registry, there is no
270
+ * asset list to parse, so the manifest is probed at its conventional name on
271
+ * the same direct-download host (release-bundle.yml publishes it as
272
+ * `SHA256SUMS` next to every asset).
273
+ */
274
+ export function releaseChecksumUrl(version) {
275
+ return `https://github.com/${GITHUB_REPO}/releases/download/v${version}/SHA256SUMS`;
276
+ }
277
+ /**
278
+ * Probe whether a release publishes a checksum manifest at a URL. Only an OK
279
+ * response resolves to the URL — a 404 (the release predates the checksum
280
+ * workflow) or any network failure resolves to undefined so the update keeps
281
+ * the transition-period warning path instead of being blocked (new releases
282
+ * always ship the manifest; old ones must keep updating).
283
+ */
284
+ async function probeChecksumManifestUrl(url) {
285
+ const controller = new AbortController();
286
+ const timeout = setTimeout(() => controller.abort(), UPDATE_CHECK_TIMEOUT_MS);
287
+ try {
288
+ const response = await fetch(url, {
289
+ headers: { 'user-agent': 'dsh-tui-updater' },
290
+ redirect: 'follow',
291
+ signal: controller.signal,
292
+ });
293
+ return response.ok ? url : undefined;
294
+ }
295
+ catch {
296
+ return undefined;
297
+ }
298
+ finally {
299
+ clearTimeout(timeout);
300
+ }
301
+ }
302
+ /**
303
+ * Fetch latest release info from GitHub Releases API for the standalone asset.
304
+ *
305
+ * @param options - Injectable API base / fetch for tests.
306
+ * @returns Release version tag, matching asset download URL, and the
307
+ * SHA256SUMS manifest URL when the release ships one, or `undefined` on any
308
+ * failure.
309
+ */
310
+ export async function fetchGithubLatestRelease(options = {}) {
311
+ const doFetch = options.fetchImpl ?? fetch;
312
+ const controller = new AbortController();
313
+ const timeout = setTimeout(() => controller.abort(), UPDATE_CHECK_TIMEOUT_MS);
314
+ try {
315
+ const response = await doFetch(`${options.apiBaseUrl ?? 'https://api.github.com'}/repos/${GITHUB_REPO}/releases/latest`, {
316
+ headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'dsh-tui-updater' },
317
+ signal: controller.signal,
318
+ });
319
+ if (!response.ok)
320
+ return undefined;
321
+ const payload = await response.json();
322
+ if (!isRecord(payload) || typeof payload.tag_name !== 'string')
323
+ return undefined;
324
+ const rawTag = payload.tag_name.replace(/^v/, '');
325
+ const version = valid(rawTag);
326
+ if (version === null)
327
+ return undefined;
328
+ const assetName = getStandaloneAssetName();
329
+ let downloadUrl;
330
+ let checksumUrl;
331
+ if (Array.isArray(payload.assets)) {
332
+ const asset = payload.assets.find((a) => isRecord(a) && a.name === assetName && typeof a.browser_download_url === 'string');
333
+ if (asset !== undefined && typeof asset.browser_download_url === 'string') {
334
+ downloadUrl = asset.browser_download_url;
335
+ }
336
+ checksumUrl = findChecksumAssetUrl(payload.assets, assetName);
337
+ }
338
+ if (downloadUrl === undefined) {
339
+ downloadUrl = `https://github.com/${GITHUB_REPO}/releases/download/v${version}/${assetName}`;
340
+ }
341
+ return checksumUrl === undefined ? { version, downloadUrl } : { version, downloadUrl, checksumUrl };
342
+ }
343
+ catch {
344
+ return undefined;
345
+ }
346
+ finally {
347
+ clearTimeout(timeout);
348
+ }
349
+ }
350
+ /**
351
+ * Verify a downloaded release asset against its SHA256SUMS manifest text
352
+ * (fail-closed in every ambiguous shape: a malformed line, a missing entry
353
+ * for the asset, or multiple bare digests all reject — a release that
354
+ * publishes a manifest has declared checksums mandatory for its assets).
355
+ * Both the GNU `hex␣␣name` and `hex␣*name` (binary-mode) line forms parse,
356
+ * and a single bare `hex` line (a `<asset>.sha256` sidecar) applies to the
357
+ * one asset it accompanies.
358
+ *
359
+ * Trust boundary (explicit scope note): the manifest is fetched from the
360
+ * SAME release as the asset, so what this check defends against is
361
+ * download-domain hijacking, cache poisoning, and asset/manifest mix-ups —
362
+ * any tampering that changes the asset without also controlling the
363
+ * release's published checksums. It does NOT defend against a fully
364
+ * compromised release source (attacker publishes matching checksums for
365
+ * malicious bytes): that requires a signature chain (minisign/cosign with
366
+ * the public key built into the binary) — a declared follow-up item, out
367
+ * of this change's scope.
368
+ *
369
+ * @param buffer - The downloaded asset bytes.
370
+ * @param manifestText - SHA256SUMS file content.
371
+ * @param assetName - Asset file name to look up in the manifest.
372
+ * @returns true only when the manifest names the asset and the digest matches.
373
+ */
374
+ export function verifyAssetChecksum(buffer, manifestText, assetName) {
375
+ const named = new Map();
376
+ let bareHex;
377
+ for (const rawLine of manifestText.split(/\r?\n/)) {
378
+ const line = rawLine.trim();
379
+ if (line === '' || line.startsWith('#'))
380
+ continue;
381
+ const match = /^([0-9a-fA-F]{64})(?:[ \t]+[ *]?(.*\S))?$/.exec(line);
382
+ if (match === null)
383
+ return false;
384
+ const hex = match[1].toLowerCase();
385
+ const name = match[2];
386
+ if (name === undefined) {
387
+ if (bareHex !== undefined)
388
+ return false;
389
+ bareHex = hex;
390
+ }
391
+ else {
392
+ named.set(name, hex);
393
+ }
394
+ }
395
+ const expected = named.get(assetName) ?? (named.size === 0 ? bareHex : undefined);
396
+ if (expected === undefined)
397
+ return false;
398
+ return createHash('sha256').update(buffer).digest('hex') === expected;
399
+ }
400
+ /**
401
+ * Escape a value for embedding in a PowerShell single-quoted literal: only
402
+ * `''` needs escaping there (same convention as `buildPsScript` in
403
+ * src/utils/clipboard.ts). Extract/archive paths derive from environment
404
+ * variables (`DSH_TUI_STANDALONE_CACHE`), so an unescaped `'` closes the
405
+ * literal and turns the rest of the path into executable command text.
406
+ * @param value - Raw string to embed between single quotes.
407
+ * @returns The value with every `'` doubled.
408
+ */
409
+ export function escapePsSingleQuoted(value) {
410
+ return value.replace(/'/g, "''");
411
+ }
412
+ export function windowsExtractPlan(downloadPath, extractDir, tarAvailable) {
413
+ if (tarAvailable) {
414
+ return { tool: 'tar', args: ['-xf', downloadPath, '-C', extractDir] };
415
+ }
416
+ return {
417
+ tool: 'powershell',
418
+ args: [
419
+ '-NoProfile', '-Command',
420
+ `Expand-Archive -Path '${escapePsSingleQuoted(downloadPath)}' -DestinationPath '${escapePsSingleQuoted(extractDir)}' -Force`,
421
+ ],
422
+ };
423
+ }
424
+ /** Probe for the Windows 10+ built-in bsdtar (missing on older LTSC images). */
425
+ function windowsTarAvailable() {
426
+ try {
427
+ execFileSync('tar', ['--version'], { stdio: 'ignore' });
428
+ return true;
429
+ }
430
+ catch {
431
+ return false;
432
+ }
433
+ }
434
+ /**
435
+ * Zip-slip / symlink guard between extraction and replacement (security
436
+ * review, medium): walk the freshly extracted tree WITHOUT following links
437
+ * and require every entry to be a regular file or directory whose resolved
438
+ * path stays inside the extract dir. GNU tar happily materializes symlink
439
+ * members pointing outside (verified: `link.txt -> /etc/passwd` lands on
440
+ * disk), and the follow-up copyFileSync would then read/write through the
441
+ * link; `../` members are also refused by tar/unzip themselves, but the
442
+ * prefix check here keeps the guard local and future-proof against a
443
+ * different extractor. The node-tar strict equivalent (preservePaths: false +
444
+ * strict) is in standalone/entry.mjs — this covers the system-tool paths
445
+ * entry.mjs cannot. Symlinks are rejected outright (defense in depth: a
446
+ * "harmless" in-tree link is still indistinguishable from a hostile one at
447
+ * this layer), as are fifo/socket/device entries — and hard links (red-team
448
+ * review): GNU tar refusing external linkname targets is extractor behavior,
449
+ * not a guarantee this code may lean on (busybox tar and friends land hard
450
+ * links verbatim), so any regular file with nlink > 1 is refused — a landed
451
+ * hard link aliases a file this walk never enumerated.
452
+ * @param extractDir - Directory the archive was extracted into.
453
+ * @returns ok plus the first offending entry's path.
454
+ */
455
+ export function validateExtractedTree(extractDir) {
456
+ const root = resolve(extractDir);
457
+ const walk = (dir) => {
458
+ let entries;
459
+ try {
460
+ entries = readdirSync(dir, { withFileTypes: true });
461
+ }
462
+ catch (error) {
463
+ return { ok: false, reason: `unreadable directory ${dir}: ${error instanceof Error ? error.message : String(error)}` };
464
+ }
465
+ for (const entry of entries) {
466
+ const full = resolve(join(dir, entry.name));
467
+ if (full !== root && !full.startsWith(root + sep)) {
468
+ return { ok: false, reason: `entry escapes the extract directory: ${full}` };
469
+ }
470
+ if (entry.isSymbolicLink()) {
471
+ return { ok: false, reason: `symbolic link in release archive: ${full}` };
472
+ }
473
+ if (entry.isDirectory()) {
474
+ const sub = walk(full);
475
+ if (!sub.ok)
476
+ return sub;
477
+ }
478
+ else if (!entry.isFile()) {
479
+ return { ok: false, reason: `non-regular entry in release archive: ${full}` };
480
+ }
481
+ else {
482
+ // Hard-link guard (see header): a regular file with more than one
483
+ // name on disk aliases something this enumeration never saw.
484
+ try {
485
+ if (lstatSync(full).nlink > 1) {
486
+ return { ok: false, reason: `hard link in release archive (nlink=${lstatSync(full).nlink}): ${full}` };
487
+ }
488
+ }
489
+ catch (error) {
490
+ return { ok: false, reason: `entry not statable: ${error instanceof Error ? error.message : String(error)}` };
491
+ }
492
+ }
493
+ }
494
+ return { ok: true };
495
+ };
496
+ return walk(root);
497
+ }
498
+ /**
499
+ * Fetch and size-cap a release's SHA256SUMS manifest. Any failure throws —
500
+ * a release that declares a manifest must actually be verifiable (fail
501
+ * closed), so the update never silently falls back to unverified bytes.
502
+ *
503
+ * The cap is enforced the same two-part way as the main asset download
504
+ * (see {@link downloadAndReplaceStandaloneBinary}): the declared
505
+ * content-length rejects before a byte is buffered, and the body is read
506
+ * through a streaming loop that aborts the connection the moment the
507
+ * running total passes the cap — a chunked response with no (or a lying)
508
+ * content-length header is interrupted at the cap instead of buffered
509
+ * whole by response.text() before the check runs.
510
+ * @param checksumUrl - Browser download URL of the manifest.
511
+ * @param maxManifestBytes - Size cap (default
512
+ * {@link MAX_CHECKSUM_MANIFEST_BYTES}); tests inject a small value.
513
+ * @returns The manifest text.
514
+ */
515
+ async function fetchChecksumManifest(checksumUrl, maxManifestBytes = MAX_CHECKSUM_MANIFEST_BYTES) {
516
+ const controller = new AbortController();
517
+ const timeout = setTimeout(() => controller.abort(), STANDALONE_DOWNLOAD_TIMEOUT_MS);
518
+ try {
519
+ const response = await fetch(checksumUrl, {
520
+ headers: { 'user-agent': 'dsh-tui-updater' },
521
+ redirect: 'follow',
522
+ signal: controller.signal,
523
+ });
524
+ if (!response.ok) {
525
+ throw new Error(`checksum manifest fetch failed: HTTP ${response.status} ${response.statusText}`);
526
+ }
527
+ const declared = Number(response.headers.get('content-length') ?? Number.NaN);
528
+ if (Number.isFinite(declared) && declared > maxManifestBytes) {
529
+ throw new Error(`checksum manifest declares ${declared} bytes, over the ${maxManifestBytes} cap`);
530
+ }
531
+ if (response.body === null) {
532
+ throw new Error('checksum manifest response has no body stream');
533
+ }
534
+ const reader = response.body.getReader();
535
+ const chunks = [];
536
+ let received = 0;
537
+ for (;;) {
538
+ const { done, value } = await reader.read();
539
+ if (done === true)
540
+ break;
541
+ received += value.byteLength;
542
+ if (received > maxManifestBytes) {
543
+ controller.abort();
544
+ try {
545
+ await reader.cancel();
546
+ }
547
+ catch { /* already aborted */ }
548
+ throw new Error(`checksum manifest streamed past ${received} bytes, over the ${maxManifestBytes} cap`);
549
+ }
550
+ chunks.push(value);
551
+ }
552
+ return Buffer.concat(chunks, received).toString('utf8');
553
+ }
554
+ finally {
555
+ clearTimeout(timeout);
556
+ }
557
+ }
558
+ /**
559
+ * Download the new standalone release binary package and atomically replace the running binary.
560
+ *
561
+ * Integrity (security review, high): when the caller resolved a SHA256SUMS
562
+ * manifest URL for the release, the downloaded bytes must match the manifest
563
+ * digest before anything is extracted or replaced — a mismatch (or an
564
+ * unreadable/malformed manifest) deletes the downloaded file and fails the
565
+ * update closed. Releases without any manifest still update, but the progress
566
+ * channel carries an explicit "no checksum" warning.
567
+ * TODO(next major): make the manifest mandatory — a release that publishes no
568
+ * checksums will then be refused outright instead of warned about.
569
+ *
570
+ * @param downloadUrl - Direct URL to download the release archive.
571
+ * @param onProgress - Optional callback invoked with progress status strings.
572
+ * @param checksumUrl - SHA256SUMS manifest URL for the release, when known.
573
+ * @param options - Injectable download limits (tests pass a small cap).
574
+ * @returns Object indicating success or an error message on failure.
575
+ */
576
+ export async function downloadAndReplaceStandaloneBinary(downloadUrl, onProgress, checksumUrl, options = {}) {
577
+ const maxAssetBytes = options.maxAssetBytes ?? MAX_ASSET_BYTES;
578
+ const tempDir = join(process.env.DSH_TUI_STANDALONE_CACHE ?? join(homedir(), '.cache', 'dsh-tui-standalone'), `.update-${Date.now()}-${process.pid}`);
579
+ try {
580
+ const currentBinary = getStandaloneBinaryPath();
581
+ const targetDir = dirname(currentBinary);
582
+ const assetName = getStandaloneAssetName();
583
+ const isZip = assetName.endsWith('.zip');
584
+ mkdirSync(tempDir, { recursive: true });
585
+ const downloadPath = join(tempDir, assetName);
586
+ onProgress?.(`downloading: ${downloadUrl}`);
587
+ const controller = new AbortController();
588
+ const timeout = setTimeout(() => controller.abort(), STANDALONE_DOWNLOAD_TIMEOUT_MS);
589
+ let response;
590
+ try {
591
+ response = await fetch(downloadUrl, {
592
+ headers: { 'user-agent': 'dsh-tui-updater' },
593
+ redirect: 'follow',
594
+ signal: controller.signal,
595
+ });
596
+ }
597
+ finally {
598
+ clearTimeout(timeout);
599
+ }
600
+ if (!response.ok) {
601
+ throw new Error(`HTTP ${response.status} ${response.statusText}`);
602
+ }
603
+ // Size cap, part 1: the declared length rejects before a single body byte
604
+ // is buffered. Part 2 (the streaming loop below) aborts a chunked
605
+ // response mid-transfer at the same cap — a stream without a
606
+ // content-length header never gets buffered whole.
607
+ const declaredLength = Number(response.headers.get('content-length') ?? Number.NaN);
608
+ if (Number.isFinite(declaredLength) && declaredLength > maxAssetBytes) {
609
+ throw new Error(`release asset declares ${declaredLength} bytes, over the ${maxAssetBytes} download cap`);
610
+ }
611
+ if (response.body === null) {
612
+ throw new Error('release asset response has no body stream');
613
+ }
614
+ // Size cap, part 2: stream the body and abort the connection the moment
615
+ // the running total passes the cap. The read-then-check pattern this
616
+ // replaces buffered the whole transfer first (a 96MB headerless response
617
+ // was measured resident at ~3x before the check ran), so a hostile
618
+ // unbounded stream could OOM the process; now the excess is never read.
619
+ const reader = response.body.getReader();
620
+ const chunks = [];
621
+ let received = 0;
622
+ for (;;) {
623
+ const { done, value } = await reader.read();
624
+ if (done === true)
625
+ break;
626
+ received += value.byteLength;
627
+ if (received > maxAssetBytes) {
628
+ controller.abort();
629
+ try {
630
+ await reader.cancel();
631
+ }
632
+ catch { /* already aborted */ }
633
+ throw new Error(`release asset streamed past ${received} bytes, over the ${maxAssetBytes} download cap`);
634
+ }
635
+ chunks.push(Buffer.from(value));
636
+ }
637
+ const buffer = Buffer.concat(chunks, received);
638
+ writeFileSync(downloadPath, buffer);
639
+ if (checksumUrl === undefined) {
640
+ // Transition period: releases published before the checksum workflow
641
+ // carry no manifest. Continue, but say so — silent degradation is how
642
+ // the unverified-download window survived review in the first place.
643
+ onProgress?.('warning: release publishes no SHA256SUMS — asset integrity cannot be verified (this will become a hard failure in the next major version)');
644
+ }
645
+ else {
646
+ onProgress?.('verifying checksum…');
647
+ const manifest = await fetchChecksumManifest(checksumUrl, options.maxChecksumManifestBytes ?? MAX_CHECKSUM_MANIFEST_BYTES);
648
+ if (!verifyAssetChecksum(buffer, manifest, assetName)) {
649
+ // Fail closed: never leave a mismatching (potentially hostile) asset
650
+ // on disk for a later retry to pick up, and never extract it.
651
+ try {
652
+ rmSync(downloadPath, { force: true });
653
+ }
654
+ catch { /* already gone */ }
655
+ throw new Error('SHA256 checksum mismatch: downloaded asset does not match the release SHA256SUMS manifest');
656
+ }
657
+ onProgress?.('checksum verified');
658
+ }
659
+ onProgress?.('extracting…');
660
+ const extractDir = join(tempDir, 'extracted');
661
+ mkdirSync(extractDir, { recursive: true });
662
+ if (isZip) {
663
+ if (process.platform === 'win32') {
664
+ // Array argv both ways: tar.exe (Win10+ bsdtar) has no shell quoting
665
+ // surface, and the Expand-Archive fallback escapes both paths as
666
+ // single-quoted literals — the paths derive from user environment
667
+ // variables, so a raw `'` must never reach the command text.
668
+ const plan = windowsExtractPlan(downloadPath, extractDir, windowsTarAvailable());
669
+ execFileSync(plan.tool, plan.args);
670
+ }
671
+ else {
672
+ execFileSync('unzip', ['-o', downloadPath, '-d', extractDir]);
673
+ }
674
+ }
675
+ else {
676
+ execFileSync('tar', ['-xzf', downloadPath, '-C', extractDir]);
677
+ }
678
+ // Zip-slip / symlink guard (see validateExtractedTree): nothing from the
679
+ // archive may be followed out of the extract dir before the replace.
680
+ const treeCheck = validateExtractedTree(extractDir);
681
+ if (!treeCheck.ok) {
682
+ throw new Error(`unsafe release archive rejected: ${treeCheck.reason ?? 'unknown extraction anomaly'}`);
683
+ }
684
+ const binaryName = process.platform === 'win32' ? 'dsh-tui.exe' : 'dsh-tui';
685
+ const newBinaryPath = join(extractDir, binaryName);
686
+ if (!existsSync(newBinaryPath)) {
687
+ throw new Error('No executable binary found in release archive');
688
+ }
689
+ // The replacement source itself must be a plain regular file — a symlink
690
+ // or device at exactly the expected name is the sharpest zip-slip probe
691
+ // (copyFileSync would follow it).
692
+ let newBinaryStat;
693
+ try {
694
+ newBinaryStat = lstatSync(newBinaryPath);
695
+ }
696
+ catch {
697
+ throw new Error(`expected binary entry unreadable: ${newBinaryPath}`);
698
+ }
699
+ if (!newBinaryStat.isFile()) {
700
+ throw new Error(`expected binary entry is not a regular file: ${newBinaryPath}`);
701
+ }
702
+ onProgress?.('replacing binary…');
703
+ if (process.platform !== 'win32') {
704
+ try {
705
+ chmodSync(newBinaryPath, 0o755);
706
+ }
707
+ catch { }
708
+ }
709
+ if (process.platform === 'win32') {
710
+ const oldBinary = `${currentBinary}.old`;
711
+ try {
712
+ rmSync(oldBinary, { force: true });
713
+ }
714
+ catch { }
715
+ renameSync(currentBinary, oldBinary);
716
+ try {
717
+ copyFileSync(newBinaryPath, currentBinary);
718
+ }
719
+ catch (copyError) {
720
+ // Restore the original executable if copying the new binary failed.
721
+ try {
722
+ renameSync(oldBinary, currentBinary);
723
+ }
724
+ catch { }
725
+ throw copyError;
726
+ }
727
+ }
728
+ else {
729
+ const stagedTarget = join(targetDir, `.dsh-tui-new-${process.pid}`);
730
+ copyFileSync(newBinaryPath, stagedTarget);
731
+ chmodSync(stagedTarget, 0o755);
732
+ renameSync(stagedTarget, currentBinary);
733
+ }
734
+ try {
735
+ rmSync(tempDir, { recursive: true, force: true });
736
+ }
737
+ catch { }
738
+ return { success: true };
739
+ }
740
+ catch (error) {
741
+ try {
742
+ rmSync(tempDir, { recursive: true, force: true });
743
+ }
744
+ catch { }
745
+ return { success: false, error: error instanceof Error ? error.message : String(error) };
746
+ }
747
+ }
748
+ /**
749
+ * Classify this install against a fresh registry lookup: an update is
750
+ * available, the install is already latest, or the answer is unknown
751
+ * (offline / registry error / unreadable own version).
752
+ *
753
+ * The configured registry decides the install target (pnpm must be able to
754
+ * fetch it), but when that registry is a mirror it can lag behind npmjs —
755
+ * issue #307's users were pinned onto stale versions this way. A
756
+ * best-effort npmjs.org check runs in parallel and surfaces as
757
+ * `authoritative` when it knows a strictly newer release, so callers can
758
+ * say "installing X now, official latest is Y" instead of silently
759
+ * upgrading to yesterday's version.
760
+ */
761
+ export async function resolveTuiUpdateTarget() {
762
+ const current = installedTuiVersion();
763
+ const currentVersion = current === undefined ? null : valid(current);
764
+ if (currentVersion === null)
765
+ return { kind: 'unknown' };
766
+ if (isStandaloneRuntime()) {
767
+ const ghRelease = await fetchGithubLatestRelease();
768
+ const latest = ghRelease?.version ?? (await fetchLatestVersion(resolveRegistryBase()));
769
+ if (latest === undefined)
770
+ return { kind: 'unknown' };
771
+ if (!gt(latest, currentVersion))
772
+ return { kind: 'latest', current: currentVersion, isStandalone: true };
773
+ const downloadUrl = ghRelease?.downloadUrl ?? `https://github.com/${GITHUB_REPO}/releases/download/v${latest}/${getStandaloneAssetName()}`;
774
+ // Mirror fallback (GitHub API timed out, version came from a registry):
775
+ // the asset list — and with it the manifest URL — is lost, so probe the
776
+ // fixed-name SHA256SUMS on the same direct-download host. Found → the
777
+ // download verifies exactly like the primary path (a tampered asset is
778
+ // refused); 404/absent → the transition warning path stays for releases
779
+ // that predate the checksum workflow (every new release ships one —
780
+ // release-bundle.yml generates it alongside the assets).
781
+ const checksumUrl = ghRelease !== undefined
782
+ ? ghRelease.checksumUrl
783
+ : await probeChecksumManifestUrl(releaseChecksumUrl(latest));
784
+ return checksumUrl === undefined
785
+ ? { kind: 'update', current: currentVersion, latest, isStandalone: true, downloadUrl }
786
+ : { kind: 'update', current: currentVersion, latest, isStandalone: true, downloadUrl, checksumUrl };
787
+ }
788
+ const registryBase = resolveRegistryBase();
789
+ const [latest, official] = await Promise.all([
790
+ fetchLatestVersion(registryBase),
791
+ registryBase === DEFAULT_REGISTRY ? undefined : fetchLatestVersion(DEFAULT_REGISTRY),
792
+ ]);
793
+ if (latest === undefined)
794
+ return { kind: 'unknown' };
795
+ if (!gt(latest, currentVersion))
796
+ return { kind: 'latest', current: currentVersion };
797
+ const authoritative = official !== undefined && gt(official, latest) ? official : undefined;
798
+ return { kind: 'update', current: currentVersion, latest, ...(authoritative === undefined ? {} : { authoritative }) };
799
+ }
800
+ /**
801
+ * Check npm for a newer published TUI version. Network and registry errors
802
+ * are intentionally treated as "no result" so an offline launch never delays
803
+ * or blocks the interactive TUI.
804
+ */
805
+ export async function checkForTuiUpdate() {
806
+ const target = await resolveTuiUpdateTarget();
807
+ return target.kind === 'update'
808
+ ? {
809
+ current: target.current,
810
+ latest: target.latest,
811
+ isStandalone: target.isStandalone,
812
+ downloadUrl: target.downloadUrl,
813
+ checksumUrl: target.checksumUrl,
814
+ }
815
+ : undefined;
816
+ }
817
+ /**
818
+ * Run a child process with its output attached to the user's terminal. The
819
+ * shell is opt-in per call: `dsh.cmd` needs it, but the node restart must
820
+ * never go through cmd.exe — the standard install path
821
+ * `C:\Program Files\nodejs\node.exe` splits on the space and the replacement
822
+ * process never starts, leaving an updated package and a dead TUI.
823
+ */
824
+ function runProcess(command, args, options = {}) {
825
+ return new Promise(resolve => {
826
+ let settled = false;
827
+ const useShell = options.shell === true && process.platform === 'win32';
828
+ // DEP0190 (issue #148): Node ≥22 warns on `shell: true` with a non-empty
829
+ // args array even when every arg is escaped — the check is syntactic.
830
+ // Fold the shell-quoted args into the command string instead (an empty
831
+ // args array does not trigger the warning); future Node majors may turn
832
+ // the deprecation into a hard error.
833
+ const [runCommand, runArgs] = useShell
834
+ ? [`${command} ${shellQuote(args).join(' ')}`, []]
835
+ : [command, args];
836
+ const child = spawn(runCommand, runArgs, {
837
+ env: options.env,
838
+ stdio: options.onStderr === undefined ? 'inherit' : ['inherit', 'inherit', 'pipe'],
839
+ shell: useShell,
840
+ });
841
+ if (options.onStderr !== undefined && child.stderr !== null) {
842
+ const onStderr = options.onStderr;
843
+ child.stderr.on('data', (chunk) => {
844
+ const text = chunk.toString('utf8');
845
+ process.stderr.write(text);
846
+ onStderr(text);
847
+ });
848
+ }
849
+ const finish = (code) => {
850
+ if (settled)
851
+ return;
852
+ settled = true;
853
+ resolve(code);
854
+ };
855
+ child.once('error', error => {
856
+ process.stderr.write(`dsh-tui: failed to run ${command}: ${error.message}\n`);
857
+ finish(127);
858
+ });
859
+ child.once('close', code => finish(code ?? 1));
860
+ });
861
+ }
862
+ /** Build the profile-manager command, preferring a preflight-pinned version. */
863
+ export function tuiUpdatePluginArgs(profile, targetVersion) {
864
+ return targetVersion === undefined
865
+ ? ['plugin', '--profile', profile, 'update', '--latest', PACKAGE_NAME]
866
+ : ['plugin', '--profile', profile, 'update', `${PACKAGE_NAME}@${targetVersion}`];
867
+ }
868
+ /**
869
+ * Postinstall-only transitive dependencies of the dsh profile chain
870
+ * (dsh-llm-pi-ai → @earendil-works/pi-ai → @google/genai + protobufjs, plus the
871
+ * esbuild/koffi peers of that chain): pnpm ≥11 refuses to run their build
872
+ * scripts unless the workspace allowlists them, and a profile that never
873
+ * opted in fails the WHOLE install with ERR_PNPM_IGNORED_BUILDS. None of
874
+ * these scripts is needed at runtime (the repo root allowBuilds them all to
875
+ * `false`), so the update flow pre-seeds the profile's pnpm-workspace.yaml
876
+ * with explicit `false` entries — an explicit decision pnpm honors silently.
877
+ */
878
+ const PROFILE_ALLOW_BUILDS = {
879
+ '@google/genai': false,
880
+ esbuild: false,
881
+ koffi: false,
882
+ protobufjs: false,
883
+ };
884
+ /** The profile's pnpm-workspace.yaml (`$DSH_HOME ?? ~/.dsh` layout). */
885
+ export function profileWorkspaceYamlPath(profile) {
886
+ const dshHome = process.env.DSH_HOME ?? join(homedir(), '.dsh');
887
+ return join(dshHome, 'profiles', profile, 'pnpm-workspace.yaml');
888
+ }
889
+ /** YAML key spelling for an allowBuilds entry (scoped names need quotes). */
890
+ function allowBuildsKeyLine(key) {
891
+ const needsQuotes = key.includes('@') || key.includes('/');
892
+ return ` ${needsQuotes ? `'${key}'` : key}: false`;
893
+ }
894
+ /**
895
+ * Make sure the profile's pnpm-workspace.yaml carries explicit `false`
896
+ * allowBuilds entries for the dsh-tui chain's postinstall-only deps, so a
897
+ * pnpm ≥11 update is not killed by ERR_PNPM_IGNORED_BUILDS. Best effort and
898
+ * idempotent: existing entries are never overwritten (an explicit user
899
+ * decision wins), a missing `allowBuilds:` block is appended, and a missing
900
+ * file is created. Returns undefined when the profile directory is absent or
901
+ * the file could not be updated — the caller still runs pnpm, whose own
902
+ * ERR_PNPM_IGNORED_BUILDS diagnostic stays the visible fallback.
903
+ */
904
+ export function ensureProfileAllowBuilds(profile) {
905
+ const yamlPath = profileWorkspaceYamlPath(profile);
906
+ try {
907
+ if (!existsSafe(dirname(yamlPath)))
908
+ return undefined;
909
+ let text = '';
910
+ try {
911
+ text = readFileSync(yamlPath, 'utf8');
912
+ }
913
+ catch {
914
+ // Missing file — start from an empty document; writeFileSync creates it.
915
+ }
916
+ const lines = text.split(/\r?\n/u);
917
+ let blockStart = -1;
918
+ for (let i = 0; i < lines.length; i += 1) {
919
+ const line = lines[i];
920
+ if (line !== '' && line === line.trimStart() && /^allowBuilds:/u.test(line)) {
921
+ blockStart = i;
922
+ break;
923
+ }
924
+ }
925
+ const present = new Set();
926
+ if (blockStart !== -1) {
927
+ for (let i = blockStart + 1; i < lines.length; i += 1) {
928
+ const line = lines[i];
929
+ if (line === '' || line === line.trimStart())
930
+ break; // dedent = block ends
931
+ const keyMatch = /^\s+('?)(.+?)\1:\s/u.exec(line);
932
+ if (keyMatch !== null)
933
+ present.add(keyMatch[2]);
934
+ }
935
+ }
936
+ const added = Object.keys(PROFILE_ALLOW_BUILDS).filter(key => !present.has(key));
937
+ if (added.length === 0)
938
+ return { existing: [...present], added };
939
+ const insert = added.map(allowBuildsKeyLine);
940
+ if (blockStart !== -1) {
941
+ // Append after the block's last existing entry (before the next
942
+ // top-level key), so existing entries keep their position.
943
+ let blockEnd = blockStart + 1;
944
+ for (let i = blockStart + 1; i < lines.length; i += 1) {
945
+ const line = lines[i];
946
+ if (line === '' || line === line.trimStart())
947
+ break;
948
+ blockEnd = i + 1;
949
+ }
950
+ lines.splice(blockEnd, 0, ...insert);
951
+ }
952
+ else {
953
+ if (lines.length > 0 && lines[lines.length - 1] !== '')
954
+ lines.push('');
955
+ lines.push('allowBuilds:', ...insert);
956
+ }
957
+ writeFileSync(yamlPath, `${lines.join('\n')}\n`);
958
+ return { existing: [...present], added };
959
+ }
960
+ catch {
961
+ return undefined;
962
+ }
963
+ }
964
+ /**
965
+ * pnpm ≥11 delays installs of packages published within `minimumReleaseAge`
966
+ * (24h by default) — on release day that gate refuses the very version
967
+ * `/update` is installing (ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION), which
968
+ * reads to the user as a broken update until the window passes. Pre-seed the
969
+ * profile's pnpm-workspace.yaml with a release-age exclusion scoped to this
970
+ * package at the exact target version — the same best-effort, idempotent
971
+ * pattern as {@link ensureProfileAllowBuilds}: foreign entries are preserved,
972
+ * an existing entry for this package is replaced (one entry tracks the current
973
+ * target instead of accumulating), a missing `minimumReleaseAgeExclude` block
974
+ * is appended, a missing file is created, and an absent profile directory
975
+ * resolves to undefined — the caller still runs pnpm, whose own diagnostic
976
+ * stays the visible fallback.
977
+ */
978
+ export function ensureProfileReleaseAgeExclude(profile, version) {
979
+ const yamlPath = profileWorkspaceYamlPath(profile);
980
+ try {
981
+ if (!existsSafe(dirname(yamlPath)))
982
+ return undefined;
983
+ let text = '';
984
+ try {
985
+ text = readFileSync(yamlPath, 'utf8');
986
+ }
987
+ catch {
988
+ // Missing file — start from an empty document; writeFileSync creates it.
989
+ }
990
+ const entry = `${PACKAGE_NAME}@${version}`;
991
+ const lines = text.split(/\r?\n/u);
992
+ let blockStart = -1;
993
+ for (let i = 0; i < lines.length; i += 1) {
994
+ const line = lines[i];
995
+ if (line !== '' && line === line.trimStart() && /^minimumReleaseAgeExclude:/u.test(line)) {
996
+ blockStart = i;
997
+ break;
998
+ }
999
+ }
1000
+ /** Item text of a list line, unquoted (`- 'x@1'` / `- x@1` → `x@1`). */
1001
+ const itemOf = (line) => line.trim().replace(/^-\s*/u, '').replace(/^'(.*)'$/u, '$1');
1002
+ const foreign = [];
1003
+ let blockEnd = -1;
1004
+ let alreadyCurrent = false;
1005
+ if (blockStart !== -1) {
1006
+ blockEnd = blockStart + 1;
1007
+ for (let i = blockStart + 1; i < lines.length; i += 1) {
1008
+ const line = lines[i];
1009
+ if (line === '' || line === line.trimStart())
1010
+ break; // dedent = block ends
1011
+ blockEnd = i + 1;
1012
+ const item = itemOf(line);
1013
+ if (item === entry) {
1014
+ alreadyCurrent = true;
1015
+ foreign.push(line);
1016
+ }
1017
+ else if (!item.startsWith(`${PACKAGE_NAME}@`)) {
1018
+ foreign.push(line);
1019
+ }
1020
+ // Stale entries for THIS package (older targets) are dropped above.
1021
+ }
1022
+ }
1023
+ if (alreadyCurrent) {
1024
+ const entries = [entry, ...lines.slice(blockStart + 1, blockEnd).map(itemOf)];
1025
+ return { entries, changed: false };
1026
+ }
1027
+ const insert = foreign.concat(` - '${entry}'`);
1028
+ if (blockStart !== -1) {
1029
+ lines.splice(blockStart + 1, blockEnd - blockStart - 1, ...insert);
1030
+ }
1031
+ else {
1032
+ if (lines.length > 0 && lines[lines.length - 1] !== '')
1033
+ lines.push('');
1034
+ lines.push('minimumReleaseAgeExclude:', ...insert);
1035
+ }
1036
+ writeFileSync(yamlPath, `${lines.join('\n')}\n`);
1037
+ return { entries: [...foreign.map(itemOf), entry], changed: true };
1038
+ }
1039
+ catch {
1040
+ return undefined;
1041
+ }
1042
+ }
1043
+ function existsSafe(path) {
1044
+ try {
1045
+ statSync(path);
1046
+ return true;
1047
+ }
1048
+ catch {
1049
+ return false;
1050
+ }
1051
+ }
1052
+ /**
1053
+ * sharp distributes its native binaries as platform-specific optional
1054
+ * dependencies (@img/sharp-<platform> wrappers plus @img/sharp-libvips-<platform>
1055
+ * runtimes). pnpm's lockfile records EVERY platform's entry by design, and
1056
+ * some pnpm update paths materialize all of them — maintainer-group report
1057
+ * 2026-09-11: a 0.10.0 → 0.10.1 update downloaded ~90MB of win32/darwin/
1058
+ * musl/riscv64/s390x/ppc64 binaries on a linux-x64 box. The fix keeps
1059
+ * `ignoredOptionalDependencies` patterns for every OTHER platform in the
1060
+ * profile: pnpm skips ignored optionals entirely (no download, no node_modules
1061
+ * entry), while the current platform's packages — the only ones sharp loads —
1062
+ * stay untouched. These tables mirror sharp's published platform matrix; a
1063
+ * suffix sharp adds later only costs the saving for that platform, never a
1064
+ * broken install, since an unknown suffix is simply not ignored.
1065
+ */
1066
+ const SHARP_WRAPPER_SUFFIXES = [
1067
+ 'darwin-arm64', 'darwin-x64', 'freebsd-wasm32', 'linux-arm', 'linux-arm64',
1068
+ 'linux-ppc64', 'linux-riscv64', 'linux-s390x', 'linux-x64',
1069
+ 'linuxmusl-arm64', 'linuxmusl-x64',
1070
+ 'win32-arm64', 'win32-ia32', 'win32-x64',
1071
+ ];
1072
+ const SHARP_LIBVIPS_SUFFIXES = [
1073
+ 'darwin-arm64', 'darwin-x64', 'linux-arm', 'linux-arm64',
1074
+ 'linux-ppc64', 'linux-riscv64', 'linux-s390x', 'linux-x64',
1075
+ 'linuxmusl-arm64', 'linuxmusl-x64',
1076
+ ];
1077
+ /**
1078
+ * The @img suffix of the RUNNING platform: musl linux maps to linuxmusl, and
1079
+ * FreeBSD — which has no native @img build — maps to the only form it can load.
1080
+ * Without that mapping a FreeBSD update would ignore `@img/sharp-freebsd-wasm32`
1081
+ * and leave sharp with nothing to load.
1082
+ */
1083
+ export function sharpCurrentSuffix(platform, cpu, libc) {
1084
+ if (platform === 'freebsd')
1085
+ return 'freebsd-wasm32';
1086
+ const os = platform === 'linux' && libc === 'musl' ? 'linuxmusl' : platform;
1087
+ return `${os}-${cpu}`;
1088
+ }
1089
+ /**
1090
+ * Deliberate omission: sharp's registry matrix (0.35.3) also carries the
1091
+ * platform-agnostic `wasm32` fallback (~9MB unpacked) plus
1092
+ * `webcontainers-wasm32`. They carry no os constraint, so they resolve on
1093
+ * every platform — including architectures with no native @img build at all
1094
+ * (loong64 etc.), where wasm is the only working form. They are therefore
1095
+ * NOT ignored: updates keep downloading them, trading ~9MB for not breaking
1096
+ * sharp on fallback-only architectures.
1097
+ */
1098
+ /** Patterns for every @img platform package EXCEPT the running one. */
1099
+ export function ignoredSharpOptionalPatterns(platform, cpu, libc) {
1100
+ const current = sharpCurrentSuffix(platform, cpu, libc);
1101
+ return [
1102
+ ...SHARP_WRAPPER_SUFFIXES.filter(s => s !== current).map(s => `@img/sharp-${s}`),
1103
+ ...SHARP_LIBVIPS_SUFFIXES.filter(s => s !== current).map(s => `@img/sharp-libvips-${s}`),
1104
+ ];
1105
+ }
1106
+ /**
1107
+ * Libc verdict for an explicit platform, so the whole matrix is testable on any
1108
+ * host. Node's report wins when present: a stray musl loader (Debian's musl
1109
+ * package, cross-compile toolchains) on a glibc system must NOT flip the
1110
+ * verdict, or the current platform's own packages would land in the ignore
1111
+ * list. The loader-path probe only answers when the report is unavailable (the
1112
+ * same fallback sharp's detect-libc uses); a non-Linux platform is always glibc.
1113
+ */
1114
+ export function detectLibc(platform, report, muslLoaderPresent) {
1115
+ if (platform !== 'linux')
1116
+ return 'glibc';
1117
+ if (report?.header?.glibcVersionRuntime !== undefined)
1118
+ return 'glibc';
1119
+ return muslLoaderPresent ? 'musl' : 'glibc';
1120
+ }
1121
+ /** The running libc, via detectLibc's precedence (report first, paths last). */
1122
+ function isMuslRuntime() {
1123
+ const report = process.report?.getReport();
1124
+ return detectLibc(process.platform, report, existsSafe('/lib/ld-musl-x86_64.so.1') || existsSafe('/lib/ld-musl-aarch64.so.1') || existsSafe('/etc/alpine-release')) === 'musl';
1125
+ }
1126
+ /** Every @img package this module's tables cover (both the wrapper and the libvips matrix). */
1127
+ const SHARP_MANAGED_PATTERNS = new Set([
1128
+ ...SHARP_WRAPPER_SUFFIXES.map(s => `@img/sharp-${s}`),
1129
+ ...SHARP_LIBVIPS_SUFFIXES.map(s => `@img/sharp-libvips-${s}`),
1130
+ ]);
1131
+ /**
1132
+ * The package name a list entry names, whatever spelling pnpm accepts: an
1133
+ * optional leading `-`, either quote style, and a trailing comment outside the
1134
+ * quotes. Returns undefined for a line that carries no scalar (a nested key),
1135
+ * which callers must treat as "not ours". Comparing names rather than raw
1136
+ * lines is what keeps a hand-edited block (`- "@img/sharp-…" # keep`, a blank
1137
+ * line inside the list) from being mistaken for a user entry and preserved —
1138
+ * that mistake would leave THIS platform's own package ignored.
1139
+ */
1140
+ function optionalDependencyNameOf(line) {
1141
+ const body = line.trim().replace(/^-\s*/u, '');
1142
+ if (body === '')
1143
+ return undefined;
1144
+ const quote = body.startsWith("'") || body.startsWith('"') ? body[0] : undefined;
1145
+ if (quote !== undefined) {
1146
+ const end = body.indexOf(quote, 1);
1147
+ return end === -1 ? undefined : body.slice(1, end);
1148
+ }
1149
+ const commentAt = body.search(/\s#/u);
1150
+ const name = (commentAt === -1 ? body : body.slice(0, commentAt)).trim();
1151
+ return name === '' ? undefined : name;
1152
+ }
1153
+ /**
1154
+ * Keep an `ignoredOptionalDependencies:` block in the profile's
1155
+ * pnpm-workspace.yaml listing every non-current-platform @img package, so an
1156
+ * update stops downloading the foreign-platform sharp natives. The list is
1157
+ * recomputed on every run: it is a fact about the machine running the update,
1158
+ * so a profile carried to another platform (WSL, a musl container, a new cpu)
1159
+ * gets a fresh list instead of a stale one that would skip the packages that
1160
+ * machine needs. Entries this module's own tables cover are rewritten (by
1161
+ * package name, so quoted forms, trailing comments and blank lines inside the
1162
+ * block all still refresh); every other entry — a user's `fsevents`, a name
1163
+ * sharp adds later, a user's own `@img/sharp-wasm32` exemption — is preserved
1164
+ * verbatim, same as in {@link ensureProfileAllowBuilds}. Best effort and
1165
+ * idempotent: the file is written only when the resulting block actually
1166
+ * differs, a missing `ignoredOptionalDependencies:` block is appended, and an
1167
+ * absent profile directory resolves to undefined — the update still runs, only
1168
+ * the download-size win is lost. A document this function cannot rewrite safely
1169
+ * (a flow-style value, a duplicated key, which is already invalid YAML) is left
1170
+ * untouched rather than half-rewritten. Residual caveat shared by any persisted
1171
+ * machine fact: a second platform using the same profile without running an
1172
+ * update keeps this platform's list, so its own binaries stay skipped until the
1173
+ * next update there.
1174
+ */
1175
+ export function ensureProfileSharpPlatformFilter(profile) {
1176
+ const yamlPath = profileWorkspaceYamlPath(profile);
1177
+ try {
1178
+ if (!existsSafe(dirname(yamlPath)))
1179
+ return undefined;
1180
+ let text = '';
1181
+ try {
1182
+ text = readFileSync(yamlPath, 'utf8');
1183
+ }
1184
+ catch {
1185
+ // Missing file — start from an empty document; writeFileSync creates it.
1186
+ }
1187
+ const lines = text === '' ? [] : text.split(/\r?\n/u);
1188
+ let blockStart = -1;
1189
+ for (let i = 0; i < lines.length; i += 1) {
1190
+ const line = lines[i];
1191
+ if (line === '' || line !== line.trimStart() || !/^ignoredOptionalDependencies:/u.test(line))
1192
+ continue;
1193
+ // A value on the key line itself (flow style `[a, b]`) is a list this
1194
+ // block rewriter would duplicate rather than refresh, and a second such
1195
+ // key is already invalid YAML — leave both alone, losing only the saving.
1196
+ const rest = line.slice(line.indexOf(':') + 1).trim();
1197
+ if ((rest !== '' && !rest.startsWith('#')) || blockStart !== -1)
1198
+ return undefined;
1199
+ blockStart = i;
1200
+ }
1201
+ const foreign = [];
1202
+ let blockEnd = blockStart === -1 ? -1 : blockStart + 1;
1203
+ if (blockStart !== -1) {
1204
+ for (let i = blockStart + 1; i < lines.length; i += 1) {
1205
+ const line = lines[i];
1206
+ if (line.trim() === '')
1207
+ continue; // blank lines inside a block list don't end it
1208
+ if (line === line.trimStart())
1209
+ break; // dedent = block ends
1210
+ blockEnd = i + 1;
1211
+ const name = optionalDependencyNameOf(line);
1212
+ // Entries from our own tables (possibly computed for another platform)
1213
+ // are dropped here and recomputed below; everything else is preserved.
1214
+ if (name === undefined || !SHARP_MANAGED_PATTERNS.has(name))
1215
+ foreign.push(line);
1216
+ }
1217
+ }
1218
+ const patterns = ignoredSharpOptionalPatterns(process.platform, process.arch, isMuslRuntime() ? 'musl' : 'glibc');
1219
+ const insert = foreign.concat(patterns.map(p => ` - '${p}'`));
1220
+ if (blockStart !== -1 && lines.slice(blockStart + 1, blockEnd).join('\n') === insert.join('\n')) {
1221
+ return { entries: patterns, changed: false };
1222
+ }
1223
+ if (blockStart !== -1) {
1224
+ lines.splice(blockStart + 1, blockEnd - blockStart - 1, ...insert);
1225
+ }
1226
+ else {
1227
+ if (lines.length > 0 && lines[lines.length - 1] !== '')
1228
+ lines.push('');
1229
+ lines.push('ignoredOptionalDependencies:', ...insert);
1230
+ }
1231
+ writeFileSync(yamlPath, `${lines.join('\n')}\n`);
1232
+ return { entries: patterns, changed: true };
1233
+ }
1234
+ catch {
1235
+ return undefined;
1236
+ }
1237
+ }
1238
+ /**
1239
+ * The pnpm Windows tmp-rename race signature (issue #225): pnpm swaps a
1240
+ * package directory via a `<name>_tmp_<pid>` staging dir, and a file lock or
1241
+ * AV scan makes the scandir/rename fail with ENOENT/EPERM/EBUSY. The failure
1242
+ * is transient — the identical command succeeds on retry — but the crashed
1243
+ * run leaves a half-updated profile (manifest pins the old version while the
1244
+ * lockfile already carries the new snapshot), which presents as "update did
1245
+ * nothing" (#209). Genuine resolution errors never carry the `_tmp_<pid>`
1246
+ * token, so matching both keeps the retry from masking real failures.
1247
+ */
1248
+ export function isTransientUpdateFailure(stderr) {
1249
+ return /ENOENT|EPERM|EBUSY/i.test(stderr) && /_tmp_\d+/i.test(stderr);
1250
+ }
1251
+ /**
1252
+ * The pnpm Linux flavor of the tmp-rename race (issue #479): the very same
1253
+ * `importPackage` staging path, but overlayfs surfaces the second swap of an
1254
+ * already-replaced package dir as EEXIST — deterministically, on every run,
1255
+ * never transiently. A plain retry of the identical command ALWAYS fails the
1256
+ * same way (the leftover `_tmp_<pid>_<threadId>` staging dir keeps colliding),
1257
+ * so this signature must route to the recovery path
1258
+ * (removeStalePackageInstall + rerun), not to the plain retry.
1259
+ */
1260
+ export function isEexistTmpRenameFailure(stderr) {
1261
+ return /EEXIST/i.test(stderr) && /_tmp_\d+/i.test(stderr);
1262
+ }
1263
+ /**
1264
+ * The dsh profile layout places plugin packages under
1265
+ * `$DSH_HOME ?? ~/.dsh` — the same root dsh itself resolves
1266
+ * (`dshHomePath is $DSH_HOME ?? ~/.dsh`, and packaged presets resolve
1267
+ * identically). /update's recovery path needs this location to clear a
1268
+ * half-updated install pnpm can no longer swap in place (issue #479).
1269
+ */
1270
+ export function profilePackageDir(profile) {
1271
+ const dshHome = process.env.DSH_HOME ?? join(homedir(), '.dsh');
1272
+ return join(dshHome, 'profiles', profile, 'node_modules', PACKAGE_NAME);
1273
+ }
1274
+ /**
1275
+ * Recovery for the pnpm tmp-rename races (issues #225/#479): remove the
1276
+ * profile's installed copy of this package plus the sibling `_tmp_`
1277
+ * staging dirs a crashed swap leaves behind, so the next installer run
1278
+ * takes the fresh-install path instead of renaming over the collision.
1279
+ * Field-verified workaround (issue #479): `rm -rf <pkg dir>` + rerun
1280
+ * succeeds where ten plain retries fail.
1281
+ *
1282
+ * A junction/symlink at the package dir is UNLINKED only — the link is
1283
+ * removed, the target tree (a dev checkout it may point at) is never
1284
+ * traversed or deleted. Best effort throughout: this runs inside a
1285
+ * failure-recovery branch, so an unusable result simply falls through to
1286
+ * the rerun and the manual repair hint.
1287
+ */
1288
+ export function removeStalePackageInstall(profile) {
1289
+ const pkgDir = profilePackageDir(profile);
1290
+ const scopeDir = dirname(pkgDir);
1291
+ const removal = { packageDir: 'absent', tmpDirs: [] };
1292
+ try {
1293
+ const stats = lstatSync(pkgDir);
1294
+ // lstat reports junctions AND symlinks as isSymbolicLink — remove the
1295
+ // link itself, never what it points at.
1296
+ if (stats.isSymbolicLink() || stats.isDirectory()) {
1297
+ rmSync(pkgDir, { recursive: true, force: true });
1298
+ removal.packageDir = 'removed';
1299
+ }
1300
+ }
1301
+ catch (error) {
1302
+ removal.packageDir = error.code === 'ENOENT' ? 'absent' : 'failed';
1303
+ }
1304
+ try {
1305
+ for (const name of readdirSync(scopeDir)) {
1306
+ if (!name.startsWith(`${PACKAGE_NAME}_tmp_`) || !/^\d+_\d+$/.test(name.slice(PACKAGE_NAME.length + 5)))
1307
+ continue;
1308
+ const staging = join(scopeDir, name);
1309
+ try {
1310
+ rmSync(staging, { recursive: true, force: true });
1311
+ removal.tmpDirs.push(name);
1312
+ }
1313
+ catch {
1314
+ // Staging leftovers are best effort; the package dir removal is
1315
+ // the load-bearing half of the recovery.
1316
+ }
1317
+ }
1318
+ }
1319
+ catch {
1320
+ // Unreadable scope dir — nothing more to clear.
1321
+ }
1322
+ return removal;
1323
+ }
1324
+ /**
1325
+ * Best-effort migrate the GLOBAL launcher to the delegating shim (0.8.7):
1326
+ * after a successful profile update, copy this package's `bin/dsh-tui.js`
1327
+ * and `package.json` over the global install so the launcher can never lag
1328
+ * the profile again — the shim delegates all logic to the profile copy it
1329
+ * just updated. Single-file-safe by contract: the new bin imports nothing
1330
+ * from lib/ (see its header), so overwriting it inside an older global
1331
+ * install cannot dangle a missing helper.
1332
+ *
1333
+ * Locating the global dir relies on argv[1] being the global `dsh-tui.js`
1334
+ * (true when booted through the `dsh-tui` command). Source checkouts and
1335
+ * direct `dsh --profile` boots resolve nothing — the migration is a silent
1336
+ * no-op there. Write failures (permissions, locked files) are equally
1337
+ * silent: the launcher-alignment warning remains the fallback diagnosis.
1338
+ *
1339
+ * @returns true when the global launcher files were replaced.
1340
+ */
1341
+ export function migrateGlobalLauncher() {
1342
+ const launcherBin = process.argv[1];
1343
+ if (launcherBin === undefined || !launcherBin.endsWith('dsh-tui.js'))
1344
+ return false;
1345
+ // Walk up from the bin to the containing package; accept it only when it
1346
+ // is OUR package and not the profile copy we are running from (junction
1347
+ // layouts collapse both onto the same real path — copying onto ourselves
1348
+ // would be a no-op at best).
1349
+ let dir = dirname(resolve(launcherBin));
1350
+ const ownDir = dirname(dirname(fileURLToPath(import.meta.url)));
1351
+ for (let depth = 0; depth < 4; depth++) {
1352
+ const manifest = join(dir, 'package.json');
1353
+ try {
1354
+ const parsed = JSON.parse(readFileSync(manifest, 'utf8'));
1355
+ if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)
1356
+ && parsed.name === PACKAGE_NAME) {
1357
+ let same = false;
1358
+ try {
1359
+ same = realpathSync(dir) === realpathSync(ownDir);
1360
+ }
1361
+ catch {
1362
+ same = resolve(dir) === resolve(ownDir);
1363
+ }
1364
+ if (same)
1365
+ return false;
1366
+ // tmp + rename keeps each file atomic; a crash mid-migration leaves
1367
+ // either the old or the new file, never a truncated one.
1368
+ const replace = (target, source) => {
1369
+ const staged = `${target}.dsh-tui-migrate`;
1370
+ writeFileSync(staged, readFileSync(source));
1371
+ renameSync(staged, target);
1372
+ };
1373
+ replace(join(dir, 'bin', 'dsh-tui.js'), join(ownDir, 'bin', 'dsh-tui.js'));
1374
+ replace(manifest, join(ownDir, 'package.json'));
1375
+ return true;
1376
+ }
1377
+ }
1378
+ catch {
1379
+ // Unreadable manifest at this level — keep walking up.
1380
+ }
1381
+ const parent = dirname(dir);
1382
+ if (parent === dir)
1383
+ return false;
1384
+ dir = parent;
1385
+ }
1386
+ return false;
1387
+ }
1388
+ /**
1389
+ * Install-only half of `/update`: run `dsh plugin add`, refuse boot-deadlock
1390
+ * targets, verify the profile actually advanced, and migrate the global
1391
+ * launcher. No restart — `updateTuiAndRestart` layers the session-preserving
1392
+ * restart on top, and the `dsh-tui update` CLI stops here.
1393
+ *
1394
+ * @param profile - The dsh profile to update.
1395
+ * @param targetVersion - Exact version from the preflight registry check, or
1396
+ * undefined when that check failed and pnpm should resolve latest.
1397
+ * @returns The update exit code plus the before/after versions.
1398
+ */
1399
+ export async function updateTui(profile, targetVersion) {
1400
+ // Stamp the pre-update version BEFORE pnpm runs: it reads this package's
1401
+ // manifest from disk, which the update replaces on the fly — a
1402
+ // post-update read already sees the NEW version, and the restarted
1403
+ // process then compares new-vs-new and false-alarms "version did not
1404
+ // advance" on every successful update (issue #307's screenshots).
1405
+ const updatedFrom = installedTuiVersion() ?? '';
1406
+ if (isStandaloneRuntime()) {
1407
+ const target = await resolveTuiUpdateTarget();
1408
+ const latestVersion = targetVersion ?? (target.kind === 'update' ? target.latest : undefined);
1409
+ const downloadUrl = (target.kind === 'update' && target.downloadUrl)
1410
+ ? target.downloadUrl
1411
+ : (latestVersion ? `https://github.com/${GITHUB_REPO}/releases/download/v${latestVersion}/${getStandaloneAssetName()}` : undefined);
1412
+ const checksumUrl = target.kind === 'update' ? target.checksumUrl : undefined;
1413
+ if (downloadUrl === undefined || latestVersion === undefined) {
1414
+ process.stderr.write('dsh-tui: 无法解析便携包更新下载地址\n');
1415
+ return { code: 1, updatedFrom };
1416
+ }
1417
+ process.stderr.write(`dsh-tui: 正在更新便携包 (${updatedFrom || 'current'} → ${latestVersion})…\n`);
1418
+ const result = await downloadAndReplaceStandaloneBinary(downloadUrl, msg => {
1419
+ process.stderr.write(`dsh-tui: ${msg}\n`);
1420
+ }, checksumUrl);
1421
+ if (!result.success) {
1422
+ process.stderr.write(`dsh-tui: 便携包更新失败: ${result.error ?? '未知错误'}\n`);
1423
+ return { code: 1, updatedFrom };
1424
+ }
1425
+ return { code: 0, updatedFrom, installed: latestVersion };
1426
+ }
1427
+ const dsh = process.platform === 'win32' ? 'dsh.cmd' : 'dsh';
1428
+ const updateArgs = tuiUpdatePluginArgs(profile, targetVersion);
1429
+ // pnpm ≥11 hard-fails installs whose dependency tree carries un-allowlisted
1430
+ // build scripts (ERR_PNPM_IGNORED_BUILDS). The dsh-auth chain pulls in
1431
+ // postinstall-only deps (@google/genai/protobufjs via pi-ai), so pre-seed
1432
+ // the profile workspace with explicit `false` entries before pnpm runs.
1433
+ const allowBuilds = ensureProfileAllowBuilds(profile);
1434
+ if (allowBuilds !== undefined && allowBuilds.added.length > 0) {
1435
+ process.stderr.write(`dsh-tui: pre-seeded profile pnpm allowBuilds (${allowBuilds.added.join(', ')}) — ` +
1436
+ 'postinstall-only deps are explicitly ignored\n');
1437
+ }
1438
+ // Foreign-platform @img/sharp-* optionals are pure download waste (~90MB on
1439
+ // the maintainer-group report); keep the profile's ignore list matching THIS
1440
+ // machine (each update recomputes it) so pnpm never fetches them.
1441
+ const sharpFilter = ensureProfileSharpPlatformFilter(profile);
1442
+ if (sharpFilter !== undefined && sharpFilter.changed) {
1443
+ process.stderr.write(`dsh-tui: sharp platform filter updated (${sharpFilter.entries.length} foreign-platform patterns ignored) — ` +
1444
+ `this profile's install keeps only the current platform's natives\n`);
1445
+ }
1446
+ // pnpm ≥11's minimumReleaseAge (24h by default) refuses installs of
1447
+ // packages published within the window — on release day that gate rejects
1448
+ // the exact version /update pins, surfacing as a failed update that heals
1449
+ // itself a day later. Scope-exempt this package at the exact target before
1450
+ // pnpm runs (release-day /update parity with the allowBuilds seed above).
1451
+ if (targetVersion !== undefined) {
1452
+ const releaseAge = ensureProfileReleaseAgeExclude(profile, targetVersion);
1453
+ if (releaseAge !== undefined && releaseAge.changed) {
1454
+ process.stderr.write(`dsh-tui: pre-seeded profile release-age exclusion (${PACKAGE_NAME}@${targetVersion}) — ` +
1455
+ 'a freshly published version installs without the 24h supply-chain delay\n');
1456
+ }
1457
+ }
1458
+ let updateStderr = '';
1459
+ const capture = (chunk) => { updateStderr += chunk; };
1460
+ let updateCode = await runProcess(dsh, updateArgs, { shell: true, onStderr: capture });
1461
+ // Transient Windows tmp-rename race (issue #225): retry the identical
1462
+ // command once — it succeeds on a clean second run, and only the
1463
+ // `_tmp_<pid>` race signature qualifies, never a real resolution error.
1464
+ if (updateCode !== 0 && isTransientUpdateFailure(updateStderr)) {
1465
+ process.stderr.write('dsh-tui: transient pnpm failure (Windows tmp-rename race) — retrying once…\n');
1466
+ updateStderr = '';
1467
+ updateCode = await runProcess(dsh, updateArgs, { shell: true, onStderr: capture });
1468
+ }
1469
+ // Deterministic Linux tmp-rename race (issue #479): EEXIST never clears on
1470
+ // a plain retry (the staging-dir collision reproduces every run), and a
1471
+ // transient retry that failed again means the same leftover state. Both
1472
+ // recover by removing the stale install + staging dirs, then rerunning —
1473
+ // the field-verified workaround that takes pnpm down its fresh-install
1474
+ // path instead of renaming over the collision.
1475
+ if (updateCode !== 0 && (isEexistTmpRenameFailure(updateStderr) || isTransientUpdateFailure(updateStderr))) {
1476
+ const flavor = isEexistTmpRenameFailure(updateStderr) ? 'EEXIST, issue #479' : 'retry failed, issue #225';
1477
+ const removal = removeStalePackageInstall(profile);
1478
+ const stagingNote = removal.tmpDirs.length > 0 ? ` + ${removal.tmpDirs.length} staging dir(s)` : '';
1479
+ process.stderr.write(`dsh-tui: pnpm tmp-rename race (${flavor}) — cleared the stale install ` +
1480
+ `(package dir: ${removal.packageDir}${stagingNote}) and rerunning the update…\n`);
1481
+ updateStderr = '';
1482
+ updateCode = await runProcess(dsh, updateArgs, { shell: true, onStderr: capture });
1483
+ }
1484
+ if (updateCode !== 0)
1485
+ return { code: updateCode, updatedFrom };
1486
+ // A --latest fallback (preflight failed) on a stale mirror can still land
1487
+ // on the 0.7.0–0.7.1 hard-inject range — restarting into it under an older
1488
+ // global-launcher patch is the permanent boot deadlock of issues
1489
+ // #183/#307. Refuse the restart when the version JUST moved there; a user
1490
+ // who was already on it keeps their restart (their combo demonstrably
1491
+ // boots) and gets the repair hint on the next /update instead.
1492
+ const installedNow = installedTuiVersion();
1493
+ if (installedNow !== undefined && installedNow !== updatedFrom && isBootDeadlockTarget(installedNow)) {
1494
+ process.stderr.write(`dsh-tui: update landed on ${installedNow}, which can permanently deadlock boot under older launcher patches ` +
1495
+ `(#183/#307) — NOT restarting into it. Repair with:\n` +
1496
+ ` dsh plugin --profile ${profile} add ${PACKAGE_NAME}@latest\n` +
1497
+ `(if the mirror has not synced the latest release yet, retry later)\n`);
1498
+ return { code: 1, updatedFrom, installed: installedNow };
1499
+ }
1500
+ // Post-update verification (issue #225): pnpm can report success yet leave
1501
+ // the profile half-updated (manifest old / lockfile new). Verify against
1502
+ // the preflight target; a full `install` reconciles lockfile →
1503
+ // node_modules, and if the mismatch survives, stop before restarting into
1504
+ // a mixed state and hand the user the exact repair command instead.
1505
+ if (targetVersion !== undefined) {
1506
+ let installed = installedTuiVersion();
1507
+ if (installed !== targetVersion) {
1508
+ await runProcess(dsh, ['plugin', '--profile', profile, 'install'], { shell: true });
1509
+ installed = installedTuiVersion();
1510
+ }
1511
+ if (installed !== targetVersion) {
1512
+ process.stderr.write(`dsh-tui: update completed but the profile still runs ${installed ?? 'an unreadable version'} ` +
1513
+ `(expected ${targetVersion}) — the profile is half-updated. Repair manually with:\n` +
1514
+ ` dsh plugin --profile ${profile} add ${PACKAGE_NAME}@${targetVersion}\n`);
1515
+ return { code: 1, updatedFrom, installed };
1516
+ }
1517
+ }
1518
+ // Launcher migration (0.8.7): the freshly installed profile carries the
1519
+ // delegating shim — stamp it over the global launcher so this is the LAST
1520
+ // time the outer copy can lag. Best-effort; the alignment warning stays as
1521
+ // the fallback when the copy is impossible.
1522
+ if (migrateGlobalLauncher()) {
1523
+ process.stderr.write('dsh-tui: global launcher aligned to the delegating shim (no manual npm i -g needed anymore).\n');
1524
+ }
1525
+ return { code: 0, updatedFrom, installed: installedTuiVersion() };
1526
+ }
1527
+ /**
1528
+ * Update the installed dsh-tui package and restart the same launcher while
1529
+ * preserving the active session. The TUI must already be unmounted before
1530
+ * this is called so pnpm output cannot corrupt the rendered terminal frame.
1531
+ *
1532
+ * When the preflight registry check resolved an exact target, pass that
1533
+ * version to pnpm instead of resolving `latest` a second time. This avoids a
1534
+ * stale mirror/dist-tag response between the check and install. If preflight
1535
+ * failed, retain the `--latest` fallback: a plain `pnpm update` stays inside
1536
+ * the manifest range and can restart unchanged across minor releases.
1537
+ *
1538
+ * @param sessionId - Session to resume in the replacement process.
1539
+ * @param profile - The dsh profile this TUI was launched with; updating any
1540
+ * other profile would leave the running install untouched.
1541
+ * @param targetVersion - Exact version returned by the preflight registry
1542
+ * check, or undefined when that check failed and pnpm should resolve latest.
1543
+ * @returns Exit codes for the update run and the replacement process.
1544
+ */
1545
+ export async function updateTuiAndRestart(sessionId, profile, targetVersion) {
1546
+ const outcome = await updateTui(profile, targetVersion);
1547
+ const { updatedFrom } = outcome;
1548
+ if (outcome.code !== 0)
1549
+ return { updateCode: outcome.code, restartCode: outcome.code };
1550
+ // Restart through the same hardened handoff as /restart (issues
1551
+ // #284/#307/#483): wait for the replacement's natural exit (the outer
1552
+ // interpreter must not reclaim the console under it), re-assert the
1553
+ // stdin detach from a watchdog so a revived pump cannot swallow the
1554
+ // child's keypresses, and capture a fast-death stderr report. The old
1555
+ // plain inherit spawn raced the interpreter for input on Windows
1556
+ // Terminal (issue #483: "cannot type anything after /update").
1557
+ const restartCode = await restartTui(sessionId, {
1558
+ env: { [UPDATED_FROM_ENV]: updatedFrom },
1559
+ kind: 'update',
1560
+ });
1561
+ return { updateCode: 0, restartCode };
1562
+ }
1563
+ /**
1564
+ * Headless `dsh-tui update`: the `/update` decision flow (preflight, deadlock
1565
+ * refusal, mirror-lag note, `--latest` fallback) followed by the install-only
1566
+ * half — no TUI, no restart. The bin launcher dynamic-imports this from the
1567
+ * profile copy's compiled lib.
1568
+ *
1569
+ * @param profile - The dsh profile to update.
1570
+ * @returns Process exit code: 0 on success or already-latest, 1 otherwise.
1571
+ */
1572
+ export async function cliUpdate(profile) {
1573
+ const target = await resolveTuiUpdateTarget();
1574
+ if (target.kind === 'latest') {
1575
+ process.stdout.write(`dsh-tui: already the latest version (${target.current}).\n`);
1576
+ return 0;
1577
+ }
1578
+ if (isStandaloneRuntime()) {
1579
+ if (target.kind === 'update') {
1580
+ process.stdout.write(`dsh-tui: updating standalone binary ${target.current} → ${target.latest}…\n`);
1581
+ const outcome = await updateTui(profile, target.latest);
1582
+ if (outcome.code === 0) {
1583
+ process.stdout.write(`dsh-tui: standalone binary updated successfully (${outcome.updatedFrom || target.current} → ${outcome.installed}).\n`);
1584
+ }
1585
+ return outcome.code;
1586
+ }
1587
+ process.stderr.write('dsh-tui: version check failed (offline or unreachable registry).\n');
1588
+ return 1;
1589
+ }
1590
+ let targetVersion;
1591
+ if (target.kind === 'update') {
1592
+ // Mirror the /update flow exactly: refuse the 0.7.0–0.7.1 hard-inject
1593
+ // range (permanent boot deadlock under older launcher patches, #183/#307)
1594
+ // instead of installing it.
1595
+ if (isBootDeadlockTarget(target.latest)) {
1596
+ process.stderr.write(`dsh-tui: refusing to update onto ${target.latest} — that range can permanently deadlock boot ` +
1597
+ `(#183/#307). Latest on the official registry: ${target.authoritative ?? target.latest}. ` +
1598
+ `If you use a mirror, retry after it syncs.\n`);
1599
+ return 1;
1600
+ }
1601
+ if (target.authoritative !== undefined) {
1602
+ process.stdout.write(`dsh-tui: note — your registry serves ${target.latest} while npmjs.org has ${target.authoritative} (mirror lag).\n`);
1603
+ }
1604
+ targetVersion = target.latest;
1605
+ process.stdout.write(`dsh-tui: updating ${target.current} → ${target.latest}…\n`);
1606
+ }
1607
+ else {
1608
+ process.stdout.write('dsh-tui: version check failed (offline or unreadable install) — falling back to `--latest`.\n');
1609
+ }
1610
+ const outcome = await updateTui(profile, targetVersion);
1611
+ if (outcome.code === 0) {
1612
+ // A preflight-less run (`--latest` fallback) can "succeed" as a pnpm
1613
+ // no-op: same manifest before and after. Say so instead of printing a
1614
+ // vacuous `updated X → X` — the /update path surfaces the same state via
1615
+ // the DSH_TUI_UPDATED_FROM stamp on restart.
1616
+ if (targetVersion === undefined && outcome.installed !== undefined && outcome.installed === outcome.updatedFrom) {
1617
+ process.stdout.write(`dsh-tui: version did not advance (still ${outcome.installed}) — already the latest, or the registry has no newer release yet.\n`);
1618
+ }
1619
+ else {
1620
+ process.stdout.write(`dsh-tui: updated ${outcome.updatedFrom || '(unknown)'} → ${outcome.installed ?? '(unreadable)'}.\n`);
1621
+ }
1622
+ }
1623
+ return outcome.code;
1624
+ }
1625
+ export async function restartTui(sessionId, options = {}) {
1626
+ const kind = options.kind ?? 'restart';
1627
+ const tag = kind === 'update' ? 'update-restart' : 'restart';
1628
+ const argv = [...process.execArgv, ...process.argv.slice(1)];
1629
+ logRestartEvent(`${tag}: spawning replacement`, {
1630
+ node: process.execPath,
1631
+ argv,
1632
+ cwd: process.cwd(),
1633
+ stdinTty: process.stdin.isTTY === true,
1634
+ stdoutTty: process.stdout.isTTY === true,
1635
+ stderrTty: process.stderr.isTTY === true,
1636
+ nodeOptions: process.env.NODE_OPTIONS ?? null,
1637
+ dshHome: process.env.DSH_HOME ?? null,
1638
+ });
1639
+ const startedAt = Date.now();
1640
+ return new Promise(resolve => {
1641
+ const child = spawn(process.execPath, argv, {
1642
+ env: {
1643
+ ...process.env,
1644
+ // The replacement resumes the current session through the launcher
1645
+ // contract (DSH_TUI_RESUME_SESSION; see src/sessionHistory.ts).
1646
+ DSH_TUI_RESUME_SESSION: sessionId,
1647
+ // Marks the replacement so its own boot logs to restart.log without
1648
+ // noisy logging on every ordinary launch (/restart only).
1649
+ ...(kind === 'restart' ? { [RESTART_CHILD_ENV]: '1' } : {}),
1650
+ ...options.env,
1651
+ },
1652
+ // stdin/stdout stay inherited so the replacement owns the console the
1653
+ // moment it boots; stderr is captured so a boot failure is reportable
1654
+ // through THIS process (the terminal may already be mid-handoff when
1655
+ // the child dies, and a raw inherit write can vanish).
1656
+ stdio: ['inherit', 'inherit', 'pipe'],
1657
+ });
1658
+ logRestartEvent(`${tag}: replacement spawned`, { childPid: child.pid });
1659
+ // Handoff watchdog (field evidence 2026-08-24: restarted TUI mounts but
1660
+ // takes no input). Two jobs, both diagnosis-grade:
1661
+ // 1. SAMPLE this process's stdin state every second — if anything
1662
+ // re-attaches a reader after the funnel's detachStdinForHandoff, the
1663
+ // sample (taken before the re-assert below) shows it in the log.
1664
+ // 2. RE-ASSERT the detach and finally destroy the stream: this process
1665
+ // must never read the shared console again — every keypress belongs
1666
+ // to the replacement, and a resumed pump here is exactly the
1667
+ // "restarted TUI sees dropped or swallowed input" failure (#284/#307).
1668
+ let watchdogTicks = 0;
1669
+ const watchdog = setInterval(() => {
1670
+ watchdogTicks += 1;
1671
+ const stdin = process.stdin;
1672
+ logRestartEvent('parent: stdin watchdog', {
1673
+ tick: watchdogTicks,
1674
+ readableListeners: stdin.listenerCount('readable'),
1675
+ dataListeners: stdin.listenerCount('data'),
1676
+ paused: stdin.isPaused,
1677
+ raw: stdin.isRaw === true,
1678
+ buffered: stdin.readableLength,
1679
+ });
1680
+ try {
1681
+ stdin.removeAllListeners('readable');
1682
+ stdin.removeAllListeners('data');
1683
+ stdin.pause();
1684
+ }
1685
+ catch {
1686
+ // Diagnosis/mitigation only.
1687
+ }
1688
+ if (watchdogTicks === 15) {
1689
+ clearInterval(watchdog);
1690
+ try {
1691
+ // Terminal safeguard: a destroyed stream can never be resumed by
1692
+ // any late re-attachment. The child holds its own inherited
1693
+ // handle, so closing ours does not affect it.
1694
+ process.stdin.destroy();
1695
+ logRestartEvent('parent: stdin destroyed after watchdog');
1696
+ }
1697
+ catch {
1698
+ // Best effort.
1699
+ }
1700
+ }
1701
+ }, 1000);
1702
+ watchdog.unref();
1703
+ let childStderr = '';
1704
+ let loggedStderrBytes = 0;
1705
+ child.stderr?.on('data', (chunk) => {
1706
+ childStderr += chunk.toString('utf8');
1707
+ // Mirror chunks to the log capped: the full text still reaches the
1708
+ // terminal report below, and unbounded output must not grow the file.
1709
+ if (loggedStderrBytes < 4096) {
1710
+ loggedStderrBytes += chunk.length;
1711
+ logRestartEvent(`${tag}: replacement stderr`, { text: chunk.toString('utf8').slice(0, 2048) });
1712
+ }
1713
+ });
1714
+ // Diagnosis marker only — never resolves: after the window the child owns
1715
+ // the terminal, and this process must keep the launch chain open until
1716
+ // the replacement exits (see the header comment).
1717
+ const timer = setTimeout(() => {
1718
+ logRestartEvent(`${tag}: survival window passed, following the replacement until it exits`);
1719
+ }, 4000);
1720
+ timer.unref();
1721
+ child.once('error', error => {
1722
+ clearTimeout(timer);
1723
+ logRestartEvent(`${tag}: spawn error`, { message: error.message });
1724
+ writeHandoffNotice(`dsh-tui: failed to spawn the restart: ${error.message}\n`);
1725
+ resolve(127);
1726
+ });
1727
+ child.once('close', (code, signal) => {
1728
+ clearTimeout(timer);
1729
+ const elapsedMs = Date.now() - startedAt;
1730
+ logRestartEvent(`${tag}: replacement exited`, {
1731
+ code: code ?? null,
1732
+ signal: signal ?? null,
1733
+ elapsedMs,
1734
+ });
1735
+ if (elapsedMs < 4000) {
1736
+ // Fast death: the TUI never came up. Synchronous stderr write —
1737
+ // process.exit() right after an async stream write skips the flush,
1738
+ // and a vanished diagnosis is indistinguishable from silent failure.
1739
+ const suffix = childStderr.trim() === '' ? '' : `\n${childStderr.trimEnd()}`;
1740
+ writeHandoffNotice(`dsh-tui: restart child exited during the handoff (code ${code ?? 'null'}` +
1741
+ `${signal === undefined || signal === null ? '' : `, signal ${signal}`}) — the TUI did not come up.` +
1742
+ `${suffix}\nYour session is preserved; resume with the launcher or retry the command.\n`);
1743
+ }
1744
+ else if (code !== 0 && code !== null) {
1745
+ // Late nonzero exit: the session ended abnormally, say so briefly.
1746
+ writeHandoffNotice(`\ndsh-tui: the restarted session exited with code ${code}.\n`);
1747
+ }
1748
+ resolve(code ?? 1);
1749
+ });
1750
+ });
1751
+ }