paintress 0.2.0 → 0.2.2

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.
Binary file
Binary file
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { t as renderDocument, w as loadDoc } from "./render-Bv6Wlw9M.js";
3
- import { a as isDaemonRunning, c as pidPath, d as sanitizeProjectName, f as socketPath, i as attachPersistent, l as resolveProjectDir, m as encodeLine, n as runStdioServer, o as sendRequest, p as LineDecoder, r as TOOLS, s as lockPath, u as safeJoin } from "./server-DTPbfSgY.js";
2
+ import { a as isDaemonRunning, c as pidPath, d as sanitizeProjectName, f as socketPath, i as attachPersistent, l as resolveProjectDir, m as encodeLine, n as runStdioServer, o as sendRequest, p as LineDecoder, r as TOOLS, s as lockPath, u as safeJoin } from "./server-C4TC8Bw3.js";
3
+ import { Wt as VERSION, t as renderDocument, w as loadDoc } from "./render-CbYe9rII.js";
4
4
  import "./index.js";
5
5
  import { closeSync, copyFileSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
6
6
  import { homedir } from "node:os";
@@ -272,7 +272,6 @@ var WatchManager = class {
272
272
  }
273
273
  };
274
274
  // src/web/daemon.ts
275
- const VERSION = "0.1.0";
276
275
  const DEFAULT_PORT = 3316;
