Commit Graph
100 Commits
Author SHA1 Message Date
Mario Zechner e4e234ecff Fix image rendering artifacts and improve show-images selector
- Image component returns correct number of lines (rows) for TUI accounting
- Empty lines rendered first, then cursor moves up and image is drawn
- This clears the space the image occupies before rendering
- Add spacer before inline images in tool output
- Create ShowImagesSelectorComponent with borders like other selectors
- Use showSelector pattern for /show-images command
2025-12-13 23:53:28 +01:00
Mario Zechner 883b6b3f9f Remove accidentally committed out.cast file 2025-12-13 23:22:45 +01:00
Mario Zechner 27e68d856e Merge feature/tui-inline-images: Inline image rendering for supported terminals 2025-12-13 23:22:31 +01:00
Mario Zechner b8a0465e30 Update docs for inline images, remove PI_NO_IMAGES env var
- Add CHANGELOG entry for inline image rendering feature
- Add /show-images to slash commands table in README
- Expand Image Support section with inline rendering info
- Add terminal.showImages to settings documentation
- Remove PI_NO_IMAGES environment variable feature
2025-12-13 23:21:18 +01:00
Mario Zechner 53794d78f2 Update existing tool components when toggling show-images setting 2025-12-13 23:15:56 +01:00
Mario Zechner d4b2b4be04 Only query cell size if terminal supports images 2025-12-13 23:15:15 +01:00
Mario Zechner f68a933d2c Add /show-images command to toggle inline image display
- Add terminal.showImages setting to settings-manager.ts
- Add /show-images slash command (only visible if terminal supports images)
- ToolExecutionComponent checks both terminal support and user setting
- Shows text fallback when inline images are disabled
2025-12-13 23:14:46 +01:00
Mario Zechner 215c10664a Fix image aspect ratio by querying terminal cell size
- Add getCellDimensions/setCellDimensions to terminal-image.ts
- TUI queries cell size on startup via CSI 16 t
- Parse response and filter it from user input
- Invalidate and re-render when cell dimensions received
- Pass rows parameter to Kitty protocol for correct aspect ratio
2025-12-13 23:09:05 +01:00
Mario Zechner 3140514d8e Add changelog entry for PR #181 - fix macOS screenshot filenames 2025-12-13 22:07:56 +01:00
badlogic 5c0a84b2d8 Add timestamps to note skill and grep examples for searching 2025-12-13 21:01:32 +00:00
badlogic da2ae69a83 Add Creating a Skill example and clarify standard CLI tools 2025-12-13 21:00:28 +00:00
badlogic 2e2de3905d Update Message History section and remove Key Concepts 2025-12-13 20:48:47 +00:00
badlogic f44549cfe8 Simplify Skills section and move before Events 2025-12-13 20:43:16 +00:00
badlogic 728e1461f6 Update Memory section: remove sessions concept, clarify as rules/preferences 2025-12-13 20:35:34 +00:00
badlogic 7d73e1ff6e Replace Claude mentions with LLM in README 2025-12-13 20:33:01 +00:00
badlogic d4f7e7c4ef Clarify mom's message flow and context management in README 2025-12-13 20:31:04 +00:00
Mario Zechner 776fab41e0 Add coding-agent changelog entry for Gemini 3 Pro thinking levels 2025-12-13 02:11:25 +01:00
Mario Zechner b9fe556d5b Add changelog entry for #176 (Gemini 3 Pro thinking levels) 2025-12-13 02:10:38 +01:00
Mario Zechner 38119ffbb0 Add changelog entry for #173, document attribution format in AGENTS.md 2025-12-13 02:06:39 +01:00
Mario Zechner 36dbb2410e mom: add [Unreleased] section to CHANGELOG 2025-12-13 01:12:34 +01:00
Mario Zechner aed17da044 Release v0.20.2 2025-12-13 01:11:36 +01:00
Mario Zechner 27b7340d18 mom: fix skill paths to use container paths in system prompt
Translate host paths to container paths (/workspace/...) so mom can
read skill files from inside the Docker container.
2025-12-13 01:10:46 +01:00
Mario Zechner aa9dc29bce Add [Unreleased] sections to CHANGELOGs 2025-12-13 00:58:16 +01:00
Mario Zechner 59cf6c717b Release v0.20.1 2025-12-13 00:57:12 +01:00
Mario Zechner e707ac4cd0 coding-agent, mom: add skills API export and mom skills auto-discovery
coding-agent:
- Export loadSkillsFromDir, formatSkillsForPrompt, and related types
- Refactor skills.ts to expose public API

