@charming_groot/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/config.d.ts +669 -0
  2. package/dist/config.d.ts.map +1 -0
  3. package/dist/config.js +99 -0
  4. package/dist/config.js.map +1 -0
  5. package/dist/errors/base-error.d.ts +29 -0
  6. package/dist/errors/base-error.d.ts.map +1 -0
  7. package/dist/errors/base-error.js +57 -0
  8. package/dist/errors/base-error.js.map +1 -0
  9. package/dist/errors/index.d.ts +2 -0
  10. package/dist/errors/index.d.ts.map +1 -0
  11. package/dist/errors/index.js +2 -0
  12. package/dist/errors/index.js.map +1 -0
  13. package/dist/event-bus.d.ts +14 -0
  14. package/dist/event-bus.d.ts.map +1 -0
  15. package/dist/event-bus.js +64 -0
  16. package/dist/event-bus.js.map +1 -0
  17. package/dist/index.d.ts +11 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +12 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/logger.d.ts +7 -0
  22. package/dist/logger.d.ts.map +1 -0
  23. package/dist/logger.js +33 -0
  24. package/dist/logger.js.map +1 -0
  25. package/dist/registry.d.ts +15 -0
  26. package/dist/registry.d.ts.map +1 -0
  27. package/dist/registry.js +46 -0
  28. package/dist/registry.js.map +1 -0
  29. package/dist/run-context.d.ts +20 -0
  30. package/dist/run-context.d.ts.map +1 -0
  31. package/dist/run-context.js +39 -0
  32. package/dist/run-context.js.map +1 -0
  33. package/dist/types/auth.d.ts +56 -0
  34. package/dist/types/auth.d.ts.map +1 -0
  35. package/dist/types/auth.js +2 -0
  36. package/dist/types/auth.js.map +1 -0
  37. package/dist/types/common.d.ts +15 -0
  38. package/dist/types/common.d.ts.map +1 -0
  39. package/dist/types/common.js +2 -0
  40. package/dist/types/common.js.map +1 -0
  41. package/dist/types/events.d.ts +77 -0
  42. package/dist/types/events.d.ts.map +1 -0
  43. package/dist/types/events.js +2 -0
  44. package/dist/types/events.js.map +1 -0
  45. package/dist/types/index.d.ts +8 -0
  46. package/dist/types/index.d.ts.map +1 -0
  47. package/dist/types/index.js +2 -0
  48. package/dist/types/index.js.map +1 -0
  49. package/dist/types/provider.d.ts +42 -0
  50. package/dist/types/provider.d.ts.map +1 -0
  51. package/dist/types/provider.js +2 -0
  52. package/dist/types/provider.js.map +1 -0
  53. package/dist/types/sandbox.d.ts +27 -0
  54. package/dist/types/sandbox.d.ts.map +1 -0
  55. package/dist/types/sandbox.js +2 -0
  56. package/dist/types/sandbox.js.map +1 -0
  57. package/dist/types/tool.d.ts +43 -0
  58. package/dist/types/tool.d.ts.map +1 -0
  59. package/dist/types/tool.js +8 -0
  60. package/dist/types/tool.js.map +1 -0
  61. package/package.json +34 -0
  62. package/src/config.ts +119 -0
  63. package/src/errors/base-error.ts +66 -0
  64. package/src/errors/index.ts +10 -0
  65. package/src/event-bus.ts +78 -0
  66. package/src/index.ts +74 -0
  67. package/src/logger.ts +43 -0
  68. package/src/registry.ts +62 -0
  69. package/src/run-context.ts +48 -0
  70. package/src/types/auth.ts +79 -0
  71. package/src/types/common.ts +22 -0
  72. package/src/types/events.ts +24 -0
  73. package/src/types/index.ts +54 -0
  74. package/src/types/provider.ts +50 -0
  75. package/src/types/sandbox.ts +29 -0
  76. package/src/types/tool.ts +37 -0
  77. package/tests/config.test.ts +98 -0
  78. package/tests/errors.test.ts +87 -0
  79. package/tests/event-bus.test.ts +89 -0
  80. package/tests/logger.test.ts +34 -0
  81. package/tests/registry.test.ts +90 -0
  82. package/tests/run-context.test.ts +80 -0
  83. package/tsconfig.json +9 -0
  84. package/vitest.config.ts +9 -0
