@animalabs/agent-framework 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/agent.d.ts +192 -19
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +404 -65
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/mcp-server-core.d.ts +41 -0
- package/dist/src/api/mcp-server-core.d.ts.map +1 -0
- package/dist/src/api/mcp-server-core.js +593 -0
- package/dist/src/api/mcp-server-core.js.map +1 -0
- package/dist/src/api/mcp-server.d.ts +2 -36
- package/dist/src/api/mcp-server.d.ts.map +1 -1
- package/dist/src/api/mcp-server.js +15 -595
- package/dist/src/api/mcp-server.js.map +1 -1
- package/dist/src/api/server.d.ts +9 -1
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +50 -26
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/api/types.d.ts +9 -1
- package/dist/src/api/types.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.js.map +1 -1
- package/dist/src/framework.d.ts +393 -113
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +1748 -582
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/gate-script.d.ts.map +1 -1
- package/dist/src/gate/gate-script.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcpl/capability-grant.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +26 -7
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +102 -22
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
- package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
- package/dist/src/mcpl/errors.js.map +1 -1
- package/dist/src/mcpl/feature-set-manager.d.ts.map +1 -1
- package/dist/src/mcpl/feature-set-manager.js +4 -3
- package/dist/src/mcpl/feature-set-manager.js.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
- package/dist/src/mcpl/inference-router.d.ts.map +1 -1
- package/dist/src/mcpl/log-value.d.ts +54 -0
- package/dist/src/mcpl/log-value.d.ts.map +1 -0
- package/dist/src/mcpl/log-value.js +109 -0
- package/dist/src/mcpl/log-value.js.map +1 -0
- package/dist/src/mcpl/prose-stream-router.d.ts +6 -6
- package/dist/src/mcpl/prose-stream-router.d.ts.map +1 -1
- package/dist/src/mcpl/prose-stream-router.js +4 -4
- package/dist/src/mcpl/prose-stream-router.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +38 -3
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +81 -16
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts +26 -3
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js +87 -23
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/reference-fetcher.d.ts.map +1 -1
- package/dist/src/mcpl/reference-fetcher.js.map +1 -1
- package/dist/src/mcpl/references.d.ts +2 -2
- package/dist/src/mcpl/references.d.ts.map +1 -1
- package/dist/src/mcpl/references.js.map +1 -1
- package/dist/src/mcpl/refusal-lines.d.ts +37 -0
- package/dist/src/mcpl/refusal-lines.d.ts.map +1 -0
- package/dist/src/mcpl/refusal-lines.js +61 -0
- package/dist/src/mcpl/refusal-lines.js.map +1 -0
- package/dist/src/mcpl/scope-manager.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +18 -2
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +66 -11
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/server-registry.d.ts.map +1 -1
- package/dist/src/mcpl/tool-classes.d.ts +1 -1
- package/dist/src/mcpl/tool-classes.d.ts.map +1 -1
- package/dist/src/mcpl/tool-classes.js +3 -2
- package/dist/src/mcpl/tool-classes.js.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.js.map +1 -1
- package/dist/src/mcpl/transport.d.ts +23 -5
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +103 -10
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +30 -26
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/api/index.d.ts.map +1 -1
- package/dist/src/modules/discord/discord-js-client.d.ts.map +1 -1
- package/dist/src/modules/discord/discord-js-client.js.map +1 -1
- package/dist/src/modules/discord/index.d.ts.map +1 -1
- package/dist/src/modules/discord/index.js +4 -2
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/health/index.d.ts.map +1 -1
- package/dist/src/modules/health/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/history/semantic.d.ts.map +1 -1
- package/dist/src/modules/history/semantic.js.map +1 -1
- package/dist/src/modules/workspace/branch-intent.d.ts.map +1 -1
- package/dist/src/modules/workspace/branch-intent.js.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.d.ts +22 -4
- package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +63 -25
- package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
- package/dist/src/modules/workspace/effects.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +8 -4
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +39 -12
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +43 -8
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +264 -39
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/reconcile.d.ts +17 -1
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +57 -14
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +27 -2
- package/dist/src/modules/workspace/types.d.ts.map +1 -1
- package/dist/src/modules/workspace/types.js.map +1 -1
- package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
- package/dist/src/modules/workspace/watcher.js.map +1 -1
- package/dist/src/operator-log.d.ts.map +1 -1
- package/dist/src/operator-log.js.map +1 -1
- package/dist/src/provider-waits.d.ts.map +1 -1
- package/dist/src/provider-waits.js.map +1 -1
- package/dist/src/queue.d.ts.map +1 -1
- package/dist/src/record-journal.d.ts.map +1 -1
- package/dist/src/record-journal.js.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.d.ts.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.js.map +1 -1
- package/dist/src/recovery/offline-branch.d.ts.map +1 -1
- package/dist/src/recovery/offline-branch.js +29 -24
- package/dist/src/recovery/offline-branch.js.map +1 -1
- package/dist/src/recovery/recover-cli.js.map +1 -1
- package/dist/src/runtime/liveness-watchdog.d.ts.map +1 -1
- package/dist/src/runtime/liveness-watchdog.js.map +1 -1
- package/dist/src/shutdown.d.ts.map +1 -1
- package/dist/src/shutdown.js.map +1 -1
- package/dist/src/stored-removal.d.ts +73 -0
- package/dist/src/stored-removal.d.ts.map +1 -0
- package/dist/src/stored-removal.js +100 -0
- package/dist/src/stored-removal.js.map +1 -0
- package/dist/src/thinking-token-stamp.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts.map +1 -1
- package/dist/src/tool-image-ledger.js.map +1 -1
- package/dist/src/tool-presentation.d.ts.map +1 -1
- package/dist/src/tool-presentation.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts.map +1 -1
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/tune-out/tools.d.ts +1 -1
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/types/agent.d.ts +42 -6
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +10 -0
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +8 -4
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +61 -10
- package/dist/src/types/trace.d.ts.map +1 -1
- package/dist/src/usage/usage-tracker.d.ts.map +1 -1
- package/dist/test/agent-runtime-settings.test.js +1139 -3
- package/dist/test/agent-runtime-settings.test.js.map +1 -1
- package/dist/test/batched-wake-locus.test.js.map +1 -1
- package/dist/test/channel-label-history.test.js.map +1 -1
- package/dist/test/code-execution.test.js.map +1 -1
- package/dist/test/conversation-fork-injection-scoping.test.js.map +1 -1
- package/dist/test/conversation-router.test.js.map +1 -1
- package/dist/test/conversation-routing.test.js +240 -6
- package/dist/test/conversation-routing.test.js.map +1 -1
- package/dist/test/discord-awareness-outbox.test.js +104 -0
- package/dist/test/discord-awareness-outbox.test.js.map +1 -1
- package/dist/test/discord-typing-keepalive.test.d.ts +2 -0
- package/dist/test/discord-typing-keepalive.test.d.ts.map +1 -0
- package/dist/test/discord-typing-keepalive.test.js +77 -0
- package/dist/test/discord-typing-keepalive.test.js.map +1 -0
- package/dist/test/ephemeral-settle.test.js.map +1 -1
- package/dist/test/event-gate-passthrough.test.js.map +1 -1
- package/dist/test/event-gate-policy-mutation.test.js.map +1 -1
- package/dist/test/event-gate-rate-limit.test.js.map +1 -1
- package/dist/test/event-gate-script.test.js.map +1 -1
- package/dist/test/event-gate-selfwake.test.js.map +1 -1
- package/dist/test/event-gate-tags.test.js.map +1 -1
- package/dist/test/event-gate.test.js.map +1 -1
- package/dist/test/explicit-prose-routing.test.js +363 -42
- package/dist/test/explicit-prose-routing.test.js.map +1 -1
- package/dist/test/framework.test.js.map +1 -1
- package/dist/test/helpers/coalescing-fixture.d.ts +2 -0
- package/dist/test/helpers/coalescing-fixture.d.ts.map +1 -1
- package/dist/test/helpers/coalescing-fixture.js +8 -2
- package/dist/test/helpers/coalescing-fixture.js.map +1 -1
- package/dist/test/helpers/mock-membrane.d.ts.map +1 -1
- package/dist/test/helpers/mock-membrane.js.map +1 -1
- package/dist/test/hide-then-turn.test.d.ts +2 -0
- package/dist/test/hide-then-turn.test.d.ts.map +1 -0
- package/dist/test/hide-then-turn.test.js +101 -0
- package/dist/test/hide-then-turn.test.js.map +1 -0
- package/dist/test/history-module-overview.test.js.map +1 -1
- package/dist/test/history-module-semantic.test.js.map +1 -1
- package/dist/test/history-module.test.js.map +1 -1
- package/dist/test/history-semantic-review-findings.test.js.map +1 -1
- package/dist/test/host-quiesce.test.js +125 -0
- package/dist/test/host-quiesce.test.js.map +1 -1
- package/dist/test/inference-exhaustion-rewind.test.js +81 -3
- package/dist/test/inference-exhaustion-rewind.test.js.map +1 -1
- package/dist/test/inference-failure-bounds.test.js +1 -0
- package/dist/test/inference-failure-bounds.test.js.map +1 -1
- package/dist/test/kv-unified-open-flight-retry.test.js.map +1 -1
- package/dist/test/liveness-watchdog.test.js.map +1 -1
- package/dist/test/maintenance-timer.test.js +1564 -2
- package/dist/test/maintenance-timer.test.js.map +1 -1
- package/dist/test/mcp-server-bin.test.d.ts +2 -0
- package/dist/test/mcp-server-bin.test.d.ts.map +1 -0
- package/dist/test/mcp-server-bin.test.js +142 -0
- package/dist/test/mcp-server-bin.test.js.map +1 -0
- package/dist/test/mcpl-awareness-barrier.test.js.map +1 -1
- package/dist/test/mcpl-child-env.test.js +1 -1
- package/dist/test/mcpl-child-env.test.js.map +1 -1
- package/dist/test/mcpl-coalesced-content-parity.test.d.ts +2 -0
- package/dist/test/mcpl-coalesced-content-parity.test.d.ts.map +1 -0
- package/dist/test/mcpl-coalesced-content-parity.test.js +532 -0
- package/dist/test/mcpl-coalesced-content-parity.test.js.map +1 -0
- package/dist/test/mcpl-coalescing.test.js.map +1 -1
- package/dist/test/mcpl-config-diagnostics.test.js.map +1 -1
- package/dist/test/mcpl-gate-roundtrip.test.js.map +1 -1
- package/dist/test/mcpl-manifest-changed.test.js.map +1 -1
- package/dist/test/mcpl-reconnect-events.test.js.map +1 -1
- package/dist/test/mcpl-reconnect-reregistration.test.js +2 -0
- package/dist/test/mcpl-reconnect-reregistration.test.js.map +1 -1
- package/dist/test/mcpl-reference-fetcher.test.js.map +1 -1
- package/dist/test/mcpl-reference-fields.test.js.map +1 -1
- package/dist/test/mcpl-rejection-log-lines.test.d.ts +2 -0
- package/dist/test/mcpl-rejection-log-lines.test.d.ts.map +1 -0
- package/dist/test/mcpl-rejection-log-lines.test.js +349 -0
- package/dist/test/mcpl-rejection-log-lines.test.js.map +1 -0
- package/dist/test/mcpl-stderr-tail.test.d.ts +2 -0
- package/dist/test/mcpl-stderr-tail.test.d.ts.map +1 -0
- package/dist/test/mcpl-stderr-tail.test.js +210 -0
- package/dist/test/mcpl-stderr-tail.test.js.map +1 -0
- package/dist/test/mcpl-tool-lifecycle-e2e.test.js.map +1 -1
- package/dist/test/mcpl-tool-lifecycle-emitter.test.js.map +1 -1
- package/dist/test/mcpl-tool-lifecycle-script.test.js.map +1 -1
- package/dist/test/mcpl-tool-lifecycle.test.js.map +1 -1
- package/dist/test/mcpl-transport-close.test.d.ts +2 -0
- package/dist/test/mcpl-transport-close.test.d.ts.map +1 -0
- package/dist/test/mcpl-transport-close.test.js +373 -0
- package/dist/test/mcpl-transport-close.test.js.map +1 -0
- package/dist/test/mcpl-transport-spawn.test.d.ts +2 -0
- package/dist/test/mcpl-transport-spawn.test.d.ts.map +1 -0
- package/dist/test/mcpl-transport-spawn.test.js +58 -0
- package/dist/test/mcpl-transport-spawn.test.js.map +1 -0
- package/dist/test/mcpl-ws-transport.test.js +1 -0
- package/dist/test/mcpl-ws-transport.test.js.map +1 -1
- package/dist/test/offline-recovery-branch.test.js +344 -0
- package/dist/test/offline-recovery-branch.test.js.map +1 -1
- package/dist/test/operator-surgery.test.js +197 -0
- package/dist/test/operator-surgery.test.js.map +1 -1
- package/dist/test/overbudget-drain-breaker.test.js +1 -0
- package/dist/test/overbudget-drain-breaker.test.js.map +1 -1
- package/dist/test/pack-installs-alone.test.d.ts +2 -0
- package/dist/test/pack-installs-alone.test.d.ts.map +1 -0
- package/dist/test/pack-installs-alone.test.js +284 -0
- package/dist/test/pack-installs-alone.test.js.map +1 -0
- package/dist/test/physical-window-restart.test.d.ts +6 -4
- package/dist/test/physical-window-restart.test.d.ts.map +1 -1
- package/dist/test/physical-window-restart.test.js +275 -10
- package/dist/test/physical-window-restart.test.js.map +1 -1
- package/dist/test/placed-reaction-baseline.test.js.map +1 -1
- package/dist/test/present-while-acting.test.js +949 -6
- package/dist/test/present-while-acting.test.js.map +1 -1
- package/dist/test/provider-acceleration-cooldown.test.js.map +1 -1
- package/dist/test/provider-waits.test.js +67 -4
- package/dist/test/provider-waits.test.js.map +1 -1
- package/dist/test/puppet-tool-call.test.js +2 -0
- package/dist/test/puppet-tool-call.test.js.map +1 -1
- package/dist/test/reaction-baseline-platform.test.js.map +1 -1
- package/dist/test/record-journal.test.js.map +1 -1
- package/dist/test/refusal-rewind.test.js +9 -0
- package/dist/test/refusal-rewind.test.js.map +1 -1
- package/dist/test/refusal-single-call.test.js.map +1 -1
- package/dist/test/release-bump.test.d.ts +2 -0
- package/dist/test/release-bump.test.d.ts.map +1 -0
- package/dist/test/release-bump.test.js +248 -0
- package/dist/test/release-bump.test.js.map +1 -0
- package/dist/test/release-changelog.test.js.map +1 -1
- package/dist/test/release-holds.test.d.ts +2 -0
- package/dist/test/release-holds.test.d.ts.map +1 -0
- package/dist/test/release-holds.test.js +456 -0
- package/dist/test/release-holds.test.js.map +1 -0
- package/dist/test/same-round-think-policy.test.js.map +1 -1
- package/dist/test/shutdown-errors.test.js.map +1 -1
- package/dist/test/silent-heartbeat-rows.test.js.map +1 -1
- package/dist/test/stop-with-host-operations.test.d.ts +20 -0
- package/dist/test/stop-with-host-operations.test.d.ts.map +1 -0
- package/dist/test/stop-with-host-operations.test.js +1174 -0
- package/dist/test/stop-with-host-operations.test.js.map +1 -0
- package/dist/test/stop-with-work-in-flight.test.js +162 -50
- package/dist/test/stop-with-work-in-flight.test.js.map +1 -1
- package/dist/test/surgery-marks-receipt.test.js.map +1 -1
- package/dist/test/tool-batch-hook.test.js.map +1 -1
- package/dist/test/tool-result-guard.test.js +131 -9
- package/dist/test/tool-result-guard.test.js.map +1 -1
- package/dist/test/tool-result-spill.test.js.map +1 -1
- package/dist/test/tool-wrapper-prose-guard-integration.test.js.map +1 -1
- package/dist/test/trunk-channel-routing.test.js +330 -7
- package/dist/test/trunk-channel-routing.test.js.map +1 -1
- package/dist/test/tune-out-e2e.test.js.map +1 -1
- package/dist/test/unconvertible-tool-result.test.js.map +1 -1
- package/dist/test/unsent-compiles.test.d.ts +2 -0
- package/dist/test/unsent-compiles.test.d.ts.map +1 -0
- package/dist/test/unsent-compiles.test.js +139 -0
- package/dist/test/unsent-compiles.test.js.map +1 -0
- package/dist/test/workspace-branch-continuation.test.js.map +1 -1
- package/dist/test/workspace-materialize-freshness.test.js.map +1 -1
- package/dist/test/workspace-read-text.test.js.map +1 -1
- package/dist/test/workspace-three-way.test.js +907 -7
- package/dist/test/workspace-three-way.test.js.map +1 -1
- package/dist/test/workspace-watcher.test.js.map +1 -1
- package/dist/test/xml-round-persist.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/src/agent.ts +411 -66
- package/src/api/mcp-server-core.ts +681 -0
- package/src/api/mcp-server.ts +16 -685
- package/src/api/server.ts +51 -29
- package/src/api/types.ts +9 -1
- package/src/framework.ts +1899 -641
- package/src/index.ts +2 -2
- package/src/mcpl/channel-registry.ts +126 -31
- package/src/mcpl/feature-set-manager.ts +4 -3
- package/src/mcpl/log-value.ts +116 -0
- package/src/mcpl/prose-stream-router.ts +6 -6
- package/src/mcpl/push-coalescer.ts +76 -12
- package/src/mcpl/push-handler.ts +95 -23
- package/src/mcpl/refusal-lines.ts +59 -0
- package/src/mcpl/server-connection.ts +70 -11
- package/src/mcpl/tool-classes.ts +3 -2
- package/src/mcpl/transport.ts +105 -14
- package/src/mcpl/types.ts +5 -1
- package/src/modules/discord/index.ts +4 -2
- package/src/modules/workspace/disk-agreement.ts +74 -18
- package/src/modules/workspace/index.ts +41 -11
- package/src/modules/workspace/observe.ts +265 -39
- package/src/modules/workspace/reconcile.ts +71 -14
- package/src/modules/workspace/types.ts +26 -1
- package/src/recovery/offline-branch.ts +32 -28
- package/src/stored-removal.ts +126 -0
- package/src/types/agent.ts +42 -6
- package/src/types/framework.ts +10 -0
- package/src/types/module.ts +8 -4
- package/src/types/trace.ts +62 -11
package/dist/src/framework.d.ts
CHANGED
|
@@ -104,6 +104,22 @@ export declare class ResumeBlockedError extends Error {
|
|
|
104
104
|
preview: RuntimeSettingsPreview;
|
|
105
105
|
}>);
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* How `runEphemeralToCompletion` rejects when a retryable provider failure
|
|
109
|
+
* states a wait the run won't sleep: one longer than an ephemeral run sleeps
|
|
110
|
+
* in its turn (600 s), an infinite one, or one that is `NaN`. The run ends at
|
|
111
|
+
* once, without retrying inside the wait, and every other ending of the run
|
|
112
|
+
* rejects with a plain `Error`. `retryAfterMs` is the wait as the provider
|
|
113
|
+
* stated it, in milliseconds, so `Infinity` or `NaN` in those two cases: a
|
|
114
|
+
* host that schedules a rerun from it handles a value that isn't finite, and
|
|
115
|
+
* one past the 2,147,483,647 ms a timer can hold. The message says the same
|
|
116
|
+
* in words. A host can test `instanceof` or the `name`, which also holds for
|
|
117
|
+
* an error from another copy of this package.
|
|
118
|
+
*/
|
|
119
|
+
export declare class ProviderWaitNotSleptError extends Error {
|
|
120
|
+
readonly retryAfterMs: number;
|
|
121
|
+
constructor(message: string, retryAfterMs: number);
|
|
122
|
+
}
|
|
107
123
|
interface InferenceToolSnapshot {
|
|
108
124
|
sameRoundThinkTextPolicy: SameRoundThinkTextPolicy;
|
|
109
125
|
}
|
|
@@ -115,18 +131,19 @@ interface InferenceToolSnapshot {
|
|
|
115
131
|
*
|
|
116
132
|
* 400 and 422 are how a provider answers a request that fails its
|
|
117
133
|
* validation, as a history it can't accept does, but other refusals come
|
|
118
|
-
* back the same way, such as
|
|
119
|
-
*
|
|
120
|
-
* large, as an oversized attachment does, shedding that
|
|
121
|
-
* the request back under the limit, and nothing else in
|
|
122
|
-
* recovers a 413; when the history as a whole is too large,
|
|
123
|
-
* help, and the breaker stops at its rewind cap. The 413 arm
|
|
124
|
-
* labels a 413
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* resource, as a rule,
|
|
134
|
+
* back the same way, such as a refusal of the account that membrane doesn't
|
|
135
|
+
* recognize by its text. A 413 is the request's size. When the newest
|
|
136
|
+
* exchange made it too large, as an oversized attachment does, shedding that
|
|
137
|
+
* exchange may bring the request back under the limit, and nothing else in
|
|
138
|
+
* the framework recovers a 413; when the history as a whole is too large,
|
|
139
|
+
* the shed doesn't help, and the breaker stops at its rewind cap. The 413 arm
|
|
140
|
+
* takes both labels membranes have given a 413, invalid_request and
|
|
141
|
+
* context_length (see the notes below). Other statuses keep the history,
|
|
142
|
+
* since a shed takes the exchange out of the agent's context, which only an
|
|
143
|
+
* operator's undo brings back, and the status gives no sign that a shed
|
|
144
|
+
* would help: a 404 is a model or an endpoint that doesn't exist, and 405,
|
|
145
|
+
* 409, 410 and 415 are about the HTTP request or the resource, as a rule,
|
|
146
|
+
* rather than the conversation.
|
|
130
147
|
*
|
|
131
148
|
* The table test in test/inference-exhaustion-rewind.test.ts is this
|
|
132
149
|
* predicate's contract. The notes below on which membrane version gives which
|
|
@@ -141,13 +158,24 @@ interface InferenceToolSnapshot {
|
|
|
141
158
|
* adapter files every status it doesn't list (404, 405, 409, 410, 413,
|
|
142
159
|
* 415, 422 …) as invalid_request, so it alone produces an invalid_request
|
|
143
160
|
* at 413 or 422, and no 0.5.86 adapter produces a context_length at 413.
|
|
144
|
-
* - From membrane
|
|
145
|
-
* adapter
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
161
|
+
* - From membrane 0.5.87 (membrane #56 and #107), this package's floor, every
|
|
162
|
+
* adapter sends an HTTP failure through one status table
|
|
163
|
+
* (errorFromProviderStatus). On a 400 or 422, auth codes and reasons and
|
|
164
|
+
* the two account refusals it recognizes by their text (a balance too low,
|
|
165
|
+
* usage limits reached) are auth, and a context overflow, by its code or
|
|
166
|
+
* text, is context_length. A 401, 402 or 403 is auth, a 408 timeout, a 429
|
|
167
|
+
* rate_limit, a 404 invalid_request and a 413 context_length; other 4xx
|
|
168
|
+
* are invalid_request. So a 413 the table types sheds, an Anthropic one
|
|
169
|
+
* included, while a context_length at 400 or 422, a token overflow, keeps
|
|
170
|
+
* the history, and so does an account refusal, which is auth. An adapter
|
|
171
|
+
* can type a failure before the table does, as Anthropic's does for a
|
|
172
|
+
* gateway's aggregate error (server). A failure with no HTTP status takes
|
|
173
|
+
* the status its provider code implies when the table knows the code, as
|
|
174
|
+
* for Anthropic's mid-stream errors, and is otherwise typed from its
|
|
175
|
+
* message, with no status. The 422 arm also covers an
|
|
176
|
+
* OpenAI-compatible server, such as a FastAPI one, that answers a
|
|
177
|
+
* validation failure with 422. The test of provider answers through the
|
|
178
|
+
* table, beside the table test, pins how the two meet at the floor.
|
|
151
179
|
*
|
|
152
180
|
* An error with no status, from a membrane that reports none, keeps the rule
|
|
153
181
|
* the breaker had before: the type alone.
|
|
@@ -162,6 +190,10 @@ export declare class AgentFramework {
|
|
|
162
190
|
private stopPromise;
|
|
163
191
|
private stopCompleted;
|
|
164
192
|
private ownedStoreClosed;
|
|
193
|
+
/** An operator's operations in flight, and the config materializations they
|
|
194
|
+
* start. stop() waits until this set is empty before it tears down, unless
|
|
195
|
+
* its wait budget runs out. */
|
|
196
|
+
private readonly operatorOperations;
|
|
165
197
|
private membrane;
|
|
166
198
|
private queue;
|
|
167
199
|
private agents;
|
|
@@ -169,16 +201,6 @@ export declare class AgentFramework {
|
|
|
169
201
|
private inferencePolicy;
|
|
170
202
|
private errorPolicy;
|
|
171
203
|
private pendingRequests;
|
|
172
|
-
/**
|
|
173
|
-
* Per-agent channel that triggered the agent's CURRENT inference turn, if any
|
|
174
|
-
* (item-3 redux). Read by the ChannelRegistry's `activeChannelResolver` to
|
|
175
|
-
* route a single-trunk agent's plain-text speech back to the channel it is
|
|
176
|
-
* answering, instead of the process-global most-recent-inbound locus that a
|
|
177
|
-
* concurrent message elsewhere can hijack. Set at turn start (or cleared for a
|
|
178
|
-
* heartbeat / no-trigger turn) in startAgentStream; overwritten by the next
|
|
179
|
-
* turn. Never read between turns (a given agent runs one turn at a time).
|
|
180
|
-
*/
|
|
181
|
-
private activeTriggerChannels;
|
|
182
204
|
private running;
|
|
183
205
|
private loopPromise;
|
|
184
206
|
/** Quiesce/maintenance mode (issue #122). DELIBERATELY separate from
|
|
@@ -201,6 +223,14 @@ export declare class AgentFramework {
|
|
|
201
223
|
private maintenanceRunId;
|
|
202
224
|
private currentMaintenanceRun;
|
|
203
225
|
private maintenanceHistory;
|
|
226
|
+
/** Each agent's last reported maintenance failure, its whole text and when
|
|
227
|
+
* it was alerted, until its maintenance goes without one
|
|
228
|
+
* (reportMaintenanceFailure). */
|
|
229
|
+
private maintenanceFailureReported;
|
|
230
|
+
/** Run records whose failure repeated one already reported, and whose report was suppressed. */
|
|
231
|
+
private maintenanceRepeats;
|
|
232
|
+
/** An operator's maintain (maintenanceTick) asked for the pass running or about to run: the run it records is kept in the history whatever it met. A pass with nothing to run records none. */
|
|
233
|
+
private maintenancePassRequested;
|
|
204
234
|
private providerGates;
|
|
205
235
|
private providerAccelerationCooldowns;
|
|
206
236
|
private providerAccelerationRecoveries;
|
|
@@ -222,32 +252,6 @@ export declare class AgentFramework {
|
|
|
222
252
|
private processLoggingPersist;
|
|
223
253
|
private processLoggingBroadcast;
|
|
224
254
|
private activeStreams;
|
|
225
|
-
/** Per-agent output locus FROZEN for the CURRENT logical turn. Resolved
|
|
226
|
-
* eagerly in startAgentStream (home → addressed trigger → global default)
|
|
227
|
-
* and never moved until the next turn: mid-turn injected messages — ambient
|
|
228
|
-
* chatter, reactions, system markers — must not hijack where the agent's
|
|
229
|
-
* plain prose lands (2026-07-21 Cairn lounge misroute). Lives here — not in
|
|
230
|
-
* driveStream locals — so the pin survives a context-budget stream restart,
|
|
231
|
-
* which continues the same logical turn in a fresh driveStream. Cleared or
|
|
232
|
-
* re-set at the start of every non-restart turn. Since 2026-07-31 the pin
|
|
233
|
-
* is no longer fully frozen: an ADDRESSED conversational injection — or a
|
|
234
|
-
* conversational follow-up in a channel the agent itself explicitly sent
|
|
235
|
-
* into this turn (turnEngagedChannels) — re-pins it at the boundary (see
|
|
236
|
-
* the addressed re-pin block in the tool-result handler). Ambient chatter
|
|
237
|
-
* elsewhere, reactions, and system markers still cannot move it. */
|
|
238
|
-
private turnLocusPins;
|
|
239
|
-
/** Channels the agent EXPLICITLY sent into during the CURRENT turn
|
|
240
|
-
* (SEND_ENGAGEMENT_TOOLS, successful calls), per agent. Second re-pin
|
|
241
|
-
* signal: a conversational reply in a channel the agent just engaged is
|
|
242
|
-
* addressed by context even without a mention (2026-07-31 n=7: q's
|
|
243
|
-
* #portables follow-up — no @mention — was answered in trailing prose
|
|
244
|
-
* that followed the stale pin into repligate's DM). No author-kind
|
|
245
|
-
* filter: agent-residents are full participants, and the bot flag
|
|
246
|
-
* tracks nothing that matters (antra). Reactions/system markers are
|
|
247
|
-
* excluded by isConversationalInjection; the engaged-this-turn scope
|
|
248
|
-
* keeps unrelated channels from moving the pin. Cleared at every fresh
|
|
249
|
-
* turn's start; budget restarts keep it. */
|
|
250
|
-
private turnEngagedChannels;
|
|
251
255
|
/** A tool boundary injected fresh CONVERSATIONAL input (a real message —
|
|
252
256
|
* not a reaction or a system marker) into the live stream. Tells
|
|
253
257
|
* driveStream to clear sticky explicit-send suppression before handling
|
|
@@ -261,12 +265,13 @@ export declare class AgentFramework {
|
|
|
261
265
|
/** Latest bounced (undelivered) prose per agent — the `{{unsent}}` source. */
|
|
262
266
|
private proseClipboards;
|
|
263
267
|
/**
|
|
264
|
-
* Each agent's routing state for its current turn (TurnRouting):
|
|
265
|
-
*
|
|
266
|
-
* hybrid's hold, a
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* turn
|
|
268
|
+
* Each agent's routing state for its current logical turn (TurnRouting):
|
|
269
|
+
* its trigger channel, locus and engaged channels, the sticky destination,
|
|
270
|
+
* the turn's destination, hybrid's hold, a ` !` continuation and receipt
|
|
271
|
+
* tallies. The start that opens a turn makes a
|
|
272
|
+
* new object instead of clearing the old one, and every later stream of
|
|
273
|
+
* the turn shares it (openLogical). A queued delivery holds the object of
|
|
274
|
+
* the turn that queued it, so prose a turn leaves queued when it ends (a
|
|
270
275
|
* skip_reply ends it before its posts have run) still follows that turn's
|
|
271
276
|
* destination, and its late writes can't reach the next turn.
|
|
272
277
|
*/
|
|
@@ -278,23 +283,25 @@ export declare class AgentFramework {
|
|
|
278
283
|
*/
|
|
279
284
|
private proseSpeechChains;
|
|
280
285
|
/**
|
|
281
|
-
* Each agent's open logical turn
|
|
282
|
-
*
|
|
283
|
-
* completes, a tool ends it, or it fails or
|
|
284
|
-
* start that routes prose while it is open
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* a
|
|
295
|
-
*
|
|
296
|
-
* start
|
|
297
|
-
*
|
|
286
|
+
* Each agent's open logical turn: its routing state and receipt tallies
|
|
287
|
+
* (TurnRouting). It stays open from the start that opens it until the
|
|
288
|
+
* turn settles (settleAgent: it completes, a tool ends it, or it fails or
|
|
289
|
+
* is abandoned), and every start that routes prose while it is open
|
|
290
|
+
* continues it with that object: a framework retry, the start that
|
|
291
|
+
* consumes tool results the non-streaming fallback left (whichever wake
|
|
292
|
+
* the scheduler starts it with), the later compile a provider-capacity
|
|
293
|
+
* hold defers a turn to. A silent start neither continues nor opens one,
|
|
294
|
+
* and leaves the open turn's object untouched (its own is the live routing
|
|
295
|
+
* while it runs: turnRouting). A stream that ends without
|
|
296
|
+
* settling needs to do nothing to carry its turn. Settling only detaches
|
|
297
|
+
* the turn from future starts: the settling stream keeps its own object,
|
|
298
|
+
* which its remaining deliveries, its receipt and its ` !` check go on
|
|
299
|
+
* using (a completion settles before it awaits its chain and writes its
|
|
300
|
+
* receipt). So every logical end must close inheritance once, before the
|
|
301
|
+
* next fresh start: a turn left open would hand its object, late writes
|
|
302
|
+
* and all, to an unrelated turn. A tool-ended turn settles before the
|
|
303
|
+
* next turn can start. Only the stream that holds the open turn closes
|
|
304
|
+
* it; disposal drops it, and stop() clears every agent's.
|
|
298
305
|
*/
|
|
299
306
|
private openLogical;
|
|
300
307
|
/** Consecutive bounce-wakes per agent; capped so an agent that keeps
|
|
@@ -357,6 +364,8 @@ export declare class AgentFramework {
|
|
|
357
364
|
* tick counts in the success log stop meaning anything. One kick per agent
|
|
358
365
|
* at a time; cleared when the kick settles (success or failure). */
|
|
359
366
|
private overBudgetDrainInFlight;
|
|
367
|
+
/** The over-budget drain kicks running, which a branch move waits for as it waits for a maintenance pass. */
|
|
368
|
+
private overBudgetDrains;
|
|
360
369
|
/** Per-agent current rewind episode: the single consolidated marker's id and
|
|
361
370
|
* how many turns have been shed so far. One marker per episode, updated in
|
|
362
371
|
* place (see updateRewindMarker); cleared when the episode ends. */
|
|
@@ -570,14 +579,35 @@ export declare class AgentFramework {
|
|
|
570
579
|
*/
|
|
571
580
|
start(): void;
|
|
572
581
|
/**
|
|
573
|
-
* Stop the event loop.
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
*
|
|
582
|
+
* Stop the event loop. After a failed or timed-out wait on operator, module
|
|
583
|
+
* or MCPL cleanup, storage stays open and stop() can be called again. A
|
|
584
|
+
* timed-out wait lets teardown go on while that work may still act on what
|
|
585
|
+
* is being torn down.
|
|
586
|
+
* @param teardownTimeoutMs Optional budget for each wait on cleanup: an
|
|
587
|
+
* operator's operations already running, then modules and MCPL together.
|
|
588
|
+
* Omit to wait until cleanup settles, as required by existing module/child
|
|
589
|
+
* contracts. This does not bound earlier stream, event-loop or maintenance
|
|
590
|
+
* quiescence (a maintenance pass or over-budget drain kick in flight), or
|
|
591
|
+
* cancel cleanup.
|
|
578
592
|
*/
|
|
579
593
|
stop(teardownTimeoutMs?: number | undefined): Promise<void>;
|
|
580
594
|
private resetCompletedStop;
|
|
595
|
+
/** Register before invoking the body, so the set holds the operation for
|
|
596
|
+
* its whole life: its synchronous trace callbacks can reenter stop(), and
|
|
597
|
+
* that stop() must find it. Invocation stays in this stack, preserving
|
|
598
|
+
* immediate mode changes; the returned promise carries its result to the
|
|
599
|
+
* caller. */
|
|
600
|
+
private trackOperatorOperation;
|
|
601
|
+
/** Whether stop() has begun: an attempt in flight (stopPromise is set before
|
|
602
|
+
* its body runs, which emits traces before the queue closes) or a closed
|
|
603
|
+
* queue (after a failed or completed stop()). The admission rule for every
|
|
604
|
+
* operator entry point, the host/command listener included. */
|
|
605
|
+
private stopHasBegun;
|
|
606
|
+
private refuseOperatorAfterStop;
|
|
607
|
+
/** Wait in rounds until the set is empty: admitted work can still start work
|
|
608
|
+
* of its own. All rounds share the caller's deadline rather than renewing
|
|
609
|
+
* its budget. */
|
|
610
|
+
private waitForOperatorOperations;
|
|
581
611
|
private stopOwned;
|
|
582
612
|
/**
|
|
583
613
|
* Advance queued ContextManager work without requiring a new message.
|
|
@@ -597,6 +627,20 @@ export declare class AgentFramework {
|
|
|
597
627
|
private flushAuxiliaryAdmission;
|
|
598
628
|
private waitForAuxiliaryIdle;
|
|
599
629
|
private withAuxiliaryAdmission;
|
|
630
|
+
/**
|
|
631
|
+
* Maintenance makes no provider call while a surgery holds the store. The
|
|
632
|
+
* surgery waits for the maintenance work that is running before it moves
|
|
633
|
+
* the branch, so a call that parked at the gate would make it wait on
|
|
634
|
+
* whatever reopens the gate: the end of a cooldown, or the retry turn a
|
|
635
|
+
* cooldown queues, which the hold itself keeps from starting.
|
|
636
|
+
*/
|
|
637
|
+
private withdrawMaintenanceUnderSurgery;
|
|
638
|
+
/**
|
|
639
|
+
* Nor once stop() has closed provider admission: a stop that catches a
|
|
640
|
+
* tick is the framework stopping on purpose, so the call is withdrawn, as
|
|
641
|
+
* under a surgery's hold, and no failure is reported for it.
|
|
642
|
+
*/
|
|
643
|
+
private withdrawMaintenanceWhenStopping;
|
|
600
644
|
private auxiliaryMembraneFor;
|
|
601
645
|
/**
|
|
602
646
|
* A conversation agent's auxiliary calls (its context manager's
|
|
@@ -606,7 +650,11 @@ export declare class AgentFramework {
|
|
|
606
650
|
* as a resident's are, so they bind its auxiliary calls too: a held model
|
|
607
651
|
* is refused without a call, and an auxiliary call's own stated wait is
|
|
608
652
|
* recorded for it. (An ephemeral run records nothing, its name being
|
|
609
|
-
* single-use, so its context manager keeps the plain membrane.)
|
|
653
|
+
* single-use, so its context manager keeps the plain membrane.) Its
|
|
654
|
+
* compression is the background work a resident's is, whether a
|
|
655
|
+
* maintenance tick or a drain after a message starts it, so it is withdrawn
|
|
656
|
+
* as a resident's is: a call made while a surgery holds the store, or once
|
|
657
|
+
* stop() has closed provider admission, is withdrawn without being sent.
|
|
610
658
|
*/
|
|
611
659
|
private conversationAuxiliaryMembraneFor;
|
|
612
660
|
/** The framework's membrane, with each complete() call passed through
|
|
@@ -645,7 +693,8 @@ export declare class AgentFramework {
|
|
|
645
693
|
*/
|
|
646
694
|
private nonOwningProviderWait;
|
|
647
695
|
/** Why an ephemeral run ended instead of sleeping a provider's stated wait,
|
|
648
|
-
* for its caller
|
|
696
|
+
* for its caller: the text, and the wait itself, which its rejection
|
|
697
|
+
* carries (ProviderWaitNotSleptError). */
|
|
649
698
|
private statedWaitNotSlept;
|
|
650
699
|
/** When a hold's timer next fires: at its deadline, stepped past what one
|
|
651
700
|
* timer can hold. A hold with no deadline (a wait held until released, or
|
|
@@ -710,7 +759,36 @@ export declare class AgentFramework {
|
|
|
710
759
|
private recordProviderAccelerationRecovery;
|
|
711
760
|
private cancelProviderAdmission;
|
|
712
761
|
private startQueuedMaintenance;
|
|
762
|
+
/** resume()'s refusal while a surgery holds the store. */
|
|
763
|
+
private refuseResumeUnderSurgery;
|
|
764
|
+
/** Whether maintenance work is running: a pass, or an over-budget drain kick. */
|
|
765
|
+
private maintenanceRunning;
|
|
766
|
+
/** Wait for the maintenance work that is running, whatever its outcome. */
|
|
767
|
+
private settleMaintenancePass;
|
|
713
768
|
private runQueuedMaintenance;
|
|
769
|
+
/**
|
|
770
|
+
* One agent's maintenance failure: recorded on its run, bounded as every
|
|
771
|
+
* failure sink is (`record.error`), and logged and alerted for that agent
|
|
772
|
+
* with the whole text. A failure that lasts, such as a manager whose
|
|
773
|
+
* strategy failed to initialize, meets every pass, a few seconds apart. It
|
|
774
|
+
* is logged and alerted again only when its whole text changes, once
|
|
775
|
+
* opsAlert's cooldown for it has passed since the webhook last posted it
|
|
776
|
+
* (so the webhook, which posts a kind at most once per cooldown, hears a
|
|
777
|
+
* failure that lasts), or after a pass in which that agent's maintenance
|
|
778
|
+
* went without a failure (maintenanceFailureReported). A record whose
|
|
779
|
+
* failure isn't reported again is marked as a repeat, and a pass whose
|
|
780
|
+
* every record is a repeat that took no tick stays out of the history.
|
|
781
|
+
*/
|
|
782
|
+
private reportMaintenanceFailure;
|
|
783
|
+
/**
|
|
784
|
+
* An agent's context readiness, or the error that reading it threw. The
|
|
785
|
+
* context manager refuses while its strategy's initialization is pending
|
|
786
|
+
* or has failed (context-manager 0.14), and a strategy can refuse on its
|
|
787
|
+
* own, as the autobiographical one does after a store-level branch switch
|
|
788
|
+
* it hasn't reloaded for. Every such throw is that agent's failure.
|
|
789
|
+
*/
|
|
790
|
+
private contextReadiness;
|
|
791
|
+
/** The strategy's progress snapshot, for diagnostics: one it can't give reads as none. */
|
|
714
792
|
private contextProgress;
|
|
715
793
|
/**
|
|
716
794
|
* A server's request or notification the host couldn't handle, answered
|
|
@@ -950,6 +1028,7 @@ export declare class AgentFramework {
|
|
|
950
1028
|
timeoutMs?: number;
|
|
951
1029
|
abandon?: boolean;
|
|
952
1030
|
}): Promise<HostModeStatus>;
|
|
1031
|
+
private runQuiesce;
|
|
953
1032
|
/** Cancel every turn-alive stream via the quiesce_abandoned kind and give
|
|
954
1033
|
* teardown a bounded grace to settle. Shared by the drain-timeout path and
|
|
955
1034
|
* the already-quiesced escalation path. */
|
|
@@ -965,6 +1044,7 @@ export declare class AgentFramework {
|
|
|
965
1044
|
resume(opts?: {
|
|
966
1045
|
force?: boolean;
|
|
967
1046
|
}): Promise<HostModeStatus>;
|
|
1047
|
+
private runResume;
|
|
968
1048
|
/**
|
|
969
1049
|
* Land every deferred write whose target has no turn alive, one at a time,
|
|
970
1050
|
* acknowledging each durably as it lands (the persisted queue is rewritten
|
|
@@ -1035,13 +1115,28 @@ export declare class AgentFramework {
|
|
|
1035
1115
|
* were activated right now — WITHOUT running inference, opening a stream, or
|
|
1036
1116
|
* mutating agent state. Intended for debug/preview tooling.
|
|
1037
1117
|
*
|
|
1038
|
-
*
|
|
1039
|
-
*
|
|
1040
|
-
* `
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1118
|
+
* What a preview commits (default): nothing of its own. It compiles as a
|
|
1119
|
+
* dry run (`dryRun`), filters tools and assembles the system prompt, then
|
|
1120
|
+
* delegates to `Agent.buildActivationRequest`. No tokens are spent, no
|
|
1121
|
+
* external MCPL server is contacted, no fold resolution is persisted and
|
|
1122
|
+
* none of the compression its fold plan calls for is queued; the consumed
|
|
1123
|
+
* watermark and any prepared budget change are left alone; and once
|
|
1124
|
+
* context-manager's thinking binding (context-manager#160, not yet
|
|
1125
|
+
* released) ships, no stamps are committed and no compile awaits
|
|
1126
|
+
* acceptance. In context-manager 0.14 its dry run leaves nothing else
|
|
1127
|
+
* behind but the release of an expired compression hold, as any compile
|
|
1128
|
+
* does (see `Agent.compileWithInjections`). The preview keeps in-memory
|
|
1129
|
+
* bookkeeping of its own, such as handing the context manager the
|
|
1130
|
+
* compression tool definitions, as every activation request does.
|
|
1131
|
+
* Under the autobiographical strategy, a budget the context can't fit
|
|
1132
|
+
* still throws, as for a committing compile: a dry run skips only
|
|
1133
|
+
* context-manager's post-pick check, and an adaptive fold plan that
|
|
1134
|
+
* doesn't fit then overruns at the middle's emission, with a refusal that
|
|
1135
|
+
* names the tokens and the limit. Windowed passthrough's newest message
|
|
1136
|
+
* alone is the one window that comes back larger than the budget. For a
|
|
1137
|
+
* verdict instead of the refusal, `previewContextSettings` returns
|
|
1138
|
+
* context-manager's own at a budget, with the agent's `maxTokens` reserved
|
|
1139
|
+
* for the response.
|
|
1045
1140
|
*
|
|
1046
1141
|
* The trade-off is fidelity: the dynamically-gathered ContextInjection[]
|
|
1047
1142
|
* (module `gatherContext` + MCPL `beforeInference` hooks) are NOT included
|
|
@@ -1066,15 +1161,18 @@ export declare class AgentFramework {
|
|
|
1066
1161
|
*
|
|
1067
1162
|
* Unlike `previewActivation` (which renders a request), this returns the
|
|
1068
1163
|
* picker's plan: resulting tokens, whether it fits, how many summaries would
|
|
1069
|
-
* have to be produced first, and the per-chunk fold levels.
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1164
|
+
* have to be produced first, and the per-chunk fold levels. It commits
|
|
1165
|
+
* nothing: its select is a dry run, which in context-manager 0.14 leaves
|
|
1166
|
+
* what a select leaves behind as the last committing compile left it —
|
|
1167
|
+
* see `AutobiographicalStrategy.previewContext` and
|
|
1168
|
+
* `Agent.compileWithInjections`.
|
|
1072
1169
|
*
|
|
1073
1170
|
* Returns null when the agent's strategy has no fold plan (non-adaptive).
|
|
1074
1171
|
*/
|
|
1075
1172
|
previewContextSettings(agentName: string, budgetTokens: number, overrides?: Record<string, unknown>, opts?: {
|
|
1076
1173
|
render?: boolean;
|
|
1077
1174
|
}): unknown;
|
|
1175
|
+
private previewContextFor;
|
|
1078
1176
|
/**
|
|
1079
1177
|
* Feasibility preview for a runtime-settings patch — or, with no patch, for
|
|
1080
1178
|
* the agent's CURRENT settings (the resume-gate case: quiesce maintenance
|
|
@@ -1089,11 +1187,18 @@ export declare class AgentFramework {
|
|
|
1089
1187
|
* the compile budget and rejected safe-by-construction paced descents.
|
|
1090
1188
|
*
|
|
1091
1189
|
* Never throws for preview-layer reasons: strategy without previewContext,
|
|
1092
|
-
* preview overlap, stale branch generation,
|
|
1093
|
-
* adaptive) path
|
|
1094
|
-
*
|
|
1190
|
+
* preview overlap, stale branch generation, the hierarchical (non-
|
|
1191
|
+
* adaptive) path, and a context manager that refuses its queries (its
|
|
1192
|
+
* strategy's initialization pending or failed) all come back as
|
|
1193
|
+
* `{available: false, reason}`. Unknown agent still throws, matching the
|
|
1194
|
+
* sibling accessors, and so does a patch whose values the agent refuses,
|
|
1195
|
+
* whatever its context manager's state. Whether the strategy takes live
|
|
1196
|
+
* tail and pace settings is the manager's to say, so while it refuses, a
|
|
1197
|
+
* patch that sets them gets no verdict either.
|
|
1095
1198
|
*/
|
|
1096
1199
|
previewAgentRuntimeSettings(agentName: string, patch?: AgentRuntimeSettingsPatch): RuntimeSettingsPreview;
|
|
1200
|
+
/** previewAgentRuntimeSettings for an agent in hand: boot restore previews one not yet registered. */
|
|
1201
|
+
private previewRuntimeSettingsFor;
|
|
1097
1202
|
/**
|
|
1098
1203
|
* Check if process logging is enabled.
|
|
1099
1204
|
*/
|
|
@@ -1138,6 +1243,7 @@ export declare class AgentFramework {
|
|
|
1138
1243
|
getSessionUsage(): SessionUsageSnapshot;
|
|
1139
1244
|
private restoreUsageState;
|
|
1140
1245
|
private persistUsageState;
|
|
1246
|
+
/** An agent's persisted record, or null when it has none; throws when the store can't be read. */
|
|
1141
1247
|
private readAgentRuntimeSettings;
|
|
1142
1248
|
private validatePersistedAgentRuntimeSettings;
|
|
1143
1249
|
/** Load resident-set inline caps from framework state, dropping (loudly)
|
|
@@ -1145,6 +1251,57 @@ export declare class AgentFramework {
|
|
|
1145
1251
|
private readPersistedToolResultInlineCaps;
|
|
1146
1252
|
/** Write (cap) or clear (null) one agent's resident-set inline cap. */
|
|
1147
1253
|
private persistToolResultInlineCap;
|
|
1254
|
+
/**
|
|
1255
|
+
* Apply an agent's persisted settings at boot, each on its own, the budget
|
|
1256
|
+
* last. A persisted setting never stops the agent booting, except a
|
|
1257
|
+
* think-text policy, which fails closed: an invalid one is refused before
|
|
1258
|
+
* this (validatePersistedAgentRuntimeSettings), and a valid one always
|
|
1259
|
+
* applies. A tail, pace or budget that can't be applied now (a tail or pace
|
|
1260
|
+
* on a strategy without live settings, a budget no longer above maxTokens,
|
|
1261
|
+
* a lower one restored paced on a strategy that can't prepare a smaller
|
|
1262
|
+
* window) is kept set but unapplied (Agent.keepRuntimeSettings), so a later
|
|
1263
|
+
* persisting write keeps it in the record.
|
|
1264
|
+
*
|
|
1265
|
+
* A budget below the recipe's restores as a paced descent from it, unless
|
|
1266
|
+
* the record carries its marker (`contextBudgetReachedTokens`, written when
|
|
1267
|
+
* a compile fit at it) and the preflight says it fits now: then it is
|
|
1268
|
+
* applied at once. The preflight plans the stored context as the context
|
|
1269
|
+
* manager will, with the restored tail and pace, so it sees what a restart
|
|
1270
|
+
* can change there: a new maxTokens (the response reserve) or strategy
|
|
1271
|
+
* configuration. It also sees a context that grew while the agent ran at
|
|
1272
|
+
* another budget after the record was written, through a persist: false
|
|
1273
|
+
* change. The system prompt, tools and injections are outside the context
|
|
1274
|
+
* manager's budget, so they don't enter it (context-manager #162). If a
|
|
1275
|
+
* compile at a budget applied at once this way is refused, the agent
|
|
1276
|
+
* restores it paced then (armed by Agent.restoreRuntimeSettings, run in
|
|
1277
|
+
* Agent.compileAtLiveBudgetNoting). A budget at or above the recipe's is
|
|
1278
|
+
* applied at once with or without the marker, as an increase always is.
|
|
1279
|
+
*
|
|
1280
|
+
* When a marked budget isn't applied at once or a setting can't be
|
|
1281
|
+
* applied, one line says why, what couldn't be applied, and the budget set
|
|
1282
|
+
* beside the one compiles plan at.
|
|
1283
|
+
*/
|
|
1284
|
+
private restorePersistedRuntimeSettings;
|
|
1285
|
+
/**
|
|
1286
|
+
* What persists for an agent: its overrides, and `contextBudgetReachedTokens`
|
|
1287
|
+
* when the agent's proof stands for the overridden budget: a compile fit at
|
|
1288
|
+
* it, or the boot applied it at once on the record's proof, and the live
|
|
1289
|
+
* budget hasn't changed since (context-manager #162). A
|
|
1290
|
+
* change of budget, immediate or not, carries none until a compile at it
|
|
1291
|
+
* fits; arming or cancelling a descent leaves the proof as it was.
|
|
1292
|
+
*/
|
|
1293
|
+
private persistedRuntimeSettingsOf;
|
|
1294
|
+
/**
|
|
1295
|
+
* A compile at the agent's live budget came out differently from the last
|
|
1296
|
+
* (Agent.onContextBudgetCompiled). Keep the persisted record's
|
|
1297
|
+
* `contextBudgetReachedTokens` true to it: written when a compile fits at
|
|
1298
|
+
* the record's own budget, withdrawn when the context manager refuses that
|
|
1299
|
+
* budget. Nothing else in the record changes, and a budget other than the
|
|
1300
|
+
* record's (one applied with `persist: false`, or a descent's starting
|
|
1301
|
+
* budget) writes nothing. A record that can't be read, or written, is
|
|
1302
|
+
* logged, and the next compile at that budget tells it again.
|
|
1303
|
+
*/
|
|
1304
|
+
private recordCompiledContextBudget;
|
|
1148
1305
|
private persistAgentRuntimeSettings;
|
|
1149
1306
|
/** Persist (or clear, with null) the host quiesce mode. First process-global
|
|
1150
1307
|
* key in the framework/state slot: quiesce survives a restart BY DESIGN — a
|
|
@@ -1179,6 +1336,17 @@ export declare class AgentFramework {
|
|
|
1179
1336
|
* events after an ephemeral/conversation agent has been disposed. */
|
|
1180
1337
|
private recordLogicalTurnToolCalls;
|
|
1181
1338
|
private recordEphemeralToolCalls;
|
|
1339
|
+
/**
|
|
1340
|
+
* A start dropped before its stream sends anything (its agent was replaced,
|
|
1341
|
+
* or stop() closed admission or ended the lifecycle the start began in)
|
|
1342
|
+
* ends the logical turn it was running. stop() ends every open turn
|
|
1343
|
+
* (openLogical), but a fresh start that awaited its batches' assembly
|
|
1344
|
+
* across a stop() reaches its routing after it and opens its turn. That
|
|
1345
|
+
* turn would then stay open, and the agent's first start after a restart
|
|
1346
|
+
* would continue the dropped turn's routing. The identity check leaves any
|
|
1347
|
+
* other turn open.
|
|
1348
|
+
*/
|
|
1349
|
+
private endDroppedTurn;
|
|
1182
1350
|
/** A logical turn's end, for every agent: it closes the agent's open
|
|
1183
1351
|
* logical turn when it is the settling stream's own (openLogical), and
|
|
1184
1352
|
* settles an active ephemeral run. The run's tool-call count comes from
|
|
@@ -1191,6 +1359,9 @@ export declare class AgentFramework {
|
|
|
1191
1359
|
* The agent is temporarily registered, inference is triggered, and the
|
|
1192
1360
|
* framework drives the stream (emitting traces, logging, dispatching tools).
|
|
1193
1361
|
* Returns the agent's speech output when it finishes (no more tool calls).
|
|
1362
|
+
* Rejects with ProviderWaitNotSleptError when the run ends rather than sleep
|
|
1363
|
+
* a retryable failure's stated wait, and with a plain Error for any other
|
|
1364
|
+
* ending.
|
|
1194
1365
|
*
|
|
1195
1366
|
* The caller provides a pre-created agent + contextManager (from createEphemeralAgent).
|
|
1196
1367
|
* The task message should already be in the context manager.
|
|
@@ -1340,6 +1511,8 @@ export declare class AgentFramework {
|
|
|
1340
1511
|
* explicit, recorded operator override.
|
|
1341
1512
|
*/
|
|
1342
1513
|
private handleHostCommand;
|
|
1514
|
+
/** handleHostCommand's work, run where stop() can wait for it. */
|
|
1515
|
+
private runHostCommand;
|
|
1343
1516
|
/**
|
|
1344
1517
|
* The last message the agent would see in its context right now, via the
|
|
1345
1518
|
* transparent `previewActivation` render (no inference, no Chronicle
|
|
@@ -1370,6 +1543,22 @@ export declare class AgentFramework {
|
|
|
1370
1543
|
* Get the most recent process logs (tail).
|
|
1371
1544
|
*/
|
|
1372
1545
|
tailProcessLogs(count?: number, eventType?: string): ProcessLogEntryWithId[];
|
|
1546
|
+
/**
|
|
1547
|
+
* Switch the store to an existing branch, start the delivery of the
|
|
1548
|
+
* Discord awareness marks the move changes (startDiscordAwarenessDelivery),
|
|
1549
|
+
* and re-materialize the config mount from it. Resolves once the mount has
|
|
1550
|
+
* run; if it fails, it rejects with the store already moved. The marks'
|
|
1551
|
+
* delivery isn't awaited, and its failure doesn't fail the switch. The
|
|
1552
|
+
* store has moved by the time the call returns, before its promise
|
|
1553
|
+
* settles, and a refusal moves nothing. An operator's operation: refused
|
|
1554
|
+
* once stop() has begun, and waited for by stop() while it runs.
|
|
1555
|
+
*
|
|
1556
|
+
* The branch moves under every agent sharing the store, so the switch
|
|
1557
|
+
* reserves the store as a surgery does: every agent must be idle, or it is
|
|
1558
|
+
* refused (OperatorActionError 'agent-busy'), and no turn starts until the
|
|
1559
|
+
* switch is done.
|
|
1560
|
+
*/
|
|
1561
|
+
switchBranch(name: string): Promise<void>;
|
|
1373
1562
|
/**
|
|
1374
1563
|
* Undo the last inference turn for an agent.
|
|
1375
1564
|
*
|
|
@@ -1386,6 +1575,9 @@ export declare class AgentFramework {
|
|
|
1386
1575
|
fromBranch?: string;
|
|
1387
1576
|
toBranch?: string;
|
|
1388
1577
|
};
|
|
1578
|
+
/** undoLastTurn's work, for a host/command undo already admitted: a stop()
|
|
1579
|
+
* begun by a trace of one of its turns doesn't refuse the next. */
|
|
1580
|
+
private runUndoLastTurn;
|
|
1389
1581
|
/**
|
|
1390
1582
|
* Redo a previously undone turn for an agent.
|
|
1391
1583
|
*
|
|
@@ -1543,9 +1735,9 @@ export declare class AgentFramework {
|
|
|
1543
1735
|
* undo or redo) without the caller awaiting it. No operator response waits
|
|
1544
1736
|
* for Discord to accept marks: the MCPL data-plane gate alone holds channel
|
|
1545
1737
|
* traffic that arrives after it until they are attempted.
|
|
1546
|
-
*
|
|
1547
|
-
*
|
|
1548
|
-
*
|
|
1738
|
+
* The sync's body installs that gate synchronously, before its first
|
|
1739
|
+
* await, so calling this while a surgery still holds the store puts the
|
|
1740
|
+
* gate up before the store is released. With no drain running, the
|
|
1549
1741
|
* drain starts in the same synchronous run (the first reaction request can
|
|
1550
1742
|
* be written before this returns); with one running, this generation's pass
|
|
1551
1743
|
* follows it (drainForGeneration). Either way delivery continues
|
|
@@ -1556,10 +1748,20 @@ export declare class AgentFramework {
|
|
|
1556
1748
|
* (queued when a surgery began, or arriving during its switch or fork): the
|
|
1557
1749
|
* surgery's store reservation, which used to hold such a turn through the
|
|
1558
1750
|
* drain, now ends once the gate is up. A failure is accounted by the gate
|
|
1559
|
-
* itself: the current generation's failure recycles the connections,
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
*
|
|
1751
|
+
* itself: the current generation's failure recycles the connections (or,
|
|
1752
|
+
* once the host is stopping, releases the gate instead), and a superseded
|
|
1753
|
+
* one leaves that to the newer generation, whose own pass meets the same
|
|
1754
|
+
* ledger. Here it is logged and raised as an ops alert, and the next sync,
|
|
1755
|
+
* reconnect or start delivers what is still pending.
|
|
1756
|
+
*
|
|
1757
|
+
* Like a server's drain, the delivery runs apart from the operation that
|
|
1758
|
+
* started it: it isn't an operator's operation, so stop() doesn't wait for
|
|
1759
|
+
* it. A drain already running when stop() begins runs on while the
|
|
1760
|
+
* connections close, and what it can't deliver stays pending in the
|
|
1761
|
+
* durable outbox. Once stop() has begun, none is started, since there's
|
|
1762
|
+
* no point opening a drain that the teardown is about to cut off: the
|
|
1763
|
+
* marks stay pending, and the next start's barrier reconciles the outbox
|
|
1764
|
+
* with the branch and delivers them.
|
|
1563
1765
|
*
|
|
1564
1766
|
* @param after What moved the branch, for the log and the alert
|
|
1565
1767
|
* ("rollback", "branch switch", "undo" …).
|
|
@@ -1567,8 +1769,8 @@ export declare class AgentFramework {
|
|
|
1567
1769
|
* branch switch that names none.
|
|
1568
1770
|
*/
|
|
1569
1771
|
startDiscordAwarenessDelivery(after: string, agentName?: string): void;
|
|
1570
|
-
/**
|
|
1571
|
-
*
|
|
1772
|
+
/** Start config file IO without holding the caller or a surgery's store
|
|
1773
|
+
* reservation. The gate picks it up by mtime; stop() still waits for it. */
|
|
1572
1774
|
private materializeConfigMountAfterBranchSwitch;
|
|
1573
1775
|
/**
|
|
1574
1776
|
* Check if undo/redo is available for an agent.
|
|
@@ -1651,9 +1853,10 @@ export declare class AgentFramework {
|
|
|
1651
1853
|
/**
|
|
1652
1854
|
* Spawn a persistent per-channel conversation agent ("fork") from the
|
|
1653
1855
|
* template agent: own ContextManager under `conversations/{name}`, seeded
|
|
1654
|
-
* with
|
|
1655
|
-
* wholesale-copy pattern
|
|
1656
|
-
* but never
|
|
1856
|
+
* with the template's compiled context without its thinking or its unpaired
|
|
1857
|
+
* tool blocks (the SubagentModule wholesale-copy pattern; see the seeding
|
|
1858
|
+
* comment below), registered in the event loop like any agent — but never
|
|
1859
|
+
* primary.
|
|
1657
1860
|
*/
|
|
1658
1861
|
private createConversationAgent;
|
|
1659
1862
|
/** Persist the router's generation counters (see hydration in create()). */
|
|
@@ -1822,6 +2025,59 @@ export declare class AgentFramework {
|
|
|
1822
2025
|
* inference; never locus-eligible itself (system + no channel metadata).
|
|
1823
2026
|
*/
|
|
1824
2027
|
private announceLocusIfChanged;
|
|
2028
|
+
/**
|
|
2029
|
+
* The channel a message moves its turn's locus to, by the addressed
|
|
2030
|
+
* re-pin rule (2026-07-31, n=6 and n=7): a conversational message (not a
|
|
2031
|
+
* reaction or a system marker) that addressed the agent, or that follows
|
|
2032
|
+
* up in a channel the turn sent into (TurnRouting.engaged). Undefined for
|
|
2033
|
+
* any other message. A tool boundary weighs the messages it injects by it,
|
|
2034
|
+
* and noteArrival the ones no boundary of the turn weighs.
|
|
2035
|
+
*/
|
|
2036
|
+
private repinChannel;
|
|
2037
|
+
/**
|
|
2038
|
+
* Weigh a message that no tool boundary of the agent's open logical turn
|
|
2039
|
+
* will weigh: one that would re-pin the locus becomes one of the turn's
|
|
2040
|
+
* arrivals (TurnRouting.arrivals). A message tune-out diverted
|
|
2041
|
+
* (metadata.tuneOut) never enters a resident's compiled view, so the agent
|
|
2042
|
+
* won't see it, and it moves nothing.
|
|
2043
|
+
*/
|
|
2044
|
+
private noteArrival;
|
|
2045
|
+
/**
|
|
2046
|
+
* Whether `agent`'s store is the residents' one message slot, which every
|
|
2047
|
+
* ordinary resident reads (sharedSlotAgents). The subconscious reads that
|
|
2048
|
+
* slot through a merged view, but its own store is isolated, as a fork's
|
|
2049
|
+
* or an ephemeral agent's is.
|
|
2050
|
+
*/
|
|
2051
|
+
private isOrdinaryResident;
|
|
2052
|
+
/**
|
|
2053
|
+
* Weigh a message just stored in an ordinary resident's store for every
|
|
2054
|
+
* other ordinary resident's open turn, running or not: residents read one
|
|
2055
|
+
* message slot, and a tool boundary weighs only the messages drained for
|
|
2056
|
+
* its own agent, so no boundary of another resident's turn weighs it.
|
|
2057
|
+
*/
|
|
2058
|
+
private noteForOtherResidents;
|
|
2059
|
+
/**
|
|
2060
|
+
* The channel of the turn's newest arrival whose message is still in the
|
|
2061
|
+
* agent's store (TurnRouting.arrivals). A message removed since it was
|
|
2062
|
+
* stored, such as an unread coalesced message its server retracted, moves
|
|
2063
|
+
* nothing, and an earlier one that remains still does. Compression keeps a
|
|
2064
|
+
* message in the store; the last compile can't be the test, since an
|
|
2065
|
+
* arrival between the turn's streams isn't in it yet.
|
|
2066
|
+
*/
|
|
2067
|
+
private remainingArrival;
|
|
2068
|
+
/**
|
|
2069
|
+
* Move a turn's locus to the channel its conversation moved to: an
|
|
2070
|
+
* addressed message, or a follow-up in a channel the turn engaged (the
|
|
2071
|
+
* addressed re-pin, repinChannel). Ambient chatter never moves it. Leaves
|
|
2072
|
+
* a durable `[routing]` notice in the window and updates
|
|
2073
|
+
* lastAnnouncedLocus once it's stored, so the next turn's announce-on-change
|
|
2074
|
+
* diffs against what the agent was last told. Returns the notice as stored, for a live
|
|
2075
|
+
* stream to inject with its boundary's other messages. Returns undefined
|
|
2076
|
+
* when the locus is already there, and when the notice couldn't be
|
|
2077
|
+
* stored. The locus has moved then too, but the announce baseline hasn't,
|
|
2078
|
+
* so the agent's next turn announces where its speech lands.
|
|
2079
|
+
*/
|
|
2080
|
+
private repinTurnLocus;
|
|
1825
2081
|
/**
|
|
1826
2082
|
* Durable window notice for a channel the agent did not ask to open —
|
|
1827
2083
|
* subscription-policy admission, or an open forced by the agent's own
|
|
@@ -1881,6 +2137,18 @@ export declare class AgentFramework {
|
|
|
1881
2137
|
*/
|
|
1882
2138
|
private maybePrimeProseMode;
|
|
1883
2139
|
private startAgentStream;
|
|
2140
|
+
/**
|
|
2141
|
+
* End a turn that beginAgentTurn drops before it sends anything. The turn
|
|
2142
|
+
* emitted inference:started, and listeners that bracket a turn, such as a
|
|
2143
|
+
* typing loop or an activity indicator, end it on a terminal event, so it
|
|
2144
|
+
* gets inference:aborted with `reason`, and lastInference records its end
|
|
2145
|
+
* as driveStream's would, when the record is still this turn's. Nothing of
|
|
2146
|
+
* the kind when another turn of this agent's name holds the turn token (one
|
|
2147
|
+
* begun after a stop and start, or by a replacement agent object): the
|
|
2148
|
+
* event and the record carry only the name, so this frame's would end that
|
|
2149
|
+
* newer turn instead.
|
|
2150
|
+
*/
|
|
2151
|
+
private abortDroppedTurn;
|
|
1884
2152
|
/**
|
|
1885
2153
|
* Body of startAgentStream, split out so the caller's try/finally owns the
|
|
1886
2154
|
* turn token unconditionally. Returns true iff the token was handed off to
|
|
@@ -1942,6 +2210,8 @@ export declare class AgentFramework {
|
|
|
1942
2210
|
toolUseId: string;
|
|
1943
2211
|
result: ToolResult;
|
|
1944
2212
|
}>;
|
|
2213
|
+
/** puppetToolCall's work, run where stop() can wait for it. */
|
|
2214
|
+
private runPuppetToolCall;
|
|
1945
2215
|
private executeToolCallFrom;
|
|
1946
2216
|
private executeMcplToolCall;
|
|
1947
2217
|
/** Event-pushing wrapper for the model-driven dispatch path. */
|
|
@@ -2252,9 +2522,16 @@ export declare class AgentFramework {
|
|
|
2252
2522
|
/**
|
|
2253
2523
|
* Reconcile the durable ledger with Chronicle, then deliver every server's
|
|
2254
2524
|
* work. A drain still running is waited for and then followed by a fresh
|
|
2255
|
-
* pass (drainForGeneration).
|
|
2256
|
-
|
|
2257
|
-
|
|
2525
|
+
* pass (drainForGeneration). Like the other operator entry points, it's
|
|
2526
|
+
* refused once stop() has begun, and stop() waits for one already running.
|
|
2527
|
+
* The framework's own branch moves start their delivery without awaiting
|
|
2528
|
+
* it (startDiscordAwarenessDelivery).
|
|
2529
|
+
*/
|
|
2530
|
+
syncDiscordAwarenessMarkers(onlyServerId?: string): Promise<void>;
|
|
2531
|
+
/** The sync's work. It installs the MCPL data-plane gate before its first
|
|
2532
|
+
* await, so a caller that starts it while holding the store puts the gate
|
|
2533
|
+
* up before releasing the store. */
|
|
2534
|
+
private runDiscordAwarenessSync;
|
|
2258
2535
|
private resumePreparedDiscordSuppressions;
|
|
2259
2536
|
/**
|
|
2260
2537
|
* Deliver every due ref independently. Permanent Discord failures are kept
|
|
@@ -2385,6 +2662,7 @@ export declare class AgentFramework {
|
|
|
2385
2662
|
* connection/handshake fails.
|
|
2386
2663
|
*/
|
|
2387
2664
|
connectMcplServer(config: import('./mcpl/types.js').McplServerConfig): Promise<void>;
|
|
2665
|
+
private runConnectMcplServer;
|
|
2388
2666
|
/**
|
|
2389
2667
|
* Disconnect an MCPL server at runtime: close the connection, destroy its
|
|
2390
2668
|
* feature-set and checkpoint state (permanent removal — unlike a transient
|
|
@@ -2393,6 +2671,7 @@ export declare class AgentFramework {
|
|
|
2393
2671
|
* No-op-ish if the server is not connected (still clears routing state).
|
|
2394
2672
|
*/
|
|
2395
2673
|
disconnectMcplServer(id: string): Promise<void>;
|
|
2674
|
+
private runDisconnectMcplServer;
|
|
2396
2675
|
/**
|
|
2397
2676
|
* Restart an MCPL server at runtime: disconnect, then reconnect with the
|
|
2398
2677
|
* same (or an updated) config. This actually respawns a stdio child —
|
|
@@ -2400,6 +2679,7 @@ export declare class AgentFramework {
|
|
|
2400
2679
|
* failures. Throws if the server has no stored config and none is given.
|
|
2401
2680
|
*/
|
|
2402
2681
|
restartMcplServer(id: string, newConfig?: import('./mcpl/types.js').McplServerConfig): Promise<void>;
|
|
2682
|
+
private runRestartMcplServer;
|
|
2403
2683
|
/**
|
|
2404
2684
|
* List configured MCPL servers with live connection status and the number
|
|
2405
2685
|
* of tools each currently contributes.
|