@nathanstephenson/flow 0.1.10-beta.1 → 0.1.10-beta.3

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.
Files changed (73) hide show
  1. package/README.md +18 -0
  2. package/build/backend-worker-chunks/{chunk-CYE5L6Z5.mjs → chunk-LO7O6NAM.mjs} +9 -7
  3. package/build/backend-worker-chunks/{claude-UXZDJKZQ.mjs → claude-6L5KCQWJ.mjs} +99 -21
  4. package/build/backend-worker-chunks/{pi-UKRC4DDM.mjs → pi-QNU2YE4G.mjs} +45 -13
  5. package/build/backend-worker.mjs +48 -7
  6. package/dist/backend/claude/background-calls.js +7 -3
  7. package/dist/backend/claude/index.js +72 -10
  8. package/dist/backend/claude/subagents.js +30 -9
  9. package/dist/backend/fake/index.js +36 -6
  10. package/dist/backend/pi/index.js +34 -2
  11. package/dist/backend/pi/state.js +16 -1
  12. package/dist/backend/pi/subagents.js +7 -3
  13. package/dist/backend/worker/claude-state.js +22 -0
  14. package/dist/backend/worker/entry.js +25 -6
  15. package/dist/backend/worker/index.js +30 -5
  16. package/dist/backend/worker/protocol.js +1 -1
  17. package/dist/backend/worker/rpc.js +13 -0
  18. package/dist/backend/worker/sandbox-mcp.js +18 -7
  19. package/dist/backend/workflow-tools.js +9 -7
  20. package/dist/build-id +1 -1
  21. package/dist/cli/bootstrap.js +1 -1
  22. package/dist/client/reduce.js +29 -3
  23. package/dist/client/subagent-tree.js +49 -0
  24. package/dist/daemon/git.js +10 -7
  25. package/dist/daemon/host.js +226 -26
  26. package/dist/daemon/runtime.js +71 -3
  27. package/dist/daemon/server.js +3 -0
  28. package/dist/daemon/store.js +2 -0
  29. package/dist/daemon/workflow-builder-guidance.js +1 -1
  30. package/dist/daemon/workflow-builder.js +36 -11
  31. package/dist/daemon/workflow-environment.js +191 -0
  32. package/dist/daemon/workflow-execution-launch.js +77 -0
  33. package/dist/daemon/workflow-execution-resources.js +76 -0
  34. package/dist/daemon/workflow-execution-routes.js +9 -6
  35. package/dist/daemon/workflow-execution-values.js +128 -0
  36. package/dist/daemon/workflow-executions.js +382 -300
  37. package/dist/daemon/workflow-routes.js +39 -0
  38. package/dist/daemon/workflow-schedule-driver.js +247 -0
  39. package/dist/daemon/workflow-schedule-routes.js +137 -0
  40. package/dist/daemon/workflow-schedules.js +341 -0
  41. package/dist/isolation/sandbox.js +30 -14
  42. package/dist/isolation/shared-sandbox.js +3 -3
  43. package/dist/protocol/events.js +2 -0
  44. package/dist/protocol/workflow-schedules.js +1 -0
  45. package/dist/tui/render.js +7 -1
  46. package/dist/workflows/calls.js +53 -0
  47. package/dist/workflows/errors.js +2 -0
  48. package/dist/workflows/executors.js +1 -1
  49. package/dist/workflows/graph.js +78 -4
  50. package/dist/workflows/invocations.js +23 -0
  51. package/dist/workflows/owner.js +45 -0
  52. package/dist/workflows/records.js +124 -8
  53. package/dist/workflows/recovery.js +37 -1
  54. package/dist/workflows/schedule-errors.js +2 -0
  55. package/dist/workflows/schedule-store.js +385 -0
  56. package/dist/workflows/scheduler.js +351 -92
  57. package/dist/workflows/schedules.js +129 -0
  58. package/dist/workflows/schema.js +2 -0
  59. package/dist/workflows/store.js +110 -11
  60. package/package.json +2 -1
  61. package/web/dist/assets/index-BGu3YSP7.css +2 -0
  62. package/web/dist/assets/index-Miy2nveb.js +40 -0
  63. package/web/dist/assets/{settings-mcp-Clp_jMWW.js → settings-mcp-Vf_fCXyE.js} +1 -1
  64. package/web/dist/assets/settings-workflows-DVKxJWQm.js +23 -0
  65. package/web/dist/assets/workflows-Dobqzjg-.js +146 -0
  66. package/web/dist/assets/workflows-pane-KB-Q76KZ.js +1 -0
  67. package/web/dist/index.html +4 -3
  68. package/web/dist/assets/index-DRfeO6GJ.js +0 -40
  69. package/web/dist/assets/index-DgQFpKbn.css +0 -2
  70. package/web/dist/assets/settings-workflows-H-6eCff3.js +0 -23
  71. package/web/dist/assets/workflow-editors-CsbVx4WJ.js +0 -139
  72. package/web/dist/assets/workflows-Bv0sj7d0.js +0 -7
  73. package/web/dist/assets/workflows-pane-DHm44w7P.js +0 -1
