@bastani/atomic 0.10.10 → 0.10.11-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -0
- package/README.md +1 -1
- 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 +11 -13
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +9 -9
- package/dist/_shared/mode-shared-2QJSCUM6.js +55 -18
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-RRLVN7ER.js → sdk-IQMULKFU.js} +2962 -470
- package/dist/_shared/sdk-IQMULKFU.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +4 -4
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js +1 -1
- package/dist/_shared/{settings-startup-4QCVCI53.js → settings-startup-HXQLSUWM.js} +8 -2
- package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -0
- package/dist/_shared/{startup-0-0-4VG2G44V.js → startup-0-0-3IXNMFM2.js} +482 -53
- package/dist/_shared/startup-0-0-3IXNMFM2.js.map +1 -0
- package/dist/_shared/{startup-0-1-XTIL65D4.js → startup-0-1-7T2IAE7J.js} +121 -251
- package/dist/_shared/startup-0-1-7T2IAE7J.js.map +1 -0
- package/dist/_shared/{startup-0-2-27OWFHV6.js → startup-0-2-5QHPCEON.js} +293 -10
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -0
- package/dist/_shared/{startup-0-3-T4DVFYWX.js → startup-0-3-4ZYBYQNM.js} +273 -14
- package/dist/_shared/startup-0-3-4ZYBYQNM.js.map +1 -0
- package/dist/_shared/startup-0-4-ZMJV547D.js +6 -6
- package/dist/_shared/{startup-0-5-FD2P735I.js → startup-0-5-YDW47QX6.js} +29 -71
- package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -0
- package/dist/_shared/startup-10-0-TDQNBDDL.js +9 -9
- package/dist/_shared/startup-12-0-55AAXBJZ.js +4 -4
- package/dist/_shared/startup-14-0-MLX36RBG.js +6 -6
- package/dist/_shared/startup-15-0-YUKGAC63.js +34 -10
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +10 -9
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +421 -84
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-4KANEHRA.js → startup-8-1-X32CYSXB.js} +1291 -722
- package/dist/_shared/startup-8-1-X32CYSXB.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +17 -9
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +29 -0
- package/dist/builtin/intercom/broker/broker.bundle.mjs +1138 -384
- package/dist/builtin/intercom/broker/database-wake-up-bus.ts +103 -24
- package/dist/builtin/intercom/broker/multinode-router.ts +42 -21
- package/dist/builtin/intercom/broker/multinode-state-store.ts +22 -1
- package/dist/builtin/intercom/broker/open-broker-state.ts +82 -31
- package/dist/builtin/intercom/broker/paths.ts +8 -4
- package/dist/builtin/intercom/broker/released-asker-remote-replies.ts +18 -6
- package/dist/builtin/intercom/broker/sql-add-column.ts +4 -1
- package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +65 -44
- package/dist/builtin/intercom/broker/sql-held-send-store.ts +11 -3
- package/dist/builtin/intercom/broker/sql-known-session-store.ts +24 -12
- package/dist/builtin/intercom/broker/sql-lease-store.ts +386 -65
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +462 -130
- package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +20 -9
- package/dist/builtin/intercom/broker/sql-released-ask-store.ts +14 -6
- package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +27 -11
- package/dist/builtin/intercom/broker/sql-schema.ts +198 -5
- package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +97 -34
- package/dist/builtin/intercom/index.bundle.mjs +11 -8
- 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/CHANGELOG.md +18 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/skill-creator/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +62 -23
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +6 -6
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +4 -4
- 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.code.js +2 -2
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- 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 +3 -3
- 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 +3 -3
- 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/agent-session-methods.d.ts +3 -0
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/compaction/compactor.d.ts +2 -0
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.code.js +1 -1
- 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.code.js +2 -2
- 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.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +2 -2
- package/dist/core/extensions/runner-context.js +4 -4
- package/dist/core/extensions/runner-context.js.map +1 -1
- 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 +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-resolver-defaults.d.ts +3 -2
- package/dist/core/package-manager-storage-adapters.code.js +1 -1
- 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 +4 -5
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.d.ts +5 -2
- package/dist/core/session-manager-core.js +39 -23
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +3 -3
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-open-markers.js +3 -0
- package/dist/core/session-open-markers.js.map +1 -0
- package/dist/core/session-storage.code.js +1 -1
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/added-exports.d.ts +6 -0
- package/dist/core/storage/added-exports.js +19 -0
- package/dist/core/storage/added-exports.js.map +1 -0
- package/dist/core/storage/database.d.ts +53 -0
- package/dist/core/storage/database.js.map +1 -1
- package/dist/core/storage/fenced-paths.d.ts +47 -0
- package/dist/core/storage/fenced-paths.js +53 -0
- package/dist/core/storage/fenced-paths.js.map +1 -1
- package/dist/core/storage/file-identity.js +31 -2
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +4 -1
- package/dist/core/storage/index.js +5 -2
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/migrations.d.ts +33 -2
- package/dist/core/storage/migrations.js +73 -5
- package/dist/core/storage/migrations.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +48 -6
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.js +137 -4
- package/dist/core/storage/node-sqlite.js.map +1 -1
- 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/prefix.d.ts +3 -2
- package/dist/core/storage/prefix.js +23 -2
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/schema-catalog.d.ts +120 -0
- package/dist/core/storage/schema-catalog.js +351 -0
- package/dist/core/storage/schema-catalog.js.map +1 -0
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +47 -25
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -1
- 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 +4 -4
- 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.code.js +1 -1
- 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/errors.js +1 -1
- package/dist/core/storage/session/expanded-child-details.code.js +4 -4
- 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-detach.d.ts +118 -0
- 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-schema.js +53 -0
- package/dist/core/storage/session/fork-schema.js.map +1 -0
- package/dist/core/storage/session/fork-segments.d.ts +58 -0
- package/dist/core/storage/session/fork-staging.code.js +176 -36
- package/dist/core/storage/session/fork-staging.code.js.map +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-sweep.js +61 -0
- package/dist/core/storage/session/fork-sweep.js.map +1 -0
- package/dist/core/storage/session/fork-window.code.js +4 -4
- 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.d.ts +37 -1
- 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 +3 -3
- 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 +3 -3
- 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.code.js +1 -1
- 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/session-search-index.d.ts +5 -0
- 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 +4 -4
- 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-chat-records.d.ts +15 -0
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +445 -11
- package/dist/core/storage/session/sql-session-store.impl.js +4 -4
- package/dist/core/storage/session/sql-session-store.js +4 -4
- 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.code.js +1 -1
- 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/session/types.d.ts +36 -0
- package/dist/core/storage/sqlite-facade.d.ts +54 -6
- package/dist/core/storage/sqlite-facade.js +384 -18
- package/dist/core/storage/sqlite-facade.js.map +1 -1
- package/dist/core/storage/statement-sequence.d.ts +83 -0
- package/dist/core/storage/statement-sequence.js +21 -0
- package/dist/core/storage/statement-sequence.js.map +1 -1
- package/dist/core/storage/storage-status.code.js +1 -1
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.code.js +1 -1
- 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.code.js +1 -1
- 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 +4 -4
- 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 +5 -5
- 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.code.js +1 -1
- 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/bash.d.ts +8 -4
- package/dist/core/tools/history-session.d.ts +7 -0
- package/dist/core/tools/history-tasks.d.ts +123 -0
- package/dist/core/tools/kill.d.ts +5 -2
- package/dist/core/tools/powershell.d.ts +2 -2
- package/dist/core/tools/read-url.code.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/tools/read.d.ts +12 -2
- package/dist/core/tools/resource-selectors.d.ts +2 -0
- package/dist/core/tools/search.d.ts +12 -2
- package/dist/core/worktree-snapshot/blob-store.d.ts +45 -2
- package/dist/core/worktree-snapshot/blob-store.js +228 -60
- package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
- package/dist/core/worktree-snapshot/errors.code.js +3 -3
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/fork-snapshot-index.js +121 -0
- package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -0
- 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.code.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.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +3 -3
- 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.js +8 -8
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/main.js +1 -1
- package/dist/modes/interactive/components/agent-panel.d.ts +1 -0
- package/dist/modes/interactive/components/stored-tree-view.code.js +3 -3
- 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/task-inspector.d.ts +2 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
- 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/interactive/interactive-mode-helpers.d.ts +2 -2
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/agent-panel-bridge.d.ts +5 -0
- package/dist/package-manager-cli.code.js +7 -7
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/0.js +1 -1
- package/dist/startup-stages/1.js +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/2.js +9 -1
- package/dist/startup-stages/3.js +1 -6
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +2 -2
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +123 -23
- package/docs/compaction.md +18 -0
- package/docs/docs.json +2 -0
- package/docs/environment-variables.md +1 -1
- package/docs/getting-started/installation.md +9 -2
- package/docs/guides/postgres-pgbouncer.md +346 -0
- package/docs/guides/postgres-tuning.md +311 -0
- package/docs/guides/resume-on-any-machine.md +2 -2
- package/docs/guides.md +2 -0
- package/docs/index.md +1 -1
- package/docs/libraries/agent-core.md +1 -1
- package/docs/libraries/ai.md +2 -2
- package/docs/libraries/codemode.md +1 -1
- package/docs/libraries/storage-libsql.md +6 -1
- package/docs/libraries/storage-postgres.md +11 -6
- package/docs/libraries/tui.md +1 -1
- package/docs/libraries.md +2 -2
- package/docs/programmatic.md +1 -1
- package/docs/quickstart.md +1 -1
- package/docs/sdk/storage.md +1 -1
- package/docs/sdk/web-server.md +1 -3
- package/docs/sdk.md +1 -7
- package/docs/sessions.md +67 -2
- package/docs/settings.md +20 -1
- package/docs/skills/authoring.md +1 -1
- package/docs/skills.md +79 -6
- package/docs/storage.md +305 -14
- package/docs/subagents/reference.md +2 -2
- package/docs/subagents.md +4 -3
- package/docs/tools.md +44 -10
- package/docs/windows.md +1 -1
- package/package.json +9 -9
- package/dist/_shared/sdk-RRLVN7ER.js.map +0 -1
- package/dist/_shared/settings-startup-4QCVCI53.js.map +0 -1
- package/dist/_shared/startup-0-0-4VG2G44V.js.map +0 -1
- package/dist/_shared/startup-0-1-XTIL65D4.js.map +0 -1
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +0 -1
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +0 -1
- package/dist/_shared/startup-0-5-FD2P735I.js.map +0 -1
- package/dist/_shared/startup-8-1-4KANEHRA.js.map +0 -1
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Tune PostgreSQL for many agents"
|
|
3
|
+
sidebarTitle: "Tune PostgreSQL"
|
|
4
|
+
description: "Server-side tuning for a PostgreSQL database shared by many Atomic agents: where the time goes, distance, connections, memory, monitoring, busy tables, and what to leave alone."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This guide is for the person who runs the PostgreSQL server that Atomic's agents share. It follows what we did on a production server and measured there. Use it after you set up the database as in [PostgreSQL storage](/storage#postgresql).
|
|
8
|
+
|
|
9
|
+
**The server we tuned:** PostgreSQL 18 on a machine with 8 CPU cores, 30 GB of memory and an NVMe disk. It served up to 200 agents about 80 ms away over the network. Each section says what we measured on that server, what is general advice, and what we have not tried on managed services such as Amazon RDS, Azure or Google Cloud SQL.
|
|
10
|
+
|
|
11
|
+
The table names below assume Atomic's default schema, `atomic`, and no `prefix`. With a prefix, each table name starts with it, for example `atomic.team_session_sessions`.
|
|
12
|
+
|
|
13
|
+
## Where the time goes
|
|
14
|
+
|
|
15
|
+
For Atomic, a database server is rarely short of CPU or disk. On our server the load average stayed below 1.7 while 200 agents worked, and every query that did real work took under 60 seconds in total over a 13-minute test. The limits are:
|
|
16
|
+
|
|
17
|
+
- **Round trips.** Each save waits for answers from the server. The farther away the server, the longer each wait.
|
|
18
|
+
- **Connections.** Each server has a fixed number. When agents need more than it has, they get errors.
|
|
19
|
+
- **Locks.** Agents that write the same data wait for each other. Before Atomic's own locking was fixed, waiting for locks was 99 to 100% of the time the server spent on Atomic's queries.
|
|
20
|
+
|
|
21
|
+
To tell which one you are hitting, run these as an administrator. Replace `atomic` with your database's name.
|
|
22
|
+
|
|
23
|
+
How many connections are in use, and what they are doing. `active` means running a query, and `idle` means open but unused:
|
|
24
|
+
|
|
25
|
+
```sql
|
|
26
|
+
SELECT state, count(*)
|
|
27
|
+
FROM pg_stat_activity
|
|
28
|
+
WHERE datname = 'atomic'
|
|
29
|
+
GROUP BY state
|
|
30
|
+
ORDER BY 2 DESC;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
What the busy connections are waiting for. A large count with `wait_event_type` `Lock` means lock waits. `Client` with `ClientRead` means the server waits for the agent, which usually means distance:
|
|
34
|
+
|
|
35
|
+
```sql
|
|
36
|
+
SELECT wait_event_type, wait_event, count(*)
|
|
37
|
+
FROM pg_stat_activity
|
|
38
|
+
WHERE datname = 'atomic' AND state <> 'idle'
|
|
39
|
+
GROUP BY 1, 2
|
|
40
|
+
ORDER BY 3 DESC;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
How close the server is to its connection limit:
|
|
44
|
+
|
|
45
|
+
```sql
|
|
46
|
+
SELECT count(*) AS used, current_setting('max_connections')::int AS max
|
|
47
|
+
FROM pg_stat_activity
|
|
48
|
+
WHERE backend_type = 'client backend';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
On the machine itself, `uptime` shows the load average. If it stays well below the number of CPU cores while agents are slow, the server is waiting, not working.
|
|
52
|
+
|
|
53
|
+
## Put the database close to the agents
|
|
54
|
+
|
|
55
|
+
Saving new entries to a session takes 1 round trip once you have run `atomic storage migrate` as the owner role, and 2 before. A round trip is the time a message takes to reach the server and come back, which `ping` shows. So every save takes at least that long:
|
|
56
|
+
|
|
57
|
+
| Distance to the server | One round trip | Each save, at least | Before `atomic storage migrate` |
|
|
58
|
+
| --- | --- | --- | --- |
|
|
59
|
+
| Same data center | about 1 ms | about 1 ms | about 2 ms |
|
|
60
|
+
| Same region, different zone | about 2 ms | about 2 ms | about 4 ms |
|
|
61
|
+
| Across a continent | about 80 ms | about 80 ms | about 160 ms |
|
|
62
|
+
|
|
63
|
+
We measured this on our server with 2 round trips per save. At 80 ms, a save took 164 to 166 ms in the middle of the range (p50) with 25 to 200 agents. At about 10 ms through PgBouncer, a save took 23 ms. Distance also makes every lock wait longer, because a transaction holds its locks for its round trips.
|
|
64
|
+
|
|
65
|
+
Run the server in the same region as the agents, and ideally the same zone. No server setting makes up for distance.
|
|
66
|
+
|
|
67
|
+
## Connections
|
|
68
|
+
|
|
69
|
+
Each Atomic process opens up to `maxConnections` plus `readerMaxConnections` connections to the server, 10 by default. An Intercom broker process opens one more, for wake-ups. [Count the connections Atomic needs](/storage#count-the-connections-atomic-needs) explains the arithmetic, and [Tuning for many concurrent agents](/storage#tuning-for-many-concurrent-agents) shows how to size `maxConnections`.
|
|
70
|
+
|
|
71
|
+
On the server:
|
|
72
|
+
|
|
73
|
+
- **`max_connections`** is the total the server accepts. Each connection uses memory for its own work, so the server cannot accept unlimited connections. On our server we raised it from 300 to 400, which needs a restart. That leaves room for PgBouncer's pool, one wake-up connection per broker, and administrators.
|
|
74
|
+
- **Per-role limits.** `ALTER ROLE atomic_runtime CONNECTION LIMIT 300;` caps one role, so a runaway fleet cannot take every slot. We raised Atomic's role from 150 to 300, because every broker holds a direct wake-up connection.
|
|
75
|
+
- **PgBouncer.** When agents need more connections than the server can give, put [PgBouncer](/guides/postgres-pgbouncer) in front. With 200 agents and a 300-connection server, we had to.
|
|
76
|
+
|
|
77
|
+
```sql
|
|
78
|
+
SHOW max_connections;
|
|
79
|
+
ALTER ROLE atomic_runtime CONNECTION LIMIT 300;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Memory
|
|
83
|
+
|
|
84
|
+
### Shared buffers
|
|
85
|
+
|
|
86
|
+
`shared_buffers` is the memory PostgreSQL keeps for table and index pages. A common starting point is a quarter of the machine's memory. Our server has 30 GB and uses `shared_buffers = 8GB`. Atomic's data was small enough that 99.999% of page reads came from memory, so a larger value would not have helped. Changing it needs a restart.
|
|
87
|
+
|
|
88
|
+
### Huge pages
|
|
89
|
+
|
|
90
|
+
The operating system tracks memory in pages, usually 4 KB each. Every server process that touches shared memory keeps its own table of those pages. With 8 GB of shared buffers and hundreds of connections, those tables alone can take gigabytes. Huge pages are 2 MB each on Linux, so the tables are 512 times smaller.
|
|
91
|
+
|
|
92
|
+
PostgreSQL uses huge pages when `huge_pages` is `try` (the default) or `on`, and the operating system has enough of them reserved. Our server had `huge_pages = try` but none reserved, so `huge_pages_status` was `off`. To fix that on Linux:
|
|
93
|
+
|
|
94
|
+
1. **Find out how many pages PostgreSQL needs.** Stop the server first: this setting can only be read while it is not running. Run, as the `postgres` user, with your data directory:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
postgres -D /var/lib/postgresql/18/main -C shared_memory_size_in_huge_pages
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
On Debian and Ubuntu, `postgres` is in `/usr/lib/postgresql/18/bin/`. Add `-c config_file=/etc/postgresql/18/main/postgresql.conf` so it reads your settings. On our server it printed `4259`.
|
|
101
|
+
|
|
102
|
+
2. **Reserve a little more than that**, rounded up, and keep it across reboots. We reserved 4350, which leaves about 180 MB spare:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
echo 'vm.nr_hugepages = 4350' | sudo tee /etc/sysctl.d/60-postgresql-hugepages.conf
|
|
106
|
+
sudo sysctl -p /etc/sysctl.d/60-postgresql-hugepages.conf
|
|
107
|
+
grep HugePages_Total /proc/meminfo
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
3. **Start the server and check** that it uses them:
|
|
111
|
+
|
|
112
|
+
```sql
|
|
113
|
+
SHOW huge_pages_status;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
It should say `on`. `huge_pages_status` exists in PostgreSQL 17 and later. On any version, `HugePages_Rsvd` in `/proc/meminfo` should be close to the number PostgreSQL needed.
|
|
117
|
+
|
|
118
|
+
Reserved huge pages are taken out of the memory other programs can use. On our server, available memory went from 30.0 GB to 21.7 GB, because 8.5 GB was now reserved as huge pages for PostgreSQL's shared memory. We did not measure how much page-table memory this saved. To undo it, set `vm.nr_hugepages` back to `0` after stopping the server.
|
|
119
|
+
|
|
120
|
+
Managed services decide huge pages for you. We have not checked how each one sets them.
|
|
121
|
+
|
|
122
|
+
## See what is slow
|
|
123
|
+
|
|
124
|
+
`pg_stat_statements` is an extension that records how often each query runs and how long it takes in total. It is the only way to see what hundreds of agents actually ask of the server.
|
|
125
|
+
|
|
126
|
+
1. **Load it at server start.** Add this line to `postgresql.conf`, or to a file in its `conf.d` directory, and restart:
|
|
127
|
+
|
|
128
|
+
```ini
|
|
129
|
+
shared_preload_libraries = 'pg_stat_statements'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
If the line already lists other libraries, add it to the list, separated by a comma.
|
|
133
|
+
|
|
134
|
+
2. **Create the extension** in Atomic's database, as a superuser. Atomic's owner role cannot: it gets `permission denied to create extension "pg_stat_statements"` with the hint `Must be superuser to create this extension`.
|
|
135
|
+
|
|
136
|
+
```sql
|
|
137
|
+
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
3. **Let your monitoring role see every query.** Without this, a role sees the text only of its own queries:
|
|
141
|
+
|
|
142
|
+
```sql
|
|
143
|
+
GRANT pg_read_all_stats TO atomic_owner;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Queries to run, all in the `atomic` database:
|
|
147
|
+
|
|
148
|
+
The queries that take the most total time. This is where to look first:
|
|
149
|
+
|
|
150
|
+
```sql
|
|
151
|
+
SELECT calls, round(total_exec_time) AS total_ms, round(mean_exec_time::numeric, 2) AS mean_ms,
|
|
152
|
+
left(query, 100) AS query
|
|
153
|
+
FROM pg_stat_statements
|
|
154
|
+
ORDER BY total_exec_time DESC
|
|
155
|
+
LIMIT 10;
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The slowest queries on average:
|
|
159
|
+
|
|
160
|
+
```sql
|
|
161
|
+
SELECT calls, round(mean_exec_time::numeric, 2) AS mean_ms, round(max_exec_time::numeric, 2) AS max_ms,
|
|
162
|
+
left(query, 100) AS query
|
|
163
|
+
FROM pg_stat_statements
|
|
164
|
+
WHERE calls > 50
|
|
165
|
+
ORDER BY mean_exec_time DESC
|
|
166
|
+
LIMIT 10;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
How much of the time is lock waits. Atomic takes its locks with `pg_advisory_xact_lock`, so a large share here means agents wait for each other, not for the server:
|
|
170
|
+
|
|
171
|
+
```sql
|
|
172
|
+
SELECT round((100 * sum(total_exec_time) FILTER (WHERE query LIKE '%pg_advisory%')
|
|
173
|
+
/ nullif(sum(total_exec_time), 0))::numeric, 1) AS lock_share_percent
|
|
174
|
+
FROM pg_stat_statements;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
To start a new measurement, clear the counters:
|
|
178
|
+
|
|
179
|
+
```sql
|
|
180
|
+
SELECT pg_stat_statements_reset();
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Busy small tables
|
|
184
|
+
|
|
185
|
+
A few of Atomic's tables are small but change constantly:
|
|
186
|
+
|
|
187
|
+
| Table | What changes it |
|
|
188
|
+
| --- | --- |
|
|
189
|
+
| `atomic.session_sessions` | One row per session, updated on every save |
|
|
190
|
+
| `atomic.intercom_leases` | Leases that Intercom brokers renew every few seconds |
|
|
191
|
+
| `atomic.snapshot_session_links` | Links between sessions and worktree snapshots, updated when sessions change |
|
|
192
|
+
|
|
193
|
+
### Clean them up sooner
|
|
194
|
+
|
|
195
|
+
PostgreSQL never changes a row in place. An update writes a new version of the row and leaves the old one behind as a dead row. A background process, autovacuum, later frees the dead rows. By default it waits until a fifth of a table is dead, which on a small table that changes constantly can mean many dead rows between cleanups, and queries that read past them.
|
|
196
|
+
|
|
197
|
+
Tell autovacuum to clean these tables after a fixed number of dead rows instead. This takes effect at once, with no restart. These are the settings we use:
|
|
198
|
+
|
|
199
|
+
```sql
|
|
200
|
+
ALTER TABLE atomic.session_sessions SET (
|
|
201
|
+
autovacuum_vacuum_scale_factor = 0, autovacuum_vacuum_threshold = 500,
|
|
202
|
+
autovacuum_analyze_scale_factor = 0, autovacuum_analyze_threshold = 500);
|
|
203
|
+
ALTER TABLE atomic.intercom_leases SET (
|
|
204
|
+
autovacuum_vacuum_scale_factor = 0, autovacuum_vacuum_threshold = 500,
|
|
205
|
+
autovacuum_analyze_scale_factor = 0, autovacuum_analyze_threshold = 500);
|
|
206
|
+
ALTER TABLE atomic.snapshot_session_links SET (
|
|
207
|
+
autovacuum_vacuum_scale_factor = 0, autovacuum_vacuum_threshold = 1000,
|
|
208
|
+
autovacuum_analyze_scale_factor = 0, autovacuum_analyze_threshold = 1000);
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
On our server, `snapshot_session_links` had 13,444 dead rows before the change. Autovacuum cleaned it 21 seconds later, leaving none. Check dead rows and the last cleanup with:
|
|
212
|
+
|
|
213
|
+
```sql
|
|
214
|
+
SELECT relname, n_live_tup, n_dead_tup, last_autovacuum
|
|
215
|
+
FROM pg_stat_user_tables
|
|
216
|
+
WHERE relname IN ('session_sessions', 'intercom_leases', 'snapshot_session_links');
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
To undo the settings, run `ALTER TABLE <table> RESET (autovacuum_vacuum_scale_factor, autovacuum_vacuum_threshold, autovacuum_analyze_scale_factor, autovacuum_analyze_threshold);`.
|
|
220
|
+
|
|
221
|
+
### Updates that stay on their page
|
|
222
|
+
|
|
223
|
+
When PostgreSQL writes a row's new version on the same page as the old one, and the update changes no indexed column, it can skip updating the table's indexes. This is called a HOT update, for heap-only tuple. It is faster and leaves less to clean up. It only works when the page has free space.
|
|
224
|
+
|
|
225
|
+
`fillfactor` leaves part of every page free for this. Atomic sets `fillfactor = 80` on `session_sessions` and `intercom_leases`, leaving a fifth of each page free, when you run `atomic storage migrate`. You do not set it yourself.
|
|
226
|
+
|
|
227
|
+
| Table | Share of updates that were HOT before | After `fillfactor = 80` | Where we measured |
|
|
228
|
+
| --- | --- | --- | --- |
|
|
229
|
+
| `session_sessions` | 92% | 94.5% | 300 sessions, in a test database |
|
|
230
|
+
| `intercom_leases` | 70 to 76% | about 90%, and the table half the size | 600 leases, in a test database |
|
|
231
|
+
| `session_sessions` | 71% on our server, misses on full pages | not yet measured there | production server |
|
|
232
|
+
|
|
233
|
+
`fillfactor` applies to pages written after the change. To rewrite existing pages, run `VACUUM FULL` on the table, which locks it while it runs, or use `pg_repack`. This is optional.
|
|
234
|
+
|
|
235
|
+
`snapshot_session_links` gets no HOT updates at all: 0 of 5,785 on our server. Its updates change a column that one of its indexes depends on, so free space does not help. The autovacuum settings above keep it small.
|
|
236
|
+
|
|
237
|
+
Check the share of HOT updates per table with:
|
|
238
|
+
|
|
239
|
+
```sql
|
|
240
|
+
SELECT relname, n_tup_upd, n_tup_hot_upd,
|
|
241
|
+
round(100.0 * n_tup_hot_upd / nullif(n_tup_upd, 0), 1) AS hot_percent
|
|
242
|
+
FROM pg_stat_user_tables
|
|
243
|
+
WHERE relname IN ('session_sessions', 'intercom_leases', 'snapshot_session_links');
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### The search index (optional)
|
|
247
|
+
|
|
248
|
+
Atomic indexes session text for search with a trigram index, `atomic.session_search_trgm`. This kind of index (GIN) collects new entries in a pending list and adds them to the index in one go when the list fills up. That flush happens inside one agent's save, so that save is slow now and then.
|
|
249
|
+
|
|
250
|
+
A smaller pending list makes the flushes smaller. In a benchmark of 460 inserts on PostgreSQL 16, run once per setting on a busy test machine, not on our server:
|
|
251
|
+
|
|
252
|
+
| Index setting | Insert p50 | Insert p99 | Slowest insert | Total insert time | Search |
|
|
253
|
+
| --- | --- | --- | --- | --- | --- |
|
|
254
|
+
| Default, 4 MB pending list | 1.96 ms | 22.9 ms | 26.5 ms | 1,122 ms | 0.83 ms |
|
|
255
|
+
| `gin_pending_list_limit = 1024` (1 MB) | 1.92 ms | 13.7 ms | 15.5 ms | 1,225 ms | 0.81 ms |
|
|
256
|
+
| `gin_pending_list_limit = 256` | 2.08 ms | 11.6 ms | 17.3 ms | 1,713 ms | 0.83 ms |
|
|
257
|
+
| `fastupdate = off` | 10.6 ms | 32.6 ms | 45.1 ms | 5,114 ms | 0.47 ms |
|
|
258
|
+
|
|
259
|
+
A 1 MB list halved the slowest inserts for 9% more total insert time. It does not make Atomic faster overall. If occasional slow saves matter to you, apply it:
|
|
260
|
+
|
|
261
|
+
```sql
|
|
262
|
+
ALTER INDEX atomic.session_search_trgm SET (gin_pending_list_limit = 1024);
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## What we checked and left alone
|
|
266
|
+
|
|
267
|
+
These settings come up in tuning advice. We measured each on our server and kept the default or the existing value:
|
|
268
|
+
|
|
269
|
+
- **`synchronous_commit = on`.** Turning it off makes commits return before they reach the disk, so a crash can lose the last commits. On our server's NVMe disk, writing the write-ahead log to disk (fsync) took 0.37 ms on average: 7,394 of them took 2.7 seconds in total. That is small next to a round trip, so there is nothing to gain.
|
|
270
|
+
- **`commit_delay`.** It makes commits wait a little so several can share one fsync. With 0.37 ms fsyncs, there is nothing to share.
|
|
271
|
+
- **`wal_compression`.** We kept `zstd`, which was already set. It makes the write-ahead log smaller at a small CPU cost, and the CPU was idle.
|
|
272
|
+
- **`io_method`.** PostgreSQL 18 can read from disk with `worker` (the default) or `io_uring`. With 99.999% of reads served from memory, the disk is rarely read, so we kept `worker`.
|
|
273
|
+
- **The search index's pending list.** See [The search index](#the-search-index-optional). It trades total insert time for fewer slow inserts, and does not raise throughput.
|
|
274
|
+
- **`deadlock_timeout`.** Atomic's lock waits are expected and end at its own lock timeout, so lowering it only adds work. Keep `log_lock_waits = on` to see long waits in the log.
|
|
275
|
+
|
|
276
|
+
We did not change `effective_cache_size`, `random_page_cost`, `max_wal_size` or `idle_in_transaction_session_timeout`. Their existing values worked.
|
|
277
|
+
|
|
278
|
+
## After you upgrade Atomic
|
|
279
|
+
|
|
280
|
+
After every Atomic upgrade, run `atomic storage migrate` once, as the owner role, before you start many agents:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
atomic storage migrate --db 'postgresql://atomic_owner@db.example.com:5432/atomic' --password-file ~/atomic-owner-password
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Why it matters for performance:
|
|
287
|
+
|
|
288
|
+
- **Fast starts.** An agent opens its storage quickly, in a few round trips and without taking locks, only when the database is already up to date. If it is not, each agent starts by checking and updating it, and many agents starting at once queue behind each other.
|
|
289
|
+
- **New steps.** `atomic storage migrate` also applies changes a runtime role without DDL rights cannot make: the sequence Intercom uses to order new leases, `fillfactor` on the busy tables, and the function that saves entries to a session in 1 round trip instead of 2. Until it runs, agents keep working, but without those gains. Agents find the function the next time they start.
|
|
290
|
+
|
|
291
|
+
## Checklist
|
|
292
|
+
|
|
293
|
+
| Step | Restart needed | Measured on our server |
|
|
294
|
+
| --- | --- | --- |
|
|
295
|
+
| Run the database in the same region as the agents | — | Yes: 2 round trips per save, 1 after `atomic storage migrate` |
|
|
296
|
+
| Size `max_connections` and per-role limits from the connection count, or put PgBouncer in front | `max_connections` only | Yes: raised 300 to 400, role 150 to 300 |
|
|
297
|
+
| Set `shared_buffers` to about a quarter of memory | Yes | Kept 8 GB of 30 GB |
|
|
298
|
+
| Reserve huge pages with `vm.nr_hugepages` and check `huge_pages_status` | Yes | Yes: `on`, 4259 pages needed, 4350 reserved |
|
|
299
|
+
| Preload `pg_stat_statements`, create it as a superuser, grant `pg_read_all_stats` | Yes | Yes |
|
|
300
|
+
| Set per-table autovacuum on `session_sessions`, `intercom_leases` and `snapshot_session_links` | No | Yes |
|
|
301
|
+
| Run `atomic storage migrate` after each Atomic upgrade | No | Yes |
|
|
302
|
+
| Optionally, shrink the search index's pending list | No | In a benchmark only |
|
|
303
|
+
| Leave `synchronous_commit`, `commit_delay`, `wal_compression` and `io_method` as they are | — | Yes |
|
|
304
|
+
|
|
305
|
+
On a managed service, the server settings above may be fixed or set through the service's own parameters. We have not tested this guide on Amazon RDS, Azure Database for PostgreSQL or Google Cloud SQL. The SQL statements work the same way there, except that creating `pg_stat_statements` needs the service's administrator role.
|
|
306
|
+
|
|
307
|
+
## Related pages
|
|
308
|
+
|
|
309
|
+
- [PostgreSQL storage](/storage#postgresql): set up the database and roles.
|
|
310
|
+
- [Tuning for many concurrent agents](/storage#tuning-for-many-concurrent-agents): size Atomic's connection settings.
|
|
311
|
+
- [Run many agents on PostgreSQL with PgBouncer](/guides/postgres-pgbouncer).
|
|
@@ -75,7 +75,7 @@ Both fresh and forked (`context: "fork"`) subagents store their sessions in the
|
|
|
75
75
|
|
|
76
76
|
When a background subagent resumes on another machine, Atomic maps its recorded directory through the parent session's restored checkouts, then prepares the subagent's own checkouts from its snapshots and builds their blueprints. Its file tools resolve old absolute paths into the restored worktrees.
|
|
77
77
|
|
|
78
|
-
Only subagents
|
|
78
|
+
Only subagents whose parent uses JSONL session files, and file-backed subagents from earlier releases, stay tied to the machine that launched them and report as unrestorable elsewhere.
|
|
79
79
|
|
|
80
80
|
## Set the environment up with a blueprint
|
|
81
81
|
|
|
@@ -95,7 +95,7 @@ initialize:
|
|
|
95
95
|
- name: Install Node.js
|
|
96
96
|
uses: github.com/actions/setup-node@v4
|
|
97
97
|
with:
|
|
98
|
-
node-version: "
|
|
98
|
+
node-version: "24"
|
|
99
99
|
- name: Install pnpm
|
|
100
100
|
run: npm install -g pnpm
|
|
101
101
|
maintenance:
|
package/docs/guides.md
CHANGED
|
@@ -25,6 +25,8 @@ New to Atomic? Follow the [Quickstart](/quickstart) to install, authenticate, ru
|
|
|
25
25
|
- **[Background tasks](/background-tasks).** Launch, inspect, steer, and stop background subagents and shells.
|
|
26
26
|
- **[Intercom](/guides/intercom).** Coordinate live sessions and subagents on one machine or across a shared database (see the full [Intercom guide](/intercom)).
|
|
27
27
|
- **[Team and CI setup](/guides/team-setup).** Share Intercom with a team through one database while sessions stay private, and configure CI runners from environment variables.
|
|
28
|
+
- **[PostgreSQL with PgBouncer](/guides/postgres-pgbouncer).** Run many agents on one PostgreSQL server by putting PgBouncer in front of it.
|
|
29
|
+
- **[Tune PostgreSQL](/guides/postgres-tuning).** Tune the PostgreSQL server that many agents share: distance, connections, memory, monitoring, and busy tables.
|
|
28
30
|
- **[Structured decisions](/sdk/structured-decisions).** Make typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
|
|
29
31
|
- **[Computer use](/computer-use).** Automate desktop apps, browsers, and terminals across macOS, Linux, and Windows.
|
|
30
32
|
- **[Verification](/verification).** Reproduce bugs and collect verifiable evidence across terminal, browser, and desktop environments.
|
package/docs/index.md
CHANGED
|
@@ -8,7 +8,7 @@ Atomic is a terminal coding agent with built-in file, shell, search, codemode, s
|
|
|
8
8
|
|
|
9
9
|
## Quick start
|
|
10
10
|
|
|
11
|
-
Install with a package manager (requires Node.js
|
|
11
|
+
Install with a package manager (requires [Node.js 24.20.0 or newer](/getting-started/installation#nodejs-version), or Bun 1.4.5+ for Bun installs):
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install -g @bastani/atomic
|
|
@@ -4,7 +4,7 @@ sidebarTitle: "@bastani/atomic-agent-core"
|
|
|
4
4
|
description: "Stateful agent loop with tool execution, event streaming, steering, and follow-up messages."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai) (requires Node.js
|
|
7
|
+
Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai) (requires Node.js 24.20+). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [TypeScript SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior. See [Standalone libraries](/libraries) for all standalone packages.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
package/docs/libraries/ai.md
CHANGED
|
@@ -4,7 +4,7 @@ sidebarTitle: "@bastani/atomic-ai"
|
|
|
4
4
|
description: "Unified LLM API for providers, models, auth, streaming, tool calling, images, classification, and thinking."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
`@bastani/atomic-ai` is the LLM library Atomic runs on (requires Node.js
|
|
7
|
+
`@bastani/atomic-ai` is the LLM library Atomic runs on (requires Node.js 24.20+). It ships in every Atomic release at Atomic's version, and you can install it independently (see [Installation](#installation)).
|
|
8
8
|
|
|
9
9
|
Inside an Atomic extension, import it without installing it because the host provides it. See [Standalone libraries](/libraries) for how the packages fit together and for legacy package names that still resolve inside Atomic.
|
|
10
10
|
|
|
@@ -56,7 +56,7 @@ Inside an Atomic extension, import it without installing it because the host pro
|
|
|
56
56
|
npm install @bastani/atomic-ai
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Requires Node.js
|
|
59
|
+
Requires Node.js 24.20 or newer.
|
|
60
60
|
|
|
61
61
|
Key root and subpath exports:
|
|
62
62
|
|
|
@@ -12,7 +12,7 @@ Runs model-written JavaScript in a QuickJS VM (compiled to WebAssembly) where th
|
|
|
12
12
|
npm install @bastani/atomic-codemode
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Requires Node.js
|
|
15
|
+
Requires Node.js 24.20+ (or Bun / Cloudflare Workers via the portable subpaths). Available package entry points:
|
|
16
16
|
|
|
17
17
|
- `@bastani/atomic-codemode`: `CodemodeSandbox`, `loadQuickJSWasm`, `parseCodemodeSource`, `renderDeclarations`, and worker runtime for Node and Bun.
|
|
18
18
|
- `@bastani/atomic-codemode/portable`: `RemoteCodemodeSandbox` and `InlineCodemodeSandbox` with zero Node.js imports.
|
|
@@ -6,7 +6,7 @@ description: "libSQL and Turso storage adapter for Atomic sessions and Intercom
|
|
|
6
6
|
|
|
7
7
|
`@bastani/atomic-storage-libsql` is Atomic's standalone libSQL and [Turso](https://turso.tech) storage adapter. It stores sessions and Intercom multi-node routing in a shared Turso database, self-hosted `sqld` server, or local libSQL file with one URL and one auth token. Unlike the six core libraries in [Standalone libraries](/libraries), this package is not bundled inside `@bastani/atomic`; install it only when you use libSQL or Turso.
|
|
8
8
|
|
|
9
|
-
- **Plain ESM with types:** Ships plain JavaScript ESM and TypeScript declarations (`libsql.d.ts`), requiring Node.js
|
|
9
|
+
- **Plain ESM with types:** Ships plain JavaScript ESM and TypeScript declarations (`libsql.d.ts`), requiring Node.js 24.20+ with no TypeScript loader.
|
|
10
10
|
- **Batched writes:** Sends statement batches to remote libSQL servers in a single request and redacts auth tokens and custom headers from error diagnostics.
|
|
11
11
|
|
|
12
12
|
For operator setup, see [Turso and libSQL](/storage#turso-and-libsql). For sharing Intercom across a team while keeping personal sessions local, see [Team and CI setup](/guides/team-setup). For all five SDK storage backends and `createAgentSessionRuntime()`, see [SDK storage backends](/sdk/storage).
|
|
@@ -58,6 +58,8 @@ Pass the returned `SqliteDatabase` to `createAgentSession({ sessionStore: { kind
|
|
|
58
58
|
| `authToken` | `string` | For remote databases | Database auth token. In CLI settings, pass through `secrets` (`{ "file": ... }` or `{ "env": ... }`) so it never lands in `settings.json`. |
|
|
59
59
|
| `namespace` | `string` | No | Self-hosted `sqld` namespace (`sqld --enable-namespaces`), sent as the `x-namespace` header. Requires a `libsql:`, `https:`, or `http:` URL. |
|
|
60
60
|
| `headers` | `Readonly<Record<string, string>>` | No | Extra request headers sent on every HTTP/libSQL request and redacted from diagnostics. Requires a `libsql:`, `https:`, or `http:` URL. |
|
|
61
|
+
| `keepAliveMs` | `number` | No | How long, in milliseconds, an unused HTTP connection stays open for reuse on `libsql:`, `https:` and `http:` URLs. A positive integer. Unset, Atomic closes an unused connection after about 4 seconds. Leave it unset for Turso, which closes unused connections after 5 seconds. Ignored for `ws:` and `wss:` URLs. |
|
|
62
|
+
| `concurrency` | `number` | No | On a libSQL server, the most reads one connection runs at the same time. A positive integer, default `20` (`DEFAULT_CONCURRENCY`). Writes still run one at a time. No effect on `file:` URLs. |
|
|
61
63
|
|
|
62
64
|
## Exported API
|
|
63
65
|
|
|
@@ -69,6 +71,9 @@ Pass the returned `SqliteDatabase` to `createAgentSession({ sessionStore: { kind
|
|
|
69
71
|
|
|
70
72
|
- **Local `file:` databases:** On first open, the adapter enables write-ahead logging (WAL, creating `-wal` and `-shm` sidecar files) with a 5-second busy timeout matching Atomic's built-in SQLite stores. Single statements, single-statement `exec`, batches, and transaction starts retry when another connection commits while waiting; multi-statement `exec` calls are not retried. Open a local file through only one SQLite library at a time so concurrent readers do not see stale WAL state.
|
|
71
73
|
- **Remote `sqld` servers:** When `sqld` hits a WAL checkpoint, it returns `SQLITE_BUSY` immediately without running the write. The adapter retries single statements, single-statement `exec`, batches, and transaction starts with jittered exponential backoff for up to 5 seconds within a 10-second wall-clock ceiling (one 5-second lock timeout plus one 5-second checkpoint window). For self-hosted `sqld`, start with `--checkpoint-interval-s 60` (or `SQLD_CHECKPOINT_INTERVAL_S=60`).
|
|
74
|
+
- **Server transactions:** A transaction sends its first reads with its `BEGIN` and its last writes with its `COMMIT`, so saving entries to a session takes 2 requests. The commit runs only if every write before it succeeded; otherwise nothing commits.
|
|
75
|
+
- **Readers:** `openReader()` returns a handle with its own client, for local files and servers. Its reads do not wait behind the main handle's calls. Closing the database closes its readers.
|
|
76
|
+
- **Throughput:** On a server, a connection runs up to `concurrency` reads at the same time. Writes run one at a time, in call order, and a libSQL database has one writer at a time. See [Tuning for many concurrent agents](/storage#tuning-libsql-and-turso).
|
|
72
77
|
|
|
73
78
|
## CLI configuration
|
|
74
79
|
|
|
@@ -7,7 +7,7 @@ description: "PostgreSQL storage adapter for Atomic sessions and Intercom multi-
|
|
|
7
7
|
`@bastani/atomic-storage-postgres` is Atomic's standalone [PostgreSQL](https://www.postgresql.org) storage adapter. It stores sessions and Intercom multi-node routing in one shared PostgreSQL database so multiple machines or SDK hosts can share state. Unlike the six core libraries in [Standalone libraries](/libraries), this package is not bundled inside `@bastani/atomic`; install it only when you use PostgreSQL.
|
|
8
8
|
|
|
9
9
|
- **PostgreSQL version requirement:** Atomic sessions require **PostgreSQL 16 or later** (for session JSON query functions). The adapter accepts **PostgreSQL 14 or later** on connect for non-session tables and rejects servers older than PostgreSQL 14.
|
|
10
|
-
- **Plain ESM with types:** Ships plain JavaScript ESM and TypeScript declarations (`postgres.d.ts`), requiring Node.js
|
|
10
|
+
- **Plain ESM with types:** Ships plain JavaScript ESM and TypeScript declarations (`postgres.d.ts`), requiring Node.js 24.20+ with no TypeScript loader.
|
|
11
11
|
|
|
12
12
|
For operator setup, role creation SQL, migrations, and troubleshooting, see [PostgreSQL setup](/storage#postgresql). For all five SDK storage backends and `createAgentSessionRuntime()`, see [SDK storage backends](/sdk/storage).
|
|
13
13
|
|
|
@@ -62,10 +62,15 @@ Pass the returned `SqliteDatabase` to `createAgentSession({ sessionStore: { kind
|
|
|
62
62
|
| Option | Type | Default | Description |
|
|
63
63
|
| --- | --- | --- | --- |
|
|
64
64
|
| `url` | `string` *(required)* | — | A `postgres://` or `postgresql://` URL with a username and no embedded password. Any password in the URL or a `password=` query parameter is rejected with `credential-in-url`. |
|
|
65
|
-
| `password` | `string \| (() => Promise<string>)` | — | Password string or async callback invoked for each new connection. Omit when using cloud `auth`; combining cloud `auth` with `password` throws `conflicting-token`. |
|
|
65
|
+
| `password` | `string \| (() => Promise<string>)` | — | Password string or async callback invoked for each new connection, and once when the database opens to tell its credential apart from other databases' in the shared pool. Omit when using cloud `auth`; combining cloud `auth` with `password` throws `conflicting-token`. |
|
|
66
66
|
| `auth` | `"password" \| "azure-entra" \| "aws-iam" \| "gcp-iam"` | `"password"` | Credential strategy. Cloud modes request short-lived tokens per new connection via the provider's SDK. |
|
|
67
|
-
| `maxConnections` | `number` | `8` (`DEFAULT_MAX_CONNECTIONS`) |
|
|
68
|
-
| `
|
|
67
|
+
| `maxConnections` | `number` | `8` (`DEFAULT_MAX_CONNECTIONS`) | Most connections the process's main pool opens. A positive integer. Every database the process opens with the same `url`, role, password, `listenUrl`, `auth`, `schema`, `proxy`, `socket` and pool options shares one main pool, one reader pool and one listening connection, and the last one to close closes them. For high throughput, set it as high as the server's `max_connections` allows. See [Tuning for many concurrent agents](/storage#tuning-for-many-concurrent-agents). |
|
|
68
|
+
| `readerMaxConnections` | `number` | `2` (`DEFAULT_READER_MAX_CONNECTIONS`) | Most connections in the reader pool that every handle `openReader()` returns shares, capped at `maxConnections`. A non-negative integer. `0` leaves `openReader` undefined, so reads share the main pool. |
|
|
69
|
+
| `statementTimeoutMs` | `number` | `30000` (`DEFAULT_STATEMENT_TIMEOUT_MS`) | How long one statement may run, in milliseconds, before the server cancels it. A positive integer. |
|
|
70
|
+
| `connectTimeoutMs` | `number` | `10000` (`DEFAULT_CONNECT_TIMEOUT_MS`) | How long opening a connection, or waiting for a free pooled one, may take, in milliseconds. A positive integer. |
|
|
71
|
+
| `idleTimeoutMs` | `number` | `300000` (`DEFAULT_IDLE_TIMEOUT_MS`) | How long a pool's last connection stays open after the pool's last call, in milliseconds. Connections opened for a burst close after `SURGE_IDLE_TIMEOUT_MS` (`10000`) idle, or after `idleTimeoutMs` when it is shorter. A positive integer. |
|
|
72
|
+
| `keepAliveIdleMs` | `number` | `60000` (`DEFAULT_KEEPALIVE_IDLE_MS`) | How long a pooled connection sits unused, in milliseconds, before TCP keepalive probes start. A positive integer. |
|
|
73
|
+
| `maxPreparedStatements` | `number` | `256` (`DEFAULT_MAX_PREPARED_STATEMENTS`); `0` when `listenUrl` is set or the URL's port is `6432` or `6543` | How many statements each pooled connection keeps prepared, so the server parses and plans each one once per connection. `0` turns them off, for example behind a pooler without prepared-statement support. |
|
|
69
74
|
| `listenUrl` | `string` | `url` | Direct session-mode endpoint for `LISTEN`/`NOTIFY` wake-ups when `url` goes through a transaction pooler. |
|
|
70
75
|
| `schema` | `string` | `"atomic"` (`DEFAULT_SCHEMA`) | Lowercase schema holding Atomic's tables. Existing databases with tables in `public` and no `atomic` schema keep using `public` until `atomic storage migrate` moves them. Every transaction sets `SET LOCAL search_path`. |
|
|
71
76
|
| `sdkSearchPaths` | `readonly string[]` | — | Extra npm prefix directories to search when loading a cloud IAM SDK not found beside the adapter. CLI adapter loading passes `<agentDir>/npm`. |
|
|
@@ -75,7 +80,7 @@ Pass the returned `SqliteDatabase` to `createAgentSession({ sessionStore: { kind
|
|
|
75
80
|
## Exported API
|
|
76
81
|
|
|
77
82
|
- `openPostgresDatabase(options: PostgresDatabaseOptions): Promise<SqliteDatabase>` — opens a pooled PostgreSQL-backed `SqliteDatabase`.
|
|
78
|
-
- `DEFAULT_MAX_CONNECTIONS` (`8`), `DEFAULT_STATEMENT_TIMEOUT_MS` (`30000`), `DEFAULT_SCHEMA` (`"atomic"`).
|
|
83
|
+
- `DEFAULT_MAX_CONNECTIONS` (`8`), `DEFAULT_READER_MAX_CONNECTIONS` (`2`), `DEFAULT_STATEMENT_TIMEOUT_MS` (`30000`), `DEFAULT_CONNECT_TIMEOUT_MS` (`10000`), `DEFAULT_IDLE_TIMEOUT_MS` (`300000`), `SURGE_IDLE_TIMEOUT_MS` (`10000`), `DEFAULT_KEEPALIVE_IDLE_MS` (`60000`), `DEFAULT_MAX_PREPARED_STATEMENTS` (`256`), `DEFAULT_SCHEMA` (`"atomic"`).
|
|
79
84
|
- `numberPlaceholders(sql: string): string` — rewrites positional `?` parameters outside string literals, quoted identifiers, and comments to `$1`, `$2`, ....
|
|
80
85
|
- `physicalIdentifiers(sql: string): string` — replaces unquoted identifiers longer than 63 bytes with their deterministic PostgreSQL physical identifier.
|
|
81
86
|
- Types: `PostgresDatabaseOptions`, `PostgresSocketFactory`, `ProxyTarget`.
|
|
@@ -97,7 +102,7 @@ For Azure Database for PostgreSQL Flexible Server (PostgreSQL 16+), Azure Horizo
|
|
|
97
102
|
|
|
98
103
|
- **TLS defaults:** When `url` omits `sslmode`, Atomic applies `sslmode=verify-full` for remote hosts (checking `PGHOST` if omitted from the URL). Add `sslrootcert=/path/to/ca.pem` for private CAs. Without `sslrootcert`, `require` verifies both certificate and hostname like `verify-full` (stricter than libpq). TLS parameter names are case-sensitive; unknown `sslmode` values are rejected.
|
|
99
104
|
- **HTTP `CONNECT` proxies:** Without `options.proxy`, remote TCP hosts check `HTTPS_PROXY` (`https_proxy`), then `ALL_PROXY` (when HTTP/HTTPS), then `HTTP_PROXY`, respecting `NO_PROXY`. Loopback hosts and Unix socket directories connect directly. Keep `sslmode=verify-full` (or `verify-ca` with a private CA) so TLS runs end to end through the tunnel.
|
|
100
|
-
- **Connection poolers and wake-ups:** Works with transaction-mode poolers (PgBouncer, Azure port `6432`, Supabase Supavisor, Neon `-pooler`) with no session-level state or
|
|
105
|
+
- **Connection poolers and wake-ups:** Works with transaction-mode poolers (PgBouncer, Azure port `6432`, Supabase Supavisor, Neon `-pooler`) with no session-level state. Prepared statements are off by default behind a pooler, when `listenUrl` is set or the port is `6432` or `6543`. On PgBouncer 1.21 and later with `max_prepared_statements` above `0`, the default from 1.24, set `maxPreparedStatements` to turn them on. A process that listens for wake-ups, as an Intercom broker does, opens one extra `LISTEN` connection outside its pools. When `url` uses a transaction pooler, set `listenUrl` to a direct endpoint, or Atomic falls back to polling. See the [PgBouncer guide](/guides/postgres-pgbouncer).
|
|
101
106
|
- **Retries and errors:** Connection drops, lock conflicts (`40001`, `40P01`, `55P03`), and canceled statements (`57014`) throw `StorageTransientError` (read-only and unwritten calls retry automatically). Invalid credentials (`28P01`), missing databases (`3D000`), and certificate errors fail immediately. Missing privileges (`42501`) fail immediately with `StorageConfigError` (`reason: "missing-privilege"`) naming the exact `GRANT` or migration command.
|
|
102
107
|
|
|
103
108
|
## CLI configuration
|
package/docs/libraries/tui.md
CHANGED
|
@@ -4,7 +4,7 @@ sidebarTitle: "@bastani/atomic-tui"
|
|
|
4
4
|
description: "Terminal UI framework with differential rendering, alternate-screen viewports, components, overlays, key handling, and images."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Minimal terminal UI framework with differential rendering and synchronized output for flicker-free interactive CLI applications (requires Node.js
|
|
7
|
+
Minimal terminal UI framework with differential rendering and synchronized output for flicker-free interactive CLI applications (requires Node.js 24.20+).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
package/docs/libraries.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Standalone libraries"
|
|
3
3
|
sidebarTitle: "All libraries"
|
|
4
|
-
description: "Explore Atomic's six core @bastani/atomic-* TypeScript libraries and two optional storage adapter packages for extensions, SDK apps, and standalone Node.js
|
|
4
|
+
description: "Explore Atomic's six core @bastani/atomic-* TypeScript libraries and two optional storage adapter packages for extensions, SDK apps, and standalone Node.js 24.20+ projects."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Atomic publishes six core TypeScript libraries and two optional storage adapter packages (all requiring Node.js
|
|
7
|
+
Atomic publishes six core TypeScript libraries and two optional storage adapter packages (all requiring Node.js 24.20 or newer). Each package publishes on npm at Atomic's version with every release and works independently outside Atomic.
|
|
8
8
|
|
|
9
9
|
## Core libraries
|
|
10
10
|
|
package/docs/programmatic.md
CHANGED
|
@@ -12,7 +12,7 @@ Atomic provides three programmatic integration modes plus a component API for in
|
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| Run one or more prompts and parse structured output as JSON lines | [JSON event stream](/json) | `atomic --mode json` |
|
|
14
14
|
| Drive a long-lived process with commands, interrupts, and extension UI prompts | [RPC mode](/rpc) | `atomic --mode rpc` |
|
|
15
|
-
| Embed Atomic directly inside a Node.js application (Node.js
|
|
15
|
+
| Embed Atomic directly inside a Node.js application (Node.js 24.20+) | [TypeScript SDK](/sdk) | `@bastani/atomic` |
|
|
16
16
|
|
|
17
17
|
- **JSON event stream** executes one or more positional prompts in sequence, writes newline-delimited session events to stdout, and exits.
|
|
18
18
|
- **RPC mode** keeps an Atomic subprocess running over stdin/stdout JSON Lines so you can send follow-up prompts, steer or abort turns, switch models, and answer extension dialogs and OAuth prompts.
|
package/docs/quickstart.md
CHANGED
|
@@ -17,7 +17,7 @@ Follow these four pages in order for full setup instructions, or use the quick c
|
|
|
17
17
|
|
|
18
18
|
## Prerequisites
|
|
19
19
|
|
|
20
|
-
- **Package install:** Node.js
|
|
20
|
+
- **Package install:** Node.js 24 LTS, version 24.20.0 or newer, with npm or pnpm, or Bun 1.4.5+ for Bun installs. Check with `node --version`; see [Node.js version](/getting-started/installation#nodejs-version) to upgrade.
|
|
21
21
|
- **Release archive install:** macOS and Linux need `tar` and either `curl` or `wget`; Windows uses built-in PowerShell commands. This path does not need Node.js or a package manager.
|
|
22
22
|
- **Model provider:** A supported subscription login (`/login`) or API key.
|
|
23
23
|
|
package/docs/sdk/storage.md
CHANGED
|
@@ -249,7 +249,7 @@ try {
|
|
|
249
249
|
}
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
See [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) for `maxConnections`, `statementTimeoutMs`, `listenUrl`, `schema`, `proxy`, `socket`, `sdkSearchPaths`, TLS, and cloud IAM role setup.
|
|
252
|
+
See [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) for `maxConnections`, `statementTimeoutMs`, `idleTimeoutMs`, `listenUrl`, `schema`, `proxy`, `socket`, `sdkSearchPaths`, TLS, and cloud IAM role setup.
|
|
253
253
|
|
|
254
254
|
**Option B — Adapter selection `{ kind: "adapter", module: POSTGRES_ADAPTER_PACKAGE, ... }`:**
|
|
255
255
|
|
package/docs/sdk/web-server.md
CHANGED
|
@@ -14,9 +14,7 @@ Read [TypeScript SDK](/sdk) first for `createAgentSession()`, `AgentSession`, `A
|
|
|
14
14
|
npm install @bastani/atomic
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Atomic requires Node.js
|
|
18
|
-
|
|
19
|
-
On Node 22, pass `--experimental-async-context-frame` on the server's `node` command line (not in `NODE_OPTIONS`) to avoid `AsyncLocalStorage` promise-hook overhead across concurrent HTTP requests; see [Node 22 hosts](/sdk#node-22-hosts).
|
|
17
|
+
Atomic requires Node.js 24.20 or newer. Dependency install scripts are not required; if your package manager blocks install scripts, leave them disabled.
|
|
20
18
|
|
|
21
19
|
## Keep Atomic out of the server bundle
|
|
22
20
|
|
package/docs/sdk.md
CHANGED
|
@@ -4,7 +4,7 @@ sidebarTitle: "SDK"
|
|
|
4
4
|
description: "Embed Atomic agent sessions in Node.js applications with programmatic control over models, tools, storage, and human input."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Embed Atomic in Node.js applications (Node.js
|
|
7
|
+
Embed Atomic in Node.js applications (Node.js 24.20 or newer) to build custom UIs, power backend services, or drive automated workflows directly inside your Node.js process. Working examples live in [examples/sdk/](https://github.com/bastani-inc/atomic/tree/main/packages/coding-agent/examples/sdk).
|
|
8
8
|
|
|
9
9
|
- **Full options and exports:** [SDK API reference](/sdk/reference) (includes [Owner-bound task supervisor](/sdk/reference#owner-bound-task-supervisor), [Supervised command SDK](/sdk/reference#supervised-command-sdk), and [Task transcript references](/sdk/reference#task-transcript-references)).
|
|
10
10
|
- **Typed decisions:** [Structured decisions API](/sdk/structured-decisions).
|
|
@@ -561,12 +561,6 @@ try {
|
|
|
561
561
|
- **`NativeModuleUnavailableError` is exported from `@bastani/atomic`** (`code: "NativeModuleUnavailable"`). `createAgentSession()` throws it when `@bastani/atomic-natives` cannot load or came from a different Atomic release.
|
|
562
562
|
- **`ShutdownFailed`, `HumanInputUnavailable`, `InvalidHostInput`, `BuiltinUnavailable`, and `SessionClosed` are NOT exported classes.** They are standard `Error` (or `AggregateError` for `ShutdownFailed`) instances tagged with string `.code` properties. Check `(error as { code?: string }).code === "HumanInputUnavailable"` (and `error instanceof AggregateError` for `ShutdownFailed`) rather than `instanceof`.
|
|
563
563
|
|
|
564
|
-
### Node 22 hosts
|
|
565
|
-
|
|
566
|
-
Atomic requires Node.js 22.19 or newer. On Node 22, `AsyncLocalStorage` uses promise hooks, which add small per-`await` overhead across the process once a session has run (Node 24 and Bun have no such overhead). Atomic stores all session context in one store so overhead stays flat regardless of active session count.
|
|
567
|
-
|
|
568
|
-
To switch Node 22 to Node 24's faster `AsyncLocalStorage` implementation, launch your host with `node --experimental-async-context-frame`. Pass the flag on your host command line, not in `NODE_OPTIONS` (Node 24+ rejects the flag, and tool subprocesses inherit `NODE_OPTIONS`). Verify that your own code does not depend on Node 22 `AsyncLocalStorage.disable()` behavior.
|
|
569
|
-
|
|
570
564
|
### Updating Atomic while your program runs
|
|
571
565
|
|
|
572
566
|
When `npm install`, `pnpm add`, or `bun add` replaces `@bastani/atomic` while a Node.js host is running, modules already loaded remain in memory while newly imported modules load from disk.
|