277
276
  const MIME = {
278
277
  ".html": "text/html; charset=utf-8",
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { Nt as Affine, tt as BackgroundBlurEffect, _t as BlendMode, nt as BlurEffect, Pt as BoolOrVar, L as BrowserSchema, Ft as Color, It as ColorOrVar, Lt as CornerRadius, vt as CrossAxis, A as DocumentObjectSchema, j as DocumentSchema, rt as EffectEntry, it as Effects, R as EllipseSchema, C as FileChangedError, at as FillEntry, yt as FillRule, ot as Fills, z as FrameSchema, st as GradientFill, bt as GradientType, ct as GraphicsBlock, B as GroupSchema, xt as IconLibrary, V as IconSchema, lt as ImageFill, St as ImageFit, H as KNOWN_NODE_TYPES, U as LayoutBlock, Ct as LayoutDir, wt as MainAxis, ut as MeshGradientFill, W as NodeBase, G as NodeSchema, K as NoteSchema, Rt as NumOrVar, M as PTR_SPEC_VERSION, zt as Padding, q as PathSchema, J as PolygonSchema, Tt as PositionMode, N as PtrDocumentSchema, Y as RectangleSchema, X as RefSchema, Z as ScriptSchema, dt as ShaderEffect, ft as ShaderFill, pt as ShadowEffect, Et as ShadowKind, Bt as Sizing, mt as SolidFill, Vt as StringOrVar, Dt as StrokeAlign, ht as StrokeBlock, Ot as StrokeCap, kt as StrokeJoin, gt as StrokeWidth, At as TextAlign, jt as TextAlignVertical, Mt as TextGrowth, Q as TextSchema, $ as UnknownNodeSchema, Ht as VARIABLE_NAME, P as VariableDef, Ut as VariableRef, F as XPaintress, I as X_PAINTRESS_KEY, h as batch, g as buildIndex, O as collectIds, s as commonToCss, n as computeCanvas, c as cornerRadiusToCss, l as effectsToCss, r as escapeAttr, i as escapeHtml, p as expandRefs, u as fillsToCss, k as genId, _ as get, o as getLucideIcon, v as insert, w as loadDoc, m as makeVarResolver, y as move, b as query, x as remove, t as renderDocument, a as renderTree, T as saveDoc, et as schemaForType, E as serializeDoc, d as strokeToCss, f as textToCss, S as update, D as validateDoc } from "./render-Bv6Wlw9M.js";
1
+ export { Nt as Affine, tt as BackgroundBlurEffect, _t as BlendMode, nt as BlurEffect, Pt as BoolOrVar, L as BrowserSchema, Ft as Color, It as ColorOrVar, Lt as CornerRadius, vt as CrossAxis, A as DocumentObjectSchema, j as DocumentSchema, rt as EffectEntry, it as Effects, R as EllipseSchema, C as FileChangedError, at as FillEntry, yt as FillRule, ot as Fills, z as FrameSchema, st as GradientFill, bt as GradientType, ct as GraphicsBlock, B as GroupSchema, xt as IconLibrary, V as IconSchema, lt as ImageFill, St as ImageFit, H as KNOWN_NODE_TYPES, U as LayoutBlock, Ct as LayoutDir, wt as MainAxis, ut as MeshGradientFill, W as NodeBase, G as NodeSchema, K as NoteSchema, Rt as NumOrVar, M as PTR_SPEC_VERSION, zt as Padding, q as PathSchema, J as PolygonSchema, Tt as PositionMode, N as PtrDocumentSchema, Y as RectangleSchema, X as RefSchema, Z as ScriptSchema, dt as ShaderEffect, ft as ShaderFill, pt as ShadowEffect, Et as ShadowKind, Bt as Sizing, mt as SolidFill, Vt as StringOrVar, Dt as StrokeAlign, ht as StrokeBlock, Ot as StrokeCap, kt as StrokeJoin, gt as StrokeWidth, At as TextAlign, jt as TextAlignVertical, Mt as TextGrowth, Q as TextSchema, $ as UnknownNodeSchema, Ht as VARIABLE_NAME, P as VariableDef, Ut as VariableRef, F as XPaintress, I as X_PAINTRESS_KEY, h as batch, g as buildIndex, O as collectIds, s as commonToCss, n as computeCanvas, c as cornerRadiusToCss, l as effectsToCss, r as escapeAttr, i as escapeHtml, p as expandRefs, u as fillsToCss, k as genId, _ as get, o as getLucideIcon, v as insert, w as loadDoc, m as makeVarResolver, y as move, b as query, x as remove, t as renderDocument, a as renderTree, T as saveDoc, et as schemaForType, E as serializeDoc, d as strokeToCss, f as textToCss, S as update, D as validateDoc } from "./render-CbYe9rII.js";
@@ -1 +1 @@
1
- export { t as createMcpServer, n as runStdioServer } from "../server-DTPbfSgY.js";
1
+ export { t as createMcpServer, n as runStdioServer } from "../server-C4TC8Bw3.js";
@@ -1,7 +1,25 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { copyFileSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
3
4
  import { z } from "zod";
4
5
  import { basename, dirname, join } from "node:path";
6
+ // src/shared/version.ts
7
+ /**
8
+ * 包版本:运行时从 package.json 读取,避免在多处硬编码后忘记同步。
9
+ *
10
+ * 路径要覆盖两种布局:
11
+ * - 构建产物 `dist/cli.js`、`dist/index.js` → `../package.json`
12
+ * - 构建产物 `dist/mcp/server.js` 与源码 `src/shared/version.ts` → `../../package.json`
13
+ */
14
+ function readPackageVersion() {
15
+ for (const rel of ["../package.json", "../../package.json"]) try {
16
+ const raw = readFileSync(fileURLToPath(new URL(rel, import.meta.url)), "utf8");
17
+ const version = JSON.parse(raw).version;
18
+ if (typeof version === "string" && version !== "") return version;
19
+ } catch {}
20
+ return "0.0.0";
21
+ }
22
+ const VERSION = readPackageVersion();
5
23
  // src/schema/scalars.ts
6
24
  /** 规格来源:format/spec.yaml §scalars(线键名,v0.2.0) */
7
25
  /** 变量名形如 $accent、$gap-md(必须字母或下划线开头,避免把 $99 这类价格文本当成变量) */
@@ -628,7 +646,7 @@ function validateDoc(input) {
628
646
  };
629
647
  }
630
648
  // src/doc/io.ts
631
- const GENERATOR = "paintress/0.1.0";
649
+ const GENERATOR = `paintress/${VERSION}`;
632
650
  var FileChangedError = class extends Error {
633
651
  path;
634
652
  constructor(path) {
@@ -1592,4 +1610,4 @@ function renderDocument(doc, opts = {}) {
1592
1610
  canvas
1593
1611
  };
1594
1612
  }
1595
- export { UnknownNodeSchema as $, DocumentObjectSchema as A, TextAlign as At, GroupSchema as B, Sizing as Bt, FileChangedError as C, LayoutDir as Ct, validateDoc as D, StrokeAlign as Dt, serializeDoc as E, ShadowKind as Et, XPaintress as F, Color as Ft, NodeSchema as G, KNOWN_NODE_TYPES as H, VARIABLE_NAME as Ht, X_PAINTRESS_KEY as I, ColorOrVar as It, PolygonSchema as J, NoteSchema as K, BrowserSchema as L, CornerRadius as Lt, PTR_SPEC_VERSION as M, TextGrowth as Mt, PtrDocumentSchema as N, Affine as Nt, collectIds as O, StrokeCap as Ot, VariableDef as P, BoolOrVar as Pt, TextSchema as Q, EllipseSchema as R, NumOrVar as Rt, update as S, ImageFit as St, saveDoc as T, PositionMode as Tt, LayoutBlock as U, VariableRef as Ut, IconSchema as V, StringOrVar as Vt, NodeBase as W, RefSchema as X, RectangleSchema as Y, ScriptSchema as Z, get as _, BlendMode as _t, renderTree as a, FillEntry as at, query as b, GradientType as bt, cornerRadiusToCss as c, GraphicsBlock as ct, strokeToCss as d, ShaderEffect as dt, schemaForType as et, textToCss as f, ShaderFill as ft, buildIndex as g, StrokeWidth as gt, batch as h, StrokeBlock as ht, escapeHtml as i, Effects as it, DocumentSchema as j, TextAlignVertical as jt, genId as k, StrokeJoin as kt, effectsToCss as l, ImageFill as lt, makeVarResolver as m, SolidFill as mt, computeCanvas as n, BlurEffect as nt, getLucideIcon as o, Fills as ot, expandRefs as p, ShadowEffect as pt, PathSchema as q, escapeAttr as r, EffectEntry as rt, commonToCss as s, GradientFill as st, renderDocument as t, BackgroundBlurEffect as tt, fillsToCss as u, MeshGradientFill as ut, insert as v, CrossAxis as vt, loadDoc as w, MainAxis as wt, remove as x, IconLibrary as xt, move as y, FillRule as yt, FrameSchema as z, Padding as zt };
1613
+ export { UnknownNodeSchema as $, DocumentObjectSchema as A, TextAlign as At, GroupSchema as B, Sizing as Bt, FileChangedError as C, LayoutDir as Ct, validateDoc as D, StrokeAlign as Dt, serializeDoc as E, ShadowKind as Et, XPaintress as F, Color as Ft, NodeSchema as G, KNOWN_NODE_TYPES as H, VARIABLE_NAME as Ht, X_PAINTRESS_KEY as I, ColorOrVar as It, PolygonSchema as J, NoteSchema as K, BrowserSchema as L, CornerRadius as Lt, PTR_SPEC_VERSION as M, TextGrowth as Mt, PtrDocumentSchema as N, Affine as Nt, collectIds as O, StrokeCap as Ot, VariableDef as P, BoolOrVar as Pt, TextSchema as Q, EllipseSchema as R, NumOrVar as Rt, update as S, ImageFit as St, saveDoc as T, PositionMode as Tt, LayoutBlock as U, VariableRef as Ut, IconSchema as V, StringOrVar as Vt, NodeBase as W, VERSION as Wt, RefSchema as X, RectangleSchema as Y, ScriptSchema as Z, get as _, BlendMode as _t, renderTree as a, FillEntry as at, query as b, GradientType as bt, cornerRadiusToCss as c, GraphicsBlock as ct, strokeToCss as d, ShaderEffect as dt, schemaForType as et, textToCss as f, ShaderFill as ft, buildIndex as g, StrokeWidth as gt, batch as h, StrokeBlock as ht, escapeHtml as i, Effects as it, DocumentSchema as j, TextAlignVertical as jt, genId as k, StrokeJoin as kt, effectsToCss as l, ImageFill as lt, makeVarResolver as m, SolidFill as mt, computeCanvas as n, BlurEffect as nt, getLucideIcon as o, Fills as ot, expandRefs as p, ShadowEffect as pt, PathSchema as q, escapeAttr as r, EffectEntry as rt, commonToCss as s, GradientFill as st, renderDocument as t, BackgroundBlurEffect as tt, fillsToCss as u, MeshGradientFill as ut, insert as v, CrossAxis as vt, loadDoc as w, MainAxis as wt, remove as x, IconLibrary as xt, move as y, FillRule as yt, FrameSchema as z, Padding as zt };
@@ -1,4 +1,4 @@
1
- import { D as validateDoc, O as collectIds, S as update, T as saveDoc, _ as get, b as query, h as batch, t as renderDocument, v as insert, w as loadDoc, x as remove, y as move } from "./render-Bv6Wlw9M.js";
1
+ import { D as validateDoc, O as collectIds, S as update, T as saveDoc, Wt as VERSION, _ as get, b as query, h as batch, t as renderDocument, v as insert, w as loadDoc, x as remove, y as move } from "./render-CbYe9rII.js";
2
2
  import { existsSync, mkdirSync, mkdtempSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
3
3
  import { homedir, tmpdir } from "node:os";
4
4
  import { z } from "zod";
@@ -634,7 +634,7 @@ async function autoRegister(cwd = process.cwd()) {
634
634
  }
635
635
  // src/mcp/server.ts
636
636
  const SERVER_NAME = "paintress";
637
- const SERVER_VERSION = "0.1.0";
637
+ const SERVER_VERSION = VERSION;
638
638
  /** 构建 MCP server:把共享工具注册到 stdio 协议上 */
639
639
  function createMcpServer() {
640
640
  const server = new McpServer({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paintress",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Design-document operation layer for AI agents: read, query, edit, render",
5
5
  "type": "module",
6
6
  "license": "MIT",