opencode-athena 0.5.0 → 0.6.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/cli/index.js +529 -79
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +24 -2
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.js +24 -2
- package/dist/plugin/index.js.map +1 -1
- package/package.json +3 -1
package/dist/plugin/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { homedir, platform } from 'os';
|
|
2
2
|
import { tool } from '@opencode-ai/plugin';
|
|
3
|
+
import { existsSync, readFileSync } from 'fs';
|
|
3
4
|
import { join, dirname } from 'path';
|
|
4
|
-
import {
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
5
6
|
import { readFile, mkdir, writeFile, readdir, rm } from 'fs/promises';
|
|
6
7
|
import { parse, stringify } from 'yaml';
|
|
7
8
|
import { z } from 'zod';
|
|
@@ -149,7 +150,28 @@ IMPORTANT: You are implementing a BMAD story. Use athena_get_story to reload ful
|
|
|
149
150
|
}
|
|
150
151
|
};
|
|
151
152
|
}
|
|
152
|
-
|
|
153
|
+
function getPackageVersion() {
|
|
154
|
+
try {
|
|
155
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
156
|
+
const possiblePaths = [
|
|
157
|
+
join(currentDir, "..", "..", "package.json"),
|
|
158
|
+
join(currentDir, "..", "..", "..", "package.json")
|
|
159
|
+
];
|
|
160
|
+
for (const pkgPath of possiblePaths) {
|
|
161
|
+
if (!existsSync(pkgPath)) continue;
|
|
162
|
+
const content = readFileSync(pkgPath, "utf-8");
|
|
163
|
+
try {
|
|
164
|
+
const pkg = JSON.parse(content);
|
|
165
|
+
if (pkg.version) return pkg.version;
|
|
166
|
+
} catch {
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return "0.0.0";
|
|
170
|
+
} catch {
|
|
171
|
+
return "0.0.0";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
var VERSION = getPackageVersion();
|
|
153
175
|
var CONFIG_PATHS = {
|
|
154
176
|
/** Global OpenCode config directory */
|
|
155
177
|
globalConfigDir: join(homedir(), ".config", "opencode"),
|