@oh-my-pi/pi-coding-agent 1.337.0
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 +1228 -0
- package/README.md +1041 -0
- package/docs/compaction.md +403 -0
- package/docs/custom-tools.md +541 -0
- package/docs/extension-loading.md +1004 -0
- package/docs/hooks.md +867 -0
- package/docs/rpc.md +1040 -0
- package/docs/sdk.md +994 -0
- package/docs/session-tree-plan.md +441 -0
- package/docs/session.md +240 -0
- package/docs/skills.md +290 -0
- package/docs/theme.md +637 -0
- package/docs/tree.md +197 -0
- package/docs/tui.md +341 -0
- package/examples/README.md +21 -0
- package/examples/custom-tools/README.md +124 -0
- package/examples/custom-tools/hello/index.ts +20 -0
- package/examples/custom-tools/question/index.ts +84 -0
- package/examples/custom-tools/subagent/README.md +172 -0
- package/examples/custom-tools/subagent/agents/planner.md +37 -0
- package/examples/custom-tools/subagent/agents/reviewer.md +35 -0
- package/examples/custom-tools/subagent/agents/scout.md +50 -0
- package/examples/custom-tools/subagent/agents/worker.md +24 -0
- package/examples/custom-tools/subagent/agents.ts +156 -0
- package/examples/custom-tools/subagent/commands/implement-and-review.md +10 -0
- package/examples/custom-tools/subagent/commands/implement.md +10 -0
- package/examples/custom-tools/subagent/commands/scout-and-plan.md +9 -0
- package/examples/custom-tools/subagent/index.ts +1002 -0
- package/examples/custom-tools/todo/index.ts +212 -0
- package/examples/hooks/README.md +56 -0
- package/examples/hooks/auto-commit-on-exit.ts +49 -0
- package/examples/hooks/confirm-destructive.ts +59 -0
- package/examples/hooks/custom-compaction.ts +116 -0
- package/examples/hooks/dirty-repo-guard.ts +52 -0
- package/examples/hooks/file-trigger.ts +41 -0
- package/examples/hooks/git-checkpoint.ts +53 -0
- package/examples/hooks/handoff.ts +150 -0
- package/examples/hooks/permission-gate.ts +34 -0
- package/examples/hooks/protected-paths.ts +30 -0
- package/examples/hooks/qna.ts +119 -0
- package/examples/hooks/snake.ts +343 -0
- package/examples/hooks/status-line.ts +40 -0
- package/examples/sdk/01-minimal.ts +22 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +44 -0
- package/examples/sdk/04-skills.ts +44 -0
- package/examples/sdk/05-tools.ts +90 -0
- package/examples/sdk/06-hooks.ts +61 -0
- package/examples/sdk/07-context-files.ts +36 -0
- package/examples/sdk/08-slash-commands.ts +42 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +55 -0
- package/examples/sdk/10-settings.ts +38 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +95 -0
- package/examples/sdk/README.md +154 -0
- package/package.json +81 -0
- package/src/cli/args.ts +246 -0
- package/src/cli/file-processor.ts +72 -0
- package/src/cli/list-models.ts +104 -0
- package/src/cli/plugin-cli.ts +650 -0
- package/src/cli/session-picker.ts +41 -0
- package/src/cli.ts +10 -0
- package/src/commands/init.md +20 -0
- package/src/config.ts +159 -0
- package/src/core/agent-session.ts +1900 -0
- package/src/core/auth-storage.ts +236 -0
- package/src/core/bash-executor.ts +196 -0
- package/src/core/compaction/branch-summarization.ts +343 -0
- package/src/core/compaction/compaction.ts +742 -0
- package/src/core/compaction/index.ts +7 -0
- package/src/core/compaction/utils.ts +154 -0
- package/src/core/custom-tools/index.ts +21 -0
- package/src/core/custom-tools/loader.ts +248 -0
- package/src/core/custom-tools/types.ts +169 -0
- package/src/core/custom-tools/wrapper.ts +28 -0
- package/src/core/exec.ts +129 -0
- package/src/core/export-html/index.ts +211 -0
- package/src/core/export-html/template.css +781 -0
- package/src/core/export-html/template.html +54 -0
- package/src/core/export-html/template.js +1185 -0
- package/src/core/export-html/vendor/highlight.min.js +1213 -0
- package/src/core/export-html/vendor/marked.min.js +6 -0
- package/src/core/hooks/index.ts +16 -0
- package/src/core/hooks/loader.ts +312 -0
- package/src/core/hooks/runner.ts +434 -0
- package/src/core/hooks/tool-wrapper.ts +99 -0
- package/src/core/hooks/types.ts +773 -0
- package/src/core/index.ts +52 -0
- package/src/core/mcp/client.ts +158 -0
- package/src/core/mcp/config.ts +154 -0
- package/src/core/mcp/index.ts +45 -0
- package/src/core/mcp/loader.ts +68 -0
- package/src/core/mcp/manager.ts +181 -0
- package/src/core/mcp/tool-bridge.ts +148 -0
- package/src/core/mcp/transports/http.ts +316 -0
- package/src/core/mcp/transports/index.ts +6 -0
- package/src/core/mcp/transports/stdio.ts +252 -0
- package/src/core/mcp/types.ts +220 -0
- package/src/core/messages.ts +189 -0
- package/src/core/model-registry.ts +317 -0
- package/src/core/model-resolver.ts +393 -0
- package/src/core/plugins/doctor.ts +59 -0
- package/src/core/plugins/index.ts +38 -0
- package/src/core/plugins/installer.ts +189 -0
- package/src/core/plugins/loader.ts +338 -0
- package/src/core/plugins/manager.ts +672 -0
- package/src/core/plugins/parser.ts +105 -0
- package/src/core/plugins/paths.ts +32 -0
- package/src/core/plugins/types.ts +190 -0
- package/src/core/sdk.ts +760 -0
- package/src/core/session-manager.ts +1128 -0
- package/src/core/settings-manager.ts +443 -0
- package/src/core/skills.ts +437 -0
- package/src/core/slash-commands.ts +248 -0
- package/src/core/system-prompt.ts +439 -0
- package/src/core/timings.ts +25 -0
- package/src/core/tools/ask.ts +211 -0
- package/src/core/tools/bash-interceptor.ts +120 -0
- package/src/core/tools/bash.ts +250 -0
- package/src/core/tools/context.ts +32 -0
- package/src/core/tools/edit-diff.ts +475 -0
- package/src/core/tools/edit.ts +208 -0
- package/src/core/tools/exa/company.ts +59 -0
- package/src/core/tools/exa/index.ts +64 -0
- package/src/core/tools/exa/linkedin.ts +59 -0
- package/src/core/tools/exa/logger.ts +56 -0
- package/src/core/tools/exa/mcp-client.ts +368 -0
- package/src/core/tools/exa/render.ts +196 -0
- package/src/core/tools/exa/researcher.ts +90 -0
- package/src/core/tools/exa/search.ts +337 -0
- package/src/core/tools/exa/types.ts +168 -0
- package/src/core/tools/exa/websets.ts +248 -0
- package/src/core/tools/find.ts +261 -0
- package/src/core/tools/grep.ts +555 -0
- package/src/core/tools/index.ts +202 -0
- package/src/core/tools/ls.ts +140 -0
- package/src/core/tools/lsp/client.ts +605 -0
- package/src/core/tools/lsp/config.ts +147 -0
- package/src/core/tools/lsp/edits.ts +101 -0
- package/src/core/tools/lsp/index.ts +804 -0
- package/src/core/tools/lsp/render.ts +447 -0
- package/src/core/tools/lsp/rust-analyzer.ts +145 -0
- package/src/core/tools/lsp/types.ts +463 -0
- package/src/core/tools/lsp/utils.ts +486 -0
- package/src/core/tools/notebook.ts +229 -0
- package/src/core/tools/path-utils.ts +61 -0
- package/src/core/tools/read.ts +240 -0
- package/src/core/tools/renderers.ts +540 -0
- package/src/core/tools/task/agents.ts +153 -0
- package/src/core/tools/task/artifacts.ts +114 -0
- package/src/core/tools/task/bundled-agents/browser.md +71 -0
- package/src/core/tools/task/bundled-agents/explore.md +82 -0
- package/src/core/tools/task/bundled-agents/plan.md +54 -0
- package/src/core/tools/task/bundled-agents/reviewer.md +59 -0
- package/src/core/tools/task/bundled-agents/task.md +53 -0
- package/src/core/tools/task/bundled-commands/architect-plan.md +10 -0
- package/src/core/tools/task/bundled-commands/implement-with-critic.md +11 -0
- package/src/core/tools/task/bundled-commands/implement.md +11 -0
- package/src/core/tools/task/commands.ts +213 -0
- package/src/core/tools/task/discovery.ts +208 -0
- package/src/core/tools/task/executor.ts +367 -0
- package/src/core/tools/task/index.ts +388 -0
- package/src/core/tools/task/model-resolver.ts +115 -0
- package/src/core/tools/task/parallel.ts +38 -0
- package/src/core/tools/task/render.ts +232 -0
- package/src/core/tools/task/types.ts +99 -0
- package/src/core/tools/truncate.ts +265 -0
- package/src/core/tools/web-fetch.ts +2370 -0
- package/src/core/tools/web-search/auth.ts +193 -0
- package/src/core/tools/web-search/index.ts +537 -0
- package/src/core/tools/web-search/providers/anthropic.ts +198 -0
- package/src/core/tools/web-search/providers/exa.ts +302 -0
- package/src/core/tools/web-search/providers/perplexity.ts +195 -0
- package/src/core/tools/web-search/render.ts +182 -0
- package/src/core/tools/web-search/types.ts +180 -0
- package/src/core/tools/write.ts +99 -0
- package/src/index.ts +176 -0
- package/src/main.ts +464 -0
- package/src/migrations.ts +135 -0
- package/src/modes/index.ts +43 -0
- package/src/modes/interactive/components/armin.ts +382 -0
- package/src/modes/interactive/components/assistant-message.ts +86 -0
- package/src/modes/interactive/components/bash-execution.ts +196 -0
- package/src/modes/interactive/components/bordered-loader.ts +41 -0
- package/src/modes/interactive/components/branch-summary-message.ts +42 -0
- package/src/modes/interactive/components/compaction-summary-message.ts +45 -0
- package/src/modes/interactive/components/custom-editor.ts +122 -0
- package/src/modes/interactive/components/diff.ts +147 -0
- package/src/modes/interactive/components/dynamic-border.ts +25 -0
- package/src/modes/interactive/components/footer.ts +381 -0
- package/src/modes/interactive/components/hook-editor.ts +117 -0
- package/src/modes/interactive/components/hook-input.ts +64 -0
- package/src/modes/interactive/components/hook-message.ts +96 -0
- package/src/modes/interactive/components/hook-selector.ts +91 -0
- package/src/modes/interactive/components/model-selector.ts +247 -0
- package/src/modes/interactive/components/oauth-selector.ts +120 -0
- package/src/modes/interactive/components/plugin-settings.ts +479 -0
- package/src/modes/interactive/components/queue-mode-selector.ts +56 -0
- package/src/modes/interactive/components/session-selector.ts +204 -0
- package/src/modes/interactive/components/settings-selector.ts +453 -0
- package/src/modes/interactive/components/show-images-selector.ts +45 -0
- package/src/modes/interactive/components/theme-selector.ts +62 -0
- package/src/modes/interactive/components/thinking-selector.ts +64 -0
- package/src/modes/interactive/components/tool-execution.ts +675 -0
- package/src/modes/interactive/components/tree-selector.ts +866 -0
- package/src/modes/interactive/components/user-message-selector.ts +159 -0
- package/src/modes/interactive/components/user-message.ts +18 -0
- package/src/modes/interactive/components/visual-truncate.ts +50 -0
- package/src/modes/interactive/components/welcome.ts +183 -0
- package/src/modes/interactive/interactive-mode.ts +2516 -0
- package/src/modes/interactive/theme/dark.json +101 -0
- package/src/modes/interactive/theme/light.json +98 -0
- package/src/modes/interactive/theme/theme-schema.json +308 -0
- package/src/modes/interactive/theme/theme.ts +998 -0
- package/src/modes/print-mode.ts +128 -0
- package/src/modes/rpc/rpc-client.ts +527 -0
- package/src/modes/rpc/rpc-mode.ts +483 -0
- package/src/modes/rpc/rpc-types.ts +203 -0
- package/src/utils/changelog.ts +99 -0
- package/src/utils/clipboard.ts +265 -0
- package/src/utils/fuzzy.ts +108 -0
- package/src/utils/mime.ts +30 -0
- package/src/utils/shell.ts +276 -0
- package/src/utils/tools-manager.ts +274 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,1228 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
## [0.31.1] - 2026-01-02
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Model selector no longer allows negative index when pressing arrow keys before models finish loading ([#398](https://github.com/badlogic/pi-mono/pull/398) by [@mitsuhiko](https://github.com/mitsuhiko))
|
|
10
|
+
- Type guard functions (`isBashToolResult`, etc.) now exported at runtime, not just in type declarations ([#397](https://github.com/badlogic/pi-mono/issues/397))
|
|
11
|
+
|
|
12
|
+
## [0.31.0] - 2026-01-02
|
|
13
|
+
|
|
14
|
+
This release introduces session trees for in-place branching, major API changes to hooks and custom tools, and structured compaction with file tracking.
|
|
15
|
+
|
|
16
|
+
### Session Tree
|
|
17
|
+
|
|
18
|
+
Sessions now use a tree structure with `id`/`parentId` fields. This enables in-place branching: navigate to any previous point with `/tree`, continue from there, and switch between branches while preserving all history in a single file.
|
|
19
|
+
|
|
20
|
+
**Existing sessions are automatically migrated** (v1 → v2) on first load. No manual action required.
|
|
21
|
+
|
|
22
|
+
New entry types: `BranchSummaryEntry` (context from abandoned branches), `CustomEntry` (hook state), `CustomMessageEntry` (hook-injected messages), `LabelEntry` (bookmarks).
|
|
23
|
+
|
|
24
|
+
See [docs/session.md](docs/session.md) for the file format and `SessionManager` API.
|
|
25
|
+
|
|
26
|
+
### Hooks Migration
|
|
27
|
+
|
|
28
|
+
The hooks API has been restructured with more granular events and better session access.
|
|
29
|
+
|
|
30
|
+
**Type renames:**
|
|
31
|
+
|
|
32
|
+
- `HookEventContext` → `HookContext`
|
|
33
|
+
- `HookCommandContext` is now a new interface extending `HookContext` with session control methods
|
|
34
|
+
|
|
35
|
+
**Event changes:**
|
|
36
|
+
|
|
37
|
+
- The monolithic `session` event is now split into granular events: `session_start`, `session_before_switch`, `session_switch`, `session_before_branch`, `session_branch`, `session_before_compact`, `session_compact`, `session_shutdown`
|
|
38
|
+
- `session_before_switch` and `session_switch` events now include `reason: "new" | "resume"` to distinguish between `/new` and `/resume`
|
|
39
|
+
- New `session_before_tree` and `session_tree` events for `/tree` navigation (hook can provide custom branch summary)
|
|
40
|
+
- New `before_agent_start` event: inject messages before the agent loop starts
|
|
41
|
+
- New `context` event: modify messages non-destructively before each LLM call
|
|
42
|
+
- Session entries are no longer passed in events. Use `ctx.sessionManager.getEntries()` or `ctx.sessionManager.getBranch()` instead
|
|
43
|
+
|
|
44
|
+
**API changes:**
|
|
45
|
+
|
|
46
|
+
- `pi.send(text, attachments?)` → `pi.sendMessage(message, triggerTurn?)` (creates `CustomMessageEntry`)
|
|
47
|
+
- New `pi.appendEntry(customType, data?)` for hook state persistence (not in LLM context)
|
|
48
|
+
- New `pi.registerCommand(name, options)` for custom slash commands (handler receives `HookCommandContext`)
|
|
49
|
+
- New `pi.registerMessageRenderer(customType, renderer)` for custom TUI rendering
|
|
50
|
+
- New `ctx.isIdle()`, `ctx.abort()`, `ctx.hasQueuedMessages()` for agent state (available in all events)
|
|
51
|
+
- New `ctx.ui.editor(title, prefill?)` for multi-line text editing with Ctrl+G external editor support
|
|
52
|
+
- New `ctx.ui.custom(component)` for full TUI component rendering with keyboard focus
|
|
53
|
+
- New `ctx.ui.setStatus(key, text)` for persistent status text in footer (multiple hooks can set their own)
|
|
54
|
+
- New `ctx.ui.theme` getter for styling text with theme colors
|
|
55
|
+
- `ctx.exec()` moved to `pi.exec()`
|
|
56
|
+
- `ctx.sessionFile` → `ctx.sessionManager.getSessionFile()`
|
|
57
|
+
- New `ctx.modelRegistry` and `ctx.model` for API key resolution
|
|
58
|
+
|
|
59
|
+
**HookCommandContext (slash commands only):**
|
|
60
|
+
|
|
61
|
+
- `ctx.waitForIdle()` - wait for agent to finish streaming
|
|
62
|
+
- `ctx.newSession(options?)` - create new sessions with optional setup callback
|
|
63
|
+
- `ctx.branch(entryId)` - branch from a specific entry
|
|
64
|
+
- `ctx.navigateTree(targetId, options?)` - navigate the session tree
|
|
65
|
+
|
|
66
|
+
These methods are only on `HookCommandContext` (not `HookContext`) because they can deadlock if called from event handlers that run inside the agent loop.
|
|
67
|
+
|
|
68
|
+
**Removed:**
|
|
69
|
+
|
|
70
|
+
- `hookTimeout` setting (hooks no longer have timeouts; use Ctrl+C to abort)
|
|
71
|
+
- `resolveApiKey` parameter (use `ctx.modelRegistry.getApiKey(model)`)
|
|
72
|
+
|
|
73
|
+
See [docs/hooks.md](docs/hooks.md) and [examples/hooks/](examples/hooks/) for the current API.
|
|
74
|
+
|
|
75
|
+
### Custom Tools Migration
|
|
76
|
+
|
|
77
|
+
The custom tools API has been restructured to mirror the hooks pattern with a context object.
|
|
78
|
+
|
|
79
|
+
**Type renames:**
|
|
80
|
+
|
|
81
|
+
- `CustomAgentTool` → `CustomTool`
|
|
82
|
+
- `ToolAPI` → `CustomToolAPI`
|
|
83
|
+
- `ToolContext` → `CustomToolContext`
|
|
84
|
+
- `ToolSessionEvent` → `CustomToolSessionEvent`
|
|
85
|
+
|
|
86
|
+
**Execute signature changed:**
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
// Before (v0.30.2)
|
|
90
|
+
execute(toolCallId, params, signal, onUpdate)
|
|
91
|
+
|
|
92
|
+
// After
|
|
93
|
+
execute(toolCallId, params, onUpdate, ctx, signal?)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The new `ctx: CustomToolContext` provides `sessionManager`, `modelRegistry`, `model`, and agent state methods:
|
|
97
|
+
|
|
98
|
+
- `ctx.isIdle()` - check if agent is streaming
|
|
99
|
+
- `ctx.hasQueuedMessages()` - check if user has queued messages (skip interactive prompts)
|
|
100
|
+
- `ctx.abort()` - abort current operation (fire-and-forget)
|
|
101
|
+
|
|
102
|
+
**Session event changes:**
|
|
103
|
+
|
|
104
|
+
- `CustomToolSessionEvent` now only has `reason` and `previousSessionFile`
|
|
105
|
+
- Session entries are no longer in the event. Use `ctx.sessionManager.getBranch()` or `ctx.sessionManager.getEntries()` to reconstruct state
|
|
106
|
+
- Reasons: `"start" | "switch" | "branch" | "tree" | "shutdown"` (no separate `"new"` reason; `/new` triggers `"switch"`)
|
|
107
|
+
- `dispose()` method removed. Use `onSession` with `reason: "shutdown"` for cleanup
|
|
108
|
+
|
|
109
|
+
See [docs/custom-tools.md](docs/custom-tools.md) and [examples/custom-tools/](examples/custom-tools/) for the current API.
|
|
110
|
+
|
|
111
|
+
### SDK Migration
|
|
112
|
+
|
|
113
|
+
**Type changes:**
|
|
114
|
+
|
|
115
|
+
- `CustomAgentTool` → `CustomTool`
|
|
116
|
+
- `AppMessage` → `AgentMessage`
|
|
117
|
+
- `sessionFile` returns `string | undefined` (was `string | null`)
|
|
118
|
+
- `model` returns `Model | undefined` (was `Model | null`)
|
|
119
|
+
- `Attachment` type removed. Use `ImageContent` from `@oh-my-pi/pi-ai` instead. Add images directly to message content arrays.
|
|
120
|
+
|
|
121
|
+
**AgentSession API:**
|
|
122
|
+
|
|
123
|
+
- `branch(entryIndex: number)` → `branch(entryId: string)`
|
|
124
|
+
- `getUserMessagesForBranching()` returns `{ entryId, text }` instead of `{ entryIndex, text }`
|
|
125
|
+
- `reset()` → `newSession(options?)` where options has optional `parentSession` for lineage tracking
|
|
126
|
+
- `newSession()` and `switchSession()` now return `Promise<boolean>` (false if cancelled by hook)
|
|
127
|
+
- New `navigateTree(targetId, options?)` for in-place tree navigation
|
|
128
|
+
|
|
129
|
+
**Hook integration:**
|
|
130
|
+
|
|
131
|
+
- New `sendHookMessage(message, triggerTurn?)` for hook message injection
|
|
132
|
+
|
|
133
|
+
**SessionManager API:**
|
|
134
|
+
|
|
135
|
+
- Method renames: `saveXXX()` → `appendXXX()` (e.g., `appendMessage`, `appendCompaction`)
|
|
136
|
+
- `branchInPlace()` → `branch()`
|
|
137
|
+
- `reset()` → `newSession(options?)` with optional `parentSession` for lineage tracking
|
|
138
|
+
- `createBranchedSessionFromEntries(entries, index)` → `createBranchedSession(leafId)`
|
|
139
|
+
- `SessionHeader.branchedFrom` → `SessionHeader.parentSession`
|
|
140
|
+
- `saveCompaction(entry)` → `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?)`
|
|
141
|
+
- `getEntries()` now excludes the session header (use `getHeader()` separately)
|
|
142
|
+
- `getSessionFile()` returns `string | undefined` (undefined for in-memory sessions)
|
|
143
|
+
- New tree methods: `getTree()`, `getBranch()`, `getLeafId()`, `getLeafEntry()`, `getEntry()`, `getChildren()`, `getLabel()`
|
|
144
|
+
- New append methods: `appendCustomEntry()`, `appendCustomMessageEntry()`, `appendLabelChange()`
|
|
145
|
+
- New branch methods: `branch(entryId)`, `branchWithSummary()`
|
|
146
|
+
|
|
147
|
+
**ModelRegistry (new):**
|
|
148
|
+
|
|
149
|
+
`ModelRegistry` is a new class that manages model discovery and API key resolution. It combines built-in models with custom models from `models.json` and resolves API keys via `AuthStorage`.
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { discoverAuthStorage, discoverModels } from "@oh-my-pi/pi-coding-agent";
|
|
153
|
+
|
|
154
|
+
const authStorage = discoverAuthStorage(); // ~/.pi/agent/auth.json
|
|
155
|
+
const modelRegistry = discoverModels(authStorage); // + ~/.pi/agent/models.json
|
|
156
|
+
|
|
157
|
+
// Get all models (built-in + custom)
|
|
158
|
+
const allModels = modelRegistry.getAll();
|
|
159
|
+
|
|
160
|
+
// Get only models with valid API keys
|
|
161
|
+
const available = await modelRegistry.getAvailable();
|
|
162
|
+
|
|
163
|
+
// Find specific model
|
|
164
|
+
const model = modelRegistry.find("anthropic", "claude-sonnet-4-20250514");
|
|
165
|
+
|
|
166
|
+
// Get API key for a model
|
|
167
|
+
const apiKey = await modelRegistry.getApiKey(model);
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This replaces the old `resolveApiKey` callback pattern. Hooks and custom tools access it via `ctx.modelRegistry`.
|
|
171
|
+
|
|
172
|
+
**Renamed exports:**
|
|
173
|
+
|
|
174
|
+
- `messageTransformer` → `convertToLlm`
|
|
175
|
+
- `SessionContext` alias `LoadedSession` removed
|
|
176
|
+
|
|
177
|
+
See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/) for the current API.
|
|
178
|
+
|
|
179
|
+
### RPC Migration
|
|
180
|
+
|
|
181
|
+
**Session commands:**
|
|
182
|
+
|
|
183
|
+
- `reset` command → `new_session` command with optional `parentSession` field
|
|
184
|
+
|
|
185
|
+
**Branching commands:**
|
|
186
|
+
|
|
187
|
+
- `branch` command: `entryIndex` → `entryId`
|
|
188
|
+
- `get_branch_messages` response: `entryIndex` → `entryId`
|
|
189
|
+
|
|
190
|
+
**Type changes:**
|
|
191
|
+
|
|
192
|
+
- Messages are now `AgentMessage` (was `AppMessage`)
|
|
193
|
+
- `prompt` command: `attachments` field replaced with `images` field using `ImageContent` format
|
|
194
|
+
|
|
195
|
+
**Compaction events:**
|
|
196
|
+
|
|
197
|
+
- `auto_compaction_start` now includes `reason` field (`"threshold"` or `"overflow"`)
|
|
198
|
+
- `auto_compaction_end` now includes `willRetry` field
|
|
199
|
+
- `compact` response includes full `CompactionResult` (`summary`, `firstKeptEntryId`, `tokensBefore`, `details`)
|
|
200
|
+
|
|
201
|
+
See [docs/rpc.md](docs/rpc.md) for the current protocol.
|
|
202
|
+
|
|
203
|
+
### Structured Compaction
|
|
204
|
+
|
|
205
|
+
Compaction and branch summarization now use a structured output format:
|
|
206
|
+
|
|
207
|
+
- Clear sections: Goal, Progress, Key Information, File Operations
|
|
208
|
+
- File tracking: `readFiles` and `modifiedFiles` arrays in `details`, accumulated across compactions
|
|
209
|
+
- Conversations are serialized to text before summarization to prevent the model from "continuing" them
|
|
210
|
+
|
|
211
|
+
The `before_compact` and `before_tree` hook events allow custom compaction implementations. See [docs/compaction.md](docs/compaction.md).
|
|
212
|
+
|
|
213
|
+
### Interactive Mode
|
|
214
|
+
|
|
215
|
+
**`/tree` command:**
|
|
216
|
+
|
|
217
|
+
- Navigate the full session tree in-place
|
|
218
|
+
- Search by typing, page with ←/→
|
|
219
|
+
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
|
|
220
|
+
- Press `l` to label entries as bookmarks
|
|
221
|
+
- Selecting a branch switches context and optionally injects a summary of the abandoned branch
|
|
222
|
+
|
|
223
|
+
**Entry labels:**
|
|
224
|
+
|
|
225
|
+
- Bookmark any entry via `/tree` → select → `l`
|
|
226
|
+
- Labels appear in tree view and persist as `LabelEntry`
|
|
227
|
+
|
|
228
|
+
**Theme changes (breaking for custom themes):**
|
|
229
|
+
|
|
230
|
+
Custom themes must add these new color tokens or they will fail to load:
|
|
231
|
+
|
|
232
|
+
- `selectedBg`: background for selected/highlighted items in tree selector and other components
|
|
233
|
+
- `customMessageBg`: background for hook-injected messages (`CustomMessageEntry`)
|
|
234
|
+
- `customMessageText`: text color for hook messages
|
|
235
|
+
- `customMessageLabel`: label color for hook messages (the `[customType]` prefix)
|
|
236
|
+
|
|
237
|
+
Total color count increased from 46 to 50. See [docs/theme.md](docs/theme.md) for the full color list and copy values from the built-in dark/light themes.
|
|
238
|
+
|
|
239
|
+
**Settings:**
|
|
240
|
+
|
|
241
|
+
- `enabledModels`: allowlist models in `settings.json` (same format as `--models` CLI)
|
|
242
|
+
|
|
243
|
+
### Added
|
|
244
|
+
|
|
245
|
+
- `ctx.ui.setStatus(key, text)` for hooks to display persistent status text in the footer ([#385](https://github.com/badlogic/pi-mono/pull/385) by [@prateekmedia](https://github.com/prateekmedia))
|
|
246
|
+
- `ctx.ui.theme` getter for styling status text and other output with theme colors
|
|
247
|
+
- `/share` command to upload session as a secret GitHub gist and get a shareable URL via shittycodingagent.ai ([#380](https://github.com/badlogic/pi-mono/issues/380))
|
|
248
|
+
- HTML export now includes a tree visualization sidebar for navigating session branches ([#375](https://github.com/badlogic/pi-mono/issues/375))
|
|
249
|
+
- HTML export supports keyboard shortcuts: Ctrl+T to toggle thinking blocks, Ctrl+O to toggle tool outputs
|
|
250
|
+
- HTML export supports theme-configurable background colors via optional `export` section in theme JSON ([#387](https://github.com/badlogic/pi-mono/pull/387) by [@mitsuhiko](https://github.com/mitsuhiko))
|
|
251
|
+
- HTML export syntax highlighting now uses theme colors and matches TUI rendering
|
|
252
|
+
- **Snake game example hook**: Demonstrates `ui.custom()`, `registerCommand()`, and session persistence. See [examples/hooks/snake.ts](examples/hooks/snake.ts).
|
|
253
|
+
- **`thinkingText` theme token**: Configurable color for thinking block text. ([#366](https://github.com/badlogic/pi-mono/pull/366) by [@paulbettner](https://github.com/paulbettner))
|
|
254
|
+
|
|
255
|
+
### Changed
|
|
256
|
+
|
|
257
|
+
- **Entry IDs**: Session entries now use short 8-character hex IDs instead of full UUIDs
|
|
258
|
+
- **API key priority**: `ANTHROPIC_OAUTH_TOKEN` now takes precedence over `ANTHROPIC_API_KEY`
|
|
259
|
+
- HTML export template split into separate files (template.html, template.css, template.js) for easier maintenance
|
|
260
|
+
|
|
261
|
+
### Fixed
|
|
262
|
+
|
|
263
|
+
- HTML export now properly sanitizes user messages containing HTML tags like `<style>` that could break DOM rendering
|
|
264
|
+
- Crash when displaying bash output containing Unicode format characters like U+0600-U+0604 ([#372](https://github.com/badlogic/pi-mono/pull/372) by [@HACKE-RC](https://github.com/HACKE-RC))
|
|
265
|
+
- **Footer shows full session stats**: Token usage and cost now include all messages, not just those after compaction. ([#322](https://github.com/badlogic/pi-mono/issues/322))
|
|
266
|
+
- **Status messages spam chat log**: Rapidly changing settings (e.g., thinking level via Shift+Tab) would add multiple status lines. Sequential status updates now coalesce into a single line. ([#365](https://github.com/badlogic/pi-mono/pull/365) by [@paulbettner](https://github.com/paulbettner))
|
|
267
|
+
- **Toggling thinking blocks during streaming shows nothing**: Pressing Ctrl+T while streaming would hide the current message until streaming completed.
|
|
268
|
+
- **Resuming session resets thinking level to off**: Initial model and thinking level were not saved to session file, causing `--resume`/`--continue` to default to `off`. ([#342](https://github.com/badlogic/pi-mono/issues/342) by [@aliou](https://github.com/aliou))
|
|
269
|
+
- **Hook `tool_result` event ignores errors from custom tools**: The `tool_result` hook event was never emitted when tools threw errors, and always had `isError: false` for successful executions. Now emits the event with correct `isError` value in both success and error cases. ([#374](https://github.com/badlogic/pi-mono/issues/374) by [@nicobailon](https://github.com/nicobailon))
|
|
270
|
+
- **Edit tool fails on Windows due to CRLF line endings**: Files with CRLF line endings now match correctly when LLMs send LF-only text. Line endings are normalized before matching and restored to original style on write. ([#355](https://github.com/badlogic/pi-mono/issues/355) by [@Pratham-Dubey](https://github.com/Pratham-Dubey))
|
|
271
|
+
- **Edit tool fails on files with UTF-8 BOM**: Files with UTF-8 BOM marker could cause "text not found" errors since the LLM doesn't include the invisible BOM character. BOM is now stripped before matching and restored on write. ([#394](https://github.com/badlogic/pi-mono/pull/394) by [@prathamdby](https://github.com/prathamdby))
|
|
272
|
+
- **Use bash instead of sh on Unix**: Fixed shell commands using `/bin/sh` instead of `/bin/bash` on Unix systems. ([#328](https://github.com/badlogic/pi-mono/pull/328) by [@dnouri](https://github.com/dnouri))
|
|
273
|
+
- **OAuth login URL clickable**: Made OAuth login URLs clickable in terminal. ([#349](https://github.com/badlogic/pi-mono/pull/349) by [@Cursivez](https://github.com/Cursivez))
|
|
274
|
+
- **Improved error messages**: Better error messages when `apiKey` or `model` are missing. ([#346](https://github.com/badlogic/pi-mono/pull/346) by [@ronyrus](https://github.com/ronyrus))
|
|
275
|
+
- **Session file validation**: `findMostRecentSession()` now validates session headers before returning, preventing non-session JSONL files from being loaded
|
|
276
|
+
- **Compaction error handling**: `generateSummary()` and `generateTurnPrefixSummary()` now throw on LLM errors instead of returning empty strings
|
|
277
|
+
- **Compaction with branched sessions**: Fixed compaction incorrectly including entries from abandoned branches, causing token overflow errors. Compaction now uses `sessionManager.getPath()` to work only on the current branch path, eliminating 80+ lines of duplicate entry collection logic between `prepareCompaction()` and `compact()`
|
|
278
|
+
- **enabledModels glob patterns**: `--models` and `enabledModels` now support glob patterns like `github-copilot/*` or `*sonnet*`. Previously, patterns were only matched literally or via substring search. ([#337](https://github.com/badlogic/pi-mono/issues/337))
|
|
279
|
+
|
|
280
|
+
## [0.30.2] - 2025-12-26
|
|
281
|
+
|
|
282
|
+
### Changed
|
|
283
|
+
|
|
284
|
+
- **Consolidated migrations**: Moved auth migration from `AuthStorage.migrateLegacy()` to new `migrations.ts` module.
|
|
285
|
+
|
|
286
|
+
## [0.30.1] - 2025-12-26
|
|
287
|
+
|
|
288
|
+
### Fixed
|
|
289
|
+
|
|
290
|
+
- **Sessions saved to wrong directory**: In v0.30.0, sessions were being saved to `~/.pi/agent/` instead of `~/.pi/agent/sessions/<encoded-cwd>/`, breaking `--resume` and `/resume`. Misplaced sessions are automatically migrated on startup. ([#320](https://github.com/badlogic/pi-mono/issues/320) by [@aliou](https://github.com/aliou))
|
|
291
|
+
- **Custom system prompts missing context**: When using a custom system prompt string, project context files (AGENTS.md), skills, date/time, and working directory were not appended. ([#321](https://github.com/badlogic/pi-mono/issues/321))
|
|
292
|
+
|
|
293
|
+
## [0.30.0] - 2025-12-25
|
|
294
|
+
|
|
295
|
+
### Breaking Changes
|
|
296
|
+
|
|
297
|
+
- **SessionManager API**: The second parameter of `create()`, `continueRecent()`, and `list()` changed from `agentDir` to `sessionDir`. When provided, it specifies the session directory directly (no cwd encoding). When omitted, uses default (`~/.pi/agent/sessions/<encoded-cwd>/`). `open()` no longer takes `agentDir`. ([#313](https://github.com/badlogic/pi-mono/pull/313))
|
|
298
|
+
|
|
299
|
+
### Added
|
|
300
|
+
|
|
301
|
+
- **`--session-dir` flag**: Use a custom directory for sessions instead of the default `~/.pi/agent/sessions/<encoded-cwd>/`. Works with `-c` (continue) and `-r` (resume) flags. ([#313](https://github.com/badlogic/pi-mono/pull/313) by [@scutifer](https://github.com/scutifer))
|
|
302
|
+
- **Reverse model cycling and model selector**: Shift+Ctrl+P cycles models backward, Ctrl+L opens model selector (retaining text in editor). ([#315](https://github.com/badlogic/pi-mono/pull/315) by [@mitsuhiko](https://github.com/mitsuhiko))
|
|
303
|
+
|
|
304
|
+
## [0.29.1] - 2025-12-25
|
|
305
|
+
|
|
306
|
+
### Added
|
|
307
|
+
|
|
308
|
+
- **Automatic custom system prompt loading**: Pi now auto-loads `SYSTEM.md` files to replace the default system prompt. Project-local `.pi/SYSTEM.md` takes precedence over global `~/.pi/agent/SYSTEM.md`. CLI `--system-prompt` flag overrides both. ([#309](https://github.com/badlogic/pi-mono/issues/309))
|
|
309
|
+
- **Unified `/settings` command**: New settings menu consolidating thinking level, theme, queue mode, auto-compact, show images, hide thinking, and collapse changelog. Replaces individual `/thinking`, `/queue`, `/theme`, `/autocompact`, and `/show-images` commands. ([#310](https://github.com/badlogic/pi-mono/issues/310))
|
|
310
|
+
|
|
311
|
+
### Fixed
|
|
312
|
+
|
|
313
|
+
- **Custom tools/hooks with typebox subpath imports**: Fixed jiti alias for `@sinclair/typebox` to point to package root instead of entry file, allowing imports like `@sinclair/typebox/compiler` to resolve correctly. ([#311](https://github.com/badlogic/pi-mono/issues/311) by [@kim0](https://github.com/kim0))
|
|
314
|
+
|
|
315
|
+
## [0.29.0] - 2025-12-25
|
|
316
|
+
|
|
317
|
+
### Breaking Changes
|
|
318
|
+
|
|
319
|
+
- **Renamed `/clear` to `/new`**: The command to start a fresh session is now `/new`. Hook event reasons `before_clear`/`clear` are now `before_new`/`new`. Merry Christmas [@mitsuhiko](https://github.com/mitsuhiko)! ([#305](https://github.com/badlogic/pi-mono/pull/305))
|
|
320
|
+
|
|
321
|
+
### Added
|
|
322
|
+
|
|
323
|
+
- **Auto-space before pasted file paths**: When pasting a file path (starting with `/`, `~`, or `.`) after a word character, a space is automatically prepended. ([#307](https://github.com/badlogic/pi-mono/pull/307) by [@mitsuhiko](https://github.com/mitsuhiko))
|
|
324
|
+
- **Word navigation in input fields**: Added Ctrl+Left/Right and Alt+Left/Right for word-by-word cursor movement. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
|
|
325
|
+
- **Full Unicode input**: Input fields now accept Unicode characters beyond ASCII. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
|
|
326
|
+
|
|
327
|
+
### Fixed
|
|
328
|
+
|
|
329
|
+
- **Readline-style Ctrl+W**: Now skips trailing whitespace before deleting the preceding word, matching standard readline behavior. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
|
|
330
|
+
|
|
331
|
+
## [0.28.0] - 2025-12-25
|
|
332
|
+
|
|
333
|
+
### Changed
|
|
334
|
+
|
|
335
|
+
- **Credential storage refactored**: API keys and OAuth tokens are now stored in `~/.pi/agent/auth.json` instead of `oauth.json` and `settings.json`. Existing credentials are automatically migrated on first run. ([#296](https://github.com/badlogic/pi-mono/issues/296))
|
|
336
|
+
|
|
337
|
+
- **SDK API changes** ([#296](https://github.com/badlogic/pi-mono/issues/296)):
|
|
338
|
+
|
|
339
|
+
- Added `AuthStorage` class for credential management (API keys and OAuth tokens)
|
|
340
|
+
- Added `ModelRegistry` class for model discovery and API key resolution
|
|
341
|
+
- Added `discoverAuthStorage()` and `discoverModels()` discovery functions
|
|
342
|
+
- `createAgentSession()` now accepts `authStorage` and `modelRegistry` options
|
|
343
|
+
- Removed `configureOAuthStorage()`, `defaultGetApiKey()`, `findModel()`, `discoverAvailableModels()`
|
|
344
|
+
- Removed `getApiKey` callback option (use `AuthStorage.setRuntimeApiKey()` for runtime overrides)
|
|
345
|
+
- Use `getModel()` from `@oh-my-pi/pi-ai` for built-in models, `modelRegistry.find()` for custom models + built-in models
|
|
346
|
+
- See updated [SDK documentation](docs/sdk.md) and [README](README.md)
|
|
347
|
+
|
|
348
|
+
- **Settings changes**: Removed `apiKeys` from `settings.json`. Use `auth.json` instead. ([#296](https://github.com/badlogic/pi-mono/issues/296))
|
|
349
|
+
|
|
350
|
+
### Fixed
|
|
351
|
+
|
|
352
|
+
- **Duplicate skill warnings for symlinks**: Skills loaded via symlinks pointing to the same file are now silently deduplicated instead of showing name collision warnings. ([#304](https://github.com/badlogic/pi-mono/pull/304) by [@mitsuhiko](https://github.com/mitsuhiko))
|
|
353
|
+
|
|
354
|
+
## [0.27.9] - 2025-12-24
|
|
355
|
+
|
|
356
|
+
### Fixed
|
|
357
|
+
|
|
358
|
+
- **Model selector and --list-models with settings.json API keys**: Models with API keys configured in settings.json (but not in environment variables) now properly appear in the /model selector and `--list-models` output. ([#295](https://github.com/badlogic/pi-mono/issues/295))
|
|
359
|
+
|
|
360
|
+
## [0.27.8] - 2025-12-24
|
|
361
|
+
|
|
362
|
+
### Fixed
|
|
363
|
+
|
|
364
|
+
- **API key priority**: OAuth tokens now take priority over settings.json API keys. Previously, an API key in settings.json would trump OAuth, causing users logged in with a plan (unlimited tokens) to be billed via PAYG instead.
|
|
365
|
+
|
|
366
|
+
## [0.27.7] - 2025-12-24
|
|
367
|
+
|
|
368
|
+
### Fixed
|
|
369
|
+
|
|
370
|
+
- **Thinking tag leakage**: Fixed Claude mimicking literal `</thinking>` tags in responses. Unsigned thinking blocks (from aborted streams) are now converted to plain text without `<thinking>` tags. The TUI still displays them as thinking blocks. ([#302](https://github.com/badlogic/pi-mono/pull/302) by [@nicobailon](https://github.com/nicobailon))
|
|
371
|
+
|
|
372
|
+
## [0.27.6] - 2025-12-24
|
|
373
|
+
|
|
374
|
+
### Added
|
|
375
|
+
|
|
376
|
+
- **Compaction hook improvements**: The `before_compact` session event now includes:
|
|
377
|
+
|
|
378
|
+
- `previousSummary`: Summary from the last compaction (if any), so hooks can preserve accumulated context
|
|
379
|
+
- `messagesToKeep`: Messages that will be kept after the summary (recent turns), in addition to `messagesToSummarize`
|
|
380
|
+
- `resolveApiKey`: Function to resolve API keys for any model (checks settings, OAuth, env vars)
|
|
381
|
+
- Removed `apiKey` string in favor of `resolveApiKey` for more flexibility
|
|
382
|
+
|
|
383
|
+
- **SessionManager API cleanup**:
|
|
384
|
+
- Renamed `loadSessionFromEntries()` to `buildSessionContext()` (builds LLM context from entries, handling compaction)
|
|
385
|
+
- Renamed `loadEntries()` to `getEntries()` (returns defensive copy of all session entries)
|
|
386
|
+
- Added `buildSessionContext()` method to SessionManager
|
|
387
|
+
|
|
388
|
+
## [0.27.5] - 2025-12-24
|
|
389
|
+
|
|
390
|
+
### Added
|
|
391
|
+
|
|
392
|
+
- **HTML export syntax highlighting**: Code blocks in markdown and tool outputs (read, write) now have syntax highlighting using highlight.js with theme-aware colors matching the TUI.
|
|
393
|
+
- **HTML export improvements**: Render markdown server-side using marked (tables, headings, code blocks, etc.), honor user's chosen theme (light/dark), add image rendering for user messages, and style code blocks with TUI-like language markers. ([@scutifer](https://github.com/scutifer))
|
|
394
|
+
|
|
395
|
+
### Fixed
|
|
396
|
+
|
|
397
|
+
- **Ghostty inline images in tmux**: Fixed terminal detection for Ghostty when running inside tmux by checking `GHOSTTY_RESOURCES_DIR` env var. ([#299](https://github.com/badlogic/pi-mono/pull/299) by [@nicobailon](https://github.com/nicobailon))
|
|
398
|
+
|
|
399
|
+
## [0.27.4] - 2025-12-24
|
|
400
|
+
|
|
401
|
+
### Fixed
|
|
402
|
+
|
|
403
|
+
- **Symlinked skill directories**: Skills in symlinked directories (e.g., `~/.pi/agent/skills/my-skills -> /path/to/skills`) are now correctly discovered and loaded.
|
|
404
|
+
|
|
405
|
+
## [0.27.3] - 2025-12-24
|
|
406
|
+
|
|
407
|
+
### Added
|
|
408
|
+
|
|
409
|
+
- **API keys in settings.json**: Store API keys in `~/.pi/agent/settings.json` under the `apiKeys` field (e.g., `{ "apiKeys": { "anthropic": "sk-..." } }`). Settings keys take priority over environment variables. ([#295](https://github.com/badlogic/pi-mono/issues/295))
|
|
410
|
+
|
|
411
|
+
### Fixed
|
|
412
|
+
|
|
413
|
+
- **Allow startup without API keys**: Interactive mode no longer throws when no API keys are configured. Users can now start the agent and use `/login` to authenticate. ([#288](https://github.com/badlogic/pi-mono/issues/288))
|
|
414
|
+
- **`--system-prompt` file path support**: The `--system-prompt` argument now correctly resolves file paths (like `--append-system-prompt` already did). ([#287](https://github.com/badlogic/pi-mono/pull/287) by [@scutifer](https://github.com/scutifer))
|
|
415
|
+
|
|
416
|
+
## [0.27.2] - 2025-12-23
|
|
417
|
+
|
|
418
|
+
### Added
|
|
419
|
+
|
|
420
|
+
- **Skip conversation restore on branch**: Hooks can return `{ skipConversationRestore: true }` from `before_branch` to create the branched session file without restoring conversation messages. Useful for checkpoint hooks that restore files separately. ([#286](https://github.com/badlogic/pi-mono/pull/286) by [@nicobarray](https://github.com/nicobarray))
|
|
421
|
+
|
|
422
|
+
## [0.27.1] - 2025-12-22
|
|
423
|
+
|
|
424
|
+
### Fixed
|
|
425
|
+
|
|
426
|
+
- **Skill discovery performance**: Skip `node_modules` directories when recursively scanning for skills. Fixes ~60ms startup delay when skill directories contain npm dependencies.
|
|
427
|
+
|
|
428
|
+
### Added
|
|
429
|
+
|
|
430
|
+
- **Startup timing instrumentation**: Set `PI_TIMING=1` to see startup performance breakdown (interactive mode only).
|
|
431
|
+
|
|
432
|
+
## [0.27.0] - 2025-12-22
|
|
433
|
+
|
|
434
|
+
### Breaking
|
|
435
|
+
|
|
436
|
+
- **Session hooks API redesign**: Merged `branch` event into `session` event. `BranchEvent`, `BranchEventResult` types and `pi.on("branch", ...)` removed. Use `pi.on("session", ...)` with `reason: "before_branch" | "branch"` instead. `AgentSession.branch()` returns `{ cancelled }` instead of `{ skipped }`. `AgentSession.reset()` and `switchSession()` now return `boolean` (false if cancelled by hook). RPC commands `reset`, `switch_session`, and `branch` now include `cancelled` in response data. ([#278](https://github.com/badlogic/pi-mono/issues/278))
|
|
437
|
+
|
|
438
|
+
### Added
|
|
439
|
+
|
|
440
|
+
- **Session lifecycle hooks**: Added `before_*` variants (`before_switch`, `before_clear`, `before_branch`) that fire before actions and can be cancelled with `{ cancel: true }`. Added `shutdown` reason for graceful exit handling. ([#278](https://github.com/badlogic/pi-mono/issues/278))
|
|
441
|
+
|
|
442
|
+
### Fixed
|
|
443
|
+
|
|
444
|
+
- **File tab completion display**: File paths no longer get cut off early. Folders now show trailing `/` and removed redundant "directory"/"file" labels to maximize horizontal space. ([#280](https://github.com/badlogic/pi-mono/issues/280))
|
|
445
|
+
|
|
446
|
+
- **Bash tool visual line truncation**: Fixed bash tool output in collapsed mode to use visual line counting (accounting for line wrapping) instead of logical line counting. Now consistent with bash-execution.ts behavior. Extracted shared `truncateToVisualLines` utility. ([#275](https://github.com/badlogic/pi-mono/issues/275))
|
|
447
|
+
|
|
448
|
+
## [0.26.1] - 2025-12-22
|
|
449
|
+
|
|
450
|
+
### Fixed
|
|
451
|
+
|
|
452
|
+
- **SDK tools respect cwd**: Core tools (bash, read, edit, write, grep, find, ls) now properly use the `cwd` option from `createAgentSession()`. Added tool factory functions (`createBashTool`, `createReadTool`, etc.) for SDK users who specify custom `cwd` with explicit tools. ([#279](https://github.com/badlogic/pi-mono/issues/279))
|
|
453
|
+
|
|
454
|
+
## [0.26.0] - 2025-12-22
|
|
455
|
+
|
|
456
|
+
### Added
|
|
457
|
+
|
|
458
|
+
- **SDK for programmatic usage**: New `createAgentSession()` factory with full control over model, tools, hooks, skills, session persistence, and settings. Philosophy: "omit to discover, provide to override". Includes 12 examples and comprehensive documentation. ([#272](https://github.com/badlogic/pi-mono/issues/272))
|
|
459
|
+
|
|
460
|
+
- **Project-specific settings**: Settings now load from both `~/.pi/agent/settings.json` (global) and `<cwd>/.pi/settings.json` (project). Project settings override global with deep merge for nested objects. Project settings are read-only (for version control). ([#276](https://github.com/badlogic/pi-mono/pull/276))
|
|
461
|
+
|
|
462
|
+
- **SettingsManager static factories**: `SettingsManager.create(cwd?, agentDir?)` for file-based settings, `SettingsManager.inMemory(settings?)` for testing. Added `applyOverrides()` for programmatic overrides.
|
|
463
|
+
|
|
464
|
+
- **SessionManager static factories**: `SessionManager.create()`, `SessionManager.open()`, `SessionManager.continueRecent()`, `SessionManager.inMemory()`, `SessionManager.list()` for flexible session management.
|
|
465
|
+
|
|
466
|
+
## [0.25.4] - 2025-12-22
|
|
467
|
+
|
|
468
|
+
### Fixed
|
|
469
|
+
|
|
470
|
+
- **Syntax highlighting stderr spam**: Fixed cli-highlight logging errors to stderr when markdown contains malformed code fences (e.g., missing newlines around closing backticks). Now validates language identifiers before highlighting and falls back silently to plain text. ([#274](https://github.com/badlogic/pi-mono/issues/274))
|
|
471
|
+
|
|
472
|
+
## [0.25.3] - 2025-12-21
|
|
473
|
+
|
|
474
|
+
### Added
|
|
475
|
+
|
|
476
|
+
- **Gemini 3 preview models**: Added `gemini-3-pro-preview` and `gemini-3-flash-preview` to the google-gemini-cli provider. ([#264](https://github.com/badlogic/pi-mono/pull/264) by [@LukeFost](https://github.com/LukeFost))
|
|
477
|
+
|
|
478
|
+
- **External editor support**: Press `Ctrl+G` to edit your message in an external editor. Uses `$VISUAL` or `$EDITOR` environment variable. On successful save, the message is replaced; on cancel, the original is kept. ([#266](https://github.com/badlogic/pi-mono/pull/266) by [@aliou](https://github.com/aliou))
|
|
479
|
+
|
|
480
|
+
- **Process suspension**: Press `Ctrl+Z` to suspend pi and return to the shell. Resume with `fg` as usual. ([#267](https://github.com/badlogic/pi-mono/pull/267) by [@aliou](https://github.com/aliou))
|
|
481
|
+
|
|
482
|
+
- **Configurable skills directories**: Added granular control over skill sources with `enableCodexUser`, `enableClaudeUser`, `enableClaudeProject`, `enablePiUser`, `enablePiProject` toggles, plus `customDirectories` and `ignoredSkills` settings. ([#269](https://github.com/badlogic/pi-mono/pull/269) by [@nicobailon](https://github.com/nicobailon))
|
|
483
|
+
|
|
484
|
+
- **Skills CLI filtering**: Added `--skills <patterns>` flag for filtering skills with glob patterns. Also added `includeSkills` setting and glob pattern support for `ignoredSkills`. ([#268](https://github.com/badlogic/pi-mono/issues/268))
|
|
485
|
+
|
|
486
|
+
## [0.25.2] - 2025-12-21
|
|
487
|
+
|
|
488
|
+
### Fixed
|
|
489
|
+
|
|
490
|
+
- **Image shifting in tool output**: Fixed an issue where images in tool output would shift down (due to accumulating spacers) each time the tool output was expanded or collapsed via Ctrl+O.
|
|
491
|
+
|
|
492
|
+
## [0.25.1] - 2025-12-21
|
|
493
|
+
|
|
494
|
+
### Fixed
|
|
495
|
+
|
|
496
|
+
- **Gemini image reading broken**: Fixed the `read` tool returning images causing flaky/broken responses with Gemini models. Images in tool results are now properly formatted per the Gemini API spec.
|
|
497
|
+
|
|
498
|
+
- **Tab completion for absolute paths**: Fixed tab completion producing `//tmp` instead of `/tmp/`. Also fixed symlinks to directories (like `/tmp`) not getting a trailing slash, which prevented continuing to tab through subdirectories.
|
|
499
|
+
|
|
500
|
+
## [0.25.0] - 2025-12-20
|
|
501
|
+
|
|
502
|
+
### Added
|
|
503
|
+
|
|
504
|
+
- **Interruptible tool execution**: Queuing a message while tools are executing now interrupts the current tool batch. Remaining tools are skipped with an error result, and your queued message is processed immediately. Useful for redirecting the agent mid-task. ([#259](https://github.com/badlogic/pi-mono/pull/259) by [@steipete](https://github.com/steipete))
|
|
505
|
+
|
|
506
|
+
- **Google Gemini CLI OAuth provider**: Access Gemini 2.0/2.5 models for free via Google Cloud Code Assist. Login with `/login` and select "Google Gemini CLI". Uses your Google account with rate limits.
|
|
507
|
+
|
|
508
|
+
- **Google Antigravity OAuth provider**: Access Gemini 3, Claude (sonnet/opus thinking models), and GPT-OSS models for free via Google's Antigravity sandbox. Login with `/login` and select "Antigravity". Uses your Google account with rate limits.
|
|
509
|
+
|
|
510
|
+
### Changed
|
|
511
|
+
|
|
512
|
+
- **Model selector respects --models scope**: The `/model` command now only shows models specified via `--models` flag when that flag is used, instead of showing all available models. This prevents accidentally selecting models from unintended providers. ([#255](https://github.com/badlogic/pi-mono/issues/255))
|
|
513
|
+
|
|
514
|
+
### Fixed
|
|
515
|
+
|
|
516
|
+
- **Connection errors not retried**: Added "connection error" to the list of retryable errors so Anthropic connection drops trigger auto-retry instead of silently failing. ([#252](https://github.com/badlogic/pi-mono/issues/252))
|
|
517
|
+
|
|
518
|
+
- **Thinking level not clamped on model switch**: Fixed TUI showing xhigh thinking level after switching to a model that doesn't support it. Thinking level is now automatically clamped to model capabilities. ([#253](https://github.com/badlogic/pi-mono/issues/253))
|
|
519
|
+
|
|
520
|
+
- **Cross-model thinking handoff**: Fixed error when switching between models with different thinking signature formats (e.g., GPT-OSS to Claude thinking models via Antigravity). Thinking blocks without signatures are now converted to text with `<thinking>` delimiters.
|
|
521
|
+
|
|
522
|
+
## [0.24.5] - 2025-12-20
|
|
523
|
+
|
|
524
|
+
### Fixed
|
|
525
|
+
|
|
526
|
+
- **Input buffering in iTerm2**: Fixed Ctrl+C, Ctrl+D, and other keys requiring multiple presses in iTerm2. The cell size query response parser was incorrectly holding back keyboard input.
|
|
527
|
+
|
|
528
|
+
## [0.24.4] - 2025-12-20
|
|
529
|
+
|
|
530
|
+
### Fixed
|
|
531
|
+
|
|
532
|
+
- **Arrow keys and Enter in selector components**: Fixed arrow keys and Enter not working in model selector, session selector, OAuth selector, and other selector components when Caps Lock or Num Lock is enabled. ([#243](https://github.com/badlogic/pi-mono/issues/243))
|
|
533
|
+
|
|
534
|
+
## [0.24.3] - 2025-12-19
|
|
535
|
+
|
|
536
|
+
### Fixed
|
|
537
|
+
|
|
538
|
+
- **Footer overflow on narrow terminals**: Fixed footer path display exceeding terminal width when resizing to very narrow widths, causing rendering crashes. /arminsayshi
|
|
539
|
+
|
|
540
|
+
## [0.24.2] - 2025-12-20
|
|
541
|
+
|
|
542
|
+
### Fixed
|
|
543
|
+
|
|
544
|
+
- **More Kitty keyboard protocol fixes**: Fixed Backspace, Enter, Home, End, and Delete keys not working with Caps Lock enabled. The initial fix in 0.24.1 missed several key handlers that were still using raw byte detection. Now all key handlers use the helper functions that properly mask out lock key bits. ([#243](https://github.com/badlogic/pi-mono/issues/243))
|
|
545
|
+
|
|
546
|
+
## [0.24.1] - 2025-12-19
|
|
547
|
+
|
|
548
|
+
### Added
|
|
549
|
+
|
|
550
|
+
- **OAuth and model config exports**: Scripts using `AgentSession` directly can now import `getAvailableModels`, `getApiKeyForModel`, `findModel`, `login`, `logout`, and `getOAuthProviders` from `@oh-my-pi/pi-coding-agent` to reuse OAuth token storage and model resolution. ([#245](https://github.com/badlogic/pi-mono/issues/245))
|
|
551
|
+
|
|
552
|
+
- **xhigh thinking level for gpt-5.2 models**: The thinking level selector and shift+tab cycling now show xhigh option for gpt-5.2 and gpt-5.2-codex models (in addition to gpt-5.1-codex-max). ([#236](https://github.com/badlogic/pi-mono/pull/236) by [@theBucky](https://github.com/theBucky))
|
|
553
|
+
|
|
554
|
+
### Fixed
|
|
555
|
+
|
|
556
|
+
- **Hooks wrap custom tools**: Custom tools are now executed through the hook wrapper, so `tool_call`/`tool_result` hooks can observe, block, and modify custom tool executions (consistent with hook type docs). ([#248](https://github.com/badlogic/pi-mono/pull/248) by [@nicobailon](https://github.com/nicobailon))
|
|
557
|
+
|
|
558
|
+
- **Hook onUpdate callback forwarding**: The `onUpdate` callback is now correctly forwarded through the hook wrapper, fixing custom tool progress updates. ([#238](https://github.com/badlogic/pi-mono/pull/238) by [@nicobailon](https://github.com/nicobailon))
|
|
559
|
+
|
|
560
|
+
- **Terminal cleanup on Ctrl+C in session selector**: Fixed terminal not being properly restored when pressing Ctrl+C in the session selector. ([#247](https://github.com/badlogic/pi-mono/pull/247) by [@aliou](https://github.com/aliou))
|
|
561
|
+
|
|
562
|
+
- **OpenRouter models with colons in IDs**: Fixed parsing of OpenRouter model IDs that contain colons (e.g., `openrouter:meta-llama/llama-4-scout:free`). ([#242](https://github.com/badlogic/pi-mono/pull/242) by [@aliou](https://github.com/aliou))
|
|
563
|
+
|
|
564
|
+
- **Global AGENTS.md loaded twice**: Fixed global AGENTS.md being loaded twice when present in both `~/.pi/agent/` and the current directory. ([#239](https://github.com/badlogic/pi-mono/pull/239) by [@aliou](https://github.com/aliou))
|
|
565
|
+
|
|
566
|
+
- **Kitty keyboard protocol on Linux**: Fixed keyboard input not working in Ghostty on Linux when Num Lock is enabled. The Kitty protocol includes Caps Lock and Num Lock state in modifier values, which broke key detection. Now correctly masks out lock key bits when matching keyboard shortcuts. ([#243](https://github.com/badlogic/pi-mono/issues/243))
|
|
567
|
+
|
|
568
|
+
- **Emoji deletion and cursor movement**: Backspace, Delete, and arrow keys now correctly handle multi-codepoint characters like emojis. Previously, deleting an emoji would leave partial bytes, corrupting the editor state. ([#240](https://github.com/badlogic/pi-mono/issues/240))
|
|
569
|
+
|
|
570
|
+
## [0.24.0] - 2025-12-19
|
|
571
|
+
|
|
572
|
+
### Added
|
|
573
|
+
|
|
574
|
+
- **Subagent orchestration example**: Added comprehensive custom tool example for spawning and orchestrating sub-agents with isolated context windows. Includes scout/planner/reviewer/worker agents and workflow commands for multi-agent pipelines. ([#215](https://github.com/badlogic/pi-mono/pull/215) by [@nicobailon](https://github.com/nicobailon))
|
|
575
|
+
|
|
576
|
+
- **`getMarkdownTheme()` export**: Custom tools can now import `getMarkdownTheme()` from `@oh-my-pi/pi-coding-agent` to use the same markdown styling as the main UI.
|
|
577
|
+
|
|
578
|
+
- **`pi.exec()` signal and timeout support**: Custom tools and hooks can now pass `{ signal, timeout }` options to `pi.exec()` for cancellation and timeout handling. The result includes a `killed` flag when the process was terminated.
|
|
579
|
+
|
|
580
|
+
- **Kitty keyboard protocol support**: Shift+Enter, Alt+Enter, Shift+Tab, Ctrl+D, and all Ctrl+key combinations now work in Ghostty, Kitty, WezTerm, and other modern terminals. ([#225](https://github.com/badlogic/pi-mono/pull/225) by [@kim0](https://github.com/kim0))
|
|
581
|
+
|
|
582
|
+
- **Dynamic API key refresh**: OAuth tokens (GitHub Copilot, Anthropic OAuth) are now refreshed before each LLM call, preventing failures in long-running agent loops where tokens expire mid-session. ([#223](https://github.com/badlogic/pi-mono/pull/223) by [@kim0](https://github.com/kim0))
|
|
583
|
+
|
|
584
|
+
- **`/hotkeys` command**: Shows all keyboard shortcuts in a formatted table.
|
|
585
|
+
|
|
586
|
+
- **Markdown table borders**: Tables now render with proper top and bottom borders.
|
|
587
|
+
|
|
588
|
+
### Changed
|
|
589
|
+
|
|
590
|
+
- **Subagent example improvements**: Parallel mode now streams updates from all tasks. Chain mode shows all completed steps during streaming. Expanded view uses proper markdown rendering with syntax highlighting. Usage footer shows turn count.
|
|
591
|
+
|
|
592
|
+
- **Skills standard compliance**: Skills now adhere to the [Agent Skills standard](https://agentskills.io/specification). Validates name (must match parent directory, lowercase, max 64 chars), description (required, max 1024 chars), and frontmatter fields. Warns on violations but remains lenient. Prompt format changed to XML structure. Removed `{baseDir}` placeholder in favor of relative paths. ([#231](https://github.com/badlogic/pi-mono/issues/231))
|
|
593
|
+
|
|
594
|
+
### Fixed
|
|
595
|
+
|
|
596
|
+
- **JSON mode stdout flush**: Fixed race condition where `pi --mode json` could exit before all output was written to stdout, causing consumers to miss final events.
|
|
597
|
+
|
|
598
|
+
- **Symlinked tools, hooks, and slash commands**: Discovery now correctly follows symlinks when scanning for custom tools, hooks, and slash commands. ([#219](https://github.com/badlogic/pi-mono/pull/219), [#232](https://github.com/badlogic/pi-mono/pull/232) by [@aliou](https://github.com/aliou))
|
|
599
|
+
|
|
600
|
+
### Breaking Changes
|
|
601
|
+
|
|
602
|
+
- **Custom tools now require `index.ts` entry point**: Auto-discovered custom tools must be in a subdirectory with an `index.ts` file. The old pattern `~/.pi/agent/tools/mytool.ts` must become `~/.pi/agent/tools/mytool/index.ts`. This allows multi-file tools to import helper modules. Explicit paths via `--tool` or `settings.json` still work with any `.ts` file.
|
|
603
|
+
|
|
604
|
+
- **Hook `tool_result` event restructured**: The `ToolResultEvent` now exposes full tool result data instead of just text. ([#233](https://github.com/badlogic/pi-mono/pull/233))
|
|
605
|
+
- Removed: `result: string` field
|
|
606
|
+
- Added: `content: (TextContent | ImageContent)[]` - full content array
|
|
607
|
+
- Added: `details: unknown` - tool-specific details (typed per tool via discriminated union on `toolName`)
|
|
608
|
+
- `ToolResultEventResult.result` renamed to `ToolResultEventResult.text` (removed), use `content` instead
|
|
609
|
+
- Hook handlers returning `{ result: "..." }` must change to `{ content: [{ type: "text", text: "..." }] }`
|
|
610
|
+
- Built-in tool details types exported: `BashToolDetails`, `ReadToolDetails`, `GrepToolDetails`, `FindToolDetails`, `LsToolDetails`, `TruncationResult`
|
|
611
|
+
- Type guards exported for narrowing: `isBashToolResult`, `isReadToolResult`, `isEditToolResult`, `isWriteToolResult`, `isGrepToolResult`, `isFindToolResult`, `isLsToolResult`
|
|
612
|
+
|
|
613
|
+
## [0.23.4] - 2025-12-18
|
|
614
|
+
|
|
615
|
+
### Added
|
|
616
|
+
|
|
617
|
+
- **Syntax highlighting**: Added syntax highlighting for markdown code blocks, read tool output, and write tool content. Uses cli-highlight with theme-aware color mapping and VS Code-style syntax colors. ([#214](https://github.com/badlogic/pi-mono/pull/214) by [@svkozak](https://github.com/svkozak))
|
|
618
|
+
|
|
619
|
+
- **Intra-line diff highlighting**: Edit tool now shows word-level changes with inverse highlighting when a single line is modified. Multi-line changes show all removed lines first, then all added lines.
|
|
620
|
+
|
|
621
|
+
### Fixed
|
|
622
|
+
|
|
623
|
+
- **Gemini tool result format**: Fixed tool result format for Gemini 3 Flash Preview which strictly requires `{ output: value }` for success and `{ error: value }` for errors. Previous format using `{ result, isError }` was rejected by newer Gemini models. ([#213](https://github.com/badlogic/pi-mono/issues/213), [#220](https://github.com/badlogic/pi-mono/pull/220))
|
|
624
|
+
|
|
625
|
+
- **Google baseUrl configuration**: Google provider now respects `baseUrl` configuration for custom endpoints or API proxies. ([#216](https://github.com/badlogic/pi-mono/issues/216), [#221](https://github.com/badlogic/pi-mono/pull/221) by [@theBucky](https://github.com/theBucky))
|
|
626
|
+
|
|
627
|
+
- **Google provider FinishReason**: Added handling for new `IMAGE_RECITATION` and `IMAGE_OTHER` finish reasons. Upgraded @google/genai to 1.34.0.
|
|
628
|
+
|
|
629
|
+
## [0.23.3] - 2025-12-17
|
|
630
|
+
|
|
631
|
+
### Fixed
|
|
632
|
+
|
|
633
|
+
- Check for compaction before submitting user prompt, not just after agent turn ends. This catches cases where user aborts mid-response and context is already near the limit.
|
|
634
|
+
|
|
635
|
+
### Changed
|
|
636
|
+
|
|
637
|
+
- Improved system prompt documentation section with clearer pointers to specific doc files for custom models, themes, skills, hooks, custom tools, and RPC.
|
|
638
|
+
|
|
639
|
+
- Cleaned up documentation:
|
|
640
|
+
|
|
641
|
+
- `theme.md`: Added missing color tokens (`thinkingXhigh`, `bashMode`)
|
|
642
|
+
- `skills.md`: Rewrote with better framing and examples
|
|
643
|
+
- `hooks.md`: Fixed timeout/error handling docs, added import aliases section
|
|
644
|
+
- `custom-tools.md`: Added intro with use cases and comparison table
|
|
645
|
+
- `rpc.md`: Added missing `hook_error` event documentation
|
|
646
|
+
- `README.md`: Complete settings table, condensed philosophy section, standardized OAuth docs
|
|
647
|
+
|
|
648
|
+
- Hooks loader now supports same import aliases as custom tools (`@sinclair/typebox`, `@oh-my-pi/pi-ai`, `@oh-my-pi/pi-tui`, `@oh-my-pi/pi-coding-agent`).
|
|
649
|
+
|
|
650
|
+
### Breaking Changes
|
|
651
|
+
|
|
652
|
+
- **Hooks**: `turn_end` event's `toolResults` type changed from `AppMessage[]` to `ToolResultMessage[]`. If you have hooks that handle `turn_end` events and explicitly type the results, update your type annotations.
|
|
653
|
+
|
|
654
|
+
## [0.23.2] - 2025-12-17
|
|
655
|
+
|
|
656
|
+
### Fixed
|
|
657
|
+
|
|
658
|
+
- Fixed Claude models via GitHub Copilot re-answering all previous prompts in multi-turn conversations. The issue was that assistant message content was sent as an array instead of a string, which Copilot's Claude adapter misinterpreted. Also added missing `Openai-Intent: conversation-edits` header and fixed `X-Initiator` logic to check for any assistant/tool message in history. ([#209](https://github.com/badlogic/pi-mono/issues/209))
|
|
659
|
+
|
|
660
|
+
- Detect image MIME type via file magic (read tool and `@file` attachments), not filename extension.
|
|
661
|
+
|
|
662
|
+
- Fixed markdown tables overflowing terminal width. Tables now wrap cell contents to fit available width instead of breaking borders mid-row. ([#206](https://github.com/badlogic/pi-mono/pull/206) by [@kim0](https://github.com/kim0))
|
|
663
|
+
|
|
664
|
+
## [0.23.1] - 2025-12-17
|
|
665
|
+
|
|
666
|
+
### Fixed
|
|
667
|
+
|
|
668
|
+
- Fixed TUI performance regression caused by Box component lacking render caching. Built-in tools now use Text directly (like v0.22.5), and Box has proper caching for custom tool rendering.
|
|
669
|
+
|
|
670
|
+
- Fixed custom tools failing to load from `~/.pi/agent/tools/` when pi is installed globally. Module imports (`@sinclair/typebox`, `@oh-my-pi/pi-tui`, `@oh-my-pi/pi-ai`) are now resolved via aliases.
|
|
671
|
+
|
|
672
|
+
## [0.23.0] - 2025-12-17
|
|
673
|
+
|
|
674
|
+
### Added
|
|
675
|
+
|
|
676
|
+
- **Custom tools**: Extend pi with custom tools written in TypeScript. Tools can provide custom TUI rendering, interact with users via `pi.ui` (select, confirm, input, notify), and maintain state across sessions via `onSession` callback. See [docs/custom-tools.md](docs/custom-tools.md) and [examples/custom-tools/](examples/custom-tools/). ([#190](https://github.com/badlogic/pi-mono/issues/190))
|
|
677
|
+
|
|
678
|
+
- **Hook and tool examples**: Added `examples/hooks/` and `examples/custom-tools/` with working examples. Examples are now bundled in npm and binary releases.
|
|
679
|
+
|
|
680
|
+
### Breaking Changes
|
|
681
|
+
|
|
682
|
+
- **Hooks**: Replaced `session_start` and `session_switch` events with unified `session` event. Use `event.reason` (`"start" | "switch" | "clear"`) to distinguish. Event now includes `entries` array for state reconstruction.
|
|
683
|
+
|
|
684
|
+
## [0.22.5] - 2025-12-17
|
|
685
|
+
|
|
686
|
+
### Fixed
|
|
687
|
+
|
|
688
|
+
- Fixed `--session` flag not saving sessions in print mode (`-p`). The session manager was never receiving events because no subscriber was attached.
|
|
689
|
+
|
|
690
|
+
## [0.22.4] - 2025-12-17
|
|
691
|
+
|
|
692
|
+
### Added
|
|
693
|
+
|
|
694
|
+
- `--list-models [search]` CLI flag to list available models with optional fuzzy search. Shows provider, model ID, context window, max output, thinking support, and image support. Only lists models with configured API keys. ([#203](https://github.com/badlogic/pi-mono/issues/203))
|
|
695
|
+
|
|
696
|
+
### Fixed
|
|
697
|
+
|
|
698
|
+
- Fixed tool execution showing green (success) background while still running. Now correctly shows gray (pending) background until the tool completes.
|
|
699
|
+
|
|
700
|
+
## [0.22.3] - 2025-12-16
|
|
701
|
+
|
|
702
|
+
### Added
|
|
703
|
+
|
|
704
|
+
- **Streaming bash output**: Bash tool now streams output in real-time during execution. The TUI displays live progress with the last 5 lines visible (expandable with ctrl+o). ([#44](https://github.com/badlogic/pi-mono/issues/44))
|
|
705
|
+
|
|
706
|
+
### Changed
|
|
707
|
+
|
|
708
|
+
- **Tool output display**: When collapsed, tool output now shows the last N lines instead of the first N lines, making streaming output more useful.
|
|
709
|
+
|
|
710
|
+
- Updated `@oh-my-pi/pi-ai` with X-Initiator header support for GitHub Copilot, ensuring agent calls are not deducted from quota. ([#200](https://github.com/badlogic/pi-mono/pull/200) by [@kim0](https://github.com/kim0))
|
|
711
|
+
|
|
712
|
+
### Fixed
|
|
713
|
+
|
|
714
|
+
- Fixed editor text being cleared during compaction. Text typed while compaction is running is now preserved. ([#179](https://github.com/badlogic/pi-mono/issues/179))
|
|
715
|
+
- Improved RGB to 256-color mapping for terminals without truecolor support. Now correctly uses grayscale ramp for neutral colors and preserves semantic tints (green for success, red for error, blue for pending) instead of mapping everything to wrong cube colors.
|
|
716
|
+
- `/think off` now actually disables thinking for all providers. Previously, providers like Gemini with "dynamic thinking" enabled by default would still use thinking even when turned off. ([#180](https://github.com/badlogic/pi-mono/pull/180) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
717
|
+
|
|
718
|
+
## [0.22.2] - 2025-12-15
|
|
719
|
+
|
|
720
|
+
### Changed
|
|
721
|
+
|
|
722
|
+
- Updated `@oh-my-pi/pi-ai` with interleaved thinking enabled by default for Anthropic Claude 4 models.
|
|
723
|
+
|
|
724
|
+
## [0.22.1] - 2025-12-15
|
|
725
|
+
|
|
726
|
+
_Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
|
|
727
|
+
|
|
728
|
+
### Changed
|
|
729
|
+
|
|
730
|
+
- Updated `@oh-my-pi/pi-ai` with interleaved thinking support for Anthropic models.
|
|
731
|
+
|
|
732
|
+
## [0.22.0] - 2025-12-15
|
|
733
|
+
|
|
734
|
+
### Added
|
|
735
|
+
|
|
736
|
+
- **GitHub Copilot support**: Use GitHub Copilot models via OAuth login (`/login` -> "GitHub Copilot"). Supports both github.com and GitHub Enterprise. Models are sourced from models.dev and include Claude, GPT, Gemini, Grok, and more. All models are automatically enabled after login. ([#191](https://github.com/badlogic/pi-mono/pull/191) by [@cau1k](https://github.com/cau1k))
|
|
737
|
+
|
|
738
|
+
### Fixed
|
|
739
|
+
|
|
740
|
+
- Model selector fuzzy search now matches against provider name (not just model ID) and supports space-separated tokens where all tokens must match
|
|
741
|
+
|
|
742
|
+
## [0.21.0] - 2025-12-14
|
|
743
|
+
|
|
744
|
+
### Added
|
|
745
|
+
|
|
746
|
+
- **Inline image rendering**: Terminals supporting Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images now render images inline in tool output. Aspect ratio is preserved by querying terminal cell dimensions on startup. Toggle with `/show-images` command or `terminal.showImages` setting. Falls back to text placeholder on unsupported terminals or when disabled. ([#177](https://github.com/badlogic/pi-mono/pull/177) by [@nicobailon](https://github.com/nicobailon))
|
|
747
|
+
|
|
748
|
+
- **Gemini 3 Pro thinking levels**: Thinking level selector now works with Gemini 3 Pro models. Minimal/low map to Google's LOW, medium/high map to Google's HIGH. ([#176](https://github.com/badlogic/pi-mono/pull/176) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
749
|
+
|
|
750
|
+
### Fixed
|
|
751
|
+
|
|
752
|
+
- Fixed read tool failing on macOS screenshot filenames due to Unicode Narrow No-Break Space (U+202F) in timestamp. Added fallback to try macOS variant paths and consolidated duplicate expandPath functions into shared path-utils.ts. ([#181](https://github.com/badlogic/pi-mono/pull/181) by [@nicobailon](https://github.com/nicobailon))
|
|
753
|
+
|
|
754
|
+
- Fixed double blank lines rendering after markdown code blocks ([#173](https://github.com/badlogic/pi-mono/pull/173) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
755
|
+
|
|
756
|
+
## [0.20.1] - 2025-12-13
|
|
757
|
+
|
|
758
|
+
### Added
|
|
759
|
+
|
|
760
|
+
- **Exported skills API**: `loadSkillsFromDir`, `formatSkillsForPrompt`, and related types are now exported for use by other packages (e.g., mom).
|
|
761
|
+
|
|
762
|
+
## [0.20.0] - 2025-12-13
|
|
763
|
+
|
|
764
|
+
### Breaking Changes
|
|
765
|
+
|
|
766
|
+
- **Pi skills now use `SKILL.md` convention**: Pi skills must now be named `SKILL.md` inside a directory, matching Codex CLI format. Previously any `*.md` file was treated as a skill. Migrate by renaming `~/.pi/agent/skills/foo.md` to `~/.pi/agent/skills/foo/SKILL.md`.
|
|
767
|
+
|
|
768
|
+
### Added
|
|
769
|
+
|
|
770
|
+
- Display loaded skills on startup in interactive mode
|
|
771
|
+
|
|
772
|
+
## [0.19.1] - 2025-12-12
|
|
773
|
+
|
|
774
|
+
### Fixed
|
|
775
|
+
|
|
776
|
+
- Documentation: Added skills system documentation to README (setup, usage, CLI flags, settings)
|
|
777
|
+
|
|
778
|
+
## [0.19.0] - 2025-12-12
|
|
779
|
+
|
|
780
|
+
### Added
|
|
781
|
+
|
|
782
|
+
- **Skills system**: Auto-discover and load instruction files on-demand. Supports Claude Code (`~/.claude/skills/*/SKILL.md`), Codex CLI (`~/.codex/skills/`), and Pi-native formats (`~/.pi/agent/skills/`, `.pi/skills/`). Skills are listed in system prompt with descriptions, agent loads them via read tool when needed. Supports `{baseDir}` placeholder. Disable with `--no-skills` or `skills.enabled: false` in settings. ([#169](https://github.com/badlogic/pi-mono/issues/169))
|
|
783
|
+
|
|
784
|
+
- **Version flag**: Added `--version` / `-v` flag to display the current version and exit. ([#170](https://github.com/badlogic/pi-mono/pull/170))
|
|
785
|
+
|
|
786
|
+
## [0.18.2] - 2025-12-11
|
|
787
|
+
|
|
788
|
+
### Added
|
|
789
|
+
|
|
790
|
+
- **Auto-retry on transient errors**: Automatically retries requests when providers return overloaded, rate limit, or server errors (429, 500, 502, 503, 504). Uses exponential backoff (2s, 4s, 8s). Shows retry status in TUI with option to cancel via Escape. Configurable in `settings.json` via `retry.enabled`, `retry.maxRetries`, `retry.baseDelayMs`. RPC mode emits `auto_retry_start` and `auto_retry_end` events. ([#157](https://github.com/badlogic/pi-mono/issues/157))
|
|
791
|
+
|
|
792
|
+
- **HTML export line numbers**: Read tool calls in HTML exports now display line number ranges (e.g., `file.txt:10-20`) when offset/limit parameters are used, matching the TUI display format. Line numbers appear in yellow color for better visibility. ([#166](https://github.com/badlogic/pi-mono/issues/166))
|
|
793
|
+
|
|
794
|
+
### Fixed
|
|
795
|
+
|
|
796
|
+
- **Branch selector now works with single message**: Previously the branch selector would not open when there was only one user message. Now it correctly allows branching from any message, including the first one. This is needed for checkpoint hooks to restore state from before the first message. ([#163](https://github.com/badlogic/pi-mono/issues/163))
|
|
797
|
+
|
|
798
|
+
- **In-memory branching for `--no-session` mode**: Branching now works correctly in `--no-session` mode without creating any session files. The conversation is truncated in memory.
|
|
799
|
+
|
|
800
|
+
- **Git branch indicator now works in subdirectories**: The footer's git branch detection now walks up the directory hierarchy to find the git root, so it works when running pi from a subdirectory of a repository. ([#156](https://github.com/badlogic/pi-mono/issues/156))
|
|
801
|
+
|
|
802
|
+
## [0.18.1] - 2025-12-10
|
|
803
|
+
|
|
804
|
+
### Added
|
|
805
|
+
|
|
806
|
+
- **Mistral provider**: Added support for Mistral AI models. Set `MISTRAL_API_KEY` environment variable to use.
|
|
807
|
+
|
|
808
|
+
### Fixed
|
|
809
|
+
|
|
810
|
+
- Fixed print mode (`-p`) not exiting after output when custom themes are present (theme watcher now properly stops in print mode) ([#161](https://github.com/badlogic/pi-mono/issues/161))
|
|
811
|
+
|
|
812
|
+
## [0.18.0] - 2025-12-10
|
|
813
|
+
|
|
814
|
+
### Added
|
|
815
|
+
|
|
816
|
+
- **Hooks system**: TypeScript modules that extend agent behavior by subscribing to lifecycle events. Hooks can intercept tool calls, prompt for confirmation, modify results, and inject messages from external sources. Auto-discovered from `~/.pi/agent/hooks/*.ts` and `.pi/hooks/*.ts`. Thanks to [@nicobailon](https://github.com/nicobailon) for the collaboration on the design and implementation. ([#145](https://github.com/badlogic/pi-mono/issues/145), supersedes [#158](https://github.com/badlogic/pi-mono/pull/158))
|
|
817
|
+
|
|
818
|
+
- **`pi.send()` API**: Hooks can inject messages into the agent session from external sources (file watchers, webhooks, CI systems). If streaming, messages are queued; otherwise a new agent loop starts immediately.
|
|
819
|
+
|
|
820
|
+
- **`--hook <path>` CLI flag**: Load hook files directly for testing without modifying settings.
|
|
821
|
+
|
|
822
|
+
- **Hook events**: `session_start`, `session_switch`, `agent_start`, `agent_end`, `turn_start`, `turn_end`, `tool_call` (can block), `tool_result` (can modify), `branch`.
|
|
823
|
+
|
|
824
|
+
- **Hook UI primitives**: `ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`, `ctx.ui.notify()` for interactive prompts from hooks.
|
|
825
|
+
|
|
826
|
+
- **Hooks documentation**: Full API reference at `docs/hooks.md`, shipped with npm package.
|
|
827
|
+
|
|
828
|
+
## [0.17.0] - 2025-12-09
|
|
829
|
+
|
|
830
|
+
### Changed
|
|
831
|
+
|
|
832
|
+
- **Simplified compaction flow**: Removed proactive compaction (aborting mid-turn when threshold approached). Compaction now triggers in two cases only: (1) overflow error from LLM, which compacts and auto-retries, or (2) threshold crossed after a successful turn, which compacts without retry.
|
|
833
|
+
|
|
834
|
+
- **Compaction retry uses `Agent.continue()`**: Auto-retry after overflow now uses the new `continue()` API instead of re-sending the user message, preserving exact context state.
|
|
835
|
+
|
|
836
|
+
- **Merged turn prefix summary**: When a turn is split during compaction, the turn prefix summary is now merged into the main history summary instead of being stored separately.
|
|
837
|
+
|
|
838
|
+
### Added
|
|
839
|
+
|
|
840
|
+
- **`isCompacting` property on AgentSession**: Check if auto-compaction is currently running.
|
|
841
|
+
|
|
842
|
+
- **Session compaction indicator**: When resuming a compacted session, displays "Session compacted N times" status message.
|
|
843
|
+
|
|
844
|
+
### Fixed
|
|
845
|
+
|
|
846
|
+
- **Block input during compaction**: User input is now blocked while auto-compaction is running to prevent race conditions.
|
|
847
|
+
|
|
848
|
+
- **Skip error messages in usage calculation**: Context size estimation now skips both aborted and error messages, as neither have valid usage data.
|
|
849
|
+
|
|
850
|
+
## [0.16.0] - 2025-12-09
|
|
851
|
+
|
|
852
|
+
### Breaking Changes
|
|
853
|
+
|
|
854
|
+
- **New RPC protocol**: The RPC mode (`--mode rpc`) has been completely redesigned with a new JSON protocol. The old protocol is no longer supported. See [`docs/rpc.md`](docs/rpc.md) for the new protocol documentation and [`test/rpc-example.ts`](test/rpc-example.ts) for a working example. Includes `RpcClient` TypeScript class for easy integration. ([#91](https://github.com/badlogic/pi-mono/issues/91))
|
|
855
|
+
|
|
856
|
+
### Changed
|
|
857
|
+
|
|
858
|
+
- **README restructured**: Reorganized documentation from 30+ flat sections into 10 logical groups. Converted verbose subsections to scannable tables. Consolidated philosophy sections. Reduced size by ~60% while preserving all information.
|
|
859
|
+
|
|
860
|
+
## [0.15.0] - 2025-12-09
|
|
861
|
+
|
|
862
|
+
### Changed
|
|
863
|
+
|
|
864
|
+
- **Major code refactoring**: Restructured codebase for better maintainability and separation of concerns. Moved files into organized directories (`core/`, `modes/`, `utils/`, `cli/`). Extracted `AgentSession` class as central session management abstraction. Split `main.ts` and `tui-renderer.ts` into focused modules. See `DEVELOPMENT.md` for the new code map. ([#153](https://github.com/badlogic/pi-mono/issues/153))
|
|
865
|
+
|
|
866
|
+
## [0.14.2] - 2025-12-08
|
|
867
|
+
|
|
868
|
+
### Added
|
|
869
|
+
|
|
870
|
+
- `/debug` command now includes agent messages as JSONL in the output
|
|
871
|
+
|
|
872
|
+
### Fixed
|
|
873
|
+
|
|
874
|
+
- Fix crash when bash command outputs binary data (e.g., `curl` downloading a video file)
|
|
875
|
+
|
|
876
|
+
## [0.14.1] - 2025-12-08
|
|
877
|
+
|
|
878
|
+
### Fixed
|
|
879
|
+
|
|
880
|
+
- Fix build errors with tsgo 7.0.0-dev.20251208.1 by properly importing `ReasoningEffort` type
|
|
881
|
+
|
|
882
|
+
## [0.14.0] - 2025-12-08
|
|
883
|
+
|
|
884
|
+
### Breaking Changes
|
|
885
|
+
|
|
886
|
+
- **Custom themes require new color tokens**: Themes must now include `thinkingXhigh` and `bashMode` color tokens. The theme loader provides helpful error messages listing missing tokens. See built-in themes (dark.json, light.json) for reference values.
|
|
887
|
+
|
|
888
|
+
### Added
|
|
889
|
+
|
|
890
|
+
- **OpenAI compatibility overrides in models.json**: Custom models using `openai-completions` API can now specify a `compat` object to override provider quirks (`supportsStore`, `supportsDeveloperRole`, `supportsReasoningEffort`, `maxTokensField`). Useful for LiteLLM, custom proxies, and other non-standard endpoints. ([#133](https://github.com/badlogic/pi-mono/issues/133), thanks @fink-andreas for the initial idea and PR)
|
|
891
|
+
|
|
892
|
+
- **xhigh thinking level**: Added `xhigh` thinking level for OpenAI codex-max models. Cycle through thinking levels with Shift+Tab; `xhigh` appears only when using a codex-max model. ([#143](https://github.com/badlogic/pi-mono/issues/143))
|
|
893
|
+
|
|
894
|
+
- **Collapse changelog setting**: Add `"collapseChangelog": true` to `~/.pi/agent/settings.json` to show a condensed "Updated to vX.Y.Z" message instead of the full changelog after updates. Use `/changelog` to view the full changelog. ([#148](https://github.com/badlogic/pi-mono/issues/148))
|
|
895
|
+
|
|
896
|
+
- **Bash mode**: Execute shell commands directly from the editor by prefixing with `!` (e.g., `!ls -la`). Output streams in real-time, is added to the LLM context, and persists in session history. Supports multiline commands, cancellation (Escape), truncation for large outputs, and preview/expand toggle (Ctrl+O). Also available in RPC mode via `{"type":"bash","command":"..."}`. ([#112](https://github.com/badlogic/pi-mono/pull/112), original implementation by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
897
|
+
|
|
898
|
+
## [0.13.2] - 2025-12-07
|
|
899
|
+
|
|
900
|
+
### Changed
|
|
901
|
+
|
|
902
|
+
- **Tool output truncation**: All tools now enforce consistent truncation limits with actionable notices for the LLM. ([#134](https://github.com/badlogic/pi-mono/issues/134))
|
|
903
|
+
- **Limits**: 2000 lines OR 50KB (whichever hits first), never partial lines
|
|
904
|
+
- **read**: Shows `[Showing lines X-Y of Z. Use offset=N to continue]`. If first line exceeds 50KB, suggests bash command
|
|
905
|
+
- **bash**: Tail truncation with temp file. Shows `[Showing lines X-Y of Z. Full output: /tmp/...]`
|
|
906
|
+
- **grep**: Pre-truncates match lines to 500 chars. Shows match limit and line truncation notices
|
|
907
|
+
- **find/ls**: Shows result/entry limit notices
|
|
908
|
+
- TUI displays truncation warnings in yellow at bottom of tool output (visible even when collapsed)
|
|
909
|
+
|
|
910
|
+
## [0.13.1] - 2025-12-06
|
|
911
|
+
|
|
912
|
+
### Added
|
|
913
|
+
|
|
914
|
+
- **Flexible Windows shell configuration**: The bash tool now supports multiple shell sources beyond Git Bash. Resolution order: (1) custom `shellPath` in settings.json, (2) Git Bash in standard locations, (3) any bash.exe on PATH. This enables Cygwin, MSYS2, and other bash environments. Configure with `~/.pi/agent/settings.json`: `{"shellPath": "C:\\cygwin64\\bin\\bash.exe"}`.
|
|
915
|
+
|
|
916
|
+
### Fixed
|
|
917
|
+
|
|
918
|
+
- **Windows binary detection**: Fixed Bun compiled binary detection on Windows by checking for URL-encoded `%7EBUN` in addition to `$bunfs` and `~BUN` in `import.meta.url`. This ensures the binary correctly locates supporting files (package.json, themes, etc.) next to the executable.
|
|
919
|
+
|
|
920
|
+
## [0.12.15] - 2025-12-06
|
|
921
|
+
|
|
922
|
+
### Fixed
|
|
923
|
+
|
|
924
|
+
- **Editor crash with emojis/CJK characters**: Fixed crash when pasting or typing text containing wide characters (emojis like ✅, CJK characters) that caused line width to exceed terminal width. The editor now uses grapheme-aware text wrapping with proper visible width calculation.
|
|
925
|
+
|
|
926
|
+
## [0.12.14] - 2025-12-06
|
|
927
|
+
|
|
928
|
+
### Added
|
|
929
|
+
|
|
930
|
+
- **Double-Escape Branch Shortcut**: Press Escape twice with an empty editor to quickly open the `/branch` selector for conversation branching.
|
|
931
|
+
|
|
932
|
+
## [0.12.13] - 2025-12-05
|
|
933
|
+
|
|
934
|
+
### Changed
|
|
935
|
+
|
|
936
|
+
- **Faster startup**: Version check now runs in parallel with TUI initialization instead of blocking startup for up to 1 second. Update notifications appear in chat when the check completes.
|
|
937
|
+
|
|
938
|
+
## [0.12.12] - 2025-12-05
|
|
939
|
+
|
|
940
|
+
### Changed
|
|
941
|
+
|
|
942
|
+
- **Footer display**: Token counts now use M suffix for millions (e.g., `10.2M` instead of `10184k`). Context display shortened from `61.3% of 200k` to `61.3%/200k`.
|
|
943
|
+
|
|
944
|
+
### Fixed
|
|
945
|
+
|
|
946
|
+
- **Multi-key sequences in inputs**: Inputs like model search now handle multi-key sequences identically to the main prompt editor. ([#122](https://github.com/badlogic/pi-mono/pull/122) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
947
|
+
- **Line wrapping escape codes**: Fixed underline style bleeding into padding when wrapping long URLs. ANSI codes now attach to the correct content, and line-end resets only turn off underline (preserving background colors). ([#109](https://github.com/badlogic/pi-mono/issues/109))
|
|
948
|
+
|
|
949
|
+
### Added
|
|
950
|
+
|
|
951
|
+
- **Fuzzy search models and sessions**: Implemented a simple fuzzy search for models and sessions (e.g., `codexmax` now finds `gpt-5.1-codex-max`). ([#122](https://github.com/badlogic/pi-mono/pull/122) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
952
|
+
- **Prompt History Navigation**: Browse previously submitted prompts using Up/Down arrow keys when the editor is empty. Press Up to cycle through older prompts, Down to return to newer ones or clear the editor. Similar to shell history and Claude Code's prompt history feature. History is session-scoped and stores up to 100 entries. ([#121](https://github.com/badlogic/pi-mono/pull/121) by [@nicobailon](https://github.com/nicobailon))
|
|
953
|
+
- **`/resume` Command**: Switch to a different session mid-conversation. Opens an interactive selector showing all available sessions. Equivalent to the `--resume` CLI flag but can be used without restarting the agent. ([#117](https://github.com/badlogic/pi-mono/pull/117) by [@hewliyang](https://github.com/hewliyang))
|
|
954
|
+
|
|
955
|
+
## [0.12.11] - 2025-12-05
|
|
956
|
+
|
|
957
|
+
### Changed
|
|
958
|
+
|
|
959
|
+
- **Compaction UI**: Simplified collapsed compaction indicator to show warning-colored text with token count instead of styled banner. Removed redundant success message after compaction. ([#108](https://github.com/badlogic/pi-mono/issues/108))
|
|
960
|
+
|
|
961
|
+
### Fixed
|
|
962
|
+
|
|
963
|
+
- **Print mode error handling**: `-p` flag now outputs error messages and exits with code 1 when requests fail, instead of silently producing no output.
|
|
964
|
+
- **Branch selector crash**: Fixed TUI crash when user messages contained Unicode characters (like `✔` or `›`) that caused line width to exceed terminal width. Now uses proper `truncateToWidth` instead of `substring`.
|
|
965
|
+
- **Bash output escape sequences**: Fixed incomplete stripping of terminal escape sequences in bash tool output. `stripAnsi` misses some sequences like standalone String Terminator (`ESC \`), which could cause rendering issues when displaying captured TUI output.
|
|
966
|
+
- **Footer overflow crash**: Fixed TUI crash when terminal width is too narrow for the footer stats line. The footer now truncates gracefully instead of overflowing.
|
|
967
|
+
|
|
968
|
+
### Added
|
|
969
|
+
|
|
970
|
+
- **`authHeader` option in models.json**: Custom providers can set `"authHeader": true` to automatically add `Authorization: Bearer <apiKey>` header. Useful for providers that require explicit auth headers. ([#81](https://github.com/badlogic/pi-mono/issues/81))
|
|
971
|
+
- **`--append-system-prompt` Flag**: Append additional text or file contents to the system prompt. Supports both inline text and file paths. Complements `--system-prompt` for layering custom instructions without replacing the base system prompt. ([#114](https://github.com/badlogic/pi-mono/pull/114) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
972
|
+
- **Thinking Block Toggle**: Added `Ctrl+T` shortcut to toggle visibility of LLM thinking blocks. When toggled off, shows a static "Thinking..." label instead of full content. Useful for reducing visual clutter during long conversations. ([#113](https://github.com/badlogic/pi-mono/pull/113) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
973
|
+
|
|
974
|
+
## [0.12.10] - 2025-12-04
|
|
975
|
+
|
|
976
|
+
### Added
|
|
977
|
+
|
|
978
|
+
- Added `gpt-5.1-codex-max` model support
|
|
979
|
+
|
|
980
|
+
## [0.12.9] - 2025-12-04
|
|
981
|
+
|
|
982
|
+
### Added
|
|
983
|
+
|
|
984
|
+
- **`/copy` Command**: Copy the last agent message to clipboard. Works cross-platform (macOS, Windows, Linux). Useful for extracting text from rendered Markdown output. ([#105](https://github.com/badlogic/pi-mono/pull/105) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
985
|
+
|
|
986
|
+
## [0.12.8] - 2025-12-04
|
|
987
|
+
|
|
988
|
+
- Fix: Use CTRL+O consistently for compaction expand shortcut (not CMD+O on Mac)
|
|
989
|
+
|
|
990
|
+
## [0.12.7] - 2025-12-04
|
|
991
|
+
|
|
992
|
+
### Added
|
|
993
|
+
|
|
994
|
+
- **Context Compaction**: Long sessions can now be compacted to reduce context usage while preserving recent conversation history. ([#92](https://github.com/badlogic/pi-mono/issues/92), [docs](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/README.md#context-compaction))
|
|
995
|
+
- `/compact [instructions]`: Manually compact context with optional custom instructions for the summary
|
|
996
|
+
- `/autocompact`: Toggle automatic compaction when context exceeds threshold
|
|
997
|
+
- Compaction summarizes older messages while keeping recent messages (default 20k tokens) verbatim
|
|
998
|
+
- Auto-compaction triggers when context reaches `contextWindow - reserveTokens` (default 16k reserve)
|
|
999
|
+
- Compacted sessions show a collapsible summary in the TUI (toggle with `o` key)
|
|
1000
|
+
- HTML exports include compaction summaries as collapsible sections
|
|
1001
|
+
- RPC mode supports `{"type":"compact"}` command and auto-compaction (emits compaction events)
|
|
1002
|
+
- **Branch Source Tracking**: Branched sessions now store `branchedFrom` in the session header, containing the path to the original session file. Useful for tracing session lineage.
|
|
1003
|
+
|
|
1004
|
+
## [0.12.5] - 2025-12-03
|
|
1005
|
+
|
|
1006
|
+
### Added
|
|
1007
|
+
|
|
1008
|
+
- **Forking/Rebranding Support**: All branding (app name, config directory, environment variable names) is now configurable via `piConfig` in `package.json`. Forks can change `piConfig.name` and `piConfig.configDir` to rebrand the CLI without code changes. Affects CLI banner, help text, config paths, and error messages. ([#95](https://github.com/badlogic/pi-mono/pull/95))
|
|
1009
|
+
|
|
1010
|
+
### Fixed
|
|
1011
|
+
|
|
1012
|
+
- **Bun Binary Detection**: Fixed Bun compiled binary failing to start after Bun updated its virtual filesystem path format from `%7EBUN` to `$bunfs`. ([#95](https://github.com/badlogic/pi-mono/pull/95))
|
|
1013
|
+
|
|
1014
|
+
## [0.12.4] - 2025-12-02
|
|
1015
|
+
|
|
1016
|
+
### Added
|
|
1017
|
+
|
|
1018
|
+
- **RPC Termination Safeguard**: When running as an RPC worker (stdin pipe detected), the CLI now exits immediately if the parent process terminates unexpectedly. Prevents orphaned RPC workers from persisting indefinitely and consuming system resources.
|
|
1019
|
+
|
|
1020
|
+
## [0.12.3] - 2025-12-02
|
|
1021
|
+
|
|
1022
|
+
### Fixed
|
|
1023
|
+
|
|
1024
|
+
- **Rate limit handling**: Anthropic rate limit errors now trigger automatic retry with exponential backoff (base 10s, max 5 retries). Previously these errors would abort the request immediately.
|
|
1025
|
+
- **Usage tracking during retries**: Retried requests now correctly accumulate token usage from all attempts, not just the final successful one. Fixes artificially low token counts when requests were retried.
|
|
1026
|
+
|
|
1027
|
+
## [0.12.2] - 2025-12-02
|
|
1028
|
+
|
|
1029
|
+
### Changed
|
|
1030
|
+
|
|
1031
|
+
- Removed support for gpt-4.5-preview and o3 models (not yet available)
|
|
1032
|
+
|
|
1033
|
+
## [0.12.1] - 2025-12-02
|
|
1034
|
+
|
|
1035
|
+
### Added
|
|
1036
|
+
|
|
1037
|
+
- **Models**: Added support for OpenAI's new models:
|
|
1038
|
+
- `gpt-4.1` (128K context)
|
|
1039
|
+
- `gpt-4.1-mini` (128K context)
|
|
1040
|
+
- `gpt-4.1-nano` (128K context)
|
|
1041
|
+
- `o3` (200K context, reasoning model)
|
|
1042
|
+
- `o4-mini` (200K context, reasoning model)
|
|
1043
|
+
|
|
1044
|
+
## [0.12.0] - 2025-12-02
|
|
1045
|
+
|
|
1046
|
+
### Added
|
|
1047
|
+
|
|
1048
|
+
- **`-p, --print` Flag**: Run in non-interactive batch mode. Processes input message or piped stdin without TUI, prints agent response directly to stdout. Ideal for scripting, piping, and CI/CD integration. Exits after first response.
|
|
1049
|
+
- **`-P, --print-streaming` Flag**: Like `-p`, but streams response tokens as they arrive. Use `--print-streaming --no-markdown` for raw unformatted output.
|
|
1050
|
+
- **`--print-turn` Flag**: Continue processing tool calls and agent turns until the agent naturally finishes or requires user input. Combine with `-p` for complete multi-turn conversations.
|
|
1051
|
+
- **`--no-markdown` Flag**: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.
|
|
1052
|
+
- **Streaming Print Mode**: Added internal `printStreaming` option for streaming output in non-TUI mode.
|
|
1053
|
+
- **RPC Mode `print` Command**: Send `{"type":"print","content":"text"}` to get formatted print output via `print_output` events.
|
|
1054
|
+
- **Auto-Save in Print Mode**: Print mode conversations are automatically saved to the session directory, allowing later resumption with `--continue`.
|
|
1055
|
+
- **Thinking level options**: Added `--thinking-off`, `--thinking-minimal`, `--thinking-low`, `--thinking-medium`, `--thinking-high` flags for directly specifying thinking level without the selector UI.
|
|
1056
|
+
|
|
1057
|
+
### Changed
|
|
1058
|
+
|
|
1059
|
+
- **Simplified RPC Protocol**: Replaced the `prompt` wrapper command with direct message objects. Send `{"role":"user","content":"text"}` instead of `{"type":"prompt","message":"text"}`. Better aligns with message format throughout the codebase.
|
|
1060
|
+
- **RPC Message Handling**: Agent now processes raw message objects directly, with `timestamp` auto-populated if missing.
|
|
1061
|
+
|
|
1062
|
+
## [0.11.9] - 2025-12-02
|
|
1063
|
+
|
|
1064
|
+
### Changed
|
|
1065
|
+
|
|
1066
|
+
- Change Ctrl+I to Ctrl+P for model cycling shortcut to avoid collision with Tab key in some terminals
|
|
1067
|
+
|
|
1068
|
+
## [0.11.8] - 2025-12-01
|
|
1069
|
+
|
|
1070
|
+
### Fixed
|
|
1071
|
+
|
|
1072
|
+
- Absolute glob patterns (e.g., `/Users/foo/**/*.ts`) are now handled correctly. Previously the leading `/` was being stripped, causing the pattern to be interpreted relative to the current directory.
|
|
1073
|
+
|
|
1074
|
+
## [0.11.7] - 2025-12-01
|
|
1075
|
+
|
|
1076
|
+
### Fixed
|
|
1077
|
+
|
|
1078
|
+
- Fix read path traversal vulnerability. Paths are now validated to prevent reading outside the working directory or its parents. The `read` tool can read from `cwd`, its ancestors (for config files), and all descendants. Symlinks are resolved before validation.
|
|
1079
|
+
|
|
1080
|
+
## [0.11.6] - 2025-12-01
|
|
1081
|
+
|
|
1082
|
+
### Fixed
|
|
1083
|
+
|
|
1084
|
+
- Fix `--system-prompt <path>` allowing the path argument to be captured by the message collection, causing "file not found" errors.
|
|
1085
|
+
|
|
1086
|
+
## [0.11.5] - 2025-11-30
|
|
1087
|
+
|
|
1088
|
+
### Fixed
|
|
1089
|
+
|
|
1090
|
+
- Fixed fatal error "Cannot set properties of undefined (setting '0')" when editing empty files in the `edit` tool.
|
|
1091
|
+
- Simplified `edit` tool output: Shows only "Edited file.txt" for successful edits instead of verbose search/replace details.
|
|
1092
|
+
- Fixed fatal error in footer rendering when token counts contain NaN values due to missing usage data.
|
|
1093
|
+
|
|
1094
|
+
## [0.11.4] - 2025-11-30
|
|
1095
|
+
|
|
1096
|
+
### Fixed
|
|
1097
|
+
|
|
1098
|
+
- Fixed chat rendering crash when messages contain preformatted/styled text (e.g., thinking traces with gray italic styling). The markdown renderer now preserves existing ANSI escape codes when they appear before inline elements.
|
|
1099
|
+
|
|
1100
|
+
## [0.11.3] - 2025-11-29
|
|
1101
|
+
|
|
1102
|
+
### Fixed
|
|
1103
|
+
|
|
1104
|
+
- Fix file drop functionality for absolute paths
|
|
1105
|
+
|
|
1106
|
+
## [0.11.2] - 2025-11-29
|
|
1107
|
+
|
|
1108
|
+
### Fixed
|
|
1109
|
+
|
|
1110
|
+
- Fixed TUI crash when pasting content containing tab characters. Tabs are now converted to 4 spaces before insertion.
|
|
1111
|
+
- Fixed terminal corruption after exit when shell integration sequences (OSC 133) appeared in bash output. These sequences are now stripped along with other ANSI codes.
|
|
1112
|
+
|
|
1113
|
+
## [0.11.1] - 2025-11-29
|
|
1114
|
+
|
|
1115
|
+
### Added
|
|
1116
|
+
|
|
1117
|
+
- Added `fd` integration for file path autocompletion. Now uses `fd` for faster fuzzy file search
|
|
1118
|
+
|
|
1119
|
+
### Fixed
|
|
1120
|
+
|
|
1121
|
+
- Fixed keyboard shortcuts Ctrl+A, Ctrl+E, Ctrl+K, Ctrl+U, Ctrl+W, and word navigation (Option+Arrow) not working in VS Code integrated terminal and some other terminal emulators
|
|
1122
|
+
|
|
1123
|
+
## [0.11.0] - 2025-11-29
|
|
1124
|
+
|
|
1125
|
+
### Added
|
|
1126
|
+
|
|
1127
|
+
- **File-based Slash Commands**: Create custom reusable prompts as `.txt` files in `~/.pi/slash-commands/`. Files become `/filename` commands with first-line descriptions. Supports `{{selection}}` placeholder for referencing selected/attached content.
|
|
1128
|
+
- **`/branch` Command**: Create conversation branches from any previous user message. Opens a selector to pick a message, then creates a new session file starting from that point. Original message text is placed in the editor for modification.
|
|
1129
|
+
- **Unified Content References**: Both `@path` in messages and `--file path` CLI arguments now use the same attachment system with consistent MIME type detection.
|
|
1130
|
+
- **Drag & Drop Files**: Drop files onto the terminal to attach them to your message. Supports multiple files and both text and image content.
|
|
1131
|
+
|
|
1132
|
+
### Changed
|
|
1133
|
+
|
|
1134
|
+
- **Model Selector with Search**: The `/model` command now opens a searchable list. Type to filter models by name, use arrows to navigate, Enter to select.
|
|
1135
|
+
- **Improved File Autocomplete**: File path completion after `@` now supports fuzzy matching and shows file/directory indicators.
|
|
1136
|
+
- **Session Selector with Search**: The `--resume` and `--session` flags now open a searchable session list with fuzzy filtering.
|
|
1137
|
+
- **Attachment Display**: Files added via `@path` are now shown as "Attached: filename" in the user message, separate from the prompt text.
|
|
1138
|
+
- **Tab Completion**: Tab key now triggers file path autocompletion anywhere in the editor, not just after `@` symbol.
|
|
1139
|
+
|
|
1140
|
+
### Fixed
|
|
1141
|
+
|
|
1142
|
+
- Fixed autocomplete z-order issue where dropdown could appear behind chat messages
|
|
1143
|
+
- Fixed cursor position when navigating through wrapped lines in the editor
|
|
1144
|
+
- Fixed attachment handling for continued sessions to preserve file references
|
|
1145
|
+
|
|
1146
|
+
## [0.10.6] - 2025-11-28
|
|
1147
|
+
|
|
1148
|
+
### Changed
|
|
1149
|
+
|
|
1150
|
+
- Show base64-truncated indicator for large images in tool output
|
|
1151
|
+
|
|
1152
|
+
### Fixed
|
|
1153
|
+
|
|
1154
|
+
- Fixed image dimensions not being read correctly from PNG/JPEG/GIF files
|
|
1155
|
+
- Fixed PDF images being incorrectly base64-truncated in display
|
|
1156
|
+
- Allow reading files from ancestor directories (needed for monorepo configs)
|
|
1157
|
+
|
|
1158
|
+
## [0.10.5] - 2025-11-28
|
|
1159
|
+
|
|
1160
|
+
### Added
|
|
1161
|
+
|
|
1162
|
+
- Full multimodal support: attach images (PNG, JPEG, GIF, WebP) and PDFs to prompts using `@path` syntax or `--file` flag
|
|
1163
|
+
|
|
1164
|
+
### Fixed
|
|
1165
|
+
|
|
1166
|
+
- `@`-references now handle special characters in file names (spaces, quotes, unicode)
|
|
1167
|
+
- Fixed cursor positioning issues with multi-byte unicode characters in editor
|
|
1168
|
+
|
|
1169
|
+
## [0.10.4] - 2025-11-28
|
|
1170
|
+
|
|
1171
|
+
### Fixed
|
|
1172
|
+
|
|
1173
|
+
- Removed padding on first user message in TUI to improve visual consistency.
|
|
1174
|
+
|
|
1175
|
+
## [0.10.3] - 2025-11-28
|
|
1176
|
+
|
|
1177
|
+
### Added
|
|
1178
|
+
|
|
1179
|
+
- Added RPC mode (`--rpc`) for programmatic integration. Accepts JSON commands on stdin, emits JSON events on stdout. See [RPC mode documentation](https://github.com/nicobailon/pi-mono/blob/main/packages/coding-agent/README.md#rpc-mode) for protocol details.
|
|
1180
|
+
|
|
1181
|
+
### Changed
|
|
1182
|
+
|
|
1183
|
+
- Refactored internal architecture to support multiple frontends (TUI, RPC) with shared agent logic.
|
|
1184
|
+
|
|
1185
|
+
## [0.10.2] - 2025-11-26
|
|
1186
|
+
|
|
1187
|
+
### Added
|
|
1188
|
+
|
|
1189
|
+
- Added thinking level persistence. Default level stored in `~/.pi/settings.json`, restored on startup. Per-session overrides saved in session files.
|
|
1190
|
+
- Added model cycling shortcut: `Ctrl+I` cycles through available models (or scoped models with `-m` flag).
|
|
1191
|
+
- Added automatic retry with exponential backoff for transient API errors (network issues, 500s, overload).
|
|
1192
|
+
- Cumulative token usage now shown in footer (total tokens used across all messages in session).
|
|
1193
|
+
- Added `--system-prompt` flag to override default system prompt with custom text or file contents.
|
|
1194
|
+
- Footer now shows estimated total cost in USD based on model pricing.
|
|
1195
|
+
|
|
1196
|
+
### Changed
|
|
1197
|
+
|
|
1198
|
+
- Replaced `--models` flag with `-m/--model` supporting multiple values. Specify models as `provider/model@thinking` (e.g., `anthropic/claude-sonnet-4-20250514@high`). Multiple `-m` flags scope available models for the session.
|
|
1199
|
+
- Thinking level border now persists visually after selector closes.
|
|
1200
|
+
- Improved tool result display with collapsible output (default collapsed, expand with `Ctrl+O`).
|
|
1201
|
+
|
|
1202
|
+
## [0.10.1] - 2025-11-25
|
|
1203
|
+
|
|
1204
|
+
### Added
|
|
1205
|
+
|
|
1206
|
+
- Add custom model configuration via `~/.pi/models.json`
|
|
1207
|
+
|
|
1208
|
+
## [0.10.0] - 2025-11-25
|
|
1209
|
+
|
|
1210
|
+
Initial public release.
|
|
1211
|
+
|
|
1212
|
+
### Added
|
|
1213
|
+
|
|
1214
|
+
- Interactive TUI with streaming responses
|
|
1215
|
+
- Conversation session management with `--continue`, `--resume`, and `--session` flags
|
|
1216
|
+
- Multi-line input support (Shift+Enter or Option+Enter for new lines)
|
|
1217
|
+
- Tool execution: `read`, `write`, `edit`, `bash`, `glob`, `grep`, `think`
|
|
1218
|
+
- Thinking mode support for Claude with visual indicator and `/thinking` selector
|
|
1219
|
+
- File path autocompletion with `@` prefix
|
|
1220
|
+
- Slash command autocompletion
|
|
1221
|
+
- `/export` command for HTML session export
|
|
1222
|
+
- `/model` command for runtime model switching
|
|
1223
|
+
- `/session` command for session statistics
|
|
1224
|
+
- Model provider support: Anthropic (Claude), OpenAI, Google (Gemini)
|
|
1225
|
+
- Git branch display in footer
|
|
1226
|
+
- Message queueing during streaming responses
|
|
1227
|
+
- OAuth integration for Gmail and Google Calendar access
|
|
1228
|
+
- HTML export with syntax highlighting and collapsible sections
|