Commit graph

212 commits

Author SHA1 Message Date
Mario Zechner
50c8323590 feat(coding-agent): package deduplication and collision detection
- Package deduplication: same package in global+project, project wins
- Collision detection for skills, prompts, and themes with ResourceCollision type
- PathMetadata tracking with parent directory lookup for file paths
- Display improvements: section headers, sorted groups, accent colors for packages
- pi list shows full paths below package names
- Extension loader discovers files in directories without index.ts
- In-memory SettingsManager properly tracks project settings

fixes #645
2026-01-24 00:35:19 +01:00
Mario Zechner
c5c515f560 remove chalk-logger example (breaks TUI by using console.log directly)
The with-deps example demonstrates npm dependency resolution properly.
2026-01-23 21:04:15 +01:00
Mario Zechner
7af1919d31 fix: use portable shebang in shell scripts
Change #!/bin/bash to #!/usr/bin/env bash for better portability
on systems like NixOS where /bin/bash doesn't exist.

Fixes #910
2026-01-22 21:44:39 +01:00
Mario Zechner
b846a4bfcf feat(coding-agent): ResourceLoader, package management, and /reload command (#645)
- Add ResourceLoader interface and DefaultResourceLoader implementation
- Add PackageManager for npm/git extension sources with install/remove/update
- Add session.reload() and session.bindExtensions() APIs
- Add /reload command in interactive mode
- Add CLI flags: --skill, --theme, --prompt-template, --no-themes, --no-prompt-templates
- Add pi install/remove/update commands for extension management
- Refactor settings.json to use arrays for skills, prompts, themes
- Remove legacy SkillsSettings source flags and filters
- Update SDK examples and documentation for ResourceLoader pattern
- Add theme registration and loadThemeFromPath for dynamic themes
- Add getShellEnv to include bin dir in PATH for bash commands
2026-01-22 13:49:38 +01:00
Mario Zechner
866d21c252 chore: move pi-dosbox to separate repo
Moved to https://github.com/badlogic/pi-dosbox
2026-01-22 13:19:54 +01:00
Mario Zechner
c083e195ad Revert "fix(pi-dosbox): force image re-render to prevent ghosting during streaming"
This reverts commit 1668a59bff.
2026-01-22 05:36:00 +01:00
Mario Zechner
1668a59bff fix(pi-dosbox): force image re-render to prevent ghosting during streaming
The TUI only re-renders changed lines. During agent streaming, the
conversation lines above DOSBox change but DOSBox lines stay the same.
This caused the image to stay at its old position while text scrolled.

Fix: Add invisible timestamp to image line to force TUI to see it as
changed every render, ensuring the image is always re-rendered at the
correct position.
2026-01-22 05:30:57 +01:00
Mario Zechner
29e6c13c03 fix(pi-dosbox): use post-init FS mounting instead of bundle.extract
bundle.extract() uses XMLHttpRequest which doesn't exist in Node.js.
Reverted to writing files directly to Emscripten FS after DOSBox init.
jsdos mounts C: to /home/web_user by default.
2026-01-22 05:11:57 +01:00
Mario Zechner
935417cff1 fix(pi-dosbox): include QBasic files in jsdos bundle
The previous approach of writing files to Emscripten FS after DOSBox
started didn't work because the C: drive mount was pointing elsewhere.

Now we create a proper zip archive of QBasic files and include it in
the jsdos bundle using the extract() API with a data URL. The bundle
extracts to the C: drive root on startup.
2026-01-22 05:09:32 +01:00
Mario Zechner
4f343f39b9 feat(pi-dosbox): persistent DOSBox with QBasic and agent tool
- DOSBox now starts at session_start and persists in background
- /dosbox command attaches UI to running instance (Ctrl+Q detaches)
- Added dosbox tool with actions: send_keys, screenshot, read_text
- Bundled QuickBASIC 4.5 files, mounted at C:\QB on startup
- Agent can interact with DOSBox programmatically via tool

Use: pi -e ./examples/extensions/pi-dosbox
Then: /dosbox to view, or let agent use the dosbox tool
2026-01-22 05:03:39 +01:00
Mario Zechner
fbd6b7f9ba fix(tui): prevent image ID collisions between modules
- allocateImageId() now returns random IDs instead of sequential
- Static images no longer auto-allocate IDs (transient display)
- Only explicit imageId usage (like DOSBox) gets tracked IDs
- Suppress emulators exit logging in DOSBox dispose

Fixes image replacement bug when extension and main app both
allocated sequential IDs starting at 1.
2026-01-22 04:52:55 +01:00
Mario Zechner
df1d5c40ea fix(tui): proper Kitty image ID management and cleanup
- Add allocateImageId() to generate unique image IDs
- Add deleteKittyImage() and deleteAllKittyImages() functions
- Image component now tracks its ID and has dispose() method
- renderImage() returns imageId for tracking
- DOSBox: reuse single image ID for all frames, delete on dispose

Fixes image accumulation hitting terminal quota and lingering
images after component close.
2026-01-22 04:39:58 +01:00
Mario Zechner
6515b1a3dd feat(coding-agent): add DOSBox terminal extension
- Render DOSBox framebuffer as images in terminal via emulators package
- Support keyboard input with js-dos key codes
- Push Kitty enhanced mode for proper key press/release events
- Standalone app (npm start) and pi extension entry point
- Exit with Ctrl+Q
2026-01-22 04:35:43 +01:00
Mario Zechner
34d28a47b5 Release v0.49.3 2026-01-22 01:42:43 +01:00
Mario Zechner
289d88c284 feat(coding-agent): add Space Invaders example extension
- Classic gameplay with 5x11 alien formation
- 3 alien types, destructible shields, level progression
- Uses Kitty keyboard protocol for smooth movement
- Saves game state on pause, tracks high score
2026-01-22 01:39:51 +01:00
Ben Vargas
f39ec4d772
feat(extensions): add antigravity-image-gen example for image generation (#893)
Adds a new extension that generates images via Google Antigravity's
image models (gemini-3-pro-image, imagen-3). Features:

- Returns images as tool result attachments for inline terminal rendering
- Configurable save modes: none, project, global, custom
- Supports env vars (PI_IMAGE_SAVE_MODE, PI_IMAGE_SAVE_DIR) and config files
- Configurable aspect ratios (1:1, 16:9, etc.)

Requires OAuth login via /login for google-antigravity provider.
2026-01-22 01:34:22 +01:00
scutifer
82cc0fe866
feat(extensions): add inline-bash example for expanding !{command} in prompts (#881)
* feat(extensions): add inline-bash example for expanding !{command} in prompts

Adds an example extension that expands inline bash commands within user
prompts before sending to the agent. Uses the `input` event to transform
patterns like `!{pwd}` or `!{git status}` into their output.

Preserves existing `!command` whole-line bash behavior.

* docs(extensions): add inline-bash to README

* chore: fix stupid bug
2026-01-21 14:08:07 +01:00
Mario Zechner
17a37bd174 Release v0.49.2 2026-01-19 16:14:07 +01:00
Marc Krenn
abb1775ff7
feat(coding-agent): Add widget placement option (#850)
* Add widget placement for extension widgets

* Remove changelog entry for widget placement

* Keep no-op widget signature

* Move widget render before attach
2026-01-19 15:54:24 +01:00
Ted
f711340136
fix question option schema (#846) 2026-01-19 14:57:23 +01:00
Mario Zechner
15a04c585a Release v0.49.1 2026-01-19 00:23:11 +01:00
Mario Zechner
3e6ae39083 Release v0.49.0 2026-01-17 22:02:12 +01:00
Mario Zechner
05ee8e3334 fix(coding-agent): show compaction UI for extensions 2026-01-17 11:48:54 +01:00
Mario Zechner
9d3f8117a4 feat(coding-agent): add extension compaction helpers 2026-01-17 11:40:39 +01:00
Jian Zhang
fc538f6ca1
feat(coding-agent): export VERSION and update custom-header example (#798)
Co-authored-by: Jian Zhang <jzhang@yanhuangdata.com>
2026-01-17 10:54:00 +01:00
Mario Zechner
91be338e39 Release v0.48.0 2026-01-17 00:32:07 +01:00
Mario Zechner
6248d86ff6 Release v0.47.0 2026-01-16 04:41:04 +01:00
Mario Zechner
07fad1362c feat(tui): hardware cursor positioning for IME support
- Add Focusable interface for components that need hardware cursor positioning
- Add CURSOR_MARKER (APC escape sequence) for marking cursor position in render output
- Editor and Input components implement Focusable and emit marker when focused
- TUI extracts cursor position from rendered output and positions hardware cursor
- Track hardwareCursorRow separately from cursorRow for differential rendering
- visibleWidth() and extractAnsiCode() now handle APC sequences
- Update overlay-test.ts example to demonstrate Focusable usage
- Add documentation for Focusable interface in docs/tui.md

Closes #719, closes #525
2026-01-16 04:30:07 +01:00
Mario Zechner
d9464383ec chore: remove test extension load-file.ts 2026-01-16 04:14:26 +01:00
Mario Zechner
356a482527 fix(tui): add vertical scrolling to Editor when content exceeds terminal height
The Editor component now accepts TUI as the first constructor parameter,
enabling it to query terminal dimensions. When content exceeds available
height, the editor scrolls vertically keeping the cursor visible.

Features:
- Max editor height is 30% of terminal rows (minimum 5 lines)
- Page Up/Down keys scroll by page size
- Scroll indicators show lines above/below: ─── ↑ 5 more ───

Breaking change: Editor constructor signature changed from
  new Editor(theme)
to
  new Editor(tui, theme)

fixes #732
2026-01-16 04:12:21 +01:00
Nico Bailon
3e5d91f287
feat(coding-agent): add input event for extension input interception (#761)
* feat(coding-agent): add input event for extension input interception

Extensions can now intercept, transform, or handle user input before the
agent processes it. Three result types: continue (pass through), transform
(modify text/images), handled (respond without LLM). Handlers chain
transforms and short-circuit on handled. Source field identifies origin.

* fix: make source public, use if/else over ternary

* fix: remove response field, extension handles own UI
2026-01-16 02:41:56 +01:00
Richard Gill
ce7e73b503
Centralize frontmatter parsing + parse frontmatter with yaml library (#728)
* Add frontmatter utility and tidy coding agent prompts

* Add frontmatter parsing utilities and tests

* Parse frontmatter with YAML parser

* Simplify frontmatter parsing utilities

* strip body in 1 place

* Improve frontmatter parsing error handling

* Normalize multiline skill and select-list descriptions
2026-01-16 00:31:53 +01:00
Mario Zechner
0aaa4ef5e4 Release v0.46.0 2026-01-15 17:35:54 +01:00
Fero
39ee5fee92
fix(plan-mode): change shortcut from Shift+P to Ctrl+Alt+P (#746)
Shift+P conflicts with typing capital P. Ctrl+Alt+P is cross-platform
safe and doesn't conflict with common shortcuts like:
- Ctrl+Shift+P (command palette on Windows/VS Code)
- Shift+Alt+P (types π on macOS)
2026-01-15 13:09:16 +01:00
Mario Zechner
d08821cc4a Release v0.45.7 2026-01-14 00:10:52 +01:00
Mario Zechner
f8dc72d24f Release v0.45.6 2026-01-13 22:48:05 +01:00
Mario Zechner
6c1d226210 docs: move PR #667 overlay entries to unreleased section 2026-01-13 22:47:38 +01:00
Mario Zechner
0feed80b07 Don't force rerender in doom 2026-01-13 22:42:00 +01:00
Mario Zechner
7d45e434de Merge branch 'main' into feat/tui-overlay-options 2026-01-13 22:06:02 +01:00
Mario Zechner
9a08bb0d1e Release v0.45.5 2026-01-13 21:46:57 +01:00
Mario Zechner
bb0ba88b97 Release v0.45.4 2026-01-13 21:36:52 +01:00
Mario Zechner
843f235251 fix: extension loading in Bun binary (#681)
- Remove loader exports from index.ts to break circular dependency
- Static import of index.js in loader.ts for virtualModules
- Add @mariozechner/pi-agent-core to virtualModules
- Update @mariozechner/jiti to 2.6.5 (bundles babel for Bun binary)
- Update SDK docs to use correct extension terminology
2026-01-13 21:19:41 +01:00
Mario Zechner
36bb1d3865 docs: update extension examples READMEs and fix plan-mode references
- Add missing extensions to examples/extensions/README.md:
  questionnaire.ts, truncated-tool.ts, model-status.ts, rainbow-editor.ts,
  custom-footer.ts, custom-header.ts, overlay-test.ts, shutdown-command.ts,
  interactive-shell.ts, claude-rules.ts, mac-system-theme.ts
- Update plan-mode.ts -> plan-mode/ (now a directory)
- Add new System Integration section
- Update docs/extensions.md plan-mode.ts -> plan-mode/index.ts (17 refs)
- Add questionnaire.ts to registerTool and ctx.ui.select() examples
- Expand examples/README.md description
2026-01-13 18:34:08 +01:00
Fero
1c58db5e23
feat(question): enhanced question tool with custom UI (#693)
Changes from the original:
- Full custom UI with options list instead of simple ctx.ui.select()
- Option descriptions: support { label, description? } in addition to strings
- Built-in 'Other...' option with inline editor for free-text input
- Better UX: Escape in editor returns to options, Escape in options cancels
- Numbered options display (1. Option, 2. Option, etc.)
- Enhanced result rendering showing selection index
2026-01-13 17:53:39 +01:00
Fero
e8f1322eee
feat(plan-mode): enhanced plan mode with explicit step tracking (#694)
Changes from the original:
- Explicit [DONE:n] tag tracking (more accurate than auto-marking on tool_result)
- Plan: header requirement - only extracts todos from 'Plan:' sections
- Utils extracted to separate file for testability
- Better session resume - only scans messages after plan-mode-execute marker
- Context filtering - properly filters plan-mode-context custom type messages
- Refactored to directory structure (index.ts + utils.ts + README.md)

The original auto-completed steps on every tool_result, which was inaccurate
for multi-tool steps. This version uses explicit [DONE:n] markers that the
agent outputs after completing each step.
2026-01-13 17:53:11 +01:00
Fero
a7a863c792
feat: add questionnaire tool for multi-question input (#695)
New tool for asking users one or more questions with a tab-based interface.

Features:
- Single question: simple options list (similar to question tool)
- Multiple questions: tab bar navigation between questions
- Progress indicators: ■/□ checkboxes show answered state
- Submit tab: review all answers before submitting
- 'Type something' option: free-text input with options visible
- Full keyboard navigation: Tab/←→ between questions, ↑↓ for options

Use cases:
- Clarifying requirements with multiple aspects
- Getting user preferences across categories
- Multi-step confirmation dialogs

Example:
```typescript
{
  questions: [{
    id: "db",
    label: "Database",
    prompt: "Which database?",
    options: [
      { value: "pg", label: "PostgreSQL", description: "Relational" },
      { value: "mongo", label: "MongoDB", description: "Document store" }
    ]
  }, {
    id: "auth",
    label: "Auth",
    prompt: "Authentication method?",
    options: [
      { value: "jwt", label: "JWT" },
      { value: "session", label: "Sessions" }
    ]
  }]
}
```
2026-01-13 17:52:22 +01:00
scutifer
0f4d929a8e
coding-agent: example extension to summarize conversation (#684)
* feat: add summarize extension example

Demonstrates custom UI with markdown rendering and external model
integration for conversation summarization.

* chore: update examples/extensions/README.md with summarize.ts
2026-01-13 13:01:09 +01:00
Nico Bailon
a4ccff382c feat(tui): overlay positioning API with CSS-like values
Add OverlayOptions for configurable positioning (anchor, margins, offsets,
percentages). Add OverlayHandle for programmatic visibility control with
hide/setHidden/isHidden. Add visible callback for responsive overlays.

Extension API: ctx.ui.custom() now accepts overlayOptions and onHandle callback.

Examples: overlay-qa-tests.ts (10 test commands), doom-overlay (DOOM at 35 FPS).
2026-01-12 22:44:58 -08:00
Mario Zechner
2090599e4b Release v0.45.3 2026-01-13 04:56:41 +01:00
Mario Zechner
c55082bb66 Release v0.45.2 2026-01-13 03:27:56 +01:00