callman-mcp 0.2.0 → 0.4.0

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 (63) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +4 -4
  3. package/dist/client/api.d.ts +16 -1
  4. package/dist/client/api.d.ts.map +1 -1
  5. package/dist/client/api.js +22 -0
  6. package/dist/client/api.js.map +1 -1
  7. package/dist/client/types.d.ts +14 -0
  8. package/dist/client/types.d.ts.map +1 -1
  9. package/dist/domain/diagram/build.d.ts +122 -73
  10. package/dist/domain/diagram/build.d.ts.map +1 -1
  11. package/dist/domain/diagram/build.js +51 -167
  12. package/dist/domain/diagram/build.js.map +1 -1
  13. package/dist/domain/diagram/layout.d.ts +5 -4
  14. package/dist/domain/diagram/layout.d.ts.map +1 -1
  15. package/dist/domain/diagram/layout.js +18 -45
  16. package/dist/domain/diagram/layout.js.map +1 -1
  17. package/dist/domain/diagram/patch.d.ts +1011 -92
  18. package/dist/domain/diagram/patch.d.ts.map +1 -1
  19. package/dist/domain/diagram/patch.js +113 -273
  20. package/dist/domain/diagram/patch.js.map +1 -1
  21. package/dist/domain/diagram/style.d.ts +4 -12
  22. package/dist/domain/diagram/style.d.ts.map +1 -1
  23. package/dist/domain/diagram/style.js +8 -84
  24. package/dist/domain/diagram/style.js.map +1 -1
  25. package/dist/domain/diagram/summarize.d.ts +26 -24
  26. package/dist/domain/diagram/summarize.d.ts.map +1 -1
  27. package/dist/domain/diagram/summarize.js +21 -35
  28. package/dist/domain/diagram/summarize.js.map +1 -1
  29. package/dist/domain/requestIntegrations.d.ts +20 -20
  30. package/dist/domain/requestShape.d.ts +32 -32
  31. package/dist/resources/docs/diagramSchema.d.ts +1 -1
  32. package/dist/resources/docs/diagramSchema.d.ts.map +1 -1
  33. package/dist/resources/docs/diagramSchema.js +87 -10
  34. package/dist/resources/docs/diagramSchema.js.map +1 -1
  35. package/dist/resources/docs/overview.d.ts +1 -1
  36. package/dist/resources/docs/overview.d.ts.map +1 -1
  37. package/dist/resources/docs/overview.js +4 -1
  38. package/dist/resources/docs/overview.js.map +1 -1
  39. package/dist/resources/generated/aiPacks.d.ts +1 -1
  40. package/dist/resources/generated/aiPacks.js +2 -2
  41. package/dist/tools/catalog.d.ts.map +1 -1
  42. package/dist/tools/catalog.js +5 -0
  43. package/dist/tools/catalog.js.map +1 -1
  44. package/dist/tools/diagrams.d.ts.map +1 -1
  45. package/dist/tools/diagrams.js +547 -59
  46. package/dist/tools/diagrams.js.map +1 -1
  47. package/dist/tools/lookups.d.ts +5 -1
  48. package/dist/tools/lookups.d.ts.map +1 -1
  49. package/dist/tools/lookups.js +41 -0
  50. package/dist/tools/lookups.js.map +1 -1
  51. package/dist-cjs/client/api.js +22 -0
  52. package/dist-cjs/domain/diagram/build.js +55 -171
  53. package/dist-cjs/domain/diagram/layout.js +19 -45
  54. package/dist-cjs/domain/diagram/patch.js +111 -271
  55. package/dist-cjs/domain/diagram/style.js +11 -88
  56. package/dist-cjs/domain/diagram/summarize.js +23 -35
  57. package/dist-cjs/resources/docs/diagramSchema.js +87 -10
  58. package/dist-cjs/resources/docs/overview.js +4 -1
  59. package/dist-cjs/resources/generated/aiPacks.js +2 -2
  60. package/dist-cjs/tools/catalog.js +5 -0
  61. package/dist-cjs/tools/diagrams.js +539 -51
  62. package/dist-cjs/tools/lookups.js +46 -1
  63. package/package.json +2 -2
@@ -1,5 +1,187 @@
1
- import { type DiagramDocument } from "callman-core";
1
+ import { type DiagramDocument, type LayoutDirection } from "callman-core";
2
2
  import { z } from "zod";
3
+ export declare const dbColumnInputSchema: z.ZodObject<{
4
+ id: z.ZodOptional<z.ZodString>;
5
+ name: z.ZodString;
6
+ dataType: z.ZodOptional<z.ZodString>;
7
+ nullable: z.ZodOptional<z.ZodBoolean>;
8
+ primaryKey: z.ZodOptional<z.ZodBoolean>;
9
+ unique: z.ZodOptional<z.ZodBoolean>;
10
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ autoIncrement: z.ZodOptional<z.ZodBoolean>;
12
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ }, "strict", z.ZodTypeAny, {
14
+ name: string;
15
+ id?: string | undefined;
16
+ unique?: boolean | undefined;
17
+ nullable?: boolean | undefined;
18
+ dataType?: string | undefined;
19
+ primaryKey?: boolean | undefined;
20
+ defaultValue?: string | null | undefined;
21
+ autoIncrement?: boolean | undefined;
22
+ comment?: string | null | undefined;
23
+ }, {
24
+ name: string;
25
+ id?: string | undefined;
26
+ unique?: boolean | undefined;
27
+ nullable?: boolean | undefined;
28
+ dataType?: string | undefined;
29
+ primaryKey?: boolean | undefined;
30
+ defaultValue?: string | null | undefined;
31
+ autoIncrement?: boolean | undefined;
32
+ comment?: string | null | undefined;
33
+ }>;
34
+ export declare const dbTableInputSchema: z.ZodObject<{
35
+ id: z.ZodOptional<z.ZodString>;
36
+ name: z.ZodString;
37
+ schema: z.ZodOptional<z.ZodString>;
38
+ kind: z.ZodOptional<z.ZodEnum<["table", "view", "collection"]>>;
39
+ columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ id: z.ZodOptional<z.ZodString>;
41
+ name: z.ZodString;
42
+ dataType: z.ZodOptional<z.ZodString>;
43
+ nullable: z.ZodOptional<z.ZodBoolean>;
44
+ primaryKey: z.ZodOptional<z.ZodBoolean>;
45
+ unique: z.ZodOptional<z.ZodBoolean>;
46
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
+ autoIncrement: z.ZodOptional<z.ZodBoolean>;
48
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ }, "strict", z.ZodTypeAny, {
50
+ name: string;
51
+ id?: string | undefined;
52
+ unique?: boolean | undefined;
53
+ nullable?: boolean | undefined;
54
+ dataType?: string | undefined;
55
+ primaryKey?: boolean | undefined;
56
+ defaultValue?: string | null | undefined;
57
+ autoIncrement?: boolean | undefined;
58
+ comment?: string | null | undefined;
59
+ }, {
60
+ name: string;
61
+ id?: string | undefined;
62
+ unique?: boolean | undefined;
63
+ nullable?: boolean | undefined;
64
+ dataType?: string | undefined;
65
+ primaryKey?: boolean | undefined;
66
+ defaultValue?: string | null | undefined;
67
+ autoIncrement?: boolean | undefined;
68
+ comment?: string | null | undefined;
69
+ }>, "many">>;
70
+ comment: z.ZodOptional<z.ZodString>;
71
+ }, "strict", z.ZodTypeAny, {
72
+ name: string;
73
+ id?: string | undefined;
74
+ schema?: string | undefined;
75
+ kind?: "collection" | "table" | "view" | undefined;
76
+ columns?: {
77
+ name: string;
78
+ id?: string | undefined;
79
+ unique?: boolean | undefined;
80
+ nullable?: boolean | undefined;
81
+ dataType?: string | undefined;
82
+ primaryKey?: boolean | undefined;
83
+ defaultValue?: string | null | undefined;
84
+ autoIncrement?: boolean | undefined;
85
+ comment?: string | null | undefined;
86
+ }[] | undefined;
87
+ comment?: string | undefined;
88
+ }, {
89
+ name: string;
90
+ id?: string | undefined;
91
+ schema?: string | undefined;
92
+ kind?: "collection" | "table" | "view" | undefined;
93
+ columns?: {
94
+ name: string;
95
+ id?: string | undefined;
96
+ unique?: boolean | undefined;
97
+ nullable?: boolean | undefined;
98
+ dataType?: string | undefined;
99
+ primaryKey?: boolean | undefined;
100
+ defaultValue?: string | null | undefined;
101
+ autoIncrement?: boolean | undefined;
102
+ comment?: string | null | undefined;
103
+ }[] | undefined;
104
+ comment?: string | undefined;
105
+ }>;
106
+ export declare const dbEndSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
107
+ table: z.ZodString;
108
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
109
+ column: z.ZodOptional<z.ZodString>;
110
+ }, "strict", z.ZodTypeAny, {
111
+ table: string;
112
+ columns?: string[] | undefined;
113
+ column?: string | undefined;
114
+ }, {
115
+ table: string;
116
+ columns?: string[] | undefined;
117
+ column?: string | undefined;
118
+ }>]>;
119
+ export declare const dbCardinalitySchema: z.ZodEnum<["1:1", "1:N", "N:1", "N:M"]>;
120
+ export declare const dbRelationshipInputSchema: z.ZodObject<{
121
+ id: z.ZodOptional<z.ZodString>;
122
+ source: z.ZodUnion<[z.ZodString, z.ZodObject<{
123
+ table: z.ZodString;
124
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
125
+ column: z.ZodOptional<z.ZodString>;
126
+ }, "strict", z.ZodTypeAny, {
127
+ table: string;
128
+ columns?: string[] | undefined;
129
+ column?: string | undefined;
130
+ }, {
131
+ table: string;
132
+ columns?: string[] | undefined;
133
+ column?: string | undefined;
134
+ }>]>;
135
+ target: z.ZodUnion<[z.ZodString, z.ZodObject<{
136
+ table: z.ZodString;
137
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
138
+ column: z.ZodOptional<z.ZodString>;
139
+ }, "strict", z.ZodTypeAny, {
140
+ table: string;
141
+ columns?: string[] | undefined;
142
+ column?: string | undefined;
143
+ }, {
144
+ table: string;
145
+ columns?: string[] | undefined;
146
+ column?: string | undefined;
147
+ }>]>;
148
+ cardinality: z.ZodOptional<z.ZodEnum<["1:1", "1:N", "N:1", "N:M"]>>;
149
+ kind: z.ZodOptional<z.ZodEnum<["foreignKey", "manual"]>>;
150
+ name: z.ZodOptional<z.ZodString>;
151
+ label: z.ZodOptional<z.ZodString>;
152
+ }, "strict", z.ZodTypeAny, {
153
+ source: string | {
154
+ table: string;
155
+ columns?: string[] | undefined;
156
+ column?: string | undefined;
157
+ };
158
+ target: string | {
159
+ table: string;
160
+ columns?: string[] | undefined;
161
+ column?: string | undefined;
162
+ };
163
+ id?: string | undefined;
164
+ name?: string | undefined;
165
+ kind?: "foreignKey" | "manual" | undefined;
166
+ label?: string | undefined;
167
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
168
+ }, {
169
+ source: string | {
170
+ table: string;
171
+ columns?: string[] | undefined;
172
+ column?: string | undefined;
173
+ };
174
+ target: string | {
175
+ table: string;
176
+ columns?: string[] | undefined;
177
+ column?: string | undefined;
178
+ };
179
+ id?: string | undefined;
180
+ name?: string | undefined;
181
+ kind?: "foreignKey" | "manual" | undefined;
182
+ label?: string | undefined;
183
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
184
+ }>;
3
185
  export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
4
186
  op: z.ZodLiteral<"addNode">;
5
187
  node: z.ZodObject<{
@@ -145,6 +327,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
145
327
  rotation: z.ZodOptional<z.ZodNumber>;
146
328
  locked: z.ZodOptional<z.ZodBoolean>;
147
329
  hidden: z.ZodOptional<z.ZodBoolean>;
330
+ collapsed: z.ZodOptional<z.ZodBoolean>;
148
331
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
332
  }, "strict", z.ZodTypeAny, {
150
333
  type: string;
@@ -155,6 +338,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
155
338
  width: number;
156
339
  height: number;
157
340
  } | undefined;
