Commit graph

33 commits

Author SHA1 Message Date
Mario Zechner
b3d4478b61 Release v0.7.23 2025-11-20 11:59:17 +01:00
Mario Zechner
22d8a0ae4a Release v0.7.18 2025-11-18 22:08:44 +01:00
Mario Zechner
587d7c39a4 feat(coding-agent): add OAuth authentication for Claude Pro/Max
- Add /login and /logout commands for OAuth flow
- OAuth tokens stored in ~/.pi/agent/oauth.json with 0600 permissions
- Auto-refresh tokens when expired (5min buffer)
- Priority: OAuth > ANTHROPIC_OAUTH_TOKEN env > ANTHROPIC_API_KEY env
- Fix model selector async loading and re-render
- Add bracketed paste support to Input component for long codes
- Update README.md with OAuth documentation
- Add implementation docs and testing checklist
2025-11-18 17:33:33 +01:00
Mario Zechner
6680034a64 Release v0.7.16 2025-11-17 14:12:04 +01:00
Mario Zechner
0c5cbd0068 v0.7.12: Custom models/providers support via models.json
- Add ~/.pi/agent/models.json config for custom providers (Ollama, vLLM, etc.)
- Support all 4 API types (openai-completions, openai-responses, anthropic-messages, google-generative-ai)
- Live reload models.json on /model selector open
- Smart model defaults per provider (claude-sonnet-4-5, gpt-5.1-codex, etc.)
- Graceful session fallback when saved model missing or no API key
- Validation errors show precise file/field info in CLI and TUI
- Agent knows its own README.md path for self-documentation
- Added gpt-5.1-codex (400k context, 128k output, reasoning)

