@makaio/framework 1.0.0-dev-1781397017668 → 1.0.0-dev-1781443723575

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.
Files changed (110) hide show
  1. package/dist/.makaio-build.json +2 -2
  2. package/dist/{adapter-D_p5kKxi.mjs → adapter-BH1X0THX.mjs} +1 -1
  3. package/dist/bus/index.d.mts +21 -21
  4. package/dist/bus/index.mjs +1 -1
  5. package/dist/contracts/adapter/index.d.mts +2 -2
  6. package/dist/contracts/adapter/index.mjs +1 -1
  7. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  8. package/dist/contracts/artifact/index.d.mts +1 -1
  9. package/dist/contracts/canonical-model/index.d.mts +1 -1
  10. package/dist/contracts/config/index.d.mts +6 -6
  11. package/dist/contracts/extension/index.d.mts +3 -3
  12. package/dist/contracts/facet/index.d.mts +1 -1
  13. package/dist/contracts/harness/index.d.mts +1 -1
  14. package/dist/contracts/index.d.mts +664 -269
  15. package/dist/contracts/index.mjs +1 -1
  16. package/dist/contracts/provider/index.d.mts +1 -1
  17. package/dist/contracts/session/index.d.mts +2 -2
  18. package/dist/contracts/session/index.mjs +1 -1
  19. package/dist/contracts/shared/index.d.mts +1 -1
  20. package/dist/contracts/skill/index.d.mts +1 -1
  21. package/dist/drizzle/0018_m_mqcweucg.sql +17 -0
  22. package/dist/drizzle/0019_m_mqcwyn0w.sql +1 -0
  23. package/dist/drizzle/meta/_journal.json +14 -0
  24. package/dist/handlers-Cpy9Q8ho.mjs +41 -0
  25. package/dist/{index-DvETyI0_.d.mts → index-BBteExwv.d.mts} +1 -1
  26. package/dist/{index-CEdOq5Om.d.mts → index-BDnI2oqX.d.mts} +1 -1
  27. package/dist/{index-B3mq3Qjf.d.mts → index-BZuF4I8O.d.mts} +1 -1
  28. package/dist/{index-BLqtL-_a.d.mts → index-C2tDMYm0.d.mts} +4 -4
  29. package/dist/{index-C24PcW2r.d.mts → index-CQuLV3jj.d.mts} +12 -12
  30. package/dist/{index-B92SK0rO.d.mts → index-CtVy1e5h.d.mts} +6 -3
  31. package/dist/{index-C0TEY7RE.d.mts → index-D7oEYudM.d.mts} +1 -1
  32. package/dist/{index-QvciMc7_.d.mts → index-DWBpxSGQ.d.mts} +899 -385
  33. package/dist/{index-DLPjliGd.d.mts → index-DWRwbJjQ.d.mts} +1 -1
  34. package/dist/{index-BQ8H7cvY.d.mts → index-Doy13wLW.d.mts} +15 -15
  35. package/dist/{index-NyKdb8kT.d.mts → index-DsAfeVbS.d.mts} +24 -24
  36. package/dist/{index-CszoKxxO.d.mts → index-N7JtH6hX.d.mts} +392 -392
  37. package/dist/{index-DBgv39-Q.d.mts → index-bLWdMu_T.d.mts} +44 -44
  38. package/dist/{index-WKF5BHsw.d.mts → index-gYlNeEGH.d.mts} +8 -8
  39. package/dist/{index-DfNIhEm_.d.mts → index-iRe4CsR5.d.mts} +20 -20
  40. package/dist/{index-B99Prx5a.d.mts → index-xeg-bqxO.d.mts} +105 -105
  41. package/dist/kernel/extension/index.d.mts +1 -1
  42. package/dist/kernel/index.d.mts +2 -2
  43. package/dist/kernel/observability/index.d.mts +1 -1
  44. package/dist/{namespace-DbvQ4HYc.d.mts → namespace-1tHmgGQV.d.mts} +154 -154
  45. package/dist/{namespace-CN2TfSCY.d.mts → namespace-CK50FeCH.d.mts} +2 -2
  46. package/dist/{namespace-C_kaVySz.d.mts → namespace-D63jVkzY.d.mts} +4 -4
  47. package/dist/{namespace-BAJTZXWc.d.mts → namespace-DWT6hqxX.d.mts} +42 -42
  48. package/dist/{namespace-D_ZXa76m.d.mts → namespace-thr1fR3_.d.mts} +32 -32
  49. package/dist/{namespace-B1Bldc48.d.mts → namespace-vfKj-JHx.d.mts} +9 -9
  50. package/dist/package-Dvk8-Gfd.mjs +1 -0
  51. package/dist/package.json +1 -1
  52. package/dist/primitive-runtime-UEzX4Ayu.mjs +1 -0
  53. package/dist/runtime-node/index.d.mts +1 -1
  54. package/dist/runtime-node/workflow-worker/index.d.mts +2 -2
  55. package/dist/{schema-msWs4YhT.d.mts → schema-CXgFk-dK.d.mts} +2 -2
  56. package/dist/{schemas-DRZJK6hW2.d.mts → schemas-BS8xAZ2y2.d.mts} +2 -2
  57. package/dist/schemas-CzvG8xq7.mjs +1 -0
  58. package/dist/{schemas-CN9hprME.d.mts → schemas-YFBpHbzr.d.mts} +3 -3
  59. package/dist/{schemas-xoTn8JZb.d.mts → schemas-za4KzhEe.d.mts} +154 -154
  60. package/dist/services/adapter-subsystem/index.d.mts +2 -2
  61. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  62. package/dist/services/agent-runtime/index.d.mts +2 -2
  63. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  64. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  65. package/dist/services/context-rules/index.d.mts +8 -8
  66. package/dist/services/filesystem/namespace.d.mts +6 -6
  67. package/dist/services/filesystem/schemas.d.mts +3 -3
  68. package/dist/services/harness/index.d.mts +3 -3
  69. package/dist/services/index.d.mts +113 -113
  70. package/dist/services/index.mjs +1 -1
  71. package/dist/services/log-import/browser.d.mts +2 -2
  72. package/dist/services/log-import/index.d.mts +2 -2
  73. package/dist/services/log-import/log-import.d.mts +1 -1
  74. package/dist/services/log-import/namespace.d.mts +2 -2
  75. package/dist/services/log-import/schemas.d.mts +1 -1
  76. package/dist/services/session/handlers/index.mjs +1 -1
  77. package/dist/services/session/index.d.mts +5 -5
  78. package/dist/services/session/index.mjs +1 -1
  79. package/dist/services/session/messages/namespace.d.mts +1 -1
  80. package/dist/services/session/session-events/namespace.d.mts +1 -1
  81. package/dist/services/session/storage/namespace.d.mts +1 -1
  82. package/dist/services/session/storage/schema.d.mts +1 -1
  83. package/dist/services/session/testing/index.mjs +1 -1
  84. package/dist/services/settings/namespace.d.mts +5 -5
  85. package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
  86. package/dist/services/subagent-template/index.d.mts +1 -1
  87. package/dist/services/subagent-template/schemas.d.mts +1 -1
  88. package/dist/services/tool-approval/index.mjs +1 -1
  89. package/dist/services/tools/index.mjs +1 -1
  90. package/dist/services/tray-menu/index.d.mts +2 -2
  91. package/dist/services/tray-menu/namespace.d.mts +1 -1
  92. package/dist/services/tray-menu/schemas.d.mts +1 -1
  93. package/dist/session-ZAJrcudH.mjs +39 -0
  94. package/dist/{session-lineage-DFkJgYt5.d.mts → session-lineage-CJgqfkMj.d.mts} +1 -1
  95. package/dist/{session-bKk-XeaY.mjs → session-owtKCoUX.mjs} +1 -1
  96. package/dist/{tool-approval-service-C2xXBtdJ.mjs → tool-approval-service-B_28RhuK.mjs} +1 -1
  97. package/dist/{tools-DEUzCPBB.mjs → tools-BpzJterj.mjs} +1 -1
  98. package/dist/{types-4LKM7ZfA.d.mts → types-8q9G9p34.d.mts} +890 -360
  99. package/dist/{types-BB8iIAjZ.d.mts → types-bPzpZb7_.d.mts} +1 -1
  100. package/dist/workflow-engine/index.d.mts +463 -48
  101. package/dist/workflow-engine/index.mjs +1 -1
  102. package/dist/workflow-engine/package.mjs +1 -1
  103. package/dist/workflow-engine/workflow-orchestrator.d.mts +3 -2
  104. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  105. package/package.json +1 -1
  106. package/dist/handlers-CTrL8wmC.mjs +0 -41
  107. package/dist/package-Bn665ylV.mjs +0 -1
  108. package/dist/primitive-runtime-C2yw4-F8.mjs +0 -1
  109. package/dist/schemas-CiMm2zrE.mjs +0 -1
  110. package/dist/session-Me3XO-l9.mjs +0 -39
