@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.
Files changed (39) hide show
  1. package/README.md +115 -18
  2. package/dist/capabilities/types.d.ts +6 -1
  3. package/dist/events/types.d.ts +9 -3
  4. package/dist/events/types.js +4 -1
  5. package/dist/foundation/types.d.ts +1 -1
  6. package/dist/foundation/types.js +1 -1
  7. package/dist/jsonSchema/generated.d.ts +11214 -7152
  8. package/dist/jsonSchema/generated.js +2835 -227
  9. package/dist/public/index.d.ts +1 -0
  10. package/dist/public/index.js +1 -0
  11. package/dist/public/sessionInteractions.d.ts +2 -0
  12. package/dist/public/sessionInteractions.js +1 -0
  13. package/dist/requests/elicitation.d.ts +4 -0
  14. package/dist/requests/elicitation.js +107 -0
  15. package/dist/requests/parsers.js +2 -100
  16. package/dist/requests/types.d.ts +17 -4
  17. package/dist/sessionInteractions/index.d.ts +3 -0
  18. package/dist/sessionInteractions/index.js +2 -0
  19. package/dist/sessionInteractions/parsers.d.ts +37 -0
  20. package/dist/sessionInteractions/parsers.js +201 -0
  21. package/dist/sessionInteractions/types.d.ts +162 -0
  22. package/dist/sessionInteractions/types.js +34 -0
  23. package/dist/zod/capabilities.d.ts +72 -6
  24. package/dist/zod/capabilities.js +32 -30
  25. package/dist/zod/collaboration.d.ts +2 -2
  26. package/dist/zod/events.d.ts +75 -42
  27. package/dist/zod/events.js +8 -0
  28. package/dist/zod/foundation.d.ts +1 -0
  29. package/dist/zod/foundation.js +15 -2
  30. package/dist/zod/index.d.ts +2 -1
  31. package/dist/zod/index.js +60 -0
  32. package/dist/zod/operations.d.ts +1 -1
  33. package/dist/zod/requests.d.ts +175 -32
  34. package/dist/zod/requests.js +33 -10
  35. package/dist/zod/sessionInteractions.d.ts +925 -0
  36. package/dist/zod/sessionInteractions.js +284 -0
  37. package/dist/zod/turns.d.ts +1 -1
  38. package/dist/zod/typeEquality.generated.d.ts +38 -4
  39. package/package.json +6 -2
