@animalabs/agent-framework 0.22.1 → 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 +4 -2
- package/dist/src/agent.d.ts +266 -28
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +539 -104
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/mcp-server-core.d.ts +41 -0
- package/dist/src/api/mcp-server-core.d.ts.map +1 -0
- package/dist/src/api/mcp-server-core.js +593 -0
- package/dist/src/api/mcp-server-core.js.map +1 -0
- package/dist/src/api/mcp-server.d.ts +2 -36
- package/dist/src/api/mcp-server.d.ts.map +1 -1
- package/dist/src/api/mcp-server.js +15 -595
- package/dist/src/api/mcp-server.js.map +1 -1
- package/dist/src/api/server.d.ts +9 -1
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +55 -27
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/api/types.d.ts +10 -2
- 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 +1212 -192
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +6686 -1835
- 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/gate/gate-script.d.ts.map +1 -1
- package/dist/src/gate/gate-script.js.map +1 -1
- package/dist/src/index.d.ts +5 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcpl/capability-grant.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +170 -13
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +499 -258
- 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/feature-set-manager.d.ts.map +1 -1
- package/dist/src/mcpl/feature-set-manager.js +4 -3
- package/dist/src/mcpl/feature-set-manager.js.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts +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/log-value.d.ts +54 -0
- package/dist/src/mcpl/log-value.d.ts.map +1 -0
- package/dist/src/mcpl/log-value.js +109 -0
- package/dist/src/mcpl/log-value.js.map +1 -0
- package/dist/src/mcpl/prose-stream-router.d.ts +6 -6
- package/dist/src/mcpl/prose-stream-router.d.ts.map +1 -1
- package/dist/src/mcpl/prose-stream-router.js +4 -4
- package/dist/src/mcpl/prose-stream-router.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +64 -7
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +121 -24
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts +38 -8
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js +77 -78
- 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 +49 -14
- 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/refusal-lines.d.ts +37 -0
- package/dist/src/mcpl/refusal-lines.d.ts.map +1 -0
- package/dist/src/mcpl/refusal-lines.js +61 -0
- package/dist/src/mcpl/refusal-lines.js.map +1 -0
- package/dist/src/mcpl/scope-manager.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +107 -12
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +470 -139
- 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/tool-classes.d.ts +1 -1
- package/dist/src/mcpl/tool-classes.d.ts.map +1 -1
- package/dist/src/mcpl/tool-classes.js +3 -2
- package/dist/src/mcpl/tool-classes.js.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.js.map +1 -1
- package/dist/src/mcpl/transport.d.ts +74 -7
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +209 -22
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +43 -28
- 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.d.ts.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 +383 -145
- 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/branch-intent.d.ts.map +1 -1
- package/dist/src/modules/workspace/branch-intent.js.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.d.ts +54 -6
- package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +93 -27
- 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 +127 -27
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +821 -248
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +117 -15
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +436 -51
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/reconcile.d.ts +75 -8
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +576 -68
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +42 -3
- 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/operator-log.d.ts.map +1 -1
- package/dist/src/operator-log.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/provider-waits.d.ts.map +1 -1
- package/dist/src/provider-waits.js.map +1 -1
- package/dist/src/queue.d.ts.map +1 -1
- package/dist/src/record-journal.d.ts.map +1 -1
- package/dist/src/record-journal.js.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.d.ts.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.js.map +1 -1
- package/dist/src/recovery/offline-branch.d.ts +1 -0
- package/dist/src/recovery/offline-branch.d.ts.map +1 -1
- package/dist/src/recovery/offline-branch.js +32 -25
- package/dist/src/recovery/offline-branch.js.map +1 -1
- package/dist/src/recovery/recover-cli.js.map +1 -1
- package/dist/src/runtime/liveness-watchdog.d.ts.map +1 -1
- package/dist/src/runtime/liveness-watchdog.js.map +1 -1
- package/dist/src/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/shutdown.d.ts.map +1 -1
- package/dist/src/shutdown.js.map +1 -1
- package/dist/src/stored-removal.d.ts +73 -0
- package/dist/src/stored-removal.d.ts.map +1 -0
- package/dist/src/stored-removal.js +100 -0
- package/dist/src/stored-removal.js.map +1 -0
- package/dist/src/thinking-token-stamp.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts +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/tune-out/tools.d.ts +1 -1
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/types/agent.d.ts +59 -11
- 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 +31 -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 +30 -7
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +151 -11
- 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 +10 -9
- package/src/agent.ts +572 -105
- package/src/api/mcp-server-core.ts +681 -0
- package/src/api/mcp-server.ts +16 -685
- package/src/api/server.ts +55 -30
- package/src/api/types.ts +10 -2
- 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 +7158 -1936
- package/src/gate/event-gate.ts +28 -3
- package/src/index.ts +12 -3
- package/src/mcpl/channel-registry.ts +615 -289
- 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/feature-set-manager.ts +4 -3
- 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/log-value.ts +116 -0
- package/src/mcpl/prose-stream-router.ts +6 -6
- package/src/mcpl/push-coalescer.ts +124 -24
- package/src/mcpl/push-handler.ts +86 -84
- package/src/mcpl/reference-fetcher.ts +71 -26
- package/src/mcpl/references.ts +81 -22
- package/src/mcpl/refusal-lines.ts +59 -0
- package/src/mcpl/server-connection.ts +496 -142
- package/src/mcpl/server-registry.ts +15 -4
- package/src/mcpl/skip-reply-wake.ts +73 -0
- package/src/mcpl/tool-classes.ts +3 -2
- package/src/mcpl/transport.ts +219 -26
- package/src/mcpl/types.ts +18 -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 +395 -160
- 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 +125 -21
- package/src/modules/workspace/effects.ts +279 -35
- package/src/modules/workspace/index.ts +841 -261
- package/src/modules/workspace/observe.ts +456 -56
- package/src/modules/workspace/reconcile.ts +688 -76
- package/src/modules/workspace/types.ts +41 -2
- 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 +36 -29
- package/src/safe-slice.ts +9 -1
- package/src/stored-removal.ts +126 -0
- 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 +59 -13
- package/src/types/events.ts +17 -0
- package/src/types/framework.ts +31 -5
- package/src/types/inference-log.ts +1 -1
- package/src/types/module.ts +31 -7
- package/src/types/trace.ts +158 -12
- 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 -462
- 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 -387
- 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 -267
- 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/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 -1394
- 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 -72
- package/dist/test/helpers/coalescing-fixture.d.ts.map +0 -1
- package/dist/test/helpers/coalescing-fixture.js +0 -146
- 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/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 -863
- 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 -309
- 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 -1201
- 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 -265
- package/dist/test/maintenance-timer.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-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 -236
- 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-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-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-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 -258
- 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 -226
- 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 -398
- 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 -197
- package/dist/test/overbudget-drain-breaker.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 -14
- package/dist/test/physical-window-restart.test.d.ts.map +0 -1
- package/dist/test/physical-window-restart.test.js +0 -222
- 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 -706
- 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 -2196
- 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 -224
- 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 -108
- 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-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/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-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 -672
- 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 -3607
- 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 -329
- 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/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 -3194
- 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
|
@@ -42,14 +42,16 @@ export class McplServerRegistry {
|
|
|
42
42
|
throw new Error(`MCPL server "${config.id}" is already registered`);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const connection = config.reconnect
|
|
45
|
+
const connection = config.reconnect === true
|
|
46
46
|
? await McplServerConnection.connectWithReconnect(config, hostCapabilities)
|
|
47
47
|
: await McplServerConnection.connect(config, hostCapabilities);
|
|
48
48
|
this.servers.set(config.id, connection);
|
|
49
49
|
|
|
50
|
-
// Auto-remove on
|
|
50
|
+
// Auto-remove on close unless the connection will reconnect. That was
|
|
51
|
+
// decided once, from `reconnect === true` at connect, and a close() the
|
|
52
|
+
// host asks for disarms it first, so a server closed for good goes too.
|
|
51
53
|
connection.on('close', () => {
|
|
52
|
-
if (!
|
|
54
|
+
if (!connection.willReconnect) {
|
|
53
55
|
this.servers.delete(config.id);
|
|
54
56
|
}
|
|
55
57
|
});
|
|
@@ -146,7 +148,16 @@ export class McplServerRegistry {
|
|
|
146
148
|
})), timeoutMs);
|
|
147
149
|
}
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Close a server for good and drop its entry, if this connection is still
|
|
153
|
+
* the one registered under `id`. The entry goes when close() resolves,
|
|
154
|
+
* whatever the connection reports: close() emits no 'close' for a
|
|
155
|
+
* connection that's down between retries, such as a reconnect stub waiting
|
|
156
|
+
* for its next retry, so the 'close' listener alone would leave it
|
|
157
|
+
* registered. A close that fails keeps the entry and rejects; a close
|
|
158
|
+
* already under way is shared.
|
|
159
|
+
*/
|
|
160
|
+
closeServer(id: string, connection: McplServerConnection): Promise<void> {
|
|
150
161
|
const existing = this.closing.get(connection);
|
|
151
162
|
if (existing) return existing;
|
|
152
163
|
const attempt = Promise.resolve().then(() => connection.close()).then(() => {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How `skip_reply` reads its `wake_in_seconds`, for every site that acts on
|
|
3
|
+
* it: the framework arms the EventGate's timer or refuses the call, the turn's
|
|
4
|
+
* bookkeeping of a refused round asks whether it was refused, and the channel
|
|
5
|
+
* registry words the confirmation. One reading, so a value can't arm a timer
|
|
6
|
+
* at one site and read as no wake at another, and the confirmation names the
|
|
7
|
+
* seconds the timer is set for.
|
|
8
|
+
*/
|
|
9
|
+
import { safeSlice } from '../safe-slice.js';
|
|
10
|
+
|
|
11
|
+
/** The range the tool's schema offers, in seconds: a larger number waits the most. */
|
|
12
|
+
export const SKIP_REPLY_WAKE_MIN_SECONDS = 1;
|
|
13
|
+
export const SKIP_REPLY_WAKE_MAX_SECONDS = 3600;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* What a `skip_reply` call's `wake_in_seconds` asks for:
|
|
17
|
+
* - `none`: absent or `null`, an ordinary skip;
|
|
18
|
+
* - `wake`: a number of at least 1, or a string that `Number()` reads as one,
|
|
19
|
+
* in whole seconds and at most 3600, so 90.7 waits 90 s and anything over
|
|
20
|
+
* 3600, Infinity included, waits 3600 s;
|
|
21
|
+
* - `invalid`: anything else, which asks for no number of seconds the host can
|
|
22
|
+
* set: a number below 1, such as 0, a negative or 0.5, and "soon", "",
|
|
23
|
+
* `true`, an array or an object. Below 1 is refused rather than raised to 1:
|
|
24
|
+
* 0 is a value a model may write when it fills an optional number with a
|
|
25
|
+
* default, and as a 1 s wake it would wake the agent again a second after
|
|
26
|
+
* each turn, for as long as it kept skipping with 0.
|
|
27
|
+
*/
|
|
28
|
+
export type SkipReplyWake =
|
|
29
|
+
| { kind: 'none' }
|
|
30
|
+
| { kind: 'wake'; seconds: number }
|
|
31
|
+
| { kind: 'invalid'; value: unknown };
|
|
32
|
+
|
|
33
|
+
export function readSkipReplyWake(input: unknown): SkipReplyWake {
|
|
34
|
+
const value = input !== null && typeof input === 'object'
|
|
35
|
+
? (input as Record<string, unknown>).wake_in_seconds
|
|
36
|
+
: undefined;
|
|
37
|
+
if (value === undefined || value === null) return { kind: 'none' };
|
|
38
|
+
// A blank string reads as 0, so it's refused as a number below 1.
|
|
39
|
+
const seconds = typeof value === 'number' ? value
|
|
40
|
+
: typeof value === 'string' ? Number(value)
|
|
41
|
+
: Number.NaN;
|
|
42
|
+
if (Number.isNaN(seconds) || seconds < SKIP_REPLY_WAKE_MIN_SECONDS) return { kind: 'invalid', value };
|
|
43
|
+
return { kind: 'wake', seconds: Math.floor(Math.min(SKIP_REPLY_WAKE_MAX_SECONDS, seconds)) };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** The refusal the model reads when its host has no EventGate to set a timer. */
|
|
47
|
+
export const SKIP_REPLY_WAKE_NO_GATE_REFUSAL =
|
|
48
|
+
"Your turn didn't end, and no wake was set: this host can't wake you on a timer, so skip_reply can't take wake_in_seconds here. To end the turn and wait for the next message, call skip_reply without it. Anything you meant to come back to, do now.";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Why a `skip_reply` call is refused, as the model will read it, or undefined
|
|
52
|
+
* when it isn't: without an EventGate, any `wake_in_seconds` but absent or
|
|
53
|
+
* `null`, since the host offers none; with one, a value that isn't a number of
|
|
54
|
+
* seconds. A refused call arms nothing and doesn't end the turn.
|
|
55
|
+
*/
|
|
56
|
+
export function skipReplyWakeRefusal(wake: SkipReplyWake, gatePresent: boolean): string | undefined {
|
|
57
|
+
if (wake.kind === 'none') return undefined;
|
|
58
|
+
if (!gatePresent) return SKIP_REPLY_WAKE_NO_GATE_REFUSAL;
|
|
59
|
+
if (wake.kind === 'wake') return undefined;
|
|
60
|
+
return `Your turn didn't end, and no wake was set: wake_in_seconds takes a number of seconds from ${SKIP_REPLY_WAKE_MIN_SECONDS} to ${SKIP_REPLY_WAKE_MAX_SECONDS}, and ${describeValue(wake.value)} isn't one. Call skip_reply with a number of seconds to come back on your own, or without wake_in_seconds to end the turn and wait for the next message.`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A value as the model wrote it, as JSON, cut to keep the refusal short,
|
|
65
|
+
* never between the halves of a surrogate pair. A tool call's input is parsed
|
|
66
|
+
* JSON, so it always has a JSON text, but JSON writes a number that isn't
|
|
67
|
+
* finite as `null`, and `-1e400` parses as -Infinity, so a number prints as
|
|
68
|
+
* `String()` of it.
|
|
69
|
+
*/
|
|
70
|
+
function describeValue(value: unknown): string {
|
|
71
|
+
const text = typeof value === 'number' ? String(value) : JSON.stringify(value);
|
|
72
|
+
return text.length > 80 ? `${safeSlice(text, 0, 80)}…` : text;
|
|
73
|
+
}
|
package/src/mcpl/tool-classes.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { globMatch } from './tool-glob.js';
|
|
24
|
+
import { logValue } from './log-value.js';
|
|
24
25
|
|
|
25
26
|
export const TOOL_CLASSES = [
|
|
26
27
|
'comms',
|
|
@@ -116,7 +117,7 @@ export function parseDeclaredClasses(meta: unknown, toolName = '(unnamed)'): Too
|
|
|
116
117
|
const raw = (meta as Record<string, unknown>)[TOOL_CLASS_META_KEY];
|
|
117
118
|
if (raw === undefined) return undefined;
|
|
118
119
|
if (!Array.isArray(raw)) {
|
|
119
|
-
console.error(`[mcpl] ${toolName}: _meta["${TOOL_CLASS_META_KEY}"] is not an array — treated as unclassed`);
|
|
120
|
+
console.error(`[mcpl] ${logValue(toolName)}: _meta["${TOOL_CLASS_META_KEY}"] is not an array — treated as unclassed`);
|
|
120
121
|
return undefined;
|
|
121
122
|
}
|
|
122
123
|
const out: ToolClass[] = [];
|
|
@@ -124,7 +125,7 @@ export function parseDeclaredClasses(meta: unknown, toolName = '(unnamed)'): Too
|
|
|
124
125
|
if (isToolClass(value)) {
|
|
125
126
|
if (!out.includes(value)) out.push(value);
|
|
126
127
|
} else {
|
|
127
|
-
console.error(`[mcpl] ${toolName}: unknown tool class ${
|
|
128
|
+
console.error(`[mcpl] ${logValue(toolName)}: unknown tool class ${logValue(value)} ignored (RFC-008 §3)`);
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
return out.length > 0 ? out : undefined;
|
package/src/mcpl/transport.ts
CHANGED
|
@@ -19,9 +19,12 @@
|
|
|
19
19
|
import { spawn, type ChildProcess } from 'node:child_process';
|
|
20
20
|
import { createInterface, type Interface as ReadlineInterface } from 'node:readline';
|
|
21
21
|
import { EventEmitter } from 'node:events';
|
|
22
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
22
23
|
import WebSocket from 'ws';
|
|
23
24
|
|
|
24
25
|
import type { McplServerConfig } from './types.js';
|
|
26
|
+
import { assertBooleanSetting } from '../config-checks.js';
|
|
27
|
+
import { logDetail } from './log-value.js';
|
|
25
28
|
|
|
26
29
|
/** Why/how a transport closed. `code`/`signal` are populated for stdio child
|
|
27
30
|
* exits; `reason` carries a WebSocket close reason or an error message. */
|
|
@@ -29,6 +32,9 @@ export interface TransportCloseInfo {
|
|
|
29
32
|
code?: number | null;
|
|
30
33
|
signal?: NodeJS.Signals | null;
|
|
31
34
|
reason?: string;
|
|
35
|
+
/** True when `reason` is the peer's own text, a WebSocket server's close
|
|
36
|
+
* reason, rather than the transport's words. */
|
|
37
|
+
reasonFromPeer?: boolean;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
/**
|
|
@@ -51,7 +57,10 @@ export abstract class McplTransport extends EventEmitter {
|
|
|
51
57
|
private lineBuffer: string[] = [];
|
|
52
58
|
private stderrBuffer: string[] = [];
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
/** The server's id from its config, so a line the transport logs names it.
|
|
61
|
+
* The stdio and WebSocket transports always give it; a test's stand-in
|
|
62
|
+
* transport may leave it out. */
|
|
63
|
+
protected constructor(protected readonly serverId?: string) {
|
|
55
64
|
super();
|
|
56
65
|
// Flush buffered inbound lines the moment a consumer subscribes.
|
|
57
66
|
this.on('newListener', (event) => {
|
|
@@ -71,6 +80,25 @@ export abstract class McplTransport extends EventEmitter {
|
|
|
71
80
|
return this._closed;
|
|
72
81
|
}
|
|
73
82
|
|
|
83
|
+
/**
|
|
84
|
+
* The last of what the server wrote to its diagnostic stream: at most its
|
|
85
|
+
* last {@link STDERR_TAIL_CHARS} UTF-16 code units, never opening inside a
|
|
86
|
+
* surrogate pair, after a '…' when earlier ones were dropped. A stdio
|
|
87
|
+
* child's stderr, and '' for a transport that has none.
|
|
88
|
+
*/
|
|
89
|
+
get stderrTail(): string {
|
|
90
|
+
return '';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Resolves once the server's diagnostic stream has ended or closed, so that
|
|
95
|
+
* {@link stderrTail} holds what arrived on it, or once `ms` have passed while
|
|
96
|
+
* it hasn't. At once for a transport that has none.
|
|
97
|
+
*/
|
|
98
|
+
stderrEnded(_ms: number): Promise<void> {
|
|
99
|
+
return Promise.resolve();
|
|
100
|
+
}
|
|
101
|
+
|
|
74
102
|
/** Deliver an inbound line, buffering it if nobody is listening yet. */
|
|
75
103
|
protected pushLine(line: string): void {
|
|
76
104
|
if (this.listenerCount('line') > 0) this.emit('line', line);
|
|
@@ -83,6 +111,23 @@ export abstract class McplTransport extends EventEmitter {
|
|
|
83
111
|
else this.stderrBuffer.push(line);
|
|
84
112
|
}
|
|
85
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Report a transport error: to the 'error' listeners if there are any, else
|
|
116
|
+
* as a log line. EventEmitter throws an 'error' that nothing listens for,
|
|
117
|
+
* and a transport reports its errors from I/O callbacks, where nothing
|
|
118
|
+
* catches that throw, so it would end the process. A transport has no
|
|
119
|
+
* listener from its creation until the handshake attaches one, and a
|
|
120
|
+
* WebSocket server that sends a malformed frame with its upgrade response
|
|
121
|
+
* makes ws raise an 'error' in that window.
|
|
122
|
+
*/
|
|
123
|
+
protected reportError(err: Error): void {
|
|
124
|
+
if (this.listenerCount('error') > 0) this.emit('error', err);
|
|
125
|
+
else {
|
|
126
|
+
const server = this.serverId === undefined ? '' : `${this.serverId}: `;
|
|
127
|
+
console.error(`[mcpl] ${server}a ${this.kind} transport error, with nothing listening for it: ${logDetail(err.message)}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
86
131
|
/** Emit 'close' exactly once. */
|
|
87
132
|
protected markClosed(info: TransportCloseInfo): void {
|
|
88
133
|
if (this._closed) return;
|
|
@@ -127,15 +172,17 @@ export const CHILD_ENV_ALLOWLIST = [
|
|
|
127
172
|
|
|
128
173
|
/** Environment for a stdio child: allowlisted host vars (+ LC_*), then the
|
|
129
174
|
* server's declared `env` on top. Windows names merge case-insensitively;
|
|
130
|
-
* POSIX names remain case-sensitive. `inheritEnv: true` restores full inheritance
|
|
175
|
+
* POSIX names remain case-sensitive. `inheritEnv: true` restores full inheritance,
|
|
176
|
+
* and only `true` does: a direct caller can pass any value, unchecked. */
|
|
131
177
|
export function buildChildEnv(
|
|
132
178
|
config: Pick<McplServerConfig, 'env' | 'inheritEnv'>,
|
|
133
179
|
hostEnv: NodeJS.ProcessEnv = process.env,
|
|
134
180
|
platform: NodeJS.Platform = process.platform,
|
|
135
181
|
): NodeJS.ProcessEnv {
|
|
136
182
|
const win = platform === 'win32';
|
|
137
|
-
const
|
|
138
|
-
|
|
183
|
+
const inherit = config.inheritEnv === true;
|
|
184
|
+
const env: NodeJS.ProcessEnv = inherit ? { ...hostEnv } : {};
|
|
185
|
+
if (!inherit) {
|
|
139
186
|
for (const [key, value] of Object.entries(hostEnv)) {
|
|
140
187
|
if (value === undefined) continue;
|
|
141
188
|
// Windows commonly enumerates Path/SystemRoot rather than PATH/SYSTEMROOT.
|
|
@@ -167,37 +214,129 @@ export function buildChildEnv(
|
|
|
167
214
|
return merged;
|
|
168
215
|
}
|
|
169
216
|
|
|
217
|
+
/** The most of a stdio child's stderr a transport keeps for {@link McplTransport.stderrTail}. */
|
|
218
|
+
export const STDERR_TAIL_CHARS = 2_048;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* How long a refusal at a stdio child's exit waits for the child's stderr to
|
|
222
|
+
* end, so that its `stderrTail` holds what the child wrote. Node can emit a
|
|
223
|
+
* child's `exit` before it has read the last of the child's stderr. When the
|
|
224
|
+
* child held the stream alone, the stream ends with it, and the wait is short.
|
|
225
|
+
* The bound binds when another process still holds the stream, such as one the
|
|
226
|
+
* server started that inherited it, or when the host's loop stalls past it
|
|
227
|
+
* before reading an end that is waiting. The tail then holds what had arrived.
|
|
228
|
+
* A process that keeps the stream open, such as one the server started and
|
|
229
|
+
* left running, holds the refusal up by the bound, a fifth of the reconnect's
|
|
230
|
+
* default first interval.
|
|
231
|
+
*/
|
|
232
|
+
export const STDERR_END_WAIT_MS = 1_000;
|
|
233
|
+
|
|
170
234
|
export class StdioTransport extends McplTransport {
|
|
171
235
|
readonly kind = 'stdio' as const;
|
|
236
|
+
/** The first error on the child's stdin or stdout, named in the close reason. */
|
|
237
|
+
private pipeError: Error | undefined;
|
|
238
|
+
private stderrEnd = '';
|
|
239
|
+
private stderrCut = false;
|
|
240
|
+
/** True once the child's stderr has ended or closed. */
|
|
241
|
+
private stderrDone = false;
|
|
242
|
+
|
|
243
|
+
override get stderrTail(): string {
|
|
244
|
+
return (this.stderrCut ? '…' : '') + this.stderrEnd;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
override stderrEnded(ms: number): Promise<void> {
|
|
248
|
+
const stderr = this.child.stderr;
|
|
249
|
+
if (!stderr || this.stderrDone) return Promise.resolve();
|
|
250
|
+
return new Promise((resolve) => {
|
|
251
|
+
let timer: NodeJS.Timeout | undefined;
|
|
252
|
+
const done = () => {
|
|
253
|
+
clearTimeout(timer);
|
|
254
|
+
stderr.off('end', done);
|
|
255
|
+
stderr.off('close', done);
|
|
256
|
+
resolve();
|
|
257
|
+
};
|
|
258
|
+
// Added after the constructor's listeners, so the tail already holds the
|
|
259
|
+
// stream's last characters when these run.
|
|
260
|
+
stderr.once('end', done);
|
|
261
|
+
stderr.once('close', done);
|
|
262
|
+
timer = setTimeout(done, ms);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
172
265
|
|
|
173
266
|
private constructor(
|
|
174
267
|
private readonly child: ChildProcess,
|
|
175
268
|
private readonly rl: ReadlineInterface,
|
|
269
|
+
serverId: string,
|
|
176
270
|
) {
|
|
177
|
-
super();
|
|
271
|
+
super(serverId);
|
|
178
272
|
|
|
179
273
|
this.rl.on('line', (line: string) => this.pushLine(line));
|
|
180
274
|
|
|
181
|
-
// Stitch stderr chunks into whole lines (a chunk can split a line
|
|
275
|
+
// Stitch stderr chunks into whole lines (a chunk can split a line, and a
|
|
276
|
+
// character's bytes), and keep the stream's last characters for
|
|
277
|
+
// stderrTail.
|
|
182
278
|
let carry = '';
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
279
|
+
const decoder = new StringDecoder('utf8');
|
|
280
|
+
const received = (text: string) => {
|
|
281
|
+
const end = this.stderrEnd + text;
|
|
282
|
+
this.stderrCut ||= end.length > STDERR_TAIL_CHARS;
|
|
283
|
+
let kept = end.slice(-STDERR_TAIL_CHARS);
|
|
284
|
+
// A cut between a surrogate pair's halves drops the low half too.
|
|
285
|
+
if (/^[\uDC00-\uDFFF]/.test(kept) && end.length > STDERR_TAIL_CHARS) kept = kept.slice(1);
|
|
286
|
+
this.stderrEnd = kept;
|
|
287
|
+
const lines = (carry + text).split('\n');
|
|
186
288
|
carry = lines.pop() ?? '';
|
|
187
289
|
for (const l of lines) if (l.length > 0) this.pushStderr(l);
|
|
290
|
+
};
|
|
291
|
+
this.child.stderr?.on('data', (chunk: Buffer) => received(decoder.write(chunk)));
|
|
292
|
+
// A last line with no newline is complete once the stream ends.
|
|
293
|
+
this.child.stderr?.on('end', () => {
|
|
294
|
+
received(decoder.end());
|
|
295
|
+
if (carry.length > 0) this.pushStderr(carry);
|
|
296
|
+
this.stderrDone = true;
|
|
188
297
|
});
|
|
189
|
-
|
|
190
|
-
this.child.on('
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
298
|
+
// A stream destroyed by an error closes without ending: nothing more comes.
|
|
299
|
+
this.child.stderr?.on('close', () => { this.stderrDone = true; });
|
|
300
|
+
|
|
301
|
+
this.child.on('error', (err) => this.reportError(err));
|
|
302
|
+
// The child's stdin and stdout carry the protocol, so after an error on
|
|
303
|
+
// either, a write's EPIPE or a read error, this transport can't reach the
|
|
304
|
+
// child even if it's still running. The handler sends a running child
|
|
305
|
+
// SIGTERM, and the exit's close names the error, so the connection handles
|
|
306
|
+
// it as any other exit. The close is the report: no 'error' is emitted,
|
|
307
|
+
// nothing is thrown. Nothing here escalates to SIGKILL, so a child that
|
|
308
|
+
// ignores SIGTERM keeps running, unreported. A child that stops reading
|
|
309
|
+
// without closing its stdin raises no error: the writes are buffered, and
|
|
310
|
+
// only request timeouts bound it (McplServerConfig.requestTimeoutMs).
|
|
311
|
+
const endOnPipeError = (err: Error) => {
|
|
312
|
+
this.pipeError ??= err;
|
|
313
|
+
if (this.child.exitCode === null && this.child.signalCode === null) this.child.kill();
|
|
314
|
+
};
|
|
315
|
+
this.child.stdin?.on('error', endOnPipeError);
|
|
316
|
+
// On the stream itself, since close() closes readline, which takes its own
|
|
317
|
+
// listener off the stream. While readline is open, its listener, which
|
|
318
|
+
// came first, re-emits the error on the interface, where an empty
|
|
319
|
+
// listener absorbs that copy.
|
|
320
|
+
this.child.stdout?.on('error', endOnPipeError);
|
|
321
|
+
this.rl.on('error', () => { /* readline's copy of a stdout error, handled above */ });
|
|
322
|
+
// stderr carries diagnostics only: a read error on it is reported, to the
|
|
323
|
+
// listeners or else in the log, and never thrown. It ends nothing once
|
|
324
|
+
// the connection is wired; during a handshake the listener is the
|
|
325
|
+
// handshake's, which fails it.
|
|
326
|
+
this.child.stderr?.on('error', (err) => this.reportError(err));
|
|
327
|
+
this.child.on('exit', (code, signal) => this.markClosed({
|
|
328
|
+
code,
|
|
329
|
+
signal,
|
|
330
|
+
reason: this.pipeError ? `child process exited, and its pipe failed with ${this.pipeError.message}` : 'child process exited',
|
|
331
|
+
}));
|
|
194
332
|
}
|
|
195
333
|
|
|
196
334
|
/**
|
|
197
|
-
* Spawn `config.command` and
|
|
198
|
-
* command is missing (a config bug) or the
|
|
335
|
+
* Spawn `config.command` and resolve with a ready stdio transport once the
|
|
336
|
+
* child has spawned. Rejects if the command is missing (a config bug) or the
|
|
337
|
+
* process fails to spawn.
|
|
199
338
|
*/
|
|
200
|
-
static spawn(config: McplServerConfig): StdioTransport {
|
|
339
|
+
static async spawn(config: McplServerConfig): Promise<StdioTransport> {
|
|
201
340
|
if (!config.command) {
|
|
202
341
|
throw new Error(
|
|
203
342
|
`MCPL server "${config.id}": stdio transport requires "command" (none provided)`,
|
|
@@ -207,8 +346,24 @@ export class StdioTransport extends McplTransport {
|
|
|
207
346
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
208
347
|
env: buildChildEnv(config),
|
|
209
348
|
});
|
|
349
|
+
// Node reports a failed spawn (a command that doesn't exist, say) as an
|
|
350
|
+
// 'error' on a tick after spawn() returns, and no 'exit' follows. It is
|
|
351
|
+
// settled here, where it is listened for. A caller that listens only once
|
|
352
|
+
// this resolves, as the handshake does, would be too late when reached
|
|
353
|
+
// from a timer callback, as a reconnect is: Node runs that tick before the
|
|
354
|
+
// caller's promise continuation, and throws an 'error' nothing listens for.
|
|
355
|
+
await new Promise<void>((resolve, reject) => {
|
|
356
|
+
const failed = (err: Error) => {
|
|
357
|
+
reject(new Error(`MCPL server "${config.id}" could not be started: ${err.message}`, { cause: err }));
|
|
358
|
+
};
|
|
359
|
+
child.once('error', failed);
|
|
360
|
+
child.once('spawn', () => {
|
|
361
|
+
child.off('error', failed);
|
|
362
|
+
resolve();
|
|
363
|
+
});
|
|
364
|
+
});
|
|
210
365
|
const rl = createInterface({ input: child.stdout! });
|
|
211
|
-
return new StdioTransport(child, rl);
|
|
366
|
+
return new StdioTransport(child, rl, config.id);
|
|
212
367
|
}
|
|
213
368
|
|
|
214
369
|
writeLine(json: string): void {
|
|
@@ -223,7 +378,12 @@ export class StdioTransport extends McplTransport {
|
|
|
223
378
|
this.child.kill();
|
|
224
379
|
}
|
|
225
380
|
await new Promise<void>((resolve) => {
|
|
226
|
-
|
|
381
|
+
// Once Node has seen a child exit, it has its exitCode set, or its
|
|
382
|
+
// signalCode when a signal ended it, and its 'exit' event has fired. A
|
|
383
|
+
// signal that didn't come through kill() (an OOM kill, a crash) leaves
|
|
384
|
+
// `killed` false. A child that has exited but isn't reaped yet still
|
|
385
|
+
// takes the kill() above, which sets `killed`.
|
|
386
|
+
if (!this.child || this.child.exitCode !== null || this.child.signalCode !== null || this.child.killed) {
|
|
227
387
|
resolve();
|
|
228
388
|
} else {
|
|
229
389
|
this.child.once('exit', () => resolve());
|
|
@@ -242,8 +402,8 @@ const WS_OPEN_TIMEOUT_MS = 15_000;
|
|
|
242
402
|
export class WebSocketTransport extends McplTransport {
|
|
243
403
|
readonly kind = 'websocket' as const;
|
|
244
404
|
|
|
245
|
-
private constructor(private readonly ws: WebSocket) {
|
|
246
|
-
super();
|
|
405
|
+
private constructor(private readonly ws: WebSocket, serverId: string) {
|
|
406
|
+
super(serverId);
|
|
247
407
|
|
|
248
408
|
this.ws.on('message', (data: WebSocket.RawData, isBinary: boolean) => {
|
|
249
409
|
// MCPL frames are UTF-8 JSON text. A frame MAY contain multiple
|
|
@@ -255,10 +415,11 @@ export class WebSocketTransport extends McplTransport {
|
|
|
255
415
|
}
|
|
256
416
|
});
|
|
257
417
|
|
|
258
|
-
this.ws.on('error', (err: Error) => this.
|
|
259
|
-
this.ws.on('close', (code: number, reason: Buffer) =>
|
|
260
|
-
|
|
261
|
-
|
|
418
|
+
this.ws.on('error', (err: Error) => this.reportError(err));
|
|
419
|
+
this.ws.on('close', (code: number, reason: Buffer) => {
|
|
420
|
+
const text = reason?.toString('utf8');
|
|
421
|
+
this.markClosed(text ? { code, reason: text, reasonFromPeer: true } : { code, reason: 'websocket closed' });
|
|
422
|
+
});
|
|
262
423
|
}
|
|
263
424
|
|
|
264
425
|
/**
|
|
@@ -313,7 +474,7 @@ export class WebSocketTransport extends McplTransport {
|
|
|
313
474
|
settled = true;
|
|
314
475
|
clearTimeout(timer);
|
|
315
476
|
ws.removeAllListeners('error'); // the instance re-attaches its own handlers
|
|
316
|
-
resolve(new WebSocketTransport(ws));
|
|
477
|
+
resolve(new WebSocketTransport(ws, config.id));
|
|
317
478
|
});
|
|
318
479
|
|
|
319
480
|
ws.once('error', (err: Error) => {
|
|
@@ -390,6 +551,38 @@ export function isWebSocketTransport(config: McplServerConfig): boolean {
|
|
|
390
551
|
return Boolean(config.url) && !config.command;
|
|
391
552
|
}
|
|
392
553
|
|
|
554
|
+
/** The settings of McplServerConfig whose type is boolean. */
|
|
555
|
+
type BooleanSetting = {
|
|
556
|
+
[K in keyof McplServerConfig]-?: NonNullable<McplServerConfig[K]> extends boolean ? K : never;
|
|
557
|
+
}[keyof McplServerConfig];
|
|
558
|
+
|
|
559
|
+
/** What `true` does for each boolean setting, as its refusal says it. A
|
|
560
|
+
* boolean setting added to McplServerConfig doesn't compile until it has
|
|
561
|
+
* an entry here, so the check below covers it too. */
|
|
562
|
+
const SERVER_CONFIG_BOOLEANS: Record<BooleanSetting, string> = {
|
|
563
|
+
inheritEnv: 'true passes the server the host\'s whole environment, and false or leaving it out passes only the allowlisted and LC_* host variables',
|
|
564
|
+
reconnect: 'true retries in the background when the server can\'t be reached or its connection drops, and false or leaving it out doesn\'t',
|
|
565
|
+
allowHostCommands: 'true lets the server run the host\'s admin commands, such as undo, hide, unstick and quiesce, and false or leaving it out refuses them',
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Refuse a server config whose `inheritEnv`, `reconnect` or `allowHostCommands`
|
|
570
|
+
* holds anything but true or false. A config read from JSON can carry a quoted
|
|
571
|
+
* "false" where the type says boolean, and every reader of these settings takes
|
|
572
|
+
* only `true` as on, so the quotes would hide what the value does. null counts
|
|
573
|
+
* as not set, so a generated config that writes an unset setting as null
|
|
574
|
+
* keeps working. `inheritEnv` is checked only for a stdio server, since a
|
|
575
|
+
* WebSocket server never reads it. The error names the server, the setting
|
|
576
|
+
* and the value's kind, not the value, which could be a secret pasted into
|
|
577
|
+
* the wrong field.
|
|
578
|
+
*/
|
|
579
|
+
export function assertServerConfigBooleans(config: McplServerConfig): void {
|
|
580
|
+
for (const [setting, whatTrueDoes] of Object.entries(SERVER_CONFIG_BOOLEANS) as Array<[BooleanSetting, string]>) {
|
|
581
|
+
if (setting === 'inheritEnv' && isWebSocketTransport(config)) continue;
|
|
582
|
+
assertBooleanSetting(`MCPL server "${config.id}" ${setting}`, config[setting], whatTrueDoes);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
393
586
|
/**
|
|
394
587
|
* Open the transport selected by `config` (WebSocket when `transport` is
|
|
395
588
|
* 'websocket' or a bare `url` is given; stdio otherwise). The returned transport
|
package/src/mcpl/types.ts
CHANGED
|
@@ -238,7 +238,10 @@ export interface McplServerConfig {
|
|
|
238
238
|
/**
|
|
239
239
|
* Escape hatch: pass the host's entire environment (including secrets) to
|
|
240
240
|
* the stdio child, as older versions did. Only for servers that genuinely
|
|
241
|
-
* need it. Default false.
|
|
241
|
+
* need it. Default false. Only `true` turns it on, and null counts as not
|
|
242
|
+
* set. For a stdio server, `create()`, `connectMcplServer` and
|
|
243
|
+
* `restartMcplServer` refuse any other value, such as a quoted "false". A
|
|
244
|
+
* WebSocket server never reads it.
|
|
242
245
|
*/
|
|
243
246
|
inheritEnv?: boolean;
|
|
244
247
|
|
|
@@ -278,7 +281,9 @@ export interface McplServerConfig {
|
|
|
278
281
|
* unstick). DEFAULT FALSE: no §6.2 capability path exists for it, and the
|
|
279
282
|
* grant cannot confer it — only this config, decided by the operator, can
|
|
280
283
|
* (PR #79 review blocker 9). The one legitimate fleet user is
|
|
281
|
-
* discord-mcpl's slash-command relay.
|
|
284
|
+
* discord-mcpl's slash-command relay. Only `true` turns it on, and null
|
|
285
|
+
* counts as not set. `create()`, `connectMcplServer` and
|
|
286
|
+
* `restartMcplServer` refuse any other value, such as a quoted "true".
|
|
282
287
|
*/
|
|
283
288
|
allowHostCommands?: boolean;
|
|
284
289
|
|
|
@@ -351,6 +356,9 @@ export interface McplServerConfig {
|
|
|
351
356
|
* When true, connect() resolves immediately (with null capabilities) if the
|
|
352
357
|
* server is unavailable, and retries in the background.
|
|
353
358
|
* Adapted from Anarchid/agent-framework@mcpl-module-proto.
|
|
359
|
+
* Only `true` turns it on, and null counts as not set. `create()`,
|
|
360
|
+
* `connectMcplServer` and `restartMcplServer` refuse any other value, such
|
|
361
|
+
* as a quoted "false".
|
|
354
362
|
*/
|
|
355
363
|
reconnect?: boolean;
|
|
356
364
|
|
|
@@ -374,7 +382,14 @@ export interface McplServerConfig {
|
|
|
374
382
|
* accepts a request and never responds would otherwise freeze the awaiting
|
|
375
383
|
* agent turn forever; with the timeout the pending request rejects with a
|
|
376
384
|
* descriptive error, which the framework surfaces as a normal isError
|
|
377
|
-
* tool_result.
|
|
385
|
+
* tool_result. Request timeouts are the only bound for a stdio server that
|
|
386
|
+
* stops reading its stdin without closing it: the host's writes are
|
|
387
|
+
* buffered, no error is raised, and the connection stays up. This is the
|
|
388
|
+
* timeout of every request that names none; the handshake's initialize has
|
|
389
|
+
* its own. Set 0 to disable, except for channels/publish and the
|
|
390
|
+
* channels/open a delivery may send first, which keep the 60 s default: a
|
|
391
|
+
* publish's outcome is reported to the resident and recorded for its
|
|
392
|
+
* draft, so it must end. Default: 60000 (60 seconds).
|
|
378
393
|
*/
|
|
379
394
|
requestTimeoutMs?: number;
|
|
380
395
|
|
|
@@ -31,6 +31,33 @@ export function isVisiblyEmptyContent(content: readonly unknown[] | null | undef
|
|
|
31
31
|
return true;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* What the converter (convertBlock, on every lane) shows for a text
|
|
36
|
+
* block whose text isn't a string, which only a nonconformant sender writes,
|
|
37
|
+
* so the agent learns that a block was there. It is the host's word, not the
|
|
38
|
+
* sender's, so it never makes content visible (isVisiblyEmptyConversion).
|
|
39
|
+
*/
|
|
40
|
+
export const NON_STRING_TEXT_PLACEHOLDER = "[Text not shown: the server's text block had no string text.]";
|
|
41
|
+
|
|
42
|
+
/** A wire text block whose text isn't a string, which the converter shows as
|
|
43
|
+
* NON_STRING_TEXT_PLACEHOLDER. */
|
|
44
|
+
function isNonStringTextBlock(block: unknown): boolean {
|
|
45
|
+
if (!block || typeof block !== 'object') return false;
|
|
46
|
+
const b = block as { type?: unknown; text?: unknown };
|
|
47
|
+
return b.type === 'text' && typeof b.text !== 'string';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* isVisiblyEmptyContent for content as a converter showed it, `wire` being
|
|
52
|
+
* the content as it arrived, block for block: a block shown as
|
|
53
|
+
* NON_STRING_TEXT_PLACEHOLDER counts as the nothing it held. So content that
|
|
54
|
+
* is only such blocks (or blank text) is still empty, and anything else is
|
|
55
|
+
* judged as the converted blocks show it, placeholders included.
|
|
56
|
+
*/
|
|
57
|
+
export function isVisiblyEmptyConversion(wire: readonly unknown[], converted: readonly unknown[]): boolean {
|
|
58
|
+
return isVisiblyEmptyContent(converted.filter((_, i) => !isNonStringTextBlock(wire[i])));
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
/** The server id and feature set the marker must carry. */
|
|
35
62
|
export const SILENT_HEARTBEAT_SERVER_ID = 'heartbeat';
|
|
36
63
|
export const SILENT_HEARTBEAT_FEATURE_SET = 'heartbeat';
|