@memberjunction/ng-task-graph-editor 0.0.0 → 6.1.0-edge.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/dist/lib/task-graph-canvas-adapter.d.ts +195 -0
- package/dist/lib/task-graph-canvas-adapter.d.ts.map +1 -0
- package/dist/lib/task-graph-canvas-adapter.js +380 -0
- package/dist/lib/task-graph-canvas-adapter.js.map +1 -0
- package/dist/lib/task-graph-editor-events.d.ts +137 -0
- package/dist/lib/task-graph-editor-events.d.ts.map +1 -0
- package/dist/lib/task-graph-editor-events.js +180 -0
- package/dist/lib/task-graph-editor-events.js.map +1 -0
- package/dist/lib/task-graph-editor.component.d.ts +230 -0
- package/dist/lib/task-graph-editor.component.d.ts.map +1 -0
- package/dist/lib/task-graph-editor.component.js +597 -0
- package/dist/lib/task-graph-editor.component.js.map +1 -0
- package/dist/lib/task-graph-editor.module.d.ts +14 -0
- package/dist/lib/task-graph-editor.module.d.ts.map +1 -0
- package/dist/lib/task-graph-editor.module.js +24 -0
- package/dist/lib/task-graph-editor.module.js.map +1 -0
- package/dist/lib/task-graph-properties-panel.component.d.ts +97 -0
- package/dist/lib/task-graph-properties-panel.component.d.ts.map +1 -0
- package/dist/lib/task-graph-properties-panel.component.js +357 -0
- package/dist/lib/task-graph-properties-panel.component.js.map +1 -0
- 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/lib/task-graph-runtime-source.d.ts +55 -0
- package/dist/lib/task-graph-runtime-source.d.ts.map +1 -0
- package/dist/lib/task-graph-runtime-source.js +66 -0
- package/dist/lib/task-graph-runtime-source.js.map +1 -0
- package/dist/public-api.d.ts +8 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +16 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +53 -7
- package/README.md +0 -45
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-graph-canvas-adapter.js","sourceRoot":"","sources":["../../src/lib/task-graph-canvas-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACH,QAAQ,EACR,mBAAmB,EACnB,QAAQ,GAKX,MAAM,8BAA8B,CAAC;AA6BtC;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAyB;IAC1D,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,WAAW,CAAC;AACjF,CAAC;AAKD,MAAM,gBAAgB,GAAuC;IACzD,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC7D,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;CACrE,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAuC;IACrE;QACI,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE,gBAAgB;KACjC;IACD;QACI,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE,gBAAgB;KACjC;IACD;QACI,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE,gBAAgB;KACjC;CACJ,CAAC;AAEF;;;;;G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ED,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,IAAmB,EAAE,MAAM,GAAG,MAAM;IAC3D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC;QAAE,CAAC,EAAE,CAAC;IACvC,OAAO,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * @fileoverview Projects a `TaskGraphSpec` onto the generic canvas shapes, and back.\n *\n * **Kept pure and separate from the component on purpose.** Everything interesting about rendering a\n * task graph — which node is an entry point, which edge is conditional, how a runtime status maps to\n * a visual one, whether removing a node orphans an edge — is decidable from data alone. Putting it\n * in a component would make it reachable only through a TestBed, and the resulting tests would be\n * about Angular rather than about graphs.\n *\n * **The direction flip, again.** A `TaskGraphSpec` edge points *backwards* (`dependsOn`: \"I wait for\n * X\"); a canvas connection points *forwards* (source → target). Same edge, opposite authoring\n * convention — the graph is written by whoever knows the prerequisites, the canvas drawn by whoever\n * follows the arrows. This is the second place in the program that inversion appears (Save as\n * Workflow is the first), which is why it is stated rather than left implicit.\n *\n * @module @memberjunction/ng-task-graph-editor\n */\nimport {\n ConfigOf,\n NormalizeDependency,\n TaskNode,\n type TaskNodeBase,\n type TaskGraphSpec,\n type TaskGraphSpecNode,\n type TaskGraphDependency,\n} from '@memberjunction/ai-core-plus';\nimport type { FlowConnection, FlowNode, FlowNodeStatus, FlowNodeTypeConfig, FlowPosition } from '@memberjunction/ng-flow-editor';\n\n/**\n * The shapes this canvas can DRAW.\n *\n * Three of the spec's seven `kind`s, and the choice is the canvas's: these are the shapes a person\n * authors. `Prompt`, `ForEach`, `While` and `External` are expressible in the spec but have no\n * authoring affordance here — a palette entry that cannot be configured would be worse than none.\n *\n * **Drawing and RENDERING are different questions**, which this type used to conflate. A run's\n * graph is displayed on the same canvas, and it contains kinds nobody can draw — so mapping them\n * all to `AgentTask` made a fully-configured ForEach render as \"AGENT STEP · No agent chosen yet\",\n * which is not merely imprecise: it says the step is broken. See {@link TaskGraphRenderType}.\n */\nexport type TaskGraphNodeType = 'AgentTask' | 'ActionTask' | 'HumanTask';\n\n/**\n * The shapes this canvas can SHOW — a superset of what it can draw.\n *\n * Display-only kinds exist because a task graph is rendered in two places: the editor, where a\n * person builds one, and a run view, where one that already ran is shown. The second must be able\n * to depict every kind the dispatcher can execute, whether or not the palette offers it.\n */\nexport type TaskGraphRenderType = TaskGraphNodeType | 'PromptTask' | 'ForEachTask' | 'WhileTask' | 'ExternalTask';\n\n/** A palette entry, pinned to one of the three authorable shapes. */\nexport type TaskGraphNodeTypeConfig = FlowNodeTypeConfig & { Type: TaskGraphNodeType };\n\n/**\n * Whether a shape is one a person can actually author here.\n *\n * The authoring paths — the palette, `NewTaskFromNodeType`, the properties panel — only handle the\n * three drawable shapes. Rendering handles more. This is the seam between the two, stated as a type\n * guard so the compiler enforces it rather than a cast pretending the distinction does not exist.\n */\nexport function IsAuthorableNodeType(type: TaskGraphRenderType): type is TaskGraphNodeType {\n return type === 'AgentTask' || type === 'ActionTask' || type === 'HumanTask';\n}\n\n/** A rendering entry — every shape the canvas can depict, authorable or not. */\nexport type TaskGraphRenderTypeConfig = FlowNodeTypeConfig & { Type: TaskGraphRenderType };\n\nconst TASK_GRAPH_PORTS: FlowNodeTypeConfig['DefaultPorts'] = [\n { ID: 'in', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'out', Direction: 'output', Side: 'bottom', Multiple: true },\n];\n\n/** What the palette offers — one entry per assignment shape the spec supports. */\nexport const TASK_GRAPH_NODE_TYPES: readonly TaskGraphNodeTypeConfig[] = [\n {\n Type: 'AgentTask',\n Label: 'Agent Step',\n Icon: 'fa-robot',\n Color: '#4A6FA5',\n Category: 'Steps',\n DefaultPorts: TASK_GRAPH_PORTS,\n },\n {\n Type: 'ActionTask',\n Label: 'Action Step',\n Icon: 'fa-bolt',\n Color: '#3B82F6',\n Category: 'Steps',\n DefaultPorts: TASK_GRAPH_PORTS,\n },\n {\n Type: 'HumanTask',\n Label: 'Person Step',\n Icon: 'fa-user-check',\n Color: '#7B1FA2',\n Category: 'Steps',\n DefaultPorts: TASK_GRAPH_PORTS,\n },\n];\n\n/**\n * Everything the canvas can DEPICT: the palette, plus the kinds that only ever arrive from a run.\n *\n * Deliberately a superset rather than an extension of the palette — adding these to\n * `TASK_GRAPH_NODE_TYPES` would put un-configurable entries in the authoring toolbox.\n */\nexport const TASK_GRAPH_RENDER_TYPES: readonly TaskGraphRenderTypeConfig[] = [\n ...TASK_GRAPH_NODE_TYPES,\n { Type: 'PromptTask', Label: 'Prompt Step', Icon: 'fa-comment-dots', Color: '#8B5CF6', Category: 'Steps', DefaultPorts: TASK_GRAPH_PORTS },\n { Type: 'ForEachTask', Label: 'For Each Step', Icon: 'fa-repeat', Color: '#D97706', Category: 'Steps', DefaultPorts: TASK_GRAPH_PORTS },\n { Type: 'WhileTask', Label: 'While Step', Icon: 'fa-rotate', Color: '#D97706', Category: 'Steps', DefaultPorts: TASK_GRAPH_PORTS },\n { Type: 'ExternalTask', Label: 'External Step', Icon: 'fa-arrow-up-right-from-square', Color: '#0891B2', Category: 'Steps', DefaultPorts: TASK_GRAPH_PORTS },\n];\n\n/**\n * The config for a node type, or null when the type is not one of ours.\n *\n * Searches the RENDER set, so a run's ForEach resolves to its own icon and label instead of\n * silently falling back to the agent shape.\n */\nexport function GetNodeTypeConfig(type: string): TaskGraphRenderTypeConfig | null {\n return TASK_GRAPH_RENDER_TYPES.find((c) => c.Type === type) ?? null;\n}\n\n/** Live per-task state for the runtime overlay, keyed by `tempId`. */\nexport type TaskGraphRuntimeStatus = Record<string, TaskGraphRuntimeState>;\n\n/** What a task is doing right now, in the durable engine's own vocabulary. */\nexport type TaskGraphRuntimeState =\n | 'Pending'\n | 'In Progress'\n | 'Complete'\n | 'Failed'\n | 'Blocked'\n | 'Cancelled'\n | 'Deferred';\n\n/**\n * Maps a durable task state onto the canvas's visual vocabulary.\n *\n * Two mappings are worth explaining. `Blocked` renders as a **warning**, not an error: nothing went\n * wrong, the graph simply cannot reach it — showing it as a failure would send someone hunting for a\n * bug that does not exist. `Deferred` renders as `pending` because, to the person watching, waiting\n * on a schedule and waiting on a prerequisite look and mean the same thing.\n */\nexport function RuntimeStateToNodeStatus(state: TaskGraphRuntimeState | undefined): FlowNodeStatus {\n switch (state) {\n case 'In Progress': return 'running';\n case 'Complete': return 'success';\n case 'Failed': return 'error';\n case 'Blocked': return 'warning';\n case 'Cancelled': return 'disabled';\n case 'Deferred': return 'pending';\n case 'Pending': return 'pending';\n default: return 'default';\n }\n}\n\n/**\n * True when the node is a person's step.\n *\n * One field decides it now: spec v2 gives every node exactly one `kind`, so \"is this a person's\n * step\" stopped being an inference over three optional flags and became a comparison.\n */\nexport function IsHumanTask(node: TaskGraphSpecNode): boolean {\n return node.kind === 'Human';\n}\n\n/**\n * Which of the three shapes a node is, for rendering.\n *\n * An unassigned node (just added, nothing picked yet) reads as an agent step: it is the commonest\n * intent, and the validator is already telling the author, in words, that it needs an assignee.\n * Guessing \"person\" instead — which is what the old `!agentName` rule did — put a step in the\n * graph that claimed to be waiting on someone when nobody had said so.\n */\nexport function GetTaskNodeType(node: TaskGraphSpecNode): TaskGraphRenderType {\n switch (node.kind) {\n case 'Human': return 'HumanTask';\n case 'Action': return 'ActionTask';\n case 'Prompt': return 'PromptTask';\n case 'ForEach': return 'ForEachTask';\n case 'While': return 'WhileTask';\n case 'External': return 'ExternalTask';\n // An unassigned node — just added, nothing picked — reads as an agent step: the commonest\n // intent, and the validator is already saying in words that it needs an assignee.\n default: return 'AgentTask';\n }\n}\n\n/**\n * Builds the task a palette entry stands for.\n *\n * Pure, and here rather than in the component, because \"what does clicking *Person Step* actually\n * put in the graph\" is a fact about the spec — testable without a TestBed, and the one place the\n * assignment xor is honoured on creation.\n *\n * `defaultAgentName` / `defaultActionName` are what the host has to offer. When it has nothing, the\n * step is created unassigned on purpose: inventing an agent name that may not exist would produce a\n * graph that passes the canvas and fails at submission, whereas an unassigned step is reported\n * immediately by the same validator the engine runs.\n */\nexport function NewTaskFromNodeType(\n spec: TaskGraphSpec,\n type: TaskGraphNodeType,\n defaults: { agentName?: string; actionName?: string } = {},\n): TaskGraphSpecNode {\n const base: TaskNodeBase = {\n tempId: NextTempId(spec),\n name: NEW_TASK_NAMES[type],\n description: '',\n dependsOn: [],\n };\n switch (type) {\n case 'HumanTask': return TaskNode.Human(base);\n // A step created before the host has any names to offer is created with an empty one on\n // purpose: the validator reports it immediately, whereas inventing a name would produce a\n // graph that passes here and fails at submission.\n case 'ActionTask': return TaskNode.Action(base, { actionName: defaults.actionName ?? '' });\n default: return TaskNode.Agent(base, { agentName: defaults.agentName ?? '' });\n }\n}\n\n/** Default step names, so a new box says what it is before the author renames it. */\nconst NEW_TASK_NAMES: Record<TaskGraphNodeType, string> = {\n AgentTask: 'New agent step',\n ActionTask: 'New action step',\n HumanTask: 'New person step',\n};\n\n/** Entry points: nodes nothing else has to finish first. Same rule the traversal engine uses. */\nexport function GetEntryTempIds(spec: TaskGraphSpec): string[] {\n return (spec.tasks ?? []).filter((t) => (t.dependsOn ?? []).length === 0).map((t) => t.tempId);\n}\n\n/** Every dependency of a node, in normalized object form. */\nexport function GetDependencies(node: TaskGraphSpecNode): TaskGraphDependency[] {\n return (node.dependsOn ?? []).map(NormalizeDependency);\n}\n\n/** The `tempId`s that depend on `tempId` — i.e. what breaks if it is removed. */\nexport function GetDependents(spec: TaskGraphSpec, tempId: string): string[] {\n return (spec.tasks ?? [])\n .filter((t) => GetDependencies(t).some((d) => d.tempId === tempId))\n .map((t) => t.tempId);\n}\n\n/** Deterministic id for a canvas edge, so re-renders don't churn selection. */\nfunction edgeId(fromTempId: string, toTempId: string): string {\n return `${fromTempId}->${toTempId}`;\n}\n\n/**\n * Projects the spec onto canvas nodes.\n *\n * Positions are left at the origin: layout is the canvas's job (Dagre), and a spec carries no\n * geometry precisely because a task graph is a *logical* structure. An agent that emitted one never\n * had an opinion about where the boxes go.\n */\n/**\n * Projects the spec onto canvas nodes.\n *\n * `positions` carries geometry the spec cannot hold. `TaskGraphSpec` is an execution contract with\n * no layout field, so without a caller-held map every re-projection would return every node to the\n * origin — which is what previously forced a full re-arrange (and a viewport re-zoom) after every\n * single edit. Unknown ids fall back to the origin, which is also the correct starting state for a\n * graph that has never been laid out.\n */\nexport function SpecToNodes(\n spec: TaskGraphSpec,\n runtime?: TaskGraphRuntimeStatus,\n positions?: ReadonlyMap<string, FlowPosition>,\n): FlowNode[] {\n const entryIds = new Set(GetEntryTempIds(spec));\n\n return (spec.tasks ?? []).map((task) => {\n const type = GetTaskNodeType(task);\n const known = positions?.get(task.tempId);\n return {\n ID: task.tempId,\n Type: type,\n Label: task.name,\n Subtitle: TaskSubtitle(task, type),\n Icon: GetNodeTypeConfig(type)?.Icon ?? 'fa-circle-nodes',\n Status: RuntimeStateToNodeStatus(runtime?.[task.tempId]),\n StatusMessage: task.description,\n IsStartNode: entryIds.has(task.tempId),\n Position: known ? { ...known } : { X: 0, Y: 0 },\n Ports: [\n { ID: 'in', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'out', Direction: 'output', Side: 'bottom', Multiple: true },\n ],\n Data: { TempId: task.tempId },\n };\n });\n}\n\n/**\n * The one line under a node's name: who or what runs it.\n *\n * An unassigned step says so rather than showing nothing — a blank subtitle looks like a step that\n * is fine, and this one is the reason the validation banner is complaining.\n */\nexport function TaskSubtitle(task: TaskGraphSpecNode, type: TaskGraphRenderType = GetTaskNodeType(task)): string {\n switch (type) {\n case 'HumanTask': return 'Waiting on a person';\n case 'ActionTask': return ConfigOf(task, 'Action')?.actionName || 'No action chosen yet';\n case 'PromptTask': return ConfigOf(task, 'Prompt')?.promptName || 'No prompt chosen yet';\n // A loop's subtitle is what it REPEATS — the one fact that makes the node readable.\n case 'ForEachTask': return LoopBodyLabel(ConfigOf(task, 'ForEach')) ?? 'Repeats for each item';\n case 'WhileTask': return LoopBodyLabel(ConfigOf(task, 'While')) ?? 'Repeats until its condition is false';\n case 'ExternalTask': return ConfigOf(task, 'External')?.domain || 'Completed by an outside system';\n // Only a genuinely unassigned node reaches this now. It used to catch Prompt, ForEach,\n // While and External too — so a fully-configured loop displayed \"No agent chosen yet\",\n // which reads as a broken step rather than an unrecognised one.\n default: return ConfigOf(task, 'Agent')?.agentName || 'No agent chosen yet';\n }\n}\n\n/** What a loop repeats, when it says. */\nfunction LoopBodyLabel(\n op: { action?: { name: string }; subAgent?: { name: string }; prompt?: { name: string } } | null | undefined,\n): string | null {\n if (!op) return null;\n const body = op.action?.name ?? op.subAgent?.name ?? op.prompt?.name;\n return body ? `Repeats: ${body}` : null;\n}\n\n/**\n * Projects the spec's dependencies onto canvas connections, reversing their direction.\n *\n * A conditional edge is drawn dashed and labeled with its condition, because the difference between\n * \"always\" and \"only sometimes\" is the single most consequential thing about an edge and the one a\n * reader is most likely to miss when scanning a diagram.\n *\n * Edges naming a task that is not in the graph are skipped rather than drawn dangling — the\n * validator reports them as `UnknownDependency`, and rendering a connection to nowhere would be a\n * second, worse way of saying the same thing.\n */\nexport function SpecToConnections(spec: TaskGraphSpec): FlowConnection[] {\n const known = new Set((spec.tasks ?? []).map((t) => t.tempId));\n const connections: FlowConnection[] = [];\n\n for (const task of spec.tasks ?? []) {\n for (const dep of GetDependencies(task)) {\n if (!known.has(dep.tempId)) continue;\n\n const conditional = !!dep.condition?.trim();\n connections.push({\n ID: edgeId(dep.tempId, task.tempId),\n // Reversed: dependsOn points back at the prerequisite, the drawn arrow points forward.\n SourceNodeID: dep.tempId,\n SourcePortID: 'out',\n TargetNodeID: task.tempId,\n TargetPortID: 'in',\n Label: conditional ? 'if' : undefined,\n LabelDetail: dep.condition ?? undefined,\n LabelIcon: conditional ? 'fa-code-branch' : undefined,\n Condition: dep.condition ?? undefined,\n Style: conditional ? 'dashed' : 'solid',\n Data: { FromTempId: dep.tempId, ToTempId: task.tempId },\n });\n }\n }\n return connections;\n}\n\n/**\n * Adds a dependency to the spec, returning a NEW spec.\n *\n * Immutable because the component emits the result to a host that may keep it, diff it, or reject\n * it; mutating the input would let a canceled edit leak into the host's copy anyway. A duplicate\n * edge is a no-op rather than an error — dragging the same connection twice is a slip, not a\n * request to corrupt the graph.\n */\nexport function AddDependency(spec: TaskGraphSpec, fromTempId: string, toTempId: string, condition?: string): TaskGraphSpec {\n return {\n ...spec,\n tasks: (spec.tasks ?? []).map((task) => {\n if (task.tempId !== toTempId) return task;\n const existing = GetDependencies(task);\n if (existing.some((d) => d.tempId === fromTempId)) return task;\n const next: TaskGraphDependency | string = condition?.trim()\n ? { tempId: fromTempId, condition }\n : fromTempId;\n return { ...task, dependsOn: [...(task.dependsOn ?? []), next] };\n }),\n };\n}\n\n/** Removes a dependency, returning a NEW spec. */\nexport function RemoveDependency(spec: TaskGraphSpec, fromTempId: string, toTempId: string): TaskGraphSpec {\n return {\n ...spec,\n tasks: (spec.tasks ?? []).map((task) =>\n task.tempId !== toTempId\n ? task\n : { ...task, dependsOn: (task.dependsOn ?? []).filter((d) => NormalizeDependency(d).tempId !== fromTempId) },\n ),\n };\n}\n\n/**\n * Removes a task AND every edge into it, returning a NEW spec.\n *\n * Severing the inbound edges is not a convenience — leaving them would produce a graph whose\n * `dependsOn` names a task that no longer exists, which the validator rejects as\n * `UnknownDependency`. Deleting a box on a canvas should not make the graph invalid.\n */\nexport function RemoveTask(spec: TaskGraphSpec, tempId: string): TaskGraphSpec {\n return {\n ...spec,\n tasks: (spec.tasks ?? [])\n .filter((t) => t.tempId !== tempId)\n .map((t) => ({ ...t, dependsOn: (t.dependsOn ?? []).filter((d) => NormalizeDependency(d).tempId !== tempId) })),\n };\n}\n\n/** Adds a task, returning a NEW spec. */\nexport function AddTask(spec: TaskGraphSpec, task: TaskGraphSpecNode): TaskGraphSpec {\n return { ...spec, tasks: [...(spec.tasks ?? []), task] };\n}\n\n/** Replaces a task in place by `tempId`, returning a NEW spec. */\nexport function UpdateTask(spec: TaskGraphSpec, tempId: string, next: TaskGraphSpecNode): TaskGraphSpec {\n return { ...spec, tasks: (spec.tasks ?? []).map((t) => (t.tempId === tempId ? next : t)) };\n}\n\n/**\n * Would adding `from → to` create a cycle?\n *\n * Answered before the edge exists, so the canvas can refuse it rather than create an invalid graph\n * and report it afterwards. A self-edge is the degenerate case and is caught first.\n *\n * Iterative rather than recursive: the graph may come from an LLM, and a deeply-chained spec should\n * produce a refusal, not a stack overflow.\n */\nexport function WouldCreateCycle(spec: TaskGraphSpec, fromTempId: string, toTempId: string): boolean {\n if (fromTempId === toTempId) return true;\n\n // A cycle appears iff `from` is already reachable from `to` by following dependsOn edges —\n // i.e. `to` already (transitively) waits on `from`.\n const dependenciesOf = new Map<string, string[]>(\n (spec.tasks ?? []).map((t) => [t.tempId, GetDependencies(t).map((d) => d.tempId)]),\n );\n\n const stack = [...(dependenciesOf.get(fromTempId) ?? [])];\n const seen = new Set<string>();\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (current === toTempId) return true;\n if (seen.has(current)) continue;\n seen.add(current);\n stack.push(...(dependenciesOf.get(current) ?? []));\n }\n return false;\n}\n\n/** A unique `tempId` for a newly added task, stable and readable. */\nexport function NextTempId(spec: TaskGraphSpec, prefix = 'task'): string {\n const taken = new Set((spec.tasks ?? []).map((t) => t.tempId));\n let n = (spec.tasks ?? []).length + 1;\n while (taken.has(`${prefix}${n}`)) n++;\n return `${prefix}${n}`;\n}\n"]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The component's upward contract.
|
|
3
|
+
*
|
|
4
|
+
* Follows MJ's `Before*` / `After*` cancelable pattern (see `guides/UI_LAYERING_GUIDE.md` §6),
|
|
5
|
+
* already used by `ng-base-forms`, `ng-trees`, `ng-entity-viewer` and `ng-conversations`.
|
|
6
|
+
*
|
|
7
|
+
* **Why the args are classes and not payload interfaces.** `Cancel` has to travel *back*. Angular's
|
|
8
|
+
* `EventEmitter` is synchronous for synchronous listeners, so the emitting component reads the
|
|
9
|
+
* mutated object after `.emit()` returns — that is the entire veto mechanism. A frozen payload
|
|
10
|
+
* cannot carry a veto, and a class additionally gives one place for defaults and future fields.
|
|
11
|
+
*
|
|
12
|
+
* **A `Before*` handler must not be `async`.** An `await` inside it returns control to the emitter
|
|
13
|
+
* before the handler sets `Cancel`, so the veto silently does nothing. Where a host genuinely needs
|
|
14
|
+
* to await — a confirmation dialog — the component exposes the action as a public method the host
|
|
15
|
+
* calls *after* its own await, rather than pretending the veto is asynchronous.
|
|
16
|
+
*
|
|
17
|
+
* @module @memberjunction/ng-task-graph-editor
|
|
18
|
+
*/
|
|
19
|
+
import type { TaskGraphSpec, TaskGraphSpecNode, TaskGraphValidationError } from '@memberjunction/ai-core-plus';
|
|
20
|
+
/**
|
|
21
|
+
* Base for every cancelable graph event.
|
|
22
|
+
*
|
|
23
|
+
* A listener flips `Cancel = true` to halt the default behavior; the matching `After*` event will
|
|
24
|
+
* then **not** fire. That is a contract hosts rely on, not a suggestion.
|
|
25
|
+
*/
|
|
26
|
+
export declare class CancellableTaskGraphEventArgs {
|
|
27
|
+
Cancel: boolean;
|
|
28
|
+
CancelReason?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Fired BEFORE a task is added. Cancel to block it (e.g. the host caps graph size). */
|
|
31
|
+
export declare class BeforeTaskAddedEventArgs extends CancellableTaskGraphEventArgs {
|
|
32
|
+
readonly Task: TaskGraphSpecNode;
|
|
33
|
+
constructor(Task: TaskGraphSpecNode);
|
|
34
|
+
}
|
|
35
|
+
/** Fired AFTER a task was added. NOT fired when the Before was canceled. */
|
|
36
|
+
export declare class AfterTaskAddedEventArgs {
|
|
37
|
+
readonly Task: TaskGraphSpecNode;
|
|
38
|
+
readonly Spec: TaskGraphSpec;
|
|
39
|
+
constructor(Task: TaskGraphSpecNode, Spec: TaskGraphSpec);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Fired BEFORE a task is removed. Cancel to block it.
|
|
43
|
+
*
|
|
44
|
+
* `DependentTempIds` is supplied because removing a node also severs every edge into it, and a host
|
|
45
|
+
* deciding whether to veto needs to know the blast radius — not just which node was clicked.
|
|
46
|
+
*/
|
|
47
|
+
export declare class BeforeTaskRemovedEventArgs extends CancellableTaskGraphEventArgs {
|
|
48
|
+
readonly Task: TaskGraphSpecNode;
|
|
49
|
+
readonly DependentTempIds: readonly string[];
|
|
50
|
+
constructor(Task: TaskGraphSpecNode, DependentTempIds: readonly string[]);
|
|
51
|
+
}
|
|
52
|
+
/** Fired AFTER a task was removed. NOT fired when the Before was canceled. */
|
|
53
|
+
export declare class AfterTaskRemovedEventArgs {
|
|
54
|
+
readonly Task: TaskGraphSpecNode;
|
|
55
|
+
readonly Spec: TaskGraphSpec;
|
|
56
|
+
constructor(Task: TaskGraphSpecNode, Spec: TaskGraphSpec);
|
|
57
|
+
}
|
|
58
|
+
/** Fired BEFORE a task's properties change. Cancel to block the edit. */
|
|
59
|
+
export declare class BeforeTaskUpdatedEventArgs extends CancellableTaskGraphEventArgs {
|
|
60
|
+
readonly Previous: TaskGraphSpecNode;
|
|
61
|
+
readonly Next: TaskGraphSpecNode;
|
|
62
|
+
constructor(Previous: TaskGraphSpecNode, Next: TaskGraphSpecNode);
|
|
63
|
+
}
|
|
64
|
+
/** Fired AFTER a task's properties changed. NOT fired when the Before was canceled. */
|
|
65
|
+
export declare class AfterTaskUpdatedEventArgs {
|
|
66
|
+
readonly Task: TaskGraphSpecNode;
|
|
67
|
+
readonly Spec: TaskGraphSpec;
|
|
68
|
+
constructor(Task: TaskGraphSpecNode, Spec: TaskGraphSpec);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Fired BEFORE a dependency edge is created. Cancel to block it.
|
|
72
|
+
*
|
|
73
|
+
* `WouldCreateCycle` is computed before emitting so a host can veto on that alone without
|
|
74
|
+
* re-deriving it. The component refuses a cycle regardless — the flag exists so the host can
|
|
75
|
+
* explain *why* rather than watch an edge silently fail to appear.
|
|
76
|
+
*/
|
|
77
|
+
export declare class BeforeDependencyAddedEventArgs extends CancellableTaskGraphEventArgs {
|
|
78
|
+
readonly FromTempId: string;
|
|
79
|
+
readonly ToTempId: string;
|
|
80
|
+
readonly WouldCreateCycle: boolean;
|
|
81
|
+
constructor(FromTempId: string, ToTempId: string, WouldCreateCycle: boolean);
|
|
82
|
+
}
|
|
83
|
+
/** Fired AFTER a dependency edge was created. NOT fired when the Before was canceled. */
|
|
84
|
+
export declare class AfterDependencyAddedEventArgs {
|
|
85
|
+
readonly FromTempId: string;
|
|
86
|
+
readonly ToTempId: string;
|
|
87
|
+
readonly Spec: TaskGraphSpec;
|
|
88
|
+
constructor(FromTempId: string, ToTempId: string, Spec: TaskGraphSpec);
|
|
89
|
+
}
|
|
90
|
+
/** Fired BEFORE a dependency edge is removed. Cancel to block it. */
|
|
91
|
+
export declare class BeforeDependencyRemovedEventArgs extends CancellableTaskGraphEventArgs {
|
|
92
|
+
readonly FromTempId: string;
|
|
93
|
+
readonly ToTempId: string;
|
|
94
|
+
constructor(FromTempId: string, ToTempId: string);
|
|
95
|
+
}
|
|
96
|
+
/** Fired AFTER a dependency edge was removed. NOT fired when the Before was canceled. */
|
|
97
|
+
export declare class AfterDependencyRemovedEventArgs {
|
|
98
|
+
readonly FromTempId: string;
|
|
99
|
+
readonly ToTempId: string;
|
|
100
|
+
readonly Spec: TaskGraphSpec;
|
|
101
|
+
constructor(FromTempId: string, ToTempId: string, Spec: TaskGraphSpec);
|
|
102
|
+
}
|
|
103
|
+
/** The spec changed for any reason. Hosts persist from here. */
|
|
104
|
+
export declare class TaskGraphSpecChangedEventArgs {
|
|
105
|
+
readonly Spec: TaskGraphSpec;
|
|
106
|
+
readonly Reason: 'TaskAdded' | 'TaskRemoved' | 'TaskUpdated' | 'DependencyAdded' | 'DependencyRemoved' | 'LayoutApplied';
|
|
107
|
+
constructor(Spec: TaskGraphSpec, Reason: 'TaskAdded' | 'TaskRemoved' | 'TaskUpdated' | 'DependencyAdded' | 'DependencyRemoved' | 'LayoutApplied');
|
|
108
|
+
}
|
|
109
|
+
/** Selection changed. `Task` is null when the selection was cleared. */
|
|
110
|
+
export declare class TaskGraphSelectionChangedEventArgs {
|
|
111
|
+
readonly Task: TaskGraphSpecNode | null;
|
|
112
|
+
constructor(Task: TaskGraphSpecNode | null);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validation ran.
|
|
116
|
+
*
|
|
117
|
+
* Errors come from the engine's own `ValidateTaskGraphSpec`, not from a second implementation here —
|
|
118
|
+
* so a graph that looks valid on the canvas cannot fail a different check at submission.
|
|
119
|
+
*/
|
|
120
|
+
export declare class TaskGraphValidationChangedEventArgs {
|
|
121
|
+
readonly Valid: boolean;
|
|
122
|
+
readonly Errors: readonly TaskGraphValidationError[];
|
|
123
|
+
constructor(Valid: boolean, Errors: readonly TaskGraphValidationError[]);
|
|
124
|
+
}
|
|
125
|
+
/** The user asked to open the agent behind a task. The host navigates. */
|
|
126
|
+
export declare class AgentOpenRequestedEventArgs {
|
|
127
|
+
readonly AgentName: string;
|
|
128
|
+
readonly Task: TaskGraphSpecNode;
|
|
129
|
+
constructor(AgentName: string, Task: TaskGraphSpecNode);
|
|
130
|
+
}
|
|
131
|
+
/** The user asked to open a record referenced by the graph. The host navigates. */
|
|
132
|
+
export declare class RecordOpenRequestedEventArgs {
|
|
133
|
+
readonly EntityName: string;
|
|
134
|
+
readonly RecordID: string;
|
|
135
|
+
constructor(EntityName: string, RecordID: string);
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=task-graph-editor-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-graph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AK,EAAE,OAAO,EACd,MAAM,EAAE,SAAS,wBAAwB,EAAE;CAElE;AAOD,0EAA0E;AAC1E,qBAAa,2BAA2B;aAEhB,SAAS,EAAE,MAAM;aACjB,IAAI,EAAE,iBAAiB;gBADvB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,iBAAiB;CAE9C;AAED,mFAAmF;AACnF,qBAAa,4BAA4B;aAEjB,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;gBADhB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;CAEvC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base for every cancelable graph event.
|
|
3
|
+
*
|
|
4
|
+
* A listener flips `Cancel = true` to halt the default behavior; the matching `After*` event will
|
|
5
|
+
* then **not** fire. That is a contract hosts rely on, not a suggestion.
|
|
6
|
+
*/
|
|
7
|
+
export class CancellableTaskGraphEventArgs {
|
|
8
|
+
Cancel = false;
|
|
9
|
+
CancelReason;
|
|
10
|
+
}
|
|
11
|
+
// ── Node lifecycle ───────────────────────────────────────────────────────────
|
|
12
|
+
/** Fired BEFORE a task is added. Cancel to block it (e.g. the host caps graph size). */
|
|
13
|
+
export class BeforeTaskAddedEventArgs extends CancellableTaskGraphEventArgs {
|
|
14
|
+
Task;
|
|
15
|
+
constructor(Task) {
|
|
16
|
+
super();
|
|
17
|
+
this.Task = Task;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Fired AFTER a task was added. NOT fired when the Before was canceled. */
|
|
21
|
+
export class AfterTaskAddedEventArgs {
|
|
22
|
+
Task;
|
|
23
|
+
Spec;
|
|
24
|
+
constructor(Task, Spec) {
|
|
25
|
+
this.Task = Task;
|
|
26
|
+
this.Spec = Spec;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Fired BEFORE a task is removed. Cancel to block it.
|
|
31
|
+
*
|
|
32
|
+
* `DependentTempIds` is supplied because removing a node also severs every edge into it, and a host
|
|
33
|
+
* deciding whether to veto needs to know the blast radius — not just which node was clicked.
|
|
34
|
+
*/
|
|
35
|
+
export class BeforeTaskRemovedEventArgs extends CancellableTaskGraphEventArgs {
|
|
36
|
+
Task;
|
|
37
|
+
DependentTempIds;
|
|
38
|
+
constructor(Task, DependentTempIds) {
|
|
39
|
+
super();
|
|
40
|
+
this.Task = Task;
|
|
41
|
+
this.DependentTempIds = DependentTempIds;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Fired AFTER a task was removed. NOT fired when the Before was canceled. */
|
|
45
|
+
export class AfterTaskRemovedEventArgs {
|
|
46
|
+
Task;
|
|
47
|
+
Spec;
|
|
48
|
+
constructor(Task, Spec) {
|
|
49
|
+
this.Task = Task;
|
|
50
|
+
this.Spec = Spec;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Fired BEFORE a task's properties change. Cancel to block the edit. */
|
|
54
|
+
export class BeforeTaskUpdatedEventArgs extends CancellableTaskGraphEventArgs {
|
|
55
|
+
Previous;
|
|
56
|
+
Next;
|
|
57
|
+
constructor(Previous, Next) {
|
|
58
|
+
super();
|
|
59
|
+
this.Previous = Previous;
|
|
60
|
+
this.Next = Next;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Fired AFTER a task's properties changed. NOT fired when the Before was canceled. */
|
|
64
|
+
export class AfterTaskUpdatedEventArgs {
|
|
65
|
+
Task;
|
|
66
|
+
Spec;
|
|
67
|
+
constructor(Task, Spec) {
|
|
68
|
+
this.Task = Task;
|
|
69
|
+
this.Spec = Spec;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// ── Edge lifecycle ───────────────────────────────────────────────────────────
|
|
73
|
+
/**
|
|
74
|
+
* Fired BEFORE a dependency edge is created. Cancel to block it.
|
|
75
|
+
*
|
|
76
|
+
* `WouldCreateCycle` is computed before emitting so a host can veto on that alone without
|
|
77
|
+
* re-deriving it. The component refuses a cycle regardless — the flag exists so the host can
|
|
78
|
+
* explain *why* rather than watch an edge silently fail to appear.
|
|
79
|
+
*/
|
|
80
|
+
export class BeforeDependencyAddedEventArgs extends CancellableTaskGraphEventArgs {
|
|
81
|
+
FromTempId;
|
|
82
|
+
ToTempId;
|
|
83
|
+
WouldCreateCycle;
|
|
84
|
+
constructor(FromTempId, ToTempId, WouldCreateCycle) {
|
|
85
|
+
super();
|
|
86
|
+
this.FromTempId = FromTempId;
|
|
87
|
+
this.ToTempId = ToTempId;
|
|
88
|
+
this.WouldCreateCycle = WouldCreateCycle;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Fired AFTER a dependency edge was created. NOT fired when the Before was canceled. */
|
|
92
|
+
export class AfterDependencyAddedEventArgs {
|
|
93
|
+
FromTempId;
|
|
94
|
+
ToTempId;
|
|
95
|
+
Spec;
|
|
96
|
+
constructor(FromTempId, ToTempId, Spec) {
|
|
97
|
+
this.FromTempId = FromTempId;
|
|
98
|
+
this.ToTempId = ToTempId;
|
|
99
|
+
this.Spec = Spec;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Fired BEFORE a dependency edge is removed. Cancel to block it. */
|
|
103
|
+
export class BeforeDependencyRemovedEventArgs extends CancellableTaskGraphEventArgs {
|
|
104
|
+
FromTempId;
|
|
105
|
+
ToTempId;
|
|
106
|
+
constructor(FromTempId, ToTempId) {
|
|
107
|
+
super();
|
|
108
|
+
this.FromTempId = FromTempId;
|
|
109
|
+
this.ToTempId = ToTempId;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Fired AFTER a dependency edge was removed. NOT fired when the Before was canceled. */
|
|
113
|
+
export class AfterDependencyRemovedEventArgs {
|
|
114
|
+
FromTempId;
|
|
115
|
+
ToTempId;
|
|
116
|
+
Spec;
|
|
117
|
+
constructor(FromTempId, ToTempId, Spec) {
|
|
118
|
+
this.FromTempId = FromTempId;
|
|
119
|
+
this.ToTempId = ToTempId;
|
|
120
|
+
this.Spec = Spec;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// ── Informational ────────────────────────────────────────────────────────────
|
|
124
|
+
//
|
|
125
|
+
// Single emitters, no Before pair. Per the layering guide: don't invent a veto for something that
|
|
126
|
+
// cannot be vetoed. A selection that already happened and a validation that already ran are facts,
|
|
127
|
+
// not requests.
|
|
128
|
+
/** The spec changed for any reason. Hosts persist from here. */
|
|
129
|
+
export class TaskGraphSpecChangedEventArgs {
|
|
130
|
+
Spec;
|
|
131
|
+
Reason;
|
|
132
|
+
constructor(Spec, Reason) {
|
|
133
|
+
this.Spec = Spec;
|
|
134
|
+
this.Reason = Reason;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** Selection changed. `Task` is null when the selection was cleared. */
|
|
138
|
+
export class TaskGraphSelectionChangedEventArgs {
|
|
139
|
+
Task;
|
|
140
|
+
constructor(Task) {
|
|
141
|
+
this.Task = Task;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Validation ran.
|
|
146
|
+
*
|
|
147
|
+
* Errors come from the engine's own `ValidateTaskGraphSpec`, not from a second implementation here —
|
|
148
|
+
* so a graph that looks valid on the canvas cannot fail a different check at submission.
|
|
149
|
+
*/
|
|
150
|
+
export class TaskGraphValidationChangedEventArgs {
|
|
151
|
+
Valid;
|
|
152
|
+
Errors;
|
|
153
|
+
constructor(Valid, Errors) {
|
|
154
|
+
this.Valid = Valid;
|
|
155
|
+
this.Errors = Errors;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// ── Intent-only (navigation the HOST performs) ───────────────────────────────
|
|
159
|
+
//
|
|
160
|
+
// A widget at this layer must not navigate: it has no Router, and it cannot know whether it is
|
|
161
|
+
// inside Explorer, a downstream app, or an embedded panel. It reports the intent; the host decides.
|
|
162
|
+
/** The user asked to open the agent behind a task. The host navigates. */
|
|
163
|
+
export class AgentOpenRequestedEventArgs {
|
|
164
|
+
AgentName;
|
|
165
|
+
Task;
|
|
166
|
+
constructor(AgentName, Task) {
|
|
167
|
+
this.AgentName = AgentName;
|
|
168
|
+
this.Task = Task;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/** The user asked to open a record referenced by the graph. The host navigates. */
|
|
172
|
+
export class RecordOpenRequestedEventArgs {
|
|
173
|
+
EntityName;
|
|
174
|
+
RecordID;
|
|
175
|
+
constructor(EntityName, RecordID) {
|
|
176
|
+
this.EntityName = EntityName;
|
|
177
|
+
this.RecordID = RecordID;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=task-graph-editor-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-graph-editor-events.js","sourceRoot":"","sources":["../../src/lib/task-graph-editor-events.ts"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,MAAM,OAAO,6BAA6B;IAC/B,MAAM,GAAY,KAAK,CAAC;IACxB,YAAY,CAAU;CAChC;AAED,gFAAgF;AAEhF,wFAAwF;AACxF,MAAM,OAAO,wBAAyB,SAAQ,6BAA6B;IAC3C;IAA5B,YAA4B,IAAuB;QAAI,KAAK,EAAE,CAAC;QAAnC,SAAI,GAAJ,IAAI,CAAmB;IAAa,CAAC;CACpE;AAED,4EAA4E;AAC5E,MAAM,OAAO,uBAAuB;IAEZ;IACA;IAFpB,YACoB,IAAuB,EACvB,IAAmB;QADnB,SAAI,GAAJ,IAAI,CAAmB;QACvB,SAAI,GAAJ,IAAI,CAAe;IACpC,CAAC;CACP;AAED;;;;;GAKG;AACH,MAAM,OAAO,0BAA2B,SAAQ,6BAA6B;IAErD;IACA;IAFpB,YACoB,IAAuB,EACvB,gBAAmC;QACnD,KAAK,EAAE,CAAC;QAFQ,SAAI,GAAJ,IAAI,CAAmB;QACvB,qBAAgB,GAAhB,gBAAgB,CAAmB;IAC1C,CAAC;CACjB;AAED,8EAA8E;AAC9E,MAAM,OAAO,yBAAyB;IAEd;IACA;IAFpB,YACoB,IAAuB,EACvB,IAA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B,YACoB,UAAkB,EAClB,QAAgB,EAChB,IAAmB;QAFnB,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,SAAI,GAAJ,IAAI,CAAe;IACpC,CAAC;CACP;AAED,gFAAgF;AAChF,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,gBAAgB;AAEhB,gEAAgE;AAChE,MAAM,OAAO,6BAA6B;IAElB;IACA;IAFpB,YACoB,IAAmB,EACnB,MAA+G;QAD/G,SAAI,GAAJ,IAAI,CAAe;QACnB,WAAM,GAAN,MAAM,CAAyG;IAChI,CAAC;CACP;AAED,wEAAwE;AACxE,MAAM,OAAO,kCAAkC;IACf;IAA5B,YAA4B,IAA8B;QAA9B,SAAI,GAAJ,IAAI,CAA0B;IAAG,CAAC;CACjE;AAED;;;;;GAKG;AACH,MAAM,OAAO,mCAAmC;IAExB;IACA;IAFpB,YACoB,KAAc,EACd,MAA2C;QAD3C,UAAK,GAAL,KAAK,CAAS;QACd,WAAM,GAAN,MAAM,CAAqC;IAC5D,CAAC;CACP;AAED,gFAAgF;AAChF,EAAE;AACF,+FAA+F;AAC/F,oGAAoG;AAEpG,0EAA0E;AAC1E,MAAM,OAAO,2BAA2B;IAEhB;IACA;IAFpB,YACoB,SAAiB,EACjB,IAAuB;QADvB,cAAS,GAAT,SAAS,CAAQ;QACjB,SAAI,GAAJ,IAAI,CAAmB;IACxC,CAAC;CACP;AAED,mFAAmF;AACnF,MAAM,OAAO,4BAA4B;IAEjB;IACA;IAFpB,YACoB,UAAkB,EAClB,QAAgB;QADhB,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;IACjC,CAAC;CACP","sourcesContent":["/**\n * @fileoverview The component's upward contract.\n *\n * Follows MJ's `Before*` / `After*` cancelable pattern (see `guides/UI_LAYERING_GUIDE.md` §6),\n * already used by `ng-base-forms`, `ng-trees`, `ng-entity-viewer` and `ng-conversations`.\n *\n * **Why the args are classes and not payload interfaces.** `Cancel` has to travel *back*. Angular's\n * `EventEmitter` is synchronous for synchronous listeners, so the emitting component reads the\n * mutated object after `.emit()` returns — that is the entire veto mechanism. A frozen payload\n * cannot carry a veto, and a class additionally gives one place for defaults and future fields.\n *\n * **A `Before*` handler must not be `async`.** An `await` inside it returns control to the emitter\n * before the handler sets `Cancel`, so the veto silently does nothing. Where a host genuinely needs\n * to await — a confirmation dialog — the component exposes the action as a public method the host\n * calls *after* its own await, rather than pretending the veto is asynchronous.\n *\n * @module @memberjunction/ng-task-graph-editor\n */\nimport type { TaskGraphSpec, TaskGraphSpecNode, TaskGraphValidationError } from '@memberjunction/ai-core-plus';\n\n/**\n * Base for every cancelable graph event.\n *\n * A listener flips `Cancel = true` to halt the default behavior; the matching `After*` event will\n * then **not** fire. That is a contract hosts rely on, not a suggestion.\n */\nexport class CancellableTaskGraphEventArgs {\n public Cancel: boolean = false;\n public CancelReason?: string;\n}\n\n// ── Node lifecycle ───────────────────────────────────────────────────────────\n\n/** Fired BEFORE a task is added. Cancel to block it (e.g. the host caps graph size). */\nexport class BeforeTaskAddedEventArgs extends CancellableTaskGraphEventArgs {\n constructor(public readonly Task: TaskGraphSpecNode) { super(); }\n}\n\n/** Fired AFTER a task was added. NOT fired when the Before was canceled. */\nexport class AfterTaskAddedEventArgs {\n constructor(\n public readonly Task: TaskGraphSpecNode,\n public readonly Spec: TaskGraphSpec,\n ) {}\n}\n\n/**\n * Fired BEFORE a task is removed. Cancel to block it.\n *\n * `DependentTempIds` is supplied because removing a node also severs every edge into it, and a host\n * deciding whether to veto needs to know the blast radius — not just which node was clicked.\n */\nexport class BeforeTaskRemovedEventArgs extends CancellableTaskGraphEventArgs {\n constructor(\n public readonly Task: TaskGraphSpecNode,\n public readonly DependentTempIds: readonly string[],\n ) { super(); }\n}\n\n/** Fired AFTER a task was removed. NOT fired when the Before was canceled. */\nexport class AfterTaskRemovedEventArgs {\n constructor(\n public readonly Task: TaskGraphSpecNode,\n public readonly Spec: TaskGraphSpec,\n ) {}\n}\n\n/** Fired BEFORE a task's properties change. Cancel to block the edit. */\nexport class BeforeTaskUpdatedEventArgs extends CancellableTaskGraphEventArgs {\n constructor(\n public readonly Previous: TaskGraphSpecNode,\n public readonly Next: TaskGraphSpecNode,\n ) { super(); }\n}\n\n/** Fired AFTER a task's properties changed. NOT fired when the Before was canceled. */\nexport class AfterTaskUpdatedEventArgs {\n constructor(\n public readonly Task: TaskGraphSpecNode,\n public readonly Spec: TaskGraphSpec,\n ) {}\n}\n\n// ── Edge lifecycle ───────────────────────────────────────────────────────────\n\n/**\n * Fired BEFORE a dependency edge is created. Cancel to block it.\n *\n * `WouldCreateCycle` is computed before emitting so a host can veto on that alone without\n * re-deriving it. The component refuses a cycle regardless — the flag exists so the host can\n * explain *why* rather than watch an edge silently fail to appear.\n */\nexport class BeforeDependencyAddedEventArgs extends CancellableTaskGraphEventArgs {\n constructor(\n public readonly FromTempId: string,\n public readonly ToTempId: string,\n public readonly WouldCreateCycle: boolean,\n ) { super(); }\n}\n\n/** Fired AFTER a dependency edge was created. NOT fired when the Before was canceled. */\nexport class AfterDependencyAddedEventArgs {\n constructor(\n public readonly FromTempId: string,\n public readonly ToTempId: string,\n public readonly Spec: TaskGraphSpec,\n ) {}\n}\n\n/** Fired BEFORE a dependency edge is removed. Cancel to block it. */\nexport class BeforeDependencyRemovedEventArgs extends CancellableTaskGraphEventArgs {\n constructor(\n public readonly FromTempId: string,\n public readonly ToTempId: string,\n ) { super(); }\n}\n\n/** Fired AFTER a dependency edge was removed. NOT fired when the Before was canceled. */\nexport class AfterDependencyRemovedEventArgs {\n constructor(\n public readonly FromTempId: string,\n public readonly ToTempId: string,\n public readonly Spec: TaskGraphSpec,\n ) {}\n}\n\n// ── Informational ────────────────────────────────────────────────────────────\n//\n// Single emitters, no Before pair. Per the layering guide: don't invent a veto for something that\n// cannot be vetoed. A selection that already happened and a validation that already ran are facts,\n// not requests.\n\n/** The spec changed for any reason. Hosts persist from here. */\nexport class TaskGraphSpecChangedEventArgs {\n constructor(\n public readonly Spec: TaskGraphSpec,\n public readonly Reason: 'TaskAdded' | 'TaskRemoved' | 'TaskUpdated' | 'DependencyAdded' | 'DependencyRemoved' | 'LayoutApplied',\n ) {}\n}\n\n/** Selection changed. `Task` is null when the selection was cleared. */\nexport class TaskGraphSelectionChangedEventArgs {\n constructor(public readonly Task: TaskGraphSpecNode | null) {}\n}\n\n/**\n * Validation ran.\n *\n * Errors come from the engine's own `ValidateTaskGraphSpec`, not from a second implementation here —\n * so a graph that looks valid on the canvas cannot fail a different check at submission.\n */\nexport class TaskGraphValidationChangedEventArgs {\n constructor(\n public readonly Valid: boolean,\n public readonly Errors: readonly TaskGraphValidationError[],\n ) {}\n}\n\n// ── Intent-only (navigation the HOST performs) ───────────────────────────────\n//\n// A widget at this layer must not navigate: it has no Router, and it cannot know whether it is\n// inside Explorer, a downstream app, or an embedded panel. It reports the intent; the host decides.\n\n/** The user asked to open the agent behind a task. The host navigates. */\nexport class AgentOpenRequestedEventArgs {\n constructor(\n public readonly AgentName: string,\n public readonly Task: TaskGraphSpecNode,\n ) {}\n}\n\n/** The user asked to open a record referenced by the graph. The host navigates. */\nexport class RecordOpenRequestedEventArgs {\n constructor(\n public readonly EntityName: string,\n public readonly RecordID: string,\n ) {}\n}\n"]}
|