@roll-agent/protocol 0.9.0 → 0.10.0
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/dist/app-output.d.ts +2 -2
- package/dist/index.d.ts +2284 -2283
- package/dist/index.js +37 -28
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -253,22 +253,29 @@ export const TOOL_OUTCOME_KINDS = [
|
|
|
253
253
|
"cancelled",
|
|
254
254
|
"tool_failed",
|
|
255
255
|
];
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
export const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
export const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
export const
|
|
265
|
-
export const
|
|
256
|
+
// Wire formats are owned by Protocol: dependency upgrades must not broaden UUIDs or
|
|
257
|
+
// reject timestamps that existing clients could send (including minute precision).
|
|
258
|
+
export const uuidSchema = z
|
|
259
|
+
.string()
|
|
260
|
+
.check(z.stringFormat("uuid", /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/));
|
|
261
|
+
export const timestampSchema = z
|
|
262
|
+
.string()
|
|
263
|
+
.check(z.stringFormat("datetime", /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-]\d{2}:\d{2})))$/));
|
|
264
|
+
export const threadIdSchema = uuidSchema.clone().brand();
|
|
265
|
+
export const turnIdSchema = uuidSchema.clone().brand();
|
|
266
|
+
export const approvalIdSchema = uuidSchema.clone().brand();
|
|
267
|
+
export const interactionIdSchema = uuidSchema.clone().brand();
|
|
268
|
+
export const runtimeInstanceIdSchema = uuidSchema.clone().brand();
|
|
269
|
+
export const requestIdSchema = uuidSchema.clone().brand();
|
|
270
|
+
export const streamIdSchema = uuidSchema.clone().brand();
|
|
271
|
+
export const operationIdSchema = uuidSchema.clone().brand();
|
|
272
|
+
export const runtimeEventIdSchema = uuidSchema.clone().brand();
|
|
273
|
+
export const attachmentIdSchema = uuidSchema.clone().brand();
|
|
266
274
|
export const runtimeEventCursorSchema = z
|
|
267
275
|
.string()
|
|
268
276
|
.max(128)
|
|
269
277
|
.regex(/^rte1:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}:(?:0|[1-9]\d*):[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/u)
|
|
270
278
|
.brand();
|
|
271
|
-
export const timestampSchema = z.string().datetime({ offset: true });
|
|
272
279
|
export const jsonValueSchema = z.json();
|
|
273
280
|
export const jsonRpcIdSchema = z.union([z.string(), z.number()]);
|
|
274
281
|
export const runtimeProtocolVersionSchema = z.enum(SUPPORTED_RUNTIME_PROTOCOL_VERSIONS);
|
|
@@ -934,14 +941,8 @@ const recoveryThreadSummarySchema = z
|
|
|
934
941
|
id: threadIdSchema,
|
|
935
942
|
title: z.string().max(RUNTIME_V13_RECOVERY_SNAPSHOT_METADATA_MAX_CHARS).optional(),
|
|
936
943
|
model: z.string().max(RUNTIME_V13_RECOVERY_SNAPSHOT_METADATA_MAX_CHARS).optional(),
|
|
937
|
-
createdAt:
|
|
938
|
-
|
|
939
|
-
.max(RUNTIME_V13_RECOVERY_SNAPSHOT_TIMESTAMP_MAX_CHARS)
|
|
940
|
-
.datetime({ offset: true }),
|
|
941
|
-
updatedAt: z
|
|
942
|
-
.string()
|
|
943
|
-
.max(RUNTIME_V13_RECOVERY_SNAPSHOT_TIMESTAMP_MAX_CHARS)
|
|
944
|
-
.datetime({ offset: true }),
|
|
944
|
+
createdAt: timestampSchema.max(RUNTIME_V13_RECOVERY_SNAPSHOT_TIMESTAMP_MAX_CHARS),
|
|
945
|
+
updatedAt: timestampSchema.max(RUNTIME_V13_RECOVERY_SNAPSHOT_TIMESTAMP_MAX_CHARS),
|
|
945
946
|
messageCount: z.number().int().nonnegative(),
|
|
946
947
|
})
|
|
947
948
|
.strict()
|
|
@@ -964,10 +965,7 @@ const recoveryActiveTurnSchema = z
|
|
|
964
965
|
.object({
|
|
965
966
|
id: turnIdSchema,
|
|
966
967
|
status: z.enum(["running", "cancelling", "waiting-for-user"]),
|
|
967
|
-
startedAt:
|
|
968
|
-
.string()
|
|
969
|
-
.max(RUNTIME_V13_RECOVERY_SNAPSHOT_TIMESTAMP_MAX_CHARS)
|
|
970
|
-
.datetime({ offset: true }),
|
|
968
|
+
startedAt: timestampSchema.max(RUNTIME_V13_RECOVERY_SNAPSHOT_TIMESTAMP_MAX_CHARS),
|
|
971
969
|
})
|
|
972
970
|
.strict()
|
|
973
971
|
.readonly();
|
|
@@ -1016,7 +1014,7 @@ export const threadSnapshotV15Schema = z.union([
|
|
|
1016
1014
|
/** Bounded Harness state only; no model-authored recovery notes or fact contents cross the wire. */
|
|
1017
1015
|
export const contextRecoveryViewSchema = z
|
|
1018
1016
|
.object({
|
|
1019
|
-
checkpointId:
|
|
1017
|
+
checkpointId: uuidSchema.clone(),
|
|
1020
1018
|
required: z.boolean(),
|
|
1021
1019
|
unextracted: z.boolean(),
|
|
1022
1020
|
requiredItemCount: z.number().int().nonnegative(),
|
|
@@ -1744,16 +1742,27 @@ export const runtimeEventEnvelopeV15Schema = z.discriminatedUnion("durability",
|
|
|
1744
1742
|
runtimeEphemeralEventEnvelopeV15Schema,
|
|
1745
1743
|
]);
|
|
1746
1744
|
/** Any currently supported Runtime Event envelope. */
|
|
1747
|
-
export const runtimeDurableEventEnvelopeV16Schema =
|
|
1748
|
-
.
|
|
1745
|
+
export const runtimeDurableEventEnvelopeV16Schema = z
|
|
1746
|
+
.object({
|
|
1749
1747
|
protocolVersion: z.literal("1.6"),
|
|
1748
|
+
...runtimeEventEnvelopeFields,
|
|
1749
|
+
durability: z.literal("durable"),
|
|
1750
|
+
eventId: runtimeEventIdSchema,
|
|
1751
|
+
cursor: runtimeEventCursorSchema,
|
|
1750
1752
|
event: runtimeDurableEventV16Schema,
|
|
1751
1753
|
})
|
|
1754
|
+
.strict()
|
|
1755
|
+
.superRefine(validateRuntimeEventCapabilities)
|
|
1752
1756
|
.readonly();
|
|
1753
|
-
export const runtimeEphemeralEventEnvelopeV16Schema =
|
|
1754
|
-
.
|
|
1757
|
+
export const runtimeEphemeralEventEnvelopeV16Schema = z
|
|
1758
|
+
.object({
|
|
1755
1759
|
protocolVersion: z.literal("1.6"),
|
|
1760
|
+
...runtimeEventEnvelopeFields,
|
|
1761
|
+
durability: z.literal("ephemeral"),
|
|
1762
|
+
event: runtimeEphemeralEventV13Schema,
|
|
1756
1763
|
})
|
|
1764
|
+
.strict()
|
|
1765
|
+
.superRefine(validateRuntimeEventCapabilities)
|
|
1757
1766
|
.readonly();
|
|
1758
1767
|
export const runtimeEventEnvelopeV16Schema = z.discriminatedUnion("durability", [
|
|
1759
1768
|
runtimeDurableEventEnvelopeV16Schema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"fixtures"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"zod": "
|
|
45
|
+
"zod": "4.6.6"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.0.0",
|