@zeroxyz/cli 1.11.0 → 1.12.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 (3) hide show
  1. package/README.md +1 -3
  2. package/dist/index.js +76 -65
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -68,9 +68,7 @@ Bootstrap Zero for agent harnesses.
68
68
 
69
69
  ```bash
70
70
  zero init # target every supported agent
71
- zero init --agent codex # only Codex
72
- zero init --agent claude,codex # comma-separated or repeat --agent
73
- zero init --agent standalone # only standalone skills + Claude/Codex hooks
71
+ zero init --standalone # only standalone skills + Claude/Codex hooks
74
72
  zero init --no-fallback # fail instead of writing standalone fallback
75
73
  zero init --dry-run # preview actions
76
74
  ```
package/dist/index.js CHANGED
@@ -78576,7 +78576,7 @@ init_esm_shims();
78576
78576
 
78577
78577
  // package.json
78578
78578
  var package_default = {
78579
- version: "1.11.0"};
78579
+ version: "1.12.1"};
78580
78580
 
78581
78581
  // src/app.ts
78582
78582
  init_esm_shims();
@@ -149726,45 +149726,20 @@ var CODEX_HOOKS_PATH = ".codex/hooks.json";
149726
149726
  var CLI_VERSION = package_default.version;
149727
149727
  var STANDALONE = "standalone";
149728
149728
  var unique = (items) => [...new Set(items)];
149729
- var parseAgentValues = (values, matrixIds) => {
149730
- if (!values || values.length === 0) {
149729
+ var buildSelection = (standalone, matrixIds) => {
149730
+ if (standalone) {
149731
149731
  return {
149732
- kind: "default",
149733
- requestedAgents: [...matrixIds],
149734
- pluginAgents: [...matrixIds]
149732
+ kind: "standalone",
149733
+ requestedAgents: [STANDALONE],
149734
+ pluginAgents: []
149735
149735
  };
149736
149736
  }
149737
- const parsed = unique(
149738
- values.flatMap(
149739
- (value) => value.split(",").map((part) => part.trim().toLowerCase()).filter(Boolean)
149740
- )
149741
- );
149742
- if (parsed.length === 0) {
149743
- throw new Error("Pass at least one agent name to --agent");
149744
- }
149745
- const valid = /* @__PURE__ */ new Set([...matrixIds, STANDALONE]);
149746
- const agents = parsed.map((value) => {
149747
- if (!valid.has(value)) {
149748
- throw new Error(
149749
- `Unknown agent "${value}". Expected one of: ${[...valid].join(", ")}`
149750
- );
149751
- }
149752
- return value;
149753
- });
149754
- if (agents.includes(STANDALONE) && agents.length > 1) {
149755
- throw new Error(
149756
- "`standalone` cannot be combined with other --agent values; run it separately."
149757
- );
149758
- }
149759
- if (agents[0] === STANDALONE) {
149760
- return { kind: "standalone", requestedAgents: agents, pluginAgents: [] };
149761
- }
149762
- return { kind: "specific", requestedAgents: agents, pluginAgents: agents };
149737
+ return {
149738
+ kind: "default",
149739
+ requestedAgents: [...matrixIds],
149740
+ pluginAgents: [...matrixIds]
149741
+ };
149763
149742
  };
149764
- var collectAgentOption = (value, previous = []) => [
149765
- ...previous,
149766
- value
149767
- ];
149768
149743
  var commandSummary = (command, args) => [command, ...args].join(" ");
149769
149744
  var commandOutput = (result) => {
149770
149745
  const chunks = [result.stderr, result.stdout].map((chunk) => typeof chunk === "string" ? chunk.trim() : "").filter(Boolean);
@@ -149830,25 +149805,10 @@ var installAgentPlugin = (entry, method, options) => {
149830
149805
  detail: optionalFailure ? `installed; ignored ${optionalFailure}` : void 0
149831
149806
  };
149832
149807
  };
149833
- var manualInstructionLines = (entry, method) => {
149834
- if (!method) {
149835
- return [`${entry.name}: no automated plugin install is available.`];
149836
- }
149837
- return [
149838
- `${entry.name}: run these from a shell where \`${method.executable}\` is on PATH:`,
149839
- ...method.steps.map((step) => commandSummary(step.command, step.args))
149840
- ];
149841
- };
149842
- var printManualInstructions = (lines) => {
149843
- for (const line of lines) {
149844
- console.log(` ${color.gray("\xB7")} ${color.dim(line)}`);
149845
- }
149846
- };
149847
149808
  var fallbackReason = (selection, detections, results) => {
149848
- if (selection.kind === "standalone")
149849
- return "--agent standalone was requested";
149809
+ if (selection.kind === "standalone") return "--standalone was requested";
149850
149810
  if (!detections.some((detection) => detection.present)) {
149851
- return selection.kind === "default" ? "no supported harness was detected in this environment" : "no requested harness was detected in this environment";
149811
+ return "no supported harness was detected in this environment";
149852
149812
  }
149853
149813
  if (results.length > 0 && results.every((result) => result.status === "skipped_unavailable")) {
149854
149814
  return "no detected harness could install the Zero plugin";
@@ -150122,8 +150082,8 @@ var runInit = async (appContext, options = {}) => {
150122
150082
  );
150123
150083
  currentStep = "plugins";
150124
150084
  const entryById = new Map(entries.map((entry) => [entry.id, entry]));
150125
- const selection = parseAgentValues(
150126
- options.agent,
150085
+ const selection = buildSelection(
150086
+ options.standalone ?? false,
150127
150087
  entries.map((entry) => entry.id)
150128
150088
  );
150129
150089
  const requestedAgents = selection.requestedAgents;
@@ -150141,6 +150101,7 @@ var runInit = async (appContext, options = {}) => {
150141
150101
  }
150142
150102
  console.log("");
150143
150103
  const fallbackSkillDirs = [];
150104
+ const standaloneOnlyAgents = [];
150144
150105
  const pluginResults = [];
150145
150106
  for (const detection of detections) {
150146
150107
  const { entry, present, exeCallable, method } = detection;
@@ -150156,7 +150117,22 @@ var runInit = async (appContext, options = {}) => {
150156
150117
  }
150157
150118
  continue;
150158
150119
  }
150159
- const detail = !present ? `~/${entry.detect.dir} not found` : !method ? "no plugin install available for this harness" : `\`${entry.detect.exe}\` is not callable in this shell`;
150120
+ if (present && !method) {
150121
+ if ((entry.standalone?.skills ?? []).length > 0) {
150122
+ standaloneOnlyAgents.push(entry);
150123
+ } else {
150124
+ const result2 = {
150125
+ agent: entry.id,
150126
+ displayName: entry.name,
150127
+ status: "skipped_unavailable",
150128
+ detail: "no plugin or standalone skill available for this harness"
150129
+ };
150130
+ pluginResults.push(result2);
150131
+ stepSkip(`${entry.name}: ${statusLabel(result2)}`, result2.detail);
150132
+ }
150133
+ continue;
150134
+ }
150135
+ const detail = !present ? `~/${entry.detect.dir} not found` : `\`${entry.detect.exe}\` is not callable in this shell`;
150160
150136
  const result = {
150161
150137
  agent: entry.id,
150162
150138
  displayName: entry.name,
@@ -150170,10 +150146,12 @@ var runInit = async (appContext, options = {}) => {
150170
150146
  fallbackSkillDirs.push(join(home, dir));
150171
150147
  }
150172
150148
  }
150173
- if (selection.kind === "specific") {
150174
- printManualInstructions(manualInstructionLines(entry, method));
150175
- }
150176
150149
  }
150150
+ const standaloneOnlyDirs = unique(
150151
+ standaloneOnlyAgents.flatMap(
150152
+ (entry) => (entry.standalone?.skills ?? []).map((dir) => join(home, dir))
150153
+ )
150154
+ );
150177
150155
  const pluginSucceeded = pluginResults.some(
150178
150156
  (result) => result.status === "installed" || result.status === "would_install"
150179
150157
  );
@@ -150213,7 +150191,8 @@ var runInit = async (appContext, options = {}) => {
150213
150191
  verbose,
150214
150192
  skillsDir: unique([
150215
150193
  ...options.skillsDir ?? [],
150216
- ...fallbackSkillDirs
150194
+ ...fallbackSkillDirs,
150195
+ ...standaloneOnlyDirs
150217
150196
  ]),
150218
150197
  hookTargets: buildHookTargets(entries),
150219
150198
  onStep: (step) => {
@@ -150226,6 +150205,40 @@ var runInit = async (appContext, options = {}) => {
150226
150205
  console.log(
150227
150206
  " Standalone fallback not used: at least one harness plugin install succeeded."
150228
150207
  );
150208
+ if (standaloneOnlyDirs.length > 0) {
150209
+ currentStep = "skill";
150210
+ if (dryRun) {
150211
+ for (const dir of standaloneOnlyDirs) {
150212
+ stepInfo(`would install/update ${join(dir, "zero")}`);
150213
+ }
150214
+ } else {
150215
+ const skillMd = await fetchText(
150216
+ `${appContext.env.ZERO_WEB_URL}/SKILL.md`
150217
+ );
150218
+ const installed = installSkill(standaloneOnlyDirs, skillMd, verbose);
150219
+ standaloneResult = {
150220
+ ...standaloneResult,
150221
+ skillsInstalled: installed
150222
+ };
150223
+ }
150224
+ }
150225
+ }
150226
+ for (const entry of standaloneOnlyAgents) {
150227
+ const result = {
150228
+ agent: entry.id,
150229
+ displayName: entry.name,
150230
+ status: dryRun ? "would_install" : "installed",
150231
+ detail: "standalone skill (no plugin for this harness)"
150232
+ };
150233
+ pluginResults.push(result);
150234
+ if (dryRun) {
150235
+ stepSkip(
150236
+ `${entry.name}: would install standalone skill`,
150237
+ result.detail
150238
+ );
150239
+ } else {
150240
+ stepSuccess(`${entry.name}: standalone skill installed`, result.detail);
150241
+ }
150229
150242
  }
150230
150243
  currentStep = "complete";
150231
150244
  appContext.services.analyticsService.capture("init_completed", {
@@ -150280,12 +150293,10 @@ var runInit = async (appContext, options = {}) => {
150280
150293
  }
150281
150294
  };
150282
150295
  var initCommand = (appContext) => new Command("init").description(
150283
- "Install the Zero plugin for supported agents, with a standalone skill/hook fallback"
150296
+ "Install the Zero plugin for every supported agent, with a standalone skill/hook fallback"
150284
150297
  ).option(
150285
- "--agent <agent>",
150286
- "Agent target: a supported harness id (e.g. claude-code, codex, droid, gemini-cli) or standalone. Repeat or comma-separate values. Omit to target every supported agent.",
150287
- collectAgentOption,
150288
- []
150298
+ "--standalone",
150299
+ "Install only the standalone skill/hooks fallback; skip all plugin installs"
150289
150300
  ).option(
150290
150301
  "--no-fallback",
150291
150302
  "Do not install standalone skills/hooks if plugin install does not succeed"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroxyz/cli",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zero": "dist/index.js",