@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/saga.cjs CHANGED
@@ -3411,18 +3411,28 @@ var import_node_path2 = require("node:path");
3411
3411
  var CLIENT_VERSION_HEADER = "x-client-version";
3412
3412
 
3413
3413
  // src/client-version.ts
3414
- function resolveClientVersion() {
3414
+ function resolveClientVersionManifestCandidates(distDir = __dirname) {
3415
+ return [
3416
+ (0, import_node_path2.join)(distDir, "..", "..", ".claude-plugin", "plugin.json"),
3417
+ (0, import_node_path2.join)(distDir, "..", "..", ".cursor-plugin", "plugin.json"),
3418
+ (0, import_node_path2.join)(distDir, "..", "..", ".codex-plugin", "plugin.json"),
3419
+ (0, import_node_path2.join)(distDir, "..", "package.json")
3420
+ ];
3421
+ }
3422
+ function readVersionFromManifest(path2) {
3415
3423
  try {
3416
- const manifest = (0, import_node_path2.join)(__dirname, "..", "..", ".claude-plugin", "plugin.json");
3417
- return JSON.parse((0, import_node_fs2.readFileSync)(manifest, "utf8")).version || "0.0.0";
3424
+ const version = JSON.parse((0, import_node_fs2.readFileSync)(path2, "utf8")).version;
3425
+ return typeof version === "string" && version.trim() ? version.trim() : null;
3418
3426
  } catch {
3419
- try {
3420
- const pkg = (0, import_node_path2.join)(__dirname, "..", "package.json");
3421
- return JSON.parse((0, import_node_fs2.readFileSync)(pkg, "utf8")).version || "0.0.0";
3422
- } catch {
3423
- return "0.0.0";
3424
- }
3427
+ return null;
3428
+ }
3429
+ }
3430
+ function resolveClientVersion() {
3431
+ for (const manifest of resolveClientVersionManifestCandidates()) {
3432
+ const version = readVersionFromManifest(manifest);
3433
+ if (version) return version;
3425
3434
  }
3435
+ return "0.0.0";
3426
3436
  }
3427
3437
  function clientVersionHeaders() {
3428
3438
  return { [CLIENT_VERSION_HEADER]: resolveClientVersion() };
@@ -4048,7 +4058,7 @@ function setInjectedStdin(payload) {
4048
4058
  }
4049
4059
  async function readStdin() {
4050
4060
  if (injectedStdin !== void 0) return injectedStdin;
4051
- if (process.stdin.isTTY) return "";
4061
+ if (process.stdin.isTTY !== false) return "";
4052
4062
  const chunks = [];
4053
4063
  for await (const chunk of process.stdin) chunks.push(chunk);
4054
4064
  return Buffer.concat(chunks).toString("utf8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "2.30.0",
3
+ "version": "2.32.0",
4
4
  "description": "MMI Future CLI — delivers the org rules (whole-file), plus saga and KB access. The cross-IDE engine the plugin's SessionStart hook drives.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",