Commit Graph

716 Commits

Author SHA1 Message Date
Mario Zechner 58828adf76 Reorganize file structure: core/, utils/, modes/interactive/components/, modes/interactive/theme/ 2025-12-09 00:51:33 +01:00
Mario Zechner c84dd8379f WP16: Update main-new.ts to use InteractiveMode 2025-12-09 00:36:16 +01:00
Mario Zechner 6e7fd1765a WP15: Create InteractiveMode using AgentSession 2025-12-09 00:34:44 +01:00
Mario Zechner ab26f1a25d WP14: Create main-new.ts and cli-new.ts using AgentSession and new modes 2025-12-09 00:21:18 +01:00
Mario Zechner 5b82995085 WP13: Create modes/index.ts barrel export 2025-12-09 00:16:46 +01:00
Mario Zechner 60ff1508e4 WP12: Create rpc-mode.ts 2025-12-09 00:16:17 +01:00
Mario Zechner d53624b8a3 WP11: Create print-mode.ts 2025-12-09 00:15:37 +01:00
Mario Zechner 99402aed21 WP9+WP10: Add AgentSession session management and utility methods 2025-12-09 00:14:47 +01:00
Mario Zechner 3cdbb02dc8 WP8: Add AgentSession bash execution 2025-12-09 00:13:10 +01:00
Mario Zechner 4a5eeb99aa WP7: Add AgentSession compaction (manual + auto), fix listener preservation 2025-12-09 00:12:07 +01:00
Mario Zechner d11c257490 WP5+WP6: Add AgentSession model, thinking level, and queue mode management 2025-12-09 00:08:36 +01:00
Mario Zechner 7d305e1e00 WP4: Add AgentSession prompting methods (prompt, queue, abort, reset) 2025-12-09 00:07:24 +01:00
Mario Zechner 314f3ddb86 WP3: Add AgentSession event subscription with session persistence 2025-12-09 00:05:54 +01:00
Mario Zechner ce5e888778 WP2: Create AgentSession basic structure + update plan for keep-old-code strategy 2025-12-09 00:05:06 +01:00
Mario Zechner ed81d2ac56 WP1: Create bash-executor.ts with unified bash execution 2025-12-09 00:01:36 +01:00
Mario Zechner 77d6b1457b Add queue mode to AgentSession API, clarify setters vs getters 2025-12-08 23:57:56 +01:00
Mario Zechner 2894b411b1 Fix: use AppMessage[] instead of Message[] in AgentSession 2025-12-08 23:56:08 +01:00
Mario Zechner 862cd3b592 Add refactoring plan for coding-agent 2025-12-08 23:54:41 +01:00
Markus Ylisiurunen aaafc8627d use only model id for fuzzy filtering in model selector (#151) 2025-12-08 23:35:31 +01:00
Mario Zechner 628ead2485 Release v0.14.2 2025-12-08 23:29:05 +01:00
Mario Zechner 5677715707 Fix crash when bash mode outputs binary data
Sanitize shell output by removing Unicode Format characters and lone
surrogates that crash string-width. This fixes crashes when running
commands like curl that download binary files.
2025-12-08 23:26:58 +01:00
Mario Zechner 9b2369e096 Release v0.14.1 2025-12-08 22:59:46 +01:00
Mario Zechner c6fd9eeeaa Fix tsgo type issues: update tsgo, fix ReasoningEffort import, remove broken enum-test 2025-12-08 22:59:13 +01:00
Mario Zechner 0b793ea451 Release v0.14.0 2025-12-08 22:51:29 +01:00
Mario Zechner 7ca9581e60 Merge branch 'bash-mode' 2025-12-08 22:49:28 +01:00
Mario Zechner a4c6b47f85 Add green borders around bash execution component 2025-12-08 22:45:05 +01:00
Mario Zechner 570ebebbc3 Add bash mode for executing shell commands
- Add ! prefix in TUI editor to execute shell commands directly
- Output streams in real-time and is added to LLM context
- Supports multiline commands, cancellation (Escape), truncation
- Preview mode shows last 20 lines, Ctrl+O expands full output
- Commands persist in session history as bashExecution messages
- Add bash command to RPC mode via {type:'bash',command:'...'}
- Add RPC tests for bash command execution and context inclusion
- Update docs: rpc.md, session.md, README.md, CHANGELOG.md

Closes #112

Co-authored-by: Markus Ylisiurunen <markus.ylisiurunen@gmail.com>
2025-12-08 22:40:32 +01:00
Mario Zechner 69bce12613 Merge main into bash-mode 2025-12-08 21:39:01 +01:00
Tiago Freitas e50368aac2 fix: include empty tools param when conversation has tool history (#150)
Anthropic (via LiteLLM/proxy) requires the `tools` parameter to be
present when messages include tool_calls or tool role messages,
even if no tools are currently being provided.

This adds a `hasToolHistory()` helper to detect if the conversation
contains tool calls or tool results, and ensures `tools: []` is
included in the request params when needed.

Fixes #149

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Ubuntu <ubuntu@ip-172-31-50-87.us-west-2.compute.internal>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 21:30:43 +01:00
Mario Zechner 18df11d10e Add xhigh thinking level for OpenAI codex-max models
- Add 'xhigh' to ThinkingLevel type in ai and agent packages
- Map xhigh to reasoning_effort: 'max' for OpenAI providers
- Add thinkingXhigh color token to theme schema and built-in themes
- Show xhigh option only when using codex-max models
- Update CHANGELOG for both ai and coding-agent packages

closes #143
2025-12-08 21:12:54 +01:00
Mario Zechner ed22731d93 Add OpenAICompat for openai-completions provider quirks
Fixes #133
2025-12-08 19:02:03 +01:00
Mario Zechner e45b0868e0 Merge PR #137: Remove provider-level tool validation 2025-12-08 18:06:50 +01:00
Mario Zechner 83f099f282 Remove provider-level tool validation, add validateToolCall helper 2025-12-08 18:04:33 +01:00
Markus Ylisiurunen 1f33526e79 add option to skip provider tool call validation 2025-12-07 17:24:06 +02:00
Nico Bailon 1d03dfbdf4 Fix truncation test assertions to match new message format (#136) 2025-12-07 12:07:15 +01:00
Mario Zechner 788158525c Release v0.13.2 2025-12-07 01:25:17 +01:00
Mario Zechner 84878657af Add changelog entry for tool output truncation (#134) 2025-12-07 01:24:41 +01:00
Mario Zechner 8158b6fa0e Restore TUI warning notices for truncated tool output
Warnings now shown at bottom of tool execution (outside collapsed area)
so users can see truncation occurred even when content is collapsed.
2025-12-07 01:14:57 +01:00
Mario Zechner 62f1c815de Implement tool result truncation with actionable notices (#134)
- read: actionable notices with offset for continuation
  - First line > 30KB: return empty + bash command suggestion
  - Hit limit: '[Showing lines X-Y of Z. Use offset=N to continue]'

- bash: tail truncation with temp file
  - Notice includes line range + temp file path
  - Edge case: last line > 30KB shows partial

- grep: pre-truncate match lines to 500 chars
  - '[... truncated]' suffix on long lines
  - Notice for match limit and line truncation

- find/ls: result/entry limit notices
  - '[N results limit reached. Use limit=M for more]'

- All notices now in text content (LLM sees them)
- TUI simplified (notices render as part of output)
- Never return partial lines (except bash edge case)
2025-12-07 01:11:31 +01:00
Mario Zechner ceb79820fe Add tool output truncation with line/byte limits
- Add truncate.ts utility with truncateHead/truncateTail functions
- Both respect 2000 line and 30KB limits (whichever hits first)
- read: head truncation, returns truncation info in details
- bash: tail truncation, writes full output to temp file if large
- grep: head truncation + 100 match limit
- find: head truncation + 1000 result limit
- ls: head truncation + 500 entry limit
- tool-execution.ts displays truncation notices in warning color
- All tools return clean output + structured truncation in details
2025-12-07 00:03:16 +01:00
Mario Zechner 159a6e7df6 Release v0.13.1 2025-12-06 23:12:36 +01:00
Mario Zechner 97ca6ccf65 Add [Unreleased] section to CHANGELOG 2025-12-06 22:49:45 +01:00
Mario Zechner 30cc0005e9 Release v0.13.0 2025-12-06 22:48:39 +01:00
Mario Zechner 92c654a872 Add totalTokens field to Usage type
- Added totalTokens field to Usage interface in pi-ai
- Anthropic: computed as input + output + cacheRead + cacheWrite
- OpenAI/Google: uses native total_tokens/totalTokenCount
- Fixed openai-completions to compute totalTokens when reasoning tokens present
- Updated calculateContextTokens() to use totalTokens field
- Added comprehensive test covering 13 providers

fixes #130
2025-12-06 22:46:02 +01:00
badlogic 6c1b4ceac2 Fix Windows binary detection for Bun compiled executables
- Updated isBunBinary detection to check for %7EBUN (URL-encoded ~BUN)
- Simplified build:binary script to remove Unix-specific shell syntax
- Binary now correctly locates supporting files next to executable on Windows
2025-12-06 22:42:47 +01:00
Mario Zechner ba06412933 Release v0.12.15 2025-12-06 21:29:03 +01:00
Mario Zechner 4c95e53dc2 Fix editor crash with wide characters (emojis, CJK)
Editor text wrapping now uses grapheme-aware width calculation instead
of string length. Fixes crash when pasting text containing emojis like
✅ or CJK characters that are 2 terminal columns wide.
2025-12-06 21:24:26 +01:00
Mario Zechner 0c4d9bc2fd Add context overflow detection utilities
Extract overflow detection logic into reusable utilities:
- isContextOverflowError() to detect overflow from error messages
- isContextOverflowFromUsage() to detect overflow from token usage
- Patterns for Anthropic, OpenAI, Google, xAI, Groq, OpenRouter, llama.cpp, LM Studio

Fixes #129
2025-12-06 21:24:15 +01:00
Mario Zechner 80a2667606 docs: add under-compaction analysis
Documents context window overflow scenarios, how OpenCode and Codex
handle them, and what fixes are needed.

Related to #128
2025-12-06 14:53:05 +01:00
Peter Steinberger 4d3dfe62ae docs: fix mini-lit links (#123) 2025-12-06 09:56:31 +01:00