MCPcopy Index your code
hub / github.com/anomalyco/opencode / tool

Function tool

packages/opencode/test/cli/run/session-data.test.ts:96–111  ·  view source on GitHub ↗
(input: { id: string; messageID: string; tool: string; state: Record<string, unknown>; callID?: string })

Source from the content-addressed store, hash-verified

94}
95
96function tool(input: { id: string; messageID: string; tool: string; state: Record<string, unknown>; callID?: string }) {
97 return {
98 type: "message.part.updated",
99 properties: {
100 part: {
101 id: input.id,
102 messageID: input.messageID,
103 sessionID: "session-1",
104 type: "tool",
105 tool: input.tool,
106 ...(input.callID ? { callID: input.callID } : {}),
107 state: input.state,
108 },
109 },
110 }
111}
112
113describe("run session data", () => {
114 test("buffers delayed assistant text until the role is known", () => {

Calls

no outgoing calls

Tested by

no test coverage detected