apex-code 0.5.2 → 0.6.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 +24 -0
- package/README.md +41 -2
- package/dist/core/agent-session.d.ts +37 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +264 -60
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/default-tool-names.d.ts +7 -0
- package/dist/core/default-tool-names.d.ts.map +1 -0
- package/dist/core/default-tool-names.js +14 -0
- package/dist/core/default-tool-names.js.map +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +2 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +16 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +7 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/permissions/startup.d.ts +1 -1
- package/dist/core/permissions/startup.d.ts.map +1 -1
- package/dist/core/permissions/startup.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -9
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +13 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/contract.d.ts +1 -0
- package/dist/core/tools/contract.d.ts.map +1 -1
- package/dist/core/tools/contract.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/plan-present.d.ts +13 -12
- package/dist/core/tools/plan-present.d.ts.map +1 -1
- package/dist/core/tools/plan-present.js +32 -19
- package/dist/core/tools/plan-present.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts +1 -1
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js +2 -0
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/renderers/todo-write.d.ts +7 -0
- package/dist/core/tools/renderers/todo-write.d.ts.map +1 -0
- package/dist/core/tools/renderers/todo-write.js +58 -0
- package/dist/core/tools/renderers/todo-write.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +13 -2
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +56 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/error-summary.d.ts +2 -0
- package/dist/modes/interactive/components/error-summary.d.ts.map +1 -1
- package/dist/modes/interactive/components/error-summary.js +10 -0
- package/dist/modes/interactive/components/error-summary.js.map +1 -1
- package/dist/modes/interactive/components/first-use-hints.d.ts +1 -1
- package/dist/modes/interactive/components/first-use-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-use-hints.js +1 -0
- package/dist/modes/interactive/components/first-use-hints.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +6 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +38 -11
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +5 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/task-panel.d.ts +27 -0
- package/dist/modes/interactive/components/task-panel.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-panel.js +92 -0
- package/dist/modes/interactive/components/task-panel.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +9 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +81 -8
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-panel.d.ts +7 -0
- package/dist/modes/interactive/components/tool-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-panel.js +35 -0
- package/dist/modes/interactive/components/tool-panel.js.map +1 -1
- package/dist/modes/interactive/components/turn-summary.d.ts +6 -0
- package/dist/modes/interactive/components/turn-summary.d.ts.map +1 -0
- package/dist/modes/interactive/components/turn-summary.js +12 -0
- package/dist/modes/interactive/components/turn-summary.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +10 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +191 -22
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/keybindings.md +21 -2
- package/docs/settings.md +8 -0
- package/npm-shrinkwrap.json +5 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Apex Code changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.1] - 2026-10-04
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Overview renders each tool and user shell operation as one row with its label, lifecycle, and available-output count or failure diagnostic. Details and all retain previews, diffs, and full output. Click an operation or press configurable Alt+O to expand it individually; Ctrl+O cycles the whole transcript and resets individual expansion. The footer shows the current detail mode.
|
|
8
|
+
|
|
9
|
+
## [0.6.0] - 2026-10-04
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `/tree` asks whether to keep current files, restore files to the selected checkpoint, or cancel when the workspace differs. Keeping files is the default. Navigation reports the workspace outcome, and a restore saves a pre-restore checkpoint.
|
|
14
|
+
- Extensions can pass `workspacePolicy` to `navigateTree`. SDK callers can inspect checkpoint drift without changing files or the conversation through `AgentSession.previewTreeWorkspace()`.
|
|
15
|
+
- Completed interactive runs show a dim `Worked for` duration. Aborted runs show `Interrupted after`, including cancellation during retry backoff. Runs under one second show no duration. The line is never saved to the session or sent to the model.
|
|
16
|
+
- Interactive permission modes have an in-memory session override. It governs tool calls, configured commands, and delegated children above configured mode sources. Bypass is available only when it was in force at startup. Reload, resume, and a new session clear the override; `/settings` still writes the saved user default.
|
|
17
|
+
|
|
18
|
+
- Plan mode activates `plan_present` when the tool registry admits it. Its selector offers approval with automatic edit acceptance, approval with edit prompts, or continued planning. Approval changes only the session mode and refreshes the footer. Explicitly selected tools remain active; tool allowlists and exclusions still apply.
|
|
19
|
+
|
|
20
|
+
- Active task lists appear in a pinned panel above the composer. Alt+J and `/tasks` toggle a globally saved expansion preference. The panel follows branch navigation and resume, retains tasks through compaction, and hides a completed list when the run settles. On macOS, Alt+J needs Option configured as Meta.
|
|
21
|
+
- The task-list tool remains opt-in. A `/settings` row adds or removes `todo_write` from saved defaults for new sessions while preserving other tools. Project defaults make the row read-only. Task results show a compact completion count with expandable details.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Shift+Tab now cycles permission modes for this session. Alt+T cycles thinking levels. The footer marks session overrides and shows the bound cycle key; the first cycle explains the new bindings. To restore the old thinking key, set `"app.thinking.cycle": "shift+tab"` and `"app.permissionMode.cycle": "alt+t"` in `~/.apex-code/agent/keybindings.json`, then run `/reload`. On macOS, Alt+T needs Option configured as Meta.
|
|
26
|
+
|
|
3
27
|
## [0.5.2] - 2026-09-30
|
|
4
28
|
|
|
5
29
|
### Changed
|
package/README.md
CHANGED
|
@@ -170,6 +170,7 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
170
170
|
| `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
|
|
171
171
|
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
172
172
|
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
173
|
+
| `/tasks` | Expand or collapse the pinned task panel |
|
|
173
174
|
| `/resume` | Pick from previous sessions |
|
|
174
175
|
| `/new` | Start a new session |
|
|
175
176
|
| `/name <name>` | Set session display name |
|
|
@@ -203,11 +204,49 @@ See `/hotkeys` for the full list. Customize via `~/.apex-code/agent/keybindings.
|
|
|
203
204
|
| Escape twice | Open `/tree` |
|
|
204
205
|
| Ctrl+L | Open model selector |
|
|
205
206
|
| Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
|
|
206
|
-
| Shift+Tab | Cycle
|
|
207
|
+
| Shift+Tab | Cycle permission mode for this session |
|
|
208
|
+
| Alt+T | Cycle thinking level |
|
|
207
209
|
| Ctrl+O | Collapse/expand tool output |
|
|
208
210
|
| Ctrl+T | Collapse/expand thinking blocks |
|
|
211
|
+
| Alt+J | Expand or collapse the task panel |
|
|
209
212
|
| Ctrl+X | Copy the last assistant message; with fullscreen copy-on-select disabled, copy the active text selection |
|
|
210
213
|
|
|
214
|
+
The permission cycle affects only the running session. The footer marks a session
|
|
215
|
+
override, and `/settings` still changes the saved default. The cycle includes bypass
|
|
216
|
+
only when bypass was in force at startup. On macOS, Alt+T needs Option configured as
|
|
217
|
+
Meta. See [keybinding configuration](docs/keybindings.md#custom-configuration) to
|
|
218
|
+
restore Shift+Tab for thinking levels.
|
|
219
|
+
|
|
220
|
+
### Plan approval
|
|
221
|
+
|
|
222
|
+
Plan mode activates `plan_present` when your tool selection admits it. When the agent
|
|
223
|
+
presents a plan, choose **Yes, and accept edits**, **Yes, and ask before each edit**,
|
|
224
|
+
or **No, keep planning**. Approval changes the permission mode for this session
|
|
225
|
+
and updates the footer. Keeping planning or dismissing the selector leaves plan
|
|
226
|
+
mode unchanged. Reload clears the session override.
|
|
227
|
+
|
|
228
|
+
If you use `--tools`, include `plan_present` to allow the approval flow. A tool
|
|
229
|
+
listed explicitly stays active after approval. `--no-tools` and tool exclusions
|
|
230
|
+
remain authoritative.
|
|
231
|
+
|
|
232
|
+
### Task list
|
|
233
|
+
|
|
234
|
+
When `todo_write` is active and the agent records tasks, a panel above the
|
|
235
|
+
composer shows completed and total counts plus the task in progress. Press Alt+J
|
|
236
|
+
or run `/tasks` to expand up to five items and an overflow count. Your expansion
|
|
237
|
+
choice is saved globally. On macOS, configure Option as Meta for Alt+J.
|
|
238
|
+
|
|
239
|
+
The panel follows the current branch through `/tree` and resume, and retains
|
|
240
|
+
tasks through compaction. A newly completed list hides when the run settles.
|
|
241
|
+
The transcript keeps a compact `Task list updated · N/M complete` result;
|
|
242
|
+
expand that result to inspect the recorded list.
|
|
243
|
+
|
|
244
|
+
Enable the task-list tool in `/settings` for new sessions. This preserves your
|
|
245
|
+
other default tools and does not change the current session. A project
|
|
246
|
+
`defaultTools` selection makes the row read-only. CLI tool selection and
|
|
247
|
+
exclusions take precedence. To enable it for one invocation, include
|
|
248
|
+
`todo_write` in `--tools` alongside the other tools you want.
|
|
249
|
+
|
|
211
250
|
### Message Queue
|
|
212
251
|
|
|
213
252
|
Submit messages while the agent is working:
|
|
@@ -525,7 +564,7 @@ Pi is aggressively extensible so it doesn't have to dictate your workflow. Featu
|
|
|
525
564
|
|
|
526
565
|
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
|
|
527
566
|
|
|
528
|
-
**
|
|
567
|
+
**Plan mode.** Apex Code supports a session permission mode for planning and an interactive [plan approval flow](#plan-approval). Approval selects the edit policy for the running session.
|
|
529
568
|
|
|
530
569
|
**No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
|
|
531
570
|
|
|
@@ -102,6 +102,7 @@ export type AgentSessionEvent = Exclude<AgentEvent, {
|
|
|
102
102
|
success: boolean;
|
|
103
103
|
attempt: number;
|
|
104
104
|
finalError?: string;
|
|
105
|
+
aborted?: boolean;
|
|
105
106
|
} | {
|
|
106
107
|
type: "summarization_retry_scheduled";
|
|
107
108
|
attempt: number;
|
|
@@ -137,6 +138,7 @@ export interface AggregateBudgetUsageSnapshot {
|
|
|
137
138
|
startedAtMs: number;
|
|
138
139
|
}
|
|
139
140
|
export interface AgentSessionConfig {
|
|
141
|
+
implicitDefaultToolNames?: readonly string[];
|
|
140
142
|
childRunRegistry?: ChildRunRegistry;
|
|
141
143
|
/**
|
|
142
144
|
* The session's delegation runtime options when delegation is configured.
|
|
@@ -302,6 +304,16 @@ export interface SessionStats {
|
|
|
302
304
|
}
|
|
303
305
|
/** Explicit workspace policy for `/tree` and `/fork`-family navigation (spec § 4). */
|
|
304
306
|
export type TreeWorkspacePolicy = "keep" | "restore" | "fail-if-drifted" | "cancel";
|
|
307
|
+
export type TreeWorkspacePreview = {
|
|
308
|
+
state: "no-checkpoint";
|
|
309
|
+
} | {
|
|
310
|
+
state: "unavailable";
|
|
311
|
+
reason: string;
|
|
312
|
+
} | {
|
|
313
|
+
state: "matches";
|
|
314
|
+
} | {
|
|
315
|
+
state: "differs";
|
|
316
|
+
};
|
|
305
317
|
/** What the navigation did to the workspace, reported separately from the conversation move. */
|
|
306
318
|
export interface TreeWorkspaceOutcome {
|
|
307
319
|
policy: TreeWorkspacePolicy;
|
|
@@ -386,9 +398,13 @@ export declare class AgentSession {
|
|
|
386
398
|
private _initialActiveToolNames?;
|
|
387
399
|
private _allowedToolNames?;
|
|
388
400
|
private _excludedToolNames?;
|
|
401
|
+
private readonly _implicitDefaultToolNames?;
|
|
389
402
|
private _baseToolsOverride?;
|
|
390
403
|
private _sessionStartEvent;
|
|
391
404
|
private _permissionGate?;
|
|
405
|
+
private _interactivePermissionMode?;
|
|
406
|
+
private _interactivePermissionModeGeneration;
|
|
407
|
+
private readonly _startupPermissionMode?;
|
|
392
408
|
private _evidenceSink?;
|
|
393
409
|
private _diagnosticsOperations?;
|
|
394
410
|
private _lspOperations?;
|
|
@@ -422,6 +438,13 @@ export declare class AgentSession {
|
|
|
422
438
|
private _baseSystemPromptOptions;
|
|
423
439
|
/** Prompt options after before_agent_start mutations for the active run. */
|
|
424
440
|
private _runSystemPromptOptions?;
|
|
441
|
+
private _requestedToolNames;
|
|
442
|
+
private _runRequestedToolNames?;
|
|
443
|
+
private _planToolMode?;
|
|
444
|
+
private _planToolSyncGeneration;
|
|
445
|
+
private _pendingPlanToolSync?;
|
|
446
|
+
private _planToolSyncChange;
|
|
447
|
+
private _planPresentationGeneration;
|
|
425
448
|
constructor(config: AgentSessionConfig);
|
|
426
449
|
get modelRuntime(): ModelRuntime;
|
|
427
450
|
private _getRequiredRequestAuth;
|
|
@@ -638,6 +661,7 @@ export declare class AgentSession {
|
|
|
638
661
|
get systemPrompt(): string;
|
|
639
662
|
/** Current retry attempt (0 if not retrying) */
|
|
640
663
|
get retryAttempt(): number;
|
|
664
|
+
getImplicitDefaultToolNames(): string[];
|
|
641
665
|
/**
|
|
642
666
|
* Get the names of currently active tools.
|
|
643
667
|
* Returns the names of tools currently set on the agent.
|
|
@@ -660,6 +684,12 @@ export declare class AgentSession {
|
|
|
660
684
|
* Changes take effect on the next agent turn.
|
|
661
685
|
*/
|
|
662
686
|
setActiveToolsByName(toolNames: string[]): void;
|
|
687
|
+
private _projectToolNames;
|
|
688
|
+
private _applyRequestedTools;
|
|
689
|
+
private _setPendingPlanToolSync;
|
|
690
|
+
private _syncPlanToolMode;
|
|
691
|
+
private _schedulePlanToolSync;
|
|
692
|
+
private _presentPlan;
|
|
663
693
|
/** Whether compaction or branch summarization is currently running */
|
|
664
694
|
get isCompacting(): boolean;
|
|
665
695
|
/** All messages including custom types like BashExecutionMessage */
|
|
@@ -831,6 +861,11 @@ export declare class AgentSession {
|
|
|
831
861
|
* to the next tool call with no restart.
|
|
832
862
|
*/
|
|
833
863
|
getPermissionMode(): Promise<EffectiveModeResolution | undefined>;
|
|
864
|
+
getInteractivePermissionMode(): PermissionMode | undefined;
|
|
865
|
+
getInteractivePermissionModeCycle(): Promise<readonly PermissionMode[]>;
|
|
866
|
+
setInteractivePermissionMode(mode: PermissionMode): Promise<EffectiveModeResolution | undefined>;
|
|
867
|
+
private _setInteractivePermissionMode;
|
|
868
|
+
clearInteractivePermissionMode(): void;
|
|
834
869
|
/**
|
|
835
870
|
* Persist a permission mode to user scope (`~/.apex-code/agent/permissions.json`).
|
|
836
871
|
* Returns the resolution that is actually in force afterwards, which is *not*
|
|
@@ -1077,6 +1112,8 @@ export declare class AgentSession {
|
|
|
1077
1112
|
label?: string;
|
|
1078
1113
|
workspacePolicy?: TreeWorkspacePolicy;
|
|
1079
1114
|
}): Promise<TreeNavigationResult>;
|
|
1115
|
+
previewTreeWorkspace(targetId: string): Promise<TreeWorkspacePreview>;
|
|
1116
|
+
private _inspectTreeWorkspace;
|
|
1080
1117
|
private _resolveTreeWorkspaceStep;
|
|
1081
1118
|
/**
|
|
1082
1119
|
* Get all user messages from session for fork selector.
|