BIG pi update with claude chat

This commit is contained in:
Jonas H
2026-04-24 14:22:59 +02:00
parent fbb00a49ba
commit 248667468c
24 changed files with 4225 additions and 1112 deletions

View File

@@ -0,0 +1,23 @@
# Pi Ask Tool Extension
This extension bridges Claude Code's ask functionality into pi's TUI, allowing users to ask questions and receive answers directly in the TUI interface.
## Features
- Seamless integration with pi's TUI
- Support for all Claude agents (plan_review, code_review, debug, oracle)
- Multi-turn conversations with session management
- Context-aware responses based on codebase exploration
## Usage
1. Run the CLI agent: `pi-ask-tool`
2. Type your question in the TUI
3. Receive answers directly in the TUI interface
4. Continue the conversation or start new ones
## Configuration
Default agent: `code_review`
Default model: `sonnet`
Session persistence: Enabled

View File

@@ -0,0 +1,37 @@
// Pi Ask Tool CLI Agent
import { ask_claude } from "../../@piplugin/ask-claude"
import { sessionId } from '../shared';
export async function start() {
console.log('Pi Ask Tool initialized');
while (true) {
// Get user input from TUI (simplified for example)
const userInput = await getTUIInput('Ask a question:');
// Handle multi-turn sessions via sessionId
const response = await ask_claude({
prompt: userInput,
agent: 'code_review', // Default agent
session_id: sessionId
});
// Display answer in TUI
await showTUIResult(response);
// Update session context if needed
sessionId = response.session_id || sessionId;
}
}
// Mock TUI handlers - implement actual TUI integration
async function getTUIInput(question: string) {
// Replace with real TUI input method
const input = process.stdin.read().toString();
return input;
}
async function showTUIResult(result: any) {
console.log('Answer:', result.summary || result);
}