@enhance-eng/enhance 0.1.38 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli-output-identity.lib-C3i0q8cd.mjs → cli-output-identity.lib-D5TqbvV1.mjs} +1040 -315
- package/dist/main.mjs +8150 -362
- package/dist/{mcp-invocation.adapter-taWD_Gn7.mjs → mcp-invocation.adapter-Dchzrqtn.mjs} +4 -4
- package/dist/mcp-main.mjs +7 -7
- package/dist/{mcp-server.adapter-bUMHR5ct.mjs → mcp-server.adapter-BMwIrDdF.mjs} +2 -2
- package/dist/mcp.mjs +2 -2
- package/dist/{mutation-key.adapter-BVKXAugo.mjs → mutation-key.adapter-C1RE4KHd.mjs} +30 -24
- package/dist/remote-mcp-main.mjs +6 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as
|
|
3
|
-
import { S as createAuthUseCase, h as fromCapabilityReference, m as boundedResultPage, n as createHttpRemoteAdapter, o as createOauthLoopbackAdapter, s as createCapabilityInvocationAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-
|
|
4
|
-
import { a as createMcpResultAdapter, i as mcpDispatchedResultSchema, n as createMcpWorkflowsAdapter, o as createMcpClientContextAdapter, r as createMcpClientInvocationAdapter } from "./mcp-server.adapter-
|
|
2
|
+
import { A as operationStatusImageSchema, B as canvasPreparationOutputSchema, C as canvasPrototypeOutputSchema, Ct as canvasMakeEditableInputSchema, D as encodeCanvasExchangeToken, E as decodeCanvasExchangeToken, F as canvasAssetImportOutputSchema, Fr as createCanvasOutputSchema, L as canvasArrangeInputSchema, M as operationStatusOutputSchema, Nt as CliError, P as canvasAssetImportInputSchema, U as canvasCaptureInputSchema, V as canvasWriteReceiptSchema, W as canvasCaptureOutputSchema, _n as screenAreaCommentTargetSchema, an as commentAuthorSchema, bn as screenTextCommentTargetSchema, cn as commentResolverSchema, dn as elementAnchorSchema, fn as getCommentOutputSchema, ft as canvasUpdateHtmlInputSchema, gn as replyCommentOutputSchema, gt as canvasCreateToolOutputSchema, hn as replyCommentInputSchema, ht as canvasCreateToolInputSchema, j as operationStatusInputSchema, jt as parseCanvasReference, k as canvasConversionStatusSchema, l as toMcpFailurePayload, ln as commentThreadSchema, lt as canvasReadInputSchema, mn as listCommentsOutputSchema, on as commentCanvasContextSchema, p as createCapabilityCatalogAdapter, pn as listCommentsInputSchema, rt as canvasRenderScopedToolInputSchema, sn as commentMessageSchema, st as canvasRemoveInputSchema, un as domLocatorSchema, ut as canvasReadOutputSchema, v as PROTOTYPE_UPDATE_GUIDANCE, vn as screenElementCommentTargetSchema, vt as canvasFindInputSchema, w as canvasExchangeDigest, x as canvasPrototypeInputSchema, xn as startCommentInputSchema, xt as canvasInsertHtmlInputSchema, yn as screenElementsCommentTargetSchema, yt as canvasFindOutputSchema, z as canvasDuplicateInputSchema } from "./cli-output-identity.lib-D5TqbvV1.mjs";
|
|
3
|
+
import { S as createAuthUseCase, h as fromCapabilityReference, m as boundedResultPage, n as createHttpRemoteAdapter, o as createOauthLoopbackAdapter, s as createCapabilityInvocationAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-C1RE4KHd.mjs";
|
|
4
|
+
import { a as createMcpResultAdapter, i as mcpDispatchedResultSchema, n as createMcpWorkflowsAdapter, o as createMcpClientContextAdapter, r as createMcpClientInvocationAdapter } from "./mcp-server.adapter-BMwIrDdF.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
7
7
|
|
|
@@ -1129,7 +1129,7 @@ const clientContext$2 = createMcpClientContextAdapter();
|
|
|
1129
1129
|
const createMcpPrototypePublishAdapter = (invoke) => ({ register: (server) => {
|
|
1130
1130
|
server.registerTool("prototype_publish", {
|
|
1131
1131
|
title: "Publish a prototype to the canvas",
|
|
1132
|
-
description:
|
|
1132
|
+
description: `Publish a selected, unpacked static build directory through the native artifact pipeline, or resume its deployment. ${PROTOTYPE_UPDATE_GUIDANCE} Runnable builds may execute scripts and contact external services when opened. Preserve the complete canvas/page/selection link and baseVersion. Deployment readiness and canvas attachment are reported separately. Poll operation_status for ingestion; call this tool again to attach. Retry uncertainty with identical arguments and clientToken. After an unrelated canvas edit, reuse the ready deployment and clientToken with a deliberate revised baseVersion; do not re-upload. A changed destination or scope requires a new attachment intent. This does not build source code or verify the resulting UI.`,
|
|
1133
1133
|
inputSchema: canvasPrototypeInputSchema,
|
|
1134
1134
|
outputSchema: canvasPrototypeOutputSchema,
|
|
1135
1135
|
annotations: {
|
package/dist/mcp-main.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { i as readLocalMcpEnvironment } from "./mutation-key.adapter-
|
|
2
|
+
import { g as toCapabilityDefinition, p as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-D5TqbvV1.mjs";
|
|
3
|
+
import { i as readLocalMcpEnvironment } from "./mutation-key.adapter-C1RE4KHd.mjs";
|
|
4
4
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-C78gc9OK.mjs";
|
|
5
|
-
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
6
|
-
import { o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-
|
|
5
|
+
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-Dchzrqtn.mjs";
|
|
6
|
+
import { o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-BMwIrDdF.mjs";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
@@ -170,19 +170,19 @@ const clientContext = createMcpClientContextAdapter();
|
|
|
170
170
|
const main = () => {
|
|
171
171
|
const config = readLocalMcpEnvironment();
|
|
172
172
|
const credentials = createFileCredentialAdapter(config.configDirectory);
|
|
173
|
-
const invocation = createMcpInvocationAdapter(config.apiUrl, credentials, config.configDirectory, { version: "0.1.
|
|
173
|
+
const invocation = createMcpInvocationAdapter(config.apiUrl, credentials, config.configDirectory, { version: "0.1.40" });
|
|
174
174
|
const catalog = [...createCapabilityCatalogAdapter(), ...createMcpTransportCapabilityAdapter()];
|
|
175
175
|
const client = clientContext.createStdio();
|
|
176
176
|
serveStdio(() => config.profile === "canvas" ? createMcpCanvasProfileAdapter({
|
|
177
177
|
readOnly: config.isReadOnly,
|
|
178
178
|
...config.workflowsDirectory !== void 0 && { workflowsDirectory: config.workflowsDirectory },
|
|
179
179
|
name: config.mcpServiceName,
|
|
180
|
-
version: "0.1.
|
|
180
|
+
version: "0.1.40",
|
|
181
181
|
invocation,
|
|
182
182
|
clientMetadata: client.metadata,
|
|
183
183
|
catalog
|
|
184
184
|
}) : createMcpServerAdapter({
|
|
185
|
-
version: "0.1.
|
|
185
|
+
version: "0.1.40",
|
|
186
186
|
name: config.mcpServiceName,
|
|
187
187
|
commandName: config.commandName,
|
|
188
188
|
invocation,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { $n as wholeCanvasDocumentOutputSchema, At as hasCanvasReferenceScope, J as canvasWriteHtmlCapabilityInputSchema, Ln as agentClientMetadata, Nt as CliError, Ot as canvasReferenceRenderTarget, at as canvasRenderFileSchema, et as canvasRenderBatchResultSchema, fr as canvasReadableSceneDocumentSchema, i as toPresentedCapabilities, ir as canvasRenderSourceStateSchema, jt as parseCanvasReference, l as toMcpFailurePayload, n as withCommandName, o as createMcpCapabilityDiscoveryAdapter, or as canvasRenderTargetSchema, p as createCapabilityCatalogAdapter, r as toCanvasAuthoringResult, t as withCommandInFailure, wt as canvasEditCapabilityInputSchema } from "./cli-output-identity.lib-D5TqbvV1.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -576,7 +576,7 @@ const renderTarget = async (input, args) => {
|
|
|
576
576
|
canvasId: reference.canvasId,
|
|
577
577
|
target: args.target
|
|
578
578
|
};
|
|
579
|
-
const held =
|
|
579
|
+
const held = wholeCanvasDocumentOutputSchema.parse(await invoke(input, "canvas.document.get", { canvasId: reference.canvasId }));
|
|
580
580
|
if (held.version !== args.expectedVersion) throw new CliError("CONFLICT", "The canvas changed before rendering.", "Read the selected subtree and render its current version.");
|
|
581
581
|
return {
|
|
582
582
|
canvasId: reference.canvasId,
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { a as toSharedCapabilities, p as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-D5TqbvV1.mjs";
|
|
3
3
|
import { t as toCapabilityInventory } from "./capability-inventory.mapper-DyYXyVBJ.mjs";
|
|
4
|
-
import { t as createMcpServerAdapter } from "./mcp-server.adapter-
|
|
4
|
+
import { t as createMcpServerAdapter } from "./mcp-server.adapter-BMwIrDdF.mjs";
|
|
5
5
|
|
|
6
6
|
export { createCapabilityCatalogAdapter, createMcpServerAdapter as createEnhanceMcpServer, toCapabilityInventory, toSharedCapabilities };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as canvasRenderBatchRequestSchema, $n as wholeCanvasDocumentOutputSchema, $t as cliAuthConfigurationSchema, An as canvasRecordingPropsSchema, Ar as canvasAdditionalStyleSchema, At as hasCanvasReferenceScope, Bn as FRAME_KIND, Bt as getRecordingOutputSchema, Cn as canvasCssTypographyOwners, Cr as reserveCanvasAssetOutputSchema, D as encodeCanvasExchangeToken, Dn as canvasCaptureSchema, Dr as canvasRichTextValueOf, Dt as canvasReferenceNodeIds, E as decodeCanvasExchangeToken, Er as canvasRichTextOf, Et as assertCanvasReferenceNodes, F as canvasAssetImportOutputSchema, G as canvasApplyCapabilityInputSchema, Gn as TEXT_KIND, Gt as foldPrototypeArtifactPath, H as canvasCaptureCapabilityInputSchema, Hn as IMAGE_KIND, Ht as PROTOTYPE_ARTIFACT_MANIFEST_PATH, I as canvasArrangeCapabilityInputSchema, In as AGENT_CLIENT_HEADER, Ir as listCanvasesOutputSchema, J as canvasWriteHtmlCapabilityInputSchema, Jn as getCanvasMutationOutputSchema, Jt as prototypeArtifactManifestSchema, K as canvasReadCapabilityInputSchema, Kn as applyCanvasOperationsInputSchema, Kt as getPrototypeArtifactCapabilitiesOutputSchema, Mn as canvasReferencePageOf, Mr as canvasBlendModeSchema, Mt as PartialBatchError, N as canvasAssetImportCapabilityInputSchema, Nn as resolveCanvasReference, Nr as canvasPaintSchema, Nt as CliError, O as resolveCanvasSnapshot, On as canvasConversionMetadataSchema, Or as hasCanvasRichTextPaints, Pn as beginCanvasActivityOutputSchema, Pt as transcriptOutputSchema, Q as transcriptReadCapabilityInputSchema, R as canvasDuplicateCapabilityInputSchema, Rn as createCanvasPreparationOutputSchema, Sn as applyCanvasTypographyPatch, Sr as reserveCanvasAssetInputSchema, St as canvasMakeEditableCapabilityInputSchema, T as canvasSnapshotToken, Tn as canvasTextPropsWithContent, Tr as canvasImageAssetIdentityFromPath, Un as PAGE_KIND, Ut as attachPrototypeArtifactOutputSchema, Vn as GROUP_KIND, Wn as RECTANGLE_KIND, Wt as createPrototypeArtifactOutputSchema, X as prototypePublishCapabilityInputSchema, Xn as textOf, Xt as submitPrototypeArtifactOutputSchema, Y as commentAttentionCapabilityInputSchema, Yn as canvasLayoutWithoutCssProperties, Yt as prototypeArtifactPathSchema, Z as recordingSnapshotCapabilityInputSchema, Zn as mapCanvasFontSources, Zt as getMeOutputSchema, _t as canvasFindCursorSchema, ar as canvasRenderStateSchema, at as canvasRenderFileSchema, b as canvasPrototypeCapabilityInputSchema, br as canvasCssValue, bt as canvasInsertHtmlCapabilityInputSchema, cr as createCanvasRenderOutputSchema, ct as canvasOutlineCursorSchema, d as toRemoteError, dr as getCanvasRenderOutputSchema, dt as canvasUpdateHtmlCapabilityInputSchema, en as createAgentTokenOutputSchema, fr as canvasReadableSceneDocumentSchema, ft as canvasUpdateHtmlInputSchema, gr as canvasAxisStyleProperties, hr as canvasAuthoredStyleDeclarations, it as canvasRenderRequestSchema, j as operationStatusInputSchema, jn as DEFAULT_CANVAS_REFERENCE_PAGE_ID, jr as CANVAS_BLEND_MODES, jt as parseCanvasReference, kn as canvasPrototypePropsSchema, kr as CANVAS_RICH_TEXT_STYLE_PROPERTIES, lr as createRecordingSnapshotOutputSchema, lt as canvasReadInputSchema, mt as canvasResourcesCursorSchema, nn as listOrganisationsOutputSchema, nr as createCanvasConversionOutputSchema, ot as canvasRemoveCapabilityInputSchema, pr as canvasSceneDocumentSchema, pt as canvasTranscriptCursorSchema, q as canvasRenderCapabilityInputSchema, qn as applyCanvasOperationsOutputSchema, qt as getPrototypePublishStatusOutputSchema, rr as getCanvasConversionOutputSchema, tr as canvasNodeStylePatchSchema, tt as canvasRenderPendingSchema, ur as downloadCanvasRenderOutputSchema, vt as canvasFindInputSchema, w as canvasExchangeDigest, wn as canvasTextChangeBetween, wr as canvasFontAssetIdentityFromPath, wt as canvasEditCapabilityInputSchema, xr as canvasAssetUploadOutputSchema, yr as canvasCssTokens, zn as getCanvasPreparationOutputSchema } from "./cli-output-identity.lib-D5TqbvV1.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { homedir, tmpdir } from "node:os";
|
|
@@ -1408,7 +1408,7 @@ const union = (boxes) => {
|
|
|
1408
1408
|
const apply = async (remote, input) => {
|
|
1409
1409
|
const response = await remote.mutate(APPLY_PROCEDURE, {
|
|
1410
1410
|
...input,
|
|
1411
|
-
documentFormatVersion:
|
|
1411
|
+
documentFormatVersion: 14
|
|
1412
1412
|
});
|
|
1413
1413
|
const parsed = applyCanvasOperationsOutputSchema.safeParse(response);
|
|
1414
1414
|
if (!parsed.success) throw new CliError("INTERNAL", "The API returned an invalid canvas apply response.", "Run `enhance doctor`; report the API and CLI versions if they differ.");
|
|
@@ -1435,7 +1435,7 @@ const createApplyCanvasComposite = (remote) => ({ execute: async (input, options
|
|
|
1435
1435
|
//#endregion
|
|
1436
1436
|
//#region src/application/canvas-scene-at-version.use-case.ts
|
|
1437
1437
|
const sceneAtVersion = async (input, canvasId, expectedVersion) => {
|
|
1438
|
-
const held =
|
|
1438
|
+
const held = wholeCanvasDocumentOutputSchema.safeParse(await input.remote.query("canvas.document.get", { canvasId }));
|
|
1439
1439
|
if (!held.success) throw new CliError("INTERNAL", "The API returned an invalid canvas document.", "Run `enhance doctor` and report incompatible API and CLI versions.");
|
|
1440
1440
|
if (held.data.version !== expectedVersion) throw new CliError("CONFLICT", `Canvas version ${String(held.data.version)} no longer matches --base-version ${String(expectedVersion)}.`, `An earlier identical request may already have committed. Do not repeat it with a new client token. Inspect the intended scope with 'enhance canvas tree --canvas <the original canvas or selection link>' and reconcile against version ${String(held.data.version)} before submitting a new edit.`);
|
|
1441
1441
|
const scene = canvasReadableSceneDocumentSchema.safeParse(held.data.document);
|
|
@@ -2476,7 +2476,8 @@ const canvasImagePaintProperty = (paint) => `--canvas-image-paint-${bytesToHex(s
|
|
|
2476
2476
|
const canvasTextPaintStackProperty = (paints) => `--canvas-text-paints-${bytesToHex(sha256(utf8ToBytes(JSON.stringify(paints.filter((paint) => paint.visible), (key, value) => key === "id" ? void 0 : value))))}`;
|
|
2477
2477
|
const PERCENT$1 = 100;
|
|
2478
2478
|
const stopCss = (stop, opacity = 1) => `${canvasColorCss(stop.color, opacity)} ${String(stop.position * PERCENT$1)}%`;
|
|
2479
|
-
const
|
|
2479
|
+
const canvasPaintImageAddress = (source) => encodeURI(source).replaceAll("\"", "%22");
|
|
2480
|
+
const canvasPaintImageUrl = (source) => `url("${canvasPaintImageAddress(source)}")`;
|
|
2480
2481
|
const canvasPaintLayerCss = (paint) => {
|
|
2481
2482
|
switch (paint.kind) {
|
|
2482
2483
|
case "solid": {
|
|
@@ -2781,6 +2782,7 @@ const hasCanvasRoundedBorderFallback = (node) => {
|
|
|
2781
2782
|
const canvasCornerShapeDeclarations = (node, size = node.box) => {
|
|
2782
2783
|
const radius = node.appearance?.radius;
|
|
2783
2784
|
if (radius === void 0 || size === void 0 || node.geometry?.kind === "path" || node.geometry?.kind === "boolean") return {};
|
|
2785
|
+
if ((radius.smoothing ?? 0) <= 0 && radius.topLeft === radius.topRight && radius.topLeft === radius.bottomRight && radius.topLeft === radius.bottomLeft) return canvasCornerRadiusDeclarations(radius);
|
|
2784
2786
|
const effective = constrainedCornerRadii(radius, size);
|
|
2785
2787
|
const declarations = canvasCornerRadiusDeclarations(effective);
|
|
2786
2788
|
if ((radius.smoothing ?? 0) <= 0) return declarations;
|
|
@@ -2849,7 +2851,7 @@ const STROKE_OWNERS = /* @__PURE__ */ new Set([
|
|
|
2849
2851
|
RECTANGLE_KIND
|
|
2850
2852
|
]);
|
|
2851
2853
|
const isCanvasBlendedPaint = (paint) => paint.visible && (paint.blendMode ?? "normal") !== "normal";
|
|
2852
|
-
const
|
|
2854
|
+
const isCanvasPaintedFill = (paint) => {
|
|
2853
2855
|
if (!paint.visible || paint.opacity <= 0) return false;
|
|
2854
2856
|
if (paint.kind === "solid") return paint.color.alpha > 0;
|
|
2855
2857
|
if (paint.kind === "image") return true;
|
|
@@ -2858,37 +2860,41 @@ const isPainted = (paint) => {
|
|
|
2858
2860
|
const hasCapturedBox = (node) => {
|
|
2859
2861
|
const source = node.props?.["source"];
|
|
2860
2862
|
if (typeof source !== "object" || source === null) return false;
|
|
2863
|
+
if (typeof Reflect.get(source, "pseudo") === "string") return true;
|
|
2861
2864
|
const layout = Reflect.get(source, "layout");
|
|
2862
2865
|
return typeof Reflect.get(source, "path") === "string" && typeof layout === "object" && layout !== null && typeof Reflect.get(layout, "tag") === "string";
|
|
2863
2866
|
};
|
|
2864
2867
|
/**
|
|
2865
2868
|
* As in Figma, a rectangle casts its shadows from what it paints, so one with no fill, border or
|
|
2866
|
-
* outline that shows casts none. A frame, and a box captured from HTML, keep the
|
|
2869
|
+
* outline that shows casts none. A frame, and a box or pseudo-element captured from HTML, keep the
|
|
2870
|
+
* box's shadow.
|
|
2867
2871
|
*/
|
|
2868
2872
|
const canvasCastsNoShadow = (node) => {
|
|
2869
2873
|
if (node.component !== "rectangle" || node.geometry !== void 0 || hasCapturedBox(node)) return false;
|
|
2870
2874
|
const { fills = [], border, outline } = node.appearance ?? {};
|
|
2871
2875
|
const strokes = [border, outline].filter((stroke) => stroke?.visible === true);
|
|
2872
|
-
return [...fills, ...strokes.flatMap((stroke) => stroke?.paints ?? [])].every((paint) => !
|
|
2876
|
+
return [...fills, ...strokes.flatMap((stroke) => stroke?.paints ?? [])].every((paint) => !isCanvasPaintedFill(paint));
|
|
2873
2877
|
};
|
|
2874
2878
|
/** A native image is an `img`, which holds no element; an image drawn from its fills is a box. */
|
|
2875
|
-
const
|
|
2879
|
+
const isCanvasBoxLayer = (node) => node.geometry === void 0 && BOX_LAYERS.has(node.component) && (node.component !== "image" || (typeof node.props?.["src"] !== "string" || node.props["src"] === "") && node.appearance?.fills !== void 0);
|
|
2876
2880
|
const visibleStrokePaints = (stroke) => stroke?.visible === true ? stroke.paints.filter((paint) => paint.visible) : [];
|
|
2877
2881
|
/** Plus darker and an image filter have no CSS background form; a blend reaches only so. */
|
|
2878
2882
|
const fillNeedsElement = (paint) => isCanvasBlendedPaint(paint) || paint.kind === "image" && (paint.filters?.some((filter) => filter.visible) ?? false);
|
|
2879
2883
|
/** The visible fills, when any of them needs its own element: then every fill is one, in order. */
|
|
2880
2884
|
const fillElementsOf = (node) => {
|
|
2881
|
-
if (!
|
|
2885
|
+
if (!isCanvasBoxLayer(node)) return [];
|
|
2882
2886
|
const fills = (node.appearance?.fills ?? []).filter((paint) => paint.visible);
|
|
2883
2887
|
return fills.some((paint) => fillNeedsElement(paint)) || fills.length > 0 && canvasProgressiveBlurOf(node) !== null ? fills : [];
|
|
2884
2888
|
};
|
|
2889
|
+
/** A captured dashed border with no edited pattern stays CSS's, which the browser draws exactly. */
|
|
2890
|
+
const canvasBorderDrawsWithCssStyle = (border) => border.style === "solid" || border.dashOrigin === "css" && border.dashPattern === void 0 && border.dashCap === void 0;
|
|
2885
2891
|
/**
|
|
2886
|
-
* One solid paint on an
|
|
2887
|
-
* is #469's border element: its paints stacked as backgrounds clipped to the border area.
|
|
2892
|
+
* One solid paint on an inside border with a CSS style stays CSS border-color on the layer. Anything
|
|
2893
|
+
* else is #469's border element: its paints stacked as backgrounds clipped to the border area.
|
|
2888
2894
|
*/
|
|
2889
2895
|
const borderNeedsElement = (border) => {
|
|
2890
2896
|
const paints = visibleStrokePaints(border);
|
|
2891
|
-
return paints.length > 0 && ((border.alignment ?? "inside") !== "inside" || border
|
|
2897
|
+
return paints.length > 0 && ((border.alignment ?? "inside") !== "inside" || !canvasBorderDrawsWithCssStyle(border) || paints.length > 1 || paints.some((paint) => paint.kind !== "solid"));
|
|
2892
2898
|
};
|
|
2893
2899
|
/** The border's ring elements: one per paint when a paint blends, so each blends on its own. */
|
|
2894
2900
|
const borderElementsOf = (node, hasFillElements) => {
|
|
@@ -2929,7 +2935,7 @@ const outlineElementsOf = (node) => {
|
|
|
2929
2935
|
/** The paint elements of a layer, in the order CSS paints a box, and whether it has any. */
|
|
2930
2936
|
const canvasPaintElementPlanOf = (node) => {
|
|
2931
2937
|
const fills = fillElementsOf(node);
|
|
2932
|
-
const shadows =
|
|
2938
|
+
const shadows = isCanvasBoxLayer(node) && !canvasCastsNoShadow(node) ? (node.appearance?.shadows ?? []).filter((shadow) => shadow.visible) : [];
|
|
2933
2939
|
const outer = shadows.filter((shadow) => shadow.kind === "outer" && isCanvasBlendedPaint(shadow));
|
|
2934
2940
|
const inner = shadows.filter((shadow) => shadow.kind === "inner" && (fills.length > 0 || isCanvasBlendedPaint(shadow)));
|
|
2935
2941
|
const underChildren = [
|
|
@@ -3136,7 +3142,7 @@ const canvasBoxStrokeDeclarations = (node, size = node.box, ringPaints) => {
|
|
|
3136
3142
|
radius: node.appearance?.radius
|
|
3137
3143
|
};
|
|
3138
3144
|
const [only] = paints;
|
|
3139
|
-
const isBorderColor = paints.length === 1 && only?.kind === "solid" && (only.blendMode ?? "normal") === "normal" && border
|
|
3145
|
+
const isBorderColor = paints.length === 1 && only?.kind === "solid" && (only.blendMode ?? "normal") === "normal" && canvasBorderDrawsWithCssStyle(border) && share === 0;
|
|
3140
3146
|
return {
|
|
3141
3147
|
position: "absolute",
|
|
3142
3148
|
inset: 0,
|
|
@@ -3167,7 +3173,7 @@ const canvasBoxStrokeDeclarations = (node, size = node.box, ringPaints) => {
|
|
|
3167
3173
|
additionalStyles: void 0,
|
|
3168
3174
|
appearance
|
|
3169
3175
|
}, size),
|
|
3170
|
-
|
|
3176
|
+
...!isBorderColor && borderDashMaskDeclarations(node, border, size, share === 0 ? NO_OUTSET : outset)
|
|
3171
3177
|
};
|
|
3172
3178
|
};
|
|
3173
3179
|
|
|
@@ -3623,12 +3629,12 @@ const hasSquareCorners = (node) => {
|
|
|
3623
3629
|
return radius.topLeft === 0 && radius.topRight === 0 && radius.bottomRight === 0 && radius.bottomLeft === 0;
|
|
3624
3630
|
};
|
|
3625
3631
|
/** Text masks through background-clip, which shows only a layer's own fills. */
|
|
3626
|
-
const
|
|
3632
|
+
const isCanvasFillOnly = (node) => {
|
|
3627
3633
|
const appearance = canvasAppearanceOf(node);
|
|
3628
3634
|
return canvasBorderOf(node).kind !== "native" && canvasOutlineOf(node).kind !== "native" && appearance.shadows.every((shadow) => !shadow.visible) && appearance.filters.every((filter) => !filter.visible) && appearance.backdropFilters.every((filter) => !filter.visible);
|
|
3629
3635
|
};
|
|
3630
|
-
/** Whether text can mask the layer: an image or
|
|
3631
|
-
const canCanvasTextMask = (node) => node !== void 0 && (node.component === "image" || node.component === "rectangle" && hasSquareCorners(node)) &&
|
|
3636
|
+
/** Whether text can mask the layer: an image or plain rectangle whose paint is fills only. */
|
|
3637
|
+
const canCanvasTextMask = (node) => node !== void 0 && node.geometry === void 0 && (node.component === "image" || node.component === "rectangle" && hasSquareCorners(node)) && isCanvasFillOnly(node);
|
|
3632
3638
|
|
|
3633
3639
|
//#endregion
|
|
3634
3640
|
//#region ../../packages/canvas-document/src/canvas-text-mask.lib.ts
|
|
@@ -4441,7 +4447,7 @@ const createEditCanvasComposite = (remote) => ({ execute: async (input) => {
|
|
|
4441
4447
|
const parsed = applyCanvasOperationsInputSchema.safeParse({
|
|
4442
4448
|
canvasId: input.canvasId,
|
|
4443
4449
|
mutationId: input.mutationId,
|
|
4444
|
-
documentFormatVersion:
|
|
4450
|
+
documentFormatVersion: 14,
|
|
4445
4451
|
baseVersion: input.baseVersion,
|
|
4446
4452
|
operations: plan.operations
|
|
4447
4453
|
});
|
|
@@ -4778,7 +4784,7 @@ const createWriteHtmlCanvasComposite = (remote, render) => ({ execute: async (in
|
|
|
4778
4784
|
//#region src/application/read-canvas-reference.use-case.ts
|
|
4779
4785
|
const readCanvasReferenceScene = async (remote, input) => {
|
|
4780
4786
|
const reference = parseCanvasReference(input.canvas);
|
|
4781
|
-
const held =
|
|
4787
|
+
const held = wholeCanvasDocumentOutputSchema.parse(await remote.query("canvas.document.get", { canvasId: reference.canvasId }));
|
|
4782
4788
|
const document = canvasReadableSceneDocumentSchema.parse(held.document);
|
|
4783
4789
|
if (hasCanvasReferenceScope(reference)) canvasReferenceNodeIds(reference, document);
|
|
4784
4790
|
if (input.nodeId !== void 0) assertCanvasReferenceNodes(reference, document, [input.nodeId]);
|
|
@@ -4867,7 +4873,7 @@ const assertIdentity = (asset, intent) => {
|
|
|
4867
4873
|
const createImportCanvasAssetComposite = (remote, files) => ({ execute: async (input) => {
|
|
4868
4874
|
const reference = parseCanvasReference(input.canvasRef);
|
|
4869
4875
|
if (hasCanvasReferenceScope(reference)) {
|
|
4870
|
-
const held =
|
|
4876
|
+
const held = wholeCanvasDocumentOutputSchema.parse(await remote.query(ASSET_PROCEDURES[2], { canvasId: reference.canvasId }));
|
|
4871
4877
|
canvasReferenceNodeIds(reference, canvasReadableSceneDocumentSchema.parse(held.document));
|
|
4872
4878
|
}
|
|
4873
4879
|
const { body, ...file } = await files.read();
|
|
@@ -5847,7 +5853,7 @@ const commitPreparation = async (remote, input, job, fingerprint) => {
|
|
|
5847
5853
|
const request = applyCanvasOperationsInputSchema.parse({
|
|
5848
5854
|
canvasId: job.canvasId,
|
|
5849
5855
|
mutationId: input.clientToken,
|
|
5850
|
-
documentFormatVersion:
|
|
5856
|
+
documentFormatVersion: 14,
|
|
5851
5857
|
baseVersion: input.baseVersion,
|
|
5852
5858
|
operations: job.result.operations,
|
|
5853
5859
|
requestContext: {
|
|
@@ -7211,7 +7217,7 @@ const editable = (input, snapshot) => {
|
|
|
7211
7217
|
};
|
|
7212
7218
|
const createReadCanvasComposite = (remote) => ({ execute: async (input) => {
|
|
7213
7219
|
const reference = parseCanvasReference(input.canvasRef);
|
|
7214
|
-
const held =
|
|
7220
|
+
const held = wholeCanvasDocumentOutputSchema.parse(await remote.query(READ_CANVAS_PROCEDURES[0], { canvasId: reference.canvasId }));
|
|
7215
7221
|
if (input.expectedVersion !== void 0 && input.expectedVersion !== held.version) return stale(held.version);
|
|
7216
7222
|
const current = canvasSceneDocumentSchema.safeParse(held.document);
|
|
7217
7223
|
const scene = current.success ? current.data : canvasReadableSceneDocumentSchema.parse(held.document);
|
|
@@ -7269,7 +7275,7 @@ const createRevisionedCanvasCommandComposite = (remote) => ({ execute: async (in
|
|
|
7269
7275
|
};
|
|
7270
7276
|
const request = applyCanvasOperationsInputSchema.safeParse({
|
|
7271
7277
|
canvasId,
|
|
7272
|
-
documentFormatVersion:
|
|
7278
|
+
documentFormatVersion: 14,
|
|
7273
7279
|
mutationId: input.clientToken,
|
|
7274
7280
|
baseVersion: input.baseVersion,
|
|
7275
7281
|
operations,
|
package/dist/remote-mcp-main.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { a as readRemoteMcpEnvironment, c as createPrototypeArtifactAdapter, l as createPublishCanvasPrototypeComposite, n as createHttpRemoteAdapter, t as createMutationKeyAdapter, u as createImportCanvasAssetComposite } from "./mutation-key.adapter-
|
|
4
|
-
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
5
|
-
import { a as createMcpResultAdapter, o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-
|
|
2
|
+
import { C as canvasPrototypeOutputSchema, F as canvasAssetImportOutputSchema, Gt as foldPrototypeArtifactPath, Nt as CliError, P as canvasAssetImportInputSchema, Qt as MCP_AUTH_SCOPE, S as canvasPrototypeIntentSchema, Yt as prototypeArtifactPathSchema, Zt as getMeOutputSchema, p as createCapabilityCatalogAdapter, v as PROTOTYPE_UPDATE_GUIDANCE } from "./cli-output-identity.lib-D5TqbvV1.mjs";
|
|
3
|
+
import { a as readRemoteMcpEnvironment, c as createPrototypeArtifactAdapter, l as createPublishCanvasPrototypeComposite, n as createHttpRemoteAdapter, t as createMutationKeyAdapter, u as createImportCanvasAssetComposite } from "./mutation-key.adapter-C1RE4KHd.mjs";
|
|
4
|
+
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-Dchzrqtn.mjs";
|
|
5
|
+
import { a as createMcpResultAdapter, o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-BMwIrDdF.mjs";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import os, { tmpdir } from "node:os";
|
|
@@ -515,7 +515,7 @@ const registerAsset = (server, input) => {
|
|
|
515
515
|
const registerPrototype = (server, input) => {
|
|
516
516
|
server.registerTool("prototype_publish", {
|
|
517
517
|
title: "Publish a prototype to the canvas",
|
|
518
|
-
description:
|
|
518
|
+
description: `Publish an uploaded static build ZIP or resume an existing deployment. ${PROTOTYPE_UPDATE_GUIDANCE} For source.kind=build supply file and build metadata; use a ZIP with the chosen HTML entry at its stated path. Runnable builds can execute scripts and contact external services when opened. Preserve the complete canvas reference and baseVersion. Reports ingestion separately from attachment. Retry identical build bytes and clientToken; a fresh download URL is allowed. After attachment conflict, reuse the ready deployment with a new token and deliberate revised baseVersion. Status reads never attach.`,
|
|
519
519
|
inputSchema: prototypeInputSchema,
|
|
520
520
|
outputSchema: canvasPrototypeOutputSchema,
|
|
521
521
|
annotations: {
|
|
@@ -729,7 +729,7 @@ const server = await createRemoteMcpHttpAdapter({
|
|
|
729
729
|
fileOrigins: config.MCP_FILE_ORIGINS.split(",").map((value) => value.trim()).filter(Boolean),
|
|
730
730
|
allowedHosts: config.MCP_ALLOWED_HOSTS.split(",").map((value) => value.trim()),
|
|
731
731
|
allowedOrigins: config.MCP_ALLOWED_ORIGINS.split(",").map((value) => value.trim()),
|
|
732
|
-
version: "0.1.
|
|
732
|
+
version: "0.1.40",
|
|
733
733
|
...config.MCP_UI_URL !== void 0 && { uiUrl: config.MCP_UI_URL },
|
|
734
734
|
onerror: (error) => process.stderr.write(`${error.message}\n`)
|
|
735
735
|
});
|