@sanity/workflow-engine 0.34.0 → 0.35.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.
- package/CHANGELOG.md +30 -0
- package/DATAMODEL.md +13 -0
- package/dist/_chunks-cjs/invariants.cjs +504 -2
- package/dist/_chunks-es/invariants.js +423 -1
- package/dist/index.cjs +254 -608
- package/dist/index.d.cts +79 -13
- package/dist/index.d.ts +79 -13
- package/dist/index.js +136 -492
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,405 +24,48 @@ function _interopNamespaceCompat(e) {
|
|
|
24
24
|
|
|
25
25
|
var v__namespace = /* @__PURE__ */ _interopNamespaceCompat(v);
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
return normalizeLegacyActivityRequirements(JSON.parse(instance.definitionSnapshot));
|
|
40
|
-
} catch (err) {
|
|
41
|
-
invariants.rethrowWithContext(err, `Failed to parse definitionSnapshot on instance "${instance._id}"`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function normalizeLegacyActivityRequirements(value) {
|
|
46
|
-
for (const stage of arrayMember(value, "stages")) for (const activity of arrayMember(stage, "activities")) normalizeLegacyRequirementMap(activity);
|
|
47
|
-
return value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function arrayMember(value, key) {
|
|
51
|
-
if (typeof value != "object" || value === null) return [];
|
|
52
|
-
const member = value[key];
|
|
53
|
-
return Array.isArray(member) ? member : [];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function normalizeLegacyRequirementMap(value) {
|
|
57
|
-
if (typeof value != "object" || value === null) return;
|
|
58
|
-
const activity = value, requirements = activity.requirements;
|
|
59
|
-
typeof requirements != "object" || requirements === null || Array.isArray(requirements) || (activity.requirements = Object.entries(requirements).map(([name, query]) => ({
|
|
60
|
-
type: "groq",
|
|
61
|
-
name: name,
|
|
62
|
-
query: query
|
|
63
|
-
})));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function parseDefinitionSnapshot(instance) {
|
|
67
|
-
return parseDefinitionSnapshotValue(instance);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function parentRef(instance) {
|
|
71
|
-
return instance.ancestors.at(-1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function effectiveEditable(baseline, override) {
|
|
75
|
-
if (baseline === void 0) return;
|
|
76
|
-
if (override === void 0) return baseline;
|
|
77
|
-
if (baseline === !0 && override === !0) return !0;
|
|
78
|
-
const parts = [ baseline, override ].map(e => e === !0 ? void 0 : e);
|
|
79
|
-
return invariants.andConditions(parts) ?? !0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const DEFAULT_EDIT_MODE = "set";
|
|
27
|
+
const EXECUTION_KINDS = {
|
|
28
|
+
interactive: "interactive",
|
|
29
|
+
server: "server",
|
|
30
|
+
cli: "cli",
|
|
31
|
+
mcp: "mcp",
|
|
32
|
+
drainer: "drainer",
|
|
33
|
+
script: "script",
|
|
34
|
+
test: "test",
|
|
35
|
+
studio: "studio",
|
|
36
|
+
sdkApp: "sdk"
|
|
37
|
+
};
|
|
83
38
|
|
|
84
|
-
function
|
|
85
|
-
|
|
39
|
+
function detectRuntime() {
|
|
40
|
+
const g = globalThis;
|
|
41
|
+
if (g.Deno !== void 0) return "deno";
|
|
42
|
+
if (g.Bun !== void 0) return "bun";
|
|
43
|
+
if (g.EdgeRuntime !== void 0) return "edge";
|
|
44
|
+
if (g.window !== void 0 && g.document !== void 0) return "browser";
|
|
45
|
+
if (g.WorkerGlobalScope !== void 0 && g.self !== void 0) return "worker";
|
|
46
|
+
const proc = g.process;
|
|
47
|
+
return typeof proc == "object" && proc !== null && typeof proc.versions?.node == "string" ? "node" : "unknown";
|
|
86
48
|
}
|
|
87
49
|
|
|
88
|
-
|
|
89
|
-
const sites = [];
|
|
90
|
-
for (const entry of definition.fields ?? []) sites.push({
|
|
91
|
-
scope: "workflow",
|
|
92
|
-
entry: entry
|
|
93
|
-
});
|
|
94
|
-
for (const entry of stage.fields ?? []) sites.push({
|
|
95
|
-
scope: "stage",
|
|
96
|
-
entry: entry
|
|
97
|
-
});
|
|
98
|
-
for (const activity of stage.activities ?? []) for (const entry of activity.fields ?? []) sites.push({
|
|
99
|
-
scope: "activity",
|
|
100
|
-
activity: activity.name,
|
|
101
|
-
entry: entry
|
|
102
|
-
});
|
|
103
|
-
return sites;
|
|
104
|
-
}
|
|
50
|
+
let inferredRuntime;
|
|
105
51
|
|
|
106
|
-
function
|
|
107
|
-
return {
|
|
108
|
-
|
|
109
|
-
...
|
|
110
|
-
|
|
111
|
-
} : {},
|
|
112
|
-
name: site.entry.name,
|
|
113
|
-
type: site.entry.type,
|
|
114
|
-
...site.entry.title !== void 0 ? {
|
|
115
|
-
title: site.entry.title
|
|
116
|
-
} : {},
|
|
117
|
-
...site.entry.validation !== void 0 ? {
|
|
118
|
-
validation: site.entry.validation
|
|
119
|
-
} : {},
|
|
120
|
-
...site.entry.roles !== void 0 ? {
|
|
121
|
-
roles: site.entry.roles
|
|
52
|
+
function resolveExecutionContext(declared) {
|
|
53
|
+
return inferredRuntime ??= detectRuntime(), {
|
|
54
|
+
runtime: inferredRuntime,
|
|
55
|
+
...declared?.kind !== void 0 ? {
|
|
56
|
+
kind: declared.kind
|
|
122
57
|
} : {},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
field: site.entry.name
|
|
126
|
-
},
|
|
127
|
-
effective: effectiveEditable(site.entry.editable, stage.editable?.[site.entry.name])
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function editableFieldsInStage(definition, stage) {
|
|
132
|
-
return fieldSites(definition, stage).filter(site => site.entry.editable !== void 0).map(site => resolveFieldSite(site, stage));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function editTargetMatches(site, target) {
|
|
136
|
-
return site.name !== target.field ? !1 : target.activity !== void 0 ? site.scope === "activity" && site.activity === target.activity : target.scope !== void 0 ? site.scope === target.scope : !0;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const SCOPE_PRECEDENCE = {
|
|
140
|
-
activity: 0,
|
|
141
|
-
stage: 1,
|
|
142
|
-
workflow: 2
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
function resolveEditTarget(args) {
|
|
146
|
-
const {definition: definition, stage: stage, target: target} = args, found = fieldSites(definition, stage).filter(site => editTargetMatches({
|
|
147
|
-
scope: site.scope,
|
|
148
|
-
name: site.entry.name,
|
|
149
|
-
...site.activity !== void 0 ? {
|
|
150
|
-
activity: site.activity
|
|
58
|
+
...declared?.id !== void 0 ? {
|
|
59
|
+
id: declared.id
|
|
151
60
|
} : {}
|
|
152
|
-
}, target)).sort((a, b) => SCOPE_PRECEDENCE[a.scope] - SCOPE_PRECEDENCE[b.scope])[0];
|
|
153
|
-
return found ? resolveFieldSite(found, stage) : void 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function fieldWindowOpen(instance, site) {
|
|
157
|
-
const terminal = terminalState(instance);
|
|
158
|
-
if (terminal !== "in-flight") return {
|
|
159
|
-
open: !1,
|
|
160
|
-
detail: `instance ${terminal}`
|
|
161
61
|
};
|
|
162
|
-
if (site.scope !== "activity") return {
|
|
163
|
-
open: !0
|
|
164
|
-
};
|
|
165
|
-
const status = invariants.findCurrentActivityEntry(instance, site.activity)?.status;
|
|
166
|
-
return status === "active" ? {
|
|
167
|
-
open: !0
|
|
168
|
-
} : {
|
|
169
|
-
open: !1,
|
|
170
|
-
detail: `activity "${site.activity}" is ${status ?? "not active"}`
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function readFieldValue(instance, site) {
|
|
175
|
-
return resolveFieldEntry$1(instance, site)?.value;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function resolveFieldEntry$1(instance, site) {
|
|
179
|
-
return fieldEntryHost(instance, site)?.find(e => e.name === site.name);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function fieldEntryHost(instance, site) {
|
|
183
|
-
if (site.scope === "workflow") return instance.fields;
|
|
184
|
-
const stageEntry = invariants.findOpenStageEntry(instance);
|
|
185
|
-
return site.scope === "stage" ? stageEntry?.fields : stageEntry?.activities.find(t => t.name === site.activity)?.fields;
|
|
186
62
|
}
|
|
187
63
|
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
...entry.actor !== void 0 ? {
|
|
193
|
-
actor: entry.actor
|
|
194
|
-
} : {}
|
|
64
|
+
function stampHistoryEntries(entries, stamp) {
|
|
65
|
+
return entries.map(entry => ({
|
|
66
|
+
...entry,
|
|
67
|
+
executionContext: stamp
|
|
195
68
|
}));
|
|
196
|
-
return latest === void 0 ? {} : {
|
|
197
|
-
...latest.actor !== void 0 ? {
|
|
198
|
-
setBy: latest.actor
|
|
199
|
-
} : {},
|
|
200
|
-
setAt: latest.at
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function editDisabledReason(args) {
|
|
205
|
-
const {effective: effective, instance: instance, window: window, guardDenial: guardDenial, predicateSatisfied: predicateSatisfied} = args;
|
|
206
|
-
if (effective === void 0) return {
|
|
207
|
-
kind: "not-editable"
|
|
208
|
-
};
|
|
209
|
-
if (!window.open) {
|
|
210
|
-
const terminalReason = instanceTerminalReason(instance);
|
|
211
|
-
return terminalReason !== void 0 ? terminalReason : {
|
|
212
|
-
kind: "edit-window-closed",
|
|
213
|
-
detail: window.detail ?? "closed"
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
if (guardDenial !== void 0) return guardDenial;
|
|
217
|
-
if (!predicateSatisfied) return {
|
|
218
|
-
kind: "editor-not-permitted",
|
|
219
|
-
predicate: effective === !0 ? "true" : effective
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function instanceTerminalReason(instance) {
|
|
224
|
-
const terminal = terminalState(instance);
|
|
225
|
-
if (terminal === "aborted" && instance.abortedAt !== void 0) return {
|
|
226
|
-
kind: "instance-aborted",
|
|
227
|
-
abortedAt: instance.abortedAt
|
|
228
|
-
};
|
|
229
|
-
if (terminal === "completed" && instance.completedAt !== void 0) return {
|
|
230
|
-
kind: "instance-completed",
|
|
231
|
-
completedAt: instance.completedAt
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function defineWorkflowEvent(options) {
|
|
236
|
-
return {
|
|
237
|
-
type: "log",
|
|
238
|
-
...options
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const noopTelemetry = {
|
|
243
|
-
log: () => {}
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
function resolveTelemetry(telemetry) {
|
|
247
|
-
return telemetry === void 0 ? noopTelemetry : {
|
|
248
|
-
log: (event, data) => {
|
|
249
|
-
try {
|
|
250
|
-
telemetry.log(event, data);
|
|
251
|
-
} catch (error) {
|
|
252
|
-
console.warn(`[workflow-engine] telemetry logger threw while logging "${event.name}" — event dropped`, error);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
const HIGH_FREQUENCY_SAMPLE_MS = 6e4, WorkflowDefinitionDeployed = defineWorkflowEvent({
|
|
259
|
-
name: "Workflows Definition Deployed",
|
|
260
|
-
version: 1,
|
|
261
|
-
description: "A definition went through a deploy — status distinguishes a newly minted version from an unchanged redeploy"
|
|
262
|
-
}), WorkflowInstanceStarted = defineWorkflowEvent({
|
|
263
|
-
name: "Workflows Instance Started",
|
|
264
|
-
version: 1,
|
|
265
|
-
description: "A workflow instance was started from a deployed definition"
|
|
266
|
-
}), WorkflowStageTransitioned = defineWorkflowEvent({
|
|
267
|
-
name: "Workflows Stage Transitioned",
|
|
268
|
-
version: 1,
|
|
269
|
-
description: "A committed stage move — one event per hop, cascades included, whichever verb drove it. Unsampled: funnel and dwell reads need complete counts, and volume is bounded by actual movement"
|
|
270
|
-
}), WorkflowActionFired = defineWorkflowEvent({
|
|
271
|
-
name: "Workflows Action Fired",
|
|
272
|
-
version: 1,
|
|
273
|
-
description: "An action was fired against an activity"
|
|
274
|
-
}), WorkflowFieldEdited = defineWorkflowEvent({
|
|
275
|
-
name: "Workflows Field Edited",
|
|
276
|
-
version: 1,
|
|
277
|
-
description: "A declared-editable field was edited through the generic edit seam",
|
|
278
|
-
maxSampleRate: HIGH_FREQUENCY_SAMPLE_MS
|
|
279
|
-
}), WorkflowInstanceTicked = defineWorkflowEvent({
|
|
280
|
-
name: "Workflows Instance Ticked",
|
|
281
|
-
version: 1,
|
|
282
|
-
description: "An instance was re-evaluated for auto-transitions and due waits",
|
|
283
|
-
maxSampleRate: HIGH_FREQUENCY_SAMPLE_MS
|
|
284
|
-
}), WorkflowEffectsDrained = defineWorkflowEvent({
|
|
285
|
-
name: "Workflows Effects Drained",
|
|
286
|
-
version: 1,
|
|
287
|
-
description: "A drain pass ran — drainedCount/drainedEffects report the successful dispatches. Unsampled when non-empty (outcome counts must be complete; volume is bounded by real effect work); empty polls are machine-cadence noise, throttled engine-side to at most one per minute"
|
|
288
|
-
}), WorkflowEffectStateReported = defineWorkflowEvent({
|
|
289
|
-
name: "Workflows Effect State Reported",
|
|
290
|
-
version: 1,
|
|
291
|
-
description: "A running effect handler committed mid-dispatch field state through commitEffectOps. Sampled (high-frequency by design — a dispatch may report many times): an adoption and usage signal, not an exact per-run report count",
|
|
292
|
-
maxSampleRate: HIGH_FREQUENCY_SAMPLE_MS
|
|
293
|
-
}), WorkflowEffectCompleted = defineWorkflowEvent({
|
|
294
|
-
name: "Workflows Effect Completed",
|
|
295
|
-
version: 1,
|
|
296
|
-
description: "An effect outcome was recorded — reported directly through completeEffect, or cancelled by the abort verb (external runtimes; engine-drained effects surface via Workflows Effects Drained instead — each outcome counts once)"
|
|
297
|
-
}), WorkflowInstanceAborted = defineWorkflowEvent({
|
|
298
|
-
name: "Workflows Instance Aborted",
|
|
299
|
-
version: 1,
|
|
300
|
-
description: "The abort admin override was invoked (changed: false = instance already terminal)"
|
|
301
|
-
}), WorkflowStageSet = defineWorkflowEvent({
|
|
302
|
-
name: "Workflows Stage Set",
|
|
303
|
-
version: 1,
|
|
304
|
-
description: "The set-stage admin override was invoked (changed: false = already at the target stage)"
|
|
305
|
-
}), WorkflowActivityReset = defineWorkflowEvent({
|
|
306
|
-
name: "Workflows Activity Reset",
|
|
307
|
-
version: 1,
|
|
308
|
-
description: "The reset-activity admin override was invoked (changed: false = already at the target status, or the instance was terminal)"
|
|
309
|
-
}), WorkflowDefinitionDeleted = defineWorkflowEvent({
|
|
310
|
-
name: "Workflows Definition Deleted",
|
|
311
|
-
version: 1,
|
|
312
|
-
description: "A deployed definition (or one version of it) was removed via the admin verb"
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
function definitionDeployedData(definition, outcome) {
|
|
316
|
-
const stages = definition.stages, activities = stages.flatMap(stage => stage.activities ?? []), actions = activities.flatMap(activity => activity.actions ?? []), transitions = stages.flatMap(stage => stage.transitions ?? []), fieldEntries2 = [ ...definition.fields ?? [], ...stages.flatMap(stage => stage.fields ?? []), ...activities.flatMap(activity => activity.fields ?? []) ];
|
|
317
|
-
return {
|
|
318
|
-
contentHash: outcome.contentHash,
|
|
319
|
-
status: outcome.status,
|
|
320
|
-
deployId: outcome.deployId,
|
|
321
|
-
stageCount: stages.length,
|
|
322
|
-
activityCount: activities.length,
|
|
323
|
-
actionCount: actions.length,
|
|
324
|
-
transitionCount: transitions.length,
|
|
325
|
-
fieldCount: fieldEntries2.length,
|
|
326
|
-
activityKinds: [ ...new Set(activities.map(invariants.deriveActivityKind)) ].sort(),
|
|
327
|
-
fieldKinds: [ ...new Set(fieldEntries2.map(entry => entry.type)) ].sort(),
|
|
328
|
-
guardCount: stages.reduce((n, stage) => n + (stage.guards ?? []).length, 0),
|
|
329
|
-
effectCount: actions.reduce((n, action) => n + (action.effects ?? []).length, 0),
|
|
330
|
-
subworkflowCount: actions.filter(action => action.spawn !== void 0).length,
|
|
331
|
-
lifecycle: definition.lifecycle ?? "standalone"
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
function definitionHashFragment(contentHash) {
|
|
336
|
-
return contentHash !== void 0 ? {
|
|
337
|
-
definitionContentHash: contentHash
|
|
338
|
-
} : {};
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
function instanceStartedData(args) {
|
|
342
|
-
return {
|
|
343
|
-
...definitionHashFragment(args.definition.contentHash),
|
|
344
|
-
instanceId: args.instanceId,
|
|
345
|
-
initialFieldCount: args.initialFieldCount,
|
|
346
|
-
viaSpawn: args.viaSpawn,
|
|
347
|
-
lifecycle: args.definition.lifecycle ?? "standalone"
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
function instanceStartedDataFor(args) {
|
|
352
|
-
return instanceStartedData({
|
|
353
|
-
definition: {
|
|
354
|
-
...parseDefinitionSnapshot(args.instance),
|
|
355
|
-
...args.instance.pinnedContentHash !== void 0 ? {
|
|
356
|
-
contentHash: args.instance.pinnedContentHash
|
|
357
|
-
} : {}
|
|
358
|
-
},
|
|
359
|
-
instanceId: args.instance._id,
|
|
360
|
-
initialFieldCount: args.initialFieldCount,
|
|
361
|
-
viaSpawn: args.viaSpawn
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
function stageTransitionedData(args) {
|
|
366
|
-
const stageIndex = name => args.definition.stages.findIndex(stage => stage.name === name), openEntry = invariants.findOpenStageEntry(args.instance), dwellMs = openEntry !== void 0 ? Date.parse(args.at) - Date.parse(openEntry.enteredAt) : Number.NaN;
|
|
367
|
-
return {
|
|
368
|
-
...definitionHashFragment(args.instance.pinnedContentHash),
|
|
369
|
-
instanceId: args.instance._id,
|
|
370
|
-
fromStageIndex: stageIndex(args.instance.currentStage),
|
|
371
|
-
toStageIndex: stageIndex(args.toStage),
|
|
372
|
-
toIsTerminal: args.toIsTerminal,
|
|
373
|
-
isRevisit: args.instance.stages.some(entry => entry.name === args.toStage),
|
|
374
|
-
...Number.isFinite(dwellMs) ? {
|
|
375
|
-
dwellMs: dwellMs
|
|
376
|
-
} : {},
|
|
377
|
-
via: args.via
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function openStage$1(instance) {
|
|
382
|
-
const definition = parseDefinitionSnapshot(instance);
|
|
383
|
-
return {
|
|
384
|
-
definition: definition,
|
|
385
|
-
stage: definition.stages.find(s => s.name === instance.currentStage)
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
function firedActivityKind(instance, activity) {
|
|
390
|
-
const node = openStage$1(instance).stage?.activities?.find(a => a.name === activity);
|
|
391
|
-
return node === void 0 ? void 0 : invariants.deriveActivityKind(node);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
function editedFieldKind(instance, target) {
|
|
395
|
-
const {definition: definition, stage: stage} = openStage$1(instance);
|
|
396
|
-
return stage === void 0 ? void 0 : resolveEditTarget({
|
|
397
|
-
definition: definition,
|
|
398
|
-
stage: stage,
|
|
399
|
-
target: target
|
|
400
|
-
})?.type;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
function actionFiredData(args) {
|
|
404
|
-
const kind = firedActivityKind(args.instance, args.activity);
|
|
405
|
-
return {
|
|
406
|
-
...definitionHashFragment(args.instance.pinnedContentHash),
|
|
407
|
-
instanceId: args.instance._id,
|
|
408
|
-
...kind !== void 0 ? {
|
|
409
|
-
activityKind: kind
|
|
410
|
-
} : {},
|
|
411
|
-
hasParams: args.params !== void 0,
|
|
412
|
-
cascaded: args.cascaded
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
function fieldEditedData(args) {
|
|
417
|
-
const kind = editedFieldKind(args.instance, args.target);
|
|
418
|
-
return {
|
|
419
|
-
...definitionHashFragment(args.instance.pinnedContentHash),
|
|
420
|
-
instanceId: args.instance._id,
|
|
421
|
-
...kind !== void 0 ? {
|
|
422
|
-
fieldKind: kind
|
|
423
|
-
} : {},
|
|
424
|
-
mode: args.mode ?? DEFAULT_EDIT_MODE
|
|
425
|
-
};
|
|
426
69
|
}
|
|
427
70
|
|
|
428
71
|
function effectSites(def) {
|
|
@@ -1420,7 +1063,7 @@ function stageSites(stage, definition) {
|
|
|
1420
1063
|
condition: transition.when
|
|
1421
1064
|
});
|
|
1422
1065
|
for (const activity of stage.activities ?? []) sites.push(...activitySites(activity, stage.name));
|
|
1423
|
-
for (const site of editableFieldsInStage(definition, stage)) typeof site.effective == "string" && sites.push({
|
|
1066
|
+
for (const site of invariants.editableFieldsInStage(definition, stage)) typeof site.effective == "string" && sites.push({
|
|
1424
1067
|
stage: stage.name,
|
|
1425
1068
|
address: {
|
|
1426
1069
|
kind: "editable-field",
|
|
@@ -2125,7 +1768,7 @@ function isAssignmentListModel(modelVersion) {
|
|
|
2125
1768
|
|
|
2126
1769
|
function definitionAssignmentModel(instance) {
|
|
2127
1770
|
if (typeof instance.definitionSnapshot != "string") return 0;
|
|
2128
|
-
const modelVersion = parseDefinitionSnapshotValue({
|
|
1771
|
+
const modelVersion = invariants.parseDefinitionSnapshotValue({
|
|
2129
1772
|
_id: instance._id,
|
|
2130
1773
|
definitionSnapshot: instance.definitionSnapshot
|
|
2131
1774
|
}).modelVersion;
|
|
@@ -2298,7 +1941,7 @@ function buildParams(args) {
|
|
|
2298
1941
|
return {
|
|
2299
1942
|
self: invariants.selfGdr(instance),
|
|
2300
1943
|
fields: renderedFields(instance.fields ?? [], snapshot),
|
|
2301
|
-
parent: parentRef(instance)?.id ?? null,
|
|
1944
|
+
parent: invariants.parentRef(instance)?.id ?? null,
|
|
2302
1945
|
ancestors: instance.ancestors.map(a => a.id),
|
|
2303
1946
|
stage: instance.currentStage,
|
|
2304
1947
|
now: now,
|
|
@@ -3968,7 +3611,7 @@ function nestedFieldEntries(entries) {
|
|
|
3968
3611
|
}
|
|
3969
3612
|
|
|
3970
3613
|
function parsedDefinitionSnapshot(root) {
|
|
3971
|
-
if (typeof root.definitionSnapshot == "string") return recordOf(parseDefinitionSnapshotValue({
|
|
3614
|
+
if (typeof root.definitionSnapshot == "string") return recordOf(invariants.parseDefinitionSnapshotValue({
|
|
3972
3615
|
_id: typeof root._id == "string" ? root._id : "<unknown instance>",
|
|
3973
3616
|
definitionSnapshot: root.definitionSnapshot
|
|
3974
3617
|
}));
|
|
@@ -4462,7 +4105,7 @@ function documentStuckCause(args) {
|
|
|
4462
4105
|
}
|
|
4463
4106
|
|
|
4464
4107
|
function diagnoseInstance(input) {
|
|
4465
|
-
const {instance: instance} = input, terminal = terminalState(instance);
|
|
4108
|
+
const {instance: instance} = input, terminal = invariants.terminalState(instance);
|
|
4466
4109
|
if (terminal === "aborted" && instance.abortedAt !== void 0) {
|
|
4467
4110
|
const reason = abortReason(instance);
|
|
4468
4111
|
return {
|
|
@@ -4758,50 +4401,6 @@ function assertRoleConstrainedAssignmentResource(args) {
|
|
|
4758
4401
|
if (hasRoleConstrainedAssignments(args.definition) && args.workflowResource.type !== "dataset") throw new Error(`${args.context}: definition "${args.definition.name}" uses role-constrained assignment fields, which require a dataset workflow resource; received resource type "${args.workflowResource.type}"`);
|
|
4759
4402
|
}
|
|
4760
4403
|
|
|
4761
|
-
const EXECUTION_KINDS = {
|
|
4762
|
-
interactive: "interactive",
|
|
4763
|
-
server: "server",
|
|
4764
|
-
cli: "cli",
|
|
4765
|
-
mcp: "mcp",
|
|
4766
|
-
drainer: "drainer",
|
|
4767
|
-
script: "script",
|
|
4768
|
-
test: "test",
|
|
4769
|
-
studio: "studio",
|
|
4770
|
-
sdkApp: "sdk-app"
|
|
4771
|
-
};
|
|
4772
|
-
|
|
4773
|
-
function detectRuntime() {
|
|
4774
|
-
const g = globalThis;
|
|
4775
|
-
if (g.Deno !== void 0) return "deno";
|
|
4776
|
-
if (g.Bun !== void 0) return "bun";
|
|
4777
|
-
if (g.EdgeRuntime !== void 0) return "edge";
|
|
4778
|
-
if (g.window !== void 0 && g.document !== void 0) return "browser";
|
|
4779
|
-
if (g.WorkerGlobalScope !== void 0 && g.self !== void 0) return "worker";
|
|
4780
|
-
const proc = g.process;
|
|
4781
|
-
return typeof proc == "object" && proc !== null && typeof proc.versions?.node == "string" ? "node" : "unknown";
|
|
4782
|
-
}
|
|
4783
|
-
|
|
4784
|
-
let inferredRuntime;
|
|
4785
|
-
|
|
4786
|
-
function resolveExecutionContext(declared) {
|
|
4787
|
-
return inferredRuntime ??= detectRuntime(), {
|
|
4788
|
-
runtime: inferredRuntime,
|
|
4789
|
-
...declared?.kind !== void 0 ? {
|
|
4790
|
-
kind: declared.kind
|
|
4791
|
-
} : {},
|
|
4792
|
-
...declared?.id !== void 0 ? {
|
|
4793
|
-
id: declared.id
|
|
4794
|
-
} : {}
|
|
4795
|
-
};
|
|
4796
|
-
}
|
|
4797
|
-
|
|
4798
|
-
function stampHistoryEntries(entries, stamp) {
|
|
4799
|
-
return entries.map(entry => ({
|
|
4800
|
-
...entry,
|
|
4801
|
-
executionContext: stamp
|
|
4802
|
-
}));
|
|
4803
|
-
}
|
|
4804
|
-
|
|
4805
4404
|
function collectWatchRefs(instance) {
|
|
4806
4405
|
return [ invariants.gdrRef({
|
|
4807
4406
|
res: instance.workflowResource,
|
|
@@ -4855,7 +4454,7 @@ function liveSubworkflowRefs(instance) {
|
|
|
4855
4454
|
}
|
|
4856
4455
|
|
|
4857
4456
|
function readsRaw(ref) {
|
|
4858
|
-
return ref.type === WORKFLOW_INSTANCE_TYPE || ref.type === "system.release";
|
|
4457
|
+
return ref.type === invariants.WORKFLOW_INSTANCE_TYPE || ref.type === "system.release";
|
|
4859
4458
|
}
|
|
4860
4459
|
|
|
4861
4460
|
const DEFAULT_CONTENT_PERSPECTIVE = "drafts";
|
|
@@ -5737,7 +5336,7 @@ const TransitionVia = v__namespace.exactOptional(v__namespace.picklist([ "transi
|
|
|
5737
5336
|
_type: v__namespace.pipe(v__namespace.string(), v__namespace.check(t => !knownHistoryTypes.has(t), "must not shadow a known history variant"))
|
|
5738
5337
|
}), HistoryEntrySchema = v__namespace.union([ v__namespace.variant("_type", HISTORY_ARMS), UnknownHistoryEntry ]), WorkflowInstanceSchema = v__namespace.looseObject(invariants.tolerantEntries()({
|
|
5739
5338
|
_id: NonEmpty,
|
|
5740
|
-
_type: v__namespace.literal(WORKFLOW_INSTANCE_TYPE),
|
|
5339
|
+
_type: v__namespace.literal(invariants.WORKFLOW_INSTANCE_TYPE),
|
|
5741
5340
|
_rev: v__namespace.string(),
|
|
5742
5341
|
_createdAt: invariants.IsoTimestamp,
|
|
5743
5342
|
_updatedAt: invariants.IsoTimestamp,
|
|
@@ -5770,7 +5369,7 @@ function parseInstanceDocument(doc) {
|
|
|
5770
5369
|
return invariants.parsePersistedDoc({
|
|
5771
5370
|
schema: WorkflowInstanceSchema,
|
|
5772
5371
|
doc: doc,
|
|
5773
|
-
docType: WORKFLOW_INSTANCE_TYPE
|
|
5372
|
+
docType: invariants.WORKFLOW_INSTANCE_TYPE
|
|
5774
5373
|
});
|
|
5775
5374
|
}
|
|
5776
5375
|
|
|
@@ -5779,7 +5378,7 @@ const WorkflowInstancePreviewEffectSchema = invariants.tolerantObject()({
|
|
|
5779
5378
|
title: v__namespace.exactOptional(v__namespace.string())
|
|
5780
5379
|
}), WorkflowInstancePreviewSchema = v__namespace.looseObject(invariants.tolerantEntries()({
|
|
5781
5380
|
_id: NonEmpty,
|
|
5782
|
-
_type: v__namespace.literal(WORKFLOW_INSTANCE_TYPE),
|
|
5381
|
+
_type: v__namespace.literal(invariants.WORKFLOW_INSTANCE_TYPE),
|
|
5783
5382
|
modelVersion: v__namespace.exactOptional(v__namespace.number()),
|
|
5784
5383
|
minReaderModel: v__namespace.exactOptional(v__namespace.number()),
|
|
5785
5384
|
workflowResource: WorkflowResourceSchema,
|
|
@@ -5801,7 +5400,7 @@ function parseInstancePreviewDocument(doc) {
|
|
|
5801
5400
|
return invariants.parsePersistedDoc({
|
|
5802
5401
|
schema: WorkflowInstancePreviewSchema,
|
|
5803
5402
|
doc: doc,
|
|
5804
|
-
docType: WORKFLOW_INSTANCE_TYPE
|
|
5403
|
+
docType: invariants.WORKFLOW_INSTANCE_TYPE
|
|
5805
5404
|
});
|
|
5806
5405
|
}
|
|
5807
5406
|
|
|
@@ -6354,7 +5953,7 @@ function buildInstanceBase(args) {
|
|
|
6354
5953
|
} : {}
|
|
6355
5954
|
}, ...args.extraHistory ?? [] ], history = executionContext !== void 0 ? stampHistoryEntries(entries, executionContext) : entries, body = {
|
|
6356
5955
|
_id: id,
|
|
6357
|
-
_type: WORKFLOW_INSTANCE_TYPE,
|
|
5956
|
+
_type: invariants.WORKFLOW_INSTANCE_TYPE,
|
|
6358
5957
|
_rev: "",
|
|
6359
5958
|
_createdAt: now,
|
|
6360
5959
|
_updatedAt: now,
|
|
@@ -6506,7 +6105,7 @@ async function readBatch(args) {
|
|
|
6506
6105
|
}
|
|
6507
6106
|
|
|
6508
6107
|
function validateRawDoc(doc, perspective) {
|
|
6509
|
-
return perspective !== "raw" ? doc : doc._type === WORKFLOW_INSTANCE_TYPE ? readInstanceDoc(doc) : assertReadableModel(doc);
|
|
6108
|
+
return perspective !== "raw" ? doc : doc._type === invariants.WORKFLOW_INSTANCE_TYPE ? readInstanceDoc(doc) : assertReadableModel(doc);
|
|
6510
6109
|
}
|
|
6511
6110
|
|
|
6512
6111
|
function groupReads(reads) {
|
|
@@ -6594,7 +6193,7 @@ async function loadContext({client: client, instanceId: instanceId, options: opt
|
|
|
6594
6193
|
clientForGdr: options.clientForGdr,
|
|
6595
6194
|
refSurface: options.refSurface,
|
|
6596
6195
|
instance: instance,
|
|
6597
|
-
definition: parseDefinitionSnapshot(instance),
|
|
6196
|
+
definition: invariants.parseDefinitionSnapshot(instance),
|
|
6598
6197
|
...options.actor !== void 0 ? {
|
|
6599
6198
|
actor: options.actor
|
|
6600
6199
|
} : {},
|
|
@@ -6670,7 +6269,7 @@ async function buildEngineContext(args) {
|
|
|
6670
6269
|
clock: clock,
|
|
6671
6270
|
now: clock(),
|
|
6672
6271
|
executionContext: resolveExecutionContext(args.executionContext),
|
|
6673
|
-
telemetry: resolveTelemetry(args.telemetry),
|
|
6272
|
+
telemetry: invariants.resolveTelemetry(args.telemetry),
|
|
6674
6273
|
...args.settlingCohorts !== void 0 ? {
|
|
6675
6274
|
settlingCohorts: args.settlingCohorts
|
|
6676
6275
|
} : {},
|
|
@@ -7602,8 +7201,9 @@ async function commitAbort({ctx: ctx, reason: reason, requestRecord: requestReco
|
|
|
7602
7201
|
now: ctx.now,
|
|
7603
7202
|
snapshot: ctx.snapshot
|
|
7604
7203
|
});
|
|
7605
|
-
for (const {effect: effect, origin: origin} of cancelled) ctx.telemetry.log(WorkflowEffectCompleted, {
|
|
7606
|
-
...
|
|
7204
|
+
for (const {effect: effect, origin: origin} of cancelled) ctx.telemetry.log(invariants.WorkflowEffectCompleted, {
|
|
7205
|
+
...invariants.executionContextFragment(ctx.executionContext),
|
|
7206
|
+
...invariants.definitionHashFragment(ctx.instance.pinnedContentHash),
|
|
7607
7207
|
instanceId: ctx.instance._id,
|
|
7608
7208
|
effect: effect,
|
|
7609
7209
|
status: "cancelled",
|
|
@@ -7887,7 +7487,7 @@ async function spawnRow({ctx: ctx, mutation: mutation, activity: activity, actio
|
|
|
7887
7487
|
});
|
|
7888
7488
|
mutation.pendingCreates.push({
|
|
7889
7489
|
body: body,
|
|
7890
|
-
started: instanceStartedData({
|
|
7490
|
+
started: invariants.instanceStartedData({
|
|
7891
7491
|
definition: definition,
|
|
7892
7492
|
instanceId: body._id,
|
|
7893
7493
|
initialFieldCount: initialFields.length,
|
|
@@ -8108,10 +7708,10 @@ async function resolveDefinitionRef({client: client, ref: ref, tag: tag}) {
|
|
|
8108
7708
|
async function prepareChildInstance(args) {
|
|
8109
7709
|
const {client: client, parent: parent, definition: definition, initialFields: initialFields, context: context, actor: actor, now: now, refSurface: refSurface, memberRolesLoader: memberRolesLoader} = args, childTag = parent.tag, workflowResource = parent.workflowResource, childDocId = instanceDocId(childTag), childRef = {
|
|
8110
7710
|
id: invariants.gdrFromResource(workflowResource, childDocId),
|
|
8111
|
-
type: WORKFLOW_INSTANCE_TYPE
|
|
7711
|
+
type: invariants.WORKFLOW_INSTANCE_TYPE
|
|
8112
7712
|
}, ancestors = [ ...parent.ancestors, {
|
|
8113
7713
|
id: invariants.selfGdr(parent),
|
|
8114
|
-
type: WORKFLOW_INSTANCE_TYPE
|
|
7714
|
+
type: invariants.WORKFLOW_INSTANCE_TYPE
|
|
8115
7715
|
} ], inheritedPerspective = parent.perspective, fieldDiscards = [], memberRoles = await memberRolesLoader({
|
|
8116
7716
|
workflowResource: workflowResource,
|
|
8117
7717
|
definition: definition
|
|
@@ -8298,14 +7898,17 @@ async function commitStageMove({ctx: ctx, mutation: mutation, fromStage: fromSta
|
|
|
8298
7898
|
}
|
|
8299
7899
|
|
|
8300
7900
|
function emitStageTransitioned({ctx: ctx, nextStage: nextStage, at: at, via: via}) {
|
|
8301
|
-
ctx.telemetry.log(WorkflowStageTransitioned,
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
7901
|
+
ctx.telemetry.log(invariants.WorkflowStageTransitioned, {
|
|
7902
|
+
...invariants.executionContextFragment(ctx.executionContext),
|
|
7903
|
+
...invariants.stageTransitionedData({
|
|
7904
|
+
instance: ctx.instance,
|
|
7905
|
+
definition: ctx.definition,
|
|
7906
|
+
toStage: nextStage.name,
|
|
7907
|
+
toIsTerminal: isTerminalStage(nextStage),
|
|
7908
|
+
at: at,
|
|
7909
|
+
via: via
|
|
7910
|
+
})
|
|
7911
|
+
});
|
|
8309
7912
|
}
|
|
8310
7913
|
|
|
8311
7914
|
function exitOpenStage({mutation: mutation, stage: stage, at: at}) {
|
|
@@ -9261,7 +8864,7 @@ async function runCascadeHop({client: client, instanceId: instanceId, actor: act
|
|
|
9261
8864
|
return preloadedInstance = void 0, buildEngineContext({
|
|
9262
8865
|
client: client,
|
|
9263
8866
|
instance: loaded,
|
|
9264
|
-
definition: parseDefinitionSnapshot(loaded),
|
|
8867
|
+
definition: invariants.parseDefinitionSnapshot(loaded),
|
|
9265
8868
|
...contextOptions
|
|
9266
8869
|
});
|
|
9267
8870
|
},
|
|
@@ -9473,7 +9076,7 @@ async function loadInstancesById(client, ids) {
|
|
|
9473
9076
|
const children = await client.fetch("*[_id in $ids]", {
|
|
9474
9077
|
ids: ids
|
|
9475
9078
|
});
|
|
9476
|
-
return new Map(children.filter(child => child._type === WORKFLOW_INSTANCE_TYPE).map(child => {
|
|
9079
|
+
return new Map(children.filter(child => child._type === invariants.WORKFLOW_INSTANCE_TYPE).map(child => {
|
|
9477
9080
|
const instance = readInstanceDoc(child);
|
|
9478
9081
|
return [ instance._id, instance ];
|
|
9479
9082
|
}));
|
|
@@ -9533,10 +9136,10 @@ async function propagateToAncestors(args) {
|
|
|
9533
9136
|
async function loadPropagationPair({client: client, instanceId: instanceId, instance: instance}) {
|
|
9534
9137
|
const child = instance ?? await getInstanceDocument(client, instanceId);
|
|
9535
9138
|
if (!child) return;
|
|
9536
|
-
const parentGdr = parentRef(child);
|
|
9139
|
+
const parentGdr = invariants.parentRef(child);
|
|
9537
9140
|
if (parentGdr === void 0) return;
|
|
9538
9141
|
const parentDoc = await client.getDocument(invariants.toBareId(parentGdr.id));
|
|
9539
|
-
if (!(!parentDoc || parentDoc._type !== WORKFLOW_INSTANCE_TYPE)) return {
|
|
9142
|
+
if (!(!parentDoc || parentDoc._type !== invariants.WORKFLOW_INSTANCE_TYPE)) return {
|
|
9540
9143
|
child: child,
|
|
9541
9144
|
parent: readInstanceDoc(parentDoc)
|
|
9542
9145
|
};
|
|
@@ -9563,7 +9166,7 @@ async function buildCascadeStepContext(args, instance) {
|
|
|
9563
9166
|
clientForGdr: args.clientForGdr,
|
|
9564
9167
|
refSurface: args.refSurface,
|
|
9565
9168
|
instance: instance,
|
|
9566
|
-
definition: parseDefinitionSnapshot(instance),
|
|
9169
|
+
definition: invariants.parseDefinitionSnapshot(instance),
|
|
9567
9170
|
...args.clock ? {
|
|
9568
9171
|
clock: args.clock
|
|
9569
9172
|
} : {},
|
|
@@ -9615,7 +9218,7 @@ function stampSpawnBatch({mutation: mutation, parent: parent, children: children
|
|
|
9615
9218
|
function requireSpawnBatchChild({parent: parent, children: children, childId: childId}) {
|
|
9616
9219
|
const child = children.get(childId);
|
|
9617
9220
|
if (child === void 0) throw new Error(`Spawn batch child ${childId} disappeared`);
|
|
9618
|
-
const expectedParent = parentRef(child);
|
|
9221
|
+
const expectedParent = invariants.parentRef(child);
|
|
9619
9222
|
if (expectedParent === void 0 || invariants.toBareId(expectedParent.id) !== parent._id) throw new Error(`Spawn batch child ${childId} does not belong to parent ${parent._id}`);
|
|
9620
9223
|
return child;
|
|
9621
9224
|
}
|
|
@@ -9638,7 +9241,7 @@ async function recordOrphanedPropagation({ctx: ctx, mutation: mutation, child: c
|
|
|
9638
9241
|
at: ctx.now,
|
|
9639
9242
|
instanceRef: {
|
|
9640
9243
|
id: childUri,
|
|
9641
|
-
type: WORKFLOW_INSTANCE_TYPE
|
|
9244
|
+
type: invariants.WORKFLOW_INSTANCE_TYPE
|
|
9642
9245
|
},
|
|
9643
9246
|
detail: `Instance "${child._id}" names this instance as its parent but no subworkflow-registry row matches it, so its state cannot drive any gate here.`
|
|
9644
9247
|
}), await persist(ctx, mutation));
|
|
@@ -9786,7 +9389,10 @@ async function persist(ctx, mutation) {
|
|
|
9786
9389
|
actor: actorForPriming,
|
|
9787
9390
|
settlingCohorts: settlingCohorts
|
|
9788
9391
|
});
|
|
9789
|
-
for (const {started: started} of pendingCreates) ctx.telemetry.log(WorkflowInstanceStarted,
|
|
9392
|
+
for (const {started: started} of pendingCreates) ctx.telemetry.log(invariants.WorkflowInstanceStarted, {
|
|
9393
|
+
...invariants.executionContextFragment(ctx.executionContext),
|
|
9394
|
+
...started
|
|
9395
|
+
});
|
|
9790
9396
|
const reloaded = await getInstanceDocument(ctx.client, ctx.instance._id);
|
|
9791
9397
|
if (!reloaded) throw new Error(`Instance ${ctx.instance._id} disappeared after transaction commit`);
|
|
9792
9398
|
return reloaded;
|
|
@@ -10478,7 +10084,7 @@ async function whatIfFireAction(args) {
|
|
|
10478
10084
|
|
|
10479
10085
|
function replayable(args) {
|
|
10480
10086
|
const {instance: instance, stage: stage, action: action} = args;
|
|
10481
|
-
if (terminalState(instance) !== "in-flight" || (action.params ?? []).length > 0 || action.spawn !== void 0) return !1;
|
|
10087
|
+
if (invariants.terminalState(instance) !== "in-flight" || (action.params ?? []).length > 0 || action.spawn !== void 0) return !1;
|
|
10482
10088
|
const primed = new Set((invariants.findOpenStageEntry(instance)?.activities ?? []).map(e => e.name));
|
|
10483
10089
|
return (stage.activities ?? []).every(declared => primed.has(declared.name)) ? !(stage.activities ?? []).flatMap(declared => declared.actions ?? []).some(sibling => invariants.isCascadeFired(sibling) && sibling.spawn !== void 0) : !1;
|
|
10484
10090
|
}
|
|
@@ -10623,7 +10229,7 @@ function contentTargets({atoms: atoms, fields: fields, activity: activity}) {
|
|
|
10623
10229
|
entry: field.entry,
|
|
10624
10230
|
read: read,
|
|
10625
10231
|
atom: atom
|
|
10626
|
-
}) ? [ _fieldTargetLabel(field.target) ] : [];
|
|
10232
|
+
}) ? [ invariants._fieldTargetLabel(field.target) ] : [];
|
|
10627
10233
|
}));
|
|
10628
10234
|
}
|
|
10629
10235
|
|
|
@@ -10650,8 +10256,8 @@ async function blockingMissingDocuments(args) {
|
|
|
10650
10256
|
atoms: await blockingAtoms(condition, args),
|
|
10651
10257
|
fields: fields,
|
|
10652
10258
|
activity: condition.activity
|
|
10653
|
-
})))).flat(), blocked = /* @__PURE__ */ new Set([ ...targets, ...missingRequiredDocuments(args).map(({target: target}) => _fieldTargetLabel(target)) ]);
|
|
10654
|
-
return args.missingDocuments.filter(({target: target}) => blocked.has(_fieldTargetLabel(target)));
|
|
10259
|
+
})))).flat(), blocked = /* @__PURE__ */ new Set([ ...targets, ...missingRequiredDocuments(args).map(({target: target}) => invariants._fieldTargetLabel(target)) ]);
|
|
10260
|
+
return args.missingDocuments.filter(({target: target}) => blocked.has(invariants._fieldTargetLabel(target)));
|
|
10655
10261
|
}
|
|
10656
10262
|
|
|
10657
10263
|
async function subjectResourceGrants(args) {
|
|
@@ -10696,7 +10302,7 @@ async function evaluateInstance(args) {
|
|
|
10696
10302
|
client: client,
|
|
10697
10303
|
instanceId: instanceId,
|
|
10698
10304
|
tag: tag
|
|
10699
|
-
}), resolveUserAttributes(client) ]), {actor: actor, grants: grants, localPrincipalId: localPrincipalId} = access, definition = parseDefinitionSnapshot(instance), clientForGdr = buildClientForGdr({
|
|
10305
|
+
}), resolveUserAttributes(client) ]), {actor: actor, grants: grants, localPrincipalId: localPrincipalId} = access, definition = invariants.parseDefinitionSnapshot(instance), clientForGdr = buildClientForGdr({
|
|
10700
10306
|
client: client,
|
|
10701
10307
|
workflowResource: workflowResource,
|
|
10702
10308
|
resourceClients: resourceClients
|
|
@@ -10760,7 +10366,7 @@ async function callerBoundProjectionScopes(args) {
|
|
|
10760
10366
|
}
|
|
10761
10367
|
|
|
10762
10368
|
function clockSitesOf(instance, sites) {
|
|
10763
|
-
return terminalState(instance) !== "in-flight" ? [] : sites.filter(entry => readsNowIn(entry.insight.analysis.reads));
|
|
10369
|
+
return invariants.terminalState(instance) !== "in-flight" ? [] : sites.filter(entry => readsNowIn(entry.insight.analysis.reads));
|
|
10764
10370
|
}
|
|
10765
10371
|
|
|
10766
10372
|
function currentStageOf(instance, definition) {
|
|
@@ -10949,18 +10555,18 @@ function autonomyOf(definition) {
|
|
|
10949
10555
|
|
|
10950
10556
|
async function evaluateEditableFields(args) {
|
|
10951
10557
|
const fields = [];
|
|
10952
|
-
for (const site of editableFieldsInStage(args.definition, args.stage)) fields.push(await evaluateEditableField(args, site));
|
|
10558
|
+
for (const site of invariants.editableFieldsInStage(args.definition, args.stage)) fields.push(await evaluateEditableField(args, site));
|
|
10953
10559
|
return fields;
|
|
10954
10560
|
}
|
|
10955
10561
|
|
|
10956
10562
|
async function evaluateEditableField(args, site) {
|
|
10957
|
-
const {instance: instance, definition: definition, snapshot: snapshot, scope: scope, scopeForActivity: scopeForActivity, guardDenial: guardDenial, sites: sites} = args, window = fieldWindowOpen(instance, site), insight = await editPredicateInsight({
|
|
10563
|
+
const {instance: instance, definition: definition, snapshot: snapshot, scope: scope, scopeForActivity: scopeForActivity, guardDenial: guardDenial, sites: sites} = args, window = invariants.fieldWindowOpen(instance, site), insight = await editPredicateInsight({
|
|
10958
10564
|
site: site,
|
|
10959
10565
|
snapshot: snapshot,
|
|
10960
10566
|
scope: scope,
|
|
10961
10567
|
scopeForActivity: scopeForActivity,
|
|
10962
10568
|
sites: sites
|
|
10963
|
-
}), predicateSatisfied = insight === void 0 || insight.outcome === "satisfied", reason = editDisabledReason({
|
|
10569
|
+
}), predicateSatisfied = insight === void 0 || insight.outcome === "satisfied", reason = invariants.editDisabledReason({
|
|
10964
10570
|
effective: site.effective,
|
|
10965
10571
|
instance: instance,
|
|
10966
10572
|
window: window,
|
|
@@ -10986,12 +10592,12 @@ async function evaluateEditableField(args, site) {
|
|
|
10986
10592
|
roleAliases: definition.roleAliases
|
|
10987
10593
|
} : {}
|
|
10988
10594
|
} : {},
|
|
10989
|
-
value: readFieldValue(instance, site),
|
|
10595
|
+
value: invariants.readFieldValue(instance, site),
|
|
10990
10596
|
editable: reason === void 0,
|
|
10991
10597
|
...reason !== void 0 ? {
|
|
10992
10598
|
disabledReason: reason
|
|
10993
10599
|
} : {},
|
|
10994
|
-
...fieldProvenance(instance, site.ref),
|
|
10600
|
+
...invariants.fieldProvenance(instance, site.ref),
|
|
10995
10601
|
...insight !== void 0 ? {
|
|
10996
10602
|
insight: insight
|
|
10997
10603
|
} : {}
|
|
@@ -11293,7 +10899,7 @@ async function instanceGuardReason({instance: instance, identity: identity, guar
|
|
|
11293
10899
|
}
|
|
11294
10900
|
|
|
11295
10901
|
function lifecycleReason({instance: instance, status: status, stageHasExits: stageHasExits}) {
|
|
11296
|
-
const terminalReason = instanceTerminalReason(instance);
|
|
10902
|
+
const terminalReason = invariants.instanceTerminalReason(instance);
|
|
11297
10903
|
if (terminalReason !== void 0) return terminalReason;
|
|
11298
10904
|
if (!stageHasExits) return {
|
|
11299
10905
|
kind: "stage-terminal",
|
|
@@ -11374,7 +10980,7 @@ function beforeArm(filter, params) {
|
|
|
11374
10980
|
|
|
11375
10981
|
function compiledConditions(filter, params) {
|
|
11376
10982
|
if (filter.limit !== void 0 && (!Number.isInteger(filter.limit) || filter.limit <= 0)) throw new invariants.ContractViolationError(`instancesQuery: limit must be a positive integer; got ${JSON.stringify(filter.limit)}`);
|
|
11377
|
-
const conditions = [ `_type == "${WORKFLOW_INSTANCE_TYPE}"`, invariants.tagScopeFilter() ];
|
|
10983
|
+
const conditions = [ `_type == "${invariants.WORKFLOW_INSTANCE_TYPE}"`, invariants.tagScopeFilter() ];
|
|
11378
10984
|
filter.includeCompleted !== !0 && conditions.push(inFlightFilter()), filter.definition !== void 0 && (conditions.push("definition == $definition"),
|
|
11379
10985
|
params.definition = filter.definition), filter.stage !== void 0 && (conditions.push("currentStage == $stage"),
|
|
11380
10986
|
params.stage = filter.stage), filter.assignment !== void 0 && conditions.push(assignmentPrefilter(filter.assignment, params));
|
|
@@ -11402,7 +11008,7 @@ function instancesQuery(args) {
|
|
|
11402
11008
|
|
|
11403
11009
|
function instanceChangesQuery(args) {
|
|
11404
11010
|
return invariants.validateTag(args.tag), {
|
|
11405
|
-
query: `*[_type == "${WORKFLOW_INSTANCE_TYPE}" && ${invariants.tagScopeFilter()}]`,
|
|
11011
|
+
query: `*[_type == "${invariants.WORKFLOW_INSTANCE_TYPE}" && ${invariants.tagScopeFilter()}]`,
|
|
11406
11012
|
params: {
|
|
11407
11013
|
tag: args.tag
|
|
11408
11014
|
}
|
|
@@ -11936,6 +11542,14 @@ function parseDefinitionInput(def, caller) {
|
|
|
11936
11542
|
return invariants.parseStoredDefinition(content, label);
|
|
11937
11543
|
}
|
|
11938
11544
|
|
|
11545
|
+
function _parseDefinitionsWithReaderModel(definitions, caller) {
|
|
11546
|
+
const parsed = definitions.map(def => parseDefinitionInput(def, caller));
|
|
11547
|
+
return {
|
|
11548
|
+
definitions: parsed,
|
|
11549
|
+
requiredMinReaderModel: requiredDefinitionReaderModel(parsed)
|
|
11550
|
+
};
|
|
11551
|
+
}
|
|
11552
|
+
|
|
11939
11553
|
function stripSystemFields(doc) {
|
|
11940
11554
|
const out = {};
|
|
11941
11555
|
for (const [k, v2] of Object.entries(doc)) k === "_rev" || k === "_createdAt" || k === "_updatedAt" || (out[k] = v2);
|
|
@@ -12001,7 +11615,7 @@ async function loadDefinitionVersionsOrThrow({client: client, definition: defini
|
|
|
12001
11615
|
}
|
|
12002
11616
|
|
|
12003
11617
|
async function editField(args) {
|
|
12004
|
-
const {client: client, instanceId: instanceId, target: target, mode: mode = DEFAULT_EDIT_MODE, value: value, requestRecord: requestRecord, options: options} = args;
|
|
11618
|
+
const {client: client, instanceId: instanceId, target: target, mode: mode = invariants.DEFAULT_EDIT_MODE, value: value, requestRecord: requestRecord, options: options} = args;
|
|
12005
11619
|
return retryOnRevisionConflict({
|
|
12006
11620
|
client: client,
|
|
12007
11621
|
instanceId: instanceId,
|
|
@@ -12028,7 +11642,7 @@ async function commitEdit({ctx: ctx, target: target, mode: mode, value: value, r
|
|
|
12028
11642
|
record: requestRecord,
|
|
12029
11643
|
now: ctx.now
|
|
12030
11644
|
});
|
|
12031
|
-
const actor = options?.actor, stage = findStage(ctx.definition, ctx.instance.currentStage), site = resolveEditTarget({
|
|
11645
|
+
const actor = options?.actor, stage = findStage(ctx.definition, ctx.instance.currentStage), site = invariants.resolveEditTarget({
|
|
12032
11646
|
definition: ctx.definition,
|
|
12033
11647
|
stage: stage,
|
|
12034
11648
|
target: target
|
|
@@ -12083,7 +11697,7 @@ async function commitEdit({ctx: ctx, target: target, mode: mode, value: value, r
|
|
|
12083
11697
|
}
|
|
12084
11698
|
|
|
12085
11699
|
async function assertFieldEditable({ctx: ctx, site: site, options: options}) {
|
|
12086
|
-
const actor = options?.actor, window = fieldWindowOpen(ctx.instance, site), vars = await callerBoundVarsForCall({
|
|
11700
|
+
const actor = options?.actor, window = invariants.fieldWindowOpen(ctx.instance, site), vars = await callerBoundVarsForCall({
|
|
12087
11701
|
client: ctx.client,
|
|
12088
11702
|
instance: ctx.instance,
|
|
12089
11703
|
options: options
|
|
@@ -12101,7 +11715,7 @@ async function assertFieldEditable({ctx: ctx, site: site, options: options}) {
|
|
|
12101
11715
|
vars: vars
|
|
12102
11716
|
} : {}
|
|
12103
11717
|
}
|
|
12104
|
-
}) : site.effective === !0, reason = editDisabledReason({
|
|
11718
|
+
}) : site.effective === !0, reason = invariants.editDisabledReason({
|
|
12105
11719
|
effective: site.effective,
|
|
12106
11720
|
instance: ctx.instance,
|
|
12107
11721
|
window: window,
|
|
@@ -12327,11 +11941,11 @@ async function cascadeAndReload(args) {
|
|
|
12327
11941
|
|
|
12328
11942
|
async function unchangedNextEvaluationAt(args) {
|
|
12329
11943
|
const {client: client, instance: instance, actor: actor, clientForGdr: clientForGdr, refSurface: refSurface, memberRolesLoader: memberRolesLoader, now: now} = args;
|
|
12330
|
-
if (terminalState(instance) !== "in-flight") return;
|
|
11944
|
+
if (invariants.terminalState(instance) !== "in-flight") return;
|
|
12331
11945
|
const ctx = await buildEngineContext({
|
|
12332
11946
|
client: client,
|
|
12333
11947
|
instance: instance,
|
|
12334
|
-
definition: parseDefinitionSnapshot(instance),
|
|
11948
|
+
definition: invariants.parseDefinitionSnapshot(instance),
|
|
12335
11949
|
clientForGdr: clientForGdr,
|
|
12336
11950
|
refSurface: refSurface,
|
|
12337
11951
|
memberRolesLoader: memberRolesLoader,
|
|
@@ -12459,12 +12073,15 @@ async function resumeStart(args) {
|
|
|
12459
12073
|
version: version
|
|
12460
12074
|
});
|
|
12461
12075
|
if (mismatch !== void 0) throw new invariants.ContractViolationError(`startInstance: instanceId "${existing._id}" already exists and ${mismatch}. A supplied instanceId is start's idempotency key — reuse one only to retry the same start.`);
|
|
12462
|
-
if (existing.stages.length === 0 && terminalState(existing) !== "in-flight") throw new invariants.ContractViolationError(`startInstance: instanceId "${existing._id}" belongs to a start that was discarded (aborted before it finished starting) — mint a new id to start again.`);
|
|
12463
|
-
const completesStart = isUnprimed(existing), emitStarted = () => resolveTelemetry(args.telemetry).log(WorkflowInstanceStarted,
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12076
|
+
if (existing.stages.length === 0 && invariants.terminalState(existing) !== "in-flight") throw new invariants.ContractViolationError(`startInstance: instanceId "${existing._id}" belongs to a start that was discarded (aborted before it finished starting) — mint a new id to start again.`);
|
|
12077
|
+
const completesStart = invariants.isUnprimed(existing), emitStarted = () => invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowInstanceStarted, {
|
|
12078
|
+
...invariants.executionContextFragment(resolveExecutionContext(args.executionContext)),
|
|
12079
|
+
...invariants.instanceStartedDataFor({
|
|
12080
|
+
instance: existing,
|
|
12081
|
+
initialFieldCount: initialFieldCount,
|
|
12082
|
+
viaSpawn: !1
|
|
12083
|
+
})
|
|
12084
|
+
}), settled = await settleStart({
|
|
12468
12085
|
...settlementArgs,
|
|
12469
12086
|
instanceId: existing._id,
|
|
12470
12087
|
...completesStart ? {
|
|
@@ -12620,7 +12237,7 @@ function assertActionAllowed({evaluation: evaluation, activity: activity, action
|
|
|
12620
12237
|
}
|
|
12621
12238
|
|
|
12622
12239
|
function assertEditAllowed(evaluation, target) {
|
|
12623
|
-
const field = evaluation.editableFields.filter(s => editTargetMatches(s, target)).sort((a, b) => SCOPE_PRECEDENCE[a.scope] - SCOPE_PRECEDENCE[b.scope])[0];
|
|
12240
|
+
const field = evaluation.editableFields.filter(s => invariants.editTargetMatches(s, target)).sort((a, b) => invariants.SCOPE_PRECEDENCE[a.scope] - invariants.SCOPE_PRECEDENCE[b.scope])[0];
|
|
12624
12241
|
if (field !== void 0 && !field.editable && field.disabledReason !== void 0) {
|
|
12625
12242
|
const reason = field.disabledReason;
|
|
12626
12243
|
throw reason.kind === "mutation-guard-denied" ? guardDeniedError(evaluation.instance._id, reason) : new EditFieldDeniedError({
|
|
@@ -12780,7 +12397,7 @@ async function assertNoSpawnReferrers({client: client, tag: tag, definition: def
|
|
|
12780
12397
|
|
|
12781
12398
|
async function nonTerminalInstanceIds({client: client, tag: tag, definition: definition, version: version}) {
|
|
12782
12399
|
const versionFilter = version === void 0 ? "" : " && pinnedVersion == $version";
|
|
12783
|
-
return (await client.fetch(`*[_type == "${WORKFLOW_INSTANCE_TYPE}" && definition == $definition && ${invariants.tagScopeFilter()} && ${inFlightFilter()}${versionFilter}] | order(_id asc){_id}`, {
|
|
12400
|
+
return (await client.fetch(`*[_type == "${invariants.WORKFLOW_INSTANCE_TYPE}" && definition == $definition && ${invariants.tagScopeFilter()} && ${inFlightFilter()}${versionFilter}] | order(_id asc){_id}`, {
|
|
12784
12401
|
definition: definition,
|
|
12785
12402
|
tag: tag,
|
|
12786
12403
|
...version !== void 0 ? {
|
|
@@ -12837,9 +12454,9 @@ const workflow = {
|
|
|
12837
12454
|
deployDefinitions: async rawArgs => {
|
|
12838
12455
|
const args = taggedScope(rawArgs, REQUEST_TAG.deploy), {client: client, tag: tag, workflowResource: workflowResource, resourceAliases: resourceAliases} = args;
|
|
12839
12456
|
invariants.validateTag(tag);
|
|
12840
|
-
const definitions = args.definitions
|
|
12457
|
+
const {definitions: definitions, requiredMinReaderModel: requiredMinReaderModel} = _parseDefinitionsWithReaderModel(args.definitions, "workflow.deployDefinitions");
|
|
12841
12458
|
definitions.forEach(validateDefinition), assertReaderModelAcknowledgement(args.expectedMinReaderModel, {
|
|
12842
|
-
requiredMinReaderModel:
|
|
12459
|
+
requiredMinReaderModel: requiredMinReaderModel
|
|
12843
12460
|
});
|
|
12844
12461
|
const roleWarnings = await validateDefinitionRoles({
|
|
12845
12462
|
client: client,
|
|
@@ -12894,12 +12511,15 @@ const workflow = {
|
|
|
12894
12511
|
});
|
|
12895
12512
|
}
|
|
12896
12513
|
hasWrites && await tx.commit();
|
|
12897
|
-
const deployId = randomKey(), telemetry = resolveTelemetry(args.telemetry);
|
|
12898
|
-
for (const {def: def, contentHash: contentHash, status: status} of deployed) telemetry.log(WorkflowDefinitionDeployed,
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12514
|
+
const deployId = randomKey(), telemetry = invariants.resolveTelemetry(args.telemetry), execution = resolveExecutionContext(args.executionContext);
|
|
12515
|
+
for (const {def: def, contentHash: contentHash, status: status} of deployed) telemetry.log(invariants.WorkflowDefinitionDeployed, {
|
|
12516
|
+
...invariants.executionContextFragment(execution),
|
|
12517
|
+
...invariants.definitionDeployedData(def, {
|
|
12518
|
+
contentHash: contentHash,
|
|
12519
|
+
status: status,
|
|
12520
|
+
deployId: deployId
|
|
12521
|
+
})
|
|
12522
|
+
});
|
|
12903
12523
|
return {
|
|
12904
12524
|
results: results,
|
|
12905
12525
|
deployId: deployId
|
|
@@ -12907,7 +12527,8 @@ const workflow = {
|
|
|
12907
12527
|
},
|
|
12908
12528
|
deleteDefinition: async rawArgs => {
|
|
12909
12529
|
const args = taggedScope(rawArgs, REQUEST_TAG.deleteDefinition), result = await deleteDefinition(args);
|
|
12910
|
-
return resolveTelemetry(args.telemetry).log(WorkflowDefinitionDeleted, {
|
|
12530
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowDefinitionDeleted, {
|
|
12531
|
+
...invariants.executionContextFragment(resolveExecutionContext(args.executionContext)),
|
|
12911
12532
|
deletedVersionCount: result.deletedVersions.length,
|
|
12912
12533
|
cascadeAbortedCount: result.abortedInstanceIds.length,
|
|
12913
12534
|
deletedGuardCount: result.deletedGuardCount
|
|
@@ -13023,12 +12644,15 @@ const workflow = {
|
|
|
13023
12644
|
} : {}
|
|
13024
12645
|
}))
|
|
13025
12646
|
});
|
|
13026
|
-
return resolveTelemetry(args.telemetry).log(WorkflowActionFired,
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
12647
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowActionFired, {
|
|
12648
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12649
|
+
...invariants.actionFiredData({
|
|
12650
|
+
instance: before,
|
|
12651
|
+
activity: activity,
|
|
12652
|
+
params: params,
|
|
12653
|
+
cascaded: result.cascaded
|
|
12654
|
+
})
|
|
12655
|
+
}), result;
|
|
13032
12656
|
}
|
|
13033
12657
|
});
|
|
13034
12658
|
},
|
|
@@ -13093,11 +12717,14 @@ const workflow = {
|
|
|
13093
12717
|
} : {}
|
|
13094
12718
|
}))
|
|
13095
12719
|
});
|
|
13096
|
-
return resolveTelemetry(args.telemetry).log(WorkflowFieldEdited,
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
12720
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowFieldEdited, {
|
|
12721
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12722
|
+
...invariants.fieldEditedData({
|
|
12723
|
+
instance: before,
|
|
12724
|
+
target: target,
|
|
12725
|
+
mode: mode
|
|
12726
|
+
})
|
|
12727
|
+
}), result;
|
|
13101
12728
|
}
|
|
13102
12729
|
});
|
|
13103
12730
|
},
|
|
@@ -13156,8 +12783,9 @@ const workflow = {
|
|
|
13156
12783
|
executionContext: executionContext,
|
|
13157
12784
|
telemetry: args.telemetry
|
|
13158
12785
|
});
|
|
13159
|
-
return resolveTelemetry(args.telemetry).log(WorkflowEffectCompleted, {
|
|
13160
|
-
...
|
|
12786
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowEffectCompleted, {
|
|
12787
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12788
|
+
...invariants.definitionHashFragment(settled.instance.pinnedContentHash),
|
|
13161
12789
|
instanceId: instanceId,
|
|
13162
12790
|
effect: completion.effect,
|
|
13163
12791
|
status: status,
|
|
@@ -13211,8 +12839,9 @@ const workflow = {
|
|
|
13211
12839
|
executionContext: executionContext,
|
|
13212
12840
|
telemetry: args.telemetry
|
|
13213
12841
|
});
|
|
13214
|
-
return resolveTelemetry(args.telemetry).log(WorkflowEffectStateReported, {
|
|
13215
|
-
...
|
|
12842
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowEffectStateReported, {
|
|
12843
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12844
|
+
...invariants.definitionHashFragment(settled.instance.pinnedContentHash),
|
|
13216
12845
|
instanceId: instanceId,
|
|
13217
12846
|
effect: report.effect,
|
|
13218
12847
|
cascaded: settled.cascaded
|
|
@@ -13244,8 +12873,9 @@ const workflow = {
|
|
|
13244
12873
|
executionContext: executionContext,
|
|
13245
12874
|
telemetry: args.telemetry
|
|
13246
12875
|
});
|
|
13247
|
-
return resolveTelemetry(args.telemetry).log(WorkflowInstanceTicked, {
|
|
13248
|
-
...
|
|
12876
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowInstanceTicked, {
|
|
12877
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12878
|
+
...invariants.definitionHashFragment(settled.instance.pinnedContentHash),
|
|
13249
12879
|
instanceId: instanceId,
|
|
13250
12880
|
cascaded: settled.cascaded
|
|
13251
12881
|
}), settledResult({
|
|
@@ -13279,8 +12909,9 @@ const workflow = {
|
|
|
13279
12909
|
telemetry: args.telemetry
|
|
13280
12910
|
})
|
|
13281
12911
|
});
|
|
13282
|
-
return resolveTelemetry(args.telemetry).log(WorkflowStageSet, {
|
|
13283
|
-
...
|
|
12912
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowStageSet, {
|
|
12913
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12914
|
+
...invariants.definitionHashFragment(before.pinnedContentHash),
|
|
13284
12915
|
instanceId: instanceId,
|
|
13285
12916
|
changed: result.fired
|
|
13286
12917
|
}), adminOverrideResult({
|
|
@@ -13329,8 +12960,9 @@ const workflow = {
|
|
|
13329
12960
|
requestRecord: record
|
|
13330
12961
|
} : {}
|
|
13331
12962
|
});
|
|
13332
|
-
return resolveTelemetry(args.telemetry).log(WorkflowInstanceAborted, {
|
|
13333
|
-
...
|
|
12963
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowInstanceAborted, {
|
|
12964
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
12965
|
+
...invariants.definitionHashFragment(before.pinnedContentHash),
|
|
13334
12966
|
instanceId: instanceId,
|
|
13335
12967
|
changed: changed
|
|
13336
12968
|
}), settledResult({
|
|
@@ -13370,8 +13002,9 @@ const workflow = {
|
|
|
13370
13002
|
telemetry: args.telemetry
|
|
13371
13003
|
})
|
|
13372
13004
|
});
|
|
13373
|
-
return resolveTelemetry(args.telemetry).log(WorkflowActivityReset, {
|
|
13374
|
-
...
|
|
13005
|
+
return invariants.resolveTelemetry(args.telemetry).log(invariants.WorkflowActivityReset, {
|
|
13006
|
+
...invariants.executionContextFragment(resolveExecutionContext(executionContext)),
|
|
13007
|
+
...invariants.definitionHashFragment(before.pinnedContentHash),
|
|
13375
13008
|
instanceId: instanceId,
|
|
13376
13009
|
changed: result.fired
|
|
13377
13010
|
}), adminOverrideResult({
|
|
@@ -13466,7 +13099,7 @@ const workflow = {
|
|
|
13466
13099
|
instance: instance
|
|
13467
13100
|
}), reserved = await renderConditionScope({
|
|
13468
13101
|
instance: instance,
|
|
13469
|
-
definition: parseDefinitionSnapshot(instance),
|
|
13102
|
+
definition: invariants.parseDefinitionSnapshot(instance),
|
|
13470
13103
|
snapshot: snapshot,
|
|
13471
13104
|
now: clock()
|
|
13472
13105
|
}), tree = groqJs.parse(groq, {
|
|
@@ -13683,7 +13316,7 @@ async function startFreshInstance(args) {
|
|
|
13683
13316
|
tag: tag
|
|
13684
13317
|
}), id = instanceId ?? instanceDocId(tag);
|
|
13685
13318
|
assertInitialStageExists(definition);
|
|
13686
|
-
const now = clock();
|
|
13319
|
+
const now = clock(), execution = resolveExecutionContext(executionContext);
|
|
13687
13320
|
await assertStartInputs({
|
|
13688
13321
|
client: client,
|
|
13689
13322
|
tag: tag,
|
|
@@ -13719,7 +13352,7 @@ async function startFreshInstance(args) {
|
|
|
13719
13352
|
perspective: perspective ?? derivePerspectiveFromFields(resolvedFields),
|
|
13720
13353
|
initialStage: definition.initialStage,
|
|
13721
13354
|
actor: actor,
|
|
13722
|
-
executionContext:
|
|
13355
|
+
executionContext: execution,
|
|
13723
13356
|
...fieldDiscards.length > 0 ? {
|
|
13724
13357
|
extraHistory: fieldDiscards
|
|
13725
13358
|
} : {}
|
|
@@ -13740,12 +13373,15 @@ async function startFreshInstance(args) {
|
|
|
13740
13373
|
...startArgs.telemetry !== void 0 ? {
|
|
13741
13374
|
telemetry: startArgs.telemetry
|
|
13742
13375
|
} : {},
|
|
13743
|
-
emitStarted: () => resolveTelemetry(startArgs.telemetry).log(WorkflowInstanceStarted,
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13376
|
+
emitStarted: () => invariants.resolveTelemetry(startArgs.telemetry).log(invariants.WorkflowInstanceStarted, {
|
|
13377
|
+
...invariants.executionContextFragment(execution),
|
|
13378
|
+
...invariants.instanceStartedData({
|
|
13379
|
+
definition: definition,
|
|
13380
|
+
instanceId: id,
|
|
13381
|
+
initialFieldCount: seedFields.length,
|
|
13382
|
+
viaSpawn: !1
|
|
13383
|
+
})
|
|
13384
|
+
})
|
|
13749
13385
|
});
|
|
13750
13386
|
return settledResult({
|
|
13751
13387
|
...settled,
|
|
@@ -14012,7 +13648,7 @@ function noteDrainedInstanceHash(buckets, instance) {
|
|
|
14012
13648
|
function drainCascadeTelemetry(telemetry) {
|
|
14013
13649
|
if (telemetry !== void 0) return {
|
|
14014
13650
|
log: (event, data) => {
|
|
14015
|
-
event.name === WorkflowEffectCompleted.name && !isCancelledCompletion(data) || telemetry.log(event, data);
|
|
13651
|
+
event.name === invariants.WorkflowEffectCompleted.name && !isCancelledCompletion(data) || telemetry.log(event, data);
|
|
14016
13652
|
}
|
|
14017
13653
|
};
|
|
14018
13654
|
}
|
|
@@ -14094,7 +13730,7 @@ async function drainOneCandidate(pass) {
|
|
|
14094
13730
|
} : {}
|
|
14095
13731
|
});
|
|
14096
13732
|
if (claimed === void 0) return !0;
|
|
14097
|
-
const retry = effectRetryPolicy(parseDefinitionSnapshot(before), candidate.name), outcome = await dispatchAndReport({
|
|
13733
|
+
const retry = effectRetryPolicy(invariants.parseDefinitionSnapshot(before), candidate.name), outcome = await dispatchAndReport({
|
|
14098
13734
|
handler: handler,
|
|
14099
13735
|
candidate: candidate,
|
|
14100
13736
|
claimToken: claimed.claimToken,
|
|
@@ -14425,18 +14061,18 @@ async function applyMissingHandler({policy: policy, info: info, log: log}) {
|
|
|
14425
14061
|
}
|
|
14426
14062
|
|
|
14427
14063
|
function previewSiteOf(args) {
|
|
14428
|
-
const stage = findStage(args.definition, args.instance.currentStage), site = resolveEditTarget({
|
|
14064
|
+
const stage = findStage(args.definition, args.instance.currentStage), site = invariants.resolveEditTarget({
|
|
14429
14065
|
definition: args.definition,
|
|
14430
14066
|
stage: stage,
|
|
14431
14067
|
target: args.target
|
|
14432
14068
|
});
|
|
14433
|
-
if (site !== void 0) return fieldWindowOpen(args.instance, site).open ? site : void 0;
|
|
14069
|
+
if (site !== void 0) return invariants.fieldWindowOpen(args.instance, site).open ? site : void 0;
|
|
14434
14070
|
}
|
|
14435
14071
|
|
|
14436
14072
|
function previewOp(site, preview) {
|
|
14437
14073
|
return buildEditOp({
|
|
14438
14074
|
site: site,
|
|
14439
|
-
mode: preview.mode ?? DEFAULT_EDIT_MODE,
|
|
14075
|
+
mode: preview.mode ?? invariants.DEFAULT_EDIT_MODE,
|
|
14440
14076
|
value: preview.value
|
|
14441
14077
|
});
|
|
14442
14078
|
}
|
|
@@ -14472,7 +14108,7 @@ async function applyEditPreviews(args) {
|
|
|
14472
14108
|
}
|
|
14473
14109
|
|
|
14474
14110
|
function createInstanceSession(args) {
|
|
14475
|
-
const {client: client, tag: tag, clock: clock, executionContext: executionContext} = args, telemetry = resolveTelemetry(args.telemetry);
|
|
14111
|
+
const {client: client, tag: tag, clock: clock, executionContext: executionContext} = args, telemetry = invariants.resolveTelemetry(args.telemetry), execution = resolveExecutionContext(executionContext);
|
|
14476
14112
|
let instance = asHeldInstance(args.instance);
|
|
14477
14113
|
const opScope = opTag => {
|
|
14478
14114
|
const scoped = taggedScope(args, opTag);
|
|
@@ -14505,7 +14141,7 @@ function createInstanceSession(args) {
|
|
|
14505
14141
|
}, uri = invariants.gdrFromResource(owned.resource, owned.doc._id);
|
|
14506
14142
|
if (uri === selfUri()) {
|
|
14507
14143
|
const rawStamp = owned.doc._updatedAt;
|
|
14508
|
-
!invariants.isParseableInstant(rawStamp) || owned.doc._type !== WORKFLOW_INSTANCE_TYPE ? asHeldInstance(owned.doc) : Date.parse(rawStamp) > Date.parse(instance._updatedAt) && (instance = asHeldInstance(owned.doc));
|
|
14144
|
+
!invariants.isParseableInstant(rawStamp) || owned.doc._type !== invariants.WORKFLOW_INSTANCE_TYPE ? asHeldInstance(owned.doc) : Date.parse(rawStamp) > Date.parse(instance._updatedAt) && (instance = asHeldInstance(owned.doc));
|
|
14509
14145
|
return;
|
|
14510
14146
|
}
|
|
14511
14147
|
target.set(uri, owned);
|
|
@@ -14528,7 +14164,7 @@ function createInstanceSession(args) {
|
|
|
14528
14164
|
let parsedDefinition;
|
|
14529
14165
|
const definitionOf = () => (parsedDefinition?.source !== instance && (parsedDefinition = {
|
|
14530
14166
|
source: instance,
|
|
14531
|
-
definition: parseDefinitionSnapshot(instance)
|
|
14167
|
+
definition: invariants.parseDefinitionSnapshot(instance)
|
|
14532
14168
|
}), parsedDefinition.definition), siteKey = site => JSON.stringify([ site.scope, site.activity ?? null, site.name ]), stagePreview = ({target: target, mode: mode, value: value}) => {
|
|
14533
14169
|
const site = previewSiteOf({
|
|
14534
14170
|
instance: instance,
|
|
@@ -14749,8 +14385,9 @@ function createInstanceSession(args) {
|
|
|
14749
14385
|
client: tickScope.client,
|
|
14750
14386
|
instanceId: instance._id,
|
|
14751
14387
|
tag: tag
|
|
14752
|
-
}), telemetry.log(WorkflowInstanceTicked, {
|
|
14753
|
-
...
|
|
14388
|
+
}), telemetry.log(invariants.WorkflowInstanceTicked, {
|
|
14389
|
+
...invariants.executionContextFragment(execution),
|
|
14390
|
+
...invariants.definitionHashFragment(instance.pinnedContentHash),
|
|
14754
14391
|
instanceId: instance._id,
|
|
14755
14392
|
cascaded: settled.cascaded
|
|
14756
14393
|
}), settledResult({
|
|
@@ -14806,12 +14443,15 @@ function createInstanceSession(args) {
|
|
|
14806
14443
|
scope: fireScope,
|
|
14807
14444
|
memberRolesLoader: memberRolesLoader
|
|
14808
14445
|
});
|
|
14809
|
-
return telemetry.log(WorkflowActionFired,
|
|
14810
|
-
|
|
14811
|
-
|
|
14812
|
-
|
|
14813
|
-
|
|
14814
|
-
|
|
14446
|
+
return telemetry.log(invariants.WorkflowActionFired, {
|
|
14447
|
+
...invariants.executionContextFragment(execution),
|
|
14448
|
+
...invariants.actionFiredData({
|
|
14449
|
+
instance: preOp,
|
|
14450
|
+
activity: activity,
|
|
14451
|
+
params: params,
|
|
14452
|
+
cascaded: result.cascaded
|
|
14453
|
+
})
|
|
14454
|
+
}), result;
|
|
14815
14455
|
});
|
|
14816
14456
|
},
|
|
14817
14457
|
editField({target: target, mode: mode, value: value}) {
|
|
@@ -14868,11 +14508,14 @@ function createInstanceSession(args) {
|
|
|
14868
14508
|
scope: editScope,
|
|
14869
14509
|
memberRolesLoader: memberRolesLoader
|
|
14870
14510
|
});
|
|
14871
|
-
return telemetry.log(WorkflowFieldEdited,
|
|
14872
|
-
|
|
14873
|
-
|
|
14874
|
-
|
|
14875
|
-
|
|
14511
|
+
return telemetry.log(invariants.WorkflowFieldEdited, {
|
|
14512
|
+
...invariants.executionContextFragment(execution),
|
|
14513
|
+
...invariants.fieldEditedData({
|
|
14514
|
+
instance: preOp,
|
|
14515
|
+
target: target,
|
|
14516
|
+
mode: mode
|
|
14517
|
+
})
|
|
14518
|
+
}), result;
|
|
14876
14519
|
}).finally(() => {
|
|
14877
14520
|
stagedKey !== void 0 && previews.delete(stagedKey);
|
|
14878
14521
|
});
|
|
@@ -14910,7 +14553,7 @@ function createEngine(args) {
|
|
|
14910
14553
|
const effects = {
|
|
14911
14554
|
handlers: args.effects?.handlers ?? {},
|
|
14912
14555
|
missingHandler: args.effects?.missingHandler ?? "fail"
|
|
14913
|
-
}, logger = args.loggerFactory ?? defaultLoggerFactory, telemetry = resolveTelemetry(args.telemetry), EMPTY_DRAIN_LOG_INTERVAL_MS = 6e4;
|
|
14556
|
+
}, logger = args.loggerFactory ?? defaultLoggerFactory, telemetry = invariants.resolveTelemetry(args.telemetry), execution = resolveExecutionContext(executionContext), EMPTY_DRAIN_LOG_INTERVAL_MS = 6e4;
|
|
14914
14557
|
let lastEmptyDrainLoggedAt;
|
|
14915
14558
|
const emptyDrainDue = () => {
|
|
14916
14559
|
const now = Date.parse((clock ?? wallClock)());
|
|
@@ -15005,8 +14648,9 @@ function createEngine(args) {
|
|
|
15005
14648
|
sleep: args.sleep
|
|
15006
14649
|
} : {}
|
|
15007
14650
|
}), drained = result.drained;
|
|
15008
|
-
return (drained.length > 0 || emptyDrainDue()) && telemetry.log(WorkflowEffectsDrained, {
|
|
15009
|
-
...
|
|
14651
|
+
return (drained.length > 0 || emptyDrainDue()) && telemetry.log(invariants.WorkflowEffectsDrained, {
|
|
14652
|
+
...invariants.executionContextFragment(execution),
|
|
14653
|
+
...invariants.definitionHashFragment(result.definitionContentHash),
|
|
15010
14654
|
instanceId: instanceId,
|
|
15011
14655
|
drainedCount: drained.length,
|
|
15012
14656
|
drainedEffects: drained.map(entry => entry.name)
|
|
@@ -15513,7 +15157,7 @@ const HISTORY_DISPLAY = {
|
|
|
15513
15157
|
title: "Workflow definition",
|
|
15514
15158
|
description: "An immutable workflow blueprint, addressed by `name` + `version`."
|
|
15515
15159
|
},
|
|
15516
|
-
[WORKFLOW_INSTANCE_TYPE]: {
|
|
15160
|
+
[invariants.WORKFLOW_INSTANCE_TYPE]: {
|
|
15517
15161
|
title: "Workflow instance",
|
|
15518
15162
|
description: "A running (or finished) workflow against its declared fields."
|
|
15519
15163
|
}
|
|
@@ -15634,8 +15278,38 @@ exports.SpawnContractsInvalidError = invariants.SpawnContractsInvalidError;
|
|
|
15634
15278
|
|
|
15635
15279
|
exports.WORKFLOW_DEFINITION_TYPE = invariants.WORKFLOW_DEFINITION_TYPE;
|
|
15636
15280
|
|
|
15281
|
+
exports.WORKFLOW_INSTANCE_TYPE = invariants.WORKFLOW_INSTANCE_TYPE;
|
|
15282
|
+
|
|
15283
|
+
exports.WorkflowActionFired = invariants.WorkflowActionFired;
|
|
15284
|
+
|
|
15285
|
+
exports.WorkflowActivityReset = invariants.WorkflowActivityReset;
|
|
15286
|
+
|
|
15287
|
+
exports.WorkflowDefinitionDeleted = invariants.WorkflowDefinitionDeleted;
|
|
15288
|
+
|
|
15289
|
+
exports.WorkflowDefinitionDeployed = invariants.WorkflowDefinitionDeployed;
|
|
15290
|
+
|
|
15291
|
+
exports.WorkflowEffectCompleted = invariants.WorkflowEffectCompleted;
|
|
15292
|
+
|
|
15293
|
+
exports.WorkflowEffectStateReported = invariants.WorkflowEffectStateReported;
|
|
15294
|
+
|
|
15295
|
+
exports.WorkflowEffectsDrained = invariants.WorkflowEffectsDrained;
|
|
15296
|
+
|
|
15637
15297
|
exports.WorkflowError = invariants.WorkflowError;
|
|
15638
15298
|
|
|
15299
|
+
exports.WorkflowFieldEdited = invariants.WorkflowFieldEdited;
|
|
15300
|
+
|
|
15301
|
+
exports.WorkflowInstanceAborted = invariants.WorkflowInstanceAborted;
|
|
15302
|
+
|
|
15303
|
+
exports.WorkflowInstanceStarted = invariants.WorkflowInstanceStarted;
|
|
15304
|
+
|
|
15305
|
+
exports.WorkflowInstanceTicked = invariants.WorkflowInstanceTicked;
|
|
15306
|
+
|
|
15307
|
+
exports.WorkflowStageSet = invariants.WorkflowStageSet;
|
|
15308
|
+
|
|
15309
|
+
exports.WorkflowStageTransitioned = invariants.WorkflowStageTransitioned;
|
|
15310
|
+
|
|
15311
|
+
exports._fieldTargetLabel = invariants._fieldTargetLabel;
|
|
15312
|
+
|
|
15639
15313
|
exports.activeAssignmentMembers = invariants.activeAssignmentMembers;
|
|
15640
15314
|
|
|
15641
15315
|
exports.actorFulfillsRole = invariants.actorFulfillsRole;
|
|
@@ -15658,6 +15332,8 @@ exports.conditionFieldReadNames = invariants.conditionFieldReadNames;
|
|
|
15658
15332
|
|
|
15659
15333
|
exports.datasetResourceParts = invariants.datasetResourceParts;
|
|
15660
15334
|
|
|
15335
|
+
exports.definitionDeployedData = invariants.definitionDeployedData;
|
|
15336
|
+
|
|
15661
15337
|
exports.deriveActivityKind = invariants.deriveActivityKind;
|
|
15662
15338
|
|
|
15663
15339
|
exports.deriveExecutorClassification = invariants.deriveExecutorClassification;
|
|
@@ -15708,10 +15384,20 @@ exports.isTodoListEntry = invariants.isTodoListEntry;
|
|
|
15708
15384
|
|
|
15709
15385
|
exports.isTodoListItem = invariants.isTodoListItem;
|
|
15710
15386
|
|
|
15387
|
+
exports.isUnprimed = invariants.isUnprimed;
|
|
15388
|
+
|
|
15711
15389
|
exports.lakePrincipalId = invariants.lakePrincipalId;
|
|
15712
15390
|
|
|
15391
|
+
exports.noopTelemetry = invariants.noopTelemetry;
|
|
15392
|
+
|
|
15713
15393
|
exports.openActivityAssignments = invariants.openActivityAssignments;
|
|
15714
15394
|
|
|
15395
|
+
exports.parentRef = invariants.parentRef;
|
|
15396
|
+
|
|
15397
|
+
exports.parseDefinitionSnapshot = invariants.parseDefinitionSnapshot;
|
|
15398
|
+
|
|
15399
|
+
exports.parseDefinitionSnapshotValue = invariants.parseDefinitionSnapshotValue;
|
|
15400
|
+
|
|
15715
15401
|
exports.parseGdr = invariants.parseGdr;
|
|
15716
15402
|
|
|
15717
15403
|
exports.parseResourceGdr = invariants.parseResourceGdr;
|
|
@@ -15734,6 +15420,8 @@ exports.releaseDocId = invariants.releaseDocId;
|
|
|
15734
15420
|
|
|
15735
15421
|
exports.releaseRef = invariants.releaseRef;
|
|
15736
15422
|
|
|
15423
|
+
exports.resolveFieldEntry = invariants.resolveFieldEntry;
|
|
15424
|
+
|
|
15737
15425
|
exports.resourceAliasesToMap = invariants.resourceAliasesToMap;
|
|
15738
15426
|
|
|
15739
15427
|
exports.resourceFromParsed = invariants.resourceFromParsed;
|
|
@@ -15750,6 +15438,8 @@ exports.startKindOf = invariants.startKindOf;
|
|
|
15750
15438
|
|
|
15751
15439
|
exports.tagScopeFilter = invariants.tagScopeFilter;
|
|
15752
15440
|
|
|
15441
|
+
exports.terminalState = invariants.terminalState;
|
|
15442
|
+
|
|
15753
15443
|
exports.toBareId = invariants.toBareId;
|
|
15754
15444
|
|
|
15755
15445
|
exports.tryParseGdr = invariants.tryParseGdr;
|
|
@@ -15952,46 +15642,18 @@ exports.StartNotPrimedError = StartNotPrimedError;
|
|
|
15952
15642
|
|
|
15953
15643
|
exports.StartNotSettledError = StartNotSettledError;
|
|
15954
15644
|
|
|
15955
|
-
exports.WORKFLOW_INSTANCE_TYPE = WORKFLOW_INSTANCE_TYPE;
|
|
15956
|
-
|
|
15957
|
-
exports.WorkflowActionFired = WorkflowActionFired;
|
|
15958
|
-
|
|
15959
|
-
exports.WorkflowActivityReset = WorkflowActivityReset;
|
|
15960
|
-
|
|
15961
|
-
exports.WorkflowDefinitionDeleted = WorkflowDefinitionDeleted;
|
|
15962
|
-
|
|
15963
|
-
exports.WorkflowDefinitionDeployed = WorkflowDefinitionDeployed;
|
|
15964
|
-
|
|
15965
|
-
exports.WorkflowEffectCompleted = WorkflowEffectCompleted;
|
|
15966
|
-
|
|
15967
|
-
exports.WorkflowEffectStateReported = WorkflowEffectStateReported;
|
|
15968
|
-
|
|
15969
|
-
exports.WorkflowEffectsDrained = WorkflowEffectsDrained;
|
|
15970
|
-
|
|
15971
|
-
exports.WorkflowFieldEdited = WorkflowFieldEdited;
|
|
15972
|
-
|
|
15973
|
-
exports.WorkflowInstanceAborted = WorkflowInstanceAborted;
|
|
15974
|
-
|
|
15975
15645
|
exports.WorkflowInstancePreviewSchema = WorkflowInstancePreviewSchema;
|
|
15976
15646
|
|
|
15977
15647
|
exports.WorkflowInstanceSchema = WorkflowInstanceSchema;
|
|
15978
15648
|
|
|
15979
|
-
exports.WorkflowInstanceStarted = WorkflowInstanceStarted;
|
|
15980
|
-
|
|
15981
|
-
exports.WorkflowInstanceTicked = WorkflowInstanceTicked;
|
|
15982
|
-
|
|
15983
|
-
exports.WorkflowStageSet = WorkflowStageSet;
|
|
15984
|
-
|
|
15985
|
-
exports.WorkflowStageTransitioned = WorkflowStageTransitioned;
|
|
15986
|
-
|
|
15987
15649
|
exports.WorkflowStateDivergedError = WorkflowStateDivergedError;
|
|
15988
15650
|
|
|
15989
15651
|
exports._additionalMissingDocuments = _additionalMissingDocuments;
|
|
15990
15652
|
|
|
15991
|
-
exports._fieldTargetLabel = _fieldTargetLabel;
|
|
15992
|
-
|
|
15993
15653
|
exports._missingDocumentsSummary = _missingDocumentsSummary;
|
|
15994
15654
|
|
|
15655
|
+
exports._parseDefinitionsWithReaderModel = _parseDefinitionsWithReaderModel;
|
|
15656
|
+
|
|
15995
15657
|
exports._requestProjectMembers = _requestProjectMembers;
|
|
15996
15658
|
|
|
15997
15659
|
exports._resolveTelemetryEnvironment = _resolveTelemetryEnvironment;
|
|
@@ -16052,8 +15714,6 @@ exports.createTelemetryIntake = createTelemetryIntake;
|
|
|
16052
15714
|
|
|
16053
15715
|
exports.defaultLoggerFactory = defaultLoggerFactory;
|
|
16054
15716
|
|
|
16055
|
-
exports.definitionDeployedData = definitionDeployedData;
|
|
16056
|
-
|
|
16057
15717
|
exports.definitionLookupGroq = definitionLookupGroq;
|
|
16058
15718
|
|
|
16059
15719
|
exports.definitionRoleNames = definitionRoleNames;
|
|
@@ -16174,8 +15834,6 @@ exports.isTelemetryEnvDenied = isTelemetryEnvDenied;
|
|
|
16174
15834
|
|
|
16175
15835
|
exports.isTerminalStage = isTerminalStage;
|
|
16176
15836
|
|
|
16177
|
-
exports.isUnprimed = isUnprimed;
|
|
16178
|
-
|
|
16179
15837
|
exports.lakeGuardId = lakeGuardId;
|
|
16180
15838
|
|
|
16181
15839
|
exports.latestDefinitionsGroq = latestDefinitionsGroq;
|
|
@@ -16192,16 +15850,8 @@ exports.modelVersionOf = modelVersionOf;
|
|
|
16192
15850
|
|
|
16193
15851
|
exports.narrateAutonomyWaits = narrateAutonomyWaits;
|
|
16194
15852
|
|
|
16195
|
-
exports.noopTelemetry = noopTelemetry;
|
|
16196
|
-
|
|
16197
|
-
exports.parentRef = parentRef;
|
|
16198
|
-
|
|
16199
15853
|
exports.parseDefinitionInput = parseDefinitionInput;
|
|
16200
15854
|
|
|
16201
|
-
exports.parseDefinitionSnapshot = parseDefinitionSnapshot;
|
|
16202
|
-
|
|
16203
|
-
exports.parseDefinitionSnapshotValue = parseDefinitionSnapshotValue;
|
|
16204
|
-
|
|
16205
15855
|
exports.parseGuardDocument = parseGuardDocument;
|
|
16206
15856
|
|
|
16207
15857
|
exports.parseInstanceDocument = parseInstanceDocument;
|
|
@@ -16236,8 +15886,6 @@ exports.resolveActor = resolveActor;
|
|
|
16236
15886
|
|
|
16237
15887
|
exports.resolveClientActor = resolveClientActor;
|
|
16238
15888
|
|
|
16239
|
-
exports.resolveFieldEntry = resolveFieldEntry$1;
|
|
16240
|
-
|
|
16241
15889
|
exports.resolveUserAttributes = resolveUserAttributes;
|
|
16242
15890
|
|
|
16243
15891
|
exports.retractStageGuards = retractStageGuards;
|
|
@@ -16264,8 +15912,6 @@ exports.subscriptionDocumentsForInstance = subscriptionDocumentsForInstance;
|
|
|
16264
15912
|
|
|
16265
15913
|
exports.sweepStaleClaims = sweepStaleClaims;
|
|
16266
15914
|
|
|
16267
|
-
exports.terminalState = terminalState;
|
|
16268
|
-
|
|
16269
15915
|
exports.unboundRequirementReads = unboundRequirementReads;
|
|
16270
15916
|
|
|
16271
15917
|
exports.unsatisfiedTransitionSummaries = unsatisfiedTransitionSummaries;
|