qlogicagent 2.3.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 +6 -6
- package/dist/cli.js +212 -211
- package/dist/index.js +211 -210
- package/dist/orchestration.js +2 -2
- package/dist/protocol.js +1 -0
- package/dist/types/agent/tunable-defaults.d.ts +4 -0
- package/dist/types/agent/types.d.ts +24 -100
- package/dist/types/cli/stdio-server.d.ts +7 -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/solo-evaluator.d.ts +7 -0
- 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 -514
- 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 -2
- package/dist/types/runtime/infra/acp-types.d.ts +3 -142
- 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/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 +17 -10
- package/package.json +14 -3
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
export declare const ACP_PROTOCOL_VERSION: 1;
|
|
2
|
+
export declare const ACP_METHODS: {
|
|
3
|
+
readonly INITIALIZE: "initialize";
|
|
4
|
+
readonly SESSION_NEW: "session/new";
|
|
5
|
+
readonly SESSION_PROMPT: "session/prompt";
|
|
6
|
+
readonly SESSION_END: "session/end";
|
|
7
|
+
readonly SESSION_SET_CONFIG: "session/set_config_option";
|
|
8
|
+
readonly SESSION_SET_MODEL: "session/set_model";
|
|
9
|
+
readonly SESSION_SET_MODE: "session/set_mode";
|
|
10
|
+
readonly SESSION_UPDATE: "session/update";
|
|
11
|
+
readonly SESSION_REQUEST_PERMISSION: "session/request_permission";
|
|
12
|
+
readonly FS_READ_TEXT_FILE: "fs/read_text_file";
|
|
13
|
+
readonly FS_WRITE_TEXT_FILE: "fs/write_text_file";
|
|
14
|
+
};
|
|
15
|
+
export type AcpStandardMethod = (typeof ACP_METHODS)[keyof typeof ACP_METHODS];
|
|
16
|
+
export declare const ACP_EXTENDED_METHODS: {
|
|
17
|
+
readonly ABORT: "x/abort";
|
|
18
|
+
readonly DREAM: "x/dream";
|
|
19
|
+
readonly AGENTS_LIST: "x/agents.list";
|
|
20
|
+
readonly SOLO_START: "x/solo.start";
|
|
21
|
+
readonly SOLO_STATUS: "x/solo.status";
|
|
22
|
+
readonly SOLO_SELECT: "x/solo.select";
|
|
23
|
+
readonly SOLO_CANCEL: "x/solo.cancel";
|
|
24
|
+
readonly PRODUCT_CREATE: "x/product.create";
|
|
25
|
+
readonly PRODUCT_RESUME: "x/product.resume";
|
|
26
|
+
readonly PRODUCT_PAUSE: "x/product.pause";
|
|
27
|
+
readonly PRODUCT_CANCEL: "x/product.cancel";
|
|
28
|
+
readonly PRODUCT_ROLLBACK: "x/product.rollback";
|
|
29
|
+
readonly PRODUCT_STATUS: "x/product.status";
|
|
30
|
+
readonly SOLO_SUBSCRIBE: "x/solo.subscribe";
|
|
31
|
+
readonly PRODUCT_SUBSCRIBE: "x/product.subscribe";
|
|
32
|
+
readonly TEAM_DELEGATE: "x/team.delegate";
|
|
33
|
+
};
|
|
34
|
+
export type AcpExtendedMethod = (typeof ACP_EXTENDED_METHODS)[keyof typeof ACP_EXTENDED_METHODS];
|
|
35
|
+
export interface AcpHostCapabilities {
|
|
36
|
+
/** Host supports x_ extended sessionUpdate types */
|
|
37
|
+
extendedEvents?: boolean;
|
|
38
|
+
/** Host supports tool approval flow (session/request_permission) */
|
|
39
|
+
toolApproval?: boolean;
|
|
40
|
+
/** Host supports filesystem operations (fs/*) */
|
|
41
|
+
filesystem?: boolean;
|
|
42
|
+
/** Host supports x/ extended RPC methods */
|
|
43
|
+
extendedMethods?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface AcpAgentCapabilities {
|
|
46
|
+
/** Agent supports x_ extended sessionUpdate types */
|
|
47
|
+
extendedEvents?: boolean;
|
|
48
|
+
/** Agent supports x/ extended RPC methods */
|
|
49
|
+
extendedMethods?: boolean;
|
|
50
|
+
/** Agent supports multi-agent orchestration (solo/product/team) */
|
|
51
|
+
orchestration?: boolean;
|
|
52
|
+
/** Supported config options */
|
|
53
|
+
configOptions?: AcpConfigOptionDescriptor[];
|
|
54
|
+
}
|
|
55
|
+
export interface AcpConfigOptionDescriptor {
|
|
56
|
+
name: string;
|
|
57
|
+
type: "string" | "boolean" | "number" | "enum";
|
|
58
|
+
values?: string[];
|
|
59
|
+
description?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface AcpInitializeParams {
|
|
62
|
+
protocolVersion: number | string;
|
|
63
|
+
clientInfo?: {
|
|
64
|
+
name: string;
|
|
65
|
+
version: string;
|
|
66
|
+
};
|
|
67
|
+
clientCapabilities?: AcpHostCapabilities;
|
|
68
|
+
}
|
|
69
|
+
export interface AcpInitializeResult {
|
|
70
|
+
protocolVersion: number;
|
|
71
|
+
agentInfo: {
|
|
72
|
+
name: string;
|
|
73
|
+
version: string;
|
|
74
|
+
};
|
|
75
|
+
agentCapabilities?: AcpAgentCapabilities;
|
|
76
|
+
}
|
|
77
|
+
export interface AcpSessionNewParams {
|
|
78
|
+
/** Working directory for the session (standard ACP field from host). */
|
|
79
|
+
cwd?: string;
|
|
80
|
+
/** MCP servers to inject into this session. */
|
|
81
|
+
mcpServers?: Array<{
|
|
82
|
+
name: string;
|
|
83
|
+
uri?: string;
|
|
84
|
+
command?: string;
|
|
85
|
+
args?: string[];
|
|
86
|
+
}>;
|
|
87
|
+
/** Optional session ID (host-assigned). If omitted, agent generates one. */
|
|
88
|
+
sessionId?: string;
|
|
89
|
+
/** Resume: fork an existing session into a new one */
|
|
90
|
+
resumeSessionId?: string;
|
|
91
|
+
forkSession?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface AcpSessionNewResult {
|
|
94
|
+
sessionId: string;
|
|
95
|
+
}
|
|
96
|
+
export interface AcpSessionPromptParams {
|
|
97
|
+
sessionId: string;
|
|
98
|
+
/** User prompt content blocks (standard ACP field). */
|
|
99
|
+
prompt: AcpContentBlock[];
|
|
100
|
+
/** Optional attached context */
|
|
101
|
+
context?: AcpContextItem[];
|
|
102
|
+
}
|
|
103
|
+
export interface AcpSessionPromptResult {
|
|
104
|
+
/** Stop reason (required by ACP standard). */
|
|
105
|
+
stopReason: AcpStopReason;
|
|
106
|
+
/** Token usage for this turn */
|
|
107
|
+
usage?: AcpUsage;
|
|
108
|
+
}
|
|
109
|
+
export interface AcpSessionEndParams {
|
|
110
|
+
sessionId: string;
|
|
111
|
+
}
|
|
112
|
+
export interface AcpSessionSetConfigParams {
|
|
113
|
+
sessionId: string;
|
|
114
|
+
option: string;
|
|
115
|
+
value: unknown;
|
|
116
|
+
}
|
|
117
|
+
export type AcpContentBlock = {
|
|
118
|
+
type: "text";
|
|
119
|
+
text: string;
|
|
120
|
+
} | {
|
|
121
|
+
type: "image";
|
|
122
|
+
url: string;
|
|
123
|
+
mimeType?: string;
|
|
124
|
+
} | {
|
|
125
|
+
type: "file";
|
|
126
|
+
path: string;
|
|
127
|
+
content?: string;
|
|
128
|
+
};
|
|
129
|
+
export interface AcpContextItem {
|
|
130
|
+
type: "file" | "url" | "text";
|
|
131
|
+
content: string;
|
|
132
|
+
metadata?: Record<string, unknown>;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The `session/update` notification params.
|
|
136
|
+
* Standard format: { sessionId, update: { sessionUpdate: "<type>", ...payload } }
|
|
137
|
+
*/
|
|
138
|
+
export interface AcpSessionUpdateNotification {
|
|
139
|
+
sessionId: string;
|
|
140
|
+
update: {
|
|
141
|
+
sessionUpdate: AcpSessionUpdateType;
|
|
142
|
+
[key: string]: unknown;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export declare const ACP_SESSION_UPDATE_TYPES: {
|
|
146
|
+
readonly AGENT_MESSAGE_CHUNK: "agent_message_chunk";
|
|
147
|
+
readonly AGENT_THOUGHT_CHUNK: "agent_thought_chunk";
|
|
148
|
+
readonly TOOL_CALL: "tool_call";
|
|
149
|
+
readonly TOOL_CALL_UPDATE: "tool_call_update";
|
|
150
|
+
readonly PLAN: "plan";
|
|
151
|
+
readonly USAGE_UPDATE: "usage_update";
|
|
152
|
+
readonly CONFIG_OPTION_UPDATE: "config_option_update";
|
|
153
|
+
readonly SESSION_INFO_UPDATE: "session_info_update";
|
|
154
|
+
readonly AVAILABLE_COMMANDS_UPDATE: "available_commands_update";
|
|
155
|
+
};
|
|
156
|
+
export type AcpStandardSessionUpdateType = (typeof ACP_SESSION_UPDATE_TYPES)[keyof typeof ACP_SESSION_UPDATE_TYPES];
|
|
157
|
+
export declare const ACP_EXTENDED_SESSION_UPDATE_TYPES: {
|
|
158
|
+
readonly X_SUBAGENT_STARTED: "x_subagent_started";
|
|
159
|
+
readonly X_SUBAGENT_DELTA: "x_subagent_delta";
|
|
160
|
+
readonly X_SUBAGENT_ENDED: "x_subagent_ended";
|
|
161
|
+
readonly X_MEDIA_RESULT: "x_media_result";
|
|
162
|
+
readonly X_MEDIA_PROGRESS: "x_media_progress";
|
|
163
|
+
readonly X_SKILL_INSTRUCTION: "x_skill_instruction";
|
|
164
|
+
readonly X_RECOVERY: "x_recovery";
|
|
165
|
+
readonly X_SIDECHAIN_STARTED: "x_sidechain_started";
|
|
166
|
+
readonly X_SIDECHAIN_COMPLETED: "x_sidechain_completed";
|
|
167
|
+
readonly X_SUGGESTIONS: "x_suggestions";
|
|
168
|
+
readonly X_ASK_USER: "x_ask_user";
|
|
169
|
+
readonly X_SESSION_INFO: "x_session_info";
|
|
170
|
+
readonly X_MEMORY_UPDATED: "x_memory_updated";
|
|
171
|
+
readonly X_TEAM_MEMBER_UPDATE: "x_team_member_update";
|
|
172
|
+
readonly X_SOLO_STARTED: "x_solo_started";
|
|
173
|
+
readonly X_SOLO_AGENT_FINISHED: "x_solo_agent_finished";
|
|
174
|
+
readonly X_SOLO_SELECTED: "x_solo_selected";
|
|
175
|
+
readonly X_PRODUCT_TASK_STARTED: "x_product_task_started";
|
|
176
|
+
readonly X_PRODUCT_TASK_COMPLETED: "x_product_task_completed";
|
|
177
|
+
readonly X_PRODUCT_CHECKPOINT: "x_product_checkpoint";
|
|
178
|
+
};
|
|
179
|
+
export type AcpExtendedSessionUpdateType = (typeof ACP_EXTENDED_SESSION_UPDATE_TYPES)[keyof typeof ACP_EXTENDED_SESSION_UPDATE_TYPES];
|
|
180
|
+
export type AcpSessionUpdateType = AcpStandardSessionUpdateType | AcpExtendedSessionUpdateType;
|
|
181
|
+
export interface AcpAgentMessageChunkPayload {
|
|
182
|
+
text: string;
|
|
183
|
+
}
|
|
184
|
+
export interface AcpAgentThoughtChunkPayload {
|
|
185
|
+
text: string;
|
|
186
|
+
}
|
|
187
|
+
export interface AcpToolCallPayload {
|
|
188
|
+
callId: string;
|
|
189
|
+
toolName: string;
|
|
190
|
+
arguments: string;
|
|
191
|
+
/** Whether the tool call is streaming (partial arguments) */
|
|
192
|
+
streaming?: boolean;
|
|
193
|
+
}
|
|
194
|
+
export interface AcpToolCallUpdatePayload {
|
|
195
|
+
callId: string;
|
|
196
|
+
toolName: string;
|
|
197
|
+
/** Tool execution result (text) */
|
|
198
|
+
result?: string;
|
|
199
|
+
/** Tool execution error */
|
|
200
|
+
error?: string;
|
|
201
|
+
/** Whether the tool call was approved and executed */
|
|
202
|
+
status: "completed" | "failed" | "rejected";
|
|
203
|
+
}
|
|
204
|
+
export interface AcpPlanPayload {
|
|
205
|
+
steps: Array<{
|
|
206
|
+
description: string;
|
|
207
|
+
status: "pending" | "in_progress" | "done" | "skipped";
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
export interface AcpUsageUpdatePayload {
|
|
211
|
+
usage: AcpUsage;
|
|
212
|
+
}
|
|
213
|
+
export interface AcpConfigOptionUpdatePayload {
|
|
214
|
+
option: string;
|
|
215
|
+
value: unknown;
|
|
216
|
+
}
|
|
217
|
+
export interface AcpEndTurnPayload {
|
|
218
|
+
stopReason: AcpStopReason;
|
|
219
|
+
usage?: AcpUsage;
|
|
220
|
+
}
|
|
221
|
+
export interface AcpAvailableCommandsUpdatePayload {
|
|
222
|
+
commands: Array<{
|
|
223
|
+
name: string;
|
|
224
|
+
description?: string;
|
|
225
|
+
}>;
|
|
226
|
+
}
|
|
227
|
+
export interface AcpXSubagentStartedPayload {
|
|
228
|
+
agentId: string;
|
|
229
|
+
agentName: string;
|
|
230
|
+
task?: string;
|
|
231
|
+
}
|
|
232
|
+
export interface AcpXSubagentDeltaPayload {
|
|
233
|
+
agentId: string;
|
|
234
|
+
text?: string;
|
|
235
|
+
toolCall?: {
|
|
236
|
+
callId: string;
|
|
237
|
+
toolName: string;
|
|
238
|
+
arguments: string;
|
|
239
|
+
};
|
|
240
|
+
toolResult?: {
|
|
241
|
+
callId: string;
|
|
242
|
+
result: string;
|
|
243
|
+
status: "completed" | "failed";
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
export interface AcpXSubagentEndedPayload {
|
|
247
|
+
agentId: string;
|
|
248
|
+
result?: string;
|
|
249
|
+
usage?: AcpUsage;
|
|
250
|
+
}
|
|
251
|
+
export interface AcpXMediaResultPayload {
|
|
252
|
+
mediaId: string;
|
|
253
|
+
type: "image" | "video" | "audio";
|
|
254
|
+
url: string;
|
|
255
|
+
metadata?: Record<string, unknown>;
|
|
256
|
+
}
|
|
257
|
+
export interface AcpXMediaProgressPayload {
|
|
258
|
+
mediaId: string;
|
|
259
|
+
progress: number;
|
|
260
|
+
stage?: string;
|
|
261
|
+
}
|
|
262
|
+
export interface AcpXSkillInstructionPayload {
|
|
263
|
+
skillId: string;
|
|
264
|
+
instruction: string;
|
|
265
|
+
}
|
|
266
|
+
export interface AcpXRecoveryPayload {
|
|
267
|
+
errorType: string;
|
|
268
|
+
message: string;
|
|
269
|
+
action: "retry" | "skip" | "fallback";
|
|
270
|
+
}
|
|
271
|
+
export interface AcpXSidechainStartedPayload {
|
|
272
|
+
chainId: string;
|
|
273
|
+
purpose: string;
|
|
274
|
+
}
|
|
275
|
+
export interface AcpXSidechainCompletedPayload {
|
|
276
|
+
chainId: string;
|
|
277
|
+
result?: string;
|
|
278
|
+
}
|
|
279
|
+
export interface AcpXSuggestionsPayload {
|
|
280
|
+
suggestions: string[];
|
|
281
|
+
}
|
|
282
|
+
export interface AcpXAskUserPayload {
|
|
283
|
+
question: string;
|
|
284
|
+
options?: string[];
|
|
285
|
+
}
|
|
286
|
+
export interface AcpXSessionInfoPayload {
|
|
287
|
+
sessionId: string;
|
|
288
|
+
model?: string;
|
|
289
|
+
metadata?: Record<string, unknown>;
|
|
290
|
+
}
|
|
291
|
+
export interface AcpXMemoryUpdatedPayload {
|
|
292
|
+
memoryId: string;
|
|
293
|
+
action: "created" | "updated" | "deleted";
|
|
294
|
+
summary?: string;
|
|
295
|
+
}
|
|
296
|
+
export interface AcpXTeamMemberUpdatePayload {
|
|
297
|
+
memberId: string;
|
|
298
|
+
/** The original ACP session/update from the external agent */
|
|
299
|
+
type: AcpSessionUpdateType;
|
|
300
|
+
payload: Record<string, unknown>;
|
|
301
|
+
}
|
|
302
|
+
export interface AcpXSoloStartedPayload {
|
|
303
|
+
evaluationId: string;
|
|
304
|
+
agents: string[];
|
|
305
|
+
task: string;
|
|
306
|
+
}
|
|
307
|
+
export interface AcpXSoloAgentFinishedPayload {
|
|
308
|
+
evaluationId: string;
|
|
309
|
+
agentId: string;
|
|
310
|
+
result?: string;
|
|
311
|
+
usage?: AcpUsage;
|
|
312
|
+
}
|
|
313
|
+
export interface AcpXSoloSelectedPayload {
|
|
314
|
+
evaluationId: string;
|
|
315
|
+
winnerId: string;
|
|
316
|
+
reason?: string;
|
|
317
|
+
}
|
|
318
|
+
export interface AcpXProductTaskStartedPayload {
|
|
319
|
+
workflowId: string;
|
|
320
|
+
taskId: string;
|
|
321
|
+
agentId: string;
|
|
322
|
+
description?: string;
|
|
323
|
+
}
|
|
324
|
+
export interface AcpXProductTaskCompletedPayload {
|
|
325
|
+
workflowId: string;
|
|
326
|
+
taskId: string;
|
|
327
|
+
agentId: string;
|
|
328
|
+
result?: string;
|
|
329
|
+
status: "completed" | "failed";
|
|
330
|
+
}
|
|
331
|
+
export interface AcpXProductCheckpointPayload {
|
|
332
|
+
workflowId: string;
|
|
333
|
+
checkpointId: string;
|
|
334
|
+
completedTasks: string[];
|
|
335
|
+
}
|
|
336
|
+
export interface AcpPermissionRequestParams {
|
|
337
|
+
sessionId: string;
|
|
338
|
+
permissionId: string;
|
|
339
|
+
toolCall: {
|
|
340
|
+
callId: string;
|
|
341
|
+
toolName: string;
|
|
342
|
+
arguments: string;
|
|
343
|
+
};
|
|
344
|
+
message?: string;
|
|
345
|
+
options: AcpPermissionOption[];
|
|
346
|
+
}
|
|
347
|
+
export interface AcpPermissionOption {
|
|
348
|
+
id: string;
|
|
349
|
+
label: string;
|
|
350
|
+
/** Whether this option grants persistent permission */
|
|
351
|
+
persistent?: boolean;
|
|
352
|
+
}
|
|
353
|
+
export interface AcpPermissionRequestResult {
|
|
354
|
+
optionId: string;
|
|
355
|
+
}
|
|
356
|
+
export interface AcpFsReadTextFileParams {
|
|
357
|
+
path: string;
|
|
358
|
+
startLine?: number;
|
|
359
|
+
endLine?: number;
|
|
360
|
+
}
|
|
361
|
+
export interface AcpFsReadTextFileResult {
|
|
362
|
+
content: string;
|
|
363
|
+
totalLines: number;
|
|
364
|
+
}
|
|
365
|
+
export interface AcpFsWriteTextFileParams {
|
|
366
|
+
path: string;
|
|
367
|
+
content: string;
|
|
368
|
+
createDirectories?: boolean;
|
|
369
|
+
}
|
|
370
|
+
export interface AcpFsWriteTextFileResult {
|
|
371
|
+
bytesWritten: number;
|
|
372
|
+
}
|
|
373
|
+
export interface AcpUsage {
|
|
374
|
+
inputTokens: number;
|
|
375
|
+
outputTokens: number;
|
|
376
|
+
cacheReadTokens?: number;
|
|
377
|
+
cacheWriteTokens?: number;
|
|
378
|
+
totalCost?: number;
|
|
379
|
+
}
|
|
380
|
+
export type AcpStopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
|
|
381
|
+
export interface AcpJsonRpcRequest {
|
|
382
|
+
jsonrpc: "2.0";
|
|
383
|
+
method: string;
|
|
384
|
+
params?: Record<string, unknown>;
|
|
385
|
+
id: string | number;
|
|
386
|
+
}
|
|
387
|
+
export interface AcpJsonRpcNotification {
|
|
388
|
+
jsonrpc: "2.0";
|
|
389
|
+
method: string;
|
|
390
|
+
params?: Record<string, unknown>;
|
|
391
|
+
}
|
|
392
|
+
export interface AcpJsonRpcResponse {
|
|
393
|
+
jsonrpc: "2.0";
|
|
394
|
+
id: string | number;
|
|
395
|
+
result?: unknown;
|
|
396
|
+
error?: AcpJsonRpcError;
|
|
397
|
+
}
|
|
398
|
+
export interface AcpJsonRpcError {
|
|
399
|
+
code: number;
|
|
400
|
+
message: string;
|
|
401
|
+
data?: unknown;
|
|
402
|
+
}
|
|
403
|
+
export type AcpJsonRpcMessage = AcpJsonRpcRequest | AcpJsonRpcResponse | AcpJsonRpcNotification;
|
|
404
|
+
export declare function isAcpJsonRpcRequest(msg: unknown): msg is AcpJsonRpcRequest;
|
|
405
|
+
export declare function isAcpJsonRpcNotification(msg: unknown): msg is AcpJsonRpcNotification;
|
|
406
|
+
export declare function isAcpJsonRpcResponse(msg: unknown): msg is AcpJsonRpcResponse;
|
|
407
|
+
export declare function parseAcpMessage(raw: string): AcpJsonRpcMessage | null;
|
|
408
|
+
/** Check if a sessionUpdate type is a standard ACP v1 type */
|
|
409
|
+
export declare function isStandardSessionUpdateType(type: string): type is AcpStandardSessionUpdateType;
|
|
410
|
+
/** Check if a sessionUpdate type is an x_ extended type */
|
|
411
|
+
export declare function isExtendedSessionUpdateType(type: string): type is AcpExtendedSessionUpdateType;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Notification Event Names — shared between Agent and Gateway.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for which agent notifications should be
|
|
5
|
+
* relayed to WebSocket clients. Adding a new event = add ONE line here.
|
|
6
|
+
*
|
|
7
|
+
* Design: Gateway's generic relay uses this list as its whitelist.
|
|
8
|
+
* Agent's protocol/notifications.ts defines the full payload types.
|
|
9
|
+
* This file is the bridge that keeps both sides in sync with zero
|
|
10
|
+
* manual string matching.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Turn-lifecycle events relayed to the Control UI WebSocket.
|
|
14
|
+
* These are the "chat session" events that every UI client needs.
|
|
15
|
+
*/
|
|
16
|
+
export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated"];
|
|
17
|
+
/**
|
|
18
|
+
* Agent Team events (Solo Mode, Product Mode, Plan lifecycle).
|
|
19
|
+
* Relayed to the UI's team/orchestration panel.
|
|
20
|
+
*/
|
|
21
|
+
export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.checkpointed", "product.dagTopology", "plan.interrupted"];
|
|
22
|
+
/**
|
|
23
|
+
* All agent notifications that Gateway should relay to WS clients.
|
|
24
|
+
* Union of session events + team events.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.checkpointed", "product.dagTopology", "plan.interrupted"];
|
|
27
|
+
/** Type-level event name for session events. */
|
|
28
|
+
export type AgentWsEventName = (typeof AGENT_WS_EVENT_NAMES)[number];
|
|
29
|
+
/** Type-level event name for team events. */
|
|
30
|
+
export type AgentTeamWsEventName = (typeof AGENT_TEAM_WS_EVENT_NAMES)[number];
|
|
31
|
+
/** Type-level event name for all relayed events. */
|
|
32
|
+
export type AllAgentWsEventName = (typeof ALL_AGENT_WS_EVENT_NAMES)[number];
|