Fixes #21
2025-11-16 22:56:24 +01:00
Mario Zechner
8ae236f956 Add /branch command for conversation branching (fixes #16)
- Add /branch slash command to create conversation branches
- New UserMessageSelectorComponent shows all user messages chronologically
- Selecting a message creates new session with messages before selection
- Selected message is placed in editor for modification/resubmission
- SessionManager.createBranchedSession() creates new session files
- Updated README.md and CHANGELOG.md with /branch documentation
2025-11-14 23:52:46 +01:00
Mario Zechner
bc01ed5eb6 Document npm run dev for watch mode development 2025-11-13 23:42:04 +01:00
Mario Zechner
bc670bc63c Fix lockstep versioning and improve documentation
- Sync all packages to version 0.7.7
- Rewrite sync-versions.js to handle ALL inter-package dependencies automatically
- Fix web-ui dependency on pi-ai (was 0.6.0, now 0.7.7)
- Move agent fix changelog entry to coding-agent CHANGELOG
- Remove redundant agent CHANGELOG.md
- Improve README.md with clearer lockstep versioning docs
- Add /changelog command to display full changelog in TUI (newest last)
- Fix changelog description (not a scrollable viewer, just displays in chat)
- Update CHANGELOG for 0.7.7 release
2025-11-13 23:37:43 +01:00
Mario Zechner
b49ac57d59 Fix changelog spacing. 2025-11-13 21:59:03 +01:00
Mario Zechner
fede1303b1 Fix AGENTS.md support, changelog viewer, and session model storage
- BREAKING: Renamed AGENT.md to AGENTS.md for project context files
- Added automatic changelog viewer on startup for new sessions
- Added settings manager to track last shown changelog version
- BREAKING: Store provider and modelId separately in session files (fixes #4)
- Fixed markdown list rendering when items contain inline code with cyan formatting
- Added dynamic border component for TUI
- Updated changelog with entries for #4 and #5
2025-11-13 21:56:58 +01:00
Mario Zechner
c82f9f4f8c Add settings manager, show changelog on startup if not shown yet. 2025-11-13 21:19:57 +01:00
Mario Zechner
97ac82312f fix: update footer state when rendering initial messages on resume/continue 2025-11-13 00:58:20 +01:00
Mario Zechner
383b67b5c0 feat: add tool call and result counts to /session command 2025-11-13 00:02:24 +01:00
Mario Zechner
5ba2109da8 feat: add /session command to show session info and stats
- Shows session file path and ID
- Displays message counts (user, assistant, total)
- Shows token usage (input, output, cache read/write, total)
- Displays total cost if available
- Reuses same calculation logic as footer component
2025-11-12 22:29:55 +01:00
Mario Zechner
2509add9bf fix: don't clear loading animation when Ctrl+C clears editor
- Remove statusContainer.clear() from clearEditor()
- Loading animation should only be removed when agent finishes
- Ctrl+C once should only clear editor text, not status
2025-11-12 22:23:21 +01:00
Mario Zechner
c75f53f6f2 Improve edit tool diff display with context-aware rendering
- Add generateDiffString() function in edit tool to create unified diffs with line numbers and 4 lines of context
- Store only the formatted diff string in tool result details instead of full file contents
- Update tool-execution renderer to parse and colorize the diff string
- Filter out message_update events from session saving to prevent verbose session files
- Add markdown nested list and table rendering tests
2025-11-12 20:09:11 +01:00
Mario Zechner
bb0b77af16 Match export output style to thinking level display
Changed export success/error messages to match the style used for thinking level changes:
- Use Spacer(1) instead of empty Text for proper blank line spacing
- Use chalk.dim() for success message instead of chalk.green()
- Add left padding (1, 0) to match other system messages
- Removed checkmark/x symbols for cleaner look

Now "Session exported to: filename.html" appears dimmed with proper spacing, just like "Thinking level: off"
2025-11-12 16:45:51 +01:00
Mario Zechner
e467a80b5b Add /export command to export sessions as self-contained HTML
- Add exportSessionToHtml function that generates beautifully formatted HTML exports
- HTML includes session metadata, all messages, tool calls, tool results, thinking blocks, and images
- Support for ANSI color codes in tool output (converted to HTML)
- Self-contained with inline CSS (dark theme, responsive design, print-friendly)
- Add /export slash command to TUI with optional filename parameter
- Add agent and coding-agent to dev script for watch mode
- Increment coding-agent version to 0.6.1

Usage: /export [optional-filename.html]
2025-11-12 16:21:59 +01:00
Mario Zechner
84dcab219b Add image support in tool results across all providers
Tool results now use content blocks and can include both text and images.
All providers (Anthropic, Google, OpenAI Completions, OpenAI Responses)
correctly pass images from tool results to LLMs.

- Update ToolResultMessage type to use content blocks
- Add placeholder text for image-only tool results in Google/Anthropic
- OpenAI providers send tool result + follow-up user message with images
- Fix Anthropic JSON parsing for empty tool arguments
- Add comprehensive tests for image-only and text+image tool results
- Update README with tool result content blocks API
2025-11-12 10:45:56 +01:00
Mario Zechner
95d040195c Add model selector TUI and update session management 2025-11-12 01:01:23 +01:00
Mario Zechner
bf5f4b17c0 Add custom session events for thinking level and model changes
Session manager changes:
- Add ThinkingLevelChangeEntry and ModelChangeEntry types
- Add saveThinkingLevelChange() and saveModelChange() methods
- Update loadThinkingLevel() to also check for thinking_level_change events
  (not just session headers)

TUI changes:
- Pass SessionManager to TuiRenderer constructor
- Call saveThinkingLevelChange() when user changes thinking level via /thinking
- Store session manager as instance variable for future use

This ensures thinking level changes during a session are persisted
and correctly restored on --continue.
2025-11-11 23:56:08 +01:00
Mario Zechner
dbee5b69ec Show "Aborted" text when aborting text generation during streaming
Update streaming component with final message in message_end event.
The final message includes the stopReason, which allows the component
to render "Aborted" text for aborted text generation.

Now behavior is consistent:
- Abort during text generation (no tool calls) → shows red "Aborted"
- Abort during tool call streaming → tool components turn red
2025-11-11 23:41:05 +01:00
Mario Zechner
1e857e0a6a Fix aborted tool display when continuing sessions
Two fixes for rendering aborted tools in --continue mode:

1. In renderInitialMessages: Check if assistant message was aborted/errored
   and immediately mark tool execution components as failed instead of
   leaving them in pending state.

2. In AssistantMessageComponent: Don't show "Aborted" text when there are
   tool calls in the message, since the tool execution components will
   show the error state themselves. This prevents duplicate error messages.

Now aborted tools show properly as red with "Operation aborted" message,
without the duplicate "Aborted" text above them.
2025-11-11 23:39:00 +01:00
Mario Zechner
2fdd304fbf Mark pending tool components as aborted when streaming is interrupted
When user presses Esc during tool argument streaming, the assistant
message ends with stopReason="aborted" but tool execution never starts.
Now we check for aborted/error stopReasons in message_end and update
all pending tool execution components to show red error state with
"Operation aborted" message.

This fixes the issue where tool components stayed stuck in blue/pending
state after aborting during JSON streaming.
2025-11-11 23:37:05 +01:00
Mario Zechner
7beb354337 Add thinking level persistence and fix UI issues
- Save and restore thinking level when continuing sessions
- Fix thinking level confirmation message spacing and styling
- Fix thinking text wrapping to preserve ANSI formatting across lines
2025-11-11 23:18:40 +01:00
Mario Zechner
159075cad7 Improve tool execution rendering and error handling
- Show tool execution components immediately when tool calls appear in streaming
- Update components with streaming arguments as they come in
- Handle incomplete/partial arguments gracefully with optional chaining
- Fix error handling: tools now throw exceptions instead of returning error messages
- Fix bash abort handling to properly reject on abort/timeout
- Clean up error display
2025-11-11 23:05:58 +01:00
Mario Zechner
3fcae75e93 Remove StreamingMessageComponent - just use AssistantMessageComponent
- StreamingMessageComponent was just a wrapper around AssistantMessageComponent
- AssistantMessageComponent now handles its own stats rendering
- Made AssistantMessageComponent updatable with updateContent()
- Removed duplicate stats handling code from tui-renderer
- All stats are now managed by the component itself
2025-11-11 22:04:42 +01:00
Mario Zechner
741add4411 Refactor TUI into proper components
- Create UserMessageComponent - handles user messages with spacing
- Create AssistantMessageComponent - handles complete assistant messages
- Create ThinkingSelectorComponent - wraps selector with borders
- Add setSelectedIndex to SelectList for preselecting current level
- Simplify tui-renderer by using dedicated components
- Much cleaner architecture - each message type is now a component
2025-11-11 21:55:29 +01:00
Mario Zechner
e2649341f0 Simplify assistant message spacing - just add spacer to components 2025-11-11 21:51:12 +01:00
Mario Zechner
f5176bb173 Fix double spacing before tool executions by removing bottom padding from assistant Markdown 2025-11-11 21:43:53 +01:00
Mario Zechner
f63ec78524 Add spacer above user messages (except first one) 2025-11-11 21:39:42 +01:00
Mario Zechner
5d7bc60cff Replace Markdown with Text component for tool execution
- Add background color support to Text component
- Replace Markdown component with Text in ToolExecutionComponent
- Use chalk.bold for formatting instead of markdown syntax
- Remove unnecessary markdown parsing overhead
2025-11-11 21:27:23 +01:00
Mario Zechner
4fa09814bd Refactor TUI components into separate files
- Move TUI components into src/tui/ folder
- Split out CustomEditor, StreamingMessageComponent, ToolExecutionComponent, FooterComponent
- Trim assistant message text content
- Add newline after per-message token/cost stats
- Improve code organization and maintainability
2025-11-11 21:16:31 +01:00
Renamed from packages/coding-agent/src/tui-renderer.ts (Browse further)