@agen-ai/agent-protocol 0.2.4 → 0.3.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 (90) hide show
  1. package/README.md +57 -13
  2. package/dist/accountQuota/index.d.ts +3 -0
  3. package/dist/accountQuota/index.js +2 -0
  4. package/dist/accountQuota/parsers.d.ts +7 -0
  5. package/dist/accountQuota/parsers.js +20 -0
  6. package/dist/accountQuota/types.d.ts +89 -0
  7. package/dist/accountQuota/types.js +12 -0
  8. package/dist/capabilities/contentReferenceText.d.ts +13 -0
  9. package/dist/capabilities/contentReferenceText.js +25 -0
  10. package/dist/capabilities/index.d.ts +1 -0
  11. package/dist/capabilities/index.js +1 -0
  12. package/dist/capabilities/types.d.ts +19 -1
  13. package/dist/capabilities/types.js +6 -0
  14. package/dist/commands/index.d.ts +3 -0
  15. package/dist/commands/index.js +2 -0
  16. package/dist/commands/parsers.d.ts +7 -0
  17. package/dist/commands/parsers.js +23 -0
  18. package/dist/commands/types.d.ts +26 -0
  19. package/dist/commands/types.js +10 -0
  20. package/dist/effectiveContent/index.d.ts +3 -0
  21. package/dist/effectiveContent/index.js +2 -0
  22. package/dist/effectiveContent/parsers.d.ts +7 -0
  23. package/dist/effectiveContent/parsers.js +23 -0
  24. package/dist/effectiveContent/types.d.ts +35 -0
  25. package/dist/effectiveContent/types.js +19 -0
  26. package/dist/environment/facts.d.ts +28 -0
  27. package/dist/environment/facts.js +39 -0
  28. package/dist/environment/index.d.ts +4 -0
  29. package/dist/environment/index.js +3 -0
  30. package/dist/environment/parsers.d.ts +17 -0
  31. package/dist/environment/parsers.js +68 -0
  32. package/dist/environment/types.d.ts +61 -0
  33. package/dist/environment/types.js +26 -0
  34. package/dist/events/types.d.ts +1 -1
  35. package/dist/extensions/index.d.ts +3 -0
  36. package/dist/extensions/index.js +2 -0
  37. package/dist/extensions/parsers.d.ts +7 -0
  38. package/dist/extensions/parsers.js +23 -0
  39. package/dist/extensions/types.d.ts +73 -0
  40. package/dist/extensions/types.js +30 -0
  41. package/dist/foundation/parsers.d.ts +9 -1
  42. package/dist/foundation/parsers.js +24 -0
  43. package/dist/foundation/types.d.ts +5 -1
  44. package/dist/foundation/types.js +1 -1
  45. package/dist/integrations/types.d.ts +22 -4
  46. package/dist/integrations/types.js +6 -2
  47. package/dist/jsonSchema/generated.d.ts +9893 -5474
  48. package/dist/jsonSchema/generated.js +3097 -154
  49. package/dist/public/accountQuota.d.ts +2 -0
  50. package/dist/public/accountQuota.js +1 -0
  51. package/dist/public/commands.d.ts +2 -0
  52. package/dist/public/commands.js +1 -0
  53. package/dist/public/effectiveContent.d.ts +2 -0
  54. package/dist/public/effectiveContent.js +1 -0
  55. package/dist/public/environment.d.ts +2 -0
  56. package/dist/public/environment.js +1 -0
  57. package/dist/public/extensions.d.ts +2 -0
  58. package/dist/public/extensions.js +1 -0
  59. package/dist/public/index.d.ts +5 -0
  60. package/dist/public/index.js +5 -0
  61. package/dist/turns/parsers.d.ts +3 -1
  62. package/dist/turns/parsers.js +9 -0
  63. package/dist/turns/types.d.ts +13 -2
  64. package/dist/turns/types.js +4 -0
  65. package/dist/zod/accountQuota.d.ts +265 -0
  66. package/dist/zod/accountQuota.js +155 -0
  67. package/dist/zod/capabilities.d.ts +79 -1
  68. package/dist/zod/capabilities.js +21 -5
  69. package/dist/zod/commands.d.ts +35 -0
  70. package/dist/zod/commands.js +114 -0
  71. package/dist/zod/effectiveContent.d.ts +72 -0
  72. package/dist/zod/effectiveContent.js +157 -0
  73. package/dist/zod/environment.d.ts +531 -0
  74. package/dist/zod/environment.js +336 -0
  75. package/dist/zod/environmentFacts.d.ts +10 -0
  76. package/dist/zod/environmentFacts.js +40 -0
  77. package/dist/zod/events.d.ts +23 -23
  78. package/dist/zod/extensions.d.ts +161 -0
  79. package/dist/zod/extensions.js +194 -0
  80. package/dist/zod/foundation.d.ts +6 -1
  81. package/dist/zod/foundation.js +12 -3
  82. package/dist/zod/index.d.ts +10 -4
  83. package/dist/zod/index.js +22 -2
  84. package/dist/zod/integrations.d.ts +54 -9
  85. package/dist/zod/integrations.js +49 -6
  86. package/dist/zod/resources.d.ts +2 -2
  87. package/dist/zod/turns.d.ts +33 -0
  88. package/dist/zod/turns.js +34 -1
  89. package/dist/zod/typeEquality.generated.d.ts +40 -4
  90. package/package.json +23 -3
