@chatcode/chatcode-cli 3.0.3 → 3.0.4-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 +10 -10
- package/README.md +16 -1
- package/README.zh.md +16 -1
- package/lib/bin.js +62 -11
- package/lib/{command-errors-CBJRI2gy.js → command-errors-CScdshCl.js} +12 -12
- package/lib/{command-trees-Dvq4C7a4.js → command-trees-Dc17MYfV.js} +2 -2
- package/lib/{component-identity-DPdJglJO.js → component-identity-DFJD_d-P.js} +3 -3
- package/lib/{dump-config-CauO75nE.js → dump-config-BcH-VYuv.js} +5 -5
- package/lib/dump-config-CyopmD85.js +2 -0
- package/lib/{dump-config-schema-CObLWWaW.js → dump-config-schema-DM0fb6Ns.js} +2 -2
- package/lib/{extension-events-Be9LWvHD.js → extension-events-qXmhzmHo.js} +20 -20
- package/lib/{frames-7PAg0Q9b.js → frames-B89znn_0.js} +4 -4
- package/lib/headless-compat.js +2 -2
- package/lib/{host-access-DeCjoRQP.js → host-access-B0CRAwsX.js} +1 -1
- package/lib/{keymap-CRUxM_qn.js → keymap-CIoVICBI.js} +17 -16
- package/lib/{plugin-CDFSDE_y.js → plugin-BKQsL2xn.js} +3264 -2301
- package/lib/{plugin-Cn-hyYY8.js → plugin-eJjD6r12.js} +1 -1
- package/lib/{profile-boot-SJGbpLgN.js → profile-boot-BNQry1NM.js} +97 -14
- package/lib/profile-boot.js +2 -2
- package/lib/{scenes-D6jV1EEi.js → scenes-BRf-zMpF.js} +3 -3
- package/lib/{settings-sections-DJQRNBo9.js → settings-sections-4gMhveN_.js} +7 -3
- package/lib/statusBarSettings-CnmdSHkO.js +382 -0
- package/lib/{themes-BCly4_y9.js → themes-Ce97Zsri.js} +13 -13
- 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 +4 -4
- package/lib/tui-compat-workspaces.js +1 -1
- package/lib/tui-compat.js +9 -26
- package/lib/types/args.d.ts +2 -0
- package/lib/types/permission-bypass.d.ts +16 -0
- package/lib/types/profile-boot.d.ts +12 -0
- package/lib/types/tui-compat.d.ts +4 -0
- package/lib/types/web-browser.d.ts +6 -0
- package/lib/types/web-instance.d.ts +42 -0
- package/lib/web-browser-Vcgfdsv_.js +46 -0
- package/lib/web-instance-B0jec7cq.js +2 -0
- package/lib/web-instance-DbP7IHPv.js +280 -0
- package/lib/{workspaces-Bb3kCAFb.js → workspaces-1xrm-e3V.js} +2 -2
- package/package.json +36 -33
- package/runtime/manifest.json +4 -2
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +137 -11
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +27 -1
- package/runtime/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.js +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/remote-stream.js +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +152 -39
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/index.js +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.d.ts +3 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.js +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +179 -35
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +57 -30
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +31 -19
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +9 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +36 -6
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/archived-session-gate.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +12 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/service.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +24 -8
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +4 -3
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +31 -14
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.js +89 -4
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/remote-events.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/index.js +28 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.host.js +39 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.remote-client.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.remote-client.js +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/types/index.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/types/index.js +19 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/client.js +30 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/index.js +111 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.host.js +104 -11
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.remote-client.d.ts +5 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.remote-client.js +78 -11
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/model.d.ts +14 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/model.js +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/service.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/service.js +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/commands.d.ts +13 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/commands.js +44 -2
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/feed.js +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/index.d.ts +13 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/index.js +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/types.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +67 -19
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/index.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/profile-context.d.ts +11 -1
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/worker/profile-resolution-bootstrap.js +22 -3
- package/runtime/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +9 -3
- package/runtime/node_modules/@deepseek-ai/dsh-base/package.json +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/client.js +931 -7
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/index.js +57 -19
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/client/index.d.ts +5 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/config.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/events.d.ts +4 -4
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/index.d.ts +3 -8
- package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/package.json +6 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +3 -2
- 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/client.js +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/present-open.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +68 -16
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/directory.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/locales.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/CodeBlock.module.css +3 -5
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/MarkdownText.module.css +23 -27
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/contract/slots.d.ts +3 -1
- 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/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +8 -7
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/SettingsDocumentAction.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/settings-document-store.d.ts +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +33 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/locales.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +1925 -207
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/ArchivedSessions.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/contract/slots.d.ts +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/locales.d.ts +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/recent.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/RecentList.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/Rows.d.ts +6 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/DeleteSession.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/stores.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/tree.d.ts +15 -13
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/index.js +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +7 -3
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.remote-client.js +6 -2
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/index.js +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/types.d.ts +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/index.js +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +36 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/package.json +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-config-editor/lib/index.js +102 -14
- package/runtime/node_modules/@deepseek-ai/dsh-config-editor/lib/types/index.d.ts +34 -4
- package/runtime/node_modules/@deepseek-ai/dsh-config-editor/package.json +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +5 -2
- package/runtime/node_modules/@deepseek-ai/dsh-host-webserver/lib/index.js +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/index.js +21 -8
- package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.d.ts +4 -6
- package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.js +18 -7
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/typert.host.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/typert.remote-client.js +5 -5
- package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/index.js +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/index.d.ts +21 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-persistence/lib/index.js +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-persistence/lib/types/index.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/index.js +95 -2
- package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/types/index.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-session-projection-cache/lib/index.js +25 -1
- package/runtime/node_modules/@deepseek-ai/dsh-session-projection-cache/lib/types/index.d.ts +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-session-query/lib/index.js +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-query/lib/types/observation.d.ts +5 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-query-sqlite/lib/index.js +26 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/index.js +5 -4
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/index.d.ts +4 -3
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/index.js +4 -3
- package/runtime/node_modules/@deepseek-ai/dsh-storage/lib/types/backend.d.ts +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/index.js +65 -1
- package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/types/domain.d.ts +17 -2
- package/runtime/node_modules/@deepseek-ai/dsh-storage-json/lib/index.js +25 -0
- package/runtime/node_modules/@deepseek-ai/dsh-storage-json/package.json +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/control.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/index.js +5522 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/command-args.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti/cicd.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti/tianti.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti-deliver/tianti-deliver.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/config.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/index.d.ts +13 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/memory-config.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/runtime.d.ts +105 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/aliases.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/auth.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/client.d.ts +206 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/config.d.ts +22 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/index.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/log.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/types.d.ts +136 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/codebase.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/dynamicWorkflow.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/engine.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/executor.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/executors.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/index.d.ts +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/memorySuggestions.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/openspec.d.ts +31 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/recommend.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/render.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/requirementContext.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/scenarioUpgrade.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/state.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/store.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/templates.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/types.d.ts +385 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/writeReviewSync.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/index.d.ts +29 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/store.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/types.d.ts +49 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/tools.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/package.json +57 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +157 -22
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-D5kpKf--.css +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Dz_cDcce.js +133 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Dz_cDcce.js.map +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-apple-touch-icon.png +0 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-icon-32.png +0 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-mask-icon.svg +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon-dark.svg +1 -3
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.ico +0 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.svg +1 -3
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +8 -4
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/preview.html +8 -4
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/package.json +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/index.js +325 -37
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/invariant.js +6 -1
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/entity.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/entity.js +23 -17
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.d.ts +41 -0
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.js +314 -23
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/spec.d.ts +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/spec.js +4 -0
- package/lib/dump-config-CijLv_kn.js +0 -2
- package/lib/tuiDisplayPrefs-Dm_fULiR.js +0 -204
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DUvMhLle.css +0 -1
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js +0 -127
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js.map +0 -1
|
@@ -177,6 +177,7 @@ async function inspectApiSession(ctx, sessionId, signal) {
|
|
|
177
177
|
/** Owns every operation that may create, resume, or configure a Web Agent. */
|
|
178
178
|
var ApiSessionAgentController = class {
|
|
179
179
|
ctx;
|
|
180
|
+
owned = /* @__PURE__ */ new Map();
|
|
180
181
|
resumes = /* @__PURE__ */ new Map();
|
|
181
182
|
creations = /* @__PURE__ */ new Map();
|
|
182
183
|
selections = /* @__PURE__ */ new WeakMap();
|
|
@@ -184,6 +185,18 @@ var ApiSessionAgentController = class {
|
|
|
184
185
|
/** @param ctx - Host context carrying Agent, model, persistence, and Typert services. */
|
|
185
186
|
constructor(ctx) {
|
|
186
187
|
this.ctx = ctx;
|
|
188
|
+
ctx.on("session/delete-release", async ({ sessionIds }) => {
|
|
189
|
+
for (const id of sessionIds) {
|
|
190
|
+
const handle = this.owned.get(id);
|
|
191
|
+
if (handle?.agent.status === "idle") await handle.dispose();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
ctx.on("agent/disposed", ({ agent }) => {
|
|
195
|
+
if (this.owned.get(agent.session.id)?.agent === agent) this.owned.delete(agent.session.id);
|
|
196
|
+
});
|
|
197
|
+
ctx.effect(() => async () => {
|
|
198
|
+
await Promise.all([...this.owned.values()].map((handle) => handle.dispose()));
|
|
199
|
+
}, "api-session.ownedAgents");
|
|
187
200
|
ctx.typert.lookups.configure("agent", async (sessionId) => {
|
|
188
201
|
const found = await this.resolveAgent(sessionId);
|
|
189
202
|
if ("error" in found) throw found.error;
|
|
@@ -287,6 +300,7 @@ var ApiSessionAgentController = class {
|
|
|
287
300
|
const defaultModel = this.ctx.agentDefaultModel;
|
|
288
301
|
const selection = {
|
|
289
302
|
get current() {
|
|
303
|
+
if (defaultModel.usesSharedPreference()) return defaultModel.currentSelection();
|
|
290
304
|
if (picked !== void 0) return picked;
|
|
291
305
|
const loggedHeader = agent.session.requestHeader();
|
|
292
306
|
if (loggedHeader === void 0) return defaultModel.currentSelection();
|
|
@@ -403,11 +417,11 @@ var ApiSessionAgentController = class {
|
|
|
403
417
|
const published = this.ctx.sessions.get(sessionId);
|
|
404
418
|
const live = this.ctx.agents.get(sessionId);
|
|
405
419
|
if (published !== void 0 && hasApiSessionSubagentOwner(this.ctx, published, live)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
406
|
-
return (await this.ctx.agents.resume({
|
|
420
|
+
return (await this.remember(this.ctx.agents.resume({
|
|
407
421
|
resumeSessionId: sessionId,
|
|
408
422
|
agentOptions: this.agentOptions(),
|
|
409
423
|
setup: composition.setup
|
|
410
|
-
})).agent;
|
|
424
|
+
}))).agent;
|
|
411
425
|
}
|
|
412
426
|
async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId) {
|
|
413
427
|
const attached = this.ctx.sessions.get(sessionId);
|
|
@@ -427,11 +441,11 @@ var ApiSessionAgentController = class {
|
|
|
427
441
|
const storedPreset = this.presetForObservation(observation);
|
|
428
442
|
this.assertPresetUnchanged(sessionId, presetId, storedPreset);
|
|
429
443
|
const composition = await this.composeAgent(storedPreset);
|
|
430
|
-
return (await this.ctx.agents.resume({
|
|
444
|
+
return (await this.remember(this.ctx.agents.resume({
|
|
431
445
|
resumeSessionId: sessionId,
|
|
432
446
|
agentOptions: this.agentOptions(),
|
|
433
447
|
setup: composition.setup
|
|
434
|
-
})).agent;
|
|
448
|
+
}))).agent;
|
|
435
449
|
} catch (e_3) {
|
|
436
450
|
env_3.error = e_3;
|
|
437
451
|
env_3.hasError = true;
|
|
@@ -447,7 +461,7 @@ var ApiSessionAgentController = class {
|
|
|
447
461
|
throw new Error(`failed to ensure project directory "${cwd}": ${String(error)}`, { cause: error });
|
|
448
462
|
}
|
|
449
463
|
const composition = await this.composeAgent(presetId);
|
|
450
|
-
return (await this.ctx.agents.create({
|
|
464
|
+
return (await this.remember(this.ctx.agents.create({
|
|
451
465
|
sessionId,
|
|
452
466
|
agentOptions: this.agentOptions(),
|
|
453
467
|
meta: {
|
|
@@ -455,7 +469,20 @@ var ApiSessionAgentController = class {
|
|
|
455
469
|
...composition.agentPreset === void 0 ? {} : { agentPreset: composition.agentPreset }
|
|
456
470
|
},
|
|
457
471
|
setup: composition.setup
|
|
458
|
-
})).agent;
|
|
472
|
+
}))).agent;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Create a Web-owned Agent whose idle handle can be released before permanent deletion.
|
|
476
|
+
* @param options - Agent creation input shared by new Sessions and ordinary forks.
|
|
477
|
+
* @returns the owned Agent handle.
|
|
478
|
+
*/
|
|
479
|
+
createOwned(options) {
|
|
480
|
+
return this.remember(this.ctx.agents.create(options));
|
|
481
|
+
}
|
|
482
|
+
async remember(pending) {
|
|
483
|
+
const handle = await pending;
|
|
484
|
+
this.owned.set(handle.agent.session.id, handle);
|
|
485
|
+
return handle;
|
|
459
486
|
}
|
|
460
487
|
agentOptions() {
|
|
461
488
|
const { provider, model } = this.ctx.agentDefaultModel.currentSelection();
|
|
@@ -499,6 +526,7 @@ function agentModelSelection(selection) {
|
|
|
499
526
|
*/
|
|
500
527
|
async function buildModelCatalog(ctx, defaultSelection = ctx.agentDefaultModel.currentSelection()) {
|
|
501
528
|
const providers = ctx.llm.listProviders();
|
|
529
|
+
const customProviders = new Set(ctx.llm.listConfigurableProviders().filter((provider) => provider.settingsNs === "llm-pi-ai" && provider.declared === true).map((provider) => provider.provider));
|
|
502
530
|
const catalog = await Promise.all(providers.map(async (provider) => {
|
|
503
531
|
try {
|
|
504
532
|
const models = await ctx.llm.listModels(provider.id);
|
|
@@ -515,6 +543,7 @@ async function buildModelCatalog(ctx, defaultSelection = ctx.agentDefaultModel.c
|
|
|
515
543
|
return {
|
|
516
544
|
id: model.id,
|
|
517
545
|
name: model.name,
|
|
546
|
+
...resolved.inputModalities === void 0 ? {} : { inputModalities: [...resolved.inputModalities] },
|
|
518
547
|
...model.description === void 0 ? {} : { description: model.description },
|
|
519
548
|
...reasoning === void 0 ? {} : { reasoning }
|
|
520
549
|
};
|
|
@@ -524,7 +553,8 @@ async function buildModelCatalog(ctx, defaultSelection = ctx.agentDefaultModel.c
|
|
|
524
553
|
group: {
|
|
525
554
|
id: provider.id,
|
|
526
555
|
name: provider.name,
|
|
527
|
-
models: entries
|
|
556
|
+
models: entries,
|
|
557
|
+
...customProviders.has(provider.id) ? { custom: true } : {}
|
|
528
558
|
}
|
|
529
559
|
};
|
|
530
560
|
} catch (error) {
|
|
@@ -539,8 +569,12 @@ async function buildModelCatalog(ctx, defaultSelection = ctx.agentDefaultModel.c
|
|
|
539
569
|
}
|
|
540
570
|
}));
|
|
541
571
|
const groups = catalog.flatMap((item) => item.kind === "group" ? [item.group] : []).filter((group) => group.models.length > 0);
|
|
572
|
+
const savedDisplayName = ctx.agentDefaultModel.sharedDisplayName();
|
|
573
|
+
const processSelection = ctx.agentDefaultModel.usesSharedPreference();
|
|
542
574
|
return {
|
|
543
|
-
default: { ...defaultSelection },
|
|
575
|
+
default: { ...processSelection ? await ctx.agentDefaultModel.resolveSelection() : defaultSelection },
|
|
576
|
+
...processSelection ? { selectionScope: "process" } : {},
|
|
577
|
+
...savedDisplayName === void 0 ? {} : { savedDisplayName },
|
|
544
578
|
routableProviders: groups.map((group) => group.id),
|
|
545
579
|
groups,
|
|
546
580
|
failures: catalog.flatMap((item) => item.kind === "failure" ? [item.failure] : [])
|
|
@@ -713,9 +747,9 @@ var SessionCommandController = class {
|
|
|
713
747
|
};
|
|
714
748
|
}
|
|
715
749
|
/**
|
|
716
|
-
* Validate and install one
|
|
750
|
+
* Validate, persist the default, and install one model selection before acknowledging success.
|
|
717
751
|
* @param request - Session identity and requested model selection.
|
|
718
|
-
* @returns the normalized selection
|
|
752
|
+
* @returns the normalized selection after the shared save and Session selection succeed.
|
|
719
753
|
*/
|
|
720
754
|
async selectModel(request) {
|
|
721
755
|
const agent = await this.resolveAgent(request.sessionId);
|
|
@@ -732,10 +766,24 @@ var SessionCommandController = class {
|
|
|
732
766
|
model: resolved.model,
|
|
733
767
|
...resolved.reasoningEffort === void 0 ? {} : { reasoningEffort: resolved.reasoningEffort }
|
|
734
768
|
};
|
|
735
|
-
this.
|
|
736
|
-
|
|
737
|
-
this.ctx.
|
|
738
|
-
})
|
|
769
|
+
const info = await this.ctx.llm.resolveModelInfo(selected.provider, selected.model);
|
|
770
|
+
try {
|
|
771
|
+
await this.ctx.agentDefaultModel.saveSelection(selected, info.name);
|
|
772
|
+
} catch (error) {
|
|
773
|
+
throw new RemoteError("session/model-save-failed", `model selection was not changed because the default could not be saved: ${String(error)}`, {
|
|
774
|
+
provider: selected.provider,
|
|
775
|
+
model: selected.model
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
this.ctx.emit("api-session/model-updated");
|
|
779
|
+
try {
|
|
780
|
+
this.agents.selectForNextRequest(agent, selected);
|
|
781
|
+
} catch (error) {
|
|
782
|
+
throw new RemoteError("session/model-install-failed", `the default model was saved, but the Session selection could not be recorded: ${String(error)}`, {
|
|
783
|
+
provider: selected.provider,
|
|
784
|
+
model: selected.model
|
|
785
|
+
});
|
|
786
|
+
}
|
|
739
787
|
return { selected: { ...selected } };
|
|
740
788
|
} catch (error) {
|
|
741
789
|
if (remoteErrorOf(error) !== void 0) throw error;
|
|
@@ -807,7 +855,7 @@ var SessionCommandController = class {
|
|
|
807
855
|
const composition = await this.agents.composeAgent(this.agents.presetForObservation(source));
|
|
808
856
|
try {
|
|
809
857
|
const { provider, model } = this.ctx.agentDefaultModel.currentSelection();
|
|
810
|
-
await this.
|
|
858
|
+
await this.agents.createOwned({
|
|
811
859
|
sessionId: childId,
|
|
812
860
|
seed,
|
|
813
861
|
inheritedEventCount: SessionLogOffset(boundary + 1),
|
|
@@ -867,6 +915,13 @@ var SessionCommandController = class {
|
|
|
867
915
|
hasError: false
|
|
868
916
|
};
|
|
869
917
|
try {
|
|
918
|
+
if (this.ctx.agentDefaultModel.usesSharedPreference()) {
|
|
919
|
+
const route = await this.ctx.agentDefaultModel.resolveSelection();
|
|
920
|
+
if (route.provider === "" || route.model === "") throw new RemoteError("session/model-unavailable", "the selected model is unavailable; select a model before sending a message", {
|
|
921
|
+
provider: route.provider,
|
|
922
|
+
model: route.model
|
|
923
|
+
});
|
|
924
|
+
}
|
|
870
925
|
if (hasImage) {
|
|
871
926
|
const current = this.agents.selectionFor(agent).current;
|
|
872
927
|
const model = await this.ctx.llm.resolveModelInfo(current.provider, current.model);
|
|
@@ -895,7 +950,7 @@ var SessionCommandController = class {
|
|
|
895
950
|
}
|
|
896
951
|
return { accepted: true };
|
|
897
952
|
};
|
|
898
|
-
return hasImage ? this.agents.serializeImageAdmission(agent, admit) : admit();
|
|
953
|
+
return hasImage || this.ctx.agentDefaultModel.usesSharedPreference() ? this.agents.serializeImageAdmission(agent, admit) : admit();
|
|
899
954
|
}
|
|
900
955
|
async requireModel(selection) {
|
|
901
956
|
if (!await modelAvailable(this.ctx, selection)) throw new RemoteError("session/model-unavailable", "Select an available model before sending a message.", {
|
|
@@ -1787,6 +1842,7 @@ const SEARCH_PROVIDER_CALL_LIMIT = 100;
|
|
|
1787
1842
|
const SESSION_SEARCH_QUERY_MAX_CHARS = 500;
|
|
1788
1843
|
const MESSAGE_TYPES = new Set(["user/message", "assistant/message"]);
|
|
1789
1844
|
const sessionListMetadataSchema = z$1.object({
|
|
1845
|
+
hasUserPrompt: z$1.boolean().default(false),
|
|
1790
1846
|
blank: z$1.boolean(),
|
|
1791
1847
|
lastPromptAt: z$1.number().nullable()
|
|
1792
1848
|
});
|
|
@@ -1806,12 +1862,21 @@ const imageLimitsSchema = z$1.object({
|
|
|
1806
1862
|
*/
|
|
1807
1863
|
function applySessionListMetadata(state, event) {
|
|
1808
1864
|
const blank = state.blank && event.type !== "turn/start";
|
|
1865
|
+
const hasUserPrompt = state.hasUserPrompt === true || hasHumanInput(event);
|
|
1809
1866
|
const lastPromptAt = event.type === "user/message" && event.data.source.kind === "user" ? event.time : state.lastPromptAt;
|
|
1810
|
-
return blank === state.blank && lastPromptAt === state.lastPromptAt ? state : {
|
|
1867
|
+
return blank === state.blank && lastPromptAt === state.lastPromptAt && hasUserPrompt === state.hasUserPrompt ? state : {
|
|
1811
1868
|
blank,
|
|
1812
|
-
lastPromptAt
|
|
1869
|
+
lastPromptAt,
|
|
1870
|
+
hasUserPrompt
|
|
1813
1871
|
};
|
|
1814
1872
|
}
|
|
1873
|
+
/** User-origin text or media is conversation input; injected context is not. */
|
|
1874
|
+
function hasHumanInput(event) {
|
|
1875
|
+
return (event.type === "user/message" ? [{
|
|
1876
|
+
...event.data,
|
|
1877
|
+
role: "user"
|
|
1878
|
+
}] : event.type === "agent/inbox/spliced" ? event.data.inserted : []).some((message) => message.role === "user" && message.source.kind === "user" && message.content.some((block) => block.type !== "text" || block.text.trim() !== ""));
|
|
1879
|
+
}
|
|
1815
1880
|
/**
|
|
1816
1881
|
* Return the longest prefix containing at most `maximum` Unicode code points.
|
|
1817
1882
|
* @param value - source text.
|
|
@@ -1831,6 +1896,10 @@ function truncateUnicodeCodePoints(value, maximum) {
|
|
|
1831
1896
|
/** Owns list projection registration, bounded cold summaries, and authorized search. */
|
|
1832
1897
|
var ApiSessionList = class {
|
|
1833
1898
|
ctx;
|
|
1899
|
+
backfillAbort = new AbortController();
|
|
1900
|
+
backfills = /* @__PURE__ */ new Set();
|
|
1901
|
+
checkedRevisions = /* @__PURE__ */ new Map();
|
|
1902
|
+
backfill = Promise.resolve();
|
|
1834
1903
|
/** @param ctx - Host context carrying Session, query, persistence, and projection services. */
|
|
1835
1904
|
constructor(ctx) {
|
|
1836
1905
|
this.ctx = ctx;
|
|
@@ -1839,14 +1908,22 @@ var ApiSessionList = class {
|
|
|
1839
1908
|
stateSchema: sessionListMetadataSchema,
|
|
1840
1909
|
init: () => ({
|
|
1841
1910
|
blank: true,
|
|
1842
|
-
lastPromptAt: null
|
|
1911
|
+
lastPromptAt: null,
|
|
1912
|
+
hasUserPrompt: false
|
|
1843
1913
|
}),
|
|
1844
1914
|
apply: applySessionListMetadata,
|
|
1845
1915
|
wire: {
|
|
1846
1916
|
viewSchema: sessionListMetadataSchema,
|
|
1847
1917
|
view: (state) => state
|
|
1848
1918
|
},
|
|
1849
|
-
stateVersion:
|
|
1919
|
+
stateVersion: 2
|
|
1920
|
+
});
|
|
1921
|
+
ctx.effect(() => async () => {
|
|
1922
|
+
this.backfillAbort.abort();
|
|
1923
|
+
await this.backfill;
|
|
1924
|
+
}, "session-list: stop summary backfill");
|
|
1925
|
+
ctx.on("session/event", (session, event) => {
|
|
1926
|
+
if (hasHumanInput(event)) ctx.emit("api-session/added", this.summaryFor(session));
|
|
1850
1927
|
});
|
|
1851
1928
|
ctx.inject(["attachments"], (attachmentCtx) => {
|
|
1852
1929
|
ctx.sessionProjections.register({
|
|
@@ -1888,6 +1965,8 @@ var ApiSessionList = class {
|
|
|
1888
1965
|
async list(signal) {
|
|
1889
1966
|
signal?.throwIfAborted();
|
|
1890
1967
|
const records = await this.ctx.sessionQuery.listSessions(signal);
|
|
1968
|
+
const listedIds = new Set(records.map((record) => record.header.id));
|
|
1969
|
+
for (const id of this.checkedRevisions.keys()) if (!listedIds.has(id)) this.checkedRevisions.delete(id);
|
|
1891
1970
|
signal?.throwIfAborted();
|
|
1892
1971
|
const items = [];
|
|
1893
1972
|
const cold = [];
|
|
@@ -1911,6 +1990,7 @@ var ApiSessionList = class {
|
|
|
1911
1990
|
async summarizeCold(header) {
|
|
1912
1991
|
const projections = await this.projectionsFor(header, void 0);
|
|
1913
1992
|
const metadata = projections?.values.sessionListMetadata;
|
|
1993
|
+
if (metadata?.hasUserPrompt !== true) this.backfillCold(header.id);
|
|
1914
1994
|
return {
|
|
1915
1995
|
sessionId: header.id,
|
|
1916
1996
|
updatedAt: updatedAt(header, metadata),
|
|
@@ -1921,6 +2001,58 @@ var ApiSessionList = class {
|
|
|
1921
2001
|
...projections === void 0 ? {} : { projections }
|
|
1922
2002
|
};
|
|
1923
2003
|
}
|
|
2004
|
+
/** Serialize missing summaries outside list latency; unreadable history stays unknown. */
|
|
2005
|
+
backfillCold(sessionId) {
|
|
2006
|
+
if (this.backfillAbort.signal.aborted || this.backfills.has(sessionId)) return;
|
|
2007
|
+
const persistence = this.ctx.get("sessionPersistence");
|
|
2008
|
+
const cache = this.ctx.get("sessionProjectionCache");
|
|
2009
|
+
if (persistence === void 0 || cache === void 0) return;
|
|
2010
|
+
this.backfills.add(sessionId);
|
|
2011
|
+
this.backfill = this.backfill.then(async () => {
|
|
2012
|
+
const signal = this.backfillAbort.signal;
|
|
2013
|
+
signal.throwIfAborted();
|
|
2014
|
+
const live = this.ctx.sessions.get(sessionId);
|
|
2015
|
+
if (live !== void 0) {
|
|
2016
|
+
this.ctx.emit("api-session/added", this.summaryFor(live));
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
const before = await persistence.stat(sessionId, { signal });
|
|
2020
|
+
if (before === void 0 || before.revision === this.checkedRevisions.get(sessionId)) return;
|
|
2021
|
+
const handle = await persistence.open(sessionId, "read", { signal });
|
|
2022
|
+
let snapshot;
|
|
2023
|
+
try {
|
|
2024
|
+
const read = await handle.read(SessionLogOffset(0), void 0, { signal });
|
|
2025
|
+
signal.throwIfAborted();
|
|
2026
|
+
const after = await persistence.stat(sessionId, { signal });
|
|
2027
|
+
if (after?.revision !== before.revision || after.header.createdAt !== handle.header.createdAt) return;
|
|
2028
|
+
snapshot = await cache.coldSnapshot(handle.header, handle.inheritedEventCount, read.events);
|
|
2029
|
+
this.checkedRevisions.set(sessionId, before.revision);
|
|
2030
|
+
} finally {
|
|
2031
|
+
await handle.close();
|
|
2032
|
+
}
|
|
2033
|
+
signal.throwIfAborted();
|
|
2034
|
+
const attached = this.ctx.sessions.get(sessionId);
|
|
2035
|
+
if (attached !== void 0) {
|
|
2036
|
+
this.ctx.emit("api-session/added", this.summaryFor(attached));
|
|
2037
|
+
return;
|
|
2038
|
+
}
|
|
2039
|
+
if ((await persistence.stat(sessionId, { signal }))?.revision !== before.revision) return;
|
|
2040
|
+
const projections = hintsOf("cached", snapshot);
|
|
2041
|
+
this.ctx.emit("api-session/added", {
|
|
2042
|
+
sessionId,
|
|
2043
|
+
updatedAt: updatedAt(handle.header, snapshot.values.sessionListMetadata),
|
|
2044
|
+
agentAvailable: false,
|
|
2045
|
+
running: false,
|
|
2046
|
+
blank: snapshot.values.sessionListMetadata?.blank ?? false,
|
|
2047
|
+
...listFields(handle.header),
|
|
2048
|
+
...projections === void 0 ? {} : { projections }
|
|
2049
|
+
});
|
|
2050
|
+
}).catch((error) => {
|
|
2051
|
+
if (!this.backfillAbort.signal.aborted) this.ctx.logger.warn(`api-session.list: summary backfill for "${sessionId}" failed: ${String(error)}`);
|
|
2052
|
+
}).finally(() => {
|
|
2053
|
+
this.backfills.delete(sessionId);
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
1924
2056
|
/**
|
|
1925
2057
|
* Search current visible message content without activating any matching Session.
|
|
1926
2058
|
* @param query - literal message-content query.
|
|
@@ -2452,7 +2584,7 @@ const ArchivedSessionGate = {
|
|
|
2452
2584
|
* @returns whether an archived Session owns the step.
|
|
2453
2585
|
*/
|
|
2454
2586
|
function underArchivedSession(ctx, agent) {
|
|
2455
|
-
const archived = ctx.workspaceRegistry.archivedSessionIds;
|
|
2587
|
+
const archived = [...ctx.workspaceRegistry.archivedSessionIds, ...ctx.workspaceRegistry.deletedSessionIds];
|
|
2456
2588
|
let header = agent.session.header;
|
|
2457
2589
|
const visited = /* @__PURE__ */ new Set();
|
|
2458
2590
|
while (!visited.has(header.id)) {
|
|
@@ -2882,6 +3014,9 @@ let SessionController = (() => {
|
|
|
2882
3014
|
ctx.plugin(SessionMediaReferences);
|
|
2883
3015
|
ctx.plugin(SessionSkillCatalog);
|
|
2884
3016
|
ctx.plugin(ArchivedSessionGate);
|
|
3017
|
+
ctx.on("session/deleted", (ids) => {
|
|
3018
|
+
for (const id of ids) ctx.emit("api-session/removed", id);
|
|
3019
|
+
});
|
|
2885
3020
|
ctx.on("session/created", (session) => {
|
|
2886
3021
|
ctx.emit("api-session/added", this.listState.summaryFor(session));
|
|
2887
3022
|
});
|
|
@@ -2980,22 +3115,24 @@ let SessionController = (() => {
|
|
|
2980
3115
|
* @param request - requested identity, location, and Agent preset.
|
|
2981
3116
|
* @returns the Session identity and resolved preset when configured.
|
|
2982
3117
|
*/
|
|
2983
|
-
create(request) {
|
|
3118
|
+
async create(request) {
|
|
3119
|
+
if (request.sessionId !== void 0) await this.assertNotDeleted(request.sessionId);
|
|
2984
3120
|
return this.commands.create(request);
|
|
2985
3121
|
}
|
|
2986
3122
|
/**
|
|
2987
|
-
* Select
|
|
3123
|
+
* Select a model after explicitly resuming the Session and awaiting default persistence.
|
|
2988
3124
|
* @param request - Session identity and requested model selection.
|
|
2989
|
-
* @returns the normalized selection
|
|
3125
|
+
* @returns the normalized selection after the shared save and Session selection succeed.
|
|
2990
3126
|
*/
|
|
2991
3127
|
selectModel(request) {
|
|
2992
|
-
return this.commands.selectModel(request);
|
|
3128
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.selectModel(request));
|
|
2993
3129
|
}
|
|
2994
3130
|
/**
|
|
2995
|
-
*
|
|
3131
|
+
* Initialize legacy account deployments without changing a product process's cached selection.
|
|
2996
3132
|
* @returns after saving the first available model or retaining the existing default.
|
|
2997
3133
|
*/
|
|
2998
3134
|
async initializeDefaultModel() {
|
|
3135
|
+
if (this.ctx.agentDefaultModel.usesSharedPreference()) return;
|
|
2999
3136
|
const provider = "deepseek-account";
|
|
3000
3137
|
if (await hasProviderApiKey(this.ctx)) return;
|
|
3001
3138
|
const model = (await buildModelCatalog(this.ctx)).groups.find((group) => group.id === provider)?.models[0];
|
|
@@ -3005,7 +3142,8 @@ let SessionController = (() => {
|
|
|
3005
3142
|
model: model.id,
|
|
3006
3143
|
...model.reasoning?.defaultEffort === void 0 ? {} : { reasoningEffort: ReasoningEffortId(model.reasoning.defaultEffort) }
|
|
3007
3144
|
};
|
|
3008
|
-
await this.ctx.agentDefaultModel.saveSelection(selection);
|
|
3145
|
+
await this.ctx.agentDefaultModel.saveSelection(selection, model.name);
|
|
3146
|
+
this.ctx.emit("api-session/model-updated");
|
|
3009
3147
|
}
|
|
3010
3148
|
/**
|
|
3011
3149
|
* Describe every currently routable model for Host-generation selectors.
|
|
@@ -3087,7 +3225,7 @@ let SessionController = (() => {
|
|
|
3087
3225
|
* @returns the accepted title and durable event sequence.
|
|
3088
3226
|
*/
|
|
3089
3227
|
rename(request) {
|
|
3090
|
-
return this.commands.rename(request);
|
|
3228
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.rename(request));
|
|
3091
3229
|
}
|
|
3092
3230
|
/**
|
|
3093
3231
|
* Fork one cold-readable exact event prefix into a new Session. An omitted
|
|
@@ -3097,7 +3235,7 @@ let SessionController = (() => {
|
|
|
3097
3235
|
* @returns the new Session identity.
|
|
3098
3236
|
*/
|
|
3099
3237
|
fork(request) {
|
|
3100
|
-
return this.commands.fork(request);
|
|
3238
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.fork(request));
|
|
3101
3239
|
}
|
|
3102
3240
|
/**
|
|
3103
3241
|
* Admit one prompt after explicitly resuming its Session.
|
|
@@ -3107,7 +3245,7 @@ let SessionController = (() => {
|
|
|
3107
3245
|
*/
|
|
3108
3246
|
prompt(request, signal) {
|
|
3109
3247
|
signal.throwIfAborted();
|
|
3110
|
-
return this.commands.prompt(request);
|
|
3248
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.prompt(request));
|
|
3111
3249
|
}
|
|
3112
3250
|
/**
|
|
3113
3251
|
* Read one image proven reachable from the addressed Session log.
|
|
@@ -3115,7 +3253,7 @@ let SessionController = (() => {
|
|
|
3115
3253
|
* @returns the durable attachment reference and base64-encoded bytes.
|
|
3116
3254
|
*/
|
|
3117
3255
|
attachment(request) {
|
|
3118
|
-
return this.commands.attachment(request);
|
|
3256
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.attachment(request));
|
|
3119
3257
|
}
|
|
3120
3258
|
/**
|
|
3121
3259
|
* Mutate one still-pending queue occurrence, resuming a cold Agent first.
|
|
@@ -3123,7 +3261,7 @@ let SessionController = (() => {
|
|
|
3123
3261
|
* @returns acknowledgement that the queue mutation was applied.
|
|
3124
3262
|
*/
|
|
3125
3263
|
updateQueue(request) {
|
|
3126
|
-
return this.commands.updateQueue(request);
|
|
3264
|
+
return this.assertNotDeleted(request.sessionId).then(() => this.commands.updateQueue(request));
|
|
3127
3265
|
}
|
|
3128
3266
|
/**
|
|
3129
3267
|
* Cancel one active Agent turn without dropping its pending inbox.
|
|
@@ -3140,7 +3278,7 @@ let SessionController = (() => {
|
|
|
3140
3278
|
* @returns one chronological page.
|
|
3141
3279
|
*/
|
|
3142
3280
|
page(request, signal) {
|
|
3143
|
-
return this.history.page(request, signal);
|
|
3281
|
+
return this.assertNotDeleted(request.address.kind === "session" ? request.address.sessionId : request.address.childSessionId).then(() => this.history.page(request, signal));
|
|
3144
3282
|
}
|
|
3145
3283
|
/**
|
|
3146
3284
|
* Follow one Session log from its opening or resume cursor.
|
|
@@ -3149,8 +3287,13 @@ let SessionController = (() => {
|
|
|
3149
3287
|
* @returns a complete opening snapshot followed by gap-free durable event
|
|
3150
3288
|
* frames and optional cursorless assistant-stream frames.
|
|
3151
3289
|
*/
|
|
3152
|
-
follow(request, signal) {
|
|
3153
|
-
|
|
3290
|
+
async *follow(request, signal) {
|
|
3291
|
+
await this.assertNotDeleted(request.address.kind === "session" ? request.address.sessionId : request.address.childSessionId);
|
|
3292
|
+
yield* this.history.follow(request, signal);
|
|
3293
|
+
}
|
|
3294
|
+
async assertNotDeleted(sessionId) {
|
|
3295
|
+
await this.ctx.workspaceRegistry.refresh();
|
|
3296
|
+
if (this.ctx.workspaceRegistry.deletedSessionIds.includes(sessionId)) throw new RemoteError("session/not-found", "Session has been permanently deleted", { sessionId });
|
|
3154
3297
|
}
|
|
3155
3298
|
/**
|
|
3156
3299
|
* Read all registered projections without activating an Agent.
|
|
@@ -3161,6 +3304,7 @@ let SessionController = (() => {
|
|
|
3161
3304
|
async projections(request, signal) {
|
|
3162
3305
|
const { sessionId } = request;
|
|
3163
3306
|
if (sessionId.length === 0) throw new RemoteError("gateway/bad-request", "sessionId must not be empty", {});
|
|
3307
|
+
await this.assertNotDeleted(sessionId);
|
|
3164
3308
|
try {
|
|
3165
3309
|
const env_2 = {
|
|
3166
3310
|
stack: [],
|