@callstack/apex 0.3.0 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +41 -10
  2. package/dist/cli.js +689 -483
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -148,15 +148,43 @@ their own backup first, so an undo is itself reversible. Apex CLI records each b
148
148
  | OpenCode | `~/.config/opencode/opencode.json` or `.jsonc` | Adds `provider.callstack.ai`, OpenAI-compatible transport, model and environment-key reference; preserves the default model. A config already in OpenCode 2's `providers` format gets the v2 entry instead, and you add the key with `/connect`. |
149
149
  | Codex 0.134.0+ | `~/.codex/callstack_ai.config.toml` | Adds a self-contained Responses API provider/profile; leaves base config and default model untouched. |
150
150
  | Claude Code | `~/.claude/settings.json` | Merges attribution flag only; use `apex run claude` for gateway credentials and model selection. |
151
- | Pi | `~/.pi/agent/models.json` | Adds `providers.callstack` with Chat Completions, Apex and `$CALLSTACK_AUTH_TOKEN`; preserves other models. Requires a Pi version supporting `$VAR` key interpolation. |
151
+ | Pi | `~/.pi/agent/models.json` and `settings.json` | Adds `providers.callstack` with Chat Completions, Apex and `$CALLSTACK_AUTH_TOKEN`; saves `medium` as Apex's per-model thinking default for direct launches. Preserves other models and their defaults. Requires a Pi version supporting `$VAR` key interpolation and `modelThinkingLevels`. |
152
152
  | Cursor | Guided setup | Prints endpoint, API-key and custom-model steps; does not modify private editor storage. |
153
153
  | VS Code / Copilot | Guided setup | Detects VS Code, not whether Copilot is installed; prints custom-endpoint steps and model JSON, retaining the editor-generated secret reference. |
154
- | Vercel AI SDK / Eve | Guided setup | Detected from the `package.json` in the directory you run Apex CLI from (`ai`, `@ai-sdk/openai` or `eve`); prints the connector snippet, which reads the key from `CALLSTACK_AUTH_TOKEN`, and the Eve context-window setting. Nothing is written into the project. |
155
-
156
- OpenCode, Pi, Codex and the Copilot model JSON also declare what Apex can do, in each tool's own
157
- fields: a 262,144-token context window, 16,384 output tokens, tool calling, image input, and the
158
- `none`/`low`/`medium`/`xhigh` reasoning efforts (default `medium`). Cursor and Claude Code have no
159
- such fields for a custom model.
154
+ | Vercel AI SDK / Eve | Guided setup | Detected from the `package.json` in the directory you run Apex CLI from (`ai`, `@ai-sdk/openai` or `eve`); prints the connector snippet, which reads the key from `CALLSTACK_AUTH_TOKEN`. Nothing is written into the project. |
155
+
156
+ Apex configs declare tool calling, image input, and the supported
157
+ `none`/`low`/`medium`/`xhigh` reasoning efforts (default `medium`) where supported.
158
+ OpenCode, Pi, Copilot, Claude's launcher, and the AI SDK guidance retain a 32,768-token output
159
+ budget. OpenCode, Pi, Codex, Copilot, and Claude's launcher declare the model's native
160
+ 262,144-token context window using each app's documented fields. Input limits and compaction
161
+ thresholds use the harness defaults; Apex CLI does not set a separate input budget or compaction
162
+ reserve.
163
+ Pi's per-model default applies to fresh direct launches and model selection; `apex run pi` also
164
+ selects `medium` explicitly. Resumed Pi sessions retain their saved thinking level.
165
+
166
+ The gateway model ID, authentication, `medium` default, and `off` → `none` translation remain
167
+ Callstack-specific.
168
+
169
+ | Harness | Context field | Output field | Official reference |
170
+ | --- | --- | --- | --- |
171
+ | OpenCode | `limit.context` | `limit.output` | [Custom providers](https://opencode.ai/docs/providers/) |
172
+ | Pi | `contextWindow` | `maxTokens` | [Custom models](https://pi.dev/docs/latest/models) |
173
+ | Codex | `model_context_window` | No output-limit config key | [OpenAI configuration reference](https://developers.openai.com/codex/config-reference/) |
174
+ | Claude Code launcher | `CLAUDE_CODE_MAX_CONTEXT_TOKENS` | `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | [Environment variables](https://code.claude.com/docs/en/env-vars) |
175
+ | VS Code / Copilot | `contextWindow` | `maxOutputTokens` | [Custom endpoint models](https://code.visualstudio.com/docs/agent-customization/language-models) |
176
+
177
+ The Claude launcher sets context/output limits only in the child process and does not set compaction
178
+ window or percentage controls. Pi retains its native compaction settings. The AI SDK
179
+ snippet sets the output budget without inventing a context-window option.
180
+
181
+ Run `apex init` again after updating the CLI to preview upgrades to an existing Apex setup; pass
182
+ `--apply` to save them. Apex context/output metadata and reasoning mappings are updated in place. Older OpenCode input
183
+ limits and Codex compaction overrides are removed so each harness uses its own compaction defaults.
184
+ Codex's obsolete `model_max_output_tokens` key from older Apex versions is removed, and its dedicated
185
+ profile becomes self-contained. Unrelated settings, models, credentials and comments are preserved;
186
+ the ordinary backups and `apex undo` also cover upgrades. `none` remains supported: the gateway
187
+ translates it to thinking off.
160
188
 
161
189
  Respects `XDG_CONFIG_HOME`, `CODEX_HOME`, `CLAUDE_CONFIG_DIR`, `PI_CODING_AGENT_DIR`,
162
190
  `XDG_STATE_HOME`/`APEX_STATE_DIR`, and Windows `APPDATA`. Project-specific settings and custom
@@ -201,9 +229,12 @@ Apex CLI will not break what you already have.
201
229
  How that works underneath:
202
230
 
203
231
  - Previews print paths and key/value changes, never secrets.
204
- - All selected configurations are parsed before any write. Malformed files, conflicting Codex
205
- profile keys and symlinked files or directories are refused, and one bad assistant blocks the
206
- whole batch instead of half-applying it.
232
+ - All selected configurations are parsed before any write. Malformed files, symlinked files and
233
+ dangling links are refused, and one bad assistant blocks the whole batch instead of half-applying
234
+ it. Symlinked directories, such as Stow-managed dotfiles, are followed; the `.apex-backup-*` copies
235
+ then land in your dotfiles repo, so add `*.apex-backup-*` to its `.gitignore`.
236
+ - The dedicated Codex Apex profile's owned keys are upgraded rather than rejected as conflicts;
237
+ the base `config.toml` and other profiles remain untouched.
207
238
  - JSON/JSONC edits preserve comments and unrelated keys. The Callstack endpoint is set to the
208
239
  documented one. A key the assistant already has (in OpenCode's own key store, or in Pi's
209
240
  `models.json`, where Apex CLI 0.2 put them) is kept, so upgrading never leaves an assistant