@@ -0,0 +1,23 @@
1
+ import { executionIdentity } from "./owner.js";
2
+ export class WorkflowInvocationNotFound extends Error {
3
+ }
4
+ export function invocationExecution(root, invocationId) {
5
+ if (!root.invocations || !Object.hasOwn(root.invocations, invocationId))
6
+ throw new WorkflowInvocationNotFound('Unknown workflow invocation');
7
+ const invocation = root.invocations[invocationId];
8
+ const retained = root.retainedDefinitions?.[invocation.definitionId];
9
+ if (!retained)
10
+ throw new Error('Missing retained Workflow Definition');
11
+ const definition = structuredClone(retained);
12
+ for (const correction of invocation.definitionUpdates ?? []) {
13
+ const index = definition.steps.findIndex(step => step.id === correction.stepId);
14
+ if (index < 0)
15
+ throw new Error('Invalid invocation correction');
16
+ definition.steps[index] = structuredClone(correction.nextStep);
17
+ }
18
+ return { ...structuredClone(invocation), ...executionIdentity(root), scope: root.scope, definition };
19
+ }
20
+ export function invocationCheckpoint(record, ownership) {
21
+ const { version: _, occurrenceId: _occurrence, runtime: _runtime, sessionId: __, scope: ___, definition: ____, ...state } = record;
22
+ return { ...state, ...ownership };
23
+ }
@@ -0,0 +1,45 @@
1
+ import { join } from 'node:path';
2
+ function storageId(value) {
3
+ if (!/^[a-zA-Z0-9_-]+$/.test(value))
4
+ throw new Error('Invalid storage ID');
5
+ return value;
6
+ }
7
+ export function executionOwnerOf(value) {
8
+ if (value.version === 1 && (value.occurrenceId !== undefined || !value.sessionId))
9
+ throw new Error('Invalid execution owner');
10
+ if (value.version === 2 && !value.occurrenceId)
11
+ throw new Error('Invalid execution owner');
12
+ if (value.occurrenceId !== undefined)
13
+ return { kind: 'occurrence', occurrenceId: storageId(value.occurrenceId) };
14
+ if (value.sessionId)
15
+ return { kind: 'session', sessionId: storageId(value.sessionId) };
16
+ throw new Error('Missing execution owner');
17
+ }
18
+ export function executionOwnerKey(owner) {
19
+ return owner.kind === 'occurrence' ? `occurrence-${storageId(owner.occurrenceId)}` : storageId(owner.sessionId);
20
+ }
21
+ export function parseExecutionOwnerKey(key) {
22
+ storageId(key);
23
+ return key.startsWith('occurrence-') ? { kind: 'occurrence', occurrenceId: storageId(key.slice(11)) } : { kind: 'session', sessionId: key };
24
+ }
25
+ export function executionOwnerPath(stateRoot, owner) {
26
+ return owner.kind === 'occurrence'
27
+ ? join(stateRoot, 'workflow-schedules', 'executions', storageId(owner.occurrenceId))
28
+ : join(stateRoot, 'sessions', storageId(owner.sessionId));
29
+ }
30
+ export function executionIdentity(value) {
31
+ const owner = executionOwnerOf(value);
32
+ return owner.kind === 'session'
33
+ ? { version: 1, sessionId: owner.sessionId }
34
+ : { version: 2, occurrenceId: owner.occurrenceId, ...(value.sessionId === undefined ? {} : { sessionId: storageId(value.sessionId) }) };
35
+ }
36
+ export function executionAssociation(value) {
37
+ return executionOwnerOf(value).kind === 'occurrence' ? value.sessionId : undefined;
38
+ }
39
+ export function executionAccessibleBy(value, owner) {
40
+ const requested = typeof owner === 'string' ? parseExecutionOwnerKey(owner) : owner;
41
+ const actual = executionOwnerOf(value);
42
+ if (requested.kind === 'occurrence')
43
+ return actual.kind === 'occurrence' && actual.occurrenceId === requested.occurrenceId;
44
+ return actual.kind === 'session' ? actual.sessionId === requested.sessionId : executionAssociation(value) === requested.sessionId;
45
+ }
@@ -1,8 +1,11 @@
1
1
  import { boundedMcpValue, validateMcpOutput } from "./mcp.js";
