@animalabs/agent-framework 0.22.2 → 0.22.4
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 +3 -1
- package/dist/src/agent.d.ts +77 -12
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +143 -41
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/mcp-server-core.js +1 -1
- package/dist/src/api/mcp-server-core.js.map +1 -1
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +5 -1
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/api/types.d.ts +1 -1
- package/dist/src/api/types.d.ts.map +1 -1
- package/dist/src/branch-names.d.ts +14 -0
- package/dist/src/branch-names.d.ts.map +1 -0
- package/dist/src/branch-names.js +22 -0
- package/dist/src/branch-names.js.map +1 -0
- package/dist/src/closest-names.d.ts +28 -0
- package/dist/src/closest-names.d.ts.map +1 -0
- package/dist/src/closest-names.js +98 -0
- package/dist/src/closest-names.js.map +1 -0
- package/dist/src/code-execution/py-runner.d.ts +16 -5
- package/dist/src/code-execution/py-runner.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.js +186 -74
- package/dist/src/code-execution/py-runner.js.map +1 -1
- package/dist/src/code-execution/runtime-py.d.ts.map +1 -1
- package/dist/src/code-execution/runtime-py.js +49 -3
- package/dist/src/code-execution/runtime-py.js.map +1 -1
- package/dist/src/code-execution/tool-definition.d.ts +12 -1
- package/dist/src/code-execution/tool-definition.d.ts.map +1 -1
- package/dist/src/code-execution/tool-definition.js +21 -3
- package/dist/src/code-execution/tool-definition.js.map +1 -1
- package/dist/src/config-checks.d.ts +28 -0
- package/dist/src/config-checks.d.ts.map +1 -0
- package/dist/src/config-checks.js +52 -0
- package/dist/src/config-checks.js.map +1 -0
- package/dist/src/deadline-timer.d.ts +21 -0
- package/dist/src/deadline-timer.d.ts.map +1 -0
- package/dist/src/deadline-timer.js +43 -0
- package/dist/src/deadline-timer.js.map +1 -0
- package/dist/src/error-message.d.ts +30 -0
- package/dist/src/error-message.d.ts.map +1 -0
- package/dist/src/error-message.js +50 -0
- package/dist/src/error-message.js.map +1 -0
- package/dist/src/framework.d.ts +828 -88
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +5011 -1326
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +8 -0
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +27 -3
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +144 -6
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +424 -263
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.d.ts +21 -1
- package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.js +91 -30
- package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
- package/dist/src/mcpl/conversation-router.d.ts +19 -3
- package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
- package/dist/src/mcpl/conversation-router.js +23 -8
- package/dist/src/mcpl/conversation-router.js.map +1 -1
- package/dist/src/mcpl/convert-block.d.ts +20 -0
- package/dist/src/mcpl/convert-block.d.ts.map +1 -0
- package/dist/src/mcpl/convert-block.js +89 -0
- package/dist/src/mcpl/convert-block.js.map +1 -0
- package/dist/src/mcpl/errors.d.ts +13 -0
- package/dist/src/mcpl/errors.d.ts.map +1 -1
- package/dist/src/mcpl/errors.js +28 -0
- package/dist/src/mcpl/errors.js.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts +23 -0
- package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.js +83 -72
- package/dist/src/mcpl/hook-orchestrator.js.map +1 -1
- package/dist/src/mcpl/inbound-source.d.ts +114 -0
- package/dist/src/mcpl/inbound-source.d.ts.map +1 -0
- package/dist/src/mcpl/inbound-source.js +83 -0
- package/dist/src/mcpl/inbound-source.js.map +1 -0
- package/dist/src/mcpl/index.d.ts +3 -1
- package/dist/src/mcpl/index.d.ts.map +1 -1
- package/dist/src/mcpl/index.js +3 -1
- package/dist/src/mcpl/index.js.map +1 -1
- package/dist/src/mcpl/inference-router.d.ts +15 -11
- package/dist/src/mcpl/inference-router.d.ts.map +1 -1
- package/dist/src/mcpl/inference-router.js +153 -84
- package/dist/src/mcpl/inference-router.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +33 -11
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +52 -20
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts +16 -9
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js +18 -83
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/reference-fetcher.d.ts +14 -2
- package/dist/src/mcpl/reference-fetcher.d.ts.map +1 -1
- package/dist/src/mcpl/reference-fetcher.js +72 -30
- package/dist/src/mcpl/reference-fetcher.js.map +1 -1
- package/dist/src/mcpl/references.d.ts +47 -12
- package/dist/src/mcpl/references.d.ts.map +1 -1
- package/dist/src/mcpl/references.js +74 -21
- package/dist/src/mcpl/references.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +89 -10
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +405 -129
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/server-registry.d.ts +10 -1
- package/dist/src/mcpl/server-registry.d.ts.map +1 -1
- package/dist/src/mcpl/server-registry.js +14 -3
- package/dist/src/mcpl/server-registry.js.map +1 -1
- package/dist/src/mcpl/skip-reply-wake.d.ts +36 -0
- package/dist/src/mcpl/skip-reply-wake.d.ts.map +1 -0
- package/dist/src/mcpl/skip-reply-wake.js +55 -0
- package/dist/src/mcpl/skip-reply-wake.js.map +1 -0
- package/dist/src/mcpl/transport.d.ts +51 -2
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +114 -20
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +14 -3
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/mcpl/visible-content.d.ts +15 -0
- package/dist/src/mcpl/visible-content.d.ts.map +1 -1
- package/dist/src/mcpl/visible-content.js +25 -0
- package/dist/src/mcpl/visible-content.js.map +1 -1
- package/dist/src/module-registry.d.ts +19 -1
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +54 -25
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/api/index.js +1 -1
- package/dist/src/modules/api/index.js.map +1 -1
- package/dist/src/modules/discord/discord-js-client.d.ts +1 -0
- package/dist/src/modules/discord/discord-js-client.d.ts.map +1 -1
- package/dist/src/modules/discord/discord-js-client.js +25 -9
- package/dist/src/modules/discord/discord-js-client.js.map +1 -1
- package/dist/src/modules/discord/index.d.ts +29 -3
- package/dist/src/modules/discord/index.d.ts.map +1 -1
- package/dist/src/modules/discord/index.js +379 -143
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/discord/types.d.ts +14 -1
- package/dist/src/modules/discord/types.d.ts.map +1 -1
- package/dist/src/modules/health/index.d.ts.map +1 -1
- package/dist/src/modules/health/index.js +2 -1
- package/dist/src/modules/health/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts +3 -1
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js +359 -127
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/history/semantic.d.ts +28 -1
- package/dist/src/modules/history/semantic.d.ts.map +1 -1
- package/dist/src/modules/history/semantic.js +177 -32
- package/dist/src/modules/history/semantic.js.map +1 -1
- package/dist/src/modules/unknown-tool.d.ts +10 -0
- package/dist/src/modules/unknown-tool.d.ts.map +1 -0
- package/dist/src/modules/unknown-tool.js +17 -0
- package/dist/src/modules/unknown-tool.js.map +1 -0
- package/dist/src/modules/workspace/disk-agreement.d.ts +32 -2
- package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +30 -2
- package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
- package/dist/src/modules/workspace/effects.d.ts +64 -6
- package/dist/src/modules/workspace/effects.d.ts.map +1 -1
- package/dist/src/modules/workspace/effects.js +291 -44
- package/dist/src/modules/workspace/effects.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +119 -23
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +793 -247
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +75 -8
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +174 -14
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/reconcile.d.ts +58 -7
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +521 -56
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +18 -4
- 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 +7 -2
- package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
- package/dist/src/modules/workspace/watcher.js +28 -4
- package/dist/src/modules/workspace/watcher.js.map +1 -1
- package/dist/src/prose-drafts.d.ts +240 -0
- package/dist/src/prose-drafts.d.ts.map +1 -0
- package/dist/src/prose-drafts.js +362 -0
- package/dist/src/prose-drafts.js.map +1 -0
- package/dist/src/prose-segments.d.ts +21 -2
- package/dist/src/prose-segments.d.ts.map +1 -1
- package/dist/src/prose-segments.js +46 -9
- package/dist/src/prose-segments.js.map +1 -1
- package/dist/src/recovery/offline-branch.d.ts +1 -0
- package/dist/src/recovery/offline-branch.d.ts.map +1 -1
- package/dist/src/recovery/offline-branch.js +3 -1
- package/dist/src/recovery/offline-branch.js.map +1 -1
- package/dist/src/safe-slice.d.ts +5 -1
- package/dist/src/safe-slice.d.ts.map +1 -1
- package/dist/src/safe-slice.js +9 -1
- package/dist/src/safe-slice.js.map +1 -1
- package/dist/src/thinking-token-stamp.d.ts +12 -0
- package/dist/src/thinking-token-stamp.d.ts.map +1 -1
- package/dist/src/thinking-token-stamp.js +34 -3
- package/dist/src/thinking-token-stamp.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts +87 -19
- package/dist/src/tool-image-ledger.d.ts.map +1 -1
- package/dist/src/tool-image-ledger.js +135 -32
- package/dist/src/tool-image-ledger.js.map +1 -1
- package/dist/src/tool-presentation.d.ts +9 -0
- package/dist/src/tool-presentation.d.ts.map +1 -1
- package/dist/src/tool-presentation.js +257 -60
- 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 +7 -10
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tool-result-history.d.ts +32 -3
- package/dist/src/tool-result-history.d.ts.map +1 -1
- package/dist/src/tool-result-history.js +106 -19
- package/dist/src/tool-result-history.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts +25 -1
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js +260 -65
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/types/agent.d.ts +17 -5
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +17 -0
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +21 -5
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/inference-log.d.ts +1 -1
- package/dist/src/types/inference-log.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +23 -4
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +95 -6
- package/dist/src/types/trace.d.ts.map +1 -1
- package/dist/src/usage/usage-tracker.d.ts +5 -0
- package/dist/src/usage/usage-tracker.d.ts.map +1 -1
- package/dist/src/usage/usage-tracker.js +35 -8
- package/dist/src/usage/usage-tracker.js.map +1 -1
- package/package.json +6 -4
- package/src/agent.ts +169 -41
- package/src/api/mcp-server-core.ts +1 -1
- package/src/api/server.ts +4 -1
- package/src/api/types.ts +1 -1
- package/src/branch-names.ts +19 -0
- package/src/closest-names.ts +94 -0
- package/src/code-execution/py-runner.ts +200 -76
- package/src/code-execution/runtime-py.ts +49 -3
- package/src/code-execution/tool-definition.ts +28 -4
- package/src/config-checks.ts +48 -0
- package/src/deadline-timer.ts +44 -0
- package/src/error-message.ts +48 -0
- package/src/framework.ts +5352 -1388
- package/src/gate/event-gate.ts +28 -3
- package/src/index.ts +11 -2
- package/src/mcpl/channel-registry.ts +517 -286
- package/src/mcpl/checkpoint-manager.ts +104 -29
- package/src/mcpl/conversation-router.ts +28 -8
- package/src/mcpl/convert-block.ts +97 -0
- package/src/mcpl/errors.ts +28 -0
- package/src/mcpl/hook-orchestrator.ts +84 -77
- package/src/mcpl/inbound-source.ts +156 -0
- package/src/mcpl/index.ts +10 -1
- package/src/mcpl/inference-router.ts +174 -99
- package/src/mcpl/push-coalescer.ts +60 -24
- package/src/mcpl/push-handler.ts +20 -90
- package/src/mcpl/reference-fetcher.ts +71 -26
- package/src/mcpl/references.ts +81 -22
- package/src/mcpl/server-connection.ts +427 -132
- package/src/mcpl/server-registry.ts +15 -4
- package/src/mcpl/skip-reply-wake.ts +73 -0
- package/src/mcpl/transport.ts +120 -18
- package/src/mcpl/types.ts +14 -3
- package/src/mcpl/visible-content.ts +27 -0
- package/src/module-registry.ts +58 -23
- package/src/modules/api/index.ts +1 -1
- package/src/modules/discord/discord-js-client.ts +26 -10
- package/src/modules/discord/index.ts +391 -158
- package/src/modules/discord/types.ts +15 -2
- package/src/modules/health/index.ts +2 -1
- package/src/modules/history/index.ts +410 -120
- package/src/modules/history/semantic.ts +189 -32
- package/src/modules/unknown-tool.ts +16 -0
- package/src/modules/workspace/disk-agreement.ts +51 -3
- package/src/modules/workspace/effects.ts +279 -35
- package/src/modules/workspace/index.ts +810 -260
- package/src/modules/workspace/observe.ts +194 -20
- package/src/modules/workspace/reconcile.ts +619 -64
- package/src/modules/workspace/types.ts +18 -4
- package/src/modules/workspace/watcher.ts +27 -4
- package/src/prose-drafts.ts +481 -0
- package/src/prose-segments.ts +51 -8
- package/src/recovery/offline-branch.ts +4 -1
- package/src/safe-slice.ts +9 -1
- package/src/thinking-token-stamp.ts +34 -3
- package/src/tool-image-ledger.ts +153 -34
- package/src/tool-presentation.ts +224 -40
- package/src/tool-result-guard.ts +7 -8
- package/src/tool-result-history.ts +124 -20
- package/src/tune-out/coordinator.ts +259 -65
- package/src/types/agent.ts +17 -7
- package/src/types/events.ts +17 -0
- package/src/types/framework.ts +21 -5
- package/src/types/inference-log.ts +1 -1
- package/src/types/module.ts +24 -4
- package/src/types/trace.ts +101 -6
- package/src/usage/usage-tracker.ts +32 -8
- package/dist/test/activation-request-sanitize.test.d.ts +0 -2
- package/dist/test/activation-request-sanitize.test.d.ts.map +0 -1
- package/dist/test/activation-request-sanitize.test.js +0 -89
- package/dist/test/activation-request-sanitize.test.js.map +0 -1
- package/dist/test/agent-cache-ttl.test.d.ts +0 -2
- package/dist/test/agent-cache-ttl.test.d.ts.map +0 -1
- package/dist/test/agent-cache-ttl.test.js +0 -41
- package/dist/test/agent-cache-ttl.test.js.map +0 -1
- package/dist/test/agent-runtime-settings.test.d.ts +0 -2
- package/dist/test/agent-runtime-settings.test.d.ts.map +0 -1
- package/dist/test/agent-runtime-settings.test.js +0 -1598
- package/dist/test/agent-runtime-settings.test.js.map +0 -1
- package/dist/test/api-admin-gate.test.d.ts +0 -2
- package/dist/test/api-admin-gate.test.d.ts.map +0 -1
- package/dist/test/api-admin-gate.test.js +0 -116
- package/dist/test/api-admin-gate.test.js.map +0 -1
- package/dist/test/assistant-persist-refusal.test.d.ts +0 -2
- package/dist/test/assistant-persist-refusal.test.d.ts.map +0 -1
- package/dist/test/assistant-persist-refusal.test.js +0 -63
- package/dist/test/assistant-persist-refusal.test.js.map +0 -1
- package/dist/test/batched-wake-locus.test.d.ts +0 -2
- package/dist/test/batched-wake-locus.test.d.ts.map +0 -1
- package/dist/test/batched-wake-locus.test.js +0 -166
- package/dist/test/batched-wake-locus.test.js.map +0 -1
- package/dist/test/busy-agent-scheduler.test.d.ts +0 -2
- package/dist/test/busy-agent-scheduler.test.d.ts.map +0 -1
- package/dist/test/busy-agent-scheduler.test.js +0 -92
- package/dist/test/busy-agent-scheduler.test.js.map +0 -1
- package/dist/test/channel-incoming-targeting.test.d.ts +0 -2
- package/dist/test/channel-incoming-targeting.test.d.ts.map +0 -1
- package/dist/test/channel-incoming-targeting.test.js +0 -81
- package/dist/test/channel-incoming-targeting.test.js.map +0 -1
- package/dist/test/channel-label-history.test.d.ts +0 -2
- package/dist/test/channel-label-history.test.d.ts.map +0 -1
- package/dist/test/channel-label-history.test.js +0 -424
- package/dist/test/channel-label-history.test.js.map +0 -1
- package/dist/test/channel-lifecycle-provenance.test.d.ts +0 -2
- package/dist/test/channel-lifecycle-provenance.test.d.ts.map +0 -1
- package/dist/test/channel-lifecycle-provenance.test.js +0 -47
- package/dist/test/channel-lifecycle-provenance.test.js.map +0 -1
- package/dist/test/channel-registry-routing.test.d.ts +0 -2
- package/dist/test/channel-registry-routing.test.d.ts.map +0 -1
- package/dist/test/channel-registry-routing.test.js +0 -446
- package/dist/test/channel-registry-routing.test.js.map +0 -1
- package/dist/test/channel-registry-typing.test.d.ts +0 -2
- package/dist/test/channel-registry-typing.test.d.ts.map +0 -1
- package/dist/test/channel-registry-typing.test.js +0 -91
- package/dist/test/channel-registry-typing.test.js.map +0 -1
- package/dist/test/channels-changed-respond-first.test.d.ts +0 -2
- package/dist/test/channels-changed-respond-first.test.d.ts.map +0 -1
- package/dist/test/channels-changed-respond-first.test.js +0 -74
- package/dist/test/channels-changed-respond-first.test.js.map +0 -1
- package/dist/test/checkpoint-attribution.test.d.ts +0 -2
- package/dist/test/checkpoint-attribution.test.d.ts.map +0 -1
- package/dist/test/checkpoint-attribution.test.js +0 -200
- package/dist/test/checkpoint-attribution.test.js.map +0 -1
- package/dist/test/code-execution.test.d.ts +0 -11
- package/dist/test/code-execution.test.d.ts.map +0 -1
- package/dist/test/code-execution.test.js +0 -1272
- package/dist/test/code-execution.test.js.map +0 -1
- package/dist/test/component-defaults.test.d.ts +0 -2
- package/dist/test/component-defaults.test.d.ts.map +0 -1
- package/dist/test/component-defaults.test.js +0 -54
- package/dist/test/component-defaults.test.js.map +0 -1
- package/dist/test/conversation-fork-injection-scoping.test.d.ts +0 -2
- package/dist/test/conversation-fork-injection-scoping.test.d.ts.map +0 -1
- package/dist/test/conversation-fork-injection-scoping.test.js +0 -200
- package/dist/test/conversation-fork-injection-scoping.test.js.map +0 -1
- package/dist/test/conversation-router.test.d.ts +0 -2
- package/dist/test/conversation-router.test.d.ts.map +0 -1
- package/dist/test/conversation-router.test.js +0 -174
- package/dist/test/conversation-router.test.js.map +0 -1
- package/dist/test/conversation-routing.test.d.ts +0 -7
- package/dist/test/conversation-routing.test.d.ts.map +0 -1
- package/dist/test/conversation-routing.test.js +0 -621
- package/dist/test/conversation-routing.test.js.map +0 -1
- package/dist/test/deferred-wake-integrity.test.d.ts +0 -29
- package/dist/test/deferred-wake-integrity.test.d.ts.map +0 -1
- package/dist/test/deferred-wake-integrity.test.js +0 -320
- package/dist/test/deferred-wake-integrity.test.js.map +0 -1
- package/dist/test/discord-awareness-outbox.test.d.ts +0 -2
- package/dist/test/discord-awareness-outbox.test.d.ts.map +0 -1
- package/dist/test/discord-awareness-outbox.test.js +0 -371
- package/dist/test/discord-awareness-outbox.test.js.map +0 -1
- package/dist/test/discord-history-delete-window.test.d.ts +0 -2
- package/dist/test/discord-history-delete-window.test.d.ts.map +0 -1
- package/dist/test/discord-history-delete-window.test.js +0 -81
- package/dist/test/discord-history-delete-window.test.js.map +0 -1
- package/dist/test/discord-history-sync.test.d.ts +0 -2
- package/dist/test/discord-history-sync.test.d.ts.map +0 -1
- package/dist/test/discord-history-sync.test.js +0 -56
- package/dist/test/discord-history-sync.test.js.map +0 -1
- package/dist/test/discord-typing-keepalive.test.d.ts +0 -2
- package/dist/test/discord-typing-keepalive.test.d.ts.map +0 -1
- package/dist/test/discord-typing-keepalive.test.js +0 -77
- package/dist/test/discord-typing-keepalive.test.js.map +0 -1
- package/dist/test/ephemeral-settle.test.d.ts +0 -2
- package/dist/test/ephemeral-settle.test.d.ts.map +0 -1
- package/dist/test/ephemeral-settle.test.js +0 -354
- package/dist/test/ephemeral-settle.test.js.map +0 -1
- package/dist/test/event-gate-passthrough.test.d.ts +0 -15
- package/dist/test/event-gate-passthrough.test.d.ts.map +0 -1
- package/dist/test/event-gate-passthrough.test.js +0 -289
- package/dist/test/event-gate-passthrough.test.js.map +0 -1
- package/dist/test/event-gate-policy-mutation.test.d.ts +0 -2
- package/dist/test/event-gate-policy-mutation.test.d.ts.map +0 -1
- package/dist/test/event-gate-policy-mutation.test.js +0 -137
- package/dist/test/event-gate-policy-mutation.test.js.map +0 -1
- package/dist/test/event-gate-rate-limit.test.d.ts +0 -2
- package/dist/test/event-gate-rate-limit.test.d.ts.map +0 -1
- package/dist/test/event-gate-rate-limit.test.js +0 -627
- package/dist/test/event-gate-rate-limit.test.js.map +0 -1
- package/dist/test/event-gate-script.test.d.ts +0 -2
- package/dist/test/event-gate-script.test.d.ts.map +0 -1
- package/dist/test/event-gate-script.test.js +0 -95
- package/dist/test/event-gate-script.test.js.map +0 -1
- package/dist/test/event-gate-selfwake.test.d.ts +0 -15
- package/dist/test/event-gate-selfwake.test.d.ts.map +0 -1
- package/dist/test/event-gate-selfwake.test.js +0 -125
- package/dist/test/event-gate-selfwake.test.js.map +0 -1
- package/dist/test/event-gate-tags.test.d.ts +0 -2
- package/dist/test/event-gate-tags.test.d.ts.map +0 -1
- package/dist/test/event-gate-tags.test.js +0 -76
- package/dist/test/event-gate-tags.test.js.map +0 -1
- package/dist/test/event-gate.test.d.ts +0 -2
- package/dist/test/event-gate.test.d.ts.map +0 -1
- package/dist/test/event-gate.test.js +0 -919
- package/dist/test/event-gate.test.js.map +0 -1
- package/dist/test/explicit-prose-routing.test.d.ts +0 -11
- package/dist/test/explicit-prose-routing.test.d.ts.map +0 -1
- package/dist/test/explicit-prose-routing.test.js +0 -1715
- package/dist/test/explicit-prose-routing.test.js.map +0 -1
- package/dist/test/framework.test.d.ts +0 -5
- package/dist/test/framework.test.d.ts.map +0 -1
- package/dist/test/framework.test.js +0 -1048
- package/dist/test/framework.test.js.map +0 -1
- package/dist/test/gather-context-timeout.test.d.ts +0 -2
- package/dist/test/gather-context-timeout.test.d.ts.map +0 -1
- package/dist/test/gather-context-timeout.test.js +0 -120
- package/dist/test/gather-context-timeout.test.js.map +0 -1
- package/dist/test/health-snapshot.test.d.ts +0 -2
- package/dist/test/health-snapshot.test.d.ts.map +0 -1
- package/dist/test/health-snapshot.test.js +0 -74
- package/dist/test/health-snapshot.test.js.map +0 -1
- package/dist/test/helpers/coalescing-fixture.d.ts +0 -74
- package/dist/test/helpers/coalescing-fixture.d.ts.map +0 -1
- package/dist/test/helpers/coalescing-fixture.js +0 -152
- package/dist/test/helpers/coalescing-fixture.js.map +0 -1
- package/dist/test/helpers/coalescing-kill-child.d.ts +0 -2
- package/dist/test/helpers/coalescing-kill-child.d.ts.map +0 -1
- package/dist/test/helpers/coalescing-kill-child.js +0 -24
- package/dist/test/helpers/coalescing-kill-child.js.map +0 -1
- package/dist/test/helpers/mock-membrane.d.ts +0 -53
- package/dist/test/helpers/mock-membrane.d.ts.map +0 -1
- package/dist/test/helpers/mock-membrane.js +0 -168
- package/dist/test/helpers/mock-membrane.js.map +0 -1
- package/dist/test/helpers/pytc-stop-rows.d.ts +0 -11
- package/dist/test/helpers/pytc-stop-rows.d.ts.map +0 -1
- package/dist/test/helpers/pytc-stop-rows.js +0 -143
- package/dist/test/helpers/pytc-stop-rows.js.map +0 -1
- package/dist/test/helpers/quiesce-crash-child.d.ts +0 -2
- package/dist/test/helpers/quiesce-crash-child.d.ts.map +0 -1
- package/dist/test/helpers/quiesce-crash-child.js +0 -156
- package/dist/test/helpers/quiesce-crash-child.js.map +0 -1
- package/dist/test/hide-then-turn.test.d.ts +0 -2
- package/dist/test/hide-then-turn.test.d.ts.map +0 -1
- package/dist/test/hide-then-turn.test.js +0 -101
- package/dist/test/hide-then-turn.test.js.map +0 -1
- package/dist/test/history-module-overview.test.d.ts +0 -2
- package/dist/test/history-module-overview.test.d.ts.map +0 -1
- package/dist/test/history-module-overview.test.js +0 -711
- package/dist/test/history-module-overview.test.js.map +0 -1
- package/dist/test/history-module-realstore.test.d.ts +0 -2
- package/dist/test/history-module-realstore.test.d.ts.map +0 -1
- package/dist/test/history-module-realstore.test.js +0 -363
- package/dist/test/history-module-realstore.test.js.map +0 -1
- package/dist/test/history-module-semantic.test.d.ts +0 -2
- package/dist/test/history-module-semantic.test.d.ts.map +0 -1
- package/dist/test/history-module-semantic.test.js +0 -213
- package/dist/test/history-module-semantic.test.js.map +0 -1
- package/dist/test/history-module-ux.test.d.ts +0 -2
- package/dist/test/history-module-ux.test.d.ts.map +0 -1
- package/dist/test/history-module-ux.test.js +0 -304
- package/dist/test/history-module-ux.test.js.map +0 -1
- package/dist/test/history-module.test.d.ts +0 -2
- package/dist/test/history-module.test.d.ts.map +0 -1
- package/dist/test/history-module.test.js +0 -619
- package/dist/test/history-module.test.js.map +0 -1
- package/dist/test/history-semantic-review-findings.test.d.ts +0 -2
- package/dist/test/history-semantic-review-findings.test.d.ts.map +0 -1
- package/dist/test/history-semantic-review-findings.test.js +0 -338
- package/dist/test/history-semantic-review-findings.test.js.map +0 -1
- package/dist/test/history-semantic-sync-converges.test.d.ts +0 -2
- package/dist/test/history-semantic-sync-converges.test.d.ts.map +0 -1
- package/dist/test/history-semantic-sync-converges.test.js +0 -109
- package/dist/test/history-semantic-sync-converges.test.js.map +0 -1
- package/dist/test/host-quiesce.test.d.ts +0 -2
- package/dist/test/host-quiesce.test.d.ts.map +0 -1
- package/dist/test/host-quiesce.test.js +0 -988
- package/dist/test/host-quiesce.test.js.map +0 -1
- package/dist/test/inference-exhaustion-rewind.test.d.ts +0 -2
- package/dist/test/inference-exhaustion-rewind.test.d.ts.map +0 -1
- package/dist/test/inference-exhaustion-rewind.test.js +0 -387
- package/dist/test/inference-exhaustion-rewind.test.js.map +0 -1
- package/dist/test/inference-failure-bounds.test.d.ts +0 -2
- package/dist/test/inference-failure-bounds.test.d.ts.map +0 -1
- package/dist/test/inference-failure-bounds.test.js +0 -1202
- package/dist/test/inference-failure-bounds.test.js.map +0 -1
- package/dist/test/inference-failure-observability.test.d.ts +0 -2
- package/dist/test/inference-failure-observability.test.d.ts.map +0 -1
- package/dist/test/inference-failure-observability.test.js +0 -84
- package/dist/test/inference-failure-observability.test.js.map +0 -1
- package/dist/test/journal-tool.test.d.ts +0 -2
- package/dist/test/journal-tool.test.d.ts.map +0 -1
- package/dist/test/journal-tool.test.js +0 -33
- package/dist/test/journal-tool.test.js.map +0 -1
- package/dist/test/kv-unified-open-flight-retry.test.d.ts +0 -2
- package/dist/test/kv-unified-open-flight-retry.test.d.ts.map +0 -1
- package/dist/test/kv-unified-open-flight-retry.test.js +0 -189
- package/dist/test/kv-unified-open-flight-retry.test.js.map +0 -1
- package/dist/test/kv-unified-wiring.test.d.ts +0 -2
- package/dist/test/kv-unified-wiring.test.d.ts.map +0 -1
- package/dist/test/kv-unified-wiring.test.js +0 -95
- package/dist/test/kv-unified-wiring.test.js.map +0 -1
- package/dist/test/late-events-after-stop.test.d.ts +0 -2
- package/dist/test/late-events-after-stop.test.d.ts.map +0 -1
- package/dist/test/late-events-after-stop.test.js +0 -122
- package/dist/test/late-events-after-stop.test.js.map +0 -1
- package/dist/test/liveness-watchdog.test.d.ts +0 -2
- package/dist/test/liveness-watchdog.test.d.ts.map +0 -1
- package/dist/test/liveness-watchdog.test.js +0 -94
- package/dist/test/liveness-watchdog.test.js.map +0 -1
- package/dist/test/machine-close-provenance.test.d.ts +0 -2
- package/dist/test/machine-close-provenance.test.d.ts.map +0 -1
- package/dist/test/machine-close-provenance.test.js +0 -116
- package/dist/test/machine-close-provenance.test.js.map +0 -1
- package/dist/test/maintenance-timer.test.d.ts +0 -2
- package/dist/test/maintenance-timer.test.d.ts.map +0 -1
- package/dist/test/maintenance-timer.test.js +0 -1827
- package/dist/test/maintenance-timer.test.js.map +0 -1
- package/dist/test/mcp-server-bin.test.d.ts +0 -2
- package/dist/test/mcp-server-bin.test.d.ts.map +0 -1
- package/dist/test/mcp-server-bin.test.js +0 -142
- package/dist/test/mcp-server-bin.test.js.map +0 -1
- package/dist/test/mcpl-access-provider.test.d.ts +0 -2
- package/dist/test/mcpl-access-provider.test.d.ts.map +0 -1
- package/dist/test/mcpl-access-provider.test.js +0 -20
- package/dist/test/mcpl-access-provider.test.js.map +0 -1
- package/dist/test/mcpl-awareness-barrier.test.d.ts +0 -2
- package/dist/test/mcpl-awareness-barrier.test.d.ts.map +0 -1
- package/dist/test/mcpl-awareness-barrier.test.js +0 -769
- package/dist/test/mcpl-awareness-barrier.test.js.map +0 -1
- package/dist/test/mcpl-capability-grant.test.d.ts +0 -10
- package/dist/test/mcpl-capability-grant.test.d.ts.map +0 -1
- package/dist/test/mcpl-capability-grant.test.js +0 -111
- package/dist/test/mcpl-capability-grant.test.js.map +0 -1
- package/dist/test/mcpl-capability-scoping.test.d.ts +0 -2
- package/dist/test/mcpl-capability-scoping.test.d.ts.map +0 -1
- package/dist/test/mcpl-capability-scoping.test.js +0 -266
- package/dist/test/mcpl-capability-scoping.test.js.map +0 -1
- package/dist/test/mcpl-child-env.test.d.ts +0 -2
- package/dist/test/mcpl-child-env.test.d.ts.map +0 -1
- package/dist/test/mcpl-child-env.test.js +0 -158
- package/dist/test/mcpl-child-env.test.js.map +0 -1
- package/dist/test/mcpl-coalesced-content-parity.test.d.ts +0 -2
- package/dist/test/mcpl-coalesced-content-parity.test.d.ts.map +0 -1
- package/dist/test/mcpl-coalesced-content-parity.test.js +0 -532
- package/dist/test/mcpl-coalesced-content-parity.test.js.map +0 -1
- package/dist/test/mcpl-coalescing.test.d.ts +0 -2
- package/dist/test/mcpl-coalescing.test.d.ts.map +0 -1
- package/dist/test/mcpl-coalescing.test.js +0 -1125
- package/dist/test/mcpl-coalescing.test.js.map +0 -1
- package/dist/test/mcpl-config-diagnostics.test.d.ts +0 -2
- package/dist/test/mcpl-config-diagnostics.test.d.ts.map +0 -1
- package/dist/test/mcpl-config-diagnostics.test.js +0 -452
- package/dist/test/mcpl-config-diagnostics.test.js.map +0 -1
- package/dist/test/mcpl-empty-content.test.d.ts +0 -2
- package/dist/test/mcpl-empty-content.test.d.ts.map +0 -1
- package/dist/test/mcpl-empty-content.test.js +0 -368
- package/dist/test/mcpl-empty-content.test.js.map +0 -1
- package/dist/test/mcpl-gate-roundtrip.test.d.ts +0 -2
- package/dist/test/mcpl-gate-roundtrip.test.d.ts.map +0 -1
- package/dist/test/mcpl-gate-roundtrip.test.js +0 -285
- package/dist/test/mcpl-gate-roundtrip.test.js.map +0 -1
- package/dist/test/mcpl-list-status.test.d.ts +0 -2
- package/dist/test/mcpl-list-status.test.d.ts.map +0 -1
- package/dist/test/mcpl-list-status.test.js +0 -82
- package/dist/test/mcpl-list-status.test.js.map +0 -1
- package/dist/test/mcpl-manifest-changed.test.d.ts +0 -2
- package/dist/test/mcpl-manifest-changed.test.d.ts.map +0 -1
- package/dist/test/mcpl-manifest-changed.test.js +0 -178
- package/dist/test/mcpl-manifest-changed.test.js.map +0 -1
- package/dist/test/mcpl-push-convert.test.d.ts +0 -2
- package/dist/test/mcpl-push-convert.test.d.ts.map +0 -1
- package/dist/test/mcpl-push-convert.test.js +0 -42
- package/dist/test/mcpl-push-convert.test.js.map +0 -1
- package/dist/test/mcpl-reconnect-events.test.d.ts +0 -2
- package/dist/test/mcpl-reconnect-events.test.d.ts.map +0 -1
- package/dist/test/mcpl-reconnect-events.test.js +0 -144
- package/dist/test/mcpl-reconnect-events.test.js.map +0 -1
- package/dist/test/mcpl-reconnect-reregistration.test.d.ts +0 -2
- package/dist/test/mcpl-reconnect-reregistration.test.d.ts.map +0 -1
- package/dist/test/mcpl-reconnect-reregistration.test.js +0 -238
- package/dist/test/mcpl-reconnect-reregistration.test.js.map +0 -1
- package/dist/test/mcpl-reference-fetcher.test.d.ts +0 -2
- package/dist/test/mcpl-reference-fetcher.test.d.ts.map +0 -1
- package/dist/test/mcpl-reference-fetcher.test.js +0 -427
- package/dist/test/mcpl-reference-fetcher.test.js.map +0 -1
- package/dist/test/mcpl-reference-fields.test.d.ts +0 -2
- package/dist/test/mcpl-reference-fields.test.d.ts.map +0 -1
- package/dist/test/mcpl-reference-fields.test.js +0 -149
- package/dist/test/mcpl-reference-fields.test.js.map +0 -1
- package/dist/test/mcpl-rejection-log-lines.test.d.ts +0 -2
- package/dist/test/mcpl-rejection-log-lines.test.d.ts.map +0 -1
- package/dist/test/mcpl-rejection-log-lines.test.js +0 -349
- package/dist/test/mcpl-rejection-log-lines.test.js.map +0 -1
- package/dist/test/mcpl-request-timeout.test.d.ts +0 -2
- package/dist/test/mcpl-request-timeout.test.d.ts.map +0 -1
- package/dist/test/mcpl-request-timeout.test.js +0 -138
- package/dist/test/mcpl-request-timeout.test.js.map +0 -1
- package/dist/test/mcpl-runtime-lifecycle.test.d.ts +0 -7
- package/dist/test/mcpl-runtime-lifecycle.test.d.ts.map +0 -1
- package/dist/test/mcpl-runtime-lifecycle.test.js +0 -142
- package/dist/test/mcpl-runtime-lifecycle.test.js.map +0 -1
- package/dist/test/mcpl-stderr-tail.test.d.ts +0 -2
- package/dist/test/mcpl-stderr-tail.test.d.ts.map +0 -1
- package/dist/test/mcpl-stderr-tail.test.js +0 -210
- package/dist/test/mcpl-stderr-tail.test.js.map +0 -1
- package/dist/test/mcpl-tool-class-listing.test.d.ts +0 -2
- package/dist/test/mcpl-tool-class-listing.test.d.ts.map +0 -1
- package/dist/test/mcpl-tool-class-listing.test.js +0 -147
- package/dist/test/mcpl-tool-class-listing.test.js.map +0 -1
- package/dist/test/mcpl-tool-classes.test.d.ts +0 -7
- package/dist/test/mcpl-tool-classes.test.d.ts.map +0 -1
- package/dist/test/mcpl-tool-classes.test.js +0 -80
- package/dist/test/mcpl-tool-classes.test.js.map +0 -1
- package/dist/test/mcpl-tool-lifecycle-e2e.test.d.ts +0 -2
- package/dist/test/mcpl-tool-lifecycle-e2e.test.d.ts.map +0 -1
- package/dist/test/mcpl-tool-lifecycle-e2e.test.js +0 -237
- package/dist/test/mcpl-tool-lifecycle-e2e.test.js.map +0 -1
- package/dist/test/mcpl-tool-lifecycle-emitter.test.d.ts +0 -11
- package/dist/test/mcpl-tool-lifecycle-emitter.test.d.ts.map +0 -1
- package/dist/test/mcpl-tool-lifecycle-emitter.test.js +0 -412
- package/dist/test/mcpl-tool-lifecycle-emitter.test.js.map +0 -1
- package/dist/test/mcpl-tool-lifecycle-script.test.d.ts +0 -2
- package/dist/test/mcpl-tool-lifecycle-script.test.d.ts.map +0 -1
- package/dist/test/mcpl-tool-lifecycle-script.test.js +0 -288
- package/dist/test/mcpl-tool-lifecycle-script.test.js.map +0 -1
- package/dist/test/mcpl-tool-lifecycle.test.d.ts +0 -11
- package/dist/test/mcpl-tool-lifecycle.test.d.ts.map +0 -1
- package/dist/test/mcpl-tool-lifecycle.test.js +0 -270
- package/dist/test/mcpl-tool-lifecycle.test.js.map +0 -1
- package/dist/test/mcpl-transport-close.test.d.ts +0 -2
- package/dist/test/mcpl-transport-close.test.d.ts.map +0 -1
- package/dist/test/mcpl-transport-close.test.js +0 -373
- package/dist/test/mcpl-transport-close.test.js.map +0 -1
- package/dist/test/mcpl-transport-spawn.test.d.ts +0 -2
- package/dist/test/mcpl-transport-spawn.test.d.ts.map +0 -1
- package/dist/test/mcpl-transport-spawn.test.js +0 -58
- package/dist/test/mcpl-transport-spawn.test.js.map +0 -1
- package/dist/test/mcpl-ws-transport.test.d.ts +0 -2
- package/dist/test/mcpl-ws-transport.test.d.ts.map +0 -1
- package/dist/test/mcpl-ws-transport.test.js +0 -259
- package/dist/test/mcpl-ws-transport.test.js.map +0 -1
- package/dist/test/module-context-integration.test.d.ts +0 -18
- package/dist/test/module-context-integration.test.d.ts.map +0 -1
- package/dist/test/module-context-integration.test.js +0 -181
- package/dist/test/module-context-integration.test.js.map +0 -1
- package/dist/test/offline-recovery-branch.test.d.ts +0 -2
- package/dist/test/offline-recovery-branch.test.d.ts.map +0 -1
- package/dist/test/offline-recovery-branch.test.js +0 -570
- package/dist/test/offline-recovery-branch.test.js.map +0 -1
- package/dist/test/operator-surgery.test.d.ts +0 -2
- package/dist/test/operator-surgery.test.d.ts.map +0 -1
- package/dist/test/operator-surgery.test.js +0 -595
- package/dist/test/operator-surgery.test.js.map +0 -1
- package/dist/test/ops-alert.test.d.ts +0 -2
- package/dist/test/ops-alert.test.d.ts.map +0 -1
- package/dist/test/ops-alert.test.js +0 -153
- package/dist/test/ops-alert.test.js.map +0 -1
- package/dist/test/overbudget-drain-breaker.test.d.ts +0 -2
- package/dist/test/overbudget-drain-breaker.test.d.ts.map +0 -1
- package/dist/test/overbudget-drain-breaker.test.js +0 -198
- package/dist/test/overbudget-drain-breaker.test.js.map +0 -1
- package/dist/test/pack-installs-alone.test.d.ts +0 -2
- package/dist/test/pack-installs-alone.test.d.ts.map +0 -1
- package/dist/test/pack-installs-alone.test.js +0 -284
- package/dist/test/pack-installs-alone.test.js.map +0 -1
- package/dist/test/per-agent-delivery.test.d.ts +0 -2
- package/dist/test/per-agent-delivery.test.d.ts.map +0 -1
- package/dist/test/per-agent-delivery.test.js +0 -108
- package/dist/test/per-agent-delivery.test.js.map +0 -1
- package/dist/test/physical-window-restart.test.d.ts +0 -16
- package/dist/test/physical-window-restart.test.d.ts.map +0 -1
- package/dist/test/physical-window-restart.test.js +0 -487
- package/dist/test/physical-window-restart.test.js.map +0 -1
- package/dist/test/placed-reaction-baseline.test.d.ts +0 -2
- package/dist/test/placed-reaction-baseline.test.d.ts.map +0 -1
- package/dist/test/placed-reaction-baseline.test.js +0 -312
- package/dist/test/placed-reaction-baseline.test.js.map +0 -1
- package/dist/test/present-while-acting.test.d.ts +0 -19
- package/dist/test/present-while-acting.test.d.ts.map +0 -1
- package/dist/test/present-while-acting.test.js +0 -1649
- package/dist/test/present-while-acting.test.js.map +0 -1
- package/dist/test/prose-segments.test.d.ts +0 -2
- package/dist/test/prose-segments.test.d.ts.map +0 -1
- package/dist/test/prose-segments.test.js +0 -52
- package/dist/test/prose-segments.test.js.map +0 -1
- package/dist/test/prose-stream-router.test.d.ts +0 -2
- package/dist/test/prose-stream-router.test.d.ts.map +0 -1
- package/dist/test/prose-stream-router.test.js +0 -171
- package/dist/test/prose-stream-router.test.js.map +0 -1
- package/dist/test/provider-acceleration-cooldown.test.d.ts +0 -2
- package/dist/test/provider-acceleration-cooldown.test.d.ts.map +0 -1
- package/dist/test/provider-acceleration-cooldown.test.js +0 -435
- package/dist/test/provider-acceleration-cooldown.test.js.map +0 -1
- package/dist/test/provider-waits.test.d.ts +0 -2
- package/dist/test/provider-waits.test.d.ts.map +0 -1
- package/dist/test/provider-waits.test.js +0 -2259
- package/dist/test/provider-waits.test.js.map +0 -1
- package/dist/test/puppet-tool-call.test.d.ts +0 -2
- package/dist/test/puppet-tool-call.test.d.ts.map +0 -1
- package/dist/test/puppet-tool-call.test.js +0 -226
- package/dist/test/puppet-tool-call.test.js.map +0 -1
- package/dist/test/puppet-turn-reservation.test.d.ts +0 -2
- package/dist/test/puppet-turn-reservation.test.d.ts.map +0 -1
- package/dist/test/puppet-turn-reservation.test.js +0 -139
- package/dist/test/puppet-turn-reservation.test.js.map +0 -1
- package/dist/test/reaction-baseline-platform.test.d.ts +0 -2
- package/dist/test/reaction-baseline-platform.test.d.ts.map +0 -1
- package/dist/test/reaction-baseline-platform.test.js +0 -124
- package/dist/test/reaction-baseline-platform.test.js.map +0 -1
- package/dist/test/record-journal.test.d.ts +0 -6
- package/dist/test/record-journal.test.d.ts.map +0 -1
- package/dist/test/record-journal.test.js +0 -269
- package/dist/test/record-journal.test.js.map +0 -1
- package/dist/test/refusal-reaction-baseline.test.d.ts +0 -2
- package/dist/test/refusal-reaction-baseline.test.d.ts.map +0 -1
- package/dist/test/refusal-reaction-baseline.test.js +0 -81
- package/dist/test/refusal-reaction-baseline.test.js.map +0 -1
- package/dist/test/refusal-rewind.test.d.ts +0 -2
- package/dist/test/refusal-rewind.test.d.ts.map +0 -1
- package/dist/test/refusal-rewind.test.js +0 -117
- package/dist/test/refusal-rewind.test.js.map +0 -1
- package/dist/test/refusal-single-call.test.d.ts +0 -2
- package/dist/test/refusal-single-call.test.d.ts.map +0 -1
- package/dist/test/refusal-single-call.test.js +0 -177
- package/dist/test/refusal-single-call.test.js.map +0 -1
- package/dist/test/release-bump.test.d.ts +0 -2
- package/dist/test/release-bump.test.d.ts.map +0 -1
- package/dist/test/release-bump.test.js +0 -248
- package/dist/test/release-bump.test.js.map +0 -1
- package/dist/test/release-changelog.test.d.ts +0 -2
- package/dist/test/release-changelog.test.d.ts.map +0 -1
- package/dist/test/release-changelog.test.js +0 -159
- package/dist/test/release-changelog.test.js.map +0 -1
- package/dist/test/release-holds.test.d.ts +0 -2
- package/dist/test/release-holds.test.d.ts.map +0 -1
- package/dist/test/release-holds.test.js +0 -456
- package/dist/test/release-holds.test.js.map +0 -1
- package/dist/test/same-round-think-policy.test.d.ts +0 -2
- package/dist/test/same-round-think-policy.test.d.ts.map +0 -1
- package/dist/test/same-round-think-policy.test.js +0 -853
- package/dist/test/same-round-think-policy.test.js.map +0 -1
- package/dist/test/save-recent-image.test.d.ts +0 -26
- package/dist/test/save-recent-image.test.d.ts.map +0 -1
- package/dist/test/save-recent-image.test.js +0 -974
- package/dist/test/save-recent-image.test.js.map +0 -1
- package/dist/test/shutdown-errors.test.d.ts +0 -2
- package/dist/test/shutdown-errors.test.d.ts.map +0 -1
- package/dist/test/shutdown-errors.test.js +0 -662
- package/dist/test/shutdown-errors.test.js.map +0 -1
- package/dist/test/silent-heartbeat-rows.test.d.ts +0 -2
- package/dist/test/silent-heartbeat-rows.test.d.ts.map +0 -1
- package/dist/test/silent-heartbeat-rows.test.js +0 -451
- package/dist/test/silent-heartbeat-rows.test.js.map +0 -1
- package/dist/test/silent-heartbeat.test.d.ts +0 -2
- package/dist/test/silent-heartbeat.test.d.ts.map +0 -1
- package/dist/test/silent-heartbeat.test.js +0 -165
- package/dist/test/silent-heartbeat.test.js.map +0 -1
- package/dist/test/state-scaling-e2e.test.d.ts +0 -22
- package/dist/test/state-scaling-e2e.test.d.ts.map +0 -1
- package/dist/test/state-scaling-e2e.test.js +0 -206
- package/dist/test/state-scaling-e2e.test.js.map +0 -1
- package/dist/test/state-scaling.test.d.ts +0 -12
- package/dist/test/state-scaling.test.d.ts.map +0 -1
- package/dist/test/state-scaling.test.js +0 -251
- package/dist/test/state-scaling.test.js.map +0 -1
- package/dist/test/stop-with-host-operations.test.d.ts +0 -20
- package/dist/test/stop-with-host-operations.test.d.ts.map +0 -1
- package/dist/test/stop-with-host-operations.test.js +0 -1174
- package/dist/test/stop-with-host-operations.test.js.map +0 -1
- package/dist/test/stop-with-work-in-flight.test.d.ts +0 -23
- package/dist/test/stop-with-work-in-flight.test.d.ts.map +0 -1
- package/dist/test/stop-with-work-in-flight.test.js +0 -784
- package/dist/test/stop-with-work-in-flight.test.js.map +0 -1
- package/dist/test/surgery-marks-receipt.test.d.ts +0 -2
- package/dist/test/surgery-marks-receipt.test.d.ts.map +0 -1
- package/dist/test/surgery-marks-receipt.test.js +0 -540
- package/dist/test/surgery-marks-receipt.test.js.map +0 -1
- package/dist/test/thinking-token-stamp.test.d.ts +0 -12
- package/dist/test/thinking-token-stamp.test.d.ts.map +0 -1
- package/dist/test/thinking-token-stamp.test.js +0 -129
- package/dist/test/thinking-token-stamp.test.js.map +0 -1
- package/dist/test/timezone.test.d.ts +0 -2
- package/dist/test/timezone.test.d.ts.map +0 -1
- package/dist/test/timezone.test.js +0 -18
- package/dist/test/timezone.test.js.map +0 -1
- package/dist/test/tool-batch-hook.test.d.ts +0 -8
- package/dist/test/tool-batch-hook.test.d.ts.map +0 -1
- package/dist/test/tool-batch-hook.test.js +0 -275
- package/dist/test/tool-batch-hook.test.js.map +0 -1
- package/dist/test/tool-policy.test.d.ts +0 -2
- package/dist/test/tool-policy.test.d.ts.map +0 -1
- package/dist/test/tool-policy.test.js +0 -51
- package/dist/test/tool-policy.test.js.map +0 -1
- package/dist/test/tool-presentation.test.d.ts +0 -2
- package/dist/test/tool-presentation.test.d.ts.map +0 -1
- package/dist/test/tool-presentation.test.js +0 -268
- package/dist/test/tool-presentation.test.js.map +0 -1
- package/dist/test/tool-result-content.test.d.ts +0 -2
- package/dist/test/tool-result-content.test.d.ts.map +0 -1
- package/dist/test/tool-result-content.test.js +0 -37
- package/dist/test/tool-result-content.test.js.map +0 -1
- package/dist/test/tool-result-guard.test.d.ts +0 -2
- package/dist/test/tool-result-guard.test.d.ts.map +0 -1
- package/dist/test/tool-result-guard.test.js +0 -3729
- package/dist/test/tool-result-guard.test.js.map +0 -1
- package/dist/test/tool-result-history.test.d.ts +0 -7
- package/dist/test/tool-result-history.test.d.ts.map +0 -1
- package/dist/test/tool-result-history.test.js +0 -156
- package/dist/test/tool-result-history.test.js.map +0 -1
- package/dist/test/tool-result-spill.test.d.ts +0 -13
- package/dist/test/tool-result-spill.test.d.ts.map +0 -1
- package/dist/test/tool-result-spill.test.js +0 -586
- package/dist/test/tool-result-spill.test.js.map +0 -1
- package/dist/test/tool-wrapper-prose-guard-integration.test.d.ts +0 -2
- package/dist/test/tool-wrapper-prose-guard-integration.test.d.ts.map +0 -1
- package/dist/test/tool-wrapper-prose-guard-integration.test.js +0 -485
- package/dist/test/tool-wrapper-prose-guard-integration.test.js.map +0 -1
- package/dist/test/tool-wrapper-prose-guard.test.d.ts +0 -2
- package/dist/test/tool-wrapper-prose-guard.test.d.ts.map +0 -1
- package/dist/test/tool-wrapper-prose-guard.test.js +0 -34
- package/dist/test/tool-wrapper-prose-guard.test.js.map +0 -1
- package/dist/test/tools-observe-parser-conformance.test.d.ts +0 -2
- package/dist/test/tools-observe-parser-conformance.test.d.ts.map +0 -1
- package/dist/test/tools-observe-parser-conformance.test.js +0 -129
- package/dist/test/tools-observe-parser-conformance.test.js.map +0 -1
- package/dist/test/trunk-channel-routing.test.d.ts +0 -19
- package/dist/test/trunk-channel-routing.test.d.ts.map +0 -1
- package/dist/test/trunk-channel-routing.test.js +0 -652
- package/dist/test/trunk-channel-routing.test.js.map +0 -1
- package/dist/test/tune-out-e2e.test.d.ts +0 -2
- package/dist/test/tune-out-e2e.test.d.ts.map +0 -1
- package/dist/test/tune-out-e2e.test.js +0 -142
- package/dist/test/tune-out-e2e.test.js.map +0 -1
- package/dist/test/tune-out-gate-composition.test.d.ts +0 -2
- package/dist/test/tune-out-gate-composition.test.d.ts.map +0 -1
- package/dist/test/tune-out-gate-composition.test.js +0 -221
- package/dist/test/tune-out-gate-composition.test.js.map +0 -1
- package/dist/test/tune-out-lifecycle.test.d.ts +0 -2
- package/dist/test/tune-out-lifecycle.test.d.ts.map +0 -1
- package/dist/test/tune-out-lifecycle.test.js +0 -121
- package/dist/test/tune-out-lifecycle.test.js.map +0 -1
- package/dist/test/turn-trigger-provenance.test.d.ts +0 -2
- package/dist/test/turn-trigger-provenance.test.d.ts.map +0 -1
- package/dist/test/turn-trigger-provenance.test.js +0 -137
- package/dist/test/turn-trigger-provenance.test.js.map +0 -1
- package/dist/test/unconvertible-tool-result.test.d.ts +0 -2
- package/dist/test/unconvertible-tool-result.test.d.ts.map +0 -1
- package/dist/test/unconvertible-tool-result.test.js +0 -358
- package/dist/test/unconvertible-tool-result.test.js.map +0 -1
- package/dist/test/unsent-compiles.test.d.ts +0 -2
- package/dist/test/unsent-compiles.test.d.ts.map +0 -1
- package/dist/test/unsent-compiles.test.js +0 -139
- package/dist/test/unsent-compiles.test.js.map +0 -1
- package/dist/test/usage-accounting.test.d.ts +0 -2
- package/dist/test/usage-accounting.test.d.ts.map +0 -1
- package/dist/test/usage-accounting.test.js +0 -13
- package/dist/test/usage-accounting.test.js.map +0 -1
- package/dist/test/usage-tracker.test.d.ts +0 -2
- package/dist/test/usage-tracker.test.d.ts.map +0 -1
- package/dist/test/usage-tracker.test.js +0 -129
- package/dist/test/usage-tracker.test.js.map +0 -1
- package/dist/test/utils-surface.test.d.ts +0 -2
- package/dist/test/utils-surface.test.d.ts.map +0 -1
- package/dist/test/utils-surface.test.js +0 -145
- package/dist/test/utils-surface.test.js.map +0 -1
- package/dist/test/workspace-branch-continuation.test.d.ts +0 -15
- package/dist/test/workspace-branch-continuation.test.d.ts.map +0 -1
- package/dist/test/workspace-branch-continuation.test.js +0 -183
- package/dist/test/workspace-branch-continuation.test.js.map +0 -1
- package/dist/test/workspace-materialize-freshness.test.d.ts +0 -16
- package/dist/test/workspace-materialize-freshness.test.d.ts.map +0 -1
- package/dist/test/workspace-materialize-freshness.test.js +0 -252
- package/dist/test/workspace-materialize-freshness.test.js.map +0 -1
- package/dist/test/workspace-path-containment.test.d.ts +0 -19
- package/dist/test/workspace-path-containment.test.d.ts.map +0 -1
- package/dist/test/workspace-path-containment.test.js +0 -91
- package/dist/test/workspace-path-containment.test.js.map +0 -1
- package/dist/test/workspace-read-file-from-disk.test.d.ts +0 -17
- package/dist/test/workspace-read-file-from-disk.test.d.ts.map +0 -1
- package/dist/test/workspace-read-file-from-disk.test.js +0 -174
- package/dist/test/workspace-read-file-from-disk.test.js.map +0 -1
- package/dist/test/workspace-read-image.test.d.ts +0 -2
- package/dist/test/workspace-read-image.test.d.ts.map +0 -1
- package/dist/test/workspace-read-image.test.js +0 -597
- package/dist/test/workspace-read-image.test.js.map +0 -1
- package/dist/test/workspace-read-text.test.d.ts +0 -2
- package/dist/test/workspace-read-text.test.d.ts.map +0 -1
- package/dist/test/workspace-read-text.test.js +0 -101
- package/dist/test/workspace-read-text.test.js.map +0 -1
- package/dist/test/workspace-restore-order.test.d.ts +0 -16
- package/dist/test/workspace-restore-order.test.d.ts.map +0 -1
- package/dist/test/workspace-restore-order.test.js +0 -140
- package/dist/test/workspace-restore-order.test.js.map +0 -1
- package/dist/test/workspace-three-way.test.d.ts +0 -12
- package/dist/test/workspace-three-way.test.d.ts.map +0 -1
- package/dist/test/workspace-three-way.test.js +0 -4094
- package/dist/test/workspace-three-way.test.js.map +0 -1
- package/dist/test/workspace-watcher.test.d.ts +0 -2
- package/dist/test/workspace-watcher.test.d.ts.map +0 -1
- package/dist/test/workspace-watcher.test.js +0 -281
- package/dist/test/workspace-watcher.test.js.map +0 -1
- package/dist/test/xml-round-persist.test.d.ts +0 -19
- package/dist/test/xml-round-persist.test.d.ts.map +0 -1
- package/dist/test/xml-round-persist.test.js +0 -235
- package/dist/test/xml-round-persist.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -32,6 +32,93 @@ function wildcardMatch(pattern, name) {
|
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
34
|
// ============================================================================
|
|
35
|
+
// Results
|
|
36
|
+
// ============================================================================
|
|
37
|
+
/**
|
|
38
|
+
* The inference/request result for a completed inference, the same for both
|
|
39
|
+
* modes: the response's text, the model that served it, why it stopped, and
|
|
40
|
+
* its usage.
|
|
41
|
+
*
|
|
42
|
+
* A response MCPL can't report as a completion throws, and is answered with
|
|
43
|
+
* the error: one the provider ended with an error, one where the model wrote a
|
|
44
|
+
* tool call, since inference/request offers the model none, and one with a
|
|
45
|
+
* stop reason FinishReason has no value for (see finishReasonFor).
|
|
46
|
+
*/
|
|
47
|
+
function resultFrom(response, routedModel) {
|
|
48
|
+
// A provider can end an inference with finish_reason 'error' and no error
|
|
49
|
+
// object. membrane 0.5.87's OpenAI-style adapters fail a stream on a frame
|
|
50
|
+
// that carries one, as OpenRouter's mid-stream error does, but pass the token
|
|
51
|
+
// alone through, and membrane, having no stop reason for it, normalizes it
|
|
52
|
+
// to end_turn and keeps it as providerReason.
|
|
53
|
+
if (response.details.stop.providerReason === 'error') {
|
|
54
|
+
throw new Error("The provider ended the inference with an error (finish_reason 'error')");
|
|
55
|
+
}
|
|
56
|
+
// membrane's yielding stream lists a native tool call in toolCalls only
|
|
57
|
+
// when the stop was tool_use, so a tool_use block cut off by another stop is
|
|
58
|
+
// only in the content. membrane's complete() lists every tool_use block in
|
|
59
|
+
// toolCalls, whatever the stop.
|
|
60
|
+
const toolUses = response.content.filter((b) => b.type === 'tool_use');
|
|
61
|
+
if (response.toolCalls.length > 0 || toolUses.length > 0) {
|
|
62
|
+
throw toolCallError(response.toolCalls.length > 0 ? response.toolCalls : toolUses);
|
|
63
|
+
}
|
|
64
|
+
// In XML tool mode membrane reads tool calls out of the text. Markup it
|
|
65
|
+
// reads no call from still shows in how the output ended: with a tool-call
|
|
66
|
+
// block still open (a call cut off at max_tokens, or an opening tag written
|
|
67
|
+
// in prose), or at `</function_calls>`, the stop sequence XML tool mode adds
|
|
68
|
+
// so that it can run calls (inference/request asks for no stop sequence of
|
|
69
|
+
// its own). Either way the markup is in the text.
|
|
70
|
+
if (response.details.stop.unclosedToolBlock) {
|
|
71
|
+
throw new Error("The model's output ended with a tool-call block still open, and inference/request offers no tools");
|
|
72
|
+
}
|
|
73
|
+
if (response.details.stop.triggeredSequence === '</function_calls>') {
|
|
74
|
+
throw new Error('The model wrote tool-call markup, and inference/request offers no tools');
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
content: response.content
|
|
78
|
+
.filter((b) => b.type === 'text')
|
|
79
|
+
.map((b) => b.text)
|
|
80
|
+
.join(''),
|
|
81
|
+
// Spec §11.3: the actual model used, which can differ from the routed one
|
|
82
|
+
// where routing or fallback applies. When membrane names none, the routed
|
|
83
|
+
// model is the only one there is to report.
|
|
84
|
+
model: actualModelOf(response) ?? routedModel,
|
|
85
|
+
finishReason: finishReasonFor(response.stopReason),
|
|
86
|
+
usage: {
|
|
87
|
+
inputTokens: response.usage.inputTokens,
|
|
88
|
+
outputTokens: response.usage.outputTokens,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The model membrane says served the response, or undefined when it names
|
|
94
|
+
* none. membrane's type says it always names one, but some of its adapters
|
|
95
|
+
* pass the provider's own value through as it is, which can be empty.
|
|
96
|
+
*/
|
|
97
|
+
function actualModelOf(response) {
|
|
98
|
+
return response.details.model.actual || undefined;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* MCPL's finishReason for membrane's stop reason. Spec §11.3 closes
|
|
102
|
+
* FinishReason at these three, so any other stop throws: `end_turn` for a
|
|
103
|
+
* refusal, or for a turn membrane's resumption guard ended (`no_progress`,
|
|
104
|
+
* `round_limit`), would tell the server the model had finished.
|
|
105
|
+
*/
|
|
106
|
+
function finishReasonFor(stopReason) {
|
|
107
|
+
switch (stopReason) {
|
|
108
|
+
case 'end_turn':
|
|
109
|
+
case 'max_tokens':
|
|
110
|
+
case 'stop_sequence':
|
|
111
|
+
return stopReason;
|
|
112
|
+
default:
|
|
113
|
+
throw new Error(`The inference ended with stop reason '${stopReason}', for which inference/request has no finishReason`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** The error for a model that called a tool, which inference/request doesn't offer. */
|
|
117
|
+
function toolCallError(calls) {
|
|
118
|
+
const names = calls.map((call) => call.name).join(', ');
|
|
119
|
+
return new Error(`The model called a tool (${names}), and inference/request offers none`);
|
|
120
|
+
}
|
|
121
|
+
// ============================================================================
|
|
35
122
|
// Constants
|
|
36
123
|
// ============================================================================
|
|
37
124
|
/** Default max tokens when not specified in preferences. */
|
|
@@ -60,9 +147,10 @@ export class InferenceRouter {
|
|
|
60
147
|
* 1. Validate feature set
|
|
61
148
|
* 2. Check loop prevention (reject if inside a hook)
|
|
62
149
|
* 3. Resolve model from routing policy
|
|
63
|
-
* 4. Build membrane request
|
|
64
|
-
* 5.
|
|
65
|
-
* 6.
|
|
150
|
+
* 4. Build membrane request
|
|
151
|
+
* 5. Run inference, streaming its visible text as chunks when asked
|
|
152
|
+
* 6. Answer with the result, or with the error for any ending that isn't
|
|
153
|
+
* a completion
|
|
66
154
|
*/
|
|
67
155
|
async handleInferenceRequest(serverId, params, responder) {
|
|
68
156
|
// 1. Validate feature set
|
|
@@ -105,47 +193,43 @@ export class InferenceRouter {
|
|
|
105
193
|
temperature: params.preferences?.temperature,
|
|
106
194
|
},
|
|
107
195
|
};
|
|
196
|
+
// Streaming needs a way to send chunks and an id to tag them with;
|
|
197
|
+
// without either, the request is answered whole.
|
|
198
|
+
const chunkRequestId = params.stream && this.sendChunkFn ? responder.requestId : undefined;
|
|
199
|
+
const streamed = chunkRequestId != null;
|
|
108
200
|
try {
|
|
109
|
-
// 5. Run inference
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
await this.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
// Emit trace: inference complete
|
|
132
|
-
this.emitTraceFn({
|
|
133
|
-
type: 'mcpl:inference_complete',
|
|
134
|
-
serverId,
|
|
135
|
-
model,
|
|
136
|
-
inputTokens: result.usage.inputTokens,
|
|
137
|
-
outputTokens: result.usage.outputTokens,
|
|
138
|
-
});
|
|
139
|
-
responder.respond(result);
|
|
140
|
-
}
|
|
201
|
+
// 5. Run inference. Both modes end in membrane's response, and one
|
|
202
|
+
// builder makes the result from it.
|
|
203
|
+
const response = chunkRequestId != null
|
|
204
|
+
? await this.streamResponse(serverId, request, chunkRequestId)
|
|
205
|
+
: await this.membrane.complete(request);
|
|
206
|
+
// 6. Answer
|
|
207
|
+
const result = resultFrom(response, model);
|
|
208
|
+
const actualModel = actualModelOf(response);
|
|
209
|
+
this.emitTraceFn({
|
|
210
|
+
type: 'mcpl:inference_complete',
|
|
211
|
+
serverId,
|
|
212
|
+
// The routed model, as inference_start has it. actualModel is the one
|
|
213
|
+
// the result reports, left out when membrane named none.
|
|
214
|
+
model,
|
|
215
|
+
...(actualModel !== undefined ? { actualModel } : {}),
|
|
216
|
+
inputTokens: result.usage.inputTokens,
|
|
217
|
+
outputTokens: result.usage.outputTokens,
|
|
218
|
+
streamed,
|
|
219
|
+
});
|
|
220
|
+
responder.respond(result);
|
|
141
221
|
}
|
|
142
222
|
catch (err) {
|
|
143
|
-
//
|
|
223
|
+
// Every ending that isn't a completion lands here, in either mode:
|
|
224
|
+
// membrane's error, a stream that stopped early, a tool call, or a
|
|
225
|
+
// stop FinishReason can't name. The answer is the JSON-RPC error, never
|
|
226
|
+
// a result carrying what arrived.
|
|
144
227
|
this.emitTraceFn({
|
|
145
228
|
type: 'mcpl:inference_fail',
|
|
146
229
|
serverId,
|
|
147
230
|
model,
|
|
148
231
|
error: err instanceof Error ? err.message : String(err),
|
|
232
|
+
streamed,
|
|
149
233
|
});
|
|
150
234
|
responder.respondError(-32603, err instanceof Error ? err.message : 'Inference failed');
|
|
151
235
|
}
|
|
@@ -190,60 +274,45 @@ export class InferenceRouter {
|
|
|
190
274
|
// Private: Streaming
|
|
191
275
|
// ==========================================================================
|
|
192
276
|
/**
|
|
193
|
-
*
|
|
277
|
+
* Run the inference as a stream, sending each visible text delta to the
|
|
278
|
+
* server as an inference/chunk, and return membrane's response once the
|
|
279
|
+
* stream completes.
|
|
194
280
|
*
|
|
195
|
-
*
|
|
196
|
-
* membrane
|
|
281
|
+
* Every other ending throws, so the request is answered with the error
|
|
282
|
+
* rather than with the text that arrived: membrane's `error`, an `aborted`
|
|
283
|
+
* stream, a stream that ends with no terminal event, and `tool-calls`. A
|
|
284
|
+
* stream that has yielded tool calls waits for their results until it is
|
|
285
|
+
* cancelled, and inference/request offers the model no tools. Leaving the
|
|
286
|
+
* loop by return or throw calls the stream's return(), which cancels it,
|
|
287
|
+
* so nothing keeps running once the request is answered.
|
|
197
288
|
*/
|
|
198
|
-
async
|
|
199
|
-
const requestId = responder.requestId;
|
|
200
|
-
// Check if streamYielding is available on the membrane instance.
|
|
201
|
-
// We use streamYielding to iterate events and forward text deltas as chunks.
|
|
289
|
+
async streamResponse(serverId, request, requestId) {
|
|
202
290
|
const stream = this.membrane.streamYielding(request);
|
|
203
|
-
let
|
|
204
|
-
let fullContent = '';
|
|
291
|
+
let index = 0;
|
|
205
292
|
for await (const event of stream) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
293
|
+
switch (event.type) {
|
|
294
|
+
case 'tokens':
|
|
295
|
+
// Only text membrane marks visible is sent, which leaves out
|
|
296
|
+
// thinking and tool-call markup. The result's content is the
|
|
297
|
+
// response's text blocks, which membrane parses on its own, so in
|
|
298
|
+
// XML tool mode the chunks can miss text the content holds: prose
|
|
299
|
+
// naming a tag the stream parser opens a block for, or a thinking
|
|
300
|
+
// block cut off before its close tag.
|
|
301
|
+
if (event.meta.visible) {
|
|
302
|
+
this.sendChunkFn(serverId, { requestId, index: index++, delta: event.content });
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
case 'tool-calls':
|
|
306
|
+
throw toolCallError(event.calls);
|
|
307
|
+
case 'complete':
|
|
308
|
+
return event.response;
|
|
309
|
+
case 'error':
|
|
310
|
+
throw event.error;
|
|
311
|
+
case 'aborted':
|
|
312
|
+
throw new Error(`The inference stopped before it finished (${event.reason})`);
|
|
214
313
|
}
|
|
215
314
|
}
|
|
216
|
-
|
|
217
|
-
const result = {
|
|
218
|
-
content: fullContent,
|
|
219
|
-
model,
|
|
220
|
-
finishReason: 'end_turn',
|
|
221
|
-
usage: { inputTokens: 0, outputTokens: 0 },
|
|
222
|
-
};
|
|
223
|
-
this.emitTraceFn({
|
|
224
|
-
type: 'mcpl:inference_complete',
|
|
225
|
-
serverId,
|
|
226
|
-
model,
|
|
227
|
-
streamed: true,
|
|
228
|
-
});
|
|
229
|
-
responder.respond(result);
|
|
230
|
-
}
|
|
231
|
-
// ==========================================================================
|
|
232
|
-
// Private: Helpers
|
|
233
|
-
// ==========================================================================
|
|
234
|
-
/**
|
|
235
|
-
* Map membrane's stopReason string to MCPL's finishReason enum.
|
|
236
|
-
*/
|
|
237
|
-
mapStopReason(stopReason) {
|
|
238
|
-
switch (stopReason) {
|
|
239
|
-
case 'max_tokens':
|
|
240
|
-
return 'max_tokens';
|
|
241
|
-
case 'stop_sequence':
|
|
242
|
-
return 'stop_sequence';
|
|
243
|
-
case 'end_turn':
|
|
244
|
-
default:
|
|
245
|
-
return 'end_turn';
|
|
246
|
-
}
|
|
315
|
+
throw new Error('The inference stream ended without a result');
|
|
247
316
|
}
|
|
248
317
|
}
|
|
249
318
|
//# sourceMappingURL=inference-router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference-router.js","sourceRoot":"","sources":["../../../src/mcpl/inference-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"inference-router.js","sourceRoot":"","sources":["../../../src/mcpl/inference-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAe/D,+EAA+E;AAC/E,wDAAwD;AACxD,+EAA+E;AAE/E;;GAEG;AACH,SAAS,aAAa,CAAC,OAAe,EAAE,IAAY;IAClD,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK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11 +126,15 @@ interface Rendering<E> {
|
|
|
126
126
|
}
|
|
127
127
|
/** What an assembly did, per subject, for the turn being assembled. */
|
|
128
128
|
export interface AssemblyResult {
|
|
129
|
-
/** Subjects
|
|
129
|
+
/** Subjects this assembly finished with: it waited on their render to
|
|
130
|
+
* completion, or freeze() declined them for this agent. */
|
|
130
131
|
settled: Set<string>;
|
|
131
132
|
/** Of those, the subjects whose render or fallback was delivered as content.
|
|
132
133
|
* A settled subject that is not here gave the turn nothing to read: empty
|
|
133
|
-
* or blank render (§5.2), cancelled, or
|
|
134
|
+
* or blank render (§5.2), cancelled, revoked before the render or at its
|
|
135
|
+
* response, a render-start that could not be made durable (the batch then
|
|
136
|
+
* waits for its recovery wake), or a batch whose audience doesn't include
|
|
137
|
+
* the agent. */
|
|
134
138
|
materialized: Set<string>;
|
|
135
139
|
}
|
|
136
140
|
interface SubjectState<E> {
|
|
@@ -217,7 +221,12 @@ export interface CoalescerHost<E> {
|
|
|
217
221
|
/** Persist one receipt now, before the acceptance is acknowledged. Throws
|
|
218
222
|
* on failure, which fails the acceptance (the producer retries). */
|
|
219
223
|
recordReceipt?(record: CoalescingReceiptRecord): void;
|
|
220
|
-
/**
|
|
224
|
+
/** One call per ADMITTED occurrence (never for a producer retry the receipt
|
|
225
|
+
* deduplicates), after its receipt is recorded. Observation only: a throw
|
|
226
|
+
* is contained here and never fails the acceptance. */
|
|
227
|
+
accepted?(occurrence: CoalescedOccurrence<E>): void;
|
|
228
|
+
/** Make every write so far DURABLE (an fsync; the coalescer requests each
|
|
229
|
+
* commit under its lock, so no two acceptances share one).
|
|
221
230
|
* Awaited before an acceptance is acknowledged and before push/render is
|
|
222
231
|
* issued: a kill after either boundary must find the receipt, the
|
|
223
232
|
* accepted work, and the render-start on disk. Rejects on failure. */
|
|
@@ -244,15 +253,21 @@ export declare function coalescingReceiptKey(serverId: string, binding: string,
|
|
|
244
253
|
* Validate wire content before it is stored, rendered or converted.
|
|
245
254
|
*
|
|
246
255
|
* Its shape and its visible emptiness, nothing else. An incoming coalesced
|
|
247
|
-
* occurrence reaches context through the
|
|
256
|
+
* occurrence reaches context through the converter an uncoalesced message
|
|
248
257
|
* goes through: a plain occurrence the moment it is admitted (the coalescer
|
|
249
258
|
* only remembers where it landed), a deferred one when its render settles or
|
|
250
259
|
* falls back to it. Its content must be an array of objects. A block the
|
|
251
|
-
*
|
|
260
|
+
* converter can't render (a video, an unknown type, an image with neither
|
|
252
261
|
* uri nor data) becomes a placeholder, as it does uncoalesced, and so does a
|
|
253
|
-
* malformed one, since the
|
|
254
|
-
* type,
|
|
255
|
-
* text block
|
|
262
|
+
* malformed one, since the converter takes any object without throwing: a
|
|
263
|
+
* type, data, mimeType or uri that isn't a string counts as absent, and a
|
|
264
|
+
* text block whose text isn't a string shows as its own placeholder, which
|
|
265
|
+
* counts as no text where MCPL content is admitted: here, on the wire blocks,
|
|
266
|
+
* and at the uncoalesced boundaries, through isVisiblyEmptyConversion. The
|
|
267
|
+
* framework's backstops read converted content with isVisiblyEmptyContent,
|
|
268
|
+
* which would count the placeholder as text, but they see only content one of
|
|
269
|
+
* those checks has passed. The uncoalesced
|
|
270
|
+
* lane doesn't check the array:
|
|
256
271
|
* there a member that isn't an object becomes the untyped placeholder, and a
|
|
257
272
|
* null member or content that isn't an array throws in conversion
|
|
258
273
|
* (agent-framework#297 brings that lane to this rule).
|
|
@@ -264,8 +279,8 @@ export declare function coalescingReceiptKey(serverId: string, binding: string,
|
|
|
264
279
|
*
|
|
265
280
|
* A render result, which the host delivers in the occurrence's place, gets
|
|
266
281
|
* these checks, as RFC-006 §5.2 gives it every check a pushed payload gets,
|
|
267
|
-
* and one more (`checkBlockShapes`): each block must be one the
|
|
268
|
-
*
|
|
282
|
+
* and one more (`checkBlockShapes`): each block must be one the converter
|
|
283
|
+
* shows as itself or as a reference stub, not as a placeholder. A malformed
|
|
269
284
|
* render falls back to the occurrence's own content; a pushed payload has
|
|
270
285
|
* nothing to fall back to, and gets its placeholders.
|
|
271
286
|
*
|
|
@@ -356,7 +371,14 @@ export declare class PushCoalescer<E = unknown> {
|
|
|
356
371
|
* Under the lock: decide whether `subject`'s batch renders for `agentName`,
|
|
357
372
|
* freeze it, make the render-start durable, re-check authority, and start
|
|
358
373
|
* the RPC. Returns the render's completion (shared by every assembly that
|
|
359
|
-
* waits on this batch, vector 25)
|
|
374
|
+
* waits on this batch, vector 25). Returns 'declined' when the turn being
|
|
375
|
+
* assembled gets nothing of the batch: the agent isn't in its audience,
|
|
376
|
+
* whether or not another assembly is rendering it (the batch is left as it
|
|
377
|
+
* is); authority was revoked before the render could start (the batch is
|
|
378
|
+
* dropped); or the render-start could not be made durable (the batch is
|
|
379
|
+
* kept for its recovery wake). Returns undefined when the batch was not
|
|
380
|
+
* this assembly's to decide on: there is none, the subject moved on during
|
|
381
|
+
* the audience lookup, or the host is stopping.
|
|
360
382
|
*/
|
|
361
383
|
private freeze;
|
|
362
384
|
private render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-coalescer.d.ts","sourceRoot":"","sources":["../../../src/mcpl/push-coalescer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIpE,eAAO,MAAM,uBAAuB;aAClC,UAAU;aAAQ,gBAAgB;aAAQ,QAAQ;aAAQ,iBAAiB;aAC3E,aAAa,EAAE,OAAS;CAChB,CAAC;AAEX,eAAO,MAAM,iBAAiB,YAAI,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAC9G,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAI/D,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM;IAAmB,QAAQ,CAAC,IAAI;IAAlE,YAAqB,KAAK,EAAE,MAAM,E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,OAAO,CAAC,cAAc,CAAC,CAoBzD;IAED;;;;;;;;;;;;OAYG;YACW,MAAM;YA4DN,MAAM;IA0EpB,OAAO,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAyB7D;IAED;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAavB,4EAA4E;IAC5E,eAAe,CAAC,OAAO,EAAE,uBAAuB,EAAE,GAAG,IAAI,CA8BxD;IAED,QAAQ,IAAI,kBAAkB,CAa7B;IAED,0FAA0F;IAC1F,uBAAuB,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAElD;IAED,OAAO,IAAI,IAAI,CAMd;IAED,OAAO,CAAC,OAAO;IAEf,OAAO,CAAC,KAAK;CAWd"}
|
|
@@ -54,15 +54,21 @@ function mergeIdentity(prior, next) {
|
|
|
54
54
|
* Validate wire content before it is stored, rendered or converted.
|
|
55
55
|
*
|
|
56
56
|
* Its shape and its visible emptiness, nothing else. An incoming coalesced
|
|
57
|
-
* occurrence reaches context through the
|
|
57
|
+
* occurrence reaches context through the converter an uncoalesced message
|
|
58
58
|
* goes through: a plain occurrence the moment it is admitted (the coalescer
|
|
59
59
|
* only remembers where it landed), a deferred one when its render settles or
|
|
60
60
|
* falls back to it. Its content must be an array of objects. A block the
|
|
61
|
-
*
|
|
61
|
+
* converter can't render (a video, an unknown type, an image with neither
|
|
62
62
|
* uri nor data) becomes a placeholder, as it does uncoalesced, and so does a
|
|
63
|
-
* malformed one, since the
|
|
64
|
-
* type,
|
|
65
|
-
* text block
|
|
63
|
+
* malformed one, since the converter takes any object without throwing: a
|
|
64
|
+
* type, data, mimeType or uri that isn't a string counts as absent, and a
|
|
65
|
+
* text block whose text isn't a string shows as its own placeholder, which
|
|
66
|
+
* counts as no text where MCPL content is admitted: here, on the wire blocks,
|
|
67
|
+
* and at the uncoalesced boundaries, through isVisiblyEmptyConversion. The
|
|
68
|
+
* framework's backstops read converted content with isVisiblyEmptyContent,
|
|
69
|
+
* which would count the placeholder as text, but they see only content one of
|
|
70
|
+
* those checks has passed. The uncoalesced
|
|
71
|
+
* lane doesn't check the array:
|
|
66
72
|
* there a member that isn't an object becomes the untyped placeholder, and a
|
|
67
73
|
* null member or content that isn't an array throws in conversion
|
|
68
74
|
* (agent-framework#297 brings that lane to this rule).
|
|
@@ -74,8 +80,8 @@ function mergeIdentity(prior, next) {
|
|
|
74
80
|
*
|
|
75
81
|
* A render result, which the host delivers in the occurrence's place, gets
|
|
76
82
|
* these checks, as RFC-006 §5.2 gives it every check a pushed payload gets,
|
|
77
|
-
* and one more (`checkBlockShapes`): each block must be one the
|
|
78
|
-
*
|
|
83
|
+
* and one more (`checkBlockShapes`): each block must be one the converter
|
|
84
|
+
* shows as itself or as a reference stub, not as a placeholder. A malformed
|
|
79
85
|
* render falls back to the occurrence's own content; a pushed payload has
|
|
80
86
|
* nothing to fall back to, and gets its placeholders.
|
|
81
87
|
*
|
|
@@ -98,12 +104,12 @@ export function validateCoalescedContent(content, options = {}) {
|
|
|
98
104
|
throw new EmptyContentError();
|
|
99
105
|
}
|
|
100
106
|
/**
|
|
101
|
-
* Whether the
|
|
102
|
-
*
|
|
107
|
+
* Whether the converter (`convertBlock` in convert-block.ts, which every lane
|
|
108
|
+
* uses) shows a block as itself, its text or its image or
|
|
103
109
|
* audio source, or as a reference stub, and not as a placeholder: an
|
|
104
|
-
* unrecognized block, a no-data or no-media-type one,
|
|
105
|
-
*
|
|
106
|
-
*
|
|
110
|
+
* unrecognized block, a no-data or no-media-type one, withheld inline data,
|
|
111
|
+
* or a text block whose text isn't a string. This follows its branches in
|
|
112
|
+
* their order.
|
|
107
113
|
*/
|
|
108
114
|
function showsAsItself(b) {
|
|
109
115
|
if (b.type === 'text')
|
|
@@ -302,6 +308,12 @@ export class PushCoalescer {
|
|
|
302
308
|
throw new CoalesceError('eventId', 'host could not persist the acceptance; retry', -32000);
|
|
303
309
|
}
|
|
304
310
|
this.receipts.set(receiptKey, entry);
|
|
311
|
+
try {
|
|
312
|
+
this.host.accepted?.(occurrence);
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
this.host.audit({ kind: 'accepted-observer-failed', subject, eventId: occurrence.eventId, error: String(error) });
|
|
316
|
+
}
|
|
305
317
|
this.prune();
|
|
306
318
|
this.persist();
|
|
307
319
|
// Written but not yet durable: the in-memory receipt deduplicates a retry
|
|
@@ -503,7 +515,9 @@ export class PushCoalescer {
|
|
|
503
515
|
// be flattened by `then`, holding the lock until the render settled —
|
|
504
516
|
// and the settlement itself needs the lock.
|
|
505
517
|
const started = await this.locked(() => this.freeze(subject, agentName));
|
|
506
|
-
if (started)
|
|
518
|
+
if (started === 'declined')
|
|
519
|
+
result.settled.add(subject);
|
|
520
|
+
else if (started) {
|
|
507
521
|
work.push(started.done.then(() => {
|
|
508
522
|
result.settled.add(subject);
|
|
509
523
|
if (started.rendering.materialized)
|
|
@@ -519,16 +533,29 @@ export class PushCoalescer {
|
|
|
519
533
|
* Under the lock: decide whether `subject`'s batch renders for `agentName`,
|
|
520
534
|
* freeze it, make the render-start durable, re-check authority, and start
|
|
521
535
|
* the RPC. Returns the render's completion (shared by every assembly that
|
|
522
|
-
* waits on this batch, vector 25)
|
|
536
|
+
* waits on this batch, vector 25). Returns 'declined' when the turn being
|
|
537
|
+
* assembled gets nothing of the batch: the agent isn't in its audience,
|
|
538
|
+
* whether or not another assembly is rendering it (the batch is left as it
|
|
539
|
+
* is); authority was revoked before the render could start (the batch is
|
|
540
|
+
* dropped); or the render-start could not be made durable (the batch is
|
|
541
|
+
* kept for its recovery wake). Returns undefined when the batch was not
|
|
542
|
+
* this assembly's to decide on: there is none, the subject moved on during
|
|
543
|
+
* the audience lookup, or the host is stopping.
|
|
523
544
|
*/
|
|
524
545
|
async freeze(subject, agentName) {
|
|
525
546
|
const state = this.subjects.get(subject);
|
|
526
547
|
if (!state || this.suspended)
|
|
527
548
|
return undefined;
|
|
528
549
|
if (state.rendering) {
|
|
529
|
-
// Another assembly froze this batch; share its outcome (vector 25)
|
|
550
|
+
// Another assembly froze this batch; share its outcome (vector 25),
|
|
551
|
+
// unless this agent isn't in its audience, as below.
|
|
530
552
|
const rendering = state.rendering;
|
|
531
|
-
|
|
553
|
+
const audience = await this.host.audience(rendering.batch.latest);
|
|
554
|
+
if (state.rendering !== rendering)
|
|
555
|
+
return undefined;
|
|
556
|
+
if (!audience.includes(agentName))
|
|
557
|
+
return 'declined';
|
|
558
|
+
return { done: rendering.done, rendering };
|
|
532
559
|
}
|
|
533
560
|
const batch = state.batch;
|
|
534
561
|
if (!batch)
|
|
@@ -536,13 +563,18 @@ export class PushCoalescer {
|
|
|
536
563
|
// The audience lookup may spawn a fork. Under the lock no admission can
|
|
537
564
|
// move the subject on meanwhile; the identity check guards the host.
|
|
538
565
|
const audience = await this.host.audience(batch.latest);
|
|
539
|
-
if (
|
|
566
|
+
if (state.batch !== batch || state.rendering)
|
|
540
567
|
return undefined;
|
|
568
|
+
// Not this agent's batch, or no longer: an agent woken for it can have left
|
|
569
|
+
// its audience since. This turn has nothing of it to show. The batch stays
|
|
570
|
+
// pending; nothing here wakes its current audience.
|
|
571
|
+
if (!audience.includes(agentName))
|
|
572
|
+
return 'declined';
|
|
541
573
|
state.batch = undefined;
|
|
542
574
|
this.host.cancelWake(subject);
|
|
543
575
|
if (!this.host.authorized(batch.latest)) {
|
|
544
576
|
this.host.audit({ kind: 'revoked', subject, eventId: batch.latest.eventId });
|
|
545
|
-
return
|
|
577
|
+
return 'declined';
|
|
546
578
|
}
|
|
547
579
|
const rendering = { batch, cancelled: false, done: Promise.resolve() };
|
|
548
580
|
state.rendering = rendering;
|
|
@@ -564,7 +596,7 @@ export class PushCoalescer {
|
|
|
564
596
|
// unrelated traffic happens by. Re-wake with backoff, so a persistent
|
|
565
597
|
// storage outage does not become a tight loop of model turns.
|
|
566
598
|
this.scheduleRecovery(subject, state);
|
|
567
|
-
return
|
|
599
|
+
return 'declined';
|
|
568
600
|
}
|
|
569
601
|
this.clearRecovery(subject);
|
|
570
602
|
if (this.suspended) {
|
|
@@ -578,7 +610,7 @@ export class PushCoalescer {
|
|
|
578
610
|
if (!this.host.authorized(batch.latest)) {
|
|
579
611
|
this.host.audit({ kind: 'revoked', subject, eventId: batch.latest.eventId });
|
|
580
612
|
state.rendering = undefined;
|
|
581
|
-
return
|
|
613
|
+
return 'declined';
|
|
582
614
|
}
|
|
583
615
|
rendering.done = this.render(subject, state, rendering, agentName);
|
|
584
616
|
return { done: rendering.done, rendering };
|