@mushi-mushi/cli 0.38.0 → 0.39.0

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.
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  resolveSdkEnvKey,
4
4
  runConnect
5
- } from "./chunk-BUCMB4NS.js";
6
- import "./chunk-KOBEOGNF.js";
7
- import "./chunk-QZMSGTVZ.js";
8
- import "./chunk-DJNAPA4D.js";
5
+ } from "./chunk-OZPDPF6G.js";
6
+ import "./chunk-CG5KPP4S.js";
7
+ import "./chunk-PPES6C4Y.js";
8
+ import "./chunk-JQPLY3ZT.js";
9
9
  import "./chunk-LGGE3LH7.js";
10
10
  export {
11
11
  resolveSdkEnvKey,
@@ -10,9 +10,9 @@ import {
10
10
  readWorkerKey,
11
11
  runDaemon,
12
12
  workerHostId
13
- } from "./chunk-JXAH3XKH.js";
14
- import "./chunk-QZMSGTVZ.js";
15
- import "./chunk-DJNAPA4D.js";
13
+ } from "./chunk-UVAADP4O.js";
14
+ import "./chunk-PPES6C4Y.js";
15
+ import "./chunk-JQPLY3ZT.js";
16
16
  import "./chunk-LGGE3LH7.js";
17
17
  export {
18
18
  assertWorkerKey,
@@ -7,8 +7,10 @@ import {
7
7
  envVarsToWrite,
8
8
  installCommand,
9
9
  isFrameworkId,
10
+ isLauncherOnly,
11
+ isMushiSdkPackage,
10
12
  readPackageJson
11
- } from "./chunk-KOBEOGNF.js";
13
+ } from "./chunk-CG5KPP4S.js";
12
14
  export {
13
15
  FRAMEWORKS,
14
16
  FRAMEWORK_IDS,
@@ -17,5 +19,7 @@ export {
17
19
  envVarsToWrite,
18
20
  installCommand,
19
21
  isFrameworkId,
22
+ isLauncherOnly,
23
+ isMushiSdkPackage,
20
24
  readPackageJson
21
25
  };
package/dist/detect.d.ts CHANGED
@@ -7,7 +7,10 @@ type FrameworkId = 'next' | 'react' | 'cra' | 'remix' | 'astro' | 'solid' | 'vue
7
7
  interface Framework {
8
8
  id: FrameworkId;
9
9
  label: string;
10
+ /** What the wizard installs: `mushi-mushi`, or the scoped native package (React Native, Capacitor). */
10
11
  packageName: string;
12
+ /** Where the snippet imports from, e.g. `mushi-mushi/react`. */
13
+ importPath: string;
11
14
  needsWebPackage: boolean;
12
15
  snippet: () => string;
13
16
  }
@@ -21,10 +24,23 @@ type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
21
24
  declare const FRAMEWORK_IDS: ReadonlyArray<FrameworkId>;
22
25
  declare function isFrameworkId(value: unknown): value is FrameworkId;
23
26
  declare const FRAMEWORKS: Record<FrameworkId, Framework>;
27
+ /**
28
+ * True for a dependency name that is a Mushi Mushi package: the `mushi-mushi`
29
+ * umbrella or any scoped `@mushi-mushi/*` package (older installs keep working).
30
+ */
31
+ declare function isMushiSdkPackage(name: string): boolean;
32
+ /**
33
+ * True for `mushi-mushi` pinned below 1.0. Before ADR 0060 that package was
34
+ * only the `npx mushi-mushi` setup command; the SDK ships in it from 1.x. A
35
+ * project that keeps `mushi-mushi@^0.8` to run the wizard has no SDK from it,
36
+ * and moving it to 1.x would add the whole SDK, so neither `mushi upgrade` nor
37
+ * `mushi doctor` treats it as one. Mirrors the server's isUmbrellaLauncherOnly.
38
+ */
39
+ declare function isLauncherOnly(name: string, spec: string | undefined): boolean;
24
40
  declare function readPackageJson(cwd: string): PackageJson | null;
25
41
  declare function detectFramework(cwd: string, pkg: PackageJson | null): Framework;
26
42
  declare function detectPackageManager(cwd: string): PackageManager;
27
43
  declare function installCommand(pm: PackageManager, packages: string[]): string;
28
44
  declare function envVarsToWrite(apiKey: string, projectId: string, framework: Framework, endpoint?: string): string;
29
45
 
30
- export { FRAMEWORKS, FRAMEWORK_IDS, type Framework, type FrameworkId, type PackageJson, type PackageManager, detectFramework, detectPackageManager, envVarsToWrite, installCommand, isFrameworkId, readPackageJson };
46
+ export { FRAMEWORKS, FRAMEWORK_IDS, type Framework, type FrameworkId, type PackageJson, type PackageManager, detectFramework, detectPackageManager, envVarsToWrite, installCommand, isFrameworkId, isLauncherOnly, isMushiSdkPackage, readPackageJson };
package/dist/detect.js CHANGED
@@ -6,8 +6,10 @@ import {
6
6
  envVarsToWrite,
7
7
  installCommand,
8
8
  isFrameworkId,
9
+ isLauncherOnly,
10
+ isMushiSdkPackage,
9
11
  readPackageJson
10
- } from "./chunk-AIZRI665.js";
12
+ } from "./chunk-AWASJDQI.js";
11
13
  export {
12
14
  FRAMEWORKS,
13
15
  FRAMEWORK_IDS,
@@ -16,5 +18,7 @@ export {
16
18
  envVarsToWrite,
17
19
  installCommand,
18
20
  isFrameworkId,
21
+ isLauncherOnly,
22
+ isMushiSdkPackage,
19
23
  readPackageJson
20
24
  };
package/dist/index.js CHANGED
@@ -22,15 +22,17 @@ import {
22
22
  sanitizeEndpoint,
23
23
  sanitizeProjectId,
24
24
  writeMcpServerEntry
25
- } from "./chunk-BUCMB4NS.js";
25
+ } from "./chunk-OZPDPF6G.js";
26
26
  import {
27
27
  FRAMEWORKS,
28
28
  detectFramework,
29
29
  detectPackageManager,
30
30
  envVarsToWrite,
31
31
  installCommand,
32
+ isLauncherOnly,
33
+ isMushiSdkPackage,
32
34
  readPackageJson
33
- } from "./chunk-KOBEOGNF.js";
35
+ } from "./chunk-CG5KPP4S.js";
34
36
  import {
35
37
  LANE_NAME_RE,
36
38
  MODEL_RE,
@@ -50,7 +52,7 @@ import {
50
52
  registerUxCommands,
51
53
  registerWorkCommands,
52
54
  validateWorkerConfig
53
- } from "./chunk-JXAH3XKH.js";
55
+ } from "./chunk-UVAADP4O.js";
54
56
  import {
55
57
  CONFIG_PATH,
56
58
  MushiCliError,
@@ -89,11 +91,11 @@ import {
89
91
  tryLoadKeyFromKeychain,
90
92
  trySaveKeyToKeychain,
91
93
  trySaveWorkerKey
92
- } from "./chunk-QZMSGTVZ.js";
94
+ } from "./chunk-PPES6C4Y.js";
93
95
  import {
94
96
  MUSHI_CLI_VERSION,
95
97
  MUSHI_MCP_PIN_SPEC
96
- } from "./chunk-DJNAPA4D.js";
98
+ } from "./chunk-JQPLY3ZT.js";
97
99
  import {
98
100
  CLOUD_API_ENDPOINT,
99
101
  CLOUD_MCP_OAUTH_URL,
@@ -616,7 +618,7 @@ error: Could not start login session: ${err instanceof Error ? err.message : Str
616
618
  choice = await resolveProjectChoice(projectsList, ask);
617
619
  rl.close();
618
620
  } else {
619
- const { readPackageJson: readPackageJson2 } = await import("./detect-WZT5X6LP.js");
621
+ const { readPackageJson: readPackageJson2 } = await import("./detect-SOXPECZ3.js");
620
622
  const cwd = process.cwd();
621
623
  const nonInteractive = chooseProjectNonInteractive(
622
624
  projectsList,
@@ -978,6 +980,7 @@ async function checkSdkInstall(cwd) {
978
980
  const pkg = JSON.parse(await readFile3(pkgPath, "utf8"));
979
981
  const deps2 = { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
980
982
  const sdks = [
983
+ "mushi-mushi",
981
984
  "@mushi-mushi/react",
982
985
  "@mushi-mushi/web",
983
986
  "@mushi-mushi/core",
@@ -988,11 +991,11 @@ async function checkSdkInstall(cwd) {
988
991
  "@mushi-mushi/capacitor",
989
992
  "@mushi-mushi/node"
990
993
  ];
991
- const installed = sdks.filter((s) => deps2[s]);
994
+ const installed = sdks.filter((s) => deps2[s] && !isLauncherOnly(s, deps2[s]));
992
995
  return {
993
996
  name: "SDK installed in this repo",
994
997
  ok: installed.length > 0,
995
- detail: installed.length > 0 ? installed.map((s) => `${s}@${deps2[s]}`).join(", ") : "No @mushi-mushi/* package in package.json \u2014 run `npx mushi-mushi` to install"
998
+ detail: installed.length > 0 ? installed.map((s) => `${s}@${deps2[s]}`).join(", ") : "No Mushi Mushi SDK (mushi-mushi) in package.json \u2014 run `npx mushi-mushi` to install"
996
999
  };
997
1000
  } catch {
998
1001
  return null;
@@ -1223,11 +1226,13 @@ async function checkHostAppWiring(cwd) {
1223
1226
  detail: mcpFound ? `${mcpFound} present` : "No .mcp.json (Claude Code) or .cursor/mcp.json (Cursor) \u2014 run `npx mushi-mushi setup --ide claude` or `--ide cursor` for two-way reporter replies"
1224
1227
  });
1225
1228
  if (isCapHybrid) {
1226
- const hasWebSdk = Boolean(deps2["@mushi-mushi/web"] || deps2["@mushi-mushi/react"]);
1229
+ const hasWebSdk = Boolean(
1230
+ deps2["mushi-mushi"] && !isLauncherOnly("mushi-mushi", deps2["mushi-mushi"]) || deps2["@mushi-mushi/web"] || deps2["@mushi-mushi/react"]
1231
+ );
1227
1232
  checks.push({
1228
1233
  name: "[host] Capacitor hybrid \u2014 WebView SDK",
1229
1234
  ok: hasWebSdk,
1230
- detail: hasWebSdk ? "Use @mushi-mushi/web or @mushi-mushi/react in the WebView (initMushi in main.tsx)" : "Install @mushi-mushi/web for Capacitor WebView reporting"
1235
+ detail: hasWebSdk ? "Use mushi-mushi (or mushi-mushi/react) in the WebView (initMushi in main.tsx)" : "Install mushi-mushi for Capacitor WebView reporting"
1231
1236
  });
1232
1237
  checks.push({
1233
1238
  name: "[host] Capacitor native plugin (optional)",
@@ -1609,7 +1614,7 @@ async function checkOnboardingStatus(config, _consoleBase, cwd, doFetch = global
1609
1614
  }
1610
1615
  async function checkVersionDrift(cwd, doFetch) {
1611
1616
  const checks = [];
1612
- const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-ULUVAZ3V.js");
1617
+ const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-MGHYYC2T.js");
1613
1618
  if (MUSHI_CLI_VERSION2 === "0.0.0-dev") return checks;
1614
1619
  const parse2 = (v) => {
1615
1620
  const m = v.replace(/^[~^]/, "").match(/^(\d+)\.(\d+)\.(\d+)/);
@@ -1642,7 +1647,7 @@ async function checkVersionDrift(cwd, doFetch) {
1642
1647
  const { join: join13 } = await import("path");
1643
1648
  const pkg = JSON.parse(await readFile3(join13(cwd, "package.json"), "utf8"));
1644
1649
  const deps2 = { ...pkg.dependencies, ...pkg.devDependencies };
1645
- const candidates = Object.entries(deps2).filter(([name]) => name.startsWith("@mushi-mushi/")).filter(([, v]) => /^[~^]?\d/.test(v));
1650
+ const candidates = Object.entries(deps2).filter(([name, spec]) => isMushiSdkPackage(name) && !isLauncherOnly(name, spec)).filter(([, v]) => /^[~^]?\d/.test(v));
1646
1651
  const drifted = (await Promise.all(
1647
1652
  candidates.map(async ([name, v]) => {
1648
1653
  try {
@@ -1766,7 +1771,7 @@ async function runDoctor(config, options = {}) {
1766
1771
  }
1767
1772
  if (sdkCheck) checks.push(sdkCheck);
1768
1773
  if (sdkCheck?.ok && !sdkCheck.warn) {
1769
- const { findSdkImport } = await import("./snippet-inject-LPRWTQDE.js");
1774
+ const { findSdkImport } = await import("./snippet-inject-ETGBPDYB.js");
1770
1775
  const imported = await findSdkImport(options.cwd ?? process.cwd());
1771
1776
  checks.push(
1772
1777
  imported ? { name: "SDK init snippet wired", ok: true, detail: `Found SDK usage in ${imported.file}` } : {
@@ -1813,7 +1818,7 @@ async function runDoctor(config, options = {}) {
1813
1818
  ...checks[idx],
1814
1819
  ok: true,
1815
1820
  warn: true,
1816
- detail: "No @mushi-mushi/* found in cwd package.json \u2014 but live heartbeats confirm the SDK is active. Run from your app repo or install with `mushi init`."
1821
+ detail: "No mushi-mushi or @mushi-mushi/* package in cwd package.json \u2014 but live heartbeats confirm the SDK is active. Run from your app repo or install with `npx mushi-mushi`."
1817
1822
  };
1818
1823
  }
1819
1824
  }
@@ -1902,7 +1907,7 @@ async function runInit(options = {}) {
1902
1907
  const credentials = await acquireCredentials(options, consoleBase, endpoint);
1903
1908
  await verifyCredentials(credentials, options, consoleBase);
1904
1909
  const pm = detectPackageManager(cwd);
1905
- const packagesToInstall = framework.needsWebPackage ? [framework.packageName, "@mushi-mushi/web"] : [framework.packageName];
1910
+ const packagesToInstall = framework.needsWebPackage ? [framework.packageName, "mushi-mushi"] : [framework.packageName];
1906
1911
  if (!options.skipInstall) {
1907
1912
  await installPackages(pm, packagesToInstall, cwd);
1908
1913
  } else {
@@ -1948,7 +1953,7 @@ function maybeSuggestAudit(pkg) {
1948
1953
  ...pkg?.dependencies,
1949
1954
  ...pkg?.devDependencies
1950
1955
  };
1951
- if (Object.keys(deps2).some((d) => d.startsWith("@mushi-mushi/"))) {
1956
+ if (Object.keys(deps2).some(isMushiSdkPackage)) {
1952
1957
  p.log.info(
1953
1958
  "A Mushi SDK is already installed here. To health-check the existing setup instead, run `npx mushi-mushi --audit`."
1954
1959
  );
@@ -1980,7 +1985,7 @@ async function chooseFramework(detected, options) {
1980
1985
  options: Object.values(FRAMEWORKS).map((fw) => ({
1981
1986
  value: fw.id,
1982
1987
  label: `${fw.id === detected.id ? "\u2713 " : " "}${fw.label}`,
1983
- hint: fw.packageName
1988
+ hint: fw.importPath
1984
1989
  }))
1985
1990
  });
1986
1991
  if (p.isCancel(confirmed)) {
@@ -2526,7 +2531,7 @@ function emitWizardFunnelEvent(credentials, endpoint, event, metadata = {}) {
2526
2531
  }
2527
2532
  async function maybeInjectSnippet(cwd, framework, options) {
2528
2533
  if (options.yes || !process.stdin.isTTY) return;
2529
- const { ENTRY_CANDIDATES, injectSnippet, MUSHI_MARKER_START } = await import("./snippet-inject-LPRWTQDE.js");
2534
+ const { ENTRY_CANDIDATES, injectSnippet, MUSHI_MARKER_START } = await import("./snippet-inject-ETGBPDYB.js");
2530
2535
  const candidates = ENTRY_CANDIDATES[framework.id];
2531
2536
  if (!candidates) return;
2532
2537
  const { readFile: readFile3, writeFile: writeFile3 } = await import("fs/promises");
@@ -2553,11 +2558,11 @@ function printNextSteps(framework, consoleBase, enableRewards = false) {
2553
2558
  p.note(framework.snippet(), "Add this to your app:");
2554
2559
  if (enableRewards) {
2555
2560
  const badgeSnippet = framework.id === "react" ? `// Add to your user menu or profile UI:
2556
- import { MushiRewardsBadge } from '@mushi-mushi/react';
2561
+ import { MushiRewardsBadge } from 'mushi-mushi/react';
2557
2562
 
2558
2563
  // Inside your component:
2559
2564
  <MushiRewardsBadge showPoints />` : `// Add to your user menu:
2560
- // import { MushiRewardsBadge } from '@mushi-mushi/react';
2565
+ // import { MushiRewardsBadge } from 'mushi-mushi/react';
2561
2566
  // <MushiRewardsBadge showPoints />`;
2562
2567
  p.note(badgeSnippet, "Rewards badge snippet:");
2563
2568
  p.log.info(`Enable rewards in your project settings at ${consoleUrl(consoleBase, "/rewards")}`);
@@ -2582,7 +2587,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
2582
2587
  if (p.isCancel(answer) || !answer) return;
2583
2588
  const endpoint = resolveCloudEndpoint(options.endpoint);
2584
2589
  try {
2585
- const { runConnect: runConnect2 } = await import("./connect-OTHJSNHC.js");
2590
+ const { runConnect: runConnect2 } = await import("./connect-RZV3PXP3.js");
2586
2591
  const saved = loadConfig();
2587
2592
  const result = await runConnect2(
2588
2593
  {
@@ -5118,14 +5123,36 @@ import { resolve as resolve2 } from "path";
5118
5123
  import { execSync } from "child_process";
5119
5124
  var SAFE_NPM_VERSION = /^\d+\.\d+\.\d+(-[\w.]+)?$/;
5120
5125
  var MUSHI_PACKAGES = [
5126
+ // The one package users install (ADR 0060). The scoped names below keep
5127
+ // working for apps that installed them before.
5128
+ "mushi-mushi",
5121
5129
  "@mushi-mushi/web",
5122
5130
  "@mushi-mushi/core",
5123
5131
  "@mushi-mushi/react",
5132
+ "@mushi-mushi/vue",
5133
+ "@mushi-mushi/svelte",
5134
+ "@mushi-mushi/angular",
5124
5135
  "@mushi-mushi/react-native",
5125
5136
  "@mushi-mushi/capacitor",
5126
5137
  "@mushi-mushi/node",
5127
5138
  "@mushi-mushi/cli"
5128
5139
  ];
5140
+ var IN_UMBRELLA = /* @__PURE__ */ new Set([
5141
+ "@mushi-mushi/web",
5142
+ "@mushi-mushi/core",
5143
+ "@mushi-mushi/react",
5144
+ "@mushi-mushi/vue",
5145
+ "@mushi-mushi/svelte",
5146
+ "@mushi-mushi/angular",
5147
+ "@mushi-mushi/node"
5148
+ ]);
5149
+ function umbrellaNote(entries) {
5150
+ if (entries.some((e) => e.name === "mushi-mushi")) return "";
5151
+ const scoped = entries.map((e) => e.name).filter((n) => IN_UMBRELLA.has(n));
5152
+ if (scoped.length === 0) return "";
5153
+ return `
5154
+ Tip: the same SDK now ships as one package. \`npm install mushi-mushi\` and import from \`mushi-mushi\` (or \`mushi-mushi/react\`, \`/vue\`, \`/svelte\`, \`/angular\`, \`/node\`). Your ${scoped.join(", ")} install keeps working.`;
5155
+ }
5129
5156
  async function planUpgrade(cwd) {
5130
5157
  const root = resolve2(cwd);
5131
5158
  const pkg = readPackageJson(root);
@@ -5134,7 +5161,7 @@ async function planUpgrade(cwd) {
5134
5161
  ...pkg?.dependencies ?? {},
5135
5162
  ...pkg?.devDependencies ?? {}
5136
5163
  };
5137
- const installed = MUSHI_PACKAGES.filter((name) => deps2[name]);
5164
+ const installed = MUSHI_PACKAGES.filter((name) => deps2[name] && !isLauncherOnly(name, deps2[name]));
5138
5165
  const entries = await Promise.all(
5139
5166
  installed.map(async (name) => {
5140
5167
  const current = deps2[name] ?? "";
@@ -5153,8 +5180,7 @@ async function planUpgrade(cwd) {
5153
5180
  name,
5154
5181
  current,
5155
5182
  latest: safeLatest,
5156
- willUpgrade,
5157
- migrateToWeb: name === "@mushi-mushi/react" && willUpgrade
5183
+ willUpgrade
5158
5184
  };
5159
5185
  })
5160
5186
  );
@@ -5178,14 +5204,14 @@ async function runUpgrade(opts = {}) {
5178
5204
  const plan = await planUpgrade(opts.cwd ?? process.cwd());
5179
5205
  if (opts.check) {
5180
5206
  const exit = evaluateUpgradeCheckExit(plan);
5181
- const message = exit === 0 ? "All installed Mushi packages are already at the latest stable version." : exit === 2 ? "Could not reach the npm registry to check for updates \u2014 try again in a moment." : plan.entries.length === 0 ? "No @mushi-mushi/* packages in package.json \u2014 run `mushi init` first." : "One or more Mushi packages are behind the latest stable npm release.";
5207
+ const message = exit === 0 ? "All installed Mushi packages are already at the latest stable version." : exit === 2 ? "Could not reach the npm registry to check for updates \u2014 try again in a moment." : plan.entries.length === 0 ? "No Mushi Mushi package (mushi-mushi or @mushi-mushi/*) in package.json \u2014 run `npx mushi-mushi` first." : "One or more Mushi packages are behind the latest stable npm release.";
5182
5208
  return { plan, upgraded: false, message };
5183
5209
  }
5184
5210
  if (plan.entries.length === 0) {
5185
5211
  return {
5186
5212
  plan,
5187
5213
  upgraded: false,
5188
- message: "No @mushi-mushi/* packages in package.json \u2014 run `mushi init` first."
5214
+ message: "No Mushi Mushi package (mushi-mushi or @mushi-mushi/*) in package.json \u2014 run `npx mushi-mushi` first."
5189
5215
  };
5190
5216
  }
5191
5217
  if (!plan.installCmd) {
@@ -5210,8 +5236,7 @@ async function runUpgrade(opts = {}) {
5210
5236
  ${plan.installCmd}`
5211
5237
  };
5212
5238
  }
5213
- const reactEntry = plan.entries.find((e) => e.migrateToWeb);
5214
- const migrateNote = reactEntry ? "\nNote: @mushi-mushi/react is legacy \u2014 prefer @mushi-mushi/web for Vite/Capacitor/SPA apps." : "";
5239
+ const migrateNote = umbrellaNote(plan.entries);
5215
5240
  return {
5216
5241
  plan,
5217
5242
  upgraded: true,
@@ -5329,7 +5354,7 @@ ${via}` };
5329
5354
 
5330
5355
  // src/commands/upgrade-cli.ts
5331
5356
  function registerUpgradeCommand(program2) {
5332
- program2.command("upgrade").description("Bump installed @mushi-mushi/* packages to the latest stable npm release").option("--cwd <path>", "Target repo (default: cwd)").option("--self", "Upgrade the globally-installed `mushi` CLI itself (not the project SDK deps)").option("--dry-run", "Print the install command without running it").option("--check", "Plan only: exit 0 current, 1 outdated, 2 registry unreachable").option("--json", "Machine-readable plan + result").addHelpText("after", `
5357
+ program2.command("upgrade").description("Bump the installed mushi-mushi package (and any @mushi-mushi/* packages) to the latest stable npm release").option("--cwd <path>", "Target repo (default: cwd)").option("--self", "Upgrade the globally-installed `mushi` CLI itself (not the project SDK deps)").option("--dry-run", "Print the install command without running it").option("--check", "Plan only: exit 0 current, 1 outdated, 2 registry unreachable").option("--json", "Machine-readable plan + result").addHelpText("after", `
5333
5358
  Examples:
5334
5359
  mushi upgrade
5335
5360
  mushi upgrade --dry-run
package/dist/init.js CHANGED
@@ -25,18 +25,20 @@ import {
25
25
  saveConfig,
26
26
  savedSdkKeyFor,
27
27
  trySaveKeyToKeychain
28
- } from "./chunk-V3DR4WLG.js";
28
+ } from "./chunk-BG2TVTBN.js";
29
29
  import {
30
30
  MUSHI_CLI_VERSION
31
- } from "./chunk-M5LN4ZWQ.js";
31
+ } from "./chunk-HQM2WZVF.js";
32
32
  import {
33
33
  FRAMEWORKS,
34
34
  detectFramework,
35
35
  detectPackageManager,
36
36
  envVarsToWrite,
37
37
  installCommand,
38
+ isLauncherOnly,
39
+ isMushiSdkPackage,
38
40
  readPackageJson
39
- } from "./chunk-AIZRI665.js";
41
+ } from "./chunk-AWASJDQI.js";
40
42
  import {
41
43
  CLOUD_API_ENDPOINT,
42
44
  CLOUD_MCP_OAUTH_URL,
@@ -609,6 +611,7 @@ async function checkSdkInstall(cwd) {
609
611
  const pkg = JSON.parse(await readFile(pkgPath, "utf8"));
610
612
  const deps = { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
611
613
  const sdks = [
614
+ "mushi-mushi",
612
615
  "@mushi-mushi/react",
613
616
  "@mushi-mushi/web",
614
617
  "@mushi-mushi/core",
@@ -619,11 +622,11 @@ async function checkSdkInstall(cwd) {
619
622
  "@mushi-mushi/capacitor",
620
623
  "@mushi-mushi/node"
621
624
  ];
622
- const installed = sdks.filter((s) => deps[s]);
625
+ const installed = sdks.filter((s) => deps[s] && !isLauncherOnly(s, deps[s]));
623
626
  return {
624
627
  name: "SDK installed in this repo",
625
628
  ok: installed.length > 0,
626
- detail: installed.length > 0 ? installed.map((s) => `${s}@${deps[s]}`).join(", ") : "No @mushi-mushi/* package in package.json \u2014 run `npx mushi-mushi` to install"
629
+ detail: installed.length > 0 ? installed.map((s) => `${s}@${deps[s]}`).join(", ") : "No Mushi Mushi SDK (mushi-mushi) in package.json \u2014 run `npx mushi-mushi` to install"
627
630
  };
628
631
  } catch {
629
632
  return null;
@@ -854,11 +857,13 @@ async function checkHostAppWiring(cwd) {
854
857
  detail: mcpFound ? `${mcpFound} present` : "No .mcp.json (Claude Code) or .cursor/mcp.json (Cursor) \u2014 run `npx mushi-mushi setup --ide claude` or `--ide cursor` for two-way reporter replies"
855
858
  });
856
859
  if (isCapHybrid) {
857
- const hasWebSdk = Boolean(deps["@mushi-mushi/web"] || deps["@mushi-mushi/react"]);
860
+ const hasWebSdk = Boolean(
861
+ deps["mushi-mushi"] && !isLauncherOnly("mushi-mushi", deps["mushi-mushi"]) || deps["@mushi-mushi/web"] || deps["@mushi-mushi/react"]
862
+ );
858
863
  checks.push({
859
864
  name: "[host] Capacitor hybrid \u2014 WebView SDK",
860
865
  ok: hasWebSdk,
861
- detail: hasWebSdk ? "Use @mushi-mushi/web or @mushi-mushi/react in the WebView (initMushi in main.tsx)" : "Install @mushi-mushi/web for Capacitor WebView reporting"
866
+ detail: hasWebSdk ? "Use mushi-mushi (or mushi-mushi/react) in the WebView (initMushi in main.tsx)" : "Install mushi-mushi for Capacitor WebView reporting"
862
867
  });
863
868
  checks.push({
864
869
  name: "[host] Capacitor native plugin (optional)",
@@ -1187,7 +1192,7 @@ async function checkVersionDrift(cwd, doFetch) {
1187
1192
  const { join: join3 } = await import("path");
1188
1193
  const pkg = JSON.parse(await readFile(join3(cwd, "package.json"), "utf8"));
1189
1194
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
1190
- const candidates = Object.entries(deps).filter(([name]) => name.startsWith("@mushi-mushi/")).filter(([, v]) => /^[~^]?\d/.test(v));
1195
+ const candidates = Object.entries(deps).filter(([name, spec]) => isMushiSdkPackage(name) && !isLauncherOnly(name, spec)).filter(([, v]) => /^[~^]?\d/.test(v));
1191
1196
  const drifted = (await Promise.all(
1192
1197
  candidates.map(async ([name, v]) => {
1193
1198
  try {
@@ -1311,7 +1316,7 @@ async function runDoctor(config, options = {}) {
1311
1316
  }
1312
1317
  if (sdkCheck) checks.push(sdkCheck);
1313
1318
  if (sdkCheck?.ok && !sdkCheck.warn) {
1314
- const { findSdkImport } = await import("./snippet-inject-NDAPEL2T.js");
1319
+ const { findSdkImport } = await import("./snippet-inject-AVGVHTUJ.js");
1315
1320
  const imported = await findSdkImport(options.cwd ?? process.cwd());
1316
1321
  checks.push(
1317
1322
  imported ? { name: "SDK init snippet wired", ok: true, detail: `Found SDK usage in ${imported.file}` } : {
@@ -1358,7 +1363,7 @@ async function runDoctor(config, options = {}) {
1358
1363
  ...checks[idx],
1359
1364
  ok: true,
1360
1365
  warn: true,
1361
- detail: "No @mushi-mushi/* found in cwd package.json \u2014 but live heartbeats confirm the SDK is active. Run from your app repo or install with `mushi init`."
1366
+ detail: "No mushi-mushi or @mushi-mushi/* package in cwd package.json \u2014 but live heartbeats confirm the SDK is active. Run from your app repo or install with `npx mushi-mushi`."
1362
1367
  };
1363
1368
  }
1364
1369
  }
@@ -1447,7 +1452,7 @@ async function runInit(options = {}) {
1447
1452
  const credentials = await acquireCredentials(options, consoleBase, endpoint);
1448
1453
  await verifyCredentials(credentials, options, consoleBase);
1449
1454
  const pm = detectPackageManager(cwd);
1450
- const packagesToInstall = framework.needsWebPackage ? [framework.packageName, "@mushi-mushi/web"] : [framework.packageName];
1455
+ const packagesToInstall = framework.needsWebPackage ? [framework.packageName, "mushi-mushi"] : [framework.packageName];
1451
1456
  if (!options.skipInstall) {
1452
1457
  await installPackages(pm, packagesToInstall, cwd);
1453
1458
  } else {
@@ -1493,7 +1498,7 @@ function maybeSuggestAudit(pkg) {
1493
1498
  ...pkg?.dependencies,
1494
1499
  ...pkg?.devDependencies
1495
1500
  };
1496
- if (Object.keys(deps).some((d) => d.startsWith("@mushi-mushi/"))) {
1501
+ if (Object.keys(deps).some(isMushiSdkPackage)) {
1497
1502
  p.log.info(
1498
1503
  "A Mushi SDK is already installed here. To health-check the existing setup instead, run `npx mushi-mushi --audit`."
1499
1504
  );
@@ -1525,7 +1530,7 @@ async function chooseFramework(detected, options) {
1525
1530
  options: Object.values(FRAMEWORKS).map((fw) => ({
1526
1531
  value: fw.id,
1527
1532
  label: `${fw.id === detected.id ? "\u2713 " : " "}${fw.label}`,
1528
- hint: fw.packageName
1533
+ hint: fw.importPath
1529
1534
  }))
1530
1535
  });
1531
1536
  if (p.isCancel(confirmed)) {
@@ -2071,7 +2076,7 @@ function emitWizardFunnelEvent(credentials, endpoint, event, metadata = {}) {
2071
2076
  }
2072
2077
  async function maybeInjectSnippet(cwd, framework, options) {
2073
2078
  if (options.yes || !process.stdin.isTTY) return;
2074
- const { ENTRY_CANDIDATES, injectSnippet, MUSHI_MARKER_START } = await import("./snippet-inject-NDAPEL2T.js");
2079
+ const { ENTRY_CANDIDATES, injectSnippet, MUSHI_MARKER_START } = await import("./snippet-inject-AVGVHTUJ.js");
2075
2080
  const candidates = ENTRY_CANDIDATES[framework.id];
2076
2081
  if (!candidates) return;
2077
2082
  const { readFile, writeFile } = await import("fs/promises");
@@ -2098,11 +2103,11 @@ function printNextSteps(framework, consoleBase, enableRewards = false) {
2098
2103
  p.note(framework.snippet(), "Add this to your app:");
2099
2104
  if (enableRewards) {
2100
2105
  const badgeSnippet = framework.id === "react" ? `// Add to your user menu or profile UI:
2101
- import { MushiRewardsBadge } from '@mushi-mushi/react';
2106
+ import { MushiRewardsBadge } from 'mushi-mushi/react';
2102
2107
 
2103
2108
  // Inside your component:
2104
2109
  <MushiRewardsBadge showPoints />` : `// Add to your user menu:
2105
- // import { MushiRewardsBadge } from '@mushi-mushi/react';
2110
+ // import { MushiRewardsBadge } from 'mushi-mushi/react';
2106
2111
  // <MushiRewardsBadge showPoints />`;
2107
2112
  p.note(badgeSnippet, "Rewards badge snippet:");
2108
2113
  p.log.info(`Enable rewards in your project settings at ${consoleUrl(consoleBase, "/rewards")}`);
@@ -2127,7 +2132,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
2127
2132
  if (p.isCancel(answer) || !answer) return;
2128
2133
  const endpoint = resolveCloudEndpoint(options.endpoint);
2129
2134
  try {
2130
- const { runConnect } = await import("./connect-M2IGP63E.js");
2135
+ const { runConnect } = await import("./connect-BCCGBCYR.js");
2131
2136
  const saved = loadConfig();
2132
2137
  const result = await runConnect(
2133
2138
  {
@@ -28,6 +28,7 @@ ${cleaned}`;
28
28
  var SOURCE_DIRS = ["src", "app", "pages", "lib", "components"];
29
29
  var SOURCE_EXTS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".vue", ".svelte"]);
30
30
  var MAX_FILES_SCANNED = 2e3;
31
+ var SDK_IMPORT = /@mushi-mushi\/|['"]mushi-mushi(?:\/[\w-]+)*['"]|MushiProvider/;
31
32
  async function findSdkImport(cwd) {
32
33
  let scanned = 0;
33
34
  async function walk(dir, depth) {
@@ -48,7 +49,7 @@ async function findSdkImport(cwd) {
48
49
  scanned += 1;
49
50
  try {
50
51
  const content = await readFile(join(dir, entry.name), "utf8");
51
- if (content.includes("@mushi-mushi/") || content.includes("MushiProvider")) {
52
+ if (SDK_IMPORT.test(content)) {
52
53
  return { file: join(dir, entry.name) };
53
54
  }
54
55
  } catch {
@@ -64,7 +65,7 @@ async function findSdkImport(cwd) {
64
65
  for (const name of ["main.ts", "main.js", "index.js", "index.ts", "index.html"]) {
65
66
  try {
66
67
  const content = await readFile(join(cwd, name), "utf8");
67
- if (content.includes("@mushi-mushi/") || content.includes("MushiProvider") || content.includes("mushi-mushi")) {
68
+ if (SDK_IMPORT.test(content) || content.includes("mushi-mushi")) {
68
69
  return { file: join(cwd, name) };
69
70
  }
70
71
  } catch {
@@ -30,6 +30,7 @@ ${cleaned}`;
30
30
  var SOURCE_DIRS = ["src", "app", "pages", "lib", "components"];
31
31
  var SOURCE_EXTS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".vue", ".svelte"]);
32
32
  var MAX_FILES_SCANNED = 2e3;
33
+ var SDK_IMPORT = /@mushi-mushi\/|['"]mushi-mushi(?:\/[\w-]+)*['"]|MushiProvider/;
33
34
  async function findSdkImport(cwd) {
34
35
  let scanned = 0;
35
36
  async function walk(dir, depth) {
@@ -50,7 +51,7 @@ async function findSdkImport(cwd) {
50
51
  scanned += 1;
51
52
  try {
52
53
  const content = await readFile(join(dir, entry.name), "utf8");
53
- if (content.includes("@mushi-mushi/") || content.includes("MushiProvider")) {
54
+ if (SDK_IMPORT.test(content)) {
54
55
  return { file: join(dir, entry.name) };
55
56
  }
56
57
  } catch {
@@ -66,7 +67,7 @@ async function findSdkImport(cwd) {
66
67
  for (const name of ["main.ts", "main.js", "index.js", "index.ts", "index.html"]) {
67
68
  try {
68
69
  const content = await readFile(join(cwd, name), "utf8");
69
- if (content.includes("@mushi-mushi/") || content.includes("MushiProvider") || content.includes("mushi-mushi")) {
70
+ if (SDK_IMPORT.test(content) || content.includes("mushi-mushi")) {
70
71
  return { file: join(cwd, name) };
71
72
  }
72
73
  } catch {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MUSHI_CLI_VERSION,
4
4
  MUSHI_MCP_PIN_SPEC
5
- } from "./chunk-DJNAPA4D.js";
5
+ } from "./chunk-JQPLY3ZT.js";
6
6
  export {
7
7
  MUSHI_CLI_VERSION,
8
8
  MUSHI_MCP_PIN_SPEC
package/dist/version.d.ts CHANGED
@@ -14,6 +14,6 @@ declare const MUSHI_CLI_VERSION: string;
14
14
  * setup refreshes the pin. Synced to packages/mcp/package.json by
15
15
  * `scripts/sync-mcp-pin.mjs` — never hand-edit the version.
16
16
  */
17
- declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.0";
17
+ declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.1";
18
18
 
19
19
  export { MUSHI_CLI_VERSION, MUSHI_MCP_PIN_SPEC };
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MUSHI_CLI_VERSION,
3
3
  MUSHI_MCP_PIN_SPEC
4
- } from "./chunk-M5LN4ZWQ.js";
4
+ } from "./chunk-HQM2WZVF.js";
5
5
  export {
6
6
  MUSHI_CLI_VERSION,
7
7
  MUSHI_MCP_PIN_SPEC
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FRAMEWORK_IDS,
3
3
  isFrameworkId
4
- } from "./chunk-AIZRI665.js";
4
+ } from "./chunk-AWASJDQI.js";
5
5
 
6
6
  // src/wizard-args.ts
7
7
  var MIN_NODE_MAJOR = 20;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/cli",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "license": "MIT",
5
5
  "description": "Mushi Mushi CLI: SDK setup, MCP wiring, triage. One place to improve AI-built apps: fix bugs, smooth user journeys and clean up the code.",
6
6
  "bin": {
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/version.ts
4
- var MUSHI_CLI_VERSION = true ? "0.38.0" : "0.0.0-dev";
5
- var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.0";
6
-
7
- export {
8
- MUSHI_CLI_VERSION,
9
- MUSHI_MCP_PIN_SPEC
10
- };
@@ -1,8 +0,0 @@
1
- // src/version.ts
2
- var MUSHI_CLI_VERSION = true ? "0.38.0" : "0.0.0-dev";
3
- var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.0";
4
-
5
- export {
6
- MUSHI_CLI_VERSION,
7
- MUSHI_MCP_PIN_SPEC
8
- };