agent-def 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1549 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { z } from "zod";
6
+ /**
7
+ * Group definition
8
+ *
9
+ * Represents a flexible organizational unit that an agent can belong to.
10
+ * Groups can represent teams, projects, clusters, departments, or any arbitrary
11
+ * organizational structure.
12
+ *
13
+ * @example
14
+ * // Simple team group
15
+ * { id: "team:backend", properties: { role: "lead", tier: "senior" } }
16
+ *
17
+ * @example
18
+ * // Project group
19
+ * { id: "project:api-v2", properties: { status: "active", priority: 1 } }
20
+ *
21
+ * @example
22
+ * // Cluster group
23
+ * { id: "cluster:production-us-east", properties: { region: "us-east-1" } }
24
+ */
25
+ export declare const GroupSchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ id: string;
30
+ properties?: Record<string, unknown> | undefined;
31
+ }, {
32
+ id: string;
33
+ properties?: Record<string, unknown> | undefined;
34
+ }>;
35
+ export type Group = z.infer<typeof GroupSchema>;
36
+ /**
37
+ * Agent definition schema
38
+ *
39
+ * The core specification for an Artinet agent, defining its identity, capabilities,
40
+ * organizational membership, and behavior. This schema is designed to be portable
41
+ * and can be serialized in agent.md files with YAML frontmatter.
42
+ *
43
+ * @example
44
+ * ```yaml
45
+ * ---
46
+ * id: backend-architect
47
+ * name: Backend System Architect
48
+ * description: Design RESTful APIs and microservice architectures
49
+ * model: openai/gpt-4
50
+ * version: "1.0.0"
51
+ * toolIds:
52
+ * - filesystem
53
+ * - database-analyzer
54
+ * groupIds:
55
+ * - team:backend
56
+ * - project:api-v2
57
+ * agentIds:
58
+ * - database-specialist
59
+ * - security-auditor
60
+ * instructions: |
61
+ * You are a backend system architect specializing in scalable API design...
62
+ * ---
63
+ * ```
64
+ */
65
+ export declare const AgentDefinitionSchema: z.ZodObject<{
66
+ name: z.ZodString;
67
+ url: z.ZodOptional<z.ZodString>;
68
+ description: z.ZodString;
69
+ version: z.ZodString;
70
+ security: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, "many">>;
71
+ protocolVersion: z.ZodOptional<z.ZodDefault<z.ZodString>>;
72
+ preferredTransport: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["JSONRPC", "GRPC", "HTTP+JSON"]>, z.ZodString]>>;
73
+ additionalInterfaces: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
+ url: z.ZodString;
75
+ transport: z.ZodUnion<[z.ZodEnum<["JSONRPC", "GRPC", "HTTP+JSON"]>, z.ZodString]>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ url: string;
78
+ transport: string;
79
+ }, {
80
+ url: string;
81
+ transport: string;
82
+ }>, "many">>;
83
+ iconUrl: z.ZodOptional<z.ZodString>;
84
+ provider: z.ZodOptional<z.ZodObject<{
85
+ organization: z.ZodString;
86
+ url: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ url: string;
89
+ organization: string;
90
+ }, {
91
+ url: string;
92
+ organization: string;
93
+ }>>;
94
+ documentationUrl: z.ZodOptional<z.ZodString>;
95
+ capabilities: z.ZodOptional<z.ZodObject<{
96
+ streaming: z.ZodOptional<z.ZodBoolean>;
97
+ pushNotifications: z.ZodOptional<z.ZodBoolean>;
98
+ stateTransitionHistory: z.ZodOptional<z.ZodBoolean>;
99
+ extensions: z.ZodOptional<z.ZodArray<z.ZodObject<{
100
+ uri: z.ZodString;
101
+ description: z.ZodOptional<z.ZodString>;
102
+ required: z.ZodOptional<z.ZodBoolean>;
103
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ uri: string;
106
+ required?: boolean | undefined;
107
+ description?: string | undefined;
108
+ params?: Record<string, unknown> | undefined;
109
+ }, {
110
+ uri: string;
111
+ required?: boolean | undefined;
112
+ description?: string | undefined;
113
+ params?: Record<string, unknown> | undefined;
114
+ }>, "many">>;
115
+ }, "strip", z.ZodTypeAny, {
116
+ extensions?: {
117
+ uri: string;
118
+ required?: boolean | undefined;
119
+ description?: string | undefined;
120
+ params?: Record<string, unknown> | undefined;
121
+ }[] | undefined;
122
+ streaming?: boolean | undefined;
123
+ pushNotifications?: boolean | undefined;
124
+ stateTransitionHistory?: boolean | undefined;
125
+ }, {
126
+ extensions?: {
127
+ uri: string;
128
+ required?: boolean | undefined;
129
+ description?: string | undefined;
130
+ params?: Record<string, unknown> | undefined;
131
+ }[] | undefined;
132
+ streaming?: boolean | undefined;
133
+ pushNotifications?: boolean | undefined;
134
+ stateTransitionHistory?: boolean | undefined;
135
+ }>>;
136
+ securitySchemes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
137
+ description: z.ZodOptional<z.ZodString>;
138
+ } & {
139
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "apiKey", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
140
+ in: z.ZodEnum<["query", "header", "cookie"]>;
141
+ name: z.ZodString;
142
+ }, "strip", z.ZodTypeAny, {
143
+ name: string;
144
+ type: "apiKey";
145
+ in: "header" | "query" | "cookie";
146
+ description?: string | undefined;
147
+ }, {
148
+ name: string;
149
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
150
+ in: "header" | "query" | "cookie";
151
+ description?: string | undefined;
152
+ }>, z.ZodObject<{
153
+ description: z.ZodOptional<z.ZodString>;
154
+ } & {
155
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "http", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
156
+ scheme: z.ZodString;
157
+ bearerFormat: z.ZodOptional<z.ZodString>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ type: "http";
160
+ scheme: string;
161
+ description?: string | undefined;
162
+ bearerFormat?: string | undefined;
163
+ }, {
164
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
165
+ scheme: string;
166
+ description?: string | undefined;
167
+ bearerFormat?: string | undefined;
168
+ }>, z.ZodObject<{
169
+ description: z.ZodOptional<z.ZodString>;
170
+ } & {
171
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "oauth2", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
172
+ flows: z.ZodObject<{
173
+ authorizationCode: z.ZodOptional<z.ZodObject<{
174
+ authorizationUrl: z.ZodString;
175
+ tokenUrl: z.ZodString;
176
+ refreshUrl: z.ZodOptional<z.ZodString>;
177
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
178
+ }, "strip", z.ZodTypeAny, {
179
+ authorizationUrl: string;
180
+ tokenUrl: string;
181
+ scopes: Record<string, string>;
182
+ refreshUrl?: string | undefined;
183
+ }, {
184
+ authorizationUrl: string;
185
+ tokenUrl: string;
186
+ scopes: Record<string, string>;
187
+ refreshUrl?: string | undefined;
188
+ }>>;
189
+ clientCredentials: z.ZodOptional<z.ZodObject<{
190
+ tokenUrl: z.ZodString;
191
+ refreshUrl: z.ZodOptional<z.ZodString>;
192
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
193
+ }, "strip", z.ZodTypeAny, {
194
+ tokenUrl: string;
195
+ scopes: Record<string, string>;
196
+ refreshUrl?: string | undefined;
197
+ }, {
198
+ tokenUrl: string;
199
+ scopes: Record<string, string>;
200
+ refreshUrl?: string | undefined;
201
+ }>>;
202
+ implicit: z.ZodOptional<z.ZodObject<{
203
+ authorizationUrl: z.ZodString;
204
+ refreshUrl: z.ZodOptional<z.ZodString>;
205
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
206
+ }, "strip", z.ZodTypeAny, {
207
+ authorizationUrl: string;
208
+ scopes: Record<string, string>;
209
+ refreshUrl?: string | undefined;
210
+ }, {
211
+ authorizationUrl: string;
212
+ scopes: Record<string, string>;
213
+ refreshUrl?: string | undefined;
214
+ }>>;
215
+ password: z.ZodOptional<z.ZodObject<{
216
+ tokenUrl: z.ZodString;
217
+ refreshUrl: z.ZodOptional<z.ZodString>;
218
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ tokenUrl: string;
221
+ scopes: Record<string, string>;
222
+ refreshUrl?: string | undefined;
223
+ }, {
224
+ tokenUrl: string;
225
+ scopes: Record<string, string>;
226
+ refreshUrl?: string | undefined;
227
+ }>>;
228
+ }, "strip", z.ZodTypeAny, {
229
+ authorizationCode?: {
230
+ authorizationUrl: string;
231
+ tokenUrl: string;
232
+ scopes: Record<string, string>;
233
+ refreshUrl?: string | undefined;
234
+ } | undefined;
235
+ clientCredentials?: {
236
+ tokenUrl: string;
237
+ scopes: Record<string, string>;
238
+ refreshUrl?: string | undefined;
239
+ } | undefined;
240
+ implicit?: {
241
+ authorizationUrl: string;
242
+ scopes: Record<string, string>;
243
+ refreshUrl?: string | undefined;
244
+ } | undefined;
245
+ password?: {
246
+ tokenUrl: string;
247
+ scopes: Record<string, string>;
248
+ refreshUrl?: string | undefined;
249
+ } | undefined;
250
+ }, {
251
+ authorizationCode?: {
252
+ authorizationUrl: string;
253
+ tokenUrl: string;
254
+ scopes: Record<string, string>;
255
+ refreshUrl?: string | undefined;
256
+ } | undefined;
257
+ clientCredentials?: {
258
+ tokenUrl: string;
259
+ scopes: Record<string, string>;
260
+ refreshUrl?: string | undefined;
261
+ } | undefined;
262
+ implicit?: {
263
+ authorizationUrl: string;
264
+ scopes: Record<string, string>;
265
+ refreshUrl?: string | undefined;
266
+ } | undefined;
267
+ password?: {
268
+ tokenUrl: string;
269
+ scopes: Record<string, string>;
270
+ refreshUrl?: string | undefined;
271
+ } | undefined;
272
+ }>;
273
+ oauth2MetadataUrl: z.ZodOptional<z.ZodString>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ type: "oauth2";
276
+ flows: {
277
+ authorizationCode?: {
278
+ authorizationUrl: string;
279
+ tokenUrl: string;
280
+ scopes: Record<string, string>;
281
+ refreshUrl?: string | undefined;
282
+ } | undefined;
283
+ clientCredentials?: {
284
+ tokenUrl: string;
285
+ scopes: Record<string, string>;
286
+ refreshUrl?: string | undefined;
287
+ } | undefined;
288
+ implicit?: {
289
+ authorizationUrl: string;
290
+ scopes: Record<string, string>;
291
+ refreshUrl?: string | undefined;
292
+ } | undefined;
293
+ password?: {
294
+ tokenUrl: string;
295
+ scopes: Record<string, string>;
296
+ refreshUrl?: string | undefined;
297
+ } | undefined;
298
+ };
299
+ description?: string | undefined;
300
+ oauth2MetadataUrl?: string | undefined;
301
+ }, {
302
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
303
+ flows: {
304
+ authorizationCode?: {
305
+ authorizationUrl: string;
306
+ tokenUrl: string;
307
+ scopes: Record<string, string>;
308
+ refreshUrl?: string | undefined;
309
+ } | undefined;
310
+ clientCredentials?: {
311
+ tokenUrl: string;
312
+ scopes: Record<string, string>;
313
+ refreshUrl?: string | undefined;
314
+ } | undefined;
315
+ implicit?: {
316
+ authorizationUrl: string;
317
+ scopes: Record<string, string>;
318
+ refreshUrl?: string | undefined;
319
+ } | undefined;
320
+ password?: {
321
+ tokenUrl: string;
322
+ scopes: Record<string, string>;
323
+ refreshUrl?: string | undefined;
324
+ } | undefined;
325
+ };
326
+ description?: string | undefined;
327
+ oauth2MetadataUrl?: string | undefined;
328
+ }>, z.ZodObject<{
329
+ description: z.ZodOptional<z.ZodString>;
330
+ } & {
331
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "openIdConnect", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
332
+ openIdConnectUrl: z.ZodString;
333
+ }, "strip", z.ZodTypeAny, {
334
+ type: "openIdConnect";
335
+ openIdConnectUrl: string;
336
+ description?: string | undefined;
337
+ }, {
338
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
339
+ openIdConnectUrl: string;
340
+ description?: string | undefined;
341
+ }>, z.ZodObject<{
342
+ description: z.ZodOptional<z.ZodString>;
343
+ } & {
344
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "mutualTLS", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
345
+ }, "strip", z.ZodTypeAny, {
346
+ type: "mutualTLS";
347
+ description?: string | undefined;
348
+ }, {
349
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
350
+ description?: string | undefined;
351
+ }>]>>>;
352
+ defaultInputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
353
+ defaultOutputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
354
+ skills: z.ZodArray<z.ZodObject<{
355
+ id: z.ZodString;
356
+ name: z.ZodString;
357
+ description: z.ZodString;
358
+ tags: z.ZodArray<z.ZodString, "many">;
359
+ examples: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
360
+ inputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
361
+ outputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
362
+ security: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, "many">>;
363
+ }, "strip", z.ZodTypeAny, {
364
+ name: string;
365
+ id: string;
366
+ description: string;
367
+ tags: string[];
368
+ examples?: string[] | undefined;
369
+ inputModes?: string[] | undefined;
370
+ outputModes?: string[] | undefined;
371
+ security?: Record<string, string[]>[] | undefined;
372
+ }, {
373
+ name: string;
374
+ id: string;
375
+ description: string;
376
+ tags: string[];
377
+ examples?: string[] | undefined;
378
+ inputModes?: string[] | undefined;
379
+ outputModes?: string[] | undefined;
380
+ security?: Record<string, string[]>[] | undefined;
381
+ }>, "many">;
382
+ supportsAuthenticatedExtendedCard: z.ZodOptional<z.ZodBoolean>;
383
+ signatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
384
+ protected: z.ZodString;
385
+ signature: z.ZodString;
386
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
387
+ }, "strip", z.ZodTypeAny, {
388
+ protected: string;
389
+ signature: string;
390
+ header?: Record<string, unknown> | undefined;
391
+ }, {
392
+ protected: string;
393
+ signature: string;
394
+ header?: Record<string, unknown> | undefined;
395
+ }>, "many">>;
396
+ } & {
397
+ /**
398
+ * Optional agent ID - will be generated if not provided
399
+ *
400
+ * Use kebab-case for consistency (e.g., 'backend-architect', 'code-reviewer')
401
+ */
402
+ id: z.ZodOptional<z.ZodString>;
403
+ /**
404
+ * Optional model specification
405
+ *
406
+ * Specifies the LLM model to use for this agent.
407
+ *
408
+ * @example "openai/gpt-4o-mini"
409
+ * @example "anthropic/claude-3-opus-20241022"
410
+ * @example "deepseek-ai/DeepSeek-R1"
411
+ */
412
+ modelId: z.ZodOptional<z.ZodString>;
413
+ /**
414
+ * Tool IDs that this agent can use
415
+ *
416
+ * A flexible list of tool identifiers that reference MCP servers, in-memory
417
+ * functions, or any other tool providers available in the runtime environment.
418
+ * Tools are resolved by the agent runtime based on these IDs.
419
+ *
420
+ * @example ["filesystem", "web-search", "code-analyzer"]
421
+ * @example ["mcp-server-git", "mcp-server-postgres", "custom-api-client"]
422
+ */
423
+ toolIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
424
+ /**
425
+ * Agent IDs that this agent can call
426
+ *
427
+ * Explicitly defines which other agents this agent has permission to invoke.
428
+ * These could be local agent instances, remote agent servers, or any agent
429
+ * accessible in the runtime environment. This provides explicit access control
430
+ * separate from group membership.
431
+ *
432
+ * @example ["database-specialist", "security-auditor", "code-reviewer"]
433
+ * @example ["agent://team-lead", "https://agents.example.com/research"]
434
+ */
435
+ agentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
436
+ /**
437
+ * Groups that this agent belongs to
438
+ *
439
+ * Defines organizational membership for discovery, coordination, and management.
440
+ * Groups can represent teams, projects, clusters, departments, or any arbitrary
441
+ * organizational structure. Supports both simple string IDs and rich objects
442
+ * with properties.
443
+ *
444
+ * @example
445
+ * // Simple string references
446
+ * ["team:backend", "project:api-v2", "cluster:production"]
447
+ *
448
+ * @example
449
+ * // Rich objects with properties
450
+ * [
451
+ * { id: "team:backend", properties: { role: "lead", tier: "senior" } },
452
+ * { id: "project:api-v2", properties: { status: "active", priority: 1 } }
453
+ * ]
454
+ */
455
+ groupIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
456
+ id: z.ZodString;
457
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
458
+ }, "strip", z.ZodTypeAny, {
459
+ id: string;
460
+ properties?: Record<string, unknown> | undefined;
461
+ }, {
462
+ id: string;
463
+ properties?: Record<string, unknown> | undefined;
464
+ }>]>, "many">>>;
465
+ /**
466
+ * System instructions for the agent
467
+ *
468
+ * The core prompt that defines the agent's behavior, expertise, methodology,
469
+ * and output format. This is typically provided in the markdown body of an
470
+ * agent.md file and defines the agent's persona and capabilities.
471
+ *
472
+ * @example
473
+ * ```
474
+ * You are a backend system architect specializing in scalable API design.
475
+ *
476
+ * ## Focus Areas
477
+ * - RESTful API design with proper versioning
478
+ * - Microservice boundaries and communication patterns
479
+ * - Database schema design and optimization
480
+ *
481
+ * ## Methodology
482
+ * 1. Analyze requirements and constraints
483
+ * 2. Design contract-first APIs
484
+ * 3. Consider scalability from day one
485
+ * ```
486
+ */
487
+ instructions: z.ZodString;
488
+ }, "strip", z.ZodTypeAny, {
489
+ name: string;
490
+ description: string;
491
+ version: string;
492
+ skills: {
493
+ name: string;
494
+ id: string;
495
+ description: string;
496
+ tags: string[];
497
+ examples?: string[] | undefined;
498
+ inputModes?: string[] | undefined;
499
+ outputModes?: string[] | undefined;
500
+ security?: Record<string, string[]>[] | undefined;
501
+ }[];
502
+ instructions: string;
503
+ toolIds: string[];
504
+ groupIds: (string | {
505
+ id: string;
506
+ properties?: Record<string, unknown> | undefined;
507
+ })[];
508
+ id?: string | undefined;
509
+ url?: string | undefined;
510
+ security?: Record<string, string[]>[] | undefined;
511
+ protocolVersion?: string | undefined;
512
+ preferredTransport?: string | undefined;
513
+ additionalInterfaces?: {
514
+ url: string;
515
+ transport: string;
516
+ }[] | undefined;
517
+ iconUrl?: string | undefined;
518
+ provider?: {
519
+ url: string;
520
+ organization: string;
521
+ } | undefined;
522
+ documentationUrl?: string | undefined;
523
+ capabilities?: {
524
+ extensions?: {
525
+ uri: string;
526
+ required?: boolean | undefined;
527
+ description?: string | undefined;
528
+ params?: Record<string, unknown> | undefined;
529
+ }[] | undefined;
530
+ streaming?: boolean | undefined;
531
+ pushNotifications?: boolean | undefined;
532
+ stateTransitionHistory?: boolean | undefined;
533
+ } | undefined;
534
+ securitySchemes?: Record<string, {
535
+ name: string;
536
+ type: "apiKey";
537
+ in: "header" | "query" | "cookie";
538
+ description?: string | undefined;
539
+ } | {
540
+ type: "http";
541
+ scheme: string;
542
+ description?: string | undefined;
543
+ bearerFormat?: string | undefined;
544
+ } | {
545
+ type: "oauth2";
546
+ flows: {
547
+ authorizationCode?: {
548
+ authorizationUrl: string;
549
+ tokenUrl: string;
550
+ scopes: Record<string, string>;
551
+ refreshUrl?: string | undefined;
552
+ } | undefined;
553
+ clientCredentials?: {
554
+ tokenUrl: string;
555
+ scopes: Record<string, string>;
556
+ refreshUrl?: string | undefined;
557
+ } | undefined;
558
+ implicit?: {
559
+ authorizationUrl: string;
560
+ scopes: Record<string, string>;
561
+ refreshUrl?: string | undefined;
562
+ } | undefined;
563
+ password?: {
564
+ tokenUrl: string;
565
+ scopes: Record<string, string>;
566
+ refreshUrl?: string | undefined;
567
+ } | undefined;
568
+ };
569
+ description?: string | undefined;
570
+ oauth2MetadataUrl?: string | undefined;
571
+ } | {
572
+ type: "openIdConnect";
573
+ openIdConnectUrl: string;
574
+ description?: string | undefined;
575
+ } | {
576
+ type: "mutualTLS";
577
+ description?: string | undefined;
578
+ }> | undefined;
579
+ defaultInputModes?: string[] | undefined;
580
+ defaultOutputModes?: string[] | undefined;
581
+ supportsAuthenticatedExtendedCard?: boolean | undefined;
582
+ signatures?: {
583
+ protected: string;
584
+ signature: string;
585
+ header?: Record<string, unknown> | undefined;
586
+ }[] | undefined;
587
+ modelId?: string | undefined;
588
+ agentIds?: string[] | undefined;
589
+ }, {
590
+ name: string;
591
+ description: string;
592
+ version: string;
593
+ skills: {
594
+ name: string;
595
+ id: string;
596
+ description: string;
597
+ tags: string[];
598
+ examples?: string[] | undefined;
599
+ inputModes?: string[] | undefined;
600
+ outputModes?: string[] | undefined;
601
+ security?: Record<string, string[]>[] | undefined;
602
+ }[];
603
+ instructions: string;
604
+ id?: string | undefined;
605
+ url?: string | undefined;
606
+ security?: Record<string, string[]>[] | undefined;
607
+ protocolVersion?: string | undefined;
608
+ preferredTransport?: string | undefined;
609
+ additionalInterfaces?: {
610
+ url: string;
611
+ transport: string;
612
+ }[] | undefined;
613
+ iconUrl?: string | undefined;
614
+ provider?: {
615
+ url: string;
616
+ organization: string;
617
+ } | undefined;
618
+ documentationUrl?: string | undefined;
619
+ capabilities?: {
620
+ extensions?: {
621
+ uri: string;
622
+ required?: boolean | undefined;
623
+ description?: string | undefined;
624
+ params?: Record<string, unknown> | undefined;
625
+ }[] | undefined;
626
+ streaming?: boolean | undefined;
627
+ pushNotifications?: boolean | undefined;
628
+ stateTransitionHistory?: boolean | undefined;
629
+ } | undefined;
630
+ securitySchemes?: Record<string, {
631
+ name: string;
632
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
633
+ in: "header" | "query" | "cookie";
634
+ description?: string | undefined;
635
+ } | {
636
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
637
+ scheme: string;
638
+ description?: string | undefined;
639
+ bearerFormat?: string | undefined;
640
+ } | {
641
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
642
+ flows: {
643
+ authorizationCode?: {
644
+ authorizationUrl: string;
645
+ tokenUrl: string;
646
+ scopes: Record<string, string>;
647
+ refreshUrl?: string | undefined;
648
+ } | undefined;
649
+ clientCredentials?: {
650
+ tokenUrl: string;
651
+ scopes: Record<string, string>;
652
+ refreshUrl?: string | undefined;
653
+ } | undefined;
654
+ implicit?: {
655
+ authorizationUrl: string;
656
+ scopes: Record<string, string>;
657
+ refreshUrl?: string | undefined;
658
+ } | undefined;
659
+ password?: {
660
+ tokenUrl: string;
661
+ scopes: Record<string, string>;
662
+ refreshUrl?: string | undefined;
663
+ } | undefined;
664
+ };
665
+ description?: string | undefined;
666
+ oauth2MetadataUrl?: string | undefined;
667
+ } | {
668
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
669
+ openIdConnectUrl: string;
670
+ description?: string | undefined;
671
+ } | {
672
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
673
+ description?: string | undefined;
674
+ }> | undefined;
675
+ defaultInputModes?: string[] | undefined;
676
+ defaultOutputModes?: string[] | undefined;
677
+ supportsAuthenticatedExtendedCard?: boolean | undefined;
678
+ signatures?: {
679
+ protected: string;
680
+ signature: string;
681
+ header?: Record<string, unknown> | undefined;
682
+ }[] | undefined;
683
+ modelId?: string | undefined;
684
+ toolIds?: string[] | undefined;
685
+ agentIds?: string[] | undefined;
686
+ groupIds?: (string | {
687
+ id: string;
688
+ properties?: Record<string, unknown> | undefined;
689
+ })[] | undefined;
690
+ }>;
691
+ export type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;
692
+ /**
693
+ * Agent configuration schema
694
+ *
695
+ * Extends AgentDefinition with deployment-specific configuration including
696
+ * server connections and runtime metadata. This schema represents the full
697
+ * configuration needed to instantiate and run an agent in a specific environment.
698
+ *
699
+ * Use this when:
700
+ * - Deploying an agent to a runtime environment
701
+ * - Connecting to specific MCP or A2A servers
702
+ * - Adding environment-specific metadata
703
+ *
704
+ * @example
705
+ * ```typescript
706
+ * const config: AgentConfiguration = {
707
+ * // AgentDefinition fields
708
+ * id: "backend-architect",
709
+ * name: "Backend System Architect",
710
+ * description: "Design RESTful APIs and microservice architectures",
711
+ * model: "openai/gpt-4",
712
+ * toolIds: ["filesystem", "database-analyzer"],
713
+ * instructions: "You are a backend system architect...",
714
+ *
715
+ * // Configuration-specific fields
716
+ * servers: [
717
+ * {
718
+ * type: "mcp",
719
+ * id: "filesystem",
720
+ * url: "http://localhost:3000/mcp/filesystem"
721
+ * },
722
+ * {
723
+ * type: "a2a",
724
+ * id: "database-specialist",
725
+ * url: "https://agents.example.com/database-specialist"
726
+ * }
727
+ * ],
728
+ * metadata: {
729
+ * environment: "production",
730
+ * region: "us-east-1",
731
+ * version: "1.2.3"
732
+ * }
733
+ * }
734
+ * ```
735
+ */
736
+ export declare const AgentConfigurationSchema: z.ZodObject<{
737
+ name: z.ZodString;
738
+ url: z.ZodOptional<z.ZodString>;
739
+ description: z.ZodString;
740
+ version: z.ZodString;
741
+ security: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, "many">>;
742
+ protocolVersion: z.ZodOptional<z.ZodDefault<z.ZodString>>;
743
+ preferredTransport: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["JSONRPC", "GRPC", "HTTP+JSON"]>, z.ZodString]>>;
744
+ additionalInterfaces: z.ZodOptional<z.ZodArray<z.ZodObject<{
745
+ url: z.ZodString;
746
+ transport: z.ZodUnion<[z.ZodEnum<["JSONRPC", "GRPC", "HTTP+JSON"]>, z.ZodString]>;
747
+ }, "strip", z.ZodTypeAny, {
748
+ url: string;
749
+ transport: string;
750
+ }, {
751
+ url: string;
752
+ transport: string;
753
+ }>, "many">>;
754
+ iconUrl: z.ZodOptional<z.ZodString>;
755
+ provider: z.ZodOptional<z.ZodObject<{
756
+ organization: z.ZodString;
757
+ url: z.ZodString;
758
+ }, "strip", z.ZodTypeAny, {
759
+ url: string;
760
+ organization: string;
761
+ }, {
762
+ url: string;
763
+ organization: string;
764
+ }>>;
765
+ documentationUrl: z.ZodOptional<z.ZodString>;
766
+ capabilities: z.ZodOptional<z.ZodObject<{
767
+ streaming: z.ZodOptional<z.ZodBoolean>;
768
+ pushNotifications: z.ZodOptional<z.ZodBoolean>;
769
+ stateTransitionHistory: z.ZodOptional<z.ZodBoolean>;
770
+ extensions: z.ZodOptional<z.ZodArray<z.ZodObject<{
771
+ uri: z.ZodString;
772
+ description: z.ZodOptional<z.ZodString>;
773
+ required: z.ZodOptional<z.ZodBoolean>;
774
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
775
+ }, "strip", z.ZodTypeAny, {
776
+ uri: string;
777
+ required?: boolean | undefined;
778
+ description?: string | undefined;
779
+ params?: Record<string, unknown> | undefined;
780
+ }, {
781
+ uri: string;
782
+ required?: boolean | undefined;
783
+ description?: string | undefined;
784
+ params?: Record<string, unknown> | undefined;
785
+ }>, "many">>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ extensions?: {
788
+ uri: string;
789
+ required?: boolean | undefined;
790
+ description?: string | undefined;
791
+ params?: Record<string, unknown> | undefined;
792
+ }[] | undefined;
793
+ streaming?: boolean | undefined;
794
+ pushNotifications?: boolean | undefined;
795
+ stateTransitionHistory?: boolean | undefined;
796
+ }, {
797
+ extensions?: {
798
+ uri: string;
799
+ required?: boolean | undefined;
800
+ description?: string | undefined;
801
+ params?: Record<string, unknown> | undefined;
802
+ }[] | undefined;
803
+ streaming?: boolean | undefined;
804
+ pushNotifications?: boolean | undefined;
805
+ stateTransitionHistory?: boolean | undefined;
806
+ }>>;
807
+ securitySchemes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
808
+ description: z.ZodOptional<z.ZodString>;
809
+ } & {
810
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "apiKey", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
811
+ in: z.ZodEnum<["query", "header", "cookie"]>;
812
+ name: z.ZodString;
813
+ }, "strip", z.ZodTypeAny, {
814
+ name: string;
815
+ type: "apiKey";
816
+ in: "header" | "query" | "cookie";
817
+ description?: string | undefined;
818
+ }, {
819
+ name: string;
820
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
821
+ in: "header" | "query" | "cookie";
822
+ description?: string | undefined;
823
+ }>, z.ZodObject<{
824
+ description: z.ZodOptional<z.ZodString>;
825
+ } & {
826
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "http", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
827
+ scheme: z.ZodString;
828
+ bearerFormat: z.ZodOptional<z.ZodString>;
829
+ }, "strip", z.ZodTypeAny, {
830
+ type: "http";
831
+ scheme: string;
832
+ description?: string | undefined;
833
+ bearerFormat?: string | undefined;
834
+ }, {
835
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
836
+ scheme: string;
837
+ description?: string | undefined;
838
+ bearerFormat?: string | undefined;
839
+ }>, z.ZodObject<{
840
+ description: z.ZodOptional<z.ZodString>;
841
+ } & {
842
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "oauth2", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
843
+ flows: z.ZodObject<{
844
+ authorizationCode: z.ZodOptional<z.ZodObject<{
845
+ authorizationUrl: z.ZodString;
846
+ tokenUrl: z.ZodString;
847
+ refreshUrl: z.ZodOptional<z.ZodString>;
848
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
849
+ }, "strip", z.ZodTypeAny, {
850
+ authorizationUrl: string;
851
+ tokenUrl: string;
852
+ scopes: Record<string, string>;
853
+ refreshUrl?: string | undefined;
854
+ }, {
855
+ authorizationUrl: string;
856
+ tokenUrl: string;
857
+ scopes: Record<string, string>;
858
+ refreshUrl?: string | undefined;
859
+ }>>;
860
+ clientCredentials: z.ZodOptional<z.ZodObject<{
861
+ tokenUrl: z.ZodString;
862
+ refreshUrl: z.ZodOptional<z.ZodString>;
863
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
864
+ }, "strip", z.ZodTypeAny, {
865
+ tokenUrl: string;
866
+ scopes: Record<string, string>;
867
+ refreshUrl?: string | undefined;
868
+ }, {
869
+ tokenUrl: string;
870
+ scopes: Record<string, string>;
871
+ refreshUrl?: string | undefined;
872
+ }>>;
873
+ implicit: z.ZodOptional<z.ZodObject<{
874
+ authorizationUrl: z.ZodString;
875
+ refreshUrl: z.ZodOptional<z.ZodString>;
876
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
877
+ }, "strip", z.ZodTypeAny, {
878
+ authorizationUrl: string;
879
+ scopes: Record<string, string>;
880
+ refreshUrl?: string | undefined;
881
+ }, {
882
+ authorizationUrl: string;
883
+ scopes: Record<string, string>;
884
+ refreshUrl?: string | undefined;
885
+ }>>;
886
+ password: z.ZodOptional<z.ZodObject<{
887
+ tokenUrl: z.ZodString;
888
+ refreshUrl: z.ZodOptional<z.ZodString>;
889
+ scopes: z.ZodRecord<z.ZodString, z.ZodString>;
890
+ }, "strip", z.ZodTypeAny, {
891
+ tokenUrl: string;
892
+ scopes: Record<string, string>;
893
+ refreshUrl?: string | undefined;
894
+ }, {
895
+ tokenUrl: string;
896
+ scopes: Record<string, string>;
897
+ refreshUrl?: string | undefined;
898
+ }>>;
899
+ }, "strip", z.ZodTypeAny, {
900
+ authorizationCode?: {
901
+ authorizationUrl: string;
902
+ tokenUrl: string;
903
+ scopes: Record<string, string>;
904
+ refreshUrl?: string | undefined;
905
+ } | undefined;
906
+ clientCredentials?: {
907
+ tokenUrl: string;
908
+ scopes: Record<string, string>;
909
+ refreshUrl?: string | undefined;
910
+ } | undefined;
911
+ implicit?: {
912
+ authorizationUrl: string;
913
+ scopes: Record<string, string>;
914
+ refreshUrl?: string | undefined;
915
+ } | undefined;
916
+ password?: {
917
+ tokenUrl: string;
918
+ scopes: Record<string, string>;
919
+ refreshUrl?: string | undefined;
920
+ } | undefined;
921
+ }, {
922
+ authorizationCode?: {
923
+ authorizationUrl: string;
924
+ tokenUrl: string;
925
+ scopes: Record<string, string>;
926
+ refreshUrl?: string | undefined;
927
+ } | undefined;
928
+ clientCredentials?: {
929
+ tokenUrl: string;
930
+ scopes: Record<string, string>;
931
+ refreshUrl?: string | undefined;
932
+ } | undefined;
933
+ implicit?: {
934
+ authorizationUrl: string;
935
+ scopes: Record<string, string>;
936
+ refreshUrl?: string | undefined;
937
+ } | undefined;
938
+ password?: {
939
+ tokenUrl: string;
940
+ scopes: Record<string, string>;
941
+ refreshUrl?: string | undefined;
942
+ } | undefined;
943
+ }>;
944
+ oauth2MetadataUrl: z.ZodOptional<z.ZodString>;
945
+ }, "strip", z.ZodTypeAny, {
946
+ type: "oauth2";
947
+ flows: {
948
+ authorizationCode?: {
949
+ authorizationUrl: string;
950
+ tokenUrl: string;
951
+ scopes: Record<string, string>;
952
+ refreshUrl?: string | undefined;
953
+ } | undefined;
954
+ clientCredentials?: {
955
+ tokenUrl: string;
956
+ scopes: Record<string, string>;
957
+ refreshUrl?: string | undefined;
958
+ } | undefined;
959
+ implicit?: {
960
+ authorizationUrl: string;
961
+ scopes: Record<string, string>;
962
+ refreshUrl?: string | undefined;
963
+ } | undefined;
964
+ password?: {
965
+ tokenUrl: string;
966
+ scopes: Record<string, string>;
967
+ refreshUrl?: string | undefined;
968
+ } | undefined;
969
+ };
970
+ description?: string | undefined;
971
+ oauth2MetadataUrl?: string | undefined;
972
+ }, {
973
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
974
+ flows: {
975
+ authorizationCode?: {
976
+ authorizationUrl: string;
977
+ tokenUrl: string;
978
+ scopes: Record<string, string>;
979
+ refreshUrl?: string | undefined;
980
+ } | undefined;
981
+ clientCredentials?: {
982
+ tokenUrl: string;
983
+ scopes: Record<string, string>;
984
+ refreshUrl?: string | undefined;
985
+ } | undefined;
986
+ implicit?: {
987
+ authorizationUrl: string;
988
+ scopes: Record<string, string>;
989
+ refreshUrl?: string | undefined;
990
+ } | undefined;
991
+ password?: {
992
+ tokenUrl: string;
993
+ scopes: Record<string, string>;
994
+ refreshUrl?: string | undefined;
995
+ } | undefined;
996
+ };
997
+ description?: string | undefined;
998
+ oauth2MetadataUrl?: string | undefined;
999
+ }>, z.ZodObject<{
1000
+ description: z.ZodOptional<z.ZodString>;
1001
+ } & {
1002
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "openIdConnect", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
1003
+ openIdConnectUrl: z.ZodString;
1004
+ }, "strip", z.ZodTypeAny, {
1005
+ type: "openIdConnect";
1006
+ openIdConnectUrl: string;
1007
+ description?: string | undefined;
1008
+ }, {
1009
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1010
+ openIdConnectUrl: string;
1011
+ description?: string | undefined;
1012
+ }>, z.ZodObject<{
1013
+ description: z.ZodOptional<z.ZodString>;
1014
+ } & {
1015
+ type: z.ZodEffects<z.ZodEnum<["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]>, "mutualTLS", "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect">;
1016
+ }, "strip", z.ZodTypeAny, {
1017
+ type: "mutualTLS";
1018
+ description?: string | undefined;
1019
+ }, {
1020
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1021
+ description?: string | undefined;
1022
+ }>]>>>;
1023
+ defaultInputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1024
+ defaultOutputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1025
+ skills: z.ZodArray<z.ZodObject<{
1026
+ id: z.ZodString;
1027
+ name: z.ZodString;
1028
+ description: z.ZodString;
1029
+ tags: z.ZodArray<z.ZodString, "many">;
1030
+ examples: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1031
+ inputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1032
+ outputModes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1033
+ security: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, "many">>;
1034
+ }, "strip", z.ZodTypeAny, {
1035
+ name: string;
1036
+ id: string;
1037
+ description: string;
1038
+ tags: string[];
1039
+ examples?: string[] | undefined;
1040
+ inputModes?: string[] | undefined;
1041
+ outputModes?: string[] | undefined;
1042
+ security?: Record<string, string[]>[] | undefined;
1043
+ }, {
1044
+ name: string;
1045
+ id: string;
1046
+ description: string;
1047
+ tags: string[];
1048
+ examples?: string[] | undefined;
1049
+ inputModes?: string[] | undefined;
1050
+ outputModes?: string[] | undefined;
1051
+ security?: Record<string, string[]>[] | undefined;
1052
+ }>, "many">;
1053
+ supportsAuthenticatedExtendedCard: z.ZodOptional<z.ZodBoolean>;
1054
+ signatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
1055
+ protected: z.ZodString;
1056
+ signature: z.ZodString;
1057
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1058
+ }, "strip", z.ZodTypeAny, {
1059
+ protected: string;
1060
+ signature: string;
1061
+ header?: Record<string, unknown> | undefined;
1062
+ }, {
1063
+ protected: string;
1064
+ signature: string;
1065
+ header?: Record<string, unknown> | undefined;
1066
+ }>, "many">>;
1067
+ } & {
1068
+ /**
1069
+ * Optional agent ID - will be generated if not provided
1070
+ *
1071
+ * Use kebab-case for consistency (e.g., 'backend-architect', 'code-reviewer')
1072
+ */
1073
+ id: z.ZodOptional<z.ZodString>;
1074
+ /**
1075
+ * Optional model specification
1076
+ *
1077
+ * Specifies the LLM model to use for this agent.
1078
+ *
1079
+ * @example "openai/gpt-4o-mini"
1080
+ * @example "anthropic/claude-3-opus-20241022"
1081
+ * @example "deepseek-ai/DeepSeek-R1"
1082
+ */
1083
+ modelId: z.ZodOptional<z.ZodString>;
1084
+ /**
1085
+ * Tool IDs that this agent can use
1086
+ *
1087
+ * A flexible list of tool identifiers that reference MCP servers, in-memory
1088
+ * functions, or any other tool providers available in the runtime environment.
1089
+ * Tools are resolved by the agent runtime based on these IDs.
1090
+ *
1091
+ * @example ["filesystem", "web-search", "code-analyzer"]
1092
+ * @example ["mcp-server-git", "mcp-server-postgres", "custom-api-client"]
1093
+ */
1094
+ toolIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1095
+ /**
1096
+ * Agent IDs that this agent can call
1097
+ *
1098
+ * Explicitly defines which other agents this agent has permission to invoke.
1099
+ * These could be local agent instances, remote agent servers, or any agent
1100
+ * accessible in the runtime environment. This provides explicit access control
1101
+ * separate from group membership.
1102
+ *
1103
+ * @example ["database-specialist", "security-auditor", "code-reviewer"]
1104
+ * @example ["agent://team-lead", "https://agents.example.com/research"]
1105
+ */
1106
+ agentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1107
+ /**
1108
+ * Groups that this agent belongs to
1109
+ *
1110
+ * Defines organizational membership for discovery, coordination, and management.
1111
+ * Groups can represent teams, projects, clusters, departments, or any arbitrary
1112
+ * organizational structure. Supports both simple string IDs and rich objects
1113
+ * with properties.
1114
+ *
1115
+ * @example
1116
+ * // Simple string references
1117
+ * ["team:backend", "project:api-v2", "cluster:production"]
1118
+ *
1119
+ * @example
1120
+ * // Rich objects with properties
1121
+ * [
1122
+ * { id: "team:backend", properties: { role: "lead", tier: "senior" } },
1123
+ * { id: "project:api-v2", properties: { status: "active", priority: 1 } }
1124
+ * ]
1125
+ */
1126
+ groupIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
1127
+ id: z.ZodString;
1128
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1129
+ }, "strip", z.ZodTypeAny, {
1130
+ id: string;
1131
+ properties?: Record<string, unknown> | undefined;
1132
+ }, {
1133
+ id: string;
1134
+ properties?: Record<string, unknown> | undefined;
1135
+ }>]>, "many">>>;
1136
+ /**
1137
+ * System instructions for the agent
1138
+ *
1139
+ * The core prompt that defines the agent's behavior, expertise, methodology,
1140
+ * and output format. This is typically provided in the markdown body of an
1141
+ * agent.md file and defines the agent's persona and capabilities.
1142
+ *
1143
+ * @example
1144
+ * ```
1145
+ * You are a backend system architect specializing in scalable API design.
1146
+ *
1147
+ * ## Focus Areas
1148
+ * - RESTful API design with proper versioning
1149
+ * - Microservice boundaries and communication patterns
1150
+ * - Database schema design and optimization
1151
+ *
1152
+ * ## Methodology
1153
+ * 1. Analyze requirements and constraints
1154
+ * 2. Design contract-first APIs
1155
+ * 3. Consider scalability from day one
1156
+ * ```
1157
+ */
1158
+ instructions: z.ZodString;
1159
+ } & {
1160
+ /**
1161
+ * Service connections for this agent
1162
+ *
1163
+ * Defines the actual service endpoints for MCP tool services and A2A agent services
1164
+ * that this agent will connect to at runtime. Each service must have a type,
1165
+ * unique ID, and connection URL.
1166
+ *
1167
+ * @example
1168
+ * [
1169
+ * { type: "mcp", id: "filesystem", url: "http://localhost:3000/mcp/fs" },
1170
+ * { type: "a2a", id: "researcher", url: "https://agents.example.com/research" }
1171
+ * { type: "a2a", uri: "local-agent-id", parameters: { name: "John Doe" } }
1172
+ * ]
1173
+ */
1174
+ services: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
1175
+ id: z.ZodString;
1176
+ url: z.ZodString;
1177
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1178
+ authToken: z.ZodOptional<z.ZodString>;
1179
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1180
+ } & {
1181
+ type: z.ZodDefault<z.ZodLiteral<"a2a">>;
1182
+ }, "strip", z.ZodTypeAny, {
1183
+ type: "a2a";
1184
+ id: string;
1185
+ url: string;
1186
+ headers?: Record<string, string> | undefined;
1187
+ authToken?: string | undefined;
1188
+ parameters?: Record<string, unknown> | undefined;
1189
+ }, {
1190
+ id: string;
1191
+ url: string;
1192
+ type?: "a2a" | undefined;
1193
+ headers?: Record<string, string> | undefined;
1194
+ authToken?: string | undefined;
1195
+ parameters?: Record<string, unknown> | undefined;
1196
+ }>, z.ZodObject<Omit<{
1197
+ id: z.ZodString;
1198
+ url: z.ZodString;
1199
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1200
+ authToken: z.ZodOptional<z.ZodString>;
1201
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1202
+ } & {
1203
+ type: z.ZodDefault<z.ZodLiteral<"a2a">>;
1204
+ }, "url" | "headers"> & {
1205
+ uri: z.ZodString;
1206
+ }, "strip", z.ZodTypeAny, {
1207
+ type: "a2a";
1208
+ id: string;
1209
+ uri: string;
1210
+ authToken?: string | undefined;
1211
+ parameters?: Record<string, unknown> | undefined;
1212
+ }, {
1213
+ id: string;
1214
+ uri: string;
1215
+ type?: "a2a" | undefined;
1216
+ authToken?: string | undefined;
1217
+ parameters?: Record<string, unknown> | undefined;
1218
+ }>]>, z.ZodUnion<[z.ZodObject<{
1219
+ id: z.ZodString;
1220
+ url: z.ZodString;
1221
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1222
+ authToken: z.ZodOptional<z.ZodString>;
1223
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1224
+ } & {
1225
+ type: z.ZodDefault<z.ZodLiteral<"mcp">>;
1226
+ }, "strip", z.ZodTypeAny, {
1227
+ type: "mcp";
1228
+ id: string;
1229
+ url: string;
1230
+ headers?: Record<string, string> | undefined;
1231
+ authToken?: string | undefined;
1232
+ parameters?: Record<string, unknown> | undefined;
1233
+ }, {
1234
+ id: string;
1235
+ url: string;
1236
+ type?: "mcp" | undefined;
1237
+ headers?: Record<string, string> | undefined;
1238
+ authToken?: string | undefined;
1239
+ parameters?: Record<string, unknown> | undefined;
1240
+ }>, z.ZodObject<Omit<{
1241
+ id: z.ZodString;
1242
+ url: z.ZodString;
1243
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1244
+ authToken: z.ZodOptional<z.ZodString>;
1245
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1246
+ } & {
1247
+ type: z.ZodDefault<z.ZodLiteral<"mcp">>;
1248
+ }, "url" | "headers"> & {
1249
+ uri: z.ZodString;
1250
+ command: z.ZodString;
1251
+ args: z.ZodArray<z.ZodString, "many">;
1252
+ }, "strip", z.ZodTypeAny, {
1253
+ type: "mcp";
1254
+ id: string;
1255
+ args: string[];
1256
+ uri: string;
1257
+ command: string;
1258
+ authToken?: string | undefined;
1259
+ parameters?: Record<string, unknown> | undefined;
1260
+ }, {
1261
+ id: string;
1262
+ args: string[];
1263
+ uri: string;
1264
+ command: string;
1265
+ type?: "mcp" | undefined;
1266
+ authToken?: string | undefined;
1267
+ parameters?: Record<string, unknown> | undefined;
1268
+ }>]>]>, "many">>;
1269
+ /**
1270
+ * Runtime metadata for the agent
1271
+ *
1272
+ * Arbitrary key-value pairs for environment-specific configuration, tracking,
1273
+ * or runtime behavior customization. Common uses include environment tags,
1274
+ * version tracking, deployment information, or feature flags.
1275
+ *
1276
+ * @example
1277
+ * {
1278
+ * environment: "production",
1279
+ * region: "us-east-1",
1280
+ * deployedBy: "ci-pipeline",
1281
+ * deployedAt: "2025-01-15T10:30:00Z",
1282
+ * version: "1.2.3"
1283
+ * }
1284
+ */
1285
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1286
+ }, "strip", z.ZodTypeAny, {
1287
+ name: string;
1288
+ description: string;
1289
+ version: string;
1290
+ skills: {
1291
+ name: string;
1292
+ id: string;
1293
+ description: string;
1294
+ tags: string[];
1295
+ examples?: string[] | undefined;
1296
+ inputModes?: string[] | undefined;
1297
+ outputModes?: string[] | undefined;
1298
+ security?: Record<string, string[]>[] | undefined;
1299
+ }[];
1300
+ instructions: string;
1301
+ toolIds: string[];
1302
+ groupIds: (string | {
1303
+ id: string;
1304
+ properties?: Record<string, unknown> | undefined;
1305
+ })[];
1306
+ services: ({
1307
+ type: "a2a";
1308
+ id: string;
1309
+ url: string;
1310
+ headers?: Record<string, string> | undefined;
1311
+ authToken?: string | undefined;
1312
+ parameters?: Record<string, unknown> | undefined;
1313
+ } | {
1314
+ type: "a2a";
1315
+ id: string;
1316
+ uri: string;
1317
+ authToken?: string | undefined;
1318
+ parameters?: Record<string, unknown> | undefined;
1319
+ } | {
1320
+ type: "mcp";
1321
+ id: string;
1322
+ url: string;
1323
+ headers?: Record<string, string> | undefined;
1324
+ authToken?: string | undefined;
1325
+ parameters?: Record<string, unknown> | undefined;
1326
+ } | {
1327
+ type: "mcp";
1328
+ id: string;
1329
+ args: string[];
1330
+ uri: string;
1331
+ command: string;
1332
+ authToken?: string | undefined;
1333
+ parameters?: Record<string, unknown> | undefined;
1334
+ })[];
1335
+ id?: string | undefined;
1336
+ url?: string | undefined;
1337
+ metadata?: Record<string, string> | undefined;
1338
+ security?: Record<string, string[]>[] | undefined;
1339
+ protocolVersion?: string | undefined;
1340
+ preferredTransport?: string | undefined;
1341
+ additionalInterfaces?: {
1342
+ url: string;
1343
+ transport: string;
1344
+ }[] | undefined;
1345
+ iconUrl?: string | undefined;
1346
+ provider?: {
1347
+ url: string;
1348
+ organization: string;
1349
+ } | undefined;
1350
+ documentationUrl?: string | undefined;
1351
+ capabilities?: {
1352
+ extensions?: {
1353
+ uri: string;
1354
+ required?: boolean | undefined;
1355
+ description?: string | undefined;
1356
+ params?: Record<string, unknown> | undefined;
1357
+ }[] | undefined;
1358
+ streaming?: boolean | undefined;
1359
+ pushNotifications?: boolean | undefined;
1360
+ stateTransitionHistory?: boolean | undefined;
1361
+ } | undefined;
1362
+ securitySchemes?: Record<string, {
1363
+ name: string;
1364
+ type: "apiKey";
1365
+ in: "header" | "query" | "cookie";
1366
+ description?: string | undefined;
1367
+ } | {
1368
+ type: "http";
1369
+ scheme: string;
1370
+ description?: string | undefined;
1371
+ bearerFormat?: string | undefined;
1372
+ } | {
1373
+ type: "oauth2";
1374
+ flows: {
1375
+ authorizationCode?: {
1376
+ authorizationUrl: string;
1377
+ tokenUrl: string;
1378
+ scopes: Record<string, string>;
1379
+ refreshUrl?: string | undefined;
1380
+ } | undefined;
1381
+ clientCredentials?: {
1382
+ tokenUrl: string;
1383
+ scopes: Record<string, string>;
1384
+ refreshUrl?: string | undefined;
1385
+ } | undefined;
1386
+ implicit?: {
1387
+ authorizationUrl: string;
1388
+ scopes: Record<string, string>;
1389
+ refreshUrl?: string | undefined;
1390
+ } | undefined;
1391
+ password?: {
1392
+ tokenUrl: string;
1393
+ scopes: Record<string, string>;
1394
+ refreshUrl?: string | undefined;
1395
+ } | undefined;
1396
+ };
1397
+ description?: string | undefined;
1398
+ oauth2MetadataUrl?: string | undefined;
1399
+ } | {
1400
+ type: "openIdConnect";
1401
+ openIdConnectUrl: string;
1402
+ description?: string | undefined;
1403
+ } | {
1404
+ type: "mutualTLS";
1405
+ description?: string | undefined;
1406
+ }> | undefined;
1407
+ defaultInputModes?: string[] | undefined;
1408
+ defaultOutputModes?: string[] | undefined;
1409
+ supportsAuthenticatedExtendedCard?: boolean | undefined;
1410
+ signatures?: {
1411
+ protected: string;
1412
+ signature: string;
1413
+ header?: Record<string, unknown> | undefined;
1414
+ }[] | undefined;
1415
+ modelId?: string | undefined;
1416
+ agentIds?: string[] | undefined;
1417
+ }, {
1418
+ name: string;
1419
+ description: string;
1420
+ version: string;
1421
+ skills: {
1422
+ name: string;
1423
+ id: string;
1424
+ description: string;
1425
+ tags: string[];
1426
+ examples?: string[] | undefined;
1427
+ inputModes?: string[] | undefined;
1428
+ outputModes?: string[] | undefined;
1429
+ security?: Record<string, string[]>[] | undefined;
1430
+ }[];
1431
+ instructions: string;
1432
+ id?: string | undefined;
1433
+ url?: string | undefined;
1434
+ metadata?: Record<string, string> | undefined;
1435
+ security?: Record<string, string[]>[] | undefined;
1436
+ protocolVersion?: string | undefined;
1437
+ preferredTransport?: string | undefined;
1438
+ additionalInterfaces?: {
1439
+ url: string;
1440
+ transport: string;
1441
+ }[] | undefined;
1442
+ iconUrl?: string | undefined;
1443
+ provider?: {
1444
+ url: string;
1445
+ organization: string;
1446
+ } | undefined;
1447
+ documentationUrl?: string | undefined;
1448
+ capabilities?: {
1449
+ extensions?: {
1450
+ uri: string;
1451
+ required?: boolean | undefined;
1452
+ description?: string | undefined;
1453
+ params?: Record<string, unknown> | undefined;
1454
+ }[] | undefined;
1455
+ streaming?: boolean | undefined;
1456
+ pushNotifications?: boolean | undefined;
1457
+ stateTransitionHistory?: boolean | undefined;
1458
+ } | undefined;
1459
+ securitySchemes?: Record<string, {
1460
+ name: string;
1461
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1462
+ in: "header" | "query" | "cookie";
1463
+ description?: string | undefined;
1464
+ } | {
1465
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1466
+ scheme: string;
1467
+ description?: string | undefined;
1468
+ bearerFormat?: string | undefined;
1469
+ } | {
1470
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1471
+ flows: {
1472
+ authorizationCode?: {
1473
+ authorizationUrl: string;
1474
+ tokenUrl: string;
1475
+ scopes: Record<string, string>;
1476
+ refreshUrl?: string | undefined;
1477
+ } | undefined;
1478
+ clientCredentials?: {
1479
+ tokenUrl: string;
1480
+ scopes: Record<string, string>;
1481
+ refreshUrl?: string | undefined;
1482
+ } | undefined;
1483
+ implicit?: {
1484
+ authorizationUrl: string;
1485
+ scopes: Record<string, string>;
1486
+ refreshUrl?: string | undefined;
1487
+ } | undefined;
1488
+ password?: {
1489
+ tokenUrl: string;
1490
+ scopes: Record<string, string>;
1491
+ refreshUrl?: string | undefined;
1492
+ } | undefined;
1493
+ };
1494
+ description?: string | undefined;
1495
+ oauth2MetadataUrl?: string | undefined;
1496
+ } | {
1497
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1498
+ openIdConnectUrl: string;
1499
+ description?: string | undefined;
1500
+ } | {
1501
+ type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
1502
+ description?: string | undefined;
1503
+ }> | undefined;
1504
+ defaultInputModes?: string[] | undefined;
1505
+ defaultOutputModes?: string[] | undefined;
1506
+ supportsAuthenticatedExtendedCard?: boolean | undefined;
1507
+ signatures?: {
1508
+ protected: string;
1509
+ signature: string;
1510
+ header?: Record<string, unknown> | undefined;
1511
+ }[] | undefined;
1512
+ modelId?: string | undefined;
1513
+ toolIds?: string[] | undefined;
1514
+ agentIds?: string[] | undefined;
1515
+ groupIds?: (string | {
1516
+ id: string;
1517
+ properties?: Record<string, unknown> | undefined;
1518
+ })[] | undefined;
1519
+ services?: ({
1520
+ id: string;
1521
+ url: string;
1522
+ type?: "a2a" | undefined;
1523
+ headers?: Record<string, string> | undefined;
1524
+ authToken?: string | undefined;
1525
+ parameters?: Record<string, unknown> | undefined;
1526
+ } | {
1527
+ id: string;
1528
+ uri: string;
1529
+ type?: "a2a" | undefined;
1530
+ authToken?: string | undefined;
1531
+ parameters?: Record<string, unknown> | undefined;
1532
+ } | {
1533
+ id: string;
1534
+ url: string;
1535
+ type?: "mcp" | undefined;
1536
+ headers?: Record<string, string> | undefined;
1537
+ authToken?: string | undefined;
1538
+ parameters?: Record<string, unknown> | undefined;
1539
+ } | {
1540
+ id: string;
1541
+ args: string[];
1542
+ uri: string;
1543
+ command: string;
1544
+ type?: "mcp" | undefined;
1545
+ authToken?: string | undefined;
1546
+ parameters?: Record<string, unknown> | undefined;
1547
+ })[] | undefined;
1548
+ }>;
1549
+ export type AgentConfiguration = z.infer<typeof AgentConfigurationSchema>;