MCPcopy Create free account
hub / github.com/anomalyco/opencode / completedToolContent

Function completedToolContent

packages/opencode/src/acp/tool.ts:103–122  ·  view source on GitHub ↗
(toolName: string, state: CompletedToolState)

Source from the content-addressed store, hash-verified

101}
102
103export function completedToolContent(toolName: string, state: CompletedToolState): ToolCallContent[] {
104 const text =
105 toolName.toLocaleLowerCase() === "read" ? (readDisplayText(state.metadata) ?? state.output) : state.output
106 const content: ToolCallContent[] = [
107 {
108 type: "content",
109 content: {
110 type: "text",
111 text,
112 },
113 },
114 ]
115
116 if (toToolKind(toolName) === "edit") {
117 content.push(...diffContent(state.input))
118 }
119
120 content.push(...imageContents(state.attachments ?? []))
121 return content
122}
123
124export function pendingToolCall(input: {
125 readonly toolCallId: string

Callers 2

tool.test.tsFile · 0.90
completedToolUpdateFunction · 0.85

Calls 5

readDisplayTextFunction · 0.85
toToolKindFunction · 0.85
diffContentFunction · 0.85
imageContentsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected