poe-code 3.0.247 → 3.0.248
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/opencode.js +40 -3
- package/dist/providers/opencode.js.map +2 -2
- package/package.json +1 -1
|
@@ -12329,6 +12329,29 @@ var OPEN_CODE_INSTALL_DEFINITION = {
|
|
|
12329
12329
|
function getModelArgs(model) {
|
|
12330
12330
|
return ["--model", providerModel(model)];
|
|
12331
12331
|
}
|
|
12332
|
+
async function ensureHealthWorkspace(context) {
|
|
12333
|
+
const dir = context.env.resolveHomePath(".poe-code", "opencode-health");
|
|
12334
|
+
await context.command.fs.mkdir(dir, { recursive: true });
|
|
12335
|
+
const check = await context.command.runCommand("git", [
|
|
12336
|
+
"-C",
|
|
12337
|
+
dir,
|
|
12338
|
+
"rev-parse",
|
|
12339
|
+
"--is-inside-work-tree"
|
|
12340
|
+
]);
|
|
12341
|
+
if (check.exitCode === 0 && check.stdout.trim() === "true") {
|
|
12342
|
+
return dir;
|
|
12343
|
+
}
|
|
12344
|
+
const init = await context.command.runCommand("git", ["-C", dir, "init", "-q"]);
|
|
12345
|
+
if (init.exitCode !== 0) {
|
|
12346
|
+
throw new Error(
|
|
12347
|
+
[
|
|
12348
|
+
"Failed to initialize OpenCode health check workspace.",
|
|
12349
|
+
formatCommandRunnerResult(init)
|
|
12350
|
+
].join("\n")
|
|
12351
|
+
);
|
|
12352
|
+
}
|
|
12353
|
+
return dir;
|
|
12354
|
+
}
|
|
12332
12355
|
var openCodeService = createProvider({
|
|
12333
12356
|
...openCodeAgent,
|
|
12334
12357
|
supportsStdinPrompt: false,
|
|
@@ -12419,11 +12442,25 @@ var openCodeService = createProvider({
|
|
|
12419
12442
|
]
|
|
12420
12443
|
},
|
|
12421
12444
|
install: OPEN_CODE_INSTALL_DEFINITION,
|
|
12422
|
-
test(context) {
|
|
12445
|
+
async test(context) {
|
|
12446
|
+
const healthDir = context.logger.context.dryRun ? context.env.resolveHomePath(".poe-code", "opencode-health") : await ensureHealthWorkspace(context);
|
|
12423
12447
|
return context.runCheck(
|
|
12424
12448
|
createSpawnHealthCheck("opencode", {
|
|
12425
|
-
|
|
12426
|
-
|
|
12449
|
+
expectedOutput: "OPEN_CODE_OK",
|
|
12450
|
+
invocation: {
|
|
12451
|
+
command: "opencode",
|
|
12452
|
+
args: [
|
|
12453
|
+
"run",
|
|
12454
|
+
"Output exactly: OPEN_CODE_OK",
|
|
12455
|
+
"--pure",
|
|
12456
|
+
"--format",
|
|
12457
|
+
"json",
|
|
12458
|
+
"--model",
|
|
12459
|
+
providerModel(context.model),
|
|
12460
|
+
"--dir",
|
|
12461
|
+
healthDir
|
|
12462
|
+
]
|
|
12463
|
+
}
|
|
12427
12464
|
})
|
|
12428
12465
|
);
|
|
12429
12466
|
},
|