@animalabs/agent-framework 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/src/agent.d.ts +192 -19
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +407 -66
- 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 +84 -23
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/api/types.d.ts +9 -1
- package/dist/src/api/types.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.js.map +1 -1
- package/dist/src/framework.d.ts +682 -103
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +3202 -718
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/gate-script.d.ts.map +1 -1
- package/dist/src/gate/gate-script.js.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcpl/capability-grant.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +26 -7
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +102 -22
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
- package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
- package/dist/src/mcpl/errors.js.map +1 -1
- package/dist/src/mcpl/feature-set-manager.d.ts.map +1 -1
- package/dist/src/mcpl/feature-set-manager.js +4 -3
- package/dist/src/mcpl/feature-set-manager.js.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
- package/dist/src/mcpl/index.d.ts +2 -0
- package/dist/src/mcpl/index.d.ts.map +1 -1
- package/dist/src/mcpl/index.js.map +1 -1
- package/dist/src/mcpl/inference-router.d.ts.map +1 -1
- package/dist/src/mcpl/log-value.d.ts +54 -0
- package/dist/src/mcpl/log-value.d.ts.map +1 -0
- package/dist/src/mcpl/log-value.js +109 -0
- package/dist/src/mcpl/log-value.js.map +1 -0
- package/dist/src/mcpl/prose-stream-router.d.ts +6 -6
- package/dist/src/mcpl/prose-stream-router.d.ts.map +1 -1
- package/dist/src/mcpl/prose-stream-router.js +4 -4
- package/dist/src/mcpl/prose-stream-router.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +38 -3
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +81 -16
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts +26 -3
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js +87 -23
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/reference-fetcher.d.ts +2 -1
- package/dist/src/mcpl/reference-fetcher.d.ts.map +1 -1
- package/dist/src/mcpl/reference-fetcher.js +20 -9
- package/dist/src/mcpl/reference-fetcher.js.map +1 -1
- package/dist/src/mcpl/references.d.ts +29 -6
- package/dist/src/mcpl/references.d.ts.map +1 -1
- package/dist/src/mcpl/references.js +57 -16
- 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 +46 -3
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +98 -15
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/server-registry.d.ts.map +1 -1
- package/dist/src/mcpl/tool-classes.d.ts +1 -1
- package/dist/src/mcpl/tool-classes.d.ts.map +1 -1
- package/dist/src/mcpl/tool-classes.js +3 -2
- package/dist/src/mcpl/tool-classes.js.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.js.map +1 -1
- package/dist/src/mcpl/transport.d.ts +23 -5
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +103 -10
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +30 -26
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/module-registry.d.ts +9 -3
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +3 -2
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/api/index.d.ts.map +1 -1
- package/dist/src/modules/discord/discord-js-client.d.ts.map +1 -1
- package/dist/src/modules/discord/discord-js-client.js.map +1 -1
- package/dist/src/modules/discord/index.d.ts.map +1 -1
- package/dist/src/modules/discord/index.js +4 -2
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/health/index.d.ts.map +1 -1
- package/dist/src/modules/health/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/history/semantic.d.ts.map +1 -1
- package/dist/src/modules/history/semantic.js.map +1 -1
- package/dist/src/modules/workspace/branch-intent.d.ts.map +1 -1
- package/dist/src/modules/workspace/branch-intent.js.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.d.ts +22 -4
- package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +63 -25
- package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
- package/dist/src/modules/workspace/effects.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +8 -4
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +85 -16
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +56 -11
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +288 -43
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/reconcile.d.ts +31 -1
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +63 -12
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +27 -2
- package/dist/src/modules/workspace/types.d.ts.map +1 -1
- package/dist/src/modules/workspace/types.js.map +1 -1
- package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
- package/dist/src/modules/workspace/watcher.js.map +1 -1
- package/dist/src/operator-log.d.ts +41 -0
- package/dist/src/operator-log.d.ts.map +1 -1
- package/dist/src/operator-log.js.map +1 -1
- package/dist/src/provider-waits.d.ts +216 -0
- package/dist/src/provider-waits.d.ts.map +1 -0
- package/dist/src/provider-waits.js +482 -0
- package/dist/src/provider-waits.js.map +1 -0
- package/dist/src/queue.d.ts.map +1 -1
- package/dist/src/record-journal.d.ts.map +1 -1
- package/dist/src/record-journal.js.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.d.ts.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.js.map +1 -1
- package/dist/src/recovery/offline-branch.d.ts.map +1 -1
- package/dist/src/recovery/offline-branch.js +29 -24
- package/dist/src/recovery/offline-branch.js.map +1 -1
- package/dist/src/recovery/recover-cli.js.map +1 -1
- package/dist/src/refusal-reactions.d.ts +14 -12
- package/dist/src/refusal-reactions.d.ts.map +1 -1
- package/dist/src/refusal-reactions.js +14 -12
- package/dist/src/refusal-reactions.js.map +1 -1
- package/dist/src/runtime/liveness-watchdog.d.ts.map +1 -1
- package/dist/src/runtime/liveness-watchdog.js.map +1 -1
- package/dist/src/shutdown.d.ts.map +1 -1
- package/dist/src/shutdown.js.map +1 -1
- package/dist/src/stored-removal.d.ts +73 -0
- package/dist/src/stored-removal.d.ts.map +1 -0
- package/dist/src/stored-removal.js +100 -0
- package/dist/src/stored-removal.js.map +1 -0
- package/dist/src/thinking-token-stamp.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts.map +1 -1
- package/dist/src/tool-image-ledger.js.map +1 -1
- package/dist/src/tool-presentation.d.ts.map +1 -1
- package/dist/src/tool-presentation.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts +30 -13
- package/dist/src/tool-result-guard.d.ts.map +1 -1
- package/dist/src/tool-result-guard.js +71 -25
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/tune-out/tools.d.ts +1 -1
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/types/agent.d.ts +42 -6
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +12 -0
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +10 -0
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +20 -8
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +75 -13
- package/dist/src/types/trace.d.ts.map +1 -1
- package/dist/src/usage/usage-tracker.d.ts.map +1 -1
- package/dist/test/agent-runtime-settings.test.js +1139 -3
- package/dist/test/agent-runtime-settings.test.js.map +1 -1
- package/dist/test/batched-wake-locus.test.js.map +1 -1
- package/dist/test/channel-label-history.test.js.map +1 -1
- package/dist/test/code-execution.test.js.map +1 -1
- package/dist/test/conversation-fork-injection-scoping.test.js.map +1 -1
- package/dist/test/conversation-router.test.js.map +1 -1
- package/dist/test/conversation-routing.test.js +240 -6
- package/dist/test/conversation-routing.test.js.map +1 -1
- package/dist/test/discord-awareness-outbox.test.js +107 -0
- package/dist/test/discord-awareness-outbox.test.js.map +1 -1
- package/dist/test/discord-typing-keepalive.test.d.ts +2 -0
- package/dist/test/discord-typing-keepalive.test.d.ts.map +1 -0
- package/dist/test/discord-typing-keepalive.test.js +77 -0
- package/dist/test/discord-typing-keepalive.test.js.map +1 -0
- package/dist/test/ephemeral-settle.test.js.map +1 -1
- package/dist/test/event-gate-passthrough.test.js.map +1 -1
- package/dist/test/event-gate-policy-mutation.test.js.map +1 -1
- package/dist/test/event-gate-rate-limit.test.js.map +1 -1
- package/dist/test/event-gate-script.test.js.map +1 -1
- package/dist/test/event-gate-selfwake.test.js.map +1 -1
- package/dist/test/event-gate-tags.test.js.map +1 -1
- package/dist/test/event-gate.test.js.map +1 -1
- package/dist/test/explicit-prose-routing.test.js +363 -44
- package/dist/test/explicit-prose-routing.test.js.map +1 -1
- package/dist/test/framework.test.js +160 -1
- package/dist/test/framework.test.js.map +1 -1
- package/dist/test/helpers/coalescing-fixture.d.ts +2 -0
- package/dist/test/helpers/coalescing-fixture.d.ts.map +1 -1
- package/dist/test/helpers/coalescing-fixture.js +11 -4
- package/dist/test/helpers/coalescing-fixture.js.map +1 -1
- package/dist/test/helpers/mock-membrane.d.ts.map +1 -1
- package/dist/test/helpers/mock-membrane.js.map +1 -1
- package/dist/test/hide-then-turn.test.d.ts +2 -0
- package/dist/test/hide-then-turn.test.d.ts.map +1 -0
- package/dist/test/hide-then-turn.test.js +101 -0
- package/dist/test/hide-then-turn.test.js.map +1 -0
- package/dist/test/history-module-overview.test.js.map +1 -1
- package/dist/test/history-module-semantic.test.js.map +1 -1
- package/dist/test/history-module.test.js.map +1 -1
- package/dist/test/history-semantic-review-findings.test.js.map +1 -1
- package/dist/test/host-quiesce.test.js +125 -0
- package/dist/test/host-quiesce.test.js.map +1 -1
- package/dist/test/inference-exhaustion-rewind.test.js +220 -14
- package/dist/test/inference-exhaustion-rewind.test.js.map +1 -1
- package/dist/test/inference-failure-bounds.test.d.ts +2 -0
- package/dist/test/inference-failure-bounds.test.d.ts.map +1 -0
- package/dist/test/inference-failure-bounds.test.js +1202 -0
- package/dist/test/inference-failure-bounds.test.js.map +1 -0
- package/dist/test/kv-unified-open-flight-retry.test.js.map +1 -1
- package/dist/test/late-events-after-stop.test.d.ts +2 -0
- package/dist/test/late-events-after-stop.test.d.ts.map +1 -0
- package/dist/test/late-events-after-stop.test.js +122 -0
- package/dist/test/late-events-after-stop.test.js.map +1 -0
- package/dist/test/liveness-watchdog.test.js.map +1 -1
- package/dist/test/maintenance-timer.test.js +1564 -2
- package/dist/test/maintenance-timer.test.js.map +1 -1
- package/dist/test/mcp-server-bin.test.d.ts +2 -0
- package/dist/test/mcp-server-bin.test.d.ts.map +1 -0
- package/dist/test/mcp-server-bin.test.js +142 -0
- package/dist/test/mcp-server-bin.test.js.map +1 -0
- package/dist/test/mcpl-awareness-barrier.test.js +141 -0
- package/dist/test/mcpl-awareness-barrier.test.js.map +1 -1
- package/dist/test/mcpl-child-env.test.js +1 -1
- package/dist/test/mcpl-child-env.test.js.map +1 -1
- package/dist/test/mcpl-coalesced-content-parity.test.d.ts +2 -0
- package/dist/test/mcpl-coalesced-content-parity.test.d.ts.map +1 -0
- package/dist/test/mcpl-coalesced-content-parity.test.js +532 -0
- package/dist/test/mcpl-coalesced-content-parity.test.js.map +1 -0
- package/dist/test/mcpl-coalescing.test.js +78 -16
- package/dist/test/mcpl-coalescing.test.js.map +1 -1
- package/dist/test/mcpl-config-diagnostics.test.js +6 -3
- package/dist/test/mcpl-config-diagnostics.test.js.map +1 -1
- package/dist/test/mcpl-gate-roundtrip.test.js.map +1 -1
- package/dist/test/mcpl-manifest-changed.test.js +2 -1
- package/dist/test/mcpl-manifest-changed.test.js.map +1 -1
- package/dist/test/mcpl-reconnect-events.test.js.map +1 -1
- package/dist/test/mcpl-reconnect-reregistration.test.js +2 -0
- package/dist/test/mcpl-reconnect-reregistration.test.js.map +1 -1
- package/dist/test/mcpl-reference-fetcher.test.js +232 -4
- package/dist/test/mcpl-reference-fetcher.test.js.map +1 -1
- package/dist/test/mcpl-reference-fields.test.js +69 -2
- package/dist/test/mcpl-reference-fields.test.js.map +1 -1
- package/dist/test/mcpl-rejection-log-lines.test.d.ts +2 -0
- package/dist/test/mcpl-rejection-log-lines.test.d.ts.map +1 -0
- package/dist/test/mcpl-rejection-log-lines.test.js +349 -0
- package/dist/test/mcpl-rejection-log-lines.test.js.map +1 -0
- package/dist/test/mcpl-stderr-tail.test.d.ts +2 -0
- package/dist/test/mcpl-stderr-tail.test.d.ts.map +1 -0
- package/dist/test/mcpl-stderr-tail.test.js +210 -0
- package/dist/test/mcpl-stderr-tail.test.js.map +1 -0
- package/dist/test/mcpl-tool-lifecycle-e2e.test.js.map +1 -1
- package/dist/test/mcpl-tool-lifecycle-emitter.test.js.map +1 -1
- package/dist/test/mcpl-tool-lifecycle-script.test.js.map +1 -1
- package/dist/test/mcpl-tool-lifecycle.test.js.map +1 -1
- package/dist/test/mcpl-transport-close.test.d.ts +2 -0
- package/dist/test/mcpl-transport-close.test.d.ts.map +1 -0
- package/dist/test/mcpl-transport-close.test.js +373 -0
- package/dist/test/mcpl-transport-close.test.js.map +1 -0
- package/dist/test/mcpl-transport-spawn.test.d.ts +2 -0
- package/dist/test/mcpl-transport-spawn.test.d.ts.map +1 -0
- package/dist/test/mcpl-transport-spawn.test.js +58 -0
- package/dist/test/mcpl-transport-spawn.test.js.map +1 -0
- package/dist/test/mcpl-ws-transport.test.js +104 -0
- package/dist/test/mcpl-ws-transport.test.js.map +1 -1
- package/dist/test/offline-recovery-branch.test.js +344 -0
- package/dist/test/offline-recovery-branch.test.js.map +1 -1
- package/dist/test/operator-surgery.test.js +197 -0
- package/dist/test/operator-surgery.test.js.map +1 -1
- package/dist/test/ops-alert.test.js +2 -1
- package/dist/test/ops-alert.test.js.map +1 -1
- package/dist/test/overbudget-drain-breaker.test.js +1 -0
- package/dist/test/overbudget-drain-breaker.test.js.map +1 -1
- package/dist/test/pack-installs-alone.test.d.ts +2 -0
- package/dist/test/pack-installs-alone.test.d.ts.map +1 -0
- package/dist/test/pack-installs-alone.test.js +284 -0
- package/dist/test/pack-installs-alone.test.js.map +1 -0
- package/dist/test/physical-window-restart.test.d.ts +6 -4
- package/dist/test/physical-window-restart.test.d.ts.map +1 -1
- package/dist/test/physical-window-restart.test.js +275 -10
- package/dist/test/physical-window-restart.test.js.map +1 -1
- package/dist/test/placed-reaction-baseline.test.d.ts +2 -0
- package/dist/test/placed-reaction-baseline.test.d.ts.map +1 -0
- package/dist/test/placed-reaction-baseline.test.js +312 -0
- package/dist/test/placed-reaction-baseline.test.js.map +1 -0
- package/dist/test/present-while-acting.test.js +949 -6
- package/dist/test/present-while-acting.test.js.map +1 -1
- package/dist/test/provider-acceleration-cooldown.test.js +5 -1
- package/dist/test/provider-acceleration-cooldown.test.js.map +1 -1
- package/dist/test/provider-waits.test.d.ts +2 -0
- package/dist/test/provider-waits.test.d.ts.map +1 -0
- package/dist/test/provider-waits.test.js +2259 -0
- package/dist/test/provider-waits.test.js.map +1 -0
- package/dist/test/puppet-tool-call.test.js +2 -0
- package/dist/test/puppet-tool-call.test.js.map +1 -1
- package/dist/test/reaction-baseline-platform.test.d.ts +2 -0
- package/dist/test/reaction-baseline-platform.test.d.ts.map +1 -0
- package/dist/test/reaction-baseline-platform.test.js +124 -0
- package/dist/test/reaction-baseline-platform.test.js.map +1 -0
- package/dist/test/record-journal.test.js.map +1 -1
- package/dist/test/refusal-reaction-baseline.test.js +10 -3
- package/dist/test/refusal-reaction-baseline.test.js.map +1 -1
- package/dist/test/refusal-rewind.test.js +9 -0
- package/dist/test/refusal-rewind.test.js.map +1 -1
- package/dist/test/refusal-single-call.test.js.map +1 -1
- package/dist/test/release-bump.test.d.ts +2 -0
- package/dist/test/release-bump.test.d.ts.map +1 -0
- package/dist/test/release-bump.test.js +248 -0
- package/dist/test/release-bump.test.js.map +1 -0
- package/dist/test/release-changelog.test.js.map +1 -1
- package/dist/test/release-holds.test.d.ts +2 -0
- package/dist/test/release-holds.test.d.ts.map +1 -0
- package/dist/test/release-holds.test.js +456 -0
- package/dist/test/release-holds.test.js.map +1 -0
- package/dist/test/same-round-think-policy.test.js.map +1 -1
- package/dist/test/save-recent-image.test.js +138 -2
- package/dist/test/save-recent-image.test.js.map +1 -1
- package/dist/test/shutdown-errors.test.js.map +1 -1
- package/dist/test/silent-heartbeat-rows.test.js.map +1 -1
- package/dist/test/stop-with-host-operations.test.d.ts +20 -0
- package/dist/test/stop-with-host-operations.test.d.ts.map +1 -0
- package/dist/test/stop-with-host-operations.test.js +1174 -0
- package/dist/test/stop-with-host-operations.test.js.map +1 -0
- package/dist/test/stop-with-work-in-flight.test.js +162 -50
- package/dist/test/stop-with-work-in-flight.test.js.map +1 -1
- package/dist/test/surgery-marks-receipt.test.d.ts +2 -0
- package/dist/test/surgery-marks-receipt.test.d.ts.map +1 -0
- package/dist/test/surgery-marks-receipt.test.js +540 -0
- package/dist/test/surgery-marks-receipt.test.js.map +1 -0
- package/dist/test/tool-batch-hook.test.js.map +1 -1
- package/dist/test/tool-result-guard.test.js +352 -16
- package/dist/test/tool-result-guard.test.js.map +1 -1
- package/dist/test/tool-result-spill.test.js.map +1 -1
- package/dist/test/tool-wrapper-prose-guard-integration.test.js.map +1 -1
- package/dist/test/trunk-channel-routing.test.js +330 -7
- package/dist/test/trunk-channel-routing.test.js.map +1 -1
- package/dist/test/tune-out-e2e.test.js.map +1 -1
- package/dist/test/unconvertible-tool-result.test.js.map +1 -1
- package/dist/test/unsent-compiles.test.d.ts +2 -0
- package/dist/test/unsent-compiles.test.d.ts.map +1 -0
- package/dist/test/unsent-compiles.test.js +139 -0
- package/dist/test/unsent-compiles.test.js.map +1 -0
- package/dist/test/workspace-branch-continuation.test.js.map +1 -1
- package/dist/test/workspace-materialize-freshness.test.js.map +1 -1
- package/dist/test/workspace-read-text.test.js.map +1 -1
- package/dist/test/workspace-three-way.test.js +1022 -7
- package/dist/test/workspace-three-way.test.js.map +1 -1
- package/dist/test/workspace-watcher.test.js.map +1 -1
- package/dist/test/xml-round-persist.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/src/agent.ts +415 -67
- package/src/api/mcp-server-core.ts +681 -0
- package/src/api/mcp-server.ts +16 -685
- package/src/api/server.ts +87 -26
- package/src/api/types.ts +9 -1
- package/src/framework.ts +3389 -782
- package/src/index.ts +9 -4
- package/src/mcpl/channel-registry.ts +126 -31
- package/src/mcpl/feature-set-manager.ts +4 -3
- package/src/mcpl/index.ts +2 -0
- package/src/mcpl/log-value.ts +116 -0
- package/src/mcpl/prose-stream-router.ts +6 -6
- package/src/mcpl/push-coalescer.ts +76 -12
- package/src/mcpl/push-handler.ts +95 -23
- package/src/mcpl/reference-fetcher.ts +18 -8
- package/src/mcpl/references.ts +57 -13
- package/src/mcpl/refusal-lines.ts +59 -0
- package/src/mcpl/server-connection.ts +125 -15
- package/src/mcpl/tool-classes.ts +3 -2
- package/src/mcpl/transport.ts +105 -14
- package/src/mcpl/types.ts +5 -1
- package/src/module-registry.ts +17 -9
- package/src/modules/discord/index.ts +4 -2
- package/src/modules/workspace/disk-agreement.ts +74 -18
- package/src/modules/workspace/index.ts +85 -15
- package/src/modules/workspace/observe.ts +295 -43
- package/src/modules/workspace/reconcile.ts +90 -12
- package/src/modules/workspace/types.ts +26 -1
- package/src/operator-log.ts +30 -0
- package/src/provider-waits.ts +523 -0
- package/src/recovery/offline-branch.ts +32 -28
- package/src/refusal-reactions.ts +14 -12
- package/src/stored-removal.ts +126 -0
- package/src/tool-result-guard.ts +72 -24
- package/src/types/agent.ts +42 -6
- package/src/types/events.ts +12 -0
- package/src/types/framework.ts +10 -0
- package/src/types/module.ts +20 -8
- package/src/types/trace.ts +76 -14
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
* that isn't that directory any more (an unmounted drive whose mountpoint is
|
|
16
16
|
* now empty, a replaced directory) is an unavailable mount, never a disk on
|
|
17
17
|
* which every file was deleted; only an explicit acceptance takes it, and
|
|
18
|
-
* that starts its evidence afresh.
|
|
18
|
+
* that starts its evidence afresh. A place, where a walk stopped (`walks`),
|
|
19
|
+
* binds no root: it only says where the next walk starts, in whatever
|
|
20
|
+
* directory the root is by then.
|
|
19
21
|
*
|
|
20
22
|
* Every transition is write-ahead (see reconcile.ts): an `intent` entry
|
|
21
23
|
* (`pending`, with the prior value and the expected one) is durable before the
|
|
@@ -55,9 +57,10 @@ export class DiskAgreement {
|
|
|
55
57
|
mounts = new Map();
|
|
56
58
|
configured = [];
|
|
57
59
|
/**
|
|
58
|
-
* An append (or a rebuild) not yet made durable. Cleared only
|
|
59
|
-
* barrier that succeeds, so a failed barrier stays owed: a later pass
|
|
60
|
-
* nothing new to record still settles it before deciding anything.
|
|
60
|
+
* An append of evidence (or a rebuild) not yet made durable. Cleared only
|
|
61
|
+
* by a barrier that succeeds, so a failed barrier stays owed: a later pass
|
|
62
|
+
* with nothing new to record still settles it before deciding anything. A
|
|
63
|
+
* place owes none (recordWalk).
|
|
61
64
|
*/
|
|
62
65
|
unsynced = false;
|
|
63
66
|
constructor(store) {
|
|
@@ -109,24 +112,20 @@ export class DiskAgreement {
|
|
|
109
112
|
root: mount.root,
|
|
110
113
|
...(mount.identity ? { identity: mount.identity } : {}),
|
|
111
114
|
paths: new Map(Object.entries(mount.paths)),
|
|
115
|
+
walks: new Map(Object.entries(mount.walks ?? {})),
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
118
|
for (const { entry } of entries) {
|
|
115
119
|
if (entry.t === 'mount') {
|
|
116
120
|
const existing = replayed.get(entry.mount);
|
|
117
|
-
if (!existing || !sameRootPath(existing.root, entry.root))
|
|
118
|
-
replayed.set(entry.mount, { root: entry.root, paths: new Map() });
|
|
121
|
+
if (!existing || !sameRootPath(existing.root, entry.root)) {
|
|
122
|
+
replayed.set(entry.mount, { root: entry.root, paths: new Map(), walks: new Map() });
|
|
123
|
+
}
|
|
119
124
|
continue;
|
|
120
125
|
}
|
|
121
126
|
const mount = replayed.get(entry.mount);
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
if (entry.t === 'root')
|
|
125
|
-
applyRoot(mount, entry);
|
|
126
|
-
else if (entry.t === 'set')
|
|
127
|
-
mount.paths.set(entry.path, entry.value);
|
|
128
|
-
else
|
|
129
|
-
mount.paths.delete(entry.path);
|
|
127
|
+
if (mount)
|
|
128
|
+
apply(mount, entry);
|
|
130
129
|
}
|
|
131
130
|
this.mounts.clear();
|
|
132
131
|
for (const { name, root } of this.configured) {
|
|
@@ -135,7 +134,7 @@ export class DiskAgreement {
|
|
|
135
134
|
this.mounts.set(name, found);
|
|
136
135
|
}
|
|
137
136
|
else {
|
|
138
|
-
this.mounts.set(name, { root, paths: new Map() });
|
|
137
|
+
this.mounts.set(name, { root, paths: new Map(), walks: new Map() });
|
|
139
138
|
this.journal.append({ t: 'mount', mount: name, root });
|
|
140
139
|
}
|
|
141
140
|
}
|
|
@@ -179,6 +178,28 @@ export class DiskAgreement {
|
|
|
179
178
|
}
|
|
180
179
|
return out;
|
|
181
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Where the next walk of `scope` ('' for the mount root) resumes: the last
|
|
183
|
+
* entry a walk of it took before its cap stopped it, if one did.
|
|
184
|
+
*/
|
|
185
|
+
walkResumesAfter(mount, scope) {
|
|
186
|
+
this.ensureReconciled();
|
|
187
|
+
return this.mounts.get(mount)?.walks.get(scope);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Record where a walk of `scope` stopped (`after`), or that one covered it
|
|
191
|
+
* (null). Kept with the evidence so a restart resumes there too. A place
|
|
192
|
+
* that's lost costs coverage, never a decision: an append that didn't land
|
|
193
|
+
* loses one, and a checkpoint written by a version that doesn't keep them
|
|
194
|
+
* (0.22) loses them all, and each scope's walks start at its top again.
|
|
195
|
+
* So recording one owes no barrier: a pass that moves only its place makes
|
|
196
|
+
* no store sync, and the place becomes durable with the next one.
|
|
197
|
+
*/
|
|
198
|
+
recordWalk(mount, scope, after) {
|
|
199
|
+
if ((this.walkResumesAfter(mount, scope) ?? null) === after)
|
|
200
|
+
return;
|
|
201
|
+
this.write({ t: 'walk', mount, scope, after }, {});
|
|
202
|
+
}
|
|
182
203
|
/**
|
|
183
204
|
* Record an intent. `durable` makes it (and every append before it) stable
|
|
184
205
|
* before the caller performs the effect; batches pass it on their last one.
|
|
@@ -212,19 +233,16 @@ export class DiskAgreement {
|
|
|
212
233
|
}
|
|
213
234
|
write(entry, opts) {
|
|
214
235
|
this.ensureReconciled();
|
|
215
|
-
|
|
236
|
+
// Evidence is owed a barrier until proven durable: a failed append may
|
|
237
|
+
// still have landed. A place isn't (recordWalk).
|
|
238
|
+
if (entry.t !== 'walk')
|
|
239
|
+
this.unsynced = true;
|
|
216
240
|
this.journal.append(entry, opts);
|
|
217
241
|
if (opts.durable)
|
|
218
242
|
this.unsynced = false; // synced after this append, and so everything before it
|
|
219
243
|
const mount = this.mounts.get(entry.mount);
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
if (entry.t === 'root')
|
|
223
|
-
applyRoot(mount, entry);
|
|
224
|
-
else if (entry.t === 'set')
|
|
225
|
-
mount.paths.set(entry.path, entry.value);
|
|
226
|
-
else if (entry.t === 'forget')
|
|
227
|
-
mount.paths.delete(entry.path);
|
|
244
|
+
if (mount)
|
|
245
|
+
apply(mount, entry);
|
|
228
246
|
}
|
|
229
247
|
/** Checkpoint when the tail has outgrown the live evidence. */
|
|
230
248
|
maybeCheckpoint() {
|
|
@@ -241,6 +259,7 @@ export class DiskAgreement {
|
|
|
241
259
|
root: mount.root,
|
|
242
260
|
...(mount.identity ? { identity: mount.identity } : {}),
|
|
243
261
|
paths: Object.fromEntries(mount.paths),
|
|
262
|
+
...(mount.walks.size > 0 ? { walks: Object.fromEntries(mount.walks) } : {}),
|
|
244
263
|
};
|
|
245
264
|
}
|
|
246
265
|
this.journal.checkpoint(snapshot);
|
|
@@ -251,9 +270,28 @@ export class DiskAgreement {
|
|
|
251
270
|
this.unsynced = false;
|
|
252
271
|
}
|
|
253
272
|
}
|
|
273
|
+
/** Apply one entry to a mount's evidence; one of a kind this version doesn't know changes nothing. */
|
|
274
|
+
function apply(mount, entry) {
|
|
275
|
+
if (entry.t === 'root')
|
|
276
|
+
applyRoot(mount, entry);
|
|
277
|
+
else if (entry.t === 'set')
|
|
278
|
+
mount.paths.set(entry.path, entry.value);
|
|
279
|
+
else if (entry.t === 'forget')
|
|
280
|
+
mount.paths.delete(entry.path);
|
|
281
|
+
else if (entry.t === 'walk') {
|
|
282
|
+
if (entry.after === null)
|
|
283
|
+
mount.walks.delete(entry.scope);
|
|
284
|
+
else
|
|
285
|
+
mount.walks.set(entry.scope, entry.after);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
254
288
|
function applyRoot(mount, entry) {
|
|
255
289
|
mount.identity = entry.identity;
|
|
256
|
-
if (entry.reset)
|
|
290
|
+
if (entry.reset) {
|
|
291
|
+
// Evidence about another directory says nothing about this one, and the
|
|
292
|
+
// accepted root's walks start at its top.
|
|
257
293
|
mount.paths.clear();
|
|
294
|
+
mount.walks.clear();
|
|
295
|
+
}
|
|
258
296
|
}
|
|
259
297
|
//# sourceMappingURL=disk-agreement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disk-agreement.js","sourceRoot":"","sources":["../../../../src/modules/workspace/disk-agreement.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"disk-agreement.js","sourceRoot":"","sources":["../../../../src/modules/workspace/disk-agreement.ts"],"names":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I;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0DrH;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0B7H;AAED,oGAAoG;AACpG,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAM7C"}
|
|
@@ -389,10 +389,14 @@ export declare class WorkspaceModule implements Module {
|
|
|
389
389
|
* After an agent's completed tool batch, before anything continues its turn:
|
|
390
390
|
* scan every `watch: 'on-agent-action'` mount, so what the batch's tools did
|
|
391
391
|
* on disk (a shell command's files, a deletion) is in the workspace when the
|
|
392
|
-
* agent next looks.
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
392
|
+
* agent next looks. On a mount over its walkCap, that holds for the first
|
|
393
|
+
* walkCap entries in the walk's order, which every batch's scan takes; files
|
|
394
|
+
* past them come in through syncs and the listings that reach them, while a
|
|
395
|
+
* read takes in only a file the workspace doesn't hold yet. A scan that
|
|
396
|
+
* outlasts the deadline stops holding the round: the miss is recorded on
|
|
397
|
+
* the mount's status and pushed as a `workspace:agent-action-scan-incomplete`
|
|
398
|
+
* event, and the scan continues, deciding on the branch selected when it
|
|
399
|
+
* applies.
|
|
396
400
|
*/
|
|
397
401
|
onToolBatchComplete(_agentName?: string): Promise<void>;
|
|
398
402
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAEV,eAAe,EAmBhB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAEV,eAAe,EAmBhB,MAAM,YAAY,CAAC;AA8BpB,YAAY,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,SAAS,GACV,MAAM,YAAY,CAAC;AA0BpB;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,WAAW,GACX,mBAAmB,GACnB,WAAW,GACX,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,CAAC;AAEd,kFAAkF;AAClF,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,OAAO,GACP,eAAe,GACf,MAAM,GACN,OAAO,GACP,YAAY,GACZ,UAAU,GACV,MAAM,GACN,MAAM,CAAC;AAEX;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,K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IAKlC;;;;;OAKG;YACW,YAAY;IAO1B,yEAAyE;IACzE,OAAO,CAAC,cAAc;YAuBR,UAAU;YAoFV,eAAe;YAwEf,WAAW;YAoCX,UAAU;YAoEV,YAAY;YA+BZ,QAAQ;YA2DR,UAAU;YAmCV,UAAU;YAoIV,YAAY;IA4C1B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,oBAAoB;IAkB5B;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;YAiBX,iBAAiB;IA6H/B;;;;OAIG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA0B3D;YAEa,UAAU;IA0IxB;;;;OAIG;YACW,kBAAkB;IAiBhC;;;;;;OAMG;YACW,eAAe;IAQ7B;;;;;;;;;;;;OAYG;IACG,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B5D;IAED;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAOhC,qFAAqF;IACrF,OAAO,CAAC,qBAAqB;IAK7B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAsCvB,8EAA8E;IAC9E,OAAO,CAAC,yBAAyB;IAajC;;;;OAIG;IACH,OAAO,CAAC,YAAY;CA6BrB"}
|
|
@@ -12,9 +12,9 @@ import { MountWatcher } from './watcher.js';
|
|
|
12
12
|
import { hashContent, DEFAULT_MAX_FILE_SIZE } from './sync.js';
|
|
13
13
|
import { DiskAgreement, sameRootIdentity } from './disk-agreement.js';
|
|
14
14
|
import { BranchIntents } from './branch-intent.js';
|
|
15
|
-
import { filesystemTrustsCtime, locateRoot } from './observe.js';
|
|
15
|
+
import { coveredByIgnore, filesystemTrustsCtime, locateRoot } from './observe.js';
|
|
16
16
|
import { TOOL_BATCH_HOOK_TIMEOUT_MS } from '../../module-registry.js';
|
|
17
|
-
import { pushPaths, reconcilePass, settleAdoptionBeforeMutation, } from './reconcile.js';
|
|
17
|
+
import { WALK_CAP, pushPaths, reconcilePass, settleAdoptionBeforeMutation, } from './reconcile.js';
|
|
18
18
|
/** Default for how long the after-batch scan may hold the agent's next inference. */
|
|
19
19
|
const AGENT_ACTION_SCAN_DEADLINE_MS = 20_000;
|
|
20
20
|
/** Why a call is refused once the module has stopped. */
|
|
@@ -471,6 +471,14 @@ export class WorkspaceModule {
|
|
|
471
471
|
* startup already is (issue #72). Cleared after application. */
|
|
472
472
|
savedState = null;
|
|
473
473
|
constructor(config) {
|
|
474
|
+
for (const mount of config.mounts) {
|
|
475
|
+
const cap = mount.walkCap;
|
|
476
|
+
if (cap !== undefined && !(Number.isSafeInteger(cap) && cap > 0)) {
|
|
477
|
+
// Numbers as JavaScript writes them (JSON would say null for NaN), anything else as JSON.
|
|
478
|
+
const shown = typeof cap === 'number' ? String(cap) : typeof cap === 'bigint' ? `${cap}n` : JSON.stringify(cap) ?? String(cap);
|
|
479
|
+
throw new Error(`[workspace] Mount "${mount.name}": walkCap must be a positive integer no larger than ${Number.MAX_SAFE_INTEGER}, not ${shown}`);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
474
482
|
// Detect overlapping mount paths: if mount A contains mount B,
|
|
475
483
|
// auto-add an ignore rule on A for B's path to prevent syncing
|
|
476
484
|
// the sub-mount's directory through the super-mount.
|
|
@@ -591,6 +599,8 @@ export class WorkspaceModule {
|
|
|
591
599
|
treeStateId: mount.treeStateId,
|
|
592
600
|
intents: this.intents.get(mount.config.name),
|
|
593
601
|
readOnly: mount.config.mode === 'read-only',
|
|
602
|
+
walkCap: mount.config.walkCap ?? WALK_CAP,
|
|
603
|
+
catchUpScan: (mount.config.watch ?? 'always') === 'always',
|
|
594
604
|
};
|
|
595
605
|
}
|
|
596
606
|
/** One disk→store pass; the caller holds the mount's turn. Emits its events. */
|
|
@@ -777,9 +787,12 @@ export class WorkspaceModule {
|
|
|
777
787
|
watcher.start();
|
|
778
788
|
this.watchers.set(name, watcher);
|
|
779
789
|
// Chokidar is started with ignoreInitial:true, so changes made while
|
|
780
|
-
// the session was down would be invisible.
|
|
781
|
-
// under the three-way rule: only real differences produce tree
|
|
782
|
-
// changes and events.
|
|
790
|
+
// the session was down would be invisible. A catch-up pass takes them
|
|
791
|
+
// in under the three-way rule: only real differences produce tree
|
|
792
|
+
// changes and events. It takes its turn with the mount's bare syncs,
|
|
793
|
+
// so on a mount over its walkCap it covers the walkCap entries after
|
|
794
|
+
// where the last turn stopped, and a change elsewhere waits for the
|
|
795
|
+
// rotation to reach it, or for a sync of its path.
|
|
783
796
|
void this.initialScan(name);
|
|
784
797
|
}
|
|
785
798
|
this.ctx.pushEvent({
|
|
@@ -797,7 +810,7 @@ export class WorkspaceModule {
|
|
|
797
810
|
try {
|
|
798
811
|
// A full pass under the three-way rule: deletions on disk are confirmed
|
|
799
812
|
// where nothing newer is pending, and nothing unvisited is touched.
|
|
800
|
-
await this.withMount(mount, () => this.passUnlocked(mount, { kind: 'dir', dir: '', recursive: true }));
|
|
813
|
+
await this.withMount(mount, () => this.passUnlocked(mount, { kind: 'dir', dir: '', recursive: true }, { resume: true }));
|
|
801
814
|
}
|
|
802
815
|
catch (err) {
|
|
803
816
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -1001,7 +1014,12 @@ export class WorkspaceModule {
|
|
|
1001
1014
|
{
|
|
1002
1015
|
name: 'sync',
|
|
1003
1016
|
description: 'Bring disk changes into the workspace. Without a path, every mount (or the given one) is '
|
|
1004
|
-
+ 'rechecked
|
|
1017
|
+
+ 'rechecked and nothing pending in the workspace is discarded. A sync takes up to the mount\'s walk '
|
|
1018
|
+
+ 'cap of entries, files, links and the like (5000 unless configured). Past it, what this one didn\'t reach is listed under '
|
|
1019
|
+
+ '`incomplete`, and the walk takes turns: the next sync of the same mount or directory picks up where '
|
|
1020
|
+
+ 'the last turn stopped, so repeated syncs cover it all. On a mount watched continuously, its own catch-up '
|
|
1021
|
+
+ 'scan, at start and when its watcher reattaches, takes turns with its whole-mount syncs. With a '
|
|
1022
|
+
+ 'path (file or directory), '
|
|
1005
1023
|
+ 'the workspace takes disk\'s state there explicitly: it restores a workspace-deleted file, resolves '
|
|
1006
1024
|
+ 'conflicts toward disk, replaces a workspace draft, and removes a workspace file disk does not have. '
|
|
1007
1025
|
+ 'Each workspace change it gives up is listed under `discarded`, with the state it had and, as `op`, '
|
|
@@ -1010,7 +1028,14 @@ export class WorkspaceModule {
|
|
|
1010
1028
|
+ 'A mount whose root is not the directory disk last agreed with (an unmounted drive, a replaced '
|
|
1011
1029
|
+ 'directory) is unavailable and listed under `incomplete`. Reconnect the drive; acceptRoot is for a '
|
|
1012
1030
|
+ 'directory replaced on purpose, or a drive back under a new device number, never for one still '
|
|
1013
|
-
+ 'unplugged, whose empty mountpoint would become the root.'
|
|
1031
|
+
+ 'unplugged, whose empty mountpoint would become the root. What the scan passed over by design and '
|
|
1032
|
+
+ 'reported nowhere else is counted under `passedOver`, by mount and reason: entries the mount\'s '
|
|
1033
|
+
+ 'ignore list covers that hold nothing the workspace tracks (an ignored directory counts once). So a '
|
|
1034
|
+
+ 'total of 0, with no conflicts and nothing under `passedOver`, `incomplete` or `skipped`, means the '
|
|
1035
|
+
+ 'sync looked everywhere and nothing had changed. A path the mount ignores is synced when you name '
|
|
1036
|
+
+ 'it, and listed under `ignored`: a sync without a path passes over it. Naming an ignored directory '
|
|
1037
|
+
+ 'sets aside the patterns that cover it or a directory above it; one that covers only something '
|
|
1038
|
+
+ 'inside it still applies, and what it covers is passed over.',
|
|
1014
1039
|
inputSchema: {
|
|
1015
1040
|
type: 'object',
|
|
1016
1041
|
properties: {
|
|
@@ -2044,7 +2069,9 @@ export class WorkspaceModule {
|
|
|
2044
2069
|
isError: true,
|
|
2045
2070
|
};
|
|
2046
2071
|
}
|
|
2047
|
-
|
|
2072
|
+
// Its whole receipt is what it changed: kept in the stub if the guard
|
|
2073
|
+
// withholds the result (agent-framework #277).
|
|
2074
|
+
return { success: true, data: { path: input.path, deleted: true }, keepWhenWithheld: ['path', 'deleted'] };
|
|
2048
2075
|
});
|
|
2049
2076
|
}
|
|
2050
2077
|
async handleLs(input) {
|
|
@@ -2480,6 +2507,10 @@ export class WorkspaceModule {
|
|
|
2480
2507
|
: {}),
|
|
2481
2508
|
...(blocked.length > 0 ? { skipped: blocked } : {}),
|
|
2482
2509
|
},
|
|
2510
|
+
// What disk lost, then what it was written: kept in the stub if the
|
|
2511
|
+
// guard withholds the result (agent-framework #277). What was left or
|
|
2512
|
+
// skipped, and why, is in the full result.
|
|
2513
|
+
keepWhenWithheld: ['deleted', 'materialized'],
|
|
2483
2514
|
};
|
|
2484
2515
|
}
|
|
2485
2516
|
/**
|
|
@@ -2521,6 +2552,8 @@ export class WorkspaceModule {
|
|
|
2521
2552
|
const allResults = [];
|
|
2522
2553
|
const allSkipped = [];
|
|
2523
2554
|
const allIncomplete = [];
|
|
2555
|
+
const allPassedOver = [];
|
|
2556
|
+
const allIgnored = [];
|
|
2524
2557
|
const rootsAccepted = [];
|
|
2525
2558
|
if (input.acceptRoot && input.path) {
|
|
2526
2559
|
return { success: false, error: 'acceptRoot takes a whole mount\'s root: give mount, or nothing, not path', isError: true };
|
|
@@ -2547,7 +2580,8 @@ export class WorkspaceModule {
|
|
|
2547
2580
|
rootsAccepted.push(name);
|
|
2548
2581
|
if (!relativePath) {
|
|
2549
2582
|
// A full recheck: every file rehashed, nothing pending discarded.
|
|
2550
|
-
|
|
2583
|
+
// Past the mount's walkCap, it resumes where the last one stopped.
|
|
2584
|
+
return this.passUnlocked(mount, { kind: 'dir', dir: '', recursive: true }, { rehash: true, resume: true });
|
|
2551
2585
|
}
|
|
2552
2586
|
// An explicit path: the workspace takes disk's state there.
|
|
2553
2587
|
const prefix = relativePath + '/';
|
|
@@ -2555,10 +2589,12 @@ export class WorkspaceModule {
|
|
|
2555
2589
|
store.treeList(mount.treeStateId, prefix).length > 0 ||
|
|
2556
2590
|
this.agreementOrThrow().paths(name, relativePath).some(([p]) => p.startsWith(prefix)) ||
|
|
2557
2591
|
this.intents.get(name).list(relativePath).some(([p]) => p.startsWith(prefix));
|
|
2558
|
-
|
|
2592
|
+
// named: ignore patterns covering the path asked for don't apply
|
|
2593
|
+
// beneath it (a directory scope's walk; a path scope doesn't walk).
|
|
2594
|
+
const opts = { rehash: true, adopt: () => true, branchId: askedOn, named: true };
|
|
2559
2595
|
if (!isDir)
|
|
2560
2596
|
return this.passUnlocked(mount, { kind: 'paths', paths: [relativePath] }, opts);
|
|
2561
|
-
const beneath = await this.passUnlocked(mount, { kind: 'dir', dir: relativePath, recursive: true }, opts);
|
|
2597
|
+
const beneath = await this.passUnlocked(mount, { kind: 'dir', dir: relativePath, recursive: true }, { ...opts, resume: true });
|
|
2562
2598
|
// Something at the path itself is no part of a directory scope: a file
|
|
2563
2599
|
// disk has where the workspace holds a directory, or a workspace file
|
|
2564
2600
|
// where disk has a directory. Its own pass takes disk's state there
|
|
@@ -2572,12 +2608,16 @@ export class WorkspaceModule {
|
|
|
2572
2608
|
if (!atPath)
|
|
2573
2609
|
return beneath;
|
|
2574
2610
|
const itself = await this.passUnlocked(mount, { kind: 'paths', paths: [relativePath] }, opts);
|
|
2611
|
+
const passedOver = new Map(beneath.passedOver);
|
|
2612
|
+
for (const [reason, count] of itself.passedOver)
|
|
2613
|
+
passedOver.set(reason, (passedOver.get(reason) ?? 0) + count);
|
|
2575
2614
|
return {
|
|
2576
2615
|
ops: [...beneath.ops, ...itself.ops],
|
|
2577
2616
|
discarded: [...beneath.discarded, ...itself.discarded],
|
|
2578
2617
|
newConflicts: [...beneath.newConflicts, ...itself.newConflicts],
|
|
2579
2618
|
reports: new Map([...beneath.reports, ...itself.reports]),
|
|
2580
2619
|
incomplete: [...beneath.incomplete, ...itself.incomplete],
|
|
2620
|
+
passedOver,
|
|
2581
2621
|
dirs: beneath.dirs,
|
|
2582
2622
|
branchId: itself.branchId ?? beneath.branchId,
|
|
2583
2623
|
};
|
|
@@ -2605,6 +2645,18 @@ export class WorkspaceModule {
|
|
|
2605
2645
|
}
|
|
2606
2646
|
for (const region of pass.incomplete)
|
|
2607
2647
|
allIncomplete.push({ mount: name, ...region });
|
|
2648
|
+
for (const [reason, count] of pass.passedOver)
|
|
2649
|
+
allPassedOver.push({ mount: name, reason, count });
|
|
2650
|
+
// A path named explicitly is synced even where the mount's ignore list
|
|
2651
|
+
// covers it, and the result says so: a sync without a path passes
|
|
2652
|
+
// over it, so nothing else keeps it current (agent-framework #276).
|
|
2653
|
+
if (coveredByIgnore(relativePath, mount.config.ignore ?? [])) {
|
|
2654
|
+
allIgnored.push({
|
|
2655
|
+
mount: name,
|
|
2656
|
+
path: relativePath,
|
|
2657
|
+
note: 'this mount\'s ignore list covers it, so a sync without a path won\'t maintain it',
|
|
2658
|
+
});
|
|
2659
|
+
}
|
|
2608
2660
|
}
|
|
2609
2661
|
return {
|
|
2610
2662
|
success: true,
|
|
@@ -2614,8 +2666,17 @@ export class WorkspaceModule {
|
|
|
2614
2666
|
totalConflicts: allResults.reduce((sum, r) => sum + r.conflicts.length, 0),
|
|
2615
2667
|
...(allSkipped.length > 0 ? { skipped: allSkipped } : {}),
|
|
2616
2668
|
...(allIncomplete.length > 0 ? { incomplete: allIncomplete } : {}),
|
|
2669
|
+
...(allPassedOver.length > 0 ? { passedOver: allPassedOver } : {}),
|
|
2670
|
+
...(allIgnored.length > 0 ? { ignored: allIgnored } : {}),
|
|
2617
2671
|
...(rootsAccepted.length > 0 ? { rootsAccepted } : {}),
|
|
2618
2672
|
},
|
|
2673
|
+
// What the workspace took from disk, gave up, or now holds as a
|
|
2674
|
+
// conflict, per mount, and any root it accepted: kept in the stub if
|
|
2675
|
+
// the guard withholds the result (agent-framework #277). What the scan
|
|
2676
|
+
// skipped or couldn't see is in the full result.
|
|
2677
|
+
// A root it accepted is short and telling: first, so a long results
|
|
2678
|
+
// list can't cut it away.
|
|
2679
|
+
keepWhenWithheld: ['rootsAccepted', 'results'],
|
|
2619
2680
|
};
|
|
2620
2681
|
}
|
|
2621
2682
|
/**
|
|
@@ -2662,10 +2723,14 @@ export class WorkspaceModule {
|
|
|
2662
2723
|
* After an agent's completed tool batch, before anything continues its turn:
|
|
2663
2724
|
* scan every `watch: 'on-agent-action'` mount, so what the batch's tools did
|
|
2664
2725
|
* on disk (a shell command's files, a deletion) is in the workspace when the
|
|
2665
|
-
* agent next looks.
|
|
2666
|
-
*
|
|
2667
|
-
*
|
|
2668
|
-
*
|
|
2726
|
+
* agent next looks. On a mount over its walkCap, that holds for the first
|
|
2727
|
+
* walkCap entries in the walk's order, which every batch's scan takes; files
|
|
2728
|
+
* past them come in through syncs and the listings that reach them, while a
|
|
2729
|
+
* read takes in only a file the workspace doesn't hold yet. A scan that
|
|
2730
|
+
* outlasts the deadline stops holding the round: the miss is recorded on
|
|
2731
|
+
* the mount's status and pushed as a `workspace:agent-action-scan-incomplete`
|
|
2732
|
+
* event, and the scan continues, deciding on the branch selected when it
|
|
2733
|
+
* applies.
|
|
2669
2734
|
*/
|
|
2670
2735
|
async onToolBatchComplete(_agentName) {
|
|
2671
2736
|
// Every agent's workspace is the store's current branch, so the agent
|
|
@@ -2732,6 +2797,10 @@ export class WorkspaceModule {
|
|
|
2732
2797
|
const pass = this.withMount(mount, () => {
|
|
2733
2798
|
if (mount.agentActionScanWaiting === scan)
|
|
2734
2799
|
mount.agentActionScanWaiting = undefined;
|
|
2800
|
+
// From the mount's start, as a listing walks, keeping no place: on a
|
|
2801
|
+
// mount over its walkCap, every batch's scan takes the first walkCap
|
|
2802
|
+
// entries in the walk's order, and the place that syncs and catch-up
|
|
2803
|
+
// scans resume from stays theirs.
|
|
2735
2804
|
return this.passUnlocked(mount, { kind: 'dir', dir: '', recursive: true });
|
|
2736
2805
|
});
|
|
2737
2806
|
scan.settled = pass.then((result) => {
|