@acryldev/blends-frame 0.2.9 → 0.2.11

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/lib/client.js CHANGED
@@ -237,13 +237,19 @@ window.__ModuleLoader__.load({
237
237
  /** @throws when the value is not a share plan. */
238
238
  function parseSharePlan(value) {
239
239
  if (!isRecord$5(value)) throw new Error("share plan: not a plan");
240
- const { owner, repo, version, visibility, createsRepository, released, license, registry, placement } = value;
240
+ const { owner, repo, version, visibility, createsRepository, released, license, registry, placement, npm } = value;
241
241
  if (typeof owner !== "string" || !GITHUB_NAME.test(owner) || typeof repo !== "string" || !GITHUB_NAME.test(repo)) throw new Error("share plan: repository");
242
242
  if (typeof version !== "string" || version === "" || released !== void 0 && (typeof released !== "string" || released === "")) throw new Error("share plan: version");
243
243
  if (visibility !== "private" && visibility !== "public" || typeof createsRepository !== "boolean") throw new Error("share plan: visibility");
244
244
  if (license !== void 0 && (typeof license !== "string" || !/^[A-Za-z0-9.+-]+$/u.test(license))) throw new Error("share plan: license");
245
245
  if (registry !== void 0 && typeof registry !== "boolean") throw new Error("share plan: registry");
246
246
  if (registry === true && visibility !== "public") throw new Error("share plan: only a public share can be listed in the registry");
247
+ const onNpm = npm === void 0 ? void 0 : isRecord$5(npm) && typeof npm.package === "string" && npm.package !== "" && typeof npm.registry === "string" && /^https?:\/\//u.test(npm.registry) && typeof npm.digest === "string" && /^[0-9a-f]{64}$/u.test(npm.digest) ? {
248
+ package: npm.package,
249
+ registry: npm.registry,
250
+ digest: npm.digest
251
+ } : null;
252
+ if (onNpm === null) throw new Error("share plan: npm");
247
253
  const place = placement === void 0 ? void 0 : isRecord$5(placement) && typeof placement.category === "string" && (placement.subcategory === void 0 || typeof placement.subcategory === "string") ? {
248
254
  category: placement.category,
249
255
  ...typeof placement.subcategory === "string" ? { subcategory: placement.subcategory } : {}
@@ -258,6 +264,7 @@ window.__ModuleLoader__.load({
258
264
  ...released === void 0 ? {} : { released },
259
265
  ...license === void 0 ? {} : { license },
260
266
  ...registry === true ? { registry } : {},
267
+ ...onNpm === void 0 ? {} : { npm: onNpm },
261
268
  ...place === void 0 ? {} : { placement: place }
262
269
  };
263
270
  }
@@ -424,7 +431,7 @@ window.__ModuleLoader__.load({
424
431
  status: "ready",
425
432
  entries: value.entries.map((entry) => {
426
433
  if (!isRecord$5(entry)) throw new Error("registry: entry");
427
- const { name, description, owner, url, version, published, compatibility, origin, source, installed, mine, download } = entry;
434
+ const { name, description, owner, url, version, published, compatibility, origin, source, installed, mine, updateFrom, download } = entry;
428
435
  if (typeof name !== "string" || typeof description !== "string" || typeof owner !== "string" || typeof url !== "string" || typeof version !== "string" || typeof compatibility !== "string" || typeof source !== "string" || typeof installed !== "boolean" || typeof mine !== "boolean") throw new Error("registry: entry");
429
436
  return {
430
437
  name,
@@ -438,6 +445,7 @@ window.__ModuleLoader__.load({
438
445
  source,
439
446
  installed,
440
447
  mine,
448
+ ...typeof updateFrom === "string" ? { updateFrom } : {},
441
449
  ...typeof download === "number" && download > 0 ? { download } : {}
442
450
  };
443
451
  }),
@@ -15178,13 +15186,14 @@ window.__ModuleLoader__.load({
15178
15186
  if (event.altKey || event.key.toLowerCase() !== "f") return false;
15179
15187
  return mac ? event.metaKey && !event.ctrlKey && !event.shiftKey : event.ctrlKey && event.shiftKey && !event.metaKey;
15180
15188
  }
15181
- const agent = (id, label, command, homepageUrl, color, yoloArgs = [], yoloEnv) => ({
15189
+ const agent = (id, label, command, homepageUrl, color, yoloArgs = [], yoloEnv, installCommand) => ({
15182
15190
  id,
15183
15191
  label,
15184
15192
  command,
15185
15193
  homepageUrl,
15186
15194
  yoloArgs,
15187
15195
  ...yoloEnv === void 0 ? {} : { yoloEnv },
15196
+ ...installCommand === void 0 ? {} : { installCommand },
15188
15197
  badge: {
15189
15198
  letter: [...label][0]?.toUpperCase() ?? "?",
15190
15199
  color
@@ -15193,15 +15202,15 @@ window.__ModuleLoader__.load({
15193
15202
  /** In the order the lists show them. Ids of agents that shipped earlier keep their spelling. */
15194
15203
  const KNOWN_AGENTS = [
15195
15204
  {
15196
- ...agent("claude", "Claude", "claude", "https://code.claude.com/docs", "#d97757", ["--dangerously-skip-permissions"]),
15205
+ ...agent("claude", "Claude", "claude", "https://code.claude.com/docs", "#d97757", ["--dangerously-skip-permissions"], void 0, "npm i -g @anthropic-ai/claude-code"),
15197
15206
  statusHooks: "claude"
15198
15207
  },
15199
- agent("codex", "Codex", "codex", "https://github.com/openai/codex", "#10a37f", ["--dangerously-bypass-approvals-and-sandbox"]),
15208
+ agent("codex", "Codex", "codex", "https://github.com/openai/codex", "#10a37f", ["--dangerously-bypass-approvals-and-sandbox"], void 0, "npm i -g @openai/codex"),
15200
15209
  agent("grok", "Grok", "grok", "https://x.ai/cli", "#94a3b8", ["--permission-mode", "bypassPermissions"]),
15201
15210
  agent("copilot", "GitHub Copilot", "copilot", "https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli", "#a78bfa", ["--yolo"]),
15202
15211
  agent("opencode", "OpenCode", "opencode", "https://opencode.ai/docs/cli/", "#94a3b8"),
15203
15212
  agent("ante", "Ante", "ante", "https://github.com/AntigmaLabs/ante-preview", "#fb923c", ["--yolo"]),
15204
- agent("pi", "Pi", "pi", "https://pi.dev", "#a78bfa"),
15213
+ agent("pi", "Pi", "pi", "https://pi.dev", "#a78bfa", [], void 0, "npm i -g @earendil-works/pi-coding-agent"),
15205
15214
  agent("omp", "OMP", "omp", "https://omp.sh", "#a78bfa"),
15206
15215
  agent("gemini", "Gemini", "gemini", "https://github.com/google-gemini/gemini-cli", "#4285f4", ["--yolo"]),
15207
15216
  agent("antigravity", "Antigravity", "agy", "https://antigravity.google/docs/cli-overview", "#4285f4", ["--dangerously-skip-permissions"]),
@@ -17609,16 +17618,22 @@ window.__ModuleLoader__.load({
17609
17618
  */
17610
17619
  function shareQuestion(plan) {
17611
17620
  const name = plan.repo;
17621
+ if (plan.npm !== void 0) {
17622
+ const sent = plan.released === void 0 ? "" : ` This sends version ${plan.version}, because ${plan.released} was already published.`;
17623
+ return `Publish ${plan.repo} to npm as ${plan.npm.package}? Anyone can find it there and add it to their own app. It is published with your own npm login.${sent}`;
17624
+ }
17612
17625
  const who = plan.registry === true ? `List ${name} in the public registry? Anyone can search for it and add it with one click.` : plan.visibility === "public" ? `Share ${name} with everyone? Anyone can find it and add it to their own app.` : `Share ${name} with your team? Only people you invite can add it.`;
17613
17626
  const next = plan.released === void 0 ? "" : ` This sends version ${plan.version}, because ${plan.released} was already shared.`;
17614
17627
  return `${who} It is kept on your GitHub account, ${plan.owner}.${next}`;
17615
17628
  }
17616
17629
  /** The words on the one big button that confirms a share. */
17617
17630
  function shareButton(plan) {
17631
+ if (plan.npm !== void 0) return "Publish to npm";
17618
17632
  return plan.registry === true ? "List in the registry" : plan.visibility === "public" ? "Share with everyone" : "Share with my team";
17619
17633
  }
17620
17634
  /** The exact sentence of what a share does, for the "Details" of the confirmation: the repository, whether it is created, the version and who can see it. */
17621
17635
  function shareSentence(plan) {
17636
+ if (plan.npm !== void 0) return `Publish v${plan.version} of ${plan.repo} to ${plan.npm.registry} as ${plan.npm.package}, public, under the ${plan.license ?? "MIT"} license. It is sent with your own npm login (npm whoami).${plan.released === void 0 ? "" : ` v${plan.released} is already there, so this is the next version.`}`;
17622
17637
  const where = `${plan.owner}/${plan.repo}`;
17623
17638
  return `${plan.createsRepository ? `Create repository ${where} on GitHub and publish v${plan.version}?` : `Publish v${plan.version} to ${where} on GitHub?`}${plan.released === void 0 ? "" : ` v${plan.released} is released there, so this is the next version.`} It will be ${plan.visibility === "public" ? `public, under the ${plan.license ?? "MIT"} license: anyone can read it and pull it into their own app` : "private"}.${plan.registry === true ? " It will be listed in the public Cordis plugin registry." : ""}`;
17624
17639
  }
@@ -17626,7 +17641,7 @@ window.__ModuleLoader__.load({
17626
17641
  function shareDetails(plan) {
17627
17642
  return [
17628
17643
  shareSentence(plan),
17629
- `Repository: ${plan.owner}/${plan.repo} on GitHub (${plan.createsRepository ? "a new one" : "it exists"}), ${plan.visibility}`,
17644
+ ...plan.npm === void 0 ? [`Repository: ${plan.owner}/${plan.repo} on GitHub (${plan.createsRepository ? "a new one" : "it exists"}), ${plan.visibility}`] : [`Package: ${plan.npm.package} on ${plan.npm.registry}`],
17630
17645
  ...plan.license === void 0 ? [] : [`License: ${plan.license}`],
17631
17646
  ...plan.registry === true ? ["Topic: cordis-plugin, which cordisplugins.github.io lists within about an hour"] : [],
17632
17647
  ...plan.placement === void 0 ? [] : [`Category: ${plan.placement.category}${plan.placement.subcategory === void 0 ? "" : ` › ${plan.placement.subcategory}`}, where this app is in the Blends store`]
@@ -17733,6 +17748,9 @@ window.__ModuleLoader__.load({
17733
17748
  ...target === void 0 ? { name } : target === "registry" ? {
17734
17749
  name,
17735
17750
  registry: true
17751
+ } : target === "npm" ? {
17752
+ name,
17753
+ npm: true
17736
17754
  } : {
17737
17755
  name,
17738
17756
  visibility: target
@@ -47361,7 +47379,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47361
47379
  className: "acrylBlendsShareAsk",
47362
47380
  role: "alertdialog",
47363
47381
  "aria-label": `Add ${item.name}`,
47364
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: addQuestion(item.name, item.owner, item.download, item.origin) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
47382
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: item.updateFrom === void 0 ? addQuestion(item.name, item.owner, item.download, item.origin) : `Update ${item.name} from v${item.updateFrom}? Changes you made to its folder are kept; if the new release changes the same lines, nothing is changed and it says which file.` }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
47365
47383
  className: "acrylBlendsShareRow",
47366
47384
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
47367
47385
  type: "button",
@@ -47377,7 +47395,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47377
47395
  onClick: () => {
47378
47396
  add(item.source);
47379
47397
  },
47380
- children: "Add to my app"
47398
+ children: item.updateFrom === void 0 ? "Add to my app" : "Update"
47381
47399
  })]
47382
47400
  })]
47383
47401
  });
@@ -47407,7 +47425,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47407
47425
  title: "Made for another kind of app; it may not run in this one",
47408
47426
  children: "other apps"
47409
47427
  }),
47410
- entry.installed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
47428
+ entry.installed && entry.updateFrom === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
47411
47429
  className: "acrylBlendsRegAdded",
47412
47430
  role: "status",
47413
47431
  children: "Added"
@@ -47422,10 +47440,11 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47422
47440
  name: entry.name,
47423
47441
  owner: entry.owner,
47424
47442
  origin: entry.origin,
47443
+ ...entry.updateFrom === void 0 ? {} : { updateFrom: entry.updateFrom },
47425
47444
  ...entry.download === void 0 ? {} : { download: entry.download }
47426
47445
  });
47427
47446
  },
47428
- children: adding === entry.source ? "Adding…" : "Add to my app"
47447
+ children: adding === entry.source ? entry.updateFrom === void 0 ? "Adding…" : "Updating…" : entry.updateFrom === void 0 ? "Add to my app" : `Update to v${entry.version}`
47429
47448
  })
47430
47449
  ]
47431
47450
  }),
@@ -47678,7 +47697,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47678
47697
  const address = colleagueAddress(shared);
47679
47698
  setState({
47680
47699
  step: "done",
47681
- text: plan.registry === true ? `Done. ${plugin.name} is shared. The registry lists new plugins within about an hour, then anyone can find it there.` : plan.visibility === "public" ? `Done. ${plugin.name} is shared with everyone.` : `Done. ${plugin.name} is shared with your team.`,
47700
+ text: plan.npm !== void 0 ? `Done. ${plugin.name} is published to npm as ${plan.npm.package}. Others take it with: npm run acryl -- plugin pull npm:${plan.npm.package}@${shared.version}` : plan.registry === true ? `Done. ${plugin.name} is shared. The registry lists new plugins within about an hour, then anyone can find it there.` : plan.visibility === "public" ? `Done. ${plugin.name} is shared with everyone.` : `Done. ${plugin.name} is shared with your team.`,
47682
47701
  ...address === void 0 ? {} : { address }
47683
47702
  });
47684
47703
  } catch (cause) {
@@ -47709,6 +47728,13 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47709
47728
  target: "public",
47710
47729
  disabled: share === void 0 || blocked
47711
47730
  },
47731
+ {
47732
+ title: "npm",
47733
+ say: "Publish it as an npm package under the account above (blank: your npm login), sent with your own npm login (npm login in a terminal). Public.",
47734
+ button: "Publish to npm",
47735
+ target: "npm",
47736
+ disabled: share === void 0
47737
+ },
47712
47738
  {
47713
47739
  title: "Public registry",
47714
47740
  say: "List it for everyone to search and add with one click. Public.",