@bastani/atomic 0.10.14 → 0.10.15-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
- package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +2 -2
- package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
- package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
- package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
- package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
- package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
- package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
- package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
- package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
- package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
- package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.code.js +1 -1
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.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 +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +1 -1
- 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 +1 -1
- 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/compaction/compactor.d.ts +0 -8
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- 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 +2 -2
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +1 -1
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +3 -3
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- 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/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 +2 -2
- 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 +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +1 -1
- 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.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +1 -1
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.d.ts +21 -1
- package/dist/index.js +2 -2
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/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/print-mode.js +1 -1
- package/dist/package-manager-cli.code.js +2 -2
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/utils/startup-database-spare.code.js +1 -1
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks/reference.md +182 -0
- package/docs/background-tasks.md +98 -405
- package/docs/build.md +67 -27
- package/docs/changelog.mdx +11 -1
- package/docs/codemode.md +108 -39
- package/docs/compaction/branch-summaries.md +54 -0
- package/docs/compaction/custom-compactors.md +161 -0
- package/docs/compaction/memory-compaction.md +77 -0
- package/docs/compaction/reference.md +86 -38
- package/docs/compaction.md +51 -252
- package/docs/computer-use.md +169 -321
- package/docs/containerization.md +71 -57
- package/docs/custom-provider/api-reference.md +119 -25
- package/docs/custom-provider/oauth.md +114 -132
- package/docs/custom-provider/override.md +37 -27
- package/docs/custom-provider/registration.md +107 -83
- package/docs/custom-provider/streaming.md +85 -71
- package/docs/custom-provider.md +85 -52
- package/docs/development.md +39 -29
- package/docs/docs.json +80 -67
- package/docs/environment-variables.md +94 -44
- package/docs/extensions/api-reference.md +86 -43
- package/docs/extensions/authoring.md +162 -154
- package/docs/extensions/events.md +80 -25
- package/docs/extensions/examples.md +90 -85
- package/docs/extensions/ui.md +206 -82
- package/docs/extensions.md +79 -108
- package/docs/getting-started/authentication.md +67 -36
- package/docs/getting-started/first-session.md +53 -43
- package/docs/getting-started/installation.md +117 -90
- package/docs/getting-started/project-instructions.md +48 -34
- package/docs/guides/configuration.md +82 -20
- package/docs/guides/non-interactive.md +66 -24
- package/docs/guides/resume-on-any-machine.md +135 -82
- package/docs/guides/team-setup.md +114 -105
- package/docs/guides.md +76 -32
- package/docs/herdr.md +16 -17
- package/docs/how-atomic-works.md +140 -0
- package/docs/index.md +58 -44
- package/docs/intercom/operations.md +141 -151
- package/docs/intercom/reference.md +85 -108
- package/docs/intercom.md +84 -145
- package/docs/json.md +120 -67
- package/docs/keybindings.md +85 -49
- package/docs/libraries/agent-core.md +137 -275
- package/docs/libraries/ai.md +100 -84
- package/docs/libraries/codemode.md +210 -300
- package/docs/libraries/schema.md +59 -53
- package/docs/libraries/storage-postgres.md +49 -35
- package/docs/libraries/telemetry.md +153 -354
- package/docs/libraries/tui.md +265 -393
- package/docs/libraries.md +42 -26
- package/docs/llama-cpp.md +171 -161
- package/docs/mcp-servers.md +90 -51
- package/docs/models/choose-a-model.md +188 -0
- package/docs/models/reference.md +74 -30
- package/docs/models.md +153 -88
- package/docs/orchestration/migrating-workflows.md +23 -16
- package/docs/orchestration/patterns.md +39 -44
- package/docs/orchestration.md +65 -26
- package/docs/packages/authoring.md +51 -29
- package/docs/packages/reference.md +42 -21
- package/docs/packages.md +69 -58
- package/docs/programmatic.md +118 -24
- package/docs/prompt-templates.md +84 -83
- package/docs/providers/reference.md +43 -48
- package/docs/providers.md +219 -451
- package/docs/quickstart.md +140 -120
- package/docs/reference/cli.md +135 -97
- package/docs/reference.md +20 -19
- package/docs/rpc/examples.md +76 -20
- package/docs/rpc/extension-ui.md +64 -38
- package/docs/rpc/protocol.md +361 -110
- package/docs/rpc.md +57 -17
- package/docs/sdk/reference.md +409 -534
- package/docs/sdk/storage.md +53 -13
- package/docs/sdk/structured-decisions.md +82 -56
- package/docs/sdk/web-server.md +57 -43
- package/docs/sdk.md +106 -84
- package/docs/security.md +42 -64
- package/docs/session-format.md +62 -38
- package/docs/sessions.md +99 -214
- package/docs/settings.md +165 -195
- package/docs/shell-aliases.md +9 -6
- package/docs/skills/authoring.md +69 -48
- package/docs/skills/reference.md +51 -20
- package/docs/skills.md +99 -148
- package/docs/slash-commands.md +129 -0
- package/docs/storage/custom-adapters.md +160 -85
- package/docs/storage/jsonl.md +81 -66
- package/docs/storage/postgres/pgbouncer.md +120 -126
- package/docs/storage/postgres/tuning.md +120 -143
- package/docs/storage/postgres.md +314 -330
- package/docs/storage/sqlite.md +71 -42
- package/docs/storage.md +298 -302
- package/docs/subagents/authoring.md +55 -38
- package/docs/subagents/reference.md +73 -33
- package/docs/subagents.md +119 -187
- package/docs/terminal-setup.md +51 -39
- package/docs/themes/reference.md +23 -19
- package/docs/themes.md +142 -127
- package/docs/tmux.md +47 -55
- package/docs/tools.md +147 -109
- package/docs/tui/reference.md +166 -214
- package/docs/tui.md +196 -341
- package/docs/usage.md +118 -138
- package/docs/verification.md +79 -51
- package/docs/web-access.md +121 -101
- package/docs/windows.md +26 -27
- package/docs/worktree-snapshots/reference.md +245 -0
- package/docs/worktree-snapshots.md +71 -259
- package/package.json +8 -8
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
- package/docs/guides/intercom.md +0 -32
- package/docs/guides/orchestration.md +0 -28
- package/docs/guides/subagents.md +0 -37
- package/docs/termux.md +0 -118
package/docs/prompt-templates.md
CHANGED
|
@@ -1,63 +1,41 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
sidebarTitle: "
|
|
2
|
+
title: "Create prompt templates"
|
|
3
|
+
sidebarTitle: "Create prompt templates"
|
|
4
4
|
description: "Create reusable Markdown slash commands with bash-style argument placeholders, defaults, and slicing."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Prompt templates are Markdown snippets that expand into full prompts
|
|
7
|
+
Prompt templates are reusable Markdown snippets that expand into full prompts when you type `/name` in Atomic, where `name` is the filename without `.md`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use prompt templates for recurring prompts you invoke yourself with no code or build step. Use a [skill](/skills) when the model should decide when to load instructions, or an [extension](/extensions) when you need TypeScript code.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Create your first template
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- **Global:** `~/.atomic/agent/prompts/*.md` (legacy `~/.pi/agent/prompts/*.md`)
|
|
18
|
-
- **Project** (only after you grant [project trust](/security#project-trust)): `.atomic/prompts/*.md` (legacy `.pi/prompts/*.md`)
|
|
19
|
-
- **Packages:** `prompts/` directories, `atomic.prompts`, or legacy `pi.prompts` entries in `package.json`
|
|
20
|
-
- **Settings:** `prompts` array in global or project `settings.json` ([Resource settings](/settings#resources)), which accepts files, directories, and filter patterns (`!glob`, `+path`, `-path` with `~` expansion; see [Package filtering](/packages/reference#package-filtering))
|
|
21
|
-
- **CLI:** `--prompt-template <path>` (repeatable; accepts either a `.md` file or a directory, and still loads with `--no-prompt-templates`; see [CLI resource options](/reference/cli#resource-options))
|
|
22
|
-
|
|
23
|
-
Disable default discovery with `--no-prompt-templates` (short flag `-np`). Explicit `--prompt-template` paths and `-e` package prompts still load.
|
|
24
|
-
|
|
25
|
-
### Discovery and precedence rules
|
|
26
|
-
|
|
27
|
-
- Auto-discovery in `~/.atomic/agent/prompts/` and `.atomic/prompts/` is non-recursive. To load templates from subdirectories, add them explicitly in `settings.json` `prompts` or in a package manifest.
|
|
28
|
-
- Scanning skips dotfiles, `node_modules`, broken symlinks, and files matched by `.gitignore`, `.ignore`, or `.fdignore` inside the `prompts/` directory. Direct symlinks to `.md` files are followed.
|
|
29
|
-
- When multiple templates share a filename, Atomic keeps the first match in this order:
|
|
30
|
-
1. Packages passed with `-e` / `--extension`
|
|
31
|
-
2. Project `settings.json` `prompts` array
|
|
32
|
-
3. Project auto-discovered directories (`.atomic/prompts/`, then legacy `.pi/prompts/`)
|
|
33
|
-
4. Global `settings.json` `prompts` array
|
|
34
|
-
5. Global auto-discovered directories (`~/.atomic/agent/prompts/`, then legacy `~/.pi/agent/prompts/`)
|
|
35
|
-
6. Configured packages (project packages, then global packages)
|
|
36
|
-
7. Bundled packages
|
|
37
|
-
8. Explicit CLI `--prompt-template <path>` paths
|
|
38
|
-
- Exception: if an inherited legacy `.pi` template collides with a bundled template, the bundled template wins.
|
|
39
|
-
- Built-in interactive commands and extension slash commands take precedence over prompt templates with the same name.
|
|
13
|
+
<Steps>
|
|
14
|
+
<Step title="Save a Markdown file">
|
|
15
|
+
Create `.atomic/prompts/review.md` for your project (or `~/.atomic/agent/prompts/review.md` for every project):
|
|
40
16
|
|
|
41
|
-
|
|
17
|
+
```markdown
|
|
18
|
+
---
|
|
19
|
+
description: Review staged git changes
|
|
20
|
+
argument-hint: "[focus area]"
|
|
21
|
+
---
|
|
22
|
+
Review the staged changes (`git diff --cached`).
|
|
23
|
+
Focus: ${1:-correctness, security, and error handling}.
|
|
24
|
+
```
|
|
25
|
+
</Step>
|
|
26
|
+
<Step title="Reload your session">
|
|
27
|
+
Run `/reload` in an active Atomic session so it picks up the new template without restarting.
|
|
28
|
+
</Step>
|
|
29
|
+
<Step title="Invoke the command">
|
|
30
|
+
Type `/review` or `/review "auth edge cases"` in the editor. Autocomplete shows the command, its `argument-hint`, and its `description`.
|
|
31
|
+
</Step>
|
|
32
|
+
</Steps>
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
description: Review staged git changes
|
|
46
|
-
---
|
|
47
|
-
Review the staged changes (`git diff --cached`). Focus on:
|
|
48
|
-
- Bugs and logic errors
|
|
49
|
-
- Security issues
|
|
50
|
-
- Error handling gaps
|
|
51
|
-
```
|
|
34
|
+
## Format and frontmatter
|
|
52
35
|
|
|
53
|
-
- The filename becomes the command
|
|
54
|
-
- `description` is optional. If omitted, Atomic uses the first non-empty line of the template body, truncated to 60 characters with
|
|
55
|
-
- `argument-hint` is optional.
|
|
56
|
-
- Invalid YAML frontmatter (for example an unquoted `description: Broken: value`) skips only that template and reports a warning naming the file and parse position. Valid sibling templates still load.
|
|
57
|
-
|
|
58
|
-
### Argument hints
|
|
59
|
-
|
|
60
|
-
Use `argument-hint` in frontmatter to show expected arguments in autocomplete. Use `<angle brackets>` for required arguments and `[square brackets]` for optional ones:
|
|
36
|
+
- The filename becomes the slash command: `review.md` registers `/review`.
|
|
37
|
+
- `description` is optional. If omitted (or set to a non-string YAML value), Atomic uses the first non-empty line of the template body, truncated to 60 characters with `...`.
|
|
38
|
+
- `argument-hint` is optional (non-string YAML values are ignored). Use `<angle brackets>` for required arguments and `[square brackets]` for optional ones; Atomic shows the hint before the description in autocomplete:
|
|
61
39
|
|
|
62
40
|
```markdown
|
|
63
41
|
---
|
|
@@ -66,8 +44,6 @@ argument-hint: "<PR-URL>"
|
|
|
66
44
|
---
|
|
67
45
|
```
|
|
68
46
|
|
|
69
|
-
This renders in the autocomplete dropdown as:
|
|
70
|
-
|
|
71
47
|
```text
|
|
72
48
|
→ pr <PR-URL> Review PRs from URLs with structured issue and code analysis
|
|
73
49
|
is <issue> Analyze GitHub issues (bugs or feature requests)
|
|
@@ -75,37 +51,38 @@ This renders in the autocomplete dropdown as:
|
|
|
75
51
|
cl Audit changelog entries before release
|
|
76
52
|
```
|
|
77
53
|
|
|
78
|
-
|
|
54
|
+
<Warning>
|
|
55
|
+
Invalid YAML frontmatter (such as an unquoted colon in `description: Broken: value`) skips only that template and reports a warning with the filename and parse position. Valid sibling templates still load.
|
|
56
|
+
</Warning>
|
|
79
57
|
|
|
80
|
-
|
|
58
|
+
## Use prompt templates
|
|
59
|
+
|
|
60
|
+
Type `/` followed by the template name and any arguments:
|
|
81
61
|
|
|
82
62
|
```text
|
|
83
63
|
/review # Expands review.md
|
|
84
|
-
/component Button # Expands with argument
|
|
85
|
-
/component Button "click handler" #
|
|
64
|
+
/component Button # Expands with one argument
|
|
65
|
+
/component Button "click handler" # Expands with multiple arguments
|
|
86
66
|
```
|
|
87
67
|
|
|
88
|
-
The
|
|
89
|
-
|
|
90
|
-
|
|
68
|
+
- **Multiline arguments.** The command name ends at the first space, tab, or line break, so arguments can start on the next line with `Shift+Enter`, and line breaks inside arguments are preserved.
|
|
69
|
+
- **Subagent views.** While viewing a subagent, invoking a prompt template expands and sends the prompt to that subagent instead of `main` ([Commands while viewing a subagent](/background-tasks/reference#commands-while-viewing-a-subagent)).
|
|
70
|
+
- **Non-interactive and queued inputs.** Prompt templates also expand in print (`-p`), JSON, and RPC modes as well as queued `steer` and `followUp` messages. From extensions, `atomic.sendUserMessage()` expands templates only when `{ expandPromptTemplates: true }` is passed. Skill commands (`/skill:...`) expand before prompt templates.
|
|
91
71
|
|
|
92
72
|
## Arguments and placeholders
|
|
93
73
|
|
|
94
|
-
Templates support bash-style positional arguments, defaults, and slicing. Substitution
|
|
74
|
+
Templates support bash-style positional arguments, defaults, and slicing. Substitution runs in a single pass (not recursively), so argument values containing `$1` or `$@` stay literal text.
|
|
95
75
|
|
|
96
76
|
| Placeholder | Expansion |
|
|
97
77
|
| --- | --- |
|
|
98
|
-
| `$1`, `$2`, `$10`, ... |
|
|
78
|
+
| `$1`, `$2`, `$10`, ... | 1-based positional argument. Missing arguments and `$0` expand to `""`. |
|
|
99
79
|
| `$@` or `$ARGUMENTS` | All arguments joined with single spaces. Interchangeable except for slicing. |
|
|
100
|
-
| `${N:-default}` | Argument `N` when present and non-empty; otherwise `default`.
|
|
101
|
-
| `${@:-default}` or `${ARGUMENTS:-default}` | All arguments joined with spaces when present and non-empty; otherwise `default`. |
|
|
80
|
+
| `${N:-default}` | Argument `N` when present and non-empty; otherwise `default`. `${0:-default}` always expands to `default`; empty defaults like `${1:-}` expand to `""`. |
|
|
81
|
+
| `${@:-default}` or `${ARGUMENTS:-default}` | All arguments joined with spaces when present and non-empty; otherwise `default`. `${@:-1}` uses `"1"` as the default (not negative slicing). |
|
|
102
82
|
| `${@:N}` | Arguments from 1-based position `N` to the end, joined with spaces. `N = 0` clamps to `1`; `N` past the last argument expands to `""`. |
|
|
103
|
-
| `${@:N:L}` | Up to `L` arguments starting at 1-based position `N`, joined with spaces. `L = 0` expands to `""`.
|
|
83
|
+
| `${@:N:L}` | Up to `L` arguments starting at 1-based position `N`, joined with spaces. `L = 0` expands to `""`. Works with `@` only (not `${ARGUMENTS:N}`). |
|
|
104
84
|
|
|
105
|
-
Default-value
|
|
106
|
-
|
|
107
|
-
- `default` inside `${N:-default}` or `${@:-default}` cannot contain a closing `}`.
|
|
108
|
-
- If `default` is longer than 1,024 characters, the placeholder does not match and remains literal text in the expanded prompt.
|
|
85
|
+
Default-value limits: `default` inside `${N:-default}` or `${@:-default}` cannot contain `}`, and defaults longer than 1,024 characters do not match and stay literal text.
|
|
109
86
|
|
|
110
87
|
Example with positional arguments and `$@`:
|
|
111
88
|
|
|
@@ -116,26 +93,50 @@ description: Create a component
|
|
|
116
93
|
Create a React component named $1 with features: $@
|
|
117
94
|
```
|
|
118
95
|
|
|
119
|
-
|
|
96
|
+
Invoking `/component Button "onClick handler" "disabled support"` fills `$1` with `Button` and `$@` with `Button onClick handler disabled support`.
|
|
120
97
|
|
|
121
|
-
|
|
98
|
+
Use `""` or `''` to pass an empty positional argument without shifting later positions. For `Review $2. Focus: ${1:-correctness}.`, `/review "" src/index.ts` expands to `Review src/index.ts. Focus: correctness.`
|
|
122
99
|
|
|
123
|
-
|
|
124
|
-
Summarize the current state in ${1:-7} bullet points.
|
|
125
|
-
```
|
|
100
|
+
### Quoting and splitting rules
|
|
126
101
|
|
|
127
|
-
|
|
102
|
+
- Arguments split on space (` `) and tab (`\t`) only, **not on newlines (`\n`)**. Multiline text without spaces or tabs between lines stays in one argument.
|
|
103
|
+
- Quotes (`"` or `'`) start a quoted argument only at the start of a token, so apostrophes inside words (`doesn't`) stay literal. Unquoted characters immediately after a closing quote stay in the same argument (`"hello"world` becomes `helloworld`).
|
|
104
|
+
- An unclosed quote is treated as a literal character and the remaining text tokenizes normally.
|
|
105
|
+
- Backslash escaping applies only to a matching quote inside a quoted argument (`\"` inside `"..."` or `\'` inside `'...'`). All other backslashes (including `\\` and unquoted backslashes) stay literal.
|
|
128
106
|
|
|
129
|
-
|
|
107
|
+
## Locations and loading rules
|
|
108
|
+
|
|
109
|
+
Atomic loads prompt templates from these sources:
|
|
110
|
+
|
|
111
|
+
- **Global:** `~/.atomic/agent/prompts/*.md`
|
|
112
|
+
- **Project** (requires [project trust](/security#project-trust)): `.atomic/prompts/*.md`
|
|
113
|
+
- **Packages:** `prompts/` directories or `atomic.prompts` entries in `package.json`
|
|
114
|
+
- **Settings:** `prompts` array in global or project `settings.json` ([Resource settings](/settings#resources)), accepting files, directories, and filter patterns (`!glob`, `+path`, `-path` with `~` expansion; see [Package filtering](/packages/reference#package-filtering))
|
|
115
|
+
- **CLI:** `--prompt-template <path>` (repeatable; accepts a `.md` file or a directory and still loads with `--no-prompt-templates` / `-np`; see [CLI resource options](/reference/cli#resource-options))
|
|
116
|
+
|
|
117
|
+
Discovery and precedence behavior:
|
|
118
|
+
|
|
119
|
+
- Auto-discovery in `~/.atomic/agent/prompts/` and `.atomic/prompts/` is non-recursive and skips dotfiles, `node_modules`, broken symlinks, and files matched by `.gitignore`, `.ignore`, or `.fdignore` inside `prompts/` (direct symlinks to `.md` files are followed).
|
|
120
|
+
- Explicit `--prompt-template <dir>` paths read all `.md` files in that directory without applying dotfile or `.gitignore` filters, and passing a non-`.md` file path to `--prompt-template` is ignored silently.
|
|
121
|
+
- Built-in [slash commands](/slash-commands) and extension slash commands always take precedence over prompt templates with the same name. Among templates themselves, `-e` packages win first, then project overrides global, both override configured and bundled packages, and explicit `--prompt-template` paths apply last—see [Resource precedence order](/packages/reference#resource-precedence-order).
|
|
130
122
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
- Backslash escaping works only for a matching quote inside a quoted argument (`\"` inside `"..."` or `\'` inside `'...'`). For example, `/review "the \"fast\" path"` passes `the "fast" path`. All other backslashes (including `\\` and backslashes outside quotes) remain literal.
|
|
123
|
+
<Note>
|
|
124
|
+
Legacy `.pi` paths (`~/.pi/agent/prompts/*.md`, `.pi/prompts/*.md`, and `pi.prompts` in `package.json`) continue to load alongside `.atomic` paths. If an inherited legacy `.pi` template collides with a bundled template, the bundled template wins.
|
|
125
|
+
</Note>
|
|
135
126
|
|
|
136
127
|
## Next steps
|
|
137
128
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
129
|
+
<Columns cols={2}>
|
|
130
|
+
<Card title="Use skills" href="/skills">
|
|
131
|
+
Provide instructions that the agent loads automatically when a task matches.
|
|
132
|
+
</Card>
|
|
133
|
+
<Card title="Subagents" href="/subagents">
|
|
134
|
+
Delegate a focused, bounded task to a child agent.
|
|
135
|
+
</Card>
|
|
136
|
+
<Card title="Install and manage packages" href="/packages">
|
|
137
|
+
Bundle prompt templates with skills, themes, and extensions to share with your team.
|
|
138
|
+
</Card>
|
|
139
|
+
<Card title="Build with Atomic" href="/build">
|
|
140
|
+
Compare every customization option in Atomic.
|
|
141
|
+
</Card>
|
|
142
|
+
</Columns>
|
|
@@ -1,71 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Provider reference"
|
|
3
3
|
sidebarTitle: "Providers"
|
|
4
|
-
description: "
|
|
4
|
+
description: "How Atomic resolves credentials across providers, maps terminal stop reasons, configures SDK login options, and surfaces provider errors."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
This reference covers credential precedence,
|
|
7
|
+
This reference covers behavior shared across all model providers: credential precedence, normalized stop reasons, SDK login options, and provider error handling. For login walkthroughs, subscriptions, and provider-specific setup, see [Authentication](/getting-started/authentication), [Choose a model](/models/choose-a-model), and [Connect model providers](/providers).
|
|
8
8
|
|
|
9
9
|
## Credential resolution order {#resolution-order}
|
|
10
10
|
|
|
11
|
-
Atomic resolves provider
|
|
11
|
+
Atomic resolves credentials for every provider from highest to lowest priority:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<Steps>
|
|
14
|
+
<Step title="CLI flag or SDK runtime override">
|
|
15
|
+
The [`--api-key`](/reference/cli#model-options) flag (or an [SDK runtime API key override](/sdk/reference#api-keys-and-oauth)).
|
|
16
|
+
</Step>
|
|
17
|
+
<Step title="Stored credential in auth.json">
|
|
18
|
+
An API key or OAuth token saved in `~/.atomic/agent/auth.json` via `/login` or `atomic auth login` (falls back to legacy `~/.pi/agent/auth.json`).
|
|
19
|
+
</Step>
|
|
20
|
+
<Step title="Provider configuration apiKey">
|
|
21
|
+
An `apiKey` supplied by an extension's [`registerProvider()`](/custom-provider) call, followed by `apiKey` in [`~/.atomic/agent/models.json`](/models).
|
|
22
|
+
</Step>
|
|
23
|
+
<Step title="Environment variable or cloud identity">
|
|
24
|
+
The provider's built-in [environment variable](/environment-variables#provider-credentials) or ambient cloud credentials (such as `ANTHROPIC_API_KEY`, AWS profiles/IAM/IRSA, Google Application Default Credentials, or Anthropic Workload Identity Federation).
|
|
25
|
+
</Step>
|
|
26
|
+
</Steps>
|
|
17
27
|
|
|
18
|
-
|
|
28
|
+
<Note>
|
|
29
|
+
Three precedence rules to keep in mind:
|
|
19
30
|
|
|
20
|
-
- **
|
|
21
|
-
- **Anthropic environment variable
|
|
31
|
+
- **An unset `$VAR` in `models.json` stops resolution.** If you set `"apiKey": "$UNSET_VAR"` on a built-in provider in `models.json` and `UNSET_VAR` is unset or empty, Atomic returns no credential instead of falling back to the provider's built-in environment variable.
|
|
32
|
+
- **Anthropic environment variable priority.** When no CLI flag, `auth.json` entry, or `models.json` `apiKey` is set for `anthropic`, Atomic checks `ANTHROPIC_AUTH_TOKEN`, then `ANTHROPIC_OAUTH_TOKEN`, then `ANTHROPIC_API_KEY`, then Anthropic Workload Identity Federation.
|
|
33
|
+
- **Amazon Bedrock bearer token exception.** For `amazon-bedrock`, a stored bearer token key in `auth.json` takes highest priority; otherwise an ambient `AWS_BEARER_TOKEN_BEDROCK` environment variable takes precedence over an `AWS_PROFILE` stored in `auth.json`.
|
|
34
|
+
</Note>
|
|
22
35
|
|
|
23
|
-
|
|
36
|
+
## SDK login options {#sdk-login-options}
|
|
24
37
|
|
|
25
|
-
Applications calling [`@bastani/atomic-ai`](/libraries/ai) directly can pass `{ agentName: "my-app" }` as the fourth argument to `models.login()` to set the OpenAI ChatGPT sign-in name hint or Codex login originator. ChatGPT sign-in defaults to `Atomic`. For host session authentication helpers, see [SDK API keys and OAuth](/sdk/reference#api-keys-and-oauth).
|
|
38
|
+
Applications calling [`@bastani/atomic-ai`](/libraries/ai) directly (on a `Models` collection returned by `createModels()` or `builtinModels()`) can pass `{ agentName: "my-app" }` as the fourth argument to `models.login()` to set the OpenAI ChatGPT sign-in name hint or Codex login originator. ChatGPT sign-in defaults to `Atomic`. For host session authentication helpers, see [SDK API keys and OAuth](/sdk/reference#api-keys-and-oauth).
|
|
26
39
|
|
|
27
40
|
## Stop reasons
|
|
28
41
|
|
|
29
|
-
Every provider reports why a
|
|
42
|
+
Every provider reports why a response ended. Atomic normalizes raw provider stop reasons (such as `end_turn`, `MAX_TOKENS`, or `tool_calls`) onto a single set of values so sessions, retries, continuations, and extensions behave consistently across providers:
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
| Stop reason | Meaning |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `stop` | The model finished its reply normally. |
|
|
47
|
+
| `length` | Output hit the model's or request's token limit; Atomic may run an automatic continuation or compact-and-retry (see [When compaction runs](/compaction#when-compaction-runs)). |
|
|
48
|
+
| `toolUse` | The model requested one or more tool calls to execute before continuing. |
|
|
49
|
+
| `error` | The provider returned an error, safety refusal, or unrecognized terminal stop reason. |
|
|
50
|
+
| `aborted` | The user or caller cancelled the request before completion. |
|
|
51
|
+
| `deferred` | The request was handed off to an asynchronous batch API. |
|
|
52
|
+
| `pending` | Internal state on an in-progress streaming partial message before a terminal reason arrives. |
|
|
32
53
|
|
|
33
|
-
|
|
54
|
+
An unrecognized terminal stop reason becomes a provider `error` naming the raw value instead of an ordinary `stop`, surfacing new truncation or safety signals rather than letting a turn appear complete. Safety and refusal responses keep their raw reason (for example, `Provider stopped with: SAFETY`). A completed turn cannot remain `pending`, so a stream that ends without a terminal reason becomes an error.
|
|
34
55
|
|
|
35
|
-
|
|
56
|
+
For custom streaming providers, see [Implement provider streaming](/custom-provider/streaming#stop-reasons).
|
|
36
57
|
|
|
37
|
-
|
|
58
|
+
## Provider errors
|
|
38
59
|
|
|
39
|
-
|
|
60
|
+
Across all providers, transient HTTP and stream failures follow your [`retry` settings](/settings#retry) and then [`fallbackModels`](/settings#fallbackmodels), while context-overflow errors trigger [compaction](/compaction) and retry the turn once. Authentication failures, unavailable models, and incompatible requests skip same-model retries and fall back to the next configured model immediately.
|
|
40
61
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| `GitHubCopilotModelUnavailableError` | `model-unavailable` | Copilot does not offer the model to this account, integration, or API, has no endpoint for it, or returns HTTP 404 | `reason`: `integration`, `not-supported`, `wrong-api`, `no-endpoint`, `not-found` | No | Yes | Pick another model, or run `/login` to refresh the model list |
|
|
44
|
-
| `GitHubCopilotRateLimitError` | `rate-limited` | HTTP 429 or a rate-limit error in the stream (honors `Retry-After`) | `retryAfterMs` | Yes | Yes, after retries | Wait for the limit to reset |
|
|
45
|
-
| `GitHubCopilotQuotaExhaustedError` | `quota-exhausted` | HTTP 402, a quota error code, or HTTP 429 reporting exhausted quota (`x-ratelimit-exceeded: quota_exceeded` or `quota exceeded`) | None | No | Yes | Pick another model, or wait for the quota to reset |
|
|
46
|
-
| `GitHubCopilotContentFilterError` | `content-filtered` | A content or policy filter blocked the request (such as HTTP 422 `cyber_policy`) or stopped the response (`content_filter`, `incomplete` with `content_filter`, `refusal`, or `sensitive`) | None | Only when `retry.fallbackOnContentFilter` is `false` | Only when `retry.fallbackOnContentFilter` allows it | Rephrase the request or pick another model |
|
|
47
|
-
| `GitHubCopilotPromptTooLargeError` | `prompt-too-large` | The prompt exceeds the model's prompt-token limit, or HTTP 413 | `promptTokens`, `limitTokens` when Copilot reports them | No | No; Atomic compacts instead | Run `/compact` or start a new session |
|
|
48
|
-
| `GitHubCopilotInvalidRequestError` | `invalid-request` | Copilot rejected the request, such as an unsupported thinking level or an unknown `Copilot-Integration-Id` header | `reason`: `reasoning-effort`, `integration-id`, `rejected` | No | Yes | Pick a supported thinking level or check `models.json` overrides |
|
|
49
|
-
| `GitHubCopilotAuthenticationError` | `authentication-failed` | HTTP 401 or 403 | None | No | Yes | Run `/login`, or check `COPILOT_GITHUB_TOKEN` |
|
|
50
|
-
| `GitHubCopilotServiceUnavailableError` | `service-unavailable` | HTTP 408, 5xx, 529, or a server error in the stream | None | Yes | Yes, after retries | Retry later |
|
|
51
|
-
| `GitHubCopilotStreamEndedEarlyError` | `stream-ended-early` | The stream stopped before its finish reason or final event, or no event arrived within [`streamDeadlineMs`](/settings#message-delivery) | `durationMs`, `startedContent` | Yes; at most once more after a [long attempt](/providers#streams-cut-after-a-long-attempt) | Yes, after retries | Retry; split the work into smaller steps, lower thinking effort, or set `fallbackModels` |
|
|
52
|
-
| `GitHubCopilotEmptyResponseError` | `empty-response` | The model finished with no text and no tool call | None | Yes | Yes, after retries | Retry |
|
|
53
|
-
| `GitHubCopilotUnrecognizedResponseError` | `unrecognized-response` | An unrecognized HTTP status, stream error code, or response body | `reason`: `unknown-status`, `unknown-error-event`, `malformed-body` | Yes, up to the retry limit | Yes, after retries | Retry, and report it if it persists |
|
|
62
|
+
<Accordion title="GitHub Copilot typed error classes and SDK helpers">
|
|
63
|
+
For GitHub Copilot requests, Atomic classifies failures into `GitHubCopilotError` subclasses (`GitHubCopilotModelUnavailableError`, `GitHubCopilotRateLimitError`, `GitHubCopilotQuotaExhaustedError`, `GitHubCopilotContentFilterError`, `GitHubCopilotPromptTooLargeError`, `GitHubCopilotInvalidRequestError`, `GitHubCopilotAuthenticationError`, `GitHubCopilotServiceUnavailableError`, `GitHubCopilotStreamEndedEarlyError`, `GitHubCopilotEmptyResponseError`, `GitHubCopilotUnrecognizedResponseError`), each carrying `code`, `retryable`, `hint`, `modelId`, `api`, `status`, `providerCode`, `requestId`, `detail`, and `cause`.
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### GitHub Copilot error helpers
|
|
58
|
-
|
|
59
|
-
SDK callers can inspect, classify, and serialize Copilot errors using functions exported from [`@bastani/atomic`](/sdk) and [`@bastani/atomic-ai`](/libraries/ai):
|
|
60
|
-
|
|
61
|
-
- **Extract or classify errors:**
|
|
62
|
-
- `getGitHubCopilotError(message)`: reads the typed error from a failed assistant message's `diagnostics`.
|
|
63
|
-
- `findGitHubCopilotError(error)`: searches an error, its `cause` chain, or a wrapped message and returns the typed `GitHubCopilotError` instance.
|
|
64
|
-
- `classifyGitHubCopilotFailure(error, failure)`: maps a raw error and request context into a typed `GitHubCopilotError`.
|
|
65
|
-
- **Serialize across processes:** Errors are stored in assistant message `diagnostics` under `GITHUB_COPILOT_ERROR_DIAGNOSTIC` (`"github_copilot_error"`), so they survive subagent workers, RPC, and saved sessions. Inferred Chat Completions stop reasons are recorded under `GITHUB_COPILOT_INFERRED_STOP_REASON_DIAGNOSTIC` (`"github_copilot_inferred_stop_reason"`). Use `serializeGitHubCopilotError()` and `deserializeGitHubCopilotError()` for explicit conversion; `deserializeGitHubCopilotError()` returns `undefined` if the class name does not match the code or if `reason` does not belong to that class.
|
|
66
|
-
- **Type guards:** Return a plain `boolean` checking an error, its `cause` chain, or a failed message (including errors relayed from another process):
|
|
67
|
-
- `isGitHubCopilotError`, `isRetryableGitHubCopilotError`
|
|
68
|
-
- `isGitHubCopilotModelUnavailableError`, `isGitHubCopilotRateLimitError`, `isGitHubCopilotQuotaExhaustedError`, `isGitHubCopilotContentFilterError`, `isGitHubCopilotPromptTooLargeError`, `isGitHubCopilotInvalidRequestError`, `isGitHubCopilotAuthenticationError`, `isGitHubCopilotServiceUnavailableError`, `isGitHubCopilotStreamEndedEarlyError`, `isGitHubCopilotEmptyResponseError`, `isGitHubCopilotUnrecognizedResponseError`
|
|
69
|
-
- **Model inspection:** Call `describeGitHubCopilotModel(model)` to inspect a Copilot model's capabilities.
|
|
70
|
-
|
|
71
|
-
The guards and `findGitHubCopilotError()` reject malformed serialized payloads. Only minimal serialized error objects containing `name`, `code`, and an optional string `message` are reconstructed without structured fields; a malformed full payload is never rebuilt with dropped context.
|
|
65
|
+
SDK callers can inspect or serialize them with `getGitHubCopilotError()`, `findGitHubCopilotError()`, `classifyGitHubCopilotFailure()`, `serializeGitHubCopilotError()`, `deserializeGitHubCopilotError()`, `isGitHubCopilotError()`, `isRetryableGitHubCopilotError()`, per-class `isGitHubCopilot*Error()` guards, `describeGitHubCopilotModel()`, and `GITHUB_COPILOT_ERROR_DIAGNOSTIC` from `@bastani/atomic` or `@bastani/atomic-ai` (`GITHUB_COPILOT_INFERRED_STOP_REASON_DIAGNOSTIC` is exported from `@bastani/atomic-ai`).
|
|
66
|
+
</Accordion>
|