Commit graph

5 commits

Author SHA1 Message Date
Mario Zechner
83a6c26969 Reorganize file structure: core/, utils/, modes/interactive/components/, modes/interactive/theme/ 2025-12-09 00:51:33 +01:00
Mario Zechner
bd0d0676d4 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
86e5a70ec4 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
Mario Zechner
547dcf0e4a fix(coding-agent): update compaction test to match actual summary prefix 2025-12-04 12:29:14 +01:00
Mario Zechner
6c2360af28 WIP: Context compaction core logic (#92)
- Add CompactionEntry type with firstKeptEntryIndex
- Add loadSessionFromEntries() for compaction-aware loading
- Add compact() function that returns CompactionEntry
- Add token calculation and cut point detection
- Add tests with real session fixture and LLM integration

Still TODO: settings, /compact and /autocompact commands, auto-trigger in TUI, /branch rework
2025-12-04 00:07:53 +01:00