@bastani/atomic 0.10.14-alpha.1 → 0.10.15-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 +29 -0
- 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 +9 -0
- 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 +76 -63
- 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 +116 -89
- 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 +15 -16
- 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 -18
- 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 +50 -38
- package/docs/termux.md +67 -41
- 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/libraries/ai.md
CHANGED
|
@@ -10,7 +10,9 @@ Inside an Atomic extension, import it without installing it because the host pro
|
|
|
10
10
|
|
|
11
11
|
`@bastani/atomic-ai` provides one LLM API across providers with provider collections, automatic auth resolution, token and cost tracking, and JSON-serializable contexts for mid-session model handoffs.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<Note>
|
|
14
|
+
The chat catalog includes only models that support tool calling (function calling). Image and classifier catalogs use their operation-specific capabilities.
|
|
15
|
+
</Note>
|
|
14
16
|
|
|
15
17
|
## Supported providers
|
|
16
18
|
|
|
@@ -60,7 +62,7 @@ Requires Node.js 24.20 or newer.
|
|
|
60
62
|
|
|
61
63
|
Key root and subpath exports:
|
|
62
64
|
|
|
63
|
-
- Root `@bastani/atomic-ai`: `createModels`, `createProvider`, `Type`/`Static`/`TSchema` (re-exported from TypeBox), thinking helpers (`DEFAULT_THINKING_BUDGETS`, `fittedThinkingBudget`, `thinkingBudgetForLevel`, `getSupportedThinkingLevels`, `clampThinkingLevel`), `OAuthRefreshRejectedError`, `GitHubCopilot*Error`, `cleanupSessionResources`, and `PI_AI_VERSION
|
|
65
|
+
- Root `@bastani/atomic-ai`: `createModels`, `createProvider`, `Type`/`Static`/`TSchema` (re-exported from TypeBox), thinking helpers (`DEFAULT_THINKING_BUDGETS`, `fittedThinkingBudget`, `thinkingBudgetForLevel`, `getSupportedThinkingLevels`, `clampThinkingLevel`), `OAuthRefreshRejectedError`, `GitHubCopilot*Error`, `cleanupSessionResources`, and `PI_AI_VERSION` (intentionally retains its legacy `PI_` prefix for compatibility).
|
|
64
66
|
- Subpaths: `@bastani/atomic-ai/models`, `@bastani/atomic-ai/providers/<provider>`, `@bastani/atomic-ai/providers/all`, `@bastani/atomic-ai/api/<api-id>`, `@bastani/atomic-ai/utils/*`, `@bastani/atomic-ai/session-resources`, `@bastani/atomic-ai/bedrock-provider`, `@bastani/atomic-ai/lazy-bedrock-provider`, `@bastani/atomic-ai/oauth`, `@bastani/atomic-ai/bun-oauth`, `@bastani/atomic-ai/lazy-oauth`, and `@bastani/atomic-ai/compat`.
|
|
65
67
|
|
|
66
68
|
## Quick start
|
|
@@ -523,6 +525,25 @@ Stored credentials remain provider-scoped, so save the key under the provider ID
|
|
|
523
525
|
|
|
524
526
|
Amazon Bedrock resolves ambient AWS credentials (`AWS_PROFILE`, access key pairs, `AWS_BEARER_TOKEN_BEDROCK`, ECS task roles, web identity tokens); its provider-owned login flow supports bearer tokens, AWS profiles, and the existing credential chain. Vertex AI resolves either an explicit key or gcloud Application Default Credentials plus project/location, with a provider-owned login flow for API keys, ADC, and service-account files.
|
|
525
527
|
|
|
528
|
+
### Provider-scoped environment overrides
|
|
529
|
+
|
|
530
|
+
Pass `env` in stream options to scope provider configuration to a single request. Values in `env` take precedence over process environment variables for provider auth and configuration such as Cloudflare account IDs, Azure OpenAI settings, Vertex project and location, Bedrock settings, `ATOMIC_CACHE_RETENTION` (legacy alias `PI_CACHE_RETENTION`), and `HTTP_PROXY` / `HTTPS_PROXY`:
|
|
531
|
+
|
|
532
|
+
```typescript
|
|
533
|
+
const models = builtinModels();
|
|
534
|
+
const model = models.getModel('cloudflare-ai-gateway', 'workers-ai/@cf/moonshotai/kimi-k2.6')!;
|
|
535
|
+
|
|
536
|
+
const response = await models.complete(model, context, {
|
|
537
|
+
env: {
|
|
538
|
+
CLOUDFLARE_API_KEY: '...',
|
|
539
|
+
CLOUDFLARE_ACCOUNT_ID: 'account-id',
|
|
540
|
+
CLOUDFLARE_GATEWAY_ID: 'gateway-id'
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
Use this when one process needs different provider settings per request, or when ambient environment variables should not leak into a provider call.
|
|
546
|
+
|
|
526
547
|
## Tools
|
|
527
548
|
|
|
528
549
|
Tools enable LLMs to interact with external systems. This library uses TypeBox schemas for type-safe tool definitions with automatic validation using TypeBox's built-in validator and value conversion utilities. TypeBox schemas can be serialized and deserialized as plain JSON, making them ideal for distributed systems.
|
|
@@ -645,12 +666,6 @@ context.messages.push({
|
|
|
645
666
|
});
|
|
646
667
|
```
|
|
647
668
|
|
|
648
|
-
### Fireworks deferred tools
|
|
649
|
-
|
|
650
|
-
Fireworks models using the Anthropic Messages API support native deferred tool loading. Keep your discovery tool in `context.tools`. After the discovery tool result, append a chronological system message with `toolsAdded` containing the newly discovered tool definitions (`toolsRemoved` when tools drop out). The adapter sends deferred schemas and `tool_reference` blocks while preserving ordinary result text and unsigned thinking during replay.
|
|
651
|
-
|
|
652
|
-
Name the discovery tool `ToolSearch` or `tool_search` for Fireworks prompt-prefix deferral. Other discovery names serialize correctly but do not get that prefix optimization. Set `model.compat.supportsToolReferences` to `false` to send ordinary tool schemas instead. This feature does not apply to Fireworks Chat Completions models.
|
|
653
|
-
|
|
654
669
|
### Streaming tool calls with partial JSON
|
|
655
670
|
|
|
656
671
|
During streaming, tool call arguments are progressively parsed as they arrive. This enables real-time UI updates before the complete arguments are available:
|
|
@@ -893,11 +908,20 @@ console.log(model.input); // ['text'] or ['text', 'image']
|
|
|
893
908
|
console.log(model.output); // ['image'] or ['image', 'text']
|
|
894
909
|
```
|
|
895
910
|
|
|
911
|
+
### Notes and limitations
|
|
912
|
+
|
|
913
|
+
- Image models and chat models share `Models` and `Provider`; list image models with `getModelsOfType('image')` and call `generateImages()`, never the chat streaming APIs.
|
|
914
|
+
- Image-generation models do not participate in tool calling.
|
|
915
|
+
- Outputs arrive in `AssistantImages.output` and can contain both base64-encoded `ImageContent` blocks and `TextContent` blocks. Check `model.output` and `model.input` for each model's capabilities.
|
|
916
|
+
- Like streaming APIs, image generation accepts options such as `apiKey`, `signal`, `headers`, `onPayload`, and `onResponse`, and results may include `stopReason`, `responseId`, and `usage`.
|
|
917
|
+
- To analyze images in a conversation or call tools, use the chat APIs with a vision-capable model.
|
|
918
|
+
- Built-in image generation is available through `openrouter` and `openai-images`.
|
|
919
|
+
|
|
896
920
|
### OpenAI Images API
|
|
897
921
|
|
|
898
922
|
The `openai-images` provider serves OpenAI's GPT Image models (`gpt-image-2.6-sunburst`, `gpt-image-2.6-flare`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`) through the OpenAI Images API. It borrows the API key stored for `openai-api`, then `openai`, then `OPENAI_API_KEY`. A ChatGPT OAuth credential on `openai` is skipped, so with only OAuth stored those models are unavailable and `generateImages()` returns `Provider is not configured: openai-images`.
|
|
899
923
|
|
|
900
|
-
Text blocks become the `prompt`. Requests without image blocks call `/images/generations`; requests with image blocks call `/images/edits` and upload each image block
|
|
924
|
+
Text blocks become the `prompt`. Requests without image blocks call `/images/generations`; requests with image blocks call `/images/edits` and upload each image block:
|
|
901
925
|
|
|
902
926
|
```typescript
|
|
903
927
|
import { getBuiltinImageModel } from '@bastani/atomic-ai/providers/all';
|
|
@@ -910,6 +934,8 @@ const result = await models.generateImages(flare, {
|
|
|
910
934
|
|
|
911
935
|
Each returned image is an `ImageContent` block whose `mimeType` matches the response's `output_format`: `image/png`, `image/jpeg`, `image/webp`, `image/gif`, or `image/svg+xml`. An SVG block stores UTF-8 XML in `data` as base64; save GIFs with `.gif` and SVGs with `.svg`.
|
|
912
936
|
|
|
937
|
+
#### Request options (`OpenAIImagesOptions`)
|
|
938
|
+
|
|
913
939
|
| Option | Sent as | Notes |
|
|
914
940
|
| --- | --- | --- |
|
|
915
941
|
| `size`, `quality`, `n`, `background` | same name | `n` is the number of images. `background: 'transparent'` needs `png` or `webp` output. |
|
|
@@ -924,7 +950,9 @@ Each returned image is an `ImageContent` block whose `mimeType` matches the resp
|
|
|
924
950
|
|
|
925
951
|
GIF and SVG output are generation-only: they cannot be combined with input image blocks, SVG requires `n` of 1, and neither supports streaming, partial images, or `outputCompression`. `outputFormat: 'gif'` consumes more tokens as `frameCount` grows; `size` applies to each frame, and total frame dimensions must stay within the model's size limits.
|
|
926
952
|
|
|
927
|
-
|
|
953
|
+
#### Reference images, markup, and mask
|
|
954
|
+
|
|
955
|
+
When sending input images, the first image without a `role` is the base image to edit and any remaining unroled images are references.
|
|
928
956
|
|
|
929
957
|
Set `role: 'markup'` on a transparent PNG with annotations (circles or sketches) to send it as the `markup` field guiding edits to the base image; it must match the base image's dimensions. Set `role: 'mask'` on an image with an alpha channel to send it as the `mask` field. Markup and mask images do not count as references, each request accepts at most one of either, and you cannot send both together. Markup-guided edits work on GPT Image 2.5 and 2.6.
|
|
930
958
|
|
|
@@ -938,21 +966,23 @@ await models.generateImages(flare, {
|
|
|
938
966
|
}, { quality: 'medium' });
|
|
939
967
|
```
|
|
940
968
|
|
|
941
|
-
|
|
969
|
+
#### Local validation
|
|
942
970
|
|
|
943
|
-
Models declare optional features in `ImageModel.capabilities`; undeclared features are treated as unsupported, so custom `openai-images` models must set `capabilities` to use them. Validation runs both before `onPayload` sees the request and again on the final payload after `onPayload` returns or mutates it.
|
|
971
|
+
Invalid requests fail locally before sending anything, returning an `ImageGenerationConfigError` with `field`, `reason`, and a hint for what to change. Models declare optional features in `ImageModel.capabilities`; undeclared features are treated as unsupported, so custom `openai-images` models must set `capabilities` to use them. Validation runs both before `onPayload` sees the request and again on the final payload after `onPayload` returns or mutates it.
|
|
944
972
|
|
|
945
973
|
| `reason` | When it fires | What to do |
|
|
946
974
|
| --- | --- | --- |
|
|
947
|
-
| `out-of-range` | `frameCount` outside 2-16, `frameDurationMs` outside 20-2000, `outputCompression` outside 0-100 (or not an integer), or `safetyIdentifier` longer than 128 characters.
|
|
975
|
+
| `out-of-range` | `frameCount` outside 2-16, `frameDurationMs` outside 20-2000, `outputCompression` outside 0-100 (or not an integer), or `safetyIdentifier` longer than 128 characters. Bounds are in `OPENAI_IMAGES_LIMITS`. | Use a value within the bounds. |
|
|
948
976
|
| `requires-option` | `frameCount` or `frameDurationMs` without `outputFormat: "gif"`, or `svg` without `outputFormat: "svg"`. `related` names the missing option. | Set the option in `related`, or remove `field`. |
|
|
949
|
-
| `conflicts-with-option` | SVG output with `n` above 1; `outputCompression` with `png`, `gif`, `svg`, or no format; `background: "transparent"` with `jpeg`, `gif`, or `svg`;
|
|
950
|
-
| `generation-only` | GIF or SVG output on a request with input images
|
|
977
|
+
| `conflicts-with-option` | SVG output with `n` above 1; `outputCompression` with `png`, `gif`, `svg`, or no format; `background: "transparent"` with `jpeg`, `gif`, or `svg`; markup combined with mask; GIF or SVG with streaming or partial images. | Remove `field` or the option named in `related`. |
|
|
978
|
+
| `generation-only` | GIF or SVG output on a request with input images (edits endpoint). | Remove the input images, or choose `png`, `jpeg`, or `webp`. |
|
|
951
979
|
| `unsupported-by-model` | `complexity`, GIF, SVG, or markup on a model whose `capabilities` do not declare it. GPT Image 2.6 declares all four; GPT Image 2.5 declares markup; older models declare none. | Use a model that declares the feature. |
|
|
952
|
-
| `requires-base-image` | An image with `role: "markup"` or `role: "mask"`
|
|
980
|
+
| `requires-base-image` | An image with `role: "markup"` or `role: "mask"` and no unroled base image. | Put the base image first, without a role. |
|
|
953
981
|
| `duplicate-role` | Two images with `role: "markup"`, or two with `role: "mask"`. | Send at most one image per role. |
|
|
954
982
|
|
|
955
|
-
|
|
983
|
+
#### Structured errors
|
|
984
|
+
|
|
985
|
+
`generateImages()` resolves with `stopReason: 'error'`, `errorMessage`, and a JSON-safe `error` (`ImageGenerationErrorData`). Rehydrate the typed error with `imageGenerationErrorFromData(result.error)` and branch on its class, guard, `code`, or `retryable` rather than parsing message text. Cancellation resolves with `stopReason: 'aborted'` and no `error`.
|
|
956
986
|
|
|
957
987
|
The typed error retains only the HTTP status and the provider's type, code, and request ID in `detail` and its message; it excludes the provider's raw message because that can quote the prompt, while `errorMessage` keeps the provider's text.
|
|
958
988
|
|
|
@@ -967,22 +997,7 @@ The typed error retains only the HTTP status and the provider's type, code, and
|
|
|
967
997
|
| `ImageModerationBlockedError` (`isImageModerationBlockedError`) | `moderation-blocked` | `error.code` is `moderation_blocked`. | No | `moderationStage` (`input`, `output`, `unknown`), `categories` |
|
|
968
998
|
| `ImageGenerationTimeoutError` (`isImageGenerationTimeoutError`) | `timeout` | The request exceeded `timeoutMs`. | Yes | `timeoutMs`, `elapsedMs`, `phase` |
|
|
969
999
|
|
|
970
|
-
All classes extend `ImageGenerationError`, and `isImageGenerationError()` matches any of them
|
|
971
|
-
|
|
972
|
-
Use `findImageGenerationError(error, guard)` to search a `cause` chain (up to 8 links), for example `findImageGenerationError(error, isImageGenerationQuotaError)`, and `isRetryableImageGenerationError()` to test whether the nearest matching error in the chain is retryable. `result.error` preserves up to 8 cause-chain links: family causes retain their structured data, while foreign causes keep a safe name and any known errno code with their message replaced by `[foreign error message omitted]`.
|
|
973
|
-
|
|
974
|
-
With `maxRetries`, rate-limit and server errors retry automatically while quota and user errors do not. Usage on an SVG request tracks the image model only; OpenAI reports the SVG-authoring model's tokens separately as `svg_usage`, which is not added to `usage` or its cost.
|
|
975
|
-
|
|
976
|
-
### Notes and limitations
|
|
977
|
-
|
|
978
|
-
- Image models and chat models share `Models` and `Provider`; list image models with `getModelsOfType('image')` and call `generateImages()`, never the chat streaming APIs.
|
|
979
|
-
- Image-generation models do not participate in tool calling.
|
|
980
|
-
- Outputs arrive in `AssistantImages.output` and can contain both base64-encoded `ImageContent` blocks and `TextContent` blocks.
|
|
981
|
-
- Some models return only images while others return images plus text; check `model.output`.
|
|
982
|
-
- Some models accept image input while others are text-to-image only; check `model.input`.
|
|
983
|
-
- Like streaming APIs, image generation accepts options such as `apiKey`, `signal`, `headers`, `onPayload`, and `onResponse`, and results may include `stopReason`, `responseId`, and `usage`.
|
|
984
|
-
- To analyze images in a conversation or call tools, use the chat APIs with a vision-capable model.
|
|
985
|
-
- Built-in image generation is available through `openrouter` and `openai-images`.
|
|
1000
|
+
All classes extend `ImageGenerationError`, and `isImageGenerationError()` matches any of them (including serialized objects from another process whose `name` and `code` match). Use `findImageGenerationError(error, guard)` to search a `cause` chain (up to 8 links) and `isRetryableImageGenerationError()` to test retryability. With `maxRetries`, rate-limit and server errors retry automatically while quota and user errors do not. Usage on an SVG request tracks the image model only; OpenAI reports the SVG-authoring model's tokens separately as `svg_usage`, which is not added to `usage` or its cost.
|
|
986
1001
|
|
|
987
1002
|
## Classification
|
|
988
1003
|
|
|
@@ -1128,13 +1143,7 @@ for (const block of response.content) {
|
|
|
1128
1143
|
}
|
|
1129
1144
|
```
|
|
1130
1145
|
|
|
1131
|
-
`xhigh` and `max` are model-specific, opt-in levels
|
|
1132
|
-
|
|
1133
|
-
| Model | Providers | Levels | `off` | `minimal` |
|
|
1134
|
-
| --- | --- | --- | --- | --- |
|
|
1135
|
-
| GPT-6.2 Astra, GPT-6.2 Sol | OpenAI, Azure and Codex Responses | `low`, `medium`, `high`, `xhigh`, `max` | No | No |
|
|
1136
|
-
| GPT-6.1 Sol | OpenAI, Azure and Codex Responses | `low`, `medium`, `high`, `xhigh`, `max` | No | Codex UI alias that sends `low` |
|
|
1137
|
-
| GPT-6.1 Terra | OpenAI, Azure and Codex Responses | `off`, `low`, `medium`, `high`, `xhigh`, `max` | Sends reasoning effort `none` | Codex UI alias that sends `low` |
|
|
1146
|
+
`xhigh` and `max` are model-specific, opt-in levels, and some models also omit `off` or `minimal`. Call `getSupportedThinkingLevels(model)` to inspect the exact levels a concrete model supports (and `clampThinkingLevel()` to normalize a requested level). For OpenAI/Codex model-specific reasoning levels, see [OpenAI and Codex](#openai-and-codex).
|
|
1138
1147
|
|
|
1139
1148
|
### Provider-specific options (`stream` / `complete`)
|
|
1140
1149
|
|
|
@@ -1686,6 +1695,10 @@ Every provider accepts messages produced by other providers, including text, too
|
|
|
1686
1695
|
|
|
1687
1696
|
## System messages
|
|
1688
1697
|
|
|
1698
|
+
<Note>
|
|
1699
|
+
**For custom provider and adapter authors:** Ordinary application callers pass `systemPrompt` and `tools` on `Context` and rarely construct `SystemMessage` directly. The wire details below apply when building custom providers or managing mid-conversation system/tool transitions.
|
|
1700
|
+
</Note>
|
|
1701
|
+
|
|
1689
1702
|
Public entry points (`Models.stream()`, `streamSimple()`, `complete()`, and `completeSimple()`) accept `Context` and normalize `systemPrompt` and `tools` into a leading system message. Provider implementations, `ProviderStreams`, and direct API modules receive a `TranscriptContext` containing only `messages`.
|
|
1690
1703
|
|
|
1691
1704
|
```typescript
|
|
@@ -1745,7 +1758,9 @@ const continuation = await models.complete(newModel, restored);
|
|
|
1745
1758
|
|
|
1746
1759
|
Models are plain serializable data with no attached functions, so you can store the active model with `JSON.stringify()` as well.
|
|
1747
1760
|
|
|
1748
|
-
>
|
|
1761
|
+
<Note>
|
|
1762
|
+
If the context contains base64-encoded images (as shown in [Image input](#image-input)), they are serialized inline with the context.
|
|
1763
|
+
</Note>
|
|
1749
1764
|
|
|
1750
1765
|
## Browser usage
|
|
1751
1766
|
|
|
@@ -1766,7 +1781,9 @@ const response = await models.complete(model, {
|
|
|
1766
1781
|
});
|
|
1767
1782
|
```
|
|
1768
1783
|
|
|
1769
|
-
>
|
|
1784
|
+
<Warning>
|
|
1785
|
+
Exposing API keys in frontend browser code lets anyone extract and abuse them. Use direct browser keys only for internal tools or demos; in production, proxy requests through a backend (see [`streamProxy()` in `@bastani/atomic-agent-core`](/libraries/agent-core#proxy-usage)).
|
|
1786
|
+
</Warning>
|
|
1770
1787
|
|
|
1771
1788
|
Browser compatibility notes:
|
|
1772
1789
|
|
|
@@ -1842,25 +1859,6 @@ registerLazyOAuthFlows();
|
|
|
1842
1859
|
|
|
1843
1860
|
Both modules are Node-only; never import them into a browser bundle.
|
|
1844
1861
|
|
|
1845
|
-
### Provider-scoped environment overrides
|
|
1846
|
-
|
|
1847
|
-
Pass `env` in stream options to scope provider configuration to a request. Values in `env` take precedence over process environment variables for provider auth and configuration such as Cloudflare account IDs, Azure OpenAI settings, Vertex project and location, Bedrock settings, `ATOMIC_CACHE_RETENTION` (legacy alias `PI_CACHE_RETENTION`), and `HTTP_PROXY` / `HTTPS_PROXY`.
|
|
1848
|
-
|
|
1849
|
-
```typescript
|
|
1850
|
-
const models = builtinModels();
|
|
1851
|
-
const model = models.getModel('cloudflare-ai-gateway', 'workers-ai/@cf/moonshotai/kimi-k2.6')!;
|
|
1852
|
-
|
|
1853
|
-
const response = await models.complete(model, context, {
|
|
1854
|
-
env: {
|
|
1855
|
-
CLOUDFLARE_API_KEY: '...',
|
|
1856
|
-
CLOUDFLARE_ACCOUNT_ID: 'account-id',
|
|
1857
|
-
CLOUDFLARE_GATEWAY_ID: 'gateway-id'
|
|
1858
|
-
}
|
|
1859
|
-
});
|
|
1860
|
-
```
|
|
1861
|
-
|
|
1862
|
-
Use this when one process needs different provider settings per request, or when ambient environment variables should not leak into a provider call.
|
|
1863
|
-
|
|
1864
1862
|
## OAuth providers
|
|
1865
1863
|
|
|
1866
1864
|
These built-in providers support OAuth authentication in addition to or instead of static API keys:
|
|
@@ -1914,15 +1912,33 @@ await models.logout('anthropic');
|
|
|
1914
1912
|
|
|
1915
1913
|
For OpenAI Sign in with ChatGPT, pass a fourth `LoginOptions` argument with `getDeviceId: () => installationUuid`. Persist this UUID and return the same value on later logins. The login registers a user-owned client and stores its issued client ID and granted scopes with the credential. Direct ChatGPT access omits unsupported temperature, output-token limits, and cache-retention fields. If its shared subscription limit is exhausted, check [ChatGPT usage](https://chatgpt.com/settings/usage).
|
|
1916
1914
|
|
|
1915
|
+
### CLI login
|
|
1916
|
+
|
|
1917
|
+
`@bastani/atomic-ai` ships the `atomic-ai` binary (with `pi-ai` kept as a legacy alias) to log into built-in **OAuth** providers:
|
|
1918
|
+
|
|
1919
|
+
```bash
|
|
1920
|
+
npx @bastani/atomic-ai login # interactive OAuth provider selection
|
|
1921
|
+
npx @bastani/atomic-ai login anthropic # log into a specific OAuth provider
|
|
1922
|
+
npx @bastani/atomic-ai list # list OAuth-enabled providers
|
|
1923
|
+
# Or when installed locally/globally:
|
|
1924
|
+
atomic-ai login anthropic
|
|
1925
|
+
```
|
|
1926
|
+
|
|
1927
|
+
The CLI lists only providers that support OAuth (`provider.auth.oauth`), and writes credentials to `auth.json` in the current working directory with owner-only permissions (`0600`).
|
|
1928
|
+
|
|
1929
|
+
### Programmatic OAuth
|
|
1930
|
+
|
|
1931
|
+
Built-in login and refresh flows are private provider implementations. Use provider-owned `OAuthAuth`, which composes with `CredentialStore` and gets locked auto-refresh through `Models`. The `@bastani/atomic-ai/oauth` entry point retains only type declarations required for extension OAuth compatibility.
|
|
1932
|
+
|
|
1933
|
+
## Provider-specific notes
|
|
1934
|
+
|
|
1917
1935
|
### Vertex AI
|
|
1918
1936
|
|
|
1919
1937
|
Vertex AI models support either a Google Cloud API key or Application Default Credentials (ADC). Its provider-owned API-key login flow can configure either method:
|
|
1920
1938
|
|
|
1921
|
-
- **API key
|
|
1922
|
-
- **Local development (ADC)
|
|
1923
|
-
- **CI/Production (ADC)
|
|
1924
|
-
|
|
1925
|
-
When using ADC, also set `GOOGLE_CLOUD_PROJECT` (or `GCLOUD_PROJECT`) and `GOOGLE_CLOUD_LOCATION`. You can also pass `project` and `location` in the call options. When using `GOOGLE_CLOUD_API_KEY`, `project` and `location` are not required.
|
|
1939
|
+
- **API key:** Set `GOOGLE_CLOUD_API_KEY` or pass `apiKey` in the call options (`project` and `location` are not required).
|
|
1940
|
+
- **Local development (ADC):** Run `gcloud auth application-default login` and set `GOOGLE_CLOUD_PROJECT` (or `GCLOUD_PROJECT`) and `GOOGLE_CLOUD_LOCATION` (or pass `project` and `location` in call options).
|
|
1941
|
+
- **CI/Production (ADC):** Set `GOOGLE_APPLICATION_CREDENTIALS` to a service account JSON key file alongside project and location.
|
|
1926
1942
|
|
|
1927
1943
|
```bash
|
|
1928
1944
|
# Local (uses your user credentials)
|
|
@@ -1936,35 +1952,35 @@ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
|
|
|
1936
1952
|
|
|
1937
1953
|
Official docs: [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials)
|
|
1938
1954
|
|
|
1939
|
-
###
|
|
1955
|
+
### Azure
|
|
1940
1956
|
|
|
1941
|
-
|
|
1957
|
+
Supports both Azure OpenAI Responses (`azure-openai-responses`) and Microsoft Foundry Chat Completions (`openai-completions`, such as `deepseek-v4-pro`). Set `AZURE_OPENAI_API_KEY` and either `AZURE_OPENAI_BASE_URL` or `AZURE_OPENAI_RESOURCE_NAME`. `AZURE_OPENAI_BASE_URL` accepts `https://<resource>.openai.azure.com`, `https://<resource>.cognitiveservices.azure.com`, and `https://<resource>.ai.azure.com` (including `*.services.ai.azure.com`); root endpoints normalize to `/openai/v1` automatically.
|
|
1942
1958
|
|
|
1943
|
-
|
|
1944
|
-
npx @bastani/atomic-ai login # interactive OAuth provider selection
|
|
1945
|
-
npx @bastani/atomic-ai login anthropic # log into a specific OAuth provider
|
|
1946
|
-
npx @bastani/atomic-ai list # list OAuth-enabled providers
|
|
1947
|
-
# Or when installed locally/globally:
|
|
1948
|
-
atomic-ai login anthropic
|
|
1949
|
-
```
|
|
1959
|
+
Use `AZURE_OPENAI_API_VERSION` (defaults to `v1`) to override the API version. Deployment names default to model IDs and can be overridden with `azureDeploymentName` or `AZURE_OPENAI_DEPLOYMENT_NAME_MAP` using comma-separated `model-id=deployment` pairs (for example `gpt-4o-mini=my-deployment,gpt-4o=prod`). Legacy deployment-based URLs are not supported.
|
|
1950
1960
|
|
|
1951
|
-
|
|
1961
|
+
### OpenAI and Codex
|
|
1952
1962
|
|
|
1953
|
-
|
|
1963
|
+
OpenAI Codex requires a ChatGPT subscription with model access and includes GPT-6.2 Sol and Codex models with extended context windows and reasoning capabilities. Prompt caching is enabled automatically when `sessionId` is provided unless `cacheRetention` is `"none"`. Set `transport` to `"sse"`, `"websocket"`, or `"auto"` for Codex Responses transport selection; WebSocket connections with `sessionId` and caching enabled reuse connections per session and expire after 5 minutes of inactivity.
|
|
1954
1964
|
|
|
1955
|
-
|
|
1965
|
+
Call `cleanupSessionResources(sessionId)` (imported from `@bastani/atomic-ai`) when finished with a Codex session so its pooled WebSocket connection does not keep the process alive.
|
|
1956
1966
|
|
|
1957
|
-
|
|
1967
|
+
Model-specific reasoning levels across OpenAI, Azure, and Codex Responses:
|
|
1958
1968
|
|
|
1959
|
-
|
|
1969
|
+
| Model | Levels | `off` | `minimal` |
|
|
1970
|
+
| --- | --- | --- | --- |
|
|
1971
|
+
| GPT-6.2 Astra, GPT-6.2 Sol | `low`, `medium`, `high`, `xhigh`, `max` | No | No |
|
|
1972
|
+
| GPT-6.1 Sol | `low`, `medium`, `high`, `xhigh`, `max` | No | Codex UI alias that sends `low` |
|
|
1973
|
+
| GPT-6.1 Terra | `off`, `low`, `medium`, `high`, `xhigh`, `max` | Sends reasoning effort `none` | Codex UI alias that sends `low` |
|
|
1960
1974
|
|
|
1961
|
-
|
|
1975
|
+
### GitHub Copilot
|
|
1962
1976
|
|
|
1963
|
-
|
|
1977
|
+
If you receive `"The requested model is not supported"`, enable the model manually in VS Code: open Copilot Chat, click the model selector, select the model (warning icon), and click **Enable**.
|
|
1964
1978
|
|
|
1965
|
-
|
|
1979
|
+
### Fireworks deferred tools
|
|
1966
1980
|
|
|
1967
|
-
|
|
1981
|
+
Fireworks models using the Anthropic Messages API support native deferred tool loading. Keep your discovery tool in `context.tools`. After the discovery tool result, append a chronological system message with `toolsAdded` containing the newly discovered tool definitions (`toolsRemoved` when tools drop out). The adapter sends deferred schemas and `tool_reference` blocks while preserving ordinary result text and unsigned thinking during replay.
|
|
1982
|
+
|
|
1983
|
+
Name the discovery tool `ToolSearch` or `tool_search` for Fireworks prompt-prefix deferral. Other discovery names serialize correctly but do not get that prefix optimization. Set `model.compat.supportsToolReferences` to `false` to send ordinary tool schemas instead. This feature does not apply to Fireworks Chat Completions models.
|
|
1968
1984
|
|
|
1969
1985
|
## Migrating from the old global API
|
|
1970
1986
|
|