@@ -1,12 +1,14 @@
1
1
  import { a as WorkflowExecutor, i as WorkflowEngineService, n as createWorkflowEnginePackage, o as registerDrizzleWorkflowStorage, r as workflowEnginePackage, t as WorkflowEngineToken } from "../package-BEbo1-6S.mjs";
2
2
  import { z } from "zod";
3
3
  import * as _$_makaio_core0 from "@makaio/framework/core";
4
+ import { IMakaioBus } from "@makaio/framework/bus";
4
5
  import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
5
- import { JsonValue, WorkflowExecutionSchema, WorkflowListQuerySchema } from "@makaio/framework/contracts";
6
+ import { JsonPatchOperation, JsonValue, WorkflowExecutionSchema, WorkflowListQuerySchema } from "@makaio/framework/contracts";
6
7
  import * as _$_makaio_storage_core0 from "@makaio/framework/storage";
7
8
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
8
9
  import * as _$drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
9
10
  import * as _$_makaio_storage_drizzle0 from "@makaio/framework/storage/drizzle";
11
+ import { MakaioDatabase } from "@makaio/framework/storage/drizzle";
10
12
  import * as _$drizzle_orm0 from "drizzle-orm";
11
13
  import { WorkflowExpressionContext } from "@makaio/framework/expression";
12
14
 
@@ -43,6 +45,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
43
45
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
44
46
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
45
47
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
48
+ state: z.ZodOptional<z.ZodObject<{
49
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
50
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
51
+ }, z.core.$strip>>;
46
52
  artifact: z.ZodOptional<z.ZodObject<{
47
53
  kind: z.ZodString;
48
54
  schemaVersion: z.ZodString;
@@ -155,6 +161,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
155
161
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
156
162
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
157
163
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
164
+ state: z.ZodOptional<z.ZodObject<{
165
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
166
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
167
+ }, z.core.$strip>>;
158
168
  artifact: z.ZodOptional<z.ZodObject<{
159
169
  kind: z.ZodString;
160
170
  schemaVersion: z.ZodString;
@@ -293,6 +303,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
293
303
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
294
304
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
295
305
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
306
+ state: z.ZodOptional<z.ZodObject<{
307
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
308
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
309
+ }, z.core.$strip>>;
296
310
  artifact: z.ZodOptional<z.ZodObject<{
297
311
  kind: z.ZodString;
298
312
  schemaVersion: z.ZodString;
@@ -410,8 +424,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
410
424
  completed: "completed";
411
425
  cancelled: "cancelled";
412
426
  failed: "failed";
413
- running: "running";
414
427
  paused: "paused";
428
+ running: "running";
415
429
  }>;
416
430
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
417
431
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -451,8 +465,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
451
465
  completed: "completed";
452
466
  cancelled: "cancelled";
453
467
  failed: "failed";
454
- running: "running";
455
468
  paused: "paused";
469
+ running: "running";
456
470
  }>;
457
471
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
458
472
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -499,8 +513,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
499
513
  completed: "completed";
500
514
  cancelled: "cancelled";
501
515
  failed: "failed";
502
- running: "running";
503
516
  paused: "paused";
517
+ running: "running";
504
518
  }>;
505
519
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
506
520
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -548,6 +562,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
548
562
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
549
563
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
550
564
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
565
+ state: z.ZodOptional<z.ZodObject<{
566
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
567
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
568
+ }, z.core.$strip>>;
551
569
  artifact: z.ZodOptional<z.ZodObject<{
552
570
  kind: z.ZodString;
553
571
  schemaVersion: z.ZodString;
@@ -716,6 +734,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
716
734
  "exit-and-resume": "exit-and-resume";
717
735
  }>>;
718
736
  }, z.core.$strip>;
737
+ initialState: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
719
738
  }, z.core.$strip>;
720
739
  response: z.ZodObject<{
721
740
  id: z.ZodString;
@@ -730,8 +749,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
730
749
  completed: "completed";
731
750
  cancelled: "cancelled";
732
751
  failed: "failed";
733
- running: "running";
734
752
  paused: "paused";
753
+ running: "running";
735
754
  }>>;
736
755
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
737
756
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -799,8 +818,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
799
818
  completed: "completed";
800
819
  cancelled: "cancelled";
801
820
  failed: "failed";
802
- running: "running";
803
821
  paused: "paused";
822
+ running: "running";
804
823
  }>>;
805
824
  artifactRef: z.ZodOptional<z.ZodObject<{
806
825
  kind: z.ZodString;
@@ -822,8 +841,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
822
841
  completed: "completed";
823
842
  cancelled: "cancelled";
824
843
  failed: "failed";
825
- running: "running";
826
844
  paused: "paused";
845
+ running: "running";
827
846
  }>;
828
847
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
829
848
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -882,8 +901,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
882
901
  cancelled: "cancelled";
883
902
  failed: "failed";
884
903
  running: "running";
885
- skipped: "skipped";
886
904
  waiting: "waiting";
905
+ skipped: "skipped";
887
906
  }>;
888
907
  attempt: z.ZodDefault<z.ZodNumber>;
889
908
  iteration: z.ZodOptional<z.ZodNumber>;
@@ -927,8 +946,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
927
946
  cancelled: "cancelled";
