@makaio/framework 1.0.0-dev-1783615060726 → 1.0.0-dev-1783687982716
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/.makaio-build.json +2 -2
- package/dist/adapter-CA8rPIUz.mjs +1 -0
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/index.d.mts +38 -3
- package/dist/adapters/index.mjs +4 -4
- package/dist/bus/index.mjs +1 -1
- package/dist/client-DaR4mzqn.mjs +1 -0
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +2 -2
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/config/index.d.mts +12 -12
- package/dist/contracts/extension/index.d.mts +3 -3
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/index.d.mts +120 -68
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/provider/index.d.mts +1 -1
- package/dist/contracts/session/index.d.mts +3 -3
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +1 -1
- package/dist/contracts/skill/index.d.mts +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/workflow/index.d.mts +3 -3
- package/dist/contracts/workflow/index.mjs +1 -1
- package/dist/{definition-DePb3ke-.d.mts → definition-s9PIua2B.d.mts} +1 -1
- package/dist/drizzle/0024_external_settlement_fingerprint.sql +1 -0
- package/dist/drizzle/0025_external_registration_frame.sql +1 -0
- package/dist/drizzle/meta/_journal.json +14 -0
- package/dist/{index-BSprsrul.d.mts → index-B4ZddkPI.d.mts} +171 -132
- package/dist/{index-DWu3qrwe.d.mts → index-B9d_8_V2.d.mts} +8 -8
- package/dist/{index-Qd1Qom8M.d.mts → index-BUrNl0QJ.d.mts} +36 -36
- package/dist/{index-2fK9iSHI.d.mts → index-BWIkf5oJ.d.mts} +6 -6
- package/dist/{index-Cx1Bm6WD.d.mts → index-Bc82MC0z.d.mts} +4 -4
- package/dist/{index-S7lj2TLp.d.mts → index-CAhKyxfm.d.mts} +481 -101
- package/dist/{index-DZPNuWMc.d.mts → index-CmHdpW0E.d.mts} +11 -11
- package/dist/{index-C9FCWOhp.d.mts → index-D4gn93gL.d.mts} +4 -4
- package/dist/{index-DLNRgZPo2.d.mts → index-D94cDExW2.d.mts} +15 -15
- package/dist/{index-D8wmMJLi.d.mts → index-DLDQDXhD.d.mts} +3 -3
- package/dist/{index-DKaEpPFS.d.mts → index-DNfNwGu6.d.mts} +9 -9
- package/dist/{index-BMbmoarE.d.mts → index-DTBQOCar.d.mts} +16 -16
- package/dist/{index-DZ14azod.d.mts → index-DTkGyKKA.d.mts} +174 -15
- package/dist/{index-DEzdNQum.d.mts → index-Di84JjS0.d.mts} +2 -2
- package/dist/{index-DoEF9LAc.d.mts → index-DsLpP5ek.d.mts} +1 -1
- package/dist/{index-CaerrEDH.d.mts → index-NkNbYFud.d.mts} +1 -1
- package/dist/{index-CqCe7Phc.d.mts → index-mU2lnU7O.d.mts} +6 -6
- package/dist/{index-BbQpQ1N3.d.mts → index-oePgeOph.d.mts} +87 -3
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/index.d.mts +2 -2
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/loop-gate-handlers-o2B5FPdF.mjs +1 -0
- package/dist/{namespace-j7vFsmYL.d.mts → namespace-3yGm4WF9.d.mts} +2 -2
- package/dist/{namespace-D8P8Sxce2.d.mts → namespace-6sIu5nBI2.d.mts} +2 -2
- package/dist/{namespace-CZK2ff3B.d.mts → namespace-B9V9R3AY.d.mts} +22 -22
- package/dist/{namespace-Ceg3zkt2.d.mts → namespace-BGIeqwfU.d.mts} +20 -20
- package/dist/{namespace-CfvtDD_U.d.mts → namespace-BLER-Qom.d.mts} +2 -2
- package/dist/{namespace-Dc94fHZW.d.mts → namespace-Dm454cNM.d.mts} +36 -36
- package/dist/{namespace-DuUCiVmK.d.mts → namespace-d_0I6P7N.d.mts} +58 -58
- package/dist/package-Co_GO3UD.mjs +7 -0
- package/dist/{package-B6mEMD8r.d.mts → package-DmVZxufT.d.mts} +1 -1
- package/dist/package.json +1 -1
- package/dist/{schema-B9goOieO.d.mts → schema-B5vHi7Uu.d.mts} +1 -1
- package/dist/{schemas-CoFCV42v.d.mts → schemas-B_t6oOK-.d.mts} +2 -2
- package/dist/{schemas-D512XweP.d.mts → schemas-CJ2JvA7d.d.mts} +3 -3
- package/dist/{schemas-Br-rSxPE2.d.mts → schemas-CNUk34qC2.d.mts} +19 -19
- package/dist/schemas-CVo8qAK-.mjs +1 -0
- package/dist/{schemas-lnE9YoG7.d.mts → schemas-CscdPqCt.d.mts} +3 -3
- package/dist/services/adapter-subsystem/index.d.mts +2 -2
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/index.d.mts +2 -2
- package/dist/services/agent-runtime/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/schemas.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +14 -14
- package/dist/services/execution-target/index.d.mts +1 -1
- package/dist/services/filesystem/namespace.d.mts +12 -12
- package/dist/services/filesystem/schemas.d.mts +6 -6
- package/dist/services/harness/index.d.mts +3 -3
- package/dist/services/index.d.mts +65 -65
- package/dist/services/session/index.d.mts +5 -5
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/services/session-editor/index.d.mts +1 -1
- package/dist/services/settings/namespace.d.mts +19 -19
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- package/dist/services/subagent-template/index.d.mts +2 -2
- package/dist/services/subagent-template/namespace.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tray-menu/index.d.mts +2 -2
- package/dist/services/tray-menu/namespace.d.mts +1 -1
- package/dist/services/tray-menu/schemas.d.mts +1 -1
- package/dist/session-DBfQkgdy.mjs +1 -0
- package/dist/{session-lineage-NBFNVkUE.d.mts → session-lineage-C1M7-O3C.d.mts} +1 -1
- package/dist/{transition-CmI3q3FA.d.mts → transition-OzGXyy3p.d.mts} +1 -1
- package/dist/{types-VwMx5_lS.d.mts → types-1a2D10yb.d.mts} +13 -2
- package/dist/{types-BNW5n6qm.d.mts → types-BMS6yfLS.d.mts} +1 -1
- package/dist/{types-Dhou-Itn.d.mts → types-BSilhlYE.d.mts} +64 -50
- package/dist/workflow-C3dgVwTY.mjs +1 -0
- package/dist/workflow-engine/index.d.mts +323 -55
- package/dist/workflow-engine/index.mjs +1 -1
- package/dist/workflow-engine/package.d.mts +1 -1
- package/dist/workflow-engine/package.mjs +1 -1
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/package.json +1 -1
- package/dist/adapter-Lx6K7yQS.mjs +0 -1
- package/dist/client-l1Rq5p6X.mjs +0 -1
- package/dist/loop-gate-handlers-Bjmat-K3.mjs +0 -1
- package/dist/package-BQn_RTo7.mjs +0 -1
- package/dist/schemas-CkOigLAT.mjs +0 -1
- package/dist/session-D5rVMqmE.mjs +0 -1
- package/dist/workflow-C1z7I5CI.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as JsonValue$1 } from "./json-value-DtIkQN7g.mjs";
|
|
2
|
-
import { s as MessageBlock$1 } from "./index-
|
|
2
|
+
import { s as MessageBlock$1 } from "./index-NkNbYFud.mjs";
|
|
3
3
|
import * as _$zod from "zod";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import * as _$_makaio_core0 from "@makaio/framework/core";
|
|
@@ -25,8 +25,8 @@ declare const SessionCreateBaseSchema: z.ZodObject<{
|
|
|
25
25
|
branchKind: z.ZodOptional<z.ZodEnum<{
|
|
26
26
|
fork: "fork";
|
|
27
27
|
subagent: "subagent";
|
|
28
|
-
compress: "compress";
|
|
29
28
|
branch: "branch";
|
|
29
|
+
compress: "compress";
|
|
30
30
|
rewrite: "rewrite";
|
|
31
31
|
coordinator: "coordinator";
|
|
32
32
|
aside: "aside";
|
|
@@ -179,8 +179,8 @@ declare const MakaioSessionSchema: z.ZodObject<{
|
|
|
179
179
|
branchKind: z.ZodOptional<z.ZodEnum<{
|
|
180
180
|
fork: "fork";
|
|
181
181
|
subagent: "subagent";
|
|
182
|
-
compress: "compress";
|
|
183
182
|
branch: "branch";
|
|
183
|
+
compress: "compress";
|
|
184
184
|
rewrite: "rewrite";
|
|
185
185
|
coordinator: "coordinator";
|
|
186
186
|
aside: "aside";
|
|
@@ -307,8 +307,8 @@ declare const SessionWithPreviewSchema: z.ZodObject<{
|
|
|
307
307
|
branchKind: z.ZodOptional<z.ZodEnum<{
|
|
308
308
|
fork: "fork";
|
|
309
309
|
subagent: "subagent";
|
|
310
|
-
compress: "compress";
|
|
311
310
|
branch: "branch";
|
|
311
|
+
compress: "compress";
|
|
312
312
|
rewrite: "rewrite";
|
|
313
313
|
coordinator: "coordinator";
|
|
314
314
|
aside: "aside";
|
|
@@ -509,8 +509,8 @@ declare const SessionSnapshotSchema: z.ZodObject<{
|
|
|
509
509
|
branchKind: z.ZodOptional<z.ZodEnum<{
|
|
510
510
|
fork: "fork";
|
|
511
511
|
subagent: "subagent";
|
|
512
|
-
compress: "compress";
|
|
513
512
|
branch: "branch";
|
|
513
|
+
compress: "compress";
|
|
514
514
|
rewrite: "rewrite";
|
|
515
515
|
coordinator: "coordinator";
|
|
516
516
|
aside: "aside";
|
|
@@ -679,8 +679,8 @@ declare const SessionSnapshotSchema: z.ZodObject<{
|
|
|
679
679
|
editOf: z.ZodOptional<z.ZodString>;
|
|
680
680
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
681
681
|
text: "text";
|
|
682
|
-
compact: "compact";
|
|
683
682
|
voice: "voice";
|
|
683
|
+
compact: "compact";
|
|
684
684
|
}>>;
|
|
685
685
|
}, z.core.$strip>>;
|
|
686
686
|
turns: z.ZodArray<z.ZodObject<{
|
|
@@ -874,8 +874,8 @@ declare const SessionSnapshotSchema: z.ZodObject<{
|
|
|
874
874
|
}>>;
|
|
875
875
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
876
876
|
text: "text";
|
|
877
|
-
compact: "compact";
|
|
878
877
|
voice: "voice";
|
|
878
|
+
compact: "compact";
|
|
879
879
|
}>>;
|
|
880
880
|
}, z.core.$strip>;
|
|
881
881
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -997,8 +997,8 @@ declare const SessionSnapshotSchema: z.ZodObject<{
|
|
|
997
997
|
kind: z.ZodEnum<{
|
|
998
998
|
fork: "fork";
|
|
999
999
|
subagent: "subagent";
|
|
1000
|
-
compress: "compress";
|
|
1001
1000
|
branch: "branch";
|
|
1001
|
+
compress: "compress";
|
|
1002
1002
|
rewrite: "rewrite";
|
|
1003
1003
|
coordinator: "coordinator";
|
|
1004
1004
|
aside: "aside";
|
|
@@ -1034,8 +1034,8 @@ declare const SessionSnapshotSchema: z.ZodObject<{
|
|
|
1034
1034
|
type: z.ZodLiteral<"locality.degraded">;
|
|
1035
1035
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1036
1036
|
intent: z.ZodEnum<{
|
|
1037
|
-
resume: "resume";
|
|
1038
1037
|
fork: "fork";
|
|
1038
|
+
resume: "resume";
|
|
1039
1039
|
}>;
|
|
1040
1040
|
verdictKind: z.ZodLiteral<"degrade">;
|
|
1041
1041
|
reason: z.ZodEnum<{
|
|
@@ -1059,8 +1059,8 @@ declare const SessionSnapshotSchema: z.ZodObject<{
|
|
|
1059
1059
|
turnId: z.ZodOptional<z.ZodString>;
|
|
1060
1060
|
}, z.core.$strip>, z.ZodObject<{
|
|
1061
1061
|
intent: z.ZodEnum<{
|
|
1062
|
-
resume: "resume";
|
|
1063
1062
|
fork: "fork";
|
|
1063
|
+
resume: "resume";
|
|
1064
1064
|
}>;
|
|
1065
1065
|
verdictKind: z.ZodLiteral<"foreign">;
|
|
1066
1066
|
foreignMachineId: z.ZodString;
|
|
@@ -1122,8 +1122,8 @@ type AgentRole = z.infer<typeof AgentRoleSchema>;
|
|
|
1122
1122
|
declare const BranchKindSchema: z.ZodEnum<{
|
|
1123
1123
|
fork: "fork";
|
|
1124
1124
|
subagent: "subagent";
|
|
1125
|
-
compress: "compress";
|
|
1126
1125
|
branch: "branch";
|
|
1126
|
+
compress: "compress";
|
|
1127
1127
|
rewrite: "rewrite";
|
|
1128
1128
|
coordinator: "coordinator";
|
|
1129
1129
|
aside: "aside";
|
|
@@ -1219,8 +1219,8 @@ declare const SessionMessageRoleSchema: z.ZodEnum<{
|
|
|
1219
1219
|
type SessionMessageRole = z.infer<typeof SessionMessageRoleSchema>;
|
|
1220
1220
|
declare const SessionMessageOriginSchema: z.ZodEnum<{
|
|
1221
1221
|
text: "text";
|
|
1222
|
-
compact: "compact";
|
|
1223
1222
|
voice: "voice";
|
|
1223
|
+
compact: "compact";
|
|
1224
1224
|
}>;
|
|
1225
1225
|
type SessionMessageOrigin$1 = z.infer<typeof SessionMessageOriginSchema>;
|
|
1226
1226
|
/**
|
|
@@ -1311,8 +1311,8 @@ declare const SessionMessageSchema$1: z.ZodObject<{
|
|
|
1311
1311
|
editOf: z.ZodOptional<z.ZodString>;
|
|
1312
1312
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1313
1313
|
text: "text";
|
|
1314
|
-
compact: "compact";
|
|
1315
1314
|
voice: "voice";
|
|
1315
|
+
compact: "compact";
|
|
1316
1316
|
}>>;
|
|
1317
1317
|
}, z.core.$strip>;
|
|
1318
1318
|
type SessionMessage$1 = z.infer<typeof SessionMessageSchema$1>;
|
|
@@ -2080,6 +2080,13 @@ declare const OrchestratorSchemas: {
|
|
|
2080
2080
|
fullPrefix: "fullPrefix";
|
|
2081
2081
|
}>>;
|
|
2082
2082
|
turnContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
|
|
2083
|
+
requestCorrelation: z.ZodOptional<z.ZodObject<{
|
|
2084
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
2085
|
+
turnId: z.ZodOptional<z.ZodString>;
|
|
2086
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
2087
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
2088
|
+
frameId: z.ZodOptional<z.ZodString>;
|
|
2089
|
+
}, z.core.$strict>>;
|
|
2083
2090
|
nativeLocality: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2084
2091
|
kind: z.ZodLiteral<"native">;
|
|
2085
2092
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -2126,8 +2133,8 @@ declare const OrchestratorSchemas: {
|
|
|
2126
2133
|
skipConnectorSwapWarning: z.ZodOptional<z.ZodBoolean>;
|
|
2127
2134
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2128
2135
|
text: "text";
|
|
2129
|
-
compact: "compact";
|
|
2130
2136
|
voice: "voice";
|
|
2137
|
+
compact: "compact";
|
|
2131
2138
|
}>>;
|
|
2132
2139
|
}, z.core.$strip>;
|
|
2133
2140
|
response: z.ZodObject<{
|
|
@@ -2944,8 +2951,8 @@ declare const OrchestratorSchemas: {
|
|
|
2944
2951
|
}>>;
|
|
2945
2952
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2946
2953
|
text: "text";
|
|
2947
|
-
compact: "compact";
|
|
2948
2954
|
voice: "voice";
|
|
2955
|
+
compact: "compact";
|
|
2949
2956
|
}>>;
|
|
2950
2957
|
}, z.core.$strip>;
|
|
2951
2958
|
/**
|
|
@@ -3307,8 +3314,8 @@ declare const MakaioSessionEventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
|
|
|
3307
3314
|
}>>;
|
|
3308
3315
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
3309
3316
|
text: "text";
|
|
3310
|
-
compact: "compact";
|
|
3311
3317
|
voice: "voice";
|
|
3318
|
+
compact: "compact";
|
|
3312
3319
|
}>>;
|
|
3313
3320
|
}, z.core.$strip>;
|
|
3314
3321
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -3430,8 +3437,8 @@ declare const MakaioSessionEventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
|
|
|
3430
3437
|
kind: z.ZodEnum<{
|
|
3431
3438
|
fork: "fork";
|
|
3432
3439
|
subagent: "subagent";
|
|
3433
|
-
compress: "compress";
|
|
3434
3440
|
branch: "branch";
|
|
3441
|
+
compress: "compress";
|
|
3435
3442
|
rewrite: "rewrite";
|
|
3436
3443
|
coordinator: "coordinator";
|
|
3437
3444
|
aside: "aside";
|
|
@@ -3467,8 +3474,8 @@ declare const MakaioSessionEventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
|
|
|
3467
3474
|
type: z.ZodLiteral<"locality.degraded">;
|
|
3468
3475
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3469
3476
|
intent: z.ZodEnum<{
|
|
3470
|
-
resume: "resume";
|
|
3471
3477
|
fork: "fork";
|
|
3478
|
+
resume: "resume";
|
|
3472
3479
|
}>;
|
|
3473
3480
|
verdictKind: z.ZodLiteral<"degrade">;
|
|
3474
3481
|
reason: z.ZodEnum<{
|
|
@@ -3492,8 +3499,8 @@ declare const MakaioSessionEventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
|
|
|
3492
3499
|
turnId: z.ZodOptional<z.ZodString>;
|
|
3493
3500
|
}, z.core.$strip>, z.ZodObject<{
|
|
3494
3501
|
intent: z.ZodEnum<{
|
|
3495
|
-
resume: "resume";
|
|
3496
3502
|
fork: "fork";
|
|
3503
|
+
resume: "resume";
|
|
3497
3504
|
}>;
|
|
3498
3505
|
verdictKind: z.ZodLiteral<"foreign">;
|
|
3499
3506
|
foreignMachineId: z.ZodString;
|
|
@@ -3687,8 +3694,8 @@ declare const ForkChildInfoSchema: z.ZodObject<{
|
|
|
3687
3694
|
branchKind: z.ZodNullable<z.ZodEnum<{
|
|
3688
3695
|
fork: "fork";
|
|
3689
3696
|
subagent: "subagent";
|
|
3690
|
-
compress: "compress";
|
|
3691
3697
|
branch: "branch";
|
|
3698
|
+
compress: "compress";
|
|
3692
3699
|
rewrite: "rewrite";
|
|
3693
3700
|
coordinator: "coordinator";
|
|
3694
3701
|
aside: "aside";
|
|
@@ -3761,8 +3768,8 @@ declare const SessionCreatedEventSchema: z.ZodObject<{
|
|
|
3761
3768
|
branchKind: z.ZodNullable<z.ZodEnum<{
|
|
3762
3769
|
fork: "fork";
|
|
3763
3770
|
subagent: "subagent";
|
|
3764
|
-
compress: "compress";
|
|
3765
3771
|
branch: "branch";
|
|
3772
|
+
compress: "compress";
|
|
3766
3773
|
rewrite: "rewrite";
|
|
3767
3774
|
coordinator: "coordinator";
|
|
3768
3775
|
aside: "aside";
|
|
@@ -4524,6 +4531,13 @@ declare const SessionSchemas: {
|
|
|
4524
4531
|
fullPrefix: "fullPrefix";
|
|
4525
4532
|
}>>;
|
|
4526
4533
|
turnContext: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodType<_$_makaio_contracts0.JsonValue, unknown, _$zod_v4_core0.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
|
|
4534
|
+
requestCorrelation: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
4535
|
+
sessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
4536
|
+
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
4537
|
+
messageId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
4538
|
+
executionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
4539
|
+
frameId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
4540
|
+
}, _$zod_v4_core0.$strict>>;
|
|
4527
4541
|
nativeLocality: _$zod.ZodOptional<_$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
4528
4542
|
kind: _$zod.ZodLiteral<"native">;
|
|
4529
4543
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
@@ -4570,8 +4584,8 @@ declare const SessionSchemas: {
|
|
|
4570
4584
|
skipConnectorSwapWarning: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
4571
4585
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
4572
4586
|
text: "text";
|
|
4573
|
-
compact: "compact";
|
|
4574
4587
|
voice: "voice";
|
|
4588
|
+
compact: "compact";
|
|
4575
4589
|
}>>;
|
|
4576
4590
|
}, _$zod_v4_core0.$strip>;
|
|
4577
4591
|
response: _$zod.ZodObject<{
|
|
@@ -5307,8 +5321,8 @@ declare const SessionSchemas: {
|
|
|
5307
5321
|
}>>;
|
|
5308
5322
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
5309
5323
|
text: "text";
|
|
5310
|
-
compact: "compact";
|
|
5311
5324
|
voice: "voice";
|
|
5325
|
+
compact: "compact";
|
|
5312
5326
|
}>>;
|
|
5313
5327
|
}, _$zod_v4_core0.$strip>;
|
|
5314
5328
|
'user_message.acknowledged': _$zod.ZodObject<{
|
|
@@ -5418,8 +5432,8 @@ declare const SessionSchemas: {
|
|
|
5418
5432
|
branchKind: _$zod.ZodNullable<_$zod.ZodEnum<{
|
|
5419
5433
|
fork: "fork";
|
|
5420
5434
|
subagent: "subagent";
|
|
5421
|
-
compress: "compress";
|
|
5422
5435
|
branch: "branch";
|
|
5436
|
+
compress: "compress";
|
|
5423
5437
|
rewrite: "rewrite";
|
|
5424
5438
|
coordinator: "coordinator";
|
|
5425
5439
|
aside: "aside";
|
|
@@ -5475,8 +5489,8 @@ declare const SessionSchemas: {
|
|
|
5475
5489
|
kind: _$zod.ZodEnum<{
|
|
5476
5490
|
fork: "fork";
|
|
5477
5491
|
subagent: "subagent";
|
|
5478
|
-
compress: "compress";
|
|
5479
5492
|
branch: "branch";
|
|
5493
|
+
compress: "compress";
|
|
5480
5494
|
rewrite: "rewrite";
|
|
5481
5495
|
coordinator: "coordinator";
|
|
5482
5496
|
aside: "aside";
|
|
@@ -5523,8 +5537,8 @@ declare const SessionSchemas: {
|
|
|
5523
5537
|
branchKind: _$zod.ZodNullable<_$zod.ZodEnum<{
|
|
5524
5538
|
fork: "fork";
|
|
5525
5539
|
subagent: "subagent";
|
|
5526
|
-
compress: "compress";
|
|
5527
5540
|
branch: "branch";
|
|
5541
|
+
compress: "compress";
|
|
5528
5542
|
rewrite: "rewrite";
|
|
5529
5543
|
coordinator: "coordinator";
|
|
5530
5544
|
aside: "aside";
|
|
@@ -5624,8 +5638,8 @@ declare const SessionSchemas: {
|
|
|
5624
5638
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
5625
5639
|
fork: "fork";
|
|
5626
5640
|
subagent: "subagent";
|
|
5627
|
-
compress: "compress";
|
|
5628
5641
|
branch: "branch";
|
|
5642
|
+
compress: "compress";
|
|
5629
5643
|
rewrite: "rewrite";
|
|
5630
5644
|
coordinator: "coordinator";
|
|
5631
5645
|
aside: "aside";
|
|
@@ -5794,8 +5808,8 @@ declare const SessionSchemas: {
|
|
|
5794
5808
|
editOf: _$zod.ZodOptional<_$zod.ZodString>;
|
|
5795
5809
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
5796
5810
|
text: "text";
|
|
5797
|
-
compact: "compact";
|
|
5798
5811
|
voice: "voice";
|
|
5812
|
+
compact: "compact";
|
|
5799
5813
|
}>>;
|
|
5800
5814
|
}, _$zod_v4_core0.$strip>>;
|
|
5801
5815
|
turns: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -5989,8 +6003,8 @@ declare const SessionSchemas: {
|
|
|
5989
6003
|
}>>;
|
|
5990
6004
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
5991
6005
|
text: "text";
|
|
5992
|
-
compact: "compact";
|
|
5993
6006
|
voice: "voice";
|
|
6007
|
+
compact: "compact";
|
|
5994
6008
|
}>>;
|
|
5995
6009
|
}, _$zod_v4_core0.$strip>;
|
|
5996
6010
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
@@ -6112,8 +6126,8 @@ declare const SessionSchemas: {
|
|
|
6112
6126
|
kind: _$zod.ZodEnum<{
|
|
6113
6127
|
fork: "fork";
|
|
6114
6128
|
subagent: "subagent";
|
|
6115
|
-
compress: "compress";
|
|
6116
6129
|
branch: "branch";
|
|
6130
|
+
compress: "compress";
|
|
6117
6131
|
rewrite: "rewrite";
|
|
6118
6132
|
coordinator: "coordinator";
|
|
6119
6133
|
aside: "aside";
|
|
@@ -6149,8 +6163,8 @@ declare const SessionSchemas: {
|
|
|
6149
6163
|
type: _$zod.ZodLiteral<"locality.degraded">;
|
|
6150
6164
|
payload: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
6151
6165
|
intent: _$zod.ZodEnum<{
|
|
6152
|
-
resume: "resume";
|
|
6153
6166
|
fork: "fork";
|
|
6167
|
+
resume: "resume";
|
|
6154
6168
|
}>;
|
|
6155
6169
|
verdictKind: _$zod.ZodLiteral<"degrade">;
|
|
6156
6170
|
reason: _$zod.ZodEnum<{
|
|
@@ -6174,8 +6188,8 @@ declare const SessionSchemas: {
|
|
|
6174
6188
|
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
6175
6189
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
6176
6190
|
intent: _$zod.ZodEnum<{
|
|
6177
|
-
resume: "resume";
|
|
6178
6191
|
fork: "fork";
|
|
6192
|
+
resume: "resume";
|
|
6179
6193
|
}>;
|
|
6180
6194
|
verdictKind: _$zod.ZodLiteral<"foreign">;
|
|
6181
6195
|
foreignMachineId: _$zod.ZodString;
|
|
@@ -6257,8 +6271,8 @@ declare const SessionSchemas: {
|
|
|
6257
6271
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
6258
6272
|
fork: "fork";
|
|
6259
6273
|
subagent: "subagent";
|
|
6260
|
-
compress: "compress";
|
|
6261
6274
|
branch: "branch";
|
|
6275
|
+
compress: "compress";
|
|
6262
6276
|
rewrite: "rewrite";
|
|
6263
6277
|
coordinator: "coordinator";
|
|
6264
6278
|
aside: "aside";
|
|
@@ -6427,8 +6441,8 @@ declare const SessionSchemas: {
|
|
|
6427
6441
|
editOf: _$zod.ZodOptional<_$zod.ZodString>;
|
|
6428
6442
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
6429
6443
|
text: "text";
|
|
6430
|
-
compact: "compact";
|
|
6431
6444
|
voice: "voice";
|
|
6445
|
+
compact: "compact";
|
|
6432
6446
|
}>>;
|
|
6433
6447
|
}, _$zod_v4_core0.$strip>>;
|
|
6434
6448
|
turns: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -6622,8 +6636,8 @@ declare const SessionSchemas: {
|
|
|
6622
6636
|
}>>;
|
|
6623
6637
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
6624
6638
|
text: "text";
|
|
6625
|
-
compact: "compact";
|
|
6626
6639
|
voice: "voice";
|
|
6640
|
+
compact: "compact";
|
|
6627
6641
|
}>>;
|
|
6628
6642
|
}, _$zod_v4_core0.$strip>;
|
|
6629
6643
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
@@ -6745,8 +6759,8 @@ declare const SessionSchemas: {
|
|
|
6745
6759
|
kind: _$zod.ZodEnum<{
|
|
6746
6760
|
fork: "fork";
|
|
6747
6761
|
subagent: "subagent";
|
|
6748
|
-
compress: "compress";
|
|
6749
6762
|
branch: "branch";
|
|
6763
|
+
compress: "compress";
|
|
6750
6764
|
rewrite: "rewrite";
|
|
6751
6765
|
coordinator: "coordinator";
|
|
6752
6766
|
aside: "aside";
|
|
@@ -6782,8 +6796,8 @@ declare const SessionSchemas: {
|
|
|
6782
6796
|
type: _$zod.ZodLiteral<"locality.degraded">;
|
|
6783
6797
|
payload: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
6784
6798
|
intent: _$zod.ZodEnum<{
|
|
6785
|
-
resume: "resume";
|
|
6786
6799
|
fork: "fork";
|
|
6800
|
+
resume: "resume";
|
|
6787
6801
|
}>;
|
|
6788
6802
|
verdictKind: _$zod.ZodLiteral<"degrade">;
|
|
6789
6803
|
reason: _$zod.ZodEnum<{
|
|
@@ -6807,8 +6821,8 @@ declare const SessionSchemas: {
|
|
|
6807
6821
|
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
6808
6822
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
6809
6823
|
intent: _$zod.ZodEnum<{
|
|
6810
|
-
resume: "resume";
|
|
6811
6824
|
fork: "fork";
|
|
6825
|
+
resume: "resume";
|
|
6812
6826
|
}>;
|
|
6813
6827
|
verdictKind: _$zod.ZodLiteral<"foreign">;
|
|
6814
6828
|
foreignMachineId: _$zod.ZodString;
|
|
@@ -6911,8 +6925,8 @@ declare const SessionSchemas: {
|
|
|
6911
6925
|
timestamp: _$zod.ZodNumber;
|
|
6912
6926
|
}, _$zod_v4_core0.$strip>, _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
6913
6927
|
intent: _$zod.ZodEnum<{
|
|
6914
|
-
resume: "resume";
|
|
6915
6928
|
fork: "fork";
|
|
6929
|
+
resume: "resume";
|
|
6916
6930
|
}>;
|
|
6917
6931
|
verdictKind: _$zod.ZodLiteral<"degrade">;
|
|
6918
6932
|
reason: _$zod.ZodEnum<{
|
|
@@ -6936,8 +6950,8 @@ declare const SessionSchemas: {
|
|
|
6936
6950
|
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
6937
6951
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
6938
6952
|
intent: _$zod.ZodEnum<{
|
|
6939
|
-
resume: "resume";
|
|
6940
6953
|
fork: "fork";
|
|
6954
|
+
resume: "resume";
|
|
6941
6955
|
}>;
|
|
6942
6956
|
verdictKind: _$zod.ZodLiteral<"foreign">;
|
|
6943
6957
|
foreignMachineId: _$zod.ZodString;
|
|
@@ -6955,8 +6969,8 @@ declare const SessionSchemas: {
|
|
|
6955
6969
|
maxTokens: _$zod.ZodNumber;
|
|
6956
6970
|
percentage: _$zod.ZodNumber;
|
|
6957
6971
|
level: _$zod.ZodEnum<{
|
|
6958
|
-
ok: "ok";
|
|
6959
6972
|
warn: "warn";
|
|
6973
|
+
ok: "ok";
|
|
6960
6974
|
critical: "critical";
|
|
6961
6975
|
}>;
|
|
6962
6976
|
lastUpdatedAt: _$zod.ZodNumber;
|
|
@@ -7134,8 +7148,8 @@ declare const SessionSchemas: {
|
|
|
7134
7148
|
}>>;
|
|
7135
7149
|
origin: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
7136
7150
|
text: "text";
|
|
7137
|
-
compact: "compact";
|
|
7138
7151
|
voice: "voice";
|
|
7152
|
+
compact: "compact";
|
|
7139
7153
|
}>>;
|
|
7140
7154
|
}, _$zod_v4_core0.$strip>;
|
|
7141
7155
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
@@ -7257,8 +7271,8 @@ declare const SessionSchemas: {
|
|
|
7257
7271
|
kind: _$zod.ZodEnum<{
|
|
7258
7272
|
fork: "fork";
|
|
7259
7273
|
subagent: "subagent";
|
|
7260
|
-
compress: "compress";
|
|
7261
7274
|
branch: "branch";
|
|
7275
|
+
compress: "compress";
|
|
7262
7276
|
rewrite: "rewrite";
|
|
7263
7277
|
coordinator: "coordinator";
|
|
7264
7278
|
aside: "aside";
|
|
@@ -7294,8 +7308,8 @@ declare const SessionSchemas: {
|
|
|
7294
7308
|
type: _$zod.ZodLiteral<"locality.degraded">;
|
|
7295
7309
|
payload: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
7296
7310
|
intent: _$zod.ZodEnum<{
|
|
7297
|
-
resume: "resume";
|
|
7298
7311
|
fork: "fork";
|
|
7312
|
+
resume: "resume";
|
|
7299
7313
|
}>;
|
|
7300
7314
|
verdictKind: _$zod.ZodLiteral<"degrade">;
|
|
7301
7315
|
reason: _$zod.ZodEnum<{
|
|
@@ -7319,8 +7333,8 @@ declare const SessionSchemas: {
|
|
|
7319
7333
|
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
7320
7334
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
7321
7335
|
intent: _$zod.ZodEnum<{
|
|
7322
|
-
resume: "resume";
|
|
7323
7336
|
fork: "fork";
|
|
7337
|
+
resume: "resume";
|
|
7324
7338
|
}>;
|
|
7325
7339
|
verdictKind: _$zod.ZodLiteral<"foreign">;
|
|
7326
7340
|
foreignMachineId: _$zod.ZodString;
|
|
@@ -7403,8 +7417,8 @@ declare const SessionSchemas: {
|
|
|
7403
7417
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
7404
7418
|
fork: "fork";
|
|
7405
7419
|
subagent: "subagent";
|
|
7406
|
-
compress: "compress";
|
|
7407
7420
|
branch: "branch";
|
|
7421
|
+
compress: "compress";
|
|
7408
7422
|
rewrite: "rewrite";
|
|
7409
7423
|
coordinator: "coordinator";
|
|
7410
7424
|
aside: "aside";
|
|
@@ -7541,8 +7555,8 @@ declare const SessionSchemas: {
|
|
|
7541
7555
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
7542
7556
|
fork: "fork";
|
|
7543
7557
|
subagent: "subagent";
|
|
7544
|
-
compress: "compress";
|
|
7545
7558
|
branch: "branch";
|
|
7559
|
+
compress: "compress";
|
|
7546
7560
|
rewrite: "rewrite";
|
|
7547
7561
|
coordinator: "coordinator";
|
|
7548
7562
|
aside: "aside";
|
|
@@ -7670,8 +7684,8 @@ declare const SessionSchemas: {
|
|
|
7670
7684
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
7671
7685
|
fork: "fork";
|
|
7672
7686
|
subagent: "subagent";
|
|
7673
|
-
compress: "compress";
|
|
7674
7687
|
branch: "branch";
|
|
7688
|
+
compress: "compress";
|
|
7675
7689
|
rewrite: "rewrite";
|
|
7676
7690
|
coordinator: "coordinator";
|
|
7677
7691
|
aside: "aside";
|
|
@@ -7748,8 +7762,8 @@ declare const SessionSchemas: {
|
|
|
7748
7762
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
7749
7763
|
fork: "fork";
|
|
7750
7764
|
subagent: "subagent";
|
|
7751
|
-
compress: "compress";
|
|
7752
7765
|
branch: "branch";
|
|
7766
|
+
compress: "compress";
|
|
7753
7767
|
rewrite: "rewrite";
|
|
7754
7768
|
coordinator: "coordinator";
|
|
7755
7769
|
aside: "aside";
|
|
@@ -7913,8 +7927,8 @@ declare const SessionSchemas: {
|
|
|
7913
7927
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
7914
7928
|
fork: "fork";
|
|
7915
7929
|
subagent: "subagent";
|
|
7916
|
-
compress: "compress";
|
|
7917
7930
|
branch: "branch";
|
|
7931
|
+
compress: "compress";
|
|
7918
7932
|
rewrite: "rewrite";
|
|
7919
7933
|
coordinator: "coordinator";
|
|
7920
7934
|
aside: "aside";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,g as t,w as n}from"./artifact-CGjnoyCC.mjs";import{i as r,r as i,t as a}from"./json-value-DmU8ibo_.mjs";import{a as o}from"./visibility-Cb62p9bv.mjs";import"./credential-ref-YWQQENEo.mjs";import{t as s}from"./provider-context-CqMgPOWF.mjs";import{a as c,o as l}from"./schemas-CuG17U3L.mjs";import{z as u}from"zod";import{createBusNamespace as d,getFullSubjectForSubjectDefinition as f,observability as p}from"@makaio/framework/core";const m=u.enum([`wait-in-process`,`exit-and-redispatch`,`exit-and-resume`]),ee=u.discriminatedUnion(`kind`,[u.object({kind:u.literal(`path`),path:u.string().min(1)}).strict(),u.object({kind:u.literal(`source`),filename:u.string().min(1),source:u.string()}).strict()]),h=u.object({source:ee.optional(),requirements:u.object({isolation:u.enum([`local`,`container`,`remote`]).optional(),capabilities:u.array(u.string()).optional()}).catchall(r).optional(),providers:u.record(u.string(),r).optional()}).catchall(r),g=u.object({kind:u.string().min(1),id:u.string().min(1)});function te(e){return`${re(e.kind)}:${re(e.id)}`}function ne(e){let t=ie(e);if(t<1)throw Error(`Invalid artifact ref key: ${e}`);let n=ae(e.slice(t+1));if(n.length===0)throw Error(`Invalid artifact ref key (empty id): ${e}`);return{kind:ae(e.slice(0,t)),id:n}}function re(e){return e.replace(/\\/g,`\\\\`).replace(/:/g,`\\:`)}function ie(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(t){t=!1;continue}if(r===`\\`){t=!0;continue}if(r===`:`)return n}return-1}function ae(e){let t=``,n=!1;for(let r of e){if(n){if(r!==`\\`&&r!==`:`)throw Error(`Invalid artifact ref key component: ${e}`);t+=r,n=!1;continue}if(r===`\\`){n=!0;continue}t+=r}if(n)throw Error(`Invalid artifact ref key component: ${e}`);return t}const _=u.union([u.string(),u.number(),u.boolean(),u.null()]),oe=u.union([_,u.object({$in:u.array(_)}).strict(),u.object({$ne:_}).strict(),u.object({$exists:u.boolean()}).strict(),u.object({$startsWith:u.string()}).strict(),u.object({$endsWith:u.string()}).strict()]),se=u.record(u.string(),oe),ce=u.object({type:u.literal(`bus-event`),subject:u.string(),filter:se.optional(),filterExpression:u.string().optional()}),v=u.object({type:u.literal(`extension`),extensionType:u.string().regex(/^[a-z0-9-]+:[a-z0-9._-]+$/),config:a.optional()}),y=u.discriminatedUnion(`type`,[u.object({type:u.literal(`manual`)}),u.object({type:u.literal(`cron`),schedule:u.string(),timezone:u.string().optional()}),u.object({type:u.literal(`webhook`),event:u.string(),branch:u.string().optional(),repo:u.string().optional()}),v,ce]),b=u.discriminatedUnion(`type`,[u.object({type:u.literal(`global`)}).strict(),u.object({type:u.literal(`workspace`),id:u.string().min(1)}).strict(),u.object({type:u.literal(`session`),id:u.string().min(1)}).strict(),u.object({type:u.literal(`external`),kind:u.string().min(1),id:u.string().min(1)}).strict()]),x=u.string().min(1),S=u.object({kind:u.string().min(1),schemaVersion:u.string().min(1),scope:n,resolve:u.string().min(1).optional(),create:u.string().min(1).optional(),statusPath:u.string().min(1).optional()}),le=u.object({kind:u.string().min(1),schemaVersion:u.string().min(1),scope:n,dataExpression:u.string().optional()}),ue=u.object({file:u.string().min(1),line:u.number().int().positive().optional(),column:u.number().int().positive().optional()}),C=u.enum([`station`,`delegate-agent`,`delegate-role`,`parallel`,`gate`,`iterate`,`iterate-chain`,`loop`,`sequence`]),de=u.enum([`all-settled`,`fail-fast`]),w=u.object({id:u.string().min(1),when:x.optional(),skip:x.optional(),writes:u.array(le).optional()}),T=u.lazy(()=>u.discriminatedUnion(`type`,[D,fe,pe,me,he,ge,_e,ye,E])),E=w.extend({type:u.literal(`sequence`),nodes:u.lazy(()=>u.array(T))}),D=w.extend({type:u.literal(`station`),prompt:u.string().min(1),role:u.string().min(1).optional(),outputSchema:i.optional(),timeoutMs:u.number().int().positive().optional(),completion:c.optional()}),fe=w.extend({type:u.literal(`delegate-agent`),agentId:u.string().min(1),inputExpression:u.string().optional(),outputSchema:i.optional()}),pe=w.extend({type:u.literal(`delegate-role`),role:u.string().min(1),prompt:u.string().min(1),outputSchema:i.optional(),timeoutMs:u.number().int().positive().optional(),completion:c.optional()}),me=w.extend({type:u.literal(`parallel`),mode:de.optional(),branches:u.record(u.string().min(1),u.lazy(()=>E))}),he=w.extend({type:u.literal(`gate`),prompt:u.string().min(1),title:u.string().optional(),autoAction:u.enum([`approve`,`reject`]),timeoutMs:u.number().int().positive().nullable(),resumeSchema:i.optional()}),ge=w.extend({type:u.literal(`iterate`),collection:u.string().min(1),body:u.lazy(()=>E),concurrency:u.number().int().nonnegative().optional()}),_e=w.extend({type:u.literal(`iterate-chain`),collection:u.string().min(1),body:u.lazy(()=>E)}),ve=u.discriminatedUnion(`kind`,[u.object({kind:u.literal(`pass`)}).strict(),u.object({kind:u.literal(`loop`)}).strict(),u.object({kind:u.literal(`escalate`),reason:u.string().min(1)}).strict()]),ye=w.extend({type:u.literal(`loop`),maxRounds:u.number().int().positive(),body:u.lazy(()=>E),gate:u.object({handler:u.string().min(1),input:u.string().min(1).optional(),config:r.optional(),escalation:u.object({title:u.string().optional(),prompt:u.string().min(1),resumeSchema:i.optional(),autoAction:u.enum([`approve`,`reject`]).default(`reject`),timeoutMs:u.number().int().positive().nullable().default(null)}).strict().optional()}).strict()}),be=u.object({factoryId:u.string().min(1),preview:u.array(u.lazy(()=>T)).optional(),sourceLocation:ue.optional()}),xe=u.discriminatedUnion(`kind`,[u.object({kind:u.literal(`editor`)}).strict(),u.object({kind:u.literal(`extension`),extension:u.string().min(1),externalId:u.string().min(1).optional(),syncedAt:u.string().datetime().optional(),metadata:a.default({})}).strict()]),Se=u.object({schema:i,initial:r.optional()}),O=u.object({id:u.string().min(1),name:u.string().optional(),description:u.string().optional(),inputSchema:i.optional(),configSchema:i.optional(),outputSchema:i.optional(),state:Se.optional(),artifact:S.optional(),root:E,triggers:u.array(y).optional(),scope:b.default({type:`global`}),canvasLayout:u.record(u.string(),r).optional(),source:xe.optional(),executionHints:h.optional()}),k=u.enum([`pending`,`running`,`paused`,`completed`,`failed`,`cancelled`]),A=u.object({id:u.string(),workflowId:u.string(),coordinatorSessionId:u.string().optional(),status:k,inputs:r,config:a.optional(),startedAt:u.number(),completedAt:u.number().optional(),error:u.string().optional(),reason:u.string().optional(),triggerPayload:a.optional(),scope:b,artifactRef:g.optional()}),j=u.object({frameId:u.string(),nodeId:u.string(),nodeType:C,path:u.array(u.string()),parentFrameId:u.string().optional(),status:u.enum([`pending`,`running`,`waiting`,`completed`,`failed`,`skipped`,`cancelled`]),attempt:u.number().int().nonnegative().default(0),iteration:u.number().int().nonnegative().optional(),branchKey:u.string().optional(),output:r.optional(),error:u.string().optional(),startedAt:u.number().optional(),completedAt:u.number().optional()}),M=u.enum([`waiting`,`resumed`,`rejected`,`timed-out`,`cancelled`]),N=u.object({executionId:u.string(),nodeId:u.string(),frameId:u.string(),schema:i,prompt:u.string().optional(),status:M,autoAction:u.enum([`approve`,`reject`]),timeoutMs:u.number().int().positive().nullable(),resumeData:r.optional(),reason:u.string().optional(),createdAt:u.number(),resolvedAt:u.number().optional()}),P=u.object({adapterName:u.string().min(1),model:u.string().optional(),reasoningEffort:o.optional(),harnessId:u.string().optional(),systemPrompt:u.string().optional(),contextMode:l.optional(),providerContext:s.optional(),completion:c.optional()}),Ce=P,we=u.object({scope:b.optional()}),Te=u.object({startedAt:u.number(),id:u.string()}),Ee=1,De=500,Oe=50,ke=u.object({workflowId:u.string().min(1).optional(),scope:b.optional(),status:k.optional(),artifactRef:g.optional(),limit:u.number().int().min(1).max(500).default(50),cursor:Te.optional()}).refine(e=>e.workflowId!==void 0||e.scope!==void 0||e.artifactRef!==void 0,{message:`Either workflowId, scope, or artifactRef is required.`}),Ae=200,je=100,Me=10,Ne=u.object({refs:u.array(g).min(1).max(200),limitPerRef:u.number().int().min(1).max(100).default(10)}),Pe=u.object({executionId:u.string().min(1).optional(),status:M.optional(),limit:u.number().int().min(1).max(500).default(50)}).refine(e=>e.executionId!==void 0||e.status!==void 0,{message:`Either executionId or status is required.`}),F=u.enum([`station`,`delegate-agent`,`delegate-role`,`gate`]),Fe=u.enum([`station`]),Ie=u.object({input:u.number().int().nonnegative(),output:u.number().int().nonnegative(),cached:u.number().int().nonnegative().optional()}),Le=u.object({duration:u.number().nonnegative(),tokenUsage:Ie.optional(),estimatedCost:u.number().nonnegative().optional(),toolCalls:u.number().int().nonnegative().optional()}),Re=u.discriminatedUnion(`kind`,[u.object({kind:u.literal(`none`)}).strict(),u.object({kind:u.literal(`hmac`),secret:u.string().min(1)}).strict()]),ze=u.object({cwd:u.string().min(1),env:u.record(u.string(),u.string()).optional()}),Be=u.object({executionId:u.string().min(1),stepId:u.string().min(1),reason:u.string().optional()});function Ve(e){let t=e.indexOf(`.`);if(t<=0||t===e.length-1)throw Error(`Invalid step cancel subject: ${e}`);return{subject:e.slice(t+1),$meta:{namespace:e.slice(0,t),isRequest:!1,payload:{},local:!1,channel:!1}}}const He=u.object({executionId:u.string().min(1),reason:u.string().optional()});function Ue(e){let t=e.indexOf(`.`);if(t<=0||t===e.length-1)throw Error(`Invalid workflow cancel subject: ${e}`);return{subject:e.slice(t+1),$meta:{namespace:e.slice(0,t),isRequest:!1,payload:{},local:!1,channel:!1}}}const We=u.object({stepId:u.string().min(1),executionId:u.string().min(1),workflowId:u.string().min(1),coordinatorSessionId:u.string().min(1),stepType:Fe,stepDefinition:D,resolvedInputs:a,busUrl:u.string().optional(),busAuth:Re.default({kind:`none`}),platformDefaults:ze,cancelSubject:u.string().min(1)}).superRefine((e,t)=>{e.stepType!==e.stepDefinition.type&&t.addIssue({code:`custom`,path:[`stepDefinition`,`type`],message:`stepDefinition.type must match stepType (${e.stepType})`})}),Ge=`Workflow cancelled`,Ke=u.object({status:u.enum([`completed`,`failed`]),output:r.optional(),error:u.string().optional(),telemetry:Le}),qe=u.enum([`running`,`completed`,`failed`,`skipped`]),I=u.object({executionId:u.string().min(1),frameId:u.string().min(1),stepId:u.string().min(1),stepType:F,status:qe,startedAt:u.number().optional(),completedAt:u.number().optional(),durationMs:u.number().nonnegative().optional(),inputTokens:u.number().int().nonnegative().optional(),outputTokens:u.number().int().nonnegative().optional(),estimatedCost:u.number().nonnegative().optional(),toolCallCount:u.number().int().nonnegative().optional(),input:u.string().optional(),output:u.string().optional()}),Je=u.enum([`triggered-by`,`feedback-loop`,`rerun-of`]),L=u.object({sourceExecutionId:u.string().min(1),targetExecutionId:u.string().min(1),linkType:Je,metadata:u.record(u.string(),u.unknown()).optional()}),Ye=u.object({sourceExecutionId:u.string().min(1).optional(),targetExecutionId:u.string().min(1).optional()}).refine(e=>e.sourceExecutionId!==void 0||e.targetExecutionId!==void 0,{message:`Either sourceExecutionId or targetExecutionId is required.`}),Xe={RUN_CONTEXT_NOT_FOUND:`WORKFLOW_RUN_CONTEXT_NOT_FOUND`,SNAPSHOT_UNAVAILABLE:`WORKFLOW_SNAPSHOT_UNAVAILABLE`,SOURCE_MISMATCH:`WORKFLOW_SOURCE_MISMATCH`,NOT_EXECUTABLE:`WORKFLOW_NOT_EXECUTABLE`,HANDLER_UNAVAILABLE:`WORKFLOW_HANDLER_UNAVAILABLE`};var Ze=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`WorkflowError`}};const R=u.string().refine(e=>e===``||e.startsWith(`/`),{message:`JSON Patch paths must be empty or start with "/".`}),Qe=u.object({op:u.enum([`add`,`replace`,`test`]),path:R,value:r}).strict(),$e=u.object({op:u.literal(`remove`),path:R}).strict(),et=u.object({op:u.enum([`move`,`copy`]),path:R,from:R}).strict(),z=u.discriminatedUnion(`op`,[Qe,$e,et]),tt=u.object({type:u.literal(`artifact-query`),query:t,select:u.enum([`latest`,`all`]),optional:u.boolean().optional()}),nt=u.object({type:u.literal(`bus-request`),subject:u.string().min(1),payload:u.record(u.string(),u.unknown()).optional(),optional:u.boolean().optional()}),rt=u.discriminatedUnion(`type`,[tt,nt]),it=u.object({type:u.literal(`artifact`),kind:u.string().min(1),schemaVersion:u.string().min(1),scope:n,metadata:u.record(u.string(),u.unknown()).optional()}),at=u.object({type:u.literal(`bus-event`),subject:u.string().min(1),payload:u.record(u.string(),u.unknown()).optional()}),ot=u.discriminatedUnion(`type`,[it,at]),st=u.object({content:u.string(),metadata:u.record(u.string(),u.unknown()).optional()}),ct=u.object({sources:u.record(u.string(),st)}),lt=u.discriminatedUnion(`kind`,[u.object({kind:u.literal(`none`)}).strict(),u.object({kind:u.literal(`hmac`),secret:u.string().min(1)}).strict()]),B=u.discriminatedUnion(`kind`,[u.object({kind:u.literal(`path`),path:u.string().min(1)}).strict(),u.object({kind:u.literal(`source`),filename:u.string().min(1),source:u.string()}).strict(),u.object({kind:u.literal(`definition`),workflowId:u.string().min(1)}).strict()]),ut=u.object({source:B,definition:O.optional(),executionId:u.string().min(1),workflowId:u.string().min(1),triggerPayload:a.default({}),inputs:r.default({}),config:a.optional(),artifactRef:g.optional(),scope:b.default({type:`global`}),busUrl:u.string().optional(),busAuth:lt.default({kind:`none`}),context:u.object({repoPath:u.string().min(1),makaioHome:u.string().min(1),os:u.enum([`darwin`,`linux`,`win32`]),arch:u.string().min(1),worktree:u.string().optional()}),env:u.record(u.string(),u.string()).default({}),coordinatorSessionId:u.string().min(1),executionHints:h.optional(),cancelSubject:u.string().min(1),suspensionStrategy:m.default(`wait-in-process`)}),V=u.object({executionId:u.string().min(1),workflowId:u.string().min(1)}),dt=u.discriminatedUnion(`status`,[V.extend({status:u.literal(`completed`),artifact:e.optional()}).strict(),V.extend({status:u.literal(`failed`),error:u.string().min(1)}).strict(),V.extend({status:u.literal(`cancelled`),reason:u.string().min(1).optional()}).strict(),V.extend({status:u.literal(`paused`),pausedAtGateId:u.string().min(1),pausedAtFrameId:u.string().min(1)}).strict()]),ft=u.object({name:u.string().min(1),importPath:u.string().min(1)}),pt=u.object({packages:u.array(ft).default([])}),mt=u.object({executionId:u.string().min(1),workflowId:u.string().min(1),source:B,definitionSnapshot:O.optional(),workerManifest:pt.default({packages:[]}),inputs:r.default({}),config:a.optional(),scope:b.default({type:`global`}),triggerPayload:a.default({}),artifactRef:g.optional(),coordinatorSessionId:u.string().min(1),executionHints:h.optional(),dispatchMetadata:a.optional(),cancelSubject:u.string().min(1),context:u.object({repoPath:u.string().min(1),makaioHome:u.string().min(1),os:u.enum([`darwin`,`linux`,`win32`]),arch:u.string().min(1),worktree:u.string().optional()}),env:u.record(u.string(),u.string()).default({}),createdAt:u.number(),suspensionStrategy:m.default(`wait-in-process`)}).superRefine((e,t)=>{e.source.kind===`definition`&&e.definitionSnapshot===void 0&&t.addIssue({code:u.ZodIssueCode.custom,path:[`definitionSnapshot`],message:`definitionSnapshot is required when source.kind is "definition"`})}),H=u.object({executionId:u.string().min(1),workflowId:u.string().min(1),workflowName:u.string().optional(),status:u.enum([`pending`,`running`,`paused`,`completed`,`failed`,`cancelled`]),startedAt:u.number(),completedAt:u.number().optional(),durationMs:u.number().nonnegative().optional(),totalInputTokens:u.number().int().nonnegative().optional(),totalOutputTokens:u.number().int().nonnegative().optional(),totalEstimatedCost:u.number().nonnegative().optional(),error:u.string().optional(),failedNodeId:u.string().optional()}),ht=u.object({executionId:u.string().min(1),frameId:u.string().min(1),nodeId:u.string().min(1),nodeType:C,path:u.array(u.string()),status:u.enum([`pending`,`running`,`waiting`,`completed`,`failed`,`skipped`,`cancelled`]),attempt:u.number().int().nonnegative(),iteration:u.number().int().nonnegative().optional(),branchKey:u.string().optional(),startedAt:u.number().optional(),completedAt:u.number().optional(),durationMs:u.number().nonnegative().optional(),inputTokens:u.number().int().nonnegative().optional(),outputTokens:u.number().int().nonnegative().optional(),estimatedCost:u.number().nonnegative().optional(),error:u.string().optional()}),gt=u.object({executionId:u.string().min(1),frameId:u.string().min(1),nodeId:u.string().min(1),artifact:S,revision:u.string().min(1).optional(),writtenAt:u.number()}),_t=u.object({executionId:u.string().min(1),nodeId:u.string().min(1),frameId:u.string().min(1),status:u.enum([`waiting`,`resumed`,`rejected`,`timed-out`,`cancelled`]),prompt:u.string().optional(),openedAt:u.number(),resolvedAt:u.number().optional(),resumeData:r.optional()}),vt=u.object({executionId:u.string().min(1),inputTokens:u.number().int().nonnegative(),outputTokens:u.number().int().nonnegative(),cachedTokens:u.number().int().nonnegative().optional(),estimatedCost:u.number().nonnegative(),byModel:u.record(u.string(),u.object({inputTokens:u.number().int().nonnegative(),outputTokens:u.number().int().nonnegative(),estimatedCost:u.number().nonnegative()})).optional()}),yt=u.object({total:u.number().int().nonnegative(),byStatus:u.object({pending:u.number().int().nonnegative(),running:u.number().int().nonnegative(),paused:u.number().int().nonnegative(),completed:u.number().int().nonnegative(),failed:u.number().int().nonnegative(),cancelled:u.number().int().nonnegative()}),totalDurationMs:u.number().nonnegative(),totalInputTokens:u.number().int().nonnegative(),totalOutputTokens:u.number().int().nonnegative(),totalEstimatedCost:u.number().nonnegative()}),bt=u.object({executionId:u.string().min(1),frameId:u.string().min(1),factoryId:u.string().min(1),materializedNodeIds:u.array(u.string().min(1)),factoryInput:i.optional(),materializedAt:u.number()}),xt=`wfx-ext-`,St=u.object({frameId:u.string().min(1).optional(),nodeId:u.string().min(1),nodeType:F,path:u.array(u.string().min(1)).optional(),attempt:u.number().int().nonnegative().default(0),iteration:u.number().int().nonnegative().optional(),branchKey:u.string().min(1).optional(),startedAt:u.number().int().nonnegative().optional()}).strict(),Ct=u.object({frameId:u.string().min(1),nodeId:u.string().min(1),nodeType:F,path:u.array(u.string().min(1)),attempt:u.number().int().nonnegative().default(0),iteration:u.number().int().nonnegative().optional(),branchKey:u.string().min(1).optional(),startedAt:u.number().int().nonnegative(),durationMs:u.number().int().nonnegative().optional()}).strict(),wt=u.object({executionId:u.string().startsWith(xt,{message:`executionId must use the wfx-ext- prefix`}).optional(),name:u.string().min(1),startedAt:u.number().int().nonnegative().optional(),scope:b.optional(),artifactRef:g.optional(),input:r.optional(),triggerPayload:a.optional(),frame:St.optional()}).superRefine((e,t)=>{e.executionId!==void 0&&e.startedAt===void 0&&t.addIssue({code:u.ZodIssueCode.custom,message:`startedAt is required when executionId is supplied`,path:[`startedAt`]})}),Tt=u.object({executionId:u.string().min(1),status:u.enum([`completed`,`failed`,`cancelled`]),error:u.string().min(1).optional(),reason:u.string().min(1).optional(),completedAt:u.number().nonnegative().overwrite(e=>Math.trunc(e)).optional(),frame:Ct.optional()}).superRefine((e,t)=>{if(e.status===`failed`&&e.error===void 0&&t.addIssue({code:u.ZodIssueCode.custom,message:`status 'failed' requires a non-empty 'error' message`,path:[`error`]}),e.status===`cancelled`&&e.reason===void 0&&t.addIssue({code:u.ZodIssueCode.custom,message:`status 'cancelled' requires a non-empty 'reason' string`,path:[`reason`]}),e.status===`completed`&&e.error!==void 0&&t.addIssue({code:u.ZodIssueCode.custom,message:`status 'completed' must not carry an 'error'`,path:[`error`]}),e.status===`completed`&&e.reason!==void 0&&t.addIssue({code:u.ZodIssueCode.custom,message:`status 'completed' must not carry a 'reason'`,path:[`reason`]}),e.frame!==void 0&&e.completedAt===void 0&&t.addIssue({code:u.ZodIssueCode.custom,message:`completedAt is required when frame metadata is supplied`,path:[`completedAt`]}),e.frame!==void 0&&e.completedAt!==void 0){let n=e.completedAt-e.frame.startedAt;n<0&&t.addIssue({code:u.ZodIssueCode.custom,message:`completedAt must not precede frame.startedAt`,path:[`completedAt`]}),e.frame.durationMs!==void 0&&e.frame.durationMs!==n&&t.addIssue({code:u.ZodIssueCode.custom,message:`frame.durationMs must equal completedAt - frame.startedAt`,path:[`frame`,`durationMs`]})}}),Et=u.object({message:u.string().min(1),details:u.string().min(1).optional(),kind:u.string().min(1).optional(),metadata:r.optional()}).strict(),U=u.object({executionId:u.string(),stepId:u.string(),stepType:u.enum([`station`,`delegate-agent`,`delegate-role`,`gate`])}),W=U.extend({stepType:u.literal(`gate`)}),Dt=u.discriminatedUnion(`source`,[W.extend({frameId:u.string(),action:u.enum([`approve`,`reject`]),source:u.literal(`user`),reason:u.string().optional()}),W.extend({frameId:u.string(),action:u.enum([`approve`,`reject`]),source:u.literal(`timeout`)}),W.extend({frameId:u.string(),source:u.literal(`cancelled`)})]),Ot=W.extend({workflowId:u.string(),workflowName:u.string(),title:u.string(),message:u.string(),autoAction:u.enum([`approve`,`reject`]),timeoutMs:u.number().nullable(),openedAt:u.number()}),kt={getDefinition:{request:u.object({id:u.string()}),response:u.object({workflow:O.nullable()})},setDefinition:{request:u.object({workflow:O}),response:u.object({id:u.string()})},deleteDefinition:{request:u.object({id:u.string()}),response:u.object({deleted:u.boolean()})},listDefinitions:{request:we,response:u.object({workflows:u.array(O)})},"definition.created":O,"definition.updated":O,"definition.deleted":u.object({id:u.string()}),start:{request:u.object({workflowId:u.string(),input:r.optional(),config:r.optional(),artifactRef:g.optional(),scope:b.optional(),executionHints:h.optional(),parentSessionId:u.string().optional(),triggerPayload:a.optional()}),response:u.object({executionId:u.string()})},rerun:{request:u.object({executionId:u.string().min(1),mode:u.enum([`snapshot`,`current`]),input:r.optional(),config:r.optional(),artifactRef:g.optional(),scope:b.optional(),executionHints:h.optional(),parentSessionId:u.string().optional(),triggerPayload:a.optional(),reason:u.string().min(1).optional()}),response:u.object({executionId:u.string()})},cancel:{request:u.object({executionId:u.string(),reason:u.string().optional()}),response:u.object({cancelled:u.boolean()})},getExecution:{request:u.object({executionId:u.string()}),response:u.object({execution:A.nullable()})},listExecutions:{request:ke,response:u.object({executions:u.array(A)})},listExecutionsByArtifactRefs:{request:Ne,response:u.object({executionsByRef:u.record(u.string(),u.array(A))})},listSpans:{request:u.object({executionId:u.string()}),response:u.object({spans:u.array(I)})},listGateInstances:{request:Pe,response:u.object({gates:u.array(N)})},setExecutionLink:{request:u.object({link:L}),response:u.object({id:u.string()})},listExecutionLinks:{request:Ye,response:u.object({links:u.array(L)})},listFrames:{request:u.object({executionId:u.string().min(1)}),response:u.object({frames:u.array(j)})},listTriggerTypes:{request:u.object({}),response:u.object({triggerTypes:u.array(u.object({type:u.string(),displayName:u.string(),icon:u.string(),category:u.string(),description:u.string().optional(),configJsonSchema:i,outputJsonSchema:i,source:u.string()}))})},runFile:{request:u.object({filePath:u.string().min(1),triggerPayload:a.optional(),scope:b.optional()}),response:u.object({executionId:u.string()})},registerExternalExecution:{request:wt,response:u.object({executionId:u.string(),frameId:u.string().optional()})},completeExternalExecution:{request:Tt,response:u.object({success:u.boolean()})},resolveRole:{request:u.object({roleId:u.string().min(1)}),response:P},resolveAgent:{request:u.object({agentId:u.string().min(1)}),response:Ce},getRunContext:{request:u.object({executionId:u.string().min(1)}),response:mt},"execution.started":u.object({executionId:u.string(),workflowId:u.string(),coordinatorSessionId:u.string().optional(),startedAt:u.number().nonnegative().optional(),artifactRef:g.optional()}),"execution.completed":u.object({executionId:u.string(),workflowId:u.string(),totalDuration:u.number(),completedAt:u.number().nonnegative().optional()}),"execution.failed":u.object({executionId:u.string(),workflowId:u.string(),error:u.string(),failedStepId:u.string().optional(),completedAt:u.number().nonnegative().optional()}),"execution.cancelled":u.object({executionId:u.string(),workflowId:u.string(),reason:u.string().optional(),completedAt:u.number().nonnegative().optional()}),"execution.progress":u.object({executionId:u.string().min(1),workflowId:u.string().min(1),frameId:u.string().min(1),nodeId:u.string().min(1),progress:Et,emittedAt:u.number().int().nonnegative()}),"execution.paused":p.schema(u.object({executionId:u.string(),workflowId:u.string(),pausedAtGateId:u.string().min(1),pausedAtFrameId:u.string().min(1)}),{traceAll:!0}),"step.beforeStart":U,"step.started":U.extend({sessionId:u.string().optional(),subagentId:u.string().optional()}),"step.completed":U.extend({result:r.optional(),duration:u.number()}),"step.failed":U.extend({error:u.string()}),"step.skipped":U.extend({reason:u.string().optional(),condition:u.string().optional()}),"gate.requested":Ot,"gate.awaitApproval":{request:Ot,response:u.object({action:u.enum([`approve`,`reject`]),source:u.enum([`user`,`timeout`]),reason:u.string().optional()})},"gate.respond":{request:u.object({executionId:u.string(),gateId:u.string(),action:u.enum([`approve`,`reject`]),frameId:u.string().optional(),resumeData:r,reason:u.string().optional()}),response:u.object({accepted:u.boolean()})},"gate.resolved":Dt,"frame.started":u.object({executionId:u.string(),frameId:u.string(),nodeId:u.string(),nodeType:C,path:u.array(u.string()),parentFrameId:u.string().optional(),startedAt:u.number().nonnegative().optional()}),"frame.completed":u.object({executionId:u.string(),frameId:u.string(),nodeId:u.string(),output:r.optional(),duration:u.number().nonnegative().optional(),completedAt:u.number().nonnegative().optional()}),"frame.failed":u.object({executionId:u.string(),frameId:u.string(),nodeId:u.string(),error:u.string(),duration:u.number().nonnegative().optional(),completedAt:u.number().nonnegative().optional()}),"frame.sessionLinked":u.object({executionId:p.attribute(u.string(),`makaio.execution.id`),frameId:p.attribute(u.string(),`makaio.frame.id`),sessionId:p.attribute(u.string(),`makaio.session.id`)}).strict(),"gate.suspended":u.object({executionId:u.string(),frameId:u.string(),nodeId:u.string(),schema:i,prompt:u.string().optional(),title:u.string().optional(),autoAction:u.enum([`approve`,`reject`]),timeoutMs:u.number().nullable(),openedAt:u.number()}),"gate.resumed":u.object({executionId:u.string(),frameId:u.string(),nodeId:u.string(),resumeData:r}),"dynamic.materialized":u.object({executionId:u.string(),frameId:u.string(),factoryId:u.string().min(1),materializedNodes:u.number().int().nonnegative()}),"artifact.updated":u.object({executionId:u.string(),frameId:u.string(),artifactRef:u.object({kind:u.string().min(1),id:u.string().min(1)}),paths:u.array(u.string()),operation:u.string().min(1),revision:u.string().min(1).optional()}),"worklog.get":{request:u.object({executionId:u.string().min(1)}),response:u.object({summary:H.nullable()})},"worklog.frame.get":{request:u.object({frameId:u.string().min(1)}),response:u.object({frame:ht.nullable()})},"worklog.list":{request:u.object({workflowId:u.string().min(1).optional(),status:k.optional(),limit:u.number().int().positive().optional(),offset:u.number().int().nonnegative().optional()}),response:u.object({items:u.array(H),total:u.number().int().nonnegative()})},"worklog.stats":{request:u.object({workflowId:u.string().min(1).optional(),since:u.number().int().nonnegative().optional(),until:u.number().int().nonnegative().optional()}),response:u.object({stats:yt})},"worklog.changed":u.object({executionId:u.string().min(1)}),"state.get":{request:u.object({executionId:u.string().min(1)}),response:u.object({executionId:u.string().min(1),sequence:u.number().int().nonnegative(),value:r})},"state.patch":{request:u.object({executionId:u.string().min(1),expectedSequence:u.number().int().nonnegative(),patch:u.array(z),nextValue:r}),response:u.object({executionId:u.string().min(1),sequence:u.number().int().positive(),value:r})},"state.updated":u.object({executionId:u.string().min(1),sequence:u.number().int().positive(),patch:u.array(z),value:r,updatedAt:u.number().int().positive()})},At=d(`workflow`,kt),jt=At.subjects;function Mt(e,t){G(e,t,void 0,0,[],`root`,void 0,void 0)}function G(e,t,n,r,i,a,o,s){let c={parent:n,depth:r,ancestors:i,relationship:a,...o!==void 0&&{index:o},...s!==void 0&&{branchKey:s}};if(t.enter?.(e,c)===!1)return;let l=[...i,e.id],u=r+1;switch(e.type){case`sequence`:{let n=e;for(let r=0;r<n.nodes.length;r++)G(n.nodes[r],t,e,u,l,`sequence-child`,r,void 0);break}case`parallel`:{let n=e;for(let[r,i]of Object.entries(n.branches))G(i,t,e,u,l,`parallel-branch`,void 0,r);break}case`iterate`:G(e.body,t,e,u,l,`iterate-body`,void 0,void 0);break;case`iterate-chain`:G(e.body,t,e,u,l,`iterate-chain-body`,void 0,void 0);break;case`loop`:G(e.body,t,e,u,l,`loop-body`,void 0,void 0);break}t.leave?.(e,c)}function Nt(e){switch(e){case`station`:case`delegate-agent`:case`delegate-role`:case`gate`:return`leaf`;case`parallel`:case`iterate`:case`iterate-chain`:case`loop`:return`control`;case`sequence`:return`structural`}}function Pt(e,t,n){return e===`parallel-branch`&&t!==void 0?[{kind:`branch`,key:t}]:e===`sequence-child`&&n!==void 0?[{kind:`index`,value:n}]:e===`iterate-body`||e===`iterate-chain-body`||e===`loop-body`?[{kind:`body`}]:[]}function Ft(e){return e.replace(/\\/g,`\\\\`).replace(/\//g,`\\/`)}function It(e){return e.map(e=>{switch(e.kind){case`node`:return`n:${Ft(e.id)}`;case`branch`:return`b:${Ft(e.key)}`;case`index`:return`i:${e.value}`;case`body`:return`body`}}).join(`/`)}function Lt(e){let t=[],n=[],r=new Map,i=[],a=[],o=[];return Mt(e.root,{enter(e,s){let c=Pt(s.relationship,s.branchKey,s.index),l={kind:`node`,id:e.id};i.push(...c,l),o.push(c.length+1);let u=[...i],d=It(u),f=a.at(-1);if(t.push({key:d,nodeId:e.id,type:e.type,role:Nt(e.type),path:u,parentKey:f,...s.branchKey!==void 0&&{branchKey:s.branchKey}}),f!==void 0&&s.parent!==void 0)switch(s.parent.type){case`sequence`:{n.push({sourceKey:f,targetKey:d,kind:`contains`});let e=r.get(f);e!==void 0&&n.push({sourceKey:e,targetKey:d,kind:`sequence`}),r.set(f,d);break}case`parallel`:n.push({sourceKey:f,targetKey:d,kind:`branch`});break;case`iterate`:case`iterate-chain`:case`loop`:n.push({sourceKey:f,targetKey:d,kind:`body`});break;default:n.push({sourceKey:f,targetKey:d,kind:`contains`});break}a.push(d)},leave(){let e=o.pop()??0;i.splice(i.length-e,e),a.pop()}}),{nodes:t,edges:n}}function K(e){return q(e.body.nodes,e.id)}function q(e,t){for(let n of e){if(n.type===`loop`)return`Nested loop '${n.id}' found inside loop '${t}' — V1 does not support nested loops`;if(n.type===`sequence`){let e=q(n.nodes,t);if(e)return e}if(n.type===`parallel`)for(let e of Object.values(n.branches)){let n=q(e.nodes,t);if(n)return n}if(n.type===`iterate`||n.type===`iterate-chain`){let e=n.body,r=q(e.nodes,t);if(r)return r}}}const J=new WeakMap,Rt=new WeakMap;function Y(e){let{$schema:t,...n}=u.toJSONSchema(e);return n}function X(e,t,n){let r=J.get(e);if(r!==void 0&&t.set(e.id,r),e.type===`sequence`)for(let r of e.nodes)X(r,t,n);else if(e.type===`parallel`)for(let r of Object.values(e.branches))X(r,t,n);else if(e.type===`iterate`)X(e.body,t,n);else if(e.type===`iterate-chain`)X(e.body,t,n);else if(e.type===`loop`){if(n!==void 0){let t=Rt.get(e);t!==void 0&&n.set(e.gate.handler,t)}X(e.body,t,n)}}function zt(e,t,n){let r={id:e,type:`station`,prompt:e,...n?.when!==void 0&&{when:n.when},...n?.skip!==void 0&&{skip:n.skip}};return J.set(r,t),r}function Bt(e,t,n){return{id:e,type:`delegate-agent`,agentId:t.agentId,...t.inputExpression!==void 0&&{inputExpression:t.inputExpression},...t.outputSchema!==void 0&&{outputSchema:t.outputSchema},...n?.when!==void 0&&{when:n.when},...n?.skip!==void 0&&{skip:n.skip}}}function Vt(e,t,n){return{id:e,type:`delegate-role`,role:t,prompt:n?.prompt??e,...n?.when!==void 0&&{when:n.when},...n?.skip!==void 0&&{skip:n.skip},...n?.outputSchema!==void 0&&{outputSchema:n.outputSchema},...n?.timeoutMs!==void 0&&{timeoutMs:n.timeoutMs},...n?.completion!==void 0&&{completion:n.completion}}}function Ht(e,t){return{id:e,type:`gate`,prompt:t.prompt,autoAction:t.autoAction,timeoutMs:t.timeoutMs,...t.title!==void 0&&{title:t.title},...t.resume!==void 0&&{resumeSchema:Y(t.resume)}}}function Ut(e,t,n){let r=`${e}__item`,i={id:r,type:`station`,prompt:r},a={id:e,type:`iterate`,collection:n.collection,body:{id:`${e}__body`,type:`sequence`,nodes:[i]},...n.concurrency!==void 0&&{concurrency:n.concurrency},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}};return J.set(i,t),a}function Wt(e,t,n){return{id:e,type:`iterate-chain`,collection:n.collection,body:{id:`${e}__body`,type:`sequence`,nodes:t},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}}}function Gt(e,t,n){let r={id:e,type:`loop`,maxRounds:n.maxRounds,body:{id:`${e}__body`,type:`sequence`,nodes:t},gate:Kt(n),...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}},i=K(r);if(i!==void 0)throw Error(i);return Rt.set(r,n.gate.evaluate),r}function Kt(e){let t=e.gate.escalation;return{handler:e.gate.handler,...e.gate.input!==void 0&&{input:e.gate.input},...e.gate.config!==void 0&&{config:e.gate.config},...t!==void 0&&{escalation:{prompt:t.prompt,autoAction:t.autoAction??`reject`,timeoutMs:t.timeoutMs??null,...t.title!==void 0&&{title:t.title},...t.resumeSchema!==void 0&&{resumeSchema:t.resumeSchema}}}}}function qt(e){return{type:`bus-event`,subject:f(e.subject),...e.filter!==void 0&&{filter:e.filter},...e.filterExpression!==void 0&&{filterExpression:e.filterExpression}}}function Jt(){return{type:`manual`}}function Yt(e){return{type:`cron`,schedule:e.schedule,...e.timezone!==void 0&&{timezone:e.timezone}}}function Xt(e){return{type:`webhook`,event:e.event,...e.branch!==void 0&&{branch:e.branch},...e.repo!==void 0&&{repo:e.repo}}}function Zt(e){return{type:`extension`,extensionType:e.extensionType,...e.config!==void 0&&{config:e.config}}}function Z(e,t){if(e.has(t))throw Error(`Duplicate step ID: ${t}`);e.add(t)}function Q(e,t){if(Z(e,t.id),t.type===`sequence`)for(let n of t.nodes)Q(e,n);else if(t.type===`parallel`)for(let n of Object.values(t.branches))Q(e,n);else (t.type===`iterate`||t.type===`iterate-chain`||t.type===`loop`)&&Q(e,t.body)}function Qt(e,t,n,r,i){let a={};return t.forEach((t,o)=>{if(t.id.length===0)throw Error(`parallel branch at index ${o} has an empty ID`);let s=t.id,c=`${e}__${s}`;Q(n,t),Z(n,c),X(t,r,i),a[s]={id:c,type:`sequence`,nodes:[t]}}),a}function $t(e,t,n,r,i){let a=`${e}__body`,o=`${e}__item`;Z(r,a),Z(r,o),i.set(o,t);let s={id:o,type:`station`,prompt:o};return{id:e,type:`iterate`,collection:n.collection,body:{id:a,type:`sequence`,nodes:[s]},...n.concurrency!==void 0&&{concurrency:n.concurrency},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}}}function en(e,t,n){return t.resume!==void 0&&(n[e]=t.resume),{id:e,type:`gate`,prompt:t.prompt,autoAction:t.autoAction,timeoutMs:t.timeoutMs,...t.title!==void 0&&{title:t.title},...t.resume!==void 0&&{resumeSchema:Y(t.resume)}}}function tn(e,t,n,r,i,a){let o=`${e}__body`;Z(r,o);for(let e of t)Q(r,e),X(e,i,a);return{id:e,type:`iterate-chain`,collection:n.collection,body:{id:o,type:`sequence`,nodes:t},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}}}function nn(e,t,n,r,i,a){let o=`${e}__body`;Z(r,o);for(let e of t)Q(r,e),X(e,i,a);let s={id:e,type:`loop`,maxRounds:n.maxRounds,body:{id:o,type:`sequence`,nodes:t},gate:Kt(n),...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}},c=K(s);if(c!==void 0)throw Error(c);return a.set(n.gate.handler,n.gate.evaluate),s}function rn(e,t){e.input=n=>(t.zodSchemas.input=n,t.definition.inputSchema=Y(n),e),e.config=n=>(t.zodSchemas.config=n,t.definition.configSchema=Y(n),e),e.output=n=>(t.zodSchemas.output=n,t.definition.outputSchema=Y(n),e),e.artifact=n=>(n.schema!==void 0&&(t.zodSchemas.artifact=n.schema),t.definition.artifact={kind:n.kind,schemaVersion:n.schemaVersion,scope:n.scope,...n.resolve!==void 0&&{resolve:n.resolve},...n.create!==void 0&&{create:n.create},...n.statusPath!==void 0&&{statusPath:n.statusPath}},e),e.state=e=>(t.definition.state={schema:e.schema,...e.initial!==void 0&&{initial:e.initial}},$(t))}function an(e,t){let{rootNodes:n,runtimeHandlers:r,runtimeLoopGates:i,registeredIds:a,zodGates:o}=t;e.station=(t,i,o)=>(Z(a,t),n.push({id:t,type:`station`,prompt:t,...o?.when!==void 0&&{when:o.when},...o?.skip!==void 0&&{skip:o.skip}}),r.set(t,i),e),e.delegateToAgent=(t,r,i)=>{Z(a,t);let o={id:t,type:`delegate-agent`,agentId:r.agentId,...r.inputExpression!==void 0&&{inputExpression:r.inputExpression},...r.outputSchema!==void 0&&{outputSchema:r.outputSchema},...i?.when!==void 0&&{when:i.when},...i?.skip!==void 0&&{skip:i.skip}};return n.push(o),e},e.delegateToRole=(t,r,i)=>(Z(a,t),n.push({id:t,type:`delegate-role`,role:r,prompt:i?.prompt??t,...i?.when!==void 0&&{when:i.when},...i?.skip!==void 0&&{skip:i.skip},...i?.outputSchema!==void 0&&{outputSchema:i.outputSchema},...i?.timeoutMs!==void 0&&{timeoutMs:i.timeoutMs},...i?.completion!==void 0&&{completion:i.completion}}),e),e.parallel=(t,o,s)=>(Z(a,t),n.push({id:t,type:`parallel`,mode:o.mode??`all-settled`,branches:Qt(t,s,a,r,i),...o.when!==void 0&&{when:o.when},...o.skip!==void 0&&{skip:o.skip}}),e),e.gate=(t,r)=>(Z(a,t),n.push(en(t,r,o)),e),e.iterate=(t,i,o)=>(Z(a,t),n.push($t(t,i,o,a,r)),e),e.iterateChain=(t,o,s)=>(Z(a,t),n.push(tn(t,o,s,a,r,i)),e),e.loop=(t,o,s)=>(Z(a,t),n.push(nn(t,o,s,a,r,i)),e),e.addNode=e=>on(e,a,r,i,n)}function on(e,t,n,r,i){Q(t,e),X(e,n,r),i.push(e)}function $(e){let t={id:e.definition.id,definition:e.definition,runtimeHandlers:e.runtimeHandlers,runtimeFactories:e.runtimeFactories,runtimeLoopGates:e.runtimeLoopGates,source:void 0,get zodSchemas(){return e.zodSchemas},addTrigger(t){return e.triggers.push(t),$(e)}};return rn(t,e),an(t,e),t}function sn(e,t){let n=[],r=new Map,i=new Map,a=new Set,o={},s={gates:o},c=new Map,l=t?.triggers?[...t.triggers]:[];return $({rootNodes:n,runtimeHandlers:r,runtimeFactories:c,runtimeLoopGates:i,registeredIds:a,zodGates:o,zodSchemas:s,definition:{id:e,...t?.name!==void 0&&{name:t.name},...t?.description!==void 0&&{description:t.description},root:{id:`${e}__root`,type:`sequence`,nodes:n},triggers:l,scope:{type:`global`}},triggers:l})}function cn(e){if(e.workflows.length===0)throw Error(`defineWorkflowBundle: workflows must not be empty`);return{workflows:Object.freeze([...e.workflows])}}const ln=u.enum([`artifact.created`,`artifact.revised`,`artifact.status.changed`]),un=u.record(u.string(),r),dn=u.object({type:u.string().min(1),input:u.record(u.string(),r).optional(),executionHints:h.optional()}),fn=u.object({id:u.string().min(1),description:u.string().optional(),on:ln,when:un.optional(),action:dn,enabled:u.boolean().default(!0)});export{st as $,w as $t,St as A,k as At,pt as B,fe as Bt,At as C,je as Ct,Tt as D,Ee as Dt,jt as E,De as Et,ht as F,S as Ft,B as G,j as Gt,dt as H,be as Ht,_t as I,le as It,at as J,M as Jt,it as K,N as Kt,yt as L,x as Lt,gt as M,v as Mt,bt as N,Pe as Nt,xt as O,Te as Ot,H as P,ve as Pt,rt as Q,ye as Qt,vt as R,xe as Rt,Mt as S,Me as St,kt as T,Oe as Tt,lt as U,A as Ut,ft as V,pe as Vt,ut as W,b as Wt,ct as X,ge as Xt,nt as Y,_e as Yt,ot as Z,we as Zt,Gt as _,Fe as _t,cn as a,P as an,Je as at,K as b,Ue as bt,Yt as c,Se as cn,Be as ct,Xt as d,g as dn,Re as dt,T as en,z as et,Bt as f,ne as fn,ze as ft,Wt as g,m as gn,He as gt,Ut as h,ee as hn,Ge as ht,fn as i,Ce as in,L as it,wt as j,Ne as jt,Ct as k,ke as kt,Zt as l,D as ln,We as lt,Ht as m,h as mn,Ie as mt,un as n,de as nn,Xe as nt,sn as o,E as on,I as ot,Vt as p,te as pn,Le as pt,tt as q,he as qt,ln as r,me as rn,Ye as rt,qt as s,ue as sn,qe as st,dn as t,C as tn,Ze as tt,Jt as u,y as un,Ke as ut,zt as v,F as vt,Et as w,Ae as wt,Lt as x,ce as xt,Y as y,Ve as yt,mt as z,O as zt};
|