oh-my-opencode-kikokikok 2.14.0 → 2.14.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/dist/cli/index.js +13 -5
- package/dist/index.js +12 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "oh-my-opencode-kikokikok",
|
|
2256
|
-
version: "2.14.
|
|
2256
|
+
version: "2.14.1",
|
|
2257
2257
|
description: "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -5598,29 +5598,37 @@ import { readFileSync } from "fs";
|
|
|
5598
5598
|
import { join, dirname } from "path";
|
|
5599
5599
|
import { fileURLToPath } from "url";
|
|
5600
5600
|
var cachedPackageInfo = null;
|
|
5601
|
+
function isValidPackageJson(obj) {
|
|
5602
|
+
return typeof obj === "object" && obj !== null && typeof obj.name === "string" && obj.name.length > 0;
|
|
5603
|
+
}
|
|
5601
5604
|
function loadPackageJson() {
|
|
5602
5605
|
if (cachedPackageInfo) {
|
|
5603
5606
|
return cachedPackageInfo;
|
|
5604
5607
|
}
|
|
5608
|
+
const fallback = { name: "oh-my-opencode", version: "0.0.0" };
|
|
5605
5609
|
try {
|
|
5606
5610
|
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
5607
5611
|
const possiblePaths = [
|
|
5612
|
+
join(currentDir, "..", "package.json"),
|
|
5608
5613
|
join(currentDir, "..", "..", "package.json"),
|
|
5609
5614
|
join(currentDir, "..", "..", "..", "package.json")
|
|
5610
5615
|
];
|
|
5611
5616
|
for (const pkgPath of possiblePaths) {
|
|
5612
5617
|
try {
|
|
5613
5618
|
const content = readFileSync(pkgPath, "utf-8");
|
|
5614
|
-
|
|
5615
|
-
|
|
5619
|
+
const parsed = JSON.parse(content);
|
|
5620
|
+
if (isValidPackageJson(parsed)) {
|
|
5621
|
+
cachedPackageInfo = parsed;
|
|
5622
|
+
return cachedPackageInfo;
|
|
5623
|
+
}
|
|
5616
5624
|
} catch {
|
|
5617
5625
|
continue;
|
|
5618
5626
|
}
|
|
5619
5627
|
}
|
|
5620
|
-
cachedPackageInfo =
|
|
5628
|
+
cachedPackageInfo = fallback;
|
|
5621
5629
|
return cachedPackageInfo;
|
|
5622
5630
|
} catch {
|
|
5623
|
-
cachedPackageInfo =
|
|
5631
|
+
cachedPackageInfo = fallback;
|
|
5624
5632
|
return cachedPackageInfo;
|
|
5625
5633
|
}
|
|
5626
5634
|
}
|
package/dist/index.js
CHANGED
|
@@ -8542,29 +8542,37 @@ import { readFileSync as readFileSync2 } from "fs";
|
|
|
8542
8542
|
import { join as join4, dirname } from "path";
|
|
8543
8543
|
import { fileURLToPath } from "url";
|
|
8544
8544
|
var cachedPackageInfo = null;
|
|
8545
|
+
function isValidPackageJson(obj) {
|
|
8546
|
+
return typeof obj === "object" && obj !== null && typeof obj.name === "string" && obj.name.length > 0;
|
|
8547
|
+
}
|
|
8545
8548
|
function loadPackageJson() {
|
|
8546
8549
|
if (cachedPackageInfo) {
|
|
8547
8550
|
return cachedPackageInfo;
|
|
8548
8551
|
}
|
|
8552
|
+
const fallback = { name: "oh-my-opencode", version: "0.0.0" };
|
|
8549
8553
|
try {
|
|
8550
8554
|
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
8551
8555
|
const possiblePaths = [
|
|
8556
|
+
join4(currentDir, "..", "package.json"),
|
|
8552
8557
|
join4(currentDir, "..", "..", "package.json"),
|
|
8553
8558
|
join4(currentDir, "..", "..", "..", "package.json")
|
|
8554
8559
|
];
|
|
8555
8560
|
for (const pkgPath of possiblePaths) {
|
|
8556
8561
|
try {
|
|
8557
8562
|
const content = readFileSync2(pkgPath, "utf-8");
|
|
8558
|
-
|
|
8559
|
-
|
|
8563
|
+
const parsed = JSON.parse(content);
|
|
8564
|
+
if (isValidPackageJson(parsed)) {
|
|
8565
|
+
cachedPackageInfo = parsed;
|
|
8566
|
+
return cachedPackageInfo;
|
|
8567
|
+
}
|
|
8560
8568
|
} catch {
|
|
8561
8569
|
continue;
|
|
8562
8570
|
}
|
|
8563
8571
|
}
|
|
8564
|
-
cachedPackageInfo =
|
|
8572
|
+
cachedPackageInfo = fallback;
|
|
8565
8573
|
return cachedPackageInfo;
|
|
8566
8574
|
} catch {
|
|
8567
|
-
cachedPackageInfo =
|
|
8575
|
+
cachedPackageInfo = fallback;
|
|
8568
8576
|
return cachedPackageInfo;
|
|
8569
8577
|
}
|
|
8570
8578
|
}
|