928
947
  failed: "failed";
929
948
  running: "running";
930
- skipped: "skipped";
931
949
  waiting: "waiting";
950
+ skipped: "skipped";
932
951
  }>;
933
952
  attempt: z.ZodDefault<z.ZodNumber>;
934
953
  iteration: z.ZodOptional<z.ZodNumber>;
@@ -969,8 +988,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
969
988
  cancelled: "cancelled";
970
989
  failed: "failed";
971
990
  running: "running";
972
- skipped: "skipped";
973
991
  waiting: "waiting";
992
+ skipped: "skipped";
974
993
  }>;
975
994
  attempt: z.ZodDefault<z.ZodNumber>;
976
995
  iteration: z.ZodOptional<z.ZodNumber>;
@@ -997,8 +1016,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
997
1016
  status: z.ZodEnum<{
998
1017
  cancelled: "cancelled";
999
1018
  rejected: "rejected";
1000
- resumed: "resumed";
1001
1019
  waiting: "waiting";
1020
+ resumed: "resumed";
1002
1021
  "timed-out": "timed-out";
1003
1022
  }>;
1004
1023
  autoAction: z.ZodEnum<{
@@ -1129,8 +1148,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1129
1148
  status: z.ZodEnum<{
1130
1149
  cancelled: "cancelled";
1131
1150
  rejected: "rejected";
1132
- resumed: "resumed";
1133
1151
  waiting: "waiting";
1152
+ resumed: "resumed";
1134
1153
  "timed-out": "timed-out";
1135
1154
  }>;
1136
1155
  autoAction: z.ZodEnum<{
@@ -1154,8 +1173,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1154
1173
  status: z.ZodOptional<z.ZodEnum<{
1155
1174
  cancelled: "cancelled";
1156
1175
  rejected: "rejected";
1157
- resumed: "resumed";
1158
1176
  waiting: "waiting";
1177
+ resumed: "resumed";
1159
1178
  "timed-out": "timed-out";
1160
1179
  }>>;
1161
1180
  limit: z.ZodDefault<z.ZodNumber>;
@@ -1170,8 +1189,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1170
1189
  status: z.ZodEnum<{
1171
1190
  cancelled: "cancelled";
1172
1191
  rejected: "rejected";
1173
- resumed: "resumed";
1174
1192
  waiting: "waiting";
1193
+ resumed: "resumed";
1175
1194
  "timed-out": "timed-out";
1176
1195
  }>;
1177
1196
  autoAction: z.ZodEnum<{
@@ -1205,8 +1224,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1205
1224
  status: z.ZodEnum<{
1206
1225
  cancelled: "cancelled";
1207
1226
  rejected: "rejected";
1208
- resumed: "resumed";
1209
1227
  waiting: "waiting";
1228
+ resumed: "resumed";
1210
1229
  "timed-out": "timed-out";
1211
1230
  }>;
1212
1231
  autoAction: z.ZodEnum<{
@@ -1347,6 +1366,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1347
1366
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
1348
1367
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
1349
1368
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
1369
+ state: z.ZodOptional<z.ZodObject<{
1370
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
1371
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
1372
+ }, z.core.$strip>>;
1350
1373
  artifact: z.ZodOptional<z.ZodObject<{
1351
1374
  kind: z.ZodString;
1352
1375
  schemaVersion: z.ZodString;
@@ -1550,6 +1573,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1550
1573
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
1551
1574
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
1552
1575
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
1576
+ state: z.ZodOptional<z.ZodObject<{
1577
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
1578
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
1579
+ }, z.core.$strip>>;
1553
1580
  artifact: z.ZodOptional<z.ZodObject<{
1554
1581
  kind: z.ZodString;
1555
1582
  schemaVersion: z.ZodString;
@@ -1719,6 +1746,38 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1719
1746
  }>>;
1720
1747
  }, z.core.$strip>>;
1721
1748
  }, z.core.$strip>;
1749
+ }>; /** Initialize execution state snapshot at sequence 0. */
1750
+ initializeState: _$_makaio_core0.LocalSubjectSchema<{
1751
+ request: z.ZodObject<{
1752
+ executionId: z.ZodString;
1753
+ initialValue: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
1754
+ }, z.core.$strip>;
1755
+ response: z.ZodObject<{}, z.core.$strip>;
1756
+ }>; /** Read current execution state snapshot. */
1757
+ getState: _$_makaio_core0.LocalSubjectSchema<{
1758
+ request: z.ZodObject<{
1759
+ executionId: z.ZodString;
1760
+ }, z.core.$strip>;
1761
+ response: z.ZodObject<{
1762
+ state: z.ZodNullable<z.ZodObject<{
1763
+ executionId: z.ZodString;
1764
+ sequence: z.ZodNumber;
1765
+ value: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
1766
+ }, z.core.$strip>>;
1767
+ }, z.core.$strip>;
1768
+ }>; /** Apply a state mutation with optimistic concurrency control. */
1769
+ patchState: _$_makaio_core0.LocalSubjectSchema<{
1770
+ request: z.ZodObject<{
1771
+ executionId: z.ZodString;
1772
+ expectedSequence: z.ZodNumber;
1773
+ nextValue: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
1774
+ }, z.core.$strip>;
1775
+ response: z.ZodObject<{
1776
+ executionId: z.ZodString;
1777
+ sequence: z.ZodNumber;
1778
+ patch: z.ZodArray<z.ZodType<_$_makaio_contracts0.JsonPatchOperation, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonPatchOperation, unknown>>>;
1779
+ value: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
1780
+ }, z.core.$strip>;
1722
1781
  }>;
1723
1782
  }, {
1724
1783
  drizzle: {
@@ -1870,7 +1929,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1870
1929
  tableName: "workflow_definitions";
1871
1930
  dataType: "string";
1872
1931
  columnType: "SQLiteText";
1873
- data: "external" | "session" | "global" | "workspace";
1932
+ data: "external" | "global" | "workspace" | "session";
1874
1933
  driverParam: string;
1875
1934
  notNull: true;
1876
1935
  hasDefault: false;
@@ -1883,7 +1942,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
1883
1942
  generated: undefined;
1884
1943
  }, {}, {
1885
1944
  length: number | undefined;
1886
- $type: "external" | "session" | "global" | "workspace";
1945
+ $type: "external" | "global" | "workspace" | "session";
1887
1946
  }>;
1888
1947
  scopeKind: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
1889
1948
  name: "scope_kind";
@@ -2086,6 +2145,31 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2086
2145
  }, {}, {
2087
2146
  $type: Record<string, _$_makaio_contracts0.JsonValue>;
2088
2147
  }>;
2148
+ state: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
2149
+ name: string;
2150
+ tableName: "workflow_definitions";
2151
+ dataType: "json";
2152
+ columnType: "SQLiteTextJson";
2153
+ data: {
2154
+ schema: Record<string, _$_makaio_contracts0.JsonValue>;
2155
+ initial?: _$_makaio_contracts0.JsonValue | undefined;
2156
+ };
2157
+ driverParam: string;
2158
+ notNull: false;
2159
+ hasDefault: false;
2160
+ isPrimaryKey: false;
2161
+ isAutoincrement: false;
2162
+ hasRuntimeDefault: false;
2163
+ enumValues: undefined;
2164
+ baseColumn: never;
2165
+ identity: undefined;
2166
+ generated: undefined;
2167
+ }, {}, {
2168
+ $type: {
2169
+ schema: Record<string, _$_makaio_contracts0.JsonValue>;
2170
+ initial?: _$_makaio_contracts0.JsonValue | undefined;
2171
+ };
2172
+ }>;
2089
2173
  artifact: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
