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,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);
}