@hexabot-ai/types 3.0.2-alpha.10 → 3.0.2-alpha.11

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.
@@ -0,0 +1,329 @@
1
+ import { z } from "zod";
2
+ export declare const WORKFLOW_EXPORT_BUNDLE_KIND = "hexabot.workflow.bundle";
3
+ export declare const WORKFLOW_TRANSFER_RESOURCE_KIND_PATTERN: RegExp;
4
+ export declare const workflowTransferResourceKindSchema: z.ZodString;
5
+ export declare const workflowExportBundleMemoryDefinitionSchema: z.ZodObject<{
6
+ exportId: z.ZodString;
7
+ name: z.ZodString;
8
+ slug: z.ZodString;
9
+ scope: z.ZodEnum<typeof import("./domain").MemoryScope>;
10
+ schema: z.ZodAny;
11
+ ttlSeconds: z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>;
12
+ }, z.core.$strict>;
13
+ export declare const workflowExportBundleCredentialSchema: z.ZodObject<{
14
+ exportId: z.ZodString;
15
+ name: z.ZodString;
16
+ exportedOwnerId: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strict>;
18
+ export declare const workflowExportBundleMcpServerSchema: z.ZodObject<{
19
+ exportId: z.ZodString;
20
+ name: z.ZodString;
21
+ enabled: z.ZodCoercedBoolean<unknown>;
22
+ transport: z.ZodEnum<typeof import("./domain").McpServerTransport>;
23
+ url: z.ZodNullable<z.ZodString>;
24
+ command: z.ZodNullable<z.ZodString>;
25
+ args: z.ZodNullable<z.ZodArray<z.ZodString>>;
26
+ cwd: z.ZodNullable<z.ZodString>;
27
+ credentialExportId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ }, z.core.$strict>;
29
+ export declare const workflowExportBundleContentTypeSchema: z.ZodObject<{
30
+ exportId: z.ZodString;
31
+ name: z.ZodString;
32
+ schema: z.ZodAny;
33
+ }, z.core.$strict>;
34
+ export declare const workflowExportBundleLabelGroupSchema: z.ZodObject<{
35
+ exportId: z.ZodString;
36
+ name: z.ZodString;
37
+ }, z.core.$strict>;
38
+ export declare const workflowExportBundleLabelSchema: z.ZodObject<{
39
+ exportId: z.ZodString;
40
+ title: z.ZodString;
41
+ name: z.ZodString;
42
+ description: z.ZodNullable<z.ZodString>;
43
+ groupExportId: z.ZodNullable<z.ZodString>;
44
+ }, z.core.$strict>;
45
+ export declare const workflowExportBundleWorkflowDependencySchema: z.ZodObject<{
46
+ exportId: z.ZodString;
47
+ workflow: z.ZodObject<{
48
+ type: z.ZodEnum<typeof import("./domain").WorkflowType>;
49
+ description: z.ZodNullable<z.ZodString>;
50
+ name: z.ZodString;
51
+ schedule: z.ZodNullable<z.ZodString>;
52
+ inputSchema: z.ZodAny;
53
+ layout: z.ZodObject<{
54
+ x: z.ZodCoercedNumber<unknown>;
55
+ y: z.ZodCoercedNumber<unknown>;
56
+ zoom: z.ZodCoercedNumber<unknown>;
57
+ direction: z.ZodEnum<typeof import("./domain").DirectionType>;
58
+ }, z.core.$strict>;
59
+ }, z.core.$strict>;
60
+ version: z.ZodObject<{
61
+ number: z.ZodCoercedNumber<unknown>;
62
+ checksum: z.ZodString;
63
+ message: z.ZodNullable<z.ZodString>;
64
+ exportedVersionId: z.ZodString;
65
+ }, z.core.$strict>;
66
+ definitionYml: z.ZodString;
67
+ }, z.core.$strict>;
68
+ export declare const workflowExportBundleV1Schema: z.ZodObject<{
69
+ kind: z.ZodLiteral<"hexabot.workflow.bundle">;
70
+ schemaVersion: z.ZodLiteral<1>;
71
+ exportedAt: z.ZodISODateTime;
72
+ workflow: z.ZodObject<{
73
+ exportId: z.ZodOptional<z.ZodString>;
74
+ name: z.ZodString;
75
+ description: z.ZodNullable<z.ZodString>;
76
+ type: z.ZodEnum<typeof import("./domain").WorkflowType>;
77
+ schedule: z.ZodNullable<z.ZodString>;
78
+ inputSchema: z.ZodAny;
79
+ layout: z.ZodObject<{
80
+ x: z.ZodCoercedNumber<unknown>;
81
+ y: z.ZodCoercedNumber<unknown>;
82
+ zoom: z.ZodCoercedNumber<unknown>;
83
+ direction: z.ZodEnum<typeof import("./domain").DirectionType>;
84
+ }, z.core.$strict>;
85
+ }, z.core.$strict>;
86
+ version: z.ZodObject<{
87
+ number: z.ZodCoercedNumber<unknown>;
88
+ checksum: z.ZodString;
89
+ message: z.ZodNullable<z.ZodString>;
90
+ exportedVersionId: z.ZodString;
91
+ }, z.core.$strict>;
92
+ definitionYml: z.ZodString;
93
+ resources: z.ZodObject<{
94
+ memoryDefinitions: z.ZodArray<z.ZodObject<{
95
+ exportId: z.ZodString;
96
+ name: z.ZodString;
97
+ slug: z.ZodString;
98
+ scope: z.ZodEnum<typeof import("./domain").MemoryScope>;
99
+ schema: z.ZodAny;
100
+ ttlSeconds: z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>;
101
+ }, z.core.$strict>>;
102
+ mcpServers: z.ZodArray<z.ZodObject<{
103
+ exportId: z.ZodString;
104
+ name: z.ZodString;
105
+ enabled: z.ZodCoercedBoolean<unknown>;
106
+ transport: z.ZodEnum<typeof import("./domain").McpServerTransport>;
107
+ url: z.ZodNullable<z.ZodString>;
108
+ command: z.ZodNullable<z.ZodString>;
109
+ args: z.ZodNullable<z.ZodArray<z.ZodString>>;
110
+ cwd: z.ZodNullable<z.ZodString>;
111
+ credentialExportId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
+ }, z.core.$strict>>;
113
+ credentials: z.ZodArray<z.ZodObject<{
114
+ exportId: z.ZodString;
115
+ name: z.ZodString;
116
+ exportedOwnerId: z.ZodOptional<z.ZodString>;
117
+ }, z.core.$strict>>;
118
+ contentTypes: z.ZodDefault<z.ZodArray<z.ZodObject<{
119
+ exportId: z.ZodString;
120
+ name: z.ZodString;
121
+ schema: z.ZodAny;
122
+ }, z.core.$strict>>>;
123
+ labelGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
124
+ exportId: z.ZodString;
125
+ name: z.ZodString;
126
+ }, z.core.$strict>>>;
127
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
128
+ exportId: z.ZodString;
129
+ title: z.ZodString;
130
+ name: z.ZodString;
131
+ description: z.ZodNullable<z.ZodString>;
132
+ groupExportId: z.ZodNullable<z.ZodString>;
133
+ }, z.core.$strict>>>;
134
+ workflows: z.ZodDefault<z.ZodArray<z.ZodObject<{
135
+ exportId: z.ZodString;
136
+ workflow: z.ZodObject<{
137
+ type: z.ZodEnum<typeof import("./domain").WorkflowType>;
138
+ description: z.ZodNullable<z.ZodString>;
139
+ name: z.ZodString;
140
+ schedule: z.ZodNullable<z.ZodString>;
141
+ inputSchema: z.ZodAny;
142
+ layout: z.ZodObject<{
143
+ x: z.ZodCoercedNumber<unknown>;
144
+ y: z.ZodCoercedNumber<unknown>;
145
+ zoom: z.ZodCoercedNumber<unknown>;
146
+ direction: z.ZodEnum<typeof import("./domain").DirectionType>;
147
+ }, z.core.$strict>;
148
+ }, z.core.$strict>;
149
+ version: z.ZodObject<{
150
+ number: z.ZodCoercedNumber<unknown>;
151
+ checksum: z.ZodString;
152
+ message: z.ZodNullable<z.ZodString>;
153
+ exportedVersionId: z.ZodString;
154
+ }, z.core.$strict>;
155
+ definitionYml: z.ZodString;
156
+ }, z.core.$strict>>>;
157
+ }, z.core.$catchall<z.ZodArray<z.ZodUnknown>>>;
158
+ }, z.core.$strict>;
159
+ export declare const workflowExportBundleSchema: z.ZodObject<{
160
+ kind: z.ZodLiteral<"hexabot.workflow.bundle">;
161
+ schemaVersion: z.ZodLiteral<1>;
162
+ exportedAt: z.ZodISODateTime;
163
+ workflow: z.ZodObject<{
164
+ exportId: z.ZodOptional<z.ZodString>;
165
+ name: z.ZodString;
166
+ description: z.ZodNullable<z.ZodString>;
167
+ type: z.ZodEnum<typeof import("./domain").WorkflowType>;
168
+ schedule: z.ZodNullable<z.ZodString>;
169
+ inputSchema: z.ZodAny;
170
+ layout: z.ZodObject<{
171
+ x: z.ZodCoercedNumber<unknown>;
172
+ y: z.ZodCoercedNumber<unknown>;
173
+ zoom: z.ZodCoercedNumber<unknown>;
174
+ direction: z.ZodEnum<typeof import("./domain").DirectionType>;
175
+ }, z.core.$strict>;
176
+ }, z.core.$strict>;
177
+ version: z.ZodObject<{
178
+ number: z.ZodCoercedNumber<unknown>;
179
+ checksum: z.ZodString;
180
+ message: z.ZodNullable<z.ZodString>;
181
+ exportedVersionId: z.ZodString;
182
+ }, z.core.$strict>;
183
+ definitionYml: z.ZodString;
184
+ resources: z.ZodObject<{
185
+ memoryDefinitions: z.ZodArray<z.ZodObject<{
186
+ exportId: z.ZodString;
187
+ name: z.ZodString;
188
+ slug: z.ZodString;
189
+ scope: z.ZodEnum<typeof import("./domain").MemoryScope>;
190
+ schema: z.ZodAny;
191
+ ttlSeconds: z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>;
192
+ }, z.core.$strict>>;
193
+ mcpServers: z.ZodArray<z.ZodObject<{
194
+ exportId: z.ZodString;
195
+ name: z.ZodString;
196
+ enabled: z.ZodCoercedBoolean<unknown>;
197
+ transport: z.ZodEnum<typeof import("./domain").McpServerTransport>;
198
+ url: z.ZodNullable<z.ZodString>;
199
+ command: z.ZodNullable<z.ZodString>;
200
+ args: z.ZodNullable<z.ZodArray<z.ZodString>>;
201
+ cwd: z.ZodNullable<z.ZodString>;
202
+ credentialExportId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
203
+ }, z.core.$strict>>;
204
+ credentials: z.ZodArray<z.ZodObject<{
205
+ exportId: z.ZodString;
206
+ name: z.ZodString;
207
+ exportedOwnerId: z.ZodOptional<z.ZodString>;
208
+ }, z.core.$strict>>;
209
+ contentTypes: z.ZodDefault<z.ZodArray<z.ZodObject<{
210
+ exportId: z.ZodString;
211
+ name: z.ZodString;
212
+ schema: z.ZodAny;
213
+ }, z.core.$strict>>>;
214
+ labelGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
215
+ exportId: z.ZodString;
216
+ name: z.ZodString;
217
+ }, z.core.$strict>>>;
218
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
219
+ exportId: z.ZodString;
220
+ title: z.ZodString;
221
+ name: z.ZodString;
222
+ description: z.ZodNullable<z.ZodString>;
223
+ groupExportId: z.ZodNullable<z.ZodString>;
224
+ }, z.core.$strict>>>;
225
+ workflows: z.ZodDefault<z.ZodArray<z.ZodObject<{
226
+ exportId: z.ZodString;
227
+ workflow: z.ZodObject<{
228
+ type: z.ZodEnum<typeof import("./domain").WorkflowType>;
229
+ description: z.ZodNullable<z.ZodString>;
230
+ name: z.ZodString;
231
+ schedule: z.ZodNullable<z.ZodString>;
232
+ inputSchema: z.ZodAny;
233
+ layout: z.ZodObject<{
234
+ x: z.ZodCoercedNumber<unknown>;
235
+ y: z.ZodCoercedNumber<unknown>;
236
+ zoom: z.ZodCoercedNumber<unknown>;
237
+ direction: z.ZodEnum<typeof import("./domain").DirectionType>;
238
+ }, z.core.$strict>;
239
+ }, z.core.$strict>;
240
+ version: z.ZodObject<{
241
+ number: z.ZodCoercedNumber<unknown>;
242
+ checksum: z.ZodString;
243
+ message: z.ZodNullable<z.ZodString>;
244
+ exportedVersionId: z.ZodString;
245
+ }, z.core.$strict>;
246
+ definitionYml: z.ZodString;
247
+ }, z.core.$strict>>>;
248
+ }, z.core.$catchall<z.ZodArray<z.ZodUnknown>>>;
249
+ }, z.core.$strict>;
250
+ export declare const workflowImportResourceActionSchema: z.ZodEnum<{
251
+ reused: "reused";
252
+ created: "created";
253
+ placeholder_created: "placeholder_created";
254
+ }>;
255
+ export declare const workflowImportResourceResultSchema: z.ZodObject<{
256
+ kind: z.ZodString;
257
+ exportId: z.ZodString;
258
+ localId: z.ZodString;
259
+ name: z.ZodString;
260
+ action: z.ZodEnum<{
261
+ reused: "reused";
262
+ created: "created";
263
+ placeholder_created: "placeholder_created";
264
+ }>;
265
+ }, z.core.$strict>;
266
+ export declare const workflowImportResultSchema: z.ZodObject<{
267
+ workflow: z.ZodType<{
268
+ id: string;
269
+ createdAt: Date;
270
+ updatedAt: Date;
271
+ name: string;
272
+ description: string | null;
273
+ type: import("./domain").WorkflowType;
274
+ schedule: string | null;
275
+ inputSchema: any;
276
+ builtin: boolean;
277
+ x: number;
278
+ y: number;
279
+ zoom: number;
280
+ direction: import("./domain").DirectionType;
281
+ createdBy: string | null;
282
+ runAfterMs: number;
283
+ currentVersion?: string | null | undefined;
284
+ publishedVersion?: string | null | undefined;
285
+ }, unknown, z.core.$ZodTypeInternals<{
286
+ id: string;
287
+ createdAt: Date;
288
+ updatedAt: Date;
289
+ name: string;
290
+ description: string | null;
291
+ type: import("./domain").WorkflowType;
292
+ schedule: string | null;
293
+ inputSchema: any;
294
+ builtin: boolean;
295
+ x: number;
296
+ y: number;
297
+ zoom: number;
298
+ direction: import("./domain").DirectionType;
299
+ createdBy: string | null;
300
+ runAfterMs: number;
301
+ currentVersion?: string | null | undefined;
302
+ publishedVersion?: string | null | undefined;
303
+ }, unknown>>;
304
+ resources: z.ZodArray<z.ZodObject<{
305
+ kind: z.ZodString;
306
+ exportId: z.ZodString;
307
+ localId: z.ZodString;
308
+ name: z.ZodString;
309
+ action: z.ZodEnum<{
310
+ reused: "reused";
311
+ created: "created";
312
+ placeholder_created: "placeholder_created";
313
+ }>;
314
+ }, z.core.$strict>>;
315
+ warnings: z.ZodArray<z.ZodString>;
316
+ }, z.core.$strict>;
317
+ export type WorkflowExportBundleMemoryDefinition = z.infer<typeof workflowExportBundleMemoryDefinitionSchema>;
318
+ export type WorkflowExportBundleCredential = z.infer<typeof workflowExportBundleCredentialSchema>;
319
+ export type WorkflowExportBundleMcpServer = z.infer<typeof workflowExportBundleMcpServerSchema>;
320
+ export type WorkflowExportBundleContentType = z.infer<typeof workflowExportBundleContentTypeSchema>;
321
+ export type WorkflowExportBundleLabelGroup = z.infer<typeof workflowExportBundleLabelGroupSchema>;
322
+ export type WorkflowExportBundleLabel = z.infer<typeof workflowExportBundleLabelSchema>;
323
+ export type WorkflowExportBundleWorkflowDependency = z.infer<typeof workflowExportBundleWorkflowDependencySchema>;
324
+ export type WorkflowExportBundleV1 = z.infer<typeof workflowExportBundleV1Schema>;
325
+ export type WorkflowExportBundle = z.infer<typeof workflowExportBundleSchema>;
326
+ export type WorkflowImportResourceAction = z.infer<typeof workflowImportResourceActionSchema>;
327
+ export type WorkflowImportResourceResult = z.infer<typeof workflowImportResourceResultSchema>;
328
+ export type WorkflowImportResult = z.infer<typeof workflowImportResultSchema>;
329
+ //# sourceMappingURL=workflow-transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-transfer.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-transfer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AAErE,eAAO,MAAM,uCAAuC,QACP,CAAC;AAE9C,eAAO,MAAM,kCAAkC,aAGE,CAAC;AAwBlD,eAAO,MAAM,0CAA0C;;;;;;;kBAOrD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;kBAI/C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;kBAU9C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;kBAIhD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;kBAG/C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;kBAM1C,CAAC;AAEH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;kBAKvD,CAAC;AAgBH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA+B,CAAC;AAEvE,eAAO,MAAM,kCAAkC;;;;EAI7C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;kBAM7C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAIrC,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexabot-ai/types",
3
- "version": "3.0.2-alpha.10",
3
+ "version": "3.0.2-alpha.11",
4
4
  "description": "Shared zod schemas and inferred entity types for Hexabot.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/index.test.ts CHANGED
