@nylorun/core 0.41.0-beta → 0.43.0-beta
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/CHANGELOG.md +15 -0
- package/dist/compatibility.d.ts +9 -1
- package/dist/compatibility.js +8 -0
- package/dist/contracts.d.ts +65 -0
- package/dist/contracts.js +18 -1
- package/dist/types/model.d.ts +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.43.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 745ef22: A model call's retries are in its event. `message.assistant` and `model.failed` carry `attempts`, the provider calls the gate made for the call (the first included), and `retries`, one `{ attempt, delayMs, error }` for each retry (the error as the provider worded it, cut to 300 characters, with the provider's credential scrubbed). Before, a call that answered after a retry was one `message.assistant` that showed no sign of it, and a call that failed after its attempts showed only its last error; the retries were only in the gates service's `model_retry` log lines.
|
|
8
|
+
|
|
9
|
+
- `@nylorun/core`: `ModelRetrySchema`, and the optional `attempts` and `retries` on the facts `message.assistant`, `model.failed` and `context.compacted` share. `ModelFailureOutcome` takes optional `attempts` and `retries`.
|
|
10
|
+
- `@nylorun/runtime`: the gate's answer reports them in `evidence.extras`, the usage ledger keeps them (`model_usage.attempts` and `retries`, store migration 0047, nullable, run at start), and the call's event takes them from its row; a failed call's from its failure outcome. A trace's chat span has `nylorun.model.attempts`. A retried call is still metered once, as one call. `/calls/model` is unchanged.
|
|
11
|
+
|
|
12
|
+
## 0.42.0-beta
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 6b49200: A2A `SendMessage` takes `message.metadata.delivery: "steer"` (Host feature `a2a-steer`, ADR-140), a session message's steer (D85): to a busy context the message waits marked `steer`, and the running turn takes it before its next step, so its task becomes that turn's. To an idle context it starts a turn; to a workflow's, or a turn past its last step, it is an ordinary queued message. The task answered to a steer carries `metadata.delivery`: `steered`, or `queued` when the message started a turn or waits unmarked; callers that don't ask for steer get the same answer as before. `createA2aClient`'s `send` takes `delivery: "steer"`, and `readDelivery(task)` reads what applied.
|
|
17
|
+
|
|
3
18
|
## 0.41.0-beta
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -275,7 +275,15 @@ export declare const OPTIONAL_HOST_FEATURES: readonly ["tenant-fixture-model", "
|
|
|
275
275
|
* queue (`queue.cancelled`), and a failed or cancelled queued task answers, and pushes,
|
|
276
276
|
* `FAILED` or `CANCELED`.
|
|
277
277
|
*/
|
|
278
|
-
"queue-recovery"
|
|
278
|
+
"queue-recovery",
|
|
279
|
+
/**
|
|
280
|
+
* The A2A endpoint's `message.metadata.delivery: "steer"` (ADR-140): a session message's steer
|
|
281
|
+
* (`steer`, D85). To a busy context the message waits marked `steer` and the running turn takes
|
|
282
|
+
* it before its next step, its task then that turn's; to an idle context, a workflow's, or a
|
|
283
|
+
* turn past its last step it is an ordinary queued message. The task `SendMessage` answers
|
|
284
|
+
* carries `metadata.delivery`: `steered` or `queued`.
|
|
285
|
+
*/
|
|
286
|
+
"a2a-steer"];
|
|
279
287
|
export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
|
|
280
288
|
export interface ProtocolRange {
|
|
281
289
|
min: number;
|
package/dist/compatibility.js
CHANGED
|
@@ -298,6 +298,14 @@ export const OPTIONAL_HOST_FEATURES = [
|
|
|
298
298
|
* `FAILED` or `CANCELED`.
|
|
299
299
|
*/
|
|
300
300
|
"queue-recovery",
|
|
301
|
+
/**
|
|
302
|
+
* The A2A endpoint's `message.metadata.delivery: "steer"` (ADR-140): a session message's steer
|
|
303
|
+
* (`steer`, D85). To a busy context the message waits marked `steer` and the running turn takes
|
|
304
|
+
* it before its next step, its task then that turn's; to an idle context, a workflow's, or a
|
|
305
|
+
* turn past its last step it is an ordinary queued message. The task `SendMessage` answers
|
|
306
|
+
* carries `metadata.delivery`: `steered` or `queued`.
|
|
307
|
+
*/
|
|
308
|
+
"a2a-steer",
|
|
301
309
|
];
|
|
302
310
|
/**
|
|
303
311
|
* What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
|
package/dist/contracts.d.ts
CHANGED
|
@@ -4757,6 +4757,17 @@ export declare const MeteredUsageSchema: z.ZodObject<{
|
|
|
4757
4757
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
4758
4758
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
4759
4759
|
}, z.core.$loose>;
|
|
4760
|
+
/**
|
|
4761
|
+
* One retry of a model call (Model Calls §6): the attempt it started, the first counted as 1,
|
|
4762
|
+
* the delay waited before it, and the error that ended the attempt before it, as the provider or
|
|
4763
|
+
* its SDK worded it, cut to 300 characters.
|
|
4764
|
+
*/
|
|
4765
|
+
export declare const ModelRetrySchema: z.ZodObject<{
|
|
4766
|
+
attempt: z.ZodNumber;
|
|
4767
|
+
delayMs: z.ZodNumber;
|
|
4768
|
+
error: z.ZodString;
|
|
4769
|
+
}, z.core.$loose>;
|
|
4770
|
+
export type ModelRetry = z.infer<typeof ModelRetrySchema>;
|
|
4760
4771
|
/**
|
|
4761
4772
|
* `message.assistant`: one completed model step. `invocationId` is the model call's.
|
|
4762
4773
|
* `model`, `finishReason` and `usage` are present when the provider reported them. A step that
|
|
@@ -4783,6 +4794,12 @@ export declare const AssistantMessagePayloadSchema: z.ZodObject<{
|
|
|
4783
4794
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
4784
4795
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
4785
4796
|
}, z.core.$loose>>;
|
|
4797
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
4798
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4799
|
+
attempt: z.ZodNumber;
|
|
4800
|
+
delayMs: z.ZodNumber;
|
|
4801
|
+
error: z.ZodString;
|
|
4802
|
+
}, z.core.$loose>>>;
|
|
4786
4803
|
invocationId: z.ZodString;
|
|
4787
4804
|
text: z.ZodString;
|
|
4788
4805
|
model: z.ZodOptional<z.ZodObject<{
|
|
@@ -4826,6 +4843,12 @@ export declare const ModelFailedPayloadSchema: z.ZodObject<{
|
|
|
4826
4843
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
4827
4844
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
4828
4845
|
}, z.core.$loose>>;
|
|
4846
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
4847
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4848
|
+
attempt: z.ZodNumber;
|
|
4849
|
+
delayMs: z.ZodNumber;
|
|
4850
|
+
error: z.ZodString;
|
|
4851
|
+
}, z.core.$loose>>>;
|
|
4829
4852
|
invocationId: z.ZodOptional<z.ZodString>;
|
|
4830
4853
|
code: z.ZodString;
|
|
4831
4854
|
message: z.ZodString;
|
|
@@ -4857,6 +4880,12 @@ export declare const ContextCompactedPayloadSchema: z.ZodObject<{
|
|
|
4857
4880
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
4858
4881
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
4859
4882
|
}, z.core.$loose>>;
|
|
4883
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
4884
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4885
|
+
attempt: z.ZodNumber;
|
|
4886
|
+
delayMs: z.ZodNumber;
|
|
4887
|
+
error: z.ZodString;
|
|
4888
|
+
}, z.core.$loose>>>;
|
|
4860
4889
|
invocationId: z.ZodOptional<z.ZodString>;
|
|
4861
4890
|
trigger: z.ZodEnum<{
|
|
4862
4891
|
overflow: "overflow";
|
|
@@ -5139,6 +5168,12 @@ declare const TRANSCRIPT_PAYLOADS: {
|
|
|
5139
5168
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
5140
5169
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
5141
5170
|
}, z.core.$loose>>;
|
|
5171
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
5172
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5173
|
+
attempt: z.ZodNumber;
|
|
5174
|
+
delayMs: z.ZodNumber;
|
|
5175
|
+
error: z.ZodString;
|
|
5176
|
+
}, z.core.$loose>>>;
|
|
5142
5177
|
invocationId: z.ZodString;
|
|
5143
5178
|
text: z.ZodString;
|
|
5144
5179
|
model: z.ZodOptional<z.ZodObject<{
|
|
@@ -5173,6 +5208,12 @@ declare const TRANSCRIPT_PAYLOADS: {
|
|
|
5173
5208
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
5174
5209
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
5175
5210
|
}, z.core.$loose>>;
|
|
5211
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
5212
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5213
|
+
attempt: z.ZodNumber;
|
|
5214
|
+
delayMs: z.ZodNumber;
|
|
5215
|
+
error: z.ZodString;
|
|
5216
|
+
}, z.core.$loose>>>;
|
|
5176
5217
|
invocationId: z.ZodOptional<z.ZodString>;
|
|
5177
5218
|
code: z.ZodString;
|
|
5178
5219
|
message: z.ZodString;
|
|
@@ -5198,6 +5239,12 @@ declare const TRANSCRIPT_PAYLOADS: {
|
|
|
5198
5239
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
5199
5240
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
5200
5241
|
}, z.core.$loose>>;
|
|
5242
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
5243
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5244
|
+
attempt: z.ZodNumber;
|
|
5245
|
+
delayMs: z.ZodNumber;
|
|
5246
|
+
error: z.ZodString;
|
|
5247
|
+
}, z.core.$loose>>>;
|
|
5201
5248
|
invocationId: z.ZodOptional<z.ZodString>;
|
|
5202
5249
|
trigger: z.ZodEnum<{
|
|
5203
5250
|
overflow: "overflow";
|
|
@@ -6071,6 +6118,12 @@ export declare const EVENT_CATALOG: {
|
|
|
6071
6118
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
6072
6119
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
6073
6120
|
}, z.core.$loose>>;
|
|
6121
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
6122
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6123
|
+
attempt: z.ZodNumber;
|
|
6124
|
+
delayMs: z.ZodNumber;
|
|
6125
|
+
error: z.ZodString;
|
|
6126
|
+
}, z.core.$loose>>>;
|
|
6074
6127
|
invocationId: z.ZodString;
|
|
6075
6128
|
text: z.ZodString;
|
|
6076
6129
|
model: z.ZodOptional<z.ZodObject<{
|
|
@@ -6109,6 +6162,12 @@ export declare const EVENT_CATALOG: {
|
|
|
6109
6162
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
6110
6163
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
6111
6164
|
}, z.core.$loose>>;
|
|
6165
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
6166
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6167
|
+
attempt: z.ZodNumber;
|
|
6168
|
+
delayMs: z.ZodNumber;
|
|
6169
|
+
error: z.ZodString;
|
|
6170
|
+
}, z.core.$loose>>>;
|
|
6112
6171
|
invocationId: z.ZodOptional<z.ZodString>;
|
|
6113
6172
|
code: z.ZodString;
|
|
6114
6173
|
message: z.ZodString;
|
|
@@ -6138,6 +6197,12 @@ export declare const EVENT_CATALOG: {
|
|
|
6138
6197
|
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
6139
6198
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
6140
6199
|
}, z.core.$loose>>;
|
|
6200
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
6201
|
+
retries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6202
|
+
attempt: z.ZodNumber;
|
|
6203
|
+
delayMs: z.ZodNumber;
|
|
6204
|
+
error: z.ZodString;
|
|
6205
|
+
}, z.core.$loose>>>;
|
|
6141
6206
|
invocationId: z.ZodOptional<z.ZodString>;
|
|
6142
6207
|
trigger: z.ZodEnum<{
|
|
6143
6208
|
overflow: "overflow";
|
package/dist/contracts.js
CHANGED
|
@@ -3159,11 +3159,24 @@ export const MeteredUsageSchema = z
|
|
|
3159
3159
|
costUsd: z.number().nonnegative().optional(),
|
|
3160
3160
|
})
|
|
3161
3161
|
.passthrough();
|
|
3162
|
+
/**
|
|
3163
|
+
* One retry of a model call (Model Calls §6): the attempt it started, the first counted as 1,
|
|
3164
|
+
* the delay waited before it, and the error that ended the attempt before it, as the provider or
|
|
3165
|
+
* its SDK worded it, cut to 300 characters.
|
|
3166
|
+
*/
|
|
3167
|
+
export const ModelRetrySchema = z
|
|
3168
|
+
.object({
|
|
3169
|
+
attempt: z.number().int().min(2),
|
|
3170
|
+
delayMs: z.number().int().nonnegative(),
|
|
3171
|
+
error: z.string(),
|
|
3172
|
+
})
|
|
3173
|
+
.passthrough();
|
|
3162
3174
|
/**
|
|
3163
3175
|
* The timing of a model call's outcome, on `message.assistant`, `model.failed` and
|
|
3164
3176
|
* `context.compacted`. `durationMs` is the journal's window, from the intent to the outcome;
|
|
3165
3177
|
* `gate`, `firstTokenMs` and `meteredUsage` are the meter's, absent when no gate metered the
|
|
3166
|
-
* call.
|
|
3178
|
+
* call. `attempts` and `retries` are the gate's: how many times it called the provider, and why
|
|
3179
|
+
* it called again; absent from a call a Runtime before 0.50 served.
|
|
3167
3180
|
*/
|
|
3168
3181
|
const modelOutcomeFacts = {
|
|
3169
3182
|
/** The model call's effect id. */
|
|
@@ -3174,6 +3187,10 @@ const modelOutcomeFacts = {
|
|
|
3174
3187
|
/** From the gate's start of the call to the provider's first stream event. */
|
|
3175
3188
|
firstTokenMs: z.number().int().nonnegative().optional(),
|
|
3176
3189
|
meteredUsage: MeteredUsageSchema.optional(),
|
|
3190
|
+
/** The provider calls the gate made for this one, the first included: more than 1 after a retry. */
|
|
3191
|
+
attempts: z.number().int().positive().optional(),
|
|
3192
|
+
/** Each retry, in order; absent when the first attempt was the last. */
|
|
3193
|
+
retries: z.array(ModelRetrySchema).optional(),
|
|
3177
3194
|
};
|
|
3178
3195
|
/**
|
|
3179
3196
|
* `message.assistant`: one completed model step. `invocationId` is the model call's.
|
package/dist/types/model.d.ts
CHANGED
|
@@ -67,6 +67,14 @@ export interface ModelFailureOutcome {
|
|
|
67
67
|
readonly message: string;
|
|
68
68
|
readonly retryable: boolean;
|
|
69
69
|
readonly retryAfterMs?: number;
|
|
70
|
+
/** The provider calls the gate made before it gave up, the first included. */
|
|
71
|
+
readonly attempts?: number;
|
|
72
|
+
/** Each retry the gate made before it gave up: the attempt it started, its delay, the error before it. */
|
|
73
|
+
readonly retries?: readonly {
|
|
74
|
+
readonly attempt: number;
|
|
75
|
+
readonly delayMs: number;
|
|
76
|
+
readonly error: string;
|
|
77
|
+
}[];
|
|
70
78
|
}
|
|
71
79
|
export interface ModelControls {
|
|
72
80
|
readonly temperature?: number;
|