@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/outcomes.js
CHANGED
|
@@ -1,126 +1,226 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { appCapabilityIds } from "@fungi.computer/puffball";
|
|
3
|
+
/** Lowercase Workflow slug used by library files and host commands. */
|
|
3
4
|
export const workflowIdSchema = z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
|
|
4
5
|
const identity = z.string().min(1).max(256);
|
|
5
|
-
const refusal = z.strictObject({
|
|
6
|
+
const refusal = z.strictObject({
|
|
7
|
+
/** Host-authored invocation refusal. */
|
|
8
|
+
error: identity,
|
|
9
|
+
});
|
|
6
10
|
/** What the palette shows before a method's ports are ever fetched. */
|
|
7
11
|
const methodSummarySchema = z.lazy(() => z.strictObject({
|
|
12
|
+
/** Port details have not yet been loaded. */
|
|
8
13
|
pending: z.literal(true).optional(),
|
|
14
|
+
/** Human-readable method summary. */
|
|
9
15
|
description: z.string().max(1000),
|
|
16
|
+
/** Declared read, write or external effect. */
|
|
10
17
|
effect: z.enum(["read", "write", "external"]),
|
|
18
|
+
/** Declared approval mode. */
|
|
11
19
|
approval: z.enum(["none", "queue", "simulate"]),
|
|
20
|
+
/** Capabilities required by this method. */
|
|
12
21
|
requires: z.array(z.string().max(80)).max(64),
|
|
22
|
+
/** Digest identifying the declaration being summarized. */
|
|
13
23
|
digest: z.string().max(128),
|
|
14
24
|
}));
|
|
15
25
|
const eventSummarySchema = z.lazy(() => z.strictObject({
|
|
26
|
+
/** Human-readable event summary. */
|
|
16
27
|
description: z.string().max(1000),
|
|
28
|
+
/** Digest identifying the event declaration. */
|
|
17
29
|
digest: z.string().max(128),
|
|
18
30
|
}));
|
|
19
31
|
const entryIdentity = {
|
|
32
|
+
/** Installation exposing these ports. */
|
|
20
33
|
installationId: identity,
|
|
34
|
+
/** App installed at this installation. */
|
|
21
35
|
appId: identity,
|
|
36
|
+
/** App display name shown in the palette. */
|
|
22
37
|
displayName: z.string().max(256),
|
|
38
|
+
/** Optional declared App icon. */
|
|
23
39
|
icon: z.string().min(1).max(80).optional(),
|
|
40
|
+
/** App capabilities included in the admitted catalog row. */
|
|
24
41
|
capabilities: z.array(z.enum(appCapabilityIds)).optional(),
|
|
42
|
+
/** Whether Workflow publication is granted to this installation. */
|
|
25
43
|
workflowPublishGranted: z.boolean().optional(),
|
|
44
|
+
/** Whether Workflow execution is granted to this installation. */
|
|
26
45
|
workflowRunGranted: z.boolean().optional(),
|
|
27
46
|
};
|
|
28
47
|
/** `catalog({})`: a palette index over every installation, with no port schemas. */
|
|
29
48
|
const catalogIndexEntrySchema = z.lazy(() => z.strictObject({
|
|
30
49
|
...entryIdentity,
|
|
50
|
+
/** Method summaries indexed by declared name. */
|
|
31
51
|
methods: z.record(z.string(), methodSummarySchema),
|
|
52
|
+
/** Event summaries indexed by declared name. */
|
|
32
53
|
events: z.record(z.string(), eventSummarySchema).optional(),
|
|
33
54
|
}));
|
|
34
55
|
/** `catalog({installationId})`: that one installation's full declared ports. */
|
|
35
56
|
const catalogFullEntrySchema = z.lazy(() => z.strictObject({
|
|
36
57
|
...entryIdentity,
|
|
58
|
+
/** Complete JSON method declarations indexed by name. */
|
|
37
59
|
methods: z.record(z.string(), z.json()),
|
|
60
|
+
/** Complete JSON event declarations indexed by name. */
|
|
38
61
|
events: z.record(z.string(), z.json()).optional(),
|
|
39
62
|
}));
|
|
63
|
+
/** Select the palette index, or one installation's complete port declarations. */
|
|
40
64
|
export const catalogInputSchema = z.lazy(() => z.strictObject({
|
|
65
|
+
/** Select one installation, or omit to read the palette index. */
|
|
41
66
|
installationId: identity.optional(),
|
|
42
67
|
}));
|
|
43
68
|
/** App method declarations admitted by the host for the current invocation. */
|
|
44
69
|
export const catalogReplySchema = z.lazy(() => z.union([
|
|
45
|
-
z.strictObject({
|
|
46
|
-
|
|
70
|
+
z.strictObject({
|
|
71
|
+
/** Bounded palette index over admitted installations. */
|
|
72
|
+
apps: z.array(catalogIndexEntrySchema).max(200),
|
|
73
|
+
}),
|
|
74
|
+
z.strictObject({
|
|
75
|
+
/** Full port declarations for the selected installation. */
|
|
76
|
+
app: catalogFullEntrySchema,
|
|
77
|
+
}),
|
|
47
78
|
refusal,
|
|
48
79
|
]));
|
|
80
|
+
/** Validation issue with optional graph, node, trigger, port or edge location. */
|
|
49
81
|
export const workflowIssueSchema = z.lazy(() => z.object({
|
|
82
|
+
/** Machine-readable validation issue category. */
|
|
50
83
|
code: z.string(),
|
|
84
|
+
/** Human-readable validation explanation. */
|
|
51
85
|
message: z.string(),
|
|
86
|
+
/** Graph containing the invalid declaration. */
|
|
52
87
|
graph: z.string().optional(),
|
|
88
|
+
/** Node associated with this issue. */
|
|
53
89
|
node: z.string().optional(),
|
|
90
|
+
/** Trigger associated with this issue. */
|
|
54
91
|
trigger: z.string().optional(),
|
|
92
|
+
/** Port associated with this issue. */
|
|
55
93
|
port: z.string().optional(),
|
|
94
|
+
/** Edge index associated with this issue. */
|
|
56
95
|
edge: z.number().optional(),
|
|
57
96
|
}));
|
|
97
|
+
/** Run admission result, including replay/conflict, invalid input or refusal. */
|
|
58
98
|
export const runReply = z.lazy(() => z.union([
|
|
59
99
|
z.strictObject({
|
|
100
|
+
/** Admission, replay or request-conflict discriminator. */
|
|
60
101
|
kind: z.enum(["started", "replay", "conflict"]),
|
|
102
|
+
/** Identity of the run selected by admission. */
|
|
61
103
|
runId: identity,
|
|
104
|
+
/** Digest of the admitted plan. */
|
|
62
105
|
planDigest: identity,
|
|
63
106
|
}),
|
|
64
107
|
z.strictObject({
|
|
108
|
+
/** The run request failed validation. */
|
|
65
109
|
kind: z.literal("invalid"),
|
|
110
|
+
/** Validation issues explaining the refusal. */
|
|
66
111
|
issues: z.array(workflowIssueSchema),
|
|
67
112
|
}),
|
|
68
|
-
z.strictObject({
|
|
113
|
+
z.strictObject({
|
|
114
|
+
/** Host-authored invocation refusal. */
|
|
115
|
+
error: identity,
|
|
116
|
+
}),
|
|
69
117
|
]));
|
|
118
|
+
/** Cancellation result, an already-terminal run, or an authority refusal. */
|
|
70
119
|
export const cancelReplySchema = z.lazy(() => z.union([
|
|
71
|
-
z.strictObject({
|
|
72
|
-
|
|
73
|
-
|
|
120
|
+
z.strictObject({
|
|
121
|
+
/** Cancellation completed, or the run was already terminal. */
|
|
122
|
+
kind: z.enum(["cancelled", "terminal"]),
|
|
123
|
+
}),
|
|
124
|
+
z.strictObject({
|
|
125
|
+
/** The cancellation was refused. */
|
|
126
|
+
kind: z.literal("refused"),
|
|
127
|
+
/** Caller lacked authority to cancel the run. */
|
|
128
|
+
reason: z.literal("denied"),
|
|
129
|
+
}),
|
|
130
|
+
z.strictObject({
|
|
131
|
+
/** Host-authored invocation error. */
|
|
132
|
+
error: z.string(),
|
|
133
|
+
}),
|
|
74
134
|
]));
|
|
135
|
+
/** Lifecycle outcome reported for a Workflow run. */
|
|
75
136
|
export const runOutcomeSchema = z.enum(["active", "terminal", "cancelled"]);
|
|
137
|
+
/** Bounded run status snapshot with events, reviews, output and error. */
|
|
76
138
|
export const statusReply = z.lazy(() => z.union([
|
|
77
139
|
z.strictObject({
|
|
140
|
+
/** Identity of the inspected run. */
|
|
78
141
|
runId: identity,
|
|
142
|
+
/** Digest of the run's admitted plan. */
|
|
79
143
|
planDigest: identity,
|
|
144
|
+
/** Current run lifecycle outcome. */
|
|
80
145
|
outcome: runOutcomeSchema,
|
|
146
|
+
/** Human-readable run title. */
|
|
81
147
|
title: z.string().max(120),
|
|
148
|
+
/** Bounded run event records. */
|
|
82
149
|
events: z.array(z.record(z.string(), z.json())).max(4096),
|
|
150
|
+
/** Bounded review records associated with the run. */
|
|
83
151
|
reviews: z.array(z.record(z.string(), z.json())).max(256),
|
|
152
|
+
/** Run status label supplied by the host. */
|
|
84
153
|
status: identity,
|
|
154
|
+
/** JSON run output. */
|
|
85
155
|
output: z.json(),
|
|
156
|
+
/** JSON run error. */
|
|
86
157
|
error: z.json(),
|
|
87
158
|
}),
|
|
88
159
|
refusal,
|
|
89
160
|
]));
|
|
161
|
+
/** Result of answering a waiting run review, or an invocation refusal. */
|
|
90
162
|
export const answerReviewReply = z.lazy(() => z.union([
|
|
91
163
|
z.strictObject({
|
|
164
|
+
/** Acceptance, denial, absence of a waiting review or invalid answer. */
|
|
92
165
|
result: z.enum(["accepted", "denied", "not_waiting", "invalid"]),
|
|
93
166
|
}),
|
|
94
167
|
refusal,
|
|
95
168
|
]));
|
|
96
169
|
const id = z.string().min(1).max(256);
|
|
97
|
-
const denied = z.strictObject({
|
|
170
|
+
const denied = z.strictObject({
|
|
171
|
+
/** Host-authored invocation refusal. */
|
|
172
|
+
error: id,
|
|
173
|
+
});
|
|
174
|
+
/** Schedule-trigger admission or its refusal details. */
|
|
98
175
|
export const scheduleArmReplySchema = z.lazy(() => z.union([
|
|
99
|
-
z.strictObject({ kind: z.literal("armed"), scheduleId: id }),
|
|
100
176
|
z.strictObject({
|
|
177
|
+
/** Schedule-trigger registration was armed. */
|
|
178
|
+
kind: z.literal("armed"),
|
|
179
|
+
/** Identity of the armed schedule registration. */
|
|
180
|
+
scheduleId: id,
|
|
181
|
+
}),
|
|
182
|
+
z.strictObject({
|
|
183
|
+
/** Schedule-trigger registration was refused. */
|
|
101
184
|
kind: z.literal("refused"),
|
|
185
|
+
/** Host-authored reason for the refusal. */
|
|
102
186
|
reason: z.string(),
|
|
187
|
+
/** Optional validation issues associated with the trigger. */
|
|
103
188
|
issues: z.array(z.json()).optional(),
|
|
104
189
|
}),
|
|
105
190
|
denied,
|
|
106
191
|
]));
|
|
192
|
+
/** Trigger disarm result, including an absent trigger or denied invocation. */
|
|
107
193
|
export const triggerDisarmReplySchema = z.lazy(() => z.union([
|
|
108
|
-
z.strictObject({
|
|
194
|
+
z.strictObject({
|
|
195
|
+
/** Registration was disarmed or was already absent. */
|
|
196
|
+
kind: z.enum(["disarmed", "not_found"]),
|
|
197
|
+
}),
|
|
109
198
|
denied,
|
|
110
199
|
]));
|
|
200
|
+
/** Visible schedule-trigger rows with their next due time and lifecycle state. */
|
|
111
201
|
export const schedulesReplySchema = z.lazy(() => z.union([
|
|
112
202
|
z.strictObject({
|
|
203
|
+
/** Schedule-trigger registrations visible to this invocation. */
|
|
113
204
|
schedules: z.array(z.strictObject({
|
|
205
|
+
/** Identity of the schedule registration. */
|
|
114
206
|
scheduleId: id,
|
|
207
|
+
/** Installation owning the Workflow schedule and its control door. */
|
|
208
|
+
installationId: id,
|
|
209
|
+
/** Workflow whose published trigger was armed. */
|
|
115
210
|
workflowId: workflowIdSchema,
|
|
211
|
+
/** Trigger identity within the published definition. */
|
|
116
212
|
triggerId: id,
|
|
213
|
+
/** Next occurrence time in epoch milliseconds. */
|
|
117
214
|
nextDueAt: z.number().int(),
|
|
215
|
+
/** Current schedule lifecycle state. */
|
|
118
216
|
state: z.enum(["active", "paused", "cancelled", "finished"]),
|
|
217
|
+
/** Latest scheduling failure, or null when absent. */
|
|
119
218
|
lastError: z.string().nullable(),
|
|
120
219
|
})),
|
|
121
220
|
}),
|
|
122
221
|
denied,
|
|
123
222
|
]));
|
|
223
|
+
/** Origin category recorded for a run: manual, schedule, event, Agent or key. */
|
|
124
224
|
export const workflowRunSourceSchema = z.enum([
|
|
125
225
|
"manual",
|
|
126
226
|
"schedule",
|
|
@@ -130,52 +230,90 @@ export const workflowRunSourceSchema = z.enum([
|
|
|
130
230
|
]);
|
|
131
231
|
/** The Agent Session (`sessionId`) stays host-side; the wire names only the Agent/key and its grantor. */
|
|
132
232
|
export const workflowRunInitiatedBySchema = z.lazy(() => z.union([
|
|
133
|
-
z.strictObject({ kind: z.literal("member"), memberId: id }),
|
|
134
233
|
z.strictObject({
|
|
234
|
+
/** Run initiated directly by a member. */
|
|
235
|
+
kind: z.literal("member"),
|
|
236
|
+
/** Identity of the initiating member. */
|
|
237
|
+
memberId: id,
|
|
238
|
+
}),
|
|
239
|
+
z.strictObject({
|
|
240
|
+
/** Run initiated by an Agent. */
|
|
135
241
|
kind: z.literal("agent"),
|
|
242
|
+
/** Identity of the initiating Agent. */
|
|
136
243
|
agentId: id,
|
|
244
|
+
/** Member whose grant authorizes the invocation. */
|
|
137
245
|
grantorMemberId: id,
|
|
138
246
|
}),
|
|
139
247
|
z.strictObject({
|
|
248
|
+
/** Run initiated by a named key. */
|
|
140
249
|
kind: z.literal("key"),
|
|
250
|
+
/** Identity of the initiating key. */
|
|
141
251
|
keyId: id,
|
|
252
|
+
/** Member whose grant authorizes the invocation. */
|
|
142
253
|
grantorMemberId: id,
|
|
143
254
|
}),
|
|
144
255
|
]));
|
|
256
|
+
/** Bounded recent-run rows with their source, initiator and pinned commit. */
|
|
145
257
|
export const runsReplySchema = z.lazy(() => z.union([
|
|
146
258
|
z.strictObject({
|
|
259
|
+
/** Bounded recent runs visible to this invocation. */
|
|
147
260
|
runs: z
|
|
148
261
|
.array(z.strictObject({
|
|
262
|
+
/** Identity of the recorded run. */
|
|
149
263
|
runId: id,
|
|
264
|
+
/** Workflow selected by the run. */
|
|
150
265
|
workflowId: workflowIdSchema,
|
|
266
|
+
/** Exact published commit used by the run. */
|
|
151
267
|
commit: z.string(),
|
|
268
|
+
/** Origin category recorded at admission. */
|
|
152
269
|
source: workflowRunSourceSchema,
|
|
270
|
+
/** Published trigger that initiated the run, when applicable. */
|
|
153
271
|
triggerId: id.optional(),
|
|
272
|
+
/** Host-admitted initiating principal and grantor. */
|
|
154
273
|
initiatedBy: workflowRunInitiatedBySchema,
|
|
274
|
+
/** Run start timestamp. */
|
|
155
275
|
startedAt: z.number(),
|
|
156
276
|
}))
|
|
157
277
|
.max(50),
|
|
158
278
|
}),
|
|
159
279
|
denied,
|
|
160
280
|
]));
|
|
281
|
+
/** Event-trigger admission or its refusal details. */
|
|
161
282
|
export const eventArmReplySchema = z.lazy(() => z.union([
|
|
162
|
-
z.strictObject({ kind: z.literal("armed"), eventTriggerId: id }),
|
|
163
283
|
z.strictObject({
|
|
284
|
+
/** Event-trigger registration was armed. */
|
|
285
|
+
kind: z.literal("armed"),
|
|
286
|
+
/** Identity of the armed event registration. */
|
|
287
|
+
eventTriggerId: id,
|
|
288
|
+
}),
|
|
289
|
+
z.strictObject({
|
|
290
|
+
/** Event-trigger registration was refused. */
|
|
164
291
|
kind: z.literal("refused"),
|
|
292
|
+
/** Host-authored reason for the refusal. */
|
|
165
293
|
reason: z.string(),
|
|
294
|
+
/** Optional validation issues associated with the trigger. */
|
|
166
295
|
issues: z.array(z.json()).optional(),
|
|
167
296
|
}),
|
|
168
297
|
denied,
|
|
169
298
|
]));
|
|
299
|
+
/** Visible event-trigger rows with emitter, event and current state. */
|
|
170
300
|
export const eventTriggersReplySchema = z.lazy(() => z.union([
|
|
171
301
|
z.strictObject({
|
|
302
|
+
/** Event-trigger registrations visible to this invocation. */
|
|
172
303
|
eventTriggers: z.array(z.strictObject({
|
|
304
|
+
/** Identity of the event registration. */
|
|
173
305
|
eventTriggerId: id,
|
|
306
|
+
/** Workflow whose published trigger was armed. */
|
|
174
307
|
workflowId: workflowIdSchema,
|
|
308
|
+
/** Trigger identity within the published definition. */
|
|
175
309
|
triggerId: id,
|
|
310
|
+
/** Installation supplying the subscribed event. */
|
|
176
311
|
emitterInstallationId: id,
|
|
312
|
+
/** Declared event name. */
|
|
177
313
|
event: id,
|
|
314
|
+
/** Current event registration state. */
|
|
178
315
|
state: z.enum(["active", "paused"]),
|
|
316
|
+
/** Latest event-trigger failure, or null when absent. */
|
|
179
317
|
lastError: z.string().nullable(),
|
|
180
318
|
})),
|
|
181
319
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type WorkflowDefinition } from "@fungi.computer/braid";
|
|
2
2
|
import type { PublishedDefinitionPort, WorkflowPublicationContext } from "@fungi.computer/braid/runtime";
|
|
3
|
-
/** The
|
|
3
|
+
/** The installation identity and Git access read from the Workflow publication context. */
|
|
4
4
|
export type WorkflowPublishedDefinitionContext = Pick<WorkflowPublicationContext, "installationId" | "git">;
|
|
5
5
|
/**
|
|
6
6
|
* How a host reads one published Workflow definition back out of Git. The
|
|
@@ -8,6 +8,7 @@ export type WorkflowPublishedDefinitionContext = Pick<WorkflowPublicationContext
|
|
|
8
8
|
* port only wraps that read into the braid-shaped `PublishedDefinition`.
|
|
9
9
|
*/
|
|
10
10
|
export type WorkflowPublishedReader = Readonly<{
|
|
11
|
+
/** Read an exact published version or commit, or null when absent. */
|
|
11
12
|
published(workflowId: string, at: {
|
|
12
13
|
version: number;
|
|
13
14
|
} | {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
/** A registered repository App as the host reports it to the calling installation:
|
|
3
|
+
* read-only identity from the source owner and the live caller. Hosts and Apps
|
|
4
|
+
* share this wire; an App never imports the host package for it.
|
|
5
|
+
* Reading it neither registers a repository nor selects or runs a Computer. */
|
|
6
|
+
export declare const repositoryWorkflowSourceSchema: S.Struct<{
|
|
7
|
+
readonly appId: S.refine<import("@fungi.computer/puffball").AppId, S.String>;
|
|
8
|
+
readonly installationId: S.String;
|
|
9
|
+
readonly callerAppId: S.refine<import("@fungi.computer/puffball").AppId, S.String>;
|
|
10
|
+
readonly callerSourceRevision: S.refine<import("@fungi.computer/puffball").SourceRevision, S.String>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
import { appIdSchema, sourceRevisionSchema, } from "@fungi.computer/puffball/effect";
|
|
3
|
+
/** A registered repository App as the host reports it to the calling installation:
|
|
4
|
+
* read-only identity from the source owner and the live caller. Hosts and Apps
|
|
5
|
+
* share this wire; an App never imports the host package for it.
|
|
6
|
+
* Reading it neither registers a repository nor selects or runs a Computer. */
|
|
7
|
+
export const repositoryWorkflowSourceSchema = S.Struct({
|
|
8
|
+
appId: appIdSchema,
|
|
9
|
+
installationId: S.String.check(S.isMinLength(1), S.isMaxLength(256)),
|
|
10
|
+
callerAppId: appIdSchema,
|
|
11
|
+
callerSourceRevision: sourceRevisionSchema,
|
|
12
|
+
});
|
package/dist/run-contracts.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare const runListItemSchema: z.ZodLazy<z.ZodObject<{
|
|
|
35
35
|
grantorMemberId: z.ZodString;
|
|
36
36
|
}, z.core.$strict>]>>;
|
|
37
37
|
}, z.core.$strict>>;
|
|
38
|
+
/** Decoded run row with its pinned publication and display metadata. */
|
|
38
39
|
export type WorkflowRunListItem = z.output<typeof runListItemSchema>;
|
|
39
40
|
/**
|
|
40
41
|
* The calling member's own id, so the Runs UI can tell its own runs from a
|
|
@@ -46,4 +47,5 @@ export declare const viewerReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObje
|
|
|
46
47
|
}, z.core.$strict>, z.ZodObject<{
|
|
47
48
|
error: z.ZodString;
|
|
48
49
|
}, z.core.$strict>]>>;
|
|
50
|
+
/** Calling member identity, or a refusal returned by the viewer read. */
|
|
49
51
|
export type ViewerReply = z.output<typeof viewerReplySchema>;
|
|
@@ -4,6 +4,7 @@ export declare const runDeliverySchema: z.ZodObject<{
|
|
|
4
4
|
agentId: z.ZodString;
|
|
5
5
|
sessionId: z.ZodString;
|
|
6
6
|
}, z.core.$strict>;
|
|
7
|
+
/** Agent and Session selected to receive run endings. */
|
|
7
8
|
export type RunDelivery = z.output<typeof runDeliverySchema>;
|
|
8
9
|
/** One chat the member may choose for run reports: an existing Agent Session. */
|
|
9
10
|
export declare const chatsReplySchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -28,13 +29,17 @@ export declare const triggerTargetSchema: z.ZodLazy<z.ZodObject<{
|
|
|
28
29
|
sessionId: z.ZodString;
|
|
29
30
|
}, z.core.$strict>>;
|
|
30
31
|
}, z.core.$strict>>;
|
|
32
|
+
/** Identify the schedule-trigger registration to disarm. */
|
|
31
33
|
export declare const scheduleDisarmInputSchema: z.ZodObject<{
|
|
32
34
|
scheduleId: z.ZodString;
|
|
33
35
|
}, z.core.$strict>;
|
|
36
|
+
/** Identify the event-trigger registration to disarm. */
|
|
34
37
|
export declare const eventDisarmInputSchema: z.ZodObject<{
|
|
35
38
|
eventTriggerId: z.ZodString;
|
|
36
39
|
}, z.core.$strict>;
|
|
40
|
+
/** Trigger listing takes no caller-supplied filters. */
|
|
37
41
|
export declare const triggerListInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
42
|
+
/** Published trigger, pinned commit, selected bindings and optional run delivery. */
|
|
38
43
|
export type WorkflowTriggerTarget = z.output<typeof triggerTargetSchema>;
|
|
39
44
|
/** Host binding input carries the App-owned immutable row digest, never caller input. */
|
|
40
45
|
export type WorkflowTriggerArmTarget = WorkflowTriggerTarget & Readonly<{
|
|
@@ -22,6 +22,9 @@ export const triggerTargetSchema = z.lazy(() => z.strictObject({
|
|
|
22
22
|
bindings: bindingsSelectionSchema,
|
|
23
23
|
delivery: runDeliverySchema.optional(),
|
|
24
24
|
}));
|
|
25
|
+
/** Identify the schedule-trigger registration to disarm. */
|
|
25
26
|
export const scheduleDisarmInputSchema = z.strictObject({ scheduleId: id });
|
|
27
|
+
/** Identify the event-trigger registration to disarm. */
|
|
26
28
|
export const eventDisarmInputSchema = z.strictObject({ eventTriggerId: id });
|
|
29
|
+
/** Trigger listing takes no caller-supplied filters. */
|
|
27
30
|
export const triggerListInputSchema = z.strictObject({});
|
|
@@ -4,13 +4,14 @@ import * as S from "effect/Schema";
|
|
|
4
4
|
/**
|
|
5
5
|
* The read side of a Workflows library's Git layout, shared by the Workflows
|
|
6
6
|
* App and the hosts that read its published definitions: one repository,
|
|
7
|
-
* `
|
|
7
|
+
* `trellis`, one `workflows/<id>.json` file per Workflow (its definition
|
|
8
8
|
* plus `layout` and optional `provenance`), and one `<id>@v<n>` tag per
|
|
9
9
|
* published version on `main`'s ancestry.
|
|
10
10
|
*/
|
|
11
11
|
export declare const workflowLibraryRepository = "trellis";
|
|
12
12
|
/** Where one Workflow's file lives in its library repository. */
|
|
13
13
|
export declare const workflowFilePath: (id: string) => string;
|
|
14
|
+
/** Decode stored definition, node layout and optional import/fork provenance. */
|
|
14
15
|
export declare const workflowDraftSchema: S.Struct<{
|
|
15
16
|
readonly definition: S.Struct<{
|
|
16
17
|
readonly format: S.Literal<"fungi.workflow/v1">;
|
|
@@ -273,8 +274,10 @@ export declare const workflowDraftSchema: S.Struct<{
|
|
|
273
274
|
export type WorkflowDraft = typeof workflowDraftSchema.Type;
|
|
274
275
|
/** A Workflow file's content at the commit it was read from. */
|
|
275
276
|
export type WorkflowDocument = WorkflowDraft & {
|
|
277
|
+
/** Exact Git commit from which the document was read. */
|
|
276
278
|
readonly commit: string;
|
|
277
279
|
};
|
|
280
|
+
/** Read-only Git operations needed to traverse and decode library files. */
|
|
278
281
|
export type WorkflowReadGit = Pick<GitBinding, "readCommit" | "readTree" | "readBlob">;
|
|
279
282
|
/** Read the immediate Workflow directory without following symlinks or submodules. */
|
|
280
283
|
export declare function workflowFiles(git: WorkflowReadGit, commit: string | null): Promise<Readonly<{
|
|
@@ -6,7 +6,7 @@ import { provenanceSchema } from "./library-contracts.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* The read side of a Workflows library's Git layout, shared by the Workflows
|
|
8
8
|
* App and the hosts that read its published definitions: one repository,
|
|
9
|
-
* `
|
|
9
|
+
* `trellis`, one `workflows/<id>.json` file per Workflow (its definition
|
|
10
10
|
* plus `layout` and optional `provenance`), and one `<id>@v<n>` tag per
|
|
11
11
|
* published version on `main`'s ancestry.
|
|
12
12
|
*/
|
|
@@ -16,6 +16,7 @@ const emptyTree = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
|
16
16
|
/** Where one Workflow's file lives in its library repository. */
|
|
17
17
|
export const workflowFilePath = (id) => `workflows/${workflowIdSchema.parse(id)}.json`;
|
|
18
18
|
const layoutSchema = S.Record(S.String, S.Struct({ x: S.Finite, y: S.Finite }));
|
|
19
|
+
/** Decode stored definition, node layout and optional import/fork provenance. */
|
|
19
20
|
export const workflowDraftSchema = S.Struct({
|
|
20
21
|
definition: workflowDefinitionSchema,
|
|
21
22
|
layout: layoutSchema,
|