@songtonyli/dsh-cli 0.1.93 → 0.1.94
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/README.md +10 -0
- package/node_modules/@deepseek-ai/cordis-plugin-include/lib/index.js +647 -149
- package/node_modules/@deepseek-ai/cordis-plugin-include/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-include/src/index.ts +362 -236
- package/node_modules/@deepseek-ai/cordis-plugin-include/src/journal.ts +242 -0
- package/node_modules/@deepseek-ai/cordis-plugin-include/src/patch.ts +261 -0
- package/node_modules/@deepseek-ai/cordis-plugin-loader/README.md +5 -1
- package/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js +96 -20
- package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/entry.ts +2 -2
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/group.ts +3 -2
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/tree.ts +77 -8
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/index.ts +24 -13
- 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/lib/bin-DQ1vWxS0.js +254 -0
- package/node_modules/@deepseek-ai/dsh/lib/bin.js +19 -245
- package/node_modules/@deepseek-ai/dsh/lib/{dump-config-D97dwXdd.js → dump-config-DCQrFN8g.js} +3 -3
- package/node_modules/@deepseek-ai/dsh/lib/dump-config-ekMiCsuS.js +2 -0
- package/node_modules/@deepseek-ai/dsh/lib/{dump-config-schema-r4V15-lg.js → dump-config-schema-C_NhxM7L.js} +2 -2
- package/node_modules/@deepseek-ai/dsh/lib/{plugin-DscIHF4k.js → plugin-cQMw2oZz.js} +4 -4
- package/node_modules/@deepseek-ai/dsh/lib/profile-boot.js +1 -1
- package/node_modules/@deepseek-ai/dsh/package.json +127 -127
- package/node_modules/@deepseek-ai/dsh-acp/lib/index.js +1 -1
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-action-cards/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-action-cards/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/index.js +7 -4
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +16 -4
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.remote-client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/types/index.js +7 -4
- package/node_modules/@deepseek-ai/dsh-action-cards/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-agent/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-agent/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent/lib/index.js +5 -30
- package/node_modules/@deepseek-ai/dsh-agent/lib/types/index.js +5 -32
- 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 +5 -7
- 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 +12 -8
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +15 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/types/mount.js +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-agent-team/README.i18n.yaml +97 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/README.md +217 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/README.zh.md +217 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/index.js +824 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/typert.host.js +825 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/typert.remote-client.js +79 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/client.js +3 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/error.js +10 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/index.js +176 -0
- package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/journal.js +17 -16
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/projection.js +172 -0
- package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/task-board.js +47 -25
- package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/task-view.js +4 -10
- package/node_modules/@deepseek-ai/dsh-agent-team/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/package.json +83 -0
- 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 +14 -14
- 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/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-api-remotes/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-api-remotes/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remotes/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +1048 -558
- 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 +8 -3
- 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 +49 -46
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +16 -48
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +46 -44
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +252 -264
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +209 -245
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +10 -19
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/archived-session-gate.js +6 -3
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/manager.js +8 -32
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/session.js +4 -21
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +2 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/control.js +3 -3
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +2 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.js +7 -7
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.js +14 -7
- package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +77 -77
- 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 +15 -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 +2 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-app-boot/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +841 -145
- 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/package.json +5 -5
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-base/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-base/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +29 -15
- package/node_modules/@deepseek-ai/dsh-base/package.json +103 -101
- 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 +15 -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/lib/client.js +16 -0
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-modules/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-modules/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/client.js +5 -1
- 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/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-action-cards/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/README.i18n.yaml +40 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/README.md +100 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/README.zh.md +100 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/lib/client.js +1425 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/package.json +72 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +12 -12
- 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 +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +74 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +40 -40
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +5 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +5 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +56 -48
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +35 -35
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/lib/client.js +24 -61
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +28 -28
- 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/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/README.md +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/README.zh.md +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/lib/client.js +73 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-file-drag/package.json +7 -7
- 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/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +185 -89
- 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 +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +106 -111
- 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/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +14 -14
- 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 +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +4 -6
- 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 +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.md +12 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.zh.md +12 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +4002 -400
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +21 -21
- 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/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/README.md +3 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/README.zh.md +3 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
- 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 +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +469 -41
- 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/package.json +7 -7
- 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 +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.md +15 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.zh.md +15 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/lib/client.js +773 -335
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/de.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/es.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/fr.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/ja.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/pt.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/ru.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/locale/zh.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +10 -9
- 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 +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +11 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +11 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +269 -111
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +15 -15
- 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/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.md +16 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.zh.md +16 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +310 -150
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +18 -17
- 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 +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +128 -50
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +20 -20
- 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 +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +44 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +26 -26
- 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 +15 -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 +27 -27
- 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/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/README.md +90 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/README.zh.md +90 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/lib/index.js +35 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +10 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +36 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-computer-use/package.json +44 -0
- package/node_modules/@deepseek-ai/dsh-config-editor/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +230 -62
- 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 +30 -6
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/lib/index.js +75 -77
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/lib/types/index.js +59 -54
- 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 +49 -0
- package/node_modules/@deepseek-ai/dsh-cua/README.md +132 -0
- package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +132 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/api.js +597 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/bridge.js +611 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +1803 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +1922 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/native-client.js +285 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/protocol.js +305 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/remote-types.js +1 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.host.js +458 -0
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.remote-client.js +343 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-cua/package.json +151 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.i18n.yaml +46 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.md +94 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.zh.md +94 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/cordis.patch.yml +10 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.md +1 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.zh.md +1 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.svg +33 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.zh.svg +33 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/icon.svg +35 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/de.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/en.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/es.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/fr.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ja.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/pt.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ru.json +7 -0
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/zh.json +7 -0
- package/node_modules/@deepseek-ai/{dsh-experimental-agent-team-profile → dsh-cua-bundle}/package.json +15 -12
- 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-api-speech-to-text/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +46 -46
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/package.json +4 -4
- 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 +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +5773 -5757
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +15 -3
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/package.json +42 -42
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/package.json +19 -18
- 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/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-forge/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.md +6 -4
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.zh.md +6 -4
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/cordis.patch.yml +4 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.de.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.es.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.fr.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.ja.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.pt.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.ru.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/DETAIL.zh.md +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/preview.svg +28 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/docs/preview.zh.svg +28 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/de.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/en.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/es.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/fr.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/ja.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/pt.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/ru.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/zh.json +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/package.json +10 -8
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/lib/index.js +11 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.md +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.zh.md +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/cordis.patch.yml +0 -4
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/client.js +892 -501
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/index.js +607 -229
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/typert.host.js +45 -31
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/typert.remote-client.js +33 -27
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +73 -75
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/lib/client.js +6 -2
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/package.json +5 -5
- 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/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/README.zh.md +2 -2
- 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/package.json +23 -23
- 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 +10 -10
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-patch/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +15 -3
- package/node_modules/@deepseek-ai/dsh-goal/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/lib/index.js +5 -1
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-headless/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-headless/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-headless/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-headless/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-hmr/lib/index.js +5 -1
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/README.zh.md +1 -1
- 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/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/lib/typert.host.js +2 -2
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/typert.remote-client.js +2 -2
- 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/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-http-proxy/README.md +4 -1
- package/node_modules/@deepseek-ai/dsh-http-proxy/README.zh.md +4 -1
- package/node_modules/@deepseek-ai/dsh-http-proxy/lib/index.js +54 -16
- 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 +37 -14
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +14 -2
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/content.js +38 -20
- package/node_modules/@deepseek-ai/dsh-llm/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.md +4 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.zh.md +4 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +52 -2
- 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 +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/index.js +5 -8
- 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 +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/index.js +4 -10
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.md +7 -2
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.zh.md +7 -2
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +18 -8
- 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 +15 -12
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.md +29 -6
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.zh.md +29 -6
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js +870 -202
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/connection.js +379 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/credentials.js +99 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/deadline.js +27 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/diagnostic.js +56 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/generation.js +111 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/index.js +163 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/probe.js +89 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/server-context.js +25 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/status.js +95 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/templates.js +66 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/tools.js +432 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/transport.js +39 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/types/types.js +7 -0
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +34 -24
- package/node_modules/@deepseek-ai/dsh-mcp-manager/README.i18n.yaml +64 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/README.md +196 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/README.zh.md +196 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/lib/index.js +572 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/lib/typert.host.js +323 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/lib/typert.remote-client.js +170 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/lib/types/index.js +582 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/lib/types/types.js +8 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-mcp-manager/package.json +77 -0
- 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/lib/client.js +2 -2
- 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 +38 -15
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +16 -16
- 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 +57 -95
- 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/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +15 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-persona/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-persona/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-persona/README.zh.md +1 -1
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plan-mode/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plan-mode/README.zh.md +1 -1
- 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/lib/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +12 -12
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +12 -12
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +38 -38
- package/node_modules/@deepseek-ai/dsh-plugin-market/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-market/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-market/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/index.js +37 -7
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/repository-cache.js +40 -7
- 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/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +15 -3
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/types/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +11 -8
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +21 -1
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +22 -2
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +2 -3
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/persistent-process.js +428 -31
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/process.js +423 -28
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +23 -23
- 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 +39 -16
- 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 +26 -26
- 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/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +40 -40
- 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/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/index.js +21 -18
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +48 -48
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-session/lib/types/known-event-types.js +1 -0
- 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/lib/index.js +36 -13
- 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 +76 -29
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-session-projection/README.md +10 -6
- package/node_modules/@deepseek-ai/dsh-session-projection/README.zh.md +10 -6
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/index.js +107 -42
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/types/index.js +128 -47
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/README.zh.md +1 -1
- 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 +15 -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/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +5 -5
- 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/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent/README.i18n.yaml +39 -24
- package/node_modules/@deepseek-ai/dsh-subagent/README.md +41 -20
- package/node_modules/@deepseek-ai/dsh-subagent/README.zh.md +41 -20
- package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +574 -873
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +64 -120
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.remote-client.js +17 -63
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/archive-admission.js +39 -115
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/child-agent.js +6 -4
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/continuation-messages.js +12 -14
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/control.js +1 -5
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/descriptor.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/index.js +83 -146
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/lifecycle.js +5 -31
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +396 -570
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.js +2 -2
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/types.js +2 -4
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +51 -55
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.zh.md +1 -1
- 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/lib/index.js +0 -1
- 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 +38 -15
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-token-meter/lib/index.js +4 -2
- package/node_modules/@deepseek-ai/dsh-token-meter/lib/types/breakdown-projection.js +1 -0
- package/node_modules/@deepseek-ai/dsh-token-meter/lib/types/usage-projection.js +1 -0
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/README.i18n.yaml +85 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/README.md +178 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/README.zh.md +178 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/lib/index.js +308 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-tool-agent-team/package.json +63 -0
- 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 +230 -184
- 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/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 +7 -7
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +7 -7
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +5 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +39 -39
- 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 +1 -1
- 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 +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-session-query/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-skill/lib/index.js +1 -0
- 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 +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +15 -13
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +14 -12
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +40 -43
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.i18n.yaml +53 -38
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.md +41 -21
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.zh.md +41 -21
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/index.js +235 -98
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +25 -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/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-web/README.md +5 -4
- package/node_modules/@deepseek-ai/dsh-tool-web/README.zh.md +5 -4
- package/node_modules/@deepseek-ai/dsh-tool-web/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +25 -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 +6 -6
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +10 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +10 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/cordis.patch.yml +17 -0
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +113 -99
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +87 -87
- 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/index.js +5 -6
- package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +16 -4
- package/node_modules/@deepseek-ai/dsh-user-questions/lib/types/index.js +5 -6
- 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/README.i18n.yaml +18 -12
- package/node_modules/@deepseek-ai/dsh-web/README.md +38 -7
- package/node_modules/@deepseek-ai/dsh-web/README.zh.md +38 -7
- package/node_modules/@deepseek-ai/dsh-web/lib/index.js +220 -112
- package/node_modules/@deepseek-ai/dsh-web/lib/typert.host.js +178 -0
- package/node_modules/@deepseek-ai/dsh-web/lib/typert.remote-client.js +45 -0
- package/node_modules/@deepseek-ai/dsh-web/lib/types/index.js +277 -0
- package/node_modules/@deepseek-ai/dsh-web/lib/types/types.js +18 -0
- package/node_modules/@deepseek-ai/dsh-web/package.json +26 -7
- package/node_modules/@deepseek-ai/dsh-web-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-web-app/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-web-app/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +14 -6
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +157 -154
- package/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +1 -1
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/README.md +22 -12
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/README.zh.md +22 -12
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/lib/index.js +394 -163
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/package.json +30 -19
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/lib/index.js +11 -0
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-B2q7cWGa.js +199 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-uWlUD22X.css +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{graphql-C-Uijqkk.js → graphql-DFkUqiqq.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{http-CLu1VCSi.js → http-BbPA7N5Y.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/php-BcJWnZHR.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{rst-BuDKiyD7.js → rst-CtdShwKQ.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{ruby-ZtjE4NPI.js → ruby-DllPV2XI.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{svelte-Tt81icjn.js → svelte-ZPgsG5h9.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{vue-B5SDFeDA.js → vue-CnLRC5W9.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{vendor-7utBqO4o.js → vendor-BUMdD3V7.js} +3 -3
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +3 -3
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.md +6 -4
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.zh.md +6 -4
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/lib/index.js +30 -18
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +20 -18
- 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/lib/index.js +11 -13
- 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 +26 -26
- package/node_modules/@deepseek-ai/schemastery/package.json +2 -2
- package/package.json +346 -343
- package/node_modules/@deepseek-ai/dsh/lib/dump-config-DuXZcU0e.js +0 -2
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.i18n.yaml +0 -100
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.md +0 -227
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.zh.md +0 -227
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/index.js +0 -1650
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/activity.js +0 -85
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/client.js +0 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/error.js +0 -23
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/index.js +0 -232
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/lifecycle.js +0 -103
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/persisted.js +0 -20
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/projection.js +0 -327
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/roster.js +0 -452
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/session-message.js +0 -23
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/package.json +0 -68
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.i18n.yaml +0 -52
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.md +0 -118
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.zh.md +0 -118
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/cordis.patch.yml +0 -29
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/DETAIL.md +0 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/DETAIL.zh.md +0 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/preview.svg +0 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/preview.zh.svg +0 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/icon.svg +0 -12
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/de.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/en.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/es.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/fr.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/ja.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/pt.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/ru.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/zh.json +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/README.i18n.yaml +0 -43
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/README.md +0 -102
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/README.zh.md +0 -102
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/lib/client.js +0 -690
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/package.json +0 -66
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/viewer-declarations-krUNq6VU.js +0 -287
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/viewer-declarations.js +0 -26
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.i18n.yaml +0 -70
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.md +0 -155
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.zh.md +0 -155
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/lib/index.js +0 -626
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/package.json +0 -62
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BCbHmUSs.js +0 -197
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BUDGJY4R.css +0 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/php-CjQPq1Mz.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-search-exa/README.i18n.yaml +0 -61
- package/node_modules/@deepseek-ai/dsh-web-search-exa/README.md +0 -142
- package/node_modules/@deepseek-ai/dsh-web-search-exa/README.zh.md +0 -142
- package/node_modules/@deepseek-ai/dsh-web-search-exa/lib/index.js +0 -154
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/de.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/es.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/fr.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/pt.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/ru.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-exa/package.json +0 -45
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/README.i18n.yaml +0 -82
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/README.md +0 -165
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/README.zh.md +0 -165
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/lib/index.js +0 -152
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/de.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/es.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/fr.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/pt.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/ru.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/package.json +0 -45
- package/node_modules/@deepseek-ai/dsh/lib/{profile-boot-e2mS45fC.js → profile-boot-xiaehH2x.js} +3 -3
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/task-graph.js +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/types.js +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/validation.js +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/locale/de.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/locale/es.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/locale/fr.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/locale/pt.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/locale/ru.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-client-ui-agent-team → dsh-client-ui-agent-team}/lib/index.js +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-client-ui-agent-team → dsh-client-ui-agent-team}/locale/de.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-client-ui-agent-team → dsh-client-ui-agent-team}/locale/es.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-client-ui-agent-team → dsh-client-ui-agent-team}/locale/fr.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-client-ui-agent-team → dsh-client-ui-agent-team}/locale/pt.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-client-ui-agent-team → dsh-client-ui-agent-team}/locale/ru.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-agent-team-profile → dsh-cua-bundle}/lib/index.js +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-tool-agent-team → dsh-tool-agent-team}/locale/de.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-tool-agent-team → dsh-tool-agent-team}/locale/es.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-tool-agent-team → dsh-tool-agent-team}/locale/fr.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-tool-agent-team → dsh-tool-agent-team}/locale/pt.json +0 -0
- /package/node_modules/@deepseek-ai/{dsh-experimental-tool-agent-team → dsh-tool-agent-team}/locale/ru.json +0 -0
|
@@ -7,8 +7,8 @@ import { Remote, RemoteError, TypertRemoteService, principalOf } from "@deepseek
|
|
|
7
7
|
import { AttachmentError } from "@deepseek-ai/dsh-attachment";
|
|
8
8
|
import { z as z$1 } from "zod";
|
|
9
9
|
import { HarnessError, ReasoningEffortId, boundContextSummary, contentHasImage, createUserMessage, errorChain, joinAssistantStreamText } from "@deepseek-ai/dsh-llm";
|
|
10
|
-
import { randomUUID } from "node:crypto";
|
|
11
10
|
import { foldConsumedWork } from "@deepseek-ai/dsh-agent";
|
|
11
|
+
import { randomUUID } from "node:crypto";
|
|
12
12
|
import { isAbsolute, resolve } from "node:path";
|
|
13
13
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
14
14
|
import { SessionLogOffset, SessionSeq } from "@deepseek-ai/dsh-session";
|
|
@@ -39,16 +39,10 @@ var SubagentError = class extends HarnessError {
|
|
|
39
39
|
const SESSION_ID_SCHEMA = z$1.string().min(1);
|
|
40
40
|
const CONTROL_ID_SCHEMAS = {
|
|
41
41
|
"subagent.prompt": z$1.object({
|
|
42
|
-
parentSessionId: SESSION_ID_SCHEMA,
|
|
43
42
|
childSessionId: SESSION_ID_SCHEMA,
|
|
44
|
-
mode: z$1.literal("continuable"),
|
|
45
43
|
delivery: z$1.enum(["queue", "steer"])
|
|
46
44
|
}),
|
|
47
|
-
"subagent.interrupt": z$1.object({
|
|
48
|
-
parentSessionId: SESSION_ID_SCHEMA,
|
|
49
|
-
childSessionId: SESSION_ID_SCHEMA,
|
|
50
|
-
mode: z$1.literal("continuable")
|
|
51
|
-
})
|
|
45
|
+
"subagent.interrupt": z$1.object({ childSessionId: SESSION_ID_SCHEMA })
|
|
52
46
|
};
|
|
53
47
|
/**
|
|
54
48
|
* Apply the subagent payload checks that are stricter than generated
|
|
@@ -77,7 +71,7 @@ function rejectPrompt(error, childSessionId, signal) {
|
|
|
77
71
|
if (error instanceof SubagentError) switch (error.code) {
|
|
78
72
|
case "MODEL_DOES_NOT_SUPPORT_IMAGES": throw new RemoteError("subagent/attachment-invalid", error.message, { reason: error.code }, { cause: error });
|
|
79
73
|
case "NOT_RESUMABLE": throw new RemoteError("subagent/not-resumable", "subagent cannot be resumed", { childSessionId }, { cause: error });
|
|
80
|
-
case "UNAUTHORIZED": throw new RemoteError("subagent/unauthorized", "subagent
|
|
74
|
+
case "UNAUTHORIZED": throw new RemoteError("subagent/unauthorized", "subagent membership in the active tree could not be verified", { childSessionId }, { cause: error });
|
|
81
75
|
case "DRAINING":
|
|
82
76
|
case "ACTIVATION_CLOSING":
|
|
83
77
|
case "ACTIVATION_LIMIT_REACHED":
|
|
@@ -122,32 +116,12 @@ function assertSubagentMaxDepth(maxDepth) {
|
|
|
122
116
|
if (maxDepth !== void 0 && (typeof maxDepth !== "number" || !Number.isSafeInteger(maxDepth) || maxDepth < 0 || Object.is(maxDepth, -0))) throw new TypeError("subagent maxDepth must be a non-negative safe integer");
|
|
123
117
|
}
|
|
124
118
|
//#endregion
|
|
125
|
-
//#region lib/types/types.js
|
|
126
|
-
/**
|
|
127
|
-
* The seam's consumer-facing contracts: request, result, and capability types
|
|
128
|
-
* for {@link SubagentProvider}, plus the `subagent/start` and `subagent/end`
|
|
129
|
-
* payloads that plugins and hosts observe. Internal control interfaces belong
|
|
130
|
-
* with their implementation — the lifecycle observer in `./lifecycle.ts`, the
|
|
131
|
-
* manager host in `./manager.ts` — so this module stays the published
|
|
132
|
-
* surface rather than a bag of everything type-shaped.
|
|
133
|
-
*
|
|
134
|
-
* @module @deepseek-ai/dsh-subagent/types
|
|
135
|
-
*/
|
|
136
|
-
/**
|
|
137
|
-
* Brand a string as a {@link SubagentRunId}.
|
|
138
|
-
* @param id - the raw run id.
|
|
139
|
-
* @returns the same string, branded.
|
|
140
|
-
*/
|
|
141
|
-
function SubagentRunId(id) {
|
|
142
|
-
return id;
|
|
143
|
-
}
|
|
144
|
-
//#endregion
|
|
145
119
|
//#region lib/types/lifecycle.js
|
|
146
120
|
/**
|
|
147
|
-
*
|
|
121
|
+
* Contained lifecycle notifications for subagents.
|
|
148
122
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
123
|
+
* The service owns scoped dispatch and listener containment; the manager
|
|
124
|
+
* supplies event payloads from each activation.
|
|
151
125
|
*
|
|
152
126
|
* @module @deepseek-ai/dsh-subagent/lifecycle
|
|
153
127
|
*/
|
|
@@ -157,8 +131,8 @@ function SubagentRunId(id) {
|
|
|
157
131
|
* returned promise is logged without starving peer listeners, changing the run,
|
|
158
132
|
* or — for provider removal, which fires from a disposer — breaking teardown.
|
|
159
133
|
* @param ctx - the service's own context, owning dispatch and the logger.
|
|
160
|
-
* @param carrier - resolve the scoped dispatch carrier for one
|
|
161
|
-
* @returns the emitter
|
|
134
|
+
* @param carrier - resolve the scoped dispatch carrier for one subagent tree root.
|
|
135
|
+
* @returns the emitter the manager and provider registry publish through.
|
|
162
136
|
*/
|
|
163
137
|
function createLifecycleEmitter(ctx, carrier) {
|
|
164
138
|
return (name, info, parent) => {
|
|
@@ -178,35 +152,6 @@ function createLifecycleEmitter(ctx, carrier) {
|
|
|
178
152
|
};
|
|
179
153
|
}
|
|
180
154
|
/**
|
|
181
|
-
* Build the observer for one local or external activation's residency epoch. Creation failure before residency emits no lifecycle edge.
|
|
182
|
-
* @param emit - the contained lifecycle emitter.
|
|
183
|
-
* @param provider - the provider name recorded in the durable descriptor.
|
|
184
|
-
* @param childId - the durable child session id.
|
|
185
|
-
* @param parent - the exact live direct parent keying scoped dispatch.
|
|
186
|
-
* @returns the observer whose edges this epoch publishes.
|
|
187
|
-
*/
|
|
188
|
-
function createActivationObserver(emit, provider, childId, parent) {
|
|
189
|
-
const identity = {
|
|
190
|
-
runId: SubagentRunId(randomUUID()),
|
|
191
|
-
provider,
|
|
192
|
-
id: childId,
|
|
193
|
-
local: false
|
|
194
|
-
};
|
|
195
|
-
return {
|
|
196
|
-
start: (child) => {
|
|
197
|
-
identity.local = child !== void 0;
|
|
198
|
-
emit("subagent/start", identity, parent);
|
|
199
|
-
},
|
|
200
|
-
settle: ({ stopReason, output }) => {
|
|
201
|
-
emit("subagent/end", {
|
|
202
|
-
...identity,
|
|
203
|
-
stopReason,
|
|
204
|
-
...output.length === 0 ? {} : { lastAssistantMessage: output }
|
|
205
|
-
}, parent);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
155
|
* Why this child's epoch ended, for the terminal lifecycle edge and the
|
|
211
156
|
* manager's own parent delivery. The child's own log is authoritative:
|
|
212
157
|
* teardown succeeding says nothing about whether the model errored, hit its
|
|
@@ -367,10 +312,11 @@ function childSessionMeta(parent, childDepth, isSeeded, selectedPreset) {
|
|
|
367
312
|
const SUBAGENT_DELEGATION_CONTEXT = "You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Before each tool call, say in one short sentence what you are doing and why it serves the task, so your progress can be followed.";
|
|
368
313
|
/**
|
|
369
314
|
* Compose a child before publication and restore historical descriptor overrides.
|
|
370
|
-
* Explicit selection mounts the named preset
|
|
371
|
-
*
|
|
315
|
+
* Explicit selection mounts the named preset. Omission joins a supplied creator's
|
|
316
|
+
* current generation; a restored child without a saved preset uses host composition.
|
|
317
|
+
* Registrations belong to the child's scope.
|
|
372
318
|
* @param childCtx - the child agent's scoped creation context.
|
|
373
|
-
* @param parent -
|
|
319
|
+
* @param parent - creator for fresh delegation; absent during target-only restoration.
|
|
374
320
|
* @param composition - independent preset and any overrides read from a historical descriptor.
|
|
375
321
|
* @returns A promise when mounting an independent preset; otherwise completes synchronously.
|
|
376
322
|
*/
|
|
@@ -382,7 +328,7 @@ function applyChildComposition(childCtx, parent, composition) {
|
|
|
382
328
|
applyChildOverrides(childCtx, composition);
|
|
383
329
|
});
|
|
384
330
|
}
|
|
385
|
-
childCtx.get("agentPresets")?.composeFrom(childCtx, parent.ctx);
|
|
331
|
+
if (parent !== void 0) childCtx.get("agentPresets")?.composeFrom(childCtx, parent.ctx);
|
|
386
332
|
applyChildOverrides(childCtx, composition);
|
|
387
333
|
}
|
|
388
334
|
function applyChildOverrides(childCtx, composition) {
|
|
@@ -444,7 +390,7 @@ function appendDelegatedPolicyOverrides(childSession, overrides) {
|
|
|
444
390
|
*
|
|
445
391
|
* @module @deepseek-ai/dsh-subagent/continuation-messages
|
|
446
392
|
*/
|
|
447
|
-
/** Build durable attribution for one
|
|
393
|
+
/** Build durable attribution for one Agent message. */
|
|
448
394
|
function agentMessageSource(sender) {
|
|
449
395
|
return {
|
|
450
396
|
kind: "agent-message",
|
|
@@ -453,7 +399,7 @@ function agentMessageSource(sender) {
|
|
|
453
399
|
};
|
|
454
400
|
}
|
|
455
401
|
/**
|
|
456
|
-
* Build the model-visible and durable representation of one
|
|
402
|
+
* Build the model-visible and durable representation of one Agent message.
|
|
457
403
|
* @param sender - exact live Agent that authored the message.
|
|
458
404
|
* @param content - model-visible message blocks supplied by the sender.
|
|
459
405
|
* @returns the durable user-message representation delivered to the recipient.
|
|
@@ -468,16 +414,14 @@ function createAgentMessage(sender, content) {
|
|
|
468
414
|
});
|
|
469
415
|
}
|
|
470
416
|
/**
|
|
471
|
-
* Append
|
|
472
|
-
* @param parentId - durable parent session id named in the guidance.
|
|
417
|
+
* Append automatic result-delivery guidance to a parent-delivered child's initial task.
|
|
473
418
|
* @param prompt - initial model-visible task blocks.
|
|
474
|
-
* @returns task blocks followed by the
|
|
419
|
+
* @returns task blocks followed by the result-delivery guidance.
|
|
475
420
|
*/
|
|
476
|
-
function
|
|
477
|
-
const encodedParentId = JSON.stringify(parentId);
|
|
421
|
+
function withResultDeliveryGuidance(prompt) {
|
|
478
422
|
return [...prompt, {
|
|
479
423
|
type: "text",
|
|
480
|
-
text:
|
|
424
|
+
text: "Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."
|
|
481
425
|
}];
|
|
482
426
|
}
|
|
483
427
|
/**
|
|
@@ -507,8 +451,8 @@ function settlementSummary(childId, stopReason, continuable) {
|
|
|
507
451
|
* @param childId - durable child session id named in the notice.
|
|
508
452
|
* @param terminal - recorded terminal state for the settled Activation.
|
|
509
453
|
* @param continuable - whether the child can accept another task.
|
|
510
|
-
* @param omitClosingText - replace the closing text
|
|
511
|
-
*
|
|
454
|
+
* @param omitClosingText - replace the closing text when the child's last action
|
|
455
|
+
* was a message to its direct parent.
|
|
512
456
|
* @returns the durable user-message representation delivered to the parent.
|
|
513
457
|
*/
|
|
514
458
|
function createSettlementMessage(childId, terminal, continuable = true, omitClosingText = false) {
|
|
@@ -543,11 +487,84 @@ function createSettlementMessage(childId, terminal, continuable = true, omitClos
|
|
|
543
487
|
kind: "subagent-settled",
|
|
544
488
|
form: "notice",
|
|
545
489
|
summary: boundContextSummary(summary),
|
|
490
|
+
stopReason: terminal.stopReason,
|
|
546
491
|
senderSessionId: childId
|
|
547
492
|
}
|
|
548
493
|
});
|
|
549
494
|
}
|
|
550
495
|
//#endregion
|
|
496
|
+
//#region lib/types/archive-admission.js
|
|
497
|
+
/**
|
|
498
|
+
* The `subagent` family of the Workspace registry's archive admission: which
|
|
499
|
+
* subagent descendants of a Session are still inside a turn, and how they
|
|
500
|
+
* stop when the Session is archived with its work. Archived ancestors also
|
|
501
|
+
* block later model steps, including when their Sessions have been released.
|
|
502
|
+
*
|
|
503
|
+
* @module @deepseek-ai/dsh-subagent
|
|
504
|
+
*/
|
|
505
|
+
/**
|
|
506
|
+
* Answer `workspace/session-activity` with the running subagent descendants of
|
|
507
|
+
* the asked Session, and `workspace/session-stop` by cancelling each of them
|
|
508
|
+
* as their parent would. Reject subsequent steps beneath archived ancestors.
|
|
509
|
+
* All listeners live as long as `ctx`'s fiber.
|
|
510
|
+
* @param ctx - context carrying the Agent registry.
|
|
511
|
+
* @param residentAncestors - verified creation ancestors for an exact managed Agent, absent before publication or for unmanaged Agents.
|
|
512
|
+
* @param identityOf - ready service-owned descriptor identity reader; absent or invalid descriptors yield no identity.
|
|
513
|
+
*/
|
|
514
|
+
function installSubagentArchiveAdmission(ctx, residentAncestors, identityOf) {
|
|
515
|
+
const ancestorsOf = (agent) => residentAncestors(agent) ?? headerAncestors(ctx, agent);
|
|
516
|
+
const runningDescendants = (sessionId) => ctx.agents.list().filter((agent) => agent.status === "running" && ancestorsOf(agent).includes(sessionId));
|
|
517
|
+
ctx.on("workspace/session-activity", async ({ sessionId }, next) => {
|
|
518
|
+
const running = runningDescendants(sessionId);
|
|
519
|
+
const rest = await next();
|
|
520
|
+
if (running.length === 0) return rest;
|
|
521
|
+
return [{
|
|
522
|
+
kind: "subagent",
|
|
523
|
+
items: running.map((child) => describe(child, identityOf(child.session)))
|
|
524
|
+
}, ...rest];
|
|
525
|
+
});
|
|
526
|
+
ctx.on("workspace/session-stop", ({ sessionId }) => {
|
|
527
|
+
for (const child of runningDescendants(sessionId)) try {
|
|
528
|
+
child.cancel({ kind: "parent" });
|
|
529
|
+
} catch (error) {
|
|
530
|
+
ctx.logger.warn(`subagent: cancelling "${child.id}" for an archived Session failed: ${String(error)}`);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
ctx.on("agent/pre-step", ({ agent }, next) => {
|
|
534
|
+
const archived = ctx.get("workspaceRegistry")?.archivedSessionIds;
|
|
535
|
+
return archived !== void 0 && ancestorsOf(agent).some((id) => archived.includes(id)) ? Promise.resolve({ kind: "reject" }) : next();
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Header-only ancestry for Agents without a published Activation. Include an
|
|
540
|
+
* offline direct creator; ordinary forks stop the chain and cycles terminate.
|
|
541
|
+
*/
|
|
542
|
+
function headerAncestors(ctx, agent) {
|
|
543
|
+
const ancestors = [];
|
|
544
|
+
const visited = new Set([agent.id]);
|
|
545
|
+
let header = agent.session.header;
|
|
546
|
+
while (header.origin === "subagent" && header.parentSession !== void 0 && !visited.has(header.parentSession)) {
|
|
547
|
+
const parentId = header.parentSession;
|
|
548
|
+
ancestors.push(parentId);
|
|
549
|
+
visited.add(parentId);
|
|
550
|
+
const parent = ctx.agents.get(parentId)?.session;
|
|
551
|
+
if (parent === void 0) break;
|
|
552
|
+
header = parent.header;
|
|
553
|
+
}
|
|
554
|
+
return ancestors;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Report the child's current projected label only when its descriptor belongs
|
|
558
|
+
* to the child's own log; inherited, absent, or invalid identities yield the id alone.
|
|
559
|
+
*/
|
|
560
|
+
function describe(child, identity) {
|
|
561
|
+
const label = identity !== void 0 && child.session.isOwnSeq(identity.seq) ? identity.label : void 0;
|
|
562
|
+
return label === void 0 ? { id: child.id } : {
|
|
563
|
+
id: child.id,
|
|
564
|
+
label
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
551
568
|
//#region lib/types/descriptor.js
|
|
552
569
|
/**
|
|
553
570
|
* The durable subagent-child descriptor: the versioned, model-hidden
|
|
@@ -565,7 +582,7 @@ function createSettlementMessage(childId, terminal, continuable = true, omitClos
|
|
|
565
582
|
* to one activation's result contract rather than durable child composition.
|
|
566
583
|
* Per-activation knobs such as `maxTokens` are omitted for the same reason as
|
|
567
584
|
* `outputSchema`: they budget one activation. Cold resume requires the exact
|
|
568
|
-
* live
|
|
585
|
+
* live subagent tree root for authorization but reconstructs child options only from the
|
|
569
586
|
* durable descriptor, so it neither restores the prior budget nor inherits
|
|
570
587
|
* the parent's current one; the resumed route's defaults apply instead.
|
|
571
588
|
*
|
|
@@ -843,28 +860,23 @@ function establishExternalCatalogChild(parent, childId, label) {
|
|
|
843
860
|
});
|
|
844
861
|
}
|
|
845
862
|
//#endregion
|
|
846
|
-
//#region lib/types/
|
|
863
|
+
//#region lib/types/types.js
|
|
847
864
|
/**
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
865
|
+
* The seam's consumer-facing contracts: request, result, and capability types
|
|
866
|
+
* for {@link SubagentProvider}, plus the `subagent/start` and `subagent/end`
|
|
867
|
+
* payloads that plugins and hosts observe. Internal control interfaces, such
|
|
868
|
+
* as the manager host, belong with their implementation.
|
|
869
|
+
*
|
|
870
|
+
* @module @deepseek-ai/dsh-subagent/types
|
|
851
871
|
*/
|
|
852
|
-
/** Process-stable identity carried only by the standard adjacent-Agent messaging tool. */
|
|
853
|
-
const adjacentAgentSendMessageTool = Symbol.for("dsh.subagent.adjacentAgentSendMessageTool");
|
|
854
872
|
/**
|
|
855
|
-
*
|
|
856
|
-
* @param
|
|
857
|
-
* @returns
|
|
873
|
+
* Brand a string as a {@link SubagentRunId}.
|
|
874
|
+
* @param id - the raw run id.
|
|
875
|
+
* @returns the same string, branded.
|
|
858
876
|
*/
|
|
859
|
-
function
|
|
860
|
-
return
|
|
877
|
+
function SubagentRunId(id) {
|
|
878
|
+
return id;
|
|
861
879
|
}
|
|
862
|
-
/**
|
|
863
|
-
* Process-stable symbol-keyed host delivery shared by the bundled runtime
|
|
864
|
-
* entry and this unbundled internal subpath.
|
|
865
|
-
* @internal
|
|
866
|
-
*/
|
|
867
|
-
const deliverSubagentPrompt = Symbol.for("dsh.subagent.deliverPrompt");
|
|
868
880
|
//#endregion
|
|
869
881
|
//#region lib/types/structured.js
|
|
870
882
|
/**
|
|
@@ -892,7 +904,7 @@ const STRUCTURED_OUTPUT_INSTRUCTION = `When you have your final answer, you MUST
|
|
|
892
904
|
* @param childCtx - the child agent's scope context (`setup`'s argument).
|
|
893
905
|
* @param schema - the trusted, already-asserted schema subset to enforce (see
|
|
894
906
|
* `assertObjectJsonSchema` in dsh-tools).
|
|
895
|
-
* @param canComplete - whether accepted input
|
|
907
|
+
* @param canComplete - whether accepted input has been processed.
|
|
896
908
|
* @returns the attachment handle (read `captured()` after the child settles).
|
|
897
909
|
*/
|
|
898
910
|
function attachStructuredRuntime(childCtx, schema, canComplete) {
|
|
@@ -934,7 +946,7 @@ function attachStructuredRuntime(childCtx, schema, canComplete) {
|
|
|
934
946
|
execute(args, exec) {
|
|
935
947
|
const violations = validateJsonSchemaValue(schema, args);
|
|
936
948
|
if (violations.length > 0) throw new ToolArgsError(violations);
|
|
937
|
-
if (!canComplete()) throw new Error("
|
|
949
|
+
if (!canComplete()) throw new Error("Process pending messages before submitting structured output.");
|
|
938
950
|
staged.set(exec, { value: args });
|
|
939
951
|
exec.concludeTurn();
|
|
940
952
|
return Promise.resolve({ recorded: true });
|
|
@@ -1044,7 +1056,7 @@ function finalAssistantOutput(events) {
|
|
|
1044
1056
|
/** Execution-period records, capacity slots, child serialization, and local output capture.
|
|
1045
1057
|
* @module @deepseek-ai/dsh-subagent/activation
|
|
1046
1058
|
*/
|
|
1047
|
-
/** Process-local
|
|
1059
|
+
/** Process-local capacity shared by every member of a subagent tree. */
|
|
1048
1060
|
var ActivationPool = class {
|
|
1049
1061
|
slots = /* @__PURE__ */ new Set();
|
|
1050
1062
|
/**
|
|
@@ -1150,11 +1162,11 @@ var ChildLock = class {
|
|
|
1150
1162
|
/**
|
|
1151
1163
|
* Owns subagent startup, message admission, cold resume, and execution lifetimes.
|
|
1152
1164
|
* One child lock orders input acceptance and closure; one activation map owns
|
|
1153
|
-
* capacity,
|
|
1165
|
+
* capacity, runtime ownership, and resource release across all providers.
|
|
1154
1166
|
*
|
|
1155
1167
|
* @module @deepseek-ai/dsh-subagent/manager
|
|
1156
1168
|
*/
|
|
1157
|
-
var __addDisposableResource$
|
|
1169
|
+
var __addDisposableResource$1 = function(env, value, async) {
|
|
1158
1170
|
if (value !== null && value !== void 0) {
|
|
1159
1171
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1160
1172
|
var dispose, inner;
|
|
@@ -1183,7 +1195,7 @@ var __addDisposableResource$2 = function(env, value, async) {
|
|
|
1183
1195
|
} else if (async) env.stack.push({ async: true });
|
|
1184
1196
|
return value;
|
|
1185
1197
|
};
|
|
1186
|
-
var __disposeResources$
|
|
1198
|
+
var __disposeResources$1 = (function(SuppressedError) {
|
|
1187
1199
|
return function(env) {
|
|
1188
1200
|
function fail(e) {
|
|
1189
1201
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
@@ -1231,18 +1243,13 @@ var SubagentManager = class {
|
|
|
1231
1243
|
locks = new ChildLock();
|
|
1232
1244
|
/** Structural Cordis owner of every Activation handle. */
|
|
1233
1245
|
ownerCtx;
|
|
1234
|
-
/**
|
|
1235
|
-
|
|
1236
|
-
* observed under each root. Entries remain until that exact root leaves the
|
|
1237
|
-
* Agent registry, closing admission throughout its host's teardown without
|
|
1238
|
-
* poisoning a later same-id replacement.
|
|
1239
|
-
*/
|
|
1240
|
-
closingScopes = /* @__PURE__ */ new Map();
|
|
1246
|
+
/** Exact subagent tree roots whose host teardown has closed admission. */
|
|
1247
|
+
closingRoots = /* @__PURE__ */ new Set();
|
|
1241
1248
|
draining = false;
|
|
1242
1249
|
/**
|
|
1243
1250
|
* Build one manager inside the service's Agent-injected context.
|
|
1244
1251
|
* @param ctx - context providing Agents, Sessions, and teardown ownership.
|
|
1245
|
-
* @param host -
|
|
1252
|
+
* @param host - descriptor reads and lifecycle publication owned by the service.
|
|
1246
1253
|
* @param maxActiveSubagents - the current configured child capacity.
|
|
1247
1254
|
*/
|
|
1248
1255
|
constructor(ctx, host, maxActiveSubagents) {
|
|
@@ -1251,8 +1258,12 @@ var SubagentManager = class {
|
|
|
1251
1258
|
this.maxActiveSubagents = maxActiveSubagents;
|
|
1252
1259
|
const scope = ctx.plugin(function activationOwner() {});
|
|
1253
1260
|
this.ownerCtx = scope.ctx;
|
|
1261
|
+
installSubagentArchiveAdmission(ctx, (agent) => {
|
|
1262
|
+
const activation = this.resident.get(agent.id);
|
|
1263
|
+
return activation !== void 0 && activationAgent(activation) === agent ? activation.ancestors : void 0;
|
|
1264
|
+
}, (session) => host.identityOf(session));
|
|
1254
1265
|
ctx.on("agent/disposed", ({ agent }) => {
|
|
1255
|
-
this.
|
|
1266
|
+
this.closingRoots.delete(agent);
|
|
1256
1267
|
});
|
|
1257
1268
|
ctx.effect(function* () {
|
|
1258
1269
|
yield scope.dispose;
|
|
@@ -1262,7 +1273,7 @@ var SubagentManager = class {
|
|
|
1262
1273
|
/**
|
|
1263
1274
|
* Interrupt one live continuable child's current turn under the supplied authority.
|
|
1264
1275
|
* @param targetSessionId - the durable child session id to interrupt.
|
|
1265
|
-
* @param authority -
|
|
1276
|
+
* @param authority - a trusted user operation or exact live ancestor Agent.
|
|
1266
1277
|
*/
|
|
1267
1278
|
interrupt(targetSessionId, authority) {
|
|
1268
1279
|
if (authority.kind === "ancestor") {
|
|
@@ -1272,9 +1283,7 @@ var SubagentManager = class {
|
|
|
1272
1283
|
}
|
|
1273
1284
|
const activation = this.resident.get(targetSessionId);
|
|
1274
1285
|
if (activation === void 0) return;
|
|
1275
|
-
if (authority.kind === "
|
|
1276
|
-
if (activation.parent.id !== authority.parentSessionId) throw new SubagentError(`subagent "${targetSessionId}" belongs to another parent session`, "UNAUTHORIZED");
|
|
1277
|
-
} else if (!activation.ancestry.has(authority.agent)) throw new SubagentError(`subagent "${targetSessionId}" is not a live descendant of agent "${authority.agent.id}"`, "UNAUTHORIZED");
|
|
1286
|
+
if (authority.kind === "ancestor" && (this.rootOf(authority.agent) !== activation.root || !activation.ancestors.includes(authority.agent.id))) throw new SubagentError(`subagent "${targetSessionId}" is not a live descendant of agent "${authority.agent.id}"`, "UNAUTHORIZED");
|
|
1278
1287
|
if (activation.closing !== void 0) return;
|
|
1279
1288
|
const kind = authority.kind === "user" ? "user" : "parent";
|
|
1280
1289
|
if (activation.kind === "local") activation.handle.agent.cancel({ kind }, { keepInbox: true });
|
|
@@ -1285,28 +1294,25 @@ var SubagentManager = class {
|
|
|
1285
1294
|
}
|
|
1286
1295
|
/**
|
|
1287
1296
|
* Close admission, await every already-admitted materialization through
|
|
1288
|
-
* publication or rollback, then dispose
|
|
1289
|
-
* child-first.
|
|
1297
|
+
* publication or rollback, then dispose every agent in the subagent tree.
|
|
1290
1298
|
*/
|
|
1291
1299
|
async drain() {
|
|
1292
1300
|
this.draining = true;
|
|
1293
1301
|
for (const pending of this.materializations) pending.controller.abort();
|
|
1294
1302
|
await Promise.all([...this.materializations].map((materialization) => materialization.settled));
|
|
1295
|
-
|
|
1296
|
-
for (const activation of this.resident.values()) for (const child of activation.ownedChildren) owned.add(child);
|
|
1297
|
-
const roots = [...this.resident.values()].filter((activation) => !owned.has(activation.childId));
|
|
1298
|
-
await this.disposeRoots(roots, "activation(s)");
|
|
1303
|
+
await this.disposeRoots([...this.resident.values()], "activation(s)");
|
|
1299
1304
|
}
|
|
1300
1305
|
/**
|
|
1301
|
-
* Join progressing
|
|
1302
|
-
* @param
|
|
1303
|
-
* @returns whether work was joined and the host must recheck
|
|
1306
|
+
* Join progressing subagent tree work for its root, leaving idle parked inboxes resident.
|
|
1307
|
+
* @param root - exact live subagent tree root; ordinary members return false.
|
|
1308
|
+
* @returns whether work was joined and the host must recheck root completion.
|
|
1304
1309
|
*/
|
|
1305
|
-
async
|
|
1310
|
+
async waitForTreeWork(root) {
|
|
1311
|
+
if (this.rootOf(root) !== root) return false;
|
|
1306
1312
|
let observed = false;
|
|
1307
1313
|
while (true) {
|
|
1308
|
-
const pending = [...this.materializations].filter((item) => item.
|
|
1309
|
-
const children = [...this.resident.values()].filter((item) =>
|
|
1314
|
+
const pending = [...this.materializations].filter((item) => item.root === root);
|
|
1315
|
+
const children = [...this.resident.values()].filter((item) => item.root === root);
|
|
1310
1316
|
observed ||= children.some((item) => item.kind === "local" && item.handle.agent.status !== "idle");
|
|
1311
1317
|
await Promise.all(children.flatMap((item) => item.kind === "local" ? [item.handle.agent.whenIdle()] : []));
|
|
1312
1318
|
const waits = pending.map((item) => item.settled);
|
|
@@ -1319,10 +1325,6 @@ var SubagentManager = class {
|
|
|
1319
1325
|
waits.push(item.handle.agent.whenIdle());
|
|
1320
1326
|
continue;
|
|
1321
1327
|
}
|
|
1322
|
-
if (item.ownedChildren.size > 0) {
|
|
1323
|
-
if ([...item.ownedChildren].some((id) => !this.resident.has(id))) waits.push(item.poke.promise);
|
|
1324
|
-
continue;
|
|
1325
|
-
}
|
|
1326
1328
|
const inbox = item.handle.agent.inbox;
|
|
1327
1329
|
if (item.failureAt === void 0 && (inbox.nextTurn.length > 0 || inbox.nextStep.length > 0)) continue;
|
|
1328
1330
|
waits.push(Promise.race([item.result.promise.catch(() => void 0), item.poke.promise]));
|
|
@@ -1332,114 +1334,73 @@ var SubagentManager = class {
|
|
|
1332
1334
|
await Promise.all(waits);
|
|
1333
1335
|
continue;
|
|
1334
1336
|
}
|
|
1335
|
-
if ([...this.materializations].some((item) => item.
|
|
1337
|
+
if ([...this.materializations].some((item) => item.root === root && !pending.includes(item)) || [...this.resident.values()].some((item) => item.root === root && !children.includes(item))) continue;
|
|
1336
1338
|
return observed;
|
|
1337
1339
|
}
|
|
1338
1340
|
}
|
|
1339
1341
|
/**
|
|
1340
|
-
* Stop the
|
|
1341
|
-
* @param parents - exact live roots whose
|
|
1342
|
+
* Stop every member of the selected subagent trees; ordinary members do not close a subagent tree.
|
|
1343
|
+
* @param parents - exact live subagent tree roots whose instances must stop.
|
|
1342
1344
|
*/
|
|
1343
1345
|
async drainDescendants(parents) {
|
|
1344
|
-
const roots = new Set(parents.filter((
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
if (owners.length === 0) continue;
|
|
1353
|
-
targets.push(activation);
|
|
1354
|
-
for (const owner of owners) {
|
|
1355
|
-
const members = this.closingMembers(owner);
|
|
1356
|
-
if (child !== void 0) members.add(child);
|
|
1357
|
-
for (const agent of lineage) members.add(agent);
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
const materializations = [...this.materializations].filter((materialization) => {
|
|
1361
|
-
const owners = [...roots].filter((root) => materialization.lineage.includes(root));
|
|
1362
|
-
for (const owner of owners) {
|
|
1363
|
-
const members = this.closingMembers(owner);
|
|
1364
|
-
for (const agent of materialization.lineage) members.add(agent);
|
|
1365
|
-
}
|
|
1366
|
-
if (owners.length > 0) materialization.controller.abort();
|
|
1367
|
-
return owners.length > 0;
|
|
1368
|
-
});
|
|
1369
|
-
const ownedTargets = /* @__PURE__ */ new Set();
|
|
1370
|
-
for (const activation of targets) for (const child of activation.ownedChildren) ownedTargets.add(child);
|
|
1371
|
-
const targetRoots = targets.filter((activation) => !ownedTargets.has(activation.childId));
|
|
1372
|
-
for (const activation of targets) this.dispose(activation).catch(() => void 0);
|
|
1373
|
-
await Promise.all(materializations.map((materialization) => materialization.settled));
|
|
1374
|
-
await this.disposeRoots(targetRoots, "scoped activation(s)");
|
|
1375
|
-
}
|
|
1376
|
-
/**
|
|
1377
|
-
* Release selected resident direct children of one exact live parent.
|
|
1378
|
-
* @param parent - exact live direct parent authorizing the selected release.
|
|
1379
|
-
* @param childIds - durable direct-child ids to release when resident.
|
|
1380
|
-
*/
|
|
1381
|
-
async drainChildren(parent, childIds) {
|
|
1382
|
-
if (this.ctx.agents.get(parent.id) !== parent) throw new SubagentError("selected child teardown requires the exact live parent agent", "UNAUTHORIZED");
|
|
1383
|
-
const targets = [];
|
|
1384
|
-
for (const childId of new Set(childIds)) {
|
|
1385
|
-
const activation = this.resident.get(childId);
|
|
1386
|
-
if (activation === void 0) continue;
|
|
1387
|
-
if (activation.parent.id !== parent.id || !activation.ancestry.has(parent)) throw new SubagentError(`subagent "${childId}" is not a direct child of agent "${parent.id}"`, "UNAUTHORIZED");
|
|
1388
|
-
targets.push(activation);
|
|
1389
|
-
}
|
|
1390
|
-
for (const activation of targets) this.dispose(activation).catch(() => void 0);
|
|
1391
|
-
await this.disposeRoots(targets, "selected activation(s)");
|
|
1346
|
+
const roots = new Set(parents.filter((root) => this.ctx.agents.get(root.id) === root && this.rootOf(root) === root));
|
|
1347
|
+
for (const root of roots) this.closingRoots.add(root);
|
|
1348
|
+
const pending = [...this.materializations].filter((item) => roots.has(item.root));
|
|
1349
|
+
for (const item of pending) item.controller.abort();
|
|
1350
|
+
const targets = [...this.resident.values()].filter((item) => roots.has(item.root));
|
|
1351
|
+
const disposal = this.disposeRoots(targets, "scoped activation(s)");
|
|
1352
|
+
const [disposed] = await Promise.allSettled([disposal, ...pending.map((item) => item.settled)]);
|
|
1353
|
+
if (disposed.status === "rejected") throw disposed.reason;
|
|
1392
1354
|
}
|
|
1393
1355
|
/**
|
|
1394
1356
|
* Start one continuable background child and resolve at initial inbox acceptance.
|
|
1395
1357
|
* Every earlier failure disposes any created handle and rolls back Activation
|
|
1396
|
-
* and
|
|
1358
|
+
* and its capacity slot without returning either id.
|
|
1397
1359
|
* @param spec - provider, delegation request, and caller cancellation.
|
|
1360
|
+
* @param prepare - creation contribution bound to the checked provider.
|
|
1398
1361
|
* @returns the durable child id and accepted initial prompt message id.
|
|
1399
1362
|
*/
|
|
1400
|
-
async startLocal(spec) {
|
|
1401
|
-
const
|
|
1402
|
-
const parent = request.parent;
|
|
1363
|
+
async startLocal(spec, prepare) {
|
|
1364
|
+
const parent = spec.parent;
|
|
1403
1365
|
this.assertAdmitting(parent);
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1425
|
-
const prepared = await this.host.prepareContinuable(spec.provider, {
|
|
1366
|
+
const ancestry = this.ancestryForChild(parent);
|
|
1367
|
+
return this.trackStartup(ancestry.root, spec.signal, async (signal) => {
|
|
1368
|
+
const persistence = spec.delivery === "caller" ? this.ctx.get("sessionPersistence") : this.requirePersistence();
|
|
1369
|
+
const childId = spec.childId ?? brandString(randomUUID());
|
|
1370
|
+
this.assertChildIdAvailable(childId);
|
|
1371
|
+
const childDepth = resolveChildDepth(parent, spec.maxDepth);
|
|
1372
|
+
const agentOptions = resolveChildAgentOptions(parent, spec.agentOptions, childDepth);
|
|
1373
|
+
const agentProvider = agentOptions.provider;
|
|
1374
|
+
const agentModel = agentOptions.model;
|
|
1375
|
+
const agentReasoningEffort = agentOptions.reasoningEffort;
|
|
1376
|
+
const descriptor = snapshotSubagentDescriptor({
|
|
1377
|
+
mode: "continuable",
|
|
1378
|
+
provider: spec.provider,
|
|
1379
|
+
label: spec.label,
|
|
1380
|
+
...agentProvider !== void 0 ? { agentProvider } : {},
|
|
1381
|
+
...agentModel !== void 0 ? { agentModel } : {},
|
|
1382
|
+
...agentReasoningEffort !== void 0 ? { agentReasoningEffort } : {}
|
|
1383
|
+
});
|
|
1384
|
+
const delegatedPolicies = captureDelegatedPolicyOverrides(parent);
|
|
1385
|
+
const cwd = await this.resolveDirectory(spec, signal);
|
|
1386
|
+
const prepared = await prepare({
|
|
1426
1387
|
sessionId: childId,
|
|
1427
1388
|
cwd,
|
|
1428
1389
|
parent,
|
|
1429
|
-
signal
|
|
1390
|
+
signal
|
|
1430
1391
|
});
|
|
1431
|
-
|
|
1392
|
+
signal.throwIfAborted();
|
|
1432
1393
|
this.assertAdmitting(parent);
|
|
1433
1394
|
const inheritedEventCount = SessionLogOffset(prepared.seed?.length ?? 0);
|
|
1434
1395
|
const seed = prepared.seed;
|
|
1435
1396
|
let established;
|
|
1436
1397
|
const messageId = await this.locks.run(childId, async () => {
|
|
1437
|
-
|
|
1398
|
+
signal.throwIfAborted();
|
|
1438
1399
|
this.assertAdmitting(parent);
|
|
1439
1400
|
this.assertChildIdAvailable(childId);
|
|
1440
1401
|
if (spec.childId !== void 0) {
|
|
1441
|
-
const persisted = await persistence?.stat(childId, { signal
|
|
1442
|
-
|
|
1402
|
+
const persisted = await persistence?.stat(childId, { signal });
|
|
1403
|
+
signal.throwIfAborted();
|
|
1443
1404
|
this.assertAdmitting(parent);
|
|
1444
1405
|
this.assertChildIdAvailable(childId);
|
|
1445
1406
|
if (persisted !== void 0) throw new SubagentError(`subagent "${childId}" already exists`, "DUPLICATE_CHILD");
|
|
@@ -1448,29 +1409,33 @@ var SubagentManager = class {
|
|
|
1448
1409
|
kind: "local",
|
|
1449
1410
|
childId,
|
|
1450
1411
|
provider: spec.provider,
|
|
1451
|
-
|
|
1412
|
+
...ancestry,
|
|
1452
1413
|
create: {
|
|
1414
|
+
parent,
|
|
1453
1415
|
cwd,
|
|
1454
1416
|
seed,
|
|
1455
|
-
meta: childSessionMeta(parent, childDepth, prepared.seed !== void 0,
|
|
1417
|
+
meta: childSessionMeta(parent, childDepth, prepared.seed !== void 0, spec.agentPreset),
|
|
1456
1418
|
inheritedEventCount,
|
|
1457
1419
|
delegatedPolicies,
|
|
1458
1420
|
descriptor
|
|
1459
1421
|
},
|
|
1460
1422
|
agentOptions,
|
|
1461
|
-
composition: { agentPreset:
|
|
1462
|
-
signal
|
|
1423
|
+
composition: { agentPreset: spec.agentPreset },
|
|
1424
|
+
signal,
|
|
1463
1425
|
delivery: spec.delivery,
|
|
1464
|
-
outputSchema: spec.
|
|
1426
|
+
outputSchema: spec.outputSchema
|
|
1465
1427
|
});
|
|
1466
1428
|
established = activation;
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1469
|
-
return await this.submitMaterialized(activation, spec.delivery !== "caller" && isAdjacentAgentSendMessageTool(this.ctx.get("tools")?.get("send_message", child)) ? withContinuableReturnGuidance(parent.id, request.prompt) : request.prompt, {
|
|
1429
|
+
const childHeader = requireLocalActivation(activation).handle.agent.session.header;
|
|
1430
|
+
return await this.submitMaterialized(activation, spec.delivery !== "caller" ? withResultDeliveryGuidance(spec.prompt) : spec.prompt, {
|
|
1470
1431
|
source: { kind: "user" },
|
|
1471
|
-
signal
|
|
1472
|
-
delivery: "queue"
|
|
1473
|
-
|
|
1432
|
+
signal,
|
|
1433
|
+
delivery: "queue",
|
|
1434
|
+
authorize: () => {
|
|
1435
|
+
this.assertAdmitting(parent);
|
|
1436
|
+
}
|
|
1437
|
+
}, ancestry.root, () => {
|
|
1438
|
+
this.assertAdmitting(parent);
|
|
1474
1439
|
establishCatalogChild(parent.session, childHeader, descriptor);
|
|
1475
1440
|
});
|
|
1476
1441
|
});
|
|
@@ -1479,54 +1444,49 @@ var SubagentManager = class {
|
|
|
1479
1444
|
childId,
|
|
1480
1445
|
messageId
|
|
1481
1446
|
};
|
|
1482
|
-
}
|
|
1483
|
-
releaseHold();
|
|
1484
|
-
throw error;
|
|
1485
|
-
}
|
|
1447
|
+
});
|
|
1486
1448
|
}
|
|
1487
1449
|
/**
|
|
1488
1450
|
* Start an external backend under activation ownership.
|
|
1489
1451
|
* @param spec - task, provider, cancellation, and delivery policy.
|
|
1452
|
+
* @param start - execution bound to the checked provider.
|
|
1490
1453
|
* @returns the accepted activation and its result/disposal capabilities.
|
|
1491
1454
|
*/
|
|
1492
|
-
async startExternal(spec) {
|
|
1493
|
-
const
|
|
1455
|
+
async startExternal(spec, start) {
|
|
1456
|
+
const { provider, delivery, childId: _childId, ...request } = spec;
|
|
1457
|
+
const parent = request.parent;
|
|
1494
1458
|
this.assertAdmitting(parent);
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
this.ctx.logger.warn(`subagent "${activation.childId}" admission rollback failed: ${failureMessage(cleanupError)}`);
|
|
1459
|
+
const ancestry = this.ancestryForChild(parent);
|
|
1460
|
+
return this.trackStartup(ancestry.root, spec.signal, async (signal) => {
|
|
1461
|
+
let activation;
|
|
1462
|
+
try {
|
|
1463
|
+
const cwd = await this.resolveDirectory(spec, signal);
|
|
1464
|
+
activation = await this.materialize({
|
|
1465
|
+
kind: "external",
|
|
1466
|
+
provider,
|
|
1467
|
+
...ancestry,
|
|
1468
|
+
signal,
|
|
1469
|
+
delivery,
|
|
1470
|
+
start: (signal) => start({
|
|
1471
|
+
...request,
|
|
1472
|
+
cwd,
|
|
1473
|
+
signal
|
|
1474
|
+
})
|
|
1475
|
+
});
|
|
1476
|
+
this.assertAdmitting(parent);
|
|
1477
|
+
signal.throwIfAborted();
|
|
1478
|
+
if (delivery === "parent") establishExternalCatalogChild(parent.session, activation.childId, spec.label);
|
|
1479
|
+
this.accept(activation);
|
|
1480
|
+
return this.receipt(activation);
|
|
1481
|
+
} catch (error) {
|
|
1482
|
+
if (activation !== void 0) try {
|
|
1483
|
+
await this.dispose(activation);
|
|
1484
|
+
} catch (cleanupError) {
|
|
1485
|
+
this.ctx.logger.warn(`subagent "${activation.childId}" admission rollback failed: ${failureMessage(cleanupError)}`);
|
|
1486
|
+
}
|
|
1487
|
+
throw error;
|
|
1525
1488
|
}
|
|
1526
|
-
|
|
1527
|
-
} finally {
|
|
1528
|
-
releaseHold();
|
|
1529
|
-
}
|
|
1489
|
+
});
|
|
1530
1490
|
}
|
|
1531
1491
|
/** Capture the explicit or inherited directory while the parent still owns startup. */
|
|
1532
1492
|
async resolveDirectory(request, signal) {
|
|
@@ -1535,60 +1495,125 @@ var SubagentManager = class {
|
|
|
1535
1495
|
return cwd;
|
|
1536
1496
|
}
|
|
1537
1497
|
/**
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
*
|
|
1541
|
-
* @
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1498
|
+
* Resolve the live subagent tree root from runtime ownership, independent of creator residency.
|
|
1499
|
+
* @param caller - exact live Agent selecting the subagent tree.
|
|
1500
|
+
* @returns the live subagent tree root.
|
|
1501
|
+
* @throws when the caller has no active runtime owner.
|
|
1502
|
+
*/
|
|
1503
|
+
rootOf(caller) {
|
|
1504
|
+
if (this.ctx.agents.get(caller.id) !== caller) throw new SubagentError("subagent tree access requires the exact live caller", "UNAUTHORIZED");
|
|
1505
|
+
const identity = this.host.identityOf(caller.session);
|
|
1506
|
+
const delegated = caller.session.header.origin === "subagent" || identity != null && caller.session.isOwnSeq(identity.seq);
|
|
1507
|
+
const activation = this.resident.get(caller.id);
|
|
1508
|
+
if (activation !== void 0 && activationAgent(activation) === caller && this.ctx.agents.get(activation.root.id) === activation.root) return activation.root;
|
|
1509
|
+
if (delegated || activation !== void 0) throw new SubagentError("agent has no active runtime owner", "UNAUTHORIZED");
|
|
1510
|
+
return caller;
|
|
1511
|
+
}
|
|
1512
|
+
/** Capture creation ancestry separately from the root that owns the new instance. */
|
|
1513
|
+
ancestryForChild(creator) {
|
|
1514
|
+
return {
|
|
1515
|
+
root: this.rootOf(creator),
|
|
1516
|
+
ancestors: [...this.resident.get(creator.id)?.ancestors ?? [], creator.id]
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Deliver to another agent in the subagent tree, restoring only the target when absent.
|
|
1521
|
+
* @param sender - exact live root or resident continuable Agent.
|
|
1522
|
+
* @param targetId - another member's durable Session id.
|
|
1523
|
+
* @param content - model-authored message blocks.
|
|
1524
|
+
* @param options - cancellation before inbox acceptance.
|
|
1525
|
+
* @returns the accepted inbox message id.
|
|
1546
1526
|
*/
|
|
1547
1527
|
async sendMessage(sender, targetId, content, options) {
|
|
1548
|
-
|
|
1528
|
+
options.signal.throwIfAborted();
|
|
1529
|
+
const root = this.rootOf(sender);
|
|
1530
|
+
if (sender.id === targetId) throw new SubagentError("send_message requires another agent in the subagent tree", "UNAUTHORIZED");
|
|
1549
1531
|
this.assertAdmitting(sender);
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
return this.sendToParent(senderActivation, sender, content);
|
|
1554
|
-
}
|
|
1555
|
-
if (sender.session.header.parentSession === targetId) throw new SubagentError(`agent "${sender.id}" is not a resident continuable child and cannot send to parent "${targetId}"`, "UNAUTHORIZED");
|
|
1556
|
-
return this.deliverToChild(sender, targetId, content, {
|
|
1532
|
+
const message = createAgentMessage(sender, content);
|
|
1533
|
+
const activation = this.resident.get(sender.id);
|
|
1534
|
+
return this.deliverToMember(root, targetId, [...message.content], {
|
|
1557
1535
|
signal: options.signal,
|
|
1558
|
-
delivery: "steer"
|
|
1536
|
+
delivery: "steer",
|
|
1537
|
+
source: message.source,
|
|
1538
|
+
authorize: () => {
|
|
1539
|
+
this.assertAdmitting(sender);
|
|
1540
|
+
},
|
|
1541
|
+
onAccepted: () => {
|
|
1542
|
+
if (activation?.kind === "local" && activation.ancestors.at(-1) === targetId) activation.omitClosingText = true;
|
|
1543
|
+
}
|
|
1559
1544
|
});
|
|
1560
1545
|
}
|
|
1561
|
-
/**
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1546
|
+
/** Resolve the live owner through verified creation edges without activating ancestors. */
|
|
1547
|
+
async resolveCreationAncestry(source, signal, root) {
|
|
1548
|
+
const ancestors = [];
|
|
1549
|
+
const seen = new Set([source.header.id]);
|
|
1550
|
+
let { header, projections, inheritedEventCount } = source;
|
|
1551
|
+
while (true) {
|
|
1552
|
+
const env_1 = {
|
|
1553
|
+
stack: [],
|
|
1554
|
+
error: void 0,
|
|
1555
|
+
hasError: false
|
|
1556
|
+
};
|
|
1557
|
+
try {
|
|
1558
|
+
signal.throwIfAborted();
|
|
1559
|
+
const parentId = header.parentSession;
|
|
1560
|
+
const identity = projections?.values.subagent;
|
|
1561
|
+
if (parentId === void 0 || identity == null || identity.seq < inheritedEventCount) break;
|
|
1562
|
+
if (seen.has(parentId)) throw new SubagentError("cyclic subagent creation ancestry", "UNAUTHORIZED");
|
|
1563
|
+
seen.add(parentId);
|
|
1564
|
+
const parent = __addDisposableResource$1(env_1, await this.observeContinuation(parentId, signal), false);
|
|
1565
|
+
if (!parent.projections?.values.subagentCatalog?.some((entry) => entry.id === header.id)) throw new SubagentError("subagent is absent from its creator catalog", "UNAUTHORIZED");
|
|
1566
|
+
ancestors.unshift(parentId);
|
|
1567
|
+
if (parentId === root?.id) return {
|
|
1568
|
+
root,
|
|
1569
|
+
ancestors
|
|
1570
|
+
};
|
|
1571
|
+
({header, projections, inheritedEventCount} = parent);
|
|
1572
|
+
} catch (e_1) {
|
|
1573
|
+
env_1.error = e_1;
|
|
1574
|
+
env_1.hasError = true;
|
|
1575
|
+
} finally {
|
|
1576
|
+
__disposeResources$1(env_1);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
if (root === void 0 && ancestors.length > 0 && header.origin !== "subagent") {
|
|
1580
|
+
const owner = this.ctx.agents.get(header.id);
|
|
1581
|
+
if (owner === void 0 || this.rootOf(owner) !== owner) throw new SubagentError("subagent tree root is not live", "CONTINUATION_UNAVAILABLE");
|
|
1582
|
+
return {
|
|
1583
|
+
root: owner,
|
|
1584
|
+
ancestors
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
throw new SubagentError(`agent "${source.header.id}" is not a member of this subagent tree`, "UNAUTHORIZED");
|
|
1576
1588
|
}
|
|
1577
1589
|
/**
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
* @param childId - durable
|
|
1590
|
+
* Deliver one host-authored prompt through the target's live subagent tree root.
|
|
1591
|
+
* Remote callers must be authorized for the target Session before invoking this operation.
|
|
1592
|
+
* @param childId - durable continuable subagent session id.
|
|
1581
1593
|
* @param content - model-visible prompt blocks.
|
|
1582
|
-
* @param
|
|
1583
|
-
* @param signal - caller cancellation before inbox acceptance.
|
|
1594
|
+
* @param options - inbox destination, durable attribution, and cancellation before acceptance.
|
|
1584
1595
|
* @returns the accepted durable message id.
|
|
1585
1596
|
*/
|
|
1586
|
-
async
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1597
|
+
async deliverPrompt(childId, content, options) {
|
|
1598
|
+
options.signal.throwIfAborted();
|
|
1599
|
+
let root = this.resident.get(childId)?.root;
|
|
1600
|
+
if (root === void 0) {
|
|
1601
|
+
const env_2 = {
|
|
1602
|
+
stack: [],
|
|
1603
|
+
error: void 0,
|
|
1604
|
+
hasError: false
|
|
1605
|
+
};
|
|
1606
|
+
try {
|
|
1607
|
+
const source = __addDisposableResource$1(env_2, await this.observeContinuation(childId, options.signal), false);
|
|
1608
|
+
({root} = await this.resolveCreationAncestry(source, options.signal));
|
|
1609
|
+
} catch (e_2) {
|
|
1610
|
+
env_2.error = e_2;
|
|
1611
|
+
env_2.hasError = true;
|
|
1612
|
+
} finally {
|
|
1613
|
+
__disposeResources$1(env_2);
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
return this.deliverToMember(root, childId, content, options);
|
|
1592
1617
|
}
|
|
1593
1618
|
/** Admit local input synchronously before any teardown can begin. */
|
|
1594
1619
|
deliver(activation, message, delivery) {
|
|
@@ -1606,32 +1631,6 @@ var SubagentManager = class {
|
|
|
1606
1631
|
if (this.resident.has(childId) || this.ctx.agents.get(childId) !== void 0 || this.ctx.get("sessions")?.get(childId) !== void 0) throw new SubagentError(`subagent "${childId}" already exists`, "DUPLICATE_CHILD");
|
|
1607
1632
|
}
|
|
1608
1633
|
/**
|
|
1609
|
-
* Pre-register `childId` in a continuation-managed parent's owned set so the
|
|
1610
|
-
* parent cannot settle while a caller is still establishing or resuming that
|
|
1611
|
-
* child. Returns a releaser for the failure path; it removes only a hold
|
|
1612
|
-
* this call added, and leaves ownership in place once a live Activation for
|
|
1613
|
-
* the child exists.
|
|
1614
|
-
* @param parent - the live direct parent the operation is admitted under.
|
|
1615
|
-
* @param childId - the durable child the operation addresses.
|
|
1616
|
-
* @returns the failure-path releaser; a no-op when nothing was added.
|
|
1617
|
-
*/
|
|
1618
|
-
holdOwnership(parent, childId) {
|
|
1619
|
-
const parentActivation = this.resident.get(parent.id);
|
|
1620
|
-
if (parentActivation === void 0 || activationAgent(parentActivation) !== parent) return () => {};
|
|
1621
|
-
if (parentActivation.closing !== void 0) throw new SubagentError(`subagent parent "${parent.id}" is being disposed; the child was not established`, "ACTIVATION_CLOSING");
|
|
1622
|
-
if (parentActivation.ownedChildren.has(childId)) return () => {};
|
|
1623
|
-
parentActivation.ownedChildren.add(childId);
|
|
1624
|
-
return () => {
|
|
1625
|
-
const live = this.resident.get(childId);
|
|
1626
|
-
/* v8 ignore next 4 -- reaching this arm needs another delivery to establish the child
|
|
1627
|
-
* between this operation's failure and its releaser running, which no test can schedule
|
|
1628
|
-
* deterministically: the ownership edge then belongs to that live Activation, so the
|
|
1629
|
-
* conservative keep leaves it for finishDisposal's releaseOwnership. */
|
|
1630
|
-
if (live !== void 0 && live.closing === void 0) return;
|
|
1631
|
-
if (parentActivation.ownedChildren.delete(childId)) this.wake(parentActivation);
|
|
1632
|
-
};
|
|
1633
|
-
}
|
|
1634
|
-
/**
|
|
1635
1634
|
* Apply activation admission to a resident parent before delivering input.
|
|
1636
1635
|
* @param parent - exact live Agent receiving the message.
|
|
1637
1636
|
* @param message - durable user message to deliver.
|
|
@@ -1651,27 +1650,16 @@ var SubagentManager = class {
|
|
|
1651
1650
|
else parent.followup(message);
|
|
1652
1651
|
}
|
|
1653
1652
|
/**
|
|
1654
|
-
* Reject new
|
|
1655
|
-
* @param agent - exact live
|
|
1653
|
+
* Reject new work from closing members or subagent trees.
|
|
1654
|
+
* @param agent - exact live caller whose instance and subagent tree must admit work.
|
|
1656
1655
|
*/
|
|
1657
1656
|
assertAdmitting(agent) {
|
|
1658
1657
|
const closing = this.closingTeardownFor(agent);
|
|
1659
|
-
if (closing === void 0)
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
* @param parent - exact live Agent claiming direct-parent authority.
|
|
1665
|
-
* @param childId - durable child session id addressed by the operation.
|
|
1666
|
-
* @param parentSession - durable direct-parent id recorded by the child.
|
|
1667
|
-
*/
|
|
1668
|
-
authorizeLineage(parent, childId, parentSession) {
|
|
1669
|
-
this.assertLiveParent(parent, childId);
|
|
1670
|
-
if (parentSession !== parent.id) throw new SubagentError(`subagent "${childId}" belongs to another parent session`, "UNAUTHORIZED");
|
|
1671
|
-
}
|
|
1672
|
-
/** Reject parent authority after the live registry entry changes. */
|
|
1673
|
-
assertLiveParent(parent, childId) {
|
|
1674
|
-
if (this.ctx.agents.get(parent.id) !== parent) throw new SubagentError(`subagent "${childId}" delivery requires the exact live parent agent`, "UNAUTHORIZED");
|
|
1658
|
+
if (closing === void 0) {
|
|
1659
|
+
if (this.resident.get(agent.id)?.closing !== void 0) throw new SubagentError(`subagent "${agent.id}" is closing`, "ACTIVATION_CLOSING");
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
throw new SubagentError(closing === "manager" ? "subagents are draining; the operation was not admitted" : `subagent tree "${closing.id}" is draining; the operation was not admitted`, "DRAINING");
|
|
1675
1663
|
}
|
|
1676
1664
|
/**
|
|
1677
1665
|
* Create or resume one child Agent and publish its Activation.
|
|
@@ -1679,25 +1667,28 @@ var SubagentManager = class {
|
|
|
1679
1667
|
* @returns the published process-local Activation.
|
|
1680
1668
|
*/
|
|
1681
1669
|
materialize(inputs) {
|
|
1682
|
-
this.assertAdmitting(inputs.
|
|
1670
|
+
this.assertAdmitting(inputs.root);
|
|
1683
1671
|
inputs.signal.throwIfAborted();
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
|
|
1672
|
+
const releaseSlot = this.rootPool(inputs.root).reserve(this.maxActiveSubagents());
|
|
1673
|
+
return this.materializeTracked(inputs, releaseSlot).catch((error) => {
|
|
1674
|
+
releaseSlot();
|
|
1675
|
+
throw error;
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
/** Keep subagent tree shutdown and host waits joined to preparation, publication, and rollback. */
|
|
1679
|
+
trackStartup(root, signal, start) {
|
|
1680
|
+
this.assertAdmitting(root);
|
|
1681
|
+
signal.throwIfAborted();
|
|
1687
1682
|
const settled = Promise.withResolvers();
|
|
1688
1683
|
const controller = new AbortController();
|
|
1689
1684
|
const materialization = {
|
|
1690
|
-
|
|
1685
|
+
root,
|
|
1691
1686
|
settled: settled.promise,
|
|
1692
1687
|
controller
|
|
1693
1688
|
};
|
|
1694
1689
|
this.materializations.add(materialization);
|
|
1695
|
-
return
|
|
1696
|
-
|
|
1697
|
-
signal: AbortSignal.any([inputs.signal, controller.signal])
|
|
1698
|
-
}, lineage, pool, releaseSlot).catch((error) => {
|
|
1699
|
-
releaseSlot();
|
|
1700
|
-
if (error instanceof Error && error.name === "AbortError") this.assertAdmitting(inputs.parent);
|
|
1690
|
+
return start(AbortSignal.any([signal, controller.signal])).catch((error) => {
|
|
1691
|
+
if (error instanceof Error && error.name === "AbortError") this.assertAdmitting(root);
|
|
1701
1692
|
throw error;
|
|
1702
1693
|
}).finally(() => {
|
|
1703
1694
|
this.materializations.delete(materialization);
|
|
@@ -1732,35 +1723,13 @@ var SubagentManager = class {
|
|
|
1732
1723
|
}))).filter((failure) => failure !== void 0);
|
|
1733
1724
|
if (reasons.length > 0) throw new SubagentError(`subagent teardown failed for ${reasons.length} ${failureSubject}: ` + reasons.map((reason) => failureMessage(reason)).join("; "), "ACTIVATION_TEARDOWN_FAILED");
|
|
1734
1725
|
}
|
|
1735
|
-
/** Return the
|
|
1736
|
-
closingMembers(root) {
|
|
1737
|
-
const existing = this.closingScopes.get(root);
|
|
1738
|
-
if (existing !== void 0) return existing;
|
|
1739
|
-
const members = /* @__PURE__ */ new Set();
|
|
1740
|
-
this.closingScopes.set(root, members);
|
|
1741
|
-
return members;
|
|
1742
|
-
}
|
|
1743
|
-
/** Return the exact currently resolvable ancestry from `agent` upward. */
|
|
1744
|
-
liveLineage(agent) {
|
|
1745
|
-
const lineage = [agent];
|
|
1746
|
-
const seen = new Set([agent.id]);
|
|
1747
|
-
let parentSession = agent.session.header.parentSession;
|
|
1748
|
-
while (parentSession !== void 0) {
|
|
1749
|
-
const parent = this.ctx.agents.get(parentSession);
|
|
1750
|
-
if (parent === void 0 || seen.has(parent.id)) break;
|
|
1751
|
-
lineage.push(parent);
|
|
1752
|
-
seen.add(parent.id);
|
|
1753
|
-
parentSession = parent.session.header.parentSession;
|
|
1754
|
-
}
|
|
1755
|
-
return lineage;
|
|
1756
|
-
}
|
|
1757
|
-
/** Return the teardown that closed continuable admission for this agent's lineage. */
|
|
1726
|
+
/** Return the subagent tree teardown that closed admission for this exact Agent. */
|
|
1758
1727
|
closingTeardownFor(agent) {
|
|
1759
1728
|
if (this.draining) return "manager";
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1729
|
+
const root = this.rootOf(agent);
|
|
1730
|
+
return this.closingRoots.has(root) ? root : void 0;
|
|
1762
1731
|
}
|
|
1763
|
-
/**
|
|
1732
|
+
/** Share one capacity pool across every instance in a subagent tree. */
|
|
1764
1733
|
rootPool(parent) {
|
|
1765
1734
|
let pool = this.rootPools.get(parent);
|
|
1766
1735
|
if (pool === void 0) {
|
|
@@ -1770,9 +1739,8 @@ var SubagentManager = class {
|
|
|
1770
1739
|
return pool;
|
|
1771
1740
|
}
|
|
1772
1741
|
/** Perform one tracked materialization through publication or rollback. */
|
|
1773
|
-
async materializeTracked(inputs,
|
|
1774
|
-
const { provider,
|
|
1775
|
-
let childId = inputs.childId;
|
|
1742
|
+
async materializeTracked(inputs, releaseSlot) {
|
|
1743
|
+
const { provider, root } = inputs;
|
|
1776
1744
|
inputs.signal.throwIfAborted();
|
|
1777
1745
|
let resource;
|
|
1778
1746
|
if (inputs.kind === "external") {
|
|
@@ -1789,9 +1757,8 @@ var SubagentManager = class {
|
|
|
1789
1757
|
controller
|
|
1790
1758
|
};
|
|
1791
1759
|
run.result.catch(() => void 0);
|
|
1792
|
-
childId = run.id;
|
|
1793
1760
|
try {
|
|
1794
|
-
this.assertChildIdAvailable(
|
|
1761
|
+
this.assertChildIdAvailable(run.id);
|
|
1795
1762
|
} catch (error) {
|
|
1796
1763
|
await run.dispose();
|
|
1797
1764
|
throw error;
|
|
@@ -1800,14 +1767,14 @@ var SubagentManager = class {
|
|
|
1800
1767
|
inputs.signal.removeEventListener("abort", cancelStartup);
|
|
1801
1768
|
}
|
|
1802
1769
|
} else {
|
|
1803
|
-
const { create } = inputs;
|
|
1770
|
+
const { create, childId } = inputs;
|
|
1804
1771
|
let structured;
|
|
1805
1772
|
const setup = async (childCtx, child) => {
|
|
1806
|
-
if (inputs.composition.agentPreset !== void 0) await applyChildComposition(childCtx, parent, inputs.composition);
|
|
1773
|
+
if (inputs.composition.agentPreset !== void 0) await applyChildComposition(childCtx, create?.parent, inputs.composition);
|
|
1807
1774
|
if (create !== void 0) {
|
|
1808
1775
|
const { provider, model, reasoningEffort } = inputs.agentOptions;
|
|
1809
1776
|
const inherited = child.model.current();
|
|
1810
|
-
if (provider !== void 0 && model !== void 0 && (inherited?.provider !== provider || inherited.model !== model)) child.model.select({
|
|
1777
|
+
if (provider !== void 0 && model !== void 0 && (inherited?.provider !== provider || inherited.model !== model || inherited.reasoningEffort !== reasoningEffort)) child.model.select({
|
|
1811
1778
|
provider,
|
|
1812
1779
|
model,
|
|
1813
1780
|
...reasoningEffort === void 0 ? {} : { reasoningEffort }
|
|
@@ -1819,18 +1786,16 @@ var SubagentManager = class {
|
|
|
1819
1786
|
if (workingDirectory === void 0) throw new Error("local subagents require the working-directory service");
|
|
1820
1787
|
await workingDirectory.set(child, create.cwd, inputs.signal);
|
|
1821
1788
|
}
|
|
1822
|
-
if (inputs.composition.agentPreset === void 0) await applyChildComposition(childCtx, parent, inputs.composition);
|
|
1823
|
-
if (inputs.outputSchema !== void 0) structured = attachStructuredRuntime(childCtx, inputs.outputSchema, () =>
|
|
1789
|
+
if (inputs.composition.agentPreset === void 0) await applyChildComposition(childCtx, create?.parent, inputs.composition);
|
|
1790
|
+
if (inputs.outputSchema !== void 0) structured = attachStructuredRuntime(childCtx, inputs.outputSchema, () => child.inbox.nextStep.length === 0 && child.inbox.nextTurn.length === 0);
|
|
1824
1791
|
};
|
|
1825
1792
|
const handle = create === void 0 ? await this.ownerCtx.agents.resume({
|
|
1826
1793
|
resumeSessionId: childId,
|
|
1827
|
-
parentAgent: parent,
|
|
1828
1794
|
agentOptions: inputs.agentOptions,
|
|
1829
1795
|
signal: inputs.signal,
|
|
1830
1796
|
setup
|
|
1831
1797
|
}) : await this.ownerCtx.agents.create({
|
|
1832
1798
|
sessionId: childId,
|
|
1833
|
-
parentAgent: parent,
|
|
1834
1799
|
meta: create.meta,
|
|
1835
1800
|
...create.seed === void 0 ? {} : { seed: create.seed },
|
|
1836
1801
|
inheritedEventCount: create.inheritedEventCount,
|
|
@@ -1848,28 +1813,25 @@ var SubagentManager = class {
|
|
|
1848
1813
|
omitClosingText: false
|
|
1849
1814
|
};
|
|
1850
1815
|
}
|
|
1851
|
-
const
|
|
1816
|
+
const childId = resource.kind === "local" ? resource.handle.agent.id : resource.run.id;
|
|
1852
1817
|
const activation = {
|
|
1853
|
-
pool,
|
|
1854
1818
|
releaseSlot,
|
|
1855
1819
|
childId,
|
|
1820
|
+
runId: SubagentRunId(randomUUID()),
|
|
1821
|
+
provider,
|
|
1856
1822
|
...resource,
|
|
1857
|
-
|
|
1823
|
+
root,
|
|
1824
|
+
ancestors: inputs.ancestors,
|
|
1858
1825
|
delivery: inputs.delivery ?? "parent",
|
|
1859
1826
|
result: Promise.withResolvers(),
|
|
1860
1827
|
closing: void 0,
|
|
1861
|
-
|
|
1862
|
-
ownedChildren: /* @__PURE__ */ new Set(),
|
|
1863
|
-
observer,
|
|
1864
|
-
announced: false
|
|
1828
|
+
accepted: false
|
|
1865
1829
|
};
|
|
1866
1830
|
activation.result.promise.catch(() => void 0);
|
|
1867
1831
|
this.resident.set(childId, activation);
|
|
1868
1832
|
try {
|
|
1869
|
-
this.assertAdmitting(
|
|
1833
|
+
this.assertAdmitting(root);
|
|
1870
1834
|
inputs.signal.throwIfAborted();
|
|
1871
|
-
if (this.ctx.agents.get(parent.id) !== parent) throw new SubagentError("subagent parent is no longer live", "UNAUTHORIZED");
|
|
1872
|
-
this.acquireOwnership(parent, childId);
|
|
1873
1835
|
const wakeSettlement = () => {
|
|
1874
1836
|
this.wake(activation);
|
|
1875
1837
|
};
|
|
@@ -1885,7 +1847,7 @@ var SubagentManager = class {
|
|
|
1885
1847
|
if (event.type === "tool/call") activation.omitClosingText = false;
|
|
1886
1848
|
});
|
|
1887
1849
|
}
|
|
1888
|
-
|
|
1850
|
+
this.host.emitLifecycle("subagent/start", this.runInfo(activation), root);
|
|
1889
1851
|
} catch (error) {
|
|
1890
1852
|
/* v8 ignore next -- rollback failure must not mask the admission failure
|
|
1891
1853
|
* that prevented this operation from returning an accepted message id. */
|
|
@@ -1894,13 +1856,19 @@ var SubagentManager = class {
|
|
|
1894
1856
|
}
|
|
1895
1857
|
return activation;
|
|
1896
1858
|
}
|
|
1897
|
-
/**
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1859
|
+
/** Identity shared by one residency epoch's start/end pair, including cold resumes. */
|
|
1860
|
+
runInfo(activation) {
|
|
1861
|
+
return {
|
|
1862
|
+
runId: activation.runId,
|
|
1863
|
+
provider: activation.provider,
|
|
1864
|
+
parentSessionId: activation.ancestors.at(-1),
|
|
1865
|
+
id: activation.childId,
|
|
1866
|
+
local: activation.kind === "local"
|
|
1867
|
+
};
|
|
1868
|
+
}
|
|
1869
|
+
/** Record acceptance and begin settlement observation before returning the receipt. */
|
|
1870
|
+
accept(activation) {
|
|
1871
|
+
activation.accepted = true;
|
|
1904
1872
|
if (activation.kind === "local") this.watchLocalSettlement(activation);
|
|
1905
1873
|
else {
|
|
1906
1874
|
const finish = () => this.close(activation, () => this.finishDisposal(activation, false));
|
|
@@ -1917,23 +1885,10 @@ var SubagentManager = class {
|
|
|
1917
1885
|
} finally {
|
|
1918
1886
|
this.resident.delete(activation.childId);
|
|
1919
1887
|
activation.releaseSlot();
|
|
1920
|
-
this.releaseOwnership(activation.childId);
|
|
1921
1888
|
activation.result.reject(error);
|
|
1922
1889
|
}
|
|
1923
1890
|
});
|
|
1924
1891
|
}
|
|
1925
|
-
/** Register the child in a continuation-managed parent's owned set. */
|
|
1926
|
-
acquireOwnership(parent, childId) {
|
|
1927
|
-
const parentActivation = this.resident.get(parent.id);
|
|
1928
|
-
if (parentActivation === void 0) return;
|
|
1929
|
-
if (parentActivation.closing !== void 0) throw new SubagentError(`subagent parent "${parent.id}" is being disposed; the child was not established`, "ACTIVATION_CLOSING");
|
|
1930
|
-
parentActivation.ownedChildren.add(childId);
|
|
1931
|
-
this.wake(parentActivation);
|
|
1932
|
-
}
|
|
1933
|
-
/** Remove one child from its live owner's set and let that owner re-check settlement. */
|
|
1934
|
-
releaseOwnership(childId) {
|
|
1935
|
-
for (const candidate of this.resident.values()) if (candidate.ownedChildren.delete(childId)) this.wake(candidate);
|
|
1936
|
-
}
|
|
1937
1892
|
/** Let a settlement watcher re-check residency after relevant state changes. */
|
|
1938
1893
|
wake(activation) {
|
|
1939
1894
|
if (activation.kind === "external") return;
|
|
@@ -1988,16 +1943,15 @@ var SubagentManager = class {
|
|
|
1988
1943
|
reportTeardownFailure(activation, error) {
|
|
1989
1944
|
this.ctx.logger.warn(`subagent "${activation.childId}" activation teardown failed: ${failureMessage(error)}`);
|
|
1990
1945
|
}
|
|
1991
|
-
/** Check pending input
|
|
1946
|
+
/** Check pending input before closing admission. */
|
|
1992
1947
|
settlementState(activation, observation) {
|
|
1993
1948
|
if (activation.closing !== void 0) return "closed";
|
|
1994
1949
|
if (activation.poke !== observation) return "retry";
|
|
1995
1950
|
const inbox = activation.handle.agent.inbox;
|
|
1996
|
-
if (activation.ownedChildren.size > 0) return "wait";
|
|
1997
1951
|
if (activation.failureAt === void 0 && (inbox.nextTurn.length > 0 || inbox.nextStep.length > 0)) return "wait";
|
|
1998
1952
|
return "ready";
|
|
1999
1953
|
}
|
|
2000
|
-
/**
|
|
1954
|
+
/** Stop and release one instance without affecting its creation descendants. */
|
|
2001
1955
|
async finishDisposal(activation, stop) {
|
|
2002
1956
|
this.wake(activation);
|
|
2003
1957
|
const { childId } = activation;
|
|
@@ -2021,22 +1975,7 @@ var SubagentManager = class {
|
|
|
2021
1975
|
} else {
|
|
2022
1976
|
if (stop) {
|
|
2023
1977
|
activation.handle.agent.cancel({ kind: "parent" });
|
|
2024
|
-
|
|
2025
|
-
const children = [...activation.ownedChildren].map((child) => this.resident.get(child)).filter((child) => child !== void 0);
|
|
2026
|
-
const pending = [...this.materializations].filter((item) => item.lineage.includes(activation.handle.agent));
|
|
2027
|
-
const childDisposals = children.map((child) => this.dispose(child));
|
|
2028
|
-
for (const item of pending) item.controller.abort();
|
|
2029
|
-
childDisposals.push(...pending.map((item) => item.settled));
|
|
2030
|
-
const reasons = (await Promise.all(childDisposals.map(async (disposal) => {
|
|
2031
|
-
try {
|
|
2032
|
-
await disposal;
|
|
2033
|
-
return;
|
|
2034
|
-
} catch (error) {
|
|
2035
|
-
return error;
|
|
2036
|
-
}
|
|
2037
|
-
}))).filter((reason) => reason !== void 0);
|
|
2038
|
-
if (reasons.length > 0) failures.push(new SubagentError(`subagent "${childId}" child teardown failed: ${reasons.map((reason) => failureMessage(reason)).join("; ")}`, "ACTIVATION_TEARDOWN_FAILED"));
|
|
2039
|
-
await idle;
|
|
1978
|
+
await activation.handle.agent.whenIdle();
|
|
2040
1979
|
await this.flushFinalState(activation);
|
|
2041
1980
|
}
|
|
2042
1981
|
result = captureLocalResult(activation);
|
|
@@ -2061,18 +2000,22 @@ var SubagentManager = class {
|
|
|
2061
2000
|
stopReason: "error"
|
|
2062
2001
|
};
|
|
2063
2002
|
this.notifySettlement(activation, result);
|
|
2064
|
-
this.
|
|
2065
|
-
|
|
2003
|
+
this.host.emitLifecycle("subagent/end", {
|
|
2004
|
+
...this.runInfo(activation),
|
|
2005
|
+
stopReason: terminal.stopReason,
|
|
2006
|
+
...terminal.output.length === 0 ? {} : { lastAssistantMessage: terminal.output }
|
|
2007
|
+
}, activation.root);
|
|
2066
2008
|
if (resultFailure === void 0) activation.result.resolve(result);
|
|
2067
2009
|
else activation.result.reject(resultFailure.error);
|
|
2068
2010
|
if (failure !== void 0) throw failure;
|
|
2069
2011
|
}
|
|
2070
2012
|
/** Deliver the captured execution result to the durable direct parent after cleanup. */
|
|
2071
2013
|
notifySettlement(activation, terminal) {
|
|
2072
|
-
if (!activation.
|
|
2014
|
+
if (!activation.accepted || activation.delivery === "caller") return;
|
|
2073
2015
|
try {
|
|
2074
|
-
const
|
|
2075
|
-
|
|
2016
|
+
const parentId = activation.ancestors.at(-1);
|
|
2017
|
+
const parent = this.ctx.agents.get(parentId);
|
|
2018
|
+
if (parent === void 0 || this.rootOf(parent) !== activation.root) return;
|
|
2076
2019
|
const message = createSettlementMessage(activation.childId, terminal, activation.kind === "local", activation.kind === "local" && activation.omitClosingText);
|
|
2077
2020
|
if (this.closingTeardownFor(parent) !== void 0) {
|
|
2078
2021
|
parent.inject(message);
|
|
@@ -2099,124 +2042,100 @@ var SubagentManager = class {
|
|
|
2099
2042
|
dispose: () => this.dispose(activation)
|
|
2100
2043
|
};
|
|
2101
2044
|
}
|
|
2102
|
-
/**
|
|
2103
|
-
async
|
|
2104
|
-
this.assertAdmitting(parent);
|
|
2105
|
-
const releaseHold = this.holdOwnership(parent, childId);
|
|
2106
|
-
try {
|
|
2107
|
-
return await this.deliverFollowup(parent, childId, content, options);
|
|
2108
|
-
} catch (error) {
|
|
2109
|
-
releaseHold();
|
|
2110
|
-
throw error;
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
/** The delivery loop behind {@link deliverToChild}, run under the parent hold. */
|
|
2114
|
-
async deliverFollowup(parent, childId, content, options) {
|
|
2045
|
+
/** Serialize target restoration and inbox admission; closure is awaited outside the lock. */
|
|
2046
|
+
async deliverToMember(root, childId, content, options) {
|
|
2115
2047
|
while (true) {
|
|
2116
|
-
|
|
2048
|
+
this.assertAdmitting(root);
|
|
2049
|
+
options.signal.throwIfAborted();
|
|
2050
|
+
const result = await this.locks.run(childId, async () => {
|
|
2051
|
+
if (childId === root.id) {
|
|
2052
|
+
if (contentHasImage(content)) await this.assertImageCapable(root, options.signal);
|
|
2053
|
+
options.signal.throwIfAborted();
|
|
2054
|
+
options.authorize?.();
|
|
2055
|
+
this.assertAdmitting(root);
|
|
2056
|
+
const message = createUserMessage({
|
|
2057
|
+
content,
|
|
2058
|
+
source: options.source
|
|
2059
|
+
});
|
|
2060
|
+
this.sendWaking(root, message, options.delivery);
|
|
2061
|
+
options.onAccepted?.();
|
|
2062
|
+
return { messageId: message.id };
|
|
2063
|
+
}
|
|
2117
2064
|
const activation = this.resident.get(childId);
|
|
2118
|
-
if (activation === void 0)
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
/* v8 ignore next 3 -- the send-versus-dispose cutoff needs a delivery to
|
|
2122
|
-
* observe the transaction inside the same critical section that opened it. */
|
|
2123
|
-
if (disposal !== void 0) return disposal.then(() => void 0, () => void 0);
|
|
2124
|
-
if (contentHasImage(content)) {
|
|
2125
|
-
await this.assertImageCapable(requireLocalActivation(activation).handle.agent, options.signal);
|
|
2126
|
-
if (activation.closing !== void 0) {
|
|
2127
|
-
await Promise.allSettled([activation.closing]);
|
|
2128
|
-
return;
|
|
2129
|
-
}
|
|
2065
|
+
if (activation === void 0) {
|
|
2066
|
+
const restored = await this.restoreTarget(root, childId, options.signal);
|
|
2067
|
+
return { messageId: await this.submitMaterialized(restored, content, options, root) };
|
|
2130
2068
|
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2069
|
+
if (activation.root !== root) throw new SubagentError("target belongs to another subagent tree", "UNAUTHORIZED");
|
|
2070
|
+
requireLocalActivation(activation);
|
|
2071
|
+
if (activation.closing === void 0 && contentHasImage(content)) await this.assertImageCapable(requireLocalActivation(activation).handle.agent, options.signal);
|
|
2072
|
+
if (activation.closing !== void 0) return { closing: activation.closing };
|
|
2073
|
+
return { messageId: this.submitAdmitted(activation, content, options, root) };
|
|
2134
2074
|
});
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
this.assertAdmitting(parent);
|
|
2138
|
-
options.signal.throwIfAborted();
|
|
2075
|
+
if ("messageId" in result) return result.messageId;
|
|
2076
|
+
await Promise.allSettled([result.closing]);
|
|
2139
2077
|
}
|
|
2140
2078
|
}
|
|
2141
|
-
/**
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
* transaction between exact-agent authorization and this no-await span. */
|
|
2145
|
-
if (activation.closing !== void 0) throw new SubagentError(`subagent "${sender.id}" activation is being disposed; the message was not delivered`, "ACTIVATION_CLOSING");
|
|
2146
|
-
const parent = this.ctx.agents.get(activation.parent.id);
|
|
2147
|
-
if (parent !== activation.parent) throw new SubagentError("direct parent is not live; the message was not delivered", "PARENT_UNAVAILABLE");
|
|
2148
|
-
const message = createAgentMessage(sender, content);
|
|
2149
|
-
this.sendAgentMessage(parent, message);
|
|
2150
|
-
activation.omitClosingText = true;
|
|
2151
|
-
return message.id;
|
|
2152
|
-
}
|
|
2153
|
-
/** Send one Agent message while translating only the target's own rejection. */
|
|
2154
|
-
sendAgentMessage(parent, message) {
|
|
2079
|
+
/** Read continuation history, preserving cancellation and reporting unavailable storage. */
|
|
2080
|
+
async observeContinuation(childId, signal) {
|
|
2081
|
+
const query = this.requireSessionQuery();
|
|
2155
2082
|
try {
|
|
2156
|
-
|
|
2083
|
+
return await query.observeSession(childId, { signal });
|
|
2157
2084
|
} catch (error) {
|
|
2158
|
-
|
|
2085
|
+
signal.throwIfAborted();
|
|
2086
|
+
throw new SubagentError(`subagent "${childId}" is unavailable`, "NOT_RESUMABLE", { cause: error });
|
|
2159
2087
|
}
|
|
2160
2088
|
}
|
|
2161
|
-
/**
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
hasError: false
|
|
2170
|
-
};
|
|
2171
|
-
try {
|
|
2172
|
-
const query = this.requireSessionQuery();
|
|
2173
|
-
let observation;
|
|
2174
|
-
try {
|
|
2175
|
-
observation = await query.observeSession(childId, { signal: options.signal });
|
|
2176
|
-
} catch (error) {
|
|
2177
|
-
options.signal.throwIfAborted();
|
|
2178
|
-
throw new SubagentError(`subagent "${childId}" is unavailable`, "NOT_RESUMABLE", { cause: error });
|
|
2179
|
-
}
|
|
2180
|
-
const source = __addDisposableResource$2(env_1, observation, false);
|
|
2181
|
-
this.assertAdmitting(parent);
|
|
2182
|
-
this.authorizeLineage(parent, childId, source.header.parentSession);
|
|
2183
|
-
const ownEvents = source.events.slice(source.inheritedEventCount);
|
|
2184
|
-
const descriptor = foldSubagentDescriptor(ownEvents);
|
|
2185
|
-
if (descriptor === void 0 || descriptor.mode !== "continuable") throw new SubagentError(`subagent "${childId}" has no supported continuation state and cannot be resumed; choose a different target`, "NOT_RESUMABLE");
|
|
2186
|
-
let activation;
|
|
2089
|
+
/** Reconstruct only the target under its subagent tree root; the caller owns acceptance or rollback. */
|
|
2090
|
+
async restoreTarget(root, childId, signal) {
|
|
2091
|
+
return this.trackStartup(root, signal, async (signal) => {
|
|
2092
|
+
const env_3 = {
|
|
2093
|
+
stack: [],
|
|
2094
|
+
error: void 0,
|
|
2095
|
+
hasError: false
|
|
2096
|
+
};
|
|
2187
2097
|
try {
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2098
|
+
const source = __addDisposableResource$1(env_3, await this.observeContinuation(childId, signal), false);
|
|
2099
|
+
this.assertAdmitting(root);
|
|
2100
|
+
const descriptor = foldSubagentDescriptor(source.events.slice(source.inheritedEventCount));
|
|
2101
|
+
if (descriptor === void 0 || descriptor.mode !== "continuable") throw new SubagentError(`subagent "${childId}" has no supported continuation state and cannot be resumed; choose a different target`, "NOT_RESUMABLE");
|
|
2102
|
+
const { ancestors } = await this.resolveCreationAncestry(source, signal, root);
|
|
2103
|
+
let activation;
|
|
2104
|
+
try {
|
|
2105
|
+
const projectedPreset = source.projections?.values.agentPreset;
|
|
2106
|
+
if (projectedPreset === void 0 && source.events.some((event) => event.type === "agent-preset/selected")) throw new SubagentError(`subagent "${childId}" has no agent preset projection for restoration`, "NOT_RESUMABLE");
|
|
2107
|
+
const agentPreset = projectedPreset ?? source.header.agentPreset;
|
|
2108
|
+
activation = await this.materialize({
|
|
2109
|
+
kind: "local",
|
|
2110
|
+
childId,
|
|
2111
|
+
provider: descriptor.provider,
|
|
2112
|
+
root,
|
|
2113
|
+
ancestors,
|
|
2114
|
+
agentOptions: {
|
|
2115
|
+
...descriptor.agentProvider !== void 0 ? { provider: descriptor.agentProvider } : {},
|
|
2116
|
+
...descriptor.agentModel !== void 0 ? { model: descriptor.agentModel } : {},
|
|
2117
|
+
...descriptor.agentReasoningEffort !== void 0 ? { reasoningEffort: ReasoningEffortId(descriptor.agentReasoningEffort) } : {}
|
|
2118
|
+
},
|
|
2119
|
+
composition: {
|
|
2120
|
+
agentPreset: agentPreset ?? void 0,
|
|
2121
|
+
persona: descriptor.persona,
|
|
2122
|
+
toolFilter: descriptor.toolFilter
|
|
2123
|
+
},
|
|
2124
|
+
signal
|
|
2125
|
+
});
|
|
2126
|
+
} catch (error) {
|
|
2127
|
+
signal.throwIfAborted();
|
|
2128
|
+
if (error instanceof SubagentError) throw error;
|
|
2129
|
+
throw new SubagentError(`subagent "${childId}" is unavailable`, "NOT_RESUMABLE", { cause: error });
|
|
2130
|
+
}
|
|
2131
|
+
return activation;
|
|
2132
|
+
} catch (e_3) {
|
|
2133
|
+
env_3.error = e_3;
|
|
2134
|
+
env_3.hasError = true;
|
|
2135
|
+
} finally {
|
|
2136
|
+
__disposeResources$1(env_3);
|
|
2212
2137
|
}
|
|
2213
|
-
|
|
2214
|
-
} catch (e_1) {
|
|
2215
|
-
env_1.error = e_1;
|
|
2216
|
-
env_1.hasError = true;
|
|
2217
|
-
} finally {
|
|
2218
|
-
__disposeResources$2(env_1);
|
|
2219
|
-
}
|
|
2138
|
+
});
|
|
2220
2139
|
}
|
|
2221
2140
|
/** Admit a materialized child, commit its creation fact, and release it on failure. */
|
|
2222
2141
|
async submitMaterialized(activation, content, options, parent, commit) {
|
|
@@ -2227,7 +2146,7 @@ var SubagentManager = class {
|
|
|
2227
2146
|
}
|
|
2228
2147
|
const messageId = this.submitAdmitted(activation, content, options, parent);
|
|
2229
2148
|
commit?.();
|
|
2230
|
-
this.
|
|
2149
|
+
this.accept(activation);
|
|
2231
2150
|
return messageId;
|
|
2232
2151
|
} catch (error) {
|
|
2233
2152
|
try {
|
|
@@ -2240,19 +2159,19 @@ var SubagentManager = class {
|
|
|
2240
2159
|
}
|
|
2241
2160
|
/** Build and submit one message across the final synchronous admission cutoff. */
|
|
2242
2161
|
submitAdmitted(activation, content, options, parent) {
|
|
2243
|
-
const message =
|
|
2162
|
+
const message = createUserMessage({
|
|
2244
2163
|
content,
|
|
2245
2164
|
source: options.source
|
|
2246
2165
|
});
|
|
2247
2166
|
options.signal.throwIfAborted();
|
|
2167
|
+
options.authorize?.();
|
|
2248
2168
|
this.assertAdmitting(parent);
|
|
2249
|
-
this.authorizeLineage(parent, activation.childId, activation.parent.id);
|
|
2250
|
-
this.acquireOwnership(parent, activation.childId);
|
|
2251
2169
|
try {
|
|
2252
2170
|
this.deliver(activation, message, options.delivery);
|
|
2253
2171
|
} finally {
|
|
2254
2172
|
this.wake(activation);
|
|
2255
2173
|
}
|
|
2174
|
+
options.onAccepted?.();
|
|
2256
2175
|
return message.id;
|
|
2257
2176
|
}
|
|
2258
2177
|
/** Refuse image content for a child whose fixed model accepts text only. */
|
|
@@ -2278,15 +2197,6 @@ var SubagentManager = class {
|
|
|
2278
2197
|
return query;
|
|
2279
2198
|
}
|
|
2280
2199
|
};
|
|
2281
|
-
/** Creation-time selection precedes the own descriptor; historical forks can select after it. */
|
|
2282
|
-
function hasIndependentPresetSelection(events) {
|
|
2283
|
-
for (const event of events) {
|
|
2284
|
-
if (event.type === "subagent/descriptor") return false;
|
|
2285
|
-
if (event.type === "agent-preset/selected") return true;
|
|
2286
|
-
}
|
|
2287
|
-
/* v8 ignore next -- coldResume rejects logs without a supported own descriptor before this lookup. */
|
|
2288
|
-
return false;
|
|
2289
|
-
}
|
|
2290
2200
|
//#endregion
|
|
2291
2201
|
//#region lib/types/list-children.js
|
|
2292
2202
|
/**
|
|
@@ -2294,7 +2204,7 @@ function hasIndependentPresetSelection(events) {
|
|
|
2294
2204
|
* Each catalog read releases its Session observation before the next branch.
|
|
2295
2205
|
* @module @deepseek-ai/dsh-subagent
|
|
2296
2206
|
*/
|
|
2297
|
-
var __addDisposableResource
|
|
2207
|
+
var __addDisposableResource = function(env, value, async) {
|
|
2298
2208
|
if (value !== null && value !== void 0) {
|
|
2299
2209
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
2300
2210
|
var dispose, inner;
|
|
@@ -2323,7 +2233,7 @@ var __addDisposableResource$1 = function(env, value, async) {
|
|
|
2323
2233
|
} else if (async) env.stack.push({ async: true });
|
|
2324
2234
|
return value;
|
|
2325
2235
|
};
|
|
2326
|
-
var __disposeResources
|
|
2236
|
+
var __disposeResources = (function(SuppressedError) {
|
|
2327
2237
|
return function(env) {
|
|
2328
2238
|
function fail(e) {
|
|
2329
2239
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
@@ -2369,14 +2279,14 @@ async function listChildren(ctx, parentSessionId, signal) {
|
|
|
2369
2279
|
try {
|
|
2370
2280
|
const query = ctx.get("sessionQuery");
|
|
2371
2281
|
if (query === void 0) throw new SubagentError("listing subagents requires the sessionQuery service (load @deepseek-ai/dsh-session-query)", "SUBAGENT_CONTROL_QUERY_UNAVAILABLE");
|
|
2372
|
-
const entries = __addDisposableResource
|
|
2282
|
+
const entries = __addDisposableResource(env_1, await query.observeSession(parentSessionId, { ...signal === void 0 ? {} : { signal } }), false).projections?.values.subagentCatalog;
|
|
2373
2283
|
if (entries === void 0) throw new SubagentError("listing subagents requires the registered subagentCatalog projection", "SUBAGENT_CONTROL_PROJECTIONS_UNAVAILABLE");
|
|
2374
2284
|
return entries;
|
|
2375
2285
|
} catch (e_1) {
|
|
2376
2286
|
env_1.error = e_1;
|
|
2377
2287
|
env_1.hasError = true;
|
|
2378
2288
|
} finally {
|
|
2379
|
-
__disposeResources
|
|
2289
|
+
__disposeResources(env_1);
|
|
2380
2290
|
}
|
|
2381
2291
|
}
|
|
2382
2292
|
/**
|
|
@@ -2459,159 +2369,6 @@ function assertListingNotCancelled(signal) {
|
|
|
2459
2369
|
if (signal?.aborted) throw new SubagentError("subagent listing was cancelled", "CANCELLED");
|
|
2460
2370
|
}
|
|
2461
2371
|
//#endregion
|
|
2462
|
-
//#region lib/types/archive-admission.js
|
|
2463
|
-
/**
|
|
2464
|
-
* The `subagent` family of the Workspace registry's archive admission: which
|
|
2465
|
-
* subagent descendants of a Session are still inside a turn, and how they
|
|
2466
|
-
* stop when the Session is archived with its work.
|
|
2467
|
-
*
|
|
2468
|
-
* @module @deepseek-ai/dsh-subagent
|
|
2469
|
-
*/
|
|
2470
|
-
var __addDisposableResource = function(env, value, async) {
|
|
2471
|
-
if (value !== null && value !== void 0) {
|
|
2472
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
2473
|
-
var dispose, inner;
|
|
2474
|
-
if (async) {
|
|
2475
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
2476
|
-
dispose = value[Symbol.asyncDispose];
|
|
2477
|
-
}
|
|
2478
|
-
if (dispose === void 0) {
|
|
2479
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
2480
|
-
dispose = value[Symbol.dispose];
|
|
2481
|
-
if (async) inner = dispose;
|
|
2482
|
-
}
|
|
2483
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
2484
|
-
if (inner) dispose = function() {
|
|
2485
|
-
try {
|
|
2486
|
-
inner.call(this);
|
|
2487
|
-
} catch (e) {
|
|
2488
|
-
return Promise.reject(e);
|
|
2489
|
-
}
|
|
2490
|
-
};
|
|
2491
|
-
env.stack.push({
|
|
2492
|
-
value,
|
|
2493
|
-
dispose,
|
|
2494
|
-
async
|
|
2495
|
-
});
|
|
2496
|
-
} else if (async) env.stack.push({ async: true });
|
|
2497
|
-
return value;
|
|
2498
|
-
};
|
|
2499
|
-
var __disposeResources = (function(SuppressedError) {
|
|
2500
|
-
return function(env) {
|
|
2501
|
-
function fail(e) {
|
|
2502
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
2503
|
-
env.hasError = true;
|
|
2504
|
-
}
|
|
2505
|
-
var r, s = 0;
|
|
2506
|
-
function next() {
|
|
2507
|
-
while (r = env.stack.pop()) try {
|
|
2508
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
2509
|
-
if (r.dispose) {
|
|
2510
|
-
var result = r.dispose.call(r.value);
|
|
2511
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
2512
|
-
fail(e);
|
|
2513
|
-
return next();
|
|
2514
|
-
});
|
|
2515
|
-
} else s |= 1;
|
|
2516
|
-
} catch (e) {
|
|
2517
|
-
fail(e);
|
|
2518
|
-
}
|
|
2519
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
2520
|
-
if (env.hasError) throw env.error;
|
|
2521
|
-
}
|
|
2522
|
-
return next();
|
|
2523
|
-
};
|
|
2524
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
2525
|
-
var e = new Error(message);
|
|
2526
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2527
|
-
});
|
|
2528
|
-
/**
|
|
2529
|
-
* Answer `workspace/session-activity` with the running subagent descendants of
|
|
2530
|
-
* the asked Session, and `workspace/session-stop` by cancelling each of them
|
|
2531
|
-
* as their parent would. Both listeners live as long as `ctx`'s fiber.
|
|
2532
|
-
* @param ctx - context carrying the Agent registry; the Session query service is optional and only supplies labels.
|
|
2533
|
-
*/
|
|
2534
|
-
function installSubagentArchiveAdmission(ctx) {
|
|
2535
|
-
ctx.on("workspace/session-activity", async ({ sessionId }, next) => {
|
|
2536
|
-
const running = runningDescendants(ctx, sessionId);
|
|
2537
|
-
const rest = await next();
|
|
2538
|
-
if (running.length === 0) return rest;
|
|
2539
|
-
return [{
|
|
2540
|
-
kind: "subagent",
|
|
2541
|
-
items: await Promise.all(running.map((child) => describe(ctx, child)))
|
|
2542
|
-
}, ...rest];
|
|
2543
|
-
});
|
|
2544
|
-
ctx.on("workspace/session-stop", ({ sessionId }) => {
|
|
2545
|
-
for (const child of runningDescendants(ctx, sessionId)) try {
|
|
2546
|
-
child.cancel({ kind: "parent" });
|
|
2547
|
-
} catch (error) {
|
|
2548
|
-
ctx.logger.warn(`subagent: cancelling "${child.id}" for an archived Session failed: ${String(error)}`);
|
|
2549
|
-
}
|
|
2550
|
-
});
|
|
2551
|
-
}
|
|
2552
|
-
/**
|
|
2553
|
-
* Live subagent descendants inside a turn, by durable lineage: a child whose
|
|
2554
|
-
* header names its parent and carries the subagent origin this package
|
|
2555
|
-
* records, at any depth. A fork shares the lineage field without the origin
|
|
2556
|
-
* and is an independent conversation, so it never holds its source. Lineage
|
|
2557
|
-
* is read as data, so a damaged header chain that loops is visited once.
|
|
2558
|
-
*/
|
|
2559
|
-
function runningDescendants(ctx, rootId) {
|
|
2560
|
-
const childrenOf = /* @__PURE__ */ new Map();
|
|
2561
|
-
for (const agent of ctx.agents.list()) {
|
|
2562
|
-
const { parentSession, origin } = agent.session.header;
|
|
2563
|
-
if (parentSession === void 0 || origin !== "subagent") continue;
|
|
2564
|
-
const siblings = childrenOf.get(parentSession) ?? [];
|
|
2565
|
-
siblings.push(agent);
|
|
2566
|
-
childrenOf.set(parentSession, siblings);
|
|
2567
|
-
}
|
|
2568
|
-
const running = [];
|
|
2569
|
-
const pending = [rootId];
|
|
2570
|
-
const visited = /* @__PURE__ */ new Set();
|
|
2571
|
-
while (pending.length > 0) {
|
|
2572
|
-
const parentId = pending.shift();
|
|
2573
|
-
if (visited.has(parentId)) continue;
|
|
2574
|
-
visited.add(parentId);
|
|
2575
|
-
for (const child of childrenOf.get(parentId) ?? []) {
|
|
2576
|
-
if (child.status === "running") running.push(child);
|
|
2577
|
-
pending.push(child.id);
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
return running;
|
|
2581
|
-
}
|
|
2582
|
-
/**
|
|
2583
|
-
* The child's activity item: its id, plus the durable creation label its
|
|
2584
|
-
* descriptor carries, read through a live Session observation. Without the
|
|
2585
|
-
* Session query service, or with a descriptor that is absent or unreadable,
|
|
2586
|
-
* the item names the child by id alone.
|
|
2587
|
-
*/
|
|
2588
|
-
async function describe(ctx, child) {
|
|
2589
|
-
const query = ctx.get("sessionQuery");
|
|
2590
|
-
if (query === void 0) return { id: child.id };
|
|
2591
|
-
try {
|
|
2592
|
-
const env_1 = {
|
|
2593
|
-
stack: [],
|
|
2594
|
-
error: void 0,
|
|
2595
|
-
hasError: false
|
|
2596
|
-
};
|
|
2597
|
-
try {
|
|
2598
|
-
const observation = __addDisposableResource(env_1, await query.observeSession(child.id, { projectionMode: "none" }), false);
|
|
2599
|
-
const label = foldSubagentDescriptor(observation.events.slice(observation.inheritedEventCount))?.label;
|
|
2600
|
-
return label === void 0 ? { id: child.id } : {
|
|
2601
|
-
id: child.id,
|
|
2602
|
-
label
|
|
2603
|
-
};
|
|
2604
|
-
} catch (e_1) {
|
|
2605
|
-
env_1.error = e_1;
|
|
2606
|
-
env_1.hasError = true;
|
|
2607
|
-
} finally {
|
|
2608
|
-
__disposeResources(env_1);
|
|
2609
|
-
}
|
|
2610
|
-
} catch {
|
|
2611
|
-
return { id: child.id };
|
|
2612
|
-
}
|
|
2613
|
-
}
|
|
2614
|
-
//#endregion
|
|
2615
2372
|
//#region lib/types/projection.js
|
|
2616
2373
|
/**
|
|
2617
2374
|
* Pure session projections for subagent identity (mode/label) and active-turn
|
|
@@ -2963,12 +2720,18 @@ let SubagentRuntime = (() => {
|
|
|
2963
2720
|
let _classSuper = TypertRemoteService;
|
|
2964
2721
|
let _instanceExtraInitializers = [];
|
|
2965
2722
|
let _prompt_decorators;
|
|
2966
|
-
let
|
|
2723
|
+
let _interruptByUser_decorators;
|
|
2967
2724
|
return class SubagentRuntime extends _classSuper {
|
|
2968
2725
|
static {
|
|
2969
2726
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2970
|
-
_prompt_decorators = [Remote(
|
|
2971
|
-
|
|
2727
|
+
_prompt_decorators = [Remote({
|
|
2728
|
+
name: "prompt",
|
|
2729
|
+
resources: { session: (request) => request.childSessionId }
|
|
2730
|
+
})];
|
|
2731
|
+
_interruptByUser_decorators = [Remote({
|
|
2732
|
+
name: "interruptByUser",
|
|
2733
|
+
resources: { session: (childSessionId) => childSessionId }
|
|
2734
|
+
})];
|
|
2972
2735
|
__esDecorate(this, null, _prompt_decorators, {
|
|
2973
2736
|
kind: "method",
|
|
2974
2737
|
name: "prompt",
|
|
@@ -2980,14 +2743,14 @@ let SubagentRuntime = (() => {
|
|
|
2980
2743
|
},
|
|
2981
2744
|
metadata: _metadata
|
|
2982
2745
|
}, null, _instanceExtraInitializers);
|
|
2983
|
-
__esDecorate(this, null,
|
|
2746
|
+
__esDecorate(this, null, _interruptByUser_decorators, {
|
|
2984
2747
|
kind: "method",
|
|
2985
|
-
name: "
|
|
2748
|
+
name: "interruptByUser",
|
|
2986
2749
|
static: false,
|
|
2987
2750
|
private: false,
|
|
2988
2751
|
access: {
|
|
2989
|
-
has: (obj) => "
|
|
2990
|
-
get: (obj) => obj.
|
|
2752
|
+
has: (obj) => "interruptByUser" in obj,
|
|
2753
|
+
get: (obj) => obj.interruptByUser
|
|
2991
2754
|
},
|
|
2992
2755
|
metadata: _metadata
|
|
2993
2756
|
}, null, _instanceExtraInitializers);
|
|
@@ -3016,13 +2779,17 @@ let SubagentRuntime = (() => {
|
|
|
3016
2779
|
super(ctx, "subagents");
|
|
3017
2780
|
this.config = config;
|
|
3018
2781
|
this.emitLifecycle = createLifecycleEmitter(this.ctx, (parent) => scopeTarget(this, parent));
|
|
2782
|
+
}
|
|
2783
|
+
async [Service.init]() {
|
|
2784
|
+
const ctx = this.ctx;
|
|
2785
|
+
await ctx.sessionProjections.register(subagentCatalogProjectionDefinition);
|
|
2786
|
+
await ctx.sessionProjections.register(subagentTimingProjectionDefinition);
|
|
2787
|
+
const identityProjection = await ctx.sessionProjections.register(subagentIdentityProjectionDefinition);
|
|
2788
|
+
if (ctx.fiber.uid === null) return;
|
|
3019
2789
|
ctx.inject(["agents"], (childCtx) => {
|
|
3020
2790
|
const manager = new SubagentManager(childCtx, {
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
},
|
|
3024
|
-
prepareContinuable: (name, request) => this.prepareContinuable(name, request),
|
|
3025
|
-
observeActivation: (provider, childId, parent) => this.observeActivation(provider, childId, parent)
|
|
2791
|
+
identityOf: (session) => identityProjection.stateOf(session).identity,
|
|
2792
|
+
emitLifecycle: this.emitLifecycle
|
|
3026
2793
|
}, () => this.config.maxActiveSubagents.get());
|
|
3027
2794
|
this.manager = manager;
|
|
3028
2795
|
childCtx.effect(() => () => {
|
|
@@ -3030,15 +2797,6 @@ let SubagentRuntime = (() => {
|
|
|
3030
2797
|
if (this.manager === manager) this.manager = void 0;
|
|
3031
2798
|
}, "subagents.managerBinding()");
|
|
3032
2799
|
});
|
|
3033
|
-
ctx.inject(["agents"], (agentsCtx) => {
|
|
3034
|
-
installSubagentArchiveAdmission(agentsCtx);
|
|
3035
|
-
});
|
|
3036
|
-
}
|
|
3037
|
-
async [Service.init]() {
|
|
3038
|
-
const { sessionProjections } = this.ctx;
|
|
3039
|
-
await sessionProjections.register(subagentCatalogProjectionDefinition);
|
|
3040
|
-
await sessionProjections.register(subagentTimingProjectionDefinition);
|
|
3041
|
-
await sessionProjections.register(subagentIdentityProjectionDefinition);
|
|
3042
2800
|
}
|
|
3043
2801
|
/**
|
|
3044
2802
|
* Resolve a delegation tool's depth policy against the current user setting.
|
|
@@ -3057,64 +2815,64 @@ let SubagentRuntime = (() => {
|
|
|
3057
2815
|
* @param spec - task, backend, and result recipient.
|
|
3058
2816
|
* @returns identities, execution result, and exact-activation disposal. A reserved
|
|
3059
2817
|
* childId requires a local backend and guarantees an accepted messageId.
|
|
2818
|
+
* @throws PROVIDER_CHANGED if the selected provider is removed or replaced before dispatch.
|
|
3060
2819
|
*/
|
|
3061
2820
|
async startActivation(spec) {
|
|
3062
2821
|
const provider = this.expectProvider(spec.provider);
|
|
3063
2822
|
if (spec.childId !== void 0 && provider.prepareContinuable === void 0) throw new SubagentError("reserved child ids require a local backend", "UNSUPPORTED_CAPABILITY");
|
|
3064
|
-
assertSubagentMaxDepth(spec.
|
|
3065
|
-
this.assertCapabilities(provider,
|
|
3066
|
-
...spec.request,
|
|
3067
|
-
signal: spec.signal
|
|
3068
|
-
});
|
|
2823
|
+
assertSubagentMaxDepth(spec.maxDepth);
|
|
2824
|
+
this.assertCapabilities(provider, spec);
|
|
3069
2825
|
const manager = this.requireManager();
|
|
3070
|
-
if (this.ctx.get("agents")?.get(spec.
|
|
3071
|
-
if (spec.
|
|
3072
|
-
|
|
2826
|
+
if (this.ctx.get("agents")?.get(spec.parent.id) !== spec.parent) throw new SubagentError("subagent creation requires the exact live parent agent", "UNAUTHORIZED");
|
|
2827
|
+
if (spec.outputSchema !== void 0) assertObjectJsonSchema(spec.outputSchema);
|
|
2828
|
+
const prepare = provider.prepareContinuable?.bind(provider);
|
|
2829
|
+
if (prepare !== void 0) return manager.startLocal(spec, (request) => {
|
|
2830
|
+
this.assertProviderCurrent(provider);
|
|
2831
|
+
return prepare(request);
|
|
2832
|
+
});
|
|
2833
|
+
const start = provider.start.bind(provider);
|
|
2834
|
+
return manager.startExternal(spec, (request) => {
|
|
2835
|
+
this.assertProviderCurrent(provider);
|
|
2836
|
+
return start(request);
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
/**
|
|
2840
|
+
* Resolve the root shared by an Agent and its other agents in its subagent tree.
|
|
2841
|
+
* @param caller - exact live Agent whose subagent ancestry selects the tree.
|
|
2842
|
+
* @returns the live root; ordinary Session forks lead independent trees.
|
|
2843
|
+
* @throws when the caller or its runtime owner is unavailable.
|
|
2844
|
+
*/
|
|
2845
|
+
rootOf(caller) {
|
|
2846
|
+
return this.requireManager().rootOf(caller);
|
|
3073
2847
|
}
|
|
3074
2848
|
/**
|
|
3075
|
-
* Join progressing
|
|
3076
|
-
*
|
|
3077
|
-
* @param
|
|
3078
|
-
* @returns whether work was joined; hosts recheck
|
|
2849
|
+
* Join progressing subagent tree work for its root. Idle members with parked input
|
|
2850
|
+
* stay resident without delaying host completion. Ordinary members return false.
|
|
2851
|
+
* @param root - exact live subagent tree root whose member work is awaited.
|
|
2852
|
+
* @returns whether work was joined; hosts recheck root idle after true.
|
|
3079
2853
|
*/
|
|
3080
|
-
async
|
|
3081
|
-
return this.manager?.
|
|
2854
|
+
async waitForTreeWork(root) {
|
|
2855
|
+
return this.manager?.waitForTreeWork(root) ?? false;
|
|
3082
2856
|
}
|
|
3083
2857
|
/**
|
|
3084
|
-
* Steer one model-authored message to
|
|
3085
|
-
*
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3088
|
-
*
|
|
3089
|
-
* @param sender - exact live
|
|
3090
|
-
* @param targetId -
|
|
2858
|
+
* Steer one model-authored message to another member of the same subagent tree.
|
|
2859
|
+
* A running target receives it at its next step; an idle target starts a turn.
|
|
2860
|
+
* A cold target resumes under its runtime subagent tree root without restoring
|
|
2861
|
+
* its creation ancestors. Sender identity is rechecked before inbox acceptance; cancellation
|
|
2862
|
+
* stops only pre-acceptance work and never retracts an accepted message.
|
|
2863
|
+
* @param sender - exact live root or resident continuable Agent originating the message.
|
|
2864
|
+
* @param targetId - another root or continuable member's durable Session id.
|
|
3091
2865
|
* @param content - model-authored content to deliver.
|
|
3092
2866
|
* @param options - caller cancellation before inbox acceptance.
|
|
3093
2867
|
* @returns the accepted message's inbox id.
|
|
3094
|
-
* @throws when
|
|
3095
|
-
* or the message was not admitted.
|
|
2868
|
+
* @throws when the target is outside the tree, cannot resume, or rejects input.
|
|
3096
2869
|
*/
|
|
3097
2870
|
async sendMessage(sender, targetId, content, options) {
|
|
3098
2871
|
return this.requireManager().sendMessage(sender, targetId, content, options);
|
|
3099
2872
|
}
|
|
3100
2873
|
/**
|
|
3101
|
-
*
|
|
3102
|
-
*
|
|
3103
|
-
* widening the public Service Definition or impersonating an Agent sender.
|
|
3104
|
-
* @param parent - exact live direct parent authorizing delivery.
|
|
3105
|
-
* @param childId - durable direct-child session id.
|
|
3106
|
-
* @param content - host-authored content to deliver.
|
|
3107
|
-
* @param source - durable host-protocol source descriptor.
|
|
3108
|
-
* @param signal - caller cancellation before inbox acceptance.
|
|
3109
|
-
* @param delivery - Queue as a distinct turn or Steer at the nearest step.
|
|
3110
|
-
* @returns the accepted message's inbox id.
|
|
3111
|
-
*/
|
|
3112
|
-
[deliverSubagentPrompt](parent, childId, content, source, signal, delivery) {
|
|
3113
|
-
return delivery === "steer" ? this.requireManager().steerPrompt(parent, childId, content, source, signal) : this.requireManager().queuePrompt(parent, childId, content, source, signal);
|
|
3114
|
-
}
|
|
3115
|
-
/**
|
|
3116
|
-
* Interrupt one live child's current execution under a human parent
|
|
3117
|
-
* address or an exact live ancestor Agent. Fire-and-return: the cancel
|
|
2874
|
+
* Interrupt one live child's current execution under a trusted user
|
|
2875
|
+
* operation or an exact live ancestor Agent. Fire-and-return: the cancel
|
|
3118
2876
|
* signal is issued before this returns, but the target may keep running
|
|
3119
2877
|
* until it observes the signal. Unclaimed pending inbox work, the Activation,
|
|
3120
2878
|
* and published descendants are preserved; claimed work is not requeued.
|
|
@@ -3123,7 +2881,7 @@ let SubagentRuntime = (() => {
|
|
|
3123
2881
|
* is an accepted no-op, as is a manager-less composition, which cannot own a
|
|
3124
2882
|
* live Activation.
|
|
3125
2883
|
* @param targetSessionId - the durable child session id to interrupt.
|
|
3126
|
-
* @param authority -
|
|
2884
|
+
* @param authority - a trusted user operation or exact live ancestor Agent.
|
|
3127
2885
|
* @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the
|
|
3128
2886
|
* live target.
|
|
3129
2887
|
*/
|
|
@@ -3131,13 +2889,11 @@ let SubagentRuntime = (() => {
|
|
|
3131
2889
|
this.manager?.interrupt(targetSessionId, authority);
|
|
3132
2890
|
}
|
|
3133
2891
|
/**
|
|
3134
|
-
* Close
|
|
3135
|
-
*
|
|
3136
|
-
*
|
|
3137
|
-
*
|
|
3138
|
-
*
|
|
3139
|
-
* @param parents - exact host-owned parent Agents entering teardown.
|
|
3140
|
-
* @returns once every retained descendant activation released its execution handle.
|
|
2892
|
+
* Close admission and stop all instances in the selected subagent trees, then await
|
|
2893
|
+
* pending startup and cleanup. Ordinary members are ignored. The cutoff lasts
|
|
2894
|
+
* until each exact root leaves the registry; unrelated subagent trees remain live.
|
|
2895
|
+
* @param parents - exact live subagent tree roots entering teardown.
|
|
2896
|
+
* @returns once all admitted startup and member cleanup have settled.
|
|
3141
2897
|
* @throws an aggregate error after all branches settle when any failed.
|
|
3142
2898
|
*/
|
|
3143
2899
|
async drainDescendants(parents) {
|
|
@@ -3146,33 +2902,6 @@ let SubagentRuntime = (() => {
|
|
|
3146
2902
|
await manager.drainDescendants(parents);
|
|
3147
2903
|
}
|
|
3148
2904
|
/**
|
|
3149
|
-
* Release selected resident direct children of one exact live
|
|
3150
|
-
* parent. Other children of the same parent remain admitted and resident.
|
|
3151
|
-
* Absent targets and a manager-less composition are accepted no-ops.
|
|
3152
|
-
* @param parent - exact live direct parent authorizing the selected release.
|
|
3153
|
-
* @param childIds - durable direct-child ids to release when resident.
|
|
3154
|
-
* @returns once every selected activation released its execution handle.
|
|
3155
|
-
* @throws {SubagentError} `UNAUTHORIZED` when a resident target belongs to a
|
|
3156
|
-
* different parent or the supplied parent identity is stale.
|
|
3157
|
-
*/
|
|
3158
|
-
async drainChildren(parent, childIds) {
|
|
3159
|
-
const manager = this.manager;
|
|
3160
|
-
if (manager === void 0) return;
|
|
3161
|
-
await manager.drainChildren(parent, childIds);
|
|
3162
|
-
}
|
|
3163
|
-
/**
|
|
3164
|
-
* Read the parent's durable direct-child catalog without loading or resuming an Agent.
|
|
3165
|
-
* The service owns and releases the live-preferred Session observation.
|
|
3166
|
-
* @param parentSessionId - parent whose direct children are requested.
|
|
3167
|
-
* @param signal - cancellation forwarded to the Session query.
|
|
3168
|
-
* @returns catalog children in parent event order.
|
|
3169
|
-
* @throws {@link SubagentError} when query or catalog projection is unavailable.
|
|
3170
|
-
* @throws SessionQueryError when the parent cannot be read or the query is cancelled.
|
|
3171
|
-
*/
|
|
3172
|
-
listChildren(parentSessionId, signal) {
|
|
3173
|
-
return listChildren(this.ctx, parentSessionId, signal);
|
|
3174
|
-
}
|
|
3175
|
-
/**
|
|
3176
2905
|
* Recursively list reachable parent catalogs in stable pre-order, preserving
|
|
3177
2906
|
* each catalog's event order. Each row carries its catalog parent and depth;
|
|
3178
2907
|
* external children are leaves; one-shot and unknown-mode children remain
|
|
@@ -3192,8 +2921,8 @@ let SubagentRuntime = (() => {
|
|
|
3192
2921
|
return listDescendants(this.ctx, rootSessionId, signal);
|
|
3193
2922
|
}
|
|
3194
2923
|
/**
|
|
3195
|
-
* Deliver one browser-authored message to a continuable child through
|
|
3196
|
-
*
|
|
2924
|
+
* Deliver one browser-authored message to a continuable child through its
|
|
2925
|
+
* live subagent tree root, retaining the caller-minted request identity and
|
|
3197
2926
|
* validated browser zone on the accepted message. Success identifies the
|
|
3198
2927
|
* message the child's inbox accepted; later execution is independent of this
|
|
3199
2928
|
* call. Queue delivery targets a later turn; steer delivery targets the
|
|
@@ -3201,21 +2930,20 @@ let SubagentRuntime = (() => {
|
|
|
3201
2930
|
* Image parts are admitted and persisted through the attachment store
|
|
3202
2931
|
* before delivery, and the child's model must accept image input.
|
|
3203
2932
|
* Cold resume at capacity rejects with `subagent/delivery-unavailable`.
|
|
3204
|
-
*
|
|
2933
|
+
* Access is checked on the target Session before attachment admission or restoration.
|
|
2934
|
+
* @param request - target id, delivery, minted identity, content, and optional browser zone.
|
|
3205
2935
|
* @param signal - carrier cancellation, owning the call until inbox acceptance.
|
|
3206
2936
|
* @returns the accepted message's inbox identity.
|
|
3207
2937
|
* @throws {RemoteError} `gateway/bad-request`, `subagent/attachment-invalid`,
|
|
3208
|
-
* `subagent/invalid-time-zone`,
|
|
2938
|
+
* `subagent/invalid-time-zone`,
|
|
3209
2939
|
* `subagent/not-resumable`, `subagent/unauthorized`,
|
|
3210
2940
|
* `subagent/delivery-unavailable`, `gateway/cancelled`, or `gateway/internal`.
|
|
3211
2941
|
*/
|
|
3212
2942
|
async prompt(request, signal) {
|
|
3213
|
-
const {
|
|
2943
|
+
const { childSessionId, clientTimeZone, delivery } = request;
|
|
3214
2944
|
validateControlRequest("subagent.prompt", request);
|
|
3215
2945
|
const canonicalTimeZone = clientTimeZone === void 0 ? void 0 : canonicalClientTimeZone(clientTimeZone);
|
|
3216
2946
|
if (clientTimeZone !== void 0 && canonicalTimeZone === void 0) throw new RemoteError("subagent/invalid-time-zone", "clientTimeZone must be UTC or a valid IANA Area/Location name", { value: clientTimeZone });
|
|
3217
|
-
const parent = this.ctx.get("agents")?.get(parentSessionId);
|
|
3218
|
-
if (parent === void 0) throw new RemoteError("subagent/parent-unavailable", `parent session "${parentSessionId}" is not live`, { parentSessionId });
|
|
3219
2947
|
const principal = principalOf(this.ctx.invocation);
|
|
3220
2948
|
const source = {
|
|
3221
2949
|
kind: "user",
|
|
@@ -3234,38 +2962,29 @@ let SubagentRuntime = (() => {
|
|
|
3234
2962
|
if (attachments === void 0) throw new Error("subagent image prompt requires an attachment store");
|
|
3235
2963
|
content = await attachments.admitPromptContent(request.content);
|
|
3236
2964
|
}
|
|
3237
|
-
return { messageId: await this
|
|
2965
|
+
return { messageId: await this.requireManager().deliverPrompt(childSessionId, content, {
|
|
2966
|
+
source,
|
|
2967
|
+
signal,
|
|
2968
|
+
delivery
|
|
2969
|
+
}) };
|
|
3238
2970
|
} catch (error) {
|
|
3239
2971
|
return rejectPrompt(error, childSessionId, signal);
|
|
3240
2972
|
}
|
|
3241
2973
|
}
|
|
3242
2974
|
/**
|
|
3243
|
-
* Remote face of {@link interrupt}
|
|
3244
|
-
* catalog, history, persistence, or parent Agent lookup runs
|
|
3245
|
-
* primitive alone authorizes the address against the live Activation, which
|
|
3246
|
-
* is what keeps a live child interruptible while its parent Agent is offline.
|
|
2975
|
+
* Remote face of {@link interrupt}, authorized on the target Session by the Gateway.
|
|
2976
|
+
* No catalog, history, persistence, or parent Agent lookup runs.
|
|
3247
2977
|
* Absent, idle, and already-completed targets are accepted no-ops there.
|
|
3248
2978
|
* @param childSessionId - durable child session id to interrupt.
|
|
3249
|
-
* @param parentSessionId - durable direct parent whose authority is claimed.
|
|
3250
|
-
* @param mode - required continuable-address discriminator.
|
|
3251
2979
|
* @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.
|
|
3252
2980
|
* @throws {RemoteError} `gateway/bad-request` for an empty id,
|
|
3253
|
-
* `subagent/unauthorized` when the address does not own the live target,
|
|
3254
2981
|
* otherwise `gateway/internal`.
|
|
3255
2982
|
*/
|
|
3256
|
-
|
|
3257
|
-
validateControlRequest("subagent.interrupt", {
|
|
3258
|
-
childSessionId,
|
|
3259
|
-
parentSessionId,
|
|
3260
|
-
mode
|
|
3261
|
-
});
|
|
2983
|
+
interruptByUser(childSessionId) {
|
|
2984
|
+
validateControlRequest("subagent.interrupt", { childSessionId });
|
|
3262
2985
|
try {
|
|
3263
|
-
this.interrupt(childSessionId, {
|
|
3264
|
-
kind: "user",
|
|
3265
|
-
parentSessionId
|
|
3266
|
-
});
|
|
2986
|
+
this.interrupt(childSessionId, { kind: "user" });
|
|
3267
2987
|
} catch (error) {
|
|
3268
|
-
if (error instanceof SubagentError && error.code === "UNAUTHORIZED") throw new RemoteError("subagent/unauthorized", "subagent does not belong to this parent", { childSessionId }, { cause: error });
|
|
3269
2988
|
throw new RemoteError("gateway/internal", "subagent interrupt failed", {}, { cause: error });
|
|
3270
2989
|
}
|
|
3271
2990
|
return { accepted: true };
|
|
@@ -3299,20 +3018,9 @@ let SubagentRuntime = (() => {
|
|
|
3299
3018
|
getProvider(name) {
|
|
3300
3019
|
return this.providers.get(name);
|
|
3301
3020
|
}
|
|
3302
|
-
/**
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
*/
|
|
3306
|
-
list() {
|
|
3307
|
-
return [...this.providers.keys()];
|
|
3308
|
-
}
|
|
3309
|
-
/**
|
|
3310
|
-
* Resolve one provider's detached continuable-creation contribution. Method
|
|
3311
|
-
* presence on the provider IS the capability, so a provider without it is
|
|
3312
|
-
* rejected before the manager reserves any child resources.
|
|
3313
|
-
*/
|
|
3314
|
-
async prepareContinuable(name, request) {
|
|
3315
|
-
return this.expectProvider(name).prepareContinuable(request);
|
|
3021
|
+
/** A pending start must use the exact provider whose capabilities were checked. */
|
|
3022
|
+
assertProviderCurrent(provider) {
|
|
3023
|
+
if (this.providers.get(provider.name) !== provider) throw new SubagentError(`subagent provider "${provider.name}" changed during startup; retry the delegation`, "PROVIDER_CHANGED");
|
|
3316
3024
|
}
|
|
3317
3025
|
/** Look up a provider for dispatch or fail loud. */
|
|
3318
3026
|
expectProvider(name) {
|
|
@@ -3325,13 +3033,6 @@ let SubagentRuntime = (() => {
|
|
|
3325
3033
|
if (this.manager === void 0) throw new SubagentError("continuable subagents require the agents service", "CONTINUATION_UNAVAILABLE");
|
|
3326
3034
|
return this.manager;
|
|
3327
3035
|
}
|
|
3328
|
-
/**
|
|
3329
|
-
* Build the lifecycle observer for one continuable Activation's residency
|
|
3330
|
-
* epoch, so the manager publishes its edges without owning event dispatch.
|
|
3331
|
-
*/
|
|
3332
|
-
observeActivation(provider, childId, parent) {
|
|
3333
|
-
return createActivationObserver(this.emitLifecycle, provider, childId, parent);
|
|
3334
|
-
}
|
|
3335
3036
|
/** Reject the first requested capability that the provider lacks. */
|
|
3336
3037
|
assertCapabilities(provider, request) {
|
|
3337
3038
|
if (request.agentPreset !== void 0 && (!provider.capabilities.agentPreset || provider.inheritsParentContext)) throw new SubagentError(`subagent provider "${provider.name}" does not support independent agent preset selection`, "UNSUPPORTED_CAPABILITY");
|