Commit graph

56 commits

Author SHA1 Message Date
43337449e3 packages 2026-03-05 15:55:27 -08:00
Mario Zechner
e0754fdbb3 fix(ai,coding-agent): make pi-ai browser-safe and move OAuth runtime exports
- add browser smoke bundling check to root check + pre-commit

- lazy-load Bedrock provider registration to avoid browser graph traversal

- remove top-level OAuth runtime exports from @mariozechner/pi-ai

- add @mariozechner/pi-ai/oauth subpath export and update coding-agent imports

- move proxy dispatcher init to coding-agent CLI (Node-only)

- document Bedrock/OAuth browser limitations

closes #1814
2026-03-04 20:21:25 +01:00
Mario Zechner
76a191c264 fix(scripts): make npm scripts cross-platform with shx (closes #1771) 2026-03-03 14:26:01 +01:00
Vaclav Synacek
693187a3fb
Make koffi optional dependency for cross-platform support (#1603)
Koffi is only used on Windows for VT input support and fails to build
on Termux/Android and Linux systems without build tools. Moving it to
optionalDependencies allows installation to succeed on all platforms
while maintaining Windows functionality.
2026-03-03 09:21:47 +01:00
Mario Zechner
2f55890452 fix(coding-agent,ai): finalize provider unregister lifecycle and dependency security updates fixes #1669 2026-02-27 21:00:25 +01:00
Duncan Ogilvie
9e22d3913a
fix(tui): enable VT input mode on Windows (#1495)
This fixes Shift+Tab not being recognized correctly
2026-02-14 01:45:11 +01:00
Mario Zechner
4c4d787b1a feat(ai): add adaptive thinking support for Claude Opus 4.6
- Add adaptive thinking mode (type: 'adaptive') for Opus 4.6+
- Add effort parameter ('low', 'medium', 'high', 'max') for adaptive thinking
- thinkingEnabled now auto-detects: adaptive for 4.6+, budget-based for older
- streamSimple/completeSimple map ThinkingLevel to effort levels for Opus 4.6
- Add tests for Opus 4.6 adaptive thinking and GPT-5.3 Codex
- Update @anthropic-ai/sdk to 0.73.0
- Update @aws-sdk/client-bedrock-runtime to 3.983.0
- Update @google/genai to 1.40.0
- Remove fast-xml-parser override (no longer needed)
2026-02-05 21:14:11 +01:00
Mario Zechner
3297a47c40 chore(deps): update glob and overrides 2026-02-04 02:21:06 +01:00
4h9fbZ
993c45a059 feat(coding-agent): add Qwen CLI OAuth provider 2026-02-01 01:51:55 +01:00
Mario Zechner
1bd68327f3 fix: make pre-commit hook fail on lint warnings, fix template literal warnings
- Add --error-on-warnings to biome check in root and web-ui package.json
- Convert string concatenation to template literals in daxnuts.ts
- Convert string concatenation to template literals in test file

Fixes #1103
2026-02-01 00:25:57 +01:00
Mario Zechner
c9fa28e626 fix: override fast-xml-parser to 5.3.4 to resolve CVE 2026-01-31 23:48:22 +01:00
Mario Zechner
758baa9fec refactor: rename custom provider examples
- custom-provider -> custom-provider-anthropic
- gitlab-duo -> custom-provider-gitlab-duo
- Update READMEs with custom provider section
2026-01-25 00:18:13 +01:00
Mario Zechner
3e6d8dc72a feat: add GitLab Duo provider extension example
- Delegates to pi-ai's built-in Anthropic/OpenAI streaming
- OAuth support with GitLab's bundled client ID
- Direct access token caching (25 min TTL)
- Models: duo-chat-opus/sonnet/haiku-4-5, duo-chat-gpt-5-1/mini/codex
- No external dependencies beyond pi-ai
2026-01-24 23:51:17 +01:00
Mario Zechner
2c5d202778 chore: add custom-provider to workspaces for auto-install 2026-01-24 23:22:33 +01:00
Danila Poyarkov
6d0c544e18 fix: Bun compatibility for build scripts and runtime detection 2026-01-23 19:31:16 +03: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
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
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
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
Aliou Diallo
80be0fc901
fix(ci): fix typecheck by adding example to workspace (#467) 2026-01-05 16:54:04 +01:00
Mario Zechner
0f98decf65 Remove proxy package
The proxy functionality is now handled by web-ui's createStreamFn
with external proxy servers.
2025-12-30 22:42:21 +01:00
Mario Zechner
6bbe3147d8 Add release script
Usage: npm run release:patch|minor|major

Automates:
- Check for uncommitted changes
- Bump version
- Update CHANGELOGs: [Unreleased] -> [version] - date
- Commit and tag
- Publish to npm
- Add new [Unreleased] sections
- Push
2025-12-30 22:42:21 +01:00
Mario Zechner
6af547afd9 Version updates 2025-12-30 22:42:18 +01:00
Mario Zechner
030788140a WIP: Remove global state from pi-ai OAuth/API key handling
- Remove setApiKey, resolveApiKey, and global apiKeys Map from stream.ts
- Rename getApiKey to getApiKeyFromEnv (only checks env vars)
- Remove OAuth storage layer (storage.ts deleted)
- OAuth login/refresh functions now return credentials instead of saving
- getOAuthApiKey/refreshOAuthToken now take credentials as params
- Add test/oauth.ts helper for ai package tests
- Simplify root npm run check (single biome + tsgo pass)
- Remove redundant check scripts from most packages
- Add web-ui and coding-agent examples to biome/tsgo includes

coding-agent still has compile errors - needs refactoring for new API
2025-12-25 01:01:03 +01:00
Mario Zechner
b02516a5cd Switch to more stable, oldder tsgo, switch all check scripts to tsgo 2025-12-18 15:20:41 +01:00
Mario Zechner
21229398ad Update tsgo, switch to tsc for agent package, as tsgo hangs on Alpine in Docker x86 2025-12-18 15:02:03 +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
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
238c5d34e4 Fix tsgo type issues: update tsgo, fix ReasoningEffort import, remove broken enum-test 2025-12-08 22:59:13 +01:00
Mario Zechner
1517e64869 chore: bump version to 0.12.6 2025-12-03 17:12:27 +01:00
Mario Zechner
e0c057ecc6 Add web-ui/example to workspaces, remove CI workaround 2025-12-03 14:27:02 +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
e1856daf57 fix: rename pi-agent to pi-agent-core (npm deprecation issue) 2025-11-21 22:20:43 +01:00
Mario Zechner
aa46dfecd4 Release v0.8.3 2025-11-21 04:57:24 +01:00
Mario Zechner
93a60b7969 Downgrade Biome to 2.3.5 to fix false positive noUnusedPrivateClassMembers warnings 2025-11-20 22:32:45 +01:00
Mario Zechner
3655ce74f1 Fix: Change prepublish to prepublishOnly to prevent build failing on npm install
The prepublish hook was running during npm install, before optional platform-specific dependencies were installed. This caused build failures on Linux for packages like @typescript/native-preview-linux-x64 and @parcel/watcher-linux-x64-glibc.

prepublishOnly only runs before npm publish, not during install.

Fixes #41
2025-11-20 17:47:52 +01:00
Mario Zechner
43a1c1ae44 chore: sync all versions to 0.6.2 and fix workspace references 2025-11-12 23:44:05 +01:00
Mario Zechner
e467a80b5b Add /export command to export sessions as self-contained HTML
- Add exportSessionToHtml function that generates beautifully formatted HTML exports
- HTML includes session metadata, all messages, tool calls, tool results, thinking blocks, and images
- Support for ANSI color codes in tool output (converted to HTML)
- Self-contained with inline CSS (dark theme, responsive design, print-friendly)
- Add /export slash command to TUI with optional filename parameter
- Add agent and coding-agent to dev script for watch mode
- Increment coding-agent version to 0.6.1

Usage: /export [optional-filename.html]
2025-11-12 16:21:59 +01:00
Mario Zechner
e533aebacd Fix Lit dependency duplication and update mini-lit to 0.2.0
- Move lit from dependencies to peerDependencies in web-ui to prevent multiple Lit instances being loaded
- Update mini-lit from 0.1.8/0.1.10 to 0.2.0 in root package.json and web-ui/package.json
- Install @tailwindcss/vite in web-ui/example
- Run biome formatting fixes across codebase

This resolves HMR custom element re-registration errors caused by duplicate Lit registries.
2025-11-12 16:03:43 +01:00
Mario Zechner
985f955ea0 Clean up TUI package and refactor component structure
- Remove old TUI implementation and components (LoadingAnimation, MarkdownComponent, TextComponent, TextEditor, WhitespaceComponent)
- Rename components-new to components with new API (Loader, Markdown, Text, Editor, Spacer)
- Move Text and Input components to separate files in src/components/
- Add render caching to Text component (similar to Markdown)
- Add proper ANSI code handling in Text component using stripVTControlCharacters
- Update coding-agent to use new TUI API (requires ProcessTerminal, uses custom Editor subclass for key handling)
- Remove old test files, keep only chat-simple.ts and virtual-terminal.ts
- Update README.md with new minimal API documentation
- Switch from tsc to tsgo for type checking
- Update package dependencies across monorepo
2025-11-11 10:32:18 +01:00
Mario Zechner
92f8801864 Fix message editor height adjustment, requires Chrome +123 2025-10-29 16:11:05 +01:00
Mario Zechner
e31973218e 0.0.2 2025-10-26 21:22:43 +01:00
Mario Zechner
ffc9be8867 Agent package + coding agent WIP, refactored web-ui prompts 2025-10-17 11:47:01 +02:00
Mario Zechner
aa005d062a Remove browser-extension package (migrated to separate sitegeist repo)
- Remove packages/browser-extension directory
- Update package.json scripts to remove browser-ext from build and dev
- Extension now lives at https://github.com/badlogic/sitegeist
- Uses file: dependencies to pi-ai and pi-web-ui for development
2025-10-06 18:38:25 +02:00
Mario Zechner
0496651308 Add Anthropic prompt caching, pluggable storage, and CORS proxy support
Storage Architecture:
- New pluggable storage system with backends (LocalStorage, ChromeStorage, IndexedDB)
- SettingsRepository for app settings (proxy config, etc.)
- ProviderKeysRepository for API key management
- AppStorage with global accessors (getAppStorage, setAppStorage, initAppStorage)

Transport Refactoring:
- Renamed DirectTransport → ProviderTransport (calls LLM providers with optional CORS proxy)
- Renamed ProxyTransport → AppTransport (uses app server with user auth)
- Updated TransportMode: "direct" → "provider", "proxy" → "app"

CORS Proxy Integration:
- ProviderTransport checks proxy.enabled/proxy.url from storage
- When enabled, modifies model baseUrl to route through proxy: {proxyUrl}/?url={originalBaseUrl}
- ProviderKeyInput test function also honors proxy settings
- Settings dialog with Proxy tab (Switch toggle, URL input, explanatory description)

Anthropic Prompt Caching:
- System prompt cached with cache_control markers (both OAuth and regular API keys)
- Last user message cached to cache conversation history
- Saves 90% on input tokens for cached content (10x cost reduction)

Settings Dialog Improvements:
- Configurable tab system with SettingsTab base class
- ApiKeysTab and ProxyTab as custom elements
- Switch toggle for proxy enable (instead of Checkbox)
- Explanatory paragraphs for each tab
- ApiKeyPromptDialog reuses ProviderKeyInput component

Removed:
- Deprecated ApiKeysDialog (replaced by ProviderKeyInput in SettingsDialog)
- Old storage-adapter and key-store (replaced by new storage architecture)
2025-10-05 23:00:36 +02:00
Mario Zechner
66f092c0c6 Proxy package 2025-10-05 19:02:15 +02:00
Mario Zechner
aaea0f4600 Integrate JailJS for CSP-restricted execution in browser extension
Major changes:
- Migrate browser-extension to use web-ui package (85% code reduction)
- Add JailJS content script with ES6+ transform support
- Expose DOM constructors (Event, KeyboardEvent, etc.) to JailJS
- Support top-level await by wrapping code in async IIFE
- Add returnFile() support in JailJS execution
- Refactor KeyStore into pluggable storage-adapter pattern
- Make ChatPanel configurable with sandboxUrlProvider and additionalTools
- Update jailjs to 0.1.1

Files deleted (33 duplicate files):
- All browser-extension components, dialogs, state, tools, utils
- Now using web-ui versions via @mariozechner/pi-web-ui

Files added:
- packages/browser-extension/src/content.ts (JailJS content script)
- packages/web-ui/src/state/storage-adapter.ts
- packages/web-ui/src/state/key-store.ts

Browser extension now has only 5 source files (down from 38).
2025-10-05 16:58:31 +02:00
Mario Zechner
9d6267a915 Fix javascript-repl renderer to use console-block component 2025-10-04 21:44:23 +02:00
Mario Zechner
b67c10dfb1 feat: add cross-browser extension with AI reading assistant
- Create Pi Reader browser extension for Chrome/Firefox
- Chrome uses Side Panel API, Firefox uses Sidebar Action API
- Supports both browsers with separate manifests and unified codebase
- Built with mini-lit components and Tailwind CSS v4
- Features model selection dialog with Ollama support
- Hot reload development server watches both browser builds
- Add useDefineForClassFields: false to fix LitElement reactivity
2025-10-01 04:33:56 +02:00