@invana/blocks 0.0.32
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 +52 -0
- package/dist/index.cjs +2095 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2245 -0
- package/dist/index.d.ts +2245 -0
- package/dist/index.js +2018 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2245 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MetricTone } from '@invana/ui';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Every block, by kind. A block that returns a value names its type in
|
|
6
|
+
* `returns` (as the spec writes it) and is what an ask turn holds; the rest
|
|
7
|
+
* only show data and are what an answer turn holds. Both are blocks.
|
|
8
|
+
*/
|
|
9
|
+
declare const BLOCKS: readonly [{
|
|
10
|
+
readonly id: "confirm";
|
|
11
|
+
readonly name: "Confirm";
|
|
12
|
+
readonly returns: "boolean";
|
|
13
|
+
readonly tier: "today";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "single";
|
|
16
|
+
readonly name: "Single choice";
|
|
17
|
+
readonly returns: "string";
|
|
18
|
+
readonly tier: "today";
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "multi";
|
|
21
|
+
readonly name: "Multiple choice";
|
|
22
|
+
readonly returns: "string[]";
|
|
23
|
+
readonly tier: "today";
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "quick";
|
|
26
|
+
readonly name: "Quick pick";
|
|
27
|
+
readonly returns: "string";
|
|
28
|
+
readonly tier: "today";
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "period";
|
|
31
|
+
readonly name: "Period";
|
|
32
|
+
readonly returns: "{from, to, label}";
|
|
33
|
+
readonly tier: "today";
|
|
34
|
+
}, {
|
|
35
|
+
readonly id: "number";
|
|
36
|
+
readonly name: "Number";
|
|
37
|
+
readonly returns: "number";
|
|
38
|
+
readonly tier: "today";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "short";
|
|
41
|
+
readonly name: "Short text";
|
|
42
|
+
readonly returns: "string";
|
|
43
|
+
readonly tier: "today";
|
|
44
|
+
}, {
|
|
45
|
+
readonly id: "long";
|
|
46
|
+
readonly name: "Long text";
|
|
47
|
+
readonly returns: "string";
|
|
48
|
+
readonly tier: "today";
|
|
49
|
+
}, {
|
|
50
|
+
readonly id: "entity";
|
|
51
|
+
readonly name: "Entity pick";
|
|
52
|
+
readonly returns: "id[]";
|
|
53
|
+
readonly tier: "next";
|
|
54
|
+
}, {
|
|
55
|
+
readonly id: "scale";
|
|
56
|
+
readonly name: "Scale";
|
|
57
|
+
readonly returns: "1–5";
|
|
58
|
+
readonly tier: "today";
|
|
59
|
+
}, {
|
|
60
|
+
readonly id: "multistep";
|
|
61
|
+
readonly name: "Multi-step";
|
|
62
|
+
readonly returns: "Record<id, value>";
|
|
63
|
+
readonly tier: "today";
|
|
64
|
+
}, {
|
|
65
|
+
readonly id: "form";
|
|
66
|
+
readonly name: "Form";
|
|
67
|
+
readonly returns: "Record<field, value>";
|
|
68
|
+
readonly tier: "next";
|
|
69
|
+
}, {
|
|
70
|
+
readonly id: "weights";
|
|
71
|
+
readonly name: "Weights";
|
|
72
|
+
readonly returns: "Record<objective, 0–100>";
|
|
73
|
+
readonly tier: "today";
|
|
74
|
+
}, {
|
|
75
|
+
readonly id: "approval";
|
|
76
|
+
readonly name: "Approval";
|
|
77
|
+
readonly returns: "approve | reject";
|
|
78
|
+
readonly tier: "today";
|
|
79
|
+
}, {
|
|
80
|
+
readonly id: "interpretation";
|
|
81
|
+
readonly name: "Interpretation";
|
|
82
|
+
readonly returns: "Record<slot, value>";
|
|
83
|
+
readonly tier: "today";
|
|
84
|
+
}, {
|
|
85
|
+
readonly id: "fork";
|
|
86
|
+
readonly name: "Reading fork";
|
|
87
|
+
readonly returns: "readingId";
|
|
88
|
+
readonly tier: "next";
|
|
89
|
+
}, {
|
|
90
|
+
readonly id: "plan";
|
|
91
|
+
readonly name: "Plan preview";
|
|
92
|
+
readonly returns: "stepId[]";
|
|
93
|
+
readonly tier: "next";
|
|
94
|
+
}, {
|
|
95
|
+
readonly id: "modelspec";
|
|
96
|
+
readonly name: "Model spec";
|
|
97
|
+
readonly returns: "{outcome, predictors[], group?, controls[]}";
|
|
98
|
+
readonly tier: "next";
|
|
99
|
+
}, {
|
|
100
|
+
readonly id: "hypothesis";
|
|
101
|
+
readonly name: "Hypothesis";
|
|
102
|
+
readonly returns: "{test, tails, alpha}";
|
|
103
|
+
readonly tier: "next";
|
|
104
|
+
}, {
|
|
105
|
+
readonly id: "range";
|
|
106
|
+
readonly name: "Range";
|
|
107
|
+
readonly returns: "{min, max}";
|
|
108
|
+
readonly tier: "next";
|
|
109
|
+
}, {
|
|
110
|
+
readonly id: "suggestions";
|
|
111
|
+
readonly name: "Suggestions";
|
|
112
|
+
readonly returns: "string";
|
|
113
|
+
readonly tier: "today";
|
|
114
|
+
}, {
|
|
115
|
+
readonly id: "narrative";
|
|
116
|
+
readonly name: "Narrative";
|
|
117
|
+
readonly tier: "today";
|
|
118
|
+
}, {
|
|
119
|
+
readonly id: "metric";
|
|
120
|
+
readonly name: "Metric";
|
|
121
|
+
readonly tier: "today";
|
|
122
|
+
}, {
|
|
123
|
+
readonly id: "grid";
|
|
124
|
+
readonly name: "Metric grid";
|
|
125
|
+
readonly tier: "today";
|
|
126
|
+
}, {
|
|
127
|
+
readonly id: "table";
|
|
128
|
+
readonly name: "Table preview";
|
|
129
|
+
readonly tier: "today";
|
|
130
|
+
}, {
|
|
131
|
+
readonly id: "attr";
|
|
132
|
+
readonly name: "Attribute matrix";
|
|
133
|
+
readonly tier: "today";
|
|
134
|
+
}, {
|
|
135
|
+
readonly id: "record";
|
|
136
|
+
readonly name: "Record";
|
|
137
|
+
readonly tier: "today";
|
|
138
|
+
}, {
|
|
139
|
+
readonly id: "ranked";
|
|
140
|
+
readonly name: "Ranked list";
|
|
141
|
+
readonly tier: "today";
|
|
142
|
+
}, {
|
|
143
|
+
readonly id: "timeseries";
|
|
144
|
+
readonly name: "Time series";
|
|
145
|
+
readonly tier: "today";
|
|
146
|
+
}, {
|
|
147
|
+
readonly id: "bars";
|
|
148
|
+
readonly name: "Bar comparison";
|
|
149
|
+
readonly tier: "next";
|
|
150
|
+
}, {
|
|
151
|
+
readonly id: "waterfall";
|
|
152
|
+
readonly name: "Bridge";
|
|
153
|
+
readonly tier: "next";
|
|
154
|
+
}, {
|
|
155
|
+
readonly id: "matrix";
|
|
156
|
+
readonly name: "Matrix";
|
|
157
|
+
readonly tier: "next";
|
|
158
|
+
}, {
|
|
159
|
+
readonly id: "funnel";
|
|
160
|
+
readonly name: "Funnel";
|
|
161
|
+
readonly tier: "next";
|
|
162
|
+
}, {
|
|
163
|
+
readonly id: "histogram";
|
|
164
|
+
readonly name: "Distribution";
|
|
165
|
+
readonly tier: "next";
|
|
166
|
+
}, {
|
|
167
|
+
readonly id: "timeline";
|
|
168
|
+
readonly name: "Timeline";
|
|
169
|
+
readonly tier: "today";
|
|
170
|
+
}, {
|
|
171
|
+
readonly id: "subgraph";
|
|
172
|
+
readonly name: "Subgraph";
|
|
173
|
+
readonly tier: "later";
|
|
174
|
+
}, {
|
|
175
|
+
readonly id: "method";
|
|
176
|
+
readonly name: "Method";
|
|
177
|
+
readonly tier: "today";
|
|
178
|
+
}, {
|
|
179
|
+
readonly id: "citations";
|
|
180
|
+
readonly name: "Citations";
|
|
181
|
+
readonly tier: "today";
|
|
182
|
+
}, {
|
|
183
|
+
readonly id: "files";
|
|
184
|
+
readonly name: "Files";
|
|
185
|
+
readonly tier: "today";
|
|
186
|
+
}, {
|
|
187
|
+
readonly id: "proposal";
|
|
188
|
+
readonly name: "Proposal";
|
|
189
|
+
readonly tier: "today";
|
|
190
|
+
}, {
|
|
191
|
+
readonly id: "cannot";
|
|
192
|
+
readonly name: "Cannot answer";
|
|
193
|
+
readonly tier: "today";
|
|
194
|
+
}, {
|
|
195
|
+
readonly id: "caveat";
|
|
196
|
+
readonly name: "Caveat";
|
|
197
|
+
readonly tier: "today";
|
|
198
|
+
}, {
|
|
199
|
+
readonly id: "scope";
|
|
200
|
+
readonly name: "Scope line";
|
|
201
|
+
readonly tier: "today";
|
|
202
|
+
}, {
|
|
203
|
+
readonly id: "checks";
|
|
204
|
+
readonly name: "Checks";
|
|
205
|
+
readonly tier: "next";
|
|
206
|
+
}, {
|
|
207
|
+
readonly id: "trace";
|
|
208
|
+
readonly name: "Progress trace";
|
|
209
|
+
readonly tier: "today";
|
|
210
|
+
}, {
|
|
211
|
+
readonly id: "activity";
|
|
212
|
+
readonly name: "Layer activity";
|
|
213
|
+
readonly tier: "today";
|
|
214
|
+
}, {
|
|
215
|
+
readonly id: "gantt";
|
|
216
|
+
readonly name: "Task timeline";
|
|
217
|
+
readonly tier: "today";
|
|
218
|
+
}, {
|
|
219
|
+
readonly id: "heatstrip";
|
|
220
|
+
readonly name: "Heat strip";
|
|
221
|
+
readonly tier: "today";
|
|
222
|
+
}, {
|
|
223
|
+
readonly id: "test";
|
|
224
|
+
readonly name: "Test result";
|
|
225
|
+
readonly tier: "next";
|
|
226
|
+
}, {
|
|
227
|
+
readonly id: "coef";
|
|
228
|
+
readonly name: "Coefficients";
|
|
229
|
+
readonly tier: "next";
|
|
230
|
+
}, {
|
|
231
|
+
readonly id: "forest";
|
|
232
|
+
readonly name: "Forest plot";
|
|
233
|
+
readonly tier: "next";
|
|
234
|
+
}, {
|
|
235
|
+
readonly id: "scatter";
|
|
236
|
+
readonly name: "Scatter";
|
|
237
|
+
readonly tier: "next";
|
|
238
|
+
}, {
|
|
239
|
+
readonly id: "box";
|
|
240
|
+
readonly name: "Box plot";
|
|
241
|
+
readonly tier: "next";
|
|
242
|
+
}, {
|
|
243
|
+
readonly id: "correlation";
|
|
244
|
+
readonly name: "Correlation";
|
|
245
|
+
readonly tier: "next";
|
|
246
|
+
}, {
|
|
247
|
+
readonly id: "control";
|
|
248
|
+
readonly name: "Control chart";
|
|
249
|
+
readonly tier: "next";
|
|
250
|
+
}, {
|
|
251
|
+
readonly id: "pareto";
|
|
252
|
+
readonly name: "Pareto";
|
|
253
|
+
readonly tier: "next";
|
|
254
|
+
}, {
|
|
255
|
+
readonly id: "survival";
|
|
256
|
+
readonly name: "Survival curve";
|
|
257
|
+
readonly tier: "next";
|
|
258
|
+
}, {
|
|
259
|
+
readonly id: "tornado";
|
|
260
|
+
readonly name: "Tornado";
|
|
261
|
+
readonly tier: "next";
|
|
262
|
+
}, {
|
|
263
|
+
readonly id: "decomposition";
|
|
264
|
+
readonly name: "Decomposition";
|
|
265
|
+
readonly tier: "next";
|
|
266
|
+
}, {
|
|
267
|
+
readonly id: "modeleval";
|
|
268
|
+
readonly name: "Model evaluation";
|
|
269
|
+
readonly tier: "next";
|
|
270
|
+
}, {
|
|
271
|
+
readonly id: "pivot";
|
|
272
|
+
readonly name: "Pivot";
|
|
273
|
+
readonly tier: "next";
|
|
274
|
+
}, {
|
|
275
|
+
readonly id: "profile";
|
|
276
|
+
readonly name: "Column profile";
|
|
277
|
+
readonly tier: "next";
|
|
278
|
+
}, {
|
|
279
|
+
readonly id: "evidence";
|
|
280
|
+
readonly name: "Evidence strength";
|
|
281
|
+
readonly tier: "next";
|
|
282
|
+
}, {
|
|
283
|
+
readonly id: "dumbbell";
|
|
284
|
+
readonly name: "Dumbbell";
|
|
285
|
+
readonly tier: "next";
|
|
286
|
+
}, {
|
|
287
|
+
readonly id: "quantiles";
|
|
288
|
+
readonly name: "Quantiles";
|
|
289
|
+
readonly tier: "today";
|
|
290
|
+
}];
|
|
291
|
+
type Block$1 = (typeof BLOCKS)[number];
|
|
292
|
+
/** Every block's kind. */
|
|
293
|
+
type BlockKind = Block$1["id"];
|
|
294
|
+
/** The kinds an ask turn can hold: the blocks that return a value. */
|
|
295
|
+
type AskKind = Extract<Block$1, {
|
|
296
|
+
returns: string;
|
|
297
|
+
}>["id"];
|
|
298
|
+
/** The kinds an answer turn can hold: the blocks that only show data. */
|
|
299
|
+
type AnswerKind = Exclude<BlockKind, AskKind>;
|
|
300
|
+
/** The blocks that return a value, and those that only show data. */
|
|
301
|
+
declare const ASK_KINDS: readonly AskKind[];
|
|
302
|
+
declare const ANSWER_KINDS: readonly AnswerKind[];
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Value types: every figure an answer shows is one of these, written one way
|
|
306
|
+
* by `formatValue`. The unit vocabulary inside `quantity` is open.
|
|
307
|
+
*/
|
|
308
|
+
declare const VALUE_TYPES: readonly [{
|
|
309
|
+
readonly id: "quantity";
|
|
310
|
+
readonly name: "Quantity with unit";
|
|
311
|
+
readonly example: "2,480 kg/ha · 26 d";
|
|
312
|
+
}, {
|
|
313
|
+
readonly id: "currency";
|
|
314
|
+
readonly name: "Currency";
|
|
315
|
+
readonly example: "£84k · −£620k · £4.1M";
|
|
316
|
+
}, {
|
|
317
|
+
readonly id: "percent";
|
|
318
|
+
readonly name: "Share";
|
|
319
|
+
readonly example: "76% · 8.2%";
|
|
320
|
+
}, {
|
|
321
|
+
readonly id: "pp";
|
|
322
|
+
readonly name: "Percentage points";
|
|
323
|
+
readonly example: "+4.8 pts · ▼ 1.8 pts";
|
|
324
|
+
}, {
|
|
325
|
+
readonly id: "bp";
|
|
326
|
+
readonly name: "Basis points";
|
|
327
|
+
readonly example: "+12 bp";
|
|
328
|
+
}, {
|
|
329
|
+
readonly id: "ratio";
|
|
330
|
+
readonly name: "Ratio or index";
|
|
331
|
+
readonly example: "OR 1.29 · beta 0.38 · 1.3×";
|
|
332
|
+
}, {
|
|
333
|
+
readonly id: "rate";
|
|
334
|
+
readonly name: "Rate per N";
|
|
335
|
+
readonly example: "8.2 per 100 discharges";
|
|
336
|
+
}, {
|
|
337
|
+
readonly id: "count";
|
|
338
|
+
readonly name: "Count with n";
|
|
339
|
+
readonly example: "1,284 plots · n = 1,061";
|
|
340
|
+
}, {
|
|
341
|
+
readonly id: "duration";
|
|
342
|
+
readonly name: "Duration";
|
|
343
|
+
readonly example: "1.2 s · 3 min · 26 d";
|
|
344
|
+
}, {
|
|
345
|
+
readonly id: "estimate";
|
|
346
|
+
readonly name: "Estimate with interval";
|
|
347
|
+
readonly example: "1.29 (95% CI 1.04–1.60)";
|
|
348
|
+
}, {
|
|
349
|
+
readonly id: "pvalue";
|
|
350
|
+
readonly name: "p-value";
|
|
351
|
+
readonly example: "p = 0.02 · p < 0.001";
|
|
352
|
+
}, {
|
|
353
|
+
readonly id: "score";
|
|
354
|
+
readonly name: "Ordinal score";
|
|
355
|
+
readonly example: "7 / 9 · 4 of 5";
|
|
356
|
+
}, {
|
|
357
|
+
readonly id: "time";
|
|
358
|
+
readonly name: "Point in time";
|
|
359
|
+
readonly example: "as of 29 Sep 06:00 · Q3 2026";
|
|
360
|
+
}];
|
|
361
|
+
type ValueTypeId = (typeof VALUE_TYPES)[number]["id"];
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* A figure with its type, written one way by `formatValue`. Until that lands
|
|
365
|
+
* in `@invana/ui`, a figure may also arrive already written, as a string.
|
|
366
|
+
*/
|
|
367
|
+
interface TypedValue {
|
|
368
|
+
value: number;
|
|
369
|
+
type: ValueTypeId;
|
|
370
|
+
/** Open vocabulary — `kg/ha`, `plots`, `pollinations`. */
|
|
371
|
+
unit?: string;
|
|
372
|
+
/** The interval of an estimate, with its level. */
|
|
373
|
+
ci?: [number, number];
|
|
374
|
+
level?: number;
|
|
375
|
+
/** The count the figure rests on. */
|
|
376
|
+
n?: number;
|
|
377
|
+
}
|
|
378
|
+
type Figure = string | number | TypedValue;
|
|
379
|
+
/** A table cell that says whether its change is good or bad. */
|
|
380
|
+
type Cell = Figure | null | {
|
|
381
|
+
value: Figure;
|
|
382
|
+
tone?: "good" | "bad";
|
|
383
|
+
strong?: boolean;
|
|
384
|
+
};
|
|
385
|
+
type Tone = "good" | "bad" | "warn" | "neutral";
|
|
386
|
+
interface NarrativeOptions {
|
|
387
|
+
/**
|
|
388
|
+
* Two or three sentences, leading with the number. `**…**` marks a figure;
|
|
389
|
+
* `[n]` places the marker for source n where the clause it backs ends; a
|
|
390
|
+
* figure led by `▲` or `▼` is drawn in the tone of its direction.
|
|
391
|
+
*/
|
|
392
|
+
text: string;
|
|
393
|
+
/** Markers appended after the text, for prose that places none of its own. */
|
|
394
|
+
cites?: number[];
|
|
395
|
+
/** The source the reader is on: its marker is lit, as is its row in the citations. */
|
|
396
|
+
active?: number;
|
|
397
|
+
}
|
|
398
|
+
interface MetricOptions {
|
|
399
|
+
label: string;
|
|
400
|
+
/** `null` when there is no figure to give; `delta` then says why. Drawn as a muted `—`. */
|
|
401
|
+
value: Figure | null;
|
|
402
|
+
/** The comparison, already worded — `▲ 3 pts vs Q2 · target 110%`. */
|
|
403
|
+
delta?: string;
|
|
404
|
+
tone?: Tone;
|
|
405
|
+
/**
|
|
406
|
+
* A bar under the figure: `value` against `target` on a scale from `min` to
|
|
407
|
+
* `max`, with the scale's ends and the target written under it in `unit`.
|
|
408
|
+
* Without a `target` it is a plain meter — how full a value with a real
|
|
409
|
+
* ceiling is (`{ value: 0.42, max: 1 }`), with nothing written under it.
|
|
410
|
+
*/
|
|
411
|
+
gauge?: {
|
|
412
|
+
value: number;
|
|
413
|
+
target?: number;
|
|
414
|
+
min?: number;
|
|
415
|
+
max: number;
|
|
416
|
+
unit?: string;
|
|
417
|
+
};
|
|
418
|
+
/** The recent run of the figure, oldest first, drawn as a sparkline beside it. */
|
|
419
|
+
trend?: number[];
|
|
420
|
+
/** Set on the warning ground: the one figure in a band that needs a second look. */
|
|
421
|
+
flag?: boolean;
|
|
422
|
+
}
|
|
423
|
+
interface Column {
|
|
424
|
+
key: string;
|
|
425
|
+
label: string;
|
|
426
|
+
align?: "left" | "right";
|
|
427
|
+
/** Set the column in the mono face — an id, a key, a timestamp. */
|
|
428
|
+
mono?: boolean;
|
|
429
|
+
}
|
|
430
|
+
/** One label/value pair in a record. */
|
|
431
|
+
interface RecordRow {
|
|
432
|
+
label: string;
|
|
433
|
+
value: string;
|
|
434
|
+
/** Where the value came from — `last year's promotions`, `your input`. */
|
|
435
|
+
source?: string;
|
|
436
|
+
/** `false` sets the value in the body face — prose rather than an id or a figure. */
|
|
437
|
+
mono?: boolean;
|
|
438
|
+
}
|
|
439
|
+
/** The options of the blocks first shared by the conversation and the page. */
|
|
440
|
+
interface SharedAnswerOptions {
|
|
441
|
+
narrative: NarrativeOptions;
|
|
442
|
+
metric: MetricOptions;
|
|
443
|
+
grid: {
|
|
444
|
+
tiles: MetricOptions[];
|
|
445
|
+
/**
|
|
446
|
+
* Fit as many tiles across as this width allows, in px — a strip of five or
|
|
447
|
+
* six on a wide panel. Unset, three across, and four sit two by two.
|
|
448
|
+
*/
|
|
449
|
+
minTileWidth?: number;
|
|
450
|
+
};
|
|
451
|
+
table: {
|
|
452
|
+
columns: Column[];
|
|
453
|
+
rows: Record<string, Cell>[];
|
|
454
|
+
/** How many rows exist; more than `rows` draws `Open all`, which sends the `open` action. */
|
|
455
|
+
total?: number;
|
|
456
|
+
noun?: string;
|
|
457
|
+
/** What follows the count — `sorted by Δ`, `7 columns`. */
|
|
458
|
+
note?: string;
|
|
459
|
+
/** The column the rows are ordered by, marked in its header. */
|
|
460
|
+
sort?: {
|
|
461
|
+
key: string;
|
|
462
|
+
dir: "asc" | "desc";
|
|
463
|
+
};
|
|
464
|
+
/** Rows called out, by index in `rows`. */
|
|
465
|
+
highlight?: number[];
|
|
466
|
+
/** A total row under the rows, set bold. */
|
|
467
|
+
totals?: Record<string, Cell>;
|
|
468
|
+
/**
|
|
469
|
+
* The column whose value names a row. Set, a row can be picked: a click
|
|
470
|
+
* sends the `select` action with that row's value.
|
|
471
|
+
*/
|
|
472
|
+
rowKey?: string;
|
|
473
|
+
/** The `rowKey` value of the row drawn selected. */
|
|
474
|
+
selected?: string | null;
|
|
475
|
+
};
|
|
476
|
+
record: {
|
|
477
|
+
rows?: RecordRow[];
|
|
478
|
+
/** Rows under headings — `Identity`, `Performance, semi-arid`. Drawn after `rows`. */
|
|
479
|
+
groups?: {
|
|
480
|
+
label: string;
|
|
481
|
+
rows: RecordRow[];
|
|
482
|
+
}[];
|
|
483
|
+
/** Who or what the record is, above its rows, with its state as a tag. */
|
|
484
|
+
header?: {
|
|
485
|
+
title: string;
|
|
486
|
+
initials?: string;
|
|
487
|
+
status?: {
|
|
488
|
+
label: string;
|
|
489
|
+
tone?: Tone;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
ranked: {
|
|
494
|
+
/** `muted` is the rest folded into one line — `3 others`. */
|
|
495
|
+
items: {
|
|
496
|
+
label: string;
|
|
497
|
+
value: number;
|
|
498
|
+
display?: string;
|
|
499
|
+
muted?: boolean;
|
|
500
|
+
}[];
|
|
501
|
+
/** Bars grow both ways from a zero rule, with what each side means under them. */
|
|
502
|
+
diverging?: {
|
|
503
|
+
below: string;
|
|
504
|
+
above: string;
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
timeseries: {
|
|
508
|
+
/**
|
|
509
|
+
* The first is the line; the rest are drawn behind it to read it against —
|
|
510
|
+
* last year beside this — each named at its right end. A point with no
|
|
511
|
+
* value — `null` — breaks the line rather than bridging the gap.
|
|
512
|
+
*/
|
|
513
|
+
series: {
|
|
514
|
+
name: string;
|
|
515
|
+
points: [string, number | null][];
|
|
516
|
+
}[];
|
|
517
|
+
band?: {
|
|
518
|
+
label?: string;
|
|
519
|
+
lower: number;
|
|
520
|
+
upper: number;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* A line to read against — an alert level, a budget — drawn dashed and
|
|
524
|
+
* named at the right. Every point above it is ringed in the `bad` tone.
|
|
525
|
+
*/
|
|
526
|
+
reference?: {
|
|
527
|
+
value: number;
|
|
528
|
+
label: string;
|
|
529
|
+
};
|
|
530
|
+
forecastFrom?: string;
|
|
531
|
+
/** Names the forecast boundary — `today`. Without one the rule is unlabelled. */
|
|
532
|
+
forecastLabel?: string;
|
|
533
|
+
marks?: {
|
|
534
|
+
at: string;
|
|
535
|
+
label?: string;
|
|
536
|
+
tone?: Tone;
|
|
537
|
+
}[];
|
|
538
|
+
unit?: string;
|
|
539
|
+
};
|
|
540
|
+
bars: {
|
|
541
|
+
groups: string[];
|
|
542
|
+
/** `muted` draws a series as the comparison — last quarter behind this one. */
|
|
543
|
+
series: {
|
|
544
|
+
name: string;
|
|
545
|
+
values: number[];
|
|
546
|
+
muted?: boolean;
|
|
547
|
+
}[];
|
|
548
|
+
target?: {
|
|
549
|
+
value: number;
|
|
550
|
+
label: string;
|
|
551
|
+
};
|
|
552
|
+
/** A plan per group, drawn as a dashed column the actual stands inside. */
|
|
553
|
+
plan?: {
|
|
554
|
+
name: string;
|
|
555
|
+
values: number[];
|
|
556
|
+
};
|
|
557
|
+
highlight?: string;
|
|
558
|
+
unit?: string;
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* What every ask says before its control. `hint`, where an ask has one, is the
|
|
563
|
+
* line under it: `**bold**` marks a figure and `` `Enter` `` a key.
|
|
564
|
+
*/
|
|
565
|
+
interface AskText {
|
|
566
|
+
/** The question. `**bold**` marks what matters in it. */
|
|
567
|
+
question: string;
|
|
568
|
+
/** A muted line under the question — what the answer is used for. Makes the question a heading. */
|
|
569
|
+
description?: string;
|
|
570
|
+
/** Set the question as a heading, bold — a short question over a longer body. */
|
|
571
|
+
heading?: boolean;
|
|
572
|
+
/** What the answer is called once settled, in its summary — `Margin`, `Yield floor`. */
|
|
573
|
+
label?: string;
|
|
574
|
+
}
|
|
575
|
+
/** A figure on the right of a choice — `2,480` over `kg/ha`, `−8.4%` over `vs LY`. */
|
|
576
|
+
interface ChoiceFigure {
|
|
577
|
+
value: string;
|
|
578
|
+
unit?: string;
|
|
579
|
+
tone?: Tone;
|
|
580
|
+
}
|
|
581
|
+
/** A choice the data model holds. `detail` names where it comes from. */
|
|
582
|
+
interface ChoiceOption {
|
|
583
|
+
value: string;
|
|
584
|
+
label: string;
|
|
585
|
+
detail?: string;
|
|
586
|
+
disabled?: boolean;
|
|
587
|
+
/** Why it is off or on — `on the causal path`. */
|
|
588
|
+
note?: string;
|
|
589
|
+
/** A second line under the label — `Adjusts for seasonality`. */
|
|
590
|
+
description?: string;
|
|
591
|
+
/** A short tag in a box before the label — `BV`. */
|
|
592
|
+
lead?: string;
|
|
593
|
+
/**
|
|
594
|
+
* An icon in that box instead: the path data of a 16×16 stroked icon, so
|
|
595
|
+
* the API can send one without the kit shipping an icon set.
|
|
596
|
+
*/
|
|
597
|
+
icon?: string;
|
|
598
|
+
/** What picking it would give, on the right in place of `detail`. */
|
|
599
|
+
figure?: ChoiceFigure;
|
|
600
|
+
/** How the pick reads in a summary, when not as its label — `Semi-arid, 3 sites`. */
|
|
601
|
+
summary?: string;
|
|
602
|
+
}
|
|
603
|
+
/** One figure of what yes costs — `2.3B` `rows scanned`. */
|
|
604
|
+
interface CostFigure {
|
|
605
|
+
label: string;
|
|
606
|
+
/** The figure. `about **40 s**` bolds only the figure in a `line`. */
|
|
607
|
+
value: string;
|
|
608
|
+
/** `warn` for a cost that changes something — records it writes. */
|
|
609
|
+
tone?: Tone;
|
|
610
|
+
}
|
|
611
|
+
interface ConfirmOptions extends AskText {
|
|
612
|
+
/** What yes costs, stated before the buttons: the rows it scans, the time it takes, what it writes. */
|
|
613
|
+
cost?: CostFigure[];
|
|
614
|
+
/**
|
|
615
|
+
* `line` writes the cost as a sentence under the question, each figure
|
|
616
|
+
* before its label; `strip` sets the figures in cells, each label above.
|
|
617
|
+
* @default "line"
|
|
618
|
+
*/
|
|
619
|
+
costAs?: "line" | "strip";
|
|
620
|
+
/** Something the analyst should weigh before answering — `data gap`. */
|
|
621
|
+
caveat?: {
|
|
622
|
+
label: string;
|
|
623
|
+
text: string;
|
|
624
|
+
};
|
|
625
|
+
yes: string;
|
|
626
|
+
no: string;
|
|
627
|
+
default?: boolean;
|
|
628
|
+
/** The no is a dismissal — `Not now` — and draws quiet. */
|
|
629
|
+
dismiss?: boolean;
|
|
630
|
+
/**
|
|
631
|
+
* `end` sets the default at the card's right edge, the other at its left;
|
|
632
|
+
* `start` sets them together at the left, the default first.
|
|
633
|
+
* @default "start"
|
|
634
|
+
*/
|
|
635
|
+
align?: "start" | "end";
|
|
636
|
+
/** How the decision reads once made — `Narrowed to Q3 first`. Defaults to the button's words. */
|
|
637
|
+
settled?: {
|
|
638
|
+
yes?: string;
|
|
639
|
+
no?: string;
|
|
640
|
+
};
|
|
641
|
+
hint?: string;
|
|
642
|
+
}
|
|
643
|
+
interface SingleOptions extends AskText {
|
|
644
|
+
options: ChoiceOption[];
|
|
645
|
+
default?: string;
|
|
646
|
+
/** Offer an “Other…” choice, answered in the analyst's own words. */
|
|
647
|
+
other?: boolean;
|
|
648
|
+
/** Send with a button of these words — `Next` — rather than on the pick. */
|
|
649
|
+
submit?: string;
|
|
650
|
+
/** Offer Skip, which keeps the default. */
|
|
651
|
+
skippable?: boolean;
|
|
652
|
+
hint?: string;
|
|
653
|
+
}
|
|
654
|
+
interface MultiOptions extends AskText {
|
|
655
|
+
options: ChoiceOption[];
|
|
656
|
+
default?: string[];
|
|
657
|
+
min?: number;
|
|
658
|
+
max?: number;
|
|
659
|
+
/**
|
|
660
|
+
* The submit's words, `{count}` standing for how many are ticked — `Hold
|
|
661
|
+
* {count} fixed`. Defaults to the question's own verb, or `Use {count} selected`.
|
|
662
|
+
*/
|
|
663
|
+
submit?: string;
|
|
664
|
+
/** Offer Select all beside the question. */
|
|
665
|
+
selectAll?: boolean;
|
|
666
|
+
hint?: string;
|
|
667
|
+
}
|
|
668
|
+
/** One row of a quick ask: a question and two to five short answers. */
|
|
669
|
+
interface QuickPick {
|
|
670
|
+
question: string;
|
|
671
|
+
/** What the answer is called once settled, in its summary — `Trend by`. */
|
|
672
|
+
label?: string;
|
|
673
|
+
/** Each option; `sub` is a second line under it — `±1.4 pp`. */
|
|
674
|
+
options: {
|
|
675
|
+
value: string;
|
|
676
|
+
label: string;
|
|
677
|
+
sub?: string;
|
|
678
|
+
}[];
|
|
679
|
+
default?: string;
|
|
680
|
+
hint?: string;
|
|
681
|
+
}
|
|
682
|
+
interface QuickOptions extends AskText, QuickPick {
|
|
683
|
+
/** Stretch the row across the card, each option an equal share. */
|
|
684
|
+
stretch?: boolean;
|
|
685
|
+
/**
|
|
686
|
+
* Further rows answered in the same card — `Confidence level` under `Show
|
|
687
|
+
* the trend by`. With any, the value is keyed: `id` for each of these,
|
|
688
|
+
* `label` (or the question) for the first.
|
|
689
|
+
*/
|
|
690
|
+
more?: (QuickPick & {
|
|
691
|
+
id: string;
|
|
692
|
+
})[];
|
|
693
|
+
}
|
|
694
|
+
interface PeriodOptions {
|
|
695
|
+
question: string;
|
|
696
|
+
options: {
|
|
697
|
+
value: string;
|
|
698
|
+
label: string;
|
|
699
|
+
from: string;
|
|
700
|
+
to: string;
|
|
701
|
+
}[];
|
|
702
|
+
default?: string;
|
|
703
|
+
custom?: boolean;
|
|
704
|
+
hint?: string;
|
|
705
|
+
}
|
|
706
|
+
interface NumberOptions extends AskText {
|
|
707
|
+
unit?: string;
|
|
708
|
+
min?: number;
|
|
709
|
+
max?: number;
|
|
710
|
+
step?: number;
|
|
711
|
+
default?: number;
|
|
712
|
+
hint?: string;
|
|
713
|
+
}
|
|
714
|
+
interface ShortOptions {
|
|
715
|
+
question: string;
|
|
716
|
+
default?: string;
|
|
717
|
+
hint?: string;
|
|
718
|
+
}
|
|
719
|
+
interface LongOptions {
|
|
720
|
+
question: string;
|
|
721
|
+
placeholder?: string;
|
|
722
|
+
optional?: boolean;
|
|
723
|
+
}
|
|
724
|
+
interface EntityOptions {
|
|
725
|
+
question: string;
|
|
726
|
+
/** Suggested or found entities, each with its type. */
|
|
727
|
+
results: {
|
|
728
|
+
id: string;
|
|
729
|
+
label: string;
|
|
730
|
+
type?: string;
|
|
731
|
+
}[];
|
|
732
|
+
default?: string[];
|
|
733
|
+
/** An action that runs once the pick is made — `Simulate 3 crosses`. */
|
|
734
|
+
submit?: string;
|
|
735
|
+
hint?: string;
|
|
736
|
+
}
|
|
737
|
+
interface ScaleOptions {
|
|
738
|
+
question: string;
|
|
739
|
+
min: number;
|
|
740
|
+
max: number;
|
|
741
|
+
low?: string;
|
|
742
|
+
high?: string;
|
|
743
|
+
default?: number;
|
|
744
|
+
}
|
|
745
|
+
interface MultistepOptions {
|
|
746
|
+
/**
|
|
747
|
+
* Each step is an ask of its own; the value is keyed by step id. A
|
|
748
|
+
* `required` step holds Next back until it is answered, and has no Skip.
|
|
749
|
+
*/
|
|
750
|
+
steps: ({
|
|
751
|
+
id: string;
|
|
752
|
+
required?: boolean;
|
|
753
|
+
} & AskSpec)[];
|
|
754
|
+
/** Show the answers for a last look, each with Edit, before they are sent. */
|
|
755
|
+
review?: boolean;
|
|
756
|
+
}
|
|
757
|
+
interface FormOptions extends AskText {
|
|
758
|
+
/**
|
|
759
|
+
* `side` sets each label in a column at the left; `top` sets it over its
|
|
760
|
+
* field, two fields to a row where the card is wide enough.
|
|
761
|
+
* @default "side"
|
|
762
|
+
*/
|
|
763
|
+
labels?: "side" | "top";
|
|
764
|
+
fields: {
|
|
765
|
+
name: string;
|
|
766
|
+
label: string;
|
|
767
|
+
type: "number" | "text" | "date" | "select";
|
|
768
|
+
unit?: string;
|
|
769
|
+
default?: string | number;
|
|
770
|
+
/** Shown beside the value — `quoted 14 d`. */
|
|
771
|
+
aside?: string;
|
|
772
|
+
/** A line under the field — `From last year's promotions`. */
|
|
773
|
+
hint?: string;
|
|
774
|
+
/** The section the field sits in, under its name — `Price`, `Timing`. */
|
|
775
|
+
group?: string;
|
|
776
|
+
/** A number must be greater than this — an elasticity `above` 0. */
|
|
777
|
+
above?: number;
|
|
778
|
+
/** A number must be less than this. */
|
|
779
|
+
below?: number;
|
|
780
|
+
}[];
|
|
781
|
+
submit?: string;
|
|
782
|
+
hint?: string;
|
|
783
|
+
}
|
|
784
|
+
interface WeightsOptions {
|
|
785
|
+
question: string;
|
|
786
|
+
objectives: {
|
|
787
|
+
id: string;
|
|
788
|
+
label: string;
|
|
789
|
+
}[];
|
|
790
|
+
default: Record<string, number>;
|
|
791
|
+
total?: number;
|
|
792
|
+
hint?: string;
|
|
793
|
+
}
|
|
794
|
+
interface ApprovalOptions {
|
|
795
|
+
rows: {
|
|
796
|
+
label: string;
|
|
797
|
+
value: string;
|
|
798
|
+
}[];
|
|
799
|
+
consequence: string;
|
|
800
|
+
actions: ActionOption[];
|
|
801
|
+
}
|
|
802
|
+
interface InterpretationOptions {
|
|
803
|
+
question?: string;
|
|
804
|
+
slots: {
|
|
805
|
+
id: "measure" | "window" | "population" | "baseline" | (string & {});
|
|
806
|
+
label: string;
|
|
807
|
+
value: string;
|
|
808
|
+
}[];
|
|
809
|
+
}
|
|
810
|
+
interface ForkOptions {
|
|
811
|
+
question: string;
|
|
812
|
+
readings: {
|
|
813
|
+
id: string;
|
|
814
|
+
label: string;
|
|
815
|
+
preview?: string;
|
|
816
|
+
hint?: string;
|
|
817
|
+
}[];
|
|
818
|
+
default?: string;
|
|
819
|
+
}
|
|
820
|
+
interface PlanOptions {
|
|
821
|
+
question?: string;
|
|
822
|
+
steps: {
|
|
823
|
+
id: string;
|
|
824
|
+
label: string;
|
|
825
|
+
cost?: string;
|
|
826
|
+
on: boolean;
|
|
827
|
+
}[];
|
|
828
|
+
submit?: string;
|
|
829
|
+
}
|
|
830
|
+
interface ModelSpecOptions {
|
|
831
|
+
question?: string;
|
|
832
|
+
outcome: {
|
|
833
|
+
field: string;
|
|
834
|
+
type: string;
|
|
835
|
+
};
|
|
836
|
+
predictors: string[];
|
|
837
|
+
controls: string[];
|
|
838
|
+
group?: string;
|
|
839
|
+
hint?: string;
|
|
840
|
+
}
|
|
841
|
+
interface HypothesisOptions {
|
|
842
|
+
question: string;
|
|
843
|
+
test: string;
|
|
844
|
+
/** Why this test — shown beside it as `suggested`. */
|
|
845
|
+
suggested?: boolean;
|
|
846
|
+
tails: 1 | 2;
|
|
847
|
+
alpha: number;
|
|
848
|
+
hint?: string;
|
|
849
|
+
}
|
|
850
|
+
interface RangeOptions {
|
|
851
|
+
question: string;
|
|
852
|
+
unit?: string;
|
|
853
|
+
default: {
|
|
854
|
+
min: number;
|
|
855
|
+
max: number;
|
|
856
|
+
};
|
|
857
|
+
hint?: string;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Follow-ups after an answer, each a whole prompt that reuses the current
|
|
861
|
+
* scope. The reply is the one picked, and the API sends it on as the next
|
|
862
|
+
* prompt; the one picked stays, dimmed.
|
|
863
|
+
*/
|
|
864
|
+
interface SuggestionsOptions {
|
|
865
|
+
items?: string[];
|
|
866
|
+
/** Follow-ups under a heading each — `Go deeper`, `Act`. */
|
|
867
|
+
groups?: {
|
|
868
|
+
label: string;
|
|
869
|
+
items: string[];
|
|
870
|
+
}[];
|
|
871
|
+
/** `stack` puts one per line, full width. Narrow threads stack on their own. */
|
|
872
|
+
layout?: "wrap" | "stack";
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Kind → the options it reads.
|
|
876
|
+
*
|
|
877
|
+
* Keyed by exactly the grammar's ask kinds; `grammar.test.ts` checks it.
|
|
878
|
+
*/
|
|
879
|
+
interface AskOptionsByKind {
|
|
880
|
+
confirm: ConfirmOptions;
|
|
881
|
+
single: SingleOptions;
|
|
882
|
+
multi: MultiOptions;
|
|
883
|
+
quick: QuickOptions;
|
|
884
|
+
period: PeriodOptions;
|
|
885
|
+
number: NumberOptions;
|
|
886
|
+
short: ShortOptions;
|
|
887
|
+
long: LongOptions;
|
|
888
|
+
entity: EntityOptions;
|
|
889
|
+
scale: ScaleOptions;
|
|
890
|
+
multistep: MultistepOptions;
|
|
891
|
+
form: FormOptions;
|
|
892
|
+
weights: WeightsOptions;
|
|
893
|
+
approval: ApprovalOptions;
|
|
894
|
+
interpretation: InterpretationOptions;
|
|
895
|
+
fork: ForkOptions;
|
|
896
|
+
plan: PlanOptions;
|
|
897
|
+
modelspec: ModelSpecOptions;
|
|
898
|
+
hypothesis: HypothesisOptions;
|
|
899
|
+
range: RangeOptions;
|
|
900
|
+
suggestions: SuggestionsOptions;
|
|
901
|
+
}
|
|
902
|
+
/** Kind → the type of the value the analyst's reply carries. */
|
|
903
|
+
interface AskValueByKind {
|
|
904
|
+
confirm: boolean;
|
|
905
|
+
single: string;
|
|
906
|
+
multi: string[];
|
|
907
|
+
/** Keyed by row when the ask has `more` rows. */
|
|
908
|
+
quick: string | Record<string, string>;
|
|
909
|
+
period: {
|
|
910
|
+
from: string;
|
|
911
|
+
to: string;
|
|
912
|
+
label: string;
|
|
913
|
+
};
|
|
914
|
+
number: number;
|
|
915
|
+
short: string;
|
|
916
|
+
long: string;
|
|
917
|
+
entity: string[];
|
|
918
|
+
scale: number;
|
|
919
|
+
multistep: Record<string, unknown>;
|
|
920
|
+
form: Record<string, unknown>;
|
|
921
|
+
weights: Record<string, number>;
|
|
922
|
+
approval: "approve" | "reject";
|
|
923
|
+
interpretation: Record<string, string>;
|
|
924
|
+
fork: string;
|
|
925
|
+
plan: string[];
|
|
926
|
+
modelspec: {
|
|
927
|
+
outcome: string;
|
|
928
|
+
predictors: string[];
|
|
929
|
+
group?: string;
|
|
930
|
+
controls: string[];
|
|
931
|
+
};
|
|
932
|
+
hypothesis: {
|
|
933
|
+
test: string;
|
|
934
|
+
tails: 1 | 2;
|
|
935
|
+
alpha: number;
|
|
936
|
+
};
|
|
937
|
+
range: {
|
|
938
|
+
min: number;
|
|
939
|
+
max: number;
|
|
940
|
+
};
|
|
941
|
+
/** The follow-up picked, as it reads. */
|
|
942
|
+
suggestions: string;
|
|
943
|
+
}
|
|
944
|
+
interface ActionOption {
|
|
945
|
+
id: string;
|
|
946
|
+
label: string;
|
|
947
|
+
variant?: "primary" | "secondary" | "ghost" | "link";
|
|
948
|
+
/** Starts the right-hand group: this action and those after it sit at the far end. */
|
|
949
|
+
push?: boolean;
|
|
950
|
+
}
|
|
951
|
+
interface MethodOptions {
|
|
952
|
+
/** The word on the line — `method`, `query`, `model`, `3 steps`. */
|
|
953
|
+
label?: string;
|
|
954
|
+
/** The formula, query or model. `**…**` marks its keywords. */
|
|
955
|
+
code?: string;
|
|
956
|
+
/** At the right of the line — `12,408 rows · 18 ms`. */
|
|
957
|
+
meta?: string;
|
|
958
|
+
/** What the model rests on, under the code — `Plots 1,284`. */
|
|
959
|
+
facts?: {
|
|
960
|
+
label: string;
|
|
961
|
+
value: string;
|
|
962
|
+
}[];
|
|
963
|
+
/** A method of several steps, in order, each with its count or time. */
|
|
964
|
+
steps?: {
|
|
965
|
+
label: string;
|
|
966
|
+
detail?: string;
|
|
967
|
+
}[];
|
|
968
|
+
/** Drawn open. Closed, the line alone says what was run. */
|
|
969
|
+
open?: boolean;
|
|
970
|
+
}
|
|
971
|
+
interface CitationSource {
|
|
972
|
+
label: string;
|
|
973
|
+
count?: Figure;
|
|
974
|
+
/** What kind of source and how fresh — `table · loaded 28 Sep 06:00`. */
|
|
975
|
+
detail?: string;
|
|
976
|
+
}
|
|
977
|
+
interface CitationsOptions {
|
|
978
|
+
sources: CitationSource[];
|
|
979
|
+
/** The source the reader is on, lit with its marker in the prose. */
|
|
980
|
+
active?: number;
|
|
981
|
+
/** One line — `▸ 3 sources`, the record total at the right — until opened. */
|
|
982
|
+
folded?: boolean;
|
|
983
|
+
/** Said under the sources. When they hold no records it is said as a warning. */
|
|
984
|
+
note?: string;
|
|
985
|
+
}
|
|
986
|
+
interface ProposalOptions {
|
|
987
|
+
/** Where it came from, on the card's header — `from this answer`. */
|
|
988
|
+
title?: string;
|
|
989
|
+
/** What it proposes, in one line above the draft. */
|
|
990
|
+
heading?: string;
|
|
991
|
+
/** The draft, label by label. */
|
|
992
|
+
rows?: {
|
|
993
|
+
label: string;
|
|
994
|
+
value: string;
|
|
995
|
+
}[];
|
|
996
|
+
/** What writing it does, as figures — `Rules 1`, `Recipients 214`. */
|
|
997
|
+
figures?: {
|
|
998
|
+
label: string;
|
|
999
|
+
value: string;
|
|
1000
|
+
}[];
|
|
1001
|
+
/** What writing it does, in words. */
|
|
1002
|
+
consequence?: string;
|
|
1003
|
+
actions: ActionOption[];
|
|
1004
|
+
/** Written: the stamp that says so, and when, on the header. */
|
|
1005
|
+
done?: {
|
|
1006
|
+
label: string;
|
|
1007
|
+
at?: string;
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
interface CannotOptions {
|
|
1011
|
+
reason: string;
|
|
1012
|
+
remedy: string;
|
|
1013
|
+
/** Nearby questions the data can answer; each is sent as a `prompt`. */
|
|
1014
|
+
nearest?: string[];
|
|
1015
|
+
/** Answered for part of what was asked; the reason says which part is missing. */
|
|
1016
|
+
partial?: boolean;
|
|
1017
|
+
}
|
|
1018
|
+
type CaveatTone = "warning" | "info" | "bad";
|
|
1019
|
+
interface CaveatNoteOptions {
|
|
1020
|
+
label: string;
|
|
1021
|
+
text: string;
|
|
1022
|
+
/** `warning` (the default) qualifies; `info` says what was filled in; `bad` says what is wrong with the data. */
|
|
1023
|
+
tone?: CaveatTone;
|
|
1024
|
+
/** A link after the text — `Show the 4 stores` — sent as an `action` event. */
|
|
1025
|
+
action?: {
|
|
1026
|
+
id: string;
|
|
1027
|
+
label: string;
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
/** One caveat, or several folded behind one line — `▸ 2 caveats`. */
|
|
1031
|
+
type CaveatOptions = (CaveatNoteOptions & {
|
|
1032
|
+
items?: never;
|
|
1033
|
+
folded?: never;
|
|
1034
|
+
}) | {
|
|
1035
|
+
items: CaveatNoteOptions[];
|
|
1036
|
+
folded?: boolean;
|
|
1037
|
+
label?: never;
|
|
1038
|
+
text?: never;
|
|
1039
|
+
};
|
|
1040
|
+
interface ScopePart {
|
|
1041
|
+
text: string;
|
|
1042
|
+
/** `changed` — this part differs from the question it was carried from; `stale` — the data behind it is late. */
|
|
1043
|
+
mark?: "changed" | "stale";
|
|
1044
|
+
/** What this part can be changed to; opening the part lists them. */
|
|
1045
|
+
choices?: {
|
|
1046
|
+
value: string;
|
|
1047
|
+
label: string;
|
|
1048
|
+
detail?: string;
|
|
1049
|
+
}[];
|
|
1050
|
+
}
|
|
1051
|
+
interface ScopeOptions {
|
|
1052
|
+
parts: (string | ScopePart)[];
|
|
1053
|
+
/** The line under the scope. Said as a warning when a part is stale. */
|
|
1054
|
+
hint?: string;
|
|
1055
|
+
/** The part whose choices are showing — a restored view, or a story. */
|
|
1056
|
+
openPart?: number;
|
|
1057
|
+
}
|
|
1058
|
+
/** One lane of the activity block: a layer, or a part of one when its parent is opened. */
|
|
1059
|
+
interface ActivityLane {
|
|
1060
|
+
id: string;
|
|
1061
|
+
/** `Graph`, `Third party`, `Company.revenue`. */
|
|
1062
|
+
label: string;
|
|
1063
|
+
/** What the lane is called at 280px — `3rd party`. Defaults to `label`. */
|
|
1064
|
+
short?: string;
|
|
1065
|
+
/** At the right — `6.9K/s`, `86k tok`, `2 refused`, `quiet`. `—` when the layer is off. */
|
|
1066
|
+
rate?: string;
|
|
1067
|
+
/** The rate is high: drawn in the info tone. `bad` draws it in the destructive tone. */
|
|
1068
|
+
rateTone?: "hot" | "bad";
|
|
1069
|
+
/** The layer is not open to this run: its label is muted, its cells hollow. */
|
|
1070
|
+
off?: boolean;
|
|
1071
|
+
/** How busy each slice was, `0`–`1`, oldest first; `null` not touched. */
|
|
1072
|
+
cells: (number | null)[];
|
|
1073
|
+
/** Slices a rule refused, or where data left the boundary. */
|
|
1074
|
+
marks?: {
|
|
1075
|
+
at: number;
|
|
1076
|
+
kind: "refused" | "egress";
|
|
1077
|
+
}[];
|
|
1078
|
+
/** Its parts — a model's types and relations — drawn under it, indented, when it is open. */
|
|
1079
|
+
children?: ActivityLane[];
|
|
1080
|
+
/** Drawn open. The reader can open and close it either way. */
|
|
1081
|
+
open?: boolean;
|
|
1082
|
+
}
|
|
1083
|
+
/** The operation behind a pinned slice — what the run did in that cell. */
|
|
1084
|
+
interface ActivityPin {
|
|
1085
|
+
/** The lane it is on, by id. */
|
|
1086
|
+
lane: string;
|
|
1087
|
+
/** The cell. */
|
|
1088
|
+
at: number;
|
|
1089
|
+
/** `Company.revenue · write`. */
|
|
1090
|
+
title: string;
|
|
1091
|
+
/** `4.25–4.50 s`. */
|
|
1092
|
+
time?: string;
|
|
1093
|
+
/** The statement, in mono — `SET c.revenue_q3 = $value · 512 rows`. */
|
|
1094
|
+
query?: string;
|
|
1095
|
+
rows?: {
|
|
1096
|
+
label: string;
|
|
1097
|
+
value: string;
|
|
1098
|
+
}[];
|
|
1099
|
+
/** Under the record — `1 of 3 operations in this window`. */
|
|
1100
|
+
note?: string;
|
|
1101
|
+
/** Sent as an `action` event — `Open in the trace`. */
|
|
1102
|
+
action?: ActionOption;
|
|
1103
|
+
}
|
|
1104
|
+
interface ActivityOptions {
|
|
1105
|
+
/** `live` follows the last seconds; `settled` is the whole run; `stale` has lost the signal. */
|
|
1106
|
+
state?: "live" | "settled" | "stale";
|
|
1107
|
+
/** The steps over the lanes, in order, each as wide as its share of the axis. */
|
|
1108
|
+
bands?: {
|
|
1109
|
+
label: string;
|
|
1110
|
+
span: number;
|
|
1111
|
+
current?: boolean;
|
|
1112
|
+
}[];
|
|
1113
|
+
/** Labels spread under the lanes — `0 s`, `10 s`, `21 s`. */
|
|
1114
|
+
axis?: string[];
|
|
1115
|
+
lanes: ActivityLane[];
|
|
1116
|
+
/** What one cell covers, for its title — `250 ms`. */
|
|
1117
|
+
cell?: string;
|
|
1118
|
+
/** A line under the lanes — `Third party only in step 3`. `**bold**` as in a narrative. */
|
|
1119
|
+
hint?: string;
|
|
1120
|
+
/** Show the key: touched, refused, left the boundary. */
|
|
1121
|
+
legend?: boolean;
|
|
1122
|
+
/** A slice held open, with its record under the lanes. */
|
|
1123
|
+
pinned?: ActivityPin;
|
|
1124
|
+
/** At the foot — `Open run detail` — sent as `action` events. */
|
|
1125
|
+
actions?: ActionOption[];
|
|
1126
|
+
}
|
|
1127
|
+
/** A bar's state on the gantt — the engine's own step statuses, as `Gantt` reads them; `refused` is what a rule stopped. */
|
|
1128
|
+
type GanttSpecStatus = "succeeded" | "running" | "failed" | "needs_input" | "stopped" | "skipped" | "queued" | "refused";
|
|
1129
|
+
/** One bar on a row that holds many — a task a worker slot ran, a layer a task reached. */
|
|
1130
|
+
interface GanttSpecBar {
|
|
1131
|
+
startMs?: number;
|
|
1132
|
+
durationMs?: number;
|
|
1133
|
+
status?: GanttSpecStatus;
|
|
1134
|
+
/** The hover text. */
|
|
1135
|
+
title?: string;
|
|
1136
|
+
/** Names the bar: picking it sends `select` with this key, not the row's. */
|
|
1137
|
+
key?: string;
|
|
1138
|
+
/** Written in the bar. */
|
|
1139
|
+
label?: string;
|
|
1140
|
+
/** Which `palette` entry paints it, instead of its status. */
|
|
1141
|
+
group?: string;
|
|
1142
|
+
/** `outline` is time held, not spent; `dashed` is time that may be spent. */
|
|
1143
|
+
variant?: "solid" | "outline" | "dashed";
|
|
1144
|
+
/** A second line under the label — `1,204 of 1,251`. */
|
|
1145
|
+
note?: string;
|
|
1146
|
+
/** A badge at the bar's end — `{ "label": "503", "tone": "bad" }`. */
|
|
1147
|
+
chip?: {
|
|
1148
|
+
label: string;
|
|
1149
|
+
tone?: Tone;
|
|
1150
|
+
};
|
|
1151
|
+
/** The bar's own hover card. Any one of these opens it. */
|
|
1152
|
+
summary?: string;
|
|
1153
|
+
result?: Record<string, string | number>;
|
|
1154
|
+
error?: {
|
|
1155
|
+
code?: string;
|
|
1156
|
+
message?: string;
|
|
1157
|
+
};
|
|
1158
|
+
log?: string;
|
|
1159
|
+
}
|
|
1160
|
+
/** One task of a run, on its clock — and the tasks it split into. */
|
|
1161
|
+
interface GanttSpecRow {
|
|
1162
|
+
/** `task_key` — what the log calls it. Also the row's label. */
|
|
1163
|
+
key: string;
|
|
1164
|
+
/** A human name for the row, instead of the key. */
|
|
1165
|
+
label?: string;
|
|
1166
|
+
/** From the run's zero. A task with neither, and no subtasks, never ran. */
|
|
1167
|
+
startMs?: number;
|
|
1168
|
+
durationMs?: number;
|
|
1169
|
+
status?: GanttSpecStatus;
|
|
1170
|
+
/** Earlier attempts, oldest first — the rate-limited fetch before the retry that stuck. */
|
|
1171
|
+
attempts?: {
|
|
1172
|
+
startMs?: number;
|
|
1173
|
+
durationMs?: number;
|
|
1174
|
+
status?: GanttSpecStatus;
|
|
1175
|
+
title?: string;
|
|
1176
|
+
}[];
|
|
1177
|
+
/** Many bars on one row, each its own thing — what a worker slot held, in order. */
|
|
1178
|
+
segments?: GanttSpecBar[];
|
|
1179
|
+
/** The right-hand cell, instead of the duration — `59% busy`. */
|
|
1180
|
+
duration?: string;
|
|
1181
|
+
/** A sentence under the hover card's header. */
|
|
1182
|
+
summary?: string;
|
|
1183
|
+
/** What it said last — the card's foot. */
|
|
1184
|
+
log?: string;
|
|
1185
|
+
error?: {
|
|
1186
|
+
code?: string;
|
|
1187
|
+
message?: string;
|
|
1188
|
+
};
|
|
1189
|
+
/** What it produced, as label/value pairs on the card — `{ rows: 412 }`. */
|
|
1190
|
+
result?: Record<string, string | number>;
|
|
1191
|
+
/** The tasks it split into, indented under it. A task with no timing draws their stretch. */
|
|
1192
|
+
subtasks?: GanttSpecRow[];
|
|
1193
|
+
/** Drawn open. The reader can open and close it either way. */
|
|
1194
|
+
open?: boolean;
|
|
1195
|
+
}
|
|
1196
|
+
interface GanttOptions {
|
|
1197
|
+
/** In plan order. */
|
|
1198
|
+
tasks: GanttSpecRow[];
|
|
1199
|
+
/** The clock's ceiling — the run's length. Defaults to the last end. */
|
|
1200
|
+
spanMs?: number;
|
|
1201
|
+
/** The *now* line, while the run is in flight. */
|
|
1202
|
+
nowMs?: number;
|
|
1203
|
+
/** The run has not decided its length yet: the last tick reads `8s+`. */
|
|
1204
|
+
openEnded?: boolean;
|
|
1205
|
+
/** Intervals on the axis. `4` by default. */
|
|
1206
|
+
ticks?: number;
|
|
1207
|
+
/** The key column, in px. Defaults to the longest key, up to 40%. */
|
|
1208
|
+
labelWidth?: number;
|
|
1209
|
+
/** The duration column, in px — set alike on Gantts stacked over one clock. */
|
|
1210
|
+
durationWidth?: number;
|
|
1211
|
+
density?: "compact" | "comfortable";
|
|
1212
|
+
/** The task picked — a restored view. Picking one sends `select` with its key. */
|
|
1213
|
+
selected?: string;
|
|
1214
|
+
/** A segment's `group` → the class that paints it — `{ "ingest": "bg-data-1" }`. */
|
|
1215
|
+
palette?: Record<string, string>;
|
|
1216
|
+
/** Gates — a moment the run held and spent nothing — ruled under the row they follow. */
|
|
1217
|
+
seams?: GanttSpecSeam[];
|
|
1218
|
+
/**
|
|
1219
|
+
* What the clock counts. `elapsed` (the default) is milliseconds from the
|
|
1220
|
+
* run's zero. `seq` is a plan read in order, before it runs: `startMs` and
|
|
1221
|
+
* `durationMs` are step numbers, ticks read `step 3`, durations `2 steps`.
|
|
1222
|
+
*/
|
|
1223
|
+
scale?: "elapsed" | "seq";
|
|
1224
|
+
}
|
|
1225
|
+
/** A gate, ruled across the stretch of clock it held. */
|
|
1226
|
+
interface GanttSpecSeam {
|
|
1227
|
+
/** The row it follows, by key. */
|
|
1228
|
+
after: string;
|
|
1229
|
+
/** The label column's word — `approval`. */
|
|
1230
|
+
label: string;
|
|
1231
|
+
startMs: number;
|
|
1232
|
+
durationMs?: number;
|
|
1233
|
+
/** Written on the rule — `held for approval`. */
|
|
1234
|
+
note?: string;
|
|
1235
|
+
}
|
|
1236
|
+
/** One state a heat strip's square can be in — named in the legend, coloured by its tone. */
|
|
1237
|
+
interface HeatStripState {
|
|
1238
|
+
key: string;
|
|
1239
|
+
label: string;
|
|
1240
|
+
/** `good` · `bad` · `warn`; `neutral` (the default) is the muted ink. */
|
|
1241
|
+
tone?: Tone;
|
|
1242
|
+
/** A ring, not a fill — for "nothing happened here". */
|
|
1243
|
+
hollow?: boolean;
|
|
1244
|
+
}
|
|
1245
|
+
interface HeatStripCell {
|
|
1246
|
+
/** When — `9:45`. In the square's title. */
|
|
1247
|
+
at: string;
|
|
1248
|
+
/** Its state, by key. */
|
|
1249
|
+
state: string;
|
|
1250
|
+
/** More for the title — `2 names: BPCL, HINDPETRO`. */
|
|
1251
|
+
detail?: string;
|
|
1252
|
+
}
|
|
1253
|
+
/** One labelled strip, and the strips it opens into. */
|
|
1254
|
+
interface HeatStripRowOptions {
|
|
1255
|
+
id: string;
|
|
1256
|
+
label: string;
|
|
1257
|
+
cells: HeatStripCell[];
|
|
1258
|
+
children?: HeatStripRowOptions[];
|
|
1259
|
+
/** Drawn open. The reader can open and close it either way. */
|
|
1260
|
+
open?: boolean;
|
|
1261
|
+
}
|
|
1262
|
+
interface HeatStripOptions {
|
|
1263
|
+
states: HeatStripState[];
|
|
1264
|
+
/** One strip. Send this or `rows`. */
|
|
1265
|
+
cells?: HeatStripCell[];
|
|
1266
|
+
/** Labelled strips over one axis, each opening into its `children`. */
|
|
1267
|
+
rows?: HeatStripRowOptions[];
|
|
1268
|
+
/** Labels under the squares, by index — `[{ at: 0, label: "09" }]`. */
|
|
1269
|
+
ticks?: {
|
|
1270
|
+
at: number;
|
|
1271
|
+
label: string;
|
|
1272
|
+
}[];
|
|
1273
|
+
}
|
|
1274
|
+
/** One dated event of the timeline block — and the smaller events it breaks into. */
|
|
1275
|
+
interface TimelineEvent {
|
|
1276
|
+
when: string;
|
|
1277
|
+
text: string;
|
|
1278
|
+
tone?: Tone;
|
|
1279
|
+
/** A second line under the text. */
|
|
1280
|
+
detail?: string;
|
|
1281
|
+
/** Starts a labelled run of events — `Before`, `Spike`, `After`. */
|
|
1282
|
+
section?: string;
|
|
1283
|
+
/** Calls the event out. */
|
|
1284
|
+
highlight?: boolean;
|
|
1285
|
+
/** The events it breaks into — a customs hold into its steps — drawn under it when it is open. */
|
|
1286
|
+
children?: TimelineEvent[];
|
|
1287
|
+
/** Drawn open. The reader can open and close it either way. */
|
|
1288
|
+
open?: boolean;
|
|
1289
|
+
}
|
|
1290
|
+
interface TraceOptions {
|
|
1291
|
+
steps: TraceStep[];
|
|
1292
|
+
/** One line — `▸ 4 steps` with `summary` at the right — until opened. */
|
|
1293
|
+
folded?: boolean;
|
|
1294
|
+
/** At the right of the folded line — `4.2 s · 16,319 rows`. */
|
|
1295
|
+
summary?: string;
|
|
1296
|
+
/** Under a failed step — `Retry`, `Skip this step` — sent as `action` events. */
|
|
1297
|
+
actions?: ActionOption[];
|
|
1298
|
+
}
|
|
1299
|
+
/** A file an answer hands over. */
|
|
1300
|
+
interface FileItem {
|
|
1301
|
+
name: string;
|
|
1302
|
+
size?: string;
|
|
1303
|
+
/** Eight characters, mono — what a reader quotes. */
|
|
1304
|
+
digest?: string;
|
|
1305
|
+
/** What the file is, in a line — `412 rows · missing store code`. */
|
|
1306
|
+
note?: string;
|
|
1307
|
+
/** A word on the file's state — `rejected`. */
|
|
1308
|
+
status?: {
|
|
1309
|
+
label: string;
|
|
1310
|
+
tone?: Tone;
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
interface AnswerOptionsByKind extends SharedAnswerOptions {
|
|
1314
|
+
attr: {
|
|
1315
|
+
columns: (Column & {
|
|
1316
|
+
dir?: "higher" | "lower";
|
|
1317
|
+
})[];
|
|
1318
|
+
rows: Record<string, Cell>[];
|
|
1319
|
+
total?: number;
|
|
1320
|
+
noun?: string;
|
|
1321
|
+
};
|
|
1322
|
+
waterfall: {
|
|
1323
|
+
start?: {
|
|
1324
|
+
label: string;
|
|
1325
|
+
value: number;
|
|
1326
|
+
};
|
|
1327
|
+
steps: {
|
|
1328
|
+
label: string;
|
|
1329
|
+
value: number;
|
|
1330
|
+
}[];
|
|
1331
|
+
end: {
|
|
1332
|
+
label: string;
|
|
1333
|
+
value: number;
|
|
1334
|
+
};
|
|
1335
|
+
unit?: string;
|
|
1336
|
+
};
|
|
1337
|
+
matrix: {
|
|
1338
|
+
rows: string[];
|
|
1339
|
+
cols: string[];
|
|
1340
|
+
values: (number | null)[][];
|
|
1341
|
+
scale: "sequential" | "diverging";
|
|
1342
|
+
};
|
|
1343
|
+
funnel: {
|
|
1344
|
+
steps: {
|
|
1345
|
+
label: string;
|
|
1346
|
+
count: number;
|
|
1347
|
+
}[];
|
|
1348
|
+
};
|
|
1349
|
+
histogram: {
|
|
1350
|
+
bins: {
|
|
1351
|
+
from: number;
|
|
1352
|
+
to: number;
|
|
1353
|
+
count: number;
|
|
1354
|
+
}[];
|
|
1355
|
+
threshold?: {
|
|
1356
|
+
value: number;
|
|
1357
|
+
label: string;
|
|
1358
|
+
};
|
|
1359
|
+
outliers?: number;
|
|
1360
|
+
unit?: string;
|
|
1361
|
+
};
|
|
1362
|
+
timeline: {
|
|
1363
|
+
/**
|
|
1364
|
+
* `detail` is a second line under the text. `section` starts a labelled run
|
|
1365
|
+
* of events — `Before`, `Spike`, `After`; `highlight` calls one out.
|
|
1366
|
+
*/
|
|
1367
|
+
events: TimelineEvent[];
|
|
1368
|
+
};
|
|
1369
|
+
subgraph: {
|
|
1370
|
+
nodes: {
|
|
1371
|
+
id: string;
|
|
1372
|
+
label: string;
|
|
1373
|
+
}[];
|
|
1374
|
+
edges: {
|
|
1375
|
+
from: string;
|
|
1376
|
+
to: string;
|
|
1377
|
+
}[];
|
|
1378
|
+
};
|
|
1379
|
+
method: MethodOptions;
|
|
1380
|
+
citations: CitationsOptions;
|
|
1381
|
+
files: {
|
|
1382
|
+
files: FileItem[];
|
|
1383
|
+
/** Each file gets its type icon and a `Download` link. */
|
|
1384
|
+
download?: boolean;
|
|
1385
|
+
};
|
|
1386
|
+
proposal: ProposalOptions;
|
|
1387
|
+
cannot: CannotOptions;
|
|
1388
|
+
caveat: CaveatOptions;
|
|
1389
|
+
scope: ScopeOptions;
|
|
1390
|
+
checks: {
|
|
1391
|
+
rows: {
|
|
1392
|
+
label: string;
|
|
1393
|
+
ok: boolean;
|
|
1394
|
+
count?: Figure;
|
|
1395
|
+
}[];
|
|
1396
|
+
};
|
|
1397
|
+
trace: TraceOptions;
|
|
1398
|
+
activity: ActivityOptions;
|
|
1399
|
+
gantt: GanttOptions;
|
|
1400
|
+
heatstrip: HeatStripOptions;
|
|
1401
|
+
test: {
|
|
1402
|
+
verdict: string;
|
|
1403
|
+
evidence?: "strong" | "moderate" | "weak";
|
|
1404
|
+
groups?: string;
|
|
1405
|
+
statistic: string;
|
|
1406
|
+
p: Figure;
|
|
1407
|
+
effect: Figure;
|
|
1408
|
+
assumptions: {
|
|
1409
|
+
label: string;
|
|
1410
|
+
ok: boolean;
|
|
1411
|
+
detail?: string;
|
|
1412
|
+
}[];
|
|
1413
|
+
};
|
|
1414
|
+
coef: {
|
|
1415
|
+
terms: {
|
|
1416
|
+
term: string;
|
|
1417
|
+
est: number;
|
|
1418
|
+
se: number;
|
|
1419
|
+
lo: number;
|
|
1420
|
+
hi: number;
|
|
1421
|
+
p: Figure;
|
|
1422
|
+
strong?: boolean;
|
|
1423
|
+
}[];
|
|
1424
|
+
};
|
|
1425
|
+
forest: {
|
|
1426
|
+
rows: {
|
|
1427
|
+
label: string;
|
|
1428
|
+
est: number;
|
|
1429
|
+
lo: number;
|
|
1430
|
+
hi: number;
|
|
1431
|
+
overall?: boolean;
|
|
1432
|
+
}[];
|
|
1433
|
+
nullAt: number;
|
|
1434
|
+
unit?: string;
|
|
1435
|
+
};
|
|
1436
|
+
scatter: {
|
|
1437
|
+
points: [number, number][];
|
|
1438
|
+
fit?: {
|
|
1439
|
+
slope: number;
|
|
1440
|
+
intercept: number;
|
|
1441
|
+
};
|
|
1442
|
+
r2?: number;
|
|
1443
|
+
x: string;
|
|
1444
|
+
y: string;
|
|
1445
|
+
};
|
|
1446
|
+
box: {
|
|
1447
|
+
groups: {
|
|
1448
|
+
label: string;
|
|
1449
|
+
min: number;
|
|
1450
|
+
q1: number;
|
|
1451
|
+
median: number;
|
|
1452
|
+
q3: number;
|
|
1453
|
+
max: number;
|
|
1454
|
+
outliers?: number[];
|
|
1455
|
+
}[];
|
|
1456
|
+
unit?: string;
|
|
1457
|
+
};
|
|
1458
|
+
correlation: {
|
|
1459
|
+
vars: string[];
|
|
1460
|
+
values: number[][];
|
|
1461
|
+
};
|
|
1462
|
+
control: {
|
|
1463
|
+
series: [string, number][];
|
|
1464
|
+
centre: number;
|
|
1465
|
+
ucl: number;
|
|
1466
|
+
lcl: number;
|
|
1467
|
+
breaches?: string[];
|
|
1468
|
+
};
|
|
1469
|
+
pareto: {
|
|
1470
|
+
items: {
|
|
1471
|
+
label: string;
|
|
1472
|
+
value: number;
|
|
1473
|
+
}[];
|
|
1474
|
+
};
|
|
1475
|
+
survival: {
|
|
1476
|
+
curves: {
|
|
1477
|
+
label: string;
|
|
1478
|
+
points: [number, number][];
|
|
1479
|
+
}[];
|
|
1480
|
+
atRisk?: {
|
|
1481
|
+
at: number;
|
|
1482
|
+
n: number;
|
|
1483
|
+
}[];
|
|
1484
|
+
unit?: string;
|
|
1485
|
+
};
|
|
1486
|
+
tornado: {
|
|
1487
|
+
base: number;
|
|
1488
|
+
inputs: {
|
|
1489
|
+
label: string;
|
|
1490
|
+
low: number;
|
|
1491
|
+
high: number;
|
|
1492
|
+
note?: string;
|
|
1493
|
+
}[];
|
|
1494
|
+
unit?: string;
|
|
1495
|
+
};
|
|
1496
|
+
decomposition: {
|
|
1497
|
+
x: string[];
|
|
1498
|
+
trend: number[];
|
|
1499
|
+
seasonal: number[];
|
|
1500
|
+
residual: number[];
|
|
1501
|
+
};
|
|
1502
|
+
modeleval: {
|
|
1503
|
+
confusion: {
|
|
1504
|
+
tp: number;
|
|
1505
|
+
fp: number;
|
|
1506
|
+
fn: number;
|
|
1507
|
+
tn: number;
|
|
1508
|
+
};
|
|
1509
|
+
threshold?: number;
|
|
1510
|
+
gains?: [number, number][];
|
|
1511
|
+
labels?: {
|
|
1512
|
+
positive: string;
|
|
1513
|
+
negative: string;
|
|
1514
|
+
};
|
|
1515
|
+
};
|
|
1516
|
+
pivot: {
|
|
1517
|
+
rowLabel: string;
|
|
1518
|
+
rows: string[];
|
|
1519
|
+
cols: string[];
|
|
1520
|
+
cells: Cell[][];
|
|
1521
|
+
totals?: {
|
|
1522
|
+
rows: Cell[];
|
|
1523
|
+
cols: Cell[];
|
|
1524
|
+
all: Cell;
|
|
1525
|
+
};
|
|
1526
|
+
};
|
|
1527
|
+
profile: {
|
|
1528
|
+
columns: {
|
|
1529
|
+
name: string;
|
|
1530
|
+
type: string;
|
|
1531
|
+
nulls: Figure;
|
|
1532
|
+
spread?: number[];
|
|
1533
|
+
flag?: boolean;
|
|
1534
|
+
}[];
|
|
1535
|
+
};
|
|
1536
|
+
evidence: {
|
|
1537
|
+
level: "strong" | "moderate" | "weak";
|
|
1538
|
+
reason: string;
|
|
1539
|
+
};
|
|
1540
|
+
dumbbell: {
|
|
1541
|
+
rows: {
|
|
1542
|
+
label: string;
|
|
1543
|
+
a: number;
|
|
1544
|
+
b: number;
|
|
1545
|
+
}[];
|
|
1546
|
+
a: string;
|
|
1547
|
+
b: string;
|
|
1548
|
+
unit?: string;
|
|
1549
|
+
};
|
|
1550
|
+
quantiles: {
|
|
1551
|
+
label?: string;
|
|
1552
|
+
p10: number;
|
|
1553
|
+
p50: number;
|
|
1554
|
+
p90: number;
|
|
1555
|
+
unit: string;
|
|
1556
|
+
max?: number;
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
/** One row of what a step read or wrote — `prompt`, `rows`, `query`. */
|
|
1560
|
+
interface TraceIoRow {
|
|
1561
|
+
label: string;
|
|
1562
|
+
value: string;
|
|
1563
|
+
/** Set the value as code, keeping its line breaks — a query, a formula. */
|
|
1564
|
+
code?: boolean;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* A step of the run behind an answer. Only `label` and `state` are required;
|
|
1568
|
+
* everything else is the step's record, filled in as the run streams — its
|
|
1569
|
+
* time, its attempts, the reasoning it streamed, what went in and came out.
|
|
1570
|
+
*/
|
|
1571
|
+
interface TraceStep {
|
|
1572
|
+
id?: string;
|
|
1573
|
+
label: string;
|
|
1574
|
+
/** What the step is doing or did, in a line — `14 rows · 3 batches`. */
|
|
1575
|
+
detail?: string;
|
|
1576
|
+
/**
|
|
1577
|
+
* `failed` stops the run at this step; `waiting` is a step held on the
|
|
1578
|
+
* analyst — an ask; `retrying` is a failed attempt about to go again;
|
|
1579
|
+
* `stopped` is a step the analyst interrupted.
|
|
1580
|
+
*/
|
|
1581
|
+
state: "done" | "running" | "pending" | "failed" | "waiting" | "retrying" | "stopped";
|
|
1582
|
+
/** Why a failed step failed, under it. */
|
|
1583
|
+
error?: string;
|
|
1584
|
+
/** The step's machine name, in mono on its record — `translate_thought`. */
|
|
1585
|
+
key?: string;
|
|
1586
|
+
/** When the step started, as an ISO 8601 time. A running step counts up from it. */
|
|
1587
|
+
startedAt?: string;
|
|
1588
|
+
/** How long it took, in ms, once settled. */
|
|
1589
|
+
duration?: number;
|
|
1590
|
+
/** Which attempt this is, and of how many allowed — `retrying 2/3`. */
|
|
1591
|
+
attempt?: number;
|
|
1592
|
+
attempts?: number;
|
|
1593
|
+
/** The model's reasoning, streamed under the step while it runs. */
|
|
1594
|
+
thinking?: string;
|
|
1595
|
+
/** What went in and what came out — the step's audit record. */
|
|
1596
|
+
io?: {
|
|
1597
|
+
input?: TraceIoRow[];
|
|
1598
|
+
output?: TraceIoRow[];
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
/** Every block, by kind, and the options its spec carries. */
|
|
1602
|
+
interface BlockOptionsByKind extends AskOptionsByKind, AnswerOptionsByKind {
|
|
1603
|
+
}
|
|
1604
|
+
/** A block as JSON: its kind and its options. The same object in a turn, a panel or a page. */
|
|
1605
|
+
type BlockSpec<K extends BlockKind = BlockKind> = {
|
|
1606
|
+
[P in K]: {
|
|
1607
|
+
kind: P;
|
|
1608
|
+
} & BlockOptionsByKind[P];
|
|
1609
|
+
}[K];
|
|
1610
|
+
/** A block that returns a value, as JSON. Each step of a multi-step one is one of these. */
|
|
1611
|
+
type AskSpec = BlockSpec<AskKind>;
|
|
1612
|
+
/** Where a block that returns a value stands: open until answered, then settled. */
|
|
1613
|
+
type AskState = "pending" | "answered" | "skipped" | "superseded" | "expired";
|
|
1614
|
+
interface BlockProps<K extends BlockKind = BlockKind> {
|
|
1615
|
+
spec: BlockOptionsByKind[K];
|
|
1616
|
+
/**
|
|
1617
|
+
* Everything the reader does, by name, with what it carries: `reply` and
|
|
1618
|
+
* `change` with the value, `skip`, `open` on a table holding rows back,
|
|
1619
|
+
* `select` with a table row's key, `download` with a file's digest or name,
|
|
1620
|
+
* `prompt` with a follow-up's words, `scope` with `{ part, value }`. An
|
|
1621
|
+
* action the spec declares (`actions`, a caveat's `action`) is `action` with
|
|
1622
|
+
* its id, so its id can never be mistaken for one of these. The shell says
|
|
1623
|
+
* what each means.
|
|
1624
|
+
*/
|
|
1625
|
+
onAction?: (action: string, value?: unknown) => void;
|
|
1626
|
+
/** Where a block that returns a value stands. Unset, it is open. */
|
|
1627
|
+
state?: AskState;
|
|
1628
|
+
/** The value given, once answered. */
|
|
1629
|
+
value?: unknown;
|
|
1630
|
+
/** Names its form and fields. Unset, one is made. */
|
|
1631
|
+
id?: string;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
/** What draws each kind; `null` is a kind with no renderer yet, drawn as a labelled placeholder. */
|
|
1635
|
+
type BlockRenderers = {
|
|
1636
|
+
[K in BlockKind]: React.ComponentType<BlockProps<K>> | null;
|
|
1637
|
+
};
|
|
1638
|
+
/** Keyed by every kind, so a kind added to the list and not here does not compile. */
|
|
1639
|
+
declare const BLOCK_RENDERERS: BlockRenderers;
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Where in a spec a patch lands, from its root: a name reads a field of an
|
|
1643
|
+
* object; on a list, a name is the item whose `key` (or `id`) it is, and a
|
|
1644
|
+
* number is an index. `["tasks", "plan", "subtasks"]` is the subtasks of the
|
|
1645
|
+
* task keyed `plan`. Empty, it is the spec itself.
|
|
1646
|
+
*/
|
|
1647
|
+
type PatchPath = (string | number)[];
|
|
1648
|
+
/**
|
|
1649
|
+
* How a block changes while it streams — the same four ways for every kind,
|
|
1650
|
+
* so a conversation, a board or a page streams any block alike. The API sends
|
|
1651
|
+
* these; {@link applyBlockPatch} returns a new spec and never mutates the old.
|
|
1652
|
+
*
|
|
1653
|
+
* A merge (`set`, `upsert`) is a JSON merge patch one level deep: a field sent
|
|
1654
|
+
* as `null` is removed — the *now* line dropped as a run ends — since JSON
|
|
1655
|
+
* cannot send `undefined`.
|
|
1656
|
+
*/
|
|
1657
|
+
type BlockPatch =
|
|
1658
|
+
/** Merge `fields` into the object at `at` — the clock moving, a run settling. */
|
|
1659
|
+
{
|
|
1660
|
+
op: "set";
|
|
1661
|
+
at?: PatchPath;
|
|
1662
|
+
fields: Record<string, unknown>;
|
|
1663
|
+
}
|
|
1664
|
+
/** Add `text` to the end of the string at `at` — a narrative's words. */
|
|
1665
|
+
| {
|
|
1666
|
+
op: "append";
|
|
1667
|
+
at: PatchPath;
|
|
1668
|
+
text: string;
|
|
1669
|
+
}
|
|
1670
|
+
/** Add `items` to the end of the list at `at` — a chart's points, a table's rows. */
|
|
1671
|
+
| {
|
|
1672
|
+
op: "push";
|
|
1673
|
+
at: PatchPath;
|
|
1674
|
+
items: unknown[];
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* Merge `item` into the list item at `at` with the same `key` (or `id`), or
|
|
1678
|
+
* add it at the end — a task starting, then settling.
|
|
1679
|
+
*/
|
|
1680
|
+
| {
|
|
1681
|
+
op: "upsert";
|
|
1682
|
+
at: PatchPath;
|
|
1683
|
+
item: Record<string, unknown>;
|
|
1684
|
+
};
|
|
1685
|
+
type BlockPatchOp = BlockPatch["op"];
|
|
1686
|
+
declare class BlockPatchError extends Error {
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* A block's spec after one patch. Any spec — a block's options, or a block
|
|
1690
|
+
* spec with its `kind`, which no patch can change.
|
|
1691
|
+
*/
|
|
1692
|
+
declare function applyBlockPatch<S extends object>(spec: S, patch: BlockPatch): S;
|
|
1693
|
+
/** Apply patches in order — a recorded stream, replayed. */
|
|
1694
|
+
declare function applyBlockPatches<S extends object>(spec: S, patches: BlockPatch[]): S;
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* A spec arrives once, then as patches. These are the ways the patches can
|
|
1698
|
+
* arrive — one at a time or in batches, from a fetch body, an EventSource, a
|
|
1699
|
+
* generator, or a recorded script — read the same way by every shell that
|
|
1700
|
+
* streams: a block (`useBlockStream`), a conversation, a board. `P` is the
|
|
1701
|
+
* shell's patch; a block's is {@link BlockPatch}.
|
|
1702
|
+
*/
|
|
1703
|
+
type PatchChunk<P = BlockPatch> = P | P[];
|
|
1704
|
+
type PatchSource<P = BlockPatch> = AsyncIterable<PatchChunk<P>> | Iterable<PatchChunk<P>>;
|
|
1705
|
+
/** Every patch of a source, in the batches they arrived in. */
|
|
1706
|
+
declare function patchesOf<P = BlockPatch>(source: PatchSource<P>): AsyncGenerator<P[]>;
|
|
1707
|
+
/**
|
|
1708
|
+
* Patches from a newline-delimited JSON body: one patch, or an array of them,
|
|
1709
|
+
* per line. Pass the `Response` of a streaming `fetch`, or its body.
|
|
1710
|
+
*/
|
|
1711
|
+
declare function fromNdjson<P = BlockPatch>(input: Response | ReadableStream<Uint8Array>): AsyncGenerator<PatchChunk<P>>;
|
|
1712
|
+
interface EventSourceOptions {
|
|
1713
|
+
/** The event whose data is a patch. @default "message" */
|
|
1714
|
+
event?: string;
|
|
1715
|
+
/** The event that ends the stream. @default "done" */
|
|
1716
|
+
done?: string;
|
|
1717
|
+
/** Close the EventSource when the stream ends. @default true */
|
|
1718
|
+
close?: boolean;
|
|
1719
|
+
}
|
|
1720
|
+
/** Patches from Server-Sent Events: each event's `data` is a patch, or an array of them. */
|
|
1721
|
+
declare function fromEventSource<P = BlockPatch>(source: EventSource, { event, done, close }?: EventSourceOptions): AsyncGenerator<PatchChunk<P>>;
|
|
1722
|
+
/** A patch and when it lands, in ms from the start of the script. */
|
|
1723
|
+
interface ScriptStep<P = BlockPatch> {
|
|
1724
|
+
at: number;
|
|
1725
|
+
patch: PatchChunk<P>;
|
|
1726
|
+
}
|
|
1727
|
+
/** A recorded stream: plain JSON, replayed by {@link playScript} or step by step with {@link scriptFrames}. */
|
|
1728
|
+
type PatchScript<P = BlockPatch> = ScriptStep<P>[];
|
|
1729
|
+
interface PlayOptions {
|
|
1730
|
+
/** 2 plays twice as fast. @default 1 */
|
|
1731
|
+
speed?: number;
|
|
1732
|
+
signal?: AbortSignal;
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* A script's patches, batched by when they land: one batch per moment, in
|
|
1736
|
+
* order — what {@link playScript} yields, without the waiting.
|
|
1737
|
+
*/
|
|
1738
|
+
declare function scriptFrames<P>(script: PatchScript<P>): {
|
|
1739
|
+
at: number;
|
|
1740
|
+
patches: P[];
|
|
1741
|
+
}[];
|
|
1742
|
+
/**
|
|
1743
|
+
* A script as a stream: each step is yielded when it is due. Steps due at the
|
|
1744
|
+
* same moment are yielded together; aborting ends the stream where it stands.
|
|
1745
|
+
*/
|
|
1746
|
+
declare function playScript<P>(script: PatchScript<P>, { speed, signal }?: PlayOptions): AsyncGenerator<P[]>;
|
|
1747
|
+
/** Shift every step of a script by `ms` — to chain scripts one after another. */
|
|
1748
|
+
declare const offsetScript: <P>(script: PatchScript<P>, ms: number) => PatchScript<P>;
|
|
1749
|
+
/** When a script's last step lands. */
|
|
1750
|
+
declare const scriptLength: <P>(script: PatchScript<P>) => number;
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* Patches to apply as they arrive — a streaming fetch (`fromNdjson`), an
|
|
1754
|
+
* EventSource (`fromEventSource`), a generator, or a recorded script
|
|
1755
|
+
* (`playScript`). Pass a function, `(signal) => source`, to open the source
|
|
1756
|
+
* afresh each time the shell mounts — a generator can be read only once. Keep
|
|
1757
|
+
* it stable (module scope, `useCallback`): a new one starts a new stream.
|
|
1758
|
+
*/
|
|
1759
|
+
type SpecStream<P = BlockPatch> = PatchSource<P> | ((signal: AbortSignal) => PatchSource<P>) | null;
|
|
1760
|
+
interface StreamOptions<S, P> {
|
|
1761
|
+
/** The stream ended; the spec as it left it. */
|
|
1762
|
+
onEnd?: (spec: S) => void;
|
|
1763
|
+
/** A patch did not apply, or the source failed. The stream stops there. */
|
|
1764
|
+
onError?: (error: unknown) => void;
|
|
1765
|
+
/** What stopping records — the patches that mark what was running as stopped. */
|
|
1766
|
+
stopPatches?: (spec: S) => P[];
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* The spec as drawn: the one given, with `stream`'s patches applied by `apply`
|
|
1770
|
+
* as they arrive. A new spec starts over from it; `stop()` ends the stream and
|
|
1771
|
+
* records how far it got. Every shell that streams — a block, a conversation,
|
|
1772
|
+
* a board — reads its stream through this, with its own patch.
|
|
1773
|
+
*/
|
|
1774
|
+
declare function useStreamedSpec<S, P>(spec: S, stream: SpecStream<P> | undefined, apply: (spec: S, patches: P[]) => S, { onEnd, onError, stopPatches }?: StreamOptions<S, P>): {
|
|
1775
|
+
live: S;
|
|
1776
|
+
stop: () => void;
|
|
1777
|
+
};
|
|
1778
|
+
/**
|
|
1779
|
+
* One block's spec, streamed: `spec` with `stream`'s {@link BlockPatch}es
|
|
1780
|
+
* applied as they arrive. `<Block stream>` reads it; a shell that draws a
|
|
1781
|
+
* block directly calls it.
|
|
1782
|
+
*
|
|
1783
|
+
* ```tsx
|
|
1784
|
+
* const { live } = useBlockStream(spec, (signal) => fromNdjson(await fetch(url, { signal })))
|
|
1785
|
+
* <GanttBlock spec={live} />
|
|
1786
|
+
* ```
|
|
1787
|
+
*/
|
|
1788
|
+
declare function useBlockStream<S extends object>(spec: S, stream: SpecStream<BlockPatch> | undefined, options?: Omit<StreamOptions<S, BlockPatch>, "stopPatches">): {
|
|
1789
|
+
live: S;
|
|
1790
|
+
stop: () => void;
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
interface BlockComponentProps {
|
|
1794
|
+
spec: BlockSpec;
|
|
1795
|
+
onAction?: (action: string, value?: unknown) => void;
|
|
1796
|
+
/** Where a block that returns a value stands. Unset, it is open. */
|
|
1797
|
+
state?: AskState;
|
|
1798
|
+
/** The value given, once answered. */
|
|
1799
|
+
value?: unknown;
|
|
1800
|
+
id?: string;
|
|
1801
|
+
/**
|
|
1802
|
+
* Patches to `spec` as they arrive — the block draws `spec` with them
|
|
1803
|
+
* applied, and a new `spec` starts over from it. See `useBlockStream`.
|
|
1804
|
+
*/
|
|
1805
|
+
stream?: SpecStream<BlockPatch>;
|
|
1806
|
+
/** The stream ended; the spec as it left it. */
|
|
1807
|
+
onStreamEnd?: (spec: BlockSpec) => void;
|
|
1808
|
+
/** A patch did not apply, or the source failed. The stream stops there. */
|
|
1809
|
+
onStreamError?: (error: unknown) => void;
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* One block, drawn bare from its spec: no card, no title. The shell around it
|
|
1813
|
+
* — an answer card, a question card, a `PanelBox`, a page section — adds the
|
|
1814
|
+
* frame. A kind with no renderer yet is a labelled placeholder with its JSON.
|
|
1815
|
+
*/
|
|
1816
|
+
declare function Block({ spec, stream, onStreamEnd, onStreamError, ...props }: BlockComponentProps): React.JSX.Element;
|
|
1817
|
+
|
|
1818
|
+
interface PageSection {
|
|
1819
|
+
title?: string;
|
|
1820
|
+
description?: string;
|
|
1821
|
+
blocks: BlockSpec[];
|
|
1822
|
+
}
|
|
1823
|
+
/** A page as JSON: a report, or a long answer opened in full. */
|
|
1824
|
+
interface PageSpec {
|
|
1825
|
+
title?: string;
|
|
1826
|
+
description?: string;
|
|
1827
|
+
sections: PageSection[];
|
|
1828
|
+
}
|
|
1829
|
+
interface PageProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
1830
|
+
spec: PageSpec;
|
|
1831
|
+
/**
|
|
1832
|
+
* A block's action, with where the block sits and what it carries — `open` on
|
|
1833
|
+
* a table in section 1, `select` with the row's key as `value`.
|
|
1834
|
+
*/
|
|
1835
|
+
onAction?: (action: string, at: {
|
|
1836
|
+
section: number;
|
|
1837
|
+
block: number;
|
|
1838
|
+
value?: unknown;
|
|
1839
|
+
}) => void;
|
|
1840
|
+
}
|
|
1841
|
+
/**
|
|
1842
|
+
* Blocks laid out as a document: sections top to bottom, each block bare, no
|
|
1843
|
+
* cards and no borders. A section's title is its rule; a page's title is its
|
|
1844
|
+
* heading. The same specs a conversation turn or a board panel draws.
|
|
1845
|
+
*/
|
|
1846
|
+
declare const Page: React.ForwardRefExoticComponent<PageProps & React.RefAttributes<HTMLElement>>;
|
|
1847
|
+
|
|
1848
|
+
interface PlaceholderProps {
|
|
1849
|
+
/** The block's kind. */
|
|
1850
|
+
kind: string;
|
|
1851
|
+
/** The block's spec exactly as it was sent. */
|
|
1852
|
+
options: unknown;
|
|
1853
|
+
className?: string;
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* A block with no renderer yet: its kind and the JSON it was sent.
|
|
1857
|
+
*
|
|
1858
|
+
* Shown rather than skipped, and never an error. A conversation is data that
|
|
1859
|
+
* outlives the code reading it, and a silently missing block is worse than a
|
|
1860
|
+
* visible one, because the analyst reads an answer they believe is complete.
|
|
1861
|
+
* While the kit is being built, the placeholders in a session story are also
|
|
1862
|
+
* the work left, in the place it will appear.
|
|
1863
|
+
*/
|
|
1864
|
+
declare function Placeholder({ kind, options, className }: PlaceholderProps): React.JSX.Element;
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* A figure as text. A string arrives already written; a number or a typed
|
|
1868
|
+
* value is written here, plainly, until `formatValue` lands in `@invana/ui`.
|
|
1869
|
+
*/
|
|
1870
|
+
declare function figureText(figure: Figure): string;
|
|
1871
|
+
/** A figure's value, or a muted dash when there is none to give. */
|
|
1872
|
+
declare function metricValue(value: MetricOptions["value"]): string;
|
|
1873
|
+
/** The tones, as a caption's. `neutral` leaves it muted. */
|
|
1874
|
+
declare const CAPTION_TONE: Record<Tone, MetricTone | undefined>;
|
|
1875
|
+
/** The tones, as a `Badge`'s. */
|
|
1876
|
+
declare const BADGE_TONE: Record<Tone, "success" | "destructive" | "warning" | "muted">;
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* `**…**` spans as strong, the rest as text. The only markup the grammar
|
|
1880
|
+
* allows in prose: the figure the sentence leads with, or what yes will cost.
|
|
1881
|
+
*/
|
|
1882
|
+
declare function strong(text: string): React.ReactNode[];
|
|
1883
|
+
/**
|
|
1884
|
+
* Prose as an answer writes it: `**…**` a figure, `[n]` the marker for source
|
|
1885
|
+
* n where the clause it backs ends, and a figure led by `▲` or `▼` in the tone
|
|
1886
|
+
* of its direction — the arrow is the direction, so the colour follows it.
|
|
1887
|
+
*/
|
|
1888
|
+
declare function prose(text: string, marker: (n: number) => React.ReactNode): React.ReactNode[];
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* The actions under a block, in the order given; the first with `push` starts
|
|
1892
|
+
* the group at the far end. Each is sent as an `action` event.
|
|
1893
|
+
*/
|
|
1894
|
+
declare function ActionRow({ actions, onAction, }: {
|
|
1895
|
+
actions: ActionOption[];
|
|
1896
|
+
onAction: (id: string) => void;
|
|
1897
|
+
}): React.JSX.Element;
|
|
1898
|
+
|
|
1899
|
+
interface ConfirmCost {
|
|
1900
|
+
/** What it measures — `rows scanned`, `time`, `records written`. */
|
|
1901
|
+
label: React.ReactNode;
|
|
1902
|
+
/**
|
|
1903
|
+
* The figure, already written — `2.3B`, `about 40 s`, `0`. A string is
|
|
1904
|
+
* drawn whole as the figure; pass nodes to mark only part of it.
|
|
1905
|
+
*/
|
|
1906
|
+
value: React.ReactNode;
|
|
1907
|
+
/** `warning` for the cost that changes something — records it will write. */
|
|
1908
|
+
tone?: "warning";
|
|
1909
|
+
}
|
|
1910
|
+
interface ConfirmCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1911
|
+
/** What yes does, in one sentence — or a short heading over a `description`. */
|
|
1912
|
+
question: React.ReactNode;
|
|
1913
|
+
/** A muted line under the question; makes the question a heading. */
|
|
1914
|
+
description?: React.ReactNode;
|
|
1915
|
+
/** Set the question as a heading without a description. */
|
|
1916
|
+
heading?: boolean;
|
|
1917
|
+
/** What yes costs, figure by figure, between the question and the buttons. */
|
|
1918
|
+
cost?: ConfirmCost[];
|
|
1919
|
+
/**
|
|
1920
|
+
* `line` writes the cost as a sentence, each figure before its label;
|
|
1921
|
+
* `strip` sets the figures in cells, each label above. @default "line"
|
|
1922
|
+
*/
|
|
1923
|
+
costAs?: "line" | "strip";
|
|
1924
|
+
/**
|
|
1925
|
+
* The strip without its box: only the rules between its cells, and the
|
|
1926
|
+
* outer cells flush with the question — for a card whose frame is already
|
|
1927
|
+
* the edge.
|
|
1928
|
+
*/
|
|
1929
|
+
seamless?: boolean;
|
|
1930
|
+
/** Something to weigh before answering, under the cost — a `CaveatNote`. */
|
|
1931
|
+
caveat?: React.ReactNode;
|
|
1932
|
+
/** The line under the buttons — where the default came from. */
|
|
1933
|
+
hint?: React.ReactNode;
|
|
1934
|
+
/** The yes and no buttons. */
|
|
1935
|
+
children?: React.ReactNode;
|
|
1936
|
+
}
|
|
1937
|
+
/**
|
|
1938
|
+
* Yes or no, where yes states what it costs: the rows it scans, the time it
|
|
1939
|
+
* takes, the records it writes. The cost is stated before the button, not
|
|
1940
|
+
* after — as a line of figures under the question, or as a strip of cells
|
|
1941
|
+
* when the figures are the point.
|
|
1942
|
+
*
|
|
1943
|
+
* The body of a confirm ask, inside its `ClarifyCard`.
|
|
1944
|
+
*/
|
|
1945
|
+
declare const ConfirmCard: React.ForwardRefExoticComponent<ConfirmCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
1946
|
+
|
|
1947
|
+
interface SuggestionChipsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
1948
|
+
/** Two to four follow-ups, each a whole prompt — `Compare with Q3 last year`. */
|
|
1949
|
+
items?: string[];
|
|
1950
|
+
/** Follow-ups under a heading each — `Go deeper`, `Act` — in place of `items`. */
|
|
1951
|
+
groups?: {
|
|
1952
|
+
label: React.ReactNode;
|
|
1953
|
+
items: string[];
|
|
1954
|
+
}[];
|
|
1955
|
+
/**
|
|
1956
|
+
* `wrap` (the default) runs the chips along a line; `stack` puts one per
|
|
1957
|
+
* line, full width. A narrow thread stacks them either way.
|
|
1958
|
+
*/
|
|
1959
|
+
layout?: "wrap" | "stack";
|
|
1960
|
+
/** A line above the chips that says what they are — `I can answer instead`. */
|
|
1961
|
+
lead?: React.ReactNode;
|
|
1962
|
+
/** Follow-ups already sent from here. They stay where they were, dimmed and disabled. */
|
|
1963
|
+
sent?: string[];
|
|
1964
|
+
/** A follow-up was picked; it goes out as the next prompt. */
|
|
1965
|
+
onSelect?: (text: string) => void;
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* What to ask next, under an answer. Each chip is a whole prompt that reuses
|
|
1969
|
+
* the current scope, so picking one sends it as it reads — nothing to fill in.
|
|
1970
|
+
*/
|
|
1971
|
+
declare const SuggestionChips: React.ForwardRefExoticComponent<SuggestionChipsProps & React.RefAttributes<HTMLDivElement>>;
|
|
1972
|
+
|
|
1973
|
+
/**
|
|
1974
|
+
* Which layers a run kept busy, and when: one lane per layer — graph, models,
|
|
1975
|
+
* skills, the LLM, third parties, the cache — over a shared axis, brighter
|
|
1976
|
+
* where it was busier, its rate at the right, the run's steps banded above.
|
|
1977
|
+
*
|
|
1978
|
+
* Live, it follows the last seconds; settled, it is the whole run. A layer
|
|
1979
|
+
* opens into its parts; a lit cell pins, and the operation behind it is
|
|
1980
|
+
* recorded under the lanes. A refusal and a crossing of the boundary are
|
|
1981
|
+
* marked in their cell. When the signal stops the lanes are dimmed, not
|
|
1982
|
+
* cooled: silence is not calm. Under 300px of its own width it switches to
|
|
1983
|
+
* short labels.
|
|
1984
|
+
*/
|
|
1985
|
+
declare function ActivityBlock({ spec, onAction }: BlockProps<"activity">): React.JSX.Element;
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Groups compared as columns. Two or more series sit side by side in each group
|
|
1989
|
+
* with a legend, a muted one drawn as the comparison, against a dashed target.
|
|
1990
|
+
* One series is drawn muted with the called-out group in primary and its value
|
|
1991
|
+
* on the cap. A plan per group is a dashed column each actual stands inside.
|
|
1992
|
+
*/
|
|
1993
|
+
declare function BarsBlock({ spec }: BlockProps<"bars">): React.JSX.Element;
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* What the data does not hold, and what would change the answer — then the
|
|
1997
|
+
* nearby questions it can answer, each sent as a new prompt. Answered in
|
|
1998
|
+
* part, the card says which part is missing, above the answer for the rest.
|
|
1999
|
+
*/
|
|
2000
|
+
declare function CannotBlock({ spec, onAction }: BlockProps<"cannot">): React.JSX.Element;
|
|
2001
|
+
|
|
2002
|
+
/**
|
|
2003
|
+
* What was excluded, imputed or assumed, and how far to trust the figure. A
|
|
2004
|
+
* caveat with the rows behind it links to them; several can fold behind one
|
|
2005
|
+
* line that names their kinds.
|
|
2006
|
+
*/
|
|
2007
|
+
declare function CaveatBlock({ spec, onAction }: BlockProps<"caveat">): React.JSX.Element;
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* The sources an answer rests on, numbered as its markers cite them, with
|
|
2011
|
+
* record counts at the right and what kind of source each is, and how fresh,
|
|
2012
|
+
* under it. The row a marker in the prose points at is lit, when the shell tracks it. Folded, one line
|
|
2013
|
+
* says how many sources and records; a source with no records is said out loud.
|
|
2014
|
+
*/
|
|
2015
|
+
interface CitationsBlockProps extends BlockProps<"citations"> {
|
|
2016
|
+
/** The source the reader is on, when the shell tracks it. Defaults to the spec's `active`. */
|
|
2017
|
+
active?: number;
|
|
2018
|
+
}
|
|
2019
|
+
declare function CitationsBlock({ spec, active }: CitationsBlockProps): React.JSX.Element;
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* Yes or no, where the question says what yes will do and the cost — rows
|
|
2023
|
+
* scanned, time, records written — is stated before the buttons, as a line or
|
|
2024
|
+
* a strip of figures. A caveat to weigh sits under the cost. The default is the
|
|
2025
|
+
* primary button; with `align: "end"` it takes the card's right edge and the
|
|
2026
|
+
* other its left, and a `dismiss` no draws quiet. `hint` says where the
|
|
2027
|
+
* default came from.
|
|
2028
|
+
*
|
|
2029
|
+
* Answered, it settles into the decision, in `settled` words when given, with
|
|
2030
|
+
* the hint the API patches in to say what it led to.
|
|
2031
|
+
*/
|
|
2032
|
+
declare function ConfirmAsk({ spec, state, value: given, onAction }: BlockProps<"confirm">): React.JSX.Element;
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* The files an answer hands over. Several are a list, each addressed by its
|
|
2036
|
+
* digest or offered for download; one file is a card that says what it holds,
|
|
2037
|
+
* with its download or its state at the right.
|
|
2038
|
+
*/
|
|
2039
|
+
declare function FilesBlock({ spec, onAction }: BlockProps<"files">): React.JSX.Element;
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Several related values answered together, where they only make sense as a
|
|
2043
|
+
* set — scenario inputs. The fields render through the form generator: with
|
|
2044
|
+
* `labels: "side"` in a column on the left, with `"top"` over each field, two
|
|
2045
|
+
* to a row where the card is wide enough; a field's `group` sets it under a
|
|
2046
|
+
* small caps name. A number out of its `above`/`below` bounds says so under
|
|
2047
|
+
* itself and holds the submit back. The submit sends a `reply` keyed by field
|
|
2048
|
+
* name.
|
|
2049
|
+
*
|
|
2050
|
+
* Answered, it settles into its values as label/value pairs; Change inputs
|
|
2051
|
+
* reopens the form with them filled in, and sending again is a `change`.
|
|
2052
|
+
*/
|
|
2053
|
+
declare function FormAsk({ spec, state, value: given, onAction }: BlockProps<"form">): React.JSX.Element;
|
|
2054
|
+
|
|
2055
|
+
/**
|
|
2056
|
+
* Where a run's time went: one row per task on the run's own clock, a retry's
|
|
2057
|
+
* failed attempt to the left of the one that stuck, a task that never ran as an
|
|
2058
|
+
* outline. A task that split into others opens into them; one with no timing of
|
|
2059
|
+
* its own draws the stretch they cover. Hover a row for what it produced; pick
|
|
2060
|
+
* one and it is sent as `select` with the task's key.
|
|
2061
|
+
*
|
|
2062
|
+
* A row's `segments` are many bars on one row — what a worker slot held, what a
|
|
2063
|
+
* layer was reached for — painted by `palette`. A keyed bar is picked on its
|
|
2064
|
+
* own and sent as `select` with its key. With `scale: "seq"` the clock counts a
|
|
2065
|
+
* plan's steps, so the same drawing reads a plan before it runs. The reader opens
|
|
2066
|
+
* and closes rows; a spec whose `open` flags change opens and closes them again.
|
|
2067
|
+
*/
|
|
2068
|
+
declare function GanttBlock({ spec, onAction }: BlockProps<"gantt">): React.JSX.Element;
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* A band of figures that belong to one answer, each with its change beneath it
|
|
2072
|
+
* and, where a figure has a ceiling or a target, a bar under it.
|
|
2073
|
+
*/
|
|
2074
|
+
declare function GridBlock({ spec }: BlockProps<"grid">): React.JSX.Element;
|
|
2075
|
+
|
|
2076
|
+
/**
|
|
2077
|
+
* A run of firings, one square each, in time order — a schedule's day, most
|
|
2078
|
+
* green and the one that is not. With `rows`, several strips over one axis, and
|
|
2079
|
+
* a row opens into its children, so the red square can be followed down to the
|
|
2080
|
+
* job that went red. The legend is always drawn: a square has no label of its own.
|
|
2081
|
+
*/
|
|
2082
|
+
declare function HeatStripBlock({ spec }: BlockProps<"heatstrip">): React.JSX.Element;
|
|
2083
|
+
|
|
2084
|
+
/**
|
|
2085
|
+
* The query, formula or model behind the figure, folded. Closed, the line
|
|
2086
|
+
* carries the meta at the right, or the code itself when there is none; open,
|
|
2087
|
+
* the code moves into its own block, with what a model rests on under it, or
|
|
2088
|
+
* the steps of a method that took several.
|
|
2089
|
+
*/
|
|
2090
|
+
declare function MethodBlock({ spec }: BlockProps<"method">): React.JSX.Element;
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* The one figure an answer turns on, with its comparison worded under it — and,
|
|
2094
|
+
* when the answer has them, a bar against its target or its recent run beside it.
|
|
2095
|
+
*/
|
|
2096
|
+
declare function MetricBlock({ spec }: BlockProps<"metric">): React.JSX.Element;
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* Several choices from a list the data model holds — filters, or the
|
|
2100
|
+
* assumptions an analysis will make, where the one left off says why in its
|
|
2101
|
+
* `note`. The defaults arrive ticked; `min` holds the submit back until enough
|
|
2102
|
+
* are, and `max` counts toward its limit beside the submit — at the limit the
|
|
2103
|
+
* rest stop being offered. Options take the same description, lead and
|
|
2104
|
+
* figure a single choice does. Submit sends the ticked values as a `reply`, in
|
|
2105
|
+
* the ask's order.
|
|
2106
|
+
*
|
|
2107
|
+
* Answered, it settles into one label/value pair; Change answer reopens it.
|
|
2108
|
+
*/
|
|
2109
|
+
declare function MultiAsk({ spec, state, value: given, id: idProp, onAction }: BlockProps<"multi">): React.JSX.Element;
|
|
2110
|
+
|
|
2111
|
+
/**
|
|
2112
|
+
* Several related asks sent as one request, one step at a time with its
|
|
2113
|
+
* progress. Skip is offered on a step that is not `required` and not the
|
|
2114
|
+
* last; a required step holds Next back, saying why, until it is answered.
|
|
2115
|
+
* With `review`, the last step leads to the answers laid out once more, each
|
|
2116
|
+
* with Edit, before they are sent. The value is keyed by step id.
|
|
2117
|
+
*
|
|
2118
|
+
* Answered, it settles into the answers as label/value pairs; Change answers
|
|
2119
|
+
* reopens the steps with them filled in, and sending again is a `change`,
|
|
2120
|
+
* which re-runs from this turn.
|
|
2121
|
+
*/
|
|
2122
|
+
declare function MultistepAsk({ spec, state, value: given, onAction }: BlockProps<"multistep">): React.JSX.Element;
|
|
2123
|
+
|
|
2124
|
+
interface NarrativeBlockProps extends BlockProps<"narrative"> {
|
|
2125
|
+
/** The source the reader is on, when the shell tracks it. Defaults to the spec's `active`. */
|
|
2126
|
+
active?: number;
|
|
2127
|
+
/** Pointing at a marker, or away from it. A shell that tracks the source lights its row too. */
|
|
2128
|
+
onActiveChange?: (n: number | undefined) => void;
|
|
2129
|
+
/** Drawn after the text — the conversation's caret while the answer is still being written. */
|
|
2130
|
+
trailing?: React.ReactNode;
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* The answer in two or three sentences, leading with the number. Markers sit
|
|
2134
|
+
* where the text places them (`[n]`), or after it (`cites`); pointing at one
|
|
2135
|
+
* lights its source in the citations when the shell tracks it. `trailing` ends
|
|
2136
|
+
* the text — the caret, while a conversation is still writing it.
|
|
2137
|
+
*/
|
|
2138
|
+
declare function NarrativeBlock({ spec, active, onActiveChange, trailing }: NarrativeBlockProps): React.JSX.Element;
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Something the answer proposes to write: what it proposes, the draft or what
|
|
2142
|
+
* writing it does as figures, what writing it would do in words, and the
|
|
2143
|
+
* actions, each sent as its id. Nothing is written until the shell acts on one;
|
|
2144
|
+
* once written, a stamp says so. The shell gives it its card and its header.
|
|
2145
|
+
*/
|
|
2146
|
+
declare function ProposalBlock({ spec, onAction }: BlockProps<"proposal">): React.JSX.Element;
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* Two to five short spec in one row — a granularity, a confidence level,
|
|
2150
|
+
* an output format — where picking one is the reply. With no `default`
|
|
2151
|
+
* nothing is picked, so the reader answers rather than accepts. An option can
|
|
2152
|
+
* carry a second line (`±1.4 pp`); `stretch` gives each an equal share of the
|
|
2153
|
+
* card. `more` adds rows answered in the same card: the value is then keyed
|
|
2154
|
+
* by row, and it is sent once every row has a pick.
|
|
2155
|
+
*
|
|
2156
|
+
* Answered, each row settles into a label/value pair; Change reopens them.
|
|
2157
|
+
*/
|
|
2158
|
+
declare function QuickAsk({ spec, state, value: given, onAction }: BlockProps<"quick">): React.JSX.Element;
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* Items in the order they matter — drivers, top-N, likely causes — each with
|
|
2162
|
+
* its bar, and its value in a column at the right. A negative contribution
|
|
2163
|
+
* draws in the destructive colour; the rest, folded into one line, is muted.
|
|
2164
|
+
* `diverging` grows the bars both ways from zero.
|
|
2165
|
+
*/
|
|
2166
|
+
declare function RankedBlock({ spec }: BlockProps<"ranked">): React.JSX.Element;
|
|
2167
|
+
|
|
2168
|
+
/**
|
|
2169
|
+
* One entity, or the assumptions behind an answer, as label/value pairs — with
|
|
2170
|
+
* who it is and its state above them, rows under headings, and where each
|
|
2171
|
+
* value came from when that is the point.
|
|
2172
|
+
*/
|
|
2173
|
+
declare function RecordBlock({ spec }: BlockProps<"record">): React.JSX.Element;
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* Period, filters, population and freshness, as the query applied them. Each
|
|
2177
|
+
* part is edited in place — typed, or picked from its choices — and sent as a
|
|
2178
|
+
* `scope` action with `{ part, value }`; a part the shell marks `fixed` — a
|
|
2179
|
+
* freshness, say — is a fact about the data and stays as it is. A part carried from an earlier question and changed since,
|
|
2180
|
+
* or resting on late data, is marked, and a hint about late data is a warning.
|
|
2181
|
+
*/
|
|
2182
|
+
interface ScopeBlockProps extends BlockProps<"scope"> {
|
|
2183
|
+
/** Parts that are facts, not choices — a freshness the data states. Drawn, never edited. */
|
|
2184
|
+
fixed?: number[];
|
|
2185
|
+
}
|
|
2186
|
+
declare function ScopeBlock({ spec, fixed, onAction }: ScopeBlockProps): React.JSX.Element;
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* One choice from a list the data model holds. Picking an option is the reply,
|
|
2190
|
+
* so the default is one keypress away — unless the ask names a `submit`, when
|
|
2191
|
+
* the pick waits for that button (and Skip, when `skippable`). An option can
|
|
2192
|
+
* carry a description under its label, a lead tag or icon before it, and a
|
|
2193
|
+
* figure on the right. With `other`, an “Other…” choice opens a field for the
|
|
2194
|
+
* analyst's own words, sent with Use this.
|
|
2195
|
+
*
|
|
2196
|
+
* Answered, it settles into one label/value pair; Change answer reopens it,
|
|
2197
|
+
* and picking again is a `change`.
|
|
2198
|
+
*/
|
|
2199
|
+
declare function SingleAsk({ spec, state, value: given, id: idProp, onAction }: BlockProps<"single">): React.JSX.Element;
|
|
2200
|
+
|
|
2201
|
+
/**
|
|
2202
|
+
* Follow-ups after an answer, each a whole prompt that reuses the current
|
|
2203
|
+
* scope; picking one is the reply, and the API sends it on as the next prompt.
|
|
2204
|
+
* They run along a line, stack one per line, or sit under headings.
|
|
2205
|
+
*
|
|
2206
|
+
* Answered, the one picked stays, dimmed, and the rest can still be sent: each
|
|
2207
|
+
* is its own next question. Superseded or expired, none can.
|
|
2208
|
+
*/
|
|
2209
|
+
declare function SuggestionsAsk({ spec, state, value: given, onAction }: BlockProps<"suggestions">): React.JSX.Element;
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* The first rows of a longer table, and how many there are in all. When rows
|
|
2213
|
+
* are held back, `Open all` asks for them with the `open` action. The column the
|
|
2214
|
+
* rows are ordered by is marked, rows an answer turns on are called out, and a
|
|
2215
|
+
* total sits under the rows in bold. With a `rowKey`, picking a row sends
|
|
2216
|
+
* `select` with its key, and the `selected` row is drawn picked.
|
|
2217
|
+
*/
|
|
2218
|
+
declare function TableBlock({ spec, onAction }: BlockProps<"table">): React.JSX.Element;
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* A few dated events, in order, each marked by what it did to the figure — with
|
|
2222
|
+
* a detail line under an event, and labelled runs of events around the one an
|
|
2223
|
+
* answer is about, which is called out. An event that breaks into smaller ones
|
|
2224
|
+
* opens into them, so a three-day hold can be read step by step.
|
|
2225
|
+
*/
|
|
2226
|
+
declare function TimelineBlock({ spec }: BlockProps<"timeline">): React.JSX.Element;
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* A measure over time: the line in the foreground, the range it is judged
|
|
2230
|
+
* against shaded in primary beneath it, and the periods that stand out ringed
|
|
2231
|
+
* in their tone. A reference — an alert level, a budget — is a dashed rule,
|
|
2232
|
+
* and every point over it is ringed as a breach; a missing point breaks the
|
|
2233
|
+
* line. The first series is the line; any others are drawn behind it to read
|
|
2234
|
+
* it against, each named at its right end. A period is named by its label.
|
|
2235
|
+
*/
|
|
2236
|
+
declare function TimeseriesBlock({ spec }: BlockProps<"timeseries">): React.JSX.Element | null;
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* What the answer is doing, step by step, while it runs — and the record of it
|
|
2240
|
+
* after, folded to one line. A failed step says why under it, with what can be
|
|
2241
|
+
* done about it; a step held on the analyst waits hollow, in the info tone.
|
|
2242
|
+
*/
|
|
2243
|
+
declare function TraceBlock({ spec, onAction }: BlockProps<"trace">): React.JSX.Element;
|
|
2244
|
+
|
|
2245
|
+
export { ANSWER_KINDS, ASK_KINDS, type ActionOption, ActionRow, ActivityBlock, type ActivityLane, type ActivityOptions, type ActivityPin, type AnswerKind, type AnswerOptionsByKind, type ApprovalOptions, type AskKind, type AskOptionsByKind, type AskSpec, type AskState, type AskText, type AskValueByKind, BADGE_TONE, BLOCKS, BLOCK_RENDERERS, BarsBlock, Block, type BlockComponentProps, type BlockKind, type BlockOptionsByKind, type BlockPatch, BlockPatchError, type BlockPatchOp, type BlockProps, type BlockRenderers, type BlockSpec, CAPTION_TONE, CannotBlock, type CannotOptions, CaveatBlock, type CaveatNoteOptions, type CaveatOptions, type CaveatTone, type Cell, type ChoiceFigure, type ChoiceOption, type CitationSource, CitationsBlock, type CitationsBlockProps, type CitationsOptions, type Column, ConfirmAsk, ConfirmCard, type ConfirmCardProps, type ConfirmCost, type ConfirmOptions, type CostFigure, type EntityOptions, type EventSourceOptions, type Figure, type FileItem, FilesBlock, type ForkOptions, FormAsk, type FormOptions, GanttBlock, type GanttOptions, type GanttSpecBar, type GanttSpecRow, type GanttSpecSeam, type GanttSpecStatus, GridBlock, HeatStripBlock, type HeatStripCell, type HeatStripOptions, type HeatStripRowOptions, type HeatStripState, type HypothesisOptions, type InterpretationOptions, type LongOptions, MethodBlock, type MethodOptions, MetricBlock, type MetricOptions, type ModelSpecOptions, MultiAsk, type MultiOptions, MultistepAsk, type MultistepOptions, NarrativeBlock, type NarrativeBlockProps, type NarrativeOptions, type NumberOptions, Page, type PageProps, type PageSection, type PageSpec, type PatchChunk, type PatchPath, type PatchScript, type PatchSource, type PeriodOptions, Placeholder, type PlaceholderProps, type PlanOptions, type PlayOptions, ProposalBlock, type ProposalOptions, QuickAsk, type QuickOptions, type QuickPick, type RangeOptions, RankedBlock, RecordBlock, type RecordRow, type ScaleOptions, ScopeBlock, type ScopeBlockProps, type ScopeOptions, type ScopePart, type ScriptStep, type ShortOptions, SingleAsk, type SingleOptions, type SpecStream, type StreamOptions, SuggestionChips, type SuggestionChipsProps, SuggestionsAsk, type SuggestionsOptions, TableBlock, TimelineBlock, type TimelineEvent, TimeseriesBlock, type Tone, TraceBlock, type TraceIoRow, type TraceOptions, type TraceStep, type TypedValue, VALUE_TYPES, type ValueTypeId, type WeightsOptions, applyBlockPatch, applyBlockPatches, figureText, fromEventSource, fromNdjson, metricValue, offsetScript, patchesOf, playScript, prose, scriptFrames, scriptLength, strong, useBlockStream, useStreamedSpec };
|