@fungi.computer/workflows-wire 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/library-contracts.d.ts +30 -0
- package/dist/library-contracts.js +30 -0
- package/dist/outcomes.d.ts +18 -0
- package/dist/outcomes.js +150 -12
- package/dist/published-definition.d.ts +2 -1
- package/dist/repository-app-source.d.ts +11 -0
- package/dist/repository-app-source.js +12 -0
- package/dist/run-contracts.d.ts +2 -0
- package/dist/trigger-contracts.d.ts +5 -0
- package/dist/trigger-contracts.js +3 -0
- package/dist/workflow-repository.d.ts +4 -1
- package/dist/workflow-repository.js +2 -1
- package/docs/api/README.md +2445 -0
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
/** Source Workflow and commit recorded when importing or forking a document. */
|
|
2
3
|
export declare const provenanceSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
3
4
|
kind: z.ZodLiteral<"import">;
|
|
4
5
|
workflowId: z.ZodString;
|
|
@@ -15,6 +16,7 @@ export declare const provenanceSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObjec
|
|
|
15
16
|
workflowId: z.ZodString;
|
|
16
17
|
commit: z.ZodString;
|
|
17
18
|
}, z.core.$strict>]>>;
|
|
19
|
+
/** Shared run request fields: identity, bindings, JSON input and optional delivery. */
|
|
18
20
|
export declare const runBase: z.ZodObject<{
|
|
19
21
|
requestId: z.ZodString;
|
|
20
22
|
workflowId: z.ZodString;
|
|
@@ -27,6 +29,7 @@ export declare const runBase: z.ZodObject<{
|
|
|
27
29
|
sessionId: z.ZodString;
|
|
28
30
|
}, z.core.$strict>>;
|
|
29
31
|
}, z.core.$strict>;
|
|
32
|
+
/** Run request pinned to either a published version or an exact Git commit. */
|
|
30
33
|
export declare const publishedRun: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
31
34
|
requestId: z.ZodString;
|
|
32
35
|
workflowId: z.ZodString;
|
|
@@ -52,6 +55,7 @@ export declare const publishedRun: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
|
52
55
|
}, z.core.$strict>>;
|
|
53
56
|
commit: z.ZodString;
|
|
54
57
|
}, z.core.$strict>]>>;
|
|
58
|
+
/** Wire document containing definition, node layout, provenance and commit. */
|
|
55
59
|
export declare const document: z.ZodObject<{
|
|
56
60
|
provenance: z.ZodOptional<z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
57
61
|
kind: z.ZodLiteral<"import">;
|
|
@@ -76,7 +80,9 @@ export declare const document: z.ZodObject<{
|
|
|
76
80
|
}, z.core.$strict>>;
|
|
77
81
|
commit: z.ZodString;
|
|
78
82
|
}, z.core.$strict>;
|
|
83
|
+
/** Nonnegative revision used to fence draft replacements. */
|
|
79
84
|
export declare const revisionSchema: z.ZodNumber;
|
|
85
|
+
/** Editable document with a draft revision instead of a published commit. */
|
|
80
86
|
export declare const draftDocument: z.ZodObject<{
|
|
81
87
|
provenance: z.ZodOptional<z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
82
88
|
kind: z.ZodLiteral<"import">;
|
|
@@ -101,6 +107,7 @@ export declare const draftDocument: z.ZodObject<{
|
|
|
101
107
|
}, z.core.$strict>>;
|
|
102
108
|
revision: z.ZodNumber;
|
|
103
109
|
}, z.core.$strict>;
|
|
110
|
+
/** Published document identified by Workflow, version, commit and content digest. */
|
|
104
111
|
export declare const publishedDocument: z.ZodObject<{
|
|
105
112
|
provenance: z.ZodOptional<z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
106
113
|
kind: z.ZodLiteral<"import">;
|
|
@@ -132,6 +139,7 @@ export declare const publishedDocument: z.ZodObject<{
|
|
|
132
139
|
readonly appReleaseKind: "Sha256Digest";
|
|
133
140
|
}, string>>;
|
|
134
141
|
}, z.core.$strict>;
|
|
142
|
+
/** Draft save result, including revision conflict or validation issues. */
|
|
135
143
|
export declare const saveReply: z.ZodUnion<readonly [z.ZodObject<{
|
|
136
144
|
kind: z.ZodLiteral<"saved">;
|
|
137
145
|
revision: z.ZodNumber;
|
|
@@ -173,6 +181,7 @@ export declare const saveReply: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
173
181
|
edge: z.ZodOptional<z.ZodNumber>;
|
|
174
182
|
}, z.core.$strip>>>;
|
|
175
183
|
}, z.core.$strict>]>;
|
|
184
|
+
/** Share review listing Git access, write/external nodes and trigger configuration. */
|
|
176
185
|
export declare const shareReview: z.ZodObject<{
|
|
177
186
|
gitAccess: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
178
187
|
binding: z.ZodLazy<z.ZodString>;
|
|
@@ -199,6 +208,7 @@ export declare const shareReview: z.ZodObject<{
|
|
|
199
208
|
}, z.core.$strict>>;
|
|
200
209
|
triggers: z.ZodArray<z.ZodJSONSchema>;
|
|
201
210
|
}, z.core.$strict>;
|
|
211
|
+
/** Import/fork result with the saved draft and review, or a typed refusal. */
|
|
202
212
|
export declare const shareCopyReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
203
213
|
kind: z.ZodLiteral<"saved">;
|
|
204
214
|
revision: z.ZodNumber;
|
|
@@ -277,6 +287,7 @@ export declare const shareCopyReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<
|
|
|
277
287
|
invalid_bundle: "invalid_bundle";
|
|
278
288
|
}>;
|
|
279
289
|
}, z.core.$strict>]>>;
|
|
290
|
+
/** Exported bundle bytes and digest, or a missing/oversized bundle result. */
|
|
280
291
|
export declare const shareExportReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
281
292
|
bytes: z.ZodString;
|
|
282
293
|
sha256: z.ZodString & z.ZodType<string & {
|
|
@@ -290,25 +301,31 @@ export declare const shareExportReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObjec
|
|
|
290
301
|
too_large: "too_large";
|
|
291
302
|
}>;
|
|
292
303
|
}, z.core.$strict>]>>;
|
|
304
|
+
/** Mint and validate identities for asynchronous Workflow publication attempts. */
|
|
293
305
|
export declare const publicationIds: Readonly<{
|
|
294
306
|
readonly publication: import("@fungi.computer/cairn/id").IdCodec<"workflow-publication", "publication", 1>;
|
|
295
307
|
}>;
|
|
308
|
+
/** Publication identity accepted by the maintained publication id family. */
|
|
296
309
|
export declare const publicationIdSchema: z.ZodLazy<z.ZodString & z.ZodType<import("@fungi.computer/cairn/id").CairnId<"workflow-publication", "publication", 1>, string, z.core.$ZodTypeInternals<import("@fungi.computer/cairn/id").CairnId<"workflow-publication", "publication", 1>, string>>>;
|
|
310
|
+
/** Publication failure categories returned by the host. */
|
|
297
311
|
export declare const publicationFailure: z.ZodEnum<{
|
|
298
312
|
too_large: "too_large";
|
|
299
313
|
git_conflict: "git_conflict";
|
|
300
314
|
publication_failed: "publication_failed";
|
|
301
315
|
access_changed: "access_changed";
|
|
302
316
|
}>;
|
|
317
|
+
/** Completed publication's exact commit and assigned version. */
|
|
303
318
|
export declare const publicationComplete: z.ZodLazy<z.ZodObject<{
|
|
304
319
|
kind: z.ZodLiteral<"published">;
|
|
305
320
|
commit: z.ZodString;
|
|
306
321
|
version: z.ZodNumber;
|
|
307
322
|
}, z.core.$strict>>;
|
|
323
|
+
/** Pending publication identified for subsequent status reads. */
|
|
308
324
|
export declare const publicationPending: z.ZodLazy<z.ZodObject<{
|
|
309
325
|
kind: z.ZodLiteral<"publishing">;
|
|
310
326
|
publicationId: z.ZodLazy<z.ZodString & z.ZodType<import("@fungi.computer/cairn/id").CairnId<"workflow-publication", "publication", 1>, string, z.core.$ZodTypeInternals<import("@fungi.computer/cairn/id").CairnId<"workflow-publication", "publication", 1>, string>>>;
|
|
311
327
|
}, z.core.$strict>>;
|
|
328
|
+
/** Failed publication and its typed failure reason. */
|
|
312
329
|
export declare const publicationFailed: z.ZodLazy<z.ZodObject<{
|
|
313
330
|
kind: z.ZodLiteral<"failed">;
|
|
314
331
|
reason: z.ZodEnum<{
|
|
@@ -318,6 +335,7 @@ export declare const publicationFailed: z.ZodLazy<z.ZodObject<{
|
|
|
318
335
|
access_changed: "access_changed";
|
|
319
336
|
}>;
|
|
320
337
|
}, z.core.$strict>>;
|
|
338
|
+
/** Current publication outcome, including an unknown publication identity. */
|
|
321
339
|
export declare const publicationStatus: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodObject<{
|
|
322
340
|
kind: z.ZodLiteral<"publishing">;
|
|
323
341
|
publicationId: z.ZodLazy<z.ZodString & z.ZodType<import("@fungi.computer/cairn/id").CairnId<"workflow-publication", "publication", 1>, string, z.core.$ZodTypeInternals<import("@fungi.computer/cairn/id").CairnId<"workflow-publication", "publication", 1>, string>>>;
|
|
@@ -336,9 +354,11 @@ export declare const publicationStatus: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy
|
|
|
336
354
|
}, z.core.$strict>>, z.ZodObject<{
|
|
337
355
|
kind: z.ZodLiteral<"not_found">;
|
|
338
356
|
}, z.core.$strict>]>>;
|
|
357
|
+
/** Another publication attempt currently owns the publication operation. */
|
|
339
358
|
export declare const publicationElsewhere: z.ZodLazy<z.ZodObject<{
|
|
340
359
|
kind: z.ZodLiteral<"publishing_elsewhere">;
|
|
341
360
|
}, z.core.$strict>>;
|
|
361
|
+
/** Publication command result, including pending work, conflict or validation issues. */
|
|
342
362
|
export declare const publishReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodObject<{
|
|
343
363
|
kind: z.ZodLiteral<"publishing_elsewhere">;
|
|
344
364
|
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
@@ -371,15 +391,18 @@ export declare const publishReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.Zo
|
|
|
371
391
|
edge: z.ZodOptional<z.ZodNumber>;
|
|
372
392
|
}, z.core.$strip>>>;
|
|
373
393
|
}, z.core.$strict>]>>;
|
|
394
|
+
/** Published version with commit identity, commit time and commit message. */
|
|
374
395
|
export declare const version: z.ZodObject<{
|
|
375
396
|
version: z.ZodNumber;
|
|
376
397
|
commit: z.ZodString;
|
|
377
398
|
committedAt: z.ZodNumber;
|
|
378
399
|
message: z.ZodString;
|
|
379
400
|
}, z.core.$strict>;
|
|
401
|
+
/** Identify one Workflow within the library. */
|
|
380
402
|
export declare const workflow: z.ZodObject<{
|
|
381
403
|
workflowId: z.ZodString;
|
|
382
404
|
}, z.core.$strict>;
|
|
405
|
+
/** Bounded library rows with draft revision and optional published reference. */
|
|
383
406
|
export declare const listings: z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
384
407
|
workflowId: z.ZodString;
|
|
385
408
|
title: z.ZodString;
|
|
@@ -389,6 +412,7 @@ export declare const listings: z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
|
389
412
|
version: z.ZodNullable<z.ZodNumber>;
|
|
390
413
|
}, z.core.$strict>>;
|
|
391
414
|
}, z.core.$strict>>>;
|
|
415
|
+
/** Bounded Git history rows without a published-version number. */
|
|
392
416
|
export declare const history: z.ZodArray<z.ZodObject<{
|
|
393
417
|
message: z.ZodString;
|
|
394
418
|
commit: z.ZodString;
|
|
@@ -399,6 +423,7 @@ export declare const libraryPageInput: z.ZodLazy<z.ZodObject<{
|
|
|
399
423
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
400
424
|
after: z.ZodOptional<z.ZodString>;
|
|
401
425
|
}, z.core.$strict>>;
|
|
426
|
+
/** One library page with an optional exclusive cursor for the next page. */
|
|
402
427
|
export declare const libraryPage: z.ZodLazy<z.ZodObject<{
|
|
403
428
|
items: z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
404
429
|
workflowId: z.ZodString;
|
|
@@ -411,6 +436,7 @@ export declare const libraryPage: z.ZodLazy<z.ZodObject<{
|
|
|
411
436
|
}, z.core.$strict>>>;
|
|
412
437
|
next: z.ZodOptional<z.ZodString>;
|
|
413
438
|
}, z.core.$strict>>;
|
|
439
|
+
/** Indexed library page, or an explicit indication that its index is missing. */
|
|
414
440
|
export declare const libraryListing: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodObject<{
|
|
415
441
|
items: z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
416
442
|
workflowId: z.ZodString;
|
|
@@ -429,6 +455,7 @@ export declare const libraryListing: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.
|
|
|
429
455
|
export declare const rebuilding: z.ZodLazy<z.ZodObject<{
|
|
430
456
|
kind: z.ZodLiteral<"rebuilding">;
|
|
431
457
|
}, z.core.$strict>>;
|
|
458
|
+
/** Draft/published document read, absence, or an explicit copy-rebuild state. */
|
|
432
459
|
export declare const documentRead: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
433
460
|
provenance: z.ZodOptional<z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
434
461
|
kind: z.ZodLiteral<"import">;
|
|
@@ -478,6 +505,7 @@ export declare const documentRead: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
|
478
505
|
}, z.core.$strict>, z.ZodNull, z.ZodLazy<z.ZodObject<{
|
|
479
506
|
kind: z.ZodLiteral<"rebuilding">;
|
|
480
507
|
}, z.core.$strict>>]>>;
|
|
508
|
+
/** Published version rows, or an explicit copy-rebuild state. */
|
|
481
509
|
export declare const versionsRead: z.ZodLazy<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
482
510
|
version: z.ZodNumber;
|
|
483
511
|
commit: z.ZodString;
|
|
@@ -486,6 +514,7 @@ export declare const versionsRead: z.ZodLazy<z.ZodUnion<readonly [z.ZodArray<z.Z
|
|
|
486
514
|
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
487
515
|
kind: z.ZodLiteral<"rebuilding">;
|
|
488
516
|
}, z.core.$strict>>]>>;
|
|
517
|
+
/** Bounded copy-rebuild continuation, optionally targeting one pinned document. */
|
|
489
518
|
export declare const rebuildCopiesInput: z.ZodLazy<z.ZodObject<{
|
|
490
519
|
cursor: z.ZodNullable<z.ZodString>;
|
|
491
520
|
target: z.ZodOptional<z.ZodObject<{
|
|
@@ -495,6 +524,7 @@ export declare const rebuildCopiesInput: z.ZodLazy<z.ZodObject<{
|
|
|
495
524
|
}, z.core.$strict>;
|
|
496
525
|
}, z.core.$strict>>;
|
|
497
526
|
}, z.core.$strict>>;
|
|
527
|
+
/** Copy-rebuild progress and the cursor needed to continue unfinished work. */
|
|
498
528
|
export declare const rebuildCopiesReply: z.ZodLazy<z.ZodObject<{
|
|
499
529
|
done: z.ZodBoolean;
|
|
500
530
|
cursor: z.ZodNullable<z.ZodString>;
|
|
@@ -6,6 +6,7 @@ import { sha256DigestSchema } from "@fungi.computer/puffball/effect";
|
|
|
6
6
|
import { gitAccessSchema, bindingsSelectionSchema, } from "@fungi.computer/braid/git-access";
|
|
7
7
|
import { gitSha1Schema } from "@fungi.computer/puffball/git-representation";
|
|
8
8
|
import { workflowIdSchema, workflowIssueSchema as issueSchema, } from "./outcomes.js";
|
|
9
|
+
/** Source Workflow and commit recorded when importing or forking a document. */
|
|
9
10
|
export const provenanceSchema = z.lazy(() => z.union([
|
|
10
11
|
z.strictObject({
|
|
11
12
|
kind: z.literal("import"),
|
|
@@ -22,6 +23,7 @@ export const provenanceSchema = z.lazy(() => z.union([
|
|
|
22
23
|
}),
|
|
23
24
|
]));
|
|
24
25
|
const identity = z.string().min(1).max(256);
|
|
26
|
+
/** Shared run request fields: identity, bindings, JSON input and optional delivery. */
|
|
25
27
|
export const runBase = z.strictObject({
|
|
26
28
|
requestId: identity,
|
|
27
29
|
workflowId: workflowIdSchema,
|
|
@@ -29,10 +31,12 @@ export const runBase = z.strictObject({
|
|
|
29
31
|
input: z.record(z.string(), z.json()),
|
|
30
32
|
delivery: runDeliverySchema.optional(),
|
|
31
33
|
});
|
|
34
|
+
/** Run request pinned to either a published version or an exact Git commit. */
|
|
32
35
|
export const publishedRun = z.lazy(() => z.union([
|
|
33
36
|
runBase.extend({ version: z.number().int().positive() }),
|
|
34
37
|
runBase.extend({ commit: gitSha1Schema }),
|
|
35
38
|
]));
|
|
39
|
+
/** Wire document containing definition, node layout, provenance and commit. */
|
|
36
40
|
export const document = z.strictObject({
|
|
37
41
|
provenance: provenanceSchema.optional(),
|
|
38
42
|
definition: z.record(z.string(), z.json()),
|
|
@@ -43,15 +47,19 @@ const invalid = z.strictObject({
|
|
|
43
47
|
kind: z.literal("invalid"),
|
|
44
48
|
issues: z.array(issueSchema),
|
|
45
49
|
});
|
|
50
|
+
/** Nonnegative revision used to fence draft replacements. */
|
|
46
51
|
export const revisionSchema = z.number().int().nonnegative();
|
|
52
|
+
/** Editable document with a draft revision instead of a published commit. */
|
|
47
53
|
export const draftDocument = document
|
|
48
54
|
.omit({ commit: true })
|
|
49
55
|
.extend({ revision: revisionSchema });
|
|
56
|
+
/** Published document identified by Workflow, version, commit and content digest. */
|
|
50
57
|
export const publishedDocument = document.extend({
|
|
51
58
|
workflowId: workflowIdSchema,
|
|
52
59
|
version: z.number().int().positive(),
|
|
53
60
|
digest: z.string().refine(S.is(sha256DigestSchema)),
|
|
54
61
|
});
|
|
62
|
+
/** Draft save result, including revision conflict or validation issues. */
|
|
55
63
|
export const saveReply = z.union([
|
|
56
64
|
z.strictObject({ kind: z.literal("saved"), revision: revisionSchema }),
|
|
57
65
|
z.strictObject({
|
|
@@ -61,6 +69,7 @@ export const saveReply = z.union([
|
|
|
61
69
|
invalid,
|
|
62
70
|
]);
|
|
63
71
|
const reviewedNode = { graph: z.string(), node: z.string() };
|
|
72
|
+
/** Share review listing Git access, write/external nodes and trigger configuration. */
|
|
64
73
|
export const shareReview = z.strictObject({
|
|
65
74
|
gitAccess: z.array(z.union([
|
|
66
75
|
gitAccessSchema.options[0].extend(reviewedNode),
|
|
@@ -76,6 +85,7 @@ export const shareReview = z.strictObject({
|
|
|
76
85
|
// Definition decoding owns trigger grammar; this reply transports configuration only.
|
|
77
86
|
triggers: z.array(z.json()),
|
|
78
87
|
});
|
|
88
|
+
/** Import/fork result with the saved draft and review, or a typed refusal. */
|
|
79
89
|
export const shareCopyReply = z.lazy(() => z.union([
|
|
80
90
|
z.strictObject({
|
|
81
91
|
kind: z.literal("saved"),
|
|
@@ -98,6 +108,7 @@ export const shareCopyReply = z.lazy(() => z.union([
|
|
|
98
108
|
]),
|
|
99
109
|
}),
|
|
100
110
|
]));
|
|
111
|
+
/** Exported bundle bytes and digest, or a missing/oversized bundle result. */
|
|
101
112
|
export const shareExportReply = z.lazy(() => z.union([
|
|
102
113
|
z.strictObject({
|
|
103
114
|
bytes: z.string(),
|
|
@@ -105,44 +116,53 @@ export const shareExportReply = z.lazy(() => z.union([
|
|
|
105
116
|
}),
|
|
106
117
|
z.strictObject({ kind: z.enum(["not_found", "too_large"]) }),
|
|
107
118
|
]));
|
|
119
|
+
/** Mint and validate identities for asynchronous Workflow publication attempts. */
|
|
108
120
|
export const publicationIds = defineIdFamily({
|
|
109
121
|
family: "workflow-publication",
|
|
110
122
|
version: 1,
|
|
111
123
|
kinds: { publication: { prefix: "publication" } },
|
|
112
124
|
});
|
|
125
|
+
/** Publication identity accepted by the maintained publication id family. */
|
|
113
126
|
export const publicationIdSchema = z.lazy(() => z
|
|
114
127
|
.string()
|
|
115
128
|
.min(1)
|
|
116
129
|
.max(256)
|
|
117
130
|
.refine((value) => publicationIds.publication.is(value)));
|
|
131
|
+
/** Publication failure categories returned by the host. */
|
|
118
132
|
export const publicationFailure = z.enum([
|
|
119
133
|
"git_conflict",
|
|
120
134
|
"publication_failed",
|
|
121
135
|
"too_large",
|
|
122
136
|
"access_changed",
|
|
123
137
|
]);
|
|
138
|
+
/** Completed publication's exact commit and assigned version. */
|
|
124
139
|
export const publicationComplete = z.lazy(() => z.strictObject({
|
|
125
140
|
kind: z.literal("published"),
|
|
126
141
|
commit: gitSha1Schema,
|
|
127
142
|
version: z.number().int().positive(),
|
|
128
143
|
}));
|
|
144
|
+
/** Pending publication identified for subsequent status reads. */
|
|
129
145
|
export const publicationPending = z.lazy(() => z.strictObject({
|
|
130
146
|
kind: z.literal("publishing"),
|
|
131
147
|
publicationId: publicationIdSchema,
|
|
132
148
|
}));
|
|
149
|
+
/** Failed publication and its typed failure reason. */
|
|
133
150
|
export const publicationFailed = z.lazy(() => z.strictObject({
|
|
134
151
|
kind: z.literal("failed"),
|
|
135
152
|
reason: publicationFailure,
|
|
136
153
|
}));
|
|
154
|
+
/** Current publication outcome, including an unknown publication identity. */
|
|
137
155
|
export const publicationStatus = z.lazy(() => z.union([
|
|
138
156
|
publicationPending,
|
|
139
157
|
publicationComplete,
|
|
140
158
|
publicationFailed,
|
|
141
159
|
z.strictObject({ kind: z.literal("not_found") }),
|
|
142
160
|
]));
|
|
161
|
+
/** Another publication attempt currently owns the publication operation. */
|
|
143
162
|
export const publicationElsewhere = z.lazy(() => z.strictObject({
|
|
144
163
|
kind: z.literal("publishing_elsewhere"),
|
|
145
164
|
}));
|
|
165
|
+
/** Publication command result, including pending work, conflict or validation issues. */
|
|
146
166
|
export const publishReply = z.lazy(() => z.union([
|
|
147
167
|
publicationElsewhere,
|
|
148
168
|
publicationComplete,
|
|
@@ -154,13 +174,16 @@ export const publishReply = z.lazy(() => z.union([
|
|
|
154
174
|
}),
|
|
155
175
|
invalid,
|
|
156
176
|
]));
|
|
177
|
+
/** Published version with commit identity, commit time and commit message. */
|
|
157
178
|
export const version = z.strictObject({
|
|
158
179
|
version: z.number().int().positive(),
|
|
159
180
|
commit: gitSha1Schema,
|
|
160
181
|
committedAt: z.number(),
|
|
161
182
|
message: z.string(),
|
|
162
183
|
});
|
|
184
|
+
/** Identify one Workflow within the library. */
|
|
163
185
|
export const workflow = z.strictObject({ workflowId: workflowIdSchema });
|
|
186
|
+
/** Bounded library rows with draft revision and optional published reference. */
|
|
164
187
|
export const listings = z.lazy(() => z
|
|
165
188
|
.array(z.strictObject({
|
|
166
189
|
workflowId: workflowIdSchema,
|
|
@@ -174,21 +197,27 @@ export const listings = z.lazy(() => z
|
|
|
174
197
|
.nullable(),
|
|
175
198
|
}))
|
|
176
199
|
.max(100));
|
|
200
|
+
/** Bounded Git history rows without a published-version number. */
|
|
177
201
|
export const history = z.array(version.omit({ version: true })).max(50);
|
|
178
202
|
/** A missing index is not an empty Git repository; only write paths reconstruct it. */
|
|
179
203
|
export const libraryPageInput = z.lazy(() => z.strictObject({
|
|
180
204
|
limit: z.number().int().min(1).max(100).default(100),
|
|
181
205
|
after: workflowIdSchema.optional(),
|
|
182
206
|
}));
|
|
207
|
+
/** One library page with an optional exclusive cursor for the next page. */
|
|
183
208
|
export const libraryPage = z.lazy(() => z.strictObject({
|
|
184
209
|
items: listings,
|
|
185
210
|
next: workflowIdSchema.optional(),
|
|
186
211
|
}));
|
|
212
|
+
/** Indexed library page, or an explicit indication that its index is missing. */
|
|
187
213
|
export const libraryListing = z.lazy(() => z.union([libraryPage, z.strictObject({ kind: z.literal("unindexed") })]));
|
|
188
214
|
/** A missing screen copy needs an explicit foreground rebuild, never a hidden Git read. */
|
|
189
215
|
export const rebuilding = z.lazy(() => z.strictObject({ kind: z.literal("rebuilding") }));
|
|
216
|
+
/** Draft/published document read, absence, or an explicit copy-rebuild state. */
|
|
190
217
|
export const documentRead = z.lazy(() => z.union([draftDocument, document, z.null(), rebuilding]));
|
|
218
|
+
/** Published version rows, or an explicit copy-rebuild state. */
|
|
191
219
|
export const versionsRead = z.lazy(() => z.union([z.array(version), rebuilding]));
|
|
220
|
+
/** Bounded copy-rebuild continuation, optionally targeting one pinned document. */
|
|
192
221
|
export const rebuildCopiesInput = z.lazy(() => z.strictObject({
|
|
193
222
|
cursor: z.string().max(1024).nullable(),
|
|
194
223
|
target: workflow
|
|
@@ -197,6 +226,7 @@ export const rebuildCopiesInput = z.lazy(() => z.strictObject({
|
|
|
197
226
|
})
|
|
198
227
|
.optional(),
|
|
199
228
|
}));
|
|
229
|
+
/** Copy-rebuild progress and the cursor needed to continue unfinished work. */
|
|
200
230
|
export const rebuildCopiesReply = z.lazy(() => z.strictObject({
|
|
201
231
|
done: z.boolean(),
|
|
202
232
|
cursor: z.string().max(1024).nullable(),
|
package/dist/outcomes.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
/** Lowercase Workflow slug used by library files and host commands. */
|
|
2
3
|
export declare const workflowIdSchema: z.ZodString;
|
|
4
|
+
/** Select the palette index, or one installation's complete port declarations. */
|
|
3
5
|
export declare const catalogInputSchema: z.ZodLazy<z.ZodObject<{
|
|
4
6
|
installationId: z.ZodOptional<z.ZodString>;
|
|
5
7
|
}, z.core.$strict>>;
|
|
@@ -31,6 +33,7 @@ export declare const catalogReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObj
|
|
|
31
33
|
displayName: z.ZodString;
|
|
32
34
|
icon: z.ZodOptional<z.ZodString>;
|
|
33
35
|
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
36
|
+
approvals: "approvals";
|
|
34
37
|
"agent.list": "agent.list";
|
|
35
38
|
"agent.manage": "agent.manage";
|
|
36
39
|
"agent.rename": "agent.rename";
|
|
@@ -72,6 +75,7 @@ export declare const catalogReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObj
|
|
|
72
75
|
displayName: z.ZodString;
|
|
73
76
|
icon: z.ZodOptional<z.ZodString>;
|
|
74
77
|
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
78
|
+
approvals: "approvals";
|
|
75
79
|
"agent.list": "agent.list";
|
|
76
80
|
"agent.manage": "agent.manage";
|
|
77
81
|
"agent.rename": "agent.rename";
|
|
@@ -107,6 +111,7 @@ export declare const catalogReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObj
|
|
|
107
111
|
}, z.core.$strict>, z.ZodObject<{
|
|
108
112
|
error: z.ZodString;
|
|
109
113
|
}, z.core.$strict>]>>;
|
|
114
|
+
/** Validation issue with optional graph, node, trigger, port or edge location. */
|
|
110
115
|
export declare const workflowIssueSchema: z.ZodLazy<z.ZodObject<{
|
|
111
116
|
code: z.ZodString;
|
|
112
117
|
message: z.ZodString;
|
|
@@ -116,6 +121,7 @@ export declare const workflowIssueSchema: z.ZodLazy<z.ZodObject<{
|
|
|
116
121
|
port: z.ZodOptional<z.ZodString>;
|
|
117
122
|
edge: z.ZodOptional<z.ZodNumber>;
|
|
118
123
|
}, z.core.$strip>>;
|
|
124
|
+
/** Run admission result, including replay/conflict, invalid input or refusal. */
|
|
119
125
|
export declare const runReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
120
126
|
kind: z.ZodEnum<{
|
|
121
127
|
started: "started";
|
|
@@ -138,6 +144,7 @@ export declare const runReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
|
138
144
|
}, z.core.$strict>, z.ZodObject<{
|
|
139
145
|
error: z.ZodString;
|
|
140
146
|
}, z.core.$strict>]>>;
|
|
147
|
+
/** Cancellation result, an already-terminal run, or an authority refusal. */
|
|
141
148
|
export declare const cancelReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
142
149
|
kind: z.ZodEnum<{
|
|
143
150
|
cancelled: "cancelled";
|
|
@@ -149,11 +156,13 @@ export declare const cancelReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObje
|
|
|
149
156
|
}, z.core.$strict>, z.ZodObject<{
|
|
150
157
|
error: z.ZodString;
|
|
151
158
|
}, z.core.$strict>]>>;
|
|
159
|
+
/** Lifecycle outcome reported for a Workflow run. */
|
|
152
160
|
export declare const runOutcomeSchema: z.ZodEnum<{
|
|
153
161
|
cancelled: "cancelled";
|
|
154
162
|
terminal: "terminal";
|
|
155
163
|
active: "active";
|
|
156
164
|
}>;
|
|
165
|
+
/** Bounded run status snapshot with events, reviews, output and error. */
|
|
157
166
|
export declare const statusReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
158
167
|
runId: z.ZodString;
|
|
159
168
|
planDigest: z.ZodString;
|
|
@@ -171,6 +180,7 @@ export declare const statusReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
|
171
180
|
}, z.core.$strict>, z.ZodObject<{
|
|
172
181
|
error: z.ZodString;
|
|
173
182
|
}, z.core.$strict>]>>;
|
|
183
|
+
/** Result of answering a waiting run review, or an invocation refusal. */
|
|
174
184
|
export declare const answerReviewReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
175
185
|
result: z.ZodEnum<{
|
|
176
186
|
invalid: "invalid";
|
|
@@ -181,6 +191,7 @@ export declare const answerReviewReply: z.ZodLazy<z.ZodUnion<readonly [z.ZodObje
|
|
|
181
191
|
}, z.core.$strict>, z.ZodObject<{
|
|
182
192
|
error: z.ZodString;
|
|
183
193
|
}, z.core.$strict>]>>;
|
|
194
|
+
/** Schedule-trigger admission or its refusal details. */
|
|
184
195
|
export declare const scheduleArmReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
185
196
|
kind: z.ZodLiteral<"armed">;
|
|
186
197
|
scheduleId: z.ZodString;
|
|
@@ -191,6 +202,7 @@ export declare const scheduleArmReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.Zo
|
|
|
191
202
|
}, z.core.$strict>, z.ZodObject<{
|
|
192
203
|
error: z.ZodString;
|
|
193
204
|
}, z.core.$strict>]>>;
|
|
205
|
+
/** Trigger disarm result, including an absent trigger or denied invocation. */
|
|
194
206
|
export declare const triggerDisarmReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
195
207
|
kind: z.ZodEnum<{
|
|
196
208
|
disarmed: "disarmed";
|
|
@@ -199,9 +211,11 @@ export declare const triggerDisarmReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.
|
|
|
199
211
|
}, z.core.$strict>, z.ZodObject<{
|
|
200
212
|
error: z.ZodString;
|
|
201
213
|
}, z.core.$strict>]>>;
|
|
214
|
+
/** Visible schedule-trigger rows with their next due time and lifecycle state. */
|
|
202
215
|
export declare const schedulesReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
203
216
|
schedules: z.ZodArray<z.ZodObject<{
|
|
204
217
|
scheduleId: z.ZodString;
|
|
218
|
+
installationId: z.ZodString;
|
|
205
219
|
workflowId: z.ZodString;
|
|
206
220
|
triggerId: z.ZodString;
|
|
207
221
|
nextDueAt: z.ZodNumber;
|
|
@@ -216,6 +230,7 @@ export declare const schedulesReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodO
|
|
|
216
230
|
}, z.core.$strict>, z.ZodObject<{
|
|
217
231
|
error: z.ZodString;
|
|
218
232
|
}, z.core.$strict>]>>;
|
|
233
|
+
/** Origin category recorded for a run: manual, schedule, event, Agent or key. */
|
|
219
234
|
export declare const workflowRunSourceSchema: z.ZodEnum<{
|
|
220
235
|
manual: "manual";
|
|
221
236
|
schedule: "schedule";
|
|
@@ -236,6 +251,7 @@ export declare const workflowRunInitiatedBySchema: z.ZodLazy<z.ZodUnion<readonly
|
|
|
236
251
|
keyId: z.ZodString;
|
|
237
252
|
grantorMemberId: z.ZodString;
|
|
238
253
|
}, z.core.$strict>]>>;
|
|
254
|
+
/** Bounded recent-run rows with their source, initiator and pinned commit. */
|
|
239
255
|
export declare const runsReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
240
256
|
runs: z.ZodArray<z.ZodObject<{
|
|
241
257
|
runId: z.ZodString;
|
|
@@ -266,6 +282,7 @@ export declare const runsReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject
|
|
|
266
282
|
}, z.core.$strict>, z.ZodObject<{
|
|
267
283
|
error: z.ZodString;
|
|
268
284
|
}, z.core.$strict>]>>;
|
|
285
|
+
/** Event-trigger admission or its refusal details. */
|
|
269
286
|
export declare const eventArmReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
270
287
|
kind: z.ZodLiteral<"armed">;
|
|
271
288
|
eventTriggerId: z.ZodString;
|
|
@@ -276,6 +293,7 @@ export declare const eventArmReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodOb
|
|
|
276
293
|
}, z.core.$strict>, z.ZodObject<{
|
|
277
294
|
error: z.ZodString;
|
|
278
295
|
}, z.core.$strict>]>>;
|
|
296
|
+
/** Visible event-trigger rows with emitter, event and current state. */
|
|
279
297
|
export declare const eventTriggersReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
280
298
|
eventTriggers: z.ZodArray<z.ZodObject<{
|
|
281
299
|
eventTriggerId: z.ZodString;
|