@enhance-eng/enhance 0.1.39 → 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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { A as operationStatusOutputSchema, D as canvasConversionStatusSchema, F as canvasArrangeInputSchema, H as canvasCaptureOutputSchema, L as canvasDuplicateInputSchema, M as canvasAssetImportInputSchema, N as canvasAssetImportOutputSchema, Nr as createCanvasOutputSchema, O as operationStatusImageSchema, R as canvasPreparationOutputSchema, S as canvasExchangeDigest, T as encodeCanvasExchangeToken, V as canvasCaptureInputSchema, _n as screenElementsCommentTargetSchema, _t as canvasFindOutputSchema, an as commentMessageSchema, at as canvasRemoveInputSchema, cn as domLocatorSchema, ct as canvasReadOutputSchema, dn as listCommentsInputSchema, f as createCapabilityCatalogAdapter, fn as listCommentsOutputSchema, gn as screenElementCommentTargetSchema, gt as canvasFindInputSchema, hn as screenAreaCommentTargetSchema, in as commentCanvasContextSchema, jt as CliError, k as operationStatusInputSchema, kt as parseCanvasReference, ln as elementAnchorSchema, mn as replyCommentOutputSchema, mt as canvasCreateToolOutputSchema, o as toMcpFailurePayload, on as commentResolverSchema, pn as replyCommentInputSchema, pt as canvasCreateToolInputSchema, rn as commentAuthorSchema, sn as commentThreadSchema, st as canvasReadInputSchema, tt as canvasRenderScopedToolInputSchema, un as getCommentOutputSchema, ut as canvasUpdateHtmlInputSchema, vn as screenTextCommentTargetSchema, w as decodeCanvasExchangeToken, x as canvasPrototypeOutputSchema, xt as canvasMakeEditableInputSchema, y as canvasPrototypeInputSchema, yn as startCommentInputSchema, yt as canvasInsertHtmlInputSchema, z as canvasWriteReceiptSchema } from "./cli-output-identity.lib-DgHRuXTI.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-BWkNj5jp.mjs";
4
- import { a as createMcpResultAdapter, i as mcpDispatchedResultSchema, n as createMcpWorkflowsAdapter, o as createMcpClientContextAdapter, r as createMcpClientInvocationAdapter } from "./mcp-server.adapter-DOHJxL6l.mjs";
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: "Publish a selected, unpacked static build directory through the native artifact pipeline, or resume its deployment. 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.",
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 { f as createCapabilityCatalogAdapter, h as toCapabilityDefinition } from "./cli-output-identity.lib-DgHRuXTI.mjs";
3
- import { i as readLocalMcpEnvironment } from "./mutation-key.adapter-BWkNj5jp.mjs";
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-CjZnnMCd.mjs";
6
- import { o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-DOHJxL6l.mjs";
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.39" });
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.39",
180
+ version: "0.1.40",
181
181
  invocation,
182
182
  clientMetadata: client.metadata,
183
183
  catalog
184
184
  }) : createMcpServerAdapter({
185
- version: "0.1.39",
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 { Et as canvasReferenceRenderTarget, Fn as agentClientMetadata, K as canvasWriteHtmlCapabilityInputSchema, Ot as hasCanvasReferenceScope, Q as canvasRenderBatchResultSchema, St as canvasEditCapabilityInputSchema, Xn as getCanvasDocumentOutputSchema, c as toPresentedCapabilities, f as createCapabilityCatalogAdapter, ir as canvasRenderTargetSchema, jt as CliError, kt as parseCanvasReference, n as withCommandName, nr as canvasRenderSourceStateSchema, o as toMcpFailurePayload, r as toCanvasAuthoringResult, rt as canvasRenderFileSchema, t as withCommandInFailure, u as createMcpCapabilityDiscoveryAdapter, ur as canvasReadableSceneDocumentSchema } from "./cli-output-identity.lib-DgHRuXTI.mjs";
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 = getCanvasDocumentOutputSchema.parse(await invoke(input, "canvas.document.get", { canvasId: reference.canvasId }));
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 { f as createCapabilityCatalogAdapter, l as toSharedCapabilities } from "./cli-output-identity.lib-DgHRuXTI.mjs";
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-DOHJxL6l.mjs";
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 canvasRenderPendingSchema, $n as canvasNodeStylePatchSchema, An as canvasReferencePageOf, Ar as canvasBlendModeSchema, At as PartialBatchError, B as canvasCaptureCapabilityInputSchema, Bn as IMAGE_KIND, Bt as PROTOTYPE_ARTIFACT_MANIFEST_PATH, C as canvasSnapshotToken, Cn as canvasTextPropsWithContent, Cr as canvasImageAssetIdentityFromPath, Dn as canvasPrototypePropsSchema, Dr as CANVAS_RICH_TEXT_STYLE_PROPERTIES, E as resolveCanvasSnapshot, En as canvasConversionMetadataSchema, Er as hasCanvasRichTextPaints, G as canvasRenderCapabilityInputSchema, Gn as applyCanvasOperationsOutputSchema, Gt as getPrototypePublishStatusOutputSchema, Hn as RECTANGLE_KIND, Ht as createPrototypeArtifactOutputSchema, I as canvasDuplicateCapabilityInputSchema, In as createCanvasPreparationOutputSchema, J as prototypePublishCapabilityInputSchema, Jn as textOf, Jt as submitPrototypeArtifactOutputSchema, K as canvasWriteHtmlCapabilityInputSchema, Kn as getCanvasMutationOutputSchema, Kt as prototypeArtifactManifestSchema, Ln as getCanvasPreparationOutputSchema, Mn as beginCanvasActivityOutputSchema, Mt as transcriptOutputSchema, N as canvasAssetImportOutputSchema, On as canvasRecordingPropsSchema, Or as canvasAdditionalStyleSchema, Ot as hasCanvasReferenceScope, P as canvasArrangeCapabilityInputSchema, Pn as AGENT_CLIENT_HEADER, Pr as listCanvasesOutputSchema, Qt as createAgentTokenOutputSchema, Rn as FRAME_KIND, Rt as getRecordingOutputSchema, S as canvasExchangeDigest, Sn as canvasTextChangeBetween, Sr as canvasFontAssetIdentityFromPath, St as canvasEditCapabilityInputSchema, T as encodeCanvasExchangeToken, Tn as canvasCaptureSchema, Tr as canvasRichTextValueOf, Tt as canvasReferenceNodeIds, U as canvasApplyCapabilityInputSchema, Un as TEXT_KIND, Ut as foldPrototypeArtifactPath, Vn as PAGE_KIND, Vt as attachPrototypeArtifactOutputSchema, W as canvasReadCapabilityInputSchema, Wn as applyCanvasOperationsInputSchema, Wt as getPrototypeArtifactCapabilitiesOutputSchema, X as transcriptReadCapabilityInputSchema, Xn as getCanvasDocumentOutputSchema, Y as recordingSnapshotCapabilityInputSchema, Yn as mapCanvasFontSources, Yt as getMeOutputSchema, Z as canvasRenderBatchRequestSchema, Zt as cliAuthConfigurationSchema, _r as canvasCssTokens, bn as applyCanvasTypographyPatch, br as reserveCanvasAssetInputSchema, bt as canvasMakeEditableCapabilityInputSchema, cr as downloadCanvasRenderOutputSchema, dr as canvasSceneDocumentSchema, dt as canvasTranscriptCursorSchema, en as listOrganisationsOutputSchema, er as createCanvasConversionOutputSchema, ft as canvasResourcesCursorSchema, gt as canvasFindInputSchema, ht as canvasFindCursorSchema, it as canvasRemoveCapabilityInputSchema, j as canvasAssetImportCapabilityInputSchema, jn as resolveCanvasReference, jr as canvasPaintSchema, jt as CliError, k as operationStatusInputSchema, kn as DEFAULT_CANVAS_REFERENCE_PAGE_ID, kr as CANVAS_BLEND_MODES, kt as parseCanvasReference, lr as getCanvasRenderOutputSchema, lt as canvasUpdateHtmlCapabilityInputSchema, mr as canvasAxisStyleProperties, nt as canvasRenderRequestSchema, or as createCanvasRenderOutputSchema, ot as canvasOutlineCursorSchema, pr as canvasAuthoredStyleDeclarations, q as commentAttentionCapabilityInputSchema, qn as canvasLayoutWithoutCssProperties, qt as prototypeArtifactPathSchema, rr as canvasRenderStateSchema, rt as canvasRenderFileSchema, s as toRemoteError, sr as createRecordingSnapshotOutputSchema, st as canvasReadInputSchema, tr as getCanvasConversionOutputSchema, ur as canvasReadableSceneDocumentSchema, ut as canvasUpdateHtmlInputSchema, v as canvasPrototypeCapabilityInputSchema, vr as canvasCssValue, vt as canvasInsertHtmlCapabilityInputSchema, w as decodeCanvasExchangeToken, wr as canvasRichTextOf, wt as assertCanvasReferenceNodes, xn as canvasCssTypographyOwners, xr as reserveCanvasAssetOutputSchema, yr as canvasAssetUploadOutputSchema, zn as GROUP_KIND } from "./cli-output-identity.lib-DgHRuXTI.mjs";
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: 13
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 = getCanvasDocumentOutputSchema.safeParse(await input.remote.query("canvas.document.get", { canvasId }));
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 canvasPaintImageUrl = (source) => `url("${encodeURI(source).replaceAll("\"", "%22")}")`;
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": {
@@ -2850,7 +2851,7 @@ const STROKE_OWNERS = /* @__PURE__ */ new Set([
2850
2851
  RECTANGLE_KIND
2851
2852
  ]);
2852
2853
  const isCanvasBlendedPaint = (paint) => paint.visible && (paint.blendMode ?? "normal") !== "normal";
2853
- const isPainted = (paint) => {
2854
+ const isCanvasPaintedFill = (paint) => {
2854
2855
  if (!paint.visible || paint.opacity <= 0) return false;
2855
2856
  if (paint.kind === "solid") return paint.color.alpha > 0;
2856
2857
  if (paint.kind === "image") return true;
@@ -2859,27 +2860,29 @@ const isPainted = (paint) => {
2859
2860
  const hasCapturedBox = (node) => {
2860
2861
  const source = node.props?.["source"];
2861
2862
  if (typeof source !== "object" || source === null) return false;
2863
+ if (typeof Reflect.get(source, "pseudo") === "string") return true;
2862
2864
  const layout = Reflect.get(source, "layout");
2863
2865
  return typeof Reflect.get(source, "path") === "string" && typeof layout === "object" && layout !== null && typeof Reflect.get(layout, "tag") === "string";
2864
2866
  };
2865
2867
  /**
2866
2868
  * As in Figma, a rectangle casts its shadows from what it paints, so one with no fill, border or
2867
- * outline that shows casts none. A frame, and a box captured from HTML, keep the box's shadow.
2869
+ * outline that shows casts none. A frame, and a box or pseudo-element captured from HTML, keep the
2870
+ * box's shadow.
2868
2871
  */
2869
2872
  const canvasCastsNoShadow = (node) => {
2870
2873
  if (node.component !== "rectangle" || node.geometry !== void 0 || hasCapturedBox(node)) return false;
2871
2874
  const { fills = [], border, outline } = node.appearance ?? {};
2872
2875
  const strokes = [border, outline].filter((stroke) => stroke?.visible === true);
2873
- return [...fills, ...strokes.flatMap((stroke) => stroke?.paints ?? [])].every((paint) => !isPainted(paint));
2876
+ return [...fills, ...strokes.flatMap((stroke) => stroke?.paints ?? [])].every((paint) => !isCanvasPaintedFill(paint));
2874
2877
  };
2875
2878
  /** A native image is an `img`, which holds no element; an image drawn from its fills is a box. */
2876
- const isBoxLayer = (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);
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);
2877
2880
  const visibleStrokePaints = (stroke) => stroke?.visible === true ? stroke.paints.filter((paint) => paint.visible) : [];
2878
2881
  /** Plus darker and an image filter have no CSS background form; a blend reaches only so. */
2879
2882
  const fillNeedsElement = (paint) => isCanvasBlendedPaint(paint) || paint.kind === "image" && (paint.filters?.some((filter) => filter.visible) ?? false);
2880
2883
  /** The visible fills, when any of them needs its own element: then every fill is one, in order. */
2881
2884
  const fillElementsOf = (node) => {
2882
- if (!isBoxLayer(node)) return [];
2885
+ if (!isCanvasBoxLayer(node)) return [];
2883
2886
  const fills = (node.appearance?.fills ?? []).filter((paint) => paint.visible);
2884
2887
  return fills.some((paint) => fillNeedsElement(paint)) || fills.length > 0 && canvasProgressiveBlurOf(node) !== null ? fills : [];
2885
2888
  };
@@ -2932,7 +2935,7 @@ const outlineElementsOf = (node) => {
2932
2935
  /** The paint elements of a layer, in the order CSS paints a box, and whether it has any. */
2933
2936
  const canvasPaintElementPlanOf = (node) => {
2934
2937
  const fills = fillElementsOf(node);
2935
- const shadows = isBoxLayer(node) && !canvasCastsNoShadow(node) ? (node.appearance?.shadows ?? []).filter((shadow) => shadow.visible) : [];
2938
+ const shadows = isCanvasBoxLayer(node) && !canvasCastsNoShadow(node) ? (node.appearance?.shadows ?? []).filter((shadow) => shadow.visible) : [];
2936
2939
  const outer = shadows.filter((shadow) => shadow.kind === "outer" && isCanvasBlendedPaint(shadow));
2937
2940
  const inner = shadows.filter((shadow) => shadow.kind === "inner" && (fills.length > 0 || isCanvasBlendedPaint(shadow)));
2938
2941
  const underChildren = [
@@ -3626,12 +3629,12 @@ const hasSquareCorners = (node) => {
3626
3629
  return radius.topLeft === 0 && radius.topRight === 0 && radius.bottomRight === 0 && radius.bottomLeft === 0;
3627
3630
  };
3628
3631
  /** Text masks through background-clip, which shows only a layer's own fills. */
3629
- const isFillOnly = (node) => {
3632
+ const isCanvasFillOnly = (node) => {
3630
3633
  const appearance = canvasAppearanceOf(node);
3631
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);
3632
3635
  };
3633
- /** Whether text can mask the layer: an image or unrounded rectangle whose paint is fills only. */
3634
- const canCanvasTextMask = (node) => node !== void 0 && (node.component === "image" || node.component === "rectangle" && hasSquareCorners(node)) && isFillOnly(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);
3635
3638
 
3636
3639
  //#endregion
3637
3640
  //#region ../../packages/canvas-document/src/canvas-text-mask.lib.ts
@@ -4444,7 +4447,7 @@ const createEditCanvasComposite = (remote) => ({ execute: async (input) => {
4444
4447
  const parsed = applyCanvasOperationsInputSchema.safeParse({
4445
4448
  canvasId: input.canvasId,
4446
4449
  mutationId: input.mutationId,
4447
- documentFormatVersion: 13,
4450
+ documentFormatVersion: 14,
4448
4451
  baseVersion: input.baseVersion,
4449
4452
  operations: plan.operations
4450
4453
  });
@@ -4781,7 +4784,7 @@ const createWriteHtmlCanvasComposite = (remote, render) => ({ execute: async (in
4781
4784
  //#region src/application/read-canvas-reference.use-case.ts
4782
4785
  const readCanvasReferenceScene = async (remote, input) => {
4783
4786
  const reference = parseCanvasReference(input.canvas);
4784
- const held = getCanvasDocumentOutputSchema.parse(await remote.query("canvas.document.get", { canvasId: reference.canvasId }));
4787
+ const held = wholeCanvasDocumentOutputSchema.parse(await remote.query("canvas.document.get", { canvasId: reference.canvasId }));
4785
4788
  const document = canvasReadableSceneDocumentSchema.parse(held.document);
4786
4789
  if (hasCanvasReferenceScope(reference)) canvasReferenceNodeIds(reference, document);
4787
4790
  if (input.nodeId !== void 0) assertCanvasReferenceNodes(reference, document, [input.nodeId]);
@@ -4870,7 +4873,7 @@ const assertIdentity = (asset, intent) => {
4870
4873
  const createImportCanvasAssetComposite = (remote, files) => ({ execute: async (input) => {
4871
4874
  const reference = parseCanvasReference(input.canvasRef);
4872
4875
  if (hasCanvasReferenceScope(reference)) {
4873
- const held = getCanvasDocumentOutputSchema.parse(await remote.query(ASSET_PROCEDURES[2], { canvasId: reference.canvasId }));
4876
+ const held = wholeCanvasDocumentOutputSchema.parse(await remote.query(ASSET_PROCEDURES[2], { canvasId: reference.canvasId }));
4874
4877
  canvasReferenceNodeIds(reference, canvasReadableSceneDocumentSchema.parse(held.document));
4875
4878
  }
4876
4879
  const { body, ...file } = await files.read();
@@ -5850,7 +5853,7 @@ const commitPreparation = async (remote, input, job, fingerprint) => {
5850
5853
  const request = applyCanvasOperationsInputSchema.parse({
5851
5854
  canvasId: job.canvasId,
5852
5855
  mutationId: input.clientToken,
5853
- documentFormatVersion: 13,
5856
+ documentFormatVersion: 14,
5854
5857
  baseVersion: input.baseVersion,
5855
5858
  operations: job.result.operations,
5856
5859
  requestContext: {
@@ -7214,7 +7217,7 @@ const editable = (input, snapshot) => {
7214
7217
  };
7215
7218
  const createReadCanvasComposite = (remote) => ({ execute: async (input) => {
7216
7219
  const reference = parseCanvasReference(input.canvasRef);
7217
- const held = getCanvasDocumentOutputSchema.parse(await remote.query(READ_CANVAS_PROCEDURES[0], { canvasId: reference.canvasId }));
7220
+ const held = wholeCanvasDocumentOutputSchema.parse(await remote.query(READ_CANVAS_PROCEDURES[0], { canvasId: reference.canvasId }));
7218
7221
  if (input.expectedVersion !== void 0 && input.expectedVersion !== held.version) return stale(held.version);
7219
7222
  const current = canvasSceneDocumentSchema.safeParse(held.document);
7220
7223
  const scene = current.success ? current.data : canvasReadableSceneDocumentSchema.parse(held.document);
@@ -7272,7 +7275,7 @@ const createRevisionedCanvasCommandComposite = (remote) => ({ execute: async (in
7272
7275
  };
7273
7276
  const request = applyCanvasOperationsInputSchema.safeParse({
7274
7277
  canvasId,
7275
- documentFormatVersion: 13,
7278
+ documentFormatVersion: 14,
7276
7279
  mutationId: input.clientToken,
7277
7280
  baseVersion: input.baseVersion,
7278
7281
  operations,
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { M as canvasAssetImportInputSchema, N as canvasAssetImportOutputSchema, Ut as foldPrototypeArtifactPath, Xt as MCP_AUTH_SCOPE, Yt as getMeOutputSchema, b as canvasPrototypeIntentSchema, f as createCapabilityCatalogAdapter, jt as CliError, qt as prototypeArtifactPathSchema, x as canvasPrototypeOutputSchema } from "./cli-output-identity.lib-DgHRuXTI.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-BWkNj5jp.mjs";
4
- import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-CjZnnMCd.mjs";
5
- import { a as createMcpResultAdapter, o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-DOHJxL6l.mjs";
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: "Publish an uploaded static build ZIP or resume an existing deployment. 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.",
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.39",
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enhance-eng/enhance",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "private": false,
5
5
  "description": "Agent-first command-line interface for Enhance.",
6
6
  "keywords": [