@agen-ai/agent-protocol 0.4.0 → 0.4.2
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 +115 -18
- package/dist/capabilities/types.d.ts +6 -1
- package/dist/events/types.d.ts +9 -3
- package/dist/events/types.js +4 -1
- package/dist/foundation/types.d.ts +1 -1
- package/dist/foundation/types.js +1 -1
- package/dist/jsonSchema/generated.d.ts +11214 -7152
- package/dist/jsonSchema/generated.js +2835 -227
- package/dist/public/index.d.ts +1 -0
- package/dist/public/index.js +1 -0
- package/dist/public/sessionInteractions.d.ts +2 -0
- package/dist/public/sessionInteractions.js +1 -0
- package/dist/requests/elicitation.d.ts +4 -0
- package/dist/requests/elicitation.js +107 -0
- package/dist/requests/parsers.js +2 -100
- package/dist/requests/types.d.ts +17 -4
- package/dist/sessionInteractions/index.d.ts +3 -0
- package/dist/sessionInteractions/index.js +2 -0
- package/dist/sessionInteractions/parsers.d.ts +37 -0
- package/dist/sessionInteractions/parsers.js +201 -0
- package/dist/sessionInteractions/types.d.ts +162 -0
- package/dist/sessionInteractions/types.js +34 -0
- package/dist/zod/capabilities.d.ts +72 -6
- package/dist/zod/capabilities.js +32 -30
- package/dist/zod/collaboration.d.ts +2 -2
- package/dist/zod/events.d.ts +75 -42
- package/dist/zod/events.js +8 -0
- package/dist/zod/foundation.d.ts +1 -0
- package/dist/zod/foundation.js +15 -2
- package/dist/zod/index.d.ts +2 -1
- package/dist/zod/index.js +60 -0
- package/dist/zod/operations.d.ts +1 -1
- package/dist/zod/requests.d.ts +175 -32
- package/dist/zod/requests.js +33 -10
- package/dist/zod/sessionInteractions.d.ts +925 -0
- package/dist/zod/sessionInteractions.js +284 -0
- package/dist/zod/turns.d.ts +1 -1
- package/dist/zod/typeEquality.generated.d.ts +38 -4
- package/package.json +6 -2
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { AgentIsoDateTime, AgentRequestId, AgentSessionId } from '../foundation/index.js';
|
|
2
|
+
import type { AgentElicitationAnswer, AgentElicitationField } from '../requests/types.js';
|
|
3
|
+
declare const agentSessionDecisionChoiceIdBrand: unique symbol;
|
|
4
|
+
declare const agentSessionFormChoiceIdBrand: unique symbol;
|
|
5
|
+
declare const agentSessionPlanReviewChoiceIdBrand: unique symbol;
|
|
6
|
+
declare const agentSessionPlanIdBrand: unique symbol;
|
|
7
|
+
declare const agentSessionPlanRevisionBrand: unique symbol;
|
|
8
|
+
export type AgentSessionRequestKind = 'decision' | 'form' | 'plan_review';
|
|
9
|
+
export type AgentSessionDecisionChoiceId = string & {
|
|
10
|
+
readonly [agentSessionDecisionChoiceIdBrand]: 'AgentSessionDecisionChoiceId';
|
|
11
|
+
};
|
|
12
|
+
export type AgentSessionFormChoiceId = string & {
|
|
13
|
+
readonly [agentSessionFormChoiceIdBrand]: 'AgentSessionFormChoiceId';
|
|
14
|
+
};
|
|
15
|
+
export type AgentSessionPlanReviewChoiceId = string & {
|
|
16
|
+
readonly [agentSessionPlanReviewChoiceIdBrand]: 'AgentSessionPlanReviewChoiceId';
|
|
17
|
+
};
|
|
18
|
+
export type AgentSessionPlanId = string & {
|
|
19
|
+
readonly [agentSessionPlanIdBrand]: 'AgentSessionPlanId';
|
|
20
|
+
};
|
|
21
|
+
export type AgentSessionPlanRevision = string & {
|
|
22
|
+
readonly [agentSessionPlanRevisionBrand]: 'AgentSessionPlanRevision';
|
|
23
|
+
};
|
|
24
|
+
export interface AgentSessionWorkspaceTarget {
|
|
25
|
+
readonly kind: 'workspace';
|
|
26
|
+
readonly path: string;
|
|
27
|
+
}
|
|
28
|
+
export type AgentSessionDecisionConsequence = Readonly<{
|
|
29
|
+
kind: 'grant';
|
|
30
|
+
scope: 'workspace';
|
|
31
|
+
persistence: Readonly<{
|
|
32
|
+
kind: 'provider_managed';
|
|
33
|
+
duration: 'persistent';
|
|
34
|
+
mayAffectOtherSessions: true;
|
|
35
|
+
}>;
|
|
36
|
+
}> | Readonly<{
|
|
37
|
+
kind: 'decline';
|
|
38
|
+
configuration: 'remains_gated';
|
|
39
|
+
}>;
|
|
40
|
+
export interface AgentSessionDecisionChoice {
|
|
41
|
+
readonly choiceId: AgentSessionDecisionChoiceId;
|
|
42
|
+
readonly label: string;
|
|
43
|
+
readonly description: string;
|
|
44
|
+
readonly consequence: AgentSessionDecisionConsequence;
|
|
45
|
+
}
|
|
46
|
+
export interface AgentSessionDecisionRequest {
|
|
47
|
+
readonly kind: 'decision';
|
|
48
|
+
readonly requestId: AgentRequestId;
|
|
49
|
+
readonly sessionId: AgentSessionId;
|
|
50
|
+
readonly title: string;
|
|
51
|
+
readonly description?: string;
|
|
52
|
+
readonly target: AgentSessionWorkspaceTarget;
|
|
53
|
+
readonly expiresAt?: AgentIsoDateTime;
|
|
54
|
+
readonly choices: readonly [AgentSessionDecisionChoice, ...AgentSessionDecisionChoice[]];
|
|
55
|
+
}
|
|
56
|
+
export interface AgentSessionDecisionResponse {
|
|
57
|
+
readonly kind: 'decision';
|
|
58
|
+
readonly choiceId: AgentSessionDecisionChoiceId;
|
|
59
|
+
}
|
|
60
|
+
export type AgentSessionFormChoice = Readonly<{
|
|
61
|
+
choiceId: AgentSessionFormChoiceId;
|
|
62
|
+
action: 'submit';
|
|
63
|
+
label: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
}> | Readonly<{
|
|
66
|
+
choiceId: AgentSessionFormChoiceId;
|
|
67
|
+
action: 'cancel';
|
|
68
|
+
label: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
}>;
|
|
71
|
+
export interface AgentSessionFormRequest {
|
|
72
|
+
readonly kind: 'form';
|
|
73
|
+
readonly requestId: AgentRequestId;
|
|
74
|
+
readonly sessionId: AgentSessionId;
|
|
75
|
+
readonly title: string;
|
|
76
|
+
readonly description?: string;
|
|
77
|
+
readonly fields: readonly [AgentElicitationField, ...AgentElicitationField[]];
|
|
78
|
+
readonly choices: readonly [AgentSessionFormChoice, ...AgentSessionFormChoice[]];
|
|
79
|
+
readonly expiresAt?: AgentIsoDateTime;
|
|
80
|
+
}
|
|
81
|
+
export type AgentSessionPlanReviewAction = 'approve' | 'revise' | 'abandon';
|
|
82
|
+
export interface AgentSessionPlanSnapshot {
|
|
83
|
+
readonly planId: AgentSessionPlanId;
|
|
84
|
+
readonly revision: AgentSessionPlanRevision;
|
|
85
|
+
readonly title: string;
|
|
86
|
+
readonly content: Readonly<{
|
|
87
|
+
kind: 'text';
|
|
88
|
+
format: 'plain_text' | 'markdown';
|
|
89
|
+
text: string;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export interface AgentSessionPlanReviewChoice {
|
|
93
|
+
readonly choiceId: AgentSessionPlanReviewChoiceId;
|
|
94
|
+
readonly action: AgentSessionPlanReviewAction;
|
|
95
|
+
readonly label: string;
|
|
96
|
+
readonly description?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface AgentSessionPlanReviewRequest {
|
|
99
|
+
readonly kind: 'plan_review';
|
|
100
|
+
readonly requestId: AgentRequestId;
|
|
101
|
+
readonly sessionId: AgentSessionId;
|
|
102
|
+
readonly title: string;
|
|
103
|
+
readonly description?: string;
|
|
104
|
+
readonly plan: AgentSessionPlanSnapshot;
|
|
105
|
+
readonly choices: readonly [AgentSessionPlanReviewChoice, ...AgentSessionPlanReviewChoice[]];
|
|
106
|
+
readonly expiresAt?: AgentIsoDateTime;
|
|
107
|
+
}
|
|
108
|
+
export type AgentSessionRequest = AgentSessionDecisionRequest | AgentSessionFormRequest | AgentSessionPlanReviewRequest;
|
|
109
|
+
export type AgentSessionFormResponse = Readonly<{
|
|
110
|
+
kind: 'form';
|
|
111
|
+
action: 'submit';
|
|
112
|
+
choiceId: AgentSessionFormChoiceId;
|
|
113
|
+
answers: readonly AgentElicitationAnswer[];
|
|
114
|
+
}> | Readonly<{
|
|
115
|
+
kind: 'form';
|
|
116
|
+
action: 'cancel';
|
|
117
|
+
choiceId: AgentSessionFormChoiceId;
|
|
118
|
+
}>;
|
|
119
|
+
export type AgentSessionPlanReviewResponse = Readonly<{
|
|
120
|
+
kind: 'plan_review';
|
|
121
|
+
action: 'approve' | 'abandon';
|
|
122
|
+
choiceId: AgentSessionPlanReviewChoiceId;
|
|
123
|
+
planId: AgentSessionPlanId;
|
|
124
|
+
revision: AgentSessionPlanRevision;
|
|
125
|
+
}> | Readonly<{
|
|
126
|
+
kind: 'plan_review';
|
|
127
|
+
action: 'revise';
|
|
128
|
+
choiceId: AgentSessionPlanReviewChoiceId;
|
|
129
|
+
planId: AgentSessionPlanId;
|
|
130
|
+
revision: AgentSessionPlanRevision;
|
|
131
|
+
feedback: string;
|
|
132
|
+
}>;
|
|
133
|
+
export type AgentSessionResponse = AgentSessionDecisionResponse | AgentSessionFormResponse | AgentSessionPlanReviewResponse;
|
|
134
|
+
export type AgentSessionAcceptedResponse = AgentSessionDecisionResponse | Readonly<{
|
|
135
|
+
kind: 'form';
|
|
136
|
+
action: 'submit' | 'cancel';
|
|
137
|
+
choiceId: AgentSessionFormChoiceId;
|
|
138
|
+
}> | Readonly<{
|
|
139
|
+
kind: 'plan_review';
|
|
140
|
+
action: AgentSessionPlanReviewAction;
|
|
141
|
+
choiceId: AgentSessionPlanReviewChoiceId;
|
|
142
|
+
planId: AgentSessionPlanId;
|
|
143
|
+
revision: AgentSessionPlanRevision;
|
|
144
|
+
}>;
|
|
145
|
+
export declare const AGENT_SESSION_REQUEST_BYTES_LIMIT = 65536;
|
|
146
|
+
export declare const AGENT_SESSION_DECISION_REQUEST_BYTES_LIMIT = 65536;
|
|
147
|
+
export declare const AGENT_SESSION_DECISION_RESPONSE_BYTES_LIMIT = 1024;
|
|
148
|
+
export declare const AGENT_SESSION_FORM_RESPONSE_BYTES_LIMIT = 65536;
|
|
149
|
+
export declare const AGENT_SESSION_PLAN_REVIEW_RESPONSE_BYTES_LIMIT = 65536;
|
|
150
|
+
export declare const AGENT_SESSION_PLAN_TEXT_BYTES_LIMIT = 49152;
|
|
151
|
+
export declare const AGENT_SESSION_PLAN_ID_BYTES_LIMIT = 128;
|
|
152
|
+
export declare const AGENT_SESSION_PLAN_REVISION_BYTES_LIMIT = 128;
|
|
153
|
+
export declare const AGENT_SESSION_PLAN_REVIEW_FEEDBACK_MAX_LENGTH = 4000;
|
|
154
|
+
export declare const AGENT_SESSION_PLAN_REVIEW_FEEDBACK_BYTES_LIMIT = 16384;
|
|
155
|
+
export declare const AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH = 16;
|
|
156
|
+
export declare const AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT = 128;
|
|
157
|
+
export declare const AGENT_SESSION_DECISION_TITLE_MAX_LENGTH = 120;
|
|
158
|
+
export declare const AGENT_SESSION_DECISION_DESCRIPTION_MAX_LENGTH = 4000;
|
|
159
|
+
export declare const AGENT_SESSION_DECISION_CHOICE_DESCRIPTION_MAX_LENGTH = 1000;
|
|
160
|
+
export declare const AGENT_SESSION_DECISION_WORKSPACE_PATH_BYTES_LIMIT = 4096;
|
|
161
|
+
export {};
|
|
162
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const AGENT_SESSION_REQUEST_BYTES_LIMIT = 65536;
|
|
2
|
+
const AGENT_SESSION_DECISION_REQUEST_BYTES_LIMIT = AGENT_SESSION_REQUEST_BYTES_LIMIT;
|
|
3
|
+
const AGENT_SESSION_DECISION_RESPONSE_BYTES_LIMIT = 1024;
|
|
4
|
+
const AGENT_SESSION_FORM_RESPONSE_BYTES_LIMIT = 65536;
|
|
5
|
+
const AGENT_SESSION_PLAN_REVIEW_RESPONSE_BYTES_LIMIT = 65536;
|
|
6
|
+
const AGENT_SESSION_PLAN_TEXT_BYTES_LIMIT = 49152;
|
|
7
|
+
const AGENT_SESSION_PLAN_ID_BYTES_LIMIT = 128;
|
|
8
|
+
const AGENT_SESSION_PLAN_REVISION_BYTES_LIMIT = 128;
|
|
9
|
+
const AGENT_SESSION_PLAN_REVIEW_FEEDBACK_MAX_LENGTH = 4e3;
|
|
10
|
+
const AGENT_SESSION_PLAN_REVIEW_FEEDBACK_BYTES_LIMIT = 16384;
|
|
11
|
+
const AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH = 16;
|
|
12
|
+
const AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT = 128;
|
|
13
|
+
const AGENT_SESSION_DECISION_TITLE_MAX_LENGTH = 120;
|
|
14
|
+
const AGENT_SESSION_DECISION_DESCRIPTION_MAX_LENGTH = 4e3;
|
|
15
|
+
const AGENT_SESSION_DECISION_CHOICE_DESCRIPTION_MAX_LENGTH = 1e3;
|
|
16
|
+
const AGENT_SESSION_DECISION_WORKSPACE_PATH_BYTES_LIMIT = 4096;
|
|
17
|
+
export {
|
|
18
|
+
AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH,
|
|
19
|
+
AGENT_SESSION_DECISION_CHOICE_DESCRIPTION_MAX_LENGTH,
|
|
20
|
+
AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT,
|
|
21
|
+
AGENT_SESSION_DECISION_DESCRIPTION_MAX_LENGTH,
|
|
22
|
+
AGENT_SESSION_DECISION_REQUEST_BYTES_LIMIT,
|
|
23
|
+
AGENT_SESSION_DECISION_RESPONSE_BYTES_LIMIT,
|
|
24
|
+
AGENT_SESSION_DECISION_TITLE_MAX_LENGTH,
|
|
25
|
+
AGENT_SESSION_DECISION_WORKSPACE_PATH_BYTES_LIMIT,
|
|
26
|
+
AGENT_SESSION_FORM_RESPONSE_BYTES_LIMIT,
|
|
27
|
+
AGENT_SESSION_PLAN_ID_BYTES_LIMIT,
|
|
28
|
+
AGENT_SESSION_PLAN_REVIEW_FEEDBACK_BYTES_LIMIT,
|
|
29
|
+
AGENT_SESSION_PLAN_REVIEW_FEEDBACK_MAX_LENGTH,
|
|
30
|
+
AGENT_SESSION_PLAN_REVIEW_RESPONSE_BYTES_LIMIT,
|
|
31
|
+
AGENT_SESSION_PLAN_REVISION_BYTES_LIMIT,
|
|
32
|
+
AGENT_SESSION_PLAN_TEXT_BYTES_LIMIT,
|
|
33
|
+
AGENT_SESSION_REQUEST_BYTES_LIMIT
|
|
34
|
+
};
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
2
|
import { type AgentCapabilities } from '../capabilities/types.js';
|
|
3
|
-
export declare const AgentApprovalCapabilitySchema: z.
|
|
3
|
+
export declare const AgentApprovalCapabilitySchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
4
4
|
kind: z.ZodLiteral<"unsupported">;
|
|
5
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"supported">;
|
|
7
|
+
modes: z.ZodReadonly<z.ZodTuple<[z.ZodReadonly<z.ZodObject<{
|
|
8
|
+
persistence: z.ZodEnum<{
|
|
9
|
+
session: "session";
|
|
10
|
+
once: "once";
|
|
11
|
+
workspace: "workspace";
|
|
12
|
+
}>;
|
|
13
|
+
scopeKinds: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
14
|
+
exact_action: "exact_action";
|
|
15
|
+
command_pattern: "command_pattern";
|
|
16
|
+
domain: "domain";
|
|
17
|
+
tool: "tool";
|
|
18
|
+
server: "server";
|
|
19
|
+
all_edits: "all_edits";
|
|
20
|
+
}>>>;
|
|
21
|
+
}, z.core.$strict>>], z.ZodReadonly<z.ZodObject<{
|
|
22
|
+
persistence: z.ZodEnum<{
|
|
23
|
+
session: "session";
|
|
24
|
+
once: "once";
|
|
25
|
+
workspace: "workspace";
|
|
26
|
+
}>;
|
|
27
|
+
scopeKinds: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
28
|
+
exact_action: "exact_action";
|
|
29
|
+
command_pattern: "command_pattern";
|
|
30
|
+
domain: "domain";
|
|
31
|
+
tool: "tool";
|
|
32
|
+
server: "server";
|
|
33
|
+
all_edits: "all_edits";
|
|
34
|
+
}>>>;
|
|
35
|
+
}, z.core.$strict>>>>;
|
|
36
|
+
providerManagedRemembrance: z.ZodLiteral<false>;
|
|
5
37
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
6
38
|
kind: z.ZodLiteral<"supported">;
|
|
7
39
|
modes: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
@@ -19,7 +51,8 @@ export declare const AgentApprovalCapabilitySchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
19
51
|
all_edits: "all_edits";
|
|
20
52
|
}>>>;
|
|
21
53
|
}, z.core.$strict>>>>;
|
|
22
|
-
|
|
54
|
+
providerManagedRemembrance: z.ZodLiteral<true>;
|
|
55
|
+
}, z.core.$strict>>]>;
|
|
23
56
|
export declare const AgentImageInputCapabilitySchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
24
57
|
kind: z.ZodLiteral<"unsupported">;
|
|
25
58
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
@@ -106,7 +139,7 @@ export declare const AgentOperationInputCapabilitySchema: z.ZodReadonly<z.ZodObj
|
|
|
106
139
|
}, z.core.$strict>>], "kind">;
|
|
107
140
|
}, z.core.$strict>>;
|
|
108
141
|
export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<{
|
|
109
|
-
protocolVersion: z.ZodLiteral<
|
|
142
|
+
protocolVersion: z.ZodLiteral<12>;
|
|
110
143
|
providerKey: z.ZodType<import("../index.js").AgentProviderKey, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentProviderKey, unknown>>;
|
|
111
144
|
sessions: z.ZodReadonly<z.ZodObject<{
|
|
112
145
|
create: z.ZodLiteral<true>;
|
|
@@ -174,8 +207,40 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
|
|
|
174
207
|
}, z.core.$strict>>], "kind">;
|
|
175
208
|
}, z.core.$strict>>;
|
|
176
209
|
requests: z.ZodReadonly<z.ZodObject<{
|
|
177
|
-
approval: z.
|
|
210
|
+
approval: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
178
211
|
kind: z.ZodLiteral<"unsupported">;
|
|
212
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
213
|
+
kind: z.ZodLiteral<"supported">;
|
|
214
|
+
modes: z.ZodReadonly<z.ZodTuple<[z.ZodReadonly<z.ZodObject<{
|
|
215
|
+
persistence: z.ZodEnum<{
|
|
216
|
+
session: "session";
|
|
217
|
+
once: "once";
|
|
218
|
+
workspace: "workspace";
|
|
219
|
+
}>;
|
|
220
|
+
scopeKinds: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
221
|
+
exact_action: "exact_action";
|
|
222
|
+
command_pattern: "command_pattern";
|
|
223
|
+
domain: "domain";
|
|
224
|
+
tool: "tool";
|
|
225
|
+
server: "server";
|
|
226
|
+
all_edits: "all_edits";
|
|
227
|
+
}>>>;
|
|
228
|
+
}, z.core.$strict>>], z.ZodReadonly<z.ZodObject<{
|
|
229
|
+
persistence: z.ZodEnum<{
|
|
230
|
+
session: "session";
|
|
231
|
+
once: "once";
|
|
232
|
+
workspace: "workspace";
|
|
233
|
+
}>;
|
|
234
|
+
scopeKinds: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
235
|
+
exact_action: "exact_action";
|
|
236
|
+
command_pattern: "command_pattern";
|
|
237
|
+
domain: "domain";
|
|
238
|
+
tool: "tool";
|
|
239
|
+
server: "server";
|
|
240
|
+
all_edits: "all_edits";
|
|
241
|
+
}>>>;
|
|
242
|
+
}, z.core.$strict>>>>;
|
|
243
|
+
providerManagedRemembrance: z.ZodLiteral<false>;
|
|
179
244
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
180
245
|
kind: z.ZodLiteral<"supported">;
|
|
181
246
|
modes: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
@@ -193,7 +258,8 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
|
|
|
193
258
|
all_edits: "all_edits";
|
|
194
259
|
}>>>;
|
|
195
260
|
}, z.core.$strict>>>>;
|
|
196
|
-
|
|
261
|
+
providerManagedRemembrance: z.ZodLiteral<true>;
|
|
262
|
+
}, z.core.$strict>>]>;
|
|
197
263
|
elicitation: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
198
264
|
kind: z.ZodLiteral<"unsupported">;
|
|
199
265
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
@@ -296,9 +362,9 @@ export declare const AgentCapabilitiesPortableSchema: z.ZodReadonly<z.ZodObject<
|
|
|
296
362
|
}>;
|
|
297
363
|
artifactKinds: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
298
364
|
file: "file";
|
|
299
|
-
image: "image";
|
|
300
365
|
plan: "plan";
|
|
301
366
|
other: "other";
|
|
367
|
+
image: "image";
|
|
302
368
|
report: "report";
|
|
303
369
|
diff: "diff";
|
|
304
370
|
log: "log";
|
package/dist/zod/capabilities.js
CHANGED
|
@@ -80,39 +80,41 @@ const PositiveSafeIntegerSchema = z.number().int().positive().max(Number.MAX_SAF
|
|
|
80
80
|
function boundedPositiveSafeInteger(maximum) {
|
|
81
81
|
return z.number().int().positive().max(maximum);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const AgentApprovalCapabilityModeSchema = z.object({
|
|
84
|
+
persistence: z.enum(AGENT_APPROVAL_PERSISTENCES),
|
|
85
|
+
scopeKinds: z.array(z.enum(AGENT_APPROVAL_SCOPE_KINDS)).min(1).max(AGENT_APPROVAL_SCOPE_KINDS.length).meta({ uniqueItems: true }).readonly()
|
|
86
|
+
}).strict().readonly();
|
|
87
|
+
const AgentApprovalCapabilitySchema = z.union([
|
|
84
88
|
z.object({ kind: z.literal("unsupported") }).strict().readonly(),
|
|
85
89
|
z.object({
|
|
86
90
|
kind: z.literal("supported"),
|
|
87
|
-
modes: z.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}).readonly()
|
|
115
|
-
]);
|
|
91
|
+
modes: z.tuple([AgentApprovalCapabilityModeSchema]).rest(AgentApprovalCapabilityModeSchema).refine((modes) => modes.length <= AGENT_APPROVAL_PERSISTENCES.length, {
|
|
92
|
+
message: "Approval modes must contain at most three precise persistences."
|
|
93
|
+
}).meta({ minItems: 1, maxItems: AGENT_APPROVAL_PERSISTENCES.length }).readonly(),
|
|
94
|
+
providerManagedRemembrance: z.literal(false)
|
|
95
|
+
}).strict().readonly(),
|
|
96
|
+
z.object({
|
|
97
|
+
kind: z.literal("supported"),
|
|
98
|
+
modes: z.array(AgentApprovalCapabilityModeSchema).max(AGENT_APPROVAL_PERSISTENCES.length).readonly(),
|
|
99
|
+
providerManagedRemembrance: z.literal(true)
|
|
100
|
+
}).strict().readonly()
|
|
101
|
+
]).superRefine((capability, context) => {
|
|
102
|
+
if (capability.kind === "unsupported") return;
|
|
103
|
+
addCanonicalListIssues({
|
|
104
|
+
values: capability.modes.map((mode) => mode.persistence),
|
|
105
|
+
canonicalOrder: AGENT_APPROVAL_PERSISTENCES,
|
|
106
|
+
path: ["modes"],
|
|
107
|
+
label: "Approval persistence modes"
|
|
108
|
+
}, context);
|
|
109
|
+
capability.modes.forEach((mode, index) => {
|
|
110
|
+
addCanonicalListIssues({
|
|
111
|
+
values: mode.scopeKinds,
|
|
112
|
+
canonicalOrder: AGENT_APPROVAL_SCOPE_KINDS,
|
|
113
|
+
path: ["modes", index, "scopeKinds"],
|
|
114
|
+
label: "Approval scope kinds"
|
|
115
|
+
}, context);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
116
118
|
const AgentContextUsageCapabilitySchema = z.discriminatedUnion("kind", [
|
|
117
119
|
z.object({ kind: z.literal("unsupported") }).strict().readonly(),
|
|
118
120
|
z.object({
|
|
@@ -12,9 +12,9 @@ export declare const AgentCollaborationNodePortableSchema: z.ZodReadonly<z.ZodOb
|
|
|
12
12
|
}>;
|
|
13
13
|
title: z.ZodString;
|
|
14
14
|
status: z.ZodEnum<{
|
|
15
|
+
canceled: "canceled";
|
|
15
16
|
completed: "completed";
|
|
16
17
|
failed: "failed";
|
|
17
|
-
canceled: "canceled";
|
|
18
18
|
running: "running";
|
|
19
19
|
starting: "starting";
|
|
20
20
|
queued: "queued";
|
|
@@ -40,11 +40,11 @@ export declare const AgentCollaborationNodePortableSchema: z.ZodReadonly<z.ZodOb
|
|
|
40
40
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
41
41
|
kind: z.ZodLiteral<"canceled">;
|
|
42
42
|
reason: z.ZodEnum<{
|
|
43
|
+
other: "other";
|
|
43
44
|
user_requested: "user_requested";
|
|
44
45
|
timeout: "timeout";
|
|
45
46
|
shutdown: "shutdown";
|
|
46
47
|
superseded: "superseded";
|
|
47
|
-
other: "other";
|
|
48
48
|
}>;
|
|
49
49
|
}, z.core.$strict>>], "kind">>;
|
|
50
50
|
createdAt: z.ZodType<import("../index.js").AgentIsoDateTime, unknown, z.core.$ZodTypeInternals<import("../index.js").AgentIsoDateTime, unknown>>;
|