@lensmcp/protocol-types 1.26.21 → 1.26.22
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/index.d.ts +2 -0
- package/index.js +1 -1
- package/lib/ai-cache-facts.js +1 -1
- package/lib/ai-cache-verdict.js +1 -1
- package/lib/ai-cache.js +3 -3
- package/lib/ai-call-groups.js +2 -2
- package/lib/ai-call-row.js +3 -3
- package/lib/ai-call.js +11 -11
- package/lib/ai-compare.js +3 -3
- package/lib/ai-context.js +6 -6
- package/lib/ai-origins.js +8 -8
- package/lib/ai-together.js +5 -5
- package/lib/bounded-clone.js +1 -1
- package/lib/bounded-map.js +1 -1
- package/lib/bounded-writer.js +1 -1
- package/lib/canvas-catalog.d.ts +63 -0
- package/lib/canvas-catalog.js +12 -0
- package/lib/canvas.d.ts +858 -0
- package/lib/canvas.js +1 -0
- package/lib/capture-demand.js +1 -1
- package/lib/dashboard-path.js +1 -1
- package/lib/docker-errors.js +1 -1
- package/lib/docker-jobs.js +1 -1
- package/lib/docker-report.js +2 -2
- package/lib/docker-runs.js +3 -3
- package/lib/error-cause.js +6 -6
- package/lib/error-dismissal.js +1 -1
- package/lib/error-verdict.js +3 -3
- package/lib/event-loop.js +1 -1
- package/lib/expected-failure.js +2 -2
- package/lib/finding-proof.js +1 -1
- package/lib/flood-guard.js +1 -1
- package/lib/goal-design.js +1 -1
- package/lib/host-agents.js +1 -1
- package/lib/lint-coverage.js +1 -1
- package/lib/lint-ignores.js +2 -2
- package/lib/log-query.js +1 -1
- package/lib/metrics-reset.js +1 -1
- package/lib/overseer-findings.js +1 -1
- package/lib/peers.js +1 -1
- package/lib/perf-rules.js +1 -1
- package/lib/pod-memory.js +1 -1
- package/lib/producer-health.js +1 -1
- package/lib/remote-instances.js +1 -1
- package/lib/sources.js +1 -1
- package/lib/static-checks.js +1 -1
- package/lib/system-report.js +1 -1
- package/lib/team.js +1 -1
- package/package.json +1 -1
package/lib/canvas.d.ts
ADDED
|
@@ -0,0 +1,858 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Canvases (planning/canvas/00-plan.md): what any agent — Claude Code, Codex, a team agent — shows the person, and what
|
|
4
|
+
* the person answers, kept by LensMCP rather than by one client's artifacts.
|
|
5
|
+
*
|
|
6
|
+
* A canvas is MDX with predefined components plus its DATA as a sidecar, drawn together. Every VERSION keeps its MDX,
|
|
7
|
+
* the contract of what it asks, the SHAPE its data must have and a copy of the data at that moment (D10, D11). The
|
|
8
|
+
* person answers inside the document with the dashboard's own session (D8); the answers, every data patch and every
|
|
9
|
+
* version are rows of one append-only LEDGER per canvas (§3.4).
|
|
10
|
+
*
|
|
11
|
+
* The line (§2): MDX is never evaluated in Node or in the dashboard's own page. The MCP server PARSES and CHECKS; the
|
|
12
|
+
* dashboard COMPILES; only an opaque-origin inner frame RUNS it, and talks to the dashboard — the broker — over one
|
|
13
|
+
* MessagePort, with the methods below and nothing else (§2.3).
|
|
14
|
+
*
|
|
15
|
+
* This file is the wire contract every part builds against: the store (`@lensmcp/canvas-engine`), the MCP tools
|
|
16
|
+
* (`@lensmcp/canvas`), the dashboard's `/api/canvases*` routes and screens, and the frame runtime
|
|
17
|
+
* (`@lensmcp/canvas-frame`).
|
|
18
|
+
*/
|
|
19
|
+
/** The stored format of a version. A dashboard that meets a newer one shows the safe view, «written by a newer LensMCP». */
|
|
20
|
+
export declare const CANVAS_FORMAT = 1;
|
|
21
|
+
/** The broker protocol's version, carried by `ui/initialize`. */
|
|
22
|
+
export declare const CANVAS_FRAME_PROTOCOL = 1;
|
|
23
|
+
/** The frame runtime a render's health is tied to (§4.1): a live view and a headless render report it alike. */
|
|
24
|
+
export declare const CANVAS_FRAME_RUNTIME = "frame-v1";
|
|
25
|
+
/** The frame host's path prefix: `/v1/host.html`, `/v1/runtime.js` … A breaking runtime change moves it. */
|
|
26
|
+
export declare const CANVAS_FRAME_PATH = "/v1";
|
|
27
|
+
/** The frame host's name (D7): a site of its own, `canvas.localhost`, reserved whole (D9). */
|
|
28
|
+
export declare const CANVAS_FRAME_HOST = "lensmcp.canvas.localhost";
|
|
29
|
+
/** `cv-` and 16 hex: checked against this before any path is built from it (§3.1). */
|
|
30
|
+
export declare const CANVAS_ID_PATTERN: RegExp;
|
|
31
|
+
/** A canvas project: `pr-` and 16 hex, stable across a moved repo (adoption) and the same on every Mac that shares it. */
|
|
32
|
+
export declare const CANVAS_PROJECT_ID_PATTERN: RegExp;
|
|
33
|
+
/** A question id, option id or checklist item id: what the person's answers are keyed by. */
|
|
34
|
+
export declare const CANVAS_QID_PATTERN: RegExp;
|
|
35
|
+
export declare const isCanvasId: (id: unknown) => id is string;
|
|
36
|
+
/** Each cap is refused with its reason, never cut silently (§3.6). */
|
|
37
|
+
export declare const CANVAS_LIMITS: {
|
|
38
|
+
/** MDX of one version. */
|
|
39
|
+
readonly mdxBytes: number;
|
|
40
|
+
/** What `canvas_get` hands back whole (`TOOL_WHOLE`); past it, a mirror path. */
|
|
41
|
+
readonly mdxWholeBytes: number;
|
|
42
|
+
/** The working data, and each version's copy of it. */
|
|
43
|
+
readonly dataBytes: number;
|
|
44
|
+
/** One answer's value and note. */
|
|
45
|
+
readonly answerBytes: number;
|
|
46
|
+
readonly questions: 500;
|
|
47
|
+
readonly assets: 50;
|
|
48
|
+
readonly assetBytes: number;
|
|
49
|
+
readonly assetFileBytes: number;
|
|
50
|
+
/** Versions × their data, per canvas. */
|
|
51
|
+
readonly canvasBytes: number;
|
|
52
|
+
/** Every canvas a project homes. */
|
|
53
|
+
readonly projectBytes: number;
|
|
54
|
+
readonly titleChars: 200;
|
|
55
|
+
readonly noteChars: 2000;
|
|
56
|
+
readonly commentChars: 8000;
|
|
57
|
+
/** A frame → parent message (zod-checked, rate-limited). */
|
|
58
|
+
readonly frameMessageBytes: number;
|
|
59
|
+
/** JSON nesting the parse and the data accept. */
|
|
60
|
+
readonly depth: 64;
|
|
61
|
+
/** Ops in one data patch or migration. */
|
|
62
|
+
readonly ops: 1000;
|
|
63
|
+
/** A data patch writes a checkpoint every this many patches (§3.6). */
|
|
64
|
+
readonly checkpointEvery: 50;
|
|
65
|
+
/** Checkpoints of the current version kept for its own data-revision history. */
|
|
66
|
+
readonly checkpointsKept: 20;
|
|
67
|
+
/** `canvas_wait`: default and most. */
|
|
68
|
+
readonly waitDefaultMs: 45000;
|
|
69
|
+
readonly waitMaxMs: 900000;
|
|
70
|
+
};
|
|
71
|
+
export declare const CANVAS_KINDS: readonly ["doc", "decision", "plan", "review", "report", "dashboard", "qa", "template"];
|
|
72
|
+
export type CanvasKind = (typeof CANVAS_KINDS)[number];
|
|
73
|
+
/** The templates LensMCP ships (§10): `canvas_write { from: "<name>" }`. */
|
|
74
|
+
export declare const CANVAS_TEMPLATE_NAMES: readonly ["decision-record", "plan-review", "weekly-report", "goal-dashboard", "qa-report"];
|
|
75
|
+
export type CanvasTemplateName = (typeof CANVAS_TEMPLATE_NAMES)[number];
|
|
76
|
+
/**
|
|
77
|
+
* Who wrote a version, patched data or answered (§3.4 `by`). Derived on the server — the MCP session, `clientInfo`, a
|
|
78
|
+
* hook-bound session, the dashboard's sign-in — never taken from input (§8).
|
|
79
|
+
*/
|
|
80
|
+
export interface CanvasActor {
|
|
81
|
+
kind: 'agent' | 'person' | 'system';
|
|
82
|
+
/** `claude`, `codex`, `mcp`, `dashboard`, `cli`, `host:<name>`. */
|
|
83
|
+
client?: string;
|
|
84
|
+
/** The MCP session, the coordination session, or the dashboard's per-sign-in session id. */
|
|
85
|
+
session?: string;
|
|
86
|
+
/** A team agent's role or name, as the person reads it. */
|
|
87
|
+
name?: string;
|
|
88
|
+
/** An `ac-…` account. */
|
|
89
|
+
account?: string;
|
|
90
|
+
/** A person's identity on a hub (§6 teammates). */
|
|
91
|
+
person?: string;
|
|
92
|
+
/** The machine it happened on — required (§3.4). */
|
|
93
|
+
machine: string;
|
|
94
|
+
}
|
|
95
|
+
export declare const CANVAS_QUESTION_KINDS: readonly ["choice", "multi", "text", "number", "confirm", "approve"];
|
|
96
|
+
export type CanvasQuestionKind = (typeof CANVAS_QUESTION_KINDS)[number];
|
|
97
|
+
export declare const CANVAS_FIELD_KINDS: readonly ["text", "number", "date", "file", "image"];
|
|
98
|
+
export type CanvasFieldKind = (typeof CANVAS_FIELD_KINDS)[number];
|
|
99
|
+
/** The interactive components: literal props only, checked at write time; they ARE the record of what was asked. */
|
|
100
|
+
export declare const CANVAS_INTERACTIVE: readonly ["Question", "Checklist", "Field", "Options"];
|
|
101
|
+
export type CanvasInteractive = (typeof CANVAS_INTERACTIVE)[number];
|
|
102
|
+
export interface CanvasOption {
|
|
103
|
+
id: string;
|
|
104
|
+
label: string;
|
|
105
|
+
detail?: string;
|
|
106
|
+
}
|
|
107
|
+
/** A follow-up's condition: the enclosing `<When qid is>` blocks, decided by the parent (§2.4). */
|
|
108
|
+
export interface CanvasCondition {
|
|
109
|
+
qid: string;
|
|
110
|
+
/** One option id, or any of several. `true`/`false` for a confirm. */
|
|
111
|
+
is: string | string[] | boolean;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One thing a version asks. Keys of answers: `qid` — or `qid/itemId` for each checklist item and each `multi`
|
|
115
|
+
* option, so two of them never conflict (§3.5).
|
|
116
|
+
*/
|
|
117
|
+
export interface CanvasAsk {
|
|
118
|
+
qid: string;
|
|
119
|
+
component: CanvasInteractive;
|
|
120
|
+
/** A question's kind; `checklist` for a Checklist; a Field's kind for a Field; `choice` for Options. */
|
|
121
|
+
kind: CanvasQuestionKind | 'checklist' | CanvasFieldKind;
|
|
122
|
+
/** The question text or the field's label: what the dashboard-drawn control shows, whatever the frame draws. */
|
|
123
|
+
title: string;
|
|
124
|
+
detail?: string;
|
|
125
|
+
options?: CanvasOption[];
|
|
126
|
+
/** Checklist items. */
|
|
127
|
+
items?: CanvasOption[];
|
|
128
|
+
/** An option id. */
|
|
129
|
+
recommended?: string;
|
|
130
|
+
/** Sets the linked task's `waitingOn`; lands in the Inbox (§7). */
|
|
131
|
+
blocking?: boolean;
|
|
132
|
+
/** Lands in Team › Inbox (§7). */
|
|
133
|
+
inbox?: boolean;
|
|
134
|
+
required?: boolean;
|
|
135
|
+
min?: number;
|
|
136
|
+
max?: number;
|
|
137
|
+
placeholder?: string;
|
|
138
|
+
when?: CanvasCondition[];
|
|
139
|
+
/** Hash of the entry's meaning (kind, title, detail, options, items, min, max) — an answer carries it; a change
|
|
140
|
+
* marks earlier answers stale (§2.4, §3.2). */
|
|
141
|
+
hash: string;
|
|
142
|
+
/** Where it is in the MDX (1-based). */
|
|
143
|
+
line: number;
|
|
144
|
+
}
|
|
145
|
+
export interface CanvasContract {
|
|
146
|
+
asks: CanvasAsk[];
|
|
147
|
+
}
|
|
148
|
+
/** The answer keys a contract has: `qid`, or `qid/itemId` for a checklist item or a `multi` option. */
|
|
149
|
+
export declare function canvasAnswerKeys(ask: CanvasAsk): string[];
|
|
150
|
+
/** `qid` of an answer key (`db`, `steps/lint` → `steps`). */
|
|
151
|
+
export declare const canvasQidOf: (key: string) => string;
|
|
152
|
+
/**
|
|
153
|
+
* The shape a version's data must have: a JSON Schema subset agents know (§3.3). `derived` marks a shape LensMCP
|
|
154
|
+
* worked out from the bindings and the data given, returned so the agent can declare its own.
|
|
155
|
+
*/
|
|
156
|
+
export interface CanvasShape {
|
|
157
|
+
type?: CanvasShapeType | CanvasShapeType[];
|
|
158
|
+
properties?: Record<string, CanvasShape>;
|
|
159
|
+
required?: string[];
|
|
160
|
+
items?: CanvasShape;
|
|
161
|
+
enum?: Array<string | number | boolean | null>;
|
|
162
|
+
minimum?: number;
|
|
163
|
+
maximum?: number;
|
|
164
|
+
minItems?: number;
|
|
165
|
+
maxItems?: number;
|
|
166
|
+
format?: 'date' | 'date-time';
|
|
167
|
+
additionalProperties?: boolean | CanvasShape;
|
|
168
|
+
description?: string;
|
|
169
|
+
derived?: boolean;
|
|
170
|
+
}
|
|
171
|
+
export type CanvasShapeType = 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
172
|
+
/** Keys of a shape LensMCP accepts — anything else is refused, naming it. */
|
|
173
|
+
export declare const CANVAS_SHAPE_KEYS: readonly ["type", "properties", "required", "items", "enum", "minimum", "maximum", "minItems", "maxItems", "format", "additionalProperties", "description", "derived", "$schema", "title"];
|
|
174
|
+
/** Where a display component reads from. `source="/costs/monthly"` is a JSON Pointer into the data. */
|
|
175
|
+
export type CanvasSourceKind = 'data' | 'lens' | 'canvas' | 'https';
|
|
176
|
+
export interface CanvasBinding {
|
|
177
|
+
component: string;
|
|
178
|
+
/** As written: `/costs/monthly`, `lens:goal/g-42/done`, `canvas:cv-…/costs`, `https://…`. */
|
|
179
|
+
source: string;
|
|
180
|
+
kind: CanvasSourceKind;
|
|
181
|
+
/** The JSON Pointer, for `data`. */
|
|
182
|
+
path?: string;
|
|
183
|
+
/** What the component needs there, as a shape (a Chart with x="month" y={["cost"]}: an array of objects with a
|
|
184
|
+
* `month` and a numeric `cost`). Checked against the version's shape. */
|
|
185
|
+
needs: CanvasShape;
|
|
186
|
+
line: number;
|
|
187
|
+
}
|
|
188
|
+
/** A get a version declares (frontmatter `gets:`, or a non-data `source=`): resolved by the dashboard, never the frame. */
|
|
189
|
+
export interface CanvasGetDecl {
|
|
190
|
+
uri: string;
|
|
191
|
+
kind: Exclude<CanvasSourceKind, 'data'>;
|
|
192
|
+
shape?: CanvasShape;
|
|
193
|
+
/** An `https:` result kept as a snapshot in the canvas's own `got` part (§2.5). */
|
|
194
|
+
keep?: boolean;
|
|
195
|
+
}
|
|
196
|
+
/** A data patch op: JSON Pointer paths (RFC 6901). `append` adds to an array's end (`path` names the array). */
|
|
197
|
+
export type CanvasDataOp = {
|
|
198
|
+
op: 'set';
|
|
199
|
+
path: string;
|
|
200
|
+
value: unknown;
|
|
201
|
+
} | {
|
|
202
|
+
op: 'remove';
|
|
203
|
+
path: string;
|
|
204
|
+
} | {
|
|
205
|
+
op: 'move';
|
|
206
|
+
from: string;
|
|
207
|
+
path: string;
|
|
208
|
+
} | {
|
|
209
|
+
op: 'copy';
|
|
210
|
+
from: string;
|
|
211
|
+
path: string;
|
|
212
|
+
} | {
|
|
213
|
+
op: 'append';
|
|
214
|
+
path: string;
|
|
215
|
+
value: unknown;
|
|
216
|
+
};
|
|
217
|
+
export declare const CANVAS_DATA_OPS: readonly ["set", "remove", "move", "copy", "append"];
|
|
218
|
+
/** One path that does not fit: «`/costs` is an object; this version expects an array of `{month, cost}`». */
|
|
219
|
+
export interface CanvasShapeError {
|
|
220
|
+
path: string;
|
|
221
|
+
expected: string;
|
|
222
|
+
got: string;
|
|
223
|
+
message: string;
|
|
224
|
+
}
|
|
225
|
+
/** Per bound path, whether the data there fits — what a component reads before it draws (§4.2). */
|
|
226
|
+
export type CanvasDataMarks = Record<string, {
|
|
227
|
+
ok: true;
|
|
228
|
+
} | {
|
|
229
|
+
ok: false;
|
|
230
|
+
message: string;
|
|
231
|
+
}>;
|
|
232
|
+
export interface CanvasProblem {
|
|
233
|
+
/** A stable code: `parse`, `import`, `duplicate-qid`, `literal-props`, `unknown-component`, `binding`, `shape`,
|
|
234
|
+
* `data`, `mermaid`, `cap`, `render`, … */
|
|
235
|
+
code: string;
|
|
236
|
+
severity: 'error' | 'warning';
|
|
237
|
+
message: string;
|
|
238
|
+
/** How to fix it — every MDX error carries one (§2.1 MDX friction). */
|
|
239
|
+
hint?: string;
|
|
240
|
+
line?: number;
|
|
241
|
+
column?: number;
|
|
242
|
+
path?: string;
|
|
243
|
+
component?: string;
|
|
244
|
+
/** The failing component's props schema, quoted (§5). */
|
|
245
|
+
schema?: string;
|
|
246
|
+
}
|
|
247
|
+
/** A render's error, from the frame (`canvas/problem`) or a headless check: its block, line, and the versions. */
|
|
248
|
+
export interface CanvasRenderError {
|
|
249
|
+
message: string;
|
|
250
|
+
block?: string;
|
|
251
|
+
line?: number;
|
|
252
|
+
column?: number;
|
|
253
|
+
component?: string;
|
|
254
|
+
runtime?: string;
|
|
255
|
+
compiler?: string;
|
|
256
|
+
}
|
|
257
|
+
export declare const CANVAS_HEALTH_STATES: readonly ["checked", "good", "broken", "unverified"];
|
|
258
|
+
export type CanvasHealthState = (typeof CANVAS_HEALTH_STATES)[number];
|
|
259
|
+
export interface CanvasHealth {
|
|
260
|
+
state: CanvasHealthState;
|
|
261
|
+
at: number;
|
|
262
|
+
/** The runtime and compiler that decided it: an upgrade re-decides (§4.1). */
|
|
263
|
+
runtime?: string;
|
|
264
|
+
compiler?: string;
|
|
265
|
+
/** `live` (a person's view), `headless` (a render check). */
|
|
266
|
+
by?: 'live' | 'headless' | 'write';
|
|
267
|
+
/** The LensMCP that decided it (none: a development build): another LensMCP re-decides (§4.1). */
|
|
268
|
+
lensmcp?: string;
|
|
269
|
+
/**
|
|
270
|
+
* The version rendered `good` under an earlier LensMCP (or runtime, or compiler) and `broken` under this one: the
|
|
271
|
+
* LensMCP it broke after — "broke after LensMCP x.y.z" (§4.1).
|
|
272
|
+
*/
|
|
273
|
+
brokeAfter?: string;
|
|
274
|
+
errors?: CanvasRenderError[];
|
|
275
|
+
}
|
|
276
|
+
export interface CanvasLink {
|
|
277
|
+
kind: 'task' | 'goal';
|
|
278
|
+
id: string;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Who else sees and edits a canvas (§6). Narrowing is any author's; widening needs the person's act. `write` covers
|
|
282
|
+
* versions and data, never answers. A canvas with any `write` project gets no gets at all (§2.5).
|
|
283
|
+
*/
|
|
284
|
+
export interface CanvasShare {
|
|
285
|
+
/** `project`: its home only; `projects`: these too; `machine`: every project on this machine. */
|
|
286
|
+
read: 'project' | 'projects' | 'machine';
|
|
287
|
+
projects?: string[];
|
|
288
|
+
write?: string[];
|
|
289
|
+
}
|
|
290
|
+
export interface CanvasProjectRef {
|
|
291
|
+
id: string;
|
|
292
|
+
name: string;
|
|
293
|
+
/** The checkout it was seen at last. */
|
|
294
|
+
root?: string;
|
|
295
|
+
remote?: string;
|
|
296
|
+
}
|
|
297
|
+
export interface CanvasRecord {
|
|
298
|
+
id: string;
|
|
299
|
+
/** The home project (`pr-…`): the one writer (§6). */
|
|
300
|
+
project: string;
|
|
301
|
+
title: string;
|
|
302
|
+
kind: CanvasKind;
|
|
303
|
+
links: CanvasLink[];
|
|
304
|
+
author: CanvasActor;
|
|
305
|
+
share: CanvasShare;
|
|
306
|
+
archived: boolean;
|
|
307
|
+
/** A delete leaves a tombstone. */
|
|
308
|
+
deleted?: {
|
|
309
|
+
at: number;
|
|
310
|
+
by: CanvasActor;
|
|
311
|
+
};
|
|
312
|
+
/** The version shown. */
|
|
313
|
+
current: number;
|
|
314
|
+
/** The newest version that rendered `good`. */
|
|
315
|
+
lastGood?: number;
|
|
316
|
+
/** The newest version written: past `current` while a candidate is broken or waits for its check. */
|
|
317
|
+
latest: number;
|
|
318
|
+
/** The working data's revision, within the current version. */
|
|
319
|
+
dataRev: number;
|
|
320
|
+
/** The ledger's head. */
|
|
321
|
+
seq: number;
|
|
322
|
+
openQuestions: number;
|
|
323
|
+
createdAt: number;
|
|
324
|
+
updatedAt: number;
|
|
325
|
+
}
|
|
326
|
+
/** A version: a complete snapshot — MDX, contract, shape and a copy of the data at that moment (§3.2). */
|
|
327
|
+
export interface CanvasVersion {
|
|
328
|
+
canvas: string;
|
|
329
|
+
n: number;
|
|
330
|
+
parent?: number;
|
|
331
|
+
restoredFrom?: number;
|
|
332
|
+
source: string;
|
|
333
|
+
contract: CanvasContract;
|
|
334
|
+
bindings: CanvasBinding[];
|
|
335
|
+
gets: CanvasGetDecl[];
|
|
336
|
+
shape: CanvasShape;
|
|
337
|
+
/** The data when the version was made. */
|
|
338
|
+
data: unknown;
|
|
339
|
+
/** The working data's revision the snapshot is. */
|
|
340
|
+
dataRev: number;
|
|
341
|
+
format: number;
|
|
342
|
+
/** The checker's and compiler's versions that passed it. */
|
|
343
|
+
checker: string;
|
|
344
|
+
author: CanvasActor;
|
|
345
|
+
/** Why — required for an agent's write. */
|
|
346
|
+
note: string;
|
|
347
|
+
health: CanvasHealth;
|
|
348
|
+
requestId?: string;
|
|
349
|
+
at: number;
|
|
350
|
+
bytes: number;
|
|
351
|
+
}
|
|
352
|
+
/** A version as listed: no source, no data. */
|
|
353
|
+
export type CanvasVersionRow = Omit<CanvasVersion, 'source' | 'data' | 'contract' | 'bindings' | 'gets' | 'shape'> & {
|
|
354
|
+
questions: number;
|
|
355
|
+
};
|
|
356
|
+
export declare const CANVAS_ANSWER_VIAS: readonly ["document", "rail", "inbox", "cli", "api", "host"];
|
|
357
|
+
export type CanvasAnswerVia = (typeof CANVAS_ANSWER_VIAS)[number];
|
|
358
|
+
/**
|
|
359
|
+
* An answer, per key. CONFIRMED: a browser request with the dashboard's session and `Sec-Fetch-Site: same-origin`, or
|
|
360
|
+
* an Inbox answer by the question's routed manager or delegate. REPORTED: anything else — a Bearer or script
|
|
361
|
+
* request, the CLI under an agent, an MCP Apps host. Agents, task logs and the Inbox act on confirmed answers only.
|
|
362
|
+
*/
|
|
363
|
+
export interface CanvasAnswer {
|
|
364
|
+
key: string;
|
|
365
|
+
qid: string;
|
|
366
|
+
value: unknown;
|
|
367
|
+
note?: string;
|
|
368
|
+
by: CanvasActor;
|
|
369
|
+
as: 'person' | 'manager' | 'delegate' | 'agent' | 'host';
|
|
370
|
+
via: CanvasAnswerVia | `host:${string}`;
|
|
371
|
+
confirmed: boolean;
|
|
372
|
+
/** The version and question hash it answered. */
|
|
373
|
+
version: number;
|
|
374
|
+
qHash: string;
|
|
375
|
+
/** The ledger row, and this key's own sequence (per-question CAS, §3.5). */
|
|
376
|
+
seq: number;
|
|
377
|
+
qSeq: number;
|
|
378
|
+
at: number;
|
|
379
|
+
/** `stale`: the question changed since (answered for v5 — changed in v7); `orphaned`: it is gone; `cleared`. */
|
|
380
|
+
state: 'current' | 'stale' | 'orphaned' | 'cleared';
|
|
381
|
+
/** For stale: the version that changed the question. */
|
|
382
|
+
changedIn?: number;
|
|
383
|
+
}
|
|
384
|
+
export declare const CANVAS_LEDGER_PARTS: readonly ["version", "data", "answer", "got", "grant", "share", "archive", "delete", "comment", "health", "meta"];
|
|
385
|
+
export type CanvasLedgerPart = (typeof CANVAS_LEDGER_PARTS)[number];
|
|
386
|
+
/** One row per change (§3.4). `seq` is assigned by the home store only. */
|
|
387
|
+
export interface CanvasLedgerRow {
|
|
388
|
+
canvas: string;
|
|
389
|
+
seq: number;
|
|
390
|
+
part: CanvasLedgerPart;
|
|
391
|
+
/** A qid/answer key, a data path, an origin, a comment id. */
|
|
392
|
+
key?: string;
|
|
393
|
+
value?: unknown;
|
|
394
|
+
ref?: string;
|
|
395
|
+
by: CanvasActor;
|
|
396
|
+
as?: string;
|
|
397
|
+
via?: string;
|
|
398
|
+
confirmed?: boolean;
|
|
399
|
+
version: number;
|
|
400
|
+
qHash?: string;
|
|
401
|
+
dataRev: number;
|
|
402
|
+
requestId?: string;
|
|
403
|
+
at: number;
|
|
404
|
+
note?: string;
|
|
405
|
+
}
|
|
406
|
+
/** A data revision of the working data, within a version. */
|
|
407
|
+
export interface CanvasDataRevision {
|
|
408
|
+
rev: number;
|
|
409
|
+
version: number;
|
|
410
|
+
ops?: CanvasDataOp[];
|
|
411
|
+
merge?: unknown;
|
|
412
|
+
by: CanvasActor;
|
|
413
|
+
note?: string;
|
|
414
|
+
at: number;
|
|
415
|
+
/** Folded into a checkpoint (§3.6): the ops are gone, the data at it is kept. */
|
|
416
|
+
compacted?: boolean;
|
|
417
|
+
}
|
|
418
|
+
export interface CanvasComment {
|
|
419
|
+
id: string;
|
|
420
|
+
canvas: string;
|
|
421
|
+
version: number;
|
|
422
|
+
/** Anchored by block and MDX line range; the quote is taken from the SOURCE, never the frame. */
|
|
423
|
+
anchor: {
|
|
424
|
+
block?: string;
|
|
425
|
+
lines: [number, number];
|
|
426
|
+
quote: string;
|
|
427
|
+
};
|
|
428
|
+
text: string;
|
|
429
|
+
by: CanvasActor;
|
|
430
|
+
at: number;
|
|
431
|
+
replies: Array<{
|
|
432
|
+
id: string;
|
|
433
|
+
text: string;
|
|
434
|
+
by: CanvasActor;
|
|
435
|
+
at: number;
|
|
436
|
+
}>;
|
|
437
|
+
resolved?: {
|
|
438
|
+
at: number;
|
|
439
|
+
by: CanvasActor;
|
|
440
|
+
note?: string;
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
export interface CanvasGrant {
|
|
444
|
+
canvas: string;
|
|
445
|
+
origin: string;
|
|
446
|
+
by: CanvasActor;
|
|
447
|
+
at: number;
|
|
448
|
+
revoked?: {
|
|
449
|
+
at: number;
|
|
450
|
+
by: CanvasActor;
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
export interface CanvasDataChange {
|
|
454
|
+
path: string;
|
|
455
|
+
change: 'added' | 'removed' | 'changed';
|
|
456
|
+
from?: unknown;
|
|
457
|
+
to?: unknown;
|
|
458
|
+
}
|
|
459
|
+
export interface CanvasShapeChange {
|
|
460
|
+
path: string;
|
|
461
|
+
change: 'added' | 'removed' | 'retyped' | 'required' | 'optional' | 'enum' | 'range' | 'format';
|
|
462
|
+
from?: unknown;
|
|
463
|
+
to?: unknown;
|
|
464
|
+
}
|
|
465
|
+
export interface CanvasQuestionChange {
|
|
466
|
+
qid: string;
|
|
467
|
+
change: 'added' | 'removed' | 'reworded' | 'options' | 'kind' | 'moved';
|
|
468
|
+
from?: Partial<CanvasAsk>;
|
|
469
|
+
to?: Partial<CanvasAsk>;
|
|
470
|
+
/** Answer keys this change made stale (or orphaned, for `removed`). */
|
|
471
|
+
stale: string[];
|
|
472
|
+
}
|
|
473
|
+
export interface CanvasDiff {
|
|
474
|
+
canvas: string;
|
|
475
|
+
from: number;
|
|
476
|
+
to: number;
|
|
477
|
+
mdx: {
|
|
478
|
+
unified: string;
|
|
479
|
+
added: number;
|
|
480
|
+
removed: number;
|
|
481
|
+
};
|
|
482
|
+
data: CanvasDataChange[];
|
|
483
|
+
shape: CanvasShapeChange[];
|
|
484
|
+
questions: CanvasQuestionChange[];
|
|
485
|
+
health: {
|
|
486
|
+
new: CanvasRenderError[];
|
|
487
|
+
fixed: CanvasRenderError[];
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
/** Two versions as pictures (§3.2 "Picture"), as the dashboard's Compare shows them: both rendered headless. */
|
|
491
|
+
export interface DashCanvasPictureDiff {
|
|
492
|
+
from: number;
|
|
493
|
+
to: number;
|
|
494
|
+
/** Where the pages differ, in CSS px of the page (both pages share the width). */
|
|
495
|
+
regions: Array<{
|
|
496
|
+
x: number;
|
|
497
|
+
y: number;
|
|
498
|
+
width: number;
|
|
499
|
+
height: number;
|
|
500
|
+
}>;
|
|
501
|
+
/** Changed cells of all (0…1). */
|
|
502
|
+
changed: number;
|
|
503
|
+
width: number;
|
|
504
|
+
heights: {
|
|
505
|
+
from: number;
|
|
506
|
+
to: number;
|
|
507
|
+
};
|
|
508
|
+
health: {
|
|
509
|
+
from: 'good' | 'broken';
|
|
510
|
+
to: 'good' | 'broken';
|
|
511
|
+
};
|
|
512
|
+
/** `render-file?name=` names: the band around the first change (halved), and both whole pages side by side. */
|
|
513
|
+
band: string;
|
|
514
|
+
full: string;
|
|
515
|
+
theme: 'light' | 'dark';
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* What the dashboard draws itself when nothing renders: no frame, no code. The MDX prose through the existing
|
|
519
|
+
* Markdown renderer; components as labelled cards (charts as tables of their data); expressions as their source.
|
|
520
|
+
*/
|
|
521
|
+
export type CanvasSafeBlock = {
|
|
522
|
+
kind: 'markdown';
|
|
523
|
+
text: string;
|
|
524
|
+
line: number;
|
|
525
|
+
} | {
|
|
526
|
+
kind: 'code';
|
|
527
|
+
lang?: string;
|
|
528
|
+
text: string;
|
|
529
|
+
line: number;
|
|
530
|
+
} | {
|
|
531
|
+
kind: 'component';
|
|
532
|
+
name: string;
|
|
533
|
+
props: Record<string, unknown>;
|
|
534
|
+
line: number;
|
|
535
|
+
children: CanvasSafeBlock[];
|
|
536
|
+
source?: string;
|
|
537
|
+
} | {
|
|
538
|
+
kind: 'expression';
|
|
539
|
+
text: string;
|
|
540
|
+
line: number;
|
|
541
|
+
};
|
|
542
|
+
/** Which tier the person sees (§4.3). */
|
|
543
|
+
export type CanvasTier = 1 | 2 | 3;
|
|
544
|
+
/** Every method the port carries; anything else is method-not-found. Names follow MCP Apps (SEP-1865). */
|
|
545
|
+
export declare const CANVAS_BROKER_METHODS: readonly ["ui/initialize", "ui/notifications/size-changed", "ui/open-link", "canvas/heartbeat", "canvas/slots", "canvas/focus", "canvas/get", "canvas/rendered", "canvas/problem", "canvas/health", "canvas/data-changed", "canvas/answers-changed", "canvas/selection", "canvas/copy", "canvas/download", "canvas/open-ref", "canvas/slot-sizes", "canvas/theme"];
|
|
546
|
+
export type CanvasBrokerMethod = (typeof CANVAS_BROKER_METHODS)[number];
|
|
547
|
+
/** A JSON-RPC 2.0 message on the port: a request has an `id`, a notification none. */
|
|
548
|
+
export interface CanvasRpc<P = unknown> {
|
|
549
|
+
jsonrpc: '2.0';
|
|
550
|
+
id?: number;
|
|
551
|
+
method: CanvasBrokerMethod;
|
|
552
|
+
params?: P;
|
|
553
|
+
}
|
|
554
|
+
export interface CanvasRpcResult<R = unknown> {
|
|
555
|
+
jsonrpc: '2.0';
|
|
556
|
+
id: number;
|
|
557
|
+
result?: R;
|
|
558
|
+
error?: {
|
|
559
|
+
code: number;
|
|
560
|
+
message: string;
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
/** What `ui/initialize` answers the frame with: everything it may read, and nothing it may not. */
|
|
564
|
+
export interface CanvasFrameInit {
|
|
565
|
+
protocol: number;
|
|
566
|
+
theme: 'light' | 'dark';
|
|
567
|
+
/** CSS custom properties the runtime applies: the dashboard's palette, so a canvas looks like the dashboard. */
|
|
568
|
+
tokens: Record<string, string>;
|
|
569
|
+
canvas: string;
|
|
570
|
+
version: number;
|
|
571
|
+
/** `@mdx-js/mdx` `function-body` output, compiled by the dashboard from the AST it checked. */
|
|
572
|
+
code: string;
|
|
573
|
+
compiler: string;
|
|
574
|
+
contract: CanvasContract;
|
|
575
|
+
bindings: CanvasBinding[];
|
|
576
|
+
data: unknown;
|
|
577
|
+
marks: CanvasDataMarks;
|
|
578
|
+
/** Confirmed answers by key (`props.answers`). */
|
|
579
|
+
answers: Record<string, unknown>;
|
|
580
|
+
/** Get results by uri (`props.got`). */
|
|
581
|
+
got: Record<string, CanvasGotResult>;
|
|
582
|
+
/** A question or heading to scroll to (`#<qid>`). */
|
|
583
|
+
anchor?: string;
|
|
584
|
+
/** Shown as the last good version (tier 2). */
|
|
585
|
+
fallback?: boolean;
|
|
586
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
587
|
+
}
|
|
588
|
+
export type CanvasGotResult = {
|
|
589
|
+
ok: true;
|
|
590
|
+
value: unknown;
|
|
591
|
+
at: number;
|
|
592
|
+
kept?: boolean;
|
|
593
|
+
} | {
|
|
594
|
+
ok: false;
|
|
595
|
+
reason: string;
|
|
596
|
+
};
|
|
597
|
+
/**
|
|
598
|
+
* The confirmed answers that stand (state `current`), the newest per key — what the frame's `props.answers` is, what
|
|
599
|
+
* `When` reads, and the only answers agents act on (§2.4).
|
|
600
|
+
*/
|
|
601
|
+
export declare function canvasConfirmedAnswers(answers: readonly CanvasAnswer[]): Record<string, unknown>;
|
|
602
|
+
/**
|
|
603
|
+
* What `ui/initialize` answers the frame with (§2.3): what it may read, and nothing it may not — answers CONFIRMED
|
|
604
|
+
* only. The dashboard and a headless render (§9) build it alike, so a render draws what the person sees.
|
|
605
|
+
*/
|
|
606
|
+
export declare function canvasFrameInit(a: {
|
|
607
|
+
detail: Pick<DashCanvasDetail, 'canvas' | 'shown' | 'version' | 'data' | 'marks' | 'answers'>;
|
|
608
|
+
code: string;
|
|
609
|
+
compiler: string;
|
|
610
|
+
theme: 'light' | 'dark';
|
|
611
|
+
tokens: Record<string, string>;
|
|
612
|
+
anchor?: string | undefined;
|
|
613
|
+
fallback: boolean;
|
|
614
|
+
}): CanvasFrameInit;
|
|
615
|
+
/** A question's slot, as the frame lays it out: the parent draws the real control over it (§2.4). In CSS pixels of
|
|
616
|
+
* the inner document — the iframe has no scroll of its own, so these are offsets from the iframe's top-left. */
|
|
617
|
+
export interface CanvasSlot {
|
|
618
|
+
qid: string;
|
|
619
|
+
x: number;
|
|
620
|
+
y: number;
|
|
621
|
+
width: number;
|
|
622
|
+
height: number;
|
|
623
|
+
visible: boolean;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Frame → parent params, zod-checked before anything acts on them (≤ `frameMessageBytes`, rate-limited by the
|
|
627
|
+
* parent). A method with no entry here takes no params from the frame.
|
|
628
|
+
*/
|
|
629
|
+
export declare const CANVAS_FRAME_PARAMS: {
|
|
630
|
+
readonly 'ui/initialize': z.ZodObject<{
|
|
631
|
+
protocol: z.ZodNumber;
|
|
632
|
+
}, z.core.$loose>;
|
|
633
|
+
readonly 'ui/notifications/size-changed': z.ZodObject<{
|
|
634
|
+
height: z.ZodNumber;
|
|
635
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
636
|
+
}, z.core.$strip>;
|
|
637
|
+
readonly 'ui/open-link': z.ZodObject<{
|
|
638
|
+
url: z.ZodString;
|
|
639
|
+
}, z.core.$strip>;
|
|
640
|
+
readonly 'canvas/heartbeat': z.ZodObject<{
|
|
641
|
+
t: z.ZodNumber;
|
|
642
|
+
}, z.core.$strip>;
|
|
643
|
+
readonly 'canvas/slots': z.ZodObject<{
|
|
644
|
+
slots: z.ZodArray<z.ZodObject<{
|
|
645
|
+
qid: z.ZodString;
|
|
646
|
+
x: z.ZodNumber;
|
|
647
|
+
y: z.ZodNumber;
|
|
648
|
+
width: z.ZodNumber;
|
|
649
|
+
height: z.ZodNumber;
|
|
650
|
+
visible: z.ZodBoolean;
|
|
651
|
+
}, z.core.$strip>>;
|
|
652
|
+
}, z.core.$strip>;
|
|
653
|
+
readonly 'canvas/focus': z.ZodObject<{
|
|
654
|
+
qid: z.ZodString;
|
|
655
|
+
}, z.core.$strip>;
|
|
656
|
+
readonly 'canvas/get': z.ZodObject<{
|
|
657
|
+
uri: z.ZodString;
|
|
658
|
+
}, z.core.$strip>;
|
|
659
|
+
readonly 'canvas/rendered': z.ZodObject<{
|
|
660
|
+
ms: z.ZodNumber;
|
|
661
|
+
blocks: z.ZodNumber;
|
|
662
|
+
errors: z.ZodNumber;
|
|
663
|
+
}, z.core.$strip>;
|
|
664
|
+
readonly 'canvas/problem': z.ZodObject<{
|
|
665
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
666
|
+
message: z.ZodString;
|
|
667
|
+
block: z.ZodOptional<z.ZodString>;
|
|
668
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
669
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
670
|
+
component: z.ZodOptional<z.ZodString>;
|
|
671
|
+
}, z.core.$strip>>;
|
|
672
|
+
}, z.core.$strip>;
|
|
673
|
+
readonly 'canvas/health': z.ZodObject<{
|
|
674
|
+
ok: z.ZodBoolean;
|
|
675
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
676
|
+
message: z.ZodString;
|
|
677
|
+
block: z.ZodOptional<z.ZodString>;
|
|
678
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
679
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
680
|
+
component: z.ZodOptional<z.ZodString>;
|
|
681
|
+
}, z.core.$strip>>;
|
|
682
|
+
}, z.core.$strip>;
|
|
683
|
+
readonly 'canvas/selection': z.ZodObject<{
|
|
684
|
+
text: z.ZodString;
|
|
685
|
+
block: z.ZodOptional<z.ZodString>;
|
|
686
|
+
lines: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
687
|
+
}, z.core.$strip>;
|
|
688
|
+
readonly 'canvas/copy': z.ZodObject<{
|
|
689
|
+
text: z.ZodString;
|
|
690
|
+
}, z.core.$strip>;
|
|
691
|
+
readonly 'canvas/download': z.ZodObject<{
|
|
692
|
+
name: z.ZodString;
|
|
693
|
+
type: z.ZodEnum<{
|
|
694
|
+
csv: "csv";
|
|
695
|
+
json: "json";
|
|
696
|
+
png: "png";
|
|
697
|
+
txt: "txt";
|
|
698
|
+
md: "md";
|
|
699
|
+
}>;
|
|
700
|
+
text: z.ZodString;
|
|
701
|
+
}, z.core.$strip>;
|
|
702
|
+
readonly 'canvas/open-ref': z.ZodObject<{
|
|
703
|
+
kind: z.ZodEnum<{
|
|
704
|
+
file: "file";
|
|
705
|
+
goal: "goal";
|
|
706
|
+
task: "task";
|
|
707
|
+
canvas: "canvas";
|
|
708
|
+
}>;
|
|
709
|
+
id: z.ZodString;
|
|
710
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
711
|
+
}, z.core.$strip>;
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* The height a question's slot starts at, before the parent measured its control (`canvas/slot-sizes` then tells the
|
|
715
|
+
* frame the real heights). One formula on both sides, so the first layout already leaves the control its room.
|
|
716
|
+
*/
|
|
717
|
+
export declare function canvasSlotHeight(ask: CanvasAsk): number;
|
|
718
|
+
/** Parent → frame notifications. */
|
|
719
|
+
export interface CanvasSlotSizes {
|
|
720
|
+
/** The height the parent's control for each qid needs. */
|
|
721
|
+
sizes: Record<string, number>;
|
|
722
|
+
}
|
|
723
|
+
export interface CanvasDataChanged {
|
|
724
|
+
data: unknown;
|
|
725
|
+
marks: CanvasDataMarks;
|
|
726
|
+
dataRev: number;
|
|
727
|
+
}
|
|
728
|
+
export interface CanvasAnswersChanged {
|
|
729
|
+
answers: Record<string, unknown>;
|
|
730
|
+
}
|
|
731
|
+
export interface DashCanvasRow {
|
|
732
|
+
id: string;
|
|
733
|
+
title: string;
|
|
734
|
+
kind: CanvasKind;
|
|
735
|
+
project: CanvasProjectRef;
|
|
736
|
+
links: CanvasLink[];
|
|
737
|
+
author: CanvasActor;
|
|
738
|
+
current: number;
|
|
739
|
+
latest: number;
|
|
740
|
+
health: CanvasHealthState;
|
|
741
|
+
openQuestions: number;
|
|
742
|
+
archived: boolean;
|
|
743
|
+
/** Read beyond its home project. */
|
|
744
|
+
shared: boolean;
|
|
745
|
+
/** Homed by another project, shared to this one. */
|
|
746
|
+
foreign: boolean;
|
|
747
|
+
updatedAt: number;
|
|
748
|
+
createdAt: number;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* A canvas question in Team › Inbox (§7): one asked with `inbox` or `blocking`, with no current confirmed answer, its
|
|
752
|
+
* `When` met. The canvas is the truth; this row is read from it, and answering it opens the canvas at the question.
|
|
753
|
+
*/
|
|
754
|
+
export interface DashCanvasInboxQuestion {
|
|
755
|
+
canvas: string;
|
|
756
|
+
canvasTitle: string;
|
|
757
|
+
kind: CanvasKind;
|
|
758
|
+
project: CanvasProjectRef;
|
|
759
|
+
/** The version whose question this is (the canvas's current). */
|
|
760
|
+
version: number;
|
|
761
|
+
ask: CanvasAsk;
|
|
762
|
+
links: CanvasLink[];
|
|
763
|
+
author: CanvasActor;
|
|
764
|
+
/** When the version that asks it was written. */
|
|
765
|
+
askedAt: number;
|
|
766
|
+
/** Homed by another project, shared to this one. */
|
|
767
|
+
foreign: boolean;
|
|
768
|
+
}
|
|
769
|
+
export interface DashCanvasInbox {
|
|
770
|
+
questions: DashCanvasInboxQuestion[];
|
|
771
|
+
/** Open canvas questions for the Inbox — what the sidebar's count adds. */
|
|
772
|
+
count: number;
|
|
773
|
+
stamp: string;
|
|
774
|
+
}
|
|
775
|
+
export interface DashCanvasList {
|
|
776
|
+
canvases: DashCanvasRow[];
|
|
777
|
+
/** The projects this machine knows, for filters and sharing by name. */
|
|
778
|
+
projects: CanvasProjectRef[];
|
|
779
|
+
/** The project the dashboard serves. */
|
|
780
|
+
here?: CanvasProjectRef;
|
|
781
|
+
counts: {
|
|
782
|
+
all: number;
|
|
783
|
+
open: number;
|
|
784
|
+
broken: number;
|
|
785
|
+
archived: number;
|
|
786
|
+
shared: number;
|
|
787
|
+
};
|
|
788
|
+
/** The store's head across canvases: the page refetches when it moves. */
|
|
789
|
+
stamp: string;
|
|
790
|
+
}
|
|
791
|
+
export interface DashCanvasDetail {
|
|
792
|
+
canvas: CanvasRecord;
|
|
793
|
+
project: CanvasProjectRef;
|
|
794
|
+
/** The version drawn: `current`, or `lastGood` under tier 2. */
|
|
795
|
+
shown: number;
|
|
796
|
+
tier: CanvasTier;
|
|
797
|
+
/** Why the tier is not 1: «Version 7 failed to render: <error>. Showing version 6.» */
|
|
798
|
+
banner?: string;
|
|
799
|
+
version: CanvasVersion;
|
|
800
|
+
/** The working data (for the current version) — or the version's own copy when an older one is shown. */
|
|
801
|
+
data: unknown;
|
|
802
|
+
dataRev: number;
|
|
803
|
+
marks: CanvasDataMarks;
|
|
804
|
+
answers: CanvasAnswer[];
|
|
805
|
+
versions: CanvasVersionRow[];
|
|
806
|
+
problems: CanvasProblem[];
|
|
807
|
+
/** Tier 3, and the print view. */
|
|
808
|
+
safe: CanvasSafeBlock[];
|
|
809
|
+
/** Where the frame host is, from this dashboard: `http://lensmcp.canvas.localhost:4321`. Empty: no frame (tier 3). */
|
|
810
|
+
frameOrigin: string;
|
|
811
|
+
/** May the person answer here (a worker Mac's read-only board: «answer on the organizer»). */
|
|
812
|
+
canAnswer: boolean;
|
|
813
|
+
/** Gets the version uses, and what each resolves to now. */
|
|
814
|
+
gets: Array<CanvasGetDecl & {
|
|
815
|
+
allowed: boolean;
|
|
816
|
+
why?: string;
|
|
817
|
+
}>;
|
|
818
|
+
comments: CanvasComment[];
|
|
819
|
+
/** The ledger's head. */
|
|
820
|
+
seq: number;
|
|
821
|
+
}
|
|
822
|
+
export interface DashCanvasCompiled {
|
|
823
|
+
canvas: string;
|
|
824
|
+
version: number;
|
|
825
|
+
code: string;
|
|
826
|
+
compiler: string;
|
|
827
|
+
format: number;
|
|
828
|
+
}
|
|
829
|
+
export interface DashCanvasAnswerInput {
|
|
830
|
+
key: string;
|
|
831
|
+
value?: unknown;
|
|
832
|
+
note?: string;
|
|
833
|
+
version: number;
|
|
834
|
+
qHash: string;
|
|
835
|
+
/** This key's `qSeq` the page last saw: refused when it moved (per-question CAS). */
|
|
836
|
+
ifQSeq?: number;
|
|
837
|
+
requestId?: string;
|
|
838
|
+
via: 'document' | 'rail' | 'inbox';
|
|
839
|
+
/** Clear the answer instead. */
|
|
840
|
+
clear?: boolean;
|
|
841
|
+
}
|
|
842
|
+
export interface DashCanvasAnswerResult {
|
|
843
|
+
answer?: CanvasAnswer;
|
|
844
|
+
answers: CanvasAnswer[];
|
|
845
|
+
seq: number;
|
|
846
|
+
}
|
|
847
|
+
export interface DashCanvasHealthInput {
|
|
848
|
+
version: number;
|
|
849
|
+
ok: boolean;
|
|
850
|
+
errors: CanvasRenderError[];
|
|
851
|
+
runtime: string;
|
|
852
|
+
compiler: string;
|
|
853
|
+
}
|
|
854
|
+
export interface DashCanvasLedger {
|
|
855
|
+
rows: CanvasLedgerRow[];
|
|
856
|
+
/** Pass as `before` for the page before. */
|
|
857
|
+
next?: number;
|
|
858
|
+
}
|