Commit graph

552 commits

Author SHA1 Message Date
Mario Zechner
3266cac0f1 Fix coloring in footer when context usage is colored 2025-12-20 21:34:18 +01:00
Mario Zechner
1294239a7a fix(coding-agent): fix Google Cloud project discovery
Use correct API response format (cloudaicompanionProject) and proper
onboarding flow with tierId and metadata. Add retry logic for project
provisioning which may take time.
2025-12-20 10:29:09 +01:00
Mario Zechner
b6fe07b618 feat(coding-agent): add Google Cloud Code Assist OAuth flow
- Add OAuth handler with PKCE flow and local callback server
- Automatic project discovery via loadCodeAssist/onboardUser endpoints
- Store credentials with projectId for API calls
- Encode token+projectId as JSON for provider to decode
- Register as 'google-cloud-code-assist' OAuth provider
2025-12-20 10:27:07 +01:00
Mario Zechner
c1382818cc fix(coding-agent): add connection error to retryable errors
Fixes #252
2025-12-20 09:55:03 +01:00
Mario Zechner
3f307f8786 docs: add changelog entries for #251 and #253 2025-12-20 09:52:57 +01:00
Mario Zechner
b7c3cf9436 fix(coding-agent): clamp thinking level to model capabilities
- setThinkingLevel() now clamps xhigh to high when model doesn't support it
- Model changes automatically re-clamp the current thinking level
- Fixed /model command to use session.setModel() instead of agent.setModel()
- Footer and editor border color update after model/thinking changes

Closes #253
2025-12-20 09:52:57 +01:00
Mario Zechner
085294b764 Release v0.24.5 2025-12-19 22:09:35 +01:00
Mario Zechner
f377c3c9c3 Release v0.24.4 2025-12-19 21:54:36 +01:00
Mario Zechner
8d1229b5ec fix(coding-agent): use key helpers for arrow keys and Enter
Fixed arrow key and Enter detection in selector components to work
with Kitty protocol when Caps Lock or Num Lock is enabled.

Updated: oauth-selector, user-message-selector, hook-selector,
hook-input, model-selector, session-selector
2025-12-19 21:53:04 +01:00
Mario Zechner
ad4eb3afa6 Release v0.24.3 2025-12-19 21:36:16 +01:00
Mario Zechner
ad9d68e488 Fix footer overflow on narrow terminals, add /arminsayshi easter egg 2025-12-19 21:35:09 +01:00
Mario Zechner
5095b4eb02 Release v0.24.2 2025-12-19 21:12:53 +01:00
Mario Zechner
b8e46130b0 Add [Unreleased] section to changelog 2025-12-19 20:52:44 +01:00
Mario Zechner
50b055f3ae Release v0.24.1 2025-12-19 20:51:44 +01:00
Mario Zechner
de1f1cc344 Export OAuth and model config functions for AgentSession scripts
Exports getAvailableModels, getApiKeyForModel, findModel, login, logout,
and getOAuthProviders from @mariozechner/pi-coding-agent so scripts using
AgentSession directly can reuse OAuth token storage and model resolution.

Fixes #245
2025-12-19 20:43:41 +01:00
Mario Zechner
b8dd9be3d0 fix(tui): handle emoji deletion and cursor movement correctly
Backspace, Delete, and arrow keys now use Intl.Segmenter to operate
on grapheme clusters instead of individual UTF-16 code units. This
fixes deletion of emojis and other multi-codepoint characters.

fixes #240
2025-12-19 20:39:45 +01:00
Mario Zechner
28c3ffb914 fix(tui): handle Kitty protocol lock key modifiers
Fixes keyboard input in Ghostty on Linux when Num Lock is enabled.
The Kitty protocol includes Caps Lock (64) and Num Lock (128) bits
in modifier values. Now masks out lock bits when matching shortcuts.

Added helper functions: isArrowUp/Down/Left/Right, isEnter, isTab,
isBackspace, isShiftEnter, isAltEnter, isAltLeft/Right, isCtrlLeft/Right

fixes #243
2025-12-19 20:34:20 +01:00
Mario Zechner
7e38897673 feat: add xhigh thinking level support for gpt-5.2 models
- Add supportsXhigh() function to ai package for checking xhigh support
- Clamp xhigh to high for OpenAI models that don't support it
- Update coding-agent to use centralized supportsXhigh()
- gpt-5.2, gpt-5.2-codex now show xhigh in thinking selector

