@demlik/tea 0.6.0 → 0.8.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/agent/index.d.ts +6 -5
- package/dist/agent/index.js +10 -10
- package/dist/authed-call/index.d.ts +2 -2
- package/dist/authed-call/index.js +7 -7
- package/dist/await-terminal/index.d.ts +3 -2
- package/dist/await-terminal/index.js +2 -2
- package/dist/batch-window/index.d.ts +4 -3
- package/dist/batch-window/index.js +3 -3
- package/dist/cache/index.d.ts +2 -2
- package/dist/cache/index.js +4 -4
- package/dist/chart/index.d.ts +217 -0
- package/dist/chart/index.js +16 -0
- package/dist/chart/index.js.map +1 -0
- package/dist/chart/inspect/index.d.ts +85 -0
- package/dist/chart/inspect/index.js +5 -0
- package/dist/chart/inspect/index.js.map +1 -0
- package/dist/chart/inspect/react.d.ts +112 -0
- package/dist/chart/inspect/react.js +11 -0
- package/dist/chart/inspect/react.js.map +1 -0
- package/dist/chart/inspect/styles.css +286 -0
- package/dist/chart/lane/index.d.ts +361 -0
- package/dist/chart/lane/index.js +9 -0
- package/dist/chart/lane/index.js.map +1 -0
- package/dist/chart/lane/react.d.ts +83 -0
- package/dist/chart/lane/react.js +559 -0
- package/dist/chart/lane/react.js.map +1 -0
- package/dist/chart/lane/styles.css +498 -0
- package/dist/chart/report/index.d.ts +116 -0
- package/dist/chart/report/index.js +32 -0
- package/dist/chart/report/index.js.map +1 -0
- package/dist/{chunk-2UGTDYOK.js → chunk-3JU6657S.js} +3 -3
- package/dist/{chunk-2UGTDYOK.js.map → chunk-3JU6657S.js.map} +1 -1
- package/dist/{chunk-AZ3NHUPD.js → chunk-4KTWLPL5.js} +3 -3
- package/dist/{chunk-AZ3NHUPD.js.map → chunk-4KTWLPL5.js.map} +1 -1
- package/dist/{chunk-ZH454CR5.js → chunk-5EHLEUTL.js} +24 -4
- package/dist/chunk-5EHLEUTL.js.map +1 -0
- package/dist/chunk-5KJKJOFC.js +758 -0
- package/dist/chunk-5KJKJOFC.js.map +1 -0
- package/dist/{chunk-WF46FABO.js → chunk-7SVIRMC6.js} +3 -3
- package/dist/{chunk-WF46FABO.js.map → chunk-7SVIRMC6.js.map} +1 -1
- package/dist/{chunk-XMHZ44QC.js → chunk-7V4EVLZA.js} +4 -4
- package/dist/{chunk-XMHZ44QC.js.map → chunk-7V4EVLZA.js.map} +1 -1
- package/dist/{chunk-IVHQCVFX.js → chunk-A56OR5RF.js} +3 -3
- package/dist/{chunk-IVHQCVFX.js.map → chunk-A56OR5RF.js.map} +1 -1
- package/dist/{chunk-O7ED34JH.js → chunk-B5VXOFMZ.js} +47 -15
- package/dist/chunk-B5VXOFMZ.js.map +1 -0
- package/dist/chunk-E6GEDSF4.js +307 -0
- package/dist/chunk-E6GEDSF4.js.map +1 -0
- package/dist/{chunk-EC6FO42Q.js → chunk-EUF7XOEE.js} +6 -6
- package/dist/{chunk-EC6FO42Q.js.map → chunk-EUF7XOEE.js.map} +1 -1
- package/dist/{chunk-XOAP3LOT.js → chunk-I5OV65MS.js} +3 -3
- package/dist/{chunk-XOAP3LOT.js.map → chunk-I5OV65MS.js.map} +1 -1
- package/dist/chunk-JER5O7PQ.js +416 -0
- package/dist/chunk-JER5O7PQ.js.map +1 -0
- package/dist/{chunk-ASX7PL2K.js → chunk-JGVL3WPL.js} +3 -3
- package/dist/{chunk-ASX7PL2K.js.map → chunk-JGVL3WPL.js.map} +1 -1
- package/dist/{chunk-S6Y3RNX4.js → chunk-JP5D6GSL.js} +4 -4
- package/dist/{chunk-S6Y3RNX4.js.map → chunk-JP5D6GSL.js.map} +1 -1
- package/dist/{chunk-ERYY5P6W.js → chunk-ND3DH6KM.js} +3 -3
- package/dist/{chunk-ERYY5P6W.js.map → chunk-ND3DH6KM.js.map} +1 -1
- package/dist/{chunk-A7USKARI.js → chunk-SUST46KO.js} +3 -3
- package/dist/{chunk-A7USKARI.js.map → chunk-SUST46KO.js.map} +1 -1
- package/dist/{chunk-2KBEIGYP.js → chunk-TP5UPGLY.js} +3 -3
- package/dist/{chunk-2KBEIGYP.js.map → chunk-TP5UPGLY.js.map} +1 -1
- package/dist/chunk-UOC2PL46.js +13 -0
- package/dist/chunk-UOC2PL46.js.map +1 -0
- package/dist/{chunk-66S2KEQQ.js → chunk-WLGO64WC.js} +4 -4
- package/dist/{chunk-66S2KEQQ.js.map → chunk-WLGO64WC.js.map} +1 -1
- package/dist/chunk-WRAA7GVZ.js +209 -0
- package/dist/chunk-WRAA7GVZ.js.map +1 -0
- package/dist/chunk-ZCL7SCBK.js +685 -0
- package/dist/chunk-ZCL7SCBK.js.map +1 -0
- package/dist/chunk-ZD6PNZBK.js +457 -0
- package/dist/chunk-ZD6PNZBK.js.map +1 -0
- package/dist/{chunk-UV7VCTNC.js → chunk-ZF6WDK2D.js} +7 -7
- package/dist/{chunk-UV7VCTNC.js.map → chunk-ZF6WDK2D.js.map} +1 -1
- package/dist/{core-CUN5HDKL.d.ts → core-Bjc0bS8j.d.ts} +22 -1
- package/dist/deadline/index.d.ts +2 -2
- package/dist/deadline/index.js +3 -3
- package/dist/devtools/index.js +2 -207
- package/dist/devtools/index.js.map +1 -1
- package/dist/do/index.d.ts +7 -6
- package/dist/do/index.js +10 -10
- package/dist/{durable-effects-CXMOi-sp.d.ts → durable-effects-D8SqU_if.d.ts} +1 -1
- package/dist/extension/index.d.ts +3 -2
- package/dist/extension/index.js +3 -3
- package/dist/extension/react.js +3 -3
- package/dist/extension/subs/index.d.ts +2 -2
- package/dist/fan-out/index.d.ts +3 -2
- package/dist/fold-Blbhru48.d.ts +435 -0
- package/dist/graph-CcjWZVrd.d.ts +923 -0
- package/dist/idempotent-intake/index.d.ts +3 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2 -2
- package/dist/llm-call/index.d.ts +2 -2
- package/dist/llm-call/index.js +7 -7
- package/dist/{machine-CoWpvp8x.d.ts → machine-0OmPvsy_.d.ts} +1 -1
- package/dist/machine-viz/index.d.ts +19 -2
- package/dist/machine-viz/index.js +4 -10
- package/dist/machine-viz/index.js.map +1 -1
- package/dist/mem/index.d.ts +3 -2
- package/dist/monitored-run/index.d.ts +4 -3
- package/dist/monitored-run/index.js +5 -5
- package/dist/node/index.d.ts +3 -2
- package/dist/paginated-walk/index.d.ts +2 -2
- package/dist/paginated-walk/index.js +7 -7
- package/dist/parity/index.d.ts +3 -2
- package/dist/parity/index.js +3 -3
- package/dist/pbt/arbitraries/index.d.ts +1 -1
- package/dist/pbt/index.d.ts +1 -1
- package/dist/pbt/index.js +3 -3
- package/dist/pbt/runners/index.d.ts +1 -1
- package/dist/pbt/runners/index.js +3 -3
- package/dist/poller/index.d.ts +28 -7
- package/dist/poller/index.js +3 -3
- package/dist/poller/index.js.map +1 -1
- package/dist/prediction/index.d.ts +1 -1
- package/dist/prediction/index.js +2 -2
- package/dist/pure/index.d.ts +1 -1
- package/dist/pure/index.js +2 -2
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +2 -2
- package/dist/reconciler/index.d.ts +2 -2
- package/dist/reconciler/index.js +7 -7
- package/dist/recorder/index.d.ts +3 -2
- package/dist/reducer-BqyoVyBG.d.ts +447 -0
- package/dist/resilient-call/index.d.ts +2 -2
- package/dist/resilient-call/index.js +6 -6
- package/dist/run-BVeqJDBF.d.ts +713 -0
- package/dist/{runtime-types-BD3ZFfdw.d.ts → runtime-types-Bxc637bp.d.ts} +53 -2
- package/dist/saga/index.d.ts +3 -2
- package/dist/samples-DCt6nF8H.d.ts +59 -0
- package/dist/snapshot/index.d.ts +1 -1
- package/dist/snapshot/index.js +3 -3
- package/dist/subs/index.d.ts +4 -3
- package/dist/subs/index.js +3 -3
- package/dist/testing/index.d.ts +3 -2
- package/dist/testing/index.js +2 -2
- package/dist/throttled-input/index.d.ts +2 -2
- package/dist/throttled-input/index.js +6 -6
- package/dist/token-refresh/index.d.ts +1 -1
- package/dist/token-refresh/index.js +3 -3
- package/dist/trace-replay/index.d.ts +3 -2
- package/dist/trace-replay/index.js +3 -3
- package/dist/{types-CjAkI83U.d.ts → types-D7u9DkH7.d.ts} +1 -1
- package/dist/with-deadline/index.d.ts +1 -1
- package/dist/with-deadline/index.js +2 -2
- package/dist/with-resilience/index.d.ts +2 -2
- package/dist/with-resilience/index.js +6 -6
- package/dist/with-telemetry/index.d.ts +1 -1
- package/dist/with-telemetry/index.js +2 -2
- package/dist/work-queue/adapter.d.ts +3 -2
- package/dist/work-queue/index.d.ts +3 -2
- package/dist/work-queue/ops.d.ts +3 -2
- package/dist/workflow/index.d.ts +3 -3
- package/package.json +31 -1
- package/dist/chunk-O7ED34JH.js.map +0 -1
- package/dist/chunk-ZH454CR5.js.map +0 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { g as EventPreview, d as ChartRefusal, I as InspectOptions, U as Unanswerable } from '../../reducer-BqyoVyBG.js';
|
|
2
|
+
import { P as PhaseStanding, I as ImportedLane, L as LogEntry, T as TaskState } from '../../fold-Blbhru48.js';
|
|
3
|
+
export { c as Lane, d as LaneChecks, e as LaneCmd, f as LaneErrorFinals, g as LaneHand, h as LaneHands, b as LaneHandsOf, i as LaneInitial, j as LaneMsg, k as LaneOf, l as LanePhaseName, m as LanePhaseOf, n as LanePhaseShape, o as LaneRegion, p as LaneRegions, q as LaneRunChecks, r as LaneRunMsg, s as LaneRunState, t as LaneRuntime, u as LaneShape, v as LaneShapeError, w as LaneSiblings, x as LaneSpec, y as LaneState, z as LaneSuccessFinals, a as LaneTaskChart, L as LaneTaskId, A as LaneTaskShape, B as LaneTasksIn, C as LaneTerminal, P as PhaseAtRest, D as defineLane, E as laneShape, F as runLane } from '../../run-BVeqJDBF.js';
|
|
4
|
+
import '../../graph-CcjWZVrd.js';
|
|
5
|
+
import '../../core-Bjc0bS8j.js';
|
|
6
|
+
import '../../samples-DCt6nF8H.js';
|
|
7
|
+
import '../index.js';
|
|
8
|
+
|
|
9
|
+
/** Why a task cannot move. `null` when it can. */
|
|
10
|
+
type StuckReason = {
|
|
11
|
+
/** It reached an error final: as finished as a shipped task, and lost. */
|
|
12
|
+
readonly kind: "tripped";
|
|
13
|
+
readonly state: string;
|
|
14
|
+
} | {
|
|
15
|
+
/**
|
|
16
|
+
* A non-final state that routes NOTHING. The chart's totality means this
|
|
17
|
+
* cannot happen on a chart that compiled — it is reported rather than
|
|
18
|
+
* swallowed because reaching it means a document declared a dead end, and
|
|
19
|
+
* a lane parked there will sit forever with no one to say why.
|
|
20
|
+
*/
|
|
21
|
+
readonly kind: "dead-end";
|
|
22
|
+
readonly state: string;
|
|
23
|
+
} | {
|
|
24
|
+
/** The retry budget is spent: the next guarded event is a one-way door. */
|
|
25
|
+
readonly kind: "budget-spent";
|
|
26
|
+
readonly state: string;
|
|
27
|
+
readonly event: string;
|
|
28
|
+
readonly landsOn: string;
|
|
29
|
+
} | {
|
|
30
|
+
/**
|
|
31
|
+
* Every event this state routes comes from the OUTSIDE WORLD — no `cmd`
|
|
32
|
+
* result and no `sub` will ever arrive here, so the lane advances only
|
|
33
|
+
* when a person acts.
|
|
34
|
+
*
|
|
35
|
+
* This is the fourth kind, and it was missing until a real epic was
|
|
36
|
+
* rendered and looked at: a task parked at a human approval reported
|
|
37
|
+
* "nothing is stuck — every task can still move", which is true of the
|
|
38
|
+
* machine and false of the day. Nothing will happen until someone does
|
|
39
|
+
* something, which is precisely what a stuck list is for.
|
|
40
|
+
*
|
|
41
|
+
* Derived from `from`, never from a state name: `roles` carries the
|
|
42
|
+
* consumer's own words for who is owed, in declaration order.
|
|
43
|
+
*/
|
|
44
|
+
readonly kind: "awaiting-world";
|
|
45
|
+
readonly state: string;
|
|
46
|
+
readonly roles: readonly string[];
|
|
47
|
+
readonly events: readonly string[];
|
|
48
|
+
};
|
|
49
|
+
/** One task of a lane, inspected. */
|
|
50
|
+
interface LaneTaskInspection {
|
|
51
|
+
readonly task: string;
|
|
52
|
+
readonly phase: string;
|
|
53
|
+
/** The leaf it is in right now, out of the fold. */
|
|
54
|
+
readonly state: string;
|
|
55
|
+
/** `false` still running, `true` a success final, `"error"` tripped. */
|
|
56
|
+
readonly endPolarity: false | true | "error";
|
|
57
|
+
/** The state it will resume to, while it is parked. `undefined` otherwise. */
|
|
58
|
+
readonly was?: string;
|
|
59
|
+
readonly retries: number;
|
|
60
|
+
readonly maxRetries: number;
|
|
61
|
+
/**
|
|
62
|
+
* The events this state routes, grouped by who sends them — {@link waitingOn},
|
|
63
|
+
* read rather than recomputed. `null` at a final. On a lane imported without
|
|
64
|
+
* a provenance map it degrades to the events alone, and says so.
|
|
65
|
+
*/
|
|
66
|
+
readonly waitingOn: string | null;
|
|
67
|
+
readonly stuck: StuckReason | null;
|
|
68
|
+
/** Every event of this task's alphabet, legal or refused, with the reason. */
|
|
69
|
+
readonly events: readonly EventPreview[];
|
|
70
|
+
/** The refused half of {@link LaneTaskInspection.events}, pulled out. */
|
|
71
|
+
readonly refusals: readonly ChartRefusal[];
|
|
72
|
+
/** The legal half, as names — the button row. */
|
|
73
|
+
readonly legal: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
/** One phase of a lane, inspected. */
|
|
76
|
+
interface LanePhaseInspection {
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly index: number;
|
|
79
|
+
readonly standing: PhaseStanding;
|
|
80
|
+
/** The phase's tasks, each inspected — running concurrently, all of them. */
|
|
81
|
+
readonly tasks: readonly LaneTaskInspection[];
|
|
82
|
+
/** The tasks in this phase sitting on an error final. */
|
|
83
|
+
readonly tripped: readonly string[];
|
|
84
|
+
}
|
|
85
|
+
/** A whole lane, as data a UI can build itself from. */
|
|
86
|
+
interface LaneInspection {
|
|
87
|
+
readonly id?: string;
|
|
88
|
+
readonly status: "active" | "done";
|
|
89
|
+
/** The terminal it landed on, or `null` while it is still running. */
|
|
90
|
+
readonly terminal: string | null;
|
|
91
|
+
/** The phase running right now, or `null` once the lane has ended. */
|
|
92
|
+
readonly activePhase: string | null;
|
|
93
|
+
readonly phases: readonly LanePhaseInspection[];
|
|
94
|
+
/** Every task on an error final, lane-wide — fabrika's `context.errors`. */
|
|
95
|
+
readonly tripped: readonly string[];
|
|
96
|
+
/** Every task that cannot move, and why. The list a human is paged on. */
|
|
97
|
+
readonly stuck: readonly {
|
|
98
|
+
readonly task: string;
|
|
99
|
+
readonly reason: StuckReason;
|
|
100
|
+
}[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A whole lane, inspected at the state its log folds to.
|
|
104
|
+
*
|
|
105
|
+
* ```ts
|
|
106
|
+
* const lane = chartFromWorkflow(JSON.parse(workflowJson));
|
|
107
|
+
* const view = inspectLane(lane, parseEventsJsonl(eventsJsonl));
|
|
108
|
+
* view.activePhase; // "phase2"
|
|
109
|
+
* view.phases[1]?.tasks[0]; // state, waiting-on, legal events, refusals
|
|
110
|
+
* view.stuck; // what a human has to go and do
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* Takes the LOG rather than a folded state, deliberately: the fold is pure over
|
|
114
|
+
* a prefix, so `inspectLane(lane, entries.slice(0, k))` is the exact view at
|
|
115
|
+
* step k and time travel costs a `slice`.
|
|
116
|
+
*/
|
|
117
|
+
declare function inspectLane(lane: ImportedLane, entries: readonly LogEntry[], optsFor?: (taskId: string) => InspectOptions): LaneInspection;
|
|
118
|
+
/**
|
|
119
|
+
* The same view, from the LEAVES rather than from a log.
|
|
120
|
+
*
|
|
121
|
+
* The two callers differ in exactly one thing and it is which of these doors
|
|
122
|
+
* they come through. A reader holding `workflow.json` + `events.jsonl` has no
|
|
123
|
+
* states, so it folds — {@link inspectLane}. A reader watching a lane RUN has
|
|
124
|
+
* the states and no log worth folding: `runLane` boots each region where its
|
|
125
|
+
* sub-issue actually is, so re-deriving the leaves from a log that starts at
|
|
126
|
+
* every chart's `initial: true` would answer a different question than the one
|
|
127
|
+
* on screen. It hands the leaves it has.
|
|
128
|
+
*
|
|
129
|
+
* @param optsFor per-task {@link InspectOptions} — the `parts` bag and the
|
|
130
|
+
* sample payloads, which only the LIVE door has. Omit it and every preview
|
|
131
|
+
* degrades honestly, exactly as `inspectState` does with no bag at all.
|
|
132
|
+
*/
|
|
133
|
+
declare function inspectLaneStates(lane: ImportedLane, states: Readonly<Record<string, TaskState>>, optsFor?: (taskId: string) => InspectOptions): LaneInspection;
|
|
134
|
+
|
|
135
|
+
/** A task's retry bookkeeping, when the source carries it. */
|
|
136
|
+
interface RetryBudget {
|
|
137
|
+
readonly retries: number;
|
|
138
|
+
readonly maxRetries: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* One event control, for one task.
|
|
142
|
+
*
|
|
143
|
+
* `send` is where the two sources part company, and it is a VALUE rather than a
|
|
144
|
+
* flag: the answer to "what would clicking this dispatch" is the msg itself, so
|
|
145
|
+
* a source that can answer it answers with the msg, and a source that cannot
|
|
146
|
+
* holds the reason. There is no third state and no boolean to get backwards.
|
|
147
|
+
*/
|
|
148
|
+
interface LaneControl {
|
|
149
|
+
readonly task: string;
|
|
150
|
+
readonly event: string;
|
|
151
|
+
/** `"legal"`, or the refusal's kind — the CSS hook, as in `<ChartInspector>`. */
|
|
152
|
+
readonly kind: string;
|
|
153
|
+
readonly refused: boolean;
|
|
154
|
+
/** The refusal's one-line explanation. Present iff refused. */
|
|
155
|
+
readonly why?: string;
|
|
156
|
+
/** Where this would land and what it would fire — the DECLARED answer. */
|
|
157
|
+
readonly outcome: string;
|
|
158
|
+
/** The msg a click dispatches, or why this source cannot offer one. */
|
|
159
|
+
readonly send: {
|
|
160
|
+
readonly type: string;
|
|
161
|
+
} | Unanswerable<"dispatch">;
|
|
162
|
+
}
|
|
163
|
+
/** One task of the lane, at the scrubbed moment. */
|
|
164
|
+
interface LaneTaskView {
|
|
165
|
+
readonly task: string;
|
|
166
|
+
readonly phase: string;
|
|
167
|
+
readonly state: string;
|
|
168
|
+
readonly endPolarity: false | true | "error";
|
|
169
|
+
/**
|
|
170
|
+
* The state it resumes to — present ONLY while the task is actually parked.
|
|
171
|
+
* A region keeps `was` after it leaves the park, and rendering that made a
|
|
172
|
+
* finished task claim a return it cannot make.
|
|
173
|
+
*/
|
|
174
|
+
readonly was?: string;
|
|
175
|
+
/** Grouped by who sends them — `report.ts`'s own derivation. `null` at a final. */
|
|
176
|
+
readonly waitingOn: string | null;
|
|
177
|
+
readonly stuck: StuckReason | null;
|
|
178
|
+
/**
|
|
179
|
+
* `false` while the task still sits at its chart's entry state.
|
|
180
|
+
*
|
|
181
|
+
* The editorial rule's input: a task that has not moved has a story one line
|
|
182
|
+
* long, and six of them side by side are six copies of one picture.
|
|
183
|
+
*/
|
|
184
|
+
readonly moved: boolean;
|
|
185
|
+
readonly budget: RetryBudget | Unanswerable<"retries">;
|
|
186
|
+
readonly controls: readonly LaneControl[];
|
|
187
|
+
/** This region, drawn at this moment. See {@link draw}. */
|
|
188
|
+
readonly diagram: string;
|
|
189
|
+
}
|
|
190
|
+
/** One phase of the lane, at the scrubbed moment. */
|
|
191
|
+
interface LanePhaseView {
|
|
192
|
+
readonly name: string;
|
|
193
|
+
readonly index: number;
|
|
194
|
+
readonly standing: PhaseStanding;
|
|
195
|
+
readonly tasks: readonly LaneTaskView[];
|
|
196
|
+
/** The tasks in this phase sitting on an error final. */
|
|
197
|
+
readonly tripped: readonly string[];
|
|
198
|
+
/**
|
|
199
|
+
* The tasks worth showing in full, by id — `report.ts`'s rule, applied.
|
|
200
|
+
*
|
|
201
|
+
* Only the ACTIVE phase expands anything: a finished phase's story is which
|
|
202
|
+
* ending each of its tasks reached, and a phase that never started has no
|
|
203
|
+
* story at all. Within the active phase, a task that has moved is expanded and
|
|
204
|
+
* a task still at its entry state is not — unless NOTHING in the phase has
|
|
205
|
+
* moved, in which case the first is the representative, because collapsing
|
|
206
|
+
* every task would leave the reader with no picture at all.
|
|
207
|
+
*/
|
|
208
|
+
readonly expanded: readonly string[];
|
|
209
|
+
}
|
|
210
|
+
/** One step of the run, as the timeline table draws it. */
|
|
211
|
+
interface LaneStepView {
|
|
212
|
+
readonly index: number;
|
|
213
|
+
readonly task: string;
|
|
214
|
+
/** The event VERBATIM — the source's own spelling. */
|
|
215
|
+
readonly event: string;
|
|
216
|
+
readonly from: string;
|
|
217
|
+
readonly to: string;
|
|
218
|
+
/** The edge that fired, keyed as the drawing keys it. */
|
|
219
|
+
readonly edge: string;
|
|
220
|
+
/**
|
|
221
|
+
* The msg arrived and NOTHING happened — the chart routes no such edge here.
|
|
222
|
+
*
|
|
223
|
+
* A total chart answers every msg, so a refused one is still a line in the
|
|
224
|
+
* log and still a step of the tape; it is just not a WALK. Left unmarked it
|
|
225
|
+
* reads as a real transition that happened to land where it started
|
|
226
|
+
* (`issue_1 DONE review → review`), which is the one row on the timeline a
|
|
227
|
+
* reader would take at face value and be wrong about.
|
|
228
|
+
*/
|
|
229
|
+
readonly refused: boolean;
|
|
230
|
+
}
|
|
231
|
+
/** A whole lane, at one moment, ready to render. */
|
|
232
|
+
interface LaneViewModel {
|
|
233
|
+
readonly source: "replay" | "live";
|
|
234
|
+
readonly title: string;
|
|
235
|
+
readonly status: "active" | "done";
|
|
236
|
+
/** The terminal it landed on, or `null` while it is still running. */
|
|
237
|
+
readonly terminal: string | null;
|
|
238
|
+
readonly activePhase: string | null;
|
|
239
|
+
/** Every task on an error final, lane-wide. */
|
|
240
|
+
readonly tripped: readonly string[];
|
|
241
|
+
/**
|
|
242
|
+
* WHICH OF TWELVE THINGS IS STUCK — the reader's first question, answered
|
|
243
|
+
* first. `inspectLane`'s own list, with the phase attached so the answer names
|
|
244
|
+
* a place as well as a task.
|
|
245
|
+
*/
|
|
246
|
+
readonly stuck: readonly {
|
|
247
|
+
readonly task: string;
|
|
248
|
+
readonly phase: string;
|
|
249
|
+
readonly reason: StuckReason;
|
|
250
|
+
}[];
|
|
251
|
+
readonly phases: readonly LanePhaseView[];
|
|
252
|
+
/** Every step up to the cursor. */
|
|
253
|
+
readonly steps: readonly LaneStepView[];
|
|
254
|
+
/**
|
|
255
|
+
* When each step happened, indexed by step — or why this source cannot say.
|
|
256
|
+
*
|
|
257
|
+
* A fabrika log stamps every line. A recorded tape carries ORDER and nothing
|
|
258
|
+
* else, so the live source answers this with the reason rather than with a
|
|
259
|
+
* column of invented times.
|
|
260
|
+
*/
|
|
261
|
+
readonly clock: readonly string[] | Unanswerable<"clock">;
|
|
262
|
+
readonly cursor: number;
|
|
263
|
+
readonly total: number;
|
|
264
|
+
/** `true` while the cursor is behind the present. */
|
|
265
|
+
readonly scrubbed: boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Why THIS SOURCE can dispatch nothing at all — absent on a source that can.
|
|
268
|
+
*
|
|
269
|
+
* A fact about the source, so it is stated once by the source rather than
|
|
270
|
+
* scraped back off whichever control still happens to carry it. Scraping is
|
|
271
|
+
* what it used to be, and it went silent on exactly the lane that needed it
|
|
272
|
+
* most: on a finished lane every control is refused BY THE CHART, so the one
|
|
273
|
+
* sentence explaining why the whole page is dead had nowhere left to live.
|
|
274
|
+
*/
|
|
275
|
+
readonly noDispatch?: Unanswerable<"dispatch">;
|
|
276
|
+
}
|
|
277
|
+
/** Every region's leaf, keyed by task. */
|
|
278
|
+
type LaneLeaves = Readonly<Record<string, TaskState>>;
|
|
279
|
+
/**
|
|
280
|
+
* What a lane view is fed. Two implementations, {@link replayFeed} and
|
|
281
|
+
* {@link liveFeed}, and the component branches on none of it.
|
|
282
|
+
*/
|
|
283
|
+
interface LaneFeed {
|
|
284
|
+
readonly kind: "replay" | "live";
|
|
285
|
+
readonly lane: ImportedLane;
|
|
286
|
+
/** How many steps have happened — the scrubber's extent. */
|
|
287
|
+
readonly total: number;
|
|
288
|
+
/** Every region's leaf after the first `n` steps. EXACT, on both sides. */
|
|
289
|
+
readonly leavesAt: (n: number) => LaneLeaves;
|
|
290
|
+
/** The steps, in order. */
|
|
291
|
+
readonly steps: readonly LaneStepView[];
|
|
292
|
+
/** {@link LaneViewModel.clock}. */
|
|
293
|
+
readonly clock: readonly string[] | Unanswerable<"clock">;
|
|
294
|
+
/** The retry budget, or why this source cannot state it. */
|
|
295
|
+
readonly budget: (task: string, leaves: LaneLeaves) => RetryBudget | Unanswerable<"retries">;
|
|
296
|
+
/** The `parts` bag and samples, per task. Absent where there are none. */
|
|
297
|
+
readonly optsFor?: (task: string) => InspectOptions;
|
|
298
|
+
/**
|
|
299
|
+
* What a click dispatches — or why this source offers no click.
|
|
300
|
+
*
|
|
301
|
+
* The task is a parameter because a lane's dispatch surface is addressed:
|
|
302
|
+
* `compile(chart, parts, taskId)` keys the table `${task}.${event}`, so the
|
|
303
|
+
* msg a control sends is the region's event WEARING its task. The preview's
|
|
304
|
+
* own `msg` is the bare one; namespacing it is the feed's job, once.
|
|
305
|
+
*/
|
|
306
|
+
readonly send: (task: string, preview: EventPreview) => LaneControl["send"];
|
|
307
|
+
/** {@link LaneViewModel.noDispatch} — set it iff NO control of this source can be sent. */
|
|
308
|
+
readonly noDispatch?: Unanswerable<"dispatch">;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* THE FABRIKA CASE: a lane plus the log it actually produced.
|
|
312
|
+
*
|
|
313
|
+
* Every field is the report module's own function. The scrubber is
|
|
314
|
+
* `foldLane(lane, entries.slice(0, n))`, which is not an approximation of the
|
|
315
|
+
* state at step n — it is the definition of it.
|
|
316
|
+
*/
|
|
317
|
+
declare function replayFeed(lane: ImportedLane, entries: readonly LogEntry[]): LaneFeed;
|
|
318
|
+
/** A running region's leaf: a state name, plus whatever ctx that chart keeps. */
|
|
319
|
+
type RunningLeaf = {
|
|
320
|
+
readonly type: string;
|
|
321
|
+
} & Readonly<Record<string, unknown>>;
|
|
322
|
+
/** What {@link liveFeed} needs from the runtime it is watching. */
|
|
323
|
+
interface LiveFeedInput {
|
|
324
|
+
/**
|
|
325
|
+
* The regions after the first `n` recorded msgs, by PURE replay — `init` +
|
|
326
|
+
* `update` only, exactly as `<ChartInspector>`'s scrubber does it.
|
|
327
|
+
*/
|
|
328
|
+
readonly regionsAt: (n: number) => Readonly<Record<string, RunningLeaf>>;
|
|
329
|
+
/** The recorded tape: `${task}.${event}` per step, in order. */
|
|
330
|
+
readonly msgs: readonly {
|
|
331
|
+
readonly type: string;
|
|
332
|
+
}[];
|
|
333
|
+
/** The `parts` bag and samples, per task — the hands the run was given. */
|
|
334
|
+
readonly optsFor?: (task: string) => InspectOptions;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* THE RUNNING CASE: a lane under `runLane`, watched.
|
|
338
|
+
*
|
|
339
|
+
* The leaves come off the RUNTIME rather than off a fold, and that distinction
|
|
340
|
+
* is load-bearing: `runLane` boots each region where its sub-issue actually is,
|
|
341
|
+
* so a fold that started every task at its chart's `initial: true` would draw a
|
|
342
|
+
* different lane than the one running.
|
|
343
|
+
*
|
|
344
|
+
* The steps are derived from the same replay: `from` is the leaf before the msg
|
|
345
|
+
* and `to` is the leaf after, both exact, and the edge they walked is
|
|
346
|
+
* {@link walkedEdgeKey} — the fold's own answer, so the live drawing thickens
|
|
347
|
+
* the same edges the markdown would.
|
|
348
|
+
*/
|
|
349
|
+
declare function liveFeed(lane: ImportedLane, input: LiveFeedInput): LaneFeed;
|
|
350
|
+
/**
|
|
351
|
+
* The lane at step `cursor`, as one value a view renders straight.
|
|
352
|
+
*
|
|
353
|
+
* ```ts
|
|
354
|
+
* const feed = replayFeed(chartFromWorkflow(document), parseEventsJsonl(log));
|
|
355
|
+
* const view = laneView(feed, feed.total); // now
|
|
356
|
+
* const then = laneView(feed, 3); // exactly after three events
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
declare function laneView(feed: LaneFeed, cursor: number, title?: string): LaneViewModel;
|
|
360
|
+
|
|
361
|
+
export { type LaneControl, type LaneFeed, type LaneInspection, type LaneLeaves, type LanePhaseInspection, type LanePhaseView, type LaneStepView, type LaneTaskInspection, type LaneTaskView, type LaneViewModel, type LiveFeedInput, type RetryBudget, type RunningLeaf, type StuckReason, inspectLane, inspectLaneStates, laneView, liveFeed, replayFeed };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { LaneShapeError, defineLane, inspectLane, inspectLaneStates, laneShape, laneView, liveFeed, replayFeed, runLane } from '../../chunk-ZCL7SCBK.js';
|
|
2
|
+
import '../../chunk-ZD6PNZBK.js';
|
|
3
|
+
import '../../chunk-5KJKJOFC.js';
|
|
4
|
+
import '../../chunk-E6GEDSF4.js';
|
|
5
|
+
import '../../chunk-UOC2PL46.js';
|
|
6
|
+
import '../../chunk-5EHLEUTL.js';
|
|
7
|
+
import '../../chunk-B5VXOFMZ.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as Samples } from '../../samples-DCt6nF8H.js';
|
|
3
|
+
import { I as ImportedLane, L as LogEntry } from '../../fold-Blbhru48.js';
|
|
4
|
+
import { L as LaneTaskId, a as LaneTaskChart, b as LaneHandsOf } from '../../run-BVeqJDBF.js';
|
|
5
|
+
import '../../graph-CcjWZVrd.js';
|
|
6
|
+
import '../../core-Bjc0bS8j.js';
|
|
7
|
+
import '../index.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Everything `<LaneView>` needs, and it is the two files a fabrika lane IS.
|
|
11
|
+
*
|
|
12
|
+
* There is no prop for the phases, the tasks, the states, the standings, the
|
|
13
|
+
* terminal or what anything is waiting on: every one of those is derived from
|
|
14
|
+
* these two, and a prop restating one would be the fact said twice.
|
|
15
|
+
*/
|
|
16
|
+
interface LaneViewProps {
|
|
17
|
+
/** The lane. `chartFromWorkflow(document)` or `defineLane(spec)` — either door. */
|
|
18
|
+
readonly lane: ImportedLane;
|
|
19
|
+
/** Its event log — `parseEventsJsonl(...)` or `parseHistoryJson(...)`. */
|
|
20
|
+
readonly log: readonly LogEntry[];
|
|
21
|
+
/** Heading. Cosmetic — defaults to the document's own `id`. */
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
/** Appended to the container's class list. */
|
|
24
|
+
readonly className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One sample bag per task, each typed by THAT task's chart.
|
|
28
|
+
*
|
|
29
|
+
* The one thing a lane genuinely cannot derive, and the only reason it is a
|
|
30
|
+
* prop: `ty<T>()` is `{}` at runtime, so a payload's shape is erased before any
|
|
31
|
+
* runtime code could read it. Optional per task, because a task whose events
|
|
32
|
+
* declare no payload has nothing to supply.
|
|
33
|
+
*
|
|
34
|
+
* WHAT A LANE LOSES, said here rather than found out. `defineLane` LOWERS its
|
|
35
|
+
* charts to the runtime-typed form the fold and the drawing share, and that form
|
|
36
|
+
* records which events a state routes and NOT which of them declare a payload.
|
|
37
|
+
* So no control is ever reported as blocked for want of a sample: a msg is built
|
|
38
|
+
* either way, with the sample merged in when one was given. Supply one where a
|
|
39
|
+
* guard reads a payload field, and the guard preview reads the field you meant.
|
|
40
|
+
*/
|
|
41
|
+
type LaneSamples<L> = {
|
|
42
|
+
readonly [T in LaneTaskId<L>]?: Samples<LaneTaskChart<L, T>>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Everything `<LiveLaneView>` needs — the lane, and the hands `runLane` demands.
|
|
46
|
+
*
|
|
47
|
+
* `hands` is not a restatement of the lane: it is the code the lane deliberately
|
|
48
|
+
* does not own (each region's `parts`, and where each instance BOOTS, which an
|
|
49
|
+
* emitted epic decides per sub-issue). It is the same bag `runLane` takes, so
|
|
50
|
+
* an author passes the one they already built.
|
|
51
|
+
*/
|
|
52
|
+
interface LiveLaneViewProps<L, H, Ctx> {
|
|
53
|
+
readonly lane: L;
|
|
54
|
+
/** The parts and boot state per task — the same bag `runLane` demands. */
|
|
55
|
+
readonly hands: H;
|
|
56
|
+
/** One payload sample per event that declares one, per task. */
|
|
57
|
+
readonly samples?: LaneSamples<L>;
|
|
58
|
+
/** The runtime ctx. Omit for a lane whose regions read nothing from one. */
|
|
59
|
+
readonly ctx?: Ctx;
|
|
60
|
+
readonly title?: string;
|
|
61
|
+
readonly className?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A lane that has already run, looked at: the REPLAY source.
|
|
65
|
+
*
|
|
66
|
+
* The scrubber folds a prefix of the real log, which is not an approximation of
|
|
67
|
+
* the state at step k but the definition of it (`fold.ts`), so dragging it
|
|
68
|
+
* backwards shows exactly what the driver would have printed at that moment.
|
|
69
|
+
* Nothing is dispatchable and every control says why.
|
|
70
|
+
*/
|
|
71
|
+
declare function LaneView(props: LaneViewProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
/**
|
|
73
|
+
* The same page over a lane that is RUNNING — the LIVE source.
|
|
74
|
+
*
|
|
75
|
+
* It owns a runtime for its lifetime (`runLane`'s `init`/`update`, built into a
|
|
76
|
+
* `Machine` here rather than asked for, so the drawing and the runtime provably
|
|
77
|
+
* come from the same lane) and records it, so the scrubber time-travels by the
|
|
78
|
+
* same pure `replay` `<ChartInspector>`'s does: `init` + `update` only, never
|
|
79
|
+
* `interpret`, so dragging backwards cannot re-fire an effect.
|
|
80
|
+
*/
|
|
81
|
+
declare function LiveLaneView<L extends ImportedLane, const H extends LaneHandsOf<L, H>, Ctx = Record<never, never>>(props: LiveLaneViewProps<L, H, Ctx>): react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
export { type LaneSamples, LaneView, type LaneViewProps, LiveLaneView, type LiveLaneViewProps };
|