2090
2174
  name: string;
2091
2175
  tableName: "workflow_definitions";
@@ -2216,7 +2300,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2216
2300
  tableName: "workflow_executions";
2217
2301
  dataType: "string";
2218
2302
  columnType: "SQLiteText";
2219
- data: "external" | "session" | "global" | "workspace";
2303
+ data: "external" | "global" | "workspace" | "session";
2220
2304
  driverParam: string;
2221
2305
  notNull: true;
2222
2306
  hasDefault: false;
@@ -2229,7 +2313,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2229
2313
  generated: undefined;
2230
2314
  }, {}, {
2231
2315
  length: number | undefined;
2232
- $type: "external" | "session" | "global" | "workspace";
2316
+ $type: "external" | "global" | "workspace" | "session";
2233
2317
  }>;
2234
2318
  scopeKind: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
2235
2319
  name: "scope_kind";
@@ -2331,7 +2415,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2331
2415
  tableName: "workflow_executions";
2332
2416
  dataType: "string";
2333
2417
  columnType: "SQLiteText";
2334
- data: "pending" | "completed" | "cancelled" | "failed" | "running" | "paused";
2418
+ data: "pending" | "completed" | "cancelled" | "failed" | "paused" | "running";
2335
2419
  driverParam: string;
2336
2420
  notNull: true;
2337
2421
  hasDefault: false;
@@ -2620,7 +2704,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2620
2704
  tableName: "workflow_execution_frames";
2621
2705
  dataType: "string";
2622
2706
  columnType: "SQLiteText";
2623
- data: "pending" | "completed" | "cancelled" | "failed" | "running" | "skipped" | "waiting";
2707
+ data: "pending" | "completed" | "cancelled" | "failed" | "running" | "waiting" | "skipped";
2624
2708
  driverParam: string;
2625
2709
  notNull: true;
2626
2710
  hasDefault: true;
@@ -2633,7 +2717,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2633
2717
  generated: undefined;
2634
2718
  }, {}, {
2635
2719
  length: number | undefined;
2636
- $type: "pending" | "completed" | "cancelled" | "failed" | "running" | "skipped" | "waiting";
2720
+ $type: "pending" | "completed" | "cancelled" | "failed" | "running" | "waiting" | "skipped";
2637
2721
  }>;
2638
2722
  attempt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
2639
2723
  name: string;
@@ -2903,7 +2987,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2903
2987
  tableName: "workflow_gate_instances";
2904
2988
  dataType: "string";
2905
2989
  columnType: "SQLiteText";
2906
- data: "cancelled" | "rejected" | "resumed" | "waiting" | "timed-out";
2990
+ data: "cancelled" | "rejected" | "waiting" | "resumed" | "timed-out";
2907
2991
  driverParam: string;
2908
2992
  notNull: true;
2909
2993
  hasDefault: true;
@@ -2916,7 +3000,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
2916
3000
  generated: undefined;
2917
3001
  }, {}, {
2918
3002
  length: number | undefined;
2919
- $type: "cancelled" | "rejected" | "resumed" | "waiting" | "timed-out";
3003
+ $type: "cancelled" | "rejected" | "waiting" | "resumed" | "timed-out";
2920
3004
  }>;
2921
3005
  autoAction: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
2922
3006
  name: "auto_action";
@@ -3568,6 +3652,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
3568
3652
  inputSchema?: Record<string, _$_makaio_contracts0.JsonValue> | undefined;
3569
3653
  configSchema?: Record<string, _$_makaio_contracts0.JsonValue> | undefined;
3570
3654
  outputSchema?: Record<string, _$_makaio_contracts0.JsonValue> | undefined;
3655
+ state?: {
3656
+ schema: Record<string, _$_makaio_contracts0.JsonValue>;
3657
+ initial?: _$_makaio_contracts0.JsonValue | undefined;
3658
+ } | undefined;
3571
3659
  artifact?: {
3572
3660
  kind: string;
3573
3661
  schemaVersion: string;
@@ -3685,6 +3773,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
3685
3773
  inputSchema?: Record<string, _$_makaio_contracts0.JsonValue> | undefined;
3686
3774
  configSchema?: Record<string, _$_makaio_contracts0.JsonValue> | undefined;
3687
3775
  outputSchema?: Record<string, _$_makaio_contracts0.JsonValue> | undefined;
3776
+ state?: {
3777
+ schema: Record<string, _$_makaio_contracts0.JsonValue>;
3778
+ initial?: _$_makaio_contracts0.JsonValue | undefined;
3779
+ } | undefined;
3688
3780
  artifact?: {
3689
3781
  kind: string;
3690
3782
  schemaVersion: string;
@@ -3942,7 +4034,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
3942
4034
  tableName: "workflow_run_contexts";
3943
4035
  dataType: "string";
3944
4036
  columnType: "SQLiteText";
3945
- data: "external" | "session" | "global" | "workspace";
4037
+ data: "external" | "global" | "workspace" | "session";
3946
4038
  driverParam: string;
3947
4039
  notNull: true;
3948
4040
  hasDefault: true;
@@ -3955,7 +4047,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
3955
4047
  generated: undefined;
3956
4048
  }, {}, {
3957
4049
  length: number | undefined;
3958
- $type: "external" | "session" | "global" | "workspace";
4050
+ $type: "external" | "global" | "workspace" | "session";
3959
4051
  }>;
3960
4052
  scopeKind: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
3961
4053
  name: "scope_kind";
@@ -4170,7 +4262,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
4170
4262
  tableName: "worklog_summaries";
4171
4263
  dataType: "string";
4172
4264
  columnType: "SQLiteText";
4173
- data: "pending" | "completed" | "cancelled" | "failed" | "running" | "paused";
4265
+ data: "pending" | "completed" | "cancelled" | "failed" | "paused" | "running";
4174
4266
  driverParam: string;
4175
4267
  notNull: true;
4176
4268
  hasDefault: false;
@@ -4432,7 +4524,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
4432
4524
  tableName: "worklog_frame_entries";
4433
4525
  dataType: "string";
4434
4526
  columnType: "SQLiteText";
4435
- data: "pending" | "completed" | "cancelled" | "failed" | "running" | "skipped" | "waiting";
4527
+ data: "pending" | "completed" | "cancelled" | "failed" | "running" | "waiting" | "skipped";
4436
4528
  driverParam: string;
4437
4529
  notNull: true;
4438
4530
  hasDefault: false;
@@ -4866,7 +4958,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
4866
4958
  tableName: "worklog_gate_events";
4867
4959
  dataType: "string";
4868
4960
  columnType: "SQLiteText";
4869
- data: "cancelled" | "rejected" | "resumed" | "waiting" | "timed-out";
4961
+ data: "cancelled" | "rejected" | "waiting" | "resumed" | "timed-out";
4870
4962
  driverParam: string;
4871
4963
  notNull: true;
4872
4964
  hasDefault: false;
@@ -4879,7 +4971,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
4879
4971
  generated: undefined;
4880
4972
  }, {}, {
4881
4973
  length: number | undefined;
4882
- $type: "cancelled" | "rejected" | "resumed" | "waiting" | "timed-out";
4974
+ $type: "cancelled" | "rejected" | "waiting" | "resumed" | "timed-out";
4883
4975
  }>;
