@pipelex/mthds-ui 0.39.0 → 0.41.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 +8 -6
- package/dist/chunk-6S5TQPTO.js +1349 -0
- package/dist/chunk-6S5TQPTO.js.map +1 -0
- package/dist/chunk-7JZBXBZS.js +258 -0
- package/dist/chunk-7JZBXBZS.js.map +1 -0
- package/dist/{chunk-AGFLCOWW.js → chunk-HPARBH6K.js} +14 -197
- package/dist/chunk-HPARBH6K.js.map +1 -0
- package/dist/chunk-N2F62MW7.js +55 -0
- package/dist/chunk-N2F62MW7.js.map +1 -0
- package/dist/chunk-P6IGZVWE.js +155 -0
- package/dist/chunk-P6IGZVWE.js.map +1 -0
- package/dist/form/react/index.d.ts +1 -1
- package/dist/graph/index.d.ts +19 -3
- package/dist/graph/index.js +20 -12
- package/dist/graph/react/index.d.ts +13 -13
- package/dist/graph/react/index.js +387 -560
- package/dist/graph/react/index.js.map +1 -1
- package/dist/graph/react/viewer/GraphToolbar.css +2 -107
- package/dist/graph/react/viewer/StyleMenu.css +109 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -12
- package/dist/registryJoin-C6Wfkik-.d.ts +441 -0
- package/dist/standalone/graph-standalone.html +176 -171
- package/dist/standalone/graph-viewer.css +75 -70
- package/dist/standalone/graph-viewer.js +101 -101
- package/dist/static-graph/index.d.ts +1 -1
- package/dist/timeline/index.d.ts +344 -83
- package/dist/timeline/index.js +67 -3
- package/dist/timeline/react/RunTimeline.css +141 -0
- package/dist/timeline/react/index.d.ts +57 -6
- package/dist/timeline/react/index.js +929 -120
- package/dist/timeline/react/index.js.map +1 -1
- package/dist/timeline/react/styles/simple/SimpleProgress.css +354 -0
- package/dist/{types-DsrzH6gM.d.ts → types-DLAnYNoi.d.ts} +1 -1
- package/package.json +6 -4
- package/dist/chunk-AGFLCOWW.js.map +0 -1
- package/dist/chunk-ILZJIORT.js +0 -54
- package/dist/chunk-ILZJIORT.js.map +0 -1
- package/dist/chunk-JJG2TO7P.js +0 -473
- package/dist/chunk-JJG2TO7P.js.map +0 -1
- package/dist/progressSnapshot-VZ4PLul9.d.ts +0 -191
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { S as SubPipeSpec, P as PipeBlueprintUnion, b as PipeSequenceBlueprint } from './types-DLAnYNoi.js';
|
|
2
|
+
import { Problem } from 'mthds/errors';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The progress snapshot of the hosted progress contract, as data.
|
|
6
|
+
*
|
|
7
|
+
* A snapshot is the state of a run's progress at one moment: which invocations
|
|
8
|
+
* of which pipes have started, ended or been skipped, how far each batch has
|
|
9
|
+
* got, which outcome each condition took, and where the run is retrying or
|
|
10
|
+
* stuck. It is defined apart from the carriers that deliver it (a progress
|
|
11
|
+
* route a client polls, a frame that tells a browser to read it again, the
|
|
12
|
+
* state of a task on another workflow platform), so these types model the
|
|
13
|
+
* snapshot alone and name no carrier and no workflow engine.
|
|
14
|
+
*
|
|
15
|
+
* Field names, optionality and the closed vocabularies follow the contract
|
|
16
|
+
* word for word. A required field is always present, `null` where its type
|
|
17
|
+
* says so; an optional field is absent when it does not apply, never `null`.
|
|
18
|
+
* A reader ignores a member it does not know, so nothing here rejects an
|
|
19
|
+
* unknown field, and the fields the contract calls open strings
|
|
20
|
+
* (`pipe_type`, `degradation.reason`) are typed `string`.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** RFC 3339 in UTC, written with `Z` in a snapshot, with fractional seconds when recorded. */
|
|
24
|
+
type ProgressTimestamp = string;
|
|
25
|
+
/** Whether the events a snapshot was projected from are a live run's or a dry run's. */
|
|
26
|
+
declare const PROGRESS_MODE: {
|
|
27
|
+
readonly LIVE: "live";
|
|
28
|
+
readonly DRY: "dry";
|
|
29
|
+
};
|
|
30
|
+
type ProgressMode = (typeof PROGRESS_MODE)[keyof typeof PROGRESS_MODE];
|
|
31
|
+
/**
|
|
32
|
+
* Where the run stands: accepted and not yet started, going, ended with its
|
|
33
|
+
* result, ended in failure, or stopped before its end.
|
|
34
|
+
*/
|
|
35
|
+
declare const RUN_PROGRESS_STATUS: {
|
|
36
|
+
readonly PENDING: "pending";
|
|
37
|
+
readonly RUNNING: "running";
|
|
38
|
+
readonly SUCCEEDED: "succeeded";
|
|
39
|
+
readonly FAILED: "failed";
|
|
40
|
+
readonly CANCELED: "canceled";
|
|
41
|
+
};
|
|
42
|
+
type RunProgressStatus = (typeof RUN_PROGRESS_STATUS)[keyof typeof RUN_PROGRESS_STATUS];
|
|
43
|
+
/**
|
|
44
|
+
* An invocation's status. These are the words a run graph uses for its nodes,
|
|
45
|
+
* the same set as the graph's `PipeStatus`:
|
|
46
|
+
*
|
|
47
|
+
* - `scheduled`: an item of a batch that has fanned out, not yet started;
|
|
48
|
+
* - `running`: started its latest attempt and not ended it;
|
|
49
|
+
* - `succeeded`: ended its latest attempt with its output;
|
|
50
|
+
* - `failed`: ended its latest attempt in failure;
|
|
51
|
+
* - `skipped`: skipped in its latest attempt, a successful end with no output of its own;
|
|
52
|
+
* - `canceled`: had not ended when the run ended.
|
|
53
|
+
*/
|
|
54
|
+
declare const INVOCATION_STATUS: {
|
|
55
|
+
readonly SCHEDULED: "scheduled";
|
|
56
|
+
readonly RUNNING: "running";
|
|
57
|
+
readonly SUCCEEDED: "succeeded";
|
|
58
|
+
readonly FAILED: "failed";
|
|
59
|
+
readonly SKIPPED: "skipped";
|
|
60
|
+
readonly CANCELED: "canceled";
|
|
61
|
+
};
|
|
62
|
+
type InvocationStatus = (typeof INVOCATION_STATUS)[keyof typeof INVOCATION_STATUS];
|
|
63
|
+
/** The reasons the platform emits today. `ProgressDegradation.reason` stays an open string. */
|
|
64
|
+
declare const DEGRADATION_REASON: {
|
|
65
|
+
readonly WORKFLOW_TASK_FAILING: "workflow_task_failing";
|
|
66
|
+
readonly STATUS_UNAVAILABLE: "status_unavailable";
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* The run status's assessment of a run that is not making progress. A snapshot
|
|
70
|
+
* carries it whole as its own `degradation`, and on the invocation it concerns.
|
|
71
|
+
* Every member is always present, `null` where its type says so.
|
|
72
|
+
*/
|
|
73
|
+
interface ProgressDegradation {
|
|
74
|
+
/** Why the run reads degraded. An open string: show `message` for a reason you do not know. */
|
|
75
|
+
reason: string;
|
|
76
|
+
/** The assessment in words, for a person. Shown as it is, never parsed. */
|
|
77
|
+
message: string;
|
|
78
|
+
/** How many times in a row the failing execution has failed to advance. */
|
|
79
|
+
failed_attempts: number | null;
|
|
80
|
+
/** When that series of failures began, or the latest time it can have begun. */
|
|
81
|
+
failing_since: ProgressTimestamp | null;
|
|
82
|
+
/** When the platform ends the run as failed if the series is still going on then. */
|
|
83
|
+
ends_at: ProgressTimestamp | null;
|
|
84
|
+
}
|
|
85
|
+
/** A batch's counts of its items. An item `scheduled` or `canceled` is counted in none of the three. */
|
|
86
|
+
interface BatchProgress {
|
|
87
|
+
/** The fan-out's item count. */
|
|
88
|
+
total: number;
|
|
89
|
+
/** Items `succeeded` or `skipped`. */
|
|
90
|
+
done: number;
|
|
91
|
+
/** Items `running`. */
|
|
92
|
+
running: number;
|
|
93
|
+
/** Items `failed`. */
|
|
94
|
+
failed: number;
|
|
95
|
+
}
|
|
96
|
+
/** A condition's resolution. */
|
|
97
|
+
interface ConditionProgress {
|
|
98
|
+
/** The outcome map's key that matched, or `null` when the condition took its default outcome. */
|
|
99
|
+
selected_outcome: string | null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The latest failure of an invocation's work, a health annotation: the problem
|
|
103
|
+
* that ended it when it is `failed`, and otherwise the problem of the latest
|
|
104
|
+
* failure of an attempt its engine is trying again.
|
|
105
|
+
*/
|
|
106
|
+
interface InvocationFailure {
|
|
107
|
+
/**
|
|
108
|
+
* The MTHDS problem document, in the caller's view. A failure only the engine
|
|
109
|
+
* observes, such as an attempt it is trying again, is served as
|
|
110
|
+
* `runtime.unexpected`, since the engine's text is no problem document.
|
|
111
|
+
*/
|
|
112
|
+
problem: Problem;
|
|
113
|
+
/** When it failed, when known. */
|
|
114
|
+
at?: ProgressTimestamp;
|
|
115
|
+
}
|
|
116
|
+
/** One attempt of one execution: an entry of a chain. */
|
|
117
|
+
interface ExecutionAttempt {
|
|
118
|
+
/** Opaque. Names the execution, the same in each of its attempts. */
|
|
119
|
+
execution: string;
|
|
120
|
+
/** Counts from 1. */
|
|
121
|
+
attempt: number;
|
|
122
|
+
}
|
|
123
|
+
/** One run of one pipe inside a run, named by its invocation path. */
|
|
124
|
+
interface ProgressInvocation {
|
|
125
|
+
/** Its invocation path, from the run's entry pipe. */
|
|
126
|
+
path: string;
|
|
127
|
+
/** The bare code of the pipe it runs, which a timeline labels its row with. */
|
|
128
|
+
pipe_code: string;
|
|
129
|
+
/** The same pipe's `pipe_ref`. */
|
|
130
|
+
pipe_ref: string;
|
|
131
|
+
/** The pipe's type, such as `PipeSequence` or `PipeLLM`: an open string. */
|
|
132
|
+
pipe_type: string;
|
|
133
|
+
status: InvocationStatus;
|
|
134
|
+
/** The start of its latest attempt; `null` while `scheduled`, and when no start of that attempt was recorded. */
|
|
135
|
+
started_at: ProgressTimestamp | null;
|
|
136
|
+
/** The end of its latest attempt; `null` while `scheduled` or `running`, and when `canceled`. */
|
|
137
|
+
ended_at: ProgressTimestamp | null;
|
|
138
|
+
/** On a `PipeSequence`, the number of steps its author wrote. */
|
|
139
|
+
step_count?: number;
|
|
140
|
+
/** On a `PipeParallel`, the number of its branches. */
|
|
141
|
+
branch_count?: number;
|
|
142
|
+
/** On a `skipped` invocation, why it was skipped. */
|
|
143
|
+
skip_reason?: string;
|
|
144
|
+
/** On a `PipeBatch` that has fanned out. */
|
|
145
|
+
batch?: BatchProgress;
|
|
146
|
+
/** On a `PipeCondition` that has resolved. */
|
|
147
|
+
condition?: ConditionProgress;
|
|
148
|
+
/** Health annotation: how many times its work has been tried, present only when more than once. */
|
|
149
|
+
attempts?: number;
|
|
150
|
+
/** Health annotation: the latest failure of its work. */
|
|
151
|
+
last_failure?: InvocationFailure;
|
|
152
|
+
/** Health annotation: the run is stuck at this invocation. */
|
|
153
|
+
degradation?: ProgressDegradation;
|
|
154
|
+
}
|
|
155
|
+
/** The state of a run's progress at one moment. */
|
|
156
|
+
interface ProgressSnapshot {
|
|
157
|
+
pipeline_run_id: string;
|
|
158
|
+
/** The mode of the events it was projected from. */
|
|
159
|
+
mode: ProgressMode;
|
|
160
|
+
status: RunProgressStatus;
|
|
161
|
+
/** What a reader compares two snapshots of one run by: the count of distinct events projected. */
|
|
162
|
+
version: number;
|
|
163
|
+
/** When the snapshot was projected. */
|
|
164
|
+
assembled_at: ProgressTimestamp;
|
|
165
|
+
/** One line saying how far the run has got. Shown as it is, never parsed. */
|
|
166
|
+
summary: string;
|
|
167
|
+
/** Present only on a snapshot of part of a run: the path of the invocation it starts at. */
|
|
168
|
+
root_path?: string;
|
|
169
|
+
/** Present only on a snapshot of part of a run: the chain of the attempt it was projected from. */
|
|
170
|
+
chain?: ExecutionAttempt[];
|
|
171
|
+
/** The run status's degradation, present when the run reads degraded. */
|
|
172
|
+
degradation?: ProgressDegradation;
|
|
173
|
+
/** Every invocation the snapshot knows, each before its descendants. */
|
|
174
|
+
invocations: ProgressInvocation[];
|
|
175
|
+
}
|
|
176
|
+
/** True once the run has ended: `succeeded`, `failed` or `canceled`. */
|
|
177
|
+
declare function isRunEnded(status: RunProgressStatus): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* A timestamp as milliseconds since the epoch, keeping any precision finer than
|
|
180
|
+
* a millisecond as a fraction, or `null` when it is not an RFC 3339 timestamp
|
|
181
|
+
* in the form the contract writes (see `TIMESTAMP_PATTERN`): anything else,
|
|
182
|
+
* an offset-less time included, is `null` rather than whatever `Date.parse`
|
|
183
|
+
* makes of it, which for an offset-less time is the reader's local time.
|
|
184
|
+
*
|
|
185
|
+
* Good to well under a microsecond, which is all a bar needs. A double cannot
|
|
186
|
+
* hold every digit a source may record past the millisecond, so to order two
|
|
187
|
+
* timestamps exactly, use `compareTimestamps`.
|
|
188
|
+
*/
|
|
189
|
+
declare function timestampMs(timestamp: ProgressTimestamp | null | undefined): number | null;
|
|
190
|
+
/**
|
|
191
|
+
* How two timestamps are ordered, exactly, at whatever precision they carry:
|
|
192
|
+
* negative when `a` is the earlier, positive when it is the later, 0 when both
|
|
193
|
+
* name the same moment, and `null` when either is not a timestamp.
|
|
194
|
+
*
|
|
195
|
+
* Whole milliseconds are compared first, then the digits past the millisecond
|
|
196
|
+
* as digits, so `…07.0340001Z` reads earlier than `…07.03400011Z`, which as
|
|
197
|
+
* epoch milliseconds in a double are one number. Two snapshots of one version
|
|
198
|
+
* are told apart by `assembled_at` alone, and the contract lets a source record
|
|
199
|
+
* any number of fractional digits, so the comparison never rounds them.
|
|
200
|
+
*/
|
|
201
|
+
declare function compareTimestamps(a: ProgressTimestamp | null | undefined, b: ProgressTimestamp | null | undefined): number | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Invocation paths: the name of each invocation in a run.
|
|
205
|
+
*
|
|
206
|
+
* A path is the route from the run's entry pipe to the invocation, one segment
|
|
207
|
+
* per controller level: `filings.review_filings/step_3/item_2/step_1` is the
|
|
208
|
+
* first step of the sequence that the batch at step 3 runs for its second item.
|
|
209
|
+
* The root segment is the entry pipe's `pipe_ref`, which never contains `/`,
|
|
210
|
+
* and an outcome key is percent-encoded, so splitting on `/` is exact.
|
|
211
|
+
*
|
|
212
|
+
* step_<n> a PipeSequence's step n, from 1, binding steps counted
|
|
213
|
+
* branch_<n> a PipeParallel's branch n, from 1
|
|
214
|
+
* item_<n> a PipeBatch's item n, from 1 (the list's index 0 is item_1)
|
|
215
|
+
* outcome_<key> a PipeCondition's outcome group, named by its first key
|
|
216
|
+
* default a PipeCondition's group that only the default outcome runs
|
|
217
|
+
*
|
|
218
|
+
* An ordinal counts from 1 with no leading zero. A segment matching none of the
|
|
219
|
+
* forms is kept as `unknown` rather than rejected, so a reader keeps drawing a
|
|
220
|
+
* path a later grammar adds a segment to.
|
|
221
|
+
*/
|
|
222
|
+
declare const PATH_SEGMENT_KIND: {
|
|
223
|
+
readonly STEP: "step";
|
|
224
|
+
readonly BRANCH: "branch";
|
|
225
|
+
readonly ITEM: "item";
|
|
226
|
+
readonly OUTCOME: "outcome";
|
|
227
|
+
readonly DEFAULT: "default";
|
|
228
|
+
readonly UNKNOWN: "unknown";
|
|
229
|
+
};
|
|
230
|
+
type PathSegmentKind = (typeof PATH_SEGMENT_KIND)[keyof typeof PATH_SEGMENT_KIND];
|
|
231
|
+
/** A segment with a number: a sequence's step, a parallel's branch, a batch's item. */
|
|
232
|
+
interface OrdinalPathSegment {
|
|
233
|
+
kind: typeof PATH_SEGMENT_KIND.STEP | typeof PATH_SEGMENT_KIND.BRANCH | typeof PATH_SEGMENT_KIND.ITEM;
|
|
234
|
+
ordinal: number;
|
|
235
|
+
raw: string;
|
|
236
|
+
}
|
|
237
|
+
/** A condition's outcome group, named by its first key, decoded. */
|
|
238
|
+
interface OutcomePathSegment {
|
|
239
|
+
kind: typeof PATH_SEGMENT_KIND.OUTCOME;
|
|
240
|
+
key: string;
|
|
241
|
+
raw: string;
|
|
242
|
+
}
|
|
243
|
+
/** A condition's group that only the default outcome runs. */
|
|
244
|
+
interface DefaultPathSegment {
|
|
245
|
+
kind: typeof PATH_SEGMENT_KIND.DEFAULT;
|
|
246
|
+
raw: string;
|
|
247
|
+
}
|
|
248
|
+
/** A segment the grammar this reader knows does not define. */
|
|
249
|
+
interface UnknownPathSegment {
|
|
250
|
+
kind: typeof PATH_SEGMENT_KIND.UNKNOWN;
|
|
251
|
+
raw: string;
|
|
252
|
+
}
|
|
253
|
+
type PathSegment = OrdinalPathSegment | OutcomePathSegment | DefaultPathSegment | UnknownPathSegment;
|
|
254
|
+
/** The root segment (the entry pipe's `pipe_ref`) and the segments after it. */
|
|
255
|
+
declare function splitInvocationPath(path: string): {
|
|
256
|
+
root: string;
|
|
257
|
+
segments: string[];
|
|
258
|
+
};
|
|
259
|
+
/** The number of a path's segments, the root included: the entry pipe's path has depth 1. */
|
|
260
|
+
declare function invocationPathDepth(path: string): number;
|
|
261
|
+
/** The path of the invocation one level up, or `null` for a root path. */
|
|
262
|
+
declare function parentInvocationPath(path: string): string | null;
|
|
263
|
+
/** The last segment of a path, or `null` for a root path. */
|
|
264
|
+
declare function lastPathSegment(path: string): PathSegment | null;
|
|
265
|
+
/**
|
|
266
|
+
* An outcome key decoded from its percent-encoded form: `high%20risk` is
|
|
267
|
+
* `high risk`. Each `%XX` is one byte of the key's UTF-8 form. A malformed
|
|
268
|
+
* encoding is returned as written rather than thrown, since a label is better
|
|
269
|
+
* shown raw than not at all.
|
|
270
|
+
*/
|
|
271
|
+
declare function decodeOutcomeKey(encoded: string): string;
|
|
272
|
+
/** One segment after the root, parsed. */
|
|
273
|
+
declare function parsePathSegment(raw: string): PathSegment;
|
|
274
|
+
/** True for a segment that carries an ordinal: a step, a branch or an item. */
|
|
275
|
+
declare function isOrdinalSegment(segment: PathSegment | null): segment is OrdinalPathSegment;
|
|
276
|
+
|
|
277
|
+
/** One invocation of a snapshot, at its place in the tree its paths make. */
|
|
278
|
+
interface InvocationTreeNode {
|
|
279
|
+
invocation: ProgressInvocation;
|
|
280
|
+
/** Its index in the snapshot's `invocations`. */
|
|
281
|
+
order: number;
|
|
282
|
+
/** The last segment of its path, `null` for a root path. */
|
|
283
|
+
segment: PathSegment | null;
|
|
284
|
+
/** The path of the node it nests under: its nearest ancestor the snapshot holds, `null` at the top. */
|
|
285
|
+
parentPath: string | null;
|
|
286
|
+
/** Its children, ordered by the number in their segment, then in snapshot order. */
|
|
287
|
+
children: InvocationTreeNode[];
|
|
288
|
+
}
|
|
289
|
+
/** The order of two siblings: by the number in their segment, numbered ones first, then in snapshot order. */
|
|
290
|
+
declare function compareSiblings(a: InvocationTreeNode, b: InvocationTreeNode): number;
|
|
291
|
+
/**
|
|
292
|
+
* The snapshot's invocations as a tree, each under its nearest ancestor the
|
|
293
|
+
* snapshot holds. A whole-run snapshot holds every ancestor, so this is its
|
|
294
|
+
* path tree; a snapshot of part of a run starts at its `root_path`, and an
|
|
295
|
+
* invocation whose parent is missing still nests under what is there rather
|
|
296
|
+
* than being lost. Children are ordered by the number in their segment, and
|
|
297
|
+
* outcome groups, which carry none, keep the snapshot's order, the order they
|
|
298
|
+
* started in. A path the snapshot lists twice keeps its first entry. The roots
|
|
299
|
+
* come in snapshot order.
|
|
300
|
+
*/
|
|
301
|
+
declare function buildInvocationTree(snapshot: ProgressSnapshot): InvocationTreeNode[];
|
|
302
|
+
/** Whether a node is a batch's item: its path ends in `item_<n>`. */
|
|
303
|
+
declare function isItemNode(node: InvocationTreeNode): boolean;
|
|
304
|
+
/** Whether a node is a condition's outcome group: its path ends in `outcome_<key>` or `default`. */
|
|
305
|
+
declare function isOutcomeNode(node: InvocationTreeNode): boolean;
|
|
306
|
+
|
|
307
|
+
/** How a run's progress is drawn. */
|
|
308
|
+
declare const TIMELINE_STYLE: {
|
|
309
|
+
/** Every invocation, labelled by its pipe code, with a bar on a shared time axis. */
|
|
310
|
+
readonly DETAILED: "detailed";
|
|
311
|
+
/** The steps in the method's own words, as a checklist, with each batch as one line of counts. */
|
|
312
|
+
readonly SIMPLE: "simple";
|
|
313
|
+
};
|
|
314
|
+
type TimelineStyleId = (typeof TIMELINE_STYLE)[keyof typeof TIMELINE_STYLE];
|
|
315
|
+
/** What the registry says of one style: what it is called and what it shows, for a menu. */
|
|
316
|
+
interface TimelineStyleDescriptor {
|
|
317
|
+
id: TimelineStyleId;
|
|
318
|
+
/** The style's name in the menu. */
|
|
319
|
+
name: string;
|
|
320
|
+
/** One line saying what the style shows, under its name in the menu. */
|
|
321
|
+
description: string;
|
|
322
|
+
}
|
|
323
|
+
declare const TIMELINE_STYLES: Record<TimelineStyleId, TimelineStyleDescriptor>;
|
|
324
|
+
/** Every registered style, in the order a menu lists them: `TIMELINE_STYLE`'s, so none is left out. */
|
|
325
|
+
declare const TIMELINE_STYLE_IDS: readonly TimelineStyleId[];
|
|
326
|
+
/** The style a timeline draws when the host names none. */
|
|
327
|
+
declare const DEFAULT_TIMELINE_STYLE: TimelineStyleId;
|
|
328
|
+
/**
|
|
329
|
+
* Whether a value names a registered style. For values that cross an untyped
|
|
330
|
+
* boundary, such as a saved setting or a host written in plain JavaScript,
|
|
331
|
+
* before they reach the timeline.
|
|
332
|
+
*/
|
|
333
|
+
declare function isTimelineStyleId(value: unknown): value is TimelineStyleId;
|
|
334
|
+
/**
|
|
335
|
+
* The style a timeline draws for its `timelineStyle` prop: the style it names,
|
|
336
|
+
* or the default when it is unset. A value naming no registered style is read
|
|
337
|
+
* as unset rather than thrown on, as `resolveGraphStyle` reads one: a style is
|
|
338
|
+
* a preference, and a host relaying a setting written for a newer version of
|
|
339
|
+
* this package should still get a timeline.
|
|
340
|
+
*/
|
|
341
|
+
declare function resolveTimelineStyle(style: unknown): TimelineStyleId;
|
|
342
|
+
/**
|
|
343
|
+
* The styles a timeline's menu offers, from its `styleMenu` prop: nothing for
|
|
344
|
+
* `false` or `undefined` (the menu is opt-in), every registered style in
|
|
345
|
+
* registry order for `true`, and for a list the registered styles it names, in
|
|
346
|
+
* its order and without repeats. A menu needs two styles to choose between, so
|
|
347
|
+
* fewer than two offer none.
|
|
348
|
+
*/
|
|
349
|
+
declare function resolveTimelineStyleMenu(styleMenu: boolean | readonly TimelineStyleId[] | undefined): TimelineStyleId[];
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* The join between a progress snapshot and the method's pipe registry.
|
|
353
|
+
*
|
|
354
|
+
* The snapshot says what ran; the registry says what the method declares: each
|
|
355
|
+
* pipe's description, each sequence's steps in order and each batch's branch
|
|
356
|
+
* and item name. They meet on `pipe_ref`, which an invocation and a registry key
|
|
357
|
+
* share, and on step numbers, which a sequence's step path carries and which
|
|
358
|
+
* are counted here as the progress contract counts them. Anything the registry
|
|
359
|
+
* lacks falls back per line, never for the whole run.
|
|
360
|
+
*/
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* A method's pipes keyed by `pipe_ref`: the map a `GraphSpec` carries as
|
|
364
|
+
* `pipe_registry` and the static builder emits. It must be the registry of the
|
|
365
|
+
* version of the method that ran, since an invocation path is stable only
|
|
366
|
+
* within one version.
|
|
367
|
+
*/
|
|
368
|
+
type TimelinePipeRegistry = Readonly<Record<string, PipeBlueprintUnion>>;
|
|
369
|
+
/** A line's title in plain words, and whether it is the author's description. */
|
|
370
|
+
interface JoinedTitle {
|
|
371
|
+
title: string;
|
|
372
|
+
fromDescription: boolean;
|
|
373
|
+
}
|
|
374
|
+
/** A pipe step of a sequence, with the number the contract gives it. */
|
|
375
|
+
interface NumberedStep {
|
|
376
|
+
/** Counted from 1, as the progress contract counts a step. */
|
|
377
|
+
number: number;
|
|
378
|
+
spec: SubPipeSpec;
|
|
379
|
+
/** The step pipe's `pipe_ref`: its code qualified with the sequence's domain when bare. */
|
|
380
|
+
pipeRef: string;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* A pipe code as a `pipe_ref`. A run graph's registry writes a step's or a
|
|
384
|
+
* branch's `pipe_code` as a full ref (`filings.summarize_filing`); the static
|
|
385
|
+
* builder writes the bare code (`summarize_filing`), which belongs to the
|
|
386
|
+
* domain of the pipe that names it.
|
|
387
|
+
*/
|
|
388
|
+
declare function qualifyPipeCode(pipeCode: string, domainCode: string): string;
|
|
389
|
+
/** The registry's pipe for a `pipe_ref`, or `null` when there is no registry or it lacks the pipe. */
|
|
390
|
+
declare function pipeOf(registry: TimelinePipeRegistry | undefined, pipeRef: string): PipeBlueprintUnion | null;
|
|
391
|
+
/** The registry's sequence for a `pipe_ref`, or `null` when it holds none by that ref. */
|
|
392
|
+
declare function sequenceOf(registry: TimelinePipeRegistry | undefined, pipeRef: string): PipeSequenceBlueprint | null;
|
|
393
|
+
/**
|
|
394
|
+
* The pipe step a sequence runs at a step number, or `null` when that number
|
|
395
|
+
* is a binding step, which runs no pipe, or is past the sequence's steps.
|
|
396
|
+
*/
|
|
397
|
+
declare function stepAt(sequence: PipeSequenceBlueprint, number: number): NumberedStep | null;
|
|
398
|
+
/**
|
|
399
|
+
* The pipe steps of a sequence numbered above `reached`, in order: the steps a
|
|
400
|
+
* running sequence has not reached yet, when `reached` is the highest step
|
|
401
|
+
* number the snapshot holds under it. Binding steps are left out: they run no
|
|
402
|
+
* pipe, so no line stands for them.
|
|
403
|
+
*/
|
|
404
|
+
declare function stepsAfter(sequence: PipeSequenceBlueprint, reached: number): NumberedStep[];
|
|
405
|
+
/** The step number a node stands at under its parent sequence, or `null` when its path's last segment is no step. */
|
|
406
|
+
declare function stepNumberOf(node: InvocationTreeNode): number | null;
|
|
407
|
+
/**
|
|
408
|
+
* Whether a registry sequence agrees with what the snapshot ran under it: each
|
|
409
|
+
* step the snapshot holds runs the pipe the sequence declares at that number,
|
|
410
|
+
* or, at a batching step, a batch. A registry of another version of the method
|
|
411
|
+
* fails this, and then nothing is read from it for that sequence.
|
|
412
|
+
*/
|
|
413
|
+
declare function sequenceMatches(sequence: PipeSequenceBlueprint, node: InvocationTreeNode): boolean;
|
|
414
|
+
/** The registry's sequence for a sequence invocation, when it agrees with what the snapshot ran under it. */
|
|
415
|
+
declare function joinedSequence(registry: TimelinePipeRegistry | undefined, node: InvocationTreeNode): PipeSequenceBlueprint | null;
|
|
416
|
+
/**
|
|
417
|
+
* A pipe's title by its `pipe_ref`: its description as a title, else its
|
|
418
|
+
* humanized code, `pipeCode` when given and otherwise the ref's last segment.
|
|
419
|
+
*/
|
|
420
|
+
declare function titleOf(registry: TimelinePipeRegistry | undefined, pipeRef: string, pipeCode?: string): JoinedTitle;
|
|
421
|
+
/** What a batch's one line is named after: the pipe its items run, and the name of an item. */
|
|
422
|
+
interface JoinedBatch {
|
|
423
|
+
/** The branch pipe's `pipe_ref`, or `null` when neither the registry nor the snapshot names it. */
|
|
424
|
+
branchRef: string | null;
|
|
425
|
+
/** The line's title: the branch's description, never the batch's own. */
|
|
426
|
+
title: JoinedTitle;
|
|
427
|
+
/** The item's name in a sentence (`filing`), or `null` when the registry does not name it. */
|
|
428
|
+
itemName: string | null;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* The branch and item of a batch invocation. Its branch is the batch
|
|
432
|
+
* blueprint's `branch_pipe_code` when the registry holds the batch; else the
|
|
433
|
+
* step spec of the sequence the batch stands in at its step number, which names
|
|
434
|
+
* the batched pipe and its item; else the `pipe_ref` its items run. Its title is
|
|
435
|
+
* the branch's, never the batch's own description, which a batch the runtime
|
|
436
|
+
* makes for a batching step words technically ("Batch processing for …").
|
|
437
|
+
* With nothing to name the branch, the batch's own code is humanized.
|
|
438
|
+
*/
|
|
439
|
+
declare function joinBatch(registry: TimelinePipeRegistry | undefined, node: InvocationTreeNode, parentSequence: PipeSequenceBlueprint | null): JoinedBatch;
|
|
440
|
+
|
|
441
|
+
export { sequenceOf as $, isItemNode as A, type BatchProgress as B, type ConditionProgress as C, DEFAULT_TIMELINE_STYLE as D, type ExecutionAttempt as E, isOrdinalSegment as F, isOutcomeNode as G, isRunEnded as H, type InvocationStatus as I, type JoinedBatch as J, isTimelineStyleId as K, joinBatch as L, joinedSequence as M, type NumberedStep as N, type OrdinalPathSegment as O, type ProgressSnapshot as P, lastPathSegment as Q, type RunProgressStatus as R, parentInvocationPath as S, type TimelineStyleId as T, type UnknownPathSegment as U, parsePathSegment as V, pipeOf as W, qualifyPipeCode as X, resolveTimelineStyle as Y, resolveTimelineStyleMenu as Z, sequenceMatches as _, type ProgressTimestamp as a, splitInvocationPath as a0, stepAt as a1, stepNumberOf as a2, stepsAfter as a3, timestampMs as a4, titleOf as a5, type TimelinePipeRegistry as b, type PathSegment as c, type ProgressInvocation as d, type ProgressDegradation as e, type ProgressMode as f, DEGRADATION_REASON as g, type DefaultPathSegment as h, INVOCATION_STATUS as i, type InvocationFailure as j, type InvocationTreeNode as k, type JoinedTitle as l, type OutcomePathSegment as m, PATH_SEGMENT_KIND as n, PROGRESS_MODE as o, type PathSegmentKind as p, RUN_PROGRESS_STATUS as q, TIMELINE_STYLE as r, TIMELINE_STYLES as s, TIMELINE_STYLE_IDS as t, type TimelineStyleDescriptor as u, buildInvocationTree as v, compareSiblings as w, compareTimestamps as x, decodeOutcomeKey as y, invocationPathDepth as z };
|