mom:
- Add skills auto-discovery from workspace/skills and channel/skills
- Fix skill loading to use host paths (not Docker container paths)
- Update README and system prompt with SKILL.md format docs
2025-12-13 00:56:10 +01:00
Mario Zechner 439f55b0eb coding-agent: add [Unreleased] section to CHANGELOG 2025-12-12 23:25:57 +01:00
Mario Zechner a5268d2aa7 Release v0.20.0 2025-12-12 23:25:01 +01:00
Mario Zechner 3b2b9abffc 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 236856aa48 Release v0.19.2 2025-12-12 23:03:01 +01:00
Mario Zechner e648febfa9 mom: add timezone and external event creation info to README 2025-12-12 23:00:22 +01:00
Mario Zechner e7d2ac7a5d mom: add Events section to README 2025-12-12 22:57:48 +01:00
Mario Zechner f1451fd8f0 mom: fix [SILENT] to delete thread messages too
Track all thread message timestamps during a run. When response is
[SILENT], delete all thread messages before deleting the main message.
This prevents the 'This message was deleted' tombstone in Slack.
2025-12-12 22:56:56 +01:00
Mario Zechner 8ba6aa6627 mom: add [SILENT] response marker for periodic events
When mom responds with just [SILENT], the status message is deleted
and nothing is posted to Slack. Useful for periodic events that check
for activity but find nothing to report.
2025-12-12 22:50:12 +01:00
Mario Zechner d6809328da mom: add events system for scheduled wake-ups
- Three event types: immediate, one-shot, periodic (cron)
- Events are JSON files in workspace/events/
- EventsWatcher with fs.watch, 100ms debounce
- Queue integration via SlackBot.enqueueEvent() (max 5)
- Fix setTyping race condition causing duplicate messages
- System prompt documents events for mom
- Design doc in docs/events.md
- Add croner dependency for cron scheduling
2025-12-12 22:45:34 +01:00
Mario Zechner 03c404c15f Display loaded skills on startup in interactive mode 2025-12-12 21:28:31 +01:00
Mario Zechner d05a895b7e Add [Unreleased] section 2025-12-12 17:56:26 +00:00
Mario Zechner 948b4115c1 Release v0.19.1 2025-12-12 17:53:45 +00:00
Mario Zechner 5ae29dd531 Document skills system in README 2025-12-12 17:51:03 +00:00
Mario Zechner 9f7a50a2e7 Add [Unreleased] section 2025-12-12 17:36:14 +00:00
Mario Zechner e3dadeb4e7 Release v0.19.0 2025-12-12 17:33:16 +00:00
Mario Zechner 4d9a06b931 mom: add [Unreleased] section 2025-12-12 11:31:04 +01:00
Mario Zechner c6a4c1da95 Release v0.18.8 2025-12-12 11:30:11 +01:00
Mario Zechner 08bfdf798d mom: add [Unreleased] section 2025-12-12 11:16:23 +01:00
Mario Zechner 80a04fb1aa Release v0.18.7 2025-12-12 11:15:26 +01:00
Mario Zechner c43395bac3 mom: add [Unreleased] section 2025-12-12 10:54:49 +01:00
Mario Zechner dba2674681 Release v0.18.6 2025-12-12 10:53:53 +01:00
Mario Zechner e26058a21c mom: add [Unreleased] section to CHANGELOG 2025-12-12 10:02:03 +01:00
Mario Zechner 44e9b1c8e9 Release v0.18.5 2025-12-12 10:00:57 +01:00
Mario Zechner 29cbf16218 docs(coding-agent): add --version flag to CHANGELOG and README 2025-12-12 00:02:17 +01:00
Mario Zechner b276f09816 mom: add [Unreleased] section to CHANGELOG 2025-12-12 00:01:22 +01:00
Mario Zechner 652ac0fa36 Release v0.18.4 2025-12-12 00:00:08 +01:00
Mario Zechner e3576fe016 mom: fix attachment downloads - pass store to SlackBot, process files, use absolute paths 2025-12-11 23:55:49 +01:00
badlogic d277d739b3 docs(mom): add App Home configuration step for enabling direct messages 2025-12-11 22:16:16 +01:00
Mario Zechner a13c8c34f5 Release v0.18.3 2025-12-11 20:34:04 +01:00
Mario Zechner 076cc3173a mom: update changelog with AgentSession integration, closes #115 2025-12-11 20:25:27 +01:00
Mario Zechner 71b776e290 mom: add context usage to thread summary, update docs
- Usage summary now shows context tokens vs model context window
- Updated CHANGELOG.md with all recent changes
- Updated README.md with new file structure (log.jsonl/context.jsonl)
2025-12-11 20:24:05 +01:00
Mario Zechner 99fe4802ef mom: rewrite message handling - log.jsonl and context.jsonl sync
- log.jsonl is source of truth, context.jsonl syncs from it at run start
- Backfill fetches missing messages from Slack API on startup
- Messages sent while mom is busy are logged and synced on next run
- Channel chatter (no @mention) logged but doesn't trigger processing
- Pre-startup messages (replayed by Slack) logged but not processed
- Stop command executes immediately, not queued
- Session header written immediately on new session creation
- Deduplicate messages by timestamp
- Strip @mentions from backfilled messages
- Remove old slack.ts and main.ts, rename *-new.ts versions
2025-12-11 20:13:29 +01:00
Mario Zechner e513127b3b 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 cc71c0a49e mom: fix duplicate logging
- Remove user message logging from agent.ts (Slack handler already logs it)
- Add excludeTimestamp param to syncFromLog to skip current @mention
- Sync happens once before each prompt with current message excluded
2025-12-11 13:26:45 +01:00
Mario Zechner 5a231abe4c mom: remove last_prompt.txt debug file (context.jsonl is source of truth) 2025-12-11 13:22:59 +01:00
Mario Zechner ca23ade9f8 mom: sync user messages from log.jsonl to context.jsonl before each agent run
- Ensures channel chatter and backfilled messages are in context
- Syncs on session creation and before each subsequent run
- User messages formatted as '[username]: text' in context
2025-12-11 13:20:40 +01:00
Mario Zechner 3f6db8e99c mom: refactor to use AgentSession for context management
- Export AgentSession, SessionManager, SettingsManager, compaction from coding-agent
- Create MomSessionManager for channel-based context.jsonl storage
- Create MomSettingsManager for mom-specific settings
- Refactor agent.ts to use AgentSession instead of ephemeral Agent
- Split logging: tool results go to context.jsonl, human messages to log.jsonl
- Enable auto-compaction and overflow detection from coding-agent

