@chatcode/chatcode-cli 3.0.5 → 3.0.6-rc.2
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.
- package/README.i18n.yaml +6 -6
- package/README.md +7 -0
- package/README.zh.md +7 -0
- package/lib/bin.js +19 -5
- package/lib/{command-errors-CnbcOM1a.js → command-errors-vCFKCJFq.js} +12 -12
- package/lib/{command-trees-CU7BxVJo.js → command-trees-N2_LR4f-.js} +2 -2
- package/lib/{component-identity-kZK1_hFy.js → component-identity-CaV_MmmE.js} +3 -3
- package/lib/desktop-history-B0iUekXf.js +72 -0
- package/lib/desktop-history-DvgkONgj.js +2 -0
- package/lib/{dump-config-D8kXfdTs.js → dump-config-CgIYHBp2.js} +1 -1
- package/lib/dump-config-D6TruNva.js +2 -0
- package/lib/{dump-config-schema-CtZbroi6.js → dump-config-schema-GiAtkJwx.js} +2 -2
- package/lib/{extension-events-hLxwPvpg.js → extension-events-B5qKP0-X.js} +20 -20
- package/lib/{host-access-kT-u85k_.js → host-access-BRXW3V8i.js} +1 -1
- package/lib/{keymap-DS1M8sDo.js → keymap-BYjklwli.js} +2 -2
- package/lib/{plugin-CYw-MBRn.js → plugin-BACkrsVG.js} +1 -1
- package/lib/{plugin-d65VulBk.js → plugin-VYAv2o0K.js} +498 -348
- package/lib/{profile-boot-CffsubnV.js → profile-boot-c5YKtUIb.js} +17 -4
- package/lib/profile-boot.js +1 -1
- package/lib/{scenes-DG6T8t-A.js → scenes-B-iDMpgW.js} +3 -3
- package/lib/{settings-sections-2SuE0biI.js → settings-sections-CYCrZKUk.js} +3 -3
- package/lib/{statusBarSettings-B2MEAwnI.js → statusBarSettings-Cu-b_o4Q.js} +3 -3
- package/lib/{themes-DUO7kGW-.js → themes-DC9GpV6q.js} +12 -12
- package/lib/tui-compat-command-trees.js +1 -1
- package/lib/tui-compat-extensions.js +3 -3
- package/lib/tui-compat-plugin-host.js +5 -5
- package/lib/tui-compat-scenes.js +1 -1
- package/lib/tui-compat-settings-sections.js +1 -1
- package/lib/tui-compat-working-activity.js +1 -1
- package/lib/tui-compat-workspaces.js +1 -1
- package/lib/tui-compat.js +6 -6
- package/lib/types/args.d.ts +8 -1
- package/lib/types/desktop-history.d.ts +31 -0
- package/lib/types/installed-bin.d.ts +9 -0
- package/lib/{workspaces-CLOkL_yE.js → workspaces-BchdRzlw.js} +2 -2
- package/package.json +26 -26
- package/runtime/manifest.json +3 -2
- package/runtime/node_modules/@chatcode/runtime-client/README.md +225 -0
- package/runtime/node_modules/@chatcode/runtime-client/desktop-history-guard.mjs +65 -0
- package/runtime/node_modules/@chatcode/runtime-client/desktop-history.mjs +278 -0
- package/runtime/node_modules/@chatcode/runtime-client/desktop-permission-gate.mjs +28 -0
- package/runtime/node_modules/@chatcode/runtime-client/execution.mjs +593 -0
- package/runtime/node_modules/@chatcode/runtime-client/index.d.ts +449 -0
- package/runtime/node_modules/@chatcode/runtime-client/model-preferences.mjs +57 -0
- package/runtime/node_modules/@chatcode/runtime-client/package.json +53 -0
- package/runtime/node_modules/@chatcode/runtime-client/runtime-connector.mjs +736 -0
- package/runtime/node_modules/@chatcode/runtime-client/session-activity.mjs +121 -0
- package/runtime/node_modules/@chatcode/runtime-client/session-browser.mjs +122 -0
- package/runtime/node_modules/@chatcode/runtime-client/stdio-bridge.mjs +103 -0
- package/runtime/node_modules/@chatcode/runtime-client/user-questions.mjs +108 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/journal.d.ts +69 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/journal.d.ts.map +1 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/patch.d.ts +68 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/patch.d.ts.map +1 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/resolve.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/resolve.d.ts.map +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/index.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/model-selection.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/model-selection.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/runtime-types.d.ts +12 -3
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +69 -17
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/invariant.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/types/agent.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/types/inbox.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/access.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/access.js +164 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +460 -79
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +636 -44
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +483 -55
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.d.ts +19 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +377 -40
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +24 -4
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +97 -15
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.d.ts +11 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +172 -18
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.js +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.js +80 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.d.ts +104 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +294 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.d.ts +105 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.js +297 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history.js +4 -4
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +88 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +230 -6
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/login-token-store.d.ts +64 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/login-token-store.js +79 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.d.ts +45 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.js +289 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.js +112 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +93 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.d.ts +25 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.js +139 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.js +101 -0
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/bundle-platform.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/startup-diagnostics.d.ts +38 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/client/socket.d.ts +50 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/connect-protocol.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/peer.d.ts +36 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/de.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/es.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/fr.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/ja.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/pt.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/ru.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/assets.d.ts +51 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/client/notify.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/client/release-change.d.ts +44 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/types/client/CreatePluginMenuItem.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/types/client/analytics.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/types/client/ApprovalCard.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/types/client/ApprovalWarning.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/PixelWhale.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/artwork.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/code-fill.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/renderer.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/ChatFlow.d.ts +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/ReasoningContent.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/RunningStatus.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/RunningWhaleTail.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/UserContent.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/flow-motion.d.ts +110 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/text-interaction.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/text-selection.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/contract/group-tree.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/conversation-nodes/group-tree-segments.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/file-path.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/reasoning-text.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/types/client/option-groups.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/text-interaction.d.ts +31 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/user-text.d.ts +60 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/interaction-registry.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/user-text-document.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/user-text-registry.d.ts +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/draft.d.ts +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/CommandChip.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/QuoteNode.d.ts +61 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/command-chip-node.d.ts +87 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/command-chip-selection.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/prompt.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/submission-analytics.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/UserText.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/session-reference-rule.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/whitespace-rules.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/view-pins.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/types/client/GoalCommandReference.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/types/client/user-text-rules.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/provider-order.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/context-menus.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/open-toast.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/outcome.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/session-open-with.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/BundleDetailSection.d.ts +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/PluginRefreshToast.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/detail-store.d.ts +76 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/header-scroll.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/sanitize-install-input.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/tab-ledger.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/versions.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/AnimatedRows.module.css +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CommandText.module.css +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DetailDocument.module.css +67 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/InlineEditor.module.css +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/MenuGroup.module.css +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/QuotePreview.module.css +101 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/RowDragPreview.module.css +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/UserMessageBubble.module.css +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ZoomControls.module.css +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/AnimatedRows.d.ts +49 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CommandText.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DetailDocument.d.ts +78 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DraggableImage.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/HoverCardGroup.d.ts +25 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/InlineEditor.d.ts +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuGroup.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuRow.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/QuotePreview.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SubmenuPanel.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/UserMessageBubble.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ZoomControls.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/document-zoom.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/file-drag-actions.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/artwork.d.ts +426 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/image-drag.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/copy-tex.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/quote-text.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/windows-path-destinations.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/menu-submenu-position.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/tooltip-placement.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/use-clipboard-copy.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useMenuSubmenu.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useRowDragPreview.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/types/client/FileReference.d.ts +29 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/types/client/user-text-rules.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/NewSessionLimit.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/RuleSelectRow.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/ScheduleEmptyIllustration.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/TaskEditorFields.d.ts +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/TaskRuleControls.d.ts +50 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/clear-ended.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/editor-store.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/editor-timing.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/task-record.d.ts +30 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/account-avatar.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/browser-login.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/notice-transition.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/onboarding-settings.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/DesktopChannelRow.d.ts +31 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/HostReleasePrompt.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/desktop-channel-source.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/ApiKeyInput.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/ModelReasoningEfforts.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/useModelRows.d.ts +41 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/PanelIcon.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/panel-pins.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/scroll-handoff.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.frontmatter-fields.js +5768 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/PreviewFrame.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/image/pan.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/markdown/frontmatter-fields.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/markdown/frontmatter.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/FileNavigator.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/FileTree.d.ts +114 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/NavigatorToggle.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/navigator-layout.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/workspace-tree.d.ts +51 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/shell/TabMenuContent.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/shell/flash.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/tabs/guide/GuideMoreIcon.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/tabs/guide/guide-pins.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/types/client/SkillReference.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/types/client/user-text-rules.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/types/client/slots.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/FontFamilyRow.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/FontSettingsGroup.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/icon-sprite.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/components/ExitCodeBadge.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/components/QuestionToolRow.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/file-menu.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/models/recorded-path.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/types/client/watch-tool-result.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/types/types.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/types/client/QuestionReplyView.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/types/client/question-reply.d.ts +74 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/contract/toast.d.ts +67 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/path-suffix.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/WorkspaceDialogs.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/SessionMenu.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/context-menus.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/toast/Toast.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/toast/register.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.d.ts +46 -0
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.js +39 -0
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +11 -8
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/index.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +10 -10
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/types/locales.d.ts +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/MicrophonePicker.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/failure-text.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/microphone-device.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-headless/lib/{json-stream-Bh4BGGk9.js → json-stream-Dc3g2Bl1.js} +11 -7
- package/runtime/node_modules/@deepseek-ai/dsh-hmr/lib/types/module-files.d.ts +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-hmr/lib/types/package-manifest.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/index.js +241 -64
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +26 -11
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.remote-client.js +3 -3
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.js +5 -1
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.d.ts +30 -6
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +109 -8
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/message.d.ts +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/prompt-protocol-options.d.ts +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/prompt-protocol-options.js +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/types.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +19 -7
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/config.d.ts +3 -3
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/credential.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listed-catalog.d.ts +56 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing-cache.d.ts +71 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing-config.d.ts +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing.d.ts +91 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocol-adapter.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/types/config.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/types/config.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +149 -28
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/adapter.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/prompt-options.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/provider-data.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/provider-data.generated.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/types.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/credentials.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/deadline.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/diagnostic.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/generation.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/probe.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/status.d.ts +87 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/templates.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/types.d.ts +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +4 -4
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/bundle-detail.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/bundle-detail.js +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.js +72 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/git-transport.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/git-transport.js +65 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.js +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/versions.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/versions.js +61 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/config.d.ts +38 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/configuration.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/async-function.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/index.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/repl.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/types.d.ts +68 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/vm-script-await.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/vm-script.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/execution.d.ts +66 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/evaluation-ended.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/module-hooks.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/vm-modules.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/persistent-process-entry.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/persistent-process.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/policy-processes.d.ts +30 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/rpc.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/worker.d.ts +66 -0
- package/runtime/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +215 -9
- package/runtime/node_modules/@deepseek-ai/dsh-sandbox/lib/types/locales.d.ts +41 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types/acl-skill.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/{types-Ci-q7_aQ.js → types-DwkEVVWZ.js} +357 -81
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-activity.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-content.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-input.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/user-questions.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/index.js +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/request-header.js +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/types.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/CopyToast.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/copy-controller.d.ts +76 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/markdown.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +197 -9
- package/runtime/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.d.ts +112 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.js +112 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.d.ts +232 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +1250 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.d.ts +56 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.js +96 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.d.ts +49 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.js +130 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/types/linux-scope-selector.d.ts +60 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +215 -9
- package/runtime/node_modules/@deepseek-ai/dsh-token-meter/lib/types/measurement-projection.d.ts +74 -0
- package/runtime/node_modules/@deepseek-ai/dsh-token-meter/lib/types/measurement-projection.js +94 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-ask-user/lib/types/timed.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +31 -1
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch-output.d.ts +140 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch-presentation.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/mutation-result.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/execute.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/index.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/plan.d.ts +52 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/preflight.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/types.d.ts +106 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent/lib/types/preset-selection.d.ts +36 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/wait-agent.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/wait-agent.js +104 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/batch.d.ts +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/batch.js +246 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/contracts.d.ts +376 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/contracts.js +51 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/events.d.ts +58 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/events.js +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/executor.d.ts +90 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/executor.js +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/pipeline.d.ts +154 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/pipeline.js +701 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/principal.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/principal.js +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-access.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-access.js +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.js +143 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/projection.d.ts +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/projection.js +298 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/timed-wait.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/timed-wait.js +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/cron.d.ts +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/duration.d.ts +61 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/instant.d.ts +145 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/recurrence.d.ts +38 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/rrule.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-values/lib/types/partial-json.d.ts +152 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-app/lib/types/public-url.d.ts +16 -0
- package/lib/dump-config-DuCc-QB7.js +0 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.d.ts +0 -26
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.js +0 -61
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/watch-config.d.ts +0 -13
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/types/ImageLightbox.d.ts +0 -27
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/queue.d.ts +0 -9
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/queue-store.d.ts +0 -20
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/ProducedFiles.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/icons.d.ts +0 -8
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/OnboardingSurface.module.css +0 -29
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/OnboardingSurface.d.ts +0 -11
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/settings-contract.d.ts +0 -86
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/settings-scope.d.ts +0 -141
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/desktop-update-bridge.d.ts +0 -23
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/AgentLoopCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/BashCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/ConfigurablePluginsTab.d.ts +0 -19
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/PluginCard.d.ts +0 -42
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/PluginConfigForm.d.ts +0 -34
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentLimitsFields.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentModelSelectionCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentModelSelectionFields.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/WebSearchCard.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/agent-loop-card-controller.d.ts +0 -43
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/bash-card-controller.d.ts +0 -45
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/card-form.d.ts +0 -171
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/fields.d.ts +0 -69
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/slot-contract.d.ts +0 -31
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-card-controller.d.ts +0 -32
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-limits-card-controller.d.ts +0 -33
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-model-selection-card-controller.d.ts +0 -129
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/tab-store.d.ts +0 -65
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/web-search-card-controller.d.ts +0 -93
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/code/languages.d.ts +0 -9
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/icons.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/pdf/PdfBody.d.ts +0 -24
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/types/client/TerminalBody.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/types/client/subagent-lineage.d.ts +0 -21
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/subagent-lineage.d.ts +0 -21
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/defaults.d.ts +0 -24
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/file-id.d.ts +0 -19
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/file-store.d.ts +0 -86
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/files-api.d.ts +0 -111
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/image-tokens.d.ts +0 -34
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/messages-api.d.ts +0 -10
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/model-info.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/models.d.ts +0 -4
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-extensions.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-files.d.ts +0 -49
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-pricing.d.ts +0 -60
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/types.d.ts +0 -119
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/upload-index.d.ts +0 -68
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/adapter.d.ts +0 -45
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/serialize.d.ts +0 -78
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/sse.d.ts +0 -24
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/translate.d.ts +0 -37
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/types.d.ts +0 -178
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/adapter.d.ts +0 -47
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/images.d.ts +0 -35
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/replay.d.ts +0 -27
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/serialize.d.ts +0 -18
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/sse.d.ts +0 -8
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/translate.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/transport.d.ts +0 -15
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/types.d.ts +0 -62
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.d.ts +0 -19
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.js +0 -30
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.d.ts +0 -35
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.js +0 -68
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.d.ts +0 -10
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.js +0 -22
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/invariant.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/invariant.js +0 -41
- package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-DGV26RBf.js +0 -1525
- package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-UEJ3Ntqn.js +0 -1511
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/fiber-state.d.ts +0 -28
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/fiber-state.js +0 -25
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/inspect.d.ts +0 -93
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/inspect.js +0 -303
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/prompt.d.ts +0 -3
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/prompt.js +0 -5
|
@@ -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(
|
|
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
|
|
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
|
|
367
|
-
* @returns the current explicit DACL (null when the directory carries none)
|
|
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
|
|
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,
|
|
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
|
-
*
|
|
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
|
|
386
|
-
*
|
|
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
|
|
389
|
-
* @param
|
|
390
|
-
* @param oldAcl - the current explicit DACL (from {@link
|
|
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,
|
|
470
|
+
function mergeAndApply(api, path, entries, oldAcl, labelEdit, descriptor, label) {
|
|
395
471
|
const newAclSlot = allocPtrSlot();
|
|
396
|
-
const mergeResult = api.setEntriesInAclW(
|
|
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
|
|
416
|
-
* capability SID
|
|
417
|
-
*
|
|
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 &&
|
|
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`,
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
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
|
|
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 } =
|
|
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
|
-
|
|
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).
|
|
472
|
-
*
|
|
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
|
|
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 } =
|
|
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,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
751
|
-
*
|
|
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
|
|
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
|
|
771
|
-
*
|
|
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
|
-
|
|
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
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
* revoke it, and revoking an
|
|
791
|
-
* treat a throw as a failed
|
|
792
|
-
* revoke the paths granted so
|
|
793
|
-
*
|
|
794
|
-
* @param
|
|
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
|
|
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
|
-
|
|
815
|
-
|
|
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
|
|
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 {
|
|
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 };
|