@chatcode/chatcode-cli 3.0.5 → 3.0.6-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +6 -6
- package/README.md +7 -0
- package/README.zh.md +7 -0
- package/lib/bin.js +19 -5
- package/lib/{command-errors-CnbcOM1a.js → command-errors-vCFKCJFq.js} +12 -12
- package/lib/{command-trees-CU7BxVJo.js → command-trees-N2_LR4f-.js} +2 -2
- package/lib/{component-identity-kZK1_hFy.js → component-identity-CaV_MmmE.js} +3 -3
- package/lib/desktop-history-B0iUekXf.js +72 -0
- package/lib/desktop-history-DvgkONgj.js +2 -0
- package/lib/{dump-config-D8kXfdTs.js → dump-config-CgIYHBp2.js} +1 -1
- package/lib/dump-config-D6TruNva.js +2 -0
- package/lib/{dump-config-schema-CtZbroi6.js → dump-config-schema-GiAtkJwx.js} +2 -2
- package/lib/{extension-events-hLxwPvpg.js → extension-events-B5qKP0-X.js} +20 -20
- package/lib/{host-access-kT-u85k_.js → host-access-BRXW3V8i.js} +1 -1
- package/lib/{keymap-DS1M8sDo.js → keymap-BYjklwli.js} +2 -2
- package/lib/{plugin-CYw-MBRn.js → plugin-BACkrsVG.js} +1 -1
- package/lib/{plugin-d65VulBk.js → plugin-VYAv2o0K.js} +498 -348
- package/lib/{profile-boot-CffsubnV.js → profile-boot-c5YKtUIb.js} +17 -4
- package/lib/profile-boot.js +1 -1
- package/lib/{scenes-DG6T8t-A.js → scenes-B-iDMpgW.js} +3 -3
- package/lib/{settings-sections-2SuE0biI.js → settings-sections-CYCrZKUk.js} +3 -3
- package/lib/{statusBarSettings-B2MEAwnI.js → statusBarSettings-Cu-b_o4Q.js} +3 -3
- package/lib/{themes-DUO7kGW-.js → themes-DC9GpV6q.js} +12 -12
- package/lib/tui-compat-command-trees.js +1 -1
- package/lib/tui-compat-extensions.js +3 -3
- package/lib/tui-compat-plugin-host.js +5 -5
- package/lib/tui-compat-scenes.js +1 -1
- package/lib/tui-compat-settings-sections.js +1 -1
- package/lib/tui-compat-working-activity.js +1 -1
- package/lib/tui-compat-workspaces.js +1 -1
- package/lib/tui-compat.js +6 -6
- package/lib/types/args.d.ts +8 -1
- package/lib/types/desktop-history.d.ts +31 -0
- package/lib/types/installed-bin.d.ts +9 -0
- package/lib/{workspaces-CLOkL_yE.js → workspaces-BchdRzlw.js} +2 -2
- package/package.json +26 -26
- package/runtime/manifest.json +3 -2
- package/runtime/node_modules/@chatcode/runtime-client/README.md +225 -0
- package/runtime/node_modules/@chatcode/runtime-client/desktop-history-guard.mjs +65 -0
- package/runtime/node_modules/@chatcode/runtime-client/desktop-history.mjs +278 -0
- package/runtime/node_modules/@chatcode/runtime-client/desktop-permission-gate.mjs +28 -0
- package/runtime/node_modules/@chatcode/runtime-client/execution.mjs +593 -0
- package/runtime/node_modules/@chatcode/runtime-client/index.d.ts +449 -0
- package/runtime/node_modules/@chatcode/runtime-client/model-preferences.mjs +57 -0
- package/runtime/node_modules/@chatcode/runtime-client/package.json +53 -0
- package/runtime/node_modules/@chatcode/runtime-client/runtime-connector.mjs +736 -0
- package/runtime/node_modules/@chatcode/runtime-client/session-activity.mjs +121 -0
- package/runtime/node_modules/@chatcode/runtime-client/session-browser.mjs +122 -0
- package/runtime/node_modules/@chatcode/runtime-client/stdio-bridge.mjs +103 -0
- package/runtime/node_modules/@chatcode/runtime-client/user-questions.mjs +108 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/journal.d.ts +69 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/journal.d.ts.map +1 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/patch.d.ts +68 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-include/lib/types/patch.d.ts.map +1 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/resolve.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/resolve.d.ts.map +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/index.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/model-selection.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/model-selection.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/runtime-types.d.ts +12 -3
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +69 -17
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/invariant.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/types/agent.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/types/inbox.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/access.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/access.js +164 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +460 -79
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +636 -44
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +483 -55
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.d.ts +19 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +377 -40
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +24 -4
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +97 -15
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.d.ts +11 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +172 -18
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.js +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.js +80 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.d.ts +104 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +294 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.d.ts +105 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.js +297 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history.js +4 -4
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +88 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +230 -6
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/login-token-store.d.ts +64 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/login-token-store.js +79 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.d.ts +45 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.js +289 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.js +112 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +93 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.d.ts +25 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.js +139 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.js +101 -0
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/bundle-platform.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/startup-diagnostics.d.ts +38 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/client/socket.d.ts +50 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/connect-protocol.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-connection/lib/types/peer.d.ts +36 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/de.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/es.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/fr.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/ja.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/pt.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-locale/lib/types/locales/ru.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/assets.d.ts +51 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/client/notify.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-modules/lib/types/client/release-change.d.ts +44 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/types/client/CreatePluginMenuItem.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/types/client/analytics.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/types/client/ApprovalCard.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/types/client/ApprovalWarning.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/PixelWhale.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/artwork.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/code-fill.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/types/client/home-whale/renderer.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/ChatFlow.d.ts +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/ReasoningContent.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/RunningStatus.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/RunningWhaleTail.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/UserContent.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/flow-motion.d.ts +110 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/text-interaction.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/chat/text-selection.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/contract/group-tree.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/conversation-nodes/group-tree-segments.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/file-path.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/client/reasoning-text.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/types/client/option-groups.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/text-interaction.d.ts +31 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/user-text.d.ts +60 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/interaction-registry.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/user-text-document.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/conversation/user-text-registry.d.ts +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/draft.d.ts +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/CommandChip.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/QuoteNode.d.ts +61 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/command-chip-node.d.ts +87 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/editor/command-chip-selection.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/prompt.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/submission-analytics.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/UserText.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/session-reference-rule.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/user-text/whitespace-rules.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/view-pins.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/types/client/GoalCommandReference.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/types/client/user-text-rules.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/provider-order.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/context-menus.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/open-toast.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/outcome.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/types/client/session-open-with.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/BundleDetailSection.d.ts +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/PluginRefreshToast.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/detail-store.d.ts +76 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/header-scroll.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/sanitize-install-input.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/tab-ledger.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/types/client/versions.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/AnimatedRows.module.css +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CommandText.module.css +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DetailDocument.module.css +67 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/InlineEditor.module.css +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/MenuGroup.module.css +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/QuotePreview.module.css +101 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/RowDragPreview.module.css +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/UserMessageBubble.module.css +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ZoomControls.module.css +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/AnimatedRows.d.ts +49 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CommandText.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DetailDocument.d.ts +78 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DraggableImage.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/HoverCardGroup.d.ts +25 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/InlineEditor.d.ts +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuGroup.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuRow.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/QuotePreview.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SubmenuPanel.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/UserMessageBubble.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ZoomControls.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/document-zoom.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/file-drag-actions.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/artwork.d.ts +426 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/image-drag.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/copy-tex.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/quote-text.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/windows-path-destinations.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/menu-submenu-position.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/tooltip-placement.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/use-clipboard-copy.d.ts +14 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useMenuSubmenu.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useRowDragPreview.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/types/client/FileReference.d.ts +29 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/types/client/user-text-rules.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/NewSessionLimit.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/RuleSelectRow.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/ScheduleEmptyIllustration.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/TaskEditorFields.d.ts +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/TaskRuleControls.d.ts +50 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/clear-ended.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/editor-store.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/editor-timing.d.ts +47 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/types/client/task-record.d.ts +30 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/account-avatar.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/browser-login.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/client/notice-transition.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/onboarding-settings.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/DesktopChannelRow.d.ts +31 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/HostReleasePrompt.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/desktop-channel-source.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/ApiKeyInput.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/ModelReasoningEfforts.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/useModelRows.d.ts +41 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/PanelIcon.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/panel-pins.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/types/client/scroll-handoff.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.frontmatter-fields.js +5768 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/PreviewFrame.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/image/pan.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/markdown/frontmatter-fields.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/markdown/frontmatter.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/FileNavigator.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/FileTree.d.ts +114 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/NavigatorToggle.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/navigator-layout.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/types/client/workspace-tree.d.ts +51 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/shell/TabMenuContent.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/shell/flash.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/tabs/guide/GuideMoreIcon.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/types/client/tabs/guide/guide-pins.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/types/client/SkillReference.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/types/client/user-text-rules.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/types/client/slots.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/FontFamilyRow.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/FontSettingsGroup.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/types/client/icon-sprite.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/components/ExitCodeBadge.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/components/QuestionToolRow.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/file-menu.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/types/client/tool/models/recorded-path.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/types/client/watch-tool-result.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/types/types.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/types/client/QuestionReplyView.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/types/client/question-reply.d.ts +74 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/contract/toast.d.ts +67 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/path-suffix.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/WorkspaceDialogs.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/SessionMenu.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/context-menus.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/toast/Toast.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/toast/register.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.d.ts +46 -0
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.js +39 -0
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +11 -8
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/index.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +10 -10
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/types/locales.d.ts +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/MicrophonePicker.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/failure-text.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/types/client/microphone-device.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-headless/lib/{json-stream-Bh4BGGk9.js → json-stream-Dc3g2Bl1.js} +11 -7
- package/runtime/node_modules/@deepseek-ai/dsh-hmr/lib/types/module-files.d.ts +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-hmr/lib/types/package-manifest.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/index.js +241 -64
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +26 -11
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.remote-client.js +3 -3
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.js +5 -1
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.d.ts +30 -6
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +109 -8
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/message.d.ts +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/prompt-protocol-options.d.ts +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/prompt-protocol-options.js +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/types.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +19 -7
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/config.d.ts +3 -3
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/credential.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listed-catalog.d.ts +56 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing-cache.d.ts +71 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing-config.d.ts +48 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/listing.d.ts +91 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocol-adapter.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/types/config.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/types/config.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +149 -28
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/adapter.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/prompt-options.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/provider-data.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/provider-data.generated.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/types/types.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/credentials.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/deadline.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/diagnostic.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/generation.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/probe.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/status.d.ts +87 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/templates.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/types.d.ts +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +4 -4
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/bundle-detail.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/bundle-detail.js +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.js +72 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/git-transport.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/git-transport.js +65 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.js +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/versions.d.ts +40 -0
- package/runtime/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/versions.js +61 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/config.d.ts +38 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/configuration.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/async-function.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/index.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/repl.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/types.d.ts +68 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/vm-script-await.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/evaluators/vm-script.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/execution.d.ts +66 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/evaluation-ended.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/module-hooks.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/imports/vm-modules.d.ts +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/persistent-process-entry.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/persistent-process.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/policy-processes.d.ts +30 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/rpc.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/types/worker.d.ts +66 -0
- package/runtime/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +215 -9
- package/runtime/node_modules/@deepseek-ai/dsh-sandbox/lib/types/locales.d.ts +41 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types/acl-skill.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/{types-Ci-q7_aQ.js → types-DwkEVVWZ.js} +357 -81
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-activity.d.ts +43 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-content.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/query-input.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/types/user-questions.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/index.js +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/request-header.js +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/types.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/CopyToast.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/copy-controller.d.ts +76 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/markdown.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +197 -9
- package/runtime/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.d.ts +112 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.js +112 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.d.ts +232 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +1250 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.d.ts +56 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.js +96 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.d.ts +49 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.js +130 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/types/linux-scope-selector.d.ts +60 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +215 -9
- package/runtime/node_modules/@deepseek-ai/dsh-token-meter/lib/types/measurement-projection.d.ts +74 -0
- package/runtime/node_modules/@deepseek-ai/dsh-token-meter/lib/types/measurement-projection.js +94 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-ask-user/lib/types/timed.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +31 -1
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch-output.d.ts +140 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch-presentation.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/apply-patch.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/mutation-result.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/execute.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/index.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/plan.d.ts +52 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/preflight.d.ts +18 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-fs/lib/types/patch/types.d.ts +106 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent/lib/types/preset-selection.d.ts +36 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/wait-agent.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/wait-agent.js +104 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/batch.d.ts +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/batch.js +246 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/contracts.d.ts +376 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/contracts.js +51 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/events.d.ts +58 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/events.js +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/executor.d.ts +90 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/executor.js +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/pipeline.d.ts +154 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tools/lib/types/pipeline.js +701 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/principal.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/principal.js +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-access.d.ts +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-access.js +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.js +143 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/projection.d.ts +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/projection.js +298 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/timed-wait.d.ts +37 -0
- package/runtime/node_modules/@deepseek-ai/dsh-user-questions/lib/types/timed-wait.js +85 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/cron.d.ts +54 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/duration.d.ts +61 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/instant.d.ts +145 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/recurrence.d.ts +38 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-time/lib/types/rrule.d.ts +34 -0
- package/runtime/node_modules/@deepseek-ai/dsh-util-values/lib/types/partial-json.d.ts +152 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-app/lib/types/public-url.d.ts +16 -0
- package/lib/dump-config-DuCc-QB7.js +0 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.d.ts +0 -26
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.js +0 -61
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/watch-config.d.ts +0 -13
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/types/ImageLightbox.d.ts +0 -27
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/contract/queue.d.ts +0 -9
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/types/client/input/queue-store.d.ts +0 -20
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/ProducedFiles.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/icons.d.ts +0 -8
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/OnboardingSurface.module.css +0 -29
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/OnboardingSurface.d.ts +0 -11
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/settings-contract.d.ts +0 -86
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/settings-scope.d.ts +0 -141
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/desktop-update-bridge.d.ts +0 -23
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/AgentLoopCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/BashCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/ConfigurablePluginsTab.d.ts +0 -19
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/PluginCard.d.ts +0 -42
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/PluginConfigForm.d.ts +0 -34
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentLimitsFields.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentModelSelectionCard.d.ts +0 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/SubagentModelSelectionFields.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/WebSearchCard.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/agent-loop-card-controller.d.ts +0 -43
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/bash-card-controller.d.ts +0 -45
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/card-form.d.ts +0 -171
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/fields.d.ts +0 -69
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/slot-contract.d.ts +0 -31
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-card-controller.d.ts +0 -32
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-limits-card-controller.d.ts +0 -33
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/subagent-model-selection-card-controller.d.ts +0 -129
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/tab-store.d.ts +0 -65
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/types/client/web-search-card-controller.d.ts +0 -93
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/code/languages.d.ts +0 -9
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/icons.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/types/client/pdf/PdfBody.d.ts +0 -24
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/types/client/TerminalBody.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/types/client/subagent-lineage.d.ts +0 -21
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/subagent-lineage.d.ts +0 -21
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/defaults.d.ts +0 -24
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/file-id.d.ts +0 -19
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/file-store.d.ts +0 -86
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/files-api.d.ts +0 -111
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/image-tokens.d.ts +0 -34
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/messages-api.d.ts +0 -10
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/model-info.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/models.d.ts +0 -4
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-extensions.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-files.d.ts +0 -49
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/request-pricing.d.ts +0 -60
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/types.d.ts +0 -119
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/common/upload-index.d.ts +0 -68
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/adapter.d.ts +0 -45
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/serialize.d.ts +0 -78
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/sse.d.ts +0 -24
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/translate.d.ts +0 -37
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/chat-completions/types.d.ts +0 -178
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/adapter.d.ts +0 -47
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/images.d.ts +0 -35
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/replay.d.ts +0 -27
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/serialize.d.ts +0 -18
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/sse.d.ts +0 -8
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/translate.d.ts +0 -14
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/transport.d.ts +0 -15
- package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocols/messages/types.d.ts +0 -62
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.d.ts +0 -19
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.js +0 -30
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.d.ts +0 -35
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.js +0 -68
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.d.ts +0 -10
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.js +0 -22
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/invariant.d.ts +0 -16
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/invariant.js +0 -41
- package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-DGV26RBf.js +0 -1525
- package/runtime/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-UEJ3Ntqn.js +0 -1511
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/fiber-state.d.ts +0 -28
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/fiber-state.js +0 -25
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/inspect.d.ts +0 -93
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/inspect.js +0 -303
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/prompt.d.ts +0 -3
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/prompt.js +0 -5
|
@@ -190,8 +190,15 @@ declare module './types.ts' {
|
|
|
190
190
|
* Queue an ordinary follow-up turn and wake the driver. The item becomes the
|
|
191
191
|
* sole ordinary message of its own turn.
|
|
192
192
|
* @param message - identified prompt content and the source that supplied it.
|
|
193
|
+
* @param promptApiKey - optional in-memory credential for the prompt's turn.
|
|
193
194
|
*/
|
|
194
|
-
followup(message: UserMessage): void;
|
|
195
|
+
followup(message: UserMessage, promptApiKey?: string): void;
|
|
196
|
+
/**
|
|
197
|
+
* Reattach a credential to its pending prompt after restoring the Session.
|
|
198
|
+
* @param message - matching durable prompt.
|
|
199
|
+
* @param apiKey - supplied again by the original caller.
|
|
200
|
+
*/
|
|
201
|
+
restorePromptApiKey?(message: UserMessage, apiKey: string): void;
|
|
195
202
|
/**
|
|
196
203
|
* Submit steering for the nearest step. An idle driver starts a turn;
|
|
197
204
|
* a running driver consumes it at its next step boundary.
|
|
@@ -311,6 +318,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
311
318
|
* `next()` preserves the current messages.
|
|
312
319
|
* @param payload.agent - the agent proposing the step.
|
|
313
320
|
* @param payload.messages - messages removed from the inbox for this step.
|
|
321
|
+
* @param payload.promptConfig - optional call configuration owned by the turn's queued prompt.
|
|
314
322
|
* @param payload.turn - the turn that will own the step.
|
|
315
323
|
* @param payload.step - the step proposed by the loop.
|
|
316
324
|
* @param payload.signal - the current turn's cancellation signal.
|
|
@@ -320,14 +328,15 @@ declare module '@deepseek-ai/cordis' {
|
|
|
320
328
|
'agent/pre-step'(this: Scoped<Agent>, payload: {
|
|
321
329
|
agent: Agent;
|
|
322
330
|
messages: UserMessage[];
|
|
331
|
+
promptConfig?: LlmCallConfig;
|
|
323
332
|
turn: number;
|
|
324
333
|
step: number;
|
|
325
334
|
signal: AbortSignal;
|
|
326
335
|
}, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>;
|
|
327
336
|
/**
|
|
328
337
|
* Replace the frozen call configuration. `await next()` yields the config
|
|
329
|
-
* the machine would use
|
|
330
|
-
*
|
|
338
|
+
* the machine would use. A queued prompt's config takes precedence over
|
|
339
|
+
* agent options and the previous request header. On step admission,
|
|
331
340
|
* this runs after assembly and `step/start`, before the system prompt and
|
|
332
341
|
* accepted user batch are committed. Cancellation here or during subsequent
|
|
333
342
|
* `prepareCall()` resolution commits neither. The prepared call capability
|
|
@@ -183,6 +183,17 @@ var AgentDefaultModelConfig = class extends Service {
|
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
/**
|
|
186
|
+
* Update the in-memory current selection without persisting to disk.
|
|
187
|
+
* Used by the desktop-injection flow where the AI workbench controls model
|
|
188
|
+
* selection and the Runtime must not write credentials or choices to disk.
|
|
189
|
+
* @param next - model selection to use in memory.
|
|
190
|
+
*/
|
|
191
|
+
setCurrentSelection(next) {
|
|
192
|
+
this.shared = { ...next };
|
|
193
|
+
this.awaitingDefault = false;
|
|
194
|
+
this.allowCatalogDefault = false;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
186
197
|
* Save the complete default model selection to the shared ChatCode Home file,
|
|
187
198
|
* or the owning profile entry in other deployments. Saves commit in submission
|
|
188
199
|
* order; a failed save rejects its caller without blocking later saves.
|
|
@@ -67,6 +67,13 @@ export declare class AgentDefaultModelConfig extends Service {
|
|
|
67
67
|
model: string;
|
|
68
68
|
name: string;
|
|
69
69
|
} | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Update the in-memory current selection without persisting to disk.
|
|
72
|
+
* Used by the desktop-injection flow where the AI workbench controls model
|
|
73
|
+
* selection and the Runtime must not write credentials or choices to disk.
|
|
74
|
+
* @param next - model selection to use in memory.
|
|
75
|
+
*/
|
|
76
|
+
setCurrentSelection(next: ModelSelection): void;
|
|
70
77
|
/**
|
|
71
78
|
* Save the complete default model selection to the shared ChatCode Home file,
|
|
72
79
|
* or the owning profile entry in other deployments. Saves commit in submission
|
|
@@ -71,6 +71,30 @@ var ReactLoopInbox = class {
|
|
|
71
71
|
projections;
|
|
72
72
|
session;
|
|
73
73
|
dispatch;
|
|
74
|
+
#promptApiKeys = /* @__PURE__ */ new Map();
|
|
75
|
+
/**
|
|
76
|
+
* Keep one credential in memory until the pending message is claimed or discarded.
|
|
77
|
+
* @param message - queued prompt and the exact model route the caller selected.
|
|
78
|
+
* @param key - credential supplied with the prompt.
|
|
79
|
+
*/
|
|
80
|
+
supplyPromptApiKey(message, key) {
|
|
81
|
+
const config = message.promptConfig;
|
|
82
|
+
if (config !== void 0 && !this.#promptApiKeys.has(message.id)) this.#promptApiKeys.set(message.id, {
|
|
83
|
+
provider: config.provider,
|
|
84
|
+
model: config.model,
|
|
85
|
+
key
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Transfer a credential from the inbox to its active turn.
|
|
90
|
+
* @param message - claimed prompt with its selected model route.
|
|
91
|
+
* @returns the in-memory key for that exact route, when supplied.
|
|
92
|
+
*/
|
|
93
|
+
takePromptApiKey(message) {
|
|
94
|
+
const auth = this.#promptApiKeys.get(message.id);
|
|
95
|
+
this.#promptApiKeys.delete(message.id);
|
|
96
|
+
return auth?.provider === message.promptConfig?.provider && auth?.model === message.promptConfig?.model ? auth?.key : void 0;
|
|
97
|
+
}
|
|
74
98
|
constructor(projections, session, dispatch) {
|
|
75
99
|
this.projections = projections;
|
|
76
100
|
this.session = session;
|
|
@@ -202,7 +226,10 @@ var ReactLoopInbox = class {
|
|
|
202
226
|
};
|
|
203
227
|
const removed = inbox.slice(actualStart, actualStart + actualDeleteCount);
|
|
204
228
|
const event = this.session.append("agent/inbox/spliced", splice);
|
|
205
|
-
if (discardRemoved) for (const message of removed)
|
|
229
|
+
if (discardRemoved) for (const message of removed) {
|
|
230
|
+
if (!ids.has(message.id)) this.#promptApiKeys.delete(message.id);
|
|
231
|
+
this.dispatch.emit("agent/inbox/discarded", { message });
|
|
232
|
+
}
|
|
206
233
|
for (const message of event.data.inserted) this.dispatch.emit("agent/inbox/inserted", { message });
|
|
207
234
|
return removed;
|
|
208
235
|
}
|
|
@@ -798,13 +825,22 @@ var ReactLoopAgent = class {
|
|
|
798
825
|
if (status !== previousStatus) this.dispatch.emit("agent/status", { status });
|
|
799
826
|
}
|
|
800
827
|
send(message, target, wakeup) {
|
|
828
|
+
this.enqueue(message, target, wakeup);
|
|
829
|
+
}
|
|
830
|
+
enqueue(message, target, wakeup, promptApiKey) {
|
|
801
831
|
const wakingAfterAbort = wakeup && this.phase.kind !== "idle" && this.phase.abort.signal.aborted;
|
|
802
832
|
const resolvedTarget = wakingAfterAbort ? "next-turn" : target;
|
|
803
833
|
this.inbox.splice(resolvedTarget, Infinity, 0, [message]);
|
|
834
|
+
if (promptApiKey !== void 0 && this.inbox.nextTurn.some((item) => item.id === message.id)) this.inbox.supplyPromptApiKey(message, promptApiKey);
|
|
804
835
|
if (wakeup) this.wakeDriver(wakingAfterAbort);
|
|
805
836
|
}
|
|
806
|
-
followup(input) {
|
|
807
|
-
this.
|
|
837
|
+
followup(input, promptApiKey) {
|
|
838
|
+
this.enqueue(input, "next-turn", true, promptApiKey);
|
|
839
|
+
}
|
|
840
|
+
restorePromptApiKey(message, apiKey) {
|
|
841
|
+
if (!message.promptApiKeyRequired || !this.inbox.nextTurn.some((item) => item.id === message.id)) return;
|
|
842
|
+
this.inbox.supplyPromptApiKey(message, apiKey);
|
|
843
|
+
this.wakeDriver(this.phase.kind !== "idle" && this.phase.abort.signal.aborted);
|
|
808
844
|
}
|
|
809
845
|
steer(input) {
|
|
810
846
|
this.send(input, "next-step", true);
|
|
@@ -903,19 +939,27 @@ var ReactLoopAgent = class {
|
|
|
903
939
|
}
|
|
904
940
|
}
|
|
905
941
|
}
|
|
906
|
-
async preStep(target, position) {
|
|
942
|
+
async preStep(target, position, activePromptConfig, activePromptApiKey) {
|
|
907
943
|
/* v8 ignore next -- private callers establish the running phase before proposing a step */
|
|
908
944
|
if (this.phase.kind !== "running") throw new Error(`agent "${this.id}": pre-step outside running phase`);
|
|
909
945
|
const signal = this.phase.abort.signal;
|
|
910
946
|
const claimed = this.inbox.claim(target, position.turn);
|
|
911
|
-
const
|
|
947
|
+
const prompt = claimed.find((message) => message.promptConfig !== void 0);
|
|
948
|
+
const promptConfig = activePromptConfig ?? prompt?.promptConfig;
|
|
949
|
+
const promptApiKey = prompt === void 0 ? activePromptApiKey : this.inbox.takePromptApiKey(prompt);
|
|
950
|
+
if (prompt?.promptApiKeyRequired === true && promptApiKey === void 0) throw new LlmError("Resubmit the prompt with its API key after Runtime restart", "MISSING_CREDENTIAL");
|
|
951
|
+
const assembly = await this.loopCtx.systemPrompt.assemble({
|
|
952
|
+
...assembleContextFor(this, signal),
|
|
953
|
+
...promptConfig === void 0 ? {} : { promptModelSelection: promptConfig }
|
|
954
|
+
});
|
|
912
955
|
signal.throwIfAborted();
|
|
913
956
|
const sections = renderContextSections(assembly);
|
|
914
957
|
const context = this.runtimeContext.project(joinContextSections(sections), sections);
|
|
915
958
|
const decision = await this.dispatch.waterfall("agent/pre-step", {
|
|
916
959
|
messages: claimed,
|
|
917
960
|
...position,
|
|
918
|
-
signal
|
|
961
|
+
signal,
|
|
962
|
+
...promptConfig === void 0 ? {} : { promptConfig }
|
|
919
963
|
}, () => Promise.resolve({
|
|
920
964
|
kind: "enter",
|
|
921
965
|
messages: context === void 0 ? claimed : [...claimed, context]
|
|
@@ -924,7 +968,9 @@ var ReactLoopAgent = class {
|
|
|
924
968
|
if (decision.kind === "reject") return decision;
|
|
925
969
|
return {
|
|
926
970
|
...decision,
|
|
927
|
-
assembly
|
|
971
|
+
assembly,
|
|
972
|
+
...promptConfig === void 0 ? {} : { promptConfig },
|
|
973
|
+
...promptApiKey === void 0 ? {} : { promptApiKey }
|
|
928
974
|
};
|
|
929
975
|
}
|
|
930
976
|
/** Whether the assembled tool schemas differ from the logged request header's. */
|
|
@@ -951,6 +997,8 @@ var ReactLoopAgent = class {
|
|
|
951
997
|
phase.turn = turn;
|
|
952
998
|
let turnEnds = null;
|
|
953
999
|
let target = "next-turn";
|
|
1000
|
+
let promptConfig;
|
|
1001
|
+
let promptApiKey;
|
|
954
1002
|
try {
|
|
955
1003
|
while (true) {
|
|
956
1004
|
signal.throwIfAborted();
|
|
@@ -958,11 +1006,13 @@ var ReactLoopAgent = class {
|
|
|
958
1006
|
const decision = await this.preStep(target, {
|
|
959
1007
|
turn,
|
|
960
1008
|
step
|
|
961
|
-
});
|
|
1009
|
+
}, promptConfig, promptApiKey);
|
|
962
1010
|
if (decision.kind === "reject") {
|
|
963
1011
|
turnEnds = { kind: "blocked" };
|
|
964
1012
|
return false;
|
|
965
1013
|
}
|
|
1014
|
+
promptConfig = decision.promptConfig;
|
|
1015
|
+
promptApiKey = decision.promptApiKey;
|
|
966
1016
|
if (turnEnds && decision.messages.length === 0) break;
|
|
967
1017
|
if (phase.step === 0 && decision.messages.length === 0) {
|
|
968
1018
|
turnEnds = { kind: "completed" };
|
|
@@ -1032,11 +1082,11 @@ var ReactLoopAgent = class {
|
|
|
1032
1082
|
if (this.phase.kind !== "running") throw new Error(`agent "${this.id}": step outside running phase`);
|
|
1033
1083
|
const { turn, step, abort: { signal } } = this.phase;
|
|
1034
1084
|
signal.throwIfAborted();
|
|
1035
|
-
const { assembly } = decision;
|
|
1085
|
+
const { assembly, promptConfig, promptApiKey } = decision;
|
|
1036
1086
|
const renderedPrompt = renderPrompt(assembly);
|
|
1037
1087
|
let firstAttempt = true;
|
|
1038
1088
|
while (true) {
|
|
1039
|
-
const { config, preparedCall } = await this.prepareRequest(turn, step, signal);
|
|
1089
|
+
const { config, preparedCall } = await this.prepareRequest(turn, step, signal, promptConfig, promptApiKey);
|
|
1040
1090
|
const startsRequestSeries = firstAttempt && decision.startsRequestSeries === true;
|
|
1041
1091
|
const commits = this.systemPrompt.project(renderedPrompt, {
|
|
1042
1092
|
inHistory: preparedCall?.systemPromptUpdate === "in-history",
|
|
@@ -1052,7 +1102,7 @@ var ReactLoopAgent = class {
|
|
|
1052
1102
|
const request = this.buildRequest(config, preparedCall, assembly.tools, {
|
|
1053
1103
|
turn,
|
|
1054
1104
|
step
|
|
1055
|
-
}, startsRequestSeries, signal);
|
|
1105
|
+
}, startsRequestSeries, signal, promptConfig !== void 0);
|
|
1056
1106
|
const live = new AssistantStreamAttempt(this.session.id, ++this.assistantAttemptCounter, () => ++this.assistantStreamRevision, turn, step, (frame) => {
|
|
1057
1107
|
this.dispatch.emit("agent/assistant-stream", { frame });
|
|
1058
1108
|
});
|
|
@@ -1149,10 +1199,10 @@ var ReactLoopAgent = class {
|
|
|
1149
1199
|
}
|
|
1150
1200
|
}
|
|
1151
1201
|
/** Resolve request config and bind its adapter before admitting model-visible input. */
|
|
1152
|
-
async prepareRequest(turn, step, signal) {
|
|
1202
|
+
async prepareRequest(turn, step, signal, promptConfig, promptApiKey) {
|
|
1153
1203
|
const { session } = this;
|
|
1154
1204
|
const persistedHeader = session.requestHeader();
|
|
1155
|
-
const persistedConfig = persistedHeader?.config;
|
|
1205
|
+
const persistedConfig = persistedHeader?.promptScoped === true ? void 0 : persistedHeader?.config;
|
|
1156
1206
|
const route = {
|
|
1157
1207
|
provider: this.options.provider ?? "",
|
|
1158
1208
|
model: this.options.model ?? ""
|
|
@@ -1160,7 +1210,7 @@ var ReactLoopAgent = class {
|
|
|
1160
1210
|
const persistedReasoningEffort = persistedConfig?.provider === route.provider && persistedConfig.model === route.model && persistedHeader?.adapterDefaults?.reasoningEffort !== true ? persistedConfig.reasoningEffort : void 0;
|
|
1161
1211
|
const reasoningEffort = this.options.reasoningEffort ?? persistedReasoningEffort;
|
|
1162
1212
|
const maxTokens = this.options.maxTokens;
|
|
1163
|
-
const seedConfig = deepFreeze(structuredClone(this.requestHeaderLogged ? requestProposal(persistedHeader) : {
|
|
1213
|
+
const seedConfig = promptConfig ?? deepFreeze(structuredClone(this.requestHeaderLogged && persistedHeader?.promptScoped !== true ? requestProposal(persistedHeader) : {
|
|
1164
1214
|
...route,
|
|
1165
1215
|
...reasoningEffort === void 0 ? {} : { reasoningEffort },
|
|
1166
1216
|
...maxTokens === void 0 ? {} : { maxTokens }
|
|
@@ -1172,13 +1222,14 @@ var ReactLoopAgent = class {
|
|
|
1172
1222
|
}, () => Promise.resolve(seedConfig));
|
|
1173
1223
|
signal.throwIfAborted();
|
|
1174
1224
|
if (!proposedConfig.provider || !proposedConfig.model) throw new Error(`agent "${this.id}" has no provider/model: set AgentOptions.provider and AgentOptions.model or supply both via the agent/request waterfall`);
|
|
1225
|
+
if (promptApiKey !== void 0 && (proposedConfig.provider !== promptConfig?.provider || proposedConfig.model !== promptConfig.model)) throw new LlmError("A prompt API key can only be used with its submitted model route", "INVALID_REQUEST");
|
|
1175
1226
|
let config;
|
|
1176
1227
|
let preparedCall;
|
|
1177
1228
|
try {
|
|
1178
|
-
preparedCall = await this.loopCtx.llm.prepareCall(proposedConfig, signal);
|
|
1229
|
+
preparedCall = await this.loopCtx.llm.prepareCall(proposedConfig, signal, promptApiKey);
|
|
1179
1230
|
config = preparedCall.config;
|
|
1180
1231
|
} catch (error) {
|
|
1181
|
-
if (!(error instanceof LlmError) || error.code !== "NO_ADAPTER") throw error;
|
|
1232
|
+
if (promptApiKey !== void 0 || !(error instanceof LlmError) || error.code !== "NO_ADAPTER") throw error;
|
|
1182
1233
|
config = proposedConfig;
|
|
1183
1234
|
}
|
|
1184
1235
|
signal.throwIfAborted();
|
|
@@ -1188,11 +1239,12 @@ var ReactLoopAgent = class {
|
|
|
1188
1239
|
};
|
|
1189
1240
|
}
|
|
1190
1241
|
/** Log the resolved envelope and derive a frozen request from the admitted surface. */
|
|
1191
|
-
buildRequest(config, preparedCall, tools, position, startsRequestSeries, signal) {
|
|
1242
|
+
buildRequest(config, preparedCall, tools, position, startsRequestSeries, signal, promptScoped) {
|
|
1192
1243
|
const { session } = this;
|
|
1193
1244
|
const surfaceGeneration = session.surface.contentGeneration;
|
|
1194
1245
|
const header = canonicalHeader({
|
|
1195
1246
|
config,
|
|
1247
|
+
...promptScoped ? { promptScoped: true } : {},
|
|
1196
1248
|
...preparedCall === void 0 ? {} : { adapterDefaults: preparedCall.adapterDefaults },
|
|
1197
1249
|
...tools.length > 0 ? { tools } : {}
|
|
1198
1250
|
});
|
|
@@ -25,7 +25,7 @@ const install = Object.assign((ctx, fail) => {
|
|
|
25
25
|
if (header === void 0) return fail("a loop-built request with no request/header event in its session log");
|
|
26
26
|
const expected = session.deriveMessages();
|
|
27
27
|
if (JSON.stringify(options.messages) !== JSON.stringify(expected)) fail(`llm request for session "${String(session.id)}" diverges from the dispatch-time durable derivation (log-reconstruction desync)`);
|
|
28
|
-
if (!(options.model === header.config.model && options.system === void 0 && options.temperature === header.config.temperature && options.maxTokens === header.config.maxTokens && JSON.stringify(options.stop) === JSON.stringify(header.config.stop) && JSON.stringify(options.tools ?? []) === JSON.stringify(header.tools ?? []))) fail(`llm request for session "${String(session.id)}" diverges from the folded request header`);
|
|
28
|
+
if (!(options.model === header.config.model && options.system === void 0 && options.temperature === header.config.temperature && options.maxTokens === header.config.maxTokens && options.contextWindow === header.config.contextWindow && options.protocol === header.config.protocol && JSON.stringify(options.protocolOptions) === JSON.stringify(header.config.protocolOptions) && JSON.stringify(options.stop) === JSON.stringify(header.config.stop) && JSON.stringify(options.tools ?? []) === JSON.stringify(header.tools ?? []))) fail(`llm request for session "${String(session.id)}" diverges from the folded request header`);
|
|
29
29
|
return next();
|
|
30
30
|
}, {
|
|
31
31
|
global: true,
|
|
@@ -38,7 +38,9 @@ export declare class ReactLoopAgent implements Agent {
|
|
|
38
38
|
/** Commit a phase and publish its externally visible status transition. */
|
|
39
39
|
private setPhase;
|
|
40
40
|
send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;
|
|
41
|
-
|
|
41
|
+
private enqueue;
|
|
42
|
+
followup(input: UserMessage, promptApiKey?: string): void;
|
|
43
|
+
restorePromptApiKey(message: UserMessage, apiKey: string): void;
|
|
42
44
|
steer(input: UserMessage): void;
|
|
43
45
|
inject(input: UserMessage): void;
|
|
44
46
|
cancel(cause: AgentCancelCause, options?: CancelOptions): void;
|
|
@@ -36,9 +36,22 @@ export declare const inboxProjectionDefinition: {
|
|
|
36
36
|
* @param dispatch - agent-scoped notifications for Inbox lifecycle events.
|
|
37
37
|
*/
|
|
38
38
|
export declare class ReactLoopInbox implements InboxContract {
|
|
39
|
+
#private;
|
|
39
40
|
private readonly projections;
|
|
40
41
|
private readonly session;
|
|
41
42
|
private readonly dispatch;
|
|
43
|
+
/**
|
|
44
|
+
* Keep one credential in memory until the pending message is claimed or discarded.
|
|
45
|
+
* @param message - queued prompt and the exact model route the caller selected.
|
|
46
|
+
* @param key - credential supplied with the prompt.
|
|
47
|
+
*/
|
|
48
|
+
supplyPromptApiKey(message: UserMessage, key: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Transfer a credential from the inbox to its active turn.
|
|
51
|
+
* @param message - claimed prompt with its selected model route.
|
|
52
|
+
* @returns the in-memory key for that exact route, when supplied.
|
|
53
|
+
*/
|
|
54
|
+
takePromptApiKey(message: UserMessage): string | undefined;
|
|
42
55
|
constructor(projections: SessionProjectionRegistry, session: Session, dispatch: AgentEventDispatch);
|
|
43
56
|
/** Prompts awaiting individual turns. */
|
|
44
57
|
get nextTurn(): readonly UserMessage[];
|
|
@@ -232,7 +232,7 @@ export const TYPERT = {
|
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
"name": "Agent",
|
|
235
|
-
"declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
|
|
235
|
+
"declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage, promptApiKey?: string): void;\n restorePromptApiKey?(message: UserMessage, apiKey: string): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
"name": "AgentCancelCause",
|
|
@@ -372,7 +372,7 @@ export const TYPERT = {
|
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
"name": "EpochHeader",
|
|
375
|
-
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
|
|
375
|
+
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n promptScoped?: true;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
|
|
376
376
|
},
|
|
377
377
|
{
|
|
378
378
|
"name": "EveryScheduleDispatchChange",
|
|
@@ -496,7 +496,7 @@ export const TYPERT = {
|
|
|
496
496
|
},
|
|
497
497
|
{
|
|
498
498
|
"name": "LlmCallConfig",
|
|
499
|
-
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
499
|
+
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
502
|
"name": "LlmCallConfigAdapterDefaults",
|
|
@@ -548,7 +548,7 @@ export const TYPERT = {
|
|
|
548
548
|
},
|
|
549
549
|
{
|
|
550
550
|
"name": "MessageSourceMap",
|
|
551
|
-
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n goal: GoalMessageSource;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n}"
|
|
551
|
+
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; promptDigest?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n goal: GoalMessageSource;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n}"
|
|
552
552
|
},
|
|
553
553
|
{
|
|
554
554
|
"name": "ModelMessageSource",
|
|
@@ -804,7 +804,7 @@ export const TYPERT = {
|
|
|
804
804
|
},
|
|
805
805
|
{
|
|
806
806
|
"name": "UserMessage",
|
|
807
|
-
"declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
|
|
807
|
+
"declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n readonly promptConfig?: LlmCallConfig;\n readonly promptApiKeyRequired?: true;\n}"
|
|
808
808
|
}
|
|
809
809
|
]
|
|
810
810
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource resolution for non-owner access decisions: the resources one call
|
|
3
|
+
* or one forwarded event touches, read from Typert-validated arguments before
|
|
4
|
+
* any lookup or Context resolves them.
|
|
5
|
+
* @module @deepseek-ai/dsh-api-gateway/src/access
|
|
6
|
+
*/
|
|
7
|
+
import type { InvocationDescriptor, RemoteAccessResource, TypertRegistryContract, TypertResourceReader } from '@deepseek-ai/dsh-typert-protocol';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the resources one call touches. For each resource kind, a
|
|
10
|
+
* `resources` reader of the method wins; otherwise every lookup parameter
|
|
11
|
+
* whose provider declares the kind contributes its wire resource id, and so
|
|
12
|
+
* does the Context identity of a Context method whose Host adapter declares
|
|
13
|
+
* the kind; otherwise the kind's registered default resolver receives named
|
|
14
|
+
* wire values and ordered parameter descriptions. A default field instead
|
|
15
|
+
* reads a top-level argument or, failing that, the first object argument.
|
|
16
|
+
* @param typert - registry holding default fields or resolvers, lookup providers, and Host Context adapters.
|
|
17
|
+
* @param readers - the method's `resources` readers, or `undefined` when it declares none.
|
|
18
|
+
* @param descriptor - receiver, parameter order, lookups, and cancellation slot of the method.
|
|
19
|
+
* @param args - named arguments matched to the descriptor's field set: JSON
|
|
20
|
+
* arguments as their Typert codecs validated them, lookup and Context
|
|
21
|
+
* identities as wire values.
|
|
22
|
+
* @param signal - value placed in the cancellation slot of the positional arguments.
|
|
23
|
+
* @returns the touched resources, the global resource alone when none;
|
|
24
|
+
* `undefined` when the resources are invalid: a reader or resolver throws,
|
|
25
|
+
* a reader returns an empty list, a default field or resolver holds an
|
|
26
|
+
* array, or a resource id is not a non-empty string.
|
|
27
|
+
*/
|
|
28
|
+
export declare function callResources(typert: Pick<TypertRegistryContract, 'contexts' | 'lookups' | 'resources'>, readers: Readonly<Record<string, TypertResourceReader>> | undefined, descriptor: Pick<InvocationDescriptor, 'cancellation' | 'invocation' | 'parameters'>, args: Readonly<Record<string, unknown>>, signal: AbortSignal): readonly RemoteAccessResource[] | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the resources one forwarded event notification touches. An event
|
|
31
|
+
* carries every resource it declares, so a reader returning `undefined`
|
|
32
|
+
* makes the notification invalid instead of a global one.
|
|
33
|
+
* @param readers - the event entry's declared readers, or `undefined` when it declares none.
|
|
34
|
+
* @param args - the event's validated JSON arguments, passed to each reader as its positional arguments.
|
|
35
|
+
* @returns the global resource alone without readers, including an empty
|
|
36
|
+
* reader set; otherwise the touched resources; `undefined` when the
|
|
37
|
+
* resources are invalid: a resource id is missing or malformed.
|
|
38
|
+
*/
|
|
39
|
+
export declare function eventResources(readers: Readonly<Record<string, TypertResourceReader>> | undefined, args: readonly unknown[]): readonly RemoteAccessResource[] | undefined;
|
|
40
|
+
//# sourceMappingURL=access.d.ts.map
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource resolution for non-owner access decisions: the resources one call
|
|
3
|
+
* or one forwarded event touches, read from Typert-validated arguments before
|
|
4
|
+
* any lookup or Context resolves them.
|
|
5
|
+
* @module @deepseek-ai/dsh-api-gateway/src/access
|
|
6
|
+
*/
|
|
7
|
+
const GLOBAL = Object.freeze([Object.freeze({ kind: 'global' })]);
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the resources one call touches. For each resource kind, a
|
|
10
|
+
* `resources` reader of the method wins; otherwise every lookup parameter
|
|
11
|
+
* whose provider declares the kind contributes its wire resource id, and so
|
|
12
|
+
* does the Context identity of a Context method whose Host adapter declares
|
|
13
|
+
* the kind; otherwise the kind's registered default resolver receives named
|
|
14
|
+
* wire values and ordered parameter descriptions. A default field instead
|
|
15
|
+
* reads a top-level argument or, failing that, the first object argument.
|
|
16
|
+
* @param typert - registry holding default fields or resolvers, lookup providers, and Host Context adapters.
|
|
17
|
+
* @param readers - the method's `resources` readers, or `undefined` when it declares none.
|
|
18
|
+
* @param descriptor - receiver, parameter order, lookups, and cancellation slot of the method.
|
|
19
|
+
* @param args - named arguments matched to the descriptor's field set: JSON
|
|
20
|
+
* arguments as their Typert codecs validated them, lookup and Context
|
|
21
|
+
* identities as wire values.
|
|
22
|
+
* @param signal - value placed in the cancellation slot of the positional arguments.
|
|
23
|
+
* @returns the touched resources, the global resource alone when none;
|
|
24
|
+
* `undefined` when the resources are invalid: a reader or resolver throws,
|
|
25
|
+
* a reader returns an empty list, a default field or resolver holds an
|
|
26
|
+
* array, or a resource id is not a non-empty string.
|
|
27
|
+
*/
|
|
28
|
+
export function callResources(typert, readers, descriptor, args, signal) {
|
|
29
|
+
// Each later source replaces an earlier one for its kind and keeps the kind's position.
|
|
30
|
+
const sources = new Map();
|
|
31
|
+
const positionalArgs = [
|
|
32
|
+
...descriptor.parameters.map(parameter => args[parameter.wire]),
|
|
33
|
+
...descriptor.cancellation === undefined ? [] : [signal],
|
|
34
|
+
];
|
|
35
|
+
for (const declaration of typert.resources.entries()) {
|
|
36
|
+
sources.set(declaration.kind, () => {
|
|
37
|
+
let id;
|
|
38
|
+
if (declaration.resolve !== undefined) {
|
|
39
|
+
const resolve = declaration.resolve;
|
|
40
|
+
try {
|
|
41
|
+
id = resolve({ args, parameters: descriptor.parameters });
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// A resolver failure cannot identify an authorized resource.
|
|
45
|
+
return 'invalid';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
id = defaultFieldId(descriptor, args, declaration.field);
|
|
50
|
+
}
|
|
51
|
+
return Array.isArray(id) ? 'invalid' : id === undefined ? [] : [id];
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
for (const [kind, ids] of lookupResources(typert, descriptor, args)) {
|
|
55
|
+
sources.set(kind, () => ids);
|
|
56
|
+
}
|
|
57
|
+
for (const [kind, reader] of Object.entries(readers ?? {})) {
|
|
58
|
+
sources.set(kind, () => read(() => reader(...positionalArgs), []));
|
|
59
|
+
}
|
|
60
|
+
const resources = [];
|
|
61
|
+
for (const [kind, ids] of sources) {
|
|
62
|
+
if (!collect(resources, kind, ids()))
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
return resources.length === 0 ? GLOBAL : resources;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve the resources one forwarded event notification touches. An event
|
|
69
|
+
* carries every resource it declares, so a reader returning `undefined`
|
|
70
|
+
* makes the notification invalid instead of a global one.
|
|
71
|
+
* @param readers - the event entry's declared readers, or `undefined` when it declares none.
|
|
72
|
+
* @param args - the event's validated JSON arguments, passed to each reader as its positional arguments.
|
|
73
|
+
* @returns the global resource alone without readers, including an empty
|
|
74
|
+
* reader set; otherwise the touched resources; `undefined` when the
|
|
75
|
+
* resources are invalid: a resource id is missing or malformed.
|
|
76
|
+
*/
|
|
77
|
+
export function eventResources(readers, args) {
|
|
78
|
+
const declared = Object.entries(readers ?? {});
|
|
79
|
+
if (declared.length === 0)
|
|
80
|
+
return GLOBAL;
|
|
81
|
+
const resources = [];
|
|
82
|
+
for (const [kind, reader] of declared) {
|
|
83
|
+
if (!collect(resources, kind, read(() => reader(...args), 'invalid')))
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return resources;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The resource ids lookup parameters and the Context identity name, per
|
|
90
|
+
* resource kind: the Context identity first, then lookup parameters in order.
|
|
91
|
+
* An optional lookup parameter the call omits names no resource id; the
|
|
92
|
+
* Context identity is required.
|
|
93
|
+
*/
|
|
94
|
+
function lookupResources(typert, descriptor, args) {
|
|
95
|
+
const ids = new Map();
|
|
96
|
+
const add = (kind, id) => {
|
|
97
|
+
const list = ids.get(kind);
|
|
98
|
+
if (list === undefined)
|
|
99
|
+
ids.set(kind, [id]);
|
|
100
|
+
else
|
|
101
|
+
list.push(id);
|
|
102
|
+
};
|
|
103
|
+
const receiver = descriptor.invocation;
|
|
104
|
+
if (receiver.kind === 'context') {
|
|
105
|
+
const kind = typert.contexts.getHost(receiver.context)?.resource;
|
|
106
|
+
// oxlint-disable-next-line typescript/no-unnecessary-condition -- domain packages merge resource kinds into TypertResourceMap.
|
|
107
|
+
if (kind !== undefined)
|
|
108
|
+
add(kind, args[receiver.wire]);
|
|
109
|
+
}
|
|
110
|
+
for (const parameter of descriptor.parameters) {
|
|
111
|
+
if (parameter.lookup === undefined)
|
|
112
|
+
continue;
|
|
113
|
+
const kind = typert.lookups.get(parameter.lookup)?.resource;
|
|
114
|
+
const id = args[parameter.wire];
|
|
115
|
+
// oxlint-disable-next-line typescript/no-unnecessary-condition -- domain packages merge resource kinds into TypertResourceMap.
|
|
116
|
+
if (kind !== undefined && id !== undefined)
|
|
117
|
+
add(kind, id);
|
|
118
|
+
}
|
|
119
|
+
return ids;
|
|
120
|
+
}
|
|
121
|
+
/** Read resource identities: `undefined` yields `absent`, a list names several and must not be empty. */
|
|
122
|
+
function read(reader, absent) {
|
|
123
|
+
let value;
|
|
124
|
+
try {
|
|
125
|
+
value = reader();
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Any reader error means it cannot name its resources, so they are invalid.
|
|
129
|
+
return 'invalid';
|
|
130
|
+
}
|
|
131
|
+
if (value === undefined)
|
|
132
|
+
return absent;
|
|
133
|
+
if (!Array.isArray(value))
|
|
134
|
+
return [value];
|
|
135
|
+
return value.length === 0 ? 'invalid' : value;
|
|
136
|
+
}
|
|
137
|
+
/** Append one kind's resource ids; false when any is malformed. */
|
|
138
|
+
function collect(resources, kind, ids) {
|
|
139
|
+
if (ids === 'invalid')
|
|
140
|
+
return false;
|
|
141
|
+
for (const id of ids) {
|
|
142
|
+
if (typeof id !== 'string' || id.length === 0)
|
|
143
|
+
return false;
|
|
144
|
+
// Kinds come from registrations, lookups, Context adapters, and reader keys, all typed by the merged resource map.
|
|
145
|
+
resources.push({ kind, id });
|
|
146
|
+
}
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
/** The default field: a top-level argument, else that field of the first object argument. */
|
|
150
|
+
function defaultFieldId(descriptor, args, field) {
|
|
151
|
+
if (descriptor.parameters.some(parameter => parameter.wire === field))
|
|
152
|
+
return args[field];
|
|
153
|
+
for (const parameter of descriptor.parameters) {
|
|
154
|
+
const value = args[parameter.wire];
|
|
155
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
156
|
+
continue;
|
|
157
|
+
if (!Object.hasOwn(value, field))
|
|
158
|
+
return undefined;
|
|
159
|
+
const id = Reflect.get(value, field);
|
|
160
|
+
return id;
|
|
161
|
+
}
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=access.js.map
|