Part of #115
2025-12-11 13:09:01 +01:00
Mario Zechner de7f71838c mom: add coding-agent dependency, update compaction docs 2025-12-11 13:04:45 +01:00
Mario Zechner 2a0f239288 mom: remove dynamic timestamp from system prompt for better cache hits 2025-12-11 12:26:59 +01:00
Mario Zechner 078661c3b1 Restore assistant bridge message insertion for compat flag 2025-12-11 00:36:35 +01:00
Mario Zechner b0628786a7 Add [Unreleased] section 2025-12-10 23:40:27 +01:00
Mario Zechner b40ecf0ee1 Release v0.18.2 2025-12-10 23:39:16 +01:00
Mario Zechner bb445d24f1 Auto-retry on transient provider errors (overloaded, rate limit, 5xx)
- Add retry logic with exponential backoff (2s, 4s, 8s) in AgentSession
- Disable Anthropic SDK built-in retries (maxRetries: 0) to allow app-level handling
- TUI shows retry status with Escape to cancel
- RPC mode: add set_auto_retry, abort_retry commands and auto_retry_start/end events
- Configurable via settings.json: retry.enabled, retry.maxRetries, retry.baseDelayMs
- Exclude context overflow errors from retry (handled by compaction)

fixes #157
2025-12-10 23:36:46 +01:00
Mario Zechner 79f5c6d22e Fix git branch indicator in subdirectories
Walk up directory hierarchy to find .git/HEAD instead of only checking cwd.

