@memberjunction/task-graph 0.0.0 → 6.1.0-edge.2

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 (51) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +167 -27
  3. package/dist/DispatcherConditionEvaluator.d.ts +10 -0
  4. package/dist/DispatcherConditionEvaluator.d.ts.map +1 -0
  5. package/dist/DispatcherConditionEvaluator.js +27 -0
  6. package/dist/DispatcherConditionEvaluator.js.map +1 -0
  7. package/dist/TaskClaimStore.d.ts +125 -0
  8. package/dist/TaskClaimStore.d.ts.map +1 -0
  9. package/dist/TaskClaimStore.js +223 -0
  10. package/dist/TaskClaimStore.js.map +1 -0
  11. package/dist/TaskGraphDispatcher.d.ts +548 -0
  12. package/dist/TaskGraphDispatcher.d.ts.map +1 -0
  13. package/dist/TaskGraphDispatcher.js +2232 -0
  14. package/dist/TaskGraphDispatcher.js.map +1 -0
  15. package/dist/TaskGraphService.d.ts +247 -0
  16. package/dist/TaskGraphService.d.ts.map +1 -0
  17. package/dist/TaskGraphService.js +753 -0
  18. package/dist/TaskGraphService.js.map +1 -0
  19. package/dist/TaskGraphSubmitterImpl.d.ts +7 -0
  20. package/dist/TaskGraphSubmitterImpl.d.ts.map +1 -0
  21. package/dist/TaskGraphSubmitterImpl.js +52 -0
  22. package/dist/TaskGraphSubmitterImpl.js.map +1 -0
  23. package/dist/TaskLoopExecutor.d.ts +62 -0
  24. package/dist/TaskLoopExecutor.d.ts.map +1 -0
  25. package/dist/TaskLoopExecutor.js +248 -0
  26. package/dist/TaskLoopExecutor.js.map +1 -0
  27. package/dist/WorkflowSpecSync.d.ts +197 -0
  28. package/dist/WorkflowSpecSync.d.ts.map +1 -0
  29. package/dist/WorkflowSpecSync.js +474 -0
  30. package/dist/WorkflowSpecSync.js.map +1 -0
  31. package/dist/index.d.ts +19 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +19 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/operations/TaskGraphOperations.d.ts +39 -0
  36. package/dist/operations/TaskGraphOperations.d.ts.map +1 -0
  37. package/dist/operations/TaskGraphOperations.js +168 -0
  38. package/dist/operations/TaskGraphOperations.js.map +1 -0
  39. package/dist/operations/WorkflowDraftOperation.d.ts +37 -0
  40. package/dist/operations/WorkflowDraftOperation.d.ts.map +1 -0
  41. package/dist/operations/WorkflowDraftOperation.js +141 -0
  42. package/dist/operations/WorkflowDraftOperation.js.map +1 -0
  43. package/dist/operations/WorkflowOperations.d.ts +22 -0
  44. package/dist/operations/WorkflowOperations.d.ts.map +1 -0
  45. package/dist/operations/WorkflowOperations.js +99 -0
  46. package/dist/operations/WorkflowOperations.js.map +1 -0
  47. package/dist/types.d.ts +328 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +9 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +36 -8
