@memberjunction/ng-task-graph-editor 6.1.0-edge.1 → 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.
- package/dist/lib/task-graph-canvas-adapter.d.ts +102 -5
- package/dist/lib/task-graph-canvas-adapter.d.ts.map +1 -1
- package/dist/lib/task-graph-canvas-adapter.js +154 -18
- package/dist/lib/task-graph-canvas-adapter.js.map +1 -1
- package/dist/lib/task-graph-editor.component.d.ts +106 -4
- package/dist/lib/task-graph-editor.component.d.ts.map +1 -1
- package/dist/lib/task-graph-editor.component.js +246 -24
- package/dist/lib/task-graph-editor.component.js.map +1 -1
- package/dist/lib/task-graph-editor.module.d.ts +6 -5
- package/dist/lib/task-graph-editor.module.d.ts.map +1 -1
- package/dist/lib/task-graph-editor.module.js +4 -3
- package/dist/lib/task-graph-editor.module.js.map +1 -1
- package/dist/lib/task-graph-properties-panel.component.d.ts +34 -8
- package/dist/lib/task-graph-properties-panel.component.d.ts.map +1 -1
- package/dist/lib/task-graph-properties-panel.component.js +164 -45
- package/dist/lib/task-graph-properties-panel.component.js.map +1 -1
- package/dist/lib/task-graph-run-view.component.d.ts +113 -0
- package/dist/lib/task-graph-run-view.component.d.ts.map +1 -0
- package/dist/lib/task-graph-run-view.component.js +289 -0
- package/dist/lib/task-graph-run-view.component.js.map +1 -0
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +1 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-graph-editor.component.js","sourceRoot":"","sources":["../../src/lib/task-graph-editor.component.ts","../../src/lib/task-graph-editor.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO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AAC;QAC7E,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;6QA1QQ,wBAAwB,yBAAxB,wBAAwB;6DAAxB,wBAAwB;YC/ErC,8BAAoB;YAOhB,AANF,qGAAe,2DAMN;YA+BX,iBAAM;;YArCJ,cAoCC;YApCD,qCAoCC;;;iFD0CU,wBAAwB;cANpC,SAAS;6BACM,KAAK,YACP,sBAAsB;;kBAY/B,KAAK;;kBAcL,KAAK;;kBAUL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBAIL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,MAAM;;kBACN,MAAM;;kFA/DE,wBAAwB","sourcesContent":["/**\n * @fileoverview View and edit a `TaskGraphSpec` on a canvas.\n *\n * **What makes this reusable is its subject.** It edits `TaskGraphSpec` — the one fully-qualified\n * graph contract every producer in the program already authors against (D16) — rather than any\n * particular persistence. A design-time flow, a graph an agent emitted at runtime, a stored workflow\n * definition and a graph a person is drawing from scratch are all the same type here, so one\n * component serves the Flow Agent editor, the Agent Run admin view, conversation plan cards, the\n * Tasks view, and anything downstream.\n *\n * The alternative — teaching the existing agent editor a second dialect — is precisely how the two\n * graph models drifted apart before Phase 4 pulled them onto one traversal engine.\n *\n * **Layer: `widgets` (L1/L2).** No `@angular/router`, no `@memberjunction/ng-shared`, no\n * `NavigationService`. Route-derived state arrives as `@Input()`; navigation *intent* leaves as an\n * `@Output()` the host acts on, because a widget cannot know whether it is inside Explorer, a\n * downstream app, or an embedded panel. See `guides/UI_LAYERING_GUIDE.md`.\n *\n * **Validation is the engine's.** Cycles, unknown dependency refs and assignment conflicts are\n * reported by calling `ValidateTaskGraphSpec` from `@memberjunction/ai-core-plus` — the same\n * function `LoopAgentType` and `TaskGraphService.Submit` call. A second implementation here would be\n * a second definition of \"valid\", and the graph that passes on the canvas would be free to fail at\n * submission.\n *\n * @module @memberjunction/ng-task-graph-editor\n */\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport {\n ValidateTaskGraphSpec,\n type TaskGraphSpec,\n type TaskGraphSpecNode,\n type TaskGraphValidationError,\n} from '@memberjunction/ai-core-plus';\nimport type {\n FlowConnection,\n FlowConnectionCreatedEvent,\n FlowLayoutDirection,\n FlowNode,\n FlowNodeTypeConfig,\n} from '@memberjunction/ng-flow-editor';\nimport {\n AddDependency,\n AddTask,\n GetDependents,\n NextTempId,\n RemoveDependency,\n RemoveTask,\n SpecToConnections,\n SpecToNodes,\n TASK_GRAPH_NODE_TYPES,\n UpdateTask,\n WouldCreateCycle,\n type TaskGraphRuntimeStatus,\n} from './task-graph-canvas-adapter';\nimport {\n AfterDependencyAddedEventArgs,\n AfterDependencyRemovedEventArgs,\n AfterTaskAddedEventArgs,\n AfterTaskRemovedEventArgs,\n AfterTaskUpdatedEventArgs,\n AgentOpenRequestedEventArgs,\n BeforeDependencyAddedEventArgs,\n BeforeDependencyRemovedEventArgs,\n BeforeTaskAddedEventArgs,\n BeforeTaskRemovedEventArgs,\n BeforeTaskUpdatedEventArgs,\n RecordOpenRequestedEventArgs,\n TaskGraphSelectionChangedEventArgs,\n TaskGraphSpecChangedEventArgs,\n TaskGraphValidationChangedEventArgs,\n} from './task-graph-editor-events';\n\n@Component({\n standalone: false,\n selector: 'mj-task-graph-editor',\n templateUrl: './task-graph-editor.component.html',\n styleUrls: ['./task-graph-editor.component.css'],\n})\nexport class TaskGraphEditorComponent extends BaseAngularComponent {\n // ── Inputs ───────────────────────────────────────────────────────────────\n\n /**\n * The graph to show. Setter-based rather than `ngOnChanges` (repo convention): the reaction is\n * explicit, runs only when this property changes, and costs nothing on other change-detection\n * passes.\n */\n @Input()\n public set Spec(value: TaskGraphSpec | null) {\n this.currentSpec = value;\n this.project();\n }\n public get Spec(): TaskGraphSpec | null {\n return this.currentSpec;\n }\n\n /**\n * Live per-task state, keyed by `tempId`. Supplying it turns the canvas into a runtime view of\n * the same graph — the convergence point the program was aiming at: one renderer for design time\n * and run time, rather than an editor and a separate Gantt that can disagree.\n */\n @Input()\n public set RuntimeStatus(value: TaskGraphRuntimeStatus | null) {\n this.currentRuntime = value;\n this.project();\n }\n public get RuntimeStatus(): TaskGraphRuntimeStatus | null {\n return this.currentRuntime;\n }\n\n /** Read-only mode. The same component is the viewer — there is no second, weaker renderer. */\n @Input() public ReadOnly: boolean = false;\n\n @Input() public ShowToolbar: boolean = true;\n @Input() public ShowPalette: boolean = true;\n @Input() public ShowMinimap: boolean = true;\n @Input() public ShowStatusBar: boolean = true;\n @Input() public AutoLayoutDirection: FlowLayoutDirection = 'vertical';\n\n /** Shown when there is nothing to draw yet. */\n @Input() public EmptyStateMessage: string = 'No steps yet. Add one to start building this workflow.';\n\n // ── Outputs ──────────────────────────────────────────────────────────────\n\n @Output() public BeforeTaskAdded = new EventEmitter<BeforeTaskAddedEventArgs>();\n @Output() public AfterTaskAdded = new EventEmitter<AfterTaskAddedEventArgs>();\n @Output() public BeforeTaskRemoved = new EventEmitter<BeforeTaskRemovedEventArgs>();\n @Output() public AfterTaskRemoved = new EventEmitter<AfterTaskRemovedEventArgs>();\n @Output() public BeforeTaskUpdated = new EventEmitter<BeforeTaskUpdatedEventArgs>();\n @Output() public AfterTaskUpdated = new EventEmitter<AfterTaskUpdatedEventArgs>();\n @Output() public BeforeDependencyAdded = new EventEmitter<BeforeDependencyAddedEventArgs>();\n @Output() public AfterDependencyAdded = new EventEmitter<AfterDependencyAddedEventArgs>();\n @Output() public BeforeDependencyRemoved = new EventEmitter<BeforeDependencyRemovedEventArgs>();\n @Output() public AfterDependencyRemoved = new EventEmitter<AfterDependencyRemovedEventArgs>();\n\n /** Informational — no `Before` pair, because these report what already happened. */\n @Output() public SpecChanged = new EventEmitter<TaskGraphSpecChangedEventArgs>();\n @Output() public SelectionChanged = new EventEmitter<TaskGraphSelectionChangedEventArgs>();\n @Output() public ValidationChanged = new EventEmitter<TaskGraphValidationChangedEventArgs>();\n\n /** Intent-only — the host navigates; this widget has no Router and must not acquire one. */\n @Output() public AgentOpenRequested = new EventEmitter<AgentOpenRequestedEventArgs>();\n @Output() public RecordOpenRequested = new EventEmitter<RecordOpenRequestedEventArgs>();\n\n // ── Rendered state ───────────────────────────────────────────────────────\n\n public Nodes: FlowNode[] = [];\n public Connections: FlowConnection[] = [];\n public NodeTypes: FlowNodeTypeConfig[] = TASK_GRAPH_NODE_TYPES;\n public SelectedTask: TaskGraphSpecNode | null = null;\n public ValidationErrors: readonly TaskGraphValidationError[] = [];\n public IsValid: boolean = true;\n\n private currentSpec: TaskGraphSpec | null = null;\n private currentRuntime: TaskGraphRuntimeStatus | null = null;\n\n public get IsEmpty(): boolean {\n return (this.currentSpec?.tasks?.length ?? 0) === 0;\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n //\n // Imperative entry points exist for exactly the case the cancelable-event contract cannot serve:\n // a host that needs to `await` something (a confirm dialog) before the action proceeds. A\n // `Before*` handler cannot await — control returns to the emitter before the handler sets\n // `Cancel` — so the host awaits first and then calls one of these.\n\n /** Re-runs validation and emits the result. Idempotent. */\n public Validate(): TaskGraphValidationChangedEventArgs {\n const result = this.currentSpec\n ? ValidateTaskGraphSpec(this.currentSpec)\n : { Valid: true, Errors: [] as TaskGraphValidationError[] };\n\n this.IsValid = result.Valid;\n this.ValidationErrors = result.Errors;\n\n const args = new TaskGraphValidationChangedEventArgs(result.Valid, result.Errors);\n this.ValidationChanged.emit(args);\n return args;\n }\n\n /** Adds a task. Returns the new task, or null when a host vetoed it. */\n public AddTask(partial: Partial<TaskGraphSpecNode> = {}): TaskGraphSpecNode | null {\n if (this.ReadOnly || !this.currentSpec) return null;\n\n const task: TaskGraphSpecNode = {\n tempId: partial.tempId ?? NextTempId(this.currentSpec),\n name: partial.name ?? 'New step',\n description: partial.description ?? '',\n agentName: partial.agentName,\n assignToUser: partial.assignToUser,\n dependsOn: partial.dependsOn ?? [],\n inputPayload: partial.inputPayload,\n };\n\n const before = new BeforeTaskAddedEventArgs(task);\n this.BeforeTaskAdded.emit(before);\n if (before.Cancel) return null;\n\n this.commit(AddTask(this.currentSpec, task), 'TaskAdded');\n this.AfterTaskAdded.emit(new AfterTaskAddedEventArgs(task, this.currentSpec!));\n return task;\n }\n\n /** Removes a task and every edge into it. Returns false when a host vetoed it. */\n public RemoveTask(tempId: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n const task = this.findTask(tempId);\n if (!task) return false;\n\n // The blast radius travels with the event: a host deciding whether to veto needs to know\n // what else breaks, not merely which box was clicked.\n const before = new BeforeTaskRemovedEventArgs(task, GetDependents(this.currentSpec, tempId));\n this.BeforeTaskRemoved.emit(before);\n if (before.Cancel) return false;\n\n this.commit(RemoveTask(this.currentSpec, tempId), 'TaskRemoved');\n if (this.SelectedTask?.tempId === tempId) this.selectTask(null);\n this.AfterTaskRemoved.emit(new AfterTaskRemovedEventArgs(task, this.currentSpec!));\n return true;\n }\n\n /** Replaces a task's properties. Returns false when a host vetoed it. */\n public UpdateTask(tempId: string, next: TaskGraphSpecNode): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n const previous = this.findTask(tempId);\n if (!previous) return false;\n\n const before = new BeforeTaskUpdatedEventArgs(previous, next);\n this.BeforeTaskUpdated.emit(before);\n if (before.Cancel) return false;\n\n this.commit(UpdateTask(this.currentSpec, tempId, next), 'TaskUpdated');\n if (this.SelectedTask?.tempId === tempId) this.SelectedTask = next;\n this.AfterTaskUpdated.emit(new AfterTaskUpdatedEventArgs(next, this.currentSpec!));\n return true;\n }\n\n /**\n * Adds a dependency edge. Returns false when it was vetoed **or would create a cycle**.\n *\n * The cycle is refused unconditionally, not merely reported: a cyclic graph can never execute —\n * nothing would ever become eligible — so allowing the canvas to draw one would let a user build\n * something the engine must then reject. Better to refuse the stroke than to accept a graph that\n * cannot run.\n */\n public AddDependency(fromTempId: string, toTempId: string, condition?: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n\n const cycle = WouldCreateCycle(this.currentSpec, fromTempId, toTempId);\n const before = new BeforeDependencyAddedEventArgs(fromTempId, toTempId, cycle);\n this.BeforeDependencyAdded.emit(before);\n if (before.Cancel || cycle) return false;\n\n this.commit(AddDependency(this.currentSpec, fromTempId, toTempId, condition), 'DependencyAdded');\n this.AfterDependencyAdded.emit(new AfterDependencyAddedEventArgs(fromTempId, toTempId, this.currentSpec!));\n return true;\n }\n\n /** Removes a dependency edge. Returns false when a host vetoed it. */\n public RemoveDependency(fromTempId: string, toTempId: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n\n const before = new BeforeDependencyRemovedEventArgs(fromTempId, toTempId);\n this.BeforeDependencyRemoved.emit(before);\n if (before.Cancel) return false;\n\n this.commit(RemoveDependency(this.currentSpec, fromTempId, toTempId), 'DependencyRemoved');\n this.AfterDependencyRemoved.emit(new AfterDependencyRemovedEventArgs(fromTempId, toTempId, this.currentSpec!));\n return true;\n }\n\n /**\n * Sets — or with an empty string, clears — a dependency edge's condition.\n *\n * Implemented as remove-then-add so it travels the same `Before*`/`After*` path as any other\n * edge change. A separate silent mutation would be a second write path into the spec, and the\n * veto contract would then be right in one place and wrong in the other.\n */\n public SetDependencyCondition(fromTempId: string, toTempId: string, condition: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n if (!this.RemoveDependency(fromTempId, toTempId)) return false;\n return this.AddDependency(fromTempId, toTempId, condition.trim() || undefined);\n }\n\n /** Asks the host to open the agent behind a task. */\n public RequestAgentOpen(task: TaskGraphSpecNode): void {\n if (task.agentName) {\n this.AgentOpenRequested.emit(new AgentOpenRequestedEventArgs(task.agentName, task));\n }\n }\n\n /** Asks the host to open a record the graph references. */\n public RequestRecordOpen(entityName: string, recordID: string): void {\n this.RecordOpenRequested.emit(new RecordOpenRequestedEventArgs(entityName, recordID));\n }\n\n // ── Canvas handlers ──────────────────────────────────────────────────────\n\n public OnNodeSelected(node: FlowNode | null): void {\n this.selectTask(node ? this.findTask(node.ID) : null);\n }\n\n public OnConnectionCreated(event: FlowConnectionCreatedEvent): void {\n this.AddDependency(event.SourceNodeID, event.TargetNodeID);\n }\n\n public OnConnectionRemoved(connection: FlowConnection): void {\n this.RemoveDependency(connection.SourceNodeID, connection.TargetNodeID);\n }\n\n public OnNodeRemoved(node: FlowNode): void {\n this.RemoveTask(node.ID);\n }\n\n // ── Internals ────────────────────────────────────────────────────────────\n\n private findTask(tempId: string): TaskGraphSpecNode | null {\n return (this.currentSpec?.tasks ?? []).find((t) => t.tempId === tempId) ?? null;\n }\n\n private selectTask(task: TaskGraphSpecNode | null): void {\n this.SelectedTask = task;\n this.SelectionChanged.emit(new TaskGraphSelectionChangedEventArgs(task));\n }\n\n /** Applies a new spec, re-projects, re-validates, and tells the host — in that order. */\n private commit(spec: TaskGraphSpec, reason: TaskGraphSpecChangedEventArgs['Reason']): void {\n this.currentSpec = spec;\n this.project();\n this.SpecChanged.emit(new TaskGraphSpecChangedEventArgs(spec, reason));\n }\n\n /** Re-derives the canvas from the spec. Validation rides along so the two never disagree. */\n private project(): void {\n if (!this.currentSpec) {\n this.Nodes = [];\n this.Connections = [];\n this.ValidationErrors = [];\n this.IsValid = true;\n return;\n }\n this.Nodes = SpecToNodes(this.currentSpec, this.currentRuntime ?? undefined);\n this.Connections = SpecToConnections(this.currentSpec);\n this.Validate();\n }\n}\n","<div class=\"mj-tge\">\n @if (IsEmpty) {\n <mj-empty-state\n Icon=\"fa-diagram-project\"\n Title=\"Nothing here yet\"\n [Message]=\"EmptyStateMessage\">\n </mj-empty-state>\n } @else {\n @if (!IsValid && ValidationErrors.length > 0) {\n <!-- Author-time validation comes from the SAME function the engine runs at submission, so a\n graph that looks fine here cannot be rejected later for a reason the canvas never showed. -->\n <mj-alert Variant=\"warning\" class=\"mj-tge__validation\">\n <strong>{{ ValidationErrors.length }} problem{{ ValidationErrors.length === 1 ? '' : 's' }} to fix</strong>\n <ul class=\"mj-tge__validation-list\">\n @for (err of ValidationErrors; track err.Code + (err.TempId ?? '')) {\n <li>{{ err.Message }}</li>\n }\n </ul>\n </mj-alert>\n }\n\n <mj-flow-editor\n class=\"mj-tge__canvas\"\n [Nodes]=\"Nodes\"\n [Connections]=\"Connections\"\n [NodeTypes]=\"NodeTypes\"\n [ReadOnly]=\"ReadOnly\"\n [ShowToolbar]=\"ShowToolbar\"\n [ShowPalette]=\"ShowPalette && !ReadOnly\"\n [ShowMinimap]=\"ShowMinimap\"\n [ShowStatusBar]=\"ShowStatusBar\"\n [AutoLayoutDirection]=\"AutoLayoutDirection\"\n (NodeSelected)=\"OnNodeSelected($event)\"\n (NodeRemoved)=\"OnNodeRemoved($event)\"\n (ConnectionCreated)=\"OnConnectionCreated($event)\"\n (ConnectionRemoved)=\"OnConnectionRemoved($event)\">\n </mj-flow-editor>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"task-graph-editor.component.js","sourceRoot":"","sources":["../../src/lib/task-graph-editor.component.ts","../../src/lib/task-graph-editor.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAa,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACH,QAAQ,EACR,qBAAqB,GAIxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAWrE,OAAO,EACH,aAAa,EACb,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB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AAM;;kBACN,MAAM;;kBAGN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,MAAM;;kBACN,MAAM;;kBAWN,SAAS;mBAAC,mBAAmB;;kFAtHrB,wBAAwB","sourcesContent":["/**\n * @fileoverview View and edit a `TaskGraphSpec` on a canvas.\n *\n * **What makes this reusable is its subject.** It edits `TaskGraphSpec` — the one fully-qualified\n * graph contract every producer in the program already authors against (D16) — rather than any\n * particular persistence. A design-time flow, a graph an agent emitted at runtime, a stored workflow\n * definition and a graph a person is drawing from scratch are all the same type here, so one\n * component serves the Flow Agent editor, the Agent Run admin view, conversation plan cards, the\n * Tasks view, and anything downstream.\n *\n * The alternative — teaching the existing agent editor a second dialect — is precisely how the two\n * graph models drifted apart before Phase 4 pulled them onto one traversal engine.\n *\n * **Layer: `widgets` (L1/L2).** No `@angular/router`, no `@memberjunction/ng-shared`, no\n * `NavigationService`. Route-derived state arrives as `@Input()`; navigation *intent* leaves as an\n * `@Output()` the host acts on, because a widget cannot know whether it is inside Explorer, a\n * downstream app, or an embedded panel. See `guides/UI_LAYERING_GUIDE.md`.\n *\n * **Validation is the engine's.** Cycles, unknown dependency refs and assignment conflicts are\n * reported by calling `ValidateTaskGraphSpec` from `@memberjunction/ai-core-plus` — the same\n * function `LoopAgentType` and `TaskGraphService.Submit` call. A second implementation here would be\n * a second definition of \"valid\", and the graph that passes on the canvas would be free to fail at\n * submission.\n *\n * @module @memberjunction/ng-task-graph-editor\n */\nimport { Component, EventEmitter, Input, OnDestroy, Output, ViewChild } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport {\n ConfigOf,\n ValidateTaskGraphSpec,\n type TaskGraphSpec,\n type TaskGraphSpecNode,\n type TaskGraphValidationError,\n} from '@memberjunction/ai-core-plus';\nimport { FlowEditorComponent } from '@memberjunction/ng-flow-editor';\nimport type {\n FlowConnection,\n FlowConnectionCreatedEvent,\n FlowLayoutDirection,\n FlowNode,\n FlowNodeAddedEvent,\n FlowNodeMovedEvent,\n FlowNodeTypeConfig,\n FlowPosition,\n} from '@memberjunction/ng-flow-editor';\nimport {\n AddDependency,\n AddTask,\n GetDependents,\n GetNodeTypeConfig,\n IsAuthorableNodeType,\n NewTaskFromNodeType,\n NextTempId,\n RemoveDependency,\n RemoveTask,\n SpecToConnections,\n SpecToNodes,\n TASK_GRAPH_NODE_TYPES,\n UpdateTask,\n WouldCreateCycle,\n type TaskGraphRuntimeStatus,\n} from './task-graph-canvas-adapter';\nimport type {\n DependencyConditionChangeRequestedEventArgs,\n TaskPropertyChangeRequestedEventArgs,\n} from './task-graph-properties-panel.component';\nimport {\n AfterDependencyAddedEventArgs,\n AfterDependencyRemovedEventArgs,\n AfterTaskAddedEventArgs,\n AfterTaskRemovedEventArgs,\n AfterTaskUpdatedEventArgs,\n AgentOpenRequestedEventArgs,\n BeforeDependencyAddedEventArgs,\n BeforeDependencyRemovedEventArgs,\n BeforeTaskAddedEventArgs,\n BeforeTaskRemovedEventArgs,\n BeforeTaskUpdatedEventArgs,\n RecordOpenRequestedEventArgs,\n TaskGraphSelectionChangedEventArgs,\n TaskGraphSpecChangedEventArgs,\n TaskGraphValidationChangedEventArgs,\n} from './task-graph-editor-events';\n\n@Component({\n standalone: false,\n selector: 'mj-task-graph-editor',\n templateUrl: './task-graph-editor.component.html',\n styleUrls: ['./task-graph-editor.component.css'],\n})\nexport class TaskGraphEditorComponent extends BaseAngularComponent implements OnDestroy {\n // ── Inputs ───────────────────────────────────────────────────────────────\n\n /**\n * The graph to show. Setter-based rather than `ngOnChanges` (repo convention): the reaction is\n * explicit, runs only when this property changes, and costs nothing on other change-detection\n * passes.\n */\n @Input()\n public set Spec(value: TaskGraphSpec | null) {\n this.currentSpec = value;\n this.project();\n }\n public get Spec(): TaskGraphSpec | null {\n return this.currentSpec;\n }\n\n /**\n * Live per-task state, keyed by `tempId`. Supplying it turns the canvas into a runtime view of\n * the same graph — the convergence point the program was aiming at: one renderer for design time\n * and run time, rather than an editor and a separate Gantt that can disagree.\n */\n @Input()\n public set RuntimeStatus(value: TaskGraphRuntimeStatus | null) {\n this.currentRuntime = value;\n this.project();\n }\n public get RuntimeStatus(): TaskGraphRuntimeStatus | null {\n return this.currentRuntime;\n }\n\n /**\n * Geometry for the nodes, keyed by `tempId`. Supplying it places the graph instead of laying it\n * out.\n *\n * **Why a host must be able to supply this.** The spec has no layout field, so without it every\n * node projects to the origin — all of them, stacked in one place — and the canvas is left to\n * rescue the situation with a deferred Dagre pass. That pass is fine in the editor, where the\n * author is present and can rearrange. It was not fine in the RUN views, which held the real\n * geometry (a workflow's authored positions, or a computed layout) and had no way to hand it\n * over: every run rendered its steps piled on the origin, and the zoom-to-fit that followed\n * fitted a bounding box one node wide and blew the viewport up past 250%.\n *\n * Applied as the starting geometry only. Once the canvas reports positions of its own — a drag,\n * an arrange — those win, because the person moving a node is the authority on where it goes.\n */\n @Input()\n public set NodePositions(value: ReadonlyMap<string, FlowPosition> | null) {\n if (!value || value.size === 0) return;\n for (const [id, position] of value) this.knownPositions.set(id, { ...position });\n // Real geometry means the one-time Dagre pass has nothing to rescue.\n this.hasLaidOut = true;\n this.project();\n this.zoomToFitSoon();\n }\n\n /** Read-only mode. The same component is the viewer — there is no second, weaker renderer. */\n @Input() public ReadOnly: boolean = false;\n\n @Input() public ShowToolbar: boolean = true;\n @Input() public ShowPalette: boolean = true;\n @Input() public ShowMinimap: boolean = true;\n @Input() public ShowStatusBar: boolean = true;\n @Input() public AutoLayoutDirection: FlowLayoutDirection = 'vertical';\n\n /**\n * Whether the properties panel rides alongside the canvas.\n *\n * On by default, because without it a step added from the palette can never be named or\n * assigned — the canvas draws structure, the panel supplies content, and one without the other\n * is a graph the author can build but not finish. Hosts embedding the read-only viewer in a chat\n * card turn it off.\n */\n @Input() public ShowProperties: boolean = true;\n\n /**\n * Agent names offered when assigning a step. Supplied by the host, which owns data access —\n * this is a widgets-layer component and does not query.\n */\n @Input() public AvailableAgentNames: readonly string[] = [];\n\n /** Action names offered when assigning a step. Same ownership rule as `AvailableAgentNames`. */\n @Input() public AvailableActionNames: readonly string[] = [];\n\n /** Shown when there is nothing to draw yet. */\n @Input() public EmptyStateMessage: string = 'No steps yet. Add one to start building this workflow.';\n\n // ── Outputs ──────────────────────────────────────────────────────────────\n\n @Output() public BeforeTaskAdded = new EventEmitter<BeforeTaskAddedEventArgs>();\n @Output() public AfterTaskAdded = new EventEmitter<AfterTaskAddedEventArgs>();\n @Output() public BeforeTaskRemoved = new EventEmitter<BeforeTaskRemovedEventArgs>();\n @Output() public AfterTaskRemoved = new EventEmitter<AfterTaskRemovedEventArgs>();\n @Output() public BeforeTaskUpdated = new EventEmitter<BeforeTaskUpdatedEventArgs>();\n @Output() public AfterTaskUpdated = new EventEmitter<AfterTaskUpdatedEventArgs>();\n @Output() public BeforeDependencyAdded = new EventEmitter<BeforeDependencyAddedEventArgs>();\n @Output() public AfterDependencyAdded = new EventEmitter<AfterDependencyAddedEventArgs>();\n @Output() public BeforeDependencyRemoved = new EventEmitter<BeforeDependencyRemovedEventArgs>();\n @Output() public AfterDependencyRemoved = new EventEmitter<AfterDependencyRemovedEventArgs>();\n\n /** Informational — no `Before` pair, because these report what already happened. */\n @Output() public SpecChanged = new EventEmitter<TaskGraphSpecChangedEventArgs>();\n @Output() public SelectionChanged = new EventEmitter<TaskGraphSelectionChangedEventArgs>();\n @Output() public ValidationChanged = new EventEmitter<TaskGraphValidationChangedEventArgs>();\n\n /** Intent-only — the host navigates; this widget has no Router and must not acquire one. */\n @Output() public AgentOpenRequested = new EventEmitter<AgentOpenRequestedEventArgs>();\n @Output() public RecordOpenRequested = new EventEmitter<RecordOpenRequestedEventArgs>();\n\n // ── Rendered state ───────────────────────────────────────────────────────\n\n public Nodes: FlowNode[] = [];\n public Connections: FlowConnection[] = [];\n public NodeTypes: FlowNodeTypeConfig[] = [...TASK_GRAPH_NODE_TYPES];\n public SelectedTask: TaskGraphSpecNode | null = null;\n public ValidationErrors: readonly TaskGraphValidationError[] = [];\n public IsValid: boolean = true;\n\n @ViewChild(FlowEditorComponent) protected canvas: FlowEditorComponent | undefined;\n\n private currentSpec: TaskGraphSpec | null = null;\n private currentRuntime: TaskGraphRuntimeStatus | null = null;\n\n public get IsEmpty(): boolean {\n return (this.currentSpec?.tasks?.length ?? 0) === 0;\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n //\n // Imperative entry points exist for exactly the case the cancelable-event contract cannot serve:\n // a host that needs to `await` something (a confirm dialog) before the action proceeds. A\n // `Before*` handler cannot await — control returns to the emitter before the handler sets\n // `Cancel` — so the host awaits first and then calls one of these.\n\n /** Re-runs validation and emits the result. Idempotent. */\n public Validate(): TaskGraphValidationChangedEventArgs {\n const result = this.currentSpec\n ? ValidateTaskGraphSpec(this.currentSpec)\n : { Valid: true, Errors: [] as TaskGraphValidationError[] };\n\n this.IsValid = result.Valid;\n this.ValidationErrors = result.Errors;\n\n const args = new TaskGraphValidationChangedEventArgs(result.Valid, result.Errors);\n this.ValidationChanged.emit(args);\n return args;\n }\n\n /** Adds a task. Returns the new task, or null when a host vetoed it. */\n public AddTask(partial: Partial<TaskGraphSpecNode> = {}): TaskGraphSpecNode | null {\n if (this.ReadOnly || !this.currentSpec) return null;\n\n // Kind and configuration travel together — a partial that supplies one without the other\n // would be a node the engine cannot run, so an unspecified partial defaults to an unassigned\n // Agent step and the validator says so immediately.\n const task: TaskGraphSpecNode = {\n tempId: partial.tempId ?? NextTempId(this.currentSpec),\n name: partial.name ?? 'New step',\n description: partial.description ?? '',\n kind: partial.kind ?? 'Agent',\n configuration: partial.configuration ?? { agentName: '' },\n dependsOn: partial.dependsOn ?? [],\n policy: partial.policy,\n layout: partial.layout,\n inputPayload: partial.inputPayload,\n };\n\n const before = new BeforeTaskAddedEventArgs(task);\n this.BeforeTaskAdded.emit(before);\n if (before.Cancel) return null;\n\n this.commit(AddTask(this.currentSpec, task), 'TaskAdded');\n this.AfterTaskAdded.emit(new AfterTaskAddedEventArgs(task, this.currentSpec!));\n return task;\n }\n\n /** Removes a task and every edge into it. Returns false when a host vetoed it. */\n public RemoveTask(tempId: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n const task = this.findTask(tempId);\n if (!task) return false;\n\n // The blast radius travels with the event: a host deciding whether to veto needs to know\n // what else breaks, not merely which box was clicked.\n const before = new BeforeTaskRemovedEventArgs(task, GetDependents(this.currentSpec, tempId));\n this.BeforeTaskRemoved.emit(before);\n if (before.Cancel) return false;\n\n this.commit(RemoveTask(this.currentSpec, tempId), 'TaskRemoved');\n if (this.SelectedTask?.tempId === tempId) this.selectTask(null);\n this.AfterTaskRemoved.emit(new AfterTaskRemovedEventArgs(task, this.currentSpec!));\n return true;\n }\n\n /** Replaces a task's properties. Returns false when a host vetoed it. */\n public UpdateTask(tempId: string, next: TaskGraphSpecNode): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n const previous = this.findTask(tempId);\n if (!previous) return false;\n\n const before = new BeforeTaskUpdatedEventArgs(previous, next);\n this.BeforeTaskUpdated.emit(before);\n if (before.Cancel) return false;\n\n this.commit(UpdateTask(this.currentSpec, tempId, next), 'TaskUpdated');\n if (this.SelectedTask?.tempId === tempId) this.SelectedTask = next;\n this.AfterTaskUpdated.emit(new AfterTaskUpdatedEventArgs(next, this.currentSpec!));\n return true;\n }\n\n /**\n * Adds a dependency edge. Returns false when it was vetoed **or would create a cycle**.\n *\n * The cycle is refused unconditionally, not merely reported: a cyclic graph can never execute —\n * nothing would ever become eligible — so allowing the canvas to draw one would let a user build\n * something the engine must then reject. Better to refuse the stroke than to accept a graph that\n * cannot run.\n */\n public AddDependency(fromTempId: string, toTempId: string, condition?: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n\n const cycle = WouldCreateCycle(this.currentSpec, fromTempId, toTempId);\n const before = new BeforeDependencyAddedEventArgs(fromTempId, toTempId, cycle);\n this.BeforeDependencyAdded.emit(before);\n if (before.Cancel || cycle) return false;\n\n this.commit(AddDependency(this.currentSpec, fromTempId, toTempId, condition), 'DependencyAdded');\n this.AfterDependencyAdded.emit(new AfterDependencyAddedEventArgs(fromTempId, toTempId, this.currentSpec!));\n return true;\n }\n\n /** Removes a dependency edge. Returns false when a host vetoed it. */\n public RemoveDependency(fromTempId: string, toTempId: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n\n const before = new BeforeDependencyRemovedEventArgs(fromTempId, toTempId);\n this.BeforeDependencyRemoved.emit(before);\n if (before.Cancel) return false;\n\n this.commit(RemoveDependency(this.currentSpec, fromTempId, toTempId), 'DependencyRemoved');\n this.AfterDependencyRemoved.emit(new AfterDependencyRemovedEventArgs(fromTempId, toTempId, this.currentSpec!));\n return true;\n }\n\n /**\n * Sets — or with an empty string, clears — a dependency edge's condition.\n *\n * Implemented as remove-then-add so it travels the same `Before*`/`After*` path as any other\n * edge change. A separate silent mutation would be a second write path into the spec, and the\n * veto contract would then be right in one place and wrong in the other.\n */\n public SetDependencyCondition(fromTempId: string, toTempId: string, condition: string): boolean {\n if (this.ReadOnly || !this.currentSpec) return false;\n if (!this.RemoveDependency(fromTempId, toTempId)) return false;\n return this.AddDependency(fromTempId, toTempId, condition.trim() || undefined);\n }\n\n /** Asks the host to open the agent behind a task. */\n public RequestAgentOpen(task: TaskGraphSpecNode): void {\n const agentName = ConfigOf(task, 'Agent')?.agentName;\n if (agentName) {\n this.AgentOpenRequested.emit(new AgentOpenRequestedEventArgs(agentName, task));\n }\n }\n\n /** Asks the host to open a record the graph references. */\n public RequestRecordOpen(entityName: string, recordID: string): void {\n this.RecordOpenRequested.emit(new RecordOpenRequestedEventArgs(entityName, recordID));\n }\n\n // ── Canvas handlers ──────────────────────────────────────────────────────\n\n public OnNodeSelected(node: FlowNode | null): void {\n this.selectTask(node ? this.findTask(node.ID) : null);\n }\n\n /**\n * A palette entry was clicked or dragged onto the canvas.\n *\n * **This binding is the bug.** The canvas has always emitted `NodeAdded` for a palette drop, and\n * this component simply never listened — so the node the canvas announced was thrown away, the\n * spec never gained a task, and the author was told \"a task graph must contain at least one\n * task\" no matter how many times they tried to add one. The canvas does not mutate its own\n * `Nodes` on purpose (the host owns the model); an unheard event is therefore a silent no-op\n * rather than a visible failure, which is why it survived.\n *\n * The new step is selected immediately: it lands unnamed and, for an agent or action step with\n * nothing available to default to, unassigned — so the properties panel is where the author has\n * to go next, and putting them there beats making them find it.\n */\n public OnNodeAdded(event: FlowNodeAddedEvent): void {\n if (this.ReadOnly || !this.currentSpec) return;\n const type = GetNodeTypeConfig(event.Node.Type)?.Type;\n // Only an authorable shape can be dropped from the palette. The render set is wider, and a\n // display-only kind arriving here would mean the palette offered something with no editor.\n if (!type || !IsAuthorableNodeType(type)) return;\n\n const added = this.AddTask(\n NewTaskFromNodeType(this.currentSpec, type, {\n agentName: this.AvailableAgentNames[0],\n actionName: this.AvailableActionNames[0],\n }),\n );\n if (!added) return;\n\n // Remember where the canvas put it BEFORE anything re-projects. The spec has no geometry\n // field, so this map is the only record that the author dropped (or clicked) it here — and\n // without it the node would snap back to the origin on the very next edit.\n this.knownPositions.set(added.tempId, { ...event.Node.Position });\n // A graph that has received a hand-placed node is laid out, by definition. Marking it here\n // stops the one-time Dagre pass from firing later and discarding that placement.\n this.hasLaidOut = true;\n this.selectTask(added);\n }\n\n /** Applies a properties-panel edit through the same vetoable path a canvas edit takes. */\n public OnTaskPropertyChangeRequested(args: TaskPropertyChangeRequestedEventArgs): void {\n this.UpdateTask(args.TempId, args.Next);\n }\n\n /** Applies a properties-panel edge-condition edit. */\n public OnDependencyConditionChangeRequested(args: DependencyConditionChangeRequestedEventArgs): void {\n this.SetDependencyCondition(args.FromTempId, args.ToTempId, args.Condition);\n }\n\n public OnConnectionCreated(event: FlowConnectionCreatedEvent): void {\n this.AddDependency(event.SourceNodeID, event.TargetNodeID);\n }\n\n public OnConnectionRemoved(connection: FlowConnection): void {\n this.RemoveDependency(connection.SourceNodeID, connection.TargetNodeID);\n }\n\n public OnNodeRemoved(node: FlowNode): void {\n this.RemoveTask(node.ID);\n }\n\n // ── Internals ────────────────────────────────────────────────────────────\n\n private findTask(tempId: string): TaskGraphSpecNode | null {\n return (this.currentSpec?.tasks ?? []).find((t) => t.tempId === tempId) ?? null;\n }\n\n private selectTask(task: TaskGraphSpecNode | null): void {\n this.SelectedTask = task;\n this.SelectionChanged.emit(new TaskGraphSelectionChangedEventArgs(task));\n }\n\n /** Applies a new spec, re-projects, re-validates, and tells the host — in that order. */\n private commit(spec: TaskGraphSpec, reason: TaskGraphSpecChangedEventArgs['Reason']): void {\n this.currentSpec = spec;\n this.project();\n this.SpecChanged.emit(new TaskGraphSpecChangedEventArgs(spec, reason));\n }\n\n /** Re-derives the canvas from the spec. Validation rides along so the two never disagree. */\n private project(): void {\n if (!this.currentSpec) {\n this.Nodes = [];\n this.Connections = [];\n this.ValidationErrors = [];\n this.IsValid = true;\n this.hasLaidOut = false;\n this.knownPositions.clear();\n return;\n }\n this.Nodes = SpecToNodes(this.currentSpec, this.currentRuntime ?? undefined, this.knownPositions);\n this.Connections = SpecToConnections(this.currentSpec);\n this.Validate();\n this.arrangeIfNeverLaidOut();\n }\n\n /**\n * Lays the graph out ONCE — when it arrives with no geometry of its own.\n *\n * A `TaskGraphSpec` carries no positions, so a spec opened for the first time projects with\n * every node at the origin and needs Dagre to make it readable. After that the author's layout\n * is the layout: `knownPositions` carries it across re-projections, and re-arranging again would\n * throw away the arrangement they just made.\n *\n * It must also not run on every edit, because `AutoArrange` ends in `ZoomToFit` — so arranging\n * per change meant the viewport snapped to fit after every added step and every drawn\n * connection, which on a one-node graph zooms to maximum. That is the behaviour being fixed\n * here; the rule mirrors the Flow Agent editor's (`flow-agent-editor.component.ts`), which has\n * always arranged only when every node sits at the origin.\n */\n private arrangeIfNeverLaidOut(): void {\n if (this.Nodes.length === 0) return;\n if (this.hasLaidOut) return;\n\n // Nothing to rescue a layout from: a spec whose nodes all sit at the origin has never been\n // arranged. One node at the origin is the legitimate starting case too.\n const allAtOrigin = this.Nodes.every((n) => n.Position.X === 0 && n.Position.Y === 0);\n if (!allAtOrigin) { this.hasLaidOut = true; return; }\n\n this.hasLaidOut = true;\n // Deferred one turn: the canvas has to render the nodes before Dagre can measure them.\n // Cleared on destroy so a pending layout cannot run against a torn-down view.\n if (this.pendingLayout !== null) clearTimeout(this.pendingLayout);\n this.pendingLayout = setTimeout(() => {\n this.pendingLayout = null;\n this.canvas?.AutoArrange(this.AutoLayoutDirection);\n });\n }\n\n /**\n * Fits the viewport to the graph, once the canvas has drawn it.\n *\n * Deferred for the same reason the layout pass is: `fitToScreen` measures the rendered nodes, so\n * calling it in the same turn as the projection fits whatever was on screen a moment ago. With\n * every node still at the origin that bounding box is a single node wide, and \"fit\" means zoom\n * to ~265% — the symptom that made a four-step workflow look like one enormous box.\n */\n private zoomToFitSoon(): void {\n if (this.pendingLayout !== null) clearTimeout(this.pendingLayout);\n this.pendingLayout = setTimeout(() => {\n this.pendingLayout = null;\n this.canvas?.ZoomToFit();\n });\n }\n\n /**\n * The canvas is the authority on geometry, so remember what it reports.\n *\n * Without this the spec — which has no geometry field — is the only survivor of a re-projection,\n * and every edit silently moved every node back to the origin. That is what forced a re-arrange\n * (and therefore a re-zoom) on each change.\n */\n public OnNodesChanged(nodes: FlowNode[]): void {\n for (const n of nodes) this.knownPositions.set(n.ID, { ...n.Position });\n }\n\n /** A single node was dragged. Same authority, narrower event. */\n public OnNodeMoved(event: FlowNodeMovedEvent): void {\n this.knownPositions.set(event.NodeID, { ...event.NewPosition });\n }\n\n public ngOnDestroy(): void {\n if (this.pendingLayout !== null) {\n clearTimeout(this.pendingLayout);\n this.pendingLayout = null;\n }\n }\n\n /** The topology the current layout was computed for; '' when nothing has been laid out. */\n /**\n * Node geometry, which the spec cannot hold.\n *\n * `TaskGraphSpec` is an execution contract with no layout field, so a re-projection would\n * otherwise return every node to the origin. Keyed by `tempId`; written from the canvas\n * (`NodesChanged` / `NodeMoved`) and from the drop position of a newly added node, and read back\n * by `SpecToNodes` on every projection.\n */\n private readonly knownPositions = new Map<string, FlowPosition>();\n\n /** Whether the one-time Dagre pass has run (or been made unnecessary by a hand-placed node). */\n private hasLaidOut: boolean = false;\n private pendingLayout: ReturnType<typeof setTimeout> | null = null;\n}\n","<div class=\"mj-tge\">\n <!-- An EDITABLE empty canvas must still render the editor, because the palette is the only way to\n add a step — showing a bare empty state instead made \"Add one to start building this workflow\"\n an instruction the user could not follow. The hint stays, as a banner above a usable canvas. -->\n @if (IsEmpty && ReadOnly) {\n <mj-empty-state\n Icon=\"fa-diagram-project\"\n Title=\"Nothing here yet\"\n [Message]=\"EmptyStateMessage\">\n </mj-empty-state>\n } @else {\n @if (IsEmpty) {\n <mj-alert Variant=\"info\" class=\"mj-tge__empty-hint\" [Message]=\"EmptyStateMessage\"></mj-alert>\n }\n @if (!IsValid && ValidationErrors.length > 0) {\n <!-- Author-time validation comes from the SAME function the engine runs at submission, so a\n graph that looks fine here cannot be rejected later for a reason the canvas never showed. -->\n <mj-alert Variant=\"warning\" class=\"mj-tge__validation\">\n <strong>{{ ValidationErrors.length }} problem{{ ValidationErrors.length === 1 ? '' : 's' }} to fix</strong>\n <ul class=\"mj-tge__validation-list\">\n @for (err of ValidationErrors; track err.Code + (err.TempId ?? '')) {\n <li>{{ err.Message }}</li>\n }\n </ul>\n </mj-alert>\n }\n\n <div class=\"mj-tge__workspace\">\n <mj-flow-editor\n class=\"mj-tge__canvas\"\n [Nodes]=\"Nodes\"\n [Connections]=\"Connections\"\n [NodeTypes]=\"NodeTypes\"\n [ReadOnly]=\"ReadOnly\"\n [ShowToolbar]=\"ShowToolbar\"\n [ShowPalette]=\"ShowPalette && !ReadOnly\"\n [ShowMinimap]=\"ShowMinimap\"\n [ShowStatusBar]=\"ShowStatusBar\"\n [AutoLayoutDirection]=\"AutoLayoutDirection\"\n (NodeSelected)=\"OnNodeSelected($event)\"\n (NodeAdded)=\"OnNodeAdded($event)\"\n (NodeRemoved)=\"OnNodeRemoved($event)\"\n (NodesChanged)=\"OnNodesChanged($event)\"\n (NodeMoved)=\"OnNodeMoved($event)\"\n (ConnectionCreated)=\"OnConnectionCreated($event)\"\n (ConnectionRemoved)=\"OnConnectionRemoved($event)\">\n </mj-flow-editor>\n\n <!-- The canvas draws structure; this supplies content. A step added from the palette arrives\n unnamed and (with nothing to default to) unassigned, so without this panel the author can\n create a step but never finish one. -->\n @if (ShowProperties && !ReadOnly) {\n <mj-task-graph-properties\n class=\"mj-tge__properties\"\n [Task]=\"SelectedTask\"\n [Spec]=\"Spec\"\n [ReadOnly]=\"ReadOnly\"\n [AvailableAgentNames]=\"AvailableAgentNames\"\n [AvailableActionNames]=\"AvailableActionNames\"\n (TaskPropertyChangeRequested)=\"OnTaskPropertyChangeRequested($event)\"\n (DependencyConditionChangeRequested)=\"OnDependencyConditionChangeRequested($event)\">\n </mj-task-graph-properties>\n }\n </div>\n }\n</div>\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./task-graph-editor.component";
|
|
3
3
|
import * as i2 from "./task-graph-properties-panel.component";
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@angular/
|
|
6
|
-
import * as i5 from "@
|
|
7
|
-
import * as i6 from "@memberjunction/ng-
|
|
4
|
+
import * as i3 from "./task-graph-run-view.component";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "@memberjunction/ng-flow-editor";
|
|
8
|
+
import * as i7 from "@memberjunction/ng-ui-components";
|
|
8
9
|
export declare class TaskGraphEditorModule {
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<TaskGraphEditorModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TaskGraphEditorModule, [typeof i1.TaskGraphEditorComponent, typeof i2.TaskGraphPropertiesPanelComponent], [typeof
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TaskGraphEditorModule, [typeof i1.TaskGraphEditorComponent, typeof i2.TaskGraphPropertiesPanelComponent, typeof i3.TaskGraphRunViewComponent], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.FlowEditorModule, typeof i7.MJEmptyStateComponent, typeof i7.MJAlertComponent, typeof i7.MJButtonDirective], [typeof i1.TaskGraphEditorComponent, typeof i2.TaskGraphPropertiesPanelComponent, typeof i3.TaskGraphRunViewComponent]>;
|
|
11
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<TaskGraphEditorModule>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=task-graph-editor.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-graph-editor.module.d.ts","sourceRoot":"","sources":["../../src/lib/task-graph-editor.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task-graph-editor.module.d.ts","sourceRoot":"","sources":["../../src/lib/task-graph-editor.module.ts"],"names":[],"mappings":";;;;;;;;AAUA,qBAKa,qBAAqB;yCAArB,qBAAqB;0CAArB,qBAAqB;0CAArB,qBAAqB;CAAG"}
|
|
@@ -5,6 +5,7 @@ import { FlowEditorModule } from '@memberjunction/ng-flow-editor';
|
|
|
5
5
|
import { MJEmptyStateComponent, MJAlertComponent, MJButtonDirective } from '@memberjunction/ng-ui-components';
|
|
6
6
|
import { TaskGraphEditorComponent } from './task-graph-editor.component';
|
|
7
7
|
import { TaskGraphPropertiesPanelComponent } from './task-graph-properties-panel.component';
|
|
8
|
+
import { TaskGraphRunViewComponent } from './task-graph-run-view.component';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
export class TaskGraphEditorModule {
|
|
10
11
|
static ɵfac = function TaskGraphEditorModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskGraphEditorModule)(); };
|
|
@@ -14,10 +15,10 @@ export class TaskGraphEditorModule {
|
|
|
14
15
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskGraphEditorModule, [{
|
|
15
16
|
type: NgModule,
|
|
16
17
|
args: [{
|
|
17
|
-
declarations: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent],
|
|
18
|
+
declarations: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent, TaskGraphRunViewComponent],
|
|
18
19
|
imports: [CommonModule, FormsModule, FlowEditorModule, MJEmptyStateComponent, MJAlertComponent, MJButtonDirective],
|
|
19
|
-
exports: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent],
|
|
20
|
+
exports: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent, TaskGraphRunViewComponent],
|
|
20
21
|
}]
|
|
21
22
|
}], null, null); })();
|
|
22
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TaskGraphEditorModule, { declarations: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent], imports: [CommonModule, FormsModule, FlowEditorModule, MJEmptyStateComponent, MJAlertComponent, MJButtonDirective], exports: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent] }); })();
|
|
23
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TaskGraphEditorModule, { declarations: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent, TaskGraphRunViewComponent], imports: [CommonModule, FormsModule, FlowEditorModule, MJEmptyStateComponent, MJAlertComponent, MJButtonDirective], exports: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent, TaskGraphRunViewComponent] }); })();
|
|
23
24
|
//# sourceMappingURL=task-graph-editor.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-graph-editor.module.js","sourceRoot":"","sources":["../../src/lib/task-graph-editor.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAA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CAAiC,EAAE,yBAAyB,aAC3F,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,aACvG,wBAAwB,EAAE,iCAAiC,EAAE,yBAAyB","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { FlowEditorModule } from '@memberjunction/ng-flow-editor';\nimport { MJEmptyStateComponent, MJAlertComponent, MJButtonDirective } from '@memberjunction/ng-ui-components';\n\nimport { TaskGraphEditorComponent } from './task-graph-editor.component';\nimport { TaskGraphPropertiesPanelComponent } from './task-graph-properties-panel.component';\nimport { TaskGraphRunViewComponent } from './task-graph-run-view.component';\n\n@NgModule({\n declarations: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent, TaskGraphRunViewComponent],\n imports: [CommonModule, FormsModule, FlowEditorModule, MJEmptyStateComponent, MJAlertComponent, MJButtonDirective],\n exports: [TaskGraphEditorComponent, TaskGraphPropertiesPanelComponent, TaskGraphRunViewComponent],\n})\nexport class TaskGraphEditorModule {}\n"]}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* @module @memberjunction/ng-task-graph-editor
|
|
15
15
|
*/
|
|
16
16
|
import { EventEmitter } from '@angular/core';
|
|
17
|
-
import type
|
|
17
|
+
import { type TaskGraphSpec, type TaskGraphSpecNode } from '@memberjunction/ai-core-plus';
|
|
18
|
+
import { type TaskGraphNodeType } from './task-graph-canvas-adapter';
|
|
18
19
|
import * as i0 from "@angular/core";
|
|
19
20
|
/** A requested change to one task. The parent applies it; this panel never writes. */
|
|
20
21
|
export declare class TaskPropertyChangeRequestedEventArgs {
|
|
@@ -40,18 +41,33 @@ export declare class TaskGraphPropertiesPanelComponent {
|
|
|
40
41
|
Spec: TaskGraphSpec | null;
|
|
41
42
|
/** Agent names offered in the assignment dropdown. Supplied by the host, which owns data access. */
|
|
42
43
|
AvailableAgentNames: readonly string[];
|
|
44
|
+
/** Action names offered in the assignment dropdown. Same ownership rule as `AvailableAgentNames`. */
|
|
45
|
+
AvailableActionNames: readonly string[];
|
|
43
46
|
ReadOnly: boolean;
|
|
44
47
|
TaskPropertyChangeRequested: EventEmitter<TaskPropertyChangeRequestedEventArgs>;
|
|
45
48
|
DependencyConditionChangeRequested: EventEmitter<DependencyConditionChangeRequestedEventArgs>;
|
|
46
49
|
Draft: TaskGraphSpecNode | null;
|
|
47
50
|
private currentTask;
|
|
48
51
|
/**
|
|
49
|
-
*
|
|
52
|
+
* Which of the three assignment shapes this step currently uses.
|
|
50
53
|
*
|
|
51
|
-
* Derived from the
|
|
52
|
-
*
|
|
53
|
-
* `agentName` and the validator would then reject a graph the form said was fine.
|
|
54
|
+
* Derived from the draft rather than stored separately: the node's own `kind` is the single
|
|
55
|
+
* source of truth, and a parallel field could disagree with it.
|
|
54
56
|
*/
|
|
57
|
+
get Assignment(): TaskGraphNodeType;
|
|
58
|
+
/**
|
|
59
|
+
* The chosen agent, read and written through the node's configuration.
|
|
60
|
+
*
|
|
61
|
+
* A template cannot narrow a discriminated union, so the two-way binding goes through here
|
|
62
|
+
* rather than at `Draft.configuration.agentName` — which would also be wrong the moment the
|
|
63
|
+
* draft is a different kind.
|
|
64
|
+
*/
|
|
65
|
+
get AgentName(): string;
|
|
66
|
+
set AgentName(value: string);
|
|
67
|
+
/** The chosen action. Same reasoning as {@link AgentName}. */
|
|
68
|
+
get ActionName(): string;
|
|
69
|
+
set ActionName(value: string);
|
|
70
|
+
/** True when this step waits on a person. */
|
|
55
71
|
get IsHumanTask(): boolean;
|
|
56
72
|
/** The edges into this task, so their conditions are editable where the step is. */
|
|
57
73
|
get IncomingEdges(): Array<{
|
|
@@ -59,13 +75,23 @@ export declare class TaskGraphPropertiesPanelComponent {
|
|
|
59
75
|
FromName: string;
|
|
60
76
|
Condition: string;
|
|
61
77
|
}>;
|
|
62
|
-
/**
|
|
63
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Switches the step between an agent, an action and a person.
|
|
80
|
+
*
|
|
81
|
+
* Replacing `kind` and `configuration` together is the whole operation now. Under the old flat
|
|
82
|
+
* shape this had to clear two sibling fields on every branch, and forgetting one produced an
|
|
83
|
+
* `AssignmentConflict` from a gesture that looked like a simple choice — a bug the union made
|
|
84
|
+
* unrepresentable rather than merely guarded.
|
|
85
|
+
*
|
|
86
|
+
* The previous name is carried over where it still applies, so toggling Agent → Person → Agent
|
|
87
|
+
* does not silently forget what the author had chosen.
|
|
88
|
+
*/
|
|
89
|
+
SetAssignment(kind: TaskGraphNodeType, name?: string): void;
|
|
64
90
|
/** Asks the parent to apply the draft. */
|
|
65
91
|
Commit(): void;
|
|
66
92
|
/** Asks the parent to change (or, with an empty string, clear) an edge's condition. */
|
|
67
93
|
CommitCondition(fromTempId: string, condition: string): void;
|
|
68
94
|
static ɵfac: i0.ɵɵFactoryDeclaration<TaskGraphPropertiesPanelComponent, never>;
|
|
69
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TaskGraphPropertiesPanelComponent, "mj-task-graph-properties", never, { "Task": { "alias": "Task"; "required": false; }; "Spec": { "alias": "Spec"; "required": false; }; "AvailableAgentNames": { "alias": "AvailableAgentNames"; "required": false; }; "ReadOnly": { "alias": "ReadOnly"; "required": false; }; }, { "TaskPropertyChangeRequested": "TaskPropertyChangeRequested"; "DependencyConditionChangeRequested": "DependencyConditionChangeRequested"; }, never, never, false, never>;
|
|
95
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TaskGraphPropertiesPanelComponent, "mj-task-graph-properties", never, { "Task": { "alias": "Task"; "required": false; }; "Spec": { "alias": "Spec"; "required": false; }; "AvailableAgentNames": { "alias": "AvailableAgentNames"; "required": false; }; "AvailableActionNames": { "alias": "AvailableActionNames"; "required": false; }; "ReadOnly": { "alias": "ReadOnly"; "required": false; }; }, { "TaskPropertyChangeRequested": "TaskPropertyChangeRequested"; "DependencyConditionChangeRequested": "DependencyConditionChangeRequested"; }, never, never, false, never>;
|
|
70
96
|
}
|
|
71
97
|
//# sourceMappingURL=task-graph-properties-panel.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-graph-properties-panel.component.d.ts","sourceRoot":"","sources":["../../src/lib/task-graph-properties-panel.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAa,YAAY,EAAiB,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"task-graph-properties-panel.component.d.ts","sourceRoot":"","sources":["../../src/lib/task-graph-properties-panel.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAa,YAAY,EAAiB,MAAM,eAAe,CAAC;AACvE,OAAO,EAAsB,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAqB,MAAM,8BAA8B,CAAC;AACjI,OAAO,EAA0D,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;;AAE7H,sFAAsF;AACtF,qBAAa,oCAAoC;aAEzB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,iBAAiB;gBADvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB;CAE9C;AAED,2DAA2D;AAC3D,qBAAa,2CAA2C;aAEhC,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;IAChC,8EAA8E;aAC9D,SAAS,EAAE,MAAM;gBAHjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;IAChC,8EAA8E;IAC9D,SAAS,EAAE,MAAM;CAExC;AAED,qBAMa,iCAAiC;IAC1C,6FAA6F;IAC7F,IACW,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAK9C;IACD,IAAW,IAAI,IAAI,iBAAiB,GAAG,IAAI,CAE1C;IAED,yEAAyE;IACzD,IAAI,EAAE,aAAa,GAAG,IAAI,CAAQ;IAElD,oGAAoG;IACpF,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAM;IAE5D,qGAAq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