@anchrd/intel-contract 0.2.2 → 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.
@@ -23,12 +23,6 @@ export declare const KnowledgeNodeKind: z.ZodEnum<{
23
23
  table: "table";
24
24
  }>;
25
25
  export type KnowledgeNodeKind = z.infer<typeof KnowledgeNodeKind>;
26
- export declare const ContextPolicy: z.ZodEnum<{
27
- pinned: "pinned";
28
- relevant: "relevant";
29
- explicit: "explicit";
30
- }>;
31
- export type ContextPolicy = z.infer<typeof ContextPolicy>;
32
26
  export declare const ResourceVerb: z.ZodEnum<{
33
27
  read: "read";
34
28
  write: "write";
@@ -57,11 +51,6 @@ export declare const KnowledgeNode: z.ZodObject<{
57
51
  }>;
58
52
  title: z.ZodString;
59
53
  description: z.ZodNullable<z.ZodString>;
60
- contextPolicy: z.ZodEnum<{
61
- pinned: "pinned";
62
- relevant: "relevant";
63
- explicit: "explicit";
64
- }>;
65
54
  ownerId: z.ZodString;
66
55
  currentVersionId: z.ZodNullable<z.ZodString>;
67
56
  createdAt: z.ZodISODateTime;
@@ -104,11 +93,6 @@ export declare const CreateKnowledgeNodeInput: z.ZodObject<{
104
93
  }>;
105
94
  title: z.ZodString;
106
95
  description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
107
- contextPolicy: z.ZodDefault<z.ZodEnum<{
108
- pinned: "pinned";
109
- relevant: "relevant";
110
- explicit: "explicit";
111
- }>>;
112
96
  idempotencyKey: z.ZodString;
113
97
  }, z.core.$strict>;
114
98
  export type CreateKnowledgeNodeInput = z.infer<typeof CreateKnowledgeNodeInput>;
@@ -133,11 +117,6 @@ export declare const UpdateKnowledgeNodeInput: z.ZodObject<{
133
117
  baseUpdatedAt: z.ZodISODateTime;
134
118
  title: z.ZodOptional<z.ZodString>;
135
119
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
- contextPolicy: z.ZodOptional<z.ZodEnum<{
137
- pinned: "pinned";
138
- relevant: "relevant";
139
- explicit: "explicit";
140
- }>>;
141
120
  parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
121
  idempotencyKey: z.ZodString;
143
122
  }, z.core.$strict>;
@@ -161,17 +140,13 @@ export declare const KnowledgeNodeList: z.ZodObject<{
161
140
  }>;
162
141
  title: z.ZodString;
163
142
  description: z.ZodNullable<z.ZodString>;
164
- contextPolicy: z.ZodEnum<{
165
- pinned: "pinned";
166
- relevant: "relevant";
167
- explicit: "explicit";
168
- }>;
169
143
  ownerId: z.ZodString;
170
144
  currentVersionId: z.ZodNullable<z.ZodString>;
171
145
  createdAt: z.ZodISODateTime;
172
146
  updatedAt: z.ZodISODateTime;
173
147
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
174
148
  }, z.core.$strict>>;
149
+ withChildren: z.ZodDefault<z.ZodArray<z.ZodString>>;
175
150
  }, z.core.$strict>;
176
151
  export type KnowledgeNodeList = z.infer<typeof KnowledgeNodeList>;