341
+ label?: string | undefined;
342
+ position?: {
343
+ x: number;
344
+ y: number;
345
+ } | undefined;
158
346
  style?: {
159
347
  fill?: string | {
160
348
  raw: string;
@@ -189,11 +377,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
189
377
  rotation?: number | undefined;
190
378
  locked?: boolean | undefined;
191
379
  hidden?: boolean | undefined;
192
- label?: string | undefined;
193
- position?: {
194
- x: number;
195
- y: number;
196
- } | undefined;
380
+ collapsed?: boolean | undefined;
197
381
  }, {
198
382
  type: string;
199
383
  data?: Record<string, unknown> | undefined;
@@ -203,6 +387,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
203
387
  width: number;
204
388
  height: number;
205
389
  } | undefined;
390
+ label?: string | undefined;
391
+ position?: {
392
+ x: number;
393
+ y: number;
394
+ } | undefined;
206
395
  style?: {
207
396
  fill?: string | {
208
397
  raw: string;
@@ -237,11 +426,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
237
426
  rotation?: number | undefined;
238
427
  locked?: boolean | undefined;
239
428
  hidden?: boolean | undefined;
240
- label?: string | undefined;
241
- position?: {
242
- x: number;
243
- y: number;
244
- } | undefined;
429
+ collapsed?: boolean | undefined;
245
430
  }>;
246
431
  }, "strict", z.ZodTypeAny, {
247
432
  op: "addNode";
@@ -254,6 +439,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
254
439
  width: number;
255
440
  height: number;
256
441
  } | undefined;
442
+ label?: string | undefined;
443
+ position?: {
444
+ x: number;
445
+ y: number;
446
+ } | undefined;
257
447
  style?: {
258
448
  fill?: string | {
259
449
  raw: string;
@@ -288,11 +478,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
288
478
  rotation?: number | undefined;
289
479
  locked?: boolean | undefined;
290
480
  hidden?: boolean | undefined;
291
- label?: string | undefined;
292
- position?: {
293
- x: number;
294
- y: number;
295
- } | undefined;
481
+ collapsed?: boolean | undefined;
296
482
  };
297
483
  }, {
298
484
  op: "addNode";
@@ -305,6 +491,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
305
491
  width: number;
306
492
  height: number;
307
493
  } | undefined;
494
+ label?: string | undefined;
495
+ position?: {
496
+ x: number;
497
+ y: number;
498
+ } | undefined;
308
499
  style?: {
309
500
  fill?: string | {
310
501
  raw: string;
@@ -339,11 +530,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
339
530
  rotation?: number | undefined;
340
531
  locked?: boolean | undefined;
341
532
  hidden?: boolean | undefined;
342
- label?: string | undefined;
343
- position?: {
344
- x: number;
345
- y: number;
346
- } | undefined;
533
+ collapsed?: boolean | undefined;
347
534
  };
348
535
  }>, z.ZodObject<{
349
536
  op: z.ZodLiteral<"updateNode">;
@@ -490,6 +677,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
490
677
  rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
491
678
  locked: z.ZodOptional<z.ZodBoolean>;
492
679
  hidden: z.ZodOptional<z.ZodBoolean>;
680
+ collapsed: z.ZodOptional<z.ZodBoolean>;
493
681
  data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
494
682
  }, "strict", z.ZodTypeAny, {
495
683
  data?: Record<string, unknown> | null | undefined;
@@ -499,6 +687,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
499
687
  width: number;
500
688
  height: number;
501
689
  } | undefined;
690
+ label?: string | undefined;
691
+ position?: {
692
+ x: number;
693
+ y: number;
694
+ } | undefined;
502
695
  style?: {
503
696
  fill?: string | {
504
697
  raw: string;
@@ -533,11 +726,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
533
726
  rotation?: number | null | undefined;
534
727
  locked?: boolean | undefined;
535
728
  hidden?: boolean | undefined;
536
- label?: string | undefined;
537
- position?: {
538
- x: number;
539
- y: number;
540
- } | undefined;
729
+ collapsed?: boolean | undefined;
541
730
  }, {
542
731
  data?: Record<string, unknown> | null | undefined;
543
732
  type?: string | undefined;
@@ -546,6 +735,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
546
735
  width: number;
547
736
  height: number;
548
737
  } | undefined;
738
+ label?: string | undefined;
739
+ position?: {
740
+ x: number;
741
+ y: number;
742
+ } | undefined;
549
743
  style?: {
550
744
  fill?: string | {
551
745
  raw: string;
@@ -580,11 +774,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
580
774
  rotation?: number | null | undefined;
581
775
  locked?: boolean | undefined;
582
776
  hidden?: boolean | undefined;
583
- label?: string | undefined;
584
- position?: {
585
- x: number;
586
- y: number;
587
- } | undefined;
777
+ collapsed?: boolean | undefined;
588
778
  }>;
589
779
  }, "strict", z.ZodTypeAny, {
590
780
  id: string;
@@ -597,6 +787,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
597
787
  width: number;
598
788
  height: number;
599
789
  } | undefined;
790
+ label?: string | undefined;
791
+ position?: {
792
+ x: number;
793
+ y: number;
794
+ } | undefined;
600
795
  style?: {
601
796
  fill?: string | {
602
797
  raw: string;
@@ -631,11 +826,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
631
826
  rotation?: number | null | undefined;
632
827
  locked?: boolean | undefined;
633
828
  hidden?: boolean | undefined;
634
- label?: string | undefined;
635
- position?: {
636
- x: number;
637
- y: number;
638
- } | undefined;
829
+ collapsed?: boolean | undefined;
639
830
  };
640
831
  }, {
641
832
  id: string;
@@ -648,6 +839,11 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
648
839
  width: number;
649
840
  height: number;
650
841
  } | undefined;
842
+ label?: string | undefined;
843
+ position?: {
844
+ x: number;
845
+ y: number;
846
+ } | undefined;
651
847
  style?: {
652
848
  fill?: string | {
653
849
  raw: string;
@@ -682,11 +878,7 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
682
878
  rotation?: number | null | undefined;
683
879
  locked?: boolean | undefined;
684
880
  hidden?: boolean | undefined;
685
- label?: string | undefined;
686
- position?: {
687
- x: number;
688
- y: number;
689
- } | undefined;
881
+ collapsed?: boolean | undefined;
690
882
  };
691
883
  }>, z.ZodObject<{
692
884
  op: z.ZodLiteral<"removeNode">;
@@ -718,71 +910,86 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
718
910
  }, {
719
911
  token: string;
720
912
  }>]>>;
721
- routing: z.ZodOptional<z.ZodEnum<["orthogonal", "straight", "curved"]>>;
722
- markerEnd: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval"]>>;
723
- markerStart: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval"]>>;
913
+ routing: z.ZodOptional<z.ZodEnum<["orthogonal", "straight", "curved", "smart"]>>;
914
+ markerEnd: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval", "one", "many", "zeroOne", "zeroMany"]>>;
915
+ markerStart: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval", "one", "many", "zeroOne", "zeroMany"]>>;
916
+ sourceSide: z.ZodOptional<z.ZodEnum<["top", "right", "bottom", "left"]>>;
917
+ targetSide: z.ZodOptional<z.ZodEnum<["top", "right", "bottom", "left"]>>;
918
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
724
919
  }, "strict", z.ZodTypeAny, {
725
920
  source: string;
726
921
  target: string;
922
+ data?: Record<string, unknown> | undefined;
727
923
  id?: string | undefined;
924
+ label?: string | undefined;
925
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
728
926
  color?: string | {
729
927
  raw: string;
730
928
  } | {
731
929
  token: string;
732
930
  } | undefined;
733
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
734
- label?: string | undefined;
735
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
736
- routing?: "orthogonal" | "straight" | "curved" | undefined;
737
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
931
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
932
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
933
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
934
+ sourceSide?: "left" | "right" | "top" | "bottom" | undefined;
935
+ targetSide?: "left" | "right" | "top" | "bottom" | undefined;
738
936
  }, {
739
937
  source: string;
740
938
  target: string;
939
+ data?: Record<string, unknown> | undefined;
741
940
  id?: string | undefined;
941
+ label?: string | undefined;
942
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
742
943
  color?: string | {
743
944
  raw: string;
744
945
  } | {
745
946
  token: string;
746
947
  } | undefined;
747
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
748
- label?: string | undefined;
749
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
750
- routing?: "orthogonal" | "straight" | "curved" | undefined;
751
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
948
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
949
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
950
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
951
+ sourceSide?: "left" | "right" | "top" | "bottom" | undefined;
952
+ targetSide?: "left" | "right" | "top" | "bottom" | undefined;
752
953
  }>;
