MCPcopy Create free account
hub / github.com/tiann/hapi / callListOpencodeModels

Function callListOpencodeModels

cli/src/api/apiMachine.test.ts:40–49  ·  view source on GitHub ↗
(client: ApiMachineClient, machineId: string, cwd: string)

Source from the content-addressed store, hash-verified

38}
39
40async function callListOpencodeModels(client: ApiMachineClient, machineId: string, cwd: string): Promise<unknown> {
41 // Reach into the private rpc handler manager to dispatch a request.
42 // Mirrors how the on-socket 'rpc-request' listener invokes handleRequest.
43 const manager = (client as unknown as { rpcHandlerManager: { handleRequest: (req: { method: string; params: string }) => Promise<string> } }).rpcHandlerManager
44 const raw = await manager.handleRequest({
45 method: `${machineId}:listOpencodeModelsForCwd`,
46 params: JSON.stringify({ cwd })
47 })
48 return JSON.parse(raw) as unknown
49}
50
51describe('ApiMachineClient listOpencodeModelsForCwd handler', () => {
52 let workspaceRoot: string

Callers 1

apiMachine.test.tsFile · 0.85

Calls 1

handleRequestMethod · 0.45

Tested by

no test coverage detected