2
2
  import { z } from 'zod';
3
3
  import { isDeepStrictEqual } from 'node:util';
4
+ import { resolveWorkflowCalls } from "./calls.js";
5
+ import { dictionaryRecord } from "./schema.js";
4
6
  import { validateDefinition, workflowDefinitionValidator } from "./graph.js";
5
7
  import { validateCompatibleDefinition } from "./recovery.js";
8
+ import { executionIdentity, executionOwnerKey, executionOwnerOf } from "./owner.js";
6
9
  const errorValidator = z.object({ message: z.string(), kind: z.enum(['failure', 'timeout', 'interrupted']) }).strict();
7
10
  const identityValidator = z.object({ headerId: z.string().min(1), activation: z.number().int().positive(), try: z.number().int().positive() }).strict();
8
11
  const loopValidator = z.object({
@@ -12,25 +15,33 @@ const loopValidator = z.object({
12
15
  }).strict();
13
16
  const attemptValidator = z.object({
14
17
  loops: z.array(identityValidator).optional(),
15
- number: z.number().int().positive(), action: z.enum(['execute', 'retry', 'supply']), startedAt: z.number().nonnegative(), finishedAt: z.number().nonnegative().optional(),
18
+ number: z.number().int().positive(), action: z.enum(['execute', 'retry', 'supply']), startedAt: z.number().nonnegative(), deadlineAt: z.number().nonnegative().optional(), finishedAt: z.number().nonnegative().optional(),
16
19
  input: z.json(), output: z.json().optional(), partialOutput: z.json().optional(), error: errorValidator.optional(),
17
20
  }).strict();
18
- export const workflowExecutionValidator = z.object({
19
- version: z.literal(1), id: z.string().min(1), sessionId: z.string().min(1), scope: z.string(), definition: workflowDefinitionValidator,
21
+ const checkpointFields = {
20
22
  definitionUpdates: z.array(z.object({
21
23
  stepId: z.string().min(1), previousStep: workflowDefinitionValidator.shape.steps.element, nextStep: workflowDefinitionValidator.shape.steps.element,
22
24
  appliedAt: z.number().nonnegative(), attempt: z.number().int().min(2),
23
25
  }).strict()).optional(),
24
- input: z.json(), launchId: z.string().min(1).optional(), naming: z.enum(['pending', 'requested']).optional(), testStepId: z.string().optional(), status: z.enum(['running', 'recovery-required', 'completed', 'completed-with-recovery', 'cancelled']),
26
+ input: z.json(), status: z.enum(['running', 'recovery-required', 'completed', 'completed-with-recovery', 'cancelled']),
25
27
  startedAt: z.number().nonnegative(), finishedAt: z.number().nonnegative().optional(), result: z.json().optional(),
26
- loops: z.record(z.string(), loopValidator).optional(),
27
- steps: z.record(z.string(), z.object({
28
+ loops: dictionaryRecord(loopValidator).optional(),
29
+ steps: dictionaryRecord(z.object({
28
30
  status: z.enum(['pending', 'running', 'completed', 'failed', 'timed-out', 'interrupted', 'skipped', 'blocked', 'cancelled']), recovery: z.boolean().optional(),
29
31
  attempts: z.array(attemptValidator), output: z.json().optional(), outcome: z.enum(['success', 'failure', 'timeout', 'true', 'false']).optional(),
30
32
  }).strict()),
33
+ };
34
+ const invocationValidator = z.object({
35
+ ...checkpointFields, id: z.string().min(1), parentInvocationId: z.string().min(1).optional(),
36
+ callStepId: z.string().min(1), callAttempt: z.number().int().positive(), definitionId: z.string().min(1),
31
37
  }).strict();
32
- export function parseExecution(value) {
33
- const record = workflowExecutionValidator.parse(value);
38
+ export const workflowExecutionValidator = z.object({
39
+ ...checkpointFields, version: z.union([z.literal(1), z.literal(2)]), occurrenceId: z.string().regex(/^[a-zA-Z0-9_-]+$/).optional(), runtime: z.object({ nodePath: z.string().optional(), isolationMode: z.enum(['none', 'bubblewrap', 'sandbox']) }).strict().optional(), id: z.string().min(1), sessionId: z.string().min(1).optional(), scope: z.string(), definition: workflowDefinitionValidator,
40
+ retainedDefinitions: z.preprocess(value => value && typeof value === 'object' && !Array.isArray(value) ? new Map(Object.entries(value)) : value, z.map(workflowDefinitionValidator.shape.id, workflowDefinitionValidator)).transform(entries => Object.fromEntries(entries)).optional(),
41
+ invocations: dictionaryRecord(invocationValidator).optional(),
42
+ launchId: z.string().min(1).optional(), naming: z.enum(['pending', 'requested']).optional(), testStepId: z.string().optional(),
43
+ }).strict();
44
+ function validateCheckpoint(record) {
34
45
  const graph = validateDefinition(record.definition);
35
46
  if (graph.order.length !== Object.keys(record.steps).length || graph.order.some(step => !Object.hasOwn(record.steps, step.id)))
36
47
  throw new Error('Execution steps do not match the definition');
@@ -53,6 +64,7 @@ export function parseExecution(value) {
53
64
  validateCompatibleDefinition(previous, definition, update.stepId);
54
65
  definition = previous;
55
66
  }
67
+ const original = definition;
56
68
  if (record.testStepId && !Object.hasOwn(record.steps, record.testStepId))
57
69
  throw new Error('Unknown test step');
58
70
  if (record.testStepId && record.naming)
@@ -100,6 +112,11 @@ export function parseExecution(value) {
100
112
  }
101
113
  const containing = loops.filter(loop => loop.memberIds.includes(id));
102
114
  for (const [index, attempt] of step.attempts.entries()) {
115
+ if (attempt.deadlineAt !== undefined) {
116
+ const configuration = stepConfiguration(record, original, id, attempt.number);
117
+ if (configuration?.kind !== 'workflow' || configuration.timeoutMs === undefined || attempt.deadlineAt !== attempt.startedAt + configuration.timeoutMs)
118
+ throw new Error('Invalid call attempt deadline');
119
+ }
103
120
  if ((attempt.loops ?? []).length !== containing.length || containing.some(loop => !attempt.loops?.some(identity => identity.headerId === loop.headerId)))
104
121
  throw new Error('Invalid attempt loop identities');
105
122
  if (containing.length && index === 0 && attempt.action !== 'execute')
@@ -133,5 +150,104 @@ export function parseExecution(value) {
133
150
  }
134
151
  if (['completed', 'completed-with-recovery'].includes(record.status) && Object.values(record.steps).some(step => ['pending', 'running', 'interrupted', 'blocked'].includes(step.status)))
135
152
  throw new Error('Completed execution contains unfinished work');
153
+ return original;
154
+ }
155
+ function stepConfiguration(record, original, stepId, attempt) {
156
+ let step = original.steps.find(step => step.id === stepId);
157
+ for (const update of record.definitionUpdates ?? [])
158
+ if (update.stepId === stepId && update.attempt <= attempt)
159
+ step = update.nextStep;
160
+ return step;
161
+ }
162
+ export function parseExecution(value) {
163
+ const record = workflowExecutionValidator.parse(value);
164
+ executionIdentity(record);
165
+ const original = validateCheckpoint(record);
166
+ const manifest = record.retainedDefinitions;
167
+ if (!manifest) {
168
+ if (record.invocations || record.definition.steps.some(step => step.kind === 'workflow'))
169
+ throw new Error('Missing retained Workflow Definitions');
170
+ return record;
171
+ }
172
+ for (const [id, definition] of Object.entries(manifest))
173
+ if (id !== definition.id)
174
+ throw new Error('Invalid retained definition identity');
175
+ if (!isDeepStrictEqual(manifest[original.id], original))
176
+ throw new Error('Retained root definition does not match the original checkpoint');
177
+ const resolved = resolveWorkflowCalls(original, id => {
178
+ if (!Object.hasOwn(manifest, id))
179
+ throw new Error('Missing retained definition');
180
+ return manifest[id];
181
+ }, record.testStepId);
182
+ if (!isDeepStrictEqual(resolved, manifest))
183
+ throw new Error('Retained definitions do not match the call manifest');
184
+ const locals = new Map();
185
+ const originals = new Map();
186
+ for (const [id, invocation] of Object.entries(record.invocations ?? {})) {
187
+ if (id !== invocation.id || id === record.id)
188
+ throw new Error('Invalid invocation identity');
189
+ const retained = manifest[invocation.definitionId];
190
+ if (!retained)
191
+ throw new Error('Missing invocation definition');
192
+ const definition = structuredClone(retained);
193
+ for (const update of invocation.definitionUpdates ?? []) {
194
+ const index = definition.steps.findIndex(step => step.id === update.stepId);
195
+ if (index < 0)
196
+ throw new Error('Unknown invocation correction step');
197
+ definition.steps[index] = structuredClone(update.nextStep);
198
+ }
199
+ const local = { ...invocation, ...executionIdentity(record), scope: record.scope, definition };
200
+ if (!isDeepStrictEqual(validateCheckpoint(local), retained))
201
+ throw new Error('Invocation corrections do not match the retained definition');
202
+ locals.set(id, local);
203
+ originals.set(id, retained);
204
+ }
205
+ const checked = new Set();
206
+ for (const id of locals.keys()) {
207
+ const path = new Set();
208
+ let current = id;
209
+ while (current !== undefined && !checked.has(current)) {
210
+ if (path.has(current))
211
+ throw new Error('Invocation parent cycle');
212
+ path.add(current);
213
+ const invocation = record.invocations[current];
214
+ if (!invocation)
215
+ throw new Error('Missing parent invocation');
216
+ current = invocation.parentInvocationId;
217
+ }
218
+ for (const ancestor of path)
219
+ checked.add(ancestor);
220
+ }
221
+ const owners = new Set();
222
+ for (const [id, invocation] of Object.entries(record.invocations ?? {})) {
223
+ const parentId = invocation.parentInvocationId;
224
+ const parent = parentId === undefined ? record : locals.get(parentId);
225
+ const parentOriginal = parentId === undefined ? original : originals.get(parentId);
226
+ const step = stepConfiguration(parent, parentOriginal, invocation.callStepId, invocation.callAttempt);
227
+ const state = parent.steps[invocation.callStepId];
228
+ const attempt = state?.attempts[invocation.callAttempt - 1];
229
+ if (step?.kind !== 'workflow' || step.workflowId !== invocation.definitionId || !attempt || attempt.action === 'supply' || (parent.testStepId !== undefined && parent.testStepId !== step.id))
230
+ throw new Error('Invalid invocation call ownership');
231
+ if (!isDeepStrictEqual(invocation.input, attempt.input))
232
+ throw new Error('Invocation input does not match the call attempt');
233
+ if (step.timeoutMs !== undefined && attempt.deadlineAt === undefined)
234
+ throw new Error('Missing call attempt deadline');
235
+ if (invocation.callAttempt < state.attempts.length && ['running', 'recovery-required'].includes(invocation.status))
236
+ throw new Error('Unfinished invocation belongs to an earlier call attempt');
237
+ const owner = JSON.stringify([parentId ?? null, invocation.callStepId, invocation.callAttempt]);
238
+ if (owners.has(owner))
239
+ throw new Error('Duplicate invocation call ownership');
240
+ owners.add(owner);
241
+ if (['completed', 'completed-with-recovery'].includes(invocation.status) && invocation.result === undefined)
242
+ throw new Error('Missing completed invocation result');
243
+ if (['completed', 'completed-with-recovery'].includes(record.status) && ['running', 'recovery-required'].includes(invocation.status))
244
+ throw new Error('Completed execution contains unfinished invocations');
245
+ if (!locals.has(id))
246
+ throw new Error('Missing invocation checkpoint');
247
+ }
136
248
  return record;
137
249
  }
250
+ /** Stable checkpoint owner, independent of optional Agent Session association. */
251
+ export function executionOwner(record) {
252
+ return executionOwnerKey(executionOwnerOf(record));
253
+ }
@@ -1,6 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { isDeepStrictEqual } from 'node:util';
3
3
  import { validateDefinition } from "./graph.js";
4
+ import { invocationExecution } from "./invocations.js";
4
5
  // Object key order is not part of a saved definition's identity; array order is.
5
6
  function canonical(value) {
6
7
  if (Array.isArray(value))
@@ -48,17 +49,52 @@ export function validateCompatibleDefinition(previous, candidate, stepId) {
48
49
  }
49
50
  return graph;
50
51
  }
52
+ export function recoverySteps(root, action, replacement) {
53
+ const steps = [];
54
+ let invocationId = action.invocationId, selected = true;
55
+ for (;;) {
56
+ const current = invocationId === undefined ? root : invocationExecution(root, invocationId);
57
+ const graph = validateDefinition(selected && replacement ? replacement : current.definition);
58
+ const repeating = new Set(current.testStepId ? [] : graph.loops.filter(loop => ['active', 'repeating', 'limit'].includes(current.loops?.[loop.headerId]?.phase ?? 'inactive')).flatMap(loop => loop.memberIds));
59
+ const owned = new Set(Object.values(root.invocations ?? {}).filter(invocation => {
60
+ const call = current.steps[invocation.callStepId];
61
+ return invocation.parentInvocationId === invocationId && call?.status === 'running' && invocation.callAttempt === call.attempts.length;
62
+ }).map(invocation => invocation.callStepId));
63
+ for (const step of graph.order) {
64
+ if (current.testStepId && current.testStepId !== step.id)
65
+ continue;
66
+ if (!repeating.has(step.id)) {
67
+ const state = current.steps[step.id];
68
+ if (!current.testStepId && ['failed', 'timed-out'].includes(state.status) && !state.recovery && graph.outgoing.get(step.id).some(edge => edge.outcome === state.outcome))
69
+ continue;
70
+ if (state.status === 'completed' || owned.has(step.id))
71
+ continue;
72
+ if (selected && action.kind === 'supply' && action.stepId === step.id)
73
+ continue;
74
+ }
75
+ steps.push(step);
76
+ }
77
+ if (invocationId === undefined)
78
+ return steps;
79
+ invocationId = root.invocations[invocationId].parentInvocationId;
80
+ selected = false;
81
+ }
82
+ }
51
83
  /** State identity, not wall-clock time: repeated notifications cannot mint new authority. */
52
84
  export function recoveryRevision(record) {
53
85
  return createHash('sha256').update(JSON.stringify({ id: record.id, status: record.status,
54
86
  steps: Object.entries(record.steps).map(([id, step]) => [id, step.status, step.attempts.map(a => [a.number, a.action, a.finishedAt, a.error])]),
55
87
  loops: record.loops, definition: savedDefinitionRevision(record.definition), definitionUpdates: record.definitionUpdates,
88
+ invocations: record.invocations, retainedDefinitions: record.retainedDefinitions,
56
89
  })).digest('hex');
57
90
  }
58
91
  export function successfulProgress(record) {
59
- return Object.values(record.steps).reduce((count, step) => count + step.attempts.filter(a => a.finishedAt !== undefined && a.output !== undefined && !a.error && a.action !== 'supply').length, 0);
92
+ const local = (execution) => Object.entries(execution.steps).reduce((count, [id, step]) => count + (execution.definition.steps.find(step => step.id === id)?.kind === 'workflow' ? 0 : step.attempts.filter(a => a.finishedAt !== undefined && a.output !== undefined && !a.error && a.action !== 'supply').length), 0);
93
+ return local(record) + Object.keys(record.invocations ?? {}).reduce((count, id) => count + local(invocationExecution(record, id)), 0);
60
94
  }
61
95
  export function safeAutomaticRecovery(record, action) {
96
+ if (action.invocationId)
97
+ record = invocationExecution(record, action.invocationId);
62
98
  if (record.status !== 'recovery-required' || Object.values(record.loops ?? {}).some(loop => loop.phase === 'limit'))
63
99
  return false;
64
100
  if (action.kind === 'retry') {
@@ -0,0 +1,2 @@
1
+ export class ScheduleValidationError extends Error {
2
+ }