@bastani/atomic 0.10.11-alpha.2 → 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 +99 -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 +6 -6
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +5 -5
- package/dist/_shared/mode-shared-2QJSCUM6.js +6 -6
- 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 +3 -3
- package/dist/_shared/{sdk-IQMULKFU.js → sdk-B5LEWGGI.js} +340 -163
- package/dist/_shared/sdk-B5LEWGGI.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/{startup-0-0-3IXNMFM2.js → startup-0-0-EZUKEP4Q.js} +48 -40
- package/dist/_shared/startup-0-0-EZUKEP4Q.js.map +1 -0
- package/dist/_shared/{startup-0-1-7T2IAE7J.js → startup-0-1-RTOHJFDJ.js} +195 -42
- package/dist/_shared/startup-0-1-RTOHJFDJ.js.map +1 -0
- package/dist/_shared/startup-0-2-5QHPCEON.js +33 -43
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -1
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +5 -5
- package/dist/_shared/startup-0-4-ZMJV547D.js +12 -7
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
- package/dist/_shared/startup-0-5-YDW47QX6.js +7 -7
- package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +6 -6
- package/dist/_shared/startup-12-0-55AAXBJZ.js +2 -2
- package/dist/_shared/startup-14-0-MLX36RBG.js +4 -5
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
- package/dist/_shared/startup-15-1-4S7FLMNG.js +19 -27
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +39 -23
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-X32CYSXB.js → startup-8-1-LZFXSD3Z.js} +90 -1176
- package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +186 -35
- 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 +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +23 -0
- package/dist/builtin/intercom/README.md +2 -2
- package/dist/builtin/intercom/broker/broker.bundle.mjs +913 -289
- 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 +170 -74
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +298 -47
- 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 +136 -19
- 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/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 +4 -4
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.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 +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +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 +19 -113
- 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.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 +2 -2
- 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 +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +5 -5
- 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 +1 -1
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- 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/creation-time.js +105 -0
- package/dist/core/storage/creation-time.js.map +1 -0
- package/dist/core/storage/database.d.ts +19 -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 +3 -2
- 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 +78 -14
- package/dist/core/storage/migrations.js +375 -49
- 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 +8 -13
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.js +51 -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 +9 -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 +7 -8
- package/dist/core/storage/schema-catalog.js +8 -8
- 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 +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +3 -3
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +4 -7
- 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-window.code.js +3 -3
- 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 +5 -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.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 +3 -3
- 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 +48 -11
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/sqlite-facade.d.ts +6 -1
- package/dist/core/storage/sqlite-facade.js +1 -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 +3 -3
- 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 +4 -4
- 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-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 +40 -3
- package/dist/core/worktree-snapshot/blob-store.js +414 -21
- package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
- package/dist/core/worktree-snapshot/errors.code.js +2 -2
- 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 +79 -38
- package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -1
- 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 +1 -1
- 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 +5 -5
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/main.js +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/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 +6 -6
- 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 -4
- 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 -10
- 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 +2 -2
- 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 +29 -49
- 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} +66 -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 +326 -990
- 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-IQMULKFU.js.map +0 -1
- package/dist/_shared/startup-0-0-3IXNMFM2.js.map +0 -1
- package/dist/_shared/startup-0-1-7T2IAE7J.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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Set up teams and CI"
|
|
3
3
|
sidebarTitle: "Team and CI setup"
|
|
4
|
-
description: "Share Intercom across a team while keeping personal sessions local, and configure CI runners with environment variables."
|
|
4
|
+
description: "Share Intercom across a team through PostgreSQL while keeping personal sessions local, and configure CI runners with environment variables."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Share one
|
|
7
|
+
Share one PostgreSQL database across machines so teammates can message each other over Intercom while keeping their personal sessions local. CI runners can point both sessions and Intercom at the same database with one environment variable, so teammates can inspect and resume CI runs.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> Atomic 0.10.11 removed libSQL and Turso support, together with `atomic team join`, `atomic team leave`, and the `ATOMIC_PROFILE=ci` variables. To move sessions off libSQL, see [Moving off libSQL](/storage#moving-off-libsql).
|
|
10
10
|
|
|
11
11
|
| Scope | Sessions | Intercom |
|
|
12
12
|
| --- | --- | --- |
|
|
@@ -21,55 +21,45 @@ Run `atomic team status` to see the active profile:
|
|
|
21
21
|
- `ci`: sessions, Intercom, and shared `storage` all use the same shared adapter database (if you ran `atomic storage join` to share sessions across your own laptops, `atomic team status` also reports `ci`).
|
|
22
22
|
- `custom`: any other combination, such as JSONL sessions, a non-default local SQLite file, a project `storage` override, or different adapters or prefixes between sessions and Intercom.
|
|
23
23
|
|
|
24
|
-
## Join a team
|
|
25
|
-
|
|
26
|
-
Install the libSQL adapter once per machine, create a database token, and join:
|
|
27
|
-
|
|
28
24
|
```bash
|
|
29
|
-
atomic
|
|
30
|
-
|
|
31
|
-
atomic team join libsql://<db>.turso.io --token-file ~/team-token
|
|
25
|
+
atomic team status # Profile, project group, and storage report
|
|
26
|
+
atomic team status --json # JSON output
|
|
32
27
|
```
|
|
33
28
|
|
|
34
|
-
|
|
29
|
+
`atomic team status` exits `1` if the selection is invalid, the adapter fails to load, or the database does not answer.
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
atomic team join <url> [--token-file <path>] [--prefix <prefix>]
|
|
38
|
-
```
|
|
31
|
+
## Join a team
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
Set up the team's PostgreSQL database as described in [PostgreSQL](/storage/postgres), then on each machine install the adapter and join it:
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
```bash
|
|
36
|
+
atomic install npm:@bastani/atomic-storage-postgres
|
|
37
|
+
(umask 077; printf 'Runtime password: '; read -rs password; printf '\n'; printf '%s' "$password" > ~/atomic-db-password)
|
|
38
|
+
atomic storage join 'postgresql://atomic_runtime@db.example.com:5432/atomic?sslmode=verify-full' --password-file ~/atomic-db-password
|
|
39
|
+
rm ~/atomic-db-password # atomic storage join keeps its own copy
|
|
40
|
+
```
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
2. Updates `~/.atomic/agent/settings.json` atomically while leaving all other settings untouched: sets `storage` to the team database and pins `sessions.storage` to `{ "path": "workflows/journal.sqlite" }` so personal transcripts stay local (printing a notice if this replaces another store). Atomic also writes a `teamJoin` marker used by `atomic team leave`; leave it unchanged.
|
|
46
|
-
3. Restarts the Intercom broker so it routes through the team database.
|
|
47
|
-
4. Prints the active profile, the current project's Intercom group, and the `atomic storage status` report.
|
|
42
|
+
`atomic storage join` checks the URL, the password, the installed adapter, and a `SELECT 1` within 15 seconds before it writes anything, then sets the global `storage` setting to the team database. See [Joining a machine to a shared database](/storage#joining-a-machine-to-a-shared-database) for every option, including `--token-file`, `--auth azure|aws|gcp`, and `--prefix`.
|
|
48
43
|
|
|
49
|
-
|
|
44
|
+
To keep your personal sessions on this machine while Intercom uses the team database, add an empty `sessions.storage` selection to `~/.atomic/agent/settings.json`. It selects the default local SQLite file even though top-level `storage` is shared. Keep the `storage` value that `atomic storage join` wrote, including the name of its password file:
|
|
50
45
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"storage": { "adapter": "@bastani/atomic-storage-postgres", "options": { "url": "postgresql://atomic_runtime@db.example.com:5432/atomic?sslmode=verify-full" }, "secrets": { "password": { "file": "agent/storage-token.28ab7041-05e2-4ad5-80af-854329035d8c" } } },
|
|
49
|
+
"sessions": { "storage": {} }
|
|
50
|
+
}
|
|
51
|
+
```
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
Then restart the Intercom broker so it routes through the team database, and check the layout:
|
|
56
54
|
|
|
57
55
|
```bash
|
|
58
|
-
atomic
|
|
59
|
-
atomic team status
|
|
60
|
-
atomic team leave # Return to the individual layout
|
|
56
|
+
atomic intercom restart
|
|
57
|
+
atomic team status
|
|
61
58
|
```
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`atomic
|
|
66
|
-
|
|
67
|
-
- Removes `storage` and `teamJoin` only when `storage` still matches the `teamJoin` record. Any manual edit leaves `storage` and its token file intact and reports why.
|
|
68
|
-
- Keeps a `storage` entry that has no `teamJoin` record. Run `atomic team join` once to record it before leaving.
|
|
69
|
-
- Removes `sessions.storage` only while it holds the local pin and no other `storage` selection remains (including a customized `storage`, a trusted project's `storage`, or a legacy `~/.pi/agent/settings.json` `storage` when using the default agent directory).
|
|
70
|
-
- Deletes the managed token file only if no remaining setting references it, then restarts the Intercom broker.
|
|
71
|
-
- Refuses to modify settings or delete token files if global or project settings cannot be read. Fix the unreadable file first.
|
|
72
|
-
- Running `atomic team leave` again makes no changes.
|
|
60
|
+
- Pass `--prefix` to isolate multiple teams inside one database. Everyone on a team must use the same URL and prefix.
|
|
61
|
+
- Sessions that were already running keep their previous Intercom group until they restart or run `/reload`.
|
|
62
|
+
- To leave the team, remove `storage` and `sessions.storage` from `~/.atomic/agent/settings.json` and run `atomic intercom restart`. The password file that `atomic storage join` wrote, `storage-token.<id>` in the agent directory, can then be deleted.
|
|
73
63
|
|
|
74
64
|
## Project groups
|
|
75
65
|
|
|
@@ -81,26 +71,14 @@ For multi-node broker behavior, Git lookup errors, and routing checks, see [Runn
|
|
|
81
71
|
|
|
82
72
|
## CI and swarms
|
|
83
73
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
CI runners do not need a `settings.json` file. Configure them with environment variables:
|
|
74
|
+
CI runners do not need a `settings.json` file. Select the team database for the whole process with `ATOMIC_STORAGE`, and keep the password in an environment variable the selection names:
|
|
87
75
|
|
|
88
76
|
| Variable | Value |
|
|
89
77
|
| --- | --- |
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `ATOMIC_TEAM_TOKEN` or `ATOMIC_TEAM_TOKEN_FILE` | Database token, or an absolute path to a token file (such as under `$RUNNER_TEMP`). Omit only for an absolute `file:` URL. Relative paths are rejected at startup because child processes may run in different working directories. |
|
|
93
|
-
| `ATOMIC_TEAM_PREFIX` | Optional prefix matching the team's database prefix |
|
|
78
|
+
| `ATOMIC_STORAGE` | `{"adapter":"@bastani/atomic-storage-postgres","options":{"url":"<team database URL>"},"secrets":{"password":{"env":"ATOMIC_DB_PASSWORD"}}}`, plus `"prefix"` when the team uses one |
|
|
79
|
+
| `ATOMIC_DB_PASSWORD` | The database password, read when a store opens |
|
|
94
80
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Validation and precedence:
|
|
98
|
-
|
|
99
|
-
- Atomic validates these variables at startup before opening a session. Leaving **any** of `ATOMIC_TEAM_URL`, `ATOMIC_TEAM_TOKEN`, `ATOMIC_TEAM_TOKEN_FILE`, or `ATOMIC_TEAM_PREFIX` exported without `ATOMIC_PROFILE=ci` fails startup immediately (`incomplete-profile`), so unset them when not using the CI profile.
|
|
100
|
-
- Setting both `ATOMIC_TEAM_TOKEN` and `ATOMIC_TEAM_TOKEN_FILE` fails startup (`conflicting-token`). Empty string values (such as `ATOMIC_TEAM_PREFIX=""`) are treated as unset.
|
|
101
|
-
- Unknown profiles, invalid URLs or prefixes, and empty or unreadable token files fail immediately with one error listing everything missing.
|
|
102
|
-
- `--storage`, `--storage-file`, and `ATOMIC_STORAGE` override the profile for all stores, including Intercom. Session-specific flags and `ATOMIC_SESSIONS_STORAGE` override only sessions. See [Selecting storage per process](/storage#selecting-storage-per-process) for the full precedence order.
|
|
103
|
-
- If the libSQL adapter is not installed, startup fails with the `atomic install` command to run.
|
|
81
|
+
Both sessions and Intercom use the team database for this process and every child process it spawns. Atomic writes nothing to settings, and it reads the password only when opening a store, never copying it into settings, logs, or child storage selections. Atomic validates `ATOMIC_STORAGE` at startup, before it opens a session. See [Selecting storage per process](/storage#selecting-storage-per-process) for the precedence order.
|
|
104
82
|
|
|
105
83
|
### GitHub Actions
|
|
106
84
|
|
|
@@ -109,17 +87,16 @@ jobs:
|
|
|
109
87
|
agent:
|
|
110
88
|
runs-on: ubuntu-latest
|
|
111
89
|
env:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
ATOMIC_TEAM_TOKEN: ${{ secrets.ATOMIC_TEAM_TOKEN }}
|
|
90
|
+
ATOMIC_STORAGE: '{"adapter":"@bastani/atomic-storage-postgres","options":{"url":"${{ vars.ATOMIC_DB_URL }}"},"secrets":{"password":{"env":"ATOMIC_DB_PASSWORD"}}}'
|
|
91
|
+
ATOMIC_DB_PASSWORD: ${{ secrets.ATOMIC_DB_PASSWORD }}
|
|
115
92
|
steps:
|
|
116
93
|
- uses: actions/checkout@v5
|
|
117
94
|
- run: npm install -g @bastani/atomic
|
|
118
|
-
- run: atomic install npm:@bastani/atomic-storage-
|
|
95
|
+
- run: atomic install npm:@bastani/atomic-storage-postgres
|
|
119
96
|
- run: atomic -p "Fix the failing test in the checkout"
|
|
120
97
|
```
|
|
121
98
|
|
|
122
|
-
Store the
|
|
99
|
+
Store the password in an encrypted secret and expose it only to the step that needs it. Every tool the agent runs in that step inherits the step's environment. On Azure, AWS, or Google Cloud, `"options": { "auth": "azure-entra" }` (or `aws-iam`, `gcp-iam`) signs in with the runner's identity instead of a password. See [PostgreSQL](/storage/postgres).
|
|
123
100
|
|
|
124
101
|
### Caching between runs
|
|
125
102
|
|
|
@@ -204,31 +181,23 @@ When the agent job resumes a session, Atomic fetches only the commits missing fr
|
|
|
204
181
|
|
|
205
182
|
## From the SDK
|
|
206
183
|
|
|
207
|
-
`@bastani/atomic/storage` exports
|
|
208
|
-
|
|
209
|
-
`teamProfileSelection()` returns an adapter selection for `@bastani/atomic-storage-libsql`. Because adapter selections resolve from user-scope packages, host extension directories, or the agent directory rather than an application's `node_modules`, install the adapter with `atomic install npm:@bastani/atomic-storage-libsql` (without `-l`), or register a local package directory with `DefaultResourceLoader({ additionalExtensionPaths })`.
|
|
210
|
-
|
|
211
|
-
If you prefer managing `@bastani/atomic-storage-libsql` as an ordinary project dependency with `npm install`, call `openLibsqlDatabase()` directly and pass `sessionStore: { kind: "database", database, prefix? }` to `createAgentSession()`, closing `database` in a `finally` block. See [SDK session storage](/sdk/storage) for complete recipes and ownership rules.
|
|
212
|
-
|
|
213
|
-
Use `teamProfileSelection({ profile: "ci", url, token })` to pass a storage selection to `createAgentSession({ storage })` without modifying settings:
|
|
214
|
-
|
|
215
|
-
- `token` stays in memory, serializes as `[redacted]`, and cannot be reopened by child processes.
|
|
216
|
-
- `tokenEnv` stores `{ env: "<VAR>" }` so child processes can reopen the store, and checks immediately at call time that the named environment variable is set (throwing `missing-token` if unset).
|
|
217
|
-
- `tokenFile` resolves relative paths against `cwd` and reads the file immediately to verify it is non-empty.
|
|
218
|
-
|
|
219
|
-
Intercom runs one broker per agent directory, so pass the CI environment variables to both the host process and any spawned `atomic` processes:
|
|
184
|
+
`@bastani/atomic/storage` exports `getTeamProfile()`, which reports the layout in effect the way `atomic team status` does. To give an embedded agent the team database, pass a storage selection to `createAgentSession({ storage })` and keep the password in memory with `inMemorySecret()`:
|
|
220
185
|
|
|
221
186
|
```typescript
|
|
222
187
|
import { spawn } from "node:child_process";
|
|
223
188
|
import { createAgentSession } from "@bastani/atomic";
|
|
224
|
-
import {
|
|
189
|
+
import { inMemorySecret } from "@bastani/atomic/storage";
|
|
225
190
|
|
|
226
191
|
const url = process.env.TEAM_DATABASE_URL!;
|
|
227
|
-
const
|
|
192
|
+
const password = process.env.TEAM_DATABASE_PASSWORD!;
|
|
228
193
|
|
|
229
|
-
// Embedded SDK agent: sessions use the team database (requires `atomic install npm:@bastani/atomic-storage-
|
|
194
|
+
// Embedded SDK agent: sessions use the team database (requires `atomic install npm:@bastani/atomic-storage-postgres`
|
|
230
195
|
// or `DefaultResourceLoader({ additionalExtensionPaths })`).
|
|
231
|
-
const storage =
|
|
196
|
+
const storage = {
|
|
197
|
+
adapter: "@bastani/atomic-storage-postgres",
|
|
198
|
+
options: { url },
|
|
199
|
+
secrets: { password: inMemorySecret(password) },
|
|
200
|
+
};
|
|
232
201
|
const { session } = await createAgentSession({ storage });
|
|
233
202
|
try {
|
|
234
203
|
await session.prompt("Summarize the failing tests");
|
|
@@ -238,25 +207,29 @@ try {
|
|
|
238
207
|
|
|
239
208
|
// Spawned agent process: sessions and Intercom both use the team database.
|
|
240
209
|
const child = spawn("atomic", ["-p", "Fix the failing test"], {
|
|
241
|
-
env: {
|
|
210
|
+
env: {
|
|
211
|
+
...process.env,
|
|
212
|
+
ATOMIC_STORAGE: JSON.stringify({ adapter: "@bastani/atomic-storage-postgres", options: { url }, secrets: { password: { env: "ATOMIC_DB_PASSWORD" } } }),
|
|
213
|
+
ATOMIC_DB_PASSWORD: password,
|
|
214
|
+
},
|
|
242
215
|
stdio: "inherit",
|
|
243
216
|
});
|
|
244
217
|
```
|
|
245
218
|
|
|
246
|
-
See [Team setup errors](/storage#team-setup-errors) for the typed errors
|
|
219
|
+
An in-memory password serializes as `[redacted]`, so child processes cannot reopen the store with it: give them an `{ "env": "<VAR>" }` reference instead, as above. See [SDK session storage](/sdk/storage) for complete recipes and ownership rules, and [Team setup errors](/storage#team-setup-errors) for the typed errors.
|
|
247
220
|
|
|
248
221
|
## Security
|
|
249
222
|
|
|
250
223
|
Anyone with read access to the team database can read everything stored in it, including CI sessions and Intercom messages until shortly after delivery.
|
|
251
224
|
|
|
252
|
-
- Give each team its own database and treat database access as full read access.
|
|
253
|
-
-
|
|
254
|
-
- In the team
|
|
225
|
+
- Give each team its own database, or its own prefix, and treat database access as full read access.
|
|
226
|
+
- Give machines and CI runners a runtime role with only the privileges Atomic needs, rotate its password when someone leaves, and prefer platform identities (`--auth`) where your cloud supports them. See [PostgreSQL](/storage/postgres).
|
|
227
|
+
- In the team layout, personal sessions stay off the shared database only because `sessions.storage` selects the local store. Share sessions intentionally with `/share` or `atomic storage export` and `atomic storage import`.
|
|
255
228
|
|
|
256
229
|
## Related
|
|
257
230
|
|
|
258
|
-
- [Storage
|
|
259
|
-
- [SDK session storage](/sdk/storage) for Node.js and TypeScript storage recipes
|
|
231
|
+
- [Storage](/storage) for storage setup, selections, precedence, and error reference.
|
|
232
|
+
- [SDK session storage](/sdk/storage) for Node.js and TypeScript storage recipes and store ownership rules.
|
|
260
233
|
- [Resume sessions on any machine](/guides/resume-on-any-machine) for cross-machine worktree snapshots and environment blueprints.
|
|
261
234
|
- [Running Intercom across machines](/intercom/operations#running-intercom-across-machines) for multi-node broker details.
|
|
262
235
|
- [Intercom groups](/intercom/reference#groups) for how groups isolate sessions.
|
package/docs/guides.md
CHANGED
|
@@ -14,7 +14,7 @@ New to Atomic? Follow the [Quickstart](/quickstart) to install, authenticate, ru
|
|
|
14
14
|
- **[Sessions](/sessions).** Save, resume, name, search, and branch sessions.
|
|
15
15
|
- **[Worktree snapshots](/worktree-snapshots).** Capture and restore repository state alongside your session history.
|
|
16
16
|
- **[Resume on any machine and blueprints](/guides/resume-on-any-machine).** Continue a session on another machine that shares your storage, and automate dependency rebuilds with [`.atomic/blueprint.yaml` blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint).
|
|
17
|
-
- **[Storage
|
|
17
|
+
- **[Storage](/storage).** Choose where sessions are kept: a [local SQLite](/storage/sqlite) file, [JSONL files](/storage/jsonl), or a [PostgreSQL](/storage/postgres) database that several machines share. Move sessions between stores with export and import. To run many agents on PostgreSQL, see [PgBouncer](/storage/postgres/pgbouncer) and [server tuning](/storage/postgres/tuning). For apps built on the SDK, see [SDK session storage](/sdk/storage).
|
|
18
18
|
- **[Context and compaction](/compaction).** Keep long sessions inside the model's context window, or plug in a [custom remote compactor](/compaction#customize-morph-or-add-a-remote-compactor).
|
|
19
19
|
- **[MCP servers](/mcp-servers).** Connect external tools and data sources over Model Context Protocol.
|
|
20
20
|
|
|
@@ -24,9 +24,7 @@ New to Atomic? Follow the [Quickstart](/quickstart) to install, authenticate, ru
|
|
|
24
24
|
- **[Subagents](/guides/subagents).** Delegate independent tasks to fresh or forked subagents in the background (see the full [Subagents guide](/subagents)).
|
|
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
|
-
- **[Team and CI setup](/guides/team-setup).** Share Intercom with a team through one database while sessions stay private, and configure CI runners
|
|
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.
|
|
27
|
+
- **[Team and CI setup](/guides/team-setup).** Share Intercom with a team through one PostgreSQL database while sessions stay private, and configure CI runners.
|
|
30
28
|
- **[Structured decisions](/sdk/structured-decisions).** Make typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
|
|
31
29
|
- **[Computer use](/computer-use).** Automate desktop apps, browsers, and terminals across macOS, Linux, and Windows.
|
|
32
30
|
- **[Verification](/verification).** Reproduce bugs and collect verifiable evidence across terminal, browser, and desktop environments.
|
package/docs/herdr.md
CHANGED
|
@@ -36,7 +36,7 @@ With Herdr 0.9.2 or newer, Atomic also reports a resume command so Herdr can reo
|
|
|
36
36
|
|
|
37
37
|
- **Local SQLite sessions (default):** Atomic reports `atomic --session-store <path> --session <id>` (plus `--session-prefix <prefix>` when a table prefix is configured).
|
|
38
38
|
- **JSONL directory sessions:** Atomic reports `atomic --session-dir <dir> --session <id>`. Session IDs ending in `.jsonl` still use `--session <id>`.
|
|
39
|
-
- **Other persisted stores (such as
|
|
39
|
+
- **Other persisted stores (such as PostgreSQL):** Atomic reports `atomic --session <id>`.
|
|
40
40
|
- **Switching sessions:** Running `/new`, `/resume`, `/fork`, or `/clone` updates the pane to the new session's ID and resume command.
|
|
41
41
|
- **Unsaved sessions:** Sessions started with `--no-session` report status without a resume command. For a brand-new persisted session, Atomic reports the resume command right away, though reopening succeeds only after the session's first entry is saved to storage.
|
|
42
42
|
- **Quit vs. stop signals:** Quitting Atomic yourself (`Ctrl+D`, `Ctrl+C` twice, `/quit`, or `/exit`) clears the resume command so Herdr does not reopen the pane. When Herdr or the OS stops Atomic with `SIGTERM`, `SIGHUP`, or a Windows console close or sign-out, the resume command stays registered for restore.
|
package/docs/index.md
CHANGED
|
@@ -51,7 +51,7 @@ Authenticate with `/login`, run `atomic auth login <provider>` in your shell, or
|
|
|
51
51
|
|
|
52
52
|
## Explore by capability
|
|
53
53
|
|
|
54
|
-
- **Sessions, snapshots, and resume:** Save and branch in [Sessions](/sessions), capture repository state with [Worktree snapshots](/worktree-snapshots), resume across machines with [Environment blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint), and share state over PostgreSQL
|
|
54
|
+
- **Sessions, snapshots, and resume:** Save and branch in [Sessions](/sessions), capture repository state with [Worktree snapshots](/worktree-snapshots), resume across machines with [Environment blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint), and share state over PostgreSQL in [Storage](/storage).
|
|
55
55
|
- **Multi-agent work:** Delegate focused tasks with [Subagents](/subagents), coordinate live sessions with [Intercom](/intercom), and script multi-step checks with [Orchestration](/orchestration).
|
|
56
56
|
- **Tools and context:** Connect external tools through [MCP servers](/mcp-servers), keep long runs within budget with [Compaction and custom compactors](/compaction#customize-morph-or-add-a-remote-compactor), and inspect terminal integrations like [Herdr](/herdr).
|
|
57
57
|
- **Embed and extend:** Drive Atomic from Node.js with the [TypeScript SDK](/sdk), [SDK storage backends](/sdk/storage), [Structured decisions (`decide()`)](/sdk/structured-decisions), [RPC mode](/rpc), and [Standalone libraries](/libraries).
|
|
@@ -120,35 +120,40 @@ By default, each machine's broker serves only sessions on that machine. With mul
|
|
|
120
120
|
|
|
121
121
|
### Turning it on
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
Point every machine at the same [PostgreSQL](/storage/postgres) database, with the same `prefix`:
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
1. Set up the database once, as in [Set up the database](/storage/postgres#set-up-the-database). With a prefix, as below, pass the same `--prefix` to `atomic storage migrate`.
|
|
126
|
+
2. On every machine, install the PostgreSQL adapter, save the runtime role's password in a file, join the database, and restart the broker:
|
|
126
127
|
|
|
127
|
-
```bash
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
atomic storage join
|
|
131
|
-
atomic
|
|
128
|
+
```bash
|
|
129
|
+
atomic install npm:@bastani/atomic-storage-postgres
|
|
130
|
+
(umask 077; printf 'Runtime password: '; read -rs password; printf '\n'; printf '%s' "$password" > ~/atomic-db-password)
|
|
131
|
+
atomic storage join 'postgresql://atomic_runtime@db.example.com:5432/atomic' --password-file ~/atomic-db-password --prefix team_
|
|
132
|
+
rm ~/atomic-db-password # atomic storage join keeps its own copy
|
|
133
|
+
atomic intercom restart
|
|
134
|
+
```
|
|
132
135
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
`atomic storage join` sets the top-level `storage` setting, which shares sessions too. To share Intercom but keep each machine's sessions local, as [Team and CI setup](/guides/team-setup) describes, also set `sessions.storage` to `{}` in `~/.atomic/agent/settings.json`, which keeps sessions in the default local SQLite file:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{ "sessions": { "storage": {} } }
|
|
137
140
|
```
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) and [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for every option. Any database-backed [custom adapter](/storage/custom-adapters#selecting-an-adapter) works too, if every machine uses the same `storage` setting and `prefix`. Both npm installs and standalone binaries support multi-node routing.
|
|
143
|
+
|
|
144
|
+
The broker takes its store from:
|
|
140
145
|
|
|
141
|
-
The
|
|
146
|
+
1. The process that starts it: `--storage`, `--storage-file`, or `ATOMIC_STORAGE`. See [Selecting storage per process](/storage#selecting-storage-per-process).
|
|
147
|
+
2. Otherwise, the top-level `storage` setting in `~/.atomic/agent/settings.json`, or in the agent directory that `ATOMIC_CODING_AGENT_DIR` names.
|
|
142
148
|
|
|
143
|
-
|
|
144
|
-
2. Otherwise, the top-level `storage` block in `~/.atomic/agent/settings.json` (or under `ATOMIC_CODING_AGENT_DIR`).
|
|
149
|
+
For example, a setting that reads the password from an environment variable:
|
|
145
150
|
|
|
146
151
|
```json
|
|
147
152
|
{
|
|
148
153
|
"storage": {
|
|
149
|
-
"adapter": "@bastani/atomic-storage-
|
|
150
|
-
"options": { "url": "
|
|
151
|
-
"secrets": { "
|
|
154
|
+
"adapter": "@bastani/atomic-storage-postgres",
|
|
155
|
+
"options": { "url": "postgresql://atomic_runtime@db.example.com:5432/atomic" },
|
|
156
|
+
"secrets": { "password": { "env": "ATOMIC_DB_PASSWORD" } },
|
|
152
157
|
"prefix": "team_"
|
|
153
158
|
}
|
|
154
159
|
}
|
|
@@ -177,7 +182,7 @@ How the project group name is derived:
|
|
|
177
182
|
|
|
178
183
|
Explicit groups take precedence over the project group: an inherited subagent group, an SDK host policy, `ATOMIC_INTERCOM_GROUP`, or `group` in `config.json`. Joining `default` explicitly while multi-node routing is on prints a warning (in the UI or once on stderr for non-interactive runs) because every teammate sharing the database can message `default`. Running sessions keep their current group until restarted or reloaded.
|
|
179
184
|
|
|
180
|
-
Before registering, each session
|
|
185
|
+
Before registering, each session checks the running broker's routing mode, so a session never joins `default` on a multi-node broker by accident, or runs locally when it asked for shared storage. If the running broker's store differs from the session's, for example after you change `storage`, run `atomic intercom restart` and restart the session. For `ProjectGroupError` and the `IntercomRouting*Error` classes (`IntercomRoutingMismatchError`, `IntercomRoutingUnavailableError`, `IntercomRoutingTimeoutError`, `IntercomRoutingChangedError`), see [Routing and project-group errors](/intercom/reference#routing-and-project-group-errors).
|
|
181
186
|
|
|
182
187
|
### What works across machines
|
|
183
188
|
|
|
@@ -193,7 +198,7 @@ If a local session and a remote session share the same name, name lookup prefers
|
|
|
193
198
|
|
|
194
199
|
### Latency
|
|
195
200
|
|
|
196
|
-
|
|
201
|
+
On PostgreSQL, the database notifies the receiving broker of a new message at once, so a cross-machine message usually arrives within a few database round trips. The `delivered` confirmation takes about as long. Brokers also check for missed messages every 5 seconds. When notifications are not available, for example behind a transaction pooler without `listenUrl`, brokers check the database every half second instead. See [Wake-ups](/storage/postgres#wake-ups). With a custom adapter, brokers check every half second. A backup check every 30 seconds recovers anything else.
|
|
197
202
|
|
|
198
203
|
A sender waits about 8 seconds for a live recipient to confirm saving a message. A recipient actively saving reports progress to extend that wait up to 2 minutes, and a claimed remote delivery gets one extra 8-second window (about 16 seconds total) before reporting an uncertain outcome. The message is still delivered once; check with the recipient before resending.
|
|
199
204
|
|
|
@@ -214,7 +219,7 @@ When a machine or broker stops abruptly, its sessions still look connected for u
|
|
|
214
219
|
|
|
215
220
|
### Data and security
|
|
216
221
|
|
|
217
|
-
- **Retention.** Cross-machine message text, attachments, and sender metadata stay in the shared database until delivered, and delivered rows are pruned
|
|
222
|
+
- **Retention.** Cross-machine message text, attachments, and sender metadata stay in the shared database until delivered, and delivered rows are pruned 12 to 17 minutes later to protect against duplicate retries. Offline messages stay until delivered or expired after 7 days. One broker at a time does this cleanup, every 5 minutes; if it stops, another broker takes over within about 15 minutes. Session names, IDs, and group memberships are stored for discovery and routing.
|
|
218
223
|
- **Database access.** Anyone who can read the shared database can read cross-machine Intercom messages. Keep credentials in `secrets` (`{ "env": ... }` or `{ "file": ... }`) rather than plain `options`, and use project groups rather than `default` so teammates in other repositories cannot inject prompts into your sessions.
|
|
219
224
|
- **No open ports.** Intercom opens no network listeners or broker-to-broker sockets. Cross-machine security matches the shared database's authentication and transport security.
|
|
220
225
|
|
|
@@ -61,7 +61,7 @@ Ambiguous prefixes list only authorized candidates and require the full UUID. Is
|
|
|
61
61
|
|
|
62
62
|
Reopened sessions and restored background subagents reclaim their previous Intercom session ID so peers can keep using the ID printed by `intercom list`. The session persists this ID as an `intercom_session_identity` entry. While a live session holds an ID, another registration receives a fresh ID instead; once released, only that same Atomic session can reclaim it while the broker remembers its previous holder.
|
|
63
63
|
|
|
64
|
-
With [multi-node routing](/intercom/operations#running-intercom-across-machines), session ID reclaim works across machines once the shared database has the current schema (on [PostgreSQL
|
|
64
|
+
With [multi-node routing](/intercom/operations#running-intercom-across-machines), session ID reclaim works across machines once the shared database has the current schema (on [PostgreSQL](/storage/postgres), run `atomic storage migrate` as the schema owner role):
|
|
65
65
|
|
|
66
66
|
- A session that disconnects cleanly reclaims its ID immediately on any machine.
|
|
67
67
|
- A session whose broker crashed reclaims its ID immediately on the same machine, or on another machine after the crashed broker's 30-second lease expires (until then it receives a fresh ID and automatically rebinds once the lease lapses).
|
|
@@ -398,7 +398,7 @@ Exported from `@bastani/atomic` with `isProjectGroupError()`, `isIntercomRouting
|
|
|
398
398
|
| Class | `code` | When it happens | Fields | What to do |
|
|
399
399
|
| --- | --- | --- | --- | --- |
|
|
400
400
|
| `ProjectGroupError` | `git-unavailable` or `git-failed` | Multi-node routing tried to derive `project:<path>` inside a Git repository, but `git` is missing or failed. Not retried in the background. | `cwd`, `detail`, `hint` | Install Git, fix the repository error, or set `ATOMIC_INTERCOM_GROUP` to skip the lookup. |
|
|
401
|
-
| `IntercomRoutingMismatchError` | `broker-routing-mismatch` | The broker routes across machines while the session joined implicitly as `default` (`reason: "implicit-default-on-remote-broker"`), or the session selected shared storage (`storage`
|
|
401
|
+
| `IntercomRoutingMismatchError` | `broker-routing-mismatch` | The broker routes across machines while the session joined implicitly as `default` (`reason: "implicit-default-on-remote-broker"`), or the session selected shared storage (`storage`) while the running broker started without it (`reason: "shared-storage-not-on-broker"`). Terminal until session restart. | `reason`, `group`, `hint`, `retryable: false` | Run `atomic intercom restart` (if the broker lacks shared storage), then restart the session or set `ATOMIC_INTERCOM_GROUP`. |
|
|
402
402
|
| `IntercomRoutingUnavailableError` | `broker-routing-unavailable` | The broker closed status without answering (`reason: "unsupported"`), sent an unreadable report (`"malformed"`), or is an older broker that could not be replaced while multi-node storage is active. | `reason`, `phase`, `hint`, `retryable: true`, optional `cause` | Run `atomic intercom restart` to replace the broker. |
|
|
403
403
|
| `IntercomRoutingTimeoutError` | `broker-routing-timeout` | The broker accepted the routing status check but did not answer in time. | `timeoutMs`, `elapsedMs`, `phase`, `hint`, `retryable: true` | Wait for reconnect backoff, or run `atomic intercom restart` if it persists. |
|
|
404
404
|
| `IntercomRoutingChangedError` | `broker-routing-changed` | The broker's routing mode changed between the session's status check and registration, so registration was refused. | `expectedAcrossMachines`, `hint`, `retryable: true` | Wait for automatic retry, or run `atomic intercom restart` if it persists. |
|
package/docs/intercom.md
CHANGED
|
@@ -323,7 +323,7 @@ Use Intercom for coordinating your own sessions and for peer-to-peer agent swarm
|
|
|
323
323
|
|
|
324
324
|
- [Operate Intercom](/intercom/operations) for broker lifecycles, upgrades, recovery, and multi-machine routing.
|
|
325
325
|
- [Intercom reference](/intercom/reference) for tool parameters, targeting rules, reach policies, and error classes.
|
|
326
|
-
- [Sharing storage across hosts](/storage#sharing-storage-across-hosts) and [Set up teams and CI](/guides/team-setup) for shared PostgreSQL
|
|
326
|
+
- [Sharing storage across hosts](/storage#sharing-storage-across-hosts) and [Set up teams and CI](/guides/team-setup) for a shared PostgreSQL database.
|
|
327
327
|
- [Intercom group and reach in the SDK](/sdk#intercom-group-and-reach) and [SDK tools](/sdk/reference#tools) for programmatic Intercom policies and `builtins.intercom`.
|
|
328
328
|
- [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for `atomic intercom` and `atomic storage` subcommands.
|
|
329
329
|
- [Run subagents](/subagents) for delegated subagent runs, supervisor coordination, and result delivery.
|
|
@@ -6,10 +6,10 @@ description: "PostgreSQL storage adapter for Atomic sessions and Intercom multi-
|
|
|
6
6
|
|
|
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
|
-
- **PostgreSQL version requirement:** Atomic
|
|
9
|
+
- **PostgreSQL version requirement:** Atomic needs **PostgreSQL 16 or newer**.
|
|
10
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
|
-
For operator setup, role creation SQL, migrations, and troubleshooting, see [PostgreSQL setup](/storage
|
|
12
|
+
For operator setup, role creation SQL, migrations, and troubleshooting, see [PostgreSQL setup](/storage/postgres). For all five SDK storage backends and `createAgentSessionRuntime()`, see [SDK storage backends](/sdk/storage).
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ If you use [cloud IAM authentication](#cloud-iam-authentication), also install t
|
|
|
27
27
|
|
|
28
28
|
## SDK quick start
|
|
29
29
|
|
|
30
|
-
Create your database roles and run `atomic storage migrate` as the owner role first (see [Set up the database](/storage#set-up-the-database)), then connect from your Node.js application with `openPostgresDatabase()`:
|
|
30
|
+
Create your database roles and run `atomic storage migrate` as the owner role first (see [Set up the database](/storage/postgres#set-up-the-database)), then connect from your Node.js application with `openPostgresDatabase()`:
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
33
|
import { readFile } from "node:fs/promises";
|
|
@@ -64,7 +64,7 @@ Pass the returned `SqliteDatabase` to `createAgentSession({ sessionStore: { kind
|
|
|
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
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`) | 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.
|
|
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. To size it, see [Tuning for many concurrent agents](/storage/postgres#tuning-for-many-concurrent-agents). |
|
|
68
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
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
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. |
|
|
@@ -96,13 +96,13 @@ On Azure, AWS, and Google Cloud, set `auth` and omit `password` / `secrets.passw
|
|
|
96
96
|
| `aws-iam` | `@aws-sdk/rds-signer` | `atomic install npm:@aws-sdk/rds-signer@3.1169.0` | RDS `Signer` using the AWS default credential chain (`AWS_*`, profiles, IRSA, instance profile) |
|
|
97
97
|
| `gcp-iam` | `google-auth-library` | `atomic install npm:google-auth-library@11.3.4` | `GoogleAuth` for `https://www.googleapis.com/auth/sqlservice.login` (ADC, GKE/GCE/Cloud Run metadata) |
|
|
98
98
|
|
|
99
|
-
For Azure Database for PostgreSQL Flexible Server (PostgreSQL 16+), Azure HorizonDB (PostgreSQL 17, read/write endpoint), Amazon RDS/Aurora, and Google Cloud SQL role-grant SQL, see [PostgreSQL setup](/storage#azure) and [Cloud identities](/storage#cloud-identities).
|
|
99
|
+
For Azure Database for PostgreSQL Flexible Server (PostgreSQL 16+), Azure HorizonDB (PostgreSQL 17, read/write endpoint), Amazon RDS/Aurora, and Google Cloud SQL role-grant SQL, see [PostgreSQL setup](/storage/postgres#azure) and [Cloud identities](/storage/postgres#cloud-identities).
|
|
100
100
|
|
|
101
101
|
## TLS, HTTP proxies, and connection poolers
|
|
102
102
|
|
|
103
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.
|
|
104
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.
|
|
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](/
|
|
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](/storage/postgres/pgbouncer).
|
|
106
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.
|
|
107
107
|
|
|
108
108
|
## CLI configuration
|
|
@@ -110,15 +110,15 @@ For Azure Database for PostgreSQL Flexible Server (PostgreSQL 16+), Azure Horizo
|
|
|
110
110
|
Join a machine with the CLI after installing in user scope and running `atomic storage migrate`:
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
printf '%s' "$
|
|
114
|
-
chmod 600 ~/atomic-db-password
|
|
113
|
+
(umask 077; printf 'Runtime password: '; read -rs password; printf '\n'; printf '%s' "$password" > ~/atomic-db-password)
|
|
115
114
|
atomic storage join 'postgresql://atomic_runtime@db.example.com:5432/atomic' --password-file ~/atomic-db-password
|
|
115
|
+
rm ~/atomic-db-password # atomic storage join keeps its own copy
|
|
116
116
|
atomic intercom restart
|
|
117
117
|
atomic storage status
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
## Related docs
|
|
121
121
|
|
|
122
|
-
- [PostgreSQL operator guide](/storage
|
|
122
|
+
- [PostgreSQL operator guide](/storage/postgres): role creation SQL, migrations, Azure/RDS/Cloud SQL setup, and troubleshooting.
|
|
123
123
|
- [SDK storage backends](/sdk/storage): complete `createAgentSession()`, `createAgentSessionRuntime()`, and error-handling recipes.
|
|
124
124
|
- [Standalone libraries](/libraries): all published `@bastani/atomic-*` packages.
|
package/docs/libraries.md
CHANGED
|
@@ -21,14 +21,13 @@ The six core libraries are bundled inside `@bastani/atomic` and provided to exte
|
|
|
21
21
|
|
|
22
22
|
## Storage adapter packages
|
|
23
23
|
|
|
24
|
-
Remote SQL storage adapters are **not** bundled into `@bastani/atomic` and must be installed separately when you use PostgreSQL
|
|
24
|
+
Remote SQL storage adapters are **not** bundled into `@bastani/atomic` and must be installed separately when you use PostgreSQL:
|
|
25
25
|
|
|
26
26
|
| Package | What it does |
|
|
27
27
|
| --- | --- |
|
|
28
28
|
| [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) | PostgreSQL 16+ storage adapter (`openPostgresDatabase()`, cloud IAM, proxies, poolers) for shared sessions and Intercom |
|
|
29
|
-
| [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) | libSQL and Turso storage adapter (`openLibsqlDatabase()`, namespaces, WAL/sqld retries) for shared sessions and Intercom |
|
|
30
29
|
|
|
31
|
-
For CLI usage, install storage adapters in user scope with `atomic install npm:@bastani/atomic-storage-postgres
|
|
30
|
+
For CLI usage, install storage adapters in user scope with `atomic install npm:@bastani/atomic-storage-postgres`. For TypeScript SDK applications, install them with `npm install` alongside `@bastani/atomic` (see [SDK storage backends](/sdk/storage)).
|
|
32
31
|
|
|
33
32
|
> **Native bindings:** `@bastani/atomic-natives` is an internal N-API native module installed automatically as a runtime dependency of `@bastani/atomic` (with per-platform binary packages in its `optionalDependencies`) and is not intended as a standalone user library.
|
|
34
33
|
|
|
@@ -55,7 +55,7 @@ Each `models` entry adds a model to the provider. An entry whose `id` matches an
|
|
|
55
55
|
| `cost.tiers[].cacheWrite` | number | | Required. Cache-write cost in USD per million tokens. |
|
|
56
56
|
| `promptCache` | object | | Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Atomic warms only tiers with a known lifetime. |
|
|
57
57
|
| `contextWindow` | number | `128000` | Context window in tokens. Applies only to chat models. |
|
|
58
|
-
| `maxTokens` | number | `16384` | Maximum output tokens. Defaults to 16384 for chat models.
|
|
58
|
+
| `maxTokens` | number | `16384` | Maximum output tokens. Defaults to 16384 for chat models. On compactor models it has no default: when set, compacted output longer than this many estimated tokens clears the context instead; when omitted, output has no size limit. |
|
|
59
59
|
| `timeoutMs` | number | | Wall-clock timeout in milliseconds for one compactor request (default 120000). Applies only to compactor models. |
|
|
60
60
|
| `samplingParams` | object | | Fields merged into every request body. Applies only to OpenAI-compatible APIs. |
|
|
61
61
|
| `samplingParamsByThinkingLevel` | object | | samplingParams per thinking level, merged over samplingParams. |
|
|
@@ -89,7 +89,7 @@ Each `modelOverrides` key is the ID of a built-in or extension model. Unknown ID
|
|
|
89
89
|
| `cost.tiers[].cacheWrite` | number | | Required. Cache-write cost in USD per million tokens. |
|
|
90
90
|
| `promptCache` | object | | Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Atomic warms only tiers with a known lifetime. |
|
|
91
91
|
| `contextWindow` | number | | Context window in tokens. Applies only to chat models. |
|
|
92
|
-
| `maxTokens` | number | | Maximum output tokens. On compactor models,
|
|
92
|
+
| `maxTokens` | number | | Maximum output tokens. On compactor models, compacted output longer than this many estimated tokens clears the context instead; omit it for no size limit. |
|
|
93
93
|
| `timeoutMs` | number | | Wall-clock timeout in milliseconds for one compactor request (default 120000). Applies only to compactor models. |
|
|
94
94
|
| `samplingParams` | object | | Fields merged into every request body. Applies only to OpenAI-compatible APIs. |
|
|
95
95
|
| `samplingParamsByThinkingLevel` | object | | samplingParams per thinking level, merged over samplingParams. |
|
package/docs/models.md
CHANGED
|
@@ -172,8 +172,7 @@ Add a custom remote compaction endpoint by setting `"type": "compactor"` on a mo
|
|
|
172
172
|
"target_ratio": 0.4,
|
|
173
173
|
"preserve_recent": 2
|
|
174
174
|
},
|
|
175
|
-
"timeoutMs": 180000
|
|
176
|
-
"maxTokens": 48000
|
|
175
|
+
"timeoutMs": 180000
|
|
177
176
|
}
|
|
178
177
|
]
|
|
179
178
|
}
|
|
@@ -181,7 +180,7 @@ Add a custom remote compaction endpoint by setting `"type": "compactor"` on a mo
|
|
|
181
180
|
}
|
|
182
181
|
```
|
|
183
182
|
|
|
184
|
-
Every custom compactor requires `"api"` at the provider or model level (just like custom chat models; built-in Morph defines its own `"api": "morph-compact"`). Atomic sends `{ messages, query, model }` plus any keys in `compactionParams` (omitting `compactionParams` lets the remote API use its own defaults). See [Customize Morph or add a remote compactor](/compaction#customize-morph-or-add-a-remote-compactor) and [Compaction reference](/compaction/reference#compactor-request-contract).
|
|
183
|
+
Every custom compactor requires `"api"` at the provider or model level (just like custom chat models; built-in Morph defines its own `"api": "morph-compact"`). Atomic sends `{ messages, query, model }` plus any keys in `compactionParams` (omitting `compactionParams` lets the remote API use its own defaults). A compactor's output has no built-in size limit; set `maxTokens` on the compactor model to reject output longer than that many estimated tokens, or use the endpoint's own size option in `compactionParams` to ask for shorter output. See [Customize Morph or add a remote compactor](/compaction#customize-morph-or-add-a-remote-compactor) and [Compaction reference](/compaction/reference#compactor-request-contract).
|
|
185
184
|
|
|
186
185
|
## Use classifier models
|
|
187
186
|
|
|
@@ -99,20 +99,20 @@ Contribute [MCP servers](/mcp-servers) via `mcpServers` in the manifest (manifes
|
|
|
99
99
|
|
|
100
100
|
## Storage adapters
|
|
101
101
|
|
|
102
|
-
Expose [storage adapters](/storage#selecting-an-adapter) via `storageAdapters` (manifest-only, paths relative to the package root). Put database drivers in `dependencies` and `@bastani/atomic` in `peerDependencies`:
|
|
102
|
+
Expose [storage adapters](/storage/custom-adapters#selecting-an-adapter) via `storageAdapters` (manifest-only, paths relative to the package root). Put database drivers in `dependencies` and `@bastani/atomic` in `peerDependencies`:
|
|
103
103
|
|
|
104
104
|
```json
|
|
105
105
|
{
|
|
106
|
-
"name": "@example/atomic-
|
|
107
|
-
"dependencies": { "
|
|
106
|
+
"name": "@example/atomic-mydb",
|
|
107
|
+
"dependencies": { "mydb-client": "1.0.0" },
|
|
108
108
|
"peerDependencies": { "@bastani/atomic": "*" },
|
|
109
|
-
"atomic": { "storageAdapters": ["./
|
|
109
|
+
"atomic": { "storageAdapters": ["./mydb-adapter.ts"] }
|
|
110
110
|
}
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
- Select an adapter by package name (`"storage": { "adapter": "@example/atomic-
|
|
114
|
-
- Select a specific adapter from a multi-adapter package with `<package>/<file-stem>`, where `<file-stem>` is the filename without its extension (for example `"@example/atomic-
|
|
115
|
-
- Storage adapters load only from user-settings packages or explicit extension paths (`--extension <dir>` in [CLI resource options](/reference/cli#resource-options) or [`DefaultResourceLoader({ additionalExtensionPaths })`](/sdk/reference#extensions), which take precedence over settings). Project-installed packages cannot supply storage adapters, and global npm adapter lookup checks `~/.atomic/agent/npm/` only (not the system global npm root). See [Adapters from Atomic packages](/storage#adapters-from-atomic-packages).
|
|
113
|
+
- Select an adapter by package name (`"storage": { "adapter": "@example/atomic-mydb" }`), which selects the first entry in `storageAdapters` when a package lists multiple adapters.
|
|
114
|
+
- Select a specific adapter from a multi-adapter package with `<package>/<file-stem>`, where `<file-stem>` is the filename without its extension (for example `"@example/atomic-mydb/mydb-adapter"`).
|
|
115
|
+
- Storage adapters load only from user-settings packages or explicit extension paths (`--extension <dir>` in [CLI resource options](/reference/cli#resource-options) or [`DefaultResourceLoader({ additionalExtensionPaths })`](/sdk/reference#extensions), which take precedence over settings). Project-installed packages cannot supply storage adapters, and global npm adapter lookup checks `~/.atomic/agent/npm/` only (not the system global npm root). See [Adapters from Atomic packages](/storage/custom-adapters#adapters-from-atomic-packages).
|
|
116
116
|
|
|
117
117
|
## Gallery metadata
|
|
118
118
|
|
package/docs/packages.md
CHANGED
|
@@ -4,7 +4,7 @@ sidebarTitle: "Atomic packages"
|
|
|
4
4
|
description: "Install, update, remove, and configure Atomic packages from npm, git, or local directories."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Atomic packages bundle extensions, skills, [subagents](/packages/authoring#subagents), prompt templates, themes, MCP servers, and [storage adapters](/storage#adapters-from-atomic-packages) for distribution over npm, git, or local paths. Declare resources under the `atomic` key in `package.json`, or use convention directories.
|
|
7
|
+
Atomic packages bundle extensions, skills, [subagents](/packages/authoring#subagents), prompt templates, themes, MCP servers, and [storage adapters](/storage/custom-adapters#adapters-from-atomic-packages) for distribution over npm, git, or local paths. Declare resources under the `atomic` key in `package.json`, or use convention directories.
|
|
8
8
|
|
|
9
9
|
## Where to go next
|
|
10
10
|
|