@memberjunction/task-graph 6.1.0-edge.1 → 6.1.0-edge.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 (65) hide show
  1. package/LICENSE +180 -4
  2. package/README.md +214 -0
  3. package/dist/TaskClaimStore.d.ts +387 -4
  4. package/dist/TaskClaimStore.d.ts.map +1 -1
  5. package/dist/TaskClaimStore.js +605 -20
  6. package/dist/TaskClaimStore.js.map +1 -1
  7. package/dist/TaskGraphDispatcher.d.ts +668 -5
  8. package/dist/TaskGraphDispatcher.d.ts.map +1 -1
  9. package/dist/TaskGraphDispatcher.js +2942 -127
  10. package/dist/TaskGraphDispatcher.js.map +1 -1
  11. package/dist/TaskGraphService.d.ts +364 -5
  12. package/dist/TaskGraphService.d.ts.map +1 -1
  13. package/dist/TaskGraphService.js +1039 -43
  14. package/dist/TaskGraphService.js.map +1 -1
  15. package/dist/TaskGraphSubmitterImpl.d.ts.map +1 -1
  16. package/dist/TaskGraphSubmitterImpl.js +5 -0
  17. package/dist/TaskGraphSubmitterImpl.js.map +1 -1
  18. package/dist/TaskLoopExecutor.d.ts +62 -0
  19. package/dist/TaskLoopExecutor.d.ts.map +1 -0
  20. package/dist/TaskLoopExecutor.js +248 -0
  21. package/dist/TaskLoopExecutor.js.map +1 -0
  22. package/dist/WorkflowSpecSync.d.ts +28 -2
  23. package/dist/WorkflowSpecSync.d.ts.map +1 -1
  24. package/dist/WorkflowSpecSync.js +83 -2
  25. package/dist/WorkflowSpecSync.js.map +1 -1
  26. package/dist/condition-gate.d.ts +128 -0
  27. package/dist/condition-gate.d.ts.map +1 -0
  28. package/dist/condition-gate.js +257 -0
  29. package/dist/condition-gate.js.map +1 -0
  30. package/dist/debug-state.d.ts +102 -0
  31. package/dist/debug-state.d.ts.map +1 -0
  32. package/dist/debug-state.js +135 -0
  33. package/dist/debug-state.js.map +1 -0
  34. package/dist/index.d.ts +7 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +7 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/operations/TaskGraphDebugOperations.d.ts +99 -0
  39. package/dist/operations/TaskGraphDebugOperations.d.ts.map +1 -0
  40. package/dist/operations/TaskGraphDebugOperations.js +310 -0
  41. package/dist/operations/TaskGraphDebugOperations.js.map +1 -0
  42. package/dist/operations/TaskGraphOperations.d.ts +20 -2
  43. package/dist/operations/TaskGraphOperations.d.ts.map +1 -1
  44. package/dist/operations/TaskGraphOperations.js +51 -8
  45. package/dist/operations/TaskGraphOperations.js.map +1 -1
  46. package/dist/operations/WorkflowDraftOperation.d.ts +37 -0
  47. package/dist/operations/WorkflowDraftOperation.d.ts.map +1 -0
  48. package/dist/operations/WorkflowDraftOperation.js +141 -0
  49. package/dist/operations/WorkflowDraftOperation.js.map +1 -0
  50. package/dist/settlement-rescue.d.ts +85 -0
  51. package/dist/settlement-rescue.d.ts.map +1 -0
  52. package/dist/settlement-rescue.js +119 -0
  53. package/dist/settlement-rescue.js.map +1 -0
  54. package/dist/task-graph-kick.d.ts +3 -0
  55. package/dist/task-graph-kick.d.ts.map +1 -0
  56. package/dist/task-graph-kick.js +17 -0
  57. package/dist/task-graph-kick.js.map +1 -0
  58. package/dist/task-predicates.d.ts +77 -0
  59. package/dist/task-predicates.d.ts.map +1 -0
  60. package/dist/task-predicates.js +75 -0
  61. package/dist/task-predicates.js.map +1 -0
  62. package/dist/types.d.ts +224 -1
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/types.js.map +1 -1
  65. package/package.json +12 -8
