@easbot/acp 0.3.29 → 0.3.36

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.
Files changed (66) hide show
  1. package/README.en.md +187 -30
  2. package/README.md +293 -84
  3. package/dist/chunks/bootstrap-67LTURXQ.cjs +1 -0
  4. package/dist/chunks/bootstrap-DHON75MT.mjs +1 -0
  5. package/dist/chunks/cache-5PSUWHGW.cjs +1 -0
  6. package/dist/chunks/cache-O43SNRV2.mjs +1 -0
  7. package/dist/chunks/chunk-33M2R2US.mjs +1 -0
  8. package/dist/chunks/chunk-663BEBE4.cjs +1 -0
  9. package/dist/chunks/chunk-6VF3MZ6H.cjs +1 -0
  10. package/dist/chunks/chunk-B3ANZALB.mjs +2 -0
  11. package/dist/chunks/chunk-D4TSQ2TT.mjs +0 -0
  12. package/dist/chunks/chunk-DX35VSAT.cjs +1 -0
  13. package/dist/chunks/chunk-FAYVTNTB.mjs +1 -0
  14. package/dist/chunks/chunk-FDMRPUSH.mjs +8 -0
  15. package/dist/chunks/chunk-H57INME2.cjs +2 -0
  16. package/dist/chunks/chunk-IOEQ7YHD.cjs +8 -0
  17. package/dist/chunks/chunk-JEYD2VIG.mjs +2 -0
  18. package/dist/chunks/chunk-JLO7UYKQ.cjs +1 -0
  19. package/dist/chunks/chunk-OQH5ALTQ.cjs +1 -0
  20. package/dist/chunks/chunk-PCEPFPJO.cjs +11 -0
  21. package/dist/chunks/chunk-SNWAB3QJ.cjs +2 -0
  22. package/dist/chunks/chunk-SWK2ITXO.mjs +11 -0
  23. package/dist/chunks/chunk-ZGY6CLVQ.mjs +1 -0
  24. package/dist/chunks/chunk-ZZK2JEUF.mjs +1 -0
  25. package/dist/chunks/cli-handler-IU5ATLSM.cjs +1 -0
  26. package/dist/chunks/cli-handler-VKJJ4B6G.mjs +1 -0
  27. package/dist/chunks/config-FVZNV76C.mjs +1 -0
  28. package/dist/chunks/config-QMFC2VIL.cjs +1 -0
  29. package/dist/chunks/interfaces-CGLEY6OS.cjs +1 -0
  30. package/dist/chunks/interfaces-HUTPEB67.mjs +1 -0
  31. package/dist/chunks/loader-5EYZQR7W.mjs +1 -0
  32. package/dist/chunks/loader-63RVAVIL.cjs +1 -0
  33. package/dist/chunks/types-BZWPIPG6.mjs +1 -0
  34. package/dist/chunks/types-NFMF7IZL.cjs +1 -0
  35. package/dist/cli.cjs +1 -1
  36. package/dist/cli.mjs +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.cts +1169 -374
  39. package/dist/index.d.ts +1169 -374
  40. package/dist/index.mjs +1 -1
  41. package/package.json +7 -7
  42. package/dist/chunks/bootstrap-5LQOAO3Q.cjs +0 -1
  43. package/dist/chunks/bootstrap-VXDGNMPK.mjs +0 -1
  44. package/dist/chunks/cache-EJ4Y2PSY.cjs +0 -1
  45. package/dist/chunks/cache-SOYLU2DS.mjs +0 -1
  46. package/dist/chunks/chunk-3OTURNTA.cjs +0 -11
  47. package/dist/chunks/chunk-CIOYWMQM.cjs +0 -1
  48. package/dist/chunks/chunk-DS4SO4NN.cjs +0 -2
  49. package/dist/chunks/chunk-ER7EK5Z3.mjs +0 -8
  50. package/dist/chunks/chunk-F44AHCPJ.cjs +0 -8
  51. package/dist/chunks/chunk-HA3RF4AE.cjs +0 -1
  52. package/dist/chunks/chunk-MFINI6BI.mjs +0 -1
  53. package/dist/chunks/chunk-PEMSMRYT.mjs +0 -1
  54. package/dist/chunks/chunk-RTXRNSMY.mjs +0 -1
  55. package/dist/chunks/chunk-SHXWJMFY.mjs +0 -11
  56. package/dist/chunks/chunk-UTBY7IJT.mjs +0 -2
  57. package/dist/chunks/chunk-Z4D2PWDQ.cjs +0 -1
  58. package/dist/chunks/cli-handler-2KK2I4DG.mjs +0 -1
  59. package/dist/chunks/cli-handler-EM2BY47U.cjs +0 -1
  60. package/dist/chunks/config-KX5CSYLV.mjs +0 -1
  61. package/dist/chunks/config-YIR7GKPG.cjs +0 -1
  62. package/dist/chunks/interfaces-6BMD3FTB.cjs +0 -1
  63. package/dist/chunks/interfaces-UB3BFHJN.mjs +0 -1
  64. package/dist/chunks/types-CHN33Z37.mjs +0 -1
  65. package/dist/chunks/types-XGBPFI7X.cjs +0 -1
  66. /package/dist/chunks/{chunk-M2YU5LAI.cjs → chunk-ISDIC2R6.cjs} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { ACPInfoACPConfig, ACPClientConfig, ACPClientsConfig, ACPServerConfig as ACPServerConfig$1, IGlobal, IInstance, ChannelType } from '@easbot/types';
2
- export { ACPAgentRuntimeConfig, ACPAgentRuntimeConfigSchema, ACPClientConfig, ACPClientConfigSchema, ACPClientsConfig, ACPClientsConfigSchema, ACPConnectionConfig, ACPConnectionConfigSchema, ACPHttpConnectionConfig, ACPHttpConnectionConfigSchema, ACPInfoACPClientsConfig, ACPInfoACPClientsConfigSchema, ACPInfoACPConfig, ACPInfoACPConfigSchema, ACPInfoACPServerConfig, ACPInfoACPServerConfigSchema, ACPModelConfig, ACPModelConfigSchema, ACPParsePartialConfig, ACPServerConfig, ACPServerConfigSchema, ACPStdioConnectionConfig, ACPStdioConnectionConfigSchema, ACPValidateConfig, ACPWebSocketConnectionConfig, ACPWebSocketConnectionConfigSchema, ACP_DEFAULT_CLIENT_CONFIG, ACP_DEFAULT_SERVER_CONFIG, ChannelType } from '@easbot/types';
3
- import z from 'zod';
4
- import { NameErrors as NameErrors$1, ACPSubscriber, EasServer } from '@easbot/utils';
5
- export { ServiceError, ServiceError as ServiceErrorInstance } from '@easbot/utils';
1
+ import { ACPInfoACPConfig, ACPClientConfig, ACPClientsConfig, ACPServerConfig as ACPServerConfig$1, IGlobal, IInstance, ModelIdentifier, ChannelType } from '@easbot/types';
2
+ export { ACPAgentRuntimeConfig, ACPAgentRuntimeConfigSchema, ACPClientConfig, ACPClientsConfig, ACPConnectionConfig, ACPConnectionConfigSchema, ACPHttpConnectionConfig, ACPHttpConnectionConfigSchema, ACPInfoACPClientsConfig, ACPInfoACPClientsConfigSchema, ACPInfoACPConfig, ACPInfoACPServerConfig, ACPInfoACPServerConfigSchema, ACPModelConfig, ACPModelConfigSchema, ACPServerConfig, ACPStdioConnectionConfig, ACPStdioConnectionConfigSchema, ACPWebSocketConnectionConfig, ACPWebSocketConnectionConfigSchema, ACP_DEFAULT_CLIENT_CONFIG, ACP_DEFAULT_SERVER_CONFIG, ChannelType } from '@easbot/types';
3
+ import z$1, { z } from 'zod';
4
+ import { NameErrors as NameErrors$1, ACPConnectionRegistryConfig, ACPConnectionResult, ACPConnectionState, ACPRoutingContext, ACPRoutingResult, EasServer } from '@easbot/utils';
5
+ export { ACPComposedContext, ACPConnectionRegistryConfig, ACPConnectionResult, ACPConnectionState, ACPDegradationInfo, ACPHistoryContext, ACPInteractionConfig, ACPInteractionContext, ACPInteractionMessage, ACPRoutingContext, ACPRoutingResult, ServiceError, ServiceError as ServiceErrorInstance } from '@easbot/utils';
6
6
  import { EasbotClient, ContextMode } from '@easbot/sdk';
7
7
  import { AvailableCommand, SessionConfigOption, SessionNotification, McpServer, Agent, AgentSideConnection, InitializeRequest, InitializeResponse, AuthenticateRequest, AuthenticateResponse, NewSessionRequest, NewSessionResponse, LoadSessionRequest, LoadSessionResponse, PromptRequest, PromptResponse, CancelNotification, ForkSessionRequest, ForkSessionResponse, ResumeSessionRequest, ResumeSessionResponse, ListSessionsRequest, ListSessionsResponse, SetSessionModeRequest, SetSessionModeResponse, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, CloseSessionRequest, CloseSessionResponse } from '@agentclientprotocol/sdk';
8
8
 
@@ -60,16 +60,478 @@ declare const formatLog: (key: string, options?: FormatLogOptions) => {
60
60
  context: Record<string, any>;
61
61
  };
62
62
 
