agentic-canvas 0.0.0-stage → 0.1.0

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/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,150 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ActorConfigError,
4
+ BRAND,
5
+ CanvasError,
6
+ CanvasService,
7
+ operatorActor,
8
+ runMcp
9
+ } from "./chunk-NSZ2AC5O.js";
10
+ import {
11
+ openLocalStore
12
+ } from "./chunk-I3EJ5JB7.js";
13
+
14
+ // src/cli.ts
15
+ import { readFileSync, writeFileSync } from "fs";
16
+ import { parseArgs } from "util";
17
+ var UsageError = class extends Error {
18
+ };
19
+ var HELP = `${BRAND.command} ${BRAND.version}
20
+ ${BRAND.description}
21
+
22
+ Usage: ${BRAND.command} [--dir <path>] <command> [flags]
23
+
24
+ Commands:
25
+ new [--id <id>] [--title <t>] Make a board.
26
+ read <board> Print the board as JSON.
27
+ add <board> --type <t> --x <n> --y <n> Add a shape. Also: --w --h --text --fill --stroke --src --id.
28
+ connect <board> <from> <to> [--text <t>] Join two shapes with an arrow.
29
+ move <board> <element> --dx <n> --dy <n> Move an element or a group.
30
+ rm <board> <element> Delete an element.
31
+ flow <board> --text <t> | --file <p> Draw a flowchart from text ("A -> B: label"). Use --file - for stdin.
32
+ export <board> [--format svg|png] [--out <path>] Print SVG, or write PNG to --out.
33
+ repair <board> [--drop <element>]... Owner only: fix a broken or over-cap board. Needs CANVAS_ACTOR=human:<id>.
34
+ mcp Serve these as MCP tools on stdio. Needs CANVAS_ACTOR.
35
+
36
+ Write commands need an actor in CANVAS_ACTOR as <kind>:<id>, such as "agent:helper".
37
+ The operator sets it. A caller cannot pick its own kind: there is no --actor flag.
38
+ Kinds: human, agent_of_human, agent_of_agent, agent, user_token.
39
+ The store folder is --dir, or CANVAS_DIR, or ./.agentic-canvas.`;
40
+ var flags = {
41
+ dir: { type: "string" },
42
+ id: { type: "string" },
43
+ title: { type: "string" },
44
+ type: { type: "string" },
45
+ x: { type: "string" },
46
+ y: { type: "string" },
47
+ w: { type: "string" },
48
+ h: { type: "string" },
49
+ text: { type: "string" },
50
+ fill: { type: "string" },
51
+ stroke: { type: "string" },
52
+ src: { type: "string" },
53
+ dx: { type: "string" },
54
+ dy: { type: "string" },
55
+ file: { type: "string" },
56
+ prefix: { type: "string" },
57
+ format: { type: "string" },
58
+ out: { type: "string" },
59
+ drop: { type: "string", multiple: true },
60
+ help: { type: "boolean" },
61
+ version: { type: "boolean" }
62
+ };
63
+ var num = (v) => v === void 0 ? void 0 : v.trim() === "" ? Number.NaN : Number(v);
64
+ function joinNegatives(argv) {
65
+ const out = [];
66
+ for (let i = 0; i < argv.length; i++) {
67
+ const next = argv[i + 1] ?? "";
68
+ if (argv[i].startsWith("--") && !argv[i].includes("=") && /^-\d/.test(next)) out.push(`${argv[i]}=${argv[++i]}`);
69
+ else out.push(argv[i]);
70
+ }
71
+ return out;
72
+ }
73
+ async function run(argv) {
74
+ const { values: v, positionals } = parseArgs({ args: joinNegatives(argv), options: flags, allowPositionals: true });
75
+ if (v.version) return void console.log(BRAND.version);
76
+ const [command, board, ...rest] = positionals;
77
+ if (v.help || command === void 0) return void console.log(HELP);
78
+ const need = (count, shape) => {
79
+ if (positionals.length !== count + 1) throw new UsageError(`usage: ${BRAND.command} ${command} ${shape}`);
80
+ };
81
+ const actor = () => {
82
+ try {
83
+ return operatorActor();
84
+ } catch (error) {
85
+ if (error instanceof ActorConfigError) throw new UsageError(`"${command}" needs an actor: ${error.message}`);
86
+ throw error;
87
+ }
88
+ };
89
+ const service = new CanvasService(openLocalStore(v.dir ?? process.env.CANVAS_DIR ?? ".agentic-canvas"));
90
+ const print = (value) => console.log(JSON.stringify(value));
91
+ switch (command) {
92
+ case "new":
93
+ need(0, "[--id <id>] [--title <t>]");
94
+ return print(await service.create(actor(), { id: v.id, title: v.title }));
95
+ case "read":
96
+ need(1, "<board>");
97
+ return print(await service.read(board));
98
+ case "add":
99
+ need(1, "<board> --type <t> --x <n> --y <n>");
100
+ return print(await service.add(board, { id: v.id, type: v.type, x: num(v.x), y: num(v.y), w: num(v.w), h: num(v.h), text: v.text, fill: v.fill, stroke: v.stroke, src: v.src }, actor()));
101
+ case "connect":
102
+ need(3, "<board> <from> <to> [--text <t>]");
103
+ return print(await service.connect(board, { id: v.id, from: { id: rest[0] }, to: { id: rest[1] }, text: v.text }, actor()));
104
+ case "move":
105
+ need(2, "<board> <element> --dx <n> --dy <n>");
106
+ return print(await service.move(board, rest[0], num(v.dx) ?? Number.NaN, num(v.dy) ?? Number.NaN, actor()));
107
+ case "rm":
108
+ need(2, "<board> <element>");
109
+ return print(await service.remove(board, rest[0]));
110
+ case "flow": {
111
+ need(1, "<board> --text <t> | --file <path>");
112
+ if (v.text === void 0 === (v.file === void 0)) throw new UsageError("flow needs exactly one of --text and --file");
113
+ const text = v.text ?? readFileSync(v.file === "-" ? 0 : v.file, "utf8");
114
+ return print(await service.flow(board, text, actor(), { idPrefix: v.prefix }));
115
+ }
116
+ case "export": {
117
+ need(1, "<board> [--format svg|png] [--out <path>]");
118
+ const format = v.format ?? "svg";
119
+ if (format !== "svg" && format !== "png") throw new UsageError(`format must be svg or png, got "${format}"`);
120
+ if (format === "png" && !v.out) throw new UsageError("png is binary: pass --out <path>");
121
+ const data = format === "svg" ? await service.exportSvg(board) : await service.exportPng(board);
122
+ if (!v.out) return void process.stdout.write(`${data}
123
+ `);
124
+ writeFileSync(v.out, data);
125
+ return print({ out: v.out, format, bytes: data.length });
126
+ }
127
+ case "repair":
128
+ need(1, "<board> [--drop <element>]...");
129
+ return print(await service.repair(board, actor(), v.drop ?? []));
130
+ case "mcp":
131
+ need(0, "");
132
+ return runMcp(service, actor());
133
+ default:
134
+ throw new UsageError(`unknown command "${command}"`);
135
+ }
136
+ }
137
+ run(process.argv.slice(2)).catch((error) => {
138
+ const code = error.code ?? "";
139
+ if (error instanceof UsageError || code.startsWith("ERR_PARSE_ARGS")) {
140
+ console.error(`${error.message}
141
+ Run "${BRAND.command} --help" for usage.`);
142
+ process.exitCode = 2;
143
+ } else if (error instanceof CanvasError) {
144
+ console.error(`${error.code}: ${error.message}`);
145
+ process.exitCode = 1;
146
+ } else {
147
+ console.error(error instanceof Error ? error.message : String(error));
148
+ process.exitCode = 1;
149
+ }
150
+ });
@@ -0,0 +1,285 @@
1
+ import * as Y from 'yjs';
2
+ import { z } from 'zod';
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { Store } from 'agentic-identity';
5
+ export { PRINCIPAL_KINDS, PrincipalKind, isMachineMade } from 'agentic-identity';
6
+ export { FileStoreOptions, createFileStore, openLocalStore } from './store-file.js';
7
+
8
+ declare const VERSION: string;
9
+
10
+ declare const BRAND: {
11
+ readonly command: "agentic-canvas";
12
+ readonly description: "A shared whiteboard for diagrams, drawn by people and agents.";
13
+ readonly version: string;
14
+ };
15
+
16
+ declare const principalSchema: z.ZodObject<{
17
+ kind: z.ZodEnum<["human", "agent_of_human", "agent_of_agent", "agent", "user_token"]>;
18
+ id: z.ZodString;
19
+ }, "strict", z.ZodTypeAny, {
20
+ id: string;
21
+ kind: "human" | "agent_of_human" | "agent_of_agent" | "agent" | "user_token";
22
+ }, {
23
+ id: string;
24
+ kind: "human" | "agent_of_human" | "agent_of_agent" | "agent" | "user_token";
25
+ }>;
26
+ type Principal = z.infer<typeof principalSchema>;
27
+
28
+ type ErrorCode = "INVALID" | "DUPLICATE_ID" | "NOT_FOUND" | "BAD_REFERENCE" | "LIMIT" | "UNAVAILABLE" | "FORBIDDEN";
29
+ declare class CanvasError extends Error {
30
+ readonly code: ErrorCode;
31
+ constructor(code: ErrorCode, message: string);
32
+ }
33
+ declare const SHAPE_TYPES: readonly ["rect", "ellipse", "diamond", "text", "sticky", "frame", "image"];
34
+ type ShapeType = (typeof SHAPE_TYPES)[number];
35
+ declare const MAX_ELEMENTS = 10000;
36
+ declare const MAX_TEXT = 10000;
37
+ type Endpoint = {
38
+ id: string;
39
+ } | {
40
+ x: number;
41
+ y: number;
42
+ };
43
+ interface Stamp {
44
+ id: string;
45
+ z: number;
46
+ groupId?: string;
47
+ /** Who made the element. Never changes. */
48
+ author: Principal;
49
+ /** Who made the last edit. */
50
+ editedBy: Principal;
51
+ }
52
+ interface Shape extends Stamp {
53
+ type: ShapeType;
54
+ x: number;
55
+ y: number;
56
+ w: number;
57
+ h: number;
58
+ text: string;
59
+ fill?: string;
60
+ stroke?: string;
61
+ src?: string;
62
+ }
63
+ interface Connector extends Stamp {
64
+ type: "connector";
65
+ from: Endpoint;
66
+ to: Endpoint;
67
+ text: string;
68
+ startArrow: boolean;
69
+ endArrow: boolean;
70
+ stroke?: string;
71
+ }
72
+ interface Group extends Stamp {
73
+ type: "group";
74
+ }
75
+ type CanvasElement = Shape | Connector | Group;
76
+ /**
77
+ * A whiteboard on a Yjs doc. Headless: no UI code. Every write names its actor.
78
+ *
79
+ * A synced Yjs update is untrusted input. Every read checks each stored element against the same
80
+ * rules the write methods enforce, and returns only the checked fields. An entry that fails is
81
+ * hidden at once. `repair()` deletes it, and `Board.decode` runs `repair()`. This holds even
82
+ * when a caller writes to `doc` directly.
83
+ */
84
+ declare class Board {
85
+ readonly doc: Y.Doc;
86
+ private readonly elements;
87
+ private readonly meta;
88
+ private maxElements;
89
+ constructor(doc?: Y.Doc, options?: {
90
+ maxElements?: number;
91
+ });
92
+ /** Load a saved board with no element checks. Only the owner repair path uses it. */
93
+ static open(update: Uint8Array): Board;
94
+ /**
95
+ * Load a saved board. Refuses a doc past the element cap. Then it deletes every entry that fails
96
+ * the element checks, and repairs what concurrent writers left broken.
97
+ */
98
+ static decode(update: Uint8Array): Board;
99
+ encode(): Uint8Array;
100
+ /** An independent copy. Edits to it leave this board alone. */
101
+ clone(): Board;
102
+ get title(): string;
103
+ get titleBy(): Principal | undefined;
104
+ setTitle(title: string, actor: Principal): void;
105
+ /** One element. An invalid entry, or a connector with a missing bound end, is hidden. */
106
+ get(elementId: string): CanvasElement | undefined;
107
+ /** All visible elements from back to front. */
108
+ list(): CanvasElement[];
109
+ /**
110
+ * Delete what peers can leave broken: entries that fail the element checks, connectors whose
111
+ * bound end is gone, and members that name a deleted group. Idempotent, so every peer may run it.
112
+ * `drop` names elements the owner removes too, with what they hold: a shape takes its connectors,
113
+ * a group takes its members. Refuses a result still past the cap, and then changes nothing.
114
+ * Returns the ids fixed.
115
+ */
116
+ repair(drop?: string[]): string[];
117
+ addShape(input: unknown, actor: Principal): Shape;
118
+ addConnector(input: unknown, actor: Principal): Connector;
119
+ update(elementId: string, patch: unknown, actor: Principal): CanvasElement;
120
+ /** Shift an element, or a whole group. Returns the ids that moved. Bound connector ends follow their shapes. */
121
+ move(elementId: string, dx: number, dy: number, actor: Principal): string[];
122
+ /** Delete an element. A shape takes its connectors and a group takes its members. Returns the ids removed. */
123
+ remove(elementId: string): string[];
124
+ group(ids: string[], actor: Principal, groupId?: string): Group;
125
+ /** Remove a group and hand its members to the parent group. */
126
+ ungroup(groupId: string, actor: Principal): void;
127
+ /** Put an element, or a group with its inner order kept, in front of or behind every other element. */
128
+ reorder(elementId: string, to: "front" | "back", actor: Principal): void;
129
+ /** One stored element that passes the checks and whose id matches its key, or undefined. */
130
+ private stored;
131
+ /** Every stored element that passes the checks, from back to front. Refuses a doc past the cap. */
132
+ private storedList;
133
+ /** Like storedList, with no cap check. Repair needs every entry, even on a board past the cap. */
134
+ private allStored;
135
+ /** A connector is detached when a bound end does not name a stored shape. */
136
+ private isDetached;
137
+ private require;
138
+ private checkEnd;
139
+ /** The z value just past the top or the bottom. Not clamped: the caller checks the range. */
140
+ private edgeZ;
141
+ /** The element and, for a group, everything below it. Cycle-safe. */
142
+ private subtree;
143
+ private subtreeIn;
144
+ private create;
145
+ /** Apply field changes and stamp the editor, all in one transaction. An undefined value clears the field. */
146
+ private write;
147
+ }
148
+
149
+ declare const MAX_FLOW_NODES = 500;
150
+ declare const MAX_FLOW_EDGES = 2000;
151
+ interface FlowNode {
152
+ id: string;
153
+ text: string;
154
+ shape: Extract<ShapeType, "rect" | "ellipse" | "diamond">;
155
+ }
156
+ interface FlowEdge {
157
+ from: string;
158
+ to: string;
159
+ text: string;
160
+ }
161
+ interface FlowGraph {
162
+ direction: "TB" | "LR";
163
+ nodes: FlowNode[];
164
+ edges: FlowEdge[];
165
+ }
166
+ declare function parseFlow(source: string): FlowGraph;
167
+ interface Placement {
168
+ id: string;
169
+ x: number;
170
+ y: number;
171
+ w: number;
172
+ h: number;
173
+ }
174
+ /** Layered layout. The top-left of the result is (0, 0). The layout breaks cycles and handles self-loops. */
175
+ declare function layoutFlow(graph: FlowGraph): Placement[];
176
+ interface DrawOptions {
177
+ /**
178
+ * Put in front of every id. Default: a new random prefix for each call, so two agents that draw at
179
+ * the same time never write the same id. A prefix you pass is used as given, and it makes ids
180
+ * repeatable. Up to 16 of A-Z, a-z, 0-9, _ and -.
181
+ */
182
+ idPrefix?: string;
183
+ /** Top-left of the drawing. Default: below the shapes already on the board. */
184
+ origin?: {
185
+ x: number;
186
+ y: number;
187
+ };
188
+ }
189
+ /** Draw a flow on the board. All or nothing: on any error the board stays as it was. */
190
+ declare function drawFlow(board: Board, source: string, actor: Principal, options?: DrawOptions): {
191
+ nodes: string[];
192
+ edges: string[];
193
+ };
194
+
195
+ interface Labels {
196
+ /** The author is an agent or acts for one. */
197
+ machineMade: boolean;
198
+ /** The last edit came from an agent or one acting for one. */
199
+ lastEditMachineMade: boolean;
200
+ }
201
+ type NodeData = Shape & Labels;
202
+ type EdgeData = Connector & Labels;
203
+ interface BoardData {
204
+ title: string;
205
+ nodes: NodeData[];
206
+ edges: EdgeData[];
207
+ groups: {
208
+ id: string;
209
+ members: string[];
210
+ }[];
211
+ /** Every non-empty text, back to front. */
212
+ texts: string[];
213
+ }
214
+ /** The board as plain data for an agent. Reads only. Embedded image bytes are left out. */
215
+ declare function readBoard(board: Board): BoardData;
216
+
217
+ /** Draw the board, back to front, on a white background. */
218
+ declare function toSvg(board: Board): string;
219
+
220
+ /**
221
+ * Draw an SVG to PNG in a headless Chromium, through the optional
222
+ * `playwright-core` package. The page runs with JavaScript off and service
223
+ * workers blocked, and every network request is aborted, so a script planted in
224
+ * the SVG cannot run and nothing leaves the machine. When the package or the
225
+ * browser is missing, this throws.
226
+ */
227
+ declare function svgToPng(svg: string): Promise<Uint8Array>;
228
+
229
+ /** The operator set CANVAS_ACTOR wrong or not at all. */
230
+ declare class ActorConfigError extends Error {
231
+ }
232
+ /**
233
+ * The actor for every write, from the operator's CANVAS_ACTOR as <kind>:<id>.
234
+ * A caller never picks its own actor or kind. Unset, empty, or bad is an error.
235
+ */
236
+ declare function operatorActor(env?: Record<string, string | undefined>): Principal;
237
+
238
+ /** One place for every board operation. The CLI, the MCP server, and the Worker call it. */
239
+ declare class CanvasService {
240
+ private readonly store;
241
+ constructor(store: Store);
242
+ create(actor: Principal, options?: {
243
+ id?: string;
244
+ title?: string;
245
+ }): Promise<{
246
+ id: string;
247
+ title: string;
248
+ }>;
249
+ read(id: string): Promise<BoardData & {
250
+ id: string;
251
+ }>;
252
+ /** Run `change` on the board and save it, all inside one transaction. */
253
+ change<R>(id: string, change: (board: Board) => R): Promise<R>;
254
+ add(id: string, shape: unknown, actor: Principal): Promise<Shape>;
255
+ connect(id: string, connector: unknown, actor: Principal): Promise<Connector>;
256
+ move(id: string, elementId: string, dx: number, dy: number, actor: Principal): Promise<{
257
+ moved: string[];
258
+ }>;
259
+ remove(id: string, elementId: string): Promise<{
260
+ removed: string[];
261
+ }>;
262
+ flow(id: string, text: string, actor: Principal, options?: DrawOptions): Promise<{
263
+ nodes: string[];
264
+ edges: string[];
265
+ }>;
266
+ exportSvg(id: string): Promise<string>;
267
+ exportPng(id: string): Promise<Uint8Array>;
268
+ /** Owner only. Repair a board and delete the named elements. Only a human actor may call it. */
269
+ repair(id: string, actor: Principal, drop?: string[]): Promise<{
270
+ id: string;
271
+ fixed: string[];
272
+ elements: number;
273
+ }>;
274
+ private load;
275
+ }
276
+
277
+ /**
278
+ * The tools mirror the CLI. The actor is fixed here by the operator. No tool takes an actor,
279
+ * author, or kind, so a caller cannot choose who it writes as.
280
+ */
281
+ declare function createMcpServer(service: CanvasService, actor: Principal): McpServer;
282
+ /** Serve the tools on stdin and stdout. Stdout carries protocol frames only. */
283
+ declare function runMcp(service: CanvasService, actor: Principal): Promise<void>;
284
+
285
+ export { ActorConfigError, BRAND, Board, type BoardData, type CanvasElement, CanvasError, CanvasService, type Connector, type DrawOptions, type EdgeData, type Endpoint, type ErrorCode, type FlowEdge, type FlowGraph, type FlowNode, type Group, MAX_ELEMENTS, MAX_FLOW_EDGES, MAX_FLOW_NODES, MAX_TEXT, type NodeData, type Placement, type Principal, SHAPE_TYPES, type Shape, type ShapeType, VERSION, createMcpServer, drawFlow, layoutFlow, operatorActor, parseFlow, principalSchema, readBoard, runMcp, svgToPng, toSvg };
package/dist/index.js ADDED
@@ -0,0 +1,56 @@
1
+ import {
2
+ ActorConfigError,
3
+ BRAND,
4
+ Board,
5
+ CanvasError,
6
+ CanvasService,
7
+ MAX_ELEMENTS,
8
+ MAX_FLOW_EDGES,
9
+ MAX_FLOW_NODES,
10
+ MAX_TEXT,
11
+ PRINCIPAL_KINDS,
12
+ SHAPE_TYPES,
13
+ VERSION,
14
+ createMcpServer,
15
+ drawFlow,
16
+ isMachineMade,
17
+ layoutFlow,
18
+ operatorActor,
19
+ parseFlow,
20
+ principalSchema,
21
+ readBoard,
22
+ runMcp,
23
+ svgToPng,
24
+ toSvg
25
+ } from "./chunk-NSZ2AC5O.js";
26
+ import {
27
+ createFileStore,
28
+ openLocalStore
29
+ } from "./chunk-I3EJ5JB7.js";
30
+ export {
31
+ ActorConfigError,
32
+ BRAND,
33
+ Board,
34
+ CanvasError,
35
+ CanvasService,
36
+ MAX_ELEMENTS,
37
+ MAX_FLOW_EDGES,
38
+ MAX_FLOW_NODES,
39
+ MAX_TEXT,
40
+ PRINCIPAL_KINDS,
41
+ SHAPE_TYPES,
42
+ VERSION,
43
+ createFileStore,
44
+ createMcpServer,
45
+ drawFlow,
46
+ isMachineMade,
47
+ layoutFlow,
48
+ openLocalStore,
49
+ operatorActor,
50
+ parseFlow,
51
+ principalSchema,
52
+ readBoard,
53
+ runMcp,
54
+ svgToPng,
55
+ toSvg
56
+ };
@@ -0,0 +1,28 @@
1
+ import { AdapterOptions, Store } from 'agentic-identity';
2
+
3
+ /** A file store failure the caller can act on. `code` says why: LOCKED or DAMAGED. */
4
+ declare class FileStoreError extends Error {
5
+ readonly code: "LOCKED" | "DAMAGED";
6
+ constructor(code: "LOCKED" | "DAMAGED", message: string);
7
+ }
8
+
9
+ interface FileStoreOptions extends AdapterOptions {
10
+ /** How long a write waits for the lock before it fails. Defaults to 10000. */
11
+ lockTimeoutMs?: number;
12
+ /** A lock older than this is stale, if its owner is alive. Defaults to 30000. */
13
+ staleAfterMs?: number;
14
+ }
15
+ /**
16
+ * A Store kept in one JSON file. Node only. It is an adapter of the shared Store port and passes `runStoreContract`. Many processes may share the file, for example the CLI
17
+ * and the MCP server. Each write takes a lock file, reads the file again, applies the change, and
18
+ * replaces the file by an atomic rename. A read sees the last renamed file, so it takes no lock.
19
+ * Each call reads the whole file and loads the docs it needs into the shared memory adapter, which runs the
20
+ * queries and the transaction rules. Cost grows with the file. Use it for local work, not for scale.
21
+ * The lock needs one machine: the process check and the clock do not work across hosts.
22
+ */
23
+ declare function createFileStore(path: string, options?: FileStoreOptions): Store;
24
+ /** The store the CLI and the MCP server share: one file in `dir`, which is made if it is missing. */
25
+ declare function openLocalStore(dir: string): Store;
26
+ declare const STORE_FILE = "canvas.json";
27
+
28
+ export { FileStoreError, type FileStoreOptions, STORE_FILE, createFileStore, openLocalStore };
@@ -0,0 +1,12 @@
1
+ import {
2
+ FileStoreError,
3
+ STORE_FILE,
4
+ createFileStore,
5
+ openLocalStore
6
+ } from "./chunk-I3EJ5JB7.js";
7
+ export {
8
+ FileStoreError,
9
+ STORE_FILE,
10
+ createFileStore,
11
+ openLocalStore
12
+ };
package/llms.txt ADDED
@@ -0,0 +1,13 @@
1
+ # agentic-canvas
2
+
3
+ A shared whiteboard for diagrams, drawn by people and agents.
4
+
5
+ Keywords: whiteboard,canvas,diagrams,drawing,collaboration,agents,mcp,cli.
6
+
7
+ - SDK: import { Board, drawFlow, readBoard, toSvg } from "agentic-canvas".
8
+ - CLI: agentic-canvas new|read|add|connect|move|rm|flow|export.
9
+
10
+ ## Docs
11
+
12
+ - README: https://github.com/pooriaarab/agentic-canvas
13
+ - License: MIT
package/package.json CHANGED
@@ -1,6 +1,79 @@
1
1
  {
2
2
  "name": "agentic-canvas",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "A shared whiteboard for diagrams, drawn by people and agents.",
5
+ "keywords": [
6
+ "whiteboard",
7
+ "canvas",
8
+ "diagrams",
9
+ "drawing",
10
+ "collaboration",
11
+ "agents",
12
+ "mcp",
13
+ "cli"
14
+ ],
15
+ "license": "MIT",
16
+ "author": "Pooria Arab",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/pooriaarab/agentic-canvas.git"
20
+ },
21
+ "type": "module",
22
+ "private": false,
23
+ "engines": {
24
+ "node": ">=22"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "llms.txt",
29
+ "SKILL.md"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "mcpName": "io.github.pooriaarab/agentic-canvas",
35
+ "main": "./dist/index.js",
36
+ "types": "./dist/index.d.ts",
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
41
+ },
42
+ "./file-store": {
43
+ "types": "./dist/store-file.d.ts",
44
+ "import": "./dist/store-file.js"
45
+ }
46
+ },
47
+ "bin": {
48
+ "agentic-canvas": "./dist/cli.js"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "typecheck": "tsc --noEmit",
53
+ "test": "vitest run",
54
+ "clean": "rm -rf dist",
55
+ "ci:local": "npm run build && npm run typecheck && npm test"
56
+ },
57
+ "dependencies": {
58
+ "@dagrejs/dagre": "^3.1.3",
59
+ "@modelcontextprotocol/sdk": "^1.12.0",
60
+ "agentic-identity": "^0.2.0",
61
+ "yjs": "^13.6.0",
62
+ "zod": "^3.25.0"
63
+ },
64
+ "peerDependencies": {
65
+ "playwright-core": ">=1.40.0"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "playwright-core": {
69
+ "optional": true
70
+ }
71
+ },
72
+ "devDependencies": {
73
+ "@types/node": "^22.0.0",
74
+ "playwright-core": "^1.64.1",
75
+ "tsup": "^8.0.0",
76
+ "typescript": "^5.6.0",
77
+ "vitest": "^3.0.0"
78
+ }
79
+ }