@@ -0,0 +1,135 @@
1
+ /**
2
+ * @fileoverview Debug/runner state for a task graph — pause, single-step, breakpoints, and edge
3
+ * overrides — expressed as durable, declarative state the dispatcher's claim filter consults.
4
+ *
5
+ * **Why state, not hooks.** The dispatcher is multi-instance and survives restarts; a callback
6
+ * registered in one process gates nothing on the peer that actually wins a claim, and dies with the
7
+ * process. A flag on the parent row gates every instance uniformly, works when "start paused" is set
8
+ * before any dispatcher has seen the graph, and holds across a deploy. The debugger and the
9
+ * dispatcher never talk directly — they rendezvous on the row, which is this engine's native
10
+ * coordination idiom (the claim protocol itself is nothing but CAS'd shared state).
11
+ *
12
+ * **Why every control is a gate on CLAIMING, never on running.** A claimed task can never be
13
+ * interrupted mid-flight anyway — only the next claim can be prevented. So `paused` means "nothing
14
+ * new starts; in-flight work finishes and its completions land", a breakpoint is an authored hold
15
+ * (the exact mechanism `holdTaskIDs` already implements for unevaluable conditions, driven by user
16
+ * intent instead of a broken guard), and `step` is a one-shot claim allowance consumed CAS-style so
17
+ * exactly one instance honors it.
18
+ *
19
+ * The state lives under `$.debug` in the parent Task's `InputPayload` bag, beside the continuation
20
+ * marker, and is written only through `TaskClaimStore`'s guarded `JSON_MODIFY` statements — the same
21
+ * two-writer discipline that protects the marker.
22
+ *
23
+ * @module @memberjunction/task-graph
24
+ */
25
+ import { UUIDsEqual } from '@memberjunction/global';
26
+ const UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
27
+ /** True for values JSON round-trips or hand edits commonly produce for a boolean. */
28
+ function readBool(value) {
29
+ return value === true || value === 'true';
30
+ }
31
+ /**
32
+ * Parses a parent Task's debug state from its `InputPayload` bag.
33
+ *
34
+ * Mirrors `ParseTaskGraphParentMetadata`'s posture exactly: unparseable input is a legitimate state
35
+ * (a row predating this, a hand edit), and the right reading of "I don't know" is "not being
36
+ * debugged" — never a throw, and never a guess that could gate real work on garbage.
37
+ */
38
+ export function ParseTaskGraphDebugState(raw) {
39
+ if (!raw)
40
+ return {};
41
+ try {
42
+ const parsed = JSON.parse(raw);
43
+ const debug = parsed && typeof parsed === 'object' ? parsed.debug : undefined;
44
+ if (!debug || typeof debug !== 'object')
45
+ return {};
46
+ const d = debug;
47
+ const state = {};
48
+ if (readBool(d.paused))
49
+ state.paused = true;
50
+ if (typeof d.pausedBy === 'string')
51
+ state.pausedBy = d.pausedBy;
52
+ if (d.pausedReason === 'user' || d.pausedReason === 'breakpoint')
53
+ state.pausedReason = d.pausedReason;
54
+ if (typeof d.pausedAtTaskID === 'string')
55
+ state.pausedAtTaskID = d.pausedAtTaskID;
56
+ if (typeof d.skipBreakpointTaskID === 'string')
57
+ state.skipBreakpointTaskID = d.skipBreakpointTaskID;
58
+ if (Array.isArray(d.breakpoints)) {
59
+ const ids = d.breakpoints.filter((b) => typeof b === 'string' && UUID_SHAPE.test(b));
60
+ if (ids.length > 0)
61
+ state.breakpoints = ids;
62
+ }
63
+ if (d.step === 'one' || d.step === 'wave' || (typeof d.step === 'string' && UUID_SHAPE.test(d.step))) {
64
+ state.step = d.step;
65
+ }
66
+ if (d.edgeOverrides && typeof d.edgeOverrides === 'object') {
67
+ const overrides = {};
68
+ for (const [edgeID, verdict] of Object.entries(d.edgeOverrides)) {
69
+ if (UUID_SHAPE.test(edgeID) && (verdict === 'true' || verdict === 'false')) {
70
+ overrides[edgeID] = verdict;
71
+ }
72
+ }
73
+ if (Object.keys(overrides).length > 0)
74
+ state.edgeOverrides = overrides;
75
+ }
76
+ return state;
77
+ }
78
+ catch {
79
+ return {};
80
+ }
81
+ }
82
+ /**
83
+ * Decides what the claim filter may do for one graph this pass, given its debug state and the tasks
84
+ * that are otherwise eligible.
85
+ *
86
+ * Pure by design — the CAS writes (consuming the step marker, pausing at the breakpoint) stay with
87
+ * the dispatcher, and this function only says which of them to attempt. Precedence:
88
+ *
89
+ * 1. **Paused** wins over everything, including breakpoints — a paused graph claims nothing unless
90
+ * a step allowance releases work, and a breakpoint inside a paused graph is moot.
91
+ * 2. **Breakpoints** fire before any claim: the FIRST eligible task carrying one pauses the whole
92
+ * graph, so no sibling of the breakpointed task starts either. That is what "pause here" means
93
+ * on a parallel graph — the alternative (claim the siblings, hold only the one task) turns a
94
+ * breakpoint into a per-task hold, which `holdTaskIDs` already is.
95
+ * 3. Otherwise the gate is open.
96
+ *
97
+ * A named-step target that is not currently eligible releases nothing — the allowance stays for the
98
+ * caller to keep or clear; stepping a task that cannot run must not release an arbitrary other one.
99
+ */
100
+ export function DecideClaimGate(debug, eligibleTaskIDs) {
101
+ if (debug.paused) {
102
+ if (!debug.step)
103
+ return { mode: 'closed' };
104
+ if (debug.step === 'wave')
105
+ return { mode: 'step', taskIDs: [...eligibleTaskIDs] };
106
+ if (debug.step === 'one') {
107
+ return eligibleTaskIDs.length > 0 ? { mode: 'step', taskIDs: [eligibleTaskIDs[0]] } : { mode: 'closed' };
108
+ }
109
+ // A named task steps only itself, and only when it is genuinely eligible.
110
+ const named = eligibleTaskIDs.find((id) => UUIDsEqual(id, debug.step));
111
+ return named ? { mode: 'step', taskIDs: [named] } : { mode: 'closed' };
112
+ }
113
+ if (debug.breakpoints && debug.breakpoints.length > 0) {
114
+ const bp = eligibleTaskIDs.find((id) => isArmedBreakpoint(debug, id));
115
+ if (bp)
116
+ return { mode: 'breakpoint', taskID: bp };
117
+ }
118
+ return { mode: 'open' };
119
+ }
120
+ function isArmedBreakpoint(debug, taskID) {
121
+ if (debug.skipBreakpointTaskID && UUIDsEqual(debug.skipBreakpointTaskID, taskID))
122
+ return false;
123
+ return (debug.breakpoints ?? []).some((id) => UUIDsEqual(id, taskID));
124
+ }
125
+ /**
126
+ * The verdict an edge override dictates, if one exists for this edge.
127
+ *
128
+ * Consulted BEFORE the condition is evaluated: an override exists precisely because the condition
129
+ * cannot be answered (or answered wrongly), so evaluating first would re-produce the hold the
130
+ * override exists to end.
131
+ */
132
+ export function OverrideVerdictFor(debug, edgeID) {
133
+ return debug.edgeOverrides?.[edgeID];
134
+ }
135
+ //# sourceMappingURL=debug-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-state.js","sourceRoot":"","sources":["../src/debug-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AA8DpD,MAAM,UAAU,GAAG,iEAAiE,CAAC;AAErF,qFA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B,CAAC;AAED,SAAS,iBAAiB,CAAC,KAA0B,EAAE,MAAc;IACjE,IAAI,KAAK,CAAC,oBAAoB,IAAI,UAAU,CAAC,KAAK,CAAC,oBAAoB,EAAE,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/F,OAAO,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAC9B,KAA0B,EAC1B,MAAc;IAEd,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,12 +7,19 @@
7
7
  * `@memberjunction/ai-core-plus`, which both this dispatcher and the in-run executor consume.