4884
4976
  prompt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
4885
4977
  name: "prompt";
@@ -4956,6 +5048,183 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
4956
5048
  };
4957
5049
  dialect: "sqlite";
4958
5050
  }>;
5051
+ workflowExecutionState: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
5052
+ name: "workflow_execution_state";
5053
+ schema: undefined;
5054
+ columns: {
5055
+ executionId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5056
+ name: "execution_id";
5057
+ tableName: "workflow_execution_state";
5058
+ dataType: "string";
5059
+ columnType: "SQLiteText";
5060
+ data: string;
5061
+ driverParam: string;
5062
+ notNull: true;
5063
+ hasDefault: false;
5064
+ isPrimaryKey: true;
5065
+ isAutoincrement: false;
5066
+ hasRuntimeDefault: false;
5067
+ enumValues: [string, ...string[]];
5068
+ baseColumn: never;
5069
+ identity: undefined;
5070
+ generated: undefined;
5071
+ }, {}, {
5072
+ length: number | undefined;
5073
+ }>;
5074
+ sequence: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5075
+ name: string;
5076
+ tableName: "workflow_execution_state";
5077
+ dataType: "number";
5078
+ columnType: "SQLiteInteger";
5079
+ data: number;
5080
+ driverParam: number;
5081
+ notNull: true;
5082
+ hasDefault: true;
5083
+ isPrimaryKey: false;
5084
+ isAutoincrement: false;
5085
+ hasRuntimeDefault: false;
5086
+ enumValues: undefined;
5087
+ baseColumn: never;
5088
+ identity: undefined;
5089
+ generated: undefined;
5090
+ }, {}, {}>;
5091
+ value: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5092
+ name: string;
5093
+ tableName: "workflow_execution_state";
5094
+ dataType: "json";
5095
+ columnType: "SQLiteTextJson";
5096
+ data: _$_makaio_contracts0.JsonValue;
5097
+ driverParam: string;
5098
+ notNull: true;
5099
+ hasDefault: false;
5100
+ isPrimaryKey: false;
5101
+ isAutoincrement: false;
5102
+ hasRuntimeDefault: false;
5103
+ enumValues: undefined;
5104
+ baseColumn: never;
5105
+ identity: undefined;
5106
+ generated: undefined;
5107
+ }, {}, {
5108
+ $type: _$_makaio_contracts0.JsonValue;
5109
+ }>;
5110
+ updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5111
+ name: string;
5112
+ tableName: "workflow_execution_state";
5113
+ dataType: "number";
5114
+ columnType: "SQLiteInteger";
5115
+ data: number;
5116
+ driverParam: number;
5117
+ notNull: true;
5118
+ hasDefault: false;
5119
+ isPrimaryKey: false;
5120
+ isAutoincrement: false;
5121
+ hasRuntimeDefault: false;
5122
+ enumValues: undefined;
5123
+ baseColumn: never;
5124
+ identity: undefined;
5125
+ generated: undefined;
5126
+ }, {}, {}>;
5127
+ };
5128
+ dialect: "sqlite";
5129
+ }>;
5130
+ workflowExecutionStateEvents: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
5131
+ name: "workflow_execution_state_events";
5132
+ schema: undefined;
5133
+ columns: {
5134
+ executionId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5135
+ name: "execution_id";
5136
+ tableName: "workflow_execution_state_events";
5137
+ dataType: "string";
5138
+ columnType: "SQLiteText";
5139
+ data: string;
5140
+ driverParam: string;
5141
+ notNull: true;
5142
+ hasDefault: false;
5143
+ isPrimaryKey: false;
5144
+ isAutoincrement: false;
5145
+ hasRuntimeDefault: false;
5146
+ enumValues: [string, ...string[]];
5147
+ baseColumn: never;
5148
+ identity: undefined;
5149
+ generated: undefined;
5150
+ }, {}, {
5151
+ length: number | undefined;
5152
+ }>;
5153
+ sequence: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5154
+ name: string;
5155
+ tableName: "workflow_execution_state_events";
5156
+ dataType: "number";
5157
+ columnType: "SQLiteInteger";
5158
+ data: number;
5159
+ driverParam: number;
5160
+ notNull: true;
5161
+ hasDefault: false;
5162
+ isPrimaryKey: false;
5163
+ isAutoincrement: false;
5164
+ hasRuntimeDefault: false;
5165
+ enumValues: undefined;
5166
+ baseColumn: never;
5167
+ identity: undefined;
5168
+ generated: undefined;
5169
+ }, {}, {}>;
5170
+ patch: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5171
+ name: string;
5172
+ tableName: "workflow_execution_state_events";
5173
+ dataType: "json";
5174
+ columnType: "SQLiteTextJson";
5175
+ data: _$_makaio_contracts0.JsonPatchOperation[];
5176
+ driverParam: string;
5177
+ notNull: true;
5178
+ hasDefault: false;
5179
+ isPrimaryKey: false;
5180
+ isAutoincrement: false;
5181
+ hasRuntimeDefault: false;
5182
+ enumValues: undefined;
5183
+ baseColumn: never;
5184
+ identity: undefined;
5185
+ generated: undefined;
5186
+ }, {}, {
5187
+ $type: _$_makaio_contracts0.JsonPatchOperation[];
5188
+ }>;
5189
+ value: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5190
+ name: string;
5191
+ tableName: "workflow_execution_state_events";
5192
+ dataType: "json";
5193
+ columnType: "SQLiteTextJson";
5194
+ data: _$_makaio_contracts0.JsonValue;
5195
+ driverParam: string;
5196
+ notNull: true;
5197
+ hasDefault: false;
5198
+ isPrimaryKey: false;
5199
+ isAutoincrement: false;
5200
+ hasRuntimeDefault: false;
5201
+ enumValues: undefined;
5202
+ baseColumn: never;
5203
+ identity: undefined;
5204
+ generated: undefined;
5205
+ }, {}, {
5206
+ $type: _$_makaio_contracts0.JsonValue;
5207
+ }>;
5208
+ createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
5209
+ name: string;
5210
+ tableName: "workflow_execution_state_events";
5211
+ dataType: "number";
5212
+ columnType: "SQLiteInteger";
5213
+ data: number;
5214
+ driverParam: number;
5215
+ notNull: true;
5216
+ hasDefault: false;
5217
+ isPrimaryKey: false;
5218
+ isAutoincrement: false;
5219
+ hasRuntimeDefault: false;
5220
+ enumValues: undefined;
5221
+ baseColumn: never;
5222
+ identity: undefined;
5223
+ generated: undefined;
5224
+ }, {}, {}>;
5225
+ };
5226
+ dialect: "sqlite";
5227
+ }>;
4959
5228
  };
