Commit graph

461 commits

Author SHA1 Message Date
Mario Zechner
0397dd44c8 coding-agent: add pi-session- prefix to exported HTML files (#72)
Makes exported session files easier to filter with .gitignore
2025-11-27 23:54:10 +01:00
Mario Zechner
0e95592eb7 Release v0.10.1 2025-11-27 14:18:29 +01:00
Mario Zechner
318254bff4 feat: show git branch in footer
- Footer now displays active git branch after directory path (e.g., ~/project (main))
- Branch detected by reading .git/HEAD directly (fast, synchronous)
- Cache refreshed after each assistant message to detect branch changes
- Handles normal branches, detached HEAD, and non-git repos

Closes #55
2025-11-27 12:56:45 +01:00
Mario Zechner
f95f41b1c4 Add CLI file arguments support via @file prefix
Implements ability to include files directly in the initial message using @ prefix.

Features:
- All @file arguments are coalesced into the first user message
- Text files wrapped in <file name="path">content</file> tags
- Images (.jpg, .jpeg, .png, .gif, .webp) attached as base64-encoded attachments
- Supports ~ expansion, relative and absolute paths
- Empty files are skipped silently
- Non-existent files cause immediate error with clear message
- Works in interactive, --print, and --mode text/json modes
- Not supported in --mode rpc (errors with clear message)

Examples:
  pi @prompt.md @image.png "Do this"
  pi --print @code.ts "Review this code"
  pi @requirements.md @design.png "Implement this"

Closes #54
2025-11-27 12:47:11 +01:00
Mario Zechner
48df1ff259 Improved HTML export with timestamps, better styling, and comprehensive stats
- Added timestamps to each user and assistant message (HH:MM:SS format)
- Fixed text clipping issues with comprehensive word-wrapping CSS
- Improved font selection: ui-monospace, Cascadia Code, Source Code Pro
- Reduced font sizes for more compact display (12px base, down from 14px)
- Added model switch indicators in conversation timeline with subtle background
- Created dedicated Tokens & Cost section showing:
  - Cumulative input/output/cache read/write tokens
  - Cost breakdown by token type with 4 decimal precision
  - Total cost in bold
  - Context usage with token count, percentage, and model identification
- Now displays all unique models used during session (not just initial model)
- Made Messages section more compact (reduced gaps, removed redundant fields)

Closes #51
Closes #52
2025-11-27 12:32:45 +01:00
Mario Zechner
ca0a86b981 Fix editor cursor navigation for wrapped lines, add word navigation
- Up/down arrows now navigate visual (wrapped) lines instead of logical lines
- Fixed double cursor display at wrap boundaries
- Added word by word navigation via Option+Left/Right or Ctrl+Left/Right
- Updated README keyboard shortcuts documentation

Closes #61
2025-11-27 12:08:36 +01:00
Mario Zechner
a59553a881 Fix edit diff line number alignment and whitespace preservation
- Fix line numbers showing incorrect values for edits far from file start
  (e.g., 1,2,3 instead of 336,337,338). Skip count was added after displaying
  lines instead of before.

- Rewrite splitIntoTokensWithAnsi in pi-tui to preserve whitespace as separate
  tokens instead of discarding it. Wrapped lines now maintain proper alignment
  and code indentation.

- Update mom README: rename title, remove em-dashes for cleaner prose
2025-11-27 11:53:00 +01:00
Mario Zechner
932f48b0e9 Release v0.10.0 2025-11-27 01:33:50 +01:00
Mario Zechner
384e4a3a7d feat: fuzzy file search with @ prefix
- Type @ to fuzzy-search files/folders across project
- Respects .gitignore and skips hidden files
- Pure Node.js implementation using readdir with withFileTypes
- No external dependencies (fd/find) required
- Also optimized Tab completion to use withFileTypes instead of statSync

Based on PR #60 by @fightbulc, reimplemented for performance.
2025-11-27 00:59:12 +01:00
Mario Zechner
c2db2f9f4a Merge branch 'main' into pr-60-fuzzy-search 2025-11-27 00:07:48 +01:00
Tino Ehrich
15d5120b6a added support for finding folders as well 2025-11-27 00:06:59 +01:00
Tino Ehrich
b8e5f8db6d feat: Fuzzy search via 2025-11-27 00:06:54 +01:00
Mario Zechner
053800e9f3
Merge pull request #59 from kiliman/kiliman/rpc-attachments
fix: pass attachments to agent prompt from RPC interface
2025-11-26 23:58:51 +01:00
Mario Zechner
e7c48e33a2 fix: emoji text wrapping crash in pi-tui
Fixed crash when rendering text containing emojis followed by long content.
The breakLongWord function was iterating over UTF-16 code units instead of
grapheme clusters, causing emojis (surrogate pairs) to be miscounted during
line wrapping. Now uses Intl.Segmenter to properly handle multi-codepoint
characters.
2025-11-26 23:55:01 +01:00
Mario Zechner
5b940c2686 docs: clarify that AGENTS.md files are loaded at every startup
Removed confusing parenthetical that suggested context files aren't loaded when continuing/resuming sessions. They are always freshly loaded from disk at startup - the parenthetical only applied to console logging behavior.
2025-11-26 23:41:52 +01:00
kiliman
958d265112 fix: pass attachments to agent prompt from RPC interface
This PR updates the call to `agent.prompt` with the `attachments` prop provided in the JSON input.
2025-11-25 21:56:32 -05:00
Mario Zechner
a484330cd1 v0.9.4: Mom Slack bot with Docker sandbox 2025-11-26 01:50:28 +01:00
Mario Zechner
b42df6848c Add $ prefix to cost in footer
Fixes #53
2025-11-25 21:32:52 +01:00
Mario Zechner
0148f0ac3d v0.9.3: Added Anthropic Claude Opus 4.5 support 2025-11-24 21:03:32 +01:00
Mario Zechner
52325adb97 Release v0.9.2 2025-11-24 19:32:55 +01:00
Mario Zechner
e1856daf57 fix: rename pi-agent to pi-agent-core (npm deprecation issue) 2025-11-21 22:20:43 +01:00
Mario Zechner
56450a4f19 fix(coding-agent): suppress informational output in non-interactive modes
In -p, --mode json, and --mode rpc modes, don't print informational
messages like 'Loaded project context from:' or model restore messages.
Only the actual output should be printed.
2025-11-21 22:07:17 +01:00
Mario Zechner
b49a017c55 Release v0.9.0 2025-11-21 21:58:12 +01:00
Mario Zechner
e89e657045 feat(coding-agent): allow starting CLI with prompt in interactive mode (#46)
BREAKING CHANGE: Passing a prompt on the command line now starts interactive
mode with the prompt pre-submitted, instead of exiting after completion.
Use --print or -p to get the previous non-interactive behavior.

- Add --print / -p flag for non-interactive mode
- Update runInteractiveMode to accept initial messages
- Update README documentation
- Fix Model Selection Priority docs to include --models scope
2025-11-21 21:57:35 +01:00
Mario Zechner
3018b01460 Fix slash command autocomplete Enter behavior
When pressing Enter on a highlighted slash command suggestion (e.g., typing
`/mod` with `/model` highlighted), the completion is now applied before
submitting. Previously, the partial text was submitted instead of the
selected command.

Fixes #49
2025-11-21 21:50:19 +01:00
Mario Zechner
ba8c073ed2 feat: enhance model cycling with thinking levels and --thinking flag
PR #47 enhancements:
- Add thinking level syntax to --models (e.g., --models sonnet:high,haiku:low)
- First model in scope used as initial model when starting new session
- Auto-apply thinking level when cycling models with Ctrl+P
- Save both model and thinking to session AND settings for persistence
- Simplify UX by removing autoThinkingDisabled flag
- Fix model matching to prioritize exact matches over partial
- Support provider/modelId format (e.g., openrouter/openai/gpt-5.1-codex)

Issue #45:
- Add --thinking CLI flag to set thinking level directly
- Takes highest priority over all other thinking level sources

Closes #45
2025-11-21 21:32:30 +01:00
Mario Zechner
df3af27288 Merge remote-tracking branch 'origin/main' into feat/model-cycling-enhancements 2025-11-21 21:16:05 +01:00
Mario Zechner
1b6a70ccb1 feat: add /clear command to reset context and start fresh session 2025-11-21 20:59:00 +01:00
Mario Zechner
59af0fd53a fix: markdown link rendering for links with identical text and href 2025-11-21 20:14:32 +01:00
Mario Zechner
38524ea900 Release v0.8.5 2025-11-21 12:48:18 +01:00
Mario Zechner
1d8bc9d6eb Fix path completion hanging and autocomplete arrow key behavior
- Fixed catastrophic regex backtracking in extractPathPrefix that caused
  terminal to hang when text contained many / characters (e.g., URLs).
  Replaced complex regex with simple lastIndexOf approach. (#18)
- Fixed arrow keys moving both autocomplete selection and editor cursor
  by adding missing return statement after handling arrow keys in
  autocomplete mode.

Closes #18
2025-11-21 12:47:23 +01:00
Tino Ehrich
ea4e234f66 feat: enhance model cycling with thinking level support
- Add exact match support with '/' prefix (/gpt-5.1-codex or /provider/model)
- Prefer exact ID matches over partial matches in fuzzy search
- Parse thinking levels from --models flag (pattern:level format)
- Use first scoped model as initial model with its thinking level
- Auto-apply thinking when cycling with Ctrl+P
- Track manual thinking changes to disable auto-switching
- Clear model scope when using /model command
- Support mixed configs: --models sonnet:high,haiku,opus:low
- Silently ignore thinking for models that don't support it
- Only allow Ctrl+P cycling when --models is explicitly provided
- Update help text with examples
- Improve code organization by resolving scope early
2025-11-21 12:02:56 +01:00
Mario Zechner
e7a5ca144c Release v0.8.4 2025-11-21 05:09:58 +01:00
Mario Zechner
aa46dfecd4 Release v0.8.3 2025-11-21 04:57:24 +01:00
Mario Zechner
85adcf22bf Release v0.8.0 2025-11-21 03:12:42 +01:00
Mario Zechner
cc88095140 WIP: Add theming system with /theme command
- Consolidated theme system into single src/theme/ directory
- Created Theme class with fg(), bg(), bold(), italic(), underline()
- Added dark and light built-in themes with 36 color tokens
- Support for custom themes in ~/.pi/agent/themes/*.json
- JSON schema for theme validation
- Theme selector UI with /theme command
- Save theme preference to settings
- Uses chalk for text formatting to preserve colors

TODO:
- Replace hardcoded colors throughout TUI components
- Apply markdown theming to Markdown components
- Add theme support to all TUI elements
2025-11-20 23:16:59 +01:00
Mario Zechner
93a60b7969 Downgrade Biome to 2.3.5 to fix false positive noUnusedPrivateClassMembers warnings 2025-11-20 22:32:45 +01:00
Mario Zechner
c7d00e6ba4 Updated README.md 2025-11-20 21:17:32 +01:00
Mario Zechner
ba5bf54af4 Release v0.7.29
- Show offset/limit in read tool display (e.g., read src/main.ts:100-200)
- Fix PI_CODING_AGENT_DIR env var name in help and code
- Add all API key env vars to help text
2025-11-20 20:48:25 +01:00
Mario Zechner
d44073b140 Release v0.7.28
- Add message queuing with configurable modes (one-at-a-time/all) (#15)
- Add /queue command to select queue mode
- Add TruncatedText component for proper viewport-aware text truncation
- Queue mode setting persists in ~/.pi/agent/settings.json
- Visual feedback for queued messages with proper ANSI handling
- Press Escape to abort and restore queued messages to editor
2025-11-20 20:39:43 +01:00
Mario Zechner
e694d435fd Release v0.7.27
- Fix slash command submission requiring two Enter presses (#30)
- Fix slash command autocomplete not re-triggering after typos (#29)
2025-11-20 18:56:27 +01:00
Mario Zechner
11aa39c5e4 Release v0.7.26 2025-11-20 17:29:24 +01:00
Mario Zechner
de39f1f493 Add custom headers support for models.json
Fixes #39

- Added headers field to Model type (provider and model level)
- Model headers override provider headers when merged
- Supported in all APIs:
  - Anthropic: defaultHeaders
  - OpenAI (completions/responses): defaultHeaders
  - Google: httpOptions.headers
- Enables bypassing Cloudflare bot detection for proxied endpoints
- Updated documentation with examples

Also fixed:
- Mistral/Chutes syntax error (iif -> if)
- process.env.ANTHROPIC_API_KEY bug (use delete instead of = undefined)
2025-11-20 17:05:31 +01:00
Mario Zechner
4ccc7d47e0 Release v0.7.25 2025-11-20 13:41:38 +01:00
Mario Zechner
9555b75674 Add PR and contributor credits to CHANGELOG 2025-11-20 13:41:19 +01:00
Mario Zechner
a1215fc32c Add table of contents to README 2025-11-20 13:20:48 +01:00
Mario Zechner
ee5228becf Fix help text to use 'pi' instead of 'coding-agent' 2025-11-20 13:00:38 +01:00
Mario Zechner
95247a3e5e Add documentation for model cycling feature 2025-11-20 12:58:31 +01:00
Mario Zechner
fecf9734b0 Add --models parameter for quick model cycling with Ctrl+P
- Add --models CLI arg accepting comma-separated patterns
- Implement smart matching: prefers aliases over dated versions
- Add Ctrl+P to cycle through scoped models (or all if no scope)
- Show model scope hint at startup
- Update help text with examples

Co-authored-by: Tino Ehrich <tino.ehrich@hey.com>
2025-11-20 12:57:20 +01:00
Mario Zechner
097ff25ed4 Release v0.7.24 2025-11-20 12:41:00 +01:00