@agen-ai/agent-protocol 0.2.1 → 0.2.3

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 (91) hide show
  1. package/README.md +22 -12
  2. package/dist/capabilities/types.d.ts +64 -18
  3. package/dist/capabilities/types.js +0 -6
  4. package/dist/collaboration/index.d.ts +3 -0
  5. package/dist/collaboration/index.js +2 -0
  6. package/dist/collaboration/parsers.d.ts +9 -0
  7. package/dist/collaboration/parsers.js +32 -0
  8. package/dist/collaboration/types.d.ts +88 -0
  9. package/dist/collaboration/types.js +64 -0
  10. package/dist/configuration/index.d.ts +3 -0
  11. package/dist/configuration/index.js +2 -0
  12. package/dist/configuration/parsers.d.ts +9 -0
  13. package/dist/configuration/parsers.js +98 -0
  14. package/dist/configuration/types.d.ts +72 -0
  15. package/dist/configuration/types.js +27 -0
  16. package/dist/events/types.d.ts +15 -3
  17. package/dist/events/types.js +3 -0
  18. package/dist/foundation/parsers.d.ts +19 -1
  19. package/dist/foundation/parsers.js +70 -0
  20. package/dist/foundation/types.d.ts +10 -1
  21. package/dist/foundation/types.js +1 -1
  22. package/dist/integrations/index.d.ts +3 -0
  23. package/dist/integrations/index.js +2 -0
  24. package/dist/integrations/parsers.d.ts +7 -0
  25. package/dist/integrations/parsers.js +23 -0
  26. package/dist/integrations/types.d.ts +43 -0
  27. package/dist/integrations/types.js +23 -0
  28. package/dist/jsonSchema/generated.d.ts +9573 -3378
  29. package/dist/jsonSchema/generated.js +4935 -973
  30. package/dist/managedContent/index.d.ts +3 -0
  31. package/dist/managedContent/index.js +2 -0
  32. package/dist/managedContent/parsers.d.ts +7 -0
  33. package/dist/managedContent/parsers.js +23 -0
  34. package/dist/managedContent/types.d.ts +39 -0
  35. package/dist/managedContent/types.js +21 -0
  36. package/dist/operations/index.d.ts +3 -0
  37. package/dist/operations/index.js +2 -0
  38. package/dist/operations/parsers.d.ts +15 -0
  39. package/dist/operations/parsers.js +181 -0
  40. package/dist/operations/types.d.ts +112 -0
  41. package/dist/operations/types.js +67 -0
  42. package/dist/public/collaboration.d.ts +2 -0
  43. package/dist/public/collaboration.js +1 -0
  44. package/dist/public/configuration.d.ts +2 -0
  45. package/dist/public/configuration.js +1 -0
  46. package/dist/public/index.d.ts +6 -0
  47. package/dist/public/index.js +6 -0
  48. package/dist/public/integrations.d.ts +2 -0
  49. package/dist/public/integrations.js +1 -0
  50. package/dist/public/managedContent.d.ts +2 -0
  51. package/dist/public/managedContent.js +1 -0
  52. package/dist/public/operations.d.ts +2 -0
  53. package/dist/public/operations.js +1 -0
  54. package/dist/public/resources.d.ts +2 -0
  55. package/dist/public/resources.js +1 -0
  56. package/dist/requests/parsers.js +40 -11
  57. package/dist/requests/types.d.ts +35 -8
  58. package/dist/requests/types.js +15 -1
  59. package/dist/resources/index.d.ts +3 -0
  60. package/dist/resources/index.js +2 -0
  61. package/dist/resources/parsers.d.ts +5 -0
  62. package/dist/resources/parsers.js +12 -0
  63. package/dist/resources/types.d.ts +39 -0
  64. package/dist/resources/types.js +19 -0
  65. package/dist/sessions/types.d.ts +15 -4
  66. package/dist/zod/capabilities.d.ts +103 -15
  67. package/dist/zod/capabilities.js +218 -56
  68. package/dist/zod/collaboration.d.ts +60 -0
  69. package/dist/zod/collaboration.js +155 -0
  70. package/dist/zod/configuration.d.ts +177 -0
  71. package/dist/zod/configuration.js +157 -0
  72. package/dist/zod/events.d.ts +214 -22
  73. package/dist/zod/events.js +15 -0
  74. package/dist/zod/foundation.d.ts +10 -1
  75. package/dist/zod/foundation.js +18 -0
  76. package/dist/zod/index.d.ts +7 -1
  77. package/dist/zod/index.js +62 -0
  78. package/dist/zod/integrations.d.ts +76 -0
  79. package/dist/zod/integrations.js +92 -0
  80. package/dist/zod/managedContent.d.ts +9 -0
  81. package/dist/zod/managedContent.js +70 -0
  82. package/dist/zod/operations.d.ts +339 -0
  83. package/dist/zod/operations.js +229 -0
  84. package/dist/zod/requests.d.ts +100 -11
  85. package/dist/zod/requests.js +68 -27
  86. package/dist/zod/resources.d.ts +43 -0
  87. package/dist/zod/resources.js +82 -0
  88. package/dist/zod/sessions.d.ts +168 -21
  89. package/dist/zod/sessions.js +54 -42
  90. package/dist/zod/typeEquality.generated.d.ts +40 -0
  91. package/package.json +26 -2
