@deimoscloud/coreai 0.1.4 → 0.1.5
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 +44 -27
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +23 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import {
|
|
2
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
3
|
+
import { dirname as dirname5, join as join8 } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
3
5
|
|
|
4
6
|
// src/config/loader.ts
|
|
5
7
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -3806,8 +3808,23 @@ function formatAgentKnowledgeState(state) {
|
|
|
3806
3808
|
}
|
|
3807
3809
|
|
|
3808
3810
|
// src/index.ts
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
+
function findPackageJson() {
|
|
3812
|
+
let dir = dirname5(fileURLToPath(import.meta.url));
|
|
3813
|
+
while (dir !== dirname5(dir)) {
|
|
3814
|
+
const pkgPath = join8(dir, "package.json");
|
|
3815
|
+
try {
|
|
3816
|
+
const content = readFileSync5(pkgPath, "utf-8");
|
|
3817
|
+
const pkg = JSON.parse(content);
|
|
3818
|
+
if (pkg.name === "@deimoscloud/coreai") {
|
|
3819
|
+
return content;
|
|
3820
|
+
}
|
|
3821
|
+
} catch {
|
|
3822
|
+
}
|
|
3823
|
+
dir = dirname5(dir);
|
|
3824
|
+
}
|
|
3825
|
+
return '{"version": "unknown"}';
|
|
3826
|
+
}
|
|
3827
|
+
var packageJson = JSON.parse(findPackageJson());
|
|
3811
3828
|
var VERSION = packageJson.version;
|
|
3812
3829
|
export {
|
|
3813
3830
|
AGENT_DIRECTORIES,
|