@lensmcp/protocol-types 1.26.20 → 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 CHANGED
@@ -83,3 +83,5 @@ export type { ProofFingerprint, ProofEvidence, ProofHost, RuntimeProofIdentity }
83
83
  export type { GoalAdmission, GoalDeliveryPolicy, DeliveryProofRequirement, PackageContract, PackagePublication, PackageCandidate, DeliveryFailureKind, DeliveryFinding, PackageDelivery, DeliveryAssignment, PackageDeliverySummary, ProofWaiver, ForcedItem, ForcedIntegration, ProofDeferral, TestsWaiver } from './lib/team-delivery.js';
84
84
  export { PROOF_ACTIONS, NOT_RUN_KINDS } from './lib/team-delivery.js';
85
85
  export type { NotRunKind } from './lib/team-delivery.js';
86
+ export * from './lib/canvas.js';
87
+ export * from './lib/canvas-catalog.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/lint-ignores.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/conversations.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";
1
+ "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/lint-ignores.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/conversations.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";export*from"./lib/canvas.js";export*from"./lib/canvas-catalog.js";
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The canvas component catalog (planning/canvas/00-plan.md §5): every component a canvas's MDX may use, with its props.
3
+ * ONE table read by three parts: the checker refuses a prop or a component not here and quotes the entry's schema
4
+ * (`@lensmcp/canvas-engine`), the frame runtime draws them (`@lensmcp/canvas-frame`), and the dashboard's safe view
5
+ * draws each as a labelled card (tier 3). The skill (`skill://lensmcp-canvas`) is written from it.
6
+ *
7
+ * Interactive components (`Question`, `Checklist`, `Field`, `Options`) and `When` take LITERAL props only — strings,
8
+ * numbers, booleans, and array/object literals of those — so the contract can be read without running anything.
9
+ * Display components may also take `{expressions}`, which run in the frame only.
10
+ */
11
+ export type CanvasPropType = 'string' | 'number' | 'boolean' | 'enum'
12
+ /** A string or an array of strings (`y="cost"` or `y={["cost","budget"]}`). */
13
+ | 'strings'
14
+ /** `[{id, label, detail?}]`, or `["Postgres", "SQLite"]` (ids are then derived: `postgres`, `sqlite`). */
15
+ | 'options'
16
+ /** Inline rows: an array of objects. */
17
+ | 'rows'
18
+ /** Table columns: `["month","cost"]` or `[{key, label, format?}]`. */
19
+ | 'columns'
20
+ /** A JSON Pointer into the data or a `lens:` / `canvas:` / `https:` uri. */
21
+ | 'source'
22
+ /** Anything a display component can read — runs in the frame only. */
23
+ | 'any';
24
+ export interface CanvasPropSpec {
25
+ type: CanvasPropType;
26
+ required?: boolean;
27
+ values?: readonly string[];
28
+ /** Must be a literal (checked at write time) even on a display component. */
29
+ literal?: boolean;
30
+ describe: string;
31
+ }
32
+ export type CanvasComponentGroup = 'layout' | 'data' | 'reference' | 'decision' | 'interactive';
33
+ export interface CanvasComponentSpec {
34
+ name: string;
35
+ group: CanvasComponentGroup;
36
+ describe: string;
37
+ props: Readonly<Record<string, CanvasPropSpec>>;
38
+ /** What it holds: nothing, inline text, any blocks, or only `Tab`/`Option` children. */
39
+ children: 'none' | 'text' | 'blocks' | 'Tab' | 'Option';
40
+ /** Must sit directly inside this component. */
41
+ parent?: string;
42
+ /** Its props are literal only, and it lands in the contract. */
43
+ interactive?: boolean;
44
+ example: string;
45
+ }
46
+ export declare const CANVAS_CHART_TYPES: readonly ["bar", "line", "area", "stacked", "pie", "scatter"];
47
+ export type CanvasChartType = (typeof CANVAS_CHART_TYPES)[number];
48
+ export declare const CANVAS_CALLOUT_TYPES: readonly ["note", "info", "tip", "warning", "danger", "success"];
49
+ export declare const CANVAS_COMPONENTS: readonly CanvasComponentSpec[];
50
+ export declare const CANVAS_COMPONENT_NAMES: readonly string[];
51
+ export declare const canvasComponent: (name: string) => CanvasComponentSpec | undefined;
52
+ /** Fenced code a canvas may use for diagrams: ```mermaid (mermaid ≥ 11, strict) and ```diff. */
53
+ export declare const CANVAS_FENCES: readonly ["mermaid", "diff"];
54
+ /** The props schema of a component, as a refusal quotes it: `Chart { type*: bar|line|…, source: source, … }`. */
55
+ export declare function canvasComponentSchema(spec: CanvasComponentSpec): string;
56
+ /** An option given as a bare label gets an id derived from it: `"Postgres 16"` → `postgres-16`. */
57
+ export declare function canvasOptionId(label: string): string;
58
+ /**
59
+ * Components the COMPILER inserts and the runtime draws, never written by an author (the checker refuses them in MDX):
60
+ * `CanvasBlock` wraps each top-level block in an error boundary (`line`, `id`), `CanvasMermaid` and `CanvasDiffBlock`
61
+ * draw ```mermaid and ```diff fences (`code`, `line`).
62
+ */
63
+ export declare const CANVAS_INTERNAL_COMPONENTS: readonly ["CanvasBlock", "CanvasMermaid", "CanvasDiffBlock"];
@@ -0,0 +1,12 @@
1
+ "use strict";var o=Object.defineProperty;var r=(e,t)=>o(e,"name",{value:t,configurable:!0});var d=Object.defineProperty,s=r((e,t)=>d(e,"name",{value:t,configurable:!0}),"i");const n=["neutral","info","success","warning","danger"];export const CANVAS_CHART_TYPES=["bar","line","area","stacked","pie","scatter"],CANVAS_CALLOUT_TYPES=["note","info","tip","warning","danger","success"],CANVAS_COMPONENTS=[{name:"Callout",group:"layout",describe:"A highlighted note.",props:{type:{type:"enum",values:CANVAS_CALLOUT_TYPES,describe:"How it reads: note (default), info, tip, warning, danger, success."},title:{type:"string",describe:"A short heading."}},children:"blocks",example:'<Callout type="warning" title="Before you merge">The migration locks `orders` for about 2 s.</Callout>'},{name:"Details",group:"layout",describe:"A section the person opens.",props:{summary:{type:"string",required:!0,describe:"What the closed section says."},open:{type:"boolean",describe:"Open at first."}},children:"blocks",example:'<Details summary="How it was measured">Three runs on the dev Mac \u2026</Details>'},{name:"Tabs",group:"layout",describe:"Tabs; each child is a `Tab`.",props:{},children:"Tab",example:`<Tabs>
2
+ <Tab title="Before">\u2026</Tab>
3
+ <Tab title="After">\u2026</Tab>
4
+ </Tabs>`},{name:"Tab",group:"layout",describe:"One tab of a `Tabs`.",props:{title:{type:"string",required:!0,describe:"The tab\u2019s label."}},children:"blocks",parent:"Tabs",example:'<Tab title="After">\u2026</Tab>'},{name:"Columns",group:"layout",describe:"Children side by side (stacked on a narrow screen).",props:{count:{type:"number",describe:"How many columns (2\u20134, default: one per child)."}},children:"blocks",example:`<Columns>
5
+ <Stat label="p95" value="120 ms" />
6
+ <Stat label="Errors" value={3} />
7
+ </Columns>`},{name:"Badge",group:"layout",describe:"A small label.",props:{tone:{type:"enum",values:n,describe:"Its color."}},children:"text",example:'<Badge tone="success">shipped</Badge>'},{name:"Stat",group:"data",describe:"One number with a label.",props:{label:{type:"string",required:!0,describe:"What it counts."},value:{type:"any",describe:"The value (or `source`)."},source:{type:"source",describe:"Where the value is: a JSON Pointer into the data (`/totals/cost`) or a get."},unit:{type:"string",describe:"Shown after the value."},delta:{type:"any",describe:"A change to show beside it (`+12%`, or a number)."},tone:{type:"enum",values:n,describe:"Its color."}},children:"none",example:'<Stat label="Monthly cost" source="/totals/cost" unit="USD" />'},{name:"Chart",group:"data",describe:"A chart of rows: bar, line, area, stacked, pie, scatter.",props:{type:{type:"enum",values:CANVAS_CHART_TYPES,required:!0,describe:"Which chart."},data:{type:"rows",describe:"Inline rows (or `source`)."},source:{type:"source",describe:"Where the rows are: a JSON Pointer to an array of objects."},x:{type:"string",required:!0,describe:"The key each row\u2019s x (or slice, for pie) is under."},y:{type:"strings",required:!0,describe:"The numeric key(s) to draw: one series each."},title:{type:"string",describe:"A heading."},unit:{type:"string",describe:"The values\u2019 unit."},height:{type:"number",describe:"Pixels (default 260)."}},children:"none",example:'<Chart type="bar" source="/costs/monthly" x="month" y={["cost"]} unit="USD" />'},{name:"Table",group:"data",describe:"Rows as a sortable table (virtualised past 500 rows).",props:{data:{type:"rows",describe:"Inline rows (or `source`)."},source:{type:"source",describe:"A JSON Pointer to an array of objects."},columns:{type:"columns",describe:"Which keys, in order (default: the first row\u2019s)."},title:{type:"string",describe:"A heading."}},children:"none",example:'<Table source="/checks" columns={["name","state","ms"]} />'},{name:"Timeline",group:"data",describe:"Dated events in order.",props:{data:{type:"rows",describe:"Inline events (or `source`): objects with a date and a title."},source:{type:"source",describe:"A JSON Pointer to an array of objects."},date:{type:"string",describe:"The key of each event\u2019s date (default `date`)."},label:{type:"string",describe:"The key of each event\u2019s title (default `title`)."}},children:"none",example:'<Timeline source="/milestones" />'},{name:"TaskRef",group:"reference",describe:"A link to a task.",props:{id:{type:"string",required:!0,literal:!0,describe:"The task id."}},children:"text",example:'<TaskRef id="6f1c\u2026" />'},{name:"GoalRef",group:"reference",describe:"A link to a goal.",props:{id:{type:"string",required:!0,literal:!0,describe:"The goal id."}},children:"text",example:'<GoalRef id="g-42" />'},{name:"CanvasRef",group:"reference",describe:"A link to another canvas.",props:{id:{type:"string",required:!0,literal:!0,describe:"The canvas id (`cv-\u2026`)."}},children:"text",example:'<CanvasRef id="cv-0123456789abcdef" />'},{name:"FileRef",group:"reference",describe:"A link to a file of the project (opened on the Changes page).",props:{path:{type:"string",required:!0,literal:!0,describe:"Repository-relative path."},line:{type:"number",literal:!0,describe:"A line to open at."}},children:"text",example:'<FileRef path="libs/core/src/index.ts" line={12} />'},{name:"Options",group:"decision",describe:"A decision between options, each an `Option` with its own text; the person picks one.",props:{qid:{type:"string",required:!0,describe:"The decision\u2019s id: what the answer is keyed by."},title:{type:"string",required:!0,describe:"The question the options answer."},blocking:{type:"boolean",describe:"Its task needs the answer: it waits flagged in Team \u203A Inbox \u203A Canvases until the person answers."},inbox:{type:"boolean",describe:"Also ask it in Team \u203A Inbox \u203A Canvases."}},children:"Option",interactive:!0,example:`<Options qid="store" title="Where do canvases live?">
8
+ <Option id="sqlite" title="One SQLite database" recommended>\u2026</Option>
9
+ <Option id="files" title="Files per canvas">\u2026</Option>
10
+ </Options>`},{name:"Option",group:"decision",describe:"One option of an `Options`: its body is the argument for it.",props:{id:{type:"string",required:!0,describe:"The option\u2019s id (the answer\u2019s value)."},title:{type:"string",required:!0,describe:"Its name."},recommended:{type:"boolean",describe:"The one you recommend."}},children:"blocks",parent:"Options",interactive:!0,example:'<Option id="sqlite" title="One SQLite database" recommended>Transactions, one writer \u2026</Option>'},{name:"Question",group:"interactive",describe:"A question the person answers in the document.",props:{qid:{type:"string",required:!0,describe:"Its id: what the answer is keyed by. Letters, digits, `-`, `_`."},kind:{type:"enum",values:["choice","multi","text","number","confirm","approve"],required:!0,describe:"choice (one option), multi (any), text, number, confirm (yes/no), approve (approve / ask for changes)."},title:{type:"string",required:!0,describe:"The question, as the control shows it."},detail:{type:"string",describe:"A line of context under it."},options:{type:"options",describe:'For choice and multi: `[{id, label, detail?}]` or `["A", "B"]`.'},recommended:{type:"string",describe:"The option id you recommend."},blocking:{type:"boolean",describe:"Its task needs the answer: it waits flagged in Team \u203A Inbox \u203A Canvases until the person answers."},inbox:{type:"boolean",describe:"Also ask it in Team \u203A Inbox \u203A Canvases."},required:{type:"boolean",describe:"An answer is needed."},min:{type:"number",describe:"For number: the least."},max:{type:"number",describe:"For number: the most."},placeholder:{type:"string",describe:"For text and number."}},children:"none",interactive:!0,example:'<Question qid="db" kind="choice" title="Which database?" options={["Postgres", "SQLite"]} recommended="sqlite" />'},{name:"Checklist",group:"interactive",describe:"Items the person ticks; each item is its own answer (`qid/itemId`).",props:{qid:{type:"string",required:!0,describe:"Its id."},title:{type:"string",required:!0,describe:"What the list is for."},items:{type:"options",required:!0,describe:'`[{id, label}]` or `["Lint", "Tests"]`.'}},children:"none",interactive:!0,example:'<Checklist qid="release" title="Before release" items={["Changelog", "Docs", "Smoke test"]} />'},{name:"Field",group:"interactive",describe:"One value the person fills in.",props:{qid:{type:"string",required:!0,describe:"Its id."},label:{type:"string",required:!0,describe:"What to fill in."},kind:{type:"enum",values:["text","number","date","file","image"],required:!0,describe:"text, number, date, file or image."},placeholder:{type:"string",describe:"A hint inside it."},required:{type:"boolean",describe:"An answer is needed."},min:{type:"number",describe:"For number."},max:{type:"number",describe:"For number."}},children:"none",interactive:!0,example:'<Field qid="deadline" label="Ship by" kind="date" />'},{name:"When",group:"interactive",describe:"Shows its content (follow-up text and questions) once a question is answered so.",props:{qid:{type:"string",required:!0,describe:"The question it follows."},is:{type:"strings",required:!0,describe:'The option id(s) \u2014 or "yes"/"no" for a confirm \u2014 that show it.'}},children:"blocks",interactive:!0,example:`<When qid="db" is="postgres">
11
+ <Question qid="pg-host" kind="text" title="Which host?" />
12
+ </When>`}],CANVAS_COMPONENT_NAMES=CANVAS_COMPONENTS.map(e=>e.name),canvasComponent=s(e=>CANVAS_COMPONENTS.find(t=>t.name===e),"canvasComponent"),CANVAS_FENCES=["mermaid","diff"];export function canvasComponentSchema(e){const t=Object.entries(e.props).map(([a,i])=>`${a}${i.required?"*":""}: ${i.type==="enum"?(i.values??[]).join("|"):i.type}`);return`${e.name} { ${t.join(", ")} }${e.children==="none"?"":` children: ${e.children}`}`}r(canvasComponentSchema,"canvasComponentSchema"),s(canvasComponentSchema,"canvasComponentSchema");export function canvasOptionId(e){const t=e.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,63);return/^[a-z]/.test(t)?t:`o-${t||"x"}`.slice(0,63)}r(canvasOptionId,"canvasOptionId"),s(canvasOptionId,"canvasOptionId");export const CANVAS_INTERNAL_COMPONENTS=["CanvasBlock","CanvasMermaid","CanvasDiffBlock"];
@@ -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
+ }
package/lib/canvas.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var l=Object.defineProperty;var i=(a,n)=>l(a,"name",{value:n,configurable:!0});var d=Object.defineProperty,r=i((a,n)=>d(a,"name",{value:n,configurable:!0}),"i");import{z as e}from"zod";export const CANVAS_FORMAT=1,CANVAS_FRAME_PROTOCOL=1,CANVAS_FRAME_RUNTIME="frame-v1",CANVAS_FRAME_PATH="/v1",CANVAS_FRAME_HOST="lensmcp.canvas.localhost",CANVAS_ID_PATTERN=/^cv-[0-9a-f]{16}$/,CANVAS_PROJECT_ID_PATTERN=/^pr-[0-9a-f]{16}$/,CANVAS_QID_PATTERN=/^[a-z][a-z0-9_-]{0,63}$/i,isCanvasId=r(a=>typeof a=="string"&&CANVAS_ID_PATTERN.test(a),"isCanvasId"),CANVAS_LIMITS={mdxBytes:256*1024,mdxWholeBytes:64*1024,dataBytes:2*1024*1024,answerBytes:16*1024,questions:500,assets:50,assetBytes:100*1024*1024,assetFileBytes:10*1024*1024,canvasBytes:256*1024*1024,projectBytes:2*1024*1024*1024,titleChars:200,noteChars:2e3,commentChars:8e3,frameMessageBytes:256*1024,depth:64,ops:1e3,checkpointEvery:50,checkpointsKept:20,waitDefaultMs:45e3,waitMaxMs:9e5},CANVAS_KINDS=["doc","decision","plan","review","report","dashboard","qa","template"],CANVAS_TEMPLATE_NAMES=["decision-record","plan-review","weekly-report","goal-dashboard","qa-report"],CANVAS_QUESTION_KINDS=["choice","multi","text","number","confirm","approve"],CANVAS_FIELD_KINDS=["text","number","date","file","image"],CANVAS_INTERACTIVE=["Question","Checklist","Field","Options"];export function canvasAnswerKeys(a){return a.kind==="checklist"?(a.items??[]).map(n=>`${a.qid}/${n.id}`):a.kind==="multi"?(a.options??[]).map(n=>`${a.qid}/${n.id}`):[a.qid]}i(canvasAnswerKeys,"canvasAnswerKeys"),r(canvasAnswerKeys,"canvasAnswerKeys");export const canvasQidOf=r(a=>a.split("/")[0]??a,"canvasQidOf"),CANVAS_SHAPE_KEYS=["type","properties","required","items","enum","minimum","maximum","minItems","maxItems","format","additionalProperties","description","derived","$schema","title"],CANVAS_DATA_OPS=["set","remove","move","copy","append"],CANVAS_HEALTH_STATES=["checked","good","broken","unverified"],CANVAS_ANSWER_VIAS=["document","rail","inbox","cli","api","host"],CANVAS_LEDGER_PARTS=["version","data","answer","got","grant","share","archive","delete","comment","health","meta"],CANVAS_BROKER_METHODS=["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"];export function canvasConfirmedAnswers(a){const n=new Map;for(const o of a){if(!o.confirmed)continue;const c=n.get(o.key);(!c||o.seq>c.seq)&&n.set(o.key,o)}const t={};for(const[o,c]of n)c.state==="current"&&(t[o]=c.value);return t}i(canvasConfirmedAnswers,"canvasConfirmedAnswers"),r(canvasConfirmedAnswers,"canvasConfirmedAnswers");export function canvasFrameInit(a){const n=a.detail;return{protocol:CANVAS_FRAME_PROTOCOL,theme:a.theme,tokens:a.tokens,canvas:n.canvas.id,version:n.shown,code:a.code,compiler:a.compiler,contract:n.version.contract,bindings:n.version.bindings,data:n.data,marks:n.marks,answers:canvasConfirmedAnswers(n.answers),got:{},...a.anchor?{anchor:a.anchor}:{},fallback:a.fallback,dir:"auto"}}i(canvasFrameInit,"canvasFrameInit"),r(canvasFrameInit,"canvasFrameInit");const s=e.number(),p=e.object({qid:e.string().max(64),x:s,y:s,width:s.min(0).max(1e4),height:s.min(0).max(1e4),visible:e.boolean()}),m=e.object({message:e.string().max(4e3),block:e.string().max(200).optional(),line:e.number().int().min(0).max(1e6).optional(),column:e.number().int().min(0).max(1e5).optional(),component:e.string().max(100).optional()});export const CANVAS_FRAME_PARAMS={"ui/initialize":e.looseObject({protocol:e.number().int()}),"ui/notifications/size-changed":e.object({height:s.min(0).max(1e6),width:s.min(0).max(1e5).optional()}),"ui/open-link":e.object({url:e.string().max(4e3)}),"canvas/heartbeat":e.object({t:s}),"canvas/slots":e.object({slots:e.array(p).max(CANVAS_LIMITS.questions)}),"canvas/focus":e.object({qid:e.string().max(64)}),"canvas/get":e.object({uri:e.string().max(2e3)}),"canvas/rendered":e.object({ms:s.min(0),blocks:e.number().int().min(0),errors:e.number().int().min(0)}),"canvas/problem":e.object({errors:e.array(m).max(200)}),"canvas/health":e.object({ok:e.boolean(),errors:e.array(m).max(200)}),"canvas/selection":e.object({text:e.string().max(8e3),block:e.string().max(200).optional(),lines:e.tuple([e.number().int(),e.number().int()]).optional()}),"canvas/copy":e.object({text:e.string().max(1024*1024)}),"canvas/download":e.object({name:e.string().max(200),type:e.enum(["csv","json","png","txt","md"]),text:e.string().max(4*1024*1024)}),"canvas/open-ref":e.object({kind:e.enum(["task","goal","file","canvas"]),id:e.string().max(2e3),line:e.number().int().optional()})};export function canvasSlotHeight(a){const n=40+(a.detail?20:0),t=44;switch(a.kind){case"choice":case"multi":return n+36*Math.max(1,a.options?.length??0)+t;case"checklist":return n+32*Math.max(1,a.items?.length??0);case"confirm":return n+t;case"approve":return n+72+t;case"text":return n+84+t;default:return n+40+t}}i(canvasSlotHeight,"canvasSlotHeight"),r(canvasSlotHeight,"canvasSlotHeight");
package/lib/peers.d.ts CHANGED
@@ -863,8 +863,9 @@ export declare const PeerEnvelopeSchema: z.ZodObject<{
863
863
  }, z.core.$strict>;