4960
5229
  }>;
4961
5230
  declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubjectDefinitions<"storage:workflow", {
@@ -4971,6 +5240,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
4971
5240
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
4972
5241
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
4973
5242
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5243
+ state: z.ZodOptional<z.ZodObject<{
5244
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
5245
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
5246
+ }, z.core.$strip>>;
4974
5247
  artifact: z.ZodOptional<z.ZodObject<{
4975
5248
  kind: z.ZodString;
4976
5249
  schemaVersion: z.ZodString;
@@ -5083,6 +5356,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5083
5356
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5084
5357
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5085
5358
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5359
+ state: z.ZodOptional<z.ZodObject<{
5360
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
5361
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
5362
+ }, z.core.$strip>>;
5086
5363
  artifact: z.ZodOptional<z.ZodObject<{
5087
5364
  kind: z.ZodString;
5088
5365
  schemaVersion: z.ZodString;
@@ -5221,6 +5498,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5221
5498
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5222
5499
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5223
5500
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5501
+ state: z.ZodOptional<z.ZodObject<{
5502
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
5503
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
5504
+ }, z.core.$strip>>;
5224
5505
  artifact: z.ZodOptional<z.ZodObject<{
5225
5506
  kind: z.ZodString;
5226
5507
  schemaVersion: z.ZodString;
@@ -5338,8 +5619,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5338
5619
  completed: "completed";
5339
5620
  cancelled: "cancelled";
5340
5621
  failed: "failed";
5341
- running: "running";
5342
5622
  paused: "paused";
5623
+ running: "running";
5343
5624
  }>;
5344
5625
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
5345
5626
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -5379,8 +5660,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5379
5660
  completed: "completed";
5380
5661
  cancelled: "cancelled";
5381
5662
  failed: "failed";
5382
- running: "running";
5383
5663
  paused: "paused";
5664
+ running: "running";
5384
5665
  }>;
5385
5666
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
5386
5667
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -5427,8 +5708,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5427
5708
  completed: "completed";
5428
5709
  cancelled: "cancelled";
5429
5710
  failed: "failed";
5430
- running: "running";
5431
5711
  paused: "paused";
5712
+ running: "running";
5432
5713
  }>;
5433
5714
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
5434
5715
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -5476,6 +5757,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5476
5757
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5477
5758
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5478
5759
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
5760
+ state: z.ZodOptional<z.ZodObject<{
5761
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
5762
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
5763
+ }, z.core.$strip>>;
5479
5764
  artifact: z.ZodOptional<z.ZodObject<{
5480
5765
  kind: z.ZodString;
5481
5766
  schemaVersion: z.ZodString;
@@ -5644,6 +5929,7 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5644
5929
  "exit-and-resume": "exit-and-resume";
5645
5930
  }>>;
5646
5931
  }, z.core.$strip>;
5932
+ initialState: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
5647
5933
  }, z.core.$strip>;
5648
5934
  response: z.ZodObject<{
5649
5935
  id: z.ZodString;
@@ -5658,8 +5944,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5658
5944
  completed: "completed";
5659
5945
  cancelled: "cancelled";
5660
5946
  failed: "failed";
5661
- running: "running";
5662
5947
  paused: "paused";
5948
+ running: "running";
5663
5949
  }>>;
5664
5950
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5665
5951
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -5727,8 +6013,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5727
6013
  completed: "completed";
5728
6014
  cancelled: "cancelled";
5729
6015
  failed: "failed";
5730
- running: "running";
5731
6016
  paused: "paused";
6017
+ running: "running";
5732
6018
  }>>;
5733
6019
  artifactRef: z.ZodOptional<z.ZodObject<{
5734
6020
  kind: z.ZodString;
@@ -5750,8 +6036,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5750
6036
  completed: "completed";
5751
6037
  cancelled: "cancelled";
5752
6038
  failed: "failed";
5753
- running: "running";
5754
6039
  paused: "paused";
6040
+ running: "running";
5755
6041
  }>;
5756
6042
  inputs: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
5757
6043
  config: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
@@ -5810,8 +6096,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5810
6096
  cancelled: "cancelled";
5811
6097
  failed: "failed";
5812
6098
  running: "running";
5813
- skipped: "skipped";
5814
6099
  waiting: "waiting";
6100
+ skipped: "skipped";
5815
6101
  }>;
5816
6102
  attempt: z.ZodDefault<z.ZodNumber>;
5817
6103
  iteration: z.ZodOptional<z.ZodNumber>;
@@ -5855,8 +6141,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5855
6141
  cancelled: "cancelled";
5856
6142
  failed: "failed";
5857
6143
  running: "running";
5858
- skipped: "skipped";
5859
6144
  waiting: "waiting";
6145
+ skipped: "skipped";
5860
6146
  }>;
5861
6147
  attempt: z.ZodDefault<z.ZodNumber>;
5862
6148
  iteration: z.ZodOptional<z.ZodNumber>;
@@ -5897,8 +6183,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5897
6183
  cancelled: "cancelled";
5898
6184
  failed: "failed";
5899
6185
  running: "running";
5900
- skipped: "skipped";
5901
6186
  waiting: "waiting";
6187
+ skipped: "skipped";
5902
6188
  }>;
5903
6189
  attempt: z.ZodDefault<z.ZodNumber>;
5904
6190
  iteration: z.ZodOptional<z.ZodNumber>;
@@ -5925,8 +6211,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
5925
6211
  status: z.ZodEnum<{
5926
6212
  cancelled: "cancelled";
5927
6213
  rejected: "rejected";
5928
- resumed: "resumed";
5929
6214
  waiting: "waiting";
6215
+ resumed: "resumed";
5930
6216
  "timed-out": "timed-out";
5931
6217
  }>;
