@popcraft/cli 0.29.0 → 0.31.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 (2) hide show
  1. package/dist/popcraft.mjs +21 -10
  2. package/package.json +2 -2
package/dist/popcraft.mjs CHANGED
@@ -1188,7 +1188,7 @@ function operations(spec = openapi) {
1188
1188
  }
1189
1189
  async function call(target2, method, path, opts = {}) {
1190
1190
  const qs = new URLSearchParams(opts.query ?? {}).toString();
1191
- const headers = { "user-agent": `popcraft-cli/${"0.29.0"}`, ...opts.headers };
1191
+ const headers = { "user-agent": `popcraft-cli/${"0.31.0"}`, ...opts.headers };
1192
1192
  if (target2.token) headers.authorization = `Bearer ${target2.token}`;
1193
1193
  if (opts.contentType) headers["content-type"] = opts.contentType;
1194
1194
  try {
@@ -261592,7 +261592,6 @@ function planEntryAction({ home }) {
261592
261592
  var STORAGE_KEY2, useHyperyTeam, TEAM_PROMPT_ENABLED, TEAM_PROMPTED_KEY, PROMPTED_KEY, useTeamPrompt, started;
261593
261593
  var init_team = __esm({
261594
261594
  "lib/client/cloud/team.ts"() {
261595
- "use strict";
261596
261595
  init_esm();
261597
261596
  init_api4();
261598
261597
  init_session();
@@ -308953,12 +308952,18 @@ function flattenOnWhite(px5) {
308953
308952
  }
308954
308953
  return px5;
308955
308954
  }
308956
- function thumbnailWebp(img) {
308955
+ function thumbnailWebp(img, maxBytes = Infinity) {
308957
308956
  flattenOnWhite(img.data);
308958
- return encodeWebpLossless(img.width, img.height, img.data);
308957
+ let out = encodeWebpLossless(img.width, img.height, img.data);
308958
+ for (let drop = 1; out.length > maxBytes && drop <= 4; drop++) {
308959
+ const px5 = img.data.slice(), mask = 255 << drop & 255, half = 1 << drop - 1;
308960
+ for (let i2 = 0; i2 < px5.length; i2 += 4) for (let c2 = 0; c2 < 3; c2++) px5[i2 + c2] = Math.min(255, (px5[i2 + c2] & mask) + half);
308961
+ out = encodeWebpLossless(img.width, img.height, px5);
308962
+ }
308963
+ return out;
308959
308964
  }
308960
308965
  function thumbnailDataUrl(img) {
308961
- return `data:image/webp;base64,${base643(thumbnailWebp(img))}`;
308966
+ return `data:image/webp;base64,${base643(thumbnailWebp(img, Math.floor((MAX_THUMBNAIL_CHARS - 32) * 3 / 4)))}`;
308962
308967
  }
308963
308968
  function previewSize(width, height) {
308964
308969
  const k2 = thumbnailScale(width, height, PREVIEW_MAX);
@@ -310272,6 +310277,7 @@ function downloadBlob(blob, filename) {
310272
310277
  }
310273
310278
  var init_download = __esm({
310274
310279
  "lib/io/download.ts"() {
310280
+ "use strict";
310275
310281
  }
310276
310282
  });
310277
310283
 
@@ -310491,6 +310497,7 @@ function creditLine(c2) {
310491
310497
  var MAX_PHOTO_PAGE, MAX_PHOTO_QUERY, UUID, isPhotoId, photoImagePath;
310492
310498
  var init_stock = __esm({
310493
310499
  "lib/photos/stock.ts"() {
310500
+ "use strict";
310494
310501
  MAX_PHOTO_PAGE = 12;
310495
310502
  MAX_PHOTO_QUERY = 200;
310496
310503
  UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -316050,6 +316057,7 @@ function videoPixelSize(resolution, aspect) {
316050
316057
  var VIDEO_ASPECTS, VIDEO_RESOLUTIONS, SEEDANCE_ASPECTS, range, VIDEO_MODELS, DEFAULT_VIDEO_MODEL, videoModel, VIDEO_LIMITS;
316051
316058
  var init_video_models = __esm({
316052
316059
  "lib/ai/video-models.ts"() {
316060
+ "use strict";
316053
316061
  VIDEO_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
316054
316062
  VIDEO_RESOLUTIONS = ["480p", "720p", "1080p"];
316055
316063
  SEEDANCE_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
@@ -326401,7 +326409,7 @@ var init_package = __esm({
326401
326409
  "packages/runtime/package.json"() {
326402
326410
  package_default = {
326403
326411
  name: "@popcraft/runtime",
326404
- version: "0.29.0",
326412
+ version: "0.31.0",
326405
326413
  description: "What code exported from PopCraft shares: the meaning of expressions (operators and functions) and, as it grows, the parts of a design's behaviour that are common code rather than generated React.",
326406
326414
  license: "MIT",
326407
326415
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -351067,6 +351075,7 @@ function exportsOf(source3) {
351067
351075
  var CODE_LIMITS, packageOf;
351068
351076
  var init_source2 = __esm({
351069
351077
  "lib/code/source.ts"() {
351078
+ "use strict";
351070
351079
  CODE_LIMITS = { modules: 100, sourceLength: 2e5, packages: 12 };
351071
351080
  packageOf = (spec) => spec.split("/").slice(0, spec.startsWith("@") ? 2 : 1).join("/");
351072
351081
  }
@@ -351109,6 +351118,7 @@ function compileModule(module2) {
351109
351118
  var import_sucrase, BUILT_IN, memo4;
351110
351119
  var init_compile2 = __esm({
351111
351120
  "lib/code/compile.ts"() {
351121
+ "use strict";
351112
351122
  import_sucrase = __toESM(require_dist2());
351113
351123
  init_source2();
351114
351124
  init_source2();
@@ -351186,7 +351196,6 @@ function hashOf2(text) {
351186
351196
  }
351187
351197
  var init_hash = __esm({
351188
351198
  "lib/code/hash.ts"() {
351189
- "use strict";
351190
351199
  }
351191
351200
  });
351192
351201
 
@@ -397152,6 +397161,7 @@ async function replay(rec, namespaces2) {
397152
397161
  var BLOCKED, isRef2, isFn;
397153
397162
  var init_replay = __esm({
397154
397163
  "lib/agent/design-script/replay.ts"() {
397164
+ "use strict";
397155
397165
  BLOCKED = /* @__PURE__ */ new Set(["constructor", "prototype", "__proto__", "caller", "callee", "arguments", "call", "apply", "bind"]);
397156
397166
  isRef2 = (v) => !!v && typeof v === "object" && "$ref" in v && Array.isArray(v.path);
397157
397167
  isFn = (v) => !!v && typeof v === "object" && "$fn" in v && Array.isArray(v.ops);
@@ -409036,7 +409046,7 @@ async function drawThumbnail(editor2, t3, sizeId) {
409036
409046
  async function drawDetailStill(editor2, t3, sizeId) {
409037
409047
  const region = thumbnailRegion(t3, sizeId);
409038
409048
  const img = await renderRegion(editor2.page, region, thumbnailScale(region.maxX - region.minX, region.maxY - region.minY, DETAIL_MAX));
409039
- return { bytes: thumbnailWebp(img), width: img.width, height: img.height };
409049
+ return { bytes: thumbnailWebp(img, DETAIL_MAX_BYTES), width: img.width, height: img.height };
409040
409050
  }
409041
409051
  function previewRoot(t3, sizeId) {
409042
409052
  const v = variantOf(t3, sizeId);
@@ -409063,7 +409073,7 @@ async function drawPreview(editor2, t3, reopen = true) {
409063
409073
  }, want);
409064
409074
  return out ? { bytes: new Uint8Array(Buffer.from(out.b64, "base64")), width: out.width, height: out.height, durationMs: out.durationMs } : null;
409065
409075
  }
409066
- var fitScale;
409076
+ var fitScale, DETAIL_MAX_BYTES;
409067
409077
  var init_pictures_node = __esm({
409068
409078
  "lib/templates/pictures.node.ts"() {
409069
409079
  init_thumbnail();
@@ -409071,6 +409081,7 @@ var init_pictures_node = __esm({
409071
409081
  init_scene_graph();
409072
409082
  init_editor_open();
409073
409083
  fitScale = (r) => thumbnailScale(r.maxX - r.minX, r.maxY - r.minY);
409084
+ DETAIL_MAX_BYTES = 6e5;
409074
409085
  }
409075
409086
  });
409076
409087
 
@@ -409752,7 +409763,7 @@ init_resources();
409752
409763
  init_desktop();
409753
409764
  init_hypery();
409754
409765
  import { createInterface } from "node:readline";
409755
- var VERSION2 = "0.29.0";
409766
+ var VERSION2 = "0.31.0";
409756
409767
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
409757
409768
 
409758
409769
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "The PopCraft command line: edit .popcraft files headlessly, call the REST API, publish to the marketplace and manage the desktop app's local plugins, themes, fonts, skills and agents.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://popcraft.app/docs/api/cli",
@@ -34,7 +34,7 @@
34
34
  "esbuild": "0.28.2"
35
35
  },
36
36
  "dependencies": {
37
- "@popcraft/kit": "0.29.0"
37
+ "@popcraft/kit": "0.31.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",