@@ -0,0 +1,474 @@
1
+ /**
2
+ * @fileoverview Persists a `WorkflowSpec` by **reconciling substrates that already exist**.
3
+ *
4
+ * **The central design constraint: no new storage.** There is no `Workflow` table and there will not
5
+ * be one. A workflow's WHAT is a Flow agent (the graph); its WHEN is a Scheduled Job or an Entity
6
+ * Action binding. Inventing a parallel `Workflow` row would create a second definition of "a
7
+ * scheduled thing", and the scheduler would then have two masters that can disagree — which is
8
+ * exactly the class of divergence this whole program has been removing.
9
+ *
10
+ * So this is a **reconciler**, not a writer. It follows the pattern
11
+ * `MJRecordProcessEntityServer.Save()` already proved: resolve the job type, find the rows this
12
+ * definition owns, then upsert or disable them so the substrate matches the spec. Rows are matched
13
+ * by a marker in their own `Configuration`, which is what makes ownership survive a rename.
14
+ *
15
+ * **Agent persistence crosses a seam.** Writing the Flow agent behind the graph is `AgentSpecSync`'s
16
+ * job — it already owns atomic multi-entity agent writes and the mutation audit. Importing it here
17
+ * would pull the agent-manager package into the execution substrate, so the host injects it instead.
18
+ * A caller with no agent writer still gets correct trigger reconciliation and an honest error rather
19
+ * than a half-persisted workflow.
20
+ *
21
+ * @module @memberjunction/task-graph
22
+ */
23
+ import { LogError, LogStatus, RunView } from '@memberjunction/core';
24
+ import { SafeJSONParse, UUIDsEqual } from '@memberjunction/global';
25
+ import { BuildChangeFilterCode } from '@memberjunction/actions-base';
26
+ import { FormatWorkflowValidationErrors, NormalizeInvocationType, NormalizeTriggers, ValidateWorkflowSpec, } from '@memberjunction/ai-core-plus';
27
+ /**
28
+ * Scheduled Job Type that runs a workflow's Flow agent.
29
+ *
30
+ * `'Agent'` is an existing seeded type backed by `AgentScheduledJobDriver` — a workflow's schedule
31
+ * reuses it rather than introducing a parallel one. `ScheduledJobType.DriverClass` is UNIQUE, so a
32
+ * second type for the same driver is not merely redundant, it is impossible; discovering that is
33
+ * what confirmed the substrate was already there and only the authoring surface was missing.
34
+ */
35
+ export const RUN_WORKFLOW_JOB_TYPE = 'Agent';
36
+ /** Marker written into an owned row's `Configuration`, so ownership survives a rename. */
37
+ export const WORKFLOW_OWNER_KEY = 'WorkflowAgentID';
38
+ /**
39
+ * The Action an entity-change trigger dispatches to.
40
+ *
41
+ * `Execute Agent` already exists and was written for exactly this: "a concrete dispatch target for
42
+ * `AIAgent.ExposeAsAction`". Entity-action *invocation* is likewise already wired — the save pipeline
43
+ * fires validate / before-save / after-save / before-delete / after-delete through
44
+ * `HandleEntityActions`. So an entity-change trigger needs no new machinery at all; it needs a
45
+ * binding row, which is what this creates.
46
+ */
47
+ export const EXECUTE_AGENT_ACTION = 'Execute Agent';
48
+ export class WorkflowSpecSync {
49
+ constructor(agentWriter = null) {
50
+ this.agentWriter = agentWriter;
51
+ }
52
+ /**
53
+ * Reconciles every substrate a workflow owns, so they match the spec.
54
+ *
55
+ * Order matters: the agent is persisted first because a Scheduled Job needs its ID to point at,
56
+ * and a job pointing at an agent that does not exist would be a scheduled no-op — the failure
57
+ * mode where everything looks configured and nothing ever runs.
58
+ */
59
+ async Persist(spec, context) {
60
+ const validation = ValidateWorkflowSpec(spec);
61
+ if (!validation.Valid) {
62
+ const message = `Workflow "${spec?.name}" is invalid:\n${FormatWorkflowValidationErrors(validation.Errors)}`;
63
+ LogError(`[WorkflowSpecSync] ${message}`);
64
+ return { Success: false, ScheduledJobIDs: [], Unreconciled: [], ErrorMessage: message };
65
+ }
66
+ if (!this.agentWriter) {
67
+ const message = 'No workflow agent writer is registered on this host, so the workflow could not be saved. ' +
68
+ 'Persisting a workflow requires the agent-authoring package to be loaded.';
69
+ LogError(`[WorkflowSpecSync] ${message}`);
70
+ return { Success: false, ScheduledJobIDs: [], Unreconciled: [], ErrorMessage: message };
71
+ }
72
+ try {
73
+ const agentID = await this.agentWriter.PersistFlowAgent(spec, context);
74
+ const { ScheduledJobIDs, Unreconciled } = await this.reconcileTriggers(spec, agentID, context);
75
+ LogStatus(`[WorkflowSpecSync] Saved "${spec.name}" as agent ${agentID}; ` +
76
+ `${ScheduledJobIDs.length} scheduled job(s) reconciled.`);
77
+ return { Success: true, AgentID: agentID, ScheduledJobIDs, Unreconciled };
78
+ }
79
+ catch (e) {
80
+ const message = e instanceof Error ? e.message : String(e);
81
+ LogError(`[WorkflowSpecSync] Persist failed for "${spec.name}": ${message}`);
82
+ return { Success: false, ScheduledJobIDs: [], Unreconciled: [], ErrorMessage: message };
83
+ }
84
+ }
85
+ /**
86
+ * Brings the workflow's owned trigger rows in line with its spec.
87
+ *
88
+ * A trigger the spec no longer names has its owned row **disabled rather than deleted**. Deleting
89
+ * would destroy the run history attached to it, and a workflow whose schedule someone removed by
90
+ * mistake should be recoverable — the row carries counts, last-run and next-run that are the only
91
+ * record that it ever fired.
92
+ */
93
+ async reconcileTriggers(spec, agentID, context) {
94
+ const triggers = NormalizeTriggers(spec);
95
+ const schedules = triggers.filter((t) => t.type === 'Schedule');
96
+ const events = triggers.filter((t) => t.type === 'EntityEvent');
97
+ const unreconciled = [];
98
+ for (const event of events) {
99
+ try {
100
+ await this.reconcileEntityEvent(event, agentID, context);
101
+ }
102
+ catch (e) {
103
+ // Reported, never dropped: a user who asked for "run this when an invoice changes"
104
+ // and got a workflow that never fires has no way to discover why from the UI.
105
+ unreconciled.push(`EntityEvent on ${event.entityName}: ${e instanceof Error ? e.message : String(e)}`);
106
+ }
107
+ }
108
+ const typeID = await this.resolveJobTypeID(context);
109
+ const owned = await this.findOwnedJobs(typeID, agentID, context);
110
+ const jobIDs = [];
111
+ const keep = new Set();
112
+ for (const schedule of schedules) {
113
+ const key = this.scheduleKey(schedule);
114
+ keep.add(key);
115
+ const existing = owned.find((j) => this.scheduleKeyOf(j) === key) ?? null;
116
+ jobIDs.push(await this.upsertScheduledJob(spec, agentID, typeID, schedule, existing, context));
117
+ }
118
+ for (const job of owned) {
119
+ if (keep.has(this.scheduleKeyOf(job) ?? ''))
120
+ continue;
121
+ if (job.Status === 'Disabled')
122
+ continue;
123
+ job.Status = 'Disabled';
124
+ if (await job.Save()) {
125
+ jobIDs.push(job.ID);
126
+ LogStatus(`[WorkflowSpecSync] Disabled scheduled job ${job.ID} — its trigger is no longer in the workflow.`);
127
+ }
128
+ else {
129
+ LogError(`[WorkflowSpecSync] Could not disable scheduled job ${job.ID}: ${job.LatestResult?.CompleteMessage ?? 'unknown error'}`);
130
+ }
131
+ }
132
+ return { ScheduledJobIDs: jobIDs, Unreconciled: unreconciled };
133
+ }
134
+ /** Identity of a schedule within a workflow — cron plus zone, matching `TriggerKey`. */
135
+ scheduleKey(trigger) {
136
+ return `${trigger.cron}|${trigger.timezone ?? ''}`;
137
+ }
138
+ /** The same identity, read back off a persisted job. */
139
+ scheduleKeyOf(job) {
140
+ return job.CronExpression ? `${job.CronExpression}|${job.Timezone ?? ''}` : null;
141
+ }
142
+ /**
143
+ * Binds an entity-change trigger by creating the Entity Action rows the save pipeline already
144
+ * reads.
145
+ *
146
+ * Nothing here teaches the platform a new trick. `HandleEntityActions` has fired entity actions
147
+ * from the save pipeline all along; what was missing was a row saying "when an Invoice is
148
+ * updated, run Execute Agent with this agent". Three rows express that: the `EntityAction`
149
+ * (which entity, which action), the `EntityActionInvocation` (which change fires it), and an
150
+ * `EntityActionParam` carrying the agent to run.
151
+ *
152
+ * Idempotent by lookup rather than by delete-and-recreate: re-saving a workflow must not detach
153
+ * and re-attach a live trigger, because a change landing in that window would be missed.
154
+ *
155
+ * **Scope reconciles onto the binding's own `ScopeEntityID`/`ScopeRecordID`.** Those columns and
156
+ * the engine's scope resolver already exist for exactly this; leaving them unset while the spec
157
+ * declared a scope produced a workflow firing on every record of the entity while its author
158
+ * believed it was watching one. `filter` reconciles the same way — onto an `ActionFilter` bound
159
+ * through `EntityActionFilter`, the row the invocation path already consults.
160
+ */
161
+ async reconcileEntityEvent(trigger, agentID, context) {
162
+ const rv = RunView.FromMetadataProvider(context.Provider);
163
+ const entity = context.Provider.EntityByName(trigger.entityName);
164
+ if (!entity)
165
+ throw new Error(`entity "${trigger.entityName}" not found in metadata`);
166
+ const scope = this.resolveScope(trigger, context);
167
+ const actionResult = await rv.RunView({ EntityName: 'MJ: Actions', ExtraFilter: `Name='${EXECUTE_AGENT_ACTION}'`, ResultType: 'entity_object' }, context.ContextUser);
168
+ const action = actionResult.Results?.[0];
169
+ if (!action)
170
+ throw new Error(`the '${EXECUTE_AGENT_ACTION}' action is not present — has the metadata seed been pushed?`);
171
+ // Resolved through the shared normalizer so the shorthand an author writes ("Update") and
172
+ // the name the platform fires ("AfterUpdate") cannot drift apart.
173
+ const invocationName = NormalizeInvocationType(trigger.invocationType);
174
+ if (!invocationName)
175
+ throw new Error(`invocation type "${trigger.invocationType}" is not one this platform fires`);
176
+ const invocationResult = await rv.RunView({
177
+ EntityName: 'MJ: Entity Action Invocation Types',
178
+ ExtraFilter: `Name='${invocationName}'`,
179
+ ResultType: 'entity_object',
180
+ }, context.ContextUser);
181
+ const invocationType = invocationResult.Results?.[0];
182
+ if (!invocationType)
183
+ throw new Error(`invocation type "${invocationName}" is not seeded`);
184
+ const entityAction = await this.upsertEntityAction(entity.ID, action.ID, agentID, scope, context);
185
+ await this.upsertInvocation(entityAction.ID, invocationType.ID, context);
186
+ // Which agent to run — fixed for the life of the binding.
187
+ await this.upsertActionParam(entityAction.ID, action.ID, 'AgentID', 'Static', agentID, context);
188
+ // WHICH RECORD changed. Without this the trigger fires and the agent has no idea what it is
189
+ // looking at — a workflow that runs on every invoice update knowing nothing about any
190
+ // invoice. `Entity Object Data` rather than `Entity Object` is not a preference: a
191
+ // BaseEntity serializes to `{}` because its fields are getters, not enumerable own
192
+ // properties, so the live instance would arrive empty. `GetAll()` is what survives the wire.
193
+ await this.upsertActionParam(entityAction.ID, action.ID, 'Data', 'Entity Object Data', null, context);
194
+ await this.reconcileTriggerFilter(entityAction.ID, trigger.filter ?? null, context);
195
+ }
196
+ /**
197
+ * Brings the binding's filter row in line with the trigger's predicate.
198
+ *
199
+ * The trigger's `filter` is an expression; what the platform evaluates is an `ActionFilter.Code`
200
+ * bound through `EntityActionFilter`. That indirection is what lets a workflow narrow *when* it
201
+ * fires without the workflow layer inventing an evaluator of its own — `RunSingleFilter` already
202
+ * compiles, caches and fail-closes this code, and the change context it hands the expression is
203
+ * the same one every other entity action sees.
204
+ *
205
+ * **Removing a filter disables the binding rather than deleting the row.** The `ActionFilter`
206
+ * survives with its code intact, so re-adding the predicate is recoverable and the audit trail of
207
+ * what this trigger used to be narrowed by does not evaporate on a save. A `Disabled` binding is
208
+ * genuinely inert — {@link EntityActionInvocationSingleRecord.ResolveFilters} skips it, which
209
+ * matters because filters fail closed, so a disabled-but-honored filter would not be a no-op, it
210
+ * would be a permanent block.
211
+ */
212
+ async reconcileTriggerFilter(entityActionID, filter, context) {
213
+ const rv = RunView.FromMetadataProvider(context.Provider);
214
+ const bindingResult = await rv.RunView({
215
+ EntityName: 'MJ: Entity Action Filters',
216
+ ExtraFilter: `EntityActionID='${entityActionID}'`,
217
+ OrderBy: 'Sequence ASC',
218
+ ResultType: 'entity_object',
219
+ }, context.ContextUser);
220
+ const binding = bindingResult.Results?.[0] ?? null;
221
+ const expression = filter?.trim() ?? '';
222
+ if (!expression) {
223
+ if (binding && binding.Status !== 'Disabled') {
224
+ binding.Status = 'Disabled';
225
+ if (!(await binding.Save())) {
226
+ throw new Error(`could not clear the trigger's filter: ${binding.LatestResult?.CompleteMessage ?? 'unknown error'}`);
227
+ }
228
+ }
229
+ return;
230
+ }
231
+ const filterRow = await this.upsertActionFilter(binding?.ActionFilterID ?? null, expression, context);
232
+ const row = binding
233
+ ?? await context.Provider.GetEntityObject('MJ: Entity Action Filters', context.ContextUser);
234
+ if (!binding)
235
+ row.NewRecord();
236
+ row.EntityActionID = entityActionID;
237
+ row.ActionFilterID = filterRow.ID;
238
+ row.Sequence = 1;
239
+ row.Status = 'Active';
240
+ if (!(await row.Save())) {
241
+ throw new Error(`could not bind the trigger's filter: ${row.LatestResult?.CompleteMessage ?? 'unknown error'}`);
242
+ }
243
+ }
244
+ /**
245
+ * Writes the filter row holding the generated predicate.
246
+ *
247
+ * Reuses the row the binding already points at, so editing a workflow's filter edits one row
248
+ * rather than accumulating an orphan per save. `UserDescription` keeps the author's expression
249
+ * verbatim next to the generated code — without it, reading the row back tells you what the
250
+ * machine produced but not what the person asked for.
251
+ */
252
+ async upsertActionFilter(existingID, expression, context) {
253
+ const row = await context.Provider.GetEntityObject('MJ: Action Filters', context.ContextUser);
254
+ if (existingID) {
255
+ if (!(await row.Load(existingID))) {
256
+ // The binding pointed at a row that is gone. Falling back to a fresh row is right:
257
+ // the alternative is refusing to save a workflow because of a dangling reference the
258
+ // author never created and cannot see.
259
+ row.NewRecord();
260
+ }
261
+ }
262
+ else {
263
+ row.NewRecord();
264
+ }
265
+ row.Code = BuildChangeFilterCode(expression);
266
+ row.UserDescription = expression;
267
+ row.CodeExplanation =
268
+ 'Generated from a workflow trigger filter. The expression is evaluated against the record change ' +
269
+ 'that fired the trigger; the run proceeds only when it is true.';
270
+ if (!(await row.Save())) {
271
+ throw new Error(`could not save the trigger's filter: ${row.LatestResult?.CompleteMessage ?? 'unknown error'}`);
272
+ }
273
+ return row;
274
+ }
275
+ /**
276
+ * Turn the spec's scope names into the IDs the binding stores.
277
+ *
278
+ * A scope that names an entity the instance does not have is an error rather than a silent
279
+ * widening: "watch this one invoice" degrading to "watch every invoice" is the failure the
280
+ * scope columns exist to prevent.
281
+ */
282
+ resolveScope(trigger, context) {
283
+ if (!trigger.scopeEntityName?.trim()) {
284
+ return { EntityID: null, RecordID: null };
285
+ }
286
+ const scopeEntity = context.Provider.EntityByName(trigger.scopeEntityName);
287
+ if (!scopeEntity)
288
+ throw new Error(`scope entity "${trigger.scopeEntityName}" not found in metadata`);
289
+ return { EntityID: scopeEntity.ID, RecordID: trigger.scopeRecordID?.trim() || null };
290
+ }
291
+ /**
292
+ * Finds or creates the Entity Action binding this workflow needs.
293
+ *
294
+ * **Each workflow owns its own binding row.** `Execute Agent` is one shared action, so every
295
+ * workflow watching a given entity would otherwise land on the same `(EntityID, ActionID)` pair
296
+ * — and reusing that row means rewriting its `AgentID`, which silently repoints the first
297
+ * workflow's trigger at the second workflow's agent. Workflow A keeps looking configured, keeps
298
+ * showing its trigger, and never runs again.
299
+ *
300
+ * That shape was briefly impossible: `UQ_EntityAction_ActionID_EntityID`, added by the v5.37.x
301
+ * junction sweep, permitted one binding per (entity, action). The sweep's own stated scope was
302
+ * "pure junction tables ... with no other meaningful data columns", which `EntityAction` — with
303
+ * Status, Sequence, LoggingMode, scope columns and three owned child collections — never met.
304
+ * `V202608080100__v6.1.x__Drop_EntityAction_Uniqueness` removes it, which also unblocks the
305
+ * ordinary case of one action bound to one entity at two different events with different params.
306
+ *
307
+ * Ownership is therefore matched on the agent and the scope, not on entity + action alone.
308
+ */
309
+ async upsertEntityAction(entityID, actionID, agentID, scope, context) {
310
+ const existing = await this.findOwnedEntityAction(entityID, actionID, agentID, scope, context);
311
+ if (existing) {
312
+ if (existing.Status !== 'Active') {
313
+ existing.Status = 'Active';
314
+ if (!(await existing.Save())) {
315
+ throw new Error(`could not reactivate the entity-action binding: ${existing.LatestResult?.CompleteMessage ?? 'unknown error'}`);
316
+ }
317
+ }
318
+ return existing;
319
+ }
320
+ const row = await context.Provider.GetEntityObject('MJ: Entity Actions', context.ContextUser);
321
+ row.NewRecord();
322
+ row.EntityID = entityID;
323
+ row.ActionID = actionID;
324
+ row.ScopeEntityID = scope.EntityID;
325
+ row.ScopeRecordID = scope.RecordID;
326
+ row.Status = 'Active';
327
+ if (!(await row.Save())) {
328
+ throw new Error(`could not create the entity-action binding: ${row.LatestResult?.CompleteMessage ?? 'unknown error'}`);
329
+ }
330
+ return row;
331
+ }
332
+ /**
333
+ * This workflow's own binding at this scope, if it already has one.
334
+ *
335
+ * Ownership lives in the `AgentID` param rather than on the binding row, so candidates are
336
+ * narrowed in SQL by entity + action + scope and then matched on that param. Scope is part of
337
+ * the identity because narrowing a trigger to a different record is a *different* subscription,
338
+ * not an edit of the existing one — matching without it would silently re-point the old binding.
339
+ */
340
+ async findOwnedEntityAction(entityID, actionID, agentID, scope, context) {
341
+ const rv = RunView.FromMetadataProvider(context.Provider);
342
+ const scopeFilter = `AND ScopeEntityID ${scope.EntityID ? `= '${scope.EntityID}'` : 'IS NULL'} ` +
343
+ `AND ScopeRecordID ${scope.RecordID ? `= '${scope.RecordID}'` : 'IS NULL'}`;
344
+ const result = await rv.RunView({
345
+ EntityName: 'MJ: Entity Actions',
346
+ ExtraFilter: `EntityID='${entityID}' AND ActionID='${actionID}' ${scopeFilter}`,
347
+ ResultType: 'entity_object',
348
+ }, context.ContextUser);
349
+ const candidates = result.Results ?? [];
350
+ if (candidates.length === 0)
351
+ return null;
352
+ const params = await rv.RunView({
353
+ EntityName: 'MJ: Entity Action Params',
354
+ ExtraFilter: `ActionParam='AgentID' AND EntityActionID IN (${candidates.map((c) => `'${c.ID}'`).join(',')})`,
355
+ ResultType: 'entity_object',
356
+ }, context.ContextUser);
357
+ const mine = (params.Results ?? []).find((p) => p.Value != null && UUIDsEqual(p.Value, agentID));
358
+ return mine ? candidates.find((c) => UUIDsEqual(c.ID, mine.EntityActionID)) ?? null : null;
359
+ }
360
+ /** Finds or creates the invocation row that says which change fires the action. */
361
+ async upsertInvocation(entityActionID, invocationTypeID, context) {
362
+ const result = await RunView.FromMetadataProvider(context.Provider).RunView({
363
+ EntityName: 'MJ: Entity Action Invocations',
364
+ ExtraFilter: `EntityActionID='${entityActionID}' AND InvocationTypeID='${invocationTypeID}'`,
365
+ ResultType: 'entity_object',
366
+ }, context.ContextUser);
367
+ const existing = result.Results?.[0];
368
+ if (existing) {
369
+ if (existing.Status !== 'Active') {
370
+ existing.Status = 'Active';
371
+ await existing.Save();
372
+ }
373
+ return;
374
+ }
375
+ const row = await context.Provider.GetEntityObject('MJ: Entity Action Invocations', context.ContextUser);
376
+ row.NewRecord();
377
+ row.EntityActionID = entityActionID;
378
+ row.InvocationTypeID = invocationTypeID;
379
+ row.Status = 'Active';
380
+ if (!(await row.Save())) {
381
+ throw new Error(`could not create the invocation binding: ${row.LatestResult?.CompleteMessage ?? 'unknown error'}`);
382
+ }
383
+ }
384
+ /**
385
+ * Finds or creates one Entity Action Param binding.
386
+ *
387
+ * `value` is null for value types the platform derives at invocation time (`Entity Object Data`,
388
+ * `Entity Object`, `Entity Field`) — for those the ValueType *is* the instruction.
389
+ */
390
+ async upsertActionParam(entityActionID, actionID, paramName, valueType, value, context) {
391
+ const rv = RunView.FromMetadataProvider(context.Provider);
392
+ const paramResult = await rv.RunView({
393
+ EntityName: 'MJ: Action Params',
394
+ ExtraFilter: `ActionID='${actionID}' AND Name='${paramName}'`,
395
+ ResultType: 'entity_object',
396
+ }, context.ContextUser);
397
+ const actionParam = paramResult.Results?.[0];
398
+ if (!actionParam) {
399
+ // Surfaced rather than left as a trigger that fires and does nothing useful.
400
+ throw new Error(`the '${EXECUTE_AGENT_ACTION}' action has no ${paramName} parameter to bind`);
401
+ }
402
+ const existingResult = await rv.RunView({
403
+ EntityName: 'MJ: Entity Action Params',
404
+ ExtraFilter: `EntityActionID='${entityActionID}' AND ActionParamID='${actionParam.ID}'`,
405
+ ResultType: 'entity_object',
406
+ }, context.ContextUser);
407
+ const row = existingResult.Results?.[0]
408
+ ?? await context.Provider.GetEntityObject('MJ: Entity Action Params', context.ContextUser);
409
+ if (!existingResult.Results?.[0])
410
+ row.NewRecord();
411
+ row.EntityActionID = entityActionID;
412
+ row.ActionParamID = actionParam.ID;
413
+ row.ValueType = valueType;
414
+ row.Value = value;
415
+ if (!(await row.Save())) {
416
+ throw new Error(`could not bind ${paramName} to the trigger: ${row.LatestResult?.CompleteMessage ?? 'unknown error'}`);
417
+ }
418
+ }
419
+ async resolveJobTypeID(context) {
420
+ const result = await RunView.FromMetadataProvider(context.Provider).RunView({
421
+ EntityName: 'MJ: Scheduled Job Types',
422
+ ExtraFilter: `Name='${RUN_WORKFLOW_JOB_TYPE}'`,
423
+ Fields: ['ID'],
424
+ ResultType: 'simple',
425
+ }, context.ContextUser);
426
+ if (!result.Success || (result.Results?.length ?? 0) === 0) {
427
+ throw new Error(`Scheduled Job Type '${RUN_WORKFLOW_JOB_TYPE}' not found — has the metadata seed been pushed?`);
428
+ }
429
+ return result.Results[0].ID;
430
+ }
431
+ /**
432
+ * Finds the Scheduled Jobs this workflow owns.
433
+ *
434
+ * Matched on a marker inside `Configuration` rather than on name, so renaming a workflow does not
435
+ * orphan its schedule and leave a second one firing alongside the new row.
436
+ */
437
+ async findOwnedJobs(typeID, agentID, context) {
438
+ const result = await RunView.FromMetadataProvider(context.Provider).RunView({ EntityName: 'MJ: Scheduled Jobs', ExtraFilter: `JobTypeID='${typeID}'`, ResultType: 'entity_object' }, context.ContextUser);
439
+ if (!result.Success)
440
+ return [];
441
+ return (result.Results ?? []).filter((job) => {
442
+ const cfg = SafeJSONParse(job.Configuration ?? '');
443
+ const owner = cfg?.[WORKFLOW_OWNER_KEY];
444
+ return !!owner && UUIDsEqual(owner, agentID);
445
+ });
446
+ }
447
+ /** Creates or updates one owned Scheduled Job so it matches the trigger. */
448
+ async upsertScheduledJob(spec, agentID, typeID, trigger, existing, context) {
449
+ const job = existing ?? await context.Provider.GetEntityObject('MJ: Scheduled Jobs', context.ContextUser);
450
+ if (!existing) {
451
+ job.NewRecord();
452
+ if (context.ContextUser?.ID)
453
+ job.OwnerUserID = context.ContextUser.ID;
454
+ }
455
+ job.JobTypeID = typeID;
456
+ job.Name = `Workflow: ${spec.name}`;
457
+ job.Description = spec.description ?? null;
458
+ job.CronExpression = trigger.cron;
459
+ job.Timezone = trigger.timezone ?? null;
460
+ job.Configuration = JSON.stringify({ [WORKFLOW_OWNER_KEY]: agentID, AgentID: agentID });
461
+ // The spec's own status governs. A Draft or Paused workflow persists its schedule but does
462
+ // not fire — which is what lets someone build the whole thing, look at it, and then turn it on.
463
+ job.Status = spec.status === 'Active' ? 'Active' : 'Disabled';
464
+ if (spec.notifications) {
465
+ job.NotifyOnFailure = true;
466
+ job.NotifyOnSuccess = spec.notifications.condition === 'Always';
467
+ }
468
+ if (!(await job.Save())) {
469
+ throw new Error(`Could not save the schedule for workflow "${spec.name}": ${job.LatestResult?.CompleteMessage ?? 'unknown error'}`);
470
+ }
471
+ return job.ID;
472
+ }
473
+ }
474
+ //# sourceMappingURL=WorkflowSpecSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowSpecSync.js","sourceRoot":"","sources":["../src/WorkflowSpecSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAqB,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAanE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACH,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,GAIvB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAE7C,0FAA0F;AAC1F,M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C,SAAS,KAAK,QAAQ,CAAC;QACpE,CAAC;QAED,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACX,6CAA6C,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,YAAY,EAAE,eAAe,IAAI,eAAe,EAAE,CACrH,CAAC;QACN,CAAC;QACD,OAAO,GAAG,CAAC,EAAE,CAAC;IAClB,CAAC;CACJ"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @memberjunction/task-graph — producer-agnostic submission and durable execution of
3
+ * dependency-ordered task graphs.
4
+ *
5
+ * Deliberately not AI-prefixed (D11): an LLM, deterministic code, or a human UI can all construct
6
+ * and submit a DAG. The graph semantics themselves live in the pure algorithms in
7
+ * `@memberjunction/ai-core-plus`, which both this dispatcher and the in-run executor consume.
8
+ */
9
+ export * from './types.js';
10
+ export * from './TaskGraphService.js';
11
+ export * from './TaskClaimStore.js';
12
+ export * from './DispatcherConditionEvaluator.js';
13
+ export * from './TaskGraphDispatcher.js';
14
+ export * from './TaskGraphSubmitterImpl.js';
15
+ export * from './WorkflowSpecSync.js';
16
+ export * from './operations/TaskGraphOperations.js';
17
+ export * from './operations/WorkflowDraftOperation.js';
18
+ export * from './operations/WorkflowOperations.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @memberjunction/task-graph — producer-agnostic submission and durable execution of
3
+ * dependency-ordered task graphs.
4
+ *
5
+ * Deliberately not AI-prefixed (D11): an LLM, deterministic code, or a human UI can all construct
6
+ * and submit a DAG. The graph semantics themselves live in the pure algorithms in
7
+ * `@memberjunction/ai-core-plus`, which both this dispatcher and the in-run executor consume.
8
+ */
9
+ export * from './types.js';
10
+ export * from './TaskGraphService.js';
11
+ export * from './TaskClaimStore.js';
12
+ export * from './DispatcherConditionEvaluator.js';
13
+ export * from './TaskGraphDispatcher.js';
14
+ export * from './TaskGraphSubmitterImpl.js';
15
+ export * from './WorkflowSpecSync.js';
16
+ export * from './operations/TaskGraphOperations.js';
17
+ export * from './operations/WorkflowDraftOperation.js';
18
+ export * from './operations/WorkflowOperations.js';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { IMetadataProvider, UserInfo } from '@memberjunction/core';
2
+ import { TaskGraphSubmitOperation, TaskGraphCancelOperation, TaskGraphRetryTaskOperation, TaskGraphGetStatusOperation, type TaskGraphSubmitInput, type TaskGraphSubmitOutput, type TaskGraphControlInput, type TaskGraphControlOutput, type TaskGraphRetryInput, type TaskGraphStatusOutput } from '@memberjunction/core-entities';
3
+ /**
4
+ * `TaskGraph.Submit` — validate and durably persist a graph, returning immediately.
5
+ *
6
+ * Returning before execution is the point: the caller is freed the moment the work is safe, and the
7
+ * dispatcher owns it from there. That is what lets an agent submit a graph over MCP without holding
8
+ * anything open.
9
+ */
10
+ export declare class TaskGraphSubmitServerOperation extends TaskGraphSubmitOperation {
11
+ protected InternalExecute(input: TaskGraphSubmitInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphSubmitOutput>;
12
+ }
13
+ /** `TaskGraph.Cancel` — cancel a graph and every task in it that has not already settled. */
14
+ export declare class TaskGraphCancelServerOperation extends TaskGraphCancelOperation {
15
+ protected InternalExecute(input: TaskGraphControlInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphControlOutput>;
16
+ }
17
+ /**
18
+ * `TaskGraph.RetryTask` — return a failed task to `Pending` and unblock its dependents.
19
+ *
20
+ * Unblocking is not optional: retrying a task while its dependents remain `Blocked` leaves the graph
21
+ * exactly as stuck as before, because nothing downstream ever becomes eligible again.
22
+ */
23
+ export declare class TaskGraphRetryTaskServerOperation extends TaskGraphRetryTaskOperation {
24
+ protected InternalExecute(input: TaskGraphRetryInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphControlOutput>;
25
+ }
26
+ /**
27
+ * `TaskGraph.GetStatus` — snapshot a graph's progress without waiting for anything.
28
+ *
29
+ * This is the observation half of making execution durable. Once nobody holds a request open, a
30
+ * caller — a client re-attaching after reload, an agent checking work it submitted, an external MCP
31
+ * caller — needs a way to ask "where is it?". The rollup uses the same pure algorithm the dispatcher
32
+ * uses, so the reported status cannot disagree with the engine's own view.
33
+ */
34
+ export declare class TaskGraphGetStatusServerOperation extends TaskGraphGetStatusOperation {
35
+ protected InternalExecute(input: TaskGraphControlInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphStatusOutput>;
36
+ }
37
+ /** Prevents tree-shaking of the registered operation classes. */
38
+ export declare function LoadTaskGraphOperations(): void;
39
+ //# sourceMappingURL=TaskGraphOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskGraphOperations.d.ts","sourceRoot":"","sources":["../../src/operations/TaskG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