@@ -0,0 +1,177 @@
1
+ import { z } from 'zod/v4';
2
+ import { type AgentConfigurationCatalog, type AgentConfigurationSelectionInput } from '../configuration/types.js';
3
+ export declare const AgentConfigurationFieldPortableSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4
+ fieldKind: z.ZodLiteral<"boolean">;
5
+ currentValue: z.ZodBoolean;
6
+ key: z.ZodString;
7
+ revision: z.ZodNumber;
8
+ label: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ scope: z.ZodEnum<{
11
+ session: "session";
12
+ provider_instance: "provider_instance";
13
+ }>;
14
+ applicationTiming: z.ZodEnum<{
15
+ immediate: "immediate";
16
+ next_session: "next_session";
17
+ provider_restart: "provider_restart";
18
+ }>;
19
+ mutable: z.ZodBoolean;
20
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
21
+ fieldKind: z.ZodLiteral<"single_select">;
22
+ currentValue: z.ZodString;
23
+ options: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
24
+ optionId: z.ZodString;
25
+ label: z.ZodString;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strict>>>>;
28
+ key: z.ZodString;
29
+ revision: z.ZodNumber;
30
+ label: z.ZodString;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ scope: z.ZodEnum<{
33
+ session: "session";
34
+ provider_instance: "provider_instance";
35
+ }>;
36
+ applicationTiming: z.ZodEnum<{
37
+ immediate: "immediate";
38
+ next_session: "next_session";
39
+ provider_restart: "provider_restart";
40
+ }>;
41
+ mutable: z.ZodBoolean;
42
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
43
+ fieldKind: z.ZodLiteral<"bounded_integer">;
44
+ currentValue: z.ZodNumber;
45
+ minimum: z.ZodNumber;
46
+ maximum: z.ZodNumber;
47
+ key: z.ZodString;
48
+ revision: z.ZodNumber;
49
+ label: z.ZodString;
50
+ description: z.ZodOptional<z.ZodString>;
51
+ scope: z.ZodEnum<{
52
+ session: "session";
53
+ provider_instance: "provider_instance";
54
+ }>;
55
+ applicationTiming: z.ZodEnum<{
56
+ immediate: "immediate";
57
+ next_session: "next_session";
58
+ provider_restart: "provider_restart";
59
+ }>;
60
+ mutable: z.ZodBoolean;
61
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
62
+ fieldKind: z.ZodLiteral<"bounded_text">;
63
+ currentValue: z.ZodString;
64
+ maxLength: z.ZodNumber;
65
+ multiline: z.ZodBoolean;
66
+ key: z.ZodString;
67
+ revision: z.ZodNumber;
68
+ label: z.ZodString;
69
+ description: z.ZodOptional<z.ZodString>;
70
+ scope: z.ZodEnum<{
71
+ session: "session";
72
+ provider_instance: "provider_instance";
73
+ }>;
74
+ applicationTiming: z.ZodEnum<{
75
+ immediate: "immediate";
76
+ next_session: "next_session";
77
+ provider_restart: "provider_restart";
78
+ }>;
79
+ mutable: z.ZodBoolean;
80
+ }, z.core.$strict>>], "fieldKind">;
81
+ export declare const AgentConfigurationCatalogPortableSchema: z.ZodReadonly<z.ZodObject<{
82
+ revision: z.ZodNumber;
83
+ fields: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
84
+ fieldKind: z.ZodLiteral<"boolean">;
85
+ currentValue: z.ZodBoolean;
86
+ key: z.ZodString;
87
+ revision: z.ZodNumber;
88
+ label: z.ZodString;
89
+ description: z.ZodOptional<z.ZodString>;
90
+ scope: z.ZodEnum<{
91
+ session: "session";
92
+ provider_instance: "provider_instance";
93
+ }>;
94
+ applicationTiming: z.ZodEnum<{
95
+ immediate: "immediate";
96
+ next_session: "next_session";
97
+ provider_restart: "provider_restart";
98
+ }>;
99
+ mutable: z.ZodBoolean;
100
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
101
+ fieldKind: z.ZodLiteral<"single_select">;
102
+ currentValue: z.ZodString;
103
+ options: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
104
+ optionId: z.ZodString;
105
+ label: z.ZodString;
106
+ description: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strict>>>>;
108
+ key: z.ZodString;
109
+ revision: z.ZodNumber;
110
+ label: z.ZodString;
111
+ description: z.ZodOptional<z.ZodString>;
112
+ scope: z.ZodEnum<{
113
+ session: "session";
114
+ provider_instance: "provider_instance";
115
+ }>;
116
+ applicationTiming: z.ZodEnum<{
117
+ immediate: "immediate";
118
+ next_session: "next_session";
119
+ provider_restart: "provider_restart";
120
+ }>;
121
+ mutable: z.ZodBoolean;
122
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
123
+ fieldKind: z.ZodLiteral<"bounded_integer">;
124
+ currentValue: z.ZodNumber;
125
+ minimum: z.ZodNumber;
126
+ maximum: z.ZodNumber;
127
+ key: z.ZodString;
128
+ revision: z.ZodNumber;
129
+ label: z.ZodString;
130
+ description: z.ZodOptional<z.ZodString>;
131
+ scope: z.ZodEnum<{
132
+ session: "session";
133
+ provider_instance: "provider_instance";
134
+ }>;
135
+ applicationTiming: z.ZodEnum<{
136
+ immediate: "immediate";
137
+ next_session: "next_session";
138
+ provider_restart: "provider_restart";
139
+ }>;
140
+ mutable: z.ZodBoolean;
141
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
142
+ fieldKind: z.ZodLiteral<"bounded_text">;
143
+ currentValue: z.ZodString;
144
+ maxLength: z.ZodNumber;
145
+ multiline: z.ZodBoolean;
146
+ key: z.ZodString;
147
+ revision: z.ZodNumber;
148
+ label: z.ZodString;
149
+ description: z.ZodOptional<z.ZodString>;
150
+ scope: z.ZodEnum<{
151
+ session: "session";
152
+ provider_instance: "provider_instance";
153
+ }>;
154
+ applicationTiming: z.ZodEnum<{
155
+ immediate: "immediate";
156
+ next_session: "next_session";
157
+ provider_restart: "provider_restart";
158
+ }>;
159
+ mutable: z.ZodBoolean;
160
+ }, z.core.$strict>>], "fieldKind">>>;
161
+ }, z.core.$strict>>;
162
+ export declare const AgentConfigurationCatalogSchema: z.ZodType<AgentConfigurationCatalog>;
163
+ export declare const AgentConfigurationValueSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
164
+ fieldKind: z.ZodLiteral<"boolean">;
165
+ value: z.ZodBoolean;
166
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
167
+ fieldKind: z.ZodLiteral<"single_select">;
168
+ optionId: z.ZodString;
169
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
170
+ fieldKind: z.ZodLiteral<"bounded_integer">;
171
+ value: z.ZodNumber;
172
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
173
+ fieldKind: z.ZodLiteral<"bounded_text">;
174
+ value: z.ZodString;
175
+ }, z.core.$strict>>], "fieldKind">;
176
+ export declare const AgentConfigurationSelectionInputSchema: z.ZodType<AgentConfigurationSelectionInput>;
177
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1,157 @@
1
+ import { z } from "zod/v4";
2
+ import { compareStringsByUnicodeCodePoint } from "../foundation/ordering.js";
3
+ import {
4
+ AGENT_CONFIGURATION_APPLICATION_TIMINGS,
5
+ AGENT_CONFIGURATION_DESCRIPTION_MAX_LENGTH,
6
+ AGENT_CONFIGURATION_FIELDS_MAX_LENGTH,
7
+ AGENT_CONFIGURATION_LABEL_MAX_LENGTH,
8
+ AGENT_CONFIGURATION_OPTIONS_MAX_LENGTH,
9
+ AGENT_CONFIGURATION_SCOPES,
10
+ AGENT_CONFIGURATION_TEXT_VALUE_MAX_LENGTH
11
+ } from "../configuration/types.js";
12
+ import {
13
+ AgentCanonicalIdValueSchema,
14
+ createAgentCanonicalNonBlankStringSchema
15
+ } from "./foundation.js";
16
+ const PositiveSafeIntegerSchema = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
17
+ const SafeIntegerSchema = z.number().int().min(Number.MIN_SAFE_INTEGER).max(Number.MAX_SAFE_INTEGER);
18
+ const LabelSchema = createAgentCanonicalNonBlankStringSchema(
19
+ AGENT_CONFIGURATION_LABEL_MAX_LENGTH
20
+ );
21
+ const DescriptionSchema = createAgentCanonicalNonBlankStringSchema(
22
+ AGENT_CONFIGURATION_DESCRIPTION_MAX_LENGTH
23
+ );
24
+ const CanonicalTextValueSchema = z.string().max(AGENT_CONFIGURATION_TEXT_VALUE_MAX_LENGTH).regex(/^(?:$|\S|\S[\s\S]*\S)$/u);
25
+ const AgentConfigurationSelectOptionSchema = z.object({
26
+ optionId: AgentCanonicalIdValueSchema,
27
+ label: LabelSchema,
28
+ description: DescriptionSchema.optional()
29
+ }).strict().readonly();
30
+ const fieldBase = {
31
+ key: AgentCanonicalIdValueSchema,
32
+ revision: PositiveSafeIntegerSchema,
33
+ label: LabelSchema,
34
+ description: DescriptionSchema.optional(),
35
+ scope: z.enum(AGENT_CONFIGURATION_SCOPES),
36
+ applicationTiming: z.enum(AGENT_CONFIGURATION_APPLICATION_TIMINGS),
37
+ mutable: z.boolean()
38
+ };
39
+ const AgentConfigurationFieldPortableSchema = z.discriminatedUnion(
40
+ "fieldKind",
41
+ [
42
+ z.object({
43
+ ...fieldBase,
44
+ fieldKind: z.literal("boolean"),
45
+ currentValue: z.boolean()
46
+ }).strict().readonly(),
47
+ z.object({
48
+ ...fieldBase,
49
+ fieldKind: z.literal("single_select"),
50
+ currentValue: AgentCanonicalIdValueSchema,
51
+ options: z.array(AgentConfigurationSelectOptionSchema).min(1).max(AGENT_CONFIGURATION_OPTIONS_MAX_LENGTH).readonly()
52
+ }).strict().readonly(),
53
+ z.object({
54
+ ...fieldBase,
55
+ fieldKind: z.literal("bounded_integer"),
56
+ currentValue: SafeIntegerSchema,
57
+ minimum: SafeIntegerSchema,
58
+ maximum: SafeIntegerSchema
59
+ }).strict().readonly(),
60
+ z.object({
61
+ ...fieldBase,
62
+ fieldKind: z.literal("bounded_text"),
63
+ currentValue: CanonicalTextValueSchema,
64
+ maxLength: z.number().int().positive().max(AGENT_CONFIGURATION_TEXT_VALUE_MAX_LENGTH),
65
+ multiline: z.boolean()
66
+ }).strict().readonly()
67
+ ]
68
+ );
69
+ const AgentConfigurationCatalogPortableSchema = z.object({
70
+ revision: PositiveSafeIntegerSchema,
71
+ fields: z.array(AgentConfigurationFieldPortableSchema).max(AGENT_CONFIGURATION_FIELDS_MAX_LENGTH).readonly()
72
+ }).strict().readonly();
73
+ const AgentConfigurationCatalogSchema = AgentConfigurationCatalogPortableSchema.superRefine((catalog, context) => {
74
+ const keys = /* @__PURE__ */ new Set();
75
+ let previousKey = "";
76
+ catalog.fields.forEach((field, fieldIndex) => {
77
+ if (keys.has(field.key)) {
78
+ context.addIssue({
79
+ code: "custom",
80
+ path: ["fields", fieldIndex, "key"],
81
+ message: "Configuration field keys must be unique."
82
+ });
83
+ }
84
+ if (fieldIndex > 0 && compareStringsByUnicodeCodePoint(previousKey, field.key) >= 0) {
85
+ context.addIssue({
86
+ code: "custom",
87
+ path: ["fields", fieldIndex, "key"],
88
+ message: "Configuration fields must be ordered by key."
89
+ });
90
+ }
91
+ keys.add(field.key);
92
+ previousKey = field.key;
93
+ if (field.fieldKind === "single_select") {
94
+ const optionIds = /* @__PURE__ */ new Set();
95
+ field.options.forEach((option, optionIndex) => {
96
+ if (optionIds.has(option.optionId)) {
97
+ context.addIssue({
98
+ code: "custom",
99
+ path: ["fields", fieldIndex, "options", optionIndex, "optionId"],
100
+ message: "Configuration option IDs must be unique within a field."
101
+ });
102
+ }
103
+ if (optionIndex > 0 && compareStringsByUnicodeCodePoint(
104
+ field.options[optionIndex - 1].optionId,
105
+ option.optionId
106
+ ) >= 0) {
107
+ context.addIssue({
108
+ code: "custom",
109
+ path: ["fields", fieldIndex, "options", optionIndex, "optionId"],
110
+ message: "Configuration options must use canonical optionId order."
111
+ });
112
+ }
113
+ optionIds.add(option.optionId);
114
+ });
115
+ if (!optionIds.has(field.currentValue)) {
116
+ context.addIssue({
117
+ code: "custom",
118
+ path: ["fields", fieldIndex, "currentValue"],
119
+ message: "Current configuration value must be an offered option."
120
+ });
121
+ }
122
+ }
123
+ if (field.fieldKind === "bounded_integer" && (field.minimum > field.maximum || field.currentValue < field.minimum || field.currentValue > field.maximum)) {
124
+ context.addIssue({
125
+ code: "custom",
126
+ path: ["fields", fieldIndex, "currentValue"],
127
+ message: "Integer configuration bounds and current value are inconsistent."
128
+ });
129
+ }
130
+ if (field.fieldKind === "bounded_text" && field.currentValue.length > field.maxLength) {
131
+ context.addIssue({
132
+ code: "custom",
133
+ path: ["fields", fieldIndex, "currentValue"],
134
+ message: "Current text configuration value exceeds the field maximum."
135
+ });
136
+ }
137
+ });
138
+ });
139
+ const AgentConfigurationValueSchema = z.discriminatedUnion("fieldKind", [
140
+ z.object({ fieldKind: z.literal("boolean"), value: z.boolean() }).strict().readonly(),
141
+ z.object({ fieldKind: z.literal("single_select"), optionId: AgentCanonicalIdValueSchema }).strict().readonly(),
142
+ z.object({ fieldKind: z.literal("bounded_integer"), value: SafeIntegerSchema }).strict().readonly(),
143
+ z.object({ fieldKind: z.literal("bounded_text"), value: CanonicalTextValueSchema }).strict().readonly()
144
+ ]);
145
+ const AgentConfigurationSelectionInputSchema = z.object({
146
+ key: AgentCanonicalIdValueSchema,
147
+ expectedCatalogRevision: PositiveSafeIntegerSchema,
148
+ expectedFieldRevision: PositiveSafeIntegerSchema,
149
+ value: AgentConfigurationValueSchema
150
+ }).strict().readonly();
151
+ export {
152
+ AgentConfigurationCatalogPortableSchema,
153
+ AgentConfigurationCatalogSchema,
154
+ AgentConfigurationFieldPortableSchema,
155
+ AgentConfigurationSelectionInputSchema,
156
+ AgentConfigurationValueSchema
157
+ };