claudekit-cli 3.41.4-dev.18 → 3.41.4-dev.19

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/index.js +79 -71
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10628,13 +10628,16 @@ var init_direct_copy = __esm(() => {
10628
10628
  var exports_provider_registry = {};
10629
10629
  __export(exports_provider_registry, {
10630
10630
  providers: () => providers,
10631
+ hasBinaryInPath: () => hasBinaryInPath,
10631
10632
  getProvidersSupporting: () => getProvidersSupporting,
10632
10633
  getProviderConfig: () => getProviderConfig,
10633
10634
  getPortableInstallPath: () => getPortableInstallPath,
10634
10635
  getAllProviderTypes: () => getAllProviderTypes,
10635
10636
  detectProviderPathCollisions: () => detectProviderPathCollisions,
10636
- detectInstalledProviders: () => detectInstalledProviders
10637
+ detectInstalledProviders: () => detectInstalledProviders,
10638
+ binaryCache: () => binaryCache
10637
10639
  });
10640
+ import { execFileSync } from "node:child_process";
10638
10641
  import { existsSync, readdirSync, statSync } from "node:fs";
10639
10642
  import { homedir, platform } from "node:os";
10640
10643
  import { join } from "node:path";
@@ -10658,8 +10661,21 @@ function hasInstallSignal(path) {
10658
10661
  function hasAnyInstallSignal(paths) {
10659
10662
  return paths.some((path) => hasInstallSignal(path));
10660
10663
  }
10664
+ function hasBinaryInPath(name) {
10665
+ const cached = binaryCache.get(name);
10666
+ if (cached !== undefined)
10667
+ return cached;
10668
+ try {
10669
+ execFileSync(isWin ? "where" : "which", [name], { stdio: "pipe", timeout: 3000 });
10670
+ binaryCache.set(name, true);
10671
+ return true;
10672
+ } catch {
10673
+ binaryCache.set(name, false);
10674
+ return false;
10675
+ }
10676
+ }
10661
10677
  function hasOpenCodeInstallSignal() {
10662
- return hasAnyInstallSignal([
10678
+ return hasBinaryInPath("opencode") || hasAnyInstallSignal([
10663
10679
  join(cwd, "opencode.json"),
10664
10680
  join(cwd, "opencode.jsonc"),
10665
10681
  join(cwd, ".opencode/agents"),
@@ -10731,11 +10747,13 @@ function detectProviderPathCollisions(selectedProviders, options2) {
10731
10747
  }
10732
10748
  return collisions;
10733
10749
  }
10734
- var home, cwd, OPENCODE_BINARY_NAME, providers;
10750
+ var home, cwd, isWin, OPENCODE_BINARY_NAME, binaryCache, providers;
10735
10751
  var init_provider_registry = __esm(() => {
10736
10752
  home = homedir();
10737
10753
  cwd = process.cwd();
10738
- OPENCODE_BINARY_NAME = platform() === "win32" ? "opencode.exe" : "opencode";
10754
+ isWin = platform() === "win32";
10755
+ OPENCODE_BINARY_NAME = isWin ? "opencode.exe" : "opencode";
10756
+ binaryCache = new Map;
10739
10757
  providers = {
10740
10758
  "claude-code": {
10741
10759
  name: "claude-code",
@@ -10787,7 +10805,7 @@ var init_provider_registry = __esm(() => {
10787
10805
  projectPath: ".claude/settings.json",
10788
10806
  globalPath: join(home, ".claude/settings.json")
10789
10807
  },
10790
- detect: async () => hasAnyInstallSignal([
10808
+ detect: async () => hasBinaryInPath("claude") || hasAnyInstallSignal([
10791
10809
  join(cwd, ".claude/agents"),
10792
10810
  join(cwd, ".claude/commands"),
10793
10811
  join(cwd, ".claude/skills"),
@@ -10938,7 +10956,7 @@ var init_provider_registry = __esm(() => {
10938
10956
  projectPath: ".codex/hooks.json",
10939
10957
  globalPath: join(home, ".codex/hooks.json")
10940
10958
  },
10941
- detect: async () => hasAnyInstallSignal([
10959
+ detect: async () => hasBinaryInPath("codex") || hasAnyInstallSignal([
10942
10960
  join(cwd, ".codex/config.toml"),
10943
10961
  join(cwd, ".codex/agents"),
10944
10962
  join(cwd, ".codex/prompts"),
@@ -11001,7 +11019,7 @@ var init_provider_registry = __esm(() => {
11001
11019
  projectPath: ".factory/settings.json",
11002
11020
  globalPath: join(home, ".factory/settings.json")
11003
11021
  },
11004
- detect: async () => hasAnyInstallSignal([
11022
+ detect: async () => hasBinaryInPath("droid") || hasAnyInstallSignal([
11005
11023
  join(cwd, ".factory/droids"),
11006
11024
  join(cwd, ".factory/commands"),
11007
11025
  join(cwd, ".factory/skills"),
@@ -11052,7 +11070,7 @@ var init_provider_registry = __esm(() => {
11052
11070
  },
11053
11071
  hooks: null,
11054
11072
  settingsJsonPath: null,
11055
- detect: async () => hasAnyInstallSignal([
11073
+ detect: async () => hasBinaryInPath("cursor") || hasAnyInstallSignal([
11056
11074
  join(cwd, ".cursor/rules"),
11057
11075
  join(home, ".cursor/rules"),
11058
11076
  join(home, ".cursor/skills")
@@ -11235,7 +11253,7 @@ var init_provider_registry = __esm(() => {
11235
11253
  },
11236
11254
  hooks: null,
11237
11255
  settingsJsonPath: null,
11238
- detect: async () => hasAnyInstallSignal([
11256
+ detect: async () => hasBinaryInPath("windsurf") || hasAnyInstallSignal([
11239
11257
  join(cwd, ".windsurf/rules"),
11240
11258
  join(cwd, ".windsurf/workflows"),
11241
11259
  join(home, ".codeium/windsurf/rules"),
@@ -11277,7 +11295,7 @@ var init_provider_registry = __esm(() => {
11277
11295
  },
11278
11296
  hooks: null,
11279
11297
  settingsJsonPath: null,
11280
- detect: async () => hasAnyInstallSignal([
11298
+ detect: async () => hasBinaryInPath("goose") || hasAnyInstallSignal([
11281
11299
  join(cwd, ".goosehints"),
11282
11300
  join(cwd, ".goose/skills"),
11283
11301
  join(home, ".config/goose/.goosehints"),
@@ -11334,7 +11352,7 @@ var init_provider_registry = __esm(() => {
11334
11352
  projectPath: ".gemini/settings.json",
11335
11353
  globalPath: join(home, ".gemini/settings.json")
11336
11354
  },
11337
- detect: async () => hasAnyInstallSignal([
11355
+ detect: async () => hasBinaryInPath("gemini") || hasAnyInstallSignal([
11338
11356
  join(cwd, ".gemini/commands"),
11339
11357
  join(cwd, "GEMINI.md"),
11340
11358
  join(home, ".gemini/commands"),
@@ -11376,7 +11394,7 @@ var init_provider_registry = __esm(() => {
11376
11394
  },
11377
11395
  hooks: null,
11378
11396
  settingsJsonPath: null,
11379
- detect: async () => hasAnyInstallSignal([
11397
+ detect: async () => hasBinaryInPath("amp") || hasAnyInstallSignal([
11380
11398
  join(cwd, ".amp/rules"),
11381
11399
  join(cwd, "AGENT.md"),
11382
11400
  join(home, ".config/amp/rules"),
@@ -11419,11 +11437,12 @@ var init_provider_registry = __esm(() => {
11419
11437
  },
11420
11438
  hooks: null,
11421
11439
  settingsJsonPath: null,
11422
- detect: async () => hasAnyInstallSignal([
11440
+ detect: async () => hasBinaryInPath("agy") || hasBinaryInPath("antigravity") || hasAnyInstallSignal([
11423
11441
  join(cwd, ".agent/rules"),
11424
11442
  join(cwd, ".agent/skills"),
11425
11443
  join(cwd, ".agent/workflows"),
11426
11444
  join(cwd, "GEMINI.md"),
11445
+ join(home, ".gemini/antigravity"),
11427
11446
  join(home, ".gemini/antigravity/skills")
11428
11447
  ])
11429
11448
  },
@@ -44008,7 +44027,7 @@ var init_default_browser_id = __esm(() => {
44008
44027
  // node_modules/run-applescript/index.js
44009
44028
  import process13 from "node:process";
44010
44029
  import { promisify as promisify4 } from "node:util";
44011
- import { execFile as execFile4, execFileSync } from "node:child_process";
44030
+ import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
44012
44031
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
44013
44032
  if (process13.platform !== "darwin") {
44014
44033
  throw new Error("macOS only");
@@ -60533,7 +60552,7 @@ var package_default;
60533
60552
  var init_package = __esm(() => {
60534
60553
  package_default = {
60535
60554
  name: "claudekit-cli",
60536
- version: "3.41.4-dev.18",
60555
+ version: "3.41.4-dev.19",
60537
60556
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
60538
60557
  type: "module",
60539
60558
  repository: {
@@ -73092,9 +73111,9 @@ var init_git_scanner = __esm(() => {
73092
73111
  });
73093
73112
 
73094
73113
  // src/commands/content/phases/platform-adapters/facebook-adapter.ts
73095
- import { execFileSync as execFileSync2 } from "node:child_process";
73114
+ import { execFileSync as execFileSync3 } from "node:child_process";
73096
73115
  function runFbcli(args, timeoutMs = 30000) {
73097
- return execFileSync2("fbcli", [...args, "--json"], {
73116
+ return execFileSync3("fbcli", [...args, "--json"], {
73098
73117
  stdio: "pipe",
73099
73118
  timeout: timeoutMs
73100
73119
  }).toString();
@@ -73134,7 +73153,7 @@ class FacebookAdapter {
73134
73153
  if (options2?.dryRun)
73135
73154
  return dryRunResult();
73136
73155
  try {
73137
- const raw2 = execFileSync2("fbcli", ["post", "--json"], {
73156
+ const raw2 = execFileSync3("fbcli", ["post", "--json"], {
73138
73157
  input: text,
73139
73158
  stdio: ["pipe", "pipe", "pipe"],
73140
73159
  timeout: 30000
@@ -73159,7 +73178,7 @@ class FacebookAdapter {
73159
73178
  if (options2?.dryRun)
73160
73179
  return dryRunResult();
73161
73180
  try {
73162
- const raw2 = execFileSync2("fbcli", ["post", "-i", mediaPath, "--json"], {
73181
+ const raw2 = execFileSync3("fbcli", ["post", "-i", mediaPath, "--json"], {
73163
73182
  input: text,
73164
73183
  stdio: ["pipe", "pipe", "pipe"],
73165
73184
  timeout: 60000
@@ -85455,7 +85474,7 @@ function isUnix(patch) {
85455
85474
  }
85456
85475
  return !patch.some((index) => index.hunks.some((hunk) => hunk.lines.some((line) => !line.startsWith("\\") && line.endsWith("\r"))));
85457
85476
  }
85458
- function isWin(patch) {
85477
+ function isWin2(patch) {
85459
85478
  if (!Array.isArray(patch)) {
85460
85479
  patch = [patch];
85461
85480
  }
@@ -85618,7 +85637,7 @@ function applyStructuredPatch(source, patch, options2 = {}) {
85618
85637
  if (options2.autoConvertLineEndings || options2.autoConvertLineEndings == null) {
85619
85638
  if (hasOnlyWinLineEndings(source) && isUnix(patch)) {
85620
85639
  patch = unixToWin(patch);
85621
- } else if (hasOnlyUnixLineEndings(source) && isWin(patch)) {
85640
+ } else if (hasOnlyUnixLineEndings(source) && isWin2(patch)) {
85622
85641
  patch = winToUnix(patch);
85623
85642
  }
85624
85643
  }
@@ -103539,6 +103558,14 @@ async function migrateCommand(options2) {
103539
103558
  f2.info(`Found: ${parts.join(", ")}`);
103540
103559
  const detectedProviders = await detectInstalledProviders();
103541
103560
  let selectedProviders;
103561
+ const allSupportedProviders = Array.from(new Set([
103562
+ ...getProvidersSupporting("agents"),
103563
+ ...getProvidersSupporting("commands"),
103564
+ ...getProvidersSupporting("skills"),
103565
+ ...getProvidersSupporting("config"),
103566
+ ...getProvidersSupporting("rules"),
103567
+ ...getProvidersSupporting("hooks")
103568
+ ]));
103542
103569
  if (options2.agent && options2.agent.length > 0) {
103543
103570
  const validProviders = Object.keys(providers);
103544
103571
  const invalid = options2.agent.filter((a3) => !validProviders.includes(a3));
@@ -103550,62 +103577,43 @@ async function migrateCommand(options2) {
103550
103577
  }
103551
103578
  selectedProviders = options2.agent;
103552
103579
  } else if (options2.all) {
103553
- const allProviders = new Set([
103554
- ...getProvidersSupporting("agents"),
103555
- ...getProvidersSupporting("commands"),
103556
- ...getProvidersSupporting("skills"),
103557
- ...getProvidersSupporting("config"),
103558
- ...getProvidersSupporting("rules"),
103559
- ...getProvidersSupporting("hooks")
103560
- ]);
103561
- selectedProviders = Array.from(allProviders);
103580
+ selectedProviders = allSupportedProviders;
103562
103581
  f2.info(`Migrating to all ${selectedProviders.length} providers`);
103563
- } else if (detectedProviders.length === 0) {
103564
- if (options2.yes) {
103565
- const allProviders = new Set([
103566
- ...getProvidersSupporting("agents"),
103567
- ...getProvidersSupporting("commands"),
103568
- ...getProvidersSupporting("skills"),
103569
- ...getProvidersSupporting("config"),
103570
- ...getProvidersSupporting("rules"),
103571
- ...getProvidersSupporting("hooks")
103572
- ]);
103573
- selectedProviders = Array.from(allProviders);
103582
+ } else if (options2.yes) {
103583
+ if (detectedProviders.length > 0) {
103584
+ selectedProviders = detectedProviders;
103585
+ f2.info(`Migrating to: ${detectedProviders.map((a3) => import_picocolors28.default.cyan(providers[a3].displayName)).join(", ")}`);
103586
+ } else {
103587
+ selectedProviders = allSupportedProviders;
103574
103588
  f2.info("No providers detected, migrating to all");
103589
+ }
103590
+ } else {
103591
+ const detectedSet = new Set(detectedProviders);
103592
+ const notDetected = allSupportedProviders.filter((pv) => !detectedSet.has(pv));
103593
+ const toOption = (key) => ({
103594
+ value: key,
103595
+ label: providers[key].displayName
103596
+ });
103597
+ if (detectedProviders.length > 0) {
103598
+ f2.info(`Detected ${import_picocolors28.default.cyan(String(detectedProviders.length))} installed provider(s)`);
103575
103599
  } else {
103576
103600
  f2.warn("No providers detected on your system.");
103577
- const allProviders = new Set([
103578
- ...getProvidersSupporting("agents"),
103579
- ...getProvidersSupporting("commands"),
103580
- ...getProvidersSupporting("skills"),
103581
- ...getProvidersSupporting("config"),
103582
- ...getProvidersSupporting("rules"),
103583
- ...getProvidersSupporting("hooks")
103584
- ]);
103585
- const selected = await ae({
103586
- message: "Select providers to migrate to",
103587
- options: Array.from(allProviders).map((key) => ({
103588
- value: key,
103589
- label: providers[key].displayName
103590
- })),
103591
- required: true
103592
- });
103593
- if (lD(selected)) {
103594
- ue("Migrate cancelled");
103595
- return;
103596
- }
103597
- selectedProviders = selected;
103598
103601
  }
103599
- } else if (detectedProviders.length === 1 || options2.yes) {
103600
- selectedProviders = detectedProviders;
103601
- f2.info(`Migrating to: ${detectedProviders.map((a3) => import_picocolors28.default.cyan(providers[a3].displayName)).join(", ")}`);
103602
- } else {
103603
- const selected = await ae({
103602
+ const groupOptions = {};
103603
+ if (detectedProviders.length > 0) {
103604
+ groupOptions[`Detected ${import_picocolors28.default.dim("(installed)")}`] = detectedProviders.map(toOption);
103605
+ }
103606
+ if (notDetected.length > 0) {
103607
+ groupOptions[`Not detected ${import_picocolors28.default.dim("(select manually if installed)")}`] = notDetected.map(toOption);
103608
+ }
103609
+ if (Object.keys(groupOptions).length === 0) {
103610
+ ue("No providers available");
103611
+ return;
103612
+ }
103613
+ const selected = await ce({
103604
103614
  message: "Select providers to migrate to",
103605
- options: detectedProviders.map((a3) => ({
103606
- value: a3,
103607
- label: providers[a3].displayName
103608
- })),
103615
+ options: groupOptions,
103616
+ initialValues: detectedProviders,
103609
103617
  required: true
103610
103618
  });
103611
103619
  if (lD(selected)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "3.41.4-dev.18",
3
+ "version": "3.41.4-dev.19",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {