Commit graph

261 commits

Author SHA1 Message Date
Mario Zechner
46d4b586e7 Minor README update 2025-12-31 00:03:50 +01:00
Mario Zechner
a65a313a9a Complete web-ui README rewrite with full API documentation
- Architecture diagram
- All components (ChatPanel, AgentInterface)
- Message types and custom message extension pattern
- Tools (JavaScript REPL, Extract Document, Artifacts)
- Storage system (all stores, backends)
- Attachments processing
- CORS proxy configuration
- Dialogs
- Internationalization
2025-12-31 00:01:55 +01:00
Mario Zechner
3e11b3e68b Update web-ui CHANGELOG.md and README.md for v0.31.0
Breaking changes:
- Agent class moved to @mariozechner/pi-agent-core
- Transport abstraction removed (ProviderTransport, AppTransport)
- AppMessage renamed to AgentMessage
- UserMessageWithAttachments now has role: 'user-with-attachments'
- CustomMessages interface replaced with CustomAgentMessages
- agent.appendMessage() removed (use queueMessage())
- New agent event types from pi-agent-core

Added:
- defaultConvertToLlm, convertAttachments utilities
- isUserMessageWithAttachments, isArtifactMessage type guards
- createStreamFn for CORS proxy support
- Default streamFn and getApiKey on AgentInterface
- Proxy utilities exported

README completely rewritten to reflect new architecture.
2025-12-30 23:55:01 +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
262ba5487c Use queueMessage for notifications in example 2025-12-30 22:42:21 +01:00
Mario Zechner
b73a9169cc Add CHANGELOG.md for web-ui package 2025-12-30 22:42:21 +01:00
Mario Zechner
4d1936d3df AgentInterface sets default streamFn and getApiKey
- Make Agent.streamFn and Agent.getApiKey public
- AgentInterface sets defaults if not already set
- Example no longer needs to configure these
2025-12-30 22:42:21 +01:00
Mario Zechner
92898f486b Allow async streamFn for dynamic proxy settings
- StreamFn type now allows returning Promise
- agent-loop awaits streamFn result
- createStreamFn takes getProxyUrl callback, reads settings on each call
2025-12-30 22:42:21 +01:00
Mario Zechner
e0be2e650d Add createStreamFn for CORS proxy support
- createStreamFn(proxyUrl?) returns a sync streamFn that applies proxy
- Example reads proxy settings once when creating Agent
- Matches old ProviderTransport behavior
2025-12-30 22:42:21 +01:00
Mario Zechner
6972ce4e87 Clear streaming container on agent_end 2025-12-30 22:42:21 +01:00
Mario Zechner
347d4cf729 Fix AgentInterface to requestUpdate on all message lifecycle events
Was only handling message_update, now also handles message_start,
message_end, turn_start, turn_end, agent_start, agent_end.
2025-12-30 22:42:21 +01:00
Mario Zechner
977e4ea6ef Add getApiKey to web-ui example Agent config
Provides API keys from the provider keys store, matching old ProviderTransport behavior.
2025-12-30 22:42:21 +01:00
Mario Zechner
6a6d1a59f4 Rename customMessageTransformer to customConvertToLlm 2025-12-30 22:42:20 +01:00
Mario Zechner
13a1991ec2 Add defaultConvertToLlm to web-ui, simplify example
- web-ui exports: defaultConvertToLlm, convertAttachments, isUserMessageWithAttachments, isArtifactMessage
- defaultConvertToLlm handles UserMessageWithAttachments and filters ArtifactMessage
- Example's customMessageTransformer now extends defaultConvertToLlm
- Removes duplicated attachment conversion logic from example
2025-12-30 22:42:20 +01:00
Mario Zechner
7a39f9eb11 Fix web-ui and example for new agent API
- AgentInterface composes UserMessageWithAttachments for attachments
- Updated example to use convertToLlm instead of transport/messageTransformer
- Fixed declaration merging: target pi-agent-core, add path to example tsconfig
- Fixed typo in CustomAgentMessages key (user-with-attachment -> user-with-attachments)
- customMessageTransformer properly converts UserMessageWithAttachments to content blocks
2025-12-30 22:42:20 +01:00
Mario Zechner
6ddc7418da WIP: Major cleanup - move Attachment to consumers, simplify agent API
- Removed Attachment from agent package (now in web-ui/coding-agent)
- Agent.prompt now takes (text, images?: ImageContent[])
- Removed transports from web-ui (duplicate of agent package)
- Updated coding-agent to use local message types
- Updated mom package for new agent API

