@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
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RFC-007 for calls a code_execution script makes (issue #235, finding F4):
|
|
3
|
-
* a real framework, a real python interpreter, real MCPL servers over stdio.
|
|
4
|
-
*
|
|
5
|
-
* prov offers `click` (classed `computer`) and `run` (unclassed,
|
|
6
|
-
* returns an error result); `delay_ms` delays an answer, and
|
|
7
|
-
* `hold` holds it until a file exists
|
|
8
|
-
* obs-all observe, no filter: every call, metadata only
|
|
9
|
-
* obs-comms filter `class: comms`
|
|
10
|
-
* obs-run filter `serverTool: run`
|
|
11
|
-
* obs-web filter `class: web`, which no call has
|
|
12
|
-
*
|
|
13
|
-
* The module tool `test--send` is classed `comms` by the embedding host.
|
|
14
|
-
* Before this, observers saw only the outer code_execution call (`shell`),
|
|
15
|
-
* so obs-comms and obs-run saw nothing at all.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, it, before, after } from 'node:test';
|
|
18
|
-
import assert from 'node:assert/strict';
|
|
19
|
-
import { tmpdir } from 'node:os';
|
|
20
|
-
import { mkdtempSync, rmSync, readFileSync, existsSync, writeFileSync } from 'node:fs';
|
|
21
|
-
import { join } from 'node:path';
|
|
22
|
-
import { AgentFramework } from '../src/index.js';
|
|
23
|
-
import { SCRIPT_PARENT_META_KEY } from '../src/mcpl/tool-lifecycle.js';
|
|
24
|
-
import { MockMembrane, createMockResponse } from './helpers/mock-membrane.js';
|
|
25
|
-
const FIXTURE = join(import.meta.dirname, 'fixtures/tool-lifecycle-mcpl-server.mjs');
|
|
26
|
-
class TestModule {
|
|
27
|
-
name = 'test';
|
|
28
|
-
async start(_ctx) { }
|
|
29
|
-
async stop() { }
|
|
30
|
-
getTools() {
|
|
31
|
-
return [{
|
|
32
|
-
name: 'send',
|
|
33
|
-
description: 'Send a message to a person',
|
|
34
|
-
inputSchema: { type: 'object', properties: { text: { type: 'string' } } },
|
|
35
|
-
}];
|
|
36
|
-
}
|
|
37
|
-
async handleToolCall() {
|
|
38
|
-
return { success: true, data: 'RESULT-MARKER sent' };
|
|
39
|
-
}
|
|
40
|
-
async onProcess(event, _state) {
|
|
41
|
-
if (event.type === 'external-message') {
|
|
42
|
-
return {
|
|
43
|
-
addMessages: [{ participant: 'User', content: [{ type: 'text', text: 'go' }] }],
|
|
44
|
-
requestInference: true,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
return {};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async function waitFor(cond, what, timeoutMs = 20_000) {
|
|
51
|
-
const deadline = Date.now() + timeoutMs;
|
|
52
|
-
while (Date.now() < deadline) {
|
|
53
|
-
if (cond())
|
|
54
|
-
return;
|
|
55
|
-
await new Promise((r) => setTimeout(r, 50));
|
|
56
|
-
}
|
|
57
|
-
throw new Error(`timed out waiting for: ${what}`);
|
|
58
|
-
}
|
|
59
|
-
const readLog = (path) => existsSync(path) ? readFileSync(path, 'utf8').split('\n').filter(Boolean).map((l) => JSON.parse(l)) : [];
|
|
60
|
-
const OBSERVERS = {
|
|
61
|
-
'obs-all': null,
|
|
62
|
-
'obs-comms': [{ match: { class: 'comms' } }],
|
|
63
|
-
'obs-run': [{ match: { serverTool: 'run' } }],
|
|
64
|
-
'obs-web': [{ match: { class: 'web' } }],
|
|
65
|
-
};
|
|
66
|
-
describe('tool lifecycle for script-made calls (RFC-007, #235 F4)', () => {
|
|
67
|
-
let tempDir;
|
|
68
|
-
let logs;
|
|
69
|
-
let membrane;
|
|
70
|
-
let framework;
|
|
71
|
-
const lifecycle = (id) => readLog(logs[id]).filter((e) => e.event === 'lifecycle').map((e) => e.params);
|
|
72
|
-
/** The stream's teardown, which ends (aborts) its open calls, has run. */
|
|
73
|
-
const streamEnded = () => !framework.activeStreams.has('scout');
|
|
74
|
-
async function runTurn(blocks) {
|
|
75
|
-
const callsBefore = membrane.calls.length;
|
|
76
|
-
membrane.pushResponse(createMockResponse(blocks, 'tool_use'));
|
|
77
|
-
membrane.pushResponse(createMockResponse([{ type: 'text', text: 'Done.' }]));
|
|
78
|
-
framework.pushEvent({
|
|
79
|
-
type: 'external-message',
|
|
80
|
-
source: 'test',
|
|
81
|
-
content: [{ type: 'text', text: 'go' }],
|
|
82
|
-
metadata: {},
|
|
83
|
-
triggerInference: true,
|
|
84
|
-
});
|
|
85
|
-
await waitFor(() => membrane.calls.length > callsBefore && (membrane.lastStream?.receivedToolResults.length ?? 0) >= 1, 'the tool round answered');
|
|
86
|
-
await waitFor(streamEnded, "the turn's stream ended");
|
|
87
|
-
}
|
|
88
|
-
before(async () => {
|
|
89
|
-
tempDir = mkdtempSync(join(tmpdir(), 'tool-lifecycle-script-'));
|
|
90
|
-
logs = {
|
|
91
|
-
prov: join(tempDir, 'prov.jsonl'),
|
|
92
|
-
'obs-all': join(tempDir, 'obs-all.jsonl'),
|
|
93
|
-
'obs-comms': join(tempDir, 'obs-comms.jsonl'),
|
|
94
|
-
'obs-run': join(tempDir, 'obs-run.jsonl'),
|
|
95
|
-
'obs-web': join(tempDir, 'obs-web.jsonl'),
|
|
96
|
-
};
|
|
97
|
-
membrane = new MockMembrane();
|
|
98
|
-
framework = await AgentFramework.create({
|
|
99
|
-
storePath: join(tempDir, 'test.chronicle'),
|
|
100
|
-
membrane: membrane.asMembrane(),
|
|
101
|
-
agents: [{ name: 'scout', model: 'test-model', systemPrompt: 'You are scout.' }],
|
|
102
|
-
modules: [new TestModule()],
|
|
103
|
-
codeExecution: { enabled: true },
|
|
104
|
-
hostToolClasses: { 'test--send': ['comms'] },
|
|
105
|
-
mcplServers: [
|
|
106
|
-
{
|
|
107
|
-
id: 'prov',
|
|
108
|
-
toolPrefix: 'prov',
|
|
109
|
-
command: process.execPath,
|
|
110
|
-
args: [FIXTURE],
|
|
111
|
-
env: { ROLE: 'provider', LOG_PATH: logs.prov },
|
|
112
|
-
},
|
|
113
|
-
...Object.entries(OBSERVERS).map(([id, filter]) => ({
|
|
114
|
-
id,
|
|
115
|
-
toolPrefix: id,
|
|
116
|
-
command: process.execPath,
|
|
117
|
-
args: [FIXTURE],
|
|
118
|
-
env: {
|
|
119
|
-
ROLE: 'observer',
|
|
120
|
-
LOG_PATH: logs[id],
|
|
121
|
-
...(filter ? { FILTER: JSON.stringify(filter) } : {}),
|
|
122
|
-
},
|
|
123
|
-
toolLifecycle: { observe: {} },
|
|
124
|
-
})),
|
|
125
|
-
],
|
|
126
|
-
});
|
|
127
|
-
await framework.start();
|
|
128
|
-
for (const [id, filter] of Object.entries(OBSERVERS)) {
|
|
129
|
-
if (filter) {
|
|
130
|
-
await waitFor(() => readLog(logs[id]).some((e) => e.event === 'observe-applied'), `${id} filter applied`);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
await waitFor(() => readLog(logs[id]).some((e) => e.event === 'policy'), `${id} granted`);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
await waitFor(() => ['prov--click', 'prov--run', 'test--send'].every((n) => framework.getAllTools().some((t) => t.name === n)), 'tools listed');
|
|
137
|
-
});
|
|
138
|
-
after(async () => {
|
|
139
|
-
await framework?.stop();
|
|
140
|
-
if (tempDir)
|
|
141
|
-
rmSync(tempDir, { recursive: true, force: true });
|
|
142
|
-
});
|
|
143
|
-
it("reports a script's calls under each inner tool's own name and class; model calls unchanged", async () => {
|
|
144
|
-
const code = [
|
|
145
|
-
'await prov__click({"x": 1, "y": 2, "delay_ms": 250})',
|
|
146
|
-
'await prov__run({"cmd": "make"})',
|
|
147
|
-
'await test__send({"text": "hello"})',
|
|
148
|
-
'print("script done")',
|
|
149
|
-
].join('\n');
|
|
150
|
-
await runTurn([
|
|
151
|
-
{ type: 'tool_use', id: 'toolu_01SCRIPTAAAAAAAAAAAAAAAAA', name: 'code_execution', input: { code } },
|
|
152
|
-
{ type: 'tool_use', id: 'toolu_01MODELBBBBBBBBBBBBBBBBBB', name: 'prov--click', input: { x: 5, y: 6 } },
|
|
153
|
-
]);
|
|
154
|
-
// Each observer logs from its own process: wait for every log we read.
|
|
155
|
-
await waitFor(() => lifecycle('obs-all').length >= 10, 'obs-all: five calls, both phases');
|
|
156
|
-
await waitFor(() => lifecycle('obs-comms').length >= 2, 'obs-comms: one call, both phases');
|
|
157
|
-
await waitFor(() => lifecycle('obs-run').length >= 2, 'obs-run: one call, both phases');
|
|
158
|
-
await new Promise((r) => setTimeout(r, 300)); // a stray or duplicate would land here
|
|
159
|
-
const script = JSON.stringify(membrane.lastStream?.receivedToolResults ?? []);
|
|
160
|
-
assert.match(script, /script done/, 'the script ran to the end');
|
|
161
|
-
const all = lifecycle('obs-all');
|
|
162
|
-
assert.equal(all.length, 10, all.map((p) => `${p.tool}:${p.phase}`).join(', '));
|
|
163
|
-
const parent = all.find((p) => p.tool === 'code_execution' && p.phase === 'started');
|
|
164
|
-
assert.deepEqual(parent.class, ['shell']);
|
|
165
|
-
const parentMeta = { [SCRIPT_PARENT_META_KEY]: parent.toolCallId };
|
|
166
|
-
// The model's own calls: as before, no attribution.
|
|
167
|
-
for (const p of all.filter((p) => p.tool === 'code_execution' || p.toolCallId === 'toolu_01MODELBBBBBBBBBBBBBBBBBB')) {
|
|
168
|
-
assert.equal(p._meta, undefined, `${p.tool}:${p.phase} carries no _meta`);
|
|
169
|
-
}
|
|
170
|
-
const modelClick = all.filter((p) => p.toolCallId === 'toolu_01MODELBBBBBBBBBBBBBBBBBB');
|
|
171
|
-
assert.deepEqual(modelClick.map((p) => `${p.tool}:${p.phase}`), ['prov--click:started', 'prov--click:completed']);
|
|
172
|
-
// The script's calls: inner tool, inner class, the parent's inference and call.
|
|
173
|
-
const inner = all.filter((p) => p._meta !== undefined);
|
|
174
|
-
assert.equal(inner.length, 6);
|
|
175
|
-
for (const p of inner) {
|
|
176
|
-
assert.deepEqual(p._meta, parentMeta);
|
|
177
|
-
assert.equal(p.inferenceId, parent.inferenceId);
|
|
178
|
-
assert.equal(p.conversationId, 'scout');
|
|
179
|
-
assert.notEqual(p.toolCallId, parent.toolCallId);
|
|
180
|
-
}
|
|
181
|
-
const phases = (tool) => inner.filter((p) => p.tool === tool);
|
|
182
|
-
const [clickStart, clickEnd] = phases('prov--click');
|
|
183
|
-
assert.deepEqual([clickStart.phase, clickEnd.phase], ['started', 'completed']);
|
|
184
|
-
assert.equal(clickStart.toolCallId, clickEnd.toolCallId);
|
|
185
|
-
assert.deepEqual(clickStart.class, ['computer']);
|
|
186
|
-
assert.equal(clickStart.serverId, 'prov');
|
|
187
|
-
assert.equal(clickStart.serverTool, 'click');
|
|
188
|
-
assert.equal(clickEnd.isError, false);
|
|
189
|
-
const duration = clickEnd.durationMs;
|
|
190
|
-
assert.ok(duration >= 200 && duration < 10_000, `durationMs ${duration} spans the 250ms call`);
|
|
191
|
-
const [runStart, runEnd] = phases('prov--run');
|
|
192
|
-
assert.deepEqual(runStart.class, []);
|
|
193
|
-
assert.equal(runEnd.phase, 'completed', 'an error result is completed, not failed');
|
|
194
|
-
assert.equal(runEnd.isError, true);
|
|
195
|
-
const [sendStart, sendEnd] = phases('test--send');
|
|
196
|
-
assert.deepEqual(sendStart.class, ['comms']);
|
|
197
|
-
assert.equal(sendStart.serverId, undefined, 'a host-implemented tool');
|
|
198
|
-
assert.equal(sendEnd.phase, 'completed');
|
|
199
|
-
// Filters see the inner calls they ask for, by class and by name.
|
|
200
|
-
assert.deepEqual(lifecycle('obs-comms').map((p) => `${p.tool}:${p.phase}`), ['test--send:started', 'test--send:completed']);
|
|
201
|
-
assert.deepEqual(lifecycle('obs-comms')[0]._meta, parentMeta);
|
|
202
|
-
assert.deepEqual(lifecycle('obs-run').map((p) => `${p.tool}:${p.phase}:${p.isError}`), ['prov--run:started:undefined', 'prov--run:completed:true']);
|
|
203
|
-
assert.equal(lifecycle('obs-web').length, 0, 'a filter no call matches sees nothing');
|
|
204
|
-
for (const id of Object.keys(OBSERVERS)) {
|
|
205
|
-
const wire = JSON.stringify(lifecycle(id));
|
|
206
|
-
for (const secret of ['RESULT-MARKER', 'hello', 'make']) {
|
|
207
|
-
assert.ok(!wire.includes(secret), `"${secret}" must not reach ${id}`);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
assert.equal(readLog(logs.prov).filter((e) => e.event === 'lifecycle').length, 0, 'the provider holds no grant');
|
|
211
|
-
});
|
|
212
|
-
it('a dispatch that throws after doing work is reported started then failed, not dropped', async () => {
|
|
213
|
-
// Some host tools change state and then throw synchronously (sleep with
|
|
214
|
-
// a huge `seconds` sets the gate, then fails formatting its reply).
|
|
215
|
-
// Stand one in for test--send.
|
|
216
|
-
const internals = framework;
|
|
217
|
-
const original = internals.dispatchToolCall;
|
|
218
|
-
let workDone = 0;
|
|
219
|
-
internals.dispatchToolCall = function (agentName, call) {
|
|
220
|
-
if (call.name === 'test--send' && call.input.boom) {
|
|
221
|
-
workDone++;
|
|
222
|
-
throw new RangeError('Invalid time value');
|
|
223
|
-
}
|
|
224
|
-
return original.call(this, agentName, call);
|
|
225
|
-
};
|
|
226
|
-
try {
|
|
227
|
-
const before = { all: lifecycle('obs-all').length, comms: lifecycle('obs-comms').length };
|
|
228
|
-
await runTurn([{
|
|
229
|
-
type: 'tool_use',
|
|
230
|
-
id: 'toolu_01THROWSDDDDDDDDDDDDDDDDDD',
|
|
231
|
-
name: 'code_execution',
|
|
232
|
-
input: { code: 'r = await test__send({"text": "x", "boom": True})\nprint("got:", r)' },
|
|
233
|
-
}]);
|
|
234
|
-
await waitFor(() => lifecycle('obs-all').length >= before.all + 4, 'obs-all: both calls ended');
|
|
235
|
-
await waitFor(() => lifecycle('obs-comms').length >= before.comms + 2, 'obs-comms: the call ended');
|
|
236
|
-
await new Promise((r) => setTimeout(r, 300)); // a stray or duplicate would land here
|
|
237
|
-
assert.equal(workDone, 1);
|
|
238
|
-
assert.match(JSON.stringify(membrane.lastStream.receivedToolResults), /got: Error: Invalid time value/);
|
|
239
|
-
const events = lifecycle('obs-all').slice(before.all);
|
|
240
|
-
assert.deepEqual(events.map((p) => `${p.tool}:${p.phase}`), [
|
|
241
|
-
'code_execution:started',
|
|
242
|
-
'test--send:started',
|
|
243
|
-
'test--send:failed',
|
|
244
|
-
'code_execution:completed',
|
|
245
|
-
]);
|
|
246
|
-
assert.deepEqual(events[2]._meta, { [SCRIPT_PARENT_META_KEY]: events[0].toolCallId });
|
|
247
|
-
assert.deepEqual(lifecycle('obs-comms').slice(before.comms).map((p) => `${p.tool}:${p.phase}`), ['test--send:started', 'test--send:failed']);
|
|
248
|
-
}
|
|
249
|
-
finally {
|
|
250
|
-
delete internals.dispatchToolCall;
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
it('a call still running when its script is killed is reported completed when it finishes', async () => {
|
|
254
|
-
const before = lifecycle('obs-all').length;
|
|
255
|
-
const release = join(tempDir, 'release-orphan');
|
|
256
|
-
await runTurn([{
|
|
257
|
-
type: 'tool_use',
|
|
258
|
-
id: 'toolu_01ORPHANCCCCCCCCCCCCCCCCCC',
|
|
259
|
-
name: 'code_execution',
|
|
260
|
-
input: { code: `await prov__click({"x": 1, "y": 1, "hold": ${JSON.stringify(release)}})`, time_limit_ms: 1000 },
|
|
261
|
-
}]);
|
|
262
|
-
// The script was stopped and the turn's stream has ended (ending its open
|
|
263
|
-
// calls), while the provider still holds the inner call's reply.
|
|
264
|
-
await waitFor(() => lifecycle('obs-all').length >= before + 3, 'the held call was reported');
|
|
265
|
-
const whileHeld = lifecycle('obs-all').slice(before);
|
|
266
|
-
assert.deepEqual(whileHeld.map((p) => `${p.tool}:${p.phase}`), [
|
|
267
|
-
'code_execution:started',
|
|
268
|
-
'prov--click:started',
|
|
269
|
-
'code_execution:completed',
|
|
270
|
-
]);
|
|
271
|
-
// Held for at least 200ms more, after the call had already started.
|
|
272
|
-
await new Promise((r) => setTimeout(r, 200));
|
|
273
|
-
writeFileSync(release, '');
|
|
274
|
-
await waitFor(() => lifecycle('obs-all').length >= before + 4, 'the orphaned call finished');
|
|
275
|
-
await new Promise((r) => setTimeout(r, 300)); // a stray or duplicate would land here
|
|
276
|
-
const events = lifecycle('obs-all').slice(before);
|
|
277
|
-
assert.deepEqual(events.map((p) => `${p.tool}:${p.phase}`), [
|
|
278
|
-
'code_execution:started',
|
|
279
|
-
'prov--click:started',
|
|
280
|
-
'code_execution:completed',
|
|
281
|
-
'prov--click:completed',
|
|
282
|
-
]);
|
|
283
|
-
const end = events[3];
|
|
284
|
-
assert.equal(end.isError, false);
|
|
285
|
-
assert.ok(end.durationMs >= 200, `durationMs ${String(end.durationMs)} covers the hold`);
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
//# sourceMappingURL=mcpl-tool-lifecycle-script.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcpl-tool-lifecycle-script.test.js","sourceRoot":"","sources":["../../test/mcpl-tool-lifecycle-script.test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AAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,EAAE,4BAA4B,CAAC,CAAC;QAC7F,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,uCAAuC;QACrF,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE;YAC1D,wBAAwB;YACxB,qBAAqB;YACrB,0BAA0B;YAC1B,uBAAuB;SACxB,CAAC,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,EAAE,CAAE,GAAG,CAAC,UAAqB,IAAI,GAAG,EAAE,cAAc,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACvG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCPL RFC-007 tool lifecycle — the host-side decision (grant, narrowing,
|
|
3
|
-
* class exclusions, the server's tools/observe filter, field selection and
|
|
4
|
-
* bounding) and the emitter's pairing (started → one terminal, to exactly the
|
|
5
|
-
* connections opened to, unless their grant no longer covers the call).
|
|
6
|
-
*
|
|
7
|
-
* Test names cite RFC-007 sections; conformance-vector numbers follow the
|
|
8
|
-
* RFC's own list where one applies.
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=mcpl-tool-lifecycle.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcpl-tool-lifecycle.test.d.ts","sourceRoot":"","sources":["../../test/mcpl-tool-lifecycle.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCPL RFC-007 tool lifecycle — the host-side decision (grant, narrowing,
|
|
3
|
-
* class exclusions, the server's tools/observe filter, field selection and
|
|
4
|
-
* bounding) and the emitter's pairing (started → one terminal, to exactly the
|
|
5
|
-
* connections opened to, unless their grant no longer covers the call).
|
|
6
|
-
*
|
|
7
|
-
* Test names cite RFC-007 sections; conformance-vector numbers follow the
|
|
8
|
-
* RFC's own list where one applies.
|
|
9
|
-
*/
|
|
10
|
-
import { test, describe } from 'node:test';
|
|
11
|
-
import assert from 'node:assert/strict';
|
|
12
|
-
import { CapabilityGrant } from '../src/mcpl/capability-grant.js';
|
|
13
|
-
import { parseToolObserveParams, selectFields, boundInput, openingFor, TOOL_OBSERVE_LIMITS, } from '../src/mcpl/tool-lifecycle.js';
|
|
14
|
-
const OBSERVE = 'toolLifecycle.observe';
|
|
15
|
-
const INPUTS = 'toolLifecycle.inputs';
|
|
16
|
-
function observer(id, paths, filter = null) {
|
|
17
|
-
const sent = [];
|
|
18
|
-
return {
|
|
19
|
-
id,
|
|
20
|
-
grant: new CapabilityGrant(new Set(paths), []),
|
|
21
|
-
toolObserveFilter: filter,
|
|
22
|
-
sendToolLifecycle: (p) => { sent.push(p); },
|
|
23
|
-
sent,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function rules(raw) {
|
|
27
|
-
const parsed = parseToolObserveParams({ rules: raw });
|
|
28
|
-
assert.ok(parsed.ok, `rules should parse: ${JSON.stringify(raw)}`);
|
|
29
|
-
return parsed.rules;
|
|
30
|
-
}
|
|
31
|
-
function call(over = {}) {
|
|
32
|
-
return {
|
|
33
|
-
toolCallId: 'toolu_0123456789abcdefghij',
|
|
34
|
-
inferenceId: 'inf_1',
|
|
35
|
-
conversationId: 'scout',
|
|
36
|
-
tool: 'computer--click',
|
|
37
|
-
class: ['computer'],
|
|
38
|
-
serverId: 'computer',
|
|
39
|
-
serverTool: 'click',
|
|
40
|
-
input: { x: 812, y: 440, button: 'left', target: { window_id: 3312, title: 'Invoice.pdf' } },
|
|
41
|
-
...over,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const DEFAULT_INPUTS = { observe: {}, inputs: { classes: 'default' } };
|
|
45
|
-
// ── RFC §6.4 steps 1–5, per connection ──────────────────────────────────────
|
|
46
|
-
describe('openingFor: grant, narrowing, filter, arguments', () => {
|
|
47
|
-
test('no observe grant → nothing (§4.1)', () => {
|
|
48
|
-
const o = observer('obs', [INPUTS], rules([{ match: {}, input: true }]));
|
|
49
|
-
assert.equal(openingFor(o, DEFAULT_INPUTS, call(), 'started'), null);
|
|
50
|
-
});
|
|
51
|
-
test('vector 1 — observe only, no filter: metadata, no input, no inputWithheld', () => {
|
|
52
|
-
const p = openingFor(observer('obs', [OBSERVE]), undefined, call(), 'started');
|
|
53
|
-
assert.deepEqual(Object.keys(p).sort(), [
|
|
54
|
-
'class', 'conversationId', 'inferenceId', 'phase', 'serverId', 'serverTool', 'tool', 'toolCallId',
|
|
55
|
-
]);
|
|
56
|
-
assert.equal(p.phase, 'started');
|
|
57
|
-
assert.deepEqual(p.class, ['computer']);
|
|
58
|
-
});
|
|
59
|
-
test('vector 2 — both leaves granted, NO filter: still metadata only (§5.1, rev 2)', () => {
|
|
60
|
-
const p = openingFor(observer('obs', [OBSERVE, INPUTS]), DEFAULT_INPUTS, call(), 'started');
|
|
61
|
-
assert.equal(p.input, undefined);
|
|
62
|
-
assert.equal(p.inputWithheld, undefined);
|
|
63
|
-
});
|
|
64
|
-
test('vector 3 — filter requests fields, grant allows: projected input, no inputAltered', () => {
|
|
65
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: { serverTool: 'click' }, input: ['x', 'y', 'target.window_id'] }]));
|
|
66
|
-
const p = openingFor(o, DEFAULT_INPUTS, call(), 'started');
|
|
67
|
-
assert.deepEqual(p.input, { x: 812, y: 440, target: { window_id: 3312 } });
|
|
68
|
-
assert.equal(p.inputAltered, undefined);
|
|
69
|
-
});
|
|
70
|
-
test('inputs narrowed by tool away from the call → inputWithheld (§4.3)', () => {
|
|
71
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {}, input: true }]));
|
|
72
|
-
const p = openingFor(o, { observe: {}, inputs: { tools: ['y--*'] } }, call(), 'started');
|
|
73
|
-
assert.equal(p.input, undefined);
|
|
74
|
-
assert.equal(p.inputWithheld, true);
|
|
75
|
-
});
|
|
76
|
-
test('observe narrowed away from the call → nothing', () => {
|
|
77
|
-
const o = observer('obs', [OBSERVE]);
|
|
78
|
-
assert.equal(openingFor(o, { observe: { tools: ['y--*'] } }, call(), 'started'), null);
|
|
79
|
-
assert.equal(openingFor(o, { observe: { classes: ['shell'] } }, call(), 'started'), null);
|
|
80
|
-
assert.ok(openingFor(o, { observe: { classes: ['shell', 'computer'] } }, call(), 'started'));
|
|
81
|
-
});
|
|
82
|
-
test('conversation narrowing is host-side (§4.3, §7.1)', () => {
|
|
83
|
-
const o = observer('obs', [OBSERVE]);
|
|
84
|
-
const cfg = { observe: { conversations: ['scout'] } };
|
|
85
|
-
assert.ok(openingFor(o, cfg, call({ conversationId: 'scout' }), 'started'));
|
|
86
|
-
assert.equal(openingFor(o, cfg, call({ conversationId: 'other' }), 'started'), null);
|
|
87
|
-
});
|
|
88
|
-
test('inputs is never unconditional: no tools/classes term → withheld (§4.3)', () => {
|
|
89
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {}, input: true }]));
|
|
90
|
-
for (const cfg of [{ observe: {} }, { observe: {}, inputs: {} }, { observe: {}, inputs: { conversations: ['*'] } }]) {
|
|
91
|
-
const p = openingFor(o, cfg, call(), 'started');
|
|
92
|
-
assert.equal(p.input, undefined, JSON.stringify(cfg));
|
|
93
|
-
assert.equal(p.inputWithheld, true, JSON.stringify(cfg));
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
test('comms never carries input, whatever the narrowing says (§4.3, §5.4)', () => {
|
|
97
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {}, input: true }]));
|
|
98
|
-
const cfg = { observe: {}, inputs: { classes: ['comms', 'files'], tools: ['*'] } };
|
|
99
|
-
const send = call({ tool: 'disc--send', class: ['comms'], serverId: 'disc', serverTool: 'send', input: { text: 'hi Alice' } });
|
|
100
|
-
const p = openingFor(o, cfg, send, 'started');
|
|
101
|
-
assert.equal(p.input, undefined);
|
|
102
|
-
assert.equal(p.inputWithheld, true);
|
|
103
|
-
// Multi-class tools get the union of restrictions (RFC-008 §5.3).
|
|
104
|
-
const sendFile = call({ tool: 'disc--send_file', class: ['files', 'comms'], input: { path: '/x' } });
|
|
105
|
-
assert.equal(openingFor(o, cfg, sendFile, 'started').input, undefined);
|
|
106
|
-
});
|
|
107
|
-
test('unclassed never carries input (RFC-008 §5.2)', () => {
|
|
108
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {}, input: true }]));
|
|
109
|
-
const p = openingFor(o, { observe: {}, inputs: { tools: ['*'] } }, call({ class: [] }), 'started');
|
|
110
|
-
assert.deepEqual(p.class, []);
|
|
111
|
-
assert.equal(p.input, undefined);
|
|
112
|
-
assert.equal(p.inputWithheld, true);
|
|
113
|
-
});
|
|
114
|
-
test('requested without the inputs grant → no input AND no inputWithheld (§5.1)', () => {
|
|
115
|
-
const o = observer('obs', [OBSERVE], rules([{ match: {}, input: true }]));
|
|
116
|
-
const p = openingFor(o, DEFAULT_INPUTS, call(), 'started');
|
|
117
|
-
assert.equal(p.input, undefined);
|
|
118
|
-
assert.equal(p.inputWithheld, undefined);
|
|
119
|
-
});
|
|
120
|
-
test('not requested → no input, no inputWithheld', () => {
|
|
121
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {} }]));
|
|
122
|
-
const p = openingFor(o, DEFAULT_INPUTS, call(), 'started');
|
|
123
|
-
assert.equal(p.input, undefined);
|
|
124
|
-
assert.equal(p.inputWithheld, undefined);
|
|
125
|
-
});
|
|
126
|
-
test('own tools are excluded (§7.1)', () => {
|
|
127
|
-
const o = observer('computer', [OBSERVE]);
|
|
128
|
-
assert.equal(openingFor(o, undefined, call(), 'started'), null);
|
|
129
|
-
});
|
|
130
|
-
test('host-implemented tools have no serverId/serverTool', () => {
|
|
131
|
-
const p = openingFor(observer('obs', [OBSERVE]), undefined, call({ tool: 'code_execution', class: ['shell'], serverId: undefined, serverTool: undefined }), 'started');
|
|
132
|
-
assert.equal('serverId' in p, false);
|
|
133
|
-
assert.equal('serverTool' in p, false);
|
|
134
|
-
});
|
|
135
|
-
test('pending never carries input', () => {
|
|
136
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {}, input: true }]));
|
|
137
|
-
const p = openingFor(o, DEFAULT_INPUTS, call(), 'pending');
|
|
138
|
-
assert.equal(p.phase, 'pending');
|
|
139
|
-
assert.equal(p.input, undefined);
|
|
140
|
-
assert.equal(p.inputWithheld, undefined);
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
// ── RFC §6 filter semantics ─────────────────────────────────────────────────
|
|
144
|
-
describe('tools/observe filter', () => {
|
|
145
|
-
const shell = call({ tool: 'workbench--bash', class: ['shell'], serverId: 'workbench', serverTool: 'bash', input: { command: 'make' } });
|
|
146
|
-
const blender = call({ tool: 'blender--execute', class: [], serverId: 'blender', serverTool: 'execute', input: { code: 'x' } });
|
|
147
|
-
const say = call({ tool: 'channel_publish', class: ['comms'], serverId: undefined, serverTool: undefined, input: { text: 'hi' } });
|
|
148
|
-
test('a call matching no rule is not reported', () => {
|
|
149
|
-
const o = observer('obs', [OBSERVE], rules([{ match: { tool: 'y--*' } }]));
|
|
150
|
-
assert.equal(openingFor(o, undefined, call(), 'started'), null);
|
|
151
|
-
assert.ok(openingFor(o, undefined, call({ tool: 'y--go' }), 'started'));
|
|
152
|
-
});
|
|
153
|
-
test('first match wins', () => {
|
|
154
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([
|
|
155
|
-
{ match: { tool: 'computer--*' }, input: ['x'] },
|
|
156
|
-
{ match: {}, input: true },
|
|
157
|
-
]));
|
|
158
|
-
assert.deepEqual(openingFor(o, DEFAULT_INPUTS, call(), 'started').input, { x: 812 });
|
|
159
|
-
});
|
|
160
|
-
test('report:false carves an exception out of a later catch-all', () => {
|
|
161
|
-
const o = observer('obs', [OBSERVE], rules([{ match: { class: 'comms' }, report: false }, { match: {} }]));
|
|
162
|
-
assert.equal(openingFor(o, undefined, say, 'started'), null);
|
|
163
|
-
assert.ok(openingFor(o, undefined, shell, 'started'));
|
|
164
|
-
});
|
|
165
|
-
test('class rule: matches by effective class; never matches an unclassed tool', () => {
|
|
166
|
-
const o = observer('obs', [OBSERVE], rules([{ match: { class: 'shell' } }]));
|
|
167
|
-
assert.ok(openingFor(o, undefined, shell, 'started'));
|
|
168
|
-
assert.equal(openingFor(o, undefined, blender, 'started'), null);
|
|
169
|
-
});
|
|
170
|
-
test('serverTool / serverId rules never match a host-implemented tool', () => {
|
|
171
|
-
const o = observer('obs', [OBSERVE], rules([{ match: { serverTool: '*' } }]));
|
|
172
|
-
assert.equal(openingFor(o, undefined, say, 'started'), null);
|
|
173
|
-
const o2 = observer('obs', [OBSERVE], rules([{ match: { serverId: '*' } }]));
|
|
174
|
-
assert.equal(openingFor(o2, undefined, say, 'started'), null);
|
|
175
|
-
});
|
|
176
|
-
test('conversationId is a match member (interest, not the boundary)', () => {
|
|
177
|
-
const o = observer('obs', [OBSERVE], rules([{ match: { conversationId: 'scout' } }]));
|
|
178
|
-
assert.ok(openingFor(o, undefined, call(), 'started'));
|
|
179
|
-
assert.equal(openingFor(o, undefined, call({ conversationId: 'x' }), 'started'), null);
|
|
180
|
-
});
|
|
181
|
-
test('rules: [] pauses; null clears back to metadata-only default', () => {
|
|
182
|
-
assert.deepEqual(parseToolObserveParams({ rules: [] }), { ok: true, rules: [] });
|
|
183
|
-
assert.equal(openingFor(observer('obs', [OBSERVE], []), undefined, call(), 'started'), null);
|
|
184
|
-
assert.deepEqual(parseToolObserveParams({ rules: null }), { ok: true, rules: null });
|
|
185
|
-
assert.deepEqual(parseToolObserveParams({}), { ok: true, rules: null });
|
|
186
|
-
assert.deepEqual(parseToolObserveParams(undefined), { ok: true, rules: null });
|
|
187
|
-
});
|
|
188
|
-
test('defaults: report true, input false', () => {
|
|
189
|
-
assert.deepEqual(rules([{ match: {} }]), [{ match: {}, report: true, input: false }]);
|
|
190
|
-
});
|
|
191
|
-
test('malformed requests fail with a reason (§6.6)', () => {
|
|
192
|
-
const bad = [
|
|
193
|
-
'nope',
|
|
194
|
-
{ rules: 'x' },
|
|
195
|
-
{ rules: [1] },
|
|
196
|
-
{ rules: [{}] },
|
|
197
|
-
{ rules: [{ match: { module: 'x' } }] },
|
|
198
|
-
{ rules: [{ match: {}, extra: 1 }] },
|
|
199
|
-
{ rules: [{ match: { class: 'quantum' } }] },
|
|
200
|
-
{ rules: [{ match: { tool: 3 } }] },
|
|
201
|
-
{ rules: [{ match: {}, report: 'yes' }] },
|
|
202
|
-
{ rules: [{ match: {}, input: 'x' }] },
|
|
203
|
-
{ rules: [{ match: {}, input: [''] }] },
|
|
204
|
-
{ rules: [{ match: {}, input: [1] }] },
|
|
205
|
-
];
|
|
206
|
-
for (const params of bad) {
|
|
207
|
-
const r = parseToolObserveParams(params);
|
|
208
|
-
assert.equal(r.ok, false, JSON.stringify(params));
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
test('limits report which limit (§6.6)', () => {
|
|
212
|
-
const many = Array.from({ length: TOOL_OBSERVE_LIMITS.rules + 1 }, () => ({ match: {} }));
|
|
213
|
-
const r1 = parseToolObserveParams({ rules: many });
|
|
214
|
-
assert.equal(r1.ok, false);
|
|
215
|
-
assert.deepEqual(!r1.ok && r1.data, { limit: 'rules' });
|
|
216
|
-
const long = 'x'.repeat(TOOL_OBSERVE_LIMITS.stringLength + 1);
|
|
217
|
-
const r2 = parseToolObserveParams({ rules: [{ match: { tool: long } }] });
|
|
218
|
-
assert.deepEqual(!r2.ok && r2.data, { limit: 'stringLength' });
|
|
219
|
-
const paths = Array.from({ length: TOOL_OBSERVE_LIMITS.pathsPerRule + 1 }, (_, i) => `f${i}`);
|
|
220
|
-
const r3 = parseToolObserveParams({ rules: [{ match: {}, input: paths }] });
|
|
221
|
-
assert.deepEqual(!r3.ok && r3.data, { limit: 'pathsPerRule' });
|
|
222
|
-
// The floor the RFC asks for is accepted.
|
|
223
|
-
assert.equal(parseToolObserveParams({ rules: Array.from({ length: 64 }, () => ({ match: {} })) }).ok, true);
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
// ── RFC §6.3 field paths, §5.2 bounds ───────────────────────────────────────
|
|
227
|
-
describe('field selection and bounding', () => {
|
|
228
|
-
test('nested path keeps structure; whole object/array; missing selects nothing', () => {
|
|
229
|
-
const input = { target: { window_id: 3, kind: 'w' }, x: 1, list: [1, 2], s: 'str' };
|
|
230
|
-
assert.deepEqual(selectFields(input, ['target.window_id']), { target: { window_id: 3 } });
|
|
231
|
-
assert.deepEqual(selectFields(input, ['target', 'list']), { target: { window_id: 3, kind: 'w' }, list: [1, 2] });
|
|
232
|
-
assert.deepEqual(selectFields(input, ['z']), {});
|
|
233
|
-
assert.deepEqual(selectFields(input, ['s.length']), {}); // through a non-object
|
|
234
|
-
assert.deepEqual(selectFields(input, ['target.window_id', 'target']), { target: { window_id: 3, kind: 'w' } });
|
|
235
|
-
});
|
|
236
|
-
test('field paths cannot reach or write prototypes', () => {
|
|
237
|
-
const out = selectFields({ a: 1 }, ['__proto__.polluted', 'constructor', 'toString']);
|
|
238
|
-
assert.deepEqual(out, {});
|
|
239
|
-
assert.equal({}.polluted, undefined);
|
|
240
|
-
});
|
|
241
|
-
test('within bound → untouched', () => {
|
|
242
|
-
const v = { a: 'x'.repeat(100) };
|
|
243
|
-
assert.deepEqual(boundInput(v, 16 * 1024), { value: v, altered: false });
|
|
244
|
-
});
|
|
245
|
-
test('vector 15 — a 200 KiB argument is cut to fit, still an object, altered', () => {
|
|
246
|
-
const big = { content: 'y'.repeat(200 * 1024), path: '/tmp/out.txt' };
|
|
247
|
-
const r = boundInput(big, 16 * 1024);
|
|
248
|
-
assert.ok(r.altered);
|
|
249
|
-
assert.ok(Buffer.byteLength(JSON.stringify(r.value)) <= 16 * 1024);
|
|
250
|
-
assert.equal(r.value.path, '/tmp/out.txt');
|
|
251
|
-
assert.ok(typeof r.value.content === 'string' && big.content.startsWith(r.value.content));
|
|
252
|
-
});
|
|
253
|
-
test('many small members: dropped until it fits', () => {
|
|
254
|
-
const wide = Object.fromEntries(Array.from({ length: 5000 }, (_, i) => [`k${i}`, i]));
|
|
255
|
-
const r = boundInput(wide, 2048);
|
|
256
|
-
assert.ok(r.altered);
|
|
257
|
-
assert.ok(Buffer.byteLength(JSON.stringify(r.value)) <= 2048);
|
|
258
|
-
});
|
|
259
|
-
test('configured bound applies after selection; selection alone never sets inputAltered', () => {
|
|
260
|
-
const o = observer('obs', [OBSERVE, INPUTS], rules([{ match: {}, input: ['content'] }]));
|
|
261
|
-
const writeCall = call({ tool: 'files--write', class: ['files'], input: { content: 'z'.repeat(5000), path: '/p' } });
|
|
262
|
-
const tight = openingFor(o, { ...DEFAULT_INPUTS, maxInputBytes: 1024 }, writeCall, 'started');
|
|
263
|
-
assert.equal(tight.inputAltered, true);
|
|
264
|
-
assert.ok(Buffer.byteLength(JSON.stringify(tight.input)) <= 1024);
|
|
265
|
-
const loose = openingFor(o, DEFAULT_INPUTS, writeCall, 'started');
|
|
266
|
-
assert.equal(loose.inputAltered, undefined);
|
|
267
|
-
assert.deepEqual(Object.keys(loose.input), ['content']);
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
//# sourceMappingURL=mcpl-tool-lifecycle.test.js.map
|