@enhance-eng/enhance 0.1.171 → 0.1.174
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-BsDqFLVA.mjs → cli-output-identity.lib-BgqE7RXo.mjs} +92 -55
- package/dist/main.mjs +22 -7
- package/dist/{mcp-invocation.adapter-DGgt79VT.mjs → mcp-invocation.adapter-Cq2xp41d.mjs} +48 -41
- package/dist/mcp-main.mjs +7 -7
- package/dist/{mcp-server.adapter-CbObvH7Y.mjs → mcp-server.adapter-VC6efIcJ.mjs} +121 -27
- package/dist/mcp.mjs +2 -2
- package/dist/remote-mcp-main.mjs +10 -13
- package/dist/{zod-messages.lib-B8yowT7b.mjs → zod-messages.lib-25kXQXyA.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1083,10 +1083,15 @@ const canvasScrollbarGutterSchema = z.object({
|
|
|
1083
1083
|
bottom: nonNegativeCanvasNumberSchema.optional(),
|
|
1084
1084
|
left: nonNegativeCanvasNumberSchema.optional()
|
|
1085
1085
|
}).strict();
|
|
1086
|
-
/**
|
|
1086
|
+
/**
|
|
1087
|
+
* A percentage of the containing block plus pixels; unlike a size limit, either may be negative.
|
|
1088
|
+
* The position may be held between pixel bounds, as a browser holds a scroll inside its range.
|
|
1089
|
+
*/
|
|
1087
1090
|
const canvasParentRelativeCoordinateSchema = z.object({
|
|
1088
1091
|
ratio: canvasNumberSchema,
|
|
1089
|
-
offset: canvasNumberSchema.optional()
|
|
1092
|
+
offset: canvasNumberSchema.optional(),
|
|
1093
|
+
min: canvasNumberSchema.optional(),
|
|
1094
|
+
max: canvasNumberSchema.optional()
|
|
1090
1095
|
}).strict();
|
|
1091
1096
|
const canvasPositionParentSchema = z.object({
|
|
1092
1097
|
x: canvasParentRelativeCoordinateSchema.optional(),
|
|
@@ -3417,6 +3422,7 @@ const CANVAS_RICH_TEXT_STYLE_PROPERTIES = /* @__PURE__ */ new Set([
|
|
|
3417
3422
|
"flexDirection",
|
|
3418
3423
|
"fontFamily",
|
|
3419
3424
|
"fontFeatureSettings",
|
|
3425
|
+
"fontLanguageOverride",
|
|
3420
3426
|
"fontOpticalSizing",
|
|
3421
3427
|
"fontSize",
|
|
3422
3428
|
"fontStretch",
|
|
@@ -4250,12 +4256,22 @@ const CANVAS_FIRST_LETTER_PROPERTIES = {
|
|
|
4250
4256
|
"font-stretch",
|
|
4251
4257
|
"font-style",
|
|
4252
4258
|
"font-weight",
|
|
4259
|
+
"font-variant-alternates",
|
|
4253
4260
|
"font-variant-caps",
|
|
4261
|
+
"font-variant-east-asian",
|
|
4262
|
+
"font-variant-emoji",
|
|
4254
4263
|
"font-variant-ligatures",
|
|
4255
4264
|
"font-variant-numeric",
|
|
4265
|
+
"font-variant-position",
|
|
4256
4266
|
"font-feature-settings",
|
|
4257
4267
|
"font-variation-settings",
|
|
4268
|
+
"font-optical-sizing",
|
|
4269
|
+
"font-size-adjust",
|
|
4258
4270
|
"font-kerning",
|
|
4271
|
+
"font-language-override",
|
|
4272
|
+
"font-synthesis-weight",
|
|
4273
|
+
"font-synthesis-style",
|
|
4274
|
+
"font-synthesis-small-caps",
|
|
4259
4275
|
"letter-spacing",
|
|
4260
4276
|
"line-height",
|
|
4261
4277
|
"text-shadow",
|
|
@@ -10775,6 +10791,8 @@ const SKILL_NAMES = [
|
|
|
10775
10791
|
"respond-to-feedback",
|
|
10776
10792
|
"apply-canvas-design"
|
|
10777
10793
|
];
|
|
10794
|
+
/** A line named a capability the server cannot reach, so the line is left out. */
|
|
10795
|
+
var Unreachable = class extends Error {};
|
|
10778
10796
|
/** A skill's name could not be written for a surface: the surface has no name for a capability. */
|
|
10779
10797
|
var SkillTextError = class extends Error {
|
|
10780
10798
|
constructor(skill, capability, surface) {
|
|
@@ -10782,19 +10800,56 @@ var SkillTextError = class extends Error {
|
|
|
10782
10800
|
this.name = "SkillTextError";
|
|
10783
10801
|
}
|
|
10784
10802
|
};
|
|
10803
|
+
const upper = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
|
|
10804
|
+
/** The text, or undefined when it names a capability the server cannot reach. */
|
|
10805
|
+
const whenReached = (text) => {
|
|
10806
|
+
try {
|
|
10807
|
+
return text();
|
|
10808
|
+
} catch (error) {
|
|
10809
|
+
if (error instanceof Unreachable) return void 0;
|
|
10810
|
+
throw error;
|
|
10811
|
+
}
|
|
10812
|
+
};
|
|
10813
|
+
/** A list line, or nothing when it names a capability the server cannot reach. */
|
|
10814
|
+
const lineOf = (text) => {
|
|
10815
|
+
const held = whenReached(text);
|
|
10816
|
+
return held === void 0 ? "" : `- ${held}\n`;
|
|
10817
|
+
};
|
|
10785
10818
|
const wordsOf = (skill, wording) => {
|
|
10786
|
-
const
|
|
10819
|
+
const reached = (capability) => {
|
|
10820
|
+
const reach = wording.surface === "mcp" ? wording.reach?.(capability) : void 0;
|
|
10821
|
+
if (reach?.kind === "none") throw new Unreachable(capability);
|
|
10822
|
+
if (reach !== void 0) return reach;
|
|
10787
10823
|
const name = wording.nameOf(capability);
|
|
10788
10824
|
if (name === void 0) throw new SkillTextError(skill, capability, wording.surface);
|
|
10789
|
-
return
|
|
10825
|
+
return {
|
|
10826
|
+
kind: "tool",
|
|
10827
|
+
tool: wording.surface === "cli" ? `${wording.command} ${name}` : name
|
|
10828
|
+
};
|
|
10829
|
+
};
|
|
10830
|
+
const teacher = (capability) => {
|
|
10831
|
+
const reach = reached(capability);
|
|
10832
|
+
if (reach.kind === "through") return `\`${reach.describe}\` with \`${reach.capability}\``;
|
|
10833
|
+
return wording.surface === "cli" ? `\`${reach.tool} --help\`` : `the description of \`${reach.tool}\``;
|
|
10834
|
+
};
|
|
10835
|
+
const toolOf = (capability) => {
|
|
10836
|
+
const reach = reached(capability);
|
|
10837
|
+
return wording.surface === "mcp" && reach.kind === "tool" ? reach.tool : void 0;
|
|
10790
10838
|
};
|
|
10791
|
-
const isTool = wording.surface === "cli";
|
|
10792
10839
|
return {
|
|
10793
|
-
call: (capability) =>
|
|
10840
|
+
call: (capability) => {
|
|
10841
|
+
const reach = reached(capability);
|
|
10842
|
+
return reach.kind === "tool" ? `\`${reach.tool}\`` : `\`${reach.tool}\` with \`${reach.capability}\``;
|
|
10843
|
+
},
|
|
10794
10844
|
two: (words) => words[wording.surface],
|
|
10795
|
-
learn: (capability, what) =>
|
|
10796
|
-
learnBoth: (first, second, what) =>
|
|
10797
|
-
|
|
10845
|
+
learn: (capability, what) => `${upper(teacher(capability))} shows how to ${what}.`,
|
|
10846
|
+
learnBoth: (first, second, what) => {
|
|
10847
|
+
const [one, other] = [toolOf(first), toolOf(second)];
|
|
10848
|
+
if (one === void 0 || other === void 0) return `${upper(teacher(first))} and ${teacher(second)} show how to ${what}.`;
|
|
10849
|
+
return one === other ? `The description of \`${one}\` shows how to ${what}.` : `The descriptions of \`${one}\` and \`${other}\` show how to ${what}.`;
|
|
10850
|
+
},
|
|
10851
|
+
command: wording.surface === "cli" ? wording.command : "",
|
|
10852
|
+
line: lineOf
|
|
10798
10853
|
};
|
|
10799
10854
|
};
|
|
10800
10855
|
/**
|
|
@@ -10895,8 +10950,9 @@ ${DESIGN_RULES.finish} Then give the canvas link. ${DESIGN_RULES.ids}
|
|
|
10895
10950
|
const SKILLS = {
|
|
10896
10951
|
capture: {
|
|
10897
10952
|
job: "capturing screens",
|
|
10953
|
+
main: "canvas.capturePage",
|
|
10898
10954
|
description: "Put the screens a thread is changing onto an Enhance canvas as editable frames and return the link. Use when asked to capture, share or review screens, or to put work on a canvas. Also applies whenever a thread has changed how a screen looks: when that work is done, offer once, in one line, to put the changed screens on an Enhance canvas for review, and capture only on a yes.",
|
|
10899
|
-
body: ({ call, two, command }) => `# Capture screens to Enhance
|
|
10955
|
+
body: ({ call, two, command, line }) => `# Capture screens to Enhance
|
|
10900
10956
|
|
|
10901
10957
|
Put each screen this thread is changing onto one Enhance canvas as an editable frame, and return the canvas link.
|
|
10902
10958
|
|
|
@@ -10908,75 +10964,57 @@ ${two({
|
|
|
10908
10964
|
- \`${command} auth status\` says who is signed in. If nobody is, ask the person to run \`${command} setup\`.`,
|
|
10909
10965
|
mcp: `## Tools
|
|
10910
10966
|
|
|
10911
|
-
|
|
10912
|
-
- ${call("canvas.capturePage")} puts one page on the canvas. Its description gives the two calls one capture takes. Read it before the first capture.
|
|
10913
|
-
- ${call("auth.status")} says who is signed in. If nobody is, call ${call("auth.login")}.`
|
|
10967
|
+
${line(() => `${call("canvas.create")} with a \`title\` of what this thread is changing makes the canvas and answers with its id and its link.`)}${line(() => `${call("canvas.capturePage")} puts one page on the canvas. Its description gives the two calls one capture takes. Read it before the first capture.`)}${line(() => `${call("auth.status")} says who is signed in. If nobody is, call ${call("auth.login")}.`)}`.trimEnd()
|
|
10914
10968
|
})}
|
|
10915
10969
|
`
|
|
10916
10970
|
},
|
|
10917
10971
|
"design-on-canvas": {
|
|
10918
10972
|
job: "designing on a canvas",
|
|
10973
|
+
main: "canvas.insertHtml",
|
|
10919
10974
|
description: "Create or revise editable product designs on an Enhance canvas using the product's real screens, components, tokens, and visual language. Use for mocks, screen exploration, and canvas design iteration.",
|
|
10920
10975
|
body: (words) => {
|
|
10921
|
-
const { call, two, learn } = words;
|
|
10976
|
+
const { call, two, learn, line } = words;
|
|
10922
10977
|
return `# Design on the canvas
|
|
10923
10978
|
|
|
10924
10979
|
Create or change editable screens on an Enhance canvas, look at what you made, and give the canvas link.
|
|
10925
10980
|
|
|
10926
10981
|
${listHeading(words)}
|
|
10927
10982
|
|
|
10928
|
-
|
|
10983
|
+
${line(() => `${two({
|
|
10929
10984
|
cli: `\`${words.command} canvas create --title "<what this is>"\``,
|
|
10930
10985
|
mcp: `${call("canvas.create")} with a \`title\``
|
|
10931
|
-
})} makes a canvas and answers with its id and its link.
|
|
10932
|
-
|
|
10933
|
-
- ${learn("canvas.insertHtml", "add a screen as HTML, with an example")} Read it before the first insert.
|
|
10934
|
-
- Give a new top-level screen \`"placement": {"kind": "auto"}\` so Enhance puts it in free space, unless the person gave coordinates. Place the next screen of a sequence with \`{"kind": "near", "anchorNodeId": "<the previous screen's id from its answer>", "side": "right"}\`.
|
|
10935
|
-
- ${learn("canvas.edit", "change text, styles, names and order on layers that are already there, and copy a layer, many in one call")} Use it for any change to existing work.
|
|
10936
|
-
- ${learn("canvas.updateHtml", "rebuild the inside of a layer")} Use it only when the structure itself changes.
|
|
10937
|
-
- ${learn("canvas.importAsset", "bring in an image or a font")}
|
|
10938
|
-
- ${learn("canvas.render", "get a picture of a screen")}
|
|
10939
|
-
- ${learn("canvas.finishWorkingOnNodes", "say that you have finished, so your mark leaves the canvas")}
|
|
10940
|
-
|
|
10986
|
+
})} makes a canvas and answers with its id and its link.`)}${line(() => learn("canvas.read", "read what a canvas holds: its outline, or one screen as HTML"))}${line(() => `${learn("canvas.insertHtml", "add a screen as HTML, with an example")} Read it before the first insert.`)}- Give a new top-level screen \`"placement": {"kind": "auto"}\` so Enhance puts it in free space, unless the person gave coordinates. Place the next screen of a sequence with \`{"kind": "near", "anchorNodeId": "<the previous screen's id from its answer>", "side": "right"}\`.
|
|
10987
|
+
${line(() => `${learn("canvas.edit", "change text, styles, names and order on layers that are already there, and copy a layer, many in one call")} Use it for any change to existing work.`)}${line(() => `${learn("canvas.updateHtml", "rebuild the inside of a layer")} Use it only when the structure itself changes.`)}${line(() => learn("canvas.importAsset", "bring in an image or a font"))}${line(() => learn("canvas.render", "get a picture of a screen"))}${line(() => learn("canvas.finishWorkingOnNodes", "say that you have finished, so your mark leaves the canvas"))}
|
|
10941
10988
|
${designSections(words)}`;
|
|
10942
10989
|
}
|
|
10943
10990
|
},
|
|
10944
10991
|
"publish-prototype": {
|
|
10945
10992
|
job: "publishing a prototype",
|
|
10993
|
+
main: "prototype.publish",
|
|
10946
10994
|
description: "Publish a selected product build to an Enhance canvas and visually verify its prototype. Use for publishing, attaching, refreshing or validating a local build folder or an authorized uploaded build artifact.",
|
|
10947
|
-
body: (
|
|
10948
|
-
const { learn } = words;
|
|
10949
|
-
return `# Publish a prototype
|
|
10995
|
+
body: ({ learn, line, two }) => `# Publish a prototype
|
|
10950
10996
|
|
|
10951
10997
|
Publish a built site to an Enhance canvas as a prototype people can click through, and give the canvas link.
|
|
10952
10998
|
|
|
10953
|
-
${listHeading(
|
|
10999
|
+
${listHeading({ two })}
|
|
10954
11000
|
|
|
10955
|
-
|
|
10956
|
-
- ${learn("canvas.read", "read what the canvas holds, including a prototype already on it")}
|
|
10957
|
-
`;
|
|
10958
|
-
}
|
|
11001
|
+
${line(() => `${learn("prototype.publish", "publish a build folder to a canvas, and how to update a prototype that is already there")} Read it before the first publish.`)}${line(() => learn("canvas.read", "read what the canvas holds, including a prototype already on it"))}`
|
|
10959
11002
|
},
|
|
10960
11003
|
"respond-to-feedback": {
|
|
10961
11004
|
job: "responding to feedback",
|
|
11005
|
+
main: "comment.reply",
|
|
10962
11006
|
description: "Act on clear Enhance canvas and prototype feedback, implement the underlying change, republish when needed, and verify the result. Use when a user asks to address, resolve, or work through review comments.",
|
|
10963
|
-
body: (
|
|
10964
|
-
const { learn, learnBoth } = words;
|
|
10965
|
-
return `# Respond to feedback
|
|
11007
|
+
body: ({ learn, learnBoth, line, two }) => `# Respond to feedback
|
|
10966
11008
|
|
|
10967
11009
|
Do what each clear review comment on an Enhance canvas asks, on the canvas or in the source its prototype was published from. Reply to and resolve the ones you finished, and leave open the ones you could not act on.
|
|
10968
11010
|
|
|
10969
|
-
${listHeading(
|
|
11011
|
+
${listHeading({ two })}
|
|
10970
11012
|
|
|
10971
|
-
|
|
10972
|
-
- ${learnBoth("comment.reply", "comment.resolve", "answer a thread and resolve it")}
|
|
10973
|
-
- ${learnBoth("canvas.read", "canvas.updateHtml", "read a screen and change it")}
|
|
10974
|
-
- ${learn("prototype.publish", "update a prototype from changed source")}
|
|
10975
|
-
`;
|
|
10976
|
-
}
|
|
11013
|
+
${line(() => learn("comment.list", "read the comment threads on a canvas"))}${line(() => learnBoth("comment.reply", "comment.resolve", "answer a thread and resolve it"))}${line(() => learnBoth("canvas.read", "canvas.updateHtml", "read a screen and change it"))}${line(() => learn("prototype.publish", "update a prototype from changed source"))}`
|
|
10977
11014
|
},
|
|
10978
11015
|
"apply-canvas-design": {
|
|
10979
11016
|
job: "applying a canvas design",
|
|
11017
|
+
main: "canvas.read",
|
|
10980
11018
|
description: "Implement an approved or edited Enhance canvas design in the owning product source, republish it, and verify source-to-design fidelity. Use for canvas-to-code or canvas-to-prototype handoff.",
|
|
10981
11019
|
body: (words) => `# Apply a canvas design
|
|
10982
11020
|
|
|
@@ -10984,30 +11022,29 @@ Make the product's source match an approved design on an Enhance canvas, then up
|
|
|
10984
11022
|
|
|
10985
11023
|
${listHeading(words)}
|
|
10986
11024
|
|
|
10987
|
-
|
|
10988
|
-
- ${words.learn("canvas.render", "get a picture of a screen")}
|
|
10989
|
-
- ${words.learn("prototype.publish", "update the prototype that is already on the canvas")} Read it before publishing.
|
|
10990
|
-
`
|
|
11025
|
+
${words.line(() => `${words.learn("canvas.read", "read the design: the canvas's outline, or one screen as HTML")} ${DESIGN_RULES.code}`)}${words.line(() => words.learn("canvas.render", "get a picture of a screen"))}${words.line(() => `${words.learn("prototype.publish", "update the prototype that is already on the canvas")} Read it before publishing.`)}`
|
|
10991
11026
|
}
|
|
10992
11027
|
};
|
|
10993
11028
|
/**
|
|
10994
11029
|
* Every skill, written for one surface. The tool's are named after its command, so the production
|
|
10995
11030
|
* and development tools never overwrite one another's; the plugin's host names them itself.
|
|
10996
11031
|
*/
|
|
10997
|
-
const skillTextsFor = (wording) => SKILL_NAMES.
|
|
10998
|
-
const { body: write, description } = SKILLS[skill];
|
|
11032
|
+
const skillTextsFor = (wording) => SKILL_NAMES.flatMap((skill) => {
|
|
11033
|
+
const { body: write, description, main } = SKILLS[skill];
|
|
10999
11034
|
const name = wording.surface === "cli" ? `${wording.commandName}-${skill}` : skill;
|
|
11000
|
-
const
|
|
11001
|
-
|
|
11035
|
+
const words = wordsOf(skill, wording);
|
|
11036
|
+
const body = whenReached(() => words.call(main) === "" ? "" : write(words));
|
|
11037
|
+
if (body === void 0) return [];
|
|
11038
|
+
return [{
|
|
11002
11039
|
skill,
|
|
11003
11040
|
name,
|
|
11004
11041
|
description,
|
|
11005
11042
|
body,
|
|
11006
11043
|
text: `---\nname: ${name}\ndescription: ${description}\n---\n\n${body}`
|
|
11007
|
-
};
|
|
11044
|
+
}];
|
|
11008
11045
|
});
|
|
11009
|
-
/** The job
|
|
11010
|
-
const
|
|
11046
|
+
/** The job a skill is for, for the sentence that lists the skills a server offers. */
|
|
11047
|
+
const jobOf = (skill) => SKILLS[skill].job;
|
|
11011
11048
|
|
|
11012
11049
|
//#endregion
|
|
11013
11050
|
//#region src/application/design-guidance.use-case.ts
|
|
@@ -20636,4 +20673,4 @@ const withCommandInFailure = (value, commandName) => ({
|
|
|
20636
20673
|
});
|
|
20637
20674
|
|
|
20638
20675
|
//#endregion
|
|
20639
|
-
export { canvasWriteReceiptSchema as $, listCommentsOutputSchema as $n, reserveCanvasAssetOutputSchema as $r, callingSurface as $t, commentAttentionCapabilityInputSchema as A, endCanvasActivityOutputSchema as Ai, foldPrototypeArtifactPath as An, IMAGE_KIND as Ar, quotedValue as At, canvasPrototypeOutputSchema as B, createOrganisationOutputSchema as Bn, canvasBoxSourceOf as Br, encodeCanvasExchangeToken as Bt, OPTION_DESCRIPTIONS as C, emptyCanvasSceneDocument as Ci, appendRecordingChunkOutputSchema as Cn, canvasAgentActivityPhaseSchema as Cr, canvasEditCapabilityInputSchema as Ct, canvasReadCapabilityInputSchema as D, CANVAS_BLEND_MODES as Di, PROTOTYPE_ARTIFACT_MANIFEST_PATH as Dn, getCanvasPreparationOutputSchema as Dr, inputProblemSummary as Dt, canvasApplyCapabilityInputSchema as E, canvasAdditionalStyleSchema as Ei, startRecordingOutputSchema as En, createCanvasPreparationOutputSchema as Er, inputProblemFields as Et, canvasCapturePageInputSchema as F, submitPrototypeArtifactOutputSchema as Fn, canvasLayoutWithoutCssProperties as Fr, hasCanvasReferenceScope as Ft, canvasCaptureCapabilityInputSchema as G, commentCanvasContextSchema as Gn, canvasCssPixelValue as Gr, canvasUpdateHtmlCapabilityInputSchema as Gt, operationStatusImageSchema as H, emptyFixtureDocument as Hn, canvasAuthoredLayoutValueOf as Hr, canvasOutlineCursorSchema as Ht, canvasCapturePageOutputSchema as I, getMeOutputSchema as In, textOf as Ir, parseCanvasReference as It, canvasArrangeCapabilityInputSchema as J, commentThreadSchema as Jn, canvasLayoutPriorityDeclarations as Jr, canvasTranscriptCursorSchema as Jt, canvasCaptureInputSchema as K, commentMessageSchema as Kn, canvasLayoutMainAxisOf as Kr, canvasUpdateHtmlInputSchema as Kt, canvasPrototypeCapabilityInputSchema as L, MCP_AUTH_SCOPE as Ln, mapCanvasFontSources as Lr, canvasExchangeDigest as Lt, recordingSnapshotCapabilityInputSchema as M, getPrototypePublishStatusOutputSchema as Mn, RECTANGLE_KIND as Mr, canvasReferenceNodeIds as Mt, transcriptReadCapabilityInputSchema as N, prototypeArtifactManifestSchema as Nn, SCREEN_KIND as Nr, canvasReferenceRenderTarget as Nt, canvasRenderCapabilityInputSchema as O, canvasBlendModeSchema as Oi, attachPrototypeArtifactOutputSchema as On, FRAME_KIND as Or, isInputRecord as Ot, canvasCapturePageCapabilityInputSchema as P, prototypeArtifactPathSchema as Pn, TEXT_KIND as Pr, fromCanvasReference as Pt, canvasPreparationOutputSchema as Q, listCommentsInputSchema as Qn, reserveCanvasAssetInputSchema as Qr, callOf as Qt, canvasPrototypeInputSchema as R, cliAuthConfigurationSchema as Rn, saveCanvasDocumentOutputSchema as Rr, canvasSnapshotToken as Rt, ProcessExitError as S, canvasSceneDocumentSchema as Si, createScreenOutputSchema as Sn, beginCanvasActivityOutputSchema as Sr, canvasMakeEditableInputSchema as St, PROCEDURE_DESCRIPTIONS as T, signedDownloadSchema as Ti, getRecordingOutputSchema as Tn, agentClientMetadata as Tr, ROOT_FIELD as Tt, operationStatusInputSchema as U, withFixtureScreen as Un, canvasAuthoredStyleDeclarations as Ur, canvasReadInputSchema as Ut, canvasConversionStatusSchema as V, listOrganisationsOutputSchema as Vn, canvasRecordedBoxNoteFor as Vr, resolveCanvasSnapshot as Vt, operationStatusOutputSchema as W, commentAuthorSchema as Wn, canvasAxisStyleProperties as Wr, canvasReadOutputSchema as Wt, canvasDuplicateCapabilityInputSchema as X, elementAnchorSchema as Xn, canvasCssValue as Xr, tallyCanvasWork as Xt, canvasArrangeInputSchema as Y, domLocatorSchema as Yn, canvasCssTokens as Yr, canvasResourcesCursorSchema as Yt, canvasDuplicateInputSchema as Z, getCommentOutputSchema as Zn, canvasAssetUploadOutputSchema as Zr, readStoredCanvasScene as Zt, toPublishedExitTable as _, createCanvasRenderOutputSchema as _i, CliError as _n, canvasRecordingPropsSchema as _r, createdCanvasAnswerSchema as _t, createRouterShapeAdapter as a, editCanvasOutputSchema as ai, inputName as an, screenTextCommentTargetSchema as ar, canvasRenderPendingSchema as at, CAPABILITY_UUID_EXAMPLE as b, getCanvasRenderOutputSchema as bi, appErrorSchema as bn, canvasReferencePageOf as br, canvasInsertHtmlInputSchema as bt, toKebabCase as c, getCanvasMutationOutputSchema as ci, CANVAS_EDIT_WORDS as cn, applyCanvasTypographyPatch as cr, canvasRenderRequestSchema as ct, toPresentedCapabilities as d, createCanvasConversionOutputSchema as di, pointOfUseText as dn, canvasTextPropsWithContent as dr, canvasRemoveInputSchema as dt, canvasFontAssetIdentityFromPath as ei, cliPathOf as en, replyCommentInputSchema as er, canvasAssetImportCapabilityInputSchema as et, toSharedCapabilities as f, getCanvasConversionOutputSchema as fi, startUpListFor as fn, canvasTextRunsOf as fr, canvasCreateToolInputSchema as ft, toMcpFailurePayload as g, canvasWorldBoundsSchema as gi, skillTextsFor as gn, canvasPrototypePropsSchema as gr, canvasFindOutputSchema as gt, toFailurePayload as h, canvasRenderTargetSchema as hi,
|
|
20676
|
+
export { canvasWriteReceiptSchema as $, listCommentsOutputSchema as $n, reserveCanvasAssetOutputSchema as $r, callingSurface as $t, commentAttentionCapabilityInputSchema as A, endCanvasActivityOutputSchema as Ai, foldPrototypeArtifactPath as An, IMAGE_KIND as Ar, quotedValue as At, canvasPrototypeOutputSchema as B, createOrganisationOutputSchema as Bn, canvasBoxSourceOf as Br, encodeCanvasExchangeToken as Bt, OPTION_DESCRIPTIONS as C, emptyCanvasSceneDocument as Ci, appendRecordingChunkOutputSchema as Cn, canvasAgentActivityPhaseSchema as Cr, canvasEditCapabilityInputSchema as Ct, canvasReadCapabilityInputSchema as D, CANVAS_BLEND_MODES as Di, PROTOTYPE_ARTIFACT_MANIFEST_PATH as Dn, getCanvasPreparationOutputSchema as Dr, inputProblemSummary as Dt, canvasApplyCapabilityInputSchema as E, canvasAdditionalStyleSchema as Ei, startRecordingOutputSchema as En, createCanvasPreparationOutputSchema as Er, inputProblemFields as Et, canvasCapturePageInputSchema as F, submitPrototypeArtifactOutputSchema as Fn, canvasLayoutWithoutCssProperties as Fr, hasCanvasReferenceScope as Ft, canvasCaptureCapabilityInputSchema as G, commentCanvasContextSchema as Gn, canvasCssPixelValue as Gr, canvasUpdateHtmlCapabilityInputSchema as Gt, operationStatusImageSchema as H, emptyFixtureDocument as Hn, canvasAuthoredLayoutValueOf as Hr, canvasOutlineCursorSchema as Ht, canvasCapturePageOutputSchema as I, getMeOutputSchema as In, textOf as Ir, parseCanvasReference as It, canvasArrangeCapabilityInputSchema as J, commentThreadSchema as Jn, canvasLayoutPriorityDeclarations as Jr, canvasTranscriptCursorSchema as Jt, canvasCaptureInputSchema as K, commentMessageSchema as Kn, canvasLayoutMainAxisOf as Kr, canvasUpdateHtmlInputSchema as Kt, canvasPrototypeCapabilityInputSchema as L, MCP_AUTH_SCOPE as Ln, mapCanvasFontSources as Lr, canvasExchangeDigest as Lt, recordingSnapshotCapabilityInputSchema as M, getPrototypePublishStatusOutputSchema as Mn, RECTANGLE_KIND as Mr, canvasReferenceNodeIds as Mt, transcriptReadCapabilityInputSchema as N, prototypeArtifactManifestSchema as Nn, SCREEN_KIND as Nr, canvasReferenceRenderTarget as Nt, canvasRenderCapabilityInputSchema as O, canvasBlendModeSchema as Oi, attachPrototypeArtifactOutputSchema as On, FRAME_KIND as Or, isInputRecord as Ot, canvasCapturePageCapabilityInputSchema as P, prototypeArtifactPathSchema as Pn, TEXT_KIND as Pr, fromCanvasReference as Pt, canvasPreparationOutputSchema as Q, listCommentsInputSchema as Qn, reserveCanvasAssetInputSchema as Qr, callOf as Qt, canvasPrototypeInputSchema as R, cliAuthConfigurationSchema as Rn, saveCanvasDocumentOutputSchema as Rr, canvasSnapshotToken as Rt, ProcessExitError as S, canvasSceneDocumentSchema as Si, createScreenOutputSchema as Sn, beginCanvasActivityOutputSchema as Sr, canvasMakeEditableInputSchema as St, PROCEDURE_DESCRIPTIONS as T, signedDownloadSchema as Ti, getRecordingOutputSchema as Tn, agentClientMetadata as Tr, ROOT_FIELD as Tt, operationStatusInputSchema as U, withFixtureScreen as Un, canvasAuthoredStyleDeclarations as Ur, canvasReadInputSchema as Ut, canvasConversionStatusSchema as V, listOrganisationsOutputSchema as Vn, canvasRecordedBoxNoteFor as Vr, resolveCanvasSnapshot as Vt, operationStatusOutputSchema as W, commentAuthorSchema as Wn, canvasAxisStyleProperties as Wr, canvasReadOutputSchema as Wt, canvasDuplicateCapabilityInputSchema as X, elementAnchorSchema as Xn, canvasCssValue as Xr, tallyCanvasWork as Xt, canvasArrangeInputSchema as Y, domLocatorSchema as Yn, canvasCssTokens as Yr, canvasResourcesCursorSchema as Yt, canvasDuplicateInputSchema as Z, getCommentOutputSchema as Zn, canvasAssetUploadOutputSchema as Zr, readStoredCanvasScene as Zt, toPublishedExitTable as _, createCanvasRenderOutputSchema as _i, CliError as _n, canvasRecordingPropsSchema as _r, createdCanvasAnswerSchema as _t, createRouterShapeAdapter as a, editCanvasOutputSchema as ai, inputName as an, screenTextCommentTargetSchema as ar, canvasRenderPendingSchema as at, CAPABILITY_UUID_EXAMPLE as b, getCanvasRenderOutputSchema as bi, appErrorSchema as bn, canvasReferencePageOf as br, canvasInsertHtmlInputSchema as bt, toKebabCase as c, getCanvasMutationOutputSchema as ci, CANVAS_EDIT_WORDS as cn, applyCanvasTypographyPatch as cr, canvasRenderRequestSchema as ct, toPresentedCapabilities as d, createCanvasConversionOutputSchema as di, pointOfUseText as dn, canvasTextPropsWithContent as dr, canvasRemoveInputSchema as dt, canvasFontAssetIdentityFromPath as ei, cliPathOf as en, replyCommentInputSchema as er, canvasAssetImportCapabilityInputSchema as et, toSharedCapabilities as f, getCanvasConversionOutputSchema as fi, startUpListFor as fn, canvasTextRunsOf as fr, canvasCreateToolInputSchema as ft, toMcpFailurePayload as g, canvasWorldBoundsSchema as gi, skillTextsFor as gn, canvasPrototypePropsSchema as gr, canvasFindOutputSchema as gt, toFailurePayload as h, canvasRenderTargetSchema as hi, jobOf as hn, canvasConversionMetadataSchema as hr, canvasFindInputSchema as ht, createLazyCapabilityCatalogAdapter as i, CANVAS_RICH_TEXT_STYLE_PROPERTIES as ii, inSurfaceWords as in, screenElementsCommentTargetSchema as ir, canvasRenderBatchResultSchema as it, prototypePublishCapabilityInputSchema as j, canvasSchema as ji, getPrototypeArtifactCapabilitiesOutputSchema as jn, PAGE_KIND as jr, assertCanvasReferenceNodes as jt, canvasWriteHtmlCapabilityInputSchema as k, canvasPaintSchema as ki, createPrototypeArtifactOutputSchema as kn, GROUP_KIND as kr, objectFieldNames as kt, GUIDE_TOPICS as l, canvasOperationSchema as li, PartialBatchError as ln, canvasCssTypographyOwners as lr, canvasRenderFileSchema as lt, toExitCode as m, canvasRenderStateSchema as mi, SKILL_NAMES as mn, canvasCaptureSchema as mr, canvasFindCursorSchema as mt, withCommandName as n, canvasRichTextValueOf as ni, currentNodeIdStep as nn, screenAreaCommentTargetSchema as nr, canvasAssetImportOutputSchema as nt, CAPTURE_PAGE_CALLS as o, applyCanvasOperationsInputSchema as oi, onSurface as on, startCommentInputSchema as or, canvasRenderScopedInputSchema as ot, createMcpCapabilityDiscoveryAdapter as p, canvasRenderSourceStateSchema as pi, DESIGN_RULES as pn, CAPTURE_LANDING_CONVERTING as pr, canvasCreateToolOutputSchema as pt, canvasCaptureOutputSchema as q, commentResolverSchema as qn, canvasLayoutPositionOf as qr, retryClientTokenSchema as qt, toCanvasAuthoringResult as r, hasCanvasRichTextPaints as ri, diagnosisStep as rn, screenElementCommentTargetSchema as rr, canvasRenderBatchRequestSchema as rt, toCapabilityDefinition as s, applyCanvasOperationsOutputSchema as si, MCP_TOOL_BY_CAPABILITY as sn, createCapturePassOutputSchema as sr, canvasRenderScopedToolInputSchema as st, withCommandInFailure as t, canvasRichTextOf as ti, commandName as tn, replyCommentOutputSchema as tr, canvasAssetImportInputSchema as tt, GUIDE_TOPIC_NAMES as u, canvasNodeStylePatchSchema as ui, loadGuideLineFor as un, canvasTextChangeBetween as ur, canvasRemoveCapabilityInputSchema as ut, toRemoteError as v, createRecordingSnapshotOutputSchema as vi, isFormatRefusalError as vn, captureLandingSchema as vr, listedCanvasesAnswerSchema as vt, PROTOTYPE_UPDATE_GUIDANCE as w, canvasImageAssetIdentityFromPath as wi, completeRecordingOutputSchema as wn, AGENT_CLIENT_HEADER as wr, canvasEditsSchema as wt, createCapabilityPolicyAdapter as x, canvasReadableSceneDocumentSchema as xi, completeScreenOutputSchema as xn, resolveCanvasReference as xr, canvasMakeEditableCapabilityInputSchema as xt, CANVAS_UPDATE_HTML_INPUT_EXAMPLE as y, downloadCanvasRenderOutputSchema as yi, transcriptOutputSchema as yn, DEFAULT_CANVAS_REFERENCE_PAGE_ID as yr, canvasInsertHtmlCapabilityInputSchema as yt, canvasPrototypeIntentSchema as z, createAgentTokenOutputSchema as zn, wholeCanvasDocumentOutputSchema as zr, decodeCanvasExchangeToken as zt };
|
package/dist/main.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { At as quotedValue, Bn as createOrganisationOutputSchema, C as OPTION_DESCRIPTIONS, Ci as emptyCanvasSceneDocument$1, Cn as appendRecordingChunkOutputSchema, Cr as canvasAgentActivityPhaseSchema$1, Dt as inputProblemSummary, En as startRecordingOutputSchema, Et as inputProblemFields, Ft as hasCanvasReferenceScope, Gt as canvasUpdateHtmlCapabilityInputSchema, Hn as emptyFixtureDocument, Hr as canvasAuthoredLayoutValueOf, It as parseCanvasReference, Jr as canvasLayoutPriorityDeclarations, Kr as canvasLayoutMainAxisOf, Nt as canvasReferenceRenderTarget, Ot as isInputRecord, Pt as fromCanvasReference, Rr as saveCanvasDocumentOutputSchema, S as ProcessExitError, Sn as createScreenOutputSchema, Sr as beginCanvasActivityOutputSchema, T as PROCEDURE_DESCRIPTIONS, Tt as ROOT_FIELD, U as operationStatusInputSchema, Un as withFixtureScreen, Ur as canvasAuthoredStyleDeclarations, Ut as canvasReadInputSchema, Wr as canvasAxisStyleProperties, Zt as readStoredCanvasScene, _ as toPublishedExitTable, _n as CliError, a as createRouterShapeAdapter, b as CAPABILITY_UUID_EXAMPLE, bn as appErrorSchema$1, c as toKebabCase, dn as pointOfUseText, en as cliPathOf, f as toSharedCapabilities, fr as canvasTextRunsOf, gi as canvasWorldBoundsSchema$1, gn as skillTextsFor, h as toFailurePayload, ht as canvasFindInputSchema, i as createLazyCapabilityCatalogAdapter, ji as canvasSchema$1, jt as assertCanvasReferenceNodes, kt as objectFieldNames, l as GUIDE_TOPICS, li as canvasOperationSchema$1, ln as PartialBatchError, m as toExitCode, n as withCommandName, nn as currentNodeIdStep, ot as canvasRenderScopedInputSchema, p as createMcpCapabilityDiscoveryAdapter, r as toCanvasAuthoringResult, t as withCommandInFailure, u as GUIDE_TOPIC_NAMES, un as loadGuideLineFor, ut as canvasRemoveCapabilityInputSchema, wn as completeRecordingOutputSchema, wt as canvasEditsSchema, x as createCapabilityPolicyAdapter, xn as completeScreenOutputSchema, y as CANVAS_UPDATE_HTML_INPUT_EXAMPLE, zr as wholeCanvasDocumentOutputSchema } from "./cli-output-identity.lib-
|
|
3
|
-
import { A as canvasAngularGradientSvg, C as sceneAtVersion, D as canvasLinearGradientSvg, E as canvasRadialGradientSvg, O as canvasFilterListCss, S as createCanvasActivityComposite, T as createAuthUseCase, _ as readCanvasReferenceScene, b as createEditCanvasComposite, c as createOauthLoopbackAdapter, d as isJsonValued, f as createCapabilityInvocationAdapter, g as createRenderFileAdapter, i as readCliEnvironment, j as canvasColorCss, k as canvasDiamondGradientSvg, l as toInputHelp, n as createMutationKeyAdapter, r as createHttpRemoteAdapter, s as readToolMachine, t as installZodMessages, u as withCapabilityNames, v as createWriteHtmlCanvasComposite, w as createRenderCanvasComposite, x as assertCanvasReferenceOperations } from "./zod-messages.lib-
|
|
2
|
+
import { At as quotedValue, Bn as createOrganisationOutputSchema, C as OPTION_DESCRIPTIONS, Ci as emptyCanvasSceneDocument$1, Cn as appendRecordingChunkOutputSchema, Cr as canvasAgentActivityPhaseSchema$1, Dt as inputProblemSummary, En as startRecordingOutputSchema, Et as inputProblemFields, Ft as hasCanvasReferenceScope, Gt as canvasUpdateHtmlCapabilityInputSchema, Hn as emptyFixtureDocument, Hr as canvasAuthoredLayoutValueOf, It as parseCanvasReference, Jr as canvasLayoutPriorityDeclarations, Kr as canvasLayoutMainAxisOf, Nt as canvasReferenceRenderTarget, Ot as isInputRecord, Pt as fromCanvasReference, Rr as saveCanvasDocumentOutputSchema, S as ProcessExitError, Sn as createScreenOutputSchema, Sr as beginCanvasActivityOutputSchema, T as PROCEDURE_DESCRIPTIONS, Tt as ROOT_FIELD, U as operationStatusInputSchema, Un as withFixtureScreen, Ur as canvasAuthoredStyleDeclarations, Ut as canvasReadInputSchema, Wr as canvasAxisStyleProperties, Zt as readStoredCanvasScene, _ as toPublishedExitTable, _n as CliError, a as createRouterShapeAdapter, b as CAPABILITY_UUID_EXAMPLE, bn as appErrorSchema$1, c as toKebabCase, dn as pointOfUseText, en as cliPathOf, f as toSharedCapabilities, fr as canvasTextRunsOf, gi as canvasWorldBoundsSchema$1, gn as skillTextsFor, h as toFailurePayload, ht as canvasFindInputSchema, i as createLazyCapabilityCatalogAdapter, ji as canvasSchema$1, jt as assertCanvasReferenceNodes, kt as objectFieldNames, l as GUIDE_TOPICS, li as canvasOperationSchema$1, ln as PartialBatchError, m as toExitCode, n as withCommandName, nn as currentNodeIdStep, ot as canvasRenderScopedInputSchema, p as createMcpCapabilityDiscoveryAdapter, r as toCanvasAuthoringResult, t as withCommandInFailure, u as GUIDE_TOPIC_NAMES, un as loadGuideLineFor, ut as canvasRemoveCapabilityInputSchema, wn as completeRecordingOutputSchema, wt as canvasEditsSchema, x as createCapabilityPolicyAdapter, xn as completeScreenOutputSchema, y as CANVAS_UPDATE_HTML_INPUT_EXAMPLE, zr as wholeCanvasDocumentOutputSchema } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
|
+
import { A as canvasAngularGradientSvg, C as sceneAtVersion, D as canvasLinearGradientSvg, E as canvasRadialGradientSvg, O as canvasFilterListCss, S as createCanvasActivityComposite, T as createAuthUseCase, _ as readCanvasReferenceScene, b as createEditCanvasComposite, c as createOauthLoopbackAdapter, d as isJsonValued, f as createCapabilityInvocationAdapter, g as createRenderFileAdapter, i as readCliEnvironment, j as canvasColorCss, k as canvasDiamondGradientSvg, l as toInputHelp, n as createMutationKeyAdapter, r as createHttpRemoteAdapter, s as readToolMachine, t as installZodMessages, u as withCapabilityNames, v as createWriteHtmlCanvasComposite, w as createRenderCanvasComposite, x as assertCanvasReferenceOperations } from "./zod-messages.lib-25kXQXyA.mjs";
|
|
4
4
|
import { t as toCapabilityInventory } from "./capability-inventory.mapper-DyYXyVBJ.mjs";
|
|
5
5
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-CShGZcd5.mjs";
|
|
6
6
|
import process from "node:process";
|
|
@@ -1891,7 +1891,7 @@ const registerCanvasProgram = (program, input) => {
|
|
|
1891
1891
|
};
|
|
1892
1892
|
|
|
1893
1893
|
//#endregion
|
|
1894
|
-
//#region ../../packages/sdk/dist/stall-watch.lib-
|
|
1894
|
+
//#region ../../packages/sdk/dist/stall-watch.lib-Dk5eJmyQ.mjs
|
|
1895
1895
|
const CAPTURE_METADATA_LENGTH = 200;
|
|
1896
1896
|
const CAPTURE_FAILURE_LENGTH = 1e3;
|
|
1897
1897
|
const CAPTURE_UPLOAD_BATCH_SIZE = 400;
|
|
@@ -3624,10 +3624,15 @@ const canvasScrollbarGutterSchema = z.object({
|
|
|
3624
3624
|
bottom: nonNegativeCanvasNumberSchema.optional(),
|
|
3625
3625
|
left: nonNegativeCanvasNumberSchema.optional()
|
|
3626
3626
|
}).strict();
|
|
3627
|
-
/**
|
|
3627
|
+
/**
|
|
3628
|
+
* A percentage of the containing block plus pixels; unlike a size limit, either may be negative.
|
|
3629
|
+
* The position may be held between pixel bounds, as a browser holds a scroll inside its range.
|
|
3630
|
+
*/
|
|
3628
3631
|
const canvasParentRelativeCoordinateSchema = z.object({
|
|
3629
3632
|
ratio: canvasNumberSchema,
|
|
3630
|
-
offset: canvasNumberSchema.optional()
|
|
3633
|
+
offset: canvasNumberSchema.optional(),
|
|
3634
|
+
min: canvasNumberSchema.optional(),
|
|
3635
|
+
max: canvasNumberSchema.optional()
|
|
3631
3636
|
}).strict();
|
|
3632
3637
|
const canvasPositionParentSchema = z.object({
|
|
3633
3638
|
x: canvasParentRelativeCoordinateSchema.optional(),
|
|
@@ -6007,12 +6012,22 @@ const CANVAS_FIRST_LETTER_PROPERTIES = {
|
|
|
6007
6012
|
"font-stretch",
|
|
6008
6013
|
"font-style",
|
|
6009
6014
|
"font-weight",
|
|
6015
|
+
"font-variant-alternates",
|
|
6010
6016
|
"font-variant-caps",
|
|
6017
|
+
"font-variant-east-asian",
|
|
6018
|
+
"font-variant-emoji",
|
|
6011
6019
|
"font-variant-ligatures",
|
|
6012
6020
|
"font-variant-numeric",
|
|
6021
|
+
"font-variant-position",
|
|
6013
6022
|
"font-feature-settings",
|
|
6014
6023
|
"font-variation-settings",
|
|
6024
|
+
"font-optical-sizing",
|
|
6025
|
+
"font-size-adjust",
|
|
6015
6026
|
"font-kerning",
|
|
6027
|
+
"font-language-override",
|
|
6028
|
+
"font-synthesis-weight",
|
|
6029
|
+
"font-synthesis-style",
|
|
6030
|
+
"font-synthesis-small-caps",
|
|
6016
6031
|
"letter-spacing",
|
|
6017
6032
|
"line-height",
|
|
6018
6033
|
"text-shadow",
|
|
@@ -10732,7 +10747,7 @@ const startStallWatch = (caller, idleMs = STALL_MS) => {
|
|
|
10732
10747
|
};
|
|
10733
10748
|
|
|
10734
10749
|
//#endregion
|
|
10735
|
-
//#region ../../packages/sdk/dist/capture-client.client-
|
|
10750
|
+
//#region ../../packages/sdk/dist/capture-client.client-DuFVZYes.mjs
|
|
10736
10751
|
const line = (text) => `Enhance: ${text}\n`;
|
|
10737
10752
|
/** A left-out capture by its journey and step, or by its test when it could not be read at all. */
|
|
10738
10753
|
const leftOutName = (leftOut, attempts) => {
|
|
@@ -12960,7 +12975,7 @@ const main = async () => {
|
|
|
12960
12975
|
const remote = createHttpRemoteAdapter(config.apiUrl, credentials, mutationKey);
|
|
12961
12976
|
const cli = createCliProgram({
|
|
12962
12977
|
apiUrl: config.apiUrl,
|
|
12963
|
-
version: "0.1.
|
|
12978
|
+
version: "0.1.174",
|
|
12964
12979
|
credentials,
|
|
12965
12980
|
remote,
|
|
12966
12981
|
mutationKey,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as canvasWriteReceiptSchema, $n as listCommentsOutputSchema, B as canvasPrototypeOutputSchema, Bt as encodeCanvasExchangeToken, F as canvasCapturePageInputSchema, Gn as commentCanvasContextSchema, H as operationStatusImageSchema, I as canvasCapturePageOutputSchema, It as parseCanvasReference, Jn as commentThreadSchema, K as canvasCaptureInputSchema, Kn as commentMessageSchema, Kt as canvasUpdateHtmlInputSchema, Lt as canvasExchangeDigest, Q as canvasPreparationOutputSchema, Qn as listCommentsInputSchema, R as canvasPrototypeInputSchema, St as canvasMakeEditableInputSchema, U as operationStatusInputSchema, Ut as canvasReadInputSchema, V as canvasConversionStatusSchema, W as operationStatusOutputSchema, Wn as commentAuthorSchema, Wt as canvasReadOutputSchema, Xn as elementAnchorSchema, Y as canvasArrangeInputSchema, Yn as domLocatorSchema, Z as canvasDuplicateInputSchema, Zn as getCommentOutputSchema, _n as CliError, _t as createdCanvasAnswerSchema, ar as screenTextCommentTargetSchema, bt as canvasInsertHtmlInputSchema, dn as pointOfUseText, dt as canvasRemoveInputSchema, er as replyCommentInputSchema, ft as canvasCreateToolInputSchema, g as toMcpFailurePayload, gt as canvasFindOutputSchema, ht as canvasFindInputSchema, ir as screenElementsCommentTargetSchema, nr as screenAreaCommentTargetSchema, nt as canvasAssetImportOutputSchema, o as CAPTURE_PAGE_CALLS, or as startCommentInputSchema, pt as canvasCreateToolOutputSchema, q as canvasCaptureOutputSchema, qn as commentResolverSchema, rr as screenElementCommentTargetSchema, sn as MCP_TOOL_BY_CAPABILITY, st as canvasRenderScopedToolInputSchema, tr as replyCommentOutputSchema, tt as canvasAssetImportInputSchema, w as PROTOTYPE_UPDATE_GUIDANCE, zt as decodeCanvasExchangeToken } from "./cli-output-identity.lib-
|
|
3
|
-
import { T as createAuthUseCase, c as createOauthLoopbackAdapter, f as createCapabilityInvocationAdapter, n as createMutationKeyAdapter, r as createHttpRemoteAdapter, u as withCapabilityNames, y as boundedResultPage } from "./zod-messages.lib-
|
|
4
|
-
import { a as
|
|
2
|
+
import { $ as canvasWriteReceiptSchema, $n as listCommentsOutputSchema, B as canvasPrototypeOutputSchema, Bt as encodeCanvasExchangeToken, F as canvasCapturePageInputSchema, Gn as commentCanvasContextSchema, H as operationStatusImageSchema, I as canvasCapturePageOutputSchema, It as parseCanvasReference, Jn as commentThreadSchema, K as canvasCaptureInputSchema, Kn as commentMessageSchema, Kt as canvasUpdateHtmlInputSchema, Lt as canvasExchangeDigest, Q as canvasPreparationOutputSchema, Qn as listCommentsInputSchema, R as canvasPrototypeInputSchema, St as canvasMakeEditableInputSchema, U as operationStatusInputSchema, Ut as canvasReadInputSchema, V as canvasConversionStatusSchema, W as operationStatusOutputSchema, Wn as commentAuthorSchema, Wt as canvasReadOutputSchema, Xn as elementAnchorSchema, Y as canvasArrangeInputSchema, Yn as domLocatorSchema, Z as canvasDuplicateInputSchema, Zn as getCommentOutputSchema, _n as CliError, _t as createdCanvasAnswerSchema, ar as screenTextCommentTargetSchema, bt as canvasInsertHtmlInputSchema, dn as pointOfUseText, dt as canvasRemoveInputSchema, er as replyCommentInputSchema, ft as canvasCreateToolInputSchema, g as toMcpFailurePayload, gt as canvasFindOutputSchema, ht as canvasFindInputSchema, ir as screenElementsCommentTargetSchema, nr as screenAreaCommentTargetSchema, nt as canvasAssetImportOutputSchema, o as CAPTURE_PAGE_CALLS, or as startCommentInputSchema, pt as canvasCreateToolOutputSchema, q as canvasCaptureOutputSchema, qn as commentResolverSchema, rr as screenElementCommentTargetSchema, sn as MCP_TOOL_BY_CAPABILITY, st as canvasRenderScopedToolInputSchema, tr as replyCommentOutputSchema, tt as canvasAssetImportInputSchema, w as PROTOTYPE_UPDATE_GUIDANCE, zt as decodeCanvasExchangeToken } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
|
+
import { T as createAuthUseCase, c as createOauthLoopbackAdapter, f as createCapabilityInvocationAdapter, n as createMutationKeyAdapter, r as createHttpRemoteAdapter, u as withCapabilityNames, y as boundedResultPage } from "./zod-messages.lib-25kXQXyA.mjs";
|
|
4
|
+
import { a as createMcpCanvasToolsAdapter, c as toolClientToken, d as createCapabilityCatalogAdapter, i as createMcpClientInvocationAdapter, l as withClientTokenNamed, o as mcpDispatchedResultSchema, r as workflowsFor, s as createMcpResultAdapter, u as createMcpClientContextAdapter } from "./mcp-server.adapter-VC6efIcJ.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
7
7
|
|
|
@@ -1220,15 +1220,6 @@ const editToolsFor = (input, catalog, invocation) => createMcpCanvasToolsAdapter
|
|
|
1220
1220
|
delivery: input.delivery ?? "linked"
|
|
1221
1221
|
});
|
|
1222
1222
|
const createMcpCanvasProfileAdapter = (input) => {
|
|
1223
|
-
const workflows = input.workflows === void 0 ? void 0 : createMcpWorkflowsAdapter(input.workflows);
|
|
1224
|
-
const server = new McpServer({
|
|
1225
|
-
name: input.name ?? "enhance-canvas",
|
|
1226
|
-
version: input.version
|
|
1227
|
-
}, {
|
|
1228
|
-
capabilities: { tools: { listChanged: false } },
|
|
1229
|
-
instructions: profileInstructions(input, workflows?.instructions)
|
|
1230
|
-
});
|
|
1231
|
-
workflows?.register(server);
|
|
1232
1223
|
const catalog = input.catalog ?? createCapabilityCatalogAdapter();
|
|
1233
1224
|
const isReadOnly = input.readOnly ?? false;
|
|
1234
1225
|
const authentication = input.authentication ?? "local";
|
|
@@ -1244,35 +1235,51 @@ const createMcpCanvasProfileAdapter = (input) => {
|
|
|
1244
1235
|
arguments: args,
|
|
1245
1236
|
clientToken
|
|
1246
1237
|
});
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1238
|
+
const registerTools = (server) => {
|
|
1239
|
+
createMcpCanvasDiscoveryAdapter({
|
|
1240
|
+
catalog,
|
|
1241
|
+
invocation,
|
|
1242
|
+
readOnly: isReadOnly
|
|
1243
|
+
}).register(server);
|
|
1244
|
+
createMcpCanvasContentAdapter(invoke, isReadOnly).register(server);
|
|
1245
|
+
if (!isReadOnly) {
|
|
1246
|
+
editToolsFor(input, catalog, invocation).register(server);
|
|
1247
|
+
createMcpCanvasPreparationAdapter(invoke).register(server);
|
|
1248
|
+
if (authentication === "local") createMcpPrototypePublishAdapter(invoke).register(server);
|
|
1249
|
+
if (authentication === "local") createMcpAssetImportAdapter(invoke).register(server);
|
|
1250
|
+
else input.hostedFiles?.register(server);
|
|
1251
|
+
}
|
|
1252
|
+
createMcpFeedbackAdapter(invoke, isReadOnly).register(server);
|
|
1253
|
+
if (authentication === "local") createMcpConnectionToolsAdapter({
|
|
1254
|
+
catalog,
|
|
1255
|
+
invocation,
|
|
1256
|
+
readOnly: isReadOnly
|
|
1257
|
+
}).register(server);
|
|
1258
|
+
createMcpOperationStatusAdapter({
|
|
1259
|
+
catalog,
|
|
1260
|
+
invocation
|
|
1261
|
+
}).register(server);
|
|
1262
|
+
input.ui?.register(server, isReadOnly);
|
|
1263
|
+
if (!isReadOnly) createMcpCanvasRenderAdapter({
|
|
1264
|
+
catalog,
|
|
1265
|
+
invocation,
|
|
1266
|
+
...input.ui !== void 0 && { ui: input.ui }
|
|
1267
|
+
}).register(server);
|
|
1268
|
+
};
|
|
1269
|
+
const workflows = workflowsFor({
|
|
1270
|
+
workflows: input.workflows,
|
|
1271
|
+
register: registerTools,
|
|
1272
|
+
catalog
|
|
1273
|
+
});
|
|
1274
|
+
const server = new McpServer({
|
|
1275
|
+
name: input.name ?? "enhance-canvas",
|
|
1276
|
+
version: input.version
|
|
1277
|
+
}, {
|
|
1278
|
+
capabilities: { tools: { listChanged: false } },
|
|
1279
|
+
instructions: profileInstructions(input, workflows?.instructions)
|
|
1280
|
+
});
|
|
1281
|
+
workflows?.register(server);
|
|
1282
|
+
registerTools(server);
|
|
1276
1283
|
return server;
|
|
1277
1284
|
};
|
|
1278
1285
|
|
package/dist/mcp-main.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { s as toCapabilityDefinition } from "./cli-output-identity.lib-
|
|
3
|
-
import { a as readLocalMcpEnvironment, t as installZodMessages } from "./zod-messages.lib-
|
|
2
|
+
import { s as toCapabilityDefinition } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
|
+
import { a as readLocalMcpEnvironment, t as installZodMessages } from "./zod-messages.lib-25kXQXyA.mjs";
|
|
4
4
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-CShGZcd5.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
5
|
+
import { d as createCapabilityCatalogAdapter, t as createMcpServerAdapter, u as createMcpClientContextAdapter } from "./mcp-server.adapter-VC6efIcJ.mjs";
|
|
6
|
+
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-Cq2xp41d.mjs";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
@@ -171,19 +171,19 @@ const clientContext = createMcpClientContextAdapter();
|
|
|
171
171
|
const main = () => {
|
|
172
172
|
const config = readLocalMcpEnvironment();
|
|
173
173
|
const credentials = createFileCredentialAdapter(config.configDirectory, config.earlierConfigDirectory);
|
|
174
|
-
const invocation = createMcpInvocationAdapter(config.apiUrl, credentials, config.configDirectory, { version: "0.1.
|
|
174
|
+
const invocation = createMcpInvocationAdapter(config.apiUrl, credentials, config.configDirectory, { version: "0.1.174" });
|
|
175
175
|
const catalog = [...createCapabilityCatalogAdapter(), ...createMcpTransportCapabilityAdapter()];
|
|
176
176
|
const client = clientContext.createStdio();
|
|
177
177
|
serveStdio(() => config.profile === "canvas" ? createMcpCanvasProfileAdapter({
|
|
178
178
|
readOnly: config.isReadOnly,
|
|
179
179
|
...config.workflowsDirectory !== void 0 && { workflows: config.workflowsDirectory },
|
|
180
180
|
name: config.mcpServiceName,
|
|
181
|
-
version: "0.1.
|
|
181
|
+
version: "0.1.174",
|
|
182
182
|
invocation,
|
|
183
183
|
clientMetadata: client.metadata,
|
|
184
184
|
catalog
|
|
185
185
|
}) : createMcpServerAdapter({
|
|
186
|
-
version: "0.1.
|
|
186
|
+
version: "0.1.174",
|
|
187
187
|
name: config.mcpServiceName,
|
|
188
188
|
commandName: config.commandName,
|
|
189
189
|
invocation,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Ct as canvasEditCapabilityInputSchema, Et as inputProblemFields, Ft as hasCanvasReferenceScope, It as parseCanvasReference, Nt as canvasReferenceRenderTarget, Tr as agentClientMetadata, Zt as readStoredCanvasScene, _n as CliError, d as toPresentedCapabilities, dn as pointOfUseText, fn as startUpListFor, g as toMcpFailurePayload, hi as canvasRenderTargetSchema, hn as
|
|
2
|
+
import { Ct as canvasEditCapabilityInputSchema, Et as inputProblemFields, Ft as hasCanvasReferenceScope, It as parseCanvasReference, Nt as canvasReferenceRenderTarget, Tr as agentClientMetadata, Zt as readStoredCanvasScene, _n as CliError, d as toPresentedCapabilities, dn as pointOfUseText, fn as startUpListFor, g as toMcpFailurePayload, gn as skillTextsFor, hi as canvasRenderTargetSchema, hn as jobOf, i as createLazyCapabilityCatalogAdapter, it as canvasRenderBatchResultSchema, k as canvasWriteHtmlCapabilityInputSchema, l as GUIDE_TOPICS, lt as canvasRenderFileSchema, mn as SKILL_NAMES, n as withCommandName, on as onSurface, p as createMcpCapabilityDiscoveryAdapter, pi as canvasRenderSourceStateSchema, pn as DESIGN_RULES, qt as retryClientTokenSchema, r as toCanvasAuthoringResult, sn as MCP_TOOL_BY_CAPABILITY, t as withCommandInFailure, u as GUIDE_TOPIC_NAMES, zr as wholeCanvasDocumentOutputSchema } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { readFile, rm } from "node:fs/promises";
|
|
@@ -676,15 +676,20 @@ const createMcpClientInvocationAdapter = (invocation, legacyClient) => ({ invoke
|
|
|
676
676
|
|
|
677
677
|
//#endregion
|
|
678
678
|
//#region src/infrastructure/mcp-workflows.adapter.ts
|
|
679
|
-
/** The guide offers
|
|
679
|
+
/** The guide offers the skills a server can carry out and every topic, by their short names. */
|
|
680
680
|
const workflowNameSchema = z.enum(SKILL_NAMES);
|
|
681
|
-
const guideNameSchema = z.enum([...SKILL_NAMES, ...GUIDE_TOPIC_NAMES]);
|
|
682
681
|
const workflowSchema = z.object({
|
|
683
682
|
name: workflowNameSchema,
|
|
684
683
|
description: z.string().min(1),
|
|
685
684
|
body: z.string().min(1)
|
|
686
685
|
});
|
|
687
|
-
|
|
686
|
+
/** The sentence that names the job of each skill a server offers, or none when it offers none. */
|
|
687
|
+
const jobsOf = (skills) => {
|
|
688
|
+
const jobs = skills.map((skill) => jobOf(skill));
|
|
689
|
+
const last = jobs.at(-1);
|
|
690
|
+
if (last === void 0) return void 0;
|
|
691
|
+
return `Before ${jobs.length === 1 ? last : `${jobs.slice(0, -1).join(", ")} or ${last}`}, call workflow_guide with the matching workflow and follow its guidance.`;
|
|
692
|
+
};
|
|
688
693
|
const topics = `Topics: ${GUIDE_TOPIC_NAMES.map((name) => `${name} (${GUIDE_TOPICS[name].description})`).join("; ")}.`;
|
|
689
694
|
/** The start-up list names tools, which every MCP server words the same. */
|
|
690
695
|
const startUp = startUpListFor({
|
|
@@ -713,14 +718,18 @@ const workflowIn = (directory, name) => {
|
|
|
713
718
|
};
|
|
714
719
|
/** The guide tool over a folder of skills, or over skills already written for tools. */
|
|
715
720
|
const createMcpWorkflowsAdapter = (skills, authenticationInstructions) => {
|
|
716
|
-
const
|
|
721
|
+
const offered = typeof skills === "string" ? workflowNameSchema.options.map((name) => workflowIn(skills, name)) : skills.map(({ skill, description, body }) => ({
|
|
717
722
|
name: skill,
|
|
718
723
|
description,
|
|
719
724
|
body
|
|
720
|
-
}))
|
|
725
|
+
}));
|
|
726
|
+
const workflows = [...offered, ...GUIDE_TOPIC_NAMES.map((name) => ({
|
|
721
727
|
name,
|
|
722
728
|
...GUIDE_TOPICS[name]
|
|
723
729
|
}))];
|
|
730
|
+
const [first, ...rest] = workflows.map(({ name }) => name);
|
|
731
|
+
const guideNameSchema = z.enum([first ?? GUIDE_TOPIC_NAMES[0], ...rest]);
|
|
732
|
+
const jobs = jobsOf(offered.map(({ name }) => name));
|
|
724
733
|
return {
|
|
725
734
|
instructions: [
|
|
726
735
|
startUp,
|
|
@@ -737,7 +746,7 @@ const createMcpWorkflowsAdapter = (skills, authenticationInstructions) => {
|
|
|
737
746
|
}] }));
|
|
738
747
|
server.registerTool("workflow_guide", {
|
|
739
748
|
title: "Load an Enhance workflow",
|
|
740
|
-
description:
|
|
749
|
+
description: [jobs, topics].filter(Boolean).join(" "),
|
|
741
750
|
inputSchema: z.strictObject({ workflow: guideNameSchema }),
|
|
742
751
|
annotations: {
|
|
743
752
|
readOnlyHint: true,
|
|
@@ -753,6 +762,83 @@ const createMcpWorkflowsAdapter = (skills, authenticationInstructions) => {
|
|
|
753
762
|
};
|
|
754
763
|
};
|
|
755
764
|
|
|
765
|
+
//#endregion
|
|
766
|
+
//#region src/infrastructure/mcp-served-skills.lib.ts
|
|
767
|
+
/**
|
|
768
|
+
* A capability whose job another capability's tool also does. `canvas_write_html` inserts a
|
|
769
|
+
* screen or group (`insert-children`) and rebuilds a layer's inside (`replace`), so a server
|
|
770
|
+
* that has it and lacks the insert or update tool names it for those jobs.
|
|
771
|
+
*/
|
|
772
|
+
const DONE_ALSO_BY = {
|
|
773
|
+
"canvas.insertHtml": ["canvas.writeHtml"],
|
|
774
|
+
"canvas.updateHtml": ["canvas.writeHtml"]
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* How a server reaches a capability, in this order: a tool of its own for the capability, a
|
|
778
|
+
* tool of its own for a capability that does the same job, the generic tool that runs it by name
|
|
779
|
+
* (with the tool that describes it), or not at all.
|
|
780
|
+
*/
|
|
781
|
+
const reachIn = ({ tools, catalog }) => (capability) => {
|
|
782
|
+
for (const id of [capability, ...DONE_ALSO_BY[capability] ?? []]) {
|
|
783
|
+
const tool = MCP_TOOL_BY_CAPABILITY[id];
|
|
784
|
+
if (tool !== void 0 && tools.has(tool)) return {
|
|
785
|
+
kind: "tool",
|
|
786
|
+
tool
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
const operation = catalog.find(({ id }) => id === capability)?.operation;
|
|
790
|
+
const generic = operation === "query" ? "capability_query" : "capability_mutate";
|
|
791
|
+
if (operation !== void 0 && tools.has(generic) && tools.has("capability_describe")) return {
|
|
792
|
+
kind: "through",
|
|
793
|
+
tool: generic,
|
|
794
|
+
describe: "capability_describe",
|
|
795
|
+
capability
|
|
796
|
+
};
|
|
797
|
+
return { kind: "none" };
|
|
798
|
+
};
|
|
799
|
+
const createServedSkills = () => {
|
|
800
|
+
const kept = {};
|
|
801
|
+
return { textsFor: (probe) => {
|
|
802
|
+
kept.written ??= skillTextsFor({
|
|
803
|
+
surface: "mcp",
|
|
804
|
+
nameOf: (capability) => MCP_TOOL_BY_CAPABILITY[capability],
|
|
805
|
+
reach: reachIn(probe())
|
|
806
|
+
});
|
|
807
|
+
return kept.written;
|
|
808
|
+
} };
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* The names of the tools a set of registrations makes. They are registered on a server nobody
|
|
812
|
+
* connects to, because the SDK's server has no public way to list its own tools.
|
|
813
|
+
*/
|
|
814
|
+
const toolNamesOf = (register) => {
|
|
815
|
+
const server = new McpServer({
|
|
816
|
+
name: "tool-names",
|
|
817
|
+
version: "0"
|
|
818
|
+
});
|
|
819
|
+
const names = /* @__PURE__ */ new Set();
|
|
820
|
+
const registerTool = Reflect.get(server, "registerTool");
|
|
821
|
+
if (typeof registerTool !== "function") throw new TypeError("The MCP server registers no tools.");
|
|
822
|
+
Object.assign(server, { registerTool: (name, ...rest) => {
|
|
823
|
+
names.add(name);
|
|
824
|
+
return Reflect.apply(registerTool, server, [name, ...rest]);
|
|
825
|
+
} });
|
|
826
|
+
register(server);
|
|
827
|
+
return names;
|
|
828
|
+
};
|
|
829
|
+
/**
|
|
830
|
+
* A server's guide, over a folder or skills it was given, or over the skills worded for the tools
|
|
831
|
+
* `register` makes, which are read only when the route has not written its skills yet.
|
|
832
|
+
*/
|
|
833
|
+
const workflowsFor = (served, authenticationInstructions) => {
|
|
834
|
+
const { workflows, register, catalog } = served;
|
|
835
|
+
const skills = typeof workflows === "object" && "textsFor" in workflows ? workflows.textsFor(() => ({
|
|
836
|
+
tools: toolNamesOf(register),
|
|
837
|
+
catalog
|
|
838
|
+
})) : workflows;
|
|
839
|
+
return skills === void 0 ? void 0 : createMcpWorkflowsAdapter(skills, authenticationInstructions);
|
|
840
|
+
};
|
|
841
|
+
|
|
756
842
|
//#endregion
|
|
757
843
|
//#region src/infrastructure/capability-catalogue-text.mapper.ts
|
|
758
844
|
const MAX_LINE_CHARACTERS = 180;
|
|
@@ -934,8 +1020,32 @@ const registerMutation = (server, catalog, invocation, execution) => {
|
|
|
934
1020
|
}));
|
|
935
1021
|
};
|
|
936
1022
|
const createMcpServerAdapter = (input) => {
|
|
937
|
-
const
|
|
938
|
-
const
|
|
1023
|
+
const isLocal = input.exposures?.includes("mcp-transport") === true;
|
|
1024
|
+
const authenticationInstructions = isLocal ? AUTHENTICATION_INSTRUCTIONS : void 0;
|
|
1025
|
+
const catalog = toPresentedCapabilities(input.catalog ?? createCapabilityCatalogAdapter(), input.exposures ?? ["shared"]);
|
|
1026
|
+
const discovery = createMcpCapabilityDiscoveryAdapter(catalog);
|
|
1027
|
+
const mcpResults = createMcpResultAdapter(isLocal ? LOCAL_AUTHENTICATION_REMEDY : HOSTED_AUTHENTICATION_REMEDY, input.commandName);
|
|
1028
|
+
const execution = {
|
|
1029
|
+
delivery: input.delivery ?? "linked",
|
|
1030
|
+
results: mcpResults,
|
|
1031
|
+
invocation: createMcpClientInvocationAdapter(input.invocation, input.clientMetadata)
|
|
1032
|
+
};
|
|
1033
|
+
const registerTools = (server) => {
|
|
1034
|
+
createMcpCatalogueToolAdapter(catalog, input.version, input.commandName).register(server);
|
|
1035
|
+
registerSearch(server, catalog, discovery, mcpResults);
|
|
1036
|
+
createMcpDescribeToolAdapter(discovery, mcpResults).register(server);
|
|
1037
|
+
registerQuery(server, catalog, execution.invocation, execution);
|
|
1038
|
+
registerMutation(server, catalog, execution.invocation, execution);
|
|
1039
|
+
createMcpCanvasToolsAdapter({
|
|
1040
|
+
catalog,
|
|
1041
|
+
...execution
|
|
1042
|
+
}).register(server);
|
|
1043
|
+
};
|
|
1044
|
+
const workflows = workflowsFor({
|
|
1045
|
+
workflows: input.workflows,
|
|
1046
|
+
register: registerTools,
|
|
1047
|
+
catalog
|
|
1048
|
+
}, authenticationInstructions);
|
|
939
1049
|
const instructions = workflows?.instructions ?? authenticationInstructions;
|
|
940
1050
|
const server = new McpServer({
|
|
941
1051
|
name: input.name ?? "enhance-mcp",
|
|
@@ -947,26 +1057,10 @@ const createMcpServerAdapter = (input) => {
|
|
|
947
1057
|
},
|
|
948
1058
|
...instructions !== void 0 && { instructions }
|
|
949
1059
|
});
|
|
950
|
-
|
|
951
|
-
const discovery = createMcpCapabilityDiscoveryAdapter(catalog);
|
|
952
|
-
const mcpResults = createMcpResultAdapter(input.exposures?.includes("mcp-transport") === true ? LOCAL_AUTHENTICATION_REMEDY : HOSTED_AUTHENTICATION_REMEDY, input.commandName);
|
|
953
|
-
createMcpCatalogueToolAdapter(catalog, input.version, input.commandName).register(server);
|
|
954
|
-
registerSearch(server, catalog, discovery, mcpResults);
|
|
955
|
-
createMcpDescribeToolAdapter(discovery, mcpResults).register(server);
|
|
956
|
-
const execution = {
|
|
957
|
-
delivery: input.delivery ?? "linked",
|
|
958
|
-
results: mcpResults,
|
|
959
|
-
invocation: createMcpClientInvocationAdapter(input.invocation, input.clientMetadata)
|
|
960
|
-
};
|
|
961
|
-
registerQuery(server, catalog, execution.invocation, execution);
|
|
962
|
-
registerMutation(server, catalog, execution.invocation, execution);
|
|
963
|
-
createMcpCanvasToolsAdapter({
|
|
964
|
-
catalog,
|
|
965
|
-
...execution
|
|
966
|
-
}).register(server);
|
|
1060
|
+
registerTools(server);
|
|
967
1061
|
workflows?.register(server);
|
|
968
1062
|
return server;
|
|
969
1063
|
};
|
|
970
1064
|
|
|
971
1065
|
//#endregion
|
|
972
|
-
export {
|
|
1066
|
+
export { createMcpCanvasToolsAdapter as a, toolClientToken as c, createCapabilityCatalogAdapter as d, createMcpClientInvocationAdapter as i, withClientTokenNamed as l, createServedSkills as n, mcpDispatchedResultSchema as o, workflowsFor as r, createMcpResultAdapter as s, createMcpServerAdapter as t, createMcpClientContextAdapter as u };
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { f as toSharedCapabilities } from "./cli-output-identity.lib-
|
|
2
|
+
import { f as toSharedCapabilities } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
3
|
import { t as toCapabilityInventory } from "./capability-inventory.mapper-DyYXyVBJ.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { d as createCapabilityCatalogAdapter, t as createMcpServerAdapter } from "./mcp-server.adapter-VC6efIcJ.mjs";
|
|
5
5
|
|
|
6
6
|
export { createCapabilityCatalogAdapter, createMcpServerAdapter as createEnhanceMcpServer, toCapabilityInventory, toSharedCapabilities };
|
package/dist/remote-mcp-main.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { An as foldPrototypeArtifactPath, B as canvasPrototypeOutputSchema, In as getMeOutputSchema, Ln as MCP_AUTH_SCOPE, Pn as prototypeArtifactPathSchema, Ti as signedDownloadSchema, _n as CliError, dn as pointOfUseText,
|
|
3
|
-
import { h as createImportCanvasAssetComposite, m as createPublishCanvasPrototypeComposite, n as createMutationKeyAdapter, o as readRemoteMcpEnvironment, p as createPrototypeArtifactAdapter, r as createHttpRemoteAdapter, t as installZodMessages } from "./zod-messages.lib-
|
|
4
|
-
import { c as
|
|
5
|
-
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
2
|
+
import { An as foldPrototypeArtifactPath, B as canvasPrototypeOutputSchema, In as getMeOutputSchema, Ln as MCP_AUTH_SCOPE, Pn as prototypeArtifactPathSchema, Ti as signedDownloadSchema, _n as CliError, dn as pointOfUseText, nt as canvasAssetImportOutputSchema, tt as canvasAssetImportInputSchema, w as PROTOTYPE_UPDATE_GUIDANCE, z as canvasPrototypeIntentSchema } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
|
+
import { h as createImportCanvasAssetComposite, m as createPublishCanvasPrototypeComposite, n as createMutationKeyAdapter, o as readRemoteMcpEnvironment, p as createPrototypeArtifactAdapter, r as createHttpRemoteAdapter, t as installZodMessages } from "./zod-messages.lib-25kXQXyA.mjs";
|
|
4
|
+
import { c as toolClientToken, d as createCapabilityCatalogAdapter, l as withClientTokenNamed, n as createServedSkills, s as createMcpResultAdapter, t as createMcpServerAdapter, u as createMcpClientContextAdapter } from "./mcp-server.adapter-VC6efIcJ.mjs";
|
|
5
|
+
import { n as createMcpCanvasProfileAdapter, t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-Cq2xp41d.mjs";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises";
|
|
@@ -618,14 +618,6 @@ const createMcpHostedFilesAdapter = (input) => ({ register: (server) => {
|
|
|
618
618
|
//#endregion
|
|
619
619
|
//#region src/infrastructure/mcp-http-profile.adapter.ts
|
|
620
620
|
const clientContext = createMcpClientContextAdapter();
|
|
621
|
-
/**
|
|
622
|
-
* What `workflow_guide` answers with on a hosted connection: the skills of the one source, worded
|
|
623
|
-
* for tools, where the plugin's own server reads the folder its build wrote from that source.
|
|
624
|
-
*/
|
|
625
|
-
const workflows = skillTextsFor({
|
|
626
|
-
surface: "mcp",
|
|
627
|
-
nameOf: (capability) => MCP_TOOL_BY_CAPABILITY[capability]
|
|
628
|
-
});
|
|
629
621
|
/** The tools that import a file, fetching only from the origins `files` allows. */
|
|
630
622
|
const hostedFilesFor = (files, apiUrl, credentials) => createMcpHostedFilesAdapter({
|
|
631
623
|
files,
|
|
@@ -642,10 +634,15 @@ const createMcpHttpProfileAdapter = (config, catalog, credentialFor, profile) =>
|
|
|
642
634
|
const hostFiles = config.fileOrigins !== void 0 && config.fileOrigins.length > 0 ? createMcpFileDownloadAdapter(config.fileOrigins) : void 0;
|
|
643
635
|
const stagedFiles = config.stagedUploadOrigin === void 0 ? void 0 : createMcpFileDownloadAdapter([config.stagedUploadOrigin]);
|
|
644
636
|
const ui = config.uiUrl === void 0 ? void 0 : createMcpCanvasUiAdapter(config.uiUrl);
|
|
637
|
+
const skills = {
|
|
638
|
+
withFiles: createServedSkills(),
|
|
639
|
+
withoutFiles: createServedSkills()
|
|
640
|
+
};
|
|
645
641
|
return createMcpHandler(({ authInfo }) => {
|
|
646
642
|
if (authInfo === void 0) throw new Error("authenticated MCP request held no identity");
|
|
647
643
|
const credentials = credentialFor(authInfo.token);
|
|
648
644
|
const files = authInfo.extra?.["savedLogin"] === true ? stagedFiles : hostFiles;
|
|
645
|
+
const workflows = files === void 0 ? skills.withoutFiles : skills.withFiles;
|
|
649
646
|
const hosted = createMcpHostedCapabilitiesAdapter(catalog, createMcpInvocationAdapter(config.apiUrl, credentials, config.configDirectory, {
|
|
650
647
|
version: config.version,
|
|
651
648
|
connectionPath: "hosted_mcp"
|
|
@@ -850,7 +847,7 @@ const server = await createRemoteMcpHttpAdapter({
|
|
|
850
847
|
...config.MCP_STAGED_UPLOAD_ORIGIN !== void 0 && { stagedUploadOrigin: config.MCP_STAGED_UPLOAD_ORIGIN },
|
|
851
848
|
allowedHosts: config.MCP_ALLOWED_HOSTS.split(",").map((value) => value.trim()),
|
|
852
849
|
allowedOrigins: config.MCP_ALLOWED_ORIGINS.split(",").map((value) => value.trim()),
|
|
853
|
-
version: "0.1.
|
|
850
|
+
version: "0.1.174",
|
|
854
851
|
...config.MCP_UI_URL !== void 0 && { uiUrl: config.MCP_UI_URL },
|
|
855
852
|
onerror: (error) => process.stderr.write(`${error.message}\n`)
|
|
856
853
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $r as reserveCanvasAssetOutputSchema, $t as callingSurface, A as commentAttentionCapabilityInputSchema, Ai as endCanvasActivityOutputSchema, An as foldPrototypeArtifactPath, Ar as IMAGE_KIND, Br as canvasBoxSourceOf, Bt as encodeCanvasExchangeToken, Ct as canvasEditCapabilityInputSchema, D as canvasReadCapabilityInputSchema, Di as CANVAS_BLEND_MODES, Dn as PROTOTYPE_ARTIFACT_MANIFEST_PATH, Dr as getCanvasPreparationOutputSchema, Dt as inputProblemSummary, E as canvasApplyCapabilityInputSchema, Ei as canvasAdditionalStyleSchema, Er as createCanvasPreparationOutputSchema, Et as inputProblemFields, Fn as submitPrototypeArtifactOutputSchema, Fr as canvasLayoutWithoutCssProperties, Ft as hasCanvasReferenceScope, G as canvasCaptureCapabilityInputSchema, Gr as canvasCssPixelValue, Gt as canvasUpdateHtmlCapabilityInputSchema, Ht as canvasOutlineCursorSchema, In as getMeOutputSchema, Ir as textOf, It as parseCanvasReference, J as canvasArrangeCapabilityInputSchema, Jt as canvasTranscriptCursorSchema, Kt as canvasUpdateHtmlInputSchema, L as canvasPrototypeCapabilityInputSchema, Lr as mapCanvasFontSources, Lt as canvasExchangeDigest, M as recordingSnapshotCapabilityInputSchema, Mn as getPrototypePublishStatusOutputSchema, Mr as RECTANGLE_KIND, Mt as canvasReferenceNodeIds, N as transcriptReadCapabilityInputSchema, Nn as prototypeArtifactManifestSchema, Nr as SCREEN_KIND, O as canvasRenderCapabilityInputSchema, Oi as canvasBlendModeSchema, On as attachPrototypeArtifactOutputSchema, Or as FRAME_KIND, P as canvasCapturePageCapabilityInputSchema, Pn as prototypeArtifactPathSchema, Pr as TEXT_KIND, Qr as reserveCanvasAssetInputSchema, Qt as callOf, Rn as cliAuthConfigurationSchema, Rt as canvasSnapshotToken, Si as canvasSceneDocumentSchema, Sr as beginCanvasActivityOutputSchema, Tn as getRecordingOutputSchema, U as operationStatusInputSchema, Ur as canvasAuthoredStyleDeclarations, Ut as canvasReadInputSchema, Vn as listOrganisationsOutputSchema, Vr as canvasRecordedBoxNoteFor, Vt as resolveCanvasSnapshot, Wr as canvasAxisStyleProperties, X as canvasDuplicateCapabilityInputSchema, Xr as canvasCssValue, Xt as tallyCanvasWork, Yr as canvasCssTokens, Yt as canvasResourcesCursorSchema, Zr as canvasAssetUploadOutputSchema, Zt as readStoredCanvasScene, _i as createCanvasRenderOutputSchema, _n as CliError, _r as canvasRecordingPropsSchema, ai as editCanvasOutputSchema, an as inputName, at as canvasRenderPendingSchema, bi as getCanvasRenderOutputSchema, br as canvasReferencePageOf, ci as getCanvasMutationOutputSchema, cn as CANVAS_EDIT_WORDS, cr as applyCanvasTypographyPatch, ct as canvasRenderRequestSchema, di as createCanvasConversionOutputSchema, dr as canvasTextPropsWithContent, ei as canvasFontAssetIdentityFromPath, en as cliPathOf, et as canvasAssetImportCapabilityInputSchema, fi as getCanvasConversionOutputSchema, gr as canvasPrototypePropsSchema, hr as canvasConversionMetadataSchema, ht as canvasFindInputSchema, ii as CANVAS_RICH_TEXT_STYLE_PROPERTIES, in as inSurfaceWords, j as prototypePublishCapabilityInputSchema, jn as getPrototypeArtifactCapabilitiesOutputSchema, jr as PAGE_KIND, jt as assertCanvasReferenceNodes, k as canvasWriteHtmlCapabilityInputSchema, ki as canvasPaintSchema, kn as createPrototypeArtifactOutputSchema, kr as GROUP_KIND, ln as PartialBatchError, lr as canvasCssTypographyOwners, lt as canvasRenderFileSchema, mi as canvasRenderStateSchema, mr as canvasCaptureSchema, mt as canvasFindCursorSchema, ni as canvasRichTextValueOf, nn as currentNodeIdStep, nt as canvasAssetImportOutputSchema, oi as applyCanvasOperationsInputSchema, pr as CAPTURE_LANDING_CONVERTING, qr as canvasLayoutPositionOf, ri as hasCanvasRichTextPaints, rn as diagnosisStep, rt as canvasRenderBatchRequestSchema, si as applyCanvasOperationsOutputSchema, sr as createCapturePassOutputSchema, ti as canvasRichTextOf, tn as commandName, ui as canvasNodeStylePatchSchema, ur as canvasTextChangeBetween, ut as canvasRemoveCapabilityInputSchema, v as toRemoteError, vi as createRecordingSnapshotOutputSchema, vn as isFormatRefusalError, vr as captureLandingSchema, vt as listedCanvasesAnswerSchema, wi as canvasImageAssetIdentityFromPath, wr as AGENT_CLIENT_HEADER, xi as canvasReadableSceneDocumentSchema, xr as resolveCanvasReference, xt as canvasMakeEditableCapabilityInputSchema, yi as downloadCanvasRenderOutputSchema, yn as transcriptOutputSchema, yr as DEFAULT_CANVAS_REFERENCE_PAGE_ID, yt as canvasInsertHtmlCapabilityInputSchema, zn as createAgentTokenOutputSchema, zr as wholeCanvasDocumentOutputSchema, zt as decodeCanvasExchangeToken } from "./cli-output-identity.lib-
|
|
2
|
+
import { $r as reserveCanvasAssetOutputSchema, $t as callingSurface, A as commentAttentionCapabilityInputSchema, Ai as endCanvasActivityOutputSchema, An as foldPrototypeArtifactPath, Ar as IMAGE_KIND, Br as canvasBoxSourceOf, Bt as encodeCanvasExchangeToken, Ct as canvasEditCapabilityInputSchema, D as canvasReadCapabilityInputSchema, Di as CANVAS_BLEND_MODES, Dn as PROTOTYPE_ARTIFACT_MANIFEST_PATH, Dr as getCanvasPreparationOutputSchema, Dt as inputProblemSummary, E as canvasApplyCapabilityInputSchema, Ei as canvasAdditionalStyleSchema, Er as createCanvasPreparationOutputSchema, Et as inputProblemFields, Fn as submitPrototypeArtifactOutputSchema, Fr as canvasLayoutWithoutCssProperties, Ft as hasCanvasReferenceScope, G as canvasCaptureCapabilityInputSchema, Gr as canvasCssPixelValue, Gt as canvasUpdateHtmlCapabilityInputSchema, Ht as canvasOutlineCursorSchema, In as getMeOutputSchema, Ir as textOf, It as parseCanvasReference, J as canvasArrangeCapabilityInputSchema, Jt as canvasTranscriptCursorSchema, Kt as canvasUpdateHtmlInputSchema, L as canvasPrototypeCapabilityInputSchema, Lr as mapCanvasFontSources, Lt as canvasExchangeDigest, M as recordingSnapshotCapabilityInputSchema, Mn as getPrototypePublishStatusOutputSchema, Mr as RECTANGLE_KIND, Mt as canvasReferenceNodeIds, N as transcriptReadCapabilityInputSchema, Nn as prototypeArtifactManifestSchema, Nr as SCREEN_KIND, O as canvasRenderCapabilityInputSchema, Oi as canvasBlendModeSchema, On as attachPrototypeArtifactOutputSchema, Or as FRAME_KIND, P as canvasCapturePageCapabilityInputSchema, Pn as prototypeArtifactPathSchema, Pr as TEXT_KIND, Qr as reserveCanvasAssetInputSchema, Qt as callOf, Rn as cliAuthConfigurationSchema, Rt as canvasSnapshotToken, Si as canvasSceneDocumentSchema, Sr as beginCanvasActivityOutputSchema, Tn as getRecordingOutputSchema, U as operationStatusInputSchema, Ur as canvasAuthoredStyleDeclarations, Ut as canvasReadInputSchema, Vn as listOrganisationsOutputSchema, Vr as canvasRecordedBoxNoteFor, Vt as resolveCanvasSnapshot, Wr as canvasAxisStyleProperties, X as canvasDuplicateCapabilityInputSchema, Xr as canvasCssValue, Xt as tallyCanvasWork, Yr as canvasCssTokens, Yt as canvasResourcesCursorSchema, Zr as canvasAssetUploadOutputSchema, Zt as readStoredCanvasScene, _i as createCanvasRenderOutputSchema, _n as CliError, _r as canvasRecordingPropsSchema, ai as editCanvasOutputSchema, an as inputName, at as canvasRenderPendingSchema, bi as getCanvasRenderOutputSchema, br as canvasReferencePageOf, ci as getCanvasMutationOutputSchema, cn as CANVAS_EDIT_WORDS, cr as applyCanvasTypographyPatch, ct as canvasRenderRequestSchema, di as createCanvasConversionOutputSchema, dr as canvasTextPropsWithContent, ei as canvasFontAssetIdentityFromPath, en as cliPathOf, et as canvasAssetImportCapabilityInputSchema, fi as getCanvasConversionOutputSchema, gr as canvasPrototypePropsSchema, hr as canvasConversionMetadataSchema, ht as canvasFindInputSchema, ii as CANVAS_RICH_TEXT_STYLE_PROPERTIES, in as inSurfaceWords, j as prototypePublishCapabilityInputSchema, jn as getPrototypeArtifactCapabilitiesOutputSchema, jr as PAGE_KIND, jt as assertCanvasReferenceNodes, k as canvasWriteHtmlCapabilityInputSchema, ki as canvasPaintSchema, kn as createPrototypeArtifactOutputSchema, kr as GROUP_KIND, ln as PartialBatchError, lr as canvasCssTypographyOwners, lt as canvasRenderFileSchema, mi as canvasRenderStateSchema, mr as canvasCaptureSchema, mt as canvasFindCursorSchema, ni as canvasRichTextValueOf, nn as currentNodeIdStep, nt as canvasAssetImportOutputSchema, oi as applyCanvasOperationsInputSchema, pr as CAPTURE_LANDING_CONVERTING, qr as canvasLayoutPositionOf, ri as hasCanvasRichTextPaints, rn as diagnosisStep, rt as canvasRenderBatchRequestSchema, si as applyCanvasOperationsOutputSchema, sr as createCapturePassOutputSchema, ti as canvasRichTextOf, tn as commandName, ui as canvasNodeStylePatchSchema, ur as canvasTextChangeBetween, ut as canvasRemoveCapabilityInputSchema, v as toRemoteError, vi as createRecordingSnapshotOutputSchema, vn as isFormatRefusalError, vr as captureLandingSchema, vt as listedCanvasesAnswerSchema, wi as canvasImageAssetIdentityFromPath, wr as AGENT_CLIENT_HEADER, xi as canvasReadableSceneDocumentSchema, xr as resolveCanvasReference, xt as canvasMakeEditableCapabilityInputSchema, yi as downloadCanvasRenderOutputSchema, yn as transcriptOutputSchema, yr as DEFAULT_CANVAS_REFERENCE_PAGE_ID, yt as canvasInsertHtmlCapabilityInputSchema, zn as createAgentTokenOutputSchema, zr as wholeCanvasDocumentOutputSchema, zt as decodeCanvasExchangeToken } from "./cli-output-identity.lib-BgqE7RXo.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { generateKeyBetween, generateNKeysBetween } from "fractional-indexing";
|