dsh-botgroup 0.0.0-stage → 0.7.0
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/LICENSE +18 -0
- package/README.en.md +118 -0
- package/README.md +117 -2
- package/THIRD_PARTY_NOTICES.txt +212 -0
- package/assets/logo-1024.png +0 -0
- package/cordis.patch.yml +13 -0
- package/icon.svg +9 -0
- package/lib/client.js +31791 -0
- package/lib/client.js.map +7 -0
- package/lib/host/activity/first-user.d.ts +16 -0
- package/lib/host/activity/first-user.js +25 -0
- package/lib/host/activity/first-user.js.map +1 -0
- package/lib/host/activity/preview.d.ts +2 -0
- package/lib/host/activity/preview.js +5 -0
- package/lib/host/activity/preview.js.map +1 -0
- package/lib/host/activity/remote.d.ts +15 -0
- package/lib/host/activity/remote.js +66 -0
- package/lib/host/activity/remote.js.map +1 -0
- package/lib/host/activity/tracker.d.ts +12 -0
- package/lib/host/activity/tracker.js +157 -0
- package/lib/host/activity/tracker.js.map +1 -0
- package/lib/host/automation/coordinator.d.ts +26 -0
- package/lib/host/automation/coordinator.js +58 -0
- package/lib/host/automation/coordinator.js.map +1 -0
- package/lib/host/automation/delivery.d.ts +16 -0
- package/lib/host/automation/delivery.js +65 -0
- package/lib/host/automation/delivery.js.map +1 -0
- package/lib/host/automation/errors.d.ts +16 -0
- package/lib/host/automation/errors.js +19 -0
- package/lib/host/automation/errors.js.map +1 -0
- package/lib/host/automation/index.d.ts +2 -0
- package/lib/host/automation/index.js +4 -0
- package/lib/host/automation/index.js.map +1 -0
- package/lib/host/automation/remote.d.ts +280 -0
- package/lib/host/automation/remote.js +152 -0
- package/lib/host/automation/remote.js.map +1 -0
- package/lib/host/automation/store.d.ts +297 -0
- package/lib/host/automation/store.js +286 -0
- package/lib/host/automation/store.js.map +1 -0
- package/lib/host/bot-context.d.ts +11 -0
- package/lib/host/bot-context.js +346 -0
- package/lib/host/bot-context.js.map +1 -0
- package/lib/host/capabilities/platform.d.ts +17 -0
- package/lib/host/capabilities/platform.js +17 -0
- package/lib/host/capabilities/platform.js.map +1 -0
- package/lib/host/capabilities/remote.d.ts +94 -0
- package/lib/host/capabilities/remote.js +59 -0
- package/lib/host/capabilities/remote.js.map +1 -0
- package/lib/host/capabilities/service.d.ts +82 -0
- package/lib/host/capabilities/service.js +144 -0
- package/lib/host/capabilities/service.js.map +1 -0
- package/lib/host/collaboration/remote.d.ts +89 -0
- package/lib/host/collaboration/remote.js +109 -0
- package/lib/host/collaboration/remote.js.map +1 -0
- package/lib/host/collaboration/service.d.ts +61 -0
- package/lib/host/collaboration/service.js +191 -0
- package/lib/host/collaboration/service.js.map +1 -0
- package/lib/host/common/integration-stores.d.ts +162 -0
- package/lib/host/common/integration-stores.js +50 -0
- package/lib/host/common/integration-stores.js.map +1 -0
- package/lib/host/common/native-ambient-source.d.ts +7 -0
- package/lib/host/common/native-ambient-source.js +15 -0
- package/lib/host/common/native-ambient-source.js.map +1 -0
- package/lib/host/common/operations.d.ts +23 -0
- package/lib/host/common/operations.js +38 -0
- package/lib/host/common/operations.js.map +1 -0
- package/lib/host/common/subagent-activation.d.ts +7 -0
- package/lib/host/common/subagent-activation.js +10 -0
- package/lib/host/common/subagent-activation.js.map +1 -0
- package/lib/host/composer.d.ts +15 -0
- package/lib/host/composer.js +102 -0
- package/lib/host/composer.js.map +1 -0
- package/lib/host/connectors/remote.d.ts +215 -0
- package/lib/host/connectors/remote.js +111 -0
- package/lib/host/connectors/remote.js.map +1 -0
- package/lib/host/connectors/service.d.ts +150 -0
- package/lib/host/connectors/service.js +491 -0
- package/lib/host/connectors/service.js.map +1 -0
- package/lib/host/data-flow/agent-binding.d.ts +8 -0
- package/lib/host/data-flow/agent-binding.js +4 -0
- package/lib/host/data-flow/agent-binding.js.map +1 -0
- package/lib/host/data-flow/connector-boundary.d.ts +7 -0
- package/lib/host/data-flow/connector-boundary.js +33 -0
- package/lib/host/data-flow/connector-boundary.js.map +1 -0
- package/lib/host/data-flow/delegation.d.ts +6 -0
- package/lib/host/data-flow/delegation.js +73 -0
- package/lib/host/data-flow/delegation.js.map +1 -0
- package/lib/host/data-flow/egress.d.ts +26 -0
- package/lib/host/data-flow/egress.js +118 -0
- package/lib/host/data-flow/egress.js.map +1 -0
- package/lib/host/data-flow/grants.d.ts +18 -0
- package/lib/host/data-flow/grants.js +39 -0
- package/lib/host/data-flow/grants.js.map +1 -0
- package/lib/host/data-flow/graph-capability.d.ts +3 -0
- package/lib/host/data-flow/graph-capability.js +21 -0
- package/lib/host/data-flow/graph-capability.js.map +1 -0
- package/lib/host/data-flow/labels.d.ts +6 -0
- package/lib/host/data-flow/labels.js +30 -0
- package/lib/host/data-flow/labels.js.map +1 -0
- package/lib/host/data-flow/lineage.d.ts +10 -0
- package/lib/host/data-flow/lineage.js +35 -0
- package/lib/host/data-flow/lineage.js.map +1 -0
- package/lib/host/data-flow/managed-copies.d.ts +216 -0
- package/lib/host/data-flow/managed-copies.js +37 -0
- package/lib/host/data-flow/managed-copies.js.map +1 -0
- package/lib/host/data-flow/native-policy.d.ts +26 -0
- package/lib/host/data-flow/native-policy.js +86 -0
- package/lib/host/data-flow/native-policy.js.map +1 -0
- package/lib/host/data-flow/outlets.d.ts +55 -0
- package/lib/host/data-flow/outlets.js +307 -0
- package/lib/host/data-flow/outlets.js.map +1 -0
- package/lib/host/data-flow/tool-guard.d.ts +13 -0
- package/lib/host/data-flow/tool-guard.js +123 -0
- package/lib/host/data-flow/tool-guard.js.map +1 -0
- package/lib/host/delegate/continuation.d.ts +5 -0
- package/lib/host/delegate/continuation.js +44 -0
- package/lib/host/delegate/continuation.js.map +1 -0
- package/lib/host/delegate/guard.d.ts +7 -0
- package/lib/host/delegate/guard.js +53 -0
- package/lib/host/delegate/guard.js.map +1 -0
- package/lib/host/delegate/tool.d.ts +3 -0
- package/lib/host/delegate/tool.js +207 -0
- package/lib/host/delegate/tool.js.map +1 -0
- package/lib/host/errors.d.ts +9 -0
- package/lib/host/errors.js +17 -0
- package/lib/host/errors.js.map +1 -0
- package/lib/host/groups/concurrent.d.ts +29 -0
- package/lib/host/groups/concurrent.js +277 -0
- package/lib/host/groups/concurrent.js.map +1 -0
- package/lib/host/groups/data-flow.d.ts +21 -0
- package/lib/host/groups/data-flow.js +59 -0
- package/lib/host/groups/data-flow.js.map +1 -0
- package/lib/host/groups/failure.d.ts +10 -0
- package/lib/host/groups/failure.js +36 -0
- package/lib/host/groups/failure.js.map +1 -0
- package/lib/host/groups/members.d.ts +172 -0
- package/lib/host/groups/members.js +242 -0
- package/lib/host/groups/members.js.map +1 -0
- package/lib/host/groups/messages.d.ts +389 -0
- package/lib/host/groups/messages.js +151 -0
- package/lib/host/groups/messages.js.map +1 -0
- package/lib/host/groups/model-selection.d.ts +15 -0
- package/lib/host/groups/model-selection.js +12 -0
- package/lib/host/groups/model-selection.js.map +1 -0
- package/lib/host/groups/model.d.ts +331 -0
- package/lib/host/groups/model.js +26 -0
- package/lib/host/groups/model.js.map +1 -0
- package/lib/host/groups/owner-follow-up.d.ts +4 -0
- package/lib/host/groups/owner-follow-up.js +34 -0
- package/lib/host/groups/owner-follow-up.js.map +1 -0
- package/lib/host/groups/recall-sessions.d.ts +32 -0
- package/lib/host/groups/recall-sessions.js +145 -0
- package/lib/host/groups/recall-sessions.js.map +1 -0
- package/lib/host/groups/recall-tool.d.ts +9 -0
- package/lib/host/groups/recall-tool.js +275 -0
- package/lib/host/groups/recall-tool.js.map +1 -0
- package/lib/host/groups/recall.d.ts +37 -0
- package/lib/host/groups/recall.js +406 -0
- package/lib/host/groups/recall.js.map +1 -0
- package/lib/host/groups/remote.d.ts +1219 -0
- package/lib/host/groups/remote.js +177 -0
- package/lib/host/groups/remote.js.map +1 -0
- package/lib/host/groups/root-guard.d.ts +26 -0
- package/lib/host/groups/root-guard.js +59 -0
- package/lib/host/groups/root-guard.js.map +1 -0
- package/lib/host/groups/roots.d.ts +25 -0
- package/lib/host/groups/roots.js +225 -0
- package/lib/host/groups/roots.js.map +1 -0
- package/lib/host/groups/round-robin.d.ts +2 -0
- package/lib/host/groups/round-robin.js +7 -0
- package/lib/host/groups/round-robin.js.map +1 -0
- package/lib/host/groups/routing.d.ts +35 -0
- package/lib/host/groups/routing.js +92 -0
- package/lib/host/groups/routing.js.map +1 -0
- package/lib/host/groups/service.d.ts +1704 -0
- package/lib/host/groups/service.js +324 -0
- package/lib/host/groups/service.js.map +1 -0
- package/lib/host/groups/state.d.ts +975 -0
- package/lib/host/groups/state.js +229 -0
- package/lib/host/groups/state.js.map +1 -0
- package/lib/host/groups/supergroup-admission.d.ts +87 -0
- package/lib/host/groups/supergroup-admission.js +99 -0
- package/lib/host/groups/supergroup-admission.js.map +1 -0
- package/lib/host/groups/team-recipes.d.ts +113 -0
- package/lib/host/groups/team-recipes.js +92 -0
- package/lib/host/groups/team-recipes.js.map +1 -0
- package/lib/host/groups/turn-runner.d.ts +184 -0
- package/lib/host/groups/turn-runner.js +613 -0
- package/lib/host/groups/turn-runner.js.map +1 -0
- package/lib/host/groups/turns.d.ts +740 -0
- package/lib/host/groups/turns.js +513 -0
- package/lib/host/groups/turns.js.map +1 -0
- package/lib/host/groups/worker-tool.d.ts +50 -0
- package/lib/host/groups/worker-tool.js +157 -0
- package/lib/host/groups/worker-tool.js.map +1 -0
- package/lib/host/home.d.ts +27 -0
- package/lib/host/home.js +221 -0
- package/lib/host/home.js.map +1 -0
- package/lib/host/im/service.d.ts +4 -0
- package/lib/host/im/service.js +20 -0
- package/lib/host/im/service.js.map +1 -0
- package/lib/host/index.d.ts +10 -0
- package/lib/host/index.js +298 -0
- package/lib/host/index.js.map +1 -0
- package/lib/host/live-persona.d.ts +9 -0
- package/lib/host/live-persona.js +102 -0
- package/lib/host/live-persona.js.map +1 -0
- package/lib/host/main-session.d.ts +45 -0
- package/lib/host/main-session.js +249 -0
- package/lib/host/main-session.js.map +1 -0
- package/lib/host/memory/admission.d.ts +46 -0
- package/lib/host/memory/admission.js +269 -0
- package/lib/host/memory/admission.js.map +1 -0
- package/lib/host/memory/auto-share.d.ts +36 -0
- package/lib/host/memory/auto-share.js +38 -0
- package/lib/host/memory/auto-share.js.map +1 -0
- package/lib/host/memory/confirmation.d.ts +145 -0
- package/lib/host/memory/confirmation.js +88 -0
- package/lib/host/memory/confirmation.js.map +1 -0
- package/lib/host/memory/conflicts.d.ts +16 -0
- package/lib/host/memory/conflicts.js +87 -0
- package/lib/host/memory/conflicts.js.map +1 -0
- package/lib/host/memory/context.d.ts +16 -0
- package/lib/host/memory/context.js +96 -0
- package/lib/host/memory/context.js.map +1 -0
- package/lib/host/memory/domain-v2.d.ts +338 -0
- package/lib/host/memory/domain-v2.js +21 -0
- package/lib/host/memory/domain-v2.js.map +1 -0
- package/lib/host/memory/facade.d.ts +159 -0
- package/lib/host/memory/facade.js +281 -0
- package/lib/host/memory/facade.js.map +1 -0
- package/lib/host/memory/forget-preview.d.ts +27 -0
- package/lib/host/memory/forget-preview.js +100 -0
- package/lib/host/memory/forget-preview.js.map +1 -0
- package/lib/host/memory/forget-runner.d.ts +31 -0
- package/lib/host/memory/forget-runner.js +167 -0
- package/lib/host/memory/forget-runner.js.map +1 -0
- package/lib/host/memory/forget-service.d.ts +65 -0
- package/lib/host/memory/forget-service.js +169 -0
- package/lib/host/memory/forget-service.js.map +1 -0
- package/lib/host/memory/history-proof.d.ts +5 -0
- package/lib/host/memory/history-proof.js +37 -0
- package/lib/host/memory/history-proof.js.map +1 -0
- package/lib/host/memory/history.d.ts +31 -0
- package/lib/host/memory/history.js +45 -0
- package/lib/host/memory/history.js.map +1 -0
- package/lib/host/memory/layout-upgrade.d.ts +8 -0
- package/lib/host/memory/layout-upgrade.js +51 -0
- package/lib/host/memory/layout-upgrade.js.map +1 -0
- package/lib/host/memory/migration.d.ts +23 -0
- package/lib/host/memory/migration.js +105 -0
- package/lib/host/memory/migration.js.map +1 -0
- package/lib/host/memory/op-log.d.ts +44 -0
- package/lib/host/memory/op-log.js +155 -0
- package/lib/host/memory/op-log.js.map +1 -0
- package/lib/host/memory/open-v2.d.ts +7 -0
- package/lib/host/memory/open-v2.js +30 -0
- package/lib/host/memory/open-v2.js.map +1 -0
- package/lib/host/memory/owner-lease.d.ts +9 -0
- package/lib/host/memory/owner-lease.js +105 -0
- package/lib/host/memory/owner-lease.js.map +1 -0
- package/lib/host/memory/persistent-map.d.ts +40 -0
- package/lib/host/memory/persistent-map.js +88 -0
- package/lib/host/memory/persistent-map.js.map +1 -0
- package/lib/host/memory/port.d.ts +10 -0
- package/lib/host/memory/port.js +3 -0
- package/lib/host/memory/port.js.map +1 -0
- package/lib/host/memory/preserve-inbox.d.ts +7 -0
- package/lib/host/memory/preserve-inbox.js +45 -0
- package/lib/host/memory/preserve-inbox.js.map +1 -0
- package/lib/host/memory/projection.d.ts +22 -0
- package/lib/host/memory/projection.js +89 -0
- package/lib/host/memory/projection.js.map +1 -0
- package/lib/host/memory/prompt.d.ts +3 -0
- package/lib/host/memory/prompt.js +56 -0
- package/lib/host/memory/prompt.js.map +1 -0
- package/lib/host/memory/query.d.ts +5 -0
- package/lib/host/memory/query.js +8 -0
- package/lib/host/memory/query.js.map +1 -0
- package/lib/host/memory/quota-replay.d.ts +4 -0
- package/lib/host/memory/quota-replay.js +22 -0
- package/lib/host/memory/quota-replay.js.map +1 -0
- package/lib/host/memory/quota.d.ts +152 -0
- package/lib/host/memory/quota.js +101 -0
- package/lib/host/memory/quota.js.map +1 -0
- package/lib/host/memory/remote.d.ts +288 -0
- package/lib/host/memory/remote.js +202 -0
- package/lib/host/memory/remote.js.map +1 -0
- package/lib/host/memory/retrieval-aliases.json +55 -0
- package/lib/host/memory/retrieval-config.d.ts +15 -0
- package/lib/host/memory/retrieval-config.js +17 -0
- package/lib/host/memory/retrieval-config.js.map +1 -0
- package/lib/host/memory/retrieval-rank.d.ts +16 -0
- package/lib/host/memory/retrieval-rank.js +88 -0
- package/lib/host/memory/retrieval-rank.js.map +1 -0
- package/lib/host/memory/retrieval-text.d.ts +3 -0
- package/lib/host/memory/retrieval-text.js +34 -0
- package/lib/host/memory/retrieval-text.js.map +1 -0
- package/lib/host/memory/root-instructions.d.ts +4 -0
- package/lib/host/memory/root-instructions.js +21 -0
- package/lib/host/memory/root-instructions.js.map +1 -0
- package/lib/host/memory/secrets.d.ts +6 -0
- package/lib/host/memory/secrets.js +12 -0
- package/lib/host/memory/secrets.js.map +1 -0
- package/lib/host/memory/service.d.ts +59 -0
- package/lib/host/memory/service.js +148 -0
- package/lib/host/memory/service.js.map +1 -0
- package/lib/host/memory/shards.d.ts +4 -0
- package/lib/host/memory/shards.js +12 -0
- package/lib/host/memory/shards.js.map +1 -0
- package/lib/host/memory/store-v2.d.ts +37 -0
- package/lib/host/memory/store-v2.js +156 -0
- package/lib/host/memory/store-v2.js.map +1 -0
- package/lib/host/memory/temporal.d.ts +18 -0
- package/lib/host/memory/temporal.js +53 -0
- package/lib/host/memory/temporal.js.map +1 -0
- package/lib/host/memory/tool-guidance.d.ts +3 -0
- package/lib/host/memory/tool-guidance.js +11 -0
- package/lib/host/memory/tool-guidance.js.map +1 -0
- package/lib/host/memory/tools.d.ts +6 -0
- package/lib/host/memory/tools.js +121 -0
- package/lib/host/memory/tools.js.map +1 -0
- package/lib/host/memory/trusted-ingress.d.ts +14 -0
- package/lib/host/memory/trusted-ingress.js +13 -0
- package/lib/host/memory/trusted-ingress.js.map +1 -0
- package/lib/host/memory/version.d.ts +135 -0
- package/lib/host/memory/version.js +17 -0
- package/lib/host/memory/version.js.map +1 -0
- package/lib/host/messaging/config.d.ts +55 -0
- package/lib/host/messaging/config.js +44 -0
- package/lib/host/messaging/config.js.map +1 -0
- package/lib/host/messaging/core.d.ts +287 -0
- package/lib/host/messaging/core.js +110 -0
- package/lib/host/messaging/core.js.map +1 -0
- package/lib/host/messaging/delivery.d.ts +6 -0
- package/lib/host/messaging/delivery.js +239 -0
- package/lib/host/messaging/delivery.js.map +1 -0
- package/lib/host/messaging/evidence.d.ts +15 -0
- package/lib/host/messaging/evidence.js +63 -0
- package/lib/host/messaging/evidence.js.map +1 -0
- package/lib/host/messaging/interrupt.d.ts +3 -0
- package/lib/host/messaging/interrupt.js +15 -0
- package/lib/host/messaging/interrupt.js.map +1 -0
- package/lib/host/messaging/recovery.d.ts +19 -0
- package/lib/host/messaging/recovery.js +114 -0
- package/lib/host/messaging/recovery.js.map +1 -0
- package/lib/host/messaging/remote.d.ts +92 -0
- package/lib/host/messaging/remote.js +119 -0
- package/lib/host/messaging/remote.js.map +1 -0
- package/lib/host/messaging/reply-routing.d.ts +6 -0
- package/lib/host/messaging/reply-routing.js +203 -0
- package/lib/host/messaging/reply-routing.js.map +1 -0
- package/lib/host/messaging/safety.d.ts +29 -0
- package/lib/host/messaging/safety.js +83 -0
- package/lib/host/messaging/safety.js.map +1 -0
- package/lib/host/messaging/scoped-projection.d.ts +43 -0
- package/lib/host/messaging/scoped-projection.js +136 -0
- package/lib/host/messaging/scoped-projection.js.map +1 -0
- package/lib/host/messaging/service.d.ts +25 -0
- package/lib/host/messaging/service.js +66 -0
- package/lib/host/messaging/service.js.map +1 -0
- package/lib/host/messaging/store.d.ts +764 -0
- package/lib/host/messaging/store.js +311 -0
- package/lib/host/messaging/store.js.map +1 -0
- package/lib/host/messaging/tool.d.ts +3 -0
- package/lib/host/messaging/tool.js +119 -0
- package/lib/host/messaging/tool.js.map +1 -0
- package/lib/host/messaging/wake.d.ts +5 -0
- package/lib/host/messaging/wake.js +14 -0
- package/lib/host/messaging/wake.js.map +1 -0
- package/lib/host/native-schedule/outcomes.d.ts +30 -0
- package/lib/host/native-schedule/outcomes.js +31 -0
- package/lib/host/native-schedule/outcomes.js.map +1 -0
- package/lib/host/native-schedule/service.d.ts +47 -0
- package/lib/host/native-schedule/service.js +164 -0
- package/lib/host/native-schedule/service.js.map +1 -0
- package/lib/host/notifications/data-flow.d.ts +6 -0
- package/lib/host/notifications/data-flow.js +56 -0
- package/lib/host/notifications/data-flow.js.map +1 -0
- package/lib/host/notifications/remote.d.ts +111 -0
- package/lib/host/notifications/remote.js +78 -0
- package/lib/host/notifications/remote.js.map +1 -0
- package/lib/host/notifications/service.d.ts +443 -0
- package/lib/host/notifications/service.js +466 -0
- package/lib/host/notifications/service.js.map +1 -0
- package/lib/host/notifications/time.d.ts +6 -0
- package/lib/host/notifications/time.js +21 -0
- package/lib/host/notifications/time.js.map +1 -0
- package/lib/host/notifications/tool.d.ts +4 -0
- package/lib/host/notifications/tool.js +97 -0
- package/lib/host/notifications/tool.js.map +1 -0
- package/lib/host/onboarding/coordinator.d.ts +87 -0
- package/lib/host/onboarding/coordinator.js +332 -0
- package/lib/host/onboarding/coordinator.js.map +1 -0
- package/lib/host/onboarding/guard.d.ts +5 -0
- package/lib/host/onboarding/guard.js +71 -0
- package/lib/host/onboarding/guard.js.map +1 -0
- package/lib/host/proactive/auto-admission.d.ts +17 -0
- package/lib/host/proactive/auto-admission.js +51 -0
- package/lib/host/proactive/auto-admission.js.map +1 -0
- package/lib/host/proactive/config.d.ts +192 -0
- package/lib/host/proactive/config.js +78 -0
- package/lib/host/proactive/config.js.map +1 -0
- package/lib/host/proactive/coordinator-client.d.ts +17 -0
- package/lib/host/proactive/coordinator-client.js +143 -0
- package/lib/host/proactive/coordinator-client.js.map +1 -0
- package/lib/host/proactive/deferred-notices.d.ts +21 -0
- package/lib/host/proactive/deferred-notices.js +147 -0
- package/lib/host/proactive/deferred-notices.js.map +1 -0
- package/lib/host/proactive/execution-prompt.d.ts +4 -0
- package/lib/host/proactive/execution-prompt.js +23 -0
- package/lib/host/proactive/execution-prompt.js.map +1 -0
- package/lib/host/proactive/execution.d.ts +36 -0
- package/lib/host/proactive/execution.js +607 -0
- package/lib/host/proactive/execution.js.map +1 -0
- package/lib/host/proactive/executors/command.d.ts +49 -0
- package/lib/host/proactive/executors/command.js +117 -0
- package/lib/host/proactive/executors/command.js.map +1 -0
- package/lib/host/proactive/executors/json-command-bridge-entry.d.ts +1 -0
- package/lib/host/proactive/executors/json-command-bridge-entry.js +29 -0
- package/lib/host/proactive/executors/json-command-bridge-entry.js.map +1 -0
- package/lib/host/proactive/executors/json-command-bridge.d.ts +46 -0
- package/lib/host/proactive/executors/json-command-bridge.js +135 -0
- package/lib/host/proactive/executors/json-command-bridge.js.map +1 -0
- package/lib/host/proactive/executors/loopback.d.ts +23 -0
- package/lib/host/proactive/executors/loopback.js +136 -0
- package/lib/host/proactive/executors/loopback.js.map +1 -0
- package/lib/host/proactive/feedback-workflow.d.ts +1336 -0
- package/lib/host/proactive/feedback-workflow.js +194 -0
- package/lib/host/proactive/feedback-workflow.js.map +1 -0
- package/lib/host/proactive/feedback.d.ts +25 -0
- package/lib/host/proactive/feedback.js +107 -0
- package/lib/host/proactive/feedback.js.map +1 -0
- package/lib/host/proactive/follow-up-events.d.ts +47 -0
- package/lib/host/proactive/follow-up-events.js +387 -0
- package/lib/host/proactive/follow-up-events.js.map +1 -0
- package/lib/host/proactive/follow-up-facts.d.ts +5 -0
- package/lib/host/proactive/follow-up-facts.js +34 -0
- package/lib/host/proactive/follow-up-facts.js.map +1 -0
- package/lib/host/proactive/follow-up-tool.d.ts +4 -0
- package/lib/host/proactive/follow-up-tool.js +195 -0
- package/lib/host/proactive/follow-up-tool.js.map +1 -0
- package/lib/host/proactive/governance-artifacts.d.ts +8 -0
- package/lib/host/proactive/governance-artifacts.js +182 -0
- package/lib/host/proactive/governance-artifacts.js.map +1 -0
- package/lib/host/proactive/governance-service.d.ts +39 -0
- package/lib/host/proactive/governance-service.js +146 -0
- package/lib/host/proactive/governance-service.js.map +1 -0
- package/lib/host/proactive/group-budget.d.ts +25 -0
- package/lib/host/proactive/group-budget.js +145 -0
- package/lib/host/proactive/group-budget.js.map +1 -0
- package/lib/host/proactive/group-follow-up.d.ts +10 -0
- package/lib/host/proactive/group-follow-up.js +95 -0
- package/lib/host/proactive/group-follow-up.js.map +1 -0
- package/lib/host/proactive/group-repair.d.ts +93 -0
- package/lib/host/proactive/group-repair.js +283 -0
- package/lib/host/proactive/group-repair.js.map +1 -0
- package/lib/host/proactive/index.d.ts +10 -0
- package/lib/host/proactive/index.js +26 -0
- package/lib/host/proactive/index.js.map +1 -0
- package/lib/host/proactive/lifecycle.d.ts +24 -0
- package/lib/host/proactive/lifecycle.js +187 -0
- package/lib/host/proactive/lifecycle.js.map +1 -0
- package/lib/host/proactive/method-evaluation.d.ts +5 -0
- package/lib/host/proactive/method-evaluation.js +41 -0
- package/lib/host/proactive/method-evaluation.js.map +1 -0
- package/lib/host/proactive/method-package.d.ts +33 -0
- package/lib/host/proactive/method-package.js +25 -0
- package/lib/host/proactive/method-package.js.map +1 -0
- package/lib/host/proactive/method-skill.d.ts +7 -0
- package/lib/host/proactive/method-skill.js +20 -0
- package/lib/host/proactive/method-skill.js.map +1 -0
- package/lib/host/proactive/model-budget.d.ts +10 -0
- package/lib/host/proactive/model-budget.js +48 -0
- package/lib/host/proactive/model-budget.js.map +1 -0
- package/lib/host/proactive/notice-pump.d.ts +16 -0
- package/lib/host/proactive/notice-pump.js +174 -0
- package/lib/host/proactive/notice-pump.js.map +1 -0
- package/lib/host/proactive/notification-bridge.d.ts +3 -0
- package/lib/host/proactive/notification-bridge.js +26 -0
- package/lib/host/proactive/notification-bridge.js.map +1 -0
- package/lib/host/proactive/read-query.d.ts +4 -0
- package/lib/host/proactive/read-query.js +53 -0
- package/lib/host/proactive/read-query.js.map +1 -0
- package/lib/host/proactive/remote.d.ts +5076 -0
- package/lib/host/proactive/remote.js +351 -0
- package/lib/host/proactive/remote.js.map +1 -0
- package/lib/host/proactive/repair.d.ts +48 -0
- package/lib/host/proactive/repair.js +205 -0
- package/lib/host/proactive/repair.js.map +1 -0
- package/lib/host/proactive/result-journal.d.ts +215 -0
- package/lib/host/proactive/result-journal.js +132 -0
- package/lib/host/proactive/result-journal.js.map +1 -0
- package/lib/host/proactive/service.d.ts +32106 -0
- package/lib/host/proactive/service.js +1632 -0
- package/lib/host/proactive/service.js.map +1 -0
- package/lib/host/proactive/setup.d.ts +13 -0
- package/lib/host/proactive/setup.js +94 -0
- package/lib/host/proactive/setup.js.map +1 -0
- package/lib/host/proactive/sources/ci-feed.d.ts +21 -0
- package/lib/host/proactive/sources/ci-feed.js +86 -0
- package/lib/host/proactive/sources/ci-feed.js.map +1 -0
- package/lib/host/proactive/sources/ci.d.ts +35 -0
- package/lib/host/proactive/sources/ci.js +72 -0
- package/lib/host/proactive/sources/ci.js.map +1 -0
- package/lib/host/proactive/sources/github-ci.d.ts +16 -0
- package/lib/host/proactive/sources/github-ci.js +117 -0
- package/lib/host/proactive/sources/github-ci.js.map +1 -0
- package/lib/host/proactive/task-cost.d.ts +10 -0
- package/lib/host/proactive/task-cost.js +70 -0
- package/lib/host/proactive/task-cost.js.map +1 -0
- package/lib/host/proactive/wire.d.ts +5 -0
- package/lib/host/proactive/wire.js +48 -0
- package/lib/host/proactive/wire.js.map +1 -0
- package/lib/host/proactive/work-continuation.d.ts +21 -0
- package/lib/host/proactive/work-continuation.js +66 -0
- package/lib/host/proactive/work-continuation.js.map +1 -0
- package/lib/host/proactive/workspace-process.d.ts +25 -0
- package/lib/host/proactive/workspace-process.js +80 -0
- package/lib/host/proactive/workspace-process.js.map +1 -0
- package/lib/host/proactive/workspace-repair.d.ts +425 -0
- package/lib/host/proactive/workspace-repair.js +352 -0
- package/lib/host/proactive/workspace-repair.js.map +1 -0
- package/lib/host/reference-memory/backend.d.ts +13 -0
- package/lib/host/reference-memory/backend.js +134 -0
- package/lib/host/reference-memory/backend.js.map +1 -0
- package/lib/host/reference-memory/cleanup-files.d.ts +7 -0
- package/lib/host/reference-memory/cleanup-files.js +36 -0
- package/lib/host/reference-memory/cleanup-files.js.map +1 -0
- package/lib/host/reference-memory/copies.d.ts +87 -0
- package/lib/host/reference-memory/copies.js +218 -0
- package/lib/host/reference-memory/copies.js.map +1 -0
- package/lib/host/reference-memory/files.d.ts +4 -0
- package/lib/host/reference-memory/files.js +43 -0
- package/lib/host/reference-memory/files.js.map +1 -0
- package/lib/host/reference-memory/model.d.ts +195 -0
- package/lib/host/reference-memory/model.js +66 -0
- package/lib/host/reference-memory/model.js.map +1 -0
- package/lib/host/reference-memory/service.d.ts +157 -0
- package/lib/host/reference-memory/service.js +124 -0
- package/lib/host/reference-memory/service.js.map +1 -0
- package/lib/host/reference-memory/writer.d.ts +55 -0
- package/lib/host/reference-memory/writer.js +265 -0
- package/lib/host/reference-memory/writer.js.map +1 -0
- package/lib/host/registry/identity.d.ts +3 -0
- package/lib/host/registry/identity.js +9 -0
- package/lib/host/registry/identity.js.map +1 -0
- package/lib/host/registry/lifecycle.d.ts +119 -0
- package/lib/host/registry/lifecycle.js +226 -0
- package/lib/host/registry/lifecycle.js.map +1 -0
- package/lib/host/registry/mutations.d.ts +7 -0
- package/lib/host/registry/mutations.js +25 -0
- package/lib/host/registry/mutations.js.map +1 -0
- package/lib/host/registry/presets.d.ts +13 -0
- package/lib/host/registry/presets.js +169 -0
- package/lib/host/registry/presets.js.map +1 -0
- package/lib/host/registry/types.d.ts +11 -0
- package/lib/host/registry/types.js +3 -0
- package/lib/host/registry/types.js.map +1 -0
- package/lib/host/registry-config.d.ts +69 -0
- package/lib/host/registry-config.js +125 -0
- package/lib/host/registry-config.js.map +1 -0
- package/lib/host/registry.d.ts +145 -0
- package/lib/host/registry.js +490 -0
- package/lib/host/registry.js.map +1 -0
- package/lib/host/shadow/budget.d.ts +106 -0
- package/lib/host/shadow/budget.js +112 -0
- package/lib/host/shadow/budget.js.map +1 -0
- package/lib/host/shadow/config.d.ts +13 -0
- package/lib/host/shadow/config.js +13 -0
- package/lib/host/shadow/config.js.map +1 -0
- package/lib/host/shadow/notification-adapter.d.ts +5 -0
- package/lib/host/shadow/notification-adapter.js +16 -0
- package/lib/host/shadow/notification-adapter.js.map +1 -0
- package/lib/host/shadow/planner.d.ts +39 -0
- package/lib/host/shadow/planner.js +76 -0
- package/lib/host/shadow/planner.js.map +1 -0
- package/lib/host/shadow/schedule-adapter.d.ts +23 -0
- package/lib/host/shadow/schedule-adapter.js +15 -0
- package/lib/host/shadow/schedule-adapter.js.map +1 -0
- package/lib/host/shadow/service.d.ts +23 -0
- package/lib/host/shadow/service.js +25 -0
- package/lib/host/shadow/service.js.map +1 -0
- package/lib/host/store.d.ts +25 -0
- package/lib/host/store.js +74 -0
- package/lib/host/store.js.map +1 -0
- package/lib/host/stores/activity.d.ts +35 -0
- package/lib/host/stores/activity.js +188 -0
- package/lib/host/stores/activity.js.map +1 -0
- package/lib/host/stores/bots.d.ts +21 -0
- package/lib/host/stores/bots.js +128 -0
- package/lib/host/stores/bots.js.map +1 -0
- package/lib/host/stores/domain.d.ts +343 -0
- package/lib/host/stores/domain.js +98 -0
- package/lib/host/stores/domain.js.map +1 -0
- package/lib/host/stores/memory.d.ts +29 -0
- package/lib/host/stores/memory.js +139 -0
- package/lib/host/stores/memory.js.map +1 -0
- package/lib/host/supergroup/collaboration.d.ts +99 -0
- package/lib/host/supergroup/collaboration.js +361 -0
- package/lib/host/supergroup/collaboration.js.map +1 -0
- package/lib/host/supergroup/config.d.ts +15 -0
- package/lib/host/supergroup/config.js +33 -0
- package/lib/host/supergroup/config.js.map +1 -0
- package/lib/host/supergroup/input-capability.d.ts +4 -0
- package/lib/host/supergroup/input-capability.js +21 -0
- package/lib/host/supergroup/input-capability.js.map +1 -0
- package/lib/host/supergroup/remote.d.ts +1944 -0
- package/lib/host/supergroup/remote.js +123 -0
- package/lib/host/supergroup/remote.js.map +1 -0
- package/lib/host/supergroup/service.d.ts +935 -0
- package/lib/host/supergroup/service.js +921 -0
- package/lib/host/supergroup/service.js.map +1 -0
- package/lib/host/supergroup/task-support.d.ts +245 -0
- package/lib/host/supergroup/task-support.js +310 -0
- package/lib/host/supergroup/task-support.js.map +1 -0
- package/lib/host/supergroup/tool.d.ts +4 -0
- package/lib/host/supergroup/tool.js +74 -0
- package/lib/host/supergroup/tool.js.map +1 -0
- package/lib/host/tools/bot-manage.d.ts +14 -0
- package/lib/host/tools/bot-manage.js +440 -0
- package/lib/host/tools/bot-manage.js.map +1 -0
- package/lib/host/workspace/remote.d.ts +194 -0
- package/lib/host/workspace/remote.js +98 -0
- package/lib/host/workspace/remote.js.map +1 -0
- package/lib/host/workspace/service.d.ts +185 -0
- package/lib/host/workspace/service.js +261 -0
- package/lib/host/workspace/service.js.map +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +58 -0
- package/lib/index.js.map +1 -0
- package/lib/module-manifest.json +278 -0
- package/lib/proactive-coordinator/LICENSE +21 -0
- package/lib/proactive-coordinator/core.mjs +19067 -0
- package/lib/proactive-coordinator/main.mjs +22363 -0
- package/lib/proactive-coordinator/package.json +1 -0
- package/lib/proactive-coordinator/prompts/admission.md +68 -0
- package/lib/proactive-coordinator/prompts/cli.md +17 -0
- package/lib/proactive-coordinator/prompts/dispatch.md +59 -0
- package/lib/proactive-coordinator/prompts/handoff-orchestrator.md +4 -0
- package/lib/proactive-coordinator/prompts/handoff-worker.md +7 -0
- package/lib/proactive-coordinator/prompts/handoff.md +6 -0
- package/lib/proactive-coordinator/prompts/orchestrator.md +16 -0
- package/lib/proactive-coordinator/prompts/replies.md +35 -0
- package/lib/proactive-coordinator/prompts/shared.md +7 -0
- package/lib/proactive-coordinator/prompts/subscriptions.md +13 -0
- package/lib/proactive-coordinator/prompts/team/communication.md +97 -0
- package/lib/proactive-coordinator/prompts/team/delivery.md +28 -0
- package/lib/proactive-coordinator/prompts/team/scope.md +22 -0
- package/lib/proactive-coordinator/prompts/work.md +49 -0
- package/lib/proactive-coordinator/prompts/worker.md +10 -0
- package/lib/proactive-coordinator/provenance.json +7 -0
- package/lib/proactive-coordinator/skills/dsh-superagent-feishu/SKILL.md +12 -0
- package/lib/proactive-coordinator/skills/dsh-superagent-github/SKILL.md +14 -0
- package/lib/shared/activity-preview.d.ts +5 -0
- package/lib/shared/activity-preview.js +40 -0
- package/lib/shared/activity-preview.js.map +1 -0
- package/lib/shared/activity.d.ts +107 -0
- package/lib/shared/activity.js +50 -0
- package/lib/shared/activity.js.map +1 -0
- package/lib/shared/automation-contract.d.ts +1138 -0
- package/lib/shared/automation-contract.js +63 -0
- package/lib/shared/automation-contract.js.map +1 -0
- package/lib/shared/automation.d.ts +336 -0
- package/lib/shared/automation.js +244 -0
- package/lib/shared/automation.js.map +1 -0
- package/lib/shared/bot-brand.d.ts +20 -0
- package/lib/shared/bot-brand.js +26 -0
- package/lib/shared/bot-brand.js.map +1 -0
- package/lib/shared/capabilities-contract.d.ts +685 -0
- package/lib/shared/capabilities-contract.js +38 -0
- package/lib/shared/capabilities-contract.js.map +1 -0
- package/lib/shared/collaboration-contract.d.ts +614 -0
- package/lib/shared/collaboration-contract.js +52 -0
- package/lib/shared/collaboration-contract.js.map +1 -0
- package/lib/shared/collaboration.d.ts +132 -0
- package/lib/shared/collaboration.js +63 -0
- package/lib/shared/collaboration.js.map +1 -0
- package/lib/shared/connectors.d.ts +216 -0
- package/lib/shared/connectors.js +121 -0
- package/lib/shared/connectors.js.map +1 -0
- package/lib/shared/data-flow.d.ts +135 -0
- package/lib/shared/data-flow.js +53 -0
- package/lib/shared/data-flow.js.map +1 -0
- package/lib/shared/eval-budget.d.ts +100 -0
- package/lib/shared/eval-budget.js +34 -0
- package/lib/shared/eval-budget.js.map +1 -0
- package/lib/shared/group-recall-reads.d.ts +35 -0
- package/lib/shared/group-recall-reads.js +12 -0
- package/lib/shared/group-recall-reads.js.map +1 -0
- package/lib/shared/group-recall.d.ts +132 -0
- package/lib/shared/group-recall.js +52 -0
- package/lib/shared/group-recall.js.map +1 -0
- package/lib/shared/groups-contract.d.ts +5905 -0
- package/lib/shared/groups-contract.js +105 -0
- package/lib/shared/groups-contract.js.map +1 -0
- package/lib/shared/groups.d.ts +1127 -0
- package/lib/shared/groups.js +257 -0
- package/lib/shared/groups.js.map +1 -0
- package/lib/shared/identity.d.ts +14 -0
- package/lib/shared/identity.js +13 -0
- package/lib/shared/identity.js.map +1 -0
- package/lib/shared/ids.d.ts +5 -0
- package/lib/shared/ids.js +6 -0
- package/lib/shared/ids.js.map +1 -0
- package/lib/shared/integrations-contract.d.ts +1916 -0
- package/lib/shared/integrations-contract.js +71 -0
- package/lib/shared/integrations-contract.js.map +1 -0
- package/lib/shared/integrations.d.ts +216 -0
- package/lib/shared/integrations.js +20 -0
- package/lib/shared/integrations.js.map +1 -0
- package/lib/shared/managed-flow.d.ts +199 -0
- package/lib/shared/managed-flow.js +15 -0
- package/lib/shared/managed-flow.js.map +1 -0
- package/lib/shared/memory-forget.d.ts +122 -0
- package/lib/shared/memory-forget.js +32 -0
- package/lib/shared/memory-forget.js.map +1 -0
- package/lib/shared/memory-management.d.ts +1014 -0
- package/lib/shared/memory-management.js +48 -0
- package/lib/shared/memory-management.js.map +1 -0
- package/lib/shared/memory-ops.d.ts +274 -0
- package/lib/shared/memory-ops.js +35 -0
- package/lib/shared/memory-ops.js.map +1 -0
- package/lib/shared/memory-tool-names.d.ts +2 -0
- package/lib/shared/memory-tool-names.js +9 -0
- package/lib/shared/memory-tool-names.js.map +1 -0
- package/lib/shared/memory-v2.d.ts +268 -0
- package/lib/shared/memory-v2.js +51 -0
- package/lib/shared/memory-v2.js.map +1 -0
- package/lib/shared/messaging-contract.d.ts +161 -0
- package/lib/shared/messaging-contract.js +24 -0
- package/lib/shared/messaging-contract.js.map +1 -0
- package/lib/shared/messaging.d.ts +808 -0
- package/lib/shared/messaging.js +231 -0
- package/lib/shared/messaging.js.map +1 -0
- package/lib/shared/native-schedule.d.ts +35 -0
- package/lib/shared/native-schedule.js +25 -0
- package/lib/shared/native-schedule.js.map +1 -0
- package/lib/shared/notifications.d.ts +167 -0
- package/lib/shared/notifications.js +104 -0
- package/lib/shared/notifications.js.map +1 -0
- package/lib/shared/onboarding-source.d.ts +19 -0
- package/lib/shared/onboarding-source.js +9 -0
- package/lib/shared/onboarding-source.js.map +1 -0
- package/lib/shared/onboarding.d.ts +115 -0
- package/lib/shared/onboarding.js +14 -0
- package/lib/shared/onboarding.js.map +1 -0
- package/lib/shared/operation-errors.d.ts +18 -0
- package/lib/shared/operation-errors.js +18 -0
- package/lib/shared/operation-errors.js.map +1 -0
- package/lib/shared/proactive/activity.d.ts +152 -0
- package/lib/shared/proactive/activity.js +23 -0
- package/lib/shared/proactive/activity.js.map +1 -0
- package/lib/shared/proactive/document.d.ts +31 -0
- package/lib/shared/proactive/document.js +17 -0
- package/lib/shared/proactive/document.js.map +1 -0
- package/lib/shared/proactive/feedback.d.ts +2315 -0
- package/lib/shared/proactive/feedback.js +177 -0
- package/lib/shared/proactive/feedback.js.map +1 -0
- package/lib/shared/proactive/follow-up.d.ts +1241 -0
- package/lib/shared/proactive/follow-up.js +178 -0
- package/lib/shared/proactive/follow-up.js.map +1 -0
- package/lib/shared/proactive/governance.d.ts +147 -0
- package/lib/shared/proactive/governance.js +92 -0
- package/lib/shared/proactive/governance.js.map +1 -0
- package/lib/shared/proactive/group-follow-up.d.ts +228 -0
- package/lib/shared/proactive/group-follow-up.js +24 -0
- package/lib/shared/proactive/group-follow-up.js.map +1 -0
- package/lib/shared/proactive/group-repair.d.ts +185 -0
- package/lib/shared/proactive/group-repair.js +95 -0
- package/lib/shared/proactive/group-repair.js.map +1 -0
- package/lib/shared/proactive/handoff.d.ts +17 -0
- package/lib/shared/proactive/handoff.js +15 -0
- package/lib/shared/proactive/handoff.js.map +1 -0
- package/lib/shared/proactive/method-evaluation.d.ts +187 -0
- package/lib/shared/proactive/method-evaluation.js +46 -0
- package/lib/shared/proactive/method-evaluation.js.map +1 -0
- package/lib/shared/proactive/method-package.d.ts +131 -0
- package/lib/shared/proactive/method-package.js +28 -0
- package/lib/shared/proactive/method-package.js.map +1 -0
- package/lib/shared/proactive/notices.d.ts +126 -0
- package/lib/shared/proactive/notices.js +64 -0
- package/lib/shared/proactive/notices.js.map +1 -0
- package/lib/shared/proactive/outcomes.d.ts +23 -0
- package/lib/shared/proactive/outcomes.js +41 -0
- package/lib/shared/proactive/outcomes.js.map +1 -0
- package/lib/shared/proactive/protocol.d.ts +12730 -0
- package/lib/shared/proactive/protocol.js +688 -0
- package/lib/shared/proactive/protocol.js.map +1 -0
- package/lib/shared/proactive/remote-contract.d.ts +30326 -0
- package/lib/shared/proactive/remote-contract.js +248 -0
- package/lib/shared/proactive/remote-contract.js.map +1 -0
- package/lib/shared/proactive/repair.d.ts +65 -0
- package/lib/shared/proactive/repair.js +55 -0
- package/lib/shared/proactive/repair.js.map +1 -0
- package/lib/shared/proactive/responsibility.d.ts +1085 -0
- package/lib/shared/proactive/responsibility.js +222 -0
- package/lib/shared/proactive/responsibility.js.map +1 -0
- package/lib/shared/proactive/setup.d.ts +250 -0
- package/lib/shared/proactive/setup.js +26 -0
- package/lib/shared/proactive/setup.js.map +1 -0
- package/lib/shared/proactive/work-progress.d.ts +14 -0
- package/lib/shared/proactive/work-progress.js +22 -0
- package/lib/shared/proactive/work-progress.js.map +1 -0
- package/lib/shared/proactive/work.d.ts +2887 -0
- package/lib/shared/proactive/work.js +250 -0
- package/lib/shared/proactive/work.js.map +1 -0
- package/lib/shared/proactive/workspace-repair.d.ts +283 -0
- package/lib/shared/proactive/workspace-repair.js +195 -0
- package/lib/shared/proactive/workspace-repair.js.map +1 -0
- package/lib/shared/reference-memory.d.ts +517 -0
- package/lib/shared/reference-memory.js +188 -0
- package/lib/shared/reference-memory.js.map +1 -0
- package/lib/shared/remote-contract.d.ts +5109 -0
- package/lib/shared/remote-contract.js +213 -0
- package/lib/shared/remote-contract.js.map +1 -0
- package/lib/shared/routine-outcomes.d.ts +20 -0
- package/lib/shared/routine-outcomes.js +9 -0
- package/lib/shared/routine-outcomes.js.map +1 -0
- package/lib/shared/schema.d.ts +785 -0
- package/lib/shared/schema.js +203 -0
- package/lib/shared/schema.js.map +1 -0
- package/lib/shared/secrets.d.ts +2 -0
- package/lib/shared/secrets.js +15 -0
- package/lib/shared/secrets.js.map +1 -0
- package/lib/shared/shadow.d.ts +12 -0
- package/lib/shared/shadow.js +8 -0
- package/lib/shared/shadow.js.map +1 -0
- package/lib/shared/supergroup-contract.d.ts +7119 -0
- package/lib/shared/supergroup-contract.js +26 -0
- package/lib/shared/supergroup-contract.js.map +1 -0
- package/lib/shared/supergroup.d.ts +1441 -0
- package/lib/shared/supergroup.js +56 -0
- package/lib/shared/supergroup.js.map +1 -0
- package/lib/shared/task-materials.d.ts +166 -0
- package/lib/shared/task-materials.js +40 -0
- package/lib/shared/task-materials.js.map +1 -0
- package/lib/shared/team-recipes.d.ts +109 -0
- package/lib/shared/team-recipes.js +25 -0
- package/lib/shared/team-recipes.js.map +1 -0
- package/lib/shared/version.d.ts +1 -0
- package/lib/shared/version.js +3 -0
- package/lib/shared/version.js.map +1 -0
- package/lib/shared/workspace-contract.d.ts +2284 -0
- package/lib/shared/workspace-contract.js +37 -0
- package/lib/shared/workspace-contract.js.map +1 -0
- package/lib/shared/workspace.d.ts +496 -0
- package/lib/shared/workspace.js +120 -0
- package/lib/shared/workspace.js.map +1 -0
- package/lib/typert.host.d.ts +12 -0
- package/lib/typert.host.js +13 -0
- package/lib/typert.host.js.map +1 -0
- package/lib/typert.remote-client.d.ts +4 -0
- package/lib/typert.remote-client.js +9 -0
- package/lib/typert.remote-client.js.map +1 -0
- package/locale/en.json +1876 -0
- package/locale/zh.json +1876 -0
- package/package.json +177 -3
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
import { groupMemberModel, proactiveMemberModel } from './model-selection.js';
|
|
2
|
+
import { verifyOwnerFollowUpChoice } from './owner-follow-up.js';
|
|
3
|
+
import { ConcurrentGroups } from './concurrent.js';
|
|
4
|
+
import { workerReservations } from './worker-tool.js';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
7
|
+
import { setSandboxMode } from '@deepseek-ai/dsh-sandbox-policy';
|
|
8
|
+
import { proactiveGroupInputs, waitIdle } from '../proactive/execution.js';
|
|
9
|
+
import { assertModelBudget } from '../proactive/model-budget.js';
|
|
10
|
+
import { groupChild, groupResult } from './data-flow.js';
|
|
11
|
+
import { outlets } from '../data-flow/tool-guard.js';
|
|
12
|
+
import { nextRoundRobinMember } from './round-robin.js';
|
|
13
|
+
import { hasOperationCode } from '../../shared/operation-errors.js';
|
|
14
|
+
import { ReasoningEffortId, createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
15
|
+
import { OperationError, need, digest } from '../common/operations.js';
|
|
16
|
+
import { groupContext } from './routing.js';
|
|
17
|
+
import { compatibleActivationSpec } from '../common/subagent-activation.js';
|
|
18
|
+
import { blocks, textOf, terminal } from './model.js';
|
|
19
|
+
import { memberRunFailure } from './failure.js';
|
|
20
|
+
import { checkSupergroup, checkSupergroupEnqueue, groupReaders } from './supergroup-admission.js';
|
|
21
|
+
export class GroupTurnRunner {
|
|
22
|
+
state;
|
|
23
|
+
roots;
|
|
24
|
+
messages;
|
|
25
|
+
concurrent;
|
|
26
|
+
constructor(state, roots, messages) {
|
|
27
|
+
this.state = state;
|
|
28
|
+
this.roots = roots;
|
|
29
|
+
this.messages = messages;
|
|
30
|
+
this.concurrent = new ConcurrentGroups(state, roots, messages, this);
|
|
31
|
+
}
|
|
32
|
+
/** Called inside the service queue. A delivery receipt is the durable acceptance point. */
|
|
33
|
+
async enqueue(t, memberId, triggerMessageId, id, returnMemberId, requestDigest) {
|
|
34
|
+
if (t.ownerFollowUp)
|
|
35
|
+
throw new OperationError('approval-denied');
|
|
36
|
+
const old = this.state.table('deliveries').get(id);
|
|
37
|
+
if (old) {
|
|
38
|
+
if (requestDigest && old.requestDigest !== requestDigest)
|
|
39
|
+
throw new OperationError('conflict');
|
|
40
|
+
return old;
|
|
41
|
+
}
|
|
42
|
+
const g = this.state.record(t.group), rows = this.state.deliveries(t.id);
|
|
43
|
+
await checkSupergroup(this.state, g);
|
|
44
|
+
checkSupergroupEnqueue(this.state, g);
|
|
45
|
+
const timeout = t.protocol === 2 ? this.state.registry.config.groupTaskTimeoutMs : this.state.registry.config.groupRoundTimeoutMs;
|
|
46
|
+
if (this.state.cancelledTurns.has(t.id) || (terminal(need(this.state.table('turns').get(t.id))) && !(t.protocol === 2 && this.state.table('turns').get(t.id)?.state === 'paused')) ||
|
|
47
|
+
(timeout > 0 && Date.now() >= t.createdAt + timeout))
|
|
48
|
+
throw new OperationError('unavailable');
|
|
49
|
+
if (t.protocol !== 2 && rows.length >= t.orderedMemberIds.length + this.state.registry.config.groupMaxContinuations)
|
|
50
|
+
throw new OperationError('invalid');
|
|
51
|
+
if (t.protocol === 2 && rows.some(row => row.memberId === memberId && row.state === 'unknown'))
|
|
52
|
+
throw new OperationError('recovery-needed');
|
|
53
|
+
if (g.membershipRevision !== t.membershipRevision)
|
|
54
|
+
throw new OperationError('conflict');
|
|
55
|
+
const member = this.state.members(g).find(m => m.id === memberId && m.enabled && m.removedAt === undefined);
|
|
56
|
+
if (!member)
|
|
57
|
+
throw new OperationError('invalid');
|
|
58
|
+
const bot = await this.state.bot(member.bot), status = need((await this.state.registry.status()).find(s => s.id === bot.id));
|
|
59
|
+
const row = { id, turnId: t.id, memberId, ordinal: rows.length, bot: member.bot,
|
|
60
|
+
botRevision: bot.updatedAt, presetId: status.presetId, triggerMessageId, returnMemberId, requestDigest,
|
|
61
|
+
contextOutputMessageIds: [], contextTruncated: false, state: 'pending', ...(t.protocol === 2 ? { automatic: true } : {}) };
|
|
62
|
+
await this.state.putDelivery(row);
|
|
63
|
+
return row;
|
|
64
|
+
}
|
|
65
|
+
async groupMessage(agent, binding, input, callId, signal) {
|
|
66
|
+
if (input.action === 'request-expert')
|
|
67
|
+
return this.state.queue.run(async () => {
|
|
68
|
+
signal.throwIfAborted();
|
|
69
|
+
const turn = need(this.state.table('turns').get(binding.turnId)), group = this.state.record(turn.group);
|
|
70
|
+
const delivery = need(this.state.table('deliveries').get(binding.deliveryId));
|
|
71
|
+
if (!group.supergroup || !this.state.expertHandler || this.state.workers.get(agent.session.id) !== binding ||
|
|
72
|
+
binding.agent !== agent || !binding.isActive?.() || this.state.cancelledTurns.has(turn.id) ||
|
|
73
|
+
group.membershipRevision !== turn.membershipRevision || !['starting', 'running'].includes(delivery.state) ||
|
|
74
|
+
!group.supergroup.readers.some(reader => reader.botId === input.botId) || input.botId === delivery.bot.botId)
|
|
75
|
+
throw new OperationError('approval-denied');
|
|
76
|
+
await checkSupergroup(this.state, group);
|
|
77
|
+
const id = `expert-request:${digest([delivery.id, callId])}`;
|
|
78
|
+
const previous = this.messages.messages(group).find(message => message.causeId === id);
|
|
79
|
+
if (!previous) {
|
|
80
|
+
const bot = await this.state.bot(delivery.bot), root = need(this.state.roots.get(group.id));
|
|
81
|
+
const message = createUserMessage({ source: { kind: 'dsh-bot-group', group: turn.group, turnId: turn.id,
|
|
82
|
+
memberId: delivery.memberId, speaker: { bot: delivery.bot, name: bot.name }, childSessionId: agent.session.id,
|
|
83
|
+
stopReason: 'expert-request', causeId: id }, content: blocks(JSON.stringify({ botId: input.botId, question: input.question })) });
|
|
84
|
+
await groupResult(this.state, group, delivery.bot, agent.session.id, root.agent, JSON.stringify(message), id, () => root.agent.session.append('user/message', message, { surfaceOp: 'append' }), signal);
|
|
85
|
+
await this.roots.flush(root);
|
|
86
|
+
}
|
|
87
|
+
await checkSupergroup(this.state, group);
|
|
88
|
+
// The callback only records a request. Waiting for this turn would deadlock its own worker.
|
|
89
|
+
await this.state.expertHandler({ group: turn.group, workId: group.supergroup.workId, agent, binding, callId,
|
|
90
|
+
botId: input.botId, question: input.question });
|
|
91
|
+
return { status: 'accepted', requestId: id };
|
|
92
|
+
});
|
|
93
|
+
if (this.state.table('turns').get(binding.turnId)?.protocol === 2)
|
|
94
|
+
return this.concurrent.message(agent, binding, input, callId, signal);
|
|
95
|
+
return this.state.queue.run(async () => {
|
|
96
|
+
signal.throwIfAborted();
|
|
97
|
+
const t = need(this.state.table('turns').get(binding.turnId)), g = this.state.record(t.group), d = need(this.state.table('deliveries').get(binding.deliveryId));
|
|
98
|
+
await checkSupergroup(this.state, g);
|
|
99
|
+
if (this.state.workers.get(agent.session.id) !== binding || this.state.cancelledTurns.has(t.id) ||
|
|
100
|
+
!['starting', 'running'].includes(d.state))
|
|
101
|
+
throw new OperationError('approval-denied');
|
|
102
|
+
if (input.action === 'skip') {
|
|
103
|
+
await this.state.putDelivery({ ...d, skipped: true });
|
|
104
|
+
return { status: 'skipped' };
|
|
105
|
+
}
|
|
106
|
+
if (d.skipped)
|
|
107
|
+
throw new OperationError('invalid');
|
|
108
|
+
const root = need(this.state.roots.get(g.id)), bot = await this.state.bot(d.bot), id = `group-message:${digest([d.id, callId])}`, hash = digest(input);
|
|
109
|
+
const old = this.state.table('deliveries').get(id);
|
|
110
|
+
if (old) {
|
|
111
|
+
if (old.requestDigest !== hash)
|
|
112
|
+
throw new OperationError('conflict');
|
|
113
|
+
return { status: old.state === 'unknown' ? 'unknown' : 'accepted', messageId: old.triggerMessageId };
|
|
114
|
+
}
|
|
115
|
+
const messages = this.messages.messages(g), reply = input.replyTo ? messages.find(m => m.id === input.replyTo) : undefined;
|
|
116
|
+
if (input.replyTo && (!reply || (reply.seq > t.contextThroughSeq && reply.turnId !== t.id && !t.predecessorTurnIds?.includes(reply.turnId))))
|
|
117
|
+
throw new OperationError('invalid');
|
|
118
|
+
const target = input.to ?? (reply?.speaker && this.state.members(g).find(m => m.bot.botId === reply.speaker?.bot.botId && m.bot.botCreatedAt === reply.speaker.bot.botCreatedAt)?.id);
|
|
119
|
+
if (this.state.deliveries(t.id).length >= t.orderedMemberIds.length + this.state.registry.config.groupMaxContinuations)
|
|
120
|
+
throw new OperationError('invalid');
|
|
121
|
+
if (input.requestReply && !target)
|
|
122
|
+
throw new OperationError('invalid');
|
|
123
|
+
const message = createUserMessage({ source: { kind: 'dsh-bot-group', group: t.group, turnId: t.id,
|
|
124
|
+
memberId: d.memberId, speaker: { bot: d.bot, name: bot.name, ...(bot.avatar ? { avatar: bot.avatar } : {}), ...(bot.avatarColor ? { avatarColor: bot.avatarColor } : {}), ...(bot.avatarVariant ? { avatarVariant: bot.avatarVariant } : {}) },
|
|
125
|
+
childSessionId: binding.childId, stopReason: 'group-message', replyTo: input.replyTo ?? d.triggerMessageId ?? t.inputMessageId, causeId: t.id }, content: blocks(input.text) });
|
|
126
|
+
// A receipt is written before the native append. Unknown append outcomes are never replayed.
|
|
127
|
+
const receipt = target ? await this.enqueue(t, target, message.id, id, input.requestReply ? d.memberId : undefined, hash) :
|
|
128
|
+
{ ...d, id, ordinal: this.state.deliveries(t.id).length, triggerMessageId: message.id, requestDigest: hash, returnMemberId: undefined, state: 'skipped' };
|
|
129
|
+
if (!target)
|
|
130
|
+
await this.state.putDelivery(receipt);
|
|
131
|
+
try {
|
|
132
|
+
await groupResult(this.state, g, d.bot, binding.childId, root.agent, JSON.stringify(message), id, () => root.agent.session.append('user/message', message, { surfaceOp: 'append' }), signal);
|
|
133
|
+
await this.roots.flush(root);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
await this.state.putDelivery({ ...receipt, state: 'unknown', reasonCode: 'message-append-unknown' });
|
|
137
|
+
throw new OperationError('recovery-needed');
|
|
138
|
+
}
|
|
139
|
+
return { status: 'accepted', messageId: message.id };
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
async prepareDelivery(t, deliveryId, signal) {
|
|
143
|
+
return this.state.queue.run(async () => {
|
|
144
|
+
const d = need(this.state.table('deliveries').get(deliveryId)), g = this.state.record(t.group);
|
|
145
|
+
await checkSupergroup(this.state, g);
|
|
146
|
+
checkSupergroupEnqueue(this.state, g);
|
|
147
|
+
const member = this.state.members(g).find((m) => m.id === d.memberId);
|
|
148
|
+
if (this.state.stopped ||
|
|
149
|
+
this.state.cancelledTurns.has(t.id) ||
|
|
150
|
+
d.state !== 'pending' ||
|
|
151
|
+
((t.proactive || t.ownerFollowUp || g.supergroup) && g.membershipRevision !== t.membershipRevision) ||
|
|
152
|
+
signal.aborted ||
|
|
153
|
+
!member?.enabled ||
|
|
154
|
+
member.removedAt !== undefined ||
|
|
155
|
+
g.archived ||
|
|
156
|
+
this.state.table('turns').get(t.id)?.stoppedMemberIds?.includes(d.memberId)) {
|
|
157
|
+
await this.state.putDelivery({ ...d, state: 'cancelled' });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const bot = await this.state.bot(d.bot);
|
|
161
|
+
const status = (await this.state.registry.status()).find((s) => s.id === bot.id);
|
|
162
|
+
if (bot.updatedAt !== d.botRevision || status?.presetId !== d.presetId || status.preset.state !== 'ok')
|
|
163
|
+
throw new OperationError('conflict');
|
|
164
|
+
const root = need(this.state.roots.get(g.id));
|
|
165
|
+
const messages = this.messages.messages(g);
|
|
166
|
+
const question = need(messages.find((m) => m.id === (d.triggerMessageId ?? t.inputMessageId)));
|
|
167
|
+
const previous = t.proactive || t.ownerFollowUp ? [] : this.state
|
|
168
|
+
.turns(g).filter(prior => prior.id === t.id || t.predecessorTurnIds?.includes(prior.id))
|
|
169
|
+
.flatMap(prior => this.state.deliveries(prior.id))
|
|
170
|
+
.filter((row) => t.protocol === 2 ? row.turnId !== t.id : row.ordinal < d.ordinal || row.turnId !== t.id)
|
|
171
|
+
.filter((d) => d.outputMessageId)
|
|
172
|
+
.map((d) => need(messages.find((m) => m.id === d.outputMessageId)));
|
|
173
|
+
const participantNames = await Promise.all(this.state.members(g).filter(m => m.enabled && m.removedAt === undefined).map(async (d) => {
|
|
174
|
+
try {
|
|
175
|
+
const b = await this.state.bot(d.bot);
|
|
176
|
+
return `${b.name} (botId=${b.id}, memberId=${d.id})`;
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return d.bot.botId;
|
|
180
|
+
}
|
|
181
|
+
}));
|
|
182
|
+
const context = groupContext(g.name, bot.name, participantNames, question, messages.filter((m) => m.seq <= t.contextThroughSeq), [...previous, ...messages.filter(m => m.id === (d.triggerMessageId ? question.replyTo : t.replyTo))], this.state.registry.config.groupContextMaxBytes, g.memberRoles?.find(row => row.bot.botId === bot.id && row.bot.botCreatedAt === bot.createdAt)?.role);
|
|
183
|
+
if (t.protocol === 2 && d.automatic) {
|
|
184
|
+
const current = need(this.state.table('turns').get(t.id));
|
|
185
|
+
if ((current.automaticExecutions ?? 0) >= (current.continuationAllowance ?? 0))
|
|
186
|
+
return;
|
|
187
|
+
await this.state.putTurn({ ...current, automaticExecutions: (current.automaticExecutions ?? 0) + 1 });
|
|
188
|
+
}
|
|
189
|
+
await this.state.putDelivery({
|
|
190
|
+
...d,
|
|
191
|
+
startedAt: Date.now(),
|
|
192
|
+
state: 'starting',
|
|
193
|
+
contextOutputMessageIds: context.outputIds,
|
|
194
|
+
contextTruncated: context.truncated,
|
|
195
|
+
});
|
|
196
|
+
const attachmentBlocks = [...new Map([question, ...messages.filter(m => m.id === question.replyTo || context.outputIds.includes(m.id))]
|
|
197
|
+
.flatMap(m => m.attachments ?? []).map(block => [`${block.type}:${block.attachment.attachmentId}`, block])).values()];
|
|
198
|
+
const modelSelection = t.memberModelSelections?.find(row => row.memberId === d.memberId)?.modelSelection ?? t.modelSelection;
|
|
199
|
+
const selected = t.ownerFollowUp?.modelSelection ??
|
|
200
|
+
(t.proactive ? proactiveMemberModel(t.proactive, d.memberId) : groupMemberModel(t, d.memberId, bot, () => this.state.route()));
|
|
201
|
+
const route = selected ? { ...selected,
|
|
202
|
+
// Explicit undefined clears a same-route effort inherited from the root's creation options.
|
|
203
|
+
reasoningEffort: selected.reasoningEffort === undefined ? undefined : ReasoningEffortId(selected.reasoningEffort) } : this.state.route();
|
|
204
|
+
return { root, bot, d, context, attachmentBlocks, route, modelSelection };
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
async recordDeliveryResult(t, deliveryId, prepared, childId, result, signal, verify) {
|
|
208
|
+
await this.state.queue.run(async () => {
|
|
209
|
+
const g = this.state.record(t.group), d = need(this.state.table('deliveries').get(deliveryId));
|
|
210
|
+
await checkSupergroup(this.state, g);
|
|
211
|
+
if ((t.proactive || t.ownerFollowUp || g.supergroup) && g.membershipRevision !== t.membershipRevision)
|
|
212
|
+
throw new OperationError('conflict');
|
|
213
|
+
const text = textOf(result.output);
|
|
214
|
+
const hasContent = !d.skipped && !signal.aborted && (Boolean(text.trim()) || result.output.some((b) => b.type !== 'text'));
|
|
215
|
+
const state = signal.aborted
|
|
216
|
+
? 'cancelled'
|
|
217
|
+
: d.skipped && result.stopReason === 'completed'
|
|
218
|
+
? 'skipped'
|
|
219
|
+
: result.stopReason === 'completed' && hasContent
|
|
220
|
+
? 'completed'
|
|
221
|
+
: 'failed';
|
|
222
|
+
// Native local results carry no failure detail; read the child's own failed turn/end.
|
|
223
|
+
const failure = state === 'failed' && result.stopReason === 'error'
|
|
224
|
+
? memberRunFailure(this.state.workers.get(childId)?.agent ?? this.state.ctx.agents.get(SessionId(childId)), d.startedAt ?? 0)
|
|
225
|
+
: undefined;
|
|
226
|
+
let output;
|
|
227
|
+
if (hasContent) {
|
|
228
|
+
const b = prepared.bot;
|
|
229
|
+
const speaker = {
|
|
230
|
+
bot: d.bot,
|
|
231
|
+
name: b.name,
|
|
232
|
+
...(b.avatar ? { avatar: b.avatar } : {}),
|
|
233
|
+
...(b.avatarColor ? { avatarColor: b.avatarColor } : {}),
|
|
234
|
+
...(b.avatarVariant ? { avatarVariant: b.avatarVariant } : {}),
|
|
235
|
+
};
|
|
236
|
+
const message = createUserMessage({
|
|
237
|
+
source: {
|
|
238
|
+
kind: 'dsh-bot-group',
|
|
239
|
+
group: t.group,
|
|
240
|
+
turnId: t.id,
|
|
241
|
+
memberId: d.memberId,
|
|
242
|
+
speaker,
|
|
243
|
+
childSessionId: childId,
|
|
244
|
+
stopReason: result.stopReason,
|
|
245
|
+
...(failure ? { failure } : {}),
|
|
246
|
+
replyTo: d.triggerMessageId ?? t.replyTo ?? t.inputMessageId,
|
|
247
|
+
causeId: t.id,
|
|
248
|
+
},
|
|
249
|
+
content: [...result.output],
|
|
250
|
+
});
|
|
251
|
+
const append = () => prepared.root.agent.session.append('user/message', message, { surfaceOp: 'append' });
|
|
252
|
+
const send = verify ? async () => { await verify(); return append(); } : append;
|
|
253
|
+
const event = await groupResult(this.state, g, d.bot, childId, prepared.root.agent, JSON.stringify(message), `${deliveryId}:result`, send, signal);
|
|
254
|
+
await this.roots.flush(prepared.root);
|
|
255
|
+
output = { outputMessageId: message.id, outputSeq: Number(event.seq) };
|
|
256
|
+
}
|
|
257
|
+
await this.state.putDelivery({
|
|
258
|
+
...d,
|
|
259
|
+
state,
|
|
260
|
+
endedAt: Date.now(),
|
|
261
|
+
...output,
|
|
262
|
+
stopReason: result.stopReason,
|
|
263
|
+
...(failure ? { failure } : {}),
|
|
264
|
+
...(state !== 'completed' && state !== 'skipped'
|
|
265
|
+
? {
|
|
266
|
+
reasonCode: signal.aborted ? String(signal.reason ?? 'user-stop') : text.trim() ? 'partial-output' : 'empty-or-failed',
|
|
267
|
+
}
|
|
268
|
+
: {}),
|
|
269
|
+
});
|
|
270
|
+
if (t.protocol === 2 && state === 'completed' && output && !this.state.cancelledTurns.has(t.id) && g.membershipRevision === t.membershipRevision) {
|
|
271
|
+
const requests = [d, ...this.state.deliveries(t.id).filter(row => row.joinedDeliveryId === d.id && row.reasonCode === 'inbox-accepted')];
|
|
272
|
+
for (const request of requests)
|
|
273
|
+
if (request.returnMemberId && !this.state.table('turns').get(t.id)?.stoppedMemberIds?.includes(request.returnMemberId)) {
|
|
274
|
+
const next = await this.enqueue(need(this.state.table('turns').get(t.id)), request.returnMemberId, output.outputMessageId, `group-return:${digest(request.id)}`);
|
|
275
|
+
await this.concurrent.returnToActive(t, next, text, d.memberId, signal);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (t.protocol !== 2 && state === 'completed' && output && d.returnMemberId &&
|
|
279
|
+
this.state.deliveries(t.id).length < t.orderedMemberIds.length + this.state.registry.config.groupMaxContinuations &&
|
|
280
|
+
(this.state.registry.config.groupRoundTimeoutMs === 0 || Date.now() < t.createdAt + this.state.registry.config.groupRoundTimeoutMs) && g.membershipRevision === t.membershipRevision)
|
|
281
|
+
await this.enqueue(t, d.returnMemberId, output.outputMessageId, `group-return:${digest(d.id)}`);
|
|
282
|
+
if (state === 'completed' && output && !t.proactive && !t.ownerFollowUp) {
|
|
283
|
+
await this.state.putGroup({
|
|
284
|
+
...g,
|
|
285
|
+
nextMemberId: nextRoundRobinMember(this.state.members(g), d.memberId),
|
|
286
|
+
revision: g.revision + 1,
|
|
287
|
+
updatedAt: Date.now(),
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
async deliverProactive(t, d, deadline) {
|
|
293
|
+
const review = t.proactive, owner = t.ownerFollowUp;
|
|
294
|
+
const approvedModel = owner?.modelSelection ?? proactiveMemberModel(need(review), d.memberId);
|
|
295
|
+
const requestBudget = review?.requestBudget ?? review?.repair;
|
|
296
|
+
if (owner && (t.orderedMemberIds.length !== 1 || d.memberId !== owner.memberId))
|
|
297
|
+
throw new OperationError('conflict');
|
|
298
|
+
if (requestBudget)
|
|
299
|
+
deadline = Math.min(deadline, Date.parse(requestBudget.deadlineAt));
|
|
300
|
+
const check = need(this.state.proactiveChecks.get(t.id));
|
|
301
|
+
const controller = new AbortController();
|
|
302
|
+
const signal = AbortSignal.any([
|
|
303
|
+
controller.signal, this.state.startup.signal,
|
|
304
|
+
AbortSignal.timeout(Math.max(1, Math.min(300000, deadline - Date.now()))),
|
|
305
|
+
]);
|
|
306
|
+
this.state.controllers.set(d.id, controller);
|
|
307
|
+
let child;
|
|
308
|
+
let inputSent = false;
|
|
309
|
+
let createAttempted = false;
|
|
310
|
+
let restrictedChild;
|
|
311
|
+
try {
|
|
312
|
+
const prepared = await this.prepareDelivery(t, d.id, signal);
|
|
313
|
+
if (!prepared)
|
|
314
|
+
return;
|
|
315
|
+
const verify = async () => {
|
|
316
|
+
signal.throwIfAborted();
|
|
317
|
+
const group = this.state.record(t.group);
|
|
318
|
+
if (group.archived || group.membershipRevision !== t.membershipRevision ||
|
|
319
|
+
(review?.modelRevision !== undefined && (group.modelRevision ?? 0) !== review.modelRevision) ||
|
|
320
|
+
(await this.state.bot(d.bot)).updatedAt !== d.botRevision)
|
|
321
|
+
throw new OperationError('conflict');
|
|
322
|
+
if (owner)
|
|
323
|
+
await verifyOwnerFollowUpChoice(this.state, t.group, owner);
|
|
324
|
+
if (review?.followUp) {
|
|
325
|
+
await this.state.validateMembers(this.state.members(group)
|
|
326
|
+
.filter(member => member.enabled && member.removedAt === undefined).map(member => member.bot));
|
|
327
|
+
}
|
|
328
|
+
await check();
|
|
329
|
+
signal.throwIfAborted();
|
|
330
|
+
};
|
|
331
|
+
await verify();
|
|
332
|
+
const group = this.state.record(t.group);
|
|
333
|
+
const input = await groupChild(this.state, group, prepared.root.agent, d.bot, prepared.context.text, d.id, signal);
|
|
334
|
+
const childId = input?.childId ?? SessionId(randomUUID());
|
|
335
|
+
const source = owner ? { kind: 'dsh-bot-group-owner-followup', group: t.group, turnId: t.id,
|
|
336
|
+
cardId: owner.cardId, predecessorTurnId: owner.predecessorTurnId, } : { kind: 'dsh-bot-group-proactive', group: t.group, turnId: t.id,
|
|
337
|
+
ticketId: need(review).ticketId, assignmentId: need(review).assignmentId,
|
|
338
|
+
...(review?.repair ? { repairPhase: review.repair.phase } : {}),
|
|
339
|
+
...(review?.followUp ? { factId: review.followUp.factId, predecessorTurnId: review.followUp.predecessorTurnId } : {}), };
|
|
340
|
+
const message = createUserMessage({
|
|
341
|
+
source,
|
|
342
|
+
content: blocks(prepared.context.text),
|
|
343
|
+
});
|
|
344
|
+
if (owner) {
|
|
345
|
+
const reservation = { turnId: t.id, deliveryId: d.id, childId, rootId: prepared.root.agent.session.id,
|
|
346
|
+
presetId: d.presetId, modelSelection: owner.modelSelection, restrictedInputId: message.id,
|
|
347
|
+
audience: this.state.members(group).filter(member => member.enabled && member.removedAt === undefined).map(member => member.bot),
|
|
348
|
+
isActive: () => !signal.aborted && !this.state.stopped && !this.state.cancelledTurns.has(t.id),
|
|
349
|
+
};
|
|
350
|
+
if (workerReservations.has(childId))
|
|
351
|
+
throw new OperationError('conflict');
|
|
352
|
+
this.state.workers.set(childId, reservation);
|
|
353
|
+
workerReservations.set(childId, reservation);
|
|
354
|
+
restrictedChild = childId;
|
|
355
|
+
}
|
|
356
|
+
const outputTokens = owner ? this.state.registry.config.proactiveModelOutputTokens ?? 1024 : requestBudget?.outputTokens ?? 1024;
|
|
357
|
+
const options = { provider: approvedModel.provider, model: approvedModel.model, ...(approvedModel.reasoningEffort ? { reasoningEffort: ReasoningEffortId(approvedModel.reasoningEffort) } : {}), maxTokens: outputTokens };
|
|
358
|
+
let requested = false, dispatched = false;
|
|
359
|
+
const create = (dispatchSignal) => {
|
|
360
|
+
createAttempted = true;
|
|
361
|
+
return this.state.ctx.agents.create({
|
|
362
|
+
sessionId: childId,
|
|
363
|
+
parentAgent: prepared.root.agent,
|
|
364
|
+
meta: { cwd: group.cwd, parentSession: prepared.root.agent.session.id,
|
|
365
|
+
origin: 'subagent', delegationDepth: 1, agentPreset: d.presetId },
|
|
366
|
+
agentOptions: options,
|
|
367
|
+
signal: dispatchSignal,
|
|
368
|
+
setup: agentCtx => {
|
|
369
|
+
agentCtx.effect(() => agentCtx.tools.restrict({ allow: [] }));
|
|
370
|
+
agentCtx.effect(() => agentCtx.tools.guard(() => 'Proactive group review is read-only'));
|
|
371
|
+
agentCtx.effect(() => agentCtx.on('agent/pre-step', async ({ messages }, next) => {
|
|
372
|
+
const input = messages[0];
|
|
373
|
+
if (messages.length !== 1 || input?.id !== message.id || input.source.kind !== source.kind)
|
|
374
|
+
return { kind: 'reject' };
|
|
375
|
+
return next();
|
|
376
|
+
}, { prepend: true }));
|
|
377
|
+
agentCtx.effect(() => agentCtx.on('agent/request', async () => {
|
|
378
|
+
if (requested)
|
|
379
|
+
throw new OperationError('approval-denied');
|
|
380
|
+
await verify();
|
|
381
|
+
requested = true;
|
|
382
|
+
return options;
|
|
383
|
+
}, { prepend: true }));
|
|
384
|
+
agentCtx.effect(() => agentCtx.on('agent/request-error', async () => undefined, { prepend: true }));
|
|
385
|
+
if (owner)
|
|
386
|
+
agentCtx.effect(() => agentCtx.on('llm/stream', async function* (request, next) {
|
|
387
|
+
if (request.sessionId === childId) {
|
|
388
|
+
if (dispatched || request.provider !== approvedModel.provider || request.model !== approvedModel.model ||
|
|
389
|
+
(approvedModel.reasoningEffort !== undefined && request.reasoningEffort !== approvedModel.reasoningEffort) ||
|
|
390
|
+
!request.maxTokens || request.maxTokens > outputTokens || (request.tools?.length ?? 0) > 0)
|
|
391
|
+
throw new OperationError('approval-denied');
|
|
392
|
+
dispatched = true;
|
|
393
|
+
await verify();
|
|
394
|
+
}
|
|
395
|
+
yield* next();
|
|
396
|
+
}, { prepend: true }));
|
|
397
|
+
if (requestBudget)
|
|
398
|
+
agentCtx.effect(() => agentCtx.on('llm/stream', (options, next) => {
|
|
399
|
+
if (options.sessionId === childId) {
|
|
400
|
+
const allowance = assertModelBudget(options, requestBudget.maxTokens);
|
|
401
|
+
this.state.recordProactiveAllowance(d.id, allowance);
|
|
402
|
+
}
|
|
403
|
+
return next();
|
|
404
|
+
}, { prepend: true }));
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
const flow = outlets(this.state.registry);
|
|
409
|
+
child = input ? await need(flow).dispatch(input.id, (_envelope, s) => create(s), signal) : await create(signal);
|
|
410
|
+
setSandboxMode(child.agent.session, 'read-only');
|
|
411
|
+
if (this.state.ctx.tools.schemas(child.agent).length)
|
|
412
|
+
throw new OperationError('approval-denied');
|
|
413
|
+
await this.state.queue.run(async () => {
|
|
414
|
+
const current = need(this.state.table('deliveries').get(d.id));
|
|
415
|
+
await this.state.putDelivery({ ...current, state: 'running', childSessionId: childId, childMessageId: message.id });
|
|
416
|
+
});
|
|
417
|
+
await verify();
|
|
418
|
+
inputSent = true;
|
|
419
|
+
if (!owner)
|
|
420
|
+
proactiveGroupInputs.set(child.agent.id, message.id);
|
|
421
|
+
child.agent.followup(message);
|
|
422
|
+
await waitIdle(child.agent, signal);
|
|
423
|
+
await verify();
|
|
424
|
+
const events = child.agent.session.snapshotEvents();
|
|
425
|
+
const accepted = events.find(event => event.type === 'user/message' && event.data.id === message.id &&
|
|
426
|
+
event.data.source.kind === source.kind);
|
|
427
|
+
const end = events.findLast(event => event.type === 'turn/end');
|
|
428
|
+
if (!accepted || end?.type !== 'turn/end' || !(await this.state.ctx.sessions.flush(child.agent.session)))
|
|
429
|
+
throw new OperationError('unavailable');
|
|
430
|
+
if (end.data.reason.kind === 'error') {
|
|
431
|
+
await this.recordDeliveryResult(t, d.id, prepared, childId, { output: [], stopReason: 'error' }, signal);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
const answer = events.findLast(event => event.type === 'assistant/message');
|
|
435
|
+
if (end.data.reason.kind !== 'completed' || answer?.type !== 'assistant/message' ||
|
|
436
|
+
answer.data.turn !== end.data.turn || answer.data.interrupted ||
|
|
437
|
+
answer.data.message.source.provider !== approvedModel.provider || answer.data.message.source.model !== approvedModel.model)
|
|
438
|
+
throw new OperationError('unavailable');
|
|
439
|
+
await this.recordDeliveryResult(t, d.id, prepared, childId, {
|
|
440
|
+
output: answer.data.message.content.filter(block => block.type === 'text'),
|
|
441
|
+
stopReason: 'completed',
|
|
442
|
+
}, signal, verify);
|
|
443
|
+
}
|
|
444
|
+
catch {
|
|
445
|
+
await this.state.queue.run(async () => {
|
|
446
|
+
const current = need(this.state.table('deliveries').get(d.id));
|
|
447
|
+
await this.state.putDelivery({ ...current, state: inputSent ? 'unknown' : signal.aborted ? 'cancelled' : 'failed',
|
|
448
|
+
reasonCode: inputSent ? 'recovery-needed' : 'native-failure' });
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
finally {
|
|
452
|
+
this.state.controllers.delete(d.id);
|
|
453
|
+
let drained = false;
|
|
454
|
+
try {
|
|
455
|
+
await child?.dispose();
|
|
456
|
+
if (child) {
|
|
457
|
+
await child.agent.whenIdle();
|
|
458
|
+
drained = true;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
finally {
|
|
462
|
+
this.state.recordProactiveDrain(d.id, !createAttempted || drained);
|
|
463
|
+
if (child)
|
|
464
|
+
proactiveGroupInputs.delete(child.agent.id);
|
|
465
|
+
if (restrictedChild) {
|
|
466
|
+
this.state.workers.delete(restrictedChild);
|
|
467
|
+
workerReservations.delete(restrictedChild);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
async deliver(t, d0, deadline) {
|
|
473
|
+
if (t.proactive || t.ownerFollowUp)
|
|
474
|
+
return this.deliverProactive(t, d0, deadline);
|
|
475
|
+
const controller = new AbortController();
|
|
476
|
+
const inputAdmission = new AbortController();
|
|
477
|
+
this.state.inputAdmissions.set(d0.id, inputAdmission);
|
|
478
|
+
this.state.controllers.set(d0.id, controller);
|
|
479
|
+
const timer = Number.isFinite(deadline) ? setTimeout(() => controller.abort('configured-timeout'), Math.max(1, deadline - Date.now())) : undefined;
|
|
480
|
+
let activation;
|
|
481
|
+
let reservedChild;
|
|
482
|
+
let disposal;
|
|
483
|
+
const stopNative = () => {
|
|
484
|
+
if (activation) {
|
|
485
|
+
disposal ??= activation.dispose();
|
|
486
|
+
void disposal.catch(() => { });
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
controller.signal.addEventListener('abort', stopNative, { once: true });
|
|
490
|
+
try {
|
|
491
|
+
const prepared = await this.prepareDelivery(t, d0.id, controller.signal);
|
|
492
|
+
if (!prepared)
|
|
493
|
+
return;
|
|
494
|
+
// A member can be removed while native startup awaits: signal remains authoritative.
|
|
495
|
+
const g = this.state.record(t.group);
|
|
496
|
+
const flow = outlets(this.state.registry);
|
|
497
|
+
const input = await groupChild(this.state, g, prepared.root.agent, prepared.d.bot, prepared.context.text, d0.id, controller.signal);
|
|
498
|
+
const childId = input?.childId ?? SessionId(randomUUID());
|
|
499
|
+
reservedChild = childId;
|
|
500
|
+
this.state.workers.set(childId, { turnId: t.id, deliveryId: d0.id, childId, rootId: g.rootSessionId, presetId: prepared.d.presetId, modelSelection: prepared.modelSelection, isActive: () => !this.state.stopped && !this.state.cancelledTurns.has(t.id) && !controller.signal.aborted && this.state.workers.get(childId)?.deliveryId === d0.id, audience: groupReaders(this.state, g) });
|
|
501
|
+
workerReservations.set(childId, need(this.state.workers.get(childId)));
|
|
502
|
+
const start = (dispatchSignal = controller.signal) => this.state.ctx.subagents.startActivation(compatibleActivationSpec({
|
|
503
|
+
childId,
|
|
504
|
+
provider: 'spawn',
|
|
505
|
+
delivery: 'caller',
|
|
506
|
+
label: prepared.bot.name,
|
|
507
|
+
signal: dispatchSignal,
|
|
508
|
+
request: {
|
|
509
|
+
parent: prepared.root.agent,
|
|
510
|
+
agentPreset: prepared.d.presetId,
|
|
511
|
+
agentOptions: prepared.route,
|
|
512
|
+
prompt: [...blocks(prepared.context.text), ...prepared.attachmentBlocks],
|
|
513
|
+
maxDepth: this.state.registry.config.groupMaxDepth,
|
|
514
|
+
},
|
|
515
|
+
}));
|
|
516
|
+
activation = input ? await need(flow).dispatch(input.id, (_envelope, signal) => start(signal), controller.signal, () => checkSupergroup(this.state, g).then(() => { })) : await start();
|
|
517
|
+
// Observe settlement independently of the shared queue and delivery-result persistence.
|
|
518
|
+
// This closes only supplemental inbox admission; a successful result remains successful.
|
|
519
|
+
void activation.result.then(() => inputAdmission.abort(), () => inputAdmission.abort());
|
|
520
|
+
this.state.activations.set(d0.id, activation);
|
|
521
|
+
if (controller.signal.aborted)
|
|
522
|
+
stopNative();
|
|
523
|
+
const currentBot = await this.state.bot(prepared.d.bot);
|
|
524
|
+
if (currentBot.updatedAt !== prepared.d.botRevision) {
|
|
525
|
+
controller.abort();
|
|
526
|
+
throw new OperationError('conflict');
|
|
527
|
+
}
|
|
528
|
+
await this.state.queue.run(async () => {
|
|
529
|
+
await this.state.putDelivery({
|
|
530
|
+
...need(this.state.table('deliveries').get(d0.id)),
|
|
531
|
+
state: 'running',
|
|
532
|
+
childSessionId: activation?.childId,
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
const result = await activation.result;
|
|
536
|
+
// Close supplementation before waiting for the shared persistence queue.
|
|
537
|
+
this.state.settledInputs.add(d0.id);
|
|
538
|
+
await this.recordDeliveryResult(t, d0.id, prepared, activation.childId, result, controller.signal);
|
|
539
|
+
}
|
|
540
|
+
catch (error) {
|
|
541
|
+
await this.state.queue.run(async () => {
|
|
542
|
+
const d = need(this.state.table('deliveries').get(d0.id));
|
|
543
|
+
await this.state.putDelivery({
|
|
544
|
+
...d,
|
|
545
|
+
...(activation ? { childSessionId: activation.childId } : {}),
|
|
546
|
+
state: error instanceof OperationError && hasOperationCode(error, 'recovery-needed')
|
|
547
|
+
? 'unknown'
|
|
548
|
+
: controller.signal.aborted
|
|
549
|
+
? 'cancelled'
|
|
550
|
+
: 'failed',
|
|
551
|
+
reasonCode: error instanceof OperationError ? error.code : 'native-failure',
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
finally {
|
|
556
|
+
inputAdmission.abort();
|
|
557
|
+
clearTimeout(timer);
|
|
558
|
+
controller.signal.removeEventListener('abort', stopNative);
|
|
559
|
+
if (activation) {
|
|
560
|
+
disposal ??= activation.dispose();
|
|
561
|
+
await disposal;
|
|
562
|
+
}
|
|
563
|
+
if (reservedChild) {
|
|
564
|
+
this.state.workers.delete(reservedChild);
|
|
565
|
+
workerReservations.delete(reservedChild);
|
|
566
|
+
}
|
|
567
|
+
this.state.inputAdmissions.delete(d0.id);
|
|
568
|
+
this.state.settledInputs.delete(d0.id);
|
|
569
|
+
this.state.activations.delete(d0.id);
|
|
570
|
+
this.state.controllers.delete(d0.id);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
async execute(id) {
|
|
574
|
+
let t = need(this.state.table('turns').get(id));
|
|
575
|
+
if (t.protocol === 2)
|
|
576
|
+
return this.concurrent.execute(id);
|
|
577
|
+
if (terminal(t)) {
|
|
578
|
+
this.state.cancelledTurns.delete(id);
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
await this.state.queue.run(async () => {
|
|
582
|
+
t = await this.state.putTurn({ ...t, state: 'running' });
|
|
583
|
+
});
|
|
584
|
+
const deadline = this.state.registry.config.groupRoundTimeoutMs ? t.createdAt + this.state.registry.config.groupRoundTimeoutMs : Infinity;
|
|
585
|
+
for (;;) {
|
|
586
|
+
const d0 = this.state.deliveries(id).find(d => d.state === 'pending');
|
|
587
|
+
if (!d0)
|
|
588
|
+
break;
|
|
589
|
+
await this.deliver(t, d0, deadline);
|
|
590
|
+
if (this.state.table('deliveries').get(d0.id)?.state === 'unknown') {
|
|
591
|
+
await this.state.queue.run(async () => {
|
|
592
|
+
for (const rest of this.state.deliveries(id).filter((d) => d.state === 'pending'))
|
|
593
|
+
await this.state.putDelivery({ ...rest, state: 'cancelled', reasonCode: 'previous-result-unknown' });
|
|
594
|
+
});
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
await this.state.queue.run(async () => {
|
|
599
|
+
const current = need(this.state.table('turns').get(id)), rows = this.state.deliveries(id);
|
|
600
|
+
const state = rows.some((d) => d.state === 'unknown')
|
|
601
|
+
? 'recovery_needed'
|
|
602
|
+
: this.state.cancelledTurns.has(id) || rows.every((d) => d.state === 'cancelled')
|
|
603
|
+
? 'cancelled'
|
|
604
|
+
: rows.every((d) => d.state === 'completed' || d.state === 'skipped')
|
|
605
|
+
? 'completed'
|
|
606
|
+
: 'partial';
|
|
607
|
+
await this.state.putTurn({ ...current, state });
|
|
608
|
+
this.state.cancelledTurns.delete(id);
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
//# sourceMappingURL=turn-runner.js.map
|
|
613
|
+
export const DSH_BOT_MODULE_VERSION = '0.7.0';
|