@lensmcp/protocol-types 1.26.25 → 1.26.27
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 +1 -0
- package/index.js +1 -1
- package/lib/canvas-chat.d.ts +132 -0
- package/lib/canvas-chat.js +2 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
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/lens-hosts.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";export*from"./lib/canvas-frame-policy.js";export*from"./lib/canvas-attachments.js";export*from"./lib/canvas-editing.js";export*from"./lib/canvas-hub.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/lens-hosts.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";export*from"./lib/canvas-frame-policy.js";export*from"./lib/canvas-attachments.js";export*from"./lib/canvas-editing.js";export*from"./lib/canvas-chat.js";export*from"./lib/canvas-hub.js";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { CanvasActor, CanvasHealthState } from './canvas.js';
|
|
2
|
+
/**
|
|
3
|
+
* Canvas chat (planning/canvas/02-canvas-chat.md): the person makes and changes a canvas by talking to it, in the
|
|
4
|
+
* dashboard. A chat (`ch-<id>`) belongs to one canvas once it exists — a chat started from *New canvas* is bound to
|
|
5
|
+
* the canvas its first version makes. Its engine is the person's pick, per chat (C1): a MODEL called with a key from
|
|
6
|
+
* Settings › AI, or an AGENT launched headless on the person's accounts.
|
|
7
|
+
*
|
|
8
|
+
* POST /api/canvases/chats DashCanvasChatStart → DashCanvasChatAnswer
|
|
9
|
+
* GET /api/canvases/chats?canvas=<id> DashCanvasChatList
|
|
10
|
+
* GET /api/canvases/chats/<ch> DashCanvasChatAnswer (`rows` whole)
|
|
11
|
+
* POST /api/canvases/chats/<ch>/messages DashCanvasChatSay → DashCanvasChatAnswer
|
|
12
|
+
* POST /api/canvases/chats/<ch>/engine DashCanvasChatEngineInput → DashCanvasChatAnswer
|
|
13
|
+
* POST /api/canvases/chats/<ch>/stop → DashCanvasChatAnswer
|
|
14
|
+
* GET /api/canvases/chats/<ch>/stream text/event-stream of DashCanvasChatEvent
|
|
15
|
+
*/
|
|
16
|
+
export declare const CANVAS_CHAT_ENGINES: readonly ["model", "agent"];
|
|
17
|
+
export type CanvasChatEngine = (typeof CANVAS_CHAT_ENGINES)[number];
|
|
18
|
+
export declare const CANVAS_CHAT_STATES: readonly ["idle", "working", "stopped", "failed"];
|
|
19
|
+
export type CanvasChatState = (typeof CANVAS_CHAT_STATES)[number];
|
|
20
|
+
/**
|
|
21
|
+
* What a row is: the person's message; the engine's words (`reply`); a tool call or a launch's progress line, shown
|
|
22
|
+
* small (`step`); a version written by the engine (`version`); a version the person saved from MDX/Data (`edit`); a
|
|
23
|
+
* failure (`error`); the engine switched (`engine`).
|
|
24
|
+
*/
|
|
25
|
+
export declare const CANVAS_CHAT_ROW_KINDS: readonly ["person", "reply", "step", "version", "edit", "error", "engine"];
|
|
26
|
+
export type CanvasChatRowKind = (typeof CANVAS_CHAT_ROW_KINDS)[number];
|
|
27
|
+
/** How a chat's engine runs: the model's provider and model id, or the agent's client and the account it uses. */
|
|
28
|
+
export interface CanvasChatSettings {
|
|
29
|
+
/** model: `anthropic` | `openai`. */
|
|
30
|
+
provider?: string;
|
|
31
|
+
/** model: the model id (default: the provider's default in Settings › AI). */
|
|
32
|
+
model?: string;
|
|
33
|
+
/** agent: `claude` | `codex` (default: the machine's launch default). */
|
|
34
|
+
client?: string;
|
|
35
|
+
/** agent: the account id (`ac-…`) it launches on (default: the drain plan's next). */
|
|
36
|
+
account?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CanvasChat {
|
|
39
|
+
id: string;
|
|
40
|
+
project: string;
|
|
41
|
+
/** The canvas it changes; absent until a new canvas's first version is written. */
|
|
42
|
+
canvas?: string;
|
|
43
|
+
engine: CanvasChatEngine;
|
|
44
|
+
settings: CanvasChatSettings;
|
|
45
|
+
title: string;
|
|
46
|
+
state: CanvasChatState;
|
|
47
|
+
/** What runs now: a model turn's id, or the agent's launch id. */
|
|
48
|
+
working?: string;
|
|
49
|
+
createdAt: number;
|
|
50
|
+
updatedAt: number;
|
|
51
|
+
by: CanvasActor;
|
|
52
|
+
/** The newest row's seq. */
|
|
53
|
+
seq: number;
|
|
54
|
+
}
|
|
55
|
+
export interface CanvasChatRow {
|
|
56
|
+
chat: string;
|
|
57
|
+
seq: number;
|
|
58
|
+
at: number;
|
|
59
|
+
kind: CanvasChatRowKind;
|
|
60
|
+
/** What is said: the person's or the engine's words, a step's line, a version's note, an error's message. */
|
|
61
|
+
text: string;
|
|
62
|
+
/** `version` and `edit`: the version's number. */
|
|
63
|
+
version?: number;
|
|
64
|
+
/** `version` and `edit`: its health once checked. */
|
|
65
|
+
health?: CanvasHealthState;
|
|
66
|
+
/** Who: the person, the model (`model:<provider>`), the agent (its client and session). */
|
|
67
|
+
by?: CanvasActor;
|
|
68
|
+
/** `engine`: the engine and settings switched to. `error`: a code the page can act on (`no-key`, `launch-off`, `quota`…). */
|
|
69
|
+
meta?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
/** The longest message the person sends, and the most rows one answer carries (the newest). */
|
|
72
|
+
export declare const CANVAS_CHAT_LIMITS: {
|
|
73
|
+
readonly textChars: 8000;
|
|
74
|
+
readonly rows: 500;
|
|
75
|
+
readonly title: 120;
|
|
76
|
+
};
|
|
77
|
+
export interface DashCanvasChatStart {
|
|
78
|
+
engine: CanvasChatEngine;
|
|
79
|
+
settings?: CanvasChatSettings;
|
|
80
|
+
/** The first message. */
|
|
81
|
+
text: string;
|
|
82
|
+
/** A chat about an existing canvas; absent, a new canvas. */
|
|
83
|
+
canvas?: string;
|
|
84
|
+
requestId?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface DashCanvasChatSay {
|
|
87
|
+
text: string;
|
|
88
|
+
requestId?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface DashCanvasChatEngineInput {
|
|
91
|
+
engine: CanvasChatEngine;
|
|
92
|
+
settings?: CanvasChatSettings;
|
|
93
|
+
}
|
|
94
|
+
export interface DashCanvasChatAnswer {
|
|
95
|
+
chat: CanvasChat;
|
|
96
|
+
rows: CanvasChatRow[];
|
|
97
|
+
}
|
|
98
|
+
export interface DashCanvasChatList {
|
|
99
|
+
chats: CanvasChat[];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The stream's events: a row as it is written; a reply's text as it streams (`live`, replaced by its `row` when whole —
|
|
103
|
+
* `text` is the whole reply so far, not a piece); the chat's own state.
|
|
104
|
+
*/
|
|
105
|
+
export type DashCanvasChatEvent = {
|
|
106
|
+
kind: 'row';
|
|
107
|
+
row: CanvasChatRow;
|
|
108
|
+
} | {
|
|
109
|
+
kind: 'live';
|
|
110
|
+
text: string;
|
|
111
|
+
} | {
|
|
112
|
+
kind: 'chat';
|
|
113
|
+
chat: CanvasChat;
|
|
114
|
+
};
|
|
115
|
+
/** The role a chat's launch carries on the launch registry and Team › Launches. */
|
|
116
|
+
export declare const CANVAS_AUTHOR_ROLE = "canvas-author";
|
|
117
|
+
/** How long a canvas author waits for the next message before it ends: the person's next message starts it again. */
|
|
118
|
+
export declare const CANVAS_AUTHOR_IDLE_MINUTES = 15;
|
|
119
|
+
/**
|
|
120
|
+
* The canvas author's whole guide: given to the launched client where a compaction cannot reach it (Claude Code's system
|
|
121
|
+
* prompt, Codex's developer instructions — storage launches.ts `roleText`), so it holds for the whole session. Its first
|
|
122
|
+
* paragraph is the plan's, with the chat's ids in it. Every tool it names is a canvas tool (apps/canvas tools.spec.ts).
|
|
123
|
+
*/
|
|
124
|
+
export declare function canvasAuthorText(p: {
|
|
125
|
+
chat: string;
|
|
126
|
+
canvas?: string;
|
|
127
|
+
}): string;
|
|
128
|
+
/** What a canvas author is told first (its stdin): read the chat and answer it. Its rules are {@link canvasAuthorText}. */
|
|
129
|
+
export declare function canvasAuthorStart(p: {
|
|
130
|
+
chat: string;
|
|
131
|
+
launchId: string;
|
|
132
|
+
}): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var e=(t,a)=>i(t,"name",{value:a,configurable:!0});var r=Object.defineProperty,n=e((t,a)=>r(t,"name",{value:a,configurable:!0}),"t"),o=Object.defineProperty,s=n((t,a)=>o(t,"name",{value:a,configurable:!0}),"a");export const CANVAS_CHAT_ENGINES=["model","agent"],CANVAS_CHAT_STATES=["idle","working","stopped","failed"],CANVAS_CHAT_ROW_KINDS=["person","reply","step","version","edit","error","engine"],CANVAS_CHAT_LIMITS={textChars:8e3,rows:500,title:120},CANVAS_AUTHOR_ROLE="canvas-author",CANVAS_AUTHOR_IDLE_MINUTES=15;export function canvasAuthorText(t){const a=JSON.stringify(t.chat);return["# Your role: canvas author (LensMCP)","",`You write a canvas with a person, in a chat (${t.chat}). Read it with \`canvas_chat { chat: ${a} }\`, change the canvas with \`canvas_write\` (\`chat: ${a}\` on the first, which makes it), say what you did with \`canvas_chat { chat: ${a}, say }\` \u2014 short \u2014 and wait for the next message with \`canvas_wait { on: ["chat"], chat: ${a}, since }\`. Do not change the repository. Stop after ${CANVAS_AUTHOR_IDLE_MINUTES} idle minutes; the person's next message starts you again with the chat so far.`,"",t.canvas?`- The canvas is ${t.canvas}: read it first (\`canvas_get { id: ${JSON.stringify(t.canvas)}, include: ["mdx", "data", "shape"] }\`), then write \`canvas_write { id: ${JSON.stringify(t.canvas)}, chat: ${a}, ifVersion, note }\`.`:`- There is no canvas yet: your first \`canvas_write { chat: ${a}, mdx, data, note }\` makes it and binds it to the chat; write the next versions with its \`id\`.`,"- Read skill://lensmcp-canvas/SKILL.md before you write: the components, the data and its shape, and what the checker refuses.","- What to do is in the person's messages (`kind: \"person\"`). An `edit` row is a version the person saved themselves: read it before you write, and build on it, never over it. Other rows are the chat's record.","- Read the repository and the lens as the canvas needs; change nothing in the repository \u2014 no edits, no commits, no branches. What you make is the canvas.",`- One message, one answer: the version(s) it asks for, one short \`say\`, then \`canvas_wait\` with the \`seq\` you read. Back with nothing new: wait again \u2014 once ${CANVAS_AUTHOR_IDLE_MINUTES} minutes passed with nothing, end.`].join(`
|
|
2
|
+
`)}e(canvasAuthorText,"canvasAuthorText"),n(canvasAuthorText,"canvasAuthorText"),s(canvasAuthorText,"canvasAuthorText");export function canvasAuthorStart(t){return`The person wrote to you in the canvas chat ${t.chat}: read it with canvas_chat { chat: ${JSON.stringify(t.chat)} } and answer its newest messages, as your role says. (LensMCP launch ${t.launchId}.)`}e(canvasAuthorStart,"canvasAuthorStart"),n(canvasAuthorStart,"canvasAuthorStart"),s(canvasAuthorStart,"canvasAuthorStart");
|