Commit graph

2352 commits

Author SHA1 Message Date
Aliou Diallo
80e6c4cf57 fix(coding-agent): restore compaction-queued messages on Alt-Up 2026-01-23 17:47:30 +01:00
Mario Zechner
73734a23a1 fix(coding-agent): only list built-in tools in system prompt
Extension tools are already described via API tool definitions.
Removes redundant 'Custom tool' fallback.
2026-01-23 00:54:30 +01:00
Mario Zechner
7a2e71bb50 chore: add pi working dir gitignores 2026-01-22 23:21:01 +01:00
Mario Zechner
b0d4d1717e
Merge pull request #906 from Perlence/feat/verbose-cli-flag
feat(coding-agent): add --verbose CLI flag to override quietStartup setting (round 2)
2026-01-22 23:19:44 +01:00
Mario Zechner
e13d97f765 Merge branch 'fix/slash-menu-trigger-clean' 2026-01-22 23:12:42 +01:00
Mario Zechner
f42deae13e fix(tui): gate slash menu to empty input 2026-01-22 23:12:33 +01:00
Mario Zechner
0f0c54b812 fix(coding-agent): expand paste markers in follow-up queue
fixes #912
2026-01-22 22:35:46 +01:00
Mario Zechner
7868b25a2b feat(coding-agent): make skill invocation messages collapsible
- Add ParsedSkillBlock interface and parseSkillBlock() function
- Change skill expansion to use XML-style <skill> tags
- Add SkillInvocationMessageComponent for collapsible display
- Collapsed: single line with skill name and expand hint
- User message rendered separately after skill block

Fixes #894
2026-01-22 22:29:24 +01:00
Mario Zechner
f54e71999f fix(coding-agent): simplify extension error listener to single instance
There's only ever one bindings instance per session, so the Set/Array
approach was unnecessary. Changed from Set<ExtensionErrorListener> to
optional single listener.
2026-01-22 22:03:17 +01:00
Mario Zechner
e0742d8217 feat(coding-agent): support env vars and shell commands in headers
Header values in models.json now resolve using the same logic as apiKey:
- Environment variable names are resolved to their values
- Shell commands prefixed with ! are executed
- Literal values are used directly

This is a minor breaking change: if a header value accidentally matches
an env var name, it will now resolve to that env var's value.