@@ -0,0 +1,284 @@
1
+ import { z } from "zod/v4";
2
+ import {
3
+ AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
4
+ agentProtocolSerializedJsonBytes
5
+ } from "../foundation/types.js";
6
+ import {
7
+ AGENT_ELICITATION_FIELDS_MAX_LENGTH,
8
+ AGENT_ELICITATION_OPTIONS_MAX_LENGTH
9
+ } from "../requests/types.js";
10
+ import {
11
+ AGENT_SESSION_DECISION_CHOICE_DESCRIPTION_MAX_LENGTH,
12
+ AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT,
13
+ AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH,
14
+ AGENT_SESSION_DECISION_DESCRIPTION_MAX_LENGTH,
15
+ AGENT_SESSION_DECISION_RESPONSE_BYTES_LIMIT,
16
+ AGENT_SESSION_DECISION_TITLE_MAX_LENGTH,
17
+ AGENT_SESSION_DECISION_WORKSPACE_PATH_BYTES_LIMIT,
18
+ AGENT_SESSION_FORM_RESPONSE_BYTES_LIMIT,
19
+ AGENT_SESSION_PLAN_ID_BYTES_LIMIT,
20
+ AGENT_SESSION_PLAN_REVISION_BYTES_LIMIT,
21
+ AGENT_SESSION_PLAN_REVIEW_FEEDBACK_BYTES_LIMIT,
22
+ AGENT_SESSION_PLAN_REVIEW_FEEDBACK_MAX_LENGTH,
23
+ AGENT_SESSION_PLAN_REVIEW_RESPONSE_BYTES_LIMIT,
24
+ AGENT_SESSION_PLAN_TEXT_BYTES_LIMIT,
25
+ AGENT_SESSION_REQUEST_BYTES_LIMIT
26
+ } from "../sessionInteractions/types.js";
27
+ import {
28
+ AgentIsoDateTimeSchema,
29
+ AgentRequestIdSchema,
30
+ AgentSessionIdSchema,
31
+ createAgentCanonicalNonBlankStringSchema,
32
+ createAgentCanonicalOpaqueStringSchema,
33
+ withAcyclicProtocolInput
34
+ } from "./foundation.js";
35
+ import {
36
+ AgentElicitationAnswerSchema,
37
+ AgentElicitationFieldSchema,
38
+ refineAgentElicitationAnswers,
39
+ refineAgentElicitationFields
40
+ } from "./requests.js";
41
+ const encoder = new TextEncoder();
42
+ const inputBounds = {
43
+ maxDepth: AGENT_PROTOCOL_JSON_DEPTH_LIMIT,
44
+ maxCollectionLength: AGENT_ELICITATION_OPTIONS_MAX_LENGTH,
45
+ requireJsonData: true
46
+ };
47
+ const SingleLineTextSchema = createAgentCanonicalNonBlankStringSchema(
48
+ AGENT_SESSION_DECISION_TITLE_MAX_LENGTH
49
+ ).regex(/^[^\u0000-\u001F\u007F-\u009F]*$/u);
50
+ function descriptionSchema(maxLength) {
51
+ return createAgentCanonicalNonBlankStringSchema(maxLength).regex(/^[^\u0000-\u0009\u000B-\u001F\u007F-\u009F]*$/u);
52
+ }
53
+ function nominalIdSchema(byteLimit) {
54
+ return createAgentCanonicalOpaqueStringSchema(
55
+ byteLimit,
56
+ "Session identities must be canonical and contain no control characters."
57
+ ).refine(
58
+ (value) => encoder.encode(value).byteLength <= byteLimit,
59
+ "Session identity exceeds its UTF-8 byte limit."
60
+ );
61
+ }
62
+ function nonemptyArraySchema(schema, maxLength) {
63
+ return z.array(schema).min(1).max(maxLength).readonly();
64
+ }
65
+ const AgentSessionDecisionChoiceIdSchema = nominalIdSchema(
66
+ AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT
67
+ );
68
+ const AgentSessionFormChoiceIdSchema = nominalIdSchema(
69
+ AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT
70
+ );
71
+ const AgentSessionPlanReviewChoiceIdSchema = nominalIdSchema(
72
+ AGENT_SESSION_DECISION_CHOICE_ID_BYTES_LIMIT
73
+ );
74
+ const AgentSessionPlanIdSchema = nominalIdSchema(AGENT_SESSION_PLAN_ID_BYTES_LIMIT);
75
+ const AgentSessionPlanRevisionSchema = nominalIdSchema(
76
+ AGENT_SESSION_PLAN_REVISION_BYTES_LIMIT
77
+ );
78
+ const AgentSessionWorkspaceTargetSchema = z.object({
79
+ kind: z.literal("workspace"),
80
+ path: createAgentCanonicalNonBlankStringSchema(AGENT_SESSION_DECISION_WORKSPACE_PATH_BYTES_LIMIT).regex(/^[^\p{Cc}\p{Cf}]*$/u).refine(
81
+ (value) => encoder.encode(value).byteLength <= AGENT_SESSION_DECISION_WORKSPACE_PATH_BYTES_LIMIT,
82
+ "Workspace target path exceeds its UTF-8 byte limit."
83
+ )
84
+ }).strict().readonly();
85
+ const AgentSessionDecisionConsequenceSchema = z.discriminatedUnion("kind", [
86
+ z.object({
87
+ kind: z.literal("grant"),
88
+ scope: z.literal("workspace"),
89
+ persistence: z.object({
90
+ kind: z.literal("provider_managed"),
91
+ duration: z.literal("persistent"),
92
+ mayAffectOtherSessions: z.literal(true)
93
+ }).strict().readonly()
94
+ }).strict().readonly(),
95
+ z.object({
96
+ kind: z.literal("decline"),
97
+ configuration: z.literal("remains_gated")
98
+ }).strict().readonly()
99
+ ]);
100
+ const AgentSessionDecisionChoiceSchema = z.object({
101
+ choiceId: AgentSessionDecisionChoiceIdSchema,
102
+ label: SingleLineTextSchema,
103
+ description: descriptionSchema(AGENT_SESSION_DECISION_CHOICE_DESCRIPTION_MAX_LENGTH),
104
+ consequence: AgentSessionDecisionConsequenceSchema
105
+ }).strict().readonly();
106
+ const requestFields = {
107
+ requestId: AgentRequestIdSchema,
108
+ sessionId: AgentSessionIdSchema,
109
+ title: SingleLineTextSchema,
110
+ description: descriptionSchema(AGENT_SESSION_DECISION_DESCRIPTION_MAX_LENGTH).optional(),
111
+ expiresAt: AgentIsoDateTimeSchema.optional()
112
+ };
113
+ const AgentSessionDecisionRequestPortableSchema = z.object({
114
+ ...requestFields,
115
+ kind: z.literal("decision"),
116
+ target: AgentSessionWorkspaceTargetSchema,
117
+ choices: nonemptyArraySchema(AgentSessionDecisionChoiceSchema, AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH)
118
+ }).strict().readonly();
119
+ const offeredChoiceFields = {
120
+ label: SingleLineTextSchema,
121
+ description: descriptionSchema(AGENT_SESSION_DECISION_CHOICE_DESCRIPTION_MAX_LENGTH).optional()
122
+ };
123
+ const AgentSessionFormChoicePortableSchema = z.discriminatedUnion("action", [
124
+ z.object({ ...offeredChoiceFields, choiceId: AgentSessionFormChoiceIdSchema, action: z.literal("submit") }).strict().readonly(),
125
+ z.object({ ...offeredChoiceFields, choiceId: AgentSessionFormChoiceIdSchema, action: z.literal("cancel") }).strict().readonly()
126
+ ]);
127
+ const AgentSessionFormChoiceSchema = withAcyclicProtocolInput(AgentSessionFormChoicePortableSchema, inputBounds);
128
+ const AgentSessionFormRequestPortableSchema = z.object({
129
+ ...requestFields,
130
+ kind: z.literal("form"),
131
+ fields: nonemptyArraySchema(AgentElicitationFieldSchema, AGENT_ELICITATION_FIELDS_MAX_LENGTH),
132
+ choices: nonemptyArraySchema(AgentSessionFormChoicePortableSchema, AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH)
133
+ }).strict().readonly();
134
+ const AgentSessionPlanSnapshotPortableSchema = z.object({
135
+ planId: AgentSessionPlanIdSchema,
136
+ revision: AgentSessionPlanRevisionSchema,
137
+ title: SingleLineTextSchema,
138
+ content: z.object({
139
+ kind: z.literal("text"),
140
+ format: z.enum(["plain_text", "markdown"]),
141
+ text: z.string().min(1).max(AGENT_SESSION_PLAN_TEXT_BYTES_LIMIT)
142
+ }).strict().readonly()
143
+ }).strict().readonly();
144
+ const AgentSessionPlanSnapshotSchema = AgentSessionPlanSnapshotPortableSchema.superRefine((plan, context) => {
145
+ if (encoder.encode(plan.content.text).byteLength > AGENT_SESSION_PLAN_TEXT_BYTES_LIMIT) {
146
+ context.addIssue({ code: "custom", path: ["content", "text"], message: "Plan text exceeds its UTF-8 byte limit." });
147
+ }
148
+ });
149
+ const AgentSessionPlanReviewChoicePortableSchema = z.object({
150
+ ...offeredChoiceFields,
151
+ choiceId: AgentSessionPlanReviewChoiceIdSchema,
152
+ action: z.enum(["approve", "revise", "abandon"])
153
+ }).strict().readonly();
154
+ const AgentSessionPlanReviewChoiceSchema = withAcyclicProtocolInput(AgentSessionPlanReviewChoicePortableSchema, inputBounds);
155
+ const AgentSessionPlanReviewRequestPortableSchema = z.object({
156
+ ...requestFields,
157
+ kind: z.literal("plan_review"),
158
+ plan: AgentSessionPlanSnapshotPortableSchema,
159
+ choices: nonemptyArraySchema(AgentSessionPlanReviewChoicePortableSchema, AGENT_SESSION_DECISION_CHOICES_MAX_LENGTH)
160
+ }).strict().readonly();
161
+ const AgentSessionRequestPortableSchema = z.discriminatedUnion("kind", [
162
+ AgentSessionDecisionRequestPortableSchema,
163
+ AgentSessionFormRequestPortableSchema,
164
+ AgentSessionPlanReviewRequestPortableSchema
165
+ ]);
166
+ function refineSessionRequest(request, context) {
167
+ if (agentProtocolSerializedJsonBytes(request) > AGENT_SESSION_REQUEST_BYTES_LIMIT) {
168
+ context.addIssue({ code: "custom", message: "Session request exceeds its serialized UTF-8 byte limit." });
169
+ }
170
+ const seenIds = /* @__PURE__ */ new Set();
171
+ const seenActions = /* @__PURE__ */ new Set();
172
+ request.choices.forEach((choice, index) => {
173
+ if (seenIds.has(choice.choiceId)) {
174
+ context.addIssue({ code: "custom", path: ["choices", index, "choiceId"], message: "Session choices must have unique IDs." });
175
+ }
176
+ seenIds.add(choice.choiceId);
177
+ if ("action" in choice) {
178
+ if (seenActions.has(choice.action)) {
179
+ context.addIssue({ code: "custom", path: ["choices", index, "action"], message: "Session choices must have distinct actions." });
180
+ }
181
+ seenActions.add(choice.action);
182
+ }
183
+ });
184
+ if (request.kind === "form") {
185
+ refineAgentElicitationFields(request.fields, context);
186
+ if (!seenActions.has("submit")) {
187
+ context.addIssue({ code: "custom", path: ["choices"], message: "Session forms must offer exactly one submit choice." });
188
+ }
189
+ }
190
+ if (request.kind === "plan_review") {
191
+ const plan = AgentSessionPlanSnapshotSchema.safeParse(request.plan);
192
+ if (!plan.success) {
193
+ for (const issue of plan.error.issues) {
194
+ context.addIssue({ code: "custom", path: ["plan", ...issue.path], message: issue.message });
195
+ }
196
+ }
197
+ }
198
+ }
199
+ const AgentSessionDecisionRequestSchema = withAcyclicProtocolInput(AgentSessionDecisionRequestPortableSchema, inputBounds).superRefine(refineSessionRequest);
200
+ const AgentSessionFormRequestSchema = withAcyclicProtocolInput(AgentSessionFormRequestPortableSchema, inputBounds).superRefine(refineSessionRequest);
201
+ const AgentSessionPlanReviewRequestSchema = withAcyclicProtocolInput(AgentSessionPlanReviewRequestPortableSchema, inputBounds).superRefine(refineSessionRequest);
202
+ const AgentSessionRequestSchema = withAcyclicProtocolInput(AgentSessionRequestPortableSchema, inputBounds).superRefine(refineSessionRequest);
203
+ const AgentSessionDecisionResponsePortableSchema = z.object({
204
+ kind: z.literal("decision"),
205
+ choiceId: AgentSessionDecisionChoiceIdSchema
206
+ }).strict().readonly();
207
+ const AgentSessionFormResponsePortableSchema = z.discriminatedUnion("action", [
208
+ z.object({
209
+ kind: z.literal("form"),
210
+ action: z.literal("submit"),
211
+ choiceId: AgentSessionFormChoiceIdSchema,
212
+ answers: z.array(AgentElicitationAnswerSchema).max(AGENT_ELICITATION_FIELDS_MAX_LENGTH).readonly()
213
+ }).strict().readonly(),
214
+ z.object({
215
+ kind: z.literal("form"),
216
+ action: z.literal("cancel"),
217
+ choiceId: AgentSessionFormChoiceIdSchema
218
+ }).strict().readonly()
219
+ ]);
220
+ const planResponseFields = {
221
+ kind: z.literal("plan_review"),
222
+ choiceId: AgentSessionPlanReviewChoiceIdSchema,
223
+ planId: AgentSessionPlanIdSchema,
224
+ revision: AgentSessionPlanRevisionSchema
225
+ };
226
+ const AgentSessionPlanReviewResponsePortableSchema = z.discriminatedUnion("action", [
227
+ z.object({ ...planResponseFields, action: z.enum(["approve", "abandon"]) }).strict().readonly(),
228
+ z.object({
229
+ ...planResponseFields,
230
+ action: z.literal("revise"),
231
+ feedback: z.string().min(1).max(AGENT_SESSION_PLAN_REVIEW_FEEDBACK_MAX_LENGTH).regex(/\S/u, "Revision feedback must contain non-whitespace content.")
232
+ }).strict().readonly()
233
+ ]);
234
+ const AgentSessionResponsePortableSchema = z.union([
235
+ AgentSessionDecisionResponsePortableSchema,
236
+ AgentSessionFormResponsePortableSchema,
237
+ AgentSessionPlanReviewResponsePortableSchema
238
+ ]);
239
+ function refineSessionResponse(response, context) {
240
+ const byteLimit = response.kind === "decision" ? AGENT_SESSION_DECISION_RESPONSE_BYTES_LIMIT : response.kind === "form" ? AGENT_SESSION_FORM_RESPONSE_BYTES_LIMIT : AGENT_SESSION_PLAN_REVIEW_RESPONSE_BYTES_LIMIT;
241
+ if (agentProtocolSerializedJsonBytes(response) > byteLimit) {
242
+ context.addIssue({ code: "custom", message: "Session response exceeds its serialized UTF-8 byte limit." });
243
+ }
244
+ if (response.kind === "form" && response.action === "submit") {
245
+ refineAgentElicitationAnswers(response.answers, context);
246
+ }
247
+ if (response.kind === "plan_review" && response.action === "revise" && encoder.encode(response.feedback).byteLength > AGENT_SESSION_PLAN_REVIEW_FEEDBACK_BYTES_LIMIT) {
248
+ context.addIssue({ code: "custom", path: ["feedback"], message: "Revision feedback exceeds its UTF-8 byte limit." });
249
+ }
250
+ }
251
+ const AgentSessionDecisionResponseSchema = withAcyclicProtocolInput(AgentSessionDecisionResponsePortableSchema, inputBounds).superRefine(refineSessionResponse);
252
+ const AgentSessionFormResponseSchema = withAcyclicProtocolInput(AgentSessionFormResponsePortableSchema, inputBounds).superRefine(refineSessionResponse);
253
+ const AgentSessionPlanReviewResponseSchema = withAcyclicProtocolInput(AgentSessionPlanReviewResponsePortableSchema, inputBounds).superRefine(refineSessionResponse);
254
+ const AgentSessionResponseSchema = withAcyclicProtocolInput(AgentSessionResponsePortableSchema, inputBounds).superRefine(refineSessionResponse);
255
+ export {
256
+ AgentSessionDecisionChoiceIdSchema,
257
+ AgentSessionDecisionChoiceSchema,
258
+ AgentSessionDecisionConsequenceSchema,
259
+ AgentSessionDecisionRequestPortableSchema,
260
+ AgentSessionDecisionRequestSchema,
261
+ AgentSessionDecisionResponsePortableSchema,
262
+ AgentSessionDecisionResponseSchema,
263
+ AgentSessionFormChoiceIdSchema,
264
+ AgentSessionFormChoiceSchema,
265
+ AgentSessionFormRequestPortableSchema,
266
+ AgentSessionFormRequestSchema,
267
+ AgentSessionFormResponsePortableSchema,
268
+ AgentSessionFormResponseSchema,
269
+ AgentSessionPlanIdSchema,
270
+ AgentSessionPlanReviewChoiceIdSchema,
271
+ AgentSessionPlanReviewChoiceSchema,
272
+ AgentSessionPlanReviewRequestPortableSchema,
273
+ AgentSessionPlanReviewRequestSchema,
274
+ AgentSessionPlanReviewResponsePortableSchema,
275
+ AgentSessionPlanReviewResponseSchema,
276
+ AgentSessionPlanRevisionSchema,
277
+ AgentSessionPlanSnapshotPortableSchema,
278
+ AgentSessionPlanSnapshotSchema,
279
+ AgentSessionRequestPortableSchema,
280
+ AgentSessionRequestSchema,
281
+ AgentSessionResponsePortableSchema,
282
+ AgentSessionResponseSchema,
283
+ AgentSessionWorkspaceTargetSchema
284
+ };
@@ -241,9 +241,9 @@ export declare const AgentPlanStepSchema: z.ZodType<AgentPlanStep>;
241
241
  export declare const AgentDiffSummarySchema: z.ZodType<AgentDiffSummary>;
