diff --git a/packages/cli/src/ui/components/messages/__snapshots__/ToolGroupDisplay.test.tsx.snap b/packages/cli/src/ui/components/messages/__snapshots__/ToolGroupDisplay.test.tsx.snap new file mode 100644 index 0000000000..56d8fb9dc7 --- /dev/null +++ b/packages/cli/src/ui/components/messages/__snapshots__/ToolGroupDisplay.test.tsx.snap @@ -0,0 +1,83 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[` > Border & Margin Logic > applies bottom margin in compact mode when group is at boundary 1`] = ` +" ✓ Compact Tool Test description +" +`; + +exports[` > Border & Margin Logic > forces top border on box when it follows a notice 1`] = ` +" Notice: + Test description + +╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ ✓ Tool in Box Test description │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ +" +`; + +exports[` > Golden Snapshots > renders error message when display info is missing 1`] = ` +" ⊷ Error: Tool display missing +" +`; + +exports[` > Golden Snapshots > renders in boxed mode (full verbosity) 1`] = ` +" +╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ ✓ Tool A Test description │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ +" +`; + +exports[` > Golden Snapshots > renders in compact mode (no box borders) 1`] = ` +" ✓ Tool A Test description + ✓ Tool B Test description +" +`; + +exports[` > Golden Snapshots > renders notices at the top (hoisting) 1`] = ` +" + Update Topic Context: + New Topic + +╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ ✓ Tool A Test description │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ +" +`; + +exports[` > Golden Snapshots > renders standalone notices without a box 1`] = ` +" + Notice Only: + Test description +" +`; + +exports[` > Result Formatting > renders compact tools with summary on same line 1`] = ` +" ✓ test-tool Test description → Success summary +" +`; + +exports[` > Result Formatting > renders placeholder for diff results 1`] = ` +" +╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ ✓ test-tool Test description │ +│ [Diff Display: 3 -> 3 chars] │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ +" +`; + +exports[` > Result Formatting > renders text results with summary below 1`] = ` +" +╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ ✓ test-tool Test description │ +│ Detailed output │ +│ │ +│ Short summary │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ +" +`; diff --git a/packages/core/src/tools/ls.ts b/packages/core/src/tools/ls.ts index c2e1a593bc..17e21359a8 100644 --- a/packages/core/src/tools/ls.ts +++ b/packages/core/src/tools/ls.ts @@ -288,6 +288,14 @@ class LSToolInvocation extends BaseToolInvocation { name: LS_DISPLAY_NAME, description: this.getDescription(), resultSummary: displayMessage, + result: { + type: 'text', + text: entries + .map( + (entry) => `${entry.isDirectory ? '[DIR] ' : ''}${entry.name}`, + ) + .join('\n'), + }, }, returnDisplay: { summary: displayMessage,