@ofrnsb/whiteboard 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,1495 @@
1
+ import { T as TextSize, B as BoardOp, W as WbLink, S as Shape, a as Board, b as WbNote, c as BoardActivity, d as BoardMode, P as PlannedItem, e as PendingBatch, f as BoardChat } from '../boards-ykaNj5ns.js';
2
+ export { g as BRUSHES, h as BoardBase, i as BoardEdit, j as BuildStep, C as COL_TYPES, k as CellValue, l as ColType, D as DrawConnector, m as DrawItem, n as DrawMark, o as DrawSection, p as DrawSpec, q as DrawStroke, H as Heading, r as HistoryItem, I as ILLUSTRATIONS, s as Illustration, L as LINE_ICONS, t as LayoutKind, u as LineIcon, M as MAX_COLS, v as MAX_LAYER, w as MAX_NOTES, x as MAX_ROWS, N as NOTE_COLORS, y as NOTE_H, z as NOTE_W, A as NoteColor, O as OUTLINED, E as PENS, F as Pen, R as ROUTES, G as Range, J as SHAPES, K as Section, Q as SheetCol, U as SheetRow, V as SheetTab, X as TEXT_SIZES, Y as WbFrame, Z as applyOps, _ as boardAt, $ as boardText, a0 as cellValue, a1 as colorFor, a2 as columnTotal, a3 as contentOf, a4 as drawOps, a5 as evalFormula, a6 as extendTimelineOps, a7 as foldIntoBase, a8 as formulaRefs, a9 as frameAt, aa as historyOf, ab as isIllustration, ac as isLineIcon, ad as layoutOps, ae as markStrokes, af as minSize, ag as nextOrigin, ah as noEmoji, ai as opKeys, aj as pasteOps, ak as pendingBatchOf, al as planOf, am as rangeTsv, an as smoothPoints, ao as stepsOf, ap as tabRows, aq as taskBoardOps, ar as taskShape, as as tidyOps, at as uid, au as validIcon } from '../boards-ykaNj5ns.js';
3
+ import { z } from 'zod';
4
+ import * as zod_to_json_schema from 'zod-to-json-schema';
5
+
6
+ type Box = {
7
+ x: number;
8
+ y: number;
9
+ w: number;
10
+ h: number;
11
+ };
12
+ /** An item a wire may start or end at; its shape says where its outline meets its box. */
13
+ type Item = Box & {
14
+ shape?: string;
15
+ };
16
+ /** Polygon outlines as points in a unit square, and the part of the square their words may use (top, right, bottom, left). */
17
+ declare const POLYGONS: {
18
+ readonly diamond: {
19
+ readonly pts: readonly [readonly [0.5, 0], readonly [1, 0.5], readonly [0.5, 1], readonly [0, 0.5]];
20
+ readonly inset: readonly [0.24, 0.22, 0.24, 0.22];
21
+ };
22
+ readonly triangle: {
23
+ readonly pts: readonly [readonly [0.5, 0], readonly [1, 1], readonly [0, 1]];
24
+ readonly inset: readonly [0.46, 0.24, 0.06, 0.24];
25
+ };
26
+ readonly pentagon: {
27
+ readonly pts: readonly [readonly [0.5, 0], readonly [1, 0.38], readonly [0.81, 1], readonly [0.19, 1], readonly [0, 0.38]];
28
+ readonly inset: readonly [0.26, 0.15, 0.06, 0.15];
29
+ };
30
+ readonly hexagon: {
31
+ readonly pts: readonly [readonly [0.24, 0], readonly [0.76, 0], readonly [1, 0.5], readonly [0.76, 1], readonly [0.24, 1], readonly [0, 0.5]];
32
+ readonly inset: readonly [0.08, 0.17, 0.08, 0.17];
33
+ };
34
+ readonly parallelogram: {
35
+ readonly pts: readonly [readonly [0.16, 0], readonly [1, 0], readonly [0.84, 1], readonly [0, 1]];
36
+ readonly inset: readonly [0.06, 0.17, 0.06, 0.17];
37
+ };
38
+ };
39
+ type Polygon = keyof typeof POLYGONS;
40
+ declare const isPolygon: (s: unknown) => s is Polygon;
41
+ /** The polygon's points at a size, as "x,y x,y ..." pairs. */
42
+ declare const polygonPoints: (p: Polygon, w: number, h: number) => [number, number][];
43
+ /** Padding (top, right, bottom, left in px) that keeps words inside a polygon of this size. */
44
+ declare const polygonPad: (p: Polygon, w: number, h: number) => [number, number, number, number];
45
+ /**
46
+ * Lines a text takes in a width, wrapped word by word the way the browser does: a word that does not fit starts the
47
+ * next line, a word longer than the line breaks across lines, and each written line break starts a new line.
48
+ */
49
+ declare function wrapLines(s: string | undefined, charW: number, width: number): number;
50
+ declare const overlaps: (a: Box, list: readonly Box[], gap?: number) => boolean;
51
+ /**
52
+ * The nearest place for a box that keeps `gap` from everything taken, searched outwards from where it was asked for.
53
+ * What is already on the board never moves; only the newcomer does.
54
+ */
55
+ declare function freeSpot(want: Box, taken: readonly Box[], gap: number, step?: number, reach?: number): Box;
56
+ /** Grid cell and clearance in px; costs in cells: a bend, crossing a wire, running along one, and leaving by a side that faces away. */
57
+ declare const WIRE: {
58
+ readonly cell: 16;
59
+ readonly clear: 18;
60
+ readonly margin: 360;
61
+ readonly bend: 20;
62
+ readonly cross: 6;
63
+ readonly along: 30;
64
+ readonly away: 8;
65
+ };
66
+ type Wire = {
67
+ from: string;
68
+ to: string;
69
+ label?: string;
70
+ };
71
+ type Routed = {
72
+ pts: number[];
73
+ label?: {
74
+ x: number;
75
+ y: number;
76
+ w: number;
77
+ h: number;
78
+ };
79
+ };
80
+ /** A label's box on a wire: its width from the letters, measured the way the board letters it. */
81
+ declare const labelSize: (label: string, charW: number) => {
82
+ w: number;
83
+ h: number;
84
+ };
85
+ /**
86
+ * Wires drawn in order, each one orthogonal, around every item (never through one), leaving and entering at a side,
87
+ * preferring few bends and keeping apart from the wires already drawn. `labelW` measures a label.
88
+ */
89
+ declare function routeWires(items: ReadonlyMap<string, Item>, wires: readonly Wire[], labelW: (s: string) => {
90
+ w: number;
91
+ h: number;
92
+ }): Map<number, Routed>;
93
+ /**
94
+ * Where a wire's label goes: on the longest run with wire showing on both sides of it, clear of every item and label;
95
+ * failing that, beside the run, so a label never hides the wire it names.
96
+ */
97
+ declare function labelSpot(pts: number[], size: {
98
+ w: number;
99
+ h: number;
100
+ }, avoid: readonly Box[]): Box;
101
+ /** A routed wire as thin boxes along its runs, so later items keep clear of it. */
102
+ declare function wireBoxes(pts: number[], pad?: number): Box[];
103
+
104
+ declare const SK: {
105
+ readonly lower: 0.36;
106
+ readonly upper: 0.43;
107
+ readonly wrapSlack: 1.12;
108
+ readonly pad: 14;
109
+ readonly gap: 18;
110
+ readonly groupPad: 26;
111
+ readonly groupTitle: 40;
112
+ readonly roundInner: 0.76;
113
+ readonly block: {
114
+ readonly s: {
115
+ readonly title: 19;
116
+ readonly titleLh: 23;
117
+ readonly text: 16;
118
+ readonly textLh: 20;
119
+ readonly icon: 34;
120
+ };
121
+ readonly m: {
122
+ readonly title: 24;
123
+ readonly titleLh: 28;
124
+ readonly text: 20;
125
+ readonly textLh: 25;
126
+ readonly icon: 52;
127
+ };
128
+ readonly l: {
129
+ readonly title: 32;
130
+ readonly titleLh: 37;
131
+ readonly text: 24;
132
+ readonly textLh: 30;
133
+ readonly icon: 72;
134
+ };
135
+ readonly xl: {
136
+ readonly title: 44;
137
+ readonly titleLh: 50;
138
+ readonly text: 30;
139
+ readonly textLh: 37;
140
+ readonly icon: 92;
141
+ };
142
+ };
143
+ readonly words: {
144
+ readonly s: {
145
+ readonly size: 20;
146
+ readonly lh: 25;
147
+ readonly upper: false;
148
+ };
149
+ readonly m: {
150
+ readonly size: 26;
151
+ readonly lh: 31;
152
+ readonly upper: false;
153
+ };
154
+ readonly l: {
155
+ readonly size: 32;
156
+ readonly lh: 37;
157
+ readonly upper: true;
158
+ };
159
+ readonly xl: {
160
+ readonly size: 46;
161
+ readonly lh: 50;
162
+ readonly upper: true;
163
+ };
164
+ };
165
+ readonly headline: {
166
+ readonly w: 1500;
167
+ readonly gapBelow: 10;
168
+ readonly contextW: 1500;
169
+ readonly below: 34;
170
+ readonly iconGap: 28;
171
+ readonly icon: 96;
172
+ };
173
+ readonly pillH: 46;
174
+ readonly maxPush: 60;
175
+ };
176
+ declare const TONES: readonly ["fact", "problem", "action", "insight", "person", "system"];
177
+ type Tone = (typeof TONES)[number];
178
+ /** Shapes the agent may draw; `square` and `circle` keep equal sides, `sticky` is a yellow note, `text` bare lettering. */
179
+ declare const FORMS: readonly ["rect", "square", "circle", "ellipse", "diamond", "triangle", "pentagon", "hexagon", "parallelogram", "cylinder", "cloud", "pill", "sticky", "text"];
180
+ type Form = (typeof FORMS)[number];
181
+ type FreeItem = {
182
+ key: string;
183
+ x: number;
184
+ y: number;
185
+ form?: Form;
186
+ size?: TextSize;
187
+ w?: number;
188
+ h?: number;
189
+ /** How deep in the explanation this sits: 0 the main flow, 1 its breakdown, and so on to 9. */
190
+ layer?: number;
191
+ title?: string;
192
+ text?: string;
193
+ tone?: Tone;
194
+ icon?: string;
195
+ /** The questions a reader would ask about this thing, answered on the board. */
196
+ why?: string;
197
+ who?: string;
198
+ when?: string;
199
+ where?: string;
200
+ how?: string;
201
+ howMuch?: string;
202
+ /** What this item's figure or claim rests on that the data does not prove (a rate that holds, a price, a definition). */
203
+ assumes?: string;
204
+ /** A remark the agent makes about this thing, stuck beside it as a sticky note. */
205
+ note?: string;
206
+ };
207
+ type FreeLink = {
208
+ from: string;
209
+ to: string;
210
+ label?: string;
211
+ dashed?: boolean;
212
+ };
213
+ type FreeBeat = {
214
+ say: string;
215
+ items?: FreeItem[];
216
+ links?: FreeLink[];
217
+ };
218
+ type FreeStory = {
219
+ headline: string;
220
+ context?: string;
221
+ icon?: string;
222
+ beats: FreeBeat[];
223
+ };
224
+ type ToldStep = {
225
+ say: string;
226
+ ops: BoardOp[];
227
+ };
228
+ /** The width of one letter of a wire's label, as the board letters it (Patrick Hand at 19px, with slack). */
229
+ declare const LABEL_CHAR: number;
230
+ declare const wireLabel: (s: string) => {
231
+ w: number;
232
+ h: number;
233
+ };
234
+ /** The height a sketched shape needs for its words at a lettering size, in a given width. */
235
+ declare function blockHeight(title: string | undefined, text: string | undefined, icon: string | undefined, size: keyof typeof SK.block, w: number, shape?: Shape): number;
236
+ /** A sticky note's height for its words (it is lettered in the board's own type, not in marker). */
237
+ declare const noteHeight: (text: string, w: number) => number;
238
+ /** Items wires keep clear of: everything but pen strokes and roads. */
239
+ declare const obstacles: (notes: readonly WbNote[]) => Map<string, Item>;
240
+ /** Wires the board routes itself, in drawing order. */
241
+ declare const autoWires: (links: readonly WbLink[]) => WbLink[];
242
+ /**
243
+ * The story as board ops, one group per beat in the order told: the headline and legend first, then each beat's
244
+ * items where the agent put them, its sticky notes, and its wires. `board` is what is already there, when adding.
245
+ */
246
+ declare function layFree(story: FreeStory, origin?: {
247
+ x: number;
248
+ y: number;
249
+ }, board?: Pick<Board, "notes" | "links">, ids?: () => string): {
250
+ steps: ToldStep[];
251
+ skipped: string[];
252
+ };
253
+
254
+ declare const LEN: {
255
+ readonly prefix: 6;
256
+ readonly short: 12;
257
+ readonly tag: 30;
258
+ readonly id: 40;
259
+ readonly name: 60;
260
+ readonly key: 64;
261
+ readonly label: 80;
262
+ readonly title: 120;
263
+ readonly ident: 128;
264
+ readonly line: 200;
265
+ readonly host: 255;
266
+ readonly message: 300;
267
+ readonly note: 400;
268
+ readonly para: 500;
269
+ readonly detail: 600;
270
+ readonly text: 1000;
271
+ readonly long: 2000;
272
+ readonly doc: 4000;
273
+ readonly instructions: 12000;
274
+ };
275
+ declare const BOARD: {
276
+ readonly note: {
277
+ readonly w: 200;
278
+ readonly h: 120;
279
+ };
280
+ readonly gap: 16;
281
+ readonly pad: 24;
282
+ readonly head: 48;
283
+ readonly maxNotes: 400;
284
+ readonly maxLinks: 400;
285
+ readonly maxTabs: 12;
286
+ readonly maxRows: 2000;
287
+ readonly maxCols: 40;
288
+ readonly maxText: 2000;
289
+ readonly maxInkPoints: 4000;
290
+ readonly inkWeight: {
291
+ readonly min: 1;
292
+ readonly max: 400;
293
+ };
294
+ readonly coordLimit: 100000;
295
+ readonly minSize: {
296
+ readonly mark: {
297
+ readonly w: 24;
298
+ readonly h: 16;
299
+ };
300
+ readonly shape: {
301
+ readonly w: 80;
302
+ readonly h: 40;
303
+ };
304
+ readonly note: {
305
+ readonly w: 120;
306
+ readonly h: 80;
307
+ };
308
+ };
309
+ readonly frame: {
310
+ readonly default: {
311
+ readonly w: 480;
312
+ readonly h: 360;
313
+ };
314
+ readonly min: {
315
+ readonly w: 160;
316
+ readonly h: 100;
317
+ };
318
+ };
319
+ readonly gridSectionsPerRow: 3;
320
+ readonly gridNotesPerRow: 2;
321
+ readonly textRows: 200;
322
+ readonly draw: {
323
+ readonly pad: 24;
324
+ readonly head: 48;
325
+ readonly gapX: 16;
326
+ readonly gapY: 12;
327
+ readonly sectionGap: 40;
328
+ readonly wrapAt: 1150;
329
+ readonly stackSlack: 160;
330
+ readonly aspect: 2.2;
331
+ readonly flowGapX: 56;
332
+ readonly diagramGap: {
333
+ readonly x: 64;
334
+ readonly y: 48;
335
+ };
336
+ readonly belowExisting: 96;
337
+ readonly item: {
338
+ readonly stack: {
339
+ readonly w: 560;
340
+ readonly h: 56;
341
+ };
342
+ readonly grid: {
343
+ readonly w: 200;
344
+ readonly h: 88;
345
+ };
346
+ readonly row: {
347
+ readonly w: 184;
348
+ readonly h: 80;
349
+ };
350
+ readonly flow: {
351
+ readonly w: 168;
352
+ readonly h: 88;
353
+ };
354
+ readonly diagram: {
355
+ readonly w: 184;
356
+ readonly h: 72;
357
+ };
358
+ readonly timeline: {
359
+ readonly w: 200;
360
+ readonly h: 120;
361
+ };
362
+ readonly matrix: {
363
+ readonly w: 176;
364
+ readonly h: 56;
365
+ };
366
+ };
367
+ readonly heading: {
368
+ readonly w: 720;
369
+ readonly h: 44;
370
+ readonly step: 52;
371
+ readonly subH: 28;
372
+ readonly subStep: 36;
373
+ readonly titleRoom: 40;
374
+ readonly titleCharW: 22;
375
+ readonly stickerGap: 24;
376
+ };
377
+ /** An emoji card: room for the illustration above the title. */
378
+ readonly iconCard: {
379
+ readonly extraH: 64;
380
+ };
381
+ readonly sticker: {
382
+ readonly w: 112;
383
+ readonly h: 112;
384
+ readonly captionH: 28;
385
+ };
386
+ /** The road: cards alternate above and below a gentle wave; `step` is the distance between milestones. */
387
+ readonly timeline: {
388
+ readonly step: 136;
389
+ readonly amp: 34;
390
+ readonly waveSteps: 2.4;
391
+ readonly sample: 24;
392
+ readonly lead: 56;
393
+ readonly cardGap: 56;
394
+ readonly pill: {
395
+ readonly w: 88;
396
+ readonly h: 32;
397
+ };
398
+ readonly dot: {
399
+ readonly w: 22;
400
+ readonly h: 22;
401
+ };
402
+ readonly trackPad: 24;
403
+ readonly labelH: 32;
404
+ };
405
+ readonly matrix: {
406
+ readonly headW: 132;
407
+ readonly headH: 40;
408
+ readonly cellW: 208;
409
+ readonly cellMinH: 96;
410
+ readonly cellPad: 12;
411
+ readonly itemGap: 8;
412
+ readonly gap: 6;
413
+ };
414
+ /** A hand-composed section: its own space in board units, and the limits on what the agent may place in it. */
415
+ readonly free: {
416
+ readonly w: 2200;
417
+ readonly h: 920;
418
+ readonly titleH: 56;
419
+ readonly titleGap: 12;
420
+ readonly titleMinW: 320;
421
+ readonly titleCharW: 13;
422
+ readonly itemW: 220;
423
+ readonly itemH: 120;
424
+ readonly gap: 24;
425
+ readonly strokes: 24;
426
+ readonly points: 80;
427
+ readonly strokeW: {
428
+ readonly pena: {
429
+ readonly s: 3;
430
+ readonly m: 6;
431
+ readonly l: 10;
432
+ };
433
+ readonly spidol: {
434
+ readonly s: 8;
435
+ readonly m: 14;
436
+ readonly l: 22;
437
+ };
438
+ };
439
+ };
440
+ /**
441
+ * The marker sketch. Letter widths are Patrick Hand's measured average advance per em (lower and upper case), with a
442
+ * little slack for word wrap. Blocks and loose text come in four sizes; the board measures every item with these
443
+ * same numbers before placing it, so words always fit their outline.
444
+ */
445
+ readonly sketch: {
446
+ readonly lower: 0.36;
447
+ readonly upper: 0.43;
448
+ readonly wrapSlack: 1.12;
449
+ readonly pad: 14;
450
+ readonly gap: 18;
451
+ readonly groupPad: 26;
452
+ readonly groupTitle: 40;
453
+ readonly roundInner: 0.76;
454
+ readonly block: {
455
+ readonly s: {
456
+ readonly title: 19;
457
+ readonly titleLh: 23;
458
+ readonly text: 16;
459
+ readonly textLh: 20;
460
+ readonly icon: 34;
461
+ };
462
+ readonly m: {
463
+ readonly title: 24;
464
+ readonly titleLh: 28;
465
+ readonly text: 20;
466
+ readonly textLh: 25;
467
+ readonly icon: 52;
468
+ };
469
+ readonly l: {
470
+ readonly title: 32;
471
+ readonly titleLh: 37;
472
+ readonly text: 24;
473
+ readonly textLh: 30;
474
+ readonly icon: 72;
475
+ };
476
+ readonly xl: {
477
+ readonly title: 44;
478
+ readonly titleLh: 50;
479
+ readonly text: 30;
480
+ readonly textLh: 37;
481
+ readonly icon: 92;
482
+ };
483
+ };
484
+ readonly words: {
485
+ readonly s: {
486
+ readonly size: 20;
487
+ readonly lh: 25;
488
+ readonly upper: false;
489
+ };
490
+ readonly m: {
491
+ readonly size: 26;
492
+ readonly lh: 31;
493
+ readonly upper: false;
494
+ };
495
+ readonly l: {
496
+ readonly size: 32;
497
+ readonly lh: 37;
498
+ readonly upper: true;
499
+ };
500
+ readonly xl: {
501
+ readonly size: 46;
502
+ readonly lh: 50;
503
+ readonly upper: true;
504
+ };
505
+ };
506
+ readonly headline: {
507
+ readonly w: 1500;
508
+ readonly gapBelow: 10;
509
+ readonly contextW: 1500;
510
+ readonly below: 34;
511
+ readonly iconGap: 28;
512
+ readonly icon: 96;
513
+ };
514
+ readonly pillH: 46;
515
+ readonly maxPush: 60;
516
+ };
517
+ /**
518
+ * A free board: items where the agent put them, `gap` kept between any two, sticky notes `noteW` wide parked
519
+ * `noteGap` from what they are about. Sticky notes are lettered in the board's own type: about `noteChar` wide
520
+ * per letter at 14px, `noteLh` a line, `noteTop` for the margins.
521
+ */
522
+ readonly tell: {
523
+ readonly widths: {
524
+ readonly s: 240;
525
+ readonly m: 300;
526
+ readonly l: 380;
527
+ readonly xl: 480;
528
+ };
529
+ readonly minTextW: 150;
530
+ readonly gap: 56;
531
+ readonly noteW: 230;
532
+ readonly noteMaxW: 330;
533
+ readonly noteGap: 16;
534
+ readonly below: 80;
535
+ readonly minAspect: {
536
+ readonly diamond: 0.75;
537
+ readonly triangle: 0.8;
538
+ readonly pentagon: 0.85;
539
+ readonly hexagon: 0.5;
540
+ readonly parallelogram: 0.3;
541
+ };
542
+ readonly noteChar: 7.2;
543
+ readonly noteLh: 20;
544
+ readonly noteTop: 34;
545
+ readonly notePad: 32;
546
+ readonly maxItems: 40;
547
+ readonly legend: {
548
+ readonly fact: "black: facts";
549
+ readonly problem: "red: what goes wrong";
550
+ readonly action: "green: what we do";
551
+ readonly insight: "purple: what it means";
552
+ readonly person: "blue: people and desks";
553
+ readonly system: "orange: systems and data";
554
+ readonly note: "yellow notes: what I said while drawing";
555
+ readonly wires: "black wires: the main flow; each layer of detail below it has its own wire colour (1 blue, 2 teal, 3 violet, 4 orange, 5 magenta, 6 olive, 7 brown, 8 slate, 9 cyan)";
556
+ };
557
+ };
558
+ readonly sectionItems: 60;
559
+ readonly gridColumns: 6;
560
+ readonly gridColumnsDefault: 2;
561
+ readonly textItemH: 32;
562
+ readonly minFrameW: 280;
563
+ readonly titleCharW: 8;
564
+ readonly minFrameExtraH: 40;
565
+ readonly fit: {
566
+ readonly charW: 7.2;
567
+ readonly minLineW: 80;
568
+ readonly inset: 28;
569
+ readonly base: 24;
570
+ readonly lineH: 20;
571
+ readonly titleGap: 4;
572
+ };
573
+ };
574
+ /** Sticky notes of a column or grid board (retro, brainstorm): square-ish with large text. */
575
+ readonly sticky: {
576
+ readonly w: 168;
577
+ readonly h: 140;
578
+ readonly top: 30;
579
+ readonly titleLh: 21;
580
+ readonly titleCharW: 8.4;
581
+ readonly byH: 16;
582
+ readonly charW: 7.2;
583
+ readonly lh: 20;
584
+ readonly pad: 32;
585
+ };
586
+ };
587
+
588
+ /** More about an edit: the agent's reason, and who is now working on the board (null clears it). */
589
+ type EditMore = {
590
+ why?: string;
591
+ activity?: Omit<BoardActivity, "at"> | null;
592
+ batch?: string;
593
+ told?: boolean;
594
+ };
595
+ /** The conversation acting on a board. */
596
+ type Via = {
597
+ chatId: string;
598
+ userId: string;
599
+ };
600
+ /** One piece of agent work (one tool call): its edits share the id, so the piece can be kept or undone as one. */
601
+ declare const newBatch: () => string;
602
+ /** A short reference people can say and the agent can quote: WB-2611-AB12. */
603
+ declare const newRef: (mode: BoardMode) => string;
604
+ /** Remembers the conversation on the board; a chat keeps its strongest link (made it > changed it > read it). */
605
+ declare function withChat(b: Board, via: Via | undefined, what: BoardChat["what"], at?: string): Board;
606
+ /** Who owns the board in the host: its organisation (tenant), team (unit) and project. */
607
+ type Owner = {
608
+ tenantId: string;
609
+ unitId?: string;
610
+ projectId?: string | null;
611
+ };
612
+ type CreateInput = {
613
+ title: string;
614
+ mode?: BoardMode;
615
+ id?: string;
616
+ ref?: string;
617
+ };
618
+ /** A new board, made by a person (`agent` false, `by` their name) or by the agent, with its first ops applied. */
619
+ declare function createBoard(owner: Owner, input: CreateInput, ops: BoardOp[], agent: boolean, by: string, via?: Via, more?: EditMore): Board;
620
+ /** `keys` overrides what gets outlined, so tidying the layout after a change does not light up every note. */
621
+ declare function editBoard(board: Board, ops: BoardOp[], agent: boolean, by: string, what: string, keys?: string[], via?: Via, more?: EditMore): Board;
622
+ /** Shows who is at work on the board; the content and its version stay as they are. */
623
+ declare function setActivity(board: Board, activity: Omit<BoardActivity, "at"> | null): Board;
624
+ /** The activity while it is fresh; an agent that stopped (or a tab that closed) fades out on its own. */
625
+ declare function liveActivity(board: Board, now?: number): BoardActivity | null;
626
+ /** The board as a browser gets it: no stored ops or base (history has its own call), a stale activity dropped. */
627
+ declare function publicBoard(b: Board): Board & {
628
+ pendingBatch: PendingBatch | null;
629
+ };
630
+ /** What a browser polling at `since` gets: nothing new when the board is still at that version. */
631
+ declare function snapshot(b: Board, since?: number): {
632
+ same: boolean;
633
+ version: number;
634
+ activity: BoardActivity | null;
635
+ pendingBatch: PendingBatch | null;
636
+ board?: undefined;
637
+ } | {
638
+ board: Board & {
639
+ pendingBatch: PendingBatch | null;
640
+ };
641
+ same?: undefined;
642
+ version?: undefined;
643
+ activity?: undefined;
644
+ pendingBatch?: undefined;
645
+ };
646
+ /**
647
+ * One edit the agent makes in a build, and how long the host should wait after saving it so anyone watching sees the
648
+ * board grow (the plan is shown first: `planFirst` asks the host to save the activity alone, then pause).
649
+ */
650
+ type AgentStep = {
651
+ ops: BoardOp[];
652
+ what: string;
653
+ why: string;
654
+ activity: Omit<BoardActivity, "at">;
655
+ told?: boolean;
656
+ pauseMs: number;
657
+ planFirst?: boolean;
658
+ };
659
+ /** The agent's ops cut into visible steps (a frame, then its cards two at a time, then links...), each with its reason. */
660
+ declare function buildSteps(ops: BoardOp[], batch: string, via?: Via, what?: string, why?: string, planFirst?: boolean): AgentStep[];
661
+ /** Beats told one at a time (draw_whiteboard): each its own edit carrying what was said, held long enough to read. */
662
+ declare function toldSteps(beats: {
663
+ say: string;
664
+ ops: BoardOp[];
665
+ }[], batch: string, via?: Via, why?: string): AgentStep[];
666
+ /** The plan of a piece of work as activity alone, for the pause before its first step lands. */
667
+ declare const planActivity: (ops: BoardOp[], what: string, batch: string, via?: Via) => Omit<BoardActivity, "at"> & {
668
+ plan: PlannedItem[];
669
+ };
670
+ /** Applies one agent step to a board (new or existing) as its own edit. */
671
+ declare function applyStep(owner: Owner, target: Board | CreateInput, step: AgentStep, via?: Via): Board;
672
+ /** Accepts the agent's work: recorded on its edits (history shows who kept it), the content and version unchanged. */
673
+ declare function keepBatch(board: Board, batch: string, by: string): Board | {
674
+ error: string;
675
+ };
676
+ /**
677
+ * Takes the agent's work back: the board returns to the version just before the batch's first edit, as a new edit.
678
+ * Refused (with who) when someone else changed the board after the agent did, so their work is never dropped silently.
679
+ */
680
+ declare function undoBatch(board: Board, batch: string, by: string): Board | {
681
+ error: string;
682
+ conflict?: true;
683
+ };
684
+ /** Makes an earlier version current again, as a new edit, so the restore itself can be undone. */
685
+ declare function restoreBoard(board: Board, version: number, by: string): Board | {
686
+ error: string;
687
+ };
688
+ declare const OpSchema: z.ZodType<BoardOp>;
689
+ /** A person's edits as a browser sent them, or the problems with them. */
690
+ declare const PatchInput: z.ZodObject<{
691
+ ops: z.ZodArray<z.ZodType<BoardOp, z.ZodTypeDef, BoardOp>, "many">;
692
+ }, "strip", z.ZodTypeAny, {
693
+ ops: BoardOp[];
694
+ }, {
695
+ ops: BoardOp[];
696
+ }>;
697
+
698
+ declare const BOARD_STEPS: {
699
+ readonly frame: "Laying out the title and frame";
700
+ readonly road: "Drawing the road";
701
+ readonly marks: "Placing milestones";
702
+ readonly marksRange: (from: string, to: string) => string;
703
+ readonly cards: (titles: string[]) => string;
704
+ readonly changes: "Tidying up";
705
+ readonly links: "Connecting steps";
706
+ readonly stickers: "Placing illustrations";
707
+ readonly what: Record<"frame" | "road" | "marks" | "cards" | "changes" | "links" | "stickers", string>;
708
+ readonly restoreWhat: "restored a version";
709
+ readonly restoreWhy: (v: number) => string;
710
+ readonly undoWhat: "undid the agent's work";
711
+ readonly undoWhy: (what: string) => string;
712
+ readonly reading: "reading the board";
713
+ readonly editing: "editing the board";
714
+ };
715
+
716
+ declare const CreateWhiteboardInput: z.ZodObject<{
717
+ title: z.ZodString;
718
+ layout: z.ZodDefault<z.ZodEnum<["columns", "timeline", "grid"]>>;
719
+ heading: z.ZodOptional<z.ZodObject<{
720
+ title: z.ZodString;
721
+ subtitle: z.ZodOptional<z.ZodString>;
722
+ icon: z.ZodOptional<z.ZodString>;
723
+ }, "strip", z.ZodTypeAny, {
724
+ title: string;
725
+ icon?: string | undefined;
726
+ subtitle?: string | undefined;
727
+ }, {
728
+ title: string;
729
+ icon?: string | undefined;
730
+ subtitle?: string | undefined;
731
+ }>>;
732
+ sections: z.ZodArray<z.ZodObject<{
733
+ title: z.ZodString;
734
+ subtitle: z.ZodOptional<z.ZodString>;
735
+ notes: z.ZodDefault<z.ZodArray<z.ZodObject<{
736
+ text: z.ZodString;
737
+ title: z.ZodOptional<z.ZodString>;
738
+ icon: z.ZodOptional<z.ZodString>;
739
+ owner: z.ZodOptional<z.ZodString>;
740
+ due: z.ZodOptional<z.ZodString>;
741
+ color: z.ZodOptional<z.ZodEnum<["yellow", "blue", "green", "pink", "purple", "gray", "paper", "ink", "red", "outline", "new", "orange", "peach", "sand"]>>;
742
+ }, "strip", z.ZodTypeAny, {
743
+ text: string;
744
+ title?: string | undefined;
745
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
746
+ owner?: string | undefined;
747
+ due?: string | undefined;
748
+ icon?: string | undefined;
749
+ }, {
750
+ text: string;
751
+ title?: string | undefined;
752
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
753
+ owner?: string | undefined;
754
+ due?: string | undefined;
755
+ icon?: string | undefined;
756
+ }>, "many">>;
757
+ }, "strip", z.ZodTypeAny, {
758
+ title: string;
759
+ notes: {
760
+ text: string;
761
+ title?: string | undefined;
762
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
763
+ owner?: string | undefined;
764
+ due?: string | undefined;
765
+ icon?: string | undefined;
766
+ }[];
767
+ subtitle?: string | undefined;
768
+ }, {
769
+ title: string;
770
+ subtitle?: string | undefined;
771
+ notes?: {
772
+ text: string;
773
+ title?: string | undefined;
774
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
775
+ owner?: string | undefined;
776
+ due?: string | undefined;
777
+ icon?: string | undefined;
778
+ }[] | undefined;
779
+ }>, "many">;
780
+ why: z.ZodOptional<z.ZodString>;
781
+ }, "strip", z.ZodTypeAny, {
782
+ title: string;
783
+ layout: "columns" | "timeline" | "grid";
784
+ sections: {
785
+ title: string;
786
+ notes: {
787
+ text: string;
788
+ title?: string | undefined;
789
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
790
+ owner?: string | undefined;
791
+ due?: string | undefined;
792
+ icon?: string | undefined;
793
+ }[];
794
+ subtitle?: string | undefined;
795
+ }[];
796
+ why?: string | undefined;
797
+ heading?: {
798
+ title: string;
799
+ icon?: string | undefined;
800
+ subtitle?: string | undefined;
801
+ } | undefined;
802
+ }, {
803
+ title: string;
804
+ sections: {
805
+ title: string;
806
+ subtitle?: string | undefined;
807
+ notes?: {
808
+ text: string;
809
+ title?: string | undefined;
810
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
811
+ owner?: string | undefined;
812
+ due?: string | undefined;
813
+ icon?: string | undefined;
814
+ }[] | undefined;
815
+ }[];
816
+ why?: string | undefined;
817
+ layout?: "columns" | "timeline" | "grid" | undefined;
818
+ heading?: {
819
+ title: string;
820
+ icon?: string | undefined;
821
+ subtitle?: string | undefined;
822
+ } | undefined;
823
+ }>;
824
+ declare const DrawWhiteboardInput: z.ZodObject<{
825
+ board: z.ZodOptional<z.ZodString>;
826
+ title: z.ZodOptional<z.ZodString>;
827
+ headline: z.ZodOptional<z.ZodString>;
828
+ context: z.ZodOptional<z.ZodString>;
829
+ icon: z.ZodOptional<z.ZodString>;
830
+ beats: z.ZodArray<z.ZodObject<{
831
+ say: z.ZodString;
832
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
833
+ note: z.ZodOptional<z.ZodString>;
834
+ why: z.ZodOptional<z.ZodString>;
835
+ who: z.ZodOptional<z.ZodString>;
836
+ when: z.ZodOptional<z.ZodString>;
837
+ where: z.ZodOptional<z.ZodString>;
838
+ how: z.ZodOptional<z.ZodString>;
839
+ howMuch: z.ZodOptional<z.ZodString>;
840
+ assumes: z.ZodOptional<z.ZodString>;
841
+ key: z.ZodString;
842
+ x: z.ZodNumber;
843
+ y: z.ZodNumber;
844
+ form: z.ZodOptional<z.ZodEnum<["rect", "square", "circle", "ellipse", "diamond", "triangle", "pentagon", "hexagon", "parallelogram", "cylinder", "cloud", "pill", "sticky", "text"]>>;
845
+ size: z.ZodOptional<z.ZodEnum<["s", "m", "l", "xl"]>>;
846
+ w: z.ZodOptional<z.ZodNumber>;
847
+ h: z.ZodOptional<z.ZodNumber>;
848
+ layer: z.ZodOptional<z.ZodNumber>;
849
+ title: z.ZodOptional<z.ZodString>;
850
+ text: z.ZodOptional<z.ZodString>;
851
+ tone: z.ZodOptional<z.ZodEnum<["fact", "problem", "action", "insight", "person", "system"]>>;
852
+ icon: z.ZodOptional<z.ZodString>;
853
+ }, "strip", z.ZodTypeAny, {
854
+ x: number;
855
+ y: number;
856
+ key: string;
857
+ note?: string | undefined;
858
+ text?: string | undefined;
859
+ title?: string | undefined;
860
+ w?: number | undefined;
861
+ h?: number | undefined;
862
+ icon?: string | undefined;
863
+ size?: "l" | "s" | "m" | "xl" | undefined;
864
+ layer?: number | undefined;
865
+ why?: string | undefined;
866
+ how?: string | undefined;
867
+ when?: string | undefined;
868
+ form?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "cylinder" | "text" | "pill" | "rect" | "square" | "circle" | "sticky" | undefined;
869
+ tone?: "fact" | "problem" | "action" | "insight" | "person" | "system" | undefined;
870
+ who?: string | undefined;
871
+ where?: string | undefined;
872
+ howMuch?: string | undefined;
873
+ assumes?: string | undefined;
874
+ }, {
875
+ x: number;
876
+ y: number;
877
+ key: string;
878
+ note?: string | undefined;
879
+ text?: string | undefined;
880
+ title?: string | undefined;
881
+ w?: number | undefined;
882
+ h?: number | undefined;
883
+ icon?: string | undefined;
884
+ size?: "l" | "s" | "m" | "xl" | undefined;
885
+ layer?: number | undefined;
886
+ why?: string | undefined;
887
+ how?: string | undefined;
888
+ when?: string | undefined;
889
+ form?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "cylinder" | "text" | "pill" | "rect" | "square" | "circle" | "sticky" | undefined;
890
+ tone?: "fact" | "problem" | "action" | "insight" | "person" | "system" | undefined;
891
+ who?: string | undefined;
892
+ where?: string | undefined;
893
+ howMuch?: string | undefined;
894
+ assumes?: string | undefined;
895
+ }>, "many">>;
896
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
897
+ from: z.ZodString;
898
+ to: z.ZodString;
899
+ label: z.ZodOptional<z.ZodString>;
900
+ dashed: z.ZodOptional<z.ZodBoolean>;
901
+ }, "strip", z.ZodTypeAny, {
902
+ from: string;
903
+ to: string;
904
+ dashed?: boolean | undefined;
905
+ label?: string | undefined;
906
+ }, {
907
+ from: string;
908
+ to: string;
909
+ dashed?: boolean | undefined;
910
+ label?: string | undefined;
911
+ }>, "many">>;
912
+ }, "strip", z.ZodTypeAny, {
913
+ say: string;
914
+ links?: {
915
+ from: string;
916
+ to: string;
917
+ dashed?: boolean | undefined;
918
+ label?: string | undefined;
919
+ }[] | undefined;
920
+ items?: {
921
+ x: number;
922
+ y: number;
923
+ key: string;
924
+ note?: string | undefined;
925
+ text?: string | undefined;
926
+ title?: string | undefined;
927
+ w?: number | undefined;
928
+ h?: number | undefined;
929
+ icon?: string | undefined;
930
+ size?: "l" | "s" | "m" | "xl" | undefined;
931
+ layer?: number | undefined;
932
+ why?: string | undefined;
933
+ how?: string | undefined;
934
+ when?: string | undefined;
935
+ form?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "cylinder" | "text" | "pill" | "rect" | "square" | "circle" | "sticky" | undefined;
936
+ tone?: "fact" | "problem" | "action" | "insight" | "person" | "system" | undefined;
937
+ who?: string | undefined;
938
+ where?: string | undefined;
939
+ howMuch?: string | undefined;
940
+ assumes?: string | undefined;
941
+ }[] | undefined;
942
+ }, {
943
+ say: string;
944
+ links?: {
945
+ from: string;
946
+ to: string;
947
+ dashed?: boolean | undefined;
948
+ label?: string | undefined;
949
+ }[] | undefined;
950
+ items?: {
951
+ x: number;
952
+ y: number;
953
+ key: string;
954
+ note?: string | undefined;
955
+ text?: string | undefined;
956
+ title?: string | undefined;
957
+ w?: number | undefined;
958
+ h?: number | undefined;
959
+ icon?: string | undefined;
960
+ size?: "l" | "s" | "m" | "xl" | undefined;
961
+ layer?: number | undefined;
962
+ why?: string | undefined;
963
+ how?: string | undefined;
964
+ when?: string | undefined;
965
+ form?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "cylinder" | "text" | "pill" | "rect" | "square" | "circle" | "sticky" | undefined;
966
+ tone?: "fact" | "problem" | "action" | "insight" | "person" | "system" | undefined;
967
+ who?: string | undefined;
968
+ where?: string | undefined;
969
+ howMuch?: string | undefined;
970
+ assumes?: string | undefined;
971
+ }[] | undefined;
972
+ }>, "many">;
973
+ why: z.ZodOptional<z.ZodString>;
974
+ }, "strip", z.ZodTypeAny, {
975
+ beats: {
976
+ say: string;
977
+ links?: {
978
+ from: string;
979
+ to: string;
980
+ dashed?: boolean | undefined;
981
+ label?: string | undefined;
982
+ }[] | undefined;
983
+ items?: {
984
+ x: number;
985
+ y: number;
986
+ key: string;
987
+ note?: string | undefined;
988
+ text?: string | undefined;
989
+ title?: string | undefined;
990
+ w?: number | undefined;
991
+ h?: number | undefined;
992
+ icon?: string | undefined;
993
+ size?: "l" | "s" | "m" | "xl" | undefined;
994
+ layer?: number | undefined;
995
+ why?: string | undefined;
996
+ how?: string | undefined;
997
+ when?: string | undefined;
998
+ form?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "cylinder" | "text" | "pill" | "rect" | "square" | "circle" | "sticky" | undefined;
999
+ tone?: "fact" | "problem" | "action" | "insight" | "person" | "system" | undefined;
1000
+ who?: string | undefined;
1001
+ where?: string | undefined;
1002
+ howMuch?: string | undefined;
1003
+ assumes?: string | undefined;
1004
+ }[] | undefined;
1005
+ }[];
1006
+ title?: string | undefined;
1007
+ icon?: string | undefined;
1008
+ why?: string | undefined;
1009
+ board?: string | undefined;
1010
+ headline?: string | undefined;
1011
+ context?: string | undefined;
1012
+ }, {
1013
+ beats: {
1014
+ say: string;
1015
+ links?: {
1016
+ from: string;
1017
+ to: string;
1018
+ dashed?: boolean | undefined;
1019
+ label?: string | undefined;
1020
+ }[] | undefined;
1021
+ items?: {
1022
+ x: number;
1023
+ y: number;
1024
+ key: string;
1025
+ note?: string | undefined;
1026
+ text?: string | undefined;
1027
+ title?: string | undefined;
1028
+ w?: number | undefined;
1029
+ h?: number | undefined;
1030
+ icon?: string | undefined;
1031
+ size?: "l" | "s" | "m" | "xl" | undefined;
1032
+ layer?: number | undefined;
1033
+ why?: string | undefined;
1034
+ how?: string | undefined;
1035
+ when?: string | undefined;
1036
+ form?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "cylinder" | "text" | "pill" | "rect" | "square" | "circle" | "sticky" | undefined;
1037
+ tone?: "fact" | "problem" | "action" | "insight" | "person" | "system" | undefined;
1038
+ who?: string | undefined;
1039
+ where?: string | undefined;
1040
+ howMuch?: string | undefined;
1041
+ assumes?: string | undefined;
1042
+ }[] | undefined;
1043
+ }[];
1044
+ title?: string | undefined;
1045
+ icon?: string | undefined;
1046
+ why?: string | undefined;
1047
+ board?: string | undefined;
1048
+ headline?: string | undefined;
1049
+ context?: string | undefined;
1050
+ }>;
1051
+ declare const UpdateWhiteboardInput: z.ZodObject<{
1052
+ board: z.ZodString;
1053
+ add_sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1054
+ title: z.ZodString;
1055
+ subtitle: z.ZodOptional<z.ZodString>;
1056
+ notes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1057
+ text: z.ZodString;
1058
+ title: z.ZodOptional<z.ZodString>;
1059
+ icon: z.ZodOptional<z.ZodString>;
1060
+ owner: z.ZodOptional<z.ZodString>;
1061
+ due: z.ZodOptional<z.ZodString>;
1062
+ color: z.ZodOptional<z.ZodEnum<["yellow", "blue", "green", "pink", "purple", "gray", "paper", "ink", "red", "outline", "new", "orange", "peach", "sand"]>>;
1063
+ }, "strip", z.ZodTypeAny, {
1064
+ text: string;
1065
+ title?: string | undefined;
1066
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1067
+ owner?: string | undefined;
1068
+ due?: string | undefined;
1069
+ icon?: string | undefined;
1070
+ }, {
1071
+ text: string;
1072
+ title?: string | undefined;
1073
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1074
+ owner?: string | undefined;
1075
+ due?: string | undefined;
1076
+ icon?: string | undefined;
1077
+ }>, "many">>;
1078
+ }, "strip", z.ZodTypeAny, {
1079
+ title: string;
1080
+ notes: {
1081
+ text: string;
1082
+ title?: string | undefined;
1083
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1084
+ owner?: string | undefined;
1085
+ due?: string | undefined;
1086
+ icon?: string | undefined;
1087
+ }[];
1088
+ subtitle?: string | undefined;
1089
+ }, {
1090
+ title: string;
1091
+ subtitle?: string | undefined;
1092
+ notes?: {
1093
+ text: string;
1094
+ title?: string | undefined;
1095
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1096
+ owner?: string | undefined;
1097
+ due?: string | undefined;
1098
+ icon?: string | undefined;
1099
+ }[] | undefined;
1100
+ }>, "many">>;
1101
+ add_notes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1102
+ text: z.ZodString;
1103
+ title: z.ZodOptional<z.ZodString>;
1104
+ icon: z.ZodOptional<z.ZodString>;
1105
+ owner: z.ZodOptional<z.ZodString>;
1106
+ due: z.ZodOptional<z.ZodString>;
1107
+ color: z.ZodOptional<z.ZodEnum<["yellow", "blue", "green", "pink", "purple", "gray", "paper", "ink", "red", "outline", "new", "orange", "peach", "sand"]>>;
1108
+ } & {
1109
+ section: z.ZodOptional<z.ZodString>;
1110
+ }, "strip", z.ZodTypeAny, {
1111
+ text: string;
1112
+ title?: string | undefined;
1113
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1114
+ owner?: string | undefined;
1115
+ due?: string | undefined;
1116
+ icon?: string | undefined;
1117
+ section?: string | undefined;
1118
+ }, {
1119
+ text: string;
1120
+ title?: string | undefined;
1121
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1122
+ owner?: string | undefined;
1123
+ due?: string | undefined;
1124
+ icon?: string | undefined;
1125
+ section?: string | undefined;
1126
+ }>, "many">>;
1127
+ move_notes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1128
+ note_id: z.ZodString;
1129
+ section: z.ZodString;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ section: string;
1132
+ note_id: string;
1133
+ }, {
1134
+ section: string;
1135
+ note_id: string;
1136
+ }>, "many">>;
1137
+ update_notes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1138
+ text: z.ZodOptional<z.ZodString>;
1139
+ icon: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1140
+ owner: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1141
+ due: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1142
+ color: z.ZodOptional<z.ZodOptional<z.ZodEnum<["yellow", "blue", "green", "pink", "purple", "gray", "paper", "ink", "red", "outline", "new", "orange", "peach", "sand"]>>>;
1143
+ } & {
1144
+ note_id: z.ZodString;
1145
+ title: z.ZodOptional<z.ZodString>;
1146
+ shape: z.ZodOptional<z.ZodEnum<["note", "box", "text", "ellipse", "cloud", "cylinder", "ink", "track", "pill", "dot", "cell", "sticker", "diamond", "triangle", "pentagon", "hexagon", "parallelogram"]>>;
1147
+ size: z.ZodOptional<z.ZodEnum<["s", "m", "l", "xl"]>>;
1148
+ }, "strip", z.ZodTypeAny, {
1149
+ note_id: string;
1150
+ text?: string | undefined;
1151
+ shape?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "box" | "note" | "cylinder" | "text" | "ink" | "track" | "pill" | "dot" | "cell" | "sticker" | undefined;
1152
+ title?: string | undefined;
1153
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1154
+ owner?: string | undefined;
1155
+ due?: string | undefined;
1156
+ icon?: string | undefined;
1157
+ size?: "l" | "s" | "m" | "xl" | undefined;
1158
+ }, {
1159
+ note_id: string;
1160
+ text?: string | undefined;
1161
+ shape?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "box" | "note" | "cylinder" | "text" | "ink" | "track" | "pill" | "dot" | "cell" | "sticker" | undefined;
1162
+ title?: string | undefined;
1163
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1164
+ owner?: string | undefined;
1165
+ due?: string | undefined;
1166
+ icon?: string | undefined;
1167
+ size?: "l" | "s" | "m" | "xl" | undefined;
1168
+ }>, "many">>;
1169
+ update_links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1170
+ link_id: z.ZodString;
1171
+ label: z.ZodOptional<z.ZodString>;
1172
+ route: z.ZodOptional<z.ZodEnum<["straight", "elbow", "curve", "auto"]>>;
1173
+ dashed: z.ZodOptional<z.ZodBoolean>;
1174
+ arrow: z.ZodOptional<z.ZodEnum<["end", "both", "none"]>>;
1175
+ }, "strip", z.ZodTypeAny, {
1176
+ link_id: string;
1177
+ route?: "straight" | "elbow" | "curve" | "auto" | undefined;
1178
+ dashed?: boolean | undefined;
1179
+ label?: string | undefined;
1180
+ arrow?: "end" | "both" | "none" | undefined;
1181
+ }, {
1182
+ link_id: string;
1183
+ route?: "straight" | "elbow" | "curve" | "auto" | undefined;
1184
+ dashed?: boolean | undefined;
1185
+ label?: string | undefined;
1186
+ arrow?: "end" | "both" | "none" | undefined;
1187
+ }>, "many">>;
1188
+ remove_notes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1189
+ rename_sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1190
+ section: z.ZodString;
1191
+ title: z.ZodString;
1192
+ }, "strip", z.ZodTypeAny, {
1193
+ title: string;
1194
+ section: string;
1195
+ }, {
1196
+ title: string;
1197
+ section: string;
1198
+ }>, "many">>;
1199
+ remove_sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1200
+ add_links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1201
+ from: z.ZodString;
1202
+ to: z.ZodString;
1203
+ label: z.ZodOptional<z.ZodString>;
1204
+ }, "strip", z.ZodTypeAny, {
1205
+ from: string;
1206
+ to: string;
1207
+ label?: string | undefined;
1208
+ }, {
1209
+ from: string;
1210
+ to: string;
1211
+ label?: string | undefined;
1212
+ }>, "many">>;
1213
+ remove_links: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1214
+ extend_timeline: z.ZodOptional<z.ZodObject<{
1215
+ road: z.ZodOptional<z.ZodString>;
1216
+ items: z.ZodArray<z.ZodObject<{
1217
+ key: z.ZodOptional<z.ZodString>;
1218
+ shape: z.ZodOptional<z.ZodEnum<["box", "note", "ellipse", "pill", "cloud", "cylinder", "text", "sticker", "dot"]>>;
1219
+ pen: z.ZodOptional<z.ZodEnum<["black", "blue", "green", "red", "purple", "orange"]>>;
1220
+ dashed: z.ZodOptional<z.ZodBoolean>;
1221
+ title: z.ZodOptional<z.ZodString>;
1222
+ text: z.ZodOptional<z.ZodString>;
1223
+ icon: z.ZodOptional<z.ZodString>;
1224
+ when: z.ZodOptional<z.ZodString>;
1225
+ color: z.ZodOptional<z.ZodEnum<["yellow", "blue", "green", "pink", "purple", "gray", "paper", "ink", "red", "outline", "new", "orange", "peach", "sand"]>>;
1226
+ size: z.ZodOptional<z.ZodEnum<["s", "m", "l", "xl"]>>;
1227
+ owner: z.ZodOptional<z.ZodString>;
1228
+ due: z.ZodOptional<z.ZodString>;
1229
+ }, "strip", z.ZodTypeAny, {
1230
+ text?: string | undefined;
1231
+ key?: string | undefined;
1232
+ shape?: "cloud" | "ellipse" | "box" | "note" | "cylinder" | "text" | "pill" | "dot" | "sticker" | undefined;
1233
+ title?: string | undefined;
1234
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1235
+ owner?: string | undefined;
1236
+ due?: string | undefined;
1237
+ icon?: string | undefined;
1238
+ pen?: "blue" | "green" | "purple" | "red" | "orange" | "black" | undefined;
1239
+ dashed?: boolean | undefined;
1240
+ size?: "l" | "s" | "m" | "xl" | undefined;
1241
+ when?: string | undefined;
1242
+ }, {
1243
+ text?: string | undefined;
1244
+ key?: string | undefined;
1245
+ shape?: "cloud" | "ellipse" | "box" | "note" | "cylinder" | "text" | "pill" | "dot" | "sticker" | undefined;
1246
+ title?: string | undefined;
1247
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1248
+ owner?: string | undefined;
1249
+ due?: string | undefined;
1250
+ icon?: string | undefined;
1251
+ pen?: "blue" | "green" | "purple" | "red" | "orange" | "black" | undefined;
1252
+ dashed?: boolean | undefined;
1253
+ size?: "l" | "s" | "m" | "xl" | undefined;
1254
+ when?: string | undefined;
1255
+ }>, "many">;
1256
+ }, "strip", z.ZodTypeAny, {
1257
+ items: {
1258
+ text?: string | undefined;
1259
+ key?: string | undefined;
1260
+ shape?: "cloud" | "ellipse" | "box" | "note" | "cylinder" | "text" | "pill" | "dot" | "sticker" | undefined;
1261
+ title?: string | undefined;
1262
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1263
+ owner?: string | undefined;
1264
+ due?: string | undefined;
1265
+ icon?: string | undefined;
1266
+ pen?: "blue" | "green" | "purple" | "red" | "orange" | "black" | undefined;
1267
+ dashed?: boolean | undefined;
1268
+ size?: "l" | "s" | "m" | "xl" | undefined;
1269
+ when?: string | undefined;
1270
+ }[];
1271
+ road?: string | undefined;
1272
+ }, {
1273
+ items: {
1274
+ text?: string | undefined;
1275
+ key?: string | undefined;
1276
+ shape?: "cloud" | "ellipse" | "box" | "note" | "cylinder" | "text" | "pill" | "dot" | "sticker" | undefined;
1277
+ title?: string | undefined;
1278
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1279
+ owner?: string | undefined;
1280
+ due?: string | undefined;
1281
+ icon?: string | undefined;
1282
+ pen?: "blue" | "green" | "purple" | "red" | "orange" | "black" | undefined;
1283
+ dashed?: boolean | undefined;
1284
+ size?: "l" | "s" | "m" | "xl" | undefined;
1285
+ when?: string | undefined;
1286
+ }[];
1287
+ road?: string | undefined;
1288
+ }>>;
1289
+ why: z.ZodOptional<z.ZodString>;
1290
+ }, "strip", z.ZodTypeAny, {
1291
+ board: string;
1292
+ why?: string | undefined;
1293
+ add_sections?: {
1294
+ title: string;
1295
+ notes: {
1296
+ text: string;
1297
+ title?: string | undefined;
1298
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1299
+ owner?: string | undefined;
1300
+ due?: string | undefined;
1301
+ icon?: string | undefined;
1302
+ }[];
1303
+ subtitle?: string | undefined;
1304
+ }[] | undefined;
1305
+ add_notes?: {
1306
+ text: string;
1307
+ title?: string | undefined;
1308
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1309
+ owner?: string | undefined;
1310
+ due?: string | undefined;
1311
+ icon?: string | undefined;
1312
+ section?: string | undefined;
1313
+ }[] | undefined;
1314
+ move_notes?: {
1315
+ section: string;
1316
+ note_id: string;
1317
+ }[] | undefined;
1318
+ update_notes?: {
1319
+ note_id: string;
1320
+ text?: string | undefined;
1321
+ shape?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "box" | "note" | "cylinder" | "text" | "ink" | "track" | "pill" | "dot" | "cell" | "sticker" | undefined;
1322
+ title?: string | undefined;
1323
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1324
+ owner?: string | undefined;
1325
+ due?: string | undefined;
1326
+ icon?: string | undefined;
1327
+ size?: "l" | "s" | "m" | "xl" | undefined;
1328
+ }[] | undefined;
1329
+ update_links?: {
1330
+ link_id: string;
1331
+ route?: "straight" | "elbow" | "curve" | "auto" | undefined;
1332
+ dashed?: boolean | undefined;
1333
+ label?: string | undefined;
1334
+ arrow?: "end" | "both" | "none" | undefined;
1335
+ }[] | undefined;
1336
+ remove_notes?: string[] | undefined;
1337
+ rename_sections?: {
1338
+ title: string;
1339
+ section: string;
1340
+ }[] | undefined;
1341
+ remove_sections?: string[] | undefined;
1342
+ add_links?: {
1343
+ from: string;
1344
+ to: string;
1345
+ label?: string | undefined;
1346
+ }[] | undefined;
1347
+ remove_links?: string[] | undefined;
1348
+ extend_timeline?: {
1349
+ items: {
1350
+ text?: string | undefined;
1351
+ key?: string | undefined;
1352
+ shape?: "cloud" | "ellipse" | "box" | "note" | "cylinder" | "text" | "pill" | "dot" | "sticker" | undefined;
1353
+ title?: string | undefined;
1354
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1355
+ owner?: string | undefined;
1356
+ due?: string | undefined;
1357
+ icon?: string | undefined;
1358
+ pen?: "blue" | "green" | "purple" | "red" | "orange" | "black" | undefined;
1359
+ dashed?: boolean | undefined;
1360
+ size?: "l" | "s" | "m" | "xl" | undefined;
1361
+ when?: string | undefined;
1362
+ }[];
1363
+ road?: string | undefined;
1364
+ } | undefined;
1365
+ }, {
1366
+ board: string;
1367
+ why?: string | undefined;
1368
+ add_sections?: {
1369
+ title: string;
1370
+ subtitle?: string | undefined;
1371
+ notes?: {
1372
+ text: string;
1373
+ title?: string | undefined;
1374
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1375
+ owner?: string | undefined;
1376
+ due?: string | undefined;
1377
+ icon?: string | undefined;
1378
+ }[] | undefined;
1379
+ }[] | undefined;
1380
+ add_notes?: {
1381
+ text: string;
1382
+ title?: string | undefined;
1383
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1384
+ owner?: string | undefined;
1385
+ due?: string | undefined;
1386
+ icon?: string | undefined;
1387
+ section?: string | undefined;
1388
+ }[] | undefined;
1389
+ move_notes?: {
1390
+ section: string;
1391
+ note_id: string;
1392
+ }[] | undefined;
1393
+ update_notes?: {
1394
+ note_id: string;
1395
+ text?: string | undefined;
1396
+ shape?: "cloud" | "diamond" | "triangle" | "pentagon" | "hexagon" | "parallelogram" | "ellipse" | "box" | "note" | "cylinder" | "text" | "ink" | "track" | "pill" | "dot" | "cell" | "sticker" | undefined;
1397
+ title?: string | undefined;
1398
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1399
+ owner?: string | undefined;
1400
+ due?: string | undefined;
1401
+ icon?: string | undefined;
1402
+ size?: "l" | "s" | "m" | "xl" | undefined;
1403
+ }[] | undefined;
1404
+ update_links?: {
1405
+ link_id: string;
1406
+ route?: "straight" | "elbow" | "curve" | "auto" | undefined;
1407
+ dashed?: boolean | undefined;
1408
+ label?: string | undefined;
1409
+ arrow?: "end" | "both" | "none" | undefined;
1410
+ }[] | undefined;
1411
+ remove_notes?: string[] | undefined;
1412
+ rename_sections?: {
1413
+ title: string;
1414
+ section: string;
1415
+ }[] | undefined;
1416
+ remove_sections?: string[] | undefined;
1417
+ add_links?: {
1418
+ from: string;
1419
+ to: string;
1420
+ label?: string | undefined;
1421
+ }[] | undefined;
1422
+ remove_links?: string[] | undefined;
1423
+ extend_timeline?: {
1424
+ items: {
1425
+ text?: string | undefined;
1426
+ key?: string | undefined;
1427
+ shape?: "cloud" | "ellipse" | "box" | "note" | "cylinder" | "text" | "pill" | "dot" | "sticker" | undefined;
1428
+ title?: string | undefined;
1429
+ color?: "yellow" | "blue" | "green" | "pink" | "purple" | "gray" | "paper" | "ink" | "red" | "outline" | "new" | "orange" | "peach" | "sand" | undefined;
1430
+ owner?: string | undefined;
1431
+ due?: string | undefined;
1432
+ icon?: string | undefined;
1433
+ pen?: "blue" | "green" | "purple" | "red" | "orange" | "black" | undefined;
1434
+ dashed?: boolean | undefined;
1435
+ size?: "l" | "s" | "m" | "xl" | undefined;
1436
+ when?: string | undefined;
1437
+ }[];
1438
+ road?: string | undefined;
1439
+ } | undefined;
1440
+ }>;
1441
+ declare const ReadBoardInput: z.ZodObject<{
1442
+ board: z.ZodString;
1443
+ note_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1444
+ }, "strip", z.ZodTypeAny, {
1445
+ board: string;
1446
+ note_ids?: string[] | undefined;
1447
+ }, {
1448
+ board: string;
1449
+ note_ids?: string[] | undefined;
1450
+ }>;
1451
+ /** How the host names a tool and tells the agent to show a board; simpul's own words mention its present block. */
1452
+ type ToolNames = {
1453
+ create: string;
1454
+ draw: string;
1455
+ update: string;
1456
+ read: string;
1457
+ list: string;
1458
+ };
1459
+ declare const DEFAULT_NAMES: ToolNames;
1460
+ /**
1461
+ * The tools to give the agent: name, description and JSON schema of the arguments. `show` tells the agent how a
1462
+ * board appears in the host's answers ("Put the returned show text in your reply.").
1463
+ */
1464
+ declare function toolSpecs(show: string, names?: ToolNames): {
1465
+ name: string;
1466
+ description: string;
1467
+ parameters: zod_to_json_schema.JsonSchema7Type & {
1468
+ $schema?: string | undefined;
1469
+ definitions?: {
1470
+ [key: string]: zod_to_json_schema.JsonSchema7Type;
1471
+ } | undefined;
1472
+ };
1473
+ }[];
1474
+ /** A plan for one tool call: a board to make (or none), the steps to save in order, and anything left undone. */
1475
+ type Plan = {
1476
+ create?: CreateInput;
1477
+ steps: AgentStep[];
1478
+ problems: string[];
1479
+ skippedKeys?: string[];
1480
+ };
1481
+ /** create_whiteboard: sections laid out as columns, a timeline or a grid, built frame by frame. */
1482
+ declare function planCreate(raw: unknown, via?: Via, batch?: string): Plan;
1483
+ /** draw_whiteboard: the beats told one at a time, each item where the agent put it, clear of what is drawn already. */
1484
+ declare function planDraw(raw: unknown, target: Board | null, via?: Via, batch?: string): Plan;
1485
+ /**
1486
+ * update_whiteboard: every change of one call is one piece of agent work. Earlier stages (a timeline extended,
1487
+ * sections added) are applied to a working copy so the later ones (notes into those sections) can find them.
1488
+ */
1489
+ declare function planUpdate(raw: unknown, board: Board, via?: Via, batch?: string): Plan;
1490
+ /** read_board: the board as text the agent reads (sections, notes with ids, owners, due dates, who wrote them). */
1491
+ declare function readBoard(raw: unknown, board: Board): string;
1492
+ /** What the agent is told after a call: the board, what it holds now, and what was skipped and why. */
1493
+ declare function resultText(board: Board, plan: Pick<Plan, "problems" | "skippedKeys">, show: string): string;
1494
+
1495
+ export { type AgentStep, BOARD, BOARD_STEPS, Board, BoardActivity, BoardChat, BoardMode, BoardOp, type Box, type CreateInput, CreateWhiteboardInput, DEFAULT_NAMES, DrawWhiteboardInput, type EditMore, FORMS, type Form, type FreeBeat, type FreeItem, type FreeLink, type FreeStory, type Item, LABEL_CHAR, LEN, OpSchema, type Owner, POLYGONS, PatchInput, PendingBatch, type Plan, PlannedItem, type Polygon, ReadBoardInput, type Routed, Shape, TONES, TextSize, type ToldStep, type Tone, type ToolNames, UpdateWhiteboardInput, type Via, WIRE, WbLink, WbNote, type Wire, applyStep, autoWires, blockHeight, buildSteps, createBoard, editBoard, freeSpot, isPolygon, keepBatch, labelSize, labelSpot, layFree, liveActivity, newBatch, newRef, noteHeight, obstacles, overlaps, planActivity, planCreate, planDraw, planUpdate, polygonPad, polygonPoints, publicBoard, readBoard, restoreBoard, resultText, routeWires, setActivity, snapshot, toldSteps, toolSpecs, undoBatch, wireBoxes, wireLabel, withChat, wrapLines };