242
242
  export declare const AgentTurnCompletedPayloadPortableSchema: z.ZodReadonly<z.ZodObject<{
243
243
  outcome: z.ZodEnum<{
244
+ canceled: "canceled";
244
245
  completed: "completed";
245
246
  failed: "failed";
246
- canceled: "canceled";
247
247
  expired: "expired";
248
248
  }>;
249
249
  reason: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  import type { z } from 'zod/v4';
2
2
  import type { AgentAccountQuotaReset, AgentAccountQuotaSnapshot, AgentAccountQuotaWindow } from '../accountQuota/types.js';
3
3
  import type { AgentArtifactDescriptor } from '../artifacts/types.js';
4
- import type { AgentCapabilities } from '../capabilities/types.js';
4
+ import type { AgentApprovalCapability, AgentCapabilities } from '../capabilities/types.js';
5
5
  import type { AgentCollaborationControlInput, AgentCollaborationNode, AgentCollaborationSpawnInput } from '../collaboration/types.js';
6
6
  import type { AgentCommandCatalog, AgentCommandDescriptor } from '../commands/types.js';
7
7
  import type { AgentConfigurationCatalog, AgentConfigurationSelectionInput } from '../configuration/types.js';
@@ -14,13 +14,14 @@ import type { AgentJsonValue, AgentProviderRefs } from '../foundation/types.js';
14
14
  import type { AgentIntegrationCatalog, AgentIntegrationDescriptor, AgentMcpIntegrationDescriptor } from '../integrations/types.js';
15
15
  import type { AgentManagedContentCatalog, AgentManagedContentDescriptor } from '../managedContent/types.js';
16
16
  import type { AgentOperationCatalog, AgentOperationDescriptor, AgentOperationInvocation, AgentOperationResult } from '../operations/types.js';
17
- import type { AgentRequest, AgentRequestResolution } from '../requests/types.js';
17
+ import type { AgentApprovalConsequence, AgentRequest, AgentRequestResolution } from '../requests/types.js';
18
18
  import type { AgentGeneratedResourceDescriptor } from '../resources/types.js';
19
+ import type { AgentSessionDecisionChoice, AgentSessionDecisionConsequence, AgentSessionDecisionRequest, AgentSessionDecisionResponse, AgentSessionFormChoice, AgentSessionFormRequest, AgentSessionFormResponse, AgentSessionPlanReviewChoice, AgentSessionPlanReviewRequest, AgentSessionPlanReviewResponse, AgentSessionPlanSnapshot, AgentSessionRequest, AgentSessionResponse, AgentSessionWorkspaceTarget } from '../sessionInteractions/types.js';
19
20
  import type { AgentSessionBinding, AgentSessionConfiguration, AgentSessionOpenInput } from '../sessions/types.js';
20
21
  import type { AgentContentReferenceInputPart, AgentItemSnapshot, AgentTurnInputContent, AgentTurnInterruptionInput, AgentTurnRunInput } from '../turns/types.js';
21
22
  import { AgentAccountQuotaResetSchema, AgentAccountQuotaSnapshotSchema, AgentAccountQuotaWindowSchema } from './accountQuota.js';
22
23
  import { AgentArtifactDescriptorSchema } from './artifacts.js';
23
- import { AgentCapabilitiesSchema } from './capabilities.js';
24
+ import { AgentApprovalCapabilitySchema, AgentCapabilitiesSchema } from './capabilities.js';
24
25
  import { AgentCollaborationControlInputSchema, AgentCollaborationNodeSchema, AgentCollaborationSpawnInputSchema } from './collaboration.js';
25
26
  import { AgentCommandCatalogSchema, AgentCommandDescriptorSchema } from './commands.js';
26
27
  import { AgentConfigurationCatalogSchema, AgentConfigurationSelectionInputSchema } from './configuration.js';
@@ -33,13 +34,42 @@ import { AgentJsonValueSchema, AgentProviderRefsSchema } from './foundation.js';
33
34
  import { AgentIntegrationCatalogSchema, AgentIntegrationDescriptorSchema, AgentMcpIntegrationDescriptorSchema } from './integrations.js';
34
35
  import { AgentManagedContentCatalogSchema, AgentManagedContentDescriptorSchema } from './managedContent.js';
35
36
  import { AgentOperationCatalogSchema, AgentOperationDescriptorSchema, AgentOperationInvocationSchema, AgentOperationResultSchema } from './operations.js';
36
- import { AgentRequestResolutionSchema, AgentRequestSchema } from './requests.js';
37
+ import { AgentApprovalConsequenceSchema, AgentRequestResolutionSchema, AgentRequestSchema } from './requests.js';
37
38
  import { AgentGeneratedResourceDescriptorSchema } from './resources.js';
39
+ import { AgentSessionDecisionChoiceSchema, AgentSessionDecisionConsequenceSchema, AgentSessionDecisionRequestSchema, AgentSessionDecisionResponseSchema, AgentSessionFormChoiceSchema, AgentSessionFormRequestSchema, AgentSessionFormResponseSchema, AgentSessionPlanReviewChoiceSchema, AgentSessionPlanReviewRequestSchema, AgentSessionPlanReviewResponseSchema, AgentSessionPlanSnapshotSchema, AgentSessionRequestSchema, AgentSessionResponseSchema, AgentSessionWorkspaceTargetSchema } from './sessionInteractions.js';
38
40
  import { AgentSessionBindingSchema, AgentSessionConfigurationSchema, AgentSessionOpenInputSchema } from './sessions.js';
39
41
  import { AgentContentReferenceInputPartSchema, AgentItemSnapshotSchema, AgentTurnInputContentSchema, AgentTurnInterruptionInputSchema, AgentTurnRunInputSchema } from './turns.js';
40
42
  type Extends<Left, Right> = [Left] extends [Right] ? true : false;
41
43
  type Assert<Value extends true> = Value;
42
44
  export type AgentProtocolSchemaTypeAssertions = readonly [
45
+ Assert<Extends<z.output<typeof AgentSessionWorkspaceTargetSchema>, AgentSessionWorkspaceTarget>>,
46
+ Assert<Extends<AgentSessionWorkspaceTarget, z.output<typeof AgentSessionWorkspaceTargetSchema>>>,
47
+ Assert<Extends<z.output<typeof AgentSessionDecisionConsequenceSchema>, AgentSessionDecisionConsequence>>,
48
+ Assert<Extends<AgentSessionDecisionConsequence, z.output<typeof AgentSessionDecisionConsequenceSchema>>>,
49
+ Assert<Extends<z.output<typeof AgentSessionDecisionChoiceSchema>, AgentSessionDecisionChoice>>,
50
+ Assert<Extends<AgentSessionDecisionChoice, z.output<typeof AgentSessionDecisionChoiceSchema>>>,
51
+ Assert<Extends<z.output<typeof AgentSessionDecisionRequestSchema>, AgentSessionDecisionRequest>>,
52
+ Assert<Extends<AgentSessionDecisionRequest, z.output<typeof AgentSessionDecisionRequestSchema>>>,
53
+ Assert<Extends<z.output<typeof AgentSessionDecisionResponseSchema>, AgentSessionDecisionResponse>>,
54
+ Assert<Extends<AgentSessionDecisionResponse, z.output<typeof AgentSessionDecisionResponseSchema>>>,
55
+ Assert<Extends<z.output<typeof AgentSessionFormChoiceSchema>, AgentSessionFormChoice>>,
56
+ Assert<Extends<AgentSessionFormChoice, z.output<typeof AgentSessionFormChoiceSchema>>>,
57
+ Assert<Extends<z.output<typeof AgentSessionFormRequestSchema>, AgentSessionFormRequest>>,
58
+ Assert<Extends<AgentSessionFormRequest, z.output<typeof AgentSessionFormRequestSchema>>>,
59
+ Assert<Extends<z.output<typeof AgentSessionFormResponseSchema>, AgentSessionFormResponse>>,
60
+ Assert<Extends<AgentSessionFormResponse, z.output<typeof AgentSessionFormResponseSchema>>>,
61
+ Assert<Extends<z.output<typeof AgentSessionPlanSnapshotSchema>, AgentSessionPlanSnapshot>>,
62
+ Assert<Extends<AgentSessionPlanSnapshot, z.output<typeof AgentSessionPlanSnapshotSchema>>>,
63
+ Assert<Extends<z.output<typeof AgentSessionPlanReviewChoiceSchema>, AgentSessionPlanReviewChoice>>,
64
+ Assert<Extends<AgentSessionPlanReviewChoice, z.output<typeof AgentSessionPlanReviewChoiceSchema>>>,
65
+ Assert<Extends<z.output<typeof AgentSessionPlanReviewRequestSchema>, AgentSessionPlanReviewRequest>>,
66
+ Assert<Extends<AgentSessionPlanReviewRequest, z.output<typeof AgentSessionPlanReviewRequestSchema>>>,
67
+ Assert<Extends<z.output<typeof AgentSessionPlanReviewResponseSchema>, AgentSessionPlanReviewResponse>>,
68
+ Assert<Extends<AgentSessionPlanReviewResponse, z.output<typeof AgentSessionPlanReviewResponseSchema>>>,
69
+ Assert<Extends<z.output<typeof AgentSessionRequestSchema>, AgentSessionRequest>>,
70
+ Assert<Extends<AgentSessionRequest, z.output<typeof AgentSessionRequestSchema>>>,
71
+ Assert<Extends<z.output<typeof AgentSessionResponseSchema>, AgentSessionResponse>>,
72
+ Assert<Extends<AgentSessionResponse, z.output<typeof AgentSessionResponseSchema>>>,
43
73
  Assert<Extends<z.output<typeof AgentEffectiveContentCatalogSchema>, AgentEffectiveContentCatalog>>,
44
74
  Assert<Extends<AgentEffectiveContentCatalog, z.output<typeof AgentEffectiveContentCatalogSchema>>>,
45
75
  Assert<Extends<z.output<typeof AgentEffectiveContentDescriptorSchema>, AgentEffectiveContentDescriptor>>,
@@ -94,6 +124,10 @@ export type AgentProtocolSchemaTypeAssertions = readonly [
94
124
  Assert<Extends<AgentTurnInterruptionInput, z.output<typeof AgentTurnInterruptionInputSchema>>>,
95
125
  Assert<Extends<z.output<typeof AgentItemSnapshotSchema>, AgentItemSnapshot>>,
96
126
  Assert<Extends<AgentItemSnapshot, z.output<typeof AgentItemSnapshotSchema>>>,
127
+ Assert<Extends<z.output<typeof AgentApprovalConsequenceSchema>, AgentApprovalConsequence>>,
128
+ Assert<Extends<AgentApprovalConsequence, z.output<typeof AgentApprovalConsequenceSchema>>>,
129
+ Assert<Extends<z.output<typeof AgentApprovalCapabilitySchema>, AgentApprovalCapability>>,
130
+ Assert<Extends<AgentApprovalCapability, z.output<typeof AgentApprovalCapabilitySchema>>>,
97
131
  Assert<Extends<z.output<typeof AgentRequestSchema>, AgentRequest>>,
98
132
  Assert<Extends<AgentRequest, z.output<typeof AgentRequestSchema>>>,
99
133
  Assert<Extends<z.output<typeof AgentRequestResolutionSchema>, AgentRequestResolution>>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agen-ai/agent-protocol",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "private": false,
5
5
  "description": "Provider-neutral sessions, turns, requests, capabilities, artifacts, and events for coding-agent runtimes.",
6
6
  "type": "module",
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/public/sessions.d.ts",
25
25
  "import": "./dist/public/sessions.js"
26
26
  },
27
+ "./session-interactions": {
28
+ "types": "./dist/public/sessionInteractions.d.ts",
29
+ "import": "./dist/public/sessionInteractions.js"
30
+ },
27
31
  "./turns": {
28
32
  "types": "./dist/public/turns.d.ts",
29
33
  "import": "./dist/public/turns.js"
@@ -100,7 +104,7 @@
100
104
  },
101
105
  "dependencies": {
102
106
  "zod": "4.4.3",
103
- "@agen-ai/validation": "^0.4.0"
107
+ "@agen-ai/validation": "^0.4.2"
104
108
  },
105
109
  "devDependencies": {
106
110
  "ajv": "8.17.1",