open-plan-annotator 0.2.9 → 0.2.11
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.
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"name": "open-plan-annotator",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"description": "Interactive plan annotation UI: review, strikethrough, and comment on Claude's plans before approving. Fully local, no external services.",
|
|
15
|
-
"version": "0.2.
|
|
15
|
+
"version": "0.2.11",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "ndom91"
|
|
18
18
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-plan-annotator",
|
|
3
3
|
"description": "Interactive plan annotation UI: review, strikethrough, and comment on Claude's plans before approving. Fully local, no external services.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.11",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ndom91"
|
|
7
7
|
},
|
package/opencode/bridge.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { existsSync, statSync } from "node:fs";
|
|
4
|
+
import { dirname } from "node:path";
|
|
3
5
|
import { fileURLToPath } from "node:url";
|
|
4
6
|
|
|
5
7
|
const WRAPPER_PATH = fileURLToPath(new URL("../bin/open-plan-annotator.cjs", import.meta.url));
|
|
@@ -102,7 +104,18 @@ export async function runPlanReview(options) {
|
|
|
102
104
|
const payload = buildHookPayload(options);
|
|
103
105
|
|
|
104
106
|
const result = await new Promise((resolve, reject) => {
|
|
105
|
-
|
|
107
|
+
let cwd = options.cwd ?? process.cwd();
|
|
108
|
+
|
|
109
|
+
// Guard: ensure cwd is a directory, not a file
|
|
110
|
+
try {
|
|
111
|
+
if (existsSync(cwd) && !statSync(cwd).isDirectory()) {
|
|
112
|
+
cwd = dirname(cwd);
|
|
113
|
+
}
|
|
114
|
+
} catch {
|
|
115
|
+
// Fall back to wrapper's directory if all else fails
|
|
116
|
+
cwd = dirname(WRAPPER_PATH);
|
|
117
|
+
}
|
|
118
|
+
|
|
106
119
|
const child = spawn(process.execPath, [WRAPPER_PATH], {
|
|
107
120
|
cwd,
|
|
108
121
|
stdio: ["pipe", "pipe", "pipe"],
|