@chatcode/chatcode-cli 3.0.5 → 3.0.6-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/README.i18n.yaml +6 -6
  2. package/README.md +7 -0
  3. package/README.zh.md +7 -0
  4. package/lib/bin.js +19 -5
  5. package/lib/desktop-history-B0iUekXf.js +72 -0
  6. package/lib/desktop-history-DvgkONgj.js +2 -0
  7. package/lib/{dump-config-D8kXfdTs.js → dump-config-CgIYHBp2.js} +1 -1
  8. package/lib/dump-config-D6TruNva.js +2 -0
  9. package/lib/{dump-config-schema-CtZbroi6.js → dump-config-schema-GiAtkJwx.js} +2 -2
  10. package/lib/{plugin-CYw-MBRn.js → plugin-BACkrsVG.js} +1 -1
  11. package/lib/{profile-boot-CffsubnV.js → profile-boot-c5YKtUIb.js} +17 -4
  12. package/lib/profile-boot.js +1 -1
  13. package/lib/tui-compat.js +1 -1
  14. package/lib/types/args.d.ts +8 -1
  15. package/lib/types/desktop-history.d.ts +31 -0
  16. package/lib/types/installed-bin.d.ts +9 -0
  17. package/package.json +25 -25
  18. package/runtime/manifest.json +3 -2
  19. package/runtime/node_modules/@chatcode/runtime-client/README.md +225 -0
  20. package/runtime/node_modules/@chatcode/runtime-client/desktop-history-guard.mjs +65 -0
  21. package/runtime/node_modules/@chatcode/runtime-client/desktop-history.mjs +278 -0
  22. package/runtime/node_modules/@chatcode/runtime-client/desktop-permission-gate.mjs +28 -0
  23. package/runtime/node_modules/@chatcode/runtime-client/execution.mjs +593 -0
  24. package/runtime/node_modules/@chatcode/runtime-client/index.d.ts +449 -0
  25. package/runtime/node_modules/@chatcode/runtime-client/model-preferences.mjs +57 -0
  26. package/runtime/node_modules/@chatcode/runtime-client/package.json +53 -0
  27. package/runtime/node_modules/@chatcode/runtime-client/runtime-connector.mjs +736 -0
  28. package/runtime/node_modules/@chatcode/runtime-client/session-activity.mjs +121 -0
  29. package/runtime/node_modules/@chatcode/runtime-client/session-browser.mjs +122 -0
  30. package/runtime/node_modules/@chatcode/runtime-client/stdio-bridge.mjs +103 -0
  31. package/runtime/node_modules/@chatcode/runtime-client/user-questions.mjs +108 -0
  32. package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/journal.d.ts +69 -0
  33. package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/journal.d.ts.map +1 -0
  34. package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/patch.d.ts +68 -0
  35. package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/patch.d.ts.map +1 -0
  36. package/runtime/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/resolve.d.ts +9 -0
  37. package/runtime/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/resolve.d.ts.map +1 -0
  38. package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/index.js +2 -2
  39. package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/model-selection.d.ts +6 -0
  40. package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/model-selection.js +2 -2
  41. package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/runtime-types.d.ts +12 -3
  42. package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +11 -0
  43. package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +7 -0
  44. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +69 -17
  45. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/invariant.js +1 -1
  46. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/types/agent.d.ts +3 -1
  47. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/types/inbox.d.ts +13 -0
  48. package/runtime/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +5 -5
  49. package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/access.d.ts +40 -0
  50. package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/access.js +164 -0
  51. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +460 -79
  52. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +636 -44
  53. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +483 -55
  54. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.d.ts +19 -1
  55. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +377 -40
  56. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +24 -4
  57. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +97 -15
  58. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +1 -1
  59. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.d.ts +11 -2
  60. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +172 -18
  61. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.d.ts +35 -0
  62. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.js +48 -0
  63. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.d.ts +43 -0
  64. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.js +80 -0
  65. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.d.ts +104 -0
  66. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +294 -0
  67. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.d.ts +105 -0
  68. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.js +297 -0
  69. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history.js +4 -4
  70. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +88 -1
  71. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +230 -6
  72. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/login-token-store.d.ts +64 -0
  73. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/login-token-store.js +79 -0
  74. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.d.ts +45 -0
  75. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.js +289 -0
  76. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.d.ts +40 -0
  77. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.js +112 -0
  78. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +93 -1
  79. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.d.ts +25 -0
  80. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.js +139 -0
  81. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +9 -0
  82. package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +5 -5
  83. package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.d.ts +42 -0
  84. package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.js +101 -0
  85. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/bundle-platform.d.ts +17 -0
  86. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/startup-diagnostics.d.ts +38 -0
  87. package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/client/socket.d.ts +50 -0
  88. package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/connect-protocol.d.ts +6 -0
  89. package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/peer.d.ts +36 -0
  90. package/runtime/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +5 -5
  91. package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/de.d.ts +47 -0
  92. package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/es.d.ts +47 -0
  93. package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/fr.d.ts +47 -0
  94. package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/ja.d.ts +47 -0
  95. package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/pt.d.ts +47 -0
  96. package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/ru.d.ts +47 -0
  97. package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/assets.d.ts +51 -0
  98. package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/client/notify.d.ts +8 -0
  99. package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/client/release-change.d.ts +44 -0
  100. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/types/client/CreatePluginMenuItem.d.ts +20 -0
  101. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/types/client/analytics.d.ts +8 -0
  102. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/types/client/ApprovalCard.d.ts +8 -0
  103. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/types/client/ApprovalWarning.d.ts +10 -0
  104. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/PixelWhale.d.ts +14 -0
  105. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/artwork.d.ts +17 -0
  106. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/code-fill.d.ts +21 -0
  107. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/renderer.d.ts +20 -0
  108. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/ChatFlow.d.ts +4 -0
  109. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/ReasoningContent.d.ts +16 -0
  110. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/RunningStatus.d.ts +18 -0
  111. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/RunningWhaleTail.d.ts +6 -0
  112. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/UserContent.d.ts +9 -0
  113. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/flow-motion.d.ts +110 -0
  114. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/text-interaction.d.ts +19 -0
  115. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/text-selection.d.ts +20 -0
  116. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/contract/group-tree.d.ts +32 -0
  117. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/conversation-nodes/group-tree-segments.d.ts +42 -0
  118. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/file-path.d.ts +11 -0
  119. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/reasoning-text.d.ts +8 -0
  120. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/index.d.ts +2 -2
  121. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/types/client/option-groups.d.ts +15 -0
  122. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/text-interaction.d.ts +31 -0
  123. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/user-text.d.ts +60 -0
  124. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/interaction-registry.d.ts +28 -0
  125. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/user-text-document.d.ts +21 -0
  126. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/user-text-registry.d.ts +26 -0
  127. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/draft.d.ts +23 -0
  128. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/CommandChip.d.ts +13 -0
  129. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/QuoteNode.d.ts +61 -0
  130. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/command-chip-node.d.ts +87 -0
  131. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/command-chip-selection.d.ts +20 -0
  132. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/prompt.d.ts +9 -0
  133. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/submission-analytics.d.ts +10 -0
  134. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/UserText.d.ts +22 -0
  135. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/session-reference-rule.d.ts +15 -0
  136. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/whitespace-rules.d.ts +7 -0
  137. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/view-pins.d.ts +22 -0
  138. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/types/client/GoalCommandReference.d.ts +9 -0
  139. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/types/client/user-text-rules.d.ts +21 -0
  140. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/provider-order.d.ts +10 -0
  141. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/context-menus.d.ts +18 -0
  142. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/open-toast.d.ts +40 -0
  143. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/outcome.d.ts +7 -0
  144. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/session-open-with.d.ts +14 -0
  145. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/BundleDetailSection.d.ts +26 -0
  146. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/PluginRefreshToast.d.ts +17 -0
  147. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/detail-store.d.ts +76 -0
  148. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/header-scroll.d.ts +14 -0
  149. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/sanitize-install-input.d.ts +8 -0
  150. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/tab-ledger.d.ts +15 -0
  151. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/versions.d.ts +33 -0
  152. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/AnimatedRows.module.css +7 -0
  153. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CommandText.module.css +12 -0
  154. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DetailDocument.module.css +67 -0
  155. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/InlineEditor.module.css +23 -0
  156. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/MenuGroup.module.css +37 -0
  157. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/QuotePreview.module.css +101 -0
  158. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/RowDragPreview.module.css +12 -0
  159. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/UserMessageBubble.module.css +11 -0
  160. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ZoomControls.module.css +54 -0
  161. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/AnimatedRows.d.ts +49 -0
  162. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CommandText.d.ts +16 -0
  163. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DetailDocument.d.ts +78 -0
  164. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DraggableImage.d.ts +19 -0
  165. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/HoverCardGroup.d.ts +25 -0
  166. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/InlineEditor.d.ts +23 -0
  167. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuGroup.d.ts +22 -0
  168. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuRow.d.ts +37 -0
  169. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/QuotePreview.d.ts +24 -0
  170. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SubmenuPanel.d.ts +19 -0
  171. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/UserMessageBubble.d.ts +11 -0
  172. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ZoomControls.d.ts +27 -0
  173. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/document-zoom.d.ts +17 -0
  174. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/file-drag-actions.d.ts +32 -0
  175. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/artwork.d.ts +426 -0
  176. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/image-drag.d.ts +17 -0
  177. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/copy-tex.d.ts +14 -0
  178. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/quote-text.d.ts +8 -0
  179. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/windows-path-destinations.d.ts +11 -0
  180. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/menu-submenu-position.d.ts +15 -0
  181. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/tooltip-placement.d.ts +35 -0
  182. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/use-clipboard-copy.d.ts +14 -0
  183. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useMenuSubmenu.d.ts +43 -0
  184. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useRowDragPreview.d.ts +20 -0
  185. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/types/client/FileReference.d.ts +29 -0
  186. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/types/client/user-text-rules.d.ts +18 -0
  187. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/NewSessionLimit.d.ts +12 -0
  188. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/RuleSelectRow.d.ts +22 -0
  189. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/ScheduleEmptyIllustration.d.ts +12 -0
  190. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/TaskEditorFields.d.ts +54 -0
  191. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/TaskRuleControls.d.ts +50 -0
  192. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/clear-ended.d.ts +33 -0
  193. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/editor-store.d.ts +32 -0
  194. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/editor-timing.d.ts +47 -0
  195. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/task-record.d.ts +30 -0
  196. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  197. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/account-avatar.d.ts +37 -0
  198. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/browser-login.d.ts +33 -0
  199. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/notice-transition.d.ts +7 -0
  200. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/index.d.ts +2 -2
  201. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/onboarding-settings.d.ts +1 -1
  202. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  203. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/DesktopChannelRow.d.ts +31 -0
  204. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/HostReleasePrompt.d.ts +24 -0
  205. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/desktop-channel-source.d.ts +43 -0
  206. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/ApiKeyInput.d.ts +17 -0
  207. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/ModelReasoningEfforts.d.ts +43 -0
  208. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/useModelRows.d.ts +41 -0
  209. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  210. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/PanelIcon.d.ts +9 -0
  211. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/panel-pins.d.ts +21 -0
  212. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/scroll-handoff.d.ts +24 -0
  213. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.frontmatter-fields.js +5768 -0
  214. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/PreviewFrame.d.ts +34 -0
  215. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/image/pan.d.ts +8 -0
  216. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/markdown/frontmatter-fields.d.ts +20 -0
  217. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/markdown/frontmatter.d.ts +13 -0
  218. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/FileNavigator.d.ts +33 -0
  219. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/FileTree.d.ts +114 -0
  220. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/NavigatorToggle.d.ts +28 -0
  221. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/navigator-layout.d.ts +6 -0
  222. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/workspace-tree.d.ts +51 -0
  223. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/shell/TabMenuContent.d.ts +13 -0
  224. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/shell/flash.d.ts +10 -0
  225. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/tabs/guide/GuideMoreIcon.d.ts +7 -0
  226. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/tabs/guide/guide-pins.d.ts +28 -0
  227. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/types/client/SkillReference.d.ts +19 -0
  228. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/types/client/user-text-rules.d.ts +17 -0
  229. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/types/client/slots.d.ts +12 -0
  230. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/FontFamilyRow.d.ts +19 -0
  231. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/FontSettingsGroup.d.ts +19 -0
  232. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/icon-sprite.d.ts +17 -0
  233. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/components/ExitCodeBadge.d.ts +9 -0
  234. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/components/QuestionToolRow.d.ts +13 -0
  235. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/file-menu.d.ts +15 -0
  236. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/models/recorded-path.d.ts +8 -0
  237. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/types/client/watch-tool-result.d.ts +15 -0
  238. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/types/types.d.ts +16 -0
  239. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/types/client/QuestionReplyView.d.ts +16 -0
  240. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/types/client/question-reply.d.ts +74 -0
  241. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/contract/toast.d.ts +67 -0
  242. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/path-suffix.d.ts +15 -0
  243. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/WorkspaceDialogs.d.ts +10 -0
  244. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/SessionMenu.d.ts +6 -0
  245. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/context-menus.d.ts +12 -0
  246. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/toast/Toast.d.ts +21 -0
  247. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/toast/register.d.ts +10 -0
  248. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +5 -5
  249. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.d.ts +46 -0
  250. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.js +39 -0
  251. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +11 -8
  252. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/index.d.ts +3 -1
  253. package/runtime/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +10 -10
  254. package/runtime/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/types/locales.d.ts +48 -0
  255. package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/MicrophonePicker.d.ts +6 -0
  256. package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/failure-text.d.ts +11 -0
  257. package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/microphone-device.d.ts +13 -0
  258. package/runtime/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +5 -5
  259. package/runtime/node_modules/@deepseek-ai/dsh-headless/lib/{json-stream-Bh4BGGk9.js → json-stream-Dc3g2Bl1.js} +11 -7
  260. package/runtime/node_modules/@deepseek-ai/dsh-hmr/lib/types/module-files.d.ts +48 -0
  261. package/runtime/node_modules/@deepseek-ai/dsh-hmr/lib/types/package-manifest.d.ts +35 -0
  262. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/index.js +241 -64
  263. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +26 -11
  264. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.remote-client.js +3 -3
  265. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.d.ts +19 -0
  266. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.js +5 -1
  267. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.d.ts +30 -6
  268. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +109 -8
  269. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/message.d.ts +5 -0
  270. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/prompt-protocol-options.d.ts +5 -0
  271. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/prompt-protocol-options.js +32 -0
  272. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/types.d.ts +7 -0
  273. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +19 -7
  274. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/config.d.ts +3 -3
  275. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/credential.d.ts +34 -0
  276. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listed-catalog.d.ts +56 -0
  277. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing-cache.d.ts +71 -0
  278. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing-config.d.ts +48 -0
  279. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing.d.ts +91 -0
  280. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocol-adapter.d.ts +3 -1
  281. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/types/config.d.ts +2 -2
  282. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/types/config.d.ts +2 -2
  283. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +149 -28
  284. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/adapter.d.ts +3 -1
  285. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/prompt-options.d.ts +17 -0
  286. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/provider-data.d.ts +10 -0
  287. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/provider-data.generated.d.ts +10 -0
  288. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/types.d.ts +8 -0
  289. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/credentials.d.ts +34 -0
  290. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/deadline.d.ts +12 -0
  291. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/diagnostic.d.ts +22 -0
  292. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/generation.d.ts +42 -0
  293. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/probe.d.ts +37 -0
  294. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/status.d.ts +87 -0
  295. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/templates.d.ts +37 -0
  296. package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/types.d.ts +85 -0
  297. package/runtime/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +4 -4
  298. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/bundle-detail.d.ts +40 -0
  299. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/bundle-detail.js +85 -0
  300. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.d.ts +17 -0
  301. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.js +72 -0
  302. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/git-transport.d.ts +27 -0
  303. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/git-transport.js +65 -0
  304. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.d.ts +15 -0
  305. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.js +54 -0
  306. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/versions.d.ts +40 -0
  307. package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/versions.js +61 -0
  308. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/config.d.ts +38 -0
  309. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/configuration.d.ts +10 -0
  310. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/async-function.d.ts +8 -0
  311. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/index.d.ts +12 -0
  312. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/repl.d.ts +8 -0
  313. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/types.d.ts +68 -0
  314. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/vm-script-await.d.ts +8 -0
  315. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/vm-script.d.ts +8 -0
  316. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/execution.d.ts +66 -0
  317. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/evaluation-ended.d.ts +7 -0
  318. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/module-hooks.d.ts +37 -0
  319. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/vm-modules.d.ts +35 -0
  320. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/persistent-process-entry.d.ts +2 -0
  321. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/persistent-process.d.ts +16 -0
  322. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/policy-processes.d.ts +30 -0
  323. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/rpc.d.ts +13 -0
  324. package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/worker.d.ts +66 -0
  325. package/runtime/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +215 -9
  326. package/runtime/node_modules/@deepseek-ai/dsh-sandbox/lib/types/locales.d.ts +41 -0
  327. package/runtime/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types/acl-skill.d.ts +19 -0
  328. package/runtime/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/{types-Ci-q7_aQ.js → types-DwkEVVWZ.js} +357 -81
  329. package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-activity.d.ts +43 -0
  330. package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-content.d.ts +21 -0
  331. package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-input.d.ts +12 -0
  332. package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/user-questions.d.ts +17 -0
  333. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/index.js +2 -1
  334. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/request-header.js +2 -0
  335. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/types.d.ts +2 -0
  336. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/CopyToast.d.ts +21 -0
  337. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/copy-controller.d.ts +76 -0
  338. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/markdown.d.ts +22 -0
  339. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +197 -9
  340. package/runtime/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +5 -5
  341. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +5 -5
  342. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.d.ts +112 -0
  343. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.js +112 -0
  344. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.d.ts +232 -0
  345. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +1250 -0
  346. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.d.ts +56 -0
  347. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.js +96 -0
  348. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.d.ts +49 -0
  349. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.js +130 -0
  350. package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/types/linux-scope-selector.d.ts +60 -0
  351. package/runtime/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +215 -9
  352. package/runtime/node_modules/@deepseek-ai/dsh-token-meter/lib/types/measurement-projection.d.ts +74 -0
  353. package/runtime/node_modules/@deepseek-ai/dsh-token-meter/lib/types/measurement-projection.js +94 -0
  354. package/runtime/node_modules/@deepseek-ai/dsh-tool-ask-user/lib/types/timed.d.ts +13 -0
  355. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +31 -1
  356. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch-output.d.ts +140 -0
  357. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch-presentation.d.ts +15 -0
  358. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch.d.ts +10 -0
  359. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/mutation-result.d.ts +18 -0
  360. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/execute.d.ts +17 -0
  361. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/index.d.ts +17 -0
  362. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/plan.d.ts +52 -0
  363. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/preflight.d.ts +18 -0
  364. package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/types.d.ts +106 -0
  365. package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent/lib/types/preset-selection.d.ts +36 -0
  366. package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/wait-agent.d.ts +8 -0
  367. package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/wait-agent.js +104 -0
  368. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/batch.d.ts +26 -0
  369. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/batch.js +246 -0
  370. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/contracts.d.ts +376 -0
  371. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/contracts.js +51 -0
  372. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/events.d.ts +58 -0
  373. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/events.js +2 -0
  374. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/executor.d.ts +90 -0
  375. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/executor.js +19 -0
  376. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/pipeline.d.ts +154 -0
  377. package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/pipeline.js +701 -0
  378. package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/principal.d.ts +13 -0
  379. package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/principal.js +15 -0
  380. package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-access.d.ts +32 -0
  381. package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-access.js +9 -0
  382. package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.d.ts +21 -0
  383. package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.js +143 -0
  384. package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/projection.d.ts +85 -0
  385. package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/projection.js +298 -0
  386. package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/timed-wait.d.ts +37 -0
  387. package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/timed-wait.js +85 -0
  388. package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/cron.d.ts +54 -0
  389. package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/duration.d.ts +61 -0
  390. package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/instant.d.ts +145 -0
  391. package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/recurrence.d.ts +38 -0
  392. package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/rrule.d.ts +34 -0
  393. package/runtime/node_modules/@deepseek-ai/dsh-util-values/lib/types/partial-json.d.ts +152 -0
  394. package/runtime/node_modules/@deepseek-ai/dsh-web-app/lib/types/public-url.d.ts +16 -0
  395. package/runtime/node_modules/@deepseek-ai/node-addon-system/lib/.tsbuildinfo +1 -1
  396. package/lib/dump-config-DuCc-QB7.js +0 -2
  397. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.d.ts +0 -26
  398. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.js +0 -61
  399. package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/watch-config.d.ts +0 -13
  400. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/types/ImageLightbox.d.ts +0 -27
  401. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/queue.d.ts +0 -9
  402. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/queue-store.d.ts +0 -20
  403. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/ProducedFiles.d.ts +0 -14
  404. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/icons.d.ts +0 -8
  405. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/OnboardingSurface.module.css +0 -29
  406. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/OnboardingSurface.d.ts +0 -11
  407. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/settings-contract.d.ts +0 -86
  408. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/settings-scope.d.ts +0 -141
  409. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/desktop-update-bridge.d.ts +0 -23
  410. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/AgentLoopCard.d.ts +0 -12
  411. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/BashCard.d.ts +0 -12
  412. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/ConfigurablePluginsTab.d.ts +0 -19
  413. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/PluginCard.d.ts +0 -42
  414. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/PluginConfigForm.d.ts +0 -34
  415. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentCard.d.ts +0 -12
  416. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentLimitsFields.d.ts +0 -14
  417. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentModelSelectionCard.d.ts +0 -12
  418. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentModelSelectionFields.d.ts +0 -14
  419. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/WebSearchCard.d.ts +0 -16
  420. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/agent-loop-card-controller.d.ts +0 -43
  421. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/bash-card-controller.d.ts +0 -45
  422. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/card-form.d.ts +0 -171
  423. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/fields.d.ts +0 -69
  424. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/slot-contract.d.ts +0 -31
  425. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-card-controller.d.ts +0 -32
  426. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-limits-card-controller.d.ts +0 -33
  427. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-model-selection-card-controller.d.ts +0 -129
  428. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/tab-store.d.ts +0 -65
  429. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/web-search-card-controller.d.ts +0 -93
  430. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/code/languages.d.ts +0 -9
  431. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/icons.d.ts +0 -14
  432. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/pdf/PdfBody.d.ts +0 -24
  433. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/types/client/TerminalBody.d.ts +0 -14
  434. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/types/client/subagent-lineage.d.ts +0 -21
  435. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/subagent-lineage.d.ts +0 -21
  436. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/defaults.d.ts +0 -24
  437. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/file-id.d.ts +0 -19
  438. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/file-store.d.ts +0 -86
  439. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/files-api.d.ts +0 -111
  440. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/image-tokens.d.ts +0 -34
  441. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/messages-api.d.ts +0 -10
  442. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/model-info.d.ts +0 -16
  443. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/models.d.ts +0 -4
  444. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-extensions.d.ts +0 -16
  445. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-files.d.ts +0 -49
  446. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-pricing.d.ts +0 -60
  447. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/types.d.ts +0 -119
  448. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/upload-index.d.ts +0 -68
  449. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/adapter.d.ts +0 -45
  450. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/serialize.d.ts +0 -78
  451. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/sse.d.ts +0 -24
  452. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/translate.d.ts +0 -37
  453. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/types.d.ts +0 -178
  454. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/adapter.d.ts +0 -47
  455. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/images.d.ts +0 -35
  456. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/replay.d.ts +0 -27
  457. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/serialize.d.ts +0 -18
  458. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/sse.d.ts +0 -8
  459. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/translate.d.ts +0 -14
  460. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/transport.d.ts +0 -15
  461. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/types.d.ts +0 -62
  462. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.d.ts +0 -19
  463. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.js +0 -30
  464. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.d.ts +0 -35
  465. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.js +0 -68
  466. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.d.ts +0 -10
  467. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.js +0 -22
  468. package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/invariant.d.ts +0 -16
  469. package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/invariant.js +0 -41
  470. package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-DGV26RBf.js +0 -1525
  471. package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-UEJ3Ntqn.js +0 -1511
  472. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/fiber-state.d.ts +0 -28
  473. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/fiber-state.js +0 -25
  474. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/inspect.d.ts +0 -93
  475. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/inspect.js +0 -303
  476. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/prompt.d.ts +0 -3
  477. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/prompt.js +0 -5
  478. package/lib/{plugin-d65VulBk.js → plugin-BccFcAte.js} +1 -1
