From 09114e7c02d4975ede63f915d7ace55a2170697d Mon Sep 17 00:00:00 2001 From: Rediet Bekele Date: Fri, 20 Feb 2026 16:11:06 +0000 Subject: [PATCH] feat(tools): add select_active_intent definition and output formatting --- apps/cli/src/ui/utils/tools.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/apps/cli/src/ui/utils/tools.ts b/apps/cli/src/ui/utils/tools.ts index b79a506571..dc86fd8ebd 100644 --- a/apps/cli/src/ui/utils/tools.ts +++ b/apps/cli/src/ui/utils/tools.ts @@ -6,6 +6,21 @@ import type { ToolData } from "../types.js" * Extract structured ToolData from parsed tool JSON * This provides rich data for tool-specific renderers */ + +// src/tools/tool.ts + +export interface SelectActiveIntentPayload { + intent_id: string; +} + +export const selectActiveIntent = { + name: "select_active_intent", + description: "Load context for a specific intent before execution", + parameters: { + intent_id: "string" + } +}; + export function extractToolData(toolInfo: Record): ToolData { const toolName = (toolInfo.tool as string) || "unknown" @@ -111,6 +126,11 @@ export function formatToolOutput(toolInfo: Record): string { const reason = toolInfo.reason as string return `→ ${mode} mode${reason ? `\n ${reason}` : ""}` } + + case "select_active_intent": { + const intentId = toolInfo.intent_id as string; + return `🔑 Selected Intent: ${intentId || "(none)"}`; + } case "switch_mode": { const mode = (toolInfo.mode_slug as string) || (toolInfo.mode as string) || "unknown" @@ -207,6 +227,12 @@ export function formatToolAskMessage(toolInfo: Record): string return `Switch to ${mode} mode?${reason ? `\nReason: ${reason}` : ""}` } + case "select_active_intent": { + const intentId = toolInfo.intent_id as string; + return `Load context for intent: ${intentId}?`; + } + + case "execute_command": { const command = toolInfo.command as string return `Run command?\n$ ${command || "(no command)"}`