Skip to content

Commit f257541

Browse files
committed
refactor(acp): extract tool and command formatting into dedicated modules
1 parent 5345c98 commit f257541

3 files changed

Lines changed: 502 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { ToolKind } from "@agentclientprotocol/sdk"
2+
3+
export namespace ParseCommand {
4+
export interface Result {
5+
kind: ToolKind
6+
title: string
7+
locations: { path: string }[]
8+
terminalOutput: boolean
9+
}
10+
11+
export function format(command: string, description: string, cwd: string): Result {
12+
const title = description || command || "Terminal"
13+
14+
return {
15+
kind: "other",
16+
title,
17+
locations: cwd ? [{ path: cwd }] : [],
18+
terminalOutput: true,
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)