opencode-conductor-plugin 1.2.1 → 1.3.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/index.js +14 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,11 +5,22 @@ import { statusCommand } from "./commands/status.js";
|
|
|
5
5
|
import { revertCommand } from "./commands/revert.js";
|
|
6
6
|
import { join } from "path";
|
|
7
7
|
import { homedir } from "os";
|
|
8
|
-
import { existsSync } from "fs";
|
|
8
|
+
import { existsSync, readFileSync } from "fs";
|
|
9
9
|
const ConductorPlugin = async (ctx) => {
|
|
10
10
|
// Detect oh-my-opencode for synergy features
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const configPath = join(homedir(), ".config", "opencode", "opencode.json");
|
|
12
|
+
let isOMOActive = false;
|
|
13
|
+
try {
|
|
14
|
+
if (existsSync(configPath)) {
|
|
15
|
+
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
16
|
+
isOMOActive = config.plugin?.some((p) => p.includes("oh-my-opencode"));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
// Fallback to filesystem check if config read fails
|
|
21
|
+
const omoPath = join(homedir(), ".config", "opencode", "node_modules", "oh-my-opencode");
|
|
22
|
+
isOMOActive = existsSync(omoPath);
|
|
23
|
+
}
|
|
13
24
|
console.log(`[Conductor] Plugin tools loaded. (OMO Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
|
|
14
25
|
const extendedCtx = { ...ctx, isOMOActive };
|
|
15
26
|
return {
|