@songtonyli/dsh-cli 0.1.93 → 0.1.95
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 +22 -6
- 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 +14 -10
- 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 +21 -5
- 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 +838 -0
- package/node_modules/@deepseek-ai/dsh-agent-team/lib/typert.host.js +829 -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 +177 -0
- package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/task-board.js +55 -29
- package/node_modules/@deepseek-ai/{dsh-experimental-agent-team → dsh-agent-team}/lib/types/task-view.js +5 -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 +1095 -585
- 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 +8 -8
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +10 -5
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +10 -5
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +35 -53
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +98 -62
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +315 -299
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +260 -276
- 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/service.js +20 -5
- 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 +60 -20
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.js +48 -0
- 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 +7 -4
- 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 +79 -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 +21 -5
- 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 +3 -1
- package/node_modules/@deepseek-ai/dsh-base/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +32 -15
- package/node_modules/@deepseek-ai/dsh-base/package.json +104 -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 +21 -5
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js +125 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +14 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.i18n.yaml +19 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.md +16 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.zh.md +16 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/assets/breach-atlas-43c5305a3d4d.webp +0 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/client.js +395 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +13 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +129 -39
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/client.js +164 -40
- 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 +18 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +27 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +27 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +258 -101
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +37 -36
- 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/lib/client.js +1 -1
- 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 +187 -106
- 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 +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +6 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +6 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +99 -118
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +12 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +12 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +65 -58
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +26 -26
- 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 +9 -22
- 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/lib/client.js +175 -20
- 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 +4010 -446
- 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 +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +6 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.pdf.js +11 -3
- 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 +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +7 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +7 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +409 -60
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +32 -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 +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +8 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +8 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +78 -109
- 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/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-commands/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-commands/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-commands/lib/index.js +37 -2
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +42 -7
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.remote-client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-commands/lib/types/index.js +36 -2
- 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 +297 -85
- 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 +42 -10
- 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 +134 -0
- package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +134 -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 +1832 -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 +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +10 -8
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +10 -8
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +6469 -5811
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +142 -10
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +145 -31
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +103 -24
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/client.js +150 -136
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/index.js +200 -186
- 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 +13 -11
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.zh.md +13 -11
- 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 +7 -13
- 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 +21 -5
- 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 +18 -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 +21 -5
- 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 +21 -5
- 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 +19 -16
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +33 -7
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +34 -8
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +95 -41
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/persistent-process.js +528 -112
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/process.js +523 -109
- 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/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +40 -39
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session/README.zh.md +1 -1
- 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-continuation/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/README.md +84 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/README.zh.md +84 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/lib/index.js +109 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/lib/types/index.js +51 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/lib/types/projection.js +48 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/lib/types/types.js +2 -0
- package/node_modules/@deepseek-ai/dsh-session-continuation/package.json +55 -0
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/lib/index.js +19 -1
- 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/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-session-log-export/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-session-log-export/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +100 -120
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +95 -30
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +14 -14
- package/node_modules/@deepseek-ai/dsh-session-projection/README.md +11 -7
- package/node_modules/@deepseek-ai/dsh-session-projection/README.zh.md +11 -7
- 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 +21 -5
- 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 +46 -28
- package/node_modules/@deepseek-ai/dsh-subagent/README.md +52 -23
- package/node_modules/@deepseek-ai/dsh-subagent/README.zh.md +52 -23
- package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +838 -903
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +90 -124
- 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/catalog.js +31 -8
- 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 +22 -22
- 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 +125 -146
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/lifecycle.js +5 -31
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/list-children.js +35 -6
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +462 -570
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.js +96 -0
- 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/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-subagent-acp/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-acp/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.zh.md +3 -3
- 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 +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.zh.md +3 -3
- 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 +317 -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 +299 -188
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-executor-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.i18n.yaml +19 -16
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.md +22 -9
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.zh.md +22 -9
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/index.js +185 -74
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/config.js +2 -1
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/errors.js +25 -0
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/index.js +36 -6
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ptc-calls.js +57 -7
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ptc.js +29 -14
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +9 -9
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +9 -9
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +6 -6
- 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 +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +19 -17
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +18 -16
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +49 -47
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.i18n.yaml +58 -40
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.md +54 -22
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.zh.md +54 -22
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/index.js +196 -107
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +24 -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 +8 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +14 -10
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +14 -10
- package/node_modules/@deepseek-ai/dsh-tui-app/cordis.patch.yml +17 -0
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +557 -173
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +89 -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 +22 -6
- 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 +18 -10
- 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-CZZasi1N.css +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-CnyQSzND.js +199 -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 +348 -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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Service } from "@deepseek-ai/cordis";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
3
4
|
import { scopeTarget } from "@deepseek-ai/dsh-scope";
|
|
4
5
|
import { ToolArgsError, assertObjectJsonSchema, validateJsonSchemaValue } from "@deepseek-ai/dsh-tools";
|
|
5
6
|
import { canonicalClientTimeZone } from "@deepseek-ai/dsh-util-time";
|
|
@@ -7,10 +8,9 @@ import { Remote, RemoteError, TypertRemoteService, principalOf } from "@deepseek
|
|
|
7
8
|
import { AttachmentError } from "@deepseek-ai/dsh-attachment";
|
|
8
9
|
import { z as z$1 } from "zod";
|
|
9
10
|
import { HarnessError, ReasoningEffortId, boundContextSummary, contentHasImage, createUserMessage, errorChain, joinAssistantStreamText } from "@deepseek-ai/dsh-llm";
|
|
10
|
-
import { randomUUID } from "node:crypto";
|
|
11
11
|
import { foldConsumedWork } from "@deepseek-ai/dsh-agent";
|
|
12
|
+
import { randomUUID } from "node:crypto";
|
|
12
13
|
import { isAbsolute, resolve } from "node:path";
|
|
13
|
-
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
14
14
|
import { SessionLogOffset, SessionSeq } from "@deepseek-ai/dsh-session";
|
|
15
15
|
import { assertNever, snapshotJsonValue } from "@deepseek-ai/dsh-util-values";
|
|
16
16
|
import { appendChunkedList, chunkedListSchema, iterateChunkedList } from "@deepseek-ai/dsh-chunked-list";
|
|
@@ -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,43 +399,42 @@ 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.
|
|
404
|
+
* @param senderName - the sender's model-facing name in its subagent tree.
|
|
458
405
|
* @param content - model-visible message blocks supplied by the sender.
|
|
459
406
|
* @returns the durable user-message representation delivered to the recipient.
|
|
460
407
|
*/
|
|
461
|
-
function createAgentMessage(sender, content) {
|
|
408
|
+
function createAgentMessage(sender, senderName, content) {
|
|
462
409
|
return createUserMessage({
|
|
463
410
|
content: [{
|
|
464
411
|
type: "text",
|
|
465
|
-
text: `Agent ${
|
|
412
|
+
text: `Agent ${senderName} sent a message: `
|
|
466
413
|
}, ...content],
|
|
467
414
|
source: agentMessageSource(sender)
|
|
468
415
|
});
|
|
469
416
|
}
|
|
470
417
|
/**
|
|
471
|
-
* Append
|
|
472
|
-
* @param parentId - durable parent session id named in the guidance.
|
|
418
|
+
* Append automatic result-delivery guidance to a parent-delivered child's initial task.
|
|
473
419
|
* @param prompt - initial model-visible task blocks.
|
|
474
|
-
* @returns task blocks followed by the
|
|
420
|
+
* @returns task blocks followed by the result-delivery guidance.
|
|
475
421
|
*/
|
|
476
|
-
function
|
|
477
|
-
const encodedParentId = JSON.stringify(parentId);
|
|
422
|
+
function withResultDeliveryGuidance(prompt) {
|
|
478
423
|
return [...prompt, {
|
|
479
424
|
type: "text",
|
|
480
|
-
text:
|
|
425
|
+
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
426
|
}];
|
|
482
427
|
}
|
|
483
428
|
/**
|
|
484
429
|
* One line telling a parent that a background child is finished and why, in
|
|
485
430
|
* the parent's own task vocabulary.
|
|
486
|
-
* @param
|
|
431
|
+
* @param childName - the model-facing name the parent knows the child by.
|
|
487
432
|
* @param stopReason - how the child's last ordinary turn ended.
|
|
488
433
|
* @param continuable - whether the child accepts a later message.
|
|
489
434
|
* @returns the model-facing opening line of the settlement notice.
|
|
490
435
|
*/
|
|
491
|
-
function settlementSummary(
|
|
492
|
-
const subject = `Background subagent ${
|
|
436
|
+
function settlementSummary(childName, stopReason, continuable) {
|
|
437
|
+
const subject = `Background subagent ${childName}`;
|
|
493
438
|
switch (stopReason) {
|
|
494
439
|
case "completed": return continuable ? `${subject} finished and will do no further work unless you send it more.` : `${subject} finished. It cannot receive follow-up messages.`;
|
|
495
440
|
case "aborted": return `${subject} was stopped before it finished.`;
|
|
@@ -504,15 +449,16 @@ function settlementSummary(childId, stopReason, continuable) {
|
|
|
504
449
|
}
|
|
505
450
|
/**
|
|
506
451
|
* Build the runtime-owned settlement notice from the child's nonempty closing text.
|
|
507
|
-
* @param childId - durable child session id
|
|
452
|
+
* @param childId - durable child session id recorded as the sender.
|
|
453
|
+
* @param childName - model-facing child name used in the notice text.
|
|
508
454
|
* @param terminal - recorded terminal state for the settled Activation.
|
|
509
455
|
* @param continuable - whether the child can accept another task.
|
|
510
|
-
* @param omitClosingText - replace the closing text
|
|
511
|
-
*
|
|
456
|
+
* @param omitClosingText - replace the closing text when the child's last action
|
|
457
|
+
* was a message to its direct parent.
|
|
512
458
|
* @returns the durable user-message representation delivered to the parent.
|
|
513
459
|
*/
|
|
514
|
-
function createSettlementMessage(childId, terminal, continuable = true, omitClosingText = false) {
|
|
515
|
-
const summary = settlementSummary(
|
|
460
|
+
function createSettlementMessage(childId, childName, terminal, continuable = true, omitClosingText = false) {
|
|
461
|
+
const summary = settlementSummary(childName, terminal.stopReason, continuable);
|
|
516
462
|
const closingText = terminal.output.flatMap((block) => block.type === "text" && block.text.length > 0 ? [block] : []);
|
|
517
463
|
return createUserMessage({
|
|
518
464
|
content: [
|
|
@@ -543,11 +489,84 @@ function createSettlementMessage(childId, terminal, continuable = true, omitClos
|
|
|
543
489
|
kind: "subagent-settled",
|
|
544
490
|
form: "notice",
|
|
545
491
|
summary: boundContextSummary(summary),
|
|
492
|
+
stopReason: terminal.stopReason,
|
|
546
493
|
senderSessionId: childId
|
|
547
494
|
}
|
|
548
495
|
});
|
|
549
496
|
}
|
|
550
497
|
//#endregion
|
|
498
|
+
//#region lib/types/archive-admission.js
|
|
499
|
+
/**
|
|
500
|
+
* The `subagent` family of the Workspace registry's archive admission: which
|
|
501
|
+
* subagent descendants of a Session are still inside a turn, and how they
|
|
502
|
+
* stop when the Session is archived with its work. Archived ancestors also
|
|
503
|
+
* block later model steps, including when their Sessions have been released.
|
|
504
|
+
*
|
|
505
|
+
* @module @deepseek-ai/dsh-subagent
|
|
506
|
+
*/
|
|
507
|
+
/**
|
|
508
|
+
* Answer `workspace/session-activity` with the running subagent descendants of
|
|
509
|
+
* the asked Session, and `workspace/session-stop` by cancelling each of them
|
|
510
|
+
* as their parent would. Reject subsequent steps beneath archived ancestors.
|
|
511
|
+
* All listeners live as long as `ctx`'s fiber.
|
|
512
|
+
* @param ctx - context carrying the Agent registry.
|
|
513
|
+
* @param residentAncestors - verified creation ancestors for an exact managed Agent, absent before publication or for unmanaged Agents.
|
|
514
|
+
* @param identityOf - ready service-owned descriptor identity reader; absent or invalid descriptors yield no identity.
|
|
515
|
+
*/
|
|
516
|
+
function installSubagentArchiveAdmission(ctx, residentAncestors, identityOf) {
|
|
517
|
+
const ancestorsOf = (agent) => residentAncestors(agent) ?? headerAncestors(ctx, agent);
|
|
518
|
+
const runningDescendants = (sessionId) => ctx.agents.list().filter((agent) => agent.status === "running" && ancestorsOf(agent).includes(sessionId));
|
|
519
|
+
ctx.on("workspace/session-activity", async ({ sessionId }, next) => {
|
|
520
|
+
const running = runningDescendants(sessionId);
|
|
521
|
+
const rest = await next();
|
|
522
|
+
if (running.length === 0) return rest;
|
|
523
|
+
return [{
|
|
524
|
+
kind: "subagent",
|
|
525
|
+
items: running.map((child) => describe(child, identityOf(child.session)))
|
|
526
|
+
}, ...rest];
|
|
527
|
+
});
|
|
528
|
+
ctx.on("workspace/session-stop", ({ sessionId }) => {
|
|
529
|
+
for (const child of runningDescendants(sessionId)) try {
|
|
530
|
+
child.cancel({ kind: "parent" });
|
|
531
|
+
} catch (error) {
|
|
532
|
+
ctx.logger.warn(`subagent: cancelling "${child.id}" for an archived Session failed: ${String(error)}`);
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
ctx.on("agent/pre-step", ({ agent }, next) => {
|
|
536
|
+
const archived = ctx.get("workspaceRegistry")?.archivedSessionIds;
|
|
537
|
+
return archived !== void 0 && ancestorsOf(agent).some((id) => archived.includes(id)) ? Promise.resolve({ kind: "reject" }) : next();
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Header-only ancestry for Agents without a published Activation. Include an
|
|
542
|
+
* offline direct creator; ordinary forks stop the chain and cycles terminate.
|
|
543
|
+
*/
|
|
544
|
+
function headerAncestors(ctx, agent) {
|
|
545
|
+
const ancestors = [];
|
|
546
|
+
const visited = new Set([agent.id]);
|
|
547
|
+
let header = agent.session.header;
|
|
548
|
+
while (header.origin === "subagent" && header.parentSession !== void 0 && !visited.has(header.parentSession)) {
|
|
549
|
+
const parentId = header.parentSession;
|
|
550
|
+
ancestors.push(parentId);
|
|
551
|
+
visited.add(parentId);
|
|
552
|
+
const parent = ctx.agents.get(parentId)?.session;
|
|
553
|
+
if (parent === void 0) break;
|
|
554
|
+
header = parent.header;
|
|
555
|
+
}
|
|
556
|
+
return ancestors;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Report the child's current projected label only when its descriptor belongs
|
|
560
|
+
* to the child's own log; inherited, absent, or invalid identities yield the id alone.
|
|
561
|
+
*/
|
|
562
|
+
function describe(child, identity) {
|
|
563
|
+
const label = identity !== void 0 && child.session.isOwnSeq(identity.seq) ? identity.label : void 0;
|
|
564
|
+
return label === void 0 ? { id: child.id } : {
|
|
565
|
+
id: child.id,
|
|
566
|
+
label
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
//#endregion
|
|
551
570
|
//#region lib/types/descriptor.js
|
|
552
571
|
/**
|
|
553
572
|
* The durable subagent-child descriptor: the versioned, model-hidden
|
|
@@ -565,7 +584,7 @@ function createSettlementMessage(childId, terminal, continuable = true, omitClos
|
|
|
565
584
|
* to one activation's result contract rather than durable child composition.
|
|
566
585
|
* Per-activation knobs such as `maxTokens` are omitted for the same reason as
|
|
567
586
|
* `outputSchema`: they budget one activation. Cold resume requires the exact
|
|
568
|
-
* live
|
|
587
|
+
* live subagent tree root for authorization but reconstructs child options only from the
|
|
569
588
|
* durable descriptor, so it neither restores the prior budget nor inherits
|
|
570
589
|
* the parent's current one; the resumed route's defaults apply instead.
|
|
571
590
|
*
|
|
@@ -708,6 +727,91 @@ function foldSubagentDescriptor(events) {
|
|
|
708
727
|
if (event === void 0) return void 0;
|
|
709
728
|
return parseSubagentDescriptor(event.data);
|
|
710
729
|
}
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region lib/types/names.js
|
|
732
|
+
/**
|
|
733
|
+
* Model-facing agent names. Each child's name is unique among its creator's
|
|
734
|
+
* children and is recorded in the creator's catalog; a member's full name is
|
|
735
|
+
* the slash-separated path of names from the root, whose own name is `lead`.
|
|
736
|
+
*
|
|
737
|
+
* @module @deepseek-ai/dsh-subagent/names
|
|
738
|
+
*/
|
|
739
|
+
/** The root agent's fixed name; no child may take it. */
|
|
740
|
+
const ROOT_AGENT_NAME = "lead";
|
|
741
|
+
/** One lower-case segment of at most 32 characters, so a 36-character UUID never matches. */
|
|
742
|
+
const NAME_PATTERN = /^[a-z][a-z0-9-]{0,31}$/u;
|
|
743
|
+
/**
|
|
744
|
+
* Whether a string is a valid child name.
|
|
745
|
+
* @param value - candidate name segment.
|
|
746
|
+
* @returns true for 1–32 lower-case letters, digits, or hyphens starting with a letter, other than `lead`.
|
|
747
|
+
*/
|
|
748
|
+
function isAgentName(value) {
|
|
749
|
+
return NAME_PATTERN.test(value) && value !== "lead";
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Append a child's name to its creator's path. The root's path is the empty string.
|
|
753
|
+
* @param parentPath - the creator's path, or undefined when an ancestor below the root has no name.
|
|
754
|
+
* @param name - the child's catalog name, absent on historical entries.
|
|
755
|
+
* @returns the child's path, or undefined when any link is unnamed.
|
|
756
|
+
*/
|
|
757
|
+
function joinAgentPath(parentPath, name) {
|
|
758
|
+
if (parentPath === void 0 || name === void 0) return void 0;
|
|
759
|
+
return parentPath === "" ? name : `${parentPath}/${name}`;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Select the model-facing name of one tree member.
|
|
763
|
+
* @param path - the member's path; `''` for the root and undefined for unnamed history.
|
|
764
|
+
* @param id - the member's Session id, used when no complete path exists.
|
|
765
|
+
* @returns `lead`, the full path, or the Session id.
|
|
766
|
+
*/
|
|
767
|
+
function agentAddress(path, id) {
|
|
768
|
+
if (path === "") return ROOT_AGENT_NAME;
|
|
769
|
+
return path ?? id;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Remove the last name from a descendant path.
|
|
773
|
+
* @param path - a non-empty descendant path.
|
|
774
|
+
* @returns the creator's path; `''` when the creator is the root.
|
|
775
|
+
*/
|
|
776
|
+
function parentAgentPath(path) {
|
|
777
|
+
const separator = path.lastIndexOf("/");
|
|
778
|
+
return separator < 0 ? "" : path.slice(0, separator);
|
|
779
|
+
}
|
|
780
|
+
/** Names claimed by in-flight creations, keyed by the exact live creator. */
|
|
781
|
+
var SiblingNameReservations = class {
|
|
782
|
+
pending = /* @__PURE__ */ new Map();
|
|
783
|
+
/**
|
|
784
|
+
* Claim a name synchronously before startup awaits, so concurrent siblings cannot share it.
|
|
785
|
+
* @param parent - exact live creator whose catalog receives the name.
|
|
786
|
+
* @param committed - names already recorded in the creator's catalog.
|
|
787
|
+
* @param requested - requested name; omission selects the first free `agent-N`.
|
|
788
|
+
* @returns the claimed name and its release.
|
|
789
|
+
* @throws {@link SubagentError} `INVALID_AGENT_NAME` or `DUPLICATE_AGENT_NAME`.
|
|
790
|
+
*/
|
|
791
|
+
reserve(parent, committed, requested) {
|
|
792
|
+
const pending = this.pending.get(parent) ?? /* @__PURE__ */ new Set();
|
|
793
|
+
const taken = (name) => committed.has(name) || pending.has(name);
|
|
794
|
+
let name;
|
|
795
|
+
if (requested === void 0) {
|
|
796
|
+
let ordinal = 1;
|
|
797
|
+
while (taken(`agent-${ordinal}`)) ordinal++;
|
|
798
|
+
name = `agent-${ordinal}`;
|
|
799
|
+
} else {
|
|
800
|
+
if (!isAgentName(requested)) throw new SubagentError(`agent name ${JSON.stringify(requested)} is invalid; use 1-32 lower-case letters, digits, or hyphens starting with a letter, other than "${ROOT_AGENT_NAME}"`, "INVALID_AGENT_NAME");
|
|
801
|
+
if (taken(requested)) throw new SubagentError(`agent name ${JSON.stringify(requested)} is already used by another subagent you created; choose another name`, "DUPLICATE_AGENT_NAME");
|
|
802
|
+
name = requested;
|
|
803
|
+
}
|
|
804
|
+
pending.add(name);
|
|
805
|
+
this.pending.set(parent, pending);
|
|
806
|
+
return {
|
|
807
|
+
name,
|
|
808
|
+
release: () => {
|
|
809
|
+
pending.delete(name);
|
|
810
|
+
if (pending.size === 0 && this.pending.get(parent) === pending) this.pending.delete(parent);
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
};
|
|
711
815
|
const sessionIdSchema = z$1.string();
|
|
712
816
|
const oneShotCatalogSchema = z$1.object({
|
|
713
817
|
version: z$1.union([z$1.literal(0), z$1.literal(1)]),
|
|
@@ -731,11 +835,22 @@ const unknownCatalogSchema = oneShotCatalogSchema.extend({
|
|
|
731
835
|
version: z$1.literal(1),
|
|
732
836
|
mode: z$1.literal("unknown")
|
|
733
837
|
});
|
|
838
|
+
const nameSchema = z$1.string().refine(isAgentName, "invalid agent name");
|
|
839
|
+
const namedContinuableCatalogSchema = continuableCatalogSchema.extend({
|
|
840
|
+
version: z$1.literal(3),
|
|
841
|
+
name: nameSchema
|
|
842
|
+
});
|
|
843
|
+
const namedExternalCatalogSchema = externalCatalogSchema.extend({
|
|
844
|
+
version: z$1.literal(3),
|
|
845
|
+
name: nameSchema
|
|
846
|
+
});
|
|
734
847
|
const eventDataSchema = z$1.union([
|
|
735
848
|
oneShotCatalogSchema,
|
|
736
849
|
externalCatalogSchema,
|
|
737
850
|
continuableCatalogSchema,
|
|
738
|
-
unknownCatalogSchema
|
|
851
|
+
unknownCatalogSchema,
|
|
852
|
+
namedContinuableCatalogSchema,
|
|
853
|
+
namedExternalCatalogSchema
|
|
739
854
|
]);
|
|
740
855
|
const viewSchema = z$1.array(z$1.union([
|
|
741
856
|
oneShotCatalogSchema.omit({
|
|
@@ -752,7 +867,8 @@ const viewSchema = z$1.array(z$1.union([
|
|
|
752
867
|
childCreatedAt: true
|
|
753
868
|
}).extend({
|
|
754
869
|
id: sessionIdSchema,
|
|
755
|
-
createdAt: externalCatalogSchema.shape.childCreatedAt
|
|
870
|
+
createdAt: externalCatalogSchema.shape.childCreatedAt,
|
|
871
|
+
name: nameSchema.optional()
|
|
756
872
|
}),
|
|
757
873
|
continuableCatalogSchema.omit({
|
|
758
874
|
version: true,
|
|
@@ -760,7 +876,8 @@ const viewSchema = z$1.array(z$1.union([
|
|
|
760
876
|
childCreatedAt: true
|
|
761
877
|
}).extend({
|
|
762
878
|
id: sessionIdSchema,
|
|
763
|
-
createdAt: continuableCatalogSchema.shape.childCreatedAt
|
|
879
|
+
createdAt: continuableCatalogSchema.shape.childCreatedAt,
|
|
880
|
+
name: nameSchema.optional()
|
|
764
881
|
}),
|
|
765
882
|
unknownCatalogSchema.omit({
|
|
766
883
|
version: true,
|
|
@@ -792,7 +909,7 @@ function subagentCatalogEntries(state) {
|
|
|
792
909
|
}
|
|
793
910
|
return entries;
|
|
794
911
|
}
|
|
795
|
-
/** Parent-owned
|
|
912
|
+
/** Parent-owned catalog; version-6 checkpoints retain unnamed facts, and invalid own facts reject restoration. */
|
|
796
913
|
const subagentCatalogProjectionDefinition = {
|
|
797
914
|
key: "subagentCatalog",
|
|
798
915
|
stateSchema,
|
|
@@ -815,56 +932,63 @@ const subagentCatalogProjectionDefinition = {
|
|
|
815
932
|
* @param parent - durable direct parent receiving the discovery fact.
|
|
816
933
|
* @param child - established child's immutable Session metadata.
|
|
817
934
|
* @param descriptor - mode-discriminated creation label frozen with the child.
|
|
935
|
+
* @param name - the child's name, reserved unique among the parent's children.
|
|
818
936
|
*/
|
|
819
|
-
function establishCatalogChild(parent, child, descriptor) {
|
|
937
|
+
function establishCatalogChild(parent, child, descriptor, name) {
|
|
820
938
|
parent.append("subagent/catalog", {
|
|
821
|
-
version:
|
|
939
|
+
version: 3,
|
|
822
940
|
childId: child.id,
|
|
823
941
|
childCreatedAt: child.createdAt,
|
|
824
942
|
mode: descriptor.mode,
|
|
825
|
-
label: descriptor.label
|
|
943
|
+
label: descriptor.label,
|
|
944
|
+
name
|
|
826
945
|
});
|
|
827
946
|
}
|
|
828
|
-
/** Catalog payload version emitted by external execution creation. */
|
|
829
|
-
const EXTERNAL_SUBAGENT_CATALOG_VERSION = 2;
|
|
830
947
|
/**
|
|
831
948
|
* Record an external execution without a local child Session.
|
|
832
949
|
* @param parent - durable direct parent receiving the discovery fact.
|
|
833
950
|
* @param childId - identity returned by the external provider.
|
|
834
951
|
* @param label - display label assigned by the caller.
|
|
952
|
+
* @param name - the child's name, reserved unique among the parent's children.
|
|
835
953
|
*/
|
|
836
|
-
function establishExternalCatalogChild(parent, childId, label) {
|
|
954
|
+
function establishExternalCatalogChild(parent, childId, label, name) {
|
|
837
955
|
parent.append("subagent/catalog", {
|
|
838
|
-
version:
|
|
956
|
+
version: 3,
|
|
839
957
|
childId,
|
|
840
958
|
childCreatedAt: Date.now(),
|
|
841
959
|
mode: "external",
|
|
842
|
-
label
|
|
960
|
+
label,
|
|
961
|
+
name
|
|
843
962
|
});
|
|
844
963
|
}
|
|
845
|
-
//#endregion
|
|
846
|
-
//#region lib/types/internal.js
|
|
847
964
|
/**
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
* @
|
|
965
|
+
* Collect the names recorded in one parent's catalog.
|
|
966
|
+
* @param entries - the parent's current catalog rows.
|
|
967
|
+
* @returns names of every named child; historical entries contribute none.
|
|
851
968
|
*/
|
|
852
|
-
|
|
853
|
-
const
|
|
969
|
+
function catalogNames(entries) {
|
|
970
|
+
const names = /* @__PURE__ */ new Set();
|
|
971
|
+
for (const entry of entries) if ("name" in entry) names.add(entry.name);
|
|
972
|
+
return names;
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region lib/types/types.js
|
|
854
976
|
/**
|
|
855
|
-
*
|
|
856
|
-
* @
|
|
857
|
-
*
|
|
977
|
+
* The seam's consumer-facing contracts: request, result, and capability types
|
|
978
|
+
* for {@link SubagentProvider}, plus the `subagent/start` and `subagent/end`
|
|
979
|
+
* payloads that plugins and hosts observe. Internal control interfaces, such
|
|
980
|
+
* as the manager host, belong with their implementation.
|
|
981
|
+
*
|
|
982
|
+
* @module @deepseek-ai/dsh-subagent/types
|
|
858
983
|
*/
|
|
859
|
-
function isAdjacentAgentSendMessageTool(definition) {
|
|
860
|
-
return definition !== void 0 && definition[adjacentAgentSendMessageTool] === true;
|
|
861
|
-
}
|
|
862
984
|
/**
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
* @
|
|
985
|
+
* Brand a string as a {@link SubagentRunId}.
|
|
986
|
+
* @param id - the raw run id.
|
|
987
|
+
* @returns the same string, branded.
|
|
866
988
|
*/
|
|
867
|
-
|
|
989
|
+
function SubagentRunId(id) {
|
|
990
|
+
return id;
|
|
991
|
+
}
|
|
868
992
|
//#endregion
|
|
869
993
|
//#region lib/types/structured.js
|
|
870
994
|
/**
|
|
@@ -892,7 +1016,7 @@ const STRUCTURED_OUTPUT_INSTRUCTION = `When you have your final answer, you MUST
|
|
|
892
1016
|
* @param childCtx - the child agent's scope context (`setup`'s argument).
|
|
893
1017
|
* @param schema - the trusted, already-asserted schema subset to enforce (see
|
|
894
1018
|
* `assertObjectJsonSchema` in dsh-tools).
|
|
895
|
-
* @param canComplete - whether accepted input
|
|
1019
|
+
* @param canComplete - whether accepted input has been processed.
|
|
896
1020
|
* @returns the attachment handle (read `captured()` after the child settles).
|
|
897
1021
|
*/
|
|
898
1022
|
function attachStructuredRuntime(childCtx, schema, canComplete) {
|
|
@@ -934,7 +1058,7 @@ function attachStructuredRuntime(childCtx, schema, canComplete) {
|
|
|
934
1058
|
execute(args, exec) {
|
|
935
1059
|
const violations = validateJsonSchemaValue(schema, args);
|
|
936
1060
|
if (violations.length > 0) throw new ToolArgsError(violations);
|
|
937
|
-
if (!canComplete()) throw new Error("
|
|
1061
|
+
if (!canComplete()) throw new Error("Process pending messages before submitting structured output.");
|
|
938
1062
|
staged.set(exec, { value: args });
|
|
939
1063
|
exec.concludeTurn();
|
|
940
1064
|
return Promise.resolve({ recorded: true });
|
|
@@ -1044,7 +1168,7 @@ function finalAssistantOutput(events) {
|
|
|
1044
1168
|
/** Execution-period records, capacity slots, child serialization, and local output capture.
|
|
1045
1169
|
* @module @deepseek-ai/dsh-subagent/activation
|
|
1046
1170
|
*/
|
|
1047
|
-
/** Process-local
|
|
1171
|
+
/** Process-local capacity shared by every member of a subagent tree. */
|
|
1048
1172
|
var ActivationPool = class {
|
|
1049
1173
|
slots = /* @__PURE__ */ new Set();
|
|
1050
1174
|
/**
|
|
@@ -1150,11 +1274,11 @@ var ChildLock = class {
|
|
|
1150
1274
|
/**
|
|
1151
1275
|
* Owns subagent startup, message admission, cold resume, and execution lifetimes.
|
|
1152
1276
|
* One child lock orders input acceptance and closure; one activation map owns
|
|
1153
|
-
* capacity,
|
|
1277
|
+
* capacity, runtime ownership, and resource release across all providers.
|
|
1154
1278
|
*
|
|
1155
1279
|
* @module @deepseek-ai/dsh-subagent/manager
|
|
1156
1280
|
*/
|
|
1157
|
-
var __addDisposableResource$
|
|
1281
|
+
var __addDisposableResource$1 = function(env, value, async) {
|
|
1158
1282
|
if (value !== null && value !== void 0) {
|
|
1159
1283
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1160
1284
|
var dispose, inner;
|
|
@@ -1183,7 +1307,7 @@ var __addDisposableResource$2 = function(env, value, async) {
|
|
|
1183
1307
|
} else if (async) env.stack.push({ async: true });
|
|
1184
1308
|
return value;
|
|
1185
1309
|
};
|
|
1186
|
-
var __disposeResources$
|
|
1310
|
+
var __disposeResources$1 = (function(SuppressedError) {
|
|
1187
1311
|
return function(env) {
|
|
1188
1312
|
function fail(e) {
|
|
1189
1313
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
@@ -1231,18 +1355,15 @@ var SubagentManager = class {
|
|
|
1231
1355
|
locks = new ChildLock();
|
|
1232
1356
|
/** Structural Cordis owner of every Activation handle. */
|
|
1233
1357
|
ownerCtx;
|
|
1234
|
-
/**
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
* poisoning a later same-id replacement.
|
|
1239
|
-
*/
|
|
1240
|
-
closingScopes = /* @__PURE__ */ new Map();
|
|
1358
|
+
/** Exact subagent tree roots whose host teardown has closed admission. */
|
|
1359
|
+
closingRoots = /* @__PURE__ */ new Set();
|
|
1360
|
+
/** Sibling names held by creations that have not committed their catalog entry. */
|
|
1361
|
+
names = new SiblingNameReservations();
|
|
1241
1362
|
draining = false;
|
|
1242
1363
|
/**
|
|
1243
1364
|
* Build one manager inside the service's Agent-injected context.
|
|
1244
1365
|
* @param ctx - context providing Agents, Sessions, and teardown ownership.
|
|
1245
|
-
* @param host -
|
|
1366
|
+
* @param host - descriptor reads and lifecycle publication owned by the service.
|
|
1246
1367
|
* @param maxActiveSubagents - the current configured child capacity.
|
|
1247
1368
|
*/
|
|
1248
1369
|
constructor(ctx, host, maxActiveSubagents) {
|
|
@@ -1251,8 +1372,12 @@ var SubagentManager = class {
|
|
|
1251
1372
|
this.maxActiveSubagents = maxActiveSubagents;
|
|
1252
1373
|
const scope = ctx.plugin(function activationOwner() {});
|
|
1253
1374
|
this.ownerCtx = scope.ctx;
|
|
1375
|
+
installSubagentArchiveAdmission(ctx, (agent) => {
|
|
1376
|
+
const activation = this.resident.get(agent.id);
|
|
1377
|
+
return activation !== void 0 && activationAgent(activation) === agent ? activation.ancestors : void 0;
|
|
1378
|
+
}, (session) => host.identityOf(session));
|
|
1254
1379
|
ctx.on("agent/disposed", ({ agent }) => {
|
|
1255
|
-
this.
|
|
1380
|
+
this.closingRoots.delete(agent);
|
|
1256
1381
|
});
|
|
1257
1382
|
ctx.effect(function* () {
|
|
1258
1383
|
yield scope.dispose;
|
|
@@ -1262,7 +1387,7 @@ var SubagentManager = class {
|
|
|
1262
1387
|
/**
|
|
1263
1388
|
* Interrupt one live continuable child's current turn under the supplied authority.
|
|
1264
1389
|
* @param targetSessionId - the durable child session id to interrupt.
|
|
1265
|
-
* @param authority -
|
|
1390
|
+
* @param authority - a trusted user operation or exact live ancestor Agent.
|
|
1266
1391
|
*/
|
|
1267
1392
|
interrupt(targetSessionId, authority) {
|
|
1268
1393
|
if (authority.kind === "ancestor") {
|
|
@@ -1272,9 +1397,7 @@ var SubagentManager = class {
|
|
|
1272
1397
|
}
|
|
1273
1398
|
const activation = this.resident.get(targetSessionId);
|
|
1274
1399
|
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");
|
|
1400
|
+
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
1401
|
if (activation.closing !== void 0) return;
|
|
1279
1402
|
const kind = authority.kind === "user" ? "user" : "parent";
|
|
1280
1403
|
if (activation.kind === "local") activation.handle.agent.cancel({ kind }, { keepInbox: true });
|
|
@@ -1285,28 +1408,25 @@ var SubagentManager = class {
|
|
|
1285
1408
|
}
|
|
1286
1409
|
/**
|
|
1287
1410
|
* Close admission, await every already-admitted materialization through
|
|
1288
|
-
* publication or rollback, then dispose
|
|
1289
|
-
* child-first.
|
|
1411
|
+
* publication or rollback, then dispose every agent in the subagent tree.
|
|
1290
1412
|
*/
|
|
1291
1413
|
async drain() {
|
|
1292
1414
|
this.draining = true;
|
|
1293
1415
|
for (const pending of this.materializations) pending.controller.abort();
|
|
1294
1416
|
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)");
|
|
1417
|
+
await this.disposeRoots([...this.resident.values()], "activation(s)");
|
|
1299
1418
|
}
|
|
1300
1419
|
/**
|
|
1301
|
-
* Join progressing
|
|
1302
|
-
* @param
|
|
1303
|
-
* @returns whether work was joined and the host must recheck
|
|
1420
|
+
* Join progressing subagent tree work for its root, leaving idle parked inboxes resident.
|
|
1421
|
+
* @param root - exact live subagent tree root; ordinary members return false.
|
|
1422
|
+
* @returns whether work was joined and the host must recheck root completion.
|
|
1304
1423
|
*/
|
|
1305
|
-
async
|
|
1424
|
+
async waitForTreeWork(root) {
|
|
1425
|
+
if (this.rootOf(root) !== root) return false;
|
|
1306
1426
|
let observed = false;
|
|
1307
1427
|
while (true) {
|
|
1308
|
-
const pending = [...this.materializations].filter((item) => item.
|
|
1309
|
-
const children = [...this.resident.values()].filter((item) =>
|
|
1428
|
+
const pending = [...this.materializations].filter((item) => item.root === root);
|
|
1429
|
+
const children = [...this.resident.values()].filter((item) => item.root === root);
|
|
1310
1430
|
observed ||= children.some((item) => item.kind === "local" && item.handle.agent.status !== "idle");
|
|
1311
1431
|
await Promise.all(children.flatMap((item) => item.kind === "local" ? [item.handle.agent.whenIdle()] : []));
|
|
1312
1432
|
const waits = pending.map((item) => item.settled);
|
|
@@ -1319,10 +1439,6 @@ var SubagentManager = class {
|
|
|
1319
1439
|
waits.push(item.handle.agent.whenIdle());
|
|
1320
1440
|
continue;
|
|
1321
1441
|
}
|
|
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
1442
|
const inbox = item.handle.agent.inbox;
|
|
1327
1443
|
if (item.failureAt === void 0 && (inbox.nextTurn.length > 0 || inbox.nextStep.length > 0)) continue;
|
|
1328
1444
|
waits.push(Promise.race([item.result.promise.catch(() => void 0), item.poke.promise]));
|
|
@@ -1332,114 +1448,84 @@ var SubagentManager = class {
|
|
|
1332
1448
|
await Promise.all(waits);
|
|
1333
1449
|
continue;
|
|
1334
1450
|
}
|
|
1335
|
-
if ([...this.materializations].some((item) => item.
|
|
1451
|
+
if ([...this.materializations].some((item) => item.root === root && !pending.includes(item)) || [...this.resident.values()].some((item) => item.root === root && !children.includes(item))) continue;
|
|
1336
1452
|
return observed;
|
|
1337
1453
|
}
|
|
1338
1454
|
}
|
|
1339
1455
|
/**
|
|
1340
|
-
* Stop the
|
|
1341
|
-
* @param parents - exact live roots whose
|
|
1456
|
+
* Stop every member of the selected subagent trees; ordinary members do not close a subagent tree.
|
|
1457
|
+
* @param parents - exact live subagent tree roots whose instances must stop.
|
|
1342
1458
|
*/
|
|
1343
1459
|
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)");
|
|
1460
|
+
const roots = new Set(parents.filter((root) => this.ctx.agents.get(root.id) === root && this.rootOf(root) === root));
|
|
1461
|
+
for (const root of roots) this.closingRoots.add(root);
|
|
1462
|
+
const pending = [...this.materializations].filter((item) => roots.has(item.root));
|
|
1463
|
+
for (const item of pending) item.controller.abort();
|
|
1464
|
+
const targets = [...this.resident.values()].filter((item) => roots.has(item.root));
|
|
1465
|
+
const disposal = this.disposeRoots(targets, "scoped activation(s)");
|
|
1466
|
+
const [disposed] = await Promise.allSettled([disposal, ...pending.map((item) => item.settled)]);
|
|
1467
|
+
if (disposed.status === "rejected") throw disposed.reason;
|
|
1392
1468
|
}
|
|
1393
1469
|
/**
|
|
1394
1470
|
* Start one continuable background child and resolve at initial inbox acceptance.
|
|
1395
1471
|
* Every earlier failure disposes any created handle and rolls back Activation
|
|
1396
|
-
* and
|
|
1472
|
+
* and its capacity slot without returning either id.
|
|
1397
1473
|
* @param spec - provider, delegation request, and caller cancellation.
|
|
1474
|
+
* @param prepare - creation contribution bound to the checked provider.
|
|
1398
1475
|
* @returns the durable child id and accepted initial prompt message id.
|
|
1399
1476
|
*/
|
|
1400
|
-
async startLocal(spec) {
|
|
1401
|
-
const
|
|
1402
|
-
const parent = request.parent;
|
|
1477
|
+
async startLocal(spec, prepare) {
|
|
1478
|
+
const parent = spec.parent;
|
|
1403
1479
|
this.assertAdmitting(parent);
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
const
|
|
1407
|
-
this.assertChildIdAvailable(childId);
|
|
1408
|
-
const childDepth = resolveChildDepth(parent, request.maxDepth);
|
|
1409
|
-
const agentOptions = resolveChildAgentOptions(parent, request.agentOptions, childDepth);
|
|
1410
|
-
const agentProvider = agentOptions.provider;
|
|
1411
|
-
const agentModel = agentOptions.model;
|
|
1412
|
-
const agentReasoningEffort = agentOptions.reasoningEffort;
|
|
1413
|
-
const descriptor = snapshotSubagentDescriptor({
|
|
1414
|
-
mode: "continuable",
|
|
1415
|
-
provider: spec.provider,
|
|
1416
|
-
label: spec.label,
|
|
1417
|
-
...agentProvider !== void 0 ? { agentProvider } : {},
|
|
1418
|
-
...agentModel !== void 0 ? { agentModel } : {},
|
|
1419
|
-
...agentReasoningEffort !== void 0 ? { agentReasoningEffort } : {}
|
|
1420
|
-
});
|
|
1421
|
-
const delegatedPolicies = captureDelegatedPolicyOverrides(parent);
|
|
1422
|
-
const releaseHold = this.holdOwnership(parent, childId);
|
|
1480
|
+
const ancestry = this.ancestryForChild(parent);
|
|
1481
|
+
const reservation = this.reserveName(parent, spec.name);
|
|
1482
|
+
const path = joinAgentPath(this.pathOf(parent, ancestry.root), reservation.name);
|
|
1423
1483
|
try {
|
|
1424
|
-
|
|
1425
|
-
|
|
1484
|
+
return await this.startLocalNamed(spec, prepare, ancestry, reservation, path);
|
|
1485
|
+
} finally {
|
|
1486
|
+
reservation.release();
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
/** Create one local child under a name reserved before any await. */
|
|
1490
|
+
startLocalNamed(spec, prepare, ancestry, reservation, path) {
|
|
1491
|
+
const parent = spec.parent;
|
|
1492
|
+
return this.trackStartup(ancestry.root, spec.signal, async (signal) => {
|
|
1493
|
+
const persistence = spec.delivery === "caller" ? this.ctx.get("sessionPersistence") : this.requirePersistence();
|
|
1494
|
+
const childId = spec.childId ?? brandString(randomUUID());
|
|
1495
|
+
this.assertChildIdAvailable(childId);
|
|
1496
|
+
const childDepth = resolveChildDepth(parent, spec.maxDepth);
|
|
1497
|
+
const agentOptions = resolveChildAgentOptions(parent, spec.agentOptions, childDepth);
|
|
1498
|
+
const agentProvider = agentOptions.provider;
|
|
1499
|
+
const agentModel = agentOptions.model;
|
|
1500
|
+
const agentReasoningEffort = agentOptions.reasoningEffort;
|
|
1501
|
+
const descriptor = snapshotSubagentDescriptor({
|
|
1502
|
+
mode: "continuable",
|
|
1503
|
+
provider: spec.provider,
|
|
1504
|
+
label: spec.label,
|
|
1505
|
+
...agentProvider !== void 0 ? { agentProvider } : {},
|
|
1506
|
+
...agentModel !== void 0 ? { agentModel } : {},
|
|
1507
|
+
...agentReasoningEffort !== void 0 ? { agentReasoningEffort } : {}
|
|
1508
|
+
});
|
|
1509
|
+
const delegatedPolicies = captureDelegatedPolicyOverrides(parent);
|
|
1510
|
+
const cwd = await this.resolveDirectory(spec, signal);
|
|
1511
|
+
const prepared = await prepare({
|
|
1426
1512
|
sessionId: childId,
|
|
1427
1513
|
cwd,
|
|
1428
1514
|
parent,
|
|
1429
|
-
signal
|
|
1515
|
+
signal
|
|
1430
1516
|
});
|
|
1431
|
-
|
|
1517
|
+
signal.throwIfAborted();
|
|
1432
1518
|
this.assertAdmitting(parent);
|
|
1433
1519
|
const inheritedEventCount = SessionLogOffset(prepared.seed?.length ?? 0);
|
|
1434
1520
|
const seed = prepared.seed;
|
|
1435
1521
|
let established;
|
|
1436
1522
|
const messageId = await this.locks.run(childId, async () => {
|
|
1437
|
-
|
|
1523
|
+
signal.throwIfAborted();
|
|
1438
1524
|
this.assertAdmitting(parent);
|
|
1439
1525
|
this.assertChildIdAvailable(childId);
|
|
1440
1526
|
if (spec.childId !== void 0) {
|
|
1441
|
-
const persisted = await persistence?.stat(childId, { signal
|
|
1442
|
-
|
|
1527
|
+
const persisted = await persistence?.stat(childId, { signal });
|
|
1528
|
+
signal.throwIfAborted();
|
|
1443
1529
|
this.assertAdmitting(parent);
|
|
1444
1530
|
this.assertChildIdAvailable(childId);
|
|
1445
1531
|
if (persisted !== void 0) throw new SubagentError(`subagent "${childId}" already exists`, "DUPLICATE_CHILD");
|
|
@@ -1448,30 +1534,35 @@ var SubagentManager = class {
|
|
|
1448
1534
|
kind: "local",
|
|
1449
1535
|
childId,
|
|
1450
1536
|
provider: spec.provider,
|
|
1451
|
-
|
|
1537
|
+
...ancestry,
|
|
1538
|
+
path,
|
|
1452
1539
|
create: {
|
|
1540
|
+
parent,
|
|
1453
1541
|
cwd,
|
|
1454
1542
|
seed,
|
|
1455
|
-
meta: childSessionMeta(parent, childDepth, prepared.seed !== void 0,
|
|
1543
|
+
meta: childSessionMeta(parent, childDepth, prepared.seed !== void 0, spec.agentPreset),
|
|
1456
1544
|
inheritedEventCount,
|
|
1457
1545
|
delegatedPolicies,
|
|
1458
1546
|
descriptor
|
|
1459
1547
|
},
|
|
1460
1548
|
agentOptions,
|
|
1461
|
-
composition: { agentPreset:
|
|
1462
|
-
signal
|
|
1549
|
+
composition: { agentPreset: spec.agentPreset },
|
|
1550
|
+
signal,
|
|
1463
1551
|
delivery: spec.delivery,
|
|
1464
|
-
outputSchema: spec.
|
|
1552
|
+
outputSchema: spec.outputSchema
|
|
1465
1553
|
});
|
|
1466
1554
|
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, {
|
|
1555
|
+
const childHeader = requireLocalActivation(activation).handle.agent.session.header;
|
|
1556
|
+
return await this.submitMaterialized(activation, spec.delivery !== "caller" ? withResultDeliveryGuidance(spec.prompt) : spec.prompt, {
|
|
1470
1557
|
source: { kind: "user" },
|
|
1471
|
-
signal
|
|
1472
|
-
delivery: "queue"
|
|
1473
|
-
|
|
1474
|
-
|
|
1558
|
+
signal,
|
|
1559
|
+
delivery: "queue",
|
|
1560
|
+
authorize: () => {
|
|
1561
|
+
this.assertAdmitting(parent);
|
|
1562
|
+
}
|
|
1563
|
+
}, ancestry.root, () => {
|
|
1564
|
+
this.assertAdmitting(parent);
|
|
1565
|
+
establishCatalogChild(parent.session, childHeader, descriptor, reservation.name);
|
|
1475
1566
|
});
|
|
1476
1567
|
});
|
|
1477
1568
|
return {
|
|
@@ -1479,55 +1570,63 @@ var SubagentManager = class {
|
|
|
1479
1570
|
childId,
|
|
1480
1571
|
messageId
|
|
1481
1572
|
};
|
|
1482
|
-
}
|
|
1483
|
-
releaseHold();
|
|
1484
|
-
throw error;
|
|
1485
|
-
}
|
|
1573
|
+
});
|
|
1486
1574
|
}
|
|
1487
1575
|
/**
|
|
1488
1576
|
* Start an external backend under activation ownership.
|
|
1489
1577
|
* @param spec - task, provider, cancellation, and delivery policy.
|
|
1578
|
+
* @param start - execution bound to the checked provider.
|
|
1490
1579
|
* @returns the accepted activation and its result/disposal capabilities.
|
|
1491
1580
|
*/
|
|
1492
|
-
async startExternal(spec) {
|
|
1493
|
-
const parent = spec
|
|
1581
|
+
async startExternal(spec, start) {
|
|
1582
|
+
const { delivery, name: requestedName, parent } = spec;
|
|
1494
1583
|
this.assertAdmitting(parent);
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
|
|
1584
|
+
const ancestry = this.ancestryForChild(parent);
|
|
1585
|
+
if (delivery === "caller" && requestedName !== void 0) throw new SubagentError("agent names require a cataloged child; caller-delivered external runs are not cataloged", "UNSUPPORTED_CAPABILITY");
|
|
1586
|
+
const reservation = delivery === "parent" ? this.reserveName(parent, requestedName) : void 0;
|
|
1587
|
+
const path = joinAgentPath(this.pathOf(parent, ancestry.root), reservation?.name);
|
|
1498
1588
|
try {
|
|
1499
|
-
|
|
1500
|
-
activation = await this.materialize({
|
|
1501
|
-
kind: "external",
|
|
1502
|
-
childId: pendingId,
|
|
1503
|
-
provider: spec.provider,
|
|
1504
|
-
parent,
|
|
1505
|
-
signal: spec.signal,
|
|
1506
|
-
delivery: spec.delivery,
|
|
1507
|
-
start: (signal) => this.host.startExternal(spec.provider, {
|
|
1508
|
-
...spec.request,
|
|
1509
|
-
cwd,
|
|
1510
|
-
label: spec.label,
|
|
1511
|
-
signal
|
|
1512
|
-
})
|
|
1513
|
-
});
|
|
1514
|
-
this.assertAdmitting(parent);
|
|
1515
|
-
this.assertLiveParent(parent, activation.childId);
|
|
1516
|
-
spec.signal.throwIfAborted();
|
|
1517
|
-
if (spec.delivery === "parent") establishExternalCatalogChild(parent.session, activation.childId, spec.label);
|
|
1518
|
-
this.announce(activation);
|
|
1519
|
-
return this.receipt(activation);
|
|
1520
|
-
} catch (error) {
|
|
1521
|
-
if (activation !== void 0) try {
|
|
1522
|
-
await this.dispose(activation);
|
|
1523
|
-
} catch (cleanupError) {
|
|
1524
|
-
this.ctx.logger.warn(`subagent "${activation.childId}" admission rollback failed: ${failureMessage(cleanupError)}`);
|
|
1525
|
-
}
|
|
1526
|
-
throw error;
|
|
1589
|
+
return await this.startExternalNamed(spec, start, ancestry, reservation, path);
|
|
1527
1590
|
} finally {
|
|
1528
|
-
|
|
1591
|
+
reservation?.release();
|
|
1529
1592
|
}
|
|
1530
1593
|
}
|
|
1594
|
+
/** Start one external execution, cataloging parent-delivered runs under their reserved name. */
|
|
1595
|
+
startExternalNamed(spec, start, ancestry, reservation, path) {
|
|
1596
|
+
const { provider, delivery, childId: _childId, name: _name, ...request } = spec;
|
|
1597
|
+
const parent = request.parent;
|
|
1598
|
+
return this.trackStartup(ancestry.root, spec.signal, async (signal) => {
|
|
1599
|
+
let activation;
|
|
1600
|
+
try {
|
|
1601
|
+
const cwd = await this.resolveDirectory(spec, signal);
|
|
1602
|
+
activation = await this.materialize({
|
|
1603
|
+
kind: "external",
|
|
1604
|
+
provider,
|
|
1605
|
+
...ancestry,
|
|
1606
|
+
path,
|
|
1607
|
+
signal,
|
|
1608
|
+
delivery,
|
|
1609
|
+
start: (signal) => start({
|
|
1610
|
+
...request,
|
|
1611
|
+
cwd,
|
|
1612
|
+
signal
|
|
1613
|
+
})
|
|
1614
|
+
});
|
|
1615
|
+
this.assertAdmitting(parent);
|
|
1616
|
+
signal.throwIfAborted();
|
|
1617
|
+
if (reservation !== void 0) establishExternalCatalogChild(parent.session, activation.childId, spec.label, reservation.name);
|
|
1618
|
+
this.accept(activation);
|
|
1619
|
+
return this.receipt(activation);
|
|
1620
|
+
} catch (error) {
|
|
1621
|
+
if (activation !== void 0) try {
|
|
1622
|
+
await this.dispose(activation);
|
|
1623
|
+
} catch (cleanupError) {
|
|
1624
|
+
this.ctx.logger.warn(`subagent "${activation.childId}" admission rollback failed: ${failureMessage(cleanupError)}`);
|
|
1625
|
+
}
|
|
1626
|
+
throw error;
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1531
1630
|
/** Capture the explicit or inherited directory while the parent still owns startup. */
|
|
1532
1631
|
async resolveDirectory(request, signal) {
|
|
1533
1632
|
const cwd = request.cwd !== void 0 && isAbsolute(request.cwd) ? request.cwd : resolve(await this.ctx.workingDirectory.ensure(request.parent, signal), request.cwd ?? ".");
|
|
@@ -1535,60 +1634,156 @@ var SubagentManager = class {
|
|
|
1535
1634
|
return cwd;
|
|
1536
1635
|
}
|
|
1537
1636
|
/**
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
*
|
|
1541
|
-
* @
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1637
|
+
* Resolve the live subagent tree root from runtime ownership, independent of creator residency.
|
|
1638
|
+
* @param caller - exact live Agent selecting the subagent tree.
|
|
1639
|
+
* @returns the live subagent tree root.
|
|
1640
|
+
* @throws when the caller has no active runtime owner.
|
|
1641
|
+
*/
|
|
1642
|
+
rootOf(caller) {
|
|
1643
|
+
if (this.ctx.agents.get(caller.id) !== caller) throw new SubagentError("subagent tree access requires the exact live caller", "UNAUTHORIZED");
|
|
1644
|
+
const identity = this.host.identityOf(caller.session);
|
|
1645
|
+
const delegated = caller.session.header.origin === "subagent" || identity != null && caller.session.isOwnSeq(identity.seq);
|
|
1646
|
+
const activation = this.resident.get(caller.id);
|
|
1647
|
+
if (activation !== void 0 && activationAgent(activation) === caller && this.ctx.agents.get(activation.root.id) === activation.root) return activation.root;
|
|
1648
|
+
if (delegated || activation !== void 0) throw new SubagentError("agent has no active runtime owner", "UNAUTHORIZED");
|
|
1649
|
+
return caller;
|
|
1650
|
+
}
|
|
1651
|
+
/** Capture creation ancestry separately from the root that owns the new instance. */
|
|
1652
|
+
ancestryForChild(creator) {
|
|
1653
|
+
return {
|
|
1654
|
+
root: this.rootOf(creator),
|
|
1655
|
+
ancestors: [...this.resident.get(creator.id)?.ancestors ?? [], creator.id]
|
|
1656
|
+
};
|
|
1657
|
+
}
|
|
1658
|
+
/** Claim a sibling name against the creator's committed catalog and in-flight siblings. */
|
|
1659
|
+
reserveName(parent, requested) {
|
|
1660
|
+
return this.names.reserve(parent, catalogNames(this.host.catalogOf(parent.session)), requested);
|
|
1661
|
+
}
|
|
1662
|
+
/** Path of an exact live tree member: `''` for the root, undefined for unnamed history. */
|
|
1663
|
+
pathOf(member, root) {
|
|
1664
|
+
return member === root ? "" : this.resident.get(member.id)?.path;
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Report the model-facing names of a live member and its direct creator.
|
|
1668
|
+
* @param agent - exact live root or resident tree member.
|
|
1669
|
+
* @returns `lead` for the root, otherwise the member's and creator's names or Session ids.
|
|
1670
|
+
* @throws when the caller has no active runtime owner.
|
|
1671
|
+
*/
|
|
1672
|
+
namesOf(agent) {
|
|
1673
|
+
const root = this.rootOf(agent);
|
|
1674
|
+
if (root === agent) return { self: ROOT_AGENT_NAME };
|
|
1675
|
+
const activation = this.resident.get(agent.id);
|
|
1676
|
+
const parentId = activation.ancestors.at(-1);
|
|
1677
|
+
const parentPath = activation.path === void 0 ? parentId === root.id ? "" : this.resident.get(parentId)?.path : parentAgentPath(activation.path);
|
|
1678
|
+
return {
|
|
1679
|
+
self: agentAddress(activation.path, agent.id),
|
|
1680
|
+
parent: agentAddress(parentPath, parentId)
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Deliver to another agent in the subagent tree, restoring only the target when absent.
|
|
1685
|
+
* @param sender - exact live root or resident continuable Agent.
|
|
1686
|
+
* @param targetId - another member's durable Session id.
|
|
1687
|
+
* @param content - model-authored message blocks.
|
|
1688
|
+
* @param options - cancellation before inbox acceptance.
|
|
1689
|
+
* @returns the accepted inbox message id.
|
|
1546
1690
|
*/
|
|
1547
1691
|
async sendMessage(sender, targetId, content, options) {
|
|
1548
|
-
|
|
1692
|
+
options.signal.throwIfAborted();
|
|
1693
|
+
const root = this.rootOf(sender);
|
|
1694
|
+
if (sender.id === targetId) throw new SubagentError("send_message requires another agent in the subagent tree", "UNAUTHORIZED");
|
|
1549
1695
|
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, {
|
|
1696
|
+
const message = createAgentMessage(sender, agentAddress(this.pathOf(sender, root), sender.id), content);
|
|
1697
|
+
const activation = this.resident.get(sender.id);
|
|
1698
|
+
return this.deliverToMember(root, targetId, [...message.content], {
|
|
1557
1699
|
signal: options.signal,
|
|
1558
|
-
delivery: "steer"
|
|
1700
|
+
delivery: "steer",
|
|
1701
|
+
source: message.source,
|
|
1702
|
+
authorize: () => {
|
|
1703
|
+
this.assertAdmitting(sender);
|
|
1704
|
+
},
|
|
1705
|
+
onAccepted: () => {
|
|
1706
|
+
if (activation?.kind === "local" && activation.ancestors.at(-1) === targetId) activation.omitClosingText = true;
|
|
1707
|
+
}
|
|
1559
1708
|
});
|
|
1560
1709
|
}
|
|
1561
|
-
/**
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1710
|
+
/** Resolve the live owner through verified creation edges without activating ancestors. */
|
|
1711
|
+
async resolveCreationAncestry(source, signal, root) {
|
|
1712
|
+
const ancestors = [];
|
|
1713
|
+
const names = [];
|
|
1714
|
+
const seen = new Set([source.header.id]);
|
|
1715
|
+
let { header, projections, inheritedEventCount } = source;
|
|
1716
|
+
const pathFromRoot = () => names.reduce(joinAgentPath, "");
|
|
1717
|
+
while (true) {
|
|
1718
|
+
const env_1 = {
|
|
1719
|
+
stack: [],
|
|
1720
|
+
error: void 0,
|
|
1721
|
+
hasError: false
|
|
1722
|
+
};
|
|
1723
|
+
try {
|
|
1724
|
+
signal.throwIfAborted();
|
|
1725
|
+
const parentId = header.parentSession;
|
|
1726
|
+
const identity = projections?.values.subagent;
|
|
1727
|
+
if (parentId === void 0 || identity == null || identity.seq < inheritedEventCount) break;
|
|
1728
|
+
if (seen.has(parentId)) throw new SubagentError("cyclic subagent creation ancestry", "UNAUTHORIZED");
|
|
1729
|
+
seen.add(parentId);
|
|
1730
|
+
const parent = __addDisposableResource$1(env_1, await this.observeContinuation(parentId, signal), false);
|
|
1731
|
+
const entry = parent.projections?.values.subagentCatalog?.find((entry) => entry.id === header.id);
|
|
1732
|
+
if (entry === void 0) throw new SubagentError("subagent is absent from its creator catalog", "UNAUTHORIZED");
|
|
1733
|
+
ancestors.unshift(parentId);
|
|
1734
|
+
names.unshift("name" in entry ? entry.name : void 0);
|
|
1735
|
+
if (parentId === root?.id) return {
|
|
1736
|
+
root,
|
|
1737
|
+
ancestors,
|
|
1738
|
+
path: pathFromRoot()
|
|
1739
|
+
};
|
|
1740
|
+
({header, projections, inheritedEventCount} = parent);
|
|
1741
|
+
} catch (e_1) {
|
|
1742
|
+
env_1.error = e_1;
|
|
1743
|
+
env_1.hasError = true;
|
|
1744
|
+
} finally {
|
|
1745
|
+
__disposeResources$1(env_1);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
if (root === void 0 && ancestors.length > 0 && header.origin !== "subagent") {
|
|
1749
|
+
const owner = this.ctx.agents.get(header.id);
|
|
1750
|
+
if (owner === void 0 || this.rootOf(owner) !== owner) throw new SubagentError("subagent tree root is not live", "CONTINUATION_UNAVAILABLE");
|
|
1751
|
+
return {
|
|
1752
|
+
root: owner,
|
|
1753
|
+
ancestors,
|
|
1754
|
+
path: pathFromRoot()
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
throw new SubagentError(`agent "${source.header.id}" is not a member of this subagent tree`, "UNAUTHORIZED");
|
|
1576
1758
|
}
|
|
1577
1759
|
/**
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
* @param childId - durable
|
|
1760
|
+
* Deliver one host-authored prompt through the target's live subagent tree root.
|
|
1761
|
+
* Remote callers must be authorized for the target Session before invoking this operation.
|
|
1762
|
+
* @param childId - durable continuable subagent session id.
|
|
1581
1763
|
* @param content - model-visible prompt blocks.
|
|
1582
|
-
* @param
|
|
1583
|
-
* @param signal - caller cancellation before inbox acceptance.
|
|
1764
|
+
* @param options - inbox destination, durable attribution, and cancellation before acceptance.
|
|
1584
1765
|
* @returns the accepted durable message id.
|
|
1585
1766
|
*/
|
|
1586
|
-
async
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1767
|
+
async deliverPrompt(childId, content, options) {
|
|
1768
|
+
options.signal.throwIfAborted();
|
|
1769
|
+
let root = this.resident.get(childId)?.root;
|
|
1770
|
+
if (root === void 0) {
|
|
1771
|
+
const env_2 = {
|
|
1772
|
+
stack: [],
|
|
1773
|
+
error: void 0,
|
|
1774
|
+
hasError: false
|
|
1775
|
+
};
|
|
1776
|
+
try {
|
|
1777
|
+
const source = __addDisposableResource$1(env_2, await this.observeContinuation(childId, options.signal), false);
|
|
1778
|
+
({root} = await this.resolveCreationAncestry(source, options.signal));
|
|
1779
|
+
} catch (e_2) {
|
|
1780
|
+
env_2.error = e_2;
|
|
1781
|
+
env_2.hasError = true;
|
|
1782
|
+
} finally {
|
|
1783
|
+
__disposeResources$1(env_2);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
return this.deliverToMember(root, childId, content, options);
|
|
1592
1787
|
}
|
|
1593
1788
|
/** Admit local input synchronously before any teardown can begin. */
|
|
1594
1789
|
deliver(activation, message, delivery) {
|
|
@@ -1606,32 +1801,6 @@ var SubagentManager = class {
|
|
|
1606
1801
|
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
1802
|
}
|
|
1608
1803
|
/**
|
|
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
1804
|
* Apply activation admission to a resident parent before delivering input.
|
|
1636
1805
|
* @param parent - exact live Agent receiving the message.
|
|
1637
1806
|
* @param message - durable user message to deliver.
|
|
@@ -1651,27 +1820,16 @@ var SubagentManager = class {
|
|
|
1651
1820
|
else parent.followup(message);
|
|
1652
1821
|
}
|
|
1653
1822
|
/**
|
|
1654
|
-
* Reject new
|
|
1655
|
-
* @param agent - exact live
|
|
1823
|
+
* Reject new work from closing members or subagent trees.
|
|
1824
|
+
* @param agent - exact live caller whose instance and subagent tree must admit work.
|
|
1656
1825
|
*/
|
|
1657
1826
|
assertAdmitting(agent) {
|
|
1658
1827
|
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");
|
|
1828
|
+
if (closing === void 0) {
|
|
1829
|
+
if (this.resident.get(agent.id)?.closing !== void 0) throw new SubagentError(`subagent "${agent.id}" is closing`, "ACTIVATION_CLOSING");
|
|
1830
|
+
return;
|
|
1831
|
+
}
|
|
1832
|
+
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
1833
|
}
|
|
1676
1834
|
/**
|
|
1677
1835
|
* Create or resume one child Agent and publish its Activation.
|
|
@@ -1679,25 +1837,28 @@ var SubagentManager = class {
|
|
|
1679
1837
|
* @returns the published process-local Activation.
|
|
1680
1838
|
*/
|
|
1681
1839
|
materialize(inputs) {
|
|
1682
|
-
this.assertAdmitting(inputs.
|
|
1840
|
+
this.assertAdmitting(inputs.root);
|
|
1683
1841
|
inputs.signal.throwIfAborted();
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
|
|
1842
|
+
const releaseSlot = this.rootPool(inputs.root).reserve(this.maxActiveSubagents());
|
|
1843
|
+
return this.materializeTracked(inputs, releaseSlot).catch((error) => {
|
|
1844
|
+
releaseSlot();
|
|
1845
|
+
throw error;
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
/** Keep subagent tree shutdown and host waits joined to preparation, publication, and rollback. */
|
|
1849
|
+
trackStartup(root, signal, start) {
|
|
1850
|
+
this.assertAdmitting(root);
|
|
1851
|
+
signal.throwIfAborted();
|
|
1687
1852
|
const settled = Promise.withResolvers();
|
|
1688
1853
|
const controller = new AbortController();
|
|
1689
1854
|
const materialization = {
|
|
1690
|
-
|
|
1855
|
+
root,
|
|
1691
1856
|
settled: settled.promise,
|
|
1692
1857
|
controller
|
|
1693
1858
|
};
|
|
1694
1859
|
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);
|
|
1860
|
+
return start(AbortSignal.any([signal, controller.signal])).catch((error) => {
|
|
1861
|
+
if (error instanceof Error && error.name === "AbortError") this.assertAdmitting(root);
|
|
1701
1862
|
throw error;
|
|
1702
1863
|
}).finally(() => {
|
|
1703
1864
|
this.materializations.delete(materialization);
|
|
@@ -1732,35 +1893,13 @@ var SubagentManager = class {
|
|
|
1732
1893
|
}))).filter((failure) => failure !== void 0);
|
|
1733
1894
|
if (reasons.length > 0) throw new SubagentError(`subagent teardown failed for ${reasons.length} ${failureSubject}: ` + reasons.map((reason) => failureMessage(reason)).join("; "), "ACTIVATION_TEARDOWN_FAILED");
|
|
1734
1895
|
}
|
|
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. */
|
|
1896
|
+
/** Return the subagent tree teardown that closed admission for this exact Agent. */
|
|
1758
1897
|
closingTeardownFor(agent) {
|
|
1759
1898
|
if (this.draining) return "manager";
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1899
|
+
const root = this.rootOf(agent);
|
|
1900
|
+
return this.closingRoots.has(root) ? root : void 0;
|
|
1762
1901
|
}
|
|
1763
|
-
/**
|
|
1902
|
+
/** Share one capacity pool across every instance in a subagent tree. */
|
|
1764
1903
|
rootPool(parent) {
|
|
1765
1904
|
let pool = this.rootPools.get(parent);
|
|
1766
1905
|
if (pool === void 0) {
|
|
@@ -1770,9 +1909,8 @@ var SubagentManager = class {
|
|
|
1770
1909
|
return pool;
|
|
1771
1910
|
}
|
|
1772
1911
|
/** Perform one tracked materialization through publication or rollback. */
|
|
1773
|
-
async materializeTracked(inputs,
|
|
1774
|
-
const { provider,
|
|
1775
|
-
let childId = inputs.childId;
|
|
1912
|
+
async materializeTracked(inputs, releaseSlot) {
|
|
1913
|
+
const { provider, root } = inputs;
|
|
1776
1914
|
inputs.signal.throwIfAborted();
|
|
1777
1915
|
let resource;
|
|
1778
1916
|
if (inputs.kind === "external") {
|
|
@@ -1789,9 +1927,8 @@ var SubagentManager = class {
|
|
|
1789
1927
|
controller
|
|
1790
1928
|
};
|
|
1791
1929
|
run.result.catch(() => void 0);
|
|
1792
|
-
childId = run.id;
|
|
1793
1930
|
try {
|
|
1794
|
-
this.assertChildIdAvailable(
|
|
1931
|
+
this.assertChildIdAvailable(run.id);
|
|
1795
1932
|
} catch (error) {
|
|
1796
1933
|
await run.dispose();
|
|
1797
1934
|
throw error;
|
|
@@ -1800,14 +1937,14 @@ var SubagentManager = class {
|
|
|
1800
1937
|
inputs.signal.removeEventListener("abort", cancelStartup);
|
|
1801
1938
|
}
|
|
1802
1939
|
} else {
|
|
1803
|
-
const { create } = inputs;
|
|
1940
|
+
const { create, childId } = inputs;
|
|
1804
1941
|
let structured;
|
|
1805
1942
|
const setup = async (childCtx, child) => {
|
|
1806
|
-
if (inputs.composition.agentPreset !== void 0) await applyChildComposition(childCtx, parent, inputs.composition);
|
|
1943
|
+
if (inputs.composition.agentPreset !== void 0) await applyChildComposition(childCtx, create?.parent, inputs.composition);
|
|
1807
1944
|
if (create !== void 0) {
|
|
1808
1945
|
const { provider, model, reasoningEffort } = inputs.agentOptions;
|
|
1809
1946
|
const inherited = child.model.current();
|
|
1810
|
-
if (provider !== void 0 && model !== void 0 && (inherited?.provider !== provider || inherited.model !== model)) child.model.select({
|
|
1947
|
+
if (provider !== void 0 && model !== void 0 && (inherited?.provider !== provider || inherited.model !== model || inherited.reasoningEffort !== reasoningEffort)) child.model.select({
|
|
1811
1948
|
provider,
|
|
1812
1949
|
model,
|
|
1813
1950
|
...reasoningEffort === void 0 ? {} : { reasoningEffort }
|
|
@@ -1819,18 +1956,16 @@ var SubagentManager = class {
|
|
|
1819
1956
|
if (workingDirectory === void 0) throw new Error("local subagents require the working-directory service");
|
|
1820
1957
|
await workingDirectory.set(child, create.cwd, inputs.signal);
|
|
1821
1958
|
}
|
|
1822
|
-
if (inputs.composition.agentPreset === void 0) await applyChildComposition(childCtx, parent, inputs.composition);
|
|
1823
|
-
if (inputs.outputSchema !== void 0) structured = attachStructuredRuntime(childCtx, inputs.outputSchema, () =>
|
|
1959
|
+
if (inputs.composition.agentPreset === void 0) await applyChildComposition(childCtx, create?.parent, inputs.composition);
|
|
1960
|
+
if (inputs.outputSchema !== void 0) structured = attachStructuredRuntime(childCtx, inputs.outputSchema, () => child.inbox.nextStep.length === 0 && child.inbox.nextTurn.length === 0);
|
|
1824
1961
|
};
|
|
1825
1962
|
const handle = create === void 0 ? await this.ownerCtx.agents.resume({
|
|
1826
1963
|
resumeSessionId: childId,
|
|
1827
|
-
parentAgent: parent,
|
|
1828
1964
|
agentOptions: inputs.agentOptions,
|
|
1829
1965
|
signal: inputs.signal,
|
|
1830
1966
|
setup
|
|
1831
1967
|
}) : await this.ownerCtx.agents.create({
|
|
1832
1968
|
sessionId: childId,
|
|
1833
|
-
parentAgent: parent,
|
|
1834
1969
|
meta: create.meta,
|
|
1835
1970
|
...create.seed === void 0 ? {} : { seed: create.seed },
|
|
1836
1971
|
inheritedEventCount: create.inheritedEventCount,
|
|
@@ -1848,28 +1983,26 @@ var SubagentManager = class {
|
|
|
1848
1983
|
omitClosingText: false
|
|
1849
1984
|
};
|
|
1850
1985
|
}
|
|
1851
|
-
const
|
|
1986
|
+
const childId = resource.kind === "local" ? resource.handle.agent.id : resource.run.id;
|
|
1852
1987
|
const activation = {
|
|
1853
|
-
pool,
|
|
1854
1988
|
releaseSlot,
|
|
1855
1989
|
childId,
|
|
1990
|
+
runId: SubagentRunId(randomUUID()),
|
|
1991
|
+
provider,
|
|
1856
1992
|
...resource,
|
|
1857
|
-
|
|
1993
|
+
root,
|
|
1994
|
+
ancestors: inputs.ancestors,
|
|
1995
|
+
path: inputs.path,
|
|
1858
1996
|
delivery: inputs.delivery ?? "parent",
|
|
1859
1997
|
result: Promise.withResolvers(),
|
|
1860
1998
|
closing: void 0,
|
|
1861
|
-
|
|
1862
|
-
ownedChildren: /* @__PURE__ */ new Set(),
|
|
1863
|
-
observer,
|
|
1864
|
-
announced: false
|
|
1999
|
+
accepted: false
|
|
1865
2000
|
};
|
|
1866
2001
|
activation.result.promise.catch(() => void 0);
|
|
1867
2002
|
this.resident.set(childId, activation);
|
|
1868
2003
|
try {
|
|
1869
|
-
this.assertAdmitting(
|
|
2004
|
+
this.assertAdmitting(root);
|
|
1870
2005
|
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
2006
|
const wakeSettlement = () => {
|
|
1874
2007
|
this.wake(activation);
|
|
1875
2008
|
};
|
|
@@ -1885,7 +2018,7 @@ var SubagentManager = class {
|
|
|
1885
2018
|
if (event.type === "tool/call") activation.omitClosingText = false;
|
|
1886
2019
|
});
|
|
1887
2020
|
}
|
|
1888
|
-
|
|
2021
|
+
this.host.emitLifecycle("subagent/start", this.runInfo(activation), root);
|
|
1889
2022
|
} catch (error) {
|
|
1890
2023
|
/* v8 ignore next -- rollback failure must not mask the admission failure
|
|
1891
2024
|
* that prevented this operation from returning an accepted message id. */
|
|
@@ -1894,13 +2027,19 @@ var SubagentManager = class {
|
|
|
1894
2027
|
}
|
|
1895
2028
|
return activation;
|
|
1896
2029
|
}
|
|
1897
|
-
/**
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
2030
|
+
/** Identity shared by one residency epoch's start/end pair, including cold resumes. */
|
|
2031
|
+
runInfo(activation) {
|
|
2032
|
+
return {
|
|
2033
|
+
runId: activation.runId,
|
|
2034
|
+
provider: activation.provider,
|
|
2035
|
+
parentSessionId: activation.ancestors.at(-1),
|
|
2036
|
+
id: activation.childId,
|
|
2037
|
+
local: activation.kind === "local"
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
/** Record acceptance and begin settlement observation before returning the receipt. */
|
|
2041
|
+
accept(activation) {
|
|
2042
|
+
activation.accepted = true;
|
|
1904
2043
|
if (activation.kind === "local") this.watchLocalSettlement(activation);
|
|
1905
2044
|
else {
|
|
1906
2045
|
const finish = () => this.close(activation, () => this.finishDisposal(activation, false));
|
|
@@ -1917,23 +2056,10 @@ var SubagentManager = class {
|
|
|
1917
2056
|
} finally {
|
|
1918
2057
|
this.resident.delete(activation.childId);
|
|
1919
2058
|
activation.releaseSlot();
|
|
1920
|
-
this.releaseOwnership(activation.childId);
|
|
1921
2059
|
activation.result.reject(error);
|
|
1922
2060
|
}
|
|
1923
2061
|
});
|
|
1924
2062
|
}
|
|
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
2063
|
/** Let a settlement watcher re-check residency after relevant state changes. */
|
|
1938
2064
|
wake(activation) {
|
|
1939
2065
|
if (activation.kind === "external") return;
|
|
@@ -1988,16 +2114,15 @@ var SubagentManager = class {
|
|
|
1988
2114
|
reportTeardownFailure(activation, error) {
|
|
1989
2115
|
this.ctx.logger.warn(`subagent "${activation.childId}" activation teardown failed: ${failureMessage(error)}`);
|
|
1990
2116
|
}
|
|
1991
|
-
/** Check pending input
|
|
2117
|
+
/** Check pending input before closing admission. */
|
|
1992
2118
|
settlementState(activation, observation) {
|
|
1993
2119
|
if (activation.closing !== void 0) return "closed";
|
|
1994
2120
|
if (activation.poke !== observation) return "retry";
|
|
1995
2121
|
const inbox = activation.handle.agent.inbox;
|
|
1996
|
-
if (activation.ownedChildren.size > 0) return "wait";
|
|
1997
2122
|
if (activation.failureAt === void 0 && (inbox.nextTurn.length > 0 || inbox.nextStep.length > 0)) return "wait";
|
|
1998
2123
|
return "ready";
|
|
1999
2124
|
}
|
|
2000
|
-
/**
|
|
2125
|
+
/** Stop and release one instance without affecting its creation descendants. */
|
|
2001
2126
|
async finishDisposal(activation, stop) {
|
|
2002
2127
|
this.wake(activation);
|
|
2003
2128
|
const { childId } = activation;
|
|
@@ -2021,22 +2146,7 @@ var SubagentManager = class {
|
|
|
2021
2146
|
} else {
|
|
2022
2147
|
if (stop) {
|
|
2023
2148
|
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;
|
|
2149
|
+
await activation.handle.agent.whenIdle();
|
|
2040
2150
|
await this.flushFinalState(activation);
|
|
2041
2151
|
}
|
|
2042
2152
|
result = captureLocalResult(activation);
|
|
@@ -2061,19 +2171,23 @@ var SubagentManager = class {
|
|
|
2061
2171
|
stopReason: "error"
|
|
2062
2172
|
};
|
|
2063
2173
|
this.notifySettlement(activation, result);
|
|
2064
|
-
this.
|
|
2065
|
-
|
|
2174
|
+
this.host.emitLifecycle("subagent/end", {
|
|
2175
|
+
...this.runInfo(activation),
|
|
2176
|
+
stopReason: terminal.stopReason,
|
|
2177
|
+
...terminal.output.length === 0 ? {} : { lastAssistantMessage: terminal.output }
|
|
2178
|
+
}, activation.root);
|
|
2066
2179
|
if (resultFailure === void 0) activation.result.resolve(result);
|
|
2067
2180
|
else activation.result.reject(resultFailure.error);
|
|
2068
2181
|
if (failure !== void 0) throw failure;
|
|
2069
2182
|
}
|
|
2070
2183
|
/** Deliver the captured execution result to the durable direct parent after cleanup. */
|
|
2071
2184
|
notifySettlement(activation, terminal) {
|
|
2072
|
-
if (!activation.
|
|
2185
|
+
if (!activation.accepted || activation.delivery === "caller") return;
|
|
2073
2186
|
try {
|
|
2074
|
-
const
|
|
2075
|
-
|
|
2076
|
-
|
|
2187
|
+
const parentId = activation.ancestors.at(-1);
|
|
2188
|
+
const parent = this.ctx.agents.get(parentId);
|
|
2189
|
+
if (parent === void 0 || this.rootOf(parent) !== activation.root) return;
|
|
2190
|
+
const message = createSettlementMessage(activation.childId, agentAddress(activation.path, activation.childId), terminal, activation.kind === "local", activation.kind === "local" && activation.omitClosingText);
|
|
2077
2191
|
if (this.closingTeardownFor(parent) !== void 0) {
|
|
2078
2192
|
parent.inject(message);
|
|
2079
2193
|
return;
|
|
@@ -2095,128 +2209,106 @@ var SubagentManager = class {
|
|
|
2095
2209
|
receipt(activation) {
|
|
2096
2210
|
return {
|
|
2097
2211
|
childId: activation.childId,
|
|
2212
|
+
name: agentAddress(activation.path, activation.childId),
|
|
2098
2213
|
result: activation.result.promise,
|
|
2099
2214
|
dispose: () => this.dispose(activation)
|
|
2100
2215
|
};
|
|
2101
2216
|
}
|
|
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) {
|
|
2217
|
+
/** Serialize target restoration and inbox admission; closure is awaited outside the lock. */
|
|
2218
|
+
async deliverToMember(root, childId, content, options) {
|
|
2115
2219
|
while (true) {
|
|
2116
|
-
|
|
2220
|
+
this.assertAdmitting(root);
|
|
2221
|
+
options.signal.throwIfAborted();
|
|
2222
|
+
const result = await this.locks.run(childId, async () => {
|
|
2223
|
+
if (childId === root.id) {
|
|
2224
|
+
if (contentHasImage(content)) await this.assertImageCapable(root, options.signal);
|
|
2225
|
+
options.signal.throwIfAborted();
|
|
2226
|
+
options.authorize?.();
|
|
2227
|
+
this.assertAdmitting(root);
|
|
2228
|
+
const message = createUserMessage({
|
|
2229
|
+
content,
|
|
2230
|
+
source: options.source
|
|
2231
|
+
});
|
|
2232
|
+
this.sendWaking(root, message, options.delivery);
|
|
2233
|
+
options.onAccepted?.();
|
|
2234
|
+
return { messageId: message.id };
|
|
2235
|
+
}
|
|
2117
2236
|
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
|
-
}
|
|
2237
|
+
if (activation === void 0) {
|
|
2238
|
+
const restored = await this.restoreTarget(root, childId, options.signal);
|
|
2239
|
+
return { messageId: await this.submitMaterialized(restored, content, options, root) };
|
|
2130
2240
|
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2241
|
+
if (activation.root !== root) throw new SubagentError("target belongs to another subagent tree", "UNAUTHORIZED");
|
|
2242
|
+
requireLocalActivation(activation);
|
|
2243
|
+
if (activation.closing === void 0 && contentHasImage(content)) await this.assertImageCapable(requireLocalActivation(activation).handle.agent, options.signal);
|
|
2244
|
+
if (activation.closing !== void 0) return { closing: activation.closing };
|
|
2245
|
+
return { messageId: this.submitAdmitted(activation, content, options, root) };
|
|
2134
2246
|
});
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
this.assertAdmitting(parent);
|
|
2138
|
-
options.signal.throwIfAborted();
|
|
2247
|
+
if ("messageId" in result) return result.messageId;
|
|
2248
|
+
await Promise.allSettled([result.closing]);
|
|
2139
2249
|
}
|
|
2140
2250
|
}
|
|
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) {
|
|
2251
|
+
/** Read continuation history, preserving cancellation and reporting unavailable storage. */
|
|
2252
|
+
async observeContinuation(childId, signal) {
|
|
2253
|
+
const query = this.requireSessionQuery();
|
|
2155
2254
|
try {
|
|
2156
|
-
|
|
2255
|
+
return await query.observeSession(childId, { signal });
|
|
2157
2256
|
} catch (error) {
|
|
2158
|
-
|
|
2257
|
+
signal.throwIfAborted();
|
|
2258
|
+
throw new SubagentError(`subagent "${childId}" is unavailable`, "NOT_RESUMABLE", { cause: error });
|
|
2159
2259
|
}
|
|
2160
2260
|
}
|
|
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;
|
|
2261
|
+
/** Reconstruct only the target under its subagent tree root; the caller owns acceptance or rollback. */
|
|
2262
|
+
async restoreTarget(root, childId, signal) {
|
|
2263
|
+
return this.trackStartup(root, signal, async (signal) => {
|
|
2264
|
+
const env_3 = {
|
|
2265
|
+
stack: [],
|
|
2266
|
+
error: void 0,
|
|
2267
|
+
hasError: false
|
|
2268
|
+
};
|
|
2187
2269
|
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
|
-
|
|
2270
|
+
const source = __addDisposableResource$1(env_3, await this.observeContinuation(childId, signal), false);
|
|
2271
|
+
this.assertAdmitting(root);
|
|
2272
|
+
const descriptor = foldSubagentDescriptor(source.events.slice(source.inheritedEventCount));
|
|
2273
|
+
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");
|
|
2274
|
+
const { ancestors, path } = await this.resolveCreationAncestry(source, signal, root);
|
|
2275
|
+
let activation;
|
|
2276
|
+
try {
|
|
2277
|
+
const projectedPreset = source.projections?.values.agentPreset;
|
|
2278
|
+
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");
|
|
2279
|
+
const agentPreset = projectedPreset ?? source.header.agentPreset;
|
|
2280
|
+
activation = await this.materialize({
|
|
2281
|
+
kind: "local",
|
|
2282
|
+
childId,
|
|
2283
|
+
provider: descriptor.provider,
|
|
2284
|
+
root,
|
|
2285
|
+
ancestors,
|
|
2286
|
+
path,
|
|
2287
|
+
agentOptions: {
|
|
2288
|
+
...descriptor.agentProvider !== void 0 ? { provider: descriptor.agentProvider } : {},
|
|
2289
|
+
...descriptor.agentModel !== void 0 ? { model: descriptor.agentModel } : {},
|
|
2290
|
+
...descriptor.agentReasoningEffort !== void 0 ? { reasoningEffort: ReasoningEffortId(descriptor.agentReasoningEffort) } : {}
|
|
2291
|
+
},
|
|
2292
|
+
composition: {
|
|
2293
|
+
agentPreset: agentPreset ?? void 0,
|
|
2294
|
+
persona: descriptor.persona,
|
|
2295
|
+
toolFilter: descriptor.toolFilter
|
|
2296
|
+
},
|
|
2297
|
+
signal
|
|
2298
|
+
});
|
|
2299
|
+
} catch (error) {
|
|
2300
|
+
signal.throwIfAborted();
|
|
2301
|
+
if (error instanceof SubagentError) throw error;
|
|
2302
|
+
throw new SubagentError(`subagent "${childId}" is unavailable`, "NOT_RESUMABLE", { cause: error });
|
|
2303
|
+
}
|
|
2304
|
+
return activation;
|
|
2305
|
+
} catch (e_3) {
|
|
2306
|
+
env_3.error = e_3;
|
|
2307
|
+
env_3.hasError = true;
|
|
2308
|
+
} finally {
|
|
2309
|
+
__disposeResources$1(env_3);
|
|
2212
2310
|
}
|
|
2213
|
-
|
|
2214
|
-
} catch (e_1) {
|
|
2215
|
-
env_1.error = e_1;
|
|
2216
|
-
env_1.hasError = true;
|
|
2217
|
-
} finally {
|
|
2218
|
-
__disposeResources$2(env_1);
|
|
2219
|
-
}
|
|
2311
|
+
});
|
|
2220
2312
|
}
|
|
2221
2313
|
/** Admit a materialized child, commit its creation fact, and release it on failure. */
|
|
2222
2314
|
async submitMaterialized(activation, content, options, parent, commit) {
|
|
@@ -2227,7 +2319,7 @@ var SubagentManager = class {
|
|
|
2227
2319
|
}
|
|
2228
2320
|
const messageId = this.submitAdmitted(activation, content, options, parent);
|
|
2229
2321
|
commit?.();
|
|
2230
|
-
this.
|
|
2322
|
+
this.accept(activation);
|
|
2231
2323
|
return messageId;
|
|
2232
2324
|
} catch (error) {
|
|
2233
2325
|
try {
|
|
@@ -2240,19 +2332,19 @@ var SubagentManager = class {
|
|
|
2240
2332
|
}
|
|
2241
2333
|
/** Build and submit one message across the final synchronous admission cutoff. */
|
|
2242
2334
|
submitAdmitted(activation, content, options, parent) {
|
|
2243
|
-
const message =
|
|
2335
|
+
const message = createUserMessage({
|
|
2244
2336
|
content,
|
|
2245
2337
|
source: options.source
|
|
2246
2338
|
});
|
|
2247
2339
|
options.signal.throwIfAborted();
|
|
2340
|
+
options.authorize?.();
|
|
2248
2341
|
this.assertAdmitting(parent);
|
|
2249
|
-
this.authorizeLineage(parent, activation.childId, activation.parent.id);
|
|
2250
|
-
this.acquireOwnership(parent, activation.childId);
|
|
2251
2342
|
try {
|
|
2252
2343
|
this.deliver(activation, message, options.delivery);
|
|
2253
2344
|
} finally {
|
|
2254
2345
|
this.wake(activation);
|
|
2255
2346
|
}
|
|
2347
|
+
options.onAccepted?.();
|
|
2256
2348
|
return message.id;
|
|
2257
2349
|
}
|
|
2258
2350
|
/** Refuse image content for a child whose fixed model accepts text only. */
|
|
@@ -2278,15 +2370,6 @@ var SubagentManager = class {
|
|
|
2278
2370
|
return query;
|
|
2279
2371
|
}
|
|
2280
2372
|
};
|
|
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
2373
|
//#endregion
|
|
2291
2374
|
//#region lib/types/list-children.js
|
|
2292
2375
|
/**
|
|
@@ -2294,7 +2377,7 @@ function hasIndependentPresetSelection(events) {
|
|
|
2294
2377
|
* Each catalog read releases its Session observation before the next branch.
|
|
2295
2378
|
* @module @deepseek-ai/dsh-subagent
|
|
2296
2379
|
*/
|
|
2297
|
-
var __addDisposableResource
|
|
2380
|
+
var __addDisposableResource = function(env, value, async) {
|
|
2298
2381
|
if (value !== null && value !== void 0) {
|
|
2299
2382
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
2300
2383
|
var dispose, inner;
|
|
@@ -2323,7 +2406,7 @@ var __addDisposableResource$1 = function(env, value, async) {
|
|
|
2323
2406
|
} else if (async) env.stack.push({ async: true });
|
|
2324
2407
|
return value;
|
|
2325
2408
|
};
|
|
2326
|
-
var __disposeResources
|
|
2409
|
+
var __disposeResources = (function(SuppressedError) {
|
|
2327
2410
|
return function(env) {
|
|
2328
2411
|
function fail(e) {
|
|
2329
2412
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
@@ -2369,14 +2452,14 @@ async function listChildren(ctx, parentSessionId, signal) {
|
|
|
2369
2452
|
try {
|
|
2370
2453
|
const query = ctx.get("sessionQuery");
|
|
2371
2454
|
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
|
|
2455
|
+
const entries = __addDisposableResource(env_1, await query.observeSession(parentSessionId, { ...signal === void 0 ? {} : { signal } }), false).projections?.values.subagentCatalog;
|
|
2373
2456
|
if (entries === void 0) throw new SubagentError("listing subagents requires the registered subagentCatalog projection", "SUBAGENT_CONTROL_PROJECTIONS_UNAVAILABLE");
|
|
2374
2457
|
return entries;
|
|
2375
2458
|
} catch (e_1) {
|
|
2376
2459
|
env_1.error = e_1;
|
|
2377
2460
|
env_1.hasError = true;
|
|
2378
2461
|
} finally {
|
|
2379
|
-
__disposeResources
|
|
2462
|
+
__disposeResources(env_1);
|
|
2380
2463
|
}
|
|
2381
2464
|
}
|
|
2382
2465
|
/**
|
|
@@ -2405,14 +2488,21 @@ async function listDescendants(ctx, rootSessionId, signal) {
|
|
|
2405
2488
|
const stack = (await readChildren(rootSessionId)).map((entry) => ({
|
|
2406
2489
|
entry,
|
|
2407
2490
|
parentId: rootSessionId,
|
|
2408
|
-
depth: 1
|
|
2491
|
+
depth: 1,
|
|
2492
|
+
parentPath: ""
|
|
2409
2493
|
})).reverse();
|
|
2410
2494
|
const visited = new Set([rootSessionId]);
|
|
2411
2495
|
const result = [];
|
|
2412
2496
|
for (let position = stack.pop(); position !== void 0; position = stack.pop()) {
|
|
2413
|
-
const { entry, parentId, depth } = position;
|
|
2497
|
+
const { entry, parentId, depth, parentPath } = position;
|
|
2414
2498
|
if (visited.has(entry.id)) continue;
|
|
2415
2499
|
visited.add(entry.id);
|
|
2500
|
+
const path = joinAgentPath(parentPath, "name" in entry ? entry.name : void 0);
|
|
2501
|
+
const at = {
|
|
2502
|
+
parentId,
|
|
2503
|
+
depth,
|
|
2504
|
+
...path === void 0 ? {} : { path }
|
|
2505
|
+
};
|
|
2416
2506
|
let children;
|
|
2417
2507
|
try {
|
|
2418
2508
|
children = entry.mode === "external" ? [] : await readChildren(entry.id);
|
|
@@ -2422,8 +2512,7 @@ async function listDescendants(ctx, rootSessionId, signal) {
|
|
|
2422
2512
|
result.push({
|
|
2423
2513
|
kind: "diagnostic",
|
|
2424
2514
|
id: entry.id,
|
|
2425
|
-
|
|
2426
|
-
depth,
|
|
2515
|
+
...at,
|
|
2427
2516
|
reason: code === "SESSION_QUERY_CORRUPT_SESSION" || code === "SESSION_QUERY_SOURCE_CONFLICT" ? "corrupt" : "unavailable"
|
|
2428
2517
|
});
|
|
2429
2518
|
continue;
|
|
@@ -2431,8 +2520,7 @@ async function listDescendants(ctx, rootSessionId, signal) {
|
|
|
2431
2520
|
if (entry.mode === "unknown") result.push({
|
|
2432
2521
|
kind: "diagnostic",
|
|
2433
2522
|
id: entry.id,
|
|
2434
|
-
|
|
2435
|
-
depth,
|
|
2523
|
+
...at,
|
|
2436
2524
|
reason: "unsupported"
|
|
2437
2525
|
});
|
|
2438
2526
|
else {
|
|
@@ -2440,8 +2528,7 @@ async function listDescendants(ctx, rootSessionId, signal) {
|
|
|
2440
2528
|
result.push({
|
|
2441
2529
|
...identity,
|
|
2442
2530
|
kind: "child",
|
|
2443
|
-
|
|
2444
|
-
depth,
|
|
2531
|
+
...at,
|
|
2445
2532
|
activity: sessions.get(entry.id) === void 0 ? "inactive" : "running",
|
|
2446
2533
|
hasChildren: children.length > 0
|
|
2447
2534
|
});
|
|
@@ -2449,169 +2536,38 @@ async function listDescendants(ctx, rootSessionId, signal) {
|
|
|
2449
2536
|
for (const child of [...children].reverse()) stack.push({
|
|
2450
2537
|
entry: child,
|
|
2451
2538
|
parentId: entry.id,
|
|
2452
|
-
depth: depth + 1
|
|
2539
|
+
depth: depth + 1,
|
|
2540
|
+
parentPath: path
|
|
2453
2541
|
});
|
|
2454
2542
|
}
|
|
2455
2543
|
return result;
|
|
2456
2544
|
}
|
|
2545
|
+
/**
|
|
2546
|
+
* Resolve a slash-separated name by reading only the catalogs along its path.
|
|
2547
|
+
* @param ctx - context carrying the Session query service.
|
|
2548
|
+
* @param rootSessionId - tree root whose catalog holds the first name.
|
|
2549
|
+
* @param name - candidate full name relative to the root.
|
|
2550
|
+
* @param signal - cancellation forwarded to each catalog read.
|
|
2551
|
+
* @returns the named member's Session id, or undefined when the text is not a name in this tree.
|
|
2552
|
+
* @throws {@link SubagentError} when a catalog dependency is unavailable; Session read failures propagate.
|
|
2553
|
+
*/
|
|
2554
|
+
async function resolveAgentPath(ctx, rootSessionId, name, signal) {
|
|
2555
|
+
const segments = name.split("/");
|
|
2556
|
+
if (!segments.every(isAgentName)) return void 0;
|
|
2557
|
+
let current = rootSessionId;
|
|
2558
|
+
for (const [index, segment] of segments.entries()) {
|
|
2559
|
+
const child = (await listChildren(ctx, current, signal)).find((entry) => "name" in entry && entry.name === segment);
|
|
2560
|
+
if (child === void 0) return void 0;
|
|
2561
|
+
if (index < segments.length - 1 && child.mode !== "continuable" && child.mode !== "one-shot") return void 0;
|
|
2562
|
+
current = child.id;
|
|
2563
|
+
}
|
|
2564
|
+
return current;
|
|
2565
|
+
}
|
|
2457
2566
|
/** Stop the complete traversal when its caller cancels. */
|
|
2458
2567
|
function assertListingNotCancelled(signal) {
|
|
2459
2568
|
if (signal?.aborted) throw new SubagentError("subagent listing was cancelled", "CANCELLED");
|
|
2460
2569
|
}
|
|
2461
2570
|
//#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
2571
|
//#region lib/types/projection.js
|
|
2616
2572
|
/**
|
|
2617
2573
|
* Pure session projections for subagent identity (mode/label) and active-turn
|
|
@@ -2963,12 +2919,18 @@ let SubagentRuntime = (() => {
|
|
|
2963
2919
|
let _classSuper = TypertRemoteService;
|
|
2964
2920
|
let _instanceExtraInitializers = [];
|
|
2965
2921
|
let _prompt_decorators;
|
|
2966
|
-
let
|
|
2922
|
+
let _interruptByUser_decorators;
|
|
2967
2923
|
return class SubagentRuntime extends _classSuper {
|
|
2968
2924
|
static {
|
|
2969
2925
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2970
|
-
_prompt_decorators = [Remote(
|
|
2971
|
-
|
|
2926
|
+
_prompt_decorators = [Remote({
|
|
2927
|
+
name: "prompt",
|
|
2928
|
+
resources: { session: (request) => request.childSessionId }
|
|
2929
|
+
})];
|
|
2930
|
+
_interruptByUser_decorators = [Remote({
|
|
2931
|
+
name: "interruptByUser",
|
|
2932
|
+
resources: { session: (childSessionId) => childSessionId }
|
|
2933
|
+
})];
|
|
2972
2934
|
__esDecorate(this, null, _prompt_decorators, {
|
|
2973
2935
|
kind: "method",
|
|
2974
2936
|
name: "prompt",
|
|
@@ -2980,14 +2942,14 @@ let SubagentRuntime = (() => {
|
|
|
2980
2942
|
},
|
|
2981
2943
|
metadata: _metadata
|
|
2982
2944
|
}, null, _instanceExtraInitializers);
|
|
2983
|
-
__esDecorate(this, null,
|
|
2945
|
+
__esDecorate(this, null, _interruptByUser_decorators, {
|
|
2984
2946
|
kind: "method",
|
|
2985
|
-
name: "
|
|
2947
|
+
name: "interruptByUser",
|
|
2986
2948
|
static: false,
|
|
2987
2949
|
private: false,
|
|
2988
2950
|
access: {
|
|
2989
|
-
has: (obj) => "
|
|
2990
|
-
get: (obj) => obj.
|
|
2951
|
+
has: (obj) => "interruptByUser" in obj,
|
|
2952
|
+
get: (obj) => obj.interruptByUser
|
|
2991
2953
|
},
|
|
2992
2954
|
metadata: _metadata
|
|
2993
2955
|
}, null, _instanceExtraInitializers);
|
|
@@ -3016,13 +2978,18 @@ let SubagentRuntime = (() => {
|
|
|
3016
2978
|
super(ctx, "subagents");
|
|
3017
2979
|
this.config = config;
|
|
3018
2980
|
this.emitLifecycle = createLifecycleEmitter(this.ctx, (parent) => scopeTarget(this, parent));
|
|
2981
|
+
}
|
|
2982
|
+
async [Service.init]() {
|
|
2983
|
+
const ctx = this.ctx;
|
|
2984
|
+
const catalogProjection = await ctx.sessionProjections.register(subagentCatalogProjectionDefinition);
|
|
2985
|
+
await ctx.sessionProjections.register(subagentTimingProjectionDefinition);
|
|
2986
|
+
const identityProjection = await ctx.sessionProjections.register(subagentIdentityProjectionDefinition);
|
|
2987
|
+
if (ctx.fiber.uid === null) return;
|
|
3019
2988
|
ctx.inject(["agents"], (childCtx) => {
|
|
3020
2989
|
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)
|
|
2990
|
+
identityOf: (session) => identityProjection.stateOf(session).identity,
|
|
2991
|
+
catalogOf: (session) => subagentCatalogProjectionDefinition.wire.view(catalogProjection.stateOf(session)),
|
|
2992
|
+
emitLifecycle: this.emitLifecycle
|
|
3026
2993
|
}, () => this.config.maxActiveSubagents.get());
|
|
3027
2994
|
this.manager = manager;
|
|
3028
2995
|
childCtx.effect(() => () => {
|
|
@@ -3030,15 +2997,6 @@ let SubagentRuntime = (() => {
|
|
|
3030
2997
|
if (this.manager === manager) this.manager = void 0;
|
|
3031
2998
|
}, "subagents.managerBinding()");
|
|
3032
2999
|
});
|
|
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
3000
|
}
|
|
3043
3001
|
/**
|
|
3044
3002
|
* Resolve a delegation tool's depth policy against the current user setting.
|
|
@@ -3057,64 +3015,98 @@ let SubagentRuntime = (() => {
|
|
|
3057
3015
|
* @param spec - task, backend, and result recipient.
|
|
3058
3016
|
* @returns identities, execution result, and exact-activation disposal. A reserved
|
|
3059
3017
|
* childId requires a local backend and guarantees an accepted messageId.
|
|
3018
|
+
* @throws PROVIDER_CHANGED if the selected provider is removed or replaced before dispatch.
|
|
3060
3019
|
*/
|
|
3061
3020
|
async startActivation(spec) {
|
|
3062
3021
|
const provider = this.expectProvider(spec.provider);
|
|
3063
3022
|
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
|
-
});
|
|
3023
|
+
assertSubagentMaxDepth(spec.maxDepth);
|
|
3024
|
+
this.assertCapabilities(provider, spec);
|
|
3069
3025
|
const manager = this.requireManager();
|
|
3070
|
-
if (this.ctx.get("agents")?.get(spec.
|
|
3071
|
-
if (spec.
|
|
3072
|
-
|
|
3026
|
+
if (this.ctx.get("agents")?.get(spec.parent.id) !== spec.parent) throw new SubagentError("subagent creation requires the exact live parent agent", "UNAUTHORIZED");
|
|
3027
|
+
if (spec.outputSchema !== void 0) assertObjectJsonSchema(spec.outputSchema);
|
|
3028
|
+
const prepare = provider.prepareContinuable?.bind(provider);
|
|
3029
|
+
if (prepare !== void 0) return manager.startLocal(spec, (request) => {
|
|
3030
|
+
this.assertProviderCurrent(provider);
|
|
3031
|
+
return prepare(request);
|
|
3032
|
+
});
|
|
3033
|
+
const start = provider.start.bind(provider);
|
|
3034
|
+
return manager.startExternal(spec, (request) => {
|
|
3035
|
+
this.assertProviderCurrent(provider);
|
|
3036
|
+
return start(request);
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
/**
|
|
3040
|
+
* Resolve the root shared by an Agent and its other agents in its subagent tree.
|
|
3041
|
+
* @param caller - exact live Agent whose subagent ancestry selects the tree.
|
|
3042
|
+
* @returns the live root; ordinary Session forks lead independent trees.
|
|
3043
|
+
* @throws when the caller or its runtime owner is unavailable.
|
|
3044
|
+
*/
|
|
3045
|
+
rootOf(caller) {
|
|
3046
|
+
return this.requireManager().rootOf(caller);
|
|
3073
3047
|
}
|
|
3074
3048
|
/**
|
|
3075
|
-
*
|
|
3076
|
-
*
|
|
3077
|
-
*
|
|
3078
|
-
* @
|
|
3049
|
+
* Report the model-facing names of a live tree member and its direct creator.
|
|
3050
|
+
* The root is `lead`; a descendant is the slash-separated path of names from
|
|
3051
|
+
* the root, or its Session id when it or a creator below the root has no name.
|
|
3052
|
+
* @param agent - exact live root or resident tree member.
|
|
3053
|
+
* @returns the member's name and, for a descendant, its creator's name.
|
|
3054
|
+
* @throws when the caller or its runtime owner is unavailable.
|
|
3079
3055
|
*/
|
|
3080
|
-
|
|
3081
|
-
return this.
|
|
3056
|
+
namesOf(agent) {
|
|
3057
|
+
return this.requireManager().namesOf(agent);
|
|
3082
3058
|
}
|
|
3083
3059
|
/**
|
|
3084
|
-
*
|
|
3085
|
-
*
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3088
|
-
*
|
|
3089
|
-
*
|
|
3090
|
-
*
|
|
3060
|
+
* Resolve a model-supplied agent reference within the caller's tree. `lead`
|
|
3061
|
+
* selects the root and a slash-separated path is looked up through the
|
|
3062
|
+
* catalogs along it. Any other text that is not a name in the tree is
|
|
3063
|
+
* returned as a Session id, because a single token can be one; a
|
|
3064
|
+
* slash-separated address never is, so an unmatched path fails instead of
|
|
3065
|
+
* reaching a member lookup as an unknown id. Resolution grants no authority:
|
|
3066
|
+
* messaging, interruption, and assignment authorize the result.
|
|
3067
|
+
* @param caller - exact live Agent whose tree root anchors the lookup.
|
|
3068
|
+
* @param name - `lead`, a full name from the root, or a Session id.
|
|
3069
|
+
* @param signal - cancellation forwarded to each catalog read.
|
|
3070
|
+
* @returns the referenced Session id.
|
|
3071
|
+
* @throws {@link SubagentError} `AGENT_NAME_NOT_FOUND` when a path names no member;
|
|
3072
|
+
* when the caller's root is unavailable; or when a catalog along the path cannot be read.
|
|
3073
|
+
*/
|
|
3074
|
+
async resolveName(caller, name, signal) {
|
|
3075
|
+
const root = this.rootOf(caller);
|
|
3076
|
+
if (name === "lead") return root.id;
|
|
3077
|
+
const resolved = await resolveAgentPath(this.ctx, root.id, name, signal);
|
|
3078
|
+
if (resolved !== void 0) return resolved;
|
|
3079
|
+
if (name.includes("/")) throw new SubagentError(`agent name ${JSON.stringify(name)} was not found in this subagent tree; use list_agents to see the names`, "AGENT_NAME_NOT_FOUND");
|
|
3080
|
+
return brandString(name);
|
|
3081
|
+
}
|
|
3082
|
+
/**
|
|
3083
|
+
* Join progressing subagent tree work for its root. Idle members with parked input
|
|
3084
|
+
* stay resident without delaying host completion. Ordinary members return false.
|
|
3085
|
+
* @param root - exact live subagent tree root whose member work is awaited.
|
|
3086
|
+
* @returns whether work was joined; hosts recheck root idle after true.
|
|
3087
|
+
*/
|
|
3088
|
+
async waitForTreeWork(root) {
|
|
3089
|
+
return this.manager?.waitForTreeWork(root) ?? false;
|
|
3090
|
+
}
|
|
3091
|
+
/**
|
|
3092
|
+
* Steer one model-authored message to another member of the same subagent tree.
|
|
3093
|
+
* A running target receives it at its next step; an idle target starts a turn.
|
|
3094
|
+
* A cold target resumes under its runtime subagent tree root without restoring
|
|
3095
|
+
* its creation ancestors. Sender identity is rechecked before inbox acceptance; cancellation
|
|
3096
|
+
* stops only pre-acceptance work and never retracts an accepted message.
|
|
3097
|
+
* @param sender - exact live root or resident continuable Agent originating the message.
|
|
3098
|
+
* @param targetId - another root or continuable member's durable Session id.
|
|
3091
3099
|
* @param content - model-authored content to deliver.
|
|
3092
3100
|
* @param options - caller cancellation before inbox acceptance.
|
|
3093
3101
|
* @returns the accepted message's inbox id.
|
|
3094
|
-
* @throws when
|
|
3095
|
-
* or the message was not admitted.
|
|
3102
|
+
* @throws when the target is outside the tree, cannot resume, or rejects input.
|
|
3096
3103
|
*/
|
|
3097
3104
|
async sendMessage(sender, targetId, content, options) {
|
|
3098
3105
|
return this.requireManager().sendMessage(sender, targetId, content, options);
|
|
3099
3106
|
}
|
|
3100
3107
|
/**
|
|
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
|
|
3108
|
+
* Interrupt one live child's current execution under a trusted user
|
|
3109
|
+
* operation or an exact live ancestor Agent. Fire-and-return: the cancel
|
|
3118
3110
|
* signal is issued before this returns, but the target may keep running
|
|
3119
3111
|
* until it observes the signal. Unclaimed pending inbox work, the Activation,
|
|
3120
3112
|
* and published descendants are preserved; claimed work is not requeued.
|
|
@@ -3123,7 +3115,7 @@ let SubagentRuntime = (() => {
|
|
|
3123
3115
|
* is an accepted no-op, as is a manager-less composition, which cannot own a
|
|
3124
3116
|
* live Activation.
|
|
3125
3117
|
* @param targetSessionId - the durable child session id to interrupt.
|
|
3126
|
-
* @param authority -
|
|
3118
|
+
* @param authority - a trusted user operation or exact live ancestor Agent.
|
|
3127
3119
|
* @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the
|
|
3128
3120
|
* live target.
|
|
3129
3121
|
*/
|
|
@@ -3131,13 +3123,11 @@ let SubagentRuntime = (() => {
|
|
|
3131
3123
|
this.manager?.interrupt(targetSessionId, authority);
|
|
3132
3124
|
}
|
|
3133
3125
|
/**
|
|
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.
|
|
3126
|
+
* Close admission and stop all instances in the selected subagent trees, then await
|
|
3127
|
+
* pending startup and cleanup. Ordinary members are ignored. The cutoff lasts
|
|
3128
|
+
* until each exact root leaves the registry; unrelated subagent trees remain live.
|
|
3129
|
+
* @param parents - exact live subagent tree roots entering teardown.
|
|
3130
|
+
* @returns once all admitted startup and member cleanup have settled.
|
|
3141
3131
|
* @throws an aggregate error after all branches settle when any failed.
|
|
3142
3132
|
*/
|
|
3143
3133
|
async drainDescendants(parents) {
|
|
@@ -3146,33 +3136,6 @@ let SubagentRuntime = (() => {
|
|
|
3146
3136
|
await manager.drainDescendants(parents);
|
|
3147
3137
|
}
|
|
3148
3138
|
/**
|
|
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
3139
|
* Recursively list reachable parent catalogs in stable pre-order, preserving
|
|
3177
3140
|
* each catalog's event order. Each row carries its catalog parent and depth;
|
|
3178
3141
|
* external children are leaves; one-shot and unknown-mode children remain
|
|
@@ -3192,8 +3155,8 @@ let SubagentRuntime = (() => {
|
|
|
3192
3155
|
return listDescendants(this.ctx, rootSessionId, signal);
|
|
3193
3156
|
}
|
|
3194
3157
|
/**
|
|
3195
|
-
* Deliver one browser-authored message to a continuable child through
|
|
3196
|
-
*
|
|
3158
|
+
* Deliver one browser-authored message to a continuable child through its
|
|
3159
|
+
* live subagent tree root, retaining the caller-minted request identity and
|
|
3197
3160
|
* validated browser zone on the accepted message. Success identifies the
|
|
3198
3161
|
* message the child's inbox accepted; later execution is independent of this
|
|
3199
3162
|
* call. Queue delivery targets a later turn; steer delivery targets the
|
|
@@ -3201,21 +3164,20 @@ let SubagentRuntime = (() => {
|
|
|
3201
3164
|
* Image parts are admitted and persisted through the attachment store
|
|
3202
3165
|
* before delivery, and the child's model must accept image input.
|
|
3203
3166
|
* Cold resume at capacity rejects with `subagent/delivery-unavailable`.
|
|
3204
|
-
*
|
|
3167
|
+
* Access is checked on the target Session before attachment admission or restoration.
|
|
3168
|
+
* @param request - target id, delivery, minted identity, content, and optional browser zone.
|
|
3205
3169
|
* @param signal - carrier cancellation, owning the call until inbox acceptance.
|
|
3206
3170
|
* @returns the accepted message's inbox identity.
|
|
3207
3171
|
* @throws {RemoteError} `gateway/bad-request`, `subagent/attachment-invalid`,
|
|
3208
|
-
* `subagent/invalid-time-zone`,
|
|
3172
|
+
* `subagent/invalid-time-zone`,
|
|
3209
3173
|
* `subagent/not-resumable`, `subagent/unauthorized`,
|
|
3210
3174
|
* `subagent/delivery-unavailable`, `gateway/cancelled`, or `gateway/internal`.
|
|
3211
3175
|
*/
|
|
3212
3176
|
async prompt(request, signal) {
|
|
3213
|
-
const {
|
|
3177
|
+
const { childSessionId, clientTimeZone, delivery } = request;
|
|
3214
3178
|
validateControlRequest("subagent.prompt", request);
|
|
3215
3179
|
const canonicalTimeZone = clientTimeZone === void 0 ? void 0 : canonicalClientTimeZone(clientTimeZone);
|
|
3216
3180
|
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
3181
|
const principal = principalOf(this.ctx.invocation);
|
|
3220
3182
|
const source = {
|
|
3221
3183
|
kind: "user",
|
|
@@ -3234,38 +3196,29 @@ let SubagentRuntime = (() => {
|
|
|
3234
3196
|
if (attachments === void 0) throw new Error("subagent image prompt requires an attachment store");
|
|
3235
3197
|
content = await attachments.admitPromptContent(request.content);
|
|
3236
3198
|
}
|
|
3237
|
-
return { messageId: await this
|
|
3199
|
+
return { messageId: await this.requireManager().deliverPrompt(childSessionId, content, {
|
|
3200
|
+
source,
|
|
3201
|
+
signal,
|
|
3202
|
+
delivery
|
|
3203
|
+
}) };
|
|
3238
3204
|
} catch (error) {
|
|
3239
3205
|
return rejectPrompt(error, childSessionId, signal);
|
|
3240
3206
|
}
|
|
3241
3207
|
}
|
|
3242
3208
|
/**
|
|
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.
|
|
3209
|
+
* Remote face of {@link interrupt}, authorized on the target Session by the Gateway.
|
|
3210
|
+
* No catalog, history, persistence, or parent Agent lookup runs.
|
|
3247
3211
|
* Absent, idle, and already-completed targets are accepted no-ops there.
|
|
3248
3212
|
* @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
3213
|
* @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.
|
|
3252
3214
|
* @throws {RemoteError} `gateway/bad-request` for an empty id,
|
|
3253
|
-
* `subagent/unauthorized` when the address does not own the live target,
|
|
3254
3215
|
* otherwise `gateway/internal`.
|
|
3255
3216
|
*/
|
|
3256
|
-
|
|
3257
|
-
validateControlRequest("subagent.interrupt", {
|
|
3258
|
-
childSessionId,
|
|
3259
|
-
parentSessionId,
|
|
3260
|
-
mode
|
|
3261
|
-
});
|
|
3217
|
+
interruptByUser(childSessionId) {
|
|
3218
|
+
validateControlRequest("subagent.interrupt", { childSessionId });
|
|
3262
3219
|
try {
|
|
3263
|
-
this.interrupt(childSessionId, {
|
|
3264
|
-
kind: "user",
|
|
3265
|
-
parentSessionId
|
|
3266
|
-
});
|
|
3220
|
+
this.interrupt(childSessionId, { kind: "user" });
|
|
3267
3221
|
} 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
3222
|
throw new RemoteError("gateway/internal", "subagent interrupt failed", {}, { cause: error });
|
|
3270
3223
|
}
|
|
3271
3224
|
return { accepted: true };
|
|
@@ -3299,20 +3252,9 @@ let SubagentRuntime = (() => {
|
|
|
3299
3252
|
getProvider(name) {
|
|
3300
3253
|
return this.providers.get(name);
|
|
3301
3254
|
}
|
|
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);
|
|
3255
|
+
/** A pending start must use the exact provider whose capabilities were checked. */
|
|
3256
|
+
assertProviderCurrent(provider) {
|
|
3257
|
+
if (this.providers.get(provider.name) !== provider) throw new SubagentError(`subagent provider "${provider.name}" changed during startup; retry the delegation`, "PROVIDER_CHANGED");
|
|
3316
3258
|
}
|
|
3317
3259
|
/** Look up a provider for dispatch or fail loud. */
|
|
3318
3260
|
expectProvider(name) {
|
|
@@ -3325,13 +3267,6 @@ let SubagentRuntime = (() => {
|
|
|
3325
3267
|
if (this.manager === void 0) throw new SubagentError("continuable subagents require the agents service", "CONTINUATION_UNAVAILABLE");
|
|
3326
3268
|
return this.manager;
|
|
3327
3269
|
}
|
|
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
3270
|
/** Reject the first requested capability that the provider lacks. */
|
|
3336
3271
|
assertCapabilities(provider, request) {
|
|
3337
3272
|
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");
|
|
@@ -3354,4 +3289,4 @@ let SubagentRuntime = (() => {
|
|
|
3354
3289
|
};
|
|
3355
3290
|
})();
|
|
3356
3291
|
//#endregion
|
|
3357
|
-
export { AssistantOutputFold, NO_START_CAPABILITIES, STRUCTURED_OUTPUT_TOOL, SUBAGENT_DESCRIPTOR_VERSION, SubagentDepthError, SubagentError, SubagentRunId, SubagentRuntime, SubagentRuntime as default, appendDelegatedPolicyOverrides, applyChildComposition, assertPositiveFinite, assertSubagentMaxDepth, assertUsableCwd, captureDelegatedPolicyOverrides, childSessionMeta, delegationDepthOf, finalAssistantOutput, foldSubagentDescriptor, parentAgentOptionsForDelegation, resolveChildAgentOptions, resolveChildDepth, settleRunResult, snapshotSubagentDescriptor, subprocessRunHandle };
|
|
3292
|
+
export { AssistantOutputFold, NO_START_CAPABILITIES, ROOT_AGENT_NAME, STRUCTURED_OUTPUT_TOOL, SUBAGENT_DESCRIPTOR_VERSION, SubagentDepthError, SubagentError, SubagentRunId, SubagentRuntime, SubagentRuntime as default, appendDelegatedPolicyOverrides, applyChildComposition, assertPositiveFinite, assertSubagentMaxDepth, assertUsableCwd, captureDelegatedPolicyOverrides, childSessionMeta, delegationDepthOf, finalAssistantOutput, foldSubagentDescriptor, parentAgentOptionsForDelegation, resolveChildAgentOptions, resolveChildDepth, settleRunResult, snapshotSubagentDescriptor, subprocessRunHandle };
|