177
152
  export declare const KnowledgeVersionList: z.ZodObject<{
@@ -200,11 +175,6 @@ export declare const KnowledgeDocument: z.ZodObject<{
200
175
  }>;
201
176
  title: z.ZodString;
202
177
  description: z.ZodNullable<z.ZodString>;
203
- contextPolicy: z.ZodEnum<{
204
- pinned: "pinned";
205
- relevant: "relevant";
206
- explicit: "explicit";
207
- }>;
208
178
  ownerId: z.ZodString;
209
179
  currentVersionId: z.ZodNullable<z.ZodString>;
210
180
  createdAt: z.ZodISODateTime;
@@ -237,11 +207,6 @@ export declare const KnowledgeAttachment: z.ZodObject<{
237
207
  }>;
238
208
  title: z.ZodString;
239
209
  description: z.ZodNullable<z.ZodString>;
240
- contextPolicy: z.ZodEnum<{
241
- pinned: "pinned";
242
- relevant: "relevant";
243
- explicit: "explicit";
244
- }>;
245
210
  ownerId: z.ZodString;
246
211
  currentVersionId: z.ZodNullable<z.ZodString>;
247
212
  createdAt: z.ZodISODateTime;
@@ -294,11 +259,6 @@ export declare const KnowledgeTable: z.ZodObject<{
294
259
  }>;
295
260
  title: z.ZodString;
296
261
  description: z.ZodNullable<z.ZodString>;
297
- contextPolicy: z.ZodEnum<{
298
- pinned: "pinned";
299
- relevant: "relevant";
300
- explicit: "explicit";
301
- }>;
302
262
  ownerId: z.ZodString;
303
263
  currentVersionId: z.ZodNullable<z.ZodString>;
304
264
  createdAt: z.ZodISODateTime;
@@ -322,11 +282,6 @@ export declare const AppendKnowledgeTableRowsResult: z.ZodObject<{
322
282
  }>;
323
283
  title: z.ZodString;
324
284
  description: z.ZodNullable<z.ZodString>;
325
- contextPolicy: z.ZodEnum<{
326
- pinned: "pinned";
327
- relevant: "relevant";
328
- explicit: "explicit";
329
- }>;
330
285
  ownerId: z.ZodString;
331
286
  currentVersionId: z.ZodNullable<z.ZodString>;
332
287
  createdAt: z.ZodISODateTime;
@@ -432,11 +387,6 @@ export declare const KnowledgeGraph: z.ZodObject<{
432
387
  }>;
433
388
  title: z.ZodString;
434
389
  description: z.ZodNullable<z.ZodString>;
435
- contextPolicy: z.ZodEnum<{
436
- pinned: "pinned";
437
- relevant: "relevant";
438
- explicit: "explicit";
439
- }>;
440
390
  ownerId: z.ZodString;
441
391
  currentVersionId: z.ZodNullable<z.ZodString>;
442
392
  createdAt: z.ZodISODateTime;
@@ -699,9 +649,9 @@ export declare const FlowPosition: z.ZodObject<{
699
649
  y: z.ZodNumber;
700
650
  }, z.core.$strict>;
701
651
  export declare const SubflowVersionMode: z.ZodEnum<{
702
- pinned: "pinned";
703
652
  latest: "latest";
704
653
  follows: "follows";
654
+ pinned: "pinned";
705
655
  }>;
706
656
  export type SubflowVersionMode = z.infer<typeof SubflowVersionMode>;
707
657
  export declare const SubflowVersion: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -713,6 +663,24 @@ export declare const SubflowVersion: z.ZodDiscriminatedUnion<[z.ZodObject<{
713
663
  versionId: z.ZodString;
714
664
  }, z.core.$strict>], "mode">;
715
665
  export type SubflowVersion = z.infer<typeof SubflowVersion>;
666
+ export declare const FlowNodeLayer: z.ZodEnum<{
667
+ marker: "marker";
668
+ step: "step";
669
+ link: "link";
670
+ }>;
671
+ export type FlowNodeLayer = z.infer<typeof FlowNodeLayer>;
672
+ export declare const flowNodeLayer: {
673
+ readonly trigger: "marker";
674
+ readonly output: "marker";
675
+ readonly instruction: "step";
676
+ readonly condition: "step";
677
+ readonly subflow: "step";
678
+ readonly folder: "link";
679
+ readonly document: "link";
680
+ readonly upload: "link";
681
+ readonly table: "link";
682
+ readonly tool: "link";
683
+ };
716
684
  export declare const FlowNode: z.ZodDiscriminatedUnion<[z.ZodObject<{
717
685
  kind: z.ZodLiteral<"trigger">;
718
686
  configuration: z.ZodObject<{
@@ -736,14 +704,9 @@ export declare const FlowNode: z.ZodDiscriminatedUnion<[z.ZodObject<{
736
704
  }, z.core.$strict>;
737
705
  label: z.ZodString;
738
706
  }, z.core.$strict>, z.ZodObject<{
739
- kind: z.ZodLiteral<"knowledge">;
707
+ kind: z.ZodLiteral<"folder">;
740
708
  configuration: z.ZodObject<{
741
- resourceIds: z.ZodArray<z.ZodString>;
742
- mode: z.ZodEnum<{
743
- relevant: "relevant";
744
- full: "full";
745
- }>;
746
- query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
709
+ resourceId: z.ZodString;
747
710
  }, z.core.$strict>;
748
711
  id: z.ZodString;
749
712
  position: z.ZodObject<{
@@ -752,11 +715,9 @@ export declare const FlowNode: z.ZodDiscriminatedUnion<[z.ZodObject<{
752
715
  }, z.core.$strict>;
753
716
  label: z.ZodString;
754
717
  }, z.core.$strict>, z.ZodObject<{
755
- kind: z.ZodLiteral<"tool">;
718
+ kind: z.ZodLiteral<"document">;
756
719
  configuration: z.ZodObject<{
757
- toolName: z.ZodString;
758
- fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
759
- arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
720
+ resourceId: z.ZodString;
760
721
  }, z.core.$strict>;
761
722
  id: z.ZodString;
762
723
  position: z.ZodObject<{
@@ -765,10 +726,9 @@ export declare const FlowNode: z.ZodDiscriminatedUnion<[z.ZodObject<{
765
726
  }, z.core.$strict>;
766
727
  label: z.ZodString;
767
728
  }, z.core.$strict>, z.ZodObject<{
768
- kind: z.ZodLiteral<"condition">;
729
+ kind: z.ZodLiteral<"upload">;
769
730
  configuration: z.ZodObject<{
770
- mode: z.ZodLiteral<"semantic">;
771
- instruction: z.ZodString;
731
+ resourceId: z.ZodString;
772
732
  }, z.core.$strict>;
773
733
  id: z.ZodString;
774
734
  position: z.ZodObject<{
@@ -777,10 +737,34 @@ export declare const FlowNode: z.ZodDiscriminatedUnion<[z.ZodObject<{
777
737
  }, z.core.$strict>;
778
738
  label: z.ZodString;
779
739
  }, z.core.$strict>, z.ZodObject<{
780
- kind: z.ZodLiteral<"approval">;
740
+ kind: z.ZodLiteral<"table">;
781
741
  configuration: z.ZodObject<{
782
- prompt: z.ZodString;
783
- timeout: z.ZodString;
742
+ resourceId: z.ZodString;
743
+ }, z.core.$strict>;
744
+ id: z.ZodString;
745
+ position: z.ZodObject<{
746
+ x: z.ZodNumber;
747
+ y: z.ZodNumber;
748
+ }, z.core.$strict>;
749
+ label: z.ZodString;
750
+ }, z.core.$strict>, z.ZodObject<{
751
+ kind: z.ZodLiteral<"tool">;
752
+ configuration: z.ZodObject<{
753
+ toolName: z.ZodString;
754
+ fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
755
+ arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
756
+ }, z.core.$strict>;
757
+ id: z.ZodString;
758
+ position: z.ZodObject<{
759
+ x: z.ZodNumber;
760
+ y: z.ZodNumber;
761
+ }, z.core.$strict>;
762
+ label: z.ZodString;
763
+ }, z.core.$strict>, z.ZodObject<{
764
+ kind: z.ZodLiteral<"condition">;
765
+ configuration: z.ZodObject<{
766
+ mode: z.ZodLiteral<"semantic">;
767
+ instruction: z.ZodString;
784
768
  }, z.core.$strict>;
785
769
  id: z.ZodString;
786
770
  position: z.ZodObject<{
@@ -809,9 +793,7 @@ export declare const FlowNode: z.ZodDiscriminatedUnion<[z.ZodObject<{
809
793
  label: z.ZodString;
810
794
  }, z.core.$strict>, z.ZodObject<{
811
795
  kind: z.ZodLiteral<"output">;
812
- configuration: z.ZodObject<{
813
- template: z.ZodDefault<z.ZodString>;
814
- }, z.core.$strict>;
796
+ configuration: z.ZodObject<{}, z.core.$strict>;
815
797
  id: z.ZodString;
816
798
  position: z.ZodObject<{
817
799
  x: z.ZodNumber;
@@ -861,14 +843,9 @@ export declare const FlowGraph: z.ZodObject<{
861
843
  }, z.core.$strict>;
862
844
  label: z.ZodString;
863
845
  }, z.core.$strict>, z.ZodObject<{
864
- kind: z.ZodLiteral<"knowledge">;
846
+ kind: z.ZodLiteral<"folder">;
865
847
  configuration: z.ZodObject<{
866
- resourceIds: z.ZodArray<z.ZodString>;
867
- mode: z.ZodEnum<{
868
- relevant: "relevant";
869
- full: "full";
870
- }>;
871
- query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
848
+ resourceId: z.ZodString;
872
849
  }, z.core.$strict>;
873
850
  id: z.ZodString;
874
851
  position: z.ZodObject<{
@@ -877,11 +854,9 @@ export declare const FlowGraph: z.ZodObject<{
877
854
  }, z.core.$strict>;
878
855
  label: z.ZodString;
879
856
  }, z.core.$strict>, z.ZodObject<{
880
- kind: z.ZodLiteral<"tool">;
857
+ kind: z.ZodLiteral<"document">;
881
858
  configuration: z.ZodObject<{
882
- toolName: z.ZodString;
883
- fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
884
- arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
859
+ resourceId: z.ZodString;
885
860
  }, z.core.$strict>;
886
861
  id: z.ZodString;
887
862
  position: z.ZodObject<{
@@ -890,10 +865,9 @@ export declare const FlowGraph: z.ZodObject<{
890
865
  }, z.core.$strict>;
891
866
  label: z.ZodString;
892
867
  }, z.core.$strict>, z.ZodObject<{
893
- kind: z.ZodLiteral<"condition">;
868
+ kind: z.ZodLiteral<"upload">;
894
869
  configuration: z.ZodObject<{
895
- mode: z.ZodLiteral<"semantic">;
896
- instruction: z.ZodString;
870
+ resourceId: z.ZodString;
897
871
  }, z.core.$strict>;
898
872
  id: z.ZodString;
899
873
  position: z.ZodObject<{
@@ -902,10 +876,34 @@ export declare const FlowGraph: z.ZodObject<{
902
876
  }, z.core.$strict>;
903
877
  label: z.ZodString;
904
878
  }, z.core.$strict>, z.ZodObject<{
905
- kind: z.ZodLiteral<"approval">;
879
+ kind: z.ZodLiteral<"table">;
906
880
  configuration: z.ZodObject<{
907
- prompt: z.ZodString;
908
- timeout: z.ZodString;
881
+ resourceId: z.ZodString;
882
+ }, z.core.$strict>;
883
+ id: z.ZodString;
884
+ position: z.ZodObject<{
885
+ x: z.ZodNumber;
886
+ y: z.ZodNumber;
887
+ }, z.core.$strict>;
888
+ label: z.ZodString;
889
+ }, z.core.$strict>, z.ZodObject<{
890
+ kind: z.ZodLiteral<"tool">;
891
+ configuration: z.ZodObject<{
892
+ toolName: z.ZodString;
893
+ fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
894
+ arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
895
+ }, z.core.$strict>;
896
+ id: z.ZodString;
897
+ position: z.ZodObject<{
898
+ x: z.ZodNumber;
899
+ y: z.ZodNumber;
900
+ }, z.core.$strict>;
901
+ label: z.ZodString;
902
+ }, z.core.$strict>, z.ZodObject<{
903
+ kind: z.ZodLiteral<"condition">;
904
+ configuration: z.ZodObject<{
905
+ mode: z.ZodLiteral<"semantic">;
906
+ instruction: z.ZodString;
909
907
  }, z.core.$strict>;
910
908
  id: z.ZodString;
911
909
  position: z.ZodObject<{
@@ -934,9 +932,7 @@ export declare const FlowGraph: z.ZodObject<{
934
932
  label: z.ZodString;
935
933
  }, z.core.$strict>, z.ZodObject<{
936
934
  kind: z.ZodLiteral<"output">;
937
- configuration: z.ZodObject<{
938
- template: z.ZodDefault<z.ZodString>;
939
- }, z.core.$strict>;
935
+ configuration: z.ZodObject<{}, z.core.$strict>;
940
936
  id: z.ZodString;
941
937
  position: z.ZodObject<{
942
938
  x: z.ZodNumber;
@@ -998,14 +994,9 @@ export declare const FlowVersion: z.ZodObject<{
998
994
  }, z.core.$strict>;
999
995
  label: z.ZodString;
1000
996
  }, z.core.$strict>, z.ZodObject<{
1001
- kind: z.ZodLiteral<"knowledge">;
997
+ kind: z.ZodLiteral<"folder">;
1002
998
  configuration: z.ZodObject<{
1003
- resourceIds: z.ZodArray<z.ZodString>;
1004
- mode: z.ZodEnum<{
1005
- relevant: "relevant";
1006
- full: "full";
1007
- }>;
1008
- query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
999
+ resourceId: z.ZodString;
1009
1000
  }, z.core.$strict>;
1010
1001
  id: z.ZodString;
1011
1002
  position: z.ZodObject<{
@@ -1014,11 +1005,9 @@ export declare const FlowVersion: z.ZodObject<{
1014
1005
  }, z.core.$strict>;
1015
1006
  label: z.ZodString;
1016
1007
  }, z.core.$strict>, z.ZodObject<{
1017
- kind: z.ZodLiteral<"tool">;
1008
+ kind: z.ZodLiteral<"document">;
1018
1009
  configuration: z.ZodObject<{
1019
- toolName: z.ZodString;
1020
- fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1021
- arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1010
+ resourceId: z.ZodString;
1022
1011
  }, z.core.$strict>;
1023
1012
  id: z.ZodString;
1024
1013
  position: z.ZodObject<{
@@ -1027,10 +1016,9 @@ export declare const FlowVersion: z.ZodObject<{
1027
1016
  }, z.core.$strict>;
1028
1017
  label: z.ZodString;
1029
1018
  }, z.core.$strict>, z.ZodObject<{
1030
- kind: z.ZodLiteral<"condition">;
1019
+ kind: z.ZodLiteral<"upload">;
1031
1020
  configuration: z.ZodObject<{
1032
- mode: z.ZodLiteral<"semantic">;
1033
- instruction: z.ZodString;
1021
+ resourceId: z.ZodString;
1034
1022
  }, z.core.$strict>;
1035
1023
  id: z.ZodString;
1036
1024
  position: z.ZodObject<{
@@ -1039,10 +1027,34 @@ export declare const FlowVersion: z.ZodObject<{
1039
1027
  }, z.core.$strict>;
1040
1028
  label: z.ZodString;
1041
1029
  }, z.core.$strict>, z.ZodObject<{
1042
- kind: z.ZodLiteral<"approval">;
1030
+ kind: z.ZodLiteral<"table">;
1043
1031
  configuration: z.ZodObject<{
1044
- prompt: z.ZodString;
1045
- timeout: z.ZodString;
1032
+ resourceId: z.ZodString;
1033
+ }, z.core.$strict>;
1034
+ id: z.ZodString;
1035
+ position: z.ZodObject<{
1036
+ x: z.ZodNumber;
1037
+ y: z.ZodNumber;
1038
+ }, z.core.$strict>;
1039
+ label: z.ZodString;
1040
+ }, z.core.$strict>, z.ZodObject<{
1041
+ kind: z.ZodLiteral<"tool">;
1042
+ configuration: z.ZodObject<{
1043
+ toolName: z.ZodString;
1044
+ fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1045
+ arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1046
+ }, z.core.$strict>;
1047
+ id: z.ZodString;
1048
+ position: z.ZodObject<{
1049
+ x: z.ZodNumber;
1050
+ y: z.ZodNumber;
1051
+ }, z.core.$strict>;
1052
+ label: z.ZodString;
1053
+ }, z.core.$strict>, z.ZodObject<{
1054
+ kind: z.ZodLiteral<"condition">;
1055
+ configuration: z.ZodObject<{
1056
+ mode: z.ZodLiteral<"semantic">;
1057
+ instruction: z.ZodString;
1046
1058
  }, z.core.$strict>;
1047
1059
  id: z.ZodString;
1048
1060
  position: z.ZodObject<{
@@ -1071,9 +1083,7 @@ export declare const FlowVersion: z.ZodObject<{
1071
1083
  label: z.ZodString;
1072
1084
  }, z.core.$strict>, z.ZodObject<{
1073
1085
  kind: z.ZodLiteral<"output">;
1074
- configuration: z.ZodObject<{
1075
- template: z.ZodDefault<z.ZodString>;
1076
- }, z.core.$strict>;
1086
+ configuration: z.ZodObject<{}, z.core.$strict>;
1077
1087
  id: z.ZodString;
1078
1088
  position: z.ZodObject<{
1079
1089
  x: z.ZodNumber;
@@ -1138,14 +1148,9 @@ export declare const FlowDocument: z.ZodObject<{
1138
1148
  }, z.core.$strict>;
1139
1149
  label: z.ZodString;
1140
1150
  }, z.core.$strict>, z.ZodObject<{
1141
- kind: z.ZodLiteral<"knowledge">;
1151
+ kind: z.ZodLiteral<"folder">;
1142
1152
  configuration: z.ZodObject<{
1143
- resourceIds: z.ZodArray<z.ZodString>;
1144
- mode: z.ZodEnum<{
1145
- relevant: "relevant";
1146
- full: "full";
1147
- }>;
1148
- query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1153
+ resourceId: z.ZodString;
1149
1154
  }, z.core.$strict>;
1150
1155
  id: z.ZodString;
1151
1156
  position: z.ZodObject<{
@@ -1154,11 +1159,9 @@ export declare const FlowDocument: z.ZodObject<{
1154
1159
  }, z.core.$strict>;
1155
1160
  label: z.ZodString;
1156
1161
  }, z.core.$strict>, z.ZodObject<{
1157
- kind: z.ZodLiteral<"tool">;
1162
+ kind: z.ZodLiteral<"document">;
1158
1163
  configuration: z.ZodObject<{
1159
- toolName: z.ZodString;
1160
- fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1161
- arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1164
+ resourceId: z.ZodString;
1162
1165
  }, z.core.$strict>;
1163
1166
  id: z.ZodString;
1164
1167
  position: z.ZodObject<{
@@ -1167,10 +1170,9 @@ export declare const FlowDocument: z.ZodObject<{
1167
1170
  }, z.core.$strict>;
1168
1171
  label: z.ZodString;
1169
1172
  }, z.core.$strict>, z.ZodObject<{
1170
- kind: z.ZodLiteral<"condition">;
1173
+ kind: z.ZodLiteral<"upload">;
1171
1174
  configuration: z.ZodObject<{
1172
- mode: z.ZodLiteral<"semantic">;
1173
- instruction: z.ZodString;
1175
+ resourceId: z.ZodString;
1174
1176
  }, z.core.$strict>;
1175
1177
  id: z.ZodString;
1176
1178
  position: z.ZodObject<{
@@ -1179,10 +1181,34 @@ export declare const FlowDocument: z.ZodObject<{
1179
1181
  }, z.core.$strict>;
1180
1182
  label: z.ZodString;
1181
1183
  }, z.core.$strict>, z.ZodObject<{
1182
- kind: z.ZodLiteral<"approval">;
1184
+ kind: z.ZodLiteral<"table">;
1183
1185
  configuration: z.ZodObject<{
1184
- prompt: z.ZodString;
1185
- timeout: z.ZodString;
1186
+ resourceId: z.ZodString;
1187
+ }, z.core.$strict>;
1188
+ id: z.ZodString;
1189
+ position: z.ZodObject<{
1190
+ x: z.ZodNumber;
1191
+ y: z.ZodNumber;
1192
+ }, z.core.$strict>;
1193
+ label: z.ZodString;
1194
+ }, z.core.$strict>, z.ZodObject<{
1195
+ kind: z.ZodLiteral<"tool">;
1196
+ configuration: z.ZodObject<{
1197
+ toolName: z.ZodString;
1198
+ fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1199
+ arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1200
+ }, z.core.$strict>;
1201
+ id: z.ZodString;
1202
+ position: z.ZodObject<{
1203
+ x: z.ZodNumber;
1204
+ y: z.ZodNumber;
1205
+ }, z.core.$strict>;
1206
+ label: z.ZodString;
1207
+ }, z.core.$strict>, z.ZodObject<{
1208
+ kind: z.ZodLiteral<"condition">;
1209
+ configuration: z.ZodObject<{
1210
+ mode: z.ZodLiteral<"semantic">;
1211
+ instruction: z.ZodString;
1186
1212
  }, z.core.$strict>;
1187
1213
  id: z.ZodString;
1188
1214
  position: z.ZodObject<{
@@ -1211,9 +1237,7 @@ export declare const FlowDocument: z.ZodObject<{
1211
1237
  label: z.ZodString;
1212
1238
  }, z.core.$strict>, z.ZodObject<{
1213
1239
  kind: z.ZodLiteral<"output">;
1214
- configuration: z.ZodObject<{
1215
- template: z.ZodDefault<z.ZodString>;
1216
- }, z.core.$strict>;
1240
+ configuration: z.ZodObject<{}, z.core.$strict>;
1217
1241
  id: z.ZodString;
1218
1242
  position: z.ZodObject<{
1219
1243
  x: z.ZodNumber;
@@ -1251,6 +1275,7 @@ export declare const FlowList: z.ZodObject<{
1251
1275
  updatedAt: z.ZodISODateTime;
1252
1276
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
1253
1277
  }, z.core.$strict>>;
1278
+ withCalls: z.ZodDefault<z.ZodArray<z.ZodString>>;
1254
1279
  }, z.core.$strict>;
1255
1280
  export type FlowList = z.infer<typeof FlowList>;
1256
1281
  export declare const FlowKnowledgeReference: z.ZodObject<{
@@ -1269,6 +1294,16 @@ export declare const FlowRequirements: z.ZodObject<{
1269
1294
  tools: z.ZodArray<z.ZodString>;
1270
1295
  }, z.core.$strict>;
1271
1296
  export type FlowRequirements = z.infer<typeof FlowRequirements>;
1297
+ export declare const FlowValidation: z.ZodObject<{
1298
+ flowId: z.ZodString;
1299
+ versionId: z.ZodNullable<z.ZodString>;
1300
+ problems: z.ZodArray<z.ZodObject<{
1301
+ code: z.ZodString;
1302
+ detail: z.ZodString;
1303
+ }, z.core.$strict>>;
1304
+ checkedAt: z.ZodISODateTime;
1305
+ }, z.core.$strict>;
1306
+ export type FlowValidation = z.infer<typeof FlowValidation>;
1272
1307
  export declare const CreateFlowInput: z.ZodObject<{
1273
1308
  parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1274
1309
  title: z.ZodString;
@@ -1320,14 +1355,9 @@ export declare const SaveFlowVersionInput: z.ZodObject<{
1320
1355
  }, z.core.$strict>;
1321
1356
  label: z.ZodString;
1322
1357
  }, z.core.$strict>, z.ZodObject<{
1323
- kind: z.ZodLiteral<"knowledge">;
1358
+ kind: z.ZodLiteral<"folder">;
1324
1359
  configuration: z.ZodObject<{
1325
- resourceIds: z.ZodArray<z.ZodString>;
1326
- mode: z.ZodEnum<{
1327
- relevant: "relevant";
1328
- full: "full";
1329
- }>;
1330
- query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1360
+ resourceId: z.ZodString;
1331
1361
  }, z.core.$strict>;
1332
1362
  id: z.ZodString;
1333
1363
  position: z.ZodObject<{
@@ -1336,11 +1366,9 @@ export declare const SaveFlowVersionInput: z.ZodObject<{
1336
1366
  }, z.core.$strict>;
1337
1367
  label: z.ZodString;
1338
1368
  }, z.core.$strict>, z.ZodObject<{
1339
- kind: z.ZodLiteral<"tool">;
1369
+ kind: z.ZodLiteral<"document">;
1340
1370
  configuration: z.ZodObject<{
1341
- toolName: z.ZodString;
1342
- fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1343
- arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1371
+ resourceId: z.ZodString;
1344
1372
  }, z.core.$strict>;
1345
1373
  id: z.ZodString;
1346
1374
  position: z.ZodObject<{
@@ -1349,10 +1377,9 @@ export declare const SaveFlowVersionInput: z.ZodObject<{
1349
1377
  }, z.core.$strict>;
1350
1378
  label: z.ZodString;
1351
1379
  }, z.core.$strict>, z.ZodObject<{
1352
- kind: z.ZodLiteral<"condition">;
1380
+ kind: z.ZodLiteral<"upload">;
1353
1381
  configuration: z.ZodObject<{
1354
- mode: z.ZodLiteral<"semantic">;
1355
- instruction: z.ZodString;
1382
+ resourceId: z.ZodString;
1356
1383
  }, z.core.$strict>;
1357
1384
  id: z.ZodString;
1358
1385
  position: z.ZodObject<{
@@ -1361,10 +1388,34 @@ export declare const SaveFlowVersionInput: z.ZodObject<{
1361
1388
  }, z.core.$strict>;
1362
1389
  label: z.ZodString;
1363
1390
  }, z.core.$strict>, z.ZodObject<{
1364
- kind: z.ZodLiteral<"approval">;
1391
+ kind: z.ZodLiteral<"table">;
1365
1392
  configuration: z.ZodObject<{
1366
- prompt: z.ZodString;
1367
- timeout: z.ZodString;
1393
+ resourceId: z.ZodString;
1394
+ }, z.core.$strict>;
1395
+ id: z.ZodString;
1396
+ position: z.ZodObject<{
1397
+ x: z.ZodNumber;
1398
+ y: z.ZodNumber;
1399
+ }, z.core.$strict>;
1400
+ label: z.ZodString;
1401
+ }, z.core.$strict>, z.ZodObject<{
1402
+ kind: z.ZodLiteral<"tool">;
1403
+ configuration: z.ZodObject<{
1404
+ toolName: z.ZodString;
1405
+ fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1406
+ arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1407
+ }, z.core.$strict>;
1408
+ id: z.ZodString;
1409
+ position: z.ZodObject<{
1410
+ x: z.ZodNumber;
1411
+ y: z.ZodNumber;
1412
+ }, z.core.$strict>;
1413
+ label: z.ZodString;
1414
+ }, z.core.$strict>, z.ZodObject<{
1415
+ kind: z.ZodLiteral<"condition">;
1416
+ configuration: z.ZodObject<{
1417
+ mode: z.ZodLiteral<"semantic">;
1418
+ instruction: z.ZodString;
1368
1419
  }, z.core.$strict>;
1369
1420
  id: z.ZodString;
1370
1421
  position: z.ZodObject<{
@@ -1393,9 +1444,7 @@ export declare const SaveFlowVersionInput: z.ZodObject<{
1393
1444
  label: z.ZodString;
1394
1445
  }, z.core.$strict>, z.ZodObject<{
1395
1446
  kind: z.ZodLiteral<"output">;
1396
- configuration: z.ZodObject<{
1397
- template: z.ZodDefault<z.ZodString>;
1398
- }, z.core.$strict>;
1447
+ configuration: z.ZodObject<{}, z.core.$strict>;
1399
1448
  id: z.ZodString;
1400
1449
  position: z.ZodObject<{
1401
1450
  x: z.ZodNumber;
@@ -1435,9 +1484,9 @@ export declare const FlowPublishCall: z.ZodObject<{
1435
1484
  calleeId: z.ZodString;
1436
1485
  calleeTitle: z.ZodString;
1437
1486
  mode: z.ZodEnum<{
1438
- pinned: "pinned";
1439
1487
  latest: "latest";
1440
1488
  follows: "follows";
1489
+ pinned: "pinned";
1441
1490
  }>;
1442
1491
  versionId: z.ZodNullable<z.ZodString>;
1443
1492
  versionSequence: z.ZodNullable<z.ZodNumber>;
@@ -1454,9 +1503,9 @@ export declare const FlowPublishPreview: z.ZodObject<{
1454
1503
  calleeId: z.ZodString;
1455
1504
  calleeTitle: z.ZodString;
1456
1505
  mode: z.ZodEnum<{
1457
- pinned: "pinned";
1458
1506
  latest: "latest";
1459
1507
  follows: "follows";
1508
+ pinned: "pinned";
1460
1509
  }>;
1461
1510
  versionId: z.ZodNullable<z.ZodString>;
1462
1511
  versionSequence: z.ZodNullable<z.ZodNumber>;
@@ -1551,7 +1600,6 @@ export type RelationGraph = z.infer<typeof RelationGraph>;
1551
1600
  export declare const FlowRunStatus: z.ZodEnum<{
1552
1601
  queued: "queued";
1553
1602
  running: "running";
1554
- waiting: "waiting";
1555
1603
  completed: "completed";
1556
1604
  failed: "failed";
1557
1605
  cancelled: "cancelled";
@@ -1564,7 +1612,6 @@ export declare const FlowRun: z.ZodObject<{
1564
1612
  status: z.ZodEnum<{
1565
1613
  queued: "queued";
1566
1614
  running: "running";
1567
- waiting: "waiting";
1568
1615
  completed: "completed";
1569
1616
  failed: "failed";
1570
1617
  cancelled: "cancelled";
@@ -1597,7 +1644,6 @@ export declare const FlowRunStep: z.ZodObject<{
1597
1644
  status: z.ZodEnum<{
1598
1645
  queued: "queued";
1599
1646
  running: "running";
1600
- waiting: "waiting";
1601
1647
  completed: "completed";
1602
1648
  failed: "failed";
1603
1649
  cancelled: "cancelled";
@@ -1636,14 +1682,9 @@ export declare const FlowRunStep: z.ZodObject<{
1636
1682
  }, z.core.$strict>;
1637
1683
  label: z.ZodString;
1638
1684
  }, z.core.$strict>, z.ZodObject<{
1639
- kind: z.ZodLiteral<"knowledge">;
1685
+ kind: z.ZodLiteral<"folder">;
1640
1686
  configuration: z.ZodObject<{
1641
- resourceIds: z.ZodArray<z.ZodString>;
1642
- mode: z.ZodEnum<{
1643
- relevant: "relevant";
1644
- full: "full";
1645
- }>;
1646
- query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1687
+ resourceId: z.ZodString;
1647
1688
  }, z.core.$strict>;
1648
1689
  id: z.ZodString;
1649
1690
  position: z.ZodObject<{
@@ -1652,11 +1693,9 @@ export declare const FlowRunStep: z.ZodObject<{
1652
1693
  }, z.core.$strict>;
1653
1694
  label: z.ZodString;
1654
1695
  }, z.core.$strict>, z.ZodObject<{
1655
- kind: z.ZodLiteral<"tool">;
1696
+ kind: z.ZodLiteral<"document">;
1656
1697
  configuration: z.ZodObject<{
1657
- toolName: z.ZodString;
1658
- fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1659
- arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1698
+ resourceId: z.ZodString;
1660
1699
  }, z.core.$strict>;
1661
1700
  id: z.ZodString;
1662
1701
  position: z.ZodObject<{
@@ -1665,10 +1704,9 @@ export declare const FlowRunStep: z.ZodObject<{
1665
1704
  }, z.core.$strict>;
1666
1705
  label: z.ZodString;
1667
1706
  }, z.core.$strict>, z.ZodObject<{
1668
- kind: z.ZodLiteral<"condition">;
1707
+ kind: z.ZodLiteral<"upload">;
1669
1708
  configuration: z.ZodObject<{
1670
- mode: z.ZodLiteral<"semantic">;
1671
- instruction: z.ZodString;
1709
+ resourceId: z.ZodString;
1672
1710
  }, z.core.$strict>;
1673
1711
  id: z.ZodString;
1674
1712
  position: z.ZodObject<{
@@ -1677,10 +1715,34 @@ export declare const FlowRunStep: z.ZodObject<{
1677
1715
  }, z.core.$strict>;
1678
1716
  label: z.ZodString;
1679
1717
  }, z.core.$strict>, z.ZodObject<{
1680
- kind: z.ZodLiteral<"approval">;
1718
+ kind: z.ZodLiteral<"table">;
1681
1719
  configuration: z.ZodObject<{
1682
- prompt: z.ZodString;
1683
- timeout: z.ZodString;
1720
+ resourceId: z.ZodString;
1721
+ }, z.core.$strict>;
1722
+ id: z.ZodString;
1723
+ position: z.ZodObject<{
1724
+ x: z.ZodNumber;
1725
+ y: z.ZodNumber;
1726
+ }, z.core.$strict>;
1727
+ label: z.ZodString;
1728
+ }, z.core.$strict>, z.ZodObject<{
1729
+ kind: z.ZodLiteral<"tool">;
1730
+ configuration: z.ZodObject<{
1731
+ toolName: z.ZodString;
1732
+ fingerprint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1733
+ arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1734
+ }, z.core.$strict>;
1735
+ id: z.ZodString;
1736
+ position: z.ZodObject<{
1737
+ x: z.ZodNumber;
1738
+ y: z.ZodNumber;
1739
+ }, z.core.$strict>;
1740
+ label: z.ZodString;
1741
+ }, z.core.$strict>, z.ZodObject<{
1742
+ kind: z.ZodLiteral<"condition">;
1743
+ configuration: z.ZodObject<{
1744
+ mode: z.ZodLiteral<"semantic">;
1745
+ instruction: z.ZodString;
1684
1746
  }, z.core.$strict>;
1685
1747
  id: z.ZodString;
1686
1748
  position: z.ZodObject<{
@@ -1709,9 +1771,7 @@ export declare const FlowRunStep: z.ZodObject<{
1709
1771
  label: z.ZodString;
1710
1772
  }, z.core.$strict>, z.ZodObject<{
1711
1773
  kind: z.ZodLiteral<"output">;
1712
- configuration: z.ZodObject<{
1713
- template: z.ZodDefault<z.ZodString>;
1714
- }, z.core.$strict>;
1774
+ configuration: z.ZodObject<{}, z.core.$strict>;
1715
1775
  id: z.ZodString;
1716
1776
  position: z.ZodObject<{
1717
1777
  x: z.ZodNumber;
@@ -1774,7 +1834,6 @@ export declare const FlowRunSummary: z.ZodObject<{
1774
1834
  status: z.ZodEnum<{
1775
1835
  queued: "queued";
1776
1836
  running: "running";
1777
- waiting: "waiting";
1778
1837
  completed: "completed";
1779
1838
  failed: "failed";
1780
1839
  cancelled: "cancelled";
@@ -1811,7 +1870,6 @@ export declare const FlowRunList: z.ZodObject<{
1811
1870
  status: z.ZodEnum<{
1812
1871
  queued: "queued";
1813
1872
  running: "running";
1814
- waiting: "waiting";
1815
1873
  completed: "completed";
1816
1874
  failed: "failed";
1817
1875
  cancelled: "cancelled";
@@ -1854,7 +1912,6 @@ export declare const FlowRunHistory: z.ZodObject<{
1854
1912
  status: z.ZodEnum<{
1855
1913
  queued: "queued";
1856
1914
  running: "running";
1857
- waiting: "waiting";
1858
1915
  completed: "completed";
1859
1916
  failed: "failed";
1860
1917
  cancelled: "cancelled";
@@ -20,7 +20,12 @@ export const SessionUser = z.strictObject({
20
20
  // folder tree, inherits the same folder grants, carries the same immutable versions and the same
21
21
  // R2 body as a document (ADR-0004 §1). Only its media type and the one operation below differ.
22
22
  export const KnowledgeNodeKind = z.enum(["folder", "document", "attachment", "table"]);
23
- export const ContextPolicy = z.enum(["pinned", "relevant", "explicit"]);
23
+ // ⚠️ There is no `ContextPolicy`, and it is not coming back in this shape (#76). It said whether a
24
+ // document should be pinned into a context, be found by relevance, or be named explicitly — an
25
+ // instruction to a retrieval Intel does not perform. Intel hands out references and the agent
26
+ // fetches what it needs (D24), so nothing here could ever have read it, and nothing did.
27
+ //
28
+ // Semantic search stays: as an MCP tool the agent calls, over everything or over one area.
24
29
  // One verb per grant, granted independently (ADR-0004 §2). Not a ladder: seeing a process must be
25
30
  // separable from being allowed to start it, and `execute` is meaningful only where a flow can live.
26
31
  export const ResourceVerb = z.enum(["read", "write", "execute", "share"]);
@@ -35,7 +40,6 @@ export const KnowledgeNode = z.strictObject({
35
40
  kind: KnowledgeNodeKind,
36
41
  title: z.string().min(1).max(240),
37
42
  description: z.string().max(2_000).nullable(),
38
- contextPolicy: ContextPolicy,
39
43
  ownerId: IntelId,
40
44
  currentVersionId: IntelId.nullable(),
41
45
  createdAt: IsoDateTime,
@@ -64,7 +68,6 @@ export const CreateKnowledgeNodeInput = z.strictObject({
64
68
  kind: KnowledgeNodeKind,
65
69
  title: z.string().trim().min(1).max(240),
66
70
  description: z.string().trim().max(2_000).nullable().default(null),
67
- contextPolicy: ContextPolicy.default("relevant"),
68
71
  idempotencyKey: z.string().min(8).max(200),
69
72
  });
70
73
  export const SaveKnowledgeVersionInput = z.strictObject({
@@ -87,21 +90,24 @@ export const UpdateKnowledgeNodeInput = z
87
90
  baseUpdatedAt: IsoDateTime,
88
91
  title: z.string().trim().min(1).max(240).optional(),
89
92
  description: z.string().trim().max(2_000).nullable().optional(),
90
- contextPolicy: ContextPolicy.optional(),
91
93
  parentId: IntelId.nullable().optional(),
92
94
  idempotencyKey: z.string().min(8).max(200),
93
95
  })
94
- .refine((input) => input.title !== undefined ||
95
- input.description !== undefined ||
96
- input.contextPolicy !== undefined ||
97
- input.parentId !== undefined, { message: "At least one change is required" });
96
+ .refine((input) => input.title !== undefined || input.description !== undefined || input.parentId !== undefined, { message: "At least one change is required" });
98
97
  export const ArchiveKnowledgeNodeInput = z.strictObject({
99
98
  nodeId: IntelId,
100
99
  baseUpdatedAt: IsoDateTime,
101
100
  archived: z.boolean(),
102
101
  idempotencyKey: z.string().min(8).max(200),
103
102
  });
104
- export const KnowledgeNodeList = z.strictObject({ items: z.array(KnowledgeNode) });
103
+ // ⚠️ `withChildren` gehört zur EBENE, nicht zum Knoten (#59). Ob etwas Kinder hat, die DIESER
104
+ // Leser sehen darf, ist keine Eigenschaft der Sache — zwei Leser bekommen verschiedene Antworten.
105
+ // Als Feld am Knoten müsste jede andere Stelle, die einen Knoten zurückgibt, es mitberechnen oder
106
+ // lügen; als Liste neben den Einträgen kostet es nur die eine Antwort, die es braucht.
107
+ export const KnowledgeNodeList = z.strictObject({
108
+ items: z.array(KnowledgeNode),
109
+ withChildren: z.array(IntelId).default([]),
110
+ });
105
111
  export const KnowledgeVersionList = z.strictObject({ items: z.array(KnowledgeVersion) });
106
112
  export const KnowledgeDocument = z.strictObject({
107
113
  node: KnowledgeNode,
@@ -387,6 +393,33 @@ export const SubflowVersion = z.discriminatedUnion("mode", [
387
393
  z.strictObject({ mode: z.literal("follows") }),
388
394
  z.strictObject({ mode: z.literal("pinned"), versionId: IntelId }),
389
395
  ]);
396
+ // The three layers a node can belong to (D25). Which one a kind is in decides what it may carry and
397
+ // where it may sit, and both rules are enforced in `compileFlow` rather than only drawn in the
398
+ // editor — a graph arrives over MCP as readily as from the canvas.
399
+ //
400
+ // ⚠️ A LINK never stands in the chain. It hangs off a step on a `context` edge, and that is the
401
+ // distinction the graph has drawn since #37 without anyone enforcing it — which is exactly how a
402
+ // start with an attachment once began its run at the attachment (the "flow edges only" comments in
403
+ // `flows.ts`). Marker and step keep the chain; a link is what a step works with.
404
+ export const FlowNodeLayer = z.enum(["marker", "step", "link"]);
405
+ export const flowNodeLayer = {
406
+ trigger: "marker",
407
+ output: "marker",
408
+ instruction: "step",
409
+ condition: "step",
410
+ subflow: "step",
411
+ folder: "link",
412
+ document: "link",
413
+ upload: "link",
414
+ table: "link",
415
+ tool: "link",
416
+ };
417
+ // One reference, never a list. The old `knowledge` node carried up to a hundred, plus a retrieval
418
+ // mode and a query that nothing read — three things in one, and the last two describing a retrieval
419
+ // Intel does not perform (D24: the agent fetches, Intel does not put anything into a context).
420
+ // Splitting by kind is what makes "exactly one" sayable at all, and it lets the editor filter the
421
+ // picker by what the node is for.
422
+ const LinkConfiguration = z.strictObject({ resourceId: IntelId });
390
423
  export const FlowNode = z.discriminatedUnion("kind", [
391
424
  z.strictObject({
392
425
  ...FlowNodeBase,
@@ -403,15 +436,17 @@ export const FlowNode = z.discriminatedUnion("kind", [
403
436
  kind: z.literal("instruction"),
404
437
  configuration: z.strictObject({ prompt: z.string().min(1).max(50_000) }),
405
438
  }),
439
+ // The four link kinds that name something in the shared tree. They are separate kinds rather than
440
+ // one with a `kind` field so the canvas, the palette and the picker can each say what they mean
441
+ // without reading into a configuration — and so a stored graph says it too.
442
+ z.strictObject({ ...FlowNodeBase, kind: z.literal("folder"), configuration: LinkConfiguration }),
406
443
  z.strictObject({
407
444
  ...FlowNodeBase,
408
- kind: z.literal("knowledge"),
409
- configuration: z.strictObject({
410
- resourceIds: z.array(IntelId).min(1).max(100),
411
- mode: z.enum(["full", "relevant"]),
412
- query: z.string().max(1_000).nullable().default(null),
413
- }),
445
+ kind: z.literal("document"),
446
+ configuration: LinkConfiguration,
414
447
  }),
448
+ z.strictObject({ ...FlowNodeBase, kind: z.literal("upload"), configuration: LinkConfiguration }),
449
+ z.strictObject({ ...FlowNodeBase, kind: z.literal("table"), configuration: LinkConfiguration }),
415
450
  z.strictObject({
416
451
  ...FlowNodeBase,
417
452
  kind: z.literal("tool"),
@@ -433,16 +468,15 @@ export const FlowNode = z.discriminatedUnion("kind", [
433
468
  instruction: z.string().min(1).max(10_000),
434
469
  }),
435
470
  }),
436
- z.strictObject({
437
- ...FlowNodeBase,
438
- kind: z.literal("approval"),
439
- configuration: z.strictObject({
440
- prompt: z.string().min(1).max(10_000),
441
- timeout: z.string().regex(/^\d+\s+(minute|minutes|hour|hours|day|days)$/),
442
- }),
443
- }),
444
- // The eighth kind: one flow calls another (ADR-0004 §3). A schema addition, not hidden behavior in
445
- // a generic code node — which flow is called has to be readable from the graph, or neither the
471
+ // ⚠️ There is no `approval` kind, and adding one back is a product decision rather than a schema
472
+ // addition (#73). It waited on a named person with a deadline, which needs a queue, a
473
+ // notification, a stand-in and an answer to "the deadline passed" — none of which exist. Without
474
+ // it, D24 holds without exception: nothing in Intel waits. A stored graph that still carries one
475
+ // is rewritten to a `condition` by migration 0007, because the question it asked is one the agent
476
+ // can answer.
477
+ //
478
+ // The seventh kind: one flow calls another (ADR-0004 §3). A schema addition, not hidden behavior
479
+ // in a generic code node — which flow is called has to be readable from the graph, or neither the
446
480
  // publish-time call rule nor the sidebar could see it.
447
481
  z.strictObject({
448
482
  ...FlowNodeBase,
@@ -454,10 +488,13 @@ export const FlowNode = z.discriminatedUnion("kind", [
454
488
  version: SubflowVersion.default({ mode: "latest" }),
455
489
  }),
456
490
  }),
491
+ // ⚠️ The end marks, it does not make. It used to carry a `template` that nothing ever read, and a
492
+ // node called "Result" that appeared to produce one is what everybody read it as. The result of a
493
+ // run is what the last step before it hands in (D25) — `completeStep` carries that forward.
457
494
  z.strictObject({
458
495
  ...FlowNodeBase,
459
496
  kind: z.literal("output"),
460
- configuration: z.strictObject({ template: z.string().max(50_000).default("") }),
497
+ configuration: z.strictObject({}),
461
498
  }),
462
499
  ]);
463
500
  // The two things an edge can mean (#37). `flow` is the order of work — "and then". `context` is what
@@ -506,7 +543,13 @@ export const FlowDocument = z.strictObject({
506
543
  flow: Flow,
507
544
  version: FlowVersion.nullable(),
508
545
  });
509
- export const FlowList = z.strictObject({ items: z.array(Flow) });
546
+ // Dasselbe für Flows: welche von ihnen einen anderen Flow rufen, den dieser Leser auch sehen darf
547
+ // (#59). Ein Aufklapp-Pfeil an einem Flow, dessen Aufrufe alle verborgen sind, verspricht Inhalt,
548
+ // den das Aufklappen nicht liefern kann.
549
+ export const FlowList = z.strictObject({
550
+ items: z.array(Flow),
551
+ withCalls: z.array(IntelId).default([]),
552
+ });
510
553
  export const FlowKnowledgeReference = z.strictObject({
511
554
  id: IntelId,
512
555
  title: z.string().min(1).max(240),
@@ -526,6 +569,22 @@ export const FlowRequirements = z.strictObject({
526
569
  hiddenKnowledge: z.number().int().nonnegative(),
527
570
  tools: z.array(ToolName),
528
571
  });
572
+ // What stands between this flow and a run, asked on demand and answered for the person asking.
573
+ //
574
+ // ⚠️ A snapshot, and it says so. The tool catalog is a live query with the requesting user's own
575
+ // token (ADR-0003), so what is reachable now can be different tomorrow, and the same flow answers
576
+ // differently for two people. That is why this is a question one asks rather than a badge on the
577
+ // flow: a standing "this flow has conflicts" would be wrong for tools by construction (#72, D24).
578
+ export const FlowValidation = z.strictObject({
579
+ flowId: IntelId,
580
+ versionId: IntelId.nullable(),
581
+ // Empty means it would start now — for this person, at this moment.
582
+ problems: z.array(z.strictObject({
583
+ code: z.string().min(1).max(80),
584
+ detail: z.string().min(1).max(2_000),
585
+ })),
586
+ checkedAt: IsoDateTime,
587
+ });
529
588
  export const CreateFlowInput = z.strictObject({
530
589
  parentId: IntelId.nullable().default(null),
531
590
  title: z.string().trim().min(1).max(240),
@@ -631,14 +690,12 @@ export const RelationGraph = z.strictObject({
631
690
  omitted: z.number().int().nonnegative(),
632
691
  limit: z.number().int().positive(),
633
692
  });
634
- export const FlowRunStatus = z.enum([
635
- "queued",
636
- "running",
637
- "waiting",
638
- "completed",
639
- "failed",
640
- "cancelled",
641
- ]);
693
+ // ⚠️ No `waiting`. It was written for the approval node and never set by anything — the two places
694
+ // that tested for it only ever saw `running` (#73). The column's CHECK constraint still allows the
695
+ // value, deliberately: rewriting it means rebuilding the table in D1 for a value nothing writes,
696
+ // and migration 0007 turns any row that somehow carries it into `failed` rather than leave a status
697
+ // the contract cannot parse.
698
+ export const FlowRunStatus = z.enum(["queued", "running", "completed", "failed", "cancelled"]);
642
699
  export const FlowRun = z.strictObject({
643
700
  id: IntelId,
644
701
  flowId: IntelId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/intel-contract",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {