Commit graph

17 commits

Author SHA1 Message Date
Mario Zechner
c63f33d83b docs(agent): update steering and options 2026-01-18 19:21:52 +01:00
Mario Zechner
6f7c10e323 Add setEditorText/getEditorText to hook UI context, improve custom() API
- Add setEditorText() and getEditorText() to HookUIContext for prompt generator pattern
- custom() now accepts async factories for fire-and-forget work
- Add CancellableLoader component to tui package
- Add BorderedLoader component for hooks with cancel UI
- Export HookAPI, HookContext, HookFactory from main package
- Update all examples to import from packages instead of relative paths
- Update hooks.md and custom-tools.md documentation

fixes #350
2026-01-01 00:04:56 +01:00
Mario Zechner
93f8d6e659 Fix README: tools are AgentTool, not extending Tool 2025-12-30 23:46:41 +01:00
Mario Zechner
b939f2b529 Fix README: use assistantMessageEvent.delta for streaming, not accumulated message 2025-12-30 23:43:27 +01:00
Mario Zechner
ae55389051 Rewrite agent README with clearer structure and event flow documentation 2025-12-30 23:40:49 +01:00
Mario Zechner
74637403b6 Update agent package: changelog, fix README type name, export proxy utilities 2025-12-30 23:33:32 +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
f86dea2e4f Expand README with AgentMessage/LLM conversion, event semantics, partial messages
- Explain AgentMessage vs LLM Message separation and why it's needed
- Document conversion flow: AgentMessage -> transformContext -> convertToLlm -> LLM
- Clarify that prompt/queueMessage/continue must convert to user or toolResult
- Document message_start/end events for prompt() and queued messages
- Explain message_update is assistant-only with partial content
- Add pattern for handling partial messages in reactive UIs
- Document agent.state.streamMessage for accessing current partial
2025-12-30 22:42:20 +01:00
Mario Zechner
b6d9442916 Fix README: prompt takes ImageContent[], not Attachment[] 2025-12-30 22:42:20 +01:00
Mario Zechner
fa22595f25 Update READMEs: remove agent section from pi-ai, rewrite pi-agent-core
- Removed Agent API section from pi-ai README (moved to agent package)
- Rewrote agent package README for new architecture:
  - No more transports (ProviderTransport, AppTransport removed)
  - Uses streamFn directly with streamProxy for proxy usage
  - Documents convertToLlm and transformContext
  - Documents low-level agentLoop/agentLoopContinue API
  - Updated custom message types documentation
2025-12-30 22:42:20 +01:00
Mario Zechner
7ac832586f Add tool result streaming
- Add AgentToolUpdateCallback type and optional onUpdate callback to AgentTool.execute()
- Add tool_execution_update event with toolCallId, toolName, args, partialResult
- Normalize tool_execution_end to always use AgentToolResult (no more string fallback)
- Bash tool streams truncated rolling buffer output during execution
- ToolExecutionComponent shows last N lines when collapsed (not first N)
- Interactive mode handles tool_execution_update events
- Update RPC docs and ai/agent READMEs

fixes #44
2025-12-16 14:53:17 +01:00
Mario Zechner
ffc9be8867 Agent package + coding agent WIP, refactored web-ui prompts 2025-10-17 11:47:01 +02:00
Mario Zechner
f82e82da93 docs: Improve reasoning support table clarity
- Remove redundant 'Reasoning Tokens' column (all models count them)
- Group by provider for better readability
- Clarify model limitations vs API limitations
- Simplify check marks to focus on thinking content availability
2025-08-10 02:13:13 +02:00
Mario Zechner
047d9af407 docs: Fix outdated Gemini thinking content notes
Gemini 2.5 thinking content IS fully supported - we handle extra_body automatically
2025-08-10 01:56:20 +02:00
Mario Zechner
99ce76d66e feat(agent): Comprehensive reasoning token support across providers
Added provider-specific reasoning/thinking token support for:
- OpenAI (o1, o3, gpt-5): Full reasoning events via Responses API, token counts via Chat Completions
- Groq: reasoning_format:"parsed" for Chat Completions, no summary support for Responses
- Gemini 2.5: extra_body.google.thinking_config with <thought> tag extraction
- OpenRouter: Unified reasoning parameter with message.reasoning field
- Anthropic: Limited support via OpenAI compatibility layer

Key improvements:
- Centralized provider detection based on baseURL
- parseReasoningFromMessage() extracts provider-specific reasoning content
- adjustRequestForProvider() handles provider-specific request modifications
- Smart reasoning support detection with caching per API type
- Comprehensive README documentation with provider support matrix

Fixes reasoning tokens not appearing for GPT-5 and other reasoning models.
2025-08-10 01:46:15 +02:00
Mario Zechner
9157411034 Updated agent README.md with test advise 2025-08-09 21:17:46 +02:00
Mario Zechner
a74c5da112 Initial monorepo setup with npm workspaces and dual TypeScript configuration
- Set up npm workspaces for three packages: pi-tui, pi-agent, and pi (pods)
- Implemented dual TypeScript configuration:
  - Root tsconfig.json with path mappings for development and type checking
  - Package-specific tsconfig.build.json for clean production builds
- Configured lockstep versioning with sync script for inter-package dependencies
- Added comprehensive documentation for development and publishing workflows
- All packages at version 0.5.0 ready for npm publishing
2025-08-09 17:18:38 +02:00