@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.
- 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/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/{plugin-CYw-MBRn.js → plugin-BACkrsVG.js} +1 -1
- package/lib/{profile-boot-CffsubnV.js → profile-boot-c5YKtUIb.js} +17 -4
- package/lib/profile-boot.js +1 -1
- package/lib/tui-compat.js +1 -1
- 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/package.json +25 -25
- 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/runtime/node_modules/@deepseek-ai/node-addon-system/lib/.tsbuildinfo +1 -1
- 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
- package/lib/{plugin-d65VulBk.js → plugin-BccFcAte.js} +1 -1
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
import { scopeTarget } from '@deepseek-ai/dsh-scope';
|
|
2
|
+
import { HarnessError } from '@deepseek-ai/dsh-llm';
|
|
3
|
+
import { assertNever, deepFreeze, snapshotJsonValue } from '@deepseek-ai/dsh-util-values';
|
|
4
|
+
import { TOOL_ABORTED, TOOL_ABORTED_BEFORE_DISPATCH, ToolNotFoundError, ToolOutputError } from "./contracts.js";
|
|
5
|
+
import { validateJsonSchemaValue } from "./json-schema.js";
|
|
6
|
+
/**
|
|
7
|
+
* Shared invocation stages for batch and program schedulers. Schedulers order
|
|
8
|
+
* prepare and complete calls while dispatch may overlap. Use executeToolBatch
|
|
9
|
+
* for complete calls, including a single-call batch.
|
|
10
|
+
*/
|
|
11
|
+
export class ToolExecutionPipeline {
|
|
12
|
+
ctx;
|
|
13
|
+
source;
|
|
14
|
+
tools;
|
|
15
|
+
constructor(ctx, source = {}) {
|
|
16
|
+
this.ctx = ctx;
|
|
17
|
+
this.source = source;
|
|
18
|
+
// Accepted calls retain their event subject while the service is withdrawn during shutdown.
|
|
19
|
+
this.tools = ctx.tools;
|
|
20
|
+
}
|
|
21
|
+
get(name, scope, toolSet) {
|
|
22
|
+
return this.source.get === undefined
|
|
23
|
+
? this.tools.executable(name, scope, toolSet)
|
|
24
|
+
: this.source.get(name, scope, toolSet);
|
|
25
|
+
}
|
|
26
|
+
resolveExecution(name, scope, nested, toolSet) {
|
|
27
|
+
const tool = this.get(name, scope, toolSet);
|
|
28
|
+
return tool !== undefined && this.source.reject?.(name, nested) === undefined ? tool : undefined;
|
|
29
|
+
}
|
|
30
|
+
/** Context deferred by a running tool body, keyed by its scheduler-owned execution. */
|
|
31
|
+
deferredContexts = new WeakMap();
|
|
32
|
+
/** Executions whose tool body declared the current turn complete. */
|
|
33
|
+
concludingExecutions = new WeakSet();
|
|
34
|
+
/** Original caller cancellation, kept outside the wrapper-mutable execution object. */
|
|
35
|
+
cancellationStates = new WeakMap();
|
|
36
|
+
/** Definition-owned final content transform snapshotted before policy begins. */
|
|
37
|
+
contentFinalizers = new WeakMap();
|
|
38
|
+
/** Execution-prepared content installed before post-execute policy. */
|
|
39
|
+
contentProjectors = new WeakMap();
|
|
40
|
+
/**
|
|
41
|
+
* Classify a pending call through the caller's visible tool definition. Only
|
|
42
|
+
* an exact `true` is parallel; unknown, hidden, undeclared, invalid, or
|
|
43
|
+
* throwing classifiers are exclusive.
|
|
44
|
+
* @param exec - call name, parsed arguments, and optional agent scope.
|
|
45
|
+
* @returns the fail-closed scheduling mode.
|
|
46
|
+
*/
|
|
47
|
+
executionMode(exec) {
|
|
48
|
+
const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined, exec.toolSet);
|
|
49
|
+
if (!tool?.isConcurrencySafe)
|
|
50
|
+
return { kind: 'exclusive' };
|
|
51
|
+
try {
|
|
52
|
+
const concurrencySafe = tool.isConcurrencySafe(exec.arguments);
|
|
53
|
+
return concurrencySafe === true ? { kind: 'parallel' } : { kind: 'exclusive' };
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return { kind: 'exclusive' };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
createExecution(exec) {
|
|
60
|
+
const deferredContexts = [];
|
|
61
|
+
const token = createExecutionToken();
|
|
62
|
+
const callId = exec.callId;
|
|
63
|
+
const rootCallId = exec.rootCallId ?? callId;
|
|
64
|
+
const name = exec.name;
|
|
65
|
+
const agent = exec.agent;
|
|
66
|
+
const parent = exec.parent;
|
|
67
|
+
const signal = exec.signal;
|
|
68
|
+
// Executor refusals precede extensible policy; unknown tools retain dispatch-stage handling.
|
|
69
|
+
const visible = this.get(name, agent, exec.toolSet);
|
|
70
|
+
const rejection = visible === undefined ? undefined : this.source.reject?.(name, parent !== undefined);
|
|
71
|
+
const rejected = rejection !== undefined;
|
|
72
|
+
const concludingExecutions = this.concludingExecutions;
|
|
73
|
+
const base = {
|
|
74
|
+
token,
|
|
75
|
+
callId,
|
|
76
|
+
rootCallId,
|
|
77
|
+
name,
|
|
78
|
+
signal,
|
|
79
|
+
...agent !== undefined ? { agent } : {},
|
|
80
|
+
...exec.toolSet !== undefined ? { toolSet: exec.toolSet } : {},
|
|
81
|
+
...parent !== undefined ? { parent } : {},
|
|
82
|
+
...exec.schema !== undefined ? { schema: exec.schema } : {},
|
|
83
|
+
deferContext(context) {
|
|
84
|
+
deferredContexts.push(context);
|
|
85
|
+
},
|
|
86
|
+
concludeTurn() {
|
|
87
|
+
concludingExecutions.add(this);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
// Capture callbacks before argument getters run; rejected calls retain finalization only when aborted.
|
|
91
|
+
const capturedFinalizer = visible?.finalizeContent?.bind(visible);
|
|
92
|
+
const capturedProjector = visible?.projectContent?.bind(visible);
|
|
93
|
+
const finalizerFor = () => rejected && !signal.aborted ? undefined : capturedFinalizer;
|
|
94
|
+
try {
|
|
95
|
+
const detached = snapshotJsonValue(exec.arguments);
|
|
96
|
+
if (detached === undefined) {
|
|
97
|
+
throw new TypeError('tool execution arguments must be losslessly JSON-serializable');
|
|
98
|
+
}
|
|
99
|
+
const execution = { ...base, arguments: deepFreeze(detached) };
|
|
100
|
+
this.deferredContexts.set(execution, deferredContexts);
|
|
101
|
+
this.contentFinalizers.set(execution, finalizerFor());
|
|
102
|
+
if (!rejected)
|
|
103
|
+
this.contentProjectors.set(execution, capturedProjector);
|
|
104
|
+
this.cancellationStates.set(execution, {
|
|
105
|
+
callerSignal: signal,
|
|
106
|
+
bodyInvoked: false,
|
|
107
|
+
});
|
|
108
|
+
if (rejected) {
|
|
109
|
+
// Cancellation takes precedence over an executor refusal.
|
|
110
|
+
if (signal.aborted) {
|
|
111
|
+
return { kind: 'final-result', exec: execution, result: toolAbortedBeforeDispatchResult() };
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
kind: 'final-result',
|
|
115
|
+
exec: execution,
|
|
116
|
+
result: toolErrorResult(rejection),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return { kind: 'ready', exec: execution };
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const execution = { ...base, arguments: undefined };
|
|
123
|
+
this.contentFinalizers.set(execution, finalizerFor());
|
|
124
|
+
return { kind: 'final-result', exec: execution, result: toolErrorResult(error) };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Snapshot input, assign its correlation token, and run ordered pre-execute
|
|
129
|
+
* policy and guards. Cancellation skips a body that has not started.
|
|
130
|
+
* @param input - the caller-supplied execution input.
|
|
131
|
+
* @returns the prepared execution plus the next scheduler stage.
|
|
132
|
+
*/
|
|
133
|
+
async prepare(input) {
|
|
134
|
+
const created = this.createExecution(input);
|
|
135
|
+
if (created.kind !== 'ready')
|
|
136
|
+
return created;
|
|
137
|
+
const exec = created.exec;
|
|
138
|
+
if (this.callerCancelled(exec)) {
|
|
139
|
+
return { kind: 'final-result', exec, result: toolAbortedBeforeDispatchResult() };
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
const carrier = scopeTarget(this.tools, exec.agent);
|
|
143
|
+
const gate = await this.ctx.waterfall(carrier, 'tools/pre-execute', exec, () => Promise.resolve({ kind: 'allow' }));
|
|
144
|
+
const askResolution = gate.kind === 'ask'
|
|
145
|
+
? await this.serviceAsk(exec, gate)
|
|
146
|
+
: { decision: gate, approvalCancelled: false };
|
|
147
|
+
const { decision } = askResolution;
|
|
148
|
+
if (this.callerCancelled(exec) && askResolution.approvalCancelled) {
|
|
149
|
+
return { kind: 'post-result', exec, result: toolAbortedBeforeDispatchResult() };
|
|
150
|
+
}
|
|
151
|
+
if (decision.kind === 'cancel') {
|
|
152
|
+
return { kind: 'post-result', exec, result: toolAbortedBeforeDispatchResult() };
|
|
153
|
+
}
|
|
154
|
+
const denialReason = decision.kind === 'allow' ? this.tools.checkGuards(exec) : decision.reason;
|
|
155
|
+
const denialInfo = decision.kind === 'deny' ? decision.info : undefined;
|
|
156
|
+
if (denialReason !== undefined) {
|
|
157
|
+
return {
|
|
158
|
+
kind: 'post-result',
|
|
159
|
+
exec,
|
|
160
|
+
result: this.materializeFinalResult({
|
|
161
|
+
content: [{ type: 'text', text: `Error: ${denialReason}` }],
|
|
162
|
+
isError: true,
|
|
163
|
+
error: { message: denialReason, ...denialInfo === undefined ? {} : { info: denialInfo } },
|
|
164
|
+
}),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
if (this.callerCancelled(exec)) {
|
|
168
|
+
return { kind: 'post-result', exec, result: toolAbortedBeforeDispatchResult() };
|
|
169
|
+
}
|
|
170
|
+
return { kind: 'dispatch', exec };
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
return { kind: 'final-result', exec, result: toolErrorResult(error) };
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/** Whether the original caller signal is currently aborted. */
|
|
177
|
+
callerCancelled(exec) {
|
|
178
|
+
const state = this.cancellationStates.get(exec);
|
|
179
|
+
/* v8 ignore next -- only registry-minted executions reach the staged scheduler methods */
|
|
180
|
+
if (state === undefined)
|
|
181
|
+
throw new Error('tool registry scheduler invariant violated: missing cancellation state');
|
|
182
|
+
return state.callerSignal.aborted;
|
|
183
|
+
}
|
|
184
|
+
/** Canonical cancellation outcome selected by whether the tool body started. */
|
|
185
|
+
cancellationResult(exec, prior) {
|
|
186
|
+
const state = this.cancellationStates.get(exec);
|
|
187
|
+
/* v8 ignore next -- only registry-minted executions reach the staged scheduler methods */
|
|
188
|
+
if (state === undefined)
|
|
189
|
+
throw new Error('tool registry scheduler invariant violated: missing cancellation state');
|
|
190
|
+
return state.bodyInvoked
|
|
191
|
+
? toolAbortedResult(prior)
|
|
192
|
+
: toolAbortedBeforeDispatchResult(prior);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Dispatch the registered body with the original caller signal fused back
|
|
196
|
+
* into any around-wrapper replacement. Cancellation never abandons the body:
|
|
197
|
+
* a started promise reaches quiescence before its outcome becomes `ABORTED`.
|
|
198
|
+
*/
|
|
199
|
+
async dispatchToolBody(exec) {
|
|
200
|
+
const state = this.cancellationStates.get(exec);
|
|
201
|
+
/* v8 ignore next -- only registry-minted executions reach the staged scheduler methods */
|
|
202
|
+
if (state === undefined)
|
|
203
|
+
throw new Error('tool registry scheduler invariant violated: missing cancellation state');
|
|
204
|
+
const wrapperSignal = exec.signal;
|
|
205
|
+
const fused = fuseToolSignals(state.callerSignal, wrapperSignal);
|
|
206
|
+
const signal = fused.signal;
|
|
207
|
+
if (isAborted(signal)) {
|
|
208
|
+
fused.dispose();
|
|
209
|
+
return toolAbortedBeforeDispatchResult();
|
|
210
|
+
}
|
|
211
|
+
exec.signal = signal;
|
|
212
|
+
try {
|
|
213
|
+
const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined, exec.toolSet);
|
|
214
|
+
if (!tool)
|
|
215
|
+
throw new ToolNotFoundError(exec.name);
|
|
216
|
+
state.bodyInvoked = true;
|
|
217
|
+
const returned = await tool.execute(exec.arguments, exec);
|
|
218
|
+
const result = this.createSuccessResult(exec, tool, returned);
|
|
219
|
+
return isAborted(signal)
|
|
220
|
+
? toolAbortedResult(result)
|
|
221
|
+
: result;
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
return toolErrorResult(error);
|
|
225
|
+
}
|
|
226
|
+
finally {
|
|
227
|
+
fused.dispose();
|
|
228
|
+
exec.signal = wrapperSignal;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Run around-dispatch and the tool body. Tool and unknown-tool failures still
|
|
233
|
+
* receive post-execute; pipeline failures are already final. Started bodies
|
|
234
|
+
* drain on cancellation before a successful outcome becomes `ABORTED`.
|
|
235
|
+
* @param exec - the execution returned by this pipeline's prepare stage.
|
|
236
|
+
* @returns whether the result still needs post-execute.
|
|
237
|
+
*/
|
|
238
|
+
async dispatch(exec) {
|
|
239
|
+
try {
|
|
240
|
+
const mutableExec = exec;
|
|
241
|
+
const carrier = scopeTarget(this.tools, exec.agent);
|
|
242
|
+
const result = await this.ctx.waterfall(carrier, 'tools/execute', mutableExec, () => this.dispatchToolBody(mutableExec));
|
|
243
|
+
const normalized = this.normalizeDispatchResult(exec, result);
|
|
244
|
+
const deferredContexts = this.deferredContexts.get(exec);
|
|
245
|
+
/* v8 ignore next -- dispatch only receives executions minted by this registry's prepare stage */
|
|
246
|
+
if (deferredContexts === undefined)
|
|
247
|
+
throw new Error('tool registry scheduler invariant violated: unprepared execution');
|
|
248
|
+
const resultWithDeferredContexts = deferredContexts.length === 0
|
|
249
|
+
? normalized
|
|
250
|
+
: this.markCanonical(exec, {
|
|
251
|
+
...normalized,
|
|
252
|
+
additionalContexts: [
|
|
253
|
+
...deferredContexts,
|
|
254
|
+
...normalized.additionalContexts ?? [],
|
|
255
|
+
],
|
|
256
|
+
});
|
|
257
|
+
return {
|
|
258
|
+
kind: 'post-result',
|
|
259
|
+
result: this.callerCancelled(exec) && !resultWithDeferredContexts.isError
|
|
260
|
+
? this.cancellationResult(exec, resultWithDeferredContexts)
|
|
261
|
+
: resultWithDeferredContexts,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
return { kind: 'final-result', result: toolErrorResult(error) };
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Run post-execute when required, apply definition-owned content finalization,
|
|
270
|
+
* and publish the lossless, frozen result. Policy and finalization failures
|
|
271
|
+
* become error results. Cancellation replaces a successful outcome before
|
|
272
|
+
* final materialization; tool-owned errors remain intact.
|
|
273
|
+
* @param exec - the execution returned by this pipeline's prepare stage.
|
|
274
|
+
* @param outcome - the preparation or dispatch result awaiting completion.
|
|
275
|
+
* @returns the same materialized result delivered to final observers.
|
|
276
|
+
*/
|
|
277
|
+
async complete(exec, outcome) {
|
|
278
|
+
switch (outcome.kind) {
|
|
279
|
+
case 'final-result':
|
|
280
|
+
return this.finish(exec, outcome.result);
|
|
281
|
+
case 'post-result':
|
|
282
|
+
break;
|
|
283
|
+
/* v8 ignore next -- closed-union exhaustiveness guard */
|
|
284
|
+
default:
|
|
285
|
+
return assertNever(outcome, 'scheduled tool outcome');
|
|
286
|
+
}
|
|
287
|
+
const { result } = outcome;
|
|
288
|
+
try {
|
|
289
|
+
const project = this.contentProjectors.get(exec);
|
|
290
|
+
this.contentProjectors.delete(exec);
|
|
291
|
+
const content = project?.(exec, result);
|
|
292
|
+
const projected = content === undefined
|
|
293
|
+
? result
|
|
294
|
+
: this.markCanonical(exec, this.materializeFinalResult({ ...result, content }));
|
|
295
|
+
const postResult = await this.postExecute(exec, projected);
|
|
296
|
+
return this.finish(exec, this.callerCancelled(exec) && !postResult.isError
|
|
297
|
+
? this.cancellationResult(exec, postResult)
|
|
298
|
+
: postResult);
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
return this.finish(exec, toolErrorResult(error));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Materialize the candidate, apply definition-owned content finalization,
|
|
306
|
+
* then materialize and notify the authoritative result.
|
|
307
|
+
* @param exec - the prepared execution.
|
|
308
|
+
* @param result - final result.
|
|
309
|
+
* @returns the materialized final result.
|
|
310
|
+
* @internal
|
|
311
|
+
*/
|
|
312
|
+
finish(exec, result) {
|
|
313
|
+
let materializedResult;
|
|
314
|
+
try {
|
|
315
|
+
materializedResult = this.materializeFinalResult(result);
|
|
316
|
+
}
|
|
317
|
+
catch (error) {
|
|
318
|
+
materializedResult = this.materializeFinalResult(toolErrorResult(error));
|
|
319
|
+
}
|
|
320
|
+
let finalResult;
|
|
321
|
+
try {
|
|
322
|
+
finalResult = this.materializeFinalResult(this.applyFinalContent(exec, materializedResult));
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
finalResult = this.materializeFinalResult(toolErrorResult(error));
|
|
326
|
+
}
|
|
327
|
+
this.notifyResult(exec, finalResult);
|
|
328
|
+
return finalResult;
|
|
329
|
+
}
|
|
330
|
+
/** Apply the snapshotted tool-owned content transform without exposing other result fields. */
|
|
331
|
+
applyFinalContent(exec, result) {
|
|
332
|
+
const finalizeContent = this.contentFinalizers.get(exec);
|
|
333
|
+
if (finalizeContent === undefined)
|
|
334
|
+
return result;
|
|
335
|
+
const content = finalizeContent(exec, result);
|
|
336
|
+
return content === undefined ? result : { ...result, content };
|
|
337
|
+
}
|
|
338
|
+
/** Notify observers without exposing a mutation or error channel into the outcome. */
|
|
339
|
+
notifyResult(exec, result) {
|
|
340
|
+
// Freeze the registry's live object before observers receive its readonly
|
|
341
|
+
// WeakMap-keyable view.
|
|
342
|
+
Object.freeze(exec);
|
|
343
|
+
const { name: toolName, callId } = exec;
|
|
344
|
+
const reportFailure = (error) => {
|
|
345
|
+
this.ctx.logger.warn(`tool "${toolName}" (${callId}): tools/result observer failed: ${toolErrorMessage(error)}`);
|
|
346
|
+
};
|
|
347
|
+
const callbacks = this.ctx.events.dispatch('emit', [
|
|
348
|
+
scopeTarget(this.tools, exec.agent), 'tools/result', exec, result,
|
|
349
|
+
]);
|
|
350
|
+
for (const callback of callbacks) {
|
|
351
|
+
try {
|
|
352
|
+
const returned = callback(exec, result);
|
|
353
|
+
void Promise.resolve(returned).catch(reportFailure);
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
reportFailure(error);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Resolve an `ask` decision to allow/deny through the approval seam. The
|
|
362
|
+
* seam is consumed opportunistically with `ctx.get('approval')` — a
|
|
363
|
+
* deployment that composes no ApprovalService keeps the historical degrade
|
|
364
|
+
* to deny, and an unmount mid-session degrades the same way on the next ask.
|
|
365
|
+
* An agent-less execution also degrades: without an agent there is no
|
|
366
|
+
* session to audit to and no UI to route to. Otherwise the outcome maps
|
|
367
|
+
* one-to-one — `allowed-once` proceeds; the three non-grants deny with
|
|
368
|
+
* distinct reasons so the model can tell a human "no" from an absent
|
|
369
|
+
* approval channel.
|
|
370
|
+
*/
|
|
371
|
+
async serviceAsk(exec, ask) {
|
|
372
|
+
const approval = this.ctx.get('approval');
|
|
373
|
+
if (approval === undefined) {
|
|
374
|
+
return {
|
|
375
|
+
decision: { kind: 'deny', reason: ask.reason ?? `tool "${exec.name}" requires approval (not yet supported)` },
|
|
376
|
+
approvalCancelled: false,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
if (exec.agent === undefined) {
|
|
380
|
+
return {
|
|
381
|
+
decision: { kind: 'deny', reason: `tool "${exec.name}" requires approval, but the call has no agent to route it through` },
|
|
382
|
+
approvalCancelled: false,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
const outcome = await approval.request({
|
|
386
|
+
agent: exec.agent,
|
|
387
|
+
toolName: exec.name,
|
|
388
|
+
callId: exec.callId,
|
|
389
|
+
...ask.reason !== undefined ? { reason: ask.reason } : {},
|
|
390
|
+
...ask.displayReason !== undefined ? { displayReason: ask.displayReason } : {},
|
|
391
|
+
signal: exec.signal,
|
|
392
|
+
});
|
|
393
|
+
switch (outcome) {
|
|
394
|
+
case 'allowed-once': return { decision: { kind: 'allow' }, approvalCancelled: false };
|
|
395
|
+
case 'rejected': return {
|
|
396
|
+
decision: { kind: 'deny', reason: `the user rejected tool "${exec.name}"` },
|
|
397
|
+
approvalCancelled: false,
|
|
398
|
+
};
|
|
399
|
+
case 'cancelled': return {
|
|
400
|
+
decision: { kind: 'deny', reason: `approval for tool "${exec.name}" was cancelled` },
|
|
401
|
+
approvalCancelled: true,
|
|
402
|
+
};
|
|
403
|
+
case 'unavailable': return {
|
|
404
|
+
decision: { kind: 'deny', reason: `tool "${exec.name}" requires approval, but no approval channel is available` },
|
|
405
|
+
approvalCancelled: false,
|
|
406
|
+
};
|
|
407
|
+
default: return assertNever(outcome, 'ApprovalOutcome');
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Run the `tools/post-execute` waterfall over a dispatched `result` and apply
|
|
412
|
+
* its {@link PostToolDecision}: `accept` keeps the call successful (replacing
|
|
413
|
+
* `content` when given), `block` turns it into an `isError` whose content is
|
|
414
|
+
* the corrective `feedback`. Either decision may attach `additionalContexts`,
|
|
415
|
+
* which are ferried on the returned result for the loop's active-batch FIFO.
|
|
416
|
+
* Context deferred by the tool body survives an accepted result but is
|
|
417
|
+
* discarded when the outer call is blocked; a block exposes only context the
|
|
418
|
+
* blocking decision explicitly supplied.
|
|
419
|
+
* Runs inside `execute`'s outer try/catch (a throwing listener → isError).
|
|
420
|
+
*/
|
|
421
|
+
async postExecute(exec, result) {
|
|
422
|
+
const decision = await this.ctx.waterfall(scopeTarget(this.tools, exec.agent), 'tools/post-execute', exec, result, () => Promise.resolve({ kind: 'accept' }));
|
|
423
|
+
const decisionContexts = decision.additionalContexts ?? [];
|
|
424
|
+
if (decision.kind === 'block') {
|
|
425
|
+
const message = failureMessageFromContent(decision.feedback);
|
|
426
|
+
return this.markCanonical(exec, {
|
|
427
|
+
content: decision.feedback,
|
|
428
|
+
isError: true,
|
|
429
|
+
error: { message },
|
|
430
|
+
...decisionContexts.length > 0 ? { additionalContexts: decisionContexts } : {},
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
if (Object.hasOwn(decision, 'content') && Object.hasOwn(decision, 'value')) {
|
|
434
|
+
throw new TypeError('tools/post-execute accept decision cannot replace both value and content');
|
|
435
|
+
}
|
|
436
|
+
const additionalContexts = [
|
|
437
|
+
...result.additionalContexts ?? [],
|
|
438
|
+
...decisionContexts,
|
|
439
|
+
];
|
|
440
|
+
if (Object.hasOwn(decision, 'value')) {
|
|
441
|
+
if (result.isError) {
|
|
442
|
+
throw new TypeError('tools/post-execute cannot replace the value of a failed result');
|
|
443
|
+
}
|
|
444
|
+
const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined, exec.toolSet);
|
|
445
|
+
if (tool === undefined)
|
|
446
|
+
throw new ToolNotFoundError(exec.name);
|
|
447
|
+
const replaced = this.createSuccessResult(exec, tool, decision.value);
|
|
448
|
+
return this.markCanonical(exec, {
|
|
449
|
+
...replaced,
|
|
450
|
+
...additionalContexts.length > 0 ? { additionalContexts } : {},
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
return this.markCanonical(exec, {
|
|
454
|
+
...result,
|
|
455
|
+
...decision.content !== undefined ? { content: decision.content } : {},
|
|
456
|
+
...additionalContexts.length > 0 ? { additionalContexts } : {},
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
/** Registry-normalized results and the exact dispatch that validated each value. */
|
|
460
|
+
canonicalResults = new WeakMap();
|
|
461
|
+
/** Mark one registry-normalized result as canonical only for its owning dispatch. */
|
|
462
|
+
markCanonical(exec, result) {
|
|
463
|
+
this.canonicalResults.set(result, exec.token);
|
|
464
|
+
return result;
|
|
465
|
+
}
|
|
466
|
+
/** Snapshot, validate, render, and optionally project one successful body value. */
|
|
467
|
+
createSuccessResult(exec, tool, candidate) {
|
|
468
|
+
const detached = snapshotToolValue(tool.name, candidate);
|
|
469
|
+
const violations = validateJsonSchemaValue(tool.output.schema, detached, 'value');
|
|
470
|
+
if (violations.length > 0)
|
|
471
|
+
throw new ToolOutputError(tool.name, violations);
|
|
472
|
+
const value = deepFreeze(detached);
|
|
473
|
+
let rendered;
|
|
474
|
+
try {
|
|
475
|
+
rendered = tool.output.render(exec.arguments, value);
|
|
476
|
+
}
|
|
477
|
+
catch (error) {
|
|
478
|
+
throw projectionError(tool.name, 'render', error);
|
|
479
|
+
}
|
|
480
|
+
const content = snapshotProjection(tool.name, 'render', rendered);
|
|
481
|
+
let meta;
|
|
482
|
+
if (tool.output.presentationMeta !== undefined) {
|
|
483
|
+
let projected;
|
|
484
|
+
try {
|
|
485
|
+
projected = tool.output.presentationMeta(exec.arguments, value);
|
|
486
|
+
}
|
|
487
|
+
catch (error) {
|
|
488
|
+
throw projectionError(tool.name, 'presentationMeta', error);
|
|
489
|
+
}
|
|
490
|
+
meta = snapshotProjection(tool.name, 'presentationMeta', projected);
|
|
491
|
+
}
|
|
492
|
+
const concludesTurn = this.concludingExecutions.has(exec);
|
|
493
|
+
return this.markCanonical(exec, this.materializeFinalResult({
|
|
494
|
+
isError: false,
|
|
495
|
+
value,
|
|
496
|
+
content,
|
|
497
|
+
...meta !== undefined ? { meta } : {},
|
|
498
|
+
...concludesTurn ? { concludesTurn: true } : {},
|
|
499
|
+
}));
|
|
500
|
+
}
|
|
501
|
+
/** Normalize an around-dispatch wrapper's authored result through the owning output contract. */
|
|
502
|
+
normalizeDispatchResult(exec, result) {
|
|
503
|
+
if (this.canonicalResults.get(result) === exec.token)
|
|
504
|
+
return result;
|
|
505
|
+
if (result.isError) {
|
|
506
|
+
return this.markCanonical(exec, {
|
|
507
|
+
isError: true,
|
|
508
|
+
error: result.error,
|
|
509
|
+
content: result.content,
|
|
510
|
+
...result.meta !== undefined ? { meta: result.meta } : {},
|
|
511
|
+
...result.additionalContexts !== undefined ? { additionalContexts: result.additionalContexts } : {},
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined, exec.toolSet);
|
|
515
|
+
if (tool === undefined)
|
|
516
|
+
throw new ToolNotFoundError(exec.name);
|
|
517
|
+
const normalized = this.createSuccessResult(exec, tool, result.value);
|
|
518
|
+
return this.markCanonical(exec, {
|
|
519
|
+
...normalized,
|
|
520
|
+
...result.additionalContexts !== undefined ? { additionalContexts: result.additionalContexts } : {},
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
/** Materialize the authoritative commit outcome once, immediately before `tools/result`. */
|
|
524
|
+
materializeFinalResult(result) {
|
|
525
|
+
const presentation = {
|
|
526
|
+
content: result.content,
|
|
527
|
+
...result.meta !== undefined ? { meta: result.meta } : {},
|
|
528
|
+
...result.additionalContexts !== undefined ? { additionalContexts: result.additionalContexts } : {},
|
|
529
|
+
};
|
|
530
|
+
if (result.isError) {
|
|
531
|
+
return materializePresentation({ isError: true, error: result.error, ...presentation });
|
|
532
|
+
}
|
|
533
|
+
const detached = materializePresentation({
|
|
534
|
+
isError: false,
|
|
535
|
+
...presentation,
|
|
536
|
+
...result.concludesTurn === true ? { concludesTurn: true } : {},
|
|
537
|
+
});
|
|
538
|
+
return deepFreeze({ ...detached, value: result.value });
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
/** Convert one projector exception into the canonical invalid-output failure. */
|
|
542
|
+
function projectionError(toolName, projector, error) {
|
|
543
|
+
return new ToolOutputError(toolName, [`output.${projector} failed: ${toolErrorMessage(error)}`]);
|
|
544
|
+
}
|
|
545
|
+
/** Snapshot one projector result before later durable-result materialization. */
|
|
546
|
+
function snapshotProjection(toolName, projector, candidate) {
|
|
547
|
+
try {
|
|
548
|
+
const detached = snapshotJsonValue(candidate);
|
|
549
|
+
if (detached === undefined) {
|
|
550
|
+
throw new ToolOutputError(toolName, [`output.${projector} returned non-lossless JSON`]);
|
|
551
|
+
}
|
|
552
|
+
return detached;
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
if (error instanceof ToolOutputError)
|
|
556
|
+
throw error;
|
|
557
|
+
throw projectionError(toolName, projector, error);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
/** Snapshot one body or policy value into the canonical invalid-output failure class. */
|
|
561
|
+
function snapshotToolValue(toolName, candidate) {
|
|
562
|
+
try {
|
|
563
|
+
const detached = snapshotJsonValue(candidate);
|
|
564
|
+
if (detached === undefined)
|
|
565
|
+
throw new ToolOutputError(toolName, ['value is not lossless JSON']);
|
|
566
|
+
return detached;
|
|
567
|
+
}
|
|
568
|
+
catch (error) {
|
|
569
|
+
if (error instanceof ToolOutputError)
|
|
570
|
+
throw error;
|
|
571
|
+
throw new ToolOutputError(toolName, [`value snapshot failed: ${toolErrorMessage(error)}`]);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Best-effort human-readable message from an arbitrary thrown value: Error
|
|
576
|
+
* instances use `.message`; non-Error objects with a string `message`
|
|
577
|
+
* property (e.g. `throw { message: 'denied' }`) use it too; everything else
|
|
578
|
+
* is stringified.
|
|
579
|
+
* @param error - thrown value from a tool or policy callback.
|
|
580
|
+
* @returns a printable failure message, including for hostile thrown values.
|
|
581
|
+
*/
|
|
582
|
+
export function toolErrorMessage(error) {
|
|
583
|
+
try {
|
|
584
|
+
if (error instanceof Error)
|
|
585
|
+
return error.message;
|
|
586
|
+
if (typeof error === 'object' && error !== null
|
|
587
|
+
&& 'message' in error && typeof error.message === 'string') {
|
|
588
|
+
return error.message;
|
|
589
|
+
}
|
|
590
|
+
return String(error);
|
|
591
|
+
}
|
|
592
|
+
catch {
|
|
593
|
+
// A hostile thrown value can trap `instanceof`, property access, or string
|
|
594
|
+
// coercion. Error normalization is the outermost safety boundary, so its
|
|
595
|
+
// fallback must itself be total.
|
|
596
|
+
return '<unprintable thrown value>';
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
/** Derive one failure message from policy feedback without changing its rendered blocks. */
|
|
600
|
+
function failureMessageFromContent(content) {
|
|
601
|
+
const text = content
|
|
602
|
+
.map(block => block.type === 'text' ? block.text : `[${block.type} content]`)
|
|
603
|
+
.join('\n');
|
|
604
|
+
return text.length > 0 ? text : 'tool result blocked by post-execute policy';
|
|
605
|
+
}
|
|
606
|
+
/** Snapshot and freeze one durable tool-result projection or reject lossy data. */
|
|
607
|
+
function materializePresentation(candidate) {
|
|
608
|
+
const detached = snapshotJsonValue(candidate);
|
|
609
|
+
if (detached === undefined) {
|
|
610
|
+
throw new TypeError('tool result must be losslessly JSON-serializable');
|
|
611
|
+
}
|
|
612
|
+
return deepFreeze(detached);
|
|
613
|
+
}
|
|
614
|
+
/** Structured `{ name, code }` for a thrown HarnessError, else undefined. */
|
|
615
|
+
function errorInfo(error) {
|
|
616
|
+
try {
|
|
617
|
+
return error instanceof HarnessError ? { name: error.name, code: error.code } : undefined;
|
|
618
|
+
}
|
|
619
|
+
catch {
|
|
620
|
+
return undefined;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
/** Mint a same-process correlation token whose identity is its value. */
|
|
624
|
+
function createExecutionToken() {
|
|
625
|
+
return Symbol('dsh.tool.execution');
|
|
626
|
+
}
|
|
627
|
+
function toolErrorResult(error) {
|
|
628
|
+
const info = errorInfo(error);
|
|
629
|
+
const message = toolErrorMessage(error);
|
|
630
|
+
return {
|
|
631
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
632
|
+
isError: true,
|
|
633
|
+
error: { message, ...info ? { info } : {} },
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
/** Read live abort state across an await without treating it as synchronously immutable. */
|
|
637
|
+
function isAborted(signal) {
|
|
638
|
+
return signal.aborted;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Fuse caller and wrapper cancellation without nesting `AbortSignal.any`.
|
|
642
|
+
* Keeping the relay dispatch-scoped also removes listeners when work settles.
|
|
643
|
+
*/
|
|
644
|
+
function fuseToolSignals(caller, wrapper) {
|
|
645
|
+
if (caller === wrapper)
|
|
646
|
+
return { signal: caller, dispose() { } };
|
|
647
|
+
const controller = new AbortController();
|
|
648
|
+
let listening = false;
|
|
649
|
+
const dispose = () => {
|
|
650
|
+
if (!listening)
|
|
651
|
+
return;
|
|
652
|
+
listening = false;
|
|
653
|
+
caller.removeEventListener('abort', abortFromCaller);
|
|
654
|
+
wrapper.removeEventListener('abort', abortFromWrapper);
|
|
655
|
+
};
|
|
656
|
+
const abortFrom = (source) => {
|
|
657
|
+
const reason = source.reason;
|
|
658
|
+
controller.abort(reason);
|
|
659
|
+
dispose();
|
|
660
|
+
};
|
|
661
|
+
const abortFromCaller = () => { abortFrom(caller); };
|
|
662
|
+
const abortFromWrapper = () => { abortFrom(wrapper); };
|
|
663
|
+
if (wrapper.aborted)
|
|
664
|
+
abortFromWrapper();
|
|
665
|
+
else if (caller.aborted)
|
|
666
|
+
abortFromCaller();
|
|
667
|
+
else {
|
|
668
|
+
listening = true;
|
|
669
|
+
caller.addEventListener('abort', abortFromCaller, { once: true });
|
|
670
|
+
wrapper.addEventListener('abort', abortFromWrapper, { once: true });
|
|
671
|
+
}
|
|
672
|
+
return { signal: controller.signal, dispose };
|
|
673
|
+
}
|
|
674
|
+
/** Canonical result when cancellation supersedes success after body invocation. */
|
|
675
|
+
function toolAbortedResult(prior) {
|
|
676
|
+
const additionalContexts = prior?.additionalContexts ?? [];
|
|
677
|
+
return {
|
|
678
|
+
content: [{ type: 'text', text: 'Error: tool call aborted' }],
|
|
679
|
+
isError: true,
|
|
680
|
+
error: {
|
|
681
|
+
message: 'tool call aborted',
|
|
682
|
+
info: { name: 'AbortError', code: TOOL_ABORTED },
|
|
683
|
+
},
|
|
684
|
+
...additionalContexts.length > 0 ? { additionalContexts } : {},
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
/** Canonical result when cancellation prevents tool body invocation. */
|
|
688
|
+
function toolAbortedBeforeDispatchResult(prior) {
|
|
689
|
+
const additionalContexts = prior?.additionalContexts ?? [];
|
|
690
|
+
return {
|
|
691
|
+
content: [{ type: 'text', text: 'Error: tool call aborted before dispatch' }],
|
|
692
|
+
isError: true,
|
|
693
|
+
error: {
|
|
694
|
+
message: 'tool call aborted before dispatch',
|
|
695
|
+
info: { name: 'AbortError', code: TOOL_ABORTED_BEFORE_DISPATCH },
|
|
696
|
+
},
|
|
697
|
+
...additionalContexts.length > 0 ? { additionalContexts } : {},
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
export { executeToolBatch } from "./batch.js";
|
|
701
|
+
//# sourceMappingURL=pipeline.js.map
|