@makaio/framework 1.0.0-dev-1783615060726 → 1.0.0-dev-1783705652236
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 +186 -8
- package/dist/adapters/index.mjs +6 -6
- 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/extension/index.d.mts +2 -2
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/index.d.mts +97 -45
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/session/index.d.mts +3 -3
- package/dist/contracts/session/index.mjs +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-BbQpQ1N3.d.mts → index-B2DjrVb8.d.mts} +84 -0
- package/dist/{index-DWu3qrwe.d.mts → index-B9d_8_V2.d.mts} +8 -8
- package/dist/{index-2fK9iSHI.d.mts → index-BWIkf5oJ.d.mts} +6 -6
- package/dist/{index-BSprsrul.d.mts → index-BcvG3wPv.d.mts} +96 -57
- package/dist/{index-CqCe7Phc.d.mts → index-BcwOnvUh.d.mts} +6 -6
- package/dist/{index-Qd1Qom8M.d.mts → index-D6aAzr32.d.mts} +4 -4
- package/dist/{index-D8wmMJLi.d.mts → index-DScUb-hF.d.mts} +1 -1
- package/dist/{index-DKaEpPFS.d.mts → index-DnnKUwHm.d.mts} +5 -5
- package/dist/{index-S7lj2TLp.d.mts → index-FFVwQMad.d.mts} +440 -60
- package/dist/{index-BMbmoarE.d.mts → index-O08Q2ikz.d.mts} +8 -8
- package/dist/{index-DZ14azod.d.mts → index-PIlYSC73.d.mts} +160 -1
- package/dist/loop-gate-handlers-o2B5FPdF.mjs +1 -0
- package/dist/{namespace-DuUCiVmK.d.mts → namespace-B4cV_pk3.d.mts} +6 -6
- package/dist/{namespace-Ceg3zkt2.d.mts → namespace-BGIeqwfU.d.mts} +20 -20
- package/dist/{namespace-Dc94fHZW.d.mts → namespace-D9PLFmPQ.d.mts} +9 -9
- 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-D512XweP.d.mts → schemas-CJ2JvA7d.d.mts} +3 -3
- package/dist/schemas-CVo8qAK-.mjs +1 -0
- package/dist/services/adapter-subsystem/index.d.mts +2 -2
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/execution-target/index.d.mts +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/index.d.mts +14 -14
- package/dist/services/session/index.d.mts +4 -4
- 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/settings/namespace.d.mts +3 -3
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- 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-BrUOVfwe.d.mts} +26 -2
- package/dist/{types-Dhou-Itn.d.mts → types-CBLPaQXe.d.mts} +36 -22
- package/dist/workflow-C3dgVwTY.mjs +1 -0
- package/dist/workflow-engine/index.d.mts +289 -21
- 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
|
@@ -32,8 +32,8 @@ declare const FacetCardinalitySchema: z.ZodEnum<{
|
|
|
32
32
|
* - `'surface'` — a UI surface or layout area
|
|
33
33
|
*/
|
|
34
34
|
declare const FacetAppliesToSchema: z.ZodEnum<{
|
|
35
|
-
artifact: "artifact";
|
|
36
35
|
workpiece: "workpiece";
|
|
36
|
+
artifact: "artifact";
|
|
37
37
|
surface: "surface";
|
|
38
38
|
}>;
|
|
39
39
|
/**
|
|
@@ -57,8 +57,8 @@ declare const FacetNamespaceRegistrationSchema: z.ZodObject<{
|
|
|
57
57
|
human: "human";
|
|
58
58
|
}>>>;
|
|
59
59
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
60
|
-
artifact: "artifact";
|
|
61
60
|
workpiece: "workpiece";
|
|
61
|
+
artifact: "artifact";
|
|
62
62
|
surface: "surface";
|
|
63
63
|
}>>>;
|
|
64
64
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -161,8 +161,8 @@ declare const FacetSchemas: {
|
|
|
161
161
|
human: "human";
|
|
162
162
|
}>>>;
|
|
163
163
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
164
|
-
artifact: "artifact";
|
|
165
164
|
workpiece: "workpiece";
|
|
165
|
+
artifact: "artifact";
|
|
166
166
|
surface: "surface";
|
|
167
167
|
}>>>;
|
|
168
168
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -189,8 +189,8 @@ declare const FacetSchemas: {
|
|
|
189
189
|
human: "human";
|
|
190
190
|
}>>>;
|
|
191
191
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
192
|
-
artifact: "artifact";
|
|
193
192
|
workpiece: "workpiece";
|
|
193
|
+
artifact: "artifact";
|
|
194
194
|
surface: "surface";
|
|
195
195
|
}>>>;
|
|
196
196
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -227,8 +227,8 @@ declare const FacetNamespace: _$_makaio_core0.BusNamespaceDefinition<"facet", {
|
|
|
227
227
|
human: "human";
|
|
228
228
|
}>>>;
|
|
229
229
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
230
|
-
artifact: "artifact";
|
|
231
230
|
workpiece: "workpiece";
|
|
231
|
+
artifact: "artifact";
|
|
232
232
|
surface: "surface";
|
|
233
233
|
}>>>;
|
|
234
234
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -255,8 +255,8 @@ declare const FacetNamespace: _$_makaio_core0.BusNamespaceDefinition<"facet", {
|
|
|
255
255
|
human: "human";
|
|
256
256
|
}>>>;
|
|
257
257
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
258
|
-
artifact: "artifact";
|
|
259
258
|
workpiece: "workpiece";
|
|
259
|
+
artifact: "artifact";
|
|
260
260
|
surface: "surface";
|
|
261
261
|
}>>>;
|
|
262
262
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -299,8 +299,8 @@ declare const FacetSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSub
|
|
|
299
299
|
human: "human";
|
|
300
300
|
}>>>;
|
|
301
301
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
302
|
-
artifact: "artifact";
|
|
303
302
|
workpiece: "workpiece";
|
|
303
|
+
artifact: "artifact";
|
|
304
304
|
surface: "surface";
|
|
305
305
|
}>>>;
|
|
306
306
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -327,8 +327,8 @@ declare const FacetSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSub
|
|
|
327
327
|
human: "human";
|
|
328
328
|
}>>>;
|
|
329
329
|
appliesTo: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
330
|
-
artifact: "artifact";
|
|
331
330
|
workpiece: "workpiece";
|
|
331
|
+
artifact: "artifact";
|
|
332
332
|
surface: "surface";
|
|
333
333
|
}>>>;
|
|
334
334
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -458,6 +458,40 @@ declare const ClientSchemas: {
|
|
|
458
458
|
}, z.core.$strip>;
|
|
459
459
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
460
460
|
}, z.core.$strip>;
|
|
461
|
+
'session.usage.snapshot': z.ZodObject<{
|
|
462
|
+
clientId: z.ZodString;
|
|
463
|
+
clientAccountId: z.ZodOptional<z.ZodString>;
|
|
464
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
465
|
+
adapterSessionId: z.ZodOptional<z.ZodString>;
|
|
466
|
+
source: z.ZodString;
|
|
467
|
+
observedAt: z.ZodNumber;
|
|
468
|
+
clientVersion: z.ZodOptional<z.ZodString>;
|
|
469
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
470
|
+
modelDisplayName: z.ZodOptional<z.ZodString>;
|
|
471
|
+
modelFamily: z.ZodOptional<z.ZodString>;
|
|
472
|
+
latestRequestInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
473
|
+
latestRequestOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
474
|
+
latestRequestCacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
475
|
+
latestRequestCacheWriteTokens: z.ZodOptional<z.ZodNumber>;
|
|
476
|
+
currentContextInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
477
|
+
currentContextOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
478
|
+
contextWindowSizeTokens: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
contextUsedPercentage: z.ZodOptional<z.ZodNumber>;
|
|
480
|
+
contextRemainingPercentage: z.ZodOptional<z.ZodNumber>;
|
|
481
|
+
contextThresholdExceeded: z.ZodOptional<z.ZodBoolean>;
|
|
482
|
+
totalCost: z.ZodOptional<z.ZodNumber>;
|
|
483
|
+
costCurrency: z.ZodOptional<z.ZodString>;
|
|
484
|
+
costProvenance: z.ZodOptional<z.ZodEnum<{
|
|
485
|
+
"provider-reported": "provider-reported";
|
|
486
|
+
"client-reported": "client-reported";
|
|
487
|
+
estimated: "estimated";
|
|
488
|
+
}>>;
|
|
489
|
+
totalDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
totalApiDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
totalLinesAdded: z.ZodOptional<z.ZodNumber>;
|
|
492
|
+
totalLinesRemoved: z.ZodOptional<z.ZodNumber>;
|
|
493
|
+
totalEdits: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
}, z.core.$strict>;
|
|
461
495
|
'session.started': z.ZodObject<{
|
|
462
496
|
clientId: z.ZodString;
|
|
463
497
|
source: z.ZodString;
|
|
@@ -909,6 +943,63 @@ declare const ClientUsageIngestSchema: {
|
|
|
909
943
|
type ClientUsageIngestRequest = z.infer<typeof ClientUsageIngestSchema.request>;
|
|
910
944
|
type ClientUsageIngestResponse = z.infer<typeof ClientUsageIngestSchema.response>;
|
|
911
945
|
//#endregion
|
|
946
|
+
//#region core/contracts/src/client/session-usage.d.ts
|
|
947
|
+
/** Provenance of a monetary amount reported in a client session snapshot. */
|
|
948
|
+
declare const ClientSessionUsageCostProvenanceSchema: z.ZodEnum<{
|
|
949
|
+
"provider-reported": "provider-reported";
|
|
950
|
+
"client-reported": "client-reported";
|
|
951
|
+
estimated: "estimated";
|
|
952
|
+
}>;
|
|
953
|
+
/** Provenance of a monetary amount reported in a client session snapshot. */
|
|
954
|
+
type ClientSessionUsageCostProvenance = z.infer<typeof ClientSessionUsageCostProvenanceSchema>;
|
|
955
|
+
/**
|
|
956
|
+
* Snapshot of usage measurements for one interactive client session.
|
|
957
|
+
*
|
|
958
|
+
* Field names encode gauge/counter semantics explicitly:
|
|
959
|
+
* - `latestRequest*` is the most recent API-call usage.
|
|
960
|
+
* - `currentContext*` is the current context-window gauge.
|
|
961
|
+
* - `total*` is cumulative for the native client session.
|
|
962
|
+
*
|
|
963
|
+
* The contract contains no prompts, responses, transcripts, tool arguments,
|
|
964
|
+
* filesystem paths, or open metadata bags.
|
|
965
|
+
*/
|
|
966
|
+
declare const ClientSessionUsageSnapshotSchema: z.ZodObject<{
|
|
967
|
+
clientId: z.ZodString;
|
|
968
|
+
clientAccountId: z.ZodOptional<z.ZodString>;
|
|
969
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
970
|
+
adapterSessionId: z.ZodOptional<z.ZodString>;
|
|
971
|
+
source: z.ZodString;
|
|
972
|
+
observedAt: z.ZodNumber;
|
|
973
|
+
clientVersion: z.ZodOptional<z.ZodString>;
|
|
974
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
975
|
+
modelDisplayName: z.ZodOptional<z.ZodString>;
|
|
976
|
+
modelFamily: z.ZodOptional<z.ZodString>;
|
|
977
|
+
latestRequestInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
978
|
+
latestRequestOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
979
|
+
latestRequestCacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
980
|
+
latestRequestCacheWriteTokens: z.ZodOptional<z.ZodNumber>;
|
|
981
|
+
currentContextInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
982
|
+
currentContextOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
983
|
+
contextWindowSizeTokens: z.ZodOptional<z.ZodNumber>;
|
|
984
|
+
contextUsedPercentage: z.ZodOptional<z.ZodNumber>;
|
|
985
|
+
contextRemainingPercentage: z.ZodOptional<z.ZodNumber>;
|
|
986
|
+
contextThresholdExceeded: z.ZodOptional<z.ZodBoolean>;
|
|
987
|
+
totalCost: z.ZodOptional<z.ZodNumber>;
|
|
988
|
+
costCurrency: z.ZodOptional<z.ZodString>;
|
|
989
|
+
costProvenance: z.ZodOptional<z.ZodEnum<{
|
|
990
|
+
"provider-reported": "provider-reported";
|
|
991
|
+
"client-reported": "client-reported";
|
|
992
|
+
estimated: "estimated";
|
|
993
|
+
}>>;
|
|
994
|
+
totalDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
995
|
+
totalApiDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
996
|
+
totalLinesAdded: z.ZodOptional<z.ZodNumber>;
|
|
997
|
+
totalLinesRemoved: z.ZodOptional<z.ZodNumber>;
|
|
998
|
+
totalEdits: z.ZodOptional<z.ZodNumber>;
|
|
999
|
+
}, z.core.$strict>;
|
|
1000
|
+
/** Snapshot of usage measurements for one interactive client session. */
|
|
1001
|
+
type ClientSessionUsageSnapshot = z.infer<typeof ClientSessionUsageSnapshotSchema>;
|
|
1002
|
+
//#endregion
|
|
912
1003
|
//#region core/contracts/src/client/binary-management.d.ts
|
|
913
1004
|
/**
|
|
914
1005
|
* Install strategies that Makaio supports for managed client binaries.
|
|
@@ -1933,6 +2024,40 @@ declare const ClientNamespace: _$_makaio_core0.BusNamespaceDefinition<"client",
|
|
|
1933
2024
|
}, _$zod_v4_core0.$strip>;
|
|
1934
2025
|
metadata: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnknown>>;
|
|
1935
2026
|
}, _$zod_v4_core0.$strip>;
|
|
2027
|
+
'session.usage.snapshot': _$zod.ZodObject<{
|
|
2028
|
+
clientId: _$zod.ZodString;
|
|
2029
|
+
clientAccountId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2030
|
+
sessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2031
|
+
adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2032
|
+
source: _$zod.ZodString;
|
|
2033
|
+
observedAt: _$zod.ZodNumber;
|
|
2034
|
+
clientVersion: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2035
|
+
modelId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2036
|
+
modelDisplayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2037
|
+
modelFamily: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2038
|
+
latestRequestInputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2039
|
+
latestRequestOutputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2040
|
+
latestRequestCacheReadTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2041
|
+
latestRequestCacheWriteTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2042
|
+
currentContextInputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2043
|
+
currentContextOutputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2044
|
+
contextWindowSizeTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2045
|
+
contextUsedPercentage: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2046
|
+
contextRemainingPercentage: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2047
|
+
contextThresholdExceeded: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
2048
|
+
totalCost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2049
|
+
costCurrency: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2050
|
+
costProvenance: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2051
|
+
"provider-reported": "provider-reported";
|
|
2052
|
+
"client-reported": "client-reported";
|
|
2053
|
+
estimated: "estimated";
|
|
2054
|
+
}>>;
|
|
2055
|
+
totalDurationMs: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2056
|
+
totalApiDurationMs: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2057
|
+
totalLinesAdded: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2058
|
+
totalLinesRemoved: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2059
|
+
totalEdits: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2060
|
+
}, _$zod_v4_core0.$strict>;
|
|
1936
2061
|
'session.started': _$zod.ZodObject<{
|
|
1937
2062
|
clientId: _$zod.ZodString;
|
|
1938
2063
|
source: _$zod.ZodString;
|
|
@@ -2536,6 +2661,40 @@ declare const ClientSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSu
|
|
|
2536
2661
|
}, _$zod_v4_core0.$strip>;
|
|
2537
2662
|
metadata: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnknown>>;
|
|
2538
2663
|
}, _$zod_v4_core0.$strip>;
|
|
2664
|
+
'session.usage.snapshot': _$zod.ZodObject<{
|
|
2665
|
+
clientId: _$zod.ZodString;
|
|
2666
|
+
clientAccountId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2667
|
+
sessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2668
|
+
adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2669
|
+
source: _$zod.ZodString;
|
|
2670
|
+
observedAt: _$zod.ZodNumber;
|
|
2671
|
+
clientVersion: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2672
|
+
modelId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2673
|
+
modelDisplayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2674
|
+
modelFamily: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2675
|
+
latestRequestInputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2676
|
+
latestRequestOutputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2677
|
+
latestRequestCacheReadTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2678
|
+
latestRequestCacheWriteTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2679
|
+
currentContextInputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2680
|
+
currentContextOutputTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2681
|
+
contextWindowSizeTokens: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2682
|
+
contextUsedPercentage: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2683
|
+
contextRemainingPercentage: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2684
|
+
contextThresholdExceeded: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
2685
|
+
totalCost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2686
|
+
costCurrency: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2687
|
+
costProvenance: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2688
|
+
"provider-reported": "provider-reported";
|
|
2689
|
+
"client-reported": "client-reported";
|
|
2690
|
+
estimated: "estimated";
|
|
2691
|
+
}>>;
|
|
2692
|
+
totalDurationMs: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2693
|
+
totalApiDurationMs: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2694
|
+
totalLinesAdded: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2695
|
+
totalLinesRemoved: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2696
|
+
totalEdits: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2697
|
+
}, _$zod_v4_core0.$strict>;
|
|
2539
2698
|
'session.started': _$zod.ZodObject<{
|
|
2540
2699
|
clientId: _$zod.ZodString;
|
|
2541
2700
|
source: _$zod.ZodString;
|
|
@@ -3130,4 +3289,4 @@ type SessionConfigDestroyResponse = z.infer<(typeof ClientSessionConfigSchemas)[
|
|
|
3130
3289
|
type SessionConfigCleanupRequest = z.infer<(typeof ClientSessionConfigSchemas)['sessionConfig.cleanup']['request']>;
|
|
3131
3290
|
type SessionConfigCleanupResponse = z.infer<(typeof ClientSessionConfigSchemas)['sessionConfig.cleanup']['response']>;
|
|
3132
3291
|
//#endregion
|
|
3133
|
-
export { ClientSessionToolPre as $, ManagedInstallStrategySchema as $t, SessionConfigIdSchema as A,
|
|
3292
|
+
export { ClientSessionToolPre as $, ManagedInstallStrategySchema as $t, SessionConfigIdSchema as A, ClientUsageWindows as An, ClientInstallResponse as At, SessionConfigTeardownResponseSchema as B, ClientUninstallSchema as Bt, SessionConfigCleanupRequest as C, ClientUsageIngestRequest as Cn, ClientBinaryListEntry as Ct, SessionConfigDestroyRequest as D, ClientUsageSnapshotSchema as Dn, ClientInstallProgress as Dt, SessionConfigCreateResponse as E, ClientUsageSnapshot as En, ClientInstallCompletedSchema as Et, SessionConfigSetupResponse as F, ClientResolveBinaryRequest as Fn, ClientSetActiveRequest as Ft, ClientSessionObservedBase as G, ClientVersionChangedSchema as Gt, ClientNamespace as H, ClientUpdateResponse as Ht, SessionConfigSetupResponseSchema as I, ClientResolveBinaryResponse as In, ClientSetActiveResponse as It, ClientSessionStartModeSchema as J, InstallStage as Jt, ClientSessionObservedBaseSchema as K, InstallError as Kt, SessionConfigTeardownRequest as L, ClientResolveBinarySchema as Ln, ClientSetActiveSchema as Lt, SessionConfigInheritanceSchema as M, ClientSchemas as Mn, ClientListRequest as Mt, SessionConfigSetupRequest as N, ClientExecutionContext as Nn, ClientListResponse as Nt, SessionConfigDestroyResponse as O, ClientUsageWindow as On, ClientInstallProgressSchema as Ot, SessionConfigSetupRequestSchema as P, ClientExecutionContextSchema as Pn, ClientListSchema as Pt, ClientSessionToolPostSchema as Q, ManagedInstallStrategy as Qt, SessionConfigTeardownRequestSchema as R, ClientUninstallRequest as Rt, ProfileUpdateResponse as S, ClientSessionLocatorSchema as Sn, ClientRuntimeStartedSchema as St, SessionConfigCreateRequest as T, ClientUsageIngestSchema as Tn, ClientInstallCompleted as Tt, ClientSubjects as U, ClientUpdateSchema as Ut, createClientDefinition as V, ClientUpdateRequest as Vt, CLIENT_SESSION_START_MODES as W, ClientVersionChanged as Wt, ClientSessionStartedSchema as X, InstalledVersionEntry as Xt, ClientSessionStarted as Y, InstallStageSchema as Yt, ClientSessionToolPost as Z, InstalledVersionEntrySchema as Zt, ProfileListRequest as _, ClientScanTargetSchema as _n, ClientRuntimeSource as _t, ClientConfigPrimeSchema as a, ClientAccountIdentifierSchema as an, ClientSessionUserPromptSubmitted as at, ProfileSetDefaultResponse as b, ClientSessionAccountObserveSchema as bn, ClientRuntimeSourceSchema as bt, ClientProfileSchema as c, ClientAccountObserveSchema as cn, ClientWiringEntrySchema as ct, ProfileCreateRequest as d, ClientIdentityObservation as dn, ClientRuntimeIsAdapterManagedRequest as dt, ClientSessionUsageCostProvenance as en, ClientSessionToolPreSchema as et, ProfileCreateResponse as f, ClientIdentityObservationSchema as fn, ClientRuntimeIsAdapterManagedResponse as ft, ProfileGetResponse as g, ClientScanTarget as gn, ClientRuntimeObserveSchema as gt, ProfileGetRequest as h, ClientScanResultSchema as hn, ClientRuntimeObserveResponse as ht, ClientConfigPrimeResponse as i, ClientAccountIdentifier as in, ClientSessionTurnStartedSchema as it, SessionConfigInheritance as j, ClientUsageWindowsSchema as jn, ClientInstallSchema as jt, SessionConfigEnvSchema as k, ClientUsageWindowSchema as kn, ClientInstallRequest as kt, ClientProfileSchemas as l, ClientIdentifierStrength as ln, ClientRuntimeEvidenceBase as lt, ProfileDeleteResponse as m, ClientScanResult as mn, ClientRuntimeObserveRequest as mt, ClientConfigPrimePhaseSchema as n, ClientSessionUsageSnapshot as nn, ClientSessionTurnCompletedSchema as nt, ClientProfile as o, ClientAccountObserveRequest as on, ClientSessionUserPromptSubmittedSchema as ot, ProfileDeleteRequest as p, ClientMetadataSchema as pn, ClientRuntimeIsAdapterManagedSchema as pt, ClientSessionStartMode as q, InstallErrorSchema as qt, ClientConfigPrimeRequest as r, ClientSessionUsageSnapshotSchema as rn, ClientSessionTurnStarted as rt, ClientProfileNameSchema as s, ClientAccountObserveResponse as sn, ClientWiringEntry as st, ClientConfigPrimePhase as t, ClientSessionUsageCostProvenanceSchema as tn, ClientSessionTurnCompleted as tt, ClientSessionConfigSchemas as u, ClientIdentifierStrengthSchema as un, ClientRuntimeEvidenceBaseSchema as ut, ProfileListResponse as v, ClientSessionAccountObserveRequest as vn, ClientRuntimeSourceLayer as vt, SessionConfigCleanupResponse as w, ClientUsageIngestResponse as wn, ClientBinaryListEntrySchema as wt, ProfileUpdateRequest as x, ClientSessionLocator as xn, ClientRuntimeStarted as xt, ProfileSetDefaultRequest as y, ClientSessionAccountObserveResponse as yn, ClientRuntimeSourceLayerSchema as yt, SessionConfigTeardownResponse as z, ClientUninstallResponse as zt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{t}from"./ajv-B5dPIck0.mjs";import{z as n}from"zod";import{execFile as r}from"node:child_process";import{isAbsolute as i,relative as a,resolve as o}from"node:path";import{realpathSync as s}from"node:fs";import{localSubject as c}from"@makaio/framework/core";import{NoHandlerError as l}from"@makaio/framework/bus";import{AgentSubjects as u,ArtifactSubjects as d,ExecutionLinkListQuerySchema as f,ExecutionLinkSchema as p,ExecutionListQuerySchema as m,ExecutionStatusSchema as h,ExecutionsByArtifactRefsQuerySchema as g,GateInstanceListQuerySchema as _,JsonPatchOperationSchema as v,JsonValueSchema as y,SessionSubjects as b,SpanRecordSchema as x,SubagentSubjects as S,WORKFLOW_CANCELLED_REASON as ee,WorkLogFrameEntrySchema as te,WorkerNodeSubjects as ne,WorkflowDefinitionSchema as re,WorkflowError as ie,WorkflowErrorCode as ae,WorkflowExecutionSchema as C,WorkflowFrameStateSchema as oe,WorkflowGateInstanceSchema as w,WorkflowListQuerySchema as se,WorkflowRunContextSchema as ce,WorkflowSchemas as le,WorkflowSubjects as ue,WorkflowSubjects as T,WorkflowWorkerSourceSchema as de,createStepCancelSubject as fe,walkWorkflowDefinition as pe}from"@makaio/framework/contracts";import{index as E,primaryKey as D,uniqueIndex as me}from"drizzle-orm/sqlite-core";import{index as O,primaryKey as he,uniqueIndex as ge}from"drizzle-orm/pg-core";import{defineDualTable as k}from"@makaio/framework/storage/drizzle";import{sql as _e}from"drizzle-orm";import{createStorageNamespaceDefinition as ve}from"@makaio/framework/storage";import{evaluateSync as A,resolveTemplate as j}from"@makaio/framework/expression";import*as ye from"node:os";function be(e){return{scopeType:e.textEnum(`scope_type`,{enum:[`global`,`workspace`,`session`,`external`]}).notNull().$type(),scopeKind:e.text(`scope_kind`).notNull().default(``),scopeId:e.text(`scope_id`).notNull().default(``)}}const xe=k(`workflow_definitions`,e=>({id:e.text(`id`).primaryKey(),name:e.text(`name`).notNull(),description:e.text(`description`),root:e.jsonCol(`root`).notNull(),inputSchema:e.jsonCol(`input_schema`),configSchema:e.jsonCol(`config_schema`),outputSchema:e.jsonCol(`output_schema`),state:e.jsonCol(`state`),artifact:e.jsonCol(`artifact`),triggers:e.jsonCol(`triggers`),...be(e),createdAt:e.epochMs(`created_at`).notNull(),updatedAt:e.epochMs(`updated_at`).notNull(),canvasLayout:e.jsonCol(`canvas_layout`),source:e.jsonCol(`source`),executionHints:e.jsonCol(`execution_hints`)}),{sqlite:e=>[me(`uniq_workflow_definitions_name_scope`).on(e.name,e.scopeType,e.scopeKind,e.scopeId),E(`idx_workflow_definitions_scope`).on(e.scopeType,e.scopeKind,e.scopeId)],postgres:e=>[ge(`uniq_workflow_definitions_name_scope`).on(e.name,e.scopeType,e.scopeKind,e.scopeId),O(`idx_workflow_definitions_scope`).on(e.scopeType,e.scopeKind,e.scopeId)]}),Se=xe.sqlite,M=k(`workflow_executions`,e=>({id:e.text(`id`).primaryKey(),workflowId:e.text(`workflow_id`).notNull(),coordinatorSessionId:e.text(`coordinator_session_id`),status:e.textEnum(`status`,{enum:[`pending`,`running`,`paused`,`completed`,`failed`,`cancelled`]}).notNull(),inputs:e.jsonCol(`inputs`),error:e.text(`error`),reason:e.text(`reason`),startedAt:e.epochMs(`started_at`).notNull(),completedAt:e.epochMs(`completed_at`),externalSettlementFingerprint:e.text(`external_settlement_fingerprint`),externalRegistrationFrameId:e.text(`external_registration_frame_id`),triggerPayload:e.jsonCol(`trigger_payload`),artifactKind:e.text(`artifact_kind`),artifactId:e.text(`artifact_id`),...be(e)}),{sqlite:e=>[E(`idx_workflow_executions_status`).on(e.status),E(`idx_workflow_executions_scope_started`).on(e.scopeType,e.scopeKind,e.scopeId,e.startedAt),E(`idx_workflow_executions_workflow_started`).on(e.workflowId,e.startedAt),E(`idx_workflow_executions_artifact`).on(e.artifactKind,e.artifactId,e.startedAt)],postgres:e=>[O(`idx_workflow_executions_status`).on(e.status),O(`idx_workflow_executions_scope_started`).on(e.scopeType,e.scopeKind,e.scopeId,e.startedAt),O(`idx_workflow_executions_workflow_started`).on(e.workflowId,e.startedAt),O(`idx_workflow_executions_artifact`).on(e.artifactKind,e.artifactId,e.startedAt)]}),Ce=M.sqlite,we=k(`workflow_execution_frames`,e=>({frameId:e.text(`frame_id`).primaryKey(),executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),nodeId:e.text(`node_id`).notNull(),nodeType:e.text(`node_type`).notNull().$type(),path:e.jsonCol(`path`).notNull(),parentFrameId:e.text(`parent_frame_id`),status:e.text(`status`).notNull().default(`pending`).$type(),attempt:e.int4(`attempt`).notNull().default(0),iteration:e.int4(`iteration`),branchKey:e.text(`branch_key`),output:e.jsonCol(`output`),outputPresent:e.bool(`output_present`).notNull().default(!1),error:e.text(`error`),startedAt:e.epochMs(`started_at`),completedAt:e.epochMs(`completed_at`)}),{sqlite:e=>[E(`idx_workflow_execution_frames_execution`).on(e.executionId),E(`idx_workflow_execution_frames_parent`).on(e.parentFrameId)],postgres:e=>[O(`idx_workflow_execution_frames_execution`).on(e.executionId),O(`idx_workflow_execution_frames_parent`).on(e.parentFrameId)]}),Te=we.sqlite,Ee=k(`workflow_gate_instances`,e=>({id:e.text(`id`).primaryKey(),executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),nodeId:e.text(`node_id`).notNull(),frameId:e.text(`frame_id`).notNull(),schema:e.jsonCol(`schema`).notNull(),prompt:e.text(`prompt`),status:e.text(`status`).notNull().default(`waiting`).$type(),autoAction:e.textEnum(`auto_action`,{enum:[`approve`,`reject`]}).notNull().default(`reject`),timeoutMs:e.int4(`timeout_ms`),resumeData:e.jsonCol(`resume_data`),reason:e.text(`reason`),resumeDataPresent:e.bool(`resume_data_present`).notNull().default(!1),createdAt:e.epochMs(`created_at`).notNull(),resolvedAt:e.epochMs(`resolved_at`)}),{sqlite:e=>[E(`idx_workflow_gate_instances_execution`).on(e.executionId),E(`idx_workflow_gate_instances_frame`).on(e.frameId)],postgres:e=>[O(`idx_workflow_gate_instances_execution`).on(e.executionId),O(`idx_workflow_gate_instances_frame`).on(e.frameId)]}),De=Ee.sqlite,Oe=k(`workflow_step_spans`,e=>({executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),frameId:e.text(`frame_id`).notNull(),stepId:e.text(`step_id`).notNull(),stepType:e.text(`step_type`).notNull(),status:e.text(`status`).$type().notNull(),startedAt:e.epochMs(`started_at`),completedAt:e.epochMs(`completed_at`),durationMs:e.int4(`duration_ms`),inputTokens:e.int4(`input_tokens`),outputTokens:e.int4(`output_tokens`),estimatedCost:e.float8(`estimated_cost`),toolCallCount:e.int4(`tool_call_count`),input:e.text(`input`),output:e.text(`output`)}),{sqlite:e=>[D({columns:[e.executionId,e.frameId]}),E(`idx_workflow_step_spans_status`).on(e.status)],postgres:e=>[he({columns:[e.executionId,e.frameId]}),O(`idx_workflow_step_spans_status`).on(e.status)]}),ke=Oe.sqlite,Ae=k(`workflow_execution_links`,e=>({sourceExecutionId:e.text(`source_execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),targetExecutionId:e.text(`target_execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),linkType:e.text(`link_type`).$type().notNull(),metadata:e.jsonCol(`metadata`)}),{sqlite:e=>[D({columns:[e.sourceExecutionId,e.targetExecutionId]}),E(`idx_workflow_execution_links_target`).on(e.targetExecutionId)],postgres:e=>[he({columns:[e.sourceExecutionId,e.targetExecutionId]}),O(`idx_workflow_execution_links_target`).on(e.targetExecutionId)]}),je=Ae.sqlite,Me=k(`workflow_run_contexts`,e=>({executionId:e.text(`execution_id`).primaryKey().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),workflowId:e.text(`workflow_id`).notNull(),coordinatorSessionId:e.text(`coordinator_session_id`).notNull(),sourceKind:e.text(`source_kind`).notNull(),sourcePath:e.text(`source_path`),sourceFilename:e.text(`source_filename`),sourceCode:e.text(`source_code`),definitionSnapshot:e.jsonCol(`definition_snapshot`),workerManifest:e.jsonCol(`worker_manifest`).notNull(),inputs:e.jsonCol(`inputs`),config:e.jsonCol(`config`).notNull().default(_e`'{}'`),triggerPayload:e.jsonCol(`trigger_payload`).notNull(),artifactRef:e.jsonCol(`artifact_ref`),executionHints:e.jsonCol(`execution_hints`),dispatchMetadata:e.jsonCol(`dispatch_metadata`),scopeType:e.textEnum(`scope_type`,{enum:[`global`,`workspace`,`session`,`external`]}).notNull().default(`global`).$type(),scopeKind:e.text(`scope_kind`).notNull().default(``),scopeId:e.text(`scope_id`).notNull().default(``),cancelSubject:e.text(`cancel_subject`).notNull(),context:e.jsonCol(`context`).notNull(),env:e.jsonCol(`env`).notNull(),createdAt:e.epochMs(`created_at`).notNull(),suspensionStrategy:e.text(`suspension_strategy`).$type()}),{sqlite:e=>[E(`idx_run_contexts_workflow`).on(e.workflowId)],postgres:e=>[O(`idx_run_contexts_workflow`).on(e.workflowId)]}),Ne=Me.sqlite,Pe=k(`worklog_summaries`,e=>({executionId:e.text(`execution_id`).primaryKey().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),workflowId:e.text(`workflow_id`).notNull(),workflowName:e.text(`workflow_name`),status:e.textEnum(`status`,{enum:[`pending`,`running`,`paused`,`completed`,`failed`,`cancelled`]}).notNull(),startedAt:e.epochMs(`started_at`).notNull(),completedAt:e.epochMs(`completed_at`),durationMs:e.int4(`duration_ms`),totalInputTokens:e.int4(`total_input_tokens`),totalOutputTokens:e.int4(`total_output_tokens`),totalEstimatedCost:e.float8(`total_estimated_cost`),error:e.text(`error`),failedNodeId:e.text(`failed_node_id`)}),{sqlite:e=>[E(`idx_worklog_summaries_workflow_started`).on(e.workflowId,e.startedAt),E(`idx_worklog_summaries_status`).on(e.status)],postgres:e=>[O(`idx_worklog_summaries_workflow_started`).on(e.workflowId,e.startedAt),O(`idx_worklog_summaries_status`).on(e.status)]}),Fe=Pe.sqlite,Ie=k(`worklog_frame_entries`,e=>({frameId:e.text(`frame_id`).primaryKey(),executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),nodeId:e.text(`node_id`).notNull(),nodeType:e.text(`node_type`).notNull().$type(),path:e.jsonCol(`path`).notNull(),status:e.textEnum(`status`,{enum:[`pending`,`running`,`waiting`,`completed`,`failed`,`skipped`,`cancelled`]}).notNull(),attempt:e.int4(`attempt`).notNull().default(0),iteration:e.int4(`iteration`),branchKey:e.text(`branch_key`),startedAt:e.epochMs(`started_at`),completedAt:e.epochMs(`completed_at`),durationMs:e.int4(`duration_ms`),inputTokens:e.int4(`input_tokens`),outputTokens:e.int4(`output_tokens`),estimatedCost:e.float8(`estimated_cost`),error:e.text(`error`)}),{sqlite:e=>[E(`idx_worklog_frame_entries_execution`).on(e.executionId)],postgres:e=>[O(`idx_worklog_frame_entries_execution`).on(e.executionId)]}),Le=Ie.sqlite,Re=k(`worklog_artifact_writes`,e=>({id:e.text(`id`).primaryKey(),executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),frameId:e.text(`frame_id`).notNull(),nodeId:e.text(`node_id`).notNull(),artifact:e.jsonCol(`artifact`).notNull(),revision:e.text(`revision`),writtenAt:e.epochMs(`written_at`).notNull()}),{sqlite:e=>[E(`idx_worklog_artifact_writes_execution`).on(e.executionId)],postgres:e=>[O(`idx_worklog_artifact_writes_execution`).on(e.executionId)]}),ze=Re.sqlite,Be=k(`worklog_gate_events`,e=>({id:e.text(`id`).primaryKey(),executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),nodeId:e.text(`node_id`).notNull(),frameId:e.text(`frame_id`).notNull(),status:e.textEnum(`status`,{enum:[`waiting`,`resumed`,`rejected`,`timed-out`,`cancelled`]}).notNull().$type(),prompt:e.text(`prompt`),openedAt:e.epochMs(`opened_at`).notNull(),resolvedAt:e.epochMs(`resolved_at`),resumeData:e.jsonCol(`resume_data`)}),{sqlite:e=>[E(`idx_worklog_gate_events_execution`).on(e.executionId),E(`idx_worklog_gate_events_status`).on(e.status)],postgres:e=>[O(`idx_worklog_gate_events_execution`).on(e.executionId),O(`idx_worklog_gate_events_status`).on(e.status)]}),Ve=Be.sqlite,He=k(`workflow_execution_state`,e=>({executionId:e.text(`execution_id`).primaryKey().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),sequence:e.int4(`sequence`).notNull().default(0),value:e.jsonCol(`value`).notNull(),updatedAt:e.epochMs(`updated_at`).notNull()})),Ue=He.sqlite,We=k(`workflow_execution_state_events`,e=>({executionId:e.text(`execution_id`).notNull().references(()=>M.columnPair(`id`),{onDelete:`cascade`}),sequence:e.int4(`sequence`).notNull(),patch:e.jsonCol(`patch`).notNull(),value:e.jsonCol(`value`).notNull(),createdAt:e.epochMs(`created_at`).notNull()}),{sqlite:e=>[D({columns:[e.executionId,e.sequence]})],postgres:e=>[he({columns:[e.executionId,e.sequence]})]}),Ge=We.sqlite,Ke=n.object({executionId:n.string().min(1),status:h.optional(),error:n.string().nullable().optional(),reason:n.string().nullable().optional(),completedAt:n.number().nullable().optional()}),qe=n.enum([`completed`,`failed`,`cancelled`]),Je=te.extend({status:n.literal(`running`),startedAt:n.number().int().nonnegative()}),Ye=te.extend({status:qe,startedAt:n.number().int().nonnegative(),completedAt:n.number().int().nonnegative(),durationMs:n.number().int().nonnegative()}),Xe=ve(`workflow`,{schemas:{get:{request:n.object({id:n.string()}),response:n.object({workflow:re.nullable()})},set:{request:n.object({workflow:re}),response:n.object({id:n.string()})},delete:{request:n.object({id:n.string()}),response:n.object({deleted:n.boolean()})},list:{request:se,response:n.object({workflows:n.array(re)})},getExecution:{request:n.object({executionId:n.string()}),response:n.object({execution:C.nullable()})},setExecution:{request:n.object({execution:C}),response:n.object({id:n.string()})},setExecutionStart:{request:n.object({execution:C,runContext:ce,initialState:y.optional(),executionLinks:n.array(p).optional()}),response:n.object({id:n.string(),executionId:n.string()})},setExternalExecutionStart:c({request:n.object({execution:C.extend({status:n.literal(`running`)}),frame:Je.optional()}),response:n.object({executionId:n.string(),frameId:n.string().optional()})}),settleExternalExecution:c({request:n.object({executionId:n.string().min(1),status:qe,error:n.string().min(1).optional(),reason:n.string().min(1).optional(),completedAt:n.number().int().nonnegative().optional(),frame:Ye.optional()}),response:n.object({success:n.boolean()})}),updateExecution:{request:Ke,response:n.object({success:n.boolean()})},cancelPausedExecution:{request:n.object({executionId:n.string().min(1),completedAt:n.number(),reason:n.string().optional()}),response:n.object({cancelled:n.boolean(),gates:n.array(w.extend({status:n.literal(`cancelled`)}))})},listExecutions:{request:m,response:n.object({executions:n.array(C)})},listExecutionsByArtifactRefs:{request:g,response:n.object({executionsByRef:n.record(n.string(),n.array(C))})},setFrame:{request:n.object({executionId:n.string().min(1),frame:oe}),response:n.object({frameId:n.string()})},getFrame:{request:n.object({frameId:n.string().min(1)}),response:n.object({frame:oe.nullable()})},listFrames:{request:n.object({executionId:n.string().min(1)}),response:n.object({frames:n.array(oe)})},setGateInstance:{request:n.object({gate:w}),response:n.object({id:n.string()})},resolveWaitingGateInstance:{request:n.object({gate:w.extend({status:n.enum([`resumed`,`rejected`])})}),response:n.object({accepted:n.boolean()})},restorePausedGateResumeState:{request:n.object({execution:C.extend({status:n.literal(`paused`)}),gate:w.extend({status:n.literal(`waiting`)})}),response:n.object({executionId:n.string(),gateId:n.string()})},getGateInstance:{request:n.object({executionId:n.string().min(1),nodeId:n.string().min(1),frameId:n.string().min(1).optional()}),response:n.object({gate:w.nullable()})},listGateInstances:{request:_,response:n.object({gates:n.array(w)})},listPausedGateTimeouts:c({request:n.object({}),response:n.object({gates:n.array(w)})}),setSpan:{request:n.object({span:x}),response:n.object({id:n.string()})},listSpans:{request:n.object({executionId:n.string()}),response:n.object({spans:n.array(x)})},setExecutionLink:{request:n.object({link:p}),response:n.object({id:n.string()})},listExecutionLinks:{request:f,response:n.object({links:n.array(p)})},setRunContext:c({request:n.object({runContext:ce}),response:n.object({executionId:n.string()})}),getRunContext:c({request:n.object({executionId:n.string().min(1)}),response:n.object({runContext:ce.nullable()})}),initializeState:c({request:n.object({executionId:n.string().min(1),initialValue:y}),response:n.object({})}),getState:c({request:n.object({executionId:n.string().min(1)}),response:n.object({state:n.object({executionId:n.string().min(1),sequence:n.number().int().nonnegative(),value:y}).nullable()})}),patchState:c({request:n.object({executionId:n.string().min(1),expectedSequence:n.number().int().nonnegative(),nextValue:y}),response:n.object({executionId:n.string().min(1),sequence:n.number().int().positive(),patch:n.array(v),value:y})})},extensions:{drizzle:{workflowDefinitions:Se,workflowExecutions:Ce,workflowExecutionFrames:Te,workflowGateInstances:De,workflowStepSpans:ke,workflowExecutionLinks:je,workflowRunContexts:Ne,worklogSummaries:Fe,worklogFrameEntries:Le,worklogArtifactWrites:ze,worklogGateEvents:Ve,workflowExecutionState:Ue,workflowExecutionStateEvents:Ge}}}),N=Xe.subjects;var Ze=e(t(),1);function Qe(e,t){let n=[];return $e(n,``,e,t),n}function $e(e,t,n,r){if(Array.isArray(n)&&Array.isArray(r)){tt(e,t,n,r);return}if(nt(n)&&nt(r)){et(e,t,n,r);return}at(n,r)||e.push({op:`replace`,path:t,value:r})}function et(e,t,n,r){let i=Array.from(new Set([...Object.keys(n),...Object.keys(r)])).sort();for(let a of i){let i=rt(n,a),o=rt(r,a),s=`${t}/${it(a)}`;if(!i&&o){e.push({op:`add`,path:s,value:r[a]});continue}if(i&&!o){e.push({op:`remove`,path:s});continue}$e(e,s,n[a],r[a])}}function tt(e,t,n,r){let i=Math.min(n.length,r.length);for(let a=0;a<i;a++)$e(e,`${t}/${String(a)}`,n[a],r[a]);for(let i=n.length-1;i>=r.length;i--)e.push({op:`remove`,path:`${t}/${String(i)}`});for(let i=n.length;i<r.length;i++)e.push({op:`add`,path:`${t}/${String(i)}`,value:r[i]})}function nt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function rt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function it(e){return e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}function at(e,t){return Object.is(e,t)}const ot={stepTimeoutMs:300*1e3,stepCooldownMs:500,busAuth:{kind:`none`},platformDefaults:{cwd:process.cwd()},cancelTimeoutMs:1e4},st=new Ze.default({allErrors:!0,strict:!1}),ct=new Map,lt=new Map;function ut(e){let t=e.$id;return typeof t==`string`?t:void 0}function dt(e,t,n){let r=ut(t);return r===void 0?`workflow:${e}:${n}`:`schema-id:${r}`}function ft(e,t){try{return JSON.stringify(pt(t))}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Workflow '${e}' state schema is invalid: ${n}`)}}function pt(e){if(Array.isArray(e))return e.map(pt);if(typeof e!=`object`||!e)return e;let t=e;return Object.fromEntries(Object.keys(t).sort().map(e=>[e,pt(t[e])]))}function mt(e,t,n){let r=lt.get(t);if(r!==void 0&&r!==n)throw Error(`Workflow '${e}' state schema reuses JSON Schema $id '${t}' with different content`);return st.getSchema(t)}function ht(e){return e==null||e.length===0?`schema validation failed`:e.map(e=>`${e.instancePath.length>0?e.instancePath:`<root>`} ${e.message??`is invalid`}`).join(`; `)}function gt(e,t){let n=ft(e,t),r=dt(e,t,n),i=ct.get(r);if(i!==void 0)return i;let a=ut(t);if(a!==void 0){let t=mt(e,a,n);if(t!==void 0)return ct.set(r,t),t}try{let e=st.compile(t);return ct.set(r,e),a!==void 0&<.set(a,n),e}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Workflow '${e}' state schema is invalid: ${n}`)}}function _t(e,t,n){if(e.state===void 0)return;let r=gt(e.id,e.state.schema);if(r(t))return;let i=n===`initial`?`initial state`:`next state`;throw Error(`Workflow '${e.id}' ${i} does not match workflow state schema: ${ht(r.errors)}`)}function vt(e){if(e.state===void 0)return;let t=e.state.initial===void 0?{}:e.state.initial;return _t(e,t,`initial`),t}function P(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function yt(e,t,n){let r=e?j(e,n):t,c=o(t),l=o(i(r)?r:o(t,r)),u,d;try{u=s(c),d=s(l)}catch{return null}let f=a(process.platform===`win32`?u.toLowerCase():u,process.platform===`win32`?d.toLowerCase():d);return f===``||!f.startsWith(`..`)&&!i(f)?d:null}function bt(e){return e instanceof Error&&(`code`in e||`killed`in e)}function xt(e){let t=e[0];return t===void 0||t.trim()===``?null:t}function St(e){let{command:t,cwd:n,env:i,timeoutMs:a,signal:o}=e,s=xt(t);if(s===null)return Promise.reject(Error(`Shell step command is empty`));let c=t.slice(1);return new Promise((e,t)=>{let l=null,u=!1,d=r(s,c,{cwd:n,env:{...process.env,...i},timeout:0,maxBuffer:10*1024*1024,shell:!1},(n,r,i)=>{n?t(Object.assign(n,{stdout:r,stderr:i,aborted:u})):e({stdout:r,stderr:i})}),f=()=>{d.exitCode===null&&(d.kill(`SIGTERM`),l=setTimeout(()=>{d.exitCode===null&&d.kill(`SIGKILL`)},5e3))},p=setTimeout(()=>{f()},a);if(d.on(`close`,()=>{clearTimeout(p),l!==null&&clearTimeout(l)}),o){let e=()=>{u=!0,f()};o.aborted?e():(o.addEventListener(`abort`,e,{once:!0}),d.on(`close`,()=>o.removeEventListener(`abort`,e)))}})}async function Ct(e){let{step:t,workspaceRoot:n,expressionContext:r,signal:i}=e,a=yt(t.cwd,n,r);if(a===null)return{status:`failed`,error:`Shell step cwd '${t.cwd}' is outside workspace root '${n}'`};let o=t.command.map(e=>j(e,r));if(xt(o)===null)return{status:`failed`,error:`Shell step command is empty`};let s=Object.fromEntries(Object.entries(t.env??{}).map(([e,t])=>[e,j(t,r)])),c=t.timeoutMs??3e5;try{let{stdout:e}=await St({command:o,cwd:a,env:s,timeoutMs:c,signal:i});return{status:`completed`,stdout:e}}catch(e){if(!bt(e))return{status:`failed`,error:String(e)};let t=e.aborted===!0,n=!t&&(e.killed===!0||e.signal!=null);return{status:`failed`,error:t?`Command cancelled`:n?`Command timed out after ${c}ms`:e.stderr?.trim()||e.stdout?.trim()||e.message}}}async function wt(e,t,n){if(!(await e.request(N.updateExecution,{executionId:t.id,status:n.status,error:n.error,reason:n.reason,completedAt:n.completedAt})).success)throw Error(`Workflow execution not found: ${t.id}`)}async function Tt(e,t,n,r){t.status=`completed`,t.completedAt=Date.now();try{await wt(e.bus,t,{status:t.status,completedAt:t.completedAt}),await e.bus.emit(T.execution.completed,{executionId:n,workflowId:t.workflowId,totalDuration:t.completedAt-r,completedAt:t.completedAt})}finally{e.activeExecutions.delete(n)}}async function F(e,t,n,r,i){t.status=`failed`,t.error=r,t.completedAt=Date.now();try{await wt(e.bus,t,{status:t.status,error:t.error,completedAt:t.completedAt});try{await i?.()}catch(e){console.error(`[WorkflowFinalizer] Failed to run failure pre-emit hook:`,e)}await e.bus.emit(T.execution.failed,{executionId:n,workflowId:t.workflowId,error:r,completedAt:t.completedAt})}finally{e.activeExecutions.delete(n)}}function Et(e,t,n){let{activeRunnerSteps:r,bus:i}=e,a=`${t}:`;for(let[e,o]of r){if(!e.startsWith(a))continue;let r=e.slice(a.length);o.controller.abort(),i.emit(fe(o.cancelSubject),{executionId:t,stepId:r,reason:n}).catch(t=>{console.error(`[WorkflowFinalizer] Failed to emit cancellation for ${e}:`,t)})}}async function Dt(e,t,n){let r=await e.bus.request(N.getExecution,{executionId:t});if(r.execution==null)return!1;let i=r.execution.workflowId;if(i===void 0)throw Error(`Paused execution ${t} is missing stored workflowId`);let a=Date.now(),{cancelled:o,gates:s}=await e.bus.request(N.cancelPausedExecution,{executionId:t,completedAt:a,reason:n});if(!o)return!1;for(let n of s)await e.bus.emit(T.gate.resolved,{executionId:t,stepId:n.nodeId,stepType:`gate`,frameId:n.frameId,source:`cancelled`}).catch(e=>{console.error(`[WorkflowFinalizer] Failed to emit cancelled gate resolution for ${n.frameId}:`,e)});return await e.bus.emit(T.execution.cancelled,{executionId:t,workflowId:i,reason:n,completedAt:a}),e.activeExecutions.delete(t),!0}async function Ot(e,t,n){let r=e.activeExecutions.get(t);if(!r||r.execution.status!==`running`)return Dt(e,t,n);let{execution:i}=r;i.status=`cancelled`,i.reason=n,i.completedAt=Date.now();try{for(let[n,r]of e.shellAbortControllers)n.startsWith(`${t}:`)&&(r.abort(),e.shellAbortControllers.delete(n));Et(e,t,n),await wt(e.bus,i,{status:i.status,reason:n,completedAt:i.completedAt}),await e.bus.emit(T.execution.cancelled,{executionId:t,workflowId:i.workflowId,reason:n,completedAt:i.completedAt})}finally{e.activeExecutions.delete(t)}return!0}const kt=[`darwin`,`linux`,`win32`];function At(e){return kt.find(t=>t===e)??`linux`}function jt(e,t){return t}function Mt(e,t){return{...t}}function Nt(e){return e.reason instanceof Error?e.reason.message:typeof e.reason==`string`&&e.reason.length>0?e.reason:ee}async function Pt(e,t,n){let r=e.activeExecutions.get(t);if(!r||r.execution.status!==`running`)return;let i=e.buildFinalizerDeps(),{execution:a}=await i.bus.request(N.getExecution,{executionId:t});a?.status===`running`&&(r.execution=a,await Ot(i,t,Nt(n))||console.error(`[WorkflowExecutor] Failed to persist runner cancellation for ${t}: execution not active`))}async function Ft(e,t){if(t.pausedAtGateId===void 0||t.pausedAtFrameId===void 0)throw Error(`Paused runner result for '${t.executionId}' is missing gate identity`);let{bus:n}=e.buildFinalizerDeps(),{execution:r}=await n.request(N.getExecution,{executionId:t.executionId});if(r?.status!==`running`){let n=e.activeExecutions.get(t.executionId);n!==void 0&&r?.status===`paused`&&(n.execution.status=`paused`,e.activeExecutions.delete(t.executionId));return}let i={...r,status:`paused`};await n.request(N.setExecution,{execution:i});let a=e.activeExecutions.get(t.executionId);a!==void 0&&(a.execution=i),await n.emit(T.execution.paused,{executionId:t.executionId,workflowId:t.workflowId,pausedAtGateId:t.pausedAtGateId,pausedAtFrameId:t.pausedAtFrameId}),e.activeExecutions.delete(t.executionId)}async function It(e,t){let n=e.activeExecutions.get(t.executionId);if(!n||n.execution.status!==`running`)return;let r=e.buildFinalizerDeps(),{execution:i}=await r.bus.request(N.getExecution,{executionId:t.executionId});if(i?.status===`running`){if(n.execution=i,t.status===`completed`){await Tt(r,n.execution,t.executionId,n.execution.startedAt);return}if(t.status===`cancelled`){await Ot(r,t.executionId,t.reason??ee);return}if(t.status===`failed`){await F(r,n.execution,t.executionId,t.error);return}}}function Lt(e,t){return{source:{kind:`path`,path:t.filePath},executionId:t.executionId,workflowId:t.workflowId,triggerPayload:t.sanitizedTriggerPayload,inputs:t.boundInputs,config:t.boundConfig,...t.artifactRef===void 0?{}:{artifactRef:t.artifactRef},...t.executionHints===void 0?{}:{executionHints:t.executionHints},scope:t.scope,busUrl:e.config.busUrl,busAuth:e.config.busAuth,context:e.resolveWorkflowContext(t.workspaceRoot),env:e.config.platformDefaults.env??{},coordinatorSessionId:t.coordinatorSessionId,cancelSubject:`workflow.${t.executionId}.cancel`,suspensionStrategy:`wait-in-process`}}function Rt(e,t){let{executionId:n}=t,{workflowRunner:r,workflowAbortControllers:i,executionTasks:a,activeExecutions:o}=e,s=new AbortController;i.set(n,s);let c=Lt(e,t);return Promise.resolve().then(()=>r.run(c,s.signal)).then(async t=>{if(t.status===`paused`){await Ft(e,t);return}await It(e,t)}).catch(async t=>{if(s.signal.aborted){await Pt(e,n,s.signal).catch(e=>{console.error(`[WorkflowExecutor] Failed to persist file runner cancellation for ${n}:`,e)});return}let r=o.get(n);if(r){let i=t instanceof Error?t.message:String(t);await F(e.buildFinalizerDeps(),r.execution,n,i).catch(e=>{console.error(`[WorkflowExecutor] Failed to persist file runner boot failure for ${n}:`,e)})}}).finally(()=>{i.delete(n),a.delete(n),o.delete(n)})}function zt(e,t){let{config:n}=e,r=t.definitionSnapshot??(t.source.kind===`definition`?t.workflow:void 0);return{source:t.source,...r===void 0?{}:{definition:r},executionId:t.executionId,workflowId:t.workflowId,triggerPayload:t.sanitizedTriggerPayload,inputs:t.boundInputs,config:t.boundConfig,...t.artifactRef===void 0?{}:{artifactRef:t.artifactRef},...t.executionHints===void 0?{}:{executionHints:t.executionHints},scope:t.scope,busUrl:n.busUrl,busAuth:n.busAuth,context:e.resolveWorkflowContext(t.workspaceRoot),env:n.platformDefaults.env??{},coordinatorSessionId:t.coordinatorSessionId,cancelSubject:`workflow.${t.executionId}.cancel`,suspensionStrategy:t.suspensionStrategy??`wait-in-process`}}function Bt(e,t){let{executionId:n}=t,{workflowRunner:r,workflowAbortControllers:i,executionTasks:a,activeExecutions:o}=e,s=new AbortController;i.set(n,s);let c=zt(e,t),l=t.dispatchMetadata===void 0?void 0:{dispatchMetadata:t.dispatchMetadata};return Promise.resolve().then(()=>r.run(c,s.signal,void 0,l)).then(async t=>{if(t.status===`paused`){await Ft(e,t);return}await It(e,t)}).catch(async t=>{if(s.signal.aborted){await Pt(e,n,s.signal).catch(e=>{console.error(`[WorkflowExecutor] Failed to persist runner cancellation for ${n}:`,e)});return}let r=o.get(n);if(r){let i=t instanceof Error?t.message:String(t);await F(e.buildFinalizerDeps(),r.execution,n,i).catch(e=>{console.error(`[WorkflowExecutor] Failed to persist runner boot failure for ${n}:`,e)})}}).finally(()=>{i.delete(n),a.delete(n),o.delete(n)})}function Vt(e,t,n={}){let r=Ht(e,n);return{executionId:e.executionId,workflowId:e.workflowId,workflow:t,...e.definitionSnapshot===void 0?{}:{definitionSnapshot:e.definitionSnapshot},source:e.source,coordinatorSessionId:e.coordinatorSessionId,sanitizedTriggerPayload:e.triggerPayload,boundInputs:e.inputs,boundConfig:e.config??{},...e.artifactRef===void 0?{}:{artifactRef:e.artifactRef},...e.executionHints===void 0?{}:{executionHints:e.executionHints},scope:e.scope,workspaceRoot:e.context.repoPath,suspensionStrategy:e.suspensionStrategy,...r===void 0?{}:{dispatchMetadata:r}}}function Ht(e,t){return t.resume===!0?{...e.dispatchMetadata,resume:!0}:e.dispatchMetadata}const Ut=/(?:^|[_-])(authorization|token|cookie|password|set[_-]?cookie|api[_-]?key|secret|credential|private[_-]?key|api[_-]?secret)(?:$|[_-])/i;function Wt(e){if(!e)return;let t={remainingBytes:65536},n={},r=Object.entries(e).slice(0,100);for(let[e,i]of r){if(t.remainingBytes<=0)break;let r=Gt(e,i,0,t);r!==void 0&&(n[e]=r)}return Object.keys(n).length>0?n:void 0}function Gt(e,t,n,r){if(!(r.remainingBytes<=0||n>6)&&(r.remainingBytes-=e.length,!(r.remainingBytes<=0))){if(Ut.test(e))return r.remainingBytes-=10,`[REDACTED]`;if(t===null)return r.remainingBytes-=4,null;if(typeof t==`string`){let e=t.slice(0,2e3);return r.remainingBytes-=e.length,e}if(typeof t==`number`||typeof t==`boolean`)return r.remainingBytes-=String(t).length,t;if(Array.isArray(t)){let i=[];for(let a of t.slice(0,100)){if(r.remainingBytes<=0)break;let t=Gt(e,a,n+1,r);t!==void 0&&i.push(t)}return i}if(typeof t==`object`){let e={},i=Object.entries(t).slice(0,100);for(let[t,a]of i){if(r.remainingBytes<=0)break;let i=Gt(t,a,n+1,r);i!==void 0&&(e[t]=i)}return e}}}function Kt(e){return(e?.requirements?.capabilities??[]).length>0}function qt(e,t,n){let r=t?.requirements?.capabilities??[];if(Kt(t))return{run:(t,i)=>e.request(ne.dispatch,{config:t,requirements:{customCapabilities:r},...n===void 0?{}:{metadata:n}},{signal:i})}}function Jt(e,t){let n=qt(e.bus,t.executionHints,t.dispatchMetadata);return n===void 0?e.workflowRunner===void 0?e.runExecution(t.executionId).finally(()=>{e.executionTasks.delete(t.executionId)}):Bt(e.buildRunnerTaskDeps(e.workflowRunner),t):Bt(e.buildRunnerTaskDeps(n),t)}async function Yt(e,t,n,r){let i=vt(r);await e.request(N.setExecutionStart,{execution:t,runContext:n,initialState:i})}async function Xt(e,t){try{await e.emit(T.execution.started,t)}catch(e){console.error(`[WorkflowExecutor] execution.started listener failed:`,e)}}async function Zt(e,t){await e.request(b.close,{sessionId:t}).catch(e=>{console.error(`[WorkflowExecutor] Failed to close coordinator session "${t}" after launch failure:`,e)})}function Qt(e,t,n,r,i,a,o,s,c){let l={id:t,workflowId:n.id,coordinatorSessionId:r,status:`running`,inputs:i,config:a,startedAt:Date.now(),triggerPayload:o,...c.artifactRef===void 0?{}:{artifactRef:c.artifactRef},scope:s};return e.set(t,{execution:l,workflow:n,runContext:c,runtimeHandlers:new Map,runtimeLoopGates:new Map}),l}async function $t(e,t,n,r,i){await e.request(N.setExecutionStart,{execution:t,runContext:n,...r===void 0?{}:{initialState:r},...i!==void 0&&i.length>0?{executionLinks:[...i]}:{}})}function en(e,t){let n=e?.source;if(n===void 0)return;let r=de.parse(n);return r.kind===`path`&&!i(r.path)?{...r,path:o(t,r.path)}:r}function tn(e,t,n){return en(t,n)??{kind:`definition`,workflowId:e}}function nn(e,t,n,r){if(!(t.kind===`definition`||e.workflowRunner!==void 0||Kt(n)))throw new ie(ae.NOT_EXECUTABLE,`Workflow source execution '${r}' requires a workflow runner or WorkerNode capability requirements.`)}async function rn(e,t,n,r){return e.set(t,n),await r,t}async function an(e,t){let{workflow:n}=await e.request(N.get,{id:t});if(!n)throw Error(`Workflow not found: ${t}`);return n}function on(e,t){if(e===void 0&&t===void 0)return;let n=[...new Set([...e?.capabilities??[],...t?.capabilities??[]])];return{...e,...t,...n.length>0&&{capabilities:n}}}function sn(e,t){if(e===void 0&&t===void 0)return;let n=on(e?.requirements,t?.requirements),r=e?.providers!==void 0||t?.providers!==void 0?{...e?.providers,...t?.providers}:void 0;return{...e,...t,...n!==void 0&&{requirements:n},...r!==void 0&&{providers:r}}}async function cn(e,t,n,r){let{sessionId:i}=await e.request(b.create,{parentSessionId:t,branchKind:`coordinator`,title:`Workflow: ${n}`,targetWorkingDirectory:r});return i}async function ln(e,t,n={}){let r=await an(e.bus,t);return un(e,t,{...n,workflow:r})}async function un(e,t,n){let{bus:r,activeExecutions:i,executionTasks:a}=e,{workflow:o,parentSessionId:s,triggerPayload:c,artifactRef:l,executionHints:u,scopeOverride:d}=n,f=P(`wfx`),p=Wt(c),m=jt(o,n.input===void 0?{}:n.input),h=Mt(o,n.config??{}),g=d??o.scope,_=sn(o.executionHints,u),v=await e.resolveExecutionWorkspaceRoot(s),y=n.executionSource??tn(t,_,v),b=n.definitionSnapshot??(y.kind===`definition`?o:void 0);nn(e,y,_,t);let x=await cn(r,s,o.name,v),S=!1;try{let s=e.buildRunContext({executionId:f,workflowId:t,coordinatorSessionId:x,source:y,...b===void 0?{}:{definitionSnapshot:b},inputs:m,config:h,scope:g,triggerPayload:p??{},...l===void 0?{}:{artifactRef:l},..._===void 0?{}:{executionHints:_},workspaceRoot:v}),c=Qt(i,f,o,x,m,h,p,g,s);await $t(r,c,s,y.kind===`definition`?vt(o):void 0,n.executionLinks?.(f));let u=c.startedAt,d=Xt(r,{executionId:f,workflowId:t,coordinatorSessionId:x,startedAt:u,...l===void 0?{}:{artifactRef:l}}),ee=Jt(e,{executionId:f,workflowId:t,workflow:o,...b===void 0?{}:{definitionSnapshot:b},source:y,coordinatorSessionId:x,sanitizedTriggerPayload:p??{},boundInputs:m,boundConfig:h,scope:g,...l===void 0?{}:{artifactRef:l},..._===void 0?{}:{executionHints:_},workspaceRoot:v,suspensionStrategy:s.suspensionStrategy});return S=!0,rn(a,f,ee,d)}catch(e){throw S||(i.delete(f),a.delete(f),await Zt(r,x)),e}}function dn(e,t,n,r,i){e.set(t.id,{execution:t,workflow:{id:t.workflowId,name:n,scope:r,root:{id:`${t.workflowId}-root`,type:`sequence`,nodes:[]}},runContext:i,runtimeHandlers:new Map,runtimeLoopGates:new Map})}async function fn(e,t,n,r){let{sessionId:i}=await e.request(b.create,{...t===void 0?{}:{parentSessionId:t},branchKind:`coordinator`,title:`Workflow: ${n}`,targetWorkingDirectory:r});return i}async function pn(e,t,n={}){let{bus:r,activeExecutions:i,executionTasks:a}=e,{artifactRef:o,executionHints:s,parentSessionId:c,triggerPayload:l,scopeOverride:u}=n,d=P(`wfx`),f=Wt(l),p=n.input===void 0?{}:n.input,m=n.config??{},h=u??{type:`global`},g=await e.resolveExecutionWorkspaceRoot(c),_=await fn(r,c,t,g),v=d,y={id:d,workflowId:v,coordinatorSessionId:_,status:`running`,inputs:p,config:m,startedAt:Date.now(),triggerPayload:f,...o===void 0?{}:{artifactRef:o},scope:h},b=!1;try{let{workflowRunner:c}=e;if(c===void 0)throw Error(`[WorkflowExecutor] startFileExecution called without a workflow runner`);let l=e.buildRunContext({executionId:d,workflowId:v,coordinatorSessionId:_,source:{kind:`path`,path:t},inputs:p,config:m,scope:h,triggerPayload:f??{},...o===void 0?{}:{artifactRef:o},...s===void 0?{}:{executionHints:s},workspaceRoot:g});await $t(r,y,l,void 0,n.executionLinks?.(d)),dn(i,y,t,h,l);let u=Xt(r,{executionId:d,workflowId:v,coordinatorSessionId:_,startedAt:y.startedAt,...o===void 0?{}:{artifactRef:o}}),x=Rt(e.buildRunnerTaskDeps(c),{executionId:d,workflowId:v,filePath:t,coordinatorSessionId:_,sanitizedTriggerPayload:f??{},boundInputs:p,boundConfig:m,...o===void 0?{}:{artifactRef:o},...s===void 0?{}:{executionHints:s},scope:h,workspaceRoot:g});return b=!0,rn(a,d,x,u)}catch(e){throw b||(i.delete(d),a.delete(d),await Zt(r,_)),e}}function mn(e){let t={};for(let[n,r]of Object.entries(e))r.status===`completed`?t[n]={status:`completed`,output:r.output}:r.status===`skipped`&&(t[n]={status:`skipped`});return t}function I(e){let t={...e,input:e.inputs,steps:e.frames};return{...t,ctx:t}}function hn(){return{context:{repoPath:process.cwd(),makaioHome:process.env.MAKAIO_HOME??`${ye.homedir()}/.makaio`,os:process.platform===`win32`?`win32`:process.platform===`darwin`?`darwin`:`linux`,arch:process.arch},env:{}}}function gn(e){return{...e,path:[...e.path]}}function _n(e){if(e===`station`||e===`delegate-agent`||e===`delegate-role`||e===`gate`)return e}function vn(e,t){let n=_n(t.nodeType);if(n===void 0||t.status!==`running`&&t.status!==`completed`&&t.status!==`failed`&&t.status!==`skipped`)return;let r=t.startedAt!==void 0&&t.completedAt!==void 0?Math.max(0,t.completedAt-t.startedAt):void 0;return{executionId:e,frameId:t.frameId,stepId:t.nodeId,stepType:n,status:t.status,...t.startedAt===void 0?{}:{startedAt:t.startedAt},...t.completedAt===void 0?{}:{completedAt:t.completedAt},...r===void 0?{}:{durationMs:r},...t.output===void 0?{}:{output:JSON.stringify(t.output)}}}var yn=class e{executionId;workflowId;definition;execution;runtimeHandlers;bus;signal;frameRegistry;framePersistenceTasks=new Map;artifactBinding;constructor(e,t,n,r,i,a,o,s,c,l=hn(),u={}){this.executionId=e,this.workflowId=t,this.definition=n,this.execution=r,this.runtimeHandlers=i,this.bus=a,this.signal=o,this.frameRegistry=s??new Map,this.artifactBinding=c,this.platformContext=l.context,this.env=l.env,this.suspensionStrategy=u.suspensionStrategy??`wait-in-process`,this.resumeFrames=u.resumeFrames,this.runtimeLoopGates=u.runtimeLoopGates??new Map}platformContext;env;suspensionStrategy;resumeFrames;runtimeLoopGates;withSignal(t){return new e(this.executionId,this.workflowId,this.definition,this.execution,this.runtimeHandlers,this.bus,t,this.frameRegistry,this.artifactBinding,{context:this.platformContext,env:this.env},{suspensionStrategy:this.suspensionStrategy,resumeFrames:this.resumeFrames,runtimeLoopGates:this.runtimeLoopGates})}buildExpressionContext(){return{inputs:this.execution.inputs,config:this.execution.config??{},trigger:this.execution.triggerPayload??{},frames:{},previousSteps:{}}}createFrame(e){let t=P(`frm`),n=[...e.path,t],r={frameId:t,nodeId:e.nodeId,nodeType:e.nodeType,path:n,parentFrameId:e.parentFrameId,status:`pending`,attempt:0,iteration:e.iteration,branchKey:e.branchKey};return this.frameRegistry.set(t,r),this.persistFrame(r).catch(()=>void 0),r}async persistFrame(e,t={}){let n=t.requireFrameStorage===!0||this.suspensionStrategy!==`wait-in-process`,r=gn(e),i=vn(this.executionId,r),a=(this.framePersistenceTasks.get(e.frameId)??Promise.resolve()).catch(()=>void 0).then(async()=>{n?await this.bus.request(N.setFrame,{executionId:this.executionId,frame:r}):await this.bus.requestOptional(N.setFrame,{executionId:this.executionId,frame:r}),i!==void 0&&await this.bus.requestOptional(N.setSpan,{span:i})}).catch(t=>{if(n)throw t;console.warn(`[RuntimeContext] Failed to persist frame ${e.frameId}:`,t)});this.framePersistenceTasks.set(e.frameId,a);try{await a}finally{this.framePersistenceTasks.get(e.frameId)===a&&this.framePersistenceTasks.delete(e.frameId)}}async updateFrame(e,t,n={}){let r=this.frameRegistry.get(e);if(!r)throw Error(`Frame not found: ${e}`);Object.assign(r,t),await this.persistFrame(r,n)}getFrame(e){return this.frameRegistry.get(e)}getFramesByNodeId(e){let t=[];for(let n of this.frameRegistry.values())n.nodeId===e&&t.push(n);return t.sort((e,t)=>(e.startedAt??0)-(t.startedAt??0))}async emitFrameStarted(e){try{await this.bus.emit(T.frame.started,{executionId:this.executionId,frameId:e.frameId,nodeId:e.nodeId,nodeType:e.nodeType,path:e.path,parentFrameId:e.parentFrameId,startedAt:e.startedAt})}catch(t){console.error(`[RuntimeContext] frame.started observer failed for ${e.frameId}:`,t)}}async emitFrameCompleted(e,t){try{await this.bus.emit(T.frame.completed,{executionId:this.executionId,frameId:e.frameId,nodeId:e.nodeId,output:e.output,duration:t,completedAt:e.completedAt})}catch(t){console.error(`[RuntimeContext] frame.completed observer failed for ${e.frameId}:`,t)}}async emitFrameFailed(e,t,n){try{await this.bus.emit(T.frame.failed,{executionId:this.executionId,frameId:e.frameId,nodeId:e.nodeId,error:t,duration:n,completedAt:e.completedAt})}catch(t){console.error(`[RuntimeContext] frame.failed observer failed for ${e.frameId}:`,t)}}};function bn(e){return{kind:`workflow-execution`,id:e,displayName:`Workflow Engine`}}function xn(e,t,n){return{inputs:n.inputs,config:n.config??{},trigger:n.triggerPayload,scope:n.scope,context:n.context,env:n.env,execution:{id:t.id,workflowId:t.workflowId,scope:t.scope},workflow:{id:e.id,name:e.name,scope:e.scope}}}function Sn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Cn(e){if(e!=null){if(Sn(e)&&typeof e.kind==`string`&&typeof e.id==`string`)return{kind:e.kind,id:e.id};throw Error(`Artifact resolve expression must return an object with string kind and id fields.`)}}function wn(e){if(e!==void 0){if(Sn(e))return e;throw Error(`Artifact create expression must return an object.`)}}async function Tn(e){let{bindingOptions:t,binding:n,existingArtifactRef:r,executionId:i,scope:a,initialData:o,bus:s}=e,c=null;if(r!==void 0){let e=await s.request(d.query,{kind:r.kind,ids:[r.id],currentOnly:!0});if(e.artifacts.length>0)c=e.artifacts[0];else return}else c=(await s.request(d.create,{kind:n.kind,schemaVersion:n.schemaVersion,scope:a??n.scope,data:o??{},relations:[],actor:bn(i)})).artifact;return{current:c,schemaVersion:n.schemaVersion,statusPath:t.statusPath,zodSchema:t.schema}}async function En(e){let{definition:t,execution:n,runContext:r,zodSchema:i,bus:a}=e,o=t.artifact;if(o===void 0)return;let s=xn(t,n,r),c=r.artifactRef??(o.resolve===void 0?void 0:Cn(A(o.resolve,s))),l=c===void 0&&o.create!==void 0?wn(A(o.create,s)):void 0,u=await Tn({bindingOptions:{kind:o.kind,schemaVersion:o.schemaVersion,scope:o.scope,...o.resolve===void 0?{}:{resolve:o.resolve},...o.create===void 0?{}:{create:o.create},...o.statusPath===void 0?{}:{statusPath:o.statusPath},...i===void 0?{}:{schema:i}},binding:o,existingArtifactRef:c,executionId:n.id,scope:o.scope,initialData:l,bus:a});if(u===void 0)throw Error(`Workflow artifact binding could not be resolved for the configured artifact reference.`);return u}const Dn=new WeakMap;function On(e,t){let n=(Dn.get(e)??Promise.resolve()).catch(()=>void 0).then(t);return Dn.set(e,n.then(()=>void 0,()=>void 0)),n}function kn(e,t){switch(t.operation){case`set`:return t.data;case`merge`:return{...e,...t.data};case`append`:{let n={...e};for(let[r,i]of Object.entries(t.data)){let t=e[r];Array.isArray(t)&&Array.isArray(i)?n[r]=[...t,...i]:n[r]=i}return n}}}function An(e,t,n){let[r,...i]=t;if(i.length===0)return{...e,[r]:n};let a=e[r]!==null&&typeof e[r]==`object`&&!Array.isArray(e[r])?e[r]:{};return{...e,[r]:An(a,i,n)}}function jn(e,t,n){return An(e,t.startsWith(`/`)?t.slice(1).split(`/`):t.split(`.`),n)}function Mn(e,t,n){if(n===`set`||n===`functional`)return[];let r=[];for(let n of Object.keys(t))e[n]!==t[n]&&r.push(`/${n}`);return r}async function Nn(e,t){if(typeof t==`function`)return{nextData:await t(Object.freeze({...e})),operationLabel:`functional`,changedPaths:[]};let n=kn(e,t),r=Mn(e,n,t.operation);return{nextData:n,operationLabel:t.operation,changedPaths:r}}function Pn(e){let{executionId:t,frameId:n,bindingState:r,bus:i}=e,a=Object.freeze({...r.current.data}),o=async e=>On(r,async()=>{let a=r.current,{nextData:o,operationLabel:s,changedPaths:c}=await Nn(a.data,e);if(r.zodSchema!==void 0){let e=r.zodSchema.safeParse(o);if(!e.success)throw Error(`Artifact data validation failed: ${e.error.message}`)}let l=await i.request(d.revise,{previous:{refClass:`artifact`,kind:a.kind,id:a.id,revision:a.revision},revision:{kind:a.kind,schemaVersion:r.schemaVersion,scope:a.scope,data:o,relations:a.relations,actor:bn(t)}});r.current=l.artifact;let u=l.artifact.revision;return i.emit(ue.artifact.updated,{executionId:t,frameId:n,artifactRef:{kind:l.artifact.kind,id:l.artifact.id},paths:c,operation:s,revision:u}).catch(e=>{console.error(`[ArtifactContext] Failed to emit artifact.updated event:`,e)}),u});return{data:a,updateArtifact:o,updateStatus:async e=>{if(r.statusPath===void 0)throw Error(`updateStatus() called but no statusPath is configured on the artifact binding. Set statusPath in the .artifact() builder call to use updateStatus().`);let t=r.statusPath;return o(n=>jn(n,t,e))}}}function Fn(e,t){return{async get(){return(await t.request(T.state.get,{executionId:e})).value},async update(n){let r=await t.request(T.state.get,{executionId:e}),i=structuredClone(r.value),a=await n(i),o=a===void 0?i:a,s=Qe(r.value,o);return(await t.request(T.state.patch,{executionId:e,expectedSequence:r.sequence,patch:s,nextValue:o})).value}}}async function In(e,t,n){if(t.signal.aborted)return{status:`cancelled`};let r=await t.bus.requestOptional(T.resolveRole,{roleId:e.roleId});if(!r.handled)return{status:`failed`,error:e.unresolvedRoleError};let i=j(e.prompt,I(n)),a=e.completion===void 0?r.data:{...r.data,completion:e.completion};return Ln({...e,task:i,resolvedConfig:a},t)}async function Ln(e,t){if(t.signal.aborted)return{status:`cancelled`};let n=await t.bus.requestOptional(S.spawn,{parentSessionId:t.execution.coordinatorSessionId??t.executionId,depth:1,config:Hn(e.task,e.resolvedConfig,e.outputSchema)});if(!n.handled)return{status:`failed`,error:e.unavailableRuntimeError};let r=await Rn(e,t,n.data.subagentId,{attempts:5}),i=await Un(e,t,n.data.subagentId);return i===`aborted`?{status:`cancelled`}:(r||await Rn(e,t,n.data.subagentId,{attempts:1}),i.handled?t.signal.aborted||i.data.status===`cancelled`?{status:`cancelled`}:i.data.status===`completed`?{status:`completed`,output:i.data.result??null}:{status:`failed`,error:`${e.nodeLabel} '${e.nodeId}' subagent ${i.data.status}: ${i.data.error??`no result`}`}:{status:`failed`,error:e.unavailableAwaitError})}async function Rn(e,t,n,r){if(e.frameId===void 0)return!0;try{let i=await zn(t,n,r.attempts);return i===void 0?!1:(await t.bus.emit(T.frame.sessionLinked,{executionId:t.executionId,frameId:e.frameId,sessionId:i}),!0)}catch(t){return console.warn(`[workflow-engine] Failed to emit frame.sessionLinked for frame '${e.frameId}' and subagent '${n}'`,t),!1}}async function zn(e,t,n){for(let r=0;r<n;r+=1){if(e.signal?.aborted)return;let i=await Bn(e,t);if(i===void 0||!i.handled)return;if(i.data.childSessionId!==void 0)return i.data.childSessionId;if(r<n-1&&!await Vn(e.signal,20))return}}async function Bn(e,t){try{return await e.bus.requestOptional(S.getStatus,{subagentId:t},{timeout:25,signal:e.signal})}catch{return}}function Vn(e,t){return e.aborted?Promise.resolve(!1):new Promise(n=>{let r,i=t=>{r!==void 0&&(clearTimeout(r),r=void 0),e.removeEventListener(`abort`,a),n(t)},a=()=>i(!1);r=setTimeout(()=>i(!0),t),e.addEventListener(`abort`,a,{once:!0}),e.aborted&&i(!1)})}function Hn(e,t,n){return{task:e,adapterName:t.adapterName,...t.model===void 0?{}:{model:t.model},...t.reasoningEffort===void 0?{}:{reasoningEffort:t.reasoningEffort},...t.harnessId===void 0?{}:{harnessId:t.harnessId},...t.systemPrompt===void 0?{}:{systemPrompt:t.systemPrompt},...t.contextMode===void 0?{}:{contextMode:t.contextMode},...t.providerContext===void 0?{}:{providerContext:t.providerContext},...t.completion===void 0?{}:{completion:t.completion},...n===void 0?{}:{responseSchema:n}}}async function Un(e,t,n){if(t.signal.aborted)return await Wn(e,t,n),`aborted`;let r=t.bus.requestOptional(S.await,{subagentId:n,...e.timeoutMs===void 0?{}:{timeoutMs:e.timeoutMs}},{timeout:0});if(t.signal.aborted)return await Wn(e,t,n),`aborted`;let i,a=new Promise(e=>{i=()=>e(`aborted`),t.signal.addEventListener(`abort`,i,{once:!0})}),o=await Promise.race([r,a]);return i!==void 0&&t.signal.removeEventListener(`abort`,i),o===`aborted`&&await Wn(e,t,n),o}async function Wn(e,t,n){try{await t.bus.requestOptional(S.kill,{subagentId:n,reason:`Workflow execution '${t.executionId}' cancelled ${e.cancellationLabel} '${e.nodeId}'`})}catch(t){console.warn(`[workflow-engine] Best-effort subagent kill failed for '${n}' (${e.cancellationLabel} '${e.nodeId}')`,t)}}async function Gn(e,t,n,r){if(t.signal.aborted)return{status:`cancelled`};let i=mn(n.frames),a=t.runtimeHandlers.get(e.id);if(a===void 0)return Kn(e,t,n,r);let o=t.artifactBinding!==void 0&&r!==void 0?Pn({executionId:t.executionId,frameId:r,bindingState:t.artifactBinding,bus:t.bus}):void 0,s=t.definition.state===void 0?void 0:Fn(t.executionId,t.bus);async function c(n){if(r===void 0){console.warn(`[station-node] updateProgress called without frameId for node '${e.id}'; skipping emit`);return}let i=le[`execution.progress`].parse({executionId:t.executionId,workflowId:t.workflowId,frameId:r,nodeId:e.id,progress:n,emittedAt:Date.now()});try{await t.bus.emit(T.execution.progress,i)}catch(t){console.error(`[station-node] execution.progress observer failed for ${e.id}:`,t)}}let l;try{l=await a({...t.platformContext,env:t.env,executionId:t.executionId,workflowId:t.workflowId,inputs:t.execution.inputs,config:t.execution.config??{},trigger:t.execution.triggerPayload??{},previousSteps:i,...n.item!==void 0&&{item:n.item},...n.index!==void 0&&{index:n.index},...n.previous!==void 0&&{previous:n.previous},signal:t.signal,...o!==void 0&&{artifact:o},...s!==void 0&&{state:s},bus:t.bus,updateProgress:c})}catch(e){return{status:`failed`,error:e instanceof Error?e.message:String(e)}}return{status:`completed`,output:l}}async function Kn(e,t,n,r){if(e.role===void 0)return{status:`failed`,error:`No handler registered for station node '${e.id}'`};let i=e.outputSchema===void 0?void 0:{schema:e.outputSchema};return In({nodeId:e.id,nodeLabel:`Station node`,roleId:e.role,prompt:e.prompt,...i===void 0?{}:{outputSchema:i},...e.timeoutMs===void 0?{}:{timeoutMs:e.timeoutMs},...e.completion===void 0?{}:{completion:e.completion},unresolvedRoleError:`No runtime handler registered for station node '${e.id}', and role '${e.role}' could not be resolved`,unavailableRuntimeError:`Subagent runtime is not available for station node '${e.id}'`,unavailableAwaitError:`Subagent runtime cannot await station node '${e.id}'`,cancellationLabel:`station`,...r===void 0?{}:{frameId:r}},t,n)}async function qn(e,t,n,r){if(t.signal.aborted)return{status:`cancelled`};let i=await t.bus.requestOptional(T.resolveAgent,{agentId:e.agentId});if(!i.handled)return{status:`failed`,error:`Agent '${e.agentId}' could not be resolved for delegate-agent node '${e.id}'`};if(t.signal.aborted)return{status:`cancelled`};let a=sr(e,n);if(a.status===`failed`)return a;let o=e.outputSchema===void 0?void 0:{schema:e.outputSchema};return Ln({nodeId:e.id,nodeLabel:`Delegate-agent node`,task:a.task,resolvedConfig:i.data,...o===void 0?{}:{outputSchema:o},unavailableRuntimeError:`Subagent runtime is not available for delegate-agent node '${e.id}'`,unavailableAwaitError:`Subagent runtime cannot await delegate-agent node '${e.id}'`,cancellationLabel:`delegate-agent`,...r===void 0?{}:{frameId:r}},t)}async function Jn(e,t,n,r){if(t.signal.aborted)return{status:`cancelled`};let i=await t.bus.requestOptional(T.resolveRole,{roleId:e.role});if(!i.handled)return{status:`failed`,error:`Role '${e.role}' could not be resolved for delegate-role node '${e.id}'`};let a=e.outputSchema===void 0?void 0:{schema:e.outputSchema},o=j(e.prompt,I(n)),s=nr(e,i.data),c={node:e,task:o,resolvedRole:s,...a===void 0?{}:{outputSchema:a},...r===void 0?{}:{frameId:r}};return rr(s)?Yn(c,t):Ln({nodeId:e.id,nodeLabel:`Delegate-role node`,task:o,resolvedConfig:s,...a===void 0?{}:{outputSchema:a},...e.timeoutMs===void 0?{}:{timeoutMs:e.timeoutMs},unavailableRuntimeError:`Subagent runtime is not available for delegate-role node '${e.id}'`,unavailableAwaitError:`Subagent runtime cannot await delegate-role node '${e.id}'`,cancellationLabel:`delegate-role`,...r===void 0?{}:{frameId:r}},t)}async function Yn(e,t){let{node:n}=e,r=n.timeoutMs??3e5,i,a=or(t.signal);try{let n=await Xn(e,t);return`status`in n?n:(i=n.sessionId,t.signal.aborted?{status:`cancelled`}:await Zn(e,t,{abortLink:a,childSessionId:i,timeoutMs:r}))}catch(e){if(t.signal.aborted)return{status:`cancelled`};let r=e instanceof Error?e.message:String(e);return{status:`failed`,error:`Delegate-role node '${n.id}' session turn failed: ${r}`}}finally{a.controller.abort(),a.cleanup(),i!==void 0&&await ar(t,n.id,i)}}async function Xn(e,t){let n=await t.bus.requestOptional(b.create,{sessionId:er(t,e),parentSessionId:t.execution.coordinatorSessionId??t.executionId,branchKind:`subagent`,title:`Workflow delegate-role '${e.node.id}'`});if(!n.handled)return{status:`failed`,error:`Session runtime is not available for delegate-role node '${e.node.id}'`};let r=n.data.sessionId;return await ir(e,t,r),(await t.bus.requestOptional(b.agent.attachResolved,{sessionId:r,agent:tr(e.resolvedRole),role:`lead`},{signal:t.signal}).catch(async n=>{throw await ar(t,e.node.id,r),n})).handled?{sessionId:r}:(await ar(t,e.node.id,r),{status:`failed`,error:`Session runtime cannot attach delegate-role node '${e.node.id}'`})}async function Zn(e,t,n){let r=t.bus.once(u.complete,{timeoutMs:n.timeoutMs,filter:{sessionId:n.childSessionId},signal:n.abortLink.controller.signal});r.catch(()=>void 0);let i=await Qn(e,t,n);if(`status`in i)return i;let a=await $n(e,t,n,i.turnId);if(a.status===`failed`)return a;let o=await r;return t.signal.aborted?{status:`cancelled`}:o.payload.outcome===`error`?{status:`failed`,error:`Delegate-role node '${e.node.id}' agent error: ${o.payload.error??`no result`}`}:{status:`completed`,output:o.payload.message??null}}async function Qn(e,t,n){let r=await t.bus.requestOptional(b.sendMessage,{sessionId:n.childSessionId,message:e.task,...e.outputSchema===void 0?{}:{responseSchema:e.outputSchema},source:`system`},{signal:t.signal});return r.handled?{turnId:r.data.turnId}:(n.abortLink.controller.abort(),{status:`failed`,error:`Session runtime cannot send delegate-role node '${e.node.id}'`})}async function $n(e,t,n,r){let i=await t.bus.requestOptional(b.turn.await,{sessionId:n.childSessionId,turnId:r,timeoutMs:n.timeoutMs},{timeout:0,signal:t.signal});return i.handled?i.data.completion.success?{status:`completed`}:{status:`failed`,error:`Delegate-role node '${e.node.id}' session turn failed: ${i.data.completion.error??`no result`}`}:(n.abortLink.controller.abort(),{status:`failed`,error:`Session runtime cannot await delegate-role node '${e.node.id}'`})}function er(e,t){return`session-workflow-${e.executionId}-${t.frameId??t.node.id}`}function tr(e){return{kind:`adapter`,adapterName:e.adapterName,...e.model===void 0?{}:{model:e.model},...e.reasoningEffort===void 0?{}:{reasoningEffort:e.reasoningEffort},...e.systemPrompt===void 0?{}:{systemPrompt:e.systemPrompt},...e.providerContext===void 0?{}:{providerConfigId:e.providerContext.providerConfigId,providerContext:e.providerContext}}}function nr(e,t){return e.completion===void 0?t:{...t,completion:e.completion}}function rr(e){return e.completion===`turn`&&e.harnessId===void 0&&e.contextMode===void 0}async function ir(e,t,n){if(e.frameId!==void 0)try{await t.bus.emit(T.frame.sessionLinked,{executionId:t.executionId,frameId:e.frameId,sessionId:n})}catch(t){console.warn(`[workflow-engine] Failed to emit frame.sessionLinked for frame '${e.frameId}' and session '${n}'`,t)}}async function ar(e,t,n){try{await e.bus.requestOptional(b.close,{sessionId:n})}catch(e){console.warn(`[workflow-engine] Failed to close delegate-role session '${n}' for node '${t}'`,e)}}function or(e){let t=new AbortController;if(e.aborted)return t.abort(),{controller:t,cleanup:()=>void 0};let n=()=>t.abort();return e.addEventListener(`abort`,n,{once:!0}),{controller:t,cleanup:()=>e.removeEventListener(`abort`,n)}}function sr(e,t){try{let n=I(t);return{status:`completed`,task:cr(e.inputExpression===void 0?n:A(e.inputExpression,n))}}catch(t){let n=t instanceof Error?t.message:String(t);return{status:`failed`,error:`delegate-agent node '${e.id}': input expression evaluation failed: ${n}`}}}function cr(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function lr(e,t,n,r){try{let i=A(n,I(r));return Array.isArray(i)?i:{status:`failed`,error:`${t} node '${e}': collection expression did not resolve to an array (got ${typeof i})`}}catch(n){return{status:`failed`,error:`${t} node '${e}': collection expression evaluation failed: ${n instanceof Error?n.message:String(n)}`}}}function ur(e,t,n){for(let r of[...e.nodes].reverse()){let e=n.getFramesByNodeId(r.id);for(let n of e)if(n.parentFrameId===t&&n.status===`completed`)return n.output}}function dr(e,t,n){return ur(e.body,t,n)}function fr(e){if(e.length===0)return;let t=new Map,n=new Map;for(let r of e){n.set(r.frameId,r);let e=t.get(r.nodeId)??[];e.push(r),t.set(r.nodeId,e)}return{byNodeId:t,byFrameId:n}}const pr=new Set([`completed`,`skipped`,`waiting`]);function L(e,t,n){let r=e?.byNodeId.get(t)??[],i=n.statuses??pr;return r.find(e=>e.parentFrameId===n.parentFrameId&&e.branchKey===n.branchKey&&e.iteration===n.iteration&&i.has(e.status))}function R(e,t,n){let r={...e.frames,[t]:n};return{...e,frames:r,previousSteps:mn(r),output:n.status===`completed`?n.output:e.output}}function z(e,t){if(typeof AbortSignal.any==`function`)return AbortSignal.any([e,t]);let n=new AbortController,r=()=>n.abort();return e.addEventListener(`abort`,r,{once:!0}),t.addEventListener(`abort`,r,{once:!0}),n.signal}const mr=new Set([`completed`,`running`]);function hr(e,t){return e.status===`running`&&t.pauseSignal?.aborted===!0&&!t.outerSignal.aborted}async function gr(e,t,n,r,i,a,o=`all-settled`){if(t.signal.aborted)return{status:`cancelled`};let s=Object.entries(e.branches);if(s.length===0)return{status:`completed`,output:yr({},o)};let c=new AbortController,l=new AbortController,u=t.suspensionStrategy!==`wait-in-process`,d=o===`fail-fast`?z(c.signal,l.signal):u?l.signal:void 0,f=d===void 0?t.signal:z(t.signal,d),p=f===t.signal?t:t.withSignal(f),m=s.map(([s,c])=>_r(s,c,e,p,n,r,i,a,{outerSignal:t.signal,pauseSignal:o===`fail-fast`||u?l.signal:void 0}));if(o===`all-settled`){let e=await Promise.all(u?m.map(e=>e.then(e=>(e.status===`paused`&&l.abort(),e))):m),t=e.find(e=>e.status===`paused`);return t===void 0?{status:`completed`,output:yr(br(s,e),o)}:t}let h=await vr(s,m,c,l);return h.type===`cancelled`?{status:`cancelled`}:h.type===`paused`?h.outcome:h.type===`failed`?{status:`failed`,error:h.error}:{status:`completed`,output:yr(br(s,h.outcomes),o)}}async function _r(e,t,n,r,i,a,o,s,c){if(r.signal.aborted)return{status:`cancelled`};let l=L(r.resumeFrames,n.id,{parentFrameId:o,branchKey:e,statuses:mr});if(l?.status===`completed`)return{status:`completed`,...l.output===void 0?{}:{output:l.output}};let u=l??r.createFrame({nodeId:n.id,nodeType:`parallel`,path:s,parentFrameId:o,branchKey:e});if(r.signal.aborted)return hr(u,c)||await $(u,r),{status:`cancelled`};l===void 0&&await X(u,r);let d;try{d=await a(t,r,i,u.frameId,u.path)}catch(e){let t=e instanceof Error?e.message:String(e);return await Q(u,r,t),{status:`failed`,error:t}}switch(d.status){case`completed`:{let e=ur(t,u.frameId,r);return await Z(u,r,e),{status:`completed`,output:e}}case`skipped`:return await Z(u,r),{status:`completed`};case`cancelled`:return hr(u,c)||await $(u,r),{status:`cancelled`};case`paused`:return d;case`failed`:return await Q(u,r,d.error),{status:`failed`,error:d.error}}}async function vr(e,t,n,r){let i,a,o=t.map(e=>e.then(e=>(e.status===`failed`&&i===void 0?(i=e.error,n.abort()):e.status===`paused`&&a===void 0&&(a=e,r.abort()),e),e=>{let t=e instanceof Error?e.message:String(e);return i===void 0&&(i=t,n.abort()),{status:`failed`,error:t}})),s=await Promise.all(o);return a===void 0?s.some(e=>e.status===`cancelled`)&&i===void 0?{type:`cancelled`}:i===void 0?{type:`completed`,outcomes:s}:{type:`failed`,error:i}:{type:`paused`,outcome:a}}function yr(e,t){return{mode:t,branches:e}}function br(e,t){let n={};for(let r=0;r<e.length;r++){let[i]=e[r],a=t[r];n[i]=xr(a)}return n}function xr(e){switch(e.status){case`completed`:return{status:`fulfilled`,...e.output===void 0?{}:{value:e.output}};case`skipped`:return{status:`fulfilled`,value:null};case`cancelled`:return{status:`cancelled`};case`paused`:return{status:`paused`,pausedAtGateId:e.pausedAtGateId,pausedAtFrameId:e.pausedAtFrameId};case`failed`:return{status:`rejected`,reason:e.error}}}const Sr=new Ze.default({allErrors:!0,strict:!1});function B(e,t){if(t===void 0)return{status:`ok`};try{return{status:`ok`,validator:Sr.compile(t)}}catch(t){return{status:`failed`,error:`Gate '${e}' has an invalid resumeSchema: ${t instanceof Error?t.message:String(t)}`}}}function V(e,t){return e===void 0||e(t)?{valid:!0}:{valid:!1,error:Cr(e.errors??[])}}function H(e,t,n){let r=B(e,t);return r.status===`failed`?{valid:!1,error:r.error}:V(r.validator,n)}function Cr(e){return e.length===0?`schema validation failed`:e.map(e=>`${e.instancePath.length>0?e.instancePath:`/`} ${e.message??`is invalid`}`).join(`; `)}function wr(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const Tr={action:`approve`,source:`timeout`};function Er(e){return e===void 0?{}:{reason:e}}async function Dr(e,t,n,r){let i=()=>{t.value&&(t.value=!1,e.reject(`cancelled`))};n.addEventListener(`abort`,i,{once:!0}),n.aborted&&i();let a=[e.promise],o;if(r!==null){let e=wr();o=setTimeout(()=>{t.value&&(t.value=!1,n.removeEventListener(`abort`,i),e.reject(`timed-out`))},r),a.push(e.promise)}try{let e=await Promise.race(a);return n.removeEventListener(`abort`,i),o!==void 0&&clearTimeout(o),{action:e.action,resumeData:e.resumeData,timedOut:!1,wasCancelled:!1,reason:e.reason}}catch(e){return o!==void 0&&clearTimeout(o),n.removeEventListener(`abort`,i),e===`timed-out`?{action:`reject`,resumeData:null,timedOut:!0,wasCancelled:!1}:{action:`reject`,resumeData:null,timedOut:!1,wasCancelled:!0}}}async function Or(e,t,n,r,i,a){let o={required:e.suspensionStrategy!==`wait-in-process`};if(a.timedOut){let a=Date.now();if(r.autoAction===`approve`){let s=V(i,Tr);return s.valid?(await U(e,{...r,status:`resumed`,resumeData:Tr,resolvedAt:a},o),await W(e,t.id,n,{action:`approve`,source:`timeout`}),{status:`completed`,output:{resumeData:Tr}}):(await U(e,{...r,status:`timed-out`,resolvedAt:a},o),await W(e,t.id,n,{action:`reject`,source:`timeout`}),{status:`failed`,error:`Gate '${t.id}' auto-approve timeout resume data does not match resumeSchema: ${s.error}`})}return await U(e,{...r,status:`timed-out`,resolvedAt:a},o),await W(e,t.id,n,{action:`reject`,source:`timeout`}),{status:`failed`,error:`Gate '${t.id}' timed out after ${String(r.timeoutMs)}ms and auto-rejected`}}if(a.wasCancelled||e.signal.aborted)return await U(e,{...r,status:`cancelled`,resolvedAt:Date.now()},o),await W(e,t.id,n,{source:`cancelled`}),{status:`cancelled`};let s=Date.now();await U(e,{...r,status:a.action===`reject`?`rejected`:`resumed`,resumeData:a.resumeData,...Er(a.reason),resolvedAt:s},o);try{await e.bus.emit(T.gate.resumed,{executionId:e.executionId,frameId:n,nodeId:t.id,resumeData:a.resumeData}),await W(e,t.id,n,{action:a.action,source:`user`,...Er(a.reason)})}catch(e){console.error(`[GateNode] gate.resumed emit failed for '${t.id}':`,e)}return{status:`completed`,output:{resumeData:a.resumeData}}}async function kr(e,t,n,r){if(t.signal.aborted)return{status:`cancelled`};let i=e.resumeSchema??{};if(t.suspensionStrategy!==`wait-in-process`){let n=await Nr(t,e,r);if(n!==void 0)return n}let a=B(e.id,e.resumeSchema);return a.status===`failed`?{status:`failed`,error:a.error}:Ar(t,e,n,r,i,a.validator)}async function Ar(e,t,n,r,i,a){let o=j(t.prompt,I(n)),s={executionId:e.executionId,nodeId:t.id,frameId:r,schema:i,prompt:o,status:`waiting`,autoAction:t.autoAction,timeoutMs:t.timeoutMs,createdAt:Date.now()},c=e.suspensionStrategy!==`wait-in-process`;if(await U(e,s,{required:c}),await e.updateFrame(r,{status:`waiting`},{requireFrameStorage:c}),c)return await jr(e,t,r,i,o,s.createdAt),{status:`paused`,pausedAtGateId:t.id,pausedAtFrameId:r};let u={value:!0},d=wr(),f=e.bus.on(T.gate.respond,async n=>{let{executionId:i,gateId:o,frameId:s,action:c,resumeData:f,reason:p}=n.payload;if(i!==e.executionId||o!==t.id||s!==void 0&&s!==r){try{await n.next()}catch(e){if(e instanceof l)n.setResult({accepted:!1});else throw e}return}if(!u.value){n.setResult({accepted:!1});return}if(!V(a,f).valid){n.setResult({accepted:!1});return}u.value=!1,n.setResult({accepted:!0}),d.resolve({action:c,resumeData:f,reason:p})});await jr(e,t,r,i,o,s.createdAt);let p=await Dr(d,u,e.signal,t.timeoutMs);return f(),Or(e,t,r,s,a,p)}async function jr(e,t,n,r,i,a){try{await e.bus.emit(T.gate.suspended,{executionId:e.executionId,frameId:n,nodeId:t.id,schema:r,prompt:i,...t.title!==void 0&&{title:t.title},autoAction:t.autoAction,timeoutMs:t.timeoutMs,openedAt:a})}catch(e){console.error(`[GateNode] gate.suspended emit failed for '${t.id}':`,e)}}async function Mr(e,t,n){if(e.suspensionStrategy!==`wait-in-process`)return(await e.bus.request(N.getGateInstance,{executionId:e.executionId,nodeId:t,frameId:n})).gate;let r=await e.bus.requestOptional(N.getGateInstance,{executionId:e.executionId,nodeId:t,frameId:n});return r.handled?r.data.gate:null}async function Nr(e,t,n){let r=await Mr(e,t.id,n);if((r?.status===`resumed`||r?.status===`rejected`)&&r.resumeData!==void 0){let i=H(t.id,r.schema,r.resumeData);if(!i.valid)return{status:`failed`,error:`Gate '${t.id}' persisted resumeData is invalid: ${i.error}`};try{await e.bus.emit(T.gate.resumed,{executionId:e.executionId,frameId:n,nodeId:t.id,resumeData:r.resumeData})}catch(e){console.error(`[GateNode] gate.resumed emit failed for '${t.id}':`,e)}return await W(e,t.id,n,{action:r.status===`rejected`?`reject`:`approve`,source:`user`,...Er(r.reason)}),{status:`completed`,output:{resumeData:r.resumeData}}}if(r?.status===`waiting`){if(r.timeoutMs!==null&&Date.now()>=r.createdAt+r.timeoutMs){let i=B(t.id,r.schema);return i.status===`failed`?{status:`failed`,error:i.error}:Or(e,t,n,r,i.validator,{action:`reject`,resumeData:null,timedOut:!0,wasCancelled:!1})}return{status:`paused`,pausedAtGateId:t.id,pausedAtFrameId:n}}if((r?.status===`resumed`||r?.status===`rejected`)&&r.resumeData===void 0)return{status:`failed`,error:`Gate '${t.id}' has status '${r.status}' but resumeData is missing — cannot reconstruct output`};if(r!==null)return{status:`failed`,error:`Gate '${t.id}' cannot resume from status '${r.status}'`}}async function U(e,t,n={}){try{n.required===!0?await e.bus.request(N.setGateInstance,{gate:t}):await e.bus.requestOptional(N.setGateInstance,{gate:t})}catch(e){if(n.required===!0)throw e;console.warn(`[GateNode] Failed to upsert gate instance for '${t.nodeId}':`,e)}}async function W(e,t,n,r){try{await e.bus.emit(T.gate.resolved,{executionId:e.executionId,stepId:t,stepType:`gate`,frameId:n,...r})}catch(e){console.error(`[GateNode] gate.resolved emit failed for '${t}':`,e)}}function G(e){return{status:`fulfilled`,...e===void 0?{}:{value:e}}}const Pr=new Set([`completed`,`running`]);function Fr(e,t){return e.status===`running`&&t.pauseSignal?.aborted===!0&&!t.outerSignal.aborted}async function Ir(e,t,n,r,i,a){if(t.signal.aborted)return{status:`cancelled`};let o=lr(e.id,`iterate`,e.collection,n);if(!Array.isArray(o))return o;let s=o;if(s.length===0)return{status:`completed`,output:Br([])};let c=await Lr(s,e,t,n,r,i,a,e.concurrency!==void 0&&e.concurrency>0?e.concurrency:0);if(t.signal.aborted&&c.every(e=>e.status===`cancelled`))return{status:`cancelled`};let l=c.find(e=>e.status===`paused`);return l===void 0?{status:`completed`,output:Br(c)}:{status:`paused`,pausedAtGateId:l.pausedAtGateId,pausedAtFrameId:l.pausedAtFrameId}}async function Lr(e,t,n,r,i,a,o,s){let c=new AbortController,l=n.suspensionStrategy!==`wait-in-process`,u=l?z(n.signal,c.signal):n.signal,d=u===n.signal?n:n.withSignal(u),f={outerSignal:n.signal,...l?{pauseSignal:c.signal}:{}};if(s===0){let n=e.map((e,n)=>zr(e,n,t,d,r,i,a,o,f));return Promise.all(l?n.map(e=>Rr(e,c)):n)}let p=Array(e.length);for(let n=0;n<e.length;n+=s){if(d.signal.aborted){for(let t=n;t<e.length;t++)p[t]={status:`cancelled`};break}let u=Math.min(n+s,e.length),m=[];for(let s=n;s<u;s++)m.push(zr(e[s],s,t,d,r,i,a,o,f));let h=await Promise.all(l?m.map(e=>Rr(e,c)):m);for(let e=0;e<h.length;e++)p[n+e]=h[e];if(h.some(e=>e.status===`paused`)){for(let t=u;t<e.length;t++)p[t]={status:`cancelled`};break}}return p}function Rr(e,t){return e.then(e=>(e.status===`paused`&&t.abort(),e))}async function zr(e,t,n,r,i,a,o,s,c){if(r.signal.aborted)return{status:`cancelled`};let l={...i,item:e,index:t},u=L(r.resumeFrames,n.id,{parentFrameId:o,iteration:t,statuses:Pr});if(u?.status===`completed`)return G(u.output);let d=u??r.createFrame({nodeId:n.id,nodeType:`iterate`,path:s,parentFrameId:o,iteration:t});if(r.signal.aborted)return Fr(d,c)||await $(d,r),{status:`cancelled`};u===void 0&&await X(d,r);let f;try{f=await a(n.body,r,l,d.frameId,d.path)}catch(e){let t=e instanceof Error?e.message:String(e);return await Q(d,r,t),{status:`rejected`,reason:t}}switch(f.status){case`completed`:{let e=dr(n,d.frameId,r);return await Z(d,r,e),G(e)}case`skipped`:return await Z(d,r),G();case`cancelled`:return Fr(d,c)||await $(d,r),{status:`cancelled`};case`paused`:return f;case`failed`:return await Q(d,r,f.error),{status:`rejected`,reason:f.error}}}function Br(e){return{items:e}}const Vr=new Set([`completed`,`running`]);async function Hr(e,t,n,r,i,a){if(t.signal.aborted)return{status:`cancelled`};let o=lr(e.id,`iterate-chain`,e.collection,n);if(!Array.isArray(o))return o;let s=o;if(s.length===0)return{status:`completed`,output:Wr([])};let c=[],l;for(let o=0;o<s.length;o++){if(t.signal.aborted)return{status:`cancelled`};let u=s[o],d=await Ur(u,o,l,e,t,n,r,i,a);switch(c.push(d),d.status){case`fulfilled`:l=d.value;break;case`rejected`:return{status:`failed`,error:d.reason};case`cancelled`:return{status:`cancelled`};case`paused`:return{status:`paused`,pausedAtGateId:d.pausedAtGateId,pausedAtFrameId:d.pausedAtFrameId}}}return{status:`completed`,output:Wr(c)}}async function Ur(e,t,n,r,i,a,o,s,c){if(i.signal.aborted)return{status:`cancelled`};let l={...a,item:e,index:t,...n!==void 0&&{previous:n}},u=L(i.resumeFrames,r.id,{parentFrameId:s,iteration:t,statuses:Vr});if(u?.status===`completed`)return G(u.output);let d=u??i.createFrame({nodeId:r.id,nodeType:`iterate-chain`,path:c,parentFrameId:s,iteration:t});if(i.signal.aborted)return await $(d,i),{status:`cancelled`};u===void 0&&await X(d,i);let f;try{f=await o(r.body,i,l,d.frameId,d.path)}catch(e){let t=e instanceof Error?e.message:String(e);return await Q(d,i,t),{status:`rejected`,reason:t}}switch(f.status){case`completed`:{let e=dr(r,d.frameId,i);return await Z(d,i,e),G(e)}case`skipped`:return await Z(d,i),G();case`cancelled`:return await $(d,i),{status:`cancelled`};case`paused`:return f;case`failed`:return await Q(d,i,f.error),{status:`rejected`,reason:f.error}}}function Wr(e){return{items:e}}async function Gr(e,t,n,r){let i=()=>{t.value&&(t.value=!1,e.reject(`cancelled`))};n.addEventListener(`abort`,i,{once:!0}),n.aborted&&i();let a=[e.promise],o;if(r!==null){let e=new Promise((e,a)=>{o=setTimeout(()=>{t.value&&(t.value=!1,n.removeEventListener(`abort`,i),a(`timed-out`))},r)});a.push(e)}try{return{status:`resolved`,value:await Promise.race(a)}}catch(e){if(e===`timed-out`)return{status:`timed-out`};if(e===`cancelled`)return{status:`cancelled`};throw e}finally{o!==void 0&&clearTimeout(o),n.removeEventListener(`abort`,i)}}const K={action:`approve`,source:`timeout`};async function q(e,t,n){try{n?await e.bus.request(N.setGateInstance,{gate:t}):await e.bus.requestOptional(N.setGateInstance,{gate:t})}catch(e){if(n)throw e;console.warn(`[LoopNode] Failed to upsert escalation gate for '${t.nodeId}':`,e)}}async function Kr(e,t,n,r,i,a){try{await e.bus.emit(T.gate.suspended,{executionId:e.executionId,frameId:n,nodeId:t.id,schema:r,prompt:i,...t.gate.escalation?.title!==void 0&&{title:t.gate.escalation.title},autoAction:t.gate.escalation?.autoAction??`reject`,timeoutMs:t.gate.escalation?.timeoutMs??null,openedAt:a})}catch(e){console.error(`[LoopNode] gate.suspended emit failed for '${t.id}':`,e)}}async function J(e,t,n,r){try{await e.bus.emit(T.gate.resolved,{executionId:e.executionId,stepId:t,stepType:`gate`,frameId:n,...r})}catch(e){console.error(`[LoopNode] gate.resolved emit failed for '${t}':`,e)}}function qr(e){let{node:t,ctx:n,parentFrameId:r,validator:i,pending:a,deferred:o}=e;return n.bus.on(T.gate.respond,async e=>{let{executionId:s,gateId:c,frameId:u,action:d,resumeData:f,reason:p}=e.payload;if(s!==n.executionId||c!==t.id||u!==void 0&&u!==r){try{await e.next()}catch(t){if(t instanceof l)e.setResult({accepted:!1});else throw t}return}if(!a.value){e.setResult({accepted:!1});return}if(!V(i,f).valid){e.setResult({accepted:!1});return}a.value=!1,e.setResult({accepted:!0}),o.resolve({action:d,resumeData:f,reason:p})})}async function Jr(e,t,n,r,i,a,o){let s=B(e.id,e.gate.escalation?.resumeSchema);if(s.status===`failed`)return{status:`failed`,error:s.error};let c={value:!0},l=wr(),u=qr({node:e,ctx:t,parentFrameId:n,validator:s.validator,pending:c,deferred:l});await Kr(t,e,n,r.schema,r.prompt??``,r.createdAt);try{let s=await Gr(l,c,t.signal,r.timeoutMs);return s.status===`timed-out`?Zr(t,e,n,r,i,a,o,!1):s.status===`resolved`?Yr(t,e.id,n,r,s.value,i,a,o):(await q(t,{...r,status:`cancelled`,resolvedAt:Date.now()},!1),await J(t,e.id,n,{source:`cancelled`}),{status:`cancelled`})}finally{u()}}async function Yr(e,t,n,r,i,a,o,s){let c=Date.now(),l=i.action===`reject`?`rejected`:`resumed`;await q(e,{...r,status:l,resumeData:i.resumeData,...i.reason===void 0?{}:{reason:i.reason},resolvedAt:c},!1);try{await e.bus.emit(T.gate.resumed,{executionId:e.executionId,frameId:n,nodeId:t,resumeData:i.resumeData}),await J(e,t,n,{action:i.action,source:`user`,...i.reason===void 0?{}:{reason:i.reason}})}catch(e){console.error(`[LoopNode] gate.resumed emit failed for '${t}':`,e)}return{status:`completed`,output:Y(`escalate`,o,a,s,i.resumeData)}}async function Xr(e,t,n,r,i,a,o){let s=e.gate.escalation;if(s===void 0)return{status:`completed`,output:Y(`escalate`,a,i,o)};let c=j(s.prompt,I(n)),l=s.resumeSchema??{},u={executionId:t.executionId,nodeId:e.id,frameId:r,schema:l,prompt:c,status:`waiting`,autoAction:s.autoAction??`reject`,timeoutMs:s.timeoutMs??null,createdAt:Date.now()},d=t.suspensionStrategy!==`wait-in-process`;return await q(t,u,d),await t.updateFrame(r,{status:`waiting`},{requireFrameStorage:d}),d?(await Kr(t,e,r,l,c,u.createdAt),{status:`paused`,pausedAtGateId:e.id,pausedAtFrameId:r}):Jr(e,t,r,u,i,a,o)}async function Zr(e,t,n,r,i,a,o,s=!0){let c=Date.now();if(r.autoAction===`approve`){let l=H(t.id,r.schema,K);return l.valid?(await q(e,{...r,status:`resumed`,resumeData:K,resolvedAt:c},s),await J(e,t.id,n,{action:`approve`,source:`timeout`}),{status:`completed`,output:Y(`escalate`,a,i,o,K)}):(await q(e,{...r,status:`timed-out`,resolvedAt:c},s),await J(e,t.id,n,{action:`reject`,source:`timeout`}),{status:`failed`,error:`Loop '${t.id}' escalation gate auto-approve timeout resume data does not match resumeSchema: ${l.error}`})}return await q(e,{...r,status:`timed-out`,resolvedAt:c},s),await J(e,t.id,n,{action:`reject`,source:`timeout`}),{status:`failed`,error:`Loop '${t.id}' escalation gate timed out after ${String(r.timeoutMs)}ms and auto-rejected`}}async function Qr(e,t,n){if(e.suspensionStrategy!==`wait-in-process`)return(await e.bus.request(N.getGateInstance,{executionId:e.executionId,nodeId:t,frameId:n})).gate;let r=await e.bus.requestOptional(N.getGateInstance,{executionId:e.executionId,nodeId:t,frameId:n});return r.handled?r.data.gate:null}async function $r(e,t,n,r,i,a){let o=await Qr(e,t.id,n);if(o!==null){if((o.status===`resumed`||o.status===`rejected`)&&o.resumeData!==void 0){let s=H(t.id,o.schema,o.resumeData);if(!s.valid)return{status:`failed`,error:`Loop '${t.id}' escalation gate resumeData is invalid: ${s.error}`};try{await e.bus.emit(T.gate.resumed,{executionId:e.executionId,frameId:n,nodeId:t.id,resumeData:o.resumeData})}catch(e){console.error(`[LoopNode] gate.resumed emit failed for '${t.id}':`,e)}return await J(e,t.id,n,{action:o.status===`rejected`?`reject`:`approve`,source:`user`,...o.reason===void 0?{}:{reason:o.reason}}),{status:`completed`,output:Y(`escalate`,i,r,a,o.resumeData)}}return o.status===`waiting`?o.timeoutMs!==null&&Date.now()>=o.createdAt+o.timeoutMs?Zr(e,t,n,o,r,i,a):{status:`paused`,pausedAtGateId:t.id,pausedAtFrameId:n}:(o.status===`resumed`||o.status===`rejected`)&&o.resumeData===void 0?{status:`failed`,error:`Loop '${t.id}' escalation gate has status '${o.status}' but resumeData is missing`}:{status:`failed`,error:`Loop '${t.id}' escalation gate cannot resume from status '${o.status}'`}}}const ei=new Set([`completed`,`running`]);async function ti(e,t,n,r,i,a,o){let s=L(n.resumeFrames,e.id,{parentFrameId:a,iteration:t,statuses:ei});if(s?.status===`completed`)return{terminal:!1,output:s.output??null,replayed:!0,gateExpressionCtx:ri(e,n,r,s.frameId)};let c=s??n.createFrame({nodeId:e.id,nodeType:`loop`,path:o,parentFrameId:a,iteration:t});if(n.signal.aborted)return await $(c,n),{terminal:!0,outcome:{status:`cancelled`}};s===void 0&&await X(c,n);let l=await ii(e,c,n,r,i);if(l!==void 0)return{terminal:!0,outcome:l};let u=ur(e.body,c.frameId,n)??null;return await Z(c,n,u),{terminal:!1,output:u,replayed:!1,gateExpressionCtx:ri(e,n,r,c.frameId)}}function ni(e,t,n,r){return L(n.resumeFrames,e.id,{parentFrameId:r,iteration:t,statuses:ei})!==void 0}function ri(e,t,n,r){let i=n;for(let n of e.body.nodes){let e=t.getFramesByNodeId(n.id).find(e=>e.parentFrameId===r&&e.status===`completed`);e!==void 0&&(i=R(i,n.id,{status:`completed`,...e.output===void 0?{}:{output:e.output}}))}return i}async function ii(e,t,n,r,i){let a;try{a=await i(e.body,n,r,t.frameId,t.path)}catch(e){let r=e instanceof Error?e.message:String(e);return await Q(t,n,r),{status:`failed`,error:r}}switch(a.status){case`failed`:return await Q(t,n,a.error),{status:`failed`,error:a.error};case`cancelled`:return await $(t,n),{status:`cancelled`};case`paused`:return a;case`skipped`:case`completed`:return}}function ai(e,t,n,r,i){let a=null;if(e.gate.input!==void 0)try{let t=I(r);a=A(e.gate.input,t)}catch(t){let n=t instanceof Error?t.message:String(t);return{status:`failed`,error:`Loop node '${e.id}': gate input expression evaluation failed: ${n}`}}let o=e.gate.config??null,s=i(a,o,{executionId:n.executionId,nodeId:e.id,round:t+1,maxRounds:e.maxRounds});return s.kind===`loop`&&t+1>=e.maxRounds?{kind:`escalate`,reason:`max_rounds_reached`}:s}async function oi(e,t,n,r,i,a){if(t.signal.aborted)return{status:`cancelled`};let o=t.runtimeLoopGates.get(e.gate.handler);if(o===void 0)return{status:`failed`,error:`Loop node '${e.id}': no gate handler registered for '${e.gate.handler}'`};let s=[],c=0;for(;;){if(t.signal.aborted)return{status:`cancelled`};let l=await ti(e,c,t,n,r,i,a);if(l.terminal)return l.outcome;if(s.push(l.output),l.replayed){if(c++,ni(e,c,t,i))continue;if(e.gate.escalation!==void 0&&t.suspensionStrategy!==`wait-in-process`){let n=await $r(t,e,i,{kind:`escalate`,reason:`resumed_from_gate`},c,s);if(n!==void 0)return n}continue}let u=ai(e,c,t,l.gateExpressionCtx,o);if(`status`in u)return u;if(u.kind===`pass`)return{status:`completed`,output:Y(`pass`,c+1,u,s)};if(u.kind===`escalate`)return e.gate.escalation===void 0?{status:`completed`,output:Y(`escalate`,c+1,u,s)}:Xr(e,t,n,i,u,c+1,s);c++}}function Y(e,t,n,r,i){return{outcome:e,rounds:t,lastGateOutcome:n,bodyOutputs:r,...i===void 0?{}:{resumeData:i}}}async function X(e,t){e.status=`running`,e.startedAt=Date.now(),await t.persistFrame(e),await t.emitFrameStarted(e)}async function Z(e,t,n){let r=Date.now(),i=e.startedAt===void 0?void 0:Math.max(0,r-e.startedAt);e.status=`completed`,e.output=n,e.completedAt=r,await t.persistFrame(e),await t.emitFrameCompleted(e,i)}async function Q(e,t,n){let r=Date.now(),i=e.startedAt===void 0?void 0:Math.max(0,r-e.startedAt);e.status=`failed`,e.error=n,e.completedAt=r,await t.persistFrame(e),await t.emitFrameFailed(e,n,i)}async function si(e,t){e.status=`skipped`,e.completedAt=Date.now(),await t.persistFrame(e)}async function $(e,t){e.status=`cancelled`,e.completedAt=Date.now(),await t.persistFrame(e)}function ci(e,t){return!!A(e,I(t))}async function li(e,t,n,r,i,a=[]){if(t.signal.aborted)return{status:`cancelled`};switch(e.type){case`sequence`:return r(e,t,n,i,a);case`station`:return Gn(e,t,n,i);case`delegate-agent`:return qn(e,t,n,i);case`delegate-role`:return Jn(e,t,n,i);case`parallel`:return gr(e,t,n,r,i??``,a,e.mode??`all-settled`);case`gate`:return kr(e,t,n,i??``);case`iterate`:return Ir(e,t,n,r,i??``,a);case`iterate-chain`:return Hr(e,t,n,r,i??``,a);case`loop`:return oi(e,t,n,r,i??``,a);default:return{status:`failed`,error:`Unknown node type: ${String(e.type)}`}}}const ui=new Set([`completed`,`skipped`,`waiting`,`running`]);function di(e){return e.type===`parallel`||e.type===`iterate`||e.type===`iterate-chain`||e.type===`loop`}function fi(e,t,n){return L(e.resumeFrames,t.id,{parentFrameId:n,...di(t)?{statuses:ui}:{}})}function pi(e,t,n){if(n?.status===`completed`)return R(e,t.id,{status:`completed`,...n.output===void 0?{}:{output:n.output}});if(n?.status===`skipped`)return R(e,t.id,{status:`skipped`})}async function mi(e,t,n,r,i,a,o){try{return{result:ci(e,i)}}catch(e){let i=e instanceof Error?e.message:String(e);return await Q(r.createFrame({nodeId:n.id,nodeType:n.type,path:a,parentFrameId:o}),r,`'${t}' condition evaluation failed: ${i}`),{status:`failed`,error:`'${t}' condition evaluation failed for '${n.id}': ${i}`}}}async function hi(e,t,n,r,i,a){let o=a??t.createFrame({nodeId:e.id,nodeType:e.type,path:r,parentFrameId:i});if(t.signal.aborted)return await $(o,t),{updatedCtx:n,outcome:{status:`cancelled`}};a===void 0&&await X(o,t);let s;try{s=await li(e,t,n,gi,o.frameId,o.path)}catch(e){let r=e instanceof Error?e.message:String(e);return await Q(o,t,r),{updatedCtx:n,outcome:{status:`failed`,error:r}}}switch(s.status){case`completed`:return await Z(o,t,s.output),{updatedCtx:R(n,e.id,{status:`completed`,output:s.output})};case`skipped`:return await si(o,t),{updatedCtx:R(n,e.id,{status:`skipped`})};case`cancelled`:return await $(o,t),{updatedCtx:n,outcome:{status:`cancelled`}};case`paused`:return{updatedCtx:n,outcome:s};case`failed`:return await Q(o,t,s.error),{updatedCtx:n,outcome:{status:`failed`,error:s.error}}}}async function gi(e,t,n,r,i=[]){let a=n;for(let n of e.nodes){if(t.signal.aborted)return{status:`cancelled`};let e=fi(t,n,r),o=pi(a,n,e);if(o!==void 0){a=o;continue}if(n.when!==void 0){let e=await mi(n.when,`when`,n,t,a,i,r);if(`status`in e)return e;if(!e.result){await si(t.createFrame({nodeId:n.id,nodeType:n.type,path:i,parentFrameId:r}),t),a=R(a,n.id,{status:`skipped`});continue}}if(n.skip!==void 0){let e=await mi(n.skip,`skip`,n,t,a,i,r);if(`status`in e)return e;if(e.result){await si(t.createFrame({nodeId:n.id,nodeType:n.type,path:i,parentFrameId:r}),t),a=R(a,n.id,{status:`skipped`});continue}}let s=e?.status===`waiting`&&n.type===`gate`||(e?.status===`running`||e?.status===`waiting`)&&di(n)?e:void 0,{updatedCtx:c,outcome:l}=await hi(n,t,a,i,r,s);if(a=c,l!==void 0)return l}return{status:`completed`}}function _i(e,t){let n=new Set;if(pe(e.root,{enter(e){if(e.type!==`loop`)return;let r=e;t.has(r.gate.handler)||n.add(r.gate.handler)}}),n.size>0)throw Error(`Workflow '${e.id}' is missing loop gate handler(s): ${[...n].join(`, `)}`)}export{Ue as A,ke as B,N as C,we as D,Te as E,M as F,Ie as G,ze as H,De as I,Fe as J,Ve as K,Ee as L,Ge as M,We as N,je as O,Ce as P,Ne as R,Xe as S,xe as T,Re as U,Oe as V,Le as W,le as X,Pe as Y,T as Z,P as _,En as a,ot as b,ln as c,Jt as d,Vt as f,Tt as g,F as h,fr as i,He as j,Ae as k,pn as l,Ot as m,gi as n,yn as o,At as p,Be as q,H as r,Yt as s,_i as t,un as u,Ct as v,Se as w,Qe as x,_t as y,Me as z};
|
|
@@ -17,13 +17,13 @@ declare const AdapterSubsystemNamespace: _$_makaio_core0.BusNamespaceDefinition<
|
|
|
17
17
|
displayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
18
18
|
protocol: _$zod.ZodOptional<_$zod.ZodString>;
|
|
19
19
|
clientId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
20
|
-
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
21
20
|
helpLinks: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
|
|
22
21
|
label: _$zod.ZodString;
|
|
23
22
|
url: _$zod.ZodString;
|
|
24
23
|
}, _$zod_v4_core0.$strict>>>;
|
|
25
24
|
instructions: _$zod.ZodOptional<_$zod.ZodString>;
|
|
26
25
|
providerDefinitionIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
|
|
26
|
+
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
27
27
|
name: _$zod.ZodString;
|
|
28
28
|
enabled: _$zod.ZodBoolean;
|
|
29
29
|
bindings: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -42,13 +42,13 @@ declare const AdapterSubsystemNamespace: _$_makaio_core0.BusNamespaceDefinition<
|
|
|
42
42
|
displayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
43
43
|
protocol: _$zod.ZodOptional<_$zod.ZodString>;
|
|
44
44
|
clientId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
45
|
-
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
46
45
|
helpLinks: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
|
|
47
46
|
label: _$zod.ZodString;
|
|
48
47
|
url: _$zod.ZodString;
|
|
49
48
|
}, _$zod_v4_core0.$strict>>>;
|
|
50
49
|
instructions: _$zod.ZodOptional<_$zod.ZodString>;
|
|
51
50
|
providerDefinitionIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
|
|
51
|
+
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
52
52
|
name: _$zod.ZodString;
|
|
53
53
|
enabled: _$zod.ZodBoolean;
|
|
54
54
|
bindings: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -529,13 +529,13 @@ declare const AdapterSubsystemNamespace: _$_makaio_core0.BusNamespaceDefinition<
|
|
|
529
529
|
displayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
530
530
|
protocol: _$zod.ZodOptional<_$zod.ZodString>;
|
|
531
531
|
clientId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
532
|
-
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
533
532
|
helpLinks: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
|
|
534
533
|
label: _$zod.ZodString;
|
|
535
534
|
url: _$zod.ZodString;
|
|
536
535
|
}, _$zod_v4_core0.$strict>>>;
|
|
537
536
|
instructions: _$zod.ZodOptional<_$zod.ZodString>;
|
|
538
537
|
providerDefinitionIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
|
|
538
|
+
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
539
539
|
name: _$zod.ZodString;
|
|
540
540
|
enabled: _$zod.ZodBoolean;
|
|
541
541
|
bindings: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -672,13 +672,13 @@ declare const AdapterSubsystemSubjects: _$_makaio_core0.BusSubjects<_$_makaio_co
|
|
|
672
672
|
displayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
673
673
|
protocol: _$zod.ZodOptional<_$zod.ZodString>;
|
|
674
674
|
clientId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
675
|
-
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
676
675
|
helpLinks: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
|
|
677
676
|
label: _$zod.ZodString;
|
|
678
677
|
url: _$zod.ZodString;
|
|
679
678
|
}, _$zod_v4_core0.$strict>>>;
|
|
680
679
|
instructions: _$zod.ZodOptional<_$zod.ZodString>;
|
|
681
680
|
providerDefinitionIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
|
|
681
|
+
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
682
682
|
name: _$zod.ZodString;
|
|
683
683
|
enabled: _$zod.ZodBoolean;
|
|
684
684
|
bindings: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -697,13 +697,13 @@ declare const AdapterSubsystemSubjects: _$_makaio_core0.BusSubjects<_$_makaio_co
|
|
|
697
697
|
displayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
698
698
|
protocol: _$zod.ZodOptional<_$zod.ZodString>;
|
|
699
699
|
clientId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
700
|
-
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
701
700
|
helpLinks: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
|
|
702
701
|
label: _$zod.ZodString;
|
|
703
702
|
url: _$zod.ZodString;
|
|
704
703
|
}, _$zod_v4_core0.$strict>>>;
|
|
705
704
|
instructions: _$zod.ZodOptional<_$zod.ZodString>;
|
|
706
705
|
providerDefinitionIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
|
|
706
|
+
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
707
707
|
name: _$zod.ZodString;
|
|
708
708
|
enabled: _$zod.ZodBoolean;
|
|
709
709
|
bindings: _$zod.ZodArray<_$zod.ZodObject<{
|
|
@@ -1184,13 +1184,13 @@ declare const AdapterSubsystemSubjects: _$_makaio_core0.BusSubjects<_$_makaio_co
|
|
|
1184
1184
|
displayName: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1185
1185
|
protocol: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1186
1186
|
clientId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1187
|
-
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
1188
1187
|
helpLinks: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
|
|
1189
1188
|
label: _$zod.ZodString;
|
|
1190
1189
|
url: _$zod.ZodString;
|
|
1191
1190
|
}, _$zod_v4_core0.$strict>>>;
|
|
1192
1191
|
instructions: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1193
1192
|
providerDefinitionIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
|
|
1193
|
+
settings: _$zod.ZodOptional<_$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
1194
1194
|
name: _$zod.ZodString;
|
|
1195
1195
|
enabled: _$zod.ZodBoolean;
|
|
1196
1196
|
bindings: _$zod.ZodArray<_$zod.ZodObject<{
|