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

Function query

ui/src/api/agentStatus.ts:12–21  ·  view source on GitHub ↗
(opts: { page?: number; pageSize?: number; name?: string } = {})

Source from the content-addressed store, hash-verified

10
11export const agentStatusApi = {
12 async query(opts: { page?: number; pageSize?: number; name?: string } = {}): Promise<ToolCallQueryResult> {
13 const params = new URLSearchParams()
14 if (opts.page) params.set('page', String(opts.page))
15 if (opts.pageSize) params.set('pageSize', String(opts.pageSize))
16 if (opts.name) params.set('name', opts.name)
17 const qs = params.toString()
18 const res = await fetch(`/api/agent-status${qs ? `?${qs}` : ''}`)
19 if (!res.ok) throw new Error('Failed to query tool calls')
20 return res.json()
21 },
22
23 async recent(opts: { afterSeq?: number; limit?: number; name?: string } = {}): Promise<{ entries: ToolCallRecord[]; lastSeq: number }> {
24 const params = new URLSearchParams()

Callers

nothing calls this directly

Calls 3

setMethod · 0.65
fetchFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected