MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / buildToolPart

Function buildToolPart

tests/token-counting.test.ts:26–36  ·  view source on GitHub ↗
(tool: string, state: Record<string, any>)

Source from the content-addressed store, hash-verified

24}
25
26function buildToolPart(tool: string, state: Record<string, any>) {
27 return {
28 id: `tool-${tool}`,
29 messageID: "msg-tool",
30 sessionID: "ses_token_counting",
31 type: "tool" as const,
32 tool,
33 callID: `call-${tool}`,
34 state,
35 }
36}
37
38function assertCounted(part: Record<string, any>, expectedContents: string[]) {
39 assert.deepEqual(extractToolContent(part), expectedContents)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected