zion 4.3.0 → 4.3.1

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/cli.js +17 -24
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import os3 from "os";
8
8
  import path16 from "path";
9
9
 
10
10
  // package.json
11
- var version = "4.3.0";
11
+ var version = "4.3.1";
12
12
 
13
13
  // src/lib/theme.ts
14
14
  import { Chalk, supportsColor, supportsColorStderr } from "chalk";
@@ -22426,7 +22426,11 @@ var UpdateFlow = class {
22426
22426
  if (installed.length === 0) {
22427
22427
  ui.outro("No skills are installed.", {
22428
22428
  tone: "muted",
22429
- lines: [`Install some with ${ctx.bin} skills install.`]
22429
+ lines: [
22430
+ `Install some with ${ctx.bin} skills install.`,
22431
+ // Without --project or --global, this was only the project's skills.
22432
+ ...options.scope ? [] : [`Add -g to update your global skills instead.`]
22433
+ ]
22430
22434
  });
22431
22435
  return 0;
22432
22436
  }
@@ -22434,18 +22438,17 @@ var UpdateFlow = class {
22434
22438
  if (missing)
22435
22439
  throw new CliError(`${missing} isn't installed`, `install it with ${ctx.bin} skills install ${missing}`);
22436
22440
  const names = options.names.length > 0 ? [...new Set(options.names)] : installed;
22437
- const pick2 = ctx.interactive && options.names.length === 0 && !options.yes;
22438
22441
  const checks = await ui.task(
22439
22442
  `Checking ${plural(names.length, "skill")} for updates`,
22440
22443
  (signal) => this.check(names, lock.skills, signal),
22441
- (checks2) => describeChecks(ctx.paint.stderr, checks2, { listUpdates: !pick2 })
22444
+ (checks2) => describeChecks(ctx.paint.stderr, checks2)
22442
22445
  );
22443
22446
  const outdated = checks.filter(isOutdated);
22444
22447
  if (outdated.length === 0) {
22445
22448
  ui.outro(names.length === 1 ? `${names[0]} is up to date.` : "Everything is up to date.");
22446
22449
  return 0;
22447
22450
  }
22448
- const chosen = pick2 ? await this.chooseUpdates(ui, outdated) : outdated.map((check2) => check2.latest);
22451
+ const chosen = outdated.map((check2) => check2.latest);
22449
22452
  const copies = (await Promise.all(chosen.map((skill) => planCopies(this.deps, skill, lock.skills[skill.name], [])))).flat();
22450
22453
  const retry = `${ctx.bin} skills update ${options.names.join(" ")}`.trimEnd();
22451
22454
  if (!await confirmConflicts(ui, copies, { yes: options.yes, retry })) {
@@ -22477,27 +22480,15 @@ var UpdateFlow = class {
22477
22480
  })
22478
22481
  );
22479
22482
  }
22480
- async chooseUpdates(ui, outdated) {
22481
- const width = Math.max(...outdated.map((check2) => shortCommit(check2.locked.commit).length));
22482
- return ui.multiselect({
22483
- message: "Update which?",
22484
- options: outdated.map((check2) => ({
22485
- value: check2.latest,
22486
- label: check2.name,
22487
- hint: describeChange(check2.locked, check2.latest).padStart(width)
22488
- })),
22489
- initialValues: outdated.map((check2) => check2.latest)
22490
- });
22491
- }
22492
22483
  };
22493
22484
  function isOutdated(check2) {
22494
22485
  return isNewer(check2.latest, check2.locked);
22495
22486
  }
22496
- function describeChecks(paint, checks, { listUpdates }) {
22487
+ function describeChecks(paint, checks) {
22497
22488
  const updates = checks.filter(isOutdated);
22498
22489
  const gone = checks.filter((check2) => check2.gone);
22499
22490
  if (updates.length === 0 && gone.length === 0) return { title: "Up to date" };
22500
- const shown2 = [...listUpdates ? updates : [], ...gone];
22491
+ const shown2 = [...updates, ...gone];
22501
22492
  const width = Math.max(0, ...shown2.map((check2) => check2.name.length));
22502
22493
  return {
22503
22494
  title: updates.length > 0 ? `${plural(updates.length, "update")} available` : `${plural(gone.length, "skill")} no longer available`,
@@ -22511,7 +22502,7 @@ function describeChecks(paint, checks, { listUpdates }) {
22511
22502
  // src/commands/skills/actions.ts
22512
22503
  var SKILLS_ACTIONS = [
22513
22504
  { id: "install", aliases: ["add"], hint: "choose skills and where they go" },
22514
- { id: "update", aliases: ["upgrade"], hint: "get newer versions of installed skills" },
22505
+ { id: "update", aliases: ["upgrade"], hint: "update every installed skill in this project (-g for global)" },
22515
22506
  { id: "remove", aliases: ["rm", "uninstall"], hint: "delete skills zion installed" },
22516
22507
  { id: "list", aliases: ["ls"], hint: "print every skill and where it is installed" },
22517
22508
  { id: "show", aliases: [], hint: "print a skill's SKILL.md" }
@@ -22658,7 +22649,7 @@ var SkillsCommand = class {
22658
22649
  const { targets, lockfile, store } = scopes.global;
22659
22650
  this.help = {
22660
22651
  usage: "[action] [skill...] [options]",
22661
- description: `Downloads skills from ${api.host} into the folders your agents load them from, replacing each skill folder whole, or symlinking it to a copy zion keeps in its own folder. Without an action, it shows every skill as a checklist where ticked means installed: tick to install, untick to remove, and installed skills with a newer version are updated too. When not in a terminal, it prints the list instead. It asks whether to work in this project or your home directory unless you pass --project or --global. zion records what it installed in ${tildify(lockfile.path)} (${relative(
22652
+ description: `Downloads skills from ${api.host} into the folders your agents load them from, replacing each skill folder whole, or symlinking it to a copy zion keeps in its own folder. Without an action, it shows every skill as a checklist where ticked means installed: tick to install, untick to remove, and installed skills with a newer version are updated too. When not in a terminal, it prints the list instead. It asks whether to work in this project or your home directory unless you pass --project or --global, except update, which takes this project unless you pass --global. zion records what it installed in ${tildify(lockfile.path)} (${relative(
22662
22653
  scopes.project.lockfile.path
22663
22654
  )} with --project), and asks before replacing or deleting a skill folder that differs from what it installed. Targets: ${targets.map((t) => `${t.id} is ${tildify(t.dir)}`).join(", ")}; with --project, the same paths under the current folder. Press p in the list to mark a skill private in a git project; zion then excludes it, and zion's whole folder once all are. Linked skills are kept in ${tildify(store)} (${tildify(scopes.project.store)} with --project).`,
22664
22655
  arguments: {
@@ -22670,7 +22661,7 @@ var SkillsCommand = class {
22670
22661
  },
22671
22662
  options: [
22672
22663
  ["-p, --project", `work in this folder, recorded in ${relative(scopes.project.lockfile.path)}`],
22673
- ["-g, --global", "work in your home directory (the default without a terminal)"],
22664
+ ["-g, --global", "work in your home directory (the default without a terminal, except for update)"],
22674
22665
  ["-t, --target <name>", `${targets.map((t) => t.id).join(" or ")}; repeat for both`],
22675
22666
  ["-l, --link", "symlink to a copy zion keeps, instead of copying into each folder (install)"],
22676
22667
  ["--copy", "copy into each folder without asking (install)"],
@@ -22678,7 +22669,7 @@ var SkillsCommand = class {
22678
22669
  ["--public", "do not keep them out of git, without asking (install)"],
22679
22670
  [
22680
22671
  "--sudo",
22681
- `read skills straight from the private ${sudoApi.host} repo, listing every folder in it, instead of from ${api.host}; needs a GitHub login that can read it`
22672
+ `read skills straight from the private ${sudoApi.host} repo, listing every skill in it, instead of from ${api.host}; needs a GitHub login that can read it`
22682
22673
  ],
22683
22674
  ["-a, --all", "every skill (install and remove)"],
22684
22675
  ["-y, --yes", "say yes to every confirmation, including replacing edited folders"],
@@ -22692,6 +22683,8 @@ var SkillsCommand = class {
22692
22683
  "skills list --sudo",
22693
22684
  "skills install --all -t agents -t claude --yes",
22694
22685
  "skills update",
22686
+ "skills update -g",
22687
+ "skills update --sudo",
22695
22688
  "skills list --json",
22696
22689
  "skills show commit | less",
22697
22690
  "skills remove commit --yes"
@@ -22717,7 +22710,7 @@ var SkillsCommand = class {
22717
22710
  const ui = base.createPrompter(ctx);
22718
22711
  return runSession(ui, async () => {
22719
22712
  ui.intro("skills", base.api.host);
22720
- const scope = options.scope ?? await this.chooseScope(ui);
22713
+ const scope = options.scope ?? (given === "update" ? "project" : await this.chooseScope(ui));
22721
22714
  const deps = this.depsFor(base, scope);
22722
22715
  const flows = { install: InstallFlow, update: UpdateFlow, remove: RemoveFlow };
22723
22716
  return given ? new flows[given](deps).run(ui, options, ctx) : new ManageFlow(deps).run(ui, ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zion",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "my site, dotfiles, agent skills and more, in your terminal",
5
5
  "license": "MIT",
6
6
  "repository": {