@animalabs/agent-framework 0.22.2 → 0.22.3
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 +136 -40
- 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/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 +3 -4
- package/src/agent.ts +162 -40
- 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/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,711 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { HistoryModule } from '../src/modules/history/index.js';
|
|
4
|
-
function buildStub(opts) {
|
|
5
|
-
const summaries = opts.summaries ?? [];
|
|
6
|
-
const messages = (opts.messages ?? []).map((m, i) => ({
|
|
7
|
-
id: m.id ?? `m${i}`,
|
|
8
|
-
sequence: m.sequence ?? i,
|
|
9
|
-
ms: m.ms,
|
|
10
|
-
channelId: m.channelId,
|
|
11
|
-
tokens: m.tokens,
|
|
12
|
-
}));
|
|
13
|
-
const calls = [];
|
|
14
|
-
const cm = {
|
|
15
|
-
getSummariesInRange(args) {
|
|
16
|
-
calls.push({ method: 'getSummariesInRange', args });
|
|
17
|
-
return summaries.filter((s) => {
|
|
18
|
-
if (args.level !== undefined && s.level !== args.level)
|
|
19
|
-
return false;
|
|
20
|
-
// Overlap test: entry overlaps [fromMs, toMs] (either bound optional).
|
|
21
|
-
if (args.toMs !== undefined && s.startMs > args.toMs)
|
|
22
|
-
return false;
|
|
23
|
-
if (args.fromMs !== undefined && s.endMs < args.fromMs)
|
|
24
|
-
return false;
|
|
25
|
-
return true;
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
getMaxSummaryLevel() {
|
|
29
|
-
calls.push({ method: 'getMaxSummaryLevel', args: undefined });
|
|
30
|
-
return opts.maxSummaryLevel ?? Math.max(0, ...summaries.map((s) => s.level));
|
|
31
|
-
},
|
|
32
|
-
getChannelTokenStats(args) {
|
|
33
|
-
calls.push({ method: 'getChannelTokenStats', args });
|
|
34
|
-
const inRange = messages.filter((m) => {
|
|
35
|
-
if (args?.fromMs !== undefined && m.ms < args.fromMs)
|
|
36
|
-
return false;
|
|
37
|
-
if (args?.toMs !== undefined && m.ms > args.toMs)
|
|
38
|
-
return false;
|
|
39
|
-
return true;
|
|
40
|
-
});
|
|
41
|
-
const byChannel = new Map();
|
|
42
|
-
let totalTokensEstimate = 0;
|
|
43
|
-
for (const m of inRange) {
|
|
44
|
-
totalTokensEstimate += m.tokens;
|
|
45
|
-
const agg = byChannel.get(m.channelId) ?? { messages: 0, tokensEstimate: 0 };
|
|
46
|
-
agg.messages++;
|
|
47
|
-
agg.tokensEstimate += m.tokens;
|
|
48
|
-
byChannel.set(m.channelId, agg);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
totalMessages: inRange.length,
|
|
52
|
-
totalTokensEstimate,
|
|
53
|
-
byChannel: [...byChannel.entries()].map(([channelId, agg]) => ({ channelId, ...agg })),
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
// Called both by HistoryModule.earliestMessageMs() (`{ toMs, limit: 1
|
|
57
|
-
// }`) and by boundaryMessagesAt() (`{ fromMs: ms, toMs: ms }`, a
|
|
58
|
-
// single-point query used for boundary-tie disambiguation) — so, unlike
|
|
59
|
-
// the previous round's stub, this now needs to return real message
|
|
60
|
-
// identity (id/sequence/metadata), not just a bare timestamp.
|
|
61
|
-
queryMessagesByTime(args) {
|
|
62
|
-
calls.push({ method: 'queryMessagesByTime', args });
|
|
63
|
-
let inRange = messages
|
|
64
|
-
.filter((m) => {
|
|
65
|
-
if (args.fromMs !== undefined && m.ms < args.fromMs)
|
|
66
|
-
return false;
|
|
67
|
-
if (args.toMs !== undefined && m.ms > args.toMs)
|
|
68
|
-
return false;
|
|
69
|
-
return true;
|
|
70
|
-
})
|
|
71
|
-
.slice()
|
|
72
|
-
.sort((a, b) => a.ms - b.ms);
|
|
73
|
-
if (args.reverse)
|
|
74
|
-
inRange = inRange.reverse();
|
|
75
|
-
const offset = args.offset ?? 0;
|
|
76
|
-
const limit = args.limit ?? inRange.length;
|
|
77
|
-
const page = inRange.slice(offset, offset + limit).map((m) => ({
|
|
78
|
-
id: m.id,
|
|
79
|
-
sequence: m.sequence,
|
|
80
|
-
timestamp: new Date(m.ms),
|
|
81
|
-
participant: 'User',
|
|
82
|
-
content: [],
|
|
83
|
-
metadata: { channelId: m.channelId },
|
|
84
|
-
}));
|
|
85
|
-
return { messages: page, matchedCount: inRange.length };
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
return { cm, calls };
|
|
89
|
-
}
|
|
90
|
-
function call(name, input) {
|
|
91
|
-
return { id: `call-${name}`, name, input };
|
|
92
|
-
}
|
|
93
|
-
function summary(id, level, startMs, endMs, content, opts = {}) {
|
|
94
|
-
return {
|
|
95
|
-
id,
|
|
96
|
-
level,
|
|
97
|
-
content,
|
|
98
|
-
tokens: content.length,
|
|
99
|
-
startMs,
|
|
100
|
-
endMs,
|
|
101
|
-
createdMs: endMs,
|
|
102
|
-
sourceIds: [`${id}-src`],
|
|
103
|
-
firstMessageId: opts.firstMessageId ?? `${id}-first`,
|
|
104
|
-
lastMessageId: opts.lastMessageId ?? `${id}-last`,
|
|
105
|
-
firstSequence: opts.firstSequence ?? Number.NEGATIVE_INFINITY,
|
|
106
|
-
lastSequence: opts.lastSequence ?? Number.POSITIVE_INFINITY,
|
|
107
|
-
...(opts.parentId ? { parentId: opts.parentId } : {}),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
describe('HistoryModule.overview', () => {
|
|
111
|
-
it('a summary-backed span appears with its content and level', async () => {
|
|
112
|
-
const { cm } = buildStub({
|
|
113
|
-
summaries: [summary('s1', 1, 1000, 2000, 'Chapter one')],
|
|
114
|
-
messages: [{ ms: 1500, channelId: 'c1', tokens: 5 }],
|
|
115
|
-
});
|
|
116
|
-
const h = new HistoryModule();
|
|
117
|
-
h.bind(cm);
|
|
118
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(2000).toISOString() }));
|
|
119
|
-
assert.equal(result.success, true, result.error);
|
|
120
|
-
const data = result.data;
|
|
121
|
-
assert.equal(data.entries.length, 1);
|
|
122
|
-
const [entry] = data.entries;
|
|
123
|
-
assert.equal(entry.summarized, true);
|
|
124
|
-
assert.equal(entry.content, 'Chapter one');
|
|
125
|
-
assert.equal(entry.level, 1);
|
|
126
|
-
assert.equal(entry.messageCount, 1);
|
|
127
|
-
assert.deepEqual(entry.byChannel.map((c) => c.channelId), ['c1']);
|
|
128
|
-
assert.equal(entry.from, new Date(1000).toISOString());
|
|
129
|
-
assert.equal(entry.to, new Date(2000).toISOString());
|
|
130
|
-
});
|
|
131
|
-
it('a gap with real messages but no summary appears as summarized:false with correct counts', async () => {
|
|
132
|
-
const { cm } = buildStub({
|
|
133
|
-
summaries: [],
|
|
134
|
-
messages: [{ ms: 10_000, channelId: 'c1', tokens: 7 }],
|
|
135
|
-
});
|
|
136
|
-
const h = new HistoryModule();
|
|
137
|
-
h.bind(cm);
|
|
138
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(0).toISOString(), to: new Date(20_000).toISOString() }));
|
|
139
|
-
assert.equal(result.success, true, result.error);
|
|
140
|
-
const data = result.data;
|
|
141
|
-
assert.equal(data.entries.length, 1);
|
|
142
|
-
const [entry] = data.entries;
|
|
143
|
-
assert.equal(entry.summarized, false);
|
|
144
|
-
assert.equal(entry.content, undefined);
|
|
145
|
-
assert.equal(entry.messageCount, 1);
|
|
146
|
-
assert.deepEqual(entry.byChannel.map((c) => c.channelId), ['c1']);
|
|
147
|
-
});
|
|
148
|
-
it('a gap with zero messages is not included', async () => {
|
|
149
|
-
const { cm } = buildStub({ summaries: [], messages: [] });
|
|
150
|
-
const h = new HistoryModule();
|
|
151
|
-
h.bind(cm);
|
|
152
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(0).toISOString(), to: new Date(20_000).toISOString() }));
|
|
153
|
-
assert.equal(result.success, true, result.error);
|
|
154
|
-
const data = result.data;
|
|
155
|
-
assert.equal(data.entries.length, 0);
|
|
156
|
-
});
|
|
157
|
-
it('fold-reduction drops a folded child when its parent is also in range', async () => {
|
|
158
|
-
const child = summary('child', 1, 1000, 2000, 'child summary', { parentId: 'parent' });
|
|
159
|
-
const parent = summary('parent', 2, 1000, 3000, 'parent summary');
|
|
160
|
-
const { cm } = buildStub({
|
|
161
|
-
summaries: [child, parent],
|
|
162
|
-
messages: [{ ms: 1500, channelId: 'c1', tokens: 5 }],
|
|
163
|
-
});
|
|
164
|
-
const h = new HistoryModule();
|
|
165
|
-
h.bind(cm);
|
|
166
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(3000).toISOString() }));
|
|
167
|
-
assert.equal(result.success, true, result.error);
|
|
168
|
-
const data = result.data;
|
|
169
|
-
// Only the coarser parent survives — the child's span is already
|
|
170
|
-
// covered by it, so showing both would duplicate the same source
|
|
171
|
-
// messages at two granularities.
|
|
172
|
-
assert.equal(data.entries.length, 1);
|
|
173
|
-
assert.equal(data.entries[0].content, 'parent summary');
|
|
174
|
-
assert.equal(data.entries[0].level, 2);
|
|
175
|
-
});
|
|
176
|
-
it('an explicit level bypasses fold-reduction, returning flat single-level results', async () => {
|
|
177
|
-
const child = summary('child', 1, 1000, 2000, 'child summary', { parentId: 'parent' });
|
|
178
|
-
const parent = summary('parent', 2, 1000, 3000, 'parent summary');
|
|
179
|
-
const { cm } = buildStub({
|
|
180
|
-
summaries: [child, parent],
|
|
181
|
-
messages: [{ ms: 1500, channelId: 'c1', tokens: 5 }],
|
|
182
|
-
});
|
|
183
|
-
const h = new HistoryModule();
|
|
184
|
-
h.bind(cm);
|
|
185
|
-
const result = await h.handleToolCall(call('overview', {
|
|
186
|
-
from: new Date(1000).toISOString(),
|
|
187
|
-
to: new Date(3000).toISOString(),
|
|
188
|
-
level: 1,
|
|
189
|
-
}));
|
|
190
|
-
assert.equal(result.success, true, result.error);
|
|
191
|
-
const data = result.data;
|
|
192
|
-
// Level explicitly pinned to 1: the child entry comes back even though
|
|
193
|
-
// it has a parentId — no reduction is applied when level is given.
|
|
194
|
-
assert.equal(data.entries.length, 1);
|
|
195
|
-
assert.equal(data.entries[0].content, 'child summary');
|
|
196
|
-
assert.equal(data.entries[0].level, 1);
|
|
197
|
-
});
|
|
198
|
-
it('channelId filtering drops empty-channel spans but keeps populated ones with unfiltered summary text', async () => {
|
|
199
|
-
const sA = summary('sA', 1, 1000, 2000, 'Channel A stuff');
|
|
200
|
-
const sB = summary('sB', 1, 3000, 4000, 'Channel B stuff mentions A too');
|
|
201
|
-
const { cm } = buildStub({
|
|
202
|
-
summaries: [sA, sB],
|
|
203
|
-
messages: [
|
|
204
|
-
{ ms: 1500, channelId: 'c1', tokens: 5 },
|
|
205
|
-
{ ms: 3500, channelId: 'c2', tokens: 5 },
|
|
206
|
-
],
|
|
207
|
-
});
|
|
208
|
-
const h = new HistoryModule();
|
|
209
|
-
h.bind(cm);
|
|
210
|
-
const result = await h.handleToolCall(call('overview', {
|
|
211
|
-
from: new Date(1000).toISOString(),
|
|
212
|
-
to: new Date(4000).toISOString(),
|
|
213
|
-
channelId: 'c1',
|
|
214
|
-
}));
|
|
215
|
-
assert.equal(result.success, true, result.error);
|
|
216
|
-
const data = result.data;
|
|
217
|
-
assert.equal(data.entries.length, 1);
|
|
218
|
-
// sB is dropped (zero c1 messages in its span); sA's summary content is
|
|
219
|
-
// kept whole/unfiltered — compression doesn't chunk per-channel.
|
|
220
|
-
assert.equal(data.entries[0].content, 'Channel A stuff');
|
|
221
|
-
assert.deepEqual(data.entries[0].byChannel.map((c) => c.channelId), ['c1']);
|
|
222
|
-
});
|
|
223
|
-
it('reports maxLevelAvailable (not a misleading single `level`) when level is omitted (finding #10)', async () => {
|
|
224
|
-
const { cm } = buildStub({
|
|
225
|
-
summaries: [summary('s1', 3, 1000, 2000, 'top level summary')],
|
|
226
|
-
messages: [],
|
|
227
|
-
maxSummaryLevel: 3,
|
|
228
|
-
});
|
|
229
|
-
const h = new HistoryModule();
|
|
230
|
-
h.bind(cm);
|
|
231
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(2000).toISOString() }));
|
|
232
|
-
assert.equal(result.success, true, result.error);
|
|
233
|
-
const data = result.data;
|
|
234
|
-
assert.equal(data.maxLevelAvailable, 3);
|
|
235
|
-
assert.equal(data.level, undefined, 'a single `level` number would be misleading for a mixed-level default result');
|
|
236
|
-
});
|
|
237
|
-
it('echoes back the exact `level` requested when one was given (finding #10)', async () => {
|
|
238
|
-
const { cm } = buildStub({
|
|
239
|
-
summaries: [summary('s1', 1, 1000, 2000, 'a level-1 summary')],
|
|
240
|
-
messages: [],
|
|
241
|
-
});
|
|
242
|
-
const h = new HistoryModule();
|
|
243
|
-
h.bind(cm);
|
|
244
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(2000).toISOString(), level: 1 }));
|
|
245
|
-
assert.equal(result.success, true, result.error);
|
|
246
|
-
const data = result.data;
|
|
247
|
-
assert.equal(data.level, 1);
|
|
248
|
-
assert.equal(data.maxLevelAvailable, undefined);
|
|
249
|
-
});
|
|
250
|
-
it('channelId scopes messageCount/tokensEstimate to that channel, keeping whole-span totals under span* keys (finding #7)', async () => {
|
|
251
|
-
const s1 = summary('s1', 1, 1000, 2000, 'mixed-channel chapter');
|
|
252
|
-
const { cm } = buildStub({
|
|
253
|
-
summaries: [s1],
|
|
254
|
-
messages: [
|
|
255
|
-
{ ms: 1100, channelId: 'c1', tokens: 10 },
|
|
256
|
-
{ ms: 1200, channelId: 'c1', tokens: 10 },
|
|
257
|
-
{ ms: 1300, channelId: 'c2', tokens: 100 },
|
|
258
|
-
],
|
|
259
|
-
});
|
|
260
|
-
const h = new HistoryModule();
|
|
261
|
-
h.bind(cm);
|
|
262
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(2000).toISOString(), channelId: 'c1' }));
|
|
263
|
-
assert.equal(result.success, true, result.error);
|
|
264
|
-
const data = result.data;
|
|
265
|
-
assert.equal(data.entries.length, 1);
|
|
266
|
-
const [entry] = data.entries;
|
|
267
|
-
// Scoped to c1 only: 2 messages, 20 tokens — NOT the whole span's 3
|
|
268
|
-
// messages / 120 tokens (which the numeric fields used to report even
|
|
269
|
-
// when the caller had narrowed to one channel).
|
|
270
|
-
assert.equal(entry.messageCount, 2);
|
|
271
|
-
assert.equal(entry.tokensEstimate, 20);
|
|
272
|
-
assert.equal(entry.spanMessageCount, 3);
|
|
273
|
-
assert.equal(entry.spanTokensEstimate, 120);
|
|
274
|
-
});
|
|
275
|
-
it('two adjacent summaries with a wide seam but zero real unsummarized traffic produce NO fabricated gap entry (finding #1)', async () => {
|
|
276
|
-
const s1 = summary('s1', 1, 1000, 1005, 'first chapter');
|
|
277
|
-
const s2 = summary('s2', 1, 20_000, 20_005, 'second chapter');
|
|
278
|
-
const { cm } = buildStub({
|
|
279
|
-
summaries: [s1, s2],
|
|
280
|
-
// Only the boundary messages anchoring each summary's own span exist
|
|
281
|
-
// — nothing real happened between ms 1006 and ms 19999.
|
|
282
|
-
// getChannelTokenStats's range is BOTH-ENDS INCLUSIVE, so a naive
|
|
283
|
-
// probe of [1005, 20000] would re-count these two boundary messages
|
|
284
|
-
// (already inside their own summaries) and fabricate a phantom gap.
|
|
285
|
-
messages: [
|
|
286
|
-
{ ms: 1000, channelId: 'c1', tokens: 5 },
|
|
287
|
-
{ ms: 1005, channelId: 'c1', tokens: 5 },
|
|
288
|
-
{ ms: 20_000, channelId: 'c1', tokens: 5 },
|
|
289
|
-
{ ms: 20_005, channelId: 'c1', tokens: 5 },
|
|
290
|
-
],
|
|
291
|
-
});
|
|
292
|
-
const h = new HistoryModule();
|
|
293
|
-
h.bind(cm);
|
|
294
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(20_005).toISOString() }));
|
|
295
|
-
assert.equal(result.success, true, result.error);
|
|
296
|
-
const data = result.data;
|
|
297
|
-
assert.equal(data.entries.length, 2, `expected exactly the two summaries, got ${JSON.stringify(data.entries)}`);
|
|
298
|
-
assert.ok(data.entries.every((e) => e.summarized), 'no fabricated summarized:false gap entry should appear between adjacent summaries');
|
|
299
|
-
});
|
|
300
|
-
it('overview({}) with real messages but zero summaries minted returns a summarized:false entry, not an empty array (finding #4)', async () => {
|
|
301
|
-
const { cm } = buildStub({
|
|
302
|
-
summaries: [],
|
|
303
|
-
messages: [
|
|
304
|
-
{ ms: 1_000_000, channelId: 'c1', tokens: 5 },
|
|
305
|
-
{ ms: 1_000_100, channelId: 'c1', tokens: 5 },
|
|
306
|
-
],
|
|
307
|
-
});
|
|
308
|
-
const h = new HistoryModule();
|
|
309
|
-
h.bind(cm);
|
|
310
|
-
const result = await h.handleToolCall(call('overview', {}));
|
|
311
|
-
assert.equal(result.success, true, result.error);
|
|
312
|
-
const data = result.data;
|
|
313
|
-
assert.equal(data.entries.length, 1);
|
|
314
|
-
assert.equal(data.entries[0].summarized, false);
|
|
315
|
-
assert.equal(data.entries[0].messageCount, 2);
|
|
316
|
-
assert.equal(data.entries[0].from, new Date(1_000_000).toISOString());
|
|
317
|
-
});
|
|
318
|
-
it('overview({}) against a genuinely empty store returns entries:[] without crashing (finding #4, empty-store edge)', async () => {
|
|
319
|
-
const { cm } = buildStub({ summaries: [], messages: [] });
|
|
320
|
-
const h = new HistoryModule();
|
|
321
|
-
h.bind(cm);
|
|
322
|
-
const result = await h.handleToolCall(call('overview', {}));
|
|
323
|
-
assert.equal(result.success, true, result.error);
|
|
324
|
-
const data = result.data;
|
|
325
|
-
assert.equal(data.entries.length, 0);
|
|
326
|
-
});
|
|
327
|
-
it('unsummarized messages older than the earliest summary still appear when `from` is omitted (finding #6)', async () => {
|
|
328
|
-
const s1 = summary('s1', 1, 50_000, 51_000, 'a later chapter');
|
|
329
|
-
const { cm } = buildStub({
|
|
330
|
-
summaries: [s1],
|
|
331
|
-
messages: [
|
|
332
|
-
{ ms: 1000, channelId: 'c1', tokens: 5 }, // predates every summary
|
|
333
|
-
{ ms: 50_500, channelId: 'c1', tokens: 5 },
|
|
334
|
-
],
|
|
335
|
-
});
|
|
336
|
-
const h = new HistoryModule();
|
|
337
|
-
h.bind(cm);
|
|
338
|
-
const result = await h.handleToolCall(call('overview', { to: new Date(51_000).toISOString() }));
|
|
339
|
-
assert.equal(result.success, true, result.error);
|
|
340
|
-
const data = result.data;
|
|
341
|
-
// Must see BOTH the old unsummarized message (as a summarized:false gap
|
|
342
|
-
// before the summary) AND the summary itself — starting the walk at the
|
|
343
|
-
// first summary's own startMs would silently make pre-compression
|
|
344
|
-
// history invisible.
|
|
345
|
-
assert.equal(data.entries.length, 2, `expected the old gap AND the summary, got ${JSON.stringify(data.entries)}`);
|
|
346
|
-
assert.equal(data.entries[0].summarized, false);
|
|
347
|
-
assert.equal(data.entries[0].messageCount, 1);
|
|
348
|
-
assert.equal(data.entries[1].summarized, true);
|
|
349
|
-
});
|
|
350
|
-
it('a broken ancestor chain (unresolvable intermediate level) still reduces via span-containment (finding #5)', async () => {
|
|
351
|
-
// L2 is deliberately absent from the fetched set — simulating
|
|
352
|
-
// context-manager's listSummariesInRange silently skipping an
|
|
353
|
-
// intermediate level whose source range no longer resolves (a
|
|
354
|
-
// pruned/redacted source message, or a viewFilter exclusion). L1's
|
|
355
|
-
// parentId still points at 'L2', but 'L2' never comes back from
|
|
356
|
-
// getSummariesInRange, so the immediate-parent check alone can't see
|
|
357
|
-
// past the gap in the chain.
|
|
358
|
-
const l1 = summary('L1', 1, 1000, 1500, 'l1 detail', { parentId: 'L2' });
|
|
359
|
-
const l3 = summary('L3', 3, 1000, 3000, 'l3 grandparent, covers L1 fully');
|
|
360
|
-
const { cm } = buildStub({
|
|
361
|
-
summaries: [l1, l3],
|
|
362
|
-
messages: [{ ms: 1200, channelId: 'c1', tokens: 5 }],
|
|
363
|
-
});
|
|
364
|
-
const h = new HistoryModule();
|
|
365
|
-
h.bind(cm);
|
|
366
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(3000).toISOString() }));
|
|
367
|
-
assert.equal(result.success, true, result.error);
|
|
368
|
-
const data = result.data;
|
|
369
|
-
// Without the containment-sweep backstop, L1 would incorrectly survive
|
|
370
|
-
// alongside L3 — its immediate parentId 'L2' isn't in the fetched set,
|
|
371
|
-
// so the parentId-only check can't tell it's superseded.
|
|
372
|
-
assert.equal(data.entries.length, 1, `expected only L3 to survive, got ${JSON.stringify(data.entries.map((e) => e.content))}`);
|
|
373
|
-
assert.equal(data.entries[0].content, 'l3 grandparent, covers L1 fully');
|
|
374
|
-
assert.equal(data.entries[0].level, 3);
|
|
375
|
-
});
|
|
376
|
-
it('a query window narrower than the old (now-removed) width threshold still finds real messages within it (finding #1 completeness)', async () => {
|
|
377
|
-
const { cm } = buildStub({
|
|
378
|
-
summaries: [],
|
|
379
|
-
messages: [
|
|
380
|
-
{ ms: 500, channelId: 'c1', tokens: 5 },
|
|
381
|
-
{ ms: 1500, channelId: 'c1', tokens: 5 },
|
|
382
|
-
{ ms: 2500, channelId: 'c1', tokens: 5 },
|
|
383
|
-
],
|
|
384
|
-
});
|
|
385
|
-
const h = new HistoryModule();
|
|
386
|
-
h.bind(cm);
|
|
387
|
-
// 3-second window — narrower than the old (now-removed) 5-second gate.
|
|
388
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(0).toISOString(), to: new Date(3000).toISOString() }));
|
|
389
|
-
assert.equal(result.success, true, result.error);
|
|
390
|
-
const data = result.data;
|
|
391
|
-
assert.equal(data.entries.length, 1, `expected the 3 messages to surface as one gap entry, got ${JSON.stringify(data.entries)}`);
|
|
392
|
-
assert.equal(data.entries[0].summarized, false);
|
|
393
|
-
assert.equal(data.entries[0].messageCount, 3);
|
|
394
|
-
});
|
|
395
|
-
it('a narrow (<5s) seam between two summaries with real messages in it is found, not silently dropped (finding #1 completeness)', async () => {
|
|
396
|
-
const s1 = summary('s1', 1, 1000, 1500, 'first chapter');
|
|
397
|
-
const s2 = summary('s2', 1, 4000, 4500, 'second chapter');
|
|
398
|
-
const { cm } = buildStub({
|
|
399
|
-
summaries: [s1, s2],
|
|
400
|
-
messages: [
|
|
401
|
-
{ ms: 1200, channelId: 'c1', tokens: 5 },
|
|
402
|
-
{ ms: 2500, channelId: 'c1', tokens: 5 }, // sits in the ~2.5s seam between s1 and s2
|
|
403
|
-
{ ms: 4200, channelId: 'c1', tokens: 5 },
|
|
404
|
-
],
|
|
405
|
-
});
|
|
406
|
-
const h = new HistoryModule();
|
|
407
|
-
h.bind(cm);
|
|
408
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(4500).toISOString() }));
|
|
409
|
-
assert.equal(result.success, true, result.error);
|
|
410
|
-
const data = result.data;
|
|
411
|
-
assert.equal(data.entries.length, 3, `expected s1, the seam gap, and s2, got ${JSON.stringify(data.entries)}`);
|
|
412
|
-
assert.equal(data.entries[0].summarized, true);
|
|
413
|
-
assert.equal(data.entries[1].summarized, false);
|
|
414
|
-
assert.equal(data.entries[1].messageCount, 1);
|
|
415
|
-
assert.equal(data.entries[2].summarized, true);
|
|
416
|
-
});
|
|
417
|
-
it('an inverted from > to range is rejected with a clear error instead of silently returning empty', async () => {
|
|
418
|
-
const { cm } = buildStub({ summaries: [], messages: [] });
|
|
419
|
-
const h = new HistoryModule();
|
|
420
|
-
h.bind(cm);
|
|
421
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(5000).toISOString(), to: new Date(1000).toISOString() }));
|
|
422
|
-
assert.equal(result.success, false);
|
|
423
|
-
assert.equal(result.isError, true);
|
|
424
|
-
assert.match(result.error ?? '', /must not be after/);
|
|
425
|
-
});
|
|
426
|
-
it('caps the entry list at an explicit `limit`, keeping the most recent spans and signaling truncated/totalSpans (no-cap finding)', async () => {
|
|
427
|
-
const summaries = Array.from({ length: 5 }, (_, i) => summary(`s${i}`, 1, 1000 + i * 10_000, 1000 + i * 10_000 + 100, `chapter ${i}`));
|
|
428
|
-
const { cm } = buildStub({ summaries, messages: [] });
|
|
429
|
-
const h = new HistoryModule();
|
|
430
|
-
h.bind(cm);
|
|
431
|
-
const result = await h.handleToolCall(call('overview', {
|
|
432
|
-
from: new Date(0).toISOString(),
|
|
433
|
-
to: new Date(1000 + 4 * 10_000 + 100).toISOString(),
|
|
434
|
-
limit: 2,
|
|
435
|
-
}));
|
|
436
|
-
assert.equal(result.success, true, result.error);
|
|
437
|
-
const data = result.data;
|
|
438
|
-
assert.equal(data.truncated, true);
|
|
439
|
-
assert.equal(data.totalSpans, 5);
|
|
440
|
-
assert.equal(data.entries.length, 2);
|
|
441
|
-
// Most recent 2 of the 5 chapters (indices 3 and 4), still in
|
|
442
|
-
// chronological order within the (capped) response.
|
|
443
|
-
assert.equal(data.entries[0].content, 'chapter 3');
|
|
444
|
-
assert.equal(data.entries[1].content, 'chapter 4');
|
|
445
|
-
});
|
|
446
|
-
it('limit:0 returns zero entries, not the whole list (slice(-0) negative-zero regression)', async () => {
|
|
447
|
-
// clampCount explicitly accepts 0 as a valid non-negative integer — the
|
|
448
|
-
// same class of bug search/extract already had fixed once: `slice(-0)`
|
|
449
|
-
// coerces to `slice(0)` (the WHOLE array) rather than "nothing", so a
|
|
450
|
-
// naive `filtered.slice(-limit)` cap silently reports truncated:true
|
|
451
|
-
// while returning everything.
|
|
452
|
-
const summaries = Array.from({ length: 5 }, (_, i) => summary(`s${i}`, 1, 1000 + i * 10_000, 1000 + i * 10_000 + 100, `chapter ${i}`));
|
|
453
|
-
const { cm } = buildStub({ summaries, messages: [] });
|
|
454
|
-
const h = new HistoryModule();
|
|
455
|
-
h.bind(cm);
|
|
456
|
-
const result = await h.handleToolCall(call('overview', {
|
|
457
|
-
from: new Date(0).toISOString(),
|
|
458
|
-
to: new Date(1000 + 4 * 10_000 + 100).toISOString(),
|
|
459
|
-
limit: 0,
|
|
460
|
-
}));
|
|
461
|
-
assert.equal(result.success, true, result.error);
|
|
462
|
-
const data = result.data;
|
|
463
|
-
assert.equal(data.entries.length, 0);
|
|
464
|
-
assert.equal(data.totalSpans, 5);
|
|
465
|
-
assert.equal(data.truncated, true);
|
|
466
|
-
});
|
|
467
|
-
it('caps at the DEFAULT limit (50) when more entries exist than that, with no explicit limit param (no-cap finding)', async () => {
|
|
468
|
-
const summaries = Array.from({ length: 55 }, (_, i) => summary(`s${i}`, 1, i * 10_000, i * 10_000 + 100, `chapter ${i}`));
|
|
469
|
-
const { cm } = buildStub({ summaries, messages: [] });
|
|
470
|
-
const h = new HistoryModule();
|
|
471
|
-
h.bind(cm);
|
|
472
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(0).toISOString(), to: new Date(55 * 10_000).toISOString() }));
|
|
473
|
-
assert.equal(result.success, true, result.error);
|
|
474
|
-
const data = result.data;
|
|
475
|
-
assert.equal(data.totalSpans, 55);
|
|
476
|
-
assert.equal(data.truncated, true);
|
|
477
|
-
assert.equal(data.entries.length, 50);
|
|
478
|
-
assert.equal(data.entries[0].content, 'chapter 5');
|
|
479
|
-
assert.equal(data.entries[49].content, 'chapter 54');
|
|
480
|
-
});
|
|
481
|
-
it('a zero-width entry sharing exactly one boundary millisecond with an unrelated coarser entry survives (containment false-positive finding)', async () => {
|
|
482
|
-
// L1 is a tiny (zero-width) chunk landing entirely at ms=2000. L2 is a
|
|
483
|
-
// completely UNRELATED, later, coarser summary that happens to start at
|
|
484
|
-
// exactly the same millisecond — not L1's parent or ancestor.
|
|
485
|
-
const l1 = summary('L1', 1, 2000, 2000, 'zero-width chunk');
|
|
486
|
-
const l2 = summary('L2', 2, 2000, 5000, 'unrelated later chapter');
|
|
487
|
-
const { cm } = buildStub({
|
|
488
|
-
summaries: [l1, l2],
|
|
489
|
-
messages: [{ ms: 2000, channelId: 'c1', tokens: 5 }],
|
|
490
|
-
});
|
|
491
|
-
const h = new HistoryModule();
|
|
492
|
-
h.bind(cm);
|
|
493
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(2000).toISOString(), to: new Date(5000).toISOString() }));
|
|
494
|
-
assert.equal(result.success, true, result.error);
|
|
495
|
-
const data = result.data;
|
|
496
|
-
const contents = data.entries.map((e) => e.content).sort();
|
|
497
|
-
assert.deepEqual(contents, ['unrelated later chapter', 'zero-width chunk']);
|
|
498
|
-
});
|
|
499
|
-
it('a message sitting exactly at an explicit `from` bound is not skipped by the half-open nudge (leading-gap, non-anchor case)', async () => {
|
|
500
|
-
const s1 = summary('s1', 1, 10_000, 11_000, 'later chapter');
|
|
501
|
-
const { cm } = buildStub({
|
|
502
|
-
summaries: [s1],
|
|
503
|
-
// This message sits EXACTLY at the caller-supplied `from` — the
|
|
504
|
-
// cursorIsEntryBoundary===false path (fromMs actually supplied, not
|
|
505
|
-
// the earliest-message-anchor case) must probe it inclusively, not
|
|
506
|
-
// nudge it away the way an interior/trailing gap's cursor is nudged.
|
|
507
|
-
messages: [{ ms: 5000, channelId: 'c1', tokens: 5 }],
|
|
508
|
-
});
|
|
509
|
-
const h = new HistoryModule();
|
|
510
|
-
h.bind(cm);
|
|
511
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(5000).toISOString(), to: new Date(11_000).toISOString() }));
|
|
512
|
-
assert.equal(result.success, true, result.error);
|
|
513
|
-
const data = result.data;
|
|
514
|
-
assert.equal(data.entries.length, 2, `expected the leading gap AND the summary, got ${JSON.stringify(data.entries)}`);
|
|
515
|
-
assert.equal(data.entries[0].summarized, false);
|
|
516
|
-
assert.equal(data.entries[0].messageCount, 1);
|
|
517
|
-
assert.equal(data.entries[0].from, new Date(5000).toISOString());
|
|
518
|
-
});
|
|
519
|
-
it("reviewer's exact repro: two distinct messages sharing a timestamp, only one covered by a summary — both correctly and separately accounted for (boundary-tie finding)", async () => {
|
|
520
|
-
const T = 5000;
|
|
521
|
-
const { cm } = buildStub({
|
|
522
|
-
summaries: [
|
|
523
|
-
summary('s1', 1, T, T, 'covers FIRST only', {
|
|
524
|
-
firstSequence: 10,
|
|
525
|
-
lastSequence: 10,
|
|
526
|
-
firstMessageId: 'FIRST',
|
|
527
|
-
lastMessageId: 'FIRST',
|
|
528
|
-
}),
|
|
529
|
-
],
|
|
530
|
-
messages: [
|
|
531
|
-
{ id: 'FIRST', sequence: 10, ms: T, channelId: 'c1', tokens: 5 },
|
|
532
|
-
{ id: 'SECOND', sequence: 11, ms: T, channelId: 'c1', tokens: 7 },
|
|
533
|
-
],
|
|
534
|
-
});
|
|
535
|
-
const h = new HistoryModule();
|
|
536
|
-
h.bind(cm);
|
|
537
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(T).toISOString(), to: new Date(T).toISOString() }));
|
|
538
|
-
assert.equal(result.success, true, result.error);
|
|
539
|
-
const data = result.data;
|
|
540
|
-
const summarizedEntries = data.entries.filter((e) => e.summarized);
|
|
541
|
-
const gapEntries = data.entries.filter((e) => !e.summarized);
|
|
542
|
-
assert.equal(summarizedEntries.length, 1, `expected exactly one summary entry, got ${JSON.stringify(data.entries)}`);
|
|
543
|
-
assert.equal(gapEntries.length, 1, `expected SECOND to surface as its own gap entry, got ${JSON.stringify(data.entries)}`);
|
|
544
|
-
// FIRST alone — SECOND must no longer be silently folded into the
|
|
545
|
-
// summary's own count (the reported bug: messageCount: 2 for a summary
|
|
546
|
-
// that only ever covered FIRST).
|
|
547
|
-
assert.equal(summarizedEntries[0].messageCount, 1);
|
|
548
|
-
assert.equal(summarizedEntries[0].boundaryUncertain, true);
|
|
549
|
-
// SECOND, correctly surfaced as unsummarized — not silently dropped.
|
|
550
|
-
assert.equal(gapEntries[0].messageCount, 1);
|
|
551
|
-
assert.equal(gapEntries[0].boundaryUncertain, true);
|
|
552
|
-
// Nothing lost, nothing double-counted across the whole response.
|
|
553
|
-
const totalMessages = data.entries.reduce((n, e) => n + e.messageCount, 0);
|
|
554
|
-
assert.equal(totalMessages, 2);
|
|
555
|
-
});
|
|
556
|
-
it('a boundary tie between two DIFFERENT channels splits byChannel correctly', async () => {
|
|
557
|
-
const T = 8000;
|
|
558
|
-
const { cm } = buildStub({
|
|
559
|
-
summaries: [
|
|
560
|
-
summary('s1', 1, T, T, 'covers FIRST only', {
|
|
561
|
-
firstSequence: 1,
|
|
562
|
-
lastSequence: 1,
|
|
563
|
-
firstMessageId: 'FIRST',
|
|
564
|
-
lastMessageId: 'FIRST',
|
|
565
|
-
}),
|
|
566
|
-
],
|
|
567
|
-
messages: [
|
|
568
|
-
{ id: 'FIRST', sequence: 1, ms: T, channelId: 'c1', tokens: 5 },
|
|
569
|
-
{ id: 'SECOND', sequence: 2, ms: T, channelId: 'c2', tokens: 9 },
|
|
570
|
-
],
|
|
571
|
-
});
|
|
572
|
-
const h = new HistoryModule();
|
|
573
|
-
h.bind(cm);
|
|
574
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(T).toISOString(), to: new Date(T).toISOString() }));
|
|
575
|
-
assert.equal(result.success, true, result.error);
|
|
576
|
-
const data = result.data;
|
|
577
|
-
const summarizedEntry = data.entries.find((e) => e.summarized);
|
|
578
|
-
const gapEntry = data.entries.find((e) => !e.summarized);
|
|
579
|
-
assert.deepEqual(summarizedEntry.byChannel.map((c) => c.channelId), ['c1']);
|
|
580
|
-
assert.deepEqual(gapEntry.byChannel.map((c) => c.channelId), ['c2']);
|
|
581
|
-
});
|
|
582
|
-
it('a tied boundary between two ADJACENT summaries routes each stray message back to its true owner, without fabricating a spurious gap', async () => {
|
|
583
|
-
// E's last covered message and F's first covered message happen to
|
|
584
|
-
// share the exact same millisecond (both summaries' sourceRanges are
|
|
585
|
-
// genuinely disjoint by SEQUENCE — this is a timestamp coincidence,
|
|
586
|
-
// not a real overlap). Neither message is actually unsummarized, so no
|
|
587
|
-
// gap should appear at all: each summary's stray gets attributed back
|
|
588
|
-
// to the OTHER summary, which already counts it correctly via its own
|
|
589
|
-
// inclusive-range call.
|
|
590
|
-
const tieMs = 9000;
|
|
591
|
-
const { cm } = buildStub({
|
|
592
|
-
summaries: [
|
|
593
|
-
summary('E', 1, 1000, tieMs, 'chapter E', { firstSequence: 0, lastSequence: 1, firstMessageId: 'e1', lastMessageId: 'e2' }),
|
|
594
|
-
summary('F', 1, tieMs, 20000, 'chapter F', { firstSequence: 2, lastSequence: 3, firstMessageId: 'f1', lastMessageId: 'f2' }),
|
|
595
|
-
],
|
|
596
|
-
messages: [
|
|
597
|
-
{ id: 'e1', sequence: 0, ms: 1000, channelId: 'c1', tokens: 5 },
|
|
598
|
-
{ id: 'e2', sequence: 1, ms: tieMs, channelId: 'c1', tokens: 5 }, // E's own last message
|
|
599
|
-
{ id: 'f1', sequence: 2, ms: tieMs, channelId: 'c1', tokens: 5 }, // F's own first message — SAME ms as e2
|
|
600
|
-
{ id: 'f2', sequence: 3, ms: 20_000, channelId: 'c1', tokens: 5 },
|
|
601
|
-
],
|
|
602
|
-
});
|
|
603
|
-
const h = new HistoryModule();
|
|
604
|
-
h.bind(cm);
|
|
605
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(20_000).toISOString() }));
|
|
606
|
-
assert.equal(result.success, true, result.error);
|
|
607
|
-
const data = result.data;
|
|
608
|
-
assert.equal(data.entries.length, 2, `expected only E and F, no spurious gap, got ${JSON.stringify(data.entries)}`);
|
|
609
|
-
assert.ok(data.entries.every((e) => e.summarized), 'no unsummarized gap should be fabricated for a tie between two real summaries');
|
|
610
|
-
const e = data.entries.find((x) => x.content === 'chapter E');
|
|
611
|
-
const f = data.entries.find((x) => x.content === 'chapter F');
|
|
612
|
-
assert.equal(e.messageCount, 2, "E should report its own 2 genuine messages (e1, e2), not F's stray f1");
|
|
613
|
-
assert.equal(f.messageCount, 2, "F should report its own 2 genuine messages (f1, f2), not E's stray e2");
|
|
614
|
-
assert.equal(e.boundaryUncertain, true);
|
|
615
|
-
assert.equal(f.boundaryUncertain, true);
|
|
616
|
-
});
|
|
617
|
-
it('a genuinely-unsummarized stray at a millisecond shared by two adjacent summaries is counted ONCE, not merged into two duplicate gaps', async () => {
|
|
618
|
-
// Same shape as the previous test (E ends and F starts at the same ms),
|
|
619
|
-
// but this time a THIRD, genuinely-unsummarized message (STRAY) also
|
|
620
|
-
// sits at that exact millisecond, with a sequence between E's and F's
|
|
621
|
-
// ranges. Both E's and F's correction passes independently discover
|
|
622
|
-
// STRAY is foreign to them and belongs to neither the other summary —
|
|
623
|
-
// each, considered alone, would call mergeForeignIntoGap for it. Without
|
|
624
|
-
// cross-entry dedup, mergeForeignIntoGap's adjacent-only gap lookup
|
|
625
|
-
// can't see the OTHER entry's just-created point-width gap one step
|
|
626
|
-
// away, so STRAY would land in two separate gap entries — double
|
|
627
|
-
// counted. It must appear exactly once.
|
|
628
|
-
const tieMs = 9000;
|
|
629
|
-
const { cm } = buildStub({
|
|
630
|
-
summaries: [
|
|
631
|
-
summary('E', 1, 1000, tieMs, 'chapter E', { firstSequence: 0, lastSequence: 1, firstMessageId: 'e1', lastMessageId: 'e2' }),
|
|
632
|
-
summary('F', 1, tieMs, 20000, 'chapter F', { firstSequence: 3, lastSequence: 4, firstMessageId: 'f1', lastMessageId: 'f2' }),
|
|
633
|
-
],
|
|
634
|
-
messages: [
|
|
635
|
-
{ id: 'e1', sequence: 0, ms: 1000, channelId: 'c1', tokens: 5 },
|
|
636
|
-
{ id: 'e2', sequence: 1, ms: tieMs, channelId: 'c1', tokens: 5 }, // E's own last message
|
|
637
|
-
{ id: 'stray', sequence: 2, ms: tieMs, channelId: 'c1', tokens: 5 }, // genuinely unsummarized, sequence between E and F
|
|
638
|
-
{ id: 'f1', sequence: 3, ms: tieMs, channelId: 'c1', tokens: 5 }, // F's own first message
|
|
639
|
-
{ id: 'f2', sequence: 4, ms: 20_000, channelId: 'c1', tokens: 5 },
|
|
640
|
-
],
|
|
641
|
-
});
|
|
642
|
-
const h = new HistoryModule();
|
|
643
|
-
h.bind(cm);
|
|
644
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(1000).toISOString(), to: new Date(20_000).toISOString() }));
|
|
645
|
-
assert.equal(result.success, true, result.error);
|
|
646
|
-
const data = result.data;
|
|
647
|
-
const gapEntries = data.entries.filter((e) => !e.summarized);
|
|
648
|
-
assert.equal(gapEntries.length, 1, `STRAY must appear in exactly one gap entry, not ${gapEntries.length}: ${JSON.stringify(gapEntries)}`);
|
|
649
|
-
assert.equal(gapEntries[0].messageCount, 1);
|
|
650
|
-
const totalMessageCount = data.entries.reduce((sum, e) => sum + e.messageCount, 0);
|
|
651
|
-
assert.equal(totalMessageCount, 5, `all 5 real messages must be counted exactly once across the whole response, got ${totalMessageCount}`);
|
|
652
|
-
});
|
|
653
|
-
it("the boundary-tie correction pass does not synthesize a gap OUTSIDE the caller's requested range (finding: out-of-range phantom gap)", async () => {
|
|
654
|
-
// getSummariesInRange intentionally returns WHOLE overlapping summaries
|
|
655
|
-
// — this one spans 1000-10000ms, well beyond the narrow window actually
|
|
656
|
-
// queried below. Two genuinely-unsummarized messages sit tied at the
|
|
657
|
-
// summary's OWN far boundaries (1000 and 10000) — outside [5000,6000],
|
|
658
|
-
// the actual requested range. The correction pass must still correct
|
|
659
|
-
// the summary's own messageCount (it's being returned either way,
|
|
660
|
-
// regardless of range), but must NOT fabricate summarized:false gap
|
|
661
|
-
// entries anchored at 1000/10000 — those boundaries are outside
|
|
662
|
-
// anything the caller asked about, and the ordinary (non-correction)
|
|
663
|
-
// gap walk elsewhere in this function already respects that same rule.
|
|
664
|
-
const { cm } = buildStub({
|
|
665
|
-
summaries: [
|
|
666
|
-
summary('S', 1, 1000, 10000, 'wide chapter', { firstSequence: 1, lastSequence: 3, firstMessageId: 's1', lastMessageId: 's2' }),
|
|
667
|
-
],
|
|
668
|
-
messages: [
|
|
669
|
-
{ id: 'leading-stray', sequence: 0, ms: 1000, channelId: 'c1', tokens: 5 }, // tied with S's own start, outside the query
|
|
670
|
-
{ id: 's1', sequence: 1, ms: 1000, channelId: 'c1', tokens: 5 }, // S's own first message
|
|
671
|
-
{ id: 'mid', sequence: 2, ms: 5500, channelId: 'c1', tokens: 5 }, // the only message actually inside the query window
|
|
672
|
-
{ id: 's2', sequence: 3, ms: 10000, channelId: 'c1', tokens: 5 }, // S's own last message
|
|
673
|
-
{ id: 'trailing-stray', sequence: 4, ms: 10000, channelId: 'c1', tokens: 5 }, // tied with S's own end, outside the query
|
|
674
|
-
],
|
|
675
|
-
});
|
|
676
|
-
const h = new HistoryModule();
|
|
677
|
-
h.bind(cm);
|
|
678
|
-
const result = await h.handleToolCall(call('overview', { from: new Date(5000).toISOString(), to: new Date(6000).toISOString() }));
|
|
679
|
-
assert.equal(result.success, true, result.error);
|
|
680
|
-
const data = result.data;
|
|
681
|
-
const gapEntries = data.entries.filter((e) => !e.summarized);
|
|
682
|
-
assert.equal(gapEntries.length, 0, `no gap should be synthesized outside the requested [5000,6000] range, got ${JSON.stringify(gapEntries)}`);
|
|
683
|
-
// The summary itself is still returned (it overlaps the query), and its
|
|
684
|
-
// corrected messageCount still excludes the two out-of-range strays —
|
|
685
|
-
// they were never part of this summary regardless of where the caller
|
|
686
|
-
// happened to query.
|
|
687
|
-
const [summaryEntry] = data.entries;
|
|
688
|
-
assert.equal(summaryEntry?.summarized, true);
|
|
689
|
-
// S's genuine messages are s1 (seq 1), mid (seq 2), s2 (seq 3) — three
|
|
690
|
-
// distinct messages whose sequence falls in S's own [1,3] range. The
|
|
691
|
-
// two strays (seq 0 and seq 4) are correctly subtracted regardless of
|
|
692
|
-
// where the caller happened to query — that correction is unconditional
|
|
693
|
-
// (see subtractMessagesFromStats above); only the SYNTHESIS of a new
|
|
694
|
-
// gap entry for them is what needed to respect the query range.
|
|
695
|
-
assert.equal(summaryEntry?.messageCount, 3, 'S should report its 3 genuine messages (s1, mid, s2), with the two out-of-range strays correctly subtracted but no gap entry synthesized for them');
|
|
696
|
-
});
|
|
697
|
-
it('surfaces the capability-absent error as a clean tool error, not a crash', async () => {
|
|
698
|
-
const cm = {
|
|
699
|
-
getSummariesInRange() {
|
|
700
|
-
throw new Error('Chronicle history index unsupported: native field-index capability absent on this chronicle build.');
|
|
701
|
-
},
|
|
702
|
-
};
|
|
703
|
-
const h = new HistoryModule();
|
|
704
|
-
h.bind(cm);
|
|
705
|
-
const result = await h.handleToolCall(call('overview', {}));
|
|
706
|
-
assert.equal(result.success, false);
|
|
707
|
-
assert.equal(result.isError, true);
|
|
708
|
-
assert.match(result.error ?? '', /Chronicle history index unsupported/);
|
|
709
|
-
});
|
|
710
|
-
});
|
|
711
|
-
//# sourceMappingURL=history-module-overview.test.js.map
|