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

Function runningToolUpdate

packages/opencode/src/acp/tool.ts:140–168  ·  view source on GitHub ↗
(input: {
  readonly toolCallId: string
  readonly toolName: string
  readonly state: RunningToolState
  readonly output?: string
  readonly cwd?: string
})

Source from the content-addressed store, hash-verified

138}
139
140export function runningToolUpdate(input: {
141 readonly toolCallId: string
142 readonly toolName: string
143 readonly state: RunningToolState
144 readonly output?: string
145 readonly cwd?: string
146}): ToolCallUpdate {
147 const content = input.output
148 ? [
149 {
150 type: "content" as const,
151 content: {
152 type: "text" as const,
153 text: input.output,
154 },
155 },
156 ]
157 : undefined
158
159 return {
160 toolCallId: input.toolCallId,
161 status: "in_progress",
162 kind: toToolKind(input.toolName),
163 title: toolTitle(input.toolName, input.state.input, input.state.title),
164 locations: toLocations(input.toolName, input.state.input, input.cwd),
165 rawInput: rawInput(input.toolName, input.state.input, input.cwd),
166 ...(content ? { content } : {}),
167 }
168}
169
170export function duplicateRunningToolUpdate(input: {
171 readonly toolCallId: string

Callers 1

runningToolMethod · 0.90

Calls 4

toToolKindFunction · 0.85
toolTitleFunction · 0.85
toLocationsFunction · 0.85
rawInputFunction · 0.85

Tested by

no test coverage detected