@popcraft/kit 0.32.1 → 0.33.0

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.
Files changed (55) hide show
  1. package/dist/chunks/{agent-BJ2DUSN5.js → agent-INS2VFTM.js} +1 -1
  2. package/dist/chunks/{builtin-6YOQKBTP.js → builtin-K5D3F5VW.js} +3 -3
  3. package/dist/chunks/{check-template-SZYRRONC.js → check-template-DECKUVV3.js} +2 -2
  4. package/dist/chunks/{chunk-KF7IAEKC.js → chunk-2H7GKDYE.js} +2 -2
  5. package/dist/chunks/{chunk-CF5ILIUY.js → chunk-3AA5RPZO.js} +3 -1
  6. package/dist/chunks/{chunk-UGIA32PT.js → chunk-4KCZGABV.js} +7 -7
  7. package/dist/chunks/{chunk-XPVDBNN7.js → chunk-4PLFCL2J.js} +5 -5
  8. package/dist/chunks/{chunk-AMASMLKC.js → chunk-5LJTWDUC.js} +3 -3
  9. package/dist/chunks/{chunk-CY7BJ44V.js → chunk-5QWAEANA.js} +2 -2
  10. package/dist/chunks/{chunk-NG47WAKE.js → chunk-DWIBBBCU.js} +2 -2
  11. package/dist/chunks/{chunk-SRUEQEFF.js → chunk-HQ3TFBUQ.js} +4 -4
  12. package/dist/chunks/{chunk-WAPCCKYL.js → chunk-M34FFS25.js} +5 -5
  13. package/dist/chunks/{chunk-J4NIZA24.js → chunk-N4GSVY3T.js} +5 -5
  14. package/dist/chunks/{chunk-X5KSYJ7D.js → chunk-OMLK7QUV.js} +3 -3
  15. package/dist/chunks/{chunk-MJKABEVI.js → chunk-OZ5SGNT6.js} +47 -44
  16. package/dist/chunks/{chunk-5EL7TNOH.js → chunk-QDDVKMU3.js} +2 -2
  17. package/dist/chunks/{chunk-AOJ2PM6I.js → chunk-QDYMLYUJ.js} +1 -1
  18. package/dist/chunks/{chunk-DC2GLAGS.js → chunk-VNNHBYH6.js} +1 -1
  19. package/dist/chunks/{chunk-HW5J5ORB.js → chunk-WATJYTA7.js} +1 -1
  20. package/dist/chunks/{chunk-4LCHHJWS.js → chunk-XIUSFWBF.js} +4 -4
  21. package/dist/chunks/{chunk-IK2PKTKB.js → chunk-ZYHV7ER3.js} +11 -11
  22. package/dist/chunks/{client-LPJDCD5F.js → client-43AHVLCY.js} +2 -2
  23. package/dist/chunks/{client-EHI36M6L.js → client-AYRJ5F22.js} +2 -2
  24. package/dist/chunks/{client-N653QTI4.js → client-B4O7QODL.js} +1 -1
  25. package/dist/chunks/{client-actions-T6MVTJDM.js → client-actions-OCPW4GDM.js} +4 -4
  26. package/dist/chunks/{dangerous-SUZWVVZD.js → dangerous-XPNRD5YD.js} +3 -3
  27. package/dist/chunks/{editor-seams-W6OQMZKZ.js → editor-seams-BLO2WFX5.js} +9 -9
  28. package/dist/chunks/{editor-store-27CIM6LZ.js → editor-store-N4QAPXJK.js} +1 -1
  29. package/dist/chunks/{export-watermark-KCPUTXV3.js → export-watermark-5GGBVSSF.js} +5 -5
  30. package/dist/chunks/{eyedropper-NGCL7DYV.js → eyedropper-BI5CGCEZ.js} +1 -1
  31. package/dist/chunks/{generate-media-2LELZC7F.js → generate-media-AOLKNXO2.js} +2 -2
  32. package/dist/chunks/{host-X2TQVN4Y.js → host-54767RAK.js} +6 -6
  33. package/dist/chunks/{integrations-VB7YBM54.js → integrations-RPVK7WIP.js} +1 -1
  34. package/dist/chunks/{libraries-PF6ZSTVY.js → libraries-QUWA6635.js} +5 -5
  35. package/dist/chunks/{live-MT5FO6LU.js → live-W3L2QOKK.js} +1 -1
  36. package/dist/chunks/{media-tool-FHI55M4F.js → media-tool-QYKQESSE.js} +1 -1
  37. package/dist/chunks/{new-file-IWGXAHIL.js → new-file-363LMZ7Q.js} +3 -3
  38. package/dist/chunks/{plugin-QLC7IIJZ.js → plugin-T65VSRKU.js} +2 -2
  39. package/dist/chunks/{plugin-import-7V2P7SYA.js → plugin-import-3SI4HULY.js} +13 -13
  40. package/dist/chunks/{presence-NREBIJAC.js → presence-IXAK63HX.js} +2 -2
  41. package/dist/chunks/{project-5EPDN5DD.js → project-HCE2D547.js} +1 -1
  42. package/dist/chunks/{publish-site-R4HDTNC4.js → publish-site-APABRUKO.js} +6 -6
  43. package/dist/chunks/{publish-store-NPODVM33.js → publish-store-TMX234D7.js} +4 -4
  44. package/dist/chunks/{raster-actions-Y4OO44Y5.js → raster-actions-TJTYOBQK.js} +1 -1
  45. package/dist/chunks/{runner-GYU2CGZU.js → runner-35RCNWBN.js} +16 -16
  46. package/dist/chunks/{store-XIDFBLAX.js → store-ODXPCKX2.js} +5 -5
  47. package/dist/chunks/{sync-SCD4Z3UQ.js → sync-K25HHGBW.js} +5 -5
  48. package/dist/chunks/{tabs-MKGZODKR.js → tabs-WBH6CHXA.js} +8 -8
  49. package/dist/chunks/{team-QKPKTYKG.js → team-APHDHPSI.js} +1 -1
  50. package/dist/chunks/{team-client-NPVN22NY.js → team-client-NCOFAD7O.js} +1 -1
  51. package/dist/chunks/{tools-3GKOEALA.js → tools-VJRKQRZE.js} +2 -2
  52. package/dist/chunks/{ui-commands-2UCZONZL.js → ui-commands-CODRAWFC.js} +11 -11
  53. package/dist/chunks/{versions-VRUI43E6.js → versions-22NOIGED.js} +5 -5
  54. package/dist/index.js +1 -1
  55. package/package.json +1 -1