Fixes #909
2026-01-22 21:50:22 +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
9b84857b83 fix(coding-agent): add 'terminated' to retryable error patterns
Codex API can send 'terminated' error mid-stream, which should be
retried like other transient server errors.
2026-01-22 21:32:56 +01:00
Mario Zechner
5e079e2ea8 fix(coding-agent): use specific terminology in reload messages instead of 'resources' 2026-01-22 19:32:14 +01:00
Mario Zechner
7d2255ddc2 fix(coding-agent): reset terminal title and working message in resetExtensionUI 2026-01-22 19:18:51 +01:00
Michael Renner
3dd95094f5
fix: allow pi-test.sh to run from any directory (#905) 2026-01-22 18:24:05 +01:00
Mario Zechner
b35950c5bd chore(coding-agent): minor cleanup in rpc-mode and shell utils 2026-01-22 14:37:17 +01:00
Sviatoslav Abakumov
07e2444b9b
feat(coding-agent): add --verbose CLI flag to override quietStartup setting 2026-01-22 17:32:47 +04:00
Mario Zechner
79268f92d0 fix(coding-agent): add missing required colors to theme-schema.json 2026-01-22 14:28:00 +01:00
Mario Zechner
d89f6e08ce fix(coding-agent): normalize raw git URLs in extension source matching
- Handle https://github.com/... URLs as git sources (not local)
- Strip .git suffix for consistent matching
2026-01-22 14:19:04 +01:00
Mario Zechner
d99b7057ca feat(coding-agent): extension package management and hot reload
Implements #645:
- ResourceLoader/PackageManager system replacing legacy discovery
- CLI commands: pi install, pi remove, pi update, pi list
- /reload command for hot reload in interactive mode
- session.reload() and session.bindExtensions() APIs
- CLI flags: --skill, --theme, --prompt-template, --no-themes, --no-prompt-templates
- Extension conflict detection with filtering
- Support for npm:, git:, local paths, and raw git URLs
- Auto npm install for git repos with package.json

closes #645
2026-01-22 13:52:09 +01:00
Mario Zechner
2b656c266b feat(coding-agent): add .gitignore to package manager install roots 2026-01-22 13:49:38 +01:00
Mario Zechner
f832a96bda docs(coding-agent): add pi list to changelog 2026-01-22 13:49:38 +01:00
Mario Zechner
ca7be6929d feat(coding-agent): run npm install after cloning git repos with package.json 2026-01-22 13:49:38 +01:00
Mario Zechner
5c047c351d fix(coding-agent): filter out conflicting extensions from loaded list 2026-01-22 13:49:38 +01:00
Mario Zechner
1faaccc5c7 fix(coding-agent): format display paths with ~ and shorten temp paths 2026-01-22 13:49:38 +01:00
Mario Zechner
8ec7d6867a fix(coding-agent): git temp path resolution, add pi list command (#645)
- Fix getGitInstallPath to check scope === 'temporary' directly
- Remove redundant temporary parameter from git methods
- Add 'pi list' command to show installed extensions from settings
2026-01-22 13:49:38 +01:00
Mario Zechner
4058680d22 feat(coding-agent): progress callbacks, conflict detection, URL parsing, tests (#645)
- Add progress callbacks to PackageManager for TUI status during install/remove/update
- Add extension conflict detection (tools, commands, flags with same names)
- Accept raw GitHub/GitLab URLs without git: prefix
- Add tests for package-manager.ts and resource-loader.ts
- Add empty fixture directories for skills tests
2026-01-22 13:49:38 +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
Michael Renner
6289c144bf
fix(ai): batch tool-result images after consecutive tool results (#902)
Fixes 400 errors when reading multiple images via GitHub Copilot's
Claude models. Claude requires tool_use -> tool_result adjacency with
no user messages interleaved.

Before: assistant(tool_calls) -> tool -> user(images) -> tool -> user(images)
After:  assistant(tool_calls) -> tool -> tool -> user(all images)
2026-01-22 13:10:10 +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
df8b3544c3 Add [Unreleased] section for next cycle 2026-01-22 01:43:26 +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
Mario Zechner
ccf6db6376 docs: add missing changelog entries for f39ec4d7, b712d1ca 2026-01-22 01:37:55 +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
Mario Zechner
b712d1ca43 fix(ai, web-ui): browser compatibility for pi-ai, update tsgo for decorator support
- Update @typescript/native-preview to 7.0.0-dev.20260120.1 (supports experimentalDecorators)
- Replace top-level node:fs, node:os, node:path imports with dynamic imports in stream.ts
- Replace top-level node:os import with dynamic import in openai-codex-responses.ts
- Replace top-level node:crypto, node:http imports with dynamic imports in openai-codex.ts
- Replace Buffer.from with atob for browser-compatible base64 decoding

fixes #873
2026-01-22 01:33:46 +01:00
Mario Zechner
d327b9c768 fix(ai): handle same-provider different-model handoff in OpenAI Responses API
When switching between OpenAI models (e.g., gpt-5-mini to gpt-5.2-codex),
function_call IDs with fc_ prefix trigger pairing validation errors because
OpenAI tracks which fc_xxx IDs were paired with rs_xxx reasoning items.

The fix omits the id field for function_calls from different models, which
avoids the pairing validation while keeping call_id for matching with
function_call_output.

Fixes #886
2026-01-22 00:58:49 +01:00
Mario Zechner
de58391085 test(ai): add failing test for orphaned function_call without reasoning item
Reproduces issue #886 where function_call is sent without its required
paired reasoning item, causing Azure/OpenAI 400 error.
2026-01-21 23:59:29 +01:00
Mario Zechner
b7cef51f3f fix(tui): don't add space after directory completion for @ file attachments 2026-01-21 23:48:41 +01:00
Mario Zechner
4ed9527213 docs: add missing changelog entries for commits since v0.49.2 2026-01-21 23:32:28 +01:00
Richard Gill
7dc652f304
Autocomplete allow searchs with /'s like: folder1/folder2 (#882)
* Extend fd autocomplete tests

* Renamed fixture type in autocomplete test
2026-01-21 23:23:51 +01:00
Aliou Diallo
69d02b8a5f
fix(coding-agent): use dynamic paths in error messages (#887)
Error messages for missing credentials and shell config now use
getAuthPath() and getSettingsPath() instead of hardcoded ~/.pi/agent/
paths, so they correctly reflect PI_CODING_AGENT_DIR when set.
2026-01-21 23:21:10 +01:00