ninekit-cli 1.2.0-dev.1 → 1.2.0-dev.2

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/cli-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "1.2.0-dev.1",
3
- "generatedAt": "2026-06-24T10:37:12.344Z",
2
+ "version": "1.2.0-dev.2",
3
+ "generatedAt": "2026-07-03T08:49:26.231Z",
4
4
  "commands": {
5
5
  "agents": {
6
6
  "name": "agents",
package/dist/index.js CHANGED
@@ -64731,7 +64731,7 @@ var package_default;
64731
64731
  var init_package = __esm(() => {
64732
64732
  package_default = {
64733
64733
  name: "ninekit-cli",
64734
- version: "1.2.0-dev.1",
64734
+ version: "1.2.0-dev.2",
64735
64735
  description: "CLI tool for bootstrapping and updating NineKit projects",
64736
64736
  type: "module",
64737
64737
  repository: {
@@ -68394,20 +68394,23 @@ async function countMissingNkHookRegistrations(claudeDir3, _kit) {
68394
68394
  }
68395
68395
  return missing;
68396
68396
  }
68397
+ function buildInitArgs(options2) {
68398
+ const args = ["init"];
68399
+ if (options2.isGlobal)
68400
+ args.push("-g");
68401
+ if (options2.kit)
68402
+ args.push("--kit", options2.kit);
68403
+ if (options2.yes)
68404
+ args.push("--yes");
68405
+ if (options2.restoreCkHooks)
68406
+ args.push("--restore-nk-hooks");
68407
+ args.push("--install-skills");
68408
+ if (options2.beta)
68409
+ args.push("--beta");
68410
+ return args;
68411
+ }
68397
68412
  function buildInitCommand(isGlobal, kit, beta, yes, restoreCkHooks) {
68398
- const parts = ["nk init"];
68399
- if (isGlobal)
68400
- parts.push("-g");
68401
- if (kit)
68402
- parts.push(`--kit ${kit}`);
68403
- if (yes)
68404
- parts.push("--yes");
68405
- if (restoreCkHooks)
68406
- parts.push("--restore-nk-hooks");
68407
- parts.push("--install-skills");
68408
- if (beta)
68409
- parts.push("--beta");
68410
- return parts.join(" ");
68413
+ return `nk ${buildInitArgs({ isGlobal, kit, beta, yes, restoreCkHooks }).join(" ")}`;
68411
68414
  }
68412
68415
  function resolveCkExecutable(platformName = process.platform) {
68413
68416
  return platformName === "win32" ? "nk.cmd" : "nk";
@@ -68427,6 +68430,17 @@ function resolveCkInitSpawnCommand(initArgs, options2 = {}) {
68427
68430
  args: initArgs
68428
68431
  };
68429
68432
  }
68433
+ function createDefaultSpawnInitFn() {
68434
+ return (spawnArgs) => new Promise((resolve34) => {
68435
+ const initCommand = resolveCkInitSpawnCommand(spawnArgs);
68436
+ const child = spawn2(initCommand.command, initCommand.args, { stdio: "inherit" });
68437
+ child.on("close", (code) => resolve34(code ?? 1));
68438
+ child.on("error", (err) => {
68439
+ logger.verbose(`Failed to spawn nk init: ${err.message}`);
68440
+ resolve34(1);
68441
+ });
68442
+ });
68443
+ }
68430
68444
  async function fetchLatestReleaseTag(kit, beta) {
68431
68445
  try {
68432
68446
  const { GitHubClient: GitHubClient2 } = await Promise.resolve().then(() => (init_github_client(), exports_github_client));
@@ -68467,11 +68481,11 @@ async function findMissingHookDependencies(claudeDir3) {
68467
68481
  }
68468
68482
  async function promptKitUpdate(beta, yes, deps) {
68469
68483
  try {
68470
- const execFn = deps?.execAsyncFn ?? execAsync2;
68471
68484
  const loadFullConfigFn = deps?.loadFullConfigFn ?? NkConfigManager.loadFull;
68472
68485
  const confirmFn = deps?.confirmFn ?? se;
68473
68486
  const isCancelFn = deps?.isCancelFn ?? lD;
68474
68487
  const getSetupFn = deps?.getSetupFn ?? getNineKitSetup;
68488
+ const spawnFn = deps?.spawnInitFn ?? createDefaultSpawnInitFn();
68475
68489
  const findMissingHookDepsFn = deps?.findMissingHookDependenciesFn ?? findMissingHookDependencies;
68476
68490
  const setup = await getSetupFn();
68477
68491
  const hasLocal = !!setup.project.metadata;
@@ -68610,12 +68624,23 @@ async function promptKitUpdate(beta, yes, deps) {
68610
68624
  }
68611
68625
  const useBeta = beta || isBetaInstalled;
68612
68626
  if (yes) {
68613
- const initCmd = buildInitCommand(selection.isGlobal, selection.kit, useBeta, true, forceKitReinstall);
68614
- logger.info(`Running: ${initCmd}`);
68627
+ const args = buildInitArgs({
68628
+ isGlobal: selection.isGlobal,
68629
+ kit: selection.kit,
68630
+ beta: useBeta,
68631
+ yes: true,
68632
+ restoreCkHooks: forceKitReinstall
68633
+ });
68634
+ logger.info(`Running: nk ${args.join(" ")}`);
68615
68635
  const s = (deps?.spinnerFn ?? de)();
68616
- s.start("Updating NineKit content...");
68636
+ s.start("Preparing NineKit content update...");
68637
+ s.stop("Running NineKit content update");
68617
68638
  try {
68618
- await execFn(initCmd, { timeout: 300000 });
68639
+ const exitCode = await spawnFn(args);
68640
+ if (exitCode !== 0) {
68641
+ logger.warning("Kit content update may have encountered issues");
68642
+ return;
68643
+ }
68619
68644
  let newKitVersion;
68620
68645
  try {
68621
68646
  const claudeDir3 = selection.isGlobal ? setup.global.path : setup.project.path;
@@ -68623,42 +68648,25 @@ async function promptKitUpdate(beta, yes, deps) {
68623
68648
  newKitVersion = selection.kit ? updatedMetadata?.kits?.[selection.kit]?.version : undefined;
68624
68649
  } catch {}
68625
68650
  if (selection.kit && kitVersion && newKitVersion && kitVersion !== newKitVersion) {
68626
- s.stop(`Kit updated: ${selection.kit}@${kitVersion} -> ${newKitVersion}`);
68651
+ logger.success(`Kit updated: ${selection.kit}@${kitVersion} -> ${newKitVersion}`);
68627
68652
  } else if (selection.kit && newKitVersion) {
68628
- s.stop(`Kit content updated (${selection.kit}@${newKitVersion})`);
68653
+ logger.success(`Kit content updated (${selection.kit}@${newKitVersion})`);
68629
68654
  } else {
68630
- s.stop("Kit content updated");
68655
+ logger.success("Kit content updated");
68631
68656
  }
68632
68657
  } catch (error) {
68633
- s.stop("Kit update finished");
68634
68658
  const errorMsg = error instanceof Error ? error.message : "unknown";
68635
- if (errorMsg.includes("exit code") && !errorMsg.includes("exit code 0")) {
68636
- logger.warning("Kit content update may have encountered issues");
68637
- logger.verbose(`Error: ${errorMsg}`);
68638
- } else {
68639
- logger.verbose(`Init command completed: ${errorMsg}`);
68640
- }
68659
+ logger.warning("Kit content update may have encountered issues");
68660
+ logger.verbose(`Error: ${errorMsg}`);
68641
68661
  }
68642
68662
  } else {
68643
- const args = ["init"];
68644
- if (selection.isGlobal)
68645
- args.push("-g");
68646
- if (forceKitReinstall)
68647
- args.push("--restore-nk-hooks");
68648
- args.push("--install-skills");
68649
- if (useBeta)
68650
- args.push("--beta");
68663
+ const args = buildInitArgs({
68664
+ isGlobal: selection.isGlobal,
68665
+ beta: useBeta,
68666
+ restoreCkHooks: forceKitReinstall
68667
+ });
68651
68668
  const displayCmd = `nk ${args.join(" ")}`;
68652
68669
  logger.info(`Running: ${displayCmd}`);
68653
- const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((resolve34) => {
68654
- const initCommand = resolveCkInitSpawnCommand(spawnArgs);
68655
- const child = spawn2(initCommand.command, initCommand.args, { stdio: "inherit" });
68656
- child.on("close", (code) => resolve34(code ?? 1));
68657
- child.on("error", (err) => {
68658
- logger.verbose(`Failed to spawn nk init: ${err.message}`);
68659
- resolve34(1);
68660
- });
68661
- }));
68662
68670
  const exitCode = await spawnFn(args);
68663
68671
  if (exitCode !== 0) {
68664
68672
  logger.warning("Kit content update may have encountered issues");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ninekit-cli",
3
- "version": "1.2.0-dev.1",
3
+ "version": "1.2.0-dev.2",
4
4
  "description": "CLI tool for bootstrapping and updating NineKit projects",
5
5
  "type": "module",
6
6
  "repository": {