753
954
  }, "strict", z.ZodTypeAny, {
754
955
  op: "addEdge";
755
956
  edge: {
756
957
  source: string;
757
958
  target: string;
959
+ data?: Record<string, unknown> | undefined;
758
960
  id?: string | undefined;
961
+ label?: string | undefined;
962
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
759
963
  color?: string | {
760
964
  raw: string;
761
965
  } | {
762
966
  token: string;
763
967
  } | undefined;
764
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
765
- label?: string | undefined;
766
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
767
- routing?: "orthogonal" | "straight" | "curved" | undefined;
768
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
968
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
969
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
970
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
971
+ sourceSide?: "left" | "right" | "top" | "bottom" | undefined;
972
+ targetSide?: "left" | "right" | "top" | "bottom" | undefined;
769
973
  };
770
974
  }, {
771
975
  op: "addEdge";
772
976
  edge: {
773
977
  source: string;
774
978
  target: string;
979
+ data?: Record<string, unknown> | undefined;
775
980
  id?: string | undefined;
981
+ label?: string | undefined;
982
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
776
983
  color?: string | {
777
984
  raw: string;
778
985
  } | {
779
986
  token: string;
780
987
  } | undefined;
781
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
782
- label?: string | undefined;
783
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
784
- routing?: "orthogonal" | "straight" | "curved" | undefined;
785
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
988
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
989
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
990
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
991
+ sourceSide?: "left" | "right" | "top" | "bottom" | undefined;
992
+ targetSide?: "left" | "right" | "top" | "bottom" | undefined;
786
993
  };
787
994
  }>, z.ZodObject<{
788
995
  op: z.ZodLiteral<"updateEdge">;
@@ -805,69 +1012,84 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
805
1012
  }, {
806
1013
  token: string;
807
1014
  }>]>>>;
808
- routing: z.ZodOptional<z.ZodEnum<["orthogonal", "straight", "curved"]>>;
809
- markerEnd: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval"]>>;
810
- markerStart: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval"]>>;
1015
+ routing: z.ZodOptional<z.ZodEnum<["orthogonal", "straight", "curved", "smart"]>>;
1016
+ markerEnd: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval", "one", "many", "zeroOne", "zeroMany"]>>;
1017
+ markerStart: z.ZodOptional<z.ZodEnum<["none", "classic", "classicThin", "open", "block", "diamond", "oval", "one", "many", "zeroOne", "zeroMany"]>>;
1018
+ sourceSide: z.ZodOptional<z.ZodNullable<z.ZodEnum<["top", "right", "bottom", "left"]>>>;
1019
+ targetSide: z.ZodOptional<z.ZodNullable<z.ZodEnum<["top", "right", "bottom", "left"]>>>;
1020
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
811
1021
  }, "strict", z.ZodTypeAny, {
1022
+ data?: Record<string, unknown> | null | undefined;
1023
+ source?: string | undefined;
1024
+ label?: string | undefined;
1025
+ target?: string | undefined;
1026
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
812
1027
  color?: string | {
813
1028
  raw: string;
814
1029
  } | {
815
1030
  token: string;
816
1031
  } | null | undefined;
817
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
1032
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
1033
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1034
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1035
+ sourceSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1036
+ targetSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1037
+ }, {
1038
+ data?: Record<string, unknown> | null | undefined;
818
1039
  source?: string | undefined;
819
1040
  label?: string | undefined;
820
1041
  target?: string | undefined;
821
1042
  semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
822
- routing?: "orthogonal" | "straight" | "curved" | undefined;
823
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
824
- }, {
825
1043
  color?: string | {
826
1044
  raw: string;
827
1045
  } | {
828
1046
  token: string;
829
1047
  } | null | undefined;
830
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
831
- source?: string | undefined;
832
- label?: string | undefined;
833
- target?: string | undefined;
834
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
835
- routing?: "orthogonal" | "straight" | "curved" | undefined;
836
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
1048
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
1049
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1050
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1051
+ sourceSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1052
+ targetSide?: "left" | "right" | "top" | "bottom" | null | undefined;
837
1053
  }>;
