@byok-sdk/protocol 0.23.0 → 0.25.0-rc.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 CHANGED
@@ -20,4 +20,4 @@ the additive field and silently executing a runtime-only offer.
20
20
  import { encodeEnvelope, decodeEnvelope } from '@byok-sdk/protocol';
21
21
  ```
22
22
 
23
- MIT licensed. Node.js 22.22.0 or newer.
23
+ MIT licensed. Node.js 24.15.0 or newer.
@@ -41,15 +41,16 @@ export declare const ContentReadPolicySchema: z.ZodObject<{
41
41
  allowedMimeTypes: z.ZodArray<z.ZodString>;
42
42
  }, z.core.$strict>;
43
43
  export type ContentReadPolicy = z.infer<typeof ContentReadPolicySchema>;
44
- export declare const AgentEgressActivityPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
- mode: z.ZodLiteral<"metadata-status">;
46
- delivery: z.ZodLiteral<"latest-value">;
47
- }, z.core.$strict>, z.ZodObject<{
48
- mode: z.ZodLiteral<"contentful-trajectory">;
44
+ /**
45
+ * The latest-value activity lane. Agent events go to the Host as the runtime
46
+ * produced them; these limits only bound transport (coalesce window and one
47
+ * event's byte size).
48
+ */
49
+ export declare const AgentEgressActivityPolicySchema: z.ZodObject<{
49
50
  delivery: z.ZodLiteral<"latest-value">;
50
51
  maxCoalesceMs: z.ZodNumber;
51
52
  maxEventBytes: z.ZodNumber;
52
- }, z.core.$strict>], "mode">;
53
+ }, z.core.$strict>;
53
54
  export type AgentEgressActivityPolicy = z.infer<typeof AgentEgressActivityPolicySchema>;
54
55
  export declare const AgentReliableQuotaPolicySchema: z.ZodObject<{
55
56
  maxPendingEventsPerAgent: z.ZodNumber;
@@ -58,21 +59,18 @@ export declare const AgentReliableQuotaPolicySchema: z.ZodObject<{
58
59
  }, z.core.$strict>;
59
60
  export type AgentReliableQuotaPolicy = z.infer<typeof AgentReliableQuotaPolicySchema>;
60
61
  /**
61
- * The only consumable policy shape for Agent egress. Missing/unknown policy
62
- * is intentionally not represented as a default: callers must select a
63
- * revision and all three content surfaces independently.
62
+ * The only consumable policy shape for Agent egress. It selects transport
63
+ * limits and the Host content-read surfaces. It does not filter, redact or
64
+ * omit Agent egress content. Callers must select a revision and all three
65
+ * content-read surfaces independently.
64
66
  */
65
67
  export declare const AgentEgressPolicySchema: z.ZodObject<{
66
68
  policyRevision: z.ZodString;
67
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
- mode: z.ZodLiteral<"metadata-status">;
69
- delivery: z.ZodLiteral<"latest-value">;
70
- }, z.core.$strict>, z.ZodObject<{
71
- mode: z.ZodLiteral<"contentful-trajectory">;
69
+ activity: z.ZodObject<{
72
70
  delivery: z.ZodLiteral<"latest-value">;
73
71
  maxCoalesceMs: z.ZodNumber;
74
72
  maxEventBytes: z.ZodNumber;
75
- }, z.core.$strict>], "mode">;
73
+ }, z.core.$strict>;
76
74
  reliable: z.ZodObject<{
77
75
  maxPendingEventsPerAgent: z.ZodNumber;
78
76
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -110,7 +108,6 @@ export declare const AgentEgressDropReasonSchema: z.ZodEnum<{
110
108
  invalid_envelope: "invalid_envelope";
111
109
  policy_denied: "policy_denied";
112
110
  quota_exceeded: "quota_exceeded";
113
- sanitizer_rejected: "sanitizer_rejected";
114
111
  }>;
115
112
  export type AgentEgressDropReason = z.infer<typeof AgentEgressDropReasonSchema>;
116
113
  export declare const AgentContentReadSurfaceSchema: z.ZodEnum<{
@@ -129,6 +129,12 @@ export declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
129
129
  outputTokens: z.ZodOptional<z.ZodNumber>;
130
130
  reasoningTokens: z.ZodOptional<z.ZodNumber>;
131
131
  totalTokens: z.ZodOptional<z.ZodNumber>;
132
+ contextTokens: z.ZodOptional<z.ZodNumber>;
133
+ contextWindow: z.ZodOptional<z.ZodNumber>;
134
+ contextSource: z.ZodOptional<z.ZodEnum<{
135
+ estimate: "estimate";
136
+ provider: "provider";
137
+ }>>;
132
138
  }, z.core.$strip>], "type">;
133
139
  export type AgentEvent = z.infer<typeof AgentEventSchema>;
134
140
  /**
@@ -174,7 +180,7 @@ export declare const KNOWN_AGENT_EVENT_TYPES: readonly string[];
174
180
  * combines this with {@link AgentEventSchema} for real use.
175
181
  *
176
182
  * Deliberately asymmetric with envelope-level control/security fields
177
- * (`instruction`, `policy` — see `messages.ts`/`permission.ts`), which stay
183
+ * (`instruction` — see `messages.ts`), which stay
178
184
  * fail-closed on unknown shapes with no equivalent widening: this tolerance
179
185
  * applies only to observability data (agent progress events), never to
180
186
  * control/security surfaces. That asymmetry is the freeze rule.
@@ -257,6 +263,12 @@ export declare const AgentEventOrUnknownSchema: z.ZodUnion<readonly [z.ZodDiscri
257
263
  outputTokens: z.ZodOptional<z.ZodNumber>;
258
264
  reasoningTokens: z.ZodOptional<z.ZodNumber>;
259
265
  totalTokens: z.ZodOptional<z.ZodNumber>;
266
+ contextTokens: z.ZodOptional<z.ZodNumber>;
267
+ contextWindow: z.ZodOptional<z.ZodNumber>;
268
+ contextSource: z.ZodOptional<z.ZodEnum<{
269
+ estimate: "estimate";
270
+ provider: "provider";
271
+ }>>;
260
272
  }, z.core.$strip>], "type">, z.ZodObject<{
261
273
  type: z.ZodString;
262
274
  }, z.core.$loose>]>;