MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / invoke

Function invoke

src/server/cli.spec.ts:152–161  ·  view source on GitHub ↗
(app: Hono, args: Record<string, string>)

Source from the content-addressed store, hash-verified

150 }
151
152 const invoke = async (app: Hono, args: Record<string, string>) => {
153 const res = await app.request('/cli/ws1/workspace/invoke', {
154 method: 'POST',
155 headers: { 'Content-Type': 'application/json' },
156 body: JSON.stringify({ tool: 'inbox_read', args }),
157 })
158 const body = (await res.json()) as { content?: Array<{ text?: string }>; error?: string }
159 const payload = body.content ? JSON.parse(body.content.map((b) => b.text ?? '').join('')) : undefined
160 return { status: res.status, body, payload }
161 }
162
163 it('`--self` (string "true") coerces and filters to this workspace', async () => {
164 const app = await makeWsApp()

Callers 1

cli.spec.tsFile · 0.85

Calls 2

parseMethod · 0.80
requestMethod · 0.65

Tested by

no test coverage detected