@bastani/atomic 0.9.18-alpha.5 → 0.9.18-alpha.7
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 +88 -0
- package/README.md +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +39 -0
- package/dist/builtin/intercom/README.md +22 -2
- package/dist/builtin/intercom/broker/broker.ts +676 -128
- package/dist/builtin/intercom/broker/client.ts +151 -35
- package/dist/builtin/intercom/broker/delivered-message-cache.ts +497 -37
- package/dist/builtin/intercom/broker/framing.ts +4 -2
- package/dist/builtin/intercom/broker/paths.ts +10 -0
- package/dist/builtin/intercom/broker/pending-send-registry.ts +1 -2
- package/dist/builtin/intercom/broker/send-handler.ts +311 -52
- package/dist/builtin/intercom/broker/send-signature.ts +4 -2
- package/dist/builtin/intercom/broker/socket-writes.ts +103 -0
- package/dist/builtin/intercom/broker/spawn.ts +9 -4
- package/dist/builtin/intercom/index.bundle.mjs +1410 -212
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/recoverable-disconnect.ts +52 -0
- package/dist/builtin/intercom/retry-policy.ts +8 -0
- package/dist/builtin/intercom/skills/intercom/SKILL.md +17 -9
- package/dist/builtin/intercom/types.ts +27 -8
- package/dist/builtin/intercom/workflow-stage-path-matching.ts +90 -0
- package/dist/builtin/intercom/workflow-stage-target.ts +57 -0
- package/dist/builtin/mcp/index.bundle.mjs +427 -126
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +19 -0
- package/dist/builtin/subagents/README.md +3 -3
- package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
- package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +11 -11
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
- package/dist/builtin/subagents/agents/debugger.md +3 -3
- package/dist/builtin/subagents/agents/worker.md +2 -2
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/skills/qlty/SKILL.md +29 -101
- package/dist/builtin/subagents/skills/qlty/references/manual-configuration.md +52 -0
- package/dist/builtin/subagents/skills/subagent/SKILL.md +11 -11
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +49 -132
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +46 -0
- package/dist/builtin/workflows/README.md +7 -7
- package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
- package/dist/builtin/workflows/builtin/{chunk-szz1ajz9.js → chunk-42s7sw0b.js} +9 -2
- package/dist/builtin/workflows/builtin/{chunk-2dqb5s2q.js → chunk-79fjkcvh.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-n58a7v26.js → chunk-b0v2xab1.js} +181 -10
- package/dist/builtin/workflows/builtin/{chunk-fghhy2a5.js → chunk-ed4jfn5t.js} +23 -5
- package/dist/builtin/workflows/builtin/{chunk-h3r2vkzc.js → chunk-hqpe2cyx.js} +60 -21
- package/dist/builtin/workflows/builtin/{chunk-hzzn6adg.js → chunk-k3w87x8y.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-82ha8p41.js → chunk-n8h4yyew.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-qwzvgxnq.js → chunk-reqr3sr3.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-c53y8bdh.js → chunk-wgccch41.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-0x6e303p.js → chunk-zbekjqew.js} +20 -7
- package/dist/builtin/workflows/builtin/{chunk-29wrp38a.js → chunk-ze5x3d1r.js} +1 -1
- package/dist/builtin/workflows/builtin/classify-and-act.js +2 -2
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +2 -2
- package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
- package/dist/builtin/workflows/builtin/goal.js +3 -3
- package/dist/builtin/workflows/builtin/index.js +11 -11
- package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
- package/dist/builtin/workflows/builtin/open-claude-design.js +2 -2
- package/dist/builtin/workflows/builtin/ralph.js +3 -3
- package/dist/builtin/workflows/builtin/steering-context.js +1 -1
- package/dist/builtin/workflows/builtin/tournament.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +39 -52
- package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +9 -37
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +49 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +57 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +57 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +47 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +57 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +60 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +58 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_astra.md +58 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +18 -4
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +3194 -737
- package/dist/builtin/workflows/src/index.js +899 -436
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +0 -10
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +4 -0
- package/dist/cli/list-models.js.map +1 -1
- package/dist/client/index.d.ts +1 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/index.js.map +1 -1
- package/dist/config.d.ts +0 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -45
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +8 -6
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -0
- 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-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +3 -4
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +6 -0
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +13 -5
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +1 -1
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +8 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +4 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +8 -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 +12 -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/runner-shortcuts.d.ts.map +1 -1
- package/dist/core/extensions/runner-shortcuts.js +0 -1
- package/dist/core/extensions/runner-shortcuts.js.map +1 -1
- package/dist/core/fast-model-routing-transport.d.ts +12 -0
- package/dist/core/fast-model-routing-transport.d.ts.map +1 -0
- package/dist/core/{codex-fast-mode-transport.js → fast-model-routing-transport.js} +29 -29
- package/dist/core/fast-model-routing-transport.js.map +1 -0
- package/dist/core/fast-model-routing.d.ts +57 -0
- package/dist/core/fast-model-routing.d.ts.map +1 -0
- package/dist/core/fast-model-routing.js +201 -0
- package/dist/core/fast-model-routing.js.map +1 -0
- package/dist/core/fast-model-variants.d.ts +98 -0
- package/dist/core/fast-model-variants.d.ts.map +1 -0
- package/dist/core/fast-model-variants.js +148 -0
- package/dist/core/fast-model-variants.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +4 -2
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +0 -10
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +0 -8
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +15 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver-initial.js +1 -1
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts +14 -1
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +25 -3
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime.d.ts +39 -2
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +91 -7
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +8 -2
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +18 -18
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-archive.d.ts.map +1 -1
- package/dist/core/session-manager-archive.js +25 -2
- package/dist/core/session-manager-archive.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts +0 -2
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +2 -9
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager-internals.d.ts +0 -1
- package/dist/core/settings-manager-internals.d.ts.map +1 -1
- package/dist/core/settings-manager-internals.js.map +1 -1
- package/dist/core/settings-manager-ui-accessors.d.ts +0 -8
- package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-ui-accessors.js +0 -53
- package/dist/core/settings-manager-ui-accessors.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-types.d.ts +0 -5
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +4 -2
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +0 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.js +7 -7
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +128 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/hashline.d.ts +2 -2
- package/dist/core/tools/hashline.d.ts.map +1 -1
- package/dist/core/tools/hashline.js +40 -10
- package/dist/core/tools/hashline.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +8 -8
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/workflow-stage-admission.d.ts +6 -0
- package/dist/core/workflow-stage-admission.d.ts.map +1 -1
- package/dist/core/workflow-stage-admission.js +14 -0
- package/dist/core/workflow-stage-admission.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.d.ts +4 -0
- package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.js +26 -1
- package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +7 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +43 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +0 -6
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -2
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +0 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +6 -11
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -5
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +3 -19
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +1 -2
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +4 -11
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/transcript-follow-indicator.js +3 -3
- package/dist/modes/interactive/components/transcript-follow-indicator.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +8 -8
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +5 -16
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +2 -9
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +3 -0
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.js +2 -2
- package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +1 -0
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +7 -0
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +20 -10
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.js +1 -5
- package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
- package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-initial-session-binding.js +3 -0
- package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +0 -8
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +5 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +15 -9
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -3
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -3
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +9 -12
- 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-model-routing.js +10 -13
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +29 -0
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +2 -32
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +1 -5
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -5
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +6 -13
- 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 +19 -13
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +27 -3
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +13 -6
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +2 -3
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +33 -18
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/custom-provider.md +2 -0
- package/docs/development.md +17 -0
- package/docs/docs.json +14 -2
- package/docs/extensions.md +9 -4
- package/docs/intercom.md +41 -7
- package/docs/keybindings.md +8 -6
- package/docs/models/evals.md +394 -0
- package/docs/models/model-selection.md +54 -27
- package/docs/models/pareto-efficiency.md +33 -16
- package/docs/models.md +37 -1
- package/docs/packages.md +2 -2
- package/docs/providers.md +44 -20
- package/docs/quickstart.md +8 -6
- package/docs/rpc.md +3 -3
- package/docs/sdk.md +2 -16
- package/docs/settings.md +19 -22
- package/docs/skills.md +4 -2
- package/docs/subagents.md +9 -3
- package/docs/tools/edit.md +373 -0
- package/docs/tools.md +3 -7
- package/docs/tui.md +2 -1
- package/docs/usage.md +3 -5
- package/docs/workflows/api-reference.md +1395 -0
- package/docs/workflows/authoring.md +678 -0
- package/docs/workflows/builtins.md +245 -0
- package/docs/workflows/operations.md +811 -0
- package/docs/workflows/reliable-design.md +2099 -0
- package/docs/workflows/verification.md +62 -0
- package/docs/workflows.md +15 -5183
- package/npm-shrinkwrap.json +584 -69
- package/package.json +7 -7
- package/dist/client/remote-session.d.ts +0 -64
- package/dist/client/remote-session.d.ts.map +0 -1
- package/dist/client/remote-session.js +0 -351
- package/dist/client/remote-session.js.map +0 -1
- package/dist/client/transcript.d.ts +0 -12
- package/dist/client/transcript.d.ts.map +0 -1
- package/dist/client/transcript.js +0 -98
- package/dist/client/transcript.js.map +0 -1
- package/dist/core/codex-fast-mode-transport.d.ts +0 -12
- package/dist/core/codex-fast-mode-transport.d.ts.map +0 -1
- package/dist/core/codex-fast-mode-transport.js.map +0 -1
- package/dist/core/codex-fast-mode.d.ts +0 -53
- package/dist/core/codex-fast-mode.d.ts.map +0 -1
- package/dist/core/codex-fast-mode.js +0 -249
- package/dist/core/codex-fast-mode.js.map +0 -1
- package/dist/modes/interactive/components/fast-mode-selector.d.ts +0 -27
- package/dist/modes/interactive/components/fast-mode-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/fast-mode-selector.js +0 -107
- package/dist/modes/interactive/components/fast-mode-selector.js.map +0 -1
- package/dist/server/create-harness.d.ts +0 -53
- package/dist/server/create-harness.d.ts.map +0 -1
- package/dist/server/create-harness.js +0 -360
- package/dist/server/create-harness.js.map +0 -1
- package/docs/models/artificial-analysis-index.md +0 -83
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
# `edit`
|
|
2
|
+
|
|
3
|
+
> Applies source edits to existing files with Atomic's hashline patch language, supplied as one `input` string.
|
|
4
|
+
|
|
5
|
+
## Source
|
|
6
|
+
|
|
7
|
+
- Tool entry point and result formatting: `src/core/tools/edit.ts`
|
|
8
|
+
- Native block resolver and fallback: `src/core/tools/block-resolver.ts`
|
|
9
|
+
- Session snapshot integration and compact output: `src/core/tools/hashline.ts`
|
|
10
|
+
- Parallel-call coalescing: `src/core/tools/edit-batch.ts`
|
|
11
|
+
- Hashline engine:
|
|
12
|
+
- `hashline-engine/input.ts` splits file sections.
|
|
13
|
+
- `hashline-engine/tokenizer.ts` and `hashline-engine/parser.ts` parse operations and body rows.
|
|
14
|
+
- `hashline-engine/block.ts` expands block operations through the host resolver.
|
|
15
|
+
- `hashline-engine/apply.ts` applies edits and performs bounded boundary and insertion-landing repairs.
|
|
16
|
+
- `hashline-engine/patcher.ts` validates snapshots, preflights sections, recovers drift, and commits writes.
|
|
17
|
+
- `hashline-engine/recovery.ts` performs snapshot-based stale-tag recovery.
|
|
18
|
+
- `hashline-engine/snapshots.ts`, `hashline-engine/format.ts`, and `hashline-engine/messages.ts` define snapshot storage, syntax, limits, and diagnostics.
|
|
19
|
+
|
|
20
|
+
The engine originated in `can1357/oh-my-pi` at commit `15b5c1397fc059673e3b0bcbc50b074e6dc1f9d8`. See
|
|
21
|
+
`src/core/tools/hashline-engine/PROVENANCE.md` and `src/core/tools/hashline-engine/LICENSE.upstream`.
|
|
22
|
+
|
|
23
|
+
## Inputs
|
|
24
|
+
|
|
25
|
+
| Field | Type | Required | Description |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `input` | `string` | Yes | One or more hashline file sections. The value must be non-empty. |
|
|
28
|
+
|
|
29
|
+
Each section starts with `[PATH#TAG]`. `TAG` is the four-hex snapshot tag emitted by the latest `read`, `search`,
|
|
30
|
+
`write`, or successful `edit` in the active tool/session store. Tags from another session do not authorize an edit.
|
|
31
|
+
Hashline edits existing files; use `write` to create a file.
|
|
32
|
+
|
|
33
|
+
The operations are:
|
|
34
|
+
|
|
35
|
+
- `replace N..M:` — replace inclusive original lines N through M with the following body rows.
|
|
36
|
+
- `replace block N:` — replace the syntactic block beginning on N with the following body rows.
|
|
37
|
+
- `delete N..M` — delete inclusive original lines N through M. It has no body.
|
|
38
|
+
- `delete block N` — delete the syntactic block beginning on N. It has no body.
|
|
39
|
+
- `insert before N:` — insert body rows immediately before original line N.
|
|
40
|
+
- `insert after N:` — insert body rows immediately after original line N.
|
|
41
|
+
- `insert after block N:` — insert body rows after the end of the syntactic block beginning on N.
|
|
42
|
+
- `insert head:` — insert body rows at the start of the file.
|
|
43
|
+
- `insert tail:` — insert body rows at the end of the file.
|
|
44
|
+
|
|
45
|
+
Line numbers refer to the original tagged snapshot and do not shift as hunks in one call apply. A body-bearing header is
|
|
46
|
+
followed by one or more `+TEXT` rows. The `+` is syntax; `TEXT` is inserted verbatim with leading whitespace preserved,
|
|
47
|
+
and `+` alone inserts a blank line. There are no old-text or context rows. To insert a literal row beginning with `-` or
|
|
48
|
+
`+`, write `+-text` or `++text`.
|
|
49
|
+
|
|
50
|
+
### Block resolution
|
|
51
|
+
|
|
52
|
+
`replace block`, `delete block`, and `insert after block` first use the native Rust tree-sitter `blockRangeAt` primitive
|
|
53
|
+
from `@bastani/atomic-natives`. The brace/indent heuristic is used only as a fallback when the native binding is
|
|
54
|
+
unavailable. Resolution selects the outermost syntactic node beginning on N. Where a language folds a decorator or
|
|
55
|
+
annotation into its construct—Python `@dec` plus `def`, and TypeScript/Java annotations—anchoring at the first decorator
|
|
56
|
+
resolves both. A Rust `#[attr]` and doc- or line-comments are separate sibling nodes: anchoring there resolves that node
|
|
57
|
+
alone, and replacing it with a construct body duplicates the untouched construct. Use `replace N..M:` or `delete N..M`
|
|
58
|
+
with explicit lines to take both, and confirm the `→ resolved lines A-B (K lines)` echo before continuing.
|
|
59
|
+
|
|
60
|
+
For `insert after block N:`, N is the opener, never the closing delimiter or last visible line. If the last line is already
|
|
61
|
+
known, use `insert after M:`. A successful resolution is echoed as
|
|
62
|
+
`replace block N → resolved lines A-B (K lines)` or `delete block N → resolved lines A-B (K lines)`; insert-after adds
|
|
63
|
+
`; body lands after line B` to `insert after block N → resolved lines A-B (K lines)`.
|
|
64
|
+
|
|
65
|
+
A replace/delete block cannot resolve when the language is unsupported, the anchor is blank or a closer, no syntactic node
|
|
66
|
+
begins there, the subtree does not parse, or no resolver is configured. Use `replace N..M:` or `delete N..M`. An unresolved
|
|
67
|
+
`insert after block N:` is instead lowered to `insert after N:` with a warning; use `insert after M:` when the explicit end
|
|
68
|
+
line is known. Streaming preview drops unresolved replace/delete block operations, while the authoritative apply rejects
|
|
69
|
+
them.
|
|
70
|
+
|
|
71
|
+
## Tolerated input shapes
|
|
72
|
+
|
|
73
|
+
Atomic's hand parser deliberately accepts these non-canonical shapes:
|
|
74
|
+
|
|
75
|
+
- Leading blank lines, a leading byte-order mark, and an optional `*** Begin Patch` envelope are ignored.
|
|
76
|
+
`*** End Patch` and `*** Abort` stop parsing; operations before either marker remain.
|
|
77
|
+
- Hex tags are case-insensitive on input and normalized to uppercase.
|
|
78
|
+
- Quoted header paths are unquoted. Absolute paths inside the execution working directory become relative display paths.
|
|
79
|
+
- Some malformed bracketed headers are recovered after removing apply-patch path noise such as `Update File:`, `Add File:`,
|
|
80
|
+
`Delete File:`, `Move to:`, and extra leading `***`. A recovered edit section still needs a valid four-hex tag.
|
|
81
|
+
- `replace N:` is a single-line replacement. `delete N` is a single-line deletion.
|
|
82
|
+
- `replace N-M:`, `replace N…M:`, and `replace N M:` are accepted as `replace N..M:`. The same separators are accepted for
|
|
83
|
+
`delete` ranges.
|
|
84
|
+
- The trailing colon is optional on body-bearing `replace` and `insert` headers.
|
|
85
|
+
- An empty concrete `replace N..M:` is accepted as deletion of that range. Prefer `delete N..M`; empty `replace block` is
|
|
86
|
+
rejected.
|
|
87
|
+
- Bare body rows under a body-bearing hunk are treated as literal rows, auto-prefixed with `+`, and warned. When every bare,
|
|
88
|
+
nonblank row has a `LINE:`/`*LINE:` read-output prefix, those prefixes are stripped as a pasted snapshot; mixed rows and
|
|
89
|
+
explicit `+` rows are preserved. A body made entirely of quoted or numeric values keeps its numeric keys.
|
|
90
|
+
- Repeated sections for the same authored path are merged in first-occurrence order when their tags do not conflict.
|
|
91
|
+
- A run of comment lines beginning with `#` is skipped only when an operation header is the immediately next token. If a
|
|
92
|
+
blank line, end of input, or the next `[PATH#TAG]` header intervenes, the deferred comment is replayed as body content and
|
|
93
|
+
rejected with the payload-line error. Once a hunk is open, a `#` line is body content: under `delete` it triggers the
|
|
94
|
+
delete-takes-no-body rejection; under a body-bearing hunk it is auto-prefixed and written as a literal line. Blank layout
|
|
95
|
+
rows before a body or after its final row are ignored; proven interior blank body rows are preserved.
|
|
96
|
+
|
|
97
|
+
The parser does **not** tolerate `delete N..M:` or a body under `delete`/`delete block`, `-` diff rows, apply-patch file
|
|
98
|
+
sentinels inside the patch, unified-diff/`@@` hunk headers, bare numeric hunk headers, malformed/absent section headers,
|
|
99
|
+
unsafe or non-positive anchors, oversized ranges, empty `insert`/`insert after block`, or empty `replace block` hunks.
|
|
100
|
+
|
|
101
|
+
Notable difference from the upstream reference: Atomic accepts an empty concrete `replace N..M:` as a deletion, and
|
|
102
|
+
unresolvable `insert after block` operations lower to plain `insert after` with a warning rather than failing.
|
|
103
|
+
|
|
104
|
+
## Outputs
|
|
105
|
+
|
|
106
|
+
A successful edit returns one compact text block per written section. Each starts with a fresh `[path#TAG]` header for the
|
|
107
|
+
post-edit content, followed by warnings and block-resolution lines, then a compact diff preview (or a
|
|
108
|
+
`First changed line: N` fallback). Warnings are emitted as diagnostic lines directly beneath the header rather than under a
|
|
109
|
+
separate `Warnings:` label. Multi-section results are separated by a blank line.
|
|
110
|
+
|
|
111
|
+
Block echoes have these exact shapes:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
replace block N → resolved lines A-B (K lines)
|
|
115
|
+
delete block N → resolved lines A-B (K lines)
|
|
116
|
+
insert after block N → resolved lines A-B (K lines); body lands after line B
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The tool's `details` value is `EditToolDetails`:
|
|
120
|
+
|
|
121
|
+
- `diff`: the combined rendered diff string.
|
|
122
|
+
- `patch`: the combined unified patch string.
|
|
123
|
+
- `firstChangedLine`: optional first changed post-edit line.
|
|
124
|
+
|
|
125
|
+
Each successful `write` or `edit` records and returns a fresh snapshot tag. Plain `write` output is also compact: a refreshed
|
|
126
|
+
header plus a success confirmation, not a full file reprint. `write` strips copied hashline headers and `LINE:`/`*LINE:`
|
|
127
|
+
display prefixes only when they match a known snapshot in the current store, reports that stripping, and preserves whether
|
|
128
|
+
a complete copied snapshot had a terminal newline. A copied `Successfully wrote to <path>` confirmation (with or without the
|
|
129
|
+
legacy `N bytes` wording) counts as tool chrome only when `<path>` is the complete path the write was asked for — the `path`
|
|
130
|
+
argument exactly as given, its resolved absolute form, or its cwd-relative form — or the copied snapshot's own path. A bare
|
|
131
|
+
basename is not enough, so a user-authored line such as `Successfully wrote to notes.md` is preserved even when the target is
|
|
132
|
+
`deep/dir/notes.md`. Unknown or literal hashline-looking content is preserved.
|
|
133
|
+
|
|
134
|
+
Parallel `edit` calls sharing the same `[path#TAG]` are applied as one snapshot-anchored batch, so one sibling does not fail
|
|
135
|
+
only because another sibling minted a new tag first. A later call arriving after that batch committed still attempts
|
|
136
|
+
snapshot recovery for provably non-overlapping drift.
|
|
137
|
+
|
|
138
|
+
Atomic verifies every target against its tagged snapshot before writing. A recognized stale tag can recover a provably
|
|
139
|
+
non-overlapping external or in-session change and emits the corresponding warning. Unknown tags, overlapping stale edits,
|
|
140
|
+
and unrecoverable drift fail with the current hash and anchor context and leave the section unchanged. All sections are
|
|
141
|
+
prepared before writes begin, but this is preflight atomicity, not transactional rollback: a filesystem failure during
|
|
142
|
+
sequential commits can leave earlier sections written, and the error names written and unwritten sections.
|
|
143
|
+
|
|
144
|
+
A byte-identical edit returns a no-op diagnostic without writing. The same identical payload escalates to an error on its
|
|
145
|
+
third attempt.
|
|
146
|
+
|
|
147
|
+
## Worked examples
|
|
148
|
+
|
|
149
|
+
Reference file in the exact shape `read` returns:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
[a.ts#0A3B]
|
|
153
|
+
1:const X = "a";
|
|
154
|
+
2:const Y = X;
|
|
155
|
+
3:
|
|
156
|
+
4:console.log(X);
|
|
157
|
+
5:console.log(Y);
|
|
158
|
+
6:export { X, Y };
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Replace line 1 with two lines:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
[a.ts#0A3B]
|
|
165
|
+
replace 1..1:
|
|
166
|
+
+const X = "b";
|
|
167
|
+
+export const Y = X;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Insert below or above line 5:
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
[a.ts#0A3B]
|
|
174
|
+
insert after 5:
|
|
175
|
+
+console.log(X + Y);
|
|
176
|
+
insert before 5:
|
|
177
|
+
+console.log(X + Y);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Delete lines 4 through 5:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
[a.ts#0A3B]
|
|
184
|
+
delete 4..5
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Insert at both file boundaries:
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
[a.ts#0A3B]
|
|
191
|
+
insert head:
|
|
192
|
+
+// header
|
|
193
|
+
insert tail:
|
|
194
|
+
+// trailer
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Replace or delete a complete block by anchoring its opener:
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
[service.ts#7B2E]
|
|
201
|
+
replace block 10:
|
|
202
|
+
+function load() {
|
|
203
|
+
+ return cache.get("key");
|
|
204
|
+
+}
|
|
205
|
+
delete block 30
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Edit two files in one preflighted call:
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
[src/a.ts#0A3B]
|
|
212
|
+
replace 4..4:
|
|
213
|
+
+const enabled = true;
|
|
214
|
+
[src/b.ts#1F7C]
|
|
215
|
+
delete 20
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Limits & Caps
|
|
219
|
+
|
|
220
|
+
- `HL_FILE_HASH_LENGTH = 4`; canonical tags match `HL_FILE_HASH_RE_RAW = [0-9A-F]{4}` and are content-derived,
|
|
221
|
+
session-store snapshot pointers.
|
|
222
|
+
- Anchors must be positive safe integers no greater than `Number.MAX_SAFE_INTEGER`.
|
|
223
|
+
- `HL_MAX_EXPANDED_RANGE_LINES = 100_000`; an inclusive numeric range is rejected before expansion above that size.
|
|
224
|
+
- `MISMATCH_CONTEXT = 2`; mismatch and unresolved-block previews show up to two lines on either side of each anchor.
|
|
225
|
+
- The repeated identical no-op hard limit in `edit.ts` is `3`; attempts one and two return the diagnostic, while attempt
|
|
226
|
+
three throws it with a `STOP.` prefix.
|
|
227
|
+
- `RECOVERY_FUZZ_FACTOR = 0`; snapshot recovery does not slide a patch hunk to a nearby duplicate.
|
|
228
|
+
- Format constants are `HL_FILE_PREFIX = "["`, `HL_FILE_SUFFIX = "]"`, `HL_FILE_HASH_SEP = "#"`,
|
|
229
|
+
`HL_PAYLOAD_REPLACE = "+"`, `HL_RANGE_SEP = ".."`, and `HL_HEADER_COLON = ":"`; operation keywords are `replace`,
|
|
230
|
+
`delete`, `insert`, `block`, `before`, `after`, `head`, and `tail`.
|
|
231
|
+
- Explicit `+TEXT` that resembles a valid hunk header remains literal and emits `HUNK_LIKE_LITERAL_WARNING`.
|
|
232
|
+
|
|
233
|
+
Across whole-file, truncated, and range/offset reads of LF or CRLF text, numbered output treats a terminal newline as a
|
|
234
|
+
separator, not an extra synthetic row. Genuine blank lines—including one immediately before that terminal newline—remain
|
|
235
|
+
visible, and truncation totals and continuation selectors count real lines. Bare-CR files retain their existing
|
|
236
|
+
compatibility behavior and are outside this guarantee.
|
|
237
|
+
|
|
238
|
+
## Errors
|
|
239
|
+
|
|
240
|
+
The templates below quote Atomic's literal messages. `N`, `M`, `A`, `B`, `PATH`, `TAG`, `<path>`, `<message>`, and similar
|
|
241
|
+
angle-bracketed names stand for runtime substitutions. Parser errors that originate within a section include the authored
|
|
242
|
+
`line N:` prefix shown.
|
|
243
|
+
|
|
244
|
+
### Tool boundary and filesystem
|
|
245
|
+
|
|
246
|
+
- `edit input must be a non-empty hashline script with [PATH#TAG] sections.`
|
|
247
|
+
- `Operation aborted`
|
|
248
|
+
- `Could not edit file: <path>. <message>.` (`<message>` is `Error code: <code>` when the error exposes a code.)
|
|
249
|
+
- `Multiple hashline sections resolve to the same file (<first path> and <second path>). Merge their ops under one header before applying.`
|
|
250
|
+
- `Stale hashline tag for <path>: file content changed before write. Re-read before editing.`
|
|
251
|
+
- `Failed to write <path>: <message>`; when applicable it appends ` Sections already written: <paths>.` and/or
|
|
252
|
+
` Sections not written: <paths>.`
|
|
253
|
+
|
|
254
|
+
### Section headers and snapshot tags
|
|
255
|
+
|
|
256
|
+
- `input must begin with "[PATH#HASH]" on the first non-blank line for anchored edits; got: <preview>. Example: "[src/foo.ts#1A2B]" then edit ops.`
|
|
257
|
+
- `Input header must be [PATH] or [PATH#TAG] with a 4-hex content-hash tag; got <header>.`
|
|
258
|
+
- `Input header "[]" is empty; provide a file path.`
|
|
259
|
+
- `Patch input did not produce any sections.`
|
|
260
|
+
- ``Missing hashline snapshot tag for <path>; use `[<path>#tag]` from your latest read/search output. To create a new file, use the write tool.``
|
|
261
|
+
- `Conflicting hashline snapshot tags for <path>: #<first tag> and #<second tag>. Re-read the file and retry with one current header.`
|
|
262
|
+
- `Hashline Patcher requires a SnapshotStore; section tags are opaque store pointers.`
|
|
263
|
+
- `File not found: <path>. Use the write tool to create new files.`
|
|
264
|
+
|
|
265
|
+
### Tokenizer and anchors
|
|
266
|
+
|
|
267
|
+
- `Tokenizer is closed; call reset() before reusing.`
|
|
268
|
+
- `line N: line anchor "<digits>" is not a safe integer; line numbers must be positive safe integers no greater than 9007199254740991.`
|
|
269
|
+
- `line N: expected a line number such as "119", "112", "7"; got "<input>". Use [PATH#hash] from your latest read for file-version binding.`
|
|
270
|
+
- `Line N does not exist (file has M lines)`
|
|
271
|
+
- `Invalid line reference. Expected a bare line number from read/search output plus the section header content-hash tag (for example [src/foo.ts#1A2B] and line "160") Received "abc"..`
|
|
272
|
+
- `Line number must be >= 1, got 0 in "0".`
|
|
273
|
+
|
|
274
|
+
These two messages are retained by the low-level `parseTag` helper but currently have no caller in Atomic, so the `edit`
|
|
275
|
+
tool cannot emit them.
|
|
276
|
+
|
|
277
|
+
### Ranges, bodies, and hunk conflicts
|
|
278
|
+
|
|
279
|
+
- `line N: range A..B ends before it starts.`
|
|
280
|
+
- `line N: range A..B expands to K lines; numeric ranges are limited to 100,000 lines.`
|
|
281
|
+
- `line N: payload line has no preceding hunk header. Got "+<text>".`
|
|
282
|
+
- ``line N: payload line has no preceding hunk header. Use `replace N..M:`, `delete N..M`, or `insert before|after|head|tail:` above the body. Got "<text>".``
|
|
283
|
+
- ``line N: `-` rows are not valid; the range already names the lines being changed. For a literal `-` line, write `+-…`.``
|
|
284
|
+
- ``line N: `delete N..M` does not take body rows. Remove the body, or use `replace N..M:`.``
|
|
285
|
+
- ``line N: `delete block N` does not take body rows. Remove the body, or use `replace block N:`.``
|
|
286
|
+
- ``line N: `insert` needs at least one `+TEXT` body row.``
|
|
287
|
+
- ``line N: `replace block N:` needs at least one `+TEXT` body row. To delete a block, use `delete block N`.``
|
|
288
|
+
- `line N: anchor line A is already targeted by another hunk on line M. Issue ONE hunk per range; payload is only the final desired content, never a before/after pair.`
|
|
289
|
+
|
|
290
|
+
A concrete `replace N..M:` with no body is not an error: Atomic treats it as deletion. `messages.ts` retains the unused
|
|
291
|
+
`EMPTY_REPLACE` text `` `replace N..M:` needs at least one `+TEXT` body row. To delete lines, use `delete N..M`. ``, but
|
|
292
|
+
the current concrete-replace parser does not emit it.
|
|
293
|
+
|
|
294
|
+
### Contamination and malformed hunk headers
|
|
295
|
+
|
|
296
|
+
- ``unified-diff hunk header (`@@ -N,M +N,M @@`) is not valid in hashline. File sections start with `[path#HASH]`; use `replace`, `delete`, or `insert` ops.``
|
|
297
|
+
- ``line N: apply_patch sentinel "<preview>" is not valid in hashline. File sections start with `[path#HASH]` (no `Update File:` / `Add File:` keyword). Use `replace N..M:`, `delete N..M`, or `insert before|after|head|tail:` ops.``
|
|
298
|
+
- ``line N: unified-diff hunk header (`@@ -N,M +N,M @@`) is not valid in hashline. Use `replace N..M:`, `delete N..M`, or `insert before|after|head|tail:` ops.``
|
|
299
|
+
- ``line N: `@@`-bracketed hunk header "<preview>" is not valid in hashline. Drop the `@@ ... @@` brackets and write a verb header such as `replace N..M:`.``
|
|
300
|
+
- ``line N: `delete N..M` has no colon and no body. Remove the colon and body rows.``
|
|
301
|
+
- ``line N: hunk headers need a verb. Use `replace A..A:` to replace, or `delete A` to delete.``
|
|
302
|
+
- ``line N: bare range hunk header "A..B" is not valid. Hunk headers need a verb: write `replace A..B:` or `delete A..B`.``
|
|
303
|
+
|
|
304
|
+
### Block resolution and internal apply invariants
|
|
305
|
+
|
|
306
|
+
- With a resolver, replace/delete failure is
|
|
307
|
+
``line N: `replace block A:` could not resolve a syntactic block beginning on line A (unsupported language, blank/closer line, or parse error). Use `replace A..M:` with explicit lines.`` or
|
|
308
|
+
``line N: `delete block A` could not resolve a syntactic block beginning on line A (unsupported language, blank/closer line, or parse error). Use `delete A..M` with explicit lines.``
|
|
309
|
+
Numbered, `*`-marked context follows after a blank line when the anchor is in range.
|
|
310
|
+
- Without a resolver:
|
|
311
|
+
``line N: `replace block`/`delete block`/`insert after block` are not available here (no block resolver configured). Use a concrete line range.``
|
|
312
|
+
- ``internal error: unresolved `replace block` edit reached the applier (resolveBlockEdits was not run).``
|
|
313
|
+
|
|
314
|
+
`insert after block` resolution failure is a warning and lowering, not an error.
|
|
315
|
+
|
|
316
|
+
### Snapshot mismatch
|
|
317
|
+
|
|
318
|
+
An unknown or cross-session tag emits these two lines, followed by numbered anchor context when available:
|
|
319
|
+
|
|
320
|
+
```text
|
|
321
|
+
Edit rejected for <path>: hash #<expected tag> is not from this session.
|
|
322
|
+
The current file hashes to #<actual tag>. Re-read the file with `read` to copy a current [path#tag] header — never invent the tag and never reuse one from a prior session.
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
A recognized tag whose snapshot no longer matches and cannot be recovered emits:
|
|
326
|
+
|
|
327
|
+
```text
|
|
328
|
+
Edit rejected for <path>: file changed between read and edit.
|
|
329
|
+
Section is bound to #<expected tag>, but the current file hashes to #<actual tag>. If a prior edit in this session modified this file, copy the [path#newhash] header from that edit's response; otherwise re-read the file with `read` to refresh the tag before retrying.
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
When the path is absent in a low-level call, the literal ` for <path>` segment is omitted.
|
|
333
|
+
|
|
334
|
+
### No-op edits
|
|
335
|
+
|
|
336
|
+
A single-file or all-no-op call returns this text without writing on attempts one and two:
|
|
337
|
+
|
|
338
|
+
```text
|
|
339
|
+
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.
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
From attempt two onward it appends `No-op count for this identical payload: N.` on a new line. Attempt three throws the
|
|
343
|
+
same text prefixed with `STOP. `. A mixed multi-section call containing a no-op throws
|
|
344
|
+
`Hashline edit for <path> did not change the file.` The lower-level patcher can also emit
|
|
345
|
+
`Edits to <path> resulted in no changes being made.` during multi-section `apply` or `preflight`.
|
|
346
|
+
|
|
347
|
+
## Warnings
|
|
348
|
+
|
|
349
|
+
Warnings that have active emission sites are emitted verbatim beneath the refreshed section header:
|
|
350
|
+
|
|
351
|
+
- ``Auto-prefixed bare body row(s) with `+`. Body rows must be `+TEXT` literal lines.``
|
|
352
|
+
- `Literal +TEXT row resembles a valid hunk header; it was kept as literal payload text.`
|
|
353
|
+
- `Recovered from a stale file hash using a previous read snapshot (file changed externally between read and edit).`
|
|
354
|
+
- `Recovered from a stale file hash using an earlier in-session snapshot (a prior edit in this session advanced the hash).`
|
|
355
|
+
- `Recovered by replaying your edits onto the current file content (a prior in-session edit changed the lines you re-targeted with a stale hash). Verify the diff matches your intent.`
|
|
356
|
+
- ``Applied the `insert head:`/`insert tail:` edit despite a stale snapshot tag (file changed since your read) — head/tail position is content-independent. Re-read if the drift was unexpected.``
|
|
357
|
+
- `` `insert after block N:` anchors on a closing delimiter, so it was applied as plain `insert after N:`. Anchor on the line that OPENS the construct. ``
|
|
358
|
+
- `` `insert after block N:` could not resolve a syntactic block on line N, so it was applied as plain `insert after N:`. Verify the landing line; anchor on a line that OPENS a construct. ``
|
|
359
|
+
- `insert after N: body indented shallower than the anchor, so the landing moved past K closing line(s) to after line M. For the deeper position inside the block, re-issue with the body indented to match.`
|
|
360
|
+
The emitted phrase is `1 closing line` for one crossed line and `K closing lines` otherwise.
|
|
361
|
+
- ``insert after block N: body indented deeper than closing line A, so it was placed inside the block, after line M. `insert after block` lands AFTER the block at sibling depth — if inside was intended, use plain `insert after A:`.``
|
|
362
|
+
- `Auto-repaired a replacement boundary echo at line N: dropped A leading and B trailing payload line(s) already present outside the range. Issue the payload as the final desired content for the selected range only — never restate unchanged lines bordering the range.`
|
|
363
|
+
- `Auto-repaired a delimiter-balance mismatch in the replacement at line N: <repair action>. Issue the payload as the final desired content only — never restate or omit a closing bracket bordering the range.`
|
|
364
|
+
The repair action is one of `dropped K duplicated trailing payload line(s) already present below the range`,
|
|
365
|
+
`dropped K duplicated leading payload line(s) already present above the range`, or
|
|
366
|
+
`kept K structural closing line(s) the range deleted without restating`.
|
|
367
|
+
- `Applied N parallel edit calls as one snapshot-anchored batch.`
|
|
368
|
+
|
|
369
|
+
`messages.ts` also defines two coalescing-warning strings, although the current parser has no emission site for them and
|
|
370
|
+
rejects overlapping deletes instead:
|
|
371
|
+
|
|
372
|
+
- ``Two hunks targeted the same range; kept only the second. One `replace N..M:` hunk per range — the body is the final content, never old+new.``
|
|
373
|
+
- ``Dropped a bare hunk overlapped by the concrete hunk after it. One `replace N..M:` hunk per range — the body is the final content, never old+new.``
|
package/docs/tools.md
CHANGED
|
@@ -4,7 +4,7 @@ Atomic enables these coding tools in normal sessions by default: `read`, `write`
|
|
|
4
4
|
|
|
5
5
|
## Hashline editing anchors
|
|
6
6
|
|
|
7
|
-
`read`, `search`, `write`, and successful `edit` results for local text files emit an editable hashline header:
|
|
7
|
+
`read`, `search`, `write`, and successful `edit` results for local text files emit an editable, session-scoped hashline header:
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
10
|
[src/example.ts#A1B2]
|
|
@@ -12,7 +12,7 @@ Atomic enables these coding tools in normal sessions by default: `read`, `write`
|
|
|
12
12
|
2:console.log(value);
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Use that header and the original line numbers to edit the existing file:
|
|
16
16
|
|
|
17
17
|
```text
|
|
18
18
|
[src/example.ts#A1B2]
|
|
@@ -22,11 +22,7 @@ insert tail:
|
|
|
22
22
|
+// done
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Before writing, Atomic verifies the current file against the tagged snapshot. If the file drifted, `edit` first attempts a snapshot-based recovery for provably non-overlapping external changes and appends a warning when it preserves those changes; unknown tags, overlapping stale edits, and unrecoverable drift fail clearly with the current file hash (and anchor context for drifted files) and leave the file unchanged. Byte-identical no-op edits return a no-op warning without writing, and repeated identical no-ops escalate to an error to stop looped retries. Hashline snapshots are scoped to the active tool/session store, so tags emitted in another session or stale context do not authorize edits. One `edit` input may contain multiple `[PATH#TAG]` sections; Atomic preflights every section before writing, but this is preflight atomicity rather than transactional rollback, so a mid-batch filesystem write failure can leave earlier sections already written. Each successful `write` or `edit` returns a fresh tag for follow-up edits; hashline edit success output is compact and includes the refreshed header plus block-resolution/change metadata while the full diff remains in tool details. Plain `write` success output is likewise compact (`[path#TAG]` plus a byte-count summary), not a full reprint of the file. `write` strips copied hashline headers and `LINE:`/`*LINE:` display prefixes only when the pasted content matches a known current-store snapshot and notes when stripping occurred; complete copied output preserves whether that snapshot had a terminal newline. Literal or unknown hashline-looking content is preserved instead of being stripped.
|
|
28
|
-
|
|
29
|
-
Hashline anchors must be positive safe integers. Inclusive numeric ranges are limited to 100,000 lines before expansion. An explicit `+TEXT` row that looks like a valid hunk header remains literal and emits a warning. Across whole-file, truncated, and range/offset reads of LF or CRLF text, numbered hashline output treats a terminal newline as a separator rather than an additional synthetic row; genuine blank lines, including one immediately before that newline, remain visible. Truncation totals and continuation selectors count real lines. Files using bare CR line endings retain their existing compatibility behavior and are outside this newline guarantee.
|
|
25
|
+
Block operations resolve through Atomic's native Rust tree-sitter primitive, with the brace/indent heuristic only as a fallback when the native binding is unavailable. See the [`edit` hashline specification](/tools/edit) for every operation, verified tolerated input shape, output and recovery behavior, limits, worked examples, literal error messages, and warnings.
|
|
30
26
|
|
|
31
27
|
## `bash` and `bashInterceptor`
|
|
32
28
|
|
package/docs/tui.md
CHANGED
|
@@ -842,7 +842,7 @@ ctx.ui.setWorkingIndicator({ frames: [] });
|
|
|
842
842
|
ctx.ui.setWorkingIndicator();
|
|
843
843
|
```
|
|
844
844
|
|
|
845
|
-
This affects the normal Working indicator from accepted prompt submission through response streaming. Working appears immediately during attachment and other pre-stream startup, then continues without a visible gap when the agent turn begins. A no-turn result, prompt failure, or turn completion removes it. An accepted manual retry clears stale status from the prior prompt before showing new pre-stream activity. Factual automatic retry and fallback status takes precedence while that transition is active; ordinary Working resumes only when a later Working lifecycle actually starts. With no extension override, Atomic renders the exact one-cell `∀` immediately before one of its 453 original randomized whimsical working verbs, selected once per turn. Every agent and SDK turn starts at regular weight with a fresh lifecycle-relative 88ms cadence, then follows a ten-frame, theme-aware dark → accent → bright/bold → accent → dark luminance ramp without changing glyph or geometry. Optional theme tone overrides control any desired phases exactly, including terminal palette indices 0–255; Atomic derives omitted tones from selected-surface, `accent`, and `text` roles. Dark, light, custom, and dynamically reloaded themes therefore retain their own palette. Under `NO_COLOR`, the same cadence remains visible through regular/bold weight without foreground-color escapes. Turn completion and terminal cleanup stop the timer cleanly. Restoring Atomic's default after an extension override also restarts at the dark regular phase; custom extension frames and intervals remain unchanged and render verbatim. `ATOMIC_REDUCED_MOTION=1` shows a static regular accent `∀` without an animation timer. The icon and longest message fit standard and 64-column widths. Factual status copy takes precedence. Compaction and retry loaders keep their plain built-in styling. During successful post-tool autocompaction, Atomic temporarily replaces the Working indicator with the compaction loader and restores it before the same stream continues; no additional user input is required.
|
|
845
|
+
This affects the normal Working indicator from accepted prompt submission through response streaming. It appears in a standalone status row by default; custom editors may opt into placing it in their top border. Newlines and terminal control characters in extension-supplied messages or frames remain stored verbatim, and the standalone row preserves their ordinary multi-line rendering. Working appears immediately during attachment and other pre-stream startup, then continues without a visible gap when the agent turn begins. A no-turn result, prompt failure, or turn completion removes it. An accepted manual retry clears stale status from the prior prompt before showing new pre-stream activity. Factual automatic retry and fallback status takes precedence while that transition is active; ordinary Working resumes only when a later Working lifecycle actually starts. With no extension override, Atomic renders the exact one-cell `∀` immediately before one of its 453 original randomized whimsical working verbs, selected once per turn. Every agent and SDK turn starts at regular weight with a fresh lifecycle-relative 88ms cadence, then follows a ten-frame, theme-aware dark → accent → bright/bold → accent → dark luminance ramp without changing glyph or geometry. Optional theme tone overrides control any desired phases exactly, including terminal palette indices 0–255; Atomic derives omitted tones from selected-surface, `accent`, and `text` roles. Dark, light, custom, and dynamically reloaded themes therefore retain their own palette. Under `NO_COLOR`, the same cadence remains visible through regular/bold weight without foreground-color escapes. Turn completion and terminal cleanup stop the timer cleanly. Restoring Atomic's default after an extension override also restarts at the dark regular phase; custom extension frames and intervals remain unchanged and render verbatim. `ATOMIC_REDUCED_MOTION=1` shows a static regular accent `∀` without an animation timer. The icon and longest message fit standard and 64-column widths. Factual status copy takes precedence. Compaction and retry loaders keep their plain built-in styling. During successful post-tool autocompaction, Atomic temporarily replaces the Working indicator with the compaction loader and restores it before the same stream continues; no additional user input is required.
|
|
846
846
|
|
|
847
847
|
Post-tool autocompaction is more precisely delimited by its own event pair. Pi opens the follow-up turn while the compaction is still unmatched, so the compaction status — not a generic Working message — owns the status surface from `compaction_start` until `compaction_end`, and the interposed turn does not take it back early. The status paints as soon as the compaction starts rather than on the next animation frame, in the main chat and in an attached workflow-stage chat alike. Ordinary Working then resumes for the continuing stream on any successful mid-turn completion, including a compaction that found nothing to compact and therefore reports no result. A cancelled or failed compaction stops all activity instead. The main chat reports automatic cancellation; an attached workflow-stage chat clears the transient status because the abort event carries no error text. Failures retain their event-provided error text.
|
|
848
848
|
|
|
@@ -974,6 +974,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
974
974
|
|
|
975
975
|
- **Extend `CustomEditor`** (not base `Editor`) to get app keybindings (escape to abort, ctrl+d to exit, model switching, etc.)
|
|
976
976
|
- **Call `super.handleInput(data)`** for keys you don't handle
|
|
977
|
+
- **Working status**: editors keep the standalone working row by default. Pass `{ embedWorkingStatus: true }` as the fourth `CustomEditor` constructor argument to opt into the editor-border spinner.
|
|
977
978
|
- **Factory pattern**: `setEditorComponent` receives a factory function that gets `tui`, `theme`, and `keybindings`
|
|
978
979
|
- **Autocomplete limit**: custom editors installed through `setEditorComponent()` that expose `setAutocompleteMaxVisible()` inherit the active `autocompleteMaxVisible` setting
|
|
979
980
|
- **Pass `undefined`** to restore the default editor: `ctx.ui.setEditorComponent(undefined)`
|
package/docs/usage.md
CHANGED
|
@@ -34,7 +34,6 @@ While ordinary agent work is active, the exact one-cell `∀` remains visible an
|
|
|
34
34
|
| Shell command | `!command` runs and sends output to the model |
|
|
35
35
|
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
36
36
|
| External editor | CTRL+G opens `$VISUAL` or `$EDITOR` |
|
|
37
|
-
| Copy selection/message | Ctrl+X copies a retained fullscreen selection when `fullscreenCopyOnSelect` is disabled; otherwise it copies the last assistant message |
|
|
38
37
|
|
|
39
38
|
See [Keybindings](/keybindings) for all shortcuts and customization.
|
|
40
39
|
|
|
@@ -45,10 +44,9 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
45
44
|
| Command | Description |
|
|
46
45
|
|---------|-------------|
|
|
47
46
|
| `/login`, `/logout` | Manage OAuth or API-key credentials |
|
|
48
|
-
| `/model` | Switch models
|
|
49
|
-
| `/thinking` | Switch thinking level
|
|
47
|
+
| `/model` | Switch models and automatically save the startup default |
|
|
48
|
+
| `/thinking` | Switch thinking level and automatically save the startup default |
|
|
50
49
|
| `/scoped-models` | Enable/disable models for CTRL+P cycling |
|
|
51
|
-
| `/fast` | Configure fast mode for chat and workflow stages when supported OpenAI or GitHub Copilot models are available |
|
|
52
50
|
| `/workflow` | List/run workflows; manage runs (connect/inspect/pause/interrupt/quit/resume); reload workflow resources |
|
|
53
51
|
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
54
52
|
| `/resume` | Pick from previous sessions |
|
|
@@ -234,7 +232,7 @@ For raw credential exports, stdout is empty on every non-zero exit but one. Once
|
|
|
234
232
|
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](/rpc) |
|
|
235
233
|
| `--export <in> [out]` | Export a session to HTML |
|
|
236
234
|
|
|
237
|
-
Interactive sessions always use fullscreen: the transcript scrolls independently above a sticky dock containing the editor, status line, usage meter, extension widgets, and footer. Wheel and trackpad gestures go first to a focused workflow graph or stage chat overlay; events those overlays do not consume fall through to the alternate-screen viewport. Non-overlay focused components do not block pi-tui's mouse path, so transcript scrolling, scrollbar interaction, and drag selection still work. Selection copies automatically by default; disable `fullscreenCopyOnSelect` to
|
|
235
|
+
Interactive sessions always use fullscreen: the transcript scrolls independently above a sticky dock containing the editor, status line, usage meter, extension widgets, and footer. Wheel and trackpad gestures go first to a focused workflow graph or stage chat overlay; events those overlays do not consume fall through to the alternate-screen viewport. Non-overlay focused components do not block pi-tui's mouse path, so transcript scrolling, scrollbar interaction, and drag selection still work. Selection copies automatically by default; disable `fullscreenCopyOnSelect` to highlight text without copying. Ctrl+X closes workflow tool detail to the graph, clears a scoped-model selection, returns stage chat to its graph, or returns a workflow graph to main chat. It does not copy. `/copy` always copies the last assistant message. The `fullscreenExitOutput` setting controls what exiting prints: `"transcript"` (the default) paints the final transcript plus a session resume hint on the main screen, while `"resume-hint"` restores the previous screen and prints only the resume hint. See [Settings](/settings) and [Terminal setup](/terminal-setup).
|
|
238
236
|
|
|
239
237
|
In print mode, Atomic also reads piped stdin and merges it into the initial prompt:
|
|
240
238
|
|