5932
6218
  autoAction: z.ZodEnum<{
@@ -6057,8 +6343,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6057
6343
  status: z.ZodEnum<{
6058
6344
  cancelled: "cancelled";
6059
6345
  rejected: "rejected";
6060
- resumed: "resumed";
6061
6346
  waiting: "waiting";
6347
+ resumed: "resumed";
6062
6348
  "timed-out": "timed-out";
6063
6349
  }>;
6064
6350
  autoAction: z.ZodEnum<{
@@ -6082,8 +6368,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6082
6368
  status: z.ZodOptional<z.ZodEnum<{
6083
6369
  cancelled: "cancelled";
6084
6370
  rejected: "rejected";
6085
- resumed: "resumed";
6086
6371
  waiting: "waiting";
6372
+ resumed: "resumed";
6087
6373
  "timed-out": "timed-out";
6088
6374
  }>>;
6089
6375
  limit: z.ZodDefault<z.ZodNumber>;
@@ -6098,8 +6384,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6098
6384
  status: z.ZodEnum<{
6099
6385
  cancelled: "cancelled";
6100
6386
  rejected: "rejected";
6101
- resumed: "resumed";
6102
6387
  waiting: "waiting";
6388
+ resumed: "resumed";
6103
6389
  "timed-out": "timed-out";
6104
6390
  }>;
6105
6391
  autoAction: z.ZodEnum<{
@@ -6133,8 +6419,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6133
6419
  status: z.ZodEnum<{
6134
6420
  cancelled: "cancelled";
6135
6421
  rejected: "rejected";
6136
- resumed: "resumed";
6137
6422
  waiting: "waiting";
6423
+ resumed: "resumed";
6138
6424
  "timed-out": "timed-out";
6139
6425
  }>;
6140
6426
  autoAction: z.ZodEnum<{
@@ -6275,6 +6561,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6275
6561
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
6276
6562
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
6277
6563
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
6564
+ state: z.ZodOptional<z.ZodObject<{
6565
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
6566
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
6567
+ }, z.core.$strip>>;
6278
6568
  artifact: z.ZodOptional<z.ZodObject<{
6279
6569
  kind: z.ZodString;
6280
6570
  schemaVersion: z.ZodString;
@@ -6478,6 +6768,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6478
6768
  inputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
6479
6769
  configSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
6480
6770
  outputSchema: z.ZodOptional<z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>>;
6771
+ state: z.ZodOptional<z.ZodObject<{
6772
+ schema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
6773
+ initial: z.ZodOptional<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
6774
+ }, z.core.$strip>>;
6481
6775
  artifact: z.ZodOptional<z.ZodObject<{
6482
6776
  kind: z.ZodString;
6483
6777
  schemaVersion: z.ZodString;
@@ -6647,6 +6941,38 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
6647
6941
  }>>;
6648
6942
  }, z.core.$strip>>;
6649
6943
  }, z.core.$strip>;
6944
+ }>; /** Initialize execution state snapshot at sequence 0. */
6945
+ initializeState: _$_makaio_core0.LocalSubjectSchema<{
6946
+ request: z.ZodObject<{
6947
+ executionId: z.ZodString;
6948
+ initialValue: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
6949
+ }, z.core.$strip>;
6950
+ response: z.ZodObject<{}, z.core.$strip>;
6951
+ }>; /** Read current execution state snapshot. */
6952
+ getState: _$_makaio_core0.LocalSubjectSchema<{
6953
+ request: z.ZodObject<{
6954
+ executionId: z.ZodString;
6955
+ }, z.core.$strip>;
6956
+ response: z.ZodObject<{
6957
+ state: z.ZodNullable<z.ZodObject<{
6958
+ executionId: z.ZodString;
6959
+ sequence: z.ZodNumber;
6960
+ value: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
6961
+ }, z.core.$strip>>;
6962
+ }, z.core.$strip>;
6963
+ }>; /** Apply a state mutation with optimistic concurrency control. */
6964
+ patchState: _$_makaio_core0.LocalSubjectSchema<{
6965
+ request: z.ZodObject<{
6966
+ executionId: z.ZodString;
6967
+ expectedSequence: z.ZodNumber;
6968
+ nextValue: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
6969
+ }, z.core.$strip>;
6970
+ response: z.ZodObject<{
6971
+ executionId: z.ZodString;
6972
+ sequence: z.ZodNumber;
6973
+ patch: z.ZodArray<z.ZodType<_$_makaio_contracts0.JsonPatchOperation, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonPatchOperation, unknown>>>;
6974
+ value: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
6975
+ }, z.core.$strip>;
6650
6976
  }>;
6651
6977
  }>, "storage:workflow">;
6652
6978
  //#endregion
@@ -6770,7 +7096,7 @@ declare const workflowDefinitionsDual: _$_makaio_storage_drizzle0.DualTable<"wor
6770
7096
  } | undefined;
6771
7097
  providers?: Record<string, JsonValue> | undefined;
6772
7098
  }>>;
6773
- scopeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"], number | undefined>>, "external" | "session" | "global" | "workspace">, _$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"]>>, "external" | "session" | "global" | "workspace">>;
7099
+ scopeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"], number | undefined>>, "external" | "global" | "workspace" | "session">, _$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"]>>, "external" | "global" | "workspace" | "session">>;
6774
7100
  scopeKind: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_kind", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_kind", [string, ...string[]]>>>>;
6775
7101
  scopeId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_id", [string, ...string[]]>>>>; /** Unique workflow identifier. */
6776
7102
  id: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"id", [string, ...string[]]>>>>; /** Workflow name. */
@@ -6813,7 +7139,14 @@ declare const workflowDefinitionsDual: _$_makaio_storage_drizzle0.DualTable<"wor
6813
7139
  }>>>; /** JSON Schema for workflow input parameters (JSON object). */
6814
7140
  inputSchema: _$_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>>>; /** JSON Schema for static workflow configuration (JSON object). */
6815
7141
  configSchema: _$_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>>>; /** JSON Schema for the workflow's primary output (JSON object). */
6816
- outputSchema: _$_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>>>; /** Primary artifact binding for workflow output/state (JSON object). */
7142
+ outputSchema: _$_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>>>; /** Optional state contract for run-scoped mutable state (JSON object). */
7143
+ state: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm_sqlite_core0.SQLiteTextJsonBuilderInitial<string>, {
7144
+ schema: Record<string, JsonValue>;
7145
+ initial?: JsonValue | undefined;
7146
+ }>, _$drizzle_orm0.$Type<_$drizzle_orm_pg_core0.PgJsonbBuilderInitial<string>, {
7147
+ schema: Record<string, JsonValue>;
7148
+ initial?: JsonValue | undefined;
7149
+ }>>; /** Primary artifact binding declared by the workflow (JSON object). */
6817
7150
  artifact: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm_sqlite_core0.SQLiteTextJsonBuilderInitial<string>, {
6818
7151
  kind: string;
6819
7152
  schemaVersion: string;
@@ -6902,7 +7235,7 @@ declare const workflowDefinitionsDual: _$_makaio_storage_drizzle0.DualTable<"wor
6902
7235
  * Stores runtime state of workflow executions.
6903
7236
  */
6904
7237
  declare const workflowExecutionsDual: _$_makaio_storage_drizzle0.DualTable<"workflow_executions", {
6905
- scopeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"], number | undefined>>, "external" | "session" | "global" | "workspace">, _$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"]>>, "external" | "session" | "global" | "workspace">>;
7238
+ scopeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"], number | undefined>>, "external" | "global" | "workspace" | "session">, _$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_type", ["global", "workspace", "session", "external"]>>, "external" | "global" | "workspace" | "session">>;
6906
7239
  scopeKind: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_kind", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_kind", [string, ...string[]]>>>>;
6907
7240
  scopeId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"scope_id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"scope_id", [string, ...string[]]>>>>; /** Unique execution identifier. */
6908
7241
  id: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"id", [string, ...string[]]>>>>; /** Workflow definition or ephemeral source execution identifier. */
@@ -6993,5 +7326,87 @@ declare const worklogFrameEntriesDual: _$_makaio_storage_drizzle0.DualTable<"wor
6993
7326
  estimatedCost: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteRealBuilderInitial<string>, _$drizzle_orm_pg_core0.PgDoublePrecisionBuilderInitial<string>>; /** Human-readable error message when `status` is `'failed'`. */
6994
7327
  error: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"error", [string, ...string[]], number | undefined>, _$drizzle_orm_pg_core0.PgTextBuilderInitial<"error", [string, ...string[]]>>;
6995
7328
  }>;
