Commit graph

385 commits

Author SHA1 Message Date
Mario Zechner
70b84532bb Update RPC example to use RpcClient 2025-12-09 14:44:13 +01:00
Mario Zechner
3c8ab0280e Add get_messages RPC command 2025-12-09 14:37:16 +01:00
Mario Zechner
2b0aa5ed8e Fix agent event ordering: update state before emitting events
Previously, Agent.emit() was called before state was updated (e.g., appendMessage).
This meant event handlers saw stale state - when message_end fired,
agent.state.messages didn't include the message yet.

Now state is updated first, then events are emitted, so handlers see
consistent state that matches the event.
2025-12-09 14:33:39 +01:00
Mario Zechner
3559a43ba0 Rewrite RPC mode with typed protocol and client
- Move RPC files to modes/rpc/ directory
- Add properly typed RpcCommand and RpcResponse types
- Expose full AgentSession API via RPC commands:
  - State: get_state
  - Model: set_model, cycle_model, get_available_models
  - Thinking: set_thinking_level, cycle_thinking_level
  - Queue: set_queue_mode
  - Compaction: compact, set_auto_compaction
  - Bash: bash, abort_bash
  - Session: get_session_stats, export_html, switch_session, branch, etc.
- Add RpcClient class for programmatic access
- Rewrite tests to use RpcClient instead of raw process spawning
- All commands support optional correlation ID for request/response matching
2025-12-09 14:13:28 +01:00
Mario Zechner
b2e1054e5e Add [Unreleased] section for next development cycle 2025-12-09 13:44:59 +01:00
Mario Zechner
dbd6e5c500 Fix theme path for binary and npm builds after refactor 2025-12-09 13:43:59 +01:00
Mario Zechner
dcf81a6a1a Release v0.15.0
closes #153
2025-12-09 13:41:12 +01:00
Mario Zechner
f24ba6d7c7 Merge branch 'main' into refactor 2025-12-09 02:54:34 +01:00
DronNick
5be846802f
Added compat flags to model config example for ollama (#152) 2025-12-09 02:54:08 +01:00
Mario Zechner
66ba63050d Add test fixture for auto-compaction testing
Session at ~98% context usage, triggers auto-compaction with single prompt
2025-12-09 02:49:47 +01:00
Mario Zechner
4227fd5996 Fix auto-compaction TUI integration and cut point logic
- Trigger auto-compaction after agent_end instead of during message_end
- Show CompactionComponent after auto-compaction (same as manual /compact)
- Fix cut point to include bash executions before kept user message
- Stop backward scan at compaction, assistant, user, or toolResult boundaries
2025-12-09 02:45:24 +01:00
Mario Zechner
75c2eea151 Fix --session flag to load session messages and restore model/thinking 2025-12-09 01:59:20 +01:00
Mario Zechner
91b89578c1 Add auto-compaction events to AgentSession
- Add AgentSessionEvent type extending AgentEvent with auto_compaction_start/end
- Emit events when auto-compaction starts and completes
- TUI shows loader during auto-compaction with escape to cancel
- Rebuilds chat UI when auto-compaction succeeds
2025-12-09 01:51:51 +01:00
Mario Zechner
803d4b65ee Show pending bash executions in pending area, move to chat on user submit 2025-12-09 01:39:40 +01:00
Mario Zechner
2c014c1b95 Fix bash execution interleaving with tool calls: defer message insertion while streaming 2025-12-09 01:34:31 +01:00
Mario Zechner
14d99b5f86 Move config.ts from utils/ to src/ 2025-12-09 01:28:06 +01:00
Mario Zechner
0c1a9c3091 Add code map to AGENTS.md, add DEVELOPMENT.md for coding-agent 2025-12-09 01:23:06 +01:00
Mario Zechner
6c9a264b63 Remove old implementation files (main.ts, cli.ts, tui-renderer.ts), rename new files 2025-12-09 01:21:28 +01:00
Mario Zechner
1a6a1a8acf Split main-new.ts into modules: cli/args, cli/file-processor, cli/session-picker, core/system-prompt, core/model-resolver 2025-12-09 01:20:31 +01:00
Mario Zechner
109a30b265 Deduplicate interactive-mode: consolidate message rendering, add showStatus helper 2025-12-09 01:12:19 +01:00
Mario Zechner
dbd5f5eb0b Refactor selectors: replace show/hide pairs with single showSelector helper 2025-12-09 01:04:55 +01:00
Mario Zechner
fd7f20f968 Remove unused BashExecutionMessage import 2025-12-09 01:00:11 +01:00
Mario Zechner
376b858d2b Remove unnecessary type cast in interactive-mode.ts 2025-12-09 00:59:25 +01:00
Mario Zechner
6adfb64279 Fix path resolution in config.ts after file reorganization 2025-12-09 00:54:51 +01:00
Mario Zechner
83a6c26969 Reorganize file structure: core/, utils/, modes/interactive/components/, modes/interactive/theme/ 2025-12-09 00:51:33 +01:00
Mario Zechner
00982705f2 WP16: Update main-new.ts to use InteractiveMode 2025-12-09 00:36:16 +01:00
Mario Zechner
0020de8518 WP15: Create InteractiveMode using AgentSession 2025-12-09 00:34:44 +01:00
Mario Zechner
e9f6de7cb8 WP14: Create main-new.ts and cli-new.ts using AgentSession and new modes 2025-12-09 00:21:18 +01:00
Mario Zechner
7890fb836a WP13: Create modes/index.ts barrel export 2025-12-09 00:16:46 +01:00
Mario Zechner
e7c71e7ee3 WP12: Create rpc-mode.ts 2025-12-09 00:16:17 +01:00
Mario Zechner
c0996a1078 WP11: Create print-mode.ts 2025-12-09 00:15:37 +01:00
Mario Zechner
934c2bc5d3 WP9+WP10: Add AgentSession session management and utility methods 2025-12-09 00:14:47 +01:00
Mario Zechner
94ff0b0962 WP8: Add AgentSession bash execution 2025-12-09 00:13:10 +01:00
Mario Zechner
8d6d2dd72b WP7: Add AgentSession compaction (manual + auto), fix listener preservation 2025-12-09 00:12:07 +01:00
Mario Zechner
0119d7610b WP5+WP6: Add AgentSession model, thinking level, and queue mode management 2025-12-09 00:08:36 +01:00
Mario Zechner
d08e1e53e9 WP4: Add AgentSession prompting methods (prompt, queue, abort, reset) 2025-12-09 00:07:24 +01:00
Mario Zechner
eba196f4ac WP3: Add AgentSession event subscription with session persistence 2025-12-09 00:05:54 +01:00
Mario Zechner
29d96ab25a WP2: Create AgentSession basic structure + update plan for keep-old-code strategy 2025-12-09 00:05:06 +01:00
Mario Zechner
3f305502cd WP1: Create bash-executor.ts with unified bash execution 2025-12-09 00:01:36 +01:00
Mario Zechner
cceb44410e Add queue mode to AgentSession API, clarify setters vs getters 2025-12-08 23:57:56 +01:00
Mario Zechner
4197b0ceea Fix: use AppMessage[] instead of Message[] in AgentSession 2025-12-08 23:56:08 +01:00
Mario Zechner
1507f8b7a3 Add refactoring plan for coding-agent 2025-12-08 23:54:41 +01:00
Markus Ylisiurunen
d56a0463df
use only model id for fuzzy filtering in model selector (#151) 2025-12-08 23:35:31 +01:00
Mario Zechner
33a2bcf203 Release v0.14.2 2025-12-08 23:29:05 +01:00
Mario Zechner
ad42ebf5f5 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
a054fecd11 Release v0.14.1 2025-12-08 22:59:46 +01:00
Mario Zechner
0bc8d79216 Release v0.14.0 2025-12-08 22:51:29 +01:00
Mario Zechner
d5200b4f1c Add green borders around bash execution component 2025-12-08 22:45:05 +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
1608da8770 Merge main into bash-mode 2025-12-08 21:39:01 +01:00