@openacp/cli 2026.401.5 → 2026.402.1
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/channel-DzDoNxa7.d.ts +522 -0
- package/dist/cli.js +2892 -3938
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +295 -553
- package/dist/index.js +1385 -2651
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +5 -0
- package/dist/testing.js +17364 -0
- package/dist/testing.js.map +1 -0
- package/package.json +2 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,476 +1,13 @@
|
|
|
1
|
+
import { A as AgentEvent, a as AgentCapabilities, P as PermissionRequest, b as AgentDefinition, M as McpServerConfig, S as SetConfigOptionValue, c as Attachment, I as InstalledAgent, R as RegistryAgent, d as AgentListItem, e as AvailabilityResult, f as InstallProgress, g as InstallResult, h as SessionStatus, C as ConfigOption, i as AgentSwitchEntry, j as AgentCommand, k as SessionRecord, O as OutgoingMessage, l as IChannelAdapter, N as NotificationMessage, m as StopReason, U as UsageRecord, n as UsageRecordEvent, o as IncomingMessage, D as DisplayVerbosity, p as ChannelConfig, q as AdapterCapabilities, T as ToolCallMeta, V as ViewerLinks, r as OutputMode, s as PlanEntry } from './channel-DzDoNxa7.js';
|
|
2
|
+
export { t as AgentDistribution, u as AuthMethod, v as AuthenticateRequest, w as ChannelAdapter, x as ConfigSelectChoice, y as ConfigSelectGroup, z as ContentBlock, K as KIND_ICONS, B as ModelInfo, E as NewSessionResponse, F as PermissionOption, G as PromptResponse, H as RegistryBinaryTarget, J as RegistryDistribution, L as STATUS_ICONS, Q as SessionListItem, W as SessionListResponse, X as SessionMode, Y as SessionModeState, Z as SessionModelState, _ as TelegramPlatformData, $ as ToolUpdateMeta } from './channel-DzDoNxa7.js';
|
|
1
3
|
import pino from 'pino';
|
|
2
4
|
import * as zod from 'zod';
|
|
3
5
|
import { z, ZodSchema } from 'zod';
|
|
4
6
|
import { EventEmitter } from 'node:events';
|
|
5
|
-
import { SetSessionConfigOptionResponse, ListSessionsResponse, LoadSessionResponse, ForkSessionResponse, PromptResponse
|
|
7
|
+
import { SetSessionConfigOptionResponse, ListSessionsResponse, LoadSessionResponse, ForkSessionResponse, PromptResponse } from '@agentclientprotocol/sdk';
|
|
6
8
|
import { FastifyInstance, FastifyPluginAsync, preHandlerHookHandler, FastifyRequest, FastifyReply } from 'fastify';
|
|
7
9
|
import * as http from 'node:http';
|
|
8
10
|
|
|
9
|
-
type OutputMode = "low" | "medium" | "high";
|
|
10
|
-
/** @deprecated Use OutputMode instead */
|
|
11
|
-
type DisplayVerbosity = OutputMode;
|
|
12
|
-
declare const STATUS_ICONS: Record<string, string>;
|
|
13
|
-
declare const KIND_ICONS: Record<string, string>;
|
|
14
|
-
interface ViewerLinks {
|
|
15
|
-
file?: string;
|
|
16
|
-
diff?: string;
|
|
17
|
-
}
|
|
18
|
-
interface ToolCallMeta {
|
|
19
|
-
id: string;
|
|
20
|
-
name: string;
|
|
21
|
-
kind?: string;
|
|
22
|
-
status?: string;
|
|
23
|
-
content?: unknown;
|
|
24
|
-
rawInput?: unknown;
|
|
25
|
-
viewerLinks?: ViewerLinks;
|
|
26
|
-
viewerFilePath?: string;
|
|
27
|
-
displaySummary?: string;
|
|
28
|
-
displayTitle?: string;
|
|
29
|
-
displayKind?: string;
|
|
30
|
-
}
|
|
31
|
-
interface ToolUpdateMeta extends ToolCallMeta {
|
|
32
|
-
status: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface Attachment {
|
|
36
|
-
type: 'image' | 'audio' | 'file';
|
|
37
|
-
filePath: string;
|
|
38
|
-
fileName: string;
|
|
39
|
-
mimeType: string;
|
|
40
|
-
size: number;
|
|
41
|
-
originalFilePath?: string;
|
|
42
|
-
}
|
|
43
|
-
interface IncomingMessage {
|
|
44
|
-
channelId: string;
|
|
45
|
-
threadId: string;
|
|
46
|
-
userId: string;
|
|
47
|
-
text: string;
|
|
48
|
-
attachments?: Attachment[];
|
|
49
|
-
}
|
|
50
|
-
interface OutgoingMessage {
|
|
51
|
-
type: "text" | "thought" | "tool_call" | "tool_update" | "plan" | "usage" | "session_end" | "error" | "attachment" | "system_message" | "mode_change" | "config_update" | "model_update" | "user_replay" | "resource" | "resource_link";
|
|
52
|
-
text: string;
|
|
53
|
-
metadata?: Record<string, unknown>;
|
|
54
|
-
attachment?: Attachment;
|
|
55
|
-
}
|
|
56
|
-
interface PermissionRequest {
|
|
57
|
-
id: string;
|
|
58
|
-
description: string;
|
|
59
|
-
options: PermissionOption[];
|
|
60
|
-
}
|
|
61
|
-
interface PermissionOption {
|
|
62
|
-
id: string;
|
|
63
|
-
label: string;
|
|
64
|
-
isAllow: boolean;
|
|
65
|
-
}
|
|
66
|
-
interface NotificationMessage {
|
|
67
|
-
sessionId: string;
|
|
68
|
-
sessionName?: string;
|
|
69
|
-
type: "completed" | "error" | "permission" | "input_required" | "budget_warning";
|
|
70
|
-
summary: string;
|
|
71
|
-
deepLink?: string;
|
|
72
|
-
}
|
|
73
|
-
interface AgentCommand {
|
|
74
|
-
name: string;
|
|
75
|
-
description: string;
|
|
76
|
-
input?: unknown;
|
|
77
|
-
}
|
|
78
|
-
type AgentEvent = {
|
|
79
|
-
type: "text";
|
|
80
|
-
content: string;
|
|
81
|
-
} | {
|
|
82
|
-
type: "thought";
|
|
83
|
-
content: string;
|
|
84
|
-
} | {
|
|
85
|
-
type: "tool_call";
|
|
86
|
-
id: string;
|
|
87
|
-
name: string;
|
|
88
|
-
kind?: string;
|
|
89
|
-
status: string;
|
|
90
|
-
content?: unknown;
|
|
91
|
-
locations?: unknown;
|
|
92
|
-
rawInput?: unknown;
|
|
93
|
-
rawOutput?: unknown;
|
|
94
|
-
meta?: unknown;
|
|
95
|
-
} | {
|
|
96
|
-
type: "tool_update";
|
|
97
|
-
id: string;
|
|
98
|
-
name?: string;
|
|
99
|
-
kind?: string;
|
|
100
|
-
status: string;
|
|
101
|
-
content?: unknown;
|
|
102
|
-
locations?: unknown;
|
|
103
|
-
rawInput?: unknown;
|
|
104
|
-
rawOutput?: unknown;
|
|
105
|
-
meta?: unknown;
|
|
106
|
-
} | {
|
|
107
|
-
type: "plan";
|
|
108
|
-
entries: PlanEntry[];
|
|
109
|
-
} | {
|
|
110
|
-
type: "usage";
|
|
111
|
-
tokensUsed?: number;
|
|
112
|
-
contextSize?: number;
|
|
113
|
-
cost?: {
|
|
114
|
-
amount: number;
|
|
115
|
-
currency: string;
|
|
116
|
-
};
|
|
117
|
-
} | {
|
|
118
|
-
type: "commands_update";
|
|
119
|
-
commands: AgentCommand[];
|
|
120
|
-
} | {
|
|
121
|
-
type: "image_content";
|
|
122
|
-
data: string;
|
|
123
|
-
mimeType: string;
|
|
124
|
-
} | {
|
|
125
|
-
type: "audio_content";
|
|
126
|
-
data: string;
|
|
127
|
-
mimeType: string;
|
|
128
|
-
} | {
|
|
129
|
-
type: "session_end";
|
|
130
|
-
reason: string;
|
|
131
|
-
} | {
|
|
132
|
-
type: "error";
|
|
133
|
-
message: string;
|
|
134
|
-
} | {
|
|
135
|
-
type: "system_message";
|
|
136
|
-
message: string;
|
|
137
|
-
} | {
|
|
138
|
-
type: "session_info_update";
|
|
139
|
-
title?: string;
|
|
140
|
-
updatedAt?: string;
|
|
141
|
-
_meta?: Record<string, unknown>;
|
|
142
|
-
} | {
|
|
143
|
-
type: "config_option_update";
|
|
144
|
-
options: ConfigOption[];
|
|
145
|
-
} | {
|
|
146
|
-
type: "user_message_chunk";
|
|
147
|
-
content: string;
|
|
148
|
-
} | {
|
|
149
|
-
type: "resource_content";
|
|
150
|
-
uri: string;
|
|
151
|
-
name: string;
|
|
152
|
-
text?: string;
|
|
153
|
-
blob?: string;
|
|
154
|
-
mimeType?: string;
|
|
155
|
-
} | {
|
|
156
|
-
type: "resource_link";
|
|
157
|
-
uri: string;
|
|
158
|
-
name: string;
|
|
159
|
-
mimeType?: string;
|
|
160
|
-
title?: string;
|
|
161
|
-
description?: string;
|
|
162
|
-
size?: number;
|
|
163
|
-
} | {
|
|
164
|
-
type: "tts_strip";
|
|
165
|
-
};
|
|
166
|
-
interface PlanEntry {
|
|
167
|
-
content: string;
|
|
168
|
-
status: "pending" | "in_progress" | "completed";
|
|
169
|
-
priority: "high" | "medium" | "low";
|
|
170
|
-
}
|
|
171
|
-
interface AgentDefinition {
|
|
172
|
-
name: string;
|
|
173
|
-
command: string;
|
|
174
|
-
args: string[];
|
|
175
|
-
workingDirectory?: string;
|
|
176
|
-
env?: Record<string, string>;
|
|
177
|
-
}
|
|
178
|
-
type AgentDistribution = "npx" | "uvx" | "binary" | "custom";
|
|
179
|
-
interface InstalledAgent {
|
|
180
|
-
registryId: string | null;
|
|
181
|
-
name: string;
|
|
182
|
-
version: string;
|
|
183
|
-
distribution: AgentDistribution;
|
|
184
|
-
command: string;
|
|
185
|
-
args: string[];
|
|
186
|
-
env: Record<string, string>;
|
|
187
|
-
workingDirectory?: string;
|
|
188
|
-
installedAt: string;
|
|
189
|
-
binaryPath: string | null;
|
|
190
|
-
}
|
|
191
|
-
interface RegistryBinaryTarget {
|
|
192
|
-
archive: string;
|
|
193
|
-
cmd: string;
|
|
194
|
-
args?: string[];
|
|
195
|
-
env?: Record<string, string>;
|
|
196
|
-
}
|
|
197
|
-
interface RegistryDistribution {
|
|
198
|
-
npx?: {
|
|
199
|
-
package: string;
|
|
200
|
-
args?: string[];
|
|
201
|
-
env?: Record<string, string>;
|
|
202
|
-
};
|
|
203
|
-
uvx?: {
|
|
204
|
-
package: string;
|
|
205
|
-
args?: string[];
|
|
206
|
-
env?: Record<string, string>;
|
|
207
|
-
};
|
|
208
|
-
binary?: Record<string, RegistryBinaryTarget>;
|
|
209
|
-
}
|
|
210
|
-
interface RegistryAgent {
|
|
211
|
-
id: string;
|
|
212
|
-
name: string;
|
|
213
|
-
version: string;
|
|
214
|
-
description: string;
|
|
215
|
-
repository?: string;
|
|
216
|
-
website?: string;
|
|
217
|
-
authors?: string[];
|
|
218
|
-
license?: string;
|
|
219
|
-
icon?: string;
|
|
220
|
-
distribution: RegistryDistribution;
|
|
221
|
-
}
|
|
222
|
-
interface AgentListItem {
|
|
223
|
-
key: string;
|
|
224
|
-
registryId: string;
|
|
225
|
-
name: string;
|
|
226
|
-
version: string;
|
|
227
|
-
description?: string;
|
|
228
|
-
distribution: AgentDistribution;
|
|
229
|
-
installed: boolean;
|
|
230
|
-
available: boolean;
|
|
231
|
-
missingDeps?: string[];
|
|
232
|
-
}
|
|
233
|
-
interface AvailabilityResult {
|
|
234
|
-
available: boolean;
|
|
235
|
-
reason?: string;
|
|
236
|
-
missing?: Array<{
|
|
237
|
-
label: string;
|
|
238
|
-
installHint: string;
|
|
239
|
-
}>;
|
|
240
|
-
}
|
|
241
|
-
interface InstallProgress {
|
|
242
|
-
onStart(agentId: string, agentName: string): void | Promise<void>;
|
|
243
|
-
onStep(step: string): void | Promise<void>;
|
|
244
|
-
onDownloadProgress(percent: number): void | Promise<void>;
|
|
245
|
-
onSuccess(agentName: string): void | Promise<void>;
|
|
246
|
-
onError(error: string, hint?: string): void | Promise<void>;
|
|
247
|
-
}
|
|
248
|
-
interface InstallResult {
|
|
249
|
-
ok: boolean;
|
|
250
|
-
agentKey: string;
|
|
251
|
-
error?: string;
|
|
252
|
-
hint?: string;
|
|
253
|
-
setupSteps?: string[];
|
|
254
|
-
}
|
|
255
|
-
type SessionStatus = "initializing" | "active" | "cancelled" | "finished" | "error";
|
|
256
|
-
interface AgentSwitchEntry {
|
|
257
|
-
agentName: string;
|
|
258
|
-
agentSessionId: string;
|
|
259
|
-
switchedAt: string;
|
|
260
|
-
promptCount: number;
|
|
261
|
-
}
|
|
262
|
-
interface SessionRecord<P = Record<string, unknown>> {
|
|
263
|
-
sessionId: string;
|
|
264
|
-
agentSessionId: string;
|
|
265
|
-
originalAgentSessionId?: string;
|
|
266
|
-
agentName: string;
|
|
267
|
-
workingDir: string;
|
|
268
|
-
channelId: string;
|
|
269
|
-
status: SessionStatus;
|
|
270
|
-
createdAt: string;
|
|
271
|
-
lastActiveAt: string;
|
|
272
|
-
name?: string;
|
|
273
|
-
dangerousMode?: boolean;
|
|
274
|
-
clientOverrides?: {
|
|
275
|
-
bypassPermissions?: boolean;
|
|
276
|
-
};
|
|
277
|
-
outputMode?: OutputMode;
|
|
278
|
-
platform: P;
|
|
279
|
-
firstAgent?: string;
|
|
280
|
-
currentPromptCount?: number;
|
|
281
|
-
agentSwitchHistory?: AgentSwitchEntry[];
|
|
282
|
-
acpState?: {
|
|
283
|
-
configOptions?: ConfigOption[];
|
|
284
|
-
agentCapabilities?: AgentCapabilities;
|
|
285
|
-
currentMode?: string;
|
|
286
|
-
availableModes?: SessionMode[];
|
|
287
|
-
currentModel?: string;
|
|
288
|
-
availableModels?: ModelInfo[];
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
interface TelegramPlatformData {
|
|
292
|
-
topicId: number;
|
|
293
|
-
skillMsgId?: number;
|
|
294
|
-
controlMsgId?: number;
|
|
295
|
-
}
|
|
296
|
-
interface UsageRecord {
|
|
297
|
-
id: string;
|
|
298
|
-
sessionId: string;
|
|
299
|
-
agentName: string;
|
|
300
|
-
tokensUsed: number;
|
|
301
|
-
contextSize: number;
|
|
302
|
-
cost?: {
|
|
303
|
-
amount: number;
|
|
304
|
-
currency: string;
|
|
305
|
-
};
|
|
306
|
-
timestamp: string;
|
|
307
|
-
}
|
|
308
|
-
interface UsageRecordEvent {
|
|
309
|
-
sessionId: string;
|
|
310
|
-
agentName: string;
|
|
311
|
-
timestamp: string;
|
|
312
|
-
tokensUsed: number;
|
|
313
|
-
contextSize: number;
|
|
314
|
-
cost?: {
|
|
315
|
-
amount: number;
|
|
316
|
-
currency: string;
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
interface SessionMode {
|
|
320
|
-
id: string;
|
|
321
|
-
name: string;
|
|
322
|
-
description?: string;
|
|
323
|
-
}
|
|
324
|
-
interface SessionModeState {
|
|
325
|
-
currentModeId: string;
|
|
326
|
-
availableModes: SessionMode[];
|
|
327
|
-
}
|
|
328
|
-
interface ConfigSelectChoice {
|
|
329
|
-
value: string;
|
|
330
|
-
name: string;
|
|
331
|
-
description?: string;
|
|
332
|
-
}
|
|
333
|
-
interface ConfigSelectGroup {
|
|
334
|
-
group: string;
|
|
335
|
-
name: string;
|
|
336
|
-
options: ConfigSelectChoice[];
|
|
337
|
-
}
|
|
338
|
-
type ConfigOption = {
|
|
339
|
-
id: string;
|
|
340
|
-
name: string;
|
|
341
|
-
description?: string;
|
|
342
|
-
category?: string;
|
|
343
|
-
type: "select";
|
|
344
|
-
currentValue: string;
|
|
345
|
-
options: (ConfigSelectChoice | ConfigSelectGroup)[];
|
|
346
|
-
_meta?: Record<string, unknown>;
|
|
347
|
-
} | {
|
|
348
|
-
id: string;
|
|
349
|
-
name: string;
|
|
350
|
-
description?: string;
|
|
351
|
-
category?: string;
|
|
352
|
-
type: "boolean";
|
|
353
|
-
currentValue: boolean;
|
|
354
|
-
_meta?: Record<string, unknown>;
|
|
355
|
-
};
|
|
356
|
-
type SetConfigOptionValue = {
|
|
357
|
-
type: "select";
|
|
358
|
-
value: string;
|
|
359
|
-
} | {
|
|
360
|
-
type: "boolean";
|
|
361
|
-
value: boolean;
|
|
362
|
-
};
|
|
363
|
-
interface ModelInfo {
|
|
364
|
-
id: string;
|
|
365
|
-
name: string;
|
|
366
|
-
description?: string;
|
|
367
|
-
}
|
|
368
|
-
interface SessionModelState {
|
|
369
|
-
currentModelId: string;
|
|
370
|
-
availableModels: ModelInfo[];
|
|
371
|
-
}
|
|
372
|
-
interface AgentCapabilities {
|
|
373
|
-
name: string;
|
|
374
|
-
title?: string;
|
|
375
|
-
version?: string;
|
|
376
|
-
loadSession?: boolean;
|
|
377
|
-
promptCapabilities?: {
|
|
378
|
-
image?: boolean;
|
|
379
|
-
audio?: boolean;
|
|
380
|
-
embeddedContext?: boolean;
|
|
381
|
-
};
|
|
382
|
-
sessionCapabilities?: {
|
|
383
|
-
list?: boolean;
|
|
384
|
-
fork?: boolean;
|
|
385
|
-
close?: boolean;
|
|
386
|
-
};
|
|
387
|
-
mcp?: {
|
|
388
|
-
http?: boolean;
|
|
389
|
-
sse?: boolean;
|
|
390
|
-
};
|
|
391
|
-
authMethods?: AuthMethod[];
|
|
392
|
-
}
|
|
393
|
-
interface NewSessionResponse {
|
|
394
|
-
sessionId: string;
|
|
395
|
-
modes?: SessionModeState;
|
|
396
|
-
configOptions?: ConfigOption[];
|
|
397
|
-
models?: SessionModelState;
|
|
398
|
-
}
|
|
399
|
-
type AuthMethod = {
|
|
400
|
-
type: "agent";
|
|
401
|
-
} | {
|
|
402
|
-
type: "env_var";
|
|
403
|
-
name: string;
|
|
404
|
-
description?: string;
|
|
405
|
-
} | {
|
|
406
|
-
type: "terminal";
|
|
407
|
-
};
|
|
408
|
-
interface AuthenticateRequest {
|
|
409
|
-
methodId: string;
|
|
410
|
-
}
|
|
411
|
-
type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
|
|
412
|
-
interface PromptResponse {
|
|
413
|
-
stopReason: StopReason;
|
|
414
|
-
_meta?: Record<string, unknown>;
|
|
415
|
-
}
|
|
416
|
-
type ContentBlock = {
|
|
417
|
-
type: "text";
|
|
418
|
-
text: string;
|
|
419
|
-
} | {
|
|
420
|
-
type: "image";
|
|
421
|
-
data: string;
|
|
422
|
-
mimeType: string;
|
|
423
|
-
uri?: string;
|
|
424
|
-
} | {
|
|
425
|
-
type: "audio";
|
|
426
|
-
data: string;
|
|
427
|
-
mimeType: string;
|
|
428
|
-
} | {
|
|
429
|
-
type: "resource";
|
|
430
|
-
resource: {
|
|
431
|
-
uri: string;
|
|
432
|
-
text?: string;
|
|
433
|
-
blob?: string;
|
|
434
|
-
mimeType?: string;
|
|
435
|
-
};
|
|
436
|
-
} | {
|
|
437
|
-
type: "resource_link";
|
|
438
|
-
uri: string;
|
|
439
|
-
name: string;
|
|
440
|
-
mimeType?: string;
|
|
441
|
-
title?: string;
|
|
442
|
-
description?: string;
|
|
443
|
-
size?: number;
|
|
444
|
-
};
|
|
445
|
-
interface SessionListItem {
|
|
446
|
-
sessionId: string;
|
|
447
|
-
title?: string;
|
|
448
|
-
createdAt: string;
|
|
449
|
-
updatedAt?: string;
|
|
450
|
-
_meta?: Record<string, unknown>;
|
|
451
|
-
}
|
|
452
|
-
interface SessionListResponse {
|
|
453
|
-
sessions: SessionListItem[];
|
|
454
|
-
nextCursor?: string;
|
|
455
|
-
}
|
|
456
|
-
type McpServerConfig = {
|
|
457
|
-
type?: "stdio";
|
|
458
|
-
name: string;
|
|
459
|
-
command: string;
|
|
460
|
-
args?: string[];
|
|
461
|
-
env?: Record<string, string>;
|
|
462
|
-
} | {
|
|
463
|
-
type: "http";
|
|
464
|
-
name: string;
|
|
465
|
-
url: string;
|
|
466
|
-
headers?: Record<string, string>;
|
|
467
|
-
} | {
|
|
468
|
-
type: "sse";
|
|
469
|
-
name: string;
|
|
470
|
-
url: string;
|
|
471
|
-
headers?: Record<string, string>;
|
|
472
|
-
};
|
|
473
|
-
|
|
474
11
|
declare const LoggingSchema: z.ZodDefault<z.ZodObject<{
|
|
475
12
|
level: z.ZodDefault<z.ZodEnum<["silent", "debug", "info", "warn", "error", "fatal"]>>;
|
|
476
13
|
logDir: z.ZodDefault<z.ZodString>;
|
|
@@ -554,7 +91,7 @@ declare const UsageSchema: z.ZodDefault<z.ZodObject<{
|
|
|
554
91
|
type UsageConfig = z.infer<typeof UsageSchema>;
|
|
555
92
|
declare const ConfigSchema: z.ZodObject<{
|
|
556
93
|
instanceName: z.ZodOptional<z.ZodString>;
|
|
557
|
-
channels: z.ZodObject<{}, "strip", z.ZodObject<{
|
|
94
|
+
channels: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodObject<{
|
|
558
95
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
559
96
|
adapter: z.ZodOptional<z.ZodString>;
|
|
560
97
|
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
@@ -599,7 +136,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
599
136
|
adapter: z.ZodOptional<z.ZodString>;
|
|
600
137
|
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
601
138
|
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
602
|
-
}, z.ZodTypeAny, "passthrough">>, "strip"
|
|
139
|
+
}, z.ZodTypeAny, "passthrough">>, "strip">>>;
|
|
603
140
|
agents: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
604
141
|
command: z.ZodString;
|
|
605
142
|
args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -919,14 +456,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
919
456
|
instanceName?: string | undefined;
|
|
920
457
|
outputMode?: "low" | "medium" | "high" | undefined;
|
|
921
458
|
}, {
|
|
922
|
-
channels: {} & {
|
|
923
|
-
[k: string]: z.objectInputType<{
|
|
924
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
925
|
-
adapter: z.ZodOptional<z.ZodString>;
|
|
926
|
-
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
927
|
-
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
928
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
929
|
-
};
|
|
930
459
|
defaultAgent: string;
|
|
931
460
|
api?: {
|
|
932
461
|
port?: number | undefined;
|
|
@@ -958,6 +487,22 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
958
487
|
retentionDays?: number | undefined;
|
|
959
488
|
} | undefined;
|
|
960
489
|
instanceName?: string | undefined;
|
|
490
|
+
channels?: z.objectInputType<{}, z.ZodObject<{
|
|
491
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
492
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
493
|
+
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
494
|
+
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
495
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
496
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
497
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
498
|
+
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
499
|
+
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
500
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
501
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
502
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
503
|
+
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
504
|
+
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
505
|
+
}, z.ZodTypeAny, "passthrough">>, "strip"> | undefined;
|
|
961
506
|
outputMode?: "low" | "medium" | "high" | undefined;
|
|
962
507
|
workspace?: {
|
|
963
508
|
baseDir?: string | undefined;
|
|
@@ -1012,6 +557,12 @@ declare class ConfigManager$1 extends EventEmitter {
|
|
|
1012
557
|
load(): Promise<void>;
|
|
1013
558
|
get(): Config;
|
|
1014
559
|
save(updates: Record<string, unknown>, changePath?: string): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Set a single config value by dot-path (e.g. "security.maxConcurrentSessions").
|
|
562
|
+
* Builds the nested update object, validates, and saves.
|
|
563
|
+
* Throws if the path contains blocked keys or the value fails Zod validation.
|
|
564
|
+
*/
|
|
565
|
+
setPath(dotPath: string, value: unknown): Promise<void>;
|
|
1015
566
|
resolveWorkspace(input?: string): string;
|
|
1016
567
|
exists(): Promise<boolean>;
|
|
1017
568
|
getConfigPath(): string;
|
|
@@ -1040,62 +591,6 @@ declare function createSessionLogger(sessionId: string, parentLogger: Logger$1):
|
|
|
1040
591
|
declare function shutdownLogger(): Promise<void>;
|
|
1041
592
|
declare function cleanupOldSessionLogs(retentionDays: number): Promise<void>;
|
|
1042
593
|
|
|
1043
|
-
interface ChannelConfig {
|
|
1044
|
-
enabled: boolean;
|
|
1045
|
-
[key: string]: unknown;
|
|
1046
|
-
}
|
|
1047
|
-
interface AdapterCapabilities {
|
|
1048
|
-
streaming: boolean;
|
|
1049
|
-
richFormatting: boolean;
|
|
1050
|
-
threads: boolean;
|
|
1051
|
-
reactions: boolean;
|
|
1052
|
-
fileUpload: boolean;
|
|
1053
|
-
voice: boolean;
|
|
1054
|
-
}
|
|
1055
|
-
interface IChannelAdapter {
|
|
1056
|
-
readonly name: string;
|
|
1057
|
-
readonly capabilities: AdapterCapabilities;
|
|
1058
|
-
start(): Promise<void>;
|
|
1059
|
-
stop(): Promise<void>;
|
|
1060
|
-
sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
|
|
1061
|
-
sendPermissionRequest(sessionId: string, request: PermissionRequest): Promise<void>;
|
|
1062
|
-
sendNotification(notification: NotificationMessage): Promise<void>;
|
|
1063
|
-
createSessionThread(sessionId: string, name: string): Promise<string>;
|
|
1064
|
-
renameSessionThread(sessionId: string, newName: string): Promise<void>;
|
|
1065
|
-
deleteSessionThread?(sessionId: string): Promise<void>;
|
|
1066
|
-
archiveSessionTopic?(sessionId: string): Promise<void>;
|
|
1067
|
-
stripTTSBlock?(sessionId: string): Promise<void>;
|
|
1068
|
-
sendSkillCommands?(sessionId: string, commands: AgentCommand[]): Promise<void>;
|
|
1069
|
-
cleanupSkillCommands?(sessionId: string): Promise<void>;
|
|
1070
|
-
/** Flush skill commands that were queued before threadId was available */
|
|
1071
|
-
flushPendingSkillCommands?(sessionId: string): Promise<void>;
|
|
1072
|
-
cleanupSessionState?(sessionId: string): Promise<void>;
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
* Base class providing default no-op implementations for optional methods.
|
|
1076
|
-
* Adapters can extend this or implement IChannelAdapter directly.
|
|
1077
|
-
* @deprecated Use MessagingAdapter or StreamAdapter instead. Kept for backward compat during migration.
|
|
1078
|
-
*/
|
|
1079
|
-
declare abstract class ChannelAdapter<TCore = unknown> implements IChannelAdapter {
|
|
1080
|
-
readonly core: TCore;
|
|
1081
|
-
protected config: ChannelConfig;
|
|
1082
|
-
abstract readonly name: string;
|
|
1083
|
-
readonly capabilities: AdapterCapabilities;
|
|
1084
|
-
constructor(core: TCore, config: ChannelConfig);
|
|
1085
|
-
abstract start(): Promise<void>;
|
|
1086
|
-
abstract stop(): Promise<void>;
|
|
1087
|
-
abstract sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
|
|
1088
|
-
abstract sendPermissionRequest(sessionId: string, request: PermissionRequest): Promise<void>;
|
|
1089
|
-
abstract sendNotification(notification: NotificationMessage): Promise<void>;
|
|
1090
|
-
abstract createSessionThread(sessionId: string, name: string): Promise<string>;
|
|
1091
|
-
abstract renameSessionThread(sessionId: string, newName: string): Promise<void>;
|
|
1092
|
-
deleteSessionThread(_sessionId: string): Promise<void>;
|
|
1093
|
-
sendSkillCommands(_sessionId: string, _commands: AgentCommand[]): Promise<void>;
|
|
1094
|
-
cleanupSkillCommands(_sessionId: string): Promise<void>;
|
|
1095
|
-
cleanupSessionState(_sessionId: string): Promise<void>;
|
|
1096
|
-
archiveSessionTopic(_sessionId: string): Promise<void>;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
594
|
declare function nodeToWebWritable(nodeStream: NodeJS.WritableStream): WritableStream<Uint8Array>;
|
|
1100
595
|
declare function nodeToWebReadable(nodeStream: NodeJS.ReadableStream): ReadableStream<Uint8Array>;
|
|
1101
596
|
|
|
@@ -1231,7 +726,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
|
|
|
1231
726
|
authenticate(methodId: string): Promise<void>;
|
|
1232
727
|
forkSession(sessionId: string, cwd: string, mcpServers?: McpServerConfig[]): Promise<ForkSessionResponse>;
|
|
1233
728
|
closeSession(sessionId: string): Promise<void>;
|
|
1234
|
-
prompt(text: string, attachments?: Attachment[]): Promise<PromptResponse
|
|
729
|
+
prompt(text: string, attachments?: Attachment[]): Promise<PromptResponse>;
|
|
1235
730
|
cancel(): Promise<void>;
|
|
1236
731
|
destroy(): Promise<void>;
|
|
1237
732
|
}
|
|
@@ -1418,8 +913,11 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
1418
913
|
promptCount: number;
|
|
1419
914
|
firstAgent: string;
|
|
1420
915
|
agentSwitchHistory: AgentSwitchEntry[];
|
|
916
|
+
isAssistant: boolean;
|
|
1421
917
|
log: Logger$1;
|
|
1422
918
|
middlewareChain?: MiddlewareChain;
|
|
919
|
+
/** Latest commands emitted by the agent — buffered before bridge connects so they're not lost */
|
|
920
|
+
latestCommands: AgentCommand[] | null;
|
|
1423
921
|
readonly permissionGate: PermissionGate;
|
|
1424
922
|
private readonly queue;
|
|
1425
923
|
private speechService?;
|
|
@@ -1431,11 +929,12 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
1431
929
|
workingDirectory: string;
|
|
1432
930
|
agentInstance: AgentInstance;
|
|
1433
931
|
speechService?: SpeechService;
|
|
932
|
+
isAssistant?: boolean;
|
|
1434
933
|
});
|
|
1435
934
|
get status(): SessionStatus;
|
|
1436
935
|
/** Transition to active — from initializing, error, or cancelled */
|
|
1437
936
|
activate(): void;
|
|
1438
|
-
/** Transition to error — from initializing or active */
|
|
937
|
+
/** Transition to error — from initializing or active. Idempotent if already in error. */
|
|
1439
938
|
fail(reason: string): void;
|
|
1440
939
|
/** Transition to finished — from active only. Emits session_end for backward compat. */
|
|
1441
940
|
finish(reason?: string): void;
|
|
@@ -1459,6 +958,8 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
1459
958
|
getConfigValue(id: string): string | undefined;
|
|
1460
959
|
/** Set session name explicitly and emit 'named' event */
|
|
1461
960
|
setName(name: string): void;
|
|
961
|
+
/** Send a config option change to the agent and update local state from the response. */
|
|
962
|
+
setConfigOption(configId: string, value: SetConfigOptionValue): Promise<void>;
|
|
1462
963
|
updateConfigOptions(options: ConfigOption[]): Promise<void>;
|
|
1463
964
|
/** Snapshot of current ACP state for persistence */
|
|
1464
965
|
toAcpStateSnapshot(): NonNullable<SessionRecord["acpState"]>;
|
|
@@ -1491,6 +992,27 @@ declare class PromptQueue {
|
|
|
1491
992
|
get isProcessing(): boolean;
|
|
1492
993
|
}
|
|
1493
994
|
|
|
995
|
+
interface AssistantCommand {
|
|
996
|
+
command: string;
|
|
997
|
+
description: string;
|
|
998
|
+
}
|
|
999
|
+
interface AssistantSection {
|
|
1000
|
+
id: string;
|
|
1001
|
+
title: string;
|
|
1002
|
+
priority: number;
|
|
1003
|
+
buildContext: () => string | null;
|
|
1004
|
+
commands?: AssistantCommand[];
|
|
1005
|
+
}
|
|
1006
|
+
declare class AssistantRegistry {
|
|
1007
|
+
private sections;
|
|
1008
|
+
private _instanceRoot;
|
|
1009
|
+
/** Set the instance root path used in assistant guidelines */
|
|
1010
|
+
setInstanceRoot(root: string): void;
|
|
1011
|
+
register(section: AssistantSection): void;
|
|
1012
|
+
unregister(id: string): void;
|
|
1013
|
+
buildSystemPrompt(channelId?: string): string;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1494
1016
|
type PluginPermission = 'events:read' | 'events:emit' | 'services:register' | 'services:use' | 'middleware:register' | 'commands:register' | 'storage:read' | 'storage:write' | 'kernel:access';
|
|
1495
1017
|
interface OpenACPPlugin {
|
|
1496
1018
|
/** Unique identifier, e.g., '@openacp/security' */
|
|
@@ -1621,7 +1143,26 @@ type CommandResponse = {
|
|
|
1621
1143
|
message: string;
|
|
1622
1144
|
} | {
|
|
1623
1145
|
type: 'silent';
|
|
1146
|
+
} | {
|
|
1147
|
+
type: 'delegated';
|
|
1624
1148
|
};
|
|
1149
|
+
interface MenuItem {
|
|
1150
|
+
id: string;
|
|
1151
|
+
label: string;
|
|
1152
|
+
priority: number;
|
|
1153
|
+
group?: string;
|
|
1154
|
+
action: {
|
|
1155
|
+
type: 'command';
|
|
1156
|
+
command: string;
|
|
1157
|
+
} | {
|
|
1158
|
+
type: 'delegate';
|
|
1159
|
+
prompt: string;
|
|
1160
|
+
} | {
|
|
1161
|
+
type: 'callback';
|
|
1162
|
+
callbackData: string;
|
|
1163
|
+
};
|
|
1164
|
+
visible?: () => boolean;
|
|
1165
|
+
}
|
|
1625
1166
|
interface MenuOption {
|
|
1626
1167
|
label: string;
|
|
1627
1168
|
command: string;
|
|
@@ -1705,6 +1246,14 @@ interface PluginContext {
|
|
|
1705
1246
|
getService<T>(name: string): T | undefined;
|
|
1706
1247
|
/** Register slash command. Requires 'commands:register'. */
|
|
1707
1248
|
registerCommand(def: CommandDef): void;
|
|
1249
|
+
/** Register a menu item. Requires 'commands:register'. */
|
|
1250
|
+
registerMenuItem(item: MenuItem): void;
|
|
1251
|
+
/** Unregister a menu item by id. Requires 'commands:register'. */
|
|
1252
|
+
unregisterMenuItem(id: string): void;
|
|
1253
|
+
/** Register an assistant section. Requires 'commands:register'. */
|
|
1254
|
+
registerAssistantSection(section: AssistantSection): void;
|
|
1255
|
+
/** Unregister an assistant section by id. Requires 'commands:register'. */
|
|
1256
|
+
unregisterAssistantSection(id: string): void;
|
|
1708
1257
|
/** Plugin-scoped storage. Requires 'storage:read' and/or 'storage:write'. */
|
|
1709
1258
|
storage: PluginStorage;
|
|
1710
1259
|
/** Plugin-scoped logger. Always available (no permission needed). */
|
|
@@ -1916,7 +1465,7 @@ interface ViewerStoreInterface {
|
|
|
1916
1465
|
}
|
|
1917
1466
|
interface TunnelServiceInterface {
|
|
1918
1467
|
getPublicUrl(): string;
|
|
1919
|
-
start(): Promise<string>;
|
|
1468
|
+
start(apiPort: number): Promise<string>;
|
|
1920
1469
|
stop(): Promise<void>;
|
|
1921
1470
|
getStore(): ViewerStoreInterface;
|
|
1922
1471
|
fileUrl(entryId: string): string;
|
|
@@ -1942,6 +1491,8 @@ declare class MessageTransformer {
|
|
|
1942
1491
|
|
|
1943
1492
|
interface SessionStore {
|
|
1944
1493
|
save(record: SessionRecord): Promise<void>;
|
|
1494
|
+
/** Immediately flush pending writes to disk (no debounce). */
|
|
1495
|
+
flush(): void;
|
|
1945
1496
|
get(sessionId: string): SessionRecord | undefined;
|
|
1946
1497
|
findByPlatform(channelId: string, predicate: (platform: Record<string, unknown>) => boolean): SessionRecord | undefined;
|
|
1947
1498
|
findByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
|
|
@@ -2017,6 +1568,11 @@ interface EventBusEvents {
|
|
|
2017
1568
|
attachments?: unknown[];
|
|
2018
1569
|
}) => void;
|
|
2019
1570
|
"usage:recorded": (data: UsageRecordEvent) => void;
|
|
1571
|
+
"session:threadReady": (data: {
|
|
1572
|
+
sessionId: string;
|
|
1573
|
+
channelId: string;
|
|
1574
|
+
threadId: string;
|
|
1575
|
+
}) => void;
|
|
2020
1576
|
"session:configChanged": (data: {
|
|
2021
1577
|
sessionId: string;
|
|
2022
1578
|
}) => void;
|
|
@@ -2046,7 +1602,9 @@ declare class SessionManager {
|
|
|
2046
1602
|
getRecordByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
|
|
2047
1603
|
getRecordByThread(channelId: string, threadId: string): SessionRecord | undefined;
|
|
2048
1604
|
registerSession(session: Session): void;
|
|
2049
|
-
patchRecord(sessionId: string, patch: Partial<SessionRecord
|
|
1605
|
+
patchRecord(sessionId: string, patch: Partial<SessionRecord>, options?: {
|
|
1606
|
+
immediate?: boolean;
|
|
1607
|
+
}): Promise<void>;
|
|
2050
1608
|
getSessionRecord(sessionId: string): SessionRecord | undefined;
|
|
2051
1609
|
cancelSession(sessionId: string): Promise<void>;
|
|
2052
1610
|
listSessions(channelId?: string): Session[];
|
|
@@ -2086,24 +1644,26 @@ declare class SessionBridge {
|
|
|
2086
1644
|
private adapter;
|
|
2087
1645
|
private deps;
|
|
2088
1646
|
private connected;
|
|
2089
|
-
private
|
|
2090
|
-
private sessionEventHandler?;
|
|
2091
|
-
private statusChangeHandler?;
|
|
2092
|
-
private namedHandler?;
|
|
2093
|
-
private promptCountHandler?;
|
|
1647
|
+
private cleanupFns;
|
|
2094
1648
|
constructor(session: Session, adapter: IChannelAdapter, deps: BridgeDeps);
|
|
2095
1649
|
private get tracer();
|
|
1650
|
+
/** Register a listener and track it for cleanup */
|
|
1651
|
+
private listen;
|
|
2096
1652
|
/** Send message to adapter, optionally running through message:outgoing middleware */
|
|
2097
1653
|
private sendMessage;
|
|
2098
1654
|
connect(): void;
|
|
2099
1655
|
disconnect(): void;
|
|
2100
|
-
|
|
2101
|
-
private
|
|
1656
|
+
/** Dispatch an agent event through middleware and to the adapter */
|
|
1657
|
+
private dispatchAgentEvent;
|
|
2102
1658
|
private handleAgentEvent;
|
|
2103
1659
|
/** Persist current ACP state (configOptions, agentCapabilities) to session store as cache */
|
|
2104
1660
|
private persistAcpState;
|
|
2105
|
-
|
|
2106
|
-
private
|
|
1661
|
+
/** Resolve a permission request through the full pipeline: middleware -> auto-approve -> ask user */
|
|
1662
|
+
private resolvePermission;
|
|
1663
|
+
/** Check if a permission request should be auto-approved (openacp commands or bypass mode) */
|
|
1664
|
+
private checkAutoApprove;
|
|
1665
|
+
/** Emit permission:afterResolve middleware hook (fire-and-forget) */
|
|
1666
|
+
private emitAfterResolve;
|
|
2107
1667
|
}
|
|
2108
1668
|
|
|
2109
1669
|
interface TunnelEntry {
|
|
@@ -2148,12 +1708,11 @@ declare class ViewerStore {
|
|
|
2148
1708
|
declare class TunnelService {
|
|
2149
1709
|
private registry;
|
|
2150
1710
|
private store;
|
|
2151
|
-
private server;
|
|
2152
1711
|
private config;
|
|
2153
|
-
private
|
|
1712
|
+
private apiPort;
|
|
2154
1713
|
private startError;
|
|
2155
1714
|
constructor(config: TunnelConfig, registryPath?: string, binDir?: string);
|
|
2156
|
-
start(): Promise<string>;
|
|
1715
|
+
start(apiPort: number): Promise<string>;
|
|
2157
1716
|
stop(): Promise<void>;
|
|
2158
1717
|
addTunnel(port: number, opts?: {
|
|
2159
1718
|
label?: string;
|
|
@@ -2219,10 +1778,127 @@ interface ContextResult {
|
|
|
2219
1778
|
};
|
|
2220
1779
|
}
|
|
2221
1780
|
|
|
1781
|
+
interface SessionHistory {
|
|
1782
|
+
version: 1;
|
|
1783
|
+
sessionId: string;
|
|
1784
|
+
turns: Turn[];
|
|
1785
|
+
}
|
|
1786
|
+
interface Turn {
|
|
1787
|
+
index: number;
|
|
1788
|
+
role: "user" | "assistant";
|
|
1789
|
+
timestamp: string;
|
|
1790
|
+
content?: string;
|
|
1791
|
+
attachments?: HistoryAttachment[];
|
|
1792
|
+
steps?: Step[];
|
|
1793
|
+
usage?: HistoryUsage;
|
|
1794
|
+
stopReason?: string;
|
|
1795
|
+
}
|
|
1796
|
+
interface HistoryAttachment {
|
|
1797
|
+
type: "image" | "audio" | "file";
|
|
1798
|
+
fileName: string;
|
|
1799
|
+
mimeType: string;
|
|
1800
|
+
size: number;
|
|
1801
|
+
}
|
|
1802
|
+
interface HistoryUsage {
|
|
1803
|
+
tokensUsed?: number;
|
|
1804
|
+
contextSize?: number;
|
|
1805
|
+
cost?: {
|
|
1806
|
+
amount: number;
|
|
1807
|
+
currency: string;
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
type Step = ThinkingStep | TextStep | ToolCallStep | PlanStep | ImageStep | AudioStep | ResourceStep | ResourceLinkStep | ModeChangeStep | ConfigChangeStep;
|
|
1811
|
+
interface ThinkingStep {
|
|
1812
|
+
type: "thinking";
|
|
1813
|
+
content: string;
|
|
1814
|
+
}
|
|
1815
|
+
interface TextStep {
|
|
1816
|
+
type: "text";
|
|
1817
|
+
content: string;
|
|
1818
|
+
}
|
|
1819
|
+
interface ToolCallStep {
|
|
1820
|
+
type: "tool_call";
|
|
1821
|
+
id: string;
|
|
1822
|
+
name: string;
|
|
1823
|
+
kind?: string;
|
|
1824
|
+
status: string;
|
|
1825
|
+
input?: unknown;
|
|
1826
|
+
output?: unknown;
|
|
1827
|
+
diff?: {
|
|
1828
|
+
path: string;
|
|
1829
|
+
oldText?: string;
|
|
1830
|
+
newText: string;
|
|
1831
|
+
} | null;
|
|
1832
|
+
locations?: {
|
|
1833
|
+
path: string;
|
|
1834
|
+
line?: number;
|
|
1835
|
+
}[];
|
|
1836
|
+
permission?: {
|
|
1837
|
+
requested: boolean;
|
|
1838
|
+
outcome: string;
|
|
1839
|
+
} | null;
|
|
1840
|
+
}
|
|
1841
|
+
interface PlanStep {
|
|
1842
|
+
type: "plan";
|
|
1843
|
+
entries: {
|
|
1844
|
+
content: string;
|
|
1845
|
+
priority: string;
|
|
1846
|
+
status: string;
|
|
1847
|
+
}[];
|
|
1848
|
+
}
|
|
1849
|
+
interface ImageStep {
|
|
1850
|
+
type: "image";
|
|
1851
|
+
mimeType: string;
|
|
1852
|
+
filePath: string;
|
|
1853
|
+
size?: number;
|
|
1854
|
+
}
|
|
1855
|
+
interface AudioStep {
|
|
1856
|
+
type: "audio";
|
|
1857
|
+
mimeType: string;
|
|
1858
|
+
filePath: string;
|
|
1859
|
+
size?: number;
|
|
1860
|
+
}
|
|
1861
|
+
interface ResourceStep {
|
|
1862
|
+
type: "resource";
|
|
1863
|
+
uri: string;
|
|
1864
|
+
name: string;
|
|
1865
|
+
text?: string;
|
|
1866
|
+
}
|
|
1867
|
+
interface ResourceLinkStep {
|
|
1868
|
+
type: "resource_link";
|
|
1869
|
+
uri: string;
|
|
1870
|
+
name: string;
|
|
1871
|
+
title?: string;
|
|
1872
|
+
description?: string;
|
|
1873
|
+
}
|
|
1874
|
+
interface ModeChangeStep {
|
|
1875
|
+
type: "mode_change";
|
|
1876
|
+
modeId: string;
|
|
1877
|
+
}
|
|
1878
|
+
interface ConfigChangeStep {
|
|
1879
|
+
type: "config_change";
|
|
1880
|
+
configId: string;
|
|
1881
|
+
value: string;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
declare class HistoryStore {
|
|
1885
|
+
private readonly dir;
|
|
1886
|
+
constructor(dir: string);
|
|
1887
|
+
write(history: SessionHistory): Promise<void>;
|
|
1888
|
+
read(sessionId: string): Promise<SessionHistory | null>;
|
|
1889
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1890
|
+
list(): Promise<string[]>;
|
|
1891
|
+
delete(sessionId: string): Promise<void>;
|
|
1892
|
+
private filePath;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
2222
1895
|
declare class ContextManager {
|
|
2223
1896
|
private providers;
|
|
2224
1897
|
private cache;
|
|
1898
|
+
private historyStore?;
|
|
2225
1899
|
constructor(cachePath?: string);
|
|
1900
|
+
setHistoryStore(store: HistoryStore): void;
|
|
1901
|
+
getHistory(sessionId: string): Promise<SessionHistory | null>;
|
|
2226
1902
|
register(provider: ContextProvider): void;
|
|
2227
1903
|
getProvider(repoPath: string): Promise<ContextProvider | null>;
|
|
2228
1904
|
listSessions(query: ContextQuery): Promise<SessionListResult | null>;
|
|
@@ -2408,6 +2084,45 @@ declare class LifecycleManager {
|
|
|
2408
2084
|
shutdown(): Promise<void>;
|
|
2409
2085
|
}
|
|
2410
2086
|
|
|
2087
|
+
declare class MenuRegistry {
|
|
2088
|
+
private items;
|
|
2089
|
+
register(item: MenuItem): void;
|
|
2090
|
+
unregister(id: string): void;
|
|
2091
|
+
getItem(id: string): MenuItem | undefined;
|
|
2092
|
+
/** Get all visible items sorted by priority */
|
|
2093
|
+
getItems(): MenuItem[];
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
interface AssistantManagerCore {
|
|
2097
|
+
createSession(params: {
|
|
2098
|
+
channelId: string;
|
|
2099
|
+
agentName: string;
|
|
2100
|
+
workingDirectory: string;
|
|
2101
|
+
initialName?: string;
|
|
2102
|
+
isAssistant?: boolean;
|
|
2103
|
+
}): Promise<Session>;
|
|
2104
|
+
connectSessionBridge(session: Session): void;
|
|
2105
|
+
configManager: {
|
|
2106
|
+
get(): {
|
|
2107
|
+
defaultAgent: string;
|
|
2108
|
+
};
|
|
2109
|
+
resolveWorkspace(): string;
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
declare class AssistantManager {
|
|
2113
|
+
private core;
|
|
2114
|
+
private registry;
|
|
2115
|
+
private sessions;
|
|
2116
|
+
private readyState;
|
|
2117
|
+
private respawning;
|
|
2118
|
+
constructor(core: AssistantManagerCore, registry: AssistantRegistry);
|
|
2119
|
+
spawn(channelId: string, threadId: string): Promise<Session>;
|
|
2120
|
+
get(channelId: string): Session | null;
|
|
2121
|
+
isAssistant(sessionId: string): boolean;
|
|
2122
|
+
respawn(channelId: string, threadId: string): Promise<Session>;
|
|
2123
|
+
waitReady(channelId: string): Promise<void>;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2411
2126
|
interface InstanceContext {
|
|
2412
2127
|
id: string;
|
|
2413
2128
|
root: string;
|
|
@@ -2450,6 +2165,9 @@ declare class OpenACPCore {
|
|
|
2450
2165
|
readonly lifecycleManager: LifecycleManager;
|
|
2451
2166
|
private agentSwitchHandler;
|
|
2452
2167
|
readonly instanceContext?: InstanceContext;
|
|
2168
|
+
readonly menuRegistry: MenuRegistry;
|
|
2169
|
+
readonly assistantRegistry: AssistantRegistry;
|
|
2170
|
+
assistantManager: AssistantManager;
|
|
2453
2171
|
private getService;
|
|
2454
2172
|
get securityGuard(): SecurityGuard;
|
|
2455
2173
|
get notificationManager(): NotificationManager;
|
|
@@ -2508,7 +2226,10 @@ declare class OpenACPCore {
|
|
|
2508
2226
|
resumed: boolean;
|
|
2509
2227
|
}>;
|
|
2510
2228
|
getOrResumeSession(channelId: string, threadId: string): Promise<Session | null>;
|
|
2511
|
-
/**
|
|
2229
|
+
/** Connect a session bridge for the given session (used by AssistantManager) */
|
|
2230
|
+
connectSessionBridge(session: Session): void;
|
|
2231
|
+
/** Create a SessionBridge for the given session and adapter.
|
|
2232
|
+
* Disconnects any existing bridge for the same session first. */
|
|
2512
2233
|
createBridge(session: Session, adapter: IChannelAdapter): SessionBridge;
|
|
2513
2234
|
}
|
|
2514
2235
|
|
|
@@ -2697,10 +2418,28 @@ interface CreateTokenOpts {
|
|
|
2697
2418
|
expire: string;
|
|
2698
2419
|
scopes?: string[];
|
|
2699
2420
|
}
|
|
2421
|
+
interface StoredCode {
|
|
2422
|
+
code: string;
|
|
2423
|
+
role: string;
|
|
2424
|
+
scopes?: string[];
|
|
2425
|
+
name: string;
|
|
2426
|
+
expire: string;
|
|
2427
|
+
createdAt: string;
|
|
2428
|
+
expiresAt: string;
|
|
2429
|
+
used: boolean;
|
|
2430
|
+
}
|
|
2431
|
+
interface CreateCodeOpts {
|
|
2432
|
+
role: string;
|
|
2433
|
+
name: string;
|
|
2434
|
+
expire: string;
|
|
2435
|
+
scopes?: string[];
|
|
2436
|
+
codeTtlMs?: number;
|
|
2437
|
+
}
|
|
2700
2438
|
|
|
2701
2439
|
declare class TokenStore {
|
|
2702
2440
|
private filePath;
|
|
2703
2441
|
private tokens;
|
|
2442
|
+
private codes;
|
|
2704
2443
|
private savePromise;
|
|
2705
2444
|
private savePending;
|
|
2706
2445
|
constructor(filePath: string);
|
|
@@ -2713,9 +2452,14 @@ declare class TokenStore {
|
|
|
2713
2452
|
list(): StoredToken[];
|
|
2714
2453
|
private lastUsedSaveTimer;
|
|
2715
2454
|
updateLastUsed(id: string): void;
|
|
2716
|
-
/** Wait for any in-flight
|
|
2455
|
+
/** Wait for any in-flight and pending saves to complete */
|
|
2717
2456
|
flush(): Promise<void>;
|
|
2718
2457
|
destroy(): void;
|
|
2458
|
+
createCode(opts: CreateCodeOpts): StoredCode;
|
|
2459
|
+
getCode(code: string): StoredCode | undefined;
|
|
2460
|
+
exchangeCode(code: string): StoredCode | undefined;
|
|
2461
|
+
listCodes(): StoredCode[];
|
|
2462
|
+
revokeCode(code: string): void;
|
|
2719
2463
|
cleanup(): void;
|
|
2720
2464
|
}
|
|
2721
2465
|
|
|
@@ -3232,8 +2976,6 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
3232
2976
|
private telegramConfig;
|
|
3233
2977
|
private saveTopicIds?;
|
|
3234
2978
|
private permissionHandler;
|
|
3235
|
-
private assistantSession;
|
|
3236
|
-
private assistantInitializing;
|
|
3237
2979
|
private notificationTopicId;
|
|
3238
2980
|
private assistantTopicId;
|
|
3239
2981
|
private sendQueue;
|
|
@@ -3319,4 +3061,4 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
3319
3061
|
archiveSessionTopic(sessionId: string): Promise<void>;
|
|
3320
3062
|
}
|
|
3321
3063
|
|
|
3322
|
-
export { ActivityTracker,
|
|
3064
|
+
export { ActivityTracker, AdapterCapabilities, AgentCapabilities, AgentCatalog, AgentCommand, AgentDefinition, AgentEvent, AgentInstance, AgentListItem, AgentManager, AgentStore, AgentSwitchEntry, type ApiConfig, type ApiServerInstance, type ApiServerOptions, type ApiServerService, type AssistantCommand, AssistantManager, AssistantRegistry, type AssistantSection, Attachment, AvailabilityResult, BaseRenderer, type BridgeDeps, CONFIG_REGISTRY, ChannelConfig, type CleanupResult, type CommandArgs, type CommandDef, CommandRegistry, type CommandResponse, type Config, type ConfigFieldDef, ConfigManager$1 as ConfigManager, ConfigOption, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type ContextService, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, DisplaySpecBuilder, DisplayVerbosity, DoctorEngine, type DoctorReport, DraftManager, EntireProvider, EventBus, type EventBusEvents, FileService, type FileServiceInterface, GroqSTT, IChannelAdapter, type IRenderer, IncomingMessage, type InstallContext, InstallProgress, InstallResult, InstalledAgent, type ListItem, type Logger$1 as Logger, type LoggingConfig, McpServerConfig, type MenuItem, type MenuOption, MenuRegistry, MessageTransformer, MessagingAdapter, type MessagingAdapterConfig, type MigrateContext, NotificationManager, NotificationMessage, type NotificationService, OpenACPCore, type OpenACPPlugin, OutgoingMessage, OutputMode, OutputModeResolver, PRODUCT_GUIDE, type PendingFix, PermissionGate, PermissionRequest, PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, RegistryAgent, type RenderedMessage, SSEManager, type STTOptions, type STTProvider$1 as STTProvider, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, SessionRecord, SessionStatus, SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, StopReason, StreamAdapter, type TTSOptions, type TTSProvider$1 as TTSProvider, type TTSResult, TelegramAdapter, type TerminalIO, ThoughtBuffer, type ThoughtDisplaySpec, ToolCallMeta, ToolCallTracker, type ToolCardSnapshot, ToolCardState, type ToolCardStateConfig, type ToolDisplaySpec, type ToolEntry, ToolStateMap, type TopicInfo, TopicManager, type TunnelServiceInterface, TypedEmitter, type UsageConfig, UsageRecord, UsageRecordEvent, type UsageService, ViewerLinks, cleanupOldSessionLogs, createApiServer, createApiServerService, createChildLogger, createSessionLogger, expandHome, extractContentText, formatTokens, formatToolSummary, formatToolTitle, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, log, nodeToWebReadable, nodeToWebWritable, progressBar, resolveOptions, resolveToolIcon, runConfigEditor, setLogLevel, shutdownLogger, splitMessage, startDaemon, stopDaemon, stripCodeFences, truncateContent, uninstallAutoStart };
|