@enhance-eng/enhance 0.1.20 → 0.1.21
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-Du4_Ahcj.mjs → cli-output-identity.lib-a1wTreJ6.mjs} +302 -12
- package/dist/main.mjs +172 -26
- package/dist/{mcp-invocation.adapter-CcSWERtl.mjs → mcp-invocation.adapter-NrVhm7y8.mjs} +2 -2
- package/dist/mcp-main.mjs +7 -7
- package/dist/{mcp-server.adapter-DrbFMc01.mjs → mcp-server.adapter-Cgp05gfi.mjs} +1 -1
- package/dist/mcp.mjs +2 -2
- package/dist/{mutation-key.adapter-B6dNFpWt.mjs → mutation-key.adapter-x3QOYrKY.mjs} +1 -1
- package/dist/remote-mcp-main.mjs +5 -5
- package/package.json +1 -1
|
@@ -1166,6 +1166,64 @@ const canvasTextStyleBindingSchema = z.object({
|
|
|
1166
1166
|
|
|
1167
1167
|
//#endregion
|
|
1168
1168
|
//#region ../../packages/contract/src/canvas/canvas-rich-text.lib.ts
|
|
1169
|
+
const ALLOWED_STYLE_PROPERTIES = /* @__PURE__ */ new Set([
|
|
1170
|
+
"alignItems",
|
|
1171
|
+
"backgroundColor",
|
|
1172
|
+
"borderBottom",
|
|
1173
|
+
"borderBottomLeftRadius",
|
|
1174
|
+
"borderBottomRightRadius",
|
|
1175
|
+
"borderLeft",
|
|
1176
|
+
"borderRight",
|
|
1177
|
+
"borderTop",
|
|
1178
|
+
"borderTopLeftRadius",
|
|
1179
|
+
"borderTopRightRadius",
|
|
1180
|
+
"boxShadow",
|
|
1181
|
+
"boxSizing",
|
|
1182
|
+
"color",
|
|
1183
|
+
"columnGap",
|
|
1184
|
+
"display",
|
|
1185
|
+
"flexDirection",
|
|
1186
|
+
"fontFamily",
|
|
1187
|
+
"fontFeatureSettings",
|
|
1188
|
+
"fontOpticalSizing",
|
|
1189
|
+
"fontSize",
|
|
1190
|
+
"fontStretch",
|
|
1191
|
+
"fontStyle",
|
|
1192
|
+
"fontVariant",
|
|
1193
|
+
"fontVariantCaps",
|
|
1194
|
+
"fontVariantLigatures",
|
|
1195
|
+
"fontVariantNumeric",
|
|
1196
|
+
"fontVariantPosition",
|
|
1197
|
+
"fontKerning",
|
|
1198
|
+
"fontVariationSettings",
|
|
1199
|
+
"fontWeight",
|
|
1200
|
+
"justifyContent",
|
|
1201
|
+
"letterSpacing",
|
|
1202
|
+
"lineHeight",
|
|
1203
|
+
"marginBottom",
|
|
1204
|
+
"marginLeft",
|
|
1205
|
+
"marginRight",
|
|
1206
|
+
"marginTop",
|
|
1207
|
+
"opacity",
|
|
1208
|
+
"paddingBottom",
|
|
1209
|
+
"paddingLeft",
|
|
1210
|
+
"paddingRight",
|
|
1211
|
+
"paddingTop",
|
|
1212
|
+
"rowGap",
|
|
1213
|
+
"textDecorationColor",
|
|
1214
|
+
"textDecorationLine",
|
|
1215
|
+
"textDecorationSkipInk",
|
|
1216
|
+
"textDecorationStyle",
|
|
1217
|
+
"textDecorationThickness",
|
|
1218
|
+
"textShadow",
|
|
1219
|
+
"textTransform",
|
|
1220
|
+
"textUnderlineOffset",
|
|
1221
|
+
"verticalAlign",
|
|
1222
|
+
"whiteSpace",
|
|
1223
|
+
"WebkitTextStrokeColor",
|
|
1224
|
+
"WebkitTextStrokeWidth",
|
|
1225
|
+
"--canvas-text-stroke-alignment"
|
|
1226
|
+
]);
|
|
1169
1227
|
const fillsSchema = canvasPaintSchema.array().max(32).optional();
|
|
1170
1228
|
const characterFormattingSchema = canvasTextParagraphSchema.pick({
|
|
1171
1229
|
paragraphSpacing: true,
|
|
@@ -1176,6 +1234,119 @@ const characterFormattingSchema = canvasTextParagraphSchema.pick({
|
|
|
1176
1234
|
hangingPunctuation: canvasTypographySchema.shape.hangingPunctuation,
|
|
1177
1235
|
verticalTrim: canvasTypographySchema.shape.verticalTrim
|
|
1178
1236
|
}).strip();
|
|
1237
|
+
const SAFE_HREF_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
1238
|
+
"http:",
|
|
1239
|
+
"https:",
|
|
1240
|
+
"mailto:",
|
|
1241
|
+
"tel:"
|
|
1242
|
+
]);
|
|
1243
|
+
const isCanvasRichTextHref = (value) => {
|
|
1244
|
+
const href = value.trim();
|
|
1245
|
+
if (href === "") return false;
|
|
1246
|
+
try {
|
|
1247
|
+
const protocol = new URL(href, "https://enhance.invalid/").protocol;
|
|
1248
|
+
return SAFE_HREF_PROTOCOLS.has(protocol);
|
|
1249
|
+
} catch {
|
|
1250
|
+
return false;
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
const safeHref = (value) => typeof value === "string" && isCanvasRichTextHref(value) ? value : void 0;
|
|
1254
|
+
const richStylesOf = (value) => {
|
|
1255
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
1256
|
+
const entries = Object.entries(value);
|
|
1257
|
+
if (entries.some(([property, styleValue]) => !ALLOWED_STYLE_PROPERTIES.has(property) || typeof styleValue !== "string" && typeof styleValue !== "number")) return null;
|
|
1258
|
+
return Object.fromEntries(entries);
|
|
1259
|
+
};
|
|
1260
|
+
const richMetadataOf = (value) => {
|
|
1261
|
+
const sourcePath = Reflect.get(value, "sourcePath");
|
|
1262
|
+
return {
|
|
1263
|
+
...Object.fromEntries(Object.entries(value).filter(([key]) => ![
|
|
1264
|
+
"text",
|
|
1265
|
+
"href",
|
|
1266
|
+
"sourcePath",
|
|
1267
|
+
"styles",
|
|
1268
|
+
"fills",
|
|
1269
|
+
"paragraph",
|
|
1270
|
+
"paragraphSpacing",
|
|
1271
|
+
"paragraphIndent",
|
|
1272
|
+
"listSpacing",
|
|
1273
|
+
"hangingPunctuation",
|
|
1274
|
+
"verticalTrim",
|
|
1275
|
+
"wrapStyle",
|
|
1276
|
+
"soft",
|
|
1277
|
+
"textStyle"
|
|
1278
|
+
].includes(key))),
|
|
1279
|
+
...typeof sourcePath === "string" && { sourcePath }
|
|
1280
|
+
};
|
|
1281
|
+
};
|
|
1282
|
+
const richChildrenOf = (values) => {
|
|
1283
|
+
const children = [];
|
|
1284
|
+
for (const candidate of values) {
|
|
1285
|
+
const child = richNodeOf(candidate);
|
|
1286
|
+
if (child === null) return null;
|
|
1287
|
+
children.push(child);
|
|
1288
|
+
}
|
|
1289
|
+
return children;
|
|
1290
|
+
};
|
|
1291
|
+
const richBreakOf = (value) => {
|
|
1292
|
+
const soft = Reflect.get(value, "soft");
|
|
1293
|
+
if (soft !== void 0 && soft !== true) return null;
|
|
1294
|
+
return {
|
|
1295
|
+
...richMetadataOf(value),
|
|
1296
|
+
kind: "break",
|
|
1297
|
+
...soft === true && { soft }
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
const richNodeOf = (value) => {
|
|
1301
|
+
if (typeof value !== "object" || value === null) return null;
|
|
1302
|
+
const kind = Reflect.get(value, "kind");
|
|
1303
|
+
const metadata = richMetadataOf(value);
|
|
1304
|
+
if (kind === "break") return richBreakOf(value);
|
|
1305
|
+
if (kind === "text") {
|
|
1306
|
+
const text = Reflect.get(value, "text");
|
|
1307
|
+
return typeof text === "string" ? {
|
|
1308
|
+
...metadata,
|
|
1309
|
+
kind,
|
|
1310
|
+
text
|
|
1311
|
+
} : null;
|
|
1312
|
+
}
|
|
1313
|
+
if (kind !== "span") return null;
|
|
1314
|
+
const values = Reflect.get(value, "children");
|
|
1315
|
+
const styles = richStylesOf(Reflect.get(value, "styles"));
|
|
1316
|
+
const fills = fillsSchema.safeParse(Reflect.get(value, "fills"));
|
|
1317
|
+
const paragraph = canvasTextParagraphSchema.optional().safeParse(Reflect.get(value, "paragraph"));
|
|
1318
|
+
const formatting = characterFormattingSchema.safeParse(value);
|
|
1319
|
+
const textStyle = canvasTextStyleBindingSchema.optional().safeParse(Reflect.get(value, "textStyle"));
|
|
1320
|
+
if (styles === null || !fills.success || !paragraph.success || !formatting.success || !textStyle.success || !Array.isArray(values)) return null;
|
|
1321
|
+
const children = richChildrenOf(values);
|
|
1322
|
+
if (children === null) return null;
|
|
1323
|
+
const href = safeHref(Reflect.get(value, "href"));
|
|
1324
|
+
return {
|
|
1325
|
+
...metadata,
|
|
1326
|
+
kind,
|
|
1327
|
+
styles,
|
|
1328
|
+
children,
|
|
1329
|
+
...textStyle.data !== void 0 && { textStyle: textStyle.data },
|
|
1330
|
+
...fills.data !== void 0 && { fills: fills.data },
|
|
1331
|
+
...paragraph.data !== void 0 && { paragraph: paragraph.data },
|
|
1332
|
+
...Object.fromEntries(Object.entries(formatting.data).filter(([, entry]) => entry !== void 0)),
|
|
1333
|
+
...href !== void 0 && { href }
|
|
1334
|
+
};
|
|
1335
|
+
};
|
|
1336
|
+
const canvasRichTextValueOf = (nodes) => nodes.map((node) => node.kind === "break" ? node.soft === true ? "\u2028" : "\n" : node.kind === "text" ? node.text : canvasRichTextValueOf(node.children)).join("");
|
|
1337
|
+
const canvasRichTextOf = (node) => {
|
|
1338
|
+
const props = node.props;
|
|
1339
|
+
if (props === void 0 || !Array.isArray(props["richText"])) return [];
|
|
1340
|
+
const value = props["richText"];
|
|
1341
|
+
const rich = [];
|
|
1342
|
+
for (const candidate of value) {
|
|
1343
|
+
const child = richNodeOf(candidate);
|
|
1344
|
+
if (child === null) return [];
|
|
1345
|
+
rich.push(child);
|
|
1346
|
+
}
|
|
1347
|
+
const text = props["text"];
|
|
1348
|
+
return canvasRichTextValueOf(rich) === text ? rich : [];
|
|
1349
|
+
};
|
|
1179
1350
|
|
|
1180
1351
|
//#endregion
|
|
1181
1352
|
//#region ../../packages/contract/src/canvas/canvas-scene.schema.ts
|
|
@@ -1312,6 +1483,21 @@ const textSchema = z.object({
|
|
|
1312
1483
|
text: z.string(),
|
|
1313
1484
|
links: z.array(textLinkSchema).optional()
|
|
1314
1485
|
});
|
|
1486
|
+
const compareTextLinks = (left, right) => {
|
|
1487
|
+
const byStart = left.start - right.start;
|
|
1488
|
+
return byStart === 0 ? left.end - right.end : byStart;
|
|
1489
|
+
};
|
|
1490
|
+
const textOf = (node) => textSchema.safeParse(node.props).data?.text ?? null;
|
|
1491
|
+
const textLinksOf = (node) => {
|
|
1492
|
+
const parsed = textSchema.safeParse(node.props).data;
|
|
1493
|
+
if (parsed === void 0) return [];
|
|
1494
|
+
const links = parsed.links;
|
|
1495
|
+
if (links === void 0) return [];
|
|
1496
|
+
const validLinks = links.filter(({ start, end }) => start < end && end <= parsed.text.length).toSorted(compareTextLinks);
|
|
1497
|
+
const nonOverlapping = [];
|
|
1498
|
+
for (const link of validLinks) if ((nonOverlapping.at(-1)?.end ?? 0) <= link.start) nonOverlapping.push(link);
|
|
1499
|
+
return nonOverlapping;
|
|
1500
|
+
};
|
|
1315
1501
|
|
|
1316
1502
|
//#endregion
|
|
1317
1503
|
//#region ../../packages/contract/src/canvas/canvas-conversion-draft.schema.ts
|
|
@@ -3375,9 +3561,47 @@ const readCanvasSelectionOutputSchema = z.object({
|
|
|
3375
3561
|
|
|
3376
3562
|
//#endregion
|
|
3377
3563
|
//#region ../../packages/contract/src/canvas/canvas-text-run-format.lib.ts
|
|
3564
|
+
const LINK_STYLES = {
|
|
3565
|
+
color: "inherit",
|
|
3566
|
+
textDecorationLine: "underline",
|
|
3567
|
+
textDecorationThickness: "0.08em",
|
|
3568
|
+
textUnderlineOffset: "0.14em"
|
|
3569
|
+
};
|
|
3378
3570
|
const STYLE_PROPERTIES = new Set(CANVAS_TEXT_STYLE_PROPERTIES);
|
|
3379
3571
|
const STYLE_CSS = new Set(Object.entries(CANVAS_TYPOGRAPHY_CSS_OWNERS).flatMap(([css, owners]) => owners.some((owner) => STYLE_PROPERTIES.has(owner)) ? [css.replaceAll(/-([a-z])/gu, (_, letter) => letter.toUpperCase())] : []));
|
|
3380
3572
|
|
|
3573
|
+
//#endregion
|
|
3574
|
+
//#region ../../packages/contract/src/canvas/canvas-text-commands.lib.ts
|
|
3575
|
+
/** Legacy link annotations join the same run tree when their contents are first edited. */
|
|
3576
|
+
const canvasTextRunsOf = (node) => {
|
|
3577
|
+
const rich = canvasRichTextOf(node);
|
|
3578
|
+
if (rich.length > 0) return rich;
|
|
3579
|
+
const text = textOf(node) ?? "";
|
|
3580
|
+
const runs = [];
|
|
3581
|
+
let position = 0;
|
|
3582
|
+
for (const link of textLinksOf(node)) {
|
|
3583
|
+
if (position < link.start) runs.push({
|
|
3584
|
+
kind: "text",
|
|
3585
|
+
text: text.slice(position, link.start)
|
|
3586
|
+
});
|
|
3587
|
+
runs.push({
|
|
3588
|
+
kind: "span",
|
|
3589
|
+
href: link.href,
|
|
3590
|
+
styles: LINK_STYLES,
|
|
3591
|
+
children: [{
|
|
3592
|
+
kind: "text",
|
|
3593
|
+
text: text.slice(link.start, link.end)
|
|
3594
|
+
}]
|
|
3595
|
+
});
|
|
3596
|
+
position = link.end;
|
|
3597
|
+
}
|
|
3598
|
+
if (position < text.length) runs.push({
|
|
3599
|
+
kind: "text",
|
|
3600
|
+
text: text.slice(position)
|
|
3601
|
+
});
|
|
3602
|
+
return runs;
|
|
3603
|
+
};
|
|
3604
|
+
|
|
3381
3605
|
//#endregion
|
|
3382
3606
|
//#region ../../packages/contract/src/canvas/canvas-text-style-consumers.lib.ts
|
|
3383
3607
|
const ownedProperties = new Set(CANVAS_TEXT_STYLE_PROPERTIES);
|
|
@@ -5002,6 +5226,32 @@ const appError$1 = (code, message, fields) => fields === void 0 ? {
|
|
|
5002
5226
|
fields
|
|
5003
5227
|
};
|
|
5004
5228
|
|
|
5229
|
+
//#endregion
|
|
5230
|
+
//#region ../../packages/contract/src/shared/client-conversion.schema.ts
|
|
5231
|
+
const MAX_CLIENT_CONVERSION_DURATION_MS = 18e5;
|
|
5232
|
+
const MAX_SOURCE_NODE_ID_LENGTH = 200;
|
|
5233
|
+
const clientConversionInputSchema = z.object({
|
|
5234
|
+
canvasId: z.uuid(),
|
|
5235
|
+
attemptId: z.uuid(),
|
|
5236
|
+
sourceNodeId: z.string().min(1).max(MAX_SOURCE_NODE_ID_LENGTH),
|
|
5237
|
+
releaseIdentity: z.string().min(1).max(100),
|
|
5238
|
+
outcome: z.enum([
|
|
5239
|
+
"started",
|
|
5240
|
+
"succeeded",
|
|
5241
|
+
"blocked",
|
|
5242
|
+
"failed"
|
|
5243
|
+
]),
|
|
5244
|
+
reason: z.enum([
|
|
5245
|
+
"none",
|
|
5246
|
+
"pending-changes",
|
|
5247
|
+
"source-unsettled",
|
|
5248
|
+
"captured-fonts-unavailable",
|
|
5249
|
+
"conversion-failed"
|
|
5250
|
+
]),
|
|
5251
|
+
durationMs: z.number().int().min(0).max(MAX_CLIENT_CONVERSION_DURATION_MS)
|
|
5252
|
+
});
|
|
5253
|
+
const clientConversionOutputSchema = z.object({ accepted: z.literal(true) });
|
|
5254
|
+
|
|
5005
5255
|
//#endregion
|
|
5006
5256
|
//#region ../../packages/contract/src/shared/client-performance.schema.ts
|
|
5007
5257
|
const MAX_CAPABILITY_VERSION$1 = 16;
|
|
@@ -5107,6 +5357,23 @@ const clientPerformanceInputSchema = z.discriminatedUnion("name", [
|
|
|
5107
5357
|
]);
|
|
5108
5358
|
const clientPerformanceOutputSchema = z.object({ accepted: z.literal(true) });
|
|
5109
5359
|
|
|
5360
|
+
//#endregion
|
|
5361
|
+
//#region ../../packages/contract/src/shared/client-render-failure.schema.ts
|
|
5362
|
+
const incidentFields = {
|
|
5363
|
+
incidentId: z.uuid(),
|
|
5364
|
+
releaseIdentity: z.string().min(1).max(100),
|
|
5365
|
+
reason: z.enum(["render-loop", "render-error"])
|
|
5366
|
+
};
|
|
5367
|
+
const clientRenderFailureInputSchema = z.discriminatedUnion("surface", [z.object({
|
|
5368
|
+
...incidentFields,
|
|
5369
|
+
surface: z.literal("canvas"),
|
|
5370
|
+
canvasId: z.uuid()
|
|
5371
|
+
}), z.object({
|
|
5372
|
+
...incidentFields,
|
|
5373
|
+
surface: z.literal("application")
|
|
5374
|
+
})]);
|
|
5375
|
+
const clientRenderFailureOutputSchema = z.object({ accepted: z.literal(true) });
|
|
5376
|
+
|
|
5110
5377
|
//#endregion
|
|
5111
5378
|
//#region ../../packages/contract/src/shared/extension-bridge.schema.ts
|
|
5112
5379
|
const EXTENSION_BRIDGE_PROBE = "enhance3:extension-probe";
|
|
@@ -6301,6 +6568,11 @@ const SHARED_CAPABILITY_POLICY = {
|
|
|
6301
6568
|
reason: "Authenticated product operation supported equally by CLI and MCP.",
|
|
6302
6569
|
owner: "product"
|
|
6303
6570
|
};
|
|
6571
|
+
const PRODUCT_TELEMETRY_POLICY = {
|
|
6572
|
+
exposure: "internal",
|
|
6573
|
+
reason: "Product telemetry is not an agent capability.",
|
|
6574
|
+
owner: "product"
|
|
6575
|
+
};
|
|
6304
6576
|
const PROCEDURE_CAPABILITY_POLICIES = {
|
|
6305
6577
|
"canvas.applyOperations": {
|
|
6306
6578
|
exposure: "internal",
|
|
@@ -6433,16 +6705,10 @@ const PROCEDURE_CAPABILITY_POLICIES = {
|
|
|
6433
6705
|
reason: "Prototype upload lifecycle is wrapped by prototype publish.",
|
|
6434
6706
|
owner: "product"
|
|
6435
6707
|
},
|
|
6436
|
-
"telemetry.
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
},
|
|
6441
|
-
"telemetry.performance": {
|
|
6442
|
-
exposure: "internal",
|
|
6443
|
-
reason: "Product telemetry is not an agent capability.",
|
|
6444
|
-
owner: "product"
|
|
6445
|
-
},
|
|
6708
|
+
"telemetry.conversion": PRODUCT_TELEMETRY_POLICY,
|
|
6709
|
+
"telemetry.renderFailure": PRODUCT_TELEMETRY_POLICY,
|
|
6710
|
+
"telemetry.lifecycle": PRODUCT_TELEMETRY_POLICY,
|
|
6711
|
+
"telemetry.performance": PRODUCT_TELEMETRY_POLICY,
|
|
6446
6712
|
"transcript.get": {
|
|
6447
6713
|
exposure: "internal",
|
|
6448
6714
|
reason: "Transcript storage details are wrapped by transcript get.",
|
|
@@ -10166,6 +10432,18 @@ const createScreenRouter = (handlers) => trpcRouter({
|
|
|
10166
10432
|
})))
|
|
10167
10433
|
});
|
|
10168
10434
|
|
|
10435
|
+
//#endregion
|
|
10436
|
+
//#region ../api/src/shared/observability/client-conversion-telemetry.router.ts
|
|
10437
|
+
const clientConversionTelemetryRoute = () => baseProcedure.input(clientConversionInputSchema).output(clientConversionOutputSchema).mutation(({ input, ctx }) => {
|
|
10438
|
+
const fields = {
|
|
10439
|
+
...input,
|
|
10440
|
+
event: "EditableConversionReported"
|
|
10441
|
+
};
|
|
10442
|
+
if (input.outcome === "blocked" || input.outcome === "failed") ctx.logger.warn(fields, "event");
|
|
10443
|
+
else ctx.logger.info(fields, "event");
|
|
10444
|
+
return { accepted: true };
|
|
10445
|
+
});
|
|
10446
|
+
|
|
10169
10447
|
//#endregion
|
|
10170
10448
|
//#region ../api/src/shared/observability/client-performance-telemetry.router.ts
|
|
10171
10449
|
const fieldsOf$1 = (input) => {
|
|
@@ -10194,6 +10472,16 @@ const clientPerformanceTelemetryRoute = () => baseProcedure.input(clientPerforma
|
|
|
10194
10472
|
return { accepted: true };
|
|
10195
10473
|
});
|
|
10196
10474
|
|
|
10475
|
+
//#endregion
|
|
10476
|
+
//#region ../api/src/shared/observability/client-render-failure.router.ts
|
|
10477
|
+
const clientRenderFailureRoute = () => baseProcedure.input(clientRenderFailureInputSchema).output(clientRenderFailureOutputSchema).mutation(({ input, ctx }) => {
|
|
10478
|
+
ctx.logger.error({
|
|
10479
|
+
...input,
|
|
10480
|
+
event: "EditorRenderFailed"
|
|
10481
|
+
}, "event");
|
|
10482
|
+
return { accepted: true };
|
|
10483
|
+
});
|
|
10484
|
+
|
|
10197
10485
|
//#endregion
|
|
10198
10486
|
//#region ../api/src/shared/observability/extension-telemetry.router.ts
|
|
10199
10487
|
const isFailure = (input) => {
|
|
@@ -10294,7 +10582,9 @@ const createAppRouter = (handlers, options = DEFAULT_ROUTER_OPTIONS) => trpcRout
|
|
|
10294
10582
|
transcript: createTranscriptRouter(handlers.transcript),
|
|
10295
10583
|
telemetry: trpcRouter({
|
|
10296
10584
|
...createExtensionTelemetryRouter()._def.record,
|
|
10297
|
-
performance: clientPerformanceTelemetryRoute()
|
|
10585
|
+
performance: clientPerformanceTelemetryRoute(),
|
|
10586
|
+
conversion: clientConversionTelemetryRoute(),
|
|
10587
|
+
renderFailure: clientRenderFailureRoute()
|
|
10298
10588
|
})
|
|
10299
10589
|
});
|
|
10300
10590
|
|
|
@@ -10929,4 +11219,4 @@ const withCommandInFailure = (value, commandName) => ({
|
|
|
10929
11219
|
});
|
|
10930
11220
|
|
|
10931
11221
|
//#endregion
|
|
10932
|
-
export { createOrganisationOutputSchema as $, parseCanvasReference as A,
|
|
11222
|
+
export { createOrganisationOutputSchema as $, parseCanvasReference as A, canvasLayoutPriorityDeclarations as At, PROTOTYPE_ARTIFACT_MANIFEST_PATH as B, transcriptReadCapabilityInputSchema as C, downloadCanvasRenderOutputSchema as Ct, assertCanvasReferenceOperations as D, canvasAuthoredStyleDeclarations as Dt, assertCanvasReferenceNodes as E, canvasAuthoredLayoutValueOf as Et, completeScreenOutputSchema as F, getPrototypePublishStatusOutputSchema as G, createPrototypeArtifactOutputSchema as H, createScreenOutputSchema as I, submitPrototypeArtifactOutputSchema as J, prototypeArtifactManifestSchema as K, appendRecordingChunkOutputSchema as L, CliError as M, canvasSchema as Mt, transcriptOutputSchema as N, canvasReferenceNodeIds as O, canvasAxisStyleProperties as Ot, appErrorSchema as P, createAgentTokenOutputSchema as Q, completeRecordingOutputSchema as R, recordingSnapshotCapabilityInputSchema as S, createRecordingSnapshotOutputSchema as St, canvasEditsSchema as T, canvasReadableSceneDocumentSchema as Tt, foldPrototypeArtifactPath as U, attachPrototypeArtifactOutputSchema as V, getPrototypeArtifactCapabilitiesOutputSchema as W, MCP_AUTH_SCOPE as X, getMeOutputSchema as Y, cliAuthConfigurationSchema as Z, canvasApplyCapabilityInputSchema as _, RENDER_MIN_SCALE as _t, toExitCode as a, beginCanvasActivityOutputSchema as at, commentAttentionCapabilityInputSchema as b, canvasWorldBoundsSchema as bt, toSharedCapabilities as c, getCanvasDocumentOutputSchema as ct, createCapabilityCatalogAdapter as d, applyCanvasOperationsInputSchema as dt, emptyFixtureDocument as et, createRouterShapeAdapter as f, applyCanvasOperationsOutputSchema as ft, PROCEDURE_DESCRIPTIONS as g, getCanvasConversionOutputSchema as gt, OPTION_DESCRIPTIONS as h, createCanvasConversionOutputSchema as ht, toCanvasAuthoringResult as i, canvasTextRunsOf as it, PartialBatchError as j, canvasAdditionalStyleSchema as jt, fromCanvasReference as k, canvasLayoutMainAxisOf as kt, createMcpCapabilityDiscoveryAdapter as l, saveCanvasDocumentOutputSchema as lt, toCapabilityDefinition as m, canvasNodeStylePatchSchema as mt, withCommandName as n, applyCanvasTypographyPatch as nt, toFailurePayload as o, canvasAgentActivityPhaseSchema as ot, createCapabilityPolicyAdapter as p, canvasOperationSchema as pt, prototypeArtifactPathSchema as q, canvasRenderResultSchema as r, canvasCssTypographyOwners as rt, toPresentedCapabilities as s, canvasLayoutWithoutCssProperties as st, withCommandInFailure as t, withFixtureScreen as tt, ProcessExitError as u, MAX_CANVAS_OPERATIONS as ut, canvasRenderCapabilityInputSchema as v, canvasRenderSourceStateSchema as vt, canvasEditCapabilityInputSchema as w, getCanvasRenderOutputSchema as wt, prototypePublishCapabilityInputSchema as x, createCanvasRenderOutputSchema as xt, canvasWriteHtmlCapabilityInputSchema as y, canvasRenderTargetSchema as yt, startRecordingOutputSchema as z };
|
package/dist/main.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as createOrganisationOutputSchema, A as parseCanvasReference, D as assertCanvasReferenceOperations, Dt as
|
|
3
|
-
import { a as createOauthLoopbackAdapter, c as createWriteHtmlCanvasComposite, d as createApplyCanvasComposite, f as createCanvasActivityComposite, l as createEditCanvasComposite, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, p as createRenderCanvasComposite, r as CLI_CONFIG, s as createRenderFileAdapter, t as createMutationKeyAdapter, u as sceneAtVersion } from "./mutation-key.adapter-
|
|
2
|
+
import { $ as createOrganisationOutputSchema, A as parseCanvasReference, At as canvasLayoutPriorityDeclarations, D as assertCanvasReferenceOperations, Dt as canvasAuthoredStyleDeclarations, E as assertCanvasReferenceNodes, Et as canvasAuthoredLayoutValueOf, F as completeScreenOutputSchema, I as createScreenOutputSchema, L as appendRecordingChunkOutputSchema, M as CliError, Mt as canvasSchema, O as canvasReferenceNodeIds, Ot as canvasAxisStyleProperties, P as appErrorSchema, R as completeRecordingOutputSchema, T as canvasEditsSchema, Tt as canvasReadableSceneDocumentSchema, _t as RENDER_MIN_SCALE, a as toExitCode, at as beginCanvasActivityOutputSchema, bt as canvasWorldBoundsSchema, c as toSharedCapabilities, ct as getCanvasDocumentOutputSchema, d as createCapabilityCatalogAdapter, et as emptyFixtureDocument, f as createRouterShapeAdapter, g as PROCEDURE_DESCRIPTIONS, h as OPTION_DESCRIPTIONS, i as toCanvasAuthoringResult, it as canvasTextRunsOf, j as PartialBatchError, k as fromCanvasReference, kt as canvasLayoutMainAxisOf, l as createMcpCapabilityDiscoveryAdapter, lt as saveCanvasDocumentOutputSchema, n as withCommandName, o as toFailurePayload, ot as canvasAgentActivityPhaseSchema, p as createCapabilityPolicyAdapter, pt as canvasOperationSchema, t as withCommandInFailure, tt as withFixtureScreen, u as ProcessExitError, ut as MAX_CANVAS_OPERATIONS, z as startRecordingOutputSchema } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
+
import { a as createOauthLoopbackAdapter, c as createWriteHtmlCanvasComposite, d as createApplyCanvasComposite, f as createCanvasActivityComposite, l as createEditCanvasComposite, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, p as createRenderCanvasComposite, r as CLI_CONFIG, s as createRenderFileAdapter, t as createMutationKeyAdapter, u as sceneAtVersion } from "./mutation-key.adapter-x3QOYrKY.mjs";
|
|
4
4
|
import { t as toCapabilityInventory } from "./capability-inventory.mapper-DyYXyVBJ.mjs";
|
|
5
5
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-rI5HpMEo.mjs";
|
|
6
6
|
import { Command } from "commander";
|
|
@@ -15,6 +15,76 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
15
15
|
import { readFile } from "node:fs/promises";
|
|
16
16
|
import { proxify } from "trpc-cli/dist/proxify.js";
|
|
17
17
|
|
|
18
|
+
//#region ../../packages/contract/src/canvas/canvas-color-css.lib.ts
|
|
19
|
+
const BYTE_MAX = 255;
|
|
20
|
+
const CHANNEL_PRECISION = 1e6;
|
|
21
|
+
const roundedChannel = (value) => Math.round(value * BYTE_MAX * CHANNEL_PRECISION) / CHANNEL_PRECISION;
|
|
22
|
+
const canvasColorCss = (color, opacity = 1) => {
|
|
23
|
+
const alpha = color.alpha * opacity;
|
|
24
|
+
if (color.space === "srgb") {
|
|
25
|
+
const channels = [
|
|
26
|
+
color.red,
|
|
27
|
+
color.green,
|
|
28
|
+
color.blue
|
|
29
|
+
].map((channel) => String(roundedChannel(channel))).join(" ");
|
|
30
|
+
return alpha === 1 ? `rgb(${channels})` : `rgb(${channels} / ${String(alpha)})`;
|
|
31
|
+
}
|
|
32
|
+
const channels = `${String(color.red)} ${String(color.green)} ${String(color.blue)}`;
|
|
33
|
+
return `color(${color.space} ${channels} / ${String(alpha)})`;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region ../../packages/contract/src/canvas/canvas-typography-css.lib.ts
|
|
38
|
+
const PERCENT$2 = 100;
|
|
39
|
+
/** Native bidi chooses each automatic paragraph's base direction without changing its alignment. */
|
|
40
|
+
const canvasTextDirectionDeclarations = (direction) => direction === void 0 ? {} : {
|
|
41
|
+
...direction !== "auto" && { direction },
|
|
42
|
+
"unicode-bidi": direction === "auto" ? "plaintext" : "isolate"
|
|
43
|
+
};
|
|
44
|
+
const CSS_IDENTIFIER = /^-?[_a-z][-\w]*$/iu;
|
|
45
|
+
const CSS_VARIABLE = /^var\(--[-\w]+\)$/iu;
|
|
46
|
+
const fontFamilyName = (family) => CSS_IDENTIFIER.test(family) || CSS_VARIABLE.test(family) ? family : JSON.stringify(family);
|
|
47
|
+
const canvasTypographyFontFamily = (typography) => [.../* @__PURE__ */ new Set([
|
|
48
|
+
typography.family,
|
|
49
|
+
...typography.family === "Inter" ? ["Inter Variable"] : [],
|
|
50
|
+
...typography.family === "JetBrains Mono" ? ["JetBrains Mono Variable"] : [],
|
|
51
|
+
...typography.fallbackFamilies
|
|
52
|
+
])].map((family) => fontFamilyName(family)).join(", ");
|
|
53
|
+
/** Weight is the sole wght owner; the remaining axes never shadow the visible weight field. */
|
|
54
|
+
const canvasFontVariationSettings = (typography) => Object.entries({
|
|
55
|
+
...typography.variations,
|
|
56
|
+
...typography.weight !== void 0 && { wght: typography.weight },
|
|
57
|
+
...typography.opticalSize?.mode === "fixed" && { opsz: typography.opticalSize.value }
|
|
58
|
+
}).toSorted(([a], [b]) => a.localeCompare(b, "en", { caseFirst: "upper" })).map(([tag, value]) => `${JSON.stringify(tag)} ${String(value)}`).join(", ");
|
|
59
|
+
const canvasFontFeatureSettings = (features) => {
|
|
60
|
+
const settings = Object.entries(features ?? {}).toSorted(([a], [b]) => a.localeCompare(b, "en")).map(([tag, value]) => `${JSON.stringify(tag)} ${String(value)}`).join(", ");
|
|
61
|
+
return settings === "" ? "normal" : settings;
|
|
62
|
+
};
|
|
63
|
+
const lineHeightDeclaration = (height) => {
|
|
64
|
+
if (height.mode === "normal") return "normal";
|
|
65
|
+
return height.mode === "percent" ? String(height.value / PERCENT$2) : height.value;
|
|
66
|
+
};
|
|
67
|
+
function canvasTypographyMetricDeclarations(typography) {
|
|
68
|
+
return {
|
|
69
|
+
...typography.lineHeight !== void 0 && { "line-height": lineHeightDeclaration(typography.lineHeight) },
|
|
70
|
+
...typography.letterSpacing !== void 0 && { "letter-spacing": typeof typography.letterSpacing === "number" ? typography.letterSpacing : `${String(typography.letterSpacing.value / PERCENT$2)}em` }
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const canvasDecorationLengthCss = (length) => {
|
|
74
|
+
if (length === void 0) return "auto";
|
|
75
|
+
if (typeof length === "number") return length;
|
|
76
|
+
return length.mode === "font-default" ? "from-font" : `${String(length.value)}%`;
|
|
77
|
+
};
|
|
78
|
+
const canvasTextDecorationDeclarations = (decoration) => ({
|
|
79
|
+
"text-decoration-line": decoration.line,
|
|
80
|
+
"text-decoration-style": decoration.style,
|
|
81
|
+
"text-decoration-color": decoration.color === void 0 ? "currentColor" : canvasColorCss(decoration.color),
|
|
82
|
+
"text-decoration-thickness": canvasDecorationLengthCss(decoration.thickness),
|
|
83
|
+
"text-underline-offset": canvasDecorationLengthCss(decoration.offset),
|
|
84
|
+
"text-decoration-skip-ink": decoration.skipInk ?? "auto"
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
18
88
|
//#region ../../packages/contract/src/recording/event-stream.lib.ts
|
|
19
89
|
/**
|
|
20
90
|
* @justified docs/comments.md#intent
|
|
@@ -867,37 +937,71 @@ const appearanceCss = (appearance) => {
|
|
|
867
937
|
...effectCss(appearance)
|
|
868
938
|
};
|
|
869
939
|
};
|
|
870
|
-
const
|
|
940
|
+
const typographyFamilyCss = (node, typography) => {
|
|
871
941
|
const result = {};
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
942
|
+
const authoredStyles = canvasAuthoredStyleDeclarations(node);
|
|
943
|
+
const families = String(authoredStyles["font-family"] ?? "sans-serif").split(",").map((family) => family.trim().replaceAll(/^(?:"|')|(?:"|')$/gu, ""));
|
|
944
|
+
if (typography.family !== void 0 || typography.fallbackFamilies !== void 0) {
|
|
945
|
+
const [family = "sans-serif", ...fallbackFamilies] = families;
|
|
946
|
+
result["font-family"] = canvasTypographyFontFamily({
|
|
947
|
+
family: typography.family ?? family,
|
|
948
|
+
fallbackFamilies: typography.fallbackFamilies ?? fallbackFamilies
|
|
949
|
+
});
|
|
950
|
+
}
|
|
876
951
|
return result;
|
|
877
952
|
};
|
|
878
|
-
const
|
|
879
|
-
const typography = node.typography ?? {};
|
|
953
|
+
const typographyFontCss = (typography) => {
|
|
880
954
|
const result = {};
|
|
881
|
-
const families = String(canvasAuthoredStyleDeclarations(node)["font-family"] ?? "sans-serif").split(",");
|
|
882
|
-
if (typography.family !== void 0 || typography.fallbackFamilies !== void 0) result["font-family"] = [typography.family ?? families[0], ...typography.fallbackFamilies ?? families.slice(1)].join(", ");
|
|
883
955
|
if (typography.size !== void 0) result["font-size"] = `${String(typography.size)}px`;
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
956
|
+
if (typography.weight !== void 0) result["font-weight"] = typography.weight;
|
|
957
|
+
if (typography.style !== void 0) result["font-style"] = typography.style;
|
|
958
|
+
if (typography.variations !== void 0 || typography.opticalSize !== void 0) result["font-variation-settings"] = canvasFontVariationSettings({
|
|
959
|
+
...typography.weight !== void 0 && { weight: typography.weight },
|
|
960
|
+
...typography.variations !== void 0 && { variations: typography.variations },
|
|
961
|
+
...typography.opticalSize !== void 0 && { opticalSize: typography.opticalSize }
|
|
962
|
+
});
|
|
963
|
+
if (typography.opticalSize !== void 0) result["font-optical-sizing"] = typography.opticalSize.mode === "auto" ? "auto" : "none";
|
|
964
|
+
if (typography.features !== void 0) result["font-feature-settings"] = canvasFontFeatureSettings(typography.features);
|
|
965
|
+
Object.assign(result, canvasTypographyMetricDeclarations(typography));
|
|
966
|
+
return result;
|
|
967
|
+
};
|
|
968
|
+
const typographyParagraphCss = (typography) => {
|
|
969
|
+
const result = {};
|
|
970
|
+
if (typography.align !== void 0) result["text-align"] = typography.align;
|
|
971
|
+
if (typography.transform !== void 0) result["text-transform"] = typography.transform;
|
|
972
|
+
Object.assign(result, canvasTextDirectionDeclarations(typography.direction));
|
|
973
|
+
if (typography.paragraphIndent !== void 0) result["text-indent"] = `${String(typography.paragraphIndent)}px each-line`;
|
|
974
|
+
if (typography.hangingPunctuation !== void 0) result["hanging-punctuation"] = "none";
|
|
975
|
+
return result;
|
|
976
|
+
};
|
|
977
|
+
const typographyVerticalCss = (typography) => {
|
|
978
|
+
const result = {};
|
|
979
|
+
if (typography.verticalAlign !== void 0 && typography.verticalAlign !== "top") {
|
|
980
|
+
result["display"] = "flex";
|
|
981
|
+
result["flex-direction"] = "column";
|
|
982
|
+
result["justify-content"] = typography.verticalAlign === "middle" ? "center" : "flex-end";
|
|
892
983
|
}
|
|
893
|
-
if (typography.
|
|
894
|
-
result["text-
|
|
895
|
-
result["text-
|
|
984
|
+
if (typography.verticalTrim !== void 0) {
|
|
985
|
+
result["text-box-trim"] = typography.verticalTrim === "cap-height" ? "trim-both" : "none";
|
|
986
|
+
result["text-box-edge"] = "cap alphabetic";
|
|
896
987
|
}
|
|
988
|
+
return result;
|
|
989
|
+
};
|
|
990
|
+
const typographyDecorationCss = (typography) => {
|
|
991
|
+
const result = {};
|
|
992
|
+
if (typography.decoration !== void 0) Object.assign(result, canvasTextDecorationDeclarations(typography.decoration));
|
|
897
993
|
if (typography.wrapping !== void 0) result["white-space"] = typography.wrapping === "wrap" ? "normal" : typography.wrapping;
|
|
994
|
+
if (typography.wrapStyle !== void 0) result["text-wrap-style"] = typography.wrapStyle;
|
|
995
|
+
return result;
|
|
996
|
+
};
|
|
997
|
+
const typographyCss = (node) => {
|
|
998
|
+
const typography = node.typography ?? {};
|
|
898
999
|
return {
|
|
899
|
-
...
|
|
900
|
-
...
|
|
1000
|
+
...typographyFamilyCss(node, typography),
|
|
1001
|
+
...typographyFontCss(typography),
|
|
1002
|
+
...typographyParagraphCss(typography),
|
|
1003
|
+
...typographyVerticalCss(typography),
|
|
1004
|
+
...typographyDecorationCss(typography)
|
|
901
1005
|
};
|
|
902
1006
|
};
|
|
903
1007
|
const computedCanvasNodeCss = (node, document) => ({
|
|
@@ -925,6 +1029,48 @@ const stringProperty = (node, property) => {
|
|
|
925
1029
|
return typeof value === "string" ? value : "";
|
|
926
1030
|
};
|
|
927
1031
|
const jsxString = (value) => `{${JSON.stringify(value)}}`;
|
|
1032
|
+
const optionalRichProperty = (value, format) => value === void 0 ? [] : [format(value)];
|
|
1033
|
+
const jsxRichTextNode = (node, depth) => {
|
|
1034
|
+
const indent = " ".repeat(depth);
|
|
1035
|
+
const content = `${indent}${jsxString(node.text)}`;
|
|
1036
|
+
return node.sourcePath === void 0 ? content : `${indent}<span data-source-path=${JSON.stringify(node.sourcePath)}>${jsxString(node.text)}</span>`;
|
|
1037
|
+
};
|
|
1038
|
+
const jsxRichBreakNode = (node, depth) => {
|
|
1039
|
+
const indent = " ".repeat(depth);
|
|
1040
|
+
const sourcePath = optionalRichProperty(node.sourcePath, (value) => `data-source-path=${JSON.stringify(value)}`).join("");
|
|
1041
|
+
return `${indent}<br data-text-break="${node.soft === true ? "line" : "paragraph"}"${sourcePath === "" ? "" : ` ${sourcePath}`} />`;
|
|
1042
|
+
};
|
|
1043
|
+
const jsxRichContainerNode = (node, depth) => {
|
|
1044
|
+
const indent = " ".repeat(depth);
|
|
1045
|
+
const properties = [
|
|
1046
|
+
...optionalRichProperty(node.sourcePath, (value) => `data-source-path=${JSON.stringify(value)}`),
|
|
1047
|
+
...optionalRichProperty(node.href, (value) => `href={${JSON.stringify(value)}}`),
|
|
1048
|
+
...optionalRichProperty(node.href, () => "rel=\"noreferrer\" target=\"_blank\""),
|
|
1049
|
+
...optionalRichProperty(Object.keys(node.styles).length === 0 ? void 0 : node.styles, (value) => `style={${JSON.stringify(value)}}`),
|
|
1050
|
+
...optionalRichProperty(node.textStyle, (value) => `data-text-style={${JSON.stringify(value)}}`),
|
|
1051
|
+
...optionalRichProperty(node.paragraph, (value) => `data-text-paragraph={${JSON.stringify(value)}}`),
|
|
1052
|
+
...optionalRichProperty(node.fills, (value) => `data-text-fills={${JSON.stringify(value)}}`),
|
|
1053
|
+
...optionalRichProperty(node.paragraphSpacing, (value) => `data-paragraph-spacing=${JSON.stringify(value)}`),
|
|
1054
|
+
...optionalRichProperty(node.paragraphIndent, (value) => `data-paragraph-indent=${JSON.stringify(value)}`),
|
|
1055
|
+
...optionalRichProperty(node.listSpacing, (value) => `data-list-spacing=${JSON.stringify(value)}`),
|
|
1056
|
+
...optionalRichProperty(node.hangingPunctuation, (value) => `data-hanging-punctuation=${JSON.stringify(value)}`),
|
|
1057
|
+
...optionalRichProperty(node.verticalTrim, (value) => `data-vertical-trim=${JSON.stringify(value)}`),
|
|
1058
|
+
...optionalRichProperty(node.wrapStyle, (value) => `data-wrap-style=${JSON.stringify(value)}`)
|
|
1059
|
+
];
|
|
1060
|
+
const tag = node.href === void 0 ? "span" : "a";
|
|
1061
|
+
const children = node.children.map((child) => jsxRichNode(child, depth + 1));
|
|
1062
|
+
return [
|
|
1063
|
+
`${indent}<${tag}${properties.length === 0 ? "" : ` ${properties.join(" ")}`}>`,
|
|
1064
|
+
...children,
|
|
1065
|
+
`${indent}</${tag}>`
|
|
1066
|
+
].join("\n");
|
|
1067
|
+
};
|
|
1068
|
+
const jsxRichNode = (node, depth) => {
|
|
1069
|
+
if (node.kind === "text") return jsxRichTextNode(node, depth);
|
|
1070
|
+
if (node.kind === "break") return jsxRichBreakNode(node, depth);
|
|
1071
|
+
return jsxRichContainerNode(node, depth);
|
|
1072
|
+
};
|
|
1073
|
+
const jsxRichText = (node, depth) => canvasTextRunsOf(node).map((run) => jsxRichNode(run, depth)).join("\n");
|
|
928
1074
|
const jsxFor = (document, nodeId, depth, maximumDepth) => {
|
|
929
1075
|
const node = requireNode(document, nodeId);
|
|
930
1076
|
const indent = " ".repeat(depth);
|
|
@@ -937,7 +1083,7 @@ const jsxFor = (document, nodeId, depth, maximumDepth) => {
|
|
|
937
1083
|
if (node.component === "image") return `${indent}<img ${properties.join(" ")} alt=${JSON.stringify(stringProperty(node, "alt"))} src=${JSON.stringify(stringProperty(node, "src"))} />`;
|
|
938
1084
|
if (node.component === "svg") return `${indent}<div ${properties.join(" ")} data-component="svg" />`;
|
|
939
1085
|
const tag = node.component === "text" ? "span" : "div";
|
|
940
|
-
const text = node.component === "text" ?
|
|
1086
|
+
const text = node.component === "text" ? jsxRichText(node, depth + 1) : "";
|
|
941
1087
|
const children = (depth >= maximumDepth ? [] : childrenOf(document, nodeId)).map((childId) => jsxFor(document, childId, depth + 1, maximumDepth));
|
|
942
1088
|
if (text === "" && children.length === 0) return `${indent}<${tag} ${properties.join(" ")} />`;
|
|
943
1089
|
return [
|
|
@@ -2175,7 +2321,7 @@ const main = async () => {
|
|
|
2175
2321
|
const credentials = createFileCredentialAdapter(CLI_CONFIG.configDirectory);
|
|
2176
2322
|
const mutationKey = createMutationKeyAdapter();
|
|
2177
2323
|
const cli = createCliProgram({
|
|
2178
|
-
version: "0.1.
|
|
2324
|
+
version: "0.1.21",
|
|
2179
2325
|
credentials,
|
|
2180
2326
|
remote: createHttpRemoteAdapter(CLI_CONFIG.apiUrl, credentials, mutationKey),
|
|
2181
2327
|
mutationKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as toFailurePayload } from "./cli-output-identity.lib-
|
|
3
|
-
import { a as createOauthLoopbackAdapter, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-
|
|
2
|
+
import { o as toFailurePayload } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
+
import { a as createOauthLoopbackAdapter, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-x3QOYrKY.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/infrastructure/mcp-auth.adapter.ts
|
package/dist/mcp-main.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { d as createCapabilityCatalogAdapter, m as toCapabilityDefinition } from "./cli-output-identity.lib-
|
|
3
|
-
import { r as CLI_CONFIG } from "./mutation-key.adapter-
|
|
2
|
+
import { d as createCapabilityCatalogAdapter, m as toCapabilityDefinition } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
+
import { r as CLI_CONFIG } from "./mutation-key.adapter-x3QOYrKY.mjs";
|
|
4
4
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-rI5HpMEo.mjs";
|
|
5
|
-
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
6
|
-
import { t as createMcpServerAdapter } from "./mcp-server.adapter-
|
|
5
|
+
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-NrVhm7y8.mjs";
|
|
6
|
+
import { t as createMcpServerAdapter } from "./mcp-server.adapter-Cgp05gfi.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import process from "node:process";
|
|
9
9
|
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
@@ -152,7 +152,7 @@ const capabilities = [
|
|
|
152
152
|
exampleInput: {},
|
|
153
153
|
exampleOutput: {
|
|
154
154
|
status: "ok",
|
|
155
|
-
runtimeVersion: "0.1.
|
|
155
|
+
runtimeVersion: "0.1.21",
|
|
156
156
|
api: {
|
|
157
157
|
reachable: true,
|
|
158
158
|
status: 200
|
|
@@ -167,10 +167,10 @@ const createMcpTransportCapabilityAdapter = () => capabilities;
|
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region src/mcp-main.ts
|
|
169
169
|
const credentials = createFileCredentialAdapter(CLI_CONFIG.configDirectory);
|
|
170
|
-
const invocation = createMcpInvocationAdapter(CLI_CONFIG.apiUrl, credentials, CLI_CONFIG.configDirectory, "0.1.
|
|
170
|
+
const invocation = createMcpInvocationAdapter(CLI_CONFIG.apiUrl, credentials, CLI_CONFIG.configDirectory, "0.1.21");
|
|
171
171
|
const catalog = [...createCapabilityCatalogAdapter(), ...createMcpTransportCapabilityAdapter()];
|
|
172
172
|
serveStdio(() => createMcpServerAdapter({
|
|
173
|
-
version: "0.1.
|
|
173
|
+
version: "0.1.21",
|
|
174
174
|
name: CLI_CONFIG.mcpServiceName,
|
|
175
175
|
commandName: CLI_CONFIG.commandName,
|
|
176
176
|
invocation,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as parseCanvasReference, E as assertCanvasReferenceNodes, M as CliError,
|
|
2
|
+
import { A as parseCanvasReference, E as assertCanvasReferenceNodes, M as CliError, Tt as canvasReadableSceneDocumentSchema, ct as getCanvasDocumentOutputSchema, d as createCapabilityCatalogAdapter, i as toCanvasAuthoringResult, l as createMcpCapabilityDiscoveryAdapter, n as withCommandName, o as toFailurePayload, r as canvasRenderResultSchema, s as toPresentedCapabilities, t as withCommandInFailure, vt as canvasRenderSourceStateSchema, w as canvasEditCapabilityInputSchema, y as canvasWriteHtmlCapabilityInputSchema, yt as canvasRenderTargetSchema } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { readFile, rm } from "node:fs/promises";
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as toSharedCapabilities, d as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-
|
|
2
|
+
import { c as toSharedCapabilities, d as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-a1wTreJ6.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-Cgp05gfi.mjs";
|
|
5
5
|
|
|
6
6
|
export { createCapabilityCatalogAdapter, createMcpServerAdapter as createEnhanceMcpServer, toCapabilityInventory, toSharedCapabilities };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as parseCanvasReference,
|
|
2
|
+
import { A as parseCanvasReference, B as PROTOTYPE_ARTIFACT_MANIFEST_PATH, C as transcriptReadCapabilityInputSchema, Ct as downloadCanvasRenderOutputSchema, D as assertCanvasReferenceOperations, E as assertCanvasReferenceNodes, G as getPrototypePublishStatusOutputSchema, H as createPrototypeArtifactOutputSchema, J as submitPrototypeArtifactOutputSchema, K as prototypeArtifactManifestSchema, M as CliError, N as transcriptOutputSchema, Ot as canvasAxisStyleProperties, Q as createAgentTokenOutputSchema, S as recordingSnapshotCapabilityInputSchema, St as createRecordingSnapshotOutputSchema, Tt as canvasReadableSceneDocumentSchema, U as foldPrototypeArtifactPath, V as attachPrototypeArtifactOutputSchema, W as getPrototypeArtifactCapabilitiesOutputSchema, Y as getMeOutputSchema, Z as cliAuthConfigurationSchema, _ as canvasApplyCapabilityInputSchema, at as beginCanvasActivityOutputSchema, b as commentAttentionCapabilityInputSchema, ct as getCanvasDocumentOutputSchema, dt as applyCanvasOperationsInputSchema, ft as applyCanvasOperationsOutputSchema, gt as getCanvasConversionOutputSchema, ht as createCanvasConversionOutputSchema, j as PartialBatchError, jt as canvasAdditionalStyleSchema, mt as canvasNodeStylePatchSchema, nt as applyCanvasTypographyPatch, q as prototypeArtifactPathSchema, rt as canvasCssTypographyOwners, st as canvasLayoutWithoutCssProperties, ut as MAX_CANVAS_OPERATIONS, v as canvasRenderCapabilityInputSchema, w as canvasEditCapabilityInputSchema, wt as getCanvasRenderOutputSchema, x as prototypePublishCapabilityInputSchema, xt as createCanvasRenderOutputSchema, y as canvasWriteHtmlCapabilityInputSchema } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { homedir, tmpdir } from "node:os";
|
|
5
5
|
import process from "node:process";
|
package/dist/remote-mcp-main.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { X as MCP_AUTH_SCOPE, Y as getMeOutputSchema, d as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-
|
|
3
|
-
import { i as readRemoteMcpEnvironment, n as createHttpRemoteAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-
|
|
4
|
-
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
5
|
-
import { t as createMcpServerAdapter } from "./mcp-server.adapter-
|
|
2
|
+
import { X as MCP_AUTH_SCOPE, Y as getMeOutputSchema, d as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
+
import { i as readRemoteMcpEnvironment, n as createHttpRemoteAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-x3QOYrKY.mjs";
|
|
4
|
+
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-NrVhm7y8.mjs";
|
|
5
|
+
import { t as createMcpServerAdapter } from "./mcp-server.adapter-Cgp05gfi.mjs";
|
|
6
6
|
import os from "node:os";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import path from "node:path";
|
|
@@ -145,7 +145,7 @@ const server = await createRemoteMcpHttpAdapter({
|
|
|
145
145
|
configDirectory: path.join(os.tmpdir(), "enhance-remote-mcp"),
|
|
146
146
|
allowedHosts: config.MCP_ALLOWED_HOSTS.split(",").map((value) => value.trim()),
|
|
147
147
|
allowedOrigins: config.MCP_ALLOWED_ORIGINS.split(",").map((value) => value.trim()),
|
|
148
|
-
version: "0.1.
|
|
148
|
+
version: "0.1.21",
|
|
149
149
|
onerror: (error) => process.stderr.write(`${error.message}\n`)
|
|
150
150
|
});
|
|
151
151
|
await server.listen(config.PORT, config.MCP_HOST);
|