@bastani/atomic 0.10.9-alpha.1 → 0.10.10-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +211 -155
- 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 +27 -12
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
- package/dist/_shared/sdk-RRLVN7ER.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/settings-startup-8-DNZ2RIHM.js +4 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
- package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
- package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
- package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
- package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
- package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +145 -58
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
- package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
- package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
- package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
- package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
- package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
- package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
- package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
- package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
- package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +85 -114
- package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
- package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
- package/dist/builtin/intercom/group.ts +7 -3
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/README.md +37 -27
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +8 -0
- package/dist/builtin/subagents/README.md +71 -138
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
- package/dist/builtin/web-access/CHANGELOG.md +9 -0
- package/dist/builtin/web-access/README.md +60 -87
- package/dist/builtin/web-access/index.bundle.mjs +387 -351
- package/dist/builtin/web-access/package.json +1 -1
- 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 +2 -2
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +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 +2 -2
- 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 +2 -2
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/agent-session-methods.d.ts +4 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/compaction/compactor.d.ts +20 -14
- package/dist/core/compaction/errors.d.ts +120 -0
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/model-resolver.d.ts +2 -2
- 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.code.js +1 -1
- 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/api-types.d.ts +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- 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/provider-types.d.ts +18 -6
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.js +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-config.d.ts +40 -0
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-resolver-scope.d.ts +4 -4
- package/dist/core/model-runtime.d.ts +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/provider-composer-internal.d.ts +11 -2
- 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.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +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 +2 -2
- 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.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/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.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +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.code.js +1 -1
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.code.js +2 -2
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +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/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 +2 -2
- 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-extensions.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -7
- 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/modes/interactive/components/settings-selector-types.d.ts +1 -0
- package/dist/modes/interactive/components/settings-selector-types.js.map +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/theme/color-utils.d.ts +5 -5
- package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
- package/dist/modes/rpc/rpc-types.d.ts +29 -2
- package/dist/package-manager-cli.code.js +5 -5
- 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/5.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -2
- package/dist/startup-stages/9.js +2 -1
- package/dist/utils/native-module.d.ts +44 -0
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +235 -243
- package/docs/build.md +12 -11
- package/docs/codemode.md +60 -51
- package/docs/compaction/reference.md +61 -24
- package/docs/compaction.md +117 -65
- package/docs/computer-use.md +179 -146
- package/docs/containerization.md +79 -33
- package/docs/custom-provider/api-reference.md +148 -11
- package/docs/custom-provider/oauth.md +44 -27
- package/docs/custom-provider/override.md +14 -7
- package/docs/custom-provider/registration.md +75 -65
- package/docs/custom-provider/streaming.md +42 -19
- package/docs/custom-provider.md +25 -61
- package/docs/development.md +47 -43
- package/docs/docs.json +33 -33
- package/docs/environment-variables.md +83 -57
- package/docs/extensions/api-reference.md +323 -734
- package/docs/extensions/authoring.md +186 -269
- package/docs/extensions/events.md +308 -375
- package/docs/extensions/examples.md +122 -74
- package/docs/extensions/ui.md +217 -197
- package/docs/extensions.md +152 -259
- package/docs/getting-started/authentication.md +27 -14
- package/docs/getting-started/first-session.md +25 -26
- package/docs/getting-started/installation.md +62 -84
- package/docs/getting-started/project-instructions.md +39 -14
- package/docs/guides/configuration.md +42 -20
- package/docs/guides/intercom.md +17 -13
- package/docs/guides/non-interactive.md +29 -16
- package/docs/guides/orchestration.md +16 -10
- package/docs/guides/resume-on-any-machine.md +54 -49
- package/docs/guides/subagents.md +22 -14
- package/docs/guides/team-setup.md +37 -26
- package/docs/guides.md +22 -21
- package/docs/herdr.md +21 -16
- package/docs/index.md +16 -17
- package/docs/intercom/operations.md +68 -66
- package/docs/intercom/reference.md +196 -191
- package/docs/intercom.md +103 -92
- package/docs/json.md +71 -71
- package/docs/keybindings.md +63 -50
- package/docs/libraries/agent-core.md +49 -8
- package/docs/libraries/ai.md +21 -12
- package/docs/libraries/codemode.md +28 -6
- package/docs/libraries/schema.md +7 -7
- package/docs/libraries/telemetry.md +7 -7
- package/docs/libraries/tui.md +74 -94
- package/docs/libraries.md +5 -5
- package/docs/llama-cpp.md +38 -33
- package/docs/mcp-servers.md +96 -90
- package/docs/models/reference.md +46 -33
- package/docs/models-configuration.md +12 -6
- package/docs/models.md +93 -88
- package/docs/orchestration/migrating-workflows.md +21 -19
- package/docs/orchestration/patterns.md +35 -20
- package/docs/orchestration.md +22 -21
- package/docs/packages/authoring.md +28 -19
- package/docs/packages/reference.md +75 -16
- package/docs/packages.md +31 -33
- package/docs/programmatic.md +22 -21
- package/docs/prompt-templates.md +63 -41
- package/docs/providers/reference.md +35 -19
- package/docs/providers.md +61 -71
- package/docs/quickstart.md +32 -46
- package/docs/reference/cli.md +249 -252
- package/docs/reference.md +23 -20
- package/docs/rpc/examples.md +74 -17
- package/docs/rpc/extension-ui.md +79 -62
- package/docs/rpc/protocol.md +816 -358
- package/docs/rpc.md +75 -151
- package/docs/sdk/reference.md +175 -45
- package/docs/sdk/structured-decisions.md +92 -62
- package/docs/sdk/web-server.md +79 -46
- package/docs/sdk.md +237 -195
- package/docs/security.md +106 -43
- package/docs/session-format.md +96 -59
- package/docs/sessions.md +149 -113
- package/docs/settings.md +289 -204
- package/docs/shell-aliases.md +15 -6
- package/docs/skills/authoring.md +17 -9
- package/docs/skills/reference.md +23 -21
- package/docs/skills.md +104 -97
- package/docs/storage.md +140 -242
- package/docs/subagents/authoring.md +147 -16
- package/docs/subagents/reference.md +100 -30
- package/docs/subagents.md +220 -252
- package/docs/terminal-setup.md +97 -69
- package/docs/termux.md +51 -85
- package/docs/themes/reference.md +51 -37
- package/docs/themes.md +49 -54
- package/docs/tmux.md +38 -21
- package/docs/tools.md +198 -147
- package/docs/tui/reference.md +64 -32
- package/docs/tui.md +38 -66
- package/docs/usage.md +76 -78
- package/docs/verification.md +25 -25
- package/docs/web-access.md +72 -55
- package/docs/windows.md +53 -58
- package/docs/worktree-snapshots.md +62 -65
- package/package.json +8 -8
- package/schemas/models.schema.json +51 -0
- package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
- package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
- package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@bastani/atomic-telemetry"
|
|
3
|
-
sidebarTitle: "
|
|
4
|
-
description: "Vendor-neutral telemetry contracts,
|
|
3
|
+
sidebarTitle: "@bastani/atomic-telemetry"
|
|
4
|
+
description: "Vendor-neutral telemetry contracts, no-op and in-memory contexts, metrics, trace rendering, and typed telemetry schemas."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Vendor-neutral telemetry contracts and typed schema utilities for Atomic's libraries. This package contains no exporter and sends nothing on its own; you supply the adapter.
|
|
@@ -273,13 +273,13 @@ Storage in `InMemoryTelemetryContext` is unbounded and process-local. Create a f
|
|
|
273
273
|
|
|
274
274
|
`TelemetryStore` separates querying from recording. `InMemoryTelemetryContext` implements it, and persistent adapters can implement it too:
|
|
275
275
|
|
|
276
|
-
- `findTraces(query?)` returns
|
|
277
|
-
- `getTrace(traceId)` returns
|
|
278
|
-
- `findMetrics({ name, startMin?, startMax?, attributes? })` returns
|
|
276
|
+
- `findTraces(query?)` returns `Promise<{ traces: readonly StoredTrace[]; cursor?: string }>`, newest trace start first, where each `StoredTrace` is `{ traceId, spans }`. `TraceQuery` filters include the earliest stored span's `name`, inclusive `startMin` and `startMax`, `errors: true`, `attributes` (scalar equalities that must all match one span anywhere in the trace), `limit` (default `20`), and opaque `cursor` (pass with the same filters to fetch the next page). Equal start times order by `traceId`.
|
|
277
|
+
- `getTrace(traceId)` returns `Promise<StoredTrace | undefined>`.
|
|
278
|
+
- `findMetrics({ name, startMin?, startMax?, attributes? })` returns `Promise<readonly StoredMetric[]>`, where each `StoredMetric` has `{ intervalMs, name, kind, unit?, attributes, count, sum, min, max }`. Time bounds are inclusive interval-start times. `InMemoryTelemetryContext` maps each raw measurement to a count-one row in its 10-second interval, while persistent stores can aggregate measurements per series and interval.
|
|
279
279
|
|
|
280
280
|
Only settled spans are returned. A trace ID propagates from the root span with the parent identity. Stores return the spans available locally, so remote or expired parents may be absent and a child can appear before its parent settles. Pagination is not a frozen snapshot across requests because late settlements and retention can change a trace's earliest stored span.
|
|
281
281
|
|
|
282
|
-
`StoredSpan`
|
|
282
|
+
`StoredSpan` has `{ id, traceId, parentId?, name, startedMs, endedMs, attributes, events: [{ name, timeMs, attributes }], links: [{ traceId, spanId, attributes? }], status }`. `startedMs` and `endedMs` are epoch milliseconds (`telemetryNow()`), and event `timeMs` values are offsets relative to span start. Durations use a monotonic clock because wall clocks across processes may disagree. Merge spans from multiple stores by `traceId`; parent relationships, not timestamp containment, define the tree.
|
|
283
283
|
|
|
284
284
|
Trace formatting lives in `@bastani/atomic-telemetry/render`:
|
|
285
285
|
|
|
@@ -383,7 +383,7 @@ const startSpan = createTypedSpanStarter(
|
|
|
383
383
|
);
|
|
384
384
|
```
|
|
385
385
|
|
|
386
|
-
The starter exposes one overload per span and checks names and attributes at compile time. Union-valued names must be narrowed before a call, preserving the relationship between each runtime name and its attribute schema. Its callback receives a child starter over the same schemas, already bound to the callback span:
|
|
386
|
+
The starter exposes one overload per span and checks names and attributes at compile time. Union-valued names must be narrowed before a call, preserving the relationship between each runtime name and its attribute schema. Always pass the second `attributes` argument (pass `{}` when a span declares `startAttributes: {}`), unlike `span.addEvent()` where `attributes` is optional when no attributes are required. Its callback receives a child starter over the same schemas, already bound to the callback span:
|
|
387
387
|
|
|
388
388
|
```typescript
|
|
389
389
|
await startSpan(
|
package/docs/libraries/tui.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@bastani/atomic-tui"
|
|
3
|
-
sidebarTitle: "
|
|
4
|
-
description: "Terminal UI framework with differential rendering, components, overlays, key handling and images."
|
|
3
|
+
sidebarTitle: "@bastani/atomic-tui"
|
|
4
|
+
description: "Terminal UI framework with differential rendering, alternate-screen viewports, components, overlays, key handling, and images."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Minimal terminal UI framework with differential rendering and synchronized output for flicker-free interactive CLI applications.
|
|
7
|
+
Minimal terminal UI framework with differential rendering and synchronized output for flicker-free interactive CLI applications (requires Node.js 22.19+).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @bastani/atomic-tui
|
|
13
|
+
```
|
|
8
14
|
|
|
9
15
|
## Features
|
|
10
16
|
|
|
@@ -13,9 +19,9 @@ Minimal terminal UI framework with differential rendering and synchronized outpu
|
|
|
13
19
|
- **Application-owned scrolling.** Alternate-screen viewport supports mouse, trackpad, and keyboard navigation.
|
|
14
20
|
- **Synchronized output.** Uses CSI 2026 for atomic, flicker-free screen updates.
|
|
15
21
|
- **Bracketed paste mode.** Handles large pastes with compact markers for pastes over 10 lines.
|
|
16
|
-
- **Component-based.** Simple `Component` interface with
|
|
22
|
+
- **Component-based.** Simple `Component` interface with `render(width)` and optional `renderSized(width, height)`.
|
|
17
23
|
- **Theme support.** Components accept theme interfaces for styling.
|
|
18
|
-
- **Built-in components.** `Text`, `TruncatedText`, `Input`, `Editor`, `Markdown`, `Loader`, `CancellableLoader`, `SelectList`, `SettingsList`, `MouseRegion`, `Spacer`, `Image`, `Box`, `Container`, `VStack`, `HStack`, and `ScrollView`.
|
|
24
|
+
- **Built-in components.** `Text`, `TruncatedText`, `Input`, `Editor`, `Markdown`, `Loader`, `CancellableLoader`, `SelectList`, `SettingsList`, `MouseRegion`, `Spacer`, `Image`, `Box`, `Container`, `WindowedContainer`, `VStack`, `HStack`, and `ScrollView`.
|
|
19
25
|
- **Inline images.** Renders images in terminals supporting Kitty or iTerm2 graphics protocols.
|
|
20
26
|
- **Autocomplete support.** File paths and slash commands.
|
|
21
27
|
|
|
@@ -187,6 +193,21 @@ Press `Ctrl+Shift+F` to open or close the primary scroll view's bordered search
|
|
|
187
193
|
|
|
188
194
|
`TuiAltScreenOptions.scrollToEndIndicator` renders a clickable label centered on the last row of a `follow: "end"` primary scroll view while scrolled away from the end. Clicking it resumes end-following.
|
|
189
195
|
|
|
196
|
+
**`TuiAltScreenOptions` summary:**
|
|
197
|
+
|
|
198
|
+
| Option | Type | Description |
|
|
199
|
+
| --- | --- | --- |
|
|
200
|
+
| `wheelScrollLines` | `number \| "auto"` | Logical lines moved per wheel event (default `1`; `"auto"` accelerates fast spins; Alt+wheel moves 5x). |
|
|
201
|
+
| `mouse` | `boolean` | Capture mouse events for scrolling and application-owned text selection. |
|
|
202
|
+
| `copyOnSelect` | `boolean` | Automatically copy dragged selections on mouse release (default `true`). |
|
|
203
|
+
| `copySelection` | `(text: string) => Promise<boolean \| string>` | Custom system clipboard writer; falls back to OSC 52 when omitted. |
|
|
204
|
+
| `openUrl` | `(url: string) => void` | Handler invoked when clicking an OSC 8 hyperlink. |
|
|
205
|
+
| `onRightClickPaste` | `() => void` | Secondary-button paste handler (currently Windows only). |
|
|
206
|
+
| `searchMatchStyle` / `searchCurrentMatchStyle` | `(text: string) => string` | Highlighters for transcript search matches and the active match. |
|
|
207
|
+
| `searchNavigationButtonStyle` | `(text: string, hovered: boolean) => string` | Styling callback for the search panel's previous/next buttons. |
|
|
208
|
+
| `scrollToEndIndicator` | `() => string` | Clickable jump-to-end indicator shown when scrolled away from the bottom. |
|
|
209
|
+
| `scrollPinnedPrompt` | `{ isPrompt, render }` | Pins matching prompt rows at the top of the scroll viewport. |
|
|
210
|
+
|
|
190
211
|
Layout geometry is rebuilt for each requested frame. Stateful components are retained, and their existing rendered-line caches remain effective. Calling `render(width)` directly on these layout components produces an unbounded document, which is also used when alt mode restores the main screen.
|
|
191
212
|
|
|
192
213
|
### Overlays
|
|
@@ -275,21 +296,29 @@ All components implement:
|
|
|
275
296
|
```typescript
|
|
276
297
|
interface Component {
|
|
277
298
|
render(width: number): string[];
|
|
299
|
+
renderSized?(width: number, height: number): string[];
|
|
278
300
|
handleInput?(data: string): void;
|
|
279
301
|
handleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
280
|
-
|
|
302
|
+
paintedRowKey?(row: number): string | undefined;
|
|
281
303
|
readonly selectionTextMayChangeOnReplay?: boolean;
|
|
304
|
+
readonly historyReplayable?: boolean;
|
|
305
|
+
wantsKeyRelease?: boolean;
|
|
306
|
+
capturesViewportInput?: boolean;
|
|
282
307
|
invalidate(): void;
|
|
283
308
|
}
|
|
284
309
|
```
|
|
285
310
|
|
|
286
|
-
|
|
|
287
|
-
|
|
311
|
+
| Member | Description |
|
|
312
|
+
| --- | --- |
|
|
288
313
|
| `render(width)` | Returns an array of strings, one per line. Each line **must not exceed `width`** or the TUI throws an error. Use `truncateToWidth()` or manual wrapping. |
|
|
314
|
+
| `renderSized?(width, height)` | Optional sized renderer invoked instead of `render()` when a layout slot allocates a fixed row height. |
|
|
289
315
|
| `handleInput?(data)` | Called when the component has focus and receives keyboard input. The `data` string contains raw terminal input, which may include ANSI escape sequences. |
|
|
290
316
|
| `handleMouse?(event)` | Called by `TuiAltScreen` for normalized pointer input targeted at the component. |
|
|
291
|
-
| `
|
|
292
|
-
| `selectionTextMayChangeOnReplay` | Set to `true` on a `WindowedContainer` component whose text cannot be recreated from saved input. Fullscreen selection then keeps the selected fragments in memory until dismissed or replaced.
|
|
317
|
+
| `paintedRowKey?(row)` | Optional stable identity for what the last render drew on `row`, so press and release become a click only when both target the same item across repaints. |
|
|
318
|
+
| `selectionTextMayChangeOnReplay` | Set to `true` on a `WindowedContainer` component whose text cannot be recreated from saved input. Fullscreen selection then keeps the selected fragments in memory until dismissed or replaced. Leave unset for deterministic rows. |
|
|
319
|
+
| `historyReplayable` | Set to `true` on a chat-rendered component that can be discarded offscreen and recreated from saved input without losing state. |
|
|
320
|
+
| `wantsKeyRelease` | When `true`, receives Kitty key release events in `handleInput()`. Default: `false`. |
|
|
321
|
+
| `capturesViewportInput` | When `true` on the focused component, `TuiAltScreen` forwards viewport scrolling and prompt-jump keys (`tui.altScreen.*` except search) to the component instead of scrolling the viewport, matching focused overlays. `SelectList`, `SettingsList`, and `Editor` (while autocomplete is open) set this so PageUp and PageDown move selection. Use `getSelectPageIndex(keybindings, data, selectedIndex, itemCount, pageSize)` to compute page movement. |
|
|
293
322
|
| `invalidate()` | Required. Clears cached render state so the next `render()` rebuilds from scratch. Stateless components can leave the body empty. |
|
|
294
323
|
|
|
295
324
|
The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered line, so styles do not carry across lines. Reapply styles per line or use `wrapTextWithAnsi()` to preserve styling across wrapped lines.
|
|
@@ -403,7 +432,7 @@ Without this propagation, typing with an IME (Chinese, Japanese, Korean, etc.) w
|
|
|
403
432
|
|
|
404
433
|
### Container
|
|
405
434
|
|
|
406
|
-
Groups child components.
|
|
435
|
+
Groups child components vertically.
|
|
407
436
|
|
|
408
437
|
```typescript
|
|
409
438
|
const container = new Container();
|
|
@@ -411,6 +440,10 @@ container.addChild(component);
|
|
|
411
440
|
container.removeChild(component);
|
|
412
441
|
```
|
|
413
442
|
|
|
443
|
+
### WindowedContainer
|
|
444
|
+
|
|
445
|
+
Virtualized vertical container for large transcripts inside `ScrollView`. Keeps only visible children mounted in memory and materializes or evicts off-screen rows on demand (respecting `historyReplayable` and `selectionTextMayChangeOnReplay` for fullscreen text selection).
|
|
446
|
+
|
|
414
447
|
### Box
|
|
415
448
|
|
|
416
449
|
Container that applies padding and background color to all children.
|
|
@@ -824,8 +857,13 @@ The TUI works with any object implementing the `Terminal` interface:
|
|
|
824
857
|
interface Terminal {
|
|
825
858
|
start(onInput: (data: string) => void, onResize: () => void): void;
|
|
826
859
|
stop(): void;
|
|
860
|
+
handOff?(held?: readonly string[]): void;
|
|
861
|
+
readonly continuedFromHandOff?: boolean;
|
|
862
|
+
restoreOnExit?(before: string, after: string): void;
|
|
827
863
|
drainInput(maxMs?: number, idleMs?: number): Promise<void>;
|
|
828
864
|
write(data: string): void;
|
|
865
|
+
flush?(): Promise<void>;
|
|
866
|
+
readonly colorDepth?: number;
|
|
829
867
|
get columns(): number;
|
|
830
868
|
get rows(): number;
|
|
831
869
|
get kittyProtocolActive(): boolean;
|
|
@@ -851,7 +889,7 @@ import { visibleWidth, truncateToWidth, wrapTextWithAnsi } from "@bastani/atomic
|
|
|
851
889
|
// Get visible width of string (ignoring ANSI codes)
|
|
852
890
|
const width = visibleWidth("\x1b[31mHello\x1b[0m"); // 5
|
|
853
891
|
|
|
854
|
-
// Truncate string to width (preserving ANSI codes
|
|
892
|
+
// Truncate string to width (preserving ANSI codes and closing active styles)
|
|
855
893
|
const truncated = truncateToWidth("Hello World", 8); // "Hello..."
|
|
856
894
|
|
|
857
895
|
// Truncate without ellipsis
|
|
@@ -862,30 +900,42 @@ const lines = wrapTextWithAnsi("This is a long line that needs wrapping", 20);
|
|
|
862
900
|
// ["This is a long line", "that needs wrapping"]
|
|
863
901
|
```
|
|
864
902
|
|
|
865
|
-
|
|
903
|
+
Additional exported helpers:
|
|
866
904
|
|
|
867
|
-
|
|
905
|
+
| Export | Purpose |
|
|
906
|
+
| --- | --- |
|
|
907
|
+
| `fuzzyFilter` / `fuzzyMatch` | Fuzzy matching and ranked filtering for pickers and search inputs. |
|
|
908
|
+
| `KeybindingsManager` / `TUI_KEYBINDINGS` | Configurable TUI keybinding definitions and lookup. |
|
|
909
|
+
| `decodePrintableKey` | Decode printable Kitty CSI-u and `modifyOtherKeys` sequences. |
|
|
910
|
+
| `normalizePastedText` | Normalize bracketed paste text (CRLF/CR, tmux control bytes, tabs, C0 control filtering). |
|
|
911
|
+
| `stripTerminalSequences` / `sliceByColumn` | Strip ANSI/OSC sequences or slice styled strings by display column range. |
|
|
912
|
+
| `hyperlink` / `clickableHint` | Format OSC 8 clickable terminal links and clickable hint badges. |
|
|
913
|
+
| `renderLatex` | Render inline or block LaTeX math into Unicode text for terminals. |
|
|
914
|
+
| `formatProgramStatus` | Encode OSC 7501 program-status escape sequences. |
|
|
915
|
+
| `getNativeClipboard` | Access the native clipboard integration when available. |
|
|
868
916
|
|
|
869
|
-
|
|
917
|
+
## Creating custom components
|
|
870
918
|
|
|
871
|
-
|
|
919
|
+
When building a custom `Component`, keep every line returned by `render(width)` within `width` columns using `truncateToWidth()`, `wrapTextWithAnsi()`, or `visibleWidth()`, handle keys via `matchesKey()` (see [Key detection](#key-detection)), and cache rendered output by width until `invalidate()` runs:
|
|
872
920
|
|
|
873
921
|
```typescript
|
|
874
|
-
import {
|
|
875
|
-
import type { Component } from "@bastani/atomic-tui";
|
|
922
|
+
import { Key, matchesKey, truncateToWidth, type Component } from "@bastani/atomic-tui";
|
|
876
923
|
|
|
877
|
-
class
|
|
924
|
+
class CachedList implements Component {
|
|
878
925
|
private selectedIndex = 0;
|
|
879
926
|
private items = ["Option 1", "Option 2", "Option 3"];
|
|
880
|
-
|
|
927
|
+
private cachedWidth?: number;
|
|
928
|
+
private cachedLines?: string[];
|
|
881
929
|
public onSelect?: (index: number) => void;
|
|
882
930
|
public onCancel?: () => void;
|
|
883
931
|
|
|
884
932
|
handleInput(data: string): void {
|
|
885
933
|
if (matchesKey(data, Key.up)) {
|
|
886
934
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
935
|
+
this.invalidate();
|
|
887
936
|
} else if (matchesKey(data, Key.down)) {
|
|
888
937
|
this.selectedIndex = Math.min(this.items.length - 1, this.selectedIndex + 1);
|
|
938
|
+
this.invalidate();
|
|
889
939
|
} else if (matchesKey(data, Key.enter)) {
|
|
890
940
|
this.onSelect?.(this.selectedIndex);
|
|
891
941
|
} else if (matchesKey(data, Key.escape) || matchesKey(data, Key.ctrl("c"))) {
|
|
@@ -893,85 +943,15 @@ class MyInteractiveComponent implements Component {
|
|
|
893
943
|
}
|
|
894
944
|
}
|
|
895
945
|
|
|
896
|
-
render(width: number): string[] {
|
|
897
|
-
return this.items.map((item, i) => {
|
|
898
|
-
const prefix = i === this.selectedIndex ? "> " : " ";
|
|
899
|
-
return truncateToWidth(prefix + item, width);
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
invalidate(): void {}
|
|
904
|
-
}
|
|
905
|
-
```
|
|
906
|
-
|
|
907
|
-
### Handling line width
|
|
908
|
-
|
|
909
|
-
Use the provided utilities so lines stay within `width`:
|
|
910
|
-
|
|
911
|
-
```typescript
|
|
912
|
-
import { visibleWidth, truncateToWidth } from "@bastani/atomic-tui";
|
|
913
|
-
import type { Component } from "@bastani/atomic-tui";
|
|
914
|
-
|
|
915
|
-
class MyComponent implements Component {
|
|
916
|
-
private text: string;
|
|
917
|
-
|
|
918
|
-
constructor(text: string) {
|
|
919
|
-
this.text = text;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
render(width: number): string[] {
|
|
923
|
-
// Option 1: Truncate long lines
|
|
924
|
-
return [truncateToWidth(this.text, width)];
|
|
925
|
-
|
|
926
|
-
// Option 2: Check and pad to exact width
|
|
927
|
-
const line = this.text;
|
|
928
|
-
const visible = visibleWidth(line);
|
|
929
|
-
if (visible > width) {
|
|
930
|
-
return [truncateToWidth(line, width)];
|
|
931
|
-
}
|
|
932
|
-
// Pad to exact width (optional, for backgrounds)
|
|
933
|
-
return [line + " ".repeat(width - visible)];
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
invalidate(): void {}
|
|
937
|
-
}
|
|
938
|
-
```
|
|
939
|
-
|
|
940
|
-
### ANSI code considerations
|
|
941
|
-
|
|
942
|
-
Both `visibleWidth()` and `truncateToWidth()` handle ANSI escape codes:
|
|
943
|
-
|
|
944
|
-
- `visibleWidth()` ignores ANSI codes when calculating display width.
|
|
945
|
-
- `truncateToWidth()` preserves ANSI codes and closes active styles when truncating.
|
|
946
|
-
|
|
947
|
-
```typescript
|
|
948
|
-
import chalk from "chalk";
|
|
949
|
-
|
|
950
|
-
const styled = chalk.red("Hello") + " " + chalk.blue("World");
|
|
951
|
-
const width = visibleWidth(styled); // 11 (not counting ANSI codes)
|
|
952
|
-
const truncated = truncateToWidth(styled, 8); // Red "Hello" + " W..." with proper reset
|
|
953
|
-
```
|
|
954
|
-
|
|
955
|
-
### Caching
|
|
956
|
-
|
|
957
|
-
Cache rendered lines and rebuild only when `width` changes or `invalidate()` runs:
|
|
958
|
-
|
|
959
|
-
```typescript
|
|
960
|
-
class CachedComponent implements Component {
|
|
961
|
-
private text: string;
|
|
962
|
-
private cachedWidth?: number;
|
|
963
|
-
private cachedLines?: string[];
|
|
964
|
-
|
|
965
946
|
render(width: number): string[] {
|
|
966
947
|
if (this.cachedLines && this.cachedWidth === width) {
|
|
967
948
|
return this.cachedLines;
|
|
968
949
|
}
|
|
969
|
-
|
|
970
|
-
const lines = [truncateToWidth(this.text, width)];
|
|
971
|
-
|
|
972
950
|
this.cachedWidth = width;
|
|
973
|
-
this.cachedLines =
|
|
974
|
-
|
|
951
|
+
this.cachedLines = this.items.map((item, i) =>
|
|
952
|
+
truncateToWidth(`${i === this.selectedIndex ? "> " : " "}${item}`, width),
|
|
953
|
+
);
|
|
954
|
+
return this.cachedLines;
|
|
975
955
|
}
|
|
976
956
|
|
|
977
957
|
invalidate(): void {
|
package/docs/libraries.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
sidebarTitle: "
|
|
4
|
-
description: "
|
|
2
|
+
title: "Standalone libraries"
|
|
3
|
+
sidebarTitle: "Overview"
|
|
4
|
+
description: "Explore the six standalone @bastani/atomic-* TypeScript libraries you can use in extensions, SDK apps, or independently on Node.js 22.19+."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Atomic is built on six TypeScript libraries. Each
|
|
7
|
+
Atomic is built on six TypeScript libraries (requiring Node.js 22.19 or newer). Each package is published on npm at Atomic's version with every release, and each works independently outside Atomic.
|
|
8
8
|
|
|
9
9
|
| Package | What it does |
|
|
10
10
|
| --- | --- |
|
|
@@ -29,6 +29,6 @@ To build on Atomic's sessions, tools, and extensions rather than the bare librar
|
|
|
29
29
|
|
|
30
30
|
## Older package names
|
|
31
31
|
|
|
32
|
-
These libraries began as forks of pi's packages. Extensions written for pi still work inside Atomic
|
|
32
|
+
These libraries began as forks of pi's packages. Extensions written for pi still work inside Atomic: imports of `@earendil-works/pi-coding-agent` and `@mariozechner/pi-coding-agent` map to `@bastani/atomic`, while `@earendil-works/pi-ai`, `@earendil-works/pi-tui`, `@earendil-works/pi-agent-core`, `@earendil-works/pi-codemode`, `@earendil-works/pi-schema`, `@earendil-works/pi-telemetry`, their `@mariozechner/pi-*` equivalents, and `@bastani/pi-ai` (plus subpaths) map to the matching `@bastani/atomic-*` package.
|
|
33
33
|
|
|
34
34
|
Use the `@bastani/atomic-*` names in new code. The older names resolve only inside Atomic. Outside Atomic, install the `@bastani/atomic-*` packages.
|
package/docs/llama-cpp.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Local models"
|
|
3
|
-
|
|
2
|
+
title: "Local models with llama.cpp"
|
|
3
|
+
sidebarTitle: "Local models"
|
|
4
|
+
description: "Connect Atomic to a local llama.cpp router server to discover, load, download, and run GGUF models and local classifiers."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Atomic supports the [llama.cpp](https://llama.app) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
|
|
7
|
+
Atomic integrates with the [llama.cpp](https://llama.app) router server to discover local GGUF models, load or unload them on demand, download models from Hugging Face, and run local classification.
|
|
9
8
|
|
|
10
9
|
## Install llama.cpp
|
|
11
10
|
|
|
@@ -46,7 +45,7 @@ For settings tuned to a specific NVIDIA GPU and model, see [NVIDIA RTX recipes](
|
|
|
46
45
|
|
|
47
46
|
## Configure Atomic
|
|
48
47
|
|
|
49
|
-
Run `/login llama.cpp` and enter the router URL and optional API key. The default URL is `http://127.0.0.1:9931
|
|
48
|
+
Run `/login llama.cpp` and enter the router URL and optional API key. The default URL is `http://127.0.0.1:9931` (trailing slashes and `/v1` are normalized automatically). When the router runs with `--no-models-autoload`, login saves only the connection; load a model with `/llama`, then select it with `/model`.
|
|
50
49
|
|
|
51
50
|
You can configure the same values with environment variables instead of `/login`:
|
|
52
51
|
|
|
@@ -56,14 +55,14 @@ export LLAMA_API_KEY=optional-secret
|
|
|
56
55
|
atomic
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
A server URL saved with `/login llama.cpp` (stored in `auth.json` under `env.LLAMA_BASE_URL`) takes precedence over `LLAMA_BASE_URL`. When no API key is configured, Atomic sends `"local"` as a placeholder key. If the server requires authentication, start `llama serve` with the matching `--api-key` and keep `--host 127.0.0.1` for local-only access.
|
|
60
59
|
|
|
61
60
|
## Manage models
|
|
62
61
|
|
|
63
62
|
Run `/llama` in interactive mode to manage router models:
|
|
64
63
|
|
|
65
64
|
- Select an unloaded model to load it, or a loaded model to unload it.
|
|
66
|
-
- Select **Download model
|
|
65
|
+
- Select **Download model...** to search Hugging Face and pick a repository and quantization. Search returns up to 20 GGUF repositories sorted by downloads (15-second timeout). The quantization picker excludes `mmproj` projection files, lists `Q4_K_M` first, and sorts remaining quantizations from smallest to largest. Typing an exact `owner/repository` or `owner/repository:QUANT` value and pressing Enter downloads it directly.
|
|
67
66
|
- Press Escape during a load or download to confirm cancellation.
|
|
68
67
|
|
|
69
68
|
Hugging Face search checks `HF_TOKEN`, then `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Unauthenticated search has lower rate limits. Atomic warns before gated downloads and links to the access page; because llama.cpp performs the download, its process also needs `HF_TOKEN` for gated repositories.
|
|
@@ -74,7 +73,36 @@ Atomic caches the last loaded-model catalog in `~/.atomic/agent/models-store.jso
|
|
|
74
73
|
|
|
75
74
|
If the router disconnects, select **Retry** to reconnect and refresh state without replaying the interrupted action.
|
|
76
75
|
|
|
77
|
-
Each llama.cpp model sets both `contextWindow` and `maxTokens` from the router-reported context window (`meta.n_ctx`, then the model's configured `--ctx-size`, cached context, training context `meta.n_ctx_train`, or the 128,000-token fallback). The server remains authoritative and may enforce a smaller generation limit.
|
|
76
|
+
Each llama.cpp model sets both `contextWindow` and `maxTokens` from the router-reported context window (`meta.n_ctx`, then the model's configured `--ctx-size`, `-c`, or `-ctx` argument, cached context, training context `meta.n_ctx_train`, or the 128,000-token fallback). The server remains authoritative and may enforce a smaller generation limit.
|
|
77
|
+
|
|
78
|
+
### Thinking and vision detection
|
|
79
|
+
|
|
80
|
+
- **Thinking controls:** Atomic enables thinking controls only when a **currently loaded** model's server `/props` `chat_template` contains `"enable_thinking"`. Sleeping or unloaded autoload-preset models are not queried during discovery so they are not woken unexpectedly; load a model in `/llama` and refresh to detect its thinking template. When thinking is detected, Atomic exposes only **`off`** and **`medium`** thinking levels (`minimal`, `low`, `high`, `xhigh`, and `max` are unavailable).
|
|
81
|
+
- **Vision support:** Image input is enabled automatically when the server reports `"image"` in `architecture.input_modalities`.
|
|
82
|
+
|
|
83
|
+
## Classification
|
|
84
|
+
|
|
85
|
+
Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, letting a local model serve `decide()` and `structured_output` decisions as your [`decisionModel`](/settings#decisionmodel). Extensions can call `ctx.modelRegistry.classify()` and codemode scripts can call `models.classify()`; see [Classifier models](/models#use-classifier-models).
|
|
86
|
+
|
|
87
|
+
Atomic exposes llama.cpp models as classifiers in two ways:
|
|
88
|
+
|
|
89
|
+
- **Decision models** (such as Julia-1, Laya, Kev, lev, and OpenJev) answer natively through llama.cpp's decision endpoint (`/v1/systemone`, API `typesafe-system-one`). Decision-only models do not appear in `/model`.
|
|
90
|
+
- **Chat models** are also exposed as classifiers under the same ID using next-token probability classification (API `llama-cpp-classify`).
|
|
91
|
+
|
|
92
|
+
llama.cpp 0.6.0 and newer identify decision models by including `decisions` in `architecture.output_modalities`. Atomic detects them even when sleeping or unloaded without waking them during discovery. Unloaded presets are selectable only when router autoload is enabled. Older servers omit this metadata and fall back to `llama-cpp-classify`.
|
|
93
|
+
|
|
94
|
+
### Chat models as classifiers
|
|
95
|
+
|
|
96
|
+
Rather than generating text, Atomic formats each question as a single chat prompt (state, all request questions, state again, then the target question and single-token labels) and reads next-token probabilities for the labels. Labels are alphanumeric characters for `choice` (2 to 62 options; 1 option throws an error), `Yes`/`No` for `bool`, and digits for `score` (2 to 10 levels). If a label token is absent from the server's top probabilities, Atomic retries with larger `n_probs` up to 32,768. Choices return normalized option probabilities and a confidence of `(n * peak - 1) / (n - 1)`; scores return the expected level.
|
|
97
|
+
|
|
98
|
+
Key behavior for chat-model classifiers:
|
|
99
|
+
|
|
100
|
+
- An explicit [`decisionModel`](/settings#decisionmodel) resolves classifiers before chat models, so `decisionModel: "llama.cpp/<id>"` uses the classifier. A choice with more than 62 options fails on `llama-cpp-classify` and falls back to the active chat model. The **Decision model** picker lists each chat model twice (classifier and chat), saving the same ID; decision-only models have only a classifier row.
|
|
101
|
+
- `structured_output` and `generateStructuredOutput()` resolve chat models before classifiers when both share an ID, so naming `llama.cpp/<id>` there uses the chat model.
|
|
102
|
+
- SDK `classify()` accepts a `temperature` option that divides label logits before normalizing. Values above `1` soften overconfident probabilities without changing the winning answer.
|
|
103
|
+
- Questions run sequentially and share the prompt prefix so the server's prompt cache evaluates it once. Because the state appears twice in the prompt, reserve twice the state size in context.
|
|
104
|
+
- Small models may follow prompt-injection instructions inside the state despite the system prompt instructing them to judge the state as data.
|
|
105
|
+
- Hybrid models such as Qwen3.5 need context checkpoints to reuse a cached prefix across questions. If every question reprocesses the full state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
|
|
78
106
|
|
|
79
107
|
## NVIDIA RTX recipes
|
|
80
108
|
|
|
@@ -169,30 +197,6 @@ Follow [Configure Atomic](#configure-atomic) to connect to `http://127.0.0.1:993
|
|
|
169
197
|
|
|
170
198
|
NVIDIA recipe memory budgets assume only that model occupies the GPU. Unload any other loaded models in `/llama` before running the recipe model.
|
|
171
199
|
|
|
172
|
-
## Classification
|
|
173
|
-
|
|
174
|
-
Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, letting a local model serve `decide()` and `structured_output` decisions as your [`decisionModel`](/settings#decisionmodel). Extensions can call `ctx.modelRegistry.classify()` and codemode scripts can call `models.classify()`; see [Classifier models](/models#use-classifier-models).
|
|
175
|
-
|
|
176
|
-
Atomic exposes llama.cpp models as classifiers in two ways:
|
|
177
|
-
|
|
178
|
-
- **Decision models** (such as Julia-1, Laya, Kev, lev, and OpenJev) answer natively through llama.cpp's `/v1/systemone` endpoint with the `typesafe-system-one` API. Decision-only models do not appear in `/model`.
|
|
179
|
-
- **Chat models** are also exposed as classifiers under the same ID with the `llama-cpp-classify` API, using next-token log-probabilities.
|
|
180
|
-
|
|
181
|
-
llama.cpp 0.6.0 and newer identify decision models by including `decisions` in `architecture.output_modalities`. Atomic detects them even when sleeping or unloaded without waking them during discovery. Unloaded presets are selectable only when router autoload is enabled. Older servers omit this metadata and fall back to `llama-cpp-classify`.
|
|
182
|
-
|
|
183
|
-
### Chat models as classifiers
|
|
184
|
-
|
|
185
|
-
Rather than generating text, Atomic formats each question as a single chat prompt (state, all request questions, state again, then the target question and single-token labels) and reads next-token probabilities for the labels. Labels are alphanumeric characters for `choice` (2 to 62 options), `Yes`/`No` for `bool`, and digits for `score` (2 to 10 levels). Choices return normalized option probabilities and a confidence of `(n * peak - 1) / (n - 1)`; scores return the expected level.
|
|
186
|
-
|
|
187
|
-
Key behavior for chat-model classifiers:
|
|
188
|
-
|
|
189
|
-
- An explicit [`decisionModel`](/settings#decisionmodel) resolves classifiers before chat models, so `decisionModel: "llama.cpp/<id>"` uses the classifier. A choice with more than 62 options fails on `llama-cpp-classify` and falls back to the active chat model. The **Decision model** picker lists each chat model twice (classifier and chat), saving the same ID; decision-only models have only a classifier row.
|
|
190
|
-
- `structured_output` and `generateStructuredOutput()` resolve chat models before classifiers when both share an ID, so naming `llama.cpp/<id>` there uses the chat model.
|
|
191
|
-
- SDK `classify()` accepts a `temperature` option that divides label logits before normalizing. Values above `1` soften overconfident probabilities without changing the winning answer.
|
|
192
|
-
- Questions run sequentially and share the prompt prefix so the server's prompt cache evaluates it once. Because the state appears twice in the prompt, reserve twice the state size in context.
|
|
193
|
-
- Small models may follow prompt-injection instructions inside the state despite the system prompt instructing them to judge the state as data.
|
|
194
|
-
- Hybrid models such as Qwen3.5 need context checkpoints to reuse a cached prefix across questions. If every question reprocesses the full state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
|
|
195
|
-
|
|
196
200
|
## Troubleshooting
|
|
197
201
|
|
|
198
202
|
```bash
|
|
@@ -202,5 +206,6 @@ curl http://127.0.0.1:9931/models
|
|
|
202
206
|
|
|
203
207
|
- **No models in `/llama`:** Verify cached models or `--models-dir` layout, then restart the router.
|
|
204
208
|
- **Model missing from `/model` with `--no-models-autoload`:** Load it in `/llama` first.
|
|
209
|
+
- **Thinking controls missing:** Load the model in `/llama`, then refresh `/model`; thinking controls appear only for loaded models whose chat template includes `"enable_thinking"`.
|
|
205
210
|
- **Load fails or runs out of memory:** Lower `-c` or unload another model.
|
|
206
211
|
- **Server is not in router mode:** Start `llama serve` without `--model`, `-m`, or `-hf`.
|