Commit Graph

542 Commits

Author SHA1 Message Date
Mario Zechner 8849bfbcd7 Fix footer overflow on narrow terminals, add /arminsayshi easter egg 2025-12-19 21:35:09 +01:00
Mario Zechner 9b6a79fd8a Release v0.24.2 2025-12-19 21:12:53 +01:00
Mario Zechner cd5ffcfac9 Add [Unreleased] section to changelog 2025-12-19 20:52:44 +01:00
Mario Zechner 783e39fd65 Release v0.24.1 2025-12-19 20:51:44 +01:00
Mario Zechner 51a1c0e60c 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 fc80319a85 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 390003f72d 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 c0f70993ee 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 85350f5e9c 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 6115cd5518 Wrap custom tools with hooks (#248) 2025-12-19 19:05:20 +01:00
Aliou Diallo 6ea1b852fe fix(coding-agent): properly cleanup terminal on Ctrl+C in session selector (#247) 2025-12-19 19:04:00 +01:00
Aliou Diallo ac79df0423 fix(coding-agent): handle OpenRouter models with colons in IDs (#242) 2025-12-19 15:26:12 +01:00
Aliou Diallo aa1e1bbc49 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 cb3e67f764 Forward onUpdate callback through hook wrapper (#238) 2025-12-19 15:23:41 +01:00
Mario Zechner 3df5f025ef Release v0.24.0 2025-12-19 05:21:25 +01:00
Mario Zechner c8b9b6ecf6 Release v0.23.5 2025-12-19 05:15:34 +01:00
Mario Zechner 8fb3857cfc Update changelog with getMarkdownTheme export and subagent improvements 2025-12-19 04:54:02 +01:00
Mario Zechner 091343c23e Update custom tools README for subdirectory/index.ts structure 2025-12-19 04:54:02 +01:00
Mario Zechner 2fa6219ae3 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 baad28f6de 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 d7d3a23857 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 7f0cde9641 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 7b1b989b21 Add changelog entry and README link for subagent example (#215) 2025-12-19 01:46:33 +01:00
Nico Bailon 73cbcd3fbb Add subagent orchestration example (#215) 2025-12-19 01:45:18 +01:00
Mario Zechner 794302831b Simplify getApiKey pass-through, add changelog entry for #223 2025-12-19 01:37:53 +01:00
Mario Zechner fffae17bc3 Merge kitty-protocol-support into main 2025-12-19 01:21:47 +01:00
Mario Zechner 2b39eeeeab Add /hotkeys command, Ctrl+D exit, markdown table borders 2025-12-19 01:19:21 +01:00
Mario Zechner 0ac493a4fe Merge origin/main into kitty-protocol-support 2025-12-19 01:04:34 +01:00
Mario Zechner cb7b5438b5 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 90e1dc6097 Improve hooks.md custom tool example with full type guard pattern 2025-12-19 00:51:21 +01:00
Mario Zechner 04e1d8e2fe 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 28db028c43 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 2ce98b36a9 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 cdacfd6a7d fix(coding-agent): support symlinked slash commands in discovery 2025-12-18 23:57:54 +01:00
Ahmed Kamal 84272c7cc7 Add Ctrl+D to README keyboard shortcuts 2025-12-18 19:56:23 +02:00
Ahmed Kamal f9c1a14919 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 e48a1eaa18 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 1aa9eeff46 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 372bed5615 Release v0.23.4 2025-12-18 16:56:50 +01:00
Mario Zechner 1edc8b6391 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
Mario Zechner cb77c8f60e Add intra-line diff highlighting for edit tool
- Extract diff rendering to dedicated diff.ts component
- Show word-level changes with inverse highlighting when a single line is modified
- Use diffWords for cleaner token grouping (includes adjacent whitespace)
- Only apply intra-line diff when exactly 1 removed and 1 added line (true modification)
- Multi-line changes show all removed then all added without incorrect pairing
- Add theme.inverse() method for inverse text styling
2025-12-18 16:49:44 +01:00
Mario Zechner 03c1c5d88f Syntax highlighting improvements
- Fix cli-highlight import (use static import instead of dynamic require)
- Add syntax highlighting to read/write tool output
- Update dark/light themes with VS Code default syntax colors
- Add highlightCode and getLanguageFromPath exports
- Upgrade @google/genai to 1.34.0 for IMAGE_RECITATION/IMAGE_OTHER FinishReason
- Add AGENTS.md rule: never downgrade code to fix type errors from outdated deps
2025-12-18 16:01:01 +01:00
Mario Zechner 1970975770 Add changelog entries for Google baseUrl fix (#216, #221) 2025-12-18 15:40:34 +01:00
Mario Zechner ee700034e0 Switch to more stable, oldder tsgo, switch all check scripts to tsgo 2025-12-18 15:20:41 +01:00
Mario Zechner 7956526d73 Add changelog entries for Gemini tool result format fix (#213, #220) 2025-12-18 15:10:54 +01:00
Aliou Diallo 916d0fd68d fix(coding-agent): support symlinked tools and hooks in discovery (#219) 2025-12-18 13:07:30 +01:00
Sergii Kozak d8a28b86f1 Add syntax highlighting to markdown code blocks 2025-12-17 20:15:44 -08:00
Mario Zechner f55fbc4f52 Update coding-agent DEVELOPMENT.md to reflect current codebase
- Fix external dependency name (pi-agent-core -> pi-agent)
- Add missing files: hooks/, custom-tools/, skills.ts, github-copilot.ts
- Update components list with all 18 current components
- Add Key Abstractions sections for hooks, custom tools, skills
- Add 'Adding a New Hook Event' to development guide
- Move config.ts to correct location in directory tree
2025-12-17 22:41:17 +01:00
Mario Zechner c4129699fa Add Unreleased section to CHANGELOG 2025-12-17 22:31:18 +01:00
Mario Zechner 93542615f7 Release v0.23.3 2025-12-17 22:29:46 +01:00