@mutmutco/cli 2.30.0 → 2.32.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.
package/dist/index.cjs CHANGED
@@ -23,18 +23,28 @@ var init_compat = __esm({
23
23
  });
24
24
 
25
25
  // src/client-version.ts
26
- function resolveClientVersion() {
26
+ function resolveClientVersionManifestCandidates(distDir = __dirname) {
27
+ return [
28
+ (0, import_node_path.join)(distDir, "..", "..", ".claude-plugin", "plugin.json"),
29
+ (0, import_node_path.join)(distDir, "..", "..", ".cursor-plugin", "plugin.json"),
30
+ (0, import_node_path.join)(distDir, "..", "..", ".codex-plugin", "plugin.json"),
31
+ (0, import_node_path.join)(distDir, "..", "package.json")
32
+ ];
33
+ }
34
+ function readVersionFromManifest(path) {
27
35
  try {
28
- const manifest = (0, import_node_path.join)(__dirname, "..", "..", ".claude-plugin", "plugin.json");
29
- return JSON.parse((0, import_node_fs.readFileSync)(manifest, "utf8")).version || "0.0.0";
36
+ const version = JSON.parse((0, import_node_fs.readFileSync)(path, "utf8")).version;
37
+ return typeof version === "string" && version.trim() ? version.trim() : null;
30
38
  } catch {
31
- try {
32
- const pkg = (0, import_node_path.join)(__dirname, "..", "package.json");
33
- return JSON.parse((0, import_node_fs.readFileSync)(pkg, "utf8")).version || "0.0.0";
34
- } catch {
35
- return "0.0.0";
36
- }
39
+ return null;
40
+ }
41
+ }
42
+ function resolveClientVersion() {
43
+ for (const manifest of resolveClientVersionManifestCandidates()) {
44
+ const version = readVersionFromManifest(manifest);
45
+ if (version) return version;
37
46
  }
47
+ return "0.0.0";
38
48
  }
39
49
  var import_node_fs, import_node_path;
40
50
  var init_client_version = __esm({
@@ -52,7 +62,7 @@ function setInjectedStdin(payload) {
52
62
  }
53
63
  async function readStdin() {
54
64
  if (injectedStdin !== void 0) return injectedStdin;
55
- if (process.stdin.isTTY) return "";
65
+ if (process.stdin.isTTY !== false) return "";
56
66
  const chunks = [];
57
67
  for await (const chunk of process.stdin) chunks.push(chunk);
58
68
  return Buffer.concat(chunks).toString("utf8");