@pipelex/mthds-ui 0.34.1 → 0.35.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ARROW_CLOSED_MARKER, B as BINDING_STEP_TYPE, z as BindingNode, H as BindingStepSpec, I as BindingStepType, J as CONTROLLER_PADDING_BOTTOM, K as CONTROLLER_PADDING_TOP, M as CONTROLLER_PADDING_X, r as CardNode, C as ConceptInfo, D as DataflowAnalysis, O as EDGE_TYPE, Q as EDGE_TYPE_ROUTED, E as EdgeRoute, R as EdgeType, U as FOLD_MODE, W as FieldResolution, F as FoldMode, n as FoldToggleOptions, X as GRAPH_DIRECTION, Y as GRAPH_SPEC_MODE, Z as GRAPH_STYLE, _ as GRAPH_THEME, $ as GRAPH_THEME_MODE, f as GraphConfig, t as GraphData, g as GraphDirection, d as GraphEdge, e as GraphNode, c as GraphNodeData, w as GraphPoint, b as GraphSpec, a0 as GraphSpecEdge, a1 as GraphSpecEdgeKind, a2 as GraphSpecMeta, u as GraphSpecMode, a3 as GraphSpecModelUsage, p as GraphSpecNode, a4 as GraphSpecNodeError, a5 as GraphSpecNodeIo, k as GraphSpecNodeIoItem, a6 as GraphSpecNodeTiming, a7 as GraphSpecNodeUsage, a8 as GraphSpecUsage, i as GraphStyleId, G as GraphTheme, h as GraphThemeMode, a9 as JudgmentQuestionSpec, aa as KNOWN_PIPE_TYPES, L as LabelDescriptor, v as LayoutConfig, ab as NODE_TYPE_CONTROLLER, ac as NODE_TYPE_PIPE_CARD, ad as NODE_TYPE_SIMPLE_DECISION, ae as NODE_TYPE_SIMPLE_FRAME, af as NODE_TYPE_SIMPLE_STEP, ag as NODE_TYPE_SIMPLE_TERMINAL, ah as NODE_TYPE_STUFF, ai as NodeKind, x as NodePipeType, N as NodeValidationSummary, aj as PipeBatchBlueprint, ak as PipeBlueprintBase, P as PipeBlueprintUnion, s as PipeCallNode, o as PipeCardPayload, al as PipeComposeBlueprint, am as PipeComposeConstructBlueprint, an as PipeComposeConstructField, ao as PipeConditionBlueprint, m as PipeControllerType, ap as PipeDocGenBlueprint, aq as PipeExtractBlueprint, ar as PipeFuncBlueprint, as as PipeImgGenBlueprint, at as PipeJudgeBlueprint, au as PipeLLMBlueprint, q as PipeOperatorType, av as PipeParallelBlueprint, aw as PipeSearchBlueprint, ax as PipeSequenceBlueprint, ay as PipeSignatureBlueprint, j as PipeStatus, az as PipeStructureBlueprint, aA as PipeType, a as PresenceMarker, aB as STEP_CATEGORY, aC as STUFF_ID_PREFIX, aD as SequenceStepSpec, aE as SimpleNodePayload, S as SimpleTitleFit, y as StepCategory, aF as StuffMultiplicity, aG as StuffRegistryEntry, aH as StuffRole, aI as StuffSpecInfo, aJ as SubPipeSpec, aK as TOOLBAR_POSITION, aL as TemplateBlueprint, aM as ToolbarOrientation, T as ToolbarPosition, aN as ToolbarSide, aO as VALIDATION_STATE, V as ValidationIssue, l as ValidationState, aP as graphSpecMode, aQ as isBindingNode, aR as isBindingStepSpec, aS as isDryGraphSpec, aT as isPluralMultiplicity, aU as isStaticGraphSpec, aV as isStuffNodeId, aW as multiplicitySuffix, aX as nodeHeight, aY as nodeWidth, aZ as stuffDigestFromId, a_ as stuffNodeId, a$ as toolbarOrientation, b0 as toolbarSide } from './types-MvxsDLCo.js';
1
+ export { A as ARROW_CLOSED_MARKER, B as BINDING_STEP_TYPE, z as BindingNode, H as BindingStepSpec, I as BindingStepType, J as CONTROLLER_PADDING_BOTTOM, K as CONTROLLER_PADDING_TOP, M as CONTROLLER_PADDING_X, r as CardNode, C as ConceptInfo, D as DataflowAnalysis, O as EDGE_TYPE, Q as EDGE_TYPE_ROUTED, E as EdgeRoute, R as EdgeType, U as FOLD_MODE, W as FieldResolution, F as FoldMode, n as FoldToggleOptions, X as GRAPH_DIRECTION, Y as GRAPH_SPEC_MODE, Z as GRAPH_STYLE, _ as GRAPH_THEME, $ as GRAPH_THEME_MODE, g as GraphConfig, t as GraphData, h as GraphDirection, e as GraphEdge, f as GraphNode, d as GraphNodeData, w as GraphPoint, c as GraphSpec, a0 as GraphSpecEdge, a1 as GraphSpecEdgeKind, a2 as GraphSpecMeta, u as GraphSpecMode, a3 as GraphSpecModelUsage, p as GraphSpecNode, a4 as GraphSpecNodeError, a5 as GraphSpecNodeIo, k as GraphSpecNodeIoItem, a6 as GraphSpecNodeTiming, a7 as GraphSpecNodeUsage, a8 as GraphSpecUsage, i as GraphStyleId, a as GraphTheme, G as GraphThemeMode, a9 as JudgmentQuestionSpec, aa as KNOWN_PIPE_TYPES, L as LabelDescriptor, v as LayoutConfig, ab as NODE_TYPE_CONTROLLER, ac as NODE_TYPE_PIPE_CARD, ad as NODE_TYPE_SIMPLE_DECISION, ae as NODE_TYPE_SIMPLE_FRAME, af as NODE_TYPE_SIMPLE_STEP, ag as NODE_TYPE_SIMPLE_TERMINAL, ah as NODE_TYPE_STUFF, ai as NodeKind, x as NodePipeType, N as NodeValidationSummary, aj as PipeBatchBlueprint, ak as PipeBlueprintBase, P as PipeBlueprintUnion, s as PipeCallNode, o as PipeCardPayload, al as PipeComposeBlueprint, am as PipeComposeConstructBlueprint, an as PipeComposeConstructField, ao as PipeConditionBlueprint, m as PipeControllerType, ap as PipeDocGenBlueprint, aq as PipeExtractBlueprint, ar as PipeFuncBlueprint, as as PipeImgGenBlueprint, at as PipeJudgeBlueprint, au as PipeLLMBlueprint, q as PipeOperatorType, av as PipeParallelBlueprint, aw as PipeSearchBlueprint, ax as PipeSequenceBlueprint, ay as PipeSignatureBlueprint, j as PipeStatus, az as PipeStructureBlueprint, aA as PipeType, b as PresenceMarker, aB as STEP_CATEGORY, aC as STUFF_ID_PREFIX, aD as SequenceStepSpec, aE as SimpleNodePayload, S as SimpleTitleFit, y as StepCategory, aF as StuffMultiplicity, aG as StuffRegistryEntry, aH as StuffRole, aI as StuffSpecInfo, aJ as SubPipeSpec, aK as TOOLBAR_POSITION, aL as TemplateBlueprint, aM as ToolbarOrientation, T as ToolbarPosition, aN as ToolbarSide, aO as VALIDATION_STATE, V as ValidationIssue, l as ValidationState, aP as graphSpecMode, aQ as isBindingNode, aR as isBindingStepSpec, aS as isDryGraphSpec, aT as isPluralMultiplicity, aU as isStaticGraphSpec, aV as isStuffNodeId, aW as multiplicitySuffix, aX as nodeHeight, aY as nodeWidth, aZ as stuffDigestFromId, a_ as stuffNodeId, a$ as toolbarOrientation, b0 as toolbarSide } from './types-CTrrBpQf.js';
2
2
  export { ControllerRect, DARK_PALETTE_COLORS, DEFAULT_GRAPH_CONFIG, ElkPositionResult, GRAPH_STYLES, GRAPH_STYLE_IDS, GRAPH_STYLE_PIPELINES, GraphSpecValidationError, GraphStyleCapabilities, GraphStyleDescriptor, GraphStylePipeline, LIGHT_PALETTE_COLORS, LayoutResult, MAX_VISIBLE_CONTROLLER_CHILDREN, ROUTE_CORNER_RADIUS_PX, ROUTE_ENDPOINT_TOLERANCE_PX, SIMPLE_DECISION_WIDTHS, SIMPLE_FOLD_DEPTH, SIMPLE_STEP_TITLE_FITS, SIMPLE_STEP_WIDE_WIDTH, SIMPLE_STEP_WIDTH, SIMPLE_TERMINAL_WIDTH, STEP_CATEGORY_BY_PIPE_TYPE, STEP_CATEGORY_WORDS, SimpleProjection, SimpleProjectionInput, StuffLocation, StyleFrameArgs, StyleProjection, StyleProjectionArgs, WrapEstimate, aggregateStatus, applyControllers, applyFolds, applySimpleFrames, applyValidationDecorations, asCardNode, asPipeCallNode, buildChildToControllerMap, buildContainmentChain, buildControllerNodes, buildDataflowAnalysis, buildDataflowGraph, buildElkGraph, buildGraph, buildPipeCardPayload, buildValidationDecorations, conceptPlainName, estimateNodeDimensions, estimateWrap, extractAbsolutePositions, extractEdgeRoutes, findCousinControllers, findStuffByDigest, fitRoute, getConceptInfo, getLayoutedElements, getPaletteColors, getPaletteForTheme, getPipeBlueprint, humanizeIdentifier, inputPortId, isGenericConcept, isGraphStyleId, outcomeLabel, outermostFoldedAncestor, outputPortId, pipeRefOf, polylineMidpoint, projectSimpleGraph, resolveConceptRef, resolveGraphStyle, resolveIssueTargetNodeId, resolveNodeBlueprint, resolveStyleMenu, roundedPolylinePath, routeLabelCenter, sentenceCase, simpleDecisionSize, simpleDefaultFolds, simpleEdgeLabelSize, simpleStepSize, simpleTerminalSize, simpleTitleFit, simpleTitleWrap, sortParentsFirst, stripDomain, textWidthPx, validateGraphSpec } from './graph/index.js';
