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

Function toolCommit

packages/opencode/test/cli/run/entry.body.test.ts:22–40  ·  view source on GitHub ↗
(input: {
  tool: string
  state: ToolPart["state"]
  phase?: StreamCommit["phase"]
  toolState?: StreamCommit["toolState"]
  text?: string
  id?: string
  messageID?: string
})

Source from the content-addressed store, hash-verified

20}
21
22function toolCommit(input: {
23 tool: string
24 state: ToolPart["state"]
25 phase?: StreamCommit["phase"]
26 toolState?: StreamCommit["toolState"]
27 text?: string
28 id?: string
29 messageID?: string
30}) {
31 return commit({
32 kind: "tool",
33 text: input.text ?? "",
34 phase: input.phase ?? "final",
35 source: "tool",
36 tool: input.tool,
37 toolState: input.toolState ?? "completed",
38 part: toolPart(input.tool, input.state, input.id, input.messageID),
39 })
40}
41
42function structured(next: StreamCommit) {
43 const body = entryBody(next)

Callers 1

entry.body.test.tsFile · 0.70

Calls 2

commitFunction · 0.70
toolPartFunction · 0.70

Tested by

no test coverage detected