@bastani/atomic 0.9.38-alpha.6 → 0.9.38-alpha.7
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/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +120 -121
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +19 -0
- package/dist/builtin/workflows/builtin/{chunk-q7dx7kh7.js → chunk-85mx6wcf.js} +6 -6
- package/dist/builtin/workflows/builtin/{chunk-neszcj53.js → chunk-8kkv04hz.js} +15 -15
- package/dist/builtin/workflows/builtin/{chunk-g1a4hw0s.js → chunk-8x61e0s7.js} +13 -25
- package/dist/builtin/workflows/builtin/{chunk-2qgfyvzs.js → chunk-y45tkftg.js} +7 -7
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +4 -4
- package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/durable/journal/internal.d.ts +0 -19
- package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +3 -11
- package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +15 -9
- package/dist/builtin/workflows/src/durable/journal/types.d.ts +3 -93
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +992 -756
- package/dist/builtin/workflows/src/index.js +547 -394
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +1 -1
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +29 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/session-picker.d.ts +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +2 -2
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +6 -1
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +4 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +44 -4
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +2 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +1 -4
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +0 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.js +1 -3
- package/dist/core/compaction/pi-summary-fallback.js.map +1 -1
- package/dist/core/extensions/loader-api.js +1 -1
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +7 -1
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/fast-model-routing.js +1 -1
- package/dist/core/fast-model-routing.js.map +1 -1
- package/dist/core/model-config.d.ts +765 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +46 -24
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/resource-loader-reload.js +1 -1
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +1 -1
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/sdk-types.d.ts +4 -0
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +48 -19
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-lifecycle-work.d.ts +3 -0
- package/dist/core/session-lifecycle-work.d.ts.map +1 -1
- package/dist/core/session-lifecycle-work.js +2 -0
- package/dist/core/session-lifecycle-work.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +7 -4
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +149 -41
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +7 -7
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts +3 -2
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +25 -9
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +1 -1
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-resume-args.d.ts +4 -0
- package/dist/core/session-resume-args.d.ts.map +1 -0
- package/dist/core/session-resume-args.js +9 -0
- package/dist/core/session-resume-args.js.map +1 -0
- package/dist/core/session-storage.d.ts +26 -0
- package/dist/core/session-storage.d.ts.map +1 -0
- package/dist/core/session-storage.js +155 -0
- package/dist/core/session-storage.js.map +1 -0
- package/dist/core/session-store-list.d.ts +4 -0
- package/dist/core/session-store-list.d.ts.map +1 -0
- package/dist/core/session-store-list.js +28 -0
- package/dist/core/session-store-list.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts +0 -1
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +0 -5
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-merge.d.ts.map +1 -1
- package/dist/core/settings-merge.js +5 -0
- package/dist/core/settings-merge.js.map +1 -1
- package/dist/core/settings-schema.d.ts +74 -3
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +28 -14
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/storage/errors.d.ts +1 -0
- package/dist/core/storage/errors.d.ts.map +1 -1
- package/dist/core/storage/errors.js.map +1 -1
- package/dist/core/storage/index.d.ts +4 -0
- package/dist/core/storage/index.d.ts.map +1 -1
- package/dist/core/storage/index.js +3 -0
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/provider.d.ts +58 -0
- package/dist/core/storage/provider.d.ts.map +1 -0
- package/dist/core/storage/provider.js +243 -0
- package/dist/core/storage/provider.js.map +1 -0
- package/dist/core/storage/run-journal.d.ts +93 -0
- package/dist/core/storage/run-journal.d.ts.map +1 -0
- package/dist/core/storage/run-journal.js +15 -0
- package/dist/core/storage/run-journal.js.map +1 -0
- package/dist/core/storage/selection.d.ts +16 -0
- package/dist/core/storage/selection.d.ts.map +1 -0
- package/dist/core/storage/selection.js +87 -0
- package/dist/core/storage/selection.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts +2 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/jsonl-session-store.js +58 -29
- package/dist/core/storage/session/jsonl-session-store.js.map +1 -1
- package/dist/core/storage/session/legacy-format.d.ts +18 -0
- package/dist/core/storage/session/legacy-format.d.ts.map +1 -0
- package/dist/core/storage/session/legacy-format.js +63 -0
- package/dist/core/storage/session/legacy-format.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.d.ts +3 -1
- package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/memory-session-store.js +9 -2
- package/dist/core/storage/session/memory-session-store.js.map +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +4 -1
- package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/sql-session-store.js +25 -6
- package/dist/core/storage/session/sql-session-store.js.map +1 -1
- package/dist/core/storage/session/types.d.ts +4 -0
- package/dist/core/storage/session/types.d.ts.map +1 -1
- package/dist/core/storage/session/types.js.map +1 -1
- package/dist/core/tools/read-url.d.ts.map +1 -1
- package/dist/core/tools/read-url.js +6 -1
- package/dist/core/tools/read-url.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +13 -0
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +5 -3
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/main-session.d.ts +5 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +106 -45
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +49 -15
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +3 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +15 -7
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-delete.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector-delete.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-delete.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts +4 -4
- package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js +13 -12
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -5
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +6 -2
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +19 -7
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +3 -1
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js +8 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-args.js +5 -1
- package/dist/modes/interactive-engine/engine-args.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +21 -15
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +3 -1
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +1 -1
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-terminal-drain.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-terminal-drain.js +11 -2
- package/dist/modes/rpc/rpc-terminal-drain.js.map +1 -1
- package/dist/utils/canonical-path.d.ts +5 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +26 -0
- package/dist/utils/canonical-path.js.map +1 -0
- package/dist/utils/paths.d.ts +1 -7
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +1 -15
- package/dist/utils/paths.js.map +1 -1
- package/docs/codemode.md +2 -0
- package/docs/compaction.md +2 -2
- package/docs/docs.json +1 -0
- package/docs/environment-variables.md +6 -2
- package/docs/getting-started/installation.md +1 -1
- package/docs/models/reference.md +2 -0
- package/docs/models-configuration.md +206 -0
- package/docs/models.md +11 -1
- package/docs/providers.md +2 -2
- package/docs/reference/cli.md +4 -0
- package/docs/sdk/web-server.md +3 -3
- package/docs/sdk.md +40 -3
- package/docs/session-format.md +30 -25
- package/docs/sessions.md +41 -17
- package/docs/settings.md +31 -9
- package/docs/storage.md +85 -2
- package/docs/workflows/api-reference.md +23 -15
- package/docs/workflows/operations.md +3 -3
- package/docs/workflows/reliable-design.md +16 -16
- package/npm-shrinkwrap.json +53 -53
- package/package.json +7 -6
- package/schemas/models.schema.json +62 -29
- package/schemas/settings.schema.json +136 -31
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Models Configuration
|
|
3
|
+
sidebarTitle: "models.json fields"
|
|
4
|
+
description: Every provider, model, override, and compatibility field accepted in models.json, generated from the schema.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Models Configuration
|
|
8
|
+
|
|
9
|
+
{/* This file is generated from TypeScript source. Do not edit it manually; run npm run generate:references --workspace=@bastani/atomic. */}
|
|
10
|
+
|
|
11
|
+
This reference lists the fields of `models.json`. See [Custom Models](/models) for examples and the file location (normally `~/.atomic/agent/models.json`).
|
|
12
|
+
|
|
13
|
+
Add `"$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/models.schema.json"` to `models.json` for editor validation and completion.
|
|
14
|
+
|
|
15
|
+
## Providers
|
|
16
|
+
|
|
17
|
+
Each key under `providers` is a provider ID. A built-in provider ID changes that provider. Any other ID adds a provider, which needs `baseUrl` and an `api` at provider or model level.
|
|
18
|
+
|
|
19
|
+
| Field | Type | Default | Description |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| `name` | string | | Display name. |
|
|
22
|
+
| `baseUrl` | string | | API base URL. Also applies to the provider's built-in models. |
|
|
23
|
+
| `apiKey` | string | | Literal key, "$NAME" environment interpolation, or "!command" output. |
|
|
24
|
+
| `api` | string | | API for the provider's models, such as "openai-completions", "openai-responses", "anthropic-messages", or "google-generative-ai". |
|
|
25
|
+
| `oauth` | `"radius"` | | OAuth login flow. Requires baseUrl. |
|
|
26
|
+
| `headers` | object | | Request headers. Values resolve like apiKey. |
|
|
27
|
+
| `compat` | [object](#compatibility) | | Provider and model compatibility overrides. |
|
|
28
|
+
| `authHeader` | boolean | `false` | Whether to send the resolved API key as Authorization: Bearer. |
|
|
29
|
+
| `models` | [`object[]`](#models) | | |
|
|
30
|
+
| `modelOverrides` | [object](#model-overrides) | | |
|
|
31
|
+
|
|
32
|
+
## Models
|
|
33
|
+
|
|
34
|
+
Each `models` entry adds a model to the provider. An entry whose `id` matches an existing model replaces it.
|
|
35
|
+
|
|
36
|
+
| Field | Type | Default | Description |
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
| `id` | string | | Required. Model ID sent to the API. |
|
|
39
|
+
| `name` | string | | Display name, also matched by --model patterns. |
|
|
40
|
+
| `api` | string | | Overrides the provider api. |
|
|
41
|
+
| `baseUrl` | string | | Overrides the provider baseUrl. |
|
|
42
|
+
| `reasoning` | boolean | `false` | Whether the model supports thinking. |
|
|
43
|
+
| `thinkingLevelMap` | object | | Provider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported. |
|
|
44
|
+
| `input` | `("text" \| "image" \| "pdf")[]` | `["text"]` | |
|
|
45
|
+
| `inputLimits` | [object](#input-limits) | | |
|
|
46
|
+
| `cost` | object | | |
|
|
47
|
+
| `cost.input` | number | | Required. Input cost in USD per million tokens. |
|
|
48
|
+
| `cost.output` | number | | Required. Output cost in USD per million tokens. |
|
|
49
|
+
| `cost.cacheRead` | number | | Required. Cache-read cost in USD per million tokens. |
|
|
50
|
+
| `cost.cacheWrite` | number | | Required. Cache-write cost in USD per million tokens. |
|
|
51
|
+
| `cost.tiers` | `object[]` | | Request-wide pricing tiers. The highest matching input threshold applies to the full request. |
|
|
52
|
+
| `cost.tiers[].inputTokensAbove` | number | | Required. Use this tier when total request input exceeds this token count. |
|
|
53
|
+
| `cost.tiers[].input` | number | | Required. Input cost in USD per million tokens. |
|
|
54
|
+
| `cost.tiers[].output` | number | | Required. Output cost in USD per million tokens. |
|
|
55
|
+
| `cost.tiers[].cacheRead` | number | | Required. Cache-read cost in USD per million tokens. |
|
|
56
|
+
| `cost.tiers[].cacheWrite` | number | | Required. Cache-write cost in USD per million tokens. |
|
|
57
|
+
| `promptCache` | object | | Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Atomic warms only tiers with a known lifetime. |
|
|
58
|
+
| `contextWindow` | number | `128000` | Context window in tokens. |
|
|
59
|
+
| `maxTokens` | number | `16384` | Maximum output tokens. |
|
|
60
|
+
| `samplingParams` | object | | Fields merged into every request body. Applies only to OpenAI-compatible APIs. |
|
|
61
|
+
| `samplingParamsByThinkingLevel` | object | | samplingParams per thinking level, merged over samplingParams. |
|
|
62
|
+
| `headers` | object | | Request headers. Values resolve like apiKey. |
|
|
63
|
+
| `compat` | [object](#compatibility) | | Provider and model compatibility overrides. |
|
|
64
|
+
|
|
65
|
+
## Model overrides
|
|
66
|
+
|
|
67
|
+
Each `modelOverrides` key is the ID of a built-in or extension model. Unknown IDs are ignored. Object fields, such as `cost`, merge with the model's value field by field; other fields replace it.
|
|
68
|
+
|
|
69
|
+
| Field | Type | Default | Description |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| `name` | string | | Display name, also matched by --model patterns. |
|
|
72
|
+
| `reasoning` | boolean | | Whether the model supports thinking. |
|
|
73
|
+
| `thinkingLevelMap` | object | | Provider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported. |
|
|
74
|
+
| `input` | `("text" \| "image" \| "pdf")[]` | | |
|
|
75
|
+
| `inputLimits` | [object](#input-limits) | | |
|
|
76
|
+
| `cost` | object | | |
|
|
77
|
+
| `cost.input` | number | | Input cost in USD per million tokens. |
|
|
78
|
+
| `cost.output` | number | | Output cost in USD per million tokens. |
|
|
79
|
+
| `cost.cacheRead` | number | | Cache-read cost in USD per million tokens. |
|
|
80
|
+
| `cost.cacheWrite` | number | | Cache-write cost in USD per million tokens. |
|
|
81
|
+
| `cost.tiers` | `object[]` | | Request-wide pricing tiers. The highest matching input threshold applies to the full request. |
|
|
82
|
+
| `cost.tiers[].inputTokensAbove` | number | | Required. Use this tier when total request input exceeds this token count. |
|
|
83
|
+
| `cost.tiers[].input` | number | | Required. Input cost in USD per million tokens. |
|
|
84
|
+
| `cost.tiers[].output` | number | | Required. Output cost in USD per million tokens. |
|
|
85
|
+
| `cost.tiers[].cacheRead` | number | | Required. Cache-read cost in USD per million tokens. |
|
|
86
|
+
| `cost.tiers[].cacheWrite` | number | | Required. Cache-write cost in USD per million tokens. |
|
|
87
|
+
| `promptCache` | object | | Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Atomic warms only tiers with a known lifetime. |
|
|
88
|
+
| `contextWindow` | number | | Context window in tokens. |
|
|
89
|
+
| `maxTokens` | number | | Maximum output tokens. |
|
|
90
|
+
| `samplingParams` | object | | Fields merged into every request body. Applies only to OpenAI-compatible APIs. |
|
|
91
|
+
| `samplingParamsByThinkingLevel` | object | | samplingParams per thinking level, merged over samplingParams. |
|
|
92
|
+
| `headers` | object | | Request headers. Values resolve like apiKey. |
|
|
93
|
+
| `compat` | [object](#compatibility) | | Provider and model compatibility overrides. |
|
|
94
|
+
|
|
95
|
+
## Input limits
|
|
96
|
+
|
|
97
|
+
See [Image Input Limits](/models/reference#image-input-limits).
|
|
98
|
+
|
|
99
|
+
| Field | Type | Default | Description |
|
|
100
|
+
|---|---|---|---|
|
|
101
|
+
| `maxRequestBytes` | integer | | Maximum serialized provider request size in bytes. |
|
|
102
|
+
| `images` | object | | |
|
|
103
|
+
| `images.resize` | object | | Cache-safe resize profile applied before a new image enters conversation history. |
|
|
104
|
+
| `images.resize.maxWidth` | integer | | |
|
|
105
|
+
| `images.resize.maxHeight` | integer | | |
|
|
106
|
+
| `images.resize.maxBytes` | integer | | Maximum base64-encoded payload size in bytes. |
|
|
107
|
+
| `images.resize.jpegQuality` | integer | | |
|
|
108
|
+
| `images.maxPerMessage` | integer | | Maximum images accepted in one provider message. |
|
|
109
|
+
| `images.maxPerRequest` | integer | | Maximum images accepted across one provider request. |
|
|
110
|
+
|
|
111
|
+
## Compatibility
|
|
112
|
+
|
|
113
|
+
`compat` describes verified differences from an API's standard request and response behavior. Model values override provider values per field. The fields that apply depend on the model's `api`.
|
|
114
|
+
|
|
115
|
+
### `openai-completions`
|
|
116
|
+
|
|
117
|
+
| Field | Type | Default | Description |
|
|
118
|
+
|---|---|---|---|
|
|
119
|
+
| `supportsStore` | boolean | | Whether the provider supports the store field. Default: auto-detected from URL. |
|
|
120
|
+
| `supportsDeveloperRole` | boolean | | Whether the provider supports the developer role instead of system. Default: auto-detected from URL. |
|
|
121
|
+
| `supportsReasoningEffort` | boolean | | Whether the provider supports reasoning_effort. Default: auto-detected from URL. |
|
|
122
|
+
| `supportsTemperature` | boolean | `true` | Whether the model accepts the temperature request field. When false, the provider omits temperature and also strips temperature, top_p, and top_k from samplingParams. |
|
|
123
|
+
| `supportsForcedToolChoice` | boolean | `true` | Whether the model accepts forced tool use (tool_choice "required" or a specific function). When false, the provider rejects a forced choice with an error instead of sending a request the model cannot honor. "auto" and "none" are never altered. |
|
|
124
|
+
| `supportsUsageInStreaming` | boolean | `true` | Whether the provider supports stream_options.include_usage for token usage in streaming responses. |
|
|
125
|
+
| `supportsFinishReason` | boolean | `true` | Whether streamed responses include finish_reason. When false, Atomic infers stop or toolUse when the stream ends. |
|
|
126
|
+
| `maxTokensField` | `"max_completion_tokens" \| "max_tokens"` | | Which field to use for max tokens. Default: auto-detected from URL. |
|
|
127
|
+
| `requiresToolResultName` | boolean | | Whether tool results require the name field. Default: auto-detected from URL. |
|
|
128
|
+
| `requiresAssistantAfterToolResult` | boolean | | Whether a user message after tool results requires an assistant message in between. Default: auto-detected from URL. |
|
|
129
|
+
| `requiresThinkingAsText` | boolean | | Whether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL. |
|
|
130
|
+
| `requiresReasoningContentOnAssistantMessages` | boolean | | Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL. |
|
|
131
|
+
| `thinkingFormat` | `"openai" \| "openrouter" \| "deepseek" \| "together" \| "baseten" \| "zai" \| "qwen" \| "chat-template" \| "qwen-chat-template" \| "string-thinking" \| "ant-ling"` | | Format for reasoning or thinking parameters. When omitted, Atomic auto-detects the format from the provider URL. "openai" uses reasoning_effort, "openrouter" uses reasoning.effort, "deepseek" uses thinking.type plus reasoning_effort when supported, "together" uses reasoning.enabled plus reasoning_effort when supported, "baseten" uses configurable chat_template_args plus reasoning_effort when supported, "zai" uses thinking.type, "qwen" uses top-level enable_thinking, "qwen-chat-template" uses chat_template_kwargs.enable_thinking and preserve_thinking, "chat-template" uses configurable chat_template_kwargs, "string-thinking" uses top-level thinking, and "ant-ling" uses reasoning.effort only when the mapped effort is non-null. |
|
|
132
|
+
| `chatTemplateKwargs` | object | | Kwargs sent as chat_template_kwargs when thinkingFormat is "chat-template". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for Atomic-controlled values. |
|
|
133
|
+
| `chatTemplateArgs` | object | | Arguments sent as chat_template_args when thinkingFormat is "baseten". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for Atomic-controlled values. |
|
|
134
|
+
| `openRouterRouting` | object | | OpenRouter provider routing preferences. Controls which upstream providers OpenRouter routes requests to. Sent as the provider field in the OpenRouter API request body. See https://openrouter.ai/docs/guides/routing/provider-selection. |
|
|
135
|
+
| `vercelGatewayRouting` | object | | Vercel AI Gateway routing preferences. Controls which upstream providers the gateway routes requests to. See https://vercel.com/docs/ai-gateway/models-and-providers/provider-options. |
|
|
136
|
+
| `zaiToolStream` | boolean | `false` | Whether z.ai supports top-level tool_stream for streaming tool call deltas. |
|
|
137
|
+
| `thinkingTokenBudgetField` | `"thinking_token_budget" \| "thinking_budget" \| "thinking_budget_tokens"` | | Top-level request field used to cap reasoning tokens from thinkingBudgets. Reasoning and the answer share max_tokens on these endpoints. "thinking_token_budget" is vLLM, "thinking_budget" is Qwen, DashScope, or SGLang, and "thinking_budget_tokens" is llama.cpp. Off by default and not set on the generated catalog. |
|
|
138
|
+
| `supportsThinkingTokenBudget` | boolean | `false` | Alias for thinkingTokenBudgetField: "thinking_token_budget" (vLLM). Prefer thinkingTokenBudgetField. |
|
|
139
|
+
| `supportsOpenAIGrammarTools` | boolean | `false` | Whether the provider supports OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models. |
|
|
140
|
+
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts system or developer messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models. |
|
|
141
|
+
| `supportsMidConvoToolAdditions` | boolean | `false` | Whether system messages can introduce additional tools mid-conversation. Requires supportsMidConvoSystemMessages. The generated catalog enables this for capable models. |
|
|
142
|
+
| `supportsStrictMode` | boolean | `false` | Whether the provider supports the strict field in tool definitions. Generated capable models enable it explicitly. |
|
|
143
|
+
| `cacheControlFormat` | `"anthropic"` | | Cache control convention for prompt caching. Anthropic applies cache_control markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content. |
|
|
144
|
+
| `sendSessionAffinityHeaders` | boolean | | Whether to send session-affinity data from options.sessionId. Default: true for OpenRouter endpoints, false otherwise. |
|
|
145
|
+
| `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session_id, x-client-request-id, and x-session-affinity; openai-nosession sends x-client-request-id and x-session-affinity; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
|
|
146
|
+
| `supportsLongCacheRetention` | boolean | | Whether the provider supports long prompt cache retention (prompt_cache_retention: "24h" or Anthropic-style cache_control.ttl: "1h", depending on format). Default: auto-detected from provider and URL. |
|
|
147
|
+
| `vllmPriority` | number | | vLLM scheduler priority sent as the top-level priority request field. Lower values are handled earlier and the server default is 0. Only meaningful with --scheduling-policy priority. Off by default and not set on the generated catalog. |
|
|
148
|
+
|
|
149
|
+
### `openai-responses`
|
|
150
|
+
|
|
151
|
+
Also applies to `azure-openai-responses` and `openai-codex-responses`.
|
|
152
|
+
|
|
153
|
+
| Field | Type | Default | Description |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| `supportsDeveloperRole` | boolean | `true` | Whether the provider supports the developer role instead of system. |
|
|
156
|
+
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts developer or system messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models. |
|
|
157
|
+
| `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session_id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
|
|
158
|
+
| `supportsLongCacheRetention` | boolean | `true` | Whether the provider supports long prompt cache retention. This uses prompt_cache_options.ttl: "30m" on GPT-5.6+ and prompt_cache_retention: "24h" on earlier models. |
|
|
159
|
+
| `supportsStrictMode` | boolean | | Whether the provider supports strict JSON-schema function tools. Defaults are API-specific; generated OpenAI models enable it explicitly. |
|
|
160
|
+
| `supportsOpenAIGrammarTools` | boolean | `false` | Whether to emit OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models. |
|
|
161
|
+
| `supportsAdditionalTools` | boolean | `false` | Whether the model supports message-anchored additional_tools input items. |
|
|
162
|
+
| `supportsToolSearch` | boolean | `false` | Whether the model supports client-executed tool search for transcript-anchored additions. |
|
|
163
|
+
| `supportsExplicitPromptCacheMode` | boolean | `false` | Whether the model accepts prompt_cache_options. Older OpenAI models reject the parameter. |
|
|
164
|
+
| `supportsMidConvoEffort` | boolean | `false` | Whether thinking level changes are sent as configuration_update input items instead of changing reasoning.effort, so a change keeps the prompt cache. Only used by the openai-responses API, and ignored with Sign in with ChatGPT on the openai provider. |
|
|
165
|
+
| `supportsMaxOutputTokens` | boolean | `true` | Whether the provider accepts max_output_tokens. Some Codex-protocol gateways reject it. |
|
|
166
|
+
|
|
167
|
+
### `anthropic-messages`
|
|
168
|
+
|
|
169
|
+
| Field | Type | Default | Description |
|
|
170
|
+
|---|---|---|---|
|
|
171
|
+
| `supportsEagerToolInputStreaming` | boolean | `true` | Whether the provider accepts per-tool eager_input_streaming. When false, the Anthropic provider omits tools[].eager_input_streaming and sends the legacy fine-grained-tool-streaming-2025-05-14 beta header for tool-enabled requests. |
|
|
172
|
+
| `supportsLongCacheRetention` | boolean | `true` | Whether the provider supports Anthropic long cache retention through cache_control.ttl. |
|
|
173
|
+
| `sendSessionAffinityHeaders` | boolean | | Whether to send x-session-affinity from options.sessionId when caching is enabled. Required for providers like Fireworks that use session affinity for prompt cache routing; requests to the same replica maximize cache hits. Default: true for OpenRouter endpoints, false otherwise. |
|
|
174
|
+
| `sessionAffinityFormat` | `"openrouter"` | | Session-affinity format. openrouter sends x-session-id; when unset, sends x-session-affinity. |
|
|
175
|
+
| `supportsCacheControlOnTools` | boolean | `true` | Whether the provider supports Anthropic-style cache_control markers on tool definitions. When false, cache_control is omitted from tool parameters. Some Anthropic-compatible providers, such as Fireworks, do not support this field on tools and may reject or ignore it. |
|
|
176
|
+
| `supportsTemperature` | boolean | `true` | Whether the model accepts the Anthropic temperature request field. Claude Opus 4.7+ rejects non-default values. |
|
|
177
|
+
| `forceAdaptiveThinking` | boolean | `false` | Whether to force adaptive thinking (thinking.type: adaptive plus output_config.effort) regardless of model ID. Built-in models that require adaptive thinking set this in generated metadata. Custom Anthropic-compatible providers can set this to true for any model whose upstream requires the adaptive format. Set false to opt out on overridden built-in models. |
|
|
178
|
+
| `allowEmptySignature` | boolean | `false` | Whether to replay empty thinking signatures instead of converting thinking to text. |
|
|
179
|
+
| `supportsStrictTools` | boolean | `false` | Whether the provider supports Anthropic strict tool schemas. Generated Anthropic models enable it explicitly. |
|
|
180
|
+
| `supportsMidConvoEffort` | boolean | `false` | Whether the exact model transport supports effort-only system messages and thinking binding controls. |
|
|
181
|
+
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts system-role messages inside the conversation. When false, later system messages are folded into the top-level system prompt. |
|
|
182
|
+
| `supportsMidConvoToolChanges` | boolean | `false` | Whether the exact model accepts mid-conversation tool_addition and tool_removal blocks. Requires supportsMidConvoSystemMessages. |
|
|
183
|
+
| `allowedFallbackModels` | `object[]` | | Models Anthropic accepts for server-side refusal fallback, with local pricing metadata for returned fallback responses. When absent or empty, callers must omit fallbacks; Anthropic rejects the field for models with no permitted fallback targets. |
|
|
184
|
+
| `enforcesPreservedThinkingBinding` | boolean | `false` | Whether the model runs the Anthropic preserved-thinking conversation check, which rejects a request whose system prompt, tools, or earlier messages changed since a replayed thinking block was produced. When true, the provider sends the thinking-binding-controls-2026-08-01 beta header and thinking.block_binding.prefix_mismatch_behavior: "drop_block", so a changed prefix drops the affected thinking blocks instead of failing the request. |
|
|
185
|
+
| `delegatesThinkingModelBinding` | boolean | `false` | Whether the API adjudicates thinking-block model binding itself, always dropping a block the target model cannot read. When true, an assistant turn produced by a different model on the same provider and API replays its signed thinking and redacted_thinking blocks unchanged instead of being rewritten into plain text. |
|
|
186
|
+
| `supportsForcedToolChoice` | boolean | `true` | Whether the model accepts forced tool use (tool_choice "any" or a specific tool). When false, the provider rejects a forced choice with an error instead of sending a request the model is guaranteed to refuse. "auto" and "none" are never altered. |
|
|
187
|
+
|
|
188
|
+
### `bedrock-converse-stream`
|
|
189
|
+
|
|
190
|
+
| Field | Type | Default | Description |
|
|
191
|
+
|---|---|---|---|
|
|
192
|
+
| `supportsStrictMode` | boolean | `false` | Whether the model supports Bedrock strict tool schemas. |
|
|
193
|
+
| `supportsForcedToolChoice` | boolean | `true` | Whether the model accepts forced tool use (toolChoice "any" or a specific tool). When false, the provider rejects a forced choice with an error instead of sending a request that is guaranteed to fail. "auto" and "none" are never altered. |
|
|
194
|
+
| `supportsTemperature` | boolean | `true` | Whether the model accepts inferenceConfig.temperature. When false, the provider omits the field. |
|
|
195
|
+
|
|
196
|
+
### `mistral-conversations`
|
|
197
|
+
|
|
198
|
+
| Field | Type | Default | Description |
|
|
199
|
+
|---|---|---|---|
|
|
200
|
+
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts system messages after the conversation has started. When false, later system messages are folded into the leading system message. |
|
|
201
|
+
|
|
202
|
+
### Atomic compatibility aliases
|
|
203
|
+
|
|
204
|
+
| Field | Type | Default | Description |
|
|
205
|
+
|---|---|---|---|
|
|
206
|
+
| `supportsGrammarTools` | boolean | | Atomic alias for supportsOpenAIGrammarTools. The canonical field wins if both are set. |
|
package/docs/models.md
CHANGED
|
@@ -19,7 +19,7 @@ For editor completion and validation of providers, models, and `compat` fields,
|
|
|
19
19
|
|
|
20
20
|
## Where to go next
|
|
21
21
|
|
|
22
|
-
This page shows minimal and full `models.json` examples you can copy.
|
|
22
|
+
This page shows minimal and full `models.json` examples you can copy. [Models Configuration](/models-configuration) lists every provider, model, override, and compatibility field directly from the schema. For extended examples, derived variants, and API behavior, see the [Model configuration guide](/models/reference).
|
|
23
23
|
|
|
24
24
|
For choosing which model to use rather than how to declare one, see [Model selection](/models/model-selection).
|
|
25
25
|
|
|
@@ -71,6 +71,16 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
|
|
|
71
71
|
|
|
72
72
|
The `apiKey` is required but Ollama ignores it, so any value works.
|
|
73
73
|
|
|
74
|
+
To route a built-in provider through a proxy, set only its `baseUrl`. Its models and authentication stay unchanged:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"providers": {
|
|
79
|
+
"anthropic": { "baseUrl": "https://proxy.example.com/v1" }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
74
84
|
Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so Atomic sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
|
|
75
85
|
|
|
76
86
|
You can set `compat` at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
|
package/docs/providers.md
CHANGED
|
@@ -389,10 +389,10 @@ The providers below have additional setup, need additional settings, or can use
|
|
|
389
389
|
|
|
390
390
|
### NVIDIA NIM
|
|
391
391
|
|
|
392
|
-
NVIDIA's built-in default is `nvidia/nemotron-3-
|
|
392
|
+
NVIDIA's built-in default is `nvidia/nemotron-3.5-super-vl-120b-a12b`. Saved and explicit model choices still take precedence. To select this model explicitly:
|
|
393
393
|
|
|
394
394
|
```bash
|
|
395
|
-
atomic --provider nvidia --model nvidia/nemotron-3-
|
|
395
|
+
atomic --provider nvidia --model nvidia/nemotron-3.5-super-vl-120b-a12b
|
|
396
396
|
```
|
|
397
397
|
|
|
398
398
|
Use `--list-models` or `/model` to check the current catalog and replace a missing saved model. A catalog listing does not verify account access or serving availability.
|
package/docs/reference/cli.md
CHANGED
|
@@ -138,9 +138,13 @@ When a print-mode turn correctly finishes by calling an opt-in terminating struc
|
|
|
138
138
|
| `--session-id <id>` | Use an exact project session ID; warn and create it when missing |
|
|
139
139
|
| `--fork <id\|prefix>` | Fork an exact ID or unique 8-hex UUID prefix into a new session |
|
|
140
140
|
| `--session-dir <dir>` | Custom session storage directory |
|
|
141
|
+
| `--session-store <path>` | Select a SQLite session database; relative paths resolve from the working directory |
|
|
142
|
+
| `--session-prefix <prefix>` | Use a non-default table prefix with `--session-store` |
|
|
141
143
|
| `--name <name>`, `-n <name>` | Set the session display name |
|
|
142
144
|
| `--no-session` | Ephemeral mode; do not save |
|
|
143
145
|
|
|
146
|
+
See [Choosing a store](/sessions#choosing-a-store) for precedence, prefix rules, and conflicts.
|
|
147
|
+
|
|
144
148
|
## Tool Options
|
|
145
149
|
|
|
146
150
|
| Option | Description |
|
package/docs/sdk/web-server.md
CHANGED
|
@@ -300,11 +300,11 @@ export async function POST(request: Request): Promise<Response> {
|
|
|
300
300
|
|
|
301
301
|
### Choose workflow storage
|
|
302
302
|
|
|
303
|
-
By default, `run()` persists workflow state in the local SQLite journal at `~/.atomic/workflows/journal.sqlite`. Keep it on durable local storage when your service needs restart recovery.
|
|
303
|
+
By default, `run()` persists workflow state in the local SQLite journal at `~/.atomic/workflows/journal.sqlite`. Keep it on durable local storage when your service needs restart recovery. If several replicas must inspect or resume each other's runs, have them share a remote SQLite-compatible database through an adapter. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts).
|
|
304
304
|
|
|
305
|
-
Use `journal: { path: "/var/lib/my-service/workflows.sqlite" }` to select a file for a run, or `journal: { memory: true }` for process-local state that cannot survive a restart.
|
|
305
|
+
Use `journal: { path: "/var/lib/my-service/workflows.sqlite" }` to select a file for a run, or `journal: { memory: true }` for process-local state that cannot survive a restart. Supply a caller-owned async SQLite facade as `{ database, prefix? }`; Atomic does not close it. You can also supply a `RunJournal` instance or `{ adapter, options?, secrets?, prefix? }` for a user-installed driver module.
|
|
306
306
|
|
|
307
|
-
`RunOpts.journal` overrides a non-empty `ATOMIC_WORKFLOW_JOURNAL_PATH`,
|
|
307
|
+
`RunOpts.journal` overrides a non-empty `ATOMIC_WORKFLOW_JOURNAL_PATH`, then `workflows.journal`, then shared top-level `storage`, then the default file. Nearer settings replace whole selections. Relative settings paths resolve against Atomic home. Configuration or storage failures stop the run instead of switching to memory. See [Choosing the durable backend](/workflows/api-reference#choosing-the-durable-backend).
|
|
308
308
|
|
|
309
309
|
## Secure the endpoint
|
|
310
310
|
|
package/docs/sdk.md
CHANGED
|
@@ -160,6 +160,43 @@ const { session } = await createAgentSession({
|
|
|
160
160
|
});
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
+
### Session storage
|
|
164
|
+
|
|
165
|
+
`createAgentSession()` persists sessions in `~/.atomic/workflows/journal.sqlite` by default, sharing the file with workflow runs under separate `session_` and `wf_` table prefixes. Pass `sessionStore` to choose storage explicitly:
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
const { session } = await createAgentSession({
|
|
169
|
+
sessionStore: { kind: "sqlite", path: "./sessions.sqlite", prefix: "project_" },
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Other selections are `{ kind: "jsonl", dir }`, `{ kind: "memory" }`, `{ kind: "database", database, prefix? }`, and `{ kind: "adapter", module, options?, secrets?, prefix? }`. `database` must implement the async `SqliteDatabase` facade. Install your own driver and expose an adapter module for a remote database; Atomic bundles only its local `node:sqlite` adapter. See [Storage adapters](/storage).
|
|
174
|
+
|
|
175
|
+
`sessionStore` also accepts a `SessionStore` instance. A supplied `sessionManager` takes precedence and remains caller-owned. Otherwise, explicit SDK storage wins over the session-directory environment variable, `sessions.storage`, shared `storage`, and the persistent default. Memory is never a default or an opening-failure fallback. The `sessionDir` factory option has been removed; use a JSONL `sessionStore` selection instead. See [Session storage settings](/settings#sessions) for scope and path rules.
|
|
176
|
+
|
|
177
|
+
Atomic closes stores it opens from a selection when the session is disposed, after pending writes finish. Supplied `SessionStore` instances and stores belonging to supplied managers remain caller-owned. With `{ kind: "database", database }`, Atomic closes its store but leaves your database open. Always await `session.dispose()` and close caller-owned stores when no session still uses them.
|
|
178
|
+
|
|
179
|
+
Resume by opening the ID in the chosen store, then pass that manager to the factory:
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { createAgentSession, resolveSessionStore, SessionManager } from "@bastani/atomic";
|
|
183
|
+
|
|
184
|
+
const store = await resolveSessionStore(process.cwd());
|
|
185
|
+
try {
|
|
186
|
+
const manager = await SessionManager.open(store, savedSessionId);
|
|
187
|
+
const { session } = await createAgentSession({ sessionManager: manager });
|
|
188
|
+
try {
|
|
189
|
+
await session.prompt("Continue the task");
|
|
190
|
+
} finally {
|
|
191
|
+
await session.dispose();
|
|
192
|
+
}
|
|
193
|
+
} finally {
|
|
194
|
+
await store.close();
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Await every `SessionManager` mutation before reading dependent state. Writes resolve after commit; a failure rejects with a typed error without publishing the failed entry. There is no `flush()` step. Extension `pi.appendEntry`, `pi.setSessionName`, `pi.setLabel`, and `pi.setThinkingLevel` also return promises. `ExtensionContext.sessionSignal` aborts when reload or shutdown starts, before admitted work is drained. Use it to stop waiting on long-running command resources, but keep awaiting any session write already started. See [SessionManager API](/session-format#sessionmanager-api) and [Storage errors](/storage#storage-errors).
|
|
199
|
+
|
|
163
200
|
### Human input without a terminal
|
|
164
201
|
|
|
165
202
|
Pass `extensionBindings.humanInput` to answer extension dialogs and `ask_user_question` in a Node host. `HostInput` requires all five methods: `confirm`, `select`, `input`, `editor` and `questionnaire`. `QuestionParams` and `QuestionnaireResult` are exported from `@bastani/atomic`; questionnaire answers retain their question indices, answer kinds, selections, previews and notes.
|
|
@@ -243,11 +280,11 @@ await run(myWorkflow, inputs, { journal: { path: "./workflow-runs.sqlite" } });
|
|
|
243
280
|
await run(myWorkflow, inputs, { journal: { memory: true } });
|
|
244
281
|
```
|
|
245
282
|
|
|
246
|
-
Use `{ database }` for an
|
|
283
|
+
Use `{ database, prefix? }` for an async `SqliteDatabase` facade; Atomic never closes the caller-owned database. To use a driver selected by module specifier, pass `{ adapter, options?, secrets?, prefix? }`. Atomic bundles no remote drivers. A supplied `RunJournal` is used as-is. Memory is an explicit opt-in for tests or ephemeral runs and cannot recover runs after process exit. See [Storage adapters](/storage#selecting-an-adapter).
|
|
247
284
|
|
|
248
285
|
Custom journals implement the full `RunJournal` interface, including `deleteOwnedRun(lease, expectSeq?)` for atomic lease-fenced deletion with an optional sequence check. A stale lease rejects with `StaleLeaseError` without deleting the successor's data. Open a facade-backed journal with `await SqlRunJournal.open(database, { prefix })`, or use `await openSqlRunJournal(pathOrDatabase?)` for the node adapter. Validate custom journals with `registerRunJournalConformance`; see [Choosing the durable backend](/workflows/api-reference#choosing-the-durable-backend).
|
|
249
286
|
|
|
250
|
-
Without a per-run option, a non-empty `ATOMIC_WORKFLOW_JOURNAL_PATH` overrides `workflows.journal
|
|
287
|
+
Without a per-run option, a non-empty `ATOMIC_WORKFLOW_JOURNAL_PATH` overrides `workflows.journal`, which overrides shared top-level `storage`. Nearer-scope settings replace whole selections. Relative settings paths resolve against Atomic home. The default journal is `~/.atomic/workflows/journal.sqlite`; an empty shared selection uses `~/.atomic/storage.sqlite`. Keep the original journal and working directory to resume saved runs. Invalid configuration and storage failures reject rather than switching to memory. See [Workflow storage settings](/settings#workflow-storage).
|
|
251
288
|
|
|
252
289
|
### Workflow run control
|
|
253
290
|
|
|
@@ -452,7 +489,7 @@ interface AgentSession {
|
|
|
452
489
|
|
|
453
490
|
Always `await session.dispose()` in `finally`. Disposal immediately refuses new work, cancels and drains owned operations, settles questions, shuts down extensions and releases session leases. Repeated calls await the same outcome.
|
|
454
491
|
|
|
455
|
-
A `ShutdownFailed` error contains component failures in `errors`; cleanup still attempts the remaining components. Caller-supplied managers and model runtimes
|
|
492
|
+
A `ShutdownFailed` error contains component failures in `errors`; cleanup still attempts the remaining components. Stores opened by the SDK, including stores created from a `sessionStore` selection, are released after session work and shutdown handlers finish. A failed session initialization releases its acquired store too. Caller-supplied `SessionStore` instances, session managers, databases, and model runtimes retain their caller-managed lifetimes. Close a supplied store or database only after its other users are done. Disposing one session does not close another session's store or a shared journal. Use `abort()` to cancel current work without destroying the session.
|
|
456
493
|
|
|
457
494
|
Captured extension APIs also refuse new execution, mutations and registrations as soon as close or reload begins. Already-admitted `pi.exec()` calls remain part of the awaited drain; provide `signal` or `timeout` when invoking subprocesses that might not finish on their own. `abort()` alone does not retire the API. A rejected transactional reload restores the surviving generation's action admission.
|
|
458
495
|
|
package/docs/session-format.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# Session File Format
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This page describes format-4 JSONL files used by explicit JSONL stores and exports. Sessions default to SQLite; see [Session storage](/sessions#session-storage) to choose a store. In JSONL, each line is a JSON object with a `type` field. Session entries form a tree through `id` and `parentId`.
|
|
4
4
|
|
|
5
5
|
## File Location
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
|
|
8
|
+
<selected-jsonl-directory>/<timestamp>_<session-id-hash>.jsonl
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`sessions.storage.dir` and `--session-dir` select the directory containing the JSONL files. Session IDs, not these paths, are used for resume and fork selection. Local artifacts and tool-result files remain on the filesystem even with a database-backed session.
|
|
12
12
|
|
|
13
13
|
## Deleting Sessions
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
For an explicitly selected JSONL store, sessions can be removed by deleting their `.jsonl` files. Do not delete the shared SQLite database to remove a single session.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Delete individual sessions from `/resume`: select a session, press `CTRL+D`, then confirm. Database stores delete the selected session record. JSONL stores use the `trash` CLI when available.
|
|
18
18
|
|
|
19
19
|
## Session Version
|
|
20
20
|
|
|
21
|
-
SessionManager writes version 4 headers.
|
|
21
|
+
SessionManager writes version 4 headers. Sessions in formats 1, 2, and 3 are upgraded automatically when opened, resumed, imported, or forked. Reading converts older records in memory; listing sessions and looking up headers leave files unchanged. Opening an older JSONL session persists its upgrade atomically under the file lock before new entries are saved. Future versions, unrecognized version values, and structurally invalid entries remain rejected; unloadable sessions are omitted from resume listings. A complete final record without a newline is accepted; a torn final record is rejected.
|
|
22
22
|
|
|
23
23
|
## Source Files
|
|
24
24
|
|
|
@@ -212,7 +212,7 @@ Workflow-owned sessions carry both `internal: true` and complete `workflow` link
|
|
|
212
212
|
{"type":"session","version":4,"id":"uuid","createdAt":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project","internal":true,"workflow":{"runId":"run-1","stageId":"stage-build","stageName":"build"}}
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
Malformed
|
|
215
|
+
Malformed or incomplete workflow markers remain visible in normal history. Atomic does not infer workflow ownership from `parentSessionId`, so ordinary user-created forks are unaffected. Valid workflow classification is inherited when an internal workflow transcript is branched or forked.
|
|
216
216
|
|
|
217
217
|
### SessionMessageEntry
|
|
218
218
|
|
|
@@ -425,27 +425,30 @@ for (const line of lines) {
|
|
|
425
425
|
|
|
426
426
|
Key methods for working with sessions programmatically.
|
|
427
427
|
|
|
428
|
-
Await `create`, `open`, `continueRecent`, `forkFrom`, and all session mutations. A resolved mutation has committed to its store; a failed write rejects with its typed storage error without publishing the failed entry. There is no `flush` method. `inMemory()` explicitly selects memory and performs no filesystem I/O.
|
|
428
|
+
Await `create`, `open`, `continueRecent`, `forkFrom`, and all session mutations. A resolved mutation has committed to its store; a failed write rejects with its typed storage error without publishing the failed entry. There is no `flush` method. `inMemory()` explicitly selects memory and performs no filesystem I/O. Factories without an explicit store or directory resolve the configured storage, defaulting to the shared local SQLite database. A directory argument explicitly selects JSONL. Store-open failures never fall back to memory.
|
|
429
429
|
|
|
430
430
|
### Static Creation Methods
|
|
431
431
|
|
|
432
|
-
- `SessionManager.create(cwd, sessionDir?, options?)` - New session
|
|
433
|
-
- `SessionManager.
|
|
434
|
-
- `SessionManager.
|
|
435
|
-
- `SessionManager.
|
|
436
|
-
- `SessionManager.
|
|
432
|
+
- `SessionManager.create(cwd, sessionDir?, options?)` - New session in configured storage, or explicit JSONL when a directory is supplied.
|
|
433
|
+
- `SessionManager.create(store, cwd, options?)` - New session in a supplied `SessionStore`. Workflow-owned sessions require the pair `internal: true` and `workflow: { runId, stageId, stageName }`.
|
|
434
|
+
- `SessionManager.open(store, sessionId, cwdOverride?)` - Open an existing session by exact ID in that store. A missing ID raises `SessionNotFoundError`; it does not create a session.
|
|
435
|
+
- `SessionManager.open(path, sessionDir?, cwdOverride?)` - Open a JSONL file directly, creating it if missing. This is a file API, not the CLI session selector.
|
|
436
|
+
- `SessionManager.continueRecent(cwd, sessionDir?, options?)` or `continueRecent(store, cwd, options?)` - Continue the most recent regular session or create one. Pass `{ includeInternal: true }` only to include workflow sessions.
|
|
437
|
+
- `SessionManager.inMemory(cwd?, options?, entries?)` - Explicit memory storage.
|
|
438
|
+
- `SessionManager.forkFrom(sourcePath, targetCwd, sessionDir?, options?)` - Fork a JSONL file into the configured or explicit destination. To fork a database session, open it by ID and await `manager.forkTo(targetCwd, targetStore?, options?)`.
|
|
439
|
+
- `SessionManager.importFromJsonl(inputPath, cwd, targetStoreOrDir?)` - Import a JSONL export without changing its ID, upgrading older supported formats. An existing ID raises `SessionExistsError`.
|
|
437
440
|
|
|
438
441
|
### Static Listing Methods
|
|
439
442
|
|
|
440
|
-
- `SessionManager.list(cwd,
|
|
441
|
-
- `SessionManager.listAll(
|
|
443
|
+
- `SessionManager.list(cwd, storeOrDir?, onProgress?, options?)` - List project sessions. Internal workflow sessions are excluded by default.
|
|
444
|
+
- `SessionManager.listAll(storeOrDir?, onProgress?, options?)` - List sessions across projects in the selected store. Both methods accept `{ includeInternal: true, signal }` to include workflow sessions or cancel listing.
|
|
442
445
|
|
|
443
|
-
|
|
446
|
+
Use the returned `SessionInfo.id` to select a session. Its `path` contains a JSONL location when available and otherwise the ID; do not treat it as a filesystem path. To list workflow sessions in the active store:
|
|
444
447
|
|
|
445
448
|
```typescript
|
|
446
|
-
const stages = await SessionManager.list(cwd,
|
|
449
|
+
const stages = await SessionManager.list(cwd, manager.getSessionStore(), undefined, { includeInternal: true });
|
|
447
450
|
for (const stage of stages.filter((session) => session.internal)) {
|
|
448
|
-
console.log(stage.workflow?.runId, stage.workflow?.stageId, stage.
|
|
451
|
+
console.log(stage.workflow?.runId, stage.workflow?.stageId, stage.id);
|
|
449
452
|
}
|
|
450
453
|
```
|
|
451
454
|
|
|
@@ -453,10 +456,11 @@ for (const stage of stages.filter((session) => session.internal)) {
|
|
|
453
456
|
|
|
454
457
|
- `newSession(options?)` - Start a new session. Options include `parentSession`, `internal`, and workflow run/stage linkage; classification requires a complete marker pair.
|
|
455
458
|
- `markSessionInternal(workflow?)` - Apply valid workflow ownership to the current session, repairing malformed markers while preserving an existing valid marker.
|
|
456
|
-
- `setSessionFile(path)` - Switch to a
|
|
457
|
-
- `createBranchedSession(leafId)` - Extract branch
|
|
459
|
+
- `setSessionFile(path)` - Switch to a JSONL file directly. For ID-based loading, use `SessionManager.open(store, sessionId)` to obtain a new manager.
|
|
460
|
+
- `createBranchedSession(leafId)` - Extract a branch into a new session in the same store
|
|
461
|
+
- `forkTo(cwd, targetStoreOrDir?, options?)` - Copy the conversation into a new session at the destination
|
|
458
462
|
|
|
459
|
-
### Instance Methods - Appending (all return entry ID)
|
|
463
|
+
### Instance Methods - Appending (all return a promise of the entry ID)
|
|
460
464
|
- `appendMessage(message)` - Add message
|
|
461
465
|
- `appendThinkingLevelChange(level)` - Record thinking change
|
|
462
466
|
- `appendContextWindowChange(contextWindow)` - Record context-window selection in tokens
|
|
@@ -490,7 +494,8 @@ for (const stage of stages.filter((session) => session.internal)) {
|
|
|
490
494
|
- `getSessionName()` - Get display name from latest session_info entry (`undefined` when cleared or never named)
|
|
491
495
|
- `getSessionNameState()` - Get the name state: `{ hasName: false }` when never named, `{ hasName: true }` when the latest entry cleared it, `{ hasName: true, name }` when currently named
|
|
492
496
|
- `getCwd()` - Working directory
|
|
493
|
-
- `getSessionDir()` -
|
|
494
|
-
- `getSessionId()` -
|
|
495
|
-
- `
|
|
496
|
-
- `
|
|
497
|
+
- `getSessionDir()` - Local JSONL directory, or an empty string for non-JSONL storage
|
|
498
|
+
- `getSessionId()` - Exact session ID, not necessarily a UUID
|
|
499
|
+
- `getSessionStore()` - Active `SessionStore`
|
|
500
|
+
- `getSessionFile()` - Optional JSONL file location for display
|
|
501
|
+
- `isPersisted()` - Whether the store is not a `MemorySessionStore`
|