@@ -42,6 +42,25 @@ export declare const AgentImageInputCapabilitySchema: z.ZodDiscriminatedUnion<[z
42
42
  maxPixelsPerImage: z.ZodNumber;
43
43
  supportsImageOnly: z.ZodBoolean;
44
44
  }, z.core.$strict>>], "kind">;
45
+ export declare const AgentContentReferenceInputCapabilitySchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
46
+ kind: z.ZodLiteral<"unsupported">;
47
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
48
+ kind: z.ZodLiteral<"supported">;
49
+ maxReferences: z.ZodNumber;
50
+ arguments: z.ZodBoolean;
51
+ textFormats: z.ZodReadonly<z.ZodObject<{
52
+ prompt: z.ZodEnum<{
53
+ unrestricted: "unrestricted";
54
+ single_line: "single_line";
55
+ literal_single_line: "literal_single_line";
56
+ }>;
57
+ arguments: z.ZodEnum<{
58
+ unrestricted: "unrestricted";
59
+ single_line: "single_line";
60
+ literal_single_line: "literal_single_line";
61
+ }>;
62
+ }, z.core.$strict>>;
63
+ }, z.core.$strict>>], "kind">;
45
64
  export declare const AgentOperationInputCapabilitySchema: z.ZodReadonly<z.ZodObject<{
46
65
  text: z.ZodLiteral<true>;
47
66
  images: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
@@ -66,9 +85,28 @@ export declare const AgentOperationInputCapabilitySchema: z.ZodReadonly<z.ZodObj
66
85
  maxPixelsPerImage: z.ZodNumber;
67
86
  supportsImageOnly: z.ZodBoolean;
68
87
  }, z.core.$strict>>], "kind">;
88
+ contentReferences: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
89
+ kind: z.ZodLiteral<"unsupported">;
90
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
91
+ kind: z.ZodLiteral<"supported">;
92
+ maxReferences: z.ZodNumber;
93
+ arguments: z.ZodBoolean;
94
+ textFormats: z.ZodReadonly<z.ZodObject<{
95
+ prompt: z.ZodEnum<{
96
+ unrestricted: "unrestricted";
97
+ single_line: "single_line";
98
+ literal_single_line: "literal_single_line";
99
+ }>;
100
+ arguments: z.ZodEnum<{
101
+ unrestricted: "unrestricted";
102
+ single_line: "single_line";
103
+ literal_single_line: "literal_single_line";
104
+ }>;
105
+ }, z.core.$strict>>;
106
+ }, z.core.$strict>>], "kind">;
69
107
  }, z.core.$strict>>;
70
108
  export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<{
71
- protocolVersion: z.ZodLiteral<8>;
109
+ protocolVersion: z.ZodLiteral<9>;
72
110
  providerKey: z.ZodType<import("../index.js").AgentProviderKey, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentProviderKey, unknown>>;
73
111
  sessions: z.ZodReadonly<z.ZodObject<{
74
112
  create: z.ZodLiteral<true>;
@@ -113,6 +151,25 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
113
151
  maxPixelsPerImage: z.ZodNumber;
114
152
  supportsImageOnly: z.ZodBoolean;
115
153
  }, z.core.$strict>>], "kind">;
