@tudeorangbiasa/sdd-multiagent-opencode 0.1.2 → 0.1.3

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.
@@ -1,19 +1,36 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const pluginDir = path.dirname(fileURLToPath(import.meta.url));
6
+
7
+ function readProfile() {
8
+ const candidates = [
9
+ path.join(process.cwd(), ".sdd", "model-profile.json"),
10
+ path.join(pluginDir, "..", "..", ".sdd", "model-profile.json"),
11
+ path.join(pluginDir, "..", ".sdd", "model-profile.json"),
12
+ ];
13
+
14
+ for (const profilePath of candidates) {
15
+ if (!fs.existsSync(profilePath)) {
16
+ continue;
17
+ }
18
+
19
+ try {
20
+ return JSON.parse(fs.readFileSync(profilePath, "utf-8"));
21
+ } catch {
22
+ return null;
23
+ }
24
+ }
25
+
26
+ return null;
27
+ }
3
28
 
4
29
  export default async () => {
5
30
  return {
6
31
  config: (cfg) => {
7
- const profilePath = path.join(process.cwd(), ".sdd", "model-profile.json");
8
-
9
- if (!fs.existsSync(profilePath)) {
10
- return;
11
- }
12
-
13
- let profile;
14
- try {
15
- profile = JSON.parse(fs.readFileSync(profilePath, "utf-8"));
16
- } catch {
32
+ const profile = readProfile();
33
+ if (!profile) {
17
34
  return;
18
35
  }
19
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tudeorangbiasa/sdd-multiagent-opencode",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Spec-Driven Development multi-agent workflow for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {