@songtonyli/dsh-cli 0.1.88 → 0.1.90
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.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/cordis/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-group/package.json +3 -3
- package/node_modules/@deepseek-ai/cordis-plugin-include/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-timer/package.json +3 -3
- package/node_modules/@deepseek-ai/cosmokit/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh/package.json +127 -125
- package/node_modules/@deepseek-ai/dsh-acp/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-acp-app/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-action-cards/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-agent/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +8 -6
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-agent-preset/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +7 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-api-account-controller/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-api-authorization-controller/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/index.js +10 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/index.js +7 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-api-job-controller/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-api-remote-access/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remote-access/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-remote-access/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-remote-access/lib/typert.host.js +5 -1
- package/node_modules/@deepseek-ai/dsh-api-remote-access/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +1541 -184
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/client/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +45 -44
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +6 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +6 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +56 -27
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +1426 -454
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +715 -57
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +560 -40
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/session.js +70 -35
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/transport.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +5 -102
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.js +80 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +294 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.js +297 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history.js +52 -341
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +98 -67
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.js +289 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.js +112 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.js +139 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +77 -75
- package/node_modules/@deepseek-ai/dsh-api-settings-controller/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-app-boot/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-app-boot/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +143 -7
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-attachment/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-attachment/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-attachment/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-attachment/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/lib/types/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-attachment-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-authorization/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-base/package.json +100 -100
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-brand/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-chunked-list/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-client-file-upload/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-resources/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-action-cards/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +7 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +7 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +245 -76
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +290 -290
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +34 -34
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +19 -59
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-file-drag/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.md +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.zh.md +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +3 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +28 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +118 -69
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +15 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +164 -106
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-recommendations/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-secret-mask/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-session/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +4 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/lib/client.js +176 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/lib/client.js +42 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +10 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +5 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +29 -29
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +158 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/index.js +239 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/typert.host.js +75 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/typert.remote-client.js +64 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +43 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +8 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +36 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-commands/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-compaction-image-offload/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-computer-use/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-config-editor/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +98 -40
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +14 -6
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cua/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-cua/README.md +16 -7
- package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +16 -7
- package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +18 -38
- package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +342 -146
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.host.js +19 -20
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.remote-client.js +13 -14
- package/node_modules/@deepseek-ai/dsh-cua/package.json +53 -50
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.md +9 -9
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.zh.md +9 -9
- package/node_modules/@deepseek-ai/dsh-cua-bundle/package.json +12 -8
- package/node_modules/@deepseek-ai/dsh-deepseek-account/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-deliverable-file-references/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-deque/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/DETAIL.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/DETAIL.zh.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/typert.host.js +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/typert.remote-client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +45 -45
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +135 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +135 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +8745 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +3131 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +2222 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +1284 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/package.json +117 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/README.i18n.yaml +43 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/README.md +121 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/README.zh.md +121 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/lib/client.js +6272 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/package.json +71 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/docs/DETAIL.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/docs/DETAIL.zh.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.md +100 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.zh.md +100 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/lib/index.js +495 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/package.json +45 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.md +77 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.zh.md +77 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/cordis.patch.yml +17 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/icon.svg +11 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/package.json +53 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.zh.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/lib/index.js +813 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +47 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/README.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/README.zh.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/lib/index.js +844 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/package.json +88 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/README.i18n.yaml +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/cordis.patch.yml +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/docs/DETAIL.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/docs/DETAIL.zh.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/package.json +7 -6
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.i18n.yaml +52 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.md +177 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.zh.md +177 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/cordis.patch.yml +17 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/icon.svg +12 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/client.js +7130 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/index.js +7781 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/owner-gateway/cli.js +370 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/retry-backoff-ccJYtzOj.js +121 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/typert.host.js +767 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/typert.remote-client.js +551 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/viewer-declarations-krUNq6VU.js +287 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/viewer-declarations.js +26 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +160 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/README.md +93 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/README.zh.md +93 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/lib/index.js +738 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/package.json +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/DETAIL.md +1 -18
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/DETAIL.zh.md +1 -18
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/preview.svg +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/preview.zh.svg +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/docs/DETAIL.md +0 -10
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/docs/DETAIL.zh.md +0 -10
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/docs/DETAIL.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/docs/DETAIL.zh.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-experimental-translator/package.json +29 -29
- package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/index.js +213 -54
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/package.json +24 -25
- package/node_modules/@deepseek-ai/dsh-file-reference/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-file-reference-local/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-fs/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-goal/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-harness-dev-context/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-headless/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-hmr/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.md +2 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.zh.md +2 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/lib/index.js +5 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/index.js +10 -1
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/typert.host.js +1 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/typert.remote-client.js +1 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/types/index.js +13 -1
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-host-product-telemetry-otel/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-http-proxy/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-lazy-require/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +40 -3
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-llm/package.json +11 -10
- package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +264 -93
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +45 -45
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/index.js +8 -15
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/index.js +12 -17
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js +3 -2
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-resources/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-message-quotes/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-official-bundles/lib/index.js +6 -2
- package/node_modules/@deepseek-ai/dsh-official-bundles/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-otel/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.md +1 -0
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.zh.md +1 -0
- package/node_modules/@deepseek-ai/dsh-package-manifest/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-persona/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-personalized-recommendations/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-plugin-detail/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +8 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +8 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +166 -34
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +60 -37
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +37 -35
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.js +72 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +137 -31
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +26 -4
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/tools.js +1 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +43 -39
- package/node_modules/@deepseek-ai/dsh-plugin-market/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-plugin-market-index/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.md +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.zh.md +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/lib/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +29 -29
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +50 -22
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +49 -21
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/configuration.js +24 -0
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +413 -597
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/persistent-process.js +5853 -125
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/process.js +5865 -91
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +31 -24
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/runner.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types-DFdfvhLN.js +1411 -0
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +37 -37
- package/node_modules/@deepseek-ai/dsh-scope/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-sdk-app/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-session-format/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-catalog/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +6 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +5 -2
- package/node_modules/@deepseek-ai/dsh-session-projection/README.md +15 -0
- package/node_modules/@deepseek-ai/dsh-session-projection/README.zh.md +15 -0
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/index.js +4 -2
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/types/index.js +3 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +41 -41
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-turn-outline/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-settings/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-shell/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-skill/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-skill/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.zh.md +3 -2
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/lib/index.js +14 -3
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-skill-office/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-spill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +35 -35
- package/node_modules/@deepseek-ai/dsh-storage/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-storage/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-storage/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-storage/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/lib/index.js +10 -12
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-storage-json/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-storage-json/README.md +9 -7
- package/node_modules/@deepseek-ai/dsh-storage-json/README.zh.md +9 -7
- package/node_modules/@deepseek-ai/dsh-storage-json/lib/index.js +50 -49
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +51 -51
- package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +37 -37
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +789 -26
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-executor-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/index.js +9 -3
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/errors.js +2 -1
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ptc.js +7 -2
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ts-types.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +8 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +36 -36
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.i18n.yaml +9 -6
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.md +19 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.zh.md +19 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/lib/index.js +21 -8
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-goal/lib/index.js +5 -10
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-present/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +35 -35
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-tool-session-query/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.i18n.yaml +23 -14
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.md +27 -8
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.zh.md +27 -8
- package/node_modules/@deepseek-ai/dsh-tool-skill/lib/index.js +27 -20
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +7 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +7 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +145 -211
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +25 -27
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-tool-terminal/package.json +32 -32
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-tools/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +24 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +85 -85
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-user-questions/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-user-questions/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-user-questions/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-util-code-language/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-crypto/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-time/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-values/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-web/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +0 -3
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +150 -151
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.md +6 -3
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.zh.md +6 -3
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/lib/index.js +32 -21
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{index-UeToUMuD.js → index--TtJvO-i.js} +84 -84
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{index-91FlLSYh.css → index-Jtzf36XE.css} +1 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{graphql-BIiNFDN_.js → graphql-C-Uijqkk.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{http-DIhnzaXE.js → http-CLu1VCSi.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{php-B4EoFdzs.js → php-CjQPq1Mz.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{rst-BHSXxbFM.js → rst-BuDKiyD7.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{ruby-DYyEMX7k.js → ruby-ZtjE4NPI.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{svelte-CwMGesqy.js → svelte-Tt81icjn.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{vue-DgeFhH50.js → vue-B5SDFeDA.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{vendor-D3p0kQ7Q.js → vendor-7utBqO4o.js} +25 -25
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +3 -3
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +21 -20
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-web-search-exa/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-win32-process/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/lib/index.js +5 -1
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-working-directory/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +23 -23
- package/node_modules/@deepseek-ai/schemastery/package.json +2 -2
- package/node_modules/acorn/CHANGELOG.md +1012 -0
- package/node_modules/acorn/LICENSE +21 -0
- package/node_modules/acorn/README.md +309 -0
- package/node_modules/acorn/bin/acorn +4 -0
- package/node_modules/acorn/dist/acorn.js +6370 -0
- package/node_modules/acorn/dist/acorn.mjs +6341 -0
- package/node_modules/acorn/dist/bin.js +90 -0
- package/node_modules/acorn/package.json +47 -0
- package/node_modules/acorn-walk/CHANGELOG.md +209 -0
- package/node_modules/{@deepseek-ai/dsh-experimental-worktree → acorn-walk}/LICENSE +5 -5
- package/node_modules/acorn-walk/README.md +124 -0
- package/node_modules/acorn-walk/dist/walk.js +485 -0
- package/node_modules/acorn-walk/dist/walk.mjs +467 -0
- package/node_modules/acorn-walk/package.json +47 -0
- package/node_modules/shell-quote/.github/FUNDING.yml +12 -0
- package/node_modules/shell-quote/LICENSE +24 -0
- package/node_modules/shell-quote/README.md +246 -0
- package/node_modules/shell-quote/index.js +4 -0
- package/node_modules/shell-quote/package.json +66 -0
- package/node_modules/shell-quote/parse.js +382 -0
- package/node_modules/shell-quote/quote.js +85 -0
- package/node_modules/shell-quote/tsconfig.json +10 -0
- package/package.json +346 -326
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.i18n.yaml +0 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.md +0 -91
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.zh.md +0 -91
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/lib/client.js +0 -93
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/lib/index.js +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/de.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/es.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/fr.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/pt.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/ru.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/package.json +0 -59
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/directory.d.ts +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/index.d.ts +0 -54
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/process.d.ts +0 -29
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/types.d.ts +0 -20
|
@@ -2,9 +2,8 @@ import { hostname } from "node:os";
|
|
|
2
2
|
import { isAbsolute, resolve } from "node:path";
|
|
3
3
|
import { Service } from "@deepseek-ai/cordis";
|
|
4
4
|
import z from "@deepseek-ai/schemastery";
|
|
5
|
-
import { AssistantStreamAccumulator, ReasoningEffortId,
|
|
5
|
+
import { AssistantStreamAccumulator, ReasoningEffortId, createUserMessage, errorChain, freezeMessage } from "@deepseek-ai/dsh-llm";
|
|
6
6
|
import { canOpenNativePath, nativeFileApplications, nativeFileManager, openNativeAssociatedPath, openNativeFileApplication, revealNativePath } from "@deepseek-ai/dsh-native-command";
|
|
7
|
-
import { SessionQueryError } from "@deepseek-ai/dsh-session-query";
|
|
8
7
|
import { Remote, RemoteError, TypertRemoteService, principalOf, remoteErrorOf } from "@deepseek-ai/dsh-typert-protocol";
|
|
9
8
|
import { canonicalClientTimeZone } from "@deepseek-ai/dsh-util-time";
|
|
10
9
|
import { assertNever } from "@deepseek-ai/dsh-util-values";
|
|
@@ -12,12 +11,14 @@ import { randomUUID } from "node:crypto";
|
|
|
12
11
|
import { mkdir } from "node:fs/promises";
|
|
13
12
|
import { installModelSelection } from "@deepseek-ai/dsh-agent";
|
|
14
13
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
14
|
+
import { SessionQueryError } from "@deepseek-ai/dsh-session-query";
|
|
15
15
|
import { credentialRef } from "@deepseek-ai/dsh-credentials";
|
|
16
16
|
import { AttachmentError } from "@deepseek-ai/dsh-attachment";
|
|
17
17
|
import { buildForkSeed } from "@deepseek-ai/dsh-session/fork";
|
|
18
18
|
import { SessionLogOffset, SessionSeq, isAppendSurfaceEvent } from "@deepseek-ai/dsh-session";
|
|
19
19
|
import { SessionTitleInvalidError } from "@deepseek-ai/dsh-session-title";
|
|
20
20
|
import { Deque } from "@deepseek-ai/dsh-deque";
|
|
21
|
+
import { MAX_TIMER_DELAY_MS, deadline, timeoutOf } from "@deepseek-ai/dsh-timeout";
|
|
21
22
|
import { performance } from "node:perf_hooks";
|
|
22
23
|
import { scheduler } from "node:timers/promises";
|
|
23
24
|
import { z as z$1 } from "zod";
|
|
@@ -26,7 +27,7 @@ import { FsError } from "@deepseek-ai/dsh-fs";
|
|
|
26
27
|
import mime from "mime-types";
|
|
27
28
|
//#region lib/types/agent.js
|
|
28
29
|
/** Agent activation, composition, and initial model route owned by API Session. */
|
|
29
|
-
var __addDisposableResource$
|
|
30
|
+
var __addDisposableResource$6 = function(env, value, async) {
|
|
30
31
|
if (value !== null && value !== void 0) {
|
|
31
32
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
32
33
|
var dispose, inner;
|
|
@@ -55,7 +56,7 @@ var __addDisposableResource$4 = function(env, value, async) {
|
|
|
55
56
|
} else if (async) env.stack.push({ async: true });
|
|
56
57
|
return value;
|
|
57
58
|
};
|
|
58
|
-
var __disposeResources$
|
|
59
|
+
var __disposeResources$6 = (function(SuppressedError) {
|
|
59
60
|
return function(env) {
|
|
60
61
|
function fail(e) {
|
|
61
62
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
@@ -288,13 +289,13 @@ var ApiSessionAgentController = class {
|
|
|
288
289
|
hasError: false
|
|
289
290
|
};
|
|
290
291
|
try {
|
|
291
|
-
const observation = __addDisposableResource$
|
|
292
|
+
const observation = __addDisposableResource$6(env_1, await this.ctx.sessionQuery.observeSession(sessionId), false);
|
|
292
293
|
return await this.resumeObserved(sessionId, observation);
|
|
293
294
|
} catch (e_1) {
|
|
294
295
|
env_1.error = e_1;
|
|
295
296
|
env_1.hasError = true;
|
|
296
297
|
} finally {
|
|
297
|
-
__disposeResources$
|
|
298
|
+
__disposeResources$6(env_1);
|
|
298
299
|
}
|
|
299
300
|
} catch (error) {
|
|
300
301
|
if (error instanceof SessionQueryError && error.code === "SESSION_QUERY_SESSION_NOT_FOUND") throw new ApiSessionNotFound(`session "${sessionId}" not found`);
|
|
@@ -349,7 +350,7 @@ var ApiSessionAgentController = class {
|
|
|
349
350
|
hasError: false
|
|
350
351
|
};
|
|
351
352
|
try {
|
|
352
|
-
const observed = __addDisposableResource$
|
|
353
|
+
const observed = __addDisposableResource$6(env_2, observation, false);
|
|
353
354
|
if (hasApiSessionSubagentOwner(this.ctx, { header: observed.header }, void 0)) throw new ApiSessionSubagentOwnership(sessionId);
|
|
354
355
|
if (observed.header.cwd !== request.cwd) throw new ApiSessionCwdConflict(sessionId, request.cwd, observed.header.cwd);
|
|
355
356
|
reusable = request.reusable(sessionId) && !observed.events.some((event) => event.type === "turn/start");
|
|
@@ -357,7 +358,7 @@ var ApiSessionAgentController = class {
|
|
|
357
358
|
env_2.error = e_2;
|
|
358
359
|
env_2.hasError = true;
|
|
359
360
|
} finally {
|
|
360
|
-
__disposeResources$
|
|
361
|
+
__disposeResources$6(env_2);
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
364
|
const composition = await this.composeAgent(request.agentPreset);
|
|
@@ -488,7 +489,8 @@ async function buildModelCatalog(ctx, defaultSelection = ctx.agentDefaultModel.c
|
|
|
488
489
|
id: model.id,
|
|
489
490
|
name: model.name,
|
|
490
491
|
...model.description === void 0 ? {} : { description: model.description },
|
|
491
|
-
...reasoning === void 0 ? {} : { reasoning }
|
|
492
|
+
...reasoning === void 0 ? {} : { reasoning },
|
|
493
|
+
...model.badge === void 0 ? {} : { badge: model.badge }
|
|
492
494
|
};
|
|
493
495
|
}));
|
|
494
496
|
return {
|
|
@@ -560,7 +562,7 @@ async function hasProviderApiKey(ctx) {
|
|
|
560
562
|
//#endregion
|
|
561
563
|
//#region lib/types/commands.js
|
|
562
564
|
/** Session commands whose activation policy is explicit at each Remote method. */
|
|
563
|
-
var __addDisposableResource$
|
|
565
|
+
var __addDisposableResource$5 = function(env, value, async) {
|
|
564
566
|
if (value !== null && value !== void 0) {
|
|
565
567
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
566
568
|
var dispose, inner;
|
|
@@ -589,7 +591,7 @@ var __addDisposableResource$3 = function(env, value, async) {
|
|
|
589
591
|
} else if (async) env.stack.push({ async: true });
|
|
590
592
|
return value;
|
|
591
593
|
};
|
|
592
|
-
var __disposeResources$
|
|
594
|
+
var __disposeResources$5 = (function(SuppressedError) {
|
|
593
595
|
return function(env) {
|
|
594
596
|
function fail(e) {
|
|
595
597
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
@@ -771,7 +773,7 @@ var SessionCommandController = class {
|
|
|
771
773
|
if (error instanceof SessionQueryError && error.code === "SESSION_QUERY_SESSION_NOT_FOUND") throw new RemoteError("session/not-found", `session "${request.sessionId}" not found`, { sessionId: request.sessionId });
|
|
772
774
|
throw new RemoteError("gateway/internal", `fork source unavailable for session "${request.sessionId}": ${String(error)}`, {});
|
|
773
775
|
}
|
|
774
|
-
const source = __addDisposableResource$
|
|
776
|
+
const source = __addDisposableResource$5(env_1, observed, false);
|
|
775
777
|
const boundary = atSeq ?? latestCompletedPrefixBoundary(source.events);
|
|
776
778
|
if (boundary === void 0 || source.events[boundary]?.seq !== boundary) throw new RemoteError("session/fork-unavailable", request.atSeq === void 0 ? `session "${request.sessionId}" has no completed turn to fork from` : `event ${String(request.atSeq)} does not exist in session "${request.sessionId}" (last seq: ${String(source.events.at(-1)?.seq ?? "none")})`, { sessionId: request.sessionId });
|
|
777
779
|
const seed = buildForkSeed(source.events, boundary);
|
|
@@ -816,7 +818,7 @@ var SessionCommandController = class {
|
|
|
816
818
|
env_1.error = e_1;
|
|
817
819
|
env_1.hasError = true;
|
|
818
820
|
} finally {
|
|
819
|
-
__disposeResources$
|
|
821
|
+
__disposeResources$5(env_1);
|
|
820
822
|
}
|
|
821
823
|
}
|
|
822
824
|
/**
|
|
@@ -851,7 +853,7 @@ var SessionCommandController = class {
|
|
|
851
853
|
source
|
|
852
854
|
});
|
|
853
855
|
if (this.ctx.agents.get(agent.id) !== agent) throw new RemoteError("session/not-found", `session "${agent.id}" was disposed during prompt admission`, { sessionId: agent.id });
|
|
854
|
-
const binding = __addDisposableResource$
|
|
856
|
+
const binding = __addDisposableResource$5(env_2, this.ctx.fileUploads.bindPrompt(agent, admission.receiptIds, request.requestId), false);
|
|
855
857
|
if (request.mode === "steer") agent.steer(message);
|
|
856
858
|
else agent.followup(message);
|
|
857
859
|
binding.commit();
|
|
@@ -859,7 +861,7 @@ var SessionCommandController = class {
|
|
|
859
861
|
env_2.error = e_2;
|
|
860
862
|
env_2.hasError = true;
|
|
861
863
|
} finally {
|
|
862
|
-
__disposeResources$
|
|
864
|
+
__disposeResources$5(env_2);
|
|
863
865
|
}
|
|
864
866
|
} catch (error) {
|
|
865
867
|
if (remoteErrorOf(error) !== void 0) throw error;
|
|
@@ -877,35 +879,13 @@ var SessionCommandController = class {
|
|
|
877
879
|
});
|
|
878
880
|
}
|
|
879
881
|
/**
|
|
880
|
-
* Read one durable image
|
|
881
|
-
* @param request -
|
|
882
|
+
* Read one durable image using the supplied reference without consulting Session history.
|
|
883
|
+
* @param request - image reference and gateway permission scope; Session existence is not checked.
|
|
882
884
|
* @returns the durable attachment reference and base64-encoded bytes.
|
|
883
885
|
*/
|
|
884
886
|
async attachment(request) {
|
|
885
|
-
let ref;
|
|
886
|
-
try {
|
|
887
|
-
const env_3 = {
|
|
888
|
-
stack: [],
|
|
889
|
-
error: void 0,
|
|
890
|
-
hasError: false
|
|
891
|
-
};
|
|
892
|
-
try {
|
|
893
|
-
const observation = __addDisposableResource$3(env_3, await this.ctx.sessionQuery.observeSession(request.sessionId, { projectionMode: "none" }), false);
|
|
894
|
-
if (observation.source === "prepared" && observation.header.cwd === void 0) throw new ApiSessionNotFound(`session "${request.sessionId}" not found`);
|
|
895
|
-
ref = referencedImage(observation.events, String(request.attachmentId));
|
|
896
|
-
} catch (e_3) {
|
|
897
|
-
env_3.error = e_3;
|
|
898
|
-
env_3.hasError = true;
|
|
899
|
-
} finally {
|
|
900
|
-
__disposeResources$3(env_3);
|
|
901
|
-
}
|
|
902
|
-
} catch (error) {
|
|
903
|
-
if (error instanceof ApiSessionNotFound || error instanceof SessionQueryError && error.code === "SESSION_QUERY_SESSION_NOT_FOUND") throw new RemoteError("session/not-found", error.message, { sessionId: request.sessionId });
|
|
904
|
-
throw new RemoteError("gateway/internal", `attachment authorization unavailable for session "${request.sessionId}": ${String(error)}`, {});
|
|
905
|
-
}
|
|
906
|
-
if (ref === void 0) throw new RemoteError("session/attachment-invalid", "Image is not referenced by this session.", { reason: "ATTACHMENT_NOT_REFERENCED" });
|
|
907
887
|
try {
|
|
908
|
-
const stored = await this.ctx.attachments.readImage(
|
|
888
|
+
const stored = await this.ctx.attachments.readImage(request.attachment);
|
|
909
889
|
return {
|
|
910
890
|
attachment: stored.ref,
|
|
911
891
|
data: Buffer.from(stored.data).toString("base64")
|
|
@@ -1040,58 +1020,6 @@ function hasPromptRequest(agent, requestId) {
|
|
|
1040
1020
|
return source.kind === "user" && "rpcId" in source && source.rpcId === requestId;
|
|
1041
1021
|
});
|
|
1042
1022
|
}
|
|
1043
|
-
function imageBlockIn(content, match) {
|
|
1044
|
-
if (!Array.isArray(content)) return void 0;
|
|
1045
|
-
for (const value of content) {
|
|
1046
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) continue;
|
|
1047
|
-
const block = value;
|
|
1048
|
-
if (block.type === "image" && typeof block.attachment === "object" && block.attachment !== null) {
|
|
1049
|
-
const ref = block.attachment;
|
|
1050
|
-
if (match(ref)) return ref;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
/** Read only first-party declared content fields; unknown event payloads stay opaque. */
|
|
1055
|
-
function imageInEvent(event, match) {
|
|
1056
|
-
const data = event.data;
|
|
1057
|
-
switch (event.type) {
|
|
1058
|
-
case "user/message":
|
|
1059
|
-
case "tool/ptc-dispatch": return imageBlockIn(data.content, match);
|
|
1060
|
-
case "system/message":
|
|
1061
|
-
case "developer/message":
|
|
1062
|
-
case "tool/result":
|
|
1063
|
-
case "team/message/queued": return imageBlockIn(data.message?.content, match);
|
|
1064
|
-
case "agent/inbox/spliced": {
|
|
1065
|
-
const messages = data.inserted;
|
|
1066
|
-
if (!Array.isArray(messages)) return void 0;
|
|
1067
|
-
for (const message of messages) {
|
|
1068
|
-
if (typeof message !== "object" || message === null || Array.isArray(message)) continue;
|
|
1069
|
-
const found = imageBlockIn(message.content, match);
|
|
1070
|
-
if (found !== void 0) return found;
|
|
1071
|
-
}
|
|
1072
|
-
return;
|
|
1073
|
-
}
|
|
1074
|
-
case "compaction/summary": return imageBlockIn(data.summary, match) ?? imageBlockIn(data.rawOutput, match);
|
|
1075
|
-
case "assistant/message": {
|
|
1076
|
-
const found = imageBlockIn(data.message?.content, match);
|
|
1077
|
-
if (found !== void 0) return found;
|
|
1078
|
-
break;
|
|
1079
|
-
}
|
|
1080
|
-
case "assistant/attempt": break;
|
|
1081
|
-
default: return;
|
|
1082
|
-
}
|
|
1083
|
-
const assistant = event;
|
|
1084
|
-
for (const chunk of assistantStreamChunks(assistant.data.stream, "block-end")) {
|
|
1085
|
-
const found = imageBlockIn([chunk.block], match);
|
|
1086
|
-
if (found !== void 0) return found;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
function referencedImage(events, attachmentId) {
|
|
1090
|
-
for (const event of events) {
|
|
1091
|
-
const found = imageInEvent(event, (ref) => String(ref.attachmentId) === attachmentId);
|
|
1092
|
-
if (found !== void 0) return found;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
1023
|
//#endregion
|
|
1096
1024
|
//#region lib/types/control.js
|
|
1097
1025
|
/** Live Session projection state with reconnect baselines. */
|
|
@@ -1196,6 +1124,417 @@ var ControlQueue = class {
|
|
|
1196
1124
|
}
|
|
1197
1125
|
}
|
|
1198
1126
|
};
|
|
1127
|
+
const MESSAGE_TYPES$1 = new Set(["user/message", "assistant/message"]);
|
|
1128
|
+
/**
|
|
1129
|
+
* Reject an invalid message budget or turn window.
|
|
1130
|
+
* @param request - history window fields.
|
|
1131
|
+
*/
|
|
1132
|
+
function validateHistoryWindow(request) {
|
|
1133
|
+
if (request.maxMessages !== void 0 && (!Number.isSafeInteger(request.maxMessages) || request.maxMessages <= 0)) throw new RemoteError("gateway/bad-request", "maxMessages must be a positive safe integer", {});
|
|
1134
|
+
const window = request.turnWindow;
|
|
1135
|
+
if (window !== void 0) {
|
|
1136
|
+
if (!Number.isSafeInteger(window.minMessages) || window.minMessages <= 0 || window.minMessages > (request.maxMessages ?? 50)) throw new RemoteError("gateway/bad-request", "turnWindow.minMessages must be a positive safe integer no greater than maxMessages", {});
|
|
1137
|
+
if (!Number.isSafeInteger(window.minTurns) || window.minTurns <= 0) throw new RemoteError("gateway/bad-request", "turnWindow.minTurns must be a positive safe integer", {});
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Select the Session whose log an address names.
|
|
1142
|
+
* @param address - ordinary Session or direct-subagent address.
|
|
1143
|
+
* @returns the Session whose log the address reads.
|
|
1144
|
+
*/
|
|
1145
|
+
function addressId(address) {
|
|
1146
|
+
return address.kind === "session" ? address.sessionId : address.childSessionId;
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Reject an address that does not match the observed Session.
|
|
1150
|
+
* @param address - ordinary Session or direct-subagent address.
|
|
1151
|
+
* @param header - observed Session header.
|
|
1152
|
+
* @param inheritedEventCount - observed fork-inherited event count.
|
|
1153
|
+
* @param projections - observed projections; subagent addresses require them.
|
|
1154
|
+
*/
|
|
1155
|
+
function validateAddress(address, header, inheritedEventCount, projections) {
|
|
1156
|
+
if (address.kind === "session") {
|
|
1157
|
+
if (header.origin === "subagent") throw new RemoteError("session/agent-busy", "subagent Sessions require their durable parent address", { reason: "use subagent delivery for this child session" });
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
if (header.origin !== "subagent" || header.parentSession !== address.parentSessionId) throw new RemoteError("subagent/unauthorized", "subagent does not belong to the supplied parent", { childSessionId: address.childSessionId });
|
|
1161
|
+
const identity = projections?.values.subagent;
|
|
1162
|
+
if (identity === null) throw new RemoteError("subagent/catalog-diagnostic", "subagent descriptor is corrupt", {
|
|
1163
|
+
parentSessionId: address.parentSessionId,
|
|
1164
|
+
childSessionId: address.childSessionId,
|
|
1165
|
+
reason: "corrupt"
|
|
1166
|
+
});
|
|
1167
|
+
if (identity === void 0 || identity.seq < inheritedEventCount) throw new RemoteError("subagent/catalog-diagnostic", "subagent descriptor is unavailable", {
|
|
1168
|
+
parentSessionId: address.parentSessionId,
|
|
1169
|
+
childSessionId: address.childSessionId,
|
|
1170
|
+
reason: "unsupported"
|
|
1171
|
+
});
|
|
1172
|
+
if (address.mode !== "unknown" && identity.mode !== address.mode) throw new RemoteError("subagent/unauthorized", "subagent mode does not match the supplied address", { childSessionId: address.childSessionId });
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Reject a missing Session using its address-specific error.
|
|
1176
|
+
* @param address - ordinary Session or direct-subagent address.
|
|
1177
|
+
* @returns never; this operation always throws.
|
|
1178
|
+
* @throws RemoteError `session/not-found` or `subagent/not-found`.
|
|
1179
|
+
*/
|
|
1180
|
+
function rejectNotFound(address) {
|
|
1181
|
+
if (address.kind === "session") throw new RemoteError("session/not-found", `session "${address.sessionId}" not found`, { sessionId: address.sessionId });
|
|
1182
|
+
throw new RemoteError("subagent/not-found", "subagent is unavailable", {
|
|
1183
|
+
parentSessionId: address.parentSessionId,
|
|
1184
|
+
childSessionId: address.childSessionId
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Cut one message-aligned backwards page from a contiguous event prefix.
|
|
1189
|
+
* @param events - contiguous events starting at seq 0.
|
|
1190
|
+
* @param beforeSeq - exclusive upper offset of an older page.
|
|
1191
|
+
* @param maxMessages - message budget.
|
|
1192
|
+
* @param throughSeq - inclusive log cut.
|
|
1193
|
+
* @param turnWindow - optional turn-boundary stop rule.
|
|
1194
|
+
* @returns the page events and whether older events remain.
|
|
1195
|
+
*/
|
|
1196
|
+
function paginate(events, beforeSeq, maxMessages, throughSeq, turnWindow) {
|
|
1197
|
+
const end = SessionLogOffset(Math.min(throughSeq + 1, beforeSeq ?? throughSeq + 1));
|
|
1198
|
+
let count = 0;
|
|
1199
|
+
let turns = 0;
|
|
1200
|
+
let cut = SessionLogOffset(0);
|
|
1201
|
+
for (let index = end - 1; index >= 0; index--) {
|
|
1202
|
+
const event = events[index];
|
|
1203
|
+
if (turnWindow !== void 0 && event.type === "turn/start") {
|
|
1204
|
+
turns++;
|
|
1205
|
+
if (count >= turnWindow.minMessages && turns >= turnWindow.minTurns) {
|
|
1206
|
+
cut = SessionLogOffset(index);
|
|
1207
|
+
break;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
if (!MESSAGE_TYPES$1.has(event.type) || !isAppendSurfaceEvent(event)) continue;
|
|
1211
|
+
count++;
|
|
1212
|
+
const sources = event.sourceEventSeqs;
|
|
1213
|
+
let groupStart = event.seq;
|
|
1214
|
+
if (sources !== void 0) {
|
|
1215
|
+
for (const source of sources) if (source < groupStart) groupStart = source;
|
|
1216
|
+
}
|
|
1217
|
+
if (count >= maxMessages) {
|
|
1218
|
+
cut = SessionLogOffset(groupStart);
|
|
1219
|
+
break;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
return {
|
|
1223
|
+
events: events.slice(cut, end),
|
|
1224
|
+
hasMore: cut > 0
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Convert a committed event to its wire entry.
|
|
1229
|
+
* @param event - committed Session event.
|
|
1230
|
+
* @returns the wire event entry.
|
|
1231
|
+
*/
|
|
1232
|
+
function entryFor(event) {
|
|
1233
|
+
return {
|
|
1234
|
+
type: "event",
|
|
1235
|
+
event
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Encode one bounded logical page without changing its pagination cut.
|
|
1240
|
+
* @param events - page events.
|
|
1241
|
+
* @returns the wire records.
|
|
1242
|
+
*/
|
|
1243
|
+
function pageRecords(events) {
|
|
1244
|
+
return events.map(entryFor);
|
|
1245
|
+
}
|
|
1246
|
+
//#endregion
|
|
1247
|
+
//#region lib/types/history/listener.js
|
|
1248
|
+
/** Passive per-Session streams; subscriptions never acquire Session observations. */
|
|
1249
|
+
/** A single subscription buffers before either consumption mode starts. */
|
|
1250
|
+
var EventListener = class {
|
|
1251
|
+
buffer;
|
|
1252
|
+
disposes = [];
|
|
1253
|
+
firstReceivedSeq;
|
|
1254
|
+
nextExpectedSeq;
|
|
1255
|
+
/**
|
|
1256
|
+
* @param ctx - context owning the event registrations.
|
|
1257
|
+
* @param sessionId - Session whose notifications are emitted.
|
|
1258
|
+
* @param signal - cancellation that wakes consumers.
|
|
1259
|
+
* @param queue - optional caller-owned buffer; only an internally created buffer is disposed here.
|
|
1260
|
+
*/
|
|
1261
|
+
constructor(ctx, sessionId, signal, queue) {
|
|
1262
|
+
signal.throwIfAborted();
|
|
1263
|
+
const buffer = queue ?? new ListenerBuffer(ctx, signal);
|
|
1264
|
+
this.buffer = queue === void 0 ? buffer : void 0;
|
|
1265
|
+
const input = buffer.createInput((item) => this.transform(item));
|
|
1266
|
+
const target = sessionId;
|
|
1267
|
+
try {
|
|
1268
|
+
this.disposes.push(ctx.on("session/event", (session, event) => {
|
|
1269
|
+
if (session.id !== target) return;
|
|
1270
|
+
buffer.capture(() => {
|
|
1271
|
+
this.recordFirst(event.seq);
|
|
1272
|
+
input.append({
|
|
1273
|
+
type: "event",
|
|
1274
|
+
session,
|
|
1275
|
+
event
|
|
1276
|
+
});
|
|
1277
|
+
});
|
|
1278
|
+
}, { global: true }));
|
|
1279
|
+
this.disposes.push(ctx.on("session/created", (session) => {
|
|
1280
|
+
if (session.id !== target) return;
|
|
1281
|
+
buffer.capture(() => {
|
|
1282
|
+
if (session.firstLiveSeq < session.seq) this.recordFirst(session.firstLiveSeq);
|
|
1283
|
+
input.prepend({
|
|
1284
|
+
type: "created",
|
|
1285
|
+
session,
|
|
1286
|
+
end: session.seq
|
|
1287
|
+
});
|
|
1288
|
+
});
|
|
1289
|
+
}, { global: true }));
|
|
1290
|
+
this.buffer?.own(() => {
|
|
1291
|
+
this[Symbol.dispose]();
|
|
1292
|
+
});
|
|
1293
|
+
} catch (error) {
|
|
1294
|
+
this[Symbol.dispose]();
|
|
1295
|
+
throw error;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
/** Consume notifications without reading history.
|
|
1299
|
+
* @returns event frames from the first received event, without loading a baseline. */
|
|
1300
|
+
events() {
|
|
1301
|
+
return this.iterate();
|
|
1302
|
+
}
|
|
1303
|
+
/** Set the inclusive opening cut for buffered history notifications.
|
|
1304
|
+
* @param cursor - snapshot cut set before consuming the queue. */
|
|
1305
|
+
setCursor(cursor) {
|
|
1306
|
+
this.nextExpectedSeq = cursor + 1;
|
|
1307
|
+
}
|
|
1308
|
+
*transform(item) {
|
|
1309
|
+
if (this.disposes.length === 0) return;
|
|
1310
|
+
this.nextExpectedSeq ??= this.firstReceivedSeq;
|
|
1311
|
+
const result = eventItem(item, this.nextExpectedSeq);
|
|
1312
|
+
this.nextExpectedSeq = result.next;
|
|
1313
|
+
for (const event of result.events) {
|
|
1314
|
+
if (this.disposes.length === 0) return;
|
|
1315
|
+
yield entryFor(event);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
async *iterate() {
|
|
1319
|
+
if (this.buffer === void 0) throw new Error("Consume the externally owned history buffer directly");
|
|
1320
|
+
try {
|
|
1321
|
+
yield* this.buffer.items();
|
|
1322
|
+
} finally {
|
|
1323
|
+
this[Symbol.dispose]();
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
recordFirst(seq) {
|
|
1327
|
+
this.firstReceivedSeq = this.firstReceivedSeq === void 0 ? seq : Math.min(this.firstReceivedSeq, seq);
|
|
1328
|
+
}
|
|
1329
|
+
[Symbol.dispose]() {
|
|
1330
|
+
for (const dispose of this.disposes.splice(0).reverse()) dispose();
|
|
1331
|
+
this.buffer?.[Symbol.dispose]();
|
|
1332
|
+
}
|
|
1333
|
+
};
|
|
1334
|
+
/**
|
|
1335
|
+
* Select the uncovered events represented by one notification.
|
|
1336
|
+
* @param item - one buffered notification.
|
|
1337
|
+
* @param next - next required seq, or undefined before the first event.
|
|
1338
|
+
* @returns uncovered events and the next required seq without acquiring an observation.
|
|
1339
|
+
*/
|
|
1340
|
+
function eventItem(item, next) {
|
|
1341
|
+
if (item.type === "event") {
|
|
1342
|
+
if (next !== void 0 && item.event.seq < next) return {
|
|
1343
|
+
events: [],
|
|
1344
|
+
next
|
|
1345
|
+
};
|
|
1346
|
+
if (next !== void 0 && item.event.seq !== next) throw new RemoteError("gateway/internal", `session event stream skipped seq ${String(next)}`, {});
|
|
1347
|
+
return {
|
|
1348
|
+
events: [item.event],
|
|
1349
|
+
next: item.event.seq + 1
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
const start = next ?? item.session.firstLiveSeq;
|
|
1353
|
+
if (start >= item.end) return {
|
|
1354
|
+
events: [],
|
|
1355
|
+
next
|
|
1356
|
+
};
|
|
1357
|
+
const events = item.session.snapshotEvents(SessionLogOffset(start), SessionLogOffset(item.end));
|
|
1358
|
+
for (const event of events) {
|
|
1359
|
+
if (next !== void 0 && event.seq !== next) throw new RemoteError("gateway/internal", `session event stream skipped seq ${String(next)}`, {});
|
|
1360
|
+
next = event.seq + 1;
|
|
1361
|
+
}
|
|
1362
|
+
return {
|
|
1363
|
+
events,
|
|
1364
|
+
next
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
/** Sparse projection changes retain every key, including keys sharing a seq. */
|
|
1368
|
+
var ProjectionListener = class {
|
|
1369
|
+
buffer;
|
|
1370
|
+
/**
|
|
1371
|
+
* @param ctx - context owning projection notifications.
|
|
1372
|
+
* @param sessionId - Session whose notifications are emitted.
|
|
1373
|
+
* @param signal - cancellation that removes registrations and wakes consumers.
|
|
1374
|
+
*/
|
|
1375
|
+
constructor(ctx, sessionId, signal) {
|
|
1376
|
+
this.buffer = new ListenerBuffer(ctx, signal);
|
|
1377
|
+
const input = this.buffer.createInput((item) => [item]);
|
|
1378
|
+
const target = sessionId;
|
|
1379
|
+
try {
|
|
1380
|
+
this.buffer.own(ctx.sessionProjections.onChanged((session, key, value, seq) => {
|
|
1381
|
+
if (session.id !== target) return;
|
|
1382
|
+
this.buffer.capture(() => {
|
|
1383
|
+
input.append({
|
|
1384
|
+
session,
|
|
1385
|
+
change: {
|
|
1386
|
+
type: "projection",
|
|
1387
|
+
key,
|
|
1388
|
+
value,
|
|
1389
|
+
seq
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
});
|
|
1393
|
+
}));
|
|
1394
|
+
} catch (error) {
|
|
1395
|
+
this.buffer[Symbol.dispose]();
|
|
1396
|
+
throw error;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
/** Consume sparse per-key projection replacements.
|
|
1400
|
+
* @returns validated replacement frames; projection seqs need not be contiguous. */
|
|
1401
|
+
async *changes() {
|
|
1402
|
+
try {
|
|
1403
|
+
for await (const { change } of this.buffer.items()) yield change;
|
|
1404
|
+
} finally {
|
|
1405
|
+
this[Symbol.dispose]();
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
[Symbol.dispose]() {
|
|
1409
|
+
this.buffer[Symbol.dispose]();
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
/** Owns buffering, callback failure and registration cleanup for one consumer. */
|
|
1413
|
+
var ListenerBuffer = class {
|
|
1414
|
+
values = new Deque();
|
|
1415
|
+
transformIds = new Deque();
|
|
1416
|
+
transforms = [];
|
|
1417
|
+
cleanup = [];
|
|
1418
|
+
wake;
|
|
1419
|
+
closed = false;
|
|
1420
|
+
failure;
|
|
1421
|
+
consumed = false;
|
|
1422
|
+
constructor(ctx, signal) {
|
|
1423
|
+
signal.throwIfAborted();
|
|
1424
|
+
const close = () => {
|
|
1425
|
+
this[Symbol.dispose]();
|
|
1426
|
+
};
|
|
1427
|
+
signal.addEventListener("abort", close, { once: true });
|
|
1428
|
+
this.own(() => {
|
|
1429
|
+
signal.removeEventListener("abort", close);
|
|
1430
|
+
});
|
|
1431
|
+
try {
|
|
1432
|
+
const dispose = ctx.effect(() => close, "session-controller.listener-buffer");
|
|
1433
|
+
this.own(() => {
|
|
1434
|
+
dispose();
|
|
1435
|
+
});
|
|
1436
|
+
} catch (error) {
|
|
1437
|
+
this[Symbol.dispose]();
|
|
1438
|
+
throw error;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Register cleanup, or run it immediately when already closed.
|
|
1443
|
+
* @param dispose - synchronous cleanup.
|
|
1444
|
+
*/
|
|
1445
|
+
own(dispose) {
|
|
1446
|
+
if (this.closed) dispose();
|
|
1447
|
+
else this.cleanup.push(dispose);
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Contain producer failure and wake the consumer with that failure.
|
|
1451
|
+
* @param action - synchronous producer operation.
|
|
1452
|
+
*/
|
|
1453
|
+
capture(action) {
|
|
1454
|
+
if (this.closed) return;
|
|
1455
|
+
try {
|
|
1456
|
+
action();
|
|
1457
|
+
} catch (error) {
|
|
1458
|
+
this.failure = { error };
|
|
1459
|
+
this[Symbol.dispose]();
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Register a dequeue transform and obtain its write-only input.
|
|
1464
|
+
* @param transform - conversion bound once and evaluated when each input is dequeued.
|
|
1465
|
+
* @returns a write-only input sharing this buffer's storage and lifetime.
|
|
1466
|
+
* @throws when this buffer is already closed.
|
|
1467
|
+
*/
|
|
1468
|
+
createInput(transform) {
|
|
1469
|
+
if (this.closed) throw new Error("Cannot register a transform on a closed listener buffer");
|
|
1470
|
+
const transformId = this.transforms.length;
|
|
1471
|
+
this.transforms.push((value) => transform(value));
|
|
1472
|
+
return {
|
|
1473
|
+
append: (item) => {
|
|
1474
|
+
if (this.closed) return;
|
|
1475
|
+
this.values.pushBack(item);
|
|
1476
|
+
this.transformIds.pushBack(transformId);
|
|
1477
|
+
this.notify();
|
|
1478
|
+
},
|
|
1479
|
+
prepend: (item) => {
|
|
1480
|
+
if (this.closed) return;
|
|
1481
|
+
this.values.pushFront(item);
|
|
1482
|
+
this.transformIds.pushFront(transformId);
|
|
1483
|
+
this.notify();
|
|
1484
|
+
}
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Consume queued values once, releasing the buffer when iteration ends.
|
|
1489
|
+
* @returns transformed output values.
|
|
1490
|
+
*/
|
|
1491
|
+
async *items() {
|
|
1492
|
+
if (this.consumed) throw new RemoteError("gateway/internal", "Session listener already has a consumer", {});
|
|
1493
|
+
this.consumed = true;
|
|
1494
|
+
try {
|
|
1495
|
+
for (;;) {
|
|
1496
|
+
if (this.failure !== void 0) throw this.failure.error;
|
|
1497
|
+
if (this.closed) return;
|
|
1498
|
+
if (this.transformIds.size === 0) {
|
|
1499
|
+
await new Promise((resolve) => {
|
|
1500
|
+
this.wake = resolve;
|
|
1501
|
+
});
|
|
1502
|
+
continue;
|
|
1503
|
+
}
|
|
1504
|
+
const transformId = this.transformIds.popFront();
|
|
1505
|
+
const value = this.values.popFront();
|
|
1506
|
+
for (const item of this.transforms[transformId](value)) {
|
|
1507
|
+
this.throwIfFailed();
|
|
1508
|
+
if (this.isClosed()) return;
|
|
1509
|
+
yield item;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
} finally {
|
|
1513
|
+
this[Symbol.dispose]();
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
throwIfFailed() {
|
|
1517
|
+
if (this.failure !== void 0) throw this.failure.error;
|
|
1518
|
+
}
|
|
1519
|
+
/** @returns whether disposal ended this buffer while a transform was yielding. */
|
|
1520
|
+
isClosed() {
|
|
1521
|
+
return this.closed;
|
|
1522
|
+
}
|
|
1523
|
+
notify() {
|
|
1524
|
+
const wake = this.wake;
|
|
1525
|
+
this.wake = void 0;
|
|
1526
|
+
wake?.();
|
|
1527
|
+
}
|
|
1528
|
+
[Symbol.dispose]() {
|
|
1529
|
+
if (this.closed) return;
|
|
1530
|
+
this.closed = true;
|
|
1531
|
+
this.values.clear();
|
|
1532
|
+
this.transformIds.clear();
|
|
1533
|
+
this.transforms.length = 0;
|
|
1534
|
+
this.notify();
|
|
1535
|
+
for (const dispose of this.cleanup.splice(0).reverse()) dispose();
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1199
1538
|
//#endregion
|
|
1200
1539
|
//#region lib/types/assistant-stream.js
|
|
1201
1540
|
/** Process-local assistant state retained for reconnecting Web followers. */
|
|
@@ -1278,8 +1617,795 @@ var SessionAssistantStreamAccumulator = class {
|
|
|
1278
1617
|
}
|
|
1279
1618
|
};
|
|
1280
1619
|
//#endregion
|
|
1281
|
-
//#region lib/types/history.js
|
|
1282
|
-
/**
|
|
1620
|
+
//#region lib/types/history/assistant-stream.js
|
|
1621
|
+
/** Assistant stream baselines and per-connection subscriptions. */
|
|
1622
|
+
/** One accumulator per live Session, shared by every subscription bound to it. */
|
|
1623
|
+
var SessionAssistantStreamsListener = class {
|
|
1624
|
+
ctx;
|
|
1625
|
+
streams = /* @__PURE__ */ new Map();
|
|
1626
|
+
/** @param ctx - service context owning the accumulator listeners. */
|
|
1627
|
+
constructor(ctx) {
|
|
1628
|
+
this.ctx = ctx;
|
|
1629
|
+
ctx.on("agent/assistant-stream", ({ agent, frame }) => {
|
|
1630
|
+
let stream = this.streams.get(agent.session.id);
|
|
1631
|
+
if (stream === void 0) {
|
|
1632
|
+
stream = new SessionAssistantStreamAccumulator();
|
|
1633
|
+
this.streams.set(agent.session.id, stream);
|
|
1634
|
+
}
|
|
1635
|
+
stream.accept(frame, agent.session.seq === 0 ? -1 : SessionSeq(agent.session.seq - 1));
|
|
1636
|
+
}, { global: true });
|
|
1637
|
+
ctx.on("agent/disposed", ({ agent }) => {
|
|
1638
|
+
this.streams.delete(agent.session.id);
|
|
1639
|
+
}, { global: true });
|
|
1640
|
+
ctx.effect(() => () => {
|
|
1641
|
+
this.streams.clear();
|
|
1642
|
+
}, "session-controller.assistant-streams");
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Bind one connection to a Session assistant stream.
|
|
1646
|
+
* @param sessionId - Session to subscribe.
|
|
1647
|
+
* @param signal - cancellation owned by the caller.
|
|
1648
|
+
* @param queue - caller-owned raw notification buffer.
|
|
1649
|
+
* @returns a listener the caller disposes.
|
|
1650
|
+
*/
|
|
1651
|
+
bind(sessionId, signal, queue) {
|
|
1652
|
+
return new AssistantStreamListener(this.ctx, sessionId, signal, () => {
|
|
1653
|
+
return this.streams.get(sessionId)?.snapshot() ?? { revision: 0 };
|
|
1654
|
+
}, queue);
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
/** Writes assistant notifications into the connection's shared queue. */
|
|
1658
|
+
var AssistantStreamListener = class {
|
|
1659
|
+
_snapshot;
|
|
1660
|
+
disposes = [];
|
|
1661
|
+
ordinal = 0;
|
|
1662
|
+
cut = 0;
|
|
1663
|
+
constructor(ctx, sessionId, signal, _snapshot, output) {
|
|
1664
|
+
this._snapshot = _snapshot;
|
|
1665
|
+
signal.throwIfAborted();
|
|
1666
|
+
const input = output.createInput((item) => this.transform(item));
|
|
1667
|
+
try {
|
|
1668
|
+
this.disposes.push(ctx.on("agent/assistant-stream", ({ agent, frame }) => {
|
|
1669
|
+
if (agent.session.id !== sessionId) return;
|
|
1670
|
+
output.capture(() => {
|
|
1671
|
+
const wire = frame.type === "start" ? {
|
|
1672
|
+
...frame,
|
|
1673
|
+
startedAfterSeq: agent.session.seq === 0 ? -1 : SessionSeq(agent.session.seq - 1)
|
|
1674
|
+
} : frame.type === "chunk" ? {
|
|
1675
|
+
...frame,
|
|
1676
|
+
chunk: frame.chunk
|
|
1677
|
+
} : frame;
|
|
1678
|
+
input.append({
|
|
1679
|
+
type: "assistant-stream",
|
|
1680
|
+
session: agent.session,
|
|
1681
|
+
frame: wire,
|
|
1682
|
+
ordinal: ++this.ordinal
|
|
1683
|
+
});
|
|
1684
|
+
});
|
|
1685
|
+
}, { global: true }));
|
|
1686
|
+
} catch (error) {
|
|
1687
|
+
this[Symbol.dispose]();
|
|
1688
|
+
throw error;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
/** @returns the baseline and local arrival cut captured synchronously together. */
|
|
1692
|
+
snapshot() {
|
|
1693
|
+
return {
|
|
1694
|
+
baseline: this._snapshot(),
|
|
1695
|
+
ordinal: this.ordinal
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
/** @param ordinal - local snapshot cut set before queue consumption. */
|
|
1699
|
+
setOrdinalCut(ordinal) {
|
|
1700
|
+
this.cut = ordinal;
|
|
1701
|
+
}
|
|
1702
|
+
*transform(item) {
|
|
1703
|
+
if (this.disposes.length === 0 || item.ordinal <= this.cut) return;
|
|
1704
|
+
yield {
|
|
1705
|
+
type: "assistant-stream",
|
|
1706
|
+
frame: item.frame
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
[Symbol.dispose]() {
|
|
1710
|
+
for (const dispose of this.disposes.splice(0).reverse()) dispose();
|
|
1711
|
+
}
|
|
1712
|
+
};
|
|
1713
|
+
//#endregion
|
|
1714
|
+
//#region lib/types/history/controller.js
|
|
1715
|
+
/** Independent Session snapshots and passive event subscriptions. */
|
|
1716
|
+
var __addDisposableResource$4 = function(env, value, async) {
|
|
1717
|
+
if (value !== null && value !== void 0) {
|
|
1718
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1719
|
+
var dispose, inner;
|
|
1720
|
+
if (async) {
|
|
1721
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
1722
|
+
dispose = value[Symbol.asyncDispose];
|
|
1723
|
+
}
|
|
1724
|
+
if (dispose === void 0) {
|
|
1725
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
1726
|
+
dispose = value[Symbol.dispose];
|
|
1727
|
+
if (async) inner = dispose;
|
|
1728
|
+
}
|
|
1729
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
1730
|
+
if (inner) dispose = function() {
|
|
1731
|
+
try {
|
|
1732
|
+
inner.call(this);
|
|
1733
|
+
} catch (e) {
|
|
1734
|
+
return Promise.reject(e);
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
env.stack.push({
|
|
1738
|
+
value,
|
|
1739
|
+
dispose,
|
|
1740
|
+
async
|
|
1741
|
+
});
|
|
1742
|
+
} else if (async) env.stack.push({ async: true });
|
|
1743
|
+
return value;
|
|
1744
|
+
};
|
|
1745
|
+
var __disposeResources$4 = (function(SuppressedError) {
|
|
1746
|
+
return function(env) {
|
|
1747
|
+
function fail(e) {
|
|
1748
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
1749
|
+
env.hasError = true;
|
|
1750
|
+
}
|
|
1751
|
+
var r, s = 0;
|
|
1752
|
+
function next() {
|
|
1753
|
+
while (r = env.stack.pop()) try {
|
|
1754
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
1755
|
+
if (r.dispose) {
|
|
1756
|
+
var result = r.dispose.call(r.value);
|
|
1757
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
1758
|
+
fail(e);
|
|
1759
|
+
return next();
|
|
1760
|
+
});
|
|
1761
|
+
} else s |= 1;
|
|
1762
|
+
} catch (e) {
|
|
1763
|
+
fail(e);
|
|
1764
|
+
}
|
|
1765
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
1766
|
+
if (env.hasError) throw env.error;
|
|
1767
|
+
}
|
|
1768
|
+
return next();
|
|
1769
|
+
};
|
|
1770
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1771
|
+
var e = new Error(message);
|
|
1772
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1773
|
+
});
|
|
1774
|
+
/** Session snapshots do not share lifetime with passive subscriptions. */
|
|
1775
|
+
var HistoryController = class {
|
|
1776
|
+
ctx;
|
|
1777
|
+
/** Reconnect state for this controller's assistant subscriptions. */
|
|
1778
|
+
streamsListener;
|
|
1779
|
+
/** @param ctx - Host context carrying Session reads and projections. */
|
|
1780
|
+
constructor(ctx) {
|
|
1781
|
+
this.ctx = ctx;
|
|
1782
|
+
this.streamsListener = new SessionAssistantStreamsListener(this.ctx);
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Read a passive page of Session events at an exact cut.
|
|
1786
|
+
* @param request - Session identity and optional cut and page window.
|
|
1787
|
+
* @param signal - read cancellation.
|
|
1788
|
+
* @returns a page at the supplied cut, or the observed log end when omitted.
|
|
1789
|
+
*/
|
|
1790
|
+
async events(request, signal) {
|
|
1791
|
+
const spec = resolveHistoryRequest(request);
|
|
1792
|
+
try {
|
|
1793
|
+
return await this.usingObservation({
|
|
1794
|
+
sessionId: addressId(request.address),
|
|
1795
|
+
projection: request.address.kind === "subagent"
|
|
1796
|
+
}, signal, (observation) => {
|
|
1797
|
+
validateObservationAddress(request.address, observation);
|
|
1798
|
+
return history(observation, spec);
|
|
1799
|
+
});
|
|
1800
|
+
} catch (error) {
|
|
1801
|
+
if (remoteErrorOf(error)?.code === "session/not-found") rejectNotFound(request.address);
|
|
1802
|
+
throw error;
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Subscribe to Session events without reading or activating the Session.
|
|
1807
|
+
* @param request - Session address to subscribe.
|
|
1808
|
+
* @param signal - stream cancellation.
|
|
1809
|
+
* @returns subscription readiness followed by event frames; readiness does not establish existence.
|
|
1810
|
+
*/
|
|
1811
|
+
async *observeEvent(request, signal) {
|
|
1812
|
+
const env_1 = {
|
|
1813
|
+
stack: [],
|
|
1814
|
+
error: void 0,
|
|
1815
|
+
hasError: false
|
|
1816
|
+
};
|
|
1817
|
+
try {
|
|
1818
|
+
const listener = __addDisposableResource$4(env_1, new EventListener(this.ctx, addressId(request.address), signal), false);
|
|
1819
|
+
yield { type: "ready" };
|
|
1820
|
+
yield* listener.events();
|
|
1821
|
+
} catch (e_1) {
|
|
1822
|
+
env_1.error = e_1;
|
|
1823
|
+
env_1.hasError = true;
|
|
1824
|
+
} finally {
|
|
1825
|
+
__disposeResources$4(env_1);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* Read exact projections or migration cache hints without activating the Session.
|
|
1830
|
+
* @param request - Session identity whose exact projection baseline is required.
|
|
1831
|
+
* @param signal - read cancellation.
|
|
1832
|
+
* @returns exact sequenced values, migration cache hints, or null when absent.
|
|
1833
|
+
*/
|
|
1834
|
+
async projections(request, signal) {
|
|
1835
|
+
const { sessionId } = request;
|
|
1836
|
+
if (sessionId.length === 0) throw new RemoteError("gateway/bad-request", "sessionId must not be empty", {});
|
|
1837
|
+
try {
|
|
1838
|
+
signal.throwIfAborted();
|
|
1839
|
+
const live = this.ctx.sessions.get(sessionId);
|
|
1840
|
+
if (live !== void 0) {
|
|
1841
|
+
const snapshot = this.ctx.sessionProjections.snapshot(live);
|
|
1842
|
+
return {
|
|
1843
|
+
kind: "sequenced",
|
|
1844
|
+
asOfSeq: snapshot.asOfSeq,
|
|
1845
|
+
values: snapshot.values
|
|
1846
|
+
};
|
|
1847
|
+
} else {
|
|
1848
|
+
const stored = await this.ctx.get("sessionPersistence")?.stat(sessionId, { signal });
|
|
1849
|
+
signal.throwIfAborted();
|
|
1850
|
+
if (stored?.formatStatus === "migration-required") return {
|
|
1851
|
+
kind: "migration-required",
|
|
1852
|
+
values: { ...(this.ctx.get("sessionProjectionCache")?.cachedSnapshot(stored.header))?.values }
|
|
1853
|
+
};
|
|
1854
|
+
return await this.usingObservation({
|
|
1855
|
+
sessionId: request.sessionId,
|
|
1856
|
+
projection: true
|
|
1857
|
+
}, signal, (observation) => ({
|
|
1858
|
+
kind: "sequenced",
|
|
1859
|
+
...projections(observation)
|
|
1860
|
+
}));
|
|
1861
|
+
}
|
|
1862
|
+
} catch (error) {
|
|
1863
|
+
const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
1864
|
+
if (code === "SESSION_QUERY_SESSION_NOT_FOUND" || code === "session/not-found") return null;
|
|
1865
|
+
if (signal.aborted || code === "SESSION_QUERY_ABORTED") throw new RemoteError("gateway/cancelled", "Session projection read was cancelled", {}, { cause: error });
|
|
1866
|
+
if (remoteErrorOf(error) !== void 0) throw error;
|
|
1867
|
+
throw new RemoteError("gateway/internal", "Session projection read failed", {}, { cause: error });
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Subscribe to sparse projection replacements without reading a baseline.
|
|
1872
|
+
* @param request - Session identity to subscribe without reading a baseline.
|
|
1873
|
+
* @param signal - stream cancellation.
|
|
1874
|
+
* @returns readiness followed by sparse per-key replacement values.
|
|
1875
|
+
*/
|
|
1876
|
+
async *observeProjections(request, signal) {
|
|
1877
|
+
const env_2 = {
|
|
1878
|
+
stack: [],
|
|
1879
|
+
error: void 0,
|
|
1880
|
+
hasError: false
|
|
1881
|
+
};
|
|
1882
|
+
try {
|
|
1883
|
+
const listener = __addDisposableResource$4(env_2, new ProjectionListener(this.ctx, request.sessionId, signal), false);
|
|
1884
|
+
yield { type: "ready" };
|
|
1885
|
+
yield* listener.changes();
|
|
1886
|
+
} catch (e_2) {
|
|
1887
|
+
env_2.error = e_2;
|
|
1888
|
+
env_2.hasError = true;
|
|
1889
|
+
} finally {
|
|
1890
|
+
__disposeResources$4(env_2);
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Read bounded committed assistant messages through a stopping cursor.
|
|
1895
|
+
* @param sessionId - Session whose committed assistant messages are requested.
|
|
1896
|
+
* @param afterSeq - exclusive lower bound.
|
|
1897
|
+
* @param throughSeq - inclusive stopping-state cursor.
|
|
1898
|
+
* @param maxMessages - positive assistant record limit.
|
|
1899
|
+
* @param signal - caller cancellation, independent of a completed wait deadline.
|
|
1900
|
+
* @returns newest-first assistant messages and whether further matching records were omitted.
|
|
1901
|
+
*/
|
|
1902
|
+
async assistantOutput(sessionId, afterSeq, throughSeq, maxMessages, signal) {
|
|
1903
|
+
return this.usingObservation({
|
|
1904
|
+
sessionId,
|
|
1905
|
+
projection: false
|
|
1906
|
+
}, signal, (observation) => {
|
|
1907
|
+
if (throughSeq > observation.cursor) throw new RemoteError("gateway/internal", "Session history no longer covers the wait cursor", {});
|
|
1908
|
+
const records = [];
|
|
1909
|
+
const events = observation.events;
|
|
1910
|
+
for (let index = throughSeq; index > afterSeq; index--) {
|
|
1911
|
+
const event = events[index];
|
|
1912
|
+
if (event.type !== "assistant/message" || !isAppendSurfaceEvent(event)) continue;
|
|
1913
|
+
if (records.length === maxMessages) return {
|
|
1914
|
+
records,
|
|
1915
|
+
truncated: true
|
|
1916
|
+
};
|
|
1917
|
+
records.push(entryFor(event));
|
|
1918
|
+
}
|
|
1919
|
+
return {
|
|
1920
|
+
records,
|
|
1921
|
+
truncated: false
|
|
1922
|
+
};
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
async usingObservation({ sessionId, projection }, signal, callback) {
|
|
1926
|
+
const env_3 = {
|
|
1927
|
+
stack: [],
|
|
1928
|
+
error: void 0,
|
|
1929
|
+
hasError: false
|
|
1930
|
+
};
|
|
1931
|
+
try {
|
|
1932
|
+
let observation;
|
|
1933
|
+
try {
|
|
1934
|
+
observation = await this.ctx.sessionQuery.observeSession(sessionId, {
|
|
1935
|
+
signal,
|
|
1936
|
+
projectionMode: projection ? "all" : "none"
|
|
1937
|
+
});
|
|
1938
|
+
} catch (error) {
|
|
1939
|
+
const code = error?.code;
|
|
1940
|
+
if (code === "SESSION_QUERY_SESSION_NOT_FOUND") throw new RemoteError("session/not-found", `session "${sessionId}" not found`, { sessionId });
|
|
1941
|
+
if (code === "SESSION_QUERY_ABORTED") throw new RemoteError("gateway/cancelled", error instanceof Error ? error.message : "Session read was cancelled", {}, { cause: error });
|
|
1942
|
+
throw error;
|
|
1943
|
+
}
|
|
1944
|
+
try {
|
|
1945
|
+
signal.throwIfAborted();
|
|
1946
|
+
} catch (error) {
|
|
1947
|
+
observation[Symbol.dispose]();
|
|
1948
|
+
throw error;
|
|
1949
|
+
}
|
|
1950
|
+
if (callback === void 0) return observation;
|
|
1951
|
+
return await callback(__addDisposableResource$4(env_3, observation, false));
|
|
1952
|
+
} catch (e_3) {
|
|
1953
|
+
env_3.error = e_3;
|
|
1954
|
+
env_3.hasError = true;
|
|
1955
|
+
} finally {
|
|
1956
|
+
__disposeResources$4(env_3);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
/**
|
|
1961
|
+
* Validate an Address against the exact read used by a Controller.
|
|
1962
|
+
* @param address - caller-supplied Session address.
|
|
1963
|
+
* @param observation - borrowed read; subagent addresses require projections.
|
|
1964
|
+
*/
|
|
1965
|
+
function validateObservationAddress(address, observation) {
|
|
1966
|
+
if (observation.header.cwd === void 0) rejectNotFound(address);
|
|
1967
|
+
validateAddress(address, observation.header, observation.inheritedEventCount, observation.projections);
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Convert a borrowed observation to one page without acquiring or retaining it.
|
|
1971
|
+
* @param observation - exact read cut owned by the caller.
|
|
1972
|
+
* @param request - validated page window and optional inclusive cut.
|
|
1973
|
+
* @returns a chronological page at the requested cut.
|
|
1974
|
+
*/
|
|
1975
|
+
function history(observation, request) {
|
|
1976
|
+
const cursor = request.throughSeq === void 0 ? observation.cursor : request.throughSeq === -1 ? -1 : SessionSeq(request.throughSeq);
|
|
1977
|
+
if (cursor > observation.cursor) throw new RemoteError("gateway/bad-request", `session history cut ${String(cursor)} exceeds ${String(observation.cursor)}`, {});
|
|
1978
|
+
const page = paginate(observation.events, request.beforeSeq === void 0 ? void 0 : SessionLogOffset(request.beforeSeq), request.maxMessages, cursor, request.turnWindow);
|
|
1979
|
+
return {
|
|
1980
|
+
cursor,
|
|
1981
|
+
records: pageRecords(page.events),
|
|
1982
|
+
hasMore: page.hasMore
|
|
1983
|
+
};
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Convert the projection baseline without acquiring or retaining its observation.
|
|
1987
|
+
* @param observation - projected read cut owned by the caller.
|
|
1988
|
+
* @returns the exact baseline; missing projection support fails explicitly.
|
|
1989
|
+
*/
|
|
1990
|
+
function projections(observation) {
|
|
1991
|
+
const snapshot = observation.projections;
|
|
1992
|
+
if (snapshot === void 0) throw new RemoteError("session/projections-unavailable", "Session projections are unavailable", {});
|
|
1993
|
+
return {
|
|
1994
|
+
asOfSeq: snapshot.asOfSeq,
|
|
1995
|
+
values: snapshot.values
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
/**
|
|
1999
|
+
* Validate and resolve the history page window.
|
|
2000
|
+
* @param request - external history window.
|
|
2001
|
+
* @returns the validated request with an explicit message budget.
|
|
2002
|
+
*/
|
|
2003
|
+
function resolveHistoryRequest(request) {
|
|
2004
|
+
if (request.throughSeq !== void 0 && (!Number.isSafeInteger(request.throughSeq) || request.throughSeq < -1 || Object.is(request.throughSeq, -0))) throw new RemoteError("gateway/bad-request", "throughSeq must be an integer greater than or equal to -1", {});
|
|
2005
|
+
if (request.beforeSeq !== void 0 && (!Number.isSafeInteger(request.beforeSeq) || request.beforeSeq < 0 || Object.is(request.beforeSeq, -0))) throw new RemoteError("gateway/bad-request", "beforeSeq must be a non-negative safe integer", {});
|
|
2006
|
+
validateHistoryWindow(request);
|
|
2007
|
+
return {
|
|
2008
|
+
...request,
|
|
2009
|
+
maxMessages: request.maxMessages ?? 50
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
//#endregion
|
|
2013
|
+
//#region lib/types/state/listener.js
|
|
2014
|
+
/** Coalesced Session state observations with Host-local revisions. */
|
|
2015
|
+
/** Coalesces Session/Agent invalidations with local revisions; pending events are sampled on reads. */
|
|
2016
|
+
var StateListener = class {
|
|
2017
|
+
readState;
|
|
2018
|
+
disposes = [];
|
|
2019
|
+
cancellation = new AbortController();
|
|
2020
|
+
signal;
|
|
2021
|
+
revision = 0;
|
|
2022
|
+
resolver = createDeferredSignal();
|
|
2023
|
+
closed = false;
|
|
2024
|
+
/**
|
|
2025
|
+
* @param ctx - lifecycle notification owner.
|
|
2026
|
+
* @param target - Session to observe.
|
|
2027
|
+
* @param signal - caller cancellation.
|
|
2028
|
+
* @param readState - passive complete-state reader.
|
|
2029
|
+
*/
|
|
2030
|
+
constructor(ctx, target, signal, readState) {
|
|
2031
|
+
this.readState = readState;
|
|
2032
|
+
signal.throwIfAborted();
|
|
2033
|
+
this.signal = AbortSignal.any([signal, this.cancellation.signal]);
|
|
2034
|
+
const notify = (id) => {
|
|
2035
|
+
if (id !== target || this.closed) return;
|
|
2036
|
+
this.revision++;
|
|
2037
|
+
const resolver = this.resolver;
|
|
2038
|
+
this.resolver = createDeferredSignal();
|
|
2039
|
+
resolver.resolve();
|
|
2040
|
+
};
|
|
2041
|
+
const close = () => {
|
|
2042
|
+
this[Symbol.dispose]();
|
|
2043
|
+
};
|
|
2044
|
+
signal.addEventListener("abort", close, { once: true });
|
|
2045
|
+
this.disposes.push(() => {
|
|
2046
|
+
signal.removeEventListener("abort", close);
|
|
2047
|
+
});
|
|
2048
|
+
try {
|
|
2049
|
+
this.disposes.push(ctx.on("session/event", (session) => {
|
|
2050
|
+
notify(session.id);
|
|
2051
|
+
}, { global: true }));
|
|
2052
|
+
this.disposes.push(ctx.on("session/created", (session) => {
|
|
2053
|
+
notify(session.id);
|
|
2054
|
+
}, { global: true }));
|
|
2055
|
+
this.disposes.push(ctx.on("session/disposed", (session) => {
|
|
2056
|
+
notify(session.id);
|
|
2057
|
+
}, { global: true }));
|
|
2058
|
+
this.disposes.push(ctx.on("agent/status", ({ agent }) => {
|
|
2059
|
+
notify(agent.id);
|
|
2060
|
+
}, { global: true }));
|
|
2061
|
+
this.disposes.push(ctx.on("agent/created", ({ agent }) => {
|
|
2062
|
+
notify(agent.id);
|
|
2063
|
+
}, { global: true }));
|
|
2064
|
+
this.disposes.push(ctx.on("agent/disposed", ({ agent }) => {
|
|
2065
|
+
notify(agent.id);
|
|
2066
|
+
}, { global: true }));
|
|
2067
|
+
const dispose = ctx.effect(() => close, "session-controller.state-listener");
|
|
2068
|
+
this.disposes.push(() => {
|
|
2069
|
+
dispose();
|
|
2070
|
+
});
|
|
2071
|
+
} catch (error) {
|
|
2072
|
+
this[Symbol.dispose]();
|
|
2073
|
+
throw error;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Check whether a completed read still represents the latest invalidation.
|
|
2078
|
+
* @param revision - revision captured with a completed read.
|
|
2079
|
+
* @returns whether no intervening invalidation occurred.
|
|
2080
|
+
*/
|
|
2081
|
+
isCurrent(revision) {
|
|
2082
|
+
return !this.closed && revision === this.revision;
|
|
2083
|
+
}
|
|
2084
|
+
/**
|
|
2085
|
+
* Read coalesced state replacements with optional periodic refresh.
|
|
2086
|
+
* @param refreshMs - optional idle recheck interval; omitted for event-only observation.
|
|
2087
|
+
* @returns complete state replacements with internal consistency revisions.
|
|
2088
|
+
*/
|
|
2089
|
+
async *observeStates(refreshMs) {
|
|
2090
|
+
let lastRevision = -1;
|
|
2091
|
+
try {
|
|
2092
|
+
while (!this.closed) {
|
|
2093
|
+
if (lastRevision === this.revision) if (refreshMs === void 0) await this.resolver.promise;
|
|
2094
|
+
else {
|
|
2095
|
+
let timer;
|
|
2096
|
+
try {
|
|
2097
|
+
await Promise.race([this.resolver.promise, new Promise((resolve) => {
|
|
2098
|
+
timer = setTimeout(resolve, refreshMs);
|
|
2099
|
+
})]);
|
|
2100
|
+
} finally {
|
|
2101
|
+
clearTimeout(timer);
|
|
2102
|
+
}
|
|
2103
|
+
if (this.isCurrent(lastRevision)) {
|
|
2104
|
+
this.revision++;
|
|
2105
|
+
const resolver = this.resolver;
|
|
2106
|
+
this.resolver = createDeferredSignal();
|
|
2107
|
+
resolver.resolve();
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
if (!this.isCurrent(this.revision)) return;
|
|
2111
|
+
lastRevision = this.revision;
|
|
2112
|
+
const state = await this.readState(this.signal);
|
|
2113
|
+
if (this.isCurrent(lastRevision)) yield {
|
|
2114
|
+
state,
|
|
2115
|
+
revision: lastRevision
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
} finally {
|
|
2119
|
+
this[Symbol.dispose]();
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
[Symbol.dispose]() {
|
|
2123
|
+
if (this.closed) return;
|
|
2124
|
+
this.closed = true;
|
|
2125
|
+
this.cancellation.abort();
|
|
2126
|
+
this.resolver.resolve();
|
|
2127
|
+
for (const dispose of this.disposes.splice(0).reverse()) dispose();
|
|
2128
|
+
}
|
|
2129
|
+
};
|
|
2130
|
+
function createDeferredSignal() {
|
|
2131
|
+
let resolve;
|
|
2132
|
+
return {
|
|
2133
|
+
promise: new Promise((settle) => {
|
|
2134
|
+
resolve = settle;
|
|
2135
|
+
}),
|
|
2136
|
+
resolve
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
//#endregion
|
|
2140
|
+
//#region lib/types/state/controller.js
|
|
2141
|
+
/** Passive Session state, coalesced observations and quiescence waits. */
|
|
2142
|
+
var __addDisposableResource$3 = function(env, value, async) {
|
|
2143
|
+
if (value !== null && value !== void 0) {
|
|
2144
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
2145
|
+
var dispose, inner;
|
|
2146
|
+
if (async) {
|
|
2147
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
2148
|
+
dispose = value[Symbol.asyncDispose];
|
|
2149
|
+
}
|
|
2150
|
+
if (dispose === void 0) {
|
|
2151
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
2152
|
+
dispose = value[Symbol.dispose];
|
|
2153
|
+
if (async) inner = dispose;
|
|
2154
|
+
}
|
|
2155
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
2156
|
+
if (inner) dispose = function() {
|
|
2157
|
+
try {
|
|
2158
|
+
inner.call(this);
|
|
2159
|
+
} catch (e) {
|
|
2160
|
+
return Promise.reject(e);
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2163
|
+
env.stack.push({
|
|
2164
|
+
value,
|
|
2165
|
+
dispose,
|
|
2166
|
+
async
|
|
2167
|
+
});
|
|
2168
|
+
} else if (async) env.stack.push({ async: true });
|
|
2169
|
+
return value;
|
|
2170
|
+
};
|
|
2171
|
+
var __disposeResources$3 = (function(SuppressedError) {
|
|
2172
|
+
return function(env) {
|
|
2173
|
+
function fail(e) {
|
|
2174
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
2175
|
+
env.hasError = true;
|
|
2176
|
+
}
|
|
2177
|
+
var r, s = 0;
|
|
2178
|
+
function next() {
|
|
2179
|
+
while (r = env.stack.pop()) try {
|
|
2180
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
2181
|
+
if (r.dispose) {
|
|
2182
|
+
var result = r.dispose.call(r.value);
|
|
2183
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
2184
|
+
fail(e);
|
|
2185
|
+
return next();
|
|
2186
|
+
});
|
|
2187
|
+
} else s |= 1;
|
|
2188
|
+
} catch (e) {
|
|
2189
|
+
fail(e);
|
|
2190
|
+
}
|
|
2191
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
2192
|
+
if (env.hasError) throw env.error;
|
|
2193
|
+
}
|
|
2194
|
+
return next();
|
|
2195
|
+
};
|
|
2196
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
2197
|
+
var e = new Error(message);
|
|
2198
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2199
|
+
});
|
|
2200
|
+
const DEFAULT_WAIT_TIMEOUT_MS = 3e4;
|
|
2201
|
+
/** Reads and waits without activating or cancelling Session execution. */
|
|
2202
|
+
var StateController = class {
|
|
2203
|
+
ctx;
|
|
2204
|
+
historyController;
|
|
2205
|
+
/**
|
|
2206
|
+
* @param ctx - live Session and pending Remote event services.
|
|
2207
|
+
* @param historyController - passive read entry used for cold state and its bounded output.
|
|
2208
|
+
*/
|
|
2209
|
+
constructor(ctx, historyController) {
|
|
2210
|
+
this.ctx = ctx;
|
|
2211
|
+
this.historyController = historyController;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Read passive execution and pending-input state.
|
|
2215
|
+
* @param request - Session identity.
|
|
2216
|
+
* @param signal - read cancellation.
|
|
2217
|
+
* @returns current passive state.
|
|
2218
|
+
*/
|
|
2219
|
+
async state(request, signal) {
|
|
2220
|
+
return this.readState(request.sessionId, signal);
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2223
|
+
* Observe complete passive state replacements.
|
|
2224
|
+
* @param request - Session identity.
|
|
2225
|
+
* @param signal - observation cancellation.
|
|
2226
|
+
* @returns complete state replacements, starting with the current state.
|
|
2227
|
+
*/
|
|
2228
|
+
async *observeState(request, signal) {
|
|
2229
|
+
const env_1 = {
|
|
2230
|
+
stack: [],
|
|
2231
|
+
error: void 0,
|
|
2232
|
+
hasError: false
|
|
2233
|
+
};
|
|
2234
|
+
try {
|
|
2235
|
+
const listener = __addDisposableResource$3(env_1, this.listen(request.sessionId, signal), false);
|
|
2236
|
+
for await (const { state } of listener.observeStates()) yield state;
|
|
2237
|
+
} catch (e_1) {
|
|
2238
|
+
env_1.error = e_1;
|
|
2239
|
+
env_1.hasError = true;
|
|
2240
|
+
} finally {
|
|
2241
|
+
__disposeResources$3(env_1);
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* Wait for quiescence, pending input, or the deadline without cancelling execution.
|
|
2246
|
+
* @param request - Session identity, timeout and assistant output window.
|
|
2247
|
+
* @param signal - cancellation of this wait only, never of Agent execution.
|
|
2248
|
+
* @returns the stopping reason and last complete state; no state before timeout is an error.
|
|
2249
|
+
*/
|
|
2250
|
+
async wait(request, signal) {
|
|
2251
|
+
const env_2 = {
|
|
2252
|
+
stack: [],
|
|
2253
|
+
error: void 0,
|
|
2254
|
+
hasError: false
|
|
2255
|
+
};
|
|
2256
|
+
try {
|
|
2257
|
+
const timeoutMs = request.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
|
|
2258
|
+
const afterSeq = request.afterSeq ?? -1;
|
|
2259
|
+
const maxMessages = request.maxMessages ?? 50;
|
|
2260
|
+
if (!Number.isSafeInteger(afterSeq) || afterSeq < -1 || Object.is(afterSeq, -0)) throw new RemoteError("gateway/bad-request", "afterSeq must be an integer greater than or equal to -1", {});
|
|
2261
|
+
if (!Number.isSafeInteger(maxMessages) || maxMessages <= 0) throw new RemoteError("gateway/bad-request", "maxMessages must be a positive safe integer", {});
|
|
2262
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > MAX_TIMER_DELAY_MS) throw new RemoteError("gateway/bad-request", "timeoutMs must be a positive supported timer delay", {});
|
|
2263
|
+
const timer = __addDisposableResource$3(env_2, deadline(signal, timeoutMs, "session/wait-timeout"), false);
|
|
2264
|
+
const listener = __addDisposableResource$3(env_2, this.listen(request.sessionId, timer.signal), false);
|
|
2265
|
+
const sessionId = request.sessionId;
|
|
2266
|
+
const statesGenerator = listener.observeStates(1e3);
|
|
2267
|
+
let nextStatePromise = statesGenerator.next();
|
|
2268
|
+
let currentState;
|
|
2269
|
+
let reason = "timeout";
|
|
2270
|
+
try {
|
|
2271
|
+
for (;;) {
|
|
2272
|
+
const observedState = await nextStatePromise;
|
|
2273
|
+
if (observedState.done) {
|
|
2274
|
+
timer.signal.throwIfAborted();
|
|
2275
|
+
throw new RemoteError("session/observation-ended", "Session observation ended before a stopping state", {});
|
|
2276
|
+
}
|
|
2277
|
+
nextStatePromise = statesGenerator.next();
|
|
2278
|
+
nextStatePromise.catch(() => void 0);
|
|
2279
|
+
if (!listener.isCurrent(observedState.value.revision)) continue;
|
|
2280
|
+
currentState = observedState.value.state;
|
|
2281
|
+
const action = computeWaitAction(currentState);
|
|
2282
|
+
if (action === "continue") continue;
|
|
2283
|
+
if (action === "input-required" || action === "idle") {
|
|
2284
|
+
reason = action;
|
|
2285
|
+
break;
|
|
2286
|
+
}
|
|
2287
|
+
const agent = this.ctx.agents.get(sessionId);
|
|
2288
|
+
if (agent === void 0 || this.ctx.sessions.get(sessionId) !== agent.session) continue;
|
|
2289
|
+
if (await waitForIdleOrStateChange(agent, nextStatePromise) === "state-changed") continue;
|
|
2290
|
+
if (!listener.isCurrent(observedState.value.revision) || this.ctx.agents.get(sessionId) !== agent || this.ctx.sessions.get(sessionId) !== agent.session) continue;
|
|
2291
|
+
reason = "idle";
|
|
2292
|
+
break;
|
|
2293
|
+
}
|
|
2294
|
+
} catch (error) {
|
|
2295
|
+
if (signal.aborted) throw signal.reason;
|
|
2296
|
+
if (!expired(timer.signal, error)) throw error;
|
|
2297
|
+
} finally {
|
|
2298
|
+
listener[Symbol.dispose]();
|
|
2299
|
+
await nextStatePromise.catch(() => void 0);
|
|
2300
|
+
await statesGenerator.return(void 0);
|
|
2301
|
+
}
|
|
2302
|
+
signal.throwIfAborted();
|
|
2303
|
+
if (currentState === void 0) throw new RemoteError("session/wait-timeout", "No Session state arrived before the wait deadline", {});
|
|
2304
|
+
const output = await this.historyController.assistantOutput(sessionId, afterSeq, currentState.cursor, maxMessages, signal);
|
|
2305
|
+
return {
|
|
2306
|
+
reason,
|
|
2307
|
+
state: currentState,
|
|
2308
|
+
output
|
|
2309
|
+
};
|
|
2310
|
+
} catch (e_2) {
|
|
2311
|
+
env_2.error = e_2;
|
|
2312
|
+
env_2.hasError = true;
|
|
2313
|
+
} finally {
|
|
2314
|
+
__disposeResources$3(env_2);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
listen(sessionId, signal) {
|
|
2318
|
+
return new StateListener(this.ctx, sessionId, signal, (readSignal) => this.readState(sessionId, readSignal));
|
|
2319
|
+
}
|
|
2320
|
+
/**
|
|
2321
|
+
* @param sessionId - Session to sample.
|
|
2322
|
+
* @param signal - read cancellation.
|
|
2323
|
+
* @param retried - whether a live source already redirected this read once.
|
|
2324
|
+
* @returns one passive state sample.
|
|
2325
|
+
*/
|
|
2326
|
+
async readState(sessionId, signal, retried = false) {
|
|
2327
|
+
signal.throwIfAborted();
|
|
2328
|
+
const agent = this.ctx.agents.get(sessionId);
|
|
2329
|
+
if (agent !== void 0) {
|
|
2330
|
+
if (agent.session.header.cwd === void 0) rejectNotFound({
|
|
2331
|
+
kind: "session",
|
|
2332
|
+
sessionId
|
|
2333
|
+
});
|
|
2334
|
+
return {
|
|
2335
|
+
cursor: agent.session.seq - 1,
|
|
2336
|
+
active: true,
|
|
2337
|
+
running: agent.status === "running",
|
|
2338
|
+
queue: queueItems(agent),
|
|
2339
|
+
pendingInput: this.pendingInput(agent.session.id)
|
|
2340
|
+
};
|
|
2341
|
+
}
|
|
2342
|
+
const state = await this.historyController.usingObservation({
|
|
2343
|
+
sessionId,
|
|
2344
|
+
projection: false
|
|
2345
|
+
}, signal, (observation) => {
|
|
2346
|
+
if (!retried && observation.source === "live") return void 0;
|
|
2347
|
+
if (observation.header.cwd === void 0) rejectNotFound({
|
|
2348
|
+
kind: "session",
|
|
2349
|
+
sessionId
|
|
2350
|
+
});
|
|
2351
|
+
return {
|
|
2352
|
+
cursor: observation.cursor,
|
|
2353
|
+
active: false,
|
|
2354
|
+
running: false,
|
|
2355
|
+
queue: null,
|
|
2356
|
+
pendingInput: this.pendingInput(observation.header.id)
|
|
2357
|
+
};
|
|
2358
|
+
});
|
|
2359
|
+
signal.throwIfAborted();
|
|
2360
|
+
return state ?? this.readState(sessionId, signal, true);
|
|
2361
|
+
}
|
|
2362
|
+
pendingInput(sessionId) {
|
|
2363
|
+
const kinds = /* @__PURE__ */ new Set();
|
|
2364
|
+
for (const { event, agentId } of this.ctx.typertGateway.getPendingRemoteEvents()) {
|
|
2365
|
+
if (String(agentId) !== sessionId) continue;
|
|
2366
|
+
kinds.add(event === "approval/request" ? "approval" : event === "user-questions/request" ? "question" : "other");
|
|
2367
|
+
}
|
|
2368
|
+
return [...kinds];
|
|
2369
|
+
}
|
|
2370
|
+
};
|
|
2371
|
+
/**
|
|
2372
|
+
* @param signal - wait deadline signal.
|
|
2373
|
+
* @param error - failure raised by the in-flight read.
|
|
2374
|
+
* @returns whether the deadline expired and cancelled that read.
|
|
2375
|
+
*/
|
|
2376
|
+
function expired(signal, error) {
|
|
2377
|
+
const reason = timeoutOf(signal, "session/wait-timeout");
|
|
2378
|
+
if (reason === void 0) return false;
|
|
2379
|
+
let current = error;
|
|
2380
|
+
for (let depth = 0; depth < 4 && current instanceof Error; depth++) {
|
|
2381
|
+
if (current === reason || current.cause === reason) return true;
|
|
2382
|
+
current = current.cause;
|
|
2383
|
+
}
|
|
2384
|
+
return error === reason;
|
|
2385
|
+
}
|
|
2386
|
+
/** Choose the next wait action; check-idle requires the caller's whenIdle and identity checks. */
|
|
2387
|
+
function computeWaitAction(state) {
|
|
2388
|
+
if (state.pendingInput.length > 0) return "input-required";
|
|
2389
|
+
if (state.running) return "continue";
|
|
2390
|
+
if (!state.active) return "idle";
|
|
2391
|
+
return "check-idle";
|
|
2392
|
+
}
|
|
2393
|
+
/** Wait for either driver quiescence or the already-armed next state; preserve rejections from both. */
|
|
2394
|
+
function waitForIdleOrStateChange(agent, nextStatePromise) {
|
|
2395
|
+
return Promise.race([agent.whenIdle().then(() => "idle"), nextStatePromise.then(() => "state-changed")]);
|
|
2396
|
+
}
|
|
2397
|
+
function queueItems(agent) {
|
|
2398
|
+
const item = (message, placement) => ({
|
|
2399
|
+
id: message.id,
|
|
2400
|
+
placement,
|
|
2401
|
+
...message.source.kind === "user" && "rpcId" in message.source ? { rpcId: message.source.rpcId } : {},
|
|
2402
|
+
content: message.content
|
|
2403
|
+
});
|
|
2404
|
+
return [...agent.inbox.nextTurn.map((message) => item(message, "queued")), ...agent.inbox.nextStep.map((message) => item(message, message.source.kind === "user" ? "steering" : "context"))];
|
|
2405
|
+
}
|
|
2406
|
+
//#endregion
|
|
2407
|
+
//#region lib/types/web/controller.js
|
|
2408
|
+
/** Web opening aggregation over one observation and a shared transforming buffer. */
|
|
1283
2409
|
var __addDisposableResource$2 = function(env, value, async) {
|
|
1284
2410
|
if (value !== null && value !== void 0) {
|
|
1285
2411
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
@@ -1338,65 +2464,75 @@ var __disposeResources$2 = (function(SuppressedError) {
|
|
|
1338
2464
|
var e = new Error(message);
|
|
1339
2465
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1340
2466
|
});
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
/** Implements cold-safe history operations delegated by the Session Controller. */
|
|
1344
|
-
var SessionHistoryController = class {
|
|
2467
|
+
/** Combines opening data and consumes transformed listener output from one queue. */
|
|
2468
|
+
var WebController = class {
|
|
1345
2469
|
ctx;
|
|
2470
|
+
historyController;
|
|
1346
2471
|
promote;
|
|
1347
|
-
closeFollowers = /* @__PURE__ */ new Set();
|
|
1348
|
-
assistantStreams = /* @__PURE__ */ new Map();
|
|
1349
2472
|
/**
|
|
1350
|
-
* @param ctx - Host context carrying Session
|
|
1351
|
-
* @param
|
|
2473
|
+
* @param ctx - Host context carrying Session queries and identity projections.
|
|
2474
|
+
* @param historyController - passive reading and listener construction.
|
|
2475
|
+
* @param promote - background activation requested before an opening snapshot is delivered.
|
|
1352
2476
|
*/
|
|
1353
|
-
constructor(ctx, promote) {
|
|
2477
|
+
constructor(ctx, historyController, promote) {
|
|
1354
2478
|
this.ctx = ctx;
|
|
2479
|
+
this.historyController = historyController;
|
|
1355
2480
|
this.promote = promote;
|
|
1356
|
-
ctx.on("agent/assistant-stream", ({ agent, frame }) => {
|
|
1357
|
-
let stream = this.assistantStreams.get(agent.session.id);
|
|
1358
|
-
if (stream === void 0) {
|
|
1359
|
-
stream = new SessionAssistantStreamAccumulator();
|
|
1360
|
-
this.assistantStreams.set(agent.session.id, stream);
|
|
1361
|
-
}
|
|
1362
|
-
stream.accept(frame, cursorBeforeNext(agent.session.seq));
|
|
1363
|
-
}, { global: true });
|
|
1364
|
-
ctx.on("agent/disposed", ({ agent }) => {
|
|
1365
|
-
this.assistantStreams.delete(agent.session.id);
|
|
1366
|
-
}, { global: true });
|
|
1367
|
-
ctx.effect(() => () => {
|
|
1368
|
-
for (const close of this.closeFollowers) close();
|
|
1369
|
-
this.closeFollowers.clear();
|
|
1370
|
-
}, "session-controller.history");
|
|
1371
2481
|
}
|
|
1372
2482
|
/**
|
|
1373
|
-
*
|
|
1374
|
-
* @param request -
|
|
1375
|
-
* @param signal -
|
|
1376
|
-
* @returns
|
|
2483
|
+
* Open a history snapshot and follow uncovered history and assistant notifications.
|
|
2484
|
+
* @param request - Session identity, page budget, assistant output and optional activation (default false).
|
|
2485
|
+
* @param signal - cancellation for opening and streaming.
|
|
2486
|
+
* @returns an opening snapshot followed by uncovered queued increments.
|
|
1377
2487
|
*/
|
|
1378
|
-
async
|
|
2488
|
+
async *follow(request, signal) {
|
|
1379
2489
|
const env_1 = {
|
|
1380
2490
|
stack: [],
|
|
1381
2491
|
error: void 0,
|
|
1382
2492
|
hasError: false
|
|
1383
2493
|
};
|
|
1384
2494
|
try {
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
const
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
const
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
2495
|
+
const sessionId = addressId(request.address);
|
|
2496
|
+
const spec = resolveHistoryRequest(request);
|
|
2497
|
+
const queue = __addDisposableResource$2(env_1, new ListenerBuffer(this.ctx, signal), false);
|
|
2498
|
+
const listener = __addDisposableResource$2(env_1, new EventListener(this.ctx, sessionId, signal, queue), false);
|
|
2499
|
+
const streams = this.historyController.streamsListener;
|
|
2500
|
+
const assistantListener = __addDisposableResource$2(env_1, request.assistantStream === true ? streams.bind(sessionId, signal, queue) : void 0, false);
|
|
2501
|
+
const observation = __addDisposableResource$2(env_1, await this.historyController.usingObservation({
|
|
2502
|
+
sessionId,
|
|
2503
|
+
projection: true
|
|
2504
|
+
}, signal).catch((error) => {
|
|
2505
|
+
if (remoteErrorOf(error)?.code === "session/not-found") rejectNotFound(request.address);
|
|
2506
|
+
throw error;
|
|
2507
|
+
}), false);
|
|
2508
|
+
validateObservationAddress(request.address, observation);
|
|
2509
|
+
let opening = {
|
|
2510
|
+
type: "snapshot",
|
|
2511
|
+
header: { ...observation.header },
|
|
2512
|
+
projections: projections(observation),
|
|
2513
|
+
...history(observation, spec)
|
|
1399
2514
|
};
|
|
2515
|
+
listener.setCursor(opening.cursor);
|
|
2516
|
+
if (assistantListener !== void 0) {
|
|
2517
|
+
const { baseline: assistantStream, ordinal } = assistantListener.snapshot();
|
|
2518
|
+
opening = {
|
|
2519
|
+
...opening,
|
|
2520
|
+
assistantStream
|
|
2521
|
+
};
|
|
2522
|
+
assistantListener.setOrdinalCut(ordinal);
|
|
2523
|
+
}
|
|
2524
|
+
if (request.activate === true && !signal.aborted && observation.header.origin !== "subagent" && observation.source === "prepared") {
|
|
2525
|
+
const promotion = observation.retain();
|
|
2526
|
+
observation[Symbol.dispose]();
|
|
2527
|
+
try {
|
|
2528
|
+
this.promote(promotion);
|
|
2529
|
+
} catch (error) {
|
|
2530
|
+
promotion[Symbol.dispose]();
|
|
2531
|
+
throw error;
|
|
2532
|
+
}
|
|
2533
|
+
} else observation[Symbol.dispose]();
|
|
2534
|
+
yield opening;
|
|
2535
|
+
yield* queue.items();
|
|
1400
2536
|
} catch (e_1) {
|
|
1401
2537
|
env_1.error = e_1;
|
|
1402
2538
|
env_1.hasError = true;
|
|
@@ -1404,264 +2540,7 @@ var SessionHistoryController = class {
|
|
|
1404
2540
|
__disposeResources$2(env_1);
|
|
1405
2541
|
}
|
|
1406
2542
|
}
|
|
1407
|
-
/**
|
|
1408
|
-
* Follow events appended after an initial cursor on one durable address.
|
|
1409
|
-
* @param request - durable address and last committed sequence already held by the caller.
|
|
1410
|
-
* @param signal - stream cancellation owned by the Remote carrier.
|
|
1411
|
-
* @returns a complete opening snapshot followed by gap-free durable events and opted-in assistant frames.
|
|
1412
|
-
*/
|
|
1413
|
-
async *follow(request, signal) {
|
|
1414
|
-
validateHistoryWindow(request);
|
|
1415
|
-
const { address } = request;
|
|
1416
|
-
const target = addressId(address);
|
|
1417
|
-
const buffered = new Deque();
|
|
1418
|
-
let snapshotCursor;
|
|
1419
|
-
let assistantStreamOrdinal = 0;
|
|
1420
|
-
let wake;
|
|
1421
|
-
const notify = () => {
|
|
1422
|
-
const resume = wake;
|
|
1423
|
-
wake = void 0;
|
|
1424
|
-
resume?.();
|
|
1425
|
-
};
|
|
1426
|
-
const follower = { closed: false };
|
|
1427
|
-
const close = () => {
|
|
1428
|
-
follower.closed = true;
|
|
1429
|
-
notify();
|
|
1430
|
-
};
|
|
1431
|
-
this.closeFollowers.add(close);
|
|
1432
|
-
const disposeEvent = this.ctx.on("session/event", (session, event) => {
|
|
1433
|
-
if (session.id !== target) return;
|
|
1434
|
-
buffered.pushBack({
|
|
1435
|
-
type: "event",
|
|
1436
|
-
event
|
|
1437
|
-
});
|
|
1438
|
-
notify();
|
|
1439
|
-
}, { global: true });
|
|
1440
|
-
const disposeCreated = this.ctx.on("session/created", (session) => {
|
|
1441
|
-
if (session.id !== target) return;
|
|
1442
|
-
const suffix = session.snapshotEvents(snapshotCursor === void 0 ? session.firstLiveSeq : SessionLogOffset(snapshotCursor + 1));
|
|
1443
|
-
for (let index = suffix.length - 1; index >= 0; index -= 1) buffered.pushFront({
|
|
1444
|
-
type: "event",
|
|
1445
|
-
event: suffix[index]
|
|
1446
|
-
});
|
|
1447
|
-
notify();
|
|
1448
|
-
}, { global: true });
|
|
1449
|
-
const disposeAssistantStream = request.assistantStream !== true ? void 0 : this.ctx.on("agent/assistant-stream", ({ agent, frame }) => {
|
|
1450
|
-
if (agent.session.id !== target) return;
|
|
1451
|
-
buffered.pushBack({
|
|
1452
|
-
type: "assistant-stream",
|
|
1453
|
-
frame: wireAssistantStreamFrame(frame, cursorBeforeNext(agent.session.seq)),
|
|
1454
|
-
ordinal: ++assistantStreamOrdinal
|
|
1455
|
-
});
|
|
1456
|
-
notify();
|
|
1457
|
-
}, { global: true });
|
|
1458
|
-
const onAbort = () => {
|
|
1459
|
-
notify();
|
|
1460
|
-
};
|
|
1461
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
1462
|
-
try {
|
|
1463
|
-
const env_2 = {
|
|
1464
|
-
stack: [],
|
|
1465
|
-
error: void 0,
|
|
1466
|
-
hasError: false
|
|
1467
|
-
};
|
|
1468
|
-
try {
|
|
1469
|
-
const source = __addDisposableResource$2(env_2, await this.sourceFor(address, signal, true), false);
|
|
1470
|
-
const events = source.events;
|
|
1471
|
-
signal.throwIfAborted();
|
|
1472
|
-
const cursor = source.cursor;
|
|
1473
|
-
snapshotCursor = cursor;
|
|
1474
|
-
const page = paginate(events, void 0, request.maxMessages ?? DEFAULT_MAX_MESSAGES, cursor, request.turnWindow);
|
|
1475
|
-
const assistantStream = request.assistantStream === true ? this.assistantStreams.get(target)?.snapshot() ?? { revision: 0 } : void 0;
|
|
1476
|
-
const assistantStreamOrdinalCut = assistantStreamOrdinal;
|
|
1477
|
-
yield {
|
|
1478
|
-
type: "snapshot",
|
|
1479
|
-
header: wireHeader(source.header),
|
|
1480
|
-
cursor,
|
|
1481
|
-
records: pageRecords(page.events),
|
|
1482
|
-
hasMore: page.hasMore,
|
|
1483
|
-
projections: source.projections === void 0 ? {
|
|
1484
|
-
asOfSeq: cursor,
|
|
1485
|
-
values: {}
|
|
1486
|
-
} : projectionBlock(source.projections),
|
|
1487
|
-
...assistantStream === void 0 ? {} : { assistantStream }
|
|
1488
|
-
};
|
|
1489
|
-
if (address.kind === "session" && source.source === "prepared") {
|
|
1490
|
-
const promotion = source.retain();
|
|
1491
|
-
try {
|
|
1492
|
-
this.promote(promotion);
|
|
1493
|
-
} catch (error) {
|
|
1494
|
-
promotion[Symbol.dispose]();
|
|
1495
|
-
throw error;
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
let nextOffset = SessionLogOffset(cursor + 1);
|
|
1499
|
-
while (!follower.closed && !signal.aborted) {
|
|
1500
|
-
const item = buffered.popFront();
|
|
1501
|
-
if (item === void 0) {
|
|
1502
|
-
await new Promise((resolve) => {
|
|
1503
|
-
wake = resolve;
|
|
1504
|
-
});
|
|
1505
|
-
continue;
|
|
1506
|
-
}
|
|
1507
|
-
if (item.type === "assistant-stream") {
|
|
1508
|
-
if (item.ordinal > assistantStreamOrdinalCut) yield {
|
|
1509
|
-
type: "assistant-stream",
|
|
1510
|
-
frame: item.frame
|
|
1511
|
-
};
|
|
1512
|
-
continue;
|
|
1513
|
-
}
|
|
1514
|
-
const expectedSeq = SessionSeq(nextOffset);
|
|
1515
|
-
if (item.event.seq < expectedSeq) continue;
|
|
1516
|
-
if (item.event.seq !== expectedSeq) throw new RemoteError("gateway/internal", `session event stream skipped seq ${String(expectedSeq)}`, {});
|
|
1517
|
-
nextOffset = SessionLogOffset(nextOffset + 1);
|
|
1518
|
-
yield entryFor(item.event);
|
|
1519
|
-
}
|
|
1520
|
-
} catch (e_2) {
|
|
1521
|
-
env_2.error = e_2;
|
|
1522
|
-
env_2.hasError = true;
|
|
1523
|
-
} finally {
|
|
1524
|
-
__disposeResources$2(env_2);
|
|
1525
|
-
}
|
|
1526
|
-
} finally {
|
|
1527
|
-
this.closeFollowers.delete(close);
|
|
1528
|
-
signal.removeEventListener("abort", onAbort);
|
|
1529
|
-
disposeCreated();
|
|
1530
|
-
disposeEvent();
|
|
1531
|
-
disposeAssistantStream?.();
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
async sourceFor(address, signal, withProjections) {
|
|
1535
|
-
const sessionId = addressId(address);
|
|
1536
|
-
try {
|
|
1537
|
-
const observation = await this.ctx.sessionQuery.observeSession(sessionId, {
|
|
1538
|
-
signal,
|
|
1539
|
-
projectionMode: withProjections || address.kind === "subagent" ? "all" : "none"
|
|
1540
|
-
});
|
|
1541
|
-
if (observation.header.cwd === void 0) {
|
|
1542
|
-
observation[Symbol.dispose]();
|
|
1543
|
-
rejectNotFound(address);
|
|
1544
|
-
}
|
|
1545
|
-
try {
|
|
1546
|
-
validateAddress(address, observation.header, observation.inheritedEventCount, observation.projections);
|
|
1547
|
-
} catch (error) {
|
|
1548
|
-
observation[Symbol.dispose]();
|
|
1549
|
-
throw error;
|
|
1550
|
-
}
|
|
1551
|
-
return observation;
|
|
1552
|
-
} catch (error) {
|
|
1553
|
-
if (error instanceof SessionQueryError && error.code === "SESSION_QUERY_SESSION_NOT_FOUND") rejectNotFound(address);
|
|
1554
|
-
throw error;
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
2543
|
};
|
|
1558
|
-
function cursorBeforeNext(nextSeq) {
|
|
1559
|
-
return nextSeq === 0 ? -1 : SessionSeq(nextSeq - 1);
|
|
1560
|
-
}
|
|
1561
|
-
function wireAssistantStreamFrame(frame, durableCursor) {
|
|
1562
|
-
if (frame.type === "start") return {
|
|
1563
|
-
...frame,
|
|
1564
|
-
startedAfterSeq: durableCursor
|
|
1565
|
-
};
|
|
1566
|
-
if (frame.type === "end") return frame;
|
|
1567
|
-
return {
|
|
1568
|
-
...frame,
|
|
1569
|
-
chunk: frame.chunk
|
|
1570
|
-
};
|
|
1571
|
-
}
|
|
1572
|
-
function projectionBlock(snapshot) {
|
|
1573
|
-
return {
|
|
1574
|
-
asOfSeq: snapshot.asOfSeq,
|
|
1575
|
-
values: snapshot.values
|
|
1576
|
-
};
|
|
1577
|
-
}
|
|
1578
|
-
function validatePageRequest(request) {
|
|
1579
|
-
if (!Number.isSafeInteger(request.throughSeq) || request.throughSeq < -1 || Object.is(request.throughSeq, -0)) throw new RemoteError("gateway/bad-request", "throughSeq must be an integer greater than or equal to -1", {});
|
|
1580
|
-
if (request.beforeSeq !== void 0 && (!Number.isSafeInteger(request.beforeSeq) || request.beforeSeq < 0 || Object.is(request.beforeSeq, -0))) throw new RemoteError("gateway/bad-request", "beforeSeq must be a non-negative safe integer", {});
|
|
1581
|
-
validateHistoryWindow(request);
|
|
1582
|
-
}
|
|
1583
|
-
function validateHistoryWindow(request) {
|
|
1584
|
-
if (request.maxMessages !== void 0 && (!Number.isSafeInteger(request.maxMessages) || request.maxMessages <= 0)) throw new RemoteError("gateway/bad-request", "maxMessages must be a positive safe integer", {});
|
|
1585
|
-
const window = request.turnWindow;
|
|
1586
|
-
if (window !== void 0) {
|
|
1587
|
-
if (!Number.isSafeInteger(window.minMessages) || window.minMessages <= 0 || window.minMessages > (request.maxMessages ?? DEFAULT_MAX_MESSAGES)) throw new RemoteError("gateway/bad-request", "turnWindow.minMessages must be a positive safe integer no greater than maxMessages", {});
|
|
1588
|
-
if (!Number.isSafeInteger(window.minTurns) || window.minTurns <= 0) throw new RemoteError("gateway/bad-request", "turnWindow.minTurns must be a positive safe integer", {});
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
function addressId(address) {
|
|
1592
|
-
return address.kind === "session" ? address.sessionId : address.childSessionId;
|
|
1593
|
-
}
|
|
1594
|
-
function validateAddress(address, header, inheritedEventCount, projections) {
|
|
1595
|
-
if (address.kind === "session") {
|
|
1596
|
-
if (header.origin === "subagent") throw new RemoteError("session/agent-busy", "subagent Sessions require their durable parent address", { reason: "use subagent delivery for this child session" });
|
|
1597
|
-
return;
|
|
1598
|
-
}
|
|
1599
|
-
if (header.origin !== "subagent" || header.parentSession !== address.parentSessionId) throw new RemoteError("subagent/unauthorized", "subagent does not belong to the supplied parent", { childSessionId: address.childSessionId });
|
|
1600
|
-
const identity = projections?.values.subagent;
|
|
1601
|
-
if (identity === null) throw new RemoteError("subagent/catalog-diagnostic", "subagent descriptor is corrupt", {
|
|
1602
|
-
parentSessionId: address.parentSessionId,
|
|
1603
|
-
childSessionId: address.childSessionId,
|
|
1604
|
-
reason: "corrupt"
|
|
1605
|
-
});
|
|
1606
|
-
if (identity === void 0 || identity.seq < inheritedEventCount) throw new RemoteError("subagent/catalog-diagnostic", "subagent descriptor is unavailable", {
|
|
1607
|
-
parentSessionId: address.parentSessionId,
|
|
1608
|
-
childSessionId: address.childSessionId,
|
|
1609
|
-
reason: "unsupported"
|
|
1610
|
-
});
|
|
1611
|
-
if (address.mode !== "unknown" && identity.mode !== address.mode) throw new RemoteError("subagent/unauthorized", "subagent mode does not match the supplied address", { childSessionId: address.childSessionId });
|
|
1612
|
-
}
|
|
1613
|
-
function rejectNotFound(address) {
|
|
1614
|
-
if (address.kind === "session") throw new RemoteError("session/not-found", `session "${address.sessionId}" not found`, { sessionId: address.sessionId });
|
|
1615
|
-
throw new RemoteError("subagent/not-found", "subagent is unavailable", {
|
|
1616
|
-
parentSessionId: address.parentSessionId,
|
|
1617
|
-
childSessionId: address.childSessionId
|
|
1618
|
-
});
|
|
1619
|
-
}
|
|
1620
|
-
function paginate(events, beforeSeq, maxMessages, throughSeq, turnWindow) {
|
|
1621
|
-
const end = SessionLogOffset(Math.min(throughSeq + 1, beforeSeq ?? throughSeq + 1));
|
|
1622
|
-
let count = 0;
|
|
1623
|
-
let turns = 0;
|
|
1624
|
-
let cut = SessionLogOffset(0);
|
|
1625
|
-
for (let index = end - 1; index >= 0; index--) {
|
|
1626
|
-
const event = events[index];
|
|
1627
|
-
if (turnWindow !== void 0 && event.type === "turn/start") {
|
|
1628
|
-
turns++;
|
|
1629
|
-
if (count >= turnWindow.minMessages && turns >= turnWindow.minTurns) {
|
|
1630
|
-
cut = SessionLogOffset(index);
|
|
1631
|
-
break;
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
if (!MESSAGE_TYPES$1.has(event.type) || !isAppendSurfaceEvent(event)) continue;
|
|
1635
|
-
count++;
|
|
1636
|
-
const sources = event.sourceEventSeqs;
|
|
1637
|
-
let groupStart = event.seq;
|
|
1638
|
-
if (sources !== void 0) {
|
|
1639
|
-
for (const source of sources) if (source < groupStart) groupStart = source;
|
|
1640
|
-
}
|
|
1641
|
-
if (count >= maxMessages) {
|
|
1642
|
-
cut = SessionLogOffset(groupStart);
|
|
1643
|
-
break;
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
return {
|
|
1647
|
-
events: events.slice(cut, end),
|
|
1648
|
-
hasMore: cut > 0
|
|
1649
|
-
};
|
|
1650
|
-
}
|
|
1651
|
-
/** Translate current logical Session metadata to the browser wire. */
|
|
1652
|
-
function wireHeader(header) {
|
|
1653
|
-
return { ...header };
|
|
1654
|
-
}
|
|
1655
|
-
function entryFor(event) {
|
|
1656
|
-
return {
|
|
1657
|
-
type: "event",
|
|
1658
|
-
event
|
|
1659
|
-
};
|
|
1660
|
-
}
|
|
1661
|
-
/** Encode one bounded logical page without changing its pagination cut. */
|
|
1662
|
-
function pageRecords(events) {
|
|
1663
|
-
return events.map(entryFor);
|
|
1664
|
-
}
|
|
1665
2544
|
//#endregion
|
|
1666
2545
|
//#region lib/types/file-references.js
|
|
1667
2546
|
/** Session Controller adapter for Agent-scoped file-reference discovery. */
|
|
@@ -2545,6 +3424,12 @@ let SessionController = (() => {
|
|
|
2545
3424
|
let _updateQueue_decorators;
|
|
2546
3425
|
let _cancel_decorators;
|
|
2547
3426
|
let _page_decorators;
|
|
3427
|
+
let _events_decorators;
|
|
3428
|
+
let _observeEvent_decorators;
|
|
3429
|
+
let _observeProjections_decorators;
|
|
3430
|
+
let _state_decorators;
|
|
3431
|
+
let _observeState_decorators;
|
|
3432
|
+
let _wait_decorators;
|
|
2548
3433
|
let _follow_decorators;
|
|
2549
3434
|
let _projections_decorators;
|
|
2550
3435
|
let _control_decorators;
|
|
@@ -2567,6 +3452,12 @@ let SessionController = (() => {
|
|
|
2567
3452
|
_updateQueue_decorators = [Remote("updateQueue")];
|
|
2568
3453
|
_cancel_decorators = [Remote("cancel")];
|
|
2569
3454
|
_page_decorators = [Remote("page")];
|
|
3455
|
+
_events_decorators = [Remote];
|
|
3456
|
+
_observeEvent_decorators = [Remote({ mode: "stream" })];
|
|
3457
|
+
_observeProjections_decorators = [Remote({ mode: "stream" })];
|
|
3458
|
+
_state_decorators = [Remote];
|
|
3459
|
+
_observeState_decorators = [Remote({ mode: "stream" })];
|
|
3460
|
+
_wait_decorators = [Remote];
|
|
2570
3461
|
_follow_decorators = [Remote({ mode: "stream" })];
|
|
2571
3462
|
_projections_decorators = [Remote("projections")];
|
|
2572
3463
|
_control_decorators = [Remote({ mode: "stream" })];
|
|
@@ -2746,6 +3637,72 @@ let SessionController = (() => {
|
|
|
2746
3637
|
},
|
|
2747
3638
|
metadata: _metadata
|
|
2748
3639
|
}, null, _instanceExtraInitializers);
|
|
3640
|
+
__esDecorate(this, null, _events_decorators, {
|
|
3641
|
+
kind: "method",
|
|
3642
|
+
name: "events",
|
|
3643
|
+
static: false,
|
|
3644
|
+
private: false,
|
|
3645
|
+
access: {
|
|
3646
|
+
has: (obj) => "events" in obj,
|
|
3647
|
+
get: (obj) => obj.events
|
|
3648
|
+
},
|
|
3649
|
+
metadata: _metadata
|
|
3650
|
+
}, null, _instanceExtraInitializers);
|
|
3651
|
+
__esDecorate(this, null, _observeEvent_decorators, {
|
|
3652
|
+
kind: "method",
|
|
3653
|
+
name: "observeEvent",
|
|
3654
|
+
static: false,
|
|
3655
|
+
private: false,
|
|
3656
|
+
access: {
|
|
3657
|
+
has: (obj) => "observeEvent" in obj,
|
|
3658
|
+
get: (obj) => obj.observeEvent
|
|
3659
|
+
},
|
|
3660
|
+
metadata: _metadata
|
|
3661
|
+
}, null, _instanceExtraInitializers);
|
|
3662
|
+
__esDecorate(this, null, _observeProjections_decorators, {
|
|
3663
|
+
kind: "method",
|
|
3664
|
+
name: "observeProjections",
|
|
3665
|
+
static: false,
|
|
3666
|
+
private: false,
|
|
3667
|
+
access: {
|
|
3668
|
+
has: (obj) => "observeProjections" in obj,
|
|
3669
|
+
get: (obj) => obj.observeProjections
|
|
3670
|
+
},
|
|
3671
|
+
metadata: _metadata
|
|
3672
|
+
}, null, _instanceExtraInitializers);
|
|
3673
|
+
__esDecorate(this, null, _state_decorators, {
|
|
3674
|
+
kind: "method",
|
|
3675
|
+
name: "state",
|
|
3676
|
+
static: false,
|
|
3677
|
+
private: false,
|
|
3678
|
+
access: {
|
|
3679
|
+
has: (obj) => "state" in obj,
|
|
3680
|
+
get: (obj) => obj.state
|
|
3681
|
+
},
|
|
3682
|
+
metadata: _metadata
|
|
3683
|
+
}, null, _instanceExtraInitializers);
|
|
3684
|
+
__esDecorate(this, null, _observeState_decorators, {
|
|
3685
|
+
kind: "method",
|
|
3686
|
+
name: "observeState",
|
|
3687
|
+
static: false,
|
|
3688
|
+
private: false,
|
|
3689
|
+
access: {
|
|
3690
|
+
has: (obj) => "observeState" in obj,
|
|
3691
|
+
get: (obj) => obj.observeState
|
|
3692
|
+
},
|
|
3693
|
+
metadata: _metadata
|
|
3694
|
+
}, null, _instanceExtraInitializers);
|
|
3695
|
+
__esDecorate(this, null, _wait_decorators, {
|
|
3696
|
+
kind: "method",
|
|
3697
|
+
name: "wait",
|
|
3698
|
+
static: false,
|
|
3699
|
+
private: false,
|
|
3700
|
+
access: {
|
|
3701
|
+
has: (obj) => "wait" in obj,
|
|
3702
|
+
get: (obj) => obj.wait
|
|
3703
|
+
},
|
|
3704
|
+
metadata: _metadata
|
|
3705
|
+
}, null, _instanceExtraInitializers);
|
|
2749
3706
|
__esDecorate(this, null, _follow_decorators, {
|
|
2750
3707
|
kind: "method",
|
|
2751
3708
|
name: "follow",
|
|
@@ -2798,16 +3755,19 @@ let SessionController = (() => {
|
|
|
2798
3755
|
"sessionProjections",
|
|
2799
3756
|
"sessionQuery",
|
|
2800
3757
|
"typert",
|
|
3758
|
+
"typertGateway",
|
|
2801
3759
|
"workspaceRegistry"
|
|
2802
3760
|
];
|
|
2803
3761
|
static Config = z.object({
|
|
2804
3762
|
nativeOpen: z.boolean(),
|
|
2805
3763
|
listWorkSliceMs: z.natural().min(1).default(16)
|
|
2806
3764
|
});
|
|
2807
|
-
|
|
3765
|
+
historyController = __runInitializers(this, _instanceExtraInitializers);
|
|
3766
|
+
stateController;
|
|
3767
|
+
webController;
|
|
3768
|
+
agents;
|
|
2808
3769
|
commands;
|
|
2809
3770
|
controlState;
|
|
2810
|
-
history;
|
|
2811
3771
|
listState;
|
|
2812
3772
|
openPath;
|
|
2813
3773
|
fileApplications;
|
|
@@ -2845,7 +3805,9 @@ let SessionController = (() => {
|
|
|
2845
3805
|
ctx.effect(() => async () => {
|
|
2846
3806
|
await Promise.allSettled([...this.promotions]);
|
|
2847
3807
|
}, "session-controller.promotions");
|
|
2848
|
-
this.
|
|
3808
|
+
this.historyController = new HistoryController(ctx);
|
|
3809
|
+
this.stateController = new StateController(ctx, this.historyController);
|
|
3810
|
+
this.webController = new WebController(ctx, this.historyController, (observation) => {
|
|
2849
3811
|
this.promote(observation);
|
|
2850
3812
|
});
|
|
2851
3813
|
this.listState = new ApiSessionList(ctx, this.listWorkSliceMs);
|
|
@@ -2876,6 +3838,10 @@ let SessionController = (() => {
|
|
|
2876
3838
|
ctx.emit("api-session/activity", session.id, event.time);
|
|
2877
3839
|
});
|
|
2878
3840
|
}
|
|
3841
|
+
/**
|
|
3842
|
+
* Request background activation through the existing Session Agent controller.
|
|
3843
|
+
* @param observation - owned lease disposed by the background task; callers retain their own lease separately.
|
|
3844
|
+
*/
|
|
2879
3845
|
promote(observation) {
|
|
2880
3846
|
const sessionId = observation.header.id;
|
|
2881
3847
|
const task = (async () => {
|
|
@@ -3088,8 +4054,8 @@ let SessionController = (() => {
|
|
|
3088
4054
|
return this.commands.prompt(request, source);
|
|
3089
4055
|
}
|
|
3090
4056
|
/**
|
|
3091
|
-
* Read one image
|
|
3092
|
-
* @param request -
|
|
4057
|
+
* Read one image from the attachment store after gateway authorization.
|
|
4058
|
+
* @param request - image reference and gateway permission scope; Session existence is not checked.
|
|
3093
4059
|
* @returns the durable attachment reference and base64-encoded bytes.
|
|
3094
4060
|
*/
|
|
3095
4061
|
attachment(request) {
|
|
@@ -3113,12 +4079,67 @@ let SessionController = (() => {
|
|
|
3113
4079
|
}
|
|
3114
4080
|
/**
|
|
3115
4081
|
* Read one cold-safe, message-aligned Session history page.
|
|
3116
|
-
* @
|
|
4082
|
+
* @deprecated Use `events`; this entry point remains for existing Web callers.
|
|
4083
|
+
* @param request - durable address, optional fixed cut, backward cursor, and page budget.
|
|
3117
4084
|
* @param signal - cancellation for persistence reads.
|
|
3118
|
-
* @returns one chronological page.
|
|
4085
|
+
* @returns one chronological page with its inclusive cursor; an omitted `throughSeq` selects the observed log end.
|
|
3119
4086
|
*/
|
|
3120
4087
|
page(request, signal) {
|
|
3121
|
-
return this.
|
|
4088
|
+
return this.historyController.events(request, signal);
|
|
4089
|
+
}
|
|
4090
|
+
/**
|
|
4091
|
+
* Read one cold-safe, message-aligned Session history page.
|
|
4092
|
+
* @param request - durable address, optional fixed cut, backward cursor, and page budget.
|
|
4093
|
+
* @param signal - cancellation for persistence reads.
|
|
4094
|
+
* @returns one chronological page with its inclusive cursor.
|
|
4095
|
+
*/
|
|
4096
|
+
events(request, signal) {
|
|
4097
|
+
return this.historyController.events(request, signal);
|
|
4098
|
+
}
|
|
4099
|
+
/**
|
|
4100
|
+
* Subscribe to Session events without reading a snapshot.
|
|
4101
|
+
* @param request - Session address.
|
|
4102
|
+
* @param signal - subscription cancellation.
|
|
4103
|
+
* @returns readiness and subsequent events, without a snapshot.
|
|
4104
|
+
*/
|
|
4105
|
+
observeEvent(request, signal) {
|
|
4106
|
+
return this.historyController.observeEvent(request, signal);
|
|
4107
|
+
}
|
|
4108
|
+
/**
|
|
4109
|
+
* Subscribe to sparse Session projection changes.
|
|
4110
|
+
* @param request - target Session.
|
|
4111
|
+
* @param signal - subscription cancellation.
|
|
4112
|
+
* @returns readiness and sparse projection changes.
|
|
4113
|
+
*/
|
|
4114
|
+
observeProjections(request, signal) {
|
|
4115
|
+
return this.historyController.observeProjections(request, signal);
|
|
4116
|
+
}
|
|
4117
|
+
/**
|
|
4118
|
+
* Read passive Session state.
|
|
4119
|
+
* @param request - target Session.
|
|
4120
|
+
* @param signal - read cancellation.
|
|
4121
|
+
* @returns current passive state.
|
|
4122
|
+
*/
|
|
4123
|
+
state(request, signal) {
|
|
4124
|
+
return this.stateController.state(request, signal);
|
|
4125
|
+
}
|
|
4126
|
+
/**
|
|
4127
|
+
* Subscribe to complete Session state replacements.
|
|
4128
|
+
* @param request - target Session.
|
|
4129
|
+
* @param signal - subscription cancellation.
|
|
4130
|
+
* @returns complete passive state replacements.
|
|
4131
|
+
*/
|
|
4132
|
+
observeState(request, signal) {
|
|
4133
|
+
return this.stateController.observeState(request, signal);
|
|
4134
|
+
}
|
|
4135
|
+
/**
|
|
4136
|
+
* Wait for Session quiescence or pending input with bounded assistant output.
|
|
4137
|
+
* @param request - Session, wait bounds and output window.
|
|
4138
|
+
* @param signal - caller cancellation.
|
|
4139
|
+
* @returns stopping state and bounded assistant output.
|
|
4140
|
+
*/
|
|
4141
|
+
wait(request, signal) {
|
|
4142
|
+
return this.stateController.wait(request, signal);
|
|
3122
4143
|
}
|
|
3123
4144
|
/**
|
|
3124
4145
|
* Follow one Session log from its opening or resume cursor.
|
|
@@ -3128,7 +4149,7 @@ let SessionController = (() => {
|
|
|
3128
4149
|
* frames and optional cursorless assistant-stream frames.
|
|
3129
4150
|
*/
|
|
3130
4151
|
follow(request, signal) {
|
|
3131
|
-
return this.
|
|
4152
|
+
return this.webController.follow(request, signal);
|
|
3132
4153
|
}
|
|
3133
4154
|
/**
|
|
3134
4155
|
* Read exact projections, returning cached hints only when migration is required.
|
|
@@ -3136,57 +4157,8 @@ let SessionController = (() => {
|
|
|
3136
4157
|
* @param signal - cancellation for the Session read.
|
|
3137
4158
|
* @returns a sequenced baseline, cached hints when migration is deferred, or null when absent.
|
|
3138
4159
|
*/
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
if (sessionId.length === 0) throw new RemoteError("gateway/bad-request", "sessionId must not be empty", {});
|
|
3142
|
-
try {
|
|
3143
|
-
const env_2 = {
|
|
3144
|
-
stack: [],
|
|
3145
|
-
error: void 0,
|
|
3146
|
-
hasError: false
|
|
3147
|
-
};
|
|
3148
|
-
try {
|
|
3149
|
-
signal.throwIfAborted();
|
|
3150
|
-
const live = this.liveProjections(sessionId);
|
|
3151
|
-
if (live !== void 0) return live;
|
|
3152
|
-
const stored = await this.ctx.get("sessionPersistence")?.stat(sessionId, { signal });
|
|
3153
|
-
signal.throwIfAborted();
|
|
3154
|
-
const attached = this.liveProjections(sessionId);
|
|
3155
|
-
if (attached !== void 0) return attached;
|
|
3156
|
-
if (stored === void 0) return null;
|
|
3157
|
-
if (stored.formatStatus === "migration-required") return {
|
|
3158
|
-
kind: "migration-required",
|
|
3159
|
-
values: { ...(this.ctx.get("sessionProjectionCache")?.cachedSnapshot(stored.header))?.values }
|
|
3160
|
-
};
|
|
3161
|
-
const projections = __addDisposableResource(env_2, await this.ctx.sessionQuery.observeSession(sessionId, { signal }), false).projections;
|
|
3162
|
-
if (projections === void 0) throw new RemoteError("session/projections-unavailable", "Session projections are unavailable", {});
|
|
3163
|
-
return {
|
|
3164
|
-
kind: "sequenced",
|
|
3165
|
-
asOfSeq: projections.asOfSeq,
|
|
3166
|
-
values: projections.values
|
|
3167
|
-
};
|
|
3168
|
-
} catch (e_2) {
|
|
3169
|
-
env_2.error = e_2;
|
|
3170
|
-
env_2.hasError = true;
|
|
3171
|
-
} finally {
|
|
3172
|
-
__disposeResources(env_2);
|
|
3173
|
-
}
|
|
3174
|
-
} catch (error) {
|
|
3175
|
-
if (error instanceof SessionQueryError && error.code === "SESSION_QUERY_SESSION_NOT_FOUND") return this.liveProjections(sessionId) ?? null;
|
|
3176
|
-
if (signal.aborted || error instanceof SessionQueryError && error.code === "SESSION_QUERY_ABORTED") throw new RemoteError("gateway/cancelled", "Session projection read was cancelled", {}, { cause: error });
|
|
3177
|
-
if (error instanceof RemoteError) throw error;
|
|
3178
|
-
throw new RemoteError("gateway/internal", "Session projection read failed", {}, { cause: error });
|
|
3179
|
-
}
|
|
3180
|
-
}
|
|
3181
|
-
liveProjections(sessionId) {
|
|
3182
|
-
const session = this.ctx.sessions.get(sessionId);
|
|
3183
|
-
if (session === void 0) return void 0;
|
|
3184
|
-
const snapshot = this.ctx.sessionProjections.snapshot(session);
|
|
3185
|
-
return {
|
|
3186
|
-
kind: "sequenced",
|
|
3187
|
-
asOfSeq: snapshot.asOfSeq,
|
|
3188
|
-
values: snapshot.values
|
|
3189
|
-
};
|
|
4160
|
+
projections(request, signal) {
|
|
4161
|
+
return this.historyController.projections(request, signal);
|
|
3190
4162
|
}
|
|
3191
4163
|
/**
|
|
3192
4164
|
* Stream a complete live-control baseline followed by replacement frames.
|