@@ -864,7 +864,7 @@ init_scene_graph();
864
864
  var licence = external_exports.enum(["commercial", "any"]).optional().describe("commercial (default): only licences that allow commercial use and edits (CC0, public domain, CC BY, CC BY-SA). any: every Creative Commons licence, including NC and ND.");
865
865
  var brief2 = (p) => ({ id: p.id, title: p.title, creator: p.credit.creator, licence: licenceLabel(p.credit), width: p.width, height: p.height, source: p.credit.sourceUrl });
866
866
  async function placeImportedPicture(ctx, imported, at, what, extra = {}) {
867
- const client = await import("./client-N653QTI4.js");
867
+ const client = await import("./client-B4O7QODL.js");
868
868
  if (at.fillLayerId) {
869
869
  const doc2 = ctx.doc();
870
870
  const target = nodeOrThrow(doc2, at.fillLayerId);
@@ -910,7 +910,7 @@ var photoSearch = defineCommand({
910
910
  }
911
911
  },
912
912
  run: async (args) => {
913
- const { searchStockPhotos } = await import("./client-N653QTI4.js");
913
+ const { searchStockPhotos } = await import("./client-B4O7QODL.js");
914
914
  const page = await searchStockPhotos(args.query, args.page ?? 1, { licence: args.licence });
915
915
  return {
916
916
  summary: `${page.results.length} photo${page.results.length === 1 ? "" : "s"} for \u201C${page.query}\u201D (page ${page.page} of ${page.pageCount || 1})`,
@@ -944,7 +944,7 @@ var photoInsert = defineCommand({
944
944
  run: async (args, ctx) => {
945
945
  if (!args.id && !args.query) throw new ToolError("Pass an id from search_photos, or a query.");
946
946
  if (args.id && !isPhotoId(args.id)) throw new ToolError(`"${args.id}" is not a photo id from search_photos.`);
947
- const client = await import("./client-N653QTI4.js");
947
+ const client = await import("./client-B4O7QODL.js");
948
948
  let photo;
949
949
  if (args.id) photo = await client.stockPhotoInfo(args.id);
950
950
  else {
@@ -982,7 +982,7 @@ var mediaList = defineCommand({
982
982
  }
983
983
  },
984
984
  run: async (args) => {
985
- const { listLibraryMedia } = await import("./client-EHI36M6L.js");
985
+ const { listLibraryMedia } = await import("./client-AYRJ5F22.js");
986
986
  const page = await listLibraryMedia(args);
987
987
  return { summary: `${page.items.length} media item${page.items.length === 1 ? "" : "s"}${page.nextCursor ? " (more)" : ""}`, data: { workspaceId: page.workspaceId, items: page.items.map(brief3), nextCursor: page.nextCursor } };
988
988
  }
@@ -1013,7 +1013,7 @@ var mediaInsert = defineCommand({
1013
1013
  run: async (args, ctx) => {
1014
1014
  const contentType = args.contentType ?? "image/*";
1015
1015
  if (!contentType.startsWith("image/")) throw new ToolError("insert_media places pictures; this item is not one.");
1016
- const { importLibraryPicture } = await import("./client-EHI36M6L.js");
1016
+ const { importLibraryPicture } = await import("./client-AYRJ5F22.js");
1017
1017
  const item = { hash: args.hash, fileKey: args.fileKey, fileName: args.name ?? "Media", contentType, size: 0, createdAt: "", fileCount: 1, source: null };
1018
1018
  const imported = await importLibraryPicture(item);
1019
1019
  return placeImportedPicture(ctx, imported, args, `\u201C${imported.name}\u201D`, { hash: imported.hash });
@@ -1034,7 +1034,7 @@ var mediaDownload = defineCommand({
1034
1034
  // The Library's right-click menu: saves the item's file to the computer.
1035
1035
  expose: { ui: { label: "Download", palette: false } },
1036
1036
  run: async (args) => {
1037
- const { libraryBlob, libraryFileName } = await import("./client-EHI36M6L.js");
1037
+ const { libraryBlob, libraryFileName } = await import("./client-AYRJ5F22.js");
1038
1038
  const { downloadBlob } = await import("./download-CSO5TEOD.js");
1039
1039
  const item = { hash: args.hash, fileKey: args.fileKey, fileName: args.name ?? "media", contentType: args.contentType ?? "", size: 0, createdAt: "", fileCount: 1, source: null };
1040
1040
  const blob = await libraryBlob(item);
@@ -1065,7 +1065,7 @@ var mediaDelete = defineCommand({
1065
1065
  }
1066
1066
  },
1067
1067
  run: async (args) => {
1068
- const { deleteLibraryMedia } = await import("./client-EHI36M6L.js");
1068
+ const { deleteLibraryMedia } = await import("./client-AYRJ5F22.js");
1069
1069
  const out = await deleteLibraryMedia(args.workspace, args.hash);
1070
1070
  return { summary: `Deleted it from the library (it was in ${out.files} file${out.files === 1 ? "" : "s"})`, data: out };
1071
1071
  }
@@ -1079,13 +1079,13 @@ async function signedIn() {
1079
1079
  }
1080
1080
  async function publishedFile() {
1081
1081
  await signedIn();
1082
- const { openFileKey } = await import("./publish-site-R4HDTNC4.js");
1082
+ const { openFileKey } = await import("./publish-site-APABRUKO.js");
1083
1083
  const key = openFileKey();
1084
1084
  if (!key) throw new CommandError("This file is not saved to the cloud yet, so it has no site. Publish it first.", "failed");
1085
1085
  return key;
1086
1086
  }
1087
1087
  async function formsWithoutDatabase(key) {
1088
- const [{ useEditorStore }, { usesForms, formsGoNowhere }, { siteBackend }] = await Promise.all([import("./editor-store-27CIM6LZ.js"), import("./backend-CG33YQA2.js"), import("./integrations-VB7YBM54.js")]);
1088
+ const [{ useEditorStore }, { usesForms, formsGoNowhere }, { siteBackend }] = await Promise.all([import("./editor-store-N4QAPXJK.js"), import("./backend-CG33YQA2.js"), import("./integrations-RPVK7WIP.js")]);
1089
1089
  const doc2 = useEditorStore.getState().document;
1090
1090
  if (!usesForms(doc2)) return false;
1091
1091
  return formsGoNowhere(doc2, await siteBackend(key).catch(() => void 0));
@@ -1121,7 +1121,7 @@ var publishSite = defineCommand({
1121
1121
  const { cleanSlug } = await import("./rules-DLAY3QRP.js");
1122
1122
  const address = p.address === void 0 ? void 0 : cleanSlug(p.address);
1123
1123
  if (address === null) throw new CommandError("That cannot be a site address: use 3 to 40 letters, digits and dashes.", "invalid_params");
1124
- const { publishOpenFile, NoScreens } = await import("./publish-site-R4HDTNC4.js");
1124
+ const { publishOpenFile, NoScreens } = await import("./publish-site-APABRUKO.js");
1125
1125
  try {
1126
1126
  const done = await publishOpenFile(address);
1127
1127
  ctx.notice(`Published version ${done.version}: ${done.url}`);
@@ -1176,7 +1176,7 @@ var publishListSites = defineCommand({
1176
1176
  },
1177
1177
  run: async (p) => {
1178
1178
  await signedIn();
1179
- const [{ workspaceSites }, { activeTeamWorkspaceId, useHyperyTeam }] = await Promise.all([import("./sites-XV7IK35R.js"), import("./team-QKPKTYKG.js")]);
1179
+ const [{ workspaceSites }, { activeTeamWorkspaceId, useHyperyTeam }] = await Promise.all([import("./sites-XV7IK35R.js"), import("./team-APHDHPSI.js")]);
1180
1180
  const workspaceId = p.workspaceId ?? activeTeamWorkspaceId() ?? useHyperyTeam.getState().personalWorkspaceId;
1181
1181
  if (!workspaceId) throw new CommandError("Your workspaces have not loaded yet. Try again in a moment.", "failed");
1182
1182
  const out = await workspaceSites(workspaceId);
@@ -1225,12 +1225,12 @@ var publishStatus = defineCommand({
1225
1225
  },
1226
1226
  run: async () => {
1227
1227
  await signedIn();
1228
- const [{ openFileKey }, { siteStatus }] = await Promise.all([import("./publish-site-R4HDTNC4.js"), import("./sites-XV7IK35R.js")]);
1228
+ const [{ openFileKey }, { siteStatus }] = await Promise.all([import("./publish-site-APABRUKO.js"), import("./sites-XV7IK35R.js")]);
1229
1229
  const key = openFileKey();
1230
1230
  const status = await siteStatus(key);
1231
1231
  const site = status.site;
1232
- const backend = key ? await (await import("./integrations-VB7YBM54.js")).siteBackend(key).catch(() => null) : null;
1233
- const destinations = key ? await (await import("./integrations-VB7YBM54.js")).listDestinations(key).catch(() => []) : [];
1232
+ const backend = key ? await (await import("./integrations-RPVK7WIP.js")).siteBackend(key).catch(() => null) : null;
1233
+ const destinations = key ? await (await import("./integrations-RPVK7WIP.js")).listDestinations(key).catch(() => []) : [];
1234
1234
  return {
1235
1235
  summary: !status.configured ? "This server does not publish websites" : !site ? "Not published yet" : site.currentVersion === null ? `Offline (${site.versions.length} versions kept) \u2014 ${site.url}` : `Version ${site.currentVersion} is online at ${site.url}`,
1236
1236
  data: { ...statusData(status), database: backend?.database ? { provider: backend.database.connection.provider, account: backend.database.connection.account, target: backend.database.target.map((t) => t.name), visitorsCanSignIn: backend.database.signIn } : null, destinations: destinations.map((d) => ({ destinationId: d.id, provider: d.connection.provider, account: d.connection.account, kind: d.capability, target: d.target.map((t) => t.name), lastSent: d.lastDeploy })) }
@@ -1261,7 +1261,7 @@ var publishStore = defineCommand({
1261
1261
  },
1262
1262
  run: async (p, ctx) => {
1263
1263
  await signedIn();
1264
- const { deployOpenStore } = await import("./publish-store-NPODVM33.js");
1264
+ const { deployOpenStore } = await import("./publish-store-TMX234D7.js");
1265
1265
  const done = await deployOpenStore(ctx.doc(), ctx.pageId(), { destinationId: p.destinationId }).catch((e) => {
1266
1266
  throw new CommandError(e instanceof Error ? e.message : String(e), "failed");
1267
1267
  });
@@ -1290,7 +1290,7 @@ var integrationList = defineCommand({
1290
1290
  }
1291
1291
  },
1292
1292
  run: async ({ capability }) => {
1293
- const [{ cloudUser }, { integrationsWorkspaceId, listWorkspaceIntegrations }] = await Promise.all([import("./session-HPSDXOSY.js"), import("./integrations-VB7YBM54.js")]);
1293
+ const [{ cloudUser }, { integrationsWorkspaceId, listWorkspaceIntegrations }] = await Promise.all([import("./session-HPSDXOSY.js"), import("./integrations-RPVK7WIP.js")]);
1294
1294
  if (!cloudUser()) throw new CommandError("You are not signed in: integrations belong to your account's workspace.", "denied");
1295
1295
  const workspaceId = integrationsWorkspaceId();
1296
1296
  if (!workspaceId) throw new CommandError("Your workspaces have not loaded yet. Try again in a moment.", "failed");
@@ -1331,7 +1331,7 @@ var integrationOpen = defineCommand({
1331
1331
  }
1332
1332
  });
1333
1333
  async function openFile() {
1334
- const [{ cloudUser }, { openFileKey }] = await Promise.all([import("./session-HPSDXOSY.js"), import("./publish-site-R4HDTNC4.js")]);
1334
+ const [{ cloudUser }, { openFileKey }] = await Promise.all([import("./session-HPSDXOSY.js"), import("./publish-site-APABRUKO.js")]);
1335
1335
  if (!cloudUser()) throw new CommandError("You are not signed in.", "denied");
1336
1336
  const key = openFileKey();
1337
1337
  if (!key) throw new CommandError("This file is not saved to the cloud yet. Publish it first (publish_site).", "failed");
@@ -1357,7 +1357,7 @@ var integrationListResources = defineCommand({
1357
1357
  }
1358
1358
  },
1359
1359
  run: async ({ connectionId, capability, path }) => {
1360
- const { listResources } = await import("./integrations-VB7YBM54.js");
1360
+ const { listResources } = await import("./integrations-RPVK7WIP.js");
1361
1361
  const list = await listResources(connectionId, capability, asPath2(path));
1362
1362
  return {
1363
1363
  summary: list.level ? `${list.resources.length} at the ${list.level.label.toLowerCase()} level${list.canCreate ? " (a new one can be made)" : ""}` : "Nothing further to pick: the path is complete",
@@ -1392,7 +1392,7 @@ var integrationAddDestination = defineCommand({
1392
1392
  },
1393
1393
  run: async (p, ctx) => {
1394
1394
  const key = await openFile();
1395
- const { addDestination, createDestination, createResource } = await import("./integrations-VB7YBM54.js");
1395
+ const { addDestination, createDestination, createResource } = await import("./integrations-RPVK7WIP.js");
1396
1396
  let made;
1397
1397
  if (p.create) made = await createDestination(key, p.capability, void 0, p.connectionId);
1398
1398
  else {
@@ -1429,7 +1429,7 @@ var integrationDeploy = defineCommand({
1429
1429
  },
1430
1430
  run: async (p, ctx) => {
1431
1431
  const key = await openFile();
1432
- const { deployDestination, listDestinations } = await import("./integrations-VB7YBM54.js");
1432
+ const { deployDestination, listDestinations } = await import("./integrations-RPVK7WIP.js");
1433
1433
  const all = await listDestinations(key);
1434
1434
  const dest = p.destinationId ? all.find((d) => d.id === p.destinationId) : all.length === 1 ? all[0] : void 0;
1435
1435
  if (!dest) throw new CommandError(all.length ? `Say which destination: ${all.map((d) => `${d.id} (${d.target.map((t) => t.name).join(" / ")})`).join(", ")}.` : "This file has no destination yet. Add one first (add_site_destination).", "invalid_params");
@@ -1463,7 +1463,7 @@ var integrationAttachDatabase = defineCommand({
1463
1463
  },
1464
1464
  run: async (p, ctx) => {
1465
1465
  const key = await openFile();
1466
- const { attachDatabase, createDatabase, createResource, listResources } = await import("./integrations-VB7YBM54.js");
1466
+ const { attachDatabase, createDatabase, createResource, listResources } = await import("./integrations-RPVK7WIP.js");
1467
1467
  if (p.create) return attached(await createDatabase(key, void 0, p.connectionId), ctx);
1468
1468
  if (!p.connectionId || !p.target) throw new CommandError("Say connectionId and target, or create: true.", "invalid_params");
1469
1469
  let target = asPath2(p.target);
@@ -1502,7 +1502,7 @@ var integrationSubmissions = defineCommand({
1502
1502
  },
1503
1503
  run: async ({ form, limit }) => {
1504
1504
  const key = await openFile();
1505
- const { listSubmissions } = await import("./integrations-VB7YBM54.js");
1505
+ const { listSubmissions } = await import("./integrations-RPVK7WIP.js");
1506
1506
  const rows = await listSubmissions(key, { form, limit: limit ?? 20 });
1507
1507
  return { summary: rows.length ? `${rows.length} ${rows.length === 1 ? "submission" : "submissions"}, the newest ${new Date(rows[0].createdAt).toISOString()}` : "Nothing has been sent yet", data: { submissions: rows } };
1508
1508
  }
@@ -1527,7 +1527,7 @@ var integrationSetSignIn = defineCommand({
1527
1527
  },
1528
1528
  run: async ({ on }, ctx) => {
1529
1529
  const key = await openFile();
1530
- const { setSignIn } = await import("./integrations-VB7YBM54.js");
1530
+ const { setSignIn } = await import("./integrations-RPVK7WIP.js");
1531
1531
  const done = await setSignIn(key, on);
1532
1532
  ctx.notice(on ? "Visitors can sign in." : "Sign-in is off.");
1533
1533
  return { summary: on ? "Visitors can now create accounts and sign in on the published site" : "Sign-in is off for the published site", data: { signIn: !!done.database?.signIn } };
@@ -1554,7 +1554,11 @@ async function fontBytes(args, ctx) {
1554
1554
  }
1555
1555
  } else if (args.src) {
1556
1556
  const { isMediaUrl, loadMediaBlob } = await import("./media-store-AFWF72EA.js");
1557
- if (isMediaUrl(args.src)) {
1557
+ if (isMediaUrl(args.src) && ctx.can("media")) {
1558
+ const bytes = await ctx.use("media").read(args.src);
1559
+ if (!bytes) throw new CommandError(`${args.src} is not in this file's media: upload it first (POST /files/{key}/media).`, "not_found");
1560
+ got = { bytes };
1561
+ } else if (isMediaUrl(args.src)) {
1558
1562
  const blob = await loadMediaBlob(args.src);
1559
1563
  if (!blob) throw new CommandError(`${args.src} is not on this device.`, "not_found");
1560
1564
  got = { bytes: new Uint8Array(await blob.arrayBuffer()) };
@@ -1621,7 +1625,7 @@ var fontAdd = defineCommand({
1621
1625
  params: external_exports.object({
1622
1626
  family: external_exports.string().trim().min(1).max(200).optional().describe("The family name texts will use (default: the name in the file). Texts set in it draw in this file."),
1623
1627
  file: external_exports.string().min(1).max(4096).optional().describe("A font file on this machine, read by the CLI: .ttf, .otf, .ttc, .woff or .woff2."),
1624
- src: external_exports.string().max(MAX_SRC).optional().describe("The font file as a base64 data URL, or a media:// ref already on this device."),
1628
+ src: external_exports.string().max(MAX_SRC).optional().describe("The font file as a base64 data URL, or a media:// ref already on this device (through the API: already uploaded to the file's media)."),
1625
1629
  weight: external_exports.number().int().min(1).max(1e3).optional().describe("The weight this face stands for (default: the file's)."),
1626
1630
  style: external_exports.enum(["normal", "italic"]).optional().describe("normal or italic (default: the file's)."),
1627
1631
  face: faceParam.optional()
@@ -1636,10 +1640,9 @@ var fontAdd = defineCommand({
1636
1640
  run: async (args, ctx) => {
1637
1641
  const { bytes, fileName: fileName2 } = await fontBytes(args, ctx);
1638
1642
  const { face, family, weight, style, info } = await resolveFace(bytes, args);
1639
- const { internBytes } = await import("./media-store-AFWF72EA.js");
1640
1643
  const { fontMime } = await import("./sfnt-LL4BE4SI.js");
1641
1644
  const { addDocumentFont } = await import("../lib/fonts/document-fonts.js");
1642
- const src = internBytes(bytes, fontMime(bytes));
1645
+ const src = ctx.can("media") ? await ctx.use("media").store(bytes, fontMime(bytes)) : (await import("./media-store-AFWF72EA.js")).internBytes(bytes, fontMime(bytes));
1643
1646
  const font = {
1644
1647
  id: `font-${src.slice(8, 20)}-${face.index}-${weight}-${style === "italic" ? "i" : "n"}`,
1645
1648
  family,
@@ -1742,7 +1745,7 @@ var fontTeamList = defineCommand({
1742
1745
  agent: { name: "list_team_fonts", readOnly: true, description: "The team's fonts: faces uploaded once that every file of the team can use (family, weight, style)." }
1743
1746
  },
1744
1747
  run: async (args) => {
1745
- const { refreshTeamFonts } = await import("./team-client-NPVN22NY.js");
1748
+ const { refreshTeamFonts } = await import("./team-client-NCOFAD7O.js");
1746
1749
  const fonts = await refreshTeamFonts(args.workspace);
1747
1750
  return { summary: plural(fonts.length, "team font"), data: { fonts: fonts.map((f) => ({ id: f.id, family: f.family, weight: f.weight, style: f.style, face: f.face, fileName: f.fileName })) } };
1748
1751
  }
@@ -1769,7 +1772,7 @@ var fontTeamAdd = defineCommand({
1769
1772
  run: async (args, ctx) => {
1770
1773
  const { bytes, fileName: fileName2 } = await fontBytes(args, ctx);
1771
1774
  const { face, family, weight, style } = await resolveFace(bytes, args);
1772
- const { uploadTeamFont } = await import("./team-client-NPVN22NY.js");
1775
+ const { uploadTeamFont } = await import("./team-client-NCOFAD7O.js");
1773
1776
  const font = await uploadTeamFont(bytes, { family, weight, style, face: face.index, fileName: fileName2 }, args.workspace);
1774
1777
  return { summary: `Added ${family} ${weight}${style === "italic" ? " italic" : ""} to the team`, data: { font } };
1775
1778
  }
@@ -1791,7 +1794,7 @@ var fontTeamRemove = defineCommand({
1791
1794
  agent: { name: "remove_team_font", description: "Remove a font from the team (list_team_fonts). Files that use it fall back to another font unless they carry it themselves. The user approves every call." }
1792
1795
  },
1793
1796
  run: async (args) => {
1794
- const { removeTeamFont } = await import("./team-client-NPVN22NY.js");
1797
+ const { removeTeamFont } = await import("./team-client-NCOFAD7O.js");
1795
1798
  const out = await removeTeamFont(args.id, args.workspace);
1796
1799
  return { summary: `Removed the team font${out.freed ? " and freed its storage" : ""}`, data: out };
1797
1800
  }
@@ -1802,7 +1805,7 @@ var fontTeamCommands = [fontTeamList, fontTeamAdd];
1802
1805
  init_define_POPCRAFT_COMPONENT_IDS();
1803
1806
  async function cloudFile() {
1804
1807
  const [{ syncStatus }, { cloudUser }] = await Promise.all([
1805
- import("./sync-SCD4Z3UQ.js"),
1808
+ import("./sync-K25HHGBW.js"),
1806
1809
  import("./session-HPSDXOSY.js")
1807
1810
  ]);
1808
1811
  const link2 = syncStatus().link;
@@ -1954,11 +1957,11 @@ var fileDuplicate = defineCommand({
1954
1957
  },
1955
1958
  run: async (_p, ctx) => {
1956
1959
  const [{ syncStatus }, { cloudApi }, { isDesktopTabs }, { createFileInTab }, { openNewCloudFile }, { v4: uuid }] = await Promise.all([
1957
- import("./sync-SCD4Z3UQ.js"),
1960
+ import("./sync-K25HHGBW.js"),
1958
1961
  import("./api-SHU5H2PY.js"),
1959
1962
  import("./tab-mode-2RKK6WQJ.js"),
1960
- import("./tabs-MKGZODKR.js"),
1961
- import("./sync-SCD4Z3UQ.js"),
1963
+ import("./tabs-WBH6CHXA.js"),
1964
+ import("./sync-K25HHGBW.js"),
1962
1965
  import("./dist-node-NEPTX7PU.js")
1963
1966
  ]);
1964
1967
  const doc2 = ctx.doc();
@@ -4574,7 +4577,7 @@ var viewCopyLink = defineCommand({
4574
4577
  },
4575
4578
  run: async (args, ctx) => {
4576
4579
  const [{ syncStatus }, { fileUrl }, { withDeepLink }] = await Promise.all([
4577
- import("./sync-SCD4Z3UQ.js"),
4580
+ import("./sync-K25HHGBW.js"),
4578
4581
  import("./api-SHU5H2PY.js"),
4579
4582
  import("./deep-link-K3CMMIZT.js")
4580
4583
  ]);
@@ -4899,7 +4902,7 @@ var pageGo = defineCommand({
4899
4902
  ] }
4900
4903
  },
4901
4904
  run: async ({ to }) => {
4902
- const { useEditorStore } = await import("./editor-store-27CIM6LZ.js");
4905
+ const { useEditorStore } = await import("./editor-store-N4QAPXJK.js");
4903
4906
  useEditorStore.getState().goToPrintPage(to);
4904
4907
  return { summary: typeof to === "number" ? `Page ${to + 1}` : `${to} page` };
4905
4908
  }
@@ -4933,7 +4936,7 @@ var pageSetup = defineCommand({
4933
4936
  }
4934
4937
  },
4935
4938
  run: async (args) => {
4936
- const { useEditorStore } = await import("./editor-store-27CIM6LZ.js");
4939
+ const { useEditorStore } = await import("./editor-store-N4QAPXJK.js");
4937
4940
  useEditorStore.getState().applyPageSetup(args);
4938
4941
  return { summary: `Page setup updated${args.kind ? ` (${args.kind.toLowerCase()})` : ""}` };
4939
4942
  }
@@ -5692,7 +5695,7 @@ async function docAtTime(doc2, ids, time2) {
5692
5695
  let frameId;
5693
5696
  if (time2 === void 0) {
5694
5697
  try {
5695
- const { useEditorStore } = await import("./editor-store-27CIM6LZ.js");
5698
+ const { useEditorStore } = await import("./editor-store-N4QAPXJK.js");
5696
5699
  const st = useEditorStore.getState();
5697
5700
  const target = st.transport?.target;
5698
5701
  if (st.mode !== "ANIMATE" || target?.kind !== "frame") return doc2;
@@ -6086,7 +6089,7 @@ async function runAnimationExport(format, args, ctx) {
6086
6089
  const filename = exportFileName(args.filename || targetName(doc2, target), format);
6087
6090
  const [{ exportAnimation }, { memoryDestination }] = await Promise.all([import("./video-SK2RJTZX.js"), import("./destination-7SRSVIPA.js")]);
6088
6091
  if (format === "lottie" || format === "dotlottie") return runLottieExport(renderer, doc2, spec, filename, ctx, memoryDestination, args.stateMachine);
6089
- const planWatermark = format !== "png" && await (await import("./export-watermark-KCPUTXV3.js")).exportWatermark();
6092
+ const planWatermark = format !== "png" && await (await import("./export-watermark-5GGBVSSF.js")).exportWatermark();
6090
6093
  if (format !== "png") spec = { ...spec, watermark: planWatermark || args.watermark !== false };
6091
6094
  const dest = ctx.destination ? await ctx.destination(filename, FORMAT_MIME[format]) : memoryDestination(filename, FORMAT_MIME[format]);
6092
6095
  let stats;
@@ -6172,7 +6175,7 @@ var exportLottie = animationCommand((args) => args.container === "lottie" ? "dot
6172
6175
  });
6173
6176
  async function exportSite(doc2, pageId2, packaging, styling = "css", siteUrl) {
6174
6177
  const [{ completeSite, nextFilesOf, shareImageFiles, staticFilesOf, NoSiteRuntime, bytesOf }, { fileBase }, { zipFiles }, { downloadBlob }] = await Promise.all([
6175
- import("./project-5EPDN5DD.js"),
6178
+ import("./project-HCE2D547.js"),
6176
6179
  import("./web-A65S74KZ.js"),
6177
6180
  import("./zip-export-NMJUBE3M.js"),
6178
6181
  import("./download-CSO5TEOD.js")
@@ -6266,7 +6269,7 @@ var exportStorefront = defineCommand({
6266
6269
  const [{ storefrontInputs }, { STOREFRONT_TARGETS }, { bytesOf }, { fileBase, flatten }, { zipFiles }, { downloadBlob }] = await Promise.all([
6267
6270
  import("./storefront-prepare-LWBIU6RV.js"),
6268
6271
  import("./storefront-6ROIKCS4.js"),
6269
- import("./project-5EPDN5DD.js"),
6272
+ import("./project-HCE2D547.js"),
6270
6273
  import("./web-A65S74KZ.js"),
6271
6274
  import("./zip-export-NMJUBE3M.js"),
6272
6275
  import("./download-CSO5TEOD.js")
@@ -6661,7 +6664,7 @@ var visionRegenerateImage = defineCommand({
6661
6664
  const id = args.id ?? ctx.selection()[0];
6662
6665
  if (!id) throw new ToolError("Select a generated image to regenerate.");
6663
6666
  nodeOrThrow(ctx.doc(), id);
6664
- const { regenerateImage } = await import("./client-actions-T6MVTJDM.js");
6667
+ const { regenerateImage } = await import("./client-actions-OCPW4GDM.js");
6665
6668
  regenerateImage(id, args.count);
6666
6669
  return { summary: args.count > 1 ? `Regenerating ${args.count} variants` : "Regenerating the image", data: { id, count: args.count } };
6667
6670
  }
@@ -9820,7 +9823,7 @@ var scriptRun = defineCommand({
9820
9823
  // A script is not the turn the user is watching: confirm-tier tools are refused inside it (dispatch, `nested`).
9821
9824
  actor: { ...ctx.actor, nested: true, label: "Script" },
9822
9825
  // A look_at inside the script sees the document as the script has left it so far, not as it was before.
9823
- use: ((name2) => name2 === "render" && ctx.can("render") ? (async (ids, options) => (await import("./agent-BJ2DUSN5.js")).renderDocument(staged, ids, options)) : ctx.use(name2))
9826
+ use: ((name2) => name2 === "render" && ctx.can("render") ? (async (ids, options) => (await import("./agent-INS2VFTM.js")).renderDocument(staged, ids, options)) : ctx.use(name2))
9824
9827
  };
9825
9828
  let calls = 0;
9826
9829
  const images = [];
@@ -10640,7 +10643,7 @@ var docImportFile = defineCommand({
10640
10643
  const file = new File([body], args.name);
10641
10644
  if (file.size > MAX_BYTES) throw new ToolError(`"${args.name}" is larger than ${MAX_BYTES / 1024 / 1024} MB.`);
10642
10645
  const [{ buildImportedDocument }, { mergeImportedDocument }] = await Promise.all([
10643
- import("./plugin-import-7V2P7SYA.js"),
10646
+ import("./plugin-import-3SI4HULY.js"),
10644
10647
  import("./import-merge-EGOLY3JE.js")
10645
10648
  ]);
10646
10649
  const built = await buildImportedDocument(file);
@@ -6,7 +6,7 @@ const __filename = __popcraftPath(import.meta.url);
6
6
  const __dirname = __popcraftDirname(__filename);
7
7
  import {
8
8
  activeTeamWorkspaceId
9
- } from "./chunk-HW5J5ORB.js";
9
+ } from "./chunk-WATJYTA7.js";
10
10
  import {
11
11
  ApiError,
12
12
  GUEST_FILE_LIMIT,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-AN573IF2.js";
19
19
  import {
20
20
  markLibraryDocument
21
- } from "./chunk-XPVDBNN7.js";
21
+ } from "./chunk-4PLFCL2J.js";
22
22
  import {
23
23
  cloudEnabled,
24
24
  cloudUser
@@ -6,7 +6,7 @@ const __filename = __popcraftPath(import.meta.url);
6
6
  const __dirname = __popcraftDirname(__filename);
7
7
  import {
8
8
  useEditorStore
9
- } from "./chunk-XPVDBNN7.js";
9
+ } from "./chunk-4PLFCL2J.js";
10
10
  import {
11
11
  announce
12
12
  } from "./chunk-IM4M2REB.js";
@@ -13,7 +13,7 @@ import {
13
13
  agentTool,
14
14
  agentToolList,
15
15
  registerCommands
16
- } from "./chunk-AMASMLKC.js";
16
+ } from "./chunk-5LJTWDUC.js";
17
17
  import {
18
18
  dispatch
19
19
  } from "./chunk-7EEUGQZW.js";
@@ -140,7 +140,7 @@ function startHyperyTeams() {
140
140
  maybePromptForTeam();
141
141
  void followFileTeam(linkedKey);
142
142
  });
143
- void import("./sync-SCD4Z3UQ.js").then(({ onSyncStatus, syncStatus }) => {
143
+ void import("./sync-K25HHGBW.js").then(({ onSyncStatus, syncStatus }) => {
144
144
  linkedKey = syncStatus().link?.key ?? null;
145
145
  void followFileTeam(linkedKey);
146
146
  onSyncStatus((_s, link) => {
@@ -14,14 +14,14 @@ import {
14
14
  newFileRefusal,
15
15
  reportNewFileBlocked,
16
16
  setCloudLink
17
- } from "./chunk-5EL7TNOH.js";
17
+ } from "./chunk-QDDVKMU3.js";
18
18
  import {
19
19
  parseDeepLink,
20
20
  withDeepLink
21
21
  } from "./chunk-YGCKTKQG.js";
22
22
  import {
23
23
  activeTeamWorkspaceId
24
- } from "./chunk-HW5J5ORB.js";
24
+ } from "./chunk-WATJYTA7.js";
25
25
  import {
26
26
  ApiError,
27
27
  api,
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-PJY3DG52.js";
30
30
  import {
31
31
  attachPresence
32
- } from "./chunk-AOJ2PM6I.js";
32
+ } from "./chunk-QDYMLYUJ.js";
33
33
  import {
34
34
  isPersistableDocument,
35
35
  isUnsavedPlaceholder,
@@ -40,7 +40,7 @@ import {
40
40
  setCollabHistory,
41
41
  storedDocument,
42
42
  useEditorStore
43
- } from "./chunk-XPVDBNN7.js";
43
+ } from "./chunk-4PLFCL2J.js";
44
44
  import {
45
45
  accessToken,
46
46
  cloudUser,
@@ -6,14 +6,14 @@ const __filename = __popcraftPath(import.meta.url);
6
6
  const __dirname = __popcraftDirname(__filename);
7
7
  import {
8
8
  pluginRun
9
- } from "./chunk-X5KSYJ7D.js";
9
+ } from "./chunk-OMLK7QUV.js";
10
10
  import {
11
11
  fileCommands,
12
12
  fontTeamRemove,
13
13
  integrationConfirmCommands,
14
14
  mediaDelete,
15
15
  publishCommands
16
- } from "./chunk-MJKABEVI.js";
16
+ } from "./chunk-OZ5SGNT6.js";
17
17
  import {
18
18
  external_exports
19
19
  } from "./chunk-BQXNFA5K.js";
@@ -55,7 +55,7 @@ var collabSetSpotlight = defineCommand({
55
55
  }
56
56
  },
57
57
  run: async ({ on }, ctx) => {
58
- const { setSpotlight } = await import("./presence-NREBIJAC.js");
58
+ const { setSpotlight } = await import("./presence-IXAK63HX.js");
59
59
  setSpotlight(on);
60
60
  ctx.notice(on ? "Spotlight on \u2014 everyone is following this view." : "Spotlight off.");
61
61
  return { summary: on ? "Spotlight on" : "Spotlight off", data: { spotlight: on } };
@@ -82,7 +82,7 @@ var collabRevealPrivate = defineCommand({
82
82
  }
83
83
  },
84
84
  run: async (_p, ctx) => {
85
- const { useEditorStore } = await import("./editor-store-27CIM6LZ.js");
85
+ const { useEditorStore } = await import("./editor-store-N4QAPXJK.js");
86
86
  const before = Object.values(useEditorStore.getState().document.nodes).filter((n) => n.privateTo).length;
87
87
  useEditorStore.getState().revealPrivate();
88
88
  ctx.notice(before ? `Revealed ${before} private item${before === 1 ? "" : "s"}.` : "Nothing was private.");
@@ -146,7 +146,7 @@ var documentDelete = defineCommand({
146
146
  }
147
147
  },
148
148
  run: async ({ id }, ctx) => {
149
- const { useEditorStore } = await import("./editor-store-27CIM6LZ.js");
149
+ const { useEditorStore } = await import("./editor-store-N4QAPXJK.js");
150
150
  const wasOpen = useEditorStore.getState().document.id === id;
151
151
  await useEditorStore.getState().deleteDocument(id);
152
152
  ctx.notice("Deleted the document.");
@@ -190,7 +190,7 @@ var libraryPublish = defineCommand({
190
190
  }
191
191
  },
192
192
  run: async (p, ctx) => {
193
- const { publishLibrary } = await import("./libraries-PF6ZSTVY.js");
193
+ const { publishLibrary } = await import("./libraries-QUWA6635.js");
194
194
  const doc = ctx.doc();
195
195
  const pick = {
196
196
  componentIds: p.componentIds ?? Object.keys(doc.components ?? {}),
@@ -222,7 +222,7 @@ var libraryUnpublish = defineCommand({
222
222
  },
223
223
  run: async ({ libraryId }, ctx) => {
224
224
  if (!libraryId.trim()) throw new CommandError("Which library? Pass its `libraryId`.", "invalid_params");
225
- const { unpublishLibrary } = await import("./libraries-PF6ZSTVY.js");
225
+ const { unpublishLibrary } = await import("./libraries-QUWA6635.js");
226
226
  await unpublishLibrary(libraryId);
227
227
  ctx.notice(`Unpublished library ${libraryId}.`);
228
228
  return { summary: `Unpublished library ${libraryId}`, data: { libraryId, unpublished: true } };
@@ -234,8 +234,8 @@ var libraryCommands = [libraryPublish, libraryUnpublish];
234
234
  init_define_POPCRAFT_COMPONENT_IDS();
235
235
  async function findVersion(id) {
236
236
  const [{ useEditorStore }, { versionLabel }] = await Promise.all([
237
- import("./editor-store-27CIM6LZ.js"),
238
- import("./versions-VRUI43E6.js")
237
+ import("./editor-store-N4QAPXJK.js"),
238
+ import("./versions-22NOIGED.js")
239
239
  ]);
240
240
  const meta = useEditorStore.getState().versions.find((v) => v.id === id);
241
241
  if (!meta) {
@@ -268,7 +268,7 @@ var versionRestore = defineCommand({
268
268
  },
269
269
  run: async ({ id }) => {
270
270
  const found = await findVersion(id);
271
- const { restoreVersion } = await import("./versions-VRUI43E6.js");
271
+ const { restoreVersion } = await import("./versions-22NOIGED.js");
272
272
  await restoreVersion(found.meta);
273
273
  return { summary: `Restored \u201C${found.label}\u201D`, data: { id, label: found.label, restored: true } };
274
274
  }
@@ -293,7 +293,7 @@ var versionDelete = defineCommand({
293
293
  },
294
294
  run: async ({ id }, ctx) => {
295
295
  const found = await findVersion(id);
296
- const { deleteVersion } = await import("./versions-VRUI43E6.js");
296
+ const { deleteVersion } = await import("./versions-22NOIGED.js");
297
297
  await deleteVersion(found.meta);
298
298
  ctx.notice(`Deleted the version \u201C${found.label}\u201D.`);
299
299
  return { summary: `Deleted the version \u201C${found.label}\u201D`, data: { id, label: found.label, deleted: true } };
@@ -16,9 +16,9 @@ import {
16
16
  requestEmbeddings,
17
17
  requestImage,
18
18
  requestImageAction
19
- } from "./chunk-CF5ILIUY.js";
19
+ } from "./chunk-3AA5RPZO.js";
20
20
  import "./chunk-TE56ZVPG.js";
21
- import "./chunk-HW5J5ORB.js";
21
+ import "./chunk-WATJYTA7.js";
22
22
  import "./chunk-PJY3DG52.js";
23
23
  import "./chunk-D5UTY5ZB.js";
24
24
  import "./chunk-R22FHI7D.js";
@@ -7,7 +7,7 @@ const __dirname = __popcraftDirname(__filename);
7
7
  import {
8
8
  defaultMeasure,
9
9
  placePicture
10
- } from "./chunk-NG47WAKE.js";
10
+ } from "./chunk-DWIBBBCU.js";
11
11
  import "./chunk-KTY54Z6Y.js";
12
12
  import {
13
13
  api
@@ -121,7 +121,7 @@ async function placeLibraryItem(item, opts = {}) {
121
121
  }
122
122
  if (item.contentType.startsWith("video/")) {
123
123
  const file = await libraryFile(item, opts);
124
- const [{ useEditorStore }, { placeMediaFile }] = await Promise.all([import("./editor-store-27CIM6LZ.js"), import("./media-tool-FHI55M4F.js")]);
124
+ const [{ useEditorStore }, { placeMediaFile }] = await Promise.all([import("./editor-store-N4QAPXJK.js"), import("./media-tool-QYKQESSE.js")]);
125
125
  const cam = useEditorStore.getState().camera;
126
126
  await placeMediaFile(file, { kind: "point", ...opts.at ?? { x: cam.x, y: cam.y } });
127
127
  return useEditorStore.getState().selection[0] ?? null;
@@ -14,7 +14,7 @@ import {
14
14
  placeStockPhoto,
15
15
  searchStockPhotos,
16
16
  stockPhotoInfo
17
- } from "./chunk-NG47WAKE.js";
17
+ } from "./chunk-DWIBBBCU.js";
18
18
  import "./chunk-KTY54Z6Y.js";
19
19
  import "./chunk-FFS4SO7R.js";
20
20
  import "./chunk-LJSVREWM.js";
@@ -16,7 +16,7 @@ import {
16
16
  selectedVectorTarget,
17
17
  startImageAction,
18
18
  startImageGeneration
19
- } from "./chunk-CY7BJ44V.js";
19
+ } from "./chunk-5QWAEANA.js";
20
20
  import "./chunk-VUI34P2Z.js";
21
21
  import "./chunk-BQXNFA5K.js";
22
22
  import "./chunk-MAARRLUL.js";
@@ -30,17 +30,17 @@ import "./chunk-E5ADUDER.js";
30
30
  import "./chunk-SCBMVH67.js";
31
31
  import "./chunk-765RD727.js";
32
32
  import "./chunk-PWPSWCAO.js";
33
- import "./chunk-CF5ILIUY.js";
33
+ import "./chunk-3AA5RPZO.js";
34
34
  import "./chunk-TE56ZVPG.js";
35
35
  import "./chunk-TP7DFN6X.js";
36
36
  import "./chunk-CLEN2YD3.js";
37
- import "./chunk-HW5J5ORB.js";
37
+ import "./chunk-WATJYTA7.js";
38
38
  import "./chunk-PJY3DG52.js";
39
39
  import "./chunk-D5UTY5ZB.js";
40
40
  import "./chunk-3PLIWIWJ.js";
41
41
  import "./chunk-Q6KVUFQF.js";
42
42
  import "./chunk-GNTJQ6T6.js";
43
- import "./chunk-XPVDBNN7.js";
43
+ import "./chunk-4PLFCL2J.js";
44
44
  import "./chunk-T3LMLGC5.js";
45
45
  import "./chunk-O6FCB3JG.js";
46
46
  import "./chunk-VY2YTU7V.js";
@@ -8,9 +8,9 @@ import {
8
8
  confirmTierCommands,
9
9
  dangerousCommands,
10
10
  registerDangerousCommands
11
- } from "./chunk-IK2PKTKB.js";
12
- import "./chunk-X5KSYJ7D.js";
13
- import "./chunk-MJKABEVI.js";
11
+ } from "./chunk-ZYHV7ER3.js";
12
+ import "./chunk-OMLK7QUV.js";
13
+ import "./chunk-OZ5SGNT6.js";
14
14
  import "./chunk-KV34UK7F.js";
15
15
  import "./chunk-VFRAUFQT.js";
16
16
  import "./chunk-HNFJNRW6.js";