838
1054
  }, "strict", z.ZodTypeAny, {
839
1055
  id: string;
840
1056
  op: "updateEdge";
841
1057
  changes: {
1058
+ data?: Record<string, unknown> | null | undefined;
1059
+ source?: string | undefined;
1060
+ label?: string | undefined;
1061
+ target?: string | undefined;
1062
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
842
1063
  color?: string | {
843
1064
  raw: string;
844
1065
  } | {
845
1066
  token: string;
846
1067
  } | null | undefined;
847
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
848
- source?: string | undefined;
849
- label?: string | undefined;
850
- target?: string | undefined;
851
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
852
- routing?: "orthogonal" | "straight" | "curved" | undefined;
853
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
1068
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
1069
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1070
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1071
+ sourceSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1072
+ targetSide?: "left" | "right" | "top" | "bottom" | null | undefined;
854
1073
  };
855
1074
  }, {
856
1075
  id: string;
857
1076
  op: "updateEdge";
858
1077
  changes: {
1078
+ data?: Record<string, unknown> | null | undefined;
1079
+ source?: string | undefined;
1080
+ label?: string | undefined;
1081
+ target?: string | undefined;
1082
+ semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
859
1083
  color?: string | {
860
1084
  raw: string;
861
1085
  } | {
862
1086
  token: string;
863
1087
  } | null | undefined;
864
- markerStart?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
865
- source?: string | undefined;
866
- label?: string | undefined;
867
- target?: string | undefined;
868
- semantic?: "sync" | "async" | "fallback" | "bus" | undefined;
869
- routing?: "orthogonal" | "straight" | "curved" | undefined;
870
- markerEnd?: "none" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | undefined;
1088
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | undefined;
1089
+ markerEnd?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1090
+ markerStart?: "none" | "many" | "classic" | "classicThin" | "open" | "block" | "diamond" | "oval" | "one" | "zeroOne" | "zeroMany" | undefined;
1091
+ sourceSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1092
+ targetSide?: "left" | "right" | "top" | "bottom" | null | undefined;
871
1093
  };
872
1094
  }>, z.ZodObject<{
873
1095
  op: z.ZodLiteral<"removeEdge">;
@@ -887,6 +1109,698 @@ export declare const diagramPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodO
887
1109
  }, {
888
1110
  title: string;
889
1111
  op: "setTitle";
1112
+ }>, z.ZodObject<{
1113
+ op: z.ZodLiteral<"moveNode">;
1114
+ id: z.ZodString;
1115
+ position: z.ZodObject<{
1116
+ x: z.ZodNumber;
1117
+ y: z.ZodNumber;
1118
+ }, "strict", z.ZodTypeAny, {
1119
+ x: number;
1120
+ y: number;
1121
+ }, {
1122
+ x: number;
1123
+ y: number;
1124
+ }>;
1125
+ }, "strict", z.ZodTypeAny, {
1126
+ id: string;
1127
+ position: {
1128
+ x: number;
1129
+ y: number;
1130
+ };
1131
+ op: "moveNode";
1132
+ }, {
1133
+ id: string;
1134
+ position: {
1135
+ x: number;
1136
+ y: number;
1137
+ };
1138
+ op: "moveNode";
1139
+ }>, z.ZodObject<{
1140
+ op: z.ZodLiteral<"reparent">;
1141
+ id: z.ZodString;
1142
+ parent: z.ZodNullable<z.ZodString>;
1143
+ position: z.ZodOptional<z.ZodObject<{
1144
+ x: z.ZodNumber;
1145
+ y: z.ZodNumber;
1146
+ }, "strict", z.ZodTypeAny, {
1147
+ x: number;
1148
+ y: number;
1149
+ }, {
1150
+ x: number;
1151
+ y: number;
1152
+ }>>;
1153
+ }, "strict", z.ZodTypeAny, {
1154
+ id: string;
1155
+ parent: string | null;
1156
+ op: "reparent";
1157
+ position?: {
1158
+ x: number;
1159
+ y: number;
1160
+ } | undefined;
1161
+ }, {
1162
+ id: string;
1163
+ parent: string | null;
1164
+ op: "reparent";
1165
+ position?: {
1166
+ x: number;
1167
+ y: number;
1168
+ } | undefined;
1169
+ }>, z.ZodObject<{
1170
+ op: z.ZodLiteral<"setEdgeRoute">;
1171
+ id: z.ZodString;
1172
+ routing: z.ZodOptional<z.ZodNullable<z.ZodEnum<["orthogonal", "straight", "curved", "smart"]>>>;
1173
+ sourceSide: z.ZodOptional<z.ZodNullable<z.ZodEnum<["top", "right", "bottom", "left"]>>>;
1174
+ targetSide: z.ZodOptional<z.ZodNullable<z.ZodEnum<["top", "right", "bottom", "left"]>>>;
1175
+ waypoints: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1176
+ x: z.ZodNumber;
1177
+ y: z.ZodNumber;
1178
+ }, "strict", z.ZodTypeAny, {
1179
+ x: number;
1180
+ y: number;
1181
+ }, {
1182
+ x: number;
1183
+ y: number;
1184
+ }>, "many">>>;
1185
+ }, "strict", z.ZodTypeAny, {
1186
+ id: string;
1187
+ op: "setEdgeRoute";
1188
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | null | undefined;
1189
+ sourceSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1190
+ targetSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1191
+ waypoints?: {
1192
+ x: number;
1193
+ y: number;
1194
+ }[] | null | undefined;
1195
+ }, {
1196
+ id: string;
1197
+ op: "setEdgeRoute";
1198
+ routing?: "orthogonal" | "straight" | "curved" | "smart" | null | undefined;
1199
+ sourceSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1200
+ targetSide?: "left" | "right" | "top" | "bottom" | null | undefined;
1201
+ waypoints?: {
1202
+ x: number;
1203
+ y: number;
1204
+ }[] | null | undefined;
1205
+ }>, z.ZodObject<{
1206
+ op: z.ZodLiteral<"reorder">;
1207
+ id: z.ZodString;
1208
+ index: z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"front">, z.ZodLiteral<"back">]>;
1209
+ }, "strict", z.ZodTypeAny, {
1210
+ id: string;
1211
+ op: "reorder";
1212
+ index: number | "front" | "back";
1213
+ }, {
1214
+ id: string;
1215
+ op: "reorder";
1216
+ index: number | "front" | "back";
1217
+ }>, z.ZodObject<{
1218
+ op: z.ZodLiteral<"setCanvas">;
1219
+ canvas: z.ZodObject<{
1220
+ background: z.ZodOptional<z.ZodNullable<z.ZodEnum<["grid", "dots", "blank"]>>>;
1221
+ gridSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1222
+ defaultRouting: z.ZodOptional<z.ZodNullable<z.ZodEnum<["orthogonal", "straight", "curved", "smart"]>>>;
1223
+ }, "strict", z.ZodTypeAny, {
1224
+ background?: "grid" | "dots" | "blank" | null | undefined;
1225
+ gridSize?: number | null | undefined;
1226
+ defaultRouting?: "orthogonal" | "straight" | "curved" | "smart" | null | undefined;
1227
+ }, {
1228
+ background?: "grid" | "dots" | "blank" | null | undefined;
1229
+ gridSize?: number | null | undefined;
1230
+ defaultRouting?: "orthogonal" | "straight" | "curved" | "smart" | null | undefined;
1231
+ }>;
1232
+ }, "strict", z.ZodTypeAny, {
1233
+ canvas: {
1234
+ background?: "grid" | "dots" | "blank" | null | undefined;
1235
+ gridSize?: number | null | undefined;
1236
+ defaultRouting?: "orthogonal" | "straight" | "curved" | "smart" | null | undefined;
1237
+ };
1238
+ op: "setCanvas";
1239
+ }, {
1240
+ canvas: {
1241
+ background?: "grid" | "dots" | "blank" | null | undefined;
1242
+ gridSize?: number | null | undefined;
1243
+ defaultRouting?: "orthogonal" | "straight" | "curved" | "smart" | null | undefined;
1244
+ };
1245
+ op: "setCanvas";
1246
+ }>, z.ZodObject<{
1247
+ op: z.ZodLiteral<"group">;
1248
+ ids: z.ZodArray<z.ZodString, "many">;
1249
+ type: z.ZodOptional<z.ZodString>;
1250
+ label: z.ZodOptional<z.ZodString>;
1251
+ id: z.ZodOptional<z.ZodString>;
1252
+ }, "strict", z.ZodTypeAny, {
1253
+ op: "group";
1254
+ ids: string[];
1255
+ type?: string | undefined;
1256
+ id?: string | undefined;
1257
+ label?: string | undefined;
1258
+ }, {
1259
+ op: "group";
1260
+ ids: string[];
1261
+ type?: string | undefined;
1262
+ id?: string | undefined;
1263
+ label?: string | undefined;
1264
+ }>, z.ZodObject<{
1265
+ op: z.ZodLiteral<"ungroup">;
1266
+ id: z.ZodString;
1267
+ }, "strict", z.ZodTypeAny, {
1268
+ id: string;
1269
+ op: "ungroup";
1270
+ }, {
1271
+ id: string;
1272
+ op: "ungroup";
1273
+ }>, z.ZodObject<{
1274
+ op: z.ZodLiteral<"relayout">;
1275
+ scope: z.ZodEnum<["new", "all"]>;
1276
+ direction: z.ZodOptional<z.ZodEnum<["DOWN", "RIGHT", "UP", "LEFT"]>>;
1277
+ }, "strict", z.ZodTypeAny, {
1278
+ scope: "all" | "new";
1279
+ op: "relayout";
1280
+ direction?: "DOWN" | "RIGHT" | "UP" | "LEFT" | undefined;
1281
+ }, {
1282
+ scope: "all" | "new";
1283
+ op: "relayout";
1284
+ direction?: "DOWN" | "RIGHT" | "UP" | "LEFT" | undefined;
1285
+ }>, z.ZodObject<{
1286
+ op: z.ZodLiteral<"addTable">;
1287
+ table: z.ZodObject<{
1288
+ id: z.ZodOptional<z.ZodString>;
1289
+ name: z.ZodString;
1290
+ schema: z.ZodOptional<z.ZodString>;
1291
+ kind: z.ZodOptional<z.ZodEnum<["table", "view", "collection"]>>;
1292
+ columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
1293
+ id: z.ZodOptional<z.ZodString>;
1294
+ name: z.ZodString;
1295
+ dataType: z.ZodOptional<z.ZodString>;
1296
+ nullable: z.ZodOptional<z.ZodBoolean>;
1297
+ primaryKey: z.ZodOptional<z.ZodBoolean>;
1298
+ unique: z.ZodOptional<z.ZodBoolean>;
1299
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1300
+ autoIncrement: z.ZodOptional<z.ZodBoolean>;
1301
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1302
+ }, "strict", z.ZodTypeAny, {
1303
+ name: string;
1304
+ id?: string | undefined;
1305
+ unique?: boolean | undefined;
1306
+ nullable?: boolean | undefined;
1307
+ dataType?: string | undefined;
1308
+ primaryKey?: boolean | undefined;
1309
+ defaultValue?: string | null | undefined;
1310
+ autoIncrement?: boolean | undefined;
1311
+ comment?: string | null | undefined;
1312
+ }, {
1313
+ name: string;
1314
+ id?: string | undefined;
1315
+ unique?: boolean | undefined;
1316
+ nullable?: boolean | undefined;
1317
+ dataType?: string | undefined;
1318
+ primaryKey?: boolean | undefined;
1319
+ defaultValue?: string | null | undefined;
1320
+ autoIncrement?: boolean | undefined;
1321
+ comment?: string | null | undefined;
1322
+ }>, "many">>;
1323
+ comment: z.ZodOptional<z.ZodString>;
1324
+ }, "strict", z.ZodTypeAny, {
1325
+ name: string;
1326
+ id?: string | undefined;
1327
+ schema?: string | undefined;
1328
+ kind?: "collection" | "table" | "view" | undefined;
1329
+ columns?: {
1330
+ name: string;
1331
+ id?: string | undefined;
1332
+ unique?: boolean | undefined;
1333
+ nullable?: boolean | undefined;
1334
+ dataType?: string | undefined;
1335
+ primaryKey?: boolean | undefined;
1336
+ defaultValue?: string | null | undefined;
1337
+ autoIncrement?: boolean | undefined;
1338
+ comment?: string | null | undefined;
1339
+ }[] | undefined;
1340
+ comment?: string | undefined;
1341
+ }, {
1342
+ name: string;
1343
+ id?: string | undefined;
1344
+ schema?: string | undefined;
1345
+ kind?: "collection" | "table" | "view" | undefined;
1346
+ columns?: {
1347
+ name: string;
1348
+ id?: string | undefined;
1349
+ unique?: boolean | undefined;
1350
+ nullable?: boolean | undefined;
1351
+ dataType?: string | undefined;
1352
+ primaryKey?: boolean | undefined;
1353
+ defaultValue?: string | null | undefined;
1354
+ autoIncrement?: boolean | undefined;
1355
+ comment?: string | null | undefined;
1356
+ }[] | undefined;
1357
+ comment?: string | undefined;
1358
+ }>;
1359
+ position: z.ZodOptional<z.ZodObject<{
1360
+ x: z.ZodNumber;
1361
+ y: z.ZodNumber;
1362
+ }, "strict", z.ZodTypeAny, {
1363
+ x: number;
1364
+ y: number;
1365
+ }, {
1366
+ x: number;
1367
+ y: number;
1368
+ }>>;
1369
+ }, "strict", z.ZodTypeAny, {
1370
+ table: {
1371
+ name: string;
1372
+ id?: string | undefined;
1373
+ schema?: string | undefined;
1374
+ kind?: "collection" | "table" | "view" | undefined;
1375
+ columns?: {
1376
+ name: string;
1377
+ id?: string | undefined;
1378
+ unique?: boolean | undefined;
1379
+ nullable?: boolean | undefined;
1380
+ dataType?: string | undefined;
1381
+ primaryKey?: boolean | undefined;
1382
+ defaultValue?: string | null | undefined;
1383
+ autoIncrement?: boolean | undefined;
1384
+ comment?: string | null | undefined;
1385
+ }[] | undefined;
1386
+ comment?: string | undefined;
1387
+ };
1388
+ op: "addTable";
1389
+ position?: {
1390
+ x: number;
1391
+ y: number;
1392
+ } | undefined;
1393
+ }, {
1394
+ table: {
1395
+ name: string;
1396
+ id?: string | undefined;
1397
+ schema?: string | undefined;
1398
+ kind?: "collection" | "table" | "view" | undefined;
1399
+ columns?: {
1400
+ name: string;
1401
+ id?: string | undefined;
1402
+ unique?: boolean | undefined;
1403
+ nullable?: boolean | undefined;
1404
+ dataType?: string | undefined;
1405
+ primaryKey?: boolean | undefined;
1406
+ defaultValue?: string | null | undefined;
1407
+ autoIncrement?: boolean | undefined;
1408
+ comment?: string | null | undefined;
1409
+ }[] | undefined;
1410
+ comment?: string | undefined;
1411
+ };
1412
+ op: "addTable";
1413
+ position?: {
1414
+ x: number;
1415
+ y: number;
1416
+ } | undefined;
1417
+ }>, z.ZodObject<{
1418
+ op: z.ZodLiteral<"renameTable">;
1419
+ table: z.ZodString;
1420
+ name: z.ZodString;
1421
+ schema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1422
+ }, "strict", z.ZodTypeAny, {
1423
+ name: string;
1424
+ table: string;
1425
+ op: "renameTable";
1426
+ schema?: string | null | undefined;
1427
+ }, {
1428
+ name: string;
1429
+ table: string;
1430
+ op: "renameTable";
1431
+ schema?: string | null | undefined;
1432
+ }>, z.ZodObject<{
1433
+ op: z.ZodLiteral<"removeTable">;
1434
+ table: z.ZodString;
1435
+ }, "strict", z.ZodTypeAny, {
1436
+ table: string;
1437
+ op: "removeTable";
1438
+ }, {
1439
+ table: string;
1440
+ op: "removeTable";
1441
+ }>, z.ZodObject<{
1442
+ op: z.ZodLiteral<"setTableComment">;
1443
+ table: z.ZodString;
1444
+ comment: z.ZodNullable<z.ZodString>;
1445
+ }, "strict", z.ZodTypeAny, {
1446
+ comment: string | null;
1447
+ table: string;
1448
+ op: "setTableComment";
1449
+ }, {
1450
+ comment: string | null;
1451
+ table: string;
1452
+ op: "setTableComment";
1453
+ }>, z.ZodObject<{
1454
+ op: z.ZodLiteral<"addColumn">;
1455
+ table: z.ZodString;
1456
+ column: z.ZodObject<{
1457
+ id: z.ZodOptional<z.ZodString>;
1458
+ name: z.ZodString;
1459
+ dataType: z.ZodOptional<z.ZodString>;
1460
+ nullable: z.ZodOptional<z.ZodBoolean>;
1461
+ primaryKey: z.ZodOptional<z.ZodBoolean>;
1462
+ unique: z.ZodOptional<z.ZodBoolean>;
1463
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1464
+ autoIncrement: z.ZodOptional<z.ZodBoolean>;
1465
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1466
+ }, "strict", z.ZodTypeAny, {
1467
+ name: string;
1468
+ id?: string | undefined;
1469
+ unique?: boolean | undefined;
1470
+ nullable?: boolean | undefined;
1471
+ dataType?: string | undefined;
1472
+ primaryKey?: boolean | undefined;
1473
+ defaultValue?: string | null | undefined;
1474
+ autoIncrement?: boolean | undefined;
1475
+ comment?: string | null | undefined;
1476
+ }, {
1477
+ name: string;
1478
+ id?: string | undefined;
1479
+ unique?: boolean | undefined;
1480
+ nullable?: boolean | undefined;
1481
+ dataType?: string | undefined;
1482
+ primaryKey?: boolean | undefined;
1483
+ defaultValue?: string | null | undefined;
1484
+ autoIncrement?: boolean | undefined;
1485
+ comment?: string | null | undefined;
1486
+ }>;
1487
+ after: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1488
+ }, "strict", z.ZodTypeAny, {
1489
+ column: {
1490
+ name: string;
1491
+ id?: string | undefined;
1492
+ unique?: boolean | undefined;
1493
+ nullable?: boolean | undefined;
1494
+ dataType?: string | undefined;
1495
+ primaryKey?: boolean | undefined;
1496
+ defaultValue?: string | null | undefined;
1497
+ autoIncrement?: boolean | undefined;
1498
+ comment?: string | null | undefined;
1499
+ };
1500
+ table: string;
1501
+ op: "addColumn";
1502
+ after?: string | null | undefined;
1503
+ }, {
1504
+ column: {
1505
+ name: string;
1506
+ id?: string | undefined;
1507
+ unique?: boolean | undefined;
1508
+ nullable?: boolean | undefined;
1509
+ dataType?: string | undefined;
1510
+ primaryKey?: boolean | undefined;
1511
+ defaultValue?: string | null | undefined;
1512
+ autoIncrement?: boolean | undefined;
1513
+ comment?: string | null | undefined;
1514
+ };
1515
+ table: string;
1516
+ op: "addColumn";
1517
+ after?: string | null | undefined;
1518
+ }>, z.ZodObject<{
1519
+ op: z.ZodLiteral<"alterColumn">;
1520
+ table: z.ZodString;
1521
+ column: z.ZodString;
1522
+ changes: z.ZodObject<{
1523
+ id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1524
+ name: z.ZodOptional<z.ZodString>;
1525
+ dataType: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1526
+ nullable: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1527
+ primaryKey: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1528
+ unique: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1529
+ defaultValue: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
1530
+ autoIncrement: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1531
+ comment: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
1532
+ }, "strict", z.ZodTypeAny, {
1533
+ id?: string | undefined;
1534
+ name?: string | undefined;
1535
+ unique?: boolean | undefined;
1536
+ nullable?: boolean | undefined;
1537
+ dataType?: string | undefined;
1538
+ primaryKey?: boolean | undefined;
1539
+ defaultValue?: string | null | undefined;
1540
+ autoIncrement?: boolean | undefined;
1541
+ comment?: string | null | undefined;
1542
+ }, {
1543
+ id?: string | undefined;
1544
+ name?: string | undefined;
1545
+ unique?: boolean | undefined;
1546
+ nullable?: boolean | undefined;
1547
+ dataType?: string | undefined;
1548
+ primaryKey?: boolean | undefined;
1549
+ defaultValue?: string | null | undefined;
1550
+ autoIncrement?: boolean | undefined;
1551
+ comment?: string | null | undefined;
1552
+ }>;
1553
+ }, "strict", z.ZodTypeAny, {
1554
+ column: string;
1555
+ table: string;
1556
+ op: "alterColumn";
1557
+ changes: {
1558
+ id?: string | undefined;
1559
+ name?: string | undefined;
1560
+ unique?: boolean | undefined;
1561
+ nullable?: boolean | undefined;
1562
+ dataType?: string | undefined;
1563
+ primaryKey?: boolean | undefined;
1564
+ defaultValue?: string | null | undefined;
1565
+ autoIncrement?: boolean | undefined;
1566
+ comment?: string | null | undefined;
1567
+ };
1568
+ }, {
1569
+ column: string;
1570
+ table: string;
1571
+ op: "alterColumn";
1572
+ changes: {
1573
+ id?: string | undefined;
1574
+ name?: string | undefined;
1575
+ unique?: boolean | undefined;
1576
+ nullable?: boolean | undefined;
1577
+ dataType?: string | undefined;
1578
+ primaryKey?: boolean | undefined;
1579
+ defaultValue?: string | null | undefined;
1580
+ autoIncrement?: boolean | undefined;
1581
+ comment?: string | null | undefined;
1582
+ };
1583
+ }>, z.ZodObject<{
1584
+ op: z.ZodLiteral<"removeColumn">;
1585
+ table: z.ZodString;
1586
+ column: z.ZodString;
1587
+ }, "strict", z.ZodTypeAny, {
1588
+ column: string;
1589
+ table: string;
1590
+ op: "removeColumn";
1591
+ }, {
1592
+ column: string;
1593
+ table: string;
1594
+ op: "removeColumn";
1595
+ }>, z.ZodObject<{
1596
+ op: z.ZodLiteral<"setPrimaryKey">;
1597
+ table: z.ZodString;
1598
+ columns: z.ZodArray<z.ZodString, "many">;
1599
+ }, "strict", z.ZodTypeAny, {
1600
+ columns: string[];
1601
+ table: string;
1602
+ op: "setPrimaryKey";
1603
+ }, {
1604
+ columns: string[];
1605
+ table: string;
1606
+ op: "setPrimaryKey";
1607
+ }>, z.ZodObject<{
1608
+ op: z.ZodLiteral<"addRelationship">;
1609
+ id: z.ZodOptional<z.ZodString>;
1610
+ source: z.ZodUnion<[z.ZodString, z.ZodObject<{
1611
+ table: z.ZodString;
1612
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1613
+ column: z.ZodOptional<z.ZodString>;
1614
+ }, "strict", z.ZodTypeAny, {
1615
+ table: string;
1616
+ columns?: string[] | undefined;
1617
+ column?: string | undefined;
1618
+ }, {
1619
+ table: string;
1620
+ columns?: string[] | undefined;
1621
+ column?: string | undefined;
1622
+ }>]>;
1623
+ target: z.ZodUnion<[z.ZodString, z.ZodObject<{
1624
+ table: z.ZodString;
1625
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1626
+ column: z.ZodOptional<z.ZodString>;
1627
+ }, "strict", z.ZodTypeAny, {
1628
+ table: string;
1629
+ columns?: string[] | undefined;
1630
+ column?: string | undefined;
1631
+ }, {
1632
+ table: string;
1633
+ columns?: string[] | undefined;
1634
+ column?: string | undefined;
1635
+ }>]>;
1636
+ cardinality: z.ZodOptional<z.ZodEnum<["1:1", "1:N", "N:1", "N:M"]>>;
1637
+ kind: z.ZodOptional<z.ZodEnum<["foreignKey", "manual"]>>;
1638
+ name: z.ZodOptional<z.ZodString>;
1639
+ label: z.ZodOptional<z.ZodString>;
1640
+ }, "strict", z.ZodTypeAny, {
1641
+ source: string | {
1642
+ table: string;
1643
+ columns?: string[] | undefined;
1644
+ column?: string | undefined;
1645
+ };
1646
+ target: string | {
1647
+ table: string;
1648
+ columns?: string[] | undefined;
1649
+ column?: string | undefined;
1650
+ };
1651
+ op: "addRelationship";
1652
+ id?: string | undefined;
1653
+ name?: string | undefined;
1654
+ kind?: "foreignKey" | "manual" | undefined;
1655
+ label?: string | undefined;
1656
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
1657
+ }, {
1658
+ source: string | {
1659
+ table: string;
1660
+ columns?: string[] | undefined;
1661
+ column?: string | undefined;
1662
+ };
1663
+ target: string | {
1664
+ table: string;
1665
+ columns?: string[] | undefined;
1666
+ column?: string | undefined;
1667
+ };
1668
+ op: "addRelationship";
1669
+ id?: string | undefined;
1670
+ name?: string | undefined;
1671
+ kind?: "foreignKey" | "manual" | undefined;
1672
+ label?: string | undefined;
1673
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
1674
+ }>, z.ZodObject<{
1675
+ op: z.ZodLiteral<"updateRelationship">;
1676
+ relationship: z.ZodString;
1677
+ changes: z.ZodObject<{
1678
+ source: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
1679
+ table: z.ZodString;
1680
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1681
+ column: z.ZodOptional<z.ZodString>;
1682
+ }, "strict", z.ZodTypeAny, {
1683
+ table: string;
1684
+ columns?: string[] | undefined;
1685
+ column?: string | undefined;
1686
+ }, {
1687
+ table: string;
1688
+ columns?: string[] | undefined;
1689
+ column?: string | undefined;
1690
+ }>]>>;
1691
+ target: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
1692
+ table: z.ZodString;
1693
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1694
+ column: z.ZodOptional<z.ZodString>;
1695
+ }, "strict", z.ZodTypeAny, {
1696
+ table: string;
1697
+ columns?: string[] | undefined;
1698
+ column?: string | undefined;
1699
+ }, {
1700
+ table: string;
1701
+ columns?: string[] | undefined;
1702
+ column?: string | undefined;
1703
+ }>]>>;
1704
+ cardinality: z.ZodOptional<z.ZodEnum<["1:1", "1:N", "N:1", "N:M"]>>;
1705
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1706
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1707
+ kind: z.ZodOptional<z.ZodEnum<["foreignKey", "manual"]>>;
1708
+ }, "strict", z.ZodTypeAny, {
1709
+ name?: string | null | undefined;
1710
+ source?: string | {
1711
+ table: string;
1712
+ columns?: string[] | undefined;
1713
+ column?: string | undefined;
1714
+ } | undefined;
1715
+ kind?: "foreignKey" | "manual" | undefined;
1716
+ label?: string | null | undefined;
1717
+ target?: string | {
1718
+ table: string;
1719
+ columns?: string[] | undefined;
1720
+ column?: string | undefined;
1721
+ } | undefined;
1722
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
1723
+ }, {
1724
+ name?: string | null | undefined;
1725
+ source?: string | {
1726
+ table: string;
1727
+ columns?: string[] | undefined;
1728
+ column?: string | undefined;
1729
+ } | undefined;
1730
+ kind?: "foreignKey" | "manual" | undefined;
1731
+ label?: string | null | undefined;
1732
+ target?: string | {
1733
+ table: string;
1734
+ columns?: string[] | undefined;
1735
+ column?: string | undefined;
1736
+ } | undefined;
1737
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
1738
+ }>;
1739
+ }, "strict", z.ZodTypeAny, {
1740
+ relationship: string;
1741
+ op: "updateRelationship";
1742
+ changes: {
1743
+ name?: string | null | undefined;
1744
+ source?: string | {
1745
+ table: string;
1746
+ columns?: string[] | undefined;
1747
+ column?: string | undefined;
1748
+ } | undefined;
1749
+ kind?: "foreignKey" | "manual" | undefined;
1750
+ label?: string | null | undefined;
1751
+ target?: string | {
1752
+ table: string;
1753
+ columns?: string[] | undefined;
1754
+ column?: string | undefined;
1755
+ } | undefined;
1756
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
1757
+ };
1758
+ }, {
1759
+ relationship: string;
1760
+ op: "updateRelationship";
1761
+ changes: {
1762
+ name?: string | null | undefined;
1763
+ source?: string | {
1764
+ table: string;
1765
+ columns?: string[] | undefined;
1766
+ column?: string | undefined;
1767
+ } | undefined;
1768
+ kind?: "foreignKey" | "manual" | undefined;
1769
+ label?: string | null | undefined;
1770
+ target?: string | {
1771
+ table: string;
1772
+ columns?: string[] | undefined;
1773
+ column?: string | undefined;
1774
+ } | undefined;
1775
+ cardinality?: "1:1" | "1:N" | "N:1" | "N:M" | undefined;
1776
+ };
1777
+ }>, z.ZodObject<{
1778
+ op: z.ZodLiteral<"removeRelationship">;
1779
+ relationship: z.ZodString;
1780
+ }, "strict", z.ZodTypeAny, {
1781
+ relationship: string;
1782
+ op: "removeRelationship";
1783
+ }, {
1784
+ relationship: string;
1785
+ op: "removeRelationship";
1786
+ }>, z.ZodObject<{
1787
+ op: z.ZodLiteral<"hideTable">;
1788
+ table: z.ZodString;
1789
+ }, "strict", z.ZodTypeAny, {
1790
+ table: string;
1791
+ op: "hideTable";
1792
+ }, {
1793
+ table: string;
1794
+ op: "hideTable";
1795
+ }>, z.ZodObject<{
1796
+ op: z.ZodLiteral<"showTable">;
1797
+ table: z.ZodString;
1798
+ }, "strict", z.ZodTypeAny, {
1799
+ table: string;
1800
+ op: "showTable";
1801
+ }, {
1802
+ table: string;
1803
+ op: "showTable";
890
1804
  }>]>;
891
1805
  export type DiagramPatchOp = z.infer<typeof diagramPatchOpSchema>;
892
1806
  export interface PatchResult {
@@ -896,6 +1810,11 @@ export interface PatchResult {
896
1810
  removedEdgeIds: string[];
897
1811
  reroutedEdgeIds: string[];
898
1812
  warnings: string[];
1813
+ relayout?: {
1814
+ scope: "new" | "all";
1815
+ direction?: LayoutDirection;
1816
+ };
1817
+ idMap: Record<string, string>;
899
1818
  }
900
1819
  export declare const applyDiagramPatch: (doc: DiagramDocument, ops: DiagramPatchOp[], options?: {
901
1820
  strictTypes?: boolean;