154
+ contentReferences: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
155
+ kind: z.ZodLiteral<"unsupported">;
156
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
157
+ kind: z.ZodLiteral<"supported">;
158
+ maxReferences: z.ZodNumber;
159
+ arguments: z.ZodBoolean;
160
+ textFormats: z.ZodReadonly<z.ZodObject<{
161
+ prompt: z.ZodEnum<{
162
+ unrestricted: "unrestricted";
163
+ single_line: "single_line";
164
+ literal_single_line: "literal_single_line";
165
+ }>;
166
+ arguments: z.ZodEnum<{
167
+ unrestricted: "unrestricted";
168
+ single_line: "single_line";
169
+ literal_single_line: "literal_single_line";
170
+ }>;
171
+ }, z.core.$strict>>;
172
+ }, z.core.$strict>>], "kind">;
116
173
  }, z.core.$strict>>;
117
174
  }, z.core.$strict>>], "kind">;
118
175
  }, z.core.$strict>>;
@@ -209,6 +266,25 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
209
266
  maxPixelsPerImage: z.ZodNumber;
210
267
  supportsImageOnly: z.ZodBoolean;
211
268
  }, z.core.$strict>>], "kind">;
269
+ contentReferences: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
270
+ kind: z.ZodLiteral<"unsupported">;
271
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
272
+ kind: z.ZodLiteral<"supported">;
273
+ maxReferences: z.ZodNumber;
274
+ arguments: z.ZodBoolean;
275
+ textFormats: z.ZodReadonly<z.ZodObject<{
276
+ prompt: z.ZodEnum<{
277
+ unrestricted: "unrestricted";
278
+ single_line: "single_line";
279
+ literal_single_line: "literal_single_line";
280
+ }>;
281
+ arguments: z.ZodEnum<{
282
+ unrestricted: "unrestricted";
283
+ single_line: "single_line";
284
+ literal_single_line: "literal_single_line";
285
+ }>;
286
+ }, z.core.$strict>>;
287
+ }, z.core.$strict>>], "kind">;
212
288
  }, z.core.$strict>>;
213
289
  output: z.ZodReadonly<z.ZodObject<{
214
290
  streaming: z.ZodBoolean;
@@ -284,6 +360,7 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
284
360
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
285
361
  kind: z.ZodLiteral<"supported">;
286
362
  integrationKinds: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
363
+ connector: "connector";
287
364
  mcp: "mcp";
288
365
  }>>>;
289
366
  maxIntegrations: z.ZodNumber;
@@ -291,6 +368,7 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
291
368
  maxToolsPerServer: z.ZodNumber;
292
369
  maxResourcesPerServer: z.ZodNumber;
293
370
  }, z.core.$strict>>], "kind">;
371
+ environment: z.ZodType<import("../index.js").AgentEnvironmentCapability, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEnvironmentCapability, unknown>>;
294
372
  collaboration: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
295
373
  kind: z.ZodLiteral<"unsupported">;
296
374
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
@@ -1,10 +1,13 @@
1
1
  import { z } from "zod/v4";
2
+ import { AgentEnvironmentCapabilitySchema } from "./environment.js";
3
+ import { AGENT_CONTENT_REFERENCES_MAX_LENGTH } from "../turns/types.js";
2
4
  import {
3
5
  AGENT_PROTOCOL_VERSION
4
6
  } from "../foundation/types.js";
5
7
  import { AGENT_ARTIFACT_KINDS } from "../artifacts/types.js";
6
8
  import {
7
9
  AGENT_AUTHENTICATION_FLOWS,
10
+ AGENT_CONTENT_REFERENCE_TEXT_FORMATS,
8
11
  AGENT_FILE_CHANGE_MODES
9
12
  } from "../capabilities/types.js";
10
13
  import {
@@ -181,23 +184,34 @@ const AgentImageInputCapabilitySchema = z.discriminatedUnion("kind", [
181
184
  }
182
185
  }).readonly()
183
186
  ]);
187
+ const AgentContentReferenceInputCapabilitySchema = z.discriminatedUnion("kind", [
188
+ z.object({ kind: z.literal("unsupported") }).strict().readonly(),
189
+ z.object({
190
+ kind: z.literal("supported"),
191
+ maxReferences: z.number().int().min(1).max(AGENT_CONTENT_REFERENCES_MAX_LENGTH),
192
+ arguments: z.boolean(),
193
+ textFormats: z.object({
194
+ prompt: z.enum(AGENT_CONTENT_REFERENCE_TEXT_FORMATS),
195
+ arguments: z.enum(AGENT_CONTENT_REFERENCE_TEXT_FORMATS)
196
+ }).strict().readonly()
197
+ }).strict().readonly()
198
+ ]);
184
199
  const AgentOperationInputCapabilitySchema = z.object({
185
200
  text: z.literal(true),
186
- images: AgentImageInputCapabilitySchema
201
+ images: AgentImageInputCapabilitySchema,
202
+ contentReferences: AgentContentReferenceInputCapabilitySchema
187
203
  }).strict().readonly();
