@bastani/atomic 0.9.19-alpha.1 → 0.9.19-alpha.11
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/CHANGELOG.md +206 -0
- package/README.md +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +51 -0
- package/dist/builtin/intercom/README.md +28 -18
- package/dist/builtin/intercom/broker/broker.ts +81 -9
- package/dist/builtin/intercom/broker/client.ts +45 -1
- package/dist/builtin/intercom/broker/framing.ts +5 -2
- package/dist/builtin/intercom/broker/group-membership.ts +4 -2
- package/dist/builtin/intercom/broker/presence-handler.ts +14 -0
- package/dist/builtin/intercom/broker/send-handler.ts +61 -6
- package/dist/builtin/intercom/broker/terminal-questions.ts +29 -0
- package/dist/builtin/intercom/index.bundle.mjs +1120 -783
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/recipient-purpose.ts +9 -0
- package/dist/builtin/intercom/recoverable-disconnect.ts +2 -3
- package/dist/builtin/intercom/retry-policy.ts +4 -2
- package/dist/builtin/intercom/skills/intercom/SKILL.md +8 -7
- package/dist/builtin/intercom/types.ts +18 -3
- package/dist/builtin/mcp/CHANGELOG.md +6 -0
- package/dist/builtin/mcp/README.md +2 -0
- package/dist/builtin/mcp/index.bundle.mjs +2201 -12000
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +57 -0
- package/dist/builtin/subagents/README.md +46 -23
- package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
- package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +8 -8
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
- package/dist/builtin/subagents/agents/debugger.md +2 -2
- package/dist/builtin/subagents/agents/worker.md +1 -1
- package/dist/builtin/subagents/package.json +2 -2
- package/dist/builtin/subagents/skills/herdr/LICENSE +201 -0
- package/dist/builtin/subagents/skills/herdr/SKILL.md +202 -0
- package/dist/builtin/subagents/skills/subagent/SKILL.md +41 -35
- package/dist/builtin/subagents/skills/tmux/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1414 -656
- package/dist/builtin/web-access/CHANGELOG.md +19 -0
- package/dist/builtin/web-access/README.md +31 -24
- package/dist/builtin/web-access/index.bundle.mjs +42723 -26674
- package/dist/builtin/web-access/package.json +3 -2
- package/dist/builtin/workflows/CHANGELOG.md +127 -0
- package/dist/builtin/workflows/README.md +15 -16
- package/dist/builtin/workflows/builtin/adversarial-verification.js +5 -7
- package/dist/builtin/workflows/builtin/{chunk-hqpe2cyx.js → chunk-1jth021m.js} +85 -85
- package/dist/builtin/workflows/builtin/{chunk-7430zyas.js → chunk-2377r57g.js} +5 -3
- package/dist/builtin/workflows/builtin/{chunk-79fjkcvh.js → chunk-31j2gs7h.js} +18 -18
- package/dist/builtin/workflows/builtin/{chunk-wgccch41.js → chunk-6w6cvk6b.js} +16 -16
- package/dist/builtin/workflows/builtin/{chunk-zbekjqew.js → chunk-a2kdsqn8.js} +4 -4
- package/dist/builtin/workflows/builtin/{chunk-ze5x3d1r.js → chunk-fg9esgkj.js} +7 -7
- package/dist/builtin/workflows/builtin/{chunk-n8h4yyew.js → chunk-g0csgs7w.js} +11 -11
- package/dist/builtin/workflows/builtin/{chunk-b0v2xab1.js → chunk-ngkqkzej.js} +221 -23
- package/dist/builtin/workflows/builtin/{chunk-ed4jfn5t.js → chunk-nkrafh9s.js} +61 -61
- package/dist/builtin/workflows/builtin/{chunk-reqr3sr3.js → chunk-wf741bv3.js} +22 -22
- package/dist/builtin/workflows/builtin/{chunk-42s7sw0b.js → chunk-yeee2jrc.js} +19 -19
- package/dist/builtin/workflows/builtin/{chunk-6fqs7c01.js → chunk-z0d03ktm.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-k3w87x8y.js → chunk-z29qbehr.js} +10 -10
- package/dist/builtin/workflows/builtin/classify-and-act.js +5 -6
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -4
- package/dist/builtin/workflows/builtin/generate-and-filter.js +5 -6
- package/dist/builtin/workflows/builtin/goal.js +7 -8
- package/dist/builtin/workflows/builtin/index.js +20 -22
- package/dist/builtin/workflows/builtin/loop-until-done.js +5 -6
- package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +7 -8
- package/dist/builtin/workflows/builtin/steering-context.js +3 -3
- package/dist/builtin/workflows/builtin/tournament.js +5 -7
- package/dist/builtin/workflows/package.json +6 -6
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +27782 -26348
- package/dist/builtin/workflows/src/index.js +1103 -515
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +4 -1
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +6 -5
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +5 -1
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts +1 -1
- package/dist/core/agent-session-compaction.js +1 -1
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
- package/dist/core/agent-session-custom-message-commit.js +33 -2
- package/dist/core/agent-session-custom-message-commit.js.map +1 -1
- package/dist/core/agent-session-delivery-forwarding.d.ts +1 -1
- package/dist/core/agent-session-delivery-forwarding.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +5 -0
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts +1 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +8 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +45 -3
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +2 -2
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +22 -8
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +21 -8
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.js +13 -3
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +1 -1
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts +2 -2
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +105 -18
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +11 -0
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.d.ts +1 -1
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +13 -4
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +27 -4
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +5 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +44 -34
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +1 -1
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +14 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -0
- package/dist/core/agent-session-tasks.js +120 -0
- package/dist/core/agent-session-tasks.js.map +1 -0
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +2 -0
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts +1 -0
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +52 -5
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.d.ts.map +1 -1
- package/dist/core/agent-session-transfer.js +7 -0
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +3 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +4 -2
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js +2 -0
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +8 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +29 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +1 -1
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extension-session-state.js.map +1 -1
- package/dist/core/extensions/agent-events.d.ts +4 -4
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +10 -2
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +15 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/event-results.d.ts +1 -1
- package/dist/core/extensions/event-results.js.map +1 -1
- package/dist/core/extensions/event-types.d.ts +2 -1
- package/dist/core/extensions/event-types.d.ts.map +1 -1
- package/dist/core/extensions/event-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +3 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +10 -0
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts +1 -1
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-discovery.d.ts +1 -1
- package/dist/core/extensions/loader-discovery.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +5 -2
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +3 -0
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +6 -1
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/message-types.d.ts +1 -1
- package/dist/core/extensions/message-types.js.map +1 -1
- package/dist/core/extensions/reactive-widget.d.ts +6 -0
- package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
- package/dist/core/extensions/reactive-widget.js +7 -1
- package/dist/core/extensions/reactive-widget.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +12 -2
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +49 -4
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts +1 -1
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js +17 -2
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner-shortcuts.d.ts.map +1 -1
- package/dist/core/extensions/runner-shortcuts.js +32 -3
- package/dist/core/extensions/runner-shortcuts.js.map +1 -1
- package/dist/core/extensions/runner-ui.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +17 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +69 -19
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +8 -1
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/tool-types.d.ts +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/extensions/types.d.ts +1 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +25 -1
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/extensions/workflow-activity-hub.d.ts +25 -0
- package/dist/core/extensions/workflow-activity-hub.d.ts.map +1 -0
- package/dist/core/extensions/workflow-activity-hub.js +183 -0
- package/dist/core/extensions/workflow-activity-hub.js.map +1 -0
- package/dist/core/extensions/workflow-events.d.ts +118 -0
- package/dist/core/extensions/workflow-events.d.ts.map +1 -0
- package/dist/core/extensions/workflow-events.js +2 -0
- package/dist/core/extensions/workflow-events.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +8 -4
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +97 -11
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybinding-identity.d.ts +4 -0
- package/dist/core/keybinding-identity.d.ts.map +1 -0
- package/dist/core/keybinding-identity.js +10 -0
- package/dist/core/keybinding-identity.js.map +1 -0
- package/dist/core/keybindings.d.ts +37 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +9 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mandatory-runtime-tools.d.ts +1 -1
- package/dist/core/mandatory-runtime-tools.js.map +1 -1
- package/dist/core/model-fallback-failures.js +2 -2
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +1 -1
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-internals.d.ts +2 -2
- package/dist/core/resource-loader-internals.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts +2 -0
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +231 -191
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +4 -2
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/retry-policy.d.ts +1 -0
- package/dist/core/retry-policy.d.ts.map +1 -1
- package/dist/core/retry-policy.js +2 -1
- package/dist/core/retry-policy.js.map +1 -1
- package/dist/core/sdk-exports.d.ts +3 -3
- package/dist/core/sdk-exports.d.ts.map +1 -1
- package/dist/core/sdk-exports.js +1 -1
- package/dist/core/sdk-exports.js.map +1 -1
- package/dist/core/sdk-types.d.ts +2 -2
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +6 -3
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +25 -8
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +10 -4
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-storage.d.ts +1 -0
- package/dist/core/settings-storage.d.ts.map +1 -1
- package/dist/core/settings-storage.js +18 -0
- package/dist/core/settings-storage.js.map +1 -1
- package/dist/core/settings-types.d.ts +17 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +6 -5
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/agent-adapter.d.ts +44 -0
- package/dist/core/tasks/agent-adapter.d.ts.map +1 -0
- package/dist/core/tasks/agent-adapter.js +112 -0
- package/dist/core/tasks/agent-adapter.js.map +1 -0
- package/dist/core/tasks/command-output.d.ts +15 -0
- package/dist/core/tasks/command-output.d.ts.map +1 -0
- package/dist/core/tasks/command-output.js +29 -0
- package/dist/core/tasks/command-output.js.map +1 -0
- package/dist/core/tasks/completion-ordering.d.ts +11 -0
- package/dist/core/tasks/completion-ordering.d.ts.map +1 -0
- package/dist/core/tasks/completion-ordering.js +19 -0
- package/dist/core/tasks/completion-ordering.js.map +1 -0
- package/dist/core/tasks/completion.d.ts +36 -0
- package/dist/core/tasks/completion.d.ts.map +1 -0
- package/dist/core/tasks/completion.js +119 -0
- package/dist/core/tasks/completion.js.map +1 -0
- package/dist/core/tasks/contracts.d.ts +404 -0
- package/dist/core/tasks/contracts.d.ts.map +1 -0
- package/dist/core/tasks/contracts.js +2 -0
- package/dist/core/tasks/contracts.js.map +1 -0
- package/dist/core/tasks/execution-scope.d.ts +10 -0
- package/dist/core/tasks/execution-scope.d.ts.map +1 -0
- package/dist/core/tasks/execution-scope.js +27 -0
- package/dist/core/tasks/execution-scope.js.map +1 -0
- package/dist/core/tasks/owner-store.d.ts +53 -0
- package/dist/core/tasks/owner-store.d.ts.map +1 -0
- package/dist/core/tasks/owner-store.js +155 -0
- package/dist/core/tasks/owner-store.js.map +1 -0
- package/dist/core/tasks/pause.d.ts +4 -0
- package/dist/core/tasks/pause.d.ts.map +1 -0
- package/dist/core/tasks/pause.js +49 -0
- package/dist/core/tasks/pause.js.map +1 -0
- package/dist/core/tasks/supervisor.d.ts +123 -0
- package/dist/core/tasks/supervisor.d.ts.map +1 -0
- package/dist/core/tasks/supervisor.js +942 -0
- package/dist/core/tasks/supervisor.js.map +1 -0
- package/dist/core/tasks/transcript.d.ts +23 -0
- package/dist/core/tasks/transcript.d.ts.map +1 -0
- package/dist/core/tasks/transcript.js +74 -0
- package/dist/core/tasks/transcript.js.map +1 -0
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts +2 -2
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js +8 -4
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/tab-bar.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/tab-bar.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts +32 -3
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +198 -1
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash.d.ts +25 -5
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +100 -10
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +92 -14
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-coordinator.d.ts +255 -0
- package/dist/core/tools/file-mutation-coordinator.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-coordinator.js +300 -0
- package/dist/core/tools/file-mutation-coordinator.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +14 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +15 -3
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/hashline.d.ts +9 -0
- package/dist/core/tools/hashline.d.ts.map +1 -1
- package/dist/core/tools/hashline.js +12 -1
- package/dist/core/tools/hashline.js.map +1 -1
- package/dist/core/tools/index.d.ts +15 -4
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +79 -12
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/kill.d.ts +17 -0
- package/dist/core/tools/kill.d.ts.map +1 -0
- package/dist/core/tools/kill.js +49 -0
- package/dist/core/tools/kill.js.map +1 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/non-minting-snapshot-store.d.ts +49 -0
- package/dist/core/tools/non-minting-snapshot-store.d.ts.map +1 -0
- package/dist/core/tools/non-minting-snapshot-store.js +64 -0
- package/dist/core/tools/non-minting-snapshot-store.js.map +1 -0
- package/dist/core/tools/powershell.d.ts +100 -34
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +41 -11
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read-document-extract.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +1 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/resource-selectors.d.ts +1 -1
- package/dist/core/tools/resource-selectors.d.ts.map +1 -1
- package/dist/core/tools/resource-selectors.js +21 -10
- package/dist/core/tools/resource-selectors.js.map +1 -1
- package/dist/core/tools/search.js.map +1 -1
- package/dist/core/tools/todos-render.d.ts +1 -1
- package/dist/core/tools/todos-render.js.map +1 -1
- package/dist/core/tools/write.d.ts +30 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +98 -10
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/workflow-stage-admission.d.ts +24 -0
- package/dist/core/workflow-stage-admission.d.ts.map +1 -1
- package/dist/core/workflow-stage-admission.js +87 -3
- package/dist/core/workflow-stage-admission.js.map +1 -1
- package/dist/extensions/herdr/activity.d.ts +15 -0
- package/dist/extensions/herdr/activity.d.ts.map +1 -0
- package/dist/extensions/herdr/activity.js +24 -0
- package/dist/extensions/herdr/activity.js.map +1 -0
- package/dist/extensions/herdr/environment.d.ts +7 -0
- package/dist/extensions/herdr/environment.d.ts.map +1 -0
- package/dist/extensions/herdr/environment.js +6 -0
- package/dist/extensions/herdr/environment.js.map +1 -0
- package/dist/extensions/herdr/index.d.ts +9 -0
- package/dist/extensions/herdr/index.d.ts.map +1 -0
- package/dist/extensions/herdr/index.js +225 -0
- package/dist/extensions/herdr/index.js.map +1 -0
- package/dist/extensions/herdr/pane-owner.d.ts +30 -0
- package/dist/extensions/herdr/pane-owner.d.ts.map +1 -0
- package/dist/extensions/herdr/pane-owner.js +111 -0
- package/dist/extensions/herdr/pane-owner.js.map +1 -0
- package/dist/extensions/herdr/transport.d.ts +8 -0
- package/dist/extensions/herdr/transport.d.ts.map +1 -0
- package/dist/extensions/herdr/transport.js +28 -0
- package/dist/extensions/herdr/transport.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/huggingface-ui.d.ts +1 -1
- package/dist/extensions/llama/huggingface-ui.js.map +1 -1
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/index-extensions.d.ts +3 -2
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +14 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +149 -69
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts +1 -1
- package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +12 -0
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +44 -0
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +43 -8
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts +2 -2
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts +2 -2
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +12 -3
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +4 -5
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.js +8 -6
- package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +7 -2
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +1 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.d.ts +8 -3
- package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.js +2 -0
- package/dist/modes/interactive/components/chat-session-host-utils.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +17 -2
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +100 -3
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.d.ts +1 -0
- package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.js +1 -1
- package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +12 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -6
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +27 -9
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form.d.ts +1 -1
- package/dist/modes/interactive/components/host-input-form.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +2 -2
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts +1 -1
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/scroll-widget.d.ts +23 -0
- package/dist/modes/interactive/components/scroll-widget.d.ts.map +1 -0
- package/dist/modes/interactive/components/scroll-widget.js +61 -0
- package/dist/modes/interactive/components/scroll-widget.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-header.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/task-completion-message.d.ts +13 -0
- package/dist/modes/interactive/components/task-completion-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-completion-message.js +65 -0
- package/dist/modes/interactive/components/task-completion-message.js.map +1 -0
- package/dist/modes/interactive/components/task-detail.d.ts +27 -0
- package/dist/modes/interactive/components/task-detail.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-detail.js +107 -0
- package/dist/modes/interactive/components/task-detail.js.map +1 -0
- package/dist/modes/interactive/components/task-inspector.d.ts +50 -0
- package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-inspector.js +599 -0
- package/dist/modes/interactive/components/task-inspector.js.map +1 -0
- package/dist/modes/interactive/components/task-list.d.ts +18 -0
- package/dist/modes/interactive/components/task-list.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-list.js +59 -0
- package/dist/modes/interactive/components/task-list.js.map +1 -0
- package/dist/modes/interactive/components/task-live-transcript.d.ts +17 -0
- package/dist/modes/interactive/components/task-live-transcript.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-live-transcript.js +41 -0
- package/dist/modes/interactive/components/task-live-transcript.js.map +1 -0
- package/dist/modes/interactive/components/task-navigation.d.ts +38 -0
- package/dist/modes/interactive/components/task-navigation.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-navigation.js +93 -0
- package/dist/modes/interactive/components/task-navigation.js.map +1 -0
- package/dist/modes/interactive/components/task-row.d.ts +34 -0
- package/dist/modes/interactive/components/task-row.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-row.js +165 -0
- package/dist/modes/interactive/components/task-row.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/transcript-follow-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-component.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-help.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-label-input.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/working-status.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +8 -2
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +3 -1
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +9 -30
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +2 -1
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-context.js +14 -4
- package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +52 -4
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +11 -3
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-widgets.js +9 -1
- package/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +19 -0
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +7 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +10 -4
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +6 -6
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -2
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +3 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +4 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +30 -4
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +33 -23
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +3 -0
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-summarization-retry-events.js +2 -2
- package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -1
- package/dist/modes/interactive/interactive-task-projection.d.ts +13 -0
- package/dist/modes/interactive/interactive-task-projection.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-task-projection.js +72 -0
- package/dist/modes/interactive/interactive-task-projection.js.map +1 -0
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/interactive-windows-subshell.d.ts +17 -0
- package/dist/modes/interactive/interactive-windows-subshell.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-windows-subshell.js +92 -0
- package/dist/modes/interactive/interactive-windows-subshell.js.map +1 -0
- package/dist/modes/interactive/skill-command-autocomplete.d.ts +12 -0
- package/dist/modes/interactive/skill-command-autocomplete.d.ts.map +1 -0
- package/dist/modes/interactive/skill-command-autocomplete.js +69 -0
- package/dist/modes/interactive/skill-command-autocomplete.js.map +1 -0
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +4 -1
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +1 -1
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.d.ts +2 -2
- package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +9 -10
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +29 -12
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts +3 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.js +11 -0
- package/dist/modes/interactive-engine/engine-diagnostic-view.js.map +1 -1
- package/dist/modes/interactive-engine/engine-dialog-host.d.ts +2 -2
- package/dist/modes/interactive-engine/engine-dialog-host.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-dialog-host.js +4 -1
- package/dist/modes/interactive-engine/engine-dialog-host.js.map +1 -1
- package/dist/modes/interactive-engine/engine-project-trust.d.ts +10 -0
- package/dist/modes/interactive-engine/engine-project-trust.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-project-trust.js +28 -0
- package/dist/modes/interactive-engine/engine-project-trust.js.map +1 -0
- package/dist/modes/interactive-engine/engine-render-service.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +3 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +7 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/input-form-host.d.ts +2 -2
- package/dist/modes/interactive-engine/input-form-host.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +5 -2
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +42 -4
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +21 -1
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +53 -2
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts +2 -2
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +19 -8
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.d.ts +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/dist/modes/interactive-engine/session-picker-host.d.ts +2 -2
- package/dist/modes/interactive-engine/session-picker-host.js.map +1 -1
- package/dist/modes/json-event.d.ts +1 -1
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-bash-request-owners.d.ts +2 -2
- package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -2
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +2 -2
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +2 -0
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +23 -1
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client-waits.d.ts +1 -1
- package/dist/modes/rpc/rpc-client-waits.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +3 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +40 -3
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts +4 -2
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +12 -4
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.js +2 -1
- package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +12 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts +4 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +35 -1
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +17 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/task-ui-bridge.d.ts +9 -0
- package/dist/modes/rpc/task-ui-bridge.d.ts.map +1 -0
- package/dist/modes/rpc/task-ui-bridge.js +146 -0
- package/dist/modes/rpc/task-ui-bridge.js.map +1 -0
- package/dist/self-update-plan.js.map +1 -1
- package/dist/utils/markit.d.ts +2 -0
- package/dist/utils/markit.d.ts.map +1 -1
- package/dist/utils/markit.js +65 -5
- package/dist/utils/markit.js.map +1 -1
- package/docs/background-tasks.md +232 -0
- package/docs/build.md +51 -0
- package/docs/changelog.mdx +8 -8
- package/docs/compaction/reference.md +267 -0
- package/docs/compaction.md +39 -200
- package/docs/computer-use.md +425 -0
- package/docs/containerization.md +9 -5
- package/docs/custom-provider/api-reference.md +145 -0
- package/docs/custom-provider/oauth.md +131 -0
- package/docs/custom-provider/override.md +34 -0
- package/docs/custom-provider/registration.md +163 -0
- package/docs/custom-provider/streaming.md +214 -0
- package/docs/custom-provider.md +43 -607
- package/docs/development.md +68 -30
- package/docs/docs.json +199 -73
- package/docs/environment-variables.md +2 -2
- package/docs/extensions/api-reference.md +1003 -0
- package/docs/extensions/authoring.md +676 -0
- package/docs/extensions/events.md +793 -0
- package/docs/extensions/examples.md +94 -0
- package/docs/extensions/ui.md +470 -0
- package/docs/extensions.md +241 -2623
- package/docs/getting-started/authentication.md +55 -0
- package/docs/getting-started/first-session.md +172 -0
- package/docs/getting-started/installation.md +154 -0
- package/docs/getting-started/project-instructions.md +43 -0
- package/docs/guides/configuration.md +65 -0
- package/docs/guides/intercom.md +24 -0
- package/docs/guides/non-interactive.md +33 -0
- package/docs/guides/subagents.md +24 -0
- package/docs/guides/workflows.md +27 -0
- package/docs/guides.md +41 -0
- package/docs/herdr.md +55 -0
- package/docs/index.md +13 -44
- package/docs/intercom/operations.md +178 -0
- package/docs/intercom/reference.md +150 -0
- package/docs/intercom.md +61 -251
- package/docs/json.md +17 -0
- package/docs/keybindings.md +36 -2
- package/docs/llama-cpp.md +5 -0
- package/docs/models/artificial-analysis-index.md +89 -0
- package/docs/models/evals.md +225 -148
- package/docs/models/model-selection.md +30 -21
- package/docs/models/pareto-efficiency.md +4 -4
- package/docs/models/reference.md +601 -0
- package/docs/models.md +45 -550
- package/docs/packages/authoring.md +88 -0
- package/docs/packages/reference.md +43 -0
- package/docs/packages.md +28 -107
- package/docs/programmatic.md +29 -0
- package/docs/prompt-templates.md +11 -0
- package/docs/providers/reference.md +23 -0
- package/docs/providers.md +59 -62
- package/docs/quickstart.md +45 -239
- package/docs/reference/cli.md +252 -0
- package/docs/reference.md +52 -0
- package/docs/rpc/examples.md +64 -0
- package/docs/rpc/extension-ui.md +198 -0
- package/docs/rpc/protocol.md +1341 -0
- package/docs/rpc.md +109 -1346
- package/docs/sdk/reference.md +1090 -0
- package/docs/sdk.md +64 -756
- package/docs/session-format.md +2 -0
- package/docs/sessions.md +6 -10
- package/docs/settings.md +45 -48
- package/docs/skills/authoring.md +95 -0
- package/docs/skills/reference.md +60 -0
- package/docs/skills.md +37 -117
- package/docs/subagents/authoring.md +37 -0
- package/docs/subagents/reference.md +60 -0
- package/docs/subagents.md +90 -78
- package/docs/terminal-setup.md +1 -1
- package/docs/themes/reference.md +176 -0
- package/docs/themes.md +25 -135
- package/docs/tmux.md +7 -0
- package/docs/tools/edit.md +5 -0
- package/docs/tools.md +67 -1
- package/docs/tui/reference.md +343 -0
- package/docs/tui.md +83 -285
- package/docs/usage.md +31 -210
- package/docs/web-access.md +50 -0
- package/docs/windows.md +6 -5
- package/docs/workflows/api-reference.md +31 -12
- package/docs/workflows/authoring.md +7 -5
- package/docs/workflows/builtins.md +11 -8
- package/docs/workflows/operations.md +103 -38
- package/docs/workflows/reliable-design.md +59 -10
- package/docs/workflows/verification.md +116 -32
- package/docs/workflows.md +7 -3
- package/examples/extensions/gondolin/index.ts +116 -148
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/ssh.ts +56 -34
- package/npm-shrinkwrap.json +798 -678
- package/package.json +11 -11
- /package/dist/builtin/workflows/builtin/{chunk-cg9tmks0.js → chunk-n1910xc4.js} +0 -0
- /package/dist/builtin/workflows/builtin/{chunk-wpckd35c.js → chunk-rc5ec5xx.js} +0 -0
- /package/dist/builtin/workflows/builtin/{chunk-7at6dnkr.js → chunk-tgt0s5e5.js} +0 -0
- /package/dist/builtin/workflows/builtin/{chunk-bfkmzv9h.js → chunk-xtxcq5tj.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/core/tools/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACN,2BAA2B,EAC3B,+BAA+B,EAE/B,sBAAsB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,UAAU,EACV,yBAAyB,EACzB,KA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QACb,CAAC;QACD,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO;YAC5C,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAA4B,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACtF,MAAM,SAAS,GAAI,OAAO,CAAC,aAAuC,IAAI,IAAI,SAAS,EAAE,CAAC;YACtF,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,IAAI,CAAC,MAAM;gBAAE,OAAO,SAAS,CAAC;YAC9B,SAAS,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3C,OAAO,SAAS,CAAC;QAClB,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,OAAyB;IACpE,OAAO,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Container, Spacer, Text } from \"@earendil-works/pi-tui\";\nimport { constants } from \"fs\";\nimport { access as fsAccess, readFile as fsReadFile, writeFile as fsWriteFile } from \"fs/promises\";\nimport { type Static, Type } from \"typebox\";\nimport { renderDiff } from \"../../modes/interactive/components/diff.ts\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { experimentalToolSamplingProperty } from \"../experimental.ts\";\nimport type { ExtensionContext, ToolDefinition } from \"../extensions/types.ts\";\nimport { nativeBlockResolver } from \"./block-resolver.ts\";\nimport { EditBatchCoordinator, parallelEditBatchWarning } from \"./edit-batch.ts\";\nimport { generateDiffString, generateUnifiedPatch, normalizeToLF, stripBom } from \"./edit-diff.ts\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport {\n\tcreateHashlineSnapshotStore,\n\tformatCompactHashlineEditResult,\n\ttype HashlineSnapshotStore,\n\trecordHashlineSnapshot,\n} from \"./hashline.ts\";\nimport {\n\tFilesystem,\n\tmissingSnapshotTagMessage,\n\tPatch,\n\tPatcher,\n\ttype PatchSectionResult,\n\ttype PreparedSection,\n\ttype WriteResult,\n} from \"./hashline-engine/index.ts\";\nimport { isNotebookPath, readEditableNotebookText, serializeEditedNotebookText } from \"./notebook.ts\";\nimport { resolveReadPath } from \"./path-utils.ts\";\nimport { renderToolPath } from \"./render-utils.ts\";\nimport { invalidateNativeSearchCache } from \"./search-native.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst editSchema = Type.Object(\n\t{\n\t\tinput: Type.String({\n\t\t\tdescription:\n\t\t\t\t\"One or more hashline file sections. Must start with [PATH#TAG]; tag comes from the latest read, search, write, or successful edit output.\",\n\t\t}),\n\t},\n\t{ additionalProperties: false },\n);\n// Hashline prompt origin: can1357/oh-my-pi packages/hashline/src/prompt.md @ 15b5c1397fc (MIT).\n// This file carries Atomic-maintained local modifications; see ./hashline-engine/PROVENANCE.md and ./hashline-engine/LICENSE.upstream.\nexport const editToolSystemPromptContribution = Object.freeze({\n\tsnippet: \"Apply source edits with hashline patch input\",\n\tguidelines: Object.freeze([\n\t\t\"hashline edit format: a header ending in ':' is followed by '+TEXT' body rows; 'delete' has no body. Every section starts with [PATH#TAG]; TAG is REQUIRED (the 4-hex snapshot tag from your latest read/search) — there is no hashless form. Use the write tool to create new files.\",\n\t\t\"Ops: 'replace N..M:' replaces original lines N..M (INCLUSIVE — line M is consumed); 'delete N..M' / 'delete block N' delete (no body); 'insert before N:' / 'insert after N:' insert relative to a line; 'insert head:' / 'insert tail:' insert at file start/end. Block ops ('replace block N:', 'delete block N', 'insert after block N:') resolve the exact syntactic node BEGINNING on N through the native Rust tree-sitter `blockRangeAt` primitive in `@bastani/atomic-natives`; the brace/indent heuristic is the fallback only when the native binding is unavailable. Single line: 'replace N..N:' / 'delete N'. The range is the ORIGINAL lines you touch; body length is irrelevant.\",\n\t\t\"Body rows appear only under a ':' header and start on the NEXT line. Every row is '+TEXT' (adds a literal line, leading whitespace kept; '+' alone adds a blank line). There is NO other body row kind — never write '-old' or a bare/context line. To keep a line, leave it out of every range. For a literal line starting with '-' or '+', prefix it: '+-x', '++x'.\",\n\t\t\"Block anchors: 'replace block N' resolves the outermost node BEGINNING on N. Where a language folds a decorator/annotation into its construct (Python folds `@dec` and `def` into one node; TypeScript/Java annotations also fold), anchoring at the first decorator sweeps both. Rust `#[attr]` and doc- or line-comments resolve alone; replacing there with a construct body duplicates the construct, so use explicit 'replace N..M:' to take both. Confirm the result echo: 'replace block N → resolved lines A-B (K lines)'. 'insert after block N:' takes the opener, never the closer; insert-after echoes '; body lands after line B'. Resolution fails for an unsupported language, blank/closer line, no node beginning on N, or an unparsable block; use 'replace N..M:' or 'insert after M:' instead.\",\n\t\t\"Numbers refer to the ORIGINAL file and do not shift as hunks apply; they die with the call — every applied edit mints a fresh #TAG and renumbers, so anchor the next edit on the edit response or a fresh read. Parallel edit calls that share a [path#TAG] are applied as one snapshot batch. Ranges are TIGHT: cover ONLY lines whose content changes; a stale wide range shreds everything it spans. Pure additions use 'insert', never a widened 'replace'. Whole construct → 'replace block N'; lines inside it → 'replace N..M'.\",\n\t\t\"On a stale-tag rejection or any surprising result: STOP and re-read before further edits. Never start or end a range mid-expression/mid-block, and never span a hunk across an elided ('…') region — read it first. Never use edit to reformat/restyle code; run the project formatter instead.\",\n\t\t[\n\t\t\t\"Worked examples. Original (the exact shape `read` returns):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"1:@cache\",\n\t\t\t\"2:def greet(name):\",\n\t\t\t'3: msg = \"Hello, \" + name',\n\t\t\t\"4: print(msg)\",\n\t\t\t'5:greet(\"world\")',\n\t\t\t\"```\",\n\t\t\t\"Replace one original line with one line:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"replace 3..3:\",\n\t\t\t'+ msg = f\"Hi, {name}\"',\n\t\t\t\"```\",\n\t\t\t\"Replace the decorated Python block (Python folds `@cache` and `def` into one node; anchoring at line 2 would keep/orphan line 1). For a Rust attribute or doc- or line-comment, use explicit `replace N..M:` to take both it and the construct:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"replace block 1:\",\n\t\t\t\"+@cache\",\n\t\t\t\"+def greet(name):\",\n\t\t\t'+ print(f\"Hello, {name}\")',\n\t\t\t\"```\",\n\t\t\t\"Delete one line (no colon/body):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"delete 4\",\n\t\t\t\"```\",\n\t\t\t\"Delete a range (no colon/body):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"delete 3..4\",\n\t\t\t\"```\",\n\t\t\t\"Delete a whole block (no colon/body):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"delete block 2\",\n\t\t\t\"```\",\n\t\t\t\"Insert before a line:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert before 5:\",\n\t\t\t\"+log()\",\n\t\t\t\"```\",\n\t\t\t\"Insert after a line:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert after 3:\",\n\t\t\t\"+ print(msg)\",\n\t\t\t\"```\",\n\t\t\t\"Insert after the block whose opener is line 2:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert after block 2:\",\n\t\t\t\"+audit()\",\n\t\t\t\"```\",\n\t\t\t\"Insert at both file ends:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert head:\",\n\t\t\t\"+# generated\",\n\t\t\t\"insert tail:\",\n\t\t\t'+greet(\"everyone\")',\n\t\t\t\"```\",\n\t\t\t\"Multi-file input:\",\n\t\t\t\"```text\",\n\t\t\t\"[src/a.ts#0A3B]\",\n\t\t\t\"replace 1..1:\",\n\t\t\t\"+export const enabled = true;\",\n\t\t\t\"[src/b.ts#1F7C]\",\n\t\t\t\"delete 20\",\n\t\t\t\"```\",\n\t\t].join(\"\\n\"),\n\t\t[\n\t\t\t\"Anti-patterns:\",\n\t\t\t\"```text\",\n\t\t\t\"# WRONG — `-` rows are rejected; bare context rows are auto-prefixed and inserted as literal content: `-` rows are not valid; the range already names the lines being changed. For a literal `-` line, write `+-…`.\",\n\t\t\t\"replace 3..3:\",\n\t\t\t' msg = \"Hello\"',\n\t\t\t\"- print(msg)\",\n\t\t\t\"+ return msg\",\n\t\t\t\"# RIGHT\",\n\t\t\t\"replace 3..3:\",\n\t\t\t\"+ return msg\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — body glued to its header: payload line has no preceding hunk header; body starts on the NEXT line.\",\n\t\t\t\"replace block 238:+export const value = 1;\",\n\t\t\t\"# RIGHT\",\n\t\t\t\"replace block 238:\",\n\t\t\t\"+export const value = 1;\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — `delete N..M` has no colon and no body.\",\n\t\t\t\"delete 2..3:\",\n\t\t\t\"+replacement\",\n\t\t\t\"# RIGHT: delete 2..3\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — empty `insert` / `replace`: `insert` needs at least one `+TEXT` body row. A bodyless concrete `replace` silently deletes the range.\",\n\t\t\t\"insert after 2:\",\n\t\t\t\"replace 4..4:\",\n\t\t\t\"# RIGHT — give `replace` a body; if deletion is intended, write `delete 4`.\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — widened replace for a pure insertion can drop retyped keepers.\",\n\t\t\t\"replace 2..4:\",\n\t\t\t\"+kept()\",\n\t\t\t\"+added()\",\n\t\t\t\"# RIGHT: insert after 2:\",\n\t\t\t\"+added()\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — block anchor is a closer/last visible line.\",\n\t\t\t\"insert after block 3:\",\n\t\t\t\"+after()\",\n\t\t\t\"# RIGHT: insert after 3:\",\n\t\t\t\"+after()\",\n\t\t\t\"```\",\n\t\t].join(\"\\n\"),\n\t\t[\n\t\t\t\"If you remember nothing else:\",\n\t\t\t\"1. RE-GROUND AFTER EVERY EDIT. Every apply mints a fresh #TAG and renumbers; use the edit response or a fresh read. Stale tag or surprise? STOP and re-read.\",\n\t\t\t\"2. RANGES ARE TIGHT. Cover only lines that change; a stale wide range shreds everything it spans. Whole construct → replace block N.\",\n\t\t\t\"3. THE BODY IS THE FINAL CONTENT. Only +TEXT rows; never -old/context lines. The range does the deleting.\",\n\t\t].join(\"\\n\"),\n\t] as const),\n} as const);\n\nexport type EditToolInput = Static<typeof editSchema>;\n\nexport interface EditToolDetails {\n\tdiff: string;\n\tpatch: string;\n\tfirstChangedLine?: number;\n}\n\nexport interface EditOperations {\n\treadFile: (absolutePath: string) => Promise<Buffer>;\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\taccess: (absolutePath: string) => Promise<void>;\n}\n\nconst defaultEditOperations: EditOperations = {\n\treadFile: (path) => fsReadFile(path),\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\taccess: (path) => fsAccess(path, constants.R_OK | constants.W_OK),\n};\n\nexport interface EditToolOptions {\n\toperations?: EditOperations;\n\thashlineStore?: HashlineSnapshotStore;\n}\n\ntype EditToolResultLike = {\n\tcontent: Array<{ type: \"text\"; text: string }>;\n\tdetails: EditToolDetails | undefined;\n};\n\nclass EditFilesystem extends Filesystem {\n\tprivate readonly cwd: string;\n\tprivate readonly operations: EditOperations;\n\tconstructor(cwd: string, operations: EditOperations) {\n\t\tsuper();\n\t\tthis.cwd = cwd;\n\t\tthis.operations = operations;\n\t}\n\n\tcanonicalPath(path: string): string {\n\t\treturn resolveReadPath(path, this.cwd);\n\t}\n\n\tasync preflightWrite(path: string): Promise<void> {\n\t\tconst absolutePath = this.canonicalPath(path);\n\t\ttry {\n\t\t\tawait this.operations.access(absolutePath);\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error && \"code\" in error ? `Error code: ${error.code}` : String(error);\n\t\t\tthrow new Error(`Could not edit file: ${path}. ${message}.`);\n\t\t}\n\t}\n\n\tasync readText(path: string): Promise<string> {\n\t\tconst absolutePath = this.canonicalPath(path);\n\t\treturn isNotebookPath(absolutePath)\n\t\t\t? readEditableNotebookText(absolutePath, path)\n\t\t\t: (await this.operations.readFile(absolutePath)).toString(\"utf-8\");\n\t}\n\n\tasync writeText(path: string, content: string): Promise<WriteResult> {\n\t\tconst absolutePath = this.canonicalPath(path);\n\t\tconst persisted = isNotebookPath(absolutePath)\n\t\t\t? serializeEditedNotebookText(absolutePath, path, normalizeToLF(stripBom(content).text))\n\t\t\t: content;\n\t\tawait this.operations.writeFile(absolutePath, persisted);\n\t\treturn { text: persisted };\n\t}\n}\n\nfunction isFourDigitHexTag(value: string): boolean {\n\treturn (\n\t\tvalue.length === 4 &&\n\t\t[...value].every(\n\t\t\t(char) => (char >= \"0\" && char <= \"9\") || (char >= \"a\" && char <= \"f\") || (char >= \"A\" && char <= \"F\"),\n\t\t)\n\t);\n}\n\nfunction extractFirstHeaderPath(input: string | undefined): string | undefined {\n\tif (!input) return undefined;\n\tfor (const line of input.split(\"\\n\")) {\n\t\tconst trimmed = line.trimStart();\n\t\tif (!trimmed.startsWith(\"[\")) continue;\n\t\tconst hashIndex = trimmed.indexOf(\"#\", 1);\n\t\tconst closeIndex = hashIndex >= 0 ? trimmed.indexOf(\"]\", hashIndex + 1) : -1;\n\t\tif (hashIndex <= 1 || closeIndex !== hashIndex + 5) continue;\n\t\tconst tag = trimmed.slice(hashIndex + 1, closeIndex);\n\t\tif (isFourDigitHexTag(tag)) return trimmed.slice(1, hashIndex);\n\t}\n\treturn undefined;\n}\n\nfunction formatEditCall(args: unknown, theme: Theme, cwd: string): string {\n\tconst input = args && typeof args === \"object\" && \"input\" in args ? (args as { input?: unknown }).input : undefined;\n\tconst pathDisplay = renderToolPath(\n\t\textractFirstHeaderPath(typeof input === \"string\" ? input : undefined) ?? null,\n\t\ttheme,\n\t\tcwd,\n\t);\n\treturn `${theme.fg(\"toolTitle\", theme.bold(\"edit\"))} ${pathDisplay}`;\n}\n\nfunction formatEditResult(result: EditToolResultLike, theme: Theme, isError: boolean): string | undefined {\n\tif (isError) {\n\t\tconst errorText = result.content\n\t\t\t.filter((c) => c.type === \"text\")\n\t\t\t.map((c) => c.text || \"\")\n\t\t\t.join(\"\\n\");\n\t\treturn errorText ? theme.fg(\"error\", errorText) : undefined;\n\t}\n\treturn result.details?.diff ? renderDiff(result.details.diff) : undefined;\n}\n\nasync function withFileMutationQueues<T>(filePaths: readonly string[], fn: () => Promise<T>): Promise<T> {\n\tconst sorted = [...new Set(filePaths)].sort();\n\tconst run = (index: number): Promise<T> => {\n\t\tconst filePath = sorted[index];\n\t\treturn filePath ? withFileMutationQueue(filePath, () => run(index + 1)) : fn();\n\t};\n\treturn run(0);\n}\n\nfunction throwIfAborted(signal?: AbortSignal): void {\n\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n}\n\nfunction formatNoopMessage(path: string, count: number): string {\n\treturn `Edits to ${path} parsed and applied cleanly, but produced no change: your body row(s) are byte-identical to the file at the targeted lines. The bug is somewhere else — re-read the file before issuing another edit. Do NOT widen the payload or add lines; verify the anchor first.${count > 1 ? `\\nNo-op count for this identical payload: ${count}.` : \"\"}`;\n}\n\nfunction blockMessages(item: PreparedSection | PatchSectionResult): string[] {\n\tconst warnings =\n\t\t\"parseWarnings\" in item ? [...item.parseWarnings, ...(item.applyResult.warnings ?? [])] : item.warnings;\n\tconst resolutions =\n\t\t(\"applyResult\" in item ? item.applyResult.blockResolutions : item.blockResolutions)?.map((resolution) => {\n\t\t\tconst verb = resolution.op === \"insert_after\" ? \"insert after block\" : `${resolution.op} block`;\n\t\t\tconst lands = resolution.op === \"insert_after\" ? `; body lands after line ${resolution.end}` : \"\";\n\t\t\treturn `${verb} ${resolution.anchorLine} → resolved lines ${resolution.start}-${resolution.end} (${resolution.end - resolution.start + 1} lines)${lands}`;\n\t\t}) ?? [];\n\treturn [...warnings, ...resolutions];\n}\n\nfunction assertUniquePreparedPaths(prepared: readonly PreparedSection[]): void {\n\tconst seen = new Map<string, string>();\n\tfor (const entry of prepared) {\n\t\tconst previous = seen.get(entry.canonicalPath);\n\t\tif (previous)\n\t\t\tthrow new Error(\n\t\t\t\t`Multiple hashline sections resolve to the same file (${previous} and ${entry.section.path}). Merge their ops under one header before applying.`,\n\t\t\t);\n\t\tseen.set(entry.canonicalPath, entry.section.path);\n\t}\n}\n\ninterface EditCwdScope {\n\treadonly fs: EditFilesystem;\n\treadonly batcher: EditBatchCoordinator<EditToolResultLike>;\n\tapplySiblingEdits(siblings: readonly { input: string }[], applySignal?: AbortSignal): Promise<EditToolResultLike>;\n}\n\nfunction createEditCwdScope(cwd: string, ops: EditOperations, hashlineStore: HashlineSnapshotStore): EditCwdScope {\n\tconst fs = new EditFilesystem(cwd, ops);\n\tconst patcher = new Patcher({ fs, snapshots: hashlineStore.snapshots, blockResolver: nativeBlockResolver });\n\tconst noopCounts = new Map<string, number>();\n\tconst batcher = new EditBatchCoordinator<EditToolResultLike>();\n\tasync function applySiblingEdits(\n\t\tsiblings: readonly { input: string }[],\n\t\tapplySignal?: AbortSignal,\n\t): Promise<EditToolResultLike> {\n\t\tconst merged =\n\t\t\tsiblings.length === 1\n\t\t\t\t? Patch.parse(siblings[0]!.input, { cwd })\n\t\t\t\t: Patch.parse(siblings.map((sibling) => sibling.input).join(\"\\n\"), { cwd });\n\t\tconst prepared: PreparedSection[] = [];\n\t\tfor (const section of merged.sections) {\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tprepared.push(await patcher.prepare(section));\n\t\t}\n\t\tassertUniquePreparedPaths(prepared);\n\t\tconst noops = prepared.filter((item) => item.isNoop);\n\t\tif (noops.length > 0) {\n\t\t\tif (noops.length !== prepared.length)\n\t\t\t\tthrow new Error(`Hashline edit for ${noops[0]!.section.path} did not change the file.`);\n\t\t\tconst key = prepared.map((item) => `${item.canonicalPath}\\0${item.applyResult.text}`).join(\"\\0\\0\");\n\t\t\tconst count = (noopCounts.get(key) ?? 0) + 1;\n\t\t\tnoopCounts.set(key, count);\n\t\t\tif (count >= 3) throw new Error(`STOP. ${formatNoopMessage(prepared[0]!.section.path, count)}`);\n\t\t\treturn {\n\t\t\t\tcontent: [{ type: \"text\", text: formatNoopMessage(prepared[0]!.section.path, count) }],\n\t\t\t\tdetails: { diff: \"\", patch: \"\" },\n\t\t\t};\n\t\t}\n\t\tfor (const item of prepared) {\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tif (normalizeToLF(stripBom(await fs.readText(item.section.path)).text) !== item.normalized)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Stale hashline tag for ${item.section.path}: file content changed before write. Re-read before editing.`,\n\t\t\t\t);\n\t\t}\n\t\tconst outputs: string[] = [];\n\t\tlet combinedDiff = \"\",\n\t\t\tcombinedPatch = \"\";\n\t\tlet firstChangedLine: number | undefined;\n\t\tconst batchNote = siblings.length > 1 ? [parallelEditBatchWarning(siblings.length)] : [];\n\t\tfor (let index = 0; index < prepared.length; index++) {\n\t\t\tconst item = prepared[index]!;\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tlet result: PatchSectionResult;\n\t\t\ttry {\n\t\t\t\tresult = await patcher.commit(item);\n\t\t\t} catch (error) {\n\t\t\t\tconst written = prepared.slice(0, index).map((entry) => entry.section.path);\n\t\t\t\tconst notWritten = prepared.slice(index + 1).map((entry) => entry.section.path);\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to write ${item.section.path}: ${message}` +\n\t\t\t\t\t\t(written.length > 0 ? ` Sections already written: ${written.join(\", \")}.` : \"\") +\n\t\t\t\t\t\t(notWritten.length > 0 ? ` Sections not written: ${notWritten.join(\", \")}.` : \"\"),\n\t\t\t\t\t{ cause: error },\n\t\t\t\t);\n\t\t\t}\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tinvalidateNativeSearchCache(result.canonicalPath);\n\t\t\tconst snapshot = recordHashlineSnapshot(result.canonicalPath, cwd, result.after, hashlineStore);\n\t\t\tconst diffResult = generateDiffString(result.before, result.after);\n\t\t\tcombinedDiff += `${combinedDiff ? \"\\n\" : \"\"}${diffResult.diff}`;\n\t\t\tcombinedPatch += `${combinedPatch ? \"\\n\" : \"\"}${generateUnifiedPatch(result.path, result.before, result.after)}`;\n\t\t\tfirstChangedLine ??= diffResult.firstChangedLine;\n\t\t\toutputs.push(formatCompactHashlineEditResult(snapshot, diffResult, [...batchNote, ...blockMessages(result)]));\n\t\t}\n\t\treturn {\n\t\t\tcontent: [{ type: \"text\", text: outputs.join(\"\\n\\n\") }],\n\t\t\tdetails: { diff: combinedDiff, patch: combinedPatch, firstChangedLine },\n\t\t};\n\t}\n\treturn { fs, batcher, applySiblingEdits };\n}\n\nexport function createEditToolDefinition(\n\tcwd: string,\n\toptions?: EditToolOptions,\n): ToolDefinition<typeof editSchema, EditToolDetails | undefined> {\n\tconst ops = options?.operations ?? defaultEditOperations;\n\tconst hashlineStore = options?.hashlineStore ?? createHashlineSnapshotStore();\n\t// Atomic adaptation of upstream #8627 (\"use ctx.cwd for cwd-sensitive tools\"). Upstream's edit\n\t// tool is a stateless text replacer, so it could resolve `ctx?.cwd || cwd` inline. Atomic's\n\t// hashline patcher instead carries per-tool state — the `EditFilesystem`, the `Patcher`, the\n\t// repeated-no-op counters, and the parallel-edit batcher — that is all keyed to one cwd.\n\t// Mutating a shared cwd field would corrupt concurrent tool calls, so each distinct execution\n\t// cwd gets its own scope. Callers that pass no ctx keep the factory cwd's scope unchanged.\n\tconst scopes = new Map<string, EditCwdScope>();\n\tconst scopeFor = (executionCwd: string): EditCwdScope => {\n\t\tconst existing = scopes.get(executionCwd);\n\t\tif (existing) return existing;\n\t\tconst scope = createEditCwdScope(executionCwd, ops, hashlineStore);\n\t\tscopes.set(executionCwd, scope);\n\t\treturn scope;\n\t};\n\treturn {\n\t\tname: \"edit\",\n\t\tlabel: \"edit\",\n\t\tdescription:\n\t\t\t\"Edit existing files with the hashline patch language: each section starts with [PATH#TAG] (TAG is the 4-hex snapshot tag from your latest read/search), then hunk headers (replace N..M:, replace block N:, delete N..M, delete block N, insert before|after N:, insert after block N:, insert head:, insert tail:) followed by +TEXT body rows. Numbers refer to the original file. Use the write tool to create new files.\",\n\t\tpromptSnippet: editToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: [...editToolSystemPromptContribution.guidelines],\n\t\t...experimentalToolSamplingProperty(),\n\t\tparameters: editSchema,\n\t\tasync execute(_toolCallId, input: EditToolInput, signal?: AbortSignal, _onUpdate?, ctx?: ExtensionContext) {\n\t\t\tif (typeof input.input !== \"string\" || input.input.trim() === \"\")\n\t\t\t\tthrow new Error(\"edit input must be a non-empty hashline script with [PATH#TAG] sections.\");\n\t\t\tconst executionCwd = ctx?.cwd || cwd;\n\t\t\tconst { fs, batcher, applySiblingEdits } = scopeFor(executionCwd);\n\t\t\tconst patch = Patch.parse(input.input, { cwd: executionCwd });\n\t\t\tconst paths = new Map<string, string>();\n\t\t\tfor (const section of patch.sections) {\n\t\t\t\tif (section.fileHash === undefined) throw new Error(missingSnapshotTagMessage(section.path));\n\t\t\t\tpaths.set(section.path, section.fileHash);\n\t\t\t}\n\t\t\tconst entry = batcher.announce(input.input, paths, signal);\n\t\t\ttry {\n\t\t\t\treturn await withFileMutationQueues(\n\t\t\t\t\t[...paths.keys()].map((sectionPath) => fs.canonicalPath(sectionPath)),\n\t\t\t\t\tasync () => {\n\t\t\t\t\t\tif (entry.settled) return await entry.promise;\n\t\t\t\t\t\tthrowIfAborted(signal);\n\t\t\t\t\t\tconst siblings = batcher.takeCompatible(entry);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst result = await applySiblingEdits(siblings, signal);\n\t\t\t\t\t\t\tfor (const sibling of siblings) sibling.resolve(result);\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tfor (const sibling of siblings) sibling.reject(error);\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tif (entry.settled) return await entry.promise;\n\t\t\t\tentry.reject(error);\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tbatcher.drop(entry);\n\t\t\t}\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(formatEditCall(args, theme, context.cwd));\n\t\t\treturn text;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatEditResult(result as EditToolResultLike, theme, context.isError);\n\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\tcomponent.clear();\n\t\t\tif (!output) return component;\n\t\t\tcomponent.addChild(new Spacer(1));\n\t\t\tcomponent.addChild(new Text(output, 1, 0));\n\t\t\treturn component;\n\t\t},\n\t};\n}\n\nexport function createEditTool(cwd: string, options?: EditToolOptions): AgentTool<typeof editSchema> {\n\treturn wrapToolDefinition(createEditToolDefinition(cwd, options));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/core/tools/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAGxE,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kBAAkB,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Container, Spacer, Text } from \"@earendil-works/pi-tui\";\nimport { constants } from \"fs\";\nimport { access as fsAccess, readFile as fsReadFile, writeFile as fsWriteFile } from \"fs/promises\";\nimport { type Static, Type } from \"typebox\";\nimport { renderDiff } from \"../../modes/interactive/components/diff.ts\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ExtensionContext, ToolDefinition } from \"../extensions/types.ts\";\nimport { nativeBlockResolver } from \"./block-resolver.ts\";\nimport { EditBatchCoordinator, parallelEditBatchWarning } from \"./edit-batch.ts\";\nimport { generateDiffString, generateUnifiedPatch, normalizeToLF, stripBom } from \"./edit-diff.ts\";\nimport {\n\tassertLiveMatchesPrepared,\n\tcomputeLiveState,\n\tFileMutationConflict,\n\tfilesystemErrorCode,\n\tisMissingTargetError,\n\ttype MutationRequester,\n\ttype MutationRequesterResolver,\n} from \"./file-mutation-coordinator.ts\";\nimport { canonicalMutationKey, withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport {\n\tcreateHashlineSnapshotStore,\n\tformatCompactHashlineEditResult,\n\ttype HashlineSnapshotStore,\n\trecordHashlineSnapshot,\n} from \"./hashline.ts\";\nimport {\n\tFilesystem,\n\tMismatchError,\n\tmissingSnapshotTagMessage,\n\tPatch,\n\tPatcher,\n\ttype PatchSectionResult,\n\ttype PreparedSection,\n\ttype WriteResult,\n} from \"./hashline-engine/index.ts\";\nimport { NonMintingSnapshotStore } from \"./non-minting-snapshot-store.ts\";\nimport { isNotebookPath, readEditableNotebookText, serializeEditedNotebookText } from \"./notebook.ts\";\nimport { resolveReadPath } from \"./path-utils.ts\";\nimport { renderToolPath } from \"./render-utils.ts\";\nimport { invalidateNativeSearchCache } from \"./search-native.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst editSchema = Type.Object(\n\t{\n\t\tinput: Type.String({\n\t\t\tdescription:\n\t\t\t\t\"One or more hashline file sections. Must start with [PATH#TAG]; tag comes from the latest read, search, write, or successful edit output.\",\n\t\t}),\n\t},\n\t{ additionalProperties: false },\n);\n// Hashline prompt origin: can1357/oh-my-pi packages/hashline/src/prompt.md @ 15b5c1397fc (MIT).\n// This file carries Atomic-maintained local modifications; see ./hashline-engine/PROVENANCE.md and ./hashline-engine/LICENSE.upstream.\nexport const editToolSystemPromptContribution = Object.freeze({\n\tsnippet: \"Apply source edits with hashline patch input\",\n\tguidelines: Object.freeze([\n\t\t\"hashline edit format: a header ending in ':' is followed by '+TEXT' body rows; 'delete' has no body. Every section starts with [PATH#TAG]; TAG is REQUIRED (the 4-hex snapshot tag from your latest read/search) — there is no hashless form. Use the write tool to create new files.\",\n\t\t\"Ops: 'replace N..M:' replaces original lines N..M (INCLUSIVE — line M is consumed); 'delete N..M' / 'delete block N' delete (no body); 'insert before N:' / 'insert after N:' insert relative to a line; 'insert head:' / 'insert tail:' insert at file start/end. Block ops ('replace block N:', 'delete block N', 'insert after block N:') resolve the exact syntactic node BEGINNING on N through the native Rust tree-sitter `blockRangeAt` primitive in `@bastani/atomic-natives`; the brace/indent heuristic is the fallback only when the native binding is unavailable. Single line: 'replace N..N:' / 'delete N'. The range is the ORIGINAL lines you touch; body length is irrelevant.\",\n\t\t\"Body rows appear only under a ':' header and start on the NEXT line. Every row is '+TEXT' (adds a literal line, leading whitespace kept; '+' alone adds a blank line). There is NO other body row kind — never write '-old' or a bare/context line. To keep a line, leave it out of every range. For a literal line starting with '-' or '+', prefix it: '+-x', '++x'.\",\n\t\t\"Block anchors: 'replace block N' resolves the outermost node BEGINNING on N. Where a language folds a decorator/annotation into its construct (Python folds `@dec` and `def` into one node; TypeScript/Java annotations also fold), anchoring at the first decorator sweeps both. Rust `#[attr]` and doc- or line-comments resolve alone; replacing there with a construct body duplicates the construct, so use explicit 'replace N..M:' to take both. Confirm the result echo: 'replace block N → resolved lines A-B (K lines)'. 'insert after block N:' takes the opener, never the closer; insert-after echoes '; body lands after line B'. Resolution fails for an unsupported language, blank/closer line, no node beginning on N, or an unparsable block; use 'replace N..M:' or 'insert after M:' instead.\",\n\t\t\"Numbers refer to the ORIGINAL file and do not shift as hunks apply; they die with the call — every applied edit mints a fresh #TAG and renumbers, so anchor the next edit on the edit response or a fresh read. Parallel edit calls that share a [path#TAG] are applied as one snapshot batch. Ranges are TIGHT: cover ONLY lines whose content changes; a stale wide range shreds everything it spans. Pure additions use 'insert', never a widened 'replace'. Whole construct → 'replace block N'; lines inside it → 'replace N..M'.\",\n\t\t\"On a stale-tag rejection or any surprising result: STOP and re-read before further edits. Never start or end a range mid-expression/mid-block, and never span a hunk across an elided ('…') region — read it first. Never use edit to reformat/restyle code; run the project formatter instead.\",\n\t\t[\n\t\t\t\"Worked examples. Original (the exact shape `read` returns):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"1:@cache\",\n\t\t\t\"2:def greet(name):\",\n\t\t\t'3: msg = \"Hello, \" + name',\n\t\t\t\"4: print(msg)\",\n\t\t\t'5:greet(\"world\")',\n\t\t\t\"```\",\n\t\t\t\"Replace one original line with one line:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"replace 3..3:\",\n\t\t\t'+ msg = f\"Hi, {name}\"',\n\t\t\t\"```\",\n\t\t\t\"Replace the decorated Python block (Python folds `@cache` and `def` into one node; anchoring at line 2 would keep/orphan line 1). For a Rust attribute or doc- or line-comment, use explicit `replace N..M:` to take both it and the construct:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"replace block 1:\",\n\t\t\t\"+@cache\",\n\t\t\t\"+def greet(name):\",\n\t\t\t'+ print(f\"Hello, {name}\")',\n\t\t\t\"```\",\n\t\t\t\"Delete one line (no colon/body):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"delete 4\",\n\t\t\t\"```\",\n\t\t\t\"Delete a range (no colon/body):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"delete 3..4\",\n\t\t\t\"```\",\n\t\t\t\"Delete a whole block (no colon/body):\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"delete block 2\",\n\t\t\t\"```\",\n\t\t\t\"Insert before a line:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert before 5:\",\n\t\t\t\"+log()\",\n\t\t\t\"```\",\n\t\t\t\"Insert after a line:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert after 3:\",\n\t\t\t\"+ print(msg)\",\n\t\t\t\"```\",\n\t\t\t\"Insert after the block whose opener is line 2:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert after block 2:\",\n\t\t\t\"+audit()\",\n\t\t\t\"```\",\n\t\t\t\"Insert at both file ends:\",\n\t\t\t\"```text\",\n\t\t\t\"[greet.py#A1B2]\",\n\t\t\t\"insert head:\",\n\t\t\t\"+# generated\",\n\t\t\t\"insert tail:\",\n\t\t\t'+greet(\"everyone\")',\n\t\t\t\"```\",\n\t\t\t\"Multi-file input:\",\n\t\t\t\"```text\",\n\t\t\t\"[src/a.ts#0A3B]\",\n\t\t\t\"replace 1..1:\",\n\t\t\t\"+export const enabled = true;\",\n\t\t\t\"[src/b.ts#1F7C]\",\n\t\t\t\"delete 20\",\n\t\t\t\"```\",\n\t\t].join(\"\\n\"),\n\t\t[\n\t\t\t\"Anti-patterns:\",\n\t\t\t\"```text\",\n\t\t\t\"# WRONG — `-` rows are rejected; bare context rows are auto-prefixed and inserted as literal content: `-` rows are not valid; the range already names the lines being changed. For a literal `-` line, write `+-…`.\",\n\t\t\t\"replace 3..3:\",\n\t\t\t' msg = \"Hello\"',\n\t\t\t\"- print(msg)\",\n\t\t\t\"+ return msg\",\n\t\t\t\"# RIGHT\",\n\t\t\t\"replace 3..3:\",\n\t\t\t\"+ return msg\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — body glued to its header: payload line has no preceding hunk header; body starts on the NEXT line.\",\n\t\t\t\"replace block 238:+export const value = 1;\",\n\t\t\t\"# RIGHT\",\n\t\t\t\"replace block 238:\",\n\t\t\t\"+export const value = 1;\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — `delete N..M` has no colon and no body.\",\n\t\t\t\"delete 2..3:\",\n\t\t\t\"+replacement\",\n\t\t\t\"# RIGHT: delete 2..3\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — empty `insert` / `replace`: `insert` needs at least one `+TEXT` body row. A bodyless concrete `replace` silently deletes the range.\",\n\t\t\t\"insert after 2:\",\n\t\t\t\"replace 4..4:\",\n\t\t\t\"# RIGHT — give `replace` a body; if deletion is intended, write `delete 4`.\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — widened replace for a pure insertion can drop retyped keepers.\",\n\t\t\t\"replace 2..4:\",\n\t\t\t\"+kept()\",\n\t\t\t\"+added()\",\n\t\t\t\"# RIGHT: insert after 2:\",\n\t\t\t\"+added()\",\n\t\t\t\"\",\n\t\t\t\"# WRONG — block anchor is a closer/last visible line.\",\n\t\t\t\"insert after block 3:\",\n\t\t\t\"+after()\",\n\t\t\t\"# RIGHT: insert after 3:\",\n\t\t\t\"+after()\",\n\t\t\t\"```\",\n\t\t].join(\"\\n\"),\n\t\t[\n\t\t\t\"If you remember nothing else:\",\n\t\t\t\"1. RE-GROUND AFTER EVERY EDIT. Every apply mints a fresh #TAG and renumbers; use the edit response or a fresh read. Stale tag or surprise? STOP and re-read.\",\n\t\t\t\"2. RANGES ARE TIGHT. Cover only lines that change; a stale wide range shreds everything it spans. Whole construct → replace block N.\",\n\t\t\t\"3. THE BODY IS THE FINAL CONTENT. Only +TEXT rows; never -old/context lines. The range does the deleting.\",\n\t\t].join(\"\\n\"),\n\t] as const),\n} as const);\n\nexport type EditToolInput = Static<typeof editSchema>;\n\nexport interface EditToolDetails {\n\tdiff: string;\n\tpatch: string;\n\tfirstChangedLine?: number;\n}\n\nexport interface EditOperations {\n\treadFile: (absolutePath: string) => Promise<Buffer>;\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\taccess: (absolutePath: string) => Promise<void>;\n}\n\nconst defaultEditOperations: EditOperations = {\n\treadFile: (path) => fsReadFile(path),\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\taccess: (path) => fsAccess(path, constants.R_OK | constants.W_OK),\n};\n\nexport interface EditToolOptions {\n\toperations?: EditOperations;\n\thashlineStore?: HashlineSnapshotStore;\n\t/** Resolves who is being rejected when a mutation conflicts. Diagnostic only. */\n\tresolveMutationRequester?: MutationRequesterResolver;\n}\n\ntype EditToolResultLike = {\n\tcontent: Array<{ type: \"text\"; text: string }>;\n\tdetails: EditToolDetails | undefined;\n};\n\nclass EditFilesystem extends Filesystem {\n\tprivate readonly cwd: string;\n\tprivate readonly operations: EditOperations;\n\tconstructor(cwd: string, operations: EditOperations) {\n\t\tsuper();\n\t\tthis.cwd = cwd;\n\t\tthis.operations = operations;\n\t}\n\n\tcanonicalPath(path: string): string {\n\t\treturn resolveReadPath(path, this.cwd);\n\t}\n\n\tasync preflightWrite(path: string): Promise<void> {\n\t\tconst absolutePath = this.canonicalPath(path);\n\t\ttry {\n\t\t\tawait this.operations.access(absolutePath);\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error && \"code\" in error ? `Error code: ${error.code}` : String(error);\n\t\t\tthrow new Error(`Could not edit file: ${path}. ${message}.`);\n\t\t}\n\t}\n\n\tasync readText(path: string): Promise<string> {\n\t\tconst absolutePath = this.canonicalPath(path);\n\t\treturn isNotebookPath(absolutePath)\n\t\t\t? readEditableNotebookText(absolutePath, path)\n\t\t\t: (await this.operations.readFile(absolutePath)).toString(\"utf-8\");\n\t}\n\n\tasync writeText(path: string, content: string): Promise<WriteResult> {\n\t\tconst absolutePath = this.canonicalPath(path);\n\t\tconst persisted = isNotebookPath(absolutePath)\n\t\t\t? serializeEditedNotebookText(absolutePath, path, normalizeToLF(stripBom(content).text))\n\t\t\t: content;\n\t\tawait this.operations.writeFile(absolutePath, persisted);\n\t\treturn { text: persisted };\n\t}\n}\n\nfunction isFourDigitHexTag(value: string): boolean {\n\treturn (\n\t\tvalue.length === 4 &&\n\t\t[...value].every(\n\t\t\t(char) => (char >= \"0\" && char <= \"9\") || (char >= \"a\" && char <= \"f\") || (char >= \"A\" && char <= \"F\"),\n\t\t)\n\t);\n}\n\nfunction extractFirstHeaderPath(input: string | undefined): string | undefined {\n\tif (!input) return undefined;\n\tfor (const line of input.split(\"\\n\")) {\n\t\tconst trimmed = line.trimStart();\n\t\tif (!trimmed.startsWith(\"[\")) continue;\n\t\tconst hashIndex = trimmed.indexOf(\"#\", 1);\n\t\tconst closeIndex = hashIndex >= 0 ? trimmed.indexOf(\"]\", hashIndex + 1) : -1;\n\t\tif (hashIndex <= 1 || closeIndex !== hashIndex + 5) continue;\n\t\tconst tag = trimmed.slice(hashIndex + 1, closeIndex);\n\t\tif (isFourDigitHexTag(tag)) return trimmed.slice(1, hashIndex);\n\t}\n\treturn undefined;\n}\n\nfunction formatEditCall(args: unknown, theme: Theme, cwd: string): string {\n\tconst input = args && typeof args === \"object\" && \"input\" in args ? (args as { input?: unknown }).input : undefined;\n\tconst pathDisplay = renderToolPath(\n\t\textractFirstHeaderPath(typeof input === \"string\" ? input : undefined) ?? null,\n\t\ttheme,\n\t\tcwd,\n\t);\n\treturn `${theme.fg(\"toolTitle\", theme.bold(\"edit\"))} ${pathDisplay}`;\n}\n\nfunction formatEditResult(result: EditToolResultLike, theme: Theme, isError: boolean): string | undefined {\n\tif (isError) {\n\t\tconst errorText = result.content\n\t\t\t.filter((c) => c.type === \"text\")\n\t\t\t.map((c) => c.text || \"\")\n\t\t\t.join(\"\\n\");\n\t\treturn errorText ? theme.fg(\"error\", errorText) : undefined;\n\t}\n\treturn result.details?.diff ? renderDiff(result.details.diff) : undefined;\n}\n\nasync function withFileMutationQueues<T>(\n\tfilePaths: readonly string[],\n\tfn: (canonicalKeys: ReadonlyMap<string, string>) => Promise<T>,\n): Promise<T> {\n\tconst sorted = [...new Set(filePaths)].sort();\n\tconst canonicalKeys = new Map<string, string>();\n\tconst run = (index: number): Promise<T> => {\n\t\tconst filePath = sorted[index];\n\t\treturn filePath\n\t\t\t? withFileMutationQueue(filePath, (canonicalKey) => {\n\t\t\t\t\tcanonicalKeys.set(filePath, canonicalKey);\n\t\t\t\t\treturn run(index + 1);\n\t\t\t\t})\n\t\t\t: fn(canonicalKeys);\n\t};\n\treturn run(0);\n}\n\nfunction throwIfAborted(signal?: AbortSignal): void {\n\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n}\n\nfunction formatNoopMessage(path: string, count: number): string {\n\treturn `Edits to ${path} parsed and applied cleanly, but produced no change: your body row(s) are byte-identical to the file at the targeted lines. The bug is somewhere else — re-read the file before issuing another edit. Do NOT widen the payload or add lines; verify the anchor first.${count > 1 ? `\\nNo-op count for this identical payload: ${count}.` : \"\"}`;\n}\n\nfunction blockMessages(item: PreparedSection | PatchSectionResult): string[] {\n\tconst warnings =\n\t\t\"parseWarnings\" in item ? [...item.parseWarnings, ...(item.applyResult.warnings ?? [])] : item.warnings;\n\tconst resolutions =\n\t\t(\"applyResult\" in item ? item.applyResult.blockResolutions : item.blockResolutions)?.map((resolution) => {\n\t\t\tconst verb = resolution.op === \"insert_after\" ? \"insert after block\" : `${resolution.op} block`;\n\t\t\tconst lands = resolution.op === \"insert_after\" ? `; body lands after line ${resolution.end}` : \"\";\n\t\t\treturn `${verb} ${resolution.anchorLine} → resolved lines ${resolution.start}-${resolution.end} (${resolution.end - resolution.start + 1} lines)${lands}`;\n\t\t}) ?? [];\n\treturn [...warnings, ...resolutions];\n}\n\nfunction assertUniquePreparedPaths(prepared: readonly PreparedSection[]): void {\n\tconst seen = new Map<string, string>();\n\tfor (const entry of prepared) {\n\t\tconst previous = seen.get(entry.canonicalPath);\n\t\tif (previous)\n\t\t\tthrow new Error(\n\t\t\t\t`Multiple hashline sections resolve to the same file (${previous} and ${entry.section.path}). Merge their ops under one header before applying.`,\n\t\t\t);\n\t\tseen.set(entry.canonicalPath, entry.section.path);\n\t}\n}\n\ninterface EditCwdScope {\n\treadonly fs: EditFilesystem;\n\treadonly batcher: EditBatchCoordinator<EditToolResultLike>;\n\tapplySiblingEdits(\n\t\tsiblings: readonly { input: string }[],\n\t\tcanonicalKeys: ReadonlyMap<string, string>,\n\t\tapplySignal?: AbortSignal,\n\t\trequester?: MutationRequester,\n\t): Promise<EditToolResultLike>;\n}\n\nfunction createEditCwdScope(cwd: string, ops: EditOperations, hashlineStore: HashlineSnapshotStore): EditCwdScope {\n\tconst fs = new EditFilesystem(cwd, ops);\n\t// Reads delegate to the session store; records are computed and dropped, so a rejection\n\t// cannot mint the tag that would validate an identical retry. `recordHashlineSnapshot`\n\t// below stays the single writer of provenance.\n\tconst patcher = new Patcher({\n\t\tfs,\n\t\tsnapshots: new NonMintingSnapshotStore(hashlineStore.snapshots),\n\t\tblockResolver: nativeBlockResolver,\n\t});\n\tconst noopCounts = new Map<string, number>();\n\tconst batcher = new EditBatchCoordinator<EditToolResultLike>();\n\t/**\n\t * `requester` is the identity of the call that reached the lock first. #2496 merges\n\t * compatible siblings into one planned mutation, and a conflict rejects that mutation as a\n\t * unit, so naming the batch's holder is accurate. Identity is diagnostic regardless: it\n\t * never decides whether a sibling is admitted.\n\t */\n\tasync function applySiblingEdits(\n\t\tsiblings: readonly { input: string }[],\n\t\tcanonicalKeys: ReadonlyMap<string, string>,\n\t\tapplySignal?: AbortSignal,\n\t\trequester?: MutationRequester,\n\t): Promise<EditToolResultLike> {\n\t\tconst merged =\n\t\t\tsiblings.length === 1\n\t\t\t\t? Patch.parse(siblings[0]!.input, { cwd })\n\t\t\t\t: Patch.parse(siblings.map((sibling) => sibling.input).join(\"\\n\"), { cwd });\n\t\tconst prepared: PreparedSection[] = [];\n\t\tfor (const section of merged.sections) {\n\t\t\tthrowIfAborted(applySignal);\n\t\t\ttry {\n\t\t\t\tprepared.push(await patcher.prepare(section));\n\t\t\t} catch (error) {\n\t\t\t\t// `hashRecognized` is the engine's own answer to \"have I ever recorded this tag\n\t\t\t\t// for this path\", so the foreign case is read off a typed field rather than\n\t\t\t\t// matched out of a message in vendored code. Everything else the engine raises\n\t\t\t\t// is left alone: recovery successes and the head/tail drift warning never reach\n\t\t\t\t// here, and a stale-but-known tag keeps the engine's own wording.\n\t\t\t\tif (!(error instanceof MismatchError) || error.hashRecognized) throw error;\n\t\t\t\tthrow new FileMutationConflict({\n\t\t\t\t\treason: \"foreign_snapshot\",\n\t\t\t\t\tpath: section.path,\n\t\t\t\t\tcanonicalKey: await canonicalMutationKey(fs.canonicalPath(section.path)),\n\t\t\t\t\tpresentedTag: error.expectedFileHash,\n\t\t\t\t\tliveState: computeLiveState(error.fileLines.join(\"\\n\")),\n\t\t\t\t\t...(requester ? { requester } : {}),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tassertUniquePreparedPaths(prepared);\n\t\tconst noops = prepared.filter((item) => item.isNoop);\n\t\tif (noops.length > 0) {\n\t\t\tif (noops.length !== prepared.length)\n\t\t\t\tthrow new Error(`Hashline edit for ${noops[0]!.section.path} did not change the file.`);\n\t\t\tconst key = prepared.map((item) => `${item.canonicalPath}\\0${item.applyResult.text}`).join(\"\\0\\0\");\n\t\t\tconst count = (noopCounts.get(key) ?? 0) + 1;\n\t\t\tnoopCounts.set(key, count);\n\t\t\tif (count >= 3) throw new Error(`STOP. ${formatNoopMessage(prepared[0]!.section.path, count)}`);\n\t\t\treturn {\n\t\t\t\tcontent: [{ type: \"text\", text: formatNoopMessage(prepared[0]!.section.path, count) }],\n\t\t\t\tdetails: { diff: \"\", patch: \"\" },\n\t\t\t};\n\t\t}\n\t\tfor (const item of prepared) {\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tlet live: string;\n\t\t\ttry {\n\t\t\t\tlive = normalizeToLF(stripBom(await fs.readText(item.section.path)).text);\n\t\t\t} catch (error) {\n\t\t\t\t// `prepare` already read this file, so a read failing now means the target changed\n\t\t\t\t// state under the patch: deleted, replaced by a directory, locked, or rewritten as\n\t\t\t\t// something this reader cannot parse. Those are all race outcomes rather than tool\n\t\t\t\t// errors, and letting them escape as raw filesystem errors would hide that from\n\t\t\t\t// every consumer that tells conflicts apart from ordinary tool failures.\n\t\t\t\tconst missing = isMissingTargetError(error);\n\t\t\t\tconst causeCode = filesystemErrorCode(error);\n\t\t\t\tthrow new FileMutationConflict({\n\t\t\t\t\treason: missing ? \"target_missing\" : \"target_unreadable\",\n\t\t\t\t\tpath: item.section.path,\n\t\t\t\t\t// Queue registration resolved this before preparation. A new lookup may fail\n\t\t\t\t\t// for the same reason as the read and mask the typed conflict.\n\t\t\t\t\tcanonicalKey: canonicalKeys.get(item.canonicalPath)!,\n\t\t\t\t\t// Only the missing case can describe the target. Once a read fails for any\n\t\t\t\t\t// other cause, its size and tag are unknowable and claiming either is invention.\n\t\t\t\t\t...(missing ? { liveState: computeLiveState(undefined) } : {}),\n\t\t\t\t\t...(causeCode ? { causeCode } : {}),\n\t\t\t\t\t...(requester ? { requester } : {}),\n\t\t\t\t});\n\t\t\t}\n\t\t\t// Compared before calling the guard so the happy path skips the extra `realpath`\n\t\t\t// that naming the target canonically costs. The guard still owns the rejection.\n\t\t\tif (live !== item.normalized) {\n\t\t\t\tassertLiveMatchesPrepared({\n\t\t\t\t\tcanonicalKey: await canonicalMutationKey(item.canonicalPath),\n\t\t\t\t\tpath: item.section.path,\n\t\t\t\t\tprepared: item.normalized,\n\t\t\t\t\tlive,\n\t\t\t\t\t...(requester ? { requester } : {}),\n\t\t\t\t\t...(item.section.fileHash ? { presentedTag: item.section.fileHash } : {}),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst outputs: string[] = [];\n\t\tlet combinedDiff = \"\",\n\t\t\tcombinedPatch = \"\";\n\t\tlet firstChangedLine: number | undefined;\n\t\tconst batchNote = siblings.length > 1 ? [parallelEditBatchWarning(siblings.length)] : [];\n\t\tfor (let index = 0; index < prepared.length; index++) {\n\t\t\tconst item = prepared[index]!;\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tlet result: PatchSectionResult;\n\t\t\ttry {\n\t\t\t\tresult = await patcher.commit(item);\n\t\t\t} catch (error) {\n\t\t\t\tconst written = prepared.slice(0, index).map((entry) => entry.section.path);\n\t\t\t\tconst notWritten = prepared.slice(index + 1).map((entry) => entry.section.path);\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to write ${item.section.path}: ${message}` +\n\t\t\t\t\t\t(written.length > 0 ? ` Sections already written: ${written.join(\", \")}.` : \"\") +\n\t\t\t\t\t\t(notWritten.length > 0 ? ` Sections not written: ${notWritten.join(\", \")}.` : \"\"),\n\t\t\t\t\t{ cause: error },\n\t\t\t\t);\n\t\t\t}\n\t\t\tinvalidateNativeSearchCache(result.canonicalPath);\n\t\t\t// Recorded before the abort check, not after. `commit` has already written, and since\n\t\t\t// the patcher was made non-minting this call is the only writer of provenance, so\n\t\t\t// aborting first would leave the session's own bytes on disk with nothing recorded\n\t\t\t// for them. The next overwrite would then read as another agent's file.\n\t\t\tconst snapshot = recordHashlineSnapshot(result.canonicalPath, cwd, result.after, hashlineStore);\n\t\t\tthrowIfAborted(applySignal);\n\t\t\tconst diffResult = generateDiffString(result.before, result.after);\n\t\t\tcombinedDiff += `${combinedDiff ? \"\\n\" : \"\"}${diffResult.diff}`;\n\t\t\tcombinedPatch += `${combinedPatch ? \"\\n\" : \"\"}${generateUnifiedPatch(result.path, result.before, result.after)}`;\n\t\t\tfirstChangedLine ??= diffResult.firstChangedLine;\n\t\t\toutputs.push(formatCompactHashlineEditResult(snapshot, diffResult, [...batchNote, ...blockMessages(result)]));\n\t\t}\n\t\treturn {\n\t\t\tcontent: [{ type: \"text\", text: outputs.join(\"\\n\\n\") }],\n\t\t\tdetails: { diff: combinedDiff, patch: combinedPatch, firstChangedLine },\n\t\t};\n\t}\n\treturn { fs, batcher, applySiblingEdits };\n}\n\nexport function createEditToolDefinition(\n\tcwd: string,\n\toptions?: EditToolOptions,\n): ToolDefinition<typeof editSchema, EditToolDetails | undefined> {\n\tconst ops = options?.operations ?? defaultEditOperations;\n\tconst hashlineStore = options?.hashlineStore ?? createHashlineSnapshotStore();\n\t// Atomic adaptation of upstream #8627 (\"use ctx.cwd for cwd-sensitive tools\"). Upstream's edit\n\t// tool is a stateless text replacer, so it could resolve `ctx?.cwd || cwd` inline. Atomic's\n\t// hashline patcher instead carries per-tool state — the `EditFilesystem`, the `Patcher`, the\n\t// repeated-no-op counters, and the parallel-edit batcher — that is all keyed to one cwd.\n\t// Mutating a shared cwd field would corrupt concurrent tool calls, so each distinct execution\n\t// cwd gets its own scope. Callers that pass no ctx keep the factory cwd's scope unchanged.\n\tconst scopes = new Map<string, EditCwdScope>();\n\tconst scopeFor = (executionCwd: string): EditCwdScope => {\n\t\tconst existing = scopes.get(executionCwd);\n\t\tif (existing) return existing;\n\t\tconst scope = createEditCwdScope(executionCwd, ops, hashlineStore);\n\t\tscopes.set(executionCwd, scope);\n\t\treturn scope;\n\t};\n\treturn {\n\t\tname: \"edit\",\n\t\tlabel: \"edit\",\n\t\tdescription:\n\t\t\t\"Edit existing files with the hashline patch language: each section starts with [PATH#TAG] (TAG is the 4-hex snapshot tag from your latest read/search), then hunk headers (replace N..M:, replace block N:, delete N..M, delete block N, insert before|after N:, insert after block N:, insert head:, insert tail:) followed by +TEXT body rows. Numbers refer to the original file. Use the write tool to create new files.\",\n\t\tpromptSnippet: editToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: [...editToolSystemPromptContribution.guidelines],\n\t\tconstrainedSampling: { type: \"json_schema\", strict: \"prefer\" },\n\t\tparameters: editSchema,\n\t\tasync execute(toolCallId, input: EditToolInput, signal?: AbortSignal, _onUpdate?, ctx?: ExtensionContext) {\n\t\t\tif (typeof input.input !== \"string\" || input.input.trim() === \"\")\n\t\t\t\tthrow new Error(\"edit input must be a non-empty hashline script with [PATH#TAG] sections.\");\n\t\t\tconst executionCwd = ctx?.cwd || cwd;\n\t\t\tconst { fs, batcher, applySiblingEdits } = scopeFor(executionCwd);\n\t\t\tconst patch = Patch.parse(input.input, { cwd: executionCwd });\n\t\t\tconst paths = new Map<string, string>();\n\t\t\tfor (const section of patch.sections) {\n\t\t\t\tif (section.fileHash === undefined) throw new Error(missingSnapshotTagMessage(section.path));\n\t\t\t\tpaths.set(section.path, section.fileHash);\n\t\t\t}\n\t\t\tconst entry = batcher.announce(input.input, paths, signal);\n\t\t\ttry {\n\t\t\t\treturn await withFileMutationQueues(\n\t\t\t\t\t[...paths.keys()].map((sectionPath) => fs.canonicalPath(sectionPath)),\n\t\t\t\t\tasync (canonicalKeys) => {\n\t\t\t\t\t\tif (entry.settled) return await entry.promise;\n\t\t\t\t\t\tthrowIfAborted(signal);\n\t\t\t\t\t\tconst siblings = batcher.takeCompatible(entry);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst result = await applySiblingEdits(\n\t\t\t\t\t\t\t\tsiblings,\n\t\t\t\t\t\t\t\tcanonicalKeys,\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t\toptions?.resolveMutationRequester?.(toolCallId),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tfor (const sibling of siblings) sibling.resolve(result);\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tfor (const sibling of siblings) sibling.reject(error);\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tif (entry.settled) return await entry.promise;\n\t\t\t\tentry.reject(error);\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tbatcher.drop(entry);\n\t\t\t}\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(formatEditCall(args, theme, context.cwd));\n\t\t\treturn text;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatEditResult(result as EditToolResultLike, theme, context.isError);\n\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\tcomponent.clear();\n\t\t\tif (!output) return component;\n\t\t\tcomponent.addChild(new Spacer(1));\n\t\t\tcomponent.addChild(new Text(output, 1, 0));\n\t\t\treturn component;\n\t\t},\n\t};\n}\n\nexport function createEditTool(cwd: string, options?: EditToolOptions): AgentTool<typeof editSchema> {\n\treturn wrapToolDefinition(createEditToolDefinition(cwd, options));\n}\n"]}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { type SnapshotStore } from "./hashline-engine/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Stable token carried inside every conflict message.
|
|
4
|
+
*
|
|
5
|
+
* It lives in the message text, not only on the class, because nothing typed survives the
|
|
6
|
+
* trip from a tool to a workflow: a subagent result reports `cause`/`error` as strings, a
|
|
7
|
+
* workflow task result has no error field at all, and a workflow runner reduces a failure to
|
|
8
|
+
* `err.message`. Matching this token is how a consumer downstream of that flattening tells a
|
|
9
|
+
* mutation conflict apart from an ordinary tool error.
|
|
10
|
+
*
|
|
11
|
+
* It is placed at the start of the message so it survives truncation of the tail as the
|
|
12
|
+
* message is relayed. Never change it without updating every consumer that matches on it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FILE_MUTATION_CONFLICT_CODE = "FILE_MUTATION_CONFLICT";
|
|
15
|
+
/**
|
|
16
|
+
* Reasons report a {@link FileMutationLiveState} wherever the live target can be described,
|
|
17
|
+
* which is everywhere except `target_unreadable`: that one exists precisely because the target
|
|
18
|
+
* could not be read, so claiming a size or a tag for it would be invention.
|
|
19
|
+
*
|
|
20
|
+
* Only the reasons that have something to compare against also report a
|
|
21
|
+
* {@link FileMutationConflictEvidence} diff: `no_prior_observation` never read the file, and
|
|
22
|
+
* `foreign_snapshot` presented a tag naming content this session has never seen, so in both
|
|
23
|
+
* cases there is no prior side to diff.
|
|
24
|
+
*/
|
|
25
|
+
export type FileMutationConflictReason =
|
|
26
|
+
/** Live content moved between the mutation being prepared and the write being attempted. */
|
|
27
|
+
"changed_before_write"
|
|
28
|
+
/** Overwrite attempted with no prior read of this file in this session. */
|
|
29
|
+
| "no_prior_observation"
|
|
30
|
+
/** Overwrite attempted, but what this session observed is no longer the live content. */
|
|
31
|
+
| "changed_since_observation"
|
|
32
|
+
/** Exclusive create lost: the target already exists. */
|
|
33
|
+
| "target_exists"
|
|
34
|
+
/** The target no longer exists: removed between preparing the mutation and writing it. */
|
|
35
|
+
| "target_missing"
|
|
36
|
+
/**
|
|
37
|
+
* The target still exists but can no longer be read: replaced by a directory, made
|
|
38
|
+
* unreadable, locked, or rewritten as content this reader cannot parse. Distinct from a
|
|
39
|
+
* content change because there is nothing to diff, and from a deletion because the path is
|
|
40
|
+
* still occupied.
|
|
41
|
+
*/
|
|
42
|
+
| "target_unreadable"
|
|
43
|
+
/** The presented tag was never minted in this session's snapshot store. */
|
|
44
|
+
| "foreign_snapshot";
|
|
45
|
+
/**
|
|
46
|
+
* Correlation only.
|
|
47
|
+
*
|
|
48
|
+
* Flora, 2026-08-13: identity "must never grant permission or identify a current owner or
|
|
49
|
+
* culprit". So this describes the writer being *rejected*, never a winner, and nothing in
|
|
50
|
+
* this module reads it to decide whether a mutation is admitted. A record of the last Atomic
|
|
51
|
+
* writer could not prove ownership anyway, because shell commands, external programs, other
|
|
52
|
+
* Atomic processes and symlink changes all bypass this coordinator.
|
|
53
|
+
*/
|
|
54
|
+
export interface MutationRequester {
|
|
55
|
+
readonly sessionId: string;
|
|
56
|
+
/** Session that spawned this one, from the child's `supervisor.supervisorSessionId`. */
|
|
57
|
+
readonly parentSessionId?: string;
|
|
58
|
+
readonly workflowRunId?: string;
|
|
59
|
+
readonly workflowStageId?: string;
|
|
60
|
+
readonly workflowStageName?: string;
|
|
61
|
+
readonly subagentRunId?: string;
|
|
62
|
+
readonly subagentAgent?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Position within a fan-out. Needed to tell siblings apart: a child's intercom address is
|
|
65
|
+
* `agent + runId + index` (`resolveSubagentIntercomTarget`), so a stage that spawns several
|
|
66
|
+
* children of one agent onto one file yields identical identity without it.
|
|
67
|
+
*/
|
|
68
|
+
readonly subagentIndex?: number;
|
|
69
|
+
/** Opaque per-attempt UUID. Diagnostic only; never an authority. */
|
|
70
|
+
readonly attemptId?: string;
|
|
71
|
+
/** The specific tool call rejected. Narrower than the attempt, which makes many calls. */
|
|
72
|
+
readonly toolCallId?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Resolved per execution rather than captured once.
|
|
76
|
+
*
|
|
77
|
+
* Mirrors `sessionTempDir` in the session tool registry, which is a thunk "so bash spill
|
|
78
|
+
* files follow the live transcript session across fork/branch/resume". A requester captured
|
|
79
|
+
* at tool-construction time would keep a stale session id through exactly those transitions,
|
|
80
|
+
* which is the relaunch case this feature exists to make legible.
|
|
81
|
+
*
|
|
82
|
+
* Takes the tool call id rather than leaving callers to merge it in, because it has a
|
|
83
|
+
* different lifetime from the rest: session identity belongs to the session, the call id is
|
|
84
|
+
* an argument of the single `execute` being rejected.
|
|
85
|
+
*/
|
|
86
|
+
export type MutationRequesterResolver = (toolCallId: string) => MutationRequester | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* What actually diverged, so a conflict can be acted on without a second round trip.
|
|
89
|
+
*
|
|
90
|
+
* A reason and a path are not evidence; they say a race happened, not what it did. Whatever acts
|
|
91
|
+
* on the rejection, a workflow applying its own control behavior or a human reading the error,
|
|
92
|
+
* needs the divergence itself before it can decide anything.
|
|
93
|
+
*
|
|
94
|
+
* The span is computed by trimming the common prefix and suffix rather than comparing line by
|
|
95
|
+
* line positionally, so inserting one line at the top reports one changed region and not every
|
|
96
|
+
* following line.
|
|
97
|
+
*/
|
|
98
|
+
export interface FileMutationConflictEvidence {
|
|
99
|
+
/** 1-based line of the first divergence. */
|
|
100
|
+
readonly line: number;
|
|
101
|
+
/** Lines the rejected mutation assumed occupied the divergent span. */
|
|
102
|
+
readonly assumedLines: number;
|
|
103
|
+
/** Lines actually occupying it now. */
|
|
104
|
+
readonly foundLines: number;
|
|
105
|
+
/** First assumed line, clamped. Absent when the span is pure insertion. */
|
|
106
|
+
readonly assumed?: string;
|
|
107
|
+
/** First live line, clamped. Absent when the span is pure deletion. */
|
|
108
|
+
readonly found?: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The target as it stood at the moment of refusal, independent of any comparison.
|
|
112
|
+
*
|
|
113
|
+
* Kept separate from {@link FileMutationConflictEvidence} because the two answer different
|
|
114
|
+
* questions and only one of them can be unanswerable. A conflict may have nothing to diff
|
|
115
|
+
* against, as when the session never read the file, but there is still always something worth
|
|
116
|
+
* reporting about what the mutation was aimed at. Size in particular is the difference between
|
|
117
|
+
* clobbering an empty placeholder and clobbering four hundred lines of production code.
|
|
118
|
+
*/
|
|
119
|
+
export interface FileMutationLiveState {
|
|
120
|
+
/** Lines currently in the file. Zero when it is empty or does not exist. */
|
|
121
|
+
readonly lines: number;
|
|
122
|
+
/** Tag of the live content, so a rejected tag can be told apart from the real one. */
|
|
123
|
+
readonly tag?: string;
|
|
124
|
+
/** First line, clamped. Absent when the file is missing, empty, or starts with a blank line. */
|
|
125
|
+
readonly firstLine?: string;
|
|
126
|
+
}
|
|
127
|
+
/** Describe live content, or a missing target when `live` is `undefined`. */
|
|
128
|
+
export declare function computeLiveState(live: string | undefined): FileMutationLiveState;
|
|
129
|
+
/**
|
|
130
|
+
* Compare what a mutation assumed against what is live, returning `undefined` when they agree.
|
|
131
|
+
*
|
|
132
|
+
* Both sides must already share a line-ending convention. `Snapshot.text` is normalized to LF,
|
|
133
|
+
* so a caller passing raw live bytes on Windows would report every line as divergent.
|
|
134
|
+
*/
|
|
135
|
+
export declare function computeConflictEvidence(assumed: string, found: string): FileMutationConflictEvidence | undefined;
|
|
136
|
+
export interface FileMutationConflictDetails {
|
|
137
|
+
readonly reason: FileMutationConflictReason;
|
|
138
|
+
/** Display path, as the model referred to it. */
|
|
139
|
+
readonly path: string;
|
|
140
|
+
/** Symlink-resolved key, from `canonicalMutationKey`. */
|
|
141
|
+
readonly canonicalKey: string;
|
|
142
|
+
readonly requester?: MutationRequester;
|
|
143
|
+
/** The tag the rejected mutation presented, when it had one. */
|
|
144
|
+
readonly presentedTag?: string;
|
|
145
|
+
/** Absent when the reason carries no comparison, as with `no_prior_observation`. */
|
|
146
|
+
readonly evidence?: FileMutationConflictEvidence;
|
|
147
|
+
/** What the mutation was aimed at. Absent only when it could not be read at all. */
|
|
148
|
+
readonly liveState?: FileMutationLiveState;
|
|
149
|
+
/**
|
|
150
|
+
* Filesystem error code that classified the conflict, such as `EISDIR` or `EACCES`. For a
|
|
151
|
+
* target that became unreadable this is the whole diagnosis, since nothing else about the
|
|
152
|
+
* file can be reported once the read fails.
|
|
153
|
+
*/
|
|
154
|
+
readonly causeCode?: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Raised instead of a bare `Error` so a conflict is countable rather than merely readable.
|
|
158
|
+
* The message is the wire format; see {@link FILE_MUTATION_CONFLICT_CODE}.
|
|
159
|
+
*/
|
|
160
|
+
export declare class FileMutationConflict extends Error {
|
|
161
|
+
readonly reason: FileMutationConflictReason;
|
|
162
|
+
readonly path: string;
|
|
163
|
+
readonly canonicalKey: string;
|
|
164
|
+
readonly requester: MutationRequester | undefined;
|
|
165
|
+
readonly presentedTag: string | undefined;
|
|
166
|
+
/** Structured alongside the message so a ledger can record it without re-parsing text. */
|
|
167
|
+
readonly evidence: FileMutationConflictEvidence | undefined;
|
|
168
|
+
readonly liveState: FileMutationLiveState | undefined;
|
|
169
|
+
readonly causeCode: string | undefined;
|
|
170
|
+
constructor(details: FileMutationConflictDetails);
|
|
171
|
+
/**
|
|
172
|
+
* Ordered by what must survive truncation: the code first, then the reason and guidance,
|
|
173
|
+
* then the divergence, and the live-state summary last. The tail is the most expendable
|
|
174
|
+
* because it is the part a reader can always recover by opening the file.
|
|
175
|
+
*/
|
|
176
|
+
static formatMessage(details: FileMutationConflictDetails): string;
|
|
177
|
+
}
|
|
178
|
+
/** Whether a thrown value is an exclusive-create collision reported by the filesystem. */
|
|
179
|
+
export declare function isExclusiveCreateCollision(error: unknown): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Whether a thrown value says the target is gone. `ENOTDIR` counts because a parent directory
|
|
182
|
+
* replaced by a file makes the path unreachable for the same reason a deletion does.
|
|
183
|
+
*/
|
|
184
|
+
export declare function isMissingTargetError(error: unknown): boolean;
|
|
185
|
+
/** The `code` a filesystem rejection carries, when it carries one. */
|
|
186
|
+
export declare function filesystemErrorCode(error: unknown): string | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Guard for the window between preparing a mutation and committing it, called under the
|
|
189
|
+
* mutation queue.
|
|
190
|
+
*
|
|
191
|
+
* `prepared` is the content the mutation was computed against, which for a hashline edit is
|
|
192
|
+
* the file as `prepare` read it, NOT what the session originally observed, since `prepare`
|
|
193
|
+
* re-reads and may have recovered onto drifted content. Naming that honestly matters: this
|
|
194
|
+
* closes a time-of-check window, it does not prove the session read the file.
|
|
195
|
+
*
|
|
196
|
+
* Full text rather than tags: a hashline tag is 16 bits and the engine documents that it can
|
|
197
|
+
* collide, so it is a label for the model to recognize, never proof of identity.
|
|
198
|
+
*/
|
|
199
|
+
export declare function assertLiveMatchesPrepared(args: {
|
|
200
|
+
readonly canonicalKey: string;
|
|
201
|
+
readonly path: string;
|
|
202
|
+
readonly prepared: string;
|
|
203
|
+
readonly live: string;
|
|
204
|
+
readonly requester?: MutationRequester;
|
|
205
|
+
readonly presentedTag?: string;
|
|
206
|
+
}): void;
|
|
207
|
+
/**
|
|
208
|
+
* Guard for `write` overwriting an existing file: this session must already have observed the
|
|
209
|
+
* exact content it is about to replace.
|
|
210
|
+
*
|
|
211
|
+
* Asks the session's own store and never another session's, which is what keeps cross-session
|
|
212
|
+
* rejection strict. `byHashAndText` answers both halves of the requirement at once, since a
|
|
213
|
+
* hit means this session recorded exactly this content for this path.
|
|
214
|
+
*
|
|
215
|
+
* `storeKey` is the snapshot store's own key convention, the normalized absolute path, which
|
|
216
|
+
* is NOT symlink-resolved unlike `canonicalKey`. Passing the wrong one makes a symlinked path
|
|
217
|
+
* miss and report a false `no_prior_observation`.
|
|
218
|
+
*
|
|
219
|
+
* The tag is derived here rather than accepted. Unlike the engine's own use of
|
|
220
|
+
* `byHashAndText`, where the hash is the independent claim a section presented, `write` has no
|
|
221
|
+
* presented tag: it replaces the whole file. Any tag is therefore just `live` hashed, and
|
|
222
|
+
* taking it as a parameter only creates a way for the two to disagree silently.
|
|
223
|
+
*/
|
|
224
|
+
export declare function assertPriorSessionObservation(args: {
|
|
225
|
+
readonly canonicalKey: string;
|
|
226
|
+
readonly storeKey: string;
|
|
227
|
+
readonly path: string;
|
|
228
|
+
readonly store: SnapshotStore;
|
|
229
|
+
readonly live: string;
|
|
230
|
+
readonly requester?: MutationRequester;
|
|
231
|
+
}): void;
|
|
232
|
+
/**
|
|
233
|
+
* Build a requester from parts already present on a session. Kept pure so it is testable
|
|
234
|
+
* without constructing an `AgentSession`, and so this module never imports one.
|
|
235
|
+
*/
|
|
236
|
+
export declare function buildMutationRequester(parts: {
|
|
237
|
+
readonly sessionId: string;
|
|
238
|
+
readonly orchestration?: {
|
|
239
|
+
readonly kind: string;
|
|
240
|
+
readonly workflowRunId: string;
|
|
241
|
+
readonly workflowStageId: string;
|
|
242
|
+
readonly workflowStageName: string;
|
|
243
|
+
};
|
|
244
|
+
readonly intercom?: {
|
|
245
|
+
readonly runId: string;
|
|
246
|
+
readonly agent: string;
|
|
247
|
+
readonly index?: number;
|
|
248
|
+
readonly supervisor?: {
|
|
249
|
+
readonly supervisorSessionId: string;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly attemptId?: string;
|
|
253
|
+
readonly toolCallId?: string;
|
|
254
|
+
}): MutationRequester;
|
|
255
|
+
//# sourceMappingURL=file-mutation-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-mutation-coordinator.d.ts","sourceRoot":"","sources":["../../../src/core/tools/file-mutation-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,MAAM,0BAA0B;AACrC,4FAA4F;AAC1F,sBAAsB;AACxB,2EAA2E;GACzE,sBAAsB;AACxB,yFAAyF;GACvF,2BAA2B;AAC7B,wDAAwD;GACtD,eAAe;AACjB,0FAA0F;GACxF,gBAAgB;AAClB;;;;;GAKG;GACD,mBAAmB;AACrB,2EAA2E;GACzE,kBAAkB,CAAC;AAEtB;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,0FAA0F;IAC1F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