8
8
  */
9
9
  export * from './types.js';
10
+ export * from './debug-state.js';
10
11
  export * from './TaskGraphService.js';
11
12
  export * from './TaskClaimStore.js';
13
+ export * from './settlement-rescue.js';
14
+ export * from './condition-gate.js';
15
+ export * from './task-predicates.js';
12
16
  export * from './DispatcherConditionEvaluator.js';
13
17
  export * from './TaskGraphDispatcher.js';
18
+ export * from './task-graph-kick.js';
14
19
  export * from './TaskGraphSubmitterImpl.js';
15
20
  export * from './WorkflowSpecSync.js';
16
21
  export * from './operations/TaskGraphOperations.js';
22
+ export * from './operations/TaskGraphDebugOperations.js';
23
+ export * from './operations/WorkflowDraftOperation.js';
17
24
  export * from './operations/WorkflowOperations.js';
18
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC"}
package/dist/index.js CHANGED
@@ -7,12 +7,19 @@
7
7
  * `@memberjunction/ai-core-plus`, which both this dispatcher and the in-run executor consume.
8
8
  */
9
9
  export * from './types.js';
10
+ export * from './debug-state.js';
10
11
  export * from './TaskGraphService.js';
11
12
  export * from './TaskClaimStore.js';
13
+ export * from './settlement-rescue.js';
14
+ export * from './condition-gate.js';
15
+ export * from './task-predicates.js';
12
16
  export * from './DispatcherConditionEvaluator.js';
13
17
  export * from './TaskGraphDispatcher.js';
18
+ export * from './task-graph-kick.js';
14
19
  export * from './TaskGraphSubmitterImpl.js';
15
20
  export * from './WorkflowSpecSync.js';
16
21
  export * from './operations/TaskGraphOperations.js';
22
+ export * from './operations/TaskGraphDebugOperations.js';
23
+ export * from './operations/WorkflowDraftOperation.js';
17
24
  export * from './operations/WorkflowOperations.js';