@@ -0,0 +1,669 @@
1
+ import { z } from 'zod';
2
+ export declare const authConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3
+ type: z.ZodLiteral<"no-auth">;
4
+ }, "strip", z.ZodTypeAny, {
5
+ type: "no-auth";
6
+ }, {
7
+ type: "no-auth";
8
+ }>, z.ZodObject<{
9
+ type: z.ZodLiteral<"api-key">;
10
+ apiKey: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ type: "api-key";
13
+ apiKey: string;
14
+ }, {
15
+ type: "api-key";
16
+ apiKey: string;
17
+ }>, z.ZodObject<{
18
+ type: z.ZodLiteral<"oauth">;
19
+ clientId: z.ZodString;
20
+ clientSecret: z.ZodString;
21
+ tokenUrl: z.ZodString;
22
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
+ accessToken: z.ZodOptional<z.ZodString>;
24
+ refreshToken: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ type: "oauth";
27
+ clientId: string;
28
+ clientSecret: string;
29
+ tokenUrl: string;
30
+ scopes?: string[] | undefined;
31
+ accessToken?: string | undefined;
32
+ refreshToken?: string | undefined;
33
+ }, {
34
+ type: "oauth";
35
+ clientId: string;
36
+ clientSecret: string;
37
+ tokenUrl: string;
38
+ scopes?: string[] | undefined;
39
+ accessToken?: string | undefined;
40
+ refreshToken?: string | undefined;
41
+ }>, z.ZodObject<{
42
+ type: z.ZodLiteral<"azure-ad">;
43
+ tenantId: z.ZodString;
44
+ clientId: z.ZodString;
45
+ clientSecret: z.ZodOptional<z.ZodString>;
46
+ accessToken: z.ZodOptional<z.ZodString>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ type: "azure-ad";
49
+ clientId: string;
50
+ tenantId: string;
51
+ clientSecret?: string | undefined;
52
+ accessToken?: string | undefined;
53
+ }, {
54
+ type: "azure-ad";
55
+ clientId: string;
56
+ tenantId: string;
57
+ clientSecret?: string | undefined;
58
+ accessToken?: string | undefined;
59
+ }>, z.ZodObject<{
60
+ type: z.ZodLiteral<"aws-iam">;
61
+ accessKeyId: z.ZodOptional<z.ZodString>;
62
+ secretAccessKey: z.ZodOptional<z.ZodString>;
63
+ sessionToken: z.ZodOptional<z.ZodString>;
64
+ region: z.ZodString;
65
+ profile: z.ZodOptional<z.ZodString>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ type: "aws-iam";
68
+ region: string;
69
+ accessKeyId?: string | undefined;
70
+ secretAccessKey?: string | undefined;
71
+ sessionToken?: string | undefined;
72
+ profile?: string | undefined;
73
+ }, {
74
+ type: "aws-iam";
75
+ region: string;
76
+ accessKeyId?: string | undefined;
77
+ secretAccessKey?: string | undefined;
78
+ sessionToken?: string | undefined;
79
+ profile?: string | undefined;
80
+ }>, z.ZodObject<{
81
+ type: z.ZodLiteral<"gcp-service-account">;
82
+ projectId: z.ZodString;
83
+ keyFilePath: z.ZodOptional<z.ZodString>;
84
+ accessToken: z.ZodOptional<z.ZodString>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ type: "gcp-service-account";
87
+ projectId: string;
88
+ accessToken?: string | undefined;
89
+ keyFilePath?: string | undefined;
90
+ }, {
91
+ type: "gcp-service-account";
92
+ projectId: string;
93
+ accessToken?: string | undefined;
94
+ keyFilePath?: string | undefined;
95
+ }>, z.ZodObject<{
96
+ type: z.ZodLiteral<"credential-file">;
97
+ filePath: z.ZodString;
98
+ profile: z.ZodOptional<z.ZodString>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ type: "credential-file";
101
+ filePath: string;
102
+ profile?: string | undefined;
103
+ }, {
104
+ type: "credential-file";
105
+ filePath: string;
106
+ profile?: string | undefined;
107
+ }>]>;
108
+ export declare const providerConfigSchema: z.ZodObject<{
109
+ providerId: z.ZodString;
110
+ model: z.ZodString;
111
+ auth: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
112
+ type: z.ZodLiteral<"no-auth">;
113
+ }, "strip", z.ZodTypeAny, {
114
+ type: "no-auth";
115
+ }, {
116
+ type: "no-auth";
117
+ }>, z.ZodObject<{
118
+ type: z.ZodLiteral<"api-key">;
119
+ apiKey: z.ZodString;
120
+ }, "strip", z.ZodTypeAny, {
121
+ type: "api-key";
122
+ apiKey: string;
123
+ }, {
124
+ type: "api-key";
125
+ apiKey: string;
126
+ }>, z.ZodObject<{
127
+ type: z.ZodLiteral<"oauth">;
128
+ clientId: z.ZodString;
129
+ clientSecret: z.ZodString;
130
+ tokenUrl: z.ZodString;
131
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
132
+ accessToken: z.ZodOptional<z.ZodString>;
133
+ refreshToken: z.ZodOptional<z.ZodString>;
134
+ }, "strip", z.ZodTypeAny, {
135
+ type: "oauth";
136
+ clientId: string;
137
+ clientSecret: string;
138
+ tokenUrl: string;
139
+ scopes?: string[] | undefined;
140
+ accessToken?: string | undefined;
141
+ refreshToken?: string | undefined;
142
+ }, {
143
+ type: "oauth";
144
+ clientId: string;
145
+ clientSecret: string;
146
+ tokenUrl: string;
147
+ scopes?: string[] | undefined;
148
+ accessToken?: string | undefined;
149
+ refreshToken?: string | undefined;
150
+ }>, z.ZodObject<{
151
+ type: z.ZodLiteral<"azure-ad">;
152
+ tenantId: z.ZodString;
153
+ clientId: z.ZodString;
154
+ clientSecret: z.ZodOptional<z.ZodString>;
155
+ accessToken: z.ZodOptional<z.ZodString>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ type: "azure-ad";
158
+ clientId: string;
159
+ tenantId: string;
160
+ clientSecret?: string | undefined;
161
+ accessToken?: string | undefined;
162
+ }, {
163
+ type: "azure-ad";
164
+ clientId: string;
165
+ tenantId: string;
166
+ clientSecret?: string | undefined;
167
+ accessToken?: string | undefined;
168
+ }>, z.ZodObject<{
169
+ type: z.ZodLiteral<"aws-iam">;
170
+ accessKeyId: z.ZodOptional<z.ZodString>;
171
+ secretAccessKey: z.ZodOptional<z.ZodString>;
172
+ sessionToken: z.ZodOptional<z.ZodString>;
173
+ region: z.ZodString;
174
+ profile: z.ZodOptional<z.ZodString>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: "aws-iam";
177
+ region: string;
178
+ accessKeyId?: string | undefined;
179
+ secretAccessKey?: string | undefined;
180
+ sessionToken?: string | undefined;
181
+ profile?: string | undefined;
182
+ }, {
183
+ type: "aws-iam";
184
+ region: string;
185
+ accessKeyId?: string | undefined;
186
+ secretAccessKey?: string | undefined;
187
+ sessionToken?: string | undefined;
188
+ profile?: string | undefined;
189
+ }>, z.ZodObject<{
190
+ type: z.ZodLiteral<"gcp-service-account">;
191
+ projectId: z.ZodString;
192
+ keyFilePath: z.ZodOptional<z.ZodString>;
193
+ accessToken: z.ZodOptional<z.ZodString>;
194
+ }, "strip", z.ZodTypeAny, {
195
+ type: "gcp-service-account";
196
+ projectId: string;
197
+ accessToken?: string | undefined;
198
+ keyFilePath?: string | undefined;
199
+ }, {
200
+ type: "gcp-service-account";
201
+ projectId: string;
202
+ accessToken?: string | undefined;
203
+ keyFilePath?: string | undefined;
204
+ }>, z.ZodObject<{
205
+ type: z.ZodLiteral<"credential-file">;
206
+ filePath: z.ZodString;
207
+ profile: z.ZodOptional<z.ZodString>;
208
+ }, "strip", z.ZodTypeAny, {
209
+ type: "credential-file";
210
+ filePath: string;
211
+ profile?: string | undefined;
212
+ }, {
213
+ type: "credential-file";
214
+ filePath: string;
215
+ profile?: string | undefined;
216
+ }>]>;
217
+ baseUrl: z.ZodOptional<z.ZodString>;
218
+ maxTokens: z.ZodDefault<z.ZodNumber>;
219
+ temperature: z.ZodDefault<z.ZodNumber>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ providerId: string;
222
+ model: string;
223
+ auth: {
224
+ type: "no-auth";
225
+ } | {
226
+ type: "api-key";
227
+ apiKey: string;
228
+ } | {
229
+ type: "oauth";
230
+ clientId: string;
231
+ clientSecret: string;
232
+ tokenUrl: string;
233
+ scopes?: string[] | undefined;
234
+ accessToken?: string | undefined;
235
+ refreshToken?: string | undefined;
236
+ } | {
237
+ type: "azure-ad";
238
+ clientId: string;
239
+ tenantId: string;
240
+ clientSecret?: string | undefined;
241
+ accessToken?: string | undefined;
242
+ } | {
243
+ type: "aws-iam";
244
+ region: string;
245
+ accessKeyId?: string | undefined;
246
+ secretAccessKey?: string | undefined;
247
+ sessionToken?: string | undefined;
248
+ profile?: string | undefined;
249
+ } | {
250
+ type: "gcp-service-account";
251
+ projectId: string;
252
+ accessToken?: string | undefined;
253
+ keyFilePath?: string | undefined;
254
+ } | {
255
+ type: "credential-file";
256
+ filePath: string;
257
+ profile?: string | undefined;
258
+ };
259
+ maxTokens: number;
260
+ temperature: number;
261
+ baseUrl?: string | undefined;
262
+ }, {
263
+ providerId: string;
264
+ model: string;
265
+ auth: {
266
+ type: "no-auth";
267
+ } | {
268
+ type: "api-key";
269
+ apiKey: string;
270
+ } | {
271
+ type: "oauth";
272
+ clientId: string;
273
+ clientSecret: string;
274
+ tokenUrl: string;
275
+ scopes?: string[] | undefined;
276
+ accessToken?: string | undefined;
277
+ refreshToken?: string | undefined;
278
+ } | {
279
+ type: "azure-ad";
280
+ clientId: string;
281
+ tenantId: string;
282
+ clientSecret?: string | undefined;
283
+ accessToken?: string | undefined;
284
+ } | {
285
+ type: "aws-iam";
286
+ region: string;
287
+ accessKeyId?: string | undefined;
288
+ secretAccessKey?: string | undefined;
289
+ sessionToken?: string | undefined;
290
+ profile?: string | undefined;
291
+ } | {
292
+ type: "gcp-service-account";
293
+ projectId: string;
294
+ accessToken?: string | undefined;
295
+ keyFilePath?: string | undefined;
296
+ } | {
297
+ type: "credential-file";
298
+ filePath: string;
299
+ profile?: string | undefined;
300
+ };
301
+ baseUrl?: string | undefined;
302
+ maxTokens?: number | undefined;
303
+ temperature?: number | undefined;
304
+ }>;
305
+ export type ProviderConfig = z.infer<typeof providerConfigSchema>;
306
+ export declare const sandboxConfigSchema: z.ZodObject<{
307
+ image: z.ZodDefault<z.ZodString>;
308
+ memoryLimitMb: z.ZodDefault<z.ZodNumber>;
309
+ cpuLimit: z.ZodDefault<z.ZodNumber>;
310
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
311
+ workDir: z.ZodDefault<z.ZodString>;
312
+ }, "strip", z.ZodTypeAny, {
313
+ image: string;
314
+ memoryLimitMb: number;
315
+ cpuLimit: number;
316
+ timeoutMs: number;
317
+ workDir: string;
318
+ }, {
319
+ image?: string | undefined;
320
+ memoryLimitMb?: number | undefined;
321
+ cpuLimit?: number | undefined;
322
+ timeoutMs?: number | undefined;
323
+ workDir?: string | undefined;
324
+ }>;
325
+ export type SandboxConfigInput = z.infer<typeof sandboxConfigSchema>;
326
+ export declare const agentConfigSchema: z.ZodObject<{
327
+ provider: z.ZodObject<{
328
+ providerId: z.ZodString;
329
+ model: z.ZodString;
330
+ auth: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
331
+ type: z.ZodLiteral<"no-auth">;
332
+ }, "strip", z.ZodTypeAny, {
333
+ type: "no-auth";
334
+ }, {
335
+ type: "no-auth";
336
+ }>, z.ZodObject<{
337
+ type: z.ZodLiteral<"api-key">;
338
+ apiKey: z.ZodString;
339
+ }, "strip", z.ZodTypeAny, {
340
+ type: "api-key";
341
+ apiKey: string;
342
+ }, {
343
+ type: "api-key";
344
+ apiKey: string;
345
+ }>, z.ZodObject<{
346
+ type: z.ZodLiteral<"oauth">;
347
+ clientId: z.ZodString;
348
+ clientSecret: z.ZodString;
349
+ tokenUrl: z.ZodString;
350
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
351
+ accessToken: z.ZodOptional<z.ZodString>;
352
+ refreshToken: z.ZodOptional<z.ZodString>;
353
+ }, "strip", z.ZodTypeAny, {
354
+ type: "oauth";
355
+ clientId: string;
356
+ clientSecret: string;
357
+ tokenUrl: string;
358
+ scopes?: string[] | undefined;
359
+ accessToken?: string | undefined;
360
+ refreshToken?: string | undefined;
361
+ }, {
362
+ type: "oauth";
363
+ clientId: string;
364
+ clientSecret: string;
365
+ tokenUrl: string;
366
+ scopes?: string[] | undefined;
367
+ accessToken?: string | undefined;
368
+ refreshToken?: string | undefined;
369
+ }>, z.ZodObject<{
370
+ type: z.ZodLiteral<"azure-ad">;
371
+ tenantId: z.ZodString;
372
+ clientId: z.ZodString;
373
+ clientSecret: z.ZodOptional<z.ZodString>;
374
+ accessToken: z.ZodOptional<z.ZodString>;
375
+ }, "strip", z.ZodTypeAny, {
376
+ type: "azure-ad";
377
+ clientId: string;
378
+ tenantId: string;
379
+ clientSecret?: string | undefined;
380
+ accessToken?: string | undefined;
381
+ }, {
382
+ type: "azure-ad";
383
+ clientId: string;
384
+ tenantId: string;
385
+ clientSecret?: string | undefined;
386
+ accessToken?: string | undefined;
387
+ }>, z.ZodObject<{
388
+ type: z.ZodLiteral<"aws-iam">;
389
+ accessKeyId: z.ZodOptional<z.ZodString>;
390
+ secretAccessKey: z.ZodOptional<z.ZodString>;
391
+ sessionToken: z.ZodOptional<z.ZodString>;
392
+ region: z.ZodString;
393
+ profile: z.ZodOptional<z.ZodString>;
394
+ }, "strip", z.ZodTypeAny, {
395
+ type: "aws-iam";
396
+ region: string;
397
+ accessKeyId?: string | undefined;
398
+ secretAccessKey?: string | undefined;
399
+ sessionToken?: string | undefined;
400
+ profile?: string | undefined;
401
+ }, {
402
+ type: "aws-iam";
403
+ region: string;
404
+ accessKeyId?: string | undefined;
405
+ secretAccessKey?: string | undefined;
406
+ sessionToken?: string | undefined;
407
+ profile?: string | undefined;
408
+ }>, z.ZodObject<{
409
+ type: z.ZodLiteral<"gcp-service-account">;
410
+ projectId: z.ZodString;
411
+ keyFilePath: z.ZodOptional<z.ZodString>;
412
+ accessToken: z.ZodOptional<z.ZodString>;
413
+ }, "strip", z.ZodTypeAny, {
414
+ type: "gcp-service-account";
415
+ projectId: string;
416
+ accessToken?: string | undefined;
417
+ keyFilePath?: string | undefined;
418
+ }, {
419
+ type: "gcp-service-account";
420
+ projectId: string;
421
+ accessToken?: string | undefined;
422
+ keyFilePath?: string | undefined;
423
+ }>, z.ZodObject<{
424
+ type: z.ZodLiteral<"credential-file">;
425
+ filePath: z.ZodString;
426
+ profile: z.ZodOptional<z.ZodString>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ type: "credential-file";
429
+ filePath: string;
430
+ profile?: string | undefined;
431
+ }, {
432
+ type: "credential-file";
433
+ filePath: string;
434
+ profile?: string | undefined;
435
+ }>]>;
436
+ baseUrl: z.ZodOptional<z.ZodString>;
437
+ maxTokens: z.ZodDefault<z.ZodNumber>;
438
+ temperature: z.ZodDefault<z.ZodNumber>;
439
+ }, "strip", z.ZodTypeAny, {
440
+ providerId: string;
441
+ model: string;
442
+ auth: {
443
+ type: "no-auth";
444
+ } | {
445
+ type: "api-key";
446
+ apiKey: string;
447
+ } | {
448
+ type: "oauth";
449
+ clientId: string;
450
+ clientSecret: string;
451
+ tokenUrl: string;
452
+ scopes?: string[] | undefined;
453
+ accessToken?: string | undefined;
454
+ refreshToken?: string | undefined;
455
+ } | {
456
+ type: "azure-ad";
457
+ clientId: string;
458
+ tenantId: string;
459
+ clientSecret?: string | undefined;
460
+ accessToken?: string | undefined;
461
+ } | {
462
+ type: "aws-iam";
463
+ region: string;
464
+ accessKeyId?: string | undefined;
465
+ secretAccessKey?: string | undefined;
466
+ sessionToken?: string | undefined;
467
+ profile?: string | undefined;
468
+ } | {
469
+ type: "gcp-service-account";
470
+ projectId: string;
471
+ accessToken?: string | undefined;
472
+ keyFilePath?: string | undefined;
473
+ } | {
474
+ type: "credential-file";
475
+ filePath: string;
476
+ profile?: string | undefined;
477
+ };
478
+ maxTokens: number;
479
+ temperature: number;
480
+ baseUrl?: string | undefined;
481
+ }, {
482
+ providerId: string;
483
+ model: string;
484
+ auth: {
485
+ type: "no-auth";
486
+ } | {
487
+ type: "api-key";
488
+ apiKey: string;
489
+ } | {
490
+ type: "oauth";
491
+ clientId: string;
492
+ clientSecret: string;
493
+ tokenUrl: string;
494
+ scopes?: string[] | undefined;
495
+ accessToken?: string | undefined;
496
+ refreshToken?: string | undefined;
497
+ } | {
498
+ type: "azure-ad";
499
+ clientId: string;
500
+ tenantId: string;
501
+ clientSecret?: string | undefined;
502
+ accessToken?: string | undefined;
503
+ } | {
504
+ type: "aws-iam";
505
+ region: string;
506
+ accessKeyId?: string | undefined;
507
+ secretAccessKey?: string | undefined;
508
+ sessionToken?: string | undefined;
509
+ profile?: string | undefined;
510
+ } | {
511
+ type: "gcp-service-account";
512
+ projectId: string;
513
+ accessToken?: string | undefined;
514
+ keyFilePath?: string | undefined;
515
+ } | {
516
+ type: "credential-file";
517
+ filePath: string;
518
+ profile?: string | undefined;
519
+ };
520
+ baseUrl?: string | undefined;
521
+ maxTokens?: number | undefined;
522
+ temperature?: number | undefined;
523
+ }>;
524
+ sandbox: z.ZodOptional<z.ZodObject<{
525
+ image: z.ZodDefault<z.ZodString>;
526
+ memoryLimitMb: z.ZodDefault<z.ZodNumber>;
527
+ cpuLimit: z.ZodDefault<z.ZodNumber>;
528
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
529
+ workDir: z.ZodDefault<z.ZodString>;
530
+ }, "strip", z.ZodTypeAny, {
531
+ image: string;
532
+ memoryLimitMb: number;
533
+ cpuLimit: number;
534
+ timeoutMs: number;
535
+ workDir: string;
536
+ }, {
537
+ image?: string | undefined;
538
+ memoryLimitMb?: number | undefined;
539
+ cpuLimit?: number | undefined;
540
+ timeoutMs?: number | undefined;
541
+ workDir?: string | undefined;
542
+ }>>;
543
+ maxIterations: z.ZodDefault<z.ZodNumber>;
544
+ systemPrompt: z.ZodOptional<z.ZodString>;
545
+ workingDirectory: z.ZodDefault<z.ZodString>;
546
+ }, "strip", z.ZodTypeAny, {
547
+ provider: {
548
+ providerId: string;
549
+ model: string;
550
+ auth: {
551
+ type: "no-auth";
552
+ } | {
553
+ type: "api-key";
554
+ apiKey: string;
555
+ } | {
556
+ type: "oauth";
557
+ clientId: string;
558
+ clientSecret: string;
559
+ tokenUrl: string;
560
+ scopes?: string[] | undefined;
561
+ accessToken?: string | undefined;
562
+ refreshToken?: string | undefined;
563
+ } | {
564
+ type: "azure-ad";
565
+ clientId: string;
566
+ tenantId: string;
567
+ clientSecret?: string | undefined;
568
+ accessToken?: string | undefined;
569
+ } | {
570
+ type: "aws-iam";
571
+ region: string;
572
+ accessKeyId?: string | undefined;
573
+ secretAccessKey?: string | undefined;
574
+ sessionToken?: string | undefined;
575
+ profile?: string | undefined;
576
+ } | {
577
+ type: "gcp-service-account";
578
+ projectId: string;
579
+ accessToken?: string | undefined;
580
+ keyFilePath?: string | undefined;
581
+ } | {
582
+ type: "credential-file";
583
+ filePath: string;
584
+ profile?: string | undefined;
585
+ };
586
+ maxTokens: number;
587
+ temperature: number;
588
+ baseUrl?: string | undefined;
589
+ };
590
+ maxIterations: number;
591
+ workingDirectory: string;
592
+ sandbox?: {
593
+ image: string;
594
+ memoryLimitMb: number;
595
+ cpuLimit: number;
596
+ timeoutMs: number;
597
+ workDir: string;
598
+ } | undefined;
599
+ systemPrompt?: string | undefined;
600
+ }, {
601
+ provider: {
602
+ providerId: string;
603
+ model: string;
604
+ auth: {
605
+ type: "no-auth";
606
+ } | {
607
+ type: "api-key";
608
+ apiKey: string;
609
+ } | {
610
+ type: "oauth";
611
+ clientId: string;
612
+ clientSecret: string;
613
+ tokenUrl: string;
614
+ scopes?: string[] | undefined;
615
+ accessToken?: string | undefined;
616
+ refreshToken?: string | undefined;
617
+ } | {
618
+ type: "azure-ad";
619
+ clientId: string;
620
+ tenantId: string;
621
+ clientSecret?: string | undefined;
622
+ accessToken?: string | undefined;
623
+ } | {
624
+ type: "aws-iam";
625
+ region: string;
626
+ accessKeyId?: string | undefined;
627
+ secretAccessKey?: string | undefined;
628
+ sessionToken?: string | undefined;
629
+ profile?: string | undefined;
630
+ } | {
631
+ type: "gcp-service-account";
632
+ projectId: string;
633
+ accessToken?: string | undefined;
634
+ keyFilePath?: string | undefined;
635
+ } | {
636
+ type: "credential-file";
637
+ filePath: string;
638
+ profile?: string | undefined;
639
+ };
640
+ baseUrl?: string | undefined;
641
+ maxTokens?: number | undefined;
642
+ temperature?: number | undefined;
643
+ };
644
+ sandbox?: {
645
+ image?: string | undefined;
646
+ memoryLimitMb?: number | undefined;
647
+ cpuLimit?: number | undefined;
648
+ timeoutMs?: number | undefined;
649
+ workDir?: string | undefined;
650
+ } | undefined;
651
+ maxIterations?: number | undefined;
652
+ systemPrompt?: string | undefined;
653
+ workingDirectory?: string | undefined;
654
+ }>;
655
+ export type AgentConfig = z.infer<typeof agentConfigSchema>;
656
+ export declare function parseConfig<T>(schema: z.ZodType<T, z.ZodTypeDef, unknown>, raw: unknown): T;
657
+ export declare function parseAgentConfig(raw: unknown): AgentConfig;
658
+ /**
659
+ * Shorthand: convert a plain apiKey string to an AuthConfig object.
660
+ * Useful for backward-compatible CLI usage.
661
+ */
662
+ export declare function apiKeyAuth(apiKey: string): {
663
+ type: 'api-key';
664
+ apiKey: string;
665
+ };
666
+ export declare function noAuth(): {
667
+ type: 'no-auth';
668
+ };
669
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoDxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQ3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,CAAC,CAS3F;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAE1D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAE9E;AAED,wBAAgB,MAAM,IAAI;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAE5C"}