@chatcode/chatcode-cli 3.0.5-rc.7 → 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 +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/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
|
@@ -29,7 +29,7 @@ export declare class ApiSessionPresetConflict extends Error {
|
|
|
29
29
|
constructor(sessionId: SessionId, requestedPreset: string, existingPreset: string | undefined);
|
|
30
30
|
}
|
|
31
31
|
/** Failures produced while resolving one ordinary Session identity to its live Agent. */
|
|
32
|
-
export type ApiSessionAgentError = RemoteError<'session/not-found' | 'session/agent-busy' | 'session/writer-held' | 'gateway/internal'>;
|
|
32
|
+
export type ApiSessionAgentError = RemoteError<'session/not-found' | 'session/agent-busy' | 'session/writer-held' | 'session/writer-released' | 'session/not-owned' | 'session/activation-pending' | 'session/busy-release' | 'session/busy-release-conflict' | 'session/subagent-access' | 'gateway/internal'>;
|
|
33
33
|
/** Result of resolving one ordinary Session identity to its live Agent. */
|
|
34
34
|
export type ApiSessionAgentResult = {
|
|
35
35
|
readonly agent: Agent;
|
|
@@ -76,6 +76,8 @@ export declare class ApiSessionAgentController {
|
|
|
76
76
|
private readonly releaseWhenIdle;
|
|
77
77
|
/** Sessions whose owned Agent is being released because the last follower closed. */
|
|
78
78
|
private readonly followerReleases;
|
|
79
|
+
private readonly released;
|
|
80
|
+
private readonly releases;
|
|
79
81
|
/** @param ctx - Host context carrying Agent, model, persistence, and Typert services. */
|
|
80
82
|
constructor(ctx: Context);
|
|
81
83
|
/**
|
|
@@ -84,6 +86,18 @@ export declare class ApiSessionAgentController {
|
|
|
84
86
|
* @returns the live Agent or a stable Session-domain failure.
|
|
85
87
|
*/
|
|
86
88
|
resolveAgent(sessionId: SessionId): Promise<ApiSessionAgentResult>;
|
|
89
|
+
/**
|
|
90
|
+
* Drain one idle, controller-owned Agent and release its native writer lease.
|
|
91
|
+
* Released identities stay fenced from implicit activation until explicit create.
|
|
92
|
+
* @param sessionId - ordinary Session to hand to another client.
|
|
93
|
+
* @returns after the Agent scope and persistence handle have closed.
|
|
94
|
+
*/
|
|
95
|
+
releaseSession(sessionId: SessionId): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Reject late admission that resolved its Agent before writer release began.
|
|
98
|
+
* @param agent - Agent previously resolved for prompt admission.
|
|
99
|
+
*/
|
|
100
|
+
assertWritable(agent: Agent): void;
|
|
87
101
|
/**
|
|
88
102
|
* Resolve one ordinary Session from an already-retained exact observation.
|
|
89
103
|
* @param observation - Host-owned observation whose preparation stays pinned through setup.
|
|
@@ -117,14 +131,17 @@ export declare class ApiSessionAgentController {
|
|
|
117
131
|
private disposeFollowing;
|
|
118
132
|
private resolve;
|
|
119
133
|
/**
|
|
120
|
-
*
|
|
134
|
+
* Ensure one requested identity, creating or resuming it once.
|
|
121
135
|
* @param sessionId - requested Session identity.
|
|
122
|
-
* @param cwd - directory the
|
|
136
|
+
* @param cwd - required directory, or undefined when strictly resuming the stored identity.
|
|
123
137
|
* @param checkPersistedIdentity - whether to inspect a cold identity before creation.
|
|
124
138
|
* @param presetId - optional Agent preset the Session must own.
|
|
139
|
+
* @param existingOnly - refuse a cold identity that does not exist instead of creating it.
|
|
140
|
+
* @param provider - optional provider override for the model selection.
|
|
141
|
+
* @param model - optional model override for the model selection.
|
|
125
142
|
* @returns the matching live ordinary Agent.
|
|
126
143
|
*/
|
|
127
|
-
ensureSession(sessionId: SessionId, cwd: string, checkPersistedIdentity: boolean, presetId?: string): Promise<Agent>;
|
|
144
|
+
ensureSession(sessionId: SessionId, cwd: string | undefined, checkPersistedIdentity: boolean, presetId?: string, existingOnly?: boolean, provider?: string, model?: string): Promise<Agent>;
|
|
128
145
|
/**
|
|
129
146
|
* Install or return the Session-local model selection used by prompt assembly.
|
|
130
147
|
* @param agent - live Agent that owns the selection.
|
|
@@ -170,6 +187,9 @@ export declare class ApiSessionAgentController {
|
|
|
170
187
|
}>;
|
|
171
188
|
private liveAgent;
|
|
172
189
|
private resume;
|
|
190
|
+
/**
|
|
191
|
+
* Resume an observed Session, optionally with provider/model override.
|
|
192
|
+
*/
|
|
173
193
|
private resumeObserved;
|
|
174
194
|
private createOrAdopt;
|
|
175
195
|
/**
|
|
@@ -174,6 +174,8 @@ export class ApiSessionAgentController {
|
|
|
174
174
|
releaseWhenIdle = new Set();
|
|
175
175
|
/** Sessions whose owned Agent is being released because the last follower closed. */
|
|
176
176
|
followerReleases = new Set();
|
|
177
|
+
released = new Set();
|
|
178
|
+
releases = new Map();
|
|
177
179
|
/** @param ctx - Host context carrying Agent, model, persistence, and Typert services. */
|
|
178
180
|
constructor(ctx) {
|
|
179
181
|
this.ctx = ctx;
|
|
@@ -228,6 +230,66 @@ export class ApiSessionAgentController {
|
|
|
228
230
|
async resolveAgent(sessionId) {
|
|
229
231
|
return this.resolve(sessionId);
|
|
230
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Drain one idle, controller-owned Agent and release its native writer lease.
|
|
235
|
+
* Released identities stay fenced from implicit activation until explicit create.
|
|
236
|
+
* @param sessionId - ordinary Session to hand to another client.
|
|
237
|
+
* @returns after the Agent scope and persistence handle have closed.
|
|
238
|
+
*/
|
|
239
|
+
releaseSession(sessionId) {
|
|
240
|
+
const pending = this.releases.get(sessionId);
|
|
241
|
+
if (pending !== undefined)
|
|
242
|
+
return pending;
|
|
243
|
+
if (this.resumes.has(sessionId) || this.creations.has(sessionId)) {
|
|
244
|
+
return Promise.reject(new RemoteError('session/activation-pending', 'session activation is still in progress', { sessionId }));
|
|
245
|
+
}
|
|
246
|
+
const handle = this.owned.get(sessionId);
|
|
247
|
+
const live = this.ctx.agents.get(sessionId);
|
|
248
|
+
if (live !== undefined && (handle === undefined || handle.agent !== live)) {
|
|
249
|
+
return Promise.reject(new RemoteError('session/not-owned', 'session belongs to another lifecycle owner', { sessionId }));
|
|
250
|
+
}
|
|
251
|
+
if (live !== undefined && (live.status !== 'idle' || live.inbox.nextTurn.length > 0 || live.inbox.nextStep.length > 0)) {
|
|
252
|
+
return Promise.reject(new RemoteError('session/busy-release', 'stop or finish pending work before handing off this session', { sessionId }));
|
|
253
|
+
}
|
|
254
|
+
this.released.add(sessionId);
|
|
255
|
+
const task = Promise.resolve().then(async () => {
|
|
256
|
+
if (handle !== undefined) {
|
|
257
|
+
await (this.imageAdmissionChains.get(handle.agent) ?? Promise.resolve());
|
|
258
|
+
if (handle.agent.status !== 'idle' || handle.agent.inbox.nextTurn.length > 0 || handle.agent.inbox.nextStep.length > 0) {
|
|
259
|
+
this.released.delete(sessionId);
|
|
260
|
+
throw new RemoteError('session/busy-release-conflict', 'session received pending work before release', { sessionId });
|
|
261
|
+
}
|
|
262
|
+
await handle.dispose();
|
|
263
|
+
this.owned.delete(sessionId);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
const persistence = this.ctx.get('sessionPersistence');
|
|
267
|
+
if (persistence === undefined)
|
|
268
|
+
throw new RemoteError('gateway/internal', 'native Session persistence is unavailable', {});
|
|
269
|
+
try {
|
|
270
|
+
const writer = await persistence.open(sessionId, 'write');
|
|
271
|
+
await writer.close();
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
if (error instanceof Error && error.name === 'SessionAlreadyOwnedError') {
|
|
275
|
+
throw new RemoteError('session/writer-held', error.message, { sessionId });
|
|
276
|
+
}
|
|
277
|
+
throw error;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}).finally(() => { this.releases.delete(sessionId); });
|
|
281
|
+
this.releases.set(sessionId, task);
|
|
282
|
+
return task;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Reject late admission that resolved its Agent before writer release began.
|
|
286
|
+
* @param agent - Agent previously resolved for prompt admission.
|
|
287
|
+
*/
|
|
288
|
+
assertWritable(agent) {
|
|
289
|
+
if (this.released.has(agent.id) || this.ctx.agents.get(agent.id) !== agent) {
|
|
290
|
+
throw new RemoteError('session/not-owned', 'session writer is no longer owned by this client', { sessionId: agent.id });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
231
293
|
/**
|
|
232
294
|
* Resolve one ordinary Session from an already-retained exact observation.
|
|
233
295
|
* @param observation - Host-owned observation whose preparation stays pinned through setup.
|
|
@@ -302,6 +364,9 @@ export class ApiSessionAgentController {
|
|
|
302
364
|
}
|
|
303
365
|
}
|
|
304
366
|
async resolve(sessionId, observation) {
|
|
367
|
+
if (this.released.has(sessionId)) {
|
|
368
|
+
return { error: new RemoteError('session/writer-released', 'session writer was released; explicitly resume it before sending', { sessionId }) };
|
|
369
|
+
}
|
|
305
370
|
const live = this.liveAgent(sessionId);
|
|
306
371
|
if (live !== undefined)
|
|
307
372
|
return live;
|
|
@@ -344,17 +409,23 @@ export class ApiSessionAgentController {
|
|
|
344
409
|
}
|
|
345
410
|
}
|
|
346
411
|
/**
|
|
347
|
-
*
|
|
412
|
+
* Ensure one requested identity, creating or resuming it once.
|
|
348
413
|
* @param sessionId - requested Session identity.
|
|
349
|
-
* @param cwd - directory the
|
|
414
|
+
* @param cwd - required directory, or undefined when strictly resuming the stored identity.
|
|
350
415
|
* @param checkPersistedIdentity - whether to inspect a cold identity before creation.
|
|
351
416
|
* @param presetId - optional Agent preset the Session must own.
|
|
417
|
+
* @param existingOnly - refuse a cold identity that does not exist instead of creating it.
|
|
418
|
+
* @param provider - optional provider override for the model selection.
|
|
419
|
+
* @param model - optional model override for the model selection.
|
|
352
420
|
* @returns the matching live ordinary Agent.
|
|
353
421
|
*/
|
|
354
|
-
async ensureSession(sessionId, cwd, checkPersistedIdentity, presetId) {
|
|
422
|
+
async ensureSession(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly = false, provider, model) {
|
|
423
|
+
const releasing = this.releases.get(sessionId);
|
|
424
|
+
if (releasing !== undefined)
|
|
425
|
+
await releasing;
|
|
355
426
|
let creation = this.creations.get(sessionId);
|
|
356
427
|
if (creation === undefined) {
|
|
357
|
-
creation = this.createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId)
|
|
428
|
+
creation = this.createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model)
|
|
358
429
|
.catch((error) => {
|
|
359
430
|
const live = this.ctx.agents.get(sessionId);
|
|
360
431
|
if (live !== undefined) {
|
|
@@ -379,9 +450,10 @@ export class ApiSessionAgentController {
|
|
|
379
450
|
if (presetId !== undefined) {
|
|
380
451
|
this.assertPresetUnchanged(sessionId, presetId, this.presetForSession(agent.session));
|
|
381
452
|
}
|
|
382
|
-
if (agent.session.header.cwd !== cwd) {
|
|
453
|
+
if (cwd !== undefined && agent.session.header.cwd !== cwd) {
|
|
383
454
|
throw new ApiSessionCwdConflict(sessionId, cwd, agent.session.header.cwd);
|
|
384
455
|
}
|
|
456
|
+
this.released.delete(sessionId);
|
|
385
457
|
return agent;
|
|
386
458
|
}
|
|
387
459
|
/**
|
|
@@ -530,7 +602,10 @@ export class ApiSessionAgentController {
|
|
|
530
602
|
throw error;
|
|
531
603
|
}
|
|
532
604
|
}
|
|
533
|
-
|
|
605
|
+
/**
|
|
606
|
+
* Resume an observed Session, optionally with provider/model override.
|
|
607
|
+
*/
|
|
608
|
+
async resumeObserved(sessionId, observation, provider, model) {
|
|
534
609
|
if (observation.header.id !== sessionId || observation.header.cwd === undefined) {
|
|
535
610
|
throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
536
611
|
}
|
|
@@ -545,11 +620,11 @@ export class ApiSessionAgentController {
|
|
|
545
620
|
}
|
|
546
621
|
return (await this.remember(this.ctx.agents.resume({
|
|
547
622
|
resumeSessionId: sessionId,
|
|
548
|
-
agentOptions: this.agentOptions(),
|
|
623
|
+
agentOptions: this.agentOptions(provider, model),
|
|
549
624
|
setup: composition.setup,
|
|
550
625
|
}))).agent;
|
|
551
626
|
}
|
|
552
|
-
async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId) {
|
|
627
|
+
async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model) {
|
|
553
628
|
const attached = this.ctx.sessions.get(sessionId);
|
|
554
629
|
const live = this.ctx.agents.get(sessionId);
|
|
555
630
|
if (attached !== undefined && hasApiSessionSubagentOwner(this.ctx, attached, live)) {
|
|
@@ -557,7 +632,7 @@ export class ApiSessionAgentController {
|
|
|
557
632
|
}
|
|
558
633
|
if (live !== undefined)
|
|
559
634
|
return live;
|
|
560
|
-
if (checkPersistedIdentity) {
|
|
635
|
+
if (checkPersistedIdentity || existingOnly) {
|
|
561
636
|
try {
|
|
562
637
|
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
563
638
|
try {
|
|
@@ -565,7 +640,7 @@ export class ApiSessionAgentController {
|
|
|
565
640
|
if (hasApiSessionSubagentOwner(this.ctx, { header: observation.header }, undefined)) {
|
|
566
641
|
throw new ApiSessionSubagentOwnership(sessionId);
|
|
567
642
|
}
|
|
568
|
-
if (observation.header.cwd !== cwd) {
|
|
643
|
+
if (cwd !== undefined && observation.header.cwd !== cwd) {
|
|
569
644
|
throw new ApiSessionCwdConflict(sessionId, cwd, observation.header.cwd);
|
|
570
645
|
}
|
|
571
646
|
const storedPreset = this.presetForObservation(observation);
|
|
@@ -573,7 +648,7 @@ export class ApiSessionAgentController {
|
|
|
573
648
|
const composition = await this.composeAgent(storedPreset);
|
|
574
649
|
return (await this.remember(this.ctx.agents.resume({
|
|
575
650
|
resumeSessionId: sessionId,
|
|
576
|
-
agentOptions: this.agentOptions(),
|
|
651
|
+
agentOptions: this.agentOptions(provider, model),
|
|
577
652
|
setup: composition.setup,
|
|
578
653
|
}))).agent;
|
|
579
654
|
}
|
|
@@ -589,8 +664,12 @@ export class ApiSessionAgentController {
|
|
|
589
664
|
if (!(error instanceof SessionQueryError)
|
|
590
665
|
|| error.code !== 'SESSION_QUERY_SESSION_NOT_FOUND')
|
|
591
666
|
throw error;
|
|
667
|
+
if (existingOnly || cwd === undefined)
|
|
668
|
+
throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
592
669
|
}
|
|
593
670
|
}
|
|
671
|
+
if (cwd === undefined)
|
|
672
|
+
throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
594
673
|
try {
|
|
595
674
|
await mkdir(cwd, { recursive: true });
|
|
596
675
|
}
|
|
@@ -600,7 +679,7 @@ export class ApiSessionAgentController {
|
|
|
600
679
|
const composition = await this.composeAgent(presetId);
|
|
601
680
|
return (await this.remember(this.ctx.agents.create({
|
|
602
681
|
sessionId,
|
|
603
|
-
agentOptions: this.agentOptions(),
|
|
682
|
+
agentOptions: this.agentOptions(provider, model),
|
|
604
683
|
meta: {
|
|
605
684
|
cwd,
|
|
606
685
|
...(composition.agentPreset === undefined ? {} : { agentPreset: composition.agentPreset }),
|
|
@@ -621,9 +700,12 @@ export class ApiSessionAgentController {
|
|
|
621
700
|
this.owned.set(handle.agent.session.id, handle);
|
|
622
701
|
return handle;
|
|
623
702
|
}
|
|
624
|
-
agentOptions() {
|
|
625
|
-
|
|
626
|
-
|
|
703
|
+
agentOptions(provider, model) {
|
|
704
|
+
if (provider !== undefined && model !== undefined) {
|
|
705
|
+
return { provider, model };
|
|
706
|
+
}
|
|
707
|
+
const { provider: defaultProvider, model: defaultModel } = this.ctx.agentDefaultModel.currentSelection();
|
|
708
|
+
return { provider: defaultProvider, model: defaultModel };
|
|
627
709
|
}
|
|
628
710
|
installSelection(agent) {
|
|
629
711
|
this.selectionFor(agent);
|
|
@@ -95,7 +95,7 @@ export async function hasProviderApiKey(ctx) {
|
|
|
95
95
|
const settings = ctx.get('settings');
|
|
96
96
|
const credentials = ctx.get('credentials');
|
|
97
97
|
if (settings === undefined || credentials === undefined) {
|
|
98
|
-
throw new RemoteError('session/provider-credentials-unavailable', 'provider credentials are unavailable', {});
|
|
98
|
+
throw new RemoteError('session/provider-credentials-unavailable', 'provider credentials are unavailable — settings or credentials service is not composed', {});
|
|
99
99
|
}
|
|
100
100
|
const namespaces = settings.describe({ redactSecrets: true });
|
|
101
101
|
for (const provider of ctx.llm.listConfigurableProviders()) {
|
package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Session commands whose activation policy is explicit at each Remote method. */
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import { ApiSessionAgentController } from './agent.ts';
|
|
4
|
-
import type { SessionAttachmentRequest, SessionAttachmentValue, SessionCancelRequest, SessionCancelValue, SessionCreateRequest, SessionCreateValue, SessionForkRequest, SessionForkValue, SessionPromptRequest, SessionPromptValue, SessionRenameRequest, SessionRenameValue, SessionSelectModelRequest, SessionSelectModelValue, SessionUpdateQueueRequest, SessionUpdateQueueValue } from './types.ts';
|
|
4
|
+
import type { SessionAttachmentRequest, SessionAttachmentValue, SessionCancelRequest, SessionCancelValue, SessionCreateRequest, SessionCreateValue, SessionForkRequest, SessionForkValue, SessionPromptRequest, SessionPromptValue, SessionRenameRequest, SessionRenameValue, SessionResumeRequest, SessionResumeValue, SessionSelectModelRequest, SessionSelectModelValue, SessionUpdateQueueRequest, SessionUpdateQueueValue } from './types.ts';
|
|
5
5
|
/** Implements Session business commands delegated by the Session Controller Remote service. */
|
|
6
6
|
export declare class SessionCommandController {
|
|
7
7
|
private readonly ctx;
|
|
@@ -20,7 +20,8 @@ export declare class SessionCommandController {
|
|
|
20
20
|
*/
|
|
21
21
|
create(request: SessionCreateRequest): Promise<SessionCreateValue>;
|
|
22
22
|
/**
|
|
23
|
-
* Validate
|
|
23
|
+
* Validate against the live registry and persist the default, then install one
|
|
24
|
+
* model selection before acknowledging success.
|
|
24
25
|
* @param request - Session identity and requested model selection.
|
|
25
26
|
* @returns the normalized selection after the shared save and Session selection succeed.
|
|
26
27
|
*/
|
|
@@ -64,6 +65,14 @@ export declare class SessionCommandController {
|
|
|
64
65
|
* @returns acknowledgement that cancellation was requested.
|
|
65
66
|
*/
|
|
66
67
|
cancel(request: SessionCancelRequest): SessionCancelValue;
|
|
68
|
+
/**
|
|
69
|
+
* Resume an existing Session, optionally with provider/model overrides.
|
|
70
|
+
* The Session must already exist in persistence. This is separate from create
|
|
71
|
+
* so desktop AI workbenches can re-inject provider/model after Runtime restart.
|
|
72
|
+
* @param request - Session identity and optional provider/model override.
|
|
73
|
+
* @returns the Session identity and resolved model selection.
|
|
74
|
+
*/
|
|
75
|
+
resume(request: SessionResumeRequest): Promise<SessionResumeValue>;
|
|
67
76
|
private resolveAgent;
|
|
68
77
|
private rejectCreation;
|
|
69
78
|
private readSessionState;
|
|
@@ -52,16 +52,16 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
52
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
53
53
|
});
|
|
54
54
|
import { modelAvailable } from "./catalog.js";
|
|
55
|
-
import { randomUUID } from 'node:crypto';
|
|
55
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
56
56
|
import { brandString } from '@deepseek-ai/dsh-brand';
|
|
57
57
|
import { AttachmentError } from '@deepseek-ai/dsh-attachment';
|
|
58
|
-
import { ReasoningEffortId, assistantStreamChunks, createUserMessage, freezeMessage, } from '@deepseek-ai/dsh-llm';
|
|
58
|
+
import { LlmError, ReasoningEffortId, assistantStreamChunks, createUserMessage, freezeMessage, normalizeApiKey, } from '@deepseek-ai/dsh-llm';
|
|
59
59
|
import { buildForkSeed } from '@deepseek-ai/dsh-session/fork';
|
|
60
60
|
import { SessionLogOffset, SessionSeq } from '@deepseek-ai/dsh-session';
|
|
61
61
|
import { SessionQueryError } from '@deepseek-ai/dsh-session-query';
|
|
62
62
|
import { SessionTitleInvalidError } from '@deepseek-ai/dsh-session-title';
|
|
63
63
|
import { canonicalClientTimeZone } from '@deepseek-ai/dsh-util-time';
|
|
64
|
-
import { assertNever } from '@deepseek-ai/dsh-util-values';
|
|
64
|
+
import { assertNever, isJsonValue } from '@deepseek-ai/dsh-util-values';
|
|
65
65
|
import { RemoteError, remoteErrorOf } from '@deepseek-ai/dsh-typert-protocol';
|
|
66
66
|
import { ApiSessionCwdConflict, ApiSessionNotFound, ApiSessionPresetConflict, ApiSessionSubagentOwnership, apiSessionSubagentOwnershipError, hasApiSessionSubagentOwner, inspectApiSession, } from "./agent.js";
|
|
67
67
|
function hasPromptContent(content) {
|
|
@@ -105,9 +105,13 @@ export class SessionCommandController {
|
|
|
105
105
|
* @returns the Session identity and resolved preset when configured.
|
|
106
106
|
*/
|
|
107
107
|
async create(request) {
|
|
108
|
+
if (request.resumeOnly === true && !request.sessionId) {
|
|
109
|
+
throw new RemoteError('gateway/bad-request', 'resumeOnly requires a sessionId', {});
|
|
110
|
+
}
|
|
108
111
|
if (request.workspaceId !== undefined && request.cwd !== undefined) {
|
|
109
112
|
throw new RemoteError('gateway/bad-request', 'session.create accepts workspaceId or cwd, not both', {});
|
|
110
113
|
}
|
|
114
|
+
this.ctx.logger.info('session-controller.commands: create', { sessionId: request.sessionId, workspaceId: request.workspaceId, cwd: request.cwd });
|
|
111
115
|
const sessionId = request.sessionId ?? brandString(`session-${randomUUID()}`);
|
|
112
116
|
let workspace;
|
|
113
117
|
if (request.workspaceId !== undefined) {
|
|
@@ -121,7 +125,7 @@ export class SessionCommandController {
|
|
|
121
125
|
const cwd = workspace?.path ?? request.cwd ?? this.defaultCwd;
|
|
122
126
|
let adopted;
|
|
123
127
|
try {
|
|
124
|
-
adopted = await this.agents.ensureSession(sessionId, cwd, request.sessionId !== undefined, request.agentPreset);
|
|
128
|
+
adopted = await this.agents.ensureSession(sessionId, cwd, request.sessionId !== undefined, request.agentPreset, request.resumeOnly === true, request.provider, request.model);
|
|
125
129
|
}
|
|
126
130
|
catch (error) {
|
|
127
131
|
this.rejectCreation(sessionId, error);
|
|
@@ -138,14 +142,17 @@ export class SessionCommandController {
|
|
|
138
142
|
return { sessionId, ...(agentPreset === undefined ? {} : { agentPreset }) };
|
|
139
143
|
}
|
|
140
144
|
/**
|
|
141
|
-
* Validate
|
|
145
|
+
* Validate against the live registry and persist the default, then install one
|
|
146
|
+
* model selection before acknowledging success.
|
|
142
147
|
* @param request - Session identity and requested model selection.
|
|
143
148
|
* @returns the normalized selection after the shared save and Session selection succeed.
|
|
144
149
|
*/
|
|
145
150
|
async selectModel(request) {
|
|
151
|
+
this.ctx.logger.info('session-controller.commands: selectModel', { sessionId: request.sessionId, provider: request.provider, model: request.model });
|
|
146
152
|
const agent = await this.resolveAgent(request.sessionId);
|
|
147
153
|
return this.agents.serializeImageAdmission(agent, async () => {
|
|
148
154
|
try {
|
|
155
|
+
// Normal flow: catalog check + disk save.
|
|
149
156
|
await this.requireModel(request);
|
|
150
157
|
const resolved = await this.ctx.llm.resolveCallConfig({
|
|
151
158
|
provider: request.provider,
|
|
@@ -298,6 +305,7 @@ export class SessionCommandController {
|
|
|
298
305
|
* @returns acknowledgement that the Agent accepted the prompt.
|
|
299
306
|
*/
|
|
300
307
|
async prompt(request) {
|
|
308
|
+
this.ctx.logger.info('session-controller.commands: prompt', { sessionId: request.sessionId, mode: request.mode, provider: request.provider, model: request.model });
|
|
301
309
|
if (!hasPromptContent(request.content)) {
|
|
302
310
|
throw new RemoteError('gateway/bad-request', 'prompt content must include non-whitespace text or an attachment', {});
|
|
303
311
|
}
|
|
@@ -308,11 +316,33 @@ export class SessionCommandController {
|
|
|
308
316
|
throw new RemoteError('session/invalid-time-zone', 'clientTimeZone must be UTC or a valid IANA Area/Location name', { value: request.clientTimeZone });
|
|
309
317
|
}
|
|
310
318
|
const agent = await this.resolveAgent(request.sessionId);
|
|
311
|
-
|
|
319
|
+
const modelConfig = request.modelConfig;
|
|
320
|
+
const promptApiKey = modelConfig === undefined ? undefined : validatePromptModelConfig(request);
|
|
321
|
+
const promptDigest = modelConfig === undefined ? undefined : digestPrompt(request);
|
|
322
|
+
if (hasPromptRequest(agent, request.requestId, promptDigest, promptApiKey))
|
|
312
323
|
return { accepted: true };
|
|
324
|
+
const promptConfig = modelConfig === undefined ? undefined : (() => {
|
|
325
|
+
try {
|
|
326
|
+
return this.ctx.llm.resolvePromptConfig(modelConfig);
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
if (!(error instanceof LlmError))
|
|
330
|
+
throw error;
|
|
331
|
+
let field = error.code === 'NO_ADAPTER' ? 'provider'
|
|
332
|
+
: error.code === 'UNSUPPORTED_OPTION' ? error.message : 'model';
|
|
333
|
+
const protocolPrefix = 'protocolOptions.';
|
|
334
|
+
if (field.startsWith(protocolPrefix)) {
|
|
335
|
+
const key = field.slice(protocolPrefix.length);
|
|
336
|
+
if (Object.hasOwn(modelConfig.options, key))
|
|
337
|
+
field = `options.${key}`;
|
|
338
|
+
}
|
|
339
|
+
throw invalidModelConfig(`modelConfig.${field}`);
|
|
340
|
+
}
|
|
341
|
+
})();
|
|
313
342
|
const source = {
|
|
314
343
|
kind: 'user',
|
|
315
344
|
rpcId: request.requestId,
|
|
345
|
+
...promptDigest === undefined ? {} : { promptDigest },
|
|
316
346
|
...(clientTimeZone === undefined ? {} : { clientTimeZone }),
|
|
317
347
|
};
|
|
318
348
|
const hasImage = request.content.some(part => part.type === 'image');
|
|
@@ -320,12 +350,22 @@ export class SessionCommandController {
|
|
|
320
350
|
try {
|
|
321
351
|
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
322
352
|
try {
|
|
323
|
-
|
|
353
|
+
// When the desktop provides provider/model per-request, apply them directly
|
|
354
|
+
// without any catalog validation or connectivity check. If the model is
|
|
355
|
+
// wrong or unreachable, the LLM adapter will return an error naturally.
|
|
356
|
+
const hasProviderModel = request.provider !== undefined && request.model !== undefined;
|
|
357
|
+
if (hasProviderModel) {
|
|
358
|
+
this.agents.selectForNextRequest(agent, {
|
|
359
|
+
provider: request.provider,
|
|
360
|
+
model: request.model,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
else if (promptConfig === undefined && this.ctx.agentDefaultModel.usesSharedPreference()) {
|
|
324
364
|
const route = await this.ctx.agentDefaultModel.resolveSelection();
|
|
325
365
|
if (route.provider === '' || route.model === '')
|
|
326
366
|
throw new RemoteError('session/model-unavailable', 'the selected model is unavailable; select a model before sending a message', { provider: route.provider, model: route.model });
|
|
327
367
|
}
|
|
328
|
-
if (hasImage) {
|
|
368
|
+
if (hasImage && promptConfig === undefined && !hasProviderModel) {
|
|
329
369
|
const current = this.agents.selectionFor(agent).current;
|
|
330
370
|
const model = await this.ctx.llm.resolveModelInfo(current.provider, current.model);
|
|
331
371
|
if (model.inputModalities !== undefined && !model.inputModalities.includes('image')) {
|
|
@@ -334,15 +374,26 @@ export class SessionCommandController {
|
|
|
334
374
|
}
|
|
335
375
|
const admission = resolvePromptFileReceipts(request.content, receiptId => this.ctx.fileUploads.resolve(agent, receiptId));
|
|
336
376
|
const content = await this.ctx.attachments.admitPromptContent(admission.content);
|
|
337
|
-
|
|
377
|
+
if (promptDigest !== undefined && hasPromptRequest(agent, request.requestId, promptDigest, promptApiKey)) {
|
|
378
|
+
return { accepted: true };
|
|
379
|
+
}
|
|
380
|
+
const message = createUserMessage({
|
|
381
|
+
content,
|
|
382
|
+
source,
|
|
383
|
+
...promptConfig === undefined ? {} : { promptConfig },
|
|
384
|
+
...promptApiKey === undefined ? {} : { promptApiKeyRequired: true },
|
|
385
|
+
});
|
|
338
386
|
if (this.ctx.agents.get(agent.id) !== agent) {
|
|
339
387
|
throw new RemoteError('session/not-found', `session "${agent.id}" was disposed during prompt admission`, { sessionId: agent.id });
|
|
340
388
|
}
|
|
341
389
|
const binding = __addDisposableResource(env_2, this.ctx.fileUploads.bindPrompt(agent, admission.receiptIds, request.requestId), false);
|
|
390
|
+
this.agents.assertWritable(agent);
|
|
342
391
|
if (request.mode === 'steer')
|
|
343
392
|
agent.steer(message);
|
|
344
|
-
else
|
|
393
|
+
else if (promptApiKey === undefined)
|
|
345
394
|
agent.followup(message);
|
|
395
|
+
else
|
|
396
|
+
agent.followup(message, promptApiKey);
|
|
346
397
|
binding.commit();
|
|
347
398
|
}
|
|
348
399
|
catch (e_2) {
|
|
@@ -448,6 +499,9 @@ export class SessionCommandController {
|
|
|
448
499
|
throw new RemoteError('session/queue-item-not-found', 'queued item is no longer pending', { itemId: request.itemId });
|
|
449
500
|
}
|
|
450
501
|
const { target, message } = located;
|
|
502
|
+
if (request.action.kind === 'steer' && message.promptConfig !== undefined) {
|
|
503
|
+
throw invalidModelConfig('mode');
|
|
504
|
+
}
|
|
451
505
|
if (request.action.kind === 'steer' && (target !== 'next-turn' || agent.status !== 'running')) {
|
|
452
506
|
throw new RemoteError('session/steer-unavailable', 'current turn no longer accepts steering', { itemId: request.itemId });
|
|
453
507
|
}
|
|
@@ -482,6 +536,7 @@ export class SessionCommandController {
|
|
|
482
536
|
* @returns acknowledgement that cancellation was requested.
|
|
483
537
|
*/
|
|
484
538
|
cancel(request) {
|
|
539
|
+
this.ctx.logger.info('session-controller.commands: cancel', { sessionId: request.sessionId });
|
|
485
540
|
const agent = this.ctx.agents.get(request.sessionId);
|
|
486
541
|
if (agent === undefined) {
|
|
487
542
|
throw new RemoteError('session/not-found', `session "${request.sessionId}" not found (not attached)`, { sessionId: request.sessionId });
|
|
@@ -492,6 +547,43 @@ export class SessionCommandController {
|
|
|
492
547
|
agent.cancel({ kind: 'user' }, { keepInbox: true });
|
|
493
548
|
return { accepted: true };
|
|
494
549
|
}
|
|
550
|
+
/**
|
|
551
|
+
* Resume an existing Session, optionally with provider/model overrides.
|
|
552
|
+
* The Session must already exist in persistence. This is separate from create
|
|
553
|
+
* so desktop AI workbenches can re-inject provider/model after Runtime restart.
|
|
554
|
+
* @param request - Session identity and optional provider/model override.
|
|
555
|
+
* @returns the Session identity and resolved model selection.
|
|
556
|
+
*/
|
|
557
|
+
async resume(request) {
|
|
558
|
+
const sessionId = request.sessionId;
|
|
559
|
+
try {
|
|
560
|
+
const agent = await this.agents.ensureSession(sessionId, undefined, true, undefined, true, request.provider, request.model);
|
|
561
|
+
const selection = this.agents.selectionFor(agent);
|
|
562
|
+
if (request.provider !== undefined && request.model !== undefined
|
|
563
|
+
&& (selection.current.provider !== request.provider || selection.current.model !== request.model)) {
|
|
564
|
+
this.agents.selectForNextRequest(agent, { provider: request.provider, model: request.model });
|
|
565
|
+
}
|
|
566
|
+
const current = selection.current;
|
|
567
|
+
return {
|
|
568
|
+
sessionId,
|
|
569
|
+
selected: {
|
|
570
|
+
provider: current.provider,
|
|
571
|
+
model: current.model,
|
|
572
|
+
...(current.reasoningEffort === undefined
|
|
573
|
+
? {}
|
|
574
|
+
: { reasoningEffort: current.reasoningEffort }),
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
catch (error) {
|
|
579
|
+
if (error instanceof RemoteError)
|
|
580
|
+
throw error;
|
|
581
|
+
if (error instanceof ApiSessionNotFound) {
|
|
582
|
+
throw new RemoteError('session/not-found', error.message, { sessionId });
|
|
583
|
+
}
|
|
584
|
+
throw new RemoteError('gateway/internal', `failed to resume session "${sessionId}": ${String(error)}`, {});
|
|
585
|
+
}
|
|
586
|
+
}
|
|
495
587
|
async resolveAgent(sessionId) {
|
|
496
588
|
const found = await this.agents.resolveAgent(sessionId);
|
|
497
589
|
if ('error' in found)
|
|
@@ -504,6 +596,9 @@ export class SessionCommandController {
|
|
|
504
596
|
if (error instanceof Error && error.name === 'SessionAlreadyOwnedError') {
|
|
505
597
|
throw new RemoteError('session/writer-held', error.message, { sessionId });
|
|
506
598
|
}
|
|
599
|
+
if (error instanceof ApiSessionNotFound) {
|
|
600
|
+
throw new RemoteError('session/not-found', error.message, { sessionId });
|
|
601
|
+
}
|
|
507
602
|
if (error instanceof ApiSessionPresetConflict) {
|
|
508
603
|
throw new RemoteError('agent-preset/conflict', error.message, {
|
|
509
604
|
sessionId: error.sessionId,
|
|
@@ -560,19 +655,78 @@ function resolvePromptFileReceipts(content, stagedFile) {
|
|
|
560
655
|
});
|
|
561
656
|
return { content: resolved, receiptIds: [...receiptIds] };
|
|
562
657
|
}
|
|
563
|
-
function
|
|
658
|
+
function invalidModelConfig(field) {
|
|
659
|
+
return new RemoteError('session/invalid-model-config', 'Invalid or unsupported prompt model configuration', { field });
|
|
660
|
+
}
|
|
661
|
+
function validatePromptModelConfig(request) {
|
|
662
|
+
const config = request.modelConfig;
|
|
663
|
+
if (request.mode !== 'queue')
|
|
664
|
+
throw invalidModelConfig('mode');
|
|
665
|
+
if (request.provider !== undefined || request.model !== undefined)
|
|
666
|
+
throw invalidModelConfig('modelConfig');
|
|
667
|
+
const object = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
668
|
+
if (config === undefined || !object(config) || !isJsonValue(config)
|
|
669
|
+
|| Object.keys(config).some(key => !['provider', 'model', 'protocol', 'options', 'protocolOptions', 'apiKey'].includes(key))
|
|
670
|
+
|| Buffer.byteLength(JSON.stringify(config)) > 16_384)
|
|
671
|
+
throw invalidModelConfig('modelConfig');
|
|
672
|
+
for (const key of ['provider', 'model', 'protocol']) {
|
|
673
|
+
const value = config[key];
|
|
674
|
+
if (key === 'protocol' && value === undefined)
|
|
675
|
+
continue;
|
|
676
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
677
|
+
throw invalidModelConfig(`modelConfig.${key}`);
|
|
678
|
+
}
|
|
679
|
+
if (!object(config.options))
|
|
680
|
+
throw invalidModelConfig('modelConfig.options');
|
|
681
|
+
if (config.protocolOptions !== undefined && !object(config.protocolOptions)) {
|
|
682
|
+
throw invalidModelConfig('modelConfig.protocolOptions');
|
|
683
|
+
}
|
|
684
|
+
if (config.apiKey === undefined)
|
|
685
|
+
return undefined;
|
|
686
|
+
if (typeof config.apiKey !== 'string')
|
|
687
|
+
throw invalidModelConfig('modelConfig.apiKey');
|
|
688
|
+
const key = normalizeApiKey(config.apiKey);
|
|
689
|
+
if (!key.ok)
|
|
690
|
+
throw invalidModelConfig('modelConfig.apiKey');
|
|
691
|
+
return key.value;
|
|
692
|
+
}
|
|
693
|
+
function digestPrompt(request) {
|
|
694
|
+
const { apiKey, ...config } = request.modelConfig ?? {};
|
|
695
|
+
const fingerprintConfig = apiKey === undefined ? config : { ...config, promptApiKeyRequired: true };
|
|
696
|
+
const body = JSON.stringify([request.mode, request.content, request.clientTimeZone ?? null, fingerprintConfig], (_key, value) => {
|
|
697
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
698
|
+
return value;
|
|
699
|
+
const record = { ...value };
|
|
700
|
+
return Object.fromEntries(Object.keys(record).sort().map(key => [key, record[key]]));
|
|
701
|
+
});
|
|
702
|
+
return createHash('sha256').update(body).digest('hex');
|
|
703
|
+
}
|
|
704
|
+
function hasPromptRequest(agent, requestId, promptDigest, promptApiKey) {
|
|
564
705
|
const matches = (message) => {
|
|
565
706
|
const source = message.source;
|
|
566
|
-
|
|
707
|
+
if (source.kind !== 'user' || !('rpcId' in source) || source.rpcId !== requestId)
|
|
708
|
+
return false;
|
|
709
|
+
if (source.promptDigest !== promptDigest) {
|
|
710
|
+
throw new RemoteError('session/request-id-conflict', 'This requestId already belongs to a different prompt', { requestId });
|
|
711
|
+
}
|
|
712
|
+
return true;
|
|
567
713
|
};
|
|
568
|
-
|
|
714
|
+
const queued = agent.inbox.nextTurn.find(matches);
|
|
715
|
+
if (queued !== undefined) {
|
|
716
|
+
if (promptApiKey !== undefined)
|
|
717
|
+
agent.restorePromptApiKey?.(queued, promptApiKey);
|
|
718
|
+
return true;
|
|
719
|
+
}
|
|
720
|
+
if (agent.inbox.nextStep.some(matches))
|
|
569
721
|
return true;
|
|
570
|
-
// oxlint-disable-next-line typescript/no-deprecated --
|
|
722
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Accepted prompts include claimed and discarded inbox items.
|
|
571
723
|
return agent.session.snapshotEvents().some((event) => {
|
|
572
|
-
if (event.type
|
|
573
|
-
return
|
|
574
|
-
|
|
575
|
-
|
|
724
|
+
if (event.type === 'user/message')
|
|
725
|
+
return matches(event.data);
|
|
726
|
+
return event.type === 'agent/inbox/spliced' && event.data.inserted.some((message) => {
|
|
727
|
+
const source = message.source;
|
|
728
|
+
return source.kind === 'user' && (promptDigest !== undefined || 'promptDigest' in source) && matches(message);
|
|
729
|
+
});
|
|
576
730
|
});
|
|
577
731
|
}
|
|
578
732
|
function imageBlockIn(content, match) {
|