Commit Graph
123 Commits
Author SHA1 Message Date
Mario Zechner a87b79f29d Add [Unreleased] sections to CHANGELOGs 2025-12-13 00:58:16 +01:00
Mario Zechner 64aac37812 coding-agent: change Pi skills to use SKILL.md convention
Breaking change: Pi skills must now be named SKILL.md inside a directory,
matching Codex CLI format. Previously any *.md file was treated as a skill.

Migrate by renaming ~/.pi/agent/skills/foo.md to ~/.pi/agent/skills/foo/SKILL.md
2025-12-12 23:23:17 +01:00
Mario Zechner 886d4189aa Add [Unreleased] section 2025-12-12 17:56:26 +00:00
Mario Zechner 2cb0ff3f0e Release v0.19.1 2025-12-12 17:53:45 +00:00
Mario Zechner 88c33163b5 Release v0.19.0 2025-12-12 17:33:16 +00:00
Nico BailonandGitHub 1de5118261 Add skills system with Claude Code compatibility (#171)
* Add skills system with Claude Code compatibility

* consolidate skills into single module, merge loaders, add <available_skills> XML tags

* add Codex CLI skills compatibility, skip hidden/symlinks
2025-12-12 18:24:52 +01:00
Mario Zechner 0bd5e154a1 mom: add [Unreleased] section to CHANGELOG 2025-12-12 10:02:03 +01:00
Mario Zechner 4281150e86 mom: fix attachment downloads - pass store to SlackBot, process files, use absolute paths 2025-12-11 23:55:49 +01:00
Mario Zechner b6fdd1ef1c mom: fix duplicate bot response logging, remove debug logs
- Remove bot response logging from agent.ts (already done in ctx.respond)
- Remove all debug console.log statements
- Clean up unused store parameter
2025-12-11 13:39:32 +01:00
Mario Zechner d5b418b48f Add [Unreleased] section 2025-12-10 23:40:27 +01:00
Mario Zechner 0c3bd34402 Add [Unreleased] section to changelogs 2025-12-10 21:41:50 +01:00
Mario Zechner 56ced9ae83 Add Mistral as AI provider
- Add Mistral to KnownProvider type and model generation
- Implement Mistral-specific compat handling in openai-completions:
  - requiresToolResultName: tool results need name field
  - requiresAssistantAfterToolResult: synthetic assistant message between tool/user
  - requiresThinkingAsText: thinking blocks as <thinking> text
  - requiresMistralToolIds: tool IDs must be exactly 9 alphanumeric chars
- Add MISTRAL_API_KEY environment variable support
- Add Mistral tests across all test files
- Update documentation (README, CHANGELOG) for both ai and coding-agent packages
- Remove client IDs from gemini.md, reference upstream source instead

Closes #165
2025-12-10 20:36:19 +01:00
Mario Zechner feaefa303c feat(coding-agent): implement hooks system
- Add hooks infrastructure in core/hooks/ (loader, runner, types)
- HookUIContext interface with mode-specific implementations
- Interactive mode: TUI-based selector/input/confirm dialogs
- RPC mode: JSON protocol for hook UI requests/responses
- Print mode: no-op UI context (hooks run but can't prompt)
- AgentSession.branch() now async, returns { selectedText, skipped }
- Settings: hooks[] and hookTimeout configuration
- Export hook types from package for hook authors

Based on PR #147 proposal, adapted for new architecture.
2025-12-09 22:17:12 +01:00
Mario Zechner ad9f7b7334 Add [Unreleased] section to changelogs 2025-12-09 21:51:01 +01:00
Mario Zechner 62a606744c Simplify compaction: remove proactive abort, use Agent.continue() for retry
- Add agentLoopContinue() to pi-ai for resuming from existing context
- Add Agent.continue() method and transport.continue() interface
- Simplify AgentSession compaction to two cases: overflow (auto-retry) and threshold (no retry)
- Remove proactive mid-turn compaction abort
- Merge turn prefix summary into main summary
- Add isCompacting property to AgentSession and RPC state
- Block input during compaction in interactive mode
- Show compaction count on session resume
- Rename RPC.md to rpc.md for consistency

Related to #128
2025-12-09 21:43:49 +01:00
Mario Zechner 48f0417c6f Update generated models 2025-12-09 15:44:45 +01:00
Mario Zechner db3d01028c Fix theme path for binary and npm builds after refactor 2025-12-09 13:43:59 +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 c6fd9eeeaa Fix tsgo type issues: update tsgo, fix ReasoningEffort import, remove broken enum-test 2025-12-08 22:59:13 +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 df717c75dc Fix wrap-ansi test to use node:test instead of vitest 2025-12-06 00:48:46 +01:00
Mario Zechner 01f06b2b22 Add [Unreleased] section 2025-12-05 23:01:46 +01:00
Mario Zechner d9f1698b6d Add [Unreleased] section 2025-12-05 12:20:35 +01:00
Mario Zechner 1d11267401 Release v0.12.10 2025-12-04 20:51:57 +01:00
Mario Zechner bd003382b5 Add [Unreleased] section 2025-12-04 03:12:00 +01:00
Mario Zechner 0ff8557c4c Use ordered root build instead of parallel workspace build in CI 2025-12-03 15:05:04 +01:00
Mario Zechner 92f3aaefb7 Add web-ui/example to workspaces, remove CI workaround 2025-12-03 14:27:02 +01:00
Mario Zechner 84e2936a8b Try fixing root level compiles 2025-12-03 14:16:00 +01:00
Mario Zechner ea27b32384 Clean-up out.html 2025-12-02 13:01:13 +01:00
badlogic 077e6f6cd9 Fix Windows binary path resolution for Bun compiled executable 2025-12-02 12:58:00 +01:00
Mario Zechner 1174f37743 docs: update AGENTS.md style guide - no emojis, no fluff 2025-12-02 12:20:32 +01:00
Mario Zechner b7f1ef7637 chore: update models.generated.ts 2025-12-02 09:38:49 +01:00
Mario Zechner ace6ec78f2 fix: use TruncatedText in oauth-selector to prevent line overflow 2025-12-02 09:28:27 +01:00
Mario Zechner f48654a244 fix: RPC mode session management not saving sessions
Since version 0.9.0, RPC mode (--mode rpc) was not saving messages to
session files. The agent.subscribe() call with session management logic
was only present in the TUI renderer after it was refactored.

RPC mode now properly saves sessions just like interactive mode.

Added test for RPC mode session management to prevent regression.

Fixes #83

Thanks @kiliman for reporting this issue!
2025-12-01 01:19:17 +01:00
Mario Zechner 55354cc7a3 docs(coding-agent): add changelog entry for git branch watcher (#79) 2025-11-29 21:54:02 +01:00
Mario Zechner da34de2503 Restore prompt to editor on API key validation failure
fixes #77
2025-11-28 23:00:37 +01:00
Mario Zechner 7b1818dab1 mom: turn-based context, timestamp fixes, system prompt improvements (#68)
Breaking Changes:
- Timestamps now use Slack format - run migrate-timestamps.ts for existing logs

Added:
- Channel/user ID mappings in system prompt
- Skills documentation in system prompt
- Debug last_prompt.txt output
- Bash working directory info
- Token-efficient log queries filtering tool calls

Changed:
- Turn-based message context (groups consecutive bot messages as one turn)
- Messages sorted by Slack timestamp
- Condensed system prompt (~5k → ~2.7k chars)
- Simplified user prompt
- Selective logging (skip UI status labels)

Fixed:
- Duplicate message logging from app_mention handler
- Username obfuscation in thread messages
2025-11-27 23:45:25 +01:00
Mario Zechner 6add0cc13c 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 213bc4df1c mom: add centralized logging, usage tracking, and improve prompt caching
Major improvements to mom's logging and cost reporting:

Centralized Logging System:
- Add src/log.ts with type-safe logging functions
- Colored console output (green=user, yellow=mom, dim=details)
- Consistent format: [HH:MM:SS] [context] message
- Replace scattered console.log/error calls throughout codebase

Usage Tracking & Cost Reporting:
- Track tokens (input, output, cache read/write) and costs per run
- Display summary at end of each run in console and Slack thread
- Example: 💰 Usage: 12,543 in + 847 out (5,234 cache read) = $0.0234

Prompt Caching Optimization:
- Move recent messages from system prompt to user message
- System prompt now mostly static (only changes with memory files)
- Enables effective use of Anthropic's prompt caching
- Significantly reduces costs on subsequent requests

Model & Cost Improvements:
- Switch from Claude Opus 4.5 to Sonnet 4.5 (~40% cost reduction)
- Fix Claude Opus 4.5 cache pricing in ai package (was 3x too expensive)
- Add manual override in generate-models.ts until upstream fix merges
- Submitted PR to models.dev: https://github.com/sst/models.dev/pull/439

UI/UX Improvements:
- Extract actual text from tool results instead of JSON wrapper
- Cleaner Slack thread formatting with duration and labels
- Tool args formatting shows paths with offset:limit notation
- Add chalk for colored terminal output

Dependencies:
- Add chalk package for terminal colors
2025-11-26 18:04:16 +01:00
Mario Zechner 82d4ac93e1 ai: update models list (removed grok-4.1-fast non-free variant) 2025-11-26 13:21:59 +01:00
Mario Zechner aa9e058249 mom: Slack bot with abort support, streaming console output, removed sandbox 2025-11-26 00:27:21 +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 68ca83441b Changes to AGENTS.md 2025-11-24 19:17:50 +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 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