188
204
  const AgentOperationsCapabilitySchema = z.discriminatedUnion("kind", [
189
205
  z.object({ kind: z.literal("unsupported") }).strict().readonly(),
190
206
  z.object({
191
207
  kind: z.literal("supported"),
192
208
  operationKinds: z.array(z.enum(AGENT_OPERATION_KINDS)).min(1).max(AGENT_OPERATION_KINDS.length).meta({ uniqueItems: true }).readonly(),
193
- fieldKinds: z.array(z.enum(AGENT_OPERATION_FIELD_KINDS)).min(1).max(AGENT_OPERATION_FIELD_KINDS.length).meta({ uniqueItems: true }).readonly(),
209
+ fieldKinds: z.array(z.enum(AGENT_OPERATION_FIELD_KINDS)).max(AGENT_OPERATION_FIELD_KINDS.length).meta({ uniqueItems: true }).readonly(),
194
210
  executionModes: z.array(z.enum(AGENT_OPERATION_EXECUTION_MODES)).min(1).max(AGENT_OPERATION_EXECUTION_MODES.length).meta({ uniqueItems: true }).readonly(),
195
211
  maxOperations: boundedPositiveSafeInteger(
196
212
  AGENT_OPERATION_CATALOG_MAX_LENGTH
197
213
  ),
198
- maxFieldsPerOperation: boundedPositiveSafeInteger(
199
- AGENT_OPERATION_FIELDS_MAX_LENGTH
200
- )
214
+ maxFieldsPerOperation: z.number().int().min(0).max(AGENT_OPERATION_FIELDS_MAX_LENGTH)
201
215
  }).strict().readonly()
202
216
  ]);
