@skylandnpm/octopus-proxy 0.1.7 → 0.1.8
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/{chunk-JWIM27KY.js → chunk-2SGNDVCO.js} +21 -2
- package/dist/cli.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
|
@@ -14438,6 +14438,7 @@ var Runtime = class {
|
|
|
14438
14438
|
password = "";
|
|
14439
14439
|
version = "";
|
|
14440
14440
|
state = "stopped";
|
|
14441
|
+
lastError = "";
|
|
14441
14442
|
async identity(pid) {
|
|
14442
14443
|
try {
|
|
14443
14444
|
return (await promisify2(execFile2)("ps", ["-p", String(pid), "-o", "lstart=", "-o", "command="])).stdout.trim();
|
|
@@ -14493,13 +14494,30 @@ var Runtime = class {
|
|
|
14493
14494
|
}
|
|
14494
14495
|
}
|
|
14495
14496
|
async status() {
|
|
14496
|
-
|
|
14497
|
+
const healthy = await this.health();
|
|
14498
|
+
return {
|
|
14499
|
+
tool: this.kind,
|
|
14500
|
+
mode: this.config.tool.mode,
|
|
14501
|
+
state: this.state,
|
|
14502
|
+
healthy,
|
|
14503
|
+
version: this.version,
|
|
14504
|
+
pid: this.owned?.pid,
|
|
14505
|
+
attempts: this.attempts,
|
|
14506
|
+
...healthy ? {} : { error: this.lastError || `OpenCode at ${this.config.tool.baseUrl} did not pass its health check` }
|
|
14507
|
+
};
|
|
14497
14508
|
}
|
|
14498
14509
|
start() {
|
|
14499
14510
|
if (this.detached) throw new Error("Runtime supervisor is detached");
|
|
14500
14511
|
if (this.config.tool.mode !== "managed") throw new Error("External instance is not owned; configure managed mode after stopping it explicitly");
|
|
14501
14512
|
if (this.starting) return this.starting;
|
|
14502
|
-
this.starting = this.startOwned().
|
|
14513
|
+
this.starting = this.startOwned().then((result) => {
|
|
14514
|
+
this.lastError = "";
|
|
14515
|
+
return result;
|
|
14516
|
+
}).catch((error) => {
|
|
14517
|
+
this.lastError = error instanceof Error ? error.message : String(error);
|
|
14518
|
+
if (this.wanted && this.state !== "unowned") this.state = "failed";
|
|
14519
|
+
throw error;
|
|
14520
|
+
}).finally(() => {
|
|
14503
14521
|
this.starting = void 0;
|
|
14504
14522
|
});
|
|
14505
14523
|
return this.starting;
|
|
@@ -14507,6 +14525,7 @@ var Runtime = class {
|
|
|
14507
14525
|
exited() {
|
|
14508
14526
|
if (this.detached) return;
|
|
14509
14527
|
this.state = this.wanted ? "failed" : "stopped";
|
|
14528
|
+
if (this.wanted && !this.lastError) this.lastError = "OpenCode process exited unexpectedly";
|
|
14510
14529
|
void this.save();
|
|
14511
14530
|
if (this.wanted && this.attempts < 5) {
|
|
14512
14531
|
const delay = Math.min(3e4, 1e3 * 2 ** this.attempts++);
|
package/dist/cli.js
CHANGED
package/dist/main.js
CHANGED