864
864
  export declare const PeerErrorBodySchema: z.ZodObject<{
865
865
  code: z.ZodEnum<{
866
- lost: "lost";
867
866
  timeout: "timeout";
867
+ lost: "lost";
868
+ refused: "refused";
868
869
  "unknown-type": "unknown-type";
869
870
  "wrong-direction": "wrong-direction";
870
871
  "bad-message": "bad-message";
@@ -872,7 +873,6 @@ export declare const PeerErrorBodySchema: z.ZodObject<{
872
873
  "not-handled": "not-handled";
873
874
  "too-large": "too-large";
874
875
  busy: "busy";
875
- refused: "refused";
876
876
  internal: "internal";
877
877
  "no-window": "no-window";
878
878
  "window-used": "window-used";
@@ -912,8 +912,9 @@ export declare const PEER_BODY_SCHEMAS: {
912
912
  }, z.core.$strict>;
913
913
  readonly error: z.ZodObject<{
914
914
  code: z.ZodEnum<{
915
- lost: "lost";
916
915
  timeout: "timeout";
916
+ lost: "lost";
917
+ refused: "refused";
917
918
  "unknown-type": "unknown-type";
918
919
  "wrong-direction": "wrong-direction";
919
920
  "bad-message": "bad-message";
@@ -921,7 +922,6 @@ export declare const PEER_BODY_SCHEMAS: {
921
922
  "not-handled": "not-handled";
922
923
  "too-large": "too-large";
923
924
  busy: "busy";
924
- refused: "refused";
925
925
  internal: "internal";
926
926
  "no-window": "no-window";
927
927
  "window-used": "window-used";
@@ -978,8 +978,9 @@ export declare const PAIR_BODY_SCHEMAS: {
978
978
  }, z.core.$strict>;
979
979
  readonly error: z.ZodObject<{
980
980
  code: z.ZodEnum<{
981
- lost: "lost";
982
981
  timeout: "timeout";
982
+ lost: "lost";
983
+ refused: "refused";
983
984
  "unknown-type": "unknown-type";
984
985
  "wrong-direction": "wrong-direction";
985
986
  "bad-message": "bad-message";
@@ -987,7 +988,6 @@ export declare const PAIR_BODY_SCHEMAS: {
987
988
  "not-handled": "not-handled";
988
989
  "too-large": "too-large";
989
990
  busy: "busy";
990
- refused: "refused";
991
991
  internal: "internal";
992
992
  "no-window": "no-window";
993
993
  "window-used": "window-used";
@@ -1171,10 +1171,10 @@ export declare const MAIN_MIRROR_SCHEMAS: {
1171
1171
  }, z.core.$strict>;
1172
1172
  verdict: z.ZodOptional<z.ZodObject<{
1173
1173
  state: z.ZodEnum<{
1174
+ waiting: "waiting";
1174
1175
  refused: "refused";
1175
1176
  "in-main": "in-main";
1176
1177
  "brought-in": "brought-in";
1177
- waiting: "waiting";
1178
1178
  "not-ff": "not-ff";
1179
1179
  }>;
1180
1180
  count: z.ZodNumber;
@@ -1204,8 +1204,8 @@ export declare const MAIN_MIRROR_SCHEMAS: {
1204
1204
  sent: z.ZodBoolean;
1205
1205
  }, z.core.$strict>>;
1206
1206
  follow: z.ZodEnum<{
1207
- "in-step": "in-step";
1208
1207
  waiting: "waiting";
1208
+ "in-step": "in-step";
1209
1209
  "fast-forward": "fast-forward";
1210
1210
  ahead: "ahead";
1211
1211
  "to-update": "to-update";
@@ -1214,11 +1214,11 @@ export declare const MAIN_MIRROR_SCHEMAS: {
1214
1214
  }>;
1215
1215
  update: z.ZodOptional<z.ZodObject<{
1216
1216
  outcome: z.ZodEnum<{
1217
- refused: "refused";
1218
1217
  waiting: "waiting";
1218
+ refused: "refused";
1219
+ current: "current";
1219
1220
  "fast-forward": "fast-forward";
1220
1221
  merged: "merged";
1221
- current: "current";
1222
1222
  conflicts: "conflicts";
1223
1223
  }>;
1224
1224
  at: z.ZodNumber;
@@ -1247,10 +1247,10 @@ export declare const MAIN_MIRROR_ANSWER_SCHEMAS: {
1247
1247
  why: z.ZodOptional<z.ZodString>;
1248
1248
  verdict: z.ZodOptional<z.ZodObject<{
1249
1249
  state: z.ZodEnum<{
1250
+ waiting: "waiting";
1250
1251
  refused: "refused";
1251
1252
  "in-main": "in-main";
1252
1253
  "brought-in": "brought-in";
1253
- waiting: "waiting";
1254
1254
  "not-ff": "not-ff";
1255
1255
  }>;
1256
1256
  count: z.ZodNumber;
@@ -1265,8 +1265,8 @@ export declare const MAIN_MIRROR_ANSWER_SCHEMAS: {
1265
1265
  needWhole: z.ZodOptional<z.ZodBoolean>;
1266
1266
  why: z.ZodOptional<z.ZodString>;
1267
1267
  follow: z.ZodOptional<z.ZodEnum<{
1268
- "in-step": "in-step";
1269
1268
  waiting: "waiting";
1269
+ "in-step": "in-step";
1270
1270
  "fast-forward": "fast-forward";
1271
1271
  ahead: "ahead";
1272
1272
  "to-update": "to-update";
@@ -1333,9 +1333,9 @@ export declare const PEER_WORK_SCHEMAS: {
1333
1333
  runId: z.ZodString;
1334
1334
  at: z.ZodNumber;
1335
1335
  state: z.ZodEnum<{
1336
- failed: "failed";
1337
- passed: "passed";
1338
1336
  errored: "errored";
1337
+ passed: "passed";
1338
+ failed: "failed";
1339
1339
  cancelled: "cancelled";
1340
1340
  timeout: "timeout";
1341
1341
  }>;
@@ -1430,10 +1430,10 @@ export declare const PEER_WORK_SCHEMAS: {
1430
1430
  }, z.core.$strict>;
1431
1431
  why: z.ZodObject<{
1432
1432
  kind: z.ZodEnum<{
1433
+ restarting: "restarting";
1433
1434
  protocol: "protocol";
1434
1435
  version: "version";
1435
1436
  installed: "installed";
1436
- restarting: "restarting";
1437
1437
  "install-failed": "install-failed";
1438
1438
  "restart-failed": "restart-failed";
1439
1439
  "no-store": "no-store";
@@ -1495,18 +1495,18 @@ export declare const StoreReplySchema: z.ZodObject<{
1495
1495
  result: z.ZodOptional<z.ZodUnknown>;
1496
1496
  error: z.ZodOptional<z.ZodObject<{
1497
1497
  name: z.ZodEnum<{
1498
+ Error: "Error";
1498
1499
  CoordinationError: "CoordinationError";
1499
1500
  CapacityRefusal: "CapacityRefusal";
1500
1501
  CoordinationBusyError: "CoordinationBusyError";
1501
1502
  StoreCallRefused: "StoreCallRefused";
1502
- Error: "Error";
1503
1503
  }>;
1504
1504
  message: z.ZodString;
1505
1505
  room: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1506
1506
  step: z.ZodOptional<z.ZodEnum<{
1507
1507
  open: "open";
1508
- write: "write";
1509
1508
  commit: "commit";
1509
+ write: "write";
1510
1510
  read: "read";
1511
1511
  }>>;
1512
1512
  waitedMs: z.ZodOptional<z.ZodNumber>;
@@ -1594,10 +1594,10 @@ export declare const PEER_LAUNCH_SCHEMAS: {
1594
1594
  readonly 'launch.state': z.ZodObject<{
1595
1595
  launchId: z.ZodString;
1596
1596
  state: z.ZodEnum<{
1597
- stopped: "stopped";
1598
- exited: "exited";
1599
1597
  running: "running";
1600
1598
  failed: "failed";
1599
+ stopped: "stopped";
1600
+ exited: "exited";
1601
1601
  }>;
1602
1602
  at: z.ZodNumber;
1603
1603
  pid: z.ZodOptional<z.ZodNumber>;
@@ -1802,9 +1802,9 @@ export declare const GOAL_PEER_SCHEMAS: {
1802
1802
  sha256: z.ZodString;
1803
1803
  }, z.core.$strict>;
1804
1804
  services: z.ZodOptional<z.ZodEnum<{
1805
- "on-demand": "on-demand";
1806
- none: "none";
1807
1805
  always: "always";
1806
+ none: "none";
1807
+ "on-demand": "on-demand";
1808
1808
  }>>;
1809
1809
  at: z.ZodNumber;
1810
1810
  }, z.core.$strict>;
@@ -1819,12 +1819,12 @@ export declare const GOAL_PEER_SCHEMAS: {
1819
1819
  readonly 'goal.changes': z.ZodObject<{
1820
1820
  goal: z.ZodString;
1821
1821
  what: z.ZodEnum<{
1822
- commit: "commit";
1823
1822
  files: "files";
1824
- row: "row";
1823
+ commit: "commit";
1825
1824
  diff: "diff";
1826
- commits: "commits";
1827
1825
  against: "against";
1826
+ row: "row";
1827
+ commits: "commits";
1828
1828
  }>;
1829
1829
  path: z.ZodOptional<z.ZodString>;
1830
1830
  sha: z.ZodOptional<z.ZodString>;
@@ -1863,10 +1863,10 @@ export declare const GOAL_PEER_ANSWER_SCHEMAS: {
1863
1863
  ref: z.ZodString;
1864
1864
  sha: z.ZodOptional<z.ZodString>;
1865
1865
  mirror: z.ZodOptional<z.ZodEnum<{
1866
+ created: "created";
1867
+ current: "current";
1866
1868
  "not-ff": "not-ff";
1867
1869
  "fast-forward": "fast-forward";
1868
- current: "current";
1869
- created: "created";
1870
1870
  "checked-out": "checked-out";
1871
1871
  }>>;
1872
1872
  told: z.ZodOptional<z.ZodString>;
@@ -1883,10 +1883,10 @@ export declare const GOAL_PEER_ANSWER_SCHEMAS: {
1883
1883
  readonly 'goal.update': z.ZodObject<{
1884
1884
  outcome: z.ZodEnum<{
1885
1885
  refused: "refused";
1886
- merged: "merged";
1887
1886
  current: "current";
1888
- conflicts: "conflicts";
1889
1887
  asked: "asked";
1888
+ merged: "merged";
1889
+ conflicts: "conflicts";
1890
1890
  }>;
1891
1891
  why: z.ZodString;
1892
1892
  sha: z.ZodOptional<z.ZodString>;
@@ -2051,8 +2051,8 @@ export declare const CONVERSATION_PEER_SCHEMAS: {
2051
2051
  startedAt: z.ZodNumber;
2052
2052
  lastAt: z.ZodNumber;
2053
2053
  state: z.ZodEnum<{
2054
- ended: "ended";
2055
2054
  running: "running";
2055
+ ended: "ended";
2056
2056
  kept: "kept";
2057
2057
  }>;
2058
2058
  kind: z.ZodOptional<z.ZodEnum<{
@@ -2072,10 +2072,10 @@ export declare const CONVERSATION_PEER_SCHEMAS: {
2072
2072
  seq: z.ZodNumber;
2073
2073
  at: z.ZodOptional<z.ZodNumber>;
2074
2074
  kind: z.ZodEnum<{
2075
- reply: "reply";
2076
2075
  tool: "tool";
2077
- compaction: "compaction";
2078
2076
  prompt: "prompt";
2077
+ reply: "reply";
2078
+ compaction: "compaction";
2079
2079
  subagent: "subagent";
2080
2080
  }>;
2081
2081
  text: z.ZodString;
@@ -2084,8 +2084,8 @@ export declare const CONVERSATION_PEER_SCHEMAS: {
2084
2084
  name: z.ZodString;
2085
2085
  target: z.ZodOptional<z.ZodString>;
2086
2086
  outcome: z.ZodOptional<z.ZodEnum<{
2087
- ok: "ok";
2088
2087
  error: "error";
2088
+ ok: "ok";
2089
2089
  }>>;
2090
2090
  output: z.ZodOptional<z.ZodString>;
2091
2091
  }, z.core.$strict>>;
@@ -2094,8 +2094,8 @@ export declare const CONVERSATION_PEER_SCHEMAS: {
2094
2094
  settles: z.ZodOptional<z.ZodArray<z.ZodObject<{
2095
2095
  seq: z.ZodNumber;
2096
2096
  outcome: z.ZodEnum<{
2097
- ok: "ok";
2098
2097
  error: "error";
2098
+ ok: "ok";
2099
2099
  }>;
2100
2100
  output: z.ZodOptional<z.ZodString>;
2101
2101
  }, z.core.$strict>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.26.20",
3
+ "version": "1.26.22",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",