@roll-agent/protocol 0.10.0 → 0.12.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/index.js
CHANGED
|
@@ -172,6 +172,7 @@ export function isRuntimeServerRequestMethodRequired(version, method) {
|
|
|
172
172
|
return getRuntimeProtocolCapabilities(version).requiredServerRequestMethods.some((requiredMethod) => requiredMethod === method);
|
|
173
173
|
}
|
|
174
174
|
export const RUNTIME_METHODS = {
|
|
175
|
+
reasoningTextSubscribe: "reasoning.text.subscribe",
|
|
175
176
|
operationResultGet: "operation.result.get",
|
|
176
177
|
initialize: "initialize",
|
|
177
178
|
clientCapabilitiesSet: "client.capabilities.set",
|
|
@@ -184,6 +185,8 @@ export const RUNTIME_METHODS = {
|
|
|
184
185
|
threadDelete: "thread.delete",
|
|
185
186
|
threadDetach: "thread.detach",
|
|
186
187
|
threadCapabilities: "thread.capabilities",
|
|
188
|
+
modelConfigGet: "runtime.modelConfig.get",
|
|
189
|
+
modelConfigReload: "runtime.modelConfig.reload",
|
|
187
190
|
turnStart: "turn.start",
|
|
188
191
|
turnCancel: "turn.cancel",
|
|
189
192
|
approvalRespond: "approval.respond",
|
|
@@ -1038,6 +1041,37 @@ export const threadSnapshotV16Schema = z.union([
|
|
|
1038
1041
|
export const threadSnapshotSchema = threadSnapshotV16Schema;
|
|
1039
1042
|
const pageSizeSchema = z.number().int().min(1).max(500).default(100);
|
|
1040
1043
|
const requestFields = { requestId: requestIdSchema };
|
|
1044
|
+
const modelConfigRevisionSchema = z.int().nonnegative();
|
|
1045
|
+
const runtimeModelConfigIdentitySchema = z
|
|
1046
|
+
.object({ provider: z.string().min(1), model: z.string().min(1) })
|
|
1047
|
+
.strict();
|
|
1048
|
+
const runtimeModelConfigFields = {
|
|
1049
|
+
revision: modelConfigRevisionSchema,
|
|
1050
|
+
active: runtimeModelConfigIdentitySchema
|
|
1051
|
+
.extend({
|
|
1052
|
+
revision: modelConfigRevisionSchema,
|
|
1053
|
+
reasoning: z.enum(["summary", "text"]).nullable(),
|
|
1054
|
+
})
|
|
1055
|
+
.readonly(),
|
|
1056
|
+
};
|
|
1057
|
+
const runtimeModelConfigFailureSchema = z.enum([
|
|
1058
|
+
"invalid-config",
|
|
1059
|
+
"restart-required",
|
|
1060
|
+
"apply-failed",
|
|
1061
|
+
]);
|
|
1062
|
+
export const runtimeModelConfigStatusSchema = z
|
|
1063
|
+
.discriminatedUnion("status", [
|
|
1064
|
+
z.object({ ...runtimeModelConfigFields, status: z.literal("applied") }).strict(),
|
|
1065
|
+
z.object({ ...runtimeModelConfigFields, status: z.literal("pending") }).strict(),
|
|
1066
|
+
z
|
|
1067
|
+
.object({
|
|
1068
|
+
...runtimeModelConfigFields,
|
|
1069
|
+
status: z.literal("failed"),
|
|
1070
|
+
reason: runtimeModelConfigFailureSchema,
|
|
1071
|
+
})
|
|
1072
|
+
.strict(),
|
|
1073
|
+
])
|
|
1074
|
+
.readonly();
|
|
1041
1075
|
const threadRequestFields = { threadId: threadIdSchema };
|
|
1042
1076
|
export const threadListParamsSchema = z
|
|
1043
1077
|
.object({
|
|
@@ -1479,13 +1513,12 @@ const messageCompletedEventSchema = z
|
|
|
1479
1513
|
.object({ type: z.literal("message.completed"), streamId: streamIdSchema, text: z.string() })
|
|
1480
1514
|
.strict()
|
|
1481
1515
|
.readonly();
|
|
1516
|
+
const reasoningDeltaFields = { reasoningId: z.string().min(1), delta: z.string() };
|
|
1482
1517
|
const reasoningSummaryDeltaEventSchema = z
|
|
1483
|
-
.
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
})
|
|
1488
|
-
.strict()
|
|
1518
|
+
.strictObject({ type: z.literal("reasoning.summary.delta"), ...reasoningDeltaFields })
|
|
1519
|
+
.readonly();
|
|
1520
|
+
const reasoningTextDeltaEventSchema = z
|
|
1521
|
+
.strictObject({ type: z.literal("reasoning.text.delta"), ...reasoningDeltaFields })
|
|
1489
1522
|
.readonly();
|
|
1490
1523
|
const toolStartedEventSchema = z
|
|
1491
1524
|
.object({
|
|
@@ -1620,9 +1653,13 @@ export const runtimeDurableEventV16Schema = z.discriminatedUnion("type", [
|
|
|
1620
1653
|
...runtimeDurableEventV15Schema.options,
|
|
1621
1654
|
contextRecoveryChangedEventSchema,
|
|
1622
1655
|
]);
|
|
1656
|
+
export const runtimeEphemeralEventV16Schema = z.discriminatedUnion("type", [
|
|
1657
|
+
...runtimeEphemeralEventV13Schema.options,
|
|
1658
|
+
reasoningTextDeltaEventSchema,
|
|
1659
|
+
]);
|
|
1623
1660
|
export const runtimeEventV16Schema = z.union([
|
|
1624
1661
|
runtimeDurableEventV16Schema,
|
|
1625
|
-
|
|
1662
|
+
runtimeEphemeralEventV16Schema,
|
|
1626
1663
|
]);
|
|
1627
1664
|
/** Latest Runtime Protocol event payloads. */
|
|
1628
1665
|
export const runtimeEventSchema = runtimeEventV16Schema;
|
|
@@ -1759,7 +1796,7 @@ export const runtimeEphemeralEventEnvelopeV16Schema = z
|
|
|
1759
1796
|
protocolVersion: z.literal("1.6"),
|
|
1760
1797
|
...runtimeEventEnvelopeFields,
|
|
1761
1798
|
durability: z.literal("ephemeral"),
|
|
1762
|
-
event:
|
|
1799
|
+
event: runtimeEphemeralEventV16Schema,
|
|
1763
1800
|
})
|
|
1764
1801
|
.strict()
|
|
1765
1802
|
.superRefine(validateRuntimeEventCapabilities)
|
|
@@ -1961,6 +1998,10 @@ export const runtimeMethodSchemasV15 = {
|
|
|
1961
1998
|
};
|
|
1962
1999
|
export const runtimeMethodSchemasV16 = {
|
|
1963
2000
|
...runtimeMethodSchemasV15,
|
|
2001
|
+
[RUNTIME_METHODS.reasoningTextSubscribe]: {
|
|
2002
|
+
params: z.object({}).strict().readonly(),
|
|
2003
|
+
result: z.object({ subscribed: z.boolean() }).strict().readonly(),
|
|
2004
|
+
},
|
|
1964
2005
|
[RUNTIME_METHODS.approvalPreview]: {
|
|
1965
2006
|
params: approvalPreviewParamsSchema,
|
|
1966
2007
|
result: approvalPreviewResultSchema,
|
|
@@ -1974,6 +2015,15 @@ export const runtimeMethodSchemasV16 = {
|
|
|
1974
2015
|
params: threadSnapshotParamsV13Schema,
|
|
1975
2016
|
result: threadSnapshotV16Schema,
|
|
1976
2017
|
},
|
|
2018
|
+
// Optional host extension. Discover support by calling get; the 1.6 handshake stays unchanged.
|
|
2019
|
+
[RUNTIME_METHODS.modelConfigGet]: {
|
|
2020
|
+
params: z.object({}).strict().readonly(),
|
|
2021
|
+
result: runtimeModelConfigStatusSchema,
|
|
2022
|
+
},
|
|
2023
|
+
[RUNTIME_METHODS.modelConfigReload]: {
|
|
2024
|
+
params: z.object(requestFields).strict().readonly(),
|
|
2025
|
+
result: runtimeModelConfigStatusSchema,
|
|
2026
|
+
},
|
|
1977
2027
|
};
|
|
1978
2028
|
export const runtimeMethodSchemas = runtimeMethodSchemasV16;
|
|
1979
2029
|
export const runtimeServerRequestSchemasV10 = {};
|