@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as WorkflowExecutor, i as WorkflowEngineService, n as createWorkflowEnginePackage, o as registerDrizzleWorkflowStorage, r as workflowEnginePackage, t as WorkflowEngineToken } from "../package-
|
|
1
|
+
import { a as WorkflowExecutor, i as WorkflowEngineService, n as createWorkflowEnginePackage, o as registerDrizzleWorkflowStorage, r as workflowEnginePackage, t as WorkflowEngineToken } from "../package-DmVZxufT.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import * as _$_makaio_core0 from "@makaio/framework/core";
|
|
4
4
|
import { IMakaioBus } from "@makaio/framework/bus";
|
|
@@ -750,7 +750,121 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
750
750
|
id: z.ZodString;
|
|
751
751
|
executionId: z.ZodString;
|
|
752
752
|
}, z.core.$strip>;
|
|
753
|
-
};
|
|
753
|
+
}; /** Atomically persist an external execution and its initial WorkLog rows. */
|
|
754
|
+
setExternalExecutionStart: _$_makaio_core0.LocalSubjectSchema<{
|
|
755
|
+
request: z.ZodObject<{
|
|
756
|
+
execution: z.ZodObject<{
|
|
757
|
+
id: z.ZodString;
|
|
758
|
+
workflowId: z.ZodString;
|
|
759
|
+
coordinatorSessionId: z.ZodOptional<z.ZodString>;
|
|
760
|
+
inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
|
|
761
|
+
config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
762
|
+
startedAt: z.ZodNumber;
|
|
763
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
764
|
+
error: z.ZodOptional<z.ZodString>;
|
|
765
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
766
|
+
triggerPayload: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
767
|
+
scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
768
|
+
type: z.ZodLiteral<"global">;
|
|
769
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
770
|
+
type: z.ZodLiteral<"workspace">;
|
|
771
|
+
id: z.ZodString;
|
|
772
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
773
|
+
type: z.ZodLiteral<"session">;
|
|
774
|
+
id: z.ZodString;
|
|
775
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
776
|
+
type: z.ZodLiteral<"external">;
|
|
777
|
+
kind: z.ZodString;
|
|
778
|
+
id: z.ZodString;
|
|
779
|
+
}, z.core.$strict>], "type">;
|
|
780
|
+
artifactRef: z.ZodOptional<z.ZodObject<{
|
|
781
|
+
kind: z.ZodString;
|
|
782
|
+
id: z.ZodString;
|
|
783
|
+
}, z.core.$strip>>;
|
|
784
|
+
status: z.ZodLiteral<"running">;
|
|
785
|
+
}, z.core.$strip>;
|
|
786
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
787
|
+
executionId: z.ZodString;
|
|
788
|
+
frameId: z.ZodString;
|
|
789
|
+
nodeId: z.ZodString;
|
|
790
|
+
nodeType: z.ZodEnum<{
|
|
791
|
+
station: "station";
|
|
792
|
+
"delegate-agent": "delegate-agent";
|
|
793
|
+
"delegate-role": "delegate-role";
|
|
794
|
+
sequence: "sequence";
|
|
795
|
+
gate: "gate";
|
|
796
|
+
parallel: "parallel";
|
|
797
|
+
iterate: "iterate";
|
|
798
|
+
"iterate-chain": "iterate-chain";
|
|
799
|
+
loop: "loop";
|
|
800
|
+
}>;
|
|
801
|
+
path: z.ZodArray<z.ZodString>;
|
|
802
|
+
attempt: z.ZodNumber;
|
|
803
|
+
iteration: z.ZodOptional<z.ZodNumber>;
|
|
804
|
+
branchKey: z.ZodOptional<z.ZodString>;
|
|
805
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
806
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
807
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
808
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
809
|
+
estimatedCost: z.ZodOptional<z.ZodNumber>;
|
|
810
|
+
error: z.ZodOptional<z.ZodString>;
|
|
811
|
+
status: z.ZodLiteral<"running">;
|
|
812
|
+
startedAt: z.ZodNumber;
|
|
813
|
+
}, z.core.$strip>>;
|
|
814
|
+
}, z.core.$strip>;
|
|
815
|
+
response: z.ZodObject<{
|
|
816
|
+
executionId: z.ZodString;
|
|
817
|
+
frameId: z.ZodOptional<z.ZodString>;
|
|
818
|
+
}, z.core.$strip>;
|
|
819
|
+
}>; /** Atomically settle an external execution and its WorkLog projection. */
|
|
820
|
+
settleExternalExecution: _$_makaio_core0.LocalSubjectSchema<{
|
|
821
|
+
request: z.ZodObject<{
|
|
822
|
+
executionId: z.ZodString;
|
|
823
|
+
status: z.ZodEnum<{
|
|
824
|
+
completed: "completed";
|
|
825
|
+
cancelled: "cancelled";
|
|
826
|
+
failed: "failed";
|
|
827
|
+
}>;
|
|
828
|
+
error: z.ZodOptional<z.ZodString>;
|
|
829
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
830
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
832
|
+
executionId: z.ZodString;
|
|
833
|
+
frameId: z.ZodString;
|
|
834
|
+
nodeId: z.ZodString;
|
|
835
|
+
nodeType: z.ZodEnum<{
|
|
836
|
+
station: "station";
|
|
837
|
+
"delegate-agent": "delegate-agent";
|
|
838
|
+
"delegate-role": "delegate-role";
|
|
839
|
+
sequence: "sequence";
|
|
840
|
+
gate: "gate";
|
|
841
|
+
parallel: "parallel";
|
|
842
|
+
iterate: "iterate";
|
|
843
|
+
"iterate-chain": "iterate-chain";
|
|
844
|
+
loop: "loop";
|
|
845
|
+
}>;
|
|
846
|
+
path: z.ZodArray<z.ZodString>;
|
|
847
|
+
attempt: z.ZodNumber;
|
|
848
|
+
iteration: z.ZodOptional<z.ZodNumber>;
|
|
849
|
+
branchKey: z.ZodOptional<z.ZodString>;
|
|
850
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
851
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
852
|
+
estimatedCost: z.ZodOptional<z.ZodNumber>;
|
|
853
|
+
error: z.ZodOptional<z.ZodString>;
|
|
854
|
+
status: z.ZodEnum<{
|
|
855
|
+
completed: "completed";
|
|
856
|
+
cancelled: "cancelled";
|
|
857
|
+
failed: "failed";
|
|
858
|
+
}>;
|
|
859
|
+
startedAt: z.ZodNumber;
|
|
860
|
+
completedAt: z.ZodNumber;
|
|
861
|
+
durationMs: z.ZodNumber;
|
|
862
|
+
}, z.core.$strip>>;
|
|
863
|
+
}, z.core.$strip>;
|
|
864
|
+
response: z.ZodObject<{
|
|
865
|
+
success: z.ZodBoolean;
|
|
866
|
+
}, z.core.$strip>;
|
|
867
|
+
}>;
|
|
754
868
|
updateExecution: {
|
|
755
869
|
request: z.ZodObject<{
|
|
756
870
|
executionId: z.ZodString;
|
|
@@ -946,12 +1060,12 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
946
1060
|
frameId: z.ZodString;
|
|
947
1061
|
nodeId: z.ZodString;
|
|
948
1062
|
nodeType: z.ZodEnum<{
|
|
949
|
-
sequence: "sequence";
|
|
950
1063
|
station: "station";
|
|
951
1064
|
"delegate-agent": "delegate-agent";
|
|
952
1065
|
"delegate-role": "delegate-role";
|
|
953
|
-
|
|
1066
|
+
sequence: "sequence";
|
|
954
1067
|
gate: "gate";
|
|
1068
|
+
parallel: "parallel";
|
|
955
1069
|
iterate: "iterate";
|
|
956
1070
|
"iterate-chain": "iterate-chain";
|
|
957
1071
|
loop: "loop";
|
|
@@ -992,12 +1106,12 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
992
1106
|
frameId: z.ZodString;
|
|
993
1107
|
nodeId: z.ZodString;
|
|
994
1108
|
nodeType: z.ZodEnum<{
|
|
995
|
-
sequence: "sequence";
|
|
996
1109
|
station: "station";
|
|
997
1110
|
"delegate-agent": "delegate-agent";
|
|
998
1111
|
"delegate-role": "delegate-role";
|
|
999
|
-
|
|
1112
|
+
sequence: "sequence";
|
|
1000
1113
|
gate: "gate";
|
|
1114
|
+
parallel: "parallel";
|
|
1001
1115
|
iterate: "iterate";
|
|
1002
1116
|
"iterate-chain": "iterate-chain";
|
|
1003
1117
|
loop: "loop";
|
|
@@ -1035,12 +1149,12 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1035
1149
|
frameId: z.ZodString;
|
|
1036
1150
|
nodeId: z.ZodString;
|
|
1037
1151
|
nodeType: z.ZodEnum<{
|
|
1038
|
-
sequence: "sequence";
|
|
1039
1152
|
station: "station";
|
|
1040
1153
|
"delegate-agent": "delegate-agent";
|
|
1041
1154
|
"delegate-role": "delegate-role";
|
|
1042
|
-
|
|
1155
|
+
sequence: "sequence";
|
|
1043
1156
|
gate: "gate";
|
|
1157
|
+
parallel: "parallel";
|
|
1044
1158
|
iterate: "iterate";
|
|
1045
1159
|
"iterate-chain": "iterate-chain";
|
|
1046
1160
|
loop: "loop";
|
|
@@ -2587,6 +2701,44 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
2587
2701
|
identity: undefined;
|
|
2588
2702
|
generated: undefined;
|
|
2589
2703
|
}, {}, {}>;
|
|
2704
|
+
externalSettlementFingerprint: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
2705
|
+
name: "external_settlement_fingerprint";
|
|
2706
|
+
tableName: "workflow_executions";
|
|
2707
|
+
dataType: "string";
|
|
2708
|
+
columnType: "SQLiteText";
|
|
2709
|
+
data: string;
|
|
2710
|
+
driverParam: string;
|
|
2711
|
+
notNull: false;
|
|
2712
|
+
hasDefault: false;
|
|
2713
|
+
isPrimaryKey: false;
|
|
2714
|
+
isAutoincrement: false;
|
|
2715
|
+
hasRuntimeDefault: false;
|
|
2716
|
+
enumValues: [string, ...string[]];
|
|
2717
|
+
baseColumn: never;
|
|
2718
|
+
identity: undefined;
|
|
2719
|
+
generated: undefined;
|
|
2720
|
+
}, {}, {
|
|
2721
|
+
length: number | undefined;
|
|
2722
|
+
}>;
|
|
2723
|
+
externalRegistrationFrameId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
2724
|
+
name: "external_registration_frame_id";
|
|
2725
|
+
tableName: "workflow_executions";
|
|
2726
|
+
dataType: "string";
|
|
2727
|
+
columnType: "SQLiteText";
|
|
2728
|
+
data: string;
|
|
2729
|
+
driverParam: string;
|
|
2730
|
+
notNull: false;
|
|
2731
|
+
hasDefault: false;
|
|
2732
|
+
isPrimaryKey: false;
|
|
2733
|
+
isAutoincrement: false;
|
|
2734
|
+
hasRuntimeDefault: false;
|
|
2735
|
+
enumValues: [string, ...string[]];
|
|
2736
|
+
baseColumn: never;
|
|
2737
|
+
identity: undefined;
|
|
2738
|
+
generated: undefined;
|
|
2739
|
+
}, {}, {
|
|
2740
|
+
length: number | undefined;
|
|
2741
|
+
}>;
|
|
2590
2742
|
triggerPayload: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
2591
2743
|
name: string;
|
|
2592
2744
|
tableName: "workflow_executions";
|
|
@@ -2713,7 +2865,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
2713
2865
|
tableName: "workflow_execution_frames";
|
|
2714
2866
|
dataType: "string";
|
|
2715
2867
|
columnType: "SQLiteText";
|
|
2716
|
-
data: "
|
|
2868
|
+
data: "station" | "delegate-agent" | "delegate-role" | "sequence" | "gate" | "parallel" | "iterate" | "iterate-chain" | "loop";
|
|
2717
2869
|
driverParam: string;
|
|
2718
2870
|
notNull: true;
|
|
2719
2871
|
hasDefault: false;
|
|
@@ -2726,7 +2878,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
2726
2878
|
generated: undefined;
|
|
2727
2879
|
}, {}, {
|
|
2728
2880
|
length: number | undefined;
|
|
2729
|
-
$type: "
|
|
2881
|
+
$type: "station" | "delegate-agent" | "delegate-role" | "sequence" | "gate" | "parallel" | "iterate" | "iterate-chain" | "loop";
|
|
2730
2882
|
}>;
|
|
2731
2883
|
path: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
2732
2884
|
name: string;
|
|
@@ -4552,7 +4704,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
4552
4704
|
tableName: "worklog_frame_entries";
|
|
4553
4705
|
dataType: "string";
|
|
4554
4706
|
columnType: "SQLiteText";
|
|
4555
|
-
data: "
|
|
4707
|
+
data: "station" | "delegate-agent" | "delegate-role" | "sequence" | "gate" | "parallel" | "iterate" | "iterate-chain" | "loop";
|
|
4556
4708
|
driverParam: string;
|
|
4557
4709
|
notNull: true;
|
|
4558
4710
|
hasDefault: false;
|
|
@@ -4565,7 +4717,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
4565
4717
|
generated: undefined;
|
|
4566
4718
|
}, {}, {
|
|
4567
4719
|
length: number | undefined;
|
|
4568
|
-
$type: "
|
|
4720
|
+
$type: "station" | "delegate-agent" | "delegate-role" | "sequence" | "gate" | "parallel" | "iterate" | "iterate-chain" | "loop";
|
|
4569
4721
|
}>;
|
|
4570
4722
|
path: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
4571
4723
|
name: string;
|
|
@@ -6012,7 +6164,121 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6012
6164
|
id: z.ZodString;
|
|
6013
6165
|
executionId: z.ZodString;
|
|
6014
6166
|
}, z.core.$strip>;
|
|
6015
|
-
};
|
|
6167
|
+
}; /** Atomically persist an external execution and its initial WorkLog rows. */
|
|
6168
|
+
setExternalExecutionStart: _$_makaio_core0.LocalSubjectSchema<{
|
|
6169
|
+
request: z.ZodObject<{
|
|
6170
|
+
execution: z.ZodObject<{
|
|
6171
|
+
id: z.ZodString;
|
|
6172
|
+
workflowId: z.ZodString;
|
|
6173
|
+
coordinatorSessionId: z.ZodOptional<z.ZodString>;
|
|
6174
|
+
inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
|
|
6175
|
+
config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
6176
|
+
startedAt: z.ZodNumber;
|
|
6177
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
6178
|
+
error: z.ZodOptional<z.ZodString>;
|
|
6179
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
6180
|
+
triggerPayload: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
6181
|
+
scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6182
|
+
type: z.ZodLiteral<"global">;
|
|
6183
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6184
|
+
type: z.ZodLiteral<"workspace">;
|
|
6185
|
+
id: z.ZodString;
|
|
6186
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6187
|
+
type: z.ZodLiteral<"session">;
|
|
6188
|
+
id: z.ZodString;
|
|
6189
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6190
|
+
type: z.ZodLiteral<"external">;
|
|
6191
|
+
kind: z.ZodString;
|
|
6192
|
+
id: z.ZodString;
|
|
6193
|
+
}, z.core.$strict>], "type">;
|
|
6194
|
+
artifactRef: z.ZodOptional<z.ZodObject<{
|
|
6195
|
+
kind: z.ZodString;
|
|
6196
|
+
id: z.ZodString;
|
|
6197
|
+
}, z.core.$strip>>;
|
|
6198
|
+
status: z.ZodLiteral<"running">;
|
|
6199
|
+
}, z.core.$strip>;
|
|
6200
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
6201
|
+
executionId: z.ZodString;
|
|
6202
|
+
frameId: z.ZodString;
|
|
6203
|
+
nodeId: z.ZodString;
|
|
6204
|
+
nodeType: z.ZodEnum<{
|
|
6205
|
+
station: "station";
|
|
6206
|
+
"delegate-agent": "delegate-agent";
|
|
6207
|
+
"delegate-role": "delegate-role";
|
|
6208
|
+
sequence: "sequence";
|
|
6209
|
+
gate: "gate";
|
|
6210
|
+
parallel: "parallel";
|
|
6211
|
+
iterate: "iterate";
|
|
6212
|
+
"iterate-chain": "iterate-chain";
|
|
6213
|
+
loop: "loop";
|
|
6214
|
+
}>;
|
|
6215
|
+
path: z.ZodArray<z.ZodString>;
|
|
6216
|
+
attempt: z.ZodNumber;
|
|
6217
|
+
iteration: z.ZodOptional<z.ZodNumber>;
|
|
6218
|
+
branchKey: z.ZodOptional<z.ZodString>;
|
|
6219
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
6220
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
6221
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
6222
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
6223
|
+
estimatedCost: z.ZodOptional<z.ZodNumber>;
|
|
6224
|
+
error: z.ZodOptional<z.ZodString>;
|
|
6225
|
+
status: z.ZodLiteral<"running">;
|
|
6226
|
+
startedAt: z.ZodNumber;
|
|
6227
|
+
}, z.core.$strip>>;
|
|
6228
|
+
}, z.core.$strip>;
|
|
6229
|
+
response: z.ZodObject<{
|
|
6230
|
+
executionId: z.ZodString;
|
|
6231
|
+
frameId: z.ZodOptional<z.ZodString>;
|
|
6232
|
+
}, z.core.$strip>;
|
|
6233
|
+
}>; /** Atomically settle an external execution and its WorkLog projection. */
|
|
6234
|
+
settleExternalExecution: _$_makaio_core0.LocalSubjectSchema<{
|
|
6235
|
+
request: z.ZodObject<{
|
|
6236
|
+
executionId: z.ZodString;
|
|
6237
|
+
status: z.ZodEnum<{
|
|
6238
|
+
completed: "completed";
|
|
6239
|
+
cancelled: "cancelled";
|
|
6240
|
+
failed: "failed";
|
|
6241
|
+
}>;
|
|
6242
|
+
error: z.ZodOptional<z.ZodString>;
|
|
6243
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
6244
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
6245
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
6246
|
+
executionId: z.ZodString;
|
|
6247
|
+
frameId: z.ZodString;
|
|
6248
|
+
nodeId: z.ZodString;
|
|
6249
|
+
nodeType: z.ZodEnum<{
|
|
6250
|
+
station: "station";
|
|
6251
|
+
"delegate-agent": "delegate-agent";
|
|
6252
|
+
"delegate-role": "delegate-role";
|
|
6253
|
+
sequence: "sequence";
|
|
6254
|
+
gate: "gate";
|
|
6255
|
+
parallel: "parallel";
|
|
6256
|
+
iterate: "iterate";
|
|
6257
|
+
"iterate-chain": "iterate-chain";
|
|
6258
|
+
loop: "loop";
|
|
6259
|
+
}>;
|
|
6260
|
+
path: z.ZodArray<z.ZodString>;
|
|
6261
|
+
attempt: z.ZodNumber;
|
|
6262
|
+
iteration: z.ZodOptional<z.ZodNumber>;
|
|
6263
|
+
branchKey: z.ZodOptional<z.ZodString>;
|
|
6264
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
6265
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
6266
|
+
estimatedCost: z.ZodOptional<z.ZodNumber>;
|
|
6267
|
+
error: z.ZodOptional<z.ZodString>;
|
|
6268
|
+
status: z.ZodEnum<{
|
|
6269
|
+
completed: "completed";
|
|
6270
|
+
cancelled: "cancelled";
|
|
6271
|
+
failed: "failed";
|
|
6272
|
+
}>;
|
|
6273
|
+
startedAt: z.ZodNumber;
|
|
6274
|
+
completedAt: z.ZodNumber;
|
|
6275
|
+
durationMs: z.ZodNumber;
|
|
6276
|
+
}, z.core.$strip>>;
|
|
6277
|
+
}, z.core.$strip>;
|
|
6278
|
+
response: z.ZodObject<{
|
|
6279
|
+
success: z.ZodBoolean;
|
|
6280
|
+
}, z.core.$strip>;
|
|
6281
|
+
}>;
|
|
6016
6282
|
updateExecution: {
|
|
6017
6283
|
request: z.ZodObject<{
|
|
6018
6284
|
executionId: z.ZodString;
|
|
@@ -6208,12 +6474,12 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6208
6474
|
frameId: z.ZodString;
|
|
6209
6475
|
nodeId: z.ZodString;
|
|
6210
6476
|
nodeType: z.ZodEnum<{
|
|
6211
|
-
sequence: "sequence";
|
|
6212
6477
|
station: "station";
|
|
6213
6478
|
"delegate-agent": "delegate-agent";
|
|
6214
6479
|
"delegate-role": "delegate-role";
|
|
6215
|
-
|
|
6480
|
+
sequence: "sequence";
|
|
6216
6481
|
gate: "gate";
|
|
6482
|
+
parallel: "parallel";
|
|
6217
6483
|
iterate: "iterate";
|
|
6218
6484
|
"iterate-chain": "iterate-chain";
|
|
6219
6485
|
loop: "loop";
|
|
@@ -6254,12 +6520,12 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6254
6520
|
frameId: z.ZodString;
|
|
6255
6521
|
nodeId: z.ZodString;
|
|
6256
6522
|
nodeType: z.ZodEnum<{
|
|
6257
|
-
sequence: "sequence";
|
|
6258
6523
|
station: "station";
|
|
6259
6524
|
"delegate-agent": "delegate-agent";
|
|
6260
6525
|
"delegate-role": "delegate-role";
|
|
6261
|
-
|
|
6526
|
+
sequence: "sequence";
|
|
6262
6527
|
gate: "gate";
|
|
6528
|
+
parallel: "parallel";
|
|
6263
6529
|
iterate: "iterate";
|
|
6264
6530
|
"iterate-chain": "iterate-chain";
|
|
6265
6531
|
loop: "loop";
|
|
@@ -6297,12 +6563,12 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6297
6563
|
frameId: z.ZodString;
|
|
6298
6564
|
nodeId: z.ZodString;
|
|
6299
6565
|
nodeType: z.ZodEnum<{
|
|
6300
|
-
sequence: "sequence";
|
|
6301
6566
|
station: "station";
|
|
6302
6567
|
"delegate-agent": "delegate-agent";
|
|
6303
6568
|
"delegate-role": "delegate-role";
|
|
6304
|
-
|
|
6569
|
+
sequence: "sequence";
|
|
6305
6570
|
gate: "gate";
|
|
6571
|
+
parallel: "parallel";
|
|
6306
6572
|
iterate: "iterate";
|
|
6307
6573
|
"iterate-chain": "iterate-chain";
|
|
6308
6574
|
loop: "loop";
|
|
@@ -7380,7 +7646,9 @@ declare const workflowExecutionsDual: _$_makaio_storage_drizzle0.DualTable<"work
|
|
|
7380
7646
|
error: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"error", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"error", [string, ...string[]]>>; /** Cancellation reason if execution was cancelled. */
|
|
7381
7647
|
reason: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"reason", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"reason", [string, ...string[]]>>; /** Execution start timestamp. */
|
|
7382
7648
|
startedAt: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgBigInt53BuilderInitial<string>>>; /** Execution completion timestamp. */
|
|
7383
|
-
completedAt: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>, _$drizzle_orm_pg_core0.PgBigInt53BuilderInitial<string>>; /**
|
|
7649
|
+
completedAt: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>, _$drizzle_orm_pg_core0.PgBigInt53BuilderInitial<string>>; /** Canonical identity of an authoritative external settlement, when present. */
|
|
7650
|
+
externalSettlementFingerprint: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"external_settlement_fingerprint", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"external_settlement_fingerprint", [string, ...string[]]>>; /** Frame durably bound by external registration; null means registration had no frame. */
|
|
7651
|
+
externalRegistrationFrameId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"external_registration_frame_id", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"external_registration_frame_id", [string, ...string[]]>>; /** Trigger payload from the firing trigger (JSON object). */
|
|
7384
7652
|
triggerPayload: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm_sqlite_core0.SQLiteTextJsonBuilderInitial<string>, Record<string, JsonValue>>, _$drizzle_orm0.$Type<_$drizzle_orm_pg_core0.PgJsonbBuilderInitial<string>, Record<string, JsonValue>>>; /** Artifact kind the execution is bound to (flat for indexed filtering). */
|
|
7385
7653
|
artifactKind: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"artifact_kind", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"artifact_kind", [string, ...string[]]>>; /** Artifact identifier within its kind. */
|
|
7386
7654
|
artifactId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"artifact_id", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"artifact_id", [string, ...string[]]>>;
|
|
@@ -7442,7 +7710,7 @@ declare const worklogFrameEntriesDual: _$_makaio_storage_drizzle0.DualTable<"wor
|
|
|
7442
7710
|
/** Unique frame identifier within the execution. */frameId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"frame_id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"frame_id", [string, ...string[]]>>>>; /** Execution this frame belongs to. */
|
|
7443
7711
|
executionId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"execution_id", [string, ...string[]], number | undefined>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"execution_id", [string, ...string[]]>>>; /** Node identifier from the workflow definition. */
|
|
7444
7712
|
nodeId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"node_id", [string, ...string[]], number | undefined>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"node_id", [string, ...string[]]>>>; /** Node type discriminant. */
|
|
7445
|
-
nodeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"node_type", [string, ...string[]], number | undefined>>, "
|
|
7713
|
+
nodeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"node_type", [string, ...string[]], number | undefined>>, "station" | "delegate-agent" | "delegate-role" | "sequence" | "gate" | "parallel" | "iterate" | "iterate-chain" | "loop">, _$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"node_type", [string, ...string[]]>>, "station" | "delegate-agent" | "delegate-role" | "sequence" | "gate" | "parallel" | "iterate" | "iterate-chain" | "loop">>;
|
|
7446
7714
|
/**
|
|
7447
7715
|
* Ordered path of frame IDs from the root frame to this frame (inclusive).
|
|
7448
7716
|
* Stored as a JSON array for tree correlation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,F as t,G as n,N as r,S as i,T as a,V as o,Y as s,j as c,v as l}from"../loop-gate-handlers-
|
|
1
|
+
import{C as e,F as t,G as n,N as r,S as i,T as a,V as o,Y as s,j as c,v as l}from"../loop-gate-handlers-o2B5FPdF.mjs";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v}from"../package-Co_GO3UD.mjs";import{JsonValueSchema as y,WorkflowFrameStateSchema as b}from"@makaio/framework/contracts";const x=new Set([...b.shape.status.options]);function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(e){if(!S(e))return!1;for(let t of Object.values(e))if(!S(t)||typeof t.status!=`string`||!x.has(t.status)||`result`in t&&t.result!==void 0&&!y.safeParse(t.result).success)return!1;return!0}function w(e){let t={trigger:S(e.trigger)?e.trigger:{},steps:C(e.steps)?e.steps:{},inputs:y.safeParse(e.inputs).success?e.inputs:{}};return`item`in e&&(t.item=e.item),typeof e.index==`number`&&(t.index=e.index),t}export{f as WorkflowEngineService,v as WorkflowEngineToken,u as WorkflowExecutor,i as WorkflowStorageNamespace,e as WorkflowStorageSubjects,w as buildWorkflowExpressionContextFromResolvedInputs,m as createWorkflowEnginePackage,_ as getWorkflowState,d as initializeWorkflowState,p as patchWorkflowState,h as registerDrizzleWorkflowStorage,l as runShellStep,a as workflowDefinitionsDual,g as workflowEnginePackage,c as workflowExecutionStateDual,r as workflowExecutionStateEventsDual,t as workflowExecutionsDual,o as workflowStepSpansDual,n as worklogFrameEntriesDual,s as worklogSummariesDual};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createWorkflowEnginePackage, r as workflowEnginePackage, t as WorkflowEngineToken } from "../package-
|
|
1
|
+
import { n as createWorkflowEnginePackage, r as workflowEnginePackage, t as WorkflowEngineToken } from "../package-DmVZxufT.mjs";
|
|
2
2
|
export { WorkflowEngineToken, createWorkflowEnginePackage, workflowEnginePackage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"../package-
|
|
1
|
+
import{n as e,r as t,t as n}from"../package-Co_GO3UD.mjs";export{n as WorkflowEngineToken,e as createWorkflowEnginePackage,t as workflowEnginePackage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,Z as t,a as n,b as r,i,m as a,n as o,o as s,s as c,t as l}from"../loop-gate-handlers-
|
|
1
|
+
import{C as e,Z as t,a as n,b as r,i,m as a,n as o,o as s,s as c,t as l}from"../loop-gate-handlers-o2B5FPdF.mjs";import{WORKFLOW_CANCELLED_REASON as u}from"@makaio/framework/contracts";async function d(n,r,i,a){let o=await g(n,r,i);return await n.request(e.setExecution,{execution:o}),i===`completed`?await n.emit(t.execution.completed,{executionId:r.executionId,workflowId:r.workflowId,totalDuration:0,completedAt:o.completedAt}):await n.emit(t.execution.cancelled,{executionId:r.executionId,workflowId:r.workflowId,reason:a,completedAt:o.completedAt}),i===`cancelled`?{executionId:r.executionId,workflowId:r.workflowId,status:`cancelled`,...a===void 0?{}:{reason:a}}:{executionId:r.executionId,workflowId:r.workflowId,status:`completed`}}function f(e,t){return t.status===`completed`?{executionId:e.executionId,workflowId:e.workflowId,status:`completed`,...t.artifact===void 0?{}:{artifact:t.artifact}}:t.status===`cancelled`?{executionId:e.executionId,workflowId:e.workflowId,status:`cancelled`,...t.reason===void 0?{}:{reason:t.reason}}:t.status===`paused`?{executionId:e.executionId,workflowId:e.workflowId,status:`paused`,pausedAtGateId:t.pausedAtGateId,pausedAtFrameId:t.pausedAtFrameId}:{executionId:e.executionId,workflowId:e.workflowId,status:`failed`,error:t.error}}function p(e){let t,n=()=>{t=a({bus:e.bus,activeExecutions:e.activeExecutions,shellAbortControllers:e.shellAbortControllers,activeRunnerSteps:e.activeRunnerSteps,cancelTimeoutMs:r.cancelTimeoutMs},e.executionId,u).catch(t=>(console.error(`[WorkflowOrchestrator] Failed to persist cancellation for ${e.executionId}:`,t),!1))};return e.signal.addEventListener(`abort`,n,{once:!0}),e.signal.aborted&&n(),async()=>(e.signal.removeEventListener(`abort`,n),t??!1)}async function m(t,n){let r=await t.requestOptional(e.getExecution,{executionId:n});return r.handled?r.data.execution?.startedAt??void 0:void 0}async function h(e,t){return{id:t.executionId,workflowId:t.workflowId,coordinatorSessionId:t.coordinatorSessionId,status:`running`,inputs:t.inputs,config:t.config??{},startedAt:await m(e,t.executionId)??Date.now(),triggerPayload:t.triggerPayload,...t.artifactRef===void 0?{}:{artifactRef:t.artifactRef},scope:t.scope}}async function g(e,t,n){let r=Date.now();return{id:t.executionId,workflowId:t.workflowId,coordinatorSessionId:t.coordinatorSessionId,status:n,inputs:t.inputs,config:t.config??{},startedAt:await m(e,t.executionId)??r,completedAt:r,triggerPayload:t.triggerPayload,...t.artifactRef===void 0?{}:{artifactRef:t.artifactRef},scope:t.scope}}async function _(e,t,r,i,a,c,l,d,f){let p=e.suspensionStrategy===`wait-in-process`?void 0:await v(e.executionId,l,{required:!0}),m=await n({definition:t,execution:r,runContext:i,zodSchema:f?.artifact,bus:l}),h=new s(e.executionId,e.workflowId,t,r,a,l,d,void 0,m,{context:e.context,env:e.env},{suspensionStrategy:e.suspensionStrategy,resumeFrames:p,runtimeLoopGates:c}),g=h.buildExpressionContext(),_=await o(t.root,h,g);return _.status===`failed`?{status:`failed`,error:_.error}:_.status===`paused`?{status:`paused`,pausedAtGateId:_.pausedAtGateId,pausedAtFrameId:_.pausedAtFrameId}:_.status===`cancelled`||d.aborted?{status:`cancelled`,reason:u}:{status:`completed`,artifact:m?.current}}async function v(t,n,r={}){try{let a=await n.requestOptional(e.listFrames,{executionId:t});if(!a.handled){if(r.required===!0)throw Error(`Frame storage handler is required to resume execution '${t}'.`);return}return a.data.frames.length===0?void 0:i(a.data.frames)}catch(e){if(r.required===!0)throw e;return}}function y(e,t){return{executionId:e.executionId,workflowId:e.workflowId,source:e.source,definitionSnapshot:e.source.kind===`definition`?e.definition??t:t,workerManifest:{packages:[]},inputs:e.inputs,config:e.config??{},scope:e.scope,triggerPayload:e.triggerPayload,...e.artifactRef===void 0?{}:{artifactRef:e.artifactRef},...e.executionHints===void 0?{}:{executionHints:e.executionHints},coordinatorSessionId:e.coordinatorSessionId,cancelSubject:e.cancelSubject,context:e.context,env:e.env,createdAt:Date.now(),suspensionStrategy:e.suspensionStrategy}}async function b(n,r,i,a,o){i.status=`paused`,await n.request(e.setExecution,{execution:i}),await n.emit(t.execution.paused,{executionId:r.executionId,workflowId:r.workflowId,pausedAtGateId:a,pausedAtFrameId:o})}async function x(e,n,r,i,a,o){r===`completed`?await e.emit(t.execution.completed,{executionId:n.executionId,workflowId:n.workflowId,totalDuration:a-i.startedAt,completedAt:a}):r===`cancelled`?await e.emit(t.execution.cancelled,{executionId:n.executionId,workflowId:n.workflowId,reason:u,completedAt:a}):await e.emit(t.execution.failed,{executionId:n.executionId,workflowId:n.workflowId,error:o??`Workflow execution failed`,completedAt:a})}async function S(t){let{config:n,loaded:r,bus:i,signal:a}=t,{definition:o}=r;if(a.aborted)return d(i,n,`cancelled`,u);let s=await h(i,n),m=y(n,o);await c(i,s,m,o);let g=new Map(r.runtimeHandlers),v=r.runtimeLoopGates??new Map,S=new Map,C=new Map,w=new Map;S.set(n.executionId,{execution:s,workflow:o,runContext:m,runtimeHandlers:g,runtimeLoopGates:new Map(v)});let T=p({signal:a,executionId:n.executionId,bus:i,activeExecutions:S,shellAbortControllers:C,activeRunnerSteps:w}),E={status:`completed`},D=!1;try{o.root.nodes.length>0&&(l(o,v),E=await _(n,o,s,m,g,v,i,a,r.zodSchemas))}catch(e){E={status:`failed`,error:e instanceof Error?e.message:String(e)}}finally{D=await T(),S.clear()}if(D)return f(n,{status:`cancelled`,reason:u});if((a.aborted||s.status===`cancelled`)&&(E={status:`cancelled`,reason:u}),E.status===`paused`)return await b(i,n,s,E.pausedAtGateId,E.pausedAtFrameId),f(n,E);let O=Date.now(),k=E.status===`failed`?E.error:void 0;return s.status=E.status,s.completedAt=O,s.error=k,await i.request(e.setExecution,{execution:s}),await x(i,n,E.status,s,O,k),f(n,E)}export{S as runWorkflowOrchestrator};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,mt as l,o as u,p as d,s as f,t as p,u as m,v as h,y as g}from"./schemas-CkOigLAT.mjs";import"./compression-C5JAWdgZ.mjs";import"./provider-context-CqMgPOWF.mjs";import"./contracts/adapter/schemas/session-lineage.mjs";import{createBusNamespace as _}from"@makaio/framework/core";const v={getCapabilities:l,startAgent:t,infer:g,listAgents:h,getAgent:e,stopAgent:a,rehydrateAgent:o,getConfigSchema:c,"agent.created":d,"session.created":i,"session.discovered":p,"session.usage":r,"session.closed":m,log:s,error:n,initialized:f,quota:u},y=_(`adapter`,v),b=y.subjects;export{b as n,v as r,y as t};
|
package/dist/client-l1Rq5p6X.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./schemas-XeIBqwvE.mjs";import{_ as t,a as n,g as r,h as i,m as a,n as ee,o as te}from"./profile-BMBXUqqh.mjs";import{n as ne,t as o}from"./version-DoV_pSzT.mjs";import{c as re,d as ie,n as ae,o as oe,s as se,t as s,u as ce}from"./account-identity-C7Kx_ieU.mjs";import{z as c}from"zod";import{createBusNamespace as le}from"@makaio/framework/core";const l=c.object({tag:c.string(),description:c.string().optional()}),u=c.object({name:c.string(),friendlyName:c.string(),description:c.string().optional(),category:c.string().optional(),capabilities:c.array(l).default([])}),d=c.object({id:c.string(),name:c.string(),description:c.string().optional(),glob:c.string().optional()}),f=c.object({name:c.string().min(1),frameworkSubject:c.string().min(1).optional(),mode:c.enum([`event`,`request`]).default(`event`)}),p=c.object({envVar:r.regex(/^[A-Za-z_][A-Za-z0-9_]*$/,{message:`envVar must be a valid environment variable name (letters, digits, underscores)`}),defaultPath:r.refine(e=>e===`~`||e.startsWith(`~/`)||t(e),{message:`defaultPath must be absolute, '~', or start with '~/'`}),pathKind:c.enum([`directory`,`file`]).default(`directory`)});function ue(e){if(!e.startsWith(`@`))return!e.includes(`@`);let t=e.indexOf(`/`);return t>1&&!e.slice(t+1).includes(`@`)}const m=c.object({type:c.literal(`npm`),package:c.string().min(1).refine(ue,{message:"package must not include an inline `@version` suffix; use the version field instead"}),version:o}),h=c.object({type:c.literal(`signed-binary-bucket`),version:o,config:c.object({baseUrl:c.string().url(),manifestPathTemplate:c.string().min(1),manifestSignaturePathTemplate:c.string().min(1),publicKeyUrl:c.string().url(),publicKeyFingerprint:c.string().min(1),binaryPathTemplate:c.string().min(1),platforms:c.record(c.string().min(1),c.string().min(1))})}),g=c.discriminatedUnion(`type`,[m,h]),_=c.object({executable:c.union([c.string().min(1),c.object({default:c.string().min(1),darwin:c.string().min(1).optional(),linux:c.string().min(1).optional(),win32:c.string().min(1).optional()}).strict()]),args:c.array(c.string()).default([])}).strict(),v=c.object({kind:c.string().min(1),payload:c.record(c.string(),c.unknown()).optional()}),y=c.object({supportsHooks:c.boolean().default(!1),supportsStatusline:c.boolean().default(!1),supportsSupervisorLaunch:c.boolean().default(!1),supportsManagedBinary:c.boolean().default(!1),hookEvents:c.array(f).default([])}).refine(e=>e.supportsHooks||e.hookEvents.length===0,{message:`hookEvents must be empty when supportsHooks is false`,path:[`hookEvents`]}),b=c.object({name:c.string().min(1),supportedVersions:ne}).strict(),x=c.object({id:c.string(),name:c.string(),version:o,description:c.string().optional(),binary:b.optional(),nativeTools:c.array(u).default([]),defaultApprovalPolicy:e,logSources:c.array(d).optional(),defaultProviderId:c.string().optional(),runtimeCapabilities:y.optional().transform(e=>y.parse(e??{})),managedInstall:g.optional(),versionCommand:_.optional(),postInstall:v.optional(),configIsolation:p.optional()}).strict().refine(e=>!e.runtimeCapabilities.supportsManagedBinary||e.managedInstall!==void 0,{message:`managedInstall is required when runtimeCapabilities.supportsManagedBinary is true`,path:[`managedInstall`]}).refine(e=>e.managedInstall===void 0||e.runtimeCapabilities.supportsManagedBinary,{message:`runtimeCapabilities.supportsManagedBinary must be true when managedInstall is provided`,path:[`runtimeCapabilities`,`supportsManagedBinary`]}).refine(e=>e.managedInstall===void 0||e.versionCommand!==void 0,{message:`versionCommand is required when managedInstall is provided`,path:[`versionCommand`]}).superRefine((e,t)=>{if(e.managedInstall===void 0||e.versionCommand===void 0)return;let{executable:n}=e.versionCommand,r=typeof n==`string`?[{path:n,issuePath:[`versionCommand`,`executable`]}]:[{path:n.default,issuePath:[`versionCommand`,`executable`,`default`]},...n.darwin===void 0?[]:[{path:n.darwin,issuePath:[`versionCommand`,`executable`,`darwin`]}],...n.linux===void 0?[]:[{path:n.linux,issuePath:[`versionCommand`,`executable`,`linux`]}],...n.win32===void 0?[]:[{path:n.win32,issuePath:[`versionCommand`,`executable`,`win32`]}]];for(let{path:e,issuePath:n}of r){let r=e.startsWith(`/`),i=/^[A-Za-z]:/.test(e),a=e.startsWith(`\\`);if(r||i||a){t.addIssue({code:c.ZodIssueCode.custom,path:n,message:`${n.join(`.`)} must be a relative path within the install directory`});continue}e.split(/[/\\]/).some(e=>e===`..`)&&t.addIssue({code:c.ZodIssueCode.custom,path:n,message:`${n.join(`.`)} must be a relative path within the install directory`})}}),S=c.object({binaryPath:a.nullable(),env:c.record(c.string(),c.string()),configDir:a.nullable(),source:c.enum([`managed`,`global`]),version:r.nullable()}),C={request:c.object({clientId:r,sessionId:r.optional(),projectDir:a.optional(),preferSource:c.enum([`managed`,`global`]).optional(),harnessId:r.optional()}),response:S},w=c.enum([`npm`,`signed-binary-bucket`]),T=c.object({version:r,installPath:a,installedAt:i,isActive:c.boolean()}),E=c.object({clientId:r,installedVersions:c.array(T),activeVersion:r.nullable(),pinnedVersion:o,updateAvailable:c.boolean()}).strict(),D={request:c.object({forceRefresh:c.boolean().optional()}),response:c.object({clients:c.array(E)})},de={request:c.object({clientId:r,version:o.optional()}),response:c.object({jobId:r,requestedVersion:o.nullable(),resolvedVersion:o.nullable()})},O={request:c.object({clientId:r,version:r}),response:c.object({clientId:r,removedVersion:r,activeVersion:r.nullable()})},k={request:c.object({clientId:r}),response:c.object({jobId:r,resolvedVersion:o.nullable()})},A={request:c.object({clientId:r,version:r}),response:c.object({clientId:r,activeVersion:r})},j=c.enum([`resolving`,`downloading`,`verifying`,`extracting`,`installing`,`post-install`,`activating`]),M=c.object({jobId:r,clientId:r,version:r.optional(),strategy:w,stage:j,progress:c.number().min(0).max(100).nullable(),installPath:a.optional(),activeAfterCompletion:c.boolean().optional(),metadata:c.record(c.string(),c.unknown()).optional()}),N=c.object({message:c.string(),code:c.string().optional()}),P=c.object({jobId:r,clientId:r,version:r.optional(),strategy:w,status:c.enum([`success`,`error`]),installPath:a.optional(),activeVersion:r.nullable(),error:N.optional(),metadata:c.record(c.string(),c.unknown()).optional()}),F=c.object({clientId:r,previousActiveVersion:r.nullable(),activeVersion:r.nullable(),reason:c.enum([`install`,`update`,`set-active`,`uninstall`])}),I=c.enum([`supervisor`,`adapter`,`client-hook`,`statusline`,`cli-wrapper`]),L=c.object({layer:I,producer:r}),R=c.object({supervisorSessionId:r.optional(),pid:c.number().int().positive().optional(),parentPid:c.number().int().positive().optional(),adapterSessionId:r.optional(),sessionId:r.optional(),cwd:c.string().optional(),argv:c.array(c.string()).optional(),metadata:c.record(c.string(),c.unknown()).optional()}),z={request:c.object({clientId:r,source:L,observedAt:i}).merge(R).refine(e=>e.supervisorSessionId!==void 0||e.pid!==void 0||e.adapterSessionId!==void 0,{message:`At least one hard-evidence field is required (supervisorSessionId, pid, or adapterSessionId)`}),response:c.object({clientRuntimeId:r,created:c.boolean(),promoted:c.boolean()})},B=R.extend({clientRuntimeId:r,clientId:r,status:c.enum([`observed`,`started`]),source:L,observedAt:i}),V={request:c.object({adapterSessionId:r,clientId:r}),response:c.object({managed:c.boolean()})},H=c.object({clientId:r,source:r,observedAt:i,sessionId:c.string().optional(),adapterSessionId:c.string().optional(),metadata:c.record(c.string(),c.unknown()).optional()}),U=[`fresh`,`fork`,`resume`,`clear`,`compact`],W=c.enum(U),G=H.extend({transcriptPath:c.string().optional(),cwd:c.string().optional(),machineId:c.string().optional(),startMode:W.optional(),parentAdapterSessionId:c.string().optional()}),K=H.extend({prompt:r.optional()}),q=H.extend({}),J=H.extend({transcriptPath:c.string().optional()}),Y=H.extend({toolName:r.optional(),toolCallId:r.optional()}),X=H.extend({toolName:r.optional(),toolCallId:r.optional(),success:c.boolean().optional()}),Z=c.object({group:r,name:r,installed:c.boolean(),command:r}),fe={"runtime.observe":z,"runtime.started":B,"runtime.isAdapterManaged":V,scan:{request:c.object({targets:c.array(se).optional()}),response:c.object({results:c.array(oe)})},"session.account.observe":re,"account.observe":ae,"account.activate":{request:c.object({clientId:r,clientAccountId:r,identifiers:c.array(s).min(1),displayLabel:c.string().optional()}),response:c.object({accepted:c.boolean()})},"account.getActive":{request:c.object({clientId:r}),response:c.object({identity:c.object({clientAccountId:r,identifiers:c.array(s).min(1),displayLabel:c.string().optional()}).nullable()})},"usage.ingest":ce,"usage.snapshot":ie,"session.started":G,"session.userPrompt.submitted":K,"session.turn.started":q,"session.turn.completed":J,"session.tool.pre":Y,"session.tool.post":X,"wiring.list":{request:c.object({clientId:r.optional(),projectDir:a.optional(),makaioCommand:r}),response:c.object({results:c.array(c.object({clientId:r,entries:c.array(Z)}))})},list:D,install:de,uninstall:O,update:k,setActive:A,"installJob.progress":M,"installJob.completed":P,"version.changed":F,resolveBinary:C,...n,...te,"config.prime":ee},Q=le(`client`,fe),pe=Q.subjects;function $(e){if(Array.isArray(e)){for(let t of e)$(t);return Object.freeze(e)}if(e&&typeof e==`object`){for(let t of Object.values(e))$(t);return Object.freeze(e)}return e}function me(e){return $(x.parse(e))}export{N as A,l as B,M as C,O as D,A as E,C as F,m as G,p as H,b as I,_ as J,v as K,x as L,T as M,w as N,k as O,S as P,f as R,P as S,D as T,d as U,u as V,g as W,z as _,U as a,B as b,G as c,J as d,q as f,V as g,R as h,fe as i,j,F as k,X as l,Z as m,Q as n,H as o,K as p,h as q,pe as r,W as s,me as t,Y as u,I as v,de as w,E as x,L as y,y as z};
|