fixes #156
2025-12-10 22:52:19 +01:00
Mario Zechner 1fe87bc50d Document that build must run before check
The web-ui package uses tsc which requires compiled .d.ts files from
dependencies to exist.

closes #167
2025-12-10 22:50:34 +01:00
Mario Zechner 3d35e7c469 Fix branch selector for single message and --no-session mode
- Allow branch selector to open with single user message (changed <= 1 to === 0 check)
- Support in-memory branching for --no-session mode (no files created)
- Add isEnabled() getter to SessionManager
- Update sessionFile getter to return null when sessions disabled
- Update SessionSwitchEvent types to allow null session files
- Add branching tests for single message and --no-session scenarios

fixes #163
2025-12-10 22:41:32 +01:00
Mario Zechner 09a48fd1c3 feat: add line number display to HTML export for read tool calls
Implements line number display in HTML exports for read tool calls, matching the TUI format.
When offset/limit parameters are provided, displays path:startLine-endLine in yellow color.

Fixes #166
2025-12-10 22:05:14 +01:00
Mario Zechner cf2f5742cc Add NPM token setup instructions to README 2025-12-10 21:42:18 +01:00
Mario Zechner 751e10e78b Add [Unreleased] section to changelogs 2025-12-10 21:41:50 +01:00
Mario Zechner f931c57726 Release v0.18.1 2025-12-10 21:25:15 +01:00
Mario Zechner 1ce09681b1 Add issue links to changelog entries 2025-12-10 21:24:05 +01:00
Mario Zechner c91afd76f1 Update changelogs for recent fixes 2025-12-10 21:23:08 +01:00
Mario Zechner 7323af1f69 fixes #161: stop theme watcher and exit cleanly in print mode
The theme file watcher was keeping the Node.js process alive indefinitely
even in print mode where hot-reload is unnecessary. This simple fix calls
stopThemeWatcher() and process.exit(0) after print mode completes.

- Added stopThemeWatcher() call after runPrintMode() completes
- Added process.exit(0) to ensure clean process termination
- Imported stopThemeWatcher from theme module

This is a minimal fix that addresses the symptom (process hanging) without
changing the theme initialization logic.
2025-12-10 21:16:47 +01:00
Mario Zechner 9516424cae fixes #161: disable theme watcher in print mode
The theme file watcher was keeping the Node.js process alive indefinitely
even in print mode where hot-reload is unnecessary. This fix adds an
enableWatcher parameter to initTheme() and setTheme() functions, and only
enables watchers in interactive mode.

- Modified initTheme() to accept enableWatcher parameter (default: false)
- Modified setTheme() to accept enableWatcher parameter (default: false)
- Updated main.ts to only enable watchers in interactive mode
- Updated InteractiveMode to enable watchers when changing themes
2025-12-10 21:16:47 +01:00
Mario Zechner 76312ea7e8 Fix Mistral 400 errors after aborted assistant messages
- Skip empty assistant messages (no content, no tool calls) to avoid
  Mistral's 'Assistant message must have either content or tool_calls'
  error
- Remove synthetic assistant bridge message after tool results (Mistral
  no longer requires this as of Dec 2024)
- Add test for empty assistant message handling

