@mutmutco/cli 3.102.0 → 3.103.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/main.cjs +22 -3
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -17946,6 +17946,9 @@ function selectPrunablePluginVersions(names, currentVersion, installedVersion) {
|
|
|
17946
17946
|
function pluginCacheRootForConfig(configRoot) {
|
|
17947
17947
|
return `${configRoot}/plugins/cache/mutmutco/mmi`;
|
|
17948
17948
|
}
|
|
17949
|
+
function pluginCacheRoot(home) {
|
|
17950
|
+
return pluginCacheRootForConfig(`${home}/.claude`);
|
|
17951
|
+
}
|
|
17949
17952
|
function runningPluginVersion(env, cliVersion) {
|
|
17950
17953
|
const root = env.CLAUDE_PLUGIN_ROOT?.trim();
|
|
17951
17954
|
const leaf = root ? root.replace(/[\\/]+$/, "").split(/[\\/]/).pop() : void 0;
|
|
@@ -18167,12 +18170,28 @@ function renderPluginCachePlan(plan, applied) {
|
|
|
18167
18170
|
function isMmiPiPackage(entry) {
|
|
18168
18171
|
return /[\\/]mutmutco[\\/]mmi[\\/][^\\/]+[\\/]\.pi-plugin\/?$/.test(entry);
|
|
18169
18172
|
}
|
|
18173
|
+
function newestExistingPiPlugin(home) {
|
|
18174
|
+
const cacheRoot = pluginCacheRoot(home);
|
|
18175
|
+
let names;
|
|
18176
|
+
try {
|
|
18177
|
+
names = (0, import_node_fs22.readdirSync)(cacheRoot);
|
|
18178
|
+
} catch {
|
|
18179
|
+
return void 0;
|
|
18180
|
+
}
|
|
18181
|
+
const newest = names.filter(isVersionDirName).sort((a, b) => compareVersions(b, a))[0];
|
|
18182
|
+
if (!newest) return void 0;
|
|
18183
|
+
const candidate = (0, import_node_path20.join)(cacheRoot, newest, ".pi-plugin");
|
|
18184
|
+
return (0, import_node_fs22.existsSync)(candidate) ? candidate : void 0;
|
|
18185
|
+
}
|
|
18170
18186
|
function expectedPiPluginPath(home, env, installedVersion) {
|
|
18171
18187
|
const root = env.CLAUDE_PLUGIN_ROOT?.trim();
|
|
18172
18188
|
if (root && /[\\/]mutmutco[\\/]mmi[\\/]/.test(root)) return (0, import_node_path20.join)(root, ".pi-plugin");
|
|
18173
18189
|
const version = installedVersion ?? runningPluginVersion(env);
|
|
18174
|
-
if (
|
|
18175
|
-
|
|
18190
|
+
if (version) {
|
|
18191
|
+
const pinned = (0, import_node_path20.join)(home, ".claude", "plugins", "cache", "mutmutco", "mmi", version, ".pi-plugin");
|
|
18192
|
+
if ((0, import_node_fs22.existsSync)(pinned)) return pinned;
|
|
18193
|
+
}
|
|
18194
|
+
return newestExistingPiPlugin(home);
|
|
18176
18195
|
}
|
|
18177
18196
|
function settingsPath(home) {
|
|
18178
18197
|
return (0, import_node_path20.join)(home, ".pi", "agent", "settings.json");
|
|
@@ -18180,7 +18199,7 @@ function settingsPath(home) {
|
|
|
18180
18199
|
function readPiPluginState(home, env, installedVersion) {
|
|
18181
18200
|
if (!(0, import_node_fs22.existsSync)((0, import_node_path20.join)(home, ".pi", "agent"))) return void 0;
|
|
18182
18201
|
const expectedPath = expectedPiPluginPath(home, env, installedVersion);
|
|
18183
|
-
if (!expectedPath
|
|
18202
|
+
if (!expectedPath) return void 0;
|
|
18184
18203
|
const file = settingsPath(home);
|
|
18185
18204
|
if (!(0, import_node_fs22.existsSync)(file)) return { expectedPath, settingsReadable: true };
|
|
18186
18205
|
try {
|
package/package.json
CHANGED