@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 +20 -10
- package/dist/main.cjs +838 -118
- package/dist/saga.cjs +20 -10
- package/package.json +1 -1
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
|
|
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
|
|
29
|
-
return
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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");
|