@@ -57,6 +57,9 @@ import {
57
57
  userFullSchema,
58
58
  userSchema,
59
59
  workflowFullSchema,
60
+ workflowExportBundleSchema,
61
+ workflowExportBundleV1Schema,
62
+ workflowImportResultSchema,
60
63
  workflowRunFullSchema,
61
64
  workflowRunSchema,
62
65
  workflowVersionFullSchema,
@@ -777,6 +780,300 @@ describe("@hexabot-ai/types schemas", () => {
777
780
  expect(parser).toHaveBeenCalledTimes(1);
778
781
  });
779
782
 
783
+ it("parses workflow export bundles without credential secrets", () => {
784
+ const bundle = workflowExportBundleSchema.parse({
785
+ kind: "hexabot.workflow.bundle",
786
+ schemaVersion: 1,
787
+ exportedAt: now,
788
+ workflow: {
789
+ exportId: "wf_1",
790
+ name: "Main",
791
+ description: null,
792
+ type: WorkflowType.conversational,
793
+ schedule: null,
794
+ inputSchema: {},
795
+ layout: {
796
+ x: 0,
797
+ y: 0,
798
+ zoom: 1,
799
+ direction: "horizontal",
800
+ },
801
+ },
802
+ version: {
803
+ number: 3,
804
+ checksum: "sha",
805
+ message: null,
806
+ exportedVersionId: "wfv_1",
807
+ },
808
+ definitionYml: "defs: {}\nflow: []\noutputs: {}",
809
+ resources: {
810
+ memoryDefinitions: [
811
+ {
812
+ exportId: "mem_1",
813
+ name: "Profile",
814
+ slug: "profile",
815
+ scope: MemoryScope.workflow,
816
+ schema: { type: "object" },
817
+ ttlSeconds: null,
818
+ },
819
+ ],
820
+ mcpServers: [
821
+ {
822
+ exportId: "mcp_1",
823
+ name: "Search",
824
+ enabled: true,
825
+ transport: McpServerTransport.http,
826
+ url: "https://mcp.example.com",
827
+ command: null,
828
+ args: null,
829
+ cwd: null,
830
+ credentialExportId: "cred_1",
831
+ },
832
+ ],
833
+ credentials: [
834
+ {
835
+ exportId: "cred_1",
836
+ name: "Search API",
837
+ exportedOwnerId: "u_1",
838
+ },
839
+ ],
840
+ contentTypes: [
841
+ {
842
+ exportId: "ct_1",
843
+ name: "Article",
844
+ schema: { type: "object" },
845
+ },
846
+ ],
847
+ labelGroups: [
848
+ {
849
+ exportId: "lg_1",
850
+ name: "Status",
851
+ },
852
+ ],
853
+ labels: [
854
+ {
855
+ exportId: "label_1",
856
+ title: "Qualified",
857
+ name: "QUALIFIED",
858
+ description: null,
859
+ groupExportId: "lg_1",
860
+ },
861
+ ],
862
+ workflows: [
863
+ {
864
+ exportId: "wf_child",
865
+ workflow: {
866
+ name: "Child",
867
+ description: "Called child workflow",
868
+ type: WorkflowType.conversational,
869
+ schedule: null,
870
+ inputSchema: {},
871
+ layout: {
872
+ x: 10,
873
+ y: 20,
874
+ zoom: 1,
875
+ direction: "horizontal",
876
+ },
877
+ },
878
+ version: {
879
+ number: 2,
880
+ checksum: "child-sha",
881
+ message: "Child version",
882
+ exportedVersionId: "wfv_child",
883
+ },
884
+ definitionYml: "defs: {}\nflow: []\noutputs: {}",
885
+ },
886
+ ],
887
+ knowledgeBases: [
888
+ {
889
+ exportId: "kb_1",
890
+ name: "Docs",
891
+ config: { index: "docs" },
892
+ },
893
+ ],
894
+ },
895
+ });
896
+
897
+ expect(bundle.resources.credentials[0]).toEqual({
898
+ exportId: "cred_1",
899
+ name: "Search API",
900
+ exportedOwnerId: "u_1",
901
+ });
902
+ expect(bundle.workflow.exportId).toBe("wf_1");
903
+ expect(bundle.resources.contentTypes[0]?.name).toBe("Article");
904
+ expect(bundle.resources.labelGroups[0]?.name).toBe("Status");
905
+ expect(bundle.resources.labels[0]).toMatchObject({
906
+ exportId: "label_1",
907
+ groupExportId: "lg_1",
908
+ });
909
+ expect(bundle.resources.workflows[0]).toMatchObject({
910
+ exportId: "wf_child",
911
+ workflow: { name: "Child" },
912
+ version: { exportedVersionId: "wfv_child" },
913
+ });
914
+ expect(bundle.resources.knowledgeBases).toEqual([
915
+ {
916
+ exportId: "kb_1",
917
+ name: "Docs",
918
+ config: { index: "docs" },
919
+ },
920
+ ]);
921
+ });
922
+
923
+ it("defaults new workflow bundle resource arrays for older bundles", () => {
924
+ const bundle = workflowExportBundleSchema.parse({
925
+ kind: "hexabot.workflow.bundle",
926
+ schemaVersion: 1,
927
+ exportedAt: now,
928
+ workflow: {
929
+ name: "Main",
930
+ description: null,
931
+ type: WorkflowType.conversational,
932
+ schedule: null,
933
+ inputSchema: {},
934
+ layout: {
935
+ x: 0,
936
+ y: 0,
937
+ zoom: 1,
938
+ direction: "horizontal",
939
+ },
940
+ },
941
+ version: {
942
+ number: 1,
943
+ checksum: "sha",
944
+ message: null,
945
+ exportedVersionId: "wfv_1",
946
+ },
947
+ definitionYml: "defs: {}\nflow: []\noutputs: {}",
948
+ resources: {
949
+ memoryDefinitions: [],
950
+ mcpServers: [],
951
+ credentials: [],
952
+ },
953
+ });
954
+
955
+ expect(bundle.resources.contentTypes).toEqual([]);
956
+ expect(bundle.resources.labelGroups).toEqual([]);
957
+ expect(bundle.resources.labels).toEqual([]);
958
+ expect(bundle.resources.workflows).toEqual([]);
959
+ });
960
+
961
+ it("rejects non-array custom workflow bundle resource buckets", () => {
962
+ expect(() =>
963
+ workflowExportBundleV1Schema.parse({
964
+ kind: "hexabot.workflow.bundle",
965
+ schemaVersion: 1,
966
+ exportedAt: now,
967
+ workflow: {
968
+ name: "Main",
969
+ description: null,
970
+ type: WorkflowType.conversational,
971
+ schedule: null,
972
+ inputSchema: {},
973
+ layout: {
974
+ x: 0,
975
+ y: 0,
976
+ zoom: 1,
977
+ direction: "horizontal",
978
+ },
979
+ },
980
+ version: {
981
+ number: 1,
982
+ checksum: "sha",
983
+ message: null,
984
+ exportedVersionId: "wfv_1",
985
+ },
986
+ definitionYml: "defs: {}\nflow: []\noutputs: {}",
987
+ resources: {
988
+ memoryDefinitions: [],
989
+ mcpServers: [],
990
+ credentials: [],
991
+ knowledgeBases: {
992
+ exportId: "kb_1",
993
+ },
994
+ },
995
+ }),
996
+ ).toThrow();
997
+ });
998
+
999
+ it("rejects credential values in workflow export bundles", () => {
1000
+ expect(() =>
1001
+ workflowExportBundleV1Schema.parse({
1002
+ kind: "hexabot.workflow.bundle",
1003
+ schemaVersion: 1,
1004
+ exportedAt: now,
1005
+ workflow: {
1006
+ name: "Main",
1007
+ description: null,
1008
+ type: WorkflowType.conversational,
1009
+ schedule: null,
1010
+ inputSchema: {},
1011
+ layout: {
1012
+ x: 0,
1013
+ y: 0,
1014
+ zoom: 1,
1015
+ direction: "horizontal",
1016
+ },
1017
+ },
1018
+ version: {
1019
+ number: 1,
1020
+ checksum: "sha",
1021
+ message: null,
1022
+ exportedVersionId: "wfv_1",
1023
+ },
1024
+ definitionYml: "defs: {}\nflow: []\noutputs: {}",
1025
+ resources: {
1026
+ memoryDefinitions: [],
1027
+ mcpServers: [],
1028
+ credentials: [
1029
+ {
1030
+ exportId: "cred_1",
1031
+ name: "Search API",
1032
+ value: "secret",
1033
+ },
1034
+ ],
1035
+ },
1036
+ }),
1037
+ ).toThrow();
1038
+ });
1039
+
1040
+ it("parses workflow import results", () => {
1041
+ const result = workflowImportResultSchema.parse({
1042
+ workflow: {
1043
+ id: "wf_1",
1044
+ createdAt: now,
1045
+ updatedAt: now,
1046
+ name: "Imported",
1047
+ description: null,
1048
+ type: WorkflowType.conversational,
1049
+ schedule: null,
1050
+ inputSchema: {},
1051
+ builtin: false,
1052
+ x: 0,
1053
+ y: 0,
1054
+ zoom: 1,
1055
+ direction: "horizontal",
1056
+ currentVersion: "wfv_1",
1057
+ publishedVersion: null,
1058
+ createdBy: "u_1",
1059
+ runAfterMs: 0,
1060
+ },
1061
+ resources: [
1062
+ {
1063
+ kind: "knowledgeBase",
1064
+ exportId: "kb_1",
1065
+ localId: "kb_local",
1066
+ name: "Docs",
1067
+ action: "reused",
1068
+ },
1069
+ ],
1070
+ warnings: ["Credential placeholder created."],
1071
+ });
1072
+
1073
+ expect(result.resources[0]?.action).toBe("reused");
1074
+ expect(result.resources[0]?.kind).toBe("knowledgeBase");
1075
+ });
1076
+
780
1077
  it("computes workflow run duration and mixed triggeredBy coercion", () => {
781
1078
  const run = workflowRunSchema.parse({
782
1079
  id: "run_1",
@@ -788,6 +1085,7 @@ describe("@hexabot-ai/types schemas", () => {
788
1085
  workflowVersionId: "wfv_1",
789
1086
  triggeredById: "s_1",
790
1087
  threadId: "t_1",
1088
+ parentRun: "parent_run_1",
791
1089
  finishedAt: "2026-01-01T00:02:00.000Z",
792
1090
  });
793
1091
  const full = workflowRunFullSchema.parse({
@@ -837,10 +1135,23 @@ describe("@hexabot-ai/types schemas", () => {
837
1135
  avatar: null,
838
1136
  },
839
1137
  thread: null,
1138
+ parentRun: {
1139
+ id: "parent_run_1",
1140
+ createdAt: now,
1141
+ updatedAt: now,
1142
+ status: "suspended",
1143
+ context: {},
1144
+ workflowId: "parent_wf_1",
1145
+ workflowVersionId: null,
1146
+ triggeredById: null,
1147
+ parentRun: null,
1148
+ },
840
1149
  });
841
1150
 
842
1151
  expect(run.duration).toBe(120000);
1152
+ expect(run.parentRun).toBe("parent_run_1");
843
1153
  expect(full.triggeredBy?.id).toBe("s_1");
1154
+ expect(full.parentRun?.workflow).toBe("parent_wf_1");
844
1155
  expect(typeof resolveRunDurationMs(run)).toBe("number");
845
1156
  });
846
1157