Closes #236
2025-12-19 20:07:24 +01:00
theBucky
4f981d8ebc feat: add xhigh thinking level support for gpt-5.2 and gpt-5.2-codex
- Add XHIGH_MODELS constant and getAvailableThinkingLevels() to AgentSession
- Update ThinkingSelectorComponent to accept availableLevels parameter
- Both shift+tab cycling and /thinking command now show xhigh for supported models
- Update types.ts documentation to list supported models
2025-12-19 19:59:13 +01:00
Nico Bailon
74f7e6c9d5
Wrap custom tools with hooks (#248) 2025-12-19 19:05:20 +01:00
Aliou Diallo
95dcd04e7c
fix(coding-agent): properly cleanup terminal on Ctrl+C in session selector (#247) 2025-12-19 19:04:00 +01:00
Aliou Diallo
9a7863fc98
fix(coding-agent): handle OpenRouter models with colons in IDs (#242) 2025-12-19 15:26:12 +01:00
Aliou Diallo
a9a1a62b14
fix(coding-agent): prevent global AGENTS.md from being loaded twice (#239)
When cwd is `~/.pi/agent/` or a subdirectory, the global AGENTS.md file
was included twice in the system prompt.

`loadProjectContextFiles()` loads context files in two steps:
1. Explicitly loads from `getAgentDir()` (`~/.pi/agent/`)
2. Walks from cwd up to root, collecting all AGENTS.md/CLAUDE.md files

There was no deduplication. When cwd is at or below `~/.pi/agent/`, the
ancestor walk includes that directory again.

Fix: track seen paths with a Set and skip duplicates.
2025-12-19 15:24:49 +01:00
Nico Bailon
a54c70bbed
Forward onUpdate callback through hook wrapper (#238) 2025-12-19 15:23:41 +01:00
Mario Zechner
16685a36ec Release v0.24.0 2025-12-19 05:21:25 +01:00
Mario Zechner
f92147ffe8 Release v0.23.5 2025-12-19 05:15:34 +01:00
Mario Zechner
13b8af1f36 Update changelog with getMarkdownTheme export and subagent improvements 2025-12-19 04:54:02 +01:00
Mario Zechner
48e792aa52 Update custom tools README for subdirectory/index.ts structure 2025-12-19 04:54:02 +01:00
Mario Zechner
a930eb8489 Convert custom tool examples to subdirectory/index.ts structure
- hello.ts → hello/index.ts
- question.ts → question/index.ts
- todo.ts → todo/index.ts
- subagent/subagent.ts → subagent/index.ts
2025-12-19 04:54:02 +01:00
Mario Zechner
320556dbf5 Subagent: markdown rendering in expanded view, chain streaming shows all steps
- Export getMarkdownTheme() from coding-agent for custom tools
- Chain/parallel modes now use Markdown component in expanded view
- Chain streaming updates include all previous steps (not just current)
- Strip {previous} placeholder from task preview in renderCall
2025-12-19 04:54:02 +01:00
Mario Zechner
4fb3af93fb Refactor subagent tool, fix custom tool discovery, fix JSON mode stdout flush
Breaking changes:
- Custom tools now require index.ts entry point in subdirectory
  (e.g., tools/mytool/index.ts instead of tools/mytool.ts)

Subagent tool improvements:
- Refactored to use Message[] from ai package instead of custom types
- Extracted agent discovery to separate agents.ts module
- Added parallel mode streaming (shows progress from all tasks)
- Added turn count to usage stats footer
- Removed redundant Query section from scout output

Fixes:
- JSON mode stdout flush: Fixed race condition where pi --mode json
  could exit before all output was written, causing consumers to
  miss final events

Also:
- Added signal/timeout support to pi.exec() for custom tools and hooks
- Renamed pi-pods bin to avoid conflict with pi
2025-12-19 04:54:02 +01:00
Mario Zechner
f8b6164ecd Fix Escape key handling for Kitty keyboard protocol
Add isEscape() helper that handles both raw (\x1b) and Kitty protocol
(\x1b[27u) Escape sequences. Update all components that check for
Escape key to use the new helper.
2025-12-19 04:54:02 +01:00
Mario Zechner
bab5cddd4d Add changelog entry and README link for subagent example (#215) 2025-12-19 01:46:33 +01:00
Nico Bailon
eb1d08a5fb
Add subagent orchestration example (#215) 2025-12-19 01:45:18 +01:00
Mario Zechner
774aaadbc0 Simplify getApiKey pass-through, add changelog entry for #223 2025-12-19 01:37:53 +01:00
Mario Zechner
139af12b37 Merge kitty-protocol-support into main 2025-12-19 01:21:47 +01:00
Mario Zechner
b2f29613e8 Add /hotkeys command, Ctrl+D exit, markdown table borders 2025-12-19 01:19:21 +01:00
Mario Zechner
b1be086169 Merge origin/main into kitty-protocol-support 2025-12-19 01:04:34 +01:00
Mario Zechner
c1f2541639
Merge pull request #232 from aliou/fix/symlinked-slash-commands
fix(coding-agent): support symlinked slash commands in discovery
2025-12-19 00:57:11 +01:00
Mario Zechner
e5e7b2a6a0 Improve hooks.md custom tool example with full type guard pattern 2025-12-19 00:51:21 +01:00
Mario Zechner
d353e5e219 Add type guards for tool_result event narrowing
- Export isBashToolResult, isReadToolResult, etc. type guards
- Update hooks.md with type guard usage examples
- Document custom tool handling in hooks.md
2025-12-19 00:48:03 +01:00
Mario Zechner
3d9bad8fb6 Expose full tool result content and details in hook tool_result event
Breaking change: ToolResultEvent now exposes content and typed details
instead of just a result string. Hook handlers returning { result: ... }
must change to { content: [...] }.

- ToolResultEvent is now a discriminated union based on toolName
- Each built-in tool has typed details (BashToolDetails, etc.)
- Export tool details types and TruncationResult
- Update hooks.md documentation

Closes #233
2025-12-19 00:42:08 +01:00
Mario Zechner
05b7b81338 Skills standard compliance
Implement Agent Skills standard (https://agentskills.io/specification):
- Validate name (must match parent dir, lowercase, max 64 chars)
- Validate description (required, max 1024 chars)
- Warn on unknown frontmatter fields
- Warn on name collisions (keep first)
- Change prompt format to XML structure
- Remove {baseDir} placeholder (use relative paths)
- Add tests and update documentation

fixes #231
2025-12-19 00:11:39 +01:00
Aliou Diallo
b9fd912ecf fix(coding-agent): support symlinked slash commands in discovery 2025-12-18 23:57:54 +01:00
Ahmed Kamal
4f2bc9b617 Add Ctrl+D to README keyboard shortcuts 2025-12-18 19:56:23 +02:00
Ahmed Kamal
727a7ab018 Add Ctrl+D to exit when editor is empty
- Add isCtrlD helper to keys.ts
- CustomEditor intercepts Ctrl+D and only triggers callback when editor is empty
- Single Ctrl+D with empty input exits immediately
- Update CHANGELOG to frame as feature (Kitty protocol support) not fix
2025-12-18 19:39:41 +02:00
Ahmed Kamal
c3c2bffc68 Add helper functions for key detection and update usage
- Add isCtrlA/C/E/K/O/P/T/U/W helper functions that check both raw and Kitty formats
- Add isAltBackspace helper function
- Refactor editor.ts, input.ts, select-list.ts to use helper functions
- Refactor custom-editor.ts, session-selector.ts, user-message-selector.ts
- Add CHANGELOG entry for the Shift+Enter fix
2025-12-18 19:29:40 +02:00
Ahmed Kamal
4a4531f887 Add Kitty keyboard protocol support for Shift+Enter and other modifier keys
Enable the Kitty keyboard protocol on terminal start to receive enhanced
key sequences that include modifier information. This fixes Shift+Enter
not working in Ghostty, Kitty, WezTerm, and other modern terminals.

Changes:
- Enable Kitty protocol on start (\x1b[>1u), disable on stop (\x1b[<u)
- Add centralized key definitions in packages/tui/src/keys.ts
- Support both legacy and Kitty sequences for all modifier+key combos:
  - Shift+Enter, Alt+Enter for newlines
  - Shift+Tab for thinking level cycling
  - Ctrl+C, Ctrl+A, Ctrl+E, Ctrl+K, Ctrl+U, Ctrl+W, Ctrl+O, Ctrl+P, Ctrl+T
  - Alt+Backspace for word deletion
- Export Keys constants and helper functions from @mariozechner/pi-tui
2025-12-18 19:20:30 +02:00
Mario Zechner
2f86c8bc3c Release v0.23.4 2025-12-18 16:56:50 +01:00
Mario Zechner
039b3a0845 Merge syntax-highlighting branch: add syntax highlighting and intra-line diff
- Syntax highlighting for markdown code blocks, read/write tool output
- Intra-line diff highlighting for edit tool with word-level inverse
- VS Code-style syntax colors in themes
- Fix Google provider FinishReason handling
- Upgrade @google/genai to 1.34.0
2025-12-18 16:54:10 +01:00