fascicle 0.12.10 → 0.12.12
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 +30 -0
- package/dist/adapters.d.ts +1 -1
- package/dist/agents.d.ts +2 -2
- package/dist/agents.js +1 -1
- package/dist/bin/fascicle-diagram.js +9 -0
- package/dist/{core-BClsJ3h0.js → core-BVCVUMmH.js} +332 -65
- package/dist/core-BVCVUMmH.js.map +1 -0
- package/dist/diagram_bin.d.ts +25 -0
- package/dist/diagram_bin.js +239 -0
- package/dist/diagram_bin.js.map +1 -0
- package/dist/{engine-DKv8YxWJ.js → engine-Ct4LBzb9.js} +4 -4
- package/dist/{engine-DKv8YxWJ.js.map → engine-Ct4LBzb9.js.map} +1 -1
- package/dist/index.d.ts +56 -32
- package/dist/index.js +48 -53
- package/dist/index.js.map +1 -1
- package/dist/{invoke-Bt7AD944.js → invoke-BcPDqE5C.js} +15 -10
- package/dist/invoke-BcPDqE5C.js.map +1 -0
- package/dist/{leading_system-B6hsYN90.js → leading_system-CfOIc5fi.js} +2 -2
- package/dist/{leading_system-B6hsYN90.js.map → leading_system-CfOIc5fi.js.map} +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/otel.d.ts +1 -1
- package/dist/stdio.d.ts +1 -1
- package/dist/stdio.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -3
- package/dist/{types-DBpU27sQ.d.ts → types-BasW4Wwb.d.ts} +43 -2
- package/dist/{types-Dp-tNZPY.d.ts → types-bEpfDrys.d.ts} +12 -2
- package/dist/ui.d.ts +1 -1
- package/dist/viewer.js +1 -1
- package/package.json +4 -2
- package/dist/core-BClsJ3h0.js.map +0 -1
- package/dist/invoke-Bt7AD944.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as FlowValue, c as StepFn, d as StepOptions, f as StepOutput, i as FlowNode, l as StepInput, m as TrajectoryLogger, n as CheckpointStore, o as RunContext, p as TrajectoryEvent, r as CleanupFn, s as Step, t as AnyStep, u as StepMetadata } from "./types-BasW4Wwb.js";
|
|
2
2
|
import { n as SchemaIssue, r as ToolSchema, t as AnySchema } from "./types-BK0UW28o.js";
|
|
3
3
|
import { _ as parse_trajectory_event, a as ParsedTrajectoryEvent, c as SpanEndEvent, d as is_checkpoint_event, f as is_custom_trajectory_event, g as is_span_start_event, h as is_span_end_event, i as EmitEvent, l as SpanStartEvent, m as is_run_end_event, n as CheckpointStatus, o as RunEndEvent, p as is_emit_event, r as CustomTrajectoryEvent, s as RunEndStatus, t as CheckpointEvent, u as TrajectoryParseResult } from "./trajectory-ByoOQZ6T.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-
|
|
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-bEpfDrys.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/flow-schema.json.d.ts
|
|
7
7
|
declare let $schema: string;
|
|
@@ -654,52 +654,46 @@ declare const run: typeof run_impl & {
|
|
|
654
654
|
/**
|
|
655
655
|
* Wrap a plain function as a `Step`, named or anonymous.
|
|
656
656
|
*
|
|
657
|
-
* The named form takes an explicit id (identity) and optional `
|
|
658
|
-
* and
|
|
659
|
-
* step so checkpoint rejects it at construction
|
|
657
|
+
* The named form takes an explicit id (identity) and optional `options`
|
|
658
|
+
* (display, description, and declared arms); the anonymous form generates a
|
|
659
|
+
* `step_<n>` id and marks the step so checkpoint rejects it at construction
|
|
660
|
+
* time. Declared arms become the step's children, which is all `describe`
|
|
661
|
+
* reads; the body alone decides whether and when they run. The rest of
|
|
662
|
+
* `options` is stored as `meta`, and left off entirely when nothing remains,
|
|
663
|
+
* so `describe` never echoes an empty object.
|
|
660
664
|
*/
|
|
661
|
-
declare function step<i, o>(id: string, fn: StepFn<i, o>,
|
|
665
|
+
declare function step<i, o>(id: string, fn: StepFn<i, o>, options?: StepOptions): Step<i, o>;
|
|
662
666
|
declare function step<i, o>(fn: StepFn<i, o>): Step<i, o>;
|
|
663
667
|
//#endregion
|
|
664
|
-
//#region src/core/
|
|
665
|
-
type
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
readonly
|
|
669
|
-
readonly name?: string;
|
|
670
|
-
} | {
|
|
671
|
-
readonly kind: '<schema>';
|
|
672
|
-
} | {
|
|
673
|
-
readonly kind: string;
|
|
674
|
-
readonly id: string;
|
|
675
|
-
};
|
|
676
|
-
type FlowNode = {
|
|
677
|
-
readonly kind: string;
|
|
678
|
-
readonly id: string;
|
|
679
|
-
readonly config?: Readonly<{
|
|
680
|
-
[key: string]: FlowValue;
|
|
681
|
-
}>;
|
|
682
|
-
readonly children?: ReadonlyArray<FlowNode>;
|
|
683
|
-
readonly meta?: StepMetadata;
|
|
668
|
+
//#region src/core/diagram.d.ts
|
|
669
|
+
type DiagramOptions = {
|
|
670
|
+
/** Throw `describe_cycle_error` on a cycle instead of drawing `<cycle>`, as `describe` does. */readonly strict?: boolean; /** Wrap descriptions so that no line runs wider than this, `prefix` included. */
|
|
671
|
+
readonly width?: number; /** Written at the start of every line, for example `' * '` for a doc comment. */
|
|
672
|
+
readonly prefix?: string;
|
|
684
673
|
};
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region src/core/describe.d.ts
|
|
685
676
|
type DescribeOptions = {
|
|
686
677
|
readonly strict?: boolean;
|
|
687
678
|
};
|
|
688
679
|
/**
|
|
689
680
|
* Public entry point: `describe(step)` for text, `describe.json(step)` for
|
|
690
|
-
* the `FlowNode` tree.
|
|
681
|
+
* the `FlowNode` tree, `describe.diagram(step)` for the annotated diagram.
|
|
691
682
|
*/
|
|
692
683
|
declare const describe: {
|
|
693
684
|
<i, o>(root: Step<i, o>, options?: DescribeOptions): string;
|
|
694
685
|
json: <i, o>(root: Step<i, o>, options?: DescribeOptions) => FlowNode;
|
|
686
|
+
diagram: <i, o>(root: Step<i, o>, options?: DiagramOptions) => string;
|
|
695
687
|
};
|
|
696
688
|
//#endregion
|
|
697
689
|
//#region src/core/display_name.d.ts
|
|
698
690
|
/**
|
|
699
691
|
* Resolve the human-readable label for `node`, falling back to `fallback`
|
|
700
692
|
* (typically the step's kind) when neither display channel is populated.
|
|
693
|
+
* It reads only `config` and `meta`, so a `describe.json` node resolves the
|
|
694
|
+
* same way as the step it was drawn from.
|
|
701
695
|
*/
|
|
702
|
-
declare function resolve_display_name(node: AnyStep, fallback: string): string;
|
|
696
|
+
declare function resolve_display_name(node: Pick<AnyStep, 'config' | 'meta'>, fallback: string): string;
|
|
703
697
|
//#endregion
|
|
704
698
|
//#region src/core/step_id.d.ts
|
|
705
699
|
/**
|
|
@@ -768,6 +762,7 @@ interface SequenceLeadingSpreadNeedsFixedFirst {
|
|
|
768
762
|
type CheckedChildren<children extends readonly unknown[]> = unknown[] extends children ? children : IsPlainArray<children> extends true ? SequenceRuntimeChildrenMustBeHomogeneous<children[number]> : number extends children['length'] ? children extends readonly [infer first, ...infer rest] ? readonly [CheckedFirst<first>, ...CheckedSpreadTail<OutputOf<first>, rest, readonly []>] : SequenceLeadingSpreadNeedsFixedFirst : children extends readonly [infer first, ...infer rest] ? readonly [CheckedFirst<first>, ...CheckedTail<children, rest>] : children;
|
|
769
763
|
type SequenceOptions = {
|
|
770
764
|
readonly name?: string;
|
|
765
|
+
readonly description?: string;
|
|
771
766
|
};
|
|
772
767
|
/**
|
|
773
768
|
* Build a step that chains children, each feeding the next.
|
|
@@ -791,6 +786,7 @@ type ParallelInput<children extends Record<string, AnyStep>> = UnionToIntersecti
|
|
|
791
786
|
type ParallelOutputs<children extends Record<string, AnyStep>> = { [k in keyof children]: StepOutput<children[k]> };
|
|
792
787
|
type ParallelOptions = {
|
|
793
788
|
readonly name?: string;
|
|
789
|
+
readonly description?: string;
|
|
794
790
|
};
|
|
795
791
|
/**
|
|
796
792
|
* Build a step that runs named children concurrently on the same input.
|
|
@@ -806,6 +802,7 @@ declare function parallel<children extends Record<string, AnyStep>>(members: chi
|
|
|
806
802
|
//#region src/core/branch.d.ts
|
|
807
803
|
type BranchConfig<i, o> = {
|
|
808
804
|
readonly name?: string;
|
|
805
|
+
readonly description?: string;
|
|
809
806
|
readonly when: (input: i) => boolean | Promise<boolean>;
|
|
810
807
|
readonly then: Step<i, o>;
|
|
811
808
|
readonly otherwise: Step<i, o>;
|
|
@@ -822,6 +819,7 @@ declare function branch<i, o>(config: BranchConfig<i, o>): Step<i, o>;
|
|
|
822
819
|
//#region src/core/map.d.ts
|
|
823
820
|
type MapConfig<input, item, result> = {
|
|
824
821
|
readonly name?: string;
|
|
822
|
+
readonly description?: string;
|
|
825
823
|
readonly items: (input: input) => ReadonlyArray<item> | Promise<ReadonlyArray<item>>;
|
|
826
824
|
readonly do: Step<item, result>;
|
|
827
825
|
readonly concurrency?: number;
|
|
@@ -838,6 +836,7 @@ declare function map<input, item, result>(config: MapConfig<input, item, result>
|
|
|
838
836
|
//#region src/core/pipe.d.ts
|
|
839
837
|
type PipeOptions = {
|
|
840
838
|
readonly name?: string;
|
|
839
|
+
readonly description?: string;
|
|
841
840
|
};
|
|
842
841
|
/**
|
|
843
842
|
* Build an output-transforming step around `inner`.
|
|
@@ -861,6 +860,7 @@ type RetryOutcome<o> = {
|
|
|
861
860
|
};
|
|
862
861
|
type RetryConfig = {
|
|
863
862
|
readonly name?: string;
|
|
863
|
+
readonly description?: string;
|
|
864
864
|
readonly max_attempts: number;
|
|
865
865
|
readonly backoff_ms?: number;
|
|
866
866
|
readonly max_delay_ms?: number;
|
|
@@ -912,6 +912,7 @@ type FallbackOutcome<o> = {
|
|
|
912
912
|
};
|
|
913
913
|
type FallbackOptions<i = unknown> = {
|
|
914
914
|
readonly name?: string;
|
|
915
|
+
readonly description?: string;
|
|
915
916
|
/**
|
|
916
917
|
* Decide whether a primary error sends the run to the backup. Returning
|
|
917
918
|
* false propagates the error untouched, the way a control-flow signal
|
|
@@ -947,6 +948,7 @@ declare function fallback<i, o, projected = o>(primary: Step<i, o>, backup: Step
|
|
|
947
948
|
//#region src/core/timeout.d.ts
|
|
948
949
|
type TimeoutOptions = {
|
|
949
950
|
readonly name?: string;
|
|
951
|
+
readonly description?: string;
|
|
950
952
|
};
|
|
951
953
|
/**
|
|
952
954
|
* Build a deadline-bounded step around `inner`.
|
|
@@ -969,6 +971,7 @@ type LoopOutcome = {
|
|
|
969
971
|
};
|
|
970
972
|
type LoopConfig<i, state, o> = {
|
|
971
973
|
readonly name?: string;
|
|
974
|
+
readonly description?: string;
|
|
972
975
|
readonly init: (input: i) => state;
|
|
973
976
|
readonly body: Step<state, state>;
|
|
974
977
|
readonly guard?: Step<state, LoopGuardResult<state>> | LoopGuardPredicate<state>;
|
|
@@ -989,6 +992,7 @@ declare function loop<i, state, o>(config: LoopConfig<i, state, o>): Step<i, o>;
|
|
|
989
992
|
//#region src/core/compose.d.ts
|
|
990
993
|
type ComposeConfig = {
|
|
991
994
|
readonly name: string;
|
|
995
|
+
readonly description?: string | undefined;
|
|
992
996
|
};
|
|
993
997
|
/**
|
|
994
998
|
* Wrap `inner` in a named composite step.
|
|
@@ -1002,6 +1006,7 @@ declare function compose<i, o>(inner: Step<i, o>, config: ComposeConfig): Step<i
|
|
|
1002
1006
|
//#region src/core/checkpoint.d.ts
|
|
1003
1007
|
type CheckpointConfig<i> = {
|
|
1004
1008
|
readonly name?: string;
|
|
1009
|
+
readonly description?: string;
|
|
1005
1010
|
readonly key: string | ((input: i) => string);
|
|
1006
1011
|
};
|
|
1007
1012
|
/**
|
|
@@ -1019,6 +1024,7 @@ declare function checkpoint<i, o>(inner: Step<i, o>, config: CheckpointConfig<i>
|
|
|
1019
1024
|
type SuspendConfig<i, o, resume> = {
|
|
1020
1025
|
readonly id: string;
|
|
1021
1026
|
readonly name?: string;
|
|
1027
|
+
readonly description?: string;
|
|
1022
1028
|
readonly on: (input: i, ctx: RunContext) => Promise<void> | void;
|
|
1023
1029
|
readonly resume_schema: AnySchema<resume>;
|
|
1024
1030
|
readonly combine: (input: i, resume: resume, ctx: RunContext) => Promise<o> | o | Step<i, o>;
|
|
@@ -1037,12 +1043,15 @@ declare function suspend<i, o, resume>(config: SuspendConfig<i, o, resume>): Ste
|
|
|
1037
1043
|
type LastOutput<children> = children extends readonly [...unknown[], Step<never, infer o>] ? o : children extends readonly [Step<never, infer o>] ? o : unknown;
|
|
1038
1044
|
type ScopeOptions = {
|
|
1039
1045
|
readonly name?: string;
|
|
1046
|
+
readonly description?: string;
|
|
1040
1047
|
};
|
|
1041
1048
|
type StashOptions = {
|
|
1042
1049
|
readonly name?: string;
|
|
1050
|
+
readonly description?: string;
|
|
1043
1051
|
};
|
|
1044
1052
|
type UseOptions = {
|
|
1045
1053
|
readonly name?: string;
|
|
1054
|
+
readonly description?: string;
|
|
1046
1055
|
};
|
|
1047
1056
|
/**
|
|
1048
1057
|
* Build a step that runs children in sequence under a fresh state map.
|
|
@@ -1070,13 +1079,14 @@ declare function use<const keys extends readonly string[], i, o>(keys: keys, fn:
|
|
|
1070
1079
|
//#region src/core/chain.d.ts
|
|
1071
1080
|
type merge<a, b> = { readonly [k in keyof (a & b)]: (a & b)[k] };
|
|
1072
1081
|
type ChainStepOptions = {
|
|
1073
|
-
readonly arm?: AnyStep
|
|
1082
|
+
readonly arm?: AnyStep | ReadonlyArray<AnyStep>;
|
|
1074
1083
|
/**
|
|
1075
1084
|
* Display label for the binding's span and `describe` line. The binding
|
|
1076
1085
|
* name is a record key and so must be identifier-shaped; this is where the
|
|
1077
1086
|
* free prose goes, exactly as `meta.name` does for a plain `step`.
|
|
1078
1087
|
*/
|
|
1079
|
-
readonly name?: string;
|
|
1088
|
+
readonly name?: string; /** What the binding is for, carried to `describe` as `meta.description`. */
|
|
1089
|
+
readonly description?: string;
|
|
1080
1090
|
};
|
|
1081
1091
|
type Chain<i, acc> = {
|
|
1082
1092
|
readonly step: {
|
|
@@ -1409,6 +1419,7 @@ type AdversarialResult<candidate> = {
|
|
|
1409
1419
|
};
|
|
1410
1420
|
type AdversarialConfig<input, candidate, projected = AdversarialResult<candidate>> = {
|
|
1411
1421
|
readonly name?: string;
|
|
1422
|
+
readonly description?: string;
|
|
1412
1423
|
readonly build: Step<AdversarialBuildInput<input, candidate>, candidate>;
|
|
1413
1424
|
readonly critique: Step<candidate, AdversarialCritiqueResult>;
|
|
1414
1425
|
readonly accept: (critique_result: AdversarialCritiqueResult) => boolean;
|
|
@@ -1436,6 +1447,7 @@ declare function adversarial<input, candidate, projected = AdversarialResult<can
|
|
|
1436
1447
|
//#region src/composites/consensus.d.ts
|
|
1437
1448
|
type ConsensusConfig<i, o, projected = ConsensusResult<o>> = {
|
|
1438
1449
|
readonly name?: string;
|
|
1450
|
+
readonly description?: string;
|
|
1439
1451
|
readonly members: Record<string, Step<i, o>>;
|
|
1440
1452
|
readonly agree: (results: Record<string, o>) => boolean;
|
|
1441
1453
|
readonly max_rounds: number;
|
|
@@ -1464,6 +1476,7 @@ declare function consensus<i, o, projected = ConsensusResult<o>>(config: Consens
|
|
|
1464
1476
|
//#region src/composites/ensemble.d.ts
|
|
1465
1477
|
type EnsembleConfig<i, o, projected = EnsembleResult<o>> = {
|
|
1466
1478
|
readonly name?: string;
|
|
1479
|
+
readonly description?: string;
|
|
1467
1480
|
readonly members: Record<string, Step<i, o>>;
|
|
1468
1481
|
readonly score: (result: o, member_id: string) => number | Promise<number>;
|
|
1469
1482
|
readonly select?: 'max' | 'min';
|
|
@@ -1492,6 +1505,7 @@ declare function ensemble<i, o, projected = EnsembleResult<o>>(config: EnsembleC
|
|
|
1492
1505
|
//#region src/composites/ensemble_step.d.ts
|
|
1493
1506
|
type EnsembleStepConfig<i, o, ranked, projected = EnsembleStepResult<o, ranked>> = {
|
|
1494
1507
|
readonly name?: string;
|
|
1508
|
+
readonly description?: string;
|
|
1495
1509
|
readonly members: Record<string, Step<i, o>>;
|
|
1496
1510
|
readonly score: Step<o, ranked>;
|
|
1497
1511
|
readonly rank_by: (r: ranked) => number;
|
|
@@ -1531,6 +1545,7 @@ declare function ensemble_step<i, o, ranked, projected = EnsembleStepResult<o, r
|
|
|
1531
1545
|
type GateConfig<o> = {
|
|
1532
1546
|
readonly id: string;
|
|
1533
1547
|
readonly name?: string;
|
|
1548
|
+
readonly description?: string;
|
|
1534
1549
|
readonly store?: CheckpointStore;
|
|
1535
1550
|
readonly format?: (result: o) => unknown;
|
|
1536
1551
|
};
|
|
@@ -1581,6 +1596,7 @@ type ImproveBudget = {
|
|
|
1581
1596
|
};
|
|
1582
1597
|
type ImproveConfig<i, c, projected = ImproveResult<c>> = {
|
|
1583
1598
|
readonly name?: string;
|
|
1599
|
+
readonly description?: string;
|
|
1584
1600
|
readonly seed: Step<i, {
|
|
1585
1601
|
readonly content: c;
|
|
1586
1602
|
readonly score: number;
|
|
@@ -1652,6 +1668,7 @@ type Improvement = {
|
|
|
1652
1668
|
};
|
|
1653
1669
|
type LearnConfig<i extends LearnInput, o> = {
|
|
1654
1670
|
readonly name?: string;
|
|
1671
|
+
readonly description?: string;
|
|
1655
1672
|
readonly flow: AnyStep;
|
|
1656
1673
|
readonly source: TrajectorySource;
|
|
1657
1674
|
readonly analyzer: Step<i, o>;
|
|
@@ -1682,6 +1699,7 @@ type BracketRecord = {
|
|
|
1682
1699
|
};
|
|
1683
1700
|
type TournamentConfig<i, o, projected = TournamentResult<o>> = {
|
|
1684
1701
|
readonly name?: string;
|
|
1702
|
+
readonly description?: string;
|
|
1685
1703
|
readonly members: Record<string, Step<i, o>>;
|
|
1686
1704
|
readonly compare: (a: o, b: o) => Promise<'a' | 'b'> | 'a' | 'b';
|
|
1687
1705
|
readonly project?: (r: TournamentResult<o>) => projected;
|
|
@@ -1896,7 +1914,13 @@ type ModelCallConfig<T = string, projected = GenerateResult<T>> = {
|
|
|
1896
1914
|
* configured provider) is used.
|
|
1897
1915
|
*/
|
|
1898
1916
|
readonly provider?: string;
|
|
1899
|
-
|
|
1917
|
+
/**
|
|
1918
|
+
* The step's id. Omitted, one is generated (`model_call_<hash>_<n>`) and
|
|
1919
|
+
* the step is anonymous, like `step(fn)`: `describe.diagram` labels it by
|
|
1920
|
+
* its kind, and `checkpoint` and `gate` reject it.
|
|
1921
|
+
*/
|
|
1922
|
+
readonly id?: string; /** What this model boundary is for, carried to `describe` as `meta.description`. */
|
|
1923
|
+
readonly description?: string;
|
|
1900
1924
|
readonly system?: string;
|
|
1901
1925
|
readonly tools?: ReadonlyArray<Tool>;
|
|
1902
1926
|
readonly schema?: ToolSchema<T>;
|
|
@@ -1983,5 +2007,5 @@ declare function model_step<T = string>(cfg: Omit<ModelCallConfig<T>, 'project'>
|
|
|
1983
2007
|
*/
|
|
1984
2008
|
declare function forward_standard_env(): Record<string, string>;
|
|
1985
2009
|
//#endregion
|
|
1986
|
-
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 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, STEP_KINDS, type SchemaIssue, type ScopeOptions, type Score, type ScoredCandidate, type SequenceOptions, type SpanEndEvent, type SpanStartEvent, type StashOptions, type Step, type StepFn, type StepInput, type StepKind, type StepMetadata, type StepOutput, type StepRecord, 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, aborted_error, adversarial, assert_valid_step_id, bench, bench_suspend_error, branch, chain, checkpoint, claude_cli_error, claude_cli_reported, compose, consensus, create_engine, default_normalize_usage, describe, describe_cycle_error, engine_config_error, engine_disposed_error, ensemble, ensemble_step, error_path, fallback, __json_default_export as flow_schema, forward_standard_env, gate, improve, incomplete_generation_error, is_checkpoint_event, is_custom_trajectory_event, is_emit_event, is_run_end_event, is_span_end_event, is_span_start_event, is_step, is_step_kind, is_valid_step_id, judge_equals, judge_llm, judge_with, learn, loop, map, model_call, model_required_error, model_step, normalize_score, on_chunk_error, parallel, parse_trajectory_event, pipe, provider_auth_error, provider_capability_error, provider_error, provider_not_configured_error, provider_required_error, rate_limit_error, read_baseline, regression_compare, resolve_display_name, resume_validation_error, retry, run, schema_validation_error, scope, sequence, stash, step, suggest_step_id, suspend, suspended_error, throughput, timeout, timeout_error, tool_approval_denied_error, tool_error, tournament, use, write_baseline };
|
|
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, STEP_KINDS, type SchemaIssue, type ScopeOptions, type Score, type ScoredCandidate, type SequenceOptions, type SpanEndEvent, type SpanStartEvent, type StashOptions, type Step, type StepFn, type StepInput, type StepKind, type StepMetadata, type StepOptions, type StepOutput, type StepRecord, 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, aborted_error, adversarial, assert_valid_step_id, bench, bench_suspend_error, branch, chain, checkpoint, claude_cli_error, claude_cli_reported, compose, consensus, create_engine, default_normalize_usage, describe, describe_cycle_error, engine_config_error, engine_disposed_error, ensemble, ensemble_step, error_path, fallback, __json_default_export as flow_schema, forward_standard_env, gate, improve, incomplete_generation_error, is_checkpoint_event, is_custom_trajectory_event, is_emit_event, is_run_end_event, is_span_end_event, is_span_start_event, is_step, is_step_kind, is_valid_step_id, judge_equals, judge_llm, judge_with, learn, loop, map, model_call, model_required_error, model_step, normalize_score, on_chunk_error, parallel, parse_trajectory_event, pipe, provider_auth_error, provider_capability_error, provider_error, provider_not_configured_error, provider_required_error, rate_limit_error, read_baseline, regression_compare, resolve_display_name, resume_validation_error, retry, run, schema_validation_error, scope, sequence, stash, step, suggest_step_id, suspend, suspended_error, throughput, timeout, timeout_error, tool_approval_denied_error, tool_error, tournament, use, write_baseline };
|
|
1987
2011
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as create_engine } from "./engine-
|
|
1
|
+
import { A as error_path, C as is_valid_step_id, D as is_step, E as describe, F as is_step_kind, I as resolve_display_name, M as suspended_error, N as timeout_error, O as aborted_error, P as STEP_KINDS, S as assert_valid_step_id, T as run, _ as map, a as suspend, b as sequence, c as checkpoint, d as timeout, f as fallback, g as pipe, i as use, j as resume_validation_error, k as describe_cycle_error, l as compose, n as scope, p as retry, r as stash, t as chain, u as loop, v as branch, w as suggest_step_id, x as step, y as parallel } from "./core-BVCVUMmH.js";
|
|
2
|
+
import { t as create_engine } from "./engine-Ct4LBzb9.js";
|
|
3
3
|
import { a as is_span_end_event, i as is_run_end_event, n as is_custom_trajectory_event, o as is_span_start_event, r as is_emit_event, s as parse_trajectory_event, t as is_checkpoint_event } from "./trajectory-D1eq9eue.js";
|
|
4
4
|
import { a as http_logger, n as tee_logger, o as filesystem_logger } from "./adapters-CutexJd3.js";
|
|
5
|
-
import { _ as provider_required_error, b as tool_approval_denied_error, c as engine_config_error, d as model_required_error, f as on_chunk_error, g as provider_not_configured_error, h as provider_error, l as engine_disposed_error, m as provider_capability_error, n as default_normalize_usage, p as provider_auth_error, s as claude_cli_error, u as incomplete_generation_error, v as rate_limit_error, x as tool_error, y as schema_validation_error } from "./leading_system-
|
|
5
|
+
import { _ as provider_required_error, b as tool_approval_denied_error, c as engine_config_error, d as model_required_error, f as on_chunk_error, g as provider_not_configured_error, h as provider_error, l as engine_disposed_error, m as provider_capability_error, n as default_normalize_usage, p as provider_auth_error, s as claude_cli_error, u as incomplete_generation_error, v as rate_limit_error, x as tool_error, y as schema_validation_error } from "./leading_system-CfOIc5fi.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
@@ -324,47 +324,6 @@ var flow_schema_default = {
|
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
326
|
//#endregion
|
|
327
|
-
//#region src/core/step_kinds.ts
|
|
328
|
-
/**
|
|
329
|
-
* Closed registry of every `Step.kind` produced by the composition layer.
|
|
330
|
-
*
|
|
331
|
-
* Studio (and any other consumer that needs to enumerate primitives: palette,
|
|
332
|
-
* docs, code generation) can rely on this being the exhaustive set. New
|
|
333
|
-
* primitives must add their kind here. `step_kinds.test.ts` pins the list
|
|
334
|
-
* against the kinds core actually constructs, and
|
|
335
|
-
* `composites/__tests__/coverage.test.ts` covers the four composite kinds
|
|
336
|
-
* whose factories live outside core.
|
|
337
|
-
*/
|
|
338
|
-
const STEP_KINDS = [
|
|
339
|
-
"step",
|
|
340
|
-
"sequence",
|
|
341
|
-
"parallel",
|
|
342
|
-
"branch",
|
|
343
|
-
"map",
|
|
344
|
-
"pipe",
|
|
345
|
-
"retry",
|
|
346
|
-
"fallback",
|
|
347
|
-
"timeout",
|
|
348
|
-
"loop",
|
|
349
|
-
"compose",
|
|
350
|
-
"adversarial",
|
|
351
|
-
"ensemble",
|
|
352
|
-
"tournament",
|
|
353
|
-
"consensus",
|
|
354
|
-
"checkpoint",
|
|
355
|
-
"suspend",
|
|
356
|
-
"scope",
|
|
357
|
-
"stash",
|
|
358
|
-
"use",
|
|
359
|
-
"chain"
|
|
360
|
-
];
|
|
361
|
-
/**
|
|
362
|
-
* Check whether a value is one of the registered `Step.kind` strings.
|
|
363
|
-
*/
|
|
364
|
-
function is_step_kind(value) {
|
|
365
|
-
return typeof value === "string" && STEP_KINDS.includes(value);
|
|
366
|
-
}
|
|
367
|
-
//#endregion
|
|
368
327
|
//#region src/composites/adversarial.ts
|
|
369
328
|
/**
|
|
370
329
|
* adversarial: build-and-critique loop.
|
|
@@ -451,7 +410,10 @@ function adversarial(config) {
|
|
|
451
410
|
});
|
|
452
411
|
},
|
|
453
412
|
max_rounds
|
|
454
|
-
}), {
|
|
413
|
+
}), {
|
|
414
|
+
name: config.name ?? "adversarial",
|
|
415
|
+
description: config.description
|
|
416
|
+
});
|
|
455
417
|
}
|
|
456
418
|
//#endregion
|
|
457
419
|
//#region src/composites/consensus.ts
|
|
@@ -501,7 +463,10 @@ function consensus(config) {
|
|
|
501
463
|
converged
|
|
502
464
|
}),
|
|
503
465
|
max_rounds
|
|
504
|
-
}), {
|
|
466
|
+
}), {
|
|
467
|
+
name: config.name ?? "consensus",
|
|
468
|
+
description: config.description
|
|
469
|
+
});
|
|
505
470
|
}
|
|
506
471
|
//#endregion
|
|
507
472
|
//#region src/composites/ensemble.ts
|
|
@@ -556,7 +521,10 @@ function ensemble(config) {
|
|
|
556
521
|
winner,
|
|
557
522
|
scores
|
|
558
523
|
});
|
|
559
|
-
})]), {
|
|
524
|
+
})]), {
|
|
525
|
+
name: config.name ?? "ensemble",
|
|
526
|
+
description: config.description
|
|
527
|
+
});
|
|
560
528
|
}
|
|
561
529
|
//#endregion
|
|
562
530
|
//#region src/composites/ensemble_step.ts
|
|
@@ -646,7 +614,10 @@ function ensemble_step(config) {
|
|
|
646
614
|
to_pairs,
|
|
647
615
|
score_each,
|
|
648
616
|
pick
|
|
649
|
-
]), {
|
|
617
|
+
]), {
|
|
618
|
+
name: config.name ?? "ensemble_step",
|
|
619
|
+
description: config.description
|
|
620
|
+
});
|
|
650
621
|
}
|
|
651
622
|
//#endregion
|
|
652
623
|
//#region src/composites/gate.ts
|
|
@@ -746,7 +717,10 @@ function gate(inner, config) {
|
|
|
746
717
|
stash("result", persisted),
|
|
747
718
|
step("project_payload", (result) => format === void 0 ? result : format(result)),
|
|
748
719
|
approval
|
|
749
|
-
]), {
|
|
720
|
+
]), {
|
|
721
|
+
name: config.name ?? "gate",
|
|
722
|
+
description: config.description
|
|
723
|
+
});
|
|
750
724
|
}
|
|
751
725
|
//#endregion
|
|
752
726
|
//#region src/composites/improve.ts
|
|
@@ -927,7 +901,10 @@ function improve(config) {
|
|
|
927
901
|
});
|
|
928
902
|
return project(result);
|
|
929
903
|
})
|
|
930
|
-
]), {
|
|
904
|
+
]), {
|
|
905
|
+
name: config.name ?? "improve",
|
|
906
|
+
description: config.description
|
|
907
|
+
});
|
|
931
908
|
}
|
|
932
909
|
//#endregion
|
|
933
910
|
//#region src/composites/learn.ts
|
|
@@ -1099,7 +1076,10 @@ function learn(config) {
|
|
|
1099
1076
|
build_input,
|
|
1100
1077
|
analyzer,
|
|
1101
1078
|
wrap_result
|
|
1102
|
-
]), {
|
|
1079
|
+
]), {
|
|
1080
|
+
name: config.name ?? "learn",
|
|
1081
|
+
description: config.description
|
|
1082
|
+
});
|
|
1103
1083
|
}
|
|
1104
1084
|
//#endregion
|
|
1105
1085
|
//#region src/composites/tournament.ts
|
|
@@ -1142,7 +1122,10 @@ function tournament(config) {
|
|
|
1142
1122
|
winner: winner_of(current, results),
|
|
1143
1123
|
bracket
|
|
1144
1124
|
});
|
|
1145
|
-
})]), {
|
|
1125
|
+
})]), {
|
|
1126
|
+
name: config.name ?? "tournament",
|
|
1127
|
+
description: config.description
|
|
1128
|
+
});
|
|
1146
1129
|
}
|
|
1147
1130
|
/**
|
|
1148
1131
|
* Plays one bracket round: pairs survivors two at a time, comparing each pair
|
|
@@ -2043,6 +2026,17 @@ function assign_if_present(target, key, value) {
|
|
|
2043
2026
|
if (value !== void 0) target[key] = value;
|
|
2044
2027
|
}
|
|
2045
2028
|
/**
|
|
2029
|
+
* The step fields that say what a model_call is, apart from its config: it is
|
|
2030
|
+
* anonymous when its id was generated, and it carries `meta.description` when
|
|
2031
|
+
* `cfg` gives one.
|
|
2032
|
+
*/
|
|
2033
|
+
function identity_fields(cfg) {
|
|
2034
|
+
return {
|
|
2035
|
+
...cfg.id === void 0 ? { anonymous: true } : {},
|
|
2036
|
+
...cfg.description === void 0 ? {} : { meta: { description: cfg.description } }
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2046
2040
|
* Translate `cfg` into a `GenerateOptions`, folding each supplied optional field
|
|
2047
2041
|
* in via `assign_if_present`. `tools` (spread to a fresh array) and
|
|
2048
2042
|
* `retry_policy` (renamed to `retry`) are the two fields that do not copy
|
|
@@ -2140,7 +2134,8 @@ function model_call(cfg) {
|
|
|
2140
2134
|
id: inner.id,
|
|
2141
2135
|
kind: inner.kind,
|
|
2142
2136
|
run: (input, ctx) => inner.run(input, ctx),
|
|
2143
|
-
config: Object.freeze({ ...describe_config })
|
|
2137
|
+
config: Object.freeze({ ...describe_config }),
|
|
2138
|
+
...identity_fields(cfg)
|
|
2144
2139
|
};
|
|
2145
2140
|
}
|
|
2146
2141
|
/**
|