@plannotator/opencode 0.27.0 → 0.27.1
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/embedded.js +66 -22
- package/package.json +1 -1
- package/plannotator.html +2 -2
- package/review-editor.html +189 -189
package/dist/embedded.js
CHANGED
|
@@ -99013,6 +99013,7 @@ var init_html_assets_node = __esm(() => {
|
|
|
99013
99013
|
import path2 from "path";
|
|
99014
99014
|
import fs3 from "fs";
|
|
99015
99015
|
import os3 from "os";
|
|
99016
|
+
import { spawn as spawn6 } from "child_process";
|
|
99016
99017
|
function currentPlatform() {
|
|
99017
99018
|
switch (process.platform) {
|
|
99018
99019
|
case "darwin":
|
|
@@ -99023,32 +99024,74 @@ function currentPlatform() {
|
|
|
99023
99024
|
return "linux";
|
|
99024
99025
|
}
|
|
99025
99026
|
}
|
|
99026
|
-
|
|
99027
|
-
|
|
99028
|
-
const
|
|
99029
|
-
|
|
99030
|
-
|
|
99031
|
-
|
|
99027
|
+
function runArgv(cmd, args, friendlyName, opts) {
|
|
99028
|
+
return new Promise((resolve13) => {
|
|
99029
|
+
const failure = (msg) => /ENOENT|not found/i.test(msg) ? { ok: false, error: `${friendlyName} not found` } : { ok: false, error: msg };
|
|
99030
|
+
let child;
|
|
99031
|
+
try {
|
|
99032
|
+
child = spawn6(cmd, args, {
|
|
99033
|
+
detached: true,
|
|
99034
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
99035
|
+
...opts?.cwd && { cwd: opts.cwd }
|
|
99036
|
+
});
|
|
99037
|
+
} catch (err) {
|
|
99038
|
+
resolve13(failure(err instanceof Error ? err.message : String(err)));
|
|
99039
|
+
return;
|
|
99040
|
+
}
|
|
99041
|
+
let stderr = "";
|
|
99042
|
+
child.stderr?.on("data", (chunk) => {
|
|
99043
|
+
if (stderr.length < LAUNCH_STDERR_CAP_BYTES)
|
|
99044
|
+
stderr += chunk.toString();
|
|
99032
99045
|
});
|
|
99033
|
-
|
|
99034
|
-
|
|
99035
|
-
|
|
99046
|
+
let settled = false;
|
|
99047
|
+
let exitInfo = null;
|
|
99048
|
+
const finish = (result) => {
|
|
99049
|
+
if (settled)
|
|
99050
|
+
return;
|
|
99051
|
+
settled = true;
|
|
99052
|
+
clearTimeout(deadline);
|
|
99053
|
+
resolve13(result);
|
|
99054
|
+
};
|
|
99055
|
+
const concludeExit = () => {
|
|
99056
|
+
if (!exitInfo)
|
|
99057
|
+
return;
|
|
99036
99058
|
if (/not found|ENOENT/i.test(stderr)) {
|
|
99037
|
-
|
|
99059
|
+
finish({ ok: false, error: `${friendlyName} not found` });
|
|
99060
|
+
return;
|
|
99038
99061
|
}
|
|
99039
|
-
|
|
99062
|
+
const status = exitInfo.code ?? exitInfo.signal ?? "unknown";
|
|
99063
|
+
finish({
|
|
99040
99064
|
ok: false,
|
|
99041
|
-
error: `Failed to open ${friendlyName} (exit ${
|
|
99042
|
-
};
|
|
99043
|
-
}
|
|
99044
|
-
|
|
99045
|
-
|
|
99046
|
-
|
|
99047
|
-
|
|
99048
|
-
|
|
99049
|
-
}
|
|
99050
|
-
|
|
99051
|
-
|
|
99065
|
+
error: `Failed to open ${friendlyName} (exit ${status})${stderr ? `: ${stderr.trim()}` : ""}`
|
|
99066
|
+
});
|
|
99067
|
+
};
|
|
99068
|
+
const deadline = setTimeout(() => {
|
|
99069
|
+
if (exitInfo)
|
|
99070
|
+
concludeExit();
|
|
99071
|
+
else
|
|
99072
|
+
finish({ ok: true });
|
|
99073
|
+
}, LAUNCH_GRACE_MS);
|
|
99074
|
+
child.once("error", (err) => {
|
|
99075
|
+
finish(failure(err instanceof Error ? err.message : String(err)));
|
|
99076
|
+
});
|
|
99077
|
+
child.once("exit", (code, signal) => {
|
|
99078
|
+
if (code === 0) {
|
|
99079
|
+
finish({ ok: true });
|
|
99080
|
+
return;
|
|
99081
|
+
}
|
|
99082
|
+
exitInfo = { code, signal };
|
|
99083
|
+
setTimeout(concludeExit, 50);
|
|
99084
|
+
});
|
|
99085
|
+
child.once("close", (code, signal) => {
|
|
99086
|
+
if (code === 0) {
|
|
99087
|
+
finish({ ok: true });
|
|
99088
|
+
return;
|
|
99089
|
+
}
|
|
99090
|
+
exitInfo = { code, signal };
|
|
99091
|
+
concludeExit();
|
|
99092
|
+
});
|
|
99093
|
+
child.unref();
|
|
99094
|
+
});
|
|
99052
99095
|
}
|
|
99053
99096
|
function spawnDetached(cmd, args, friendlyName) {
|
|
99054
99097
|
try {
|
|
@@ -99208,6 +99251,7 @@ async function handleOpenIn(req, options = {}) {
|
|
|
99208
99251
|
const result = await openFileInApp(abs, appId);
|
|
99209
99252
|
return Response.json(result);
|
|
99210
99253
|
}
|
|
99254
|
+
var LAUNCH_GRACE_MS = 2000, LAUNCH_STDERR_CAP_BYTES = 8192;
|
|
99211
99255
|
var init_open_in = __esm(() => {
|
|
99212
99256
|
init_open_in_apps2();
|
|
99213
99257
|
init_html_assets_node();
|