@@ -13,6 +13,7 @@ import {MarkupColorizer} from "./ports/markup-colorizer.ts";
1313import { Interpreter } from "./interpreter.ts" ;
1414import { ToolUseSuccess } from "./events/tool-use-success.ts" ;
1515import { ClaudeIOEvent } from "./events/claude-io-event.type.js" ;
16+ import { TaskToolCall } from "./events/task-tool-call.ts" ;
1617
1718describe ( "Interpreter" , ( ) => {
1819 it ( "outputs a generic tool call event" , async ( ) => {
@@ -308,4 +309,40 @@ describe("Interpreter", () => {
308309 "$ echo hello\nYou don't have permission.\n" ,
309310 ) ;
310311 } ) ;
312+
313+ it ( "formats a task tool call" , async ( ) => {
314+ const outputFake = new OutputFake ( ) ;
315+ const interpreter = new Interpreter ( outputFake , new NullColorizer ( ) ) ;
316+
317+ await interpreter . process (
318+ new TaskToolCall ( {
319+ toolUseId : "1" ,
320+ subagentType : "Explore" ,
321+ description : "look around" ,
322+ prompt : "a prompt" ,
323+ } ) ,
324+ ) ;
325+
326+ expect ( outputFake . value ( ) ) . toBe (
327+ "Task (Explore): look around\na prompt\n" ,
328+ ) ;
329+ } ) ;
330+
331+ it ( "colorizes a task tool call" , async ( ) => {
332+ const outputFake = new OutputFake ( ) ;
333+ const interpreter = new Interpreter ( outputFake , new MarkupColorizer ( ) ) ;
334+
335+ await interpreter . process (
336+ new TaskToolCall ( {
337+ toolUseId : "1" ,
338+ subagentType : "Explore" ,
339+ description : "look around" ,
340+ prompt : "a prompt" ,
341+ } ) ,
342+ ) ;
343+
344+ expect ( outputFake . value ( ) ) . toBe (
345+ "[[importantAction Task (Explore): look around]]\na prompt\n" ,
346+ ) ;
347+ } ) ;
311348} ) ;
0 commit comments