@bastani/atomic 0.10.14 → 0.10.15-alpha.1
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 +17 -0
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
- package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +2 -2
- package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
- package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
- package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
- package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
- package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
- package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
- package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
- package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
- package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
- package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.code.js +1 -1
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +1 -1
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +1 -1
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/compaction/compactor.d.ts +0 -8
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +2 -2
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +1 -1
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +3 -3
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +2 -2
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +2 -2
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +1 -1
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +2 -2
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +2 -2
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +2 -2
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +1 -1
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +1 -1
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.d.ts +21 -1
- package/dist/index.js +2 -2
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/print-mode.js +1 -1
- package/dist/package-manager-cli.code.js +2 -2
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/utils/startup-database-spare.code.js +1 -1
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks/reference.md +182 -0
- package/docs/background-tasks.md +98 -405
- package/docs/build.md +67 -27
- package/docs/changelog.mdx +1 -1
- package/docs/codemode.md +108 -39
- package/docs/compaction/branch-summaries.md +54 -0
- package/docs/compaction/custom-compactors.md +161 -0
- package/docs/compaction/memory-compaction.md +77 -0
- package/docs/compaction/reference.md +86 -38
- package/docs/compaction.md +51 -252
- package/docs/computer-use.md +169 -321
- package/docs/containerization.md +71 -57
- package/docs/custom-provider/api-reference.md +119 -25
- package/docs/custom-provider/oauth.md +114 -132
- package/docs/custom-provider/override.md +37 -27
- package/docs/custom-provider/registration.md +107 -83
- package/docs/custom-provider/streaming.md +85 -71
- package/docs/custom-provider.md +85 -52
- package/docs/development.md +39 -29
- package/docs/docs.json +76 -63
- package/docs/environment-variables.md +94 -44
- package/docs/extensions/api-reference.md +86 -43
- package/docs/extensions/authoring.md +162 -154
- package/docs/extensions/events.md +80 -25
- package/docs/extensions/examples.md +90 -85
- package/docs/extensions/ui.md +206 -82
- package/docs/extensions.md +79 -108
- package/docs/getting-started/authentication.md +67 -36
- package/docs/getting-started/first-session.md +53 -43
- package/docs/getting-started/installation.md +116 -89
- package/docs/getting-started/project-instructions.md +48 -34
- package/docs/guides/configuration.md +82 -20
- package/docs/guides/non-interactive.md +66 -24
- package/docs/guides/resume-on-any-machine.md +135 -82
- package/docs/guides/team-setup.md +114 -105
- package/docs/guides.md +76 -32
- package/docs/herdr.md +15 -16
- package/docs/how-atomic-works.md +140 -0
- package/docs/index.md +58 -44
- package/docs/intercom/operations.md +141 -151
- package/docs/intercom/reference.md +85 -108
- package/docs/intercom.md +84 -145
- package/docs/json.md +120 -67
- package/docs/keybindings.md +85 -49
- package/docs/libraries/agent-core.md +137 -275
- package/docs/libraries/ai.md +100 -84
- package/docs/libraries/codemode.md +210 -300
- package/docs/libraries/schema.md +59 -53
- package/docs/libraries/storage-postgres.md +49 -35
- package/docs/libraries/telemetry.md +153 -354
- package/docs/libraries/tui.md +265 -393
- package/docs/libraries.md +42 -26
- package/docs/llama-cpp.md +171 -161
- package/docs/mcp-servers.md +90 -51
- package/docs/models/choose-a-model.md +188 -0
- package/docs/models/reference.md +74 -30
- package/docs/models.md +153 -88
- package/docs/orchestration/migrating-workflows.md +23 -16
- package/docs/orchestration/patterns.md +39 -44
- package/docs/orchestration.md +65 -26
- package/docs/packages/authoring.md +51 -29
- package/docs/packages/reference.md +42 -21
- package/docs/packages.md +69 -58
- package/docs/programmatic.md +118 -24
- package/docs/prompt-templates.md +84 -83
- package/docs/providers/reference.md +43 -48
- package/docs/providers.md +219 -451
- package/docs/quickstart.md +140 -120
- package/docs/reference/cli.md +135 -97
- package/docs/reference.md +20 -18
- package/docs/rpc/examples.md +76 -20
- package/docs/rpc/extension-ui.md +64 -38
- package/docs/rpc/protocol.md +361 -110
- package/docs/rpc.md +57 -17
- package/docs/sdk/reference.md +409 -534
- package/docs/sdk/storage.md +53 -13
- package/docs/sdk/structured-decisions.md +82 -56
- package/docs/sdk/web-server.md +57 -43
- package/docs/sdk.md +106 -84
- package/docs/security.md +42 -64
- package/docs/session-format.md +62 -38
- package/docs/sessions.md +99 -214
- package/docs/settings.md +165 -195
- package/docs/shell-aliases.md +9 -6
- package/docs/skills/authoring.md +69 -48
- package/docs/skills/reference.md +51 -20
- package/docs/skills.md +99 -148
- package/docs/slash-commands.md +129 -0
- package/docs/storage/custom-adapters.md +160 -85
- package/docs/storage/jsonl.md +81 -66
- package/docs/storage/postgres/pgbouncer.md +120 -126
- package/docs/storage/postgres/tuning.md +120 -143
- package/docs/storage/postgres.md +314 -330
- package/docs/storage/sqlite.md +71 -42
- package/docs/storage.md +298 -302
- package/docs/subagents/authoring.md +55 -38
- package/docs/subagents/reference.md +73 -33
- package/docs/subagents.md +119 -187
- package/docs/terminal-setup.md +50 -38
- package/docs/termux.md +67 -41
- package/docs/themes/reference.md +23 -19
- package/docs/themes.md +142 -127
- package/docs/tmux.md +47 -55
- package/docs/tools.md +147 -109
- package/docs/tui/reference.md +166 -214
- package/docs/tui.md +196 -341
- package/docs/usage.md +118 -138
- package/docs/verification.md +79 -51
- package/docs/web-access.md +121 -101
- package/docs/windows.md +26 -27
- package/docs/worktree-snapshots/reference.md +245 -0
- package/docs/worktree-snapshots.md +71 -259
- package/package.json +8 -8
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
- package/docs/guides/intercom.md +0 -32
- package/docs/guides/orchestration.md +0 -28
- package/docs/guides/subagents.md +0 -37
package/docs/windows.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Windows
|
|
3
|
-
sidebarTitle: "Windows"
|
|
4
|
-
description: "Install Atomic, configure Bash and PowerShell,
|
|
2
|
+
title: "Run Atomic on Windows"
|
|
3
|
+
sidebarTitle: "Run on Windows"
|
|
4
|
+
description: "Install Atomic on Windows, configure Bash and PowerShell, choose a terminal, and troubleshoot Windows or WSL."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Install with PowerShell
|
|
@@ -15,21 +15,21 @@ irm https://raw.githubusercontent.com/bastani-inc/atomic/main/install.ps1 | iex
|
|
|
15
15
|
To pin an exact release (`MAJOR.MINOR.PATCH` or `MAJOR.MINOR.PATCH-alpha.REVISION`):
|
|
16
16
|
|
|
17
17
|
```powershell
|
|
18
|
-
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/bastani-inc/atomic/main/install.ps1))) -Ref 0.
|
|
18
|
+
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/bastani-inc/atomic/main/install.ps1))) -Ref 0.10.14
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
By default, the installer verifies `SHA256SUMS`, stores versioned payloads under `%LOCALAPPDATA%\atomic`, and creates an ASCII-only `atomic.cmd` launcher plus an `atomic-current` junction in `%LOCALAPPDATA%\atomic\bin`. The relative shim supports Unicode install paths and custom bin directories.
|
|
22
22
|
|
|
23
|
-
Override defaults with `ATOMIC_INSTALL_DIR`, `ATOMIC_BIN_DIR` (defaults to `<ATOMIC_INSTALL_DIR>\bin`, so changing `ATOMIC_INSTALL_DIR` moves the default bin directory too), `ATOMIC_VERSION` (`-Ref` takes precedence
|
|
23
|
+
Override defaults with `ATOMIC_INSTALL_DIR`, `ATOMIC_BIN_DIR` (defaults to `<ATOMIC_INSTALL_DIR>\bin`, so changing `ATOMIC_INSTALL_DIR` moves the default bin directory too), `ATOMIC_VERSION` (`-Ref` takes precedence), or optional `GITHUB_TOKEN`/`GH_TOKEN` (used only if release resolution falls back to the GitHub API). See [Release archive](/getting-started/installation#release-archive) for cross-platform archive options and [Package managers](/getting-started/installation#package-managers) if you install with Node.js.
|
|
24
24
|
|
|
25
25
|
### Installer rules and edge cases
|
|
26
26
|
|
|
27
|
-
- **Reruns, repair, and locking:** Concurrent installer runs serialize on an exclusive lock file under `ATOMIC_INSTALL_DIR`.
|
|
28
|
-
- **PATH and `PATHEXT`:** The installer
|
|
29
|
-
- **Existing launchers and directories:** A same-stem launcher that `PATHEXT` resolves before `atomic.cmd
|
|
27
|
+
- **Reruns, repair, and locking:** Concurrent installer runs serialize on an exclusive lock file under `ATOMIC_INSTALL_DIR`. Rerunning skips the download when the requested release is healthy and restores a missing User PATH entry; pass `-Force` or set `ATOMIC_FORCE_INSTALL=1` to reinstall anyway. A missing or mismatched `atomic.cmd` shim, invalid junction, or payload missing required startup files triggers a repair install.
|
|
28
|
+
- **PATH and `PATHEXT`:** The installer updates User PATH and the current PowerShell process, then prompts you to open a new terminal when User PATH changed. A custom `ATOMIC_BIN_DIR` containing `;` cannot be one Windows PATH entry, so the installer leaves PATH untouched and prints a direct command for `atomic.cmd`. `PATHEXT` must include `.CMD` for bare `atomic` to resolve, or installation stops with an error.
|
|
29
|
+
- **Existing launchers and directories:** A same-stem launcher that `PATHEXT` resolves before `atomic.cmd` (such as a stale `atomic.exe`) stops installation before download until you remove it. An unexpected regular `current` entry under `ATOMIC_INSTALL_DIR`, or regular `atomic-current` entry under `ATOMIC_BIN_DIR`, is reported and left untouched.
|
|
30
30
|
- **Pinned versions:** `-Ref` is validated against `MAJOR.MINOR.PATCH` or `MAJOR.MINOR.PATCH-alpha.REVISION` and honored literally. If GitHub returns a different release tag, installation stops before download.
|
|
31
|
-
- **TLS 1.2 on legacy PowerShell 5.1:** Once downloaded, the script enables TLS 1.2 for its own GitHub requests and restores your previous
|
|
32
|
-
- **Output, Intercom upgrade, and cleanup:** Setting `NO_COLOR` to any value (even empty) switches installer output to plain text
|
|
31
|
+
- **TLS 1.2 on legacy PowerShell 5.1:** Once downloaded, the script enables TLS 1.2 for its own GitHub requests and restores your previous setting. If `irm` itself fails to reach GitHub on Windows PowerShell 5.1, enable TLS 1.2 in your shell before running the command.
|
|
32
|
+
- **Output, Intercom upgrade, and cleanup:** Setting `NO_COLOR` to any value (even empty) switches installer output to plain text (output is also plain under `CI` or redirected stdout). After installing, `install.ps1` runs `atomic intercom upgrade` to replace any older running Intercom broker and warns if that step fails ([Updating while Intercom is running](/getting-started/installation#updating-while-intercom-is-running)). Staging directories (`atomic-install-*`) are removed when installation finishes.
|
|
33
33
|
|
|
34
34
|
## Bash and PowerShell discovery
|
|
35
35
|
|
|
@@ -40,9 +40,9 @@ Atomic uses Bash for the `bash` tool and checks these locations in order:
|
|
|
40
40
|
3. Git Bash at `%ProgramFiles(x86)%\Git\bin\bash.exe`
|
|
41
41
|
4. `bash.exe` on `PATH` (Cygwin, MSYS2, or WSL)
|
|
42
42
|
|
|
43
|
-
Windows Store app aliases (such as those in `%LOCALAPPDATA%\Microsoft\WindowsApps`) are accepted wherever Atomic searches for a shell. Atomic checks only absolute directories on `PATH` in order, skips empty and relative
|
|
43
|
+
Windows Store app aliases (such as those in `%LOCALAPPDATA%\Microsoft\WindowsApps`) are accepted wherever Atomic searches for a shell. Atomic checks only absolute directories on `PATH` in order, skips empty and relative entries, never searches the current working directory first, and caches missing `PATH` lookups for 30 seconds.
|
|
44
44
|
|
|
45
|
-
For the `bash` tool on native Windows, [Git for Windows](https://git-scm.com/download/win)
|
|
45
|
+
For the `bash` tool on native Windows, install [Git for Windows](https://git-scm.com/download/win). Atomic rejects legacy WSL `%SystemRoot%\System32\bash.exe` in interactive and CLI sessions because Windows cannot reliably isolate legacy WSL child processes; run Atomic directly inside WSL when you want a WSL POSIX shell.
|
|
46
46
|
|
|
47
47
|
PowerShell discovery checks these locations in order:
|
|
48
48
|
|
|
@@ -51,11 +51,9 @@ PowerShell discovery checks these locations in order:
|
|
|
51
51
|
3. `powershell.exe` on `PATH`
|
|
52
52
|
4. `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe`
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Because Bash and PowerShell use incompatible syntax, putting PowerShell syntax in `shellCommandPrefix` breaks every model `bash` tool call, and putting Bash syntax breaks every `!` and `!!` command. Leave `shellCommandPrefix` unset on native Windows unless you intentionally disable one side (for example, by excluding `bash`). Inside WSL, both `bash` tool calls and `!`/`!!` run in Bash, so Bash syntax works for both. See [Shell aliases](/shell-aliases).
|
|
54
|
+
<Warning>
|
|
55
|
+
**Leave `shellCommandPrefix` unset on native Windows.** Atomic prepends `shellCommandPrefix` to **both** model `bash` tool calls (Bash) and interactive `!`/`!!` commands (PowerShell), so either Bash or PowerShell syntax breaks one side unless you disable the other. Inside WSL, both run in Bash. See [Shell aliases](/shell-aliases).
|
|
56
|
+
</Warning>
|
|
59
57
|
|
|
60
58
|
### Set a custom Bash path
|
|
61
59
|
|
|
@@ -67,7 +65,7 @@ Set `shellPath` in `~/.atomic/agent/settings.json` or a trusted project's `.atom
|
|
|
67
65
|
}
|
|
68
66
|
```
|
|
69
67
|
|
|
70
|
-
If `shellPath` is a bare executable name (with no `/`, `\`, or `:`), Atomic searches absolute `PATH` directories. Otherwise Atomic
|
|
68
|
+
If `shellPath` is a bare executable name (with no `/`, `\`, or `:`), Atomic searches absolute `PATH` directories. Otherwise Atomic expands a leading `~/` or `~\` to your home directory, checks the resolved path, and stops with `Custom shell path not found: ...` if it does not exist, rather than falling back to Git Bash.
|
|
71
69
|
|
|
72
70
|
POSIX-style paths copied from Git Bash, MSYS2, Cygwin, or WSL work anywhere Atomic resolves a file path. Atomic translates `/c/...`, `/cygdrive/c/...`, and `/mnt/c/...` (case-insensitive single drive letter) into `C:\...`, while leaving UNC/double-slash paths (`//...`) and paths already containing `\` untouched.
|
|
73
71
|
|
|
@@ -78,7 +76,7 @@ On native Windows, Atomic enables the `powershell` tool by default whenever `pws
|
|
|
78
76
|
- **Execution flags and encoding:** Atomic launches PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass` (using `-EncodedCommand` with UTF-16LE base64 in interactive and CLI sessions, or `-Command` in standalone SDK calls), sets UTF-8 console output, and wraps Windows PowerShell 5.1 (`powershell.exe`) calls so script errors exit with code `1`.
|
|
79
77
|
- **Environment and PTY control:** Both `ATOMIC_*` and legacy `PI_*` session environment variables are available inside PowerShell calls ([Environment variables](/environment-variables)). Setting `ATOMIC_NO_PTY=1` (legacy `PI_NO_PTY=1`, where `ATOMIC_NO_PTY=0` overrides `PI_NO_PTY=1`) disables PTY allocation for both `powershell` and `bash` tool calls.
|
|
80
78
|
- **Tool lists and output:** Add `powershell` to `defaultTools` in [Tool settings](/settings#tools) if you define a custom built-in tool allowlist. To disable all shell execution on native Windows, exclude both `bash` and `powershell` (`--exclude-tools bash,powershell`; see [No built-in sandbox](/security#no-built-in-sandbox)). PowerShell calls render with a `PS>` prompt, and truncated output spills to an `atomic-powershell-*` temporary file separate from Bash spill files.
|
|
81
|
-
- **SDK
|
|
79
|
+
- **Programmatic SDK usage:** For TypeScript SDK PowerShell tool factories and options, see [PowerShell tool behavior](/sdk/reference#powershell-tool-behavior).
|
|
82
80
|
|
|
83
81
|
## Choose a terminal
|
|
84
82
|
|
|
@@ -108,13 +106,12 @@ Atomic adjusts several default shortcuts on native Windows and WSL to avoid term
|
|
|
108
106
|
|
|
109
107
|
On native Windows outside VS Code's integrated terminal, pressing the unmodified secondary mouse button pastes clipboard text into the focused input. See [Keybindings](/keybindings) for the complete shortcut reference.
|
|
110
108
|
|
|
111
|
-
##
|
|
109
|
+
## Shutdown and process cleanup
|
|
112
110
|
|
|
113
|
-
- **Early startup typing:** On eligible interactive starts, Atomic opens the prompt editor right away so you can start typing while the session finishes loading. Submitting early shows the working indicator, and pressing `Escape` cancels a queued submission. If resource loading fails before a prompt sends, Atomic restores your draft without sending a model request; run `/reload` to retry. See [Startup typing](/usage#startup-typing).
|
|
114
111
|
- **Graceful shutdown:** Quitting Atomic gives the session up to 5 seconds to run `session_shutdown` handlers.
|
|
115
|
-
- **Console close and Windows sign-out:** Closing the console window
|
|
116
|
-
- **Shell process-tree cleanup:** Interactive and CLI `bash` and `powershell` tool calls are contained automatically by the session. Interactive `!` commands and standalone SDK
|
|
117
|
-
- **Node.js compile cache:** On Node.js, Atomic enables Node's persistent compile cache automatically and warms a cold default cache in a background helper during interactive runs. Set `NODE_COMPILE_CACHE` to use a custom directory
|
|
112
|
+
- **Console close and Windows sign-out:** Closing the console window and signing out, restarting, or shutting down Windows also run `session_shutdown` handlers with `fromSignal: true` for up to about 4 seconds before Windows terminates the process.
|
|
113
|
+
- **Shell process-tree cleanup:** Interactive and CLI `bash` and `powershell` tool calls are contained automatically by the session. Interactive `!` commands and standalone SDK shell calls start in their own Windows Job object, so pressing `Escape`, hitting a timeout, or aborting stops the shell and its child processes. Background processes that Git Bash detaches from the job outlive `bash` if left running when it exits. Set `ATOMIC_HOST_SPAWN=child-process` to disable native Job-object containment for `!` commands, helper processes, and standalone SDK tool calls and fall back to Node's `child_process` ([Environment variables](/environment-variables#diagnostics-and-performance)).
|
|
114
|
+
- **Node.js compile cache:** On Node.js, Atomic enables Node's persistent compile cache automatically and warms a cold default cache in a background helper during interactive runs. Set `NODE_COMPILE_CACHE` to use a custom directory or `NODE_DISABLE_COMPILE_CACHE=1` to disable it ([Environment variables](/environment-variables#diagnostics-and-performance)).
|
|
118
115
|
|
|
119
116
|
## Self-update on Windows
|
|
120
117
|
|
|
@@ -122,8 +119,6 @@ Run `atomic update` or `atomic update --self` to update Atomic (add `--force` to
|
|
|
122
119
|
|
|
123
120
|
For writable global package-manager installs on Windows, Atomic handles loaded native add-ons during self-update so Windows file locks do not block replacement. For custom or wrapped installations, configure `selfUpdateCommand` in global settings or `ATOMIC_SELF_UPDATE_COMMAND` (see [Custom update command](/reference/cli#custom-update-command)).
|
|
124
121
|
|
|
125
|
-
If you upgrade an npm install from 0.10.4 or earlier while an older Intercom broker is running, `npm install -g @bastani/atomic` can fail with `EBUSY` because earlier brokers locked files inside the npm install directory. Close running Atomic sessions and wait 5 seconds (or run `atomic intercom restart`), then rerun the install. From 0.10.5 onward, the broker runs outside the install directory ([Updating while Intercom is running](/getting-started/installation#updating-while-intercom-is-running)).
|
|
126
|
-
|
|
127
122
|
If Atomic cannot safely self-update an installation, it exits with an explanation naming the detected executable path when available and tells you how to update. Release archive installs are not updated by `atomic update`; rerun `install.ps1` instead. Standalone Bun binaries point you to the latest [Atomic releases](https://github.com/bastani-inc/atomic/releases/latest).
|
|
128
123
|
|
|
129
124
|
## Headless skills and file watchers
|
|
@@ -133,10 +128,14 @@ If Atomic cannot safely self-update an installation, it exits with an explanatio
|
|
|
133
128
|
|
|
134
129
|
## Known issues
|
|
135
130
|
|
|
136
|
-
These issues come from older versions of Windows `conhost`:
|
|
131
|
+
These display and input issues come from older versions of Windows `conhost`:
|
|
137
132
|
|
|
138
133
|
| Issue | Affects | Remedy |
|
|
139
134
|
| --- | --- | --- |
|
|
140
135
|
| Opening the external editor (`Ctrl+G`) crashes the session ([microsoft/terminal#17515](https://github.com/microsoft/terminal/issues/17515)) | Built-in conhost | Use a terminal with a current conhost |
|
|
141
136
|
| Text such as `;0;rgb:0000/0000/0000` appears in the prompt, and BEL opens the external editor | Built-in conhost behind mintty or Windows OpenSSH | Use a terminal with a current conhost |
|
|
142
137
|
| Fragments such as `79` or `55` appear in the prompt | WezTerm 20240203 | Use WezTerm nightly |
|
|
138
|
+
|
|
139
|
+
<Note>
|
|
140
|
+
**Upgrading npm installs from Atomic 0.10.4 or earlier (`EBUSY`):** Earlier Intercom brokers locked files inside the global npm install directory, causing `npm install -g @bastani/atomic` to fail with `EBUSY`. Close running Atomic sessions and wait 5 seconds (or run `atomic intercom restart`), then rerun the install. From 0.10.5 onward, the broker runs outside the install directory ([Updating while Intercom is running](/getting-started/installation#updating-while-intercom-is-running)).
|
|
141
|
+
</Note>
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Worktree snapshots reference"
|
|
3
|
+
sidebarTitle: "Worktree snapshots"
|
|
4
|
+
description: "Reference for worktree snapshot records, 25-file environment fingerprint, pooling, leases, repository refs, garbage collection, SDK functions, and WorkspaceError classes."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This reference covers the internal mechanics, SDK APIs, and typed errors behind [Worktree snapshots](/worktree-snapshots). For cross-machine setup and environment blueprints, see [Resume sessions on any machine](/guides/resume-on-any-machine).
|
|
8
|
+
|
|
9
|
+
## Snapshot record and storage
|
|
10
|
+
|
|
11
|
+
Each `worktree_snapshot` session entry (see [WorktreeSnapshotEntry](/session-format#worktreesnapshotentry)) records a JSON `WorktreeSnapshot` object:
|
|
12
|
+
|
|
13
|
+
- `root`: absolute checkout path on the recording machine (informational).
|
|
14
|
+
- `remotes`: configured remote fetch URLs with embedded credentials stripped.
|
|
15
|
+
- `branch` and `head`: active branch name (or `null` when detached) and `HEAD` commit SHA.
|
|
16
|
+
- `snapshot` and `tree`: local snapshot commit SHA (parented on `head`) and Git tree SHA of the working copy, built through a private Git index under `~/.atomic/agent/worktree-snapshots/capture-index/` (safe to delete; rebuilt automatically on the next capture).
|
|
17
|
+
- `delta` and `chain`: binary patch chain starting from a full delta against `head` and continuing with incremental deltas against previous snapshots, restarting from `head` every `snapshots.fullEvery` snapshots (default `10`) or when `HEAD` changes.
|
|
18
|
+
- `bundle`: optional Git bundle of commits reachable from `head` and not reachable from any remote-tracking ref.
|
|
19
|
+
- `omitted`: structured list of paths or unpushed commits left out of the snapshot.
|
|
20
|
+
- `filters`: conversion settings on the recording host (`core.autocrlf`, `core.eol`, and `.gitattributes` filter drivers such as `lfs`).
|
|
21
|
+
- `envHash`: SHA-256 fingerprint of root-relative lockfiles and toolchain files.
|
|
22
|
+
|
|
23
|
+
Patches and bundles are stored once by SHA-256 content hash in the database's `snapshot_blobs` table. Payloads over 1 MiB split into rows of at most 1 MiB so every SQL backend supports files up to `snapshots.maxFileBytes` (default 5 MiB).
|
|
24
|
+
|
|
25
|
+
- **Unpushed-commit omission caching.** When unpushed commits are omitted because a commit touches a deny-listed secret or the bundle exceeds `snapshots.maxSnapshotBytes` (default 50 MiB), Atomic caches that omission in memory for the running process. It re-checks and re-bundles automatically if the unpushed commit set changes (including after a push or force push), a new Atomic process starts, the repository is repacked (`git gc` or `git repack`), Git packing or attributes settings change, or `snapshots.maxSnapshotBytes` is raised above the bundle size.
|
|
26
|
+
- **Blob-less stores and transient failures.** A new session in a store without blob tables (JSONL directory, memory, or custom store without `snapshotBlobs`) reports `blob-store-unsupported` once; a transient database failure reports `blob-store-failed` once without failing the turn.
|
|
27
|
+
|
|
28
|
+
### Omission reasons
|
|
29
|
+
|
|
30
|
+
Every entry in `snapshot.omitted` carries a typed `reason`:
|
|
31
|
+
|
|
32
|
+
| Reason | Extra fields | Meaning |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `denied` | `path` | Matched the built-in secret deny list (cannot be overridden) |
|
|
35
|
+
| `snapshot-ignore` | `path` | Matched `.atomic/snapshot-ignore` |
|
|
36
|
+
| `untracked-excluded` | `path` | Untracked file skipped because `snapshots.includeUntracked` is `false` |
|
|
37
|
+
| `nested-repository` | `path` (trailing `/`) | Untracked Git repository inside the checkout |
|
|
38
|
+
| `submodule-changes` | `path` | Submodule with uncommitted local changes |
|
|
39
|
+
| `unpushed-submodule-commit` | `path` | Submodule pointing to a commit not reachable from its remotes |
|
|
40
|
+
| `submodule-unchecked` | `path` | Submodule inspection failed or timed out after 10 seconds |
|
|
41
|
+
| `over-file-cap` | `path`, `bytes` | Single file exceeded `snapshots.maxFileBytes` |
|
|
42
|
+
| `over-snapshot-cap` | `path`, `bytes` | Adding the file would push the snapshot past `snapshots.maxSnapshotBytes` |
|
|
43
|
+
| `unpushed-history-denied` | `commits`, `paths` | Unpushed commits touched deny-listed paths, so the bundle was omitted |
|
|
44
|
+
| `bundle-over-cap` | `commits`, `bytes` | Unpushed-commit bundle exceeded `snapshots.maxSnapshotBytes` |
|
|
45
|
+
|
|
46
|
+
### Environment fingerprint {#environment-fingerprint}
|
|
47
|
+
|
|
48
|
+
`envHash` (`computeEnvironmentHash(root)`) computes a SHA-256 digest over `"atomic-env-v1\n"` followed by each present file's path and content hash from these **25** root-relative lockfiles and toolchain files (`ENVIRONMENT_INPUT_FILES`):
|
|
49
|
+
|
|
50
|
+
`.devcontainer.json`, `.devcontainer/Dockerfile`, `.devcontainer/devcontainer.json`, `.mise.toml`, `.node-version`, `.nvmrc`, `.python-version`, `.tool-versions`, `Cargo.lock`, `Gemfile.lock`, `Pipfile.lock`, `bun.lock`, `bun.lockb`, `composer.lock`, `flake.lock`, `go.sum`, `mise.toml`, `npm-shrinkwrap.json`, `package-lock.json`, `pnpm-lock.yaml`, `poetry.lock`, `rust-toolchain`, `rust-toolchain.toml`, `uv.lock`, and `yarn.lock`.
|
|
51
|
+
|
|
52
|
+
Files outside this list (such as `requirements.txt`, `build.gradle`, and `pom.xml`) are not included in `envHash`.
|
|
53
|
+
|
|
54
|
+
## Pooling, leases, and restore internals
|
|
55
|
+
|
|
56
|
+
Restored checkouts live at pooled paths under `~/.atomic/agent/worktree-snapshots/worktrees/<repository>-<n>`, with pool metadata in `~/.atomic/agent/worktree-snapshots/pool/` and shared per-repository Git object stores in `~/.atomic/agent/worktree-snapshots/repositories/`.
|
|
57
|
+
|
|
58
|
+
Only checkouts sharing the same repository remotes share a pool. Checkouts without remotes are never pooled (so ignored files such as `node_modules` or `.env` cannot cross between unrelated projects); they restore into fresh worktrees each time, and `atomic blueprint prebuild` refuses them.
|
|
59
|
+
|
|
60
|
+
### Worktree leases
|
|
61
|
+
|
|
62
|
+
An open session keeps its worktree reserved by refreshing its lease every 10 seconds:
|
|
63
|
+
|
|
64
|
+
- **Same host.** A worktree held by a live process is never reclaimed. Linux and Windows verify both PID and process start time so reused PIDs after a reboot do not block reuse; macOS falls back to a 24-hour cap without a refresh.
|
|
65
|
+
- **Other hosts sharing the pool.** If a process stalls or exits abnormally on another host, the worktree remains reserved for 90 seconds after the last refresh before another host can claim or remove it.
|
|
66
|
+
- **Lease verification.** Before saving a snapshot or continuing in a pooled worktree, Atomic verifies the session still holds the lease. If another session claimed it meanwhile, capture skips and warns with `pooled-worktree-lost`; stop editing there and run `/resume` to open a fresh worktree.
|
|
67
|
+
|
|
68
|
+
A worktree stays associated with the session it was restored for after the session closes so resuming it again continues in the same directory. If another session claims that idle worktree later, the original session gets a fresh worktree on its next resume.
|
|
69
|
+
|
|
70
|
+
### Idle reuse, eviction, and set-aside worktrees
|
|
71
|
+
|
|
72
|
+
- **Idle reuse.** Restore reuses an idle pooled worktree that still matches its last recorded snapshot with no extra untracked or excluded files, resetting tracked files while preserving ignored directories (`node_modules`, `target`, `.venv`) and preferring worktrees with a matching `envHash`. `/session snapshot` marks reused worktrees `(claimed)`.
|
|
73
|
+
- **Eviction.** When clean idle worktrees for a repository exceed `snapshots.pool.maxIdlePerRepository` (default `2`, `0` keeps none; invalid values silently fall back to `2` without throwing `WorkspaceConfigError`), Atomic deletes the oldest clean idle ones. Worktrees with unrecorded edits or excluded files (such as `.env`) are never evicted.
|
|
74
|
+
- **Set-aside worktrees.** If Atomic is killed (`SIGKILL`) mid-blueprint build, the next resume marks that worktree set-aside under `~/.atomic/agent/worktree-snapshots/pool/set-aside/` so no session reuses it while build processes might still be running (see [Start the first turn while the build runs](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)). On Linux (`/proc`) and macOS (`lsof`), Atomic deletes set-aside pooled worktrees automatically on a later restore once no process owned by the current user holds open files or a working directory inside them. If another user's or protected process blocks checking, on Windows (where open-file inspection conservatively assumes in-use, though job objects normally terminate child processes on exit), or for non-pooled worktrees, inspect open handles (`lsof +D <path>` on Unix) and remove the directory manually.
|
|
75
|
+
|
|
76
|
+
### Object stores, SSH, LFS, and interrupted restores
|
|
77
|
+
|
|
78
|
+
- **Shared object stores.** Missing commits fetch shallowly (`--depth=1`), falling back to a full fetch when needed; run `git fetch --unshallow origin` if you need full local history. Credential-free remotes are added as `origin`, `origin-2`, and so on, and pushed commits receive refs under `refs/remotes/atomic/pushed/` so later snapshots bundle only truly unpushed commits.
|
|
79
|
+
- **Non-interactive fetches.** Unless `GIT_SSH_COMMAND`, `GIT_SSH`, or `core.sshCommand` is configured, SSH runs with `BatchMode=yes` and a 15-second connect timeout. Unknown host keys or locked SSH keys fail fast with `commits-unavailable` (`reason: "not-fetched"`); run `git ls-remote <remote>` once interactively and resume again.
|
|
80
|
+
- **Git LFS concurrency.** Restores download missing LFS objects across recorded remotes without prompting. During a session resume, at most **2** LFS downloads run in parallel **per session resume** (`LFS_DOWNLOAD_CONCURRENCY = 2`, enforced in memory per resume rather than cross-process per host). A checkout's blueprint and first prompt (or first tool call under [`resume.waitForBlueprint: "tools"`](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)) wait until its download finishes, and a second resume waits up to 10 minutes for an in-flight download. Unavailable LFS objects stay as pointer files with an `lfs-objects-unavailable` warning; push them with `git lfs push --all <remote>` or `git lfs push --object-id <remote> <oid>` and resume again.
|
|
81
|
+
- **Interrupted restores.** Restores stage and verify worktrees before publishing them. If a process dies mid-restore, the next restore cleans up staging records under `~/.atomic/agent/worktree-snapshots/restores/` once their lock is 30 seconds stale without deleting files it did not create. Any retained leftover emits `stale-restore-retained` once with `kind` (`"worktree"`, `"record"`, or `"records-directory"`).
|
|
82
|
+
- **Security checks.** Before invoking Git, Atomic validates snapshot IDs, hashes, and remotes. Unsafe values (embedded credentials, leading `-`, control characters, or Git remote helpers such as `ext::`) fail with `invalid-snapshot`.
|
|
83
|
+
|
|
84
|
+
### Partial restore recovery {#partial-restore-recovery}
|
|
85
|
+
|
|
86
|
+
Only three errors refuse a session resume: an unreadable session, `invalid-snapshot`, or `unsafe-target`. Working directories reached through symlinks compare by their resolved physical path.
|
|
87
|
+
|
|
88
|
+
When an exact restore fails with a degradable error (`blob-missing`, `blob-corrupt`, `commits-unavailable`, `delta-failed`, or `tree-mismatch`), Atomic records `restore.degraded` (or `unrestored` if no commit is reachable) on the `worktree_snapshot` entry and pins the original snapshot ID in `degradedFrom` on subsequent captures in that worktree for up to 30 days.
|
|
89
|
+
|
|
90
|
+
On a later resume:
|
|
91
|
+
|
|
92
|
+
- **Full restore succeeds with local partial-restore edits.** Atomic applies the partial-restore edits on top as a single patch, records `restore.degradedWork` with `outcome: "applied"`, shows an info notice, and captures a fresh snapshot immediately, releasing the old target.
|
|
93
|
+
- **Carried-over edits conflict.** Atomic leaves the restored worktree at the original snapshot, saves the conflicting edits under `refs/atomic/degraded-work/<snapshot>`, records `restore.degradedWork` with `outcome: "kept"`, retains those blobs for 30 days (or until discarded), and prints a `git diff ... | git apply --3way` command.
|
|
94
|
+
- **Carried-over edits are unavailable.** If edits made in the partial worktree cannot be read on this machine (for example, unpushed commits made there), Atomic records `outcome: "unavailable"`, reports them, leaves them in the partial worktree, and clears the original target.
|
|
95
|
+
- **Full restore still fails.** Atomic restores the partial worktree's latest snapshot so new work stays intact, warns that the original is still unreachable, and keeps retrying.
|
|
96
|
+
|
|
97
|
+
After 30 days—or immediately when you call `discardDegradedRestore()`—the partial worktree's latest snapshot becomes the active restore target and `degradedFrom` clears on the next capture.
|
|
98
|
+
|
|
99
|
+
## Snapshot refs in your repository
|
|
100
|
+
|
|
101
|
+
Every snapshot is also written as a Git commit in the checkout's repository and kept reachable at `refs/atomic/snapshots/<session-id>/<checkout>` so `git gc` and `git maintenance` do not prune it, and resume recognizes your local checkout even after further edits.
|
|
102
|
+
|
|
103
|
+
- Each new snapshot advances the ref so at most one snapshot commit stays alive per session and checkout.
|
|
104
|
+
- Moving work to or from a restored worktree deletes the old ref once a snapshot is captured in the new location.
|
|
105
|
+
- Deleting a session through `/resume` or `SessionManager.deleteSession()` deletes its local refs along with refs of its non-running subagents.
|
|
106
|
+
|
|
107
|
+
If you import a copy of a session into another store on the same machine, both copies share the same session ID and ref; deleting one copy removes the local ref for both (no files are lost, though if `git gc` later prunes that commit and the checkout drifted, resume restores into a fresh worktree).
|
|
108
|
+
|
|
109
|
+
Snapshot refs sit outside `refs/heads` and `refs/tags`, so `git push`, `git push --all`, `git push --tags`, and snapshot bundles ignore them. Avoid `git push --mirror` if you do not want to push snapshot commits.
|
|
110
|
+
|
|
111
|
+
Exclude snapshot commits from `git log --all`:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
git log --exclude='refs/atomic/*' --all
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Remove leftover local refs (for example after deleting a session on another machine or via `SessionStore.delete()`):
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git for-each-ref --format='delete %(refname)' refs/atomic/snapshots/ | git update-ref --stdin
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Retention and garbage collection
|
|
124
|
+
|
|
125
|
+
Snapshot blobs live in one shared table per database and are garbage-collected automatically when no retained session references them:
|
|
126
|
+
|
|
127
|
+
- **Retained snapshots.** For every branch of every session (including internal subagent sessions), Atomic retains the latest snapshot of each checkout on that branch. Deleting a session releases its snapshots. A partly restored snapshot remains retained for up to 30 days. Unfinished workflow runs left from earlier releases retain their snapshots until removed.
|
|
128
|
+
- **Background schedule.** When `snapshots.autoCollect` is `true`, Atomic triggers collection in the background 10 seconds after an interactive or RPC session starts and 10 seconds after it closes, at most once per `snapshots.collectIntervalSeconds` per database (measured on the database clock). Collection sweeps in short batches so the UI stays responsive, aborts cleanly when the last store on the database closes, and resumes later if interrupted.
|
|
129
|
+
- **Grace window.** Blobs stored or reused within `snapshots.graceSeconds` (default 1 hour) are never deleted, protecting captures in progress. Reusing an earlier patch refreshes its age; if a blob is collected before its snapshot commits, Atomic retries storing it or reports `blobs-collected` without recording a broken snapshot. Raise `snapshots.graceSeconds` if `blobs-collected` repeats.
|
|
130
|
+
- **Failures and disk space.** Collection errors never fail an active session; they are recorded in the `snapshot_collection` table (`finished_at`, `deleted`, `error_code`) and retried after the configured interval. SQLite reuses freed pages internally without shrinking the file; run `VACUUM` while no Atomic process uses the database to reclaim disk space.
|
|
131
|
+
|
|
132
|
+
<Note>
|
|
133
|
+
**Older SQLite chunk-table migration (`pendingChunkMove`).** Earlier local SQLite databases stored snapshot chunks in an older table layout. When background collection skips the live table migration (for example because free disk space is low), `collectSnapshotGarbage()` reports `pendingChunkMove` so you can run the offline migration with `atomic storage move-snapshot-chunks`. Because SQLite's `ALTER TABLE RENAME` validates every view and trigger in the database, any broken custom view or trigger referencing renamed or missing tables causes the migration to fail with a hint naming the offending object—drop or fix it, then re-run. See [Moving snapshot data in an old SQLite file](/storage#moving-snapshot-data-in-an-old-sqlite-file).
|
|
134
|
+
</Note>
|
|
135
|
+
|
|
136
|
+
## SDK {#sdk}
|
|
137
|
+
|
|
138
|
+
Open a `SqliteDatabase` handle with `openNodeSqliteDatabase()` or `openPostgresDatabase()` (see [SDK session storage](/sdk/storage) and [SQLite storage](/storage/sqlite)), then open a `SqlSnapshotBlobStore` on that database:
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
import {
|
|
142
|
+
captureWorktreeSnapshot,
|
|
143
|
+
restoreWorktreeSnapshot,
|
|
144
|
+
verifyWorktree,
|
|
145
|
+
SqlSnapshotBlobStore,
|
|
146
|
+
type WorkspaceBinding,
|
|
147
|
+
} from "@bastani/atomic";
|
|
148
|
+
import { openNodeSqliteDatabase } from "@bastani/atomic/storage";
|
|
149
|
+
|
|
150
|
+
const database = await openNodeSqliteDatabase("./sessions.sqlite");
|
|
151
|
+
try {
|
|
152
|
+
// Pass the same table prefix as your sessions when using a prefix (positional string).
|
|
153
|
+
const blobs = await SqlSnapshotBlobStore.open(database, "project_");
|
|
154
|
+
const capture = await captureWorktreeSnapshot(process.cwd(), { blobs });
|
|
155
|
+
if (capture.status === "captured" || capture.status === "unchanged") {
|
|
156
|
+
const binding: WorkspaceBinding = capture.binding; // { remotes, head, tree, envHash }
|
|
157
|
+
const path = await restoreWorktreeSnapshot(capture.snapshot, { blobs });
|
|
158
|
+
await verifyWorktree(binding, path);
|
|
159
|
+
}
|
|
160
|
+
} finally {
|
|
161
|
+
await database.close();
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`SqlSnapshotBlobStore.open(database, prefix?)` takes `prefix` as an optional positional string (unlike `SqlSessionStore.open(database, { prefix })`, which takes an options object). `SqlSnapshotBlobStore` does not own `database` and has no `close()` method; close your caller-owned `database` in a `finally` block after snapshot operations and any running garbage collection finish.
|
|
166
|
+
|
|
167
|
+
In `createAgentSession({ snapshots })`, pass partial snapshot settings to override `settings.json` for one session.
|
|
168
|
+
|
|
169
|
+
### Capture, restore, and verification
|
|
170
|
+
|
|
171
|
+
- `captureWorktreeSnapshot(dir, { settings?, previous?, blobs?, signal? })`: resolves to `captured`, `unchanged`, `disabled`, or `unavailable` with a typed `GitUnavailableError` or `WorkspaceSnapshotError`.
|
|
172
|
+
- `restoreWorktreeSnapshot(bindingOrSnapshot, { into?, blobs?, snapshots?, storeDir?, onWarning?, deferLfs?, signal?, git? })`: resolves to the path of a new verified worktree (`into` must be new or empty). Checks the target and blobs before writing, cleans up on failure, emits `omitted-content`, `filters`, `lfs-objects-unavailable`, and `stale-restore-retained` warnings to `onWarning`, and optionally hands off exact-restore Git LFS pulls to `deferLfs(worktree, pull)`.
|
|
173
|
+
- `restoreWorktree(bindingOrSnapshot, options?)`: same as `restoreWorktreeSnapshot()`, resolving the full `RestoredWorktree` object (`{ path, snapshot, binding, warnings }`).
|
|
174
|
+
- `restoreDegradedWorktree(snapshot, failure, { blobs?, storeDir?, candidates?, onWarning?, signal?, git? })`: restores the closest reachable state after a degradable `WorkspaceRestoreError` accepted by `isDegradableRestoreFailure` (`blob-missing`, `blob-corrupt`, `commits-unavailable`, `delta-failed`, or `tree-mismatch`). Resolves `{ path, degraded, warnings }`.
|
|
175
|
+
- `restoreBestWorktree(snapshot, { blobs?, storeDir?, candidates?, signal?, git? })`: runs exact restore followed by degraded restore, resolving `{ status: "restored", path, warnings, degraded? }` or `{ status: "unrestored", reason }`. Rejects only on `invalid-snapshot`, `unsafe-target`, abort, or untyped errors. Pair with `unrestoredRecord(snapshot, reason, continuedIn, place)` to build a `WorktreeUnrestored` entry.
|
|
176
|
+
- `verifyWorktree(binding, dir, { settings?, signal? })`: resolves to the checkout's current binding when `HEAD` and tree match, or rejects with `WorkspaceDriftError`.
|
|
177
|
+
- `isHeadOnlyAdvance(driftError, signal?)`: resolves `true` when `WorkspaceDriftError` reflects only `HEAD` advancing over the same recorded tree.
|
|
178
|
+
- `bindingOf(snapshot)`: extracts `{ remotes, head, tree, envHash }` from a `WorktreeSnapshot`.
|
|
179
|
+
- `computeEnvironmentHash(root)` and `ENVIRONMENT_INPUT_FILES`: compute the 25-file `envHash` or inspect the input file list.
|
|
180
|
+
- `canonicalizeWorktreePath(path)` and `canonicalizeWorktreePathAsync(path)`: resolve symlinks in the existing portion of a path so paths compare consistently with snapshot roots.
|
|
181
|
+
- `defaultWorktreeSnapshotStoreDir(agentDir?)`: return the default host snapshot store directory (`<agentDir>/worktree-snapshots`).
|
|
182
|
+
- `removeRestoredWorktree(path, { storeDir?, onWarning?, signal? })`: remove a worktree created by Atomic restore (for rolling back multi-checkout restores); rejects any non-restored path with `unsafe-target`.
|
|
183
|
+
- `MemorySnapshotBlobStore`, `snapshotBlob(data)`, and `snapshotBlobHashes(snapshot)`: in-memory blob store (for tests or prebuild), content-hash blob helper, and blob-hash extraction.
|
|
184
|
+
- `resolveWorktreeSnapshotSettings(input, source, prefix, base?)`, `DEFAULT_WORKTREE_SNAPSHOT_SETTINGS`, `SNAPSHOT_DENY_PATTERNS`, `SNAPSHOT_KEY_FILE_PATTERNS`, `SNAPSHOT_IGNORE_FILE`, and `setWorktreeSnapshotGit(resolver)`: settings validation, policy constants, and custom Git executable resolution.
|
|
185
|
+
|
|
186
|
+
### Session resume and partial restores
|
|
187
|
+
|
|
188
|
+
- `openSessionInWorktree(sessionManager, { settings, storeDir?, signal?, beforeRecord?, pendingMappings?, keepInPlace?, cannotRestore?, fallbackCwd?, skipMissingRecords? })`: checks every recorded checkout and restores drifted or missing ones without running blueprints, resolving `{ sessionManager, notices, unrestored, missingRecords }`. `resumeSessionWorktree` performs the same restore without reopening the session. For standard SDK resume with blueprints, pass `sessionManager` directly to `createAgentSession({ sessionManager })` (see [Worktree snapshots in the SDK](/sdk#worktree-snapshots)).
|
|
189
|
+
- `discardDegradedRestore(sessionManager, { settings, root?, signal? })`: records each partly restored worktree (or only `root`) without `degradedFrom` so it becomes the active restore target and releases the original snapshot on the next collection.
|
|
190
|
+
- `degradedRestorePin(sessionManager, root)`: returns `{ snapshotId, since, base?, lapsed, work?, kept? }` for a checkout with an active partial-restore target, or `undefined` otherwise.
|
|
191
|
+
- `withWorktreeRestoreNotices(notices, work)` and `currentWorktreeRestoreNotices()`: scope `worktree_restore` system prompt notices across sessions opened inside `work`.
|
|
192
|
+
|
|
193
|
+
### Reading older snapshots on demand
|
|
194
|
+
|
|
195
|
+
Sessions opened at the default tail window load only the snapshot records needed for resume into memory. Use `sessionManager.readWorktreeSnapshotPages()` and `sessionManager.loadWorktreeSnapshotRecords()` (see [SessionManager API](/session-format#sessionmanager-api)) to inspect older snapshots on demand:
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
const session = await SessionManager.open(store, sessionId);
|
|
199
|
+
const held = session.getWorktreeSnapshotRecords();
|
|
200
|
+
const ids: string[] = [];
|
|
201
|
+
for await (const page of session.readWorktreeSnapshotPages({ branch: true })) {
|
|
202
|
+
for (const { entry } of page) ids.push(entry.snapshotId);
|
|
203
|
+
}
|
|
204
|
+
const records = await session.loadWorktreeSnapshotRecords(ids);
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Garbage collection
|
|
208
|
+
|
|
209
|
+
- `collectSnapshotGarbage(blobs, { graceSeconds?, signal? })`: deletes eligible unreferenced blobs from a `SqlSnapshotBlobStore` (default `graceSeconds` is `DEFAULT_BLOB_GRACE_SECONDS`, 1 hour) and resolves `{ deleted, pendingChunkMove? }`. Rejects non-SQL stores with `blob-store-unsupported`.
|
|
210
|
+
- `scheduleSnapshotCollection(blobs, settings, { onFailure?, delayMs? })`: starts background collection when `settings.autoCollect` is enabled and due (sessions pass `SNAPSHOT_COLLECTION_SESSION_DELAY_MS`, 10 seconds). Never rejects after validating settings; resolves with `collected`, `skipped`, `interrupted`, or `failed`, and does not keep an idle process alive.
|
|
211
|
+
- `runningSnapshotCollection(blobs)`: returns a promise settling when the current process's active collection finishes, or `undefined` if none is running.
|
|
212
|
+
|
|
213
|
+
## Errors {#errors}
|
|
214
|
+
|
|
215
|
+
Every workspace error except `GitUnavailableError` extends `WorkspaceError`. Each error carries a stable `code`, JSON-safe `fields`, a `hint`, a `summary`, and `retryable`.
|
|
216
|
+
|
|
217
|
+
- Among snapshot and restore errors below, `WorkspaceCollectionError` sets `retryable: true`; `WorkspaceConfigError`, `WorkspaceGitError`, `WorkspaceSnapshotError`, `WorkspaceRestoreError`, and `WorkspaceDriftError` set `retryable: false`.
|
|
218
|
+
- Across the broader `WorkspaceError` hierarchy (also used by workspace binding and pull-request publication), `WorkspaceTimeoutError` always sets `retryable: true`, and `WorkspaceBindingError` (on `writer-conflict`, `addition-in-progress`, clone/fetch/push Git failures, and retryable filesystem errnos) and `WorkspacePublicationError` (on `push-failed` and `gh-failed`) set `retryable: true` conditionally.
|
|
219
|
+
|
|
220
|
+
Always check `error.retryable` or `isRetryableWorkspaceError(error)` and branch on class or `code`, never on message text. Use `findWorkspaceError(error, guard)` to inspect cause chains up to 8 levels deep, and `serializeWorkspaceError` / `rehydrateWorkspaceError` to preserve typed errors across process boundaries.
|
|
221
|
+
|
|
222
|
+
| Class | Code | When | Fields | What to do |
|
|
223
|
+
| --- | --- | --- | --- | --- |
|
|
224
|
+
| `WorkspaceConfigError` | `invalid-setting` | A snapshot setting or SDK option has an invalid type or range | `source`, `field`, `expected` | Fix the named setting or option |
|
|
225
|
+
| `GitUnavailableError` | `not-installed`, `unsupported-platform`, `offline`, `checksum-mismatch`, `download-failed`, `install-failed` | Git could not be started or provisioned | `platform`, `arch`, `installDir`, `installCommand?`, `systemGit?` | Follow `hint` (install Git or put it on `PATH`) |
|
|
226
|
+
| `WorkspaceGitError` | `git-failed` | A Git command failed (`detail` holds its first error line) | `operation`, `cwd`, `exitCode`, `detail` | Check repository permissions, free disk space, and Git locks, then retry |
|
|
227
|
+
| `WorkspaceSnapshotError` | `not-a-repository` | The directory is outside any Git work tree | `subject` | Work inside a Git checkout |
|
|
228
|
+
| `WorkspaceSnapshotError` | `unborn-head` | The repository has no commits yet | `subject` | Create an initial commit |
|
|
229
|
+
| `WorkspaceSnapshotError` | `blob-store-unsupported` | The selected storage cannot hold snapshot blobs | `subject` | Use a SQLite or SQL database store (`--session-store` or `sessions.storage`) |
|
|
230
|
+
| `WorkspaceSnapshotError` | `blob-store-failed` | The session's storage was unreachable or rejected the snapshot payload | `subject`, `cause` | Restore storage access (`atomic storage status`); the next file-writing turn captures again |
|
|
231
|
+
| `WorkspaceSnapshotError` | `blobs-collected` | Collection deleted a capture's blobs before the snapshot recorded, and retrying failed | `subject` | Raise `snapshots.graceSeconds` |
|
|
232
|
+
| `WorkspaceSnapshotError` | `pooled-worktree-lost` | Another session took over the pooled worktree while this session was running | `subject` | Stop editing files there and run `/resume` to restore into a fresh worktree |
|
|
233
|
+
| `WorkspaceSnapshotError` | `unreadable-path` | A path needed by capture, restore, or verification cannot be read | `subject`, `cause` | Fix permissions or symlinks, or add the path to `.gitignore` or `.atomic/snapshot-ignore` |
|
|
234
|
+
| `WorkspaceRestoreError` | `snapshot-not-found` | A binding has no recorded snapshot and its tree is not on this host | `head`, `tree` | Pass the recorded snapshot or restore where the tree exists |
|
|
235
|
+
| `WorkspaceRestoreError` | `blob-missing` | A patch or bundle is missing from storage | `snapshotId`, `blob`, `role`, `deltaIndex` | Use the storage where the snapshot was recorded, or import a `.jsonl` export |
|
|
236
|
+
| `WorkspaceRestoreError` | `blob-corrupt` | A stored or imported blob fails its hash check | `snapshotId`, `blob`, `role` | Restore an earlier snapshot or re-export the session |
|
|
237
|
+
| `WorkspaceRestoreError` | `commits-unavailable` | `HEAD` cannot be fetched and no usable bundle exists | `head`, `commits`, `paths`, `remotes`, `reason` (`denied-history`, `bundle-over-cap`, `not-fetched`) | Push `head` to a recorded remote, raise `snapshots.maxSnapshotBytes` for `bundle-over-cap`, or verify remote access |
|
|
238
|
+
| `WorkspaceRestoreError` | `delta-failed` | A patch failed to produce its recorded tree | `snapshotId`, `deltaIndex`, `blob`, `expectedTree`, `actualTree` | Restore an earlier snapshot |
|
|
239
|
+
| `WorkspaceRestoreError` | `tree-mismatch` | The materialized worktree tree differs from the snapshot | `target`, `expectedTree`, `actualTree` | Check `.gitattributes` filters on this host, then retry |
|
|
240
|
+
| `WorkspaceRestoreError` | `unsafe-target` | `into` is non-empty (`not-empty`), or `removeRestoredWorktree` received a non-restored path (`not-restored`) | `target`, `reason` | Pass a new or empty directory, or omit `into` |
|
|
241
|
+
| `WorkspaceRestoreError` | `unwritable-path` | A restore or removal could not write a directory or file | `target`, `snapshotId`, `cause` | Free disk space or fix directory permissions, then retry |
|
|
242
|
+
| `WorkspaceRestoreError` | `path-too-long` | On Windows, a restored worktree path or Git directory exceeds Git for Windows path limits. Nothing is written. | `snapshotId`, `target`, `limit`, `agentDir` | Set `ATOMIC_CODING_AGENT_DIR` to a shorter path ([Long paths on Windows](/guides/resume-on-any-machine#long-paths-on-windows)) |
|
|
243
|
+
| `WorkspaceRestoreError` | `invalid-snapshot` | A snapshot record has unsafe remotes or malformed IDs or hashes | `snapshotId`, `field`, `reason` (`unsafe-remote`, `invalid-object-id`, `invalid-snapshot-id`, `invalid-blob-hash`) | Restore only trusted storage records or re-export on the recording machine |
|
|
244
|
+
| `WorkspaceDriftError` | `tree-drift` | A checkout drifted from its snapshot and could not be restored | `root`, `expectedHead`, `actualHead`, `expectedTree`, `actualTree`, `snapshotId`, `reason?`, `restoreCode?`, `cause?` | Follow `hint` |
|
|
245
|
+
| `WorkspaceCollectionError` | `collection-failed` | Database garbage collection failed (`retryable: true`; retained blobs are untouched) | `table`, `phase` (`claim`, `index`, `sweep`, `record`), `deleted`, `cause` | Check database permissions, disk space, and locks; if the hint names a broken view or trigger blocking an old SQLite chunk-table migration, fix or drop it and see [Moving snapshot data in an old SQLite file](/storage#moving-snapshot-data-in-an-old-sqlite-file) |
|