3
3
  export { P as ParsedPipeRef, m as makePipeRef, p as parsePipeRef } from './pipeRefs-BQJO5nh5.js';
4
4
  import 'elkjs/lib/elk-api';
@@ -0,0 +1,191 @@
1
+ /**
2
+ * The progress snapshot of the hosted progress contract, as data.
3
+ *
4
+ * A snapshot is the state of a run's progress at one moment: which invocations
5
+ * of which pipes have started, ended or been skipped, how far each batch has
6
+ * got, which outcome each condition took, and where the run is retrying or
7
+ * stuck. It is defined apart from the carriers that deliver it (a progress
8
+ * route a client polls, a frame that tells a browser to read it again, the
9
+ * state of a task on another workflow platform), so these types model the
10
+ * snapshot alone and name no carrier and no workflow engine.
11
+ *
12
+ * Field names, optionality and the closed vocabularies follow the contract
13
+ * word for word. A required field is always present, `null` where its type
14
+ * says so; an optional field is absent when it does not apply, never `null`.
15
+ * A reader ignores a member it does not know, so nothing here rejects an
16
+ * unknown field, and the fields the contract calls open strings
17
+ * (`pipe_type`, `degradation.reason`) are typed `string`.
18
+ */
19
+ /** RFC 3339 in UTC, written with `Z` in a snapshot, with fractional seconds when recorded. */
20
+ type ProgressTimestamp = string;
21
+ /** Whether the events a snapshot was projected from are a live run's or a dry run's. */
22
+ declare const PROGRESS_MODE: {
23
+ readonly LIVE: "live";
24
+ readonly DRY: "dry";
25
+ };
26
+ type ProgressMode = (typeof PROGRESS_MODE)[keyof typeof PROGRESS_MODE];
27
+ /**
28
+ * Where the run stands: accepted and not yet started, going, ended with its
29
+ * result, ended in failure, or stopped before its end.
30
+ */
31
+ declare const RUN_PROGRESS_STATUS: {
32
+ readonly PENDING: "pending";
33
+ readonly RUNNING: "running";
34
+ readonly SUCCEEDED: "succeeded";
35
+ readonly FAILED: "failed";
36
+ readonly CANCELED: "canceled";
37
+ };
38
+ type RunProgressStatus = (typeof RUN_PROGRESS_STATUS)[keyof typeof RUN_PROGRESS_STATUS];
39
+ /**
40
+ * An invocation's status. These are the words a run graph uses for its nodes,
41
+ * the same set as the graph's `PipeStatus`:
42
+ *
43
+ * - `scheduled`: an item of a batch that has fanned out, not yet started;
44
+ * - `running`: started its latest attempt and not ended it;
45
+ * - `succeeded`: ended its latest attempt with its output;
46
+ * - `failed`: ended its latest attempt in failure;
47
+ * - `skipped`: skipped in its latest attempt, a successful end with no output of its own;
48
+ * - `canceled`: had not ended when the run ended.
49
+ */
50
+ declare const INVOCATION_STATUS: {
51
+ readonly SCHEDULED: "scheduled";
52
+ readonly RUNNING: "running";
53
+ readonly SUCCEEDED: "succeeded";
54
+ readonly FAILED: "failed";
55
+ readonly SKIPPED: "skipped";
56
+ readonly CANCELED: "canceled";
57
+ };
58
+ type InvocationStatus = (typeof INVOCATION_STATUS)[keyof typeof INVOCATION_STATUS];
59
+ /** The reasons the platform emits today. `ProgressDegradation.reason` stays an open string. */
60
+ declare const DEGRADATION_REASON: {
61
+ readonly WORKFLOW_TASK_FAILING: "workflow_task_failing";
62
+ readonly STATUS_UNAVAILABLE: "status_unavailable";
63
+ };
64
+ /**
65
+ * The run status's assessment of a run that is not making progress. A snapshot
66
+ * carries it whole as its own `degradation`, and on the invocation it concerns.
67
+ * Every member is always present, `null` where its type says so.
68
+ */
69
+ interface ProgressDegradation {
70
+ /** Why the run reads degraded. An open string: show `message` for a reason you do not know. */
71
+ reason: string;
72
+ /** The assessment in words, for a person. Shown as it is, never parsed. */
73
+ message: string;
74
+ /** How many times in a row the failing execution has failed to advance. */
75
+ failed_attempts: number | null;
76
+ /** When that series of failures began, or the latest time it can have begun. */
77
+ failing_since: ProgressTimestamp | null;
78
+ /** When the platform ends the run as failed if the series is still going on then. */
79
+ ends_at: ProgressTimestamp | null;
80
+ }
81
+ /** A batch's counts of its items. An item `scheduled` or `canceled` is counted in none of the three. */
82
+ interface BatchProgress {
83
+ /** The fan-out's item count. */
84
+ total: number;
85
+ /** Items `succeeded` or `skipped`. */
86
+ done: number;
87
+ /** Items `running`. */
88
+ running: number;
89
+ /** Items `failed`. */
90
+ failed: number;
91
+ }
92
+ /** A condition's resolution. */
93
+ interface ConditionProgress {
94
+ /** The outcome map's key that matched, or `null` when the condition took its default outcome. */
95
+ selected_outcome: string | null;
96
+ }
97
+ /** The latest failure of an invocation's work, a health annotation. */
98
+ interface InvocationFailure {
99
+ /** The failure under the run's error disclosure: its own message when written for the caller, else a placeholder. */
100
+ message: string;
101
+ /** When it failed, when known. */
102
+ at?: ProgressTimestamp;
103
+ }
104
+ /** One attempt of one execution: an entry of a chain. */
105
+ interface ExecutionAttempt {
106
+ /** Opaque. Names the execution, the same in each of its attempts. */
107
+ execution: string;
108
+ /** Counts from 1. */
109
+ attempt: number;
110
+ }
111
+ /** One run of one pipe inside a run, named by its invocation path. */
112
+ interface ProgressInvocation {
113
+ /** Its invocation path, from the run's entry pipe. */
114
+ path: string;
115
+ /** The bare code of the pipe it runs, which a timeline labels its row with. */
116
+ pipe_code: string;
117
+ /** The same pipe's `pipe_ref`. */
118
+ pipe_ref: string;
119
+ /** The pipe's type, such as `PipeSequence` or `PipeLLM`: an open string. */
120
+ pipe_type: string;
121
+ status: InvocationStatus;
122
+ /** The start of its latest attempt; `null` while `scheduled`, and when no start of that attempt was recorded. */
123
+ started_at: ProgressTimestamp | null;
124
+ /** The end of its latest attempt; `null` while `scheduled` or `running`, and when `canceled`. */
125
+ ended_at: ProgressTimestamp | null;
126
+ /** On a `PipeSequence`, the number of steps its author wrote. */
127
+ step_count?: number;
128
+ /** On a `PipeParallel`, the number of its branches. */
129
+ branch_count?: number;
130
+ /** On a `skipped` invocation, why it was skipped. */
131
+ skip_reason?: string;
132
+ /** On a `PipeBatch` that has fanned out. */
133
+ batch?: BatchProgress;
134
+ /** On a `PipeCondition` that has resolved. */
135
+ condition?: ConditionProgress;
136
+ /** Health annotation: how many times its work has been tried, present only when more than once. */
137
+ attempts?: number;
138
+ /** Health annotation: the latest failure of its work. */
139
+ last_failure?: InvocationFailure;
140
+ /** Health annotation: the run is stuck at this invocation. */
141
+ degradation?: ProgressDegradation;
142
+ }
143
+ /** The state of a run's progress at one moment. */
144
+ interface ProgressSnapshot {
145
+ pipeline_run_id: string;
146
+ /** The mode of the events it was projected from. */
147
+ mode: ProgressMode;
148
+ status: RunProgressStatus;
149
+ /** What a reader compares two snapshots of one run by: the count of distinct events projected. */
150
+ version: number;
151
+ /** When the snapshot was projected. */
152
+ assembled_at: ProgressTimestamp;
153
+ /** One line saying how far the run has got. Shown as it is, never parsed. */
154
+ summary: string;
155
+ /** Present only on a snapshot of part of a run: the path of the invocation it starts at. */
156
+ root_path?: string;
157
+ /** Present only on a snapshot of part of a run: the chain of the attempt it was projected from. */
158
+ chain?: ExecutionAttempt[];
159
+ /** The run status's degradation, present when the run reads degraded. */
160
+ degradation?: ProgressDegradation;
161
+ /** Every invocation the snapshot knows, each before its descendants. */
162
+ invocations: ProgressInvocation[];
163
+ }
164
+ /** True once the run has ended: `succeeded`, `failed` or `canceled`. */
165
+ declare function isRunEnded(status: RunProgressStatus): boolean;
166
+ /**
167
+ * A timestamp as milliseconds since the epoch, keeping any precision finer than
168
+ * a millisecond as a fraction, or `null` when it is not an RFC 3339 timestamp
169
+ * in the form the contract writes (see `TIMESTAMP_PATTERN`): anything else,
170
+ * an offset-less time included, is `null` rather than whatever `Date.parse`
171
+ * makes of it, which for an offset-less time is the reader's local time.
172
+ *
173
+ * Good to well under a microsecond, which is all a bar needs. A double cannot
174
+ * hold every digit a source may record past the millisecond, so to order two
175
+ * timestamps exactly, use `compareTimestamps`.
176
+ */
177
+ declare function timestampMs(timestamp: ProgressTimestamp | null | undefined): number | null;
178
+ /**
179
+ * How two timestamps are ordered, exactly, at whatever precision they carry:
180
+ * negative when `a` is the earlier, positive when it is the later, 0 when both
181
+ * name the same moment, and `null` when either is not a timestamp.
182
+ *
183
+ * Whole milliseconds are compared first, then the digits past the millisecond
184
+ * as digits, so `…07.0340001Z` reads earlier than `…07.03400011Z`, which as
185
+ * epoch milliseconds in a double are one number. Two snapshots of one version
186
+ * are told apart by `assembled_at` alone, and the contract lets a source record
187
+ * any number of fractional digits, so the comparison never rounds them.
188
+ */
189
+ declare function compareTimestamps(a: ProgressTimestamp | null | undefined, b: ProgressTimestamp | null | undefined): number | null;
190
+
191
+ export { type BatchProgress as B, type ConditionProgress as C, DEGRADATION_REASON as D, type ExecutionAttempt as E, type InvocationStatus as I, type ProgressSnapshot as P, RUN_PROGRESS_STATUS as R, type ProgressTimestamp as a, type ProgressInvocation as b, INVOCATION_STATUS as c, type InvocationFailure as d, PROGRESS_MODE as e, type ProgressDegradation as f, type ProgressMode as g, type RunProgressStatus as h, compareTimestamps as i, isRunEnded as j, timestampMs as t };
@@ -1,4 +1,4 @@
1
- import { C as ConceptInfo, P as PipeBlueprintUnion, a as PresenceMarker, b as GraphSpec, V as ValidationIssue } from '../types-MvxsDLCo.js';
1
+ import { C as ConceptInfo, P as PipeBlueprintUnion, b as PresenceMarker, c as GraphSpec, V as ValidationIssue } from '../types-CTrrBpQf.js';
2
2
  export { P as ParsedPipeRef, m as makePipeRef, p as parsePipeRef } from '../pipeRefs-BQJO5nh5.js';
