@enhance-eng/enhance 0.1.33 → 0.1.38
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-CWNAXho4.mjs → cli-output-identity.lib-C3i0q8cd.mjs} +2002 -867
- package/dist/main.mjs +535 -246
- package/dist/{mcp-invocation.adapter-DHdF8-MP.mjs → mcp-invocation.adapter-taWD_Gn7.mjs} +23 -14
- package/dist/mcp-main.mjs +7 -7
- package/dist/{mcp-server.adapter-B0Kn0e7m.mjs → mcp-server.adapter-bUMHR5ct.mjs} +2 -1
- package/dist/mcp.mjs +2 -2
- package/dist/{mutation-key.adapter-A1d27TVY.mjs → mutation-key.adapter-BVKXAugo.mjs} +4103 -145
- package/dist/remote-mcp-main.mjs +5 -5
- package/package.json +7 -7
|
@@ -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, 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,
|
|
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 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-C3i0q8cd.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-BVKXAugo.mjs";
|
|
4
|
+
import { a as createMcpResultAdapter, i as mcpDispatchedResultSchema, n as createMcpWorkflowsAdapter, o as createMcpClientContextAdapter, r as createMcpClientInvocationAdapter } from "./mcp-server.adapter-bUMHR5ct.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
7
7
|
|
|
@@ -10,8 +10,8 @@ const CANVAS_HTML_EXAMPLES = {
|
|
|
10
10
|
retained: "<div data-enhance-id=\"frame\" data-enhance-name=\"Settings\" style=\"width:360px\"><span data-enhance-id=\"title\" data-enhance-name=\"Title\" style=\"font-size:24px\">Account settings</span><div data-enhance-id=\"reference\" data-enhance-name=\"Reference\" data-enhance-opaque=\"true\"></div></div>",
|
|
11
11
|
mixed: "<div data-enhance-id=\"frame\" data-enhance-name=\"Settings\" style=\"width:360px\"><span data-enhance-id=\"title\" data-enhance-name=\"Title\" style=\"font-size:24px\">Your account</span><div style=\"width:320px;height:64px;padding:16px;background:#f4f4f5\"><span style=\"font-size:16px\">Your changes are saved.</span></div><div data-enhance-id=\"reference\" data-enhance-name=\"Reference\" data-enhance-opaque=\"true\"></div></div>"
|
|
12
12
|
};
|
|
13
|
-
const CANVAS_HTML_REFERENCE_URI = "enhance://canvas/html/
|
|
14
|
-
const CANVAS_HTML_REFERENCE = `# Canvas HTML exchange, version
|
|
13
|
+
const CANVAS_HTML_REFERENCE_URI = "enhance://canvas/html/2";
|
|
14
|
+
const CANVAS_HTML_REFERENCE = `# Canvas HTML exchange, version 2
|
|
15
15
|
|
|
16
16
|
This reference describes the canvas MCP HTML exchange. It is generated from the runtime's checked source and is also available as the MCP resource ${CANVAS_HTML_REFERENCE_URI}. Tool schemas remain authoritative for arguments and returned outcomes. The broader CLI has its own command help.
|
|
17
17
|
|
|
@@ -19,9 +19,11 @@ This reference describes the canvas MCP HTML exchange. It is generated from the
|
|
|
19
19
|
|
|
20
20
|
Preserve the complete canvas, page or selection reference. Use canvas_read with its editable view and an explicit existing root. An editable read is complete or fails with a narrower-scope remedy; an outline is a different, paginated view. The returned snapshot token binds the scope and observed revision. Submit that exact token and reference with the complete edited root.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Each layer's element carries the CSS the editor paints for it: its fills, border, radius, shadows, filters, background blur, opacity, blend and isolation, under the CSS authored on it. Frames, groups, rectangles, ellipses, images and the root are div elements. An image's source is its background-image, painted once; a written background-image URL, background-size (100% 100%, cover, contain or auto) or background-position changes its source, fit or position. Vectors, polygons, stars and Boolean groups are an svg element holding one path, whose d, fill-rule and fill are the layer's path and its one solid fill. Text is a span; rich text holds one span per run, each marked with data-enhance-run and its place, and carrying that run's CSS. Each retained element keeps data-enhance-id and data-enhance-name. These IDs identify existing objects; never invent, duplicate or copy them into a new object. You may edit the name. Preserve the original root identity.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
A border or outline that the editor draws on its own element appears as a child element with data-enhance-paint="border" or "outline" and that element's CSS; the layer's own element then has none of that CSS. On that element you may change mix-blend-mode, the blend of its one paint, and, for a dashed stroke, the stroke-dasharray and stroke-linecap inside its mask-image, which set the dash pattern and cap; the rest of it follows the border or outline. A fill or shadow that blends, and the other fills of its layer, appear as child elements with data-enhance-paint set to that paint's ID; on such an element you may change only mix-blend-mode, which sets that paint's blend. A value that is not a paint blend mode, or an ID that is not one of the layer's paints, is refused. A fill drawn as CSS on the layer has no paint element: set its blend with the appearance operation; mix-blend-mode on a layer's own element is the layer blend. Isolation isolate on any layer, a frame or a shape, is its Normal setting, which keeps its paints' blends inside it; without isolation it is Pass through. A frame that clips its content is one element: write its layout, gap, padding and overflow on it, and its children are inside it. A mask group's element carries the CSS mask made from its mask source (an alpha, luminance or outline mask); the mask source stays a child.
|
|
25
|
+
|
|
26
|
+
Locked layers are read with their CSS and data-enhance-locked="true"; every change to them is refused. Screens, recordings and prototypes are sealed: empty opaque placeholders with data-enhance-opaque="true", their pixels coming from a recorded page, a recording or a running build. Layer kinds without an HTML form yet are sealed the same way. The read gives each sealed layer's reason in sealedReasons. Keep opaque placeholders unchanged, including their identity and name. Their hidden descendants are not missing content. The native structural tools remain responsible for moves, duplication and removal, including lock and scope checks.
|
|
25
27
|
|
|
26
28
|
Example returned root (illustrative IDs; use the actual returned IDs):
|
|
27
29
|
|
|
@@ -31,7 +33,9 @@ ${CANVAS_HTML_EXAMPLES.retained}
|
|
|
31
33
|
|
|
32
34
|
## Edit existing content and add new content
|
|
33
35
|
|
|
34
|
-
Retained elements accept only data-enhance-id, data-enhance-name, data-enhance-opaque and style. Use ordinary inline CSS declarations, with no duplicate property, !important or at-rule. Keep unrelated
|
|
36
|
+
Retained elements accept only data-enhance-id, data-enhance-name, data-enhance-opaque, data-enhance-locked and style; an svg element also keeps its viewBox and preserveAspectRatio. Use ordinary inline CSS declarations, with no duplicate property, !important or at-rule. Keep unrelated CSS unchanged; only what you change is written.
|
|
37
|
+
|
|
38
|
+
Writing a CSS property that a native setting paints replaces that setting: the setting is cleared and the layer keeps your CSS. Writing a mask group's mask CSS makes it an ordinary group with that CSS, and its former mask source paints as an ordinary child. Writing a path's d makes the layer a vector with that path; a Boolean group gives up its operands. A run span's words, color and CSS change only that run; a run has no blend of its own, so set mix-blend-mode on the text layer. On a paint element only mix-blend-mode changes, as that paint's blend; change the rest through the layer's border or outline CSS.
|
|
35
39
|
|
|
36
40
|
Add a populated new subtree without retained identity or opaque markers. New content goes through the same safe HTML compiler as canvas_insert_html, receives fresh identities. Prefer concrete inline CSS and explicit dimensions for each meaningful group. Do not include scripts, event handlers, embedded executable documents or executable URLs. Available content becomes editable even when fidelity is incomplete. Available assets are retained; unavailable assets do not prevent insertion. Importing an asset does not place it.
|
|
37
41
|
|
|
@@ -41,7 +45,7 @@ Example complete update changing the title and adding a notice:
|
|
|
41
45
|
${CANVAS_HTML_EXAMPLES.mixed}
|
|
42
46
|
\`\`\`
|
|
43
47
|
|
|
44
|
-
A new subtree cannot contain retained IDs or opaque placeholders
|
|
48
|
+
A new subtree cannot contain retained IDs or opaque placeholders. Insert a container and use canvas_arrange to move retained objects into it. New fragments are compiled independently; do not rely on inherited parent measurements or styles. Use explicit child dimensions and styles, then inspect the committed rendering. For a separate screen, prefer canvas_insert_html at an explicit parent and observed baseVersion.
|
|
45
49
|
|
|
46
50
|
## Deletion, commitment and recovery
|
|
47
51
|
|
|
@@ -87,7 +91,7 @@ const registerRemoval = (server, invoke) => {
|
|
|
87
91
|
const registerExchange = (server, invoke, isReadOnly) => {
|
|
88
92
|
server.registerTool("canvas_read", {
|
|
89
93
|
title: "Read canvas content",
|
|
90
|
-
description: "Always set view. To inspect object IDs and hierarchy, use view=\"outline\" (optional rootNodeIds, depth, limit, cursor). To change existing text or styles, use view=\"editable\" with rootNodeId; it returns complete HTML and a snapshotToken for canvas_update_html. Use view=\"resources\" only for image/font inventory (limit, cursor); use view=\"source\" with nodeId for source metadata and optional transcript. Preserve the full canvas selection URL. Editable HTML retains IDs and
|
|
94
|
+
description: "Always set view. To inspect object IDs and hierarchy, use view=\"outline\" (optional rootNodeIds, depth, limit, cursor). To change existing text or styles, use view=\"editable\" with rootNodeId; it returns complete HTML and a snapshotToken for canvas_update_html. Use view=\"resources\" only for image/font inventory (limit, cursor); use view=\"source\" with nodeId for source metadata and optional transcript. Preserve the full canvas selection URL. Editable HTML carries the CSS the editor paints, retains IDs, marks locked layers and paint elements, and gives each sealed placeholder's reason; reference: enhance://canvas/html/2. Cursors bind scope and revision; omitted evidence is explicit. Use canvas_render to inspect pixels.",
|
|
91
95
|
inputSchema: canvasReadInputSchema,
|
|
92
96
|
outputSchema: canvasReadOutputSchema,
|
|
93
97
|
annotations: READ_ANNOTATIONS
|
|
@@ -95,7 +99,7 @@ const registerExchange = (server, invoke, isReadOnly) => {
|
|
|
95
99
|
if (isReadOnly) return;
|
|
96
100
|
server.registerTool("canvas_update_html", {
|
|
97
101
|
title: "Update editable canvas content",
|
|
98
|
-
description: "Submit the complete HTML from canvas_read with its original snapshotToken and canvasRef. Preserve retained IDs and opaque placeholders. Add populated new subtrees without identity markers and with explicit dimensions/styles. Retained
|
|
102
|
+
description: "Submit the complete HTML from canvas_read with its original snapshotToken and canvasRef. Preserve retained IDs and opaque placeholders. Add populated new subtrees without identity markers and with explicit dimensions/styles. Retained elements allow only identity, name, opaque, locked and style attributes (svg also viewBox). Writing CSS that a native setting paints replaces that setting; writing a mask group's mask CSS removes the mask. Keep opaque and locked elements unchanged. New wrappers cannot contain retained IDs; use canvas_arrange. Reference: enhance://canvas/html/2. Declare deliberate omitted subtrees in removeNodeIds. A no-op creates no revision. Retry an uncertain result with identical arguments and clientToken; a changed canvas requires a new read and deliberate replan.",
|
|
99
103
|
inputSchema: canvasUpdateHtmlInputSchema,
|
|
100
104
|
outputSchema: canvasPreparationOutputSchema,
|
|
101
105
|
annotations: {
|
|
@@ -140,8 +144,8 @@ const registerConversion = (server, invoke) => {
|
|
|
140
144
|
}, async ({ clientToken, ...args }, context) => clientContext$9.run(context, async () => delivered$1(canvasConversionStatusSchema, async () => invoke("canvas.makeEditable", args, clientToken))));
|
|
141
145
|
};
|
|
142
146
|
const createMcpCanvasContentAdapter = (invoke, isReadOnly) => ({ register: (server) => {
|
|
143
|
-
server.registerResource("canvas-html-
|
|
144
|
-
title: "Canvas HTML exchange, version
|
|
147
|
+
server.registerResource("canvas-html-v2", CANVAS_HTML_REFERENCE_URI, {
|
|
148
|
+
title: "Canvas HTML exchange, version 2",
|
|
145
149
|
description: "Retained identity, inline CSS, new subtrees, removal and retry rules with checked examples.",
|
|
146
150
|
mimeType: "text/markdown"
|
|
147
151
|
}, (uri) => ({ contents: [{
|
|
@@ -608,6 +612,7 @@ const projectFeedbackMessage = (message, start, end) => ({
|
|
|
608
612
|
tokenLabel: message.author.tokenLabel
|
|
609
613
|
},
|
|
610
614
|
body: message.body.slice(start, end),
|
|
615
|
+
isDeleted: message.isDeleted,
|
|
611
616
|
createdAt: message.createdAt,
|
|
612
617
|
editedAt: message.editedAt,
|
|
613
618
|
mentionedPersonIds: message.mentions.map((mention) => mention.personId),
|
|
@@ -1064,7 +1069,11 @@ const createMcpFeedbackAdapter = (invoke, isReadOnly = false) => ({ register: (s
|
|
|
1064
1069
|
const clientContext$3 = createMcpClientContextAdapter();
|
|
1065
1070
|
const deliverStatus = async (server, offered) => {
|
|
1066
1071
|
const image = operationStatusImageSchema.safeParse(offered);
|
|
1067
|
-
const
|
|
1072
|
+
const status = operationStatusOutputSchema.parse(image.success ? image.data.status : offered);
|
|
1073
|
+
const result = image.success && status.kind === "canvas-render" ? {
|
|
1074
|
+
...status,
|
|
1075
|
+
...image.data.localImage.source !== void 0 && { source: image.data.localImage.source }
|
|
1076
|
+
} : status;
|
|
1068
1077
|
const images = (image.success ? await createMcpResultAdapter("Reconnect Enhance.").success(server, image.data.localImage, "embedded") : null)?.content.filter((entry) => entry.type === "image") ?? [];
|
|
1069
1078
|
const response = createMcpResultAdapter("Reconnect Enhance.").structured(result.kind === "canvas-render" && images.length > 0 ? {
|
|
1070
1079
|
...result,
|
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-
|
|
3
|
-
import { i as readLocalMcpEnvironment } from "./mutation-key.adapter-
|
|
2
|
+
import { f as createCapabilityCatalogAdapter, h as toCapabilityDefinition } from "./cli-output-identity.lib-C3i0q8cd.mjs";
|
|
3
|
+
import { i as readLocalMcpEnvironment } from "./mutation-key.adapter-BVKXAugo.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-taWD_Gn7.mjs";
|
|
6
|
+
import { o as createMcpClientContextAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-bUMHR5ct.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.38" });
|
|
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.38",
|
|
181
181
|
invocation,
|
|
182
182
|
clientMetadata: client.metadata,
|
|
183
183
|
catalog
|
|
184
184
|
}) : createMcpServerAdapter({
|
|
185
|
-
version: "0.1.
|
|
185
|
+
version: "0.1.38",
|
|
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 { 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-C3i0q8cd.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -148,6 +148,7 @@ const createMcpRenderBatchResultAdapter = async (server, presented, delivery) =>
|
|
|
148
148
|
pixelsDelivered: false,
|
|
149
149
|
outcome: {
|
|
150
150
|
state: "delivery_unavailable",
|
|
151
|
+
...render.data.source !== void 0 && { source: render.data.source },
|
|
151
152
|
operation: {
|
|
152
153
|
kind: "canvas-render",
|
|
153
154
|
canvasId: render.data.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-
|
|
2
|
+
import { f as createCapabilityCatalogAdapter, l as toSharedCapabilities } from "./cli-output-identity.lib-C3i0q8cd.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-bUMHR5ct.mjs";
|
|
5
5
|
|
|
6
6
|
export { createCapabilityCatalogAdapter, createMcpServerAdapter as createEnhanceMcpServer, toCapabilityInventory, toSharedCapabilities };
|