@pipelex/mthds-ui 0.27.0 → 0.29.0
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/README.md +19 -5
- package/dist/{chunk-VCO4GZDZ.js → chunk-3I3ZPYMW.js} +13 -1
- package/dist/chunk-3I3ZPYMW.js.map +1 -0
- package/dist/{chunk-XBHDA3PQ.js → chunk-Y46574OW.js} +2 -2
- package/dist/{chunk-K3BWHQVX.js → chunk-ZTXSDTVF.js} +81 -34
- package/dist/chunk-ZTXSDTVF.js.map +1 -0
- package/dist/form/react/RunPanel.css +1 -3
- package/dist/form/react/index.d.ts +5 -5
- package/dist/form/react/index.js +2 -2
- package/dist/form/react/index.js.map +1 -1
- package/dist/graph/index.d.ts +24 -9
- package/dist/graph/index.js +11 -3
- package/dist/graph/react/graph-core.css +12 -0
- package/dist/graph/react/index.d.ts +113 -45
- package/dist/graph/react/index.js +333 -283
- package/dist/graph/react/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/standalone/graph-standalone.html +420 -114
- package/dist/standalone/graph-viewer.css +13 -1
- package/dist/standalone/graph-viewer.js +406 -112
- package/dist/static-graph/index.d.ts +32 -9
- package/dist/static-graph/index.js +709 -88
- package/dist/static-graph/index.js.map +1 -1
- package/dist/{types-DgqW3Jg4.d.ts → types-BaFWy56P.d.ts} +106 -13
- package/package.json +2 -2
- package/dist/chunk-K3BWHQVX.js.map +0 -1
- package/dist/chunk-VCO4GZDZ.js.map +0 -1
- /package/dist/{chunk-XBHDA3PQ.js.map → chunk-Y46574OW.js.map} +0 -0
package/README.md
CHANGED
|
@@ -37,11 +37,11 @@ If you render the React components, one setup step follows the install: the form
|
|
|
37
37
|
import { GraphViewer } from "@pipelex/mthds-ui/graph/react";
|
|
38
38
|
|
|
39
39
|
function MethodGraph({ graphspec }) {
|
|
40
|
-
return <GraphViewer
|
|
40
|
+
return <GraphViewer graph={{ graphSpec: graphspec }} />;
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
That's it. `GraphViewer` handles layout, styling, CSS variables, and all ReactFlow internals. All props except `
|
|
44
|
+
That's it. `GraphViewer` handles layout, styling, CSS variables, and all ReactFlow internals. All props except `graph` are optional with sensible defaults. The one exception to "styling" is the detail panel's data view, which shows a result through the form kernel's controls; those are styled by your app, as [Styling the form controls](#styling-the-form-controls) describes.
|
|
45
45
|
|
|
46
46
|
### Next.js (App Router)
|
|
47
47
|
|
|
@@ -63,15 +63,29 @@ const GraphViewer = dynamic(
|
|
|
63
63
|
) as React.ComponentType<GraphViewerProps>;
|
|
64
64
|
|
|
65
65
|
export function MyGraph({ graphspec }) {
|
|
66
|
-
return <GraphViewer
|
|
66
|
+
return <GraphViewer graph={{ graphSpec: graphspec }} />;
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
### Showing what a run produced
|
|
71
|
+
|
|
72
|
+
`graph` carries the spec together with the artifacts that describe its pipes, and the detail panel uses them to lay a data node's value out. They must all come from one source, because the panel looks each value's descriptor up by the `pipe_ref` of the pipe that produced it in this graph: a run's own results, or a method's validate report beside that method's dry or static graph. A run's results carry all four, and `graphArtifactsFrom` reads them in one call:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { GraphViewer, graphArtifactsFrom } from "@pipelex/mthds-ui/graph/react";
|
|
76
|
+
|
|
77
|
+
// results: { graph_spec, pipe_io_contracts, output_form, input_form }
|
|
78
|
+
const graph = graphArtifactsFrom(results);
|
|
79
|
+
return <GraphViewer graph={graph} />;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Without `pipeIoContracts` and `outputForm` the panel shows each concept's structure table and no data tab. See [docs/stuff-result-panel.md](docs/stuff-result-panel.md).
|
|
83
|
+
|
|
70
84
|
### GraphViewer props
|
|
71
85
|
|
|
72
86
|
| Prop | Type | Default | Description |
|
|
73
87
|
| ------------------ | ------------------------------------------------- | ---------------------- | ---------------------------------------- |
|
|
74
|
-
| `
|
|
88
|
+
| `graph` | `GraphArtifacts \| null` | — | The spec and its descriptors, one source |
|
|
75
89
|
| `config` | `GraphConfig` | `DEFAULT_GRAPH_CONFIG` | Layout and visual configuration |
|
|
76
90
|
| `direction` | `GraphDirection` | `"LR"` | Layout direction: `TB`, `LR`, `RL`, `BT` |
|
|
77
91
|
| `showControllers` | `boolean` | `false` | Show controller group outlines |
|
|
@@ -237,7 +251,7 @@ const myConfig = {
|
|
|
237
251
|
|
|
238
252
|
```tsx
|
|
239
253
|
<GraphViewer
|
|
240
|
-
|
|
254
|
+
graph={{ graphSpec: graphspec }}
|
|
241
255
|
config={{
|
|
242
256
|
...DEFAULT_GRAPH_CONFIG,
|
|
243
257
|
paletteColors: {
|
|
@@ -7,6 +7,8 @@ var PIPE_TYPE_PRESENCE = {
|
|
|
7
7
|
PipeSearch: true,
|
|
8
8
|
PipeFunc: true,
|
|
9
9
|
PipeStructure: true,
|
|
10
|
+
PipeJudge: true,
|
|
11
|
+
PipeDocGen: true,
|
|
10
12
|
PipeSignature: true,
|
|
11
13
|
PipeSequence: true,
|
|
12
14
|
PipeParallel: true,
|
|
@@ -14,6 +16,7 @@ var PIPE_TYPE_PRESENCE = {
|
|
|
14
16
|
PipeBatch: true
|
|
15
17
|
};
|
|
16
18
|
var KNOWN_PIPE_TYPES = new Set(Object.keys(PIPE_TYPE_PRESENCE));
|
|
19
|
+
var BINDING_STEP_TYPE = "BindingStep";
|
|
17
20
|
var GRAPH_SPEC_MODE = {
|
|
18
21
|
DRY: "dry",
|
|
19
22
|
LIVE: "live",
|
|
@@ -39,6 +42,12 @@ function multiplicitySuffix(multiplicity) {
|
|
|
39
42
|
if (!isPluralMultiplicity(multiplicity)) return "";
|
|
40
43
|
return multiplicity === true ? "[]" : `[${multiplicity}]`;
|
|
41
44
|
}
|
|
45
|
+
function isBindingNode(node) {
|
|
46
|
+
return node.kind === "binding";
|
|
47
|
+
}
|
|
48
|
+
function isBindingStepSpec(step) {
|
|
49
|
+
return "from_path" in step;
|
|
50
|
+
}
|
|
42
51
|
function graphSpecMode(spec) {
|
|
43
52
|
var _a;
|
|
44
53
|
return (_a = spec == null ? void 0 : spec.meta) == null ? void 0 : _a.mode;
|
|
@@ -141,6 +150,7 @@ function nodeHeight(n) {
|
|
|
141
150
|
|
|
142
151
|
export {
|
|
143
152
|
KNOWN_PIPE_TYPES,
|
|
153
|
+
BINDING_STEP_TYPE,
|
|
144
154
|
GRAPH_SPEC_MODE,
|
|
145
155
|
NODE_TYPE_PIPE_CARD,
|
|
146
156
|
NODE_TYPE_STUFF,
|
|
@@ -151,6 +161,8 @@ export {
|
|
|
151
161
|
stuffDigestFromId,
|
|
152
162
|
isPluralMultiplicity,
|
|
153
163
|
multiplicitySuffix,
|
|
164
|
+
isBindingNode,
|
|
165
|
+
isBindingStepSpec,
|
|
154
166
|
graphSpecMode,
|
|
155
167
|
isStaticGraphSpec,
|
|
156
168
|
isDryGraphSpec,
|
|
@@ -170,4 +182,4 @@ export {
|
|
|
170
182
|
nodeWidth,
|
|
171
183
|
nodeHeight
|
|
172
184
|
};
|
|
173
|
-
//# sourceMappingURL=chunk-
|
|
185
|
+
//# sourceMappingURL=chunk-3I3ZPYMW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/types.ts"],"sourcesContent":["// ─── Pipe type taxonomy ─────────────────────────────────────────────────────\n// Operators perform work; controllers orchestrate other pipes.\n\nexport type PipeOperatorType =\n | \"PipeLLM\"\n | \"PipeExtract\"\n | \"PipeCompose\"\n | \"PipeImgGen\"\n | \"PipeSearch\"\n | \"PipeFunc\"\n | \"PipeStructure\" // turns Text into a structured concept via an LLM\n | \"PipeJudge\" // asks a judging model one closed question, answered as a verdict native\n | \"PipeDocGen\" // lays its inputs out as a stored document file, calling no AI model\n | \"PipeSignature\"; // contract-only stub — emitted under `--allow-signatures`\n\nexport type PipeControllerType = \"PipeSequence\" | \"PipeParallel\" | \"PipeCondition\" | \"PipeBatch\";\n\nexport type PipeType = PipeOperatorType | PipeControllerType;\n\n// Presence map over the full `PipeType` union — typed as `Record<PipeType, true>`\n// so adding a pipe class to the union without listing it here is a compile\n// error. `KNOWN_PIPE_TYPES` derives its keys from this map, keeping the runtime\n// check the validator performs in sync with the type.\nconst PIPE_TYPE_PRESENCE: Record<PipeType, true> = {\n PipeLLM: true,\n PipeExtract: true,\n PipeCompose: true,\n PipeImgGen: true,\n PipeSearch: true,\n PipeFunc: true,\n PipeStructure: true,\n PipeJudge: true,\n PipeDocGen: true,\n PipeSignature: true,\n PipeSequence: true,\n PipeParallel: true,\n PipeCondition: true,\n PipeBatch: true,\n};\n\n/** Every pipe class name pipelex emits as `pipe_type`. Used by validateGraphSpec. */\nexport const KNOWN_PIPE_TYPES: ReadonlySet<string> = new Set(Object.keys(PIPE_TYPE_PRESENCE));\n\n/**\n * The `pipe_type` of a binding node. A PipeSequence's binding step\n * (`{ from = \"invoice.total\", result = \"total_amount\" }`) runs no pipe, so the\n * class it carries is not a pipe class: pipelex writes `BindingStep` beside the\n * `binding` node kind, and the node's `pipe_code` is the step's `from` path.\n */\nexport const BINDING_STEP_TYPE = \"BindingStep\" as const;\n\nexport type BindingStepType = typeof BINDING_STEP_TYPE;\n\n/** What a GraphSpec node's `pipe_type` names: a pipe class, or the binding step that runs none. */\nexport type NodePipeType = PipeType | BindingStepType;\n\nexport type PipeStatus = \"succeeded\" | \"failed\" | \"running\" | \"scheduled\" | \"skipped\" | \"canceled\";\n\n// ─── GraphSpec mode contract ────────────────────────────────────────────────\n\nexport const GRAPH_SPEC_MODE = {\n DRY: \"dry\",\n LIVE: \"live\",\n STATIC: \"static\",\n} as const;\n\nexport type GraphSpecMode = (typeof GRAPH_SPEC_MODE)[keyof typeof GRAPH_SPEC_MODE];\n\nexport interface GraphSpecMeta {\n format: \"mthds\";\n /**\n * Missing mode is a legacy runtime graph. Static UI behavior must key only on\n * `mode === \"static\"` and never infer it from absent runtime fields.\n */\n mode?: GraphSpecMode;\n [key: string]: unknown;\n}\n\n// ─── Node type constants ────────────────────────────────────────────────────\n// Used by graphBuilders and consumed by ReactFlow custom node registration.\n\nexport const NODE_TYPE_PIPE_CARD = \"pipeCard\" as const;\nexport const NODE_TYPE_STUFF = \"default\" as const;\nexport const NODE_TYPE_CONTROLLER = \"controllerGroup\" as const;\n\n// ─── Stuff node ID helpers ──────────────────────────────────────────────────\n// Stuff (data) nodes use a \"stuff_<digest>\" convention throughout the graph.\n\nexport const STUFF_ID_PREFIX = \"stuff_\";\n\nexport function stuffNodeId(digest: string): string {\n return STUFF_ID_PREFIX + digest;\n}\n\nexport function isStuffNodeId(id: string): boolean {\n return id.startsWith(STUFF_ID_PREFIX);\n}\n\nexport function stuffDigestFromId(id: string): string {\n return id.slice(STUFF_ID_PREFIX.length);\n}\n\n// ─── Stuff multiplicity ─────────────────────────────────────────────────────\n// How many values a stuff holds, in the encoding the pipe registry already uses\n// for `StuffSpecInfo.multiplicity`: `true` for a variable-length list (`Code[]`),\n// an integer for a fixed count (`Code[N]`), `null`/`false`/absent for a single\n// value. A count of exactly one is single throughout the MTHDS standard —\n// `Code[1]` is a way of writing `Code`, never a one-item list — so it reads as\n// single here too.\n\nexport type StuffMultiplicity = number | boolean | null;\n\n/** Whether a multiplicity declares a list: variable-length, or a fixed count of at least two. */\nexport function isPluralMultiplicity(multiplicity: StuffMultiplicity | undefined): boolean {\n return multiplicity === true || (Number.isInteger(multiplicity) && (multiplicity as number) > 1);\n}\n\n/** The authored marker for a multiplicity — `\"[]\"`, `\"[N]\"`, or `\"\"` for a single value. */\nexport function multiplicitySuffix(multiplicity: StuffMultiplicity | undefined): string {\n if (!isPluralMultiplicity(multiplicity)) return \"\";\n return multiplicity === true ? \"[]\" : `[${multiplicity as number}]`;\n}\n\n// ─── GraphSpec types (from pipelex-agent --view output) ─────────────────────\n\nexport interface GraphSpecNodeIoItem {\n name: string;\n digest?: string;\n /** The bare concept code or ref, never carrying a multiplicity marker — that is `multiplicity`. */\n concept?: string;\n /**\n * How many values the stuff holds (see `StuffMultiplicity`). Emitted only on a\n * plural stuff; absent means single. The static builder writes it, and a\n * runtime graph carries it once its producer emits it, so a renderer must read\n * absence as single rather than as unknown.\n */\n multiplicity?: StuffMultiplicity;\n content_type?: string;\n preview?: string;\n size?: number;\n data?: unknown;\n data_text?: string;\n data_html?: string;\n extra?: Record<string, unknown>;\n}\n\nexport interface GraphSpecNodeIo {\n inputs: GraphSpecNodeIoItem[];\n outputs: GraphSpecNodeIoItem[];\n}\n\nexport type NodeKind =\n | \"pipe_call\"\n | \"controller\"\n | \"operator\"\n | \"input\"\n | \"output\"\n | \"artifact\"\n | \"error\"\n // A PipeSequence binding step: it runs no pipe, and produces the stuff it binds from a path in working memory.\n | \"binding\";\n\nexport interface GraphSpecNodeTiming {\n started_at: string;\n ended_at: string;\n duration: number;\n}\n\nexport interface GraphSpecNodeError {\n error_type: string;\n message: string;\n stack?: string;\n}\n\n/**\n * Inference usage attributed to one graph node — the mirror of pipelex's\n * `NodeUsageSpec`. Read the invariants before rendering any of these numbers;\n * getting them wrong means showing a wrong dollar figure, which is worse than\n * showing none.\n *\n * 1. `node.usage === undefined` is ALL-OR-NOTHING across a spec: it means the\n * run reported no usage at all (collection off, or zero inference calls).\n * As soon as one call was reported, EVERY node carries a usage object —\n * zeroed for controllers, PipeFunc, PipeCompose, skipped and lifted pipes.\n * So it never means \"this particular node was not measured\".\n * 2. `cost === null` ⟺ `rated_inference_calls === 0`. \"Made no call\" and \"made\n * only unrated calls\" both land here; `inference_calls` tells them apart.\n * Never render `null` as `$0.00` — a dry run is entirely unrated.\n * 3. `inference_calls > rated_inference_calls > 0` means `cost` is a LOWER\n * BOUND, not a total. It must be marked (a leading \"≥\").\n * 4. `total_tokens` is input_joined + output. Do NOT sum\n * `nb_tokens_by_category`: `input_cached` is a subset of `input`, not\n * additive, so summing double-counts.\n *\n * The `subtree_*` half covers the node plus every descendant, rolled up by\n * pipelex so no consumer re-derives it. Controllers have only a subtree.\n */\n/**\n * What one inference model actually did for a node — the graph's only record of\n * the model that RAN.\n *\n * Everything else in a GraphSpec that names a model records what was *asked for*:\n * `execution_data.resolved_model` is the handle the pipe resolved to (often still\n * an alias like `@default-premium`, since aliases resolve at inference time), and\n * the blueprint holds the authored choice (`$writing-factual`). Only this survives\n * alias resolution, deck defaults, and any fallback or retry.\n *\n * `cost` follows the same rule as the node's: `null` iff no call to this model was\n * priced.\n */\nexport interface GraphSpecModelUsage {\n inference_model_name: string;\n inference_model_id: string;\n /**\n * Kind of inference: `\"llm\"`, `\"img_gen\"`, `\"extract\"`, `\"search\"`. Open set.\n *\n * The discriminator to check before displaying token counts: everything except\n * `\"llm\"` is billed PER REQUEST, and pipelex encodes that price by putting\n * `1_000_000` in each token category (rates are per-million), so those \"tokens\"\n * are a scaled request counter rather than a measurement.\n */\n model_type: string;\n inference_calls: number;\n rated_inference_calls: number;\n cost: number | null;\n}\n\nexport interface GraphSpecNodeUsage {\n inference_calls: number;\n rated_inference_calls: number;\n nb_tokens_by_category: Record<string, number>;\n total_tokens: number;\n cost: number | null;\n /** Components of `cost`; `input` is the joined input cost (non-cached + cached). */\n cost_input: number | null;\n cost_output: number | null;\n /**\n * The models that actually ran, most-used first. A list because one node\n * routinely uses more than one — a PipeLLM's text pass and its object pass\n * resolve separately — so `by_model[0]` is the dominant model, not \"the\" model.\n */\n by_model: GraphSpecModelUsage[];\n subtree_inference_calls: number;\n subtree_rated_inference_calls: number;\n subtree_nb_tokens_by_category: Record<string, number>;\n subtree_total_tokens: number;\n subtree_cost: number | null;\n subtree_cost_input: number | null;\n subtree_cost_output: number | null;\n /** Every model this node's whole branch used. */\n subtree_by_model: GraphSpecModelUsage[];\n}\n\n/**\n * Run-level usage for a whole spec — the mirror of pipelex's `GraphUsageSpec`.\n *\n * `total` covers every call the run reported, attributed or not. `unattributed`\n * is the part that named no live node; on a healthy run it is zeroed, and a\n * non-zero one is worth surfacing rather than hiding. Neither has a subtree\n * distinct from itself, so their `subtree_*` fields repeat their own.\n */\nexport interface GraphSpecUsage {\n total: GraphSpecNodeUsage;\n unattributed: GraphSpecNodeUsage;\n}\n\nexport interface GraphSpecNode {\n id: string;\n kind: NodeKind;\n pipe_code?: string;\n pipe_type: NodePipeType;\n description?: string;\n domain_code?: string;\n status: PipeStatus;\n timing?: GraphSpecNodeTiming;\n io: GraphSpecNodeIo;\n error?: GraphSpecNodeError;\n tags?: Record<string, string>;\n metrics?: Record<string, number>;\n usage?: GraphSpecNodeUsage;\n execution_data?: Record<string, unknown>;\n}\n\n/**\n * A pipe-call node: a controller or an operator. Narrowed from `GraphSpecNode`\n * for code paths that only ever render pipe-call nodes, where `pipe_code` is\n * guaranteed (validateGraphSpec enforces this).\n */\nexport type PipeCallNode = GraphSpecNode & {\n kind: \"controller\" | \"operator\";\n pipe_code: string;\n pipe_type: PipeType;\n};\n\n/**\n * A binding node: a PipeSequence's binding step, which runs no pipe. Its\n * `pipe_code` is the step's `from` path (`invoice.total`), its one input the\n * root the path starts from, and its one output the stuff it binds, under the\n * step's `result`. A binding that bound nothing, because the path held nothing,\n * has no output; one whose root was absent has no input; a failed one may have\n * neither. The graph draws it all the same. It is never a controller: nothing\n * is contained in it.\n */\nexport type BindingNode = GraphSpecNode & {\n kind: \"binding\";\n pipe_code: string;\n pipe_type: BindingStepType;\n};\n\n/** A node the graph draws as a card: a pipe-call node or a binding node. */\nexport type CardNode = PipeCallNode | BindingNode;\n\n/** Whether a node is a binding step's node. */\nexport function isBindingNode(node: Pick<GraphSpecNode, \"kind\">): boolean {\n return node.kind === \"binding\";\n}\n\nexport type GraphSpecEdgeKind =\n | \"contains\"\n | \"data\"\n | \"control\"\n | \"selected_outcome\"\n | \"batch_item\"\n | \"batch_aggregate\"\n | \"parallel_combine\";\n\nexport interface GraphSpecEdge {\n id: string;\n source: string;\n target: string;\n kind: GraphSpecEdgeKind;\n label?: string;\n source_stuff_digest?: string;\n target_stuff_digest?: string;\n meta?: Record<string, unknown>;\n}\n\n// ─── Concept and Pipe registry types ───────────────────────────────────────\n// Serialized from Python Concept and PipeAbstract instances via model_dump().\n//\n// Every field pipelex writes as `T | null` is declared `field?: T | null` here,\n// optional as well as nullable. Unlike `usage`, the registries cross the boundary\n// unvalidated, and a host that drops `null` values from the JSON it relays (ChatGPT\n// does, on the way to an MCP App view) delivers such a field with the key absent.\n// The optional marker is what makes the compiler refuse a strict `!== null` test\n// followed by a dereference.\n\n/**\n * A concept as the registry serializes it. A field that can be `null` is also\n * declared optional, because a host that drops `null` values delivers it absent:\n * test it with `!= null`, optional chaining or truthiness.\n */\nexport interface ConceptInfo {\n code: string;\n domain_code: string;\n description: string;\n structure_class_name: string;\n refines?: string | null;\n json_schema?: Record<string, unknown>;\n}\n\n/**\n * Presence of a value in a declared slot, mirroring the runtime's\n * `PresenceMarker`: `plain` (always present), `optional` (the `?` suffix — the\n * slot may legitimately hold no value), `force` (the `!` suffix — a use-site\n * assertion that the value must be present). The runtime defaults the field to\n * `plain`, so an absent `presence` reads as plain.\n */\nexport type PresenceMarker = \"plain\" | \"optional\" | \"force\";\n\nexport interface StuffSpecInfo {\n concept: ConceptInfo;\n multiplicity?: StuffMultiplicity;\n presence?: PresenceMarker;\n}\n\n// ─── Template blueprint (shared by LLM prompts, Search, Compose, ImgGen) ───\n\nexport interface TemplateBlueprint {\n template: string;\n templating_style?: string | null;\n category: string;\n extra_context?: Record<string, unknown> | null;\n}\n\n// ─── Sub-pipe (used by Sequence, Parallel, Batch) ──────────────────────\n\nexport interface SubPipeSpec {\n pipe_code: string;\n output_name?: string | null;\n output_multiplicity?: string | number | boolean | null;\n batch_params?: { input_list_stuff_name: string; input_item_stuff_name: string } | null;\n}\n\n/**\n * A PipeSequence binding step, as the runtime holds it and the registry\n * serializes it: the value at `from_path` stored under `output_name`. A step\n * whose `batch_over` is a dotted path is held as such a binding, under a\n * private `_bound_…` name and with `is_dotted_batch_over` set, followed by the\n * same pipe step batching over that name.\n */\nexport interface BindingStepSpec {\n from_path: string;\n output_name: string;\n is_dotted_batch_over?: boolean;\n}\n\n/** One step of a PipeSequence: a pipe step, or a binding step. */\nexport type SequenceStepSpec = SubPipeSpec | BindingStepSpec;\n\n/** Whether a sequence step is a binding step, which carries a `from_path` and runs no pipe. */\nexport function isBindingStepSpec(step: SequenceStepSpec): step is BindingStepSpec {\n return \"from_path\" in step;\n}\n\n// ─── PipeAbstract base (common to all pipe types) ──────────────────────\n\nexport interface PipeBlueprintBase {\n type: PipeType;\n pipe_category: \"PipeOperator\" | \"PipeController\";\n code: string;\n domain_code: string;\n description: string;\n inputs: Record<string, StuffSpecInfo>;\n output: StuffSpecInfo;\n}\n\n// ─── Operator blueprints ───────────────────────────────────────────────\n\nexport interface PipeLLMBlueprint extends PipeBlueprintBase {\n type: \"PipeLLM\";\n llm_prompt_spec: {\n system_prompt_blueprint?: TemplateBlueprint | null;\n prompt_blueprint?: TemplateBlueprint | null;\n user_image_references?: unknown[] | null;\n user_document_references?: unknown[] | null;\n system_image_references?: unknown[] | null;\n system_document_references?: unknown[] | null;\n };\n llm_choices?: { for_text?: string | null; for_object?: string | null } | null;\n structuring_method?: string | null;\n output_multiplicity?: string | number | null;\n}\n\nexport interface PipeImgGenBlueprint extends PipeBlueprintBase {\n type: \"PipeImgGen\";\n img_gen_prompt_blueprint: {\n prompt_blueprint?: TemplateBlueprint | null;\n negative_prompt_blueprint?: TemplateBlueprint | null;\n image_references?: unknown[] | null;\n };\n img_gen_choice?: string | null;\n aspect_ratio?: string | null;\n is_raw?: boolean | null;\n seed?: number | string | null;\n background?: string | null;\n output_format?: string | null;\n output_multiplicity: number;\n}\n\n/**\n * A single field in a PipeCompose construct blueprint. Mirrors the\n * `ConstructFieldBlueprint` Pydantic model in pipelex. Exactly one of\n * `fixed_value` / `from_path` / `template` / `nested` is populated, matching\n * the `method` discriminator.\n *\n * - `fixed` → `fixed_value` holds a literal (string, number, bool, list)\n * - `from_var` → `from_path` holds a dotted path into working memory,\n * optionally with a `list_to_dict_keyed_by` modifier\n * - `template` → `template` holds a Jinja2 template string (per-field)\n * - `nested` → `nested` holds a recursive construct blueprint for building\n * nested structured content\n */\nexport interface PipeComposeConstructField {\n method: \"from_var\" | \"fixed\" | \"template\" | \"nested\";\n fixed_value?: unknown;\n from_path?: string | null;\n template?: string | null;\n nested?: PipeComposeConstructBlueprint | null;\n list_to_dict_keyed_by?: string | null;\n}\n\n/**\n * A PipeCompose construct blueprint, parsed from `[pipe.X.construct]` in MTHDS.\n * Mirrors the `ConstructBlueprint` Pydantic model in pipelex.\n */\nexport interface PipeComposeConstructBlueprint {\n fields: Record<string, PipeComposeConstructField>;\n}\n\n/**\n * Per-field record of how each field was built at runtime, emitted by\n * `PipeCompose._run_construct_mode` in pipelex via `execution_data.fields`.\n *\n * - `method` → which composition method was used (mirrors `ConstructFieldMethod`)\n * - `rendered` → present only for `template` fields, holds the Jinja2 output\n *\n * Nested fields record only their method; their sub-fields are not surfaced.\n */\nexport interface FieldResolution {\n method: \"from_var\" | \"fixed\" | \"template\" | \"nested\";\n rendered?: string;\n}\n\nexport interface PipeComposeBlueprint extends PipeBlueprintBase {\n type: \"PipeCompose\";\n /** Legacy monolithic template. Null when construct_blueprint is used instead. */\n template?: string | null;\n templating_style?: string | null;\n category: string;\n extra_context?: Record<string, unknown> | null;\n /** Field-level construct form (e.g. `[pipe.X.construct]` in MTHDS). */\n construct_blueprint?: PipeComposeConstructBlueprint | null;\n}\n\nexport interface PipeExtractBlueprint extends PipeBlueprintBase {\n type: \"PipeExtract\";\n extract_choice?: string | null;\n should_caption_images: boolean;\n max_page_images?: number | null;\n should_include_page_views: boolean;\n page_views_dpi?: number | null;\n render_js?: boolean | null;\n include_raw_html?: boolean | null;\n image_stuff_name?: string | null;\n document_stuff_name?: string | null;\n}\n\nexport interface PipeSearchBlueprint extends PipeBlueprintBase {\n type: \"PipeSearch\";\n search_choice?: string | null;\n prompt_blueprint: TemplateBlueprint;\n include_images_override?: boolean | null;\n max_results_override?: number | null;\n from_date?: string | null;\n to_date?: string | null;\n include_domains?: string[] | null;\n exclude_domains?: string[] | null;\n is_structured_output: boolean;\n}\n\nexport interface PipeFuncBlueprint extends PipeBlueprintBase {\n type: \"PipeFunc\";\n}\n\n/**\n * A PipeStructure: an LLM-backed operator that turns a single Text-compatible\n * input into a structured concept. Serialized from the runtime `PipeStructure`,\n * so the registry entry carries the runtime fields below alongside the base.\n */\nexport interface PipeStructureBlueprint extends PipeBlueprintBase {\n type: \"PipeStructure\";\n /**\n * LLM used to structure the text. A string model handle, an inline LLM\n * setting object, or null (→ resolved from the model deck's `for_object`\n * default at run time).\n */\n llm_choice?: string | Record<string, unknown> | null;\n /** The single Text-compatible input variable the structuring reads. */\n text_input_name: string;\n /** `true` → let the LLM decide the count, a number → fixed count, null → single object. */\n output_multiplicity?: boolean | number | null;\n}\n\n/**\n * The question a PipeJudge asks, as the runtime serializes it. Its `kind`\n * decides the verdict native the judge answers with: `yes_no` → `YesNo`,\n * `choice` → `Choice`, `rating` → `Rating`. `instructions` is the authored\n * question, still a template.\n */\nexport interface JudgmentQuestionSpec {\n kind: \"yes_no\" | \"choice\" | \"rating\";\n instructions: string;\n yes_criterion?: string | null;\n no_criterion?: string | null;\n options?: Record<string, string | null> | null;\n levels?: string[] | null;\n}\n\n/**\n * A PipeJudge: asks a judging model one closed question about its inputs and\n * stores the verdict native it answers with. Serialized from the runtime\n * `PipeJudge`.\n */\nexport interface PipeJudgeBlueprint extends PipeBlueprintBase {\n type: \"PipeJudge\";\n /** The judging model, a handle or an inline setting, or null for the deck's default. */\n judgment_choice?: string | Record<string, unknown> | null;\n judgment_question: JudgmentQuestionSpec;\n /** The probability a yes/no verdict must reach to read as yes, when the pipe declares one. */\n threshold?: number | null;\n}\n\n/**\n * A PipeDocGen: lays its inputs out as a stored document file, in the declared\n * format, and calls no AI model. Serialized from the runtime `PipeDocGen`.\n */\nexport interface PipeDocGenBlueprint extends PipeBlueprintBase {\n type: \"PipeDocGen\";\n /** `pdf`, `html`, `xlsx` or `docx`. */\n doc_gen_format: string;\n /** The engine the step names, or null for the deck's default. */\n doc_gen_choice?: string | Record<string, unknown> | null;\n /** The HTML template of a pdf step, inline or read from its template file. */\n template?: string | null;\n /** The template file as the method names it. */\n template_file?: string | null;\n /** The file name the document is stored under, a template. */\n filename?: string | null;\n}\n\n/**\n * A contract-only pipe: declares inputs + output but has no implementation.\n * Emitted under `--allow-signatures` so an in-progress bundle still validates\n * (dry-run mocks the declared output) before every referenced pipe is built.\n */\nexport interface PipeSignatureBlueprint extends Omit<PipeBlueprintBase, \"pipe_category\"> {\n type: \"PipeSignature\";\n /**\n * Signatures sit outside the executable taxonomy, so pipelex serializes\n * `pipe_category: null` (present, not omitted) — unlike operator/controller\n * blueprints which carry \"PipeOperator\" / \"PipeController\". Optional all the\n * same, since a host that drops `null` values delivers it absent.\n */\n pipe_category?: null;\n /** Intended downstream pipe type once implemented — an optional hint. */\n signature_for?: PipeType | null;\n}\n\n// ─── Controller blueprints ─────────────────────────────────────────────\n\nexport interface PipeSequenceBlueprint extends PipeBlueprintBase {\n type: \"PipeSequence\";\n /** Pipe steps and binding steps, in order — a dotted `batch_over` held as a binding then a batch. */\n sequential_sub_pipes: SequenceStepSpec[];\n}\n\nexport interface PipeParallelBlueprint extends PipeBlueprintBase {\n type: \"PipeParallel\";\n parallel_sub_pipes: SubPipeSpec[];\n add_each_output: boolean;\n /**\n * Removed from the language in pipelex 0.41 (a parallel always combines now),\n * so 0.41 registry dumps omit the key entirely. Optional rather than deleted\n * because the static builder still honors it as a legacy authoring key when\n * naming the combined stuff, which L-260929-1e09e0 removes.\n */\n combined_output?: string | null;\n}\n\nexport interface PipeConditionBlueprint extends PipeBlueprintBase {\n type: \"PipeCondition\";\n expression: string;\n outcome_map: Record<string, string>;\n default_outcome: string;\n add_alias_from_expression_to?: string | null;\n}\n\nexport interface PipeBatchBlueprint extends PipeBlueprintBase {\n type: \"PipeBatch\";\n branch_pipe_code: string;\n batch_params: { input_list_stuff_name: string; input_item_stuff_name: string };\n}\n\n/**\n * A pipe as the registry serializes it, discriminated on `type`. A field that can\n * be `null` is also declared optional, because a host that drops `null` values\n * delivers it absent: test it with `!= null`, optional chaining or truthiness.\n */\nexport type PipeBlueprintUnion =\n | PipeLLMBlueprint\n | PipeImgGenBlueprint\n | PipeComposeBlueprint\n | PipeExtractBlueprint\n | PipeSearchBlueprint\n | PipeFuncBlueprint\n | PipeStructureBlueprint\n | PipeJudgeBlueprint\n | PipeDocGenBlueprint\n | PipeSignatureBlueprint\n | PipeSequenceBlueprint\n | PipeParallelBlueprint\n | PipeConditionBlueprint\n | PipeBatchBlueprint;\n\n// ─── GraphSpec top-level ───────────────────────────────────────────────────\n\nexport interface GraphSpec {\n graph_id?: string;\n created_at?: string;\n pipeline_ref?: { domain?: string; main_pipe?: string; entrypoint?: string };\n nodes: GraphSpecNode[];\n edges: GraphSpecEdge[];\n usage?: GraphSpecUsage;\n meta?: GraphSpecMeta;\n pipe_registry?: Record<string, PipeBlueprintUnion>;\n concept_registry?: Record<string, ConceptInfo>;\n}\n\nexport function graphSpecMode(\n spec: Pick<GraphSpec, \"meta\"> | null | undefined,\n): GraphSpecMode | undefined {\n return spec?.meta?.mode;\n}\n\nexport function isStaticGraphSpec(spec: Pick<GraphSpec, \"meta\"> | null | undefined): boolean {\n return graphSpecMode(spec) === GRAPH_SPEC_MODE.STATIC;\n}\n\nexport function isDryGraphSpec(spec: Pick<GraphSpec, \"meta\"> | null | undefined): boolean {\n return graphSpecMode(spec) === GRAPH_SPEC_MODE.DRY;\n}\n\n// ─── Dataflow analysis result ───────────────────────────────────────────────\n\n/** One stuff as the dataflow analysis registers it, from the first io item naming its digest. */\nexport interface StuffRegistryEntry {\n name: string;\n concept?: string;\n multiplicity?: StuffMultiplicity;\n contentType?: string;\n}\n\nexport interface DataflowAnalysis {\n readonly stuffRegistry: Readonly<Record<string, StuffRegistryEntry>>;\n /**\n * Every operator that writes each stuff. Usually one; a condition's output has one per\n * outcome, because every outcome writes the condition's one slot and only one of them runs.\n */\n readonly stuffProducers: Readonly<Record<string, readonly string[]>>;\n readonly stuffConsumers: Readonly<Record<string, readonly string[]>>;\n readonly controllerNodeIds: ReadonlySet<string>;\n readonly childNodeIds: ReadonlySet<string>;\n readonly containmentTree: Readonly<Record<string, readonly string[]>>;\n}\n\n// ─── Graph configuration ────────────────────────────────────────────────────\n\nexport const GRAPH_DIRECTION = {\n TB: \"TB\",\n BT: \"BT\",\n LR: \"LR\",\n RL: \"RL\",\n} as const;\n\nexport type GraphDirection = (typeof GRAPH_DIRECTION)[keyof typeof GRAPH_DIRECTION];\n\nexport const EDGE_TYPE = {\n /** Bezier curve — ReactFlow v12 renamed this type from \"bezier\" to \"default\". */\n DEFAULT: \"default\",\n STEP: \"step\",\n STRAIGHT: \"straight\",\n SMOOTH_STEP: \"smoothstep\",\n} as const;\n\nexport type EdgeType = (typeof EDGE_TYPE)[keyof typeof EDGE_TYPE];\n\nexport const FOLD_MODE = {\n /** Every pipe controller folded into a single pipe card. */\n FOLDED: \"folded\",\n /** Every pipe controller expanded as a group wrapper. */\n EXPANDED: \"expanded\",\n /** Renderer decides — reserved for future heuristics; currently behaves like EXPANDED. */\n AUTO: \"auto\",\n} as const;\n\nexport type FoldMode = (typeof FOLD_MODE)[keyof typeof FOLD_MODE];\n\n/**\n * The *resolved* binary theme — the value that actually drives the palette and\n * the container class. `getPaletteForTheme` takes this. `system` is never a\n * resolved theme; it resolves to one of these via the environment.\n */\nexport const GRAPH_THEME = {\n DARK: \"dark\",\n LIGHT: \"light\",\n} as const;\n\nexport type GraphTheme = (typeof GRAPH_THEME)[keyof typeof GRAPH_THEME];\n\n/**\n * The user's theme *selection* — what the toolbar cycles, what gets persisted\n * and reported. `system` follows the host environment (browser `prefers-color-scheme`\n * or an injected `systemTheme`) and resolves to a binary `GraphTheme` at render\n * time. The `dark`/`light` overlap with `GraphTheme` is intentional: a resolved\n * theme is also a valid mode.\n */\nexport const GRAPH_THEME_MODE = {\n DARK: \"dark\",\n LIGHT: \"light\",\n SYSTEM: \"system\",\n} as const;\n\nexport type GraphThemeMode = (typeof GRAPH_THEME_MODE)[keyof typeof GRAPH_THEME_MODE];\n\n/**\n * Anchor for the built-in floating toolbar. The values match ReactFlow's\n * `PanelPosition` union exactly, so they pass straight to `<Panel position=…>`\n * (the React layer asserts that subset relationship at compile time). Orientation\n * is *derived* from the position, never configured independently — see\n * `toolbarOrientation`: only the two edge-center anchors are vertical, everything\n * else (corners + top/bottom-center) is a horizontal bar.\n *\n * `types.ts` stays React-free, so `PanelPosition` is intentionally NOT imported\n * here — the compatibility assertion lives in `GraphToolbar.tsx`.\n */\nexport const TOOLBAR_POSITION = {\n TOP_LEFT: \"top-left\",\n TOP_CENTER: \"top-center\",\n TOP_RIGHT: \"top-right\",\n BOTTOM_LEFT: \"bottom-left\",\n BOTTOM_CENTER: \"bottom-center\",\n BOTTOM_RIGHT: \"bottom-right\",\n CENTER_LEFT: \"center-left\",\n CENTER_RIGHT: \"center-right\",\n} as const;\n\nexport type ToolbarPosition = (typeof TOOLBAR_POSITION)[keyof typeof TOOLBAR_POSITION];\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\n/**\n * Derive the bar orientation from its anchor. \"Corners are horizontal, edges\n * decide the rest\": only `center-left` / `center-right` produce a vertical bar;\n * every other position (the four corners plus `top-center` / `bottom-center`) is\n * horizontal. Pure + React-free so it is unit-testable without rendering.\n */\nexport function toolbarOrientation(position: ToolbarPosition): ToolbarOrientation {\n return position === TOOLBAR_POSITION.CENTER_LEFT || position === TOOLBAR_POSITION.CENTER_RIGHT\n ? \"vertical\"\n : \"horizontal\";\n}\n\nexport type ToolbarSide = \"left\" | \"center\" | \"right\";\n\n/**\n * Derive which edge the anchor hugs. The built-in `DetailPanel` overlays the\n * right edge, so only right-side anchors (`*-right`) need to dodge it — the\n * toolbar reads this to decide whether to shift left while the panel is open.\n * Pure + React-free so it is unit-testable without rendering, and exhaustively\n * switched so adding a `TOOLBAR_POSITION` value without a side fails to compile\n * — exactly like {@link toolbarOrientation}.\n */\nexport function toolbarSide(position: ToolbarPosition): ToolbarSide {\n switch (position) {\n case TOOLBAR_POSITION.TOP_LEFT:\n case TOOLBAR_POSITION.CENTER_LEFT:\n case TOOLBAR_POSITION.BOTTOM_LEFT:\n return \"left\";\n case TOOLBAR_POSITION.TOP_RIGHT:\n case TOOLBAR_POSITION.CENTER_RIGHT:\n case TOOLBAR_POSITION.BOTTOM_RIGHT:\n return \"right\";\n case TOOLBAR_POSITION.TOP_CENTER:\n case TOOLBAR_POSITION.BOTTOM_CENTER:\n return \"center\";\n default: {\n const _exhaustive: never = position;\n return _exhaustive;\n }\n }\n}\n\n// ─── Validation status (toolbar widget) ──────────────────────────────────────\n\n/**\n * State of the toolbar's validation widget. The widget itself is opt-in: it\n * renders only when the host passes a `validationState` to `GraphViewer` —\n * `undefined` (the default) keeps it hidden entirely. The states describe the\n * host's validation lifecycle, not the static analyzer's: `validating` while a\n * verdict is being produced, `valid`/`invalid` once one exists, and `error`\n * when no verdict could be produced at all (validator unavailable, timeout…).\n * `unvalidated` is for a host with no validator at all, such as a page drawing\n * a method from its source: no verdict exists or is coming, and the issues are\n * what reading the source turned up.\n */\nexport const VALIDATION_STATE = {\n VALIDATING: \"validating\",\n VALID: \"valid\",\n INVALID: \"invalid\",\n ERROR: \"error\",\n UNVALIDATED: \"unvalidated\",\n} as const;\n\nexport type ValidationState = (typeof VALIDATION_STATE)[keyof typeof VALIDATION_STATE];\n\n/**\n * One issue row in the validation panel. Mostly presentation: the host decides\n * which issues to show for each state (its validator's errors, the static\n * analyzer's diagnostics, or a mix) and handles navigation on row click. The\n * only fields the viewer interprets are the optional targeting fields\n * (`pipeRef` / `nodeId`), which drive node decorations on the graph.\n */\nexport interface ValidationIssue {\n severity: \"error\" | \"warning\";\n message: string;\n /** Short locator chip, e.g. `pipe.analyze_candidate` or a TOML path. */\n context?: string;\n /** Owning-file basename, when the issue lives in a specific file. */\n file?: string;\n /** Human-readable suggested fix, when the validator derived one. */\n suggestedFix?: string;\n /** Which analyzer produced the issue: the host's validator or the static parser. */\n origin?: \"validator\" | \"static\";\n /**\n * Fully-qualified pipe ref (`domain_code.pipe_code`, see `makePipeRef`) this\n * issue targets — decorates every rendered node invoking that pipe (a pipe\n * can be invoked from several places in the graph). Always qualified, never a\n * bare code: two domains may declare the same pipe code, and a bare match\n * would ring every same-code node. An emitter that cannot qualify must leave\n * the issue untargeted (panel-only) rather than decorate by guess.\n */\n pipeRef?: string;\n /**\n * Precise invocation this issue targets — a GraphSpec node id (e.g.\n * `demo.main_flow/step_2`). Takes precedence over `pipeRef` when both are\n * set. Issues with neither targeting field stay panel-only.\n */\n nodeId?: string;\n}\n\n/**\n * Aggregated validation decoration for one rendered node — derived from the\n * targeted `ValidationIssue`s by `buildValidationDecorations` (worst severity\n * wins, folded controllers roll up their hidden descendants' issues). Rendered\n * as a severity ring + count badge on the node, with `lines` as the tooltip.\n */\nexport interface NodeValidationSummary {\n /** Worst severity among the node's issues (`error` wins over `warning`). */\n severity: \"error\" | \"warning\";\n /** Number of issue hits on the node (a multi-instance pipe counts per invocation). */\n count: number;\n /** Tooltip lines: each issue's message, followed by a `Fix: …` line when present. */\n lines: string[];\n}\n\nexport interface GraphConfig {\n direction?: GraphDirection;\n showControllers?: boolean;\n foldMode?: FoldMode;\n /**\n * Theme *mode*: `dark | light | system`. `system` follows the host environment.\n * Defaults to `system` (see `DEFAULT_GRAPH_CONFIG`). Pass `dark`/`light` to pin\n * a fixed appearance.\n */\n theme?: GraphThemeMode;\n /**\n * Anchor for the built-in floating toolbar (default `top-right`). Orientation\n * is derived from the position — see {@link toolbarOrientation}. The\n * `toolbarPosition` *prop* on `GraphViewer` takes precedence over this; both\n * are reactive and persistence is the host's responsibility.\n */\n toolbarPosition?: ToolbarPosition;\n nodesep?: number;\n ranksep?: number;\n edgeType?: EdgeType;\n initialZoom?: number | null;\n panToTop?: boolean;\n paletteColors?: Record<string, string>;\n}\n\n// ─── Label descriptors ──────────────────────────────────────────────────────\n// Plain objects, no React dependency. GraphViewer maps these to React elements.\n\nexport type LabelDescriptor =\n | { kind: \"pipe\"; label: string; isFailed: boolean }\n | { kind: \"stuff\"; label: string; concept: string };\n\n// ─── Fold toggle options ────────────────────────────────────────────────────\n// Passed by UI click handlers so the orchestrator can decide whether the\n// toggle should propagate to \"cousin\" controllers (other instances of the\n// same pipe) or affect only the clicked one.\n\nexport interface FoldToggleOptions {\n /**\n * When `true`, the toggle applies only to the clicked controller — its\n * cousins (other controller nodes sharing the same `pipe_code`) are left\n * untouched. Wired to the alt/option modifier key in the click handlers.\n */\n soloMode?: boolean;\n}\n\n// ─── Pipe card payload ──────────────────────────────────────────────────────\n// Built by graphBuilders, consumed by PipeCardNode in the React layer.\n\nexport interface PipeCardPayload {\n pipeCode: string;\n pipeType: NodePipeType;\n description?: string;\n status: PipeStatus;\n graphMode?: GraphSpecMode;\n inputs: { name: string; concept: string }[];\n outputs: { name: string; concept: string }[];\n /** Authored/static annotations and runtime tags carried by the GraphSpec node. */\n tags?: Record<string, string>;\n /** Layout direction — injected by the layout engine */\n direction?: \"LR\" | \"TB\";\n /** When set, the card renders an unfold button that invokes this callback. */\n onExpand?: (options?: FoldToggleOptions) => void;\n /** Validation decoration (severity ring + count badge), stamped by GraphViewer. */\n validation?: NodeValidationSummary;\n /** Badge click handler (opens the validation panel), stamped alongside `validation`. */\n onValidationBadgeClick?: () => void;\n}\n\n// ─── Graph node data ────────────────────────────────────────────────────────\n// Extends Record<string, unknown> for ReactFlow's Node<T> generic parameter.\n\nexport type StuffRole = \"input\" | \"output\" | \"combined\";\n\nexport interface GraphNodeData extends Record<string, unknown> {\n labelDescriptor?: LabelDescriptor;\n label?: unknown;\n nodeData?: GraphSpecNode;\n isPipe: boolean;\n isStuff: boolean;\n isController?: boolean;\n labelText: string;\n pipeCode?: string;\n pipeType?: NodePipeType;\n graphMode?: GraphSpecMode;\n pipeCardData?: PipeCardPayload;\n /** For stuff nodes: \"input\" (no producer), \"output\" (no consumer), or undefined (intermediate). */\n stuffRole?: StuffRole;\n /** For stuff nodes: the digest used to build the node ID. */\n stuffDigest?: string;\n /** Validation decoration (severity ring + count badge), stamped by GraphViewer. */\n validation?: NodeValidationSummary;\n /** Badge click handler (opens the validation panel), stamped alongside `validation`. */\n onValidationBadgeClick?: () => void;\n}\n\n// ─── Graph node / edge / data ───────────────────────────────────────────────\n\nexport interface GraphNode {\n id: string;\n type: string;\n data: GraphNodeData;\n position: { x: number; y: number };\n style?: Record<string, string | number>;\n sourcePosition?: \"top\" | \"bottom\" | \"left\" | \"right\";\n targetPosition?: \"top\" | \"bottom\" | \"left\" | \"right\";\n parentId?: string;\n extent?: \"parent\";\n selected?: boolean;\n}\n\nexport interface GraphEdge {\n id: string;\n source: string;\n target: string;\n type: string;\n animated?: boolean;\n label?: string;\n labelStyle?: Record<string, string | number>;\n labelBgStyle?: Record<string, string | number>;\n labelBgPadding?: [number, number];\n labelBgBorderRadius?: number;\n style?: Record<string, string | number>;\n markerEnd?: { type: string; color: string };\n _batchEdge?: boolean;\n _crossGroup?: boolean;\n}\n\nexport interface GraphData {\n nodes: GraphNode[];\n edges: GraphEdge[];\n}\n\n// ─── Layout ─────────────────────────────────────────────────────────────────\n\nexport interface LayoutConfig {\n nodesep?: number;\n ranksep?: number;\n}\n\n// Controller padding constants (shared between layout and controller modules)\nexport const CONTROLLER_PADDING_X = 40;\nexport const CONTROLLER_PADDING_TOP = 48;\nexport const CONTROLLER_PADDING_BOTTOM = 20;\n\n// Default marker type string (avoids ReactFlow dependency in pure modules)\nexport const ARROW_CLOSED_MARKER = \"arrowclosed\";\n\n// ─── Node dimension helpers ─────────────────────────────────────────────────\n// Extract dimensions from style. Used by buildControllerNodes.\n// NOT used by getLayoutedElements, which estimates dimensions before styles exist.\n\nexport function nodeWidth(n: GraphNode): number {\n const raw = n.style?.width;\n if (raw == null) return 200;\n const w = typeof raw === \"number\" ? raw : parseFloat(raw);\n return isNaN(w) || w <= 0 ? 200 : w;\n}\n\nexport function nodeHeight(n: GraphNode): number {\n const raw = n.style?.height;\n if (raw != null) {\n const h = typeof raw === \"number\" ? raw : parseFloat(raw);\n if (!isNaN(h) && h > 0) return h;\n }\n return n.data?.isStuff ? 60 : 70;\n}\n"],"mappings":"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","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
GRAPH_THEME,
|
|
5
5
|
GRAPH_THEME_MODE,
|
|
6
6
|
TOOLBAR_POSITION
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3I3ZPYMW.js";
|
|
8
8
|
import {
|
|
9
9
|
__spreadProps,
|
|
10
10
|
__spreadValues
|
|
@@ -192,4 +192,4 @@ export {
|
|
|
192
192
|
DEFAULT_GRAPH_CONFIG,
|
|
193
193
|
getPaletteColors
|
|
194
194
|
};
|
|
195
|
-
//# sourceMappingURL=chunk-
|
|
195
|
+
//# sourceMappingURL=chunk-Y46574OW.js.map
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2N65P32H.js";
|
|
4
4
|
import {
|
|
5
5
|
ARROW_CLOSED_MARKER,
|
|
6
|
+
BINDING_STEP_TYPE,
|
|
6
7
|
CONTROLLER_PADDING_BOTTOM,
|
|
7
8
|
CONTROLLER_PADDING_TOP,
|
|
8
9
|
CONTROLLER_PADDING_X,
|
|
@@ -11,13 +12,14 @@ import {
|
|
|
11
12
|
NODE_TYPE_PIPE_CARD,
|
|
12
13
|
NODE_TYPE_STUFF,
|
|
13
14
|
graphSpecMode,
|
|
15
|
+
isBindingNode,
|
|
14
16
|
isStuffNodeId,
|
|
15
17
|
multiplicitySuffix,
|
|
16
18
|
nodeHeight,
|
|
17
19
|
nodeWidth,
|
|
18
20
|
stuffDigestFromId,
|
|
19
21
|
stuffNodeId
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3I3ZPYMW.js";
|
|
21
23
|
import {
|
|
22
24
|
__objRest,
|
|
23
25
|
__spreadProps,
|
|
@@ -42,6 +44,11 @@ var PIPE_STATUSES = /* @__PURE__ */ new Set([
|
|
|
42
44
|
"canceled"
|
|
43
45
|
]);
|
|
44
46
|
var GRAPH_SPEC_MODES = /* @__PURE__ */ new Set(["dry", "live", "static"]);
|
|
47
|
+
var DRAWN_NODE_KINDS = /* @__PURE__ */ new Set([
|
|
48
|
+
"controller",
|
|
49
|
+
"operator",
|
|
50
|
+
"binding"
|
|
51
|
+
]);
|
|
45
52
|
var EDGE_KINDS = /* @__PURE__ */ new Set([
|
|
46
53
|
"contains",
|
|
47
54
|
"data",
|
|
@@ -170,10 +177,10 @@ function validateNode(node, path) {
|
|
|
170
177
|
fail(path, `expected an object, got ${describe(node)}`);
|
|
171
178
|
}
|
|
172
179
|
requireNonEmptyString(node.id, `${path}.id`);
|
|
173
|
-
if (
|
|
180
|
+
if (!DRAWN_NODE_KINDS.has(node.kind)) {
|
|
174
181
|
fail(
|
|
175
182
|
`${path}.kind`,
|
|
176
|
-
`expected "controller" or "
|
|
183
|
+
`expected "controller", "operator" or "binding" \u2014 a real pipelex run emits only pipe-call and binding nodes, got ${JSON.stringify(node.kind)}`
|
|
177
184
|
);
|
|
178
185
|
}
|
|
179
186
|
if (typeof node.status !== "string" || !PIPE_STATUSES.has(node.status)) {
|
|
@@ -184,7 +191,14 @@ function validateNode(node, path) {
|
|
|
184
191
|
}
|
|
185
192
|
requireNonEmptyString(node.pipe_code, `${path}.pipe_code`);
|
|
186
193
|
const pipeType = requireNonEmptyString(node.pipe_type, `${path}.pipe_type`);
|
|
187
|
-
if (
|
|
194
|
+
if (node.kind === "binding") {
|
|
195
|
+
if (pipeType !== BINDING_STEP_TYPE) {
|
|
196
|
+
fail(
|
|
197
|
+
`${path}.pipe_type`,
|
|
198
|
+
`expected "${BINDING_STEP_TYPE}" on a binding node, got ${JSON.stringify(pipeType)}`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
} else if (!KNOWN_PIPE_TYPES.has(pipeType)) {
|
|
188
202
|
fail(
|
|
189
203
|
`${path}.pipe_type`,
|
|
190
204
|
`unrecognized pipe class "${pipeType}" \u2014 add it to PipeOperatorType or PipeControllerType in types.ts`
|
|
@@ -289,6 +303,19 @@ function asPipeCallNode(node, path = "node") {
|
|
|
289
303
|
requireNonEmptyString(node.pipe_code, `${path}.pipe_code`);
|
|
290
304
|
return node;
|
|
291
305
|
}
|
|
306
|
+
function asCardNode(node, path = "node") {
|
|
307
|
+
if (node.kind === "binding") {
|
|
308
|
+
requireNonEmptyString(node.pipe_code, `${path}.pipe_code`);
|
|
309
|
+
if (node.pipe_type !== BINDING_STEP_TYPE) {
|
|
310
|
+
fail(
|
|
311
|
+
`${path}.pipe_type`,
|
|
312
|
+
`expected "${BINDING_STEP_TYPE}" on a binding node, got ${JSON.stringify(node.pipe_type)}`
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
return node;
|
|
316
|
+
}
|
|
317
|
+
return asPipeCallNode(node, path);
|
|
318
|
+
}
|
|
292
319
|
|
|
293
320
|
// src/graph/graphAnalysis.ts
|
|
294
321
|
function buildDataflowAnalysis(graphspec) {
|
|
@@ -319,7 +346,8 @@ function buildDataflowAnalysis(graphspec) {
|
|
|
319
346
|
};
|
|
320
347
|
}
|
|
321
348
|
if (output.digest && !isController) {
|
|
322
|
-
stuffProducers[output.digest] =
|
|
349
|
+
if (!stuffProducers[output.digest]) stuffProducers[output.digest] = [];
|
|
350
|
+
stuffProducers[output.digest].push(node.id);
|
|
323
351
|
}
|
|
324
352
|
}
|
|
325
353
|
for (const input of nodeIo.inputs) {
|
|
@@ -353,9 +381,9 @@ function buildChildToControllerMap(graphspec, analysis) {
|
|
|
353
381
|
childToController[childId] = ctrlId;
|
|
354
382
|
}
|
|
355
383
|
}
|
|
356
|
-
for (const [digest,
|
|
384
|
+
for (const [digest, producerIds] of Object.entries(analysis.stuffProducers)) {
|
|
357
385
|
const stuffId = "stuff_" + digest;
|
|
358
|
-
const ctrlId = childToController
|
|
386
|
+
const ctrlId = commonController(producerIds, childToController);
|
|
359
387
|
if (ctrlId) {
|
|
360
388
|
childToController[stuffId] = ctrlId;
|
|
361
389
|
}
|
|
@@ -418,6 +446,16 @@ function buildChildToControllerMap(graphspec, analysis) {
|
|
|
418
446
|
}
|
|
419
447
|
return childToController;
|
|
420
448
|
}
|
|
449
|
+
function commonController(nodeIds, childToController) {
|
|
450
|
+
if (nodeIds.length === 0) return void 0;
|
|
451
|
+
let candidate = childToController[nodeIds[0]];
|
|
452
|
+
while (candidate) {
|
|
453
|
+
const ctrl = candidate;
|
|
454
|
+
if (nodeIds.every((id) => isDescendantOf(id, ctrl, childToController))) return ctrl;
|
|
455
|
+
candidate = childToController[ctrl];
|
|
456
|
+
}
|
|
457
|
+
return void 0;
|
|
458
|
+
}
|
|
421
459
|
function isDescendantOf(nodeId, ancestorCtrlId, childToController) {
|
|
422
460
|
let current = childToController[nodeId];
|
|
423
461
|
while (current) {
|
|
@@ -470,7 +508,7 @@ var STUFF_CHAR_WIDTH_PX = 7;
|
|
|
470
508
|
var STUFF_LABEL_PADDING = 48;
|
|
471
509
|
var MIN_STUFF_WIDTH = 140;
|
|
472
510
|
function buildDataflowGraph(graphspec, analysis, edgeType) {
|
|
473
|
-
var _a;
|
|
511
|
+
var _a, _b;
|
|
474
512
|
const nodes = [];
|
|
475
513
|
const edges = [];
|
|
476
514
|
const graphMode = graphSpecMode(graphspec);
|
|
@@ -481,8 +519,10 @@ function buildDataflowGraph(graphspec, analysis, edgeType) {
|
|
|
481
519
|
}
|
|
482
520
|
}
|
|
483
521
|
const participatingPipes = /* @__PURE__ */ new Set();
|
|
484
|
-
for (const
|
|
485
|
-
|
|
522
|
+
for (const producers of Object.values(analysis.stuffProducers)) {
|
|
523
|
+
for (const producer of producers) {
|
|
524
|
+
participatingPipes.add(producer);
|
|
525
|
+
}
|
|
486
526
|
}
|
|
487
527
|
for (const consumers of Object.values(analysis.stuffConsumers)) {
|
|
488
528
|
for (const consumer of consumers) {
|
|
@@ -490,8 +530,8 @@ function buildDataflowGraph(graphspec, analysis, edgeType) {
|
|
|
490
530
|
}
|
|
491
531
|
}
|
|
492
532
|
for (const node of graphspec.nodes) {
|
|
493
|
-
if (!participatingPipes.has(node.id)) continue;
|
|
494
|
-
const pipeNode =
|
|
533
|
+
if (!participatingPipes.has(node.id) && !isBindingNode(node)) continue;
|
|
534
|
+
const pipeNode = asCardNode(node, `nodes[${node.id}]`);
|
|
495
535
|
const isFailed = pipeNode.status === "failed";
|
|
496
536
|
const label = pipeNode.pipe_code;
|
|
497
537
|
const pipeCardData = buildPipeCardPayload(pipeNode, graphMode);
|
|
@@ -519,8 +559,8 @@ function buildDataflowGraph(graphspec, analysis, edgeType) {
|
|
|
519
559
|
const textWidth = Math.max(label.length, concept.length) * STUFF_CHAR_WIDTH_PX + STUFF_LABEL_PADDING;
|
|
520
560
|
const stuffWidth = Math.max(MIN_STUFF_WIDTH, textWidth);
|
|
521
561
|
const isCombined = combinedStuffDigests.has(digest);
|
|
522
|
-
const isInput = !analysis.stuffProducers[digest] && !isCombined;
|
|
523
|
-
const isOutput = !isInput && !isCombined && !((
|
|
562
|
+
const isInput = !((_a = analysis.stuffProducers[digest]) == null ? void 0 : _a.length) && !isCombined;
|
|
563
|
+
const isOutput = !isInput && !isCombined && !((_b = analysis.stuffConsumers[digest]) == null ? void 0 : _b.length);
|
|
524
564
|
const stuffRole = isCombined ? "combined" : isInput ? "input" : isOutput ? "output" : void 0;
|
|
525
565
|
const borderColor = isInput ? "var(--color-stuff-input-border, #50FA7B)" : isOutput ? "var(--color-stuff-output-border, #a78bfa)" : isCombined ? "var(--color-parallel-combine)" : "var(--color-stuff-border)";
|
|
526
566
|
nodes.push({
|
|
@@ -546,20 +586,22 @@ function buildDataflowGraph(graphspec, analysis, edgeType) {
|
|
|
546
586
|
});
|
|
547
587
|
}
|
|
548
588
|
let edgeId = 0;
|
|
549
|
-
for (const [digest,
|
|
589
|
+
for (const [digest, producers] of Object.entries(analysis.stuffProducers)) {
|
|
550
590
|
const stuffId = stuffNodeId(digest);
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
591
|
+
for (const producerNodeId of producers) {
|
|
592
|
+
edges.push({
|
|
593
|
+
id: "edge_" + edgeId++,
|
|
594
|
+
source: producerNodeId,
|
|
595
|
+
target: stuffId,
|
|
596
|
+
type: edgeType,
|
|
597
|
+
animated: false,
|
|
598
|
+
style: { stroke: "var(--color-edge)", strokeWidth: 2 },
|
|
599
|
+
markerEnd: {
|
|
600
|
+
type: ARROW_CLOSED_MARKER,
|
|
601
|
+
color: "var(--color-edge)"
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
}
|
|
563
605
|
}
|
|
564
606
|
for (const [digest, consumers] of Object.entries(analysis.stuffConsumers)) {
|
|
565
607
|
const stuffId = stuffNodeId(digest);
|
|
@@ -659,7 +701,7 @@ function buildDataflowGraph(graphspec, analysis, edgeType) {
|
|
|
659
701
|
function buildGraph(graphspec, edgeType) {
|
|
660
702
|
if (graphspec) {
|
|
661
703
|
const analysis = buildDataflowAnalysis(graphspec);
|
|
662
|
-
if (analysis && (Object.keys(analysis.stuffProducers).length > 0 || Object.keys(analysis.stuffConsumers).length > 0)) {
|
|
704
|
+
if (analysis && (Object.keys(analysis.stuffProducers).length > 0 || Object.keys(analysis.stuffConsumers).length > 0 || graphspec.nodes.some(isBindingNode))) {
|
|
663
705
|
return { graphData: buildDataflowGraph(graphspec, analysis, edgeType), analysis };
|
|
664
706
|
}
|
|
665
707
|
}
|
|
@@ -807,8 +849,12 @@ function applyFolds(graphData, analysis, graphspec, foldedSet, onToggleFold) {
|
|
|
807
849
|
for (const child of children) updatedChildNodeIds.add(child);
|
|
808
850
|
}
|
|
809
851
|
const updatedStuffProducers = {};
|
|
810
|
-
for (const [digest,
|
|
811
|
-
|
|
852
|
+
for (const [digest, producers] of Object.entries(analysis.stuffProducers)) {
|
|
853
|
+
const seen = /* @__PURE__ */ new Set();
|
|
854
|
+
for (const producerId of producers) {
|
|
855
|
+
seen.add(effectiveId(producerId, childToCtrl, foldedSet));
|
|
856
|
+
}
|
|
857
|
+
updatedStuffProducers[digest] = [...seen];
|
|
812
858
|
}
|
|
813
859
|
const updatedStuffConsumers = {};
|
|
814
860
|
for (const [digest, consumers] of Object.entries(analysis.stuffConsumers)) {
|
|
@@ -883,7 +929,7 @@ function issueTargetIds(issue, graphspec) {
|
|
|
883
929
|
if (issue.nodeId) return [issue.nodeId];
|
|
884
930
|
if (issue.pipeRef) {
|
|
885
931
|
return graphspec.nodes.filter(
|
|
886
|
-
(n) => n.domain_code !== void 0 && n.pipe_code !== void 0 && makePipeRef(n.domain_code, n.pipe_code) === issue.pipeRef
|
|
932
|
+
(n) => !isBindingNode(n) && n.domain_code !== void 0 && n.pipe_code !== void 0 && makePipeRef(n.domain_code, n.pipe_code) === issue.pipeRef
|
|
887
933
|
).map((n) => n.id);
|
|
888
934
|
}
|
|
889
935
|
return [];
|
|
@@ -938,7 +984,7 @@ function applyValidationDecorations(nodes, decorations, onBadgeClick) {
|
|
|
938
984
|
|
|
939
985
|
// src/graph/stuffLookup.ts
|
|
940
986
|
function pipeRefOf(node) {
|
|
941
|
-
if (!node.pipe_code || !node.domain_code) return void 0;
|
|
987
|
+
if (isBindingNode(node) || !node.pipe_code || !node.domain_code) return void 0;
|
|
942
988
|
return makePipeRef(node.domain_code, node.pipe_code);
|
|
943
989
|
}
|
|
944
990
|
function findStuffByDigest(spec, digest) {
|
|
@@ -1532,7 +1578,7 @@ function applyControllers(layoutedNodes, layoutedEdges, graphspec, analysis, sho
|
|
|
1532
1578
|
const controllerTypeMap = {};
|
|
1533
1579
|
for (const node of graphspec.nodes) {
|
|
1534
1580
|
if (analysis.controllerNodeIds.has(node.id)) {
|
|
1535
|
-
controllerTypeMap[node.id] = node.pipe_type;
|
|
1581
|
+
controllerTypeMap[node.id] = asPipeCallNode(node, `nodes[${node.id}]`).pipe_type;
|
|
1536
1582
|
}
|
|
1537
1583
|
}
|
|
1538
1584
|
for (const ctrlId of analysis.controllerNodeIds) {
|
|
@@ -1636,6 +1682,7 @@ export {
|
|
|
1636
1682
|
GraphSpecValidationError,
|
|
1637
1683
|
validateGraphSpec,
|
|
1638
1684
|
asPipeCallNode,
|
|
1685
|
+
asCardNode,
|
|
1639
1686
|
buildDataflowAnalysis,
|
|
1640
1687
|
buildChildToControllerMap,
|
|
1641
1688
|
getPipeBlueprint,
|
|
@@ -1663,4 +1710,4 @@ export {
|
|
|
1663
1710
|
buildControllerNodes,
|
|
1664
1711
|
applyControllers
|
|
1665
1712
|
};
|
|
1666
|
-
//# sourceMappingURL=chunk-
|
|
1713
|
+
//# sourceMappingURL=chunk-ZTXSDTVF.js.map
|