@bastani/atomic 0.10.11-alpha.1 → 0.10.11-alpha.3
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 +155 -0
- package/README.md +5 -8
- 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 +9 -9
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +8 -8
- package/dist/_shared/mode-shared-2QJSCUM6.js +9 -9
- package/dist/_shared/p0-cli-BB45ZQY6.js +46 -67
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +7 -8
- package/dist/_shared/p1a-prewarm-XIU57JHF.js.map +1 -1
- package/dist/_shared/{p1b-elig-ENCUPKKJ.js → p1b-elig-TVB5CBLL.js} +14 -2
- package/dist/_shared/{p1b-elig-ENCUPKKJ.js.map → p1b-elig-TVB5CBLL.js.map} +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-AVFII7NK.js → sdk-B5LEWGGI.js} +2633 -488
- package/dist/_shared/sdk-B5LEWGGI.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +3 -3
- 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-57KF6LZH.js → startup-0-0-EZUKEP4Q.js} +436 -51
- package/dist/_shared/startup-0-0-EZUKEP4Q.js.map +1 -0
- package/dist/_shared/{startup-0-1-GIY75K46.js → startup-0-1-RTOHJFDJ.js} +240 -279
- package/dist/_shared/startup-0-1-RTOHJFDJ.js.map +1 -0
- package/dist/_shared/{startup-0-2-27OWFHV6.js → startup-0-2-5QHPCEON.js} +254 -46
- 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 +14 -9
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
- package/dist/_shared/startup-0-5-YDW47QX6.js +10 -10
- package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +9 -9
- package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +6 -7
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +7 -7
- package/dist/_shared/startup-15-1-4S7FLMNG.js +22 -30
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +455 -102
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-X32CYSXB.js → startup-8-1-LZFXSD3Z.js} +162 -1184
- package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +189 -36
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/storage-status-K7PX2RXA.js +557 -0
- package/dist/_shared/storage-status-K7PX2RXA.js.map +1 -0
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +376 -0
- package/dist/_shared/team-DOQKICG2.js.map +1 -0
- package/dist/_shared/tree-outline-MUEPK5B7.js +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +34 -0
- package/dist/builtin/intercom/README.md +2 -2
- package/dist/builtin/intercom/broker/broker.bundle.mjs +1091 -344
- package/dist/builtin/intercom/broker/database-wake-up-bus.ts +243 -64
- package/dist/builtin/intercom/broker/multinode-router.ts +154 -22
- package/dist/builtin/intercom/broker/multinode-state-store.ts +30 -3
- package/dist/builtin/intercom/broker/open-broker-state.ts +14 -0
- package/dist/builtin/intercom/broker/sql-add-column.ts +29 -5
- package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +3 -2
- package/dist/builtin/intercom/broker/sql-held-send-store.ts +2 -2
- package/dist/builtin/intercom/broker/sql-known-session-store.ts +43 -19
- package/dist/builtin/intercom/broker/sql-lease-store.ts +208 -101
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +516 -102
- package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +8 -5
- package/dist/builtin/intercom/broker/sql-released-ask-store.ts +12 -5
- package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +24 -7
- package/dist/builtin/intercom/broker/sql-retention.ts +141 -0
- package/dist/builtin/intercom/broker/sql-schema.ts +199 -27
- package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +74 -19
- package/dist/builtin/intercom/broker/wake-up-bus.ts +6 -0
- package/dist/builtin/intercom/index.bundle.mjs +2 -3
- 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 +6 -0
- 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 +2 -10
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/bun/bundled-sqlite.js +41 -0
- package/dist/bun/bundled-sqlite.js.map +1 -0
- 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 +4 -4
- package/dist/cli/intercom-command.code.js.map +1 -1
- 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 +20 -114
- package/dist/cli/team-command.code.js.map +1 -1
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +5 -18
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-rehydrate-errors.d.ts +4 -9
- package/dist/core/compaction/compactor.d.ts +3 -3
- package/dist/core/debug.code.js +1 -1
- 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.code.js +1 -1
- 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 +1 -1
- package/dist/core/extensions/runner-context.js +3 -3
- package/dist/core/intercom-broker-control-host.code.js +2 -2
- 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/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/process-start-token.d.ts +8 -0
- package/dist/core/process-tree-containment.d.ts +16 -0
- package/dist/core/sdk-types.d.ts +1 -2
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.code.js +4 -4
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +27 -15
- 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/settings-schema.d.ts +0 -3
- package/dist/core/storage/added-exports-0-10-11.js +19 -0
- package/dist/core/storage/added-exports-0-10-11.js.map +1 -0
- package/dist/core/storage/added-exports.js +3 -0
- package/dist/core/storage/added-exports.js.map +1 -1
- package/dist/core/storage/creation-time.js +105 -0
- package/dist/core/storage/creation-time.js.map +1 -0
- package/dist/core/storage/database.d.ts +56 -5
- package/dist/core/storage/database.js.map +1 -1
- package/dist/core/storage/dialect.d.ts +1 -1
- package/dist/core/storage/dialect.js +1 -1
- package/dist/core/storage/dialect.js.map +1 -1
- package/dist/core/storage/errors.d.ts +13 -13
- package/dist/core/storage/errors.js +10 -16
- package/dist/core/storage/errors.js.map +1 -1
- package/dist/core/storage/fenced-paths.d.ts +11 -0
- package/dist/core/storage/fenced-paths.js +11 -0
- package/dist/core/storage/fenced-paths.js.map +1 -1
- package/dist/core/storage/file-identity.d.ts +2 -0
- package/dist/core/storage/file-identity.js +24 -8
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +4 -3
- package/dist/core/storage/index.js +5 -3
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/libsql-removed.d.ts +71 -0
- package/dist/core/storage/libsql-removed.js +123 -0
- package/dist/core/storage/libsql-removed.js.map +1 -0
- package/dist/core/storage/migrations.d.ts +81 -8
- package/dist/core/storage/migrations.js +386 -47
- package/dist/core/storage/migrations.js.map +1 -1
- package/dist/core/storage/node-sqlite-file-gate.js +0 -15
- package/dist/core/storage/node-sqlite-file-gate.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +36 -12
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.js +135 -3
- 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 +1 -1
- package/dist/core/storage/prefix.js +14 -2
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/process-selection.d.ts +5 -5
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/schema-catalog.d.ts +82 -5
- package/dist/core/storage/schema-catalog.js +244 -34
- package/dist/core/storage/schema-catalog.js.map +1 -1
- package/dist/core/storage/selection.d.ts +7 -82
- package/dist/core/storage/selection.js +20 -235
- package/dist/core/storage/selection.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.code.js +9 -8
- 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.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 +3 -3
- 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 +5 -8
- 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 +42 -2
- 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 +4 -4
- 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 +43 -4
- 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-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +394 -20
- 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.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/session/types.d.ts +22 -0
- package/dist/core/storage/sqlite-facade.d.ts +23 -2
- package/dist/core/storage/sqlite-facade.js +34 -0
- package/dist/core/storage/sqlite-facade.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.d.ts +26 -115
- 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 +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/history-session.d.ts +2 -0
- package/dist/core/tools/history-tasks.d.ts +3 -2
- package/dist/core/tools/read-url.code.js +4 -4
- 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.d.ts +71 -3
- package/dist/core/worktree-snapshot/blob-store.js +575 -67
- 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-blob-guard.js +81 -0
- package/dist/core/worktree-snapshot/fork-blob-guard.js.map +1 -0
- package/dist/core/worktree-snapshot/fork-snapshot-index.js +162 -0
- package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js +4 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -1
- 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 +2 -2
- 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.d.ts +3 -1
- 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/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/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/modes/interactive-engine/engine-prewarm.d.ts +1 -1
- package/dist/modes/print-mode.js +1 -1
- 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/10.js +1 -1
- package/dist/startup-stages/11.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/2.js +2 -3
- package/dist/startup-stages/3.js +1 -3
- package/dist/startup-stages/4.js +1 -2
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/6.js +5 -7
- package/dist/startup-stages/7.js +3 -6
- package/dist/startup-stages/8.js +7 -2
- package/dist/startup-stages/9.js +1 -7
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/compile-cache-deferral.js +8 -13
- package/dist/utils/compile-cache-deferral.js.map +1 -1
- package/dist/utils/compile-cache-warmup-host.js +3 -4
- package/dist/utils/compile-cache-warmup-host.js.map +1 -1
- package/dist/utils/compile-cache.js +12 -100
- package/dist/utils/compile-cache.js.map +1 -1
- 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/dist/utils/worker-threads.js +2 -15
- package/dist/utils/worker-threads.js.map +1 -1
- package/docs/build.md +3 -3
- package/docs/changelog.mdx +1421 -69
- package/docs/compaction/reference.md +5 -5
- package/docs/compaction.md +7 -9
- package/docs/containerization.md +2 -2
- package/docs/custom-provider/api-reference.md +1 -1
- package/docs/docs.json +37 -10
- package/docs/environment-variables.md +0 -2
- package/docs/extensions/api-reference.md +4 -4
- package/docs/getting-started/installation.md +3 -0
- package/docs/guides/configuration.md +1 -1
- package/docs/guides/non-interactive.md +1 -1
- package/docs/guides/resume-on-any-machine.md +14 -22
- package/docs/guides/team-setup.md +56 -83
- package/docs/guides.md +2 -4
- package/docs/herdr.md +1 -1
- package/docs/index.md +1 -1
- package/docs/intercom/operations.md +26 -21
- package/docs/intercom/reference.md +2 -2
- package/docs/intercom.md +1 -1
- package/docs/libraries/storage-postgres.md +9 -9
- package/docs/libraries.md +2 -3
- package/docs/models-configuration.md +2 -2
- package/docs/models.md +2 -3
- package/docs/packages/authoring.md +7 -7
- package/docs/packages.md +1 -1
- package/docs/programmatic.md +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/reference/cli.md +6 -11
- package/docs/reference.md +2 -2
- package/docs/rpc/extension-ui.md +2 -2
- package/docs/sdk/reference.md +5 -4
- package/docs/sdk/storage.md +8 -92
- package/docs/sdk/structured-decisions.md +1 -1
- package/docs/sdk/web-server.md +3 -3
- package/docs/sdk.md +14 -4
- package/docs/security.md +1 -1
- package/docs/session-format.md +5 -5
- package/docs/sessions.md +31 -42
- package/docs/settings.md +7 -8
- package/docs/storage/custom-adapters.md +255 -0
- package/docs/storage/jsonl.md +117 -0
- package/docs/{guides/postgres-pgbouncer.md → storage/postgres/pgbouncer.md} +73 -68
- package/docs/storage/postgres/tuning.md +337 -0
- package/docs/storage/postgres.md +556 -0
- package/docs/storage/sqlite.md +99 -0
- package/docs/storage.md +333 -956
- package/docs/subagents/authoring.md +1 -1
- package/docs/subagents.md +2 -2
- package/docs/tools.md +1 -1
- package/docs/worktree-snapshots.md +2 -2
- package/package.json +9 -9
- package/schemas/models.schema.json +2 -2
- package/schemas/settings.schema.json +0 -14
- package/dist/_shared/sdk-AVFII7NK.js.map +0 -1
- package/dist/_shared/settings-startup-4QCVCI53.js.map +0 -1
- package/dist/_shared/startup-0-0-57KF6LZH.js.map +0 -1
- package/dist/_shared/startup-0-1-GIY75K46.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-8-1-X32CYSXB.js.map +0 -1
- package/dist/core/intercom-broker-control.d.ts +0 -129
- package/dist/startup-stages/13.js +0 -1
- package/docs/guides/postgres-tuning.md +0 -311
- package/docs/libraries/storage-libsql.md +0 -97
package/docs/programmatic.md
CHANGED
|
@@ -21,7 +21,7 @@ Atomic provides three programmatic integration modes plus a component API for in
|
|
|
21
21
|
## SDK guides and APIs
|
|
22
22
|
|
|
23
23
|
- [SDK overview](/sdk): create sessions, bind workspaces, configure Intercom policies, and handle lifecycle events.
|
|
24
|
-
- [SDK storage backends](/sdk/storage): configure SQLite, JSONL, in-memory,
|
|
24
|
+
- [SDK storage backends](/sdk/storage): configure SQLite, JSONL, in-memory, and PostgreSQL for `createAgentSession()`, `createAgentSessionRuntime()`, and `SessionManager`.
|
|
25
25
|
- [Structured decisions API](/sdk/structured-decisions): run typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
|
|
26
26
|
- [Embed Atomic in a web server](/sdk/web-server): build a streaming HTTP API with Next.js App Router and `createAgentSession()`.
|
|
27
27
|
- [SDK API reference](/sdk/reference): complete session options, loaders, tool status, task supervision, run modes, and exports.
|
|
@@ -36,4 +36,4 @@ Atomic provides three programmatic integration modes plus a component API for in
|
|
|
36
36
|
## Terminal UI and standalone libraries
|
|
37
37
|
|
|
38
38
|
- [Build TUI components](/tui) walks through custom interactive components and common patterns, and [TUI API reference](/tui/reference) documents the component, focus, input, and rendering contracts.
|
|
39
|
-
- [Standalone libraries](/libraries) covers the six core `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`) plus the optional storage adapter packages ([`@bastani/atomic-storage-postgres`](/libraries/storage-postgres)
|
|
39
|
+
- [Standalone libraries](/libraries) covers the six core `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`) plus the optional storage adapter packages ([`@bastani/atomic-storage-postgres`](/libraries/storage-postgres)).
|
package/docs/quickstart.md
CHANGED
|
@@ -156,7 +156,7 @@ Piped stdin is separated from CLI prompt text by a newline. Use `--mode json` fo
|
|
|
156
156
|
|
|
157
157
|
- **[Interactive mode](/usage).** Learn slash commands, shortcuts, and message queueing.
|
|
158
158
|
- **[Sessions](/sessions) and [Worktree snapshots](/worktree-snapshots).** Branch conversations, restore repository checkouts, and [resume on any machine with blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint).
|
|
159
|
-
- **[Storage
|
|
159
|
+
- **[Storage](/storage).** Keep local SQLite or switch to shared PostgreSQL (or see [SDK storage backends](/sdk/storage) for embedded apps).
|
|
160
160
|
- **[Compaction](/compaction).** Manage long sessions and configure [custom remote compactors](/compaction#customize-morph-or-add-a-remote-compactor).
|
|
161
161
|
- **[MCP servers](/mcp-servers).** Connect external tools and data sources over Model Context Protocol.
|
|
162
162
|
- **[Subagents](/subagents), [Intercom](/intercom), and [Orchestration](/orchestration).** Delegate independent tasks, coordinate live sessions, and verify multi-step work.
|
package/docs/reference/cli.md
CHANGED
|
@@ -374,16 +374,13 @@ Passing `--help` or `-h` after `--` (for example `atomic mcp add srv -- cmd --he
|
|
|
374
374
|
|
|
375
375
|
```bash
|
|
376
376
|
atomic storage status [--json] # Selection, source, adapter, and connection per domain
|
|
377
|
-
atomic storage join <url> [--token-file <path>] [--prefix <prefix>] # Use a shared libSQL or Turso database
|
|
378
377
|
atomic storage join <postgres-url> --password-file <path>|--token-file <path>|--auth azure|aws|gcp [--prefix <prefix>] # Use a shared PostgreSQL database
|
|
379
378
|
atomic storage migrate [--db <url> [--password-file <path> | --token-file <path> | --auth azure|aws|gcp]] [--prefix <prefix>]
|
|
380
379
|
atomic storage move-snapshot-chunks <sqlite-file> [--prefix <prefix>]
|
|
381
380
|
atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]
|
|
382
381
|
atomic storage export <dir> [--sessions] [--limit <n>] [--since <time>] [--storage <json> | --storage-file <path>]
|
|
383
382
|
atomic storage import <dir> [--sessions] [--storage <json> | --storage-file <path>]
|
|
384
|
-
atomic team join <url> [--token-file <path>] [--prefix <prefix>] # Share Intercom (libSQL/Turso); sessions stay local
|
|
385
383
|
atomic team status [--json] # Profile in effect plus the storage report
|
|
386
|
-
atomic team leave # Remove what team join wrote
|
|
387
384
|
atomic intercom status # This machine's Intercom broker and multi-node state
|
|
388
385
|
atomic intercom restart # Replace the broker so it reads the current selection
|
|
389
386
|
atomic intercom upgrade # Replace a broker an older Atomic started, when safe
|
|
@@ -391,14 +388,12 @@ atomic intercom upgrade # Replace a
|
|
|
391
388
|
|
|
392
389
|
`atomic storage status` reports the selected storage for sessions and Intercom, where each selection came from (environment variable, project settings, global settings, or default), any outranked selections, whether each adapter loads, and whether each database answers `SELECT 1`. It also shows the running Intercom broker, its multi-node routing state, and peer brokers live in the shared database. It modifies nothing and exits `1` if a selection is invalid, an adapter fails to load, or a database does not answer.
|
|
393
390
|
|
|
394
|
-
`atomic storage join` verifies the credential and connection (`SELECT 1` with a 15-second timeout) using `@bastani/atomic-storage-
|
|
391
|
+
`atomic storage join` verifies the credential and connection (`SELECT 1` with a 15-second timeout) using `@bastani/atomic-storage-postgres` (for `postgres://` or `postgresql://` URLs), writes only the global `storage` setting, and reports any environment variables or settings that override it. It creates no tables and prints the install command if the adapter package is missing.
|
|
395
392
|
|
|
396
|
-
-
|
|
397
|
-
-
|
|
393
|
+
- Pass exactly one of `--password-file` (copied to a mode `600` `storage-token.<id>` file), `--token-file` (referenced in place and re-read on every new connection), or `--auth azure|aws|gcp`. Passwords in the URL are rejected, and settings store only file references.
|
|
394
|
+
- A libSQL URL (`libsql://`, `https://`, `http://`, `wss://`, `ws://`, or `file:`) is refused with `libsql-removed`: Atomic 0.10.11 removed libSQL support. See [Moving off libSQL](/storage#moving-off-libsql).
|
|
398
395
|
|
|
399
|
-
`atomic team
|
|
400
|
-
|
|
401
|
-
`atomic team status` adds the active profile (`individual`, `team`, `ci`, or `custom`) and project Intercom group. `atomic team leave` reverts only what `team join` wrote, deletes its token file unless another setting references it, and restarts the broker. See [Team and CI setup](/guides/team-setup).
|
|
396
|
+
`atomic team status` adds the active profile (`individual`, `team`, `ci`, or `custom`) and project Intercom group. `atomic team join` and `atomic team leave` were removed with libSQL support in 0.10.11 and fail with `libsql-removed`. See [Team and CI setup](/guides/team-setup).
|
|
402
397
|
|
|
403
398
|
`atomic storage migrate` creates or upgrades session and Intercom tables in the selected shared database (or `--db`). Run it as the database owner after joining or upgrading Atomic so runtime-only roles do not need schema-creation privileges (DDL).
|
|
404
399
|
|
|
@@ -406,7 +401,7 @@ atomic intercom upgrade # Replace a
|
|
|
406
401
|
|
|
407
402
|
`atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]` searches entries of a stored session in a local SQLite database by regex pattern, optionally resuming pagination from `cursor`. See [Recalling earlier work](/sessions#recalling-earlier-work).
|
|
408
403
|
|
|
409
|
-
`atomic storage export` writes sessions to `<dir>/sessions/<sessionId>.jsonl` (compatible with `atomic --import`). Each file is replaced whole; identical files are skipped and no files are deleted. `--limit <n>` exports at most `n` most recently modified sessions, and `--since <time>` filters by modification date or timestamp. Exporting a shared
|
|
404
|
+
`atomic storage export` writes sessions to `<dir>/sessions/<sessionId>.jsonl` (compatible with `atomic --import`). Each file is replaced whole; identical files are skipped and no files are deleted. `--limit <n>` exports at most `n` most recently modified sessions, and `--since <time>` filters by modification date or timestamp. Exporting a shared PostgreSQL database requires `--storage` or `--storage-file` explicitly.
|
|
410
405
|
|
|
411
406
|
`atomic storage import` validates every file in `<dir>/sessions` before writing, then adds new sessions and newer entries for existing sessions while ignoring other directories. Partial failures list what was and was not written so you can rerun safely. Both `export` and `import` accept `--sessions`, plus `--storage <json>` or `--storage-file <path>` to target a specific store.
|
|
412
407
|
|
|
@@ -435,7 +430,7 @@ Because `prebuild` executes project code, the project must be trusted or `--appr
|
|
|
435
430
|
|
|
436
431
|
See [Environment variables](/environment-variables) for the complete registry, exact boolean parsing rules, legacy `PI_*` aliases, color controls, and diagnostic knobs. Key CLI variables:
|
|
437
432
|
|
|
438
|
-
- **Config & storage:** `ATOMIC_CODING_AGENT_DIR`, `ATOMIC_CODING_AGENT_SESSION_DIR`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`, `
|
|
433
|
+
- **Config & storage:** `ATOMIC_CODING_AGENT_DIR`, `ATOMIC_CODING_AGENT_SESSION_DIR`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`, `ATOMIC_PACKAGE_DIR`.
|
|
439
434
|
- **Network & updates:** `ATOMIC_OFFLINE`, `ATOMIC_SKIP_VERSION_CHECK`, `ATOMIC_SELF_UPDATE_COMMAND` ([Custom update command](#custom-update-command)), `ATOMIC_TELEMETRY`, `ATOMIC_CACHE_RETENTION` ([Prompt-cache retention](/environment-variables#prompt-cache-retention)).
|
|
440
435
|
- **Interactive & shell:** `NO_COLOR`, `FORCE_COLOR`, `ATOMIC_REDUCED_MOTION`, `ATOMIC_DEBUG`, `ATOMIC_NO_PTY`, `ATOMIC_STDIN_TIMEOUT_MS`, `VISUAL` / `EDITOR`, `AI_AGENT` (set to `atomic` on Atomic and its child processes).
|
|
441
436
|
|
package/docs/reference.md
CHANGED
|
@@ -24,7 +24,7 @@ Look up exact commands, settings, configuration schemas, tool behaviors, and API
|
|
|
24
24
|
- [Models configuration](/models-configuration) lists the generated `models.json` field reference (including [remote compaction models](/models#remote-compaction-models)).
|
|
25
25
|
- [Session format](/session-format) specifies the JSONL format, entry types, and `SessionManager` API.
|
|
26
26
|
- [Compaction reference](/compaction/reference) covers parameters, saved boundaries, custom compactor contracts, hooks, exports, settings, and historical formats.
|
|
27
|
-
- [Storage](/storage) covers local SQLite,
|
|
27
|
+
- [Storage](/storage) covers choosing a session store, sharing one database between machines, the `atomic storage` commands, exporting and importing sessions, and storage errors. Each kind of store has its own page: [local SQLite](/storage/sqlite), [JSONL](/storage/jsonl), and [PostgreSQL](/storage/postgres), with its adapter library [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) and guides for [PgBouncer](/storage/postgres/pgbouncer) and [server tuning](/storage/postgres/tuning). [Custom adapters](/storage/custom-adapters) covers adapter packages, your own database drivers, and the conformance suites. For SDK apps, see [SDK session storage](/sdk/storage).
|
|
28
28
|
- [Worktree snapshots SDK & errors](/worktree-snapshots#sdk) documents snapshot capture/restore functions, garbage collection, and `WorkspaceError` classes.
|
|
29
29
|
- [Environment blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint) documents `.atomic/blueprint.yaml`, `atomic blueprint cache-key`, and `atomic blueprint prebuild`.
|
|
30
30
|
|
|
@@ -42,7 +42,7 @@ Look up exact commands, settings, configuration schemas, tool behaviors, and API
|
|
|
42
42
|
- [Extension events](/extensions/events) lists every extension event and its payload.
|
|
43
43
|
- [Provider API reference](/custom-provider/api-reference) specifies custom provider configuration and model definition options.
|
|
44
44
|
- [SDK API reference](/sdk/reference) covers options, loaders, return values, run modes, and exports.
|
|
45
|
-
- [SDK storage
|
|
45
|
+
- [SDK session storage](/sdk/storage) documents `sessionStore`, `storage`, `resolveSessionStore()`, `StorageProvider`, and `createAgentSessionRuntime()` storage wiring.
|
|
46
46
|
- [Structured decisions](/sdk/structured-decisions) documents `decide()`, structured output tools, and provider limits.
|
|
47
47
|
- [RPC protocol](/rpc/protocol) and [RPC extension UI](/rpc/extension-ui) document RPC commands, events, UI dialogs, types, and errors.
|
|
48
48
|
- [JSON event stream](/json) documents `--mode json` event output.
|
package/docs/rpc/extension-ui.md
CHANGED
|
@@ -134,7 +134,7 @@ Represents one `ask_user_question` tool call: one to four questions, each with a
|
|
|
134
134
|
"header": "Storage",
|
|
135
135
|
"options": [
|
|
136
136
|
{ "label": "SQLite", "description": "A local file" },
|
|
137
|
-
{ "label": "
|
|
137
|
+
{ "label": "PostgreSQL", "description": "A shared database" }
|
|
138
138
|
]
|
|
139
139
|
}
|
|
140
140
|
]
|
|
@@ -152,7 +152,7 @@ Expected response: `extension_ui_response` with `answers` (one entry per answere
|
|
|
152
152
|
{
|
|
153
153
|
"type": "extension_ui_response",
|
|
154
154
|
"id": "uuid-5",
|
|
155
|
-
"answers": [{ "questionIndex": 0, "question": "Which storage should runs use?", "kind": "option", "answer": "
|
|
155
|
+
"answers": [{ "questionIndex": 0, "question": "Which storage should runs use?", "kind": "option", "answer": "PostgreSQL" }]
|
|
156
156
|
}
|
|
157
157
|
```
|
|
158
158
|
|
package/docs/sdk/reference.md
CHANGED
|
@@ -164,6 +164,8 @@ Remote catalogs persist locally so later runtimes can restore them without a net
|
|
|
164
164
|
- Network refreshes are throttled to once per provider every four hours unless forced. Call `await modelRuntime.refresh({ allowNetwork: true, force: true, signal })` to force an immediate refresh.
|
|
165
165
|
- Setting `ATOMIC_OFFLINE` (legacy alias `PI_OFFLINE`) disables model network access, and a `refresh()` call that omits `allowNetwork` follows that same runtime network policy.
|
|
166
166
|
|
|
167
|
+
A running session exposes the runtime it uses as `session.modelRuntime`, so you can add a provider to a live session without creating a new runtime. For example, `session.modelRuntime.registerProvider("acme", { ... })` makes the provider's models available to that session's model selection and compaction.
|
|
168
|
+
|
|
167
169
|
`registerProvider()`, `registerNativeProvider()`, and `unregisterProvider()` return at once and refresh the catalog from cache in the background while checking provider credentials. `await modelRuntime.whenRegistrationRefreshesSettled()` resolves once no registration refresh is running, including refreshes started while you wait.
|
|
168
170
|
|
|
169
171
|
### API keys and OAuth
|
|
@@ -507,7 +509,7 @@ Without a detachment policy, detachable calls run inline. A host using persisten
|
|
|
507
509
|
- **`session.isWaitingOnDetachedResults()`:** Reports whether the transcript still awaits a detached result. While waiting under a detachment policy, nothing starts a turn on the idle session (including subagent notices, steering, follow-ups, and post-compaction continuations); held custom messages are persisted and replayed after `resumeDetachedTurn()` continues the turn. Do not call `prompt()` while waiting on results.
|
|
508
510
|
- **`session.hasPendingDetachedTurn()` and `session.redispatchDetachedToolCalls()`:** `hasPendingDetachedTurn()` reports whether a reopened transcript ends on a detached turn; continue it with `redispatchDetachedToolCalls()` and `resumeDetachedTurn()` instead of prompting again. `redispatchDetachedToolCalls()` restarts unanswered detachable calls with their original IDs and arguments and emits `tool_execution_start` before returning.
|
|
509
511
|
|
|
510
|
-
Results handed to `resumeDetachedTurn()` pass through `tool_result` hooks, image resizing, and output persistence (stored as `tool-output://<sha256>` in blob-capable stores like SQLite,
|
|
512
|
+
Results handed to `resumeDetachedTurn()` pass through `tool_result` hooks, image resizing, and output persistence (stored as `tool-output://<sha256>` in blob-capable stores like SQLite, PostgreSQL, and memory, or on disk otherwise; see [Persisted tool output](/tools#persisted-tool-output)).
|
|
511
513
|
|
|
512
514
|
Detached calls run outside the session's async context and hold no reference to the session:
|
|
513
515
|
|
|
@@ -1503,10 +1505,9 @@ StorageProvider, type StorageSelection, type StorageOpenContext, type StorageAda
|
|
|
1503
1505
|
type AdapterOptions, type SecretRef, type SessionStorageOption, type SessionStore
|
|
1504
1506
|
loadStorageAdapter, resolveAdapterOptions, adapterOpenContext, storageSelectionKey
|
|
1505
1507
|
secretFilePath, secretFilePathAsync
|
|
1506
|
-
|
|
1508
|
+
POSTGRES_ADAPTER_PACKAGE, LOCAL_SESSIONS_STORAGE, REDACTED_SECRET
|
|
1507
1509
|
inMemorySecret, type InMemorySecretRef
|
|
1508
|
-
|
|
1509
|
-
joinTeam, leaveTeam, getTeamProfile, isPostgresUrl
|
|
1510
|
+
getTeamProfile, isPostgresUrl
|
|
1510
1511
|
selectStorage, selectStorageAsync, type StorageInputSelection, type StorageSettingsSelection
|
|
1511
1512
|
selectProcessStorage, selectProcessStorageAsync, type ProcessStorageChoice, type StorageDomain
|
|
1512
1513
|
processSharedStorageSelection, processSharedStorageSelectionAsync
|
package/docs/sdk/storage.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "SDK storage backends"
|
|
3
3
|
sidebarTitle: "Storage backends"
|
|
4
|
-
description: "Configure local SQLite, JSONL, in-memory,
|
|
4
|
+
description: "Configure local SQLite, JSONL, in-memory, and PostgreSQL storage for createAgentSession(), createAgentSessionRuntime(), and SessionManager."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
By default, Atomic persists sessions in local SQLite at `~/.atomic/workflows/journal.sqlite` (`session_` table prefix). In SDK applications, you can select any built-in or remote backend per session, share one database connection across multiple sessions, or manage lifecycle explicitly through `createAgentSessionRuntime()` and `SessionManager`.
|
|
8
8
|
|
|
9
|
-
For CLI setup, database role administration, migrations, and custom drivers, see [Storage
|
|
9
|
+
For CLI setup, database role administration, migrations, and custom drivers, see [Storage](/storage).
|
|
10
10
|
|
|
11
11
|
## Choosing a backend
|
|
12
12
|
|
|
@@ -15,7 +15,6 @@ For CLI setup, database role administration, migrations, and custom drivers, see
|
|
|
15
15
|
| **Local SQLite** (default) | Built into `@bastani/atomic` | `{ kind: "sqlite", path, prefix? }` or caller-owned `openNodeSqliteDatabase()` | Single-machine apps, full worktree snapshots, history search, zero external services |
|
|
16
16
|
| **JSONL directory** | Built into `@bastani/atomic` | `{ kind: "jsonl", dir }` or `JsonlSessionStore.open(dir, { exactDirectory: true })` | Human-readable append-only `.jsonl` files (no snapshot blobs) |
|
|
17
17
|
| **In-memory** | Built into `@bastani/atomic` | `SessionManager.inMemory()`, `new MemorySessionStore()`, or `{ kind: "memory" }` | Tests, ephemeral runs, or RAM-backed release/rehydrate |
|
|
18
|
-
| **libSQL / Turso** | [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) | `openLibsqlDatabase()` + `{ kind: "database", database }`, `{ kind: "adapter", ... }`, or `teamProfileSelection()` | Lightweight shared DB for small teams, multi-machine resume, or CI |
|
|
19
18
|
| **PostgreSQL 16+** | [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) | `openPostgresDatabase()` + `{ kind: "database", database }` or `{ kind: "adapter", ... }` | Concurrent multi-machine writers, managed HA, connection poolers, cloud IAM |
|
|
20
19
|
|
|
21
20
|
### `@bastani/atomic` vs. `@bastani/atomic/storage`
|
|
@@ -199,9 +198,9 @@ npm install @bastani/atomic-storage-postgres @bastani/atomic
|
|
|
199
198
|
|
|
200
199
|
Before connecting from an SDK host:
|
|
201
200
|
|
|
202
|
-
- **PostgreSQL version:** Atomic
|
|
201
|
+
- **PostgreSQL version:** Atomic needs **PostgreSQL 16 or newer**.
|
|
203
202
|
- **Table prefix rules:** On PostgreSQL, `prefix` must be **lowercase** and at most **24 characters** (`POSTGRES_MAX_STORAGE_PREFIX_LENGTH`). Uppercase or oversized prefixes fail with `StoragePrefixError`.
|
|
204
|
-
- **Owner-role migrations:** Run `atomic storage migrate` once as the database owner role before connecting with a least-privilege runtime role. See [Set up the database](/storage#set-up-the-database).
|
|
203
|
+
- **Owner-role migrations:** Run `atomic storage migrate` once as the database owner role before connecting with a least-privilege runtime role. See [Set up the database](/storage/postgres#set-up-the-database).
|
|
205
204
|
|
|
206
205
|
**Option A — Caller-owned `openPostgresDatabase()` (recommended for SDK hosts sharing one pool):**
|
|
207
206
|
|
|
@@ -295,89 +294,7 @@ try {
|
|
|
295
294
|
|
|
296
295
|
> **Module resolution for `{ kind: "adapter" }`:** Atomic resolves adapter package names from user-scope packages installed with `atomic install` (`~/.atomic/agent/npm`), paths passed in `DefaultResourceLoader({ additionalExtensionPaths: [packageRoot] })`, or relative to `agentDir` — **not** from your application's local `node_modules`. If your app installed `@bastani/atomic-storage-postgres` only with `npm install`, use **Option A** (`openPostgresDatabase()`), install the package in user scope (`atomic install npm:@bastani/atomic-storage-postgres`), pass its directory via `additionalExtensionPaths`, or pass a resolved file path (`fileURLToPath(import.meta.resolve(POSTGRES_ADAPTER_PACKAGE))`).
|
|
297
296
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Install the optional adapter alongside `@bastani/atomic`:
|
|
301
|
-
|
|
302
|
-
```bash
|
|
303
|
-
npm install @bastani/atomic-storage-libsql @bastani/atomic
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
**Option A — Caller-owned `openLibsqlDatabase()`:**
|
|
307
|
-
|
|
308
|
-
```typescript
|
|
309
|
-
import { createAgentSession } from "@bastani/atomic";
|
|
310
|
-
import { openLibsqlDatabase } from "@bastani/atomic-storage-libsql";
|
|
311
|
-
|
|
312
|
-
const database = await openLibsqlDatabase({
|
|
313
|
-
url: "libsql://<db>.turso.io",
|
|
314
|
-
authToken: process.env.TURSO_AUTH_TOKEN,
|
|
315
|
-
// Optional for self-hosted sqld (`libsql:`, `https:`, or `http:` URLs):
|
|
316
|
-
// namespace: "team-a",
|
|
317
|
-
// headers: { "x-custom-routing": "primary" },
|
|
318
|
-
});
|
|
319
|
-
try {
|
|
320
|
-
const { session } = await createAgentSession({
|
|
321
|
-
sessionStore: { kind: "database", database, prefix: "app_" },
|
|
322
|
-
});
|
|
323
|
-
try {
|
|
324
|
-
await session.prompt("Summarize recent test failures");
|
|
325
|
-
} finally {
|
|
326
|
-
await session.dispose();
|
|
327
|
-
}
|
|
328
|
-
} finally {
|
|
329
|
-
await database.close();
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
**Option B — `{ kind: "adapter" }` and `teamProfileSelection()`:**
|
|
334
|
-
|
|
335
|
-
The `{ kind: "adapter" }` resolution rules are the same as PostgreSQL above (`atomic install npm:@bastani/atomic-storage-libsql`, `additionalExtensionPaths`, or resolved file path). For CI or team profiles, `teamProfileSelection()` builds a validated libSQL `storage` selection without touching `settings.json`:
|
|
336
|
-
|
|
337
|
-
```typescript
|
|
338
|
-
import {
|
|
339
|
-
createAgentSession,
|
|
340
|
-
LIBSQL_ADAPTER_PACKAGE,
|
|
341
|
-
teamProfileSelection,
|
|
342
|
-
} from "@bastani/atomic";
|
|
343
|
-
|
|
344
|
-
// Adapter selection
|
|
345
|
-
{
|
|
346
|
-
const { session } = await createAgentSession({
|
|
347
|
-
sessionStore: {
|
|
348
|
-
kind: "adapter",
|
|
349
|
-
module: LIBSQL_ADAPTER_PACKAGE,
|
|
350
|
-
options: { url: "libsql://<db>.turso.io" },
|
|
351
|
-
secrets: { authToken: { env: "TURSO_AUTH_TOKEN" } },
|
|
352
|
-
prefix: "app_",
|
|
353
|
-
},
|
|
354
|
-
});
|
|
355
|
-
try {
|
|
356
|
-
await session.prompt("Check release readiness");
|
|
357
|
-
} finally {
|
|
358
|
-
await session.dispose();
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
// CI / team profile helper (libSQL / Turso only)
|
|
363
|
-
// Pass exactly one of `token` (in-memory, redacted), `tokenEnv` (validated immediately), or `tokenFile`.
|
|
364
|
-
{
|
|
365
|
-
const storage = teamProfileSelection({
|
|
366
|
-
profile: "ci",
|
|
367
|
-
url: process.env.ATOMIC_TEAM_URL!,
|
|
368
|
-
tokenEnv: "ATOMIC_TEAM_TOKEN",
|
|
369
|
-
prefix: "ci_",
|
|
370
|
-
});
|
|
371
|
-
const { session } = await createAgentSession({ storage });
|
|
372
|
-
try {
|
|
373
|
-
await session.prompt("Run release checks");
|
|
374
|
-
} finally {
|
|
375
|
-
await session.dispose();
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
See [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) and [Team and CI setup](/guides/team-setup#from-the-sdk) for `sqld` checkpoints, retries, and CI environment variables.
|
|
297
|
+
> Atomic 0.10.11 removed libSQL and Turso support, including `@bastani/atomic-storage-libsql`, `teamProfileSelection()`, and `LIBSQL_ADAPTER_PACKAGE`. To move sessions off libSQL, see [Moving off libSQL](/storage#moving-off-libsql).
|
|
381
298
|
|
|
382
299
|
## `createAgentSessionRuntime()` and `SessionManager` with explicit stores
|
|
383
300
|
|
|
@@ -423,8 +340,8 @@ import { openNodeSqliteDatabase } from "@bastani/atomic/storage";
|
|
|
423
340
|
const cwd = process.cwd();
|
|
424
341
|
const agentDir = getAgentDir();
|
|
425
342
|
|
|
426
|
-
// Swap openNodeSqliteDatabase() for openPostgresDatabase()
|
|
427
|
-
// to run the exact same runtime against PostgreSQL
|
|
343
|
+
// Swap openNodeSqliteDatabase() for openPostgresDatabase()
|
|
344
|
+
// to run the exact same runtime against PostgreSQL.
|
|
428
345
|
const database = await openNodeSqliteDatabase("./runtime-sessions.sqlite");
|
|
429
346
|
try {
|
|
430
347
|
const store = await SqlSessionStore.open(database, { prefix: "app_" });
|
|
@@ -529,7 +446,7 @@ When `createAgentSession()` chooses a session store, the first source set wins:
|
|
|
529
446
|
|
|
530
447
|
1. `sessionManager` (caller-owned `SessionManager`).
|
|
531
448
|
2. `sessionStore` (either a `SessionStore` instance or a tagged `StorageSelection`: `{ kind: "sqlite", path, prefix? }`, `{ kind: "jsonl", dir }`, `{ kind: "memory" }`, `{ kind: "database", database, prefix? }`, or `{ kind: "adapter", module, options?, secrets?, prefix? }`).
|
|
532
|
-
3. `storage` (`settings.json` shape: `{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }
|
|
449
|
+
3. `storage` (`settings.json` shape: `{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }`. Does not accept `{ dir }`; use `sessionStore: { kind: "jsonl", dir }` for JSONL).
|
|
533
450
|
4. Process overrides (`ATOMIC_SESSIONS_STORAGE`, `ATOMIC_STORAGE`, `--storage`, `--storage-file`; see [Selecting storage per process](/storage#selecting-storage-per-process)).
|
|
534
451
|
5. Settings (`sessions.storage`, then top-level `storage`).
|
|
535
452
|
6. Default local SQLite (`~/.atomic/workflows/journal.sqlite`).
|
|
@@ -608,7 +525,6 @@ For the full list of storage error classes, cross-process `serializeStorageError
|
|
|
608
525
|
|
|
609
526
|
- [Operator storage setup](/storage): PostgreSQL roles, TLS, proxies, poolers, migrations, `atomic storage` commands, and custom drivers.
|
|
610
527
|
- [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres): PostgreSQL adapter options, cloud IAM, and SQL helpers.
|
|
611
|
-
- [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql): Turso and self-hosted `sqld` adapter options and retry behavior.
|
|
612
528
|
- [SDK overview](/sdk): `createAgentSession()`, workspaces, Intercom policies, and lifecycle hooks.
|
|
613
529
|
- [SDK API reference](/sdk/reference): Full options, loaders, run modes, and exports.
|
|
614
530
|
- [`SessionManager` API](/session-format#sessionmanager-api): Entry types, tree navigation, and session append methods.
|
|
@@ -234,7 +234,7 @@ console.log(result.value.category, result.model);
|
|
|
234
234
|
|
|
235
235
|
`result.value` holds the schema-validated result, `result.model` identifies the candidate that answered, and `result.modelAttempts` records skipped and failed candidates when a fallback chain ran.
|
|
236
236
|
|
|
237
|
-
`result.usage` reports chat token usage when a chat candidate produced the result (classifier billing is reported separately by the classifier operation). A schema-valid result does not guarantee policy compliance, so
|
|
237
|
+
`result.usage` reports chat token usage when a chat candidate produced the result (classifier billing is reported separately by the classifier operation). A schema-valid result does not guarantee policy compliance, so check the result against your own rules before acting.
|
|
238
238
|
|
|
239
239
|
The `structured_output` tool accepts required `instructions`, non-empty named `state`, and optional `model` and `fallbackModels` from the calling model. `createStructuredOutputTool({ schema })` fixes the output schema. The calling model cannot override the deadline; set it with `timeoutMs`. See [Structured output final results](/sdk/reference#structured-output-final-results).
|
|
240
240
|
|
package/docs/sdk/web-server.md
CHANGED
|
@@ -31,7 +31,7 @@ const nextConfig: NextConfig = {
|
|
|
31
31
|
export default nextConfig;
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Once `@bastani/atomic` is external, its dependencies load from `node_modules`. List any other Atomic packages your application imports directly, including [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres)
|
|
34
|
+
Once `@bastani/atomic` is external, its dependencies load from `node_modules`. List any other Atomic packages your application imports directly, including [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) when using remote SQL storage (see [SDK storage guide](/sdk/storage)).
|
|
35
35
|
|
|
36
36
|
Import TypeBox for custom tool schemas from `@bastani/atomic/typebox` (and its subpaths such as `/value`, `/compile`, and `/format`) rather than `typebox` directly so custom formats and settings share Atomic's TypeBox registry.
|
|
37
37
|
|
|
@@ -126,7 +126,7 @@ if (!state.shutdownRegistered) {
|
|
|
126
126
|
}
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
`SessionManager.inMemory()` keeps history in process memory. To persist conversations across restarts, pass a SQLite, JSONL,
|
|
129
|
+
`SessionManager.inMemory()` keeps history in process memory. To persist conversations across restarts, pass a SQLite, JSONL, or PostgreSQL `SessionManager` or `sessionStore` (see [SDK storage guide](/sdk/storage)). Call `closeConversation()` when a conversation finishes or goes idle, and run `closeAllConversations()` on `SIGTERM`/`SIGINT` so session stores and child processes close cleanly.
|
|
130
130
|
|
|
131
131
|
Sessions on `globalThis` live in one server process. Run this on a long-lived Node.js server with sticky routing per conversation if you scale to multiple instances; short-lived serverless functions discard process memory between requests.
|
|
132
132
|
|
|
@@ -278,7 +278,7 @@ Any route driving an agent session lets callers run tools with the server proces
|
|
|
278
278
|
## Next steps
|
|
279
279
|
|
|
280
280
|
- [TypeScript SDK](/sdk): sessions, prompting, storage, and events.
|
|
281
|
-
- [SDK storage guide](/sdk/storage): persist server sessions in SQLite, JSONL,
|
|
281
|
+
- [SDK storage guide](/sdk/storage): persist server sessions in SQLite, JSONL, or PostgreSQL and wire `createAgentSessionRuntime()`.
|
|
282
282
|
- [SDK API reference](/sdk/reference): every `createAgentSession()` option and export.
|
|
283
283
|
- [Orchestration](/orchestration): multi-step workflows with codemode and subagents.
|
|
284
284
|
- [Migrating workflows](/orchestration/migrating-workflows): replacing older workflow definitions.
|
package/docs/sdk.md
CHANGED
|
@@ -8,7 +8,7 @@ Embed Atomic in Node.js applications (Node.js 24.20 or newer) to build custom UI
|
|
|
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).
|
|
11
|
-
- **Session storage:** [SDK storage guide](/sdk/storage) and [Storage
|
|
11
|
+
- **Session storage:** [SDK storage guide](/sdk/storage) and [Storage](/storage).
|
|
12
12
|
- **HTTP streaming servers:** [Embed Atomic in a web server](/sdk/web-server) (Next.js App Router guide).
|
|
13
13
|
- **Compare modes:** [Programmatic integration](/programmatic).
|
|
14
14
|
|
|
@@ -146,7 +146,6 @@ Sessions default to local SQLite at `~/.atomic/workflows/journal.sqlite` with th
|
|
|
146
146
|
| Local SQLite (default) | Built into `@bastani/atomic` (`@bastani/atomic/storage`) | `{ kind: "sqlite", path, prefix? }` or caller-owned `openNodeSqliteDatabase()` and `SqlSessionStore.open()` |
|
|
147
147
|
| JSONL directory | Built into `@bastani/atomic` | `{ kind: "jsonl", dir }` or caller-owned `JsonlSessionStore.open()` |
|
|
148
148
|
| In-memory | Built into `@bastani/atomic` | `new MemorySessionStore()` (caller-owned) or `{ kind: "memory" }` (discarded on `dispose()`) |
|
|
149
|
-
| libSQL / Turso | [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) | `{ kind: "adapter", module: LIBSQL_ADAPTER_PACKAGE, ... }` or caller-owned `openLibsqlDatabase()` |
|
|
150
149
|
| PostgreSQL (16+ for sessions) | [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) | `{ kind: "adapter", module: POSTGRES_ADAPTER_PACKAGE, ... }` or caller-owned `openPostgresDatabase()` |
|
|
151
150
|
|
|
152
151
|
Quick local SQLite session. Atomic opens the store and closes it in `dispose()`:
|
|
@@ -190,11 +189,11 @@ try {
|
|
|
190
189
|
}
|
|
191
190
|
```
|
|
192
191
|
|
|
193
|
-
- **`sessionStore` vs. `storage`:** `sessionStore` accepts a `SessionStore` instance (`SqlSessionStore`, `JsonlSessionStore`, `MemorySessionStore`) or a tagged selection (`{ kind: "sqlite" | "jsonl" | "memory" | "database" | "adapter", ... }`). `storage` uses the `settings.json` shape
|
|
192
|
+
- **`sessionStore` vs. `storage`:** `sessionStore` accepts a `SessionStore` instance (`SqlSessionStore`, `JsonlSessionStore`, `MemorySessionStore`) or a tagged selection (`{ kind: "sqlite" | "jsonl" | "memory" | "database" | "adapter", ... }`). `storage` uses the `settings.json` shape (`{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }`) and does not support JSONL.
|
|
194
193
|
- **Precedence:** Atomic resolves storage in order from `sessionManager`, `sessionStore`, `storage`, process flags and variables (`ATOMIC_SESSIONS_STORAGE` and `ATOMIC_STORAGE`), settings (`sessions.storage` before `storage`), and default SQLite. Memory is never an automatic fallback.
|
|
195
194
|
- **Ownership and mutations:** Atomic closes stores it opened from selection objects during `dispose()`, while leaving caller-owned `SessionStore`, `SessionManager`, and `database` instances open. Await every `SessionManager` write and every `atomic.appendEntry`, `setSessionName`, `setLabel`, `setThinkingLevel`, and `cycleThinkingLevel` call; there is no `flush()` method. `ExtensionContext.sessionSignal` aborts when reload or shutdown starts so extensions can cancel waits while finishing in-flight writes.
|
|
196
195
|
|
|
197
|
-
See the **[SDK storage guide](/sdk/storage)** for all five backends, `createAgentSessionRuntime()` wiring, `SessionManager` CRUD, `JsonlSessionStore` `exactDirectory` behavior, `npm install` vs `atomic install` adapter resolution, ownership and close rules, and `StorageError` handling. For CLI session commands, the full `SessionManager` method list, operator setup, and cross-machine resume, see [Sessions](/sessions), [SessionManager API](/session-format#sessionmanager-api), [Storage
|
|
196
|
+
See the **[SDK storage guide](/sdk/storage)** for all five backends, `createAgentSessionRuntime()` wiring, `SessionManager` CRUD, `JsonlSessionStore` `exactDirectory` behavior, `npm install` vs `atomic install` adapter resolution, ownership and close rules, and `StorageError` handling. For CLI session commands, the full `SessionManager` method list, operator setup, and cross-machine resume, see [Sessions](/sessions), [SessionManager API](/session-format#sessionmanager-api), [Storage](/storage), and [Resume on any machine](/guides/resume-on-any-machine).
|
|
198
197
|
|
|
199
198
|
### Human input without a terminal
|
|
200
199
|
|
|
@@ -572,6 +571,17 @@ When `npm install`, `pnpm add`, or `bun add` replaces `@bastani/atomic` while a
|
|
|
572
571
|
|
|
573
572
|
Also restart after an in-place update if your process launched on an older Atomic release or before importing `@bastani/atomic/rpc-entry`.
|
|
574
573
|
|
|
574
|
+
### Node 22 hosts
|
|
575
|
+
|
|
576
|
+
Atomic no longer runs on Node.js 22. It needs Node.js 24.20.0 or newer. To move a host off Node 22:
|
|
577
|
+
|
|
578
|
+
1. Run `node --version` to see which version you have.
|
|
579
|
+
2. Install the current Node.js 24 LTS release from [nodejs.org](https://nodejs.org/en/download), or with `nvm install 24`, `fnm install 24` or `mise use -g node@24`.
|
|
580
|
+
3. Reinstall your project's dependencies with the new Node.js, for example with `npm install`.
|
|
581
|
+
4. If you started your host with `node --experimental-async-context-frame` to make Node 22 faster, remove the flag. Node 24 doesn't need it and refuses to start with it.
|
|
582
|
+
|
|
583
|
+
See [Node.js version](/getting-started/installation#nodejs-version) for more on choosing a version.
|
|
584
|
+
|
|
575
585
|
### Migrating an existing Node host
|
|
576
586
|
|
|
577
587
|
- **Builtins load automatically:** Remove manual registration of shipped builtin extensions; disable selectively with `builtins` and restrict tools with `tools` / `excludedTools` (`tools: []` excludes Intercom too).
|
package/docs/security.md
CHANGED
|
@@ -92,7 +92,7 @@ Atomic enforces several local guardrails by default:
|
|
|
92
92
|
- **SSRF blocking on URL reads.** `read` blocks `localhost`, `.localhost`, private IP ranges, cloud metadata endpoints, and redirects to them ([Documents and URLs](/tools#documents-and-urls)). Set `ATOMIC_ALLOW_PRIVATE_URL_READS=1` only when a workflow must read private URLs ([Environment variables](/environment-variables)). Bundled `@bastani/web-access` also keeps local or intranet hosts and credentialed URLs out of remote fallbacks ([Web access](/web-access)).
|
|
93
93
|
- **Opt-in browser cookies.** Gemini Web cookie lookup is disabled by default and activates only when you set `allowBrowserCookies: true` in `~/.atomic/web-search.json` or `ATOMIC_ALLOW_BROWSER_COOKIES=1` ([Web access](/web-access)).
|
|
94
94
|
- **Worktree snapshot secret deny list.** [Worktree snapshots](/worktree-snapshots) exclude `.env*`, `*.pem`, `*.key`, `*.p12`, `*.pfx`, `credentials`, `credentials.json`, `.netrc`, `_netrc`, `.git-credentials`, `.pgpass`, and private SSH key files before `.atomic/snapshot-ignore` or Git staging. This deny list cannot be overridden ([What is left out](/worktree-snapshots#what-is-left-out)).
|
|
95
|
-
- **Storage credentials and process overrides.** Shared storage rejects credentials embedded in URLs and saves static tokens in mode-`600` files. Process-level storage overrides (`--storage`, `--storage-file`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE
|
|
95
|
+
- **Storage credentials and process overrides.** Shared storage rejects credentials embedded in URLs and saves static tokens in mode-`600` files. Process-level storage overrides (`--storage`, `--storage-file`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`) come from the launching host and bypass project trust ([Selecting storage per process](/storage#selecting-storage-per-process)).
|
|
96
96
|
- **Session sharing and debug snapshots.** `/share` uploads a private GitHub gist and strips worktree snapshots and large tool-output blobs, while keeping the rest of the transcript ([Exporting and sharing sessions](/usage#exporting-and-sharing-sessions)). `/debug` writes all current session messages unredacted to `~/.atomic/agent/atomic-debug.log` ([Diagnostics and debugging](/development#debugging)).
|
|
97
97
|
|
|
98
98
|
## Running untrusted or unattended work
|
package/docs/session-format.md
CHANGED
|
@@ -4,7 +4,7 @@ sidebarTitle: "Session format"
|
|
|
4
4
|
description: "Format-4 JSONL session schema, message and entry types, context rebuilding rules, and the SessionManager API."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
This reference describes format-4 JSONL files used by explicit JSONL stores and session exports. Sessions default to local SQLite; see [Session storage](/sessions#session-storage), [Storage
|
|
7
|
+
This reference describes format-4 JSONL files used by explicit JSONL stores and session exports. Sessions default to local SQLite; see [Session storage](/sessions#session-storage), [Storage](/storage), and [SDK session storage](/sdk/storage) to choose or open a store.
|
|
8
8
|
|
|
9
9
|
In JSONL, each line is a JSON object with a `type` field. Session entries form a tree through `id` and `parentId`.
|
|
10
10
|
|
|
@@ -446,7 +446,7 @@ Repository state of one checkout at the end of a turn that ran a file-writing to
|
|
|
446
446
|
|
|
447
447
|
Built-in stores save turn-ending diagnostic lines, such as cancelled retry errors, separately from session entries so reopening a session can display them in place. Each saved line is capped at 4,096 UTF-8 bytes and ends with `... [diagnostic truncated]` if trimmed, while the live terminal error stays intact.
|
|
448
448
|
|
|
449
|
-
These records are not session entries. `/tree`, model requests, compaction, token totals, conversation exports, and continuation logic ignore them. Copying a JSONL file or importing a session does not transfer them
|
|
449
|
+
These records are not session entries. `/tree`, model requests, compaction, token totals, conversation exports, and continuation logic ignore them. Copying a JSONL file or importing a session does not transfer them.
|
|
450
450
|
|
|
451
451
|
Cache-miss and dropped-thinking notices are derived from saved assistant replies. When a compacted session opens on its active context window, Atomic does not reload discarded history to reconstruct earlier notice counts.
|
|
452
452
|
|
|
@@ -540,7 +540,7 @@ for (const line of lines) {
|
|
|
540
540
|
|
|
541
541
|
Await `create`, `open`, `continueRecent`, `forkFrom`, and every session mutation. A resolved mutation has committed to its store, and a failed write rejects with a typed storage error without publishing the entry. There is no `flush` method.
|
|
542
542
|
|
|
543
|
-
`inMemory()` selects memory storage explicitly without filesystem I/O. Factories without an explicit store or directory resolve configured storage, defaulting to the shared local SQLite database. Passing a directory selects JSONL explicitly. Store-open failures never fall back to memory. To open SQLite, PostgreSQL,
|
|
543
|
+
`inMemory()` selects memory storage explicitly without filesystem I/O. Factories without an explicit store or directory resolve configured storage, defaulting to the shared local SQLite database. Passing a directory selects JSONL explicitly. Store-open failures never fall back to memory. To open SQLite, PostgreSQL, JSONL, or memory stores, see [SDK session storage](/sdk/storage), [Storage](/storage), and [Session management](/sdk/reference#session-management).
|
|
544
544
|
|
|
545
545
|
**Store ownership and closing.** `SessionManager` has no `close()` method. Calling `SessionManager.create(cwd)`, `SessionManager.continueRecent(cwd)`, or `SessionManager.open(filePath)` without passing a `SessionStore` opens an internal store that `createAgentSession({ sessionManager })` does **not** close during `session.dispose()`. Close `sessionManager.getSessionStore().close()` when finished, or open and close a `SessionStore` explicitly and pass it to `SessionManager.create(store, cwd)` or `SessionManager.open(store, sessionId)`. Calling `close()` twice on a direct `SqlSessionStore`, `JsonlSessionStore`, or `MemorySessionStore` throws `StoreClosedError`, and `SqlSessionStore.close()` leaves a caller-owned `database` open. See [SDK session storage](/sdk/storage) for the ownership matrix.
|
|
546
546
|
|
|
@@ -550,8 +550,8 @@ By default, opening an existing session loads only the active tail window (entri
|
|
|
550
550
|
|
|
551
551
|
- `SessionManager.create(cwd, sessionDir?, options?)`: create a new session in configured storage, or in flat-layout JSONL when `sessionDir` is provided.
|
|
552
552
|
- `SessionManager.create(store, cwd, options?)`: create a new session in a supplied `SessionStore`.
|
|
553
|
-
- `SessionManager.open(store, sessionId, cwdOverride?, options?)`: open an existing session by exact ID in any `SessionStore` (required for SQLite
|
|
554
|
-
- `SessionManager.open(path, sessionDir?, cwdOverride?, options?)`: open a JSONL file directly by filesystem path, creating it if missing. This is a JSONL file API only and cannot open a SQLite
|
|
553
|
+
- `SessionManager.open(store, sessionId, cwdOverride?, options?)`: open an existing session by exact ID in any `SessionStore` (required for SQLite and PostgreSQL sessions), raising `SessionNotFoundError` if missing. Defaults to `{ history: "tail" }`, loading from the latest compaction window; pass `{ history: "full" }` only when every stored entry must be loaded into memory. `continueRecent(store, cwd, options?)` and instance method `openSessionById()` share the same behavior.
|
|
554
|
+
- `SessionManager.open(path, sessionDir?, cwdOverride?, options?)`: open a JSONL file directly by filesystem path, creating it if missing. This is a JSONL file API only and cannot open a SQLite or PostgreSQL session ID.
|
|
555
555
|
- `SessionManager.continueRecent(cwd, sessionDir?, options?)` or `continueRecent(store, cwd, options?)`: continue the most recent regular session or create a new one. Pass `{ includeInternal: true }` to include internal sessions.
|
|
556
556
|
- `SessionManager.inMemory(cwd?, options?)`: create an empty memory-only session synchronously. To seed entries, await `SessionManager.inMemory(cwd, options, entries)` without mutating the supplied array until it resolves.
|
|
557
557
|
- `SessionManager.forkFrom(sourcePath, targetCwd, sessionDir?, options?)`: fork a JSONL file into the target store. For database sessions, open the session by ID and await `manager.forkTo(targetCwd, targetStore?, options?)`.
|