7329
+ /**
7330
+ * Workflow execution state snapshot table.
7331
+ *
7332
+ * Stores the latest state value for each execution. Updated in place via
7333
+ * optimistic-concurrency patches through the `patchWorkflowState` handler.
7334
+ * The `sequence` column is a monotonically increasing counter used for
7335
+ * compare-and-set conflict detection.
7336
+ *
7337
+ * CENTRAL tier — migrated alongside `workflow_executions`.
7338
+ */
7339
+ declare const workflowExecutionStateDual: _$_makaio_storage_drizzle0.DualTable<"workflow_execution_state", {
7340
+ /** Execution this state belongs to (1:1 with workflow_executions.id). */executionId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"execution_id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"execution_id", [string, ...string[]]>>>>; /** Monotonically increasing sequence number for optimistic concurrency. */
7341
+ sequence: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>>>, _$drizzle_orm0.HasDefault<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgIntegerBuilderInitial<string>>>>; /** Current state value (JSON). */
7342
+ value: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm0.$Type<_$drizzle_orm_sqlite_core0.SQLiteTextJsonBuilderInitial<string>, JsonValue>>, _$drizzle_orm0.NotNull<_$drizzle_orm0.$Type<_$drizzle_orm_pg_core0.PgJsonbBuilderInitial<string>, JsonValue>>>; /** Last update timestamp (epoch ms). */
7343
+ updatedAt: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgBigInt53BuilderInitial<string>>>;
7344
+ }>;
7345
+ /**
7346
+ * Workflow execution state mutation log table.
7347
+ *
7348
+ * Append-only log of every state mutation applied to an execution. Each row
7349
+ * records the JSON-Patch array (`patch`) and the resulting full value
7350
+ * (`value`) at the given `sequence` number. Used for audit trails,
7351
+ * debugging, and eventual replay.
7352
+ *
7353
+ * CENTRAL tier — migrated alongside `workflow_executions`.
7354
+ */
7355
+ declare const workflowExecutionStateEventsDual: _$_makaio_storage_drizzle0.DualTable<"workflow_execution_state_events", {
7356
+ /** Execution this event belongs to. */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[]]>>>; /** Sequence number of the mutation (matches the snapshot sequence after apply). */
7357
+ sequence: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgIntegerBuilderInitial<string>>>; /** JSON-Patch operations applied in this mutation (JSON array). */
7358
+ patch: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm0.$Type<_$drizzle_orm_sqlite_core0.SQLiteTextJsonBuilderInitial<string>, JsonPatchOperation[]>>, _$drizzle_orm0.NotNull<_$drizzle_orm0.$Type<_$drizzle_orm_pg_core0.PgJsonbBuilderInitial<string>, JsonPatchOperation[]>>>; /** Full state value after applying the patch (JSON). */
7359
+ value: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm0.$Type<_$drizzle_orm_sqlite_core0.SQLiteTextJsonBuilderInitial<string>, JsonValue>>, _$drizzle_orm0.NotNull<_$drizzle_orm0.$Type<_$drizzle_orm_pg_core0.PgJsonbBuilderInitial<string>, JsonValue>>>; /** Mutation timestamp (epoch ms). */
7360
+ createdAt: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteIntegerBuilderInitial<string>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgBigInt53BuilderInitial<string>>>;
7361
+ }>;
7362
+ //#endregion
7363
+ //#region subsystems/workflow-engine/src/storage/state-handler.d.ts
7364
+ /**
7365
+ * Initialize workflow state for an execution.
7366
+ *
7367
+ * Creates the initial state snapshot row with sequence 0 and appends a
7368
+ * corresponding entry to the mutation log. If a state row already exists
7369
+ * for the given execution, the insert is a no-op (idempotent) to prevent
7370
+ * a restart or re-init from overwriting live state.
7371
+ * @param db - Database instance.
7372
+ * @param executionId - Execution to initialize state for.
7373
+ * @param initialValue - Initial state value.
7374
+ */
7375
+ declare function initializeWorkflowState(db: MakaioDatabase, executionId: string, initialValue: JsonValue): Promise<void>;
7376
+ /**
7377
+ * Get the current state snapshot for an execution.
7378
+ * @param db - Database instance.
7379
+ * @param executionId - Execution to get state for.
7380
+ * @returns Current state with sequence number, or null if no state exists.
7381
+ */
7382
+ declare function getWorkflowState(db: MakaioDatabase, executionId: string): Promise<{
7383
+ executionId: string;
7384
+ sequence: number;
7385
+ value: JsonValue;
7386
+ } | null>;
7387
+ /**
7388
+ * Apply a state mutation with optimistic concurrency control.
7389
+ *
7390
+ * Atomically updates the snapshot and appends a mutation log entry. The
7391
+ * persisted patch is derived from the stored current value and accepted next
7392
+ * value so the append-only event log always reflects the actual snapshot
7393
+ * transition.
7394
+ * Throws when the current sequence does not match `expectedSequence`.
7395
+ * @param db - Database instance
7396
+ * @param params - Patch parameters including executionId, expectedSequence, and nextValue
7397
+ * @returns The new state with updated sequence number.
7398
+ * @throws Error with message containing 'state sequence conflict' when expectedSequence doesn't match.
7399
+ * @throws Error when no state exists for the given execution.
7400
+ */
7401
+ declare function patchWorkflowState(db: MakaioDatabase, params: {
7402
+ executionId: string;
7403
+ expectedSequence: number;
7404
+ nextValue: JsonValue;
7405
+ }): Promise<{
7406
+ executionId: string;
7407
+ sequence: number;
7408
+ patch: JsonPatchOperation[];
7409
+ value: JsonValue;
7410
+ }>;
6996
7411
  //#endregion
6997
- export { WorkflowEngineService, WorkflowEngineToken, WorkflowExecutor, WorkflowStorageNamespace, WorkflowStorageSubjects, buildWorkflowExpressionContextFromResolvedInputs, createWorkflowEnginePackage, registerDrizzleWorkflowStorage, runShellStep, workflowDefinitionsDual, workflowEnginePackage, workflowExecutionsDual, workflowStepSpansDual, worklogFrameEntriesDual, worklogSummariesDual };
7412
+ export { WorkflowEngineService, WorkflowEngineToken, WorkflowExecutor, WorkflowStorageNamespace, WorkflowStorageSubjects, buildWorkflowExpressionContextFromResolvedInputs, createWorkflowEnginePackage, getWorkflowState, initializeWorkflowState, patchWorkflowState, registerDrizzleWorkflowStorage, runShellStep, workflowDefinitionsDual, workflowEnginePackage, workflowExecutionStateDual, workflowExecutionStateEventsDual, workflowExecutionsDual, workflowStepSpansDual, worklogFrameEntriesDual, worklogSummariesDual };