Follow-up to #165
2025-12-10 21:13:33 +01:00
Mario Zechner 99b4b1aca0 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 7785b7c93f Release v0.18.0 2025-12-10 01:18:13 +01:00
Mario Zechner 7742f7b653 Credit nicobailon for hooks collaboration 2025-12-10 01:01:15 +01:00
Mario Zechner c7afa35e1b Add hooks to changelog (closes #145, supersedes #158) 2025-12-10 01:00:32 +01:00
Mario Zechner 1abc635044 Add ./hooks subpath export for cleaner imports 2025-12-10 00:56:02 +01:00
Mario Zechner 7c553acd1e Add hooks system with pi.send() for external message injection
- Hook discovery from ~/.pi/agent/hooks/, .pi/hooks/, --hook flag
- Events: session_start, session_switch, agent_start/end, turn_start/end, tool_call, tool_result, branch
- tool_call can block execution, tool_result can modify results
- pi.send(text, attachments?) to inject messages from external sources
- UI primitives: ctx.ui.select/confirm/input/notify
- Context: ctx.exec(), ctx.cwd, ctx.sessionFile, ctx.hasUI
- Docs shipped with npm package and binary builds
- System prompt references docs folder
2025-12-10 00:50:30 +01:00
Mario Zechner 942d8d3c95 Fix queued messages. 2025-12-09 23:51:22 +01:00
Mario Zechner 86c2a33df4 fix(coding-agent): skip hook init when no hooks configured 2025-12-09 22:24:17 +01:00
Mario Zechner 04d59f31ea 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 195760d8ee Fix version scripts: clean reinstall to avoid npm workspace bug 2025-12-09 21:56:22 +01:00
Mario Zechner 44657ef0f9 Run npm install after version bumps to sync package-lock.json 2025-12-09 21:52:51 +01:00
Mario Zechner 55032f1697 Add [Unreleased] section to changelogs 2025-12-09 21:51:01 +01:00
Mario Zechner 2d9ecd1750 Release v0.17.0 2025-12-09 21:47:39 +01:00
Mario Zechner 5a9d844f9a 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 d67c69c6e9 Fix bash execution component to limit by visual lines instead of logical lines 2025-12-09 21:16:25 +01:00
Mario Zechner a38e619095 feat(coding-agent): implement new compaction system with overflow recovery
Phase 1: Updated compaction.ts
- findCutPoint now returns CutPointResult with isSplitTurn and turnStartIndex
- Can cut at user, assistant, or bashExecution messages (never tool results)
- Added turnPrefixSummary support for split turns (parallel summarization)
- estimateTokens helper for context size estimation

Phase 2: Updated session-manager.ts
- CompactionEntry now has optional turnPrefixSummary field
- loadSessionFromEntries injects both summaries when turn was split

Phase 3: Updated agent-session.ts
- Overflow detection via isContextOverflow after agent_end
- Proactive compaction check on turn_end before next LLM call
- _abortingForCompaction flag to skip saving aborted messages
- Auto-retry after overflow recovery or proactive compaction
- New event fields: reason (overflow/threshold), willRetry

Phase 4: Updated interactive-mode.ts
- Shows reason in compaction status (Context overflow detected...)
- Shows retry status after compaction

Tests updated for new CutPointResult return type.
2025-12-09 17:18:53 +01:00
Mario Zechner ee9acdb49d Fix hardcoded truncation limits in tool output display
- Add maxLines and maxBytes fields to TruncationResult to track actual limits used
- Update tool-execution.ts to use actual limits from truncation result
- Add fallbacks to DEFAULT_MAX_* for backward compatibility with old sessions
- Fix outdated comments that said 30KB when default is 50KB
2025-12-09 17:06:29 +01:00
Mario Zechner 8226975080 feat(coding-agent): maintain in-memory session entries for --no-session compaction support
SessionManager now tracks all entries in memory regardless of whether file
persistence is enabled. This allows compaction to work in --no-session mode
where no session file is created.

- Added inMemoryEntries array to store session entries
- All save methods now push to inMemoryEntries
- loadEntries() returns in-memory entries when file persistence is disabled
- File persistence only writes when enabled flag is true
- Session loading (constructor, setSessionFile) populates in-memory entries
2025-12-09 16:55:42 +01:00
Mario Zechner 02c7f9ea51 Port truncation logic from coding-agent to mom
- Add truncate.ts with 2000 lines / 50KB limits
- Update bash tool with tail truncation and temp file output
- Update read tool with head truncation and offset hints
- Remove redundant context history truncation (tools already provide actionable hints)

fixes #155
2025-12-09 16:05:08 +01:00
Mario Zechner de3fd172a9 Update generated models 2025-12-09 15:44:45 +01:00