@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
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { hostname } from "node:os";
|
|
2
2
|
import { isAbsolute, resolve } from "node:path";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
|
-
import { AssistantStreamAccumulator, ReasoningEffortId, assistantStreamChunks, createUserMessage, errorChain, freezeMessage } from "@deepseek-ai/dsh-llm";
|
|
4
|
+
import { AssistantStreamAccumulator, LlmError, ReasoningEffortId, assistantStreamChunks, createUserMessage, errorChain, freezeMessage, normalizeApiKey } from "@deepseek-ai/dsh-llm";
|
|
5
5
|
import { canOpenNativePath, nativeFileApplications, nativeFileManager, openNativeAssociatedPath, openNativeFileApplication, revealNativePath } from "@deepseek-ai/dsh-native-command";
|
|
6
6
|
import { SessionQueryError } from "@deepseek-ai/dsh-session-query";
|
|
7
7
|
import { Remote, RemoteError, TypertRemoteService, remoteErrorOf } from "@deepseek-ai/dsh-typert-protocol";
|
|
8
8
|
import { mkdir } from "node:fs/promises";
|
|
9
9
|
import { installModelSelection } from "@deepseek-ai/dsh-agent";
|
|
10
|
-
import { credentialRef } from "@deepseek-ai/dsh-credentials";
|
|
11
|
-
import { randomUUID } from "node:crypto";
|
|
10
|
+
import { credentialKey, credentialRef } from "@deepseek-ai/dsh-credentials";
|
|
11
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
12
12
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
13
13
|
import { AttachmentError } from "@deepseek-ai/dsh-attachment";
|
|
14
14
|
import { buildForkSeed } from "@deepseek-ai/dsh-session/fork";
|
|
15
15
|
import { SessionLogOffset, SessionSeq, isAppendSurfaceEvent } from "@deepseek-ai/dsh-session";
|
|
16
16
|
import { SessionTitleInvalidError } from "@deepseek-ai/dsh-session-title";
|
|
17
17
|
import { canonicalClientTimeZone } from "@deepseek-ai/dsh-util-time";
|
|
18
|
-
import { assertNever } from "@deepseek-ai/dsh-util-values";
|
|
18
|
+
import { assertNever, isJsonValue } from "@deepseek-ai/dsh-util-values";
|
|
19
|
+
import { Service } from "@deepseek-ai/cordis";
|
|
19
20
|
import { Deque } from "@deepseek-ai/dsh-deque";
|
|
20
21
|
import { z as z$1 } from "zod";
|
|
21
22
|
import { isUserInvocable } from "@deepseek-ai/dsh-skill";
|
|
@@ -188,6 +189,8 @@ var ApiSessionAgentController = class {
|
|
|
188
189
|
releaseWhenIdle = /* @__PURE__ */ new Set();
|
|
189
190
|
/** Sessions whose owned Agent is being released because the last follower closed. */
|
|
190
191
|
followerReleases = /* @__PURE__ */ new Set();
|
|
192
|
+
released = /* @__PURE__ */ new Set();
|
|
193
|
+
releases = /* @__PURE__ */ new Map();
|
|
191
194
|
/** @param ctx - Host context carrying Agent, model, persistence, and Typert services. */
|
|
192
195
|
constructor(ctx) {
|
|
193
196
|
this.ctx = ctx;
|
|
@@ -235,6 +238,53 @@ var ApiSessionAgentController = class {
|
|
|
235
238
|
return this.resolve(sessionId);
|
|
236
239
|
}
|
|
237
240
|
/**
|
|
241
|
+
* Drain one idle, controller-owned Agent and release its native writer lease.
|
|
242
|
+
* Released identities stay fenced from implicit activation until explicit create.
|
|
243
|
+
* @param sessionId - ordinary Session to hand to another client.
|
|
244
|
+
* @returns after the Agent scope and persistence handle have closed.
|
|
245
|
+
*/
|
|
246
|
+
releaseSession(sessionId) {
|
|
247
|
+
const pending = this.releases.get(sessionId);
|
|
248
|
+
if (pending !== void 0) return pending;
|
|
249
|
+
if (this.resumes.has(sessionId) || this.creations.has(sessionId)) return Promise.reject(new RemoteError("session/activation-pending", "session activation is still in progress", { sessionId }));
|
|
250
|
+
const handle = this.owned.get(sessionId);
|
|
251
|
+
const live = this.ctx.agents.get(sessionId);
|
|
252
|
+
if (live !== void 0 && (handle === void 0 || handle.agent !== live)) return Promise.reject(new RemoteError("session/not-owned", "session belongs to another lifecycle owner", { sessionId }));
|
|
253
|
+
if (live !== void 0 && (live.status !== "idle" || live.inbox.nextTurn.length > 0 || live.inbox.nextStep.length > 0)) return Promise.reject(new RemoteError("session/busy-release", "stop or finish pending work before handing off this session", { sessionId }));
|
|
254
|
+
this.released.add(sessionId);
|
|
255
|
+
const task = Promise.resolve().then(async () => {
|
|
256
|
+
if (handle !== void 0) {
|
|
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
|
+
} else {
|
|
265
|
+
const persistence = this.ctx.get("sessionPersistence");
|
|
266
|
+
if (persistence === void 0) throw new RemoteError("gateway/internal", "native Session persistence is unavailable", {});
|
|
267
|
+
try {
|
|
268
|
+
await (await persistence.open(sessionId, "write")).close();
|
|
269
|
+
} catch (error) {
|
|
270
|
+
if (error instanceof Error && error.name === "SessionAlreadyOwnedError") throw new RemoteError("session/writer-held", error.message, { sessionId });
|
|
271
|
+
throw error;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}).finally(() => {
|
|
275
|
+
this.releases.delete(sessionId);
|
|
276
|
+
});
|
|
277
|
+
this.releases.set(sessionId, task);
|
|
278
|
+
return task;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Reject late admission that resolved its Agent before writer release began.
|
|
282
|
+
* @param agent - Agent previously resolved for prompt admission.
|
|
283
|
+
*/
|
|
284
|
+
assertWritable(agent) {
|
|
285
|
+
if (this.released.has(agent.id) || this.ctx.agents.get(agent.id) !== agent) throw new RemoteError("session/not-owned", "session writer is no longer owned by this client", { sessionId: agent.id });
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
238
288
|
* Resolve one ordinary Session from an already-retained exact observation.
|
|
239
289
|
* @param observation - Host-owned observation whose preparation stays pinned through setup.
|
|
240
290
|
* @returns the live Agent or a stable Session-domain failure.
|
|
@@ -303,6 +353,7 @@ var ApiSessionAgentController = class {
|
|
|
303
353
|
}
|
|
304
354
|
}
|
|
305
355
|
async resolve(sessionId, observation) {
|
|
356
|
+
if (this.released.has(sessionId)) return { error: new RemoteError("session/writer-released", "session writer was released; explicitly resume it before sending", { sessionId }) };
|
|
306
357
|
const live = this.liveAgent(sessionId);
|
|
307
358
|
if (live !== void 0) return live;
|
|
308
359
|
const attached = this.ctx.sessions.get(sessionId);
|
|
@@ -329,17 +380,22 @@ var ApiSessionAgentController = class {
|
|
|
329
380
|
}
|
|
330
381
|
}
|
|
331
382
|
/**
|
|
332
|
-
*
|
|
383
|
+
* Ensure one requested identity, creating or resuming it once.
|
|
333
384
|
* @param sessionId - requested Session identity.
|
|
334
|
-
* @param cwd - directory the
|
|
385
|
+
* @param cwd - required directory, or undefined when strictly resuming the stored identity.
|
|
335
386
|
* @param checkPersistedIdentity - whether to inspect a cold identity before creation.
|
|
336
387
|
* @param presetId - optional Agent preset the Session must own.
|
|
388
|
+
* @param existingOnly - refuse a cold identity that does not exist instead of creating it.
|
|
389
|
+
* @param provider - optional provider override for the model selection.
|
|
390
|
+
* @param model - optional model override for the model selection.
|
|
337
391
|
* @returns the matching live ordinary Agent.
|
|
338
392
|
*/
|
|
339
|
-
async ensureSession(sessionId, cwd, checkPersistedIdentity, presetId) {
|
|
393
|
+
async ensureSession(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly = false, provider, model) {
|
|
394
|
+
const releasing = this.releases.get(sessionId);
|
|
395
|
+
if (releasing !== void 0) await releasing;
|
|
340
396
|
let creation = this.creations.get(sessionId);
|
|
341
397
|
if (creation === void 0) {
|
|
342
|
-
creation = this.createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId).catch((error) => {
|
|
398
|
+
creation = this.createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model).catch((error) => {
|
|
343
399
|
const live = this.ctx.agents.get(sessionId);
|
|
344
400
|
if (live !== void 0) {
|
|
345
401
|
if (hasApiSessionSubagentOwner(this.ctx, live.session, live)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
@@ -356,7 +412,8 @@ var ApiSessionAgentController = class {
|
|
|
356
412
|
const agent = await creation;
|
|
357
413
|
if (hasApiSessionSubagentOwner(this.ctx, agent.session, agent)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
358
414
|
if (presetId !== void 0) this.assertPresetUnchanged(sessionId, presetId, this.presetForSession(agent.session));
|
|
359
|
-
if (agent.session.header.cwd !== cwd) throw new ApiSessionCwdConflict(sessionId, cwd, agent.session.header.cwd);
|
|
415
|
+
if (cwd !== void 0 && agent.session.header.cwd !== cwd) throw new ApiSessionCwdConflict(sessionId, cwd, agent.session.header.cwd);
|
|
416
|
+
this.released.delete(sessionId);
|
|
360
417
|
return agent;
|
|
361
418
|
}
|
|
362
419
|
/**
|
|
@@ -483,7 +540,10 @@ var ApiSessionAgentController = class {
|
|
|
483
540
|
throw error;
|
|
484
541
|
}
|
|
485
542
|
}
|
|
486
|
-
|
|
543
|
+
/**
|
|
544
|
+
* Resume an observed Session, optionally with provider/model override.
|
|
545
|
+
*/
|
|
546
|
+
async resumeObserved(sessionId, observation, provider, model) {
|
|
487
547
|
if (observation.header.id !== sessionId || observation.header.cwd === void 0) throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
488
548
|
if (hasApiSessionSubagentOwner(this.ctx, { header: observation.header }, void 0)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
489
549
|
const composition = await this.composeAgent(this.presetForObservation(observation));
|
|
@@ -492,16 +552,16 @@ var ApiSessionAgentController = class {
|
|
|
492
552
|
if (published !== void 0 && hasApiSessionSubagentOwner(this.ctx, published, live)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
493
553
|
return (await this.remember(this.ctx.agents.resume({
|
|
494
554
|
resumeSessionId: sessionId,
|
|
495
|
-
agentOptions: this.agentOptions(),
|
|
555
|
+
agentOptions: this.agentOptions(provider, model),
|
|
496
556
|
setup: composition.setup
|
|
497
557
|
}))).agent;
|
|
498
558
|
}
|
|
499
|
-
async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId) {
|
|
559
|
+
async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model) {
|
|
500
560
|
const attached = this.ctx.sessions.get(sessionId);
|
|
501
561
|
const live = this.ctx.agents.get(sessionId);
|
|
502
562
|
if (attached !== void 0 && hasApiSessionSubagentOwner(this.ctx, attached, live)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
503
563
|
if (live !== void 0) return live;
|
|
504
|
-
if (checkPersistedIdentity) try {
|
|
564
|
+
if (checkPersistedIdentity || existingOnly) try {
|
|
505
565
|
const env_3 = {
|
|
506
566
|
stack: [],
|
|
507
567
|
error: void 0,
|
|
@@ -510,13 +570,13 @@ var ApiSessionAgentController = class {
|
|
|
510
570
|
try {
|
|
511
571
|
const observation = __addDisposableResource$4(env_3, await this.ctx.sessionQuery.observeSession(sessionId), false);
|
|
512
572
|
if (hasApiSessionSubagentOwner(this.ctx, { header: observation.header }, void 0)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
513
|
-
if (observation.header.cwd !== cwd) throw new ApiSessionCwdConflict(sessionId, cwd, observation.header.cwd);
|
|
573
|
+
if (cwd !== void 0 && observation.header.cwd !== cwd) throw new ApiSessionCwdConflict(sessionId, cwd, observation.header.cwd);
|
|
514
574
|
const storedPreset = this.presetForObservation(observation);
|
|
515
575
|
this.assertPresetUnchanged(sessionId, presetId, storedPreset);
|
|
516
576
|
const composition = await this.composeAgent(storedPreset);
|
|
517
577
|
return (await this.remember(this.ctx.agents.resume({
|
|
518
578
|
resumeSessionId: sessionId,
|
|
519
|
-
agentOptions: this.agentOptions(),
|
|
579
|
+
agentOptions: this.agentOptions(provider, model),
|
|
520
580
|
setup: composition.setup
|
|
521
581
|
}))).agent;
|
|
522
582
|
} catch (e_3) {
|
|
@@ -527,7 +587,9 @@ var ApiSessionAgentController = class {
|
|
|
527
587
|
}
|
|
528
588
|
} catch (error) {
|
|
529
589
|
if (!(error instanceof SessionQueryError) || error.code !== "SESSION_QUERY_SESSION_NOT_FOUND") throw error;
|
|
590
|
+
if (existingOnly || cwd === void 0) throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
530
591
|
}
|
|
592
|
+
if (cwd === void 0) throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
531
593
|
try {
|
|
532
594
|
await mkdir(cwd, { recursive: true });
|
|
533
595
|
} catch (error) {
|
|
@@ -536,7 +598,7 @@ var ApiSessionAgentController = class {
|
|
|
536
598
|
const composition = await this.composeAgent(presetId);
|
|
537
599
|
return (await this.remember(this.ctx.agents.create({
|
|
538
600
|
sessionId,
|
|
539
|
-
agentOptions: this.agentOptions(),
|
|
601
|
+
agentOptions: this.agentOptions(provider, model),
|
|
540
602
|
meta: {
|
|
541
603
|
cwd,
|
|
542
604
|
...composition.agentPreset === void 0 ? {} : { agentPreset: composition.agentPreset }
|
|
@@ -557,12 +619,16 @@ var ApiSessionAgentController = class {
|
|
|
557
619
|
this.owned.set(handle.agent.session.id, handle);
|
|
558
620
|
return handle;
|
|
559
621
|
}
|
|
560
|
-
agentOptions() {
|
|
561
|
-
|
|
562
|
-
return {
|
|
622
|
+
agentOptions(provider, model) {
|
|
623
|
+
if (provider !== void 0 && model !== void 0) return {
|
|
563
624
|
provider,
|
|
564
625
|
model
|
|
565
626
|
};
|
|
627
|
+
const { provider: defaultProvider, model: defaultModel } = this.ctx.agentDefaultModel.currentSelection();
|
|
628
|
+
return {
|
|
629
|
+
provider: defaultProvider,
|
|
630
|
+
model: defaultModel
|
|
631
|
+
};
|
|
566
632
|
}
|
|
567
633
|
installSelection(agent) {
|
|
568
634
|
this.selectionFor(agent);
|
|
@@ -680,7 +746,7 @@ async function modelAvailable(ctx, selection) {
|
|
|
680
746
|
async function hasProviderApiKey(ctx) {
|
|
681
747
|
const settings = ctx.get("settings");
|
|
682
748
|
const credentials = ctx.get("credentials");
|
|
683
|
-
if (settings === void 0 || credentials === void 0) throw new RemoteError("session/provider-credentials-unavailable", "provider credentials are unavailable", {});
|
|
749
|
+
if (settings === void 0 || credentials === void 0) throw new RemoteError("session/provider-credentials-unavailable", "provider credentials are unavailable — settings or credentials service is not composed", {});
|
|
684
750
|
const namespaces = settings.describe({ redactSecrets: true });
|
|
685
751
|
for (const provider of ctx.llm.listConfigurableProviders()) {
|
|
686
752
|
if (provider.provider === "deepseek-account") continue;
|
|
@@ -791,7 +857,13 @@ var SessionCommandController = class {
|
|
|
791
857
|
* @returns the Session identity and resolved preset when configured.
|
|
792
858
|
*/
|
|
793
859
|
async create(request) {
|
|
860
|
+
if (request.resumeOnly === true && !request.sessionId) throw new RemoteError("gateway/bad-request", "resumeOnly requires a sessionId", {});
|
|
794
861
|
if (request.workspaceId !== void 0 && request.cwd !== void 0) throw new RemoteError("gateway/bad-request", "session.create accepts workspaceId or cwd, not both", {});
|
|
862
|
+
this.ctx.logger.info("session-controller.commands: create", {
|
|
863
|
+
sessionId: request.sessionId,
|
|
864
|
+
workspaceId: request.workspaceId,
|
|
865
|
+
cwd: request.cwd
|
|
866
|
+
});
|
|
795
867
|
const sessionId = request.sessionId ?? brandString(`session-${randomUUID()}`);
|
|
796
868
|
let workspace;
|
|
797
869
|
if (request.workspaceId !== void 0) {
|
|
@@ -801,7 +873,7 @@ var SessionCommandController = class {
|
|
|
801
873
|
const cwd = workspace?.path ?? request.cwd ?? this.defaultCwd;
|
|
802
874
|
let adopted;
|
|
803
875
|
try {
|
|
804
|
-
adopted = await this.agents.ensureSession(sessionId, cwd, request.sessionId !== void 0, request.agentPreset);
|
|
876
|
+
adopted = await this.agents.ensureSession(sessionId, cwd, request.sessionId !== void 0, request.agentPreset, request.resumeOnly === true, request.provider, request.model);
|
|
805
877
|
} catch (error) {
|
|
806
878
|
this.rejectCreation(sessionId, error);
|
|
807
879
|
}
|
|
@@ -820,11 +892,17 @@ var SessionCommandController = class {
|
|
|
820
892
|
};
|
|
821
893
|
}
|
|
822
894
|
/**
|
|
823
|
-
* Validate
|
|
895
|
+
* Validate against the live registry and persist the default, then install one
|
|
896
|
+
* model selection before acknowledging success.
|
|
824
897
|
* @param request - Session identity and requested model selection.
|
|
825
898
|
* @returns the normalized selection after the shared save and Session selection succeed.
|
|
826
899
|
*/
|
|
827
900
|
async selectModel(request) {
|
|
901
|
+
this.ctx.logger.info("session-controller.commands: selectModel", {
|
|
902
|
+
sessionId: request.sessionId,
|
|
903
|
+
provider: request.provider,
|
|
904
|
+
model: request.model
|
|
905
|
+
});
|
|
828
906
|
const agent = await this.resolveAgent(request.sessionId);
|
|
829
907
|
return this.agents.serializeImageAdmission(agent, async () => {
|
|
830
908
|
try {
|
|
@@ -969,14 +1047,37 @@ var SessionCommandController = class {
|
|
|
969
1047
|
* @returns acknowledgement that the Agent accepted the prompt.
|
|
970
1048
|
*/
|
|
971
1049
|
async prompt(request) {
|
|
1050
|
+
this.ctx.logger.info("session-controller.commands: prompt", {
|
|
1051
|
+
sessionId: request.sessionId,
|
|
1052
|
+
mode: request.mode,
|
|
1053
|
+
provider: request.provider,
|
|
1054
|
+
model: request.model
|
|
1055
|
+
});
|
|
972
1056
|
if (!hasPromptContent(request.content)) throw new RemoteError("gateway/bad-request", "prompt content must include non-whitespace text or an attachment", {});
|
|
973
1057
|
const clientTimeZone = request.clientTimeZone === void 0 ? void 0 : canonicalClientTimeZone(request.clientTimeZone);
|
|
974
1058
|
if (request.clientTimeZone !== void 0 && clientTimeZone === void 0) throw new RemoteError("session/invalid-time-zone", "clientTimeZone must be UTC or a valid IANA Area/Location name", { value: request.clientTimeZone });
|
|
975
1059
|
const agent = await this.resolveAgent(request.sessionId);
|
|
976
|
-
|
|
1060
|
+
const modelConfig = request.modelConfig;
|
|
1061
|
+
const promptApiKey = modelConfig === void 0 ? void 0 : validatePromptModelConfig(request);
|
|
1062
|
+
const promptDigest = modelConfig === void 0 ? void 0 : digestPrompt(request);
|
|
1063
|
+
if (hasPromptRequest(agent, request.requestId, promptDigest, promptApiKey)) return { accepted: true };
|
|
1064
|
+
const promptConfig = modelConfig === void 0 ? void 0 : (() => {
|
|
1065
|
+
try {
|
|
1066
|
+
return this.ctx.llm.resolvePromptConfig(modelConfig);
|
|
1067
|
+
} catch (error) {
|
|
1068
|
+
if (!(error instanceof LlmError)) throw error;
|
|
1069
|
+
let field = error.code === "NO_ADAPTER" ? "provider" : error.code === "UNSUPPORTED_OPTION" ? error.message : "model";
|
|
1070
|
+
if (field.startsWith("protocolOptions.")) {
|
|
1071
|
+
const key = field.slice(16);
|
|
1072
|
+
if (Object.hasOwn(modelConfig.options, key)) field = `options.${key}`;
|
|
1073
|
+
}
|
|
1074
|
+
throw invalidModelConfig(`modelConfig.${field}`);
|
|
1075
|
+
}
|
|
1076
|
+
})();
|
|
977
1077
|
const source = {
|
|
978
1078
|
kind: "user",
|
|
979
1079
|
rpcId: request.requestId,
|
|
1080
|
+
...promptDigest === void 0 ? {} : { promptDigest },
|
|
980
1081
|
...clientTimeZone === void 0 ? {} : { clientTimeZone }
|
|
981
1082
|
};
|
|
982
1083
|
const hasImage = request.content.some((part) => part.type === "image");
|
|
@@ -988,27 +1089,38 @@ var SessionCommandController = class {
|
|
|
988
1089
|
hasError: false
|
|
989
1090
|
};
|
|
990
1091
|
try {
|
|
991
|
-
|
|
1092
|
+
const hasProviderModel = request.provider !== void 0 && request.model !== void 0;
|
|
1093
|
+
if (hasProviderModel) this.agents.selectForNextRequest(agent, {
|
|
1094
|
+
provider: request.provider,
|
|
1095
|
+
model: request.model
|
|
1096
|
+
});
|
|
1097
|
+
else if (promptConfig === void 0 && this.ctx.agentDefaultModel.usesSharedPreference()) {
|
|
992
1098
|
const route = await this.ctx.agentDefaultModel.resolveSelection();
|
|
993
1099
|
if (route.provider === "" || route.model === "") throw new RemoteError("session/model-unavailable", "the selected model is unavailable; select a model before sending a message", {
|
|
994
1100
|
provider: route.provider,
|
|
995
1101
|
model: route.model
|
|
996
1102
|
});
|
|
997
1103
|
}
|
|
998
|
-
if (hasImage) {
|
|
1104
|
+
if (hasImage && promptConfig === void 0 && !hasProviderModel) {
|
|
999
1105
|
const current = this.agents.selectionFor(agent).current;
|
|
1000
1106
|
const model = await this.ctx.llm.resolveModelInfo(current.provider, current.model);
|
|
1001
1107
|
if (model.inputModalities !== void 0 && !model.inputModalities.includes("image")) throw new RemoteError("session/attachment-invalid", `Model "${current.model}" does not support image input.`, { reason: "MODEL_DOES_NOT_SUPPORT_IMAGES" });
|
|
1002
1108
|
}
|
|
1003
1109
|
const admission = resolvePromptFileReceipts(request.content, (receiptId) => this.ctx.fileUploads.resolve(agent, receiptId));
|
|
1110
|
+
const content = await this.ctx.attachments.admitPromptContent(admission.content);
|
|
1111
|
+
if (promptDigest !== void 0 && hasPromptRequest(agent, request.requestId, promptDigest, promptApiKey)) return { accepted: true };
|
|
1004
1112
|
const message = createUserMessage({
|
|
1005
|
-
content
|
|
1006
|
-
source
|
|
1113
|
+
content,
|
|
1114
|
+
source,
|
|
1115
|
+
...promptConfig === void 0 ? {} : { promptConfig },
|
|
1116
|
+
...promptApiKey === void 0 ? {} : { promptApiKeyRequired: true }
|
|
1007
1117
|
});
|
|
1008
1118
|
if (this.ctx.agents.get(agent.id) !== agent) throw new RemoteError("session/not-found", `session "${agent.id}" was disposed during prompt admission`, { sessionId: agent.id });
|
|
1009
1119
|
const binding = __addDisposableResource$3(env_2, this.ctx.fileUploads.bindPrompt(agent, admission.receiptIds, request.requestId), false);
|
|
1120
|
+
this.agents.assertWritable(agent);
|
|
1010
1121
|
if (request.mode === "steer") agent.steer(message);
|
|
1011
|
-
else agent.followup(message);
|
|
1122
|
+
else if (promptApiKey === void 0) agent.followup(message);
|
|
1123
|
+
else agent.followup(message, promptApiKey);
|
|
1012
1124
|
binding.commit();
|
|
1013
1125
|
} catch (e_2) {
|
|
1014
1126
|
env_2.error = e_2;
|
|
@@ -1091,6 +1203,7 @@ var SessionCommandController = class {
|
|
|
1091
1203
|
};
|
|
1092
1204
|
if (located === void 0) throw new RemoteError("session/queue-item-not-found", "queued item is no longer pending", { itemId: request.itemId });
|
|
1093
1205
|
const { target, message } = located;
|
|
1206
|
+
if (request.action.kind === "steer" && message.promptConfig !== void 0) throw invalidModelConfig("mode");
|
|
1094
1207
|
if (request.action.kind === "steer" && (target !== "next-turn" || agent.status !== "running")) throw new RemoteError("session/steer-unavailable", "current turn no longer accepts steering", { itemId: request.itemId });
|
|
1095
1208
|
switch (request.action.kind) {
|
|
1096
1209
|
case "edit":
|
|
@@ -1120,12 +1233,44 @@ var SessionCommandController = class {
|
|
|
1120
1233
|
* @returns acknowledgement that cancellation was requested.
|
|
1121
1234
|
*/
|
|
1122
1235
|
cancel(request) {
|
|
1236
|
+
this.ctx.logger.info("session-controller.commands: cancel", { sessionId: request.sessionId });
|
|
1123
1237
|
const agent = this.ctx.agents.get(request.sessionId);
|
|
1124
1238
|
if (agent === void 0) throw new RemoteError("session/not-found", `session "${request.sessionId}" not found (not attached)`, { sessionId: request.sessionId });
|
|
1125
1239
|
if (hasApiSessionSubagentOwner(this.ctx, agent.session, agent)) throw apiSessionSubagentOwnershipError(request.sessionId);
|
|
1126
1240
|
agent.cancel({ kind: "user" }, { keepInbox: true });
|
|
1127
1241
|
return { accepted: true };
|
|
1128
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Resume an existing Session, optionally with provider/model overrides.
|
|
1245
|
+
* The Session must already exist in persistence. This is separate from create
|
|
1246
|
+
* so desktop AI workbenches can re-inject provider/model after Runtime restart.
|
|
1247
|
+
* @param request - Session identity and optional provider/model override.
|
|
1248
|
+
* @returns the Session identity and resolved model selection.
|
|
1249
|
+
*/
|
|
1250
|
+
async resume(request) {
|
|
1251
|
+
const sessionId = request.sessionId;
|
|
1252
|
+
try {
|
|
1253
|
+
const agent = await this.agents.ensureSession(sessionId, void 0, true, void 0, true, request.provider, request.model);
|
|
1254
|
+
const selection = this.agents.selectionFor(agent);
|
|
1255
|
+
if (request.provider !== void 0 && request.model !== void 0 && (selection.current.provider !== request.provider || selection.current.model !== request.model)) this.agents.selectForNextRequest(agent, {
|
|
1256
|
+
provider: request.provider,
|
|
1257
|
+
model: request.model
|
|
1258
|
+
});
|
|
1259
|
+
const current = selection.current;
|
|
1260
|
+
return {
|
|
1261
|
+
sessionId,
|
|
1262
|
+
selected: {
|
|
1263
|
+
provider: current.provider,
|
|
1264
|
+
model: current.model,
|
|
1265
|
+
...current.reasoningEffort === void 0 ? {} : { reasoningEffort: current.reasoningEffort }
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
} catch (error) {
|
|
1269
|
+
if (error instanceof RemoteError) throw error;
|
|
1270
|
+
if (error instanceof ApiSessionNotFound) throw new RemoteError("session/not-found", error.message, { sessionId });
|
|
1271
|
+
throw new RemoteError("gateway/internal", `failed to resume session "${sessionId}": ${String(error)}`, {});
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1129
1274
|
async resolveAgent(sessionId) {
|
|
1130
1275
|
const found = await this.agents.resolveAgent(sessionId);
|
|
1131
1276
|
if ("error" in found) throw found.error;
|
|
@@ -1134,6 +1279,7 @@ var SessionCommandController = class {
|
|
|
1134
1279
|
rejectCreation(sessionId, error) {
|
|
1135
1280
|
if (remoteErrorOf(error) !== void 0) throw error;
|
|
1136
1281
|
if (error instanceof Error && error.name === "SessionAlreadyOwnedError") throw new RemoteError("session/writer-held", error.message, { sessionId });
|
|
1282
|
+
if (error instanceof ApiSessionNotFound) throw new RemoteError("session/not-found", error.message, { sessionId });
|
|
1137
1283
|
if (error instanceof ApiSessionPresetConflict) throw new RemoteError("agent-preset/conflict", error.message, {
|
|
1138
1284
|
sessionId: error.sessionId,
|
|
1139
1285
|
requestedPreset: error.requestedPreset,
|
|
@@ -1188,16 +1334,76 @@ function resolvePromptFileReceipts(content, stagedFile) {
|
|
|
1188
1334
|
receiptIds: [...receiptIds]
|
|
1189
1335
|
};
|
|
1190
1336
|
}
|
|
1191
|
-
function
|
|
1337
|
+
function invalidModelConfig(field) {
|
|
1338
|
+
return new RemoteError("session/invalid-model-config", "Invalid or unsupported prompt model configuration", { field });
|
|
1339
|
+
}
|
|
1340
|
+
function validatePromptModelConfig(request) {
|
|
1341
|
+
const config = request.modelConfig;
|
|
1342
|
+
if (request.mode !== "queue") throw invalidModelConfig("mode");
|
|
1343
|
+
if (request.provider !== void 0 || request.model !== void 0) throw invalidModelConfig("modelConfig");
|
|
1344
|
+
const object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1345
|
+
if (config === void 0 || !object(config) || !isJsonValue(config) || Object.keys(config).some((key) => ![
|
|
1346
|
+
"provider",
|
|
1347
|
+
"model",
|
|
1348
|
+
"protocol",
|
|
1349
|
+
"options",
|
|
1350
|
+
"protocolOptions",
|
|
1351
|
+
"apiKey"
|
|
1352
|
+
].includes(key)) || Buffer.byteLength(JSON.stringify(config)) > 16384) throw invalidModelConfig("modelConfig");
|
|
1353
|
+
for (const key of [
|
|
1354
|
+
"provider",
|
|
1355
|
+
"model",
|
|
1356
|
+
"protocol"
|
|
1357
|
+
]) {
|
|
1358
|
+
const value = config[key];
|
|
1359
|
+
if (key === "protocol" && value === void 0) continue;
|
|
1360
|
+
if (typeof value !== "string" || value.trim() === "") throw invalidModelConfig(`modelConfig.${key}`);
|
|
1361
|
+
}
|
|
1362
|
+
if (!object(config.options)) throw invalidModelConfig("modelConfig.options");
|
|
1363
|
+
if (config.protocolOptions !== void 0 && !object(config.protocolOptions)) throw invalidModelConfig("modelConfig.protocolOptions");
|
|
1364
|
+
if (config.apiKey === void 0) return void 0;
|
|
1365
|
+
if (typeof config.apiKey !== "string") throw invalidModelConfig("modelConfig.apiKey");
|
|
1366
|
+
const key = normalizeApiKey(config.apiKey);
|
|
1367
|
+
if (!key.ok) throw invalidModelConfig("modelConfig.apiKey");
|
|
1368
|
+
return key.value;
|
|
1369
|
+
}
|
|
1370
|
+
function digestPrompt(request) {
|
|
1371
|
+
const { apiKey, ...config } = request.modelConfig ?? {};
|
|
1372
|
+
const fingerprintConfig = apiKey === void 0 ? config : {
|
|
1373
|
+
...config,
|
|
1374
|
+
promptApiKeyRequired: true
|
|
1375
|
+
};
|
|
1376
|
+
const body = JSON.stringify([
|
|
1377
|
+
request.mode,
|
|
1378
|
+
request.content,
|
|
1379
|
+
request.clientTimeZone ?? null,
|
|
1380
|
+
fingerprintConfig
|
|
1381
|
+
], (_key, value) => {
|
|
1382
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
|
|
1383
|
+
const record = { ...value };
|
|
1384
|
+
return Object.fromEntries(Object.keys(record).sort().map((key) => [key, record[key]]));
|
|
1385
|
+
});
|
|
1386
|
+
return createHash("sha256").update(body).digest("hex");
|
|
1387
|
+
}
|
|
1388
|
+
function hasPromptRequest(agent, requestId, promptDigest, promptApiKey) {
|
|
1192
1389
|
const matches = (message) => {
|
|
1193
1390
|
const source = message.source;
|
|
1194
|
-
|
|
1391
|
+
if (source.kind !== "user" || !("rpcId" in source) || source.rpcId !== requestId) return false;
|
|
1392
|
+
if (source.promptDigest !== promptDigest) throw new RemoteError("session/request-id-conflict", "This requestId already belongs to a different prompt", { requestId });
|
|
1393
|
+
return true;
|
|
1195
1394
|
};
|
|
1196
|
-
|
|
1395
|
+
const queued = agent.inbox.nextTurn.find(matches);
|
|
1396
|
+
if (queued !== void 0) {
|
|
1397
|
+
if (promptApiKey !== void 0) agent.restorePromptApiKey?.(queued, promptApiKey);
|
|
1398
|
+
return true;
|
|
1399
|
+
}
|
|
1400
|
+
if (agent.inbox.nextStep.some(matches)) return true;
|
|
1197
1401
|
return agent.session.snapshotEvents().some((event) => {
|
|
1198
|
-
if (event.type
|
|
1199
|
-
|
|
1200
|
-
|
|
1402
|
+
if (event.type === "user/message") return matches(event.data);
|
|
1403
|
+
return event.type === "agent/inbox/spliced" && event.data.inserted.some((message) => {
|
|
1404
|
+
const source = message.source;
|
|
1405
|
+
return source.kind === "user" && (promptDigest !== void 0 || "promptDigest" in source) && matches(message);
|
|
1406
|
+
});
|
|
1201
1407
|
});
|
|
1202
1408
|
}
|
|
1203
1409
|
function imageBlockIn(content, match) {
|
|
@@ -1253,6 +1459,82 @@ function referencedImage(events, attachmentId) {
|
|
|
1253
1459
|
}
|
|
1254
1460
|
}
|
|
1255
1461
|
//#endregion
|
|
1462
|
+
//#region lib/types/login-token-store.js
|
|
1463
|
+
/**
|
|
1464
|
+
* Login token store for desktop-injected ChatCode OAuth tokens.
|
|
1465
|
+
*
|
|
1466
|
+
* Stores login tokens (obtained by the desktop AI workbench via OAuth) into
|
|
1467
|
+
* the existing credentials service as GrantRecords, using the same credential
|
|
1468
|
+
* key that ChatCodeAuthService reads from. This means the existing auth bundle
|
|
1469
|
+
* automatically picks up desktop-injected tokens without modification.
|
|
1470
|
+
*
|
|
1471
|
+
* The storage format matches ChatCodeAuthService's AccountState:
|
|
1472
|
+
* payload: { version: 2, grant: { version: 1, accessToken, refreshToken?, ... } }
|
|
1473
|
+
*
|
|
1474
|
+
* Runtime crash → token is preserved in the credentials service on disk.
|
|
1475
|
+
* Desktop does NOT need to re-prompt the user for OAuth.
|
|
1476
|
+
*
|
|
1477
|
+
* @module @deepseek-ai/dsh-login-token-store
|
|
1478
|
+
*/
|
|
1479
|
+
/**
|
|
1480
|
+
* The ChatCode credential key shared with ChatCodeAuthService.
|
|
1481
|
+
* Must match cco-llm-chatcode-config/src/chatcode-auth.ts CHATCODE_CREDENTIAL_KEY.
|
|
1482
|
+
*/
|
|
1483
|
+
const CHATCODE_CREDENTIAL_KEY = credentialKey("chatcode-auth", "default");
|
|
1484
|
+
/**
|
|
1485
|
+
* Owns the login token store backed by the credentials service.
|
|
1486
|
+
*
|
|
1487
|
+
* Tokens are stored as GrantRecords in the same credential key used by
|
|
1488
|
+
* ChatCodeAuthService. This ensures that status/accessToken/refreshToken
|
|
1489
|
+
* automatically reads desktop-injected tokens without any modification to
|
|
1490
|
+
* the auth bundle.
|
|
1491
|
+
*/
|
|
1492
|
+
var LoginTokenStore = class extends Service {
|
|
1493
|
+
constructor(ctx) {
|
|
1494
|
+
super(ctx, "loginTokenStore");
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Store a ChatCode OAuth grant with accessToken and optional metadata.
|
|
1498
|
+
* Replaces any existing grant for the same key using ChatCodeAuthService's
|
|
1499
|
+
* payload format: { version: 2, grant: { version: 1, accessToken, ... } }.
|
|
1500
|
+
*
|
|
1501
|
+
* refreshToken defaults to accessToken when not provided, so ChatCodeAuthService
|
|
1502
|
+
* can use it as a self-refresh credential when the provider does not issue a
|
|
1503
|
+
* separate refresh token (implicit/OAuth PKCE flows).
|
|
1504
|
+
*/
|
|
1505
|
+
async set(input) {
|
|
1506
|
+
await this.ctx.credentials.modifyRecord(CHATCODE_CREDENTIAL_KEY, async () => {
|
|
1507
|
+
return {
|
|
1508
|
+
kind: "grant",
|
|
1509
|
+
payload: {
|
|
1510
|
+
version: 2,
|
|
1511
|
+
grant: {
|
|
1512
|
+
version: 1,
|
|
1513
|
+
accessToken: input.accessToken,
|
|
1514
|
+
refreshToken: input.refreshToken ?? input.accessToken,
|
|
1515
|
+
...input.longToken === void 0 ? {} : { longToken: input.longToken },
|
|
1516
|
+
...input.expiresAtMs === void 0 ? {} : { expiresAtMs: input.expiresAtMs },
|
|
1517
|
+
...input.userName === void 0 ? {} : { userName: input.userName },
|
|
1518
|
+
...input.emailAddress === void 0 ? {} : { emailAddress: input.emailAddress }
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
};
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Remove the ChatCode OAuth token from the credentials service.
|
|
1526
|
+
*/
|
|
1527
|
+
async delete() {
|
|
1528
|
+
await this.ctx.credentials.deleteRecord(CHATCODE_CREDENTIAL_KEY);
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* Check whether a ChatCode OAuth token exists.
|
|
1532
|
+
*/
|
|
1533
|
+
async has() {
|
|
1534
|
+
return await this.ctx.credentials.readRecord(CHATCODE_CREDENTIAL_KEY) !== void 0;
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
//#endregion
|
|
1256
1538
|
//#region lib/types/control.js
|
|
1257
1539
|
/** Live Session projection state with reconnect baselines. */
|
|
1258
1540
|
/** Owns the Host-wide Session control stream. */
|
|
@@ -1703,7 +1985,7 @@ var SessionHistoryController = class {
|
|
|
1703
1985
|
rejectNotFound(address);
|
|
1704
1986
|
}
|
|
1705
1987
|
try {
|
|
1706
|
-
validateAddress(address, observation.header, observation.inheritedEventCount, observation.projections);
|
|
1988
|
+
validateAddress(address, observation.header, observation.inheritedEventCount, observation.projections, address.kind === "subagent" && observation.source === "live" && !observation.events.some((event) => event.seq >= observation.inheritedEventCount && event.type === "subagent/descriptor"));
|
|
1707
1989
|
} catch (error) {
|
|
1708
1990
|
observation[Symbol.dispose]();
|
|
1709
1991
|
throw error;
|
|
@@ -1751,17 +2033,17 @@ function validateHistoryWindow(request) {
|
|
|
1751
2033
|
function addressId(address) {
|
|
1752
2034
|
return address.kind === "session" ? address.sessionId : address.childSessionId;
|
|
1753
2035
|
}
|
|
1754
|
-
function validateAddress(address, header, inheritedEventCount, projections) {
|
|
2036
|
+
function validateAddress(address, header, inheritedEventCount, projections, descriptorPending) {
|
|
1755
2037
|
if (address.kind === "session") {
|
|
1756
2038
|
if (header.origin === "subagent") throw new RemoteError("session/agent-busy", "subagent Sessions require their durable parent address", { reason: "use subagent delivery for this child session" });
|
|
1757
2039
|
return;
|
|
1758
2040
|
}
|
|
1759
2041
|
if (header.origin !== "subagent" || header.parentSession !== address.parentSessionId) throw new RemoteError("subagent/unauthorized", "subagent does not belong to the supplied parent", { childSessionId: address.childSessionId });
|
|
1760
2042
|
const identity = projections?.values.subagent;
|
|
1761
|
-
if (identity === null) throw new RemoteError("subagent/catalog-diagnostic", "subagent descriptor is corrupt", {
|
|
2043
|
+
if (identity === null) throw new RemoteError("subagent/catalog-diagnostic", descriptorPending ? "subagent descriptor is not ready" : "subagent descriptor is corrupt", {
|
|
1762
2044
|
parentSessionId: address.parentSessionId,
|
|
1763
2045
|
childSessionId: address.childSessionId,
|
|
1764
|
-
reason: "corrupt"
|
|
2046
|
+
reason: descriptorPending ? "unavailable" : "corrupt"
|
|
1765
2047
|
});
|
|
1766
2048
|
if (identity === void 0 || identity.seq < inheritedEventCount) throw new RemoteError("subagent/catalog-diagnostic", "subagent descriptor is unavailable", {
|
|
1767
2049
|
parentSessionId: address.parentSessionId,
|
|
@@ -2776,14 +3058,23 @@ let SessionController = (() => {
|
|
|
2776
3058
|
let _list_decorators;
|
|
2777
3059
|
let _search_decorators;
|
|
2778
3060
|
let _create_decorators;
|
|
3061
|
+
let _workspaceAccess_decorators;
|
|
3062
|
+
let _setWorkspaceAccess_decorators;
|
|
3063
|
+
let _toolCatalog_decorators;
|
|
3064
|
+
let _release_decorators;
|
|
3065
|
+
let _setLoginToken_decorators;
|
|
3066
|
+
let _clearLoginToken_decorators;
|
|
3067
|
+
let _resume_decorators;
|
|
2779
3068
|
let _selectModel_decorators;
|
|
2780
3069
|
let _initializeDefaultModel_decorators;
|
|
2781
3070
|
let _modelCatalog_decorators;
|
|
3071
|
+
let _refreshModelCatalog_decorators;
|
|
2782
3072
|
let _canOpenWorkspacePath_decorators;
|
|
2783
3073
|
let _openWorkspacePath_decorators;
|
|
2784
3074
|
let _workspacePathApplications_decorators;
|
|
2785
3075
|
let _rename_decorators;
|
|
2786
3076
|
let _fork_decorators;
|
|
3077
|
+
let _promptModelConfig_decorators;
|
|
2787
3078
|
let _prompt_decorators;
|
|
2788
3079
|
let _attachment_decorators;
|
|
2789
3080
|
let _updateQueue_decorators;
|
|
@@ -2798,14 +3089,23 @@ let SessionController = (() => {
|
|
|
2798
3089
|
_list_decorators = [Remote("list")];
|
|
2799
3090
|
_search_decorators = [Remote("search")];
|
|
2800
3091
|
_create_decorators = [Remote("create")];
|
|
3092
|
+
_workspaceAccess_decorators = [Remote("workspaceAccess")];
|
|
3093
|
+
_setWorkspaceAccess_decorators = [Remote("setWorkspaceAccess")];
|
|
3094
|
+
_toolCatalog_decorators = [Remote("toolCatalog")];
|
|
3095
|
+
_release_decorators = [Remote("release")];
|
|
3096
|
+
_setLoginToken_decorators = [Remote("setLoginToken")];
|
|
3097
|
+
_clearLoginToken_decorators = [Remote("clearLoginToken")];
|
|
3098
|
+
_resume_decorators = [Remote("resume")];
|
|
2801
3099
|
_selectModel_decorators = [Remote("selectModel")];
|
|
2802
3100
|
_initializeDefaultModel_decorators = [Remote];
|
|
2803
3101
|
_modelCatalog_decorators = [Remote("modelCatalog")];
|
|
3102
|
+
_refreshModelCatalog_decorators = [Remote("refreshModelCatalog")];
|
|
2804
3103
|
_canOpenWorkspacePath_decorators = [Remote];
|
|
2805
3104
|
_openWorkspacePath_decorators = [Remote("openWorkspacePath")];
|
|
2806
3105
|
_workspacePathApplications_decorators = [Remote("workspacePathApplications")];
|
|
2807
3106
|
_rename_decorators = [Remote("rename")];
|
|
2808
3107
|
_fork_decorators = [Remote("fork")];
|
|
3108
|
+
_promptModelConfig_decorators = [Remote("promptModelConfig")];
|
|
2809
3109
|
_prompt_decorators = [Remote("prompt")];
|
|
2810
3110
|
_attachment_decorators = [Remote("attachment")];
|
|
2811
3111
|
_updateQueue_decorators = [Remote("updateQueue")];
|
|
@@ -2847,6 +3147,83 @@ let SessionController = (() => {
|
|
|
2847
3147
|
},
|
|
2848
3148
|
metadata: _metadata
|
|
2849
3149
|
}, null, _instanceExtraInitializers);
|
|
3150
|
+
__esDecorate(this, null, _workspaceAccess_decorators, {
|
|
3151
|
+
kind: "method",
|
|
3152
|
+
name: "workspaceAccess",
|
|
3153
|
+
static: false,
|
|
3154
|
+
private: false,
|
|
3155
|
+
access: {
|
|
3156
|
+
has: (obj) => "workspaceAccess" in obj,
|
|
3157
|
+
get: (obj) => obj.workspaceAccess
|
|
3158
|
+
},
|
|
3159
|
+
metadata: _metadata
|
|
3160
|
+
}, null, _instanceExtraInitializers);
|
|
3161
|
+
__esDecorate(this, null, _setWorkspaceAccess_decorators, {
|
|
3162
|
+
kind: "method",
|
|
3163
|
+
name: "setWorkspaceAccess",
|
|
3164
|
+
static: false,
|
|
3165
|
+
private: false,
|
|
3166
|
+
access: {
|
|
3167
|
+
has: (obj) => "setWorkspaceAccess" in obj,
|
|
3168
|
+
get: (obj) => obj.setWorkspaceAccess
|
|
3169
|
+
},
|
|
3170
|
+
metadata: _metadata
|
|
3171
|
+
}, null, _instanceExtraInitializers);
|
|
3172
|
+
__esDecorate(this, null, _toolCatalog_decorators, {
|
|
3173
|
+
kind: "method",
|
|
3174
|
+
name: "toolCatalog",
|
|
3175
|
+
static: false,
|
|
3176
|
+
private: false,
|
|
3177
|
+
access: {
|
|
3178
|
+
has: (obj) => "toolCatalog" in obj,
|
|
3179
|
+
get: (obj) => obj.toolCatalog
|
|
3180
|
+
},
|
|
3181
|
+
metadata: _metadata
|
|
3182
|
+
}, null, _instanceExtraInitializers);
|
|
3183
|
+
__esDecorate(this, null, _release_decorators, {
|
|
3184
|
+
kind: "method",
|
|
3185
|
+
name: "release",
|
|
3186
|
+
static: false,
|
|
3187
|
+
private: false,
|
|
3188
|
+
access: {
|
|
3189
|
+
has: (obj) => "release" in obj,
|
|
3190
|
+
get: (obj) => obj.release
|
|
3191
|
+
},
|
|
3192
|
+
metadata: _metadata
|
|
3193
|
+
}, null, _instanceExtraInitializers);
|
|
3194
|
+
__esDecorate(this, null, _setLoginToken_decorators, {
|
|
3195
|
+
kind: "method",
|
|
3196
|
+
name: "setLoginToken",
|
|
3197
|
+
static: false,
|
|
3198
|
+
private: false,
|
|
3199
|
+
access: {
|
|
3200
|
+
has: (obj) => "setLoginToken" in obj,
|
|
3201
|
+
get: (obj) => obj.setLoginToken
|
|
3202
|
+
},
|
|
3203
|
+
metadata: _metadata
|
|
3204
|
+
}, null, _instanceExtraInitializers);
|
|
3205
|
+
__esDecorate(this, null, _clearLoginToken_decorators, {
|
|
3206
|
+
kind: "method",
|
|
3207
|
+
name: "clearLoginToken",
|
|
3208
|
+
static: false,
|
|
3209
|
+
private: false,
|
|
3210
|
+
access: {
|
|
3211
|
+
has: (obj) => "clearLoginToken" in obj,
|
|
3212
|
+
get: (obj) => obj.clearLoginToken
|
|
3213
|
+
},
|
|
3214
|
+
metadata: _metadata
|
|
3215
|
+
}, null, _instanceExtraInitializers);
|
|
3216
|
+
__esDecorate(this, null, _resume_decorators, {
|
|
3217
|
+
kind: "method",
|
|
3218
|
+
name: "resume",
|
|
3219
|
+
static: false,
|
|
3220
|
+
private: false,
|
|
3221
|
+
access: {
|
|
3222
|
+
has: (obj) => "resume" in obj,
|
|
3223
|
+
get: (obj) => obj.resume
|
|
3224
|
+
},
|
|
3225
|
+
metadata: _metadata
|
|
3226
|
+
}, null, _instanceExtraInitializers);
|
|
2850
3227
|
__esDecorate(this, null, _selectModel_decorators, {
|
|
2851
3228
|
kind: "method",
|
|
2852
3229
|
name: "selectModel",
|
|
@@ -2880,6 +3257,17 @@ let SessionController = (() => {
|
|
|
2880
3257
|
},
|
|
2881
3258
|
metadata: _metadata
|
|
2882
3259
|
}, null, _instanceExtraInitializers);
|
|
3260
|
+
__esDecorate(this, null, _refreshModelCatalog_decorators, {
|
|
3261
|
+
kind: "method",
|
|
3262
|
+
name: "refreshModelCatalog",
|
|
3263
|
+
static: false,
|
|
3264
|
+
private: false,
|
|
3265
|
+
access: {
|
|
3266
|
+
has: (obj) => "refreshModelCatalog" in obj,
|
|
3267
|
+
get: (obj) => obj.refreshModelCatalog
|
|
3268
|
+
},
|
|
3269
|
+
metadata: _metadata
|
|
3270
|
+
}, null, _instanceExtraInitializers);
|
|
2883
3271
|
__esDecorate(this, null, _canOpenWorkspacePath_decorators, {
|
|
2884
3272
|
kind: "method",
|
|
2885
3273
|
name: "canOpenWorkspacePath",
|
|
@@ -2935,6 +3323,17 @@ let SessionController = (() => {
|
|
|
2935
3323
|
},
|
|
2936
3324
|
metadata: _metadata
|
|
2937
3325
|
}, null, _instanceExtraInitializers);
|
|
3326
|
+
__esDecorate(this, null, _promptModelConfig_decorators, {
|
|
3327
|
+
kind: "method",
|
|
3328
|
+
name: "promptModelConfig",
|
|
3329
|
+
static: false,
|
|
3330
|
+
private: false,
|
|
3331
|
+
access: {
|
|
3332
|
+
has: (obj) => "promptModelConfig" in obj,
|
|
3333
|
+
get: (obj) => obj.promptModelConfig
|
|
3334
|
+
},
|
|
3335
|
+
metadata: _metadata
|
|
3336
|
+
}, null, _instanceExtraInitializers);
|
|
2938
3337
|
__esDecorate(this, null, _prompt_decorators, {
|
|
2939
3338
|
kind: "method",
|
|
2940
3339
|
name: "prompt",
|
|
@@ -3063,6 +3462,7 @@ let SessionController = (() => {
|
|
|
3063
3462
|
constructor(ctx, config, internals = {}) {
|
|
3064
3463
|
super(ctx, "sessionController", { namespace: "session" });
|
|
3065
3464
|
installModelSelectionProjection(ctx);
|
|
3465
|
+
ctx.plugin(LoginTokenStore);
|
|
3066
3466
|
this.agents = new ApiSessionAgentController(ctx);
|
|
3067
3467
|
this.commands = new SessionCommandController(ctx, this.agents, process.cwd());
|
|
3068
3468
|
ctx.effect(() => ctx.fileUploads.registerAgentResolver(async (sessionId) => {
|
|
@@ -3177,7 +3577,12 @@ let SessionController = (() => {
|
|
|
3177
3577
|
* @returns visible Session summaries ordered by activity.
|
|
3178
3578
|
*/
|
|
3179
3579
|
async list(_request, signal) {
|
|
3180
|
-
|
|
3580
|
+
try {
|
|
3581
|
+
return { items: await this.listState.list(signal) };
|
|
3582
|
+
} catch (error) {
|
|
3583
|
+
if (error instanceof RemoteError) throw error;
|
|
3584
|
+
throw new RemoteError("session/list-failed", "failed to list sessions", {});
|
|
3585
|
+
}
|
|
3181
3586
|
}
|
|
3182
3587
|
/**
|
|
3183
3588
|
* Search visible Session content without resuming an Agent.
|
|
@@ -3186,7 +3591,12 @@ let SessionController = (() => {
|
|
|
3186
3591
|
* @returns authorized bounded Session search results.
|
|
3187
3592
|
*/
|
|
3188
3593
|
search(request, signal) {
|
|
3189
|
-
|
|
3594
|
+
try {
|
|
3595
|
+
return this.listState.search(request.query, signal);
|
|
3596
|
+
} catch (error) {
|
|
3597
|
+
if (error instanceof RemoteError) throw error;
|
|
3598
|
+
throw new RemoteError("session/search-failed", "failed to search sessions", {});
|
|
3599
|
+
}
|
|
3190
3600
|
}
|
|
3191
3601
|
/**
|
|
3192
3602
|
* Create or idempotently adopt one ordinary Session.
|
|
@@ -3194,15 +3604,155 @@ let SessionController = (() => {
|
|
|
3194
3604
|
* @returns the Session identity and resolved preset when configured.
|
|
3195
3605
|
*/
|
|
3196
3606
|
async create(request) {
|
|
3607
|
+
this.ctx.logger.info("session-controller: create", {
|
|
3608
|
+
sessionId: request.sessionId,
|
|
3609
|
+
cwd: request.cwd,
|
|
3610
|
+
workspaceId: request.workspaceId
|
|
3611
|
+
});
|
|
3197
3612
|
if (request.sessionId !== void 0) await this.assertNotDeleted(request.sessionId);
|
|
3198
3613
|
return this.commands.create(request);
|
|
3199
3614
|
}
|
|
3200
3615
|
/**
|
|
3616
|
+
* Read the effective Runtime sandbox and approval policy for a Session.
|
|
3617
|
+
* @param request - existing Session identity; cold Sessions may resume.
|
|
3618
|
+
* @returns the active sandbox, durable preset name and approval mode.
|
|
3619
|
+
*/
|
|
3620
|
+
async workspaceAccess(request) {
|
|
3621
|
+
if (!request.sessionId) throw new RemoteError("gateway/bad-request", "sessionId is required", {});
|
|
3622
|
+
await this.assertNotDeleted(request.sessionId);
|
|
3623
|
+
const result = await this.agents.resolveAgent(request.sessionId);
|
|
3624
|
+
if ("error" in result) throw result.error;
|
|
3625
|
+
const presets = this.ctx.get("permissionPresets");
|
|
3626
|
+
if (!presets) throw new RemoteError("session/capability-unavailable", "Permission presets are not composed", {});
|
|
3627
|
+
const preset = presets.current(result.agent.session);
|
|
3628
|
+
const spec = presets.resolve(preset);
|
|
3629
|
+
return {
|
|
3630
|
+
mode: spec.sandbox,
|
|
3631
|
+
preset,
|
|
3632
|
+
approval: spec.approval
|
|
3633
|
+
};
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* Change the durable permission state used by the Web picker, between tasks only.
|
|
3637
|
+
* @param request - existing Session identity and requested workspace access.
|
|
3638
|
+
* @returns the actual policy after persistence; active work or queued inputs are refused.
|
|
3639
|
+
*/
|
|
3640
|
+
async setWorkspaceAccess(request) {
|
|
3641
|
+
if (![
|
|
3642
|
+
"read-only",
|
|
3643
|
+
"workspace-write",
|
|
3644
|
+
"danger-full-access"
|
|
3645
|
+
].includes(request.mode)) throw new RemoteError("gateway/bad-request", "Unknown workspace access", {});
|
|
3646
|
+
await this.assertNotDeleted(request.sessionId);
|
|
3647
|
+
const result = await this.agents.resolveAgent(request.sessionId);
|
|
3648
|
+
if ("error" in result) throw result.error;
|
|
3649
|
+
const agent = result.agent;
|
|
3650
|
+
return this.agents.serializeImageAdmission(agent, async () => {
|
|
3651
|
+
this.agents.assertWritable(agent);
|
|
3652
|
+
if (agent.status !== "idle" || agent.inbox.nextStep.length || agent.inbox.nextTurn.length) throw new RemoteError("session/agent-busy", "Stop or finish the task before changing workspace access", { reason: String(agent.id) });
|
|
3653
|
+
const presets = this.ctx.get("permissionPresets");
|
|
3654
|
+
if (!presets) throw new RemoteError("session/capability-unavailable", "Permission presets are not composed", {});
|
|
3655
|
+
presets.set(agent.session, request.mode);
|
|
3656
|
+
return this.workspaceAccess({ sessionId: request.sessionId });
|
|
3657
|
+
});
|
|
3658
|
+
}
|
|
3659
|
+
/**
|
|
3660
|
+
* Read the executable Tool names in one resolved Agent scope.
|
|
3661
|
+
* @param request - existing Session identity; cold Sessions may resume.
|
|
3662
|
+
* @returns enabled Tool names and descriptions, without execution callbacks.
|
|
3663
|
+
*/
|
|
3664
|
+
async toolCatalog(request) {
|
|
3665
|
+
if (!request.sessionId) throw new RemoteError("gateway/bad-request", "sessionId is required", {});
|
|
3666
|
+
await this.assertNotDeleted(request.sessionId);
|
|
3667
|
+
const result = await this.agents.resolveAgent(request.sessionId);
|
|
3668
|
+
if ("error" in result) throw result.error;
|
|
3669
|
+
const tools = this.ctx.get("tools");
|
|
3670
|
+
if (!tools) throw new RemoteError("session/capability-unavailable", "Tools are not composed", {});
|
|
3671
|
+
return tools.schemas(result.agent).map(({ name, description }) => ({
|
|
3672
|
+
name,
|
|
3673
|
+
description
|
|
3674
|
+
}));
|
|
3675
|
+
}
|
|
3676
|
+
/**
|
|
3677
|
+
* Release an idle Session's writer without stopping other Sessions.
|
|
3678
|
+
* @param request - ordinary Session identity owned by this controller.
|
|
3679
|
+
* @returns acknowledgement after persistence has drained and unlocked.
|
|
3680
|
+
*/
|
|
3681
|
+
async release(request) {
|
|
3682
|
+
try {
|
|
3683
|
+
await this.agents.releaseSession(request.sessionId);
|
|
3684
|
+
return { released: true };
|
|
3685
|
+
} catch (error) {
|
|
3686
|
+
if (error instanceof RemoteError) throw error;
|
|
3687
|
+
throw new RemoteError("session/release-failed", `failed to release session "${request.sessionId}"`, { sessionId: request.sessionId });
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
/**
|
|
3691
|
+
* Inject a ChatCode OAuth grant into the credentials service.
|
|
3692
|
+
*
|
|
3693
|
+
* The desktop AI workbench calls this after completing OAuth to provide the
|
|
3694
|
+
* access token and optional metadata (refreshToken, expiry, user info).
|
|
3695
|
+
* The grant is stored in the credentials service (persisted to disk, encrypted)
|
|
3696
|
+
* using the same credential key as ChatCodeAuthService, so the auth bundle
|
|
3697
|
+
* automatically reads it without any modification.
|
|
3698
|
+
*
|
|
3699
|
+
* Token expiry is detected by API 401 responses, not by local clock.
|
|
3700
|
+
* When the token expires, the LLM adapter returns API 401 naturally.
|
|
3701
|
+
*
|
|
3702
|
+
* @param request - ChatCode OAuth grant fields.
|
|
3703
|
+
* @returns confirmation.
|
|
3704
|
+
*/
|
|
3705
|
+
async setLoginToken(request) {
|
|
3706
|
+
if (!request.accessToken || typeof request.accessToken !== "string") throw new RemoteError("gateway/bad-request", "accessToken is required", {});
|
|
3707
|
+
try {
|
|
3708
|
+
await this.ctx.loginTokenStore.set(request);
|
|
3709
|
+
this.ctx.logger.info("session-controller: setLoginToken", { hasRefreshToken: request.refreshToken !== void 0 });
|
|
3710
|
+
return { ok: true };
|
|
3711
|
+
} catch (error) {
|
|
3712
|
+
this.ctx.logger.error("session-controller: setLoginToken failed", { error: String(error) });
|
|
3713
|
+
if (error instanceof RemoteError) throw error;
|
|
3714
|
+
throw new RemoteError("session/login-token-store-failed", `login token could not be stored: ${String(error)}`, {});
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
/**
|
|
3718
|
+
* Remove the ChatCode OAuth token from the credentials service.
|
|
3719
|
+
* @param _request - unused (no params needed).
|
|
3720
|
+
* @returns confirmation.
|
|
3721
|
+
*/
|
|
3722
|
+
async clearLoginToken(_request) {
|
|
3723
|
+
try {
|
|
3724
|
+
await this.ctx.loginTokenStore.delete();
|
|
3725
|
+
this.ctx.logger.info("session-controller: clearLoginToken");
|
|
3726
|
+
return { ok: true };
|
|
3727
|
+
} catch (error) {
|
|
3728
|
+
this.ctx.logger.error("session-controller: clearLoginToken failed", { error: String(error) });
|
|
3729
|
+
if (error instanceof RemoteError) throw error;
|
|
3730
|
+
throw new RemoteError("session/login-token-delete-failed", `login token could not be deleted: ${String(error)}`, {});
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
/**
|
|
3734
|
+
* Resume an existing Session, optionally with provider/model overrides.
|
|
3735
|
+
* The Session must already exist in persistence. Desktop AI workbenches use
|
|
3736
|
+
* this after Runtime restart to re-inject the model selection.
|
|
3737
|
+
* @param request - Session identity and optional provider/model override.
|
|
3738
|
+
* @returns the Session identity and resolved model selection.
|
|
3739
|
+
*/
|
|
3740
|
+
resume(request) {
|
|
3741
|
+
if (!request.sessionId) throw new RemoteError("gateway/bad-request", "sessionId is required", {});
|
|
3742
|
+
this.ctx.logger.info("session-controller: resume", { sessionId: request.sessionId });
|
|
3743
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.resume(request));
|
|
3744
|
+
}
|
|
3745
|
+
/**
|
|
3201
3746
|
* Select a model after explicitly resuming the Session and awaiting default persistence.
|
|
3202
3747
|
* @param request - Session identity and requested model selection.
|
|
3203
3748
|
* @returns the normalized selection after the shared save and Session selection succeed.
|
|
3204
3749
|
*/
|
|
3205
3750
|
selectModel(request) {
|
|
3751
|
+
this.ctx.logger.info("session-controller: selectModel", {
|
|
3752
|
+
sessionId: request.sessionId,
|
|
3753
|
+
provider: request.provider,
|
|
3754
|
+
model: request.model
|
|
3755
|
+
});
|
|
3206
3756
|
return this.assertNotDeleted(request.sessionId).then(() => this.commands.selectModel(request));
|
|
3207
3757
|
}
|
|
3208
3758
|
/**
|
|
@@ -3228,6 +3778,21 @@ let SessionController = (() => {
|
|
|
3228
3778
|
* @returns provider-grouped models, the deployment default, and isolated provider failures.
|
|
3229
3779
|
*/
|
|
3230
3780
|
modelCatalog() {
|
|
3781
|
+
try {
|
|
3782
|
+
return buildModelCatalog(this.ctx);
|
|
3783
|
+
} catch (error) {
|
|
3784
|
+
if (error instanceof RemoteError) throw error;
|
|
3785
|
+
throw new RemoteError("session/model-catalog-failed", "failed to build model catalog", {});
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
/** Refresh account-owned catalogs before returning safe model names and routes.
|
|
3789
|
+
* @returns the current registry catalog; refresh failures reject without changing Session selection.
|
|
3790
|
+
*/
|
|
3791
|
+
async refreshModelCatalog() {
|
|
3792
|
+
this.ctx.logger.info("session-controller: refreshModelCatalog", {});
|
|
3793
|
+
const catalog = this.ctx.get("chatcodeModelCatalog");
|
|
3794
|
+
if (catalog === void 0) throw new RemoteError("gateway/internal", "ChatCode model catalog service is unavailable", {});
|
|
3795
|
+
await catalog.refresh();
|
|
3231
3796
|
return buildModelCatalog(this.ctx);
|
|
3232
3797
|
}
|
|
3233
3798
|
/**
|
|
@@ -3235,7 +3800,11 @@ let SessionController = (() => {
|
|
|
3235
3800
|
* @returns true when the matching open operation is available.
|
|
3236
3801
|
*/
|
|
3237
3802
|
canOpenWorkspacePath() {
|
|
3238
|
-
|
|
3803
|
+
try {
|
|
3804
|
+
return this.canOpenPath();
|
|
3805
|
+
} catch {
|
|
3806
|
+
return false;
|
|
3807
|
+
}
|
|
3239
3808
|
}
|
|
3240
3809
|
/**
|
|
3241
3810
|
* Describe the serving desktop for authenticated file-action routes.
|
|
@@ -3303,6 +3872,7 @@ let SessionController = (() => {
|
|
|
3303
3872
|
* @returns the accepted title and durable event sequence.
|
|
3304
3873
|
*/
|
|
3305
3874
|
rename(request) {
|
|
3875
|
+
this.ctx.logger.info("session-controller: rename", { sessionId: request.sessionId });
|
|
3306
3876
|
return this.assertNotDeleted(request.sessionId).then(() => this.commands.rename(request));
|
|
3307
3877
|
}
|
|
3308
3878
|
/**
|
|
@@ -3313,9 +3883,21 @@ let SessionController = (() => {
|
|
|
3313
3883
|
* @returns the new Session identity.
|
|
3314
3884
|
*/
|
|
3315
3885
|
fork(request) {
|
|
3886
|
+
this.ctx.logger.info("session-controller: fork", { sessionId: request.sessionId });
|
|
3316
3887
|
return this.assertNotDeleted(request.sessionId).then(() => this.commands.fork(request));
|
|
3317
3888
|
}
|
|
3318
3889
|
/**
|
|
3890
|
+
* Advertise support for request-local model configuration.
|
|
3891
|
+
* @returns Supported model configuration version.
|
|
3892
|
+
*/
|
|
3893
|
+
promptModelConfig() {
|
|
3894
|
+
return {
|
|
3895
|
+
version: 1,
|
|
3896
|
+
requestApiKey: true,
|
|
3897
|
+
unifiedOptions: true
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
3900
|
+
/**
|
|
3319
3901
|
* Admit one prompt after explicitly resuming its Session.
|
|
3320
3902
|
* @param request - Session identity, prompt content, source metadata, and delivery mode.
|
|
3321
3903
|
* @param signal - caller cancellation before prompt admission begins.
|
|
@@ -3323,6 +3905,10 @@ let SessionController = (() => {
|
|
|
3323
3905
|
*/
|
|
3324
3906
|
prompt(request, signal) {
|
|
3325
3907
|
signal.throwIfAborted();
|
|
3908
|
+
this.ctx.logger.info("session-controller: prompt", {
|
|
3909
|
+
sessionId: request.sessionId,
|
|
3910
|
+
mode: request.mode
|
|
3911
|
+
});
|
|
3326
3912
|
return this.assertNotDeleted(request.sessionId).then(() => this.commands.prompt(request));
|
|
3327
3913
|
}
|
|
3328
3914
|
/**
|
|
@@ -3347,6 +3933,7 @@ let SessionController = (() => {
|
|
|
3347
3933
|
* @returns acknowledgement that cancellation was requested.
|
|
3348
3934
|
*/
|
|
3349
3935
|
cancel(request) {
|
|
3936
|
+
this.ctx.logger.info("session-controller: cancel", { sessionId: request.sessionId });
|
|
3350
3937
|
return this.commands.cancel(request);
|
|
3351
3938
|
}
|
|
3352
3939
|
/**
|
|
@@ -3377,7 +3964,7 @@ let SessionController = (() => {
|
|
|
3377
3964
|
}
|
|
3378
3965
|
async assertNotDeleted(sessionId) {
|
|
3379
3966
|
await this.ctx.workspaceRegistry.refresh();
|
|
3380
|
-
if (this.ctx.workspaceRegistry.deletedSessionIds.includes(sessionId)) throw new RemoteError("session/
|
|
3967
|
+
if (this.ctx.workspaceRegistry.deletedSessionIds.includes(sessionId)) throw new RemoteError("session/deleted", "Session has been permanently deleted", { sessionId });
|
|
3381
3968
|
}
|
|
3382
3969
|
/**
|
|
3383
3970
|
* Read all registered projections without activating an Agent.
|
|
@@ -3420,8 +4007,13 @@ let SessionController = (() => {
|
|
|
3420
4007
|
* @param signal - cancellation owned by the Remote stream carrier.
|
|
3421
4008
|
* @returns one complete baseline followed by live replacement frames.
|
|
3422
4009
|
*/
|
|
3423
|
-
control(signal) {
|
|
3424
|
-
|
|
4010
|
+
async *control(signal) {
|
|
4011
|
+
try {
|
|
4012
|
+
yield* this.controlState.control(signal);
|
|
4013
|
+
} catch (error) {
|
|
4014
|
+
this.ctx.logger.error("session-controller: control stream failed", { error: String(error) });
|
|
4015
|
+
throw error;
|
|
4016
|
+
}
|
|
3425
4017
|
}
|
|
3426
4018
|
};
|
|
3427
4019
|
})();
|