3
3
 
4
4
  type DiagnosticSeverity = "error" | "warning";
@@ -0,0 +1,339 @@
1
+ import { P as ProgressSnapshot, B as BatchProgress, I as InvocationStatus, b as ProgressInvocation, a as ProgressTimestamp } from '../progressSnapshot-VZ4PLul9.js';
2
+ export { C as ConditionProgress, D as DEGRADATION_REASON, E as ExecutionAttempt, c as INVOCATION_STATUS, d as InvocationFailure, e as PROGRESS_MODE, f as ProgressDegradation, g as ProgressMode, R as RUN_PROGRESS_STATUS, h as RunProgressStatus, i as compareTimestamps, j as isRunEnded, t as timestampMs } from '../progressSnapshot-VZ4PLul9.js';
3
+
4
+ /**
5
+ * Invocation paths: the name of each invocation in a run.
6
+ *
7
+ * A path is the route from the run's entry pipe to the invocation, one segment
8
+ * per controller level: `filings.review_filings/step_3/item_2/step_1` is the
9
+ * first step of the sequence that the batch at step 3 runs for its second item.
10
+ * The root segment is the entry pipe's `pipe_ref`, which never contains `/`,
11
+ * and an outcome key is percent-encoded, so splitting on `/` is exact.
12
+ *
13
+ * step_<n> a PipeSequence's step n, from 1, binding steps counted
14
+ * branch_<n> a PipeParallel's branch n, from 1
15
+ * item_<n> a PipeBatch's item n, from 1 (the list's index 0 is item_1)
16
+ * outcome_<key> a PipeCondition's outcome group, named by its first key
17
+ * default a PipeCondition's group that only the default outcome runs
18
+ *
19
+ * An ordinal counts from 1 with no leading zero. A segment matching none of the
20
+ * forms is kept as `unknown` rather than rejected, so a reader keeps drawing a
21
+ * path a later grammar adds a segment to.
22
+ */
23
+ declare const PATH_SEGMENT_KIND: {
24
+ readonly STEP: "step";
25
+ readonly BRANCH: "branch";
26
+ readonly ITEM: "item";
27
+ readonly OUTCOME: "outcome";
28
+ readonly DEFAULT: "default";
29
+ readonly UNKNOWN: "unknown";
30
+ };
31
+ type PathSegmentKind = (typeof PATH_SEGMENT_KIND)[keyof typeof PATH_SEGMENT_KIND];
32
+ /** A segment with a number: a sequence's step, a parallel's branch, a batch's item. */
33
+ interface OrdinalPathSegment {
34
+ kind: typeof PATH_SEGMENT_KIND.STEP | typeof PATH_SEGMENT_KIND.BRANCH | typeof PATH_SEGMENT_KIND.ITEM;
35
+ ordinal: number;
36
+ raw: string;
37
+ }
38
+ /** A condition's outcome group, named by its first key, decoded. */
39
+ interface OutcomePathSegment {
40
+ kind: typeof PATH_SEGMENT_KIND.OUTCOME;
41
+ key: string;
42
+ raw: string;
43
+ }
44
+ /** A condition's group that only the default outcome runs. */
45
+ interface DefaultPathSegment {
46
+ kind: typeof PATH_SEGMENT_KIND.DEFAULT;
47
+ raw: string;
48
+ }
49
+ /** A segment the grammar this reader knows does not define. */
50
+ interface UnknownPathSegment {
51
+ kind: typeof PATH_SEGMENT_KIND.UNKNOWN;
52
+ raw: string;
53
+ }
54
+ type PathSegment = OrdinalPathSegment | OutcomePathSegment | DefaultPathSegment | UnknownPathSegment;
55
+ /** The root segment (the entry pipe's `pipe_ref`) and the segments after it. */
56
+ declare function splitInvocationPath(path: string): {
57
+ root: string;
58
+ segments: string[];
59
+ };
60
+ /** The number of a path's segments, the root included: the entry pipe's path has depth 1. */
61
+ declare function invocationPathDepth(path: string): number;
62
+ /** The path of the invocation one level up, or `null` for a root path. */
63
+ declare function parentInvocationPath(path: string): string | null;
64
+ /** The last segment of a path, or `null` for a root path. */
65
+ declare function lastPathSegment(path: string): PathSegment | null;
66
+ /**
67
+ * An outcome key decoded from its percent-encoded form: `high%20risk` is
68
+ * `high risk`. Each `%XX` is one byte of the key's UTF-8 form. A malformed
69
+ * encoding is returned as written rather than thrown, since a label is better
70
+ * shown raw than not at all.
71
+ */
72
+ declare function decodeOutcomeKey(encoded: string): string;
73
+ /** One segment after the root, parsed. */
74
+ declare function parsePathSegment(raw: string): PathSegment;
75
+ /** True for a segment that carries an ordinal: a step, a branch or an item. */
76
+ declare function isOrdinalSegment(segment: PathSegment | null): segment is OrdinalPathSegment;
77
+
78
+ /**
79
+ * The stream of progress a snapshot belongs to, as one string: its run, its
80
+ * mode, and the part of the run it covers (`root_path`, absent for the whole
81
+ * run). Two snapshots with the same key are compared by `fresherSnapshot`; two
82
+ * with different keys are not compared at all. A reader keys on it whatever
83
+ * belongs to one stream, as the timeline keys what its reader expanded and its
84
+ * own reading clock.
85
+ */
86
+ declare function progressStreamKey(snapshot: ProgressSnapshot): string;
87
+ /**
88
+ * True when two snapshots describe the same stream of progress: one run, one
89
+ * mode, and the same part of it. Two snapshots that differ here are not
90
+ * compared at all; the one a reader is handed is a different run to draw.
91
+ */
92
+ declare function isSameProgressStream(a: ProgressSnapshot, b: ProgressSnapshot): boolean;
93
+ /**
94
+ * Of the snapshot a reader holds and one it has just read, the one to keep.
95
+ *
96
+ * Reads that overlap can answer out of order, so a reader never simply takes
97
+ * the latest answer. The contract's rule, its first clause before the other two:
98
+ *
99
+ * 1. Never a `pending` or `running` snapshot over one saying the run has ended,
100
+ * whatever their versions and their `assembled_at`: an ended run does not
101
+ * resume, and a read lagging behind the writes can project an ended run from
102
+ * fewer events than an earlier read projected it running from.
103
+ * 2. Of two snapshots of different versions, the higher version.
104
+ * 3. Of two of the same version, the later `assembled_at`: the later projection
105
+ * is the one that saw, say, a timeout end the run with no event between them.
106
+ * The two are compared exactly, at every fractional digit they carry.
107
+ *
108
+ * Ties keep the snapshot held, so a repeated read changes nothing. A snapshot of
109
+ * another run, another mode or another part of a run replaces the held one, since
110
+ * there is nothing to compare it with. Returns one of its two arguments, never a
111
+ * copy, so a caller can tell by identity whether anything changed.
112
+ */
113
+ declare function fresherSnapshot(held: ProgressSnapshot | null | undefined, incoming: ProgressSnapshot): ProgressSnapshot;
114
+
115
+ /**
116
+ * A batch holding more items than this starts collapsed into its one row. A
117
+ * timeline row is one line, so the bar is set higher than the graph's own
118
+ * auto-fold, which folds a controller drawn as a block of cards.
119
+ */
120
+ declare const DEFAULT_WIDE_BATCH_THRESHOLD = 10;
121
+ interface TimelineRowsOptions {
122
+ /**
123
+ * The batches a reader expanded (`true`) or collapsed (`false`), by path. A
124
+ * batch absent from it takes the default: collapsed when wide, else expanded.
125
+ */
126
+ expandedBatches?: Readonly<Record<string, boolean>>;
127
+ /** A batch with more items than this is wide. Defaults to `DEFAULT_WIDE_BATCH_THRESHOLD`. */
128
+ wideBatchThreshold?: number;
129
+ }
130
+ /** A run of consecutive items sharing one status, in item order: one cell of a batch's strip. */
131
+ interface TimelineStripSegment {
132
+ status: InvocationStatus;
133
+ /** The number of the first item of the run, from 1. */
134
+ firstItem: number;
135
+ /** How many items the run holds. */
136
+ count: number;
137
+ }
138
+ /** What a batch's one row shows of its items. */
139
+ interface TimelineBatch {
140
+ /** The snapshot's own counts, `null` when it carries none (a batch that has not fanned out). */
141
+ counts: BatchProgress | null;
142
+ /** The total the row reads: the counts' `total`, else the number of items the snapshot holds. */
143
+ total: number;
144
+ /** The items' states in item order, consecutive equal states merged. */
145
+ strip: TimelineStripSegment[];
146
+ /** True when the batch holds more items than the wide threshold. */
147
+ wide: boolean;
148
+ /** True when its item rows are drawn. */
149
+ expanded: boolean;
150
+ /**
151
+ * How many of its item rows are hidden: none while expanded, and while
152
+ * collapsed every item but the ones kept in view, those holding a failed or
153
+ * stuck invocation, themselves or anywhere beneath them.
154
+ */
155
+ hiddenItemCount: number;
156
+ }
157
+ /**
158
+ * Which outcome a condition's branch row stands for. When its condition has
159
+ * resolved, the outcome is the resolution's, the key the condition matched,
160
+ * which may differ from the key in the path: a path names an outcome group by
161
+ * the first key that runs its pipe. A dry run's condition, which runs every
162
+ * group and resolves none, names each by its path.
163
+ */
164
+ interface TimelineOutcome {
165
+ /** The outcome map's key, decoded; `null` for the default outcome. */
166
+ key: string | null;
167
+ /** True when it comes from the condition's `selected_outcome`, false when read off the path. */
168
+ fromResolution: boolean;
169
+ }
170
+ /**
171
+ * Why an item row of a collapsed batch is drawn anyway: an invocation that
172
+ * failed, or one where the run is stuck (carrying `degradation`), is the item
173
+ * itself or lies anywhere beneath it. A failure anywhere beneath wins over a
174
+ * stuck invocation.
175
+ */
176
+ declare const KEPT_VISIBLE_REASON: {
177
+ readonly FAILED: "failed";
178
+ readonly DEGRADED: "degraded";
179
+ };
180
+ type KeptVisibleReason = (typeof KEPT_VISIBLE_REASON)[keyof typeof KEPT_VISIBLE_REASON];
181
+ /** One drawn row: one invocation, at its place in the tree. */
182
+ interface TimelineRow {
183
+ path: string;
184
+ /** The path of the row it nests under: its nearest ancestor the snapshot holds, `null` at the top. */
185
+ parentPath: string | null;
186
+ /** Its nesting level among the drawn rows, 0 at the top. */
187
+ depth: number;
188
+ /** The last segment of its path, `null` for the entry pipe's. */
189
+ segment: PathSegment | null;
190
+ /** Its place under its parent, worded as the summary words it: `step 2 of 4`, `item 3 of 40`, `outcome detailed`. */
191
+ placeLabel: string | null;
192
+ /** On a condition's branch, the outcome it stands for. */
193
+ outcome: TimelineOutcome | null;
194
+ invocation: ProgressInvocation;
195
+ /** How many child rows it has in the snapshot, drawn or not. */
196
+ childCount: number;
197
+ /** On a batch, what its row shows of its items. */
198
+ batch: TimelineBatch | null;
199
+ /** Set on an item row drawn under a collapsed batch, saying why. */
200
+ keptVisible: KeptVisibleReason | null;
201
+ }
202
+ /**
203
+ * The rows a timeline draws for a snapshot, in drawing order: every invocation
204
+ * before its descendants, nested by path, each labelled with its place under
205
+ * its parent.
206
+ *
207
+ * A batch is one row whatever its width (decision on batch progress display):
208
+ * its row carries the snapshot's counts and a strip of its items' states, and
209
+ * its item rows are drawn only while it is expanded. A wide batch starts
210
+ * collapsed; a narrow one starts expanded; `expandedBatches` overrides either.
211
+ * Collapsed, it still draws each item holding an invocation that failed or
212
+ * where the run is stuck (one carrying `degradation`), whether the item itself
213
+ * or anything beneath it, a nested batch's item included, with everything under
214
+ * it, so the trouble can always be pointed at, along with the rows leading to it.
215
+ *
216
+ * Pure, and a function of the snapshot and the options alone: the same snapshot
217
+ * always yields the same rows, so repainting with a newer snapshot keeps every
218
+ * row it still holds at its place relative to the others.
219
+ */
220
+ declare function buildTimelineRows(snapshot: ProgressSnapshot, options?: TimelineRowsOptions): TimelineRow[];
221
+
222
+ /** The stretch of time a timeline's shared axis spans, in epoch milliseconds. */
223
+ interface TimelineWindow {
224
+ startMs: number;
225
+ endMs: number;
226
+ }
227
+ /** Where one invocation's bar starts and ends on the axis. */
228
+ interface TimelineBar {
229
+ startMs: number;
230
+ endMs: number;
231
+ /** True while the bar grows: the invocation is running, so its end is the reading clock. */
232
+ growing: boolean;
233
+ /** True when its end was never recorded: a canceled invocation, drawn to the end of the axis. */
234
+ openEnded: boolean;
235
+ }
236
+ /**
237
+ * The reading clock: the moment a running invocation's elapsed time is measured
238
+ * against. A host or a replay may pin it with `now`; otherwise it is the
239
+ * snapshot's `assembled_at`, the moment the snapshot was projected, which is
240
+ * what a reader measures against when it cannot trust its own clock.
241
+ */
242
+ declare function readingClockMs(snapshot: ProgressSnapshot, now?: ProgressTimestamp | number | null): number | null;
243
+ /** An invocation's recorded moments in epoch milliseconds, each `null` where none was recorded. */
244
+ interface InvocationTimes {
245
+ /** The start of its latest attempt. */
246
+ startedMs: number | null;
247
+ /** The end of its latest attempt. */
248
+ endedMs: number | null;
249
+ /** When its last failure happened, when that is known. */
250
+ failedMs: number | null;
251
+ }
252
+ /** An invocation's recorded moments, parsed. */
253
+ declare function invocationTimes(invocation: ProgressInvocation): InvocationTimes;
254
+ /**
255
+ * Everything a timeline reads of time in one snapshot, parsed once, so that a
256
+ * timeline redrawing as its clock ticks parses no timestamp again: each
257
+ * invocation's moments, and the span of every moment the snapshot recorded.
258
+ */
259
+ interface SnapshotTimes {
260
+ /** Each invocation's moments, by path. A path listed twice keeps its first entry's, as its row does. */
261
+ invocations: ReadonlyMap<string, InvocationTimes>;
262
+ /**
263
+ * The axis as far as the snapshot's own records go: from the earliest start
264
+ * to the latest moment recorded, whether a start, an end or a failure, and
265
+ * never spanning zero time. `null` when no invocation has started. Every bar
266
+ * that does not follow the clock lies inside it, and it is the whole axis of
267
+ * a run that has ended.
268
+ */
269
+ recorded: TimelineWindow | null;
270
+ /** The snapshot's `assembled_at`. */
271
+ assembledMs: number | null;
272
+ /** True once the run has ended. */
273
+ ended: boolean;
274
+ }
275
+ /** A snapshot's moments, parsed once: see `SnapshotTimes`. */
276
+ declare function snapshotTimes(snapshot: ProgressSnapshot): SnapshotTimes;
277
+ /**
278
+ * The axis at one reading of the clock, from a snapshot's parsed moments: the
279
+ * snapshot's recorded span, stretched to the reading clock while the run goes
280
+ * on (to its `assembled_at` when `nowMs` is not given, or is not a finite
281
+ * number, which would give the axis no end). See `timelineWindow`. Returns the
282
+ * recorded span itself when the clock does not stretch it.
283
+ */
284
+ declare function timelineWindowAt(times: SnapshotTimes, nowMs?: number | null): TimelineWindow | null;
285
+ /**
286
+ * The axis every bar is drawn on: from the earliest start the snapshot holds to
287
+ * the latest moment it knows of. While the run goes on, that is the reading
288
+ * clock, so the axis, and every running bar with it, keeps growing. Once the run
289
+ * has ended, it is the latest time recorded in its invocations, whether a start,
290
+ * an end or a failure, an end counting even when its start was not recorded:
291
+ * the snapshot's `assembled_at` is then only when it was read, which may be long
292
+ * after. A `nowMs` that is not a finite number counts as not given. `null` when
293
+ * no invocation has started.
294
+ */
295
+ declare function timelineWindow(snapshot: ProgressSnapshot, nowMs?: number | null): TimelineWindow | null;
296
+ /**
297
+ * True when an invocation's bar moves while the reading clock ticks: a running
298
+ * invocation's grows to the clock, and a canceled one's runs to the end of the
299
+ * axis, which grows with the clock while the run goes on. Any other bar is
300
+ * settled by its snapshot, so a timeline need not redraw it between snapshots.
301
+ */
302
+ declare function barFollowsClock(invocation: ProgressInvocation, times?: InvocationTimes): boolean;
303
+ /**
304
+ * An invocation's bar: from the start of its latest attempt to its end, or to
305
+ * the reading clock while it runs. A canceled invocation recorded no end, so its
306
+ * bar runs to the end of the axis, which is as late as the run is known to have
307
+ * gone. `null` for an invocation that has not started, such as a scheduled item.
308
+ * A `nowMs` that is not a finite number counts as not given, as it does for the
309
+ * axis, so a running bar then ends at the end of the axis rather than at `NaN`
310
+ * or `Infinity`. `times` are the invocation's moments when the caller has
311
+ * already parsed them.
312
+ */
313
+ declare function invocationBar(invocation: ProgressInvocation, window: TimelineWindow, nowMs?: number | null, times?: InvocationTimes): TimelineBar | null;
314
+ /** A moment's place on the axis, as a percentage of its width, clamped to it. */
315
+ declare function axisPercent(ms: number, window: TimelineWindow): number;
316
+ /** A tick of the axis: its offset from the run's first start, and where it sits. */
317
+ interface TimelineTick {
318
+ offsetMs: number;
319
+ percent: number;
320
+ label: string;
321
+ }
322
+ /**
323
+ * The axis's ticks, at the smallest round step that keeps them to `maxTicks`
324
+ * intervals or fewer, labelled with their offset from the first start. Past the
325
+ * table's largest step, a day, the step is the smallest whole number of days
326
+ * that still keeps to `maxTicks`, so no axis is ever crowded with labels. An
327
+ * axis whose span is not a finite positive number has no ticks: an infinite
328
+ * one would otherwise take an infinite step and never reach its end.
329
+ */
330
+ declare function timelineTicks(window: TimelineWindow, maxTicks?: number): TimelineTick[];
331
+ /**
332
+ * A duration in a few characters: `340ms`, `6.7s`, `42s`, `2m 05s`, `1h 12m`.
333
+ * Negative durations, which only clock skew produces, read as zero.
334
+ */
335
+ declare function formatDuration(ms: number): string;
336
+ /** A moment as its UTC time of day, to the millisecond: `09:30:07.034 UTC`. */
337
+ declare function formatClockTime(ms: number): string;
338
+
339
+ export { BatchProgress, DEFAULT_WIDE_BATCH_THRESHOLD, type DefaultPathSegment, InvocationStatus, type InvocationTimes, KEPT_VISIBLE_REASON, type KeptVisibleReason, type OrdinalPathSegment, type OutcomePathSegment, PATH_SEGMENT_KIND, type PathSegment, type PathSegmentKind, ProgressInvocation, ProgressSnapshot, ProgressTimestamp, type SnapshotTimes, type TimelineBar, type TimelineBatch, type TimelineOutcome, type TimelineRow, type TimelineRowsOptions, type TimelineStripSegment, type TimelineTick, type TimelineWindow, type UnknownPathSegment, axisPercent, barFollowsClock, buildTimelineRows, decodeOutcomeKey, formatClockTime, formatDuration, fresherSnapshot, invocationBar, invocationPathDepth, invocationTimes, isOrdinalSegment, isSameProgressStream, lastPathSegment, parentInvocationPath, parsePathSegment, progressStreamKey, readingClockMs, snapshotTimes, splitInvocationPath, timelineTicks, timelineWindow, timelineWindowAt };
@@ -0,0 +1,70 @@
1
+ import {
2
+ DEFAULT_WIDE_BATCH_THRESHOLD,
3
+ DEGRADATION_REASON,
4
+ INVOCATION_STATUS,
5
+ KEPT_VISIBLE_REASON,
6
+ PATH_SEGMENT_KIND,
7
+ PROGRESS_MODE,
8
+ RUN_PROGRESS_STATUS,
9
+ axisPercent,
10
+ barFollowsClock,
11
+ buildTimelineRows,
12
+ compareTimestamps,
13
+ decodeOutcomeKey,
14
+ formatClockTime,
15
+ formatDuration,
16
+ fresherSnapshot,
17
+ invocationBar,
18
+ invocationPathDepth,
19
+ invocationTimes,
20
+ isOrdinalSegment,
21
+ isRunEnded,
22
+ isSameProgressStream,
23
+ lastPathSegment,
24
+ parentInvocationPath,
25
+ parsePathSegment,
26
+ progressStreamKey,
27
+ readingClockMs,
28
+ snapshotTimes,
29
+ splitInvocationPath,
30
+ timelineTicks,
31
+ timelineWindow,
32
+ timelineWindowAt,
33
+ timestampMs
34
+ } from "../chunk-JJG2TO7P.js";
35
+ import "../chunk-2NMEKWO5.js";
36
+ export {
37
+ DEFAULT_WIDE_BATCH_THRESHOLD,
38
+ DEGRADATION_REASON,
39
+ INVOCATION_STATUS,
40
+ KEPT_VISIBLE_REASON,
41
+ PATH_SEGMENT_KIND,
42
+ PROGRESS_MODE,
43
+ RUN_PROGRESS_STATUS,
44
+ axisPercent,
45
+ barFollowsClock,
46
+ buildTimelineRows,
47
+ compareTimestamps,
48
+ decodeOutcomeKey,
49
+ formatClockTime,
50
+ formatDuration,
51
+ fresherSnapshot,
52
+ invocationBar,
53
+ invocationPathDepth,
54
+ invocationTimes,
55
+ isOrdinalSegment,
56
+ isRunEnded,
57
+ isSameProgressStream,
58
+ lastPathSegment,
59
+ parentInvocationPath,
60
+ parsePathSegment,
61
+ progressStreamKey,
62
+ readingClockMs,
63
+ snapshotTimes,
64
+ splitInvocationPath,
65
+ timelineTicks,
66
+ timelineWindow,
67
+ timelineWindowAt,
68
+ timestampMs
69
+ };
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}