@@ -1,8 +1,13 @@
1
- import { existsSync, mkdirSync, realpathSync, statSync } from "node:fs";
1
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
2
2
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
3
3
  import { ERROR_INSUFFICIENT_BUFFER, Win32Error, allocPtrSlot, allocUint32, decodePtr, decodeUint32, drainPipe, extendWin32ProcessBindings, isNullPtr, isNullPtr as isNullPtr$1, spawnInheritedJobProcess, spawnPipedProcess, throwLastError, throwLastError as throwLastError$1, throwWin32, waitForProcessExit } from "@deepseek-ai/dsh-win32-process";
4
4
  import { createHash } from "node:crypto";
5
5
  import { createLazyRequire } from "@deepseek-ai/dsh-lazy-require";
6
+ import { readFile, rm } from "node:fs/promises";
7
+ import { tmpdir } from "node:os";
8
+ import { fileURLToPath } from "node:url";
9
+ import { BUNDLED_SKILL_RANK } from "@deepseek-ai/dsh-skill";
10
+ import { parse } from "yaml";
6
11
  //#region lib/types/win32-abi.js
7
12
  /** ACL/token-specific Win32 constants. */
8
13
  /** OpenProcess access required to query the current process token. */
@@ -188,6 +193,18 @@ function bindings() {
188
193
  PVOID,
189
194
  PPVOID
190
195
  ]),
