dsh-botgroup 0.0.0-stage → 0.6.7
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 +180 -0
- package/README.md +179 -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 +28298 -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 +318 -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/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/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 +72 -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 +208 -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 +114 -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 +49 -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 +180 -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 +272 -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 +54 -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 +105 -0
- package/lib/host/groups/members.js +204 -0
- package/lib/host/groups/members.js.map +1 -0
- package/lib/host/groups/messages.d.ts +335 -0
- package/lib/host/groups/messages.js +148 -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 +266 -0
- package/lib/host/groups/model.js +22 -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 +902 -0
- package/lib/host/groups/remote.js +146 -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 +8 -0
- package/lib/host/groups/routing.js +62 -0
- package/lib/host/groups/routing.js.map +1 -0
- package/lib/host/groups/service.d.ts +1204 -0
- package/lib/host/groups/service.js +286 -0
- package/lib/host/groups/service.js.map +1 -0
- package/lib/host/groups/state.d.ts +818 -0
- package/lib/host/groups/state.js +227 -0
- package/lib/host/groups/state.js.map +1 -0
- package/lib/host/groups/turn-runner.d.ts +181 -0
- package/lib/host/groups/turn-runner.js +578 -0
- package/lib/host/groups/turn-runner.js.map +1 -0
- package/lib/host/groups/turns.d.ts +657 -0
- package/lib/host/groups/turns.js +480 -0
- package/lib/host/groups/turns.js.map +1 -0
- package/lib/host/groups/worker-tool.d.ts +43 -0
- package/lib/host/groups/worker-tool.js +86 -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 +9 -0
- package/lib/host/index.js +270 -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 +31 -0
- package/lib/host/memory/facade.js +182 -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 +164 -0
- package/lib/host/memory/remote.js +191 -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 +279 -0
- package/lib/host/messaging/core.js +109 -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 +237 -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 +78 -0
- package/lib/host/messaging/safety.js.map +1 -0
- package/lib/host/messaging/service.d.ts +22 -0
- package/lib/host/messaging/service.js +56 -0
- package/lib/host/messaging/service.js.map +1 -0
- package/lib/host/messaging/store.d.ts +732 -0
- package/lib/host/messaging/store.js +310 -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 +100 -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 +45 -0
- package/lib/host/proactive/follow-up-events.js +328 -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 +4910 -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 +30446 -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 +118 -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 +66 -0
- package/lib/host/registry-config.js +123 -0
- package/lib/host/registry-config.js.map +1 -0
- package/lib/host/registry.d.ts +142 -0
- package/lib/host/registry.js +489 -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/tools/bot-manage.d.ts +14 -0
- package/lib/host/tools/bot-manage.js +436 -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 +262 -0
- package/lib/proactive-coordinator/LICENSE +21 -0
- package/lib/proactive-coordinator/core.mjs +19067 -0
- package/lib/proactive-coordinator/main.mjs +22196 -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 +4128 -0
- package/lib/shared/groups-contract.js +97 -0
- package/lib/shared/groups-contract.js.map +1 -0
- package/lib/shared/groups.d.ts +966 -0
- package/lib/shared/groups.js +240 -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 +588 -0
- package/lib/shared/memory-management.js +40 -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 +797 -0
- package/lib/shared/messaging.js +229 -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 +15 -0
- package/lib/shared/operation-errors.js +15 -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 +781 -0
- package/lib/shared/proactive/follow-up.js +164 -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 +12103 -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 +29534 -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 +167 -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 +4586 -0
- package/lib/shared/remote-contract.js +205 -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/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 +1644 -0
- package/locale/zh.json +1644 -0
- package/package.json +176 -3
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { AutoSharePolicy } from '../../shared/data-flow.js';
|
|
2
|
+
import type { BotKey } from '../../shared/identity.js';
|
|
3
|
+
import type { Commit, MemoryKernel } from './op-log.js';
|
|
4
|
+
export type AutoPolicyInput = Omit<AutoSharePolicy, 'revision'>;
|
|
5
|
+
export declare class AutoShareQuota {
|
|
6
|
+
readonly kernel: MemoryKernel;
|
|
7
|
+
private readonly clock;
|
|
8
|
+
constructor(kernel: MemoryKernel, clock?: () => number);
|
|
9
|
+
get policy(): AutoSharePolicy;
|
|
10
|
+
configureHost(input: Omit<AutoPolicyInput, 'hostConfig'>): Promise<void>;
|
|
11
|
+
configure(input: AutoPolicyInput, expectedRevision?: number): Promise<void>;
|
|
12
|
+
status(): {
|
|
13
|
+
domainUsed: number;
|
|
14
|
+
configured: boolean;
|
|
15
|
+
effectiveAutoShare: false;
|
|
16
|
+
reason: "unverifiable-user-input";
|
|
17
|
+
botDaily: number;
|
|
18
|
+
domainDaily: number;
|
|
19
|
+
timeZone: string;
|
|
20
|
+
revision: number;
|
|
21
|
+
};
|
|
22
|
+
private charge;
|
|
23
|
+
/** Host-only accounting seam. Caller validates source capability; this method grants no user_stated authority.
|
|
24
|
+
* Used by the future automatic outlet after its capability/checker gates, and synthetic accounting tests now.
|
|
25
|
+
*/
|
|
26
|
+
commit(opId: string, owner: BotKey, policyRevision: number, build: () => Commit): Promise<{
|
|
27
|
+
opId: string;
|
|
28
|
+
seq: number;
|
|
29
|
+
kind: "policy" | "accept" | "forget" | "propose" | "revise" | "resolve" | "supersede" | "dispute" | "promote" | "retire_shard" | "migration" | "cleanup";
|
|
30
|
+
subjectIds: string[];
|
|
31
|
+
payloadRefs: string[];
|
|
32
|
+
expectedRevision: number;
|
|
33
|
+
forgetEpoch: number;
|
|
34
|
+
versions: ({
|
|
35
|
+
scope: "private";
|
|
36
|
+
ownerBotKey: {
|
|
37
|
+
botId: string;
|
|
38
|
+
botCreatedAt: number;
|
|
39
|
+
};
|
|
40
|
+
shard: {
|
|
41
|
+
botId: string;
|
|
42
|
+
botCreatedAt: number;
|
|
43
|
+
};
|
|
44
|
+
schemaVersion: 2;
|
|
45
|
+
memoryId: string;
|
|
46
|
+
versionId: string;
|
|
47
|
+
userScope: string;
|
|
48
|
+
contentRef: string;
|
|
49
|
+
revision: number;
|
|
50
|
+
commitSeq: number;
|
|
51
|
+
kind: "user_fact" | "user_event" | "bot_role" | "how_to_work";
|
|
52
|
+
recordedAt: number;
|
|
53
|
+
sourceRefs: {
|
|
54
|
+
sessionId?: string | undefined;
|
|
55
|
+
eventSeq?: number | undefined;
|
|
56
|
+
callId?: string | undefined;
|
|
57
|
+
parentVersionId?: string | undefined;
|
|
58
|
+
entryReceiptId?: string | undefined;
|
|
59
|
+
managementOpId?: string | undefined;
|
|
60
|
+
}[];
|
|
61
|
+
provenance: {
|
|
62
|
+
channel: "model" | "legacy" | "management";
|
|
63
|
+
bot: {
|
|
64
|
+
botId: string;
|
|
65
|
+
botCreatedAt: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
trust: "candidate" | "user_stated" | "user_confirmed";
|
|
69
|
+
status: "rejected" | "superseded" | "active" | "disputed" | "proposed" | "expired" | "forgotten";
|
|
70
|
+
labels: {
|
|
71
|
+
readers: "shared" | {
|
|
72
|
+
botId: string;
|
|
73
|
+
botCreatedAt: number;
|
|
74
|
+
}[];
|
|
75
|
+
originTrust: "candidate" | "user_stated" | "user_confirmed";
|
|
76
|
+
sourceVersions: string[];
|
|
77
|
+
restrictions: ("revoked" | "secret" | "no-egress" | "pending-cleanup")[];
|
|
78
|
+
grants: string[];
|
|
79
|
+
};
|
|
80
|
+
legacyKind?: "profile" | "preference" | "fact" | "note" | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
scope: "shared";
|
|
83
|
+
shard: {
|
|
84
|
+
botId: string;
|
|
85
|
+
botCreatedAt: number;
|
|
86
|
+
} | "user";
|
|
87
|
+
schemaVersion: 2;
|
|
88
|
+
memoryId: string;
|
|
89
|
+
versionId: string;
|
|
90
|
+
userScope: string;
|
|
91
|
+
contentRef: string;
|
|
92
|
+
revision: number;
|
|
93
|
+
commitSeq: number;
|
|
94
|
+
kind: "user_fact" | "user_event" | "bot_role" | "how_to_work";
|
|
95
|
+
recordedAt: number;
|
|
96
|
+
sourceRefs: {
|
|
97
|
+
sessionId?: string | undefined;
|
|
98
|
+
eventSeq?: number | undefined;
|
|
99
|
+
callId?: string | undefined;
|
|
100
|
+
parentVersionId?: string | undefined;
|
|
101
|
+
entryReceiptId?: string | undefined;
|
|
102
|
+
managementOpId?: string | undefined;
|
|
103
|
+
}[];
|
|
104
|
+
provenance: {
|
|
105
|
+
channel: "model" | "legacy" | "management";
|
|
106
|
+
bot: {
|
|
107
|
+
botId: string;
|
|
108
|
+
botCreatedAt: number;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
trust: "candidate" | "user_stated" | "user_confirmed";
|
|
112
|
+
status: "rejected" | "superseded" | "active" | "disputed" | "proposed" | "expired" | "forgotten";
|
|
113
|
+
labels: {
|
|
114
|
+
readers: "shared" | {
|
|
115
|
+
botId: string;
|
|
116
|
+
botCreatedAt: number;
|
|
117
|
+
}[];
|
|
118
|
+
originTrust: "candidate" | "user_stated" | "user_confirmed";
|
|
119
|
+
sourceVersions: string[];
|
|
120
|
+
restrictions: ("revoked" | "secret" | "no-egress" | "pending-cleanup")[];
|
|
121
|
+
grants: string[];
|
|
122
|
+
};
|
|
123
|
+
legacyKind?: "profile" | "preference" | "fact" | "note" | undefined;
|
|
124
|
+
})[];
|
|
125
|
+
receiptRefs: string[];
|
|
126
|
+
owner?: {
|
|
127
|
+
botId: string;
|
|
128
|
+
botCreatedAt: number;
|
|
129
|
+
} | undefined;
|
|
130
|
+
autoPolicy?: {
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
botDaily: number;
|
|
133
|
+
domainDaily: number;
|
|
134
|
+
timeZone: string;
|
|
135
|
+
revision: number;
|
|
136
|
+
hostConfig?: {
|
|
137
|
+
enabled: boolean;
|
|
138
|
+
botDaily: number;
|
|
139
|
+
domainDaily: number;
|
|
140
|
+
timeZone: string;
|
|
141
|
+
} | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
quotaCharge?: {
|
|
144
|
+
botId: string;
|
|
145
|
+
bucket: number;
|
|
146
|
+
end: number;
|
|
147
|
+
timeZone: string;
|
|
148
|
+
at: number;
|
|
149
|
+
} | undefined;
|
|
150
|
+
grantUse?: string | undefined;
|
|
151
|
+
}>;
|
|
152
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { autoSharePolicySchema } from '../../shared/data-flow.js';
|
|
4
|
+
import { nextDayBoundary } from './context.js';
|
|
5
|
+
import { nativeIngressCapability } from './trusted-ingress.js';
|
|
6
|
+
export class AutoShareQuota {
|
|
7
|
+
kernel;
|
|
8
|
+
clock;
|
|
9
|
+
constructor(kernel, clock = Date.now) {
|
|
10
|
+
this.kernel = kernel;
|
|
11
|
+
this.clock = clock;
|
|
12
|
+
}
|
|
13
|
+
get policy() {
|
|
14
|
+
return this.kernel.snapshot.autoPolicy ?? { enabled: true, botDaily: 5, domainDaily: 20,
|
|
15
|
+
timeZone: this.kernel.scope.quotaTimeZone, revision: this.kernel.scope.policyRevision };
|
|
16
|
+
}
|
|
17
|
+
async configureHost(input) {
|
|
18
|
+
const previous = this.kernel.snapshot.autoPolicy?.hostConfig;
|
|
19
|
+
if (isDeepStrictEqual(previous, input))
|
|
20
|
+
return;
|
|
21
|
+
const changed = Object.fromEntries(Object.entries(input).filter(([key, value]) => !previous || previous[key] !== value));
|
|
22
|
+
await this.configure({ ...this.policy, ...changed, hostConfig: input });
|
|
23
|
+
}
|
|
24
|
+
async configure(input, expectedRevision = this.kernel.policyRevision) {
|
|
25
|
+
const policy = autoSharePolicySchema.parse({ ...input, revision: expectedRevision + 1 });
|
|
26
|
+
const old = this.policy;
|
|
27
|
+
if (expectedRevision !== this.kernel.policyRevision)
|
|
28
|
+
throw new Error('Sharing policy conflict');
|
|
29
|
+
const unchanged = Object.entries(input).every(([key, value]) => isDeepStrictEqual(old[key], value));
|
|
30
|
+
if (unchanged && this.kernel.snapshot.autoPolicy)
|
|
31
|
+
return;
|
|
32
|
+
await this.kernel.transact(() => {
|
|
33
|
+
if (expectedRevision !== this.kernel.policyRevision)
|
|
34
|
+
throw new Error('Sharing policy conflict');
|
|
35
|
+
return { opId: randomUUID(), kind: 'policy', subjectIds: [], expectedRevision: this.kernel.seq,
|
|
36
|
+
forgetEpoch: this.kernel.epoch, autoPolicy: policy };
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
status() {
|
|
40
|
+
const p = this.policy, charges = [...this.kernel.snapshot.quota.values()];
|
|
41
|
+
const latest = charges.reduce((a, b) => !a || a.at < b.at ? b : a, undefined);
|
|
42
|
+
const now = Math.max(this.clock(), latest?.at ?? 0);
|
|
43
|
+
const domainUsed = latest && now < latest.end ? charges.filter(c => c.bucket === latest.bucket).length : 0;
|
|
44
|
+
return { domainUsed, configured: p.enabled, effectiveAutoShare: false, reason: nativeIngressCapability.reason,
|
|
45
|
+
botDaily: p.botDaily, domainDaily: p.domainDaily, timeZone: p.timeZone, revision: p.revision };
|
|
46
|
+
}
|
|
47
|
+
charge(botId) {
|
|
48
|
+
const charges = [...this.kernel.snapshot.quota.values()], now = this.clock();
|
|
49
|
+
if (!Number.isSafeInteger(now) || now < 0)
|
|
50
|
+
throw new Error('Invalid Host clock');
|
|
51
|
+
const latest = charges.reduce((a, b) => !a || a.at < b.at ? b : a, undefined);
|
|
52
|
+
const at = Math.max(now, latest?.at ?? 0), p = this.policy;
|
|
53
|
+
// A timezone edit takes effect only after the existing bucket ends. Rollback never reopens an old bucket.
|
|
54
|
+
let bucket, end, timeZone;
|
|
55
|
+
if (latest && at < latest.end)
|
|
56
|
+
({ bucket, end, timeZone } = latest);
|
|
57
|
+
else {
|
|
58
|
+
timeZone = p.timeZone;
|
|
59
|
+
end = nextDayBoundary(at, timeZone);
|
|
60
|
+
// Find the current local day start, including DST. Clamp at the previous bucket boundary on timezone changes.
|
|
61
|
+
const day = new Intl.DateTimeFormat('en-CA', { timeZone, dateStyle: 'short' });
|
|
62
|
+
let low = Math.max(0, at - 36 * 3600000), high = at;
|
|
63
|
+
while (high - low > 1) {
|
|
64
|
+
const middle = Math.floor((low + high) / 2);
|
|
65
|
+
if (day.format(middle) === day.format(at))
|
|
66
|
+
high = middle;
|
|
67
|
+
else
|
|
68
|
+
low = middle;
|
|
69
|
+
}
|
|
70
|
+
bucket = Math.max(high, latest?.end ?? 0);
|
|
71
|
+
}
|
|
72
|
+
const sameBucket = charges.filter(c => c.bucket === bucket);
|
|
73
|
+
if (!p.enabled || sameBucket.length >= p.domainDaily || sameBucket.filter(c => c.botId === botId).length >= p.botDaily)
|
|
74
|
+
throw new Error('Automatic sharing disabled or daily quota exhausted');
|
|
75
|
+
return { botId, bucket, end, timeZone, at };
|
|
76
|
+
}
|
|
77
|
+
/** Host-only accounting seam. Caller validates source capability; this method grants no user_stated authority.
|
|
78
|
+
* Used by the future automatic outlet after its capability/checker gates, and synthetic accounting tests now.
|
|
79
|
+
*/
|
|
80
|
+
async commit(opId, owner, policyRevision, build) {
|
|
81
|
+
return this.kernel.transact(() => {
|
|
82
|
+
const old = this.kernel.domain.table('ops').get(opId);
|
|
83
|
+
if (old) {
|
|
84
|
+
const { seq: _seq, payloadRefs: _refs, receiptRefs: _receipts, ...command } = old;
|
|
85
|
+
const proposed = build();
|
|
86
|
+
return { ...proposed, owner, quotaCharge: command.quotaCharge };
|
|
87
|
+
}
|
|
88
|
+
if (policyRevision !== this.kernel.policyRevision)
|
|
89
|
+
throw new Error('Automatic sharing policy changed');
|
|
90
|
+
if (this.kernel.snapshot.retired.has(JSON.stringify(owner)))
|
|
91
|
+
throw new Error('Bot shard retired');
|
|
92
|
+
const command = build();
|
|
93
|
+
if (command.opId !== opId || command.kind !== 'accept' || command.versions?.length !== 1 ||
|
|
94
|
+
command.versions[0]?.scope !== 'shared')
|
|
95
|
+
throw new Error('Automatic quota requires one shared accept operation');
|
|
96
|
+
return { ...command, owner, quotaCharge: this.charge(owner.botId) };
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=quota.js.map
|
|
101
|
+
export const DSH_BOT_MODULE_VERSION = '0.6.7';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quota.js","sourceRoot":"","sources":["../../../src/host/memory/quota.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,OAAO,cAAc;IACJ;IAAuC;IAA5D,YAAqB,MAAoB,EAAmB,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IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC;gBACtF,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;YACnH,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import { type DshBotMemoryMethods, type MemoryRemoteListInput, type MemoryRemotePatch, type MemoryRemoteSaveInput, type MemoryRemoteSearchInput } from '../../shared/remote-contract.js';
|
|
4
|
+
import type { MemoryRecord, MemorySaveResult } from '../../shared/schema.js';
|
|
5
|
+
import { type ForgetChoice, type ForgetSelection } from '../../shared/memory-forget.js';
|
|
6
|
+
import type { MemoryQuery, MemoryCreate, MemoryRevise, MemoryConfirm, MemoryResolve } from '../../shared/memory-management.js';
|
|
7
|
+
declare module '@deepseek-ai/cordis' {
|
|
8
|
+
interface Context {
|
|
9
|
+
dshBotMemory: DshBotMemoryRemote;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** The registry owns all storage and queue lifetimes; this service only adapts UI calls. */
|
|
13
|
+
export declare class DshBotMemoryRemote extends TypertRemoteService implements DshBotMemoryMethods {
|
|
14
|
+
static inject: string[];
|
|
15
|
+
constructor(ctx: Context);
|
|
16
|
+
autoShareStatus(): Promise<{
|
|
17
|
+
shadow: {
|
|
18
|
+
mode: "offline-only";
|
|
19
|
+
shadowEnabled: boolean;
|
|
20
|
+
offlineOrganizeEnabled: boolean;
|
|
21
|
+
opportunities: number;
|
|
22
|
+
candidates: number;
|
|
23
|
+
modelRequests: 0;
|
|
24
|
+
notifications: 0;
|
|
25
|
+
memoryWrites: 0;
|
|
26
|
+
} | undefined;
|
|
27
|
+
domainUsed: number;
|
|
28
|
+
configured: boolean;
|
|
29
|
+
effectiveAutoShare: false;
|
|
30
|
+
reason: "unverifiable-user-input";
|
|
31
|
+
botDaily: number;
|
|
32
|
+
domainDaily: number;
|
|
33
|
+
timeZone: string;
|
|
34
|
+
revision: number;
|
|
35
|
+
}>;
|
|
36
|
+
setAutoShare(input: {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
expectedRevision: number;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
shadow: {
|
|
41
|
+
mode: "offline-only";
|
|
42
|
+
shadowEnabled: boolean;
|
|
43
|
+
offlineOrganizeEnabled: boolean;
|
|
44
|
+
opportunities: number;
|
|
45
|
+
candidates: number;
|
|
46
|
+
modelRequests: 0;
|
|
47
|
+
notifications: 0;
|
|
48
|
+
memoryWrites: 0;
|
|
49
|
+
} | undefined;
|
|
50
|
+
domainUsed: number;
|
|
51
|
+
configured: boolean;
|
|
52
|
+
effectiveAutoShare: false;
|
|
53
|
+
reason: "unverifiable-user-input";
|
|
54
|
+
botDaily: number;
|
|
55
|
+
domainDaily: number;
|
|
56
|
+
timeZone: string;
|
|
57
|
+
revision: number;
|
|
58
|
+
}>;
|
|
59
|
+
query(input: MemoryQuery): Promise<{
|
|
60
|
+
rows: {
|
|
61
|
+
deletedBot: boolean;
|
|
62
|
+
state: "rejected" | "superseded" | "active" | "disputed" | "proposed" | "expired" | "forgotten";
|
|
63
|
+
version: import("../../shared/memory-v2.js").MemoryVersion;
|
|
64
|
+
payload: import("../../shared/memory-v2.js").MemoryPayload;
|
|
65
|
+
}[];
|
|
66
|
+
next?: string | undefined;
|
|
67
|
+
revision: number;
|
|
68
|
+
total: number;
|
|
69
|
+
}>;
|
|
70
|
+
createManaged(input: MemoryCreate): Promise<`${string}-${string}-${string}-${string}-${string}`>;
|
|
71
|
+
revise(input: MemoryRevise): Promise<void>;
|
|
72
|
+
confirm(input: MemoryConfirm): Promise<string>;
|
|
73
|
+
resolve(input: MemoryResolve): Promise<void>;
|
|
74
|
+
previewContribution(id: string): Promise<{
|
|
75
|
+
previewRevision: string;
|
|
76
|
+
memoryId: string;
|
|
77
|
+
mode: "version" | "related";
|
|
78
|
+
revision: number;
|
|
79
|
+
targets: string[];
|
|
80
|
+
sessionIds: string[];
|
|
81
|
+
versions: number;
|
|
82
|
+
historyNodes: number;
|
|
83
|
+
summaries: number;
|
|
84
|
+
copies: number;
|
|
85
|
+
pendingMessages: number;
|
|
86
|
+
conservative: boolean;
|
|
87
|
+
rootInstructions: boolean;
|
|
88
|
+
affectedBots?: number | undefined;
|
|
89
|
+
derivatives?: number | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
previewShared(selection: ForgetSelection): Promise<{
|
|
92
|
+
previewRevision: string;
|
|
93
|
+
memoryId: string;
|
|
94
|
+
mode: "version" | "related";
|
|
95
|
+
revision: number;
|
|
96
|
+
targets: string[];
|
|
97
|
+
sessionIds: string[];
|
|
98
|
+
versions: number;
|
|
99
|
+
historyNodes: number;
|
|
100
|
+
summaries: number;
|
|
101
|
+
copies: number;
|
|
102
|
+
pendingMessages: number;
|
|
103
|
+
conservative: boolean;
|
|
104
|
+
rootInstructions: boolean;
|
|
105
|
+
affectedBots?: number | undefined;
|
|
106
|
+
derivatives?: number | undefined;
|
|
107
|
+
}>;
|
|
108
|
+
private forgetting;
|
|
109
|
+
previewForget(botId: string, selection: ForgetSelection): Promise<{
|
|
110
|
+
previewRevision: string;
|
|
111
|
+
memoryId: string;
|
|
112
|
+
mode: "version" | "related";
|
|
113
|
+
revision: number;
|
|
114
|
+
targets: string[];
|
|
115
|
+
sessionIds: string[];
|
|
116
|
+
versions: number;
|
|
117
|
+
historyNodes: number;
|
|
118
|
+
summaries: number;
|
|
119
|
+
copies: number;
|
|
120
|
+
pendingMessages: number;
|
|
121
|
+
conservative: boolean;
|
|
122
|
+
rootInstructions: boolean;
|
|
123
|
+
affectedBots?: number | undefined;
|
|
124
|
+
derivatives?: number | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
chooseForget(choice: ForgetChoice): Promise<{
|
|
127
|
+
id: string;
|
|
128
|
+
stopped: boolean;
|
|
129
|
+
strong: boolean;
|
|
130
|
+
phase: "blocked" | "intent" | "stopped" | "cleaning" | "verified";
|
|
131
|
+
reasons: ("unavailable" | "history" | "copies" | "system-head" | "inbox" | "root-instructions" | "raw-read-policy" | "inventory" | "flush")[];
|
|
132
|
+
sessions: number;
|
|
133
|
+
}>;
|
|
134
|
+
cleanupStatuses(): Promise<{
|
|
135
|
+
id: string;
|
|
136
|
+
stopped: boolean;
|
|
137
|
+
strong: boolean;
|
|
138
|
+
phase: "blocked" | "intent" | "stopped" | "cleaning" | "verified";
|
|
139
|
+
reasons: ("unavailable" | "history" | "copies" | "system-head" | "inbox" | "root-instructions" | "raw-read-policy" | "inventory" | "flush")[];
|
|
140
|
+
sessions: number;
|
|
141
|
+
}[]>;
|
|
142
|
+
retryCleanup(id: string): Promise<{
|
|
143
|
+
id: string;
|
|
144
|
+
stopped: boolean;
|
|
145
|
+
strong: boolean;
|
|
146
|
+
phase: "blocked" | "intent" | "stopped" | "cleaning" | "verified";
|
|
147
|
+
reasons: ("unavailable" | "history" | "copies" | "system-head" | "inbox" | "root-instructions" | "raw-read-policy" | "inventory" | "flush")[];
|
|
148
|
+
sessions: number;
|
|
149
|
+
}>;
|
|
150
|
+
rootInstructions(): Promise<{
|
|
151
|
+
root: string;
|
|
152
|
+
files: {
|
|
153
|
+
path: string;
|
|
154
|
+
state: "unknown" | "present" | "absent";
|
|
155
|
+
}[];
|
|
156
|
+
}>;
|
|
157
|
+
list(botId: string, options: MemoryRemoteListInput): Promise<MemoryRecord[]>;
|
|
158
|
+
search(botId: string, input: MemoryRemoteSearchInput): Promise<MemoryRecord[]>;
|
|
159
|
+
save(botId: string, input: MemoryRemoteSaveInput): Promise<MemorySaveResult>;
|
|
160
|
+
update(botId: string, id: string, patch: MemoryRemotePatch): Promise<MemoryRecord>;
|
|
161
|
+
remove(botId: string, id: string): Promise<void>;
|
|
162
|
+
quarantineCount(): Promise<number>;
|
|
163
|
+
count(botId: string): Promise<number>;
|
|
164
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
36
|
+
import { memoryRemoteListSchema, memoryRemotePatchSchema, memoryRemoteSaveSchema, memoryRemoteSearchSchema, } from '../../shared/remote-contract.js';
|
|
37
|
+
import { parseInput } from '../errors.js';
|
|
38
|
+
import { rejectMemorySecrets } from './secrets.js';
|
|
39
|
+
import { forgetChoiceSchema, forgetSelectionSchema } from '../../shared/memory-forget.js';
|
|
40
|
+
import { z } from 'zod';
|
|
41
|
+
/** The registry owns all storage and queue lifetimes; this service only adapts UI calls. */
|
|
42
|
+
let DshBotMemoryRemote = (() => {
|
|
43
|
+
let _classSuper = TypertRemoteService;
|
|
44
|
+
let _instanceExtraInitializers = [];
|
|
45
|
+
let _autoShareStatus_decorators;
|
|
46
|
+
let _setAutoShare_decorators;
|
|
47
|
+
let _query_decorators;
|
|
48
|
+
let _createManaged_decorators;
|
|
49
|
+
let _revise_decorators;
|
|
50
|
+
let _confirm_decorators;
|
|
51
|
+
let _resolve_decorators;
|
|
52
|
+
let _previewContribution_decorators;
|
|
53
|
+
let _previewShared_decorators;
|
|
54
|
+
let _previewForget_decorators;
|
|
55
|
+
let _chooseForget_decorators;
|
|
56
|
+
let _cleanupStatuses_decorators;
|
|
57
|
+
let _retryCleanup_decorators;
|
|
58
|
+
let _rootInstructions_decorators;
|
|
59
|
+
let _list_decorators;
|
|
60
|
+
let _search_decorators;
|
|
61
|
+
let _save_decorators;
|
|
62
|
+
let _update_decorators;
|
|
63
|
+
let _remove_decorators;
|
|
64
|
+
let _quarantineCount_decorators;
|
|
65
|
+
let _count_decorators;
|
|
66
|
+
return class DshBotMemoryRemote extends _classSuper {
|
|
67
|
+
static {
|
|
68
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
69
|
+
_autoShareStatus_decorators = [Remote];
|
|
70
|
+
_setAutoShare_decorators = [Remote];
|
|
71
|
+
_query_decorators = [Remote];
|
|
72
|
+
_createManaged_decorators = [Remote];
|
|
73
|
+
_revise_decorators = [Remote];
|
|
74
|
+
_confirm_decorators = [Remote];
|
|
75
|
+
_resolve_decorators = [Remote];
|
|
76
|
+
_previewContribution_decorators = [Remote];
|
|
77
|
+
_previewShared_decorators = [Remote];
|
|
78
|
+
_previewForget_decorators = [Remote];
|
|
79
|
+
_chooseForget_decorators = [Remote];
|
|
80
|
+
_cleanupStatuses_decorators = [Remote];
|
|
81
|
+
_retryCleanup_decorators = [Remote];
|
|
82
|
+
_rootInstructions_decorators = [Remote];
|
|
83
|
+
_list_decorators = [Remote];
|
|
84
|
+
_search_decorators = [Remote];
|
|
85
|
+
_save_decorators = [Remote];
|
|
86
|
+
_update_decorators = [Remote];
|
|
87
|
+
_remove_decorators = [Remote('delete')];
|
|
88
|
+
_quarantineCount_decorators = [Remote];
|
|
89
|
+
_count_decorators = [Remote];
|
|
90
|
+
__esDecorate(this, null, _autoShareStatus_decorators, { kind: "method", name: "autoShareStatus", static: false, private: false, access: { has: obj => "autoShareStatus" in obj, get: obj => obj.autoShareStatus }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
91
|
+
__esDecorate(this, null, _setAutoShare_decorators, { kind: "method", name: "setAutoShare", static: false, private: false, access: { has: obj => "setAutoShare" in obj, get: obj => obj.setAutoShare }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
92
|
+
__esDecorate(this, null, _query_decorators, { kind: "method", name: "query", static: false, private: false, access: { has: obj => "query" in obj, get: obj => obj.query }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
93
|
+
__esDecorate(this, null, _createManaged_decorators, { kind: "method", name: "createManaged", static: false, private: false, access: { has: obj => "createManaged" in obj, get: obj => obj.createManaged }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
94
|
+
__esDecorate(this, null, _revise_decorators, { kind: "method", name: "revise", static: false, private: false, access: { has: obj => "revise" in obj, get: obj => obj.revise }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
95
|
+
__esDecorate(this, null, _confirm_decorators, { kind: "method", name: "confirm", static: false, private: false, access: { has: obj => "confirm" in obj, get: obj => obj.confirm }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
96
|
+
__esDecorate(this, null, _resolve_decorators, { kind: "method", name: "resolve", static: false, private: false, access: { has: obj => "resolve" in obj, get: obj => obj.resolve }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
97
|
+
__esDecorate(this, null, _previewContribution_decorators, { kind: "method", name: "previewContribution", static: false, private: false, access: { has: obj => "previewContribution" in obj, get: obj => obj.previewContribution }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
98
|
+
__esDecorate(this, null, _previewShared_decorators, { kind: "method", name: "previewShared", static: false, private: false, access: { has: obj => "previewShared" in obj, get: obj => obj.previewShared }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
99
|
+
__esDecorate(this, null, _previewForget_decorators, { kind: "method", name: "previewForget", static: false, private: false, access: { has: obj => "previewForget" in obj, get: obj => obj.previewForget }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
100
|
+
__esDecorate(this, null, _chooseForget_decorators, { kind: "method", name: "chooseForget", static: false, private: false, access: { has: obj => "chooseForget" in obj, get: obj => obj.chooseForget }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
101
|
+
__esDecorate(this, null, _cleanupStatuses_decorators, { kind: "method", name: "cleanupStatuses", static: false, private: false, access: { has: obj => "cleanupStatuses" in obj, get: obj => obj.cleanupStatuses }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
102
|
+
__esDecorate(this, null, _retryCleanup_decorators, { kind: "method", name: "retryCleanup", static: false, private: false, access: { has: obj => "retryCleanup" in obj, get: obj => obj.retryCleanup }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
103
|
+
__esDecorate(this, null, _rootInstructions_decorators, { kind: "method", name: "rootInstructions", static: false, private: false, access: { has: obj => "rootInstructions" in obj, get: obj => obj.rootInstructions }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
104
|
+
__esDecorate(this, null, _list_decorators, { kind: "method", name: "list", static: false, private: false, access: { has: obj => "list" in obj, get: obj => obj.list }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
105
|
+
__esDecorate(this, null, _search_decorators, { kind: "method", name: "search", static: false, private: false, access: { has: obj => "search" in obj, get: obj => obj.search }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
106
|
+
__esDecorate(this, null, _save_decorators, { kind: "method", name: "save", static: false, private: false, access: { has: obj => "save" in obj, get: obj => obj.save }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
107
|
+
__esDecorate(this, null, _update_decorators, { kind: "method", name: "update", static: false, private: false, access: { has: obj => "update" in obj, get: obj => obj.update }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
108
|
+
__esDecorate(this, null, _remove_decorators, { kind: "method", name: "remove", static: false, private: false, access: { has: obj => "remove" in obj, get: obj => obj.remove }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
109
|
+
__esDecorate(this, null, _quarantineCount_decorators, { kind: "method", name: "quarantineCount", static: false, private: false, access: { has: obj => "quarantineCount" in obj, get: obj => obj.quarantineCount }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
110
|
+
__esDecorate(this, null, _count_decorators, { kind: "method", name: "count", static: false, private: false, access: { has: obj => "count" in obj, get: obj => obj.count }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
111
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
112
|
+
}
|
|
113
|
+
static inject = ['dshBots'];
|
|
114
|
+
constructor(ctx) {
|
|
115
|
+
super(ctx, 'dshBotMemory', { namespace: 'dshBot.memory' });
|
|
116
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
117
|
+
}
|
|
118
|
+
async autoShareStatus() { return this.ctx.dshBots.autoShareStatus(); }
|
|
119
|
+
async setAutoShare(input) { return this.ctx.dshBots.setAutoShare(input); }
|
|
120
|
+
async query(input) { return this.ctx.dshBots.manageMemory(m => m.query(input)); }
|
|
121
|
+
async createManaged(input) {
|
|
122
|
+
const result = await this.ctx.dshBots.manageMemory(m => m.create(input));
|
|
123
|
+
this.ctx.dshBots.invalidate();
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
async revise(input) {
|
|
127
|
+
await this.ctx.dshBots.manageMemory(m => m.revise(input));
|
|
128
|
+
this.ctx.dshBots.invalidate();
|
|
129
|
+
}
|
|
130
|
+
async confirm(input) {
|
|
131
|
+
const result = await this.ctx.dshBots.manageMemory(m => m.confirm(input));
|
|
132
|
+
this.ctx.dshBots.invalidate();
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
async resolve(input) {
|
|
136
|
+
await this.ctx.dshBots.manageMemory(m => m.resolve(input));
|
|
137
|
+
this.ctx.dshBots.invalidate();
|
|
138
|
+
}
|
|
139
|
+
async previewContribution(id) { return this.forgetting().previews.contribution(parseInput(z.uuid(), id)); }
|
|
140
|
+
async previewShared(selection) {
|
|
141
|
+
return this.forgetting().previewShared(parseInput(forgetSelectionSchema, selection));
|
|
142
|
+
}
|
|
143
|
+
forgetting() {
|
|
144
|
+
const service = this.ctx.dshBots.memoryForget;
|
|
145
|
+
if (!service)
|
|
146
|
+
throw new Error('Memory cleanup is not ready');
|
|
147
|
+
return service;
|
|
148
|
+
}
|
|
149
|
+
async previewForget(botId, selection) {
|
|
150
|
+
return this.forgetting().preview(botId, parseInput(forgetSelectionSchema, selection));
|
|
151
|
+
}
|
|
152
|
+
async chooseForget(choice) {
|
|
153
|
+
const result = await this.forgetting().choose(parseInput(forgetChoiceSchema, choice));
|
|
154
|
+
this.ctx.dshBots.invalidate();
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
async cleanupStatuses() { return this.forgetting().runner.statuses(); }
|
|
158
|
+
async retryCleanup(id) {
|
|
159
|
+
return this.forgetting().runner.resume(parseInput(z.uuid(), id));
|
|
160
|
+
}
|
|
161
|
+
async rootInstructions() { return this.forgetting().roots(); }
|
|
162
|
+
async list(botId, options) {
|
|
163
|
+
return this.ctx.dshBots.memoryFor(botId).query(parseInput(memoryRemoteListSchema, options));
|
|
164
|
+
}
|
|
165
|
+
async search(botId, input) {
|
|
166
|
+
return this.ctx.dshBots.memoryFor(botId).query(parseInput(memoryRemoteSearchSchema, input));
|
|
167
|
+
}
|
|
168
|
+
async save(botId, input) {
|
|
169
|
+
rejectMemorySecrets(input);
|
|
170
|
+
const fields = parseInput(memoryRemoteSaveSchema, input);
|
|
171
|
+
return this.ctx.dshBots.memoryFor(botId).save(fields, { by: 'user', at: Date.now() });
|
|
172
|
+
}
|
|
173
|
+
async update(botId, id, patch) {
|
|
174
|
+
rejectMemorySecrets(patch);
|
|
175
|
+
return this.ctx.dshBots.memoryFor(botId).update(id, parseInput(memoryRemotePatchSchema, patch));
|
|
176
|
+
}
|
|
177
|
+
// "remove" is reserved by rc.2's Client namespace service, including nested namespaces.
|
|
178
|
+
async remove(botId, id) {
|
|
179
|
+
return this.ctx.dshBots.memoryFor(botId).forget({ id });
|
|
180
|
+
}
|
|
181
|
+
async quarantineCount() {
|
|
182
|
+
return this.ctx.dshBots.memoryQuarantineCount();
|
|
183
|
+
}
|
|
184
|
+
async count(botId) {
|
|
185
|
+
return this.ctx.dshBots.memoryFor(botId).count();
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
})();
|
|
189
|
+
export { DshBotMemoryRemote };
|
|
190
|
+
//# sourceMappingURL=remote.js.map
|
|
191
|
+
export const DSH_BOT_MODULE_VERSION = '0.6.7';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../src/host/memory/remote.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAML,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAA2C,MAAM,+BAA+B,CAAC;AACnI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,4FAA4F;IAC/E,kBAAkB;sBAAS,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;iBAA9C,kBAAmB,SAAQ,WAAmB;;;2CAMxD,MAAM;wCAEN,MAAM;iCAEN,MAAM;yCAEN,MAAM;kCAIN,MAAM;mCAIN,MAAM;mCAIN,MAAM;+CAIN,MAAM;yCAEN,MAAM;yCAUN,MAAM;wCAIN,MAAM;2CAMN,MAAM;wCAEN,MAAM;4CAIN,MAAM;gCAGN,MAAM;kCAKN,MAAM;gCAKN,MAAM;kCAON,MAAM;kCAON,MAAM,CAAC,QAAQ,CAAC;2CAKhB,MAAM;iCAKN,MAAM;YAtFP,gMAAM,eAAe,6DAAiD;YAEtE,uLAAM,YAAY,6DAAwG;YAE1H,kKAAM,KAAK,6DAAmF;YAE9F,0LAAM,aAAa,6DAElB;YAED,qKAAM,MAAM,6DAEX;YAED,wKAAM,OAAO,6DAEZ;YAED,wKAAM,OAAO,6DAEZ;YAED,4MAAM,mBAAmB,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