@shog-lab/pi-toolkit 0.1.0 → 0.1.1
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/bin/init.js +10 -1
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -29,12 +29,21 @@ function findHostRoot() {
|
|
|
29
29
|
if (initCwd && resolve(initCwd) !== PKG_ROOT) {
|
|
30
30
|
return resolve(initCwd);
|
|
31
31
|
}
|
|
32
|
+
// Fallback: walk up from PKG_ROOT until we land on a node_modules whose parent
|
|
33
|
+
// is NOT inside a pnpm cache. pnpm nests packages under
|
|
34
|
+
// node_modules/.pnpm/<pkg>@<ver>/node_modules/... so the first ancestor
|
|
35
|
+
// node_modules we hit is inside .pnpm — skip past it to find the real host root.
|
|
32
36
|
let dir = resolve(PKG_ROOT);
|
|
33
37
|
while (dir !== "/" && dir !== ".") {
|
|
34
38
|
const parent = dirname(dir);
|
|
35
39
|
if (parent === dir) break;
|
|
36
40
|
if (parent.endsWith("/node_modules")) {
|
|
37
|
-
|
|
41
|
+
const candidate = dirname(parent);
|
|
42
|
+
if (candidate.includes("/node_modules/.pnpm/")) {
|
|
43
|
+
dir = candidate;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
return candidate;
|
|
38
47
|
}
|
|
39
48
|
dir = parent;
|
|
40
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shog-lab/pi-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Common pi-coding-agent extensions and CLI tools: image generation (Jimeng), web search and image understanding (mmx), browser automation (agent-browser).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|