196
+ initializeAcl: bind(advapi32, "InitializeAcl", "int", [
197
+ PVOID,
198
+ "uint32",
199
+ "uint32"
200
+ ]),
201
+ addMandatoryAce: bind(advapi32, "AddMandatoryAce", "int", [
202
+ PVOID,
203
+ "uint32",
204
+ "uint32",
205
+ "uint32",
206
+ PVOID
207
+ ]),
191
208
  setNamedSecurityInfoW: bind(advapi32, "SetNamedSecurityInfoW", "uint32", [
192
209
  "str16",
193
210
  "int",
@@ -272,6 +289,15 @@ function getTempPath(api) {
272
289
  * failure is reported with the API name, the exact Win32 code, the formatted
273
290
  * system text, and the affected path.
274
291
  *
292
+ * Each grant applies three edits in ONE SetNamedSecurityInfoW call: the
293
+ * capability-SID allow ACE, a Deny ACE that removes the ambient
294
+ * `FILE_DELETE_CHILD` right from the world SID, and a Low no-write-up
295
+ * mandatory label ({@link buildLowLabelAcl}). The deny is what keeps one
296
+ * granted root out of another's reach: Windows also authorizes a delete from
297
+ * the parent directory's `FILE_DELETE_CHILD` right, which the token's
298
+ * write-restricted intersection does not reach, and every granted root carries
299
+ * the Low label that clears the integrity check.
300
+ *
275
301
  * Concurrency: grants are read-merge-write against the directory's CURRENT
276
302
  * DACL, and the whole get-merge-set sequence runs under a per-path exclusive
277
303
  * LockFileEx lock (see {@link withPathLock}) so concurrent sandbox instances
@@ -283,17 +309,21 @@ function getTempPath(api) {
283
309
  * perms@0, mode@4, inheritance@8, Trustee@16 { pMultipleTrustee@16,
284
310
  * MultipleTrusteeOperation@24, TrusteeForm@28, TrusteeType@32, ptstrName@40 }.
285
311
  * `permissions` is the access mask; the POC passes 0 for REVOKE_ACCESS, which
286
- * removes every ACE for the trustee.
312
+ * removes every ACE for the trustee. `inheritance` defaults to children of
313
+ * both kinds; the ambient-delete deny narrows it to containers because
314
+ * FILE_DELETE_CHILD is meaningless on a file and its bit would otherwise
315
+ * spread through the file's inherited mask.
287
316
  * @param sidPtr - the trustee SID the entry names.
288
- * @param mode - the access mode (GRANT_ACCESS or REVOKE_ACCESS).
289
- * @param permissions - the access mask to grant (0 for REVOKE_ACCESS).
317
+ * @param mode - the access mode (GRANT_ACCESS, DENY_ACCESS, or REVOKE_ACCESS).
318
+ * @param permissions - the access mask to grant or deny (0 for REVOKE_ACCESS).
319
+ * @param inheritance - the ACE inheritance flags.
290
320
  * @returns the packed entry buffer.
291
321
  */
292
- function buildExplicitAccess(sidPtr, mode, permissions) {
322
+ function buildExplicitAccess(sidPtr, mode, permissions, inheritance = 3) {
293
323
  const entry = Buffer.alloc(48);
294
324
  entry.writeUInt32LE(permissions, 0);
295
325
  entry.writeUInt32LE(mode, 4);
296
- entry.writeUInt32LE(3, 8);
326
+ entry.writeUInt32LE(inheritance, 8);
297
327
  entry.writeUInt32LE(0, 24);
298
328
  entry.writeUInt32LE(0, 28);
299
329
  entry.writeUInt32LE(0, 32);
@@ -356,76 +386,173 @@ function withPathLock(api, path, action) {
356
386
  return result;
357
387
  }
358
388
  /**
359
- * Read the directory's current explicit DACL via GetNamedSecurityInfoW.
389
+ * Read the directory's current explicit DACL and mandatory label via
390
+ * GetNamedSecurityInfoW.
360
391
  * Allocation contract (the POC's RevokeAccess, minus its missing checks): the
361
392
  * returned ACL pointer sits INSIDE the security descriptor allocation — only
362
393
  * the descriptor may be LocalFree'd, and it must not be freed before
363
394
  * SetEntriesInAclW has consumed the ACL. Freeing the ACL pointer itself
364
395
  * corrupts the heap (verified the hard way).
365
396
  * @param api - the binding table.
366
- * @param path - the directory whose DACL is read.
367
- * @returns the current explicit DACL (null when the directory carries none) and its owning descriptor.
397
+ * @param path - the directory whose DACL and label are read.
398
+ * @returns the current explicit DACL and label ACL (null when the directory carries none) plus their owning descriptor.
368
399
  */
369
- function readCurrentDacl(api, path) {
400
+ function readCurrentSecurity(api, path) {
370
401
  const ownerSlot = allocPtrSlot();
371
402
  const groupSlot = allocPtrSlot();
372
403
  const daclSlot = allocPtrSlot();
373
404
  const saclSlot = allocPtrSlot();
374
405
  const descriptorSlot = allocPtrSlot();
375
- const readResult = api.getNamedSecurityInfoW(path, 1, 4, ownerSlot, groupSlot, daclSlot, saclSlot, descriptorSlot);
406
+ const readResult = api.getNamedSecurityInfoW(path, 1, 20, ownerSlot, groupSlot, daclSlot, saclSlot, descriptorSlot);
376
407
  if (readResult !== 0) throwWin32(api, "GetNamedSecurityInfoW", readResult, path);
377
408
  return {
378
409
  oldAcl: decodePtr(daclSlot),
410
+ labelAcl: decodePtr(saclSlot),
379
411
  descriptor: decodePtr(descriptorSlot)
380
412
  };
381
413
  }
382
414
  /**
383
- * Shared tail of grantWrite and revokeWrite: merge `entry` into `oldAcl`
415
+ * Build the Low mandatory label applied with every write grant: one
416
+ * SYSTEM_MANDATORY_LABEL_ACE naming `lowLabelSidPtr` with the no-write-up
417
+ * policy, inheriting to subcontainers and objects so later children carry the
418
+ * same label. The caller frees the returned ACL with LocalFree
419
+ * (SetNamedSecurityInfoW copies it); every Win32 call is checked and a
420
+ * half-built ACL is released before the error is thrown.
421
+ * @param api - the binding table.
422
+ * @param lowLabelSidPtr - the Low integrity SID (S-1-16-4096) the label names.
423
+ * @returns the ACL carrying the single inheritable label ACE.
424
+ */
425
+ function buildLowLabelAcl(api, lowLabelSidPtr) {
426
+ const sidLength = api.getLengthSid(lowLabelSidPtr);
427
+ if (sidLength === 0) throwLastError$1(api, "GetLengthSid", "Low mandatory label SID");
428
+ const aclLength = 16 + sidLength;
429
+ const acl = api.localAlloc(64, aclLength);
430
+ if (isNullPtr$1(acl)) throwLastError$1(api, "LocalAlloc", "Low mandatory label ACL");
431
+ if (api.initializeAcl(acl, aclLength, 2) === 0) {
432
+ const win32Code = api.getLastError();
433
+ api.localFree(acl);
434
+ throwWin32(api, "InitializeAcl", win32Code, "Low mandatory label ACL");
435
+ }
436
+ if (api.addMandatoryAce(acl, 2, 3, 1, lowLabelSidPtr) === 0) {
437
+ const win32Code = api.getLastError();
438
+ api.localFree(acl);
439
+ throwWin32(api, "AddMandatoryAce", win32Code, "Low mandatory label ACL");
440
+ }
441
+ return acl;
442
+ }
443
+ /**
444
+ * True when the label ACL already carries the EXACT label this module would
445
+ * add (mandatory-label ACE, OI|CI inheritance, no-write-up policy, the Low
446
+ * SID), so a re-grant can skip the eager full-tree propagation.
447
+ * @param labelAcl - the current label ACL pointer (from {@link readCurrentSecurity}).
448
+ * @param lowLabelSidPtr - the Low integrity SID to match.
449
+ * @returns whether the exact label ACE is already present.
450
+ */
451
+ function hasExactLabel(labelAcl, lowLabelSidPtr) {
452
+ return hasExactEntry(labelAcl, 17, 3, 1, lowLabelSidPtr);
453
+ }
454
+ /**
455
+ * Shared tail of grantWrite and revokeWrite: merge `entries` into `oldAcl`
384
456
  * (null = no explicit DACL yet; SetEntriesInAclW builds one from scratch),
385
- * free the descriptor before applying the merged ACL, apply it, then free the
386
- * merged ACL — checking every call and reporting with the caller's label.
457
+ * free the descriptor before applying the merged ACL, apply the merged DACL
458
+ * together with the label edit in one SetNamedSecurityInfoW call, then free
459
+ * every ACL this call owns — checking each call and reporting with the
460
+ * caller's label. The entry count derives from the buffer, so a grant can
461
+ * carry its capability ACE and its ambient-delete deny in one merge.
387
462
  * @param api - the binding table.
388
- * @param path - the directory the DACL edit applies to.
389
- * @param entry - the EXPLICIT_ACCESS_W to merge (grant or revoke).
390
- * @param oldAcl - the current explicit DACL (from {@link readCurrentDacl}).
463
+ * @param path - the directory the DACL and label edits apply to.
464
+ * @param entries - packed EXPLICIT_ACCESS_W records to merge (grant, deny, or revoke).
465
+ * @param oldAcl - the current explicit DACL (from {@link readCurrentSecurity}).
466
+ * @param labelEdit - the label change to apply alongside the DACL.
391
467
  * @param descriptor - the descriptor allocation owning `oldAcl`.
392
468
  * @param label - the caller's name for error details.
393
469
  */
394
- function mergeAndApply(api, path, entry, oldAcl, descriptor, label) {
470
+ function mergeAndApply(api, path, entries, oldAcl, labelEdit, descriptor, label) {
395
471
  const newAclSlot = allocPtrSlot();
396
- const mergeResult = api.setEntriesInAclW(1, entry, oldAcl, newAclSlot);
472
+ const mergeResult = api.setEntriesInAclW(entries.length / 48, entries, oldAcl, newAclSlot);
397
473
  if (mergeResult !== 0) {
398
474
  if (descriptor !== null) api.localFree(descriptor);
475
+ if (labelEdit.kind === "apply") api.localFree(labelEdit.acl);
399
476
  throwWin32(api, "SetEntriesInAclW", mergeResult, `${label}(${path})`);
400
477
  }
401
478
  const newAcl = decodePtr(newAclSlot);
402
479
  if (newAcl === null) {
403
480
  if (descriptor !== null) api.localFree(descriptor);
481
+ if (labelEdit.kind === "apply") api.localFree(labelEdit.acl);
404
482
  throwWin32(api, "SetEntriesInAclW", api.getLastError(), `${label}(${path}): null new ACL`);
405
483
  }
406
484
  const freedDescriptor = descriptor !== null ? api.localFree(descriptor) : null;
407
- const applyResult = api.setNamedSecurityInfoW(path, 1, 4, null, null, newAcl, null);
485
+ const applyResult = api.setNamedSecurityInfoW(path, 1, labelEdit.kind === "keep" ? 4 : 20, null, null, newAcl, labelEdit.kind === "apply" ? labelEdit.acl : null);
408
486
  const freedNew = api.localFree(newAcl);
487
+ const freedLabel = labelEdit.kind === "apply" ? api.localFree(labelEdit.acl) : null;
409
488
  if (applyResult !== 0) throwWin32(api, "SetNamedSecurityInfoW", applyResult, `${label}(${path})`);
410
489
  if (freedDescriptor !== null && !isNullPtr$1(freedDescriptor)) throwLastError$1(api, "LocalFree", `${label}(${path}) descriptor`);
411
490
  if (!isNullPtr$1(freedNew)) throwLastError$1(api, "LocalFree", `${label}(${path}) new ACL`);
491
+ if (freedLabel !== null && !isNullPtr$1(freedLabel)) throwLastError$1(api, "LocalFree", `${label}(${path}) label ACL`);
492
+ }
493
+ /**
494
+ * True when the explicit DACL already carries the EXACT entry
495
+ * `(aceType, inheritance, mask, trustee SID)`. Every field is read through
496
+ * koffi.decode at pointer offsets — no memcpy, no pointer arithmetic. The
497
+ * ACE's SID is INLINE (embedded in the ACE after the 4-byte mask — there is
498
+ * no pointer to read; reading one yields garbage addresses and crashed
499
+ * EqualSid, verified by gdb), so it is compared field-by-field against the
500
+ * trustee SID through bounded offset reads ({@link sameSidAt}). Allowed and
501
+ * denied ACEs share the Mask@4/SID@8 layout. A malformed header reads as "no
502
+ * exact entry" so the caller falls back to the merge-apply path, which owns
503
+ * the robust failure handling.
504
+ * @param acl - the current explicit DACL pointer (from {@link readCurrentSecurity}).
505
+ * @param aceType - the ACE type to match.
506
+ * @param inheritance - the ACE inheritance flags to match.
507
+ * @param mask - the access mask to match.
508
+ * @param sidPtr - the trustee SID to match.
509
+ * @returns whether the exact entry is already present.
510
+ */
511
+ function hasExactEntry(acl, aceType, inheritance, mask, sidPtr) {
512
+ const aclSize = decodeUint16At(acl, 2);
513
+ const aceCount = decodeUint16At(acl, 4);
514
+ if (aclSize < 8 || aclSize > 1048576) return false;
515
+ let offset = 8;
516
+ for (let index = 0; index < aceCount; index++) {
517
+ const aceSize = decodeUint16At(acl, offset + 2);
518
+ if (aceSize < 8 || offset + aceSize > aclSize) return false;
519
+ if (decodeUint8At(acl, offset) === aceType && decodeUint8At(acl, offset + 1) === inheritance && decodeUint32At(acl, offset + 4) === mask && sameSidAt(acl, offset + 8, sidPtr, 0)) return true;
520
+ offset += aceSize;
521
+ }
522
+ return false;
412
523
  }
413
524
  /**
414
525
  * True when the explicit DACL already carries the EXACT write grant this
415
- * module would add (Allow ACE, OI|CI inheritance, {@link abi.GRANT_MASK}, the
416
- * capability SID). Every field is read through koffi.decode at pointer offsets —
417
- * no memcpy, no pointer arithmetic. The ACE's SID is INLINE (embedded in the
418
- * ACE after the 4-byte mask — there is no pointer to read; reading one
419
- * yields garbage addresses and crashed EqualSid, verified by gdb), so it is
420
- * compared field-by-field against the capability SID through bounded offset
421
- * reads ({@link sameSidAt}). A malformed header reads as "no exact grant"
422
- * so the caller falls back to the merge-apply path, which owns the robust
423
- * failure handling.
424
- * @param oldAcl - the current explicit DACL pointer (from {@link readCurrentDacl}).
526
+ * module would add: the Allow ACE for {@link abi.GRANT_MASK} naming the
527
+ * capability SID.
528
+ * @param oldAcl - the current explicit DACL pointer (from {@link readCurrentSecurity}).
425
529
  * @param sidPtr - the capability SID to match.
426
530
  * @returns whether the exact grant ACE is already present.
427
531
  */
428
532
  function hasExactGrant(oldAcl, sidPtr) {
533
+ return hasExactEntry(oldAcl, 0, 3, GRANT_MASK, sidPtr);
534
+ }
535
+ /**
536
+ * True when the explicit DACL already carries the EXACT ambient-delete deny:
537
+ * the container-inherited Deny ACE for {@link abi.FILE_DELETE_CHILD} naming
538
+ * the world SID. It is part of the idempotent skip, so a root granted by an
539
+ * earlier build receives the deny on its next provision.
540
+ * @param oldAcl - the current explicit DACL pointer (from {@link readCurrentSecurity}).
541
+ * @param worldSidPtr - the Everyone SID the deny names.
542
+ * @returns whether the exact deny ACE is already present.
543
+ */
544
+ function hasExactDeny(oldAcl, worldSidPtr) {
545
+ return hasExactEntry(oldAcl, 1, 2, 64, worldSidPtr);
546
+ }
547
+ /**
548
+ * True when a capability grant for a SID OTHER than `sidPtr` stands on this
549
+ * DACL — the condition under which a revoke must leave the shared Low label in
550
+ * place, or the remaining grant's child would lose its write authority.
551
+ * @param oldAcl - the current explicit DACL pointer (from {@link readCurrentSecurity}).
552
+ * @param sidPtr - the capability SID being revoked.
553
+ * @returns whether another capability grant remains.
554
+ */
555
+ function hasForeignGrant(oldAcl, sidPtr) {
429
556
  const aclSize = decodeUint16At(oldAcl, 2);
430
557
  const aceCount = decodeUint16At(oldAcl, 4);
431
558
  if (aclSize < 8 || aclSize > 1048576) return false;
@@ -433,46 +560,67 @@ function hasExactGrant(oldAcl, sidPtr) {
433
560
  for (let index = 0; index < aceCount; index++) {
434
561
  const aceSize = decodeUint16At(oldAcl, offset + 2);
435
562
  if (aceSize < 8 || offset + aceSize > aclSize) return false;
436
- if (decodeUint8At(oldAcl, offset) === 0 && decodeUint8At(oldAcl, offset + 1) === 3 && decodeUint32At(oldAcl, offset + 4) === 1114454 && sameSidAt(oldAcl, offset + 8, sidPtr, 0)) return true;
563
+ if (decodeUint8At(oldAcl, offset) === 0 && decodeUint32At(oldAcl, offset + 4) === 1114454 && !sameSidAt(oldAcl, offset + 8, sidPtr, 0)) return true;
437
564
  offset += aceSize;
438
565
  }
439
566
  return false;
440
567
  }
441
568
  /**
442
569
  * Grant `GRANT_MASK` (Write+Delete, displays as "Modify") to the capability SID
443
- * on `path`, inheriting to subcontainers and objects. Idempotent: when the
444
- * directory's current explicit DACL already carries the exact ACE (the
445
- * per-session grant surviving from a previous server lifetime), the
446
- * SetNamedSecurityInfoW apply is SKIPPED — it would otherwise re-propagate
447
- * the identical ACE across the whole tree (eager inheritance; minutes on
448
- * large workspaces). Otherwise read-merge-write: the new ACE merges into the
449
- * directory's CURRENT explicit DACL (same shape as {@link revokeWrite}), so
450
- * pre-existing explicit ACEs survive. Runs under the per-path lock. The
451
- * directory must be owned by the caller (owner implicit WRITE_DAC) — same
452
- * precondition as the POC.
570
+ * on `path`, deny the world SID the ambient `FILE_DELETE_CHILD` right, and
571
+ * apply the Low mandatory label — one merge. The deny inherits to containers
572
+ * only: the right is evaluated on directories, and inheriting its bit onto
573
+ * files would deny every `FILE_ALL_ACCESS`/`GENERIC_ALL` open inside the root
574
+ * (0x40 is a member of that mask). The capability ACE's DELETE bit is then the
575
+ * only delete authority inside the root, so a file whose own DACL grants no
576
+ * DELETE is no longer deletable through its parent's rights.
577
+ *
578
+ * Idempotent: the exact ACE, deny, and label together SKIP the
579
+ * SetNamedSecurityInfoW apply, which would otherwise re-propagate the
580
+ * identical descriptor across the whole tree (eager inheritance; minutes on
581
+ * large workspaces). Otherwise read-merge-write, so pre-existing explicit ACEs
582
+ * survive (same shape as {@link revokeWrite}). Runs under the per-path lock.
583
+ * The directory must be owned by the caller AND grant WRITE_OWNER (the label
584
+ * lives in the SACL; owner-implicit rights cover only READ_CONTROL and
585
+ * WRITE_DAC) — a Full-control workspace satisfies both.
453
586
  * @param api - the binding table.
454
- * @param path - the directory whose DACL gains the grant (the workspace or temp root).
587
+ * @param path - the directory whose DACL and label gain the grant (the workspace or temp root).
455
588
  * @param sidPtr - the capability SID the ACE names.
589
+ * @param lowLabelSidPtr - the Low integrity SID the mandatory label names.
590
+ * @param worldSidPtr - the Everyone SID the ambient-delete deny names.
456
591
  */
457
- function grantWrite(api, path, sidPtr) {
592
+ function grantWrite(api, path, sidPtr, lowLabelSidPtr, worldSidPtr) {
458
593
  withPathLock(api, path, () => {
459
- const { oldAcl, descriptor } = readCurrentDacl(api, path);
460
- if (oldAcl !== null && hasExactGrant(oldAcl, sidPtr)) {
594
+ const { oldAcl, labelAcl, descriptor } = readCurrentSecurity(api, path);
595
+ if (oldAcl !== null && labelAcl !== null && hasExactGrant(oldAcl, sidPtr) && hasExactDeny(oldAcl, worldSidPtr) && hasExactLabel(labelAcl, lowLabelSidPtr)) {
461
596
  if (descriptor !== null) {
462
597
  if (!isNullPtr$1(api.localFree(descriptor))) throwLastError$1(api, "LocalFree", `grantWrite(${path}) descriptor`);
463
598
  }
464
599
  return;
465
600
  }
466
- mergeAndApply(api, path, buildExplicitAccess(sidPtr, 1, GRANT_MASK), oldAcl, descriptor, "grantWrite");
601
+ let label;
602
+ try {
603
+ label = buildLowLabelAcl(api, lowLabelSidPtr);
604
+ } catch (error) {
605
+ if (descriptor !== null) api.localFree(descriptor);
606
+ throw error;
607
+ }
608
+ mergeAndApply(api, path, Buffer.concat([buildExplicitAccess(worldSidPtr, 3, 64, 2), buildExplicitAccess(sidPtr, 1, GRANT_MASK)]), oldAcl, {
609
+ kind: "apply",
610
+ acl: label
611
+ }, descriptor, "grantWrite");
467
612
  });
468
613
  }
469
614
  /**
470
615
  * Remove every ACE for the capability SID from the directory DACL (REVOKE_ACCESS
471
- * merge — other entries are preserved). Returns whether an ACE removal was
472
- * attempted (false when the directory carries no DACL at all).
616
+ * merge — other entries are preserved). The shared Low label is cleared only
617
+ * when no other capability grant remains on the directory: two grants may
618
+ * target one directory, and the surviving one still needs the label for its
619
+ * child's writes. Returns whether an ACE removal was attempted (false when the
620
+ * directory carries no DACL at all).
473
621
  *
474
622
  * Runs under the per-path lock (the whole get-merge-set sequence); the
475
- * descriptor/ACL allocation contract lives on {@link readCurrentDacl}.
623
+ * descriptor/ACL allocation contract lives on {@link readCurrentSecurity}.
476
624
  * @param api - the binding table.
477
625
  * @param path - the directory whose DACL loses the capability-SID ACEs.
478
626
  * @param sidPtr - the capability SID whose ACEs are removed.
@@ -480,14 +628,14 @@ function grantWrite(api, path, sidPtr) {
480
628
  */
481
629
  function revokeWrite(api, path, sidPtr) {
482
630
  return withPathLock(api, path, () => {
483
- const { oldAcl, descriptor } = readCurrentDacl(api, path);
631
+ const { oldAcl, descriptor } = readCurrentSecurity(api, path);
484
632
  if (oldAcl === null) {
485
633
  if (descriptor !== null) {
486
634
  if (!isNullPtr$1(api.localFree(descriptor))) throwLastError$1(api, "LocalFree", `revokeWrite(${path}) descriptor`);
487
635
  }
488
636
  return false;
489
637
  }
490
- mergeAndApply(api, path, buildExplicitAccess(sidPtr, 4, 0), oldAcl, descriptor, "revokeWrite");
638
+ mergeAndApply(api, path, buildExplicitAccess(sidPtr, 4, 0), oldAcl, hasForeignGrant(oldAcl, sidPtr) ? { kind: "keep" } : { kind: "clear" }, descriptor, "revokeWrite");
491
639
  return true;
492
640
  });
493
641
  }
@@ -673,6 +821,23 @@ function setTokenDefaultDaclGrant(api, token, sidPtr) {
673
821
  }
674
822
  api.localFree(newDacl);
675
823
  }
824
+ /**
825
+ * Lower the restricted token's integrity level to Low (S-1-16-4096), the level
826
+ * the mandatory labels `grantWrite` applies are matched against; a token left
827
+ * at Medium would ignore them. Requires TOKEN_ADJUST_DEFAULT on the token;
828
+ * fails closed before any child is spawned.
829
+ * @param api - the binding table.
830
+ * @param token - the restricted token to lower.
831
+ * @param lowLabelSidPtr - the Low integrity SID (S-1-16-4096).
832
+ */
833
+ function restrictTokenIntegrity(api, token, lowLabelSidPtr) {
834
+ const sidLength = api.getLengthSid(lowLabelSidPtr);
835
+ if (sidLength === 0) throwLastError$1(api, "GetLengthSid", "Low integrity label SID");
836
+ const info = Buffer.alloc(16 + sidLength);
837
+ info.writeBigUInt64LE(ptrAddress(lowLabelSidPtr), 0);
838
+ info.writeUInt32LE(32, 8);
839
+ if (api.setTokenInformation(token, 25, info, info.length) === 0) throwLastError$1(api, "SetTokenInformation", "TokenIntegrityLevel (Low)");
840
+ }
676
841
  /** Pack `SID_AND_ATTRIBUTES[count]` (16-byte stride; Attributes stay 0). */
677
842
  function buildRestrictingSids(sids) {
678
843
  const buffer = Buffer.alloc(16 * sids.length);
@@ -725,7 +890,7 @@ function createRestrictedToken(api, currentToken, logonSid, writeSids, known, mo
725
890
  ...writeSids
726
891
  ]);
727
892
  const tokenSlot = allocPtrSlot();
728
- if (api.createRestrictedToken(currentToken, 13, 0, null, 0, null, restrictingSids.length / 16, restrictingSids, tokenSlot) === 0) throwLastError$1(api, "CreateRestrictedToken", `restricting SIDs: ${restrictingSids.length / 16}`);
893
+ if (api.createRestrictedToken(currentToken, 9, 0, null, 0, null, restrictingSids.length / 16, restrictingSids, tokenSlot) === 0) throwLastError$1(api, "CreateRestrictedToken", `restricting SIDs: ${restrictingSids.length / 16}`);
729
894
  const token = decodePtr(tokenSlot);
730
895
  if (token === null) throwWin32(api, "CreateRestrictedToken", api.getLastError(), "null token handle");
731
896
  return token;
@@ -741,34 +906,42 @@ function createRestrictedToken(api, currentToken, logonSid, writeSids, known, mo
741
906
  *
742
907
  * Fail-closed: `add` throws on any grant failure and the caller disposes the
743
908
  * instance (revoking every path granted so far); `dispose` revokes every
744
- * standing grant and reports every cleanup failure.
909
+ * revocable grant, leaves the standing workspace edits in place, and reports
910
+ * every cleanup failure.
745
911
  * @module @deepseek-ai/dsh-sandbox-windows-acl/grant
746
912
  */
747
913
  /**
748
914
  * One write SID's provider-lifetime grant materialization: the parsed SID
749
- * pointer plus every directory whose DACL currently carries its ACE.
750
- * Workspace paths are added STANDING (their ACEs are the cross-session reuse
751
- * cache and outlive the grant — dispose() skips revoking them, or the next
915
+ * pointer plus every directory whose DACL currently carries its ACE and whose
916
+ * label ACL carries the Low mandatory label. Workspace paths are added
917
+ * STANDING (their security descriptor edits are the cross-session reuse cache
918
+ * and outlive the grant — dispose() skips revoking them, or the next
752
919
  * provision would re-propagate the whole tree); temp paths are revocable
753
920
  * (dispose() revokes them — an inheritable ACE must not outlive its
754
921
  * session's temp directory). Create with {@link AclWriteGrant.create};
755
- * dispose revokes the revocable paths and frees the SID.
922
+ * dispose revokes the revocable paths and frees every SID.
756
923
  */
757
924
  var AclWriteGrant = class AclWriteGrant {
758
925
  /** The write SID in SDDL string form. */
759
926
  writeSid;
760
927
  api;
761
928
  sidPtr;
929
+ lowLabelSidPtr;
930
+ worldSidPtr;
762
931
  revocablePaths = [];
763
932
  standingPaths = [];
764
- constructor(api, sidPtr, writeSid) {
933
+ constructor(api, sidPtr, lowLabelSidPtr, worldSidPtr, writeSid) {
765
934
  this.api = api;
766
935
  this.sidPtr = sidPtr;
936
+ this.lowLabelSidPtr = lowLabelSidPtr;
937
+ this.worldSidPtr = worldSidPtr;
767
938
  this.writeSid = writeSid;
768
939
  }
769
940
  /**
770
- * Parse the SID string and open the binding table (lazily, once per
771
- * server). Fail-closed: any failure throws — nothing is granted yet.
941
+ * Parse the SID string, create the Low integrity SID the grants label with
942
+ * and the world SID their ambient-delete deny names, and open the binding
943
+ * table (lazily, once per server). Fail-closed: any failure throws — nothing
944
+ * is granted yet.
772
945
  * @param writeSid - the workspace (`S-1-4-x-y`) or temp (`S-1-4-x-y-1`) capability SID string.
773
946
  * @param api - optional already-resolved bindings (tests).
774
947
  * @returns the ready grant (no ACEs yet).
@@ -779,31 +952,43 @@ var AclWriteGrant = class AclWriteGrant {
779
952
  if (bindings.convertStringSidToSidW(writeSid, sidSlot) === 0) throwLastError$1(bindings, "ConvertStringSidToSidW", writeSid);
780
953
  const sidPtr = decodePtr(sidSlot);
781
954
  if (sidPtr === null) throwLastError$1(bindings, "ConvertStringSidToSidW", `null SID for ${writeSid}`);
782
- return new AclWriteGrant(bindings, sidPtr, writeSid);
955
+ try {
956
+ const lowLabelSidPtr = makeWellKnownSid(bindings, 66);
957
+ try {
958
+ return new AclWriteGrant(bindings, sidPtr, lowLabelSidPtr, makeWellKnownSid(bindings, 1), writeSid);
959
+ } catch (error) {
960
+ bindings.localFree(lowLabelSidPtr);
961
+ throw error;
962
+ }
963
+ } catch (error) {
964
+ bindings.localFree(sidPtr);
965
+ throw error;
966
+ }
783
967
  }
784
968
  /**
785
- * Grant the write ACE on one directory (idempotent: an already-standing
786
- * exact ACE skips the eager full-tree re-propagation — see
787
- * {@link grantWrite}) and record the path for {@link dispose} unless it is
788
- * standing. The path is recorded BEFORE the grant: a post-apply throw (a
789
- * LocalFree failure after SetNamedSecurityInfoW succeeded) must still
790
- * revoke it, and revoking an ungranted path is a no-op merge. Callers
791
- * treat a throw as a failed materialization and dispose the instance to
792
- * revoke the paths granted so far.
793
- * @param path - the directory whose DACL gains the grant.
794
- * @param standing - the ACE outlives this grant (the workspace reuse
969
+ * Grant the write ACE, the ambient-delete deny, and the Low mandatory label
970
+ * on one directory (idempotent: an already-standing exact ACE, deny, and
971
+ * label skip the eager full-tree re-propagation — see {@link grantWrite})
972
+ * and record the path for {@link dispose} unless it is standing. The path is
973
+ * recorded BEFORE the grant: a post-apply throw (a LocalFree failure after
974
+ * SetNamedSecurityInfoW succeeded) must still revoke it, and revoking an
975
+ * ungranted path is a no-op merge. Callers treat a throw as a failed
976
+ * materialization and dispose the instance to revoke the paths granted so
977
+ * far.
978
+ * @param path - the directory whose DACL and label gain the grant.
979
+ * @param standing - the edits outlive this grant (the workspace reuse
795
980
  * cache; dispose() skips revoking it). Default false (revoked on
796
981
  * dispose — the temp-directory lifecycle).
797
982
  */
798
983
  add(path, standing = false) {
799
984
  (standing ? this.standingPaths : this.revocablePaths).push(path);
800
- grantWrite(this.api, path, this.sidPtr);
985
+ grantWrite(this.api, path, this.sidPtr, this.lowLabelSidPtr, this.worldSidPtr);
801
986
  }
802
987
  /** Every directory currently carrying the grant, in grant order. */
803
988
  get paths() {
804
989
  return [...this.standingPaths, ...this.revocablePaths];
805
990
  }
806
- /** Revoke every revocable grant (standing ACEs stay) and free the SID; reports every cleanup failure. */
991
+ /** Revoke every revocable grant (standing security descriptor edits stay) and free the SIDs; reports every cleanup failure. */
807
992
  dispose() {
808
993
  const failures = [];
809
994
  for (const path of this.revocablePaths) try {
@@ -811,8 +996,12 @@ var AclWriteGrant = class AclWriteGrant {
811
996
  } catch (error) {
812
997
  failures.push(error);
813
998
  }
814
- try {
815
- if (!isNullPtr$1(this.api.localFree(this.sidPtr))) throwLastError$1(this.api, "LocalFree", "write SID");
999
+ for (const [label, sidPtr] of [
1000
+ ["write SID", this.sidPtr],
1001
+ ["Low label SID", this.lowLabelSidPtr],
1002
+ ["world SID", this.worldSidPtr]
1003
+ ]) try {
1004
+ if (!isNullPtr$1(this.api.localFree(sidPtr))) throwLastError$1(this.api, "LocalFree", label);
816
1005
  } catch (error) {
817
1006
  failures.push(error);
818
1007
  }
@@ -868,6 +1057,88 @@ function tempWriteSid(tempDir) {
868
1057
  return `S-1-4-${digest.readUInt32LE(0) % (2 ** 30 - 1) + 1}-${digest.readUInt32LE(4) % (2 ** 30 - 1) + 1}-1`;
869
1058
  }
870
1059
  //#endregion
1060
+ //#region lib/types/acl-skill.js
1061
+ /**
1062
+ * Registers the bundled Windows sandbox ACL diagnosis skill.
1063
+ *
1064
+ * The provider owns a private filesystem copy of its resources so external
1065
+ * PowerShell can execute them even when the package lives inside ASAR or SEA.
1066
+ * Disposing the registration removes both the provider and its resource copy.
1067
+ *
1068
+ * @module @deepseek-ai/dsh-sandbox-windows-acl
1069
+ */
1070
+ /** Bundled skill that diagnoses Windows sandbox ACL failures. */
1071
+ const ACL_DIAGNOSIS_SKILL = "diagnose-windows-sandbox-acl";
1072
+ /** Provider name this module registers the skill under. */
1073
+ const PROVIDER = "dsh-windows-acl";
1074
+ function parseSkill(raw, path) {
1075
+ const frontmatter = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(raw);
1076
+ if (frontmatter?.[1] === void 0) throw new Error(`dsh-sandbox-windows-acl: ${path} has no YAML frontmatter`);
1077
+ const metadata = parse(frontmatter[1]);
1078
+ const description = typeof metadata === "object" && metadata !== null && "description" in metadata ? metadata.description : void 0;
1079
+ if (typeof description !== "string" || description.length === 0) throw new Error(`dsh-sandbox-windows-acl: ${path} has no description`);
1080
+ return {
1081
+ description,
1082
+ content: raw.slice(frontmatter[0].length).trim()
1083
+ };
1084
+ }
1085
+ /**
1086
+ * Register the bundled diagnosis skill with a private resource directory owned by this fiber.
1087
+ * Missing or invalid packaged assets fail registration; disposal removes the directory.
1088
+ * @param ctx - Context carrying the skill registry.
1089
+ */
1090
+ function registerAclDiagnosisSkill(ctx) {
1091
+ const packaged = fileURLToPath(new URL(`../assets/${ACL_DIAGNOSIS_SKILL}/`, import.meta.url));
1092
+ ctx.effect(function* () {
1093
+ const directory = mkdtempSync(join(tmpdir(), "dsh-acl-skill-"));
1094
+ yield async () => {
1095
+ await rm(directory, {
1096
+ recursive: true,
1097
+ force: true
1098
+ });
1099
+ };
1100
+ mkdirSync(join(directory, "scripts"));
1101
+ for (const path of ["SKILL.md", "scripts/diagnose-windows-sandbox-acl.ps1"]) writeFileSync(join(directory, path), readFileSync(join(packaged, path)), {
1102
+ flag: "wx",
1103
+ mode: 384
1104
+ });
1105
+ const locator = join(directory, "SKILL.md");
1106
+ const { description } = parseSkill(readFileSync(locator, "utf8"), locator);
1107
+ const candidate = {
1108
+ name: ACL_DIAGNOSIS_SKILL,
1109
+ description,
1110
+ invocation: {
1111
+ modelInvocable: true,
1112
+ userInvocable: true
1113
+ },
1114
+ provider: PROVIDER,
1115
+ source: "bundled",
1116
+ rank: BUNDLED_SKILL_RANK,
1117
+ resourceBase: {
1118
+ kind: "directory",
1119
+ path: directory
1120
+ },
1121
+ locator
1122
+ };
1123
+ const provider = {
1124
+ name: PROVIDER,
1125
+ list: () => Promise.resolve([candidate]),
1126
+ async get(entry, options) {
1127
+ const { rank: _rank, locator: entryPath, ...summary } = entry;
1128
+ const raw = await readFile(entryPath, {
1129
+ encoding: "utf8",
1130
+ signal: options.signal
1131
+ });
1132
+ return {
1133
+ ...summary,
1134
+ content: parseSkill(raw, entryPath).content
1135
+ };
1136
+ }
1137
+ };
1138
+ yield ctx.skills.registerProvider(() => provider);
1139
+ }, "Windows ACL diagnosis skill resources");
1140
+ }
1141
+ //#endregion
871
1142
  //#region lib/types/index.js
872
1143
  /**
873
1144
  * Windows ACL write-restriction sandbox backend for the ChatCode CLI
@@ -881,7 +1152,10 @@ function tempWriteSid(tempDir) {
881
1152
  * keep-alive group logon SID + Everyone; Authenticated Users, INTERACTIVE,
882
1153
  * and LOCAL are absent from both lists — see the seam's dual-list contract
883
1154
  * in `packages/sandbox/sandbox-local` and the package README's Modes section
884
- * for the complete boundary). The write SID is the per-WORKSPACE identity
1155
+ * for the complete boundary). The intersection covers only the object's own
1156
+ * access check, so the token is also lowered to Low integrity and every
1157
+ * granted directory carries a Low no-write-up label and the ambient-delete
1158
+ * deny the `acl` module documents. The write SID is the per-WORKSPACE identity
885
1159
  * ({@link workspaceWriteSid}): deterministic from the canonical workspace
886
1160
  * path, so the workspace-root ACE materializes once per workspace per
887
1161
  * machine and every later provision hits the exact-ACE skip — the
@@ -996,23 +1270,25 @@ var AclSandbox = class {
996
1270
  assertPrivateTempDisjoint(this.writableDirs, tempDir);
997
1271
  }
998
1272
  this.tempDirResolved = tempDir;
1273
+ const lowLabelSid = makeWellKnownSid(api, 66);
1274
+ const worldSid = makeWellKnownSid(api, 1);
1275
+ this.sidAllocations.push(lowLabelSid, worldSid);
999
1276
  if (this.manageDacls) {
1000
1277
  if (this.writeSidPtr !== void 0) {
1001
- for (const path of this.writableDirs) grantWrite(api, path, this.writeSidPtr);
1278
+ for (const path of this.writableDirs) grantWrite(api, path, this.writeSidPtr, lowLabelSid, worldSid);
1002
1279
  if (tempDir !== null && this.tempWriteSidPtr !== void 0) {
1003
1280
  this.grantedPaths.push({
1004
1281
  path: tempDir,
1005
1282
  sidPtr: this.tempWriteSidPtr
1006
1283
  });
1007
- grantWrite(api, tempDir, this.tempWriteSidPtr);
1284
+ grantWrite(api, tempDir, this.tempWriteSidPtr, lowLabelSid, worldSid);
1008
1285
  }
1009
1286
  }
1010
1287
  }
1011
1288
  const logonSid = findLogonSid(api, currentToken);
1012
1289
  this.sidAllocations.push(logonSid);
1013
- const worldSid = makeWellKnownSid(api, 1);
1014
- this.sidAllocations.push(worldSid);
1015
1290
  restrictedToken = createRestrictedToken(api, currentToken, logonSid, [this.writeSidPtr, this.tempWriteSidPtr].filter((sid) => sid !== void 0), { world: worldSid }, this.mode);
1291
+ restrictTokenIntegrity(api, restrictedToken, lowLabelSid);
1016
1292
  this.token = restrictedToken;
1017
1293
  setTokenDefaultDaclGrant(api, restrictedToken, this.tempWriteSidPtr ?? this.writeSidPtr ?? worldSid);
1018
1294
  if (api.closeHandle(currentToken) === 0) throwLastError$1(api, "CloseHandle", "current process token");
@@ -1132,4 +1408,4 @@ var AclSandbox = class {
1132
1408
  }
1133
1409
  };
1134
1410
  //#endregion
1135
- export { assertTempRootOutsideWorkspace as a, AclWriteGrant as i, tempWriteSid as n, win32 as o, workspaceWriteSid as r, AclSandbox as t };
1411
+ export { workspaceWriteSid as a, win32 as c, tempWriteSid as i, ACL_DIAGNOSIS_SKILL as n, AclWriteGrant as o, registerAclDiagnosisSkill as r, assertTempRootOutsideWorkspace as s, AclSandbox as t };