63
+ declare const ACPServerConfigSchema: z.ZodPipe<z.ZodObject<{
64
+ directory: z.ZodDefault<z.ZodString>;
65
+ enabled: z.ZodDefault<z.ZodBoolean>;
66
+ channel: z.ZodDefault<z.ZodPreprocess<z.ZodEnum<{
67
+ stdio: "stdio";
68
+ http: "http";
69
+ websocket: "websocket";
70
+ }>, unknown>>;
71
+ port: z.ZodDefault<z.ZodNumber>;
72
+ hostname: z.ZodDefault<z.ZodCustomStringFormat<"hostname">>;
73
+ timeout: z.ZodDefault<z.ZodNumber>;
74
+ name: z.ZodOptional<z.ZodString>;
75
+ agentId: z.ZodOptional<z.ZodString>;
76
+ stdio: z.ZodOptional<z.ZodObject<{
77
+ command: z.ZodString;
78
+ args: z.ZodArray<z.ZodString>;
79
+ }, z.core.$strip>>;
80
+ http: z.ZodOptional<z.ZodObject<{
81
+ baseUrl: z.ZodString;
82
+ timeout: z.ZodDefault<z.ZodNumber>;
83
+ }, z.core.$strip>>;
84
+ ws: z.ZodOptional<z.ZodObject<{
85
+ url: z.ZodString;
86
+ timeout: z.ZodDefault<z.ZodNumber>;
87
+ batchSize: z.ZodDefault<z.ZodNumber>;
88
+ batchInterval: z.ZodDefault<z.ZodNumber>;
89
+ heartbeatInterval: z.ZodDefault<z.ZodNumber>;
90
+ }, z.core.$strip>>;
91
+ agent: z.ZodOptional<z.ZodObject<{
92
+ agent: z.ZodOptional<z.ZodString>;
93
+ model: z.ZodOptional<z.ZodObject<{
94
+ id: z.ZodString;
95
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
96
+ }, z.core.$strip>>;
97
+ }, z.core.$strip>>;
98
+ }, z.core.$strip>, z.ZodTransform<{
99
+ channel: "stdio" | "http" | "websocket";
100
+ directory: string;
101
+ enabled: boolean;
102
+ port: number;
103
+ hostname: string;
104
+ timeout: number;
105
+ name?: string | undefined;
106
+ agentId?: string | undefined;
107
+ stdio?: {
108
+ command: string;
109
+ args: string[];
110
+ } | undefined;
111
+ http?: {
112
+ baseUrl: string;
113
+ timeout: number;
114
+ } | undefined;
115
+ ws?: {
116
+ url: string;
117
+ timeout: number;
118
+ batchSize: number;
119
+ batchInterval: number;
120
+ heartbeatInterval: number;
121
+ } | undefined;
122
+ agent?: {
123
+ agent?: string | undefined;
124
+ model?: {
125
+ id: string;
126
+ options?: Record<string, unknown> | undefined;
127
+ } | undefined;
128
+ } | undefined;
129
+ }, {
130
+ directory: string;
131
+ enabled: boolean;
132
+ channel: "stdio" | "http" | "websocket";
133
+ port: number;
134
+ hostname: string;
135
+ timeout: number;
136
+ name?: string | undefined;
137
+ agentId?: string | undefined;
138
+ stdio?: {
139
+ command: string;
140
+ args: string[];
141
+ } | undefined;
142
+ http?: {
143
+ baseUrl: string;
144
+ timeout: number;
145
+ } | undefined;
146
+ ws?: {
147
+ url: string;
148
+ timeout: number;
149
+ batchSize: number;
150
+ batchInterval: number;
151
+ heartbeatInterval: number;
152
+ } | undefined;
153
+ agent?: {
154
+ agent?: string | undefined;
155
+ model?: {
156
+ id: string;
157
+ options?: Record<string, unknown> | undefined;
158
+ } | undefined;
159
+ } | undefined;
160
+ }>>;
161
+ declare const ACPClientConfigSchema: z.ZodPipe<z.ZodObject<{
162
+ id: z.ZodString;
163
+ type: z.ZodEnum<{
164
+ custom: "custom";
165
+ easbot: "easbot";
166
+ }>;
167
+ name: z.ZodOptional<z.ZodString>;
168
+ agentId: z.ZodOptional<z.ZodString>;
169
+ channel: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
170
+ stdio: "stdio";
171
+ http: "http";
172
+ websocket: "websocket";
173
+ }>, unknown>>;
174
+ connection: z.ZodObject<{
175
+ stdio: z.ZodOptional<z.ZodObject<{
176
+ command: z.ZodString;
177
+ args: z.ZodArray<z.ZodString>;
178
+ }, z.core.$strip>>;
179
+ http: z.ZodOptional<z.ZodObject<{
180
+ baseUrl: z.ZodString;
181
+ timeout: z.ZodDefault<z.ZodNumber>;
182
+ }, z.core.$strip>>;
183
+ ws: z.ZodOptional<z.ZodObject<{
184
+ url: z.ZodString;
185
+ timeout: z.ZodDefault<z.ZodNumber>;
186
+ batchSize: z.ZodDefault<z.ZodNumber>;
187
+ batchInterval: z.ZodDefault<z.ZodNumber>;
188
+ heartbeatInterval: z.ZodDefault<z.ZodNumber>;
189
+ }, z.core.$strip>>;
190
+ }, z.core.$strip>;
191
+ autoConnect: z.ZodDefault<z.ZodBoolean>;
192
+ priority: z.ZodDefault<z.ZodNumber>;
193
+ }, z.core.$strip>, z.ZodTransform<{
194
+ channel: "stdio" | "http" | "websocket";
195
+ id: string;
196
+ type: "custom" | "easbot";
197
+ connection: {
198
+ stdio?: {
199
+ command: string;
200
+ args: string[];
201
+ } | undefined;
202
+ http?: {
203
+ baseUrl: string;
204
+ timeout: number;
205
+ } | undefined;
206
+ ws?: {
207
+ url: string;
208
+ timeout: number;
209
+ batchSize: number;
210
+ batchInterval: number;
211
+ heartbeatInterval: number;
212
+ } | undefined;
213
+ };
214
+ autoConnect: boolean;
215
+ priority: number;
216
+ name?: string | undefined;
217
+ agentId?: string | undefined;
218
+ }, {
219
+ id: string;
220
+ type: "custom" | "easbot";
221
+ connection: {
222
+ stdio?: {
223
+ command: string;
224
+ args: string[];
225
+ } | undefined;
226
+ http?: {
227
+ baseUrl: string;
228
+ timeout: number;
229
+ } | undefined;
230
+ ws?: {
231
+ url: string;
232
+ timeout: number;
233
+ batchSize: number;
234
+ batchInterval: number;
235
+ heartbeatInterval: number;
236
+ } | undefined;
237
+ };
238
+ autoConnect: boolean;
239
+ priority: number;
240
+ name?: string | undefined;
241
+ agentId?: string | undefined;
242
+ channel?: "stdio" | "http" | "websocket" | undefined;
243
+ }>>;
244
+ declare const ACPClientsConfigSchema: z.ZodObject<{
245
+ clients: z.ZodArray<z.ZodPipe<z.ZodObject<{
246
+ id: z.ZodString;
247
+ type: z.ZodEnum<{
248
+ custom: "custom";
249
+ easbot: "easbot";
250
+ }>;
251
+ name: z.ZodOptional<z.ZodString>;
252
+ agentId: z.ZodOptional<z.ZodString>;
253
+ channel: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
254
+ stdio: "stdio";
255
+ http: "http";
256
+ websocket: "websocket";
257
+ }>, unknown>>;
258
+ connection: z.ZodObject<{
259
+ stdio: z.ZodOptional<z.ZodObject<{
260
+ command: z.ZodString;
261
+ args: z.ZodArray<z.ZodString>;
262
+ }, z.core.$strip>>;
263
+ http: z.ZodOptional<z.ZodObject<{
264
+ baseUrl: z.ZodString;
265
+ timeout: z.ZodDefault<z.ZodNumber>;
266
+ }, z.core.$strip>>;
267
+ ws: z.ZodOptional<z.ZodObject<{
268
+ url: z.ZodString;
269
+ timeout: z.ZodDefault<z.ZodNumber>;
270
+ batchSize: z.ZodDefault<z.ZodNumber>;
271
+ batchInterval: z.ZodDefault<z.ZodNumber>;
272
+ heartbeatInterval: z.ZodDefault<z.ZodNumber>;
273
+ }, z.core.$strip>>;
274
+ }, z.core.$strip>;
275
+ autoConnect: z.ZodDefault<z.ZodBoolean>;
276
+ priority: z.ZodDefault<z.ZodNumber>;
277
+ }, z.core.$strip>, z.ZodTransform<{
278
+ channel: "stdio" | "http" | "websocket";
279
+ id: string;
280
+ type: "custom" | "easbot";
281
+ connection: {
282
+ stdio?: {
283
+ command: string;
284
+ args: string[];
285
+ } | undefined;
286
+ http?: {
287
+ baseUrl: string;
288
+ timeout: number;
289
+ } | undefined;
290
+ ws?: {
291
+ url: string;
292
+ timeout: number;
293
+ batchSize: number;
294
+ batchInterval: number;
295
+ heartbeatInterval: number;
296
+ } | undefined;
297
+ };
298
+ autoConnect: boolean;
299
+ priority: number;
300
+ name?: string | undefined;
301
+ agentId?: string | undefined;
302
+ }, {
303
+ id: string;
304
+ type: "custom" | "easbot";
305
+ connection: {
306
+ stdio?: {
307
+ command: string;
308
+ args: string[];
309
+ } | undefined;
310
+ http?: {
311
+ baseUrl: string;
312
+ timeout: number;
313
+ } | undefined;
314
+ ws?: {
315
+ url: string;
316
+ timeout: number;
317
+ batchSize: number;
318
+ batchInterval: number;
319
+ heartbeatInterval: number;
320
+ } | undefined;
321
+ };
322
+ autoConnect: boolean;
323
+ priority: number;
324
+ name?: string | undefined;
325
+ agentId?: string | undefined;
326
+ channel?: "stdio" | "http" | "websocket" | undefined;
327
+ }>>>;
328
+ defaultClientId: z.ZodOptional<z.ZodString>;
329
+ }, z.core.$strip>;
330
+ declare const ACPInfoACPConfigSchema: z.ZodObject<{
331
+ server: z.ZodOptional<z.ZodPipe<z.ZodObject<{
332
+ directory: z.ZodDefault<z.ZodString>;
333
+ enabled: z.ZodDefault<z.ZodBoolean>;
334
+ channel: z.ZodDefault<z.ZodPreprocess<z.ZodEnum<{
335
+ stdio: "stdio";
336
+ http: "http";
337
+ websocket: "websocket";
338
+ }>, unknown>>;
339
+ port: z.ZodDefault<z.ZodNumber>;
340
+ hostname: z.ZodDefault<z.ZodCustomStringFormat<"hostname">>;
341
+ timeout: z.ZodDefault<z.ZodNumber>;
342
+ name: z.ZodOptional<z.ZodString>;
343
+ agentId: z.ZodOptional<z.ZodString>;
344
+ stdio: z.ZodOptional<z.ZodObject<{
345
+ command: z.ZodString;
346
+ args: z.ZodArray<z.ZodString>;
347
+ }, z.core.$strip>>;
348
+ http: z.ZodOptional<z.ZodObject<{
349
+ baseUrl: z.ZodString;
350
+ timeout: z.ZodDefault<z.ZodNumber>;
351
+ }, z.core.$strip>>;
352
+ ws: z.ZodOptional<z.ZodObject<{
353
+ url: z.ZodString;
354
+ timeout: z.ZodDefault<z.ZodNumber>;
355
+ batchSize: z.ZodDefault<z.ZodNumber>;
356
+ batchInterval: z.ZodDefault<z.ZodNumber>;
357
+ heartbeatInterval: z.ZodDefault<z.ZodNumber>;
358
+ }, z.core.$strip>>;
359
+ agent: z.ZodOptional<z.ZodObject<{
360
+ agent: z.ZodOptional<z.ZodString>;
361
+ model: z.ZodOptional<z.ZodObject<{
362
+ id: z.ZodString;
363
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>>;
366
+ }, z.core.$strip>, z.ZodTransform<{
367
+ channel: "stdio" | "http" | "websocket";
368
+ directory: string;
369
+ enabled: boolean;
370
+ port: number;
371
+ hostname: string;
372
+ timeout: number;
373
+ name?: string | undefined;
374
+ agentId?: string | undefined;
375
+ stdio?: {
376
+ command: string;
377
+ args: string[];
378
+ } | undefined;
379
+ http?: {
380
+ baseUrl: string;
381
+ timeout: number;
382
+ } | undefined;
383
+ ws?: {
384
+ url: string;
385
+ timeout: number;
386
+ batchSize: number;
387
+ batchInterval: number;
388
+ heartbeatInterval: number;
389
+ } | undefined;
390
+ agent?: {
391
+ agent?: string | undefined;
392
+ model?: {
393
+ id: string;
394
+ options?: Record<string, unknown> | undefined;
395
+ } | undefined;
396
+ } | undefined;
397
+ }, {
398
+ directory: string;
399
+ enabled: boolean;
400
+ channel: "stdio" | "http" | "websocket";
401
+ port: number;
402
+ hostname: string;
403
+ timeout: number;
404
+ name?: string | undefined;
405
+ agentId?: string | undefined;
406
+ stdio?: {
407
+ command: string;
408
+ args: string[];
409
+ } | undefined;
410
+ http?: {
411
+ baseUrl: string;
412
+ timeout: number;
413
+ } | undefined;
414
+ ws?: {
415
+ url: string;
416
+ timeout: number;
417
+ batchSize: number;
418
+ batchInterval: number;
419
+ heartbeatInterval: number;
420
+ } | undefined;
421
+ agent?: {
422
+ agent?: string | undefined;
423
+ model?: {
424
+ id: string;
425
+ options?: Record<string, unknown> | undefined;
426
+ } | undefined;
427
+ } | undefined;
428
+ }>>>;
429
+ clients: z.ZodOptional<z.ZodObject<{
430
+ clients: z.ZodArray<z.ZodPipe<z.ZodObject<{
431
+ id: z.ZodString;
432
+ type: z.ZodEnum<{
433
+ custom: "custom";
434
+ easbot: "easbot";
435
+ }>;
436
+ name: z.ZodOptional<z.ZodString>;
437
+ agentId: z.ZodOptional<z.ZodString>;
438
+ channel: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
439
+ stdio: "stdio";
440
+ http: "http";
441
+ websocket: "websocket";
442
+ }>, unknown>>;
443
+ connection: z.ZodObject<{
444
+ stdio: z.ZodOptional<z.ZodObject<{
445
+ command: z.ZodString;
446
+ args: z.ZodArray<z.ZodString>;
447
+ }, z.core.$strip>>;
448
+ http: z.ZodOptional<z.ZodObject<{
449
+ baseUrl: z.ZodString;
450
+ timeout: z.ZodDefault<z.ZodNumber>;
451
+ }, z.core.$strip>>;
452
+ ws: z.ZodOptional<z.ZodObject<{
453
+ url: z.ZodString;
454
+ timeout: z.ZodDefault<z.ZodNumber>;
455
+ batchSize: z.ZodDefault<z.ZodNumber>;
456
+ batchInterval: z.ZodDefault<z.ZodNumber>;
457
+ heartbeatInterval: z.ZodDefault<z.ZodNumber>;
458
+ }, z.core.$strip>>;
459
+ }, z.core.$strip>;
460
+ autoConnect: z.ZodDefault<z.ZodBoolean>;
461
+ priority: z.ZodDefault<z.ZodNumber>;
462
+ }, z.core.$strip>, z.ZodTransform<{
463
+ channel: "stdio" | "http" | "websocket";
464
+ id: string;
465
+ type: "custom" | "easbot";
466
+ connection: {
467
+ stdio?: {
468
+ command: string;
469
+ args: string[];
470
+ } | undefined;
471
+ http?: {
472
+ baseUrl: string;
473
+ timeout: number;
474
+ } | undefined;
475
+ ws?: {
476
+ url: string;
477
+ timeout: number;
478
+ batchSize: number;
479
+ batchInterval: number;
480
+ heartbeatInterval: number;
481
+ } | undefined;
482
+ };
483
+ autoConnect: boolean;
484
+ priority: number;
485
+ name?: string | undefined;
486
+ agentId?: string | undefined;
487
+ }, {
488
+ id: string;
489
+ type: "custom" | "easbot";
490
+ connection: {
491
+ stdio?: {
492
+ command: string;
493
+ args: string[];
494
+ } | undefined;
495
+ http?: {
496
+ baseUrl: string;
497
+ timeout: number;
498
+ } | undefined;
499
+ ws?: {
500
+ url: string;
501
+ timeout: number;
502
+ batchSize: number;
503
+ batchInterval: number;
504
+ heartbeatInterval: number;
505
+ } | undefined;
506
+ };
507
+ autoConnect: boolean;
508
+ priority: number;
509
+ name?: string | undefined;
510
+ agentId?: string | undefined;
511
+ channel?: "stdio" | "http" | "websocket" | undefined;
512
+ }>>>;
513
+ defaultClientId: z.ZodOptional<z.ZodString>;
514
+ }, z.core.$strip>>;
515
+ client: z.ZodOptional<z.ZodObject<{
516
+ autoRegister: z.ZodDefault<z.ZodBoolean>;
517
+ gatewayUrl: z.ZodOptional<z.ZodURL>;
518
+ }, z.core.$strip>>;
519
+ }, z.core.$strip>;
520
+
521
+ declare function ACPValidateConfig(config: unknown): ACPInfoACPConfig;
522
+ declare function ACPParsePartialConfig(partial: unknown): ACPInfoACPConfig;
523
+
63
524
  interface AcpConfigStateResult {
64
525
  config: ACPInfoACPConfig;
526
+ cachedConfig: ACPInfoACPConfig | null;
65
527
  directories: string[];
66
528
  }
67
529
  declare function loadConfig(): Promise<ACPInfoACPConfig>;
68
530
  declare function getConfig(): ACPInfoACPConfig | null;
69
531
  declare function isConfigLoaded(): boolean;
70
532
  declare function clearConfigCache(): void;
71
- declare function getConfigDirectory(): string;
72
533
  declare function reloadConfig(): Promise<ACPInfoACPConfig>;
534
+ declare function getConfigDirectory(): string;
73
535
  declare function getServerConfig(): Promise<ACPServerConfig$1>;
74
536
  declare function getClientsConfig(): Promise<ACPClientsConfig>;
75
537
  declare function getClientById(clientId: string): Promise<ACPClientConfig | undefined>;
@@ -84,7 +546,7 @@ type StateResult = {
84
546
  };
85
547
  declare namespace AcpCache {
86
548
  function state(): Promise<StateResult>;
87
- function resetState(): void;
549
+ function resetState(writtenPath?: string): void;
88
550
  function init(): Promise<void>;
89
551
  function getAcpJson(): Promise<Record<string, unknown> | undefined>;
90
552
  function exists(): Promise<boolean>;
@@ -101,17 +563,18 @@ declare namespace AcpError {
101
563
  path: string;
102
564
  }, options?: ErrorOptions): {
103
565
  readonly name: "AcpConfigNotFoundError";
566
+ readonly message: string;
104
567
  readonly data: {
105
568
  message: string;
106
569
  path: string;
107
570
  };
108
- schema(): z.ZodObject<{
109
- name: z.ZodLiteral<"AcpConfigNotFoundError">;
110
- data: z.ZodObject<{
111
- message: z.ZodString;
112
- path: z.ZodString;
113
- }, z.core.$strip>;
114
- }, z.core.$strip>;
571
+ schema(): z$1.ZodObject<{
572
+ name: z$1.ZodLiteral<"AcpConfigNotFoundError">;
573
+ data: z$1.ZodObject<{
574
+ message: z$1.ZodString;
575
+ path: z$1.ZodString;
576
+ }, z$1.core.$strip>;
577
+ }, z$1.core.$strip>;
115
578
  toObject(): {
116
579
  name: "AcpConfigNotFoundError";
117
580
  data: {
@@ -119,71 +582,70 @@ declare namespace AcpError {
119
582
  path: string;
120
583
  };
121
584
  };
122
- message: string;
123
585
  stack?: string;
124
586
  cause?: unknown;
125
587
  };
126
- readonly Schema: z.ZodObject<{
127
- name: z.ZodLiteral<"AcpConfigNotFoundError">;
128
- data: z.ZodObject<{
129
- message: z.ZodString;
130
- path: z.ZodString;
131
- }, z.core.$strip>;
132
- }, z.core.$strip>;
588
+ readonly Schema: z$1.ZodObject<{
589
+ name: z$1.ZodLiteral<"AcpConfigNotFoundError">;
590
+ data: z$1.ZodObject<{
591
+ message: z$1.ZodString;
592
+ path: z$1.ZodString;
593
+ }, z$1.core.$strip>;
594
+ }, z$1.core.$strip>;
133
595
  isInstance(input: any): input is InstanceType<any>;
134
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
596
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
135
597
  readonly Unknown: {
136
598
  new (data: {
137
599
  message: string;
138
600
  }, options?: ErrorOptions): {
139
601
  readonly name: "UnknownError";
602
+ readonly message: string;
140
603
  readonly data: {
141
604
  message: string;
142
605
  };
143
- schema(): z.ZodObject<{
144
- name: z.ZodLiteral<"UnknownError">;
145
- data: z.ZodObject<{
146
- message: z.ZodString;
147
- }, z.core.$strip>;
148
- }, z.core.$strip>;
606
+ schema(): z$1.ZodObject<{
607
+ name: z$1.ZodLiteral<"UnknownError">;
608
+ data: z$1.ZodObject<{
609
+ message: z$1.ZodString;
610
+ }, z$1.core.$strip>;
611
+ }, z$1.core.$strip>;
149
612
  toObject(): {
150
613
  name: "UnknownError";
151
614
  data: {
152
615
  message: string;
153
616
  };
154
617
  };
155
- message: string;
156
618
  stack?: string;
157
619
  cause?: unknown;
158
620
  };
159
- readonly Schema: z.ZodObject<{
160
- name: z.ZodLiteral<"UnknownError">;
161
- data: z.ZodObject<{
162
- message: z.ZodString;
163
- }, z.core.$strip>;
164
- }, z.core.$strip>;
621
+ readonly Schema: z$1.ZodObject<{
622
+ name: z$1.ZodLiteral<"UnknownError">;
623
+ data: z$1.ZodObject<{
624
+ message: z$1.ZodString;
625
+ }, z$1.core.$strip>;
626
+ }, z$1.core.$strip>;
165
627
  isInstance(input: any): input is {
166
628
  readonly name: "UnknownError";
629
+ readonly message: string;
167
630
  readonly data: {
168
631
  message: string;
169
632
  };
170
- schema(): z.ZodObject<{
171
- name: z.ZodLiteral<"UnknownError">;
172
- data: z.ZodObject<{
173
- message: z.ZodString;
174
- }, z.core.$strip>;
175
- }, z.core.$strip>;
633
+ schema(): z$1.ZodObject<{
634
+ name: z$1.ZodLiteral<"UnknownError">;
635
+ data: z$1.ZodObject<{
636
+ message: z$1.ZodString;
637
+ }, z$1.core.$strip>;
638
+ }, z$1.core.$strip>;
176
639
  toObject(): {
177
640
  name: "UnknownError";
178
641
  data: {
179
642
  message: string;
180
643
  };
181
644
  };
182
- message: string;
183
645
  stack?: string;
184
646
  cause?: unknown;
185
647
  };
186
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
648
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
187
649
  readonly Unknown: any;
188
650
  isError(error: unknown): error is Error;
189
651
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
@@ -201,17 +663,18 @@ declare namespace AcpError {
201
663
  path?: string | undefined;
202
664
  }, options?: ErrorOptions): {
203
665
  readonly name: "AcpConfigValidationError";
666
+ readonly message: string;
204
667
  readonly data: {
205
668
  message: string;
206
669
  path?: string | undefined;
207
670
  };
208
- schema(): z.ZodObject<{
209
- name: z.ZodLiteral<"AcpConfigValidationError">;
210
- data: z.ZodObject<{
211
- message: z.ZodString;
212
- path: z.ZodOptional<z.ZodString>;
213
- }, z.core.$strip>;
214
- }, z.core.$strip>;
671
+ schema(): z$1.ZodObject<{
672
+ name: z$1.ZodLiteral<"AcpConfigValidationError">;
673
+ data: z$1.ZodObject<{
674
+ message: z$1.ZodString;
675
+ path: z$1.ZodOptional<z$1.ZodString>;
676
+ }, z$1.core.$strip>;
677
+ }, z$1.core.$strip>;
215
678
  toObject(): {
216
679
  name: "AcpConfigValidationError";
217
680
  data: {
@@ -219,71 +682,70 @@ declare namespace AcpError {
219
682
  path?: string | undefined;
220
683
  };
221
684
  };
222
- message: string;
223
685
  stack?: string;
224
686
  cause?: unknown;
225
687
  };
226
- readonly Schema: z.ZodObject<{
227
- name: z.ZodLiteral<"AcpConfigValidationError">;
228
- data: z.ZodObject<{
229
- message: z.ZodString;
230
- path: z.ZodOptional<z.ZodString>;
231
- }, z.core.$strip>;
232
- }, z.core.$strip>;
688
+ readonly Schema: z$1.ZodObject<{
689
+ name: z$1.ZodLiteral<"AcpConfigValidationError">;
690
+ data: z$1.ZodObject<{
691
+ message: z$1.ZodString;
692
+ path: z$1.ZodOptional<z$1.ZodString>;
693
+ }, z$1.core.$strip>;
694
+ }, z$1.core.$strip>;
233
695
  isInstance(input: any): input is InstanceType<any>;
234
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
696
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
235
697
  readonly Unknown: {
236
698
  new (data: {
237
699
  message: string;
238
700
  }, options?: ErrorOptions): {
239
701
  readonly name: "UnknownError";
702
+ readonly message: string;
240
703
  readonly data: {
241
704
  message: string;
242
705
  };
243
- schema(): z.ZodObject<{
244
- name: z.ZodLiteral<"UnknownError">;
245
- data: z.ZodObject<{
246
- message: z.ZodString;
247
- }, z.core.$strip>;
248
- }, z.core.$strip>;
706
+ schema(): z$1.ZodObject<{
707
+ name: z$1.ZodLiteral<"UnknownError">;
708
+ data: z$1.ZodObject<{
709
+ message: z$1.ZodString;
710
+ }, z$1.core.$strip>;
711
+ }, z$1.core.$strip>;
249
712
  toObject(): {
250
713
  name: "UnknownError";
251
714
  data: {
252
715
  message: string;
253
716
  };
254
717
  };
255
- message: string;
256
718
  stack?: string;
257
719
  cause?: unknown;
258
720
  };
259
- readonly Schema: z.ZodObject<{
260
- name: z.ZodLiteral<"UnknownError">;
261
- data: z.ZodObject<{
262
- message: z.ZodString;
263
- }, z.core.$strip>;
264
- }, z.core.$strip>;
721
+ readonly Schema: z$1.ZodObject<{
722
+ name: z$1.ZodLiteral<"UnknownError">;
723
+ data: z$1.ZodObject<{
724
+ message: z$1.ZodString;
725
+ }, z$1.core.$strip>;
726
+ }, z$1.core.$strip>;
265
727
  isInstance(input: any): input is {
266
728
  readonly name: "UnknownError";
729
+ readonly message: string;
267
730
  readonly data: {
268
731
  message: string;
269
732
  };
270
- schema(): z.ZodObject<{
271
- name: z.ZodLiteral<"UnknownError">;
272
- data: z.ZodObject<{
273
- message: z.ZodString;
274
- }, z.core.$strip>;
275
- }, z.core.$strip>;
733
+ schema(): z$1.ZodObject<{
734
+ name: z$1.ZodLiteral<"UnknownError">;
735
+ data: z$1.ZodObject<{
736
+ message: z$1.ZodString;
737
+ }, z$1.core.$strip>;
738
+ }, z$1.core.$strip>;
276
739
  toObject(): {
277
740
  name: "UnknownError";
278
741
  data: {
279
742
  message: string;
280
743
  };
281
744
  };
282
- message: string;
283
745
  stack?: string;
284
746
  cause?: unknown;
285
747
  };
286
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
748
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
287
749
  readonly Unknown: any;
288
750
  isError(error: unknown): error is Error;
289
751
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
@@ -303,21 +765,22 @@ declare namespace AcpError {
303
765
  code?: string | undefined;
304
766
  }, options?: ErrorOptions): {
305
767
  readonly name: "AcpServerStartFailedError";
768
+ readonly message: string;
306
769
  readonly data: {
307
770
  message: string;
308
771
  channel?: string | undefined;
309
772
  port?: number | undefined;
310
773
  code?: string | undefined;
311
774
  };
312
- schema(): z.ZodObject<{
313
- name: z.ZodLiteral<"AcpServerStartFailedError">;
314
- data: z.ZodObject<{
315
- message: z.ZodString;
316
- channel: z.ZodOptional<z.ZodString>;
317
- port: z.ZodOptional<z.ZodNumber>;
318
- code: z.ZodOptional<z.ZodString>;
319
- }, z.core.$strip>;
320
- }, z.core.$strip>;
775
+ schema(): z$1.ZodObject<{
776
+ name: z$1.ZodLiteral<"AcpServerStartFailedError">;
777
+ data: z$1.ZodObject<{
778
+ message: z$1.ZodString;
779
+ channel: z$1.ZodOptional<z$1.ZodString>;
780
+ port: z$1.ZodOptional<z$1.ZodNumber>;
781
+ code: z$1.ZodOptional<z$1.ZodString>;
782
+ }, z$1.core.$strip>;
783
+ }, z$1.core.$strip>;
321
784
  toObject(): {
322
785
  name: "AcpServerStartFailedError";
323
786
  data: {
@@ -327,73 +790,72 @@ declare namespace AcpError {
327
790
  code?: string | undefined;
328
791
  };
329
792
  };
330
- message: string;
331
793
  stack?: string;
332
794
  cause?: unknown;
333
795
  };
334
- readonly Schema: z.ZodObject<{
335
- name: z.ZodLiteral<"AcpServerStartFailedError">;
336
- data: z.ZodObject<{
337
- message: z.ZodString;
338
- channel: z.ZodOptional<z.ZodString>;
339
- port: z.ZodOptional<z.ZodNumber>;
340
- code: z.ZodOptional<z.ZodString>;
341
- }, z.core.$strip>;
342
- }, z.core.$strip>;
796
+ readonly Schema: z$1.ZodObject<{
797
+ name: z$1.ZodLiteral<"AcpServerStartFailedError">;
798
+ data: z$1.ZodObject<{
799
+ message: z$1.ZodString;
800
+ channel: z$1.ZodOptional<z$1.ZodString>;
801
+ port: z$1.ZodOptional<z$1.ZodNumber>;
802
+ code: z$1.ZodOptional<z$1.ZodString>;
803
+ }, z$1.core.$strip>;
804
+ }, z$1.core.$strip>;
343
805
  isInstance(input: any): input is InstanceType<any>;
344
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
806
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
345
807
  readonly Unknown: {
346
808
  new (data: {
347
809
  message: string;
348
810
  }, options?: ErrorOptions): {
349
811
  readonly name: "UnknownError";
812
+ readonly message: string;
350
813
  readonly data: {
351
814
  message: string;
352
815
  };
353
- schema(): z.ZodObject<{
354
- name: z.ZodLiteral<"UnknownError">;
355
- data: z.ZodObject<{
356
- message: z.ZodString;
357
- }, z.core.$strip>;
358
- }, z.core.$strip>;
816
+ schema(): z$1.ZodObject<{
817
+ name: z$1.ZodLiteral<"UnknownError">;
818
+ data: z$1.ZodObject<{
819
+ message: z$1.ZodString;
820
+ }, z$1.core.$strip>;
821
+ }, z$1.core.$strip>;
359
822
  toObject(): {
360
823
  name: "UnknownError";
361
824
  data: {
362
825
  message: string;
363
826
  };
364
827
  };
365
- message: string;
366
828
  stack?: string;
367
829
  cause?: unknown;
368
830
  };
369
- readonly Schema: z.ZodObject<{
370
- name: z.ZodLiteral<"UnknownError">;
371
- data: z.ZodObject<{
372
- message: z.ZodString;
373
- }, z.core.$strip>;
374
- }, z.core.$strip>;
831
+ readonly Schema: z$1.ZodObject<{
832
+ name: z$1.ZodLiteral<"UnknownError">;
833
+ data: z$1.ZodObject<{
834
+ message: z$1.ZodString;
835
+ }, z$1.core.$strip>;
836
+ }, z$1.core.$strip>;
375
837
  isInstance(input: any): input is {
376
838
  readonly name: "UnknownError";
839
+ readonly message: string;
377
840
  readonly data: {
378
841
  message: string;
379
842
  };
380
- schema(): z.ZodObject<{
381
- name: z.ZodLiteral<"UnknownError">;
382
- data: z.ZodObject<{
383
- message: z.ZodString;
384
- }, z.core.$strip>;
385
- }, z.core.$strip>;
843
+ schema(): z$1.ZodObject<{
844
+ name: z$1.ZodLiteral<"UnknownError">;
845
+ data: z$1.ZodObject<{
846
+ message: z$1.ZodString;
847
+ }, z$1.core.$strip>;
848
+ }, z$1.core.$strip>;
386
849
  toObject(): {
387
850
  name: "UnknownError";
388
851
  data: {
389
852
  message: string;
390
853
  };
391
854
  };
392
- message: string;
393
855
  stack?: string;
394
856
  cause?: unknown;
395
857
  };
396
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
858
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
397
859
  readonly Unknown: any;
398
860
  isError(error: unknown): error is Error;
399
861
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
@@ -413,21 +875,22 @@ declare namespace AcpError {
413
875
  code?: string | undefined;
414
876
  }, options?: ErrorOptions): {
415
877
  readonly name: "AcpClientConnectionFailedError";
878
+ readonly message: string;
416
879
  readonly data: {
417
880
  message: string;
418
881
  clientId?: string | undefined;
419
882
  channel?: string | undefined;
420
883
  code?: string | undefined;
421
884
  };
422
- schema(): z.ZodObject<{
423
- name: z.ZodLiteral<"AcpClientConnectionFailedError">;
424
- data: z.ZodObject<{
425
- message: z.ZodString;
426
- clientId: z.ZodOptional<z.ZodString>;
427
- channel: z.ZodOptional<z.ZodString>;
428
- code: z.ZodOptional<z.ZodString>;
429
- }, z.core.$strip>;
430
- }, z.core.$strip>;
885
+ schema(): z$1.ZodObject<{
886
+ name: z$1.ZodLiteral<"AcpClientConnectionFailedError">;
887
+ data: z$1.ZodObject<{
888
+ message: z$1.ZodString;
889
+ clientId: z$1.ZodOptional<z$1.ZodString>;
890
+ channel: z$1.ZodOptional<z$1.ZodString>;
891
+ code: z$1.ZodOptional<z$1.ZodString>;
892
+ }, z$1.core.$strip>;
893
+ }, z$1.core.$strip>;
431
894
  toObject(): {
432
895
  name: "AcpClientConnectionFailedError";
433
896
  data: {
@@ -437,73 +900,72 @@ declare namespace AcpError {
437
900
  code?: string | undefined;
438
901
  };
439
902
  };
440
- message: string;
441
903
  stack?: string;
442
904
  cause?: unknown;
443
905
  };
444
- readonly Schema: z.ZodObject<{
445
- name: z.ZodLiteral<"AcpClientConnectionFailedError">;
446
- data: z.ZodObject<{
447
- message: z.ZodString;
448
- clientId: z.ZodOptional<z.ZodString>;
449
- channel: z.ZodOptional<z.ZodString>;
450
- code: z.ZodOptional<z.ZodString>;
451
- }, z.core.$strip>;
452
- }, z.core.$strip>;
906
+ readonly Schema: z$1.ZodObject<{
907
+ name: z$1.ZodLiteral<"AcpClientConnectionFailedError">;
908
+ data: z$1.ZodObject<{
909
+ message: z$1.ZodString;
910
+ clientId: z$1.ZodOptional<z$1.ZodString>;
911
+ channel: z$1.ZodOptional<z$1.ZodString>;
912
+ code: z$1.ZodOptional<z$1.ZodString>;
913
+ }, z$1.core.$strip>;
914
+ }, z$1.core.$strip>;
453
915
  isInstance(input: any): input is InstanceType<any>;
454
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
916
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
455
917
  readonly Unknown: {
456
918
  new (data: {
457
919
  message: string;
458
920
  }, options?: ErrorOptions): {
459
921
  readonly name: "UnknownError";
922
+ readonly message: string;
460
923
  readonly data: {
461
924
  message: string;
462
925
  };
463
- schema(): z.ZodObject<{
464
- name: z.ZodLiteral<"UnknownError">;
465
- data: z.ZodObject<{
466
- message: z.ZodString;
467
- }, z.core.$strip>;
468
- }, z.core.$strip>;
926
+ schema(): z$1.ZodObject<{
927
+ name: z$1.ZodLiteral<"UnknownError">;
928
+ data: z$1.ZodObject<{
929
+ message: z$1.ZodString;
930
+ }, z$1.core.$strip>;
931
+ }, z$1.core.$strip>;
469
932
  toObject(): {
470
933
  name: "UnknownError";
471
934
  data: {
472
935
  message: string;
473
936
  };
474
937
  };
475
- message: string;
476
938
  stack?: string;
477
939
  cause?: unknown;
478
940
  };
479
- readonly Schema: z.ZodObject<{
480
- name: z.ZodLiteral<"UnknownError">;
481
- data: z.ZodObject<{
482
- message: z.ZodString;
483
- }, z.core.$strip>;
484
- }, z.core.$strip>;
941
+ readonly Schema: z$1.ZodObject<{
942
+ name: z$1.ZodLiteral<"UnknownError">;
943
+ data: z$1.ZodObject<{
944
+ message: z$1.ZodString;
945
+ }, z$1.core.$strip>;
946
+ }, z$1.core.$strip>;
485
947
  isInstance(input: any): input is {
486
948
  readonly name: "UnknownError";
949
+ readonly message: string;
487
950
  readonly data: {
488
951
  message: string;
489
952
  };
490
- schema(): z.ZodObject<{
491
- name: z.ZodLiteral<"UnknownError">;
492
- data: z.ZodObject<{
493
- message: z.ZodString;
494
- }, z.core.$strip>;
495
- }, z.core.$strip>;
953
+ schema(): z$1.ZodObject<{
954
+ name: z$1.ZodLiteral<"UnknownError">;
955
+ data: z$1.ZodObject<{
956
+ message: z$1.ZodString;
957
+ }, z$1.core.$strip>;
958
+ }, z$1.core.$strip>;
496
959
  toObject(): {
497
960
  name: "UnknownError";
498
961
  data: {
499
962
  message: string;
500
963
  };
501
964
  };
502
- message: string;
503
965
  stack?: string;
504
966
  cause?: unknown;
505
967
  };
506
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
968
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
507
969
  readonly Unknown: any;
508
970
  isError(error: unknown): error is Error;
509
971
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
@@ -522,19 +984,20 @@ declare namespace AcpError {
522
984
  method?: string | undefined;
523
985
  }, options?: ErrorOptions): {
524
986
  readonly name: "AcpRpcParseFailedError";
987
+ readonly message: string;
525
988
  readonly data: {
526
989
  message: string;
527
990
  frame?: string | undefined;
528
991
  method?: string | undefined;
529
992
  };
530
- schema(): z.ZodObject<{
531
- name: z.ZodLiteral<"AcpRpcParseFailedError">;
532
- data: z.ZodObject<{
533
- message: z.ZodString;
534
- frame: z.ZodOptional<z.ZodString>;
535
- method: z.ZodOptional<z.ZodString>;
536
- }, z.core.$strip>;
537
- }, z.core.$strip>;
993
+ schema(): z$1.ZodObject<{
994
+ name: z$1.ZodLiteral<"AcpRpcParseFailedError">;
995
+ data: z$1.ZodObject<{
996
+ message: z$1.ZodString;
997
+ frame: z$1.ZodOptional<z$1.ZodString>;
998
+ method: z$1.ZodOptional<z$1.ZodString>;
999
+ }, z$1.core.$strip>;
1000
+ }, z$1.core.$strip>;
538
1001
  toObject(): {
539
1002
  name: "AcpRpcParseFailedError";
540
1003
  data: {
@@ -543,72 +1006,388 @@ declare namespace AcpError {
543
1006
  method?: string | undefined;
544
1007
  };
545
1008
  };
1009
+ stack?: string;
1010
+ cause?: unknown;
1011
+ };
1012
+ readonly Schema: z$1.ZodObject<{
1013
+ name: z$1.ZodLiteral<"AcpRpcParseFailedError">;
1014
+ data: z$1.ZodObject<{
1015
+ message: z$1.ZodString;
1016
+ frame: z$1.ZodOptional<z$1.ZodString>;
1017
+ method: z$1.ZodOptional<z$1.ZodString>;
1018
+ }, z$1.core.$strip>;
1019
+ }, z$1.core.$strip>;
1020
+ isInstance(input: any): input is InstanceType<any>;
1021
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1022
+ readonly Unknown: {
1023
+ new (data: {
1024
+ message: string;
1025
+ }, options?: ErrorOptions): {
1026
+ readonly name: "UnknownError";
1027
+ readonly message: string;
1028
+ readonly data: {
1029
+ message: string;
1030
+ };
1031
+ schema(): z$1.ZodObject<{
1032
+ name: z$1.ZodLiteral<"UnknownError">;
1033
+ data: z$1.ZodObject<{
1034
+ message: z$1.ZodString;
1035
+ }, z$1.core.$strip>;
1036
+ }, z$1.core.$strip>;
1037
+ toObject(): {
1038
+ name: "UnknownError";
1039
+ data: {
1040
+ message: string;
1041
+ };
1042
+ };
1043
+ stack?: string;
1044
+ cause?: unknown;
1045
+ };
1046
+ readonly Schema: z$1.ZodObject<{
1047
+ name: z$1.ZodLiteral<"UnknownError">;
1048
+ data: z$1.ZodObject<{
1049
+ message: z$1.ZodString;
1050
+ }, z$1.core.$strip>;
1051
+ }, z$1.core.$strip>;
1052
+ isInstance(input: any): input is {
1053
+ readonly name: "UnknownError";
1054
+ readonly message: string;
1055
+ readonly data: {
1056
+ message: string;
1057
+ };
1058
+ schema(): z$1.ZodObject<{
1059
+ name: z$1.ZodLiteral<"UnknownError">;
1060
+ data: z$1.ZodObject<{
1061
+ message: z$1.ZodString;
1062
+ }, z$1.core.$strip>;
1063
+ }, z$1.core.$strip>;
1064
+ toObject(): {
1065
+ name: "UnknownError";
1066
+ data: {
1067
+ message: string;
1068
+ };
1069
+ };
1070
+ stack?: string;
1071
+ cause?: unknown;
1072
+ };
1073
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1074
+ readonly Unknown: any;
1075
+ isError(error: unknown): error is Error;
1076
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1077
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1078
+ stackTraceLimit: number;
1079
+ };
1080
+ isError(error: unknown): error is Error;
1081
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1082
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1083
+ stackTraceLimit: number;
1084
+ };
1085
+ const ServiceModeConflictError: {
1086
+ new (data: {
546
1087
  message: string;
1088
+ conflictingModes: string[];
1089
+ }, options?: ErrorOptions): {
1090
+ readonly name: "AcpServiceModeConflictError";
1091
+ readonly message: string;
1092
+ readonly data: {
1093
+ message: string;
1094
+ conflictingModes: string[];
1095
+ };
1096
+ schema(): z$1.ZodObject<{
1097
+ name: z$1.ZodLiteral<"AcpServiceModeConflictError">;
1098
+ data: z$1.ZodObject<{
1099
+ message: z$1.ZodString;
1100
+ conflictingModes: z$1.ZodArray<z$1.ZodString>;
1101
+ }, z$1.core.$strip>;
1102
+ }, z$1.core.$strip>;
1103
+ toObject(): {
1104
+ name: "AcpServiceModeConflictError";
1105
+ data: {
1106
+ message: string;
1107
+ conflictingModes: string[];
1108
+ };
1109
+ };
547
1110
  stack?: string;
548
1111
  cause?: unknown;
549
1112
  };
550
- readonly Schema: z.ZodObject<{
551
- name: z.ZodLiteral<"AcpRpcParseFailedError">;
552
- data: z.ZodObject<{
553
- message: z.ZodString;
554
- frame: z.ZodOptional<z.ZodString>;
555
- method: z.ZodOptional<z.ZodString>;
556
- }, z.core.$strip>;
557
- }, z.core.$strip>;
1113
+ readonly Schema: z$1.ZodObject<{
1114
+ name: z$1.ZodLiteral<"AcpServiceModeConflictError">;
1115
+ data: z$1.ZodObject<{
1116
+ message: z$1.ZodString;
1117
+ conflictingModes: z$1.ZodArray<z$1.ZodString>;
1118
+ }, z$1.core.$strip>;
1119
+ }, z$1.core.$strip>;
558
1120
  isInstance(input: any): input is InstanceType<any>;
559
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1121
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
560
1122
  readonly Unknown: {
561
1123
  new (data: {
562
1124
  message: string;
563
1125
  }, options?: ErrorOptions): {
564
1126
  readonly name: "UnknownError";
1127
+ readonly message: string;
1128
+ readonly data: {
1129
+ message: string;
1130
+ };
1131
+ schema(): z$1.ZodObject<{
1132
+ name: z$1.ZodLiteral<"UnknownError">;
1133
+ data: z$1.ZodObject<{
1134
+ message: z$1.ZodString;
1135
+ }, z$1.core.$strip>;
1136
+ }, z$1.core.$strip>;
1137
+ toObject(): {
1138
+ name: "UnknownError";
1139
+ data: {
1140
+ message: string;
1141
+ };
1142
+ };
1143
+ stack?: string;
1144
+ cause?: unknown;
1145
+ };
1146
+ readonly Schema: z$1.ZodObject<{
1147
+ name: z$1.ZodLiteral<"UnknownError">;
1148
+ data: z$1.ZodObject<{
1149
+ message: z$1.ZodString;
1150
+ }, z$1.core.$strip>;
1151
+ }, z$1.core.$strip>;
1152
+ isInstance(input: any): input is {
1153
+ readonly name: "UnknownError";
1154
+ readonly message: string;
565
1155
  readonly data: {
566
1156
  message: string;
567
1157
  };
568
- schema(): z.ZodObject<{
569
- name: z.ZodLiteral<"UnknownError">;
570
- data: z.ZodObject<{
571
- message: z.ZodString;
572
- }, z.core.$strip>;
573
- }, z.core.$strip>;
1158
+ schema(): z$1.ZodObject<{
1159
+ name: z$1.ZodLiteral<"UnknownError">;
1160
+ data: z$1.ZodObject<{
1161
+ message: z$1.ZodString;
1162
+ }, z$1.core.$strip>;
1163
+ }, z$1.core.$strip>;
574
1164
  toObject(): {
575
1165
  name: "UnknownError";
576
1166
  data: {
577
1167
  message: string;
578
1168
  };
579
1169
  };
1170
+ stack?: string;
1171
+ cause?: unknown;
1172
+ };
1173
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1174
+ readonly Unknown: any;
1175
+ isError(error: unknown): error is Error;
1176
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1177
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1178
+ stackTraceLimit: number;
1179
+ };
1180
+ isError(error: unknown): error is Error;
1181
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1182
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1183
+ stackTraceLimit: number;
1184
+ };
1185
+ const RoutingError: {
1186
+ new (data: {
1187
+ message: string;
1188
+ code: string;
1189
+ context?: Record<string, unknown> | undefined;
1190
+ }, options?: ErrorOptions): {
1191
+ readonly name: "AcpRoutingError";
1192
+ readonly message: string;
1193
+ readonly data: {
1194
+ message: string;
1195
+ code: string;
1196
+ context?: Record<string, unknown> | undefined;
1197
+ };
1198
+ schema(): z$1.ZodObject<{
1199
+ name: z$1.ZodLiteral<"AcpRoutingError">;
1200
+ data: z$1.ZodObject<{
1201
+ message: z$1.ZodString;
1202
+ code: z$1.ZodString;
1203
+ context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1204
+ }, z$1.core.$strip>;
1205
+ }, z$1.core.$strip>;
1206
+ toObject(): {
1207
+ name: "AcpRoutingError";
1208
+ data: {
1209
+ message: string;
1210
+ code: string;
1211
+ context?: Record<string, unknown> | undefined;
1212
+ };
1213
+ };
1214
+ stack?: string;
1215
+ cause?: unknown;
1216
+ };
1217
+ readonly Schema: z$1.ZodObject<{
1218
+ name: z$1.ZodLiteral<"AcpRoutingError">;
1219
+ data: z$1.ZodObject<{
1220
+ message: z$1.ZodString;
1221
+ code: z$1.ZodString;
1222
+ context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1223
+ }, z$1.core.$strip>;
1224
+ }, z$1.core.$strip>;
1225
+ isInstance(input: any): input is InstanceType<any>;
1226
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1227
+ readonly Unknown: {
1228
+ new (data: {
580
1229
  message: string;
1230
+ }, options?: ErrorOptions): {
1231
+ readonly name: "UnknownError";
1232
+ readonly message: string;
1233
+ readonly data: {
1234
+ message: string;
1235
+ };
1236
+ schema(): z$1.ZodObject<{
1237
+ name: z$1.ZodLiteral<"UnknownError">;
1238
+ data: z$1.ZodObject<{
1239
+ message: z$1.ZodString;
1240
+ }, z$1.core.$strip>;
1241
+ }, z$1.core.$strip>;
1242
+ toObject(): {
1243
+ name: "UnknownError";
1244
+ data: {
1245
+ message: string;
1246
+ };
1247
+ };
581
1248
  stack?: string;
582
1249
  cause?: unknown;
583
1250
  };
584
- readonly Schema: z.ZodObject<{
585
- name: z.ZodLiteral<"UnknownError">;
586
- data: z.ZodObject<{
587
- message: z.ZodString;
588
- }, z.core.$strip>;
589
- }, z.core.$strip>;
1251
+ readonly Schema: z$1.ZodObject<{
1252
+ name: z$1.ZodLiteral<"UnknownError">;
1253
+ data: z$1.ZodObject<{
1254
+ message: z$1.ZodString;
1255
+ }, z$1.core.$strip>;
1256
+ }, z$1.core.$strip>;
590
1257
  isInstance(input: any): input is {
591
1258
  readonly name: "UnknownError";
1259
+ readonly message: string;
592
1260
  readonly data: {
593
1261
  message: string;
594
1262
  };
595
- schema(): z.ZodObject<{
596
- name: z.ZodLiteral<"UnknownError">;
597
- data: z.ZodObject<{
598
- message: z.ZodString;
599
- }, z.core.$strip>;
600
- }, z.core.$strip>;
1263
+ schema(): z$1.ZodObject<{
1264
+ name: z$1.ZodLiteral<"UnknownError">;
1265
+ data: z$1.ZodObject<{
1266
+ message: z$1.ZodString;
1267
+ }, z$1.core.$strip>;
1268
+ }, z$1.core.$strip>;
601
1269
  toObject(): {
602
1270
  name: "UnknownError";
603
1271
  data: {
604
1272
  message: string;
605
1273
  };
606
1274
  };
1275
+ stack?: string;
1276
+ cause?: unknown;
1277
+ };
1278
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1279
+ readonly Unknown: any;
1280
+ isError(error: unknown): error is Error;
1281
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1282
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1283
+ stackTraceLimit: number;
1284
+ };
1285
+ isError(error: unknown): error is Error;
1286
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1287
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1288
+ stackTraceLimit: number;
1289
+ };
1290
+ const AdapterEnvironmentInitializationError: {
1291
+ new (data: {
1292
+ message: string;
1293
+ stage: "log" | "global" | "models" | "handlers" | "instance";
1294
+ }, options?: ErrorOptions): {
1295
+ readonly name: "AcpAdapterEnvironmentInitializationError";
1296
+ readonly message: string;
1297
+ readonly data: {
1298
+ message: string;
1299
+ stage: "log" | "global" | "models" | "handlers" | "instance";
1300
+ };
1301
+ schema(): z$1.ZodObject<{
1302
+ name: z$1.ZodLiteral<"AcpAdapterEnvironmentInitializationError">;
1303
+ data: z$1.ZodObject<{
1304
+ message: z$1.ZodString;
1305
+ stage: z$1.ZodEnum<{
1306
+ log: "log";
1307
+ global: "global";
1308
+ models: "models";
1309
+ handlers: "handlers";
1310
+ instance: "instance";
1311
+ }>;
1312
+ }, z$1.core.$strip>;
1313
+ }, z$1.core.$strip>;
1314
+ toObject(): {
1315
+ name: "AcpAdapterEnvironmentInitializationError";
1316
+ data: {
1317
+ message: string;
1318
+ stage: "log" | "global" | "models" | "handlers" | "instance";
1319
+ };
1320
+ };
1321
+ stack?: string;
1322
+ cause?: unknown;
1323
+ };
1324
+ readonly Schema: z$1.ZodObject<{
1325
+ name: z$1.ZodLiteral<"AcpAdapterEnvironmentInitializationError">;
1326
+ data: z$1.ZodObject<{
1327
+ message: z$1.ZodString;
1328
+ stage: z$1.ZodEnum<{
1329
+ log: "log";
1330
+ global: "global";
1331
+ models: "models";
1332
+ handlers: "handlers";
1333
+ instance: "instance";
1334
+ }>;
1335
+ }, z$1.core.$strip>;
1336
+ }, z$1.core.$strip>;
1337
+ isInstance(input: any): input is InstanceType<any>;
1338
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1339
+ readonly Unknown: {
1340
+ new (data: {
607
1341
  message: string;
1342
+ }, options?: ErrorOptions): {
1343
+ readonly name: "UnknownError";
1344
+ readonly message: string;
1345
+ readonly data: {
1346
+ message: string;
1347
+ };
1348
+ schema(): z$1.ZodObject<{
1349
+ name: z$1.ZodLiteral<"UnknownError">;
1350
+ data: z$1.ZodObject<{
1351
+ message: z$1.ZodString;
1352
+ }, z$1.core.$strip>;
1353
+ }, z$1.core.$strip>;
1354
+ toObject(): {
1355
+ name: "UnknownError";
1356
+ data: {
1357
+ message: string;
1358
+ };
1359
+ };
1360
+ stack?: string;
1361
+ cause?: unknown;
1362
+ };
1363
+ readonly Schema: z$1.ZodObject<{
1364
+ name: z$1.ZodLiteral<"UnknownError">;
1365
+ data: z$1.ZodObject<{
1366
+ message: z$1.ZodString;
1367
+ }, z$1.core.$strip>;
1368
+ }, z$1.core.$strip>;
1369
+ isInstance(input: any): input is {
1370
+ readonly name: "UnknownError";
1371
+ readonly message: string;
1372
+ readonly data: {
1373
+ message: string;
1374
+ };
1375
+ schema(): z$1.ZodObject<{
1376
+ name: z$1.ZodLiteral<"UnknownError">;
1377
+ data: z$1.ZodObject<{
1378
+ message: z$1.ZodString;
1379
+ }, z$1.core.$strip>;
1380
+ }, z$1.core.$strip>;
1381
+ toObject(): {
1382
+ name: "UnknownError";
1383
+ data: {
1384
+ message: string;
1385
+ };
1386
+ };
608
1387
  stack?: string;
609
1388
  cause?: unknown;
610
1389
  };
611
- create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1390
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
612
1391
  readonly Unknown: any;
613
1392
  isError(error: unknown): error is Error;
614
1393
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
@@ -620,7 +1399,142 @@ declare namespace AcpError {
620
1399
  prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
621
1400
  stackTraceLimit: number;
622
1401
  };
1402
+ const AdapterError: {
1403
+ new (data: {
1404
+ message: string;
1405
+ type: string;
1406
+ context?: Record<string, unknown> | undefined;
1407
+ }, options?: ErrorOptions): {
1408
+ readonly name: "AcpAdapterError";
1409
+ readonly message: string;
1410
+ readonly data: {
1411
+ message: string;
1412
+ type: string;
1413
+ context?: Record<string, unknown> | undefined;
1414
+ };
1415
+ schema(): z$1.ZodObject<{
1416
+ name: z$1.ZodLiteral<"AcpAdapterError">;
1417
+ data: z$1.ZodObject<{
1418
+ message: z$1.ZodString;
1419
+ type: z$1.ZodString;
1420
+ context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1421
+ }, z$1.core.$strip>;
1422
+ }, z$1.core.$strip>;
1423
+ toObject(): {
1424
+ name: "AcpAdapterError";
1425
+ data: {
1426
+ message: string;
1427
+ type: string;
1428
+ context?: Record<string, unknown> | undefined;
1429
+ };
1430
+ };
1431
+ stack?: string;
1432
+ cause?: unknown;
1433
+ };
1434
+ readonly Schema: z$1.ZodObject<{
1435
+ name: z$1.ZodLiteral<"AcpAdapterError">;
1436
+ data: z$1.ZodObject<{
1437
+ message: z$1.ZodString;
1438
+ type: z$1.ZodString;
1439
+ context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1440
+ }, z$1.core.$strip>;
1441
+ }, z$1.core.$strip>;
1442
+ isInstance(input: any): input is InstanceType<any>;
1443
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1444
+ readonly Unknown: {
1445
+ new (data: {
1446
+ message: string;
1447
+ }, options?: ErrorOptions): {
1448
+ readonly name: "UnknownError";
1449
+ readonly message: string;
1450
+ readonly data: {
1451
+ message: string;
1452
+ };
1453
+ schema(): z$1.ZodObject<{
1454
+ name: z$1.ZodLiteral<"UnknownError">;
1455
+ data: z$1.ZodObject<{
1456
+ message: z$1.ZodString;
1457
+ }, z$1.core.$strip>;
1458
+ }, z$1.core.$strip>;
1459
+ toObject(): {
1460
+ name: "UnknownError";
1461
+ data: {
1462
+ message: string;
1463
+ };
1464
+ };
1465
+ stack?: string;
1466
+ cause?: unknown;
1467
+ };
1468
+ readonly Schema: z$1.ZodObject<{
1469
+ name: z$1.ZodLiteral<"UnknownError">;
1470
+ data: z$1.ZodObject<{
1471
+ message: z$1.ZodString;
1472
+ }, z$1.core.$strip>;
1473
+ }, z$1.core.$strip>;
1474
+ isInstance(input: any): input is {
1475
+ readonly name: "UnknownError";
1476
+ readonly message: string;
1477
+ readonly data: {
1478
+ message: string;
1479
+ };
1480
+ schema(): z$1.ZodObject<{
1481
+ name: z$1.ZodLiteral<"UnknownError">;
1482
+ data: z$1.ZodObject<{
1483
+ message: z$1.ZodString;
1484
+ }, z$1.core.$strip>;
1485
+ }, z$1.core.$strip>;
1486
+ toObject(): {
1487
+ name: "UnknownError";
1488
+ data: {
1489
+ message: string;
1490
+ };
1491
+ };
1492
+ stack?: string;
1493
+ cause?: unknown;
1494
+ };
1495
+ create<Name extends string, Data extends z$1.core.$ZodType>(name: Name, data: Data): any;
1496
+ readonly Unknown: any;
1497
+ isError(error: unknown): error is Error;
1498
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1499
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1500
+ stackTraceLimit: number;
1501
+ };
1502
+ isError(error: unknown): error is Error;
1503
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1504
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1505
+ stackTraceLimit: number;
1506
+ };
1507
+ }
1508
+ declare enum ErrorType {
1509
+ CHANNEL_ERROR = "channel_error",
1510
+ CHANNEL_TIMEOUT = "channel_timeout",
1511
+ CHANNEL_UNAVAILABLE = "channel_unavailable",
1512
+ NETWORK_ERROR = "network_error",
1513
+ CONNECTION_FAILED = "connection_failed",
1514
+ CONNECTION_TIMEOUT = "connection_timeout",
1515
+ ACP_ERROR = "acp_error",
1516
+ ACP_AUTH_FAILED = "acp_auth_failed",
1517
+ ACP_SESSION_NOT_FOUND = "acp_session_not_found",
1518
+ CONFIG_ERROR = "config_error",
1519
+ CONFIG_INVALID = "config_invalid",
1520
+ SYSTEM_ERROR = "system_error",
1521
+ INITIALIZATION_FAILED = "initialization_failed"
623
1522
  }
1523
+ type AdapterError = InstanceType<typeof AcpError.AdapterError>;
1524
+ declare function isAdapterError(err: unknown): err is AdapterError;
1525
+ type ServiceModeConflictError = InstanceType<typeof AcpError.ServiceModeConflictError>;
1526
+ declare function isServiceModeConflictError(err: unknown): err is ServiceModeConflictError;
1527
+ type RoutingError = InstanceType<typeof AcpError.RoutingError>;
1528
+ declare function isRoutingError(err: unknown): err is RoutingError;
1529
+ type AdapterEnvironmentInitializationError = InstanceType<typeof AcpError.AdapterEnvironmentInitializationError>;
1530
+ declare function isAdapterEnvironmentInitializationError(err: unknown): err is AdapterEnvironmentInitializationError;
1531
+ declare function isAdapterErrorRetryable(type: ErrorType): boolean;
1532
+ declare function isAdapterErrorFatal(type: ErrorType): boolean;
1533
+ declare function createAdapterError(type: ErrorType, message: string, context?: Record<string, unknown>, cause?: Error): AdapterError;
1534
+ declare function createChannelError(message: string, context?: Record<string, unknown>, cause?: Error): AdapterError;
1535
+ declare function createNetworkError(message: string, context?: Record<string, unknown>, cause?: Error): AdapterError;
1536
+ declare function createConfigError(message: string, context?: Record<string, unknown>): AdapterError;
1537
+ declare function createTimeoutError(message: string, timeout: number, context?: Record<string, unknown>): AdapterError;
624
1538
  declare const ACP_BUSINESS_CODES: ReadonlySet<string>;
625
1539
  declare const ACP_BUSINESS_HINTS: Readonly<Record<string, string>>;
626
1540
  declare function registerBusinessErrors(): Promise<void>;
@@ -655,155 +1569,35 @@ declare function getInstance(): IInstance;
655
1569
  declare function setEasbotClientAdapter(client: EasbotClient | null): Promise<void>;
656
1570
  declare function resetEasbotClientAdapter(): Promise<void>;
657
1571
  declare function getSdk(): Promise<EasbotClient>;
1572
+ interface GatewayUrlAdapter {
1573
+ url: string;
1574
+ autoRegister: boolean;
1575
+ }
1576
+ declare function setGatewayUrlAdapter(adapter: GatewayUrlAdapter | null): void;
1577
+ declare function resetGatewayUrlAdapter(): void;
1578
+ declare function getGatewayUrlAdapter(): GatewayUrlAdapter | null;
658
1579
  declare function getHomeDir(): string;
659
1580
  declare function getXdgData(): string;
660
1581
  declare function getWorktree(): string;
661
1582
  declare function getProjectDirectory(): string;
662
1583
 
663
- interface ConnectionState {
664
- localAgentId: string;
665
- remoteAgentId: string;
666
- connectionId: string;
667
- sessionId: string;
668
- localSessionId?: string;
669
- baseUrl: string;
670
- channel?: 'stdio' | 'http' | 'websocket';
671
- historyScope: 'session' | 'peer' | 'global';
672
- historyWindowSize?: number;
673
- sessionSequence?: string[];
674
- serviceGroup?: string;
675
- degradePolicy?: 'polling_only' | 'streaming_first';
676
- lastSeenMessageId?: string;
677
- updatedAt: number;
678
- status: 'active' | 'degraded' | 'closed';
679
- subscriber?: ACPSubscriber;
680
- availableCommands?: AvailableCommand[];
681
- configOptions?: SessionConfigOption[];
682
- currentModeId?: string;
683
- remoteSessionStatus?: 'idle' | 'busy' | 'retry';
684
- }
685
- interface ConnectionResult {
686
- connectionId: string;
687
- sessionId: string;
688
- localAgentId: string;
689
- remoteAgentId: string;
690
- baseUrl: string;
691
- }
692
- interface RoutingContext {
693
- connectionId?: string;
694
- localAgentId?: string;
695
- remoteAgentId?: string;
696
- baseUrl?: string;
697
- sessionId?: string;
698
- }
699
- interface RoutingResult {
700
- success: boolean;
701
- connectionId?: string;
702
- sessionId?: string;
703
- localAgentId?: string;
704
- remoteAgentId?: string;
705
- baseUrl?: string;
706
- error?: string;
707
- }
708
- interface HistoryContext {
709
- scope: 'session' | 'peer' | 'global';
710
- windowSize?: number;
711
- currentSessionId: string;
712
- remoteAgentId: string;
713
- tokenBudget?: number;
714
- }
715
- interface ComposedContext {
716
- messages: Array<{
717
- id: string;
718
- role: 'user' | 'assistant' | 'system';
719
- content: string;
720
- metadata?: Record<string, unknown>;
721
- }>;
722
- sourceSessions: string[];
723
- totalTokens: number;
724
- }
725
- interface DegradationInfo {
726
- mode: 'polling' | 'streaming';
727
- reason: string;
728
- timestamp: number;
729
- }
730
- interface ConnectionRegistryConfig {
731
- defaultHistoryScope?: 'session' | 'peer' | 'global';
732
- defaultHistoryWindowSize?: number;
733
- defaultDegradePolicy?: 'polling_only' | 'streaming_first';
734
- }
735
- interface InteractionContext {
736
- connectionId: string;
737
- localSessionId: string;
738
- baseUrl: string;
739
- remoteAgentId?: string;
740
- originalPrompt: string;
741
- currentRound: number;
742
- maxRounds: number;
743
- unsubscribe?: () => void;
744
- status: 'active' | 'completed' | 'error' | 'round_limit_exceeded';
745
- startedAt: number;
746
- updatedAt: number;
747
- error?: string;
748
- }
749
- interface InteractionConfig {
750
- maxRounds?: number;
751
- autoUnsubscribe?: boolean;
752
- }
753
- interface InteractionMessage {
754
- role: 'agent_interaction';
755
- initiation: {
756
- source: 'agent_tool_call';
757
- prompt: string;
758
- timestamp: number;
759
- };
760
- remoteAgent: {
761
- baseUrl: string;
762
- sessionId: string;
763
- agentId?: string;
764
- };
765
- response: {
766
- text: string;
767
- tools?: Array<{
768
- name: string;
769
- status: 'completed' | 'failed';
770
- output?: unknown;
771
- }>;
772
- metadata?: {
773
- messageId?: string;
774
- tokens?: {
775
- input: number;
776
- output: number;
777
- total: number;
778
- };
779
- };
780
- };
781
- interactionStatus: {
782
- currentRound: number;
783
- maxRounds: number;
784
- canContinue: boolean;
785
- remainingRounds: number;
786
- };
787
- continuationHint?: string;
788
- }
789
-
790
1584
  declare namespace ServerConnectionRegistry {
791
1585
  type Registry = ConnectionRegistry;
792
- function init(config?: ConnectionRegistryConfig): Promise<ConnectionRegistry>;
1586
+ function init(config?: ACPConnectionRegistryConfig): Promise<ConnectionRegistry>;
793
1587
  function connect(args: {
794
1588
  baseUrl: string;
795
1589
  localAgentId: string;
796
1590
  remoteAgentId: string;
797
1591
  remoteSessionId?: string;
798
1592
  localSessionId?: string;
799
- }): Promise<ConnectionResult>;
800
- function resolve(id: string): Promise<ConnectionState | undefined>;
801
- function resolveSync(id: string): ConnectionState | undefined;
1593
+ }): Promise<ACPConnectionResult>;
1594
+ function resolve(id: string): Promise<ACPConnectionState | undefined>;
1595
+ function resolveSync(id: string): ACPConnectionState | undefined;
802
1596
  function close(connectionId: string): Promise<void>;
803
1597
  function markDegraded(connectionId: string, reason: string): Promise<void>;
804
- function getConnectionsByLocalAgent(agentId: string): Promise<ConnectionState[]>;
805
- function getConnectionsByService(baseUrl: string): Promise<ConnectionState[]>;
806
- function getAllActiveConnections(): Promise<ConnectionState[]>;
1598
+ function getConnectionsByLocalAgent(agentId: string): Promise<ACPConnectionState[]>;
1599
+ function getConnectionsByService(baseUrl: string): Promise<ACPConnectionState[]>;
1600
+ function getAllActiveConnections(): Promise<ACPConnectionState[]>;
807
1601
  function updateLastSeenMessageId(connectionId: string, messageId: string): Promise<void>;
808
1602
  function updateSessionUpdates(connectionId: string, updates: {
809
1603
  availableCommands?: AvailableCommand[];
@@ -825,15 +1619,15 @@ declare namespace ServerConnectionRegistry {
825
1619
  private agentIndex;
826
1620
  private serviceIndex;
827
1621
  private connections;
828
- static create(config?: ConnectionRegistryConfig): ConnectionRegistry;
1622
+ static create(config?: ACPConnectionRegistryConfig): ConnectionRegistry;
829
1623
  private constructor();
830
- connect(baseUrl: string, localAgentId: string, remoteAgentId: string, remoteSessionId?: string, localSessionId?: string): ConnectionResult;
831
- resolve(id: string, createIfMissing?: boolean): ConnectionState | undefined;
1624
+ connect(baseUrl: string, localAgentId: string, remoteAgentId: string, remoteSessionId?: string, localSessionId?: string): ACPConnectionResult;
1625
+ resolve(id: string, createIfMissing?: boolean): ACPConnectionState | undefined;
832
1626
  closeConnection(connectionId: string): void;
833
1627
  markDegraded(connectionId: string, reason: string): void;
834
- getConnectionsByAgent(agentId: string): ConnectionState[];
835
- getConnectionsByService(baseUrl: string): ConnectionState[];
836
- getAllActiveConnections(): ConnectionState[];
1628
+ getConnectionsByAgent(agentId: string): ACPConnectionState[];
1629
+ getConnectionsByService(baseUrl: string): ACPConnectionState[];
1630
+ getAllActiveConnections(): ACPConnectionState[];
837
1631
  updateLastSeenMessageId(connectionId: string, messageId: string): void;
838
1632
  updateSessionUpdates(connectionId: string, updates: {
839
1633
  availableCommands?: AvailableCommand[];
@@ -855,34 +1649,30 @@ declare enum RoutingErrorCode {
855
1649
  CONNECTION_CLOSED = "CONNECTION_CLOSED",
856
1650
  MISSING_REQUIRED_PARAMS = "MISSING_REQUIRED_PARAMS"
857
1651
  }
858
- declare class RoutingError extends Error {
859
- readonly code: RoutingErrorCode;
860
- readonly context?: RoutingContext | undefined;
861
- constructor(code: RoutingErrorCode, message: string, context?: RoutingContext | undefined);
862
- }
1652
+ declare function createRoutingError(code: RoutingErrorCode, message: string, context?: ACPRoutingContext): RoutingError;
863
1653
  declare class SessionRouter {
864
1654
  static create(): SessionRouter;
865
1655
  protected constructor();
866
- route(context: RoutingContext): RoutingResult;
867
- routeOrThrow(context: RoutingContext): ConnectionState;
868
- registerConnection(state: ConnectionState): RoutingResult;
1656
+ route(context: ACPRoutingContext): ACPRoutingResult;
1657
+ routeOrThrow(context: ACPRoutingContext): ACPConnectionState;
1658
+ registerConnection(state: ACPConnectionState): ACPRoutingResult;
869
1659
  unregisterConnection(connectionId: string): boolean;
870
1660
  private isValidContext;
871
1661
  private routeByConnectionId;
872
1662
  private routeByPeerAndBaseUrl;
873
1663
  private routeByBaseUrlAndSessionId;
874
- protected getConnectionState(connectionId: string): ConnectionState | undefined;
875
- protected getConnectionsByPeer(agentId: string): ConnectionState[];
876
- protected getConnectionsByService(baseUrl: string): ConnectionState[];
1664
+ protected getConnectionState(connectionId: string): ACPConnectionState | undefined;
1665
+ protected getConnectionsByPeer(agentId: string): ACPConnectionState[];
1666
+ protected getConnectionsByService(baseUrl: string): ACPConnectionState[];
877
1667
  private getErrorCode;
878
1668
  }
879
1669
  declare class RegistrySessionRouter extends SessionRouter {
880
1670
  private readonly registry;
881
1671
  static fromRegistry(registry: RegistrySessionRouter['registry']): RegistrySessionRouter;
882
1672
  protected constructor(registry: RegistrySessionRouter['registry']);
883
- protected getConnectionState(connectionId: string): ConnectionState | undefined;
884
- protected getConnectionsByPeer(agentId: string): ConnectionState[];
885
- protected getConnectionsByService(baseUrl: string): ConnectionState[];
1673
+ protected getConnectionState(connectionId: string): ACPConnectionState | undefined;
1674
+ protected getConnectionsByPeer(agentId: string): ACPConnectionState[];
1675
+ protected getConnectionsByService(baseUrl: string): ACPConnectionState[];
886
1676
  }
887
1677
 
888
1678
  interface ACPConnection {
@@ -968,10 +1758,7 @@ interface AdapterSessionState {
968
1758
  cwd: string;
969
1759
  mcpServers: McpServer[];
970
1760
  createdAt: Date;
971
- model?: {
972
- providerId: string;
973
- modelId: string;
974
- };
1761
+ model?: ModelIdentifier;
975
1762
  variant?: string;
976
1763
  modeId?: string;
977
1764
  contextMode?: ContextMode;
@@ -986,8 +1773,8 @@ declare class AdapterSessionManager {
986
1773
  load(sessionId: string, cwd: string, mcpServers: McpServer[], model?: AdapterSessionState['model']): Promise<AdapterSessionState>;
987
1774
  get(sessionId: string): AdapterSessionState;
988
1775
  getModel(sessionId: string): {
989
- providerId: string;
990
1776
  modelId: string;
1777
+ providerId: string;
991
1778
  } | undefined;
992
1779
  setModel(sessionId: string, model: AdapterSessionState['model']): AdapterSessionState;
993
1780
  getVariant(sessionId: string): string | undefined;
@@ -997,7 +1784,7 @@ declare class AdapterSessionManager {
997
1784
  setAgent(sessionId: string, agent?: string): AdapterSessionState;
998
1785
  close(sessionId: string): boolean;
999
1786
  dispose(): void;
1000
- resolveConnectionState(sessionId: string): ConnectionState | undefined;
1787
+ resolveConnectionState(sessionId: string): ACPConnectionState | undefined;
1001
1788
  }
1002
1789
 
1003
1790
  interface ACPServiceConfig {
@@ -1078,9 +1865,9 @@ declare abstract class ACPService implements Agent {
1078
1865
 
1079
1866
  type ServiceMode = ChannelType;
1080
1867
  declare const ServiceMode: {
1081
- readonly HTTP: ChannelType.HTTP;
1082
- readonly STDIO: ChannelType.STDIO;
1083
- readonly WEBSOCKET: ChannelType.WS;
1868
+ readonly HTTP: "http";
1869
+ readonly STDIO: "stdio";
1870
+ readonly WEBSOCKET: "websocket";
1084
1871
  };
1085
1872
  type ServiceModeValue = (typeof ServiceMode)[keyof typeof ServiceMode];
1086
1873
  interface StdioChannelConfig {
@@ -1111,11 +1898,7 @@ interface ACPServerConfig {
1111
1898
  degradePolicy?: 'polling_only' | 'streaming_first';
1112
1899
  sessionExpireMs?: number;
1113
1900
  }
1114
- declare class ServiceModeConflictError extends Error {
1115
- readonly conflictingModes: ServiceMode[];
1116
- constructor(message: string, conflictingModes?: ServiceMode[]);
1117
- getConflictingModesDescription(): string;
1118
- }
1901
+ declare function createServiceModeConflictError(message: string, conflictingModes?: ServiceMode[]): ServiceModeConflictError;
1119
1902
 
1120
1903
  declare function loadACPServerConfig(config: Partial<ACPServerConfig>): ACPServerConfig;
1121
1904
  declare function loadConfigFromEnv(): Partial<ACPServerConfig>;
@@ -1131,6 +1914,16 @@ interface ACPServerInstance {
1131
1914
  declare function startACPServer(agent: EasBotAgent, config?: Partial<ACPServerConfig>): Promise<ACPServerInstance>;
1132
1915
  declare function createACPServerInstance(config: ACPServerConfig): ACPServerInstance;
1133
1916
 
1917
+ type AcpEndpointChannel = 'stdio' | 'http' | 'websocket';
1918
+ declare const ACP_STDIO_COMMAND = "easbot";
1919
+ interface AcpEndpointInput {
1920
+ channel: AcpEndpointChannel;
1921
+ hostname?: string;
1922
+ port?: number;
1923
+ command?: string;
1924
+ }
1925
+ declare function getAcpEndpointUrl(input: AcpEndpointInput): string | null;
1926
+
1134
1927
  declare function startHttpServer(agent: EasBotAgent, config: ACPServerConfig): Promise<{
1135
1928
  server: EasServer;
1136
1929
  stop: () => Promise<void>;
@@ -1147,6 +1940,7 @@ interface EventBroadcaster {
1147
1940
  declare class ServerAgentSideConnection implements ACPConnection {
1148
1941
  private broadcaster;
1149
1942
  private sessionIds;
1943
+ private sessionRefCounts;
1150
1944
  setBroadcaster(broadcaster: EventBroadcaster): void;
1151
1945
  addSession(sessionId: string): void;
1152
1946
  removeSession(sessionId: string): void;
@@ -1205,12 +1999,8 @@ interface AdapterBootstrapConfig {
1205
1999
  logLevel?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
1206
2000
  channel?: ChannelType;
1207
2001
  }
1208
- declare class AdapterEnvironmentInitializationError extends Error {
1209
- readonly type: 'AdapterEnvironmentInitializationError';
1210
- readonly stage: 'global' | 'log' | 'models' | 'handlers' | 'instance';
1211
- readonly cause?: Error;
1212
- constructor(message: string, stage: AdapterEnvironmentInitializationError['stage'], cause?: Error);
1213
- }
2002
+ type AdapterEnvInitStage = 'global' | 'log' | 'models' | 'handlers' | 'instance';
2003
+ declare function createAdapterEnvironmentInitializationError(message: string, stage: AdapterEnvInitStage, cause?: Error): AdapterEnvironmentInitializationError;
1214
2004
  declare namespace EasbotAdapter {
1215
2005
  function resetState(): void;
1216
2006
  function init(config?: AdapterBootstrapConfig): Promise<void>;
@@ -1244,4 +2034,9 @@ declare namespace EasbotAdapter {
1244
2034
  }
1245
2035
  declare const AdapterBootstrap: typeof EasbotAdapter;
1246
2036
 
1247
- export { type ACPServerInstance, ACP_BUSINESS_CODES, ACP_BUSINESS_HINTS, ACP_JSON_REL_PATH, AcpCache, type AcpCliDeps, type AcpCliResult, type AcpConfigStateResult, AcpError, AcpEventBridge, AdapterBootstrap, type AdapterBootstrapConfig, AdapterEnvironmentInitializationError, AgentStatus, COMMANDS_HELP, type CommandHelp, type ComposedContext, type ConnectionRegistryConfig, type ConnectionResult, type ConnectionState, type DegradationInfo, EasBotAgent, type EasBotAgentConfig, EasbotAdapter, type FormatLogOptions, type HistoryContext, I18n, type InteractionConfig, type InteractionContext, type InteractionMessage, LanguagesSupported, type Locale, NameErrors, RegistrySessionRouter, type RoutingContext, RoutingError, RoutingErrorCode, type RoutingResult, ServerAgentSideConnection, ServerConnectionRegistry, ServiceMode, ServiceModeConflictError, type ServiceModeValue, SessionRouter, type TranslateOptions, type TranslationResources, type TypeWithI18N, applyEnvironmentOverrides, changeI18nLanguage, clearConfigCache, createACPServerInstance, formatLog, getClientById, getClientsConfig, getConfig, getConfigDirectory, getDefaultClient, getGatewayClientUrl, getGlobal, getHomeDir, getInstance, getProjectDirectory, getRegisteredResources, getSdk, getServerConfig, getWorktree, getXdgData, handleAcpCli, initI18n, isConfigLoaded, languages, loadACPServerConfig, loadConfig, loadConfigFromEnv, registerBusinessErrors, registerI18nResources, reloadConfig, renderBanner, renderHelp, resetEasbotClientAdapter, resetGlobalAdapter, resetInstanceAdapter, setEasbotClientAdapter, setGlobalAdapter, setInstanceAdapter, startACPServer, startHttpServer, startWebSocketServer, t, translate };
2037
+ declare function getAgentAddress(config: ACPServerConfig$1): string;
2038
+ declare function registerToGateway(config: ACPServerConfig$1): Promise<boolean>;
2039
+ declare function deregisterFromGateway(): Promise<void>;
2040
+ declare function hasRegistrationSession(): boolean;
2041
+
2042
+ export { ACPClientConfigSchema, ACPClientsConfigSchema, ACPInfoACPConfigSchema, ACPParsePartialConfig, ACPServerConfigSchema, type ACPServerInstance, ACPValidateConfig, ACP_BUSINESS_CODES, ACP_BUSINESS_HINTS, ACP_JSON_REL_PATH, ACP_STDIO_COMMAND, AcpCache, type AcpCliDeps, type AcpCliResult, type AcpConfigStateResult, type AcpEndpointChannel, type AcpEndpointInput, AcpError, AcpEventBridge, AdapterBootstrap, type AdapterBootstrapConfig, type AdapterEnvInitStage, AdapterEnvironmentInitializationError, AdapterError, AgentStatus, COMMANDS_HELP, type CommandHelp, EasBotAgent, type EasBotAgentConfig, EasbotAdapter, ErrorType, type FormatLogOptions, type GatewayUrlAdapter, I18n, LanguagesSupported, type Locale, NameErrors, RegistrySessionRouter, RoutingError, RoutingErrorCode, ServerAgentSideConnection, ServerConnectionRegistry, ServiceMode, ServiceModeConflictError, type ServiceModeValue, SessionRouter, type TranslateOptions, type TranslationResources, type TypeWithI18N, applyEnvironmentOverrides, changeI18nLanguage, clearConfigCache, createACPServerInstance, createAdapterEnvironmentInitializationError, createAdapterError, createChannelError, createConfigError, createNetworkError, createRoutingError, createServiceModeConflictError, createTimeoutError, deregisterFromGateway, formatLog, getAcpEndpointUrl, getAgentAddress, getClientById, getClientsConfig, getConfig, getConfigDirectory, getDefaultClient, getGatewayClientUrl, getGatewayUrlAdapter, getGlobal, getHomeDir, getInstance, getProjectDirectory, getRegisteredResources, getSdk, getServerConfig, getWorktree, getXdgData, handleAcpCli, hasRegistrationSession, initI18n, isAdapterEnvironmentInitializationError, isAdapterError, isAdapterErrorFatal, isAdapterErrorRetryable, isConfigLoaded, isRoutingError, isServiceModeConflictError, languages, loadACPServerConfig, loadConfig, loadConfigFromEnv, registerBusinessErrors, registerI18nResources, registerToGateway, reloadConfig, renderBanner, renderHelp, resetEasbotClientAdapter, resetGatewayUrlAdapter, resetGlobalAdapter, resetInstanceAdapter, setEasbotClientAdapter, setGatewayUrlAdapter, setGlobalAdapter, setInstanceAdapter, startACPServer, startHttpServer, startWebSocketServer, t, translate };