....` overrides from the
@@ -1176,7 +1242,7 @@ function start-coding-agent {
echo " .devenv/{shared,templates}/codex.toml." >&2
return 1
fi
- exec codex "${codex_args[@]}" "$@"
+ exec "$bin" "${codex_args[@]}" "$@"
;;
esac
}
@@ -1484,6 +1550,7 @@ function usage {
echo " start of a wsN with no on-disk workspace yet)."
echo " --attach attach to the tmux session after startup."
echo " --agentic enable MCP + Serena (AI-agent mode)."
+ echo " --gpu grant NVIDIA GPU access at container creation."
echo " --serena-context CTX passed to Serena (default: desktop-app)."
echo " --opencode-config-dir DIR"
echo " bind-mount DIR over the container's"
@@ -1515,7 +1582,8 @@ function usage {
echo " config wired in. cd's into the workspace, refuses to launch if the"
echo " instance is not running, and forwards extra args to the client."
echo " client: claude | opencode | vscode | codex"
- echo " Options: --ws N (default: 0). See agentic-devenv.md and"
+ echo " Options: --ws N (default: 0), --bin EXE (run EXE instead of"
+ echo " the client's default executable). See agentic-devenv.md and"
echo " .devenv/README.md for per-client setup and override paths."
echo ""
echo "- build-bundle Build all bundles (frontend, backend, exporter, storybook and mcp)."
diff --git a/mcp/README.md b/mcp/README.md
index 59d60aaf61..2f1636d24a 100644
--- a/mcp/README.md
+++ b/mcp/README.md
@@ -290,7 +290,7 @@ The Penpot MCP server can be configured using environment variables.
| Environment Variable | Description | Default |
|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| `PENPOT_MCP_SERVER_HOST` | Address on which the MCP server listens (binds to) | `localhost` |
-| `PENPOT_MCP_SERVER_PORT` | Port for the MCP server | `4401` |
+| `PENPOT_MCP_SERVER_PORT` | Port for the MCP server | `4401` |
| `PENPOT_MCP_WEBSOCKET_PORT` | Port for the WebSocket server (plugin connection) | `4402` |
| `PENPOT_MCP_REPL_PORT` | Port for the REPL server (development/debugging) | `4403` |
| `PENPOT_MCP_REPL_HOST` | Address on which the REPL server listens (binds to) | `localhost` |
@@ -298,8 +298,21 @@ The Penpot MCP server can be configured using environment variables.
| `PENPOT_MCP_REMOTE_MODE` | Enable remote mode (disables file system access). Set to `true` to enable. | `false` |
| `PENPOT_MCP_DEVENV` | Enable Penpot development environment tools in local single-user mode. Set to `true` to enable. | `false` |
| `PENPOT_MCP_TOOL_TIMEOUT_S` | Timeout, in seconds, for tool calls dispatched to the Penpot plugin | `120` |
+| `PENPOT_MCP_MAX_BODY_SIZE` | Maximum size of a JSON request body accepted by the MCP endpoint, in any format supported by Express (e.g. `10mb`) | `10mb` |
| `PENPOT_MCP_EXPORT_SHAPE_MAX_PARALLEL_REQUESTS` | Maximum number of parallel export shape requests (multi-user mode only). | `0` (no limit) |
+| `PENPOT_MCP_AUTH_URI` | Public base URL of the MCP authorization service, e.g. `https://penpot.example/api/mcp/oauth`. Set to enable OAuth; requires `--multi-user`. Use HTTPS (HTTP is allowed on loopback for development), without credentials, query parameters, or a fragment. | (unset; OAuth disabled) |
| `PENPOT_MCP_REDIS_URI` | Redis connection URI (e.g. `redis://host:6379`) enabling multi-instance horizontal scaling via Redis pub/sub task routing (multi-user mode only). When unset, the server runs in single-instance mode, requiring the plugin and MCP client to connect to the same instance. | (unset) |
+| `PENPOT_MCP_BACKEND_URI` | Penpot instance base URI. Setting a nonblank value enables tools that communicate with the Penpot backend (currently only the `submit_feedback` tool). The MCP server appends suffixes such as `api/main/methods/send-mcp-feedback`. Backend interactions require MCP user tokens to be provided. | (unset) |
+
+### Backend Configuration
+
+If `PENPOT_MCP_BACKEND_URI` is set, the backend must itself be configured correspondingly, i.e. set
+the following variables for the backend process:
+
+| Environment Variable | Description | Default |
+|----------------------|-------------|---------|
+| `PENPOT_MCP_FEEDBACK_EMAIL` | Selects the inbox for MCP feedback. Unset means the command rejects submissions. Requires the `enable-mcp` or `enable-access-tokens` flag and uses the backend's existing SMTP configuration. | (unset) |
+
### Logging Configuration
@@ -348,9 +361,10 @@ Some of the aforementioned configuration options control these modes.
* Auto-formatting: Use `pnpm run fmt`
* Generating API type data: See [types-generator/README.md](types-generator/README.md)
* Versioning: Use `bash scripts/set-version` to set the version for the MCP package (in `package.json`).
- - Ensure that at least the major, minor and patch components of the version are always up-to-date.
- - The MCP plugin assumes that a mismatch between the MCP version and the Penpot version (as returned by the API)
- indicates incompatibility, resulting in the display of a warning message in the plugin UI.
+ - Ensure that at least the major and minor components of the version are always up-to-date.
+ - The MCP plugin assumes that a mismatch between the major.minor components of the MCP version and the Penpot
+ version (as returned by the API) indicates incompatibility, resulting in the display of a warning message in
+ the plugin UI. Patch releases are treated as compatible.
* Packaging and publishing:
1. Ensure that the API type data is up-to-date (see above).
2. Ensure release version is set correctly in package.json (call `bash scripts/set-version` to update it automatically)
diff --git a/mcp/package.json b/mcp/package.json
index a62d084e1f..977047cf57 100644
--- a/mcp/package.json
+++ b/mcp/package.json
@@ -1,6 +1,6 @@
{
"name": "@penpot/mcp",
- "version": "2.17.0",
+ "version": "2.19.1",
"description": "MCP server for Penpot integration",
"license": "MPL-2.0",
"bin": {
@@ -23,9 +23,9 @@
"type": "git",
"url": "https://github.com/penpot/penpot.git"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"devDependencies": {
- "concurrently": "^10.0.5",
- "prettier": "^3.9.9"
+ "concurrently": "^10.0.6",
+ "prettier": "^3.9.10"
}
}
diff --git a/mcp/packages/browser-extension/.gitignore b/mcp/packages/browser-extension/.gitignore
new file mode 100644
index 0000000000..f06235c460
--- /dev/null
+++ b/mcp/packages/browser-extension/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+dist
diff --git a/mcp/packages/browser-extension/README.md b/mcp/packages/browser-extension/README.md
new file mode 100644
index 0000000000..21597628ae
--- /dev/null
+++ b/mcp/packages/browser-extension/README.md
@@ -0,0 +1,53 @@
+# Penpot MCP
+
+A Chrome and Firefox extension that keeps the browser from discarding Penpot tabs connected to
+MCP. A discarded tab reloads when the user returns to it, and loses its MCP session.
+
+## How it works
+
+- The content script asks the Penpot page for its MCP session. The page answers with the
+ session ID and connection status.
+- The background (a service worker in Chrome, an event page in Firefox) maps each session to
+ its tab and marks the tab as not discardable (`autoDiscardable: false`) until the session
+ ends.
+
+The popup lists the connected tabs.
+
+The icon is the Penpot logo; `public/icons/icon.svg` is its source. To redraw the PNGs after
+changing it:
+
+```sh
+for size in 16 32 48 128; do
+ rsvg-convert -w $size -h $size public/icons/icon.svg -o public/icons/icon-$size.png
+done
+```
+
+## Frozen tabs
+
+Chrome can also freeze a background page, which then cannot run the MCP plugin. The extension
+does not handle this: the Penpot page holds a shared Web Lock while its MCP connection is
+requested, and Chrome does not freeze a page holding one. Firefox does not freeze background
+pages.
+
+## Build and load
+
+From `mcp/`:
+
+```sh
+pnpm install
+pnpm --filter mcp-common run build
+pnpm --filter mcp-browser-extension run build
+```
+
+The build writes one extension per browser, in `dist/chrome` and `dist/firefox`.
+
+- **Chrome:** open `chrome://extensions`, turn on developer mode, choose "Load unpacked" and
+ pick `mcp/packages/browser-extension/dist/chrome`.
+- **Firefox** (140 or later): open `about:debugging#/runtime/this-firefox`, choose "Load
+ Temporary Add-on…" and pick `mcp/packages/browser-extension/dist/firefox/manifest.json`.
+ Firefox removes temporary add-ons when it closes.
+
+Reload Penpot tabs opened before the extension was loaded, so the content script runs in them.
+
+The content script runs on `https://design.penpot.app`, on the test environments under
+`https://*.penpot.dev` and on `localhost` at any port.
diff --git a/mcp/packages/browser-extension/package.json b/mcp/packages/browser-extension/package.json
new file mode 100644
index 0000000000..43a5c4d8fd
--- /dev/null
+++ b/mcp/packages/browser-extension/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "mcp-browser-extension",
+ "private": true,
+ "version": "0.1.0",
+ "description": "Browser extension that keeps Penpot tabs connected to MCP from being discarded",
+ "type": "module",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
+ "scripts": {
+ "build": "tsc && node ./scripts/build.mjs",
+ "test": "tsx --test \"src/**/*.test.ts\"",
+ "types:check": "tsc",
+ "clean": "rm -rf dist/"
+ },
+ "devDependencies": {
+ "@penpot/mcp-common": "workspace:../common",
+ "@types/chrome": "^0.3.6",
+ "esbuild": "^0.28.2",
+ "tsx": "^4.23.15",
+ "typescript": "^6.0.3"
+ }
+}
diff --git a/mcp/packages/browser-extension/public/icons/icon-128.png b/mcp/packages/browser-extension/public/icons/icon-128.png
new file mode 100644
index 0000000000..a545f42dd5
Binary files /dev/null and b/mcp/packages/browser-extension/public/icons/icon-128.png differ
diff --git a/mcp/packages/browser-extension/public/icons/icon-16.png b/mcp/packages/browser-extension/public/icons/icon-16.png
new file mode 100644
index 0000000000..3e6eb3e20e
Binary files /dev/null and b/mcp/packages/browser-extension/public/icons/icon-16.png differ
diff --git a/mcp/packages/browser-extension/public/icons/icon-32.png b/mcp/packages/browser-extension/public/icons/icon-32.png
new file mode 100644
index 0000000000..31f2fe30e5
Binary files /dev/null and b/mcp/packages/browser-extension/public/icons/icon-32.png differ
diff --git a/mcp/packages/browser-extension/public/icons/icon-48.png b/mcp/packages/browser-extension/public/icons/icon-48.png
new file mode 100644
index 0000000000..f92dd70100
Binary files /dev/null and b/mcp/packages/browser-extension/public/icons/icon-48.png differ
diff --git a/mcp/packages/browser-extension/public/icons/icon.svg b/mcp/packages/browser-extension/public/icons/icon.svg
new file mode 100644
index 0000000000..b12e54c10e
--- /dev/null
+++ b/mcp/packages/browser-extension/public/icons/icon.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/mcp/packages/browser-extension/public/popup.css b/mcp/packages/browser-extension/public/popup.css
new file mode 100644
index 0000000000..acbc7ba3dd
--- /dev/null
+++ b/mcp/packages/browser-extension/public/popup.css
@@ -0,0 +1,54 @@
+:root {
+ color-scheme: light dark;
+ --text: #1f1f1f;
+ --muted: #6b6b6b;
+ --background: #ffffff;
+}
+
+@media (prefers-color-scheme: dark) {
+ :root {
+ --text: #ededed;
+ --muted: #a0a0a0;
+ --background: #1f1f1f;
+ }
+}
+
+body {
+ width: 320px;
+ margin: 0;
+ padding: 12px 16px;
+ font:
+ 13px/1.4 system-ui,
+ sans-serif;
+ color: var(--text);
+ background: var(--background);
+}
+
+h1 {
+ margin: 0 0 12px;
+ font-size: 15px;
+}
+
+h2 {
+ margin: 16px 0 4px;
+ font-size: 12px;
+ text-transform: uppercase;
+ color: var(--muted);
+}
+
+.note {
+ margin: 0;
+ color: var(--muted);
+}
+
+ul {
+ margin: 0;
+ padding-left: 18px;
+ overflow-wrap: anywhere;
+}
+
+li.empty {
+ list-style: none;
+ margin-left: -18px;
+ color: var(--muted);
+}
diff --git a/mcp/packages/browser-extension/public/popup.html b/mcp/packages/browser-extension/public/popup.html
new file mode 100644
index 0000000000..778829cfab
--- /dev/null
+++ b/mcp/packages/browser-extension/public/popup.html
@@ -0,0 +1,15 @@
+
+
+
+
+ Penpot MCP
+
+
+
+ Penpot MCP
+ The browser does not discard these tabs while they are connected to MCP.
+ Connected tabs
+
+
+
+
diff --git a/mcp/packages/browser-extension/scripts/build.mjs b/mcp/packages/browser-extension/scripts/build.mjs
new file mode 100644
index 0000000000..6d7b6b3069
--- /dev/null
+++ b/mcp/packages/browser-extension/scripts/build.mjs
@@ -0,0 +1,18 @@
+import { build } from "esbuild";
+import { cp, rm, writeFile } from "node:fs/promises";
+import { BROWSERS, createManifest } from "./manifest.mjs";
+
+const TARGETS = { chrome: "chrome116", firefox: "firefox140" };
+
+await rm("dist", { recursive: true, force: true });
+for (const browser of BROWSERS) {
+ const outdir = `dist/${browser}`;
+ const options = { bundle: true, target: TARGETS[browser], outdir, logLevel: "info" };
+ // Chrome loads the service worker as a module, Firefox the event page as a classic script
+ await build({ ...options, entryPoints: ["src/background.ts"], format: browser === "chrome" ? "esm" : "iife" });
+ await build({ ...options, entryPoints: ["src/popup.ts"], format: "esm" });
+ // content scripts load as classic scripts
+ await build({ ...options, entryPoints: ["src/content.ts"], format: "iife" });
+ await cp("public", outdir, { recursive: true });
+ await writeFile(`${outdir}/manifest.json`, JSON.stringify(createManifest(browser), null, 4) + "\n");
+}
diff --git a/mcp/packages/browser-extension/scripts/manifest.mjs b/mcp/packages/browser-extension/scripts/manifest.mjs
new file mode 100644
index 0000000000..5b11972c55
--- /dev/null
+++ b/mcp/packages/browser-extension/scripts/manifest.mjs
@@ -0,0 +1,61 @@
+/** Browsers the extension is built for, one directory of `dist/` each. */
+export const BROWSERS = ["chrome", "firefox"];
+
+const ICONS = {
+ 16: "icons/icon-16.png",
+ 32: "icons/icon-32.png",
+ 48: "icons/icon-48.png",
+ 128: "icons/icon-128.png",
+};
+
+const CONTENT_SCRIPTS = [
+ {
+ matches: ["https://design.penpot.app/*", "https://*.penpot.dev/*", "https://localhost/*", "http://localhost/*"],
+ js: ["content.js"],
+ run_at: "document_idle",
+ },
+];
+
+/**
+ * Creates the extension manifest for a browser.
+ *
+ * Chrome runs the background as a module service worker. Firefox runs it as an event page and
+ * needs an add-on ID.
+ *
+ * @param {"chrome" | "firefox"} browser - The browser to build for
+ */
+export function createManifest(browser) {
+ const common = {
+ manifest_version: 3,
+ name: "Penpot MCP",
+ version: "0.1.0",
+ description: "Keeps the browser from discarding Penpot tabs connected to MCP.",
+ icons: ICONS,
+ permissions: ["storage"],
+ action: {
+ default_title: "Penpot MCP",
+ default_popup: "popup.html",
+ default_icon: { 16: ICONS[16], 32: ICONS[32] },
+ },
+ content_scripts: CONTENT_SCRIPTS,
+ };
+ if (browser === "chrome") {
+ return {
+ ...common,
+ minimum_chrome_version: "116",
+ background: { service_worker: "background.js", type: "module" },
+ };
+ }
+ return {
+ ...common,
+ background: { scripts: ["background.js"] },
+ browser_specific_settings: {
+ gecko: {
+ id: "mcp-extension@penpot.app",
+ // the first version that knows data_collection_permissions
+ strict_min_version: "140.0",
+ data_collection_permissions: { required: ["none"] },
+ },
+ },
+ };
+}
diff --git a/mcp/packages/browser-extension/src/DiscardGuard.ts b/mcp/packages/browser-extension/src/DiscardGuard.ts
new file mode 100644
index 0000000000..a50b06d682
--- /dev/null
+++ b/mcp/packages/browser-extension/src/DiscardGuard.ts
@@ -0,0 +1,28 @@
+import type { SessionChange, SessionMapObserver } from "./SessionMap.ts";
+
+/** Browser control over the automatic discarding of tabs. */
+export interface DiscardControl {
+ setAutoDiscardable(tabId: number, autoDiscardable: boolean): Promise;
+}
+
+/**
+ * Keeps the browser from discarding tabs that hold an MCP session, since a discarded tab reloads
+ * and loses its MCP connection. Tabs regain automatic discarding when they stop holding a session.
+ */
+export class DiscardGuard implements SessionMapObserver {
+ constructor(private readonly control: DiscardControl) {}
+
+ sessionsChanged(change: SessionChange): void {
+ for (const tabId of change.tabsAdded) {
+ this.set(tabId, false);
+ }
+ for (const tabId of change.tabsRemoved) {
+ this.set(tabId, true);
+ }
+ }
+
+ private set(tabId: number, autoDiscardable: boolean): void {
+ // the tab may have been closed meanwhile
+ this.control.setAutoDiscardable(tabId, autoDiscardable).catch(() => {});
+ }
+}
diff --git a/mcp/packages/browser-extension/src/PageBridge.test.ts b/mcp/packages/browser-extension/src/PageBridge.test.ts
new file mode 100644
index 0000000000..afaeabd048
--- /dev/null
+++ b/mcp/packages/browser-extension/src/PageBridge.test.ts
@@ -0,0 +1,102 @@
+import assert from "node:assert/strict";
+import { beforeEach, test } from "node:test";
+import type { ContentMessage } from "./messages.ts";
+import { PageBridge, type PageWindow, type WorkerChannel } from "./PageBridge.ts";
+
+const ORIGIN = "https://design.penpot.app";
+
+/** Page recording what the bridge posts and dispatching events to it. */
+class FakePage implements PageWindow {
+ readonly location = { origin: ORIGIN };
+ readonly posted: { message: unknown; targetOrigin: string }[] = [];
+ private readonly listeners = new Map void)[]>();
+
+ postMessage(message: unknown, targetOrigin: string): void {
+ this.posted.push({ message, targetOrigin });
+ }
+
+ addEventListener(type: string, listener: (event: any) => void): void {
+ this.listeners.set(type, [...(this.listeners.get(type) ?? []), listener]);
+ }
+
+ dispatch(type: string, event: object = {}): void {
+ for (const listener of this.listeners.get(type) ?? []) listener(event);
+ }
+
+ /** Posts a message on the page as the Penpot app does. */
+ post(data: unknown, origin = ORIGIN, source: unknown = this): void {
+ this.dispatch("message", { data, origin, source });
+ }
+}
+
+/** Worker channel recording what the bridge sends. */
+class FakeWorker implements WorkerChannel {
+ readonly received: ContentMessage[] = [];
+
+ async sendMessage(message: ContentMessage): Promise {
+ this.received.push(message);
+ return undefined;
+ }
+}
+
+const announcement = { type: "penpot-mcp:session", sessionId: "abcdefghij", status: "connected" };
+
+let page: FakePage;
+let worker: FakeWorker;
+
+beforeEach(() => {
+ page = new FakePage();
+ worker = new FakeWorker();
+ new PageBridge(page, worker).start();
+});
+
+test("asks the page for its session on start, restricted to the page's origin", () => {
+ assert.deepEqual(page.posted, [{ message: { type: "penpot-mcp-extension:hello" }, targetOrigin: ORIGIN }]);
+});
+
+test("says hello again when the page reports it has started listening", () => {
+ page.post({ type: "penpot-mcp:ready" });
+ page.post({ type: "penpot-mcp:ready" }, "https://evil.example");
+ assert.equal(page.posted.length, 2);
+ assert.deepEqual(page.posted[1], { message: { type: "penpot-mcp-extension:hello" }, targetOrigin: ORIGIN });
+});
+
+test("forwards the page's session announcements to the worker", () => {
+ page.post(announcement);
+ assert.deepEqual(worker.received, [{ type: "session", announcement }]);
+});
+
+test("ignores announcements from other origins or other windows", () => {
+ page.post(announcement, "https://evil.example");
+ page.post(announcement, ORIGIN, {});
+ assert.deepEqual(worker.received, []);
+});
+
+test("ignores invalid announcements and its own hello", () => {
+ page.post({ ...announcement, status: "unknown" });
+ page.post({ type: "penpot-mcp-extension:hello" });
+ assert.deepEqual(worker.received, []);
+});
+
+test("reports a hidden page and asks again when it returns from the back/forward cache", () => {
+ page.dispatch("pagehide");
+ page.dispatch("pageshow", { persisted: false });
+ assert.equal(page.posted.length, 1);
+ page.dispatch("pageshow", { persisted: true });
+ assert.deepEqual(worker.received, [{ type: "page-hidden" }]);
+ assert.equal(page.posted.length, 2);
+});
+
+test("keeps working when the worker cannot be reached", () => {
+ const failing = new FakePage();
+ new PageBridge(failing, {
+ sendMessage: () => {
+ throw new Error("Extension context invalidated.");
+ },
+ }).start();
+ failing.post(announcement);
+ new PageBridge(failing, {
+ sendMessage: () => Promise.reject(new Error("No receiver")),
+ }).start();
+ failing.post(announcement);
+});
diff --git a/mcp/packages/browser-extension/src/PageBridge.ts b/mcp/packages/browser-extension/src/PageBridge.ts
new file mode 100644
index 0000000000..42a0a54887
--- /dev/null
+++ b/mcp/packages/browser-extension/src/PageBridge.ts
@@ -0,0 +1,69 @@
+import type { ExtensionHello } from "@penpot/mcp-common";
+import { parseAnnouncement, type ContentMessage } from "./messages.ts";
+
+/** Page operations the bridge uses; the content script passes its window. */
+export interface PageWindow {
+ readonly location: { readonly origin: string };
+ postMessage(message: unknown, targetOrigin: string): void;
+ addEventListener(type: string, listener: (event: any) => void): void;
+}
+
+/** Channel from the content script to the service worker. */
+export interface WorkerChannel {
+ sendMessage(message: ContentMessage): Promise;
+}
+
+/**
+ * Relays the MCP session announced by a Penpot page to the extension's service worker.
+ *
+ * The bridge asks the page for its session on load, when the page reports it has started
+ * listening, and when the page returns from the back/forward cache. It accepts only messages the
+ * page posted on its own window from its own origin.
+ */
+export class PageBridge {
+ constructor(
+ private readonly page: PageWindow,
+ private readonly worker: WorkerChannel
+ ) {}
+
+ /** Starts listening to the page and asks it for its session. */
+ start(): void {
+ this.page.addEventListener("message", (event: MessageEvent) => this.handleMessage(event));
+ this.page.addEventListener("pagehide", () => this.send({ type: "page-hidden" }));
+ this.page.addEventListener("pageshow", (event: PageTransitionEvent) => {
+ if (event.persisted) {
+ this.sayHello();
+ }
+ });
+ this.sayHello();
+ }
+
+ private sayHello(): void {
+ const hello: ExtensionHello = { type: "penpot-mcp-extension:hello" };
+ this.page.postMessage(hello, this.page.location.origin);
+ }
+
+ private handleMessage(event: MessageEvent): void {
+ if (event.source !== this.page || event.origin !== this.page.location.origin) {
+ return;
+ }
+ // the page started listening after the hello sent on load
+ if (event.data?.type === "penpot-mcp:ready") {
+ this.sayHello();
+ return;
+ }
+ const announcement = parseAnnouncement(event.data);
+ if (announcement) {
+ this.send({ type: "session", announcement });
+ }
+ }
+
+ private send(message: ContentMessage): void {
+ try {
+ // the worker cannot be reached after the extension is reloaded or removed
+ this.worker.sendMessage(message).catch(() => {});
+ } catch {
+ // ignored for the same reason
+ }
+ }
+}
diff --git a/mcp/packages/browser-extension/src/PopupState.test.ts b/mcp/packages/browser-extension/src/PopupState.test.ts
new file mode 100644
index 0000000000..94a1b9d892
--- /dev/null
+++ b/mcp/packages/browser-extension/src/PopupState.test.ts
@@ -0,0 +1,13 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { getPopupState } from "./PopupState.ts";
+import { SessionMap } from "./SessionMap.ts";
+
+test("lists the sessions and their tabs", async () => {
+ const sessions = new SessionMap({ load: async () => undefined, save: async () => {} });
+ await sessions.announce(
+ { tabId: 7, windowId: 1 },
+ { type: "penpot-mcp:session", sessionId: "tab", status: "connected" }
+ );
+ assert.deepEqual(getPopupState(sessions), { sessions: [{ sessionId: "tab", tabId: 7 }] });
+});
diff --git a/mcp/packages/browser-extension/src/PopupState.ts b/mcp/packages/browser-extension/src/PopupState.ts
new file mode 100644
index 0000000000..1bf6678a69
--- /dev/null
+++ b/mcp/packages/browser-extension/src/PopupState.ts
@@ -0,0 +1,22 @@
+import type { SessionMap } from "./SessionMap.ts";
+
+/** Request of the popup for the extension's state. */
+export interface PopupStateRequest {
+ type: "popup:get-state";
+}
+
+/** State of the extension shown in the popup. */
+export interface PopupState {
+ sessions: { sessionId: string; tabId: number }[];
+}
+
+/**
+ * Collects the state shown in the popup.
+ *
+ * @param sessions - The map of sessions to tabs
+ */
+export function getPopupState(sessions: SessionMap): PopupState {
+ return {
+ sessions: sessions.all().map(([sessionId, entry]) => ({ sessionId, tabId: entry.tabId })),
+ };
+}
diff --git a/mcp/packages/browser-extension/src/SessionMap.test.ts b/mcp/packages/browser-extension/src/SessionMap.test.ts
new file mode 100644
index 0000000000..38e31fa874
--- /dev/null
+++ b/mcp/packages/browser-extension/src/SessionMap.test.ts
@@ -0,0 +1,125 @@
+import assert from "node:assert/strict";
+import { beforeEach, test } from "node:test";
+import type { SessionAnnouncement } from "@penpot/mcp-common";
+import { DiscardGuard } from "./DiscardGuard.ts";
+import { SessionMap, type SessionChange, type SessionEntry, type SessionStore } from "./SessionMap.ts";
+
+/** In-memory store standing in for session storage. */
+class MemoryStore implements SessionStore {
+ constructor(public saved?: Record) {}
+
+ async load() {
+ return this.saved;
+ }
+
+ async save(entries: Record) {
+ this.saved = structuredClone(entries);
+ }
+}
+
+const TAB = { tabId: 1, windowId: 10 };
+const OTHER_TAB = { tabId: 2, windowId: 10 };
+
+function announcement(
+ status: SessionAnnouncement["status"],
+ sessionId: string | null = "session"
+): SessionAnnouncement {
+ return { type: "penpot-mcp:session", sessionId, status };
+}
+
+let store: MemoryStore;
+let changes: SessionChange[];
+let sessions: SessionMap;
+
+beforeEach(() => {
+ store = new MemoryStore();
+ changes = [];
+ sessions = new SessionMap(store);
+ sessions.observe({ sessionsChanged: (change) => changes.push(change) });
+});
+
+test("maps a connected session to the announcing tab and saves it", async () => {
+ await sessions.announce(TAB, announcement("connected"));
+ assert.deepEqual(sessions.get("session"), TAB);
+ assert.deepEqual(store.saved, { session: TAB });
+ assert.deepEqual(changes, [{ tabsAdded: [1], tabsRemoved: [] }]);
+});
+
+test("ignores announcements without a connected session", async () => {
+ await sessions.announce(TAB, announcement("connecting", null));
+ await sessions.announce(TAB, announcement("connected", null));
+ await sessions.announce(TAB, announcement("error"));
+ assert.deepEqual(sessions.all(), []);
+ assert.deepEqual(changes, []);
+});
+
+test("keeps the session while the plugin reconnects", async () => {
+ await sessions.announce(TAB, announcement("connected"));
+ await sessions.announce(TAB, announcement("connecting"));
+ await sessions.announce(TAB, announcement("connected"));
+ assert.equal(sessions.get("session")?.tabId, 1);
+ assert.equal(changes.length, 1);
+});
+
+test("forgets the tab's session when its page announces a disconnect", async () => {
+ await sessions.announce(TAB, announcement("connected"));
+ await sessions.announce(TAB, announcement("disconnected", null));
+ assert.equal(sessions.get("session"), undefined);
+ assert.deepEqual(changes.at(-1), { tabsAdded: [], tabsRemoved: [1] });
+});
+
+test("a tab holds only the session it announced last", async () => {
+ await sessions.announce(TAB, announcement("connected", "old"));
+ await sessions.announce(TAB, announcement("connected", "new"));
+ assert.equal(sessions.get("old"), undefined);
+ assert.equal(sessions.get("new")?.tabId, 1);
+ assert.deepEqual(changes.at(-1), { tabsAdded: [], tabsRemoved: [] });
+});
+
+test("forgets only the sessions of a removed tab", async () => {
+ await sessions.announce(TAB, announcement("connected", "first"));
+ await sessions.announce(OTHER_TAB, announcement("connected", "second"));
+ await sessions.removeTab(1);
+ assert.deepEqual(
+ sessions.all().map(([sessionId]) => sessionId),
+ ["second"]
+ );
+ assert.deepEqual(changes.at(-1), { tabsAdded: [], tabsRemoved: [1] });
+});
+
+test("restores the saved sessions when the worker restarts", async () => {
+ await sessions.announce(TAB, announcement("connected"));
+ const restarted = new SessionMap(store);
+ await restarted.ready();
+ assert.equal(restarted.get("session")?.tabId, 1);
+});
+
+test("changes made while restoring apply to the restored sessions", async () => {
+ const saved = new MemoryStore({ first: TAB });
+ const restored = new SessionMap(saved);
+ await restored.announce(OTHER_TAB, announcement("connected", "second"));
+ assert.deepEqual(Object.keys(saved.saved!).sort(), ["first", "second"]);
+});
+
+test("the discard guard protects tabs holding a session and releases them after", async () => {
+ const calls: [number, boolean][] = [];
+ const guard = new DiscardGuard({
+ setAutoDiscardable: async (tabId, autoDiscardable) => {
+ calls.push([tabId, autoDiscardable]);
+ },
+ });
+ const guarded = new SessionMap(new MemoryStore());
+ guarded.observe(guard);
+ await guarded.announce(TAB, announcement("connected"));
+ await guarded.removeTab(1);
+ assert.deepEqual(calls, [
+ [1, false],
+ [1, true],
+ ]);
+});
+
+test("the discard guard ignores tabs closed meanwhile", async () => {
+ const guard = new DiscardGuard({ setAutoDiscardable: () => Promise.reject(new Error("No tab with id")) });
+ guard.sessionsChanged({ tabsAdded: [1], tabsRemoved: [2] });
+ await new Promise((resolve) => setImmediate(resolve));
+});
diff --git a/mcp/packages/browser-extension/src/SessionMap.ts b/mcp/packages/browser-extension/src/SessionMap.ts
new file mode 100644
index 0000000000..53eca8e1e2
--- /dev/null
+++ b/mcp/packages/browser-extension/src/SessionMap.ts
@@ -0,0 +1,129 @@
+import type { SessionAnnouncement } from "@penpot/mcp-common";
+
+/** The tab holding an MCP session. */
+export interface SessionEntry {
+ tabId: number;
+ windowId: number;
+}
+
+/** Persistence of the session map across service worker restarts. */
+export interface SessionStore {
+ load(): Promise | undefined>;
+ save(entries: Record): Promise;
+}
+
+/** Change of the tabs holding sessions, reported after each change of the map. */
+export interface SessionChange {
+ /** tabs that hold a session and held none before. */
+ tabsAdded: number[];
+ /** tabs that held a session and hold none now. */
+ tabsRemoved: number[];
+}
+
+/** Receiver of the changes of a session map. */
+export interface SessionMapObserver {
+ sessionsChanged(change: SessionChange): void;
+}
+
+/**
+ * Map from MCP session IDs to the tabs holding them.
+ *
+ * A tab holds the session it last announced as connected, until it announces a disconnect, is
+ * hidden or is closed. The map is saved after each change and restored when the service worker
+ * restarts.
+ */
+export class SessionMap {
+ private entries = new Map();
+ private readonly observers: SessionMapObserver[] = [];
+ private readonly loaded: Promise;
+
+ constructor(private readonly store: SessionStore) {
+ this.loaded = store.load().then(
+ (saved) => {
+ this.entries = new Map(Object.entries(saved ?? {}));
+ },
+ () => {}
+ );
+ }
+
+ /** Adds a receiver of the changes of this map. */
+ observe(observer: SessionMapObserver): void {
+ this.observers.push(observer);
+ }
+
+ /** Resolves once the saved entries have been restored. */
+ ready(): Promise {
+ return this.loaded;
+ }
+
+ /**
+ * Records a session announcement made by the page in a tab.
+ *
+ * @param tab - The tab and window of the announcing page
+ * @param announcement - The page's announcement
+ */
+ async announce(tab: { tabId: number; windowId: number }, announcement: SessionAnnouncement): Promise {
+ await this.loaded;
+ if (announcement.status === "disconnected") {
+ await this.change(() => this.deleteTab(tab.tabId));
+ } else if (announcement.status === "connected" && announcement.sessionId) {
+ const { sessionId } = announcement;
+ await this.change(() => {
+ // a tab holds a single session
+ this.deleteTab(tab.tabId);
+ this.entries.set(sessionId, { ...tab });
+ });
+ }
+ }
+
+ /**
+ * Forgets the sessions held by a tab.
+ *
+ * @param tabId - The tab whose page was hidden, or which was closed or replaced
+ */
+ async removeTab(tabId: number): Promise {
+ await this.loaded;
+ await this.change(() => this.deleteTab(tabId));
+ }
+
+ /** Returns the entry of a session, if a tab holds it. */
+ get(sessionId: string): SessionEntry | undefined {
+ return this.entries.get(sessionId);
+ }
+
+ /** Returns all sessions with their entries. */
+ all(): [string, SessionEntry][] {
+ return [...this.entries];
+ }
+
+ /** Applies a change, then saves the map and reports the change if any tab gained or lost a session. */
+ private async change(apply: () => void): Promise {
+ const before = this.tabs();
+ const snapshot = JSON.stringify([...this.entries]);
+ apply();
+ if (JSON.stringify([...this.entries]) === snapshot) {
+ return;
+ }
+ const after = this.tabs();
+ await this.store.save(Object.fromEntries(this.entries));
+ const change = {
+ tabsAdded: [...after].filter((tabId) => !before.has(tabId)),
+ tabsRemoved: [...before].filter((tabId) => !after.has(tabId)),
+ };
+ for (const observer of this.observers) {
+ observer.sessionsChanged(change);
+ }
+ }
+
+ private deleteTab(tabId: number): void {
+ for (const [sessionId, entry] of [...this.entries]) {
+ if (entry.tabId === tabId) {
+ this.entries.delete(sessionId);
+ }
+ }
+ }
+
+ private tabs(): Set {
+ return new Set([...this.entries.values()].map((entry) => entry.tabId));
+ }
+}
diff --git a/mcp/packages/browser-extension/src/background.ts b/mcp/packages/browser-extension/src/background.ts
new file mode 100644
index 0000000000..fc4f6ddf43
--- /dev/null
+++ b/mcp/packages/browser-extension/src/background.ts
@@ -0,0 +1,44 @@
+/**
+ * Service worker of the Penpot MCP extension.
+ *
+ * It keeps the map from MCP sessions to the tabs holding them, and keeps the browser from
+ * discarding those tabs.
+ *
+ * Chrome may stop the worker, and Firefox its event page, at any time, so listeners are
+ * registered synchronously at start and state lives in session storage.
+ */
+import { ChromeDiscardControl, ChromeSessionStore } from "./chrome.ts";
+import { DiscardGuard } from "./DiscardGuard.ts";
+import { parseAnnouncement, type ContentMessage } from "./messages.ts";
+import { getPopupState, type PopupStateRequest } from "./PopupState.ts";
+import { SessionMap } from "./SessionMap.ts";
+
+const sessions = new SessionMap(new ChromeSessionStore());
+sessions.observe(new DiscardGuard(new ChromeDiscardControl()));
+
+chrome.runtime.onMessage.addListener((message: ContentMessage | PopupStateRequest, sender, sendResponse) => {
+ if (sender.id !== chrome.runtime.id) {
+ return;
+ }
+ const tab = sender.tab;
+ if (message?.type === "popup:get-state" && !tab) {
+ void sessions.ready().then(() => sendResponse(getPopupState(sessions)));
+ // the response is sent asynchronously
+ return true;
+ }
+ if (tab?.id === undefined) {
+ return;
+ }
+ if (message?.type === "page-hidden") {
+ void sessions.removeTab(tab.id);
+ } else if (message?.type === "session") {
+ const announcement = parseAnnouncement(message.announcement);
+ if (announcement) {
+ void sessions.announce({ tabId: tab.id, windowId: tab.windowId }, announcement);
+ }
+ }
+});
+
+chrome.tabs.onRemoved.addListener((tabId) => void sessions.removeTab(tabId));
+
+chrome.tabs.onReplaced.addListener((_addedTabId, removedTabId) => void sessions.removeTab(removedTabId));
diff --git a/mcp/packages/browser-extension/src/chrome.ts b/mcp/packages/browser-extension/src/chrome.ts
new file mode 100644
index 0000000000..38954c7ced
--- /dev/null
+++ b/mcp/packages/browser-extension/src/chrome.ts
@@ -0,0 +1,26 @@
+import type { DiscardControl } from "./DiscardGuard.ts";
+import type { SessionEntry, SessionStore } from "./SessionMap.ts";
+
+const SESSIONS_KEY = "sessions";
+
+/**
+ * Session store in `chrome.storage.session`, which lives in memory, survives service worker
+ * restarts and clears when the browser closes.
+ */
+export class ChromeSessionStore implements SessionStore {
+ async load(): Promise | undefined> {
+ const stored = await chrome.storage.session.get(SESSIONS_KEY);
+ return stored[SESSIONS_KEY] as Record | undefined;
+ }
+
+ async save(entries: Record): Promise {
+ await chrome.storage.session.set({ [SESSIONS_KEY]: entries });
+ }
+}
+
+/** Discard control through the Chrome tabs API. */
+export class ChromeDiscardControl implements DiscardControl {
+ async setAutoDiscardable(tabId: number, autoDiscardable: boolean): Promise {
+ await chrome.tabs.update(tabId, { autoDiscardable });
+ }
+}
diff --git a/mcp/packages/browser-extension/src/content.ts b/mcp/packages/browser-extension/src/content.ts
new file mode 100644
index 0000000000..1e115228a4
--- /dev/null
+++ b/mcp/packages/browser-extension/src/content.ts
@@ -0,0 +1,3 @@
+import { PageBridge } from "./PageBridge.ts";
+
+new PageBridge(window, chrome.runtime).start();
diff --git a/mcp/packages/browser-extension/src/manifest.test.ts b/mcp/packages/browser-extension/src/manifest.test.ts
new file mode 100644
index 0000000000..f78006c58a
--- /dev/null
+++ b/mcp/packages/browser-extension/src/manifest.test.ts
@@ -0,0 +1,45 @@
+import assert from "node:assert/strict";
+import { access } from "node:fs/promises";
+import test from "node:test";
+import { BROWSERS, createManifest } from "../scripts/manifest.mjs";
+
+const manifests = BROWSERS.map((browser) => createManifest(browser));
+const [chrome, firefox] = manifests;
+
+test("runs the background as a module service worker in Chrome and as an event page in Firefox", () => {
+ assert.deepEqual(chrome.background, { service_worker: "background.js", type: "module" });
+ assert.deepEqual(firefox.background, { scripts: ["background.js"] });
+});
+
+test("requests only storage", () => {
+ for (const manifest of manifests) {
+ assert.equal(manifest.manifest_version, 3);
+ assert.deepEqual(manifest.permissions, ["storage"]);
+ assert.equal(manifest.optional_permissions, undefined);
+ assert.equal(manifest.host_permissions, undefined);
+ }
+});
+
+test("gives the Firefox build an add-on ID and a minimum version", () => {
+ assert.deepEqual(firefox.browser_specific_settings, {
+ gecko: {
+ id: "mcp-extension@penpot.app",
+ strict_min_version: "140.0",
+ data_collection_permissions: { required: ["none"] },
+ },
+ });
+ assert.equal(chrome.browser_specific_settings, undefined);
+});
+
+test("references icons and a popup that exist in public/", async () => {
+ for (const manifest of manifests) {
+ const paths = [
+ ...Object.values(manifest.icons as Record),
+ ...Object.values(manifest.action.default_icon as Record),
+ manifest.action.default_popup,
+ ];
+ for (const path of paths) {
+ await access(new URL(`../public/${path}`, import.meta.url));
+ }
+ }
+});
diff --git a/mcp/packages/browser-extension/src/messages.test.ts b/mcp/packages/browser-extension/src/messages.test.ts
new file mode 100644
index 0000000000..14040124e5
--- /dev/null
+++ b/mcp/packages/browser-extension/src/messages.test.ts
@@ -0,0 +1,28 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { parseAnnouncement } from "./messages.ts";
+
+const announcement = { type: "penpot-mcp:session", sessionId: "abcdefghij", status: "connected" };
+
+test("accepts session announcements, with or without a session ID", () => {
+ for (const data of [announcement, { ...announcement, sessionId: null, status: "connecting" }]) {
+ assert.deepEqual(parseAnnouncement(data), data);
+ }
+});
+
+test("keeps only the announcement fields", () => {
+ assert.deepEqual(parseAnnouncement({ ...announcement, extra: 1 }), announcement);
+});
+
+test("rejects other messages and malformed announcements", () => {
+ for (const data of [
+ null,
+ "penpot-mcp:session",
+ { ...announcement, type: "penpot-mcp-extension:hello" },
+ { ...announcement, sessionId: "" },
+ { ...announcement, sessionId: 42 },
+ { ...announcement, status: "frozen" },
+ ]) {
+ assert.equal(parseAnnouncement(data), null, JSON.stringify(data));
+ }
+});
diff --git a/mcp/packages/browser-extension/src/messages.ts b/mcp/packages/browser-extension/src/messages.ts
new file mode 100644
index 0000000000..e55644973e
--- /dev/null
+++ b/mcp/packages/browser-extension/src/messages.ts
@@ -0,0 +1,32 @@
+import type { McpConnectionStatus, SessionAnnouncement } from "@penpot/mcp-common";
+
+/**
+ * Message sent by the content script to the service worker.
+ *
+ * - `session`: the page announced its MCP session
+ * - `page-hidden`: the page is being unloaded or stored in the back/forward cache
+ */
+export type ContentMessage = { type: "session"; announcement: SessionAnnouncement } | { type: "page-hidden" };
+
+const STATUSES: readonly McpConnectionStatus[] = ["idle", "connecting", "connected", "disconnected", "error"];
+
+function isSessionId(value: unknown): value is string | null {
+ return value === null || (typeof value === "string" && value.length > 0 && value.length <= 128);
+}
+
+/**
+ * Validates a session announcement posted on the page.
+ *
+ * @param data - The data of a window message
+ * @returns The announcement, or null if the data is not a valid announcement
+ */
+export function parseAnnouncement(data: unknown): SessionAnnouncement | null {
+ if (typeof data !== "object" || data === null) {
+ return null;
+ }
+ const { type, sessionId, status } = data as Record;
+ if (type !== "penpot-mcp:session" || !isSessionId(sessionId) || !STATUSES.includes(status as McpConnectionStatus)) {
+ return null;
+ }
+ return { type, sessionId, status: status as McpConnectionStatus };
+}
diff --git a/mcp/packages/browser-extension/src/popup.ts b/mcp/packages/browser-extension/src/popup.ts
new file mode 100644
index 0000000000..fa29fac3fb
--- /dev/null
+++ b/mcp/packages/browser-extension/src/popup.ts
@@ -0,0 +1,28 @@
+import type { PopupState, PopupStateRequest } from "./PopupState.ts";
+
+const REFRESH_INTERVAL_MS = 1_000;
+
+const sessionsList = document.getElementById("sessions") as HTMLUListElement;
+
+function render(state: PopupState): void {
+ const items = state.sessions.map((session) => `${session.sessionId} (tab ${session.tabId})`);
+ sessionsList.replaceChildren(
+ ...(items.length ? items : ["No Penpot tab is connected to MCP."]).map((text) => {
+ const item = document.createElement("li");
+ item.textContent = text;
+ item.classList.toggle("empty", items.length === 0);
+ return item;
+ })
+ );
+}
+
+async function refresh(): Promise {
+ const request: PopupStateRequest = { type: "popup:get-state" };
+ const state: PopupState | undefined = await chrome.runtime.sendMessage(request);
+ if (state) {
+ render(state);
+ }
+}
+
+void refresh();
+setInterval(() => void refresh(), REFRESH_INTERVAL_MS);
diff --git a/mcp/packages/browser-extension/tsconfig.json b/mcp/packages/browser-extension/tsconfig.json
new file mode 100644
index 0000000000..b05f0b7842
--- /dev/null
+++ b/mcp/packages/browser-extension/tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "lib": ["ES2022", "DOM"],
+ "types": ["chrome"],
+ "skipLibCheck": true,
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "isolatedModules": true,
+ "verbatimModuleSyntax": true,
+ "noEmit": true,
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["src"],
+ "exclude": ["src/*.test.ts"]
+}
diff --git a/mcp/packages/common/package.json b/mcp/packages/common/package.json
index b87f8ce17b..267a37fef2 100644
--- a/mcp/packages/common/package.json
+++ b/mcp/packages/common/package.json
@@ -4,7 +4,7 @@
"description": "Shared type definitions and interfaces for Penpot MCP",
"main": "dist/index.js",
"types": "dist/index.d.ts",
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"scripts": {
"build": "tsc --build --clean && tsc --build",
"watch": "tsc --watch",
diff --git a/mcp/packages/common/src/types.ts b/mcp/packages/common/src/types.ts
index f9d7cde400..278e272951 100644
--- a/mcp/packages/common/src/types.ts
+++ b/mcp/packages/common/src/types.ts
@@ -22,6 +22,47 @@ export interface PluginTaskResult {
* Optional result data from the task execution.
*/
data?: T;
+
+ /**
+ * Rollbacks of rejected changes that happened in the workspace since the previous task response.
+ */
+ rollbacks?: ContentRollbackEvent[];
+}
+
+/**
+ * Message from the MCP server giving the plugin back the rollbacks of a task response that came
+ * after its task timed out, so that the plugin reports them with its next response.
+ */
+export interface UnclaimedRollbacksMessage {
+ type: "unclaimed-rollbacks";
+
+ /**
+ * The rollbacks the late response carried, oldest first.
+ */
+ rollbacks: ContentRollbackEvent[];
+}
+
+/**
+ * Rollback of rejected changes in the Penpot workspace.
+ *
+ * The backend rejected some changes and the workspace undid them, together with the rest of their
+ * undo steps and any later change to the same file. Mirrors the plugin API's `ContentRollback`.
+ */
+export interface ContentRollbackEvent {
+ /**
+ * Ids of the files that lost changes.
+ */
+ fileIds: string[];
+
+ /**
+ * Ids of the pages the undone changes touched.
+ */
+ pageIds: string[];
+
+ /**
+ * Ids of the page shapes the undone changes touched.
+ */
+ shapeIds: string[];
}
/**
@@ -71,6 +112,11 @@ export interface PluginTaskResponse {
* The result of the task execution.
*/
data?: T;
+
+ /**
+ * Rollbacks of rejected changes that happened in the workspace since the previous task response.
+ */
+ rollbacks?: ContentRollbackEvent[];
}
/**
@@ -97,3 +143,36 @@ export interface ExecuteCodeTaskResultData {
*/
log: string;
}
+
+/**
+ * Status of the Penpot MCP plugin connection, as reported to the Penpot app.
+ */
+export type McpConnectionStatus = "idle" | "connecting" | "connected" | "disconnected" | "error";
+
+/**
+ * Message posted by a browser extension's content script to ask the Penpot page for its MCP session.
+ */
+export interface ExtensionHello {
+ type: "penpot-mcp-extension:hello";
+}
+
+/**
+ * Message posted by the Penpot page when it starts listening for an {@link ExtensionHello}.
+ *
+ * A content script that said hello before the page was listening says it again.
+ */
+export interface PageReady {
+ type: "penpot-mcp:ready";
+}
+
+/**
+ * Message posted by the Penpot page to announce its MCP session to a browser extension.
+ *
+ * The page sends it in reply to {@link ExtensionHello} and on every connection status change.
+ */
+export interface SessionAnnouncement {
+ type: "penpot-mcp:session";
+ /** the MCP session ID of the page, or null while it is not known. */
+ sessionId: string | null;
+ status: McpConnectionStatus;
+}
diff --git a/mcp/packages/plugin/package.json b/mcp/packages/plugin/package.json
index ffa4f3837a..7d33e479fe 100644
--- a/mcp/packages/plugin/package.json
+++ b/mcp/packages/plugin/package.json
@@ -3,7 +3,7 @@
"private": true,
"version": "1.0.0",
"type": "module",
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"scripts": {
"start": "vite build --watch --config vite.config.ts",
"start:multi-user": "pnpm run start",
@@ -13,13 +13,13 @@
"clean": "rm -rf dist/"
},
"dependencies": {
- "@penpot/plugin-styles": "1.5.0",
+ "@penpot/plugin-styles": "1.6.0",
"@penpot/plugin-types": "link:../../../plugins/libs/plugin-types"
},
"devDependencies": {
"cross-env": "^10.1.0",
"typescript": "^6.0.3",
- "vite": "^8.3.2",
+ "vite": "^8.3.5",
"vite-live-preview": "^0.4.0"
}
}
diff --git a/mcp/packages/plugin/public/manifest.json b/mcp/packages/plugin/public/manifest.json
index c67296f1db..3512312eca 100644
--- a/mcp/packages/plugin/public/manifest.json
+++ b/mcp/packages/plugin/public/manifest.json
@@ -5,5 +5,5 @@
"version": 2,
"scope": "global",
"description": "This plugin enables interaction with the Penpot MCP server",
- "permissions": ["user:read", "content:read", "content:write", "library:read", "library:write", "comment:read", "comment:write"]
+ "permissions": ["user:read", "content:read", "content:write", "library:read", "library:write", "comment:read", "comment:write", "allow:localstorage"]
}
diff --git a/mcp/packages/plugin/src/ConnectionMetadata.test.ts b/mcp/packages/plugin/src/ConnectionMetadata.test.ts
index 3131086153..ea87d92ca6 100644
--- a/mcp/packages/plugin/src/ConnectionMetadata.test.ts
+++ b/mcp/packages/plugin/src/ConnectionMetadata.test.ts
@@ -4,9 +4,11 @@ import { readFileSync } from "node:fs";
import test from "node:test";
import { runInNewContext } from "node:vm";
import ts from "typescript";
+import * as ErrorUtils from "./ErrorUtils.ts";
import { shouldReconnectAfterClose } from "./ReconnectPolicy.ts";
import { SessionId } from "./SessionId.ts";
import { SessionIdDisplay } from "./SessionIdDisplay.ts";
+import * as VersionCompatibility from "./VersionCompatibility.ts";
/** Compiles the actual plugin entry point for a simulated browser boundary. */
function compile(name: string) {
@@ -15,6 +17,29 @@ function compile(name: string) {
}).outputText;
}
+/** Exports of a compiled module that Node's type stripping cannot load directly. */
+function compiledModule(name: string) {
+ const exports = {};
+ runInNewContext(compile(name), { exports });
+ return exports;
+}
+
+/** Resolves the imports of `plugin.ts`, stubbing the code execution handler and the rollback log. */
+function pluginRequire(name: string) {
+ if (name === "./task-handlers/ExecuteCodeTaskHandler") return { ExecuteCodeTaskHandler: class {} };
+ if (name === "./TaskHandler") return compiledModule("TaskHandler.ts");
+ if (name === "./ErrorUtils") return ErrorUtils;
+ if (name === "./VersionCompatibility") return VersionCompatibility;
+ if (name === "./RollbackLog")
+ return {
+ LocalStorageRollbackStore: class {},
+ RollbackLog: class {
+ listen() {}
+ },
+ };
+ throw new Error(`Unexpected import: ${name}`);
+}
+
function pluginUi() {
const messages: any[] = [];
const sockets: FakeSocket[] = [];
@@ -147,6 +172,17 @@ test("resume and freeze events cannot send liveness messages before initializati
assert.deepEqual(ui.sockets[0].sent, [{ type: "heartbeat" }]);
});
+test("answers heartbeat requests once initialized, without forwarding them to the plugin", () => {
+ const ui = pluginUi();
+ ui.connect();
+ ui.sockets[0].receive({ type: "heartbeat-request" });
+ assert.deepEqual(ui.sockets[0].sent, []);
+ ui.sockets[0].receive({ type: "initialized" });
+ ui.sockets[0].receive({ type: "heartbeat-request" });
+ assert.deepEqual(ui.sockets[0].sent, [{ type: "heartbeat" }]);
+ assert.equal(ui.messages.filter((message) => message.type === "heartbeat-request").length, 0);
+});
+
test("plugin reads the current file for each connection metadata request", () => {
let onMessage!: (message: any) => void;
const messages: any[] = [];
@@ -173,7 +209,7 @@ test("plugin reads the current file for each connection metadata request", () =>
on() {},
},
mcp: undefined,
- require: () => ({ ExecuteCodeTaskHandler: class {} }),
+ require: pluginRequire,
});
onMessage({ type: "connection-metadata-request", sessionId: "first" });
penpot.currentFile = { id: "file-2", name: "Second design" };
@@ -212,7 +248,7 @@ test("plugin without penpotMgmt derives metadata from the open file", () => {
exports: {},
penpot,
mcp: undefined,
- require: () => ({ ExecuteCodeTaskHandler: class {} }),
+ require: pluginRequire,
});
onMessage({ type: "connection-metadata-request", sessionId: "first" });
penpot.currentFile = null;
@@ -302,7 +338,7 @@ test("integrated plugin stays idle until explicitly connected, including while t
setMcpStatus: (status: string) => statuses.push(status),
on: (event: string, callback: () => void) => events.set(event, callback),
},
- require: () => ({ ExecuteCodeTaskHandler: class {} }),
+ require: pluginRequire,
});
assert.ok(!statuses.includes("connecting"));
events.get("connect")!();
diff --git a/mcp/packages/plugin/src/RollbackLog.test.ts b/mcp/packages/plugin/src/RollbackLog.test.ts
new file mode 100644
index 0000000000..da42e8c548
--- /dev/null
+++ b/mcp/packages/plugin/src/RollbackLog.test.ts
@@ -0,0 +1,169 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { LocalStorageRollbackStore, RollbackLog, type RollbackStore } from "./RollbackLog.ts";
+
+const rollback = (id: string) => ({ fileIds: [`file-${id}`], pageIds: [`page-${id}`], shapeIds: [`shape-${id}`] });
+
+/**
+ * Installs a `penpot` global whose `on` hands each subscription to `on`.
+ */
+function installPenpot(on: (type: string, callback: any) => void): void {
+ (globalThis as any).penpot = { on };
+}
+
+test("records the rollbacks Penpot reports", () => {
+ let callback: any;
+ installPenpot((type, cb) => {
+ assert.equal(type, "contentrollback");
+ callback = cb;
+ });
+ const log = new RollbackLog();
+ log.listen();
+
+ callback(rollback("a"));
+
+ assert.deepEqual(log.pending(), [rollback("a")]);
+});
+
+test("stays empty when Penpot has no rollback event", () => {
+ installPenpot(() => {
+ throw new Error("Invalid enum value");
+ });
+ const log = new RollbackLog();
+
+ assert.doesNotThrow(() => log.listen());
+ assert.deepEqual(log.pending(), []);
+});
+
+test("keeps the rollbacks recorded after the acknowledged ones", () => {
+ const log = new RollbackLog();
+ log.record(rollback("a"));
+ const sent = log.pending();
+ log.record(rollback("b"));
+
+ log.acknowledge(sent.length);
+
+ assert.deepEqual(log.pending(), [rollback("b")]);
+});
+
+test("puts returned rollbacks back ahead of the ones recorded since", () => {
+ const log = new RollbackLog();
+ log.record(rollback("a"));
+ const sent = log.pending();
+ log.acknowledge(sent.length);
+ log.record(rollback("b"));
+
+ log.restore(sent);
+
+ assert.deepEqual(log.pending(), [rollback("a"), rollback("b")]);
+});
+
+/**
+ * Rollback store that keeps its events in memory, standing in for the storage that outlives a reload.
+ */
+class MemoryRollbackStore implements RollbackStore {
+ events: unknown = [];
+
+ load() {
+ return this.events as any;
+ }
+
+ save(events: any) {
+ this.events = JSON.parse(JSON.stringify(events));
+ }
+}
+
+/**
+ * Plugin local storage held in a map.
+ */
+function memoryStorage(): {
+ items: Map;
+ getItem(key: string): string;
+ setItem(key: string, value: unknown): void;
+ removeItem(key: string): void;
+} {
+ const items = new Map();
+ return {
+ items,
+ getItem: (key) => items.get(key) ?? (null as any),
+ setItem: (key, value) => void items.set(key, String(value)),
+ removeItem: (key) => void items.delete(key),
+ };
+}
+
+test("keeps unsent rollbacks across a reload", () => {
+ const store = new MemoryRollbackStore();
+ new RollbackLog(store).record(rollback("a"));
+
+ const reloaded = new RollbackLog(store);
+
+ assert.deepEqual(reloaded.pending(), [rollback("a")]);
+});
+
+test("forgets the stored rollbacks once a response carried them", () => {
+ const store = new MemoryRollbackStore();
+ const log = new RollbackLog(store);
+ log.record(rollback("a"));
+ log.record(rollback("b"));
+
+ log.acknowledge(1);
+
+ assert.deepEqual(new RollbackLog(store).pending(), [rollback("b")]);
+ log.acknowledge(1);
+ assert.deepEqual(new RollbackLog(store).pending(), []);
+});
+
+test("stores the rollbacks the server returns", () => {
+ const store = new MemoryRollbackStore();
+ new RollbackLog(store).restore([rollback("a")]);
+
+ assert.deepEqual(new RollbackLog(store).pending(), [rollback("a")]);
+});
+
+test("keeps rollbacks in memory when the storage fails", () => {
+ const failing: RollbackStore = {
+ load: () => {
+ throw new Error("storage unavailable");
+ },
+ save: () => {
+ throw new Error("storage unavailable");
+ },
+ };
+ const log = new RollbackLog(failing);
+
+ assert.doesNotThrow(() => log.record(rollback("a")));
+ assert.deepEqual(log.pending(), [rollback("a")]);
+});
+
+test("stores rollbacks per file in the plugin local storage", () => {
+ const storage = memoryStorage();
+ const fileA = new LocalStorageRollbackStore(storage, "file-a");
+ const fileB = new LocalStorageRollbackStore(storage, "file-b");
+
+ fileA.save([rollback("a")]);
+
+ assert.deepEqual(new LocalStorageRollbackStore(storage, "file-a").load(), [rollback("a")]);
+ assert.deepEqual(fileB.load(), []);
+});
+
+test("removes the entry of a file with no rollbacks left", () => {
+ const storage = memoryStorage();
+ const store = new LocalStorageRollbackStore(storage, "file-a");
+ store.save([rollback("a")]);
+
+ store.save([]);
+
+ assert.equal(storage.items.size, 0);
+});
+
+test("ignores a stored entry that is not a rollback list", () => {
+ const storage = memoryStorage();
+ const store = new LocalStorageRollbackStore(storage, "file-a");
+
+ for (const raw of ["not json", '{"fileIds": []}', '[{"fileIds": "x"}]']) {
+ storage.items.clear();
+ store.save([rollback("a")]);
+ storage.items.set([...storage.items.keys()][0], raw);
+ assert.deepEqual(store.load(), [], raw);
+ }
+});
diff --git a/mcp/packages/plugin/src/RollbackLog.ts b/mcp/packages/plugin/src/RollbackLog.ts
new file mode 100644
index 0000000000..c4f49d3101
--- /dev/null
+++ b/mcp/packages/plugin/src/RollbackLog.ts
@@ -0,0 +1,191 @@
+import type { LocalStorage } from "@penpot/plugin-types";
+import type { ContentRollbackEvent } from "../../common/src";
+
+/**
+ * Storage of the rollbacks a {@link RollbackLog} has not handed over yet, which outlives a reload
+ * of the plugin or of the browser tab.
+ */
+export interface RollbackStore {
+ /**
+ * Returns the stored rollbacks, oldest first.
+ */
+ load(): ContentRollbackEvent[];
+
+ /**
+ * Replaces the stored rollbacks.
+ *
+ * @param events - the rollbacks not handed over yet, oldest first
+ */
+ save(events: ContentRollbackEvent[]): void;
+}
+
+/**
+ * Rollback store in Penpot's plugin local storage, with one entry per file.
+ *
+ * The plugin runs for one open file, and a reload opens the same file again, so the entry of that
+ * file holds what the reload would otherwise lose. The storage is the browser's, so it is kept
+ * across reloads but not shared with other browsers.
+ */
+export class LocalStorageRollbackStore implements RollbackStore {
+ private static readonly KEY_PREFIX = "rollbacks/";
+
+ private readonly storage: Pick;
+ private readonly fileId: string;
+
+ /**
+ * @param storage - the plugin local storage (`penpot.localStorage`)
+ * @param fileId - the id of the file the plugin runs for
+ */
+ constructor(storage: Pick, fileId: string) {
+ this.storage = storage;
+ this.fileId = fileId;
+ }
+
+ private get key(): string {
+ return LocalStorageRollbackStore.KEY_PREFIX + this.fileId;
+ }
+
+ load(): ContentRollbackEvent[] {
+ const raw = this.storage.getItem(this.key);
+ if (!raw) {
+ return [];
+ }
+ try {
+ const events = JSON.parse(raw);
+ return Array.isArray(events) && events.every(isRollbackEvent) ? events : [];
+ } catch {
+ return [];
+ }
+ }
+
+ save(events: ContentRollbackEvent[]): void {
+ if (events.length === 0) {
+ this.storage.removeItem(this.key);
+ } else {
+ this.storage.setItem(this.key, JSON.stringify(events));
+ }
+ }
+}
+
+/**
+ * Tells whether the given value has the shape of a rollback event.
+ *
+ * @param value - a value read from storage
+ */
+function isRollbackEvent(value: any): value is ContentRollbackEvent {
+ const isIdList = (ids: unknown) => Array.isArray(ids) && ids.every((id) => typeof id === "string");
+ return (
+ typeof value === "object" &&
+ value !== null &&
+ isIdList(value.fileIds) &&
+ isIdList(value.pageIds) &&
+ isIdList(value.shapeIds)
+ );
+}
+
+/**
+ * Log of the rollbacks of rejected changes that the MCP server has not been told about yet.
+ *
+ * A rollback happens after the task that made the rejected changes has returned (the backend
+ * rejects a save seconds later), so the log hands its events to the next task response. With a
+ * store, the log also keeps its events across a reload, until a response carries them.
+ */
+export class RollbackLog {
+ private readonly store?: RollbackStore;
+ private events: ContentRollbackEvent[];
+
+ /**
+ * @param store - the storage that keeps the events across reloads; without one, or when it
+ * fails, the events live in memory only
+ */
+ constructor(store?: RollbackStore) {
+ this.store = store;
+ this.events = this.load();
+ }
+
+ /**
+ * Starts recording the rollbacks Penpot reports.
+ *
+ * Penpot versions without the `contentrollback` event reject the subscription; the log then
+ * stays empty.
+ */
+ listen(): void {
+ try {
+ // @ts-ignore - contentrollback is not yet in the released plugin types
+ penpot.on("contentrollback", (event: ContentRollbackEvent) => this.record(event));
+ } catch (error) {
+ console.warn("Penpot does not report rollbacks:", error);
+ }
+ }
+
+ /**
+ * Adds a rollback to the log.
+ *
+ * @param event - the rollback as reported by Penpot
+ */
+ record(event: ContentRollbackEvent): void {
+ this.events.push(copyEvent(event));
+ this.save();
+ }
+
+ /**
+ * Puts back rollbacks that a sent response carried but no tool execution received (the
+ * server had given up on that task), ahead of the ones recorded since.
+ *
+ * @param events - the returned rollbacks, oldest first
+ */
+ restore(events: ContentRollbackEvent[]): void {
+ this.events = [...events.map(copyEvent), ...this.events];
+ this.save();
+ }
+
+ /**
+ * Returns the rollbacks not yet acknowledged, oldest first.
+ */
+ pending(): ContentRollbackEvent[] {
+ return [...this.events];
+ }
+
+ /**
+ * Removes the oldest `count` rollbacks, once a response carrying them has been sent.
+ *
+ * @param count - the number of rollbacks the sent response carried
+ */
+ acknowledge(count: number): void {
+ if (count === 0) {
+ return;
+ }
+ this.events = this.events.slice(count);
+ this.save();
+ }
+
+ private load(): ContentRollbackEvent[] {
+ try {
+ return this.store?.load() ?? [];
+ } catch (error) {
+ console.warn("Unable to read the stored rollbacks:", error);
+ return [];
+ }
+ }
+
+ private save(): void {
+ try {
+ this.store?.save(this.events);
+ } catch (error) {
+ console.warn("Unable to store the rollbacks:", error);
+ }
+ }
+}
+
+/**
+ * Copies a rollback event into a plain object.
+ *
+ * @param event - the rollback, possibly a proxy or array-like from Penpot
+ */
+function copyEvent(event: ContentRollbackEvent): ContentRollbackEvent {
+ return {
+ fileIds: [...event.fileIds],
+ pageIds: [...event.pageIds],
+ shapeIds: [...event.shapeIds],
+ };
+}
diff --git a/mcp/packages/plugin/src/TaskHandler.ts b/mcp/packages/plugin/src/TaskHandler.ts
index 7bc0aa3085..c5e6130e76 100644
--- a/mcp/packages/plugin/src/TaskHandler.ts
+++ b/mcp/packages/plugin/src/TaskHandler.ts
@@ -1,3 +1,5 @@
+import type { RollbackLog } from "./RollbackLog";
+
/**
* Represents a task received from the MCP server in the Penpot MCP plugin
*/
@@ -8,11 +10,13 @@ export class Task {
* @param requestId Unique identifier for the task request
* @param taskType The type of the task to execute
* @param params Task parameters/arguments
+ * @param rollbackLog Log whose pending rollbacks the response carries, if any
*/
constructor(
public requestId: string,
public taskType: string,
- public params: TParams
+ public params: TParams,
+ private readonly rollbackLog?: RollbackLog
) {}
/**
@@ -24,6 +28,9 @@ export class Task {
return;
}
+ // rollbacks the server has not been told about, whatever the task did
+ const rollbacks = this.rollbackLog?.pending() ?? [];
+
// create response object
const response = {
type: "task-response",
@@ -33,6 +40,7 @@ export class Task {
success: success,
data: data,
error: error,
+ ...(rollbacks.length > 0 ? { rollbacks } : {}),
},
};
@@ -60,6 +68,7 @@ export class Task {
}
console.log("Sent task response:", response);
this.isResponseSent = true;
+ this.rollbackLog?.acknowledge(rollbacks.length);
}
public sendSuccess(data: any = undefined): void {
diff --git a/mcp/packages/plugin/src/VersionCompatibility.test.ts b/mcp/packages/plugin/src/VersionCompatibility.test.ts
new file mode 100644
index 0000000000..2e40bb7cf0
--- /dev/null
+++ b/mcp/packages/plugin/src/VersionCompatibility.test.ts
@@ -0,0 +1,28 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { extractMinorVersion, isCompatibleVersion } from "./VersionCompatibility.ts";
+
+test("extracts major.minor from release and pre-release versions", () => {
+ assert.equal(extractMinorVersion("2.18.1"), "2.18");
+ assert.equal(extractMinorVersion("2.17.0"), "2.17");
+ assert.equal(extractMinorVersion("2.15.0-rc.1.116"), "2.15");
+ assert.equal(extractMinorVersion("2.18.1-dev.140"), "2.18");
+ assert.equal(extractMinorVersion("2.18"), "2.18");
+});
+
+test("returns non-matching versions unchanged", () => {
+ assert.equal(extractMinorVersion("<2.15"), "<2.15");
+ assert.equal(extractMinorVersion("develop"), "develop");
+});
+
+test("treats patch releases of the same minor version as compatible", () => {
+ assert.equal(isCompatibleVersion(extractMinorVersion("2.17.2"), extractMinorVersion("2.17.0")), true);
+});
+
+test("reports a different minor version as incompatible", () => {
+ assert.equal(isCompatibleVersion(extractMinorVersion("2.18.1"), extractMinorVersion("2.17.0")), false);
+});
+
+test("treats local development builds of Penpot as compatible", () => {
+ assert.equal(isCompatibleVersion(extractMinorVersion("0.0.0"), extractMinorVersion("2.17.0")), true);
+});
diff --git a/mcp/packages/plugin/src/VersionCompatibility.ts b/mcp/packages/plugin/src/VersionCompatibility.ts
new file mode 100644
index 0000000000..f529491ea3
--- /dev/null
+++ b/mcp/packages/plugin/src/VersionCompatibility.ts
@@ -0,0 +1,27 @@
+/**
+ * Extracts the major.minor prefix from a version string.
+ *
+ * Patch releases of Penpot do not change the plugin API the MCP server is
+ * written against, and the MCP package version is only set per minor
+ * release, so the patch component is not part of the compatibility check.
+ *
+ * @param version - a version string starting with major.minor (e.g. "2.18.1")
+ * @returns the major.minor prefix, or the original string if it does not match
+ */
+export function extractMinorVersion(version: string): string {
+ const match = version.match(/^(\d+\.\d+)(?:\.|$)/);
+ return match ? match[1] : version;
+}
+
+/**
+ * Returns whether an MCP build is intended for the running Penpot version.
+ *
+ * Local development builds of Penpot report "0.0.0" and are always treated
+ * as compatible.
+ *
+ * @param penpotVersion - the running Penpot version, as major.minor prefix
+ * @param mcpVersion - the version the MCP build targets, as major.minor prefix
+ */
+export function isCompatibleVersion(penpotVersion: string, mcpVersion: string): boolean {
+ return penpotVersion === "0.0" || penpotVersion === mcpVersion;
+}
diff --git a/mcp/packages/plugin/src/main.ts b/mcp/packages/plugin/src/main.ts
index 71973ade0b..4f5e78b755 100644
--- a/mcp/packages/plugin/src/main.ts
+++ b/mcp/packages/plugin/src/main.ts
@@ -131,6 +131,7 @@ function sendTaskResponse(response: any): void {
id: response.id,
success: false,
error: errorMessage,
+ rollbacks: response.rollbacks,
};
responseString = JSON.stringify(response);
}
@@ -145,7 +146,9 @@ function sendTaskResponse(response: any): void {
* Emits a liveness signal from the plugin event loop.
*
* WebSocket ping/pong is not enough here: browsers can answer protocol pings while
- * page JavaScript is frozen and unable to run MCP tasks.
+ * page JavaScript is frozen and unable to run MCP tasks. The plugin sends one on a timer and
+ * in answer to each heartbeat request of the server, since a browser runs the timers of a
+ * hidden page as rarely as once a minute but handles socket messages at once.
*/
function sendHeartbeat(): boolean {
if (connectionReady && ws?.readyState === WebSocket.OPEN) {
@@ -252,6 +255,10 @@ function connectToMcpServer(baseUrl?: string, token?: string): void {
parent.postMessage({ type: "context-request" }, "*");
return;
}
+ if (request.type === "heartbeat-request") {
+ sendHeartbeat();
+ return;
+ }
// Track the current task received from the MCP server
if (request.task) {
updateCurrentTask(request.task);
diff --git a/mcp/packages/plugin/src/plugin.ts b/mcp/packages/plugin/src/plugin.ts
index 025354df74..f659baa208 100644
--- a/mcp/packages/plugin/src/plugin.ts
+++ b/mcp/packages/plugin/src/plugin.ts
@@ -1,8 +1,10 @@
import { ExecuteCodeTaskHandler } from "./task-handlers/ExecuteCodeTaskHandler";
import { Task, TaskHandler } from "./TaskHandler";
import { formatTaskError } from "./ErrorUtils";
-import type { PluginConnectionInit } from "../../common/src";
+import { extractMinorVersion, isCompatibleVersion } from "./VersionCompatibility";
+import type { ContentRollbackEvent, PluginConnectionInit } from "../../common/src";
import type { WorkspaceContext } from "@penpot/plugin-types";
+import { LocalStorageRollbackStore, RollbackLog, type RollbackStore } from "./RollbackLog";
/**
* indicates whether the plugin is running in an environment with the Penpot-integrated remote MCP server
@@ -16,17 +18,6 @@ const isIntegratedRemoteMcp = !!mcp;
*/
const management = typeof penpotMgmt === "undefined" ? null : penpotMgmt;
-/**
- * Extracts the major.minor.patch prefix from a version string.
- *
- * @param version - a version string starting with major.minor.patch
- * @returns the major.minor.patch prefix, or the original string if it does not match
- */
-function extractVersionPrefix(version: string): string {
- const match = version.match(/^(\d+\.\d+\.\d+)/);
- return match ? match[1] : version;
-}
-
let uiInitialized = false;
/**
@@ -34,6 +25,29 @@ let uiInitialized = false;
*/
const taskHandlers: TaskHandler[] = [new ExecuteCodeTaskHandler()];
+/**
+ * Rollbacks of rejected changes, reported to the MCP server with the next task response.
+ * The ones not reported yet are kept in the plugin local storage of the open file, so a reload
+ * of the tab or of the plugin does not lose them.
+ */
+const rollbackLog = new RollbackLog(createRollbackStore());
+rollbackLog.listen();
+
+/**
+ * Creates the store of the rollbacks not reported yet, for the open file.
+ *
+ * @returns the store, or undefined when no file is open or the local storage is unavailable
+ */
+function createRollbackStore(): RollbackStore | undefined {
+ try {
+ const fileId = penpot.currentFile?.id;
+ return fileId ? new LocalStorageRollbackStore(penpot.localStorage, fileId) : undefined;
+ } catch (error) {
+ console.warn("Rollbacks are kept in memory only:", error);
+ return undefined;
+ }
+}
+
// Open the plugin UI (main.ts)
penpot.ui.open("Penpot MCP Plugin", `?theme=${penpot.theme}`, {
width: 236,
@@ -43,7 +57,16 @@ penpot.ui.open("Penpot MCP Plugin", `?theme=${penpot.theme}`, {
// Register message handlers
penpot.ui.onMessage<
- string | { id: string; type?: string; status?: string; sessionId?: string; task: string; params: any }
+ | string
+ | {
+ id: string;
+ type?: string;
+ status?: string;
+ sessionId?: string;
+ task: string;
+ params: any;
+ rollbacks?: ContentRollbackEvent[];
+ }
>((message) => {
if (typeof message === "object" && message.type === "ui-initialized") {
uiInitialized = true;
@@ -53,11 +76,10 @@ penpot.ui.onMessage<
integratedRemoteMcp: isIntegratedRemoteMcp,
});
// Check Penpot version compatibility
- const penpotVersionPrefix = penpot.version ? extractVersionPrefix(penpot.version) : "<2.15"; // pre-2.15 versions don't have version info
- const mcpVersionPrefix = extractVersionPrefix(PENPOT_MCP_VERSION);
+ const penpotVersionPrefix = penpot.version ? extractMinorVersion(penpot.version) : "<2.15"; // pre-2.15 versions don't have version info
+ const mcpVersionPrefix = extractMinorVersion(PENPOT_MCP_VERSION);
console.log(`Penpot version: ${penpotVersionPrefix}, MCP version: ${mcpVersionPrefix}`);
- const isLocalPenpotVersion = penpotVersionPrefix == "0.0.0";
- if (penpotVersionPrefix !== mcpVersionPrefix && !isLocalPenpotVersion) {
+ if (!isCompatibleVersion(penpotVersionPrefix, mcpVersionPrefix)) {
penpot.ui.sendMessage({
type: "version-mismatch",
mcpVersion: mcpVersionPrefix,
@@ -89,6 +111,9 @@ penpot.ui.onMessage<
}
} else if (typeof message === "object" && message.type === "context-request") {
sendWorkspaceContext();
+ } else if (typeof message === "object" && message.type === "unclaimed-rollbacks") {
+ // the server got these with a response that came too late: report them again
+ rollbackLog.restore(message.rollbacks ?? []);
} else if (typeof message === "object" && message.type === "update-connection-status") {
mcp?.setMcpStatus(message.status || "unknown", message.sessionId);
} else if (typeof message === "object" && message.task && message.id) {
@@ -138,7 +163,7 @@ management?.on("workspacechange", sendWorkspaceContext);
*/
async function handlePluginTaskRequest(request: { id: string; task: string; params: any }): Promise {
console.log("Executing plugin task:", request.task, request.params);
- const task = new Task(request.id, request.task, request.params);
+ const task = new Task(request.id, request.task, request.params, rollbackLog);
// Find the appropriate handler
const handler = taskHandlers.find((h) => h.isApplicableTo(task));
diff --git a/mcp/packages/server/data/api_types.yml b/mcp/packages/server/data/api_types.yml
index 69715ca183..ecb78c628d 100644
--- a/mcp/packages/server/data/api_types.yml
+++ b/mcp/packages/server/data/api_types.yml
@@ -128,7 +128,8 @@ Penpot:
Example
```
- const size = penpot.ui.size;console.log(size);
+ const size = penpot.ui.size;
+ console.log(size);
```
* resize: (width: number, height: number) => void
@@ -186,7 +187,8 @@ Penpot:
Example
```
- const rootShape = context.root;console.log(rootShape);
+ const rootShape = context.root;
+ console.log(rootShape);
```
currentFile: |-
```
@@ -201,7 +203,8 @@ Penpot:
Example
```
- const fileData = context.currentFile;console.log(fileData);
+ const fileData = context.currentFile;
+ console.log(fileData);
```
currentPage: |-
```
@@ -212,7 +215,8 @@ Penpot:
Example
```
- const currentPage = context.currentPage;console.log(currentPage);
+ const currentPage = context.currentPage;
+ console.log(currentPage);
```
viewport: |-
```
@@ -223,7 +227,8 @@ Penpot:
Example
```
- const viewportSettings = context.viewport;console.log(viewportSettings);
+ const viewportSettings = context.viewport;
+ console.log(viewportSettings);
```
flags: |-
```
@@ -240,7 +245,8 @@ Penpot:
Example
```
- const historyContext = context.history;console.log(historyContext);
+ const historyContext = context.history;
+ console.log(historyContext);
```
library: |-
```
@@ -251,7 +257,8 @@ Penpot:
Example
```
- const libraryContext = context.library;console.log(libraryContext);
+ const libraryContext = context.library;
+ console.log(libraryContext);
```
fonts: |-
```
@@ -262,7 +269,8 @@ Penpot:
Example
```
- const fontsContext = context.fonts;console.log(fontsContext);
+ const fontsContext = context.fonts;
+ console.log(fontsContext);
```
currentUser: |-
```
@@ -273,7 +281,8 @@ Penpot:
Example
```
- const currentUser = context.currentUser;console.log(currentUser);
+ const currentUser = context.currentUser;
+ console.log(currentUser);
```
activeUsers: |-
```
@@ -284,7 +293,8 @@ Penpot:
Example
```
- const activeUsers = context.activeUsers;console.log(activeUsers);
+ const activeUsers = context.activeUsers;
+ console.log(activeUsers);
```
theme: |-
```
@@ -295,7 +305,8 @@ Penpot:
Example
```
- const currentTheme = context.theme;console.log(currentTheme);
+ const currentTheme = context.theme;
+ console.log(currentTheme);
```
localStorage: |-
```
@@ -312,7 +323,8 @@ Penpot:
Example
```
- const selectedShapes = context.selection;console.log(selectedShapes);
+ const selectedShapes = context.selection;
+ console.log(selectedShapes);
```
Methods:
on: |-
@@ -334,7 +346,8 @@ Penpot:
that will be observed. For example:
```
- // Observe the current selected shapepenpot.on('shapechange', (shape) => console.log(shape.name), { shapeId: penpot.selection[0].id });
+ // Observe the current selected shape
+ penpot.on('shapechange', (shape) => console.log(shape.name), { shapeId: penpot.selection[0].id });
```
* selectionchange: event emitted when the current selection changes. The callback will receive the list of ids for the new selection
@@ -384,7 +397,8 @@ Penpot:
Example
```
- const listenerId = penpot.on('contentsave', () => console.log("Changed"));penpot.off(listenerId);
+ const listenerId = penpot.on('contentsave', () => console.log("Changed"));
+ penpot.off(listenerId);
```
shapesColors: |-
```
@@ -403,7 +417,8 @@ Penpot:
Example
```
- const colors = context.shapesColors(shapes);console.log(colors);
+ const colors = context.shapesColors(shapes);
+ console.log(colors);
```
replaceColor: |-
```
@@ -446,7 +461,14 @@ Penpot:
Example
```
- const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');console.log(imageData);// to insert the image in a shape we can doconst board = penpot.createBoard();const shape = penpot.createRectangle();board.appendChild(shape);shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
+ const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');
+ console.log(imageData);
+
+ // to insert the image in a shape we can do
+ const board = penpot.createBoard();
+ const shape = penpot.createRectangle();
+ board.appendChild(shape);
+ shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
```
uploadMediaData: |-
```
@@ -475,7 +497,8 @@ Penpot:
Example
```
- const imageData = await context.uploadMediaData('example', imageData, 'image/jpeg');console.log(imageData);
+ const imageData = await context.uploadMediaData('example', imageData, 'image/jpeg');
+ console.log(imageData);
```
group: |-
```
@@ -496,7 +519,8 @@ Penpot:
Example
```
- const penpotShapesArray = penpot.selection;penpot.group(penpotShapesArray);
+ const penpotShapesArray = penpot.selection;
+ penpot.group(penpotShapesArray);
```
ungroup: |-
```
@@ -518,7 +542,11 @@ Penpot:
Example
```
- const penpotShapesArray = penpot.selection;// We need to make sure that something is selected, and that the selected shape is a groupif (penpotShapesArray.length && penpot.utils.types.isGroup(penpotShapesArray[0])) { penpot.ungroup(penpotShapesArray[0]);}
+ const penpotShapesArray = penpot.selection;
+ // We need to make sure that something is selected, and that the selected shape is a group
+ if (penpotShapesArray.length && penpot.utils.types.isGroup(penpotShapesArray[0])) {
+ penpot.ungroup(penpotShapesArray[0]);
+ }
```
createRectangle: |-
```
@@ -531,7 +559,48 @@ Penpot:
Example
```
- const shape = penpot.createRectangle();// just change the values like thisshape.name = "Example rectangle";// for solid colorshape.fills = [{ fillColor: "#7EFFF5" }];// for linear gradient colorshape.fills = [{ fillColorGradient: { "type": "linear", "startX": 0.5, "startY": 0, "endX": 0.5, "endY": 1, "width": 1, "stops": [ { "color": "#003ae9", "opacity": 1, "offset": 0 }, { "color": "#003ae9", "opacity": 0, "offset": 1 } ] }}];// for a image fillconst imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');shape.fills = [{ fillOpacity: 1, fillImage: imageData }];shape.borderRadius = 8;shape.strokes = [ { strokeColor: "#2e3434", strokeStyle: "solid", strokeWidth: 2, strokeAlignment: "center", },];
+ const shape = penpot.createRectangle();
+ // just change the values like this
+ shape.name = "Example rectangle";
+
+ // for solid color
+ shape.fills = [{ fillColor: "#7EFFF5" }];
+ // for linear gradient color
+ shape.fills = [{
+ fillColorGradient: {
+ "type": "linear",
+ "startX": 0.5,
+ "startY": 0,
+ "endX": 0.5,
+ "endY": 1,
+ "width": 1,
+ "stops": [
+ {
+ "color": "#003ae9",
+ "opacity": 1,
+ "offset": 0
+ },
+ {
+ "color": "#003ae9",
+ "opacity": 0,
+ "offset": 1
+ }
+ ]
+ }
+ }];
+ // for a image fill
+ const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');
+ shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
+
+ shape.borderRadius = 8;
+ shape.strokes = [
+ {
+ strokeColor: "#2e3434",
+ strokeStyle: "solid",
+ strokeWidth: 2,
+ strokeAlignment: "center",
+ },
+ ];
```
createBoard: |-
```
@@ -546,7 +615,16 @@ Penpot:
Example
```
- const board = penpot.createBoard();// to add grid layoutboard.addGridLayout();// to add flex layoutboard.addFlexLayout();// to create a shape inside the boardconst shape = penpot.createRectangle();board.appendChild(shape);
+ const board = penpot.createBoard();
+
+ // to add grid layout
+ board.addGridLayout();
+ // to add flex layout
+ board.addFlexLayout();
+
+ // to create a shape inside the board
+ const shape = penpot.createRectangle();
+ board.appendChild(shape);
```
createEllipse: |-
```
@@ -559,7 +637,47 @@ Penpot:
Example
```
- const shape = penpot.createEllipse();// just change the values like thisshape.name = "Example ellipse";// for solid colorshape.fills = [{ fillColor: "#7EFFF5" }];// for linear gradient colorshape.fills = [{ fillColorGradient: { "type": "linear", "startX": 0.5, "startY": 0, "endX": 0.5, "endY": 1, "width": 1, "stops": [ { "color": "#003ae9", "opacity": 1, "offset": 0 }, { "color": "#003ae9", "opacity": 0, "offset": 1 } ] }}];// for an image fillconst imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');shape.fills = [{ fillOpacity: 1, fillImage: imageData }];shape.strokes = [ { strokeColor: "#2e3434", strokeStyle: "solid", strokeWidth: 2, strokeAlignment: "center", },];
+ const shape = penpot.createEllipse();
+ // just change the values like this
+ shape.name = "Example ellipse";
+
+ // for solid color
+ shape.fills = [{ fillColor: "#7EFFF5" }];
+ // for linear gradient color
+ shape.fills = [{
+ fillColorGradient: {
+ "type": "linear",
+ "startX": 0.5,
+ "startY": 0,
+ "endX": 0.5,
+ "endY": 1,
+ "width": 1,
+ "stops": [
+ {
+ "color": "#003ae9",
+ "opacity": 1,
+ "offset": 0
+ },
+ {
+ "color": "#003ae9",
+ "opacity": 0,
+ "offset": 1
+ }
+ ]
+ }
+ }];
+ // for an image fill
+ const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');
+ shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
+
+ shape.strokes = [
+ {
+ strokeColor: "#2e3434",
+ strokeStyle: "solid",
+ strokeWidth: 2,
+ strokeAlignment: "center",
+ },
+ ];
```
createPath: |-
```
@@ -572,7 +690,11 @@ Penpot:
Example
```
- const path = penpot.createPath();path.name = "My path";// for solid colorpath.fills = [{ fillColor: "#7EFFF5" }];
+ const path = penpot.createPath();
+ path.name = "My path";
+
+ // for solid color
+ path.fills = [{ fillColor: "#7EFFF5" }];
```
createBoolean: |-
```
@@ -661,7 +783,16 @@ Penpot:
Example
```
- const board = penpot.createBoard();let text;text = penpot.createText();// just change the values like thistext.growType = 'auto-height';text.fontFamily = 'Work Sans';text.fontSize = '12';text.fills = [{fillColor: '#9f05ff', fillOpacity: 1}];text.strokes = [{strokeOpacity: 1, strokeStyle: 'solid', strokeWidth: 2, strokeColor: '#deabff', strokeAlignment: 'outer'}];board.appendChild(text);
+ const board = penpot.createBoard();
+ let text;
+ text = penpot.createText();
+ // just change the values like this
+ text.growType = 'auto-height';
+ text.fontFamily = 'Work Sans';
+ text.fontSize = '12';
+ text.fills = [{fillColor: '#9f05ff', fillOpacity: 1}];
+ text.strokes = [{strokeOpacity: 1, strokeStyle: 'solid', strokeWidth: 2, strokeColor: '#deabff', strokeAlignment: 'outer'}];
+ board.appendChild(text);
```
generateMarkup: |-
```
@@ -683,7 +814,8 @@ Penpot:
Example
```
- const markup = context.generateMarkup(shapes, { type: 'html' });console.log(markup);
+ const markup = context.generateMarkup(shapes, { type: 'html' });
+ console.log(markup);
```
generateStyle: |-
```
@@ -713,7 +845,8 @@ Penpot:
Example
```
- const styles = context.generateStyle(shapes, { type: 'css' });console.log(styles);
+ const styles = context.generateStyle(shapes, { type: 'css' });
+ console.log(styles);
```
generateFontFaces: |-
```
@@ -731,7 +864,8 @@ Penpot:
Example
```
- const fontfaces = context.generateFontFaces(penpot.selection);console.log(fontfaces);
+ const fontfaces = context.generateFontFaces(penpot.selection);
+ console.log(fontfaces);
```
openViewer: |-
```
@@ -756,7 +890,12 @@ Penpot:
Example
```
- const page = penpot.createPage();page.name = 'New Page';await penpot.openPage(page); // make the new page active firstconst board = penpot.createBoard();board.resize(375, 812);page.root.appendChild(board);
+ const page = penpot.createPage();
+ page.name = 'New Page';
+ await penpot.openPage(page); // make the new page active first
+ const board = penpot.createBoard();
+ board.resize(375, 812);
+ page.root.appendChild(board);
```
openPage: |-
```
@@ -939,7 +1078,8 @@ ActiveUser:
Example
```
- const userPosition = activeUser.position;console.log(userPosition);
+ const userPosition = activeUser.position;
+ console.log(userPosition);
```
zoom: |-
```
@@ -950,7 +1090,8 @@ ActiveUser:
Example
```
- const userZoom = activeUser.zoom;console.log(userZoom);
+ const userZoom = activeUser.zoom;
+ console.log(userZoom);
```
id: |-
```
@@ -961,7 +1102,8 @@ ActiveUser:
Example
```
- const userId = user.id;console.log(userId);
+ const userId = user.id;
+ console.log(userId);
```
name: |-
```
@@ -972,7 +1114,8 @@ ActiveUser:
Example
```
- const userName = user.name;console.log(userName);
+ const userName = user.name;
+ console.log(userName);
```
avatarUrl: |-
```
@@ -983,7 +1126,8 @@ ActiveUser:
Example
```
- const avatarUrl = user.avatarUrl;console.log(avatarUrl);
+ const avatarUrl = user.avatarUrl;
+ console.log(avatarUrl);
```
color: |-
```
@@ -994,7 +1138,8 @@ ActiveUser:
Example
```
- const userColor = user.color;console.log(userColor);
+ const userColor = user.color;
+ console.log(userColor);
```
sessionId: |-
```
@@ -1005,7 +1150,8 @@ ActiveUser:
Example
```
- const sessionId = user.sessionId;console.log(sessionId);
+ const sessionId = user.sessionId;
+ console.log(sessionId);
```
Blur:
overview: |-
@@ -1151,6 +1297,10 @@ Board:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -1187,6 +1337,7 @@ Board:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -1567,6 +1718,10 @@ Board:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -1661,7 +1816,16 @@ Board:
Example
```
- const board = penpot.createBoard();const flex = board.addFlexLayout();// You can change the flex properties as follows.flex.dir = "column";flex.wrap = "wrap";flex.alignItems = "center";flex.justifyContent = "center";flex.horizontalSizing = "fill";flex.verticalSizing = "fill";
+ const board = penpot.createBoard();
+ const flex = board.addFlexLayout();
+
+ // You can change the flex properties as follows.
+ flex.dir = "column";
+ flex.wrap = "wrap";
+ flex.alignItems = "center";
+ flex.justifyContent = "center";
+ flex.horizontalSizing = "fill";
+ flex.verticalSizing = "fill";
```
addGridLayout: |-
```
@@ -1676,7 +1840,16 @@ Board:
Example
```
- const board = penpot.createBoard();const grid = board.addGridLayout();// You can change the grid properties as follows.grid.alignItems = "center";grid.justifyItems = "start";grid.rowGap = 10;grid.columnGap = 10;grid.verticalPadding = 5;grid.horizontalPadding = 5;
+ const board = penpot.createBoard();
+ const grid = board.addGridLayout();
+
+ // You can change the grid properties as follows.
+ grid.alignItems = "center";
+ grid.justifyItems = "start";
+ grid.rowGap = 10;
+ grid.columnGap = 10;
+ grid.verticalPadding = 5;
+ grid.horizontalPadding = 5;
```
addRulerGuide: |-
```
@@ -1734,7 +1907,8 @@ Board:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -1771,7 +1945,8 @@ Board:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -1795,7 +1970,8 @@ Board:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -1841,7 +2017,8 @@ Board:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -1971,6 +2148,18 @@ Board:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -2179,6 +2368,11 @@ Board:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -2326,6 +2520,10 @@ VariantContainer:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -2362,6 +2560,7 @@ VariantContainer:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -2745,6 +2944,10 @@ VariantContainer:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -2839,7 +3042,16 @@ VariantContainer:
Example
```
- const board = penpot.createBoard();const flex = board.addFlexLayout();// You can change the flex properties as follows.flex.dir = "column";flex.wrap = "wrap";flex.alignItems = "center";flex.justifyContent = "center";flex.horizontalSizing = "fill";flex.verticalSizing = "fill";
+ const board = penpot.createBoard();
+ const flex = board.addFlexLayout();
+
+ // You can change the flex properties as follows.
+ flex.dir = "column";
+ flex.wrap = "wrap";
+ flex.alignItems = "center";
+ flex.justifyContent = "center";
+ flex.horizontalSizing = "fill";
+ flex.verticalSizing = "fill";
```
addGridLayout: |-
```
@@ -2854,7 +3066,16 @@ VariantContainer:
Example
```
- const board = penpot.createBoard();const grid = board.addGridLayout();// You can change the grid properties as follows.grid.alignItems = "center";grid.justifyItems = "start";grid.rowGap = 10;grid.columnGap = 10;grid.verticalPadding = 5;grid.horizontalPadding = 5;
+ const board = penpot.createBoard();
+ const grid = board.addGridLayout();
+
+ // You can change the grid properties as follows.
+ grid.alignItems = "center";
+ grid.justifyItems = "start";
+ grid.rowGap = 10;
+ grid.columnGap = 10;
+ grid.verticalPadding = 5;
+ grid.horizontalPadding = 5;
```
addRulerGuide: |-
```
@@ -2912,7 +3133,8 @@ VariantContainer:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -2949,7 +3171,8 @@ VariantContainer:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -2973,7 +3196,8 @@ VariantContainer:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -3019,7 +3243,8 @@ VariantContainer:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -3149,6 +3374,18 @@ VariantContainer:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -3357,6 +3594,11 @@ VariantContainer:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -3491,6 +3733,10 @@ Boolean:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -3527,6 +3773,7 @@ Boolean:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -3864,6 +4111,10 @@ Boolean:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -3978,7 +4229,8 @@ Boolean:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -4015,7 +4267,8 @@ Boolean:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -4039,7 +4292,8 @@ Boolean:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -4085,7 +4339,8 @@ Boolean:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -4215,6 +4470,18 @@ Boolean:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -4423,6 +4690,11 @@ Boolean:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -5694,7 +5966,8 @@ Context:
Example
```
- const rootShape = context.root;console.log(rootShape);
+ const rootShape = context.root;
+ console.log(rootShape);
```
currentFile: |-
```
@@ -5709,7 +5982,8 @@ Context:
Example
```
- const fileData = context.currentFile;console.log(fileData);
+ const fileData = context.currentFile;
+ console.log(fileData);
```
currentPage: |-
```
@@ -5720,7 +5994,8 @@ Context:
Example
```
- const currentPage = context.currentPage;console.log(currentPage);
+ const currentPage = context.currentPage;
+ console.log(currentPage);
```
viewport: |-
```
@@ -5731,7 +6006,8 @@ Context:
Example
```
- const viewportSettings = context.viewport;console.log(viewportSettings);
+ const viewportSettings = context.viewport;
+ console.log(viewportSettings);
```
flags: |-
```
@@ -5748,7 +6024,8 @@ Context:
Example
```
- const historyContext = context.history;console.log(historyContext);
+ const historyContext = context.history;
+ console.log(historyContext);
```
library: |-
```
@@ -5759,7 +6036,8 @@ Context:
Example
```
- const libraryContext = context.library;console.log(libraryContext);
+ const libraryContext = context.library;
+ console.log(libraryContext);
```
fonts: |-
```
@@ -5770,7 +6048,8 @@ Context:
Example
```
- const fontsContext = context.fonts;console.log(fontsContext);
+ const fontsContext = context.fonts;
+ console.log(fontsContext);
```
currentUser: |-
```
@@ -5781,7 +6060,8 @@ Context:
Example
```
- const currentUser = context.currentUser;console.log(currentUser);
+ const currentUser = context.currentUser;
+ console.log(currentUser);
```
activeUsers: |-
```
@@ -5792,7 +6072,8 @@ Context:
Example
```
- const activeUsers = context.activeUsers;console.log(activeUsers);
+ const activeUsers = context.activeUsers;
+ console.log(activeUsers);
```
theme: |-
```
@@ -5803,7 +6084,8 @@ Context:
Example
```
- const currentTheme = context.theme;console.log(currentTheme);
+ const currentTheme = context.theme;
+ console.log(currentTheme);
```
localStorage: |-
```
@@ -5820,7 +6102,8 @@ Context:
Example
```
- const selectedShapes = context.selection;console.log(selectedShapes);
+ const selectedShapes = context.selection;
+ console.log(selectedShapes);
```
Methods:
shapesColors: |-
@@ -5840,7 +6123,8 @@ Context:
Example
```
- const colors = context.shapesColors(shapes);console.log(colors);
+ const colors = context.shapesColors(shapes);
+ console.log(colors);
```
replaceColor: |-
```
@@ -5883,7 +6167,14 @@ Context:
Example
```
- const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');console.log(imageData);// to insert the image in a shape we can doconst board = penpot.createBoard();const shape = penpot.createRectangle();board.appendChild(shape);shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
+ const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');
+ console.log(imageData);
+
+ // to insert the image in a shape we can do
+ const board = penpot.createBoard();
+ const shape = penpot.createRectangle();
+ board.appendChild(shape);
+ shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
```
uploadMediaData: |-
```
@@ -5912,7 +6203,8 @@ Context:
Example
```
- const imageData = await context.uploadMediaData('example', imageData, 'image/jpeg');console.log(imageData);
+ const imageData = await context.uploadMediaData('example', imageData, 'image/jpeg');
+ console.log(imageData);
```
group: |-
```
@@ -5933,7 +6225,8 @@ Context:
Example
```
- const penpotShapesArray = penpot.selection;penpot.group(penpotShapesArray);
+ const penpotShapesArray = penpot.selection;
+ penpot.group(penpotShapesArray);
```
ungroup: |-
```
@@ -5955,7 +6248,11 @@ Context:
Example
```
- const penpotShapesArray = penpot.selection;// We need to make sure that something is selected, and that the selected shape is a groupif (penpotShapesArray.length && penpot.utils.types.isGroup(penpotShapesArray[0])) { penpot.ungroup(penpotShapesArray[0]);}
+ const penpotShapesArray = penpot.selection;
+ // We need to make sure that something is selected, and that the selected shape is a group
+ if (penpotShapesArray.length && penpot.utils.types.isGroup(penpotShapesArray[0])) {
+ penpot.ungroup(penpotShapesArray[0]);
+ }
```
createRectangle: |-
```
@@ -5968,7 +6265,48 @@ Context:
Example
```
- const shape = penpot.createRectangle();// just change the values like thisshape.name = "Example rectangle";// for solid colorshape.fills = [{ fillColor: "#7EFFF5" }];// for linear gradient colorshape.fills = [{ fillColorGradient: { "type": "linear", "startX": 0.5, "startY": 0, "endX": 0.5, "endY": 1, "width": 1, "stops": [ { "color": "#003ae9", "opacity": 1, "offset": 0 }, { "color": "#003ae9", "opacity": 0, "offset": 1 } ] }}];// for a image fillconst imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');shape.fills = [{ fillOpacity: 1, fillImage: imageData }];shape.borderRadius = 8;shape.strokes = [ { strokeColor: "#2e3434", strokeStyle: "solid", strokeWidth: 2, strokeAlignment: "center", },];
+ const shape = penpot.createRectangle();
+ // just change the values like this
+ shape.name = "Example rectangle";
+
+ // for solid color
+ shape.fills = [{ fillColor: "#7EFFF5" }];
+ // for linear gradient color
+ shape.fills = [{
+ fillColorGradient: {
+ "type": "linear",
+ "startX": 0.5,
+ "startY": 0,
+ "endX": 0.5,
+ "endY": 1,
+ "width": 1,
+ "stops": [
+ {
+ "color": "#003ae9",
+ "opacity": 1,
+ "offset": 0
+ },
+ {
+ "color": "#003ae9",
+ "opacity": 0,
+ "offset": 1
+ }
+ ]
+ }
+ }];
+ // for a image fill
+ const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');
+ shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
+
+ shape.borderRadius = 8;
+ shape.strokes = [
+ {
+ strokeColor: "#2e3434",
+ strokeStyle: "solid",
+ strokeWidth: 2,
+ strokeAlignment: "center",
+ },
+ ];
```
createBoard: |-
```
@@ -5983,7 +6321,16 @@ Context:
Example
```
- const board = penpot.createBoard();// to add grid layoutboard.addGridLayout();// to add flex layoutboard.addFlexLayout();// to create a shape inside the boardconst shape = penpot.createRectangle();board.appendChild(shape);
+ const board = penpot.createBoard();
+
+ // to add grid layout
+ board.addGridLayout();
+ // to add flex layout
+ board.addFlexLayout();
+
+ // to create a shape inside the board
+ const shape = penpot.createRectangle();
+ board.appendChild(shape);
```
createEllipse: |-
```
@@ -5996,7 +6343,47 @@ Context:
Example
```
- const shape = penpot.createEllipse();// just change the values like thisshape.name = "Example ellipse";// for solid colorshape.fills = [{ fillColor: "#7EFFF5" }];// for linear gradient colorshape.fills = [{ fillColorGradient: { "type": "linear", "startX": 0.5, "startY": 0, "endX": 0.5, "endY": 1, "width": 1, "stops": [ { "color": "#003ae9", "opacity": 1, "offset": 0 }, { "color": "#003ae9", "opacity": 0, "offset": 1 } ] }}];// for an image fillconst imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');shape.fills = [{ fillOpacity: 1, fillImage: imageData }];shape.strokes = [ { strokeColor: "#2e3434", strokeStyle: "solid", strokeWidth: 2, strokeAlignment: "center", },];
+ const shape = penpot.createEllipse();
+ // just change the values like this
+ shape.name = "Example ellipse";
+
+ // for solid color
+ shape.fills = [{ fillColor: "#7EFFF5" }];
+ // for linear gradient color
+ shape.fills = [{
+ fillColorGradient: {
+ "type": "linear",
+ "startX": 0.5,
+ "startY": 0,
+ "endX": 0.5,
+ "endY": 1,
+ "width": 1,
+ "stops": [
+ {
+ "color": "#003ae9",
+ "opacity": 1,
+ "offset": 0
+ },
+ {
+ "color": "#003ae9",
+ "opacity": 0,
+ "offset": 1
+ }
+ ]
+ }
+ }];
+ // for an image fill
+ const imageData = await context.uploadMediaUrl('example', 'https://example.com/image.jpg');
+ shape.fills = [{ fillOpacity: 1, fillImage: imageData }];
+
+ shape.strokes = [
+ {
+ strokeColor: "#2e3434",
+ strokeStyle: "solid",
+ strokeWidth: 2,
+ strokeAlignment: "center",
+ },
+ ];
```
createPath: |-
```
@@ -6009,7 +6396,11 @@ Context:
Example
```
- const path = penpot.createPath();path.name = "My path";// for solid colorpath.fills = [{ fillColor: "#7EFFF5" }];
+ const path = penpot.createPath();
+ path.name = "My path";
+
+ // for solid color
+ path.fills = [{ fillColor: "#7EFFF5" }];
```
createBoolean: |-
```
@@ -6098,7 +6489,16 @@ Context:
Example
```
- const board = penpot.createBoard();let text;text = penpot.createText();// just change the values like thistext.growType = 'auto-height';text.fontFamily = 'Work Sans';text.fontSize = '12';text.fills = [{fillColor: '#9f05ff', fillOpacity: 1}];text.strokes = [{strokeOpacity: 1, strokeStyle: 'solid', strokeWidth: 2, strokeColor: '#deabff', strokeAlignment: 'outer'}];board.appendChild(text);
+ const board = penpot.createBoard();
+ let text;
+ text = penpot.createText();
+ // just change the values like this
+ text.growType = 'auto-height';
+ text.fontFamily = 'Work Sans';
+ text.fontSize = '12';
+ text.fills = [{fillColor: '#9f05ff', fillOpacity: 1}];
+ text.strokes = [{strokeOpacity: 1, strokeStyle: 'solid', strokeWidth: 2, strokeColor: '#deabff', strokeAlignment: 'outer'}];
+ board.appendChild(text);
```
generateMarkup: |-
```
@@ -6120,7 +6520,8 @@ Context:
Example
```
- const markup = context.generateMarkup(shapes, { type: 'html' });console.log(markup);
+ const markup = context.generateMarkup(shapes, { type: 'html' });
+ console.log(markup);
```
generateStyle: |-
```
@@ -6150,7 +6551,8 @@ Context:
Example
```
- const styles = context.generateStyle(shapes, { type: 'css' });console.log(styles);
+ const styles = context.generateStyle(shapes, { type: 'css' });
+ console.log(styles);
```
generateFontFaces: |-
```
@@ -6168,7 +6570,8 @@ Context:
Example
```
- const fontfaces = context.generateFontFaces(penpot.selection);console.log(fontfaces);
+ const fontfaces = context.generateFontFaces(penpot.selection);
+ console.log(fontfaces);
```
addListener: |-
```
@@ -6195,7 +6598,9 @@ Context:
Example
```
- const listenerId = context.addListener('selectionchange', (event) => { console.log(event);});
+ const listenerId = context.addListener('selectionchange', (event) => {
+ console.log(event);
+ });
```
removeListener: |-
```
@@ -6237,7 +6642,12 @@ Context:
Example
```
- const page = penpot.createPage();page.name = 'New Page';await penpot.openPage(page); // make the new page active firstconst board = penpot.createBoard();board.resize(375, 812);page.root.appendChild(board);
+ const page = penpot.createPage();
+ page.name = 'New Page';
+ await penpot.openPage(page); // make the new page active first
+ const board = penpot.createBoard();
+ board.resize(375, 812);
+ page.root.appendChild(board);
```
openPage: |-
```
@@ -6392,7 +6802,8 @@ ContextGeometryUtils:
Example
```
- const centerPoint = geometryUtils.center(shapes);console.log(centerPoint);
+ const centerPoint = geometryUtils.center(shapes);
+ console.log(centerPoint);
```
```
@@ -6424,7 +6835,8 @@ ContextGeometryUtils:
Example
```
- const centerPoint = geometryUtils.center(shapes);console.log(centerPoint);
+ const centerPoint = geometryUtils.center(shapes);
+ console.log(centerPoint);
```
ContextTypesUtils:
overview: |-
@@ -6435,7 +6847,8 @@ ContextTypesUtils:
Example
```
- const isBoard = typesUtils.isBoard(shape);console.log(isBoard);
+ const isBoard = typesUtils.isBoard(shape);
+ console.log(isBoard);
```
```
@@ -6664,7 +7077,8 @@ ContextUtils:
Example
```
- const centerPoint = penpot.utils.geometry.center(shapes);console.log(centerPoint);
+ const centerPoint = penpot.utils.geometry.center(shapes);
+ console.log(centerPoint);
```
types: |-
```
@@ -6676,7 +7090,8 @@ ContextUtils:
Example
```
- const isBoard = utils.types.isBoard(shape);console.log(isBoard);
+ const isBoard = utils.types.isBoard(shape);
+ console.log(isBoard);
```
Dissolve:
overview: |-
@@ -6802,6 +7217,10 @@ Ellipse:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -6838,6 +7257,7 @@ Ellipse:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -7147,6 +7567,10 @@ Ellipse:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -7206,7 +7630,8 @@ Ellipse:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -7243,7 +7668,8 @@ Ellipse:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -7267,7 +7693,8 @@ Ellipse:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -7313,7 +7740,8 @@ Ellipse:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -7443,6 +7871,18 @@ Ellipse:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -7651,6 +8091,11 @@ Ellipse:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -7701,7 +8146,9 @@ EventsMap:
Example
```
- penpot.on('pagechange', (event) => { console.log(event);});
+ penpot.on('pagechange', (event) => {
+ console.log(event);
+ });
```
```
@@ -7950,7 +8397,8 @@ File:
Example
```
- const errors = file.validate();if (errors.length) console.error(errors);
+ const errors = file.validate();
+ if (errors.length) console.error(errors);
```
getPluginData: |-
```
@@ -7971,7 +8419,8 @@ File:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -8008,7 +8457,8 @@ File:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -8032,7 +8482,8 @@ File:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -8078,7 +8529,8 @@ File:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
FileValidationError:
overview: |-
@@ -8799,7 +9251,10 @@ FontsContext:
Example
```
- const font = fontsContext.findById('font-id');if (font) { console.log(font.name);}
+ const font = fontsContext.findById('font-id');
+ if (font) {
+ console.log(font.name);
+ }
```
findByName: |-
```
@@ -8820,7 +9275,10 @@ FontsContext:
Example
```
- const font = fontsContext.findByName('font-name');if (font) { console.log(font.name);}
+ const font = fontsContext.findByName('font-name');
+ if (font) {
+ console.log(font.name);
+ }
```
findAllById: |-
```
@@ -8841,7 +9299,8 @@ FontsContext:
Example
```
- const fonts = fontsContext.findAllById('font-id');console.log(fonts);
+ const fonts = fontsContext.findAllById('font-id');
+ console.log(fonts);
```
findAllByName: |-
```
@@ -8862,7 +9321,8 @@ FontsContext:
Example
```
- const fonts = fontsContext.findAllByName('font-name');console.log(fonts);
+ const fonts = fontsContext.findAllByName('font-name');
+ console.log(fonts);
```
GridLayout:
overview: |-
@@ -9129,7 +9589,9 @@ GridLayout:
Example
```
- const board = penpot.createBoard();const grid = board.addGridLayout();grid.addRow("flex", 1);
+ const board = penpot.createBoard();
+ const grid = board.addGridLayout();
+ grid.addRow("flex", 1);
```
addRowAtIndex: |-
```
@@ -9176,7 +9638,9 @@ GridLayout:
Example
```
- const board = penpot.createBoard();const grid = board.addGridLayout();grid.addColumn('percent', 50);
+ const board = penpot.createBoard();
+ const grid = board.addGridLayout();
+ grid.addColumn('percent', 50);
```
addColumnAtIndex: |-
```
@@ -9410,6 +9874,10 @@ Group:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -9446,6 +9914,7 @@ Group:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -9759,6 +10228,10 @@ Group:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -9884,7 +10357,8 @@ Group:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -9921,7 +10395,8 @@ Group:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -9945,7 +10420,8 @@ Group:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -9991,7 +10467,8 @@ Group:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -10121,6 +10598,18 @@ Group:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -10329,6 +10818,11 @@ Group:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -10713,6 +11207,10 @@ Image:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -10749,6 +11247,7 @@ Image:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -11058,6 +11557,10 @@ Image:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -11117,7 +11620,8 @@ Image:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -11154,7 +11658,8 @@ Image:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -11178,7 +11683,8 @@ Image:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -11224,7 +11730,8 @@ Image:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -11354,6 +11861,18 @@ Image:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -11562,6 +12081,11 @@ Image:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -11889,6 +12413,7 @@ Library:
colors: LibraryColor[];
typographies: LibraryTypography[];
components: LibraryComponent[];
+ deletedComponents: LibraryComponent[];
tokens: TokenCatalog;
createColor(): LibraryColor;
createTypography(): LibraryTypography;
@@ -11950,6 +12475,13 @@ Library:
```
console.log(penpot.library.local.components
```
+ deletedComponents: |-
+ ```
+ readonly deletedComponents: LibraryComponent[]
+ ```
+
+ Deleted components, including individual deleted variants.
+ Use a component's `restore()` method to restore it.
tokens: |-
```
readonly tokens: TokenCatalog
@@ -11972,7 +12504,8 @@ Library:
Example
```
- const newColor = penpot.library.local.createColor();console.log(newColor);
+ const newColor = penpot.library.local.createColor();
+ console.log(newColor);
```
createTypography: |-
```
@@ -12029,7 +12562,8 @@ Library:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -12066,7 +12600,8 @@ Library:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -12090,7 +12625,8 @@ Library:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -12136,7 +12672,8 @@ Library:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
LibraryColor:
overview: |-
@@ -12273,7 +12810,8 @@ LibraryColor:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -12310,7 +12848,8 @@ LibraryColor:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -12334,7 +12873,8 @@ LibraryColor:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -12380,7 +12920,8 @@ LibraryColor:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
LibraryComponent:
overview: |-
@@ -12392,6 +12933,10 @@ LibraryComponent:
```
interface LibraryComponent {
+ annotation: string | null;
+ duplicate(): LibraryComponent;
+ remove(): void;
+ restore(): void;
instance(): Shape;
mainInstance(): Shape;
isVariant(): this is LibraryVariantComponent;
@@ -12415,9 +12960,18 @@ LibraryComponent:
+ LibraryComponent
- LibraryVariantComponent
- Referenced by: Board, Boolean, ContextTypesUtils, Ellipse, Group, Image, Library, Path, Rectangle, ShapeBase, SvgRaw, Text, VariantContainer, Variants
+ Referenced by: Board, Boolean, ContextTypesUtils, Ellipse, Group, Image, Library, LibraryComponent, LibraryVariantComponent, Path, Rectangle, ShapeBase, SvgRaw, Text, VariantContainer, Variants
members:
Properties:
+ annotation: |-
+ ```
+ annotation: string | null
+ ```
+
+ The component annotation, or null when none is set.
+ Set null to delete it. Text can contain at most 300 characters.
+ Writing requires `library:write` permission and a live component in the
+ current file's library.
id: |-
```
readonly id: string
@@ -12443,6 +12997,41 @@ LibraryComponent:
The path of the library element.
Methods:
+ duplicate: |-
+ ```
+ duplicate(): LibraryComponent
+ ```
+
+ Duplicates this component and its main instance in the current file's library.
+ Requires `library:write` permission. The component must not be deleted.
+
+ Returns LibraryComponent
+ remove: |-
+ ```
+ remove(): void
+ ```
+
+ Deletes this component and its main instance from the current file's library.
+ Requires `library:write` permission. Does nothing if already deleted.
+ Surviving copies keep their link so the component can be restored later.
+
+ Returns void
+ restore: |-
+ ```
+ restore(): void
+ ```
+
+ Restores this component if it has been deleted, including its main instance,
+ in the current file's library.
+ Leaves the current page, selection, zoom, and viewport unchanged.
+ Requires `library:write` permission. Does nothing if already restored.
+
+ Returns void
+
+ Example
+ ```
+ penpot.selection[0].component()?.restore();
+ ```
instance: |-
```
instance(): Shape
@@ -12505,7 +13094,8 @@ LibraryComponent:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -12542,7 +13132,8 @@ LibraryComponent:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -12566,7 +13157,8 @@ LibraryComponent:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -12612,7 +13204,8 @@ LibraryComponent:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
LibraryVariantComponent:
overview: |-
@@ -12624,6 +13217,10 @@ LibraryVariantComponent:
```
interface LibraryVariantComponent {
+ annotation: string | null;
+ duplicate(): LibraryComponent;
+ remove(): void;
+ restore(): void;
instance(): Shape;
mainInstance(): Shape;
isVariant(): this is LibraryVariantComponent;
@@ -12654,6 +13251,15 @@ LibraryVariantComponent:
Referenced by: ContextTypesUtils, LibraryComponent, LibraryVariantComponent
members:
Properties:
+ annotation: |-
+ ```
+ annotation: string | null
+ ```
+
+ The component annotation, or null when none is set.
+ Set null to delete it. Text can contain at most 300 characters.
+ Writing requires `library:write` permission and a live component in the
+ current file's library.
variants: |-
```
readonly variants: Variants | null
@@ -12698,6 +13304,41 @@ LibraryVariantComponent:
The path of the library element.
Methods:
+ duplicate: |-
+ ```
+ duplicate(): LibraryComponent
+ ```
+
+ Duplicates this component and its main instance in the current file's library.
+ Requires `library:write` permission. The component must not be deleted.
+
+ Returns LibraryComponent
+ remove: |-
+ ```
+ remove(): void
+ ```
+
+ Deletes this component and its main instance from the current file's library.
+ Requires `library:write` permission. Does nothing if already deleted.
+ Surviving copies keep their link so the component can be restored later.
+
+ Returns void
+ restore: |-
+ ```
+ restore(): void
+ ```
+
+ Restores this component if it has been deleted, including its main instance,
+ in the current file's library.
+ Leaves the current page, selection, zoom, and viewport unchanged.
+ Requires `library:write` permission. Does nothing if already restored.
+
+ Returns void
+
+ Example
+ ```
+ penpot.selection[0].component()?.restore();
+ ```
instance: |-
```
instance(): Shape
@@ -12785,7 +13426,8 @@ LibraryVariantComponent:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -12822,7 +13464,8 @@ LibraryVariantComponent:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -12846,7 +13489,8 @@ LibraryVariantComponent:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -12892,7 +13536,8 @@ LibraryVariantComponent:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
LibraryElement:
overview: |-
@@ -12970,7 +13615,8 @@ LibraryElement:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -13007,7 +13653,8 @@ LibraryElement:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -13031,7 +13678,8 @@ LibraryElement:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -13077,7 +13725,8 @@ LibraryElement:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
LibrarySummary:
overview: |-
@@ -13331,7 +13980,8 @@ LibraryTypography:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -13368,7 +14018,8 @@ LibraryTypography:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -13392,7 +14043,8 @@ LibraryTypography:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -13438,7 +14090,8 @@ LibraryTypography:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
LocalStorage:
overview: |-
@@ -13869,7 +14522,8 @@ Page:
Example
```
- const page = penpot.createPage();page.remove();
+ const page = penpot.createPage();
+ page.remove();
```
getShapeById: |-
```
@@ -14075,7 +14729,8 @@ Page:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -14112,7 +14767,8 @@ Page:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -14136,7 +14792,8 @@ Page:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -14182,7 +14839,8 @@ Page:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
Path:
overview: |-
@@ -14275,6 +14933,10 @@ Path:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -14311,6 +14973,7 @@ Path:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -14642,6 +15305,10 @@ Path:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -14715,7 +15382,8 @@ Path:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -14752,7 +15420,8 @@ Path:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -14776,7 +15445,8 @@ Path:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -14822,7 +15492,8 @@ Path:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -14952,6 +15623,18 @@ Path:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -15160,6 +15843,11 @@ Path:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -15394,7 +16082,8 @@ PluginData:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -15431,7 +16120,8 @@ PluginData:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -15455,7 +16145,8 @@ PluginData:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -15501,7 +16192,8 @@ PluginData:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
PreviousScreen:
overview: |-
@@ -15656,6 +16348,10 @@ Rectangle:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -15692,6 +16388,7 @@ Rectangle:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -16001,6 +16698,10 @@ Rectangle:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -16060,7 +16761,8 @@ Rectangle:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -16097,7 +16799,8 @@ Rectangle:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -16121,7 +16824,8 @@ Rectangle:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -16167,7 +16871,8 @@ Rectangle:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -16297,6 +17002,18 @@ Rectangle:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -16505,6 +17222,11 @@ Rectangle:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -16756,6 +17478,10 @@ ShapeBase:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -16792,6 +17518,7 @@ ShapeBase:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -17100,6 +17827,10 @@ ShapeBase:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -17159,7 +17890,8 @@ ShapeBase:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -17196,7 +17928,8 @@ ShapeBase:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -17220,7 +17953,8 @@ ShapeBase:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -17266,7 +18000,8 @@ ShapeBase:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -17396,6 +18131,18 @@ ShapeBase:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -17604,6 +18351,11 @@ ShapeBase:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -17707,8 +18459,8 @@ Stroke:
Interface Stroke
================
- Represents stroke properties in Penpot. You can add a stroke to any shape except for groups.
- This interface includes properties for defining the color, style, width, alignment, and caps of a stroke.
+ Stroke properties for any shape except groups.
+ Literals apply strokeWidth before top/right/bottom/left widths.
```
interface Stroke {
@@ -17718,6 +18470,11 @@ Stroke:
strokeOpacity?: number;
strokeStyle?: "none" | "svg" | "mixed" | "solid" | "dotted" | "dashed";
strokeWidth?: number;
+ strokeWidthType?: "simple" | "multiple";
+ strokeWidthTop?: number;
+ strokeWidthRight?: number;
+ strokeWidthBottom?: number;
+ strokeWidthLeft?: number;
strokeAlignment?: "center" | "inner" | "outer";
strokeCapStart?: StrokeCap;
strokeCapEnd?: StrokeCap;
@@ -17765,7 +18522,41 @@ Stroke:
strokeWidth?: number
```
- The optional width of the stroke.
+ Reads the top width. Setting it selects simple mode and sets all four sides.
+ strokeWidthType: |-
+ ```
+ readonly strokeWidthType?: "simple" | "multiple"
+ ```
+
+ Computed width mode: simple when all four effective widths match, multiple otherwise.
+ strokeWidthTop: |-
+ ```
+ strokeWidthTop?: number
+ ```
+
+ Top side width; setting it preserves the other side widths.
+ Boards and rectangles only; other shape types raise a validation error.
+ strokeWidthRight: |-
+ ```
+ strokeWidthRight?: number
+ ```
+
+ Right side width; setting it preserves the other side widths.
+ Boards and rectangles only; other shape types raise a validation error.
+ strokeWidthBottom: |-
+ ```
+ strokeWidthBottom?: number
+ ```
+
+ Bottom side width; setting it preserves the other side widths.
+ Boards and rectangles only; other shape types raise a validation error.
+ strokeWidthLeft: |-
+ ```
+ strokeWidthLeft?: number
+ ```
+
+ Left side width; setting it preserves the other side widths.
+ Boards and rectangles only; other shape types raise a validation error.
strokeAlignment: |-
```
strokeAlignment?: "center" | "inner" | "outer"
@@ -17883,6 +18674,10 @@ SvgRaw:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -17919,6 +18714,7 @@ SvgRaw:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -18221,6 +19017,10 @@ SvgRaw:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -18286,7 +19086,8 @@ SvgRaw:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -18323,7 +19124,8 @@ SvgRaw:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -18347,7 +19149,8 @@ SvgRaw:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -18393,7 +19196,8 @@ SvgRaw:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -18523,6 +19327,18 @@ SvgRaw:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -18731,6 +19547,11 @@ SvgRaw:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -18858,6 +19679,10 @@ Text:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -18894,6 +19719,7 @@ Text:
detach(): void;
swapComponent(component: LibraryComponent): void;
resetOverrides(): void;
+ updateMain(): void;
switchVariant(pos: number, value: string): void;
combineAsVariants(ids: string[]): VariantContainer;
isVariantHead(): boolean;
@@ -19214,6 +20040,10 @@ Text:
shadow: string;
strokeColor: string;
strokeWidth: string;
+ strokeWidthTop: string;
+ strokeWidthRight: string;
+ strokeWidthBottom: string;
+ strokeWidthLeft: string;
fontFamilies: string;
fontSize: string;
fontWeight: string;
@@ -19381,7 +20211,8 @@ Text:
Example
```
- const data = shape.getPluginData('exampleKey');console.log(data);
+ const data = shape.getPluginData('exampleKey');
+ console.log(data);
```
setPluginData: |-
```
@@ -19418,7 +20249,8 @@ Text:
Example
```
- const keys = shape.getPluginDataKeys();console.log(keys);
+ const keys = shape.getPluginDataKeys();
+ console.log(keys);
```
getSharedPluginData: |-
```
@@ -19442,7 +20274,8 @@ Text:
Example
```
- const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');console.log(sharedData);
+ const sharedData = shape.getSharedPluginData('exampleNamespace', 'exampleKey');
+ console.log(sharedData);
```
setSharedPluginData: |-
```
@@ -19488,7 +20321,8 @@ Text:
Example
```
- const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');console.log(sharedKeys);
+ const sharedKeys = shape.getSharedPluginDataKeys('exampleNamespace');
+ console.log(sharedKeys);
```
setParentIndex: |-
```
@@ -19618,6 +20452,18 @@ Text:
Similar to the "reset overrides" action on the Penpot interface.
The current shape must be a component copy instance.
+ Returns void
+ updateMain: |-
+ ```
+ updateMain(): void
+ ```
+
+ Applies this copy's overrides to its main component and synchronizes copies.
+ Similar to the editor's "update main component" action.
+ Requires `content:write` and `library:write` permissions.
+ The shape must be a component copy head on the active page of the current file,
+ outside any other component copy, with a main component that is not deleted.
+
Returns void
switchVariant: |-
```
@@ -19826,6 +20672,11 @@ Text:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties (`strokeWidthTop`,
+ `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`) are only valid on
+ boards and rectangles. Applying one to any other shape raises a validation
+ error. The uniform `strokeWidth` property is accepted on every shape.
+
Returns void
clone: |-
```
@@ -19888,7 +20739,8 @@ Text:
Example
```
- const textRange = textShape.getRange(0, 10);console.log(textRange.characters);
+ const textRange = textShape.getRange(0, 10);
+ console.log(textRange.characters);
```
applyTypography: |-
```
@@ -20323,6 +21175,10 @@ TokenBase:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -20464,6 +21320,10 @@ TokenBorderRadius:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -20727,6 +21587,10 @@ TokenShadow:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -20868,6 +21732,10 @@ TokenColor:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21009,6 +21877,10 @@ TokenDimension:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21153,6 +22025,10 @@ TokenFontFamilies:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21294,6 +22170,10 @@ TokenFontSizes:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21436,6 +22316,10 @@ TokenFontWeights:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21577,6 +22461,10 @@ TokenLetterSpacing:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21718,6 +22606,10 @@ TokenNumber:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -21860,6 +22752,10 @@ TokenOpacity:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22002,6 +22898,10 @@ TokenRotation:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22143,6 +23043,10 @@ TokenSizing:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22284,6 +23188,10 @@ TokenSpacing:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22425,6 +23333,10 @@ TokenBorderWidth:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22567,6 +23479,10 @@ TokenTextCase:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22709,6 +23625,10 @@ TokenTextDecoration:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -22985,6 +23905,10 @@ TokenTypography:
and the value set to the attributes will depend on which sets are active
(and will change if different sets or themes are activated later).
+ NOTE that the per-side stroke width properties are only valid on boards and
+ rectangles; applying one to any other shape raises a validation error. The
+ uniform `strokeWidth` property is accepted on every shape.
+
Returns void
applyToSelected: |-
```
@@ -23414,7 +24338,8 @@ User:
Example
```
- const userId = user.id;console.log(userId);
+ const userId = user.id;
+ console.log(userId);
```
name: |-
```
@@ -23425,7 +24350,8 @@ User:
Example
```
- const userName = user.name;console.log(userName);
+ const userName = user.name;
+ console.log(userName);
```
avatarUrl: |-
```
@@ -23436,7 +24362,8 @@ User:
Example
```
- const avatarUrl = user.avatarUrl;console.log(avatarUrl);
+ const avatarUrl = user.avatarUrl;
+ console.log(avatarUrl);
```
color: |-
```
@@ -23447,7 +24374,8 @@ User:
Example
```
- const userColor = user.color;console.log(userColor);
+ const userColor = user.color;
+ console.log(userColor);
```
sessionId: |-
```
@@ -23458,7 +24386,8 @@ User:
Example
```
- const sessionId = user.sessionId;console.log(sessionId);
+ const sessionId = user.sessionId;
+ console.log(sessionId);
```
Variants:
overview: |-
@@ -23703,7 +24632,8 @@ Bounds:
Example
```
- const bounds = { x: 50, y: 50, width: 200, height: 100 };console.log(bounds);
+ const bounds = { x: 50, y: 50, width: 200, height: 100 };
+ console.log(bounds);
```
```
@@ -24066,7 +24996,10 @@ Shape:
Example
```
- let shape: Shape;if (penpot.utils.types.isRectangle(shape)) { console.log(shape.type);}
+ let shape: Shape;
+ if (penpot.utils.types.isRectangle(shape)) {
+ console.log(shape.type);
+ }
```
Referenced by: Board, Boolean, Context, ContextGeometryUtils, ContextTypesUtils, Ellipse, EventsMap, FlexLayout, GridLayout, Group, Image, Interaction, Library, LibraryComponent, LibraryTypography, LibraryVariantComponent, OpenOverlay, OverlayAction, Page, Path, Penpot, Rectangle, ShapeBase, SvgRaw, Text, ToggleOverlay, TokenBase, TokenBorderRadius, TokenBorderWidth, TokenColor, TokenDimension, TokenFontFamilies, TokenFontSizes, TokenFontWeights, TokenLetterSpacing, TokenNumber, TokenOpacity, TokenRotation, TokenShadow, TokenSizing, TokenSpacing, TokenTextCase, TokenTextDecoration, TokenTypography, VariantContainer, Viewport
@@ -24239,7 +25172,14 @@ TokenDimensionProps:
==============================
```
- TokenDimensionProps: "x" | "y" | "strokeWidth"
+ TokenDimensionProps:
+ | "x"
+ | "y"
+ | "strokeWidth"
+ | "strokeWidthTop"
+ | "strokeWidthRight"
+ | "strokeWidthBottom"
+ | "strokeWidthLeft"
```
The properties that a Dimension token can be applied to.
@@ -24372,7 +25312,12 @@ TokenBorderWidthProps:
================================
```
- TokenBorderWidthProps: "strokeWidth"
+ TokenBorderWidthProps:
+ | "strokeWidth"
+ | "strokeWidthTop"
+ | "strokeWidthRight"
+ | "strokeWidthBottom"
+ | "strokeWidthLeft"
```
The properties that a BorderWidth token can be applied to.
diff --git a/mcp/packages/server/data/initial_instructions.md b/mcp/packages/server/data/initial_instructions.md
index 66c2c642da..fbca1c5bad 100644
--- a/mcp/packages/server/data/initial_instructions.md
+++ b/mcp/packages/server/data/initial_instructions.md
@@ -19,10 +19,28 @@ This allows you to inspect intermediate results while still being able to build
## Asynchronous Updates
Changes made to a design may take effect asynchronously.
-So if you need to read the result of your executions/observe properties affected by a change in the same `execude_code` call, use
+So if you need to read the result of your executions/observe properties affected by a change in the same `execute_code` call, use
`await penpot.waitForLayoutUpdate();`
before trying to observe changes.
-Every `execude_code` call waits for updates before applying your code, so you never need to call `waitForLayoutUpdate` at the beginning of your code.
+To wait only for a single shape (and its children), use `await shape.waitForLayoutUpdate();`.
+Both accept an optional timeout in milliseconds (default 30000) and reject when it elapses.
+Every `execute_code` call waits for updates before applying your code, so you never need to call `waitForLayoutUpdate` at the beginning of your code.
+
+## Rejected Changes and Read-Only Mode
+
+Penpot saves your changes to the backend after your `execute_code` call returns.
+When the backend rejects a save, Penpot undoes the rejected changes, together with the rest of their undo steps
+and any later change to the same file. This can happen a few seconds after the call that made the changes succeeded.
+The next tool response then starts with a warning that names the files, pages and shapes involved.
+When you get this warning:
+ * Do not trust what you know about the design from before: shapes you created may be gone, and removed ones may be back.
+ * Read the affected pages and shapes again (e.g. `penpotUtils.shapeStructure(page.root, 3)`) and check that they hold what you expect.
+ * Redo the missing changes, then check again; if the same changes are rejected again, stop and tell the user.
+
+While saves are failing, the workspace becomes read-only: every write through the API throws an error saying that the
+workspace is read-only because changes cannot be saved. Do not retry in a loop; wait and try again later, or tell the user.
+Writes also throw when the user cannot edit the file, a version is being previewed or the canvas stopped rendering;
+the error says which. These do not pass by waiting: tell the user.
# The Structure of Penpot Designs
@@ -57,6 +75,8 @@ Actual low-level shape types are `Rectangle`, `Path`, `Text`, `Ellipse`, `Image`
The objects are not shared references; you can modify properties of the fills in the target shape without affecting the source shape.
- Colors: Use hex strings with caps only (e.g. '#FF5533')
- IMPORTANT: The contents of the arrays are read-only. You cannot modify individual fills/strokes; you need to replace the entire array to change them!
+ - Per-side stroke widths (boards and rectangles only; other shapes raise a validation error): `strokeWidthTop`, `strokeWidthRight`, `strokeWidthBottom`, `strokeWidthLeft`.
+ Setting `strokeWidth` sets all four sides. Read-only `strokeWidthType` is `"simple"` when all four widths match, `"multiple"` otherwise.
* `borderRadius` - Uniform border radius for all corners
* `borderRadiusTopLeft`, `borderRadiusTopRight`, `borderRadiusBottomRight`, `borderRadiusBottomLeft` - Individual corner radii.
* `blur: Blur` - Blur properties
@@ -206,6 +226,9 @@ General pointers for working with Penpot designs:
* Prefer `penpotUtils` helper functions — avoid reimplementing shape searching.
* To get an overview of a single page, use `penpotUtils.shapeStructure(page.root, 3)`.
Note that `penpot.root` refers to the current page only. When working across pages, first determine the relevant page(s).
+ * IMPORTANT: Shapes can only be created or modified on the active page; changes to shapes on other pages raise a validation error.
+ To work on another page, first activate it with `await penpot.openPage(page)`.
+ `penpot.createPage()` does NOT activate the new page; call `openPage` before adding shapes to it.
* Use `penpotUtils.findShapes()` or `penpotUtils.findShape()` with predicates to locate elements efficiently.
Common tasks - Quick Reference (ALWAYS use penpotUtils for these):
@@ -295,6 +318,17 @@ Detaching:
* When creating new design elements based on a component instance/copy, use `shape.detach()` to break the link to the main component, allowing independent modification.
* Without detaching, some manipulations will have no effect; e.g. child/descendant removal will not work.
+Syncing copies and main components:
+ * `copy.resetOverrides()` - restores a copy (and its children) to the attributes of its main component.
+ * `copy.updateMain()` - applies the overrides of a copy to its main component and syncs all copies.
+ The copy must be a copy head on the active page, not nested in another copy.
+
+Managing components (current file's library only):
+ * `component.remove()` - deletes the component and its main instance; existing copies keep their link.
+ * `library.deletedComponents: LibraryComponent[]` - deleted components; `component.restore()` brings one back.
+ * `component.duplicate(): LibraryComponent` - duplicates the component and its main instance.
+ * `component.annotation: string | null` - writable annotation (max. 300 characters); set `null` to delete it.
+
### Variants
Variants are a system for grouping related component versions along named property axes (e.g. Type, Style), powering a structured swap UI for designers using component instances.
@@ -357,11 +391,16 @@ The token library: `penpot.library.local.tokens` (type: `TokenCatalog`)
* `addSet({name: string}): TokenSet` - Create new set
* `addTheme({group: string, name: string}): TokenTheme` - Create new theme
+Token source: `penpot.library.tokensSource: Library` is the library that supplies the file's tokens (default: `penpot.library.local`).
+ * Assigning a connected library makes its tokens the file's tokens; assign `penpot.library.local` to use local tokens again.
+ * With an external source, `penpot.library.local.tokens` lists the source's tokens and is where you toggle active sets/themes;
+ the source library's own catalog is read-only.
+
`TokenSet` contains tokens with unique names:
* `active: boolean` - Only active sets affect shapes; use `set.toggleActive()` to change: `if (!set.active) set.toggleActive();`
* `tokens: Token[]` - All tokens in set
* `addToken({type: TokenType, name: string, value: TokenValueString}): Token` - Creates a token, adding it to the set.
- - `TokenType`: "color" | "dimension" | "spacing" | "typography" | "shadow" | "opacity" | "borderRadius" | "borderWidth" | "fontWeights" | "fontSizes" | "fontFamilies" | "letterSpacing" | "textDecoration" | "textCase"
+ - `TokenType`: "color" | "dimension" | "spacing" | "sizing" | "typography" | "shadow" | "opacity" | "number" | "rotation" | "borderRadius" | "borderWidth" | "fontWeights" | "fontSizes" | "fontFamilies" | "letterSpacing" | "textDecoration" | "textCase"
- `value`: depends on the type of token (inspect `Token` and related types)
- Examples:
const token = set.addToken({type: "color", name: "color.primary", value: "#0066FF"}); // direct value
@@ -387,7 +426,7 @@ Applying tokens:
- TokenBorderRadiusProps: "borderRadiusTopLeft", "borderRadiusTopRight", "borderRadiusBottomRight", "borderRadiusBottomLeft"
- TokenShadowProps: "shadow"
- TokenColorProps: "fill", "strokeColor"
- - TokenDimensionProps: "x", "y", "strokeWidth"
+ - TokenDimensionProps: "x", "y", "strokeWidth", "strokeWidthTop", "strokeWidthRight", "strokeWidthBottom", "strokeWidthLeft"
- TokenFontFamiliesProps: "fontFamilies"
- TokenFontSizesProps: "fontSize"
- TokenFontWeightProps: "fontWeight"
@@ -396,10 +435,11 @@ Applying tokens:
- TokenOpacityProps: "opacity"
- TokenSizingProps: "width", "height", "layoutItemMinW", "layoutItemMaxW", "layoutItemMinH", "layoutItemMaxH"
- TokenSpacingProps: "rowGap", "columnGap", "paddingLeft", "paddingTop", "paddingRight", "paddingBottom", "marginLeft", "marginTop", "marginRight", "marginBottom"
- - TokenBorderWidthProps: "strokeWidth"
+ - TokenBorderWidthProps: "strokeWidth", "strokeWidthTop", "strokeWidthRight", "strokeWidthBottom", "strokeWidthLeft"
- TokenTextCaseProps: "textCase"
- TokenTextDecorationProps: "textDecoration"
- TokenTypographyProps: "typography"
+ The per-side stroke width properties apply only to boards and rectangles; `strokeWidth` works on every shape.
* `token.applyToShapes(shapes, properties)` - Apply from token
* Application is **asynchronous** (use `waitForLayoutUpdate`)
* After application:
diff --git a/mcp/packages/server/package.json b/mcp/packages/server/package.json
index ee816a759b..0bd3d8ae01 100644
--- a/mcp/packages/server/package.json
+++ b/mcp/packages/server/package.json
@@ -25,17 +25,17 @@
"author": "",
"license": "MIT",
"engines": {
- "node": ">=20"
+ "node": ">=20.20.2"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"dependencies": {
"@modelcontextprotocol/node": "^2.1.1",
"@modelcontextprotocol/server": "^2.3.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.15.1",
- "express": "^5.2.1",
+ "express": "^5.3.0",
"ioredis": "^6.0.0",
- "js-yaml": "^5.4.2",
+ "js-yaml": "^5.5.0",
"nrepl-client": "^0.3.0",
"pino": "^10.4.0",
"pino-loki": "^3.0.0",
@@ -43,14 +43,14 @@
"reflect-metadata": "^0.2.2",
"sharp": "^0.35.5",
"ws": "^8.22.0",
- "zod": "^4.6.5"
+ "zod": "^4.6.7"
},
"devDependencies": {
"@modelcontextprotocol/client": "^2.3.1",
"@penpot/mcp-common": "workspace:../common",
"@types/express": "^5.0.6",
"@types/js-yaml": "^4.0.9",
- "@types/node": "^26.6.4",
+ "@types/node": "^26.6.5",
"@types/ws": "^8.18.2",
"cross-env": "^10.1.0",
"esbuild": "^0.28.1",
diff --git a/mcp/packages/server/src/Feedback.test.ts b/mcp/packages/server/src/Feedback.test.ts
new file mode 100644
index 0000000000..be92aac8ea
--- /dev/null
+++ b/mcp/packages/server/src/Feedback.test.ts
@@ -0,0 +1,240 @@
+import assert from "node:assert/strict";
+import { createServer, type Server } from "node:http";
+import { once } from "node:events";
+import { afterEach, beforeEach, test } from "node:test";
+import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
+import { PenpotMcpServer } from "./PenpotMcpServer";
+import { PenpotBackendClient } from "./PenpotBackendClient";
+
+let previousEnv: NodeJS.ProcessEnv;
+let backend: Server;
+let backendUri: string;
+let server: PenpotMcpServer | undefined;
+let client: Client | undefined;
+let requests: { url: string; authorization?: string; client?: string; body: unknown }[];
+let responseStatus: number;
+let nextPort = 17_700;
+
+beforeEach(async () => {
+ previousEnv = { ...process.env };
+ process.env.PENPOT_MCP_SERVER_HOST = "127.0.0.1";
+ process.env.PENPOT_MCP_SERVER_PORT = String(nextPort++);
+ process.env.PENPOT_MCP_WEBSOCKET_PORT = "0";
+ process.env.PENPOT_MCP_DEVENV = "false";
+ process.env.PENPOT_MCP_REPL_ENABLE = "false";
+ delete process.env.PENPOT_MCP_REDIS_URI;
+ delete process.env.PENPOT_MCP_BACKEND_URI;
+ requests = [];
+ responseStatus = 200;
+ backend = createServer(async (req, res) => {
+ let body = "";
+ for await (const chunk of req) body += chunk;
+ requests.push({
+ url: req.url!,
+ authorization: req.headers.authorization,
+ client: req.headers["x-client"] as string,
+ body: JSON.parse(body),
+ });
+ res.writeHead(responseStatus, {
+ "content-type": "application/json",
+ ...(responseStatus === 307 ? { location: `${backendUri}/redirected` } : {}),
+ });
+ res.end(JSON.stringify({ status: "queued", detail: "private backend diagnostics" }));
+ });
+ backend.listen(0, "127.0.0.1");
+ await once(backend, "listening");
+ const address = backend.address();
+ assert.ok(address && typeof address === "object");
+ backendUri = `http://127.0.0.1:${address.port}/penpot`;
+});
+
+afterEach(async () => {
+ await client?.close();
+ await server?.stop();
+ client = undefined;
+ server = undefined;
+ backend.closeAllConnections();
+ await new Promise((resolve, reject) => backend.close((error) => (error ? reject(error) : resolve())));
+ process.env = previousEnv;
+});
+
+async function connect(multiUser: boolean, token?: string) {
+ server = new PenpotMcpServer(multiUser);
+ await server.start();
+ client = new Client({ name: "feedback-test", version: "1" });
+ const url = new URL(`http://127.0.0.1:${server.port}/mcp`);
+ if (token) url.searchParams.set("userToken", token);
+ await client.connect(new StreamableHTTPClientTransport(url));
+ return client;
+}
+
+const feedback = { subject: "Export fails", feedback: "Expected a PNG, received an error." };
+
+/**
+ * Collects all `pattern` values in a JSON schema.
+ */
+function schemaPatterns(schema: unknown): string[] {
+ if (Array.isArray(schema)) {
+ return schema.flatMap(schemaPatterns);
+ }
+ if (schema === null || typeof schema !== "object") {
+ return [];
+ }
+ return Object.entries(schema).flatMap(([key, value]) =>
+ key === "pattern" && typeof value === "string" ? [value] : schemaPatterns(value)
+ );
+}
+
+for (const multiUser of [false, true]) {
+ test(`feedback is absent without a backend URI (multi-user=${multiUser})`, async () => {
+ const connected = await connect(multiUser, "alice");
+ assert.ok(!(await connected.listTools()).tools.some((tool) => tool.name === "submit_feedback"));
+ });
+
+ test(`feedback works without a plugin (multi-user=${multiUser})`, async () => {
+ process.env.PENPOT_MCP_BACKEND_URI = backendUri;
+ const connected = await connect(multiUser, "alice");
+ const tool = (await connected.listTools()).tools.find((tool) => tool.name === "submit_feedback");
+ assert.ok(tool);
+ assert.deepEqual(tool.inputSchema.required, ["subject", "feedback"]);
+ // advertised patterns must also compile outside ECMAScript (ChatGPT uses Python)
+ const patterns = schemaPatterns(tool.inputSchema);
+ assert.ok(patterns.length > 0);
+ assert.ok(!patterns.some((pattern) => /\\[pP]\{/.test(pattern)), patterns.join(", "));
+ const result = await connected.callTool({ name: "submit_feedback", arguments: feedback });
+ assert.deepEqual(result.content, [
+ { type: "text", text: "Feedback queued. It is emailed in the background, so delivery is not confirmed." },
+ ]);
+ assert.deepEqual(requests, [
+ {
+ url: "/penpot/api/main/methods/send-mcp-feedback",
+ authorization: "Token alice",
+ client: "penpot-mcp",
+ body: feedback,
+ },
+ ]);
+ });
+
+ test(`missing credentials leave the tool listed but prevent submission (multi-user=${multiUser})`, async () => {
+ process.env.PENPOT_MCP_BACKEND_URI = backendUri;
+ const connected = await connect(multiUser);
+ assert.ok((await connected.listTools()).tools.some((tool) => tool.name === "submit_feedback"));
+ const result = await connected.callTool({ name: "submit_feedback", arguments: feedback });
+ assert.match(JSON.stringify(result.content), /userToken.*MCP.*URL/);
+ assert.equal(requests.length, 0);
+ });
+}
+
+test("blank backend URI does not enable feedback", async () => {
+ process.env.PENPOT_MCP_BACKEND_URI = " ";
+ const connected = await connect(false);
+ assert.ok(!(await connected.listTools()).tools.some((tool) => tool.name === "submit_feedback"));
+});
+
+test("rejects invalid input without contacting the backend", async () => {
+ process.env.PENPOT_MCP_BACKEND_URI = backendUri;
+ const connected = await connect(false, "alice");
+ for (const args of [
+ { ...feedback, subject: "" },
+ { ...feedback, subject: " " },
+ { ...feedback, subject: "a\r\nBcc: other@example.com" },
+ { ...feedback, subject: "a\tb" },
+ { ...feedback, subject: "a\u0085b" },
+ { ...feedback, feedback: "a\u0000b" },
+ { ...feedback, feedback: "a\u001bb" },
+ { ...feedback, subject: "x".repeat(121) },
+ { ...feedback, feedback: " \n" },
+ { ...feedback, feedback: "x".repeat(5001) },
+ ]) {
+ // SDK versions may return a tool error or reject with a protocol error.
+ try {
+ const result = await connected.callTool({ name: "submit_feedback", arguments: args });
+ assert.equal(result.isError, true);
+ } catch (error) {
+ assert.match(String(error), /invalid|validation/i);
+ }
+ }
+ assert.equal(requests.length, 0);
+});
+
+test("preserves deployment prefixes with and without a trailing slash", async () => {
+ for (const uri of [backendUri, backendUri + "/"]) {
+ await new PenpotBackendClient(uri).submitFeedback("alice", feedback);
+ }
+ assert.deepEqual(
+ requests.map((request) => request.url),
+ ["/penpot/api/main/methods/send-mcp-feedback", "/penpot/api/main/methods/send-mcp-feedback"]
+ );
+});
+
+test("keeps credentials isolated across concurrent submissions", async () => {
+ const backendClient = new PenpotBackendClient(backendUri);
+ await Promise.all(
+ ["alice", "bob"].map((token) =>
+ backendClient.submitFeedback(token, {
+ subject: token,
+ feedback: "A concrete problem.",
+ })
+ )
+ );
+ assert.deepEqual(
+ requests
+ .map((request) => ({
+ authorization: request.authorization,
+ subject: (request.body as typeof feedback).subject,
+ }))
+ .sort((a, b) => a.subject.localeCompare(b.subject)),
+ [
+ { authorization: "Token alice", subject: "alice" },
+ { authorization: "Token bob", subject: "bob" },
+ ]
+ );
+});
+
+for (const status of [400, 401, 403, 404, 429, 503, 500, 307]) {
+ test(`does not retry or expose response bodies on status ${status}`, async () => {
+ responseStatus = status;
+ const backendClient = new PenpotBackendClient(backendUri);
+ await assert.rejects(backendClient.submitFeedback("secret-token", feedback), (error: Error) => {
+ assert.doesNotMatch(error.message, /private backend diagnostics|secret-token/);
+ return true;
+ });
+ assert.equal(requests.length, 1);
+ });
+}
+
+test("bounds network waits and does not retry an uncertain submission", async (t) => {
+ backend.removeAllListeners("request");
+ let count = 0;
+ backend.on("request", (_req, _res) => {
+ count++;
+ });
+ const timeout = AbortSignal.timeout.bind(AbortSignal);
+ t.mock.method(AbortSignal, "timeout", (milliseconds: number) => {
+ assert.equal(milliseconds, 10_000);
+ return timeout(50);
+ });
+ await assert.rejects(
+ new PenpotBackendClient(backendUri).submitFeedback("secret-token", feedback),
+ /could not be confirmed.*Do not retry automatically/
+ );
+ assert.ok(count <= 1);
+});
+
+test("rejects invalid backend configuration without echoing credentials", () => {
+ for (const uri of [
+ "invalid",
+ "file:///tmp",
+ "https://user:secret@example.com",
+ "https://example.com/?secret=value",
+ "https://example.com/#fragment",
+ ]) {
+ assert.throws(
+ () => new PenpotBackendClient(uri),
+ (error: Error) => {
+ assert.doesNotMatch(error.message, /secret|value|user:/);
+ return true;
+ }
+ );
+ }
+});
diff --git a/mcp/packages/server/src/McpAuthentication.test.ts b/mcp/packages/server/src/McpAuthentication.test.ts
new file mode 100644
index 0000000000..715e60fdc9
--- /dev/null
+++ b/mcp/packages/server/src/McpAuthentication.test.ts
@@ -0,0 +1,81 @@
+import assert from "node:assert/strict";
+import { test } from "node:test";
+import express from "express";
+import { McpAuthentication } from "./McpAuthentication";
+
+test("OAuth is opt-in and requires multi-user mode", () => {
+ assert.equal(new McpAuthentication(undefined, false).isOAuthEnabled, false);
+ assert.equal(new McpAuthentication("", true).isOAuthEnabled, false);
+ assert.throws(() => new McpAuthentication("https://penpot.example/api/mcp/oauth", false), /multi-user/);
+ for (const uri of [
+ "not a URL",
+ "http://remote.example/auth",
+ "https://user:secret@example.com/auth",
+ "https://example.com/auth?x=1",
+ "https://example.com/auth#fragment",
+ ]) {
+ assert.throws(() => new McpAuthentication(uri, true), /PENPOT_MCP_AUTH_URI/);
+ }
+ assert.equal(new McpAuthentication("http://localhost:3449/api/mcp/oauth", true).isOAuthEnabled, true);
+});
+
+async function withEndpoint(uri: string | undefined, run: (base: string) => Promise) {
+ const auth = new McpAuthentication(uri, true);
+ const app = express();
+ app.all("/mcp", (req, res) => {
+ const result = auth.authenticate(req, res);
+ if (!result.isRejected) res.json({ token: result.userToken ?? null });
+ });
+ const server = app.listen(0, "127.0.0.1");
+ await new Promise((resolve) => server.once("listening", resolve));
+ const address = server.address();
+ assert.ok(address && typeof address !== "string");
+ try {
+ await run(`http://127.0.0.1:${address.port}/mcp`);
+ } finally {
+ await new Promise((resolve, reject) => server.close((error) => (error ? reject(error) : resolve())));
+ }
+}
+
+test("missing credentials challenge the client only when OAuth is enabled", async () => {
+ await withEndpoint(undefined, async (base) => {
+ const response = await fetch(base);
+ assert.equal(response.status, 200);
+ assert.deepEqual(await response.json(), { token: null });
+ });
+ await withEndpoint("https://penpot.example/api/mcp/oauth/", async (base) => {
+ const response = await fetch(base);
+ assert.equal(response.status, 401);
+ assert.equal(
+ response.headers.get("www-authenticate"),
+ 'Bearer resource_metadata="https://penpot.example/api/mcp/oauth/resource", scope="mcp"'
+ );
+ assert.equal(response.headers.get("cache-control"), "no-store");
+ });
+});
+
+test("bearer credentials take precedence and query credentials remain supported", async () => {
+ for (const uri of [undefined, "https://penpot.example/api/mcp/oauth"]) {
+ await withEndpoint(uri, async (base) => {
+ const bearer = await fetch(base + "?userToken=query-token", {
+ headers: { Authorization: "bEaReR header-token" },
+ });
+ assert.deepEqual(await bearer.json(), { token: "header-token" });
+ const query = await fetch(base + "?userToken=query-token");
+ assert.deepEqual(await query.json(), { token: "query-token" });
+ });
+ }
+});
+
+test("malformed credentials never fall back to another token", async () => {
+ await withEndpoint("https://penpot.example/api/mcp/oauth", async (base) => {
+ for (const header of ["Basic abc", "Bearer", "Bearer two tokens", "Bearer a, Bearer b"]) {
+ const response = await fetch(base + "?userToken=valid", { headers: { Authorization: header } });
+ assert.equal(response.status, 401, header);
+ assert.deepEqual(await response.json(), { error: "invalid_token" });
+ }
+ for (const query of ["?userToken=a&userToken=b", "?userToken=", "?userToken=a%20b"]) {
+ assert.equal((await fetch(base + query)).status, 401, query);
+ }
+ });
+});
diff --git a/mcp/packages/server/src/McpAuthentication.ts b/mcp/packages/server/src/McpAuthentication.ts
new file mode 100644
index 0000000000..6df14f6733
--- /dev/null
+++ b/mcp/packages/server/src/McpAuthentication.ts
@@ -0,0 +1,120 @@
+import type { Request, Response } from "express";
+
+/**
+ * Result of processing credentials from an MCP HTTP request.
+ */
+export class McpAuthenticationResult {
+ /**
+ * @param userToken the extracted user token, if present
+ * @param isRejected whether the request was rejected and its HTTP error response sent
+ */
+ constructor(
+ public readonly userToken: string | undefined,
+ public readonly isRejected: boolean = false
+ ) {}
+}
+
+/**
+ * HTTP credential extraction and optional OAuth discovery for MCP clients.
+ *
+ * Tokens retain their existing role of matching requests to Penpot connections.
+ */
+export class McpAuthentication {
+ public readonly isOAuthEnabled: boolean;
+ private readonly resourceMetadataUri?: string;
+
+ /**
+ * Creates a new MCP authentication handler.
+ *
+ * @param authUri the authentication URI from PENPOT_MCP_AUTH_URI, or undefined/empty to disable OAuth
+ * @param multiUser whether the server is running in multi-user mode
+ */
+ constructor(authUri: string | undefined, multiUser: boolean) {
+ if (!authUri?.trim()) {
+ this.isOAuthEnabled = false;
+ } else {
+ if (!multiUser) {
+ throw new Error("PENPOT_MCP_AUTH_URI (which enables OAuth) requires multi-user mode");
+ }
+
+ // validate the authentication URI
+ let uri: URL;
+ try {
+ uri = new URL(authUri);
+ } catch {
+ throw new Error("PENPOT_MCP_AUTH_URI must be an absolute HTTP(S) URL");
+ }
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(uri.hostname);
+ if (
+ (uri.protocol !== "https:" && !(uri.protocol === "http:" && loopback)) ||
+ uri.username ||
+ uri.password ||
+ uri.search ||
+ uri.hash
+ ) {
+ throw new Error(
+ "PENPOT_MCP_AUTH_URI must use HTTPS (HTTP is allowed on loopback) without credentials, query, or fragment"
+ );
+ }
+
+ this.resourceMetadataUri = uri.href.replace(/\/$/, "") + "/resource";
+ this.isOAuthEnabled = true;
+ }
+ }
+
+ /**
+ * Extracts credentials.
+ * If credentials are absent while OAuth is enabled, sends an authentication error.
+ */
+ public authenticate(req: Request, res: Response): McpAuthenticationResult {
+ let userToken: string | undefined;
+
+ // check for a Bearer token in the Authorization header
+ const header = req.headers.authorization;
+ if (header !== undefined) {
+ const headerCount = req.rawHeaders.filter(
+ (_, i) => i % 2 === 0 && req.rawHeaders[i].toLowerCase() === "authorization"
+ ).length;
+ const match = /^Bearer +([A-Za-z0-9\-._~+/]+=*)$/i.exec(header);
+ if (headerCount !== 1 || !match) {
+ this.rejectOAuth(res, "invalid_token");
+ return new McpAuthenticationResult(undefined, true);
+ }
+ userToken = match[1];
+ }
+ // check for a userToken query parameter
+ else if (req.query.userToken !== undefined) {
+ const value = req.query.userToken;
+ if (typeof value !== "string" || !/^[A-Za-z0-9\-._~+/]+=*$/.test(value)) {
+ this.rejectOAuth(res, "invalid_token");
+ return new McpAuthenticationResult(undefined, true);
+ }
+ userToken = value;
+ }
+
+ // NOTE: The MCP server does not validate userToken against the backend.
+ // It uses the token to match MCP requests to a connection established
+ // from the Penpot webapp. Without that matching connection, requests
+ // cannot access or modify designs. The user must be logged in to Penpot
+ // to establish that connection; Penpot login and file permissions thus
+ // provide the authentication and access control boundary.
+
+ if (this.isOAuthEnabled && !userToken) {
+ this.rejectOAuth(res);
+ return new McpAuthenticationResult(undefined, true);
+ } else {
+ return new McpAuthenticationResult(userToken);
+ }
+ }
+
+ private rejectOAuth(res: Response, error?: "invalid_token"): void {
+ let challenge = "Bearer";
+ if (this.resourceMetadataUri) {
+ challenge += ` resource_metadata="${this.resourceMetadataUri}", scope="mcp"`;
+ }
+ if (error) challenge += `${this.resourceMetadataUri ? "," : ""} error="${error}"`;
+ res.setHeader("WWW-Authenticate", challenge);
+ res.setHeader("Cache-Control", "no-store");
+ res.status(401).json({ error: error ?? "unauthorized" });
+ }
+}
diff --git a/mcp/packages/server/src/PenpotBackendClient.ts b/mcp/packages/server/src/PenpotBackendClient.ts
new file mode 100644
index 0000000000..07bebddf97
--- /dev/null
+++ b/mcp/packages/server/src/PenpotBackendClient.ts
@@ -0,0 +1,86 @@
+import { createLogger } from "./logger";
+
+/** A plain-text MCP feedback report. */
+export interface Feedback {
+ subject: string;
+ feedback: string;
+}
+
+/** Backend operations available to MCP tools. */
+export interface PenpotBackend {
+ submitFeedback(userToken: string, feedback: Feedback): Promise;
+}
+
+/** Client for the configured Penpot instance's backend services. */
+export class PenpotBackendClient implements PenpotBackend {
+ private readonly logger = createLogger("PenpotBackendClient");
+ private readonly baseUri: URL;
+
+ constructor(baseUri: string) {
+ try {
+ this.baseUri = new URL(baseUri);
+ } catch {
+ throw new Error("PENPOT_MCP_BACKEND_URI must be an absolute HTTP(S) instance URI.");
+ }
+ if (
+ !["http:", "https:"].includes(this.baseUri.protocol) ||
+ this.baseUri.username ||
+ this.baseUri.password ||
+ this.baseUri.search ||
+ this.baseUri.hash
+ ) {
+ throw new Error(
+ "PENPOT_MCP_BACKEND_URI must be an HTTP(S) instance URI without credentials, query or fragment."
+ );
+ }
+ if (!this.baseUri.pathname.endsWith("/")) this.baseUri.pathname += "/";
+ }
+
+ public async submitFeedback(userToken: string, feedback: Feedback): Promise {
+ await this.callRpc("send-mcp-feedback", userToken, feedback);
+ }
+
+ /** Calls a backend RPC method whose result body is not needed. */
+ private async callRpc(methodName: string, userToken: string, params: object): Promise {
+ let response: Response;
+ try {
+ response = await fetch(new URL(`api/main/methods/${encodeURIComponent(methodName)}`, this.baseUri), {
+ method: "POST",
+ headers: {
+ Authorization: `Token ${userToken}`,
+ "X-Client": "penpot-mcp",
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ },
+ body: JSON.stringify(params),
+ redirect: "manual",
+ signal: AbortSignal.timeout(10_000),
+ });
+ // discard backend diagnostics, which may contain private data
+ await response.body?.cancel();
+ } catch (error) {
+ this.logger.error(error, "Penpot RPC request failed");
+ throw new Error("The backend operation could not be confirmed. Do not retry automatically.");
+ }
+
+ if (response.ok) return;
+
+ switch (response.status) {
+ case 401:
+ throw new Error(
+ "The backend did not accept the MCP user token. It may be outdated, " +
+ "or the Penpot instance may not have access tokens enabled."
+ );
+ case 403:
+ throw new Error("The MCP user token is not authorized for this backend operation.");
+ case 400:
+ throw new Error("The backend rejected the request parameters or the operation is disabled.");
+ case 429:
+ throw new Error("The backend request limit has been reached. Do not retry automatically.");
+ default:
+ throw new Error(
+ `The backend operation could not be confirmed (HTTP ${response.status}). Do not retry automatically.`
+ );
+ }
+ }
+}
diff --git a/mcp/packages/server/src/PenpotConnection.ts b/mcp/packages/server/src/PenpotConnection.ts
index 267c1b159b..902f248a48 100644
--- a/mcp/packages/server/src/PenpotConnection.ts
+++ b/mcp/packages/server/src/PenpotConnection.ts
@@ -17,6 +17,8 @@ export interface PenpotConnection extends PluginLivenessState {
readonly userToken: string | null;
readonly session: PenpotSession;
readonly pingInterval: NodeJS.Timeout;
+ /** the interval sending heartbeat requests to the plugin. */
+ readonly heartbeatRequestInterval: NodeJS.Timeout;
/** whether initialization and dispatch subscriptions have completed. */
ready: boolean;
}
diff --git a/mcp/packages/server/src/PenpotMcpServer.http.test.ts b/mcp/packages/server/src/PenpotMcpServer.http.test.ts
index 2a72ed5305..d5534de879 100644
--- a/mcp/packages/server/src/PenpotMcpServer.http.test.ts
+++ b/mcp/packages/server/src/PenpotMcpServer.http.test.ts
@@ -16,6 +16,7 @@ beforeEach(async () => {
process.env.PENPOT_MCP_DEVENV = "false";
process.env.PENPOT_MCP_REPL_ENABLE = "false";
delete process.env.PENPOT_MCP_REDIS_URI;
+ delete process.env.PENPOT_MCP_AUTH_URI;
server = new PenpotMcpServer(true);
baseUrl = `http://127.0.0.1:${server.port}`;
await server.start();
@@ -26,7 +27,7 @@ afterEach(async () => {
process.env = previousEnv;
});
-async function modernRequest(method: string, params: Record = {}, query = "") {
+async function modernRequest(method: string, params: Record = {}, query = "", bearer?: string) {
return fetch(`${baseUrl}/mcp${query}`, {
method: "POST",
headers: {
@@ -34,6 +35,7 @@ async function modernRequest(method: string, params: Record = {
Accept: "application/json, text/event-stream",
"MCP-Protocol-Version": "2026-07-28",
"Mcp-Method": method,
+ ...(bearer ? { Authorization: `Bearer ${bearer}` } : {}),
...(typeof params.name === "string" ? { "Mcp-Name": params.name } : {}),
},
body: JSON.stringify({
@@ -93,7 +95,8 @@ test("isolates user tokens across overlapping tool calls with the same request I
name: "execute_code",
arguments: { code: "return 1;" },
},
- `?userToken=${token}`
+ token === "alice" ? "" : `?userToken=${token}`,
+ token === "alice" ? token : undefined
);
const body = (await response.json()) as { result: CallToolResult };
assert.equal(response.status, 200, JSON.stringify(body));
@@ -123,6 +126,13 @@ test("passes an explicit Penpot session ID from the tool call to plugin dispatch
assert.match(JSON.stringify(body), /chosen-tab/);
});
+test("accepts tool calls with request bodies larger than 100 KiB", async (t) => {
+ t.mock.method(server.pluginBridge, "executePluginTask", async () => ({ data: "ok" }));
+ const code = `return "${"x".repeat(200_000)}".length;`;
+ const response = await modernRequest("tools/call", { name: "execute_code", arguments: { code } });
+ assert.equal(response.status, 200);
+});
+
test("supports older Streamable HTTP clients without allocating a session", async () => {
const client = new Client({ name: "legacy-test", version: "1" });
const transport = new StreamableHTTPClientTransport(new URL(`${baseUrl}/mcp`));
@@ -135,3 +145,117 @@ test("supports older Streamable HTTP clients without allocating a session", asyn
await client.close();
}
});
+
+test("OAuth challenges missing credentials and accepts bearer and query tokens", async () => {
+ await server.stop();
+ process.env.PENPOT_MCP_AUTH_URI = "https://penpot.example/api/mcp/oauth";
+ server = new PenpotMcpServer(true);
+ await server.start();
+
+ const missing = await modernRequest("tools/list");
+ assert.equal(missing.status, 401);
+ assert.match(missing.headers.get("www-authenticate") ?? "", /resource_metadata=/);
+
+ for (const useBearer of [true, false]) {
+ const client = new Client({ name: "oauth-test", version: "1" });
+ const transport = new StreamableHTTPClientTransport(
+ new URL(`${baseUrl}/mcp${useBearer ? "" : "?userToken=alice"}`),
+ useBearer ? { requestInit: { headers: { Authorization: "Bearer alice" } } } : undefined
+ );
+ try {
+ await client.connect(transport);
+ const result = await client.listTools();
+ const tool = result.tools.find((tool) => tool.name === "execute_code");
+ assert.ok(tool, "authenticated clients can discover execute_code");
+ } finally {
+ await client.close();
+ }
+ }
+});
+
+/**
+ * Makes the plugin bridge answer each dispatched task at once with the given responses, in order.
+ */
+function answerTasks(t: { mock: any }, responses: Array>): void {
+ const bridge = server.pluginBridge as any;
+ t.mock.method(bridge.dispatcher, "dispatch", async (task: { id: string }) => {
+ bridge.pendingTasks.set(task.id, task);
+ bridge.handlePluginTaskResponse({ id: task.id, ...responses.shift() });
+ });
+}
+
+async function callExecuteCode(): Promise {
+ const response = await modernRequest(
+ "tools/call",
+ { name: "execute_code", arguments: { code: "return 1;" } },
+ "?userToken=alice"
+ );
+ const body = (await response.json()) as { result: CallToolResult };
+ assert.equal(response.status, 200, JSON.stringify(body));
+ return body.result;
+}
+
+const rollback = { fileIds: ["file-1"], pageIds: ["page-1"], shapeIds: ["shape-1", "shape-2"] };
+
+test("puts a warning first in the tool response that reports a rollback", async (t) => {
+ answerTasks(t, [
+ { success: true, data: { result: 1, log: "" }, rollbacks: [rollback] },
+ { success: true, data: { result: 2, log: "" } },
+ ]);
+
+ const first = await callExecuteCode();
+ const second = await callExecuteCode();
+
+ assert.equal(first.content.length, 2);
+ const [notice, data] = first.content;
+ assert.equal(notice.type, "text");
+ assert.match(notice.text, /CHANGES WERE ROLLED BACK/);
+ assert.match(notice.text, /Pages: page-1/);
+ assert.match(notice.text, /Shapes: shape-1, shape-2/);
+ assert.equal(data.type, "text");
+ assert.equal(JSON.parse(data.text).result, 1);
+
+ assert.equal(second.content.length, 1);
+});
+
+test("puts a rollback warning first in a failed tool response too", async (t) => {
+ answerTasks(t, [{ success: false, error: "Shape not found", rollbacks: [rollback] }]);
+
+ const result = await callExecuteCode();
+
+ assert.equal(result.content.length, 2);
+ const [notice, failure] = result.content;
+ assert.equal(notice.type, "text");
+ assert.match(notice.text, /CHANGES WERE ROLLED BACK/);
+ assert.equal(failure.type, "text");
+ assert.match(failure.text, /Tool execution failed: .*Shape not found/);
+});
+
+/**
+ * A plugin connection whose socket keeps the messages sent to it.
+ */
+function fakeConnection(): { socket: { readyState: number; send: (message: string) => void }; sent: unknown[] } {
+ const sent: unknown[] = [];
+ return { socket: { readyState: 1, send: (message: string) => sent.push(JSON.parse(message)) }, sent };
+}
+
+test("gives the rollbacks of a response that came after its task timed out back to the plugin", () => {
+ const bridge = server.pluginBridge as any;
+ const connection = fakeConnection();
+
+ bridge.handlePluginTaskResponse(
+ { id: "timed-out", success: true, data: { result: 1, log: "" }, rollbacks: [rollback] },
+ connection
+ );
+
+ assert.deepEqual(connection.sent, [{ type: "unclaimed-rollbacks", rollbacks: [rollback] }]);
+});
+
+test("sends nothing back for a late response without rollbacks", () => {
+ const bridge = server.pluginBridge as any;
+ const connection = fakeConnection();
+
+ bridge.handlePluginTaskResponse({ id: "timed-out", success: true, data: { result: 1, log: "" } }, connection);
+
+ assert.deepEqual(connection.sent, []);
+});
diff --git a/mcp/packages/server/src/PenpotMcpServer.ts b/mcp/packages/server/src/PenpotMcpServer.ts
index 73ffd83a9f..56f7ac5b2c 100644
--- a/mcp/packages/server/src/PenpotMcpServer.ts
+++ b/mcp/packages/server/src/PenpotMcpServer.ts
@@ -8,20 +8,23 @@ import { ExecuteCodeTool } from "./tools/ExecuteCodeTool";
import { PluginBridge } from "./PluginBridge";
import { RedisBridge } from "./RedisBridge";
import { ConfigurationLoader } from "./ConfigurationLoader";
+import { PenpotBackendClient } from "./PenpotBackendClient";
+import { SubmitFeedbackTool } from "./tools/SubmitFeedbackTool";
import { createLogger } from "./logger";
import { Tool } from "./Tool";
import { HighLevelOverviewTool } from "./tools/HighLevelOverviewTool";
import { PenpotApiInfoTool } from "./tools/PenpotApiInfoTool";
import { ExportShapeTool } from "./tools/ExportShapeTool";
import { ImportImageTool } from "./tools/ImportImageTool";
-import { CljsReplTool } from "./tools/CljsReplTool";
-import { ImportPenpotFileTool } from "./tools/ImportPenpotFileTool";
-import { CljsCompilerOutputTool } from "./tools/CljsCompilerOutputTool";
-import { CljCheckParentheses } from "./tools/CljCheckParentheses";
-import { ReadTaigaIssueTool } from "./tools/ReadTaigaIssueTool";
+import { CljsReplTool } from "./tools/dev/CljsReplTool";
+import { ImportPenpotFileTool } from "./tools/dev/ImportPenpotFileTool";
+import { CljsCompilerOutputTool } from "./tools/dev/CljsCompilerOutputTool";
+import { CljCheckParentheses } from "./tools/dev/CljCheckParentheses";
+import { ReadTaigaIssueTool } from "./tools/dev/ReadTaigaIssueTool";
import { NreplClient } from "./NreplClient";
import { ReplServer } from "./ReplServer";
import { ApiDocs } from "./ApiDocs";
+import { McpAuthentication } from "./McpAuthentication";
/**
* Session context for request-scoped data.
@@ -111,6 +114,7 @@ export class PenpotMcpServer {
private app!: Express;
private httpServer?: HttpServer;
private readonly mcpHandler: McpHttpHandler;
+ private readonly authentication: McpAuthentication;
public readonly pluginBridge: PluginBridge;
private readonly replServer: ReplServer | null;
private apiDocs: ApiDocs;
@@ -143,7 +147,16 @@ export class PenpotMcpServer {
*/
private readonly tenant: string;
+ /**
+ * Maximum size of a JSON request body, read from the `PENPOT_MCP_MAX_BODY_SIZE` environment variable.
+ *
+ * Accepts any value supported by Express' `json` body parser (e.g. `"10mb"`). Defaults to `"10mb"`,
+ * since tool calls such as `execute_code` can carry large payloads.
+ */
+ private readonly maxBodySize: string;
+
constructor(private isMultiUser: boolean = false) {
+ this.authentication = new McpAuthentication(process.env.PENPOT_MCP_AUTH_URI, isMultiUser);
// read port configuration from environment variables
this.host = process.env.PENPOT_MCP_SERVER_HOST ?? "localhost";
this.port = parseInt(process.env.PENPOT_MCP_SERVER_PORT ?? "4401", 10);
@@ -151,6 +164,7 @@ export class PenpotMcpServer {
this.replHost = process.env.PENPOT_MCP_REPL_HOST ?? "localhost";
this.replPort = parseInt(process.env.PENPOT_MCP_REPL_PORT ?? "4403", 10);
this.tenant = process.env.PENPOT_TENANT ?? "default";
+ this.maxBodySize = process.env.PENPOT_MCP_MAX_BODY_SIZE ?? "10mb";
const toolTimeoutSecs = parseInt(process.env.PENPOT_MCP_TOOL_TIMEOUT_S ?? "120", 10);
this.configLoader = new ConfigurationLoader(process.cwd());
@@ -261,6 +275,10 @@ export class PenpotMcpServer {
if (this.isFileSystemAccessEnabled()) {
toolInstances.push(new ImportImageTool(this));
}
+ const backendUri = process.env.PENPOT_MCP_BACKEND_URI?.trim();
+ if (backendUri) {
+ toolInstances.push(new SubmitFeedbackTool(this, new PenpotBackendClient(backendUri)));
+ }
if (shouldRegisterDeveloperTools(this.isDevEnv(), this.isMultiUserMode())) {
const nreplClient = new NreplClient();
toolInstances.push(new CljsReplTool(this, nreplClient));
@@ -298,24 +316,30 @@ export class PenpotMcpServer {
private setupHttpEndpoints(): void {
const handleMcpRequest = toNodeHandler(this.mcpHandler);
this.app.all("/mcp", async (req, res) => {
- const userToken = req.query.userToken as string | undefined;
+ const authResult = this.authentication.authenticate(req, res);
+ if (authResult.isRejected) {
+ return;
+ }
this.logger.info(
- `Received MCP request: method=${req.body?.method ?? ""}; userTokenFp=${PenpotMcpServer.tokenFingerprint(userToken)}`
+ `Received MCP request: method=${req.body?.method ?? ""}; userTokenFp=${PenpotMcpServer.tokenFingerprint(authResult.userToken)}`
+ );
+ await this.sessionContext.run({ userToken: authResult.userToken }, () =>
+ handleMcpRequest(req, res, req.body)
);
- await this.sessionContext.run({ userToken }, () => handleMcpRequest(req, res, req.body));
});
}
async start(): Promise {
const { default: express } = await import("express");
this.app = express();
- this.app.use(express.json());
+ this.app.use(express.json({ limit: this.maxBodySize }));
this.setupHttpEndpoints();
return new Promise((resolve, reject) => {
this.httpServer = this.app.listen(this.port, this.host, async () => {
this.logger.info(`Multi-user mode: ${this.isMultiUserMode()}`);
+ this.logger.info(`OAuth enabled: ${this.authentication.isOAuthEnabled}`);
this.logger.info(
`Multi-instance mode with Redis-backed transport: ${this.redisBridge ? "true" : "false"}`
);
diff --git a/mcp/packages/server/src/PluginBridge.sessions.test.ts b/mcp/packages/server/src/PluginBridge.sessions.test.ts
index 1a42241169..3e676725f2 100644
--- a/mcp/packages/server/src/PluginBridge.sessions.test.ts
+++ b/mcp/packages/server/src/PluginBridge.sessions.test.ts
@@ -1,8 +1,8 @@
import assert from "node:assert/strict";
import { once } from "node:events";
-import { afterEach, beforeEach, test } from "node:test";
+import { afterEach, beforeEach, mock, test } from "node:test";
import { WebSocket } from "ws";
-import { PluginBridge } from "./PluginBridge";
+import { HEARTBEAT_REQUEST_INTERVAL_MS, PluginBridge } from "./PluginBridge";
import { PluginTask } from "./PluginTask";
import type { PenpotMcpServer } from "./PenpotMcpServer";
@@ -37,17 +37,33 @@ async function connect(sessionId: string, token = "alice", fileName = "Design",
const socket = new WebSocket(`ws://127.0.0.1:${port}?userToken=${token}`);
sockets.push(socket);
await once(socket, "open");
+ // answer tasks from the start, since one may arrive right behind the initialization
+ socket.on("message", (raw) => {
+ const request = JSON.parse(raw.toString());
+ if (request.type !== "initialized" && request.type !== "heartbeat-request") {
+ socket.send(JSON.stringify({ id: request.id, success: true, data: reply }));
+ }
+ });
const initialized = once(socket, "message", { signal: AbortSignal.timeout(1500) });
socket.send(JSON.stringify({ type: "initialize", session: { sessionId, fileId: "file-1", fileName } }));
const [message] = await initialized;
assert.equal(JSON.parse(message.toString()).type, "initialized");
- socket.on("message", (raw) => {
- const request = JSON.parse(raw.toString());
- socket.send(JSON.stringify({ id: request.id, success: true, data: reply }));
- });
return socket;
}
+test("asks each plugin for a heartbeat at a fixed interval", async () => {
+ mock.timers.enable({ apis: ["setInterval"] });
+ try {
+ const socket = await connect("tab-1");
+ const requested = once(socket, "message", { signal: AbortSignal.timeout(1500) });
+ mock.timers.tick(HEARTBEAT_REQUEST_INTERVAL_MS);
+ const [message] = await requested;
+ assert.deepEqual(JSON.parse(message.toString()), { type: "heartbeat-request" });
+ } finally {
+ mock.timers.reset();
+ }
+});
+
test("keeps two tabs for the same file and dispatches to the selected session", async () => {
await connect("tab-1");
await connect("tab-2");
@@ -169,3 +185,21 @@ test("a dashboard session remains routable while its workspace metadata changes"
assert.deepEqual(bridge.getUserConnections("alice")!.getSessions(), [{ sessionId: "tab", ...context }]);
}
});
+
+test("a task fails at once when its plugin connection closes before answering", async () => {
+ const plugin = new WebSocket(`ws://127.0.0.1:${port}?userToken=alice`);
+ sockets.push(plugin);
+ await once(plugin, "open");
+ const initialized = once(plugin, "message");
+ plugin.send(JSON.stringify({ type: "initialize", session: { sessionId: "tab", fileId: null, fileName: null } }));
+ await initialized;
+ // the socket closes once the task reaches it
+ plugin.on("message", () => plugin.terminate());
+ const started = Date.now();
+ await assert.rejects(
+ bridge.executePluginTask(new PluginTask("test", {}), "tab"),
+ /connection closed before the task finished/
+ );
+ // well within the 1s task timeout of these tests
+ assert.ok(Date.now() - started < 500);
+});
diff --git a/mcp/packages/server/src/PluginBridge.ts b/mcp/packages/server/src/PluginBridge.ts
index 913b28b26a..340016f44f 100644
--- a/mcp/packages/server/src/PluginBridge.ts
+++ b/mcp/packages/server/src/PluginBridge.ts
@@ -1,8 +1,14 @@
import { WebSocket, WebSocketServer } from "ws";
import * as http from "http";
import { z } from "zod";
-import { AbstractPluginTask, PluginTask } from "./PluginTask";
-import { PluginTaskResponse, PluginTaskResult } from "@penpot/mcp-common";
+import { AbstractPluginTask, PluginTask, PluginTaskError } from "./PluginTask";
+import { RollbackNotices } from "./RollbackNotices";
+import {
+ ContentRollbackEvent,
+ PluginTaskResponse,
+ PluginTaskResult,
+ UnclaimedRollbacksMessage,
+} from "@penpot/mcp-common";
import { createLogger } from "./logger";
import type { PenpotMcpServer } from "./PenpotMcpServer";
import type { RedisBridge } from "./RedisBridge";
@@ -15,6 +21,14 @@ import { MultiInstanceTaskDispatcher } from "./dispatch/MultiInstanceTaskDispatc
const KEEP_ALIVE_TIME = 30000; // 30 seconds
const INITIALIZATION_TIMEOUT_MS = 10_000;
+/**
+ * The interval, in ms, between the heartbeat requests sent to each plugin.
+ *
+ * A browser runs the timers of a hidden page as rarely as once a minute, which would leave the
+ * plugin's own heartbeat older than the stale threshold, but it handles socket messages at once.
+ */
+export const HEARTBEAT_REQUEST_INTERVAL_MS = 10_000;
+
/**
* Maximum plugin heartbeat age before a connection is stale.
*
@@ -79,6 +93,11 @@ export class PluginBridge implements TaskDispatchHost {
private readonly taskConnections: Map = new Map();
private readonly dispatcher: TaskDispatcher;
+ /**
+ * Collector of the rollbacks that task responses report, per tool execution.
+ */
+ public readonly rollbackNotices = new RollbackNotices();
+
/**
* Creates the plugin bridge and starts its WebSocket server.
*
@@ -187,8 +206,8 @@ export class PluginBridge implements TaskDispatchHost {
}
});
- ws.on("close", () => {
- this.logger.info("WebSocket connection closed");
+ ws.on("close", (code: number, reason: Buffer) => {
+ this.logger.info("WebSocket connection closed (code %d%s)", code, reason.length ? `: ${reason}` : "");
clearTimeout(initializationTimeout);
this.removeConnection(ws);
});
@@ -218,12 +237,17 @@ export class PluginBridge implements TaskDispatchHost {
const pingInterval = setInterval(() => {
ws.ping();
}, KEEP_ALIVE_TIME);
+ // the plugin answers with a heartbeat, which a frozen page cannot send
+ const heartbeatRequestInterval = setInterval(() => {
+ ws.send(JSON.stringify({ type: "heartbeat-request" }));
+ }, HEARTBEAT_REQUEST_INTERVAL_MS);
// register the client connection with both indexes
const connection: PenpotConnection = {
socket: ws,
userToken,
pingInterval,
+ heartbeatRequestInterval,
session,
ready: false,
lastHeartbeat: Date.now(),
@@ -260,10 +284,11 @@ export class PluginBridge implements TaskDispatchHost {
/**
* Removes a client connection and releases all resources associated with it.
*
- * Clears the per-connection keep-alive interval and removes the connection from the
- * socket-keyed index and the user's session collection. The token-keyed index entry
- * is removed only when the user's last local connection closes. Safe to call with a
- * socket that is not (or no longer) registered.
+ * Clears the per-connection keep-alive and heartbeat-request intervals and removes the
+ * connection from the socket-keyed index and the user's session collection. The
+ * token-keyed index entry is removed only when the user's last local connection closes.
+ * Tasks sent over the connection and still awaiting a response fail at once. Safe to call
+ * with a socket that is not (or no longer) registered.
*
* @param ws - The WebSocket whose connection state should be removed
*/
@@ -274,9 +299,17 @@ export class PluginBridge implements TaskDispatchHost {
}
connection.ready = false;
clearInterval(connection.pingInterval);
+ clearInterval(connection.heartbeatRequestInterval);
this.connectionsBySocket.delete(ws);
const connections = this.getUserConnections(connection.userToken)!;
connections.remove(connection);
+ // a task sent over the closed socket can no longer be answered, since responses only count
+ // from the connection the task went to
+ for (const [taskId, taskConnection] of [...this.taskConnections]) {
+ if (taskConnection === connection) {
+ this.rejectPendingTask(taskId, new Error("The plugin connection closed before the task finished."));
+ }
+ }
if (connection.userToken !== null && connections.size === 0) {
this.userPenpotConnectionsByToken.delete(connection.userToken);
}
@@ -289,7 +322,9 @@ export class PluginBridge implements TaskDispatchHost {
* Handles responses from the plugin for completed tasks.
*
* Finds the pending task by ID and resolves or rejects its promise
- * based on the execution result.
+ * based on the execution result. A response that comes after its task
+ * timed out has no task to report its rollbacks to, so they go back to
+ * the plugin, which sends them with its next response.
*
* @param response - The plugin task response containing ID and result
* @param connection - The responding local connection, or undefined for Redis responses
@@ -298,6 +333,7 @@ export class PluginBridge implements TaskDispatchHost {
const task = this.pendingTasks.get(response.id);
if (!task) {
this.logger.info(`Received response for unknown task ID: ${response.id}`);
+ this.returnRollbacks(connection, response.rollbacks);
return;
}
@@ -316,15 +352,40 @@ export class PluginBridge implements TaskDispatchHost {
// Resolve or reject the task's promise based on the result
if (response.success) {
- task.resolveWithResult({ data: response.data });
+ task.resolveWithResult({ data: response.data, rollbacks: response.rollbacks });
} else {
- const error = new Error(response.error || "Task execution failed (details not provided)");
+ const error = new PluginTaskError(
+ response.error || "Task execution failed (details not provided)",
+ response.rollbacks
+ );
task.rejectWithError(error);
}
this.logger.info(`Task ${response.id} completed: success=${response.success}`);
}
+ /**
+ * Sends rollbacks that no tool execution received back to the plugin.
+ *
+ * @param connection - The plugin connection that reported them, if known
+ * @param rollbacks - The rollbacks of a response whose task is gone
+ */
+ private returnRollbacks(
+ connection: PenpotConnection | undefined,
+ rollbacks: ContentRollbackEvent[] | undefined
+ ): void {
+ if (!connection || !rollbacks || rollbacks.length === 0) {
+ return;
+ }
+ if (connection.socket.readyState !== 1) {
+ this.logger.warn("Plugin disconnected; %d rollback(s) of a late response are lost", rollbacks.length);
+ return;
+ }
+ const message: UnclaimedRollbacksMessage = { type: "unclaimed-rollbacks", rollbacks };
+ connection.socket.send(JSON.stringify(message));
+ this.logger.info("Returned %d rollback(s) of a late response to the plugin", rollbacks.length);
+ }
+
/**
* Rejects a still-pending task with the given error, releasing its correlation state.
*
@@ -363,6 +424,7 @@ export class PluginBridge implements TaskDispatchHost {
* Executes a plugin task by sending it to the connected Penpot plugin instance,
* either directly via WebSocket or indirectly via Redis (depending on the configuration),
* and awaiting the result.
+ * Rollbacks the response reports go to {@link rollbackNotices}.
*
* @param task - The plugin task to execute
* @param sessionId - The target session; when omitted, discovery must yield exactly one session
@@ -381,11 +443,20 @@ export class PluginBridge implements TaskDispatchHost {
userToken = sessionContext.userToken;
}
// attach the result handler before dispatch can reject the task
- const result = task.getResultPromise();
+ const resultPromise = task.getResultPromise();
void this.dispatcher.dispatch(task, userToken, sessionId).catch((error) => {
task.rejectWithError(error instanceof Error ? error : new Error(String(error)));
});
- return await result;
+ try {
+ const result = await resultPromise;
+ this.rollbackNotices.record(result.rollbacks);
+ return result;
+ } catch (error) {
+ if (error instanceof PluginTaskError) {
+ this.rollbackNotices.record(error.rollbacks);
+ }
+ throw error;
+ }
}
/**
diff --git a/mcp/packages/server/src/PluginTask.ts b/mcp/packages/server/src/PluginTask.ts
index 30a88c73de..ddab54a76c 100644
--- a/mcp/packages/server/src/PluginTask.ts
+++ b/mcp/packages/server/src/PluginTask.ts
@@ -5,7 +5,7 @@
* A task defines a specific operation for the plugin to execute along with
* strongly-typed parameters and provides request/response correlation.
*/
-import { PluginTaskRequest, PluginTaskResult } from "@penpot/mcp-common";
+import { ContentRollbackEvent, PluginTaskRequest, PluginTaskResult } from "@penpot/mcp-common";
import { randomUUID } from "crypto";
/**
@@ -153,3 +153,23 @@ export class PluginTask<
this.rejectResult(error);
}
}
+
+/**
+ * Error of a plugin task that failed in the plugin.
+ *
+ * Carries the rollbacks the failed task's response reported, which must reach the LLM like those of a
+ * successful response.
+ */
+export class PluginTaskError extends Error {
+ /**
+ * @param message - the error message reported by the plugin
+ * @param rollbacks - the rollbacks the response reported
+ */
+ constructor(
+ message: string,
+ public readonly rollbacks: ContentRollbackEvent[] = []
+ ) {
+ super(message);
+ this.name = "PluginTaskError";
+ }
+}
diff --git a/mcp/packages/server/src/RemotePluginTask.ts b/mcp/packages/server/src/RemotePluginTask.ts
index 368623a5a0..c4714d021c 100644
--- a/mcp/packages/server/src/RemotePluginTask.ts
+++ b/mcp/packages/server/src/RemotePluginTask.ts
@@ -1,4 +1,4 @@
-import { AbstractPluginTask } from "./PluginTask";
+import { AbstractPluginTask, PluginTaskError } from "./PluginTask";
import { PluginTaskResult } from "@penpot/mcp-common";
import type { RedisBridge } from "./RedisBridge";
@@ -43,6 +43,7 @@ export class RemotePluginTask extends AbstractPluginTask ({
+ fileIds: ["file-1"],
+ pageIds: [`page-${id}`],
+ shapeIds: shapes,
+});
+
+test("collects only the rollbacks recorded while its function runs", async () => {
+ const notices = new RollbackNotices();
+ notices.record([rollback("outside")]);
+
+ const [value, rollbacks] = await notices.collect(async () => {
+ notices.record([rollback("a")]);
+ await Promise.resolve();
+ notices.record([rollback("b")]);
+ return 42;
+ });
+
+ assert.equal(value, 42);
+ assert.deepEqual(rollbacks, [rollback("a"), rollback("b")]);
+});
+
+test("keeps the rollbacks of overlapping executions apart", async () => {
+ const notices = new RollbackNotices();
+ let release!: () => void;
+ const gate = new Promise((resolve) => (release = resolve));
+
+ const first = notices.collect(async () => {
+ await gate;
+ notices.record([rollback("a")]);
+ });
+ const second = notices.collect(async () => {
+ notices.record([rollback("b")]);
+ release();
+ });
+
+ const [[, a], [, b]] = await Promise.all([first, second]);
+ assert.deepEqual(a, [rollback("a")]);
+ assert.deepEqual(b, [rollback("b")]);
+});
+
+test("names each affected file, page and shape once", () => {
+ const text = RollbackNotices.describe([rollback("a", ["s1", "s2"]), rollback("b", ["s2"])]);
+
+ assert.match(text, /\(2 times\)/);
+ assert.match(text, /Files: file-1\n/);
+ assert.match(text, /Pages: page-a, page-b\n/);
+ assert.match(text, /Shapes: s1, s2$/);
+});
+
+test("lists at most 50 shapes", () => {
+ const shapes = Array.from({ length: 53 }, (_, i) => `s${i}`);
+
+ const text = RollbackNotices.describe([rollback("a", shapes)]);
+
+ assert.match(text, /s49 \(and 3 more\)$/);
+ assert.doesNotMatch(text, /s50/);
+});
diff --git a/mcp/packages/server/src/RollbackNotices.ts b/mcp/packages/server/src/RollbackNotices.ts
new file mode 100644
index 0000000000..67b746a38c
--- /dev/null
+++ b/mcp/packages/server/src/RollbackNotices.ts
@@ -0,0 +1,88 @@
+import { AsyncLocalStorage } from "async_hooks";
+import type { ContentRollbackEvent } from "@penpot/mcp-common";
+import { TextContent, ToolResponse } from "./ToolResponse";
+
+/**
+ * Collector of the rollbacks of rejected changes that plugin task responses report during one tool execution.
+ *
+ * The plugin reports a rollback with the first task response after it, so the rollback reaches the tool
+ * execution that follows the one which made the changes. {@link withNotice} then puts a warning at the
+ * top of that tool's response, so the LLM learns that some of its earlier changes are gone.
+ */
+export class RollbackNotices {
+ /**
+ * Maximum number of shape ids listed in a notice.
+ */
+ private static readonly MAX_LISTED_SHAPES = 50;
+
+ private readonly storage = new AsyncLocalStorage();
+
+ /**
+ * Runs the given function, collecting the rollbacks recorded while it runs.
+ *
+ * @param fn - the function to run (typically a tool's core logic)
+ * @returns the function's value and the collected rollbacks
+ */
+ async collect(fn: () => Promise): Promise<[T, ContentRollbackEvent[]]> {
+ const rollbacks: ContentRollbackEvent[] = [];
+ const value = await this.storage.run(rollbacks, fn);
+ return [value, rollbacks];
+ }
+
+ /**
+ * Records rollbacks reported by a plugin task response for the current tool execution.
+ * Rollbacks reported outside of {@link collect} are dropped.
+ *
+ * @param rollbacks - the rollbacks the response carried, if any
+ */
+ record(rollbacks: ContentRollbackEvent[] | undefined): void {
+ if (rollbacks && rollbacks.length > 0) {
+ this.storage.getStore()?.push(...rollbacks);
+ }
+ }
+
+ /**
+ * Puts a rollback warning at the top of the given response.
+ *
+ * @param response - the tool response
+ * @param rollbacks - the rollbacks collected while the tool ran
+ * @returns the response, with the warning first if there were rollbacks
+ */
+ static withNotice(response: ToolResponse, rollbacks: ContentRollbackEvent[]): ToolResponse {
+ if (rollbacks.length === 0) {
+ return response;
+ }
+ // clients may join text items without a separator
+ const notice = new TextContent(RollbackNotices.describe(rollbacks) + "\n\n");
+ response.content = [notice, ...response.content];
+ return response;
+ }
+
+ /**
+ * Describes the given rollbacks for the LLM.
+ *
+ * @param rollbacks - the rollbacks to describe (at least one)
+ */
+ static describe(rollbacks: ContentRollbackEvent[]): string {
+ const fileIds = new Set(rollbacks.flatMap((r) => r.fileIds));
+ const pageIds = new Set(rollbacks.flatMap((r) => r.pageIds));
+ const shapeIds = [...new Set(rollbacks.flatMap((r) => r.shapeIds))];
+
+ const listedShapes = shapeIds.slice(0, RollbackNotices.MAX_LISTED_SHAPES);
+ const unlistedShapes = shapeIds.length - listedShapes.length;
+
+ return (
+ "WARNING: CHANGES WERE ROLLED BACK. Since your previous Penpot tool call, the Penpot backend rejected " +
+ `some changes ${rollbacks.length > 1 ? `(${rollbacks.length} times) ` : ""}and the workspace undid them, ` +
+ "together with the rest of their undo steps and any later change to the same file. " +
+ "Changes you made in earlier calls may be gone, even though those calls succeeded, and the tool call " +
+ "that returned this warning may have run on the reverted data.\n" +
+ "Before you continue, read the affected pages and shapes again, check that they hold what you expect, " +
+ "and redo what is missing. Do not rely on shape references or data you kept from before.\n" +
+ `Files: ${[...fileIds].join(", ") || "none"}\n` +
+ `Pages: ${[...pageIds].join(", ") || "none"}\n` +
+ `Shapes: ${listedShapes.join(", ") || "none"}` +
+ (unlistedShapes > 0 ? ` (and ${unlistedShapes} more)` : "")
+ );
+ }
+}
diff --git a/mcp/packages/server/src/Tool.ts b/mcp/packages/server/src/Tool.ts
index 6ec44f2cb6..f6cee26a50 100644
--- a/mcp/packages/server/src/Tool.ts
+++ b/mcp/packages/server/src/Tool.ts
@@ -3,6 +3,7 @@ import "reflect-metadata";
import { TextResponse, ToolResponse } from "./ToolResponse";
import type { PenpotMcpServer, SessionContext } from "./PenpotMcpServer";
import { createLogger } from "./logger";
+import { RollbackNotices } from "./RollbackNotices";
/**
* An empty arguments class for tools that do not require any parameters.
@@ -44,9 +45,22 @@ export abstract class Tool {
* Executes the tool with automatic validation and type safety.
*
* This method handles the unknown args from the MCP protocol,
- * delegating to the type-safe implementation.
+ * delegating to the type-safe implementation. A rollback reported by a
+ * plugin task during the execution puts a warning first in the response.
*/
async execute(args: unknown): Promise {
+ const [response, rollbacks] = await this.mcpServer.pluginBridge.rollbackNotices.collect(() =>
+ this.executeAndReport(args)
+ );
+ return RollbackNotices.withNotice(response, rollbacks);
+ }
+
+ /**
+ * Executes the tool logic, turning a failure into an error response.
+ *
+ * @param args - the tool arguments
+ */
+ private async executeAndReport(args: unknown): Promise {
const executionId = ++Tool.executionCounter;
try {
let argsInstance: TArgs = args as TArgs;
diff --git a/mcp/packages/server/src/tools/SubmitFeedbackTool.ts b/mcp/packages/server/src/tools/SubmitFeedbackTool.ts
new file mode 100644
index 0000000000..57273991fb
--- /dev/null
+++ b/mcp/packages/server/src/tools/SubmitFeedbackTool.ts
@@ -0,0 +1,69 @@
+import { z } from "zod";
+import type { Feedback, PenpotBackend } from "../PenpotBackendClient";
+import type { PenpotMcpServer } from "../PenpotMcpServer";
+import { Tool } from "../Tool";
+import { TextResponse, type ToolResponse } from "../ToolResponse";
+
+/** Arguments for submitting a plain-text feedback report. */
+export class SubmitFeedbackArgs implements Feedback {
+ static schema = {
+ subject: z
+ .string()
+ .min(1)
+ .max(120)
+ .regex(/\S/)
+ // the Unicode Cc category; `\P{Cc}` is avoided because clients that compile
+ // advertised patterns with other regex engines (e.g. Python) reject it
+ .regex(/^[^\x00-\x1F\x7F-\x9F]*$/)
+ .describe("Short, specific summary without line breaks or other control characters (max 120 characters)."),
+ feedback: z
+ .string()
+ .min(1)
+ .max(5000)
+ .regex(/\S/)
+ // line breaks and tabs are the only control characters allowed
+ .regex(/^[^\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]*$/)
+ .describe("Concise plain-text feedback (max 5,000 characters)."),
+ };
+
+ subject!: string;
+ feedback!: string;
+}
+
+/** Tool for user-approved feedback about the Penpot MCP integration. */
+export class SubmitFeedbackTool extends Tool {
+ constructor(
+ mcpServer: PenpotMcpServer,
+ private readonly backend: PenpotBackend
+ ) {
+ super(mcpServer, SubmitFeedbackArgs.schema);
+ }
+
+ public getToolName(): string {
+ return "submit_feedback";
+ }
+
+ public getToolDescription(): string {
+ return (
+ "Submit feedback about Penpot MCP, provided that the user explicitly requests or approves submission " +
+ "and there is a concrete, actionable issue to report. " +
+ "Focus on bugs, limitations, or unclear documentation that blocked work or caused substantial rework. " +
+ "Briefly propose what to report and ask the user at a natural pause. " +
+ "Skip vague dissatisfaction, routine transient errors, and your own coding mistakes. " +
+ "Describe the operation, expected and actual behavior, and any workaround. Exclude sensitive content."
+ );
+ }
+
+ protected formatArgs(_args: SubmitFeedbackArgs): string {
+ return "[feedback omitted]";
+ }
+
+ protected async executeCore(args: SubmitFeedbackArgs): Promise {
+ const userToken = this.getSessionContext()?.userToken;
+ if (!userToken?.trim()) {
+ throw new Error("Include userToken in the MCP server URL to submit feedback.");
+ }
+ await this.backend.submitFeedback(userToken, { subject: args.subject, feedback: args.feedback });
+ return new TextResponse("Feedback queued. It is emailed in the background, so delivery is not confirmed.");
+ }
+}
diff --git a/mcp/packages/server/src/tools/CljCheckParentheses.ts b/mcp/packages/server/src/tools/dev/CljCheckParentheses.ts
similarity index 97%
rename from mcp/packages/server/src/tools/CljCheckParentheses.ts
rename to mcp/packages/server/src/tools/dev/CljCheckParentheses.ts
index 81e2a9628c..d7a5af6fd2 100644
--- a/mcp/packages/server/src/tools/CljCheckParentheses.ts
+++ b/mcp/packages/server/src/tools/dev/CljCheckParentheses.ts
@@ -1,9 +1,9 @@
import { z } from "zod";
-import { Tool } from "../Tool";
+import { Tool } from "../../Tool";
import "reflect-metadata";
-import type { ToolResponse } from "../ToolResponse";
-import { TextResponse } from "../ToolResponse";
-import type { PenpotMcpServer } from "../PenpotMcpServer";
+import type { ToolResponse } from "../../ToolResponse";
+import { TextResponse } from "../../ToolResponse";
+import type { PenpotMcpServer } from "../../PenpotMcpServer";
import * as fs from "fs";
/**
diff --git a/mcp/packages/server/src/tools/CljsCompilerOutputTool.ts b/mcp/packages/server/src/tools/dev/CljsCompilerOutputTool.ts
similarity index 86%
rename from mcp/packages/server/src/tools/CljsCompilerOutputTool.ts
rename to mcp/packages/server/src/tools/dev/CljsCompilerOutputTool.ts
index 11989c6303..772d9461df 100644
--- a/mcp/packages/server/src/tools/CljsCompilerOutputTool.ts
+++ b/mcp/packages/server/src/tools/dev/CljsCompilerOutputTool.ts
@@ -1,9 +1,9 @@
-import { Tool, EmptyToolArgs } from "../Tool";
+import { Tool, EmptyToolArgs } from "../../Tool";
import "reflect-metadata";
-import type { ToolResponse } from "../ToolResponse";
-import { TextResponse } from "../ToolResponse";
-import { PenpotMcpServer } from "../PenpotMcpServer";
-import { NreplClient } from "../NreplClient";
+import type { ToolResponse } from "../../ToolResponse";
+import { TextResponse } from "../../ToolResponse";
+import { PenpotMcpServer } from "../../PenpotMcpServer";
+import { NreplClient } from "../../NreplClient";
/**
* Reports the compiler status of the shadow-cljs `:main` build.
diff --git a/mcp/packages/server/src/tools/CljsReplTool.ts b/mcp/packages/server/src/tools/dev/CljsReplTool.ts
similarity index 89%
rename from mcp/packages/server/src/tools/CljsReplTool.ts
rename to mcp/packages/server/src/tools/dev/CljsReplTool.ts
index bd894caef3..ab2babf56d 100644
--- a/mcp/packages/server/src/tools/CljsReplTool.ts
+++ b/mcp/packages/server/src/tools/dev/CljsReplTool.ts
@@ -1,10 +1,10 @@
import { z } from "zod";
-import { Tool } from "../Tool";
+import { Tool } from "../../Tool";
import "reflect-metadata";
-import type { ToolResponse } from "../ToolResponse";
-import { TextResponse } from "../ToolResponse";
-import { PenpotMcpServer } from "../PenpotMcpServer";
-import { NreplClient } from "../NreplClient";
+import type { ToolResponse } from "../../ToolResponse";
+import { TextResponse } from "../../ToolResponse";
+import { PenpotMcpServer } from "../../PenpotMcpServer";
+import { NreplClient } from "../../NreplClient";
/**
* Arguments for the CljsReplTool.
diff --git a/mcp/packages/server/src/tools/ImportPenpotFileTool.ts b/mcp/packages/server/src/tools/dev/ImportPenpotFileTool.ts
similarity index 98%
rename from mcp/packages/server/src/tools/ImportPenpotFileTool.ts
rename to mcp/packages/server/src/tools/dev/ImportPenpotFileTool.ts
index f55ae194f2..50d18f5ae5 100644
--- a/mcp/packages/server/src/tools/ImportPenpotFileTool.ts
+++ b/mcp/packages/server/src/tools/dev/ImportPenpotFileTool.ts
@@ -1,10 +1,10 @@
import { z } from "zod";
-import { Tool } from "../Tool";
-import { TextResponse, ToolResponse } from "../ToolResponse";
+import { Tool } from "../../Tool";
+import { TextResponse, ToolResponse } from "../../ToolResponse";
import "reflect-metadata";
-import { PenpotMcpServer } from "../PenpotMcpServer";
-import { NreplClient } from "../NreplClient";
-import { createLogger } from "../logger";
+import { PenpotMcpServer } from "../../PenpotMcpServer";
+import { NreplClient } from "../../NreplClient";
+import { createLogger } from "../../logger";
import * as crypto from "crypto";
import * as fs from "fs";
import * as path from "path";
diff --git a/mcp/packages/server/src/tools/ReadTaigaIssueTool.ts b/mcp/packages/server/src/tools/dev/ReadTaigaIssueTool.ts
similarity index 96%
rename from mcp/packages/server/src/tools/ReadTaigaIssueTool.ts
rename to mcp/packages/server/src/tools/dev/ReadTaigaIssueTool.ts
index 29e8bea460..decd926182 100644
--- a/mcp/packages/server/src/tools/ReadTaigaIssueTool.ts
+++ b/mcp/packages/server/src/tools/dev/ReadTaigaIssueTool.ts
@@ -1,9 +1,9 @@
import { z } from "zod";
-import { Tool } from "../Tool";
+import { Tool } from "../../Tool";
import "reflect-metadata";
-import type { ToolResponse } from "../ToolResponse";
-import { TextResponse } from "../ToolResponse";
-import { PenpotMcpServer } from "../PenpotMcpServer";
+import type { ToolResponse } from "../../ToolResponse";
+import { TextResponse } from "../../ToolResponse";
+import { PenpotMcpServer } from "../../PenpotMcpServer";
/**
* Arguments for the {@link ReadTaigaIssueTool}.
diff --git a/mcp/pnpm-lock.yaml b/mcp/pnpm-lock.yaml
index 7b7f98e50e..f005fb60ac 100644
--- a/mcp/pnpm-lock.yaml
+++ b/mcp/pnpm-lock.yaml
@@ -7,153 +7,153 @@ importers:
configDependencies: {}
packageManagerDependencies:
pnpm:
- specifier: 12.15.0
- version: 12.15.0
+ specifier: 12.18.0
+ version: 12.18.0
packages:
- '@pnpm/exe.android-arm64@12.15.0':
- resolution: {integrity: sha512-eVCqmscY70LGvgRzu3mi8IBWBFGix+a6mNZoWmXxESsBdeiKEF9xQSuaeel10yn+zI7TXy2jlI63vFLzETk+aQ==}
+ '@pnpm/exe.android-arm64@12.18.0':
+ resolution: {integrity: sha512-fOF6IwgvnUKEmVedGqiAsNPfN2Ry8GvaqzSQOiF3RJFbpBfPKO/6YT54s1GjToyYinRxw9preHHPe4y2N3SzhA==}
cpu: [arm64]
os: [android]
- '@pnpm/exe.android-x64@12.15.0':
- resolution: {integrity: sha512-Gx/WbkFcdUFUg8g8AShezcS9EiQxfYvdAm2hfKLO8sfJmJvKOCt5fzlgHWDzmGhoclibgW+tUGZ/KF4F4wOTCA==}
+ '@pnpm/exe.android-x64@12.18.0':
+ resolution: {integrity: sha512-6OiolnaCsB3/GcJ9XNrenbUH3zFHRJ+5QynrMUUEyThbgnnCzWxa199hpQlOmxN4rAXuYQ0IYgWFNUZxyzg31Q==}
cpu: [x64]
os: [android]
- '@pnpm/exe.darwin-arm64@12.15.0':
- resolution: {integrity: sha512-N0ZykiDWCvqSBJvt71j7cSoBR993FqvYZFtmpCtqvW3pguiI+NAgraLPA5OTwu5mV+/d8hYpVcPktJA3xFDLtA==}
+ '@pnpm/exe.darwin-arm64@12.18.0':
+ resolution: {integrity: sha512-zkq+4YzVIX39ETYLyC3W7LY7MpHEU/J3nRhHl4i2yPld2Cf2+rEKRh3ejJ4AmaQ77HHJLCktY4Z3jq0fpcxFXg==}
cpu: [arm64]
os: [darwin]
- '@pnpm/exe.darwin-x64@12.15.0':
- resolution: {integrity: sha512-7Ntr2HlBUxzwWOg7NwDxCbRW/3vXuqKO+hcXm+w3SBi9rrHY53li1wLqWVT7Gjxd+lVEHM1QJZo6WJEGFU8C6A==}
+ '@pnpm/exe.darwin-x64@12.18.0':
+ resolution: {integrity: sha512-qMsL9qx92unOTa6hgkfiTJv8ceZaTx0IQg7InhYDVX2ZrTECujaVEEVypnJK5m3eGUsP1KD7Y4qIgleCwfRsYw==}
cpu: [x64]
os: [darwin]
- '@pnpm/exe.freebsd-x64@12.15.0':
- resolution: {integrity: sha512-btOiyL7fL7W4uQGH0aqFai2TNC3IoKcZ7gNHBVbEFZt2dWrnrD0SufL3iGs3fLlmb4OtuU35uf4Zpr9V9Jh9mA==}
+ '@pnpm/exe.freebsd-x64@12.18.0':
+ resolution: {integrity: sha512-/9vy/4ms52cU4MjZ5NhHd6N2d9L9W0kARf5/ff2tweAHu0VeUzs/0qp/7ZHFuddm2Wa/m0AKQoPum9AVUCqKsw==}
cpu: [x64]
os: [freebsd]
- '@pnpm/exe.linux-arm64-musl@12.15.0':
- resolution: {integrity: sha512-pNC38k+O+90FOjbPNSnw0E7apq1PKTmz3fFe1amn+lys/U5kL++uzir8bRiho8ONcyA3d9EU7wdqcY0DKkj+JA==}
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
+ resolution: {integrity: sha512-Vp+TIMPPyackVCXkOdEKH/RmAn/r07EcIyrgZYQK7VrkksqZOie0GnWIx+85mPqeFEYCRtXIZAFJ9L4ceTndDg==}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-arm64@12.15.0':
- resolution: {integrity: sha512-qML/8aCXslh8td/w4U+HJNqUcZ2+m6EfTbWScIzZRmyPsRFN+xB4LP1U/hymxc1iSJiKtG56HJx2fvUErWFIGw==}
+ '@pnpm/exe.linux-arm64@12.18.0':
+ resolution: {integrity: sha512-2dpyVBCHT+FfpuQh9i+7MXAqNWYLCvD5vYr5p6Eimxoga8USLnjbUgyj72AOrO0hjc5ri3TEFP3jiyBHjkSZpQ==}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-ppc64@12.15.0':
- resolution: {integrity: sha512-tjRDUUl7RCJ6T/6eoNPxOqkwU4Mzi5RtTXmSAxujyz37OTwwsMU7Ps087Zk4gHcUvRSeyF40ZFsew3vtE+nmUA==}
+ '@pnpm/exe.linux-ppc64@12.18.0':
+ resolution: {integrity: sha512-BBOOOfNJ2QwIIya3eKqOjiN4WNTszfRz7HCvw9XggcT7+ftMjNP8XJ/GfW+ltCBeUFR9d8WBVsr2m/NLjX2CZQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-riscv64@12.15.0':
- resolution: {integrity: sha512-bF1uBWEfbwaeryz6lIiaJ8AWD082otZfvzGX5l+6LZRpRwUEpJHUsJrORaYP5/cNMv5ZR2p6TvvcJcQzwtDzmw==}
+ '@pnpm/exe.linux-riscv64@12.18.0':
+ resolution: {integrity: sha512-7kMN77xSOYJX8GPSH5RbNAc5oM61LMmcSUukDDUwllnZPXm8GRPskCNsTWy8SCw01Kr1FB+5SwGNMiTdiziLNQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-s390x@12.15.0':
- resolution: {integrity: sha512-zKMhIzsexYMToeLmqV5jPsvV/f9vwsJb2kUH2NFYzalbxImeBrlA4kL7GwF8gD4pagV6jYYcJb8RjbZIdjHptg==}
+ '@pnpm/exe.linux-s390x@12.18.0':
+ resolution: {integrity: sha512-htuSCpEcmDzhKoJqXbPkvfr176dBHU0QIF5mWcRiqxRXAB/1JoYiMYotfjWpk+ztgpB9qlx4XnWlLFAf7gzc6g==}
cpu: [s390x]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-x64-musl@12.15.0':
- resolution: {integrity: sha512-A9J0Jg0Rdx+qQU4qXtwyST5tto9IOu1zi4fDk35nbc6DWahggbcKtFvZPKFwL2qgUXGXOX//hXv6z/sp6emO8A==}
+ '@pnpm/exe.linux-x64-musl@12.18.0':
+ resolution: {integrity: sha512-Uj+vzfIQ62kDP10x36yHZIXVs5ohdNtiPYwn5FhCLlNScHPo0OAI+ShGDtLofiBXKE7umu71Jmjm7N8a8zVcDw==}
cpu: [x64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-x64@12.15.0':
- resolution: {integrity: sha512-yc+QlZR+9+nr29J4fRzhMoapgxTBDndq/+peyoq1XUufnQFnfbXUMFudDIKzHi545linGqmOmXfn0NoufNgcOg==}
+ '@pnpm/exe.linux-x64@12.18.0':
+ resolution: {integrity: sha512-OJ+X2wcraldCwj75pCIerWARQSRpdfj0eBTs/2ODyhfeW46ylOnjTIE/GKra6Mn6E72/gBmXS8igrUioa+F9fQ==}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.win32-arm64@12.15.0':
- resolution: {integrity: sha512-fPXZxuY1VclkOga9bc53qNCXcegfeoBR8+Ue+AospDwKzuGGSHll0oDxkLfkmpjyRqpe7bH5DyQPYp/xSMaIVA==}
+ '@pnpm/exe.win32-arm64@12.18.0':
+ resolution: {integrity: sha512-wEY6jiACGcbhhi5yD59doHqNTndS7AaujaPmtWAu1DKkHru2hy5fJ9yUGecW72Ypaw2/I3BEprfMOopap2NQtw==}
cpu: [arm64]
os: [win32]
- '@pnpm/exe.win32-x64@12.15.0':
- resolution: {integrity: sha512-nrd+Tp1We1DGj4DGG5Bea9lZNh9y1PjlLBdEwdInS4D0h0UIDtM7JaGGGDJhNzIwcHASyihWI7HLV+dtG+fhYg==}
+ '@pnpm/exe.win32-x64@12.18.0':
+ resolution: {integrity: sha512-5FJkghO7RLRkQpWxeVEygW9XsmnNuxzPfXbgwFWCHsFyFhpDn/vOdL88ToQEM0Kt5igdW5s6U0/IDH8Dvkt3pg==}
cpu: [x64]
os: [win32]
- pnpm@12.15.0:
- resolution: {integrity: sha512-s5UdbW/0qfE9x89WzSjSuOs328ycaOUuHhGRhz6p+CoBcoerULqtxczElPA2xnwOR+sTYIwvo29HcRth6hKOYQ==}
+ pnpm@12.18.0:
+ resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==}
engines: {node: '>=18'}
hasBin: true
snapshots:
- '@pnpm/exe.android-arm64@12.15.0':
+ '@pnpm/exe.android-arm64@12.18.0':
optional: true
- '@pnpm/exe.android-x64@12.15.0':
+ '@pnpm/exe.android-x64@12.18.0':
optional: true
- '@pnpm/exe.darwin-arm64@12.15.0':
+ '@pnpm/exe.darwin-arm64@12.18.0':
optional: true
- '@pnpm/exe.darwin-x64@12.15.0':
+ '@pnpm/exe.darwin-x64@12.18.0':
optional: true
- '@pnpm/exe.freebsd-x64@12.15.0':
+ '@pnpm/exe.freebsd-x64@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64-musl@12.15.0':
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64@12.15.0':
+ '@pnpm/exe.linux-arm64@12.18.0':
optional: true
- '@pnpm/exe.linux-ppc64@12.15.0':
+ '@pnpm/exe.linux-ppc64@12.18.0':
optional: true
- '@pnpm/exe.linux-riscv64@12.15.0':
+ '@pnpm/exe.linux-riscv64@12.18.0':
optional: true
- '@pnpm/exe.linux-s390x@12.15.0':
+ '@pnpm/exe.linux-s390x@12.18.0':
optional: true
- '@pnpm/exe.linux-x64-musl@12.15.0':
+ '@pnpm/exe.linux-x64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-x64@12.15.0':
+ '@pnpm/exe.linux-x64@12.18.0':
optional: true
- '@pnpm/exe.win32-arm64@12.15.0':
+ '@pnpm/exe.win32-arm64@12.18.0':
optional: true
- '@pnpm/exe.win32-x64@12.15.0':
+ '@pnpm/exe.win32-x64@12.18.0':
optional: true
- pnpm@12.15.0:
+ pnpm@12.18.0:
optionalDependencies:
- '@pnpm/exe.android-arm64': 12.15.0
- '@pnpm/exe.android-x64': 12.15.0
- '@pnpm/exe.darwin-arm64': 12.15.0
- '@pnpm/exe.darwin-x64': 12.15.0
- '@pnpm/exe.freebsd-x64': 12.15.0
- '@pnpm/exe.linux-arm64': 12.15.0
- '@pnpm/exe.linux-arm64-musl': 12.15.0
- '@pnpm/exe.linux-ppc64': 12.15.0
- '@pnpm/exe.linux-riscv64': 12.15.0
- '@pnpm/exe.linux-s390x': 12.15.0
- '@pnpm/exe.linux-x64': 12.15.0
- '@pnpm/exe.linux-x64-musl': 12.15.0
- '@pnpm/exe.win32-arm64': 12.15.0
- '@pnpm/exe.win32-x64': 12.15.0
+ '@pnpm/exe.android-arm64': 12.18.0
+ '@pnpm/exe.android-x64': 12.18.0
+ '@pnpm/exe.darwin-arm64': 12.18.0
+ '@pnpm/exe.darwin-x64': 12.18.0
+ '@pnpm/exe.freebsd-x64': 12.18.0
+ '@pnpm/exe.linux-arm64': 12.18.0
+ '@pnpm/exe.linux-arm64-musl': 12.18.0
+ '@pnpm/exe.linux-ppc64': 12.18.0
+ '@pnpm/exe.linux-riscv64': 12.18.0
+ '@pnpm/exe.linux-s390x': 12.18.0
+ '@pnpm/exe.linux-x64': 12.18.0
+ '@pnpm/exe.linux-x64-musl': 12.18.0
+ '@pnpm/exe.win32-arm64': 12.18.0
+ '@pnpm/exe.win32-x64': 12.18.0
---
lockfileVersion: '9.0'
@@ -171,11 +171,29 @@ importers:
.:
devDependencies:
concurrently:
- specifier: ^10.0.5
- version: 10.0.5
+ specifier: ^10.0.6
+ version: 10.0.6
prettier:
- specifier: ^3.9.9
- version: 3.9.9
+ specifier: ^3.9.10
+ version: 3.9.10
+
+ packages/browser-extension:
+ devDependencies:
+ '@penpot/mcp-common':
+ specifier: workspace:../common
+ version: link:../common
+ '@types/chrome':
+ specifier: ^0.3.6
+ version: 0.3.6
+ esbuild:
+ specifier: ^0.28.2
+ version: 0.28.2
+ tsx:
+ specifier: ^4.23.15
+ version: 4.23.15
+ typescript:
+ specifier: ^6.0.3
+ version: 6.0.3
packages/common:
devDependencies:
@@ -186,8 +204,8 @@ importers:
packages/plugin:
dependencies:
'@penpot/plugin-styles':
- specifier: 1.5.0
- version: 1.5.0
+ specifier: 1.6.0
+ version: 1.6.0
'@penpot/plugin-types':
specifier: link:../../../plugins/libs/plugin-types
version: link:../../../plugins/libs/plugin-types
@@ -199,11 +217,11 @@ importers:
specifier: ^6.0.3
version: 6.0.3
vite:
- specifier: ^8.3.2
- version: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)
+ specifier: ^8.3.5
+ version: 8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)
vite-live-preview:
specifier: ^0.4.0
- version: 0.4.0(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15))
+ version: 0.4.0(vite@8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15))
packages/server:
dependencies:
@@ -220,14 +238,14 @@ importers:
specifier: ^0.15.1
version: 0.15.1
express:
- specifier: ^5.2.1
- version: 5.2.1(supports-color@10.2.2)
+ specifier: ^5.3.0
+ version: 5.3.0(supports-color@10.2.2)
ioredis:
specifier: ^6.0.0
version: 6.0.0(supports-color@10.2.2)
js-yaml:
- specifier: ^5.4.2
- version: 5.4.2
+ specifier: ^5.5.0
+ version: 5.5.0
nrepl-client:
specifier: ^0.3.0
version: 0.3.0
@@ -245,13 +263,13 @@ importers:
version: 0.2.2
sharp:
specifier: ^0.35.5
- version: 0.35.5(@types/node@26.6.4)
+ version: 0.35.5(@types/node@26.6.5)
ws:
specifier: ^8.22.0
version: 8.22.0
zod:
- specifier: ^4.6.5
- version: 4.6.5
+ specifier: ^4.6.7
+ version: 4.6.7
devDependencies:
'@modelcontextprotocol/client':
specifier: ^2.3.1
@@ -266,8 +284,8 @@ importers:
specifier: ^4.0.9
version: 4.0.9
'@types/node':
- specifier: ^26.6.4
- version: 26.6.4
+ specifier: ^26.6.5
+ version: 26.6.5
'@types/ws':
specifier: ^8.18.2
version: 8.18.2
@@ -279,7 +297,7 @@ importers:
version: 0.28.2
ts-node:
specifier: ^10.9.2
- version: 10.9.2(@types/node@26.6.4)(typescript@6.0.3)
+ version: 10.9.2(@types/node@26.6.5)(typescript@6.0.3)
tsx:
specifier: ^4.23.15
version: 4.23.15
@@ -654,107 +672,107 @@ packages:
resolution: {integrity: sha512-e59MfWuSssj6DoQ96JCTqdW1AXT5/XtnTl0WWd6MU1Ka434fFUGGosCLJbGNySDhHGvxQWoRWK137FXYFkYNWw==}
engines: {node: '>=20'}
- '@oxc-project/types@0.152.0':
- resolution: {integrity: sha512-oM/5rLBm2tPkg0iBgkH/FOeR3PCDpY19GTgAZjMFM8h9WI9VW7cLgzp6nwtarYKmovavIQZ+Fe/RKX/8C8O/Rw==}
+ '@oxc-project/types@0.155.0':
+ resolution: {integrity: sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==}
- '@penpot/plugin-styles@1.5.0':
- resolution: {integrity: sha512-rwXFBRPd0IZs3ens+eRT8oA5WqkQgF6xlW6fCfH7U1NHRjej9HH7vTGXmfjoIVml6Xx1sbyYHZVxkQC8Ub8+zA==}
+ '@penpot/plugin-styles@1.6.0':
+ resolution: {integrity: sha512-vmIDYbQqIcTPxYer7/C1nmo5QJyErTI4ZcFNELuENMnLcs+UeAFWtqsMENGoY6jfldEujbUwoglS9hBKI11x5Q==}
'@pinojs/redact@0.4.0':
resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==}
- '@rolldown/binding-android-arm-eabi@1.2.12':
- resolution: {integrity: sha512-dB/a1214qKfHMXCpgqR4OZT+jS4kTyEXbQGJPqzobt5EwH5rX080pxE37alt3RzvR1bf1Yz/yGqRfrYAxuPw0A==}
+ '@rolldown/binding-android-arm-eabi@1.2.15':
+ resolution: {integrity: sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
- '@rolldown/binding-android-arm64@1.2.12':
- resolution: {integrity: sha512-7KHFgQ5VJxIHcLlrwrc3Xbds7oTNQT7Pgi9gQCJKrd2VGab/UksIOYp6VD8MzCstGxOKMgNamPwUCfxPdP1OHg==}
+ '@rolldown/binding-android-arm64@1.2.15':
+ resolution: {integrity: sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
- '@rolldown/binding-darwin-arm64@1.2.12':
- resolution: {integrity: sha512-3YIhqHD96nA5SaYNRBR16HnGv4oavZvXfD/ayHM+oYZ0WD/8lBAtf6zQua4kEyAvpqrluKXl0lnOBoiNby7x9w==}
+ '@rolldown/binding-darwin-arm64@1.2.15':
+ resolution: {integrity: sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
- '@rolldown/binding-darwin-x64@1.2.12':
- resolution: {integrity: sha512-UuuJ35MFw4gmFOrE9pEqIV+K3syIKveph+Qc1/ljHZVdoDW4pz/JHR/eMVom+TZGl/5OOvGJOWaOCVt3ZfqhxA==}
+ '@rolldown/binding-darwin-x64@1.2.15':
+ resolution: {integrity: sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
- '@rolldown/binding-freebsd-x64@1.2.12':
- resolution: {integrity: sha512-uMvssit0a4W+/7D8CbHUvG719mH3R2jwXAlh/XcPvuHTE0g++LymF88DCGNX0HM2rBOn0xrzgXktIB6fLSJBTQ==}
+ '@rolldown/binding-freebsd-x64@1.2.15':
+ resolution: {integrity: sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
- '@rolldown/binding-linux-arm-gnueabihf@1.2.12':
- resolution: {integrity: sha512-XcFu0R0xWnwzSf4IQgFH1rJIckPN1pLy2R+4r9IDB7Yfu/ys9cVqfa4pBrMHj7a3gl8mIR4nRNPg0e5IvEVs6g==}
+ '@rolldown/binding-linux-arm-gnueabihf@1.2.15':
+ resolution: {integrity: sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
- '@rolldown/binding-linux-arm64-gnu@1.2.12':
- resolution: {integrity: sha512-260UrKgn8tz39ak+SMDOirKzr7V04M9dWPw5llW00SwBivCZoWcRBKV1d8cXnRkUmSZA3BdiUmBHWk7734Ulpw==}
+ '@rolldown/binding-linux-arm64-gnu@1.2.15':
+ resolution: {integrity: sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-arm64-musl@1.2.12':
- resolution: {integrity: sha512-5YK1I9SqDkbPgc1IA8BgDl34suqUS2q0KWnBrirm0E51YjOs6eo6dV6jbQfNE/argHRSvd0QUGgtpIoYx+WWpw==}
+ '@rolldown/binding-linux-arm64-musl@1.2.15':
+ resolution: {integrity: sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@rolldown/binding-linux-ppc64-gnu@1.2.12':
- resolution: {integrity: sha512-Rkcrmp7eFRg74yL5fXEU91JEWbdEPLevWwGtXpmhbjlD1StScbWTmO94Bhly+Mo+ketKYkdmM1vNUKeWSlx8cQ==}
+ '@rolldown/binding-linux-ppc64-gnu@1.2.15':
+ resolution: {integrity: sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-s390x-gnu@1.2.12':
- resolution: {integrity: sha512-qvK4DuAsQc2BSjlx+Xr+IzOIvvxbGZqxFwdWfG6F518Erj0GGISyQbJ6pIappnOxlNPzNHvo/L0BwB30GZ+zVw==}
+ '@rolldown/binding-linux-s390x-gnu@1.2.15':
+ resolution: {integrity: sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-x64-gnu@1.2.12':
- resolution: {integrity: sha512-Q9uLBO53Xd4QIq1WOycVQyPP1O4HhraEV2qqb3uTrnVw6QZih9duY4vNXOivL1xoUS1/z+W8eF4NMfl2a8Sdjw==}
+ '@rolldown/binding-linux-x64-gnu@1.2.15':
+ resolution: {integrity: sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-x64-musl@1.2.12':
- resolution: {integrity: sha512-3IBxWFMjbOZskDPKv8Lf9BCnahlKuHthWkYnyIxOH/QcJrFcS4EmcenthApkwr/5+nEqZlLzeYbxeMaX7A5u4g==}
+ '@rolldown/binding-linux-x64-musl@1.2.15':
+ resolution: {integrity: sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
- '@rolldown/binding-openharmony-arm64@1.2.12':
- resolution: {integrity: sha512-xtX61xg4LKPkPWilZU1ynKClz5Gj4bf74LML4r3eVLWumKnGjoEr1OSHQhMdbBDoYTi+yjrujvpZe2pUnqCrrA==}
+ '@rolldown/binding-openharmony-arm64@1.2.15':
+ resolution: {integrity: sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
- '@rolldown/binding-win32-arm64-msvc@1.2.12':
- resolution: {integrity: sha512-At7fPB6PCaIjzgIhEZFxuT+BBFqiQibJDT4d3PhiR3f4E7bbMZF4aKblbFfEM3sETRDd1YiQx/+U/g/B/ou5Ew==}
+ '@rolldown/binding-win32-arm64-msvc@1.2.15':
+ resolution: {integrity: sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
- '@rolldown/binding-win32-x64-msvc@1.2.12':
- resolution: {integrity: sha512-WIw2haVKwjuYdXkHaoC0mF8Le71TuCBxjrdKqLbJGctbBABj+ClfmNvtbOnzpq3RokNo5+V1qhtSzJyXorsklQ==}
+ '@rolldown/binding-win32-x64-msvc@1.2.15':
+ resolution: {integrity: sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
@@ -783,6 +801,9 @@ packages:
'@types/body-parser@1.19.6':
resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==}
+ '@types/chrome@0.3.6':
+ resolution: {integrity: sha512-NXCrCBefCHCKMVbkaxfBQqyP766Wg85S2FQhixCCxq7AtjJwoEaja2y5NSqCzpihIi9mPqhaF5RuybTnrdYD2Q==}
+
'@types/connect@3.4.38':
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
@@ -792,6 +813,9 @@ packages:
'@types/express@5.0.6':
resolution: {integrity: sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==}
+ '@types/har-format@1.2.16':
+ resolution: {integrity: sha512-fluxdy7ryD3MV6h8pTfTYpy/xQzCFC7m89nOH9y94cNqJ1mDIDPut7MnRHI3F6qRmh/cT2fUjG1MLdCNb4hE9A==}
+
'@types/http-errors@2.0.5':
resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==}
@@ -801,6 +825,9 @@ packages:
'@types/node@26.6.4':
resolution: {integrity: sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==}
+ '@types/node@26.6.5':
+ resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==}
+
'@types/qs@6.15.1':
resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==}
@@ -843,8 +870,8 @@ packages:
arg@4.1.3:
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
- argparse@2.0.1:
- resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
+ argparse@3.0.4:
+ resolution: {integrity: sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==}
atomic-sleep@1.0.0:
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
@@ -853,8 +880,8 @@ packages:
bencode@2.0.3:
resolution: {integrity: sha512-D/vrAD4dLVX23NalHwb8dSvsUsxeRPO8Y7ToKA015JQYq69MLDOMkC0uGZYA/MPpltLO8rt8eqFC2j8DxjTZ/w==}
- body-parser@2.3.0:
- resolution: {integrity: sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==}
+ body-parser@2.4.0:
+ resolution: {integrity: sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==}
engines: {node: '>=18'}
bytes@3.1.2:
@@ -890,19 +917,15 @@ packages:
colorette@2.0.20:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
- concurrently@10.0.5:
- resolution: {integrity: sha512-JaP/CoftUrCcAFW/g//RbgEGwlelnEae6cfBLgH6ZdO6s8jPkn6p9SB9u6pdVxYXoiSnFqseOlHfrEfF82TVOg==}
+ concurrently@10.0.6:
+ resolution: {integrity: sha512-qgICXXFp2/3nAebRLmxcINKEXM1mLK3ij/y31P02VTs/KIkddIeC05n73DxOXsXMB9LFSqNU1/na3lDlOhcbIw==}
engines: {node: '>=22'}
hasBin: true
- content-disposition@1.1.0:
- resolution: {integrity: sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==}
+ content-disposition@2.0.1:
+ resolution: {integrity: sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==}
engines: {node: '>=18'}
- content-type@1.0.5:
- resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==}
- engines: {node: '>= 0.6'}
-
content-type@2.1.0:
resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==}
engines: {node: '>=18'}
@@ -1012,8 +1035,8 @@ packages:
resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==}
engines: {node: '>=18.0.0'}
- express@5.2.1:
- resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==}
+ express@5.3.0:
+ resolution: {integrity: sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==}
engines: {node: '>= 18'}
fast-copy@4.1.2:
@@ -1118,8 +1141,8 @@ packages:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
- js-yaml@5.4.2:
- resolution: {integrity: sha512-m+aqu+LwO1O6sIopafj8HUVl5aawITwZQe/yHpMCKjaWBaA/d07B/QdMb3529REftiU+RMMHL3Vlsw3hON7vWg==}
+ js-yaml@5.5.0:
+ resolution: {integrity: sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==}
hasBin: true
libphonenumber-js@1.13.14:
@@ -1248,8 +1271,8 @@ packages:
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
engines: {node: '>=14.0.0'}
- on-finished@2.4.1:
- resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
+ on-finished@2.4.2:
+ resolution: {integrity: sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==}
engines: {node: '>= 0.8'}
once@1.4.0:
@@ -1296,17 +1319,17 @@ packages:
resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==}
engines: {node: '>=16.20.0'}
- postcss@8.5.29:
- resolution: {integrity: sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==}
+ postcss@8.5.32:
+ resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==}
engines: {node: ^10 || ^12 || >=14}
- prettier@3.9.9:
- resolution: {integrity: sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg==}
+ prettier@3.9.10:
+ resolution: {integrity: sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==}
engines: {node: '>=14'}
hasBin: true
- process-warning@5.1.0:
- resolution: {integrity: sha512-jQSaVHsPgtyw60e1rQ/A+/ArPEj/S8pS/vFnyGa/gYFXrKk/6RuDkoqVDQ5NI5MmS01698ltlAk0NoDBNLujRw==}
+ process-warning@5.1.1:
+ resolution: {integrity: sha512-oCkNVj4OKnKEcocVBcDfiIugN1/cE6rgfT3nCtzeqZPA8+rIxMaQ0xXzIkGP8Gj2qUaP1UR7uhJ1VD8lUCpzCg==}
proxy-addr@2.0.8:
resolution: {integrity: sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==}
@@ -1319,6 +1342,10 @@ packages:
resolution: {integrity: sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==}
engines: {node: '>=0.6'}
+ qs@6.17.0:
+ resolution: {integrity: sha512-5LK5BZ2XDHMvcUJaf0CQ5HL3aVgKbpklvByC7qLSxYkfE8COEEbJg5xCHWCTqzqi0Gs4Jn5Mv5v3R38W6edscA==}
+ engines: {node: '>=0.6'}
+
quick-format-unescaped@4.0.4:
resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
@@ -1340,8 +1367,8 @@ packages:
reflect-metadata@0.2.2:
resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
- rolldown@1.2.12:
- resolution: {integrity: sha512-8wafseiaG80xmXSfqidUNqZcylTlhmPZZt+za2m+js2sFZ8dTNlhIOV2WcbIPx2hgwPBJpEUGFAMZ9bgBBLTSQ==}
+ rolldown@1.2.15:
+ resolution: {integrity: sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
@@ -1359,8 +1386,8 @@ packages:
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
- secure-json-parse@4.1.0:
- resolution: {integrity: sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==}
+ secure-json-parse@4.1.1:
+ resolution: {integrity: sha512-lnd81MQEZKjhW/Gd2TQqdd4XP6QYNdDW/EP+I7nTrFHP9y2LmaGPIHk9xsnzcOiEr1c39c/e84xFgGviQKBTRw==}
semver@7.8.5:
resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==}
@@ -1522,13 +1549,13 @@ packages:
peerDependencies:
vite: '>=5.4.0'
- vite@8.3.2:
- resolution: {integrity: sha512-SQr1x6W5vVSbROg7vsyXIaxK9b0G7zsT68acdWWRmnBUsgDieLCRG+Rep9WdZgcposvv/GSnr4GUUBqB3vXq6w==}
+ vite@8.3.5:
+ resolution: {integrity: sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
'@types/node': ^20.19.0 || >=22.12.0
- '@vitejs/devtools': ^0.7.1
+ '@vitejs/devtools': ^0.7.1 || ^0.8.0
esbuild: ^0.27.0 || ^0.28.0
jiti: '>=1.21.0'
less: ^4.0.0
@@ -1605,8 +1632,8 @@ packages:
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
engines: {node: '>=6'}
- zod@4.6.5:
- resolution: {integrity: sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==}
+ zod@4.6.7:
+ resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==}
snapshots:
@@ -1828,11 +1855,11 @@ snapshots:
eventsource-parser: 3.1.1
jose: 6.2.12
pkce-challenge: 5.0.1
- zod: 4.6.5
+ zod: 4.6.7
'@modelcontextprotocol/core@2.3.1':
dependencies:
- zod: 4.6.5
+ zod: 4.6.7
'@modelcontextprotocol/node@2.1.1(@modelcontextprotocol/server@2.3.1)':
dependencies:
@@ -1843,57 +1870,57 @@ snapshots:
'@modelcontextprotocol/server@2.3.1':
dependencies:
'@modelcontextprotocol/core': 2.3.1
- zod: 4.6.5
+ zod: 4.6.7
- '@oxc-project/types@0.152.0': {}
+ '@oxc-project/types@0.155.0': {}
- '@penpot/plugin-styles@1.5.0': {}
+ '@penpot/plugin-styles@1.6.0': {}
'@pinojs/redact@0.4.0': {}
- '@rolldown/binding-android-arm-eabi@1.2.12':
+ '@rolldown/binding-android-arm-eabi@1.2.15':
optional: true
- '@rolldown/binding-android-arm64@1.2.12':
+ '@rolldown/binding-android-arm64@1.2.15':
optional: true
- '@rolldown/binding-darwin-arm64@1.2.12':
+ '@rolldown/binding-darwin-arm64@1.2.15':
optional: true
- '@rolldown/binding-darwin-x64@1.2.12':
+ '@rolldown/binding-darwin-x64@1.2.15':
optional: true
- '@rolldown/binding-freebsd-x64@1.2.12':
+ '@rolldown/binding-freebsd-x64@1.2.15':
optional: true
- '@rolldown/binding-linux-arm-gnueabihf@1.2.12':
+ '@rolldown/binding-linux-arm-gnueabihf@1.2.15':
optional: true
- '@rolldown/binding-linux-arm64-gnu@1.2.12':
+ '@rolldown/binding-linux-arm64-gnu@1.2.15':
optional: true
- '@rolldown/binding-linux-arm64-musl@1.2.12':
+ '@rolldown/binding-linux-arm64-musl@1.2.15':
optional: true
- '@rolldown/binding-linux-ppc64-gnu@1.2.12':
+ '@rolldown/binding-linux-ppc64-gnu@1.2.15':
optional: true
- '@rolldown/binding-linux-s390x-gnu@1.2.12':
+ '@rolldown/binding-linux-s390x-gnu@1.2.15':
optional: true
- '@rolldown/binding-linux-x64-gnu@1.2.12':
+ '@rolldown/binding-linux-x64-gnu@1.2.15':
optional: true
- '@rolldown/binding-linux-x64-musl@1.2.12':
+ '@rolldown/binding-linux-x64-musl@1.2.15':
optional: true
- '@rolldown/binding-openharmony-arm64@1.2.12':
+ '@rolldown/binding-openharmony-arm64@1.2.15':
optional: true
- '@rolldown/binding-win32-arm64-msvc@1.2.12':
+ '@rolldown/binding-win32-arm64-msvc@1.2.15':
optional: true
- '@rolldown/binding-win32-x64-msvc@1.2.12':
+ '@rolldown/binding-win32-x64-msvc@1.2.15':
optional: true
'@rolldown/pluginutils@1.0.1': {}
@@ -1913,15 +1940,19 @@ snapshots:
'@types/body-parser@1.19.6':
dependencies:
'@types/connect': 3.4.38
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
+
+ '@types/chrome@0.3.6':
+ dependencies:
+ '@types/har-format': 1.2.16
'@types/connect@3.4.38':
dependencies:
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
'@types/express-serve-static-core@5.1.3':
dependencies:
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
'@types/qs': 6.15.1
'@types/range-parser': 1.2.7
'@types/send': 1.2.1
@@ -1932,6 +1963,8 @@ snapshots:
'@types/express-serve-static-core': 5.1.3
'@types/serve-static': 2.2.0
+ '@types/har-format@1.2.16': {}
+
'@types/http-errors@2.0.5': {}
'@types/js-yaml@4.0.9': {}
@@ -1940,18 +1973,22 @@ snapshots:
dependencies:
undici-types: 8.9.0
+ '@types/node@26.6.5':
+ dependencies:
+ undici-types: 8.9.0
+
'@types/qs@6.15.1': {}
'@types/range-parser@1.2.7': {}
'@types/send@1.2.1':
dependencies:
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
'@types/serve-static@2.2.0':
dependencies:
'@types/http-errors': 2.0.5
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
'@types/validator@13.15.10': {}
@@ -1976,21 +2013,21 @@ snapshots:
arg@4.1.3: {}
- argparse@2.0.1: {}
+ argparse@3.0.4: {}
atomic-sleep@1.0.0: {}
bencode@2.0.3: {}
- body-parser@2.3.0(supports-color@10.2.2):
+ body-parser@2.4.0(supports-color@10.2.2):
dependencies:
bytes: 3.1.2
content-type: 2.1.0
debug: 4.4.3(supports-color@10.2.2)
http-errors: 2.0.1
iconv-lite: 0.7.3
- on-finished: 2.4.1
- qs: 6.16.0
+ on-finished: 2.4.2
+ qs: 6.17.0
raw-body: 3.0.2
type-is: 2.1.0
transitivePeerDependencies:
@@ -2028,7 +2065,7 @@ snapshots:
colorette@2.0.20: {}
- concurrently@10.0.5:
+ concurrently@10.0.6:
dependencies:
chalk: 5.6.2
rxjs: 7.8.2
@@ -2037,9 +2074,7 @@ snapshots:
tree-kill: 1.2.2
yargs: 18.0.0
- content-disposition@1.1.0: {}
-
- content-type@1.0.5: {}
+ content-disposition@2.0.1: {}
content-type@2.1.0: {}
@@ -2143,12 +2178,12 @@ snapshots:
dependencies:
eventsource-parser: 3.1.1
- express@5.2.1(supports-color@10.2.2):
+ express@5.3.0(supports-color@10.2.2):
dependencies:
accepts: 2.0.0
- body-parser: 2.3.0(supports-color@10.2.2)
- content-disposition: 1.1.0
- content-type: 1.0.5
+ body-parser: 2.4.0(supports-color@10.2.2)
+ content-disposition: 2.0.1
+ content-type: 2.1.0
cookie: 0.7.2
cookie-signature: 1.2.2
debug: 4.4.3(supports-color@10.2.2)
@@ -2161,7 +2196,7 @@ snapshots:
http-errors: 2.0.1
merge-descriptors: 2.0.0
mime-types: 3.0.2
- on-finished: 2.4.1
+ on-finished: 2.4.2
once: 1.4.0
parseurl: 1.3.3
proxy-addr: 2.0.8
@@ -2189,7 +2224,7 @@ snapshots:
debug: 4.4.3(supports-color@10.2.2)
encodeurl: 2.0.0
escape-html: 1.0.3
- on-finished: 2.4.1
+ on-finished: 2.4.2
parseurl: 1.3.3
statuses: 2.0.2
transitivePeerDependencies:
@@ -2273,9 +2308,9 @@ snapshots:
joycon@3.1.1: {}
- js-yaml@5.4.2:
+ js-yaml@5.5.0:
dependencies:
- argparse: 2.0.1
+ argparse: 3.0.4
libphonenumber-js@1.13.14: {}
@@ -2361,7 +2396,7 @@ snapshots:
on-exit-leak-free@2.1.2: {}
- on-finished@2.4.1:
+ on-finished@2.4.2:
dependencies:
ee-first: 1.1.1
@@ -2400,7 +2435,7 @@ snapshots:
on-exit-leak-free: 2.1.2
pino-abstract-transport: 3.0.0
pump: 3.0.4
- secure-json-parse: 4.1.0
+ secure-json-parse: 4.1.1
sonic-boom: 5.0.1
strip-json-comments: 5.0.3
@@ -2413,7 +2448,7 @@ snapshots:
on-exit-leak-free: 2.1.2
pino-abstract-transport: 3.0.0
pino-std-serializers: 7.1.0
- process-warning: 5.1.0
+ process-warning: 5.1.1
quick-format-unescaped: 4.0.4
real-require: 1.0.0
safe-stable-stringify: 2.5.0
@@ -2422,15 +2457,15 @@ snapshots:
pkce-challenge@5.0.1: {}
- postcss@8.5.29:
+ postcss@8.5.32:
dependencies:
nanoid: 3.3.20
picocolors: 1.1.1
source-map-js: 1.2.2
- prettier@3.9.9: {}
+ prettier@3.9.10: {}
- process-warning@5.1.0: {}
+ process-warning@5.1.1: {}
proxy-addr@2.0.8:
dependencies:
@@ -2447,6 +2482,11 @@ snapshots:
es-define-property: 1.0.1
side-channel: 1.1.1
+ qs@6.17.0:
+ dependencies:
+ es-define-property: 1.0.1
+ side-channel: 1.1.1
+
quick-format-unescaped@4.0.4: {}
range-parser@1.3.0: {}
@@ -2464,26 +2504,26 @@ snapshots:
reflect-metadata@0.2.2: {}
- rolldown@1.2.12:
+ rolldown@1.2.15:
dependencies:
- '@oxc-project/types': 0.152.0
+ '@oxc-project/types': 0.155.0
'@rolldown/pluginutils': 1.0.1
optionalDependencies:
- '@rolldown/binding-android-arm-eabi': 1.2.12
- '@rolldown/binding-android-arm64': 1.2.12
- '@rolldown/binding-darwin-arm64': 1.2.12
- '@rolldown/binding-darwin-x64': 1.2.12
- '@rolldown/binding-freebsd-x64': 1.2.12
- '@rolldown/binding-linux-arm-gnueabihf': 1.2.12
- '@rolldown/binding-linux-arm64-gnu': 1.2.12
- '@rolldown/binding-linux-arm64-musl': 1.2.12
- '@rolldown/binding-linux-ppc64-gnu': 1.2.12
- '@rolldown/binding-linux-s390x-gnu': 1.2.12
- '@rolldown/binding-linux-x64-gnu': 1.2.12
- '@rolldown/binding-linux-x64-musl': 1.2.12
- '@rolldown/binding-openharmony-arm64': 1.2.12
- '@rolldown/binding-win32-arm64-msvc': 1.2.12
- '@rolldown/binding-win32-x64-msvc': 1.2.12
+ '@rolldown/binding-android-arm-eabi': 1.2.15
+ '@rolldown/binding-android-arm64': 1.2.15
+ '@rolldown/binding-darwin-arm64': 1.2.15
+ '@rolldown/binding-darwin-x64': 1.2.15
+ '@rolldown/binding-freebsd-x64': 1.2.15
+ '@rolldown/binding-linux-arm-gnueabihf': 1.2.15
+ '@rolldown/binding-linux-arm64-gnu': 1.2.15
+ '@rolldown/binding-linux-arm64-musl': 1.2.15
+ '@rolldown/binding-linux-ppc64-gnu': 1.2.15
+ '@rolldown/binding-linux-s390x-gnu': 1.2.15
+ '@rolldown/binding-linux-x64-gnu': 1.2.15
+ '@rolldown/binding-linux-x64-musl': 1.2.15
+ '@rolldown/binding-openharmony-arm64': 1.2.15
+ '@rolldown/binding-win32-arm64-msvc': 1.2.15
+ '@rolldown/binding-win32-x64-msvc': 1.2.15
router@2.2.0(supports-color@10.2.2):
dependencies:
@@ -2503,7 +2543,7 @@ snapshots:
safer-buffer@2.1.2: {}
- secure-json-parse@4.1.0: {}
+ secure-json-parse@4.1.1: {}
semver@7.8.5: {}
@@ -2517,7 +2557,7 @@ snapshots:
http-errors: 2.0.1
mime-types: 3.0.2
ms: 2.1.3
- on-finished: 2.4.1
+ on-finished: 2.4.2
range-parser: 1.3.0
statuses: 2.0.2
transitivePeerDependencies:
@@ -2534,7 +2574,7 @@ snapshots:
setprototypeof@1.2.0: {}
- sharp@0.35.5(@types/node@26.6.4):
+ sharp@0.35.5(@types/node@26.6.5):
dependencies:
'@img/colour': 1.1.0
detect-libc: 2.1.2
@@ -2565,7 +2605,7 @@ snapshots:
'@img/sharp-win32-arm64': 0.35.5
'@img/sharp-win32-ia32': 0.35.5
'@img/sharp-win32-x64': 0.35.5
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
shebang-command@2.0.0:
dependencies:
@@ -2646,14 +2686,14 @@ snapshots:
tree-kill@1.2.2: {}
- ts-node@10.9.2(@types/node@26.6.4)(typescript@6.0.3):
+ ts-node@10.9.2(@types/node@26.6.5)(typescript@6.0.3):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.13
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
- '@types/node': 26.6.4
+ '@types/node': 26.6.5
acorn: 8.19.0
acorn-walk: 8.3.5
arg: 4.1.3
@@ -2690,25 +2730,25 @@ snapshots:
vary@1.1.2: {}
- vite-live-preview@0.4.0(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)):
+ vite-live-preview@0.4.0(vite@8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)):
dependencies:
'@seahax/deep-copy': 0.1.0
'@seahax/semaphore': 0.5.1
'@types/ws': 8.18.2
escape-goat: 4.0.0
strip-ansi: 7.2.0
- vite: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)
+ vite: 8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)
ws: 8.22.0
transitivePeerDependencies:
- bufferutil
- utf-8-validate
- vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15):
+ vite@8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15):
dependencies:
lightningcss: 1.33.0
picomatch: 4.0.7
- postcss: 8.5.29
- rolldown: 1.2.12
+ postcss: 8.5.32
+ rolldown: 1.2.15
tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 26.6.4
@@ -2745,4 +2785,4 @@ snapshots:
yn@3.1.1: {}
- zod@4.6.5: {}
+ zod@4.6.7: {}
diff --git a/mcp/pnpm-workspace.yaml b/mcp/pnpm-workspace.yaml
index 3da100dca6..6e1adb0a9f 100644
--- a/mcp/pnpm-workspace.yaml
+++ b/mcp/pnpm-workspace.yaml
@@ -14,11 +14,14 @@ minimumReleaseAgeExclude:
- fast-uri@3.1.3 || 3.1.4 || 3.1.5
- ip-address@10.2.1 || 10.2.2 || 10.3.1
- hono@4.12.34
+ - "@penpot/plugin-styles@1.6.0"
+ - "@penpot/plugin-types@1.6.0"
packages:
- "packages/common"
- "packages/server"
- "packages/plugin"
+ - "packages/browser-extension"
overrides:
'@hono/node-server@<2.0.5': ^2.0.5
diff --git a/mcp/scripts/build b/mcp/scripts/build
index 3e5337fda2..671091ac9f 100755
--- a/mcp/scripts/build
+++ b/mcp/scripts/build
@@ -21,7 +21,7 @@ set +e
set -e
popd
-pnpm -r --filter "!mcp-plugin" install;
+pnpm -r --filter "!mcp-plugin" --filter "!mcp-browser-extension" install;
pnpm -r --filter "mcp-server" run build;
rsync -avr packages/server/dist/ ./dist/;
diff --git a/mcp/scripts/start-mcp-devenv-oauth b/mcp/scripts/start-mcp-devenv-oauth
new file mode 100755
index 0000000000..230dbf4029
--- /dev/null
+++ b/mcp/scripts/start-mcp-devenv-oauth
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# This starts the MCP server in multi-user mode with OAuth enabled, for
+# testing OAuth in the Penpot development environment (assuming devenv).
+# Agentic tooling expects the single-user server from start-mcp-devenv.
+
+set -e
+
+if [ -z "$PENPOT_PUBLIC_URI" ]; then
+ echo "PENPOT_PUBLIC_URI is not set; run this inside the devenv container." >&2
+ exit 1
+fi
+
+PENPOT_MCP_AUTH_URI="${PENPOT_PUBLIC_URI%/}/api/mcp/oauth"
+
+echo "OAuth authorization URI: $PENPOT_MCP_AUTH_URI"
+echo "MCP endpoint for clients: ${PENPOT_PUBLIC_URI%/}/mcp/stream"
+
+PENPOT_MCP_SERVER_HOST=0.0.0.0 PENPOT_MCP_REMOTE_MODE=true PENPOT_MCP_AUTH_URI="$PENPOT_MCP_AUTH_URI" pnpm run bootstrap:multi-user
diff --git a/media-processor/package.json b/media-processor/package.json
index 4a79f0ae66..aa7b3f7449 100644
--- a/media-processor/package.json
+++ b/media-processor/package.json
@@ -14,7 +14,7 @@
"fmt:check": "prettier --check src/ test/",
"clean": "rm -rf dist/"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"dependencies": {
"express": "^5.2.1",
"multer": "^2.4.0",
diff --git a/media-processor/pnpm-lock.yaml b/media-processor/pnpm-lock.yaml
index 147a963c3e..e5c4f4debe 100644
--- a/media-processor/pnpm-lock.yaml
+++ b/media-processor/pnpm-lock.yaml
@@ -7,153 +7,153 @@ importers:
configDependencies: {}
packageManagerDependencies:
pnpm:
- specifier: 12.15.0
- version: 12.15.0
+ specifier: 12.18.0
+ version: 12.18.0
packages:
- '@pnpm/exe.android-arm64@12.15.0':
- resolution: {integrity: sha512-eVCqmscY70LGvgRzu3mi8IBWBFGix+a6mNZoWmXxESsBdeiKEF9xQSuaeel10yn+zI7TXy2jlI63vFLzETk+aQ==}
+ '@pnpm/exe.android-arm64@12.18.0':
+ resolution: {integrity: sha512-fOF6IwgvnUKEmVedGqiAsNPfN2Ry8GvaqzSQOiF3RJFbpBfPKO/6YT54s1GjToyYinRxw9preHHPe4y2N3SzhA==}
cpu: [arm64]
os: [android]
- '@pnpm/exe.android-x64@12.15.0':
- resolution: {integrity: sha512-Gx/WbkFcdUFUg8g8AShezcS9EiQxfYvdAm2hfKLO8sfJmJvKOCt5fzlgHWDzmGhoclibgW+tUGZ/KF4F4wOTCA==}
+ '@pnpm/exe.android-x64@12.18.0':
+ resolution: {integrity: sha512-6OiolnaCsB3/GcJ9XNrenbUH3zFHRJ+5QynrMUUEyThbgnnCzWxa199hpQlOmxN4rAXuYQ0IYgWFNUZxyzg31Q==}
cpu: [x64]
os: [android]
- '@pnpm/exe.darwin-arm64@12.15.0':
- resolution: {integrity: sha512-N0ZykiDWCvqSBJvt71j7cSoBR993FqvYZFtmpCtqvW3pguiI+NAgraLPA5OTwu5mV+/d8hYpVcPktJA3xFDLtA==}
+ '@pnpm/exe.darwin-arm64@12.18.0':
+ resolution: {integrity: sha512-zkq+4YzVIX39ETYLyC3W7LY7MpHEU/J3nRhHl4i2yPld2Cf2+rEKRh3ejJ4AmaQ77HHJLCktY4Z3jq0fpcxFXg==}
cpu: [arm64]
os: [darwin]
- '@pnpm/exe.darwin-x64@12.15.0':
- resolution: {integrity: sha512-7Ntr2HlBUxzwWOg7NwDxCbRW/3vXuqKO+hcXm+w3SBi9rrHY53li1wLqWVT7Gjxd+lVEHM1QJZo6WJEGFU8C6A==}
+ '@pnpm/exe.darwin-x64@12.18.0':
+ resolution: {integrity: sha512-qMsL9qx92unOTa6hgkfiTJv8ceZaTx0IQg7InhYDVX2ZrTECujaVEEVypnJK5m3eGUsP1KD7Y4qIgleCwfRsYw==}
cpu: [x64]
os: [darwin]
- '@pnpm/exe.freebsd-x64@12.15.0':
- resolution: {integrity: sha512-btOiyL7fL7W4uQGH0aqFai2TNC3IoKcZ7gNHBVbEFZt2dWrnrD0SufL3iGs3fLlmb4OtuU35uf4Zpr9V9Jh9mA==}
+ '@pnpm/exe.freebsd-x64@12.18.0':
+ resolution: {integrity: sha512-/9vy/4ms52cU4MjZ5NhHd6N2d9L9W0kARf5/ff2tweAHu0VeUzs/0qp/7ZHFuddm2Wa/m0AKQoPum9AVUCqKsw==}
cpu: [x64]
os: [freebsd]
- '@pnpm/exe.linux-arm64-musl@12.15.0':
- resolution: {integrity: sha512-pNC38k+O+90FOjbPNSnw0E7apq1PKTmz3fFe1amn+lys/U5kL++uzir8bRiho8ONcyA3d9EU7wdqcY0DKkj+JA==}
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
+ resolution: {integrity: sha512-Vp+TIMPPyackVCXkOdEKH/RmAn/r07EcIyrgZYQK7VrkksqZOie0GnWIx+85mPqeFEYCRtXIZAFJ9L4ceTndDg==}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-arm64@12.15.0':
- resolution: {integrity: sha512-qML/8aCXslh8td/w4U+HJNqUcZ2+m6EfTbWScIzZRmyPsRFN+xB4LP1U/hymxc1iSJiKtG56HJx2fvUErWFIGw==}
+ '@pnpm/exe.linux-arm64@12.18.0':
+ resolution: {integrity: sha512-2dpyVBCHT+FfpuQh9i+7MXAqNWYLCvD5vYr5p6Eimxoga8USLnjbUgyj72AOrO0hjc5ri3TEFP3jiyBHjkSZpQ==}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-ppc64@12.15.0':
- resolution: {integrity: sha512-tjRDUUl7RCJ6T/6eoNPxOqkwU4Mzi5RtTXmSAxujyz37OTwwsMU7Ps087Zk4gHcUvRSeyF40ZFsew3vtE+nmUA==}
+ '@pnpm/exe.linux-ppc64@12.18.0':
+ resolution: {integrity: sha512-BBOOOfNJ2QwIIya3eKqOjiN4WNTszfRz7HCvw9XggcT7+ftMjNP8XJ/GfW+ltCBeUFR9d8WBVsr2m/NLjX2CZQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-riscv64@12.15.0':
- resolution: {integrity: sha512-bF1uBWEfbwaeryz6lIiaJ8AWD082otZfvzGX5l+6LZRpRwUEpJHUsJrORaYP5/cNMv5ZR2p6TvvcJcQzwtDzmw==}
+ '@pnpm/exe.linux-riscv64@12.18.0':
+ resolution: {integrity: sha512-7kMN77xSOYJX8GPSH5RbNAc5oM61LMmcSUukDDUwllnZPXm8GRPskCNsTWy8SCw01Kr1FB+5SwGNMiTdiziLNQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-s390x@12.15.0':
- resolution: {integrity: sha512-zKMhIzsexYMToeLmqV5jPsvV/f9vwsJb2kUH2NFYzalbxImeBrlA4kL7GwF8gD4pagV6jYYcJb8RjbZIdjHptg==}
+ '@pnpm/exe.linux-s390x@12.18.0':
+ resolution: {integrity: sha512-htuSCpEcmDzhKoJqXbPkvfr176dBHU0QIF5mWcRiqxRXAB/1JoYiMYotfjWpk+ztgpB9qlx4XnWlLFAf7gzc6g==}
cpu: [s390x]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-x64-musl@12.15.0':
- resolution: {integrity: sha512-A9J0Jg0Rdx+qQU4qXtwyST5tto9IOu1zi4fDk35nbc6DWahggbcKtFvZPKFwL2qgUXGXOX//hXv6z/sp6emO8A==}
+ '@pnpm/exe.linux-x64-musl@12.18.0':
+ resolution: {integrity: sha512-Uj+vzfIQ62kDP10x36yHZIXVs5ohdNtiPYwn5FhCLlNScHPo0OAI+ShGDtLofiBXKE7umu71Jmjm7N8a8zVcDw==}
cpu: [x64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-x64@12.15.0':
- resolution: {integrity: sha512-yc+QlZR+9+nr29J4fRzhMoapgxTBDndq/+peyoq1XUufnQFnfbXUMFudDIKzHi545linGqmOmXfn0NoufNgcOg==}
+ '@pnpm/exe.linux-x64@12.18.0':
+ resolution: {integrity: sha512-OJ+X2wcraldCwj75pCIerWARQSRpdfj0eBTs/2ODyhfeW46ylOnjTIE/GKra6Mn6E72/gBmXS8igrUioa+F9fQ==}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.win32-arm64@12.15.0':
- resolution: {integrity: sha512-fPXZxuY1VclkOga9bc53qNCXcegfeoBR8+Ue+AospDwKzuGGSHll0oDxkLfkmpjyRqpe7bH5DyQPYp/xSMaIVA==}
+ '@pnpm/exe.win32-arm64@12.18.0':
+ resolution: {integrity: sha512-wEY6jiACGcbhhi5yD59doHqNTndS7AaujaPmtWAu1DKkHru2hy5fJ9yUGecW72Ypaw2/I3BEprfMOopap2NQtw==}
cpu: [arm64]
os: [win32]
- '@pnpm/exe.win32-x64@12.15.0':
- resolution: {integrity: sha512-nrd+Tp1We1DGj4DGG5Bea9lZNh9y1PjlLBdEwdInS4D0h0UIDtM7JaGGGDJhNzIwcHASyihWI7HLV+dtG+fhYg==}
+ '@pnpm/exe.win32-x64@12.18.0':
+ resolution: {integrity: sha512-5FJkghO7RLRkQpWxeVEygW9XsmnNuxzPfXbgwFWCHsFyFhpDn/vOdL88ToQEM0Kt5igdW5s6U0/IDH8Dvkt3pg==}
cpu: [x64]
os: [win32]
- pnpm@12.15.0:
- resolution: {integrity: sha512-s5UdbW/0qfE9x89WzSjSuOs328ycaOUuHhGRhz6p+CoBcoerULqtxczElPA2xnwOR+sTYIwvo29HcRth6hKOYQ==}
+ pnpm@12.18.0:
+ resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==}
engines: {node: '>=18'}
hasBin: true
snapshots:
- '@pnpm/exe.android-arm64@12.15.0':
+ '@pnpm/exe.android-arm64@12.18.0':
optional: true
- '@pnpm/exe.android-x64@12.15.0':
+ '@pnpm/exe.android-x64@12.18.0':
optional: true
- '@pnpm/exe.darwin-arm64@12.15.0':
+ '@pnpm/exe.darwin-arm64@12.18.0':
optional: true
- '@pnpm/exe.darwin-x64@12.15.0':
+ '@pnpm/exe.darwin-x64@12.18.0':
optional: true
- '@pnpm/exe.freebsd-x64@12.15.0':
+ '@pnpm/exe.freebsd-x64@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64-musl@12.15.0':
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64@12.15.0':
+ '@pnpm/exe.linux-arm64@12.18.0':
optional: true
- '@pnpm/exe.linux-ppc64@12.15.0':
+ '@pnpm/exe.linux-ppc64@12.18.0':
optional: true
- '@pnpm/exe.linux-riscv64@12.15.0':
+ '@pnpm/exe.linux-riscv64@12.18.0':
optional: true
- '@pnpm/exe.linux-s390x@12.15.0':
+ '@pnpm/exe.linux-s390x@12.18.0':
optional: true
- '@pnpm/exe.linux-x64-musl@12.15.0':
+ '@pnpm/exe.linux-x64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-x64@12.15.0':
+ '@pnpm/exe.linux-x64@12.18.0':
optional: true
- '@pnpm/exe.win32-arm64@12.15.0':
+ '@pnpm/exe.win32-arm64@12.18.0':
optional: true
- '@pnpm/exe.win32-x64@12.15.0':
+ '@pnpm/exe.win32-x64@12.18.0':
optional: true
- pnpm@12.15.0:
+ pnpm@12.18.0:
optionalDependencies:
- '@pnpm/exe.android-arm64': 12.15.0
- '@pnpm/exe.android-x64': 12.15.0
- '@pnpm/exe.darwin-arm64': 12.15.0
- '@pnpm/exe.darwin-x64': 12.15.0
- '@pnpm/exe.freebsd-x64': 12.15.0
- '@pnpm/exe.linux-arm64': 12.15.0
- '@pnpm/exe.linux-arm64-musl': 12.15.0
- '@pnpm/exe.linux-ppc64': 12.15.0
- '@pnpm/exe.linux-riscv64': 12.15.0
- '@pnpm/exe.linux-s390x': 12.15.0
- '@pnpm/exe.linux-x64': 12.15.0
- '@pnpm/exe.linux-x64-musl': 12.15.0
- '@pnpm/exe.win32-arm64': 12.15.0
- '@pnpm/exe.win32-x64': 12.15.0
+ '@pnpm/exe.android-arm64': 12.18.0
+ '@pnpm/exe.android-x64': 12.18.0
+ '@pnpm/exe.darwin-arm64': 12.18.0
+ '@pnpm/exe.darwin-x64': 12.18.0
+ '@pnpm/exe.freebsd-x64': 12.18.0
+ '@pnpm/exe.linux-arm64': 12.18.0
+ '@pnpm/exe.linux-arm64-musl': 12.18.0
+ '@pnpm/exe.linux-ppc64': 12.18.0
+ '@pnpm/exe.linux-riscv64': 12.18.0
+ '@pnpm/exe.linux-s390x': 12.18.0
+ '@pnpm/exe.linux-x64': 12.18.0
+ '@pnpm/exe.linux-x64-musl': 12.18.0
+ '@pnpm/exe.win32-arm64': 12.18.0
+ '@pnpm/exe.win32-x64': 12.18.0
---
lockfileVersion: '9.0'
diff --git a/operations/2.19.0-migrate-legacy-file-data.md b/operations/2.19.0-migrate-legacy-file-data.md
new file mode 100644
index 0000000000..df3c82d917
--- /dev/null
+++ b/operations/2.19.0-migrate-legacy-file-data.md
@@ -0,0 +1,323 @@
+# Migrate legacy file payloads to `file_data`
+
+Online procedure to move the legacy file payloads (`file.data` and labelled
+`file_change.data`) to `file_data` and to delete the orphan `file_change`
+rows that carry `data` without a `label`.
+
+- Migration: `backend/src/app/migrations/sql/0157-migrate-legacy-file-data.sql`
+- Issue:
+
+The result has to be **exactly** the end state of the migration, because on a
+big instance the migration is marked as applied and never runs. This procedure
+runs the same statements by hand, in small batched transactions.
+
+Use this only if the automatic migration would take too long on the instance
+(millions of snapshots, hundreds of GB in TOAST). Small and medium instances
+run the migration automatically on boot and need nothing from here.
+
+Run it before upgrading to 2.19.0.
+
+## What changes
+
+- Every `file_change` row with `data IS NOT NULL AND label IS NOT NULL`
+ (a snapshot) gets a `file_data` row with `type='snapshot'`,
+ `backend='db'`, `metadata=NULL`, `created_at` from `created_at`,
+ `modified_at` from `updated_at`, and `deleted_at` copied as is. Then the
+ legacy `file_change.data` is set to `NULL`.
+- Every `file` row with `data IS NOT NULL` gets a `file_data` row with
+ `type='main'` (and `file_id = id`), the same `backend`/`metadata` mapping
+ and the timestamps copied one to one. Then the legacy `file.data` is set
+ to `NULL`.
+- Every `file_change` row with `data IS NOT NULL AND label IS NULL` (an
+ orphan revision) is deleted outright. No read path reaches these rows:
+ snapshots resolve through `label IS NOT NULL`, lagged changes read the
+ `changes` column (not `data`), and nothing references `file_change` rows
+ from other tables. Rows carrying `deleted_at` would be collected by
+ `objects-gc` anyway; undated ones would sit in the table and its TOAST
+ for ever.
+
+`deleted_at` is copied on purpose: the write path always writes it to
+`file_data`, the GC only collects `file_data` rows carrying it, and reads
+never filter on `file_data.deleted_at`. Without the copy, migrated rows of
+deleted files and snapshots would be orphaned: nobody reads them and nobody
+collects them.
+
+## Why this mechanism
+
+A single-statement copy inside the transaction of the startup does not fit a
+big instance, so the copy runs here in small batched transactions:
+
+- One statement is one transaction. Never wrap several batches in one
+ transaction. Run a single stream of batches at a time.
+- `FOR UPDATE SKIP LOCKED`: the batches never block the application and are
+ never blocked by it. A row skipped by a lock stays in the index and the
+ next execution picks it up.
+- Partial temp indexes hold only the pending rows, so every execution finds
+ its next batch without rescanning what is done, and migrated rows
+ (`data = NULL`) and deleted orphans drop out of the index on their own.
+ No cursor is needed. Do not `VACUUM` mid-run to clean them: it would walk
+ the whole TOAST. Drop them at the end.
+- No `ON CONFLICT DO NOTHING` here on purpose: a duplicate key must abort
+ the batch (atomically: it migrates nothing) so the conflict is
+ investigated instead of silently skipped. The automatic migration is
+ lenient so a small instance never fails to boot; here strictness is what
+ keeps the data auditable.
+
+---
+
+## Phase 0 — Before anything
+
+### 0.1 Mark the migration as applied
+
+Do this first: it registers the automatic migration as done, so a backend
+restart mid-procedure never runs it on boot (it would copy the whole legacy
+payload inside the startup transaction).
+
+```sql
+INSERT INTO migrations (module, step)
+VALUES ('main', '0157-migrate-legacy-file-data');
+```
+
+The module is `main` and the step has no `.sql` (see
+`backend/src/app/util/migrations.clj`).
+
+### 0.2 Counters
+
+Repeat the counters any time to follow the progress. Each batch loop ends
+when it returns 0; the check in phase 3 confirms nothing is pending.
+
+```sql
+-- Remaining legacy rows.
+SELECT (SELECT count(*) FROM file_change
+ WHERE data IS NOT NULL AND label IS NOT NULL) AS snapshots_remaining,
+ (SELECT count(*) FROM file_change
+ WHERE data IS NOT NULL AND label IS NULL) AS orphans_remaining,
+ (SELECT count(*) FROM file
+ WHERE data IS NOT NULL) AS files_remaining;
+```
+
+Optional, reference only: how much is already migrated. Skip it unless
+curious: it is a full count over the partitioned table and can take a
+while on a big instance. For progress, the remaining counters above and
+the per-batch counts are enough.
+
+```sql
+SELECT (SELECT count(*) FROM file_data
+ WHERE type = 'snapshot' AND backend = 'db') AS snapshots_in_file_data,
+ (SELECT count(*) FROM file_data
+ WHERE type = 'main' AND backend = 'db') AS mains_in_file_data;
+```
+
+## Phase 1 — Temp indexes
+
+Required by the batch loops, created before them. `CONCURRENTLY` so writes
+are not blocked; each statement is its own transaction.
+
+```sql
+CREATE INDEX CONCURRENTLY tmp_file_change_mig ON file_change (id)
+ WHERE data IS NOT NULL AND label IS NOT NULL;
+CREATE INDEX CONCURRENTLY tmp_file_change_orphan_mig ON file_change (id)
+ WHERE data IS NOT NULL AND label IS NULL;
+CREATE INDEX CONCURRENTLY tmp_file_mig ON file (id)
+ WHERE data IS NOT NULL;
+```
+
+A failed `CONCURRENTLY` build stays `INVALID` and the planner ignores it
+silently, so verify all three indexes exist and are valid:
+
+```sql
+SELECT indexrelid::regclass AS index, indisvalid AS valid
+ FROM pg_index
+ WHERE indexrelid::regclass::text LIKE 'tmp_%mig';
+```
+
+## Phase 2 — Batch loops
+
+Repeat each statement until it returns 0. Lower `LIMIT` if a batch hits
+`statement_timeout` or memory pressure (`SET statement_timeout = '15min'`
+per batch is the usual guard).
+
+### 2.1 Delete orphans
+
+Orphans first (or interleaved with the other two; the row sets are
+disjoint, and deleting TOAST-heavy rows early frees space for the rest):
+
+```sql
+WITH doomed AS (
+ SELECT id
+ FROM file_change
+ WHERE data IS NOT NULL
+ AND label IS NULL
+ ORDER BY id
+ LIMIT 10000
+ FOR UPDATE SKIP LOCKED
+),
+del AS (
+ DELETE FROM file_change fc
+ USING doomed
+ WHERE fc.id = doomed.id
+ RETURNING fc.id
+)
+SELECT count(*) AS deleted
+ FROM del;
+```
+
+### 2.2 Migrate snapshots
+
+Repeat until it returns 0 (`~120 MB` per transaction at `LIMIT 10000`):
+
+```sql
+WITH batch AS (
+ SELECT id, file_id, data, created_at, updated_at, deleted_at
+ FROM file_change
+ WHERE data IS NOT NULL
+ AND label IS NOT NULL
+ ORDER BY id
+ LIMIT 10000
+ FOR UPDATE SKIP LOCKED
+),
+-- NO ON CONFLICT on purpose: duplicates must abort (see above).
+-- upd reads from ins (RETURNING), not from batch.
+ins AS (
+ INSERT INTO file_data (file_id, id, created_at, modified_at, deleted_at,
+ type, backend, metadata, data)
+ SELECT file_id, id, created_at, updated_at, deleted_at,
+ 'snapshot', 'db', NULL, data
+ FROM batch
+ RETURNING file_id, id
+),
+-- Only the origin of what was really inserted is nulled. On conflict
+-- the whole transaction aborts, so ins == batch whenever this runs.
+upd AS (
+ UPDATE file_change fc
+ SET data = NULL
+ FROM ins
+ WHERE ins.file_id = fc.file_id
+ AND ins.id = fc.id
+ RETURNING fc.id
+)
+SELECT count(*) AS migrated
+ FROM upd;
+```
+
+### 2.3 Migrate files
+
+Repeat until it returns 0 (tune `LIMIT` to the average `file.data` size;
+start at 5000):
+
+```sql
+WITH batch AS (
+ SELECT id, data, created_at, modified_at, deleted_at
+ FROM file
+ WHERE data IS NOT NULL
+ ORDER BY id
+ LIMIT 5000
+ FOR UPDATE SKIP LOCKED
+),
+ins AS (
+ INSERT INTO file_data (file_id, id, created_at, modified_at, deleted_at,
+ type, backend, metadata, data)
+ SELECT id, id, created_at, modified_at, deleted_at,
+ 'main', 'db', NULL, data
+ FROM batch
+ RETURNING file_id, id
+),
+upd AS (
+ UPDATE file f
+ SET data = NULL
+ FROM ins
+ WHERE ins.file_id = f.id
+ AND ins.id = f.id
+ RETURNING f.id
+)
+SELECT count(*) AS migrated
+ FROM upd;
+```
+
+### 2.4 Duplicate keys
+
+If a batch aborts on duplicate key, stop and do not blind-retry it: it
+means `file_data` already holds that key. Locate the overlap:
+
+```sql
+-- Snapshots with legacy data AND a file_data key already present.
+SELECT c.file_id, c.id, c.created_by, c.deleted_at,
+ pg_size_pretty(length(c.data)) AS legacy_size,
+ pg_size_pretty(length(fd.data)) AS file_data_size,
+ fd.modified_at AS file_data_modified_at
+ FROM file_change c
+ JOIN file_data fd ON fd.file_id = c.file_id
+ AND fd.id = c.id
+ AND fd.type = 'snapshot'
+ WHERE c.data IS NOT NULL
+ ORDER BY c.id
+ LIMIT 20;
+
+-- Files with legacy data AND a file_data key already present.
+SELECT f.id,
+ pg_size_pretty(length(f.data)) AS legacy_size,
+ pg_size_pretty(length(fd.data)) AS file_data_size,
+ fd.modified_at AS file_data_modified_at
+ FROM file f
+ JOIN file_data fd ON fd.file_id = f.id
+ AND fd.id = f.id
+ AND fd.type = 'main'
+ WHERE f.data IS NOT NULL
+ ORDER BY f.id
+ LIMIT 20;
+```
+
+Resolve manually, one row at a time, only when `file_data` holds equal or
+newer data (compare `modified_at` and sizes above): the legacy copy is
+redundant, null the origin, leave `file_data` untouched.
+
+```sql
+-- UPDATE file_change SET data = NULL WHERE file_id = '...' AND id = '...';
+-- UPDATE file SET data = NULL WHERE id = '...';
+```
+
+## Phase 3 — Verification and cleanup
+
+Each loop above already ended returning 0; confirm nothing is pending (if
+anything shows up, repeat that loop):
+
+```sql
+-- Remaining legacy rows: all three must read 0.
+SELECT (SELECT count(*) FROM file_change
+ WHERE data IS NOT NULL AND label IS NOT NULL) AS snapshots_remaining,
+ (SELECT count(*) FROM file_change
+ WHERE data IS NOT NULL AND label IS NULL) AS orphans_remaining,
+ (SELECT count(*) FROM file
+ WHERE data IS NOT NULL) AS files_remaining;
+```
+
+```sql
+-- Spot check: migrated rows exist in file_data with backend 'db'.
+SELECT fd.file_id, fd.id, fd.type, fd.backend,
+ pg_size_pretty(length(fd.data)) AS size_in_file_data
+ FROM file_data fd
+ ORDER BY fd.file_id, fd.id
+ LIMIT 5;
+```
+
+Drop the temp indexes first, so the vacuum below skips them (each batch
+left its dead entries behind), then reclaim the dead tuples and refresh
+planner stats. Plain `VACUUM` does not block writes; `VERBOSE` prints
+progress, which matters on big tables:
+
+```sql
+DROP INDEX CONCURRENTLY tmp_file_change_mig;
+DROP INDEX CONCURRENTLY tmp_file_change_orphan_mig;
+DROP INDEX CONCURRENTLY tmp_file_mig;
+VACUUM (ANALYZE ON, VERBOSE ON) file_change;
+VACUUM (ANALYZE ON, VERBOSE ON) file;
+-- file_data is partitioned into 16 tables: the statement walks all of
+-- them, so it can take a while. Without it the planner stats of the fresh
+-- inserts stay stale until autovacuum catches up.
+VACUUM (ANALYZE ON, VERBOSE ON) file_data;
+```
+
+## Phase 4 — Upgrade
+
+The migration was marked as applied in phase 0, so the new version skips
+it on boot. Deploy normally.
diff --git a/package.json b/package.json
index 05df2e97cd..a27aad2cc9 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"license": "MPL-2.0",
"author": "Kaleidos INC Sucursal en España SL",
"private": true,
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"repository": {
"type": "git",
"url": "https://github.com/penpot/penpot"
diff --git a/plugins/CHANGELOG.md b/plugins/CHANGELOG.md
index f74e320625..5a6b8cd350 100644
--- a/plugins/CHANGELOG.md
+++ b/plugins/CHANGELOG.md
@@ -1,22 +1,26 @@
-## 1.6.0 (Unreleased)
+## 1.6.0 (2026-11-10)
### 🚀 Features
- **plugin-types, plugins-runtime:** `penpotMgmt` returns `Team`, `Project` and `ProjectFile` objects. Assigning `name` renames teams, projects and files, `project.pinned` pins a project and `file.shared` shares a file as a team library; `createProject`, `createFile`, `moveTo`, `duplicate`, `remove` and `restore` live on the objects. Added `penpotMgmt.listTeams`, `penpotMgmt.createTeam`, `penpotMgmt.getFile`, `listDeletedProjects` and `listDeletedFiles`, and the `manage:projects`, `manage:teams` and `manage:delete` permissions. Restoration uses the dashboard's Trash operation; projects need recoverable files and empty projects cannot be restored; the API exposes no permanent deletion method. Team deletion is not exposed.
- **plugins-runtime, plugin-types**: Added global plugins (`scope: "global"`) that remain active across dashboard and workspace navigation until closed or logged out, with `penpotMgmt` for project and file discovery, file navigation and workspace events. Global scope adds the `allow:global` permission, which users must accept when installing the plugin.
-- **plugin-types:** Added `LibraryComponent.restore()` to restore a deleted component and its main instance without changing the current page, selection, zoom, or viewport. Requires `library:write` permission.
+- **plugin-types:** Added `LibraryComponent.restore()` to restore a deleted component and its main instance without changing the current page, selection, zoom, or viewport. Requires `library:write` permission and only applies to the current file's library.
- **plugin-types:** Added `Shape.updateMain()`, `LibraryComponent.duplicate()`, writable component `annotation`, and `Library.deletedComponents`. Declared the existing `LibraryComponent.remove()` method.
- **plugin-types:** Added `LibraryContext.tokensSource` to read or set the current file's token source to a connected library, or restore local tokens.
- **plugin-types:** Added `paddingType` (`'simple' | 'multiple'`) to flex and grid layouts and `marginType` (`'simple' | 'multiple'`) to layout children, exposing whether the four padding/margin sides are mirrored or honoured independently.
- **plugin-types**: Added `waitForLayoutUpdate` to wait until pending layout updates have finished. It rejects when the optional timeout elapses, defaulting to 30 seconds so a wait never hangs.
- **plugin-types**: Added `waitForLayoutUpdate` to the `Shape` interface to wait until the pending layout updates of a shape and its children have finished
+- **plugin-types:** Added the `contentrollback` event and the `ContentRollback` type. The event fires after the backend rejected some changes and the workspace undid them, with the ids of the files, pages and shapes affected. It fires once the undone data is in the workspace, also when the workspace has to reload the file to undo the changes.
- **plugin-types:** `Stroke` exposes per-side widths for boards and rectangles, also supported by `borderWidth` and `dimension` tokens. Read-only `strokeWidthType` reports `simple` when all four effective widths match, otherwise `multiple`.
### 🩹 Fixes
+- **plugin-runtime:** `LibraryComponent.instance()`, `createShapeFromSvg()` and `createShapeFromSvgWithImages()` now create shapes at the page root instead of inside a board at the page origin. Closes #12086.
- **plugin-types, plugin-runtime:** Dashboard property setters now update values after backend success and log failures without interrupting the workspace. File moves reject projects in other teams, backend rejections include their type and code, and `project.fileCount` stays at its listing snapshot. Duplicated projects include their file count and pinned state.
- **plugin-runtime:** Cancel plugin loads before they execute after unloading or logout, and allow reopening plugins that close during startup.
- **plugins-runtime**: `library.connectLibrary()` now resolves once the library's assets are loaded; it used to resolve with an empty library the first time. `library.connected` and `library.availableLibraries()` ignore files opened earlier in the same tab, which used to show up as connected and be left out of the available libraries.
+- **plugins-runtime:** Writes now fail with an error while the workspace cannot take them (saves failing, a user who cannot edit, a version preview, a canvas that stopped rendering), whatever the `throwValidationErrors` flag. They used to change the workspace with edits that would never be saved. The error says why. The Inspect tab does not block writes, and undo blocks still open and close.
+- **plugins-runtime:** Writes that wait for the server (`createShapeFromSvgWithImages`, `uploadMediaData`, `uploadMediaUrl`, `connectLibrary`) check again when the server answers. If the workspace turned read-only meanwhile (a save failed), the promise rejects with the read-only error: no shape is added and no library is linked. An image the server already stored stays in the file's media, unused.
- **plugins-runtime:** `LibraryComponent.remove()` now rejects linked-library and missing component handles, and does nothing for an already deleted component.
- **plugins-runtime**: An interaction obtained from `Shape.interactions` now keeps addressing that interaction instead of the position it held when the array was read. Removing every interaction of a shape from a single read removes all of them rather than leaving some behind, and writing through a held interaction after an earlier one is removed no longer lands on a different interaction.
- **plugins-runtime**: `Shape.removeInteraction()` now rejects an interaction belonging to a different shape with a validation error, instead of removing whichever interaction sat at the same position on the target shape.
diff --git a/plugins/apps/colors-to-tokens-plugin/package.json b/plugins/apps/colors-to-tokens-plugin/package.json
index a762e7494c..cfed5c5f6b 100644
--- a/plugins/apps/colors-to-tokens-plugin/package.json
+++ b/plugins/apps/colors-to-tokens-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build colors-to-tokens-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build colors-to-tokens-plugin",
"build:dev": "ng build colors-to-tokens-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=colors-to-tokens-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=colors-to-tokens-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/composable-test-suite/ci/run-ci.ts b/plugins/apps/composable-test-suite/ci/run-ci.ts
index d9403c6793..69186e9436 100644
--- a/plugins/apps/composable-test-suite/ci/run-ci.ts
+++ b/plugins/apps/composable-test-suite/ci/run-ci.ts
@@ -146,7 +146,7 @@ async function setupMockedRoutes(page: Page): Promise {
route.fulfill({
status: 200,
contentType: "application/javascript",
- body: 'var penpotFlags = "";\n',
+ body: 'var penpotFlags = "disable-admin-console";\n',
})
);
diff --git a/plugins/apps/composable-test-suite/package.json b/plugins/apps/composable-test-suite/package.json
index 1f21539f19..81261c19e9 100644
--- a/plugins/apps/composable-test-suite/package.json
+++ b/plugins/apps/composable-test-suite/package.json
@@ -27,5 +27,5 @@
"vite": "^8.3.2",
"vite-live-preview": "^0.4.0"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/composable-test-suite/src/composable-tests/cases.ts b/plugins/apps/composable-test-suite/src/composable-tests/cases.ts
index e9150ec16c..793903e15d 100644
--- a/plugins/apps/composable-test-suite/src/composable-tests/cases.ts
+++ b/plugins/apps/composable-test-suite/src/composable-tests/cases.ts
@@ -5,6 +5,7 @@ import { createTestCaseRemoteMainCopySyncNested } from "./cases/caseRemoteMainCo
import { createTestCaseVariantSwitchPropagates } from "./cases/caseVariantSwitchPropagates.ts";
import { createTestCaseCopySubheadDeletePreservesSlots } from "./cases/caseCopySubheadDeletePreservesSlots.ts";
import { createTestCaseMainReorderKeepsCopySlots } from "./cases/caseMainReorderKeepsCopySlots.ts";
+import { createTestCaseMainChildMovedOutLeavesCopy } from "./cases/caseMainChildMovedOutLeavesCopy.ts";
/**
* All composable test cases currently defined. A factory (not a constant): each
@@ -19,5 +20,6 @@ export function allCases(): readonly TestCase[] {
createTestCaseVariantSwitchPropagates(),
createTestCaseCopySubheadDeletePreservesSlots(),
createTestCaseMainReorderKeepsCopySlots(),
+ createTestCaseMainChildMovedOutLeavesCopy(),
];
}
diff --git a/plugins/apps/composable-test-suite/src/composable-tests/cases/caseMainChildMovedOutLeavesCopy.ts b/plugins/apps/composable-test-suite/src/composable-tests/cases/caseMainChildMovedOutLeavesCopy.ts
new file mode 100644
index 0000000000..04df9632fd
--- /dev/null
+++ b/plugins/apps/composable-test-suite/src/composable-tests/cases/caseMainChildMovedOutLeavesCopy.ts
@@ -0,0 +1,59 @@
+import { Board } from "@penpot/plugin-types";
+import { TestCase } from "../test-suite/TestCase.ts";
+import { Color } from "../model/Color";
+import { ShapePropFillColor } from "../model/ShapeProp.ts";
+import { Assert } from "../util/Assert.ts";
+import { OpAssert } from "../operations/OpAssert";
+import { OpSequence } from "../operations/OpSequence.ts";
+import { OpOptional } from "../operations/OpOptional.ts";
+import { OpChangeProperty } from "../operations/OpChangeProperty";
+import { OpCreateBoard } from "../operations/OpCreateBoard";
+import { OpCreateSimpleComponentWithCopy } from "../operations/OpCreateSimpleComponentWithCopy";
+import { OpMoveShape } from "../operations/OpMoveShape";
+
+const BASELINE = new Color("#aaaaaa");
+const EDIT_COLOR = new Color("#ff0000");
+
+/**
+ * A shape moved out of a main leaves its copies, also when another edit lands
+ * right after the move, before propagation has run.
+ *
+ * The baseline assertion waits for the setup to settle; the setup's own commits
+ * would otherwise sync the copy in the same pass and hide the result. The move
+ * and the optional edit then run back to back, so their commits arrive together;
+ * without the edit, the move is the last commit.
+ */
+export function createTestCaseMainChildMovedOutLeavesCopy(): TestCase {
+ const foundation = new OpCreateSimpleComponentWithCopy(BASELINE);
+ const { mainChild, copyRoot } = foundation.roles;
+ const outside = new OpCreateBoard("Outside");
+ const outsideBoard = outside.roles.board;
+
+ const move = new OpMoveShape(mainChild, outsideBoard, "main rect", "outside board");
+
+ return new TestCase(
+ "MainChildMovedOutLeavesCopy",
+ "A component containing a single rectangle is created, plus a copy of it and a board " +
+ "outside the component. The main's rectangle is moved into that board, optionally " +
+ "followed at once by a fill change on the board. The copy must lose its rectangle " +
+ "either way.",
+ new OpSequence(
+ foundation,
+ outside,
+ new OpAssert("the copy starts with its rectangle", (s) => {
+ const copyChildren = (s.get(copyRoot) as Board).children;
+ Assert.that(copyChildren.length === 1, `the copy should have one child, found ${copyChildren.length}`);
+ }),
+ move,
+ new OpOptional(new OpChangeProperty(outsideBoard, new ShapePropFillColor(), EDIT_COLOR, "outside board")),
+ new OpAssert("the rectangle left the main and the copy", (s) => {
+ move.assertHasMoved(s, mainChild);
+ const copyChildren = (s.get(copyRoot) as Board).children;
+ Assert.that(
+ copyChildren.length === 0,
+ `the copy should have no children, found ${copyChildren.map((c) => c.name).join(", ")}`
+ );
+ })
+ )
+ );
+}
diff --git a/plugins/apps/composable-test-suite/src/composable-tests/operations/OpCreateBoard.ts b/plugins/apps/composable-test-suite/src/composable-tests/operations/OpCreateBoard.ts
new file mode 100644
index 0000000000..eeb7bb64ff
--- /dev/null
+++ b/plugins/apps/composable-test-suite/src/composable-tests/operations/OpCreateBoard.ts
@@ -0,0 +1,39 @@
+import { Board } from "@penpot/plugin-types";
+import { Operation } from "../core/Operation";
+import { Role } from "../core/Role";
+import { RoleBundle } from "../core/RoleBundle";
+import { Situation } from "../core/Situation";
+
+/** The roles exposed by {@link OpCreateBoard}. */
+class RolesBoard extends RoleBundle {
+ /** The free board the operation created. */
+ readonly board = new Role("board");
+}
+
+/**
+ * Creates a free board on the page, outside any component, and binds it to its
+ * `board` role. Gives a case somewhere to move shapes to, or to edit, apart from
+ * the configuration under test.
+ */
+export class OpCreateBoard extends Operation {
+ readonly roles = new RolesBoard();
+
+ /**
+ * @param boardName - the name given to the new board
+ */
+ constructor(private readonly boardName: string) {
+ super();
+ }
+
+ async applyTo(situation: Situation): Promise {
+ const board = penpot.createBoard();
+ board.name = this.boardName;
+ board.resize(100, 100);
+ situation.applyPosAdvanceX(board);
+ situation.bind(this.roles.board, board);
+ }
+
+ toString(): string {
+ return `create board ${this.boardName}`;
+ }
+}
diff --git a/plugins/apps/composable-test-suite/src/composable-tests/operations/OpMoveShape.ts b/plugins/apps/composable-test-suite/src/composable-tests/operations/OpMoveShape.ts
new file mode 100644
index 0000000000..6795dc121b
--- /dev/null
+++ b/plugins/apps/composable-test-suite/src/composable-tests/operations/OpMoveShape.ts
@@ -0,0 +1,53 @@
+import { Board } from "@penpot/plugin-types";
+import { Operation } from "../core/Operation";
+import { Situation } from "../core/Situation";
+import { ShapeTarget, resolveTarget } from "../core/ShapeTarget";
+import { Assert } from "../util/Assert";
+
+/**
+ * Moves the shape a target resolves to into another parent, via the Plugin API's
+ * `appendChild`. Used to move a shape out of the main of a component, which must
+ * remove the corresponding shape from its copies.
+ */
+export class OpMoveShape extends Operation {
+ /**
+ * @param target - resolves the shape to move (role or situation-derived)
+ * @param newParent - resolves the board that receives the shape
+ * @param targetLabel - a human-readable name for the moved shape, for the log
+ * @param parentLabel - a human-readable name for the new parent, for the log
+ */
+ constructor(
+ private readonly target: ShapeTarget,
+ private readonly newParent: ShapeTarget,
+ private readonly targetLabel: string = String(target),
+ private readonly parentLabel: string = String(newParent)
+ ) {
+ super();
+ }
+
+ async applyTo(situation: Situation): Promise {
+ const shape = resolveTarget(this.target, situation);
+ const parent = resolveTarget(this.newParent, situation) as Board;
+ parent.appendChild(shape);
+ }
+
+ /**
+ * Asserts that the shape `target` resolves to now sits in this operation's
+ * new parent.
+ *
+ * @param situation - the situation to resolve the targets against
+ * @param target - resolves the shape expected to have moved
+ */
+ assertHasMoved(situation: Situation, target: ShapeTarget): void {
+ const shape = resolveTarget(target, situation);
+ const parent = resolveTarget(this.newParent, situation);
+ Assert.that(
+ shape.parent?.id === parent.id,
+ `expected "${shape.name}" inside "${parent.name}" but its parent is "${shape.parent?.name}"`
+ );
+ }
+
+ toString(): string {
+ return `move ${this.targetLabel} into ${this.parentLabel}`;
+ }
+}
diff --git a/plugins/apps/contrast-plugin/package.json b/plugins/apps/contrast-plugin/package.json
index 8402969c20..d773fe0297 100644
--- a/plugins/apps/contrast-plugin/package.json
+++ b/plugins/apps/contrast-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build contrast-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build contrast-plugin",
"build:dev": "ng build contrast-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=contrast-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=contrast-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/create-palette-plugin/package.json b/plugins/apps/create-palette-plugin/package.json
index de963120f4..016063ea11 100644
--- a/plugins/apps/create-palette-plugin/package.json
+++ b/plugins/apps/create-palette-plugin/package.json
@@ -12,5 +12,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/e2e/package.json b/plugins/apps/e2e/package.json
index 97405221de..f432a1e113 100644
--- a/plugins/apps/e2e/package.json
+++ b/plugins/apps/e2e/package.json
@@ -7,5 +7,5 @@
"test": "vitest",
"lint": "eslint ."
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/example-styles/package.json b/plugins/apps/example-styles/package.json
index f1fc7219c9..a30835a099 100644
--- a/plugins/apps/example-styles/package.json
+++ b/plugins/apps/example-styles/package.json
@@ -11,5 +11,5 @@
"serve": "vite preview",
"lint": "eslint ."
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/icons-plugin/package.json b/plugins/apps/icons-plugin/package.json
index 841c979c14..936de38fe3 100644
--- a/plugins/apps/icons-plugin/package.json
+++ b/plugins/apps/icons-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build icons-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build icons-plugin",
"build:dev": "ng build icons-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=icons-plugin",
"build:plugin:watch": "node ../../tools/scripts/build-plugin.mjs --plugin=icons-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/lorem-ipsum-plugin/package.json b/plugins/apps/lorem-ipsum-plugin/package.json
index 5868285101..34eab294e3 100644
--- a/plugins/apps/lorem-ipsum-plugin/package.json
+++ b/plugins/apps/lorem-ipsum-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build lorem-ipsum-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build lorem-ipsum-plugin",
"build:dev": "ng build lorem-ipsum-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=lorem-ipsum-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=lorem-ipsum-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/plugin-api-test-suite/README.md b/plugins/apps/plugin-api-test-suite/README.md
index a04657cfff..2504756974 100644
--- a/plugins/apps/plugin-api-test-suite/README.md
+++ b/plugins/apps/plugin-api-test-suite/README.md
@@ -247,13 +247,17 @@ with `name`/`pinned`/`shared` properties and `open`, `moveTo`, `duplicate` and
`remove` methods. `management.test.ts` shows the patterns:
- Put every team and project a test creates under a name from
- `temporaryName()` (`src/framework/temporary.ts`). Tests delete the teams they
- create; the live CI driver deletes the teams and projects with that prefix
- after the run. Runs from the plugin UI leave the projects behind. The tests
- need nothing set up beforehand.
-- Assigning `name`, `pinned` or `shared` updates the object at once and saves
- in the background. To check the saved result, list again inside
- `waitForAsync()` (`src/tests/wait.ts`).
+ `temporaryName()` (`src/framework/temporary.ts`). The API cannot delete
+ teams, so the live CI driver deletes the teams and projects with that prefix
+ after the run. Runs from the plugin UI leave them behind. The tests need
+ nothing set up beforehand.
+- Assigning `name`, `pinned` or `shared` saves to the backend first and updates
+ the object only when the save succeeds. Wait for the new value with
+ `waitFor()` (`src/tests/wait.ts`) before reading it; to check what the
+ backend stored, list again inside `waitForAsync()`.
+- `Project.fileCount` is the count when the project was listed; creating or
+ moving files does not change it. List the project again to see the new
+ count.
- Shape, page, file and library objects taken before `file.open()` (or
`openFile`) are stale afterwards; look them up again in the new file.
`ctx.board` belongs to the file the test started in, so only use it there.
diff --git a/plugins/apps/plugin-api-test-suite/ci/run-ci.ts b/plugins/apps/plugin-api-test-suite/ci/run-ci.ts
index acf6904299..535418577c 100644
--- a/plugins/apps/plugin-api-test-suite/ci/run-ci.ts
+++ b/plugins/apps/plugin-api-test-suite/ci/run-ci.ts
@@ -309,7 +309,7 @@ async function setupMockedRoutes(page: Page): Promise {
route.fulfill({
status: 200,
contentType: 'application/javascript',
- body: 'var penpotFlags = "";\n',
+ body: 'var penpotFlags = "disable-admin-console";\n',
}),
);
diff --git a/plugins/apps/plugin-api-test-suite/package.json b/plugins/apps/plugin-api-test-suite/package.json
index 1c6ba084c1..03a09c7c00 100644
--- a/plugins/apps/plugin-api-test-suite/package.json
+++ b/plugins/apps/plugin-api-test-suite/package.json
@@ -20,5 +20,5 @@
"devDependencies": {
"playwright": "^1.63.0"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/plugin-api-test-suite/src/tests/components.test.ts b/plugins/apps/plugin-api-test-suite/src/tests/components.test.ts
index 92d68fd6aa..b2c16486f4 100644
--- a/plugins/apps/plugin-api-test-suite/src/tests/components.test.ts
+++ b/plugins/apps/plugin-api-test-suite/src/tests/components.test.ts
@@ -64,6 +64,20 @@ describe('Component instances', () => {
expect(inst.isVariantHead()).toBeFalsy();
});
+ // instance() places the copy at the page origin; a board covering that point
+ // must not capture it.
+ test('instance creates the copy at the page root', (ctx) => {
+ ctx.board.x = 0;
+ ctx.board.y = 0;
+ const inst = makeComponent(ctx).instance();
+ try {
+ expect(inst.parent?.id).toBe(ctx.penpot.root?.id);
+ expect(ctx.board.children.map((c) => c.id)).not.toContain(inst.id);
+ } finally {
+ inst.remove();
+ }
+ });
+
test('component navigation methods return shapes', (ctx) => {
const inst = instanceOf(ctx);
expect(inst.componentRoot()).toBeDefined();
diff --git a/plugins/apps/plugin-api-test-suite/src/tests/management.test.ts b/plugins/apps/plugin-api-test-suite/src/tests/management.test.ts
index 1c451f5ac1..67e96d83b6 100644
--- a/plugins/apps/plugin-api-test-suite/src/tests/management.test.ts
+++ b/plugins/apps/plugin-api-test-suite/src/tests/management.test.ts
@@ -193,6 +193,7 @@ describe('Management', () => {
try {
team.name = renamed;
+ await waitFor(() => team.name === renamed, { timeout: 5000 });
expect(team.name).toBe(renamed);
await waitForAsync(
async () => (await currentTeam(ctx)).name === renamed,
@@ -225,7 +226,9 @@ describe('Management', () => {
expect(file.projectId).toBe(created.id);
expect(file.teamId).toBe(team.id);
expect(file.shared).toBe(false);
- expect(created.fileCount).toBe(1);
+ // fileCount is a listing snapshot, so list the project again.
+ expect(created.fileCount).toBe(0);
+ expect((await listedProject(ctx, created.id))?.fileCount).toBe(1);
expect((await created.listFiles()).map((f) => f.id)).toEqual([file.id]);
// Creating does not navigate.
expect(ctx.penpotMgmt.workspace).toEqual(home);
@@ -240,6 +243,9 @@ describe('Management', () => {
created.name = renamed;
created.pinned = true;
+ await waitFor(() => created.name === renamed && created.pinned, {
+ timeout: 5000,
+ });
expect(created.name).toBe(renamed);
expect(created.pinned).toBe(true);
@@ -282,20 +288,18 @@ describe('Management', () => {
name: temporaryName('team'),
});
- try {
- const moved = await team.createProject({
- name: temporaryName('moved'),
- });
- await moved.moveTo(target);
+ // Teams cannot be deleted through the API; the live CI driver deletes
+ // the temporary team after the run.
+ const moved = await team.createProject({
+ name: temporaryName('moved'),
+ });
+ await moved.moveTo(target);
- expect(moved.teamId).toBe(target.id);
- expect((await target.listProjects()).map((p) => p.id)).toContain(
- moved.id,
- );
- expect(await listedProject(ctx, moved.id)).toBeUndefined();
- } finally {
- await target.remove();
- }
+ expect(moved.teamId).toBe(target.id);
+ expect((await target.listProjects()).map((p) => p.id)).toContain(
+ moved.id,
+ );
+ expect(await listedProject(ctx, moved.id)).toBeUndefined();
});
});
@@ -305,6 +309,7 @@ describe('Management', () => {
const parent = await temporaryProject(ctx);
file.name = ' Renamed ';
+ await waitFor(() => file.name === 'Renamed', { timeout: 5000 });
expect(file.name).toBe('Renamed');
await waitForAsync(
async () => (await listedFile(parent, file.id))?.name === 'Renamed',
@@ -361,6 +366,9 @@ describe('Management', () => {
expect(ctx.penpotMgmt.workspace.fileName).toBe(`${original} (renamed)`);
} finally {
file.name = original;
+ await waitFor(() => ctx.penpotMgmt.workspace.fileName === original, {
+ timeout: 5000,
+ });
}
});
});
@@ -460,6 +468,7 @@ describe('Management', () => {
);
file.shared = true;
+ await waitFor(() => file.shared, { timeout: 5000 });
expect(file.shared).toBe(true);
await waitForAsync(isListed);
expect(await isListed()).toBe(true);
diff --git a/plugins/apps/plugin-api-test-suite/src/tests/shapes-factories.test.ts b/plugins/apps/plugin-api-test-suite/src/tests/shapes-factories.test.ts
index 6dc8be8fa5..eb0782cae0 100644
--- a/plugins/apps/plugin-api-test-suite/src/tests/shapes-factories.test.ts
+++ b/plugins/apps/plugin-api-test-suite/src/tests/shapes-factories.test.ts
@@ -325,4 +325,41 @@ describe('Shapes', () => {
expect(a.x).toBeCloseTo(10, 0);
});
});
+
+ // The factories place new shapes at the page origin. A board covering that
+ // point must not capture them: they belong to the page root until the plugin
+ // reparents them.
+ describe('Placement', () => {
+ const svg =
+ '' +
+ ' ';
+
+ test('createShapeFromSvg creates the shape at the page root', (ctx) => {
+ ctx.board.x = 0;
+ ctx.board.y = 0;
+ const group = ctx.penpot.createShapeFromSvg(svg);
+ expect(group).not.toBeNull();
+ if (!group) return;
+ try {
+ expect(group.parent?.id).toBe(ctx.penpot.root?.id);
+ expect(ctx.board.children.map((c) => c.id)).not.toContain(group.id);
+ } finally {
+ group.remove();
+ }
+ });
+
+ test('createShapeFromSvgWithImages creates the shape at the page root', async (ctx) => {
+ ctx.board.x = 0;
+ ctx.board.y = 0;
+ const group = await ctx.penpot.createShapeFromSvgWithImages(svg);
+ expect(group).not.toBeNull();
+ if (!group) return;
+ try {
+ expect(group.parent?.id).toBe(ctx.penpot.root?.id);
+ expect(ctx.board.children.map((c) => c.id)).not.toContain(group.id);
+ } finally {
+ group.remove();
+ }
+ });
+ });
});
diff --git a/plugins/apps/plugin-api-test-suite/src/tests/variants.test.ts b/plugins/apps/plugin-api-test-suite/src/tests/variants.test.ts
index 451e75f91b..ace7b44d32 100644
--- a/plugins/apps/plugin-api-test-suite/src/tests/variants.test.ts
+++ b/plugins/apps/plugin-api-test-suite/src/tests/variants.test.ts
@@ -41,6 +41,27 @@ function sameIds(a: string[], b: string[]): boolean {
return a.length === b.length && a.every((id, i) => id === b[i]);
}
+// Value of the first property for each variant component, in variant order.
+function firstPropertyValues(container: VariantContainer): string[] {
+ const variants = container.variants;
+ if (!variants) return [];
+ const property = variants.properties[0];
+ return variants
+ .variantComponents()
+ .map((c) => (c as LibraryVariantComponent).variantProps[property]);
+}
+
+function variantValueOf(
+ container: VariantContainer,
+ componentId: string,
+): string | undefined {
+ const variants = container.variants;
+ const component = variants
+ ?.variantComponents()
+ .find((c) => c.id === componentId) as LibraryVariantComponent | undefined;
+ return component?.variantProps[variants!.properties[0]];
+}
+
// Polls until the condition holds. On timeout it returns normally so the
// assertion that follows reports the actual mismatch.
async function waitFor(
@@ -134,6 +155,72 @@ describe('Variants', () => {
expect(variantComponentIds(container)).toEqual(expected);
});
+ // The components built here all share the name "Rectangle". Combining
+ // components with the same name must give every variant a unique,
+ // non-empty value, numbered in the combine order (#12878).
+ test('createVariantFromComponents gives same-name components unique values in input order', async (ctx) => {
+ const a = componentWithMain(ctx);
+ const b = componentWithMain(ctx);
+ const c = componentWithMain(ctx);
+ const container = ctx.penpot.createVariantFromComponents([
+ c.main,
+ a.main,
+ b.main,
+ ]);
+ const expected = ['Value 1', 'Value 2', 'Value 3'];
+ await waitFor(() => sameIds(firstPropertyValues(container), expected));
+ expect(firstPropertyValues(container)).toEqual(expected);
+ expect(variantComponentIds(container)).toEqual([
+ c.comp.id,
+ a.comp.id,
+ b.comp.id,
+ ]);
+ });
+
+ test('combineAsVariants gives same-name components unique values in combine order', async (ctx) => {
+ const a = componentWithMain(ctx);
+ const b = componentWithMain(ctx);
+ const c = componentWithMain(ctx);
+ const container = a.main.combineAsVariants([b.main.id, c.main.id]);
+ const expected = ['Value 1', 'Value 2', 'Value 3'];
+ await waitFor(() => sameIds(firstPropertyValues(container), expected));
+ expect(firstPropertyValues(container)).toEqual(expected);
+ expect(variantComponentIds(container)).toEqual([
+ a.comp.id,
+ b.comp.id,
+ c.comp.id,
+ ]);
+ });
+
+ test('a same-name main moved into a variant container takes the first free value', async (ctx) => {
+ const a = componentWithMain(ctx);
+ const b = componentWithMain(ctx);
+ const c = componentWithMain(ctx);
+ const container = ctx.penpot.createVariantFromComponents([
+ a.main,
+ b.main,
+ c.main,
+ ]);
+ await waitFor(() => firstPropertyValues(container).includes('Value 2'));
+
+ // Free "Value 2" so the moved main has a gap to fill.
+ const withValue2 = container
+ .variants!.variantComponents()
+ .find(
+ (comp) => variantValueOf(container, comp.id) === 'Value 2',
+ ) as LibraryVariantComponent;
+ withValue2.setVariantProperty(0, 'Renamed');
+ await waitFor(() => !firstPropertyValues(container).includes('Value 2'));
+
+ const d = componentWithMain(ctx);
+ container.appendChild(d.main);
+ await waitFor(() => variantValueOf(container, d.comp.id) !== undefined);
+ expect(variantValueOf(container, d.comp.id)).toBe('Value 2');
+
+ const values = firstPropertyValues(container);
+ expect(new Set(values).size).toBe(values.length);
+ });
+
test('variant component exposes variant props and Variants', (ctx) => {
const rect = ctx.penpot.createRectangle();
ctx.board.appendChild(rect);
diff --git a/plugins/apps/poc-state-plugin/package.json b/plugins/apps/poc-state-plugin/package.json
index 3e225d2f41..f2138cd8c0 100644
--- a/plugins/apps/poc-state-plugin/package.json
+++ b/plugins/apps/poc-state-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build poc-state-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build poc-state-plugin",
"build:dev": "ng build poc-state-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=poc-state-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=poc-state-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/poc-tokens-plugin/package.json b/plugins/apps/poc-tokens-plugin/package.json
index 83d30f08a9..a152f95df1 100644
--- a/plugins/apps/poc-tokens-plugin/package.json
+++ b/plugins/apps/poc-tokens-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build poc-tokens-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build poc-tokens-plugin",
"build:dev": "ng build poc-tokens-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=poc-tokens-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=poc-tokens-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "exit 0"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/rename-layers-plugin/package.json b/plugins/apps/rename-layers-plugin/package.json
index 90faf2acea..a8a0ce18d3 100644
--- a/plugins/apps/rename-layers-plugin/package.json
+++ b/plugins/apps/rename-layers-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build rename-layers-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build rename-layers-plugin",
"build:dev": "ng build rename-layers-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=rename-layers-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=rename-layers-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/apps/table-plugin/package.json b/plugins/apps/table-plugin/package.json
index b77a35b327..3ae9e4bd23 100644
--- a/plugins/apps/table-plugin/package.json
+++ b/plugins/apps/table-plugin/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "build": "ng build table-plugin && pnpm run build:plugin",
+ "build": "pnpm run build:plugin && ng build table-plugin",
"build:dev": "ng build table-plugin --configuration development",
"build:plugin": "node ../../tools/scripts/build-plugin.mjs --plugin=table-plugin",
"watch": "node ../../tools/scripts/build-plugin.mjs --plugin=table-plugin --watch",
@@ -13,5 +13,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/libs/plugin-types/index.d.ts b/plugins/libs/plugin-types/index.d.ts
index 5d6c27e156..a21eb02a64 100644
--- a/plugins/libs/plugin-types/index.d.ts
+++ b/plugins/libs/plugin-types/index.d.ts
@@ -110,6 +110,7 @@ export interface Penpot extends Omit<
* - themechange: event emitted when the user changes its theme. The callback will receive the new theme (currently: either `dark` or `light`)
* - filechange: event emitted when a different file is opened. The callback will receive the new file.
* - contentsave: event emitted after the file content is saved in the backend. The callback receives no arguments.
+ * - contentrollback: event emitted after the backend rejected some changes and they were undone in the workspace. The callback receives a `ContentRollback` with the files, pages and shapes affected.
* - finish: event emitted when the current file is closed. The callback will receive the id of the closed file.
*
* @param type The event type to listen for.
@@ -1859,6 +1860,37 @@ export interface EventsMap {
* The `contentsave` event will trigger after the file content is saved in the backend.
*/
readonly contentsave: void;
+
+ /**
+ * The `contentrollback` event will trigger after the backend rejected some changes
+ * and the workspace undid them, together with the rest of their undo steps and any
+ * later change to the same file. Changes made by a plugin can be undone this way
+ * after the call that made them returned, so a plugin that relies on them should
+ * read the affected shapes again. The event fires once the undone data is in the
+ * workspace. When the workspace could not undo the changes in place, it reloads the
+ * file from the server first; the whole file then holds the server data, so shapes
+ * outside the listed ones may have changed too.
+ */
+ readonly contentrollback: ContentRollback;
+}
+
+/**
+ * What a rollback of rejected changes undid, as given to the `contentrollback` event.
+ */
+export interface ContentRollback {
+ /**
+ * Ids of the files that lost changes.
+ */
+ readonly fileIds: string[];
+ /**
+ * Ids of the pages the undone changes touched.
+ */
+ readonly pageIds: string[];
+ /**
+ * Ids of the page shapes the undone changes touched. A shape the undone changes
+ * created no longer exists; one they removed exists again.
+ */
+ readonly shapeIds: string[];
}
/**
@@ -3060,7 +3092,8 @@ export interface LibraryComponent extends LibraryElement {
remove(): void;
/**
- * Restores this component if it has been deleted, including its main instance.
+ * Restores this component if it has been deleted, including its main instance,
+ * in the current file's library.
* Leaves the current page, selection, zoom, and viewport unchanged.
* Requires `library:write` permission. Does nothing if already restored.
*
diff --git a/plugins/libs/plugin-types/package.json b/plugins/libs/plugin-types/package.json
index 87546804f9..cd738a4fdc 100644
--- a/plugins/libs/plugin-types/package.json
+++ b/plugins/libs/plugin-types/package.json
@@ -1,11 +1,11 @@
{
"name": "@penpot/plugin-types",
- "version": "1.5.0",
+ "version": "1.6.0",
"typings": "./index.d.ts",
"type": "module",
"scripts": {
"build": "node ../../tools/scripts/build-types.mjs",
"lint": "tsc -p . --noEmit"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/libs/plugins-runtime/package.json b/plugins/libs/plugins-runtime/package.json
index f40741cf5e..337f6cd9af 100644
--- a/plugins/libs/plugins-runtime/package.json
+++ b/plugins/libs/plugins-runtime/package.json
@@ -1,8 +1,8 @@
{
"name": "@penpot/plugins-runtime",
- "version": "1.5.0",
+ "version": "1.6.0",
"dependencies": {
- "@penpot/plugin-types": "workspace:^",
+ "@penpot/plugin-types": "^1.6.0",
"ses": "^2.3.0",
"zod": "^4.6.5"
},
@@ -16,5 +16,5 @@
"lint": "eslint .",
"test": "vitest"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/libs/plugins-runtime/src/lib/api/index.ts b/plugins/libs/plugins-runtime/src/lib/api/index.ts
index f122c46ffe..b7fd1a0c02 100644
--- a/plugins/libs/plugins-runtime/src/lib/api/index.ts
+++ b/plugins/libs/plugins-runtime/src/lib/api/index.ts
@@ -45,6 +45,7 @@ export const validEvents = [
'themechange',
'shapechange',
'contentsave',
+ 'contentrollback',
] as const;
export function createApi(
diff --git a/plugins/libs/plugins-styles/package.json b/plugins/libs/plugins-styles/package.json
index aab41a3eaf..c70d423063 100644
--- a/plugins/libs/plugins-styles/package.json
+++ b/plugins/libs/plugins-styles/package.json
@@ -1,10 +1,10 @@
{
"name": "@penpot/plugin-styles",
- "version": "1.5.0",
+ "version": "1.6.0",
"dependencies": {},
"scripts": {
"build": "node ../../tools/scripts/build-css.mjs",
"lint": "echo 0"
},
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61"
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3"
}
diff --git a/plugins/package.json b/plugins/package.json
index f6b6d8901c..4b04171c49 100644
--- a/plugins/package.json
+++ b/plugins/package.json
@@ -3,7 +3,7 @@
"version": "0.6.0",
"type": "module",
"license": "MIT",
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"scripts": {
"start": "pnpm run start:app:runtime",
"start:app:runtime": "concurrently --kill-others --names build,server \"pnpm --filter @penpot/plugins-runtime run build:watch\" \"pnpm --filter @penpot/plugins-runtime run preview\"",
diff --git a/plugins/pnpm-lock.yaml b/plugins/pnpm-lock.yaml
index faf9371961..94c234158b 100644
--- a/plugins/pnpm-lock.yaml
+++ b/plugins/pnpm-lock.yaml
@@ -7,153 +7,153 @@ importers:
configDependencies: {}
packageManagerDependencies:
pnpm:
- specifier: 12.15.0
- version: 12.15.0
+ specifier: 12.18.0
+ version: 12.18.0
packages:
- '@pnpm/exe.android-arm64@12.15.0':
- resolution: {integrity: sha512-eVCqmscY70LGvgRzu3mi8IBWBFGix+a6mNZoWmXxESsBdeiKEF9xQSuaeel10yn+zI7TXy2jlI63vFLzETk+aQ==}
+ '@pnpm/exe.android-arm64@12.18.0':
+ resolution: {integrity: sha512-fOF6IwgvnUKEmVedGqiAsNPfN2Ry8GvaqzSQOiF3RJFbpBfPKO/6YT54s1GjToyYinRxw9preHHPe4y2N3SzhA==}
cpu: [arm64]
os: [android]
- '@pnpm/exe.android-x64@12.15.0':
- resolution: {integrity: sha512-Gx/WbkFcdUFUg8g8AShezcS9EiQxfYvdAm2hfKLO8sfJmJvKOCt5fzlgHWDzmGhoclibgW+tUGZ/KF4F4wOTCA==}
+ '@pnpm/exe.android-x64@12.18.0':
+ resolution: {integrity: sha512-6OiolnaCsB3/GcJ9XNrenbUH3zFHRJ+5QynrMUUEyThbgnnCzWxa199hpQlOmxN4rAXuYQ0IYgWFNUZxyzg31Q==}
cpu: [x64]
os: [android]
- '@pnpm/exe.darwin-arm64@12.15.0':
- resolution: {integrity: sha512-N0ZykiDWCvqSBJvt71j7cSoBR993FqvYZFtmpCtqvW3pguiI+NAgraLPA5OTwu5mV+/d8hYpVcPktJA3xFDLtA==}
+ '@pnpm/exe.darwin-arm64@12.18.0':
+ resolution: {integrity: sha512-zkq+4YzVIX39ETYLyC3W7LY7MpHEU/J3nRhHl4i2yPld2Cf2+rEKRh3ejJ4AmaQ77HHJLCktY4Z3jq0fpcxFXg==}
cpu: [arm64]
os: [darwin]
- '@pnpm/exe.darwin-x64@12.15.0':
- resolution: {integrity: sha512-7Ntr2HlBUxzwWOg7NwDxCbRW/3vXuqKO+hcXm+w3SBi9rrHY53li1wLqWVT7Gjxd+lVEHM1QJZo6WJEGFU8C6A==}
+ '@pnpm/exe.darwin-x64@12.18.0':
+ resolution: {integrity: sha512-qMsL9qx92unOTa6hgkfiTJv8ceZaTx0IQg7InhYDVX2ZrTECujaVEEVypnJK5m3eGUsP1KD7Y4qIgleCwfRsYw==}
cpu: [x64]
os: [darwin]
- '@pnpm/exe.freebsd-x64@12.15.0':
- resolution: {integrity: sha512-btOiyL7fL7W4uQGH0aqFai2TNC3IoKcZ7gNHBVbEFZt2dWrnrD0SufL3iGs3fLlmb4OtuU35uf4Zpr9V9Jh9mA==}
+ '@pnpm/exe.freebsd-x64@12.18.0':
+ resolution: {integrity: sha512-/9vy/4ms52cU4MjZ5NhHd6N2d9L9W0kARf5/ff2tweAHu0VeUzs/0qp/7ZHFuddm2Wa/m0AKQoPum9AVUCqKsw==}
cpu: [x64]
os: [freebsd]
- '@pnpm/exe.linux-arm64-musl@12.15.0':
- resolution: {integrity: sha512-pNC38k+O+90FOjbPNSnw0E7apq1PKTmz3fFe1amn+lys/U5kL++uzir8bRiho8ONcyA3d9EU7wdqcY0DKkj+JA==}
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
+ resolution: {integrity: sha512-Vp+TIMPPyackVCXkOdEKH/RmAn/r07EcIyrgZYQK7VrkksqZOie0GnWIx+85mPqeFEYCRtXIZAFJ9L4ceTndDg==}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-arm64@12.15.0':
- resolution: {integrity: sha512-qML/8aCXslh8td/w4U+HJNqUcZ2+m6EfTbWScIzZRmyPsRFN+xB4LP1U/hymxc1iSJiKtG56HJx2fvUErWFIGw==}
+ '@pnpm/exe.linux-arm64@12.18.0':
+ resolution: {integrity: sha512-2dpyVBCHT+FfpuQh9i+7MXAqNWYLCvD5vYr5p6Eimxoga8USLnjbUgyj72AOrO0hjc5ri3TEFP3jiyBHjkSZpQ==}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-ppc64@12.15.0':
- resolution: {integrity: sha512-tjRDUUl7RCJ6T/6eoNPxOqkwU4Mzi5RtTXmSAxujyz37OTwwsMU7Ps087Zk4gHcUvRSeyF40ZFsew3vtE+nmUA==}
+ '@pnpm/exe.linux-ppc64@12.18.0':
+ resolution: {integrity: sha512-BBOOOfNJ2QwIIya3eKqOjiN4WNTszfRz7HCvw9XggcT7+ftMjNP8XJ/GfW+ltCBeUFR9d8WBVsr2m/NLjX2CZQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-riscv64@12.15.0':
- resolution: {integrity: sha512-bF1uBWEfbwaeryz6lIiaJ8AWD082otZfvzGX5l+6LZRpRwUEpJHUsJrORaYP5/cNMv5ZR2p6TvvcJcQzwtDzmw==}
+ '@pnpm/exe.linux-riscv64@12.18.0':
+ resolution: {integrity: sha512-7kMN77xSOYJX8GPSH5RbNAc5oM61LMmcSUukDDUwllnZPXm8GRPskCNsTWy8SCw01Kr1FB+5SwGNMiTdiziLNQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-s390x@12.15.0':
- resolution: {integrity: sha512-zKMhIzsexYMToeLmqV5jPsvV/f9vwsJb2kUH2NFYzalbxImeBrlA4kL7GwF8gD4pagV6jYYcJb8RjbZIdjHptg==}
+ '@pnpm/exe.linux-s390x@12.18.0':
+ resolution: {integrity: sha512-htuSCpEcmDzhKoJqXbPkvfr176dBHU0QIF5mWcRiqxRXAB/1JoYiMYotfjWpk+ztgpB9qlx4XnWlLFAf7gzc6g==}
cpu: [s390x]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-x64-musl@12.15.0':
- resolution: {integrity: sha512-A9J0Jg0Rdx+qQU4qXtwyST5tto9IOu1zi4fDk35nbc6DWahggbcKtFvZPKFwL2qgUXGXOX//hXv6z/sp6emO8A==}
+ '@pnpm/exe.linux-x64-musl@12.18.0':
+ resolution: {integrity: sha512-Uj+vzfIQ62kDP10x36yHZIXVs5ohdNtiPYwn5FhCLlNScHPo0OAI+ShGDtLofiBXKE7umu71Jmjm7N8a8zVcDw==}
cpu: [x64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-x64@12.15.0':
- resolution: {integrity: sha512-yc+QlZR+9+nr29J4fRzhMoapgxTBDndq/+peyoq1XUufnQFnfbXUMFudDIKzHi545linGqmOmXfn0NoufNgcOg==}
+ '@pnpm/exe.linux-x64@12.18.0':
+ resolution: {integrity: sha512-OJ+X2wcraldCwj75pCIerWARQSRpdfj0eBTs/2ODyhfeW46ylOnjTIE/GKra6Mn6E72/gBmXS8igrUioa+F9fQ==}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.win32-arm64@12.15.0':
- resolution: {integrity: sha512-fPXZxuY1VclkOga9bc53qNCXcegfeoBR8+Ue+AospDwKzuGGSHll0oDxkLfkmpjyRqpe7bH5DyQPYp/xSMaIVA==}
+ '@pnpm/exe.win32-arm64@12.18.0':
+ resolution: {integrity: sha512-wEY6jiACGcbhhi5yD59doHqNTndS7AaujaPmtWAu1DKkHru2hy5fJ9yUGecW72Ypaw2/I3BEprfMOopap2NQtw==}
cpu: [arm64]
os: [win32]
- '@pnpm/exe.win32-x64@12.15.0':
- resolution: {integrity: sha512-nrd+Tp1We1DGj4DGG5Bea9lZNh9y1PjlLBdEwdInS4D0h0UIDtM7JaGGGDJhNzIwcHASyihWI7HLV+dtG+fhYg==}
+ '@pnpm/exe.win32-x64@12.18.0':
+ resolution: {integrity: sha512-5FJkghO7RLRkQpWxeVEygW9XsmnNuxzPfXbgwFWCHsFyFhpDn/vOdL88ToQEM0Kt5igdW5s6U0/IDH8Dvkt3pg==}
cpu: [x64]
os: [win32]
- pnpm@12.15.0:
- resolution: {integrity: sha512-s5UdbW/0qfE9x89WzSjSuOs328ycaOUuHhGRhz6p+CoBcoerULqtxczElPA2xnwOR+sTYIwvo29HcRth6hKOYQ==}
+ pnpm@12.18.0:
+ resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==}
engines: {node: '>=18'}
hasBin: true
snapshots:
- '@pnpm/exe.android-arm64@12.15.0':
+ '@pnpm/exe.android-arm64@12.18.0':
optional: true
- '@pnpm/exe.android-x64@12.15.0':
+ '@pnpm/exe.android-x64@12.18.0':
optional: true
- '@pnpm/exe.darwin-arm64@12.15.0':
+ '@pnpm/exe.darwin-arm64@12.18.0':
optional: true
- '@pnpm/exe.darwin-x64@12.15.0':
+ '@pnpm/exe.darwin-x64@12.18.0':
optional: true
- '@pnpm/exe.freebsd-x64@12.15.0':
+ '@pnpm/exe.freebsd-x64@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64-musl@12.15.0':
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64@12.15.0':
+ '@pnpm/exe.linux-arm64@12.18.0':
optional: true
- '@pnpm/exe.linux-ppc64@12.15.0':
+ '@pnpm/exe.linux-ppc64@12.18.0':
optional: true
- '@pnpm/exe.linux-riscv64@12.15.0':
+ '@pnpm/exe.linux-riscv64@12.18.0':
optional: true
- '@pnpm/exe.linux-s390x@12.15.0':
+ '@pnpm/exe.linux-s390x@12.18.0':
optional: true
- '@pnpm/exe.linux-x64-musl@12.15.0':
+ '@pnpm/exe.linux-x64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-x64@12.15.0':
+ '@pnpm/exe.linux-x64@12.18.0':
optional: true
- '@pnpm/exe.win32-arm64@12.15.0':
+ '@pnpm/exe.win32-arm64@12.18.0':
optional: true
- '@pnpm/exe.win32-x64@12.15.0':
+ '@pnpm/exe.win32-x64@12.18.0':
optional: true
- pnpm@12.15.0:
+ pnpm@12.18.0:
optionalDependencies:
- '@pnpm/exe.android-arm64': 12.15.0
- '@pnpm/exe.android-x64': 12.15.0
- '@pnpm/exe.darwin-arm64': 12.15.0
- '@pnpm/exe.darwin-x64': 12.15.0
- '@pnpm/exe.freebsd-x64': 12.15.0
- '@pnpm/exe.linux-arm64': 12.15.0
- '@pnpm/exe.linux-arm64-musl': 12.15.0
- '@pnpm/exe.linux-ppc64': 12.15.0
- '@pnpm/exe.linux-riscv64': 12.15.0
- '@pnpm/exe.linux-s390x': 12.15.0
- '@pnpm/exe.linux-x64': 12.15.0
- '@pnpm/exe.linux-x64-musl': 12.15.0
- '@pnpm/exe.win32-arm64': 12.15.0
- '@pnpm/exe.win32-x64': 12.15.0
+ '@pnpm/exe.android-arm64': 12.18.0
+ '@pnpm/exe.android-x64': 12.18.0
+ '@pnpm/exe.darwin-arm64': 12.18.0
+ '@pnpm/exe.darwin-x64': 12.18.0
+ '@pnpm/exe.freebsd-x64': 12.18.0
+ '@pnpm/exe.linux-arm64': 12.18.0
+ '@pnpm/exe.linux-arm64-musl': 12.18.0
+ '@pnpm/exe.linux-ppc64': 12.18.0
+ '@pnpm/exe.linux-riscv64': 12.18.0
+ '@pnpm/exe.linux-s390x': 12.18.0
+ '@pnpm/exe.linux-x64': 12.18.0
+ '@pnpm/exe.linux-x64-musl': 12.18.0
+ '@pnpm/exe.win32-arm64': 12.18.0
+ '@pnpm/exe.win32-x64': 12.18.0
---
lockfileVersion: '9.0'
@@ -347,7 +347,7 @@ importers:
version: 0.14.5(eslint@10.12.0(jiti@2.7.0)(supports-color@10.2.2))(optionator@0.9.4)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))
vite-plugin-dts:
specifier: 5.1.2
- version: 5.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.2)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28))
+ version: 5.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.12)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28))
vite-plugin-static-copy:
specifier: ^4.1.1
version: 4.1.1(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))
@@ -380,10 +380,10 @@ importers:
version: 7.0.2
vite:
specifier: ^8.3.2
- version: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.97.3)(sass@1.101.0)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)
+ version: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)
vite-live-preview:
specifier: ^0.4.0
- version: 0.4.0(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.97.3)(sass@1.101.0)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))
+ version: 0.4.0(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))
apps/contrast-plugin: {}
@@ -416,7 +416,7 @@ importers:
libs/plugins-runtime:
dependencies:
'@penpot/plugin-types':
- specifier: workspace:^
+ specifier: ^1.6.0
version: link:../plugin-types
ses:
specifier: ^2.3.0
@@ -1576,9 +1576,6 @@ packages:
cpu: [x64]
os: [win32]
- '@oxc-project/types@0.142.0':
- resolution: {integrity: sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==}
-
'@oxc-project/types@0.149.0':
resolution: {integrity: sha512-Efcc+iF0j3Bf67YjEqIqWXbX5XddXoK/Mw4K1/JuXwRCZ8N16VR7iT23nlCc9XrveFVh/E5Rqs2StT0V8v9LdA==}
@@ -1710,12 +1707,6 @@ packages:
cpu: [arm64]
os: [android]
- '@rolldown/binding-android-arm64@1.2.2':
- resolution: {integrity: sha512-l7x215OGvo1s52JWmR8U/DAVzEDWBCIbTm28aeJV/WDTSHgcKXaZTuBT0hJMs5NggilfJTW3clZVvd24yfKJxA==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm64]
- os: [android]
-
'@rolldown/binding-android-arm64@1.2.8':
resolution: {integrity: sha512-dIYTWl9XprMUiQFoc55KUyk/oS8SKYH3zFl0LTR7RT0Xj4hgSVyuJcroH8JUu8RcpF8fTB6E0aOwCkZoYPcDSQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1728,12 +1719,6 @@ packages:
cpu: [arm64]
os: [darwin]
- '@rolldown/binding-darwin-arm64@1.2.2':
- resolution: {integrity: sha512-9u9Xv6c1AJZT0FfwH5vrMG5Jjcwhc1MlyrPu0XfTqkzsmqfks2M6W/o5XwAJgVVN/jHpqqngC1WevHKKTIUtIA==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm64]
- os: [darwin]
-
'@rolldown/binding-darwin-arm64@1.2.8':
resolution: {integrity: sha512-PCSDQGXD2IyTEFrcgPyBM8jJuGmrbCMuoIOXdbEGVemruKACXoLQJrb+A45Z0L5t1RQkdfJprAYPkikbh7dzdA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1746,12 +1731,6 @@ packages:
cpu: [x64]
os: [darwin]
- '@rolldown/binding-darwin-x64@1.2.2':
- resolution: {integrity: sha512-9W1mbGZAfW3oqd85bhBkmpyHCCzL1TeG/zFFP3vg7b0rlly8cxOcre5nXwz+LHazCwac2MNWgPdPCHndABjpWQ==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [x64]
- os: [darwin]
-
'@rolldown/binding-darwin-x64@1.2.8':
resolution: {integrity: sha512-Uk7lRsGhPFHVX/sAUC6D5H9Ol30dFHd6iquokll2th3LpdJ3F5CzQB+7DHn0Ri2mG+U7k2zXiPHDrwZenXhwSA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1764,12 +1743,6 @@ packages:
cpu: [x64]
os: [freebsd]
- '@rolldown/binding-freebsd-x64@1.2.2':
- resolution: {integrity: sha512-0p1lhiCSCyaerFwtrdZQUx7NqGk6LQnaRKWX7tFQqwQgvX0rjM15cIkm3pax1UpEakK14C4mOxx/jSqCBdBRqQ==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [x64]
- os: [freebsd]
-
'@rolldown/binding-freebsd-x64@1.2.8':
resolution: {integrity: sha512-DjszaTEVogPqA5bYzsEeqDCQxbcp2fexQwKcRspYji2yzR68fCf+e4fx6kBSRDwX5/brZaHw/hWS9+A/+/w9sQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1782,12 +1755,6 @@ packages:
cpu: [arm]
os: [linux]
- '@rolldown/binding-linux-arm-gnueabihf@1.2.2':
- resolution: {integrity: sha512-e+cOJXrJ2L3zx6YzqPg+f6Wbk3V1cKB8bOhbaYdVYN3DdquzNdRAmrbETz1qnt5yp/c7JNlNjmITiA2cVneQ7w==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm]
- os: [linux]
-
'@rolldown/binding-linux-arm-gnueabihf@1.2.8':
resolution: {integrity: sha512-zmwa7FTmdzB6aaEEuuls18H6Ap5JmJPSoPTuXixeJZV6tG40SyLkApQtz1g8ptZtiEKqj9OM0oNLPh1AgvE31Q==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1801,13 +1768,6 @@ packages:
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-arm64-gnu@1.2.2':
- resolution: {integrity: sha512-JsSMsj6sNat/MuhG5fnBD7QgbtpHKVe30x5/bAVirDHdhoQRXJkF6xc0Jqk8O4fiCUQAzMOoH9wZi3m60c8wtg==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm64]
- os: [linux]
- libc: [glibc]
-
'@rolldown/binding-linux-arm64-gnu@1.2.8':
resolution: {integrity: sha512-KdYQDPHwJVnbFwdTGMgxsI9SqblBlz6STGM+w1We/d5B8OWWidYH0MwkU/uA1wM5fIpO2MkOVxXrNzzuZhw9ew==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1822,13 +1782,6 @@ packages:
os: [linux]
libc: [musl]
- '@rolldown/binding-linux-arm64-musl@1.2.2':
- resolution: {integrity: sha512-B5G/zJdHaoJn9vD50eGHWkiWfmq8Uhi3IiLPJTzmZTrAalk1bztUikSXo0qga18ibE0IXboyeMUnhPjhAJ45wQ==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm64]
- os: [linux]
- libc: [musl]
-
'@rolldown/binding-linux-arm64-musl@1.2.8':
resolution: {integrity: sha512-jFJTifHnNPY+yzOoNZQfSIysrVyXzEQPhPnOUjmD1bcQGHH6s7c8cViKWar8YplQImE5N9JRqMCLrM2CdxOrZA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1843,13 +1796,6 @@ packages:
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-ppc64-gnu@1.2.2':
- resolution: {integrity: sha512-6mC/awzKka8W6EoekjegpfGkjz8jXWDX63pqu/HYVpyKtZfu65Jsh4QAH3Kej3CAv/c1oGX7psTmFEbr0mDxLA==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [ppc64]
- os: [linux]
- libc: [glibc]
-
'@rolldown/binding-linux-ppc64-gnu@1.2.8':
resolution: {integrity: sha512-FhiOziBDWPBjbcmRzfLyIJnaP7AVMFXT7YCXPjXxj7wKU3vx24RjrCNN/zjvVa+N2vVoHJwCoUBvsrN/DG3zIA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1864,13 +1810,6 @@ packages:
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-s390x-gnu@1.2.2':
- resolution: {integrity: sha512-412MX9fJLdA1IK28EZnc8jYv2HRTleOZgfLQumJ5zy7OeJLZlg/CETwFaXjNmGVxG51cFHpKLqb5LKvBC+HsHA==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [s390x]
- os: [linux]
- libc: [glibc]
-
'@rolldown/binding-linux-s390x-gnu@1.2.8':
resolution: {integrity: sha512-WnHfADMzOV2Y55wlx1hzzQnar/wDt/VdvWSD99r18Mz9ylNieIGOkRx3UV21h7m/eJvjySYJkO26VvGNFkwsIQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1885,13 +1824,6 @@ packages:
os: [linux]
libc: [glibc]
- '@rolldown/binding-linux-x64-gnu@1.2.2':
- resolution: {integrity: sha512-Q/+HI/ToJafZ1iCqGgVQXUEkIjufHCTF0gBQ2a5o3cg7GJ2h0qyq3nvvSmU+bGda2/7ygXpTY4TM6gO9OhQ0ZA==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [x64]
- os: [linux]
- libc: [glibc]
-
'@rolldown/binding-linux-x64-gnu@1.2.8':
resolution: {integrity: sha512-H9tRr5ibfXFVLxbPOseVewewFpl28zcEdjRDt2FTUZU7odxP0gEv1ki4/kGmcGOh78oRwZuuQllGLZ9zTJp84g==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1906,13 +1838,6 @@ packages:
os: [linux]
libc: [musl]
- '@rolldown/binding-linux-x64-musl@1.2.2':
- resolution: {integrity: sha512-ZKp/w41n6wCvxzxQHtQSbuphfX3Y4cCvbjkKHusrLx4lh+JWLTU7StSltO/DKARISzbj368d+qUaCjI8K2wzXw==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [x64]
- os: [linux]
- libc: [musl]
-
'@rolldown/binding-linux-x64-musl@1.2.8':
resolution: {integrity: sha512-UefiqfM3D6IVNlZ8tSGs9+Ejjud2T+oxO0IHADU45Y+lyEjD2dVFyZHbkfX0LUb5Zugo/oIv1eCO/KVYhgYJYA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1926,12 +1851,6 @@ packages:
cpu: [arm64]
os: [openharmony]
- '@rolldown/binding-openharmony-arm64@1.2.2':
- resolution: {integrity: sha512-pxE6xD4KS3eAROkKK5yrhB9/3+vhlhVGMvlQLbdpzrBGDbKrnzx3RLwPaHvasLo6jgaiBLn7e04Df9C4tYhjmA==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm64]
- os: [openharmony]
-
'@rolldown/binding-openharmony-arm64@1.2.8':
resolution: {integrity: sha512-637Ke4kWSy6rp9cxQ9gMOXlxPgIw/c1beASV4M//3+9I4uwBVOOl74G+e3zyU3u19U7RkRl/HuewixZ/Z6+Rjg==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1944,12 +1863,6 @@ packages:
cpu: [arm64]
os: [win32]
- '@rolldown/binding-win32-arm64-msvc@1.2.2':
- resolution: {integrity: sha512-4MqEue5re+xIZzAWsB8sj0P1kqZySWqIuN4t6QaIO/YA6SFwySOLruvWQFzfmqk8LBK2P30KCSJwf6mJCZZ5/A==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [arm64]
- os: [win32]
-
'@rolldown/binding-win32-arm64-msvc@1.2.8':
resolution: {integrity: sha512-xWBkPOF1Q9k/Gv1nQXnVdLxKu74jXppuOM4Z3mnypVUJJJwLsMl7hNJGRAUJoG8A5MgOI1ACKM+wBFxSJzKy4A==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1962,12 +1875,6 @@ packages:
cpu: [x64]
os: [win32]
- '@rolldown/binding-win32-x64-msvc@1.2.2':
- resolution: {integrity: sha512-NweNxxD0Nf9t8v7kodun45Ijp3EIwYY+uydPP6qBEYvfBqhIjN6dZMzlQja3tqX/aLs3F3Uz+AxDpKgRhpOZQg==}
- engines: {node: ^20.19.0 || >=22.12.0}
- cpu: [x64]
- os: [win32]
-
'@rolldown/binding-win32-x64-msvc@1.2.8':
resolution: {integrity: sha512-uz2ZvfgXbxqNwijjjbxrnvALwpyODDcgc1T1N8N3rf/DXKQmaFwmB4LX4yyjggpwN2obdQLb2rgirX5ffCWYng==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -2846,10 +2753,6 @@ packages:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
- chokidar@4.0.3:
- resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
- engines: {node: '>= 14.16.0'}
-
chokidar@5.0.0:
resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==}
engines: {node: '>= 20.19.0'}
@@ -2887,9 +2790,6 @@ packages:
resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==}
engines: {node: '>=20'}
- colorjs.io@0.5.2:
- resolution: {integrity: sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==}
-
colorjs.io@0.7.1:
resolution: {integrity: sha512-LY7OHnJZxHwT5UlzNa9bbhHHDbzB6yE5+3MIPwJEQKRvSCt/T4G7epsj+9j2BExUIIfXFIJGsIXUKdfrK9Q5tA==}
@@ -3511,6 +3411,7 @@ packages:
image-size@0.5.5:
resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
engines: {node: '>=0.10.0'}
+ deprecated: Please migrate to image-size@2.x
hasBin: true
immutable@5.1.9:
@@ -4261,10 +4162,6 @@ packages:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
- readdirp@4.1.2:
- resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
- engines: {node: '>= 14.18.0'}
-
readdirp@5.0.0:
resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}
engines: {node: '>= 20.19.0'}
@@ -4307,11 +4204,6 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
- rolldown@1.2.2:
- resolution: {integrity: sha512-opwpo1tQBAcpSUJDt94B7hhLNGOKjCdE//XXjeLrnx9b83bjnw45tXdg1b09yEw/VLFBJGZpwRULMmOZo7ol+A==}
- engines: {node: ^20.19.0 || >=22.12.0}
- hasBin: true
-
rolldown@1.2.8:
resolution: {integrity: sha512-Z67nTmhZe7anqnM/EjI392w5i/ANUinjip7QYsOyN37oayduxt3ksdX0hf5OOamkAd53BiIHfbfSzfUmzKFQqQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -4344,82 +4236,42 @@ packages:
resolution: {integrity: sha512-toyMCyUKkT6DsYlHuKZGjd8T6WltaW4TGX07F7HnF4tNJM5m/8VaVsd74zrq3QSPqGE9JjxIDK4NrNc/QY9pkA==}
cpu: ['!arm', '!arm64', '!riscv64', '!x64']
- sass-embedded-all-unknown@1.97.3:
- resolution: {integrity: sha512-t6N46NlPuXiY3rlmG6/+1nwebOBOaLFOOVqNQOC2cJhghOD4hh2kHNQQTorCsbY9S1Kir2la1/XLBwOJfui0xg==}
- cpu: ['!arm', '!arm64', '!riscv64', '!x64']
-
sass-embedded-android-arm64@1.104.1:
resolution: {integrity: sha512-yW3BVW4YFpN2vu2cVQ+Pz5JrRTvoIz36aCdo+J/Mo1A9gEN8eVPV/AL7aeZ803YdKgIitd3qw3pY4wpmT6TXNg==}
engines: {node: '>=14.0.0'}
cpu: [arm64]
os: [android]
- sass-embedded-android-arm64@1.97.3:
- resolution: {integrity: sha512-aiZ6iqiHsUsaDx0EFbbmmA0QgxicSxVVN3lnJJ0f1RStY0DthUkquGT5RJ4TPdaZ6ebeJWkboV4bra+CP766eA==}
- engines: {node: '>=14.0.0'}
- cpu: [arm64]
- os: [android]
-
sass-embedded-android-arm@1.104.1:
resolution: {integrity: sha512-g/XPAJYAzSSQZFP4xCdGD0HLKB4mf24cJ/+5Nls8rMool3jNkBv9+AFO4EV0b+RxN8rLcEsMccH1CR64yIFYcQ==}
engines: {node: '>=14.0.0'}
cpu: [arm]
os: [android]
- sass-embedded-android-arm@1.97.3:
- resolution: {integrity: sha512-cRTtf/KV/q0nzGZoUzVkeIVVFv3L/tS1w4WnlHapphsjTXF/duTxI8JOU1c/9GhRPiMdfeXH7vYNcMmtjwX7jg==}
- engines: {node: '>=14.0.0'}
- cpu: [arm]
- os: [android]
-
sass-embedded-android-riscv64@1.104.1:
resolution: {integrity: sha512-ZYY8oMKQS7Q/6FBoC8w3T16O3MucDe3xv8iKym41Nht5uvLCGGpm4fC4OF5nlv7wQkJv8oactYddGG3Wd0Rqkg==}
engines: {node: '>=14.0.0'}
cpu: [riscv64]
os: [android]
- sass-embedded-android-riscv64@1.97.3:
- resolution: {integrity: sha512-zVEDgl9JJodofGHobaM/q6pNETG69uuBIGQHRo789jloESxxZe82lI3AWJQuPmYCOG5ElfRthqgv89h3gTeLYA==}
- engines: {node: '>=14.0.0'}
- cpu: [riscv64]
- os: [android]
-
sass-embedded-android-x64@1.104.1:
resolution: {integrity: sha512-5WZKC4lSfjMIjzZdQUlYQUAV+UiatBhD8w28U7cYLLj4/dMgEPOBd4g3VMv0BwpgH2JOaycMS42dXq29W2bcDg==}
engines: {node: '>=14.0.0'}
cpu: [x64]
os: [android]
- sass-embedded-android-x64@1.97.3:
- resolution: {integrity: sha512-3ke0le7ZKepyXn/dKKspYkpBC0zUk/BMciyP5ajQUDy4qJwobd8zXdAq6kOkdiMB+d9UFJOmEkvgFJHl3lqwcw==}
- engines: {node: '>=14.0.0'}
- cpu: [x64]
- os: [android]
-
sass-embedded-darwin-arm64@1.104.1:
resolution: {integrity: sha512-oatuHzn0NsEg0d9Dcze6CuWUPvuETtMxRK4cv0eRAg7p6R0vHnv5GZRyWG6gEy3nc/ha/L+GtTasWVU82f4jrQ==}
engines: {node: '>=14.0.0'}
cpu: [arm64]
os: [darwin]
- sass-embedded-darwin-arm64@1.97.3:
- resolution: {integrity: sha512-fuqMTqO4gbOmA/kC5b9y9xxNYw6zDEyfOtMgabS7Mz93wimSk2M1quQaTJnL98Mkcsl2j+7shNHxIS/qpcIDDA==}
- engines: {node: '>=14.0.0'}
- cpu: [arm64]
- os: [darwin]
-
sass-embedded-darwin-x64@1.104.1:
resolution: {integrity: sha512-gql/5sHGzUTVwuHfM3QLCDeb6NYwen+LLj22gz81C2NKHF/4nUtDyh4N+fURWdT7J0/EhtMOd0+FLML3sGNP7g==}
engines: {node: '>=14.0.0'}
cpu: [x64]
os: [darwin]
- sass-embedded-darwin-x64@1.97.3:
- resolution: {integrity: sha512-b/2RBs/2bZpP8lMkyZ0Px0vkVkT8uBd0YXpOwK7iOwYkAT8SsO4+WdVwErsqC65vI5e1e5p1bb20tuwsoQBMVA==}
- engines: {node: '>=14.0.0'}
- cpu: [x64]
- os: [darwin]
-
sass-embedded-linux-arm64@1.104.1:
resolution: {integrity: sha512-sVWUKXNTu8sP3X95Df0xo/t49Ce5IseTIMqXHxhFBKVmx7gf7kBWNLK0wH5ym+4khc+B5nNJPgq4IxpelG8tMQ==}
engines: {node: '>=14.0.0'}
@@ -4427,13 +4279,6 @@ packages:
os: [linux]
libc: glibc
- sass-embedded-linux-arm64@1.97.3:
- resolution: {integrity: sha512-IP1+2otCT3DuV46ooxPaOKV1oL5rLjteRzf8ldZtfIEcwhSgSsHgA71CbjYgLEwMY9h4jeal8Jfv3QnedPvSjg==}
- engines: {node: '>=14.0.0'}
- cpu: [arm64]
- os: [linux]
- libc: glibc
-
sass-embedded-linux-arm@1.104.1:
resolution: {integrity: sha512-WfmshPJOp9vUKxgp8wZ2ncaKBbyrlW9J51M2aUQHWECjMNxTULnGOHWSmD7FViXv4zwn1Co5FIFQUipW7RCxtA==}
engines: {node: '>=14.0.0'}
@@ -4441,13 +4286,6 @@ packages:
os: [linux]
libc: glibc
- sass-embedded-linux-arm@1.97.3:
- resolution: {integrity: sha512-2lPQ7HQQg4CKsH18FTsj2hbw5GJa6sBQgDsls+cV7buXlHjqF8iTKhAQViT6nrpLK/e8nFCoaRgSqEC8xMnXuA==}
- engines: {node: '>=14.0.0'}
- cpu: [arm]
- os: [linux]
- libc: glibc
-
sass-embedded-linux-musl-arm64@1.104.1:
resolution: {integrity: sha512-H7b+LzZ/w8pwNExInM8HDHraqvxCMdUc5ZRGU/aSJJhZ9HjeRKBjF3GxaisVHnx7o18j1l4VQ5cLBL9tTmNzZw==}
engines: {node: '>=14.0.0'}
@@ -4455,13 +4293,6 @@ packages:
os: [linux]
libc: musl
- sass-embedded-linux-musl-arm64@1.97.3:
- resolution: {integrity: sha512-Lij0SdZCsr+mNRSyDZ7XtJpXEITrYsaGbOTz5e6uFLJ9bmzUbV7M8BXz2/cA7bhfpRPT7/lwRKPdV4+aR9Ozcw==}
- engines: {node: '>=14.0.0'}
- cpu: [arm64]
- os: [linux]
- libc: musl
-
sass-embedded-linux-musl-arm@1.104.1:
resolution: {integrity: sha512-k0cQ/CxBzFVYiQEObg6CpF6CUglkdEhi/DZgZXQbwC27kbGGY+fatmIs/cFPJL2z1ulACwoAr86RQUFzYvw5eg==}
engines: {node: '>=14.0.0'}
@@ -4469,13 +4300,6 @@ packages:
os: [linux]
libc: musl
- sass-embedded-linux-musl-arm@1.97.3:
- resolution: {integrity: sha512-cBTMU68X2opBpoYsSZnI321gnoaiMBEtc+60CKCclN6PCL3W3uXm8g4TLoil1hDD6mqU9YYNlVG6sJ+ZNef6Lg==}
- engines: {node: '>=14.0.0'}
- cpu: [arm]
- os: [linux]
- libc: musl
-
sass-embedded-linux-musl-riscv64@1.104.1:
resolution: {integrity: sha512-9DYdn4wfrkidjxJVtEd2iCx8HKdZe+uF82GDmrYEZhgu4NjVE6a4fQyW7OLwzn3erZMHKBaObBOH1d37DnXI1A==}
engines: {node: '>=14.0.0'}
@@ -4483,13 +4307,6 @@ packages:
os: [linux]
libc: musl
- sass-embedded-linux-musl-riscv64@1.97.3:
- resolution: {integrity: sha512-sBeLFIzMGshR4WmHAD4oIM7WJVkSoCIEwutzptFtGlSlwfNiijULp+J5hA2KteGvI6Gji35apR5aWj66wEn/iA==}
- engines: {node: '>=14.0.0'}
- cpu: [riscv64]
- os: [linux]
- libc: musl
-
sass-embedded-linux-musl-x64@1.104.1:
resolution: {integrity: sha512-5xz+nAr01b6yaRdrGVgE7lNvm1lGFjwNdUvnz+teidvHCbD5oTcbhrRVrnDoLHHvq5n3Jve9TzWaaHhezaEfHA==}
engines: {node: '>=14.0.0'}
@@ -4497,13 +4314,6 @@ packages:
os: [linux]
libc: musl
- sass-embedded-linux-musl-x64@1.97.3:
- resolution: {integrity: sha512-/oWJ+OVrDg7ADDQxRLC/4g1+Nsz1g4mkYS2t6XmyMJKFTFK50FVI2t5sOdFH+zmMp+nXHKM036W94y9m4jjEcw==}
- engines: {node: '>=14.0.0'}
- cpu: [x64]
- os: [linux]
- libc: musl
-
sass-embedded-linux-riscv64@1.104.1:
resolution: {integrity: sha512-oWryPJWTXK5adtlz/FD7wd2kS4I0CEgp6mWLUVb4oMFURMLz9bA9fO87D7lc4SV++lds7T51PU1kykCbOvNHMg==}
engines: {node: '>=14.0.0'}
@@ -4511,13 +4321,6 @@ packages:
os: [linux]
libc: glibc
- sass-embedded-linux-riscv64@1.97.3:
- resolution: {integrity: sha512-l3IfySApLVYdNx0Kjm7Zehte1CDPZVcldma3dZt+TfzvlAEerM6YDgsk5XEj3L8eHBCgHgF4A0MJspHEo2WNfA==}
- engines: {node: '>=14.0.0'}
- cpu: [riscv64]
- os: [linux]
- libc: glibc
-
sass-embedded-linux-x64@1.104.1:
resolution: {integrity: sha512-j/sX/yKTx/wJKepC5/ISlR6kPeSuHKThf76D2za5i2VnbHg0MN19jQq3WMorowR3kRghqt6azs3awogG+e7IRA==}
engines: {node: '>=14.0.0'}
@@ -4525,70 +4328,32 @@ packages:
os: [linux]
libc: glibc
- sass-embedded-linux-x64@1.97.3:
- resolution: {integrity: sha512-Kwqwc/jSSlcpRjULAOVbndqEy2GBzo6OBmmuBVINWUaJLJ8Kczz3vIsDUWLfWz/kTEw9FHBSiL0WCtYLVAXSLg==}
- engines: {node: '>=14.0.0'}
- cpu: [x64]
- os: [linux]
- libc: glibc
-
sass-embedded-unknown-all@1.104.1:
resolution: {integrity: sha512-RaMsYZB5mRioL4qhoI7T5mmNb2OunakbPTJW2cuu3MeIULnGoxo7Wd5QKFxeQvF7sSQL57RuaQ+q9pH+/pQ9Fg==}
os: ['!android', '!darwin', '!linux', '!win32']
- sass-embedded-unknown-all@1.97.3:
- resolution: {integrity: sha512-/GHajyYJmvb0IABUQHbVHf1nuHPtIDo/ClMZ81IDr59wT5CNcMe7/dMNujXwWugtQVGI5UGmqXWZQCeoGnct8Q==}
- os: ['!android', '!darwin', '!linux', '!win32']
-
sass-embedded-win32-arm64@1.104.1:
resolution: {integrity: sha512-fS6DL7lcnTPclqGLF4xRt8egZlFY9cU23d57ufbWqaUbCFu9JTu0+8qB4jMxfx1la6byi3GoSTfbnNOLfWv8sw==}
engines: {node: '>=14.0.0'}
cpu: [arm64]
os: [win32]
- sass-embedded-win32-arm64@1.97.3:
- resolution: {integrity: sha512-RDGtRS1GVvQfMGAmVXNxYiUOvPzn9oO1zYB/XUM9fudDRnieYTcUytpNTQZLs6Y1KfJxgt5Y+giRceC92fT8Uw==}
- engines: {node: '>=14.0.0'}
- cpu: [arm64]
- os: [win32]
-
sass-embedded-win32-x64@1.104.1:
resolution: {integrity: sha512-/c4N2A93Ckms6DuRFVftKYISuI1tyC8gmlVJ8WaWFzgCBN/Swq2rARJIBUNeuxlmxjmYXfd3+2f/u887K63wbA==}
engines: {node: '>=14.0.0'}
cpu: [x64]
os: [win32]
- sass-embedded-win32-x64@1.97.3:
- resolution: {integrity: sha512-SFRa2lED9UEwV6vIGeBXeBOLKF+rowF3WmNfb/BzhxmdAsKofCXrJ8ePW7OcDVrvNEbTOGwhsReIsF5sH8fVaw==}
- engines: {node: '>=14.0.0'}
- cpu: [x64]
- os: [win32]
-
sass-embedded@1.104.1:
resolution: {integrity: sha512-7LxbtPJ1MWKVbhzOnGx1sHTkHTcHVJ9hbgVsU29p/8gY1VeXt19fcJFr5xsx2f6zfrrR3FeOcYMt0uYDLAxpgw==}
engines: {node: '>=20.19.0'}
hasBin: true
- sass-embedded@1.97.3:
- resolution: {integrity: sha512-eKzFy13Nk+IRHhlAwP3sfuv+PzOrvzUkwJK2hdoCKYcWGSdmwFpeGpWmyewdw8EgBnsKaSBtgf/0b2K635ecSA==}
- engines: {node: '>=16.0.0'}
- hasBin: true
-
- sass@1.101.0:
- resolution: {integrity: sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==}
- engines: {node: '>=20.19.0'}
- hasBin: true
-
sass@1.104.1:
resolution: {integrity: sha512-yDA+1aIG3EHgN4V/BvuhCvu61FF6hEd4e+9DxikUm9U0CAGuvdIZ/UYy7qbOxjhbbWQraoyLlMuzdRGOSV5Bmw==}
engines: {node: '>=20.19.0'}
hasBin: true
- sass@1.97.3:
- resolution: {integrity: sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==}
- engines: {node: '>=14.0.0'}
- hasBin: true
-
sax@1.6.1:
resolution: {integrity: sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==}
engines: {node: '>=11.0.0'}
@@ -5400,7 +5165,7 @@ snapshots:
'@angular-devkit/core@22.2.1(chokidar@5.0.0)':
dependencies:
ajv: 8.20.0
- ajv-formats: 3.0.1(ajv@8.20.0)
+ ajv-formats: 3.0.1
jsonc-parser: 3.3.1
picomatch: 4.0.7
rxjs: 7.8.2
@@ -6439,9 +6204,6 @@ snapshots:
'@oxc-parser/binding-win32-x64-msvc@0.150.0':
optional: true
- '@oxc-project/types@0.142.0':
- optional: true
-
'@oxc-project/types@0.149.0': {}
'@oxc-project/types@0.150.0': {}
@@ -6524,126 +6286,84 @@ snapshots:
'@rolldown/binding-android-arm64@1.2.12':
optional: true
- '@rolldown/binding-android-arm64@1.2.2':
- optional: true
-
'@rolldown/binding-android-arm64@1.2.8':
optional: true
'@rolldown/binding-darwin-arm64@1.2.12':
optional: true
- '@rolldown/binding-darwin-arm64@1.2.2':
- optional: true
-
'@rolldown/binding-darwin-arm64@1.2.8':
optional: true
'@rolldown/binding-darwin-x64@1.2.12':
optional: true
- '@rolldown/binding-darwin-x64@1.2.2':
- optional: true
-
'@rolldown/binding-darwin-x64@1.2.8':
optional: true
'@rolldown/binding-freebsd-x64@1.2.12':
optional: true
- '@rolldown/binding-freebsd-x64@1.2.2':
- optional: true
-
'@rolldown/binding-freebsd-x64@1.2.8':
optional: true
'@rolldown/binding-linux-arm-gnueabihf@1.2.12':
optional: true
- '@rolldown/binding-linux-arm-gnueabihf@1.2.2':
- optional: true
-
'@rolldown/binding-linux-arm-gnueabihf@1.2.8':
optional: true
'@rolldown/binding-linux-arm64-gnu@1.2.12':
optional: true
- '@rolldown/binding-linux-arm64-gnu@1.2.2':
- optional: true
-
'@rolldown/binding-linux-arm64-gnu@1.2.8':
optional: true
'@rolldown/binding-linux-arm64-musl@1.2.12':
optional: true
- '@rolldown/binding-linux-arm64-musl@1.2.2':
- optional: true
-
'@rolldown/binding-linux-arm64-musl@1.2.8':
optional: true
'@rolldown/binding-linux-ppc64-gnu@1.2.12':
optional: true
- '@rolldown/binding-linux-ppc64-gnu@1.2.2':
- optional: true
-
'@rolldown/binding-linux-ppc64-gnu@1.2.8':
optional: true
'@rolldown/binding-linux-s390x-gnu@1.2.12':
optional: true
- '@rolldown/binding-linux-s390x-gnu@1.2.2':
- optional: true
-
'@rolldown/binding-linux-s390x-gnu@1.2.8':
optional: true
'@rolldown/binding-linux-x64-gnu@1.2.12':
optional: true
- '@rolldown/binding-linux-x64-gnu@1.2.2':
- optional: true
-
'@rolldown/binding-linux-x64-gnu@1.2.8':
optional: true
'@rolldown/binding-linux-x64-musl@1.2.12':
optional: true
- '@rolldown/binding-linux-x64-musl@1.2.2':
- optional: true
-
'@rolldown/binding-linux-x64-musl@1.2.8':
optional: true
'@rolldown/binding-openharmony-arm64@1.2.12':
optional: true
- '@rolldown/binding-openharmony-arm64@1.2.2':
- optional: true
-
'@rolldown/binding-openharmony-arm64@1.2.8':
optional: true
'@rolldown/binding-win32-arm64-msvc@1.2.12':
optional: true
- '@rolldown/binding-win32-arm64-msvc@1.2.2':
- optional: true
-
'@rolldown/binding-win32-arm64-msvc@1.2.8':
optional: true
'@rolldown/binding-win32-x64-msvc@1.2.12':
optional: true
- '@rolldown/binding-win32-x64-msvc@1.2.2':
- optional: true
-
'@rolldown/binding-win32-x64-msvc@1.2.8':
optional: true
@@ -6796,7 +6516,7 @@ snapshots:
dependencies:
ajv: 8.20.0
ajv-draft-04: 1.0.0(ajv@8.20.0)
- ajv-formats: 3.0.1(ajv@8.20.0)
+ ajv-formats: 3.0.1
fs-extra: 11.3.6
import-lazy: 4.0.0
jju: 1.4.0
@@ -7282,13 +7002,13 @@ snapshots:
ajv: 8.20.0
optional: true
- ajv-formats@2.1.1(ajv@8.20.0):
- optionalDependencies:
+ ajv-formats@2.1.1:
+ dependencies:
ajv: 8.20.0
optional: true
- ajv-formats@3.0.1(ajv@8.20.0):
- optionalDependencies:
+ ajv-formats@3.0.1:
+ dependencies:
ajv: 8.20.0
ajv-keywords@5.1.0(ajv@8.20.0):
@@ -7538,11 +7258,6 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
- chokidar@4.0.3:
- dependencies:
- readdirp: 4.1.2
- optional: true
-
chokidar@5.0.0:
dependencies:
readdirp: 5.0.0
@@ -7577,9 +7292,6 @@ snapshots:
strip-ansi: 7.2.0
wrap-ansi: 9.0.2
- colorjs.io@0.5.2:
- optional: true
-
colorjs.io@0.7.1: {}
combined-stream@1.0.8:
@@ -9160,9 +8872,6 @@ snapshots:
dependencies:
picomatch: 2.3.2
- readdirp@4.1.2:
- optional: true
-
readdirp@5.0.0: {}
reflect-metadata@0.2.2: {}
@@ -9234,27 +8943,6 @@ snapshots:
'@rolldown/binding-win32-arm64-msvc': 1.2.12
'@rolldown/binding-win32-x64-msvc': 1.2.12
- rolldown@1.2.2:
- dependencies:
- '@oxc-project/types': 0.142.0
- '@rolldown/pluginutils': 1.0.1
- optionalDependencies:
- '@rolldown/binding-android-arm64': 1.2.2
- '@rolldown/binding-darwin-arm64': 1.2.2
- '@rolldown/binding-darwin-x64': 1.2.2
- '@rolldown/binding-freebsd-x64': 1.2.2
- '@rolldown/binding-linux-arm-gnueabihf': 1.2.2
- '@rolldown/binding-linux-arm64-gnu': 1.2.2
- '@rolldown/binding-linux-arm64-musl': 1.2.2
- '@rolldown/binding-linux-ppc64-gnu': 1.2.2
- '@rolldown/binding-linux-s390x-gnu': 1.2.2
- '@rolldown/binding-linux-x64-gnu': 1.2.2
- '@rolldown/binding-linux-x64-musl': 1.2.2
- '@rolldown/binding-openharmony-arm64': 1.2.2
- '@rolldown/binding-win32-arm64-msvc': 1.2.2
- '@rolldown/binding-win32-x64-msvc': 1.2.2
- optional: true
-
rolldown@1.2.8:
dependencies:
'@oxc-project/types': 0.149.0
@@ -9338,117 +9026,59 @@ snapshots:
sass: 1.104.1
optional: true
- sass-embedded-all-unknown@1.97.3:
- dependencies:
- sass: 1.97.3
- optional: true
-
sass-embedded-android-arm64@1.104.1:
optional: true
- sass-embedded-android-arm64@1.97.3:
- optional: true
-
sass-embedded-android-arm@1.104.1:
optional: true
- sass-embedded-android-arm@1.97.3:
- optional: true
-
sass-embedded-android-riscv64@1.104.1:
optional: true
- sass-embedded-android-riscv64@1.97.3:
- optional: true
-
sass-embedded-android-x64@1.104.1:
optional: true
- sass-embedded-android-x64@1.97.3:
- optional: true
-
sass-embedded-darwin-arm64@1.104.1:
optional: true
- sass-embedded-darwin-arm64@1.97.3:
- optional: true
-
sass-embedded-darwin-x64@1.104.1:
optional: true
- sass-embedded-darwin-x64@1.97.3:
- optional: true
-
sass-embedded-linux-arm64@1.104.1:
optional: true
- sass-embedded-linux-arm64@1.97.3:
- optional: true
-
sass-embedded-linux-arm@1.104.1:
optional: true
- sass-embedded-linux-arm@1.97.3:
- optional: true
-
sass-embedded-linux-musl-arm64@1.104.1:
optional: true
- sass-embedded-linux-musl-arm64@1.97.3:
- optional: true
-
sass-embedded-linux-musl-arm@1.104.1:
optional: true
- sass-embedded-linux-musl-arm@1.97.3:
- optional: true
-
sass-embedded-linux-musl-riscv64@1.104.1:
optional: true
- sass-embedded-linux-musl-riscv64@1.97.3:
- optional: true
-
sass-embedded-linux-musl-x64@1.104.1:
optional: true
- sass-embedded-linux-musl-x64@1.97.3:
- optional: true
-
sass-embedded-linux-riscv64@1.104.1:
optional: true
- sass-embedded-linux-riscv64@1.97.3:
- optional: true
-
sass-embedded-linux-x64@1.104.1:
optional: true
- sass-embedded-linux-x64@1.97.3:
- optional: true
-
sass-embedded-unknown-all@1.104.1:
dependencies:
sass: 1.104.1
optional: true
- sass-embedded-unknown-all@1.97.3:
- dependencies:
- sass: 1.97.3
- optional: true
-
sass-embedded-win32-arm64@1.104.1:
optional: true
- sass-embedded-win32-arm64@1.97.3:
- optional: true
-
sass-embedded-win32-x64@1.104.1:
optional: true
- sass-embedded-win32-x64@1.97.3:
- optional: true
-
sass-embedded@1.104.1:
dependencies:
'@bufbuild/protobuf': 2.13.0
@@ -9478,45 +9108,6 @@ snapshots:
sass-embedded-win32-arm64: 1.104.1
sass-embedded-win32-x64: 1.104.1
- sass-embedded@1.97.3:
- dependencies:
- '@bufbuild/protobuf': 2.13.0
- colorjs.io: 0.5.2
- immutable: 5.1.9
- rxjs: 7.8.2
- supports-color: 8.1.1
- sync-child-process: 1.0.2
- varint: 6.0.0
- optionalDependencies:
- sass-embedded-all-unknown: 1.97.3
- sass-embedded-android-arm: 1.97.3
- sass-embedded-android-arm64: 1.97.3
- sass-embedded-android-riscv64: 1.97.3
- sass-embedded-android-x64: 1.97.3
- sass-embedded-darwin-arm64: 1.97.3
- sass-embedded-darwin-x64: 1.97.3
- sass-embedded-linux-arm: 1.97.3
- sass-embedded-linux-arm64: 1.97.3
- sass-embedded-linux-musl-arm: 1.97.3
- sass-embedded-linux-musl-arm64: 1.97.3
- sass-embedded-linux-musl-riscv64: 1.97.3
- sass-embedded-linux-musl-x64: 1.97.3
- sass-embedded-linux-riscv64: 1.97.3
- sass-embedded-linux-x64: 1.97.3
- sass-embedded-unknown-all: 1.97.3
- sass-embedded-win32-arm64: 1.97.3
- sass-embedded-win32-x64: 1.97.3
- optional: true
-
- sass@1.101.0:
- dependencies:
- chokidar: 5.0.0
- immutable: 5.1.9
- source-map-js: 1.2.1
- optionalDependencies:
- '@parcel/watcher': 2.6.0
- optional: true
-
sass@1.104.1:
dependencies:
chokidar: 5.0.0
@@ -9525,15 +9116,6 @@ snapshots:
optionalDependencies:
'@parcel/watcher': 2.6.0
- sass@1.97.3:
- dependencies:
- chokidar: 4.0.3
- immutable: 5.1.9
- source-map-js: 1.2.1
- optionalDependencies:
- '@parcel/watcher': 2.6.0
- optional: true
-
sax@1.6.1:
optional: true
@@ -9545,7 +9127,7 @@ snapshots:
dependencies:
'@types/json-schema': 7.0.15
ajv: 8.20.0
- ajv-formats: 2.1.1(ajv@8.20.0)
+ ajv-formats: 2.1.1
ajv-keywords: 5.1.0(ajv@8.20.0)
optional: true
@@ -9936,7 +9518,7 @@ snapshots:
universalify@2.0.1: {}
- unplugin-dts@1.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.2)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)):
+ unplugin-dts@1.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.12)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)):
dependencies:
'@rollup/pluginutils': 5.4.0(rollup@4.60.4)
'@volar/typescript': 2.4.28(typescript@6.0.2)
@@ -9952,7 +9534,7 @@ snapshots:
'@microsoft/api-extractor': 7.56.0(@types/node@26.6.4)
'@rspack/core': 1.6.8(@swc/helpers@0.5.18)
esbuild: 0.28.2
- rolldown: 1.2.2
+ rolldown: 1.2.12
rollup: 4.60.4
vite: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)
webpack: 5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)
@@ -9982,14 +9564,14 @@ snapshots:
verkit@0.3.2: {}
- vite-live-preview@0.4.0(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.97.3)(sass@1.101.0)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)):
+ vite-live-preview@0.4.0(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)):
dependencies:
'@seahax/deep-copy': 0.1.0
'@seahax/semaphore': 0.5.1
'@types/ws': 8.18.1
escape-goat: 4.0.0
strip-ansi: 7.2.0
- vite: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.97.3)(sass@1.101.0)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)
+ vite: 8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)
ws: 8.21.1
transitivePeerDependencies:
- bufferutil
@@ -10010,9 +9592,9 @@ snapshots:
optionator: 0.9.4
typescript: 6.0.2
- vite-plugin-dts@5.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.2)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)):
+ vite-plugin-dts@5.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.12)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)):
dependencies:
- unplugin-dts: 1.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.2)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28))
+ unplugin-dts: 1.1.2(@microsoft/api-extractor@7.56.0(@types/node@26.6.4))(@rspack/core@1.6.8(@swc/helpers@0.5.18))(esbuild@0.28.2)(rolldown@1.2.12)(rollup@4.60.4)(supports-color@10.2.2)(typescript@6.0.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0))(webpack@5.106.2(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28))
optionalDependencies:
'@microsoft/api-extractor': 7.56.0(@types/node@26.6.4)
rollup: 4.60.4
@@ -10072,25 +9654,6 @@ snapshots:
tsx: 4.23.15
yaml: 2.9.0
- vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.97.3)(sass@1.101.0)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0):
- dependencies:
- lightningcss: 1.33.0
- picomatch: 4.0.7
- postcss: 8.5.28
- rolldown: 1.2.12
- tinyglobby: 0.2.17
- optionalDependencies:
- '@types/node': 26.6.4
- esbuild: 0.28.2
- fsevents: 2.3.3
- jiti: 2.7.0
- less: 4.6.4
- sass: 1.101.0
- sass-embedded: 1.97.3
- terser: 5.46.2
- tsx: 4.23.15
- yaml: 2.9.0
-
vitest@5.0.3(@types/node@26.6.4)(@vitest/coverage-v8@5.0.3)(@vitest/ui@5.0.3)(happy-dom@20.14.5)(jsdom@30.1.2)(vite@8.3.2(@types/node@26.6.4)(esbuild@0.28.2)(jiti@2.7.0)(less@4.6.4)(sass-embedded@1.104.1)(sass@1.104.1)(terser@5.46.2)(tsx@4.23.15)(yaml@2.9.0)):
dependencies:
'@types/chai': 5.2.3
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 03d4f60051..bbe85fa79b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -7,153 +7,153 @@ importers:
configDependencies: {}
packageManagerDependencies:
pnpm:
- specifier: 12.15.0
- version: 12.15.0
+ specifier: 12.18.0
+ version: 12.18.0
packages:
- '@pnpm/exe.android-arm64@12.15.0':
- resolution: {integrity: sha512-eVCqmscY70LGvgRzu3mi8IBWBFGix+a6mNZoWmXxESsBdeiKEF9xQSuaeel10yn+zI7TXy2jlI63vFLzETk+aQ==}
+ '@pnpm/exe.android-arm64@12.18.0':
+ resolution: {integrity: sha512-fOF6IwgvnUKEmVedGqiAsNPfN2Ry8GvaqzSQOiF3RJFbpBfPKO/6YT54s1GjToyYinRxw9preHHPe4y2N3SzhA==}
cpu: [arm64]
os: [android]
- '@pnpm/exe.android-x64@12.15.0':
- resolution: {integrity: sha512-Gx/WbkFcdUFUg8g8AShezcS9EiQxfYvdAm2hfKLO8sfJmJvKOCt5fzlgHWDzmGhoclibgW+tUGZ/KF4F4wOTCA==}
+ '@pnpm/exe.android-x64@12.18.0':
+ resolution: {integrity: sha512-6OiolnaCsB3/GcJ9XNrenbUH3zFHRJ+5QynrMUUEyThbgnnCzWxa199hpQlOmxN4rAXuYQ0IYgWFNUZxyzg31Q==}
cpu: [x64]
os: [android]
- '@pnpm/exe.darwin-arm64@12.15.0':
- resolution: {integrity: sha512-N0ZykiDWCvqSBJvt71j7cSoBR993FqvYZFtmpCtqvW3pguiI+NAgraLPA5OTwu5mV+/d8hYpVcPktJA3xFDLtA==}
+ '@pnpm/exe.darwin-arm64@12.18.0':
+ resolution: {integrity: sha512-zkq+4YzVIX39ETYLyC3W7LY7MpHEU/J3nRhHl4i2yPld2Cf2+rEKRh3ejJ4AmaQ77HHJLCktY4Z3jq0fpcxFXg==}
cpu: [arm64]
os: [darwin]
- '@pnpm/exe.darwin-x64@12.15.0':
- resolution: {integrity: sha512-7Ntr2HlBUxzwWOg7NwDxCbRW/3vXuqKO+hcXm+w3SBi9rrHY53li1wLqWVT7Gjxd+lVEHM1QJZo6WJEGFU8C6A==}
+ '@pnpm/exe.darwin-x64@12.18.0':
+ resolution: {integrity: sha512-qMsL9qx92unOTa6hgkfiTJv8ceZaTx0IQg7InhYDVX2ZrTECujaVEEVypnJK5m3eGUsP1KD7Y4qIgleCwfRsYw==}
cpu: [x64]
os: [darwin]
- '@pnpm/exe.freebsd-x64@12.15.0':
- resolution: {integrity: sha512-btOiyL7fL7W4uQGH0aqFai2TNC3IoKcZ7gNHBVbEFZt2dWrnrD0SufL3iGs3fLlmb4OtuU35uf4Zpr9V9Jh9mA==}
+ '@pnpm/exe.freebsd-x64@12.18.0':
+ resolution: {integrity: sha512-/9vy/4ms52cU4MjZ5NhHd6N2d9L9W0kARf5/ff2tweAHu0VeUzs/0qp/7ZHFuddm2Wa/m0AKQoPum9AVUCqKsw==}
cpu: [x64]
os: [freebsd]
- '@pnpm/exe.linux-arm64-musl@12.15.0':
- resolution: {integrity: sha512-pNC38k+O+90FOjbPNSnw0E7apq1PKTmz3fFe1amn+lys/U5kL++uzir8bRiho8ONcyA3d9EU7wdqcY0DKkj+JA==}
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
+ resolution: {integrity: sha512-Vp+TIMPPyackVCXkOdEKH/RmAn/r07EcIyrgZYQK7VrkksqZOie0GnWIx+85mPqeFEYCRtXIZAFJ9L4ceTndDg==}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-arm64@12.15.0':
- resolution: {integrity: sha512-qML/8aCXslh8td/w4U+HJNqUcZ2+m6EfTbWScIzZRmyPsRFN+xB4LP1U/hymxc1iSJiKtG56HJx2fvUErWFIGw==}
+ '@pnpm/exe.linux-arm64@12.18.0':
+ resolution: {integrity: sha512-2dpyVBCHT+FfpuQh9i+7MXAqNWYLCvD5vYr5p6Eimxoga8USLnjbUgyj72AOrO0hjc5ri3TEFP3jiyBHjkSZpQ==}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-ppc64@12.15.0':
- resolution: {integrity: sha512-tjRDUUl7RCJ6T/6eoNPxOqkwU4Mzi5RtTXmSAxujyz37OTwwsMU7Ps087Zk4gHcUvRSeyF40ZFsew3vtE+nmUA==}
+ '@pnpm/exe.linux-ppc64@12.18.0':
+ resolution: {integrity: sha512-BBOOOfNJ2QwIIya3eKqOjiN4WNTszfRz7HCvw9XggcT7+ftMjNP8XJ/GfW+ltCBeUFR9d8WBVsr2m/NLjX2CZQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-riscv64@12.15.0':
- resolution: {integrity: sha512-bF1uBWEfbwaeryz6lIiaJ8AWD082otZfvzGX5l+6LZRpRwUEpJHUsJrORaYP5/cNMv5ZR2p6TvvcJcQzwtDzmw==}
+ '@pnpm/exe.linux-riscv64@12.18.0':
+ resolution: {integrity: sha512-7kMN77xSOYJX8GPSH5RbNAc5oM61LMmcSUukDDUwllnZPXm8GRPskCNsTWy8SCw01Kr1FB+5SwGNMiTdiziLNQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-s390x@12.15.0':
- resolution: {integrity: sha512-zKMhIzsexYMToeLmqV5jPsvV/f9vwsJb2kUH2NFYzalbxImeBrlA4kL7GwF8gD4pagV6jYYcJb8RjbZIdjHptg==}
+ '@pnpm/exe.linux-s390x@12.18.0':
+ resolution: {integrity: sha512-htuSCpEcmDzhKoJqXbPkvfr176dBHU0QIF5mWcRiqxRXAB/1JoYiMYotfjWpk+ztgpB9qlx4XnWlLFAf7gzc6g==}
cpu: [s390x]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-x64-musl@12.15.0':
- resolution: {integrity: sha512-A9J0Jg0Rdx+qQU4qXtwyST5tto9IOu1zi4fDk35nbc6DWahggbcKtFvZPKFwL2qgUXGXOX//hXv6z/sp6emO8A==}
+ '@pnpm/exe.linux-x64-musl@12.18.0':
+ resolution: {integrity: sha512-Uj+vzfIQ62kDP10x36yHZIXVs5ohdNtiPYwn5FhCLlNScHPo0OAI+ShGDtLofiBXKE7umu71Jmjm7N8a8zVcDw==}
cpu: [x64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-x64@12.15.0':
- resolution: {integrity: sha512-yc+QlZR+9+nr29J4fRzhMoapgxTBDndq/+peyoq1XUufnQFnfbXUMFudDIKzHi545linGqmOmXfn0NoufNgcOg==}
+ '@pnpm/exe.linux-x64@12.18.0':
+ resolution: {integrity: sha512-OJ+X2wcraldCwj75pCIerWARQSRpdfj0eBTs/2ODyhfeW46ylOnjTIE/GKra6Mn6E72/gBmXS8igrUioa+F9fQ==}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.win32-arm64@12.15.0':
- resolution: {integrity: sha512-fPXZxuY1VclkOga9bc53qNCXcegfeoBR8+Ue+AospDwKzuGGSHll0oDxkLfkmpjyRqpe7bH5DyQPYp/xSMaIVA==}
+ '@pnpm/exe.win32-arm64@12.18.0':
+ resolution: {integrity: sha512-wEY6jiACGcbhhi5yD59doHqNTndS7AaujaPmtWAu1DKkHru2hy5fJ9yUGecW72Ypaw2/I3BEprfMOopap2NQtw==}
cpu: [arm64]
os: [win32]
- '@pnpm/exe.win32-x64@12.15.0':
- resolution: {integrity: sha512-nrd+Tp1We1DGj4DGG5Bea9lZNh9y1PjlLBdEwdInS4D0h0UIDtM7JaGGGDJhNzIwcHASyihWI7HLV+dtG+fhYg==}
+ '@pnpm/exe.win32-x64@12.18.0':
+ resolution: {integrity: sha512-5FJkghO7RLRkQpWxeVEygW9XsmnNuxzPfXbgwFWCHsFyFhpDn/vOdL88ToQEM0Kt5igdW5s6U0/IDH8Dvkt3pg==}
cpu: [x64]
os: [win32]
- pnpm@12.15.0:
- resolution: {integrity: sha512-s5UdbW/0qfE9x89WzSjSuOs328ycaOUuHhGRhz6p+CoBcoerULqtxczElPA2xnwOR+sTYIwvo29HcRth6hKOYQ==}
+ pnpm@12.18.0:
+ resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==}
engines: {node: '>=18'}
hasBin: true
snapshots:
- '@pnpm/exe.android-arm64@12.15.0':
+ '@pnpm/exe.android-arm64@12.18.0':
optional: true
- '@pnpm/exe.android-x64@12.15.0':
+ '@pnpm/exe.android-x64@12.18.0':
optional: true
- '@pnpm/exe.darwin-arm64@12.15.0':
+ '@pnpm/exe.darwin-arm64@12.18.0':
optional: true
- '@pnpm/exe.darwin-x64@12.15.0':
+ '@pnpm/exe.darwin-x64@12.18.0':
optional: true
- '@pnpm/exe.freebsd-x64@12.15.0':
+ '@pnpm/exe.freebsd-x64@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64-musl@12.15.0':
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64@12.15.0':
+ '@pnpm/exe.linux-arm64@12.18.0':
optional: true
- '@pnpm/exe.linux-ppc64@12.15.0':
+ '@pnpm/exe.linux-ppc64@12.18.0':
optional: true
- '@pnpm/exe.linux-riscv64@12.15.0':
+ '@pnpm/exe.linux-riscv64@12.18.0':
optional: true
- '@pnpm/exe.linux-s390x@12.15.0':
+ '@pnpm/exe.linux-s390x@12.18.0':
optional: true
- '@pnpm/exe.linux-x64-musl@12.15.0':
+ '@pnpm/exe.linux-x64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-x64@12.15.0':
+ '@pnpm/exe.linux-x64@12.18.0':
optional: true
- '@pnpm/exe.win32-arm64@12.15.0':
+ '@pnpm/exe.win32-arm64@12.18.0':
optional: true
- '@pnpm/exe.win32-x64@12.15.0':
+ '@pnpm/exe.win32-x64@12.18.0':
optional: true
- pnpm@12.15.0:
+ pnpm@12.18.0:
optionalDependencies:
- '@pnpm/exe.android-arm64': 12.15.0
- '@pnpm/exe.android-x64': 12.15.0
- '@pnpm/exe.darwin-arm64': 12.15.0
- '@pnpm/exe.darwin-x64': 12.15.0
- '@pnpm/exe.freebsd-x64': 12.15.0
- '@pnpm/exe.linux-arm64': 12.15.0
- '@pnpm/exe.linux-arm64-musl': 12.15.0
- '@pnpm/exe.linux-ppc64': 12.15.0
- '@pnpm/exe.linux-riscv64': 12.15.0
- '@pnpm/exe.linux-s390x': 12.15.0
- '@pnpm/exe.linux-x64': 12.15.0
- '@pnpm/exe.linux-x64-musl': 12.15.0
- '@pnpm/exe.win32-arm64': 12.15.0
- '@pnpm/exe.win32-x64': 12.15.0
+ '@pnpm/exe.android-arm64': 12.18.0
+ '@pnpm/exe.android-x64': 12.18.0
+ '@pnpm/exe.darwin-arm64': 12.18.0
+ '@pnpm/exe.darwin-x64': 12.18.0
+ '@pnpm/exe.freebsd-x64': 12.18.0
+ '@pnpm/exe.linux-arm64': 12.18.0
+ '@pnpm/exe.linux-arm64-musl': 12.18.0
+ '@pnpm/exe.linux-ppc64': 12.18.0
+ '@pnpm/exe.linux-riscv64': 12.18.0
+ '@pnpm/exe.linux-s390x': 12.18.0
+ '@pnpm/exe.linux-x64': 12.18.0
+ '@pnpm/exe.linux-x64-musl': 12.18.0
+ '@pnpm/exe.win32-arm64': 12.18.0
+ '@pnpm/exe.win32-x64': 12.18.0
---
lockfileVersion: '9.0'
diff --git a/render-wasm/README.md b/render-wasm/README.md
index a6e0c1e25a..48a6a3cb81 100644
--- a/render-wasm/README.md
+++ b/render-wasm/README.md
@@ -52,6 +52,12 @@ Each target keeps its own `CARGO_TARGET_DIR` (`target/`), so switching
between them does not invalidate the other's cache. Set `BUILD_MODE=release`
(or `NODE_ENV=production`) for an optimized build; the default is `debug`.
+Set `PENPOT_WASM_PREPARED=1` when the pinned Rust toolchain is selected, its
+Emscripten target is installed, and this package's Node dependencies are
+installed. `./build`, `./test`, `./lint` and `./fmt` then skip `rustup` setup
+and `pnpm install`. Benchmark preparation sets this flag for each retained
+build.
+
### Serialize builds in one checkout
All targets in one checkout share one `flock` lock stored at
diff --git a/render-wasm/_build_env b/render-wasm/_build_env
index c8d1fdd1e5..5c804469d0 100644
--- a/render-wasm/_build_env
+++ b/render-wasm/_build_env
@@ -164,6 +164,11 @@ function setup_rust {
}
function setup {
+ if [ "${PENPOT_WASM_PREPARED:-}" = "1" ]; then
+ echo "Skipping rustup and pnpm setup (PENPOT_WASM_PREPARED=1)" >&2
+ return 0
+ fi
+
setup_rust
pnpm install;
}
diff --git a/render-wasm/build b/render-wasm/build
index c4061068f2..c033654c5f 100755
--- a/render-wasm/build
+++ b/render-wasm/build
@@ -3,7 +3,9 @@
# Usage: ./build [frontend|export] [extra cargo params...]
#
# With no target, builds both. Set BUILD_MODE=release (or NODE_ENV=production)
-# for an optimized build. See `_build_env` for what each target changes.
+# for an optimized build. Set PENPOT_WASM_PREPARED=1 when the pinned toolchain
+# and Node dependencies are prepared to skip their setup. See `_build_env` for
+# what each target changes.
_SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
_RENDER_TARGET=${1:-}
diff --git a/render-wasm/fmt b/render-wasm/fmt
new file mode 100755
index 0000000000..b7a9b8118f
--- /dev/null
+++ b/render-wasm/fmt
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# Usage: ./fmt [--check] [extra cargo fmt params...]
+#
+# Formats the crate with the Rust toolchain pinned in `_build_env`. Set
+# PENPOT_WASM_PREPARED=1 to skip the toolchain setup.
+
+set -e
+
+_SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
+pushd "$_SCRIPT_DIR" > /dev/null
+
+. ./_build_env frontend
+
+setup
+cargo fmt "$@"
+
+popd > /dev/null
diff --git a/render-wasm/lint b/render-wasm/lint
index 097a4314cf..ca605e8ec9 100755
--- a/render-wasm/lint
+++ b/render-wasm/lint
@@ -10,6 +10,8 @@ fi
. ./_build_env frontend
+setup || exit $?
+
ALLOWED_RULES="-D static_mut_refs"
# ./lint --fix
diff --git a/render-wasm/package.json b/render-wasm/package.json
index 96253a6356..a7a15fb5f0 100644
--- a/render-wasm/package.json
+++ b/render-wasm/package.json
@@ -4,7 +4,7 @@
"license": "MPL-2.0",
"author": "Kaleidos INC Sucursal en España SL",
"private": true,
- "packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
+ "packageManager": "pnpm@12.18.0+sha512.9d7882d5dc82147ecfc4e062aa34834e0ad0296710a1837a1115ae012127d36b7109e321ac1598a1dd0a65597681b1e99917e12ed0d749eae91187943363beb3",
"repository": {
"type": "git",
"url": "https://github.com/penpot/penpot"
diff --git a/render-wasm/pnpm-lock.yaml b/render-wasm/pnpm-lock.yaml
index 9ef64d85bd..452e972384 100644
--- a/render-wasm/pnpm-lock.yaml
+++ b/render-wasm/pnpm-lock.yaml
@@ -7,153 +7,153 @@ importers:
configDependencies: {}
packageManagerDependencies:
pnpm:
- specifier: 12.15.0
- version: 12.15.0
+ specifier: 12.18.0
+ version: 12.18.0
packages:
- '@pnpm/exe.android-arm64@12.15.0':
- resolution: {integrity: sha512-eVCqmscY70LGvgRzu3mi8IBWBFGix+a6mNZoWmXxESsBdeiKEF9xQSuaeel10yn+zI7TXy2jlI63vFLzETk+aQ==}
+ '@pnpm/exe.android-arm64@12.18.0':
+ resolution: {integrity: sha512-fOF6IwgvnUKEmVedGqiAsNPfN2Ry8GvaqzSQOiF3RJFbpBfPKO/6YT54s1GjToyYinRxw9preHHPe4y2N3SzhA==}
cpu: [arm64]
os: [android]
- '@pnpm/exe.android-x64@12.15.0':
- resolution: {integrity: sha512-Gx/WbkFcdUFUg8g8AShezcS9EiQxfYvdAm2hfKLO8sfJmJvKOCt5fzlgHWDzmGhoclibgW+tUGZ/KF4F4wOTCA==}
+ '@pnpm/exe.android-x64@12.18.0':
+ resolution: {integrity: sha512-6OiolnaCsB3/GcJ9XNrenbUH3zFHRJ+5QynrMUUEyThbgnnCzWxa199hpQlOmxN4rAXuYQ0IYgWFNUZxyzg31Q==}
cpu: [x64]
os: [android]
- '@pnpm/exe.darwin-arm64@12.15.0':
- resolution: {integrity: sha512-N0ZykiDWCvqSBJvt71j7cSoBR993FqvYZFtmpCtqvW3pguiI+NAgraLPA5OTwu5mV+/d8hYpVcPktJA3xFDLtA==}
+ '@pnpm/exe.darwin-arm64@12.18.0':
+ resolution: {integrity: sha512-zkq+4YzVIX39ETYLyC3W7LY7MpHEU/J3nRhHl4i2yPld2Cf2+rEKRh3ejJ4AmaQ77HHJLCktY4Z3jq0fpcxFXg==}
cpu: [arm64]
os: [darwin]
- '@pnpm/exe.darwin-x64@12.15.0':
- resolution: {integrity: sha512-7Ntr2HlBUxzwWOg7NwDxCbRW/3vXuqKO+hcXm+w3SBi9rrHY53li1wLqWVT7Gjxd+lVEHM1QJZo6WJEGFU8C6A==}
+ '@pnpm/exe.darwin-x64@12.18.0':
+ resolution: {integrity: sha512-qMsL9qx92unOTa6hgkfiTJv8ceZaTx0IQg7InhYDVX2ZrTECujaVEEVypnJK5m3eGUsP1KD7Y4qIgleCwfRsYw==}
cpu: [x64]
os: [darwin]
- '@pnpm/exe.freebsd-x64@12.15.0':
- resolution: {integrity: sha512-btOiyL7fL7W4uQGH0aqFai2TNC3IoKcZ7gNHBVbEFZt2dWrnrD0SufL3iGs3fLlmb4OtuU35uf4Zpr9V9Jh9mA==}
+ '@pnpm/exe.freebsd-x64@12.18.0':
+ resolution: {integrity: sha512-/9vy/4ms52cU4MjZ5NhHd6N2d9L9W0kARf5/ff2tweAHu0VeUzs/0qp/7ZHFuddm2Wa/m0AKQoPum9AVUCqKsw==}
cpu: [x64]
os: [freebsd]
- '@pnpm/exe.linux-arm64-musl@12.15.0':
- resolution: {integrity: sha512-pNC38k+O+90FOjbPNSnw0E7apq1PKTmz3fFe1amn+lys/U5kL++uzir8bRiho8ONcyA3d9EU7wdqcY0DKkj+JA==}
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
+ resolution: {integrity: sha512-Vp+TIMPPyackVCXkOdEKH/RmAn/r07EcIyrgZYQK7VrkksqZOie0GnWIx+85mPqeFEYCRtXIZAFJ9L4ceTndDg==}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-arm64@12.15.0':
- resolution: {integrity: sha512-qML/8aCXslh8td/w4U+HJNqUcZ2+m6EfTbWScIzZRmyPsRFN+xB4LP1U/hymxc1iSJiKtG56HJx2fvUErWFIGw==}
+ '@pnpm/exe.linux-arm64@12.18.0':
+ resolution: {integrity: sha512-2dpyVBCHT+FfpuQh9i+7MXAqNWYLCvD5vYr5p6Eimxoga8USLnjbUgyj72AOrO0hjc5ri3TEFP3jiyBHjkSZpQ==}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-ppc64@12.15.0':
- resolution: {integrity: sha512-tjRDUUl7RCJ6T/6eoNPxOqkwU4Mzi5RtTXmSAxujyz37OTwwsMU7Ps087Zk4gHcUvRSeyF40ZFsew3vtE+nmUA==}
+ '@pnpm/exe.linux-ppc64@12.18.0':
+ resolution: {integrity: sha512-BBOOOfNJ2QwIIya3eKqOjiN4WNTszfRz7HCvw9XggcT7+ftMjNP8XJ/GfW+ltCBeUFR9d8WBVsr2m/NLjX2CZQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-riscv64@12.15.0':
- resolution: {integrity: sha512-bF1uBWEfbwaeryz6lIiaJ8AWD082otZfvzGX5l+6LZRpRwUEpJHUsJrORaYP5/cNMv5ZR2p6TvvcJcQzwtDzmw==}
+ '@pnpm/exe.linux-riscv64@12.18.0':
+ resolution: {integrity: sha512-7kMN77xSOYJX8GPSH5RbNAc5oM61LMmcSUukDDUwllnZPXm8GRPskCNsTWy8SCw01Kr1FB+5SwGNMiTdiziLNQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-s390x@12.15.0':
- resolution: {integrity: sha512-zKMhIzsexYMToeLmqV5jPsvV/f9vwsJb2kUH2NFYzalbxImeBrlA4kL7GwF8gD4pagV6jYYcJb8RjbZIdjHptg==}
+ '@pnpm/exe.linux-s390x@12.18.0':
+ resolution: {integrity: sha512-htuSCpEcmDzhKoJqXbPkvfr176dBHU0QIF5mWcRiqxRXAB/1JoYiMYotfjWpk+ztgpB9qlx4XnWlLFAf7gzc6g==}
cpu: [s390x]
os: [linux]
libc: [glibc]
- '@pnpm/exe.linux-x64-musl@12.15.0':
- resolution: {integrity: sha512-A9J0Jg0Rdx+qQU4qXtwyST5tto9IOu1zi4fDk35nbc6DWahggbcKtFvZPKFwL2qgUXGXOX//hXv6z/sp6emO8A==}
+ '@pnpm/exe.linux-x64-musl@12.18.0':
+ resolution: {integrity: sha512-Uj+vzfIQ62kDP10x36yHZIXVs5ohdNtiPYwn5FhCLlNScHPo0OAI+ShGDtLofiBXKE7umu71Jmjm7N8a8zVcDw==}
cpu: [x64]
os: [linux]
libc: [musl]
- '@pnpm/exe.linux-x64@12.15.0':
- resolution: {integrity: sha512-yc+QlZR+9+nr29J4fRzhMoapgxTBDndq/+peyoq1XUufnQFnfbXUMFudDIKzHi545linGqmOmXfn0NoufNgcOg==}
+ '@pnpm/exe.linux-x64@12.18.0':
+ resolution: {integrity: sha512-OJ+X2wcraldCwj75pCIerWARQSRpdfj0eBTs/2ODyhfeW46ylOnjTIE/GKra6Mn6E72/gBmXS8igrUioa+F9fQ==}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@pnpm/exe.win32-arm64@12.15.0':
- resolution: {integrity: sha512-fPXZxuY1VclkOga9bc53qNCXcegfeoBR8+Ue+AospDwKzuGGSHll0oDxkLfkmpjyRqpe7bH5DyQPYp/xSMaIVA==}
+ '@pnpm/exe.win32-arm64@12.18.0':
+ resolution: {integrity: sha512-wEY6jiACGcbhhi5yD59doHqNTndS7AaujaPmtWAu1DKkHru2hy5fJ9yUGecW72Ypaw2/I3BEprfMOopap2NQtw==}
cpu: [arm64]
os: [win32]
- '@pnpm/exe.win32-x64@12.15.0':
- resolution: {integrity: sha512-nrd+Tp1We1DGj4DGG5Bea9lZNh9y1PjlLBdEwdInS4D0h0UIDtM7JaGGGDJhNzIwcHASyihWI7HLV+dtG+fhYg==}
+ '@pnpm/exe.win32-x64@12.18.0':
+ resolution: {integrity: sha512-5FJkghO7RLRkQpWxeVEygW9XsmnNuxzPfXbgwFWCHsFyFhpDn/vOdL88ToQEM0Kt5igdW5s6U0/IDH8Dvkt3pg==}
cpu: [x64]
os: [win32]
- pnpm@12.15.0:
- resolution: {integrity: sha512-s5UdbW/0qfE9x89WzSjSuOs328ycaOUuHhGRhz6p+CoBcoerULqtxczElPA2xnwOR+sTYIwvo29HcRth6hKOYQ==}
+ pnpm@12.18.0:
+ resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==}
engines: {node: '>=18'}
hasBin: true
snapshots:
- '@pnpm/exe.android-arm64@12.15.0':
+ '@pnpm/exe.android-arm64@12.18.0':
optional: true
- '@pnpm/exe.android-x64@12.15.0':
+ '@pnpm/exe.android-x64@12.18.0':
optional: true
- '@pnpm/exe.darwin-arm64@12.15.0':
+ '@pnpm/exe.darwin-arm64@12.18.0':
optional: true
- '@pnpm/exe.darwin-x64@12.15.0':
+ '@pnpm/exe.darwin-x64@12.18.0':
optional: true
- '@pnpm/exe.freebsd-x64@12.15.0':
+ '@pnpm/exe.freebsd-x64@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64-musl@12.15.0':
+ '@pnpm/exe.linux-arm64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-arm64@12.15.0':
+ '@pnpm/exe.linux-arm64@12.18.0':
optional: true
- '@pnpm/exe.linux-ppc64@12.15.0':
+ '@pnpm/exe.linux-ppc64@12.18.0':
optional: true
- '@pnpm/exe.linux-riscv64@12.15.0':
+ '@pnpm/exe.linux-riscv64@12.18.0':
optional: true
- '@pnpm/exe.linux-s390x@12.15.0':
+ '@pnpm/exe.linux-s390x@12.18.0':
optional: true
- '@pnpm/exe.linux-x64-musl@12.15.0':
+ '@pnpm/exe.linux-x64-musl@12.18.0':
optional: true
- '@pnpm/exe.linux-x64@12.15.0':
+ '@pnpm/exe.linux-x64@12.18.0':
optional: true
- '@pnpm/exe.win32-arm64@12.15.0':
+ '@pnpm/exe.win32-arm64@12.18.0':
optional: true
- '@pnpm/exe.win32-x64@12.15.0':
+ '@pnpm/exe.win32-x64@12.18.0':
optional: true
- pnpm@12.15.0:
+ pnpm@12.18.0:
optionalDependencies:
- '@pnpm/exe.android-arm64': 12.15.0
- '@pnpm/exe.android-x64': 12.15.0
- '@pnpm/exe.darwin-arm64': 12.15.0
- '@pnpm/exe.darwin-x64': 12.15.0
- '@pnpm/exe.freebsd-x64': 12.15.0
- '@pnpm/exe.linux-arm64': 12.15.0
- '@pnpm/exe.linux-arm64-musl': 12.15.0
- '@pnpm/exe.linux-ppc64': 12.15.0
- '@pnpm/exe.linux-riscv64': 12.15.0
- '@pnpm/exe.linux-s390x': 12.15.0
- '@pnpm/exe.linux-x64': 12.15.0
- '@pnpm/exe.linux-x64-musl': 12.15.0
- '@pnpm/exe.win32-arm64': 12.15.0
- '@pnpm/exe.win32-x64': 12.15.0
+ '@pnpm/exe.android-arm64': 12.18.0
+ '@pnpm/exe.android-x64': 12.18.0
+ '@pnpm/exe.darwin-arm64': 12.18.0
+ '@pnpm/exe.darwin-x64': 12.18.0
+ '@pnpm/exe.freebsd-x64': 12.18.0
+ '@pnpm/exe.linux-arm64': 12.18.0
+ '@pnpm/exe.linux-arm64-musl': 12.18.0
+ '@pnpm/exe.linux-ppc64': 12.18.0
+ '@pnpm/exe.linux-riscv64': 12.18.0
+ '@pnpm/exe.linux-s390x': 12.18.0
+ '@pnpm/exe.linux-x64': 12.18.0
+ '@pnpm/exe.linux-x64-musl': 12.18.0
+ '@pnpm/exe.win32-arm64': 12.18.0
+ '@pnpm/exe.win32-x64': 12.18.0
---
lockfileVersion: '9.0'
diff --git a/render-wasm/scripts/cargo-build.test.cjs b/render-wasm/scripts/cargo-build.test.cjs
index e757c7cd95..01a080aa42 100644
--- a/render-wasm/scripts/cargo-build.test.cjs
+++ b/render-wasm/scripts/cargo-build.test.cjs
@@ -347,3 +347,58 @@ test("rejects malformed Cargo JSON and removes stale build facts", (t) => {
assert.match(result.stderr, /ERROR:/);
assert.equal(fs.existsSync(f.info), false);
});
+
+function runSetup(t, prepared) {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), "render-wasm-setup-"));
+ t.after(() => fs.rmSync(root, { recursive: true, force: true }));
+ const bin = path.join(root, "bin");
+ const marker = path.join(root, "calls");
+ fs.mkdirSync(bin);
+ for (const name of ["rustup", "pnpm"]) {
+ fs.writeFileSync(
+ path.join(bin, name),
+ `#!/bin/sh\nprintf '%s\\n' "${name} $*" >> "$MARKER"\n`,
+ { mode: 0o755 },
+ );
+ }
+ const env = {
+ ...process.env,
+ MARKER: marker,
+ PATH: `${bin}:${process.env.PATH}`,
+ };
+ if (prepared === undefined) {
+ delete env.PENPOT_WASM_PREPARED;
+ } else {
+ env.PENPOT_WASM_PREPARED = prepared;
+ }
+ const result = spawnSync(
+ "bash",
+ [
+ "--noprofile",
+ "--norc",
+ "-c",
+ 'source "$1" frontend; setup',
+ "setup-test",
+ path.resolve(__dirname, "..", "_build_env"),
+ ],
+ {
+ cwd: path.resolve(__dirname, ".."),
+ env,
+ encoding: "utf8",
+ },
+ );
+ assert.equal(result.status, 0, result.stderr);
+ return fs.existsSync(marker) ? fs.readFileSync(marker, "utf8") : "";
+}
+
+test("prepared setup skips rustup and pnpm", (t) => {
+ const normal = runSetup(t);
+ assert.match(normal, /^rustup default /m);
+ assert.match(normal, /^pnpm install$/m);
+
+ const disabled = runSetup(t, "0");
+ assert.match(disabled, /^rustup default /m);
+ assert.match(disabled, /^pnpm install$/m);
+
+ assert.equal(runSetup(t, "1"), "");
+});
diff --git a/render-wasm/src/globals.rs b/render-wasm/src/globals.rs
index 26e149d97c..cc9e718bdf 100644
--- a/render-wasm/src/globals.rs
+++ b/render-wasm/src/globals.rs
@@ -16,7 +16,7 @@ static mut RENDER_RESOURCES: *mut RenderResources = std::ptr::null_mut();
pub(crate) fn get_design_state() -> &'static mut State {
unsafe {
- debug_assert!(!DESIGN_STATE.is_null(), "Design State is null");
+ assert!(!DESIGN_STATE.is_null(), "Design State is null");
&mut *DESIGN_STATE
}
}
@@ -35,7 +35,7 @@ pub(crate) fn get_gpu_state() -> &'static mut GpuState {
#[inline(always)]
pub(crate) fn get_render_state() -> &'static mut RenderState {
unsafe {
- debug_assert!(!RENDER_STATE.is_null(), "Render State is null");
+ assert!(!RENDER_STATE.is_null(), "Render State is null");
&mut *RENDER_STATE
}
}
@@ -64,7 +64,7 @@ pub(crate) fn has_render_resources() -> bool {
#[inline(always)]
pub(crate) fn get_resources() -> &'static mut RenderResources {
unsafe {
- debug_assert!(!RENDER_RESOURCES.is_null(), "Render Resources is null");
+ assert!(!RENDER_RESOURCES.is_null(), "Render Resources is null");
&mut *RENDER_RESOURCES
}
}
@@ -72,7 +72,7 @@ pub(crate) fn get_resources() -> &'static mut RenderResources {
#[inline(always)]
pub(crate) fn get_text_editor_state() -> &'static mut TextEditorState {
unsafe {
- debug_assert!(!TEXT_EDITOR_STATE.is_null(), "Text Editor state is null");
+ assert!(!TEXT_EDITOR_STATE.is_null(), "Text Editor state is null");
&mut *TEXT_EDITOR_STATE
}
}
@@ -80,7 +80,7 @@ pub(crate) fn get_text_editor_state() -> &'static mut TextEditorState {
#[inline(always)]
pub(crate) fn get_ui_state() -> &'static mut UIState {
unsafe {
- debug_assert!(!UI_STATE.is_null(), "UI State is null");
+ assert!(!UI_STATE.is_null(), "UI State is null");
&mut *UI_STATE
}
}
@@ -234,14 +234,28 @@ pub extern "C" fn init_headless(_width: i32, _height: i32) -> Result<()> {
Ok(())
}
+unsafe fn drop_global(slot: *mut *mut T) {
+ let ptr = std::ptr::replace(slot, std::ptr::null_mut());
+ if !ptr.is_null() {
+ drop(Box::from_raw(ptr));
+ }
+}
+
#[no_mangle]
#[wasm_error]
pub extern "C" fn clean_up() -> Result<()> {
- // Cancel the current animation frame if it exists so
- // it won't try to render without context
- let render_state = get_render_state();
- render_state.prepare_context_loss_cleanup();
- unsafe { DESIGN_STATE = std::ptr::null_mut() }
+ if has_render_state() {
+ // Abandons the GL context, so the drops below issue no GL calls.
+ get_render_state().prepare_context_loss_cleanup();
+ }
+ unsafe {
+ drop_global(std::ptr::addr_of_mut!(DESIGN_STATE));
+ drop_global(std::ptr::addr_of_mut!(TEXT_EDITOR_STATE));
+ drop_global(std::ptr::addr_of_mut!(UI_STATE));
+ drop_global(std::ptr::addr_of_mut!(RENDER_STATE));
+ drop_global(std::ptr::addr_of_mut!(RENDER_RESOURCES));
+ drop_global(std::ptr::addr_of_mut!(GPU_STATE));
+ }
mem::free_bytes()?;
Ok(())
}
diff --git a/render-wasm/src/math/bools.rs b/render-wasm/src/math/bools.rs
index cb300d83d9..653ab6cc8f 100644
--- a/render-wasm/src/math/bools.rs
+++ b/render-wasm/src/math/bools.rs
@@ -419,11 +419,7 @@ fn beziers_to_segments(beziers: &[(BezierSource, Bezier)]) -> Vec {
let mut last_end = (first_bezier.end.x as f32, first_bezier.end.y as f32);
let mut cur_end = first_bezier.end;
- loop {
- let Some((next_src, next_bezier)) = find_next_in_pool(&mut pool, cur_end, cur_src)
- else {
- break;
- };
+ while let Some((next_src, next_bezier)) = find_next_in_pool(&mut pool, cur_end, cur_src) {
push_bezier(&mut result, &next_bezier);
last_end = (next_bezier.end.x as f32, next_bezier.end.y as f32);
cur_end = next_bezier.end;
diff --git a/render-wasm/src/render.rs b/render-wasm/src/render.rs
index 5b47c8bce2..9072be3f08 100644
--- a/render-wasm/src/render.rs
+++ b/render-wasm/src/render.rs
@@ -764,6 +764,13 @@ impl RenderState {
Self::union_stroke_outset(base, stroke_outset)
}
+ /// Fill ∪ outer stroke outline in shape-local space: the area a drop
+ /// shadow must not show under (vector, SVG).
+ pub(crate) fn drop_shadow_clear_path(shape: &Shape) -> skia::Path {
+ let stroke_outset = Stroke::max_bounds_width(shape.visible_strokes(), shape.is_open());
+ Self::background_blur_clip_path(shape, stroke_outset)
+ }
+
/// Unions a centered stroke of width `2 * stroke_outset` into `base`.
/// The inward half disappears in the union, leaving `stroke_outset` beyond
/// the fill outline.
@@ -3431,20 +3438,11 @@ impl RenderState {
return self.render_masked_group_silhouette(shape, clip_bounds, pass);
}
- let flat = Shadow::new(
- skia::Color::BLACK,
- 0.0,
- 0.0,
- (0.0, 0.0),
- crate::shapes::ShadowStyle::Drop,
- false,
- );
-
self.render_drop_black_shadow(
shape,
pass.tree,
&shape.extrect(pass.tree, pass.scale),
- &flat,
+ &Shadow::silhouette(),
clip_bounds.clone(),
pass.scale,
pass.extra_layer_blur,
@@ -3649,7 +3647,19 @@ impl RenderState {
// High zoom with blur: use render_into_filter_surface to ensure blur has enough space
// Apply spread geometrically to avoid dilate filter rounding issues
let layer_blur_value = combined_blur.map(|b| b.value).unwrap_or(0.0);
- let cache_key = clip_bounds.is_none().then(|| {
+
+ // Only the part that can blur into this tile matters. A shadow bigger
+ // than the filter surface would otherwise be cut at MIN_FIT_SCALE.
+ let mut filter_bounds = bounds;
+ if target_surface != SurfaceId::Export {
+ let reach = 2.0 * (shadow.blur + layer_blur_value) + 1.0;
+ let tile_reach = self.render_area_with_margins.with_outset((reach, reach));
+ if !filter_bounds.intersect(tile_reach) {
+ return Ok(());
+ }
+ }
+
+ let cache_key = (clip_bounds.is_none() && filter_bounds == bounds).then(|| {
shadows::DropShadowFilterCacheKey::for_shape(
shape.id,
shadow,
@@ -3682,7 +3692,7 @@ impl RenderState {
// Apply spread geometrically to avoid dilate filter rounding issues
let filter_result = filters::render_into_filter_surface(
self,
- bounds,
+ filter_bounds,
blur_downscale,
|state, temp_surface| {
let canvas = state.surfaces.canvas(temp_surface);
@@ -3712,7 +3722,8 @@ impl RenderState {
)?;
if let Some((mut surface, filter_scale)) = filter_result {
- let cached = shadows::CachedDropShadowFilter::new(bounds, filter_scale, &mut surface);
+ let cached =
+ shadows::CachedDropShadowFilter::new(filter_bounds, filter_scale, &mut surface);
shadows::blit_cached_drop_shadow_filter(
&mut self.surfaces,
&cached,
@@ -3819,6 +3830,27 @@ impl RenderState {
.canvas(SurfaceId::DropShadows)
.draw_paint(&paint);
+ // Like CSS box-shadow, the shadow never shows under the shape.
+ if element.clears_drop_shadow_underneath() {
+ let mut paint = skia::Paint::default();
+ paint.set_blend_mode(skia::BlendMode::DstOut);
+ let layer_rec = skia::canvas::SaveLayerRec::default().paint(&paint);
+ self.surfaces
+ .canvas(SurfaceId::DropShadows)
+ .save_layer(&layer_rec);
+ self.render_drop_black_shadow(
+ element,
+ tree,
+ element_extrect,
+ &Shadow::silhouette(),
+ clip_bounds.clone(),
+ scale,
+ None,
+ target_surface,
+ )?;
+ self.surfaces.canvas(SurfaceId::DropShadows).restore();
+ }
+
self.surfaces.canvas(SurfaceId::DropShadows).restore();
}
diff --git a/render-wasm/src/render/surfaces.rs b/render-wasm/src/render/surfaces.rs
index 2c60832b45..47a89c8521 100644
--- a/render-wasm/src/render/surfaces.rs
+++ b/render-wasm/src/render/surfaces.rs
@@ -27,8 +27,8 @@ const TILE_DRAWABLE_RECT: IRect = IRect {
};
const DOC_ATLAS_MAX_DIM: i32 = 4096;
-/// GPU→GPU copy of `src` from `from` into `dst` on `to_canvas`, without
-/// `image_snapshot` (avoids per-tile sync stalls on WebGL).
+/// GPU→GPU copy of `src` from `from` into `dst`, replacing destination pixels,
+/// including transparent pixels, within the current canvas clip.
fn draw_surface_src_rect_to_dst(
from: &mut skia::Surface,
to_canvas: &skia::Canvas,
@@ -48,7 +48,9 @@ fn draw_surface_src_rect_to_dst(
to_canvas.translate((dst.left, dst.top));
to_canvas.scale((sx, sy));
to_canvas.translate((-src.left, -src.top));
- from.draw(to_canvas, (0.0, 0.0), sampling, None);
+ let mut paint = skia::Paint::default();
+ paint.set_blend_mode(skia::BlendMode::Src);
+ from.draw(to_canvas, (0.0, 0.0), sampling, Some(&paint));
to_canvas.restore();
}
diff --git a/render-wasm/src/render/svg/document.rs b/render-wasm/src/render/svg/document.rs
index 1fbdd11615..703308c19e 100644
--- a/render-wasm/src/render/svg/document.rs
+++ b/render-wasm/src/render/svg/document.rs
@@ -5,6 +5,7 @@ use crate::shapes::{radius_to_sigma, Fill, Shadow, Shape, Type};
use crate::state::ShapesPoolRef;
use crate::render::vector::draw_shape_geometry;
+use crate::render::RenderState;
// Skia's SVG backend (`SkSVGDevice`) silently drops everything drawn inside a
// `save_layer`, so composite effects rendered with `save_layer` (opacity,
@@ -222,6 +223,35 @@ impl SvgLayerCanvas {
self.finish_clip_path_fragment(id, canvas);
}
+ /// Opens a group whose mask hides `element`'s outline, so its drop shadows
+ /// never show under it (CSS `box-shadow`). Returns whether it opened one.
+ pub(super) fn open_drop_shadow_clear_group(&mut self, element: &Shape) -> bool {
+ if !element.clears_drop_shadow_underneath() {
+ return false;
+ }
+ let id = self.unique("dsmask");
+ let canvas = self.new_fragment();
+ {
+ let cv: &skia::Canvas = &canvas;
+ let mut paint = Paint::default();
+ paint.set_color(skia::Color::WHITE);
+ cv.save();
+ cv.reset_matrix();
+ cv.draw_rect(
+ skia::Rect::from_wh(self.page_rect.width(), self.page_rect.height()),
+ &paint,
+ );
+ cv.restore();
+ paint.set_anti_alias(true);
+ paint.set_color(skia::Color::BLACK);
+ cv.concat(&element.centered_transform());
+ cv.draw_path(&RenderState::drop_shadow_clear_path(element), &paint);
+ }
+ self.finish_mask_fragment(&id, canvas);
+ self.open_group(&format!("mask=\"url(#{id})\""));
+ true
+ }
+
/// Finalizes a fragment canvas as a `` def.
///
/// Rewrite fill-rule to clip-rule: clipPaths ignore fill-rule, so evenodd
diff --git a/render-wasm/src/render/svg/frames.rs b/render-wasm/src/render/svg/frames.rs
index fa3bb808f6..de51c6abaf 100644
--- a/render-wasm/src/render/svg/frames.rs
+++ b/render-wasm/src/render/svg/frames.rs
@@ -34,6 +34,7 @@ pub(super) fn render_frame(
// (GPU), filter only blurs/tints — keeps stroke-ring width and rotation.
if !builder.suppress_filters {
let drops: Vec = element.drop_shadows_visible().copied().collect();
+ let cleared = !drops.is_empty() && builder.open_drop_shadow_clear_group(element);
for shadow in &drops {
let id = push_container_drop_filter(builder, shadow);
builder.open_group(&format!("filter=\"url(#{id})\""));
@@ -49,6 +50,9 @@ pub(super) fn render_frame(
builder.suppress_filters = prev_suppress;
builder.close_group();
}
+ if cleared {
+ builder.close_group();
+ }
}
let effects = content_effect_attrs(builder, element);
diff --git a/render-wasm/src/render/svg/mod.rs b/render-wasm/src/render/svg/mod.rs
index 997a68e71c..fee187db54 100644
--- a/render-wasm/src/render/svg/mod.rs
+++ b/render-wasm/src/render/svg/mod.rs
@@ -298,6 +298,7 @@ fn render_leaf(
// feMorphology rounding on circles). Filter only blurs/tints.
if !builder.suppress_filters {
let drops: Vec = element.drop_shadows_visible().copied().collect();
+ let cleared = !drops.is_empty() && builder.open_drop_shadow_clear_group(element);
for shadow in &drops {
let id = push_container_drop_filter(builder, shadow);
builder.open_group(&format!("filter=\"url(#{id})\""));
@@ -313,6 +314,9 @@ fn render_leaf(
builder.suppress_filters = prev_suppress;
builder.close_group();
}
+ if cleared {
+ builder.close_group();
+ }
}
let effects = content_effect_attrs(builder, element);
diff --git a/render-wasm/src/render/svg/tests.rs b/render-wasm/src/render/svg/tests.rs
index 490d5ef27a..2212371f1e 100644
--- a/render-wasm/src/render/svg/tests.rs
+++ b/render-wasm/src/render/svg/tests.rs
@@ -577,6 +577,43 @@ fn exports_leaf_drop_shadow_as_svg_filter() {
insta::assert_snapshot!(svg);
}
+fn render_rect_with_drop_shadow(fill: skia::Color) -> String {
+ let mut pool = ShapesPool::new();
+ let id = uid(1);
+ add_solid_rect(&mut pool, id, Uuid::nil(), (0.0, 0.0, 100.0, 80.0), fill);
+ pool.get_mut(&id).unwrap().add_shadow(Shadow::new(
+ skia::Color::BLACK,
+ 8.0,
+ 0.0,
+ (4.0, 6.0),
+ ShadowStyle::Drop,
+ false,
+ ));
+ render(&pool, id)
+}
+
+#[test]
+fn translucent_leaf_hides_drop_shadow_underneath() {
+ let svg = render_rect_with_drop_shadow(skia::Color::from_argb(100, 255, 0, 0));
+ let mask_at = svg
+ .find("mask=\"url(#dsmask")
+ .unwrap_or_else(|| panic!("drop shadow must be masked under a translucent fill: {svg}"));
+ let filter_at = svg.find("filter=\"url(#fx").expect("drop filter");
+ assert!(
+ mask_at < filter_at,
+ "the mask must wrap the drop shadow group: {svg}"
+ );
+}
+
+#[test]
+fn opaque_leaf_keeps_drop_shadow_unmasked() {
+ let svg = render_rect_with_drop_shadow(skia::Color::from_rgb(255, 0, 0));
+ assert!(
+ !svg.contains("dsmask"),
+ "an opaque fill hides the shadow already: {svg}"
+ );
+}
+
#[test]
fn leaf_drop_offset_follows_rotation_in_user_space() {
let mut pool = ShapesPool::new();
diff --git a/render-wasm/src/render/vector.rs b/render-wasm/src/render/vector.rs
index bfbeedf0d0..9dbc5651a5 100644
--- a/render-wasm/src/render/vector.rs
+++ b/render-wasm/src/render/vector.rs
@@ -1,9 +1,11 @@
-use skia_safe::{self as skia, Canvas, Paint, RRect};
+use std::borrow::Cow;
+
+use skia_safe::{self as skia, Canvas, Matrix, Paint, RRect};
use crate::error::Result;
use crate::shapes::{
circle_segments_local, merge_fills, radius_to_sigma, rect_segments_local, stroke_to_path,
- BlurType, Fill, Frame, Path, Rect, Shape, Stroke, StrokeKind, StrokeStyle, Type,
+ BlurType, Fill, Frame, Path, Rect, Shape, SolidColor, Stroke, StrokeKind, StrokeStyle, Type,
};
use crate::state::ShapesPoolRef;
use crate::uuid::Uuid;
@@ -29,6 +31,10 @@ pub(super) struct VectorRenderer<'a> {
/// techniques that `SkSVGDevice` drops: draw fills individually and emit
/// solid Inner/Outer strokes as filled outlines.
compose_fills: bool,
+ /// Set when an enclosing layer already applies the shape's layer blur.
+ blur_in_layer: bool,
+ /// Set inside a container's drop-shadow pass: text glyphs paint opaque.
+ silhouette: bool,
}
impl<'a> VectorRenderer<'a> {
@@ -43,6 +49,8 @@ impl<'a> VectorRenderer<'a> {
shared,
scale,
compose_fills,
+ blur_in_layer: false,
+ silhouette: false,
}
}
@@ -50,9 +58,10 @@ impl<'a> VectorRenderer<'a> {
///
/// SVG export (`compose_fills == false`) returns `None`: `SkSVGDevice` drops
/// paint image-filters (the shape would vanish). Layer blur is re-emitted as
- /// a native SVG `` wrapper instead.
+ /// a native SVG `` wrapper instead. Also `None` inside a layer
+ /// that already blurs, or the shape would blur twice.
fn layer_blur_filter(&self, shape: &Shape) -> Option {
- if !self.compose_fills {
+ if !self.compose_fills || self.blur_in_layer {
return None;
}
shape.image_filter(1.)
@@ -120,8 +129,10 @@ impl ShapeRenderer for VectorRenderer<'_> {
fn draw_drop_shadows(&mut self, shape: &Shape) -> Result<()> {
let layer_bounds = shape.layer_bounds();
+ self.canvas.save();
+ clip_out_drop_shadow_underneath(self.canvas, shape, &Matrix::default());
for shadow in shape.drop_shadows_visible() {
- if let Some(filter) = shadow.get_drop_shadow_filter() {
+ if let Some(filter) = shadow.get_drop_shadow_blur_filter() {
let mut paint = Paint::default();
paint.set_image_filter(filter);
let layer_rec = skia::canvas::SaveLayerRec::default()
@@ -131,10 +142,17 @@ impl ShapeRenderer for VectorRenderer<'_> {
let mut fill_paint = Paint::default();
fill_paint.set_anti_alias(true);
fill_paint.set_color(skia::Color::BLACK);
+ // Spread as a mitered outline: Skia's dilate filter runs as
+ // SkSL per pixel on CPU canvases, which takes minutes.
+ if shadow.spread > 0.0 {
+ fill_paint.set_style(skia::PaintStyle::StrokeAndFill);
+ fill_paint.set_stroke_width(2.0 * shadow.spread);
+ }
draw_shape_geometry(self.canvas, shape, &fill_paint);
self.canvas.restore();
}
}
+ self.canvas.restore();
Ok(())
}
@@ -182,13 +200,17 @@ impl ShapeRenderer for VectorRenderer<'_> {
};
let text_content = text_content.new_bounds(shape.selrect());
- let mut paragraph_builders = text_content.paragraph_builder_group_from_text(None);
+ let mut paragraph_builders =
+ text_content.paragraph_builder_group_from_text(Some(self.silhouette));
let blur_filter = self.layer_blur_filter(shape);
// Text drop shadows: one filter layer per shadow over fill + stroke
- // silhouettes (mirrors GPU `render_text_shadows`).
- let drop_shadows = shape.drop_shadow_paints();
- if !drop_shadows.is_empty() {
+ // silhouettes (mirrors GPU `render_text_shadows`). Spread grows the
+ // glyphs through strokes (`spread_shape`).
+ let layer_bounds = shape.layer_bounds();
+ for shadow in shape.drop_shadows_visible() {
+ let spread = spread_shape(shape, shadow.spread);
+ let shape: &Shape = &spread;
let shadow_stroke_outset = Stroke::max_bounds_width(shape.visible_strokes(), false);
let mut shadow_paragraphs = text_content.paragraph_builder_group_from_text(Some(true));
let mut stroke_shadow_groups: Vec<(StrokeKind, _)> = shape
@@ -208,67 +230,66 @@ impl ShapeRenderer for VectorRenderer<'_> {
})
.collect();
- let layer_bounds = shape.layer_bounds();
- for shadow_paint in &drop_shadows {
- self.canvas.save_layer(
- &skia::canvas::SaveLayerRec::default()
- .bounds(&layer_bounds)
- .paint(shadow_paint),
- );
+ let mut shadow_paint = Paint::default();
+ shadow_paint.set_image_filter(shadow.get_drop_shadow_blur_filter());
+ self.canvas.save_layer(
+ &skia::canvas::SaveLayerRec::default()
+ .bounds(&layer_bounds)
+ .paint(&shadow_paint),
+ );
- text::render_overlay_emoji(
- self.canvas,
- shape,
- &mut shadow_paragraphs,
- None,
- blur_filter.as_ref(),
- None,
- None,
- )?;
+ text::render_overlay_emoji(
+ self.canvas,
+ shape,
+ &mut shadow_paragraphs,
+ None,
+ blur_filter.as_ref(),
+ None,
+ None,
+ )?;
- for (kind, stroke_paragraphs) in &mut stroke_shadow_groups {
- if *kind == StrokeKind::Inner {
- // Inner stroke masked by the glyph fill (outset 0 here).
- let mut fill_builders =
- text_content.paragraph_builder_group_from_text(Some(true));
- text::render_inner_stroke(
- None,
- Some(self.canvas),
- shape,
- stroke_paragraphs,
- &mut fill_builders,
- None,
- blur_filter.as_ref(),
- 0.0,
- None,
- )?;
- } else if *kind == StrokeKind::Outer {
- text::render_outer_stroke(
- None,
- Some(self.canvas),
- shape,
- stroke_paragraphs,
- None,
- blur_filter.as_ref(),
- 0.0,
- None,
- )?;
- } else {
- text::render_with_bounds_outset_overlay_emoji(
- self.canvas,
- shape,
- stroke_paragraphs,
- None,
- blur_filter.as_ref(),
- shadow_stroke_outset,
- None,
- None,
- )?;
- }
+ for (kind, stroke_paragraphs) in &mut stroke_shadow_groups {
+ if *kind == StrokeKind::Inner {
+ // Inner stroke masked by the glyph fill (outset 0 here).
+ let mut fill_builders =
+ text_content.paragraph_builder_group_from_text(Some(true));
+ text::render_inner_stroke(
+ None,
+ Some(self.canvas),
+ shape,
+ stroke_paragraphs,
+ &mut fill_builders,
+ None,
+ blur_filter.as_ref(),
+ 0.0,
+ None,
+ )?;
+ } else if *kind == StrokeKind::Outer {
+ text::render_outer_stroke(
+ None,
+ Some(self.canvas),
+ shape,
+ stroke_paragraphs,
+ None,
+ blur_filter.as_ref(),
+ 0.0,
+ None,
+ )?;
+ } else {
+ text::render_with_bounds_outset_overlay_emoji(
+ self.canvas,
+ shape,
+ stroke_paragraphs,
+ None,
+ blur_filter.as_ref(),
+ shadow_stroke_outset,
+ None,
+ None,
+ )?;
}
-
- self.canvas.restore();
}
+
+ self.canvas.restore();
}
text::render_overlay_emoji(
@@ -427,6 +448,9 @@ struct TreeOpts<'a> {
root_fills: &'a [Fill],
/// Nearest group's fills, painted by fill-less leaves (GPU `nested_fills`).
inherited_fills: &'a [Fill],
+ /// Set inside a container's drop-shadow pass: the spread to grow every
+ /// shape by.
+ silhouette: Option,
}
impl<'a> TreeOpts<'a> {
@@ -447,6 +471,7 @@ impl<'a> TreeOpts<'a> {
skip: self.skip,
root_fills: self.root_fills,
inherited_fills,
+ silhouette: self.silhouette,
}
}
}
@@ -500,6 +525,7 @@ fn render_tree_dispatch(
skip: None,
root_fills: &root_fills,
inherited_fills: &root_fills,
+ silhouette: None,
};
render_tree_inner(shared, canvas, id, tree, scale, &opts)
}
@@ -525,6 +551,10 @@ fn render_tree_inner(
if element.hidden {
return Ok(());
}
+ let silhouette = opts
+ .silhouette
+ .map(|spread| silhouette_shape(element, spread));
+ let element: &Shape = silhouette.as_deref().unwrap_or(element);
// Background blur samples already-drawn content behind the shape, so it must
// run before the shape (and its subtree) paints. SVGRaw is excluded,
@@ -561,7 +591,8 @@ fn render_tree_inner(
} else {
element.fills.as_slice()
};
- render_leaf(shared, canvas, element, fills, scale)?;
+ let silhouette = opts.silhouette.is_some();
+ render_leaf(shared, canvas, element, fills, scale, silhouette)?;
}
}
@@ -696,6 +727,7 @@ fn render_background_blur_image(
skip: Some(&shape.id),
root_fills: opts.root_fills,
inherited_fills: opts.root_fills,
+ silhouette: None,
};
render_tree_inner(shared, oc, opts.root, tree, scale, &sub)?;
}
@@ -952,6 +984,8 @@ fn render_frame(
canvas.save();
canvas.concat(&matrix);
let mut renderer = VectorRenderer::new(canvas, shared, scale, true);
+ // The opacity/blend layer above carries the frame's layer blur.
+ renderer.blur_in_layer = needs_layer;
renderer.draw_fills(element, &element.fills)?;
renderer.draw_fill_inner_shadows(element)?;
canvas.restore();
@@ -995,8 +1029,10 @@ fn render_container_drop_shadows(
opts: &TreeOpts,
) -> Result<()> {
let subtree_bounds = element.extrect(tree, scale);
+ canvas.save();
+ clip_out_drop_shadow_underneath(canvas, element, &element.centered_transform());
for shadow in element.drop_shadows_visible() {
- let Some(filter) = shadow.get_drop_shadow_filter() else {
+ let Some(filter) = shadow.get_drop_shadow_blur_filter() else {
continue;
};
let mut paint = Paint::default();
@@ -1007,13 +1043,22 @@ fn render_container_drop_shadows(
.paint(&paint),
);
+ // Spread grows every silhouette shape instead of dilating the layer.
+ let spread = opts.silhouette.unwrap_or(0.0) + shadow.spread.max(0.0);
if draw_fills && !element.fills.is_empty() {
+ let mut background = Cow::Borrowed(element);
+ if spread > 0.0 {
+ background.to_mut().selrect.outset((spread, spread));
+ }
let mut renderer = VectorRenderer::new(canvas, shared, scale, true);
- renderer.draw_fills(element, &element.fills)?;
+ renderer.draw_fills(&background, &[Fill::Solid(SolidColor(skia::Color::BLACK))])?;
}
let children = children_paint_order(tree, element);
- let child_opts = opts.for_children_of(element);
+ let child_opts = TreeOpts {
+ silhouette: Some(spread),
+ ..opts.for_children_of(element)
+ };
if element.is_masked_group() {
render_masked_children(shared, canvas, element, &children, tree, scale, &child_opts)?;
} else {
@@ -1024,9 +1069,54 @@ fn render_container_drop_shadows(
canvas.restore();
}
+ canvas.restore();
Ok(())
}
+/// Like CSS `box-shadow`, a drop shadow never shows under its shape.
+/// `local_to_canvas` maps shape-local space to the current canvas space.
+fn clip_out_drop_shadow_underneath(canvas: &Canvas, shape: &Shape, local_to_canvas: &Matrix) {
+ if shape.clears_drop_shadow_underneath() {
+ let path = RenderState::drop_shadow_clear_path(shape).make_transform(local_to_canvas);
+ canvas.clip_path(&path, skia::ClipOp::Difference, true);
+ }
+}
+
+/// `shape` grown by a drop-shadow `spread` for its silhouette, through its own
+/// strokes and joins (as the GPU does for paths). Empty frames and containers
+/// have no outline of their own to grow.
+fn spread_shape(shape: &Shape, spread: f32) -> Cow<'_, Shape> {
+ let outline = match shape.shape_type {
+ Type::Group(_) | Type::SVGRaw(_) => false,
+ Type::Frame(_) => !shape.fills.is_empty() || !shape.strokes.is_empty(),
+ _ => true,
+ };
+ if spread <= 0.0 || !outline {
+ return Cow::Borrowed(shape);
+ }
+ let mut shape = shape.clone();
+ shape.apply_shadow_spread(spread);
+ Cow::Owned(shape)
+}
+
+/// `shape` as drawn in a container's drop-shadow pass: grown by `spread` and
+/// solid black, since fill and stroke opacity don't affect the shadow (GPU).
+fn silhouette_shape(shape: &Shape, spread: f32) -> Cow<'_, Shape> {
+ let mut shape = spread_shape(shape, spread);
+ if shape.has_fills() || !shape.strokes.is_empty() {
+ let black = Fill::Solid(SolidColor(skia::Color::BLACK));
+ let shape = shape.to_mut();
+ if shape.has_fills() {
+ shape.clear_fills();
+ shape.add_fill(black.clone());
+ }
+ for stroke in shape.strokes.iter_mut() {
+ stroke.fill = black.clone();
+ }
+ }
+ shape
+}
+
// ---------------------------------------------------------------------------
// Leaf shapes (Rect, Circle, Path, Bool, Text, SVGRaw)
// ---------------------------------------------------------------------------
@@ -1037,6 +1127,7 @@ fn render_leaf(
element: &Shape,
fills: &[Fill],
scale: f32,
+ silhouette: bool,
) -> Result<()> {
let needs_layer = element.needs_layer();
@@ -1065,6 +1156,8 @@ fn render_leaf(
} else {
false
};
+ renderer.blur_in_layer = blur_layer;
+ renderer.silhouette = silhouette;
renderer.draw_drop_shadows(element)?;
render_leaf_content(&mut renderer, element, fills)?;
diff --git a/render-wasm/src/shapes.rs b/render-wasm/src/shapes.rs
index 3baa6dd66c..5802f9f6fb 100644
--- a/render-wasm/src/shapes.rs
+++ b/render-wasm/src/shapes.rs
@@ -1497,6 +1497,12 @@ impl Shape {
.filter(|shadow| shadow.style() == ShadowStyle::Drop && !shadow.hidden())
}
+ pub fn clears_drop_shadow_underneath(&self) -> bool {
+ !matches!(self.shape_type, Type::Text(_))
+ && self.has_fills()
+ && !self.fills.iter().any(Fill::is_opaque)
+ }
+
#[allow(dead_code)]
pub fn inner_shadows(&self) -> impl DoubleEndedIterator- {
self.shadows
@@ -2187,20 +2193,6 @@ impl Shape {
true
}
- pub fn drop_shadow_paints(&self) -> Vec
{
- let drop_shadows: Vec<&Shadow> = self.drop_shadows_visible().collect();
-
- drop_shadows
- .into_iter()
- .map(|shadow| {
- let mut paint = skia_safe::Paint::default();
- let filter = shadow.get_drop_shadow_filter();
- paint.set_image_filter(filter);
- paint
- })
- .collect()
- }
-
pub fn inner_shadow_paints(&self) -> Vec {
let inner_shadows: Vec<&Shadow> = self.inner_shadows_visible().collect();
diff --git a/render-wasm/src/shapes/fills.rs b/render-wasm/src/shapes/fills.rs
index 15afbbbba7..525d848b7b 100644
--- a/render-wasm/src/shapes/fills.rs
+++ b/render-wasm/src/shapes/fills.rs
@@ -264,6 +264,16 @@ impl Fill {
}
}
+ pub fn is_opaque(&self) -> bool {
+ match self {
+ Fill::Solid(SolidColor(color)) => color.a() == 255,
+ Fill::LinearGradient(g) | Fill::RadialGradient(g) => {
+ g.opacity == 255 && g.colors.iter().all(|c| c.a() == 255)
+ }
+ Fill::Image(i) => i.opacity == 255,
+ }
+ }
+
pub fn with_full_opacity(&self) -> Fill {
match self {
Fill::Solid(SolidColor(color)) => Fill::Solid(SolidColor(skia::Color::from_argb(
diff --git a/render-wasm/src/shapes/shadows.rs b/render-wasm/src/shapes/shadows.rs
index b13c6d76bf..d0e2864e9f 100644
--- a/render-wasm/src/shapes/shadows.rs
+++ b/render-wasm/src/shapes/shadows.rs
@@ -60,6 +60,18 @@ impl Shadow {
self.hidden
}
+ /// The bare shape silhouette: no offset, blur or spread.
+ pub fn silhouette() -> Self {
+ Self::new(
+ skia::Color::BLACK,
+ 0.0,
+ 0.0,
+ (0.0, 0.0),
+ ShadowStyle::Drop,
+ false,
+ )
+ }
+
/// Approximate on-screen footprint (blur/spread + offset) at `scale` (zoom×dpr).
#[inline]
pub fn device_extent(&self, scale: f32) -> f32 {
@@ -87,25 +99,30 @@ impl Shadow {
}
pub fn get_drop_shadow_filter(&self) -> Option {
+ let filter = self.get_drop_shadow_blur_filter()?;
+
+ if self.spread > 0. {
+ return image_filters::dilate((self.spread, self.spread), filter, None);
+ }
+
+ Some(filter)
+ }
+
+ /// [`Self::get_drop_shadow_filter`] without the spread dilate.
+ pub fn get_drop_shadow_blur_filter(&self) -> Option {
if self.style == ShadowStyle::Inner {
return None;
}
let sigma = radius_to_sigma(self.blur);
- let mut filter = image_filters::drop_shadow_only(
+ image_filters::drop_shadow_only(
(self.offset.0, self.offset.1),
(sigma, sigma),
self.color,
None,
None,
None,
- );
-
- if self.spread > 0. {
- filter = image_filters::dilate((self.spread, self.spread), filter, None);
- }
-
- filter
+ )
}
/// Same shadow as [`Self::get_drop_shadow_filter`], for a `merge` input.
diff --git a/render-wasm/src/state/shapes_pool.rs b/render-wasm/src/state/shapes_pool.rs
index c877399250..cd9542068a 100644
--- a/render-wasm/src/state/shapes_pool.rs
+++ b/render-wasm/src/state/shapes_pool.rs
@@ -308,10 +308,11 @@ impl ShapesPoolImpl {
}
}
- // Expand every root modifier to its full descendant subtree.
+ // Expand every pure-move root modifier to the descendants without one.
// When CLJS sends only root shapes (translation on drag), descendants
- // need the same matrix.
- // For resize/rotate, propagate-modifiers already includes all descendants.
+ // need the same matrix. Other matrices come from propagate-modifiers,
+ // where a missing child means the child stays put (e.g. an auto-size
+ // layout parent or a layout child that does not move).
// Descendants are NOT pushed into `ids` / `modifier_uuids`: rebuild_modifier_tiles
// runs for roots, and drops the non-clipping ancestors' extrects separately.
let root_pairs: Vec<(usize, skia::Matrix)> = ids
@@ -319,7 +320,7 @@ impl ShapesPoolImpl {
.filter_map(|uuid| {
let idx = self.uuid_to_idx.get(uuid).copied()?;
let matrix = modifiers_with_idx.get(&idx).copied()?;
- Some((idx, matrix))
+ math::is_move_only_matrix(&matrix).then_some((idx, matrix))
})
.collect();
@@ -599,4 +600,33 @@ mod tests {
pool.get_mut(&id).expect("shape").set_opacity(0.5);
assert_eq!(pool.get(&id).expect("shape").opacity, 0.5);
}
+
+ fn pool_with_parent_and_child() -> (ShapesPool, Uuid, Uuid) {
+ let mut pool = ShapesPool::new();
+ pool.initialize(2);
+ let parent = Uuid::new_v4();
+ let child = Uuid::new_v4();
+ pool.add_shape(parent).add_child(child);
+ pool.add_shape(child).set_parent(parent);
+ (pool, parent, child)
+ }
+
+ #[test]
+ fn set_modifiers_passes_a_move_down_to_children() {
+ let (mut pool, parent, child) = pool_with_parent_and_child();
+ let translate = skia::Matrix::translate((10.0, 0.0));
+
+ pool.set_modifiers(HashMap::from([(parent, translate)]));
+
+ assert_eq!(pool.get_modifier(&child), Some(&translate));
+ }
+
+ #[test]
+ fn set_modifiers_keeps_a_resize_on_the_parent() {
+ let (mut pool, parent, child) = pool_with_parent_and_child();
+
+ pool.set_modifiers(HashMap::from([(parent, skia::Matrix::scale((1.0, 2.4)))]));
+
+ assert_eq!(pool.get_modifier(&child), None);
+ }
}
diff --git a/render-wasm/src/tiles.rs b/render-wasm/src/tiles.rs
index 8180266fb9..2dbfec39b4 100644
--- a/render-wasm/src/tiles.rs
+++ b/render-wasm/src/tiles.rs
@@ -444,7 +444,8 @@ impl PendingTiles {
// Farthest first, since we use pop() to process the tiles
// in order of priority (closest first)
- self.tile_order.sort_unstable_by(|a, b| b.0.cmp(&a.0));
+ self.tile_order
+ .sort_unstable_by_key(|a| std::cmp::Reverse(a.0));
for (_, tile) in self.tile_order.iter() {
let tile = *tile;
diff --git a/render-wasm/src/wasm/fills.rs b/render-wasm/src/wasm/fills.rs
index 28ff005bec..3de2b4dd79 100644
--- a/render-wasm/src/wasm/fills.rs
+++ b/render-wasm/src/wasm/fills.rs
@@ -87,13 +87,11 @@ impl TryFrom<&[u8]> for RawFillData {
// FIXME: return Result
pub fn read_fills_from_bytes(buffer: &[u8], num_fills: usize) -> Vec {
buffer
- .chunks_exact(RAW_FILL_DATA_SIZE)
+ .as_chunks::()
+ .0
+ .iter()
.take(num_fills)
- .map(|bytes| {
- RawFillData::try_from(bytes)
- .expect("Invalid fill data")
- .into()
- })
+ .map(|bytes| RawFillData::from(*bytes).into())
.collect()
}
diff --git a/render-wasm/src/wasm/text/helpers.rs b/render-wasm/src/wasm/text/helpers.rs
index f9ccfebdd0..be51aadcb2 100644
--- a/render-wasm/src/wasm/text/helpers.rs
+++ b/render-wasm/src/wasm/text/helpers.rs
@@ -297,12 +297,9 @@ pub fn replace_text_with_newlines(
let mut current_cursor = *cursor;
- if let Some(new_offset) = replace_text_at_cursor(text_content, ¤t_cursor, lines[0]) {
- current_cursor =
- TextPositionWithAffinity::new_downstream_affinity(current_cursor.paragraph, new_offset);
- } else {
- return None;
- }
+ let new_offset = replace_text_at_cursor(text_content, ¤t_cursor, lines[0])?;
+ current_cursor =
+ TextPositionWithAffinity::new_downstream_affinity(current_cursor.paragraph, new_offset);
for line in lines.iter().skip(1) {
if !split_paragraph_at_cursor(text_content, ¤t_cursor) {
@@ -336,12 +333,9 @@ pub fn insert_text_with_newlines(
let mut current_cursor = *cursor;
- if let Some(new_offset) = insert_text_at_cursor(text_content, ¤t_cursor, lines[0]) {
- current_cursor =
- TextPositionWithAffinity::new_downstream_affinity(current_cursor.paragraph, new_offset);
- } else {
- return None;
- }
+ let new_offset = insert_text_at_cursor(text_content, ¤t_cursor, lines[0])?;
+ current_cursor =
+ TextPositionWithAffinity::new_downstream_affinity(current_cursor.paragraph, new_offset);
for line in lines.iter().skip(1) {
if !split_paragraph_at_cursor(text_content, ¤t_cursor) {
@@ -477,8 +471,7 @@ pub fn delete_selection_range(text_content: &mut TextContent, selection: &TextSe
delete_range_in_paragraph(&mut paragraphs[end_paragraph], 0, end.offset);
- let end_para_children: Vec<_> =
- paragraphs[end_paragraph].children_mut().drain(..).collect();
+ let end_para_children: Vec<_> = std::mem::take(paragraphs[end_paragraph].children_mut());
paragraphs[start.paragraph]
.children_mut()
.extend(end_para_children);
@@ -593,10 +586,7 @@ pub fn delete_char_before(
let paragraphs = text_content.paragraphs_mut();
let prev_para_len = paragraph_char_count(¶graphs[prev_para_idx]);
- let current_children: Vec<_> = paragraphs[cursor.paragraph]
- .children_mut()
- .drain(..)
- .collect();
+ let current_children: Vec<_> = std::mem::take(paragraphs[cursor.paragraph].children_mut());
paragraphs[prev_para_idx]
.children_mut()
.extend(current_children);
@@ -770,7 +760,7 @@ pub fn delete_char_after(text_content: &mut TextContent, cursor: &TextPositionWi
delete_range_in_paragraph(para, cursor.offset, end);
} else if cursor.paragraph < paragraphs.len() - 1 {
let next_para_idx = cursor.paragraph + 1;
- let next_children: Vec<_> = paragraphs[next_para_idx].children_mut().drain(..).collect();
+ let next_children: Vec<_> = std::mem::take(paragraphs[next_para_idx].children_mut());
paragraphs[cursor.paragraph]
.children_mut()
.extend(next_children);
diff --git a/render-wasm/src/wasm/ui.rs b/render-wasm/src/wasm/ui.rs
index 3ef343618c..f63bccfd2d 100644
--- a/render-wasm/src/wasm/ui.rs
+++ b/render-wasm/src/wasm/ui.rs
@@ -76,11 +76,13 @@ impl TryFrom<&[u8]> for RawGuide {
fn read_guides_from_bytes(buffer: &[u8], count: usize) -> Result> {
buffer
- .chunks_exact(RAW_GUIDE_SIZE)
+ .as_chunks::()
+ .0
+ .iter()
.take(count)
.enumerate()
.map(|(i, bytes)| {
- RawGuide::try_from(bytes).map(|raw_guide| {
+ RawGuide::try_from(bytes.as_slice()).map(|raw_guide| {
let mut guide: Guide = raw_guide.into();
guide.index = i;
guide
diff --git a/scripts/changelog.py b/scripts/changelog.py
index fbba459fbd..280ffa1f85 100644
--- a/scripts/changelog.py
+++ b/scripts/changelog.py
@@ -1,18 +1,24 @@
#!/usr/bin/env python3
"""
-changelog.py — Helper commands for the ``update-changelog`` skill.
+changelog.py — Helper commands for the changelog flow.
Uses ``scripts/gh.py`` (via subprocess) and the local ``CHANGES.md`` so the
-skill file itself stays free of inline programs.
+flow memory (`mem:workflow/updating-changelog`) stays free of inline programs.
Subcommands:
check-merged Verify that every given PR is merged (warns otherwise)
+ boom Generate the :boom: section from `breaking change` issues
+ security Generate the :lock: section from advisories fixed in a version
cross-ref Compare merged milestone PRs against the changelog section
report Generate the anomaly report (CHANGES-ISSUES.md)
Usage:
python3 scripts/changelog.py check-merged 9179 9204 9311
cat prs.txt | python3 scripts/changelog.py check-merged --stdin
+ python3 scripts/changelog.py boom "2.19.0"
+ python3 scripts/changelog.py boom "2.19.0" --write
+ python3 scripts/changelog.py security "2.19.1"
+ python3 scripts/changelog.py security "2.19.1" --write
python3 scripts/changelog.py cross-ref "2.16.0"
python3 scripts/changelog.py report "2.16.0"
python3 scripts/changelog.py report "2.16.0" --changes CHANGES.md --output CHANGES-ISSUES.md
@@ -34,6 +40,27 @@ from pathlib import Path
REPO = "penpot/penpot"
GH_PY = Path(__file__).resolve().parent / "gh.py"
+BOOM_HEADING = "### :boom: Breaking changes & Deprecations"
+SECURITY_HEADING = "### :lock: Security fixes"
+BREAKING_LABEL = "breaking change"
+EXCLUDED_LABELS = {"release blocker", "no changelog"}
+
+# PR label carried by the security fixes that reference their advisory in the
+# PR body, and the GHSA id pattern used to find that reference.
+SECURITY_PR_LABEL = "pr pt"
+GHSA_ID_RE = re.compile(r"GHSA-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}", re.IGNORECASE)
+
+# Marker line of the issue comment that carries the changelog text of a
+# breaking change. Everything after the marker line is the entry content.
+BREAKING_NOTE_RE = re.compile(r"(?im)^#{1,3}[ \t]+Breaking change note[ \t]*$")
+
+# Level used for the headings found inside a breaking change note. Entries
+# themselves are level-4 headings, so note headings must live below them.
+NOTE_HEADING = "#####"
+
+# Emoji prefixes used at the start of issue titles (`:bug:`, `:sparkles:`).
+TITLE_PREFIX_RE = re.compile(r"^(?::[A-Za-z0-9_+-]+:\s*)+")
+
# ─────────────────────────────────────────────
# Shared helpers
@@ -125,6 +152,84 @@ def collect_changelog_issues(section: str) -> set[int]:
return numbers
+def issue_excluded(issue: dict | None) -> bool:
+ """Return True when an issue must stay out of the changelog.
+
+ Shared by the ``report`` and ``boom`` subcommands so the exclusions
+ cannot drift apart.
+ """
+ if not issue:
+ return True
+ if issue.get("state") != "CLOSED":
+ return True
+ if issue.get("issue_type") in {"Task"}:
+ return True
+ if issue.get("project_status") in {"Rejected"}:
+ return True
+ if EXCLUDED_LABELS & set(issue.get("labels", [])):
+ return True
+ return False
+
+
+def extract_breaking_note(comment_body: str | None) -> str | None:
+ """Return the content that follows a ``## Breaking change note`` marker.
+
+ The whole comment is used (paragraphs, lists, code blocks), not just its
+ first paragraph, so a breaking change can be as detailed as needed.
+ """
+ if not comment_body:
+ return None
+ match = BREAKING_NOTE_RE.search(comment_body)
+ if not match:
+ return None
+ content = demote_headings(comment_body[match.end():].strip("\n"))
+ return content.strip() or None
+
+
+def demote_headings(markdown: str) -> str:
+ """Push note headings below the entry heading, leaving code fences alone."""
+ lines: list[str] = []
+ in_fence = False
+ for line in markdown.splitlines():
+ if line.lstrip().startswith(("```", "~~~")):
+ in_fence = not in_fence
+ lines.append(line)
+ continue
+ if not in_fence:
+ match = re.match(r"^#{1,4}([ \t]+.*)$", line)
+ if match:
+ line = NOTE_HEADING + match.group(1)
+ lines.append(line)
+ return "\n".join(lines)
+
+
+def strip_title_prefix(title: str) -> str:
+ """Remove leading emoji shortcodes from a title."""
+ return TITLE_PREFIX_RE.sub("", title).strip()
+
+
+def closing_pr_numbers(issue: dict) -> list[int]:
+ """Return the sorted closing PR numbers of an issue."""
+ return sorted(set(issue.get("closing_prs", [])))
+
+
+def render_boom_entry(
+ issue: dict,
+ note: str | None,
+ pr_numbers: list[int],
+ author: str | None = None,
+) -> str:
+ """Render one ``:boom:`` entry: title, note content and references."""
+ title = strip_title_prefix(issue["title"])
+ attribution = f"(by @{author}) " if author else ""
+ refs = attribution + issue_link(issue["number"])
+ if pr_numbers:
+ refs += " (PR: " + ", ".join(pr_link(n) for n in pr_numbers) + ")"
+ if note:
+ return f"#### {title}\n\n{note}\n\n{refs}"
+ return f"#### {title}\n\n{refs}"
+
+
# ─────────────────────────────────────────────
# Subcommand: check-merged
# ─────────────────────────────────────────────
@@ -155,6 +260,324 @@ def cmd_check_merged(args: argparse.Namespace) -> None:
print(f"OK: all {len(prs)} PRs are merged", file=sys.stderr)
+# ─────────────────────────────────────────────
+# Subcommand: boom
+# ─────────────────────────────────────────────
+
+
+def version_section_bounds(content: str, milestone: str) -> tuple[int, int] | None:
+ """Return the ``[start, end)`` offsets of a ``## `` section."""
+ match = re.search(
+ rf"(?m)^## {re.escape(milestone)}(?:[ \t]*\([^)]*\))?[ \t]*$", content
+ )
+ if not match:
+ return None
+ start = match.start()
+ next_heading = re.search(r"(?m)^## ", content[match.end():])
+ end = match.end() + next_heading.start() if next_heading else len(content)
+ return start, end
+
+
+def entry_list_body(entries: list[str]) -> str:
+ """Return the body text that follows a generated subsection heading."""
+ if entries:
+ return "\n\n" + "\n\n".join(entries) + "\n\n"
+ return "\n\n"
+
+
+def replace_boom_section(content: str, milestone: str, entries: list[str]) -> str:
+ """Return ``content`` with its ``:boom:`` subsection replaced.
+
+ The subsection is inserted right after the version header when missing,
+ which keeps ``:boom:`` as the first section.
+ """
+ bounds = version_section_bounds(content, milestone)
+ if bounds is None:
+ raise ValueError(f'no "## {milestone}" section found')
+ start, end = bounds
+ section = content[start:end]
+ heading = re.search(rf"(?m)^{re.escape(BOOM_HEADING)}[ \t]*$", section)
+ if heading:
+ body_start = start + heading.end()
+ next_heading = re.search(r"(?m)^### ", content[body_start:end])
+ body_end = body_start + next_heading.start() if next_heading else end
+ return content[:body_start] + entry_list_body(entries) + content[body_end:]
+ header = re.match(r"(?m)^## [^\n]*\n", section)
+ if header is None:
+ raise ValueError(f'version "## {milestone}" header has no trailing newline')
+ insert_at = start + header.end()
+ block = "\n" + BOOM_HEADING + entry_list_body(entries)[:-1]
+ return content[:insert_at] + block + content[insert_at:]
+
+
+def fetch_prs_by_issue(issues: list[dict]) -> dict[int, dict]:
+ """Fetch every closing PR of ``issues``, keyed by PR number."""
+ numbers = sorted({n for issue in issues for n in issue.get("closing_prs", [])})
+ if not numbers:
+ return {}
+ return {pr["number"]: pr for pr in fetch_prs_by_numbers(numbers)}
+
+
+def fetch_breaking_notes(issues: list[dict]) -> dict[int, str]:
+ """Return the last ``## Breaking change note`` comment of each issue."""
+ if not issues:
+ return {}
+ comments = json.loads(
+ run_gh_py("comments", *[str(issue["number"]) for issue in issues])
+ )
+ notes: dict[int, str] = {}
+ for comment in comments:
+ note = extract_breaking_note(comment.get("body"))
+ if note is None:
+ continue
+ number = comment["issue"]
+ if number in notes:
+ print(
+ f'WARNING: issue #{number} has several "## Breaking change note" '
+ "comments; using the last one",
+ file=sys.stderr,
+ )
+ notes[number] = note
+ return notes
+
+
+def cmd_boom(args: argparse.Namespace) -> None:
+ """Generate the ``:boom:`` section from ``breaking change`` issues."""
+ all_issues = json.loads(run_gh_py("issues", args.milestone, "--state", "all"))
+ labelled = sorted(
+ (
+ issue
+ for issue in all_issues
+ if BREAKING_LABEL in issue.get("labels", [])
+ and not issue_excluded(issue)
+ ),
+ key=lambda issue: issue["number"],
+ )
+
+ notes: dict[int, str] = {}
+ prs: dict[int, dict] = {}
+ if labelled:
+ notes = fetch_breaking_notes(labelled)
+ prs = fetch_prs_by_issue(labelled)
+
+ entries: list[str] = []
+ for issue in labelled:
+ note = notes.get(issue["number"])
+ if not note:
+ print(
+ f'WARNING: issue #{issue["number"]} has no "## Breaking change note" '
+ "comment; the entry will have no description",
+ file=sys.stderr,
+ )
+ merged = [
+ prs[num]
+ for num in closing_pr_numbers(issue)
+ if num in prs and prs[num].get("state") == "MERGED"
+ ]
+ author = None
+ if "community contribution" in issue.get("labels", []):
+ authors = [pr["author"] for pr in merged if pr.get("author")]
+ author = authors[0] if authors else None
+ entries.append(
+ render_boom_entry(issue, note, [pr["number"] for pr in merged], author)
+ )
+
+ block = BOOM_HEADING + entry_list_body(entries)
+ print(block.rstrip("\n"))
+
+ if not labelled:
+ print(
+ f"No closed issues labelled `{BREAKING_LABEL}` in {args.milestone}",
+ file=sys.stderr,
+ )
+
+ if args.write:
+ with open(args.changes) as f:
+ content = f.read()
+ try:
+ updated = replace_boom_section(content, args.milestone, entries)
+ except ValueError as err:
+ print(f"ERROR: {err}", file=sys.stderr)
+ sys.exit(1)
+ if updated == content:
+ print(f"{args.changes}: :boom: section already up to date", file=sys.stderr)
+ else:
+ with open(args.changes, "w") as f:
+ f.write(updated)
+ print(f"{args.changes}: :boom: section updated", file=sys.stderr)
+
+
+# ─────────────────────────────────────────────
+# Subcommand: security
+# ─────────────────────────────────────────────
+
+
+def imperative_description(summary: str) -> str:
+ """Return a changelog description built from an advisory summary.
+
+ Advisory summaries are declarative ("Missing authorization in ... lets
+ ..."), so the description prefixes ``Fix`` and decapitalizes the first
+ word unless it starts with an acronym (``SVG``, ``CVE-...``). The wording
+ may still be polished in the flow; re-running ``security --write``
+ rewrites the entry from the advisory summary.
+ """
+ summary = strip_title_prefix((summary or "").strip())
+ if not summary:
+ return ""
+ first_word = summary.split(maxsplit=1)[0]
+ if len(first_word) > 1 and first_word[1:].islower():
+ summary = summary[0].lower() + summary[1:]
+ return f"Fix {summary}"
+
+
+def render_security_entry(advisory: dict, pr_numbers: list[int]) -> str:
+ """Render one ``:lock:`` entry: description, advisory link and PRs."""
+ ghsa_id = advisory["ghsa_id"]
+ url = advisory.get("url") or (
+ f"https://github.com/{REPO}/security/advisories/{ghsa_id}"
+ )
+ description = imperative_description(advisory.get("summary", "")) or (
+ "Fix a security issue"
+ )
+ entry = f"- {description} ({url})"
+ if pr_numbers:
+ entry += " (PR: " + ", ".join(pr_link(n) for n in pr_numbers) + ")"
+ return entry
+
+
+def fetch_security_advisories(milestone: str) -> list[dict]:
+ """Fetch the advisories that declare ``milestone`` as a patched version."""
+ return json.loads(run_gh_py("advisories", "--patched-version", milestone))
+
+
+def fetch_security_prs(milestone: str) -> dict[str, list[int]]:
+ """Map each GHSA id to the merged ``pr pt`` PRs in a milestone referencing it."""
+ by_ghsa: dict[str, list[int]] = {}
+ for pr in fetch_milestone_prs(milestone, "all"):
+ if pr.get("state") != "MERGED":
+ continue
+ if SECURITY_PR_LABEL not in pr.get("labels", []):
+ continue
+ for ghsa_id in GHSA_ID_RE.findall(pr.get("body") or ""):
+ by_ghsa.setdefault(ghsa_id.upper(), []).append(pr["number"])
+ return {ghsa_id: sorted(set(numbers)) for ghsa_id, numbers in by_ghsa.items()}
+
+
+def subsection_end(
+ content: str, section: str, start: int, end: int, heading_re: str
+) -> int | None:
+ """Return the offset where the body of a ``###`` subsection ends.
+
+ ``heading_re`` is a prefix of the heading line (e.g. ``### :rocket:``), so
+ the heading text that follows it does not matter.
+ """
+ match = re.search(rf"(?m)^{heading_re}", section)
+ if not match:
+ return None
+ body_start = start + match.end()
+ next_heading = re.search(r"(?m)^### ", content[body_start:end])
+ return body_start + next_heading.start() if next_heading else end
+
+
+def replace_security_section(
+ content: str, milestone: str, entries: list[str]
+) -> str:
+ """Return ``content`` with its ``:lock:`` subsection replaced or added.
+
+ The subsection follows ``:rocket:`` (or ``:boom:`` when there is no
+ ``:rocket:``, or the version header when neither exists), which keeps the
+ layout order. An empty ``entries`` list removes the subsection: the
+ heading only exists when the version has security fixes to list.
+ """
+ bounds = version_section_bounds(content, milestone)
+ if bounds is None:
+ raise ValueError(f'no "## {milestone}" section found')
+ start, end = bounds
+ section = content[start:end]
+
+ heading = re.search(rf"(?m)^{re.escape(SECURITY_HEADING)}[ \t]*$", section)
+ if heading:
+ heading_start = start + heading.start()
+ body_start = start + heading.end()
+ next_heading = re.search(r"(?m)^### ", content[body_start:end])
+ body_end = body_start + next_heading.start() if next_heading else end
+ if not entries:
+ return content[:heading_start] + content[body_end:]
+ return (
+ content[:heading_start]
+ + SECURITY_HEADING
+ + entry_list_body(entries)
+ + content[body_end:]
+ )
+
+ if not entries:
+ return content
+
+ anchor = subsection_end(content, section, start, end, r"### :rocket:")
+ if anchor is None:
+ anchor = subsection_end(content, section, start, end, r"### :boom:")
+ if anchor is None:
+ header = re.match(r"(?m)^## [^\n]*\n", section)
+ if header is None:
+ raise ValueError(f'version "## {milestone}" header has no trailing newline')
+ insert_at = start + header.end()
+ block = "\n" + SECURITY_HEADING + entry_list_body(entries)[:-1]
+ return content[:insert_at] + block + content[insert_at:]
+
+ block = SECURITY_HEADING + entry_list_body(entries)
+ return content[:anchor] + block + content[anchor:]
+
+
+def cmd_security(args: argparse.Namespace) -> None:
+ """Generate the ``:lock:`` section from advisories fixed in the version."""
+ milestone = args.milestone
+ advisories = fetch_security_advisories(milestone)
+ prs_by_ghsa = fetch_security_prs(milestone)
+
+ matched = {
+ advisory["ghsa_id"].upper()
+ for advisory in advisories
+ if advisory.get("ghsa_id")
+ }
+ for ghsa_id in sorted(set(prs_by_ghsa) - matched):
+ numbers = ", ".join(f"#{n}" for n in prs_by_ghsa[ghsa_id])
+ print(
+ f"WARNING: PR {numbers} references {ghsa_id}, which declares no patched "
+ f'version "{milestone}"; it will not be listed under :lock:',
+ file=sys.stderr,
+ )
+
+ entries = [
+ render_security_entry(
+ advisory, prs_by_ghsa.get(advisory["ghsa_id"].upper(), [])
+ )
+ for advisory in sorted(advisories, key=lambda advisory: advisory["ghsa_id"])
+ ]
+
+ if entries:
+ print((SECURITY_HEADING + entry_list_body(entries)).rstrip("\n"))
+ else:
+ print(
+ f"No advisories declare patched version {milestone}",
+ file=sys.stderr,
+ )
+
+ if args.write:
+ with open(args.changes) as f:
+ content = f.read()
+ try:
+ updated = replace_security_section(content, milestone, entries)
+ except ValueError as err:
+ print(f"ERROR: {err}", file=sys.stderr)
+ sys.exit(1)
+ if updated == content:
+ print(f"{args.changes}: :lock: section already up to date", file=sys.stderr)
+ else:
+ with open(args.changes, "w") as f:
+ f.write(updated)
+ print(f"{args.changes}: :lock: section updated", file=sys.stderr)
+
+
# ─────────────────────────────────────────────
# Subcommand: cross-ref
# ─────────────────────────────────────────────
@@ -298,21 +721,6 @@ def cmd_report(args: argparse.Namespace) -> None:
"""Return the milestone title for an issue, or None if unassigned."""
return issue_milestone_cache.get(issue_num)
- excluded_labels = {"release blocker", "no changelog"}
-
- def issue_excluded(issue: dict | None) -> bool:
- if not issue:
- return True
- if issue.get("state") != "CLOSED":
- return True
- if issue.get("issue_type") in {"Task"}:
- return True
- if issue.get("project_status") in {"Rejected"}:
- return True
- if excluded_labels & set(issue.get("labels", [])):
- return True
- return False
-
# Type A: issue in milestone, referenced PR in different milestone or none
anomalies_a = []
for issue_num in sorted(changelog_issues):
@@ -361,13 +769,14 @@ def cmd_report(args: argparse.Namespace) -> None:
# These stay in the changelog (they are preserved, not removed) — the
# human decides whether to label the issue or move the entry elsewhere.
anomalies_e = []
- boom_body = extract_subsection(section, r"### :boom:")
- if boom_body:
- for issue_num in sorted(collect_changelog_issues(boom_body)):
+ boom_section_body = extract_subsection(section, r"### :boom:")
+ boom_issues = collect_changelog_issues(boom_section_body)
+ if boom_section_body:
+ for issue_num in sorted(boom_issues):
labels = get_issue_labels(issue_num)
if labels is None:
continue
- if "breaking change" not in labels:
+ if BREAKING_LABEL not in labels:
issue = issue_by_num.get(issue_num) or external_issues.get(issue_num) or {}
anomalies_e.append(
{
@@ -406,6 +815,20 @@ def cmd_report(args: argparse.Namespace) -> None:
}
)
+ # Type G: `breaking change` issue missing from :boom:. Same contract as
+ # type F for highlights: the label is the only source of the section.
+ anomalies_g = []
+ for issue_num, issue in sorted(issue_by_num.items()):
+ if issue_excluded(issue) or issue_num in boom_issues:
+ continue
+ if BREAKING_LABEL in issue.get("labels", []):
+ anomalies_g.append(
+ {
+ "issue": issue_num,
+ "issue_title": issue.get("title", ""),
+ }
+ )
+
# Type C: released X.Y.0 sections without a :rocket: subsection.
# Patches (X.Y.Z with Z != 0) never carry :rocket: — only minors/majors.
anomalies_c = []
@@ -459,13 +882,14 @@ def cmd_report(args: argparse.Namespace) -> None:
)
f.write("---\n\n")
- n_a, n_b, n_c, n_d, n_e, n_f = (
+ n_a, n_b, n_c, n_d, n_e, n_f, n_g = (
len(anomalies_a),
len(anomalies_b),
len(anomalies_c),
len(anomalies_d),
len(anomalies_e),
len(anomalies_f),
+ len(anomalies_g),
)
f.write("## Summary\n\n")
@@ -476,14 +900,15 @@ def cmd_report(args: argparse.Namespace) -> None:
f"- **PR in {milestone}, closing issue in a different milestone:** {n_b}\n"
)
f.write(f"- **:boom: entry without breaking change label:** {n_e}\n")
+ f.write(f"- **:boom: out of sync with breaking change label:** {n_g}\n")
f.write(f"- **:rocket: out of sync with release highlight label:** {n_f}\n")
- f.write(f"- **Total anomalies:** {n_a + n_b + n_e + n_f}\n")
+ f.write(f"- **Total anomalies:** {n_a + n_b + n_e + n_f + n_g}\n")
f.write(
f"- **Released X.Y.0 version missing :rocket: section (gap):** {n_c}\n"
)
f.write(f"- **:rocket: entry without issue AND PR references (gap):** {n_d}\n\n")
- if n_a or n_b or n_e or n_f:
+ if n_a or n_b or n_e or n_f or n_g:
f.write("## Anomalies\n\n")
f.write(
"Types A and B are milestone mismatches between an issue in the changelog "
@@ -494,8 +919,9 @@ def cmd_report(args: argparse.Namespace) -> None:
"removing the misleading entry from the changelog.\n\n"
"Type E entries stay in the changelog: either label the issue "
"as `breaking change` or move the entry out of `:boom:`.\n\n"
- "Type F is a rule violation: `:rocket:` must list exactly the "
- "issues labelled `release highlight`. Fix the label on GitHub "
+ "Types F and G are rule violations: `:rocket:` must list exactly "
+ "the issues labelled `release highlight`, and `:boom:` exactly "
+ "the issues labelled `breaking change`. Fix the label on GitHub "
"or re-run the workflow.\n\n"
)
@@ -556,6 +982,18 @@ def cmd_report(args: argparse.Namespace) -> None:
f"- ⚠️ {issue_link_title(e['issue'], e['issue_title'][:80])}: {e['reason']}\n"
)
f.write("\n")
+
+ if n_g:
+ f.write("\n### :boom: out of sync with breaking change label\n\n")
+ f.write(
+ "These milestone issues carry the `breaking change` label but "
+ "have no entry under `### :boom: Breaking changes & Deprecations`. "
+ "Regenerate the section (`changelog.py boom --write`) or add "
+ "the entry.\n\n"
+ )
+ for e in anomalies_g:
+ f.write(f"- ⚠️ {issue_link_title(e['issue'], e['issue_title'][:80])}\n")
+ f.write("\n")
else:
f.write(
"✅ No anomalies found. All (issue, PR) pairs in the changelog have aligned milestone assignments.\n\n"
@@ -590,7 +1028,7 @@ def cmd_report(args: argparse.Namespace) -> None:
for d in anomalies_d:
f.write(f"- **{d['version']}**: `{d['line']}`\n")
f.write("\n")
- elif not (n_a or n_b or n_e or n_f):
+ elif not (n_a or n_b or n_e or n_f or n_g):
f.write(
"✅ No highlight gaps found. All released X.Y.0 versions have properly referenced :rocket: entries.\n\n"
)
@@ -618,7 +1056,7 @@ def cmd_report(args: argparse.Namespace) -> None:
def main() -> None:
parser = argparse.ArgumentParser(
- description="Helper commands for the update-changelog skill"
+ description="Helper commands for the changelog flow"
)
sub = parser.add_subparsers(dest="command", required=True, title="subcommands")
@@ -633,6 +1071,26 @@ def main() -> None:
help="Read PR numbers from stdin (one per line)")
p_check.set_defaults(func=cmd_check_merged)
+ p_boom = sub.add_parser(
+ "boom", help="Generate the :boom: section from `breaking change` issues"
+ )
+ p_boom.add_argument("milestone", help="Milestone title (e.g. '2.16.0')")
+ p_boom.add_argument("--changes", default="CHANGES.md",
+ help="Path to the changelog file (default: CHANGES.md)")
+ p_boom.add_argument("--write", action="store_true",
+ help="Replace the :boom: section in CHANGES.md in place")
+ p_boom.set_defaults(func=cmd_boom)
+
+ p_security = sub.add_parser(
+ "security", help="Generate the :lock: section from advisories fixed in a version"
+ )
+ p_security.add_argument("milestone", help="Milestone title (e.g. '2.19.1')")
+ p_security.add_argument("--changes", default="CHANGES.md",
+ help="Path to the changelog file (default: CHANGES.md)")
+ p_security.add_argument("--write", action="store_true",
+ help="Replace the :lock: section in CHANGES.md in place")
+ p_security.set_defaults(func=cmd_security)
+
p_cross = sub.add_parser(
"cross-ref",
help="Compare merged milestone PRs against the changelog section",
diff --git a/scripts/ci b/scripts/ci
index 4428b673f9..e2ed5cd6e0 100755
--- a/scripts/ci
+++ b/scripts/ci
@@ -24,7 +24,7 @@ BOLD='\033[1m'
NC='\033[0m'
# Available modules
-ALL_MODULES=("frontend" "backend" "common" "render-wasm" "exporter" "mcp" "plugins" "library")
+ALL_MODULES=("frontend" "backend" "common" "render-wasm" "exporter" "mcp" "plugins" "library" "media-processor")
# Module commands
declare -A LINT_CMD=(
@@ -36,6 +36,7 @@ declare -A LINT_CMD=(
[mcp]=""
[plugins]="pnpm run lint"
[library]="pnpm run lint"
+ [media-processor]=""
)
declare -A TEST_CMD=(
@@ -47,28 +48,43 @@ declare -A TEST_CMD=(
[mcp]="pnpm run test"
[plugins]="pnpm run test"
[library]="pnpm run test"
+ [media-processor]="pnpm run test"
)
declare -A FMT_CHECK_CMD=(
[frontend]="pnpm run check-fmt:clj && pnpm run check-fmt:js && pnpm run check-fmt:scss"
[backend]="pnpm run check-fmt:clj"
[common]="pnpm run check-fmt:clj && pnpm run check-fmt:js"
- [render-wasm]="cargo fmt --check"
+ [render-wasm]="./fmt --check"
[exporter]="pnpm run check-fmt:clj"
[mcp]="pnpm run fmt:check"
[plugins]="pnpm run format:check"
[library]="pnpm run check-fmt:clj"
+ [media-processor]="pnpm run fmt:check"
)
declare -A FMT_FIX_CMD=(
[frontend]="pnpm run fmt:clj && pnpm run fmt:js && pnpm run fmt:scss"
[backend]="pnpm run fmt:clj"
[common]="pnpm run fmt:clj && pnpm run fmt:js"
- [render-wasm]="cargo fmt"
+ [render-wasm]="./fmt"
[exporter]="pnpm run fmt:clj"
[mcp]="pnpm run fmt"
[plugins]="pnpm run format"
[library]="pnpm run fmt:clj"
+ [media-processor]="pnpm run fmt"
+)
+
+declare -A BUILD_CMD=(
+ [frontend]="NODE_ENV=production pnpm run build:app:main && pnpm run build:app:libs && pnpm run build:app:assets"
+ [backend]="clojure -T:build jar"
+ [common]=""
+ [render-wasm]="./build"
+ [exporter]="NODE_ENV=production pnpm run build:app"
+ [mcp]="pnpm run build"
+ [plugins]="pnpm run build:runtime && pnpm run build:plugins && pnpm run build:styles-example && pnpm run build:doc"
+ [library]="NODE_ENV=production clojure -M:dev:shadow-cljs release library"
+ [media-processor]="pnpm run types:check && pnpm run build"
)
declare -A PAREN_REPAIR_CMD=(
@@ -80,6 +96,7 @@ declare -A PAREN_REPAIR_CMD=(
[mcp]=""
[plugins]=""
[library]="find src test -name '*.clj' -o -name '*.cljs' -o -name '*.cljc' | xargs $PROJECT_ROOT/scripts/paren-repair"
+ [media-processor]=""
)
# Default options
@@ -197,6 +214,9 @@ run_module() {
cmd="${FMT_CHECK_CMD[$module]:-}"
fi
;;
+ build)
+ cmd="${BUILD_CMD[$module]:-}"
+ ;;
paren-repair)
cmd="${PAREN_REPAIR_CMD[$module]:-}"
;;
@@ -282,8 +302,8 @@ Usage: $(basename "$0") [OPTIONS] [MODULES...]
CI orchestration script for Penpot monorepo.
MODULES:
- frontend, backend, common, render-wasm, exporter, mcp, plugins, library
- Use --all to run all modules.
+ frontend, backend, common, render-wasm, exporter, mcp, plugins, library,
+ media-processor. Use --all to run all modules.
OPTIONS:
--all Run all modules
@@ -294,6 +314,8 @@ OPTIONS:
--no-test Skip tests
--fmt Run format check only
--no-fmt Skip format check
+ --build Run production build only
+ --no-build Skip build
--fix Run format fix instead of check
--paren-repair Fix delimiter errors in Clojure/CLJS files
--fail-fast Stop on first failure
@@ -307,6 +329,8 @@ EXAMPLES:
$(basename "$0") frontend backend # Run lint, test, fmt on frontend and backend
$(basename "$0") --all --no-test # Run lint and fmt on all modules
$(basename "$0") --lint common # Run only lint on common
+ $(basename "$0") --build frontend # Run only the production build of frontend
+ $(basename "$0") --build --all # Build every module
$(basename "$0") --fix frontend # Fix formatting in frontend
$(basename "$0") --paren-repair frontend # Fix delimiter errors in frontend
$(basename "$0") --paren-repair --all # Fix delimiter errors in all Clojure modules
@@ -353,6 +377,14 @@ main() {
TASKS=("${TASKS[@]/fmt/}")
shift
;;
+ --build)
+ TASKS=("build")
+ shift
+ ;;
+ --no-build)
+ TASKS=("${TASKS[@]/build/}")
+ shift
+ ;;
--paren-repair)
TASKS=("paren-repair")
shift
diff --git a/scripts/gh.py b/scripts/gh.py
index c430fbe843..eebd5155fd 100755
--- a/scripts/gh.py
+++ b/scripts/gh.py
@@ -6,6 +6,8 @@ Uses GitHub GraphQL and REST APIs via the authenticated ``gh`` CLI.
Subcommands:
issues List issues in a milestone (or unassigned with milestone=none)
+ issue Fetch issue details by number (batched)
+ comments Fetch every comment of one or more issues
prs Fetch details for one or more PRs (by number or milestone)
advisories List or inspect GitHub security advisories
link-issue Explicitly link a GitHub issue to a pull request
@@ -26,8 +28,10 @@ Usage:
python3 scripts/gh.py prs --milestone "2.16.0" (default: state=merged)
python3 scripts/gh.py prs --milestone "2.16.0" --state all
python3 scripts/gh.py issue 11235 11236
+ python3 scripts/gh.py comments 11235 11236
python3 scripts/gh.py advisories (list all advisories)
python3 scripts/gh.py advisories --severity critical (filter by severity)
+ python3 scripts/gh.py advisories --patched-version 2.19.1 (filter by patched version)
python3 scripts/gh.py advisories GHSA-xvj6-fh9w-gjw7 (single advisory detail)
python3 scripts/gh.py link-issue 11235 11243
@@ -888,6 +892,51 @@ def cmd_issue(args: argparse.Namespace) -> None:
print(json.dumps(all_results, indent=2))
+# ─────────────────────────────────────────────
+# Subcommand: comments
+# ─────────────────────────────────────────────
+
+COMMENTS_PER_PAGE = 100
+
+
+def fetch_issue_comments(issue_number: int) -> list[dict]:
+ """Fetch every comment of an issue via REST, oldest first."""
+ comments: list[dict] = []
+ page = 1
+ while True:
+ batch = run_gh_rest(
+ f"repos/{REPO}/issues/{issue_number}/comments"
+ f"?per_page={COMMENTS_PER_PAGE}&page={page}"
+ )
+ for comment in batch:
+ comments.append({
+ "issue": issue_number,
+ "id": comment["id"],
+ "author": (comment.get("user") or {}).get("login"),
+ "created_at": comment.get("created_at"),
+ "body": comment.get("body"),
+ })
+ if len(batch) < COMMENTS_PER_PAGE:
+ return comments
+ page += 1
+
+
+def cmd_comments(args: argparse.Namespace) -> None:
+ """Handle the ``comments`` subcommand (REST, paginated per issue)."""
+ issue_numbers = read_numbers_from_args(args)
+ if not issue_numbers:
+ print("ERROR: no issue numbers provided (pass numbers, --file, or --stdin)",
+ file=sys.stderr)
+ sys.exit(1)
+
+ all_comments: list[dict] = []
+ for num in issue_numbers:
+ print(f"Fetching comments for issue #{num}...", file=sys.stderr)
+ all_comments.extend(fetch_issue_comments(num))
+
+ print(json.dumps(all_comments, indent=2))
+
+
# ─────────────────────────────────────────────
# Subcommand: advisories
# ─────────────────────────────────────────────
@@ -932,6 +981,22 @@ def format_advisory_summary(adv: dict) -> dict:
}
+def advisory_patched_versions(adv: dict) -> list[str]:
+ """Return every patched version declared by an advisory's vulnerabilities."""
+ versions: list[str] = []
+ for vuln in adv.get("vulnerabilities", []):
+ for token in re.split(r"[,;]", vuln.get("patched_versions") or ""):
+ token = token.strip()
+ if token and token not in versions:
+ versions.append(token)
+ return versions
+
+
+def advisory_fixed_in_version(adv: dict, version: str) -> bool:
+ """Return True when the advisory declares ``version`` among its patched ones."""
+ return version in advisory_patched_versions(adv)
+
+
def format_advisory_detail(adv: dict) -> dict:
"""Extract full detail view of an advisory."""
summary = format_advisory_summary(adv)
@@ -972,6 +1037,16 @@ def cmd_advisories(args: argparse.Namespace) -> None:
advisories = fetch_advisories()
print(f"Fetched {len(advisories)} advisories", file=sys.stderr)
+ if args.patched_version:
+ version = args.patched_version.strip()
+ advisories = [
+ adv for adv in advisories if advisory_fixed_in_version(adv, version)
+ ]
+ print(
+ f"After patched-version filter ({version}): {len(advisories)} advisories",
+ file=sys.stderr,
+ )
+
results = [format_advisory_summary(adv) for adv in advisories]
# Apply filters
@@ -1080,6 +1155,24 @@ def main() -> None:
)
p_issue.set_defaults(func=cmd_issue)
+ # --- comments ---
+ p_comments = sub.add_parser(
+ "comments", help="Fetch every comment of one or more issues"
+ )
+ p_comments.add_argument(
+ "numbers", type=int, nargs="*",
+ help="Issue numbers to fetch (space-separated)"
+ )
+ p_comments.add_argument(
+ "--file", type=str,
+ help="File with one issue number per line"
+ )
+ p_comments.add_argument(
+ "--stdin", action="store_true",
+ help="Read issue numbers from stdin (one per line)"
+ )
+ p_comments.set_defaults(func=cmd_comments)
+
# --- advisories ---
p_adv = sub.add_parser("advisories", help="List or inspect GitHub security advisories")
p_adv.add_argument(
@@ -1094,6 +1187,10 @@ def main() -> None:
"--state", choices=["triage", "draft", "published", "closed", "withdrawn"],
help="Filter by advisory state"
)
+ p_adv.add_argument(
+ "--patched-version", type=str,
+ help="Filter by patched version declared in the advisory (e.g. '2.19.1')"
+ )
p_adv.set_defaults(func=cmd_advisories)
args = parser.parse_args()
diff --git a/scripts/sync-pnpm-version b/scripts/sync-pnpm-version
index e87cf17500..149b072955 100755
--- a/scripts/sync-pnpm-version
+++ b/scripts/sync-pnpm-version
@@ -27,7 +27,8 @@ Options:
-h, --help Show this help.
external/ (vendored trees with their own lifecycles), .opencode/,
-.pnpm-store/, bundles/ and docker build-context copies are never stamped.
+.pnpm-store/, bundles/, build output (target/) and docker build-context
+copies are never stamped.
EOF
}
@@ -91,7 +92,7 @@ mapfile -t files < <(
find . \
\( -name .git -o -name node_modules -o -name .pnpm-store \
-o -name external -o -name .opencode -o -name bundles \
- -o -name .angular \) -type d -prune \
+ -o -name target -o -name .angular \) -type d -prune \
-o -path './docker/images/bundle-*' -prune \
-o -name package.json -type f -print | sort
)
diff --git a/scripts/test_changelog.py b/scripts/test_changelog.py
new file mode 100644
index 0000000000..e27d3de1d2
--- /dev/null
+++ b/scripts/test_changelog.py
@@ -0,0 +1,661 @@
+#!/usr/bin/env python3
+"""Tests for scripts/changelog.py.
+
+Run with:
+
+ python3 scripts/test_changelog.py
+"""
+
+import argparse
+import contextlib
+import importlib.machinery
+import importlib.util
+import io
+import json
+import pathlib
+import sys
+import tempfile
+import unittest
+from unittest.mock import patch
+
+
+# Loading scripts/changelog.py should not emit scripts/__pycache__/.
+sys.dont_write_bytecode = True
+
+SCRIPT_PATH = pathlib.Path(__file__).resolve().parent / "changelog.py"
+
+
+def load_changelog():
+ """Load scripts/changelog.py as a module without running its CLI."""
+ loader = importlib.machinery.SourceFileLoader("changelog_helper", str(SCRIPT_PATH))
+ spec = importlib.util.spec_from_loader("changelog_helper", loader)
+ module = importlib.util.module_from_spec(spec)
+ loader.exec_module(module)
+ return module
+
+
+ch = load_changelog()
+
+CHANGES = """# CHANGELOG
+
+## 2.19.0 (Unreleased)
+
+### :boom: Breaking changes & Deprecations
+
+- Old entry.
+
+### :rocket: Epics and highlights
+
+- Add highlights [#1](https://github.com/penpot/penpot/issues/1)
+"""
+
+
+class ExtractBreakingNoteTests(unittest.TestCase):
+ def test_uses_the_whole_comment_after_the_marker(self):
+ body = (
+ "## Breaking change note\n\n"
+ "First paragraph.\n\n"
+ "- bullet one\n"
+ "- bullet two\n\n"
+ "```sql\nSELECT 1;\n```\n"
+ )
+ self.assertEqual(
+ ch.extract_breaking_note(body),
+ "First paragraph.\n\n- bullet one\n- bullet two\n\n"
+ "```sql\nSELECT 1;\n```",
+ )
+
+ def test_accepts_any_heading_level_for_the_marker(self):
+ self.assertEqual(
+ ch.extract_breaking_note("# breaking change note\n\nText."), "Text."
+ )
+ self.assertEqual(
+ ch.extract_breaking_note("### Breaking Change Note\n\nText."), "Text."
+ )
+
+ def test_returns_none_without_marker(self):
+ self.assertIsNone(ch.extract_breaking_note("### Description\n\ntext\n"))
+ self.assertIsNone(ch.extract_breaking_note("## Breaking change notes\n\ntext"))
+ self.assertIsNone(ch.extract_breaking_note(None))
+ self.assertIsNone(ch.extract_breaking_note(""))
+
+ def test_returns_none_for_a_marker_without_content(self):
+ self.assertIsNone(ch.extract_breaking_note("## Breaking change note\n"))
+
+
+class DemoteHeadingsTests(unittest.TestCase):
+ def test_demotes_headings_below_the_entry_level(self):
+ markdown = "# One\n## Two\n### Three\n#### Four\n##### Five\n"
+ self.assertEqual(
+ ch.demote_headings(markdown),
+ "##### One\n##### Two\n##### Three\n##### Four\n##### Five",
+ )
+
+ def test_keeps_headings_inside_code_fences(self):
+ markdown = (
+ "```bash\n# not a heading\n```\n"
+ "## Real heading\n"
+ "~~~\n### not a heading\n~~~\n"
+ )
+ self.assertEqual(
+ ch.demote_headings(markdown),
+ "```bash\n# not a heading\n```\n"
+ "##### Real heading\n"
+ "~~~\n### not a heading\n~~~",
+ )
+
+
+class StripTitlePrefixTests(unittest.TestCase):
+ def test_strips_shortcodes(self):
+ self.assertEqual(ch.strip_title_prefix(":boom: Enable it"), "Enable it")
+ self.assertEqual(ch.strip_title_prefix(":bug: :tada: Fix it"), "Fix it")
+ self.assertEqual(ch.strip_title_prefix("Plain title"), "Plain title")
+
+
+class IssueExcludedTests(unittest.TestCase):
+ def issue(self, **overrides):
+ base = {
+ "state": "CLOSED",
+ "issue_type": "Enhancement",
+ "project_status": "In progress",
+ "labels": [],
+ }
+ base.update(overrides)
+ return base
+
+ def test_keeps_a_valid_closed_issue(self):
+ self.assertFalse(ch.issue_excluded(self.issue()))
+
+ def test_excludes_open_task_rejected_and_labelled(self):
+ self.assertTrue(ch.issue_excluded(None))
+ self.assertTrue(ch.issue_excluded(self.issue(state="OPEN")))
+ self.assertTrue(ch.issue_excluded(self.issue(issue_type="Task")))
+ self.assertTrue(ch.issue_excluded(self.issue(project_status="Rejected")))
+ self.assertTrue(ch.issue_excluded(self.issue(labels=["release blocker"])))
+ self.assertTrue(ch.issue_excluded(self.issue(labels=["no changelog"])))
+
+
+class RenderBoomEntryTests(unittest.TestCase):
+ def test_entry_is_a_heading_plus_note_plus_references(self):
+ issue = {"number": 7, "title": ":boom: Drop the flag", "labels": []}
+ self.assertEqual(
+ ch.render_boom_entry(issue, "One.\n\nTwo.", [8, 9]),
+ "#### Drop the flag\n\nOne.\n\nTwo.\n\n"
+ "[#7](https://github.com/penpot/penpot/issues/7)"
+ " (PR: [#8](https://github.com/penpot/penpot/pull/8),"
+ " [#9](https://github.com/penpot/penpot/pull/9))",
+ )
+
+ def test_entry_without_a_note_keeps_the_heading(self):
+ issue = {"number": 7, "title": "Drop the flag", "labels": []}
+ self.assertEqual(
+ ch.render_boom_entry(issue, None, []),
+ "#### Drop the flag\n\n[#7](https://github.com/penpot/penpot/issues/7)",
+ )
+
+ def test_community_attribution_goes_before_the_issue_link(self):
+ issue = {"number": 7, "title": "Drop the flag", "labels": []}
+ entry = ch.render_boom_entry(issue, "Text.", [8], "someone")
+ self.assertEqual(
+ entry,
+ "#### Drop the flag\n\nText.\n\n(by @someone)"
+ " [#7](https://github.com/penpot/penpot/issues/7)"
+ " (PR: [#8](https://github.com/penpot/penpot/pull/8))",
+ )
+
+
+class ReplaceBoomSectionTests(unittest.TestCase):
+ def test_replaces_the_existing_subsection(self):
+ entry = "#### New entry\n\nSome text.\n\n[#9](https://example.test/9)"
+ updated = ch.replace_boom_section(CHANGES, "2.19.0", [entry])
+ self.assertIn(
+ "### :boom: Breaking changes & Deprecations\n\n"
+ f"{entry}\n\n### :rocket:",
+ updated,
+ )
+ self.assertNotIn("Old entry.", updated)
+
+ def test_replacement_is_idempotent(self):
+ entry = "#### New entry\n\nSome text.\n\n[#9](https://example.test/9)"
+ once = ch.replace_boom_section(CHANGES, "2.19.0", [entry])
+ self.assertEqual(once, ch.replace_boom_section(once, "2.19.0", [entry]))
+
+ def test_empty_section_keeps_the_heading(self):
+ updated = ch.replace_boom_section(CHANGES, "2.19.0", [])
+ self.assertIn(
+ "### :boom: Breaking changes & Deprecations\n\n### :rocket:", updated
+ )
+
+ def test_inserts_the_subsection_when_missing(self):
+ without = CHANGES.replace(
+ "### :boom: Breaking changes & Deprecations\n\n- Old entry.\n\n", ""
+ )
+ updated = ch.replace_boom_section(without, "2.19.0", ["#### New entry"])
+ self.assertIn(
+ "## 2.19.0 (Unreleased)\n\n"
+ "### :boom: Breaking changes & Deprecations\n\n#### New entry\n\n"
+ "### :rocket:",
+ updated,
+ )
+
+ def test_unknown_version_raises(self):
+ with self.assertRaises(ValueError):
+ ch.replace_boom_section(CHANGES, "9.9.9", ["#### Entry"])
+
+
+ISSUES = [
+ {
+ "number": 21,
+ "title": ":boom: New default",
+ "state": "CLOSED",
+ "issue_type": "Enhancement",
+ "labels": ["breaking change"],
+ "closing_prs": [31],
+ "project_status": "Done",
+ },
+ {
+ "number": 22,
+ "title": "No note",
+ "state": "CLOSED",
+ "issue_type": "Enhancement",
+ "labels": ["breaking change"],
+ "closing_prs": [],
+ "project_status": "Done",
+ },
+ {
+ "number": 23,
+ "title": "Still open",
+ "state": "OPEN",
+ "issue_type": "Enhancement",
+ "labels": ["breaking change"],
+ "closing_prs": [],
+ "project_status": "In progress",
+ },
+ {
+ "number": 24,
+ "title": "Not breaking",
+ "state": "CLOSED",
+ "issue_type": "Bug",
+ "labels": [],
+ "closing_prs": [],
+ "project_status": "Done",
+ },
+]
+
+COMMENTS = [
+ {"issue": 21, "body": "## Breaking change note\n\nDeploy the new service.\n"},
+ {"issue": 22, "body": "## Description\n\nNo marker here.\n"},
+ {"issue": 21, "body": "## Breaking change note\n\nDeploy the new service.\n"},
+]
+
+PRS = [{"number": 31, "author": "someone", "labels": [], "state": "MERGED"}]
+
+
+class CmdBoomTests(unittest.TestCase):
+ def setUp(self):
+ self.calls = []
+ self.issues = ISSUES
+ self.comments = COMMENTS
+ self.prs = PRS
+
+ def fake_run_gh_py(*args, input_text=None):
+ self.calls.append(args)
+ if args[0] == "issues":
+ return json.dumps(self.issues)
+ if args[0] == "comments":
+ return json.dumps(self.comments)
+ if args[0] == "prs":
+ return json.dumps(self.prs)
+ raise AssertionError(f"unexpected gh.py call: {args}")
+
+ patcher = patch.object(ch, "run_gh_py", side_effect=fake_run_gh_py)
+ patcher.start()
+ self.addCleanup(patcher.stop)
+
+ def run_boom(self, **kwargs):
+ args = argparse.Namespace(
+ milestone="2.19.0",
+ changes=CHANGES if "changes" not in kwargs else kwargs["changes"],
+ write=kwargs.get("write", False),
+ )
+ out, err = io.StringIO(), io.StringIO()
+ with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
+ ch.cmd_boom(args)
+ return out.getvalue(), err.getvalue()
+
+ def test_renders_only_closed_breaking_issues(self):
+ out, err = self.run_boom()
+ expected = (
+ "### :boom: Breaking changes & Deprecations\n\n"
+ "#### New default\n\n"
+ "Deploy the new service.\n\n"
+ "[#21](https://github.com/penpot/penpot/issues/21)"
+ " (PR: [#31](https://github.com/penpot/penpot/pull/31))\n\n"
+ "#### No note\n\n"
+ "[#22](https://github.com/penpot/penpot/issues/22)\n"
+ )
+ self.assertEqual(out, expected)
+ self.assertIn("issue #22 has no", err)
+ self.assertIn("using the last one", err)
+
+ def test_unmerged_closing_pr_is_not_referenced(self):
+ self.prs = [{"number": 31, "author": "someone", "state": "CLOSED"}]
+ out, _ = self.run_boom()
+ self.assertNotIn("pull/31", out)
+ self.assertIn("[#21](https://github.com/penpot/penpot/issues/21)", out)
+
+ def test_no_labelled_issue_clears_the_section_on_write(self):
+ self.issues = [ISSUES[3]]
+ with tempfile.TemporaryDirectory() as tmp:
+ path = pathlib.Path(tmp) / "CHANGES.md"
+ path.write_text(CHANGES)
+ out, err = self.run_boom(changes=str(path), write=True)
+ updated = path.read_text()
+ self.assertEqual(out, "### :boom: Breaking changes & Deprecations\n")
+ self.assertNotIn("Old entry.", updated)
+ self.assertIn(":boom: section updated", err)
+
+ def test_writes_the_section_in_place(self):
+ with tempfile.TemporaryDirectory() as tmp:
+ path = pathlib.Path(tmp) / "CHANGES.md"
+ path.write_text(CHANGES)
+ out, err = self.run_boom(changes=str(path), write=True)
+ updated = path.read_text()
+ self.assertIn("#### New default", updated)
+ self.assertNotIn("Old entry.", updated)
+ self.assertIn(":boom: section updated", err)
+ self.assertIn("Deploy the new service.", out)
+
+
+class ReportTests(unittest.TestCase):
+ """Focused check of the `:boom:` sync anomaly (type G) in the report."""
+
+ def test_reports_breaking_issue_missing_from_boom(self):
+ issues = [
+ {
+ "number": 1,
+ "title": "Unlabelled entry",
+ "state": "CLOSED",
+ "issue_type": "Enhancement",
+ "labels": [],
+ "closing_prs": [],
+ "project_status": "Done",
+ },
+ {
+ "number": 2,
+ "title": "Labelled, not listed",
+ "state": "CLOSED",
+ "issue_type": "Enhancement",
+ "labels": ["breaking change"],
+ "closing_prs": [],
+ "project_status": "Done",
+ },
+ ]
+ changes = (
+ "# CHANGELOG\n\n## 2.19.0 (Unreleased)\n\n"
+ "### :boom: Breaking changes & Deprecations\n\n"
+ "#### Something changed\n\n"
+ "[#1](https://github.com/penpot/penpot/issues/1)\n"
+ )
+ with tempfile.TemporaryDirectory() as tmp:
+ changes_path = pathlib.Path(tmp) / "CHANGES.md"
+ output_path = pathlib.Path(tmp) / "ISSUES.md"
+ changes_path.write_text(changes)
+ args = argparse.Namespace(
+ milestone="2.19.0",
+ changes=str(changes_path),
+ output=str(output_path),
+ )
+ with patch.object(ch, "run_gh_py", return_value=json.dumps(issues)), \
+ patch.object(ch, "fetch_milestone_prs", return_value=[]), \
+ contextlib.redirect_stdout(io.StringIO()), \
+ contextlib.redirect_stderr(io.StringIO()):
+ ch.cmd_report(args)
+ report = output_path.read_text()
+
+ self.assertIn("**:boom: out of sync with breaking change label:** 1", report)
+ self.assertIn("### :boom: out of sync with breaking change label", report)
+ self.assertIn("issues/2", report)
+ self.assertIn("**:boom: entry without breaking change label:** 1", report)
+
+
+ADVISORY = {
+ "ghsa_id": "GHSA-j4vc-cmf6-jhr7",
+ "url": "https://github.com/penpot/penpot/security/advisories/GHSA-j4vc-cmf6-jhr7",
+ "summary": (
+ "Missing authorization in mark-all-threads-as-read lets a user update "
+ "inaccessible threads"
+ ),
+}
+
+SECURITY_CHANGES = """# CHANGELOG
+
+## 2.19.1
+
+### :bug: Bugs fixed
+
+- Fix something [#1](https://github.com/penpot/penpot/issues/1)
+"""
+
+SECURITY_CHANGES_WITH_ROCKET = """# CHANGELOG
+
+## 2.19.1
+
+### :rocket: Epics and highlights
+
+- Add highlights [#1](https://github.com/penpot/penpot/issues/1)
+
+### :bug: Bugs fixed
+
+- Fix something [#2](https://github.com/penpot/penpot/issues/2)
+"""
+
+SECURITY_CHANGES_WITH_BOOM = """# CHANGELOG
+
+## 2.19.1
+
+### :boom: Breaking changes & Deprecations
+
+#### Old entry
+
+[#1](https://github.com/penpot/penpot/issues/1)
+
+### :bug: Bugs fixed
+
+- Fix something [#2](https://github.com/penpot/penpot/issues/2)
+"""
+
+
+class ImperativeDescriptionTests(unittest.TestCase):
+ def test_prefixes_fix_and_decapitalizes(self):
+ self.assertEqual(
+ ch.imperative_description("Missing authorization in foo"),
+ "Fix missing authorization in foo",
+ )
+
+ def test_keeps_acronyms(self):
+ self.assertEqual(
+ ch.imperative_description("SVG sanitizer escapes nothing"),
+ "Fix SVG sanitizer escapes nothing",
+ )
+ self.assertEqual(
+ ch.imperative_description("CVE-2026-105694: sanitizer escapes nothing"),
+ "Fix CVE-2026-105694: sanitizer escapes nothing",
+ )
+
+ def test_strips_emoji_prefix_and_handles_empty(self):
+ self.assertEqual(
+ ch.imperative_description(":bug: Missing check"), "Fix missing check"
+ )
+ self.assertEqual(ch.imperative_description(""), "")
+
+
+class RenderSecurityEntryTests(unittest.TestCase):
+ def test_entry_has_description_advisory_and_prs(self):
+ self.assertEqual(
+ ch.render_security_entry(ADVISORY, [8, 9]),
+ "- Fix missing authorization in mark-all-threads-as-read lets a user "
+ "update inaccessible threads "
+ "(https://github.com/penpot/penpot/security/advisories/GHSA-j4vc-cmf6-jhr7)"
+ " (PR: [#8](https://github.com/penpot/penpot/pull/8),"
+ " [#9](https://github.com/penpot/penpot/pull/9))",
+ )
+
+ def test_entry_without_prs_links_only_the_advisory(self):
+ entry = ch.render_security_entry(ADVISORY, [])
+ self.assertNotIn("PR:", entry)
+ self.assertIn("security/advisories/GHSA-j4vc-cmf6-jhr7", entry)
+
+ def test_entry_builds_the_url_when_the_advisory_lacks_it(self):
+ advisory = dict(ADVISORY)
+ del advisory["url"]
+ self.assertIn(
+ "(https://github.com/penpot/penpot/security/advisories/GHSA-j4vc-cmf6-jhr7)",
+ ch.render_security_entry(advisory, []),
+ )
+
+
+class FetchSecurityPrsTests(unittest.TestCase):
+ def test_maps_merged_pr_pt_prs_by_ghsa(self):
+ prs = [
+ {
+ "number": 10,
+ "state": "MERGED",
+ "labels": ["internal", "pr pt"],
+ "body": "Relates to [GHSA-4mmc-j8rh-74pf]"
+ "(https://github.com/penpot/penpot/security/advisories/GHSA-4mmc-j8rh-74pf)",
+ },
+ {
+ "number": 11,
+ "state": "CLOSED",
+ "labels": ["pr pt"],
+ "body": "Closes GHSA-j4vc-cmf6-jhr7",
+ },
+ {
+ "number": 12,
+ "state": "MERGED",
+ "labels": ["bug"],
+ "body": "GHSA-qwhj-rchj-58mg",
+ },
+ {
+ "number": 13,
+ "state": "MERGED",
+ "labels": ["pr pt"],
+ "body": "No advisory here",
+ },
+ ]
+ with patch.object(ch, "fetch_milestone_prs", return_value=prs):
+ result = ch.fetch_security_prs("2.19.1")
+ self.assertEqual(result, {"GHSA-4MMC-J8RH-74PF": [10]})
+
+
+class ReplaceSecuritySectionTests(unittest.TestCase):
+ ENTRY = (
+ "- Fix missing check (https://example.test/ghsa)"
+ " (PR: [#8](https://example.test/pr/8))"
+ )
+
+ def test_inserts_after_rocket(self):
+ updated = ch.replace_security_section(
+ SECURITY_CHANGES_WITH_ROCKET, "2.19.1", [self.ENTRY]
+ )
+ self.assertIn(
+ "### :rocket: Epics and highlights\n\n"
+ "- Add highlights [#1](https://github.com/penpot/penpot/issues/1)\n\n"
+ "### :lock: Security fixes\n\n"
+ f"{self.ENTRY}\n\n"
+ "### :bug: Bugs fixed",
+ updated,
+ )
+
+ def test_inserts_after_boom_when_there_is_no_rocket(self):
+ updated = ch.replace_security_section(
+ SECURITY_CHANGES_WITH_BOOM, "2.19.1", [self.ENTRY]
+ )
+ self.assertIn(
+ "#### Old entry\n\n[#1](https://github.com/penpot/penpot/issues/1)\n\n"
+ "### :lock: Security fixes\n\n"
+ f"{self.ENTRY}\n\n"
+ "### :bug: Bugs fixed",
+ updated,
+ )
+
+ def test_inserts_after_the_header_when_no_anchor_exists(self):
+ updated = ch.replace_security_section(
+ SECURITY_CHANGES, "2.19.1", [self.ENTRY]
+ )
+ self.assertIn(
+ "## 2.19.1\n\n"
+ "### :lock: Security fixes\n\n"
+ f"{self.ENTRY}\n\n"
+ "### :bug: Bugs fixed",
+ updated,
+ )
+
+ def test_replacement_is_idempotent(self):
+ once = ch.replace_security_section(
+ SECURITY_CHANGES, "2.19.1", [self.ENTRY]
+ )
+ twice = ch.replace_security_section(once, "2.19.1", [self.ENTRY])
+ self.assertEqual(once, twice)
+ self.assertEqual(once.count("### :lock: Security fixes"), 1)
+
+ def test_empty_entries_remove_the_subsection(self):
+ once = ch.replace_security_section(
+ SECURITY_CHANGES, "2.19.1", [self.ENTRY]
+ )
+ removed = ch.replace_security_section(once, "2.19.1", [])
+ self.assertNotIn(":lock:", removed)
+ self.assertEqual(removed, SECURITY_CHANGES)
+
+ def test_empty_entries_leave_a_section_without_heading_untouched(self):
+ self.assertEqual(
+ ch.replace_security_section(SECURITY_CHANGES, "2.19.1", []),
+ SECURITY_CHANGES,
+ )
+
+ def test_unknown_version_raises(self):
+ with self.assertRaises(ValueError):
+ ch.replace_security_section(SECURITY_CHANGES, "9.9.9", [self.ENTRY])
+
+
+class CmdSecurityTests(unittest.TestCase):
+ ADVISORIES = [ADVISORY]
+ PRS = [
+ {
+ "number": 8,
+ "state": "MERGED",
+ "labels": ["pr pt"],
+ "body": "Closes GHSA-j4vc-cmf6-jhr7",
+ }
+ ]
+
+ def setUp(self):
+ self.calls = []
+
+ def fake_run_gh_py(*args, input_text=None):
+ self.calls.append(args)
+ if args[0] == "advisories":
+ return json.dumps(self.ADVISORIES)
+ if args[0] == "prs":
+ return json.dumps(self.PRS)
+ raise AssertionError(f"unexpected gh.py call: {args}")
+
+ patcher = patch.object(ch, "run_gh_py", side_effect=fake_run_gh_py)
+ patcher.start()
+ self.addCleanup(patcher.stop)
+
+ def run_security(self, changes=SECURITY_CHANGES, write=False):
+ args = argparse.Namespace(milestone="2.19.1", changes=changes, write=write)
+ out, err = io.StringIO(), io.StringIO()
+ with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
+ ch.cmd_security(args)
+ return out.getvalue(), err.getvalue()
+
+ def test_prints_the_section_with_the_linked_pr(self):
+ out, _ = self.run_security()
+ self.assertIn("### :lock: Security fixes", out)
+ self.assertIn("security/advisories/GHSA-j4vc-cmf6-jhr7", out)
+ self.assertIn("(PR: [#8](https://github.com/penpot/penpot/pull/8))", out)
+ self.assertEqual(
+ self.calls[0], ("advisories", "--patched-version", "2.19.1")
+ )
+
+ def test_no_advisories_prints_no_section(self):
+ self.ADVISORIES = []
+ self.PRS = []
+ out, err = self.run_security()
+ self.assertEqual(out, "")
+ self.assertIn("No advisories", err)
+
+ def test_writes_the_section_in_place(self):
+ with tempfile.TemporaryDirectory() as tmp:
+ path = pathlib.Path(tmp) / "CHANGES.md"
+ path.write_text(SECURITY_CHANGES)
+ _, err = self.run_security(changes=str(path), write=True)
+ updated = path.read_text()
+ self.assertIn("### :lock: Security fixes", updated)
+ self.assertIn("(PR: [#8](https://github.com/penpot/penpot/pull/8))", updated)
+ self.assertIn(":lock: section updated", err)
+
+ def test_no_advisories_leaves_the_file_untouched(self):
+ self.ADVISORIES = []
+ self.PRS = []
+ with tempfile.TemporaryDirectory() as tmp:
+ path = pathlib.Path(tmp) / "CHANGES.md"
+ path.write_text(SECURITY_CHANGES)
+ _, err = self.run_security(changes=str(path), write=True)
+ updated = path.read_text()
+ self.assertEqual(updated, SECURITY_CHANGES)
+ self.assertIn(":lock: section already up to date", err)
+
+ def test_warns_when_a_pr_references_an_unmatched_advisory(self):
+ self.ADVISORIES = []
+ _, err = self.run_security()
+ self.assertIn("GHSA-J4VC-CMF6-JHR7", err)
+ self.assertIn("#8", err)
+ self.assertIn("will not be listed", err)
+
+
+if __name__ == "__main__":
+ unittest.main(verbosity=2)
diff --git a/scripts/test_ci.py b/scripts/test_ci.py
new file mode 100644
index 0000000000..405f385d8e
--- /dev/null
+++ b/scripts/test_ci.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python3
+"""Tests for scripts/ci.
+
+Run with:
+
+ python3 scripts/test_ci.py
+
+Covers the wiring of the orchestrator around the `build` task and the
+`media-processor` module: the flag set, one build command per module, the
+help text, the dry-run mode (which must execute and write nothing), and the
+default task list staying free of build.
+"""
+
+import pathlib
+import re
+import subprocess
+import sys
+import unittest
+
+sys.dont_write_bytecode = True
+
+REPO_ROOT = pathlib.Path(__file__).resolve().parent.parent
+CI = REPO_ROOT / "scripts" / "ci"
+LOG_DIR = REPO_ROOT / ".ci-logs"
+
+ANSI = re.compile(r"\x1b\[[0-9;]*m")
+
+# Modules with a production build. `common` has no build of its own: its
+# compilation happens in its test task and in the modules consuming it.
+BUILD_MODULES = (
+ "frontend",
+ "backend",
+ "render-wasm",
+ "exporter",
+ "mcp",
+ "plugins",
+ "library",
+ "media-processor",
+)
+
+ALL_MODULES = BUILD_MODULES + ("common",)
+
+
+def run_ci(*args, cwd=REPO_ROOT):
+ """Run scripts/ci and return (exit_code, output without ANSI escapes)."""
+ proc = subprocess.run(
+ [str(CI), *args],
+ cwd=cwd,
+ capture_output=True,
+ text=True,
+ )
+ return proc.returncode, ANSI.sub("", proc.stdout + proc.stderr)
+
+
+def log_snapshot():
+ """Names and mtimes of every entry under .ci-logs, or None when absent."""
+ if not LOG_DIR.exists():
+ return None
+ return sorted((p.name, p.stat().st_mtime_ns) for p in LOG_DIR.iterdir())
+
+
+class BuildTaskTests(unittest.TestCase):
+ def test_build_all_has_one_command_per_module_without_common(self):
+ code, out = run_ci("--build", "--dry-run", "--all")
+
+ self.assertEqual(code, 0, out)
+ self.assertEqual(out.count("build: would run"), len(BUILD_MODULES), out)
+ self.assertIn("build: not defined for common, skipping", out)
+ for module in BUILD_MODULES:
+ self.assertIn(f" in {module}/", out)
+
+ def test_build_is_not_part_of_the_default_tasks(self):
+ code, out = run_ci("--dry-run", "--all")
+
+ self.assertEqual(code, 0, out)
+ self.assertNotIn("build:", out)
+ for task in ("lint", "test", "fmt"):
+ self.assertIn(f"{task}: would run", out)
+
+ def test_build_flag_runs_build_only(self):
+ code, out = run_ci("--build", "--dry-run", "frontend")
+
+ self.assertEqual(code, 0, out)
+ self.assertIn("build: would run", out)
+ for task in ("lint", "test", "fmt"):
+ self.assertNotIn(f"{task}:", out)
+
+ def test_no_build_flag_is_accepted(self):
+ code, out = run_ci("--no-build", "--dry-run", "frontend")
+
+ self.assertEqual(code, 0, out)
+ self.assertIn("lint: would run", out)
+ self.assertNotIn("build:", out)
+
+ def test_dry_run_executes_nothing(self):
+ before = log_snapshot()
+
+ run_ci("--build", "--dry-run", "mcp")
+
+ self.assertEqual(before, log_snapshot())
+
+
+class MediaProcessorModuleTests(unittest.TestCase):
+ def test_module_is_accepted_and_lint_is_skipped(self):
+ code, out = run_ci("--dry-run", "media-processor")
+
+ self.assertEqual(code, 0, out)
+ self.assertIn(
+ "lint: not defined for media-processor, skipping",
+ out,
+ )
+ for task in ("test", "fmt"):
+ self.assertIn(f"{task}: would run", out)
+
+ def test_module_is_included_in_all(self):
+ code, out = run_ci("--dry-run", "--all")
+
+ self.assertEqual(code, 0, out)
+ self.assertIn("media-processor", out)
+ self.assertIn("media-processor:test", out)
+
+ def test_build_runs_types_check_before_esbuild(self):
+ code, out = run_ci("--build", "--dry-run", "media-processor")
+
+ self.assertEqual(code, 0, out)
+ self.assertIn(
+ "pnpm run types:check && pnpm run build",
+ out,
+ )
+
+
+class HelpTests(unittest.TestCase):
+ def help_options(self, out):
+ """Option tokens from the OPTIONS section, e.g. '--build'."""
+ options = []
+ for line in out.splitlines():
+ stripped = line.strip()
+ if stripped.startswith("--"):
+ options.append(stripped.split()[0])
+ return options
+
+ def test_help_documents_the_build_flags(self):
+ code, out = run_ci("--help")
+
+ self.assertEqual(code, 0, out)
+ options = self.help_options(out)
+ self.assertIn("--build", options)
+ self.assertIn("--no-build", options)
+
+ def test_help_lists_every_module(self):
+ code, out = run_ci("--help")
+
+ self.assertEqual(code, 0, out)
+ for module in ALL_MODULES:
+ self.assertIn(module, out)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/test_gh.py b/scripts/test_gh.py
index 5fb6840a22..b703b389eb 100644
--- a/scripts/test_gh.py
+++ b/scripts/test_gh.py
@@ -110,5 +110,115 @@ class LinkIssueTests(unittest.TestCase):
self.assertIn("link missing", stderr.getvalue())
+class CommentsTests(unittest.TestCase):
+ def test_paginates_until_a_short_page(self):
+ page_one = [
+ {"id": i, "user": {"login": "u"}, "created_at": "t", "body": f"b{i}"}
+ for i in range(100)
+ ]
+ page_two = [{"id": 100, "user": None, "created_at": "t", "body": "last"}]
+ calls = []
+
+ def fake_rest(path):
+ calls.append(path)
+ return page_one if len(calls) == 1 else page_two
+
+ with patch.object(gh, "run_gh_rest", side_effect=fake_rest):
+ comments = gh.fetch_issue_comments(7)
+
+ self.assertEqual(len(comments), 101)
+ self.assertEqual(
+ comments[0],
+ {"issue": 7, "id": 0, "author": "u", "created_at": "t", "body": "b0"},
+ )
+ self.assertIsNone(comments[-1]["author"])
+ self.assertIn("page=1", calls[0])
+ self.assertIn("page=2", calls[1])
+
+ @patch.object(gh, "fetch_issue_comments")
+ def test_cmd_comments_outputs_every_issue(self, fetch_comments):
+ fetch_comments.side_effect = lambda num: [
+ {"issue": num, "id": num, "author": "u", "created_at": "t", "body": "x"}
+ ]
+ args = types.SimpleNamespace(numbers=[1, 2], file=None, stdin=False)
+ stdout = io.StringIO()
+
+ with contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(io.StringIO()):
+ gh.cmd_comments(args)
+
+ self.assertEqual([c["issue"] for c in json.loads(stdout.getvalue())], [1, 2])
+
+ def test_cmd_comments_requires_numbers(self):
+ args = types.SimpleNamespace(numbers=[], file=None, stdin=False)
+ with contextlib.redirect_stderr(io.StringIO()):
+ with self.assertRaises(SystemExit) as error:
+ gh.cmd_comments(args)
+ self.assertEqual(error.exception.code, 1)
+
+
+class AdvisoriesTests(unittest.TestCase):
+ def advisory(self, patched, ghsa="GHSA-aaaa-bbbb-cccc"):
+ return {
+ "ghsa_id": ghsa,
+ "severity": "medium",
+ "state": "draft",
+ "summary": "Something",
+ "html_url": f"https://github.com/penpot/penpot/security/advisories/{ghsa}",
+ "vulnerabilities": [
+ {
+ "package": {"name": "penpot"},
+ "vulnerable_version_range": "<2.19.1",
+ "patched_versions": patched,
+ }
+ ],
+ }
+
+ def test_fixed_in_version_matches_exact_tokens(self):
+ self.assertTrue(gh.advisory_fixed_in_version(self.advisory("2.19.1"), "2.19.1"))
+ self.assertFalse(
+ gh.advisory_fixed_in_version(self.advisory("2.19.10"), "2.19.1")
+ )
+ self.assertFalse(gh.advisory_fixed_in_version(self.advisory(""), "2.19.1"))
+ self.assertFalse(
+ gh.advisory_fixed_in_version({"vulnerabilities": []}, "2.19.1")
+ )
+
+ def test_fixed_in_version_accepts_several_tokens(self):
+ self.assertTrue(
+ gh.advisory_fixed_in_version(self.advisory("2.19.0, 2.19.1"), "2.19.1")
+ )
+ self.assertTrue(
+ gh.advisory_fixed_in_version(self.advisory(" 2.19.1 "), "2.19.1")
+ )
+
+ @patch.object(gh, "fetch_advisories")
+ def test_cmd_advisories_filters_by_patched_version(self, fetch_advisories):
+ matching = self.advisory("2.19.1", "GHSA-j4vc-cmf6-jhr7")
+ other = self.advisory("2.19.0", "GHSA-4mmc-j8rh-74pf")
+ fetch_advisories.return_value = [matching, other]
+ args = types.SimpleNamespace(
+ ghsa_id=None,
+ severity=None,
+ state=None,
+ patched_version="2.19.1",
+ )
+ stdout = io.StringIO()
+
+ with contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(
+ io.StringIO()
+ ):
+ gh.cmd_advisories(args)
+
+ results = json.loads(stdout.getvalue())
+ self.assertEqual([r["ghsa_id"] for r in results], ["GHSA-j4vc-cmf6-jhr7"])
+ # The list output keeps the summary schema: raw vulnerabilities stay
+ # internal to the filter.
+ self.assertNotIn("vulnerabilities", results[0])
+ self.assertEqual(
+ results[0]["url"],
+ "https://github.com/penpot/penpot/security/advisories/GHSA-j4vc-cmf6-jhr7",
+ )
+
+
if __name__ == "__main__":
unittest.main(verbosity=2)
diff --git a/scripts/test_sync_pnpm_version.py b/scripts/test_sync_pnpm_version.py
index 889250f433..91089632f2 100644
--- a/scripts/test_sync_pnpm_version.py
+++ b/scripts/test_sync_pnpm_version.py
@@ -134,6 +134,23 @@ class SyncPnpmVersionTests(unittest.TestCase):
self.assertNotEqual(proc.returncode, 0)
self.assertIn("missing/package.json", proc.stdout + proc.stderr)
+ def test_target_dirs_are_never_stamped(self):
+ generated = self.tmp / "module" / "target"
+ generated.mkdir(parents=True)
+ package = generated / "package.json"
+ package.write_text(
+ '{\n'
+ ' "name": "generated",\n'
+ ' "packageManager": "pnpm@10.0.0+sha512.' + "00" * 64 + '"\n'
+ '}\n'
+ )
+ before = package.read_bytes()
+
+ self.assertEqual(self.stamp().returncode, 0)
+ self.assertEqual(package.read_bytes(), before)
+ # The stale copy must not make --check fail either.
+ self.assertEqual(self.stamp("--check").returncode, 0)
+
def test_stamp_is_idempotent(self):
self.assertEqual(self.stamp().returncode, 0)
first = {