capsule-ai-cli
Version:
The AI Model Orchestrator - Intelligent multi-model workflows with device-locked licensing
37 lines • 1.34 kB
JavaScript
import chalk from 'chalk';
import { toolRegistry } from '../tools/registry.js';
export class ToolDisplay {
activeExecutions = new Map();
n;
displayToolStart(execution) {
this.activeExecutions.set(execution.id, {
startTime: new Date(),
frameIndex: 0
});
}
displayProgress(executionId, progress) {
const tracking = this.activeExecutions.get(executionId);
if (!tracking)
return;
}
displayToolComplete(execution) {
if (execution.state === 'error' || !execution.result?.success) {
console.log(chalk.red(`● Error: ${execution.displayName}`));
if (execution.result?.error) {
console.log(chalk.red(` ${execution.result.error}`));
}
}
this.activeExecutions.delete(execution.id);
}
displayToolReference(toolName, parameters) {
const tool = toolRegistry.get(toolName);
const icon = tool?.icon || '🔧';
const displayName = tool?.displayName || toolName;
const paramStr = Object.entries(parameters)
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
.join(', ');
return chalk.dim(`${icon} ${displayName}(${paramStr})`);
}
}
export const toolDisplay = new ToolDisplay();
//# sourceMappingURL=tool-display.js.map