@bastani/atomic 0.10.9 → 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 +57 -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
package/docs/tui/reference.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: TUI API reference
|
|
2
|
+
title: "TUI API reference"
|
|
3
3
|
sidebarTitle: "TUI API"
|
|
4
|
-
description:
|
|
4
|
+
description: "Reference for Atomic TUI component, focusable, keyboard, theme invalidation, debug logging, and host-native UI contracts."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# TUI API reference
|
|
8
|
-
|
|
9
7
|
## Tool blocks
|
|
10
8
|
|
|
11
9
|
Use `ToolBlock` from `@bastani/atomic` for a transcript item with a state glyph, one header row, and connected result rows. It accepts `status`, `title`, and optional `args`, `meta`, `details`, `body`, and `outputPad` (default `1`).
|
|
12
10
|
|
|
13
|
-
Supported `ToolBlockStatus` values:
|
|
14
|
-
|
|
11
|
+
Supported `ToolBlockStatus` (aliases `NoticeStatus`) values:
|
|
12
|
+
|
|
13
|
+
- General states: `running` (`∀`), `success`, `failure`, `stopped` (interrupted or not run, muted `◼`), `warning`, `paused` (warning-colored `‖`), `waiting` (dim `◌`, wakes automatically when what it waits on finishes), `heartbeat` (muted `♥`), and `info`.
|
|
15
14
|
- Subagent and background-task states (shared with the agent panel and `/tasks`): `agent-running` (grey `◯`), `shell-running` (`⧗`), `input` (`◆`, waiting for an answer), `task-queued` (dim `○`), `task-stopping` (warning-colored `◼`), and `task-stopped` (red `◯`).
|
|
16
15
|
|
|
17
|
-
`TASK_MARKS` from `@bastani/atomic` exports these glyphs for custom rendering.
|
|
16
|
+
`TASK_MARKS` from `@bastani/atomic` exports these glyphs for custom rendering. Exhaustive switches on `ToolBlockStatus` or `NoticeStatus` must handle all general states (including `waiting` and `heartbeat`) plus all six subagent and background-task states.
|
|
18
17
|
|
|
19
18
|
A `NoticeLine` reports a task, drawing `running` as a grey `◯`, `stopped` as a red `◯`, and `paused` as warning-colored `‖`. With `NO_COLOR`, running and stopped notices (like `agent-running` and `task-stopped` blocks) both show plain `◯`, distinguished by their text.
|
|
20
19
|
|
|
@@ -33,7 +32,7 @@ A block does not add a leading blank line; its container controls spacing betwee
|
|
|
33
32
|
|
|
34
33
|
In ordinary tool renderers, return only the call title from `renderCall` and unframed result content from `renderResult`; Atomic supplies the state glyph and connectors. Return `ToolBlockRecords` when several results need separate connectors.
|
|
35
34
|
|
|
36
|
-
When embedding `ChatSessionHost
|
|
35
|
+
When embedding `ChatSessionHost` (an experimental embedded-chat host exported from `@bastani/atomic`; not yet a guaranteed stable extension API), forward the complete `ctx.ui.getChatRenderSettings()` result. Its optional component factories preserve tool renderers and the embedded chat's repaint and expansion settings. Do not copy only `getToolDefinition`. Custom message renderers can use `options.cwd` for the receiving chat's working directory instead of assuming `process.cwd()` matches it.
|
|
37
36
|
|
|
38
37
|
`host.replaceMessages(messages)` starts a fresh unread baseline. Use `host.replaceMessages(messages, { preserveUnread: true })` for a new snapshot of the same conversation; arrivals that have not painted yet remain unread.
|
|
39
38
|
|
|
@@ -45,25 +44,43 @@ The `Markdown` component from `@bastani/atomic-tui` also accepts per-instance `h
|
|
|
45
44
|
|
|
46
45
|
## Component interface
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
`@bastani/atomic-tui` defines the base `Component` interface, and Atomic extends it with `ExtensionCustomComponent` for components returned by `ctx.ui.custom()`:
|
|
49
48
|
|
|
50
49
|
```typescript
|
|
50
|
+
// Base component interface from @bastani/atomic-tui
|
|
51
51
|
interface Component {
|
|
52
52
|
render(width: number): string[];
|
|
53
|
-
|
|
53
|
+
renderSized?(width: number, height: number): string[];
|
|
54
|
+
handleInput?(data: string): void;
|
|
55
|
+
handleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
56
|
+
paintedRowKey?(row: number): string | undefined;
|
|
57
|
+
readonly selectionTextMayChangeOnReplay?: boolean;
|
|
58
|
+
readonly historyReplayable?: boolean;
|
|
54
59
|
wantsKeyRelease?: boolean;
|
|
55
60
|
capturesViewportInput?: boolean;
|
|
56
61
|
invalidate(): void;
|
|
57
62
|
}
|
|
63
|
+
|
|
64
|
+
// Returned by ctx.ui.custom() in @bastani/atomic
|
|
65
|
+
type ExtensionCustomComponent = Omit<Component, "handleInput"> & {
|
|
66
|
+
handleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;
|
|
67
|
+
dispose?(): void;
|
|
68
|
+
};
|
|
58
69
|
```
|
|
59
70
|
|
|
60
|
-
|
|
|
61
|
-
|
|
62
|
-
| `render(width)` | Return array of
|
|
63
|
-
| `
|
|
71
|
+
| Member | Description |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| `render(width)` | Return an array of lines; each line **must not exceed `width`**. |
|
|
74
|
+
| `renderSized?(width, height)` | Optional sized renderer called instead of `render()` when a layout allocates a fixed row count. |
|
|
75
|
+
| `handleInput?(data)` | Receive keyboard input when focused (a focused overlay also receives mouse input before the fullscreen viewport). On `ExtensionCustomComponent`, return `true` (or a promise resolving to `true`) when consuming input; return `false`, `undefined`, or reject to let matching fullscreen viewport keys or overlay mouse events fall through to the viewport. Non-overlay focused components leave mouse input with `@bastani/atomic-tui` so transcript scrolling, scrollbar dragging, and text selection remain available. |
|
|
76
|
+
| `handleMouse?(event)` | Optional normalized mouse event handler on base `@bastani/atomic-tui` components. |
|
|
77
|
+
| `paintedRowKey?(row)` | Optional stable identity for what the last render drew on `row` so click press/release pairs match the same item across repaints. |
|
|
78
|
+
| `selectionTextMayChangeOnReplay?` | Set `true` when rendered text depends on private state that cannot be replayed from history. |
|
|
79
|
+
| `historyReplayable?` | Set `true` as an own data property on chat render components that can be discarded and recreated from saved entries without losing state. |
|
|
64
80
|
| `wantsKeyRelease?` | If `true`, component receives key release events (Kitty protocol). Default: `false`. |
|
|
65
81
|
| `capturesViewportInput?` | If `true` while focused, fullscreen viewport keys such as PageUp/PageDown go to the component instead of scrolling the transcript, as they do for a focused overlay. `SelectList`, `SettingsList`, and the editor with open autocomplete set it; wrappers can forward it. Default: `false`. |
|
|
66
82
|
| `invalidate()` | Clear cached render state. Called on theme changes. |
|
|
83
|
+
| `dispose?()` | Optional cleanup hook on `ExtensionCustomComponent`, invoked when `ctx.ui.custom()` closes or dismisses the component. |
|
|
67
84
|
|
|
68
85
|
The `@bastani/atomic-tui` `Component` type permits handlers returning `void`; Atomic treats a missing or `undefined` return as unhandled only for matching fullscreen viewport keys or mouse events deferred to a focused overlay. Components that mutate state for such inputs must return `true` so the viewport does not apply them a second time.
|
|
69
86
|
|
|
@@ -190,9 +207,9 @@ Utilities:
|
|
|
190
207
|
|
|
191
208
|
When the theme changes, the TUI calls `invalidate()` on all components. Clear cached render state there so the new theme takes effect.
|
|
192
209
|
|
|
193
|
-
###
|
|
210
|
+
### Why pre-baked theme strings go stale
|
|
194
211
|
|
|
195
|
-
If a component pre-bakes theme colors into strings (via `theme.fg()`, `theme.bg()`, etc.) and caches them, the cached strings contain ANSI escape codes from the old theme.
|
|
212
|
+
If a component pre-bakes theme colors into strings (via `theme.fg()`, `theme.bg()`, etc.) and caches them, the cached strings contain ANSI escape codes from the old theme. Clearing the render cache alone does not update pre-baked strings stored separately.
|
|
196
213
|
|
|
197
214
|
**Wrong approach** (theme colors won't update):
|
|
198
215
|
|
|
@@ -206,12 +223,12 @@ class BadComponent extends Container {
|
|
|
206
223
|
this.content = new Text(theme.fg("accent", message), 1, 0);
|
|
207
224
|
this.addChild(this.content);
|
|
208
225
|
}
|
|
209
|
-
// No invalidate override
|
|
226
|
+
// No invalidate override: parent invalidate only clears
|
|
210
227
|
// child render caches, not the pre-baked content
|
|
211
228
|
}
|
|
212
229
|
```
|
|
213
230
|
|
|
214
|
-
###
|
|
231
|
+
### Rebuilding themed content on invalidate
|
|
215
232
|
|
|
216
233
|
Components that build content with theme colors must rebuild that content when `invalidate()` is called:
|
|
217
234
|
|
|
@@ -274,7 +291,7 @@ class ComplexComponent extends Container {
|
|
|
274
291
|
}
|
|
275
292
|
```
|
|
276
293
|
|
|
277
|
-
### When
|
|
294
|
+
### When to rebuild on invalidate
|
|
278
295
|
|
|
279
296
|
This pattern is needed when:
|
|
280
297
|
|
|
@@ -290,13 +307,19 @@ This pattern is not needed when:
|
|
|
290
307
|
|
|
291
308
|
## Debug logging
|
|
292
309
|
|
|
293
|
-
|
|
310
|
+
Three environment variables capture TUI rendering diagnostics (legacy `PI_*` aliases are also accepted when the `ATOMIC_*` variable is unset):
|
|
311
|
+
|
|
312
|
+
- **`ATOMIC_TUI_WRITE_LOG`** (legacy `PI_TUI_WRITE_LOG`): captures the raw ANSI byte stream written to stdout. Pass a file path, or a directory path to write one `tui-<timestamp>-<pid>.log` file per process.
|
|
313
|
+
- **`ATOMIC_TUI_DEBUG=1`** (legacy `PI_TUI_DEBUG=1`): writes main-screen render snapshots to `/tmp/tui/render-<timestamp>-<random>.log`.
|
|
314
|
+
- **`ATOMIC_TUI_DEBUG_REDRAW=1`** (legacy `PI_TUI_DEBUG_REDRAW=1`): logs full-redraw triggers to `pi-tui-debug.log` in the TUI log directory.
|
|
315
|
+
|
|
316
|
+
Review all captured logs for sensitive content before sharing.
|
|
294
317
|
|
|
295
318
|
```bash
|
|
296
319
|
ATOMIC_TUI_WRITE_LOG=/tmp/tui-ansi.log atomic
|
|
297
320
|
```
|
|
298
321
|
|
|
299
|
-
Use
|
|
322
|
+
Use these captures when reporting a terminal-rendering bug.
|
|
300
323
|
|
|
301
324
|
## Performance
|
|
302
325
|
|
|
@@ -328,11 +351,11 @@ Call `invalidate()` when state changes, then `ctx.ui.requestRender()` from the e
|
|
|
328
351
|
|
|
329
352
|
## Host integration
|
|
330
353
|
|
|
331
|
-
These runtime contracts
|
|
354
|
+
These runtime contracts pair with [Build TUI components](/tui), which provides runnable `ctx.ui.custom()` examples and common interaction patterns.
|
|
332
355
|
|
|
333
|
-
###
|
|
356
|
+
### Controlling terminal autowrap
|
|
334
357
|
|
|
335
|
-
|
|
358
|
+
When running inside Atomic's terminal UI, components do not write escape sequences directly to `process.stdout`. Use the optional `tui.terminal.setAutowrap` setter when a Windows overlay needs to toggle autowrap:
|
|
336
359
|
|
|
337
360
|
```typescript
|
|
338
361
|
await ctx.ui.custom((tui, theme, keybindings, done) => {
|
|
@@ -341,19 +364,19 @@ await ctx.ui.custom((tui, theme, keybindings, done) => {
|
|
|
341
364
|
}, { overlay: true });
|
|
342
365
|
```
|
|
343
366
|
|
|
344
|
-
Only autowrap control is exposed. Atomic restores the mode when the component hides, closes, or
|
|
367
|
+
Only autowrap control is exposed. Atomic restores the previous mode when the component hides, closes, or disposes, or if the terminal host recovers from a crash or restart. Fullscreen mode retains its baseline mouse and autowrap behavior. In custom standalone hosts, `setAutowrap` may be absent; write escape sequences directly only when your component owns the terminal directly.
|
|
345
368
|
|
|
346
|
-
###
|
|
369
|
+
### Detecting fullscreen vs. main-screen mode
|
|
347
370
|
|
|
348
371
|
`tui.mode` is `"fullscreen"` when Atomic paints on the alternate screen and `"regular"` on the main-screen fallback (used under `TERM=dumb`, in CI, or without a TTY).
|
|
349
372
|
|
|
350
|
-
|
|
373
|
+
Each rendered frame updates `tui.mode` to match the active terminal renderer, and Atomic invalidates the component whenever the mode changes. Before the first frame renders, `tui.mode` starts as `"regular"`, so read `tui.mode` inside `render()` rather than caching it inside the factory.
|
|
351
374
|
|
|
352
375
|
### Host-native session picker
|
|
353
376
|
|
|
354
|
-
Use `ctx.ui.hostSessionPicker(request)` for responsive session-list navigation and search,
|
|
377
|
+
Use `ctx.ui.hostSessionPicker(request)` for responsive session-list navigation and search, even while an extension is busy. Pass JSON-safe rows, update or close the picker, and handle selection, cancellation, and confirmed `Ctrl+D` deletion through the API.
|
|
355
378
|
|
|
356
|
-
|
|
379
|
+
This API is available in interactive terminal sessions and absent in headless RPC or print mode; report that limitation instead of building a fallback picker.
|
|
357
380
|
|
|
358
381
|
```typescript
|
|
359
382
|
const picker = ctx.ui.hostSessionPicker?.({
|
|
@@ -379,14 +402,23 @@ Set `canDelete: false` on a row to disable deletion even when `onDelete` is pres
|
|
|
379
402
|
|
|
380
403
|
### Host-native input form
|
|
381
404
|
|
|
382
|
-
Use `ctx.ui.hostInputForm(request)` for a structured inline form in the editor slot. It supports Tab
|
|
405
|
+
Use `ctx.ui.hostInputForm(request)` for a structured inline form in the editor slot. It supports `Tab`/`Shift+Tab`, arrow keys, text editing, configured keybindings, `Enter`, `Escape`, and `Ctrl+C`. The promise rejects with `"The host could not read this input form."` if the host cannot read the form.
|
|
383
406
|
|
|
384
407
|
```typescript
|
|
385
408
|
try {
|
|
386
409
|
const values = await ctx.ui.hostInputForm?.({
|
|
387
410
|
title: "Release",
|
|
411
|
+
heading: "Prepare release", // optional panel heading label
|
|
412
|
+
submitLabel: "Publish", // optional submit button label
|
|
388
413
|
fields: [
|
|
389
|
-
{
|
|
414
|
+
{
|
|
415
|
+
name: "version",
|
|
416
|
+
type: "string",
|
|
417
|
+
description: "Semantic version tag",
|
|
418
|
+
placeholder: "1.2.3",
|
|
419
|
+
required: true,
|
|
420
|
+
initialValue: "",
|
|
421
|
+
},
|
|
390
422
|
{ name: "channel", type: "select", choices: ["stable", "beta"], initialValue: "stable" },
|
|
391
423
|
],
|
|
392
424
|
});
|
|
@@ -396,7 +428,7 @@ try {
|
|
|
396
428
|
}
|
|
397
429
|
```
|
|
398
430
|
|
|
399
|
-
|
|
431
|
+
`HostInputFormRequest` accepts `title`, `fields`, optional `heading`, and optional `submitLabel`. Each `HostInputFormField` accepts `name`, `type` (`"string"`, `"text"`, `"number"`, `"integer"`, `"boolean"`, or `"select"`), `initialValue` (raw string), and optional `description`, `placeholder`, `required`, and `choices`. Returned values are raw strings; your extension owns parsing and domain coercion.
|
|
400
432
|
|
|
401
433
|
Every current interactive Atomic host exposes the optional capability, while headless RPC and print surfaces omit it. Keep a legacy fallback only when compatibility with older hosts is required.
|
|
402
434
|
|
package/docs/tui.md
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "TUI components"
|
|
3
|
-
|
|
2
|
+
title: "Build TUI components"
|
|
3
|
+
sidebarTitle: "TUI components"
|
|
4
|
+
description: "Build custom interactive terminal UI components, overlays, selectors, widgets, and editors for Atomic extensions."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and common interaction patterns.
|
|
9
|
-
|
|
10
|
-
**Source:** TUI components come from Atomic's `@bastani/atomic-tui` runtime dependency. The [`@bastani/atomic-tui` library page](/libraries/tui) documents its full API, including standalone use outside Atomic.
|
|
11
|
-
|
|
12
|
-
## On this page and its reference
|
|
13
|
-
|
|
14
|
-
This page covers writing your first component and common interaction patterns. The component and focusable interfaces, host terminal modes, the host-native session picker and input form, keyboard input, line width, invalidation, debug logging, and performance contracts live in the [TUI API reference](/tui/reference).
|
|
7
|
+
Extensions and custom tools can render custom terminal UI (TUI) components for interactive workflows. This guide covers `ctx.ui.custom()`, overlays, built-in components, theming, and common patterns. For the full `Component`, `ExtensionCustomComponent`, `Focusable`, keyboard, invalidation, debug logging, and host-native UI contracts, see [TUI API reference](/tui/reference) and [`@bastani/atomic-tui`](/libraries/tui).
|
|
15
8
|
|
|
16
9
|
## Using components
|
|
17
10
|
|
|
18
|
-
Use `ctx.ui.custom()` with a component factory. The factory receives `done(result)`, and `ctx.ui.custom()` resolves with that
|
|
11
|
+
Use `ctx.ui.custom()` with a synchronous or `async` component factory (`ExtensionCustomComponent | Promise<ExtensionCustomComponent>`). The factory receives `done(result)`, and `ctx.ui.custom()` resolves with that value when the component calls `done()`. Components may also implement `dispose?(): void` for cleanup when dismissed.
|
|
19
12
|
|
|
20
13
|
```typescript
|
|
21
14
|
atomic.on("session_start", async (_event, ctx) => {
|
|
@@ -26,23 +19,20 @@ atomic.on("session_start", async (_event, ctx) => {
|
|
|
26
19
|
});
|
|
27
20
|
```
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
For inspection or navigation, pass `{ purpose: "navigation" }` so Atomic mounts the component without emitting `ui_prompt_start` or `ui_prompt_end` (preventing persistent viewers from reporting the session as blocked). Inline navigation temporarily hides all `ctx.ui.setWidget()` widgets above and below the editor, including the agent panel, plus queued-message and pending-shell previews, restoring them when the last inline navigation view closes. Overlays do not hide them. The default purpose is `"prompt"` (for approvals and required user decisions); prompts opened during navigation still emit their own lifecycle events.
|
|
22
|
+
Key options for `ctx.ui.custom(factory, options?)`:
|
|
32
23
|
|
|
33
|
-
|
|
24
|
+
- **`handlesCtrlC?: boolean`:** By default (`false`), Atomic closes a custom component on the first `Ctrl+C` so a wedged component cannot trap the keyboard. Set `handlesCtrlC: true` only when your component handles `Ctrl+C` itself (for example to cancel, skip, or close cleanly).
|
|
25
|
+
- **`handlesInternalUiAction?: boolean`:** Set `true` when the component claims internal UI actions such as clicking the jump-to-bottom URL.
|
|
26
|
+
- **`signal?: AbortSignal`:** Dismisses the component and releases input ownership when aborted. Inside Atomic's CLI terminal UI, aborting resolves with `undefined` (matching user cancellation); in an embedded SDK TUI host, aborting rejects with `signal.reason`.
|
|
27
|
+
- **`purpose?: "prompt" | "navigation"`:** Defaults to `"prompt"` (for approvals and required user decisions). Pass `{ purpose: "navigation" }` for inspection or browsing views so Atomic mounts the component without emitting `ui_prompt_start`/`ui_prompt_end`. Inline navigation temporarily hides `ctx.ui.setWidget()` widgets, the agent panel, and queued previews until the last inline navigation view closes (overlays do not hide them). In `getHostCustomUiState()`, `blockingInlineCustomUiActive` counts all inline mounts while `blockingInlineCustomUiNeedsInput` distinguishes required prompts from navigation views.
|
|
28
|
+
- **`blocked?: { kind: "question" | "permission" | "auth", message: string }`:** Reports Atomic as waiting for user input through [program status](/terminal-setup#program-status). Inline components report blocked while visible; overlays report blocked from mount until `done()` or `signal` abort, even while hidden with `setHidden()` or covered by another overlay. When several blocking prompts are open, the most recently shown one supplies `kind` and `message`.
|
|
29
|
+
- **`overlay?: boolean`, `overlayOptions?: OverlayOptions | (() => OverlayOptions)`, `onHandle?: (handle: OverlayHandle) => void`:** Mounts the component as a floating overlay (see [Overlays](#overlays)). `overlayOptions` may be a static object or a callback evaluated dynamically on render.
|
|
30
|
+
- **`deferInlineCustomUiFocus?: boolean`:** Overlay option that keeps pending inline custom UI deferred in the background while the overlay holds focus.
|
|
31
|
+
- **`reserveTranscriptRows?: boolean`:** Overlay-only option for blocking bottom-anchored dialogs (such as `ask_user_question`). Requires a bottom anchor (`bottom-left`, `bottom-center`, or `bottom-right`), rejects `row` and nonzero `offsetY`, leaves at least 6 transcript rows visible above the overlay, and extends transcript scrollback so every line can scroll into view. On short terminals, embed `OVERLAY_ACTIVE_ROW_MARKER` (exported from `@bastani/atomic`) once per frame in your selected row so Atomic windows the cropped overlay around that row instead of clipping it from the top.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
Main-chat inline custom UIs share the editor slot. Completing an older mount leaves the current one visible; closing the current mount restores the most recent pending inline UI, and the main editor returns only after the last inline owner closes. Reserving bottom prompts (`reserveTranscriptRows`) wait out of view while inline navigation or an overlay with `deferInlineCustomUiFocus` owns input, and `Escape` belongs to the active navigation view until it closes.
|
|
36
34
|
|
|
37
|
-
-
|
|
38
|
-
- Overlays report blocked from mount until `done()` or `signal` abort, even while hidden with `setHidden()` or covered by another overlay.
|
|
39
|
-
- When several blocking prompts are open, the most recently shown one supplies `kind` and `message`.
|
|
40
|
-
|
|
41
|
-
Main-chat inline custom UIs share the editor slot. Completing an older mount leaves the current one visible; closing the current mount restores the most recent pending inline UI, and the main editor returns only after the last inline owner closes.
|
|
42
|
-
|
|
43
|
-
Reserving bottom prompts (`reserveTranscriptRows`, including `ask_user_question`) wait out of view while inline navigation or an overlay with `deferInlineCustomUiFocus` owns input. Leaving navigation restores the same pending prompt, and `Escape` belongs exclusively to the active navigation view until then.
|
|
44
|
-
|
|
45
|
-
In isolated interactive mode, do not access host process objects from `render()` or `handleInput()`. Return JSON-safe values to `done()`. Return `true` for consumed viewport keys or overlay mouse events and `false` to let the transcript handle them. Set `wantsKeyRelease = true` only when your component needs release events. Non-overlay components leave mouse scrolling and selection with the transcript.
|
|
35
|
+
Do not rely on host process globals from `render()` or `handleInput()`, and pass only JSON-safe values to `done()`. Return `true` for consumed viewport keys or overlay mouse events and `false` to let the transcript handle them. Set `wantsKeyRelease = true` only when your component needs key release events. Non-overlay components leave mouse scrolling and selection with the transcript.
|
|
46
36
|
|
|
47
37
|
## Overlays
|
|
48
38
|
|
|
@@ -55,7 +45,7 @@ const result = await ctx.ui.custom<string | null>(
|
|
|
55
45
|
);
|
|
56
46
|
```
|
|
57
47
|
|
|
58
|
-
For positioning and sizing,
|
|
48
|
+
For positioning and sizing, pass `overlayOptions` as a static object or a `() => OverlayOptions` function for dynamic updates:
|
|
59
49
|
|
|
60
50
|
```typescript
|
|
61
51
|
const result = await ctx.ui.custom<string | null>(
|
|
@@ -309,8 +299,8 @@ renderResult(result, options, theme, context) {
|
|
|
309
299
|
**Foreground colors** (`theme.fg(color, text)`):
|
|
310
300
|
|
|
311
301
|
| Category | Colors |
|
|
312
|
-
|
|
313
|
-
| General | `text`, `accent`, `muted`, `dim` |
|
|
302
|
+
| --- | --- |
|
|
303
|
+
| General | `text`, `accent`, `muted`, `dim`, `searchMatchText` |
|
|
314
304
|
| Status | `success`, `error`, `warning` |
|
|
315
305
|
| Borders | `border`, `borderAccent`, `borderMuted` |
|
|
316
306
|
| Messages | `userMessageText`, `customMessageText`, `customMessageLabel` |
|
|
@@ -318,12 +308,12 @@ renderResult(result, options, theme, context) {
|
|
|
318
308
|
| Diffs | `toolDiffAdded`, `toolDiffRemoved`, `toolDiffContext` |
|
|
319
309
|
| Markdown | `mdHeading`, `mdLink`, `mdLinkUrl`, `mdCode`, `mdCodeBlock`, `mdCodeBlockBorder`, `mdQuote`, `mdQuoteBorder`, `mdHr`, `mdListBullet` |
|
|
320
310
|
| Syntax | `syntaxComment`, `syntaxKeyword`, `syntaxFunction`, `syntaxVariable`, `syntaxString`, `syntaxNumber`, `syntaxType`, `syntaxOperator`, `syntaxPunctuation` |
|
|
321
|
-
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
|
|
311
|
+
| Thinking | `thinkingText`, `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
|
|
322
312
|
| Modes | `bashMode` |
|
|
323
313
|
|
|
324
314
|
**Background colors** (`theme.bg(color, text)`):
|
|
325
315
|
|
|
326
|
-
`selectedBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`
|
|
316
|
+
`selectedBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`, `scrollbarThumb`, `searchMatchBg`
|
|
327
317
|
|
|
328
318
|
**For Markdown**, use `getMarkdownTheme()`:
|
|
329
319
|
|
|
@@ -481,7 +471,7 @@ atomic.registerCommand("pick", {
|
|
|
481
471
|
|
|
482
472
|
**Examples:** [preset.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/preset.ts), [tools.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/tools.ts)
|
|
483
473
|
|
|
484
|
-
### Pattern 2: Async
|
|
474
|
+
### Pattern 2: Async operation with cancel (`BorderedLoader`)
|
|
485
475
|
|
|
486
476
|
For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
|
|
487
477
|
|
|
@@ -513,7 +503,7 @@ atomic.registerCommand("fetch", {
|
|
|
513
503
|
|
|
514
504
|
**Examples:** [qna.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/qna.ts), [handoff.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/handoff.ts)
|
|
515
505
|
|
|
516
|
-
### Pattern 3: Settings
|
|
506
|
+
### Pattern 3: Settings and toggles (`SettingsList`)
|
|
517
507
|
|
|
518
508
|
For toggling multiple settings. Use `SettingsList` from `@bastani/atomic-tui` with `getSettingsListTheme()`.
|
|
519
509
|
|
|
@@ -560,7 +550,7 @@ atomic.registerCommand("settings", {
|
|
|
560
550
|
|
|
561
551
|
**Examples:** [tools.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/tools.ts)
|
|
562
552
|
|
|
563
|
-
### Pattern 4: Persistent
|
|
553
|
+
### Pattern 4: Persistent status indicator
|
|
564
554
|
|
|
565
555
|
Show status in the footer that persists across renders. Good for mode indicators.
|
|
566
556
|
|
|
@@ -610,7 +600,7 @@ Compaction and retry loaders use their own factual text and the built-in indicat
|
|
|
610
600
|
|
|
611
601
|
**Examples:** [working-indicator.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/working-indicator.ts)
|
|
612
602
|
|
|
613
|
-
### Pattern 5: Widgets
|
|
603
|
+
### Pattern 5: Widgets above or below the editor
|
|
614
604
|
|
|
615
605
|
Show persistent content above or below the input editor. Good for todo lists, progress.
|
|
616
606
|
|
|
@@ -645,7 +635,7 @@ The listener runs after the host removes that key, so the extension can reset lo
|
|
|
645
635
|
|
|
646
636
|
Opt in with `scroll: { maxHeight: 6 }` to give a widget its own fullscreen viewport. The host may allocate fewer rows when the editor or other widgets need space. Render the full content, not a pre-clipped slice. Wheel input over the widget scrolls only that widget, including at either end. A one-column scrollbar appears only while content overflows. Scrolling does not take editor focus or register keyboard shortcuts.
|
|
647
637
|
|
|
648
|
-
For a cap that follows terminal resizing, use `scroll: { maxHeight: 10, maxHeightFraction: 1 / 3 }`. The fraction
|
|
638
|
+
For a cap that follows terminal resizing, use `scroll: { maxHeight: 10, maxHeightFraction: 1 / 3 }`. The fraction applies to live terminal rows, rounded down with a one-row minimum, then capped at `maxHeight`. Actual allocation may still be zero when other dock content uses all available rows. Omitting the fraction keeps the fixed cap.
|
|
649
639
|
|
|
650
640
|
```typescript
|
|
651
641
|
import type { ScrollableWidgetComponent, WidgetScrollRequest } from "@bastani/atomic";
|
|
@@ -673,11 +663,11 @@ ctx.ui.requestRender();
|
|
|
673
663
|
|
|
674
664
|
`getScrollRequest` and `onScroll` are optional. Keep the request version unchanged during ordinary updates so they do not reset wheel scrolling. New positions are clamped to the actual viewport. Requests with older versions are ignored. Unmounting starts a fresh viewport. Keep item identity and insertion/deletion anchors in your extension; positions here count rendered rows.
|
|
675
665
|
|
|
676
|
-
`installReactiveWidget` accepts the same `scroll`, `getScrollRequest`, and `onScroll` options. Existing widgets remain unscrolled unless they opt in.
|
|
666
|
+
`installReactiveWidget` accepts the same `scroll`, `getScrollRequest`, and `onScroll` options. Existing widgets remain unscrolled unless they opt in. Native wheel input requires fullscreen mode and a terminal that forwards mouse events; the main-screen fallback (such as `TERM=dumb` or non-TTY sessions) does not provide a native viewport. No Option/Alt key setup is required for wheel input.
|
|
677
667
|
|
|
678
668
|
**Examples:** [plan-mode/index.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/plan-mode/index.ts)
|
|
679
669
|
|
|
680
|
-
### Pattern 6: Custom
|
|
670
|
+
### Pattern 6: Custom footer
|
|
681
671
|
|
|
682
672
|
Replace the footer. `footerData` exposes data not otherwise accessible to extensions.
|
|
683
673
|
|
|
@@ -695,7 +685,7 @@ ctx.ui.setFooter((tui, theme, footerData) => ({
|
|
|
695
685
|
ctx.ui.setFooter(undefined); // restore default
|
|
696
686
|
```
|
|
697
687
|
|
|
698
|
-
`ctx.ui.getFooterDataProvider()` exposes the same read-only status and Git-branch provider to embedded extension UIs
|
|
688
|
+
`ctx.ui.getFooterDataProvider()` exposes the same read-only status and Git-branch provider to embedded extension UIs in Atomic's terminal UI.
|
|
699
689
|
|
|
700
690
|
For a viewer with a different cwd, subscribe with that cwd to retain its branch watcher, and read the live branch during each render using the same raw cwd string:
|
|
701
691
|
|
|
@@ -718,7 +708,7 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
|
|
|
718
708
|
|
|
719
709
|
**Examples:** [custom-footer.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/custom-footer.ts)
|
|
720
710
|
|
|
721
|
-
### Pattern 7: Custom
|
|
711
|
+
### Pattern 7: Custom editor (vim mode)
|
|
722
712
|
|
|
723
713
|
Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
|
|
724
714
|
|
|
@@ -787,14 +777,14 @@ export default function (atomic: ExtensionAPI) {
|
|
|
787
777
|
|
|
788
778
|
- **Extend `CustomEditor`** (not base `Editor`) to get app keybindings (escape to abort, ctrl+d to exit, model switching, etc.)
|
|
789
779
|
- **Call `super.handleInput(data)`** for keys you don't handle
|
|
790
|
-
-
|
|
791
|
-
- **Factory pattern**: `setEditorComponent` receives a factory function that gets `tui`, `theme`, and `keybindings
|
|
792
|
-
- **Autocomplete limit**:
|
|
793
|
-
- **Pass `undefined`** to restore the default editor: `ctx.ui.setEditorComponent(undefined)
|
|
780
|
+
- **`CustomEditorOptions`**: The optional fourth argument to `new CustomEditor(tui, theme, keybindings, options?)` accepts `{ promptPrefix?, placeholder?, embedWorkingStatus?, topRuleLabel?, paddingX?, autocompleteMaxVisible? }`. Editors keep the standalone working row by default; pass `{ embedWorkingStatus: true }` to render the working spinner in the editor's top border.
|
|
781
|
+
- **Factory pattern**: `setEditorComponent` receives a factory function that gets `tui`, `theme`, and `keybindings`.
|
|
782
|
+
- **Autocomplete limit**: Custom editors installed through `setEditorComponent()` that expose `setAutocompleteMaxVisible()` inherit the active `autocompleteMaxVisible` setting.
|
|
783
|
+
- **Pass `undefined`** to restore the default editor: `ctx.ui.setEditorComponent(undefined)`.
|
|
794
784
|
|
|
795
785
|
**Examples:** [modal-editor.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/modal-editor.ts)
|
|
796
786
|
|
|
797
|
-
### Pattern 7b: Attached
|
|
787
|
+
### Pattern 7b: Attached composer
|
|
798
788
|
|
|
799
789
|
When an extension or custom SDK host embeds a secondary chat editor, `applyAttachedComposer(style, label, placeholder, lines)` distinguishes it from the main prompt: accent-coloured rules above and below the prompt, the top rule ending in a bold `label`, and a dim `placeholder` after the cursor while nothing is typed.
|
|
800
790
|
|
|
@@ -831,7 +821,7 @@ export default function (atomic: ExtensionAPI) {
|
|
|
831
821
|
}
|
|
832
822
|
```
|
|
833
823
|
|
|
834
|
-
It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N more`: a first or last line that is not a rule, such as one your editor draws itself, is left
|
|
824
|
+
It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N more`: a first or last line that is not a rule, such as one your editor draws itself, is left unchanged. Composer rules draw with the light box-drawing glyph (`─`). A long label truncates with `…` to fit, and below `INPUT_LABEL_MIN_COLUMNS` (40) columns, the light `─` rules render without the label. Pass `undefined` for `label` or `placeholder` to omit either.
|
|
835
825
|
|
|
836
826
|
## Key rules
|
|
837
827
|
|
|
@@ -841,7 +831,7 @@ It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N mo
|
|
|
841
831
|
|
|
842
832
|
3. **Call `tui.requestRender()` after state changes.** In `handleInput`, call `tui.requestRender()` after updating state.
|
|
843
833
|
|
|
844
|
-
4. **Return the
|
|
834
|
+
4. **Return the component object.** Custom components implement `{ render, invalidate, handleInput?, dispose? }`.
|
|
845
835
|
|
|
846
836
|
5. **Use existing components.** `Selector`, `SelectList`, `SettingsList`, and `BorderedLoader` cover most interactive UI cases.
|
|
847
837
|
|
|
@@ -857,22 +847,4 @@ It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N mo
|
|
|
857
847
|
- **Snake game**: [examples/extensions/snake.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/snake.ts): game with keyboard input and game loop.
|
|
858
848
|
- **Custom tool rendering**: [examples/extensions/todo.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/todo.ts): `renderCall` and `renderResult`.
|
|
859
849
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
<a id="component-interface" />
|
|
863
|
-
<a id="focusable-interface-ime-support" />
|
|
864
|
-
<a id="container-components-with-embedded-inputs" />
|
|
865
|
-
<a id="host-terminal-modes-from-an-isolated-component" />
|
|
866
|
-
<a id="host-native-session-picker" />
|
|
867
|
-
<a id="host-native-input-form" />
|
|
868
|
-
<a id="keyboard-input" />
|
|
869
|
-
<a id="line-width" />
|
|
870
|
-
<a id="debug-logging" />
|
|
871
|
-
<a id="performance" />
|
|
872
|
-
<a id="invalidation-and-theme-changes" />
|
|
873
|
-
<a id="the-problem" />
|
|
874
|
-
<a id="the-solution" />
|
|
875
|
-
<a id="pattern-rebuild-on-invalidate" />
|
|
876
|
-
<a id="when-this-matters" />
|
|
877
|
-
|
|
878
|
-
These component, input, invalidation, logging, performance, and host-integration contracts moved to [TUI API reference](/tui/reference).
|
|
850
|
+
For component, focusable, keyboard input, invalidation, debug logging, and host-native UI contracts, continue to [TUI API reference](/tui/reference).
|