203
217
  const AgentManagedContentCapabilitySchema = z.discriminatedUnion("kind", [
@@ -313,6 +327,7 @@ const AgentCapabilitiesPortableSchema = z.object({
313
327
  operations: AgentOperationsCapabilitySchema,
314
328
  managedContent: AgentManagedContentCapabilitySchema,
315
329
  integrations: AgentIntegrationsCapabilitySchema,
330
+ environment: AgentEnvironmentCapabilitySchema,
316
331
  collaboration: AgentCollaborationCapabilitySchema,
317
332
  generatedResources: AgentGeneratedResourcesCapabilitySchema,
318
333
  authentication: z.discriminatedUnion("kind", [
@@ -474,6 +489,7 @@ export {
474
489
  AgentApprovalCapabilitySchema,
475
490
  AgentCapabilitiesPortableSchema,
476
491
  AgentCapabilitiesSchema,
492
+ AgentContentReferenceInputCapabilitySchema,
477
493
  AgentImageInputCapabilitySchema,
478
494
  AgentOperationInputCapabilitySchema
479
495
  };
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod/v4';
2
+ import { type AgentCommandCatalog, type AgentCommandDescriptor } from '../commands/types.js';
3
+ export declare const AgentCommandDescriptorPortableSchema: z.ZodReadonly<z.ZodObject<{
4
+ commandId: z.ZodType<import("../index.js").AgentCommandId, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentCommandId, unknown>>;
5
+ revision: z.ZodNumber;
6
+ name: z.ZodString;
7
+ summary: z.ZodOptional<z.ZodString>;
8
+ source: z.ZodType<import("../index.js").AgentEnvironmentSource, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEnvironmentSource, unknown>>;
9
+ availability: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
10
+ operation: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
11
+ operationId: z.ZodType<import("../index.js").AgentOperationId, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentOperationId, unknown>>;
12
+ revision: z.ZodNumber;
13
+ catalogRevision: z.ZodNumber;
14
+ }, z.core.$strict>>>;
15
+ }, z.core.$strict>>;
16
+ export declare const AgentCommandDescriptorSchema: z.ZodType<AgentCommandDescriptor>;
17
+ export declare const AgentCommandCatalogPortableSchema: z.ZodReadonly<z.ZodObject<{
18
+ revision: z.ZodNumber;
19
+ observedAt: z.ZodType<import("../index.js").AgentIsoDateTime, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentIsoDateTime, unknown>>;
20
+ commands: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
21
+ commandId: z.ZodType<import("../index.js").AgentCommandId, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentCommandId, unknown>>;
22
+ revision: z.ZodNumber;
23
+ name: z.ZodString;
24
+ summary: z.ZodOptional<z.ZodString>;
25
+ source: z.ZodType<import("../index.js").AgentEnvironmentSource, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEnvironmentSource, unknown>>;
26
+ availability: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
27
+ operation: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
28
+ operationId: z.ZodType<import("../index.js").AgentOperationId, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentOperationId, unknown>>;
29
+ revision: z.ZodNumber;
30
+ catalogRevision: z.ZodNumber;
31
+ }, z.core.$strict>>>;
32
+ }, z.core.$strict>>>>;
33
+ }, z.core.$strict>>;
34
+ export declare const AgentCommandCatalogSchema: z.ZodType<AgentCommandCatalog>;
35
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1,114 @@
1
+ import { z } from "zod/v4";
2
+ import {
3
+ AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
4
+ agentProtocolSerializedJsonBytes
5
+ } from "../foundation/types.js";
6
+ import { compareStringsByUnicodeCodePoint } from "../foundation/ordering.js";
7
+ import {
8
+ AGENT_COMMAND_CATALOG_BYTES_LIMIT,
9
+ AGENT_COMMAND_CATALOG_MAX_LENGTH,
10
+ AGENT_COMMAND_NAME_MAX_LENGTH,
11
+ AGENT_COMMAND_SUMMARY_MAX_LENGTH
12
+ } from "../commands/types.js";
13
+ import {
14
+ AgentAvailabilityFactSchema,
15
+ AgentEnvironmentSourceSchema
16
+ } from "./environmentFacts.js";
17
+ import {
18
+ AgentCommandIdSchema,
19
+ AgentIsoDateTimeSchema,
20
+ AgentOperationIdSchema,
21
+ createAgentCanonicalNonBlankStringSchema,
22
+ withAcyclicProtocolInput
23
+ } from "./foundation.js";
24
+ const PositiveSafeIntegerSchema = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
25
+ const NameSchema = createAgentCanonicalNonBlankStringSchema(
26
+ AGENT_COMMAND_NAME_MAX_LENGTH
27
+ );
28
+ const SummarySchema = createAgentCanonicalNonBlankStringSchema(
29
+ AGENT_COMMAND_SUMMARY_MAX_LENGTH
30
+ );
31
+ const AgentCommandOperationReferenceSchema = z.object({
32
+ operationId: AgentOperationIdSchema,
33
+ revision: PositiveSafeIntegerSchema,
34
+ catalogRevision: PositiveSafeIntegerSchema
35
+ }).strict().readonly();
36
+ const AgentCommandDescriptorPortableSchema = z.object({
37
+ commandId: AgentCommandIdSchema,
38
+ revision: PositiveSafeIntegerSchema,
39
+ name: NameSchema,
40
+ summary: SummarySchema.optional(),
41
+ source: AgentEnvironmentSourceSchema,
42
+ availability: AgentAvailabilityFactSchema,
43
+ operation: AgentCommandOperationReferenceSchema.optional()
44
+ }).strict().readonly();
45
+ const AgentCommandDescriptorSchema = withAcyclicProtocolInput(
46
+ AgentCommandDescriptorPortableSchema,
47
+ {
48
+ maxDepth: AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
49
+ maxCollectionLength: AGENT_COMMAND_CATALOG_MAX_LENGTH
50
+ }
51
+ );
52
+ const AgentCommandCatalogPortableSchema = z.object({
53
+ revision: PositiveSafeIntegerSchema,
54
+ observedAt: AgentIsoDateTimeSchema,
55
+ commands: z.array(AgentCommandDescriptorPortableSchema).max(AGENT_COMMAND_CATALOG_MAX_LENGTH).readonly()
56
+ }).strict().readonly();
57
+ function addOrderedUniqueIssues(values, path, context) {
58
+ const seen = /* @__PURE__ */ new Set();
59
+ values.forEach((value, index) => {
60
+ if (seen.has(value)) {
61
+ context.addIssue({
62
+ code: "custom",
63
+ path: [...path, index],
64
+ message: "Command IDs must be unique."
65
+ });
66
+ }
67
+ if (index > 0 && compareStringsByUnicodeCodePoint(values[index - 1], value) >= 0) {
68
+ context.addIssue({
69
+ code: "custom",
70
+ path: [...path, index],
71
+ message: "Command IDs must use canonical order."
72
+ });
73
+ }
74
+ seen.add(value);
75
+ });
76
+ }
77
+ const AgentCommandCatalogSchema = withAcyclicProtocolInput(
78
+ AgentCommandCatalogPortableSchema,
79
+ {
80
+ maxDepth: AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
81
+ maxCollectionLength: AGENT_COMMAND_CATALOG_MAX_LENGTH
82
+ }
83
+ ).superRefine((catalog, context) => {
84
+ if (agentProtocolSerializedJsonBytes(catalog) > AGENT_COMMAND_CATALOG_BYTES_LIMIT) {
85
+ context.addIssue({
86
+ code: "custom",
87
+ path: ["commands"],
88
+ message: "Command catalog exceeds its serialized UTF-8 byte limit."
89
+ });
90
+ }
91
+ addOrderedUniqueIssues(
92
+ catalog.commands.map((descriptor) => descriptor.commandId),
93
+ ["commands"],
94
+ context
95
+ );
96
+ catalog.commands.forEach((descriptor, descriptorIndex) => {
97
+ const parsed = AgentCommandDescriptorSchema.safeParse(descriptor);
98
+ if (!parsed.success) {
99
+ for (const issue of parsed.error.issues) {
100
+ context.addIssue({
101
+ code: "custom",
102
+ path: ["commands", descriptorIndex, ...issue.path],
103
+ message: issue.message
104
+ });
105
+ }
106
+ }
107
+ });
108
+ });
109
+ export {
110
+ AgentCommandCatalogPortableSchema,
111
+ AgentCommandCatalogSchema,
112
+ AgentCommandDescriptorPortableSchema,
113
+ AgentCommandDescriptorSchema
114
+ };
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod/v4';
2
+ import { type AgentEffectiveContentCatalog, type AgentEffectiveContentDescriptor } from '../effectiveContent/types.js';
3
+ export declare const AgentDefinitionObservationSchema: z.ZodReadonly<z.ZodObject<{
4
+ mode: z.ZodEnum<{
5
+ unknown: "unknown";
6
+ primary: "primary";
7
+ subagent: "subagent";
8
+ all: "all";
9
+ }>;
10
+ hidden: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
11
+ }, z.core.$strict>>;
12
+ export declare const AgentEffectiveContentDescriptorPortableSchema: z.ZodReadonly<z.ZodObject<{
13
+ contentId: z.ZodType<import("../index.js").AgentEffectiveContentId, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEffectiveContentId, unknown>>;
14
+ revision: z.ZodNumber;
15
+ kind: z.ZodEnum<{
16
+ prompt: "prompt";
17
+ skill: "skill";
18
+ rule: "rule";
19
+ agent_definition: "agent_definition";
20
+ }>;
21
+ name: z.ZodString;
22
+ summary: z.ZodOptional<z.ZodString>;
23
+ source: z.ZodType<import("../index.js").AgentEnvironmentSource, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEnvironmentSource, unknown>>;
24
+ registration: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
25
+ enablement: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
26
+ invocation: z.ZodType<"unknown" | "unavailable" | "user_and_model" | "user_only" | "model_only", unknown, z.core.$ZodTypeInternals<"unknown" | "unavailable" | "user_and_model" | "user_only" | "model_only", unknown>>;
27
+ modelCallability: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
28
+ extension: z.ZodOptional<z.ZodType<import("../index.js").AgentQualifiedExtensionReference, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentQualifiedExtensionReference, unknown>>>;
29
+ agentDefinition: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
30
+ mode: z.ZodEnum<{
31
+ unknown: "unknown";
32
+ primary: "primary";
33
+ subagent: "subagent";
34
+ all: "all";
35
+ }>;
36
+ hidden: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
37
+ }, z.core.$strict>>>;
38
+ }, z.core.$strict>>;
39
+ export declare const AgentEffectiveContentDescriptorSchema: z.ZodType<AgentEffectiveContentDescriptor>;
40
+ export declare const AgentEffectiveContentCatalogPortableSchema: z.ZodReadonly<z.ZodObject<{
41
+ revision: z.ZodNumber;
42
+ observedAt: z.ZodType<import("../index.js").AgentIsoDateTime, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentIsoDateTime, unknown>>;
43
+ content: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
44
+ contentId: z.ZodType<import("../index.js").AgentEffectiveContentId, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEffectiveContentId, unknown>>;
45
+ revision: z.ZodNumber;
46
+ kind: z.ZodEnum<{
47
+ prompt: "prompt";
48
+ skill: "skill";
49
+ rule: "rule";
50
+ agent_definition: "agent_definition";
51
+ }>;
52
+ name: z.ZodString;
53
+ summary: z.ZodOptional<z.ZodString>;
54
+ source: z.ZodType<import("../index.js").AgentEnvironmentSource, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentEnvironmentSource, unknown>>;
55
+ registration: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
56
+ enablement: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
57
+ invocation: z.ZodType<"unknown" | "unavailable" | "user_and_model" | "user_only" | "model_only", unknown, z.core.$ZodTypeInternals<"unknown" | "unavailable" | "user_and_model" | "user_only" | "model_only", unknown>>;
58
+ modelCallability: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
59
+ extension: z.ZodOptional<z.ZodType<import("../index.js").AgentQualifiedExtensionReference, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentQualifiedExtensionReference, unknown>>>;
60
+ agentDefinition: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
61
+ mode: z.ZodEnum<{
62
+ unknown: "unknown";
63
+ primary: "primary";
64
+ subagent: "subagent";
65
+ all: "all";
66
+ }>;
67
+ hidden: z.ZodType<import("../index.js").AgentAvailabilityFact, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentAvailabilityFact, unknown>>;
68
+ }, z.core.$strict>>>;
69
+ }, z.core.$strict>>>>;
70
+ }, z.core.$strict>>;
71
+ export declare const AgentEffectiveContentCatalogSchema: z.ZodType<AgentEffectiveContentCatalog>;
72
+ //# sourceMappingURL=effectiveContent.d.ts.map
@@ -0,0 +1,157 @@
1
+ import { z } from "zod/v4";
2
+ import {
3
+ AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
4
+ agentProtocolSerializedJsonBytes
5
+ } from "../foundation/types.js";
6
+ import { compareStringsByUnicodeCodePoint } from "../foundation/ordering.js";
7
+ import {
8
+ AGENT_EFFECTIVE_CONTENT_CATALOG_BYTES_LIMIT,
9
+ AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH,
10
+ AGENT_EFFECTIVE_CONTENT_KINDS,
11
+ AGENT_EFFECTIVE_CONTENT_NAME_MAX_LENGTH,
12
+ AGENT_EFFECTIVE_CONTENT_SUMMARY_MAX_LENGTH,
13
+ AGENT_DEFINITION_MODES
14
+ } from "../effectiveContent/types.js";
15
+ import {
16
+ AgentAvailabilityFactSchema,
17
+ AgentEnvironmentSourceSchema,
18
+ AgentInvocationPostureSchema,
19
+ AgentQualifiedExtensionReferenceSchema
20
+ } from "./environmentFacts.js";
21
+ import {
22
+ AgentEffectiveContentIdSchema,
23
+ AgentIsoDateTimeSchema,
24
+ createAgentCanonicalNonBlankStringSchema,
25
+ withAcyclicProtocolInput
26
+ } from "./foundation.js";
27
+ const PositiveSafeIntegerSchema = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
28
+ const NameSchema = createAgentCanonicalNonBlankStringSchema(
29
+ AGENT_EFFECTIVE_CONTENT_NAME_MAX_LENGTH
30
+ );
31
+ const SummarySchema = createAgentCanonicalNonBlankStringSchema(
32
+ AGENT_EFFECTIVE_CONTENT_SUMMARY_MAX_LENGTH
33
+ );
34
+ const AgentDefinitionObservationSchema = z.object({
35
+ mode: z.enum(AGENT_DEFINITION_MODES),
36
+ hidden: AgentAvailabilityFactSchema
37
+ }).strict().readonly();
38
+ const AgentEffectiveContentDescriptorPortableSchema = z.object({
39
+ contentId: AgentEffectiveContentIdSchema,
40
+ revision: PositiveSafeIntegerSchema,
41
+ kind: z.enum(AGENT_EFFECTIVE_CONTENT_KINDS),
42
+ name: NameSchema,
43
+ summary: SummarySchema.optional(),
44
+ source: AgentEnvironmentSourceSchema,
45
+ registration: AgentAvailabilityFactSchema,
46
+ enablement: AgentAvailabilityFactSchema,
47
+ invocation: AgentInvocationPostureSchema,
48
+ modelCallability: AgentAvailabilityFactSchema,
49
+ extension: AgentQualifiedExtensionReferenceSchema.optional(),
50
+ agentDefinition: AgentDefinitionObservationSchema.optional()
51
+ }).strict().readonly();
52
+ function validateEffectiveContentSemantics(descriptor, context) {
53
+ if (descriptor.agentDefinition && descriptor.kind !== "agent_definition") {
54
+ context.addIssue({
55
+ code: "custom",
56
+ path: ["agentDefinition"],
57
+ message: "Only agent definitions can carry definition observations."
58
+ });
59
+ }
60
+ const unavailable = descriptor.registration.kind === "known" && !descriptor.registration.value || descriptor.enablement.kind === "known" && !descriptor.enablement.value;
61
+ const positiveInvocation = descriptor.invocation === "user_and_model" || descriptor.invocation === "user_only" || descriptor.invocation === "model_only";
62
+ if (unavailable && positiveInvocation) {
63
+ context.addIssue({
64
+ code: "custom",
65
+ path: ["invocation"],
66
+ message: "Denied registration or enablement cannot advertise a positive invocation posture."
67
+ });
68
+ }
69
+ if (unavailable && descriptor.modelCallability.kind === "known" && descriptor.modelCallability.value) {
70
+ context.addIssue({
71
+ code: "custom",
72
+ path: ["modelCallability"],
73
+ message: "Denied registration or enablement cannot be model-callable."
74
+ });
75
+ }
76
+ if (descriptor.modelCallability.kind !== "known") return;
77
+ const modelIsIncluded = descriptor.invocation === "user_and_model" || descriptor.invocation === "model_only";
78
+ const modelIsExcluded = descriptor.invocation === "user_only" || descriptor.invocation === "unavailable";
79
+ if (modelIsIncluded && !descriptor.modelCallability.value || modelIsExcluded && descriptor.modelCallability.value) {
80
+ context.addIssue({
81
+ code: "custom",
82
+ path: ["modelCallability"],
83
+ message: "modelCallability must agree with the explicit invocation posture."
84
+ });
85
+ }
86
+ }
87
+ const AgentEffectiveContentDescriptorSchema = withAcyclicProtocolInput(
88
+ AgentEffectiveContentDescriptorPortableSchema,
89
+ {
90
+ maxDepth: AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
91
+ maxCollectionLength: AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH
92
+ }
93
+ ).superRefine(validateEffectiveContentSemantics);
94
+ const AgentEffectiveContentCatalogPortableSchema = z.object({
95
+ revision: PositiveSafeIntegerSchema,
96
+ observedAt: AgentIsoDateTimeSchema,
97
+ content: z.array(AgentEffectiveContentDescriptorPortableSchema).max(AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH).readonly()
98
+ }).strict().readonly();
99
+ function addOrderedUniqueIssues(values, path, context) {
100
+ const seen = /* @__PURE__ */ new Set();
101
+ values.forEach((value, index) => {
102
+ if (seen.has(value)) {
103
+ context.addIssue({
104
+ code: "custom",
105
+ path: [...path, index],
106
+ message: "Effective content IDs must be unique."
107
+ });
108
+ }
109
+ if (index > 0 && compareStringsByUnicodeCodePoint(values[index - 1], value) >= 0) {
110
+ context.addIssue({
111
+ code: "custom",
112
+ path: [...path, index],
113
+ message: "Effective content IDs must use canonical order."
114
+ });
115
+ }
116
+ seen.add(value);
117
+ });
118
+ }
119
+ const AgentEffectiveContentCatalogSchema = withAcyclicProtocolInput(
120
+ AgentEffectiveContentCatalogPortableSchema,
121
+ {
122
+ maxDepth: AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
123
+ maxCollectionLength: AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH
124
+ }
125
+ ).superRefine((catalog, context) => {
126
+ if (agentProtocolSerializedJsonBytes(catalog) > AGENT_EFFECTIVE_CONTENT_CATALOG_BYTES_LIMIT) {
127
+ context.addIssue({
128
+ code: "custom",
129
+ path: ["content"],
130
+ message: "Effective content catalog exceeds its serialized UTF-8 byte limit."
131
+ });
132
+ }
133
+ addOrderedUniqueIssues(
134
+ catalog.content.map((descriptor) => descriptor.contentId),
135
+ ["content"],
136
+ context
137
+ );
138
+ catalog.content.forEach((descriptor, descriptorIndex) => {
139
+ const parsed = AgentEffectiveContentDescriptorSchema.safeParse(descriptor);
140
+ if (!parsed.success) {
141
+ for (const issue of parsed.error.issues) {
142
+ context.addIssue({
143
+ code: "custom",
144
+ path: ["content", descriptorIndex, ...issue.path],
145
+ message: issue.message
146
+ });
147
+ }
148
+ }
149
+ });
150
+ });
151
+ export {
152
+ AgentDefinitionObservationSchema,
153
+ AgentEffectiveContentCatalogPortableSchema,
154
+ AgentEffectiveContentCatalogSchema,
155
+ AgentEffectiveContentDescriptorPortableSchema,
156
+ AgentEffectiveContentDescriptorSchema
157
+ };