18
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +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,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { BaseRemotableOperation, IMetadataProvider, UserInfo } from '@memberjunction/core';
2
+ import type { TaskGraphDebugState } from '../debug-state.js';
3
+ /** Input for `TaskGraph.Pause` and `TaskGraph.Resume`. */
4
+ export interface TaskGraphPauseInput {
5
+ /** Parent task ID identifying the workflow run. */
6
+ parentTaskID: string;
7
+ }
8
+ /** Input for `TaskGraph.Step`. */
9
+ export interface TaskGraphStepInput {
10
+ parentTaskID: string;
11
+ /** `'one'` (default) releases the next eligible step, `'wave'` the current frontier, a task ID exactly that step. */
12
+ target?: string;
13
+ }
14
+ /** Input for `TaskGraph.SetBreakpoints`. */
15
+ export interface TaskGraphSetBreakpointsInput {
16
+ parentTaskID: string;
17
+ /** The full breakpoint set — replaces what was there. Empty clears all breakpoints. */
18
+ taskIDs: string[];
19
+ }
20
+ /** Input for `TaskGraph.OverrideEdge`. */
21
+ export interface TaskGraphOverrideEdgeInput {
22
+ parentTaskID: string;
23
+ /** The `MJ: Task Dependencies` row being answered. */
24
+ edgeID: string;
25
+ /** `'false'` = branch not taken, `'true'` = gate open, omitted/null = remove the override. */
26
+ verdict?: 'true' | 'false' | null;
27
+ }
28
+ /** Input for `TaskGraph.SkipTask`, `TaskGraph.ForceCompleteTask` and `TaskGraph.UpdateTaskInput`. */
29
+ export interface TaskGraphTaskInterventionInput {
30
+ taskID: string;
31
+ /** ForceCompleteTask: the output downstream paths evaluate against. UpdateTaskInput: the new input. */
32
+ payload?: Record<string, unknown> | string | null;
33
+ }
34
+ /** Output of the debug control verbs — what happened and the debug state now in force. */
35
+ export interface TaskGraphDebugControlOutput {
36
+ success: boolean;
37
+ /** The graph's debug state after the verb (pause/step/breakpoints/overrides). */
38
+ debug?: TaskGraphDebugState;
39
+ errorMessage?: string;
40
+ }
41
+ /** `TaskGraph.Pause` — nothing new starts; in-flight steps finish and their completions land. */
42
+ export declare class TaskGraphPauseServerOperation extends BaseRemotableOperation<TaskGraphPauseInput, TaskGraphDebugControlOutput> {
43
+ readonly OperationKey = "TaskGraph.Pause";
44
+ readonly ExecutionMode: "Sync";
45
+ readonly RequiredScope = "taskgraph:execute";
46
+ protected InternalExecute(input: TaskGraphPauseInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
47
+ }
48
+ /** `TaskGraph.Resume` — claiming continues; breakpoints and overrides survive. */
49
+ export declare class TaskGraphResumeServerOperation extends BaseRemotableOperation<TaskGraphPauseInput, TaskGraphDebugControlOutput> {
50
+ readonly OperationKey = "TaskGraph.Resume";
51
+ readonly ExecutionMode: "Sync";
52
+ readonly RequiredScope = "taskgraph:execute";
53
+ protected InternalExecute(input: TaskGraphPauseInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
54
+ }
55
+ /** `TaskGraph.Step` — arm a one-shot claim allowance on a paused workflow. */
56
+ export declare class TaskGraphStepServerOperation extends BaseRemotableOperation<TaskGraphStepInput, TaskGraphDebugControlOutput> {
57
+ readonly OperationKey = "TaskGraph.Step";
58
+ readonly ExecutionMode: "Sync";
59
+ readonly RequiredScope = "taskgraph:execute";
60
+ protected InternalExecute(input: TaskGraphStepInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
61
+ }
62
+ /** `TaskGraph.SetBreakpoints` — replace the workflow's breakpoint set. */
63
+ export declare class TaskGraphSetBreakpointsServerOperation extends BaseRemotableOperation<TaskGraphSetBreakpointsInput, TaskGraphDebugControlOutput> {
64
+ readonly OperationKey = "TaskGraph.SetBreakpoints";
65
+ readonly ExecutionMode: "Sync";
66
+ readonly RequiredScope = "taskgraph:execute";
67
+ protected InternalExecute(input: TaskGraphSetBreakpointsInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
68
+ }
69
+ /** `TaskGraph.OverrideEdge` — answer a path the engine cannot decide (or decided wrongly). */
70
+ export declare class TaskGraphOverrideEdgeServerOperation extends BaseRemotableOperation<TaskGraphOverrideEdgeInput, TaskGraphDebugControlOutput> {
71
+ readonly OperationKey = "TaskGraph.OverrideEdge";
72
+ readonly ExecutionMode: "Sync";
73
+ readonly RequiredScope = "taskgraph:execute";
74
+ protected InternalExecute(input: TaskGraphOverrideEdgeInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
75
+ }
76
+ /** `TaskGraph.SkipTask` — declare a Pending step not-taken; dependents proceed. */
77
+ export declare class TaskGraphSkipTaskServerOperation extends BaseRemotableOperation<TaskGraphTaskInterventionInput, TaskGraphDebugControlOutput> {
78
+ readonly OperationKey = "TaskGraph.SkipTask";
79
+ readonly ExecutionMode: "Sync";
80
+ readonly RequiredScope = "taskgraph:execute";
81
+ protected InternalExecute(input: TaskGraphTaskInterventionInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
82
+ }
83
+ /** `TaskGraph.ForceCompleteTask` — mark a wedged or externally-resolved step Complete with a supplied output. */
84
+ export declare class TaskGraphForceCompleteTaskServerOperation extends BaseRemotableOperation<TaskGraphTaskInterventionInput, TaskGraphDebugControlOutput> {
85
+ readonly OperationKey = "TaskGraph.ForceCompleteTask";
86
+ readonly ExecutionMode: "Sync";
87
+ readonly RequiredScope = "taskgraph:execute";
88
+ protected InternalExecute(input: TaskGraphTaskInterventionInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
89
+ }
90
+ /** `TaskGraph.UpdateTaskInput` — replace a Pending step's input before stepping it. */
91
+ export declare class TaskGraphUpdateTaskInputServerOperation extends BaseRemotableOperation<TaskGraphTaskInterventionInput, TaskGraphDebugControlOutput> {
92
+ readonly OperationKey = "TaskGraph.UpdateTaskInput";
93
+ readonly ExecutionMode: "Sync";
94
+ readonly RequiredScope = "taskgraph:execute";
95
+ protected InternalExecute(input: TaskGraphTaskInterventionInput, provider: IMetadataProvider, user: UserInfo): Promise<TaskGraphDebugControlOutput>;
96
+ }
97
+ /** Prevents tree-shaking of the registered operation classes. */
98
+ export declare function LoadTaskGraphDebugOperations(): void;
99
+ //# sourceMappingURL=TaskGraphDebugOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskGraphDebugOperations.d.ts","sourceRoot":"","sources":["../../src/operations/TaskGraphDebugOperations.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAW,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIpG,OAAO,KAAK,EAAmC,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAM3F,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAChC,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,kCAAkC;AAClC,MAAM,WAAW,kBAA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,CAAU;IAChD,SAAgB,aAAa,uBAAuB;cAEpC,eAAe,CAAC,KAAK,EAAE,8BAA8B,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAS5J;AAED,iHAAiH;AACjH,qBACa,yCAA0C,SAAQ,sBAAsB,CAAC,8BAA8B,EAAE,2BAA2B,CAAC;IAC9I,SAAgB,YAAY,iCAAiC;IAC7D,SAAgB,aAAa,EAAG,MAAM,CAAU;IAChD,SAAgB,aAAa,uBAAuB;cAEpC,eAAe,CAAC,KAAK,EAAE,8BAA8B,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAS5J;AAED,uFAAuF;AACvF,qBACa,uCAAwC,SAAQ,sBAAsB,CAAC,8BAA8B,EAAE,2BAA2B,CAAC;IAC5I,SAAgB,YAAY,+BAA+B;IAC3D,SAAgB,aAAa,EAAG,MAAM,CAAU;IAChD,SAAgB,aAAa,uBAAuB;cAEpC,eAAe,CAAC,KAAK,EAAE,8BAA8B,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAU5J;AAED,iEAAiE;AACjE,wBAAgB,4BAA4B,IAAI,IAAI,CASnD"}
@@ -0,0 +1,310 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ /**
8
+ * @fileoverview Remote Operation implementations for the task-graph debug/runner control plane —
9
+ * pause, resume, single-step, breakpoints, edge overrides, and the step-level intervention verbs.
10
+ *
11
+ * Ships per the standing rule from #3576: every task-graph control verb is a Remote Operation, so
12
+ * the console UI, MCP callers, and an Action wrapper all reach the same typed call site. All logic
13
+ * stays in `TaskGraphService`; these are thin adapters.
14
+ *
15
+ * **Registration note.** These subclasses extend `BaseRemotableOperation` directly and declare
16
+ * their own `OperationKey`/`ExecutionMode`/`RequiredScope`, rather than extending a CodeGen-emitted
17
+ * base from `@memberjunction/core-entities` the way `TaskGraphOperations.ts` does. The metadata rows
18
+ * for these operations ship in `metadata/remote-operations/.remote-operations.json`; once
19
+ * `mj sync push` + `mj codegen` have run, CodeGen emits the typed bases and a follow-up may
20
+ * re-parent these classes onto them — the runtime contract (ClassFactory key + metadata
21
+ * invokability gate) is identical either way.
22
+ *
23
+ * **Authorization.** The debug verbs write through guarded SQL, not through entity permissions, so
24
+ * each one gates explicitly: the caller must be the graph's recorded owner or an Owner-type user.
25
+ * A graph with no recorded owner fails closed for everyone but Owner-type users.
26
+ *
27
+ * @module @memberjunction/task-graph
28
+ */
29
+ import { RegisterClass } from '@memberjunction/global';
30
+ import { BaseRemotableOperation, RunView } from '@memberjunction/core';
31
+ import { UUIDsEqual } from '@memberjunction/global';
32
+ import { ParseTaskGraphParentMetadata, TASK_TYPE_NAME, TaskGraphService } from '../TaskGraphService.js';
33
+ // ── shared plumbing ────────────────────────────────────────────────────────
34
+ function submitContext(provider, user) {
35
+ // EnvironmentID is empty on every debug path: the graph already exists, and the service reads
36
+ // the field only while persisting a new one.
37
+ return { EnvironmentID: '', ConversationDetailID: null, ContextUser: user, Provider: provider };
38
+ }
39
+ /**
40
+ * The caller must be the graph's recorded owner, or an Owner-type user.
41
+ *
42
+ * Explicit here because the debug verbs write through guarded SQL rather than entity saves, so
43
+ * entity permissions never see them. Fails closed: a graph with no recorded owner (submitted before
44
+ * ownership stamping) is controllable only by Owner-type users.
45
+ */
46
+ async function authorizeGraphControl(parentTaskID, provider, user) {
47
+ if (user.Type?.trim().toLowerCase() === 'owner')
48
+ return null;
49
+ const parent = await provider.GetEntityObject('MJ: Tasks', user);
50
+ if (!(await parent.Load(parentTaskID)))
51
+ return 'No such workflow run.';
52
+ const owner = ParseTaskGraphParentMetadata(parent.InputPayload).submittedByUserID;
53
+ if (!owner || !UUIDsEqual(owner, user.ID)) {
54
+ return 'Only the workflow run\'s owner can control it.';
55
+ }
56
+ return null;
57
+ }
58
+ /**
59
+ * Resolves a child task's graph, so task-scoped verbs authorize against the same owner.
60
+ *
61
+ * **Proves the parent is a WORKFLOW graph, not merely that the task has one.** `MJ: Tasks` holds
62
+ * conversation tasks and users' personal to-dos alongside workflow steps, and both of those can be
63
+ * parented too — so "has a ParentID" is not "is a step of a workflow run". Without the type check
64
+ * the ownership gate below is the only thing standing between these verbs and any parented row in
65
+ * the table, and for an Owner-type caller that gate returns before loading anything. The guarded
66
+ * statements carry the same discriminator as a second layer; this is the first.
67
+ */
68
+ async function graphOfTask(taskID, provider, user) {
69
+ const task = await provider.GetEntityObject('MJ: Tasks', user);
70
+ if (!(await task.Load(taskID)))
71
+ return { error: 'No such step.' };
72
+ if (!task.ParentID)
73
+ return { error: 'That task is not a step of a workflow run.' };
74
+ const parent = await provider.GetEntityObject('MJ: Tasks', user);
75
+ if (!(await parent.Load(task.ParentID)))
76
+ return { error: 'That step\'s workflow run could not be read.' };
77
+ const workflowTypeID = await resolveWorkflowTaskTypeID(provider, user);
78
+ if (!workflowTypeID || !UUIDsEqual(parent.TypeID ?? '', workflowTypeID)) {
79
+ return { error: 'That task is not a step of a workflow run.' };
80
+ }
81
+ return { parentTaskID: task.ParentID };
82
+ }
83
+ /**
84
+ * The `AI Workflow` task type's ID, or null when the row does not exist.
85
+ *
86
+ * Read rather than created: these verbs act on graphs that already exist, so an absent type row
87
+ * means there are no workflow graphs to act on — minting one from a debug verb would be a write on
88
+ * a read path, and would make the check it feeds vacuously pass.
89
+ */
90
+ async function resolveWorkflowTaskTypeID(provider, user) {
91
+ const result = await RunView.FromMetadataProvider(provider).RunView({
92
+ EntityName: 'MJ: Task Types',
93
+ ExtraFilter: `Name='${TASK_TYPE_NAME}'`,
94
+ Fields: ['ID'],
95
+ ResultType: 'simple',
96
+ MaxRows: 1,
97
+ }, user);
98
+ return result.Success ? (result.Results?.[0]?.ID ?? null) : null;
99
+ }
100
+ function failed(errorMessage) {
101
+ return { success: false, errorMessage };
102
+ }
103
+ // ── the verbs ──────────────────────────────────────────────────────────────
104
+ /** `TaskGraph.Pause` — nothing new starts; in-flight steps finish and their completions land. */
105
+ let TaskGraphPauseServerOperation = class TaskGraphPauseServerOperation extends BaseRemotableOperation {
106
+ constructor() {
107
+ super(...arguments);
108
+ this.OperationKey = 'TaskGraph.Pause';
109
+ this.ExecutionMode = 'Sync';
110
+ this.RequiredScope = 'taskgraph:execute';
111
+ }
112
+ async InternalExecute(input, provider, user) {
113
+ if (!input?.parentTaskID)
114
+ throw new Error('parentTaskID is required');
115
+ const denied = await authorizeGraphControl(input.parentTaskID, provider, user);
116
+ if (denied)
117
+ return failed(denied);
118
+ const result = await new TaskGraphService().PauseGraph(input.parentTaskID, submitContext(provider, user), user.ID);
119
+ return { success: result.Success, debug: result.Debug, errorMessage: result.ErrorMessage };
120
+ }
121
+ };
122
+ TaskGraphPauseServerOperation = __decorate([
123
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.Pause')
124
+ ], TaskGraphPauseServerOperation);
125
+ export { TaskGraphPauseServerOperation };
126
+ /** `TaskGraph.Resume` — claiming continues; breakpoints and overrides survive. */
127
+ let TaskGraphResumeServerOperation = class TaskGraphResumeServerOperation extends BaseRemotableOperation {
128
+ constructor() {
129
+ super(...arguments);
130
+ this.OperationKey = 'TaskGraph.Resume';
131
+ this.ExecutionMode = 'Sync';
132
+ this.RequiredScope = 'taskgraph:execute';
133
+ }
134
+ async InternalExecute(input, provider, user) {
135
+ if (!input?.parentTaskID)
136
+ throw new Error('parentTaskID is required');
137
+ const denied = await authorizeGraphControl(input.parentTaskID, provider, user);
138
+ if (denied)
139
+ return failed(denied);
140
+ const result = await new TaskGraphService().ResumeGraph(input.parentTaskID, submitContext(provider, user));
141
+ return { success: result.Success, debug: result.Debug, errorMessage: result.ErrorMessage };
142
+ }
143
+ };
144
+ TaskGraphResumeServerOperation = __decorate([
145
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.Resume')
146
+ ], TaskGraphResumeServerOperation);
147
+ export { TaskGraphResumeServerOperation };
148
+ /** `TaskGraph.Step` — arm a one-shot claim allowance on a paused workflow. */
149
+ let TaskGraphStepServerOperation = class TaskGraphStepServerOperation extends BaseRemotableOperation {
150
+ constructor() {
151
+ super(...arguments);
152
+ this.OperationKey = 'TaskGraph.Step';
153
+ this.ExecutionMode = 'Sync';
154
+ this.RequiredScope = 'taskgraph:execute';
155
+ }
156
+ async InternalExecute(input, provider, user) {
157
+ if (!input?.parentTaskID)
158
+ throw new Error('parentTaskID is required');
159
+ const denied = await authorizeGraphControl(input.parentTaskID, provider, user);
160
+ if (denied)
161
+ return failed(denied);
162
+ const target = input.target === 'wave' || input.target === 'one'
163
+ ? input.target
164
+ : input.target ? input.target : 'one';
165
+ const result = await new TaskGraphService().StepGraph(input.parentTaskID, target, submitContext(provider, user));
166
+ return { success: result.Success, debug: result.Debug, errorMessage: result.ErrorMessage };
167
+ }
168
+ };
169
+ TaskGraphStepServerOperation = __decorate([
170
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.Step')
171
+ ], TaskGraphStepServerOperation);
172
+ export { TaskGraphStepServerOperation };
173
+ /** `TaskGraph.SetBreakpoints` — replace the workflow's breakpoint set. */
174
+ let TaskGraphSetBreakpointsServerOperation = class TaskGraphSetBreakpointsServerOperation extends BaseRemotableOperation {
175
+ constructor() {
176
+ super(...arguments);
177
+ this.OperationKey = 'TaskGraph.SetBreakpoints';
178
+ this.ExecutionMode = 'Sync';
179
+ this.RequiredScope = 'taskgraph:execute';
180
+ }
181
+ async InternalExecute(input, provider, user) {
182
+ if (!input?.parentTaskID)
183
+ throw new Error('parentTaskID is required');
184
+ if (!Array.isArray(input.taskIDs))
185
+ throw new Error('taskIDs is required (empty array clears)');
186
+ const denied = await authorizeGraphControl(input.parentTaskID, provider, user);
187
+ if (denied)
188
+ return failed(denied);
189
+ const result = await new TaskGraphService().SetBreakpoints(input.parentTaskID, input.taskIDs, submitContext(provider, user));
190
+ return { success: result.Success, debug: result.Debug, errorMessage: result.ErrorMessage };
191
+ }
192
+ };
193
+ TaskGraphSetBreakpointsServerOperation = __decorate([
194
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.SetBreakpoints')
195
+ ], TaskGraphSetBreakpointsServerOperation);
196
+ export { TaskGraphSetBreakpointsServerOperation };
197
+ /** `TaskGraph.OverrideEdge` — answer a path the engine cannot decide (or decided wrongly). */
198
+ let TaskGraphOverrideEdgeServerOperation = class TaskGraphOverrideEdgeServerOperation extends BaseRemotableOperation {
199
+ constructor() {
200
+ super(...arguments);
201
+ this.OperationKey = 'TaskGraph.OverrideEdge';
202
+ this.ExecutionMode = 'Sync';
203
+ this.RequiredScope = 'taskgraph:execute';
204
+ }
205
+ async InternalExecute(input, provider, user) {
206
+ if (!input?.parentTaskID)
207
+ throw new Error('parentTaskID is required');
208
+ if (!input?.edgeID)
209
+ throw new Error('edgeID is required');
210
+ const denied = await authorizeGraphControl(input.parentTaskID, provider, user);
211
+ if (denied)
212
+ return failed(denied);
213
+ const verdict = input.verdict === 'true' || input.verdict === 'false' ? input.verdict : null;
214
+ const result = await new TaskGraphService().SetEdgeOverride(input.parentTaskID, input.edgeID, verdict, submitContext(provider, user));
215
+ return { success: result.Success, debug: result.Debug, errorMessage: result.ErrorMessage };
216
+ }
217
+ };
218
+ TaskGraphOverrideEdgeServerOperation = __decorate([
219
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.OverrideEdge')
220
+ ], TaskGraphOverrideEdgeServerOperation);
221
+ export { TaskGraphOverrideEdgeServerOperation };
222
+ /** `TaskGraph.SkipTask` — declare a Pending step not-taken; dependents proceed. */
223
+ let TaskGraphSkipTaskServerOperation = class TaskGraphSkipTaskServerOperation extends BaseRemotableOperation {
224
+ constructor() {
225
+ super(...arguments);
226
+ this.OperationKey = 'TaskGraph.SkipTask';
227
+ this.ExecutionMode = 'Sync';
228
+ this.RequiredScope = 'taskgraph:execute';
229
+ }
230
+ async InternalExecute(input, provider, user) {
231
+ if (!input?.taskID)
232
+ throw new Error('taskID is required');
233
+ const graph = await graphOfTask(input.taskID, provider, user);
234
+ if ('error' in graph)
235
+ return failed(graph.error);
236
+ const denied = await authorizeGraphControl(graph.parentTaskID, provider, user);
237
+ if (denied)
238
+ return failed(denied);
239
+ const result = await new TaskGraphService().SkipTask(input.taskID, submitContext(provider, user));
240
+ return { success: result.Success, errorMessage: result.ErrorMessage };
241
+ }
242
+ };
243
+ TaskGraphSkipTaskServerOperation = __decorate([
244
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.SkipTask')
245
+ ], TaskGraphSkipTaskServerOperation);
246
+ export { TaskGraphSkipTaskServerOperation };
247
+ /** `TaskGraph.ForceCompleteTask` — mark a wedged or externally-resolved step Complete with a supplied output. */
248
+ let TaskGraphForceCompleteTaskServerOperation = class TaskGraphForceCompleteTaskServerOperation extends BaseRemotableOperation {
249
+ constructor() {
250
+ super(...arguments);
251
+ this.OperationKey = 'TaskGraph.ForceCompleteTask';
252
+ this.ExecutionMode = 'Sync';
253
+ this.RequiredScope = 'taskgraph:execute';
254
+ }
255
+ async InternalExecute(input, provider, user) {
256
+ if (!input?.taskID)
257
+ throw new Error('taskID is required');
258
+ const graph = await graphOfTask(input.taskID, provider, user);
259
+ if ('error' in graph)
260
+ return failed(graph.error);
261
+ const denied = await authorizeGraphControl(graph.parentTaskID, provider, user);
262
+ if (denied)
263
+ return failed(denied);
264
+ const result = await new TaskGraphService().ForceCompleteTask(input.taskID, input.payload ?? null, submitContext(provider, user));
265
+ return { success: result.Success, errorMessage: result.ErrorMessage };
266
+ }
267
+ };
268
+ TaskGraphForceCompleteTaskServerOperation = __decorate([
269
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.ForceCompleteTask')
270
+ ], TaskGraphForceCompleteTaskServerOperation);
271
+ export { TaskGraphForceCompleteTaskServerOperation };
272
+ /** `TaskGraph.UpdateTaskInput` — replace a Pending step's input before stepping it. */
273
+ let TaskGraphUpdateTaskInputServerOperation = class TaskGraphUpdateTaskInputServerOperation extends BaseRemotableOperation {
274
+ constructor() {
275
+ super(...arguments);
276
+ this.OperationKey = 'TaskGraph.UpdateTaskInput';
277
+ this.ExecutionMode = 'Sync';
278
+ this.RequiredScope = 'taskgraph:execute';
279
+ }
280
+ async InternalExecute(input, provider, user) {
281
+ if (!input?.taskID)
282
+ throw new Error('taskID is required');
283
+ if (input.payload === undefined)
284
+ throw new Error('payload is required');
285
+ const graph = await graphOfTask(input.taskID, provider, user);
286
+ if ('error' in graph)
287
+ return failed(graph.error);
288
+ const denied = await authorizeGraphControl(graph.parentTaskID, provider, user);
289
+ if (denied)
290
+ return failed(denied);
291
+ const result = await new TaskGraphService().UpdateTaskInput(input.taskID, input.payload, submitContext(provider, user));
292
+ return { success: result.Success, errorMessage: result.ErrorMessage };
293
+ }
294
+ };
295
+ TaskGraphUpdateTaskInputServerOperation = __decorate([
296
+ RegisterClass(BaseRemotableOperation, 'TaskGraph.UpdateTaskInput')
297
+ ], TaskGraphUpdateTaskInputServerOperation);
298
+ export { TaskGraphUpdateTaskInputServerOperation };
299
+ /** Prevents tree-shaking of the registered operation classes. */
300
+ export function LoadTaskGraphDebugOperations() {
301
+ void TaskGraphPauseServerOperation;
302
+ void TaskGraphResumeServerOperation;
303
+ void TaskGraphStepServerOperation;
304
+ void TaskGraphSetBreakpointsServerOperation;
305
+ void TaskGraphOverrideEdgeServerOperation;
306
+ void TaskGraphSkipTaskServerOperation;
307
+ void TaskGraphForceCompleteTaskServerOperation;
308
+ void TaskGraphUpdateTaskInputServerOperation;
309
+ }
310
+ //# sourceMappingURL=TaskGraphDebugOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskGraphDebugOperations.js","sourceRoot":"","sources":["../../src/operations/TaskGraphDebugOperations.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAqB,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,gBAAgB,EAA0B,MAAM,qBAAqB,CAAC;AAmD7H,8EAA8E;AAE9E,SAAS,aAAa,CAAC,QAA2B,EAAE,IAAc;IAC9D,8FAA8F;IAC9F,6CAA6C;IAC7C,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACpG,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,qBAAqB,CAChC,YAAoB,EACpB,QAA2B,EAC3B,IAAc;IAEd,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,eAAe,CAAe,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/E,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAAE,OAAO,uBAAuB,CAAC;IACvE,MAAM,KAAK,GAAG,4BAA4B,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,iBAAiB,CAAC;IAClF,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACxC,OAAO,gDAAgD,CAAC;IAC5D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