Remaining: Fix AgentInterface.ts to compose UserMessageWithAttachments
2025-12-30 22:42:20 +01:00
Mario Zechner
0e8173af00 Release v0.30.2 2025-12-26 03:25:55 +01:00
Mario Zechner
9dcb0bdba4 Release v0.30.1
fixes #320
2025-12-26 03:13:37 +01:00
Kao Félix
a7efe3d4c1 fix: use consistent model comparison including provider 2025-12-25 22:10:08 +01:00
Mario Zechner
6d97d212d5 Release v0.30.0 2025-12-25 20:35:14 +01:00
Mario Zechner
19dde0a988 Release v0.29.1 2025-12-25 18:10:11 +01:00
Mario Zechner
b48a0c9328 Release v0.29.0 2025-12-25 04:16:42 +01:00
Mario Zechner
1059d39d54 Add removeRuntimeApiKey to AuthStorage 2025-12-25 03:57:20 +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
8fdd77b652 Release v0.27.9 2025-12-24 21:25:20 +01:00
Mario Zechner
a965b6f160 Release v0.27.8 - OAuth takes priority over settings.json API keys 2025-12-24 20:52:22 +01:00
Mario Zechner
89630b0d44 Release v0.27.7 2025-12-24 18:30:53 +01:00
Mario Zechner
3eb460ee50 Release v0.27.6 2025-12-24 13:59:09 +01:00
Mario Zechner
bf313d2713 Release v0.27.5 2025-12-24 12:18:51 +01:00
Mario Zechner
20b24cf5a4 Fix symlinked skill directories not being discovered
Release v0.27.4
2025-12-24 03:32:54 +01:00
Mario Zechner
f8619c1564 Release v0.27.3 2025-12-24 02:46:23 +01:00
Mario Zechner
c57ed89110 Release v0.27.2 2025-12-23 03:48:52 +01:00
Mario Zechner
4492a3f304 Release v0.27.1 2025-12-22 19:28:26 +01:00
Mario Zechner
b9b44f4cf4 Release v0.27.0 2025-12-22 18:20:10 +01:00
Mario Zechner
7e1b632596 Release v0.26.1 2025-12-22 16:19:19 +01:00
Mario Zechner
42bc368e70 Release v0.26.0 2025-12-22 12:53:58 +01:00
Mario Zechner
11e743373d Fix syntax highlighting stderr spam with malformed markdown, fixes #274 2025-12-22 00:23:01 +01:00
Mario Zechner
d5fd685901 Enable more biome lints and fix things 2025-12-21 22:56:20 +01:00
Mario Zechner
9c18439c4d Release v0.25.3 2025-12-21 21:01:27 +01:00
Mario Zechner
299986f06b Release v0.25.2 2025-12-21 02:59:03 +01:00
Mario Zechner
c97702cf91 Release v0.25.1 2025-12-21 02:43:47 +01:00
Mario Zechner
df07a74ad5 Release v0.25.0 2025-12-20 22:02:47 +01:00
Mario Zechner
085294b764 Release v0.24.5 2025-12-19 22:09:35 +01:00
Mario Zechner
f377c3c9c3 Release v0.24.4 2025-12-19 21:54:36 +01:00
Mario Zechner
ad4eb3afa6 Release v0.24.3 2025-12-19 21:36:16 +01:00
Mario Zechner
5095b4eb02 Release v0.24.2 2025-12-19 21:12:53 +01:00
Mario Zechner
50b055f3ae Release v0.24.1 2025-12-19 20:51:44 +01:00
Mario Zechner
16685a36ec Release v0.24.0 2025-12-19 05:21:25 +01:00
Mario Zechner
f92147ffe8 Release v0.23.5 2025-12-19 05:15:34 +01:00
Ahmed Kamal
1167e84453
Fix expired OAuth tokens in long-running agent loops (#223)
Add getApiKey hook to AgentLoopConfig that resolves API keys dynamically
before each LLM call. This allows short-lived OAuth tokens (e.g. GitHub
Copilot, Anthropic OAuth) to be refreshed between turns when tool
execution takes a long time.

Previously, the API key was resolved once when ProviderTransport.run()
was called and passed as a static string to the agent loop. If the loop
ran for longer than the token lifetime (e.g. 30 minutes for Copilot),
subsequent LLM calls would fail with expired token errors.

Changes:
- Add getApiKey hook to AgentLoopConfig (packages/ai)
- Call getApiKey before each LLM call in streamAssistantResponse
- Update ProviderTransport to pass getApiKey instead of static apiKey
- Update web-ui ProviderTransport with same pattern
2025-12-19 01:36:25 +01:00