fascicle 0.12.13 → 0.13.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/CHANGELOG.md +34 -1
- package/dist/adapters-DNnzeLxr.js +447 -0
- package/dist/adapters-DNnzeLxr.js.map +1 -0
- package/dist/adapters.d.ts +54 -9
- package/dist/adapters.js +1 -1
- package/dist/agents.d.ts +12 -9
- package/dist/agents.js +1 -1
- package/dist/{core-BVCVUMmH.js → core-DK7g1Z40.js} +887 -74
- package/dist/core-DK7g1Z40.js.map +1 -0
- package/dist/diagram_bin.d.ts +1 -2
- package/dist/diagram_bin.js +5 -2
- package/dist/diagram_bin.js.map +1 -1
- package/dist/{engine-Ct4LBzb9.js → engine-BOGuc0X2.js} +366 -36
- package/dist/engine-BOGuc0X2.js.map +1 -0
- package/dist/index.d.ts +342 -180
- package/dist/index.js +149 -123
- package/dist/index.js.map +1 -1
- package/dist/{invoke-BcPDqE5C.js → invoke-Beef3R3X.js} +3 -3
- package/dist/{invoke-BcPDqE5C.js.map → invoke-Beef3R3X.js.map} +1 -1
- package/dist/mcp.d.ts +8 -9
- package/dist/mcp.js +1 -1
- package/dist/otel.d.ts +3 -4
- package/dist/stdio.d.ts +4 -5
- package/dist/stdio.js +2 -2
- package/dist/testing.d.ts +46 -10
- package/dist/testing.js +540 -4
- package/dist/testing.js.map +1 -1
- package/dist/{trajectory-D1eq9eue.js → trajectory-BI-mrVFT.js} +25 -2
- package/dist/trajectory-BI-mrVFT.js.map +1 -0
- package/dist/{trajectory-ByoOQZ6T.d.ts → trajectory-Bm-mOtqw.d.ts} +34 -3
- package/dist/{types-BasW4Wwb.d.ts → types-CPqLZOEr.d.ts} +40 -2
- package/dist/{types-bEpfDrys.d.ts → types-CZ83Q5nm.d.ts} +12 -7
- package/dist/ui.d.ts +11 -10
- package/dist/ui.js +3 -2
- package/dist/ui.js.map +1 -1
- package/dist/viewer-app/assets/index-DXsB0byD.js +2 -0
- package/dist/viewer-app/index.html +1 -1
- package/dist/viewer.d.ts +7 -8
- package/dist/viewer.js +2 -2
- package/dist/viewer.js.map +1 -1
- package/package.json +28 -28
- package/dist/adapters-CutexJd3.js +0 -270
- package/dist/adapters-CutexJd3.js.map +0 -1
- package/dist/core-BVCVUMmH.js.map +0 -1
- package/dist/engine-Ct4LBzb9.js.map +0 -1
- package/dist/leading_system-CfOIc5fi.js +0 -330
- package/dist/leading_system-CfOIc5fi.js.map +0 -1
- package/dist/trajectory-D1eq9eue.js.map +0 -1
- package/dist/viewer-app/assets/index-BBEYkjnQ.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { a as FlowValue, c as
|
|
1
|
+
import { a as FlowValue, c as Step, d as StepMetadata, f as StepOptions, h as TrajectoryLogger, i as FlowNode, l as StepFn, m as TrajectoryEvent, n as CheckpointStore, o as RunContext, p as StepOutput, r as CleanupFn, s as ScopedCheckpointStore, t as AnyStep, u as StepInput } from "./types-CPqLZOEr.js";
|
|
2
2
|
import { n as SchemaIssue, r as ToolSchema, t as AnySchema } from "./types-BK0UW28o.js";
|
|
3
|
-
import { _ as
|
|
4
|
-
import { A as ToolExecContext, B as ProviderCapability, C as StepRecord, D as ToolApprovalHandler, E as Tool, F as AiSdkProviderAdapter, G as ClaudeCliProviderReported, H as ProviderTransport, I as EffortTranslation, L as ExternalAgentAdapter, M as TurnResult, N as UsageTotals, O as ToolApprovalRequest, P as UserContentPart, R as NativeProviderAdapter, S as RetryPolicy, T as StreamChunk, U as RawProviderUsage, V as ProviderFactory, W as default_normalize_usage, _ as PricingTable, a as Engine, b as ResolvedModel, c as FinishReason, d as GenerateTiming, f as Message, g as Pricing, h as PrepareStepResult, i as EffortLevel, j as TurnRequest, k as ToolCallRecord, l as GenerateOptions, m as PrepareStepHook, n as AssistantContentPart, o as EngineConfig, p as PrepareStepContext, r as CostBreakdown, s as EngineDefaults, t as AiSdkTelemetrySettings, u as GenerateResult, v as ProviderConfigMap, w as StepTiming, x as RetryFailureKind, y as ProviderInit, z as ProviderAdapter } from "./types-
|
|
5
|
-
|
|
3
|
+
import { _ as is_run_end_event, a as MapItemFailedEvent, b as is_step_replayed_event, c as RunEndStatus, d as StepReplayedEvent, f as TrajectoryParseResult, g as is_map_item_failed_event, h as is_emit_event, i as EmitEvent, l as SpanEndEvent, m as is_custom_trajectory_event, n as CheckpointStatus, o as ParsedTrajectoryEvent, p as is_checkpoint_event, r as CustomTrajectoryEvent, s as RunEndEvent, t as CheckpointEvent, u as SpanStartEvent, v as is_span_end_event, x as parse_trajectory_event, y as is_span_start_event } from "./trajectory-Bm-mOtqw.js";
|
|
4
|
+
import { A as ToolExecContext, B as ProviderCapability, C as StepRecord, D as ToolApprovalHandler, E as Tool, F as AiSdkProviderAdapter, G as ClaudeCliProviderReported, H as ProviderTransport, I as EffortTranslation, L as ExternalAgentAdapter, M as TurnResult, N as UsageTotals, O as ToolApprovalRequest, P as UserContentPart, R as NativeProviderAdapter, S as RetryPolicy, T as StreamChunk, U as RawProviderUsage, V as ProviderFactory, W as default_normalize_usage, _ as PricingTable, a as Engine, b as ResolvedModel, c as FinishReason, d as GenerateTiming, f as Message, g as Pricing, h as PrepareStepResult, i as EffortLevel, j as TurnRequest, k as ToolCallRecord, l as GenerateOptions, m as PrepareStepHook, n as AssistantContentPart, o as EngineConfig, p as PrepareStepContext, r as CostBreakdown, s as EngineDefaults, t as AiSdkTelemetrySettings, u as GenerateResult, v as ProviderConfigMap, w as StepTiming, x as RetryFailureKind, y as ProviderInit, z as ProviderAdapter } from "./types-CZ83Q5nm.js";
|
|
6
5
|
//#region src/core/flow-schema.json.d.ts
|
|
7
6
|
declare let $schema: string;
|
|
8
7
|
declare let $id: string;
|
|
@@ -193,12 +192,16 @@ declare namespace $defs {
|
|
|
193
192
|
export { type_14 as type };
|
|
194
193
|
export let minimum: number;
|
|
195
194
|
}
|
|
195
|
+
export namespace settle {
|
|
196
|
+
let type_15: string;
|
|
197
|
+
export { type_15 as type };
|
|
198
|
+
}
|
|
196
199
|
}
|
|
197
200
|
export { properties_4 as properties };
|
|
198
201
|
}
|
|
199
202
|
namespace pipe_config {
|
|
200
|
-
let
|
|
201
|
-
export {
|
|
203
|
+
let type_16: string;
|
|
204
|
+
export { type_16 as type };
|
|
202
205
|
let required_4: string[];
|
|
203
206
|
export { required_4 as required };
|
|
204
207
|
export namespace properties_5 {
|
|
@@ -207,16 +210,16 @@ declare namespace $defs {
|
|
|
207
210
|
export { $ref_25 as $ref };
|
|
208
211
|
}
|
|
209
212
|
export namespace fn_1 {
|
|
210
|
-
let
|
|
211
|
-
export {
|
|
213
|
+
let type_17: string;
|
|
214
|
+
export { type_17 as type };
|
|
212
215
|
}
|
|
213
216
|
export { fn_1 as fn };
|
|
214
217
|
}
|
|
215
218
|
export { properties_5 as properties };
|
|
216
219
|
}
|
|
217
220
|
namespace retry_config {
|
|
218
|
-
let
|
|
219
|
-
export {
|
|
221
|
+
let type_18: string;
|
|
222
|
+
export { type_18 as type };
|
|
220
223
|
let required_5: string[];
|
|
221
224
|
export { required_5 as required };
|
|
222
225
|
export namespace properties_6 {
|
|
@@ -226,14 +229,14 @@ declare namespace $defs {
|
|
|
226
229
|
}
|
|
227
230
|
export { _do_1 as do };
|
|
228
231
|
export namespace max_attempts {
|
|
229
|
-
let
|
|
230
|
-
export {
|
|
232
|
+
let type_19: string;
|
|
233
|
+
export { type_19 as type };
|
|
231
234
|
let minimum_1: number;
|
|
232
235
|
export { minimum_1 as minimum };
|
|
233
236
|
}
|
|
234
237
|
export namespace backoff_ms {
|
|
235
|
-
let
|
|
236
|
-
export {
|
|
238
|
+
let type_20: string;
|
|
239
|
+
export { type_20 as type };
|
|
237
240
|
let minimum_2: number;
|
|
238
241
|
export { minimum_2 as minimum };
|
|
239
242
|
}
|
|
@@ -241,8 +244,8 @@ declare namespace $defs {
|
|
|
241
244
|
export { properties_6 as properties };
|
|
242
245
|
}
|
|
243
246
|
namespace fallback_config {
|
|
244
|
-
let
|
|
245
|
-
export {
|
|
247
|
+
let type_21: string;
|
|
248
|
+
export { type_21 as type };
|
|
246
249
|
let required_6: string[];
|
|
247
250
|
export { required_6 as required };
|
|
248
251
|
export namespace properties_7 {
|
|
@@ -258,8 +261,8 @@ declare namespace $defs {
|
|
|
258
261
|
export { properties_7 as properties };
|
|
259
262
|
}
|
|
260
263
|
namespace timeout_config {
|
|
261
|
-
let
|
|
262
|
-
export {
|
|
264
|
+
let type_22: string;
|
|
265
|
+
export { type_22 as type };
|
|
263
266
|
let required_7: string[];
|
|
264
267
|
export { required_7 as required };
|
|
265
268
|
export namespace properties_8 {
|
|
@@ -269,8 +272,8 @@ declare namespace $defs {
|
|
|
269
272
|
}
|
|
270
273
|
export { _do_2 as do };
|
|
271
274
|
export namespace ms {
|
|
272
|
-
let
|
|
273
|
-
export {
|
|
275
|
+
let type_23: string;
|
|
276
|
+
export { type_23 as type };
|
|
274
277
|
let minimum_3: number;
|
|
275
278
|
export { minimum_3 as minimum };
|
|
276
279
|
}
|
|
@@ -278,14 +281,14 @@ declare namespace $defs {
|
|
|
278
281
|
export { properties_8 as properties };
|
|
279
282
|
}
|
|
280
283
|
namespace compose_node_config {
|
|
281
|
-
let
|
|
282
|
-
export {
|
|
284
|
+
let type_24: string;
|
|
285
|
+
export { type_24 as type };
|
|
283
286
|
let required_8: string[];
|
|
284
287
|
export { required_8 as required };
|
|
285
288
|
export namespace properties_9 {
|
|
286
289
|
export namespace name {
|
|
287
|
-
let
|
|
288
|
-
export {
|
|
290
|
+
let type_25: string;
|
|
291
|
+
export { type_25 as type };
|
|
289
292
|
export let minLength: number;
|
|
290
293
|
}
|
|
291
294
|
export namespace _do_3 {
|
|
@@ -297,21 +300,21 @@ declare namespace $defs {
|
|
|
297
300
|
export { properties_9 as properties };
|
|
298
301
|
}
|
|
299
302
|
namespace loop_config {
|
|
300
|
-
let
|
|
301
|
-
export {
|
|
303
|
+
let type_26: string;
|
|
304
|
+
export { type_26 as type };
|
|
302
305
|
let required_9: string[];
|
|
303
306
|
export { required_9 as required };
|
|
304
307
|
export namespace properties_10 {
|
|
305
308
|
export namespace name_1 {
|
|
306
|
-
let
|
|
307
|
-
export {
|
|
309
|
+
let type_27: string;
|
|
310
|
+
export { type_27 as type };
|
|
308
311
|
let minLength_1: number;
|
|
309
312
|
export { minLength_1 as minLength };
|
|
310
313
|
}
|
|
311
314
|
export { name_1 as name };
|
|
312
315
|
export namespace init {
|
|
313
|
-
let
|
|
314
|
-
export {
|
|
316
|
+
let type_28: string;
|
|
317
|
+
export { type_28 as type };
|
|
315
318
|
}
|
|
316
319
|
export namespace body {
|
|
317
320
|
let $ref_31: string;
|
|
@@ -322,12 +325,12 @@ declare namespace $defs {
|
|
|
322
325
|
export { $ref_32 as $ref };
|
|
323
326
|
}
|
|
324
327
|
export namespace finish {
|
|
325
|
-
let type_28: string;
|
|
326
|
-
export { type_28 as type };
|
|
327
|
-
}
|
|
328
|
-
export namespace max_rounds {
|
|
329
328
|
let type_29: string;
|
|
330
329
|
export { type_29 as type };
|
|
330
|
+
}
|
|
331
|
+
export namespace max_rounds {
|
|
332
|
+
let type_30: string;
|
|
333
|
+
export { type_30 as type };
|
|
331
334
|
let minimum_4: number;
|
|
332
335
|
export { minimum_4 as minimum };
|
|
333
336
|
}
|
|
@@ -335,8 +338,8 @@ declare namespace $defs {
|
|
|
335
338
|
export { properties_10 as properties };
|
|
336
339
|
}
|
|
337
340
|
namespace adversarial_config {
|
|
338
|
-
let
|
|
339
|
-
export {
|
|
341
|
+
let type_31: string;
|
|
342
|
+
export { type_31 as type };
|
|
340
343
|
let required_10: string[];
|
|
341
344
|
export { required_10 as required };
|
|
342
345
|
export namespace properties_11 {
|
|
@@ -349,12 +352,12 @@ declare namespace $defs {
|
|
|
349
352
|
export { $ref_34 as $ref };
|
|
350
353
|
}
|
|
351
354
|
export namespace accept {
|
|
352
|
-
let type_31: string;
|
|
353
|
-
export { type_31 as type };
|
|
354
|
-
}
|
|
355
|
-
export namespace max_rounds_1 {
|
|
356
355
|
let type_32: string;
|
|
357
356
|
export { type_32 as type };
|
|
357
|
+
}
|
|
358
|
+
export namespace max_rounds_1 {
|
|
359
|
+
let type_33: string;
|
|
360
|
+
export { type_33 as type };
|
|
358
361
|
let minimum_5: number;
|
|
359
362
|
export { minimum_5 as minimum };
|
|
360
363
|
}
|
|
@@ -363,14 +366,14 @@ declare namespace $defs {
|
|
|
363
366
|
export { properties_11 as properties };
|
|
364
367
|
}
|
|
365
368
|
namespace ensemble_config {
|
|
366
|
-
let
|
|
367
|
-
export {
|
|
369
|
+
let type_34: string;
|
|
370
|
+
export { type_34 as type };
|
|
368
371
|
let required_11: string[];
|
|
369
372
|
export { required_11 as required };
|
|
370
373
|
export namespace properties_12 {
|
|
371
374
|
namespace members {
|
|
372
|
-
let
|
|
373
|
-
export {
|
|
375
|
+
let type_35: string;
|
|
376
|
+
export { type_35 as type };
|
|
374
377
|
export namespace additionalProperties_1 {
|
|
375
378
|
let $ref_35: string;
|
|
376
379
|
export { $ref_35 as $ref };
|
|
@@ -378,12 +381,12 @@ declare namespace $defs {
|
|
|
378
381
|
export { additionalProperties_1 as additionalProperties };
|
|
379
382
|
}
|
|
380
383
|
namespace score {
|
|
381
|
-
let type_35: string;
|
|
382
|
-
export { type_35 as type };
|
|
383
|
-
}
|
|
384
|
-
namespace select {
|
|
385
384
|
let type_36: string;
|
|
386
385
|
export { type_36 as type };
|
|
386
|
+
}
|
|
387
|
+
namespace select {
|
|
388
|
+
let type_37: string;
|
|
389
|
+
export { type_37 as type };
|
|
387
390
|
let _enum: string[];
|
|
388
391
|
export { _enum as enum };
|
|
389
392
|
}
|
|
@@ -391,14 +394,14 @@ declare namespace $defs {
|
|
|
391
394
|
export { properties_12 as properties };
|
|
392
395
|
}
|
|
393
396
|
namespace tournament_config {
|
|
394
|
-
let
|
|
395
|
-
export {
|
|
397
|
+
let type_38: string;
|
|
398
|
+
export { type_38 as type };
|
|
396
399
|
let required_12: string[];
|
|
397
400
|
export { required_12 as required };
|
|
398
401
|
export namespace properties_13 {
|
|
399
402
|
export namespace members_1 {
|
|
400
|
-
let
|
|
401
|
-
export {
|
|
403
|
+
let type_39: string;
|
|
404
|
+
export { type_39 as type };
|
|
402
405
|
export namespace additionalProperties_2 {
|
|
403
406
|
let $ref_36: string;
|
|
404
407
|
export { $ref_36 as $ref };
|
|
@@ -407,21 +410,21 @@ declare namespace $defs {
|
|
|
407
410
|
}
|
|
408
411
|
export { members_1 as members };
|
|
409
412
|
export namespace compare {
|
|
410
|
-
let
|
|
411
|
-
export {
|
|
413
|
+
let type_40: string;
|
|
414
|
+
export { type_40 as type };
|
|
412
415
|
}
|
|
413
416
|
}
|
|
414
417
|
export { properties_13 as properties };
|
|
415
418
|
}
|
|
416
419
|
namespace consensus_config {
|
|
417
|
-
let
|
|
418
|
-
export {
|
|
420
|
+
let type_41: string;
|
|
421
|
+
export { type_41 as type };
|
|
419
422
|
let required_13: string[];
|
|
420
423
|
export { required_13 as required };
|
|
421
424
|
export namespace properties_14 {
|
|
422
425
|
export namespace members_2 {
|
|
423
|
-
let
|
|
424
|
-
export {
|
|
426
|
+
let type_42: string;
|
|
427
|
+
export { type_42 as type };
|
|
425
428
|
export namespace additionalProperties_3 {
|
|
426
429
|
let $ref_37: string;
|
|
427
430
|
export { $ref_37 as $ref };
|
|
@@ -430,12 +433,12 @@ declare namespace $defs {
|
|
|
430
433
|
}
|
|
431
434
|
export { members_2 as members };
|
|
432
435
|
export namespace agree {
|
|
433
|
-
let type_42: string;
|
|
434
|
-
export { type_42 as type };
|
|
435
|
-
}
|
|
436
|
-
export namespace max_rounds_2 {
|
|
437
436
|
let type_43: string;
|
|
438
437
|
export { type_43 as type };
|
|
438
|
+
}
|
|
439
|
+
export namespace max_rounds_2 {
|
|
440
|
+
let type_44: string;
|
|
441
|
+
export { type_44 as type };
|
|
439
442
|
let minimum_6: number;
|
|
440
443
|
export { minimum_6 as minimum };
|
|
441
444
|
}
|
|
@@ -444,8 +447,8 @@ declare namespace $defs {
|
|
|
444
447
|
export { properties_14 as properties };
|
|
445
448
|
}
|
|
446
449
|
namespace checkpoint_config {
|
|
447
|
-
let
|
|
448
|
-
export {
|
|
450
|
+
let type_45: string;
|
|
451
|
+
export { type_45 as type };
|
|
449
452
|
let required_14: string[];
|
|
450
453
|
export { required_14 as required };
|
|
451
454
|
export namespace properties_15 {
|
|
@@ -455,41 +458,45 @@ declare namespace $defs {
|
|
|
455
458
|
}
|
|
456
459
|
export { _do_4 as do };
|
|
457
460
|
export namespace key {
|
|
458
|
-
let
|
|
459
|
-
export {
|
|
461
|
+
let type_46: string;
|
|
462
|
+
export { type_46 as type };
|
|
460
463
|
}
|
|
461
464
|
}
|
|
462
465
|
export { properties_15 as properties };
|
|
463
466
|
}
|
|
464
467
|
namespace suspend_config {
|
|
465
|
-
let
|
|
466
|
-
export {
|
|
468
|
+
let type_47: string;
|
|
469
|
+
export { type_47 as type };
|
|
467
470
|
let required_15: string[];
|
|
468
471
|
export { required_15 as required };
|
|
469
472
|
export namespace properties_16 {
|
|
470
473
|
export namespace id_1 {
|
|
471
|
-
let type_47: string;
|
|
472
|
-
export { type_47 as type };
|
|
473
|
-
}
|
|
474
|
-
export { id_1 as id };
|
|
475
|
-
export namespace on {
|
|
476
474
|
let type_48: string;
|
|
477
475
|
export { type_48 as type };
|
|
478
476
|
}
|
|
479
|
-
export
|
|
477
|
+
export { id_1 as id };
|
|
478
|
+
export namespace on {
|
|
480
479
|
let type_49: string;
|
|
481
480
|
export { type_49 as type };
|
|
482
481
|
}
|
|
483
|
-
export namespace
|
|
482
|
+
export namespace resume_schema {
|
|
484
483
|
let type_50: string;
|
|
485
484
|
export { type_50 as type };
|
|
486
485
|
}
|
|
486
|
+
export namespace combine {
|
|
487
|
+
let type_51: string;
|
|
488
|
+
export { type_51 as type };
|
|
489
|
+
}
|
|
490
|
+
export namespace deadline_ms {
|
|
491
|
+
let type_52: string;
|
|
492
|
+
export { type_52 as type };
|
|
493
|
+
}
|
|
487
494
|
}
|
|
488
495
|
export { properties_16 as properties };
|
|
489
496
|
}
|
|
490
497
|
namespace scope_config {
|
|
491
|
-
let
|
|
492
|
-
export {
|
|
498
|
+
let type_53: string;
|
|
499
|
+
export { type_53 as type };
|
|
493
500
|
export namespace items_3 {
|
|
494
501
|
let $ref_39: string;
|
|
495
502
|
export { $ref_39 as $ref };
|
|
@@ -497,8 +504,8 @@ declare namespace $defs {
|
|
|
497
504
|
export { items_3 as items };
|
|
498
505
|
}
|
|
499
506
|
namespace scope_entry {
|
|
500
|
-
let
|
|
501
|
-
export {
|
|
507
|
+
let type_54: string;
|
|
508
|
+
export { type_54 as type };
|
|
502
509
|
export let oneOf: ({
|
|
503
510
|
type: string;
|
|
504
511
|
required: string[];
|
|
@@ -529,18 +536,18 @@ declare namespace $defs {
|
|
|
529
536
|
})[];
|
|
530
537
|
}
|
|
531
538
|
namespace chain_config {
|
|
532
|
-
let
|
|
533
|
-
export {
|
|
539
|
+
let type_55: string;
|
|
540
|
+
export { type_55 as type };
|
|
534
541
|
let required_16: string[];
|
|
535
542
|
export { required_16 as required };
|
|
536
543
|
export namespace properties_17 {
|
|
537
544
|
namespace input {
|
|
538
|
-
let
|
|
539
|
-
export {
|
|
545
|
+
let type_56: string;
|
|
546
|
+
export { type_56 as type };
|
|
540
547
|
}
|
|
541
548
|
namespace steps {
|
|
542
|
-
let
|
|
543
|
-
export {
|
|
549
|
+
let type_57: string;
|
|
550
|
+
export { type_57 as type };
|
|
544
551
|
export namespace items_4 {
|
|
545
552
|
let $ref_40: string;
|
|
546
553
|
export { $ref_40 as $ref };
|
|
@@ -548,15 +555,15 @@ declare namespace $defs {
|
|
|
548
555
|
export { items_4 as items };
|
|
549
556
|
}
|
|
550
557
|
namespace output {
|
|
551
|
-
let
|
|
552
|
-
export {
|
|
558
|
+
let type_58: string;
|
|
559
|
+
export { type_58 as type };
|
|
553
560
|
}
|
|
554
561
|
}
|
|
555
562
|
export { properties_17 as properties };
|
|
556
563
|
}
|
|
557
564
|
namespace chain_entry {
|
|
558
|
-
let
|
|
559
|
-
export {
|
|
565
|
+
let type_59: string;
|
|
566
|
+
export { type_59 as type };
|
|
560
567
|
let oneOf_1: ({
|
|
561
568
|
type: string;
|
|
562
569
|
required: string[];
|
|
@@ -618,6 +625,7 @@ type RunOutcome<o> = {
|
|
|
618
625
|
readonly kind: 'suspended';
|
|
619
626
|
readonly id: string;
|
|
620
627
|
readonly payload: unknown;
|
|
628
|
+
readonly deadline_ms?: number;
|
|
621
629
|
readonly resume: (data: unknown) => Promise<RunOutcome<o>>;
|
|
622
630
|
};
|
|
623
631
|
/**
|
|
@@ -627,7 +635,8 @@ type RunOutcome<o> = {
|
|
|
627
635
|
* Resolves `{ kind: 'done', output }` on completion. When a `suspend` gate
|
|
628
636
|
* fires, resolves `{ kind: 'suspended', id, payload, resume }` where `id` is
|
|
629
637
|
* the gate's suspend id, `payload` is what the gate raised on its
|
|
630
|
-
* `suspended_error
|
|
638
|
+
* `suspended_error` (plus `deadline_ms`, when the gate set one), and
|
|
639
|
+
* `resume(data)` re-runs the flow from the original
|
|
631
640
|
* input with `resume_data[id] = data` merged over the caller's options: the
|
|
632
641
|
* same full re-run semantics as calling `run` again yourself, so pure
|
|
633
642
|
* prefixes replay and `checkpoint`ed steps are served from the store. The
|
|
@@ -645,11 +654,86 @@ declare function run_until_suspended<i, o>(flow: Step<i, o>, input: i, options?:
|
|
|
645
654
|
* carries suspension as data. All share one implementation, so every entry
|
|
646
655
|
* point runs the same graph identically.
|
|
647
656
|
*/
|
|
648
|
-
declare const run: typeof run_impl & {
|
|
657
|
+
export declare const run: typeof run_impl & {
|
|
649
658
|
stream: typeof run_stream;
|
|
650
659
|
until_suspended: typeof run_until_suspended;
|
|
651
660
|
};
|
|
652
661
|
//#endregion
|
|
662
|
+
//#region src/core/durable.d.ts
|
|
663
|
+
type Claims = Required<Pick<CheckpointStore, 'claim' | 'release'>>;
|
|
664
|
+
/**
|
|
665
|
+
* A store `durable` can keep runs in: one that scopes, and whose scopes can
|
|
666
|
+
* claim. `filesystem_store` from `fascicle/adapters` is one, and
|
|
667
|
+
* `checkpoint_store_conformance` in `fascicle/testing` checks a store of
|
|
668
|
+
* your own.
|
|
669
|
+
*/
|
|
670
|
+
type DurableStore = {
|
|
671
|
+
readonly scope: (prefix: string) => ScopedCheckpointStore & Claims;
|
|
672
|
+
};
|
|
673
|
+
type DurableConfig = {
|
|
674
|
+
readonly store: DurableStore;
|
|
675
|
+
/**
|
|
676
|
+
* How long a drive owns its run before another invocation may take it
|
|
677
|
+
* over, in milliseconds. The driver renews the lease every third of this
|
|
678
|
+
* while it drives, so the lease only runs out once a drive stops answering
|
|
679
|
+
* (its process died, or stalled for longer than this). Default 60 seconds.
|
|
680
|
+
*/
|
|
681
|
+
readonly lease_ms?: number;
|
|
682
|
+
/**
|
|
683
|
+
* What happens when a run's flow no longer has the shape the run started
|
|
684
|
+
* on. `'fail'` (the default) throws `flow_changed_error`. `'replay'` takes
|
|
685
|
+
* the new shape, records a `flow_changed` event, and drives on.
|
|
686
|
+
*/
|
|
687
|
+
readonly on_flow_change?: 'fail' | 'replay';
|
|
688
|
+
};
|
|
689
|
+
/**
|
|
690
|
+
* The `run` options a drive passes through. The driver owns the checkpoint
|
|
691
|
+
* store and the resume data, so it leaves those two out.
|
|
692
|
+
*/
|
|
693
|
+
type DurableRunOptions = Omit<RunOptions, 'checkpoint_store' | 'resume_data'>;
|
|
694
|
+
type DurableOutcome<o> = {
|
|
695
|
+
readonly kind: 'done';
|
|
696
|
+
readonly run_id: string;
|
|
697
|
+
readonly output: o;
|
|
698
|
+
} | {
|
|
699
|
+
readonly kind: 'suspended';
|
|
700
|
+
readonly run_id: string;
|
|
701
|
+
readonly id: string;
|
|
702
|
+
readonly payload: unknown;
|
|
703
|
+
readonly deadline_at?: number;
|
|
704
|
+
} | {
|
|
705
|
+
readonly kind: 'busy';
|
|
706
|
+
readonly run_id: string;
|
|
707
|
+
};
|
|
708
|
+
type DurableRunState = Exclude<DurableOutcome<unknown>, {
|
|
709
|
+
readonly kind: 'busy';
|
|
710
|
+
}> | {
|
|
711
|
+
readonly kind: 'running';
|
|
712
|
+
readonly run_id: string;
|
|
713
|
+
} | {
|
|
714
|
+
readonly kind: 'failed';
|
|
715
|
+
readonly run_id: string;
|
|
716
|
+
readonly error: string;
|
|
717
|
+
};
|
|
718
|
+
type DurableRuns = {
|
|
719
|
+
readonly start: <i, o>(run_id: string, flow: Step<i, o>, input: i, options?: DurableRunOptions) => Promise<DurableOutcome<o>>;
|
|
720
|
+
readonly resume: <i, o>(run_id: string, flow: Step<i, o>, resume_data: Readonly<Record<string, unknown>>, options?: DurableRunOptions) => Promise<DurableOutcome<o>>;
|
|
721
|
+
readonly get: (run_id: string) => Promise<DurableRunState | undefined>;
|
|
722
|
+
readonly delete: (run_id: string) => Promise<boolean>;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* Keep the runs of flows that suspend in `config.store`, and drive them one
|
|
726
|
+
* event at a time.
|
|
727
|
+
*
|
|
728
|
+
* `start(run_id, flow, input)` begins a run and drives it until it's done or
|
|
729
|
+
* waiting at a gate. `resume(run_id, flow, { [gate]: data })` hands a run
|
|
730
|
+
* the data its gate waits for and drives it on. Both report `busy` instead
|
|
731
|
+
* when another invocation is driving the run, and both are safe to repeat.
|
|
732
|
+
* `get(run_id)` reads where a run stands without driving it, and
|
|
733
|
+
* `delete(run_id)` removes it, resolving false while a drive holds it.
|
|
734
|
+
*/
|
|
735
|
+
export declare function durable(config: DurableConfig): DurableRuns;
|
|
736
|
+
//#endregion
|
|
653
737
|
//#region src/core/step.d.ts
|
|
654
738
|
/**
|
|
655
739
|
* Wrap a plain function as a `Step`, named or anonymous.
|
|
@@ -662,14 +746,31 @@ declare const run: typeof run_impl & {
|
|
|
662
746
|
* `options` is stored as `meta`, and left off entirely when nothing remains,
|
|
663
747
|
* so `describe` never echoes an empty object.
|
|
664
748
|
*/
|
|
665
|
-
declare function step<i, o>(id: string, fn: StepFn<i, o>, options?: StepOptions): Step<i, o>;
|
|
666
|
-
declare function step<i, o>(fn: StepFn<i, o>): Step<i, o>;
|
|
749
|
+
export declare function step<i, o>(id: string, fn: StepFn<i, o>, options?: StepOptions): Step<i, o>;
|
|
750
|
+
export declare function step<i, o>(fn: StepFn<i, o>): Step<i, o>;
|
|
667
751
|
//#endregion
|
|
668
752
|
//#region src/core/diagram.d.ts
|
|
669
753
|
type DiagramOptions = {
|
|
670
|
-
/** Throw `describe_cycle_error` on a cycle instead of drawing `<cycle>`, as `describe` does. */
|
|
671
|
-
readonly
|
|
754
|
+
/** Throw `describe_cycle_error` on a cycle instead of drawing `<cycle>`, as `describe` does. */
|
|
755
|
+
readonly strict?: boolean;
|
|
756
|
+
/** Wrap descriptions so that no line runs wider than this, `prefix` included. */
|
|
757
|
+
readonly width?: number;
|
|
758
|
+
/** Written at the start of every line, for example `' * '` for a doc comment. */
|
|
672
759
|
readonly prefix?: string;
|
|
760
|
+
/** Mark each step that `describe.replays` finds with the gates it can run again before. */
|
|
761
|
+
readonly replays?: boolean;
|
|
762
|
+
};
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/core/replays.d.ts
|
|
765
|
+
/**
|
|
766
|
+
* A step that a resumed run can run again: its `id`, the `label` its row
|
|
767
|
+
* carries in `describe.diagram`, and the ids of the gates it can run before,
|
|
768
|
+
* in flow order.
|
|
769
|
+
*/
|
|
770
|
+
type ReplayHint = {
|
|
771
|
+
readonly id: string;
|
|
772
|
+
readonly label: string;
|
|
773
|
+
readonly gates: ReadonlyArray<string>;
|
|
673
774
|
};
|
|
674
775
|
//#endregion
|
|
675
776
|
//#region src/core/describe.d.ts
|
|
@@ -678,12 +779,14 @@ type DescribeOptions = {
|
|
|
678
779
|
};
|
|
679
780
|
/**
|
|
680
781
|
* Public entry point: `describe(step)` for text, `describe.json(step)` for
|
|
681
|
-
* the `FlowNode` tree, `describe.diagram(step)` for the annotated diagram
|
|
782
|
+
* the `FlowNode` tree, `describe.diagram(step)` for the annotated diagram,
|
|
783
|
+
* and `describe.replays(step)` for the steps a resume would pay for twice.
|
|
682
784
|
*/
|
|
683
|
-
declare const describe: {
|
|
785
|
+
export declare const describe: {
|
|
684
786
|
<i, o>(root: Step<i, o>, options?: DescribeOptions): string;
|
|
685
787
|
json: <i, o>(root: Step<i, o>, options?: DescribeOptions) => FlowNode;
|
|
686
788
|
diagram: <i, o>(root: Step<i, o>, options?: DiagramOptions) => string;
|
|
789
|
+
replays: <i, o>(root: Step<i, o>, options?: DescribeOptions) => ReadonlyArray<ReplayHint>;
|
|
687
790
|
};
|
|
688
791
|
//#endregion
|
|
689
792
|
//#region src/core/display_name.d.ts
|
|
@@ -693,7 +796,7 @@ declare const describe: {
|
|
|
693
796
|
* It reads only `config` and `meta`, so a `describe.json` node resolves the
|
|
694
797
|
* same way as the step it was drawn from.
|
|
695
798
|
*/
|
|
696
|
-
declare function resolve_display_name(node: Pick<AnyStep, 'config' | 'meta'>, fallback: string): string;
|
|
799
|
+
export declare function resolve_display_name(node: Pick<AnyStep, 'config' | 'meta'>, fallback: string): string;
|
|
697
800
|
//#endregion
|
|
698
801
|
//#region src/core/step_id.d.ts
|
|
699
802
|
/**
|
|
@@ -718,19 +821,19 @@ declare function resolve_display_name(node: Pick<AnyStep, 'config' | 'meta'>, fa
|
|
|
718
821
|
/**
|
|
719
822
|
* Report whether `id` can be read back as a property name.
|
|
720
823
|
*/
|
|
721
|
-
declare function is_valid_step_id(id: string): boolean;
|
|
824
|
+
export declare function is_valid_step_id(id: string): boolean;
|
|
722
825
|
/**
|
|
723
826
|
* Render the closest identifier-shaped spelling of `raw`, for failure
|
|
724
827
|
* messages only. Prefixes an underscore when the swap alone still leaves an
|
|
725
828
|
* illegal leading character, so the suggestion is always usable as written.
|
|
726
829
|
*/
|
|
727
|
-
declare function suggest_step_id(raw: string): string;
|
|
830
|
+
export declare function suggest_step_id(raw: string): string;
|
|
728
831
|
/**
|
|
729
832
|
* Throw when `id` is not identifier-shaped. `subject` names the failing
|
|
730
833
|
* surface so the message points at the call the reader actually wrote, and
|
|
731
834
|
* `remedy` says where the prose spelling belongs instead.
|
|
732
835
|
*/
|
|
733
|
-
declare function assert_valid_step_id(id: string, subject: string, remedy: string): void;
|
|
836
|
+
export declare function assert_valid_step_id(id: string, subject: string, remedy: string): void;
|
|
734
837
|
//#endregion
|
|
735
838
|
//#region src/core/sequence.d.ts
|
|
736
839
|
type FirstInput<children> = children extends readonly [Step<infer i, unknown>, ...unknown[]] ? i : unknown;
|
|
@@ -744,7 +847,7 @@ interface SequenceJointMismatch<at extends string, upstream_output, this_step_ac
|
|
|
744
847
|
}
|
|
745
848
|
type CheckedJoint<element, upstream, at extends string> = unknown extends element ? unknown : element extends AnyStep ? [upstream] extends [InputOf<element>] ? element : SequenceJointMismatch<at, upstream, InputOf<element>> : AnyStep;
|
|
746
849
|
type CheckedFirst<element> = unknown extends element ? unknown : element extends AnyStep ? element : AnyStep;
|
|
747
|
-
type CheckedTail<children extends readonly unknown[], rest extends readonly unknown[]> = { readonly [k in keyof rest]: CheckedJoint<rest[k], OutputOf<k extends keyof children ? children[k] : never>, `after children[${k & string}]
|
|
850
|
+
type CheckedTail<children extends readonly unknown[], rest extends readonly unknown[]> = { readonly [k in keyof rest]: CheckedJoint<rest[k], OutputOf<k extends keyof children ? children[k] : never>, `after children[${k & string}]`>; };
|
|
748
851
|
type IsPlainArray<t extends readonly unknown[]> = t extends readonly [] ? false : t[number][] extends [...t] ? true : false;
|
|
749
852
|
type CheckedSegment<seg extends readonly unknown[], e, upstream> = unknown extends e ? seg : [e] extends [AnyStep] ? [upstream | OutputOf<e>] extends [InputOf<e>] ? seg : readonly SequenceJointMismatch<'spread segment', upstream | OutputOf<e>, InputOf<e>>[] : readonly AnyStep[];
|
|
750
853
|
type SplitSpreadTrail<t extends readonly unknown[], trail extends readonly unknown[] = []> = IsPlainArray<t> extends true ? [t, trail] : t extends readonly [...infer init, infer last_el] ? SplitSpreadTrail<init, [last_el, ...trail]> : [t, trail];
|
|
@@ -777,13 +880,13 @@ type SequenceOptions = {
|
|
|
777
880
|
* construction with a pointed message rather than at run time. Checks
|
|
778
881
|
* `ctx.abort` before each child so aborts land on step boundaries.
|
|
779
882
|
*/
|
|
780
|
-
declare function sequence<const children extends readonly unknown[]>(children: children & CheckedChildren<children>, options?: SequenceOptions): Step<FirstInput<children>, LastOutput$1<children>>;
|
|
781
|
-
declare function sequence<t>(children: ReadonlyArray<Step<t, t>>, options?: SequenceOptions): Step<t, t>;
|
|
883
|
+
export declare function sequence<const children extends readonly unknown[]>(children: children & CheckedChildren<children>, options?: SequenceOptions): Step<FirstInput<children>, LastOutput$1<children>>;
|
|
884
|
+
export declare function sequence<t>(children: ReadonlyArray<Step<t, t>>, options?: SequenceOptions): Step<t, t>;
|
|
782
885
|
//#endregion
|
|
783
886
|
//#region src/core/parallel.d.ts
|
|
784
887
|
type UnionToIntersection<u> = (u extends unknown ? (x: u) => void : never) extends ((x: infer i) => void) ? i : never;
|
|
785
888
|
type ParallelInput<children extends Record<string, AnyStep>> = UnionToIntersection<StepInput<children[keyof children]>>;
|
|
786
|
-
type ParallelOutputs<children extends Record<string, AnyStep>> = { [k in keyof children]: StepOutput<children[k]
|
|
889
|
+
type ParallelOutputs<children extends Record<string, AnyStep>> = { [k in keyof children]: StepOutput<children[k]>; };
|
|
787
890
|
type ParallelOptions = {
|
|
788
891
|
readonly name?: string;
|
|
789
892
|
readonly description?: string;
|
|
@@ -797,7 +900,7 @@ type ParallelOptions = {
|
|
|
797
900
|
* wins over application errors so a human-approval gate stays resumable
|
|
798
901
|
* instead of being masked by a sibling's failure.
|
|
799
902
|
*/
|
|
800
|
-
declare function parallel<children extends Record<string, AnyStep>>(members: children, options?: ParallelOptions): Step<ParallelInput<children>, ParallelOutputs<children>>;
|
|
903
|
+
export declare function parallel<children extends Record<string, AnyStep>>(members: children, options?: ParallelOptions): Step<ParallelInput<children>, ParallelOutputs<children>>;
|
|
801
904
|
//#endregion
|
|
802
905
|
//#region src/core/branch.d.ts
|
|
803
906
|
type BranchConfig<i, o> = {
|
|
@@ -814,7 +917,7 @@ type BranchConfig<i, o> = {
|
|
|
814
917
|
* Both branches appear as children so `describe()` renders the full tree even
|
|
815
918
|
* though only one branch runs.
|
|
816
919
|
*/
|
|
817
|
-
declare function branch<i, o>(config: BranchConfig<i, o>): Step<i, o>;
|
|
920
|
+
export declare function branch<i, o>(config: BranchConfig<i, o>): Step<i, o>;
|
|
818
921
|
//#endregion
|
|
819
922
|
//#region src/core/map.d.ts
|
|
820
923
|
type MapConfig<input, item, result> = {
|
|
@@ -823,15 +926,52 @@ type MapConfig<input, item, result> = {
|
|
|
823
926
|
readonly items: (input: input) => ReadonlyArray<item> | Promise<ReadonlyArray<item>>;
|
|
824
927
|
readonly do: Step<item, result>;
|
|
825
928
|
readonly concurrency?: number;
|
|
929
|
+
/**
|
|
930
|
+
* Unset or `false`: the first item that throws fails the map. A map that
|
|
931
|
+
* keeps every item's outcome takes a `MapSettleConfig` instead.
|
|
932
|
+
*/
|
|
933
|
+
readonly settle?: false;
|
|
934
|
+
};
|
|
935
|
+
/**
|
|
936
|
+
* The config of a map that settles: every item runs, and the output holds one
|
|
937
|
+
* `Settled` entry per item, in input order.
|
|
938
|
+
*/
|
|
939
|
+
type MapSettleConfig<input, item, result> = Omit<MapConfig<input, item, result>, 'settle'> & {
|
|
940
|
+
readonly settle: true;
|
|
941
|
+
};
|
|
942
|
+
/**
|
|
943
|
+
* What a settled item keeps of the error it threw: the `message`, plus the
|
|
944
|
+
* `name`, `kind`, and step-id `path` when the error has them. All of it is
|
|
945
|
+
* plain data, so it survives a checkpoint, and `kind` (`timeout_error`, for
|
|
946
|
+
* example) is how to tell one failure from another once the class is gone.
|
|
947
|
+
*/
|
|
948
|
+
type SettledError = {
|
|
949
|
+
readonly message: string;
|
|
950
|
+
readonly name?: string;
|
|
951
|
+
readonly kind?: string;
|
|
952
|
+
readonly path?: ReadonlyArray<string>;
|
|
953
|
+
};
|
|
954
|
+
/**
|
|
955
|
+
* One item's outcome in the output of a map that settles.
|
|
956
|
+
*/
|
|
957
|
+
type Settled<o> = {
|
|
958
|
+
readonly ok: true;
|
|
959
|
+
readonly value: o;
|
|
960
|
+
} | {
|
|
961
|
+
readonly ok: false;
|
|
962
|
+
readonly error: SettledError;
|
|
826
963
|
};
|
|
827
964
|
/**
|
|
828
965
|
* Build a per-item execution step.
|
|
829
966
|
*
|
|
830
967
|
* Extracts an array via `items(input)`, runs `do` once per element through a
|
|
831
968
|
* bounded worker pool, and returns results in input order. The first item
|
|
832
|
-
* failure stops new work and propagates after in-flight items settle.
|
|
969
|
+
* failure stops new work and propagates after in-flight items settle. With
|
|
970
|
+
* `settle: true` every item runs, and the output holds each one's `Settled`
|
|
971
|
+
* outcome instead.
|
|
833
972
|
*/
|
|
834
|
-
declare function map<input, item, result>(config:
|
|
973
|
+
export declare function map<input, item, result>(config: MapSettleConfig<input, item, result>): Step<input, Settled<result>[]>;
|
|
974
|
+
export declare function map<input, item, result>(config: MapConfig<input, item, result>): Step<input, result[]>;
|
|
835
975
|
//#endregion
|
|
836
976
|
//#region src/core/pipe.d.ts
|
|
837
977
|
type PipeOptions = {
|
|
@@ -845,7 +985,7 @@ type PipeOptions = {
|
|
|
845
985
|
* not variadic, and the early `TypeError`s point misuse at `step(fn)` or
|
|
846
986
|
* `sequence([...])` instead of failing obscurely at run time.
|
|
847
987
|
*/
|
|
848
|
-
declare function pipe<i, a, b>(inner: Step<i, a>, fn: (value: a) => b | Promise<b>, options?: PipeOptions): Step<i, b>;
|
|
988
|
+
export declare function pipe<i, a, b>(inner: Step<i, a>, fn: (value: a) => b | Promise<b>, options?: PipeOptions): Step<i, b>;
|
|
849
989
|
//#endregion
|
|
850
990
|
//#region src/core/retry.d.ts
|
|
851
991
|
/**
|
|
@@ -894,7 +1034,7 @@ type RetryProjection<o, projected> = {
|
|
|
894
1034
|
* `on_error`; control-flow signals and errors `when` rejects propagate
|
|
895
1035
|
* untouched. `project` maps the outcome envelope into the output.
|
|
896
1036
|
*/
|
|
897
|
-
declare function retry<i, o, projected = o>(inner: Step<i, o>, config: RetryConfig & RetryProjection<o, projected>): Step<i, projected>;
|
|
1037
|
+
export declare function retry<i, o, projected = o>(inner: Step<i, o>, config: RetryConfig & RetryProjection<o, projected>): Step<i, projected>;
|
|
898
1038
|
//#endregion
|
|
899
1039
|
//#region src/core/fallback.d.ts
|
|
900
1040
|
/**
|
|
@@ -943,7 +1083,7 @@ type FallbackProjection<o, projected> = {
|
|
|
943
1083
|
* triggering the backup or the handoff. `project` maps the outcome envelope
|
|
944
1084
|
* into the output.
|
|
945
1085
|
*/
|
|
946
|
-
declare function fallback<i, o, projected = o>(primary: Step<i, o>, backup: Step<i, o>, options?: FallbackOptions<i> & FallbackProjection<o, projected>): Step<i, projected>;
|
|
1086
|
+
export declare function fallback<i, o, projected = o>(primary: Step<i, o>, backup: Step<i, o>, options?: FallbackOptions<i> & FallbackProjection<o, projected>): Step<i, projected>;
|
|
947
1087
|
//#endregion
|
|
948
1088
|
//#region src/core/timeout.d.ts
|
|
949
1089
|
type TimeoutOptions = {
|
|
@@ -957,7 +1097,7 @@ type TimeoutOptions = {
|
|
|
957
1097
|
* with `timeout_error`. The `timed_out` flag distinguishes timer expiry from
|
|
958
1098
|
* a parent abort so the right error propagates.
|
|
959
1099
|
*/
|
|
960
|
-
declare function timeout<i, o>(inner: Step<i, o>, ms: number, options?: TimeoutOptions): Step<i, o>;
|
|
1100
|
+
export declare function timeout<i, o>(inner: Step<i, o>, ms: number, options?: TimeoutOptions): Step<i, o>;
|
|
961
1101
|
//#endregion
|
|
962
1102
|
//#region src/core/loop.d.ts
|
|
963
1103
|
type LoopGuardResult<state> = {
|
|
@@ -987,7 +1127,7 @@ type LoopConfig<i, state, o> = {
|
|
|
987
1127
|
* can tell a converged run from an exhausted one without the loop wrapping
|
|
988
1128
|
* its output.
|
|
989
1129
|
*/
|
|
990
|
-
declare function loop<i, state, o>(config: LoopConfig<i, state, o>): Step<i, o>;
|
|
1130
|
+
export declare function loop<i, state, o>(config: LoopConfig<i, state, o>): Step<i, o>;
|
|
991
1131
|
//#endregion
|
|
992
1132
|
//#region src/core/compose.d.ts
|
|
993
1133
|
type ComposeConfig = {
|
|
@@ -1001,7 +1141,7 @@ type ComposeConfig = {
|
|
|
1001
1141
|
* `display_name` used as the span label. Throws a `TypeError` when `name`
|
|
1002
1142
|
* is not a non-empty string, catching the mistake at construction time.
|
|
1003
1143
|
*/
|
|
1004
|
-
declare function compose<i, o>(inner: Step<i, o>, config: ComposeConfig): Step<i, o>;
|
|
1144
|
+
export declare function compose<i, o>(inner: Step<i, o>, config: ComposeConfig): Step<i, o>;
|
|
1005
1145
|
//#endregion
|
|
1006
1146
|
//#region src/core/checkpoint.d.ts
|
|
1007
1147
|
type CheckpointConfig<i> = {
|
|
@@ -1018,13 +1158,14 @@ type CheckpointConfig<i> = {
|
|
|
1018
1158
|
* re-computed rather than replayed. Throws at construction time when `inner`
|
|
1019
1159
|
* is anonymous.
|
|
1020
1160
|
*/
|
|
1021
|
-
declare function checkpoint<i, o>(inner: Step<i, o>, config: CheckpointConfig<i>): Step<i, o>;
|
|
1161
|
+
export declare function checkpoint<i, o>(inner: Step<i, o>, config: CheckpointConfig<i>): Step<i, o>;
|
|
1022
1162
|
//#endregion
|
|
1023
1163
|
//#region src/core/suspend.d.ts
|
|
1024
1164
|
type SuspendConfig<i, o, resume> = {
|
|
1025
1165
|
readonly id: string;
|
|
1026
1166
|
readonly name?: string;
|
|
1027
1167
|
readonly description?: string;
|
|
1168
|
+
readonly deadline_ms?: number;
|
|
1028
1169
|
readonly on: (input: i, ctx: RunContext) => Promise<void> | void;
|
|
1029
1170
|
readonly resume_schema: AnySchema<resume>;
|
|
1030
1171
|
readonly combine: (input: i, resume: resume, ctx: RunContext) => Promise<o> | o | Step<i, o>;
|
|
@@ -1037,7 +1178,7 @@ type SuspendConfig<i, o, resume> = {
|
|
|
1037
1178
|
* `combine`. The step's id is the user-supplied suspend id so resume data can
|
|
1038
1179
|
* be addressed to it.
|
|
1039
1180
|
*/
|
|
1040
|
-
declare function suspend<i, o, resume>(config: SuspendConfig<i, o, resume>): Step<i, o>;
|
|
1181
|
+
export declare function suspend<i, o, resume>(config: SuspendConfig<i, o, resume>): Step<i, o>;
|
|
1041
1182
|
//#endregion
|
|
1042
1183
|
//#region src/core/scope.d.ts
|
|
1043
1184
|
type LastOutput<children> = children extends readonly [...unknown[], Step<never, infer o>] ? o : children extends readonly [Step<never, infer o>] ? o : unknown;
|
|
@@ -1060,24 +1201,24 @@ type UseOptions = {
|
|
|
1060
1201
|
* values) and registered so `stash`/`use` inside recognize it; writes stay
|
|
1061
1202
|
* local to this scope. Outputs chain like `sequence`.
|
|
1062
1203
|
*/
|
|
1063
|
-
declare function scope<const children extends readonly AnyStep[]>(children: children, options?: ScopeOptions): Step<unknown, LastOutput<children>>;
|
|
1204
|
+
export declare function scope<const children extends readonly AnyStep[]>(children: children, options?: ScopeOptions): Step<unknown, LastOutput<children>>;
|
|
1064
1205
|
/**
|
|
1065
1206
|
* Build a step that stores its source's output in scope state at `key`.
|
|
1066
1207
|
*
|
|
1067
1208
|
* Passes the value through unchanged so it composes mid-chain. Throws when
|
|
1068
1209
|
* run outside a `scope`.
|
|
1069
1210
|
*/
|
|
1070
|
-
declare function stash<i, v>(key: string, source: Step<i, v>, options?: StashOptions): Step<i, v>;
|
|
1211
|
+
export declare function stash<i, v>(key: string, source: Step<i, v>, options?: StashOptions): Step<i, v>;
|
|
1071
1212
|
/**
|
|
1072
1213
|
* Build a step that projects named scope values into a function call.
|
|
1073
1214
|
*
|
|
1074
1215
|
* Reads `keys` from scope state (missing keys project as `undefined`) and
|
|
1075
1216
|
* invokes `fn(projection, input, ctx)`. Throws when run outside a `scope`.
|
|
1076
1217
|
*/
|
|
1077
|
-
declare function use<const keys extends readonly string[], i, o>(keys: keys, fn: (state: { [k in keys[number]]: unknown }, input: i, ctx: RunContext) => Promise<o> | o, options?: UseOptions): Step<i, o>;
|
|
1218
|
+
export declare function use<const keys extends readonly string[], i, o>(keys: keys, fn: (state: { [k in keys[number]]: unknown; }, input: i, ctx: RunContext) => Promise<o> | o, options?: UseOptions): Step<i, o>;
|
|
1078
1219
|
//#endregion
|
|
1079
1220
|
//#region src/core/chain.d.ts
|
|
1080
|
-
type merge<a, b> = { readonly [k in keyof (a & b)]: (a & b)[k] };
|
|
1221
|
+
type merge<a, b> = { readonly [k in keyof (a & b)]: (a & b)[k]; };
|
|
1081
1222
|
type ChainStepOptions = {
|
|
1082
1223
|
readonly arm?: AnyStep | ReadonlyArray<AnyStep>;
|
|
1083
1224
|
/**
|
|
@@ -1085,13 +1226,14 @@ type ChainStepOptions = {
|
|
|
1085
1226
|
* name is a record key and so must be identifier-shaped; this is where the
|
|
1086
1227
|
* free prose goes, exactly as `meta.name` does for a plain `step`.
|
|
1087
1228
|
*/
|
|
1088
|
-
readonly name?: string;
|
|
1229
|
+
readonly name?: string;
|
|
1230
|
+
/** What the binding is for, carried to `describe` as `meta.description`. */
|
|
1089
1231
|
readonly description?: string;
|
|
1090
1232
|
};
|
|
1091
1233
|
type Chain<i, acc> = {
|
|
1092
1234
|
readonly step: {
|
|
1093
|
-
<k extends string, o>(name: k, fn: (s: acc, ctx: RunContext) => Promise<o> | o, options?: ChainStepOptions): Chain<i, merge<acc, { readonly [p in k]: o }>>;
|
|
1094
|
-
<k extends string, a, o>(name: k, arm: Step<a, o>, select: (s: acc) => a, options?: ChainStepOptions): Chain<i, merge<acc, { readonly [p in k]: o }>>;
|
|
1235
|
+
<k extends string, o>(name: k, fn: (s: acc, ctx: RunContext) => Promise<o> | o, options?: ChainStepOptions): Chain<i, merge<acc, { readonly [p in k]: o; }>>;
|
|
1236
|
+
<k extends string, a, o>(name: k, arm: Step<a, o>, select: (s: acc) => a, options?: ChainStepOptions): Chain<i, merge<acc, { readonly [p in k]: o; }>>;
|
|
1095
1237
|
};
|
|
1096
1238
|
readonly stage: {
|
|
1097
1239
|
(name: string): Chain<i, acc>;
|
|
@@ -1107,7 +1249,7 @@ type Chain<i, acc> = {
|
|
|
1107
1249
|
* before any entry is recorded.
|
|
1108
1250
|
*/
|
|
1109
1251
|
type ChainOpen<i, k extends string, acc> = Chain<i, acc> & {
|
|
1110
|
-
readonly input: <t>() => Chain<t, { readonly [p in k]: t }>;
|
|
1252
|
+
readonly input: <t>() => Chain<t, { readonly [p in k]: t; }>;
|
|
1111
1253
|
};
|
|
1112
1254
|
/**
|
|
1113
1255
|
* Open a chain builder whose record starts as `{ [input_name]: input }`.
|
|
@@ -1121,35 +1263,51 @@ type ChainOpen<i, k extends string, acc> = Chain<i, acc> & {
|
|
|
1121
1263
|
* return, so binding names and views are checked at compile time with no
|
|
1122
1264
|
* declared state shape.
|
|
1123
1265
|
*/
|
|
1124
|
-
declare function chain<i = never, k extends string = 'input'>(input_name?: k): ChainOpen<i, k, { readonly [p in k]: i }>;
|
|
1266
|
+
export declare function chain<i = never, k extends string = 'input'>(input_name?: k): ChainOpen<i, k, { readonly [p in k]: i; }>;
|
|
1125
1267
|
//#endregion
|
|
1126
1268
|
//#region src/core/errors.d.ts
|
|
1127
|
-
declare class timeout_error extends Error {
|
|
1269
|
+
export declare class timeout_error extends Error {
|
|
1128
1270
|
readonly kind: "timeout_error";
|
|
1129
1271
|
readonly path?: ReadonlyArray<string>;
|
|
1130
1272
|
readonly timeout_ms: number;
|
|
1131
1273
|
constructor(message: string, timeout_ms: number);
|
|
1132
1274
|
}
|
|
1133
|
-
declare class suspended_error extends Error {
|
|
1275
|
+
export declare class suspended_error extends Error {
|
|
1134
1276
|
readonly kind: "suspended_error";
|
|
1135
1277
|
readonly path?: ReadonlyArray<string>;
|
|
1136
1278
|
readonly suspend_id: string;
|
|
1137
1279
|
readonly payload: unknown;
|
|
1138
|
-
|
|
1280
|
+
readonly deadline_ms: number | undefined;
|
|
1281
|
+
constructor(suspend_id: string, payload: unknown, message?: string, deadline_ms?: number);
|
|
1139
1282
|
}
|
|
1140
|
-
declare class resume_validation_error extends Error {
|
|
1283
|
+
export declare class resume_validation_error extends Error {
|
|
1141
1284
|
readonly kind: "resume_validation_error";
|
|
1142
1285
|
readonly path?: ReadonlyArray<string>;
|
|
1143
1286
|
readonly issues: ReadonlyArray<SchemaIssue>;
|
|
1144
|
-
|
|
1287
|
+
readonly suspend_id: string | undefined;
|
|
1288
|
+
constructor(message: string, issues: ReadonlyArray<SchemaIssue>, suspend_id?: string);
|
|
1289
|
+
}
|
|
1290
|
+
export declare class flow_changed_error extends Error {
|
|
1291
|
+
readonly kind: "flow_changed_error";
|
|
1292
|
+
readonly path?: ReadonlyArray<string>;
|
|
1293
|
+
readonly run_id: string;
|
|
1294
|
+
readonly started_on: string;
|
|
1295
|
+
readonly continued_on: string;
|
|
1296
|
+
constructor(run_id: string, started_on: string, continued_on: string);
|
|
1297
|
+
}
|
|
1298
|
+
export declare class run_not_found_error extends Error {
|
|
1299
|
+
readonly kind: "run_not_found_error";
|
|
1300
|
+
readonly path?: ReadonlyArray<string>;
|
|
1301
|
+
readonly run_id: string;
|
|
1302
|
+
constructor(run_id: string);
|
|
1145
1303
|
}
|
|
1146
|
-
declare class describe_cycle_error extends Error {
|
|
1304
|
+
export declare class describe_cycle_error extends Error {
|
|
1147
1305
|
readonly kind: "describe_cycle_error";
|
|
1148
1306
|
readonly path?: ReadonlyArray<string>;
|
|
1149
1307
|
readonly step_id: string;
|
|
1150
1308
|
constructor(step_id: string, message?: string);
|
|
1151
1309
|
}
|
|
1152
|
-
declare class aborted_error extends Error {
|
|
1310
|
+
export declare class aborted_error extends Error {
|
|
1153
1311
|
readonly kind: "aborted_error";
|
|
1154
1312
|
readonly path?: ReadonlyArray<string>;
|
|
1155
1313
|
readonly reason?: unknown;
|
|
@@ -1176,7 +1334,7 @@ declare class aborted_error extends Error {
|
|
|
1176
1334
|
* property is present and well-formed (an all-string array); anything else,
|
|
1177
1335
|
* including non-object inputs, is `undefined`.
|
|
1178
1336
|
*/
|
|
1179
|
-
declare function error_path(err: unknown): ReadonlyArray<string> | undefined;
|
|
1337
|
+
export declare function error_path(err: unknown): ReadonlyArray<string> | undefined;
|
|
1180
1338
|
//#endregion
|
|
1181
1339
|
//#region src/core/is_step.d.ts
|
|
1182
1340
|
/**
|
|
@@ -1185,7 +1343,7 @@ declare function error_path(err: unknown): ReadonlyArray<string> | undefined;
|
|
|
1185
1343
|
* True when the value has a string `id`, a string `kind`, and a callable
|
|
1186
1344
|
* `run`.
|
|
1187
1345
|
*/
|
|
1188
|
-
declare function is_step(value: unknown): value is AnyStep;
|
|
1346
|
+
export declare function is_step(value: unknown): value is AnyStep;
|
|
1189
1347
|
//#endregion
|
|
1190
1348
|
//#region src/core/step_kinds.d.ts
|
|
1191
1349
|
/**
|
|
@@ -1198,12 +1356,12 @@ declare function is_step(value: unknown): value is AnyStep;
|
|
|
1198
1356
|
* `composites/__tests__/coverage.test.ts` covers the four composite kinds
|
|
1199
1357
|
* whose factories live outside core.
|
|
1200
1358
|
*/
|
|
1201
|
-
declare const STEP_KINDS: readonly ["step", "sequence", "parallel", "branch", "map", "pipe", "retry", "fallback", "timeout", "loop", "compose", "adversarial", "ensemble", "tournament", "consensus", "checkpoint", "suspend", "scope", "stash", "use", "chain"];
|
|
1359
|
+
export declare const STEP_KINDS: readonly ["step", "sequence", "parallel", "branch", "map", "pipe", "retry", "fallback", "timeout", "loop", "compose", "adversarial", "ensemble", "tournament", "consensus", "checkpoint", "suspend", "scope", "stash", "use", "chain"];
|
|
1202
1360
|
type StepKind = (typeof STEP_KINDS)[number];
|
|
1203
1361
|
/**
|
|
1204
1362
|
* Check whether a value is one of the registered `Step.kind` strings.
|
|
1205
1363
|
*/
|
|
1206
|
-
declare function is_step_kind(value: unknown): value is StepKind;
|
|
1364
|
+
export declare function is_step_kind(value: unknown): value is StepKind;
|
|
1207
1365
|
//#endregion
|
|
1208
1366
|
//#region src/engine/create_engine.d.ts
|
|
1209
1367
|
/**
|
|
@@ -1213,18 +1371,21 @@ declare function is_step_kind(value: unknown): value is StepKind;
|
|
|
1213
1371
|
* A `generate` call that names a provider absent from `config.providers`
|
|
1214
1372
|
* still throws `provider_not_configured_error`, but only at call time.
|
|
1215
1373
|
*/
|
|
1216
|
-
declare function create_engine(config: EngineConfig): Engine;
|
|
1374
|
+
export declare function create_engine(config: EngineConfig): Engine;
|
|
1217
1375
|
//#endregion
|
|
1218
1376
|
//#region src/engine/throughput.d.ts
|
|
1219
1377
|
type Throughput = {
|
|
1220
|
-
/** Output tokens per second over the measured window. Not rounded. */
|
|
1378
|
+
/** Output tokens per second over the measured window. Not rounded. */
|
|
1379
|
+
tokens_per_second: number;
|
|
1221
1380
|
/**
|
|
1222
1381
|
* 'decode' when every contributing step streamed, so each window excludes
|
|
1223
1382
|
* its time-to-first-chunk; 'blended' when any window is a whole round-trip
|
|
1224
1383
|
* (network + queueing + prefill included).
|
|
1225
1384
|
*/
|
|
1226
|
-
basis: 'decode' | 'blended';
|
|
1227
|
-
|
|
1385
|
+
basis: 'decode' | 'blended';
|
|
1386
|
+
/** Output tokens summed across the contributing steps. */
|
|
1387
|
+
output_tokens: number;
|
|
1388
|
+
/** The measured window in ms, summed across the contributing steps. */
|
|
1228
1389
|
measured_ms: number;
|
|
1229
1390
|
};
|
|
1230
1391
|
/**
|
|
@@ -1239,7 +1400,7 @@ type Throughput = {
|
|
|
1239
1400
|
* no step has timing (an external adapter, a test seam), or the summed window
|
|
1240
1401
|
* is 0 ms (a sub-millisecond stub turn), where a rate would divide by zero.
|
|
1241
1402
|
*/
|
|
1242
|
-
declare function throughput(source: GenerateResult<unknown> | StepRecord | ReadonlyArray<StepRecord>): Throughput | undefined;
|
|
1403
|
+
export declare function throughput(source: GenerateResult<unknown> | StepRecord | ReadonlyArray<StepRecord>): Throughput | undefined;
|
|
1243
1404
|
//#endregion
|
|
1244
1405
|
//#region src/engine/providers/claude_cli/reported.d.ts
|
|
1245
1406
|
/**
|
|
@@ -1251,12 +1412,12 @@ declare function throughput(source: GenerateResult<unknown> | StepRecord | Reado
|
|
|
1251
1412
|
* entry lacks a string `session_id` and a numeric `duration_ms`.
|
|
1252
1413
|
* `duration_api_ms` carries through only when it is a number.
|
|
1253
1414
|
*/
|
|
1254
|
-
declare function claude_cli_reported(source: {
|
|
1415
|
+
export declare function claude_cli_reported(source: {
|
|
1255
1416
|
readonly provider_reported?: Readonly<Record<string, unknown>>;
|
|
1256
1417
|
}): ClaudeCliProviderReported | undefined;
|
|
1257
1418
|
//#endregion
|
|
1258
1419
|
//#region src/engine/errors.d.ts
|
|
1259
|
-
declare class rate_limit_error extends Error {
|
|
1420
|
+
export declare class rate_limit_error extends Error {
|
|
1260
1421
|
readonly kind: "rate_limit_error";
|
|
1261
1422
|
readonly path?: ReadonlyArray<string>;
|
|
1262
1423
|
readonly retry_after_ms: number | undefined;
|
|
@@ -1268,7 +1429,7 @@ declare class rate_limit_error extends Error {
|
|
|
1268
1429
|
status?: number;
|
|
1269
1430
|
});
|
|
1270
1431
|
}
|
|
1271
|
-
declare class provider_error extends Error {
|
|
1432
|
+
export declare class provider_error extends Error {
|
|
1272
1433
|
readonly kind: "provider_error";
|
|
1273
1434
|
readonly path?: ReadonlyArray<string>;
|
|
1274
1435
|
readonly status: number | undefined;
|
|
@@ -1280,14 +1441,14 @@ declare class provider_error extends Error {
|
|
|
1280
1441
|
cause_kind?: 'provider_5xx' | 'network' | 'unknown';
|
|
1281
1442
|
});
|
|
1282
1443
|
}
|
|
1283
|
-
declare class schema_validation_error extends Error {
|
|
1444
|
+
export declare class schema_validation_error extends Error {
|
|
1284
1445
|
readonly kind: "schema_validation_error";
|
|
1285
1446
|
readonly path?: ReadonlyArray<string>;
|
|
1286
1447
|
readonly schema_issues: ReadonlyArray<SchemaIssue>;
|
|
1287
1448
|
readonly raw_text: string;
|
|
1288
1449
|
constructor(message: string, schema_issues: ReadonlyArray<SchemaIssue>, raw_text: string);
|
|
1289
1450
|
}
|
|
1290
|
-
declare class tool_error extends Error {
|
|
1451
|
+
export declare class tool_error extends Error {
|
|
1291
1452
|
readonly kind: "tool_error";
|
|
1292
1453
|
readonly path?: ReadonlyArray<string>;
|
|
1293
1454
|
readonly tool_name: string;
|
|
@@ -1299,7 +1460,7 @@ declare class tool_error extends Error {
|
|
|
1299
1460
|
cause: unknown;
|
|
1300
1461
|
});
|
|
1301
1462
|
}
|
|
1302
|
-
declare class tool_approval_denied_error extends Error {
|
|
1463
|
+
export declare class tool_approval_denied_error extends Error {
|
|
1303
1464
|
readonly kind: "tool_approval_denied_error";
|
|
1304
1465
|
readonly path?: ReadonlyArray<string>;
|
|
1305
1466
|
readonly tool_name: string;
|
|
@@ -1311,7 +1472,7 @@ declare class tool_approval_denied_error extends Error {
|
|
|
1311
1472
|
tool_call_id: string;
|
|
1312
1473
|
});
|
|
1313
1474
|
}
|
|
1314
|
-
declare class model_required_error extends Error {
|
|
1475
|
+
export declare class model_required_error extends Error {
|
|
1315
1476
|
readonly kind: "model_required_error";
|
|
1316
1477
|
readonly path?: ReadonlyArray<string>;
|
|
1317
1478
|
constructor(message?: string);
|
|
@@ -1321,7 +1482,7 @@ declare class model_required_error extends Error {
|
|
|
1321
1482
|
* configured names, and the message repeats them, so a typo is visible from
|
|
1322
1483
|
* the message alone rather than needing the engine config alongside it.
|
|
1323
1484
|
*/
|
|
1324
|
-
declare class provider_not_configured_error extends Error {
|
|
1485
|
+
export declare class provider_not_configured_error extends Error {
|
|
1325
1486
|
readonly kind: "provider_not_configured_error";
|
|
1326
1487
|
readonly path?: ReadonlyArray<string>;
|
|
1327
1488
|
readonly provider: string;
|
|
@@ -1334,38 +1495,38 @@ declare class provider_not_configured_error extends Error {
|
|
|
1334
1495
|
* the configured provider names so the message tells the caller exactly what
|
|
1335
1496
|
* the engine can route to.
|
|
1336
1497
|
*/
|
|
1337
|
-
declare class provider_required_error extends Error {
|
|
1498
|
+
export declare class provider_required_error extends Error {
|
|
1338
1499
|
readonly kind: "provider_required_error";
|
|
1339
1500
|
readonly path?: ReadonlyArray<string>;
|
|
1340
1501
|
readonly configured: ReadonlyArray<string>;
|
|
1341
1502
|
constructor(configured: ReadonlyArray<string>);
|
|
1342
1503
|
}
|
|
1343
|
-
declare class engine_config_error extends Error {
|
|
1504
|
+
export declare class engine_config_error extends Error {
|
|
1344
1505
|
readonly kind: "engine_config_error";
|
|
1345
1506
|
readonly path?: ReadonlyArray<string>;
|
|
1346
1507
|
readonly provider: string | undefined;
|
|
1347
1508
|
constructor(message: string, provider?: string);
|
|
1348
1509
|
}
|
|
1349
|
-
declare class on_chunk_error extends Error {
|
|
1510
|
+
export declare class on_chunk_error extends Error {
|
|
1350
1511
|
readonly kind: "on_chunk_error";
|
|
1351
1512
|
readonly path?: ReadonlyArray<string>;
|
|
1352
1513
|
readonly cause: unknown;
|
|
1353
1514
|
constructor(message: string, cause: unknown);
|
|
1354
1515
|
}
|
|
1355
|
-
declare class provider_capability_error extends Error {
|
|
1516
|
+
export declare class provider_capability_error extends Error {
|
|
1356
1517
|
readonly kind: "provider_capability_error";
|
|
1357
1518
|
readonly path?: ReadonlyArray<string>;
|
|
1358
1519
|
readonly provider: string;
|
|
1359
1520
|
readonly capability: string;
|
|
1360
1521
|
constructor(provider: string, capability: string, detail?: string);
|
|
1361
1522
|
}
|
|
1362
|
-
declare class engine_disposed_error extends Error {
|
|
1523
|
+
export declare class engine_disposed_error extends Error {
|
|
1363
1524
|
readonly kind: "engine_disposed_error";
|
|
1364
1525
|
readonly path?: ReadonlyArray<string>;
|
|
1365
1526
|
constructor(message?: string);
|
|
1366
1527
|
}
|
|
1367
1528
|
type ClaudeCliErrorReason = 'binary_not_found' | 'auth_missing' | 'auth_expired' | 'api_key_missing' | 'startup_timeout' | 'stall_timeout' | 'no_result_event' | 'result_error' | 'subprocess_exit' | 'sandbox_unavailable' | 'engine_disposed' | 'parse_error';
|
|
1368
|
-
declare class claude_cli_error extends Error {
|
|
1529
|
+
export declare class claude_cli_error extends Error {
|
|
1369
1530
|
readonly kind: "claude_cli_error";
|
|
1370
1531
|
readonly path?: ReadonlyArray<string>;
|
|
1371
1532
|
readonly reason: ClaudeCliErrorReason;
|
|
@@ -1376,7 +1537,7 @@ declare class claude_cli_error extends Error {
|
|
|
1376
1537
|
stderr_snippet?: string;
|
|
1377
1538
|
});
|
|
1378
1539
|
}
|
|
1379
|
-
declare class provider_auth_error extends Error {
|
|
1540
|
+
export declare class provider_auth_error extends Error {
|
|
1380
1541
|
readonly kind: "provider_auth_error";
|
|
1381
1542
|
readonly path?: ReadonlyArray<string>;
|
|
1382
1543
|
readonly provider: string;
|
|
@@ -1394,7 +1555,7 @@ declare class provider_auth_error extends Error {
|
|
|
1394
1555
|
* schema_validation_error, which covers a response that completed normally
|
|
1395
1556
|
* and then failed validation after its repair attempts ran out.
|
|
1396
1557
|
*/
|
|
1397
|
-
declare class incomplete_generation_error extends Error {
|
|
1558
|
+
export declare class incomplete_generation_error extends Error {
|
|
1398
1559
|
readonly kind: "incomplete_generation_error";
|
|
1399
1560
|
readonly path?: ReadonlyArray<string>;
|
|
1400
1561
|
readonly finish_reason: FinishReason;
|
|
@@ -1442,7 +1603,7 @@ type AdversarialConfig<input, candidate, projected = AdversarialResult<candidate
|
|
|
1442
1603
|
* through `scope`/`stash`/`use` so the build and critique steps remain
|
|
1443
1604
|
* unmodified user-supplied `Step` values.
|
|
1444
1605
|
*/
|
|
1445
|
-
declare function adversarial<input, candidate, projected = AdversarialResult<candidate>>(config: AdversarialConfig<input, candidate, projected>): Step<input, projected>;
|
|
1606
|
+
export declare function adversarial<input, candidate, projected = AdversarialResult<candidate>>(config: AdversarialConfig<input, candidate, projected>): Step<input, projected>;
|
|
1446
1607
|
//#endregion
|
|
1447
1608
|
//#region src/composites/consensus.d.ts
|
|
1448
1609
|
type ConsensusConfig<i, o, projected = ConsensusResult<o>> = {
|
|
@@ -1471,7 +1632,7 @@ type ConsensusResult<o> = {
|
|
|
1471
1632
|
* whose guard evaluates `agree`. State carries the original input alongside
|
|
1472
1633
|
* the most recent results so each round receives the same input.
|
|
1473
1634
|
*/
|
|
1474
|
-
declare function consensus<i, o, projected = ConsensusResult<o>>(config: ConsensusConfig<i, o, projected>): Step<i, projected>;
|
|
1635
|
+
export declare function consensus<i, o, projected = ConsensusResult<o>>(config: ConsensusConfig<i, o, projected>): Step<i, projected>;
|
|
1475
1636
|
//#endregion
|
|
1476
1637
|
//#region src/composites/ensemble.d.ts
|
|
1477
1638
|
type EnsembleConfig<i, o, projected = EnsembleResult<o>> = {
|
|
@@ -1500,7 +1661,7 @@ type EnsembleResult<o> = {
|
|
|
1500
1661
|
* a single picking step. Cancellation, fan-out, and abort propagation come
|
|
1501
1662
|
* from `parallel`'s own contract.
|
|
1502
1663
|
*/
|
|
1503
|
-
declare function ensemble<i, o, projected = EnsembleResult<o>>(config: EnsembleConfig<i, o, projected>): Step<i, projected>;
|
|
1664
|
+
export declare function ensemble<i, o, projected = EnsembleResult<o>>(config: EnsembleConfig<i, o, projected>): Step<i, projected>;
|
|
1504
1665
|
//#endregion
|
|
1505
1666
|
//#region src/composites/ensemble_step.d.ts
|
|
1506
1667
|
type EnsembleStepConfig<i, o, ranked, projected = EnsembleStepResult<o, ranked>> = {
|
|
@@ -1539,7 +1700,7 @@ type EnsembleStepResult<o, ranked> = {
|
|
|
1539
1700
|
* winner). Cancellation, fan-out, and abort propagation come from the
|
|
1540
1701
|
* underlying `parallel` and `map` contracts.
|
|
1541
1702
|
*/
|
|
1542
|
-
declare function ensemble_step<i, o, ranked, projected = EnsembleStepResult<o, ranked>>(config: EnsembleStepConfig<i, o, ranked, projected>): Step<i, projected>;
|
|
1703
|
+
export declare function ensemble_step<i, o, ranked, projected = EnsembleStepResult<o, ranked>>(config: EnsembleStepConfig<i, o, ranked, projected>): Step<i, projected>;
|
|
1543
1704
|
//#endregion
|
|
1544
1705
|
//#region src/composites/gate.d.ts
|
|
1545
1706
|
type GateConfig<o> = {
|
|
@@ -1564,7 +1725,7 @@ type GateConfig<o> = {
|
|
|
1564
1725
|
* `combine` returns a `use` step that restores the stashed result, which is
|
|
1565
1726
|
* how the decision stays signal-only.
|
|
1566
1727
|
*/
|
|
1567
|
-
declare function gate<i, o>(inner: Step<i, o>, config: GateConfig<o>): Step<i, o>;
|
|
1728
|
+
export declare function gate<i, o>(inner: Step<i, o>, config: GateConfig<o>): Step<i, o>;
|
|
1568
1729
|
//#endregion
|
|
1569
1730
|
//#region src/composites/improve.d.ts
|
|
1570
1731
|
type Candidate<c> = {
|
|
@@ -1642,7 +1803,7 @@ type ImproveResult<c> = {
|
|
|
1642
1803
|
* `ensemble_step`, and merges the outcome back into state via `use`.
|
|
1643
1804
|
* State threading is the entire job.
|
|
1644
1805
|
*/
|
|
1645
|
-
declare function improve<i, c, projected = ImproveResult<c>>(config: ImproveConfig<i, c, projected>): Step<i, projected>;
|
|
1806
|
+
export declare function improve<i, c, projected = ImproveResult<c>>(config: ImproveConfig<i, c, projected>): Step<i, projected>;
|
|
1646
1807
|
//#endregion
|
|
1647
1808
|
//#region src/composites/learn.d.ts
|
|
1648
1809
|
type TrajectorySource = {
|
|
@@ -1688,7 +1849,7 @@ type LearnResult<o> = {
|
|
|
1688
1849
|
* wraps its proposals with the stashed meta (event count, run ids) into a
|
|
1689
1850
|
* `LearnResult`.
|
|
1690
1851
|
*/
|
|
1691
|
-
declare function learn<i extends LearnInput, o>(config: LearnConfig<i, o>): Step<unknown, LearnResult<o>>;
|
|
1852
|
+
export declare function learn<i extends LearnInput, o>(config: LearnConfig<i, o>): Step<unknown, LearnResult<o>>;
|
|
1692
1853
|
//#endregion
|
|
1693
1854
|
//#region src/composites/tournament.d.ts
|
|
1694
1855
|
type BracketRecord = {
|
|
@@ -1717,7 +1878,7 @@ type TournamentResult<o> = {
|
|
|
1717
1878
|
* bracket }` envelope into the step's output (for example, `(r) => r.winner`);
|
|
1718
1879
|
* omitted, the envelope itself is the output.
|
|
1719
1880
|
*/
|
|
1720
|
-
declare function tournament<i, o, projected = TournamentResult<o>>(config: TournamentConfig<i, o, projected>): Step<i, projected>;
|
|
1881
|
+
export declare function tournament<i, o, projected = TournamentResult<o>>(config: TournamentConfig<i, o, projected>): Step<i, projected>;
|
|
1721
1882
|
//#endregion
|
|
1722
1883
|
//#region src/composites/errors.d.ts
|
|
1723
1884
|
/**
|
|
@@ -1727,7 +1888,7 @@ declare function tournament<i, o, projected = TournamentResult<o>>(config: Tourn
|
|
|
1727
1888
|
* src/mcp/errors.ts in the `no-class` rule ignores: `instanceof` branching is
|
|
1728
1889
|
* how a caller tells a benched flow's usage error apart from a case failure.
|
|
1729
1890
|
*/
|
|
1730
|
-
declare class bench_suspend_error extends Error {
|
|
1891
|
+
export declare class bench_suspend_error extends Error {
|
|
1731
1892
|
readonly kind: "bench_suspend_error";
|
|
1732
1893
|
readonly path?: ReadonlyArray<string>;
|
|
1733
1894
|
readonly case_id: string;
|
|
@@ -1810,7 +1971,7 @@ type BenchOptions = {
|
|
|
1810
1971
|
* `suspended_error` from an approval gate rejects with `bench_suspend_error`:
|
|
1811
1972
|
* `bench` has no resume path, so a suspend is a usage error, not a zero score.
|
|
1812
1973
|
*/
|
|
1813
|
-
declare function bench<I, O, S = Score>(flow: Step<I, O>, cases: ReadonlyArray<BenchCase<I>>, judges: Record<string, Judge<I, O, S>>, options?: BenchOptions): Promise<BenchReport<I, O, S>>;
|
|
1974
|
+
export declare function bench<I, O, S = Score>(flow: Step<I, O>, cases: ReadonlyArray<BenchCase<I>>, judges: Record<string, Judge<I, O, S>>, options?: BenchOptions): Promise<BenchReport<I, O, S>>;
|
|
1814
1975
|
/**
|
|
1815
1976
|
* Coerces a raw judge return value into a `Score`.
|
|
1816
1977
|
*
|
|
@@ -1819,21 +1980,21 @@ declare function bench<I, O, S = Score>(flow: Step<I, O>, cases: ReadonlyArray<B
|
|
|
1819
1980
|
* non-string `reason`, which is dropped) normalizes toward `undefined` or a
|
|
1820
1981
|
* reason-less score; `undefined` means the judge abstained.
|
|
1821
1982
|
*/
|
|
1822
|
-
declare function normalize_score(raw: unknown): Score | undefined;
|
|
1983
|
+
export declare function normalize_score(raw: unknown): Score | undefined;
|
|
1823
1984
|
//#endregion
|
|
1824
1985
|
//#region src/composites/judges.d.ts
|
|
1825
1986
|
/**
|
|
1826
1987
|
* Judge that scores 1 when the output deep-equals `meta.expected`, 0
|
|
1827
1988
|
* otherwise. Abstains when the case has no `meta` or no `expected` key.
|
|
1828
1989
|
*/
|
|
1829
|
-
declare function judge_equals<O>(): Judge<unknown, O>;
|
|
1990
|
+
export declare function judge_equals<O>(): Judge<unknown, O>;
|
|
1830
1991
|
type JudgeWithFn<I, O> = (args: JudgeArgs<I, O>) => number | Score | undefined | Promise<number | Score | undefined>;
|
|
1831
1992
|
/**
|
|
1832
1993
|
* Wraps a plain scoring function as a Judge. The function may return a bare
|
|
1833
1994
|
* number, a `Score`, or `undefined` to abstain; the result is normalized
|
|
1834
1995
|
* via `normalize_score`.
|
|
1835
1996
|
*/
|
|
1836
|
-
declare function judge_with<I, O>(fn: JudgeWithFn<I, O>): Judge<I, O>;
|
|
1997
|
+
export declare function judge_with<I, O>(fn: JudgeWithFn<I, O>): Judge<I, O>;
|
|
1837
1998
|
type JudgeLlmConfig = {
|
|
1838
1999
|
readonly model: Step<string, string>;
|
|
1839
2000
|
readonly rubric: string;
|
|
@@ -1850,7 +2011,7 @@ type JudgeLlmConfig = {
|
|
|
1850
2011
|
* caller-supplied model step, parse the JSON score from the reply. An
|
|
1851
2012
|
* unparseable reply makes the judge abstain rather than fail the case.
|
|
1852
2013
|
*/
|
|
1853
|
-
declare function judge_llm<I, O>(config: JudgeLlmConfig): Judge<I, O>;
|
|
2014
|
+
export declare function judge_llm<I, O>(config: JudgeLlmConfig): Judge<I, O>;
|
|
1854
2015
|
//#endregion
|
|
1855
2016
|
//#region src/composites/regression.d.ts
|
|
1856
2017
|
type RegressionDelta = {
|
|
@@ -1885,18 +2046,18 @@ type RegressionCompareOptions = {
|
|
|
1885
2046
|
* `score_threshold` (default 0); cost regresses on a relative increase above
|
|
1886
2047
|
* `cost_threshold` (default 10%).
|
|
1887
2048
|
*/
|
|
1888
|
-
declare function regression_compare(current: BenchReport, baseline: BenchReport, options?: RegressionCompareOptions): RegressionReport;
|
|
2049
|
+
export declare function regression_compare(current: BenchReport, baseline: BenchReport, options?: RegressionCompareOptions): RegressionReport;
|
|
1889
2050
|
/**
|
|
1890
2051
|
* Read and validate a baseline `BenchReport` from a JSON file.
|
|
1891
2052
|
*
|
|
1892
2053
|
* Validation is structural (required fields present), so a hand-edited or
|
|
1893
2054
|
* truncated baseline fails loudly with the offending path in the message.
|
|
1894
2055
|
*/
|
|
1895
|
-
declare function read_baseline(path: string): Promise<BenchReport>;
|
|
2056
|
+
export declare function read_baseline(path: string): Promise<BenchReport>;
|
|
1896
2057
|
/**
|
|
1897
2058
|
* Write a `BenchReport` as pretty-printed JSON, creating parent directories.
|
|
1898
2059
|
*/
|
|
1899
|
-
declare function write_baseline(path: string, report: BenchReport): Promise<void>;
|
|
2060
|
+
export declare function write_baseline(path: string, report: BenchReport): Promise<void>;
|
|
1900
2061
|
//#endregion
|
|
1901
2062
|
//#region src/model_call.d.ts
|
|
1902
2063
|
type ModelCallInput = string | ReadonlyArray<Message>;
|
|
@@ -1919,7 +2080,8 @@ type ModelCallConfig<T = string, projected = GenerateResult<T>> = {
|
|
|
1919
2080
|
* the step is anonymous, like `step(fn)`: `describe.diagram` labels it by
|
|
1920
2081
|
* its kind, and `checkpoint` and `gate` reject it.
|
|
1921
2082
|
*/
|
|
1922
|
-
readonly id?: string;
|
|
2083
|
+
readonly id?: string;
|
|
2084
|
+
/** What this model boundary is for, carried to `describe` as `meta.description`. */
|
|
1923
2085
|
readonly description?: string;
|
|
1924
2086
|
readonly system?: string;
|
|
1925
2087
|
readonly tools?: ReadonlyArray<Tool>;
|
|
@@ -1974,7 +2136,7 @@ type ModelCallConfig<T = string, projected = GenerateResult<T>> = {
|
|
|
1974
2136
|
* maps the `GenerateResult` envelope into the step's output inside the same
|
|
1975
2137
|
* step; omitted, the envelope is the output.
|
|
1976
2138
|
*/
|
|
1977
|
-
declare function model_call<T = string, projected = GenerateResult<T>>(cfg: ModelCallConfig<T, projected>): Step<ModelCallInput, projected>;
|
|
2139
|
+
export declare function model_call<T = string, projected = GenerateResult<T>>(cfg: ModelCallConfig<T, projected>): Step<ModelCallInput, projected>;
|
|
1978
2140
|
/**
|
|
1979
2141
|
* model_step: `model_call` projected to its content.
|
|
1980
2142
|
*
|
|
@@ -1991,7 +2153,7 @@ declare function model_call<T = string, projected = GenerateResult<T>>(cfg: Mode
|
|
|
1991
2153
|
* primitive into an app-shaped helper of your own is still the extension
|
|
1992
2154
|
* pattern; this is its smallest instance.
|
|
1993
2155
|
*/
|
|
1994
|
-
declare function model_step<T = string>(cfg: Omit<ModelCallConfig<T>, 'project'>): Step<ModelCallInput, T>;
|
|
2156
|
+
export declare function model_step<T = string>(cfg: Omit<ModelCallConfig<T>, 'project'>): Step<ModelCallInput, T>;
|
|
1995
2157
|
//#endregion
|
|
1996
2158
|
//#region src/forward_standard_env.d.ts
|
|
1997
2159
|
/**
|
|
@@ -2005,7 +2167,7 @@ declare function model_step<T = string>(cfg: Omit<ModelCallConfig<T>, 'project'>
|
|
|
2005
2167
|
* claude_cli: { env: forward_standard_env() },
|
|
2006
2168
|
* }
|
|
2007
2169
|
*/
|
|
2008
|
-
declare function forward_standard_env(): Record<string, string>;
|
|
2170
|
+
export declare function forward_standard_env(): Record<string, string>;
|
|
2009
2171
|
//#endregion
|
|
2010
|
-
export { type AdversarialBuildInput, type AdversarialConfig, type AdversarialCritiqueResult, type AdversarialResult, type AiSdkProviderAdapter, type AiSdkTelemetrySettings, type AnySchema, type AnyStep, type AssistantContentPart, type BenchCase, type BenchOptions, type BenchReport, type BenchSummary, type BracketRecord, type BranchConfig, type Candidate, type CaseResult, type Chain, type ChainOpen, type ChainStepOptions, type CheckpointConfig, type CheckpointEvent, type CheckpointStatus, type CheckpointStore, type ClaudeCliErrorReason, type ClaudeCliProviderReported, type CleanupFn, type ComposeConfig, type ConsensusConfig, type ConsensusResult, type CostBreakdown, type CustomTrajectoryEvent, type DescribeOptions, type DiagramOptions, type EffortLevel, type EffortTranslation, type EmitEvent, type Engine, type EngineConfig, type EngineDefaults, type EnsembleConfig, type EnsembleResult, type EnsembleStepConfig, type EnsembleStepResult, type ExternalAgentAdapter, type FallbackOptions, type FallbackOutcome, type FallbackProjection, type FinishReason, type FlowNode, type FlowValue, type GateConfig, type GenerateOptions, type GenerateResult, type GenerateTiming, type HistoryEntry, type ImproveBudget, type ImproveConfig, type ImproveResult, type ImproveRoundInput, type Improvement, type Judge, type JudgeArgs, type JudgeLlmConfig, type JudgeWithFn, type LearnConfig, type LearnInput, type LearnResult, type Lesson, type LoopConfig, type LoopGuardPredicate, type LoopGuardResult, type LoopOutcome, type MapConfig, type Message, type ModelCallConfig, type ModelCallInput, type NativeProviderAdapter, type ParallelOptions, type ParsedTrajectoryEvent, type PerCaseDelta, type PipeOptions, type PrepareStepContext, type PrepareStepHook, type PrepareStepResult, type Pricing, type PricingTable, type ProviderAdapter, type ProviderCapability, type ProviderConfigMap, type ProviderFactory, type ProviderInit, type ProviderTransport, type RawProviderUsage, type RegressionCompareOptions, type RegressionDelta, type RegressionReport, type ResolvedModel, type RetryConfig, type RetryFailureKind, type RetryOutcome, type RetryPolicy, type RetryProjection, type RunContext, type RunEndEvent, type RunEndStatus, type RunOptions, type RunOutcome,
|
|
2172
|
+
export { type AdversarialBuildInput, type AdversarialConfig, type AdversarialCritiqueResult, type AdversarialResult, type AiSdkProviderAdapter, type AiSdkTelemetrySettings, type AnySchema, type AnyStep, type AssistantContentPart, type BenchCase, type BenchOptions, type BenchReport, type BenchSummary, type BracketRecord, type BranchConfig, type Candidate, type CaseResult, type Chain, type ChainOpen, type ChainStepOptions, type CheckpointConfig, type CheckpointEvent, type CheckpointStatus, type CheckpointStore, type ClaudeCliErrorReason, type ClaudeCliProviderReported, type CleanupFn, type ComposeConfig, type ConsensusConfig, type ConsensusResult, type CostBreakdown, type CustomTrajectoryEvent, type DescribeOptions, type DiagramOptions, type DurableConfig, type DurableOutcome, type DurableRunOptions, type DurableRunState, type DurableRuns, type DurableStore, type EffortLevel, type EffortTranslation, type EmitEvent, type Engine, type EngineConfig, type EngineDefaults, type EnsembleConfig, type EnsembleResult, type EnsembleStepConfig, type EnsembleStepResult, type ExternalAgentAdapter, type FallbackOptions, type FallbackOutcome, type FallbackProjection, type FinishReason, type FlowNode, type FlowValue, type GateConfig, type GenerateOptions, type GenerateResult, type GenerateTiming, type HistoryEntry, type ImproveBudget, type ImproveConfig, type ImproveResult, type ImproveRoundInput, type Improvement, type Judge, type JudgeArgs, type JudgeLlmConfig, type JudgeWithFn, type LearnConfig, type LearnInput, type LearnResult, type Lesson, type LoopConfig, type LoopGuardPredicate, type LoopGuardResult, type LoopOutcome, type MapConfig, type MapItemFailedEvent, type MapSettleConfig, type Message, type ModelCallConfig, type ModelCallInput, type NativeProviderAdapter, type ParallelOptions, type ParsedTrajectoryEvent, type PerCaseDelta, type PipeOptions, type PrepareStepContext, type PrepareStepHook, type PrepareStepResult, type Pricing, type PricingTable, type ProviderAdapter, type ProviderCapability, type ProviderConfigMap, type ProviderFactory, type ProviderInit, type ProviderTransport, type RawProviderUsage, type RegressionCompareOptions, type RegressionDelta, type RegressionReport, type ReplayHint, type ResolvedModel, type RetryConfig, type RetryFailureKind, type RetryOutcome, type RetryPolicy, type RetryProjection, type RunContext, type RunEndEvent, type RunEndStatus, type RunOptions, type RunOutcome, type SchemaIssue, type ScopeOptions, type ScopedCheckpointStore, type Score, type ScoredCandidate, type SequenceOptions, type Settled, type SettledError, type SpanEndEvent, type SpanStartEvent, type StashOptions, type Step, type StepFn, type StepInput, type StepKind, type StepMetadata, type StepOptions, type StepOutput, type StepRecord, type StepReplayedEvent, type StepTiming, type StreamChunk, type StreamingRunHandle, type SuspendConfig, type Throughput, type TimeoutOptions, type Tool, type ToolApprovalHandler, type ToolApprovalRequest, type ToolCallRecord, type ToolExecContext, type ToolSchema, type TournamentConfig, type TournamentResult, type TrajectoryEvent, type TrajectoryLogger, type TrajectoryParseResult, type TrajectorySource, type TurnRequest, type TurnResult, type UsageTotals, type UseOptions, type UserContentPart, default_normalize_usage, __json_default_export as flow_schema, is_checkpoint_event, is_custom_trajectory_event, is_emit_event, is_map_item_failed_event, is_run_end_event, is_span_end_event, is_span_start_event, is_step_replayed_event, parse_trajectory_event };
|
|
2011
2173
|
//# sourceMappingURL=index.d.ts.map
|