@agen-ai/agent-protocol 0.2.5 → 0.3.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.
- package/README.md +45 -13
- package/dist/capabilities/contentReferenceText.d.ts +13 -0
- package/dist/capabilities/contentReferenceText.js +25 -0
- package/dist/capabilities/index.d.ts +1 -0
- package/dist/capabilities/index.js +1 -0
- package/dist/capabilities/types.d.ts +19 -1
- package/dist/capabilities/types.js +6 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/parsers.d.ts +7 -0
- package/dist/commands/parsers.js +23 -0
- package/dist/commands/types.d.ts +26 -0
- package/dist/commands/types.js +10 -0
- package/dist/effectiveContent/index.d.ts +3 -0
- package/dist/effectiveContent/index.js +2 -0
- package/dist/effectiveContent/parsers.d.ts +7 -0
- package/dist/effectiveContent/parsers.js +23 -0
- package/dist/effectiveContent/types.d.ts +35 -0
- package/dist/effectiveContent/types.js +19 -0
- package/dist/environment/facts.d.ts +28 -0
- package/dist/environment/facts.js +39 -0
- package/dist/environment/index.d.ts +4 -0
- package/dist/environment/index.js +3 -0
- package/dist/environment/parsers.d.ts +17 -0
- package/dist/environment/parsers.js +68 -0
- package/dist/environment/types.d.ts +61 -0
- package/dist/environment/types.js +26 -0
- package/dist/events/types.d.ts +1 -1
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/parsers.d.ts +7 -0
- package/dist/extensions/parsers.js +23 -0
- package/dist/extensions/types.d.ts +73 -0
- package/dist/extensions/types.js +30 -0
- package/dist/foundation/parsers.d.ts +9 -1
- package/dist/foundation/parsers.js +24 -0
- package/dist/foundation/types.d.ts +5 -1
- package/dist/foundation/types.js +1 -1
- package/dist/integrations/types.d.ts +22 -4
- package/dist/integrations/types.js +6 -2
- package/dist/jsonSchema/generated.d.ts +9390 -5844
- package/dist/jsonSchema/generated.js +2526 -157
- package/dist/public/commands.d.ts +2 -0
- package/dist/public/commands.js +1 -0
- package/dist/public/effectiveContent.d.ts +2 -0
- package/dist/public/effectiveContent.js +1 -0
- package/dist/public/environment.d.ts +2 -0
- package/dist/public/environment.js +1 -0
- package/dist/public/extensions.d.ts +2 -0
- package/dist/public/extensions.js +1 -0
- package/dist/public/index.d.ts +4 -0
- package/dist/public/index.js +4 -0
- package/dist/turns/parsers.d.ts +3 -1
- package/dist/turns/parsers.js +9 -0
- package/dist/turns/types.d.ts +13 -2
- package/dist/turns/types.js +4 -0
- package/dist/zod/capabilities.d.ts +79 -1
- package/dist/zod/capabilities.js +21 -5
- package/dist/zod/commands.d.ts +35 -0
- package/dist/zod/commands.js +114 -0
- package/dist/zod/effectiveContent.d.ts +72 -0
- package/dist/zod/effectiveContent.js +157 -0
- package/dist/zod/environment.d.ts +531 -0
- package/dist/zod/environment.js +336 -0
- package/dist/zod/environmentFacts.d.ts +10 -0
- package/dist/zod/environmentFacts.js +40 -0
- package/dist/zod/events.d.ts +21 -21
- package/dist/zod/extensions.d.ts +161 -0
- package/dist/zod/extensions.js +194 -0
- package/dist/zod/foundation.d.ts +5 -1
- package/dist/zod/foundation.js +8 -0
- package/dist/zod/index.d.ts +9 -4
- package/dist/zod/index.js +21 -2
- package/dist/zod/integrations.d.ts +50 -5
- package/dist/zod/integrations.js +49 -6
- package/dist/zod/turns.d.ts +33 -0
- package/dist/zod/turns.js +34 -1
- package/dist/zod/typeEquality.generated.d.ts +34 -4
- package/package.json +18 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../commands/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../effectiveContent/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../environment/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../extensions/index.js";
|
package/dist/public/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export * from '../turns/index.js';
|
|
|
5
5
|
export * from '../requests/index.js';
|
|
6
6
|
export * from '../operations/index.js';
|
|
7
7
|
export * from '../managedContent/index.js';
|
|
8
|
+
export * from '../effectiveContent/index.js';
|
|
9
|
+
export * from '../commands/index.js';
|
|
10
|
+
export * from '../extensions/index.js';
|
|
11
|
+
export * from '../environment/index.js';
|
|
8
12
|
export * from '../configuration/index.js';
|
|
9
13
|
export * from '../integrations/index.js';
|
|
10
14
|
export * from '../collaboration/index.js';
|
package/dist/public/index.js
CHANGED
|
@@ -5,6 +5,10 @@ export * from "../turns/index.js";
|
|
|
5
5
|
export * from "../requests/index.js";
|
|
6
6
|
export * from "../operations/index.js";
|
|
7
7
|
export * from "../managedContent/index.js";
|
|
8
|
+
export * from "../effectiveContent/index.js";
|
|
9
|
+
export * from "../commands/index.js";
|
|
10
|
+
export * from "../extensions/index.js";
|
|
11
|
+
export * from "../environment/index.js";
|
|
8
12
|
export * from "../configuration/index.js";
|
|
9
13
|
export * from "../integrations/index.js";
|
|
10
14
|
export * from "../collaboration/index.js";
|
package/dist/turns/parsers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentProtocolParseResult } from '../foundation/index.js';
|
|
2
|
-
import type { AgentItemSnapshot, AgentTurnInputContent, AgentTurnInterruptionInput, AgentTurnRunInput } from './types.js';
|
|
2
|
+
import type { AgentItemSnapshot, AgentContentReferenceInputPart, AgentTurnInputContent, AgentTurnInterruptionInput, AgentTurnRunInput } from './types.js';
|
|
3
3
|
export declare function parseAgentTurnInputContent(input: unknown): AgentTurnInputContent;
|
|
4
4
|
export declare function safeParseAgentTurnInputContent(input: unknown): AgentProtocolParseResult<AgentTurnInputContent>;
|
|
5
5
|
export declare function parseAgentTurnRunInput(input: unknown): AgentTurnRunInput;
|
|
@@ -8,4 +8,6 @@ export declare function parseAgentTurnInterruptionInput(input: unknown): AgentTu
|
|
|
8
8
|
export declare function safeParseAgentTurnInterruptionInput(input: unknown): AgentProtocolParseResult<AgentTurnInterruptionInput>;
|
|
9
9
|
export declare function parseAgentItemSnapshot(input: unknown): AgentItemSnapshot;
|
|
10
10
|
export declare function safeParseAgentItemSnapshot(input: unknown): AgentProtocolParseResult<AgentItemSnapshot>;
|
|
11
|
+
export declare function parseAgentContentReferenceInputPart(input: unknown): AgentContentReferenceInputPart;
|
|
12
|
+
export declare function safeParseAgentContentReferenceInputPart(input: unknown): AgentProtocolParseResult<AgentContentReferenceInputPart>;
|
|
11
13
|
//# sourceMappingURL=parsers.d.ts.map
|
package/dist/turns/parsers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parseWithSchema, safeParseWithSchema } from "../internal/parsers.js";
|
|
2
2
|
import {
|
|
3
3
|
AgentItemSnapshotSchema,
|
|
4
|
+
AgentContentReferenceInputPartSchema,
|
|
4
5
|
AgentTurnInputContentSchema,
|
|
5
6
|
AgentTurnInterruptionInputSchema,
|
|
6
7
|
AgentTurnRunInputSchema
|
|
@@ -29,11 +30,19 @@ function parseAgentItemSnapshot(input) {
|
|
|
29
30
|
function safeParseAgentItemSnapshot(input) {
|
|
30
31
|
return safeParseWithSchema(AgentItemSnapshotSchema, input);
|
|
31
32
|
}
|
|
33
|
+
function parseAgentContentReferenceInputPart(input) {
|
|
34
|
+
return parseWithSchema(AgentContentReferenceInputPartSchema, input);
|
|
35
|
+
}
|
|
36
|
+
function safeParseAgentContentReferenceInputPart(input) {
|
|
37
|
+
return safeParseWithSchema(AgentContentReferenceInputPartSchema, input);
|
|
38
|
+
}
|
|
32
39
|
export {
|
|
40
|
+
parseAgentContentReferenceInputPart,
|
|
33
41
|
parseAgentItemSnapshot,
|
|
34
42
|
parseAgentTurnInputContent,
|
|
35
43
|
parseAgentTurnInterruptionInput,
|
|
36
44
|
parseAgentTurnRunInput,
|
|
45
|
+
safeParseAgentContentReferenceInputPart,
|
|
37
46
|
safeParseAgentItemSnapshot,
|
|
38
47
|
safeParseAgentTurnInputContent,
|
|
39
48
|
safeParseAgentTurnInterruptionInput,
|
package/dist/turns/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentError, AgentIsoDateTime, AgentItemId, AgentTurnId } from '../foundation/index.js';
|
|
1
|
+
import type { AgentError, AgentEnvironmentId, AgentEffectiveContentId, AgentIsoDateTime, AgentItemId, AgentTurnId } from '../foundation/index.js';
|
|
2
2
|
export interface AgentTextInputPart {
|
|
3
3
|
readonly type: 'text';
|
|
4
4
|
readonly text: string;
|
|
@@ -28,7 +28,18 @@ export interface AgentImageInputPart {
|
|
|
28
28
|
readonly type: 'image';
|
|
29
29
|
readonly source: AgentImageInputSource;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export declare const AGENT_CONTENT_REFERENCES_MAX_LENGTH = 16;
|
|
32
|
+
export declare const AGENT_CONTENT_REFERENCE_ARGUMENT_BYTES_LIMIT = 4096;
|
|
33
|
+
export interface AgentContentReferenceInputPart {
|
|
34
|
+
readonly type: 'content_reference';
|
|
35
|
+
readonly environmentId: AgentEnvironmentId;
|
|
36
|
+
readonly environmentRevision: number;
|
|
37
|
+
readonly contentCatalogRevision: number;
|
|
38
|
+
readonly contentId: AgentEffectiveContentId;
|
|
39
|
+
readonly contentRevision: number;
|
|
40
|
+
readonly arguments?: string | undefined;
|
|
41
|
+
}
|
|
42
|
+
export type AgentTurnInputPart = AgentTextInputPart | AgentImageInputPart | AgentContentReferenceInputPart;
|
|
32
43
|
export declare const AGENT_TURN_INTERACTION_MODES: readonly ["default", "plan"];
|
|
33
44
|
export type AgentTurnInteractionMode = (typeof AGENT_TURN_INTERACTION_MODES)[number];
|
|
34
45
|
export interface AgentTurnInputContent {
|
package/dist/turns/types.js
CHANGED
|
@@ -8,6 +8,8 @@ const AGENT_IMAGE_INPUT_SOURCE_KINDS = [
|
|
|
8
8
|
"base64",
|
|
9
9
|
"local_file"
|
|
10
10
|
];
|
|
11
|
+
const AGENT_CONTENT_REFERENCES_MAX_LENGTH = 16;
|
|
12
|
+
const AGENT_CONTENT_REFERENCE_ARGUMENT_BYTES_LIMIT = 4096;
|
|
11
13
|
const AGENT_TURN_INTERACTION_MODES = ["default", "plan"];
|
|
12
14
|
const AGENT_ITEM_KINDS = [
|
|
13
15
|
"user_message",
|
|
@@ -79,6 +81,8 @@ const AGENT_FILE_CHANGE_KINDS = [
|
|
|
79
81
|
"unknown"
|
|
80
82
|
];
|
|
81
83
|
export {
|
|
84
|
+
AGENT_CONTENT_REFERENCES_MAX_LENGTH,
|
|
85
|
+
AGENT_CONTENT_REFERENCE_ARGUMENT_BYTES_LIMIT,
|
|
82
86
|
AGENT_CONTENT_STREAM_KINDS,
|
|
83
87
|
AGENT_CONTEXT_COMPACTION_DURATION_MAX_MILLISECONDS,
|
|
84
88
|
AGENT_CONTEXT_COMPACTION_STATES,
|
|
@@ -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<
|
|
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<{
|
package/dist/zod/capabilities.js
CHANGED
|
@@ -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)).
|
|
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:
|
|
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
|