qlogicagent 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.js +10 -9
- package/dist/cli.js +213 -211
- package/dist/index.js +212 -210
- package/dist/orchestration.js +13 -12
- package/dist/protocol.js +1 -0
- package/dist/types/agent/constants.d.ts +4 -53
- package/dist/types/agent/tunable-defaults.d.ts +225 -0
- package/dist/types/agent/types.d.ts +24 -100
- package/dist/types/cli/stdio-server.d.ts +40 -0
- package/dist/types/cli/tool-bootstrap.d.ts +6 -0
- package/dist/types/contracts/index.d.ts +2 -3
- package/dist/types/llm/provider-def.d.ts +3 -0
- package/dist/types/llm/transport.d.ts +25 -25
- package/dist/types/llm/transports/anthropic-messages.d.ts +2 -2
- package/dist/types/llm/transports/gemini-generatecontent.d.ts +2 -2
- package/dist/types/llm/transports/openai-chat.d.ts +2 -2
- package/dist/types/llm/transports/openai-responses.d.ts +9 -9
- package/dist/types/llm/transports/volcengine-responses.d.ts +11 -11
- package/dist/types/orchestration/agent-instance.d.ts +15 -0
- package/dist/types/orchestration/skill-improvement.d.ts +39 -8
- package/dist/types/orchestration/solo-evaluator.d.ts +7 -0
- package/dist/types/orchestration/subagent/fork-subagent.d.ts +2 -2
- package/dist/types/orchestration/tool-loop/tool-choice-policy.d.ts +1 -1
- package/dist/types/protocol/methods.d.ts +143 -53
- package/dist/types/protocol/notifications.d.ts +4 -495
- package/dist/types/protocol/wire/acp-protocol.d.ts +411 -0
- package/dist/types/protocol/wire/agent-events.d.ts +32 -0
- package/dist/types/protocol/wire/agent-methods.d.ts +587 -0
- package/dist/types/protocol/wire/agent-rpc.d.ts +97 -0
- package/dist/types/protocol/wire/capability-manifest.d.ts +111 -0
- package/dist/types/protocol/wire/capability-transport.d.ts +207 -0
- package/dist/types/protocol/wire/channel-ingress.d.ts +29 -0
- package/dist/types/protocol/wire/channel.d.ts +89 -0
- package/dist/types/protocol/wire/chat-types.d.ts +87 -0
- package/dist/types/protocol/wire/checkpoint-runtime.d.ts +61 -0
- package/dist/types/protocol/wire/checkpoint.d.ts +72 -0
- package/dist/types/protocol/wire/execution.d.ts +391 -0
- package/dist/types/protocol/wire/gateway-rpc.d.ts +314 -0
- package/dist/types/protocol/wire/gateway.d.ts +62 -0
- package/dist/types/protocol/wire/hook-protocol.d.ts +37 -0
- package/dist/types/protocol/wire/index.d.ts +25 -0
- package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +80 -0
- package/dist/types/protocol/wire/notification-payloads.d.ts +581 -0
- package/dist/types/protocol/wire/provider-runtime-contract.d.ts +66 -0
- package/dist/types/protocol/wire/provider-runtime-core.d.ts +147 -0
- package/dist/types/protocol/wire/provider-runtime-io.d.ts +20 -0
- package/dist/types/protocol/wire/resource-manifest.d.ts +68 -0
- package/dist/types/protocol/wire/session.d.ts +32 -0
- package/dist/types/protocol/wire/thread-protocol.d.ts +157 -0
- package/dist/types/protocol/wire/transport.d.ts +57 -0
- package/dist/types/protocol/wire/turn.d.ts +208 -0
- package/dist/types/protocol/wire/web-capability.d.ts +51 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +2 -5
- package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +2 -4
- package/dist/types/runtime/infra/acp-types.d.ts +3 -142
- package/dist/types/runtime/infra/project-store.d.ts +6 -0
- package/dist/types/runtime/infra/skill-injector.d.ts +9 -2
- package/dist/types/runtime/infra/token-budget.d.ts +3 -3
- package/dist/types/runtime/session/index.d.ts +1 -1
- package/dist/types/runtime/session/session-memory.d.ts +46 -0
- package/dist/types/runtime/session/session-persistence.d.ts +34 -8
- package/dist/types/runtime/session/session-state.d.ts +4 -4
- package/dist/types/skills/memory/memory-tool.d.ts +1 -1
- package/dist/types/skills/memory/qmemory-adapter.d.ts +1 -1
- package/dist/types/skills/permissions/hook-runner.d.ts +4 -4
- package/dist/types/skills/permissions/permission-classifier.d.ts +2 -2
- package/dist/types/skills/skill-system/skill-source.d.ts +65 -0
- package/dist/types/skills/tools/project-switch-tool.d.ts +24 -0
- package/dist/types/skills/tools.d.ts +5 -5
- package/dist/types/transport/acp-event-emitter.d.ts +1 -1
- package/dist/types/transport/acp-server.d.ts +18 -9
- package/package.json +14 -3
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent RPC Method Map — complete typed contract for ALL agent JSON-RPC methods.
|
|
3
|
+
*
|
|
4
|
+
* This extends GatewayRpcMethodMap (26 methods Gateway directly calls) with all
|
|
5
|
+
* additional agent-specific methods (thread, memory, config, agents, solo, product, etc.).
|
|
6
|
+
*
|
|
7
|
+
* Consumers use this for fully typed RPC clients:
|
|
8
|
+
* import type { AgentRpcMethodMap } from "qlogicagent/protocol";
|
|
9
|
+
* async function call<M extends keyof AgentRpcMethodMap>(method: M, params: AgentRpcMethodMap[M]["params"]): Promise<AgentRpcMethodMap[M]["result"]> { ... }
|
|
10
|
+
*/
|
|
11
|
+
import type { ChatMessage, ToolDefinition } from "./chat-types.js";
|
|
12
|
+
import type { GatewayRpcMethodMap } from "./gateway-rpc.js";
|
|
13
|
+
import type { WireTokenUsage } from "./notification-payloads.js";
|
|
14
|
+
export type AgentCategory = "sub-agent" | "teammate";
|
|
15
|
+
export type AgentProtocol = "internal" | "acp";
|
|
16
|
+
export type AgentStatus = "available" | "unavailable" | "handshake_failed" | "not_installed";
|
|
17
|
+
export interface AgentCapabilities {
|
|
18
|
+
supportsMcp: boolean;
|
|
19
|
+
supportsResume: boolean;
|
|
20
|
+
supportsUsageUpdate: boolean;
|
|
21
|
+
skillsDirs?: string[];
|
|
22
|
+
}
|
|
23
|
+
/** Descriptor for a discovered or registered agent. */
|
|
24
|
+
export interface AgentDescriptor {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
category: AgentCategory;
|
|
28
|
+
protocol: AgentProtocol;
|
|
29
|
+
status: AgentStatus;
|
|
30
|
+
cliPath?: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
capabilities?: AgentCapabilities;
|
|
33
|
+
authRequired: boolean;
|
|
34
|
+
hasConfig: boolean;
|
|
35
|
+
supportsBaseUrlOverride: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** User-provided custom agent definition. */
|
|
38
|
+
export interface CustomAgentDef {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
cliCommand: string;
|
|
42
|
+
acpArgs: string[];
|
|
43
|
+
env?: Record<string, string>;
|
|
44
|
+
authRequired?: boolean;
|
|
45
|
+
skillsDirs?: string[];
|
|
46
|
+
supportsBaseUrlOverride?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Persisted per-agent configuration. */
|
|
49
|
+
export interface AgentConfig {
|
|
50
|
+
apiKey?: string;
|
|
51
|
+
baseUrl?: string;
|
|
52
|
+
model?: string;
|
|
53
|
+
env?: Record<string, string>;
|
|
54
|
+
customArgs?: string[];
|
|
55
|
+
customCliPath?: string;
|
|
56
|
+
modelIdMap?: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
export type SoloState = "running" | "evaluating" | "completed" | "cancelled" | "failed";
|
|
59
|
+
export type SoloAgentState = "pending" | "running" | "completed" | "failed";
|
|
60
|
+
export interface SoloAgentResult {
|
|
61
|
+
id: string;
|
|
62
|
+
state: SoloAgentState;
|
|
63
|
+
progress?: string;
|
|
64
|
+
resultText?: string;
|
|
65
|
+
diff?: string;
|
|
66
|
+
usage?: {
|
|
67
|
+
inputTokens: number;
|
|
68
|
+
outputTokens: number;
|
|
69
|
+
};
|
|
70
|
+
error?: string;
|
|
71
|
+
worktreePath?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface SoloStatus {
|
|
74
|
+
soloId: string;
|
|
75
|
+
state: SoloState;
|
|
76
|
+
agents: SoloAgentResult[];
|
|
77
|
+
evaluation?: {
|
|
78
|
+
winnerId: string;
|
|
79
|
+
reasoning: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export type ProductPhase = "active" | "paused" | "completed" | "failed";
|
|
83
|
+
export type ProductTaskStatus = "pending" | "running" | "completed" | "failed" | "paused";
|
|
84
|
+
export interface ProductInstanceDef {
|
|
85
|
+
name: string;
|
|
86
|
+
role: string;
|
|
87
|
+
agentId: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ProductTaskDef {
|
|
90
|
+
taskId: string;
|
|
91
|
+
assignee: string;
|
|
92
|
+
prompt: string;
|
|
93
|
+
dependsOn?: string[];
|
|
94
|
+
}
|
|
95
|
+
export interface ProductStatus {
|
|
96
|
+
productId: string;
|
|
97
|
+
name: string;
|
|
98
|
+
phase: ProductPhase;
|
|
99
|
+
instances: Array<{
|
|
100
|
+
instanceId: string;
|
|
101
|
+
name: string;
|
|
102
|
+
agentId: string;
|
|
103
|
+
state: string;
|
|
104
|
+
worktreePath?: string;
|
|
105
|
+
usage?: {
|
|
106
|
+
inputTokens: number;
|
|
107
|
+
outputTokens: number;
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
tasks: Array<{
|
|
111
|
+
taskId: string;
|
|
112
|
+
assignee: string;
|
|
113
|
+
status: ProductTaskStatus;
|
|
114
|
+
result?: string;
|
|
115
|
+
error?: string;
|
|
116
|
+
startedAt?: string;
|
|
117
|
+
completedAt?: string;
|
|
118
|
+
}>;
|
|
119
|
+
budget: {
|
|
120
|
+
maxTotalTokens?: number;
|
|
121
|
+
maxDuration?: number;
|
|
122
|
+
usedTokens: number;
|
|
123
|
+
elapsed: number;
|
|
124
|
+
};
|
|
125
|
+
lastCheckpointAt: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ProductSummary {
|
|
128
|
+
productId: string;
|
|
129
|
+
name: string;
|
|
130
|
+
phase: ProductPhase;
|
|
131
|
+
instanceCount: number;
|
|
132
|
+
taskCount: number;
|
|
133
|
+
completedTasks: number;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
lastCheckpointAt: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* All agent RPC methods — superset of GatewayRpcMethodMap.
|
|
139
|
+
*
|
|
140
|
+
* Methods from GatewayRpcMethodMap (session.*, project.*, files.*, instructions.*)
|
|
141
|
+
* are inherited. This adds the agent-specific protocol methods.
|
|
142
|
+
*/
|
|
143
|
+
export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
|
|
144
|
+
"initialize": {
|
|
145
|
+
params: {
|
|
146
|
+
protocolVersion: string;
|
|
147
|
+
host?: {
|
|
148
|
+
name: string;
|
|
149
|
+
version: string;
|
|
150
|
+
};
|
|
151
|
+
hostName?: string;
|
|
152
|
+
hostVersion?: string;
|
|
153
|
+
capabilities?: {
|
|
154
|
+
streaming?: boolean;
|
|
155
|
+
toolApproval?: boolean;
|
|
156
|
+
threads?: boolean;
|
|
157
|
+
};
|
|
158
|
+
config?: Record<string, unknown>;
|
|
159
|
+
};
|
|
160
|
+
result: {
|
|
161
|
+
protocolVersion: string;
|
|
162
|
+
agent: {
|
|
163
|
+
name: string;
|
|
164
|
+
version: string;
|
|
165
|
+
};
|
|
166
|
+
capabilities: {
|
|
167
|
+
tools: string[];
|
|
168
|
+
streaming: boolean;
|
|
169
|
+
threads: boolean;
|
|
170
|
+
notifications: string[];
|
|
171
|
+
methods: string[];
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
"thread.create": {
|
|
176
|
+
params: {
|
|
177
|
+
id?: string;
|
|
178
|
+
title?: string;
|
|
179
|
+
cwd?: string;
|
|
180
|
+
config?: Record<string, unknown>;
|
|
181
|
+
};
|
|
182
|
+
result: {
|
|
183
|
+
id: string;
|
|
184
|
+
title?: string;
|
|
185
|
+
status: "active";
|
|
186
|
+
createdAt: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
"thread.list": {
|
|
190
|
+
params: {
|
|
191
|
+
limit?: number;
|
|
192
|
+
};
|
|
193
|
+
result: {
|
|
194
|
+
threads: Array<{
|
|
195
|
+
id: string;
|
|
196
|
+
title?: string;
|
|
197
|
+
status: "active" | "archived";
|
|
198
|
+
turnCount?: number;
|
|
199
|
+
createdAt: string;
|
|
200
|
+
lastActiveAt: string;
|
|
201
|
+
}>;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
"thread.turn": {
|
|
205
|
+
params: {
|
|
206
|
+
turnId?: string;
|
|
207
|
+
sessionId: string;
|
|
208
|
+
messages?: ChatMessage[];
|
|
209
|
+
tools?: ToolDefinition[];
|
|
210
|
+
config?: Record<string, unknown>;
|
|
211
|
+
};
|
|
212
|
+
result: {
|
|
213
|
+
accepted: boolean;
|
|
214
|
+
turnId: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
"session.resume": {
|
|
218
|
+
params: {
|
|
219
|
+
sessionId: string;
|
|
220
|
+
};
|
|
221
|
+
result: {
|
|
222
|
+
metadata: {
|
|
223
|
+
sessionId: string;
|
|
224
|
+
createdAt: number;
|
|
225
|
+
lastActiveAt: number;
|
|
226
|
+
model?: string;
|
|
227
|
+
cwd?: string;
|
|
228
|
+
turnCount: number;
|
|
229
|
+
messageCount: number;
|
|
230
|
+
title?: string;
|
|
231
|
+
};
|
|
232
|
+
messages: ChatMessage[];
|
|
233
|
+
costSnapshot?: Record<string, unknown>;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
"session.getInfo": {
|
|
237
|
+
params: {
|
|
238
|
+
sessionId?: string;
|
|
239
|
+
};
|
|
240
|
+
result: {
|
|
241
|
+
sessionId: string;
|
|
242
|
+
paths: {
|
|
243
|
+
sessionDir: string;
|
|
244
|
+
transcript: string;
|
|
245
|
+
state: string;
|
|
246
|
+
agentHome: string;
|
|
247
|
+
settings: string;
|
|
248
|
+
cwd: string;
|
|
249
|
+
};
|
|
250
|
+
model?: string;
|
|
251
|
+
provider?: string;
|
|
252
|
+
turnCount: number;
|
|
253
|
+
title?: string;
|
|
254
|
+
usage?: {
|
|
255
|
+
totalPromptTokens: number;
|
|
256
|
+
totalCompletionTokens: number;
|
|
257
|
+
totalCost?: number;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
"memory.list": {
|
|
262
|
+
params: {
|
|
263
|
+
source?: "local" | "store" | "qmemory" | "all";
|
|
264
|
+
};
|
|
265
|
+
result: {
|
|
266
|
+
entries: Array<{
|
|
267
|
+
source: "local" | "store" | "qmemory";
|
|
268
|
+
target?: string;
|
|
269
|
+
path?: string;
|
|
270
|
+
content?: string;
|
|
271
|
+
lines?: number;
|
|
272
|
+
}>;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
"memory.read": {
|
|
276
|
+
params: {
|
|
277
|
+
source?: string;
|
|
278
|
+
target?: string;
|
|
279
|
+
path?: string;
|
|
280
|
+
};
|
|
281
|
+
result: {
|
|
282
|
+
content: string;
|
|
283
|
+
source: string;
|
|
284
|
+
path?: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
"memory.write": {
|
|
288
|
+
params: {
|
|
289
|
+
source?: string;
|
|
290
|
+
target?: string;
|
|
291
|
+
path?: string;
|
|
292
|
+
content: string;
|
|
293
|
+
mode?: "overwrite" | "append";
|
|
294
|
+
};
|
|
295
|
+
result: {
|
|
296
|
+
ok: boolean;
|
|
297
|
+
path?: string;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
"memory.search": {
|
|
301
|
+
params: {
|
|
302
|
+
query: string;
|
|
303
|
+
source?: "local" | "qmemory" | "all";
|
|
304
|
+
limit?: number;
|
|
305
|
+
};
|
|
306
|
+
result: {
|
|
307
|
+
results: Array<{
|
|
308
|
+
source: string;
|
|
309
|
+
target?: string;
|
|
310
|
+
content: string;
|
|
311
|
+
score?: number;
|
|
312
|
+
path?: string;
|
|
313
|
+
}>;
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
"memory.delete": {
|
|
317
|
+
params: {
|
|
318
|
+
source?: string;
|
|
319
|
+
target?: string;
|
|
320
|
+
path?: string;
|
|
321
|
+
};
|
|
322
|
+
result: {
|
|
323
|
+
ok: boolean;
|
|
324
|
+
deleted?: number;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
"memory.dream": {
|
|
328
|
+
params: {
|
|
329
|
+
scope?: "session" | "project" | "all";
|
|
330
|
+
};
|
|
331
|
+
result: {
|
|
332
|
+
ok: boolean;
|
|
333
|
+
consolidated: number;
|
|
334
|
+
archived: number;
|
|
335
|
+
durationMs: number;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
"tools.list": {
|
|
339
|
+
params: {
|
|
340
|
+
category?: string;
|
|
341
|
+
includeDisabled?: boolean;
|
|
342
|
+
};
|
|
343
|
+
result: {
|
|
344
|
+
tools: Array<{
|
|
345
|
+
name: string;
|
|
346
|
+
description: string;
|
|
347
|
+
category: string;
|
|
348
|
+
enabled: boolean;
|
|
349
|
+
parameters?: Record<string, unknown>;
|
|
350
|
+
}>;
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
"media.listModels": {
|
|
354
|
+
params: {
|
|
355
|
+
mediaType?: string;
|
|
356
|
+
};
|
|
357
|
+
result: {
|
|
358
|
+
models: Array<{
|
|
359
|
+
id: string;
|
|
360
|
+
name: string;
|
|
361
|
+
mediaType: string;
|
|
362
|
+
provider: string;
|
|
363
|
+
capabilities?: Record<string, unknown>;
|
|
364
|
+
}>;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
"config.get": {
|
|
368
|
+
params: {
|
|
369
|
+
keys?: string[];
|
|
370
|
+
};
|
|
371
|
+
result: {
|
|
372
|
+
config: Record<string, unknown>;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
"config.update": {
|
|
376
|
+
params: {
|
|
377
|
+
updates: Record<string, unknown>;
|
|
378
|
+
};
|
|
379
|
+
result: {
|
|
380
|
+
ok: boolean;
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
"todos.list": {
|
|
384
|
+
params: {
|
|
385
|
+
sessionId?: string;
|
|
386
|
+
};
|
|
387
|
+
result: {
|
|
388
|
+
items: Array<{
|
|
389
|
+
id: number;
|
|
390
|
+
title: string;
|
|
391
|
+
status: string;
|
|
392
|
+
owner?: string;
|
|
393
|
+
blockedBy?: number[];
|
|
394
|
+
}>;
|
|
395
|
+
summary: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
"tasks.list": {
|
|
399
|
+
params: {
|
|
400
|
+
status?: string;
|
|
401
|
+
};
|
|
402
|
+
result: {
|
|
403
|
+
tasks: Array<{
|
|
404
|
+
id: string;
|
|
405
|
+
type: string;
|
|
406
|
+
status: string;
|
|
407
|
+
progress?: number;
|
|
408
|
+
createdAt: string;
|
|
409
|
+
}>;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
"tasks.cancel": {
|
|
413
|
+
params: {
|
|
414
|
+
taskId: string;
|
|
415
|
+
};
|
|
416
|
+
result: {
|
|
417
|
+
ok: boolean;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
"agent.ping": {
|
|
421
|
+
params: undefined;
|
|
422
|
+
result: {
|
|
423
|
+
status: "idle" | "busy";
|
|
424
|
+
uptime: number;
|
|
425
|
+
version: string;
|
|
426
|
+
usage?: WireTokenUsage;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
"agent.abort": {
|
|
430
|
+
params: {
|
|
431
|
+
turnId?: string;
|
|
432
|
+
reason?: string;
|
|
433
|
+
};
|
|
434
|
+
result: {
|
|
435
|
+
aborted: boolean;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
"tool.approval.response": {
|
|
439
|
+
params: {
|
|
440
|
+
approvalId: string;
|
|
441
|
+
approved: boolean;
|
|
442
|
+
message?: string;
|
|
443
|
+
};
|
|
444
|
+
result: {
|
|
445
|
+
received: boolean;
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
"agents.scan": {
|
|
449
|
+
params: {
|
|
450
|
+
force?: boolean;
|
|
451
|
+
};
|
|
452
|
+
result: AgentDescriptor[];
|
|
453
|
+
};
|
|
454
|
+
"agents.list": {
|
|
455
|
+
params: undefined;
|
|
456
|
+
result: AgentDescriptor[];
|
|
457
|
+
};
|
|
458
|
+
"agents.config": {
|
|
459
|
+
params: {
|
|
460
|
+
action: "register" | "unregister" | "update";
|
|
461
|
+
agent: CustomAgentDef;
|
|
462
|
+
};
|
|
463
|
+
result: {
|
|
464
|
+
ok: true;
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
"agents.setConfig": {
|
|
468
|
+
params: {
|
|
469
|
+
agentId: string;
|
|
470
|
+
apiKey?: string;
|
|
471
|
+
baseUrl?: string;
|
|
472
|
+
model?: string;
|
|
473
|
+
env?: Record<string, string>;
|
|
474
|
+
customArgs?: string[];
|
|
475
|
+
customCliPath?: string;
|
|
476
|
+
modelIdMap?: Record<string, string>;
|
|
477
|
+
};
|
|
478
|
+
result: {
|
|
479
|
+
ok: true;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
"agents.getConfig": {
|
|
483
|
+
params: {
|
|
484
|
+
agentId: string;
|
|
485
|
+
};
|
|
486
|
+
result: AgentConfig | null;
|
|
487
|
+
};
|
|
488
|
+
"agents.removeConfig": {
|
|
489
|
+
params: {
|
|
490
|
+
agentId: string;
|
|
491
|
+
};
|
|
492
|
+
result: {
|
|
493
|
+
ok: true;
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
"agents.setGateway": {
|
|
497
|
+
params: {
|
|
498
|
+
url: string;
|
|
499
|
+
};
|
|
500
|
+
result: {
|
|
501
|
+
ok: true;
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
"solo.start": {
|
|
505
|
+
params: {
|
|
506
|
+
task: string;
|
|
507
|
+
agents: string[];
|
|
508
|
+
cwd: string;
|
|
509
|
+
};
|
|
510
|
+
result: {
|
|
511
|
+
soloId: string;
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
"solo.status": {
|
|
515
|
+
params: {
|
|
516
|
+
soloId: string;
|
|
517
|
+
};
|
|
518
|
+
result: SoloStatus | null;
|
|
519
|
+
};
|
|
520
|
+
"solo.cancel": {
|
|
521
|
+
params: {
|
|
522
|
+
soloId: string;
|
|
523
|
+
};
|
|
524
|
+
result: {
|
|
525
|
+
ok: true;
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
"solo.select": {
|
|
529
|
+
params: {
|
|
530
|
+
soloId: string;
|
|
531
|
+
winnerId: string;
|
|
532
|
+
};
|
|
533
|
+
result: {
|
|
534
|
+
ok: true;
|
|
535
|
+
mergedBranch: string;
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
"product.create": {
|
|
539
|
+
params: {
|
|
540
|
+
name: string;
|
|
541
|
+
cwd: string;
|
|
542
|
+
instances: ProductInstanceDef[];
|
|
543
|
+
tasks: ProductTaskDef[];
|
|
544
|
+
budget?: {
|
|
545
|
+
maxTotalTokens?: number;
|
|
546
|
+
maxDuration?: number;
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
result: {
|
|
550
|
+
productId: string;
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
"product.resume": {
|
|
554
|
+
params: {
|
|
555
|
+
productId: string;
|
|
556
|
+
};
|
|
557
|
+
result: {
|
|
558
|
+
ok: true;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
"product.pause": {
|
|
562
|
+
params: {
|
|
563
|
+
productId: string;
|
|
564
|
+
};
|
|
565
|
+
result: {
|
|
566
|
+
ok: true;
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
"product.checkpoint": {
|
|
570
|
+
params: {
|
|
571
|
+
productId: string;
|
|
572
|
+
};
|
|
573
|
+
result: {
|
|
574
|
+
ok: true;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
"product.status": {
|
|
578
|
+
params: {
|
|
579
|
+
productId: string;
|
|
580
|
+
};
|
|
581
|
+
result: ProductStatus | null;
|
|
582
|
+
};
|
|
583
|
+
"product.list": {
|
|
584
|
+
params: undefined;
|
|
585
|
+
result: ProductSummary[];
|
|
586
|
+
};
|
|
587
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol version. Both sides exchange this during `agent.hello`
|
|
3
|
+
* handshake. If major versions differ the host MUST reject.
|
|
4
|
+
*/
|
|
5
|
+
export declare const AGENT_RPC_PROTOCOL_VERSION: "1.0.0";
|
|
6
|
+
export declare const AGENT_RPC_ERROR_CODES: {
|
|
7
|
+
readonly PARSE_ERROR: -32700;
|
|
8
|
+
readonly INVALID_REQUEST: -32600;
|
|
9
|
+
readonly METHOD_NOT_FOUND: -32601;
|
|
10
|
+
readonly INVALID_PARAMS: -32602;
|
|
11
|
+
readonly INTERNAL_ERROR: -32603;
|
|
12
|
+
readonly TURN_ABORTED: -32000;
|
|
13
|
+
readonly TURN_TIMEOUT: -32001;
|
|
14
|
+
readonly LLM_ERROR: -32010;
|
|
15
|
+
readonly LLM_AUTH_ERROR: -32011;
|
|
16
|
+
readonly LLM_RATE_LIMIT: -32012;
|
|
17
|
+
readonly LLM_QUOTA_EXHAUSTED: -32013;
|
|
18
|
+
readonly LLM_MODEL_NOT_FOUND: -32014;
|
|
19
|
+
readonly TOOL_INVOKE_FAILED: -32020;
|
|
20
|
+
readonly TOOL_TIMEOUT: -32021;
|
|
21
|
+
readonly PROTOCOL_MISMATCH: -32030;
|
|
22
|
+
};
|
|
23
|
+
export type AgentRpcErrorCode = (typeof AGENT_RPC_ERROR_CODES)[keyof typeof AGENT_RPC_ERROR_CODES];
|
|
24
|
+
export interface AgentRpcRequest {
|
|
25
|
+
jsonrpc: "2.0";
|
|
26
|
+
method: string;
|
|
27
|
+
params?: Record<string, unknown>;
|
|
28
|
+
id?: string | number;
|
|
29
|
+
}
|
|
30
|
+
export interface AgentRpcError {
|
|
31
|
+
code: AgentRpcErrorCode | number;
|
|
32
|
+
message: string;
|
|
33
|
+
data?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface AgentRpcResponse {
|
|
36
|
+
jsonrpc: "2.0";
|
|
37
|
+
id: string | number;
|
|
38
|
+
result?: unknown;
|
|
39
|
+
error?: AgentRpcError;
|
|
40
|
+
}
|
|
41
|
+
export interface AgentRpcNotification {
|
|
42
|
+
jsonrpc: "2.0";
|
|
43
|
+
method: string;
|
|
44
|
+
params: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
export type AgentRpcMessage = AgentRpcRequest | AgentRpcResponse | AgentRpcNotification;
|
|
47
|
+
/** Sent by host to agent CLI as params of `agent.hello` request. */
|
|
48
|
+
export interface AgentHelloParams {
|
|
49
|
+
protocolVersion: string;
|
|
50
|
+
hostName: string;
|
|
51
|
+
hostVersion: string;
|
|
52
|
+
capabilities?: string[];
|
|
53
|
+
}
|
|
54
|
+
/** Returned by agent CLI as result of `agent.hello` request. */
|
|
55
|
+
export interface AgentHelloResult {
|
|
56
|
+
protocolVersion: string;
|
|
57
|
+
agentName: string;
|
|
58
|
+
agentVersion: string;
|
|
59
|
+
capabilities?: string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Agent → Host notification: agent requests human approval before executing a tool.
|
|
63
|
+
* Method name: `tool.approval.request`
|
|
64
|
+
*/
|
|
65
|
+
export interface ToolApprovalRequestParams {
|
|
66
|
+
/** Unique id for this approval request (used to correlate the response). */
|
|
67
|
+
approvalId: string;
|
|
68
|
+
/** Tool call id from the LLM. */
|
|
69
|
+
callId: string;
|
|
70
|
+
/** Tool name. */
|
|
71
|
+
toolName: string;
|
|
72
|
+
/** Serialized arguments JSON. */
|
|
73
|
+
arguments: string;
|
|
74
|
+
/** Human-readable reason for requiring approval. */
|
|
75
|
+
message?: string;
|
|
76
|
+
/** Suggested actions the user can pick (allow-once, allow-always, deny). */
|
|
77
|
+
suggestions?: string[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Host → Agent notification: host relays the user's approval decision.
|
|
81
|
+
* Method name: `tool.approval.response`
|
|
82
|
+
*/
|
|
83
|
+
export interface ToolApprovalResponseParams {
|
|
84
|
+
/** Must match the `approvalId` from the request. */
|
|
85
|
+
approvalId: string;
|
|
86
|
+
/** User's decision. */
|
|
87
|
+
decision: "allow-once" | "allow-session" | "allow-always" | "deny";
|
|
88
|
+
}
|
|
89
|
+
/** Well-known method names for the approval protocol. */
|
|
90
|
+
export declare const AGENT_RPC_APPROVAL_METHODS: {
|
|
91
|
+
readonly REQUEST: "tool.approval.request";
|
|
92
|
+
readonly RESPONSE: "tool.approval.response";
|
|
93
|
+
};
|
|
94
|
+
export declare function isAgentRpcRequest(msg: unknown): msg is AgentRpcRequest;
|
|
95
|
+
export declare function isAgentRpcResponse(msg: unknown): msg is AgentRpcResponse;
|
|
96
|
+
export declare function isAgentRpcNotification(msg: unknown): msg is AgentRpcNotification;
|
|
97
|
+
export declare function parseAgentRpcMessage(raw: string): AgentRpcMessage | null;
|