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

Function completedTool

packages/opencode/test/cli/run/stream.transport.test.ts:249–278  ·  view source on GitHub ↗
(input: {
  sessionID: string
  messageID: string
  id: string
  callID: string
  tool: string
  body: Record<string, unknown>
  output?: string
  metadata?: Record<string, unknown>
})

Source from the content-addressed store, hash-verified

247}
248
249function completedTool(input: {
250 sessionID: string
251 messageID: string
252 id: string
253 callID: string
254 tool: string
255 body: Record<string, unknown>
256 output?: string
257 metadata?: Record<string, unknown>
258}): SessionToolPart {
259 return {
260 id: input.id,
261 sessionID: input.sessionID,
262 messageID: input.messageID,
263 type: "tool",
264 callID: input.callID,
265 tool: input.tool,
266 state: {
267 status: "completed",
268 input: input.body,
269 output: input.output ?? "",
270 title: input.tool,
271 metadata: input.metadata ?? {},
272 time: {
273 start: 1,
274 end: 2,
275 },
276 },
277 }
278}
279
280function textPart(id: string, messageID: string, text: string, sessionID = "session-1"): TextPart {
281 return {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected