@sweny-ai/core 0.1.161 → 0.1.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +3 -1
- package/dist/browser.js +2 -0
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +7 -2
- package/dist/cli/run-history.d.ts +6 -0
- package/dist/cli/run-history.js +10 -1
- package/dist/cli/run-output.d.ts +11 -1
- package/dist/cli/run-output.js +19 -2
- package/dist/decider.d.ts +144 -0
- package/dist/decider.js +260 -0
- package/dist/executor.d.ts +7 -0
- package/dist/executor.js +115 -11
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -0
- package/dist/mermaid.js +4 -2
- package/dist/schema.d.ts +243 -38
- package/dist/schema.js +136 -3
- package/dist/studio.d.ts +2 -2
- package/dist/types.d.ts +24 -2
- package/dist/when.d.ts +114 -0
- package/dist/when.js +581 -0
- package/dist/workflows/browser.js +1 -1
- package/dist/workflows/triage.yml +15 -4
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { z } from "zod";
|
|
|
10
10
|
import type { Workflow, WorkflowType } from "./types.js";
|
|
11
11
|
import { sourceZ } from "./sources.js";
|
|
12
12
|
import { workflowInputsZ } from "./inputs.js";
|
|
13
|
+
export { isWhenExpression, whenLabel } from "./when.js";
|
|
13
14
|
export { sourceZ };
|
|
14
15
|
export { workflowInputsZ };
|
|
15
16
|
export declare const jsonSchemaZ: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -618,6 +619,7 @@ export declare const evaluatorZ: z.ZodEffects<z.ZodObject<{
|
|
|
618
619
|
}, "strict", z.ZodTypeAny, {
|
|
619
620
|
name: string;
|
|
620
621
|
kind: "function" | "value" | "judge";
|
|
622
|
+
model?: string | undefined;
|
|
621
623
|
rule?: {
|
|
622
624
|
any_tool_called?: string[] | undefined;
|
|
623
625
|
all_tools_called?: string[] | undefined;
|
|
@@ -632,10 +634,10 @@ export declare const evaluatorZ: z.ZodEffects<z.ZodObject<{
|
|
|
632
634
|
} | undefined;
|
|
633
635
|
rubric?: string | undefined;
|
|
634
636
|
pass_when?: string | undefined;
|
|
635
|
-
model?: string | undefined;
|
|
636
637
|
}, {
|
|
637
638
|
name: string;
|
|
638
639
|
kind: "function" | "value" | "judge";
|
|
640
|
+
model?: string | undefined;
|
|
639
641
|
rule?: {
|
|
640
642
|
any_tool_called?: string[] | undefined;
|
|
641
643
|
all_tools_called?: string[] | undefined;
|
|
@@ -650,10 +652,10 @@ export declare const evaluatorZ: z.ZodEffects<z.ZodObject<{
|
|
|
650
652
|
} | undefined;
|
|
651
653
|
rubric?: string | undefined;
|
|
652
654
|
pass_when?: string | undefined;
|
|
653
|
-
model?: string | undefined;
|
|
654
655
|
}>, {
|
|
655
656
|
name: string;
|
|
656
657
|
kind: "function" | "value" | "judge";
|
|
658
|
+
model?: string | undefined;
|
|
657
659
|
rule?: {
|
|
658
660
|
any_tool_called?: string[] | undefined;
|
|
659
661
|
all_tools_called?: string[] | undefined;
|
|
@@ -668,10 +670,10 @@ export declare const evaluatorZ: z.ZodEffects<z.ZodObject<{
|
|
|
668
670
|
} | undefined;
|
|
669
671
|
rubric?: string | undefined;
|
|
670
672
|
pass_when?: string | undefined;
|
|
671
|
-
model?: string | undefined;
|
|
672
673
|
}, {
|
|
673
674
|
name: string;
|
|
674
675
|
kind: "function" | "value" | "judge";
|
|
676
|
+
model?: string | undefined;
|
|
675
677
|
rule?: {
|
|
676
678
|
any_tool_called?: string[] | undefined;
|
|
677
679
|
all_tools_called?: string[] | undefined;
|
|
@@ -686,7 +688,6 @@ export declare const evaluatorZ: z.ZodEffects<z.ZodObject<{
|
|
|
686
688
|
} | undefined;
|
|
687
689
|
rubric?: string | undefined;
|
|
688
690
|
pass_when?: string | undefined;
|
|
689
|
-
model?: string | undefined;
|
|
690
691
|
}>;
|
|
691
692
|
export declare const nodeRequiresZ: z.ZodEffects<z.ZodObject<{
|
|
692
693
|
output_required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -868,6 +869,55 @@ export declare const budgetZ: z.ZodEffects<z.ZodObject<{
|
|
|
868
869
|
tokens?: number | undefined;
|
|
869
870
|
cost_usd?: number | undefined;
|
|
870
871
|
}>;
|
|
872
|
+
/**
|
|
873
|
+
* Decision model for route choices (#357). `shadow` needs a provider; the
|
|
874
|
+
* state only ever goes to that `base_url`, there is no fallback. The key is
|
|
875
|
+
* named by env var, never inlined.
|
|
876
|
+
*/
|
|
877
|
+
export declare const deciderZ: z.ZodEffects<z.ZodObject<{
|
|
878
|
+
mode: z.ZodEnum<["off", "shadow"]>;
|
|
879
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
880
|
+
base_url: z.ZodString;
|
|
881
|
+
model: z.ZodString;
|
|
882
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
883
|
+
}, "strict", z.ZodTypeAny, {
|
|
884
|
+
model: string;
|
|
885
|
+
base_url: string;
|
|
886
|
+
api_key_env?: string | undefined;
|
|
887
|
+
}, {
|
|
888
|
+
model: string;
|
|
889
|
+
base_url: string;
|
|
890
|
+
api_key_env?: string | undefined;
|
|
891
|
+
}>>;
|
|
892
|
+
}, "strict", z.ZodTypeAny, {
|
|
893
|
+
mode: "off" | "shadow";
|
|
894
|
+
provider?: {
|
|
895
|
+
model: string;
|
|
896
|
+
base_url: string;
|
|
897
|
+
api_key_env?: string | undefined;
|
|
898
|
+
} | undefined;
|
|
899
|
+
}, {
|
|
900
|
+
mode: "off" | "shadow";
|
|
901
|
+
provider?: {
|
|
902
|
+
model: string;
|
|
903
|
+
base_url: string;
|
|
904
|
+
api_key_env?: string | undefined;
|
|
905
|
+
} | undefined;
|
|
906
|
+
}>, {
|
|
907
|
+
mode: "off" | "shadow";
|
|
908
|
+
provider?: {
|
|
909
|
+
model: string;
|
|
910
|
+
base_url: string;
|
|
911
|
+
api_key_env?: string | undefined;
|
|
912
|
+
} | undefined;
|
|
913
|
+
}, {
|
|
914
|
+
mode: "off" | "shadow";
|
|
915
|
+
provider?: {
|
|
916
|
+
model: string;
|
|
917
|
+
base_url: string;
|
|
918
|
+
api_key_env?: string | undefined;
|
|
919
|
+
} | undefined;
|
|
920
|
+
}>;
|
|
871
921
|
/** One typed write intent a node may emit (#365). */
|
|
872
922
|
export declare const safeOutputDeclarationZ: z.ZodObject<{
|
|
873
923
|
type: z.ZodEnum<["comment", "issue", "pr", "label", "issue_state"]>;
|
|
@@ -1274,6 +1324,7 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1274
1324
|
}, "strict", z.ZodTypeAny, {
|
|
1275
1325
|
name: string;
|
|
1276
1326
|
kind: "function" | "value" | "judge";
|
|
1327
|
+
model?: string | undefined;
|
|
1277
1328
|
rule?: {
|
|
1278
1329
|
any_tool_called?: string[] | undefined;
|
|
1279
1330
|
all_tools_called?: string[] | undefined;
|
|
@@ -1288,10 +1339,10 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1288
1339
|
} | undefined;
|
|
1289
1340
|
rubric?: string | undefined;
|
|
1290
1341
|
pass_when?: string | undefined;
|
|
1291
|
-
model?: string | undefined;
|
|
1292
1342
|
}, {
|
|
1293
1343
|
name: string;
|
|
1294
1344
|
kind: "function" | "value" | "judge";
|
|
1345
|
+
model?: string | undefined;
|
|
1295
1346
|
rule?: {
|
|
1296
1347
|
any_tool_called?: string[] | undefined;
|
|
1297
1348
|
all_tools_called?: string[] | undefined;
|
|
@@ -1306,10 +1357,10 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1306
1357
|
} | undefined;
|
|
1307
1358
|
rubric?: string | undefined;
|
|
1308
1359
|
pass_when?: string | undefined;
|
|
1309
|
-
model?: string | undefined;
|
|
1310
1360
|
}>, {
|
|
1311
1361
|
name: string;
|
|
1312
1362
|
kind: "function" | "value" | "judge";
|
|
1363
|
+
model?: string | undefined;
|
|
1313
1364
|
rule?: {
|
|
1314
1365
|
any_tool_called?: string[] | undefined;
|
|
1315
1366
|
all_tools_called?: string[] | undefined;
|
|
@@ -1324,10 +1375,10 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1324
1375
|
} | undefined;
|
|
1325
1376
|
rubric?: string | undefined;
|
|
1326
1377
|
pass_when?: string | undefined;
|
|
1327
|
-
model?: string | undefined;
|
|
1328
1378
|
}, {
|
|
1329
1379
|
name: string;
|
|
1330
1380
|
kind: "function" | "value" | "judge";
|
|
1381
|
+
model?: string | undefined;
|
|
1331
1382
|
rule?: {
|
|
1332
1383
|
any_tool_called?: string[] | undefined;
|
|
1333
1384
|
all_tools_called?: string[] | undefined;
|
|
@@ -1342,7 +1393,6 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1342
1393
|
} | undefined;
|
|
1343
1394
|
rubric?: string | undefined;
|
|
1344
1395
|
pass_when?: string | undefined;
|
|
1345
|
-
model?: string | undefined;
|
|
1346
1396
|
}>, "many">>;
|
|
1347
1397
|
eval_policy: z.ZodOptional<z.ZodEnum<["all_pass", "any_pass", "weighted"]>>;
|
|
1348
1398
|
judge_model: z.ZodOptional<z.ZodString>;
|
|
@@ -1454,12 +1504,12 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1454
1504
|
type?: string | undefined;
|
|
1455
1505
|
};
|
|
1456
1506
|
skills: string[];
|
|
1507
|
+
model?: string | undefined;
|
|
1457
1508
|
output?: Record<string, unknown> | undefined;
|
|
1458
1509
|
tools?: {
|
|
1459
1510
|
deny?: string[] | undefined;
|
|
1460
1511
|
allow?: string[] | undefined;
|
|
1461
1512
|
} | undefined;
|
|
1462
|
-
model?: string | undefined;
|
|
1463
1513
|
on_fail?: "halt" | "continue" | undefined;
|
|
1464
1514
|
max_turns?: number | undefined;
|
|
1465
1515
|
budget?: {
|
|
@@ -1525,6 +1575,7 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1525
1575
|
eval?: {
|
|
1526
1576
|
name: string;
|
|
1527
1577
|
kind: "function" | "value" | "judge";
|
|
1578
|
+
model?: string | undefined;
|
|
1528
1579
|
rule?: {
|
|
1529
1580
|
any_tool_called?: string[] | undefined;
|
|
1530
1581
|
all_tools_called?: string[] | undefined;
|
|
@@ -1539,7 +1590,6 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1539
1590
|
} | undefined;
|
|
1540
1591
|
rubric?: string | undefined;
|
|
1541
1592
|
pass_when?: string | undefined;
|
|
1542
|
-
model?: string | undefined;
|
|
1543
1593
|
}[] | undefined;
|
|
1544
1594
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
1545
1595
|
judge_model?: string | undefined;
|
|
@@ -1571,12 +1621,12 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1571
1621
|
url: string;
|
|
1572
1622
|
type?: string | undefined;
|
|
1573
1623
|
};
|
|
1624
|
+
model?: string | undefined;
|
|
1574
1625
|
output?: Record<string, unknown> | undefined;
|
|
1575
1626
|
tools?: {
|
|
1576
1627
|
deny?: string[] | undefined;
|
|
1577
1628
|
allow?: string[] | undefined;
|
|
1578
1629
|
} | undefined;
|
|
1579
|
-
model?: string | undefined;
|
|
1580
1630
|
on_fail?: "halt" | "continue" | undefined;
|
|
1581
1631
|
skills?: string[] | undefined;
|
|
1582
1632
|
max_turns?: number | undefined;
|
|
@@ -1643,6 +1693,7 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1643
1693
|
eval?: {
|
|
1644
1694
|
name: string;
|
|
1645
1695
|
kind: "function" | "value" | "judge";
|
|
1696
|
+
model?: string | undefined;
|
|
1646
1697
|
rule?: {
|
|
1647
1698
|
any_tool_called?: string[] | undefined;
|
|
1648
1699
|
all_tools_called?: string[] | undefined;
|
|
@@ -1657,7 +1708,6 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1657
1708
|
} | undefined;
|
|
1658
1709
|
rubric?: string | undefined;
|
|
1659
1710
|
pass_when?: string | undefined;
|
|
1660
|
-
model?: string | undefined;
|
|
1661
1711
|
}[] | undefined;
|
|
1662
1712
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
1663
1713
|
judge_model?: string | undefined;
|
|
@@ -1683,17 +1733,27 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
1683
1733
|
export declare const edgeZ: z.ZodObject<{
|
|
1684
1734
|
from: z.ZodString;
|
|
1685
1735
|
to: z.ZodString;
|
|
1686
|
-
when: z.ZodOptional<z.ZodString
|
|
1736
|
+
when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1737
|
+
expr: z.ZodString;
|
|
1738
|
+
}, "strict", z.ZodTypeAny, {
|
|
1739
|
+
expr: string;
|
|
1740
|
+
}, {
|
|
1741
|
+
expr: string;
|
|
1742
|
+
}>]>>;
|
|
1687
1743
|
max_iterations: z.ZodOptional<z.ZodNumber>;
|
|
1688
1744
|
}, "strict", z.ZodTypeAny, {
|
|
1689
1745
|
from: string;
|
|
1690
1746
|
to: string;
|
|
1691
|
-
when?: string |
|
|
1747
|
+
when?: string | {
|
|
1748
|
+
expr: string;
|
|
1749
|
+
} | undefined;
|
|
1692
1750
|
max_iterations?: number | undefined;
|
|
1693
1751
|
}, {
|
|
1694
1752
|
from: string;
|
|
1695
1753
|
to: string;
|
|
1696
|
-
when?: string |
|
|
1754
|
+
when?: string | {
|
|
1755
|
+
expr: string;
|
|
1756
|
+
} | undefined;
|
|
1697
1757
|
max_iterations?: number | undefined;
|
|
1698
1758
|
}>;
|
|
1699
1759
|
/**
|
|
@@ -2057,6 +2117,7 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2057
2117
|
}, "strict", z.ZodTypeAny, {
|
|
2058
2118
|
name: string;
|
|
2059
2119
|
kind: "function" | "value" | "judge";
|
|
2120
|
+
model?: string | undefined;
|
|
2060
2121
|
rule?: {
|
|
2061
2122
|
any_tool_called?: string[] | undefined;
|
|
2062
2123
|
all_tools_called?: string[] | undefined;
|
|
@@ -2071,10 +2132,10 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2071
2132
|
} | undefined;
|
|
2072
2133
|
rubric?: string | undefined;
|
|
2073
2134
|
pass_when?: string | undefined;
|
|
2074
|
-
model?: string | undefined;
|
|
2075
2135
|
}, {
|
|
2076
2136
|
name: string;
|
|
2077
2137
|
kind: "function" | "value" | "judge";
|
|
2138
|
+
model?: string | undefined;
|
|
2078
2139
|
rule?: {
|
|
2079
2140
|
any_tool_called?: string[] | undefined;
|
|
2080
2141
|
all_tools_called?: string[] | undefined;
|
|
@@ -2089,10 +2150,10 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2089
2150
|
} | undefined;
|
|
2090
2151
|
rubric?: string | undefined;
|
|
2091
2152
|
pass_when?: string | undefined;
|
|
2092
|
-
model?: string | undefined;
|
|
2093
2153
|
}>, {
|
|
2094
2154
|
name: string;
|
|
2095
2155
|
kind: "function" | "value" | "judge";
|
|
2156
|
+
model?: string | undefined;
|
|
2096
2157
|
rule?: {
|
|
2097
2158
|
any_tool_called?: string[] | undefined;
|
|
2098
2159
|
all_tools_called?: string[] | undefined;
|
|
@@ -2107,10 +2168,10 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2107
2168
|
} | undefined;
|
|
2108
2169
|
rubric?: string | undefined;
|
|
2109
2170
|
pass_when?: string | undefined;
|
|
2110
|
-
model?: string | undefined;
|
|
2111
2171
|
}, {
|
|
2112
2172
|
name: string;
|
|
2113
2173
|
kind: "function" | "value" | "judge";
|
|
2174
|
+
model?: string | undefined;
|
|
2114
2175
|
rule?: {
|
|
2115
2176
|
any_tool_called?: string[] | undefined;
|
|
2116
2177
|
all_tools_called?: string[] | undefined;
|
|
@@ -2125,7 +2186,6 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2125
2186
|
} | undefined;
|
|
2126
2187
|
rubric?: string | undefined;
|
|
2127
2188
|
pass_when?: string | undefined;
|
|
2128
|
-
model?: string | undefined;
|
|
2129
2189
|
}>, "many">>;
|
|
2130
2190
|
eval_policy: z.ZodOptional<z.ZodEnum<["all_pass", "any_pass", "weighted"]>>;
|
|
2131
2191
|
judge_model: z.ZodOptional<z.ZodString>;
|
|
@@ -2237,12 +2297,12 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2237
2297
|
type?: string | undefined;
|
|
2238
2298
|
};
|
|
2239
2299
|
skills: string[];
|
|
2300
|
+
model?: string | undefined;
|
|
2240
2301
|
output?: Record<string, unknown> | undefined;
|
|
2241
2302
|
tools?: {
|
|
2242
2303
|
deny?: string[] | undefined;
|
|
2243
2304
|
allow?: string[] | undefined;
|
|
2244
2305
|
} | undefined;
|
|
2245
|
-
model?: string | undefined;
|
|
2246
2306
|
on_fail?: "halt" | "continue" | undefined;
|
|
2247
2307
|
max_turns?: number | undefined;
|
|
2248
2308
|
budget?: {
|
|
@@ -2308,6 +2368,7 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2308
2368
|
eval?: {
|
|
2309
2369
|
name: string;
|
|
2310
2370
|
kind: "function" | "value" | "judge";
|
|
2371
|
+
model?: string | undefined;
|
|
2311
2372
|
rule?: {
|
|
2312
2373
|
any_tool_called?: string[] | undefined;
|
|
2313
2374
|
all_tools_called?: string[] | undefined;
|
|
@@ -2322,7 +2383,6 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2322
2383
|
} | undefined;
|
|
2323
2384
|
rubric?: string | undefined;
|
|
2324
2385
|
pass_when?: string | undefined;
|
|
2325
|
-
model?: string | undefined;
|
|
2326
2386
|
}[] | undefined;
|
|
2327
2387
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
2328
2388
|
judge_model?: string | undefined;
|
|
@@ -2354,12 +2414,12 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2354
2414
|
url: string;
|
|
2355
2415
|
type?: string | undefined;
|
|
2356
2416
|
};
|
|
2417
|
+
model?: string | undefined;
|
|
2357
2418
|
output?: Record<string, unknown> | undefined;
|
|
2358
2419
|
tools?: {
|
|
2359
2420
|
deny?: string[] | undefined;
|
|
2360
2421
|
allow?: string[] | undefined;
|
|
2361
2422
|
} | undefined;
|
|
2362
|
-
model?: string | undefined;
|
|
2363
2423
|
on_fail?: "halt" | "continue" | undefined;
|
|
2364
2424
|
skills?: string[] | undefined;
|
|
2365
2425
|
max_turns?: number | undefined;
|
|
@@ -2426,6 +2486,7 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2426
2486
|
eval?: {
|
|
2427
2487
|
name: string;
|
|
2428
2488
|
kind: "function" | "value" | "judge";
|
|
2489
|
+
model?: string | undefined;
|
|
2429
2490
|
rule?: {
|
|
2430
2491
|
any_tool_called?: string[] | undefined;
|
|
2431
2492
|
all_tools_called?: string[] | undefined;
|
|
@@ -2440,7 +2501,6 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2440
2501
|
} | undefined;
|
|
2441
2502
|
rubric?: string | undefined;
|
|
2442
2503
|
pass_when?: string | undefined;
|
|
2443
|
-
model?: string | undefined;
|
|
2444
2504
|
}[] | undefined;
|
|
2445
2505
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
2446
2506
|
judge_model?: string | undefined;
|
|
@@ -2466,17 +2526,27 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2466
2526
|
edges: z.ZodArray<z.ZodObject<{
|
|
2467
2527
|
from: z.ZodString;
|
|
2468
2528
|
to: z.ZodString;
|
|
2469
|
-
when: z.ZodOptional<z.ZodString
|
|
2529
|
+
when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2530
|
+
expr: z.ZodString;
|
|
2531
|
+
}, "strict", z.ZodTypeAny, {
|
|
2532
|
+
expr: string;
|
|
2533
|
+
}, {
|
|
2534
|
+
expr: string;
|
|
2535
|
+
}>]>>;
|
|
2470
2536
|
max_iterations: z.ZodOptional<z.ZodNumber>;
|
|
2471
2537
|
}, "strict", z.ZodTypeAny, {
|
|
2472
2538
|
from: string;
|
|
2473
2539
|
to: string;
|
|
2474
|
-
when?: string |
|
|
2540
|
+
when?: string | {
|
|
2541
|
+
expr: string;
|
|
2542
|
+
} | undefined;
|
|
2475
2543
|
max_iterations?: number | undefined;
|
|
2476
2544
|
}, {
|
|
2477
2545
|
from: string;
|
|
2478
2546
|
to: string;
|
|
2479
|
-
when?: string |
|
|
2547
|
+
when?: string | {
|
|
2548
|
+
expr: string;
|
|
2549
|
+
} | undefined;
|
|
2480
2550
|
max_iterations?: number | undefined;
|
|
2481
2551
|
}>, "many">;
|
|
2482
2552
|
entry: z.ZodString;
|
|
@@ -2632,6 +2702,50 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2632
2702
|
tokens?: number | undefined;
|
|
2633
2703
|
cost_usd?: number | undefined;
|
|
2634
2704
|
}>>;
|
|
2705
|
+
decider: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
2706
|
+
mode: z.ZodEnum<["off", "shadow"]>;
|
|
2707
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
2708
|
+
base_url: z.ZodString;
|
|
2709
|
+
model: z.ZodString;
|
|
2710
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
2711
|
+
}, "strict", z.ZodTypeAny, {
|
|
2712
|
+
model: string;
|
|
2713
|
+
base_url: string;
|
|
2714
|
+
api_key_env?: string | undefined;
|
|
2715
|
+
}, {
|
|
2716
|
+
model: string;
|
|
2717
|
+
base_url: string;
|
|
2718
|
+
api_key_env?: string | undefined;
|
|
2719
|
+
}>>;
|
|
2720
|
+
}, "strict", z.ZodTypeAny, {
|
|
2721
|
+
mode: "off" | "shadow";
|
|
2722
|
+
provider?: {
|
|
2723
|
+
model: string;
|
|
2724
|
+
base_url: string;
|
|
2725
|
+
api_key_env?: string | undefined;
|
|
2726
|
+
} | undefined;
|
|
2727
|
+
}, {
|
|
2728
|
+
mode: "off" | "shadow";
|
|
2729
|
+
provider?: {
|
|
2730
|
+
model: string;
|
|
2731
|
+
base_url: string;
|
|
2732
|
+
api_key_env?: string | undefined;
|
|
2733
|
+
} | undefined;
|
|
2734
|
+
}>, {
|
|
2735
|
+
mode: "off" | "shadow";
|
|
2736
|
+
provider?: {
|
|
2737
|
+
model: string;
|
|
2738
|
+
base_url: string;
|
|
2739
|
+
api_key_env?: string | undefined;
|
|
2740
|
+
} | undefined;
|
|
2741
|
+
}, {
|
|
2742
|
+
mode: "off" | "shadow";
|
|
2743
|
+
provider?: {
|
|
2744
|
+
model: string;
|
|
2745
|
+
base_url: string;
|
|
2746
|
+
api_key_env?: string | undefined;
|
|
2747
|
+
} | undefined;
|
|
2748
|
+
}>>;
|
|
2635
2749
|
context_mode: z.ZodOptional<z.ZodEnum<["bounded", "full"]>>;
|
|
2636
2750
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
2637
2751
|
type: z.ZodEnum<["string", "number", "boolean", "string[]"]>;
|
|
@@ -2735,12 +2849,12 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2735
2849
|
type?: string | undefined;
|
|
2736
2850
|
};
|
|
2737
2851
|
skills: string[];
|
|
2852
|
+
model?: string | undefined;
|
|
2738
2853
|
output?: Record<string, unknown> | undefined;
|
|
2739
2854
|
tools?: {
|
|
2740
2855
|
deny?: string[] | undefined;
|
|
2741
2856
|
allow?: string[] | undefined;
|
|
2742
2857
|
} | undefined;
|
|
2743
|
-
model?: string | undefined;
|
|
2744
2858
|
on_fail?: "halt" | "continue" | undefined;
|
|
2745
2859
|
max_turns?: number | undefined;
|
|
2746
2860
|
budget?: {
|
|
@@ -2806,6 +2920,7 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2806
2920
|
eval?: {
|
|
2807
2921
|
name: string;
|
|
2808
2922
|
kind: "function" | "value" | "judge";
|
|
2923
|
+
model?: string | undefined;
|
|
2809
2924
|
rule?: {
|
|
2810
2925
|
any_tool_called?: string[] | undefined;
|
|
2811
2926
|
all_tools_called?: string[] | undefined;
|
|
@@ -2820,7 +2935,6 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2820
2935
|
} | undefined;
|
|
2821
2936
|
rubric?: string | undefined;
|
|
2822
2937
|
pass_when?: string | undefined;
|
|
2823
|
-
model?: string | undefined;
|
|
2824
2938
|
}[] | undefined;
|
|
2825
2939
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
2826
2940
|
judge_model?: string | undefined;
|
|
@@ -2846,7 +2960,9 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2846
2960
|
edges: {
|
|
2847
2961
|
from: string;
|
|
2848
2962
|
to: string;
|
|
2849
|
-
when?: string |
|
|
2963
|
+
when?: string | {
|
|
2964
|
+
expr: string;
|
|
2965
|
+
} | undefined;
|
|
2850
2966
|
max_iterations?: number | undefined;
|
|
2851
2967
|
}[];
|
|
2852
2968
|
entry: string;
|
|
@@ -2880,6 +2996,14 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2880
2996
|
spec_version?: string | undefined;
|
|
2881
2997
|
workflow_type?: "pr_review" | "e2e_test" | "content_generation" | "monitor" | "data_sync" | "generic" | undefined;
|
|
2882
2998
|
judge_budget?: number | undefined;
|
|
2999
|
+
decider?: {
|
|
3000
|
+
mode: "off" | "shadow";
|
|
3001
|
+
provider?: {
|
|
3002
|
+
model: string;
|
|
3003
|
+
base_url: string;
|
|
3004
|
+
api_key_env?: string | undefined;
|
|
3005
|
+
} | undefined;
|
|
3006
|
+
} | undefined;
|
|
2883
3007
|
context_mode?: "full" | "bounded" | undefined;
|
|
2884
3008
|
inputs?: Record<string, {
|
|
2885
3009
|
type: "string" | "number" | "boolean" | "string[]";
|
|
@@ -2909,12 +3033,12 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2909
3033
|
url: string;
|
|
2910
3034
|
type?: string | undefined;
|
|
2911
3035
|
};
|
|
3036
|
+
model?: string | undefined;
|
|
2912
3037
|
output?: Record<string, unknown> | undefined;
|
|
2913
3038
|
tools?: {
|
|
2914
3039
|
deny?: string[] | undefined;
|
|
2915
3040
|
allow?: string[] | undefined;
|
|
2916
3041
|
} | undefined;
|
|
2917
|
-
model?: string | undefined;
|
|
2918
3042
|
on_fail?: "halt" | "continue" | undefined;
|
|
2919
3043
|
skills?: string[] | undefined;
|
|
2920
3044
|
max_turns?: number | undefined;
|
|
@@ -2981,6 +3105,7 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2981
3105
|
eval?: {
|
|
2982
3106
|
name: string;
|
|
2983
3107
|
kind: "function" | "value" | "judge";
|
|
3108
|
+
model?: string | undefined;
|
|
2984
3109
|
rule?: {
|
|
2985
3110
|
any_tool_called?: string[] | undefined;
|
|
2986
3111
|
all_tools_called?: string[] | undefined;
|
|
@@ -2995,7 +3120,6 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
2995
3120
|
} | undefined;
|
|
2996
3121
|
rubric?: string | undefined;
|
|
2997
3122
|
pass_when?: string | undefined;
|
|
2998
|
-
model?: string | undefined;
|
|
2999
3123
|
}[] | undefined;
|
|
3000
3124
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
3001
3125
|
judge_model?: string | undefined;
|
|
@@ -3021,7 +3145,9 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
3021
3145
|
edges: {
|
|
3022
3146
|
from: string;
|
|
3023
3147
|
to: string;
|
|
3024
|
-
when?: string |
|
|
3148
|
+
when?: string | {
|
|
3149
|
+
expr: string;
|
|
3150
|
+
} | undefined;
|
|
3025
3151
|
max_iterations?: number | undefined;
|
|
3026
3152
|
}[];
|
|
3027
3153
|
entry: string;
|
|
@@ -3069,6 +3195,14 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
3069
3195
|
spec_version?: string | undefined;
|
|
3070
3196
|
workflow_type?: "pr_review" | "e2e_test" | "content_generation" | "monitor" | "data_sync" | "generic" | undefined;
|
|
3071
3197
|
judge_budget?: number | undefined;
|
|
3198
|
+
decider?: {
|
|
3199
|
+
mode: "off" | "shadow";
|
|
3200
|
+
provider?: {
|
|
3201
|
+
model: string;
|
|
3202
|
+
base_url: string;
|
|
3203
|
+
api_key_env?: string | undefined;
|
|
3204
|
+
} | undefined;
|
|
3205
|
+
} | undefined;
|
|
3072
3206
|
context_mode?: "full" | "bounded" | undefined;
|
|
3073
3207
|
inputs?: Record<string, {
|
|
3074
3208
|
type: "string" | "number" | "boolean" | "string[]";
|
|
@@ -3127,12 +3261,12 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
3127
3261
|
type?: string | undefined;
|
|
3128
3262
|
};
|
|
3129
3263
|
skills: string[];
|
|
3264
|
+
model?: string | undefined;
|
|
3130
3265
|
output?: Record<string, unknown> | undefined;
|
|
3131
3266
|
tools?: {
|
|
3132
3267
|
deny?: string[] | undefined;
|
|
3133
3268
|
allow?: string[] | undefined;
|
|
3134
3269
|
} | undefined;
|
|
3135
|
-
model?: string | undefined;
|
|
3136
3270
|
on_fail?: "halt" | "continue" | undefined;
|
|
3137
3271
|
max_turns?: number | undefined;
|
|
3138
3272
|
budget?: {
|
|
@@ -3198,6 +3332,7 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
3198
3332
|
eval?: {
|
|
3199
3333
|
name: string;
|
|
3200
3334
|
kind: "function" | "value" | "judge";
|
|
3335
|
+
model?: string | undefined;
|
|
3201
3336
|
rule?: {
|
|
3202
3337
|
any_tool_called?: string[] | undefined;
|
|
3203
3338
|
all_tools_called?: string[] | undefined;
|
|
@@ -3212,7 +3347,6 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
3212
3347
|
} | undefined;
|
|
3213
3348
|
rubric?: string | undefined;
|
|
3214
3349
|
pass_when?: string | undefined;
|
|
3215
|
-
model?: string | undefined;
|
|
3216
3350
|
}[] | undefined;
|
|
3217
3351
|
eval_policy?: "all_pass" | "any_pass" | "weighted" | undefined;
|
|
3218
3352
|
judge_model?: string | undefined;
|
|
@@ -3238,7 +3372,9 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
3238
3372
|
edges: {
|
|
3239
3373
|
from: string;
|
|
3240
3374
|
to: string;
|
|
3241
|
-
when?: string |
|
|
3375
|
+
when?: string | {
|
|
3376
|
+
expr: string;
|
|
3377
|
+
} | undefined;
|
|
3242
3378
|
max_iterations?: number | undefined;
|
|
3243
3379
|
}[];
|
|
3244
3380
|
entry: string;
|
|
@@ -3272,6 +3408,14 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
3272
3408
|
spec_version?: string | undefined;
|
|
3273
3409
|
workflow_type?: "pr_review" | "e2e_test" | "content_generation" | "monitor" | "data_sync" | "generic" | undefined;
|
|
3274
3410
|
judge_budget?: number | undefined;
|
|
3411
|
+
decider?: {
|
|
3412
|
+
mode: "off" | "shadow";
|
|
3413
|
+
provider?: {
|
|
3414
|
+
model: string;
|
|
3415
|
+
base_url: string;
|
|
3416
|
+
api_key_env?: string | undefined;
|
|
3417
|
+
} | undefined;
|
|
3418
|
+
} | undefined;
|
|
3275
3419
|
context_mode?: "full" | "bounded" | undefined;
|
|
3276
3420
|
inputs?: Record<string, {
|
|
3277
3421
|
type: "string" | "number" | "boolean" | "string[]";
|
|
@@ -3290,7 +3434,7 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
3290
3434
|
} | undefined;
|
|
3291
3435
|
};
|
|
3292
3436
|
export interface WorkflowError {
|
|
3293
|
-
code: "MISSING_ENTRY" | "UNKNOWN_EDGE_SOURCE" | "UNKNOWN_EDGE_TARGET" | "UNREACHABLE_NODE" | "UNKNOWN_SKILL" | "SELF_LOOP" | "UNBOUNDED_CYCLE" | "AMBIGUOUS_EDGES" | "UNSUPPORTED_EVAL_POLICY" | "INVALID_INLINE_SKILL" | "EDGE_ITERATIONS_EXCEEDED" | "RETRY_MAX_EXCEEDED" | "PERMISSION_CEILING" | "BUDGET_CEILING" | "OUTPUT_NOT_ALLOWED" | "DUPLICATE_OUTPUT" | "UNSUPPORTED_OUTPUT";
|
|
3437
|
+
code: "MISSING_ENTRY" | "UNKNOWN_EDGE_SOURCE" | "UNKNOWN_EDGE_TARGET" | "UNREACHABLE_NODE" | "UNKNOWN_SKILL" | "SELF_LOOP" | "UNBOUNDED_CYCLE" | "AMBIGUOUS_EDGES" | "UNSUPPORTED_EVAL_POLICY" | "INVALID_INLINE_SKILL" | "EDGE_ITERATIONS_EXCEEDED" | "RETRY_MAX_EXCEEDED" | "PERMISSION_CEILING" | "BUDGET_CEILING" | "OUTPUT_NOT_ALLOWED" | "DUPLICATE_OUTPUT" | "UNSUPPORTED_OUTPUT" | "INVALID_WHEN_EXPRESSION" | "MIXED_EDGE_CONDITIONS";
|
|
3294
3438
|
message: string;
|
|
3295
3439
|
nodeId?: string;
|
|
3296
3440
|
}
|
|
@@ -3568,6 +3712,49 @@ export declare const workflowJsonSchema: {
|
|
|
3568
3712
|
};
|
|
3569
3713
|
};
|
|
3570
3714
|
};
|
|
3715
|
+
readonly Decider: {
|
|
3716
|
+
readonly type: "object";
|
|
3717
|
+
readonly required: readonly ["mode"];
|
|
3718
|
+
readonly additionalProperties: false;
|
|
3719
|
+
readonly description: "Decision model for route choices. 'shadow' asks it alongside the agent and logs whether they agree; the route is always the agent's. The workflow state goes only to provider.base_url, with no fallback.";
|
|
3720
|
+
readonly properties: {
|
|
3721
|
+
readonly mode: {
|
|
3722
|
+
readonly type: "string";
|
|
3723
|
+
readonly enum: readonly ["off", "shadow"];
|
|
3724
|
+
};
|
|
3725
|
+
readonly provider: {
|
|
3726
|
+
readonly type: "object";
|
|
3727
|
+
readonly required: readonly ["base_url", "model"];
|
|
3728
|
+
readonly additionalProperties: false;
|
|
3729
|
+
readonly properties: {
|
|
3730
|
+
readonly base_url: {
|
|
3731
|
+
readonly type: "string";
|
|
3732
|
+
readonly format: "uri";
|
|
3733
|
+
readonly description: "Server root serving POST /v1/systemone (Ollama or TypeSafe Jev).";
|
|
3734
|
+
};
|
|
3735
|
+
readonly model: {
|
|
3736
|
+
readonly type: "string";
|
|
3737
|
+
readonly minLength: 1;
|
|
3738
|
+
};
|
|
3739
|
+
readonly api_key_env: {
|
|
3740
|
+
readonly type: "string";
|
|
3741
|
+
readonly minLength: 1;
|
|
3742
|
+
readonly description: "Env var holding the bearer key.";
|
|
3743
|
+
};
|
|
3744
|
+
};
|
|
3745
|
+
};
|
|
3746
|
+
};
|
|
3747
|
+
readonly if: {
|
|
3748
|
+
readonly properties: {
|
|
3749
|
+
readonly mode: {
|
|
3750
|
+
readonly const: "shadow";
|
|
3751
|
+
};
|
|
3752
|
+
};
|
|
3753
|
+
};
|
|
3754
|
+
readonly then: {
|
|
3755
|
+
readonly required: readonly ["provider"];
|
|
3756
|
+
};
|
|
3757
|
+
};
|
|
3571
3758
|
readonly SafeOutput: {
|
|
3572
3759
|
readonly type: "object";
|
|
3573
3760
|
readonly required: readonly ["type"];
|
|
@@ -3753,6 +3940,10 @@ export declare const workflowJsonSchema: {
|
|
|
3753
3940
|
readonly $ref: "#/$defs/Budget";
|
|
3754
3941
|
readonly description: "Spend ceiling for the whole run and for every node. A node's own budget may only narrow it. The CLI's --max-tokens and --max-cost tighten it further.";
|
|
3755
3942
|
};
|
|
3943
|
+
readonly decider: {
|
|
3944
|
+
readonly $ref: "#/$defs/Decider";
|
|
3945
|
+
readonly description: "Decision model for route choices (shadow mode only). Default: off.";
|
|
3946
|
+
};
|
|
3756
3947
|
readonly context_mode: {
|
|
3757
3948
|
readonly type: "string";
|
|
3758
3949
|
readonly enum: readonly ["bounded", "full"];
|
|
@@ -4099,8 +4290,22 @@ export declare const workflowJsonSchema: {
|
|
|
4099
4290
|
readonly minLength: 1;
|
|
4100
4291
|
};
|
|
4101
4292
|
readonly when: {
|
|
4102
|
-
readonly
|
|
4103
|
-
readonly
|
|
4293
|
+
readonly description: "Condition for taking this edge. A string is natural language, evaluated at runtime by the workflow's harness. An object { expr } is a deterministic expression over prior nodes' declared output fields, evaluated by sweny with no model call.";
|
|
4294
|
+
readonly oneOf: readonly [{
|
|
4295
|
+
readonly type: "string";
|
|
4296
|
+
}, {
|
|
4297
|
+
readonly type: "object";
|
|
4298
|
+
readonly required: readonly ["expr"];
|
|
4299
|
+
readonly additionalProperties: false;
|
|
4300
|
+
readonly properties: {
|
|
4301
|
+
readonly expr: {
|
|
4302
|
+
readonly type: "string";
|
|
4303
|
+
readonly minLength: 1;
|
|
4304
|
+
readonly maxLength: 2000;
|
|
4305
|
+
readonly description: "Boolean expression: == != < <= > >= in, && || !, exists, string/number/boolean/null literals, and node.field paths to declared output fields.";
|
|
4306
|
+
};
|
|
4307
|
+
};
|
|
4308
|
+
}];
|
|
4104
4309
|
};
|
|
4105
4310
|
readonly max_iterations: {
|
|
4106
4311
|
readonly type: "integer";
|