open-agents-ai 0.184.39 → 0.184.41
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 +34 -74
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -60201,6 +60201,11 @@ var init_status_bar = __esm({
|
|
|
60201
60201
|
setHeaderButtonHandler(handler) {
|
|
60202
60202
|
this._headerButtonHandler = handler;
|
|
60203
60203
|
}
|
|
60204
|
+
/** Programmatically fire a header button command (used for deferred/queued clicks) */
|
|
60205
|
+
fireHeaderButton(command) {
|
|
60206
|
+
if (this._headerButtonHandler)
|
|
60207
|
+
this._headerButtonHandler(command);
|
|
60208
|
+
}
|
|
60204
60209
|
/** Get the text selection instance (for external keyboard shortcut wiring) */
|
|
60205
60210
|
get textSelection() {
|
|
60206
60211
|
return this._textSelection;
|
|
@@ -64759,10 +64764,17 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
64759
64764
|
});
|
|
64760
64765
|
let commandCtxRef = null;
|
|
64761
64766
|
let headerBtnActive = null;
|
|
64767
|
+
let headerBtnQueue = null;
|
|
64762
64768
|
statusBar.setHeaderButtonHandler((command) => {
|
|
64763
|
-
if (!commandCtxRef)
|
|
64769
|
+
if (!commandCtxRef) {
|
|
64770
|
+
headerBtnQueue = command;
|
|
64764
64771
|
return;
|
|
64765
|
-
|
|
64772
|
+
}
|
|
64773
|
+
if (headerBtnActive && headerBtnActive !== command) {
|
|
64774
|
+
headerBtnQueue = command;
|
|
64775
|
+
return;
|
|
64776
|
+
}
|
|
64777
|
+
if (headerBtnActive === command)
|
|
64766
64778
|
return;
|
|
64767
64779
|
headerBtnActive = command;
|
|
64768
64780
|
(async () => {
|
|
@@ -64777,6 +64789,11 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
64777
64789
|
banner.renderCurrentFrame();
|
|
64778
64790
|
statusBar.refreshDisplay();
|
|
64779
64791
|
}
|
|
64792
|
+
if (headerBtnQueue) {
|
|
64793
|
+
const queued = headerBtnQueue;
|
|
64794
|
+
headerBtnQueue = null;
|
|
64795
|
+
setTimeout(() => statusBar.fireHeaderButton?.(queued), 50);
|
|
64796
|
+
}
|
|
64780
64797
|
})();
|
|
64781
64798
|
});
|
|
64782
64799
|
rl.output = null;
|
|
@@ -65041,80 +65058,18 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
65041
65058
|
}
|
|
65042
65059
|
try {
|
|
65043
65060
|
const apiPort = parseInt(process.env["OA_PORT"] || "11435", 10);
|
|
65044
|
-
const
|
|
65045
|
-
const
|
|
65046
|
-
|
|
65047
|
-
|
|
65048
|
-
tester.once("error", (err) => {
|
|
65049
|
-
resolve36(err.code !== "EADDRINUSE");
|
|
65050
|
-
});
|
|
65051
|
-
tester.once("listening", () => {
|
|
65052
|
-
tester.close(() => resolve36(true));
|
|
65053
|
-
});
|
|
65054
|
-
tester.listen(apiPort, "127.0.0.1");
|
|
65055
|
-
});
|
|
65056
|
-
if (!portFree) {
|
|
65057
|
-
let isOurServer = false;
|
|
65058
|
-
try {
|
|
65059
|
-
const probe = await fetch(`http://127.0.0.1:${apiPort}/health`, { signal: AbortSignal.timeout(2e3) });
|
|
65060
|
-
if (probe.ok) {
|
|
65061
|
-
const data = await probe.json();
|
|
65062
|
-
isOurServer = data.status === "ok";
|
|
65063
|
-
}
|
|
65064
|
-
} catch {
|
|
65065
|
-
}
|
|
65066
|
-
if (isOurServer) {
|
|
65067
|
-
} else {
|
|
65068
|
-
try {
|
|
65069
|
-
const { execSync: nodeExec } = __require("child_process");
|
|
65070
|
-
if (isWin2) {
|
|
65071
|
-
const out = nodeExec(`netstat -ano | findstr :${apiPort} | findstr LISTENING`, { encoding: "utf8", timeout: 3e3 }).trim();
|
|
65072
|
-
const pid = out.split(/\s+/).pop();
|
|
65073
|
-
if (pid && parseInt(pid, 10) > 0 && parseInt(pid, 10) !== process.pid) {
|
|
65074
|
-
nodeExec(`taskkill /PID ${pid} /F`, { timeout: 3e3 });
|
|
65075
|
-
writeContent(() => renderInfo(`Killed orphaned process on port ${apiPort} (PID ${pid})`));
|
|
65076
|
-
await new Promise((r) => setTimeout(r, 1e3));
|
|
65077
|
-
}
|
|
65078
|
-
} else {
|
|
65079
|
-
try {
|
|
65080
|
-
const out = nodeExec(`lsof -ti :${apiPort} 2>/dev/null || fuser ${apiPort}/tcp 2>/dev/null`, { encoding: "utf8", timeout: 3e3 }).trim();
|
|
65081
|
-
const pids = out.split(/\s+/).map((s) => parseInt(s, 10)).filter((p) => p > 0 && p !== process.pid);
|
|
65082
|
-
for (const pid of pids) {
|
|
65083
|
-
try {
|
|
65084
|
-
process.kill(pid, "SIGTERM");
|
|
65085
|
-
} catch {
|
|
65086
|
-
}
|
|
65087
|
-
}
|
|
65088
|
-
if (pids.length > 0) {
|
|
65089
|
-
writeContent(() => renderInfo(`Killed ${pids.length} orphaned process(es) on port ${apiPort}`));
|
|
65090
|
-
await new Promise((r) => setTimeout(r, 1e3));
|
|
65091
|
-
}
|
|
65092
|
-
} catch {
|
|
65093
|
-
}
|
|
65094
|
-
}
|
|
65095
|
-
} catch {
|
|
65096
|
-
}
|
|
65097
|
-
}
|
|
65098
|
-
}
|
|
65099
|
-
const portNowFree = await new Promise((resolve36) => {
|
|
65100
|
-
const net = __require("net");
|
|
65101
|
-
const tester = net.createServer();
|
|
65102
|
-
tester.once("error", () => resolve36(false));
|
|
65103
|
-
tester.once("listening", () => {
|
|
65104
|
-
tester.close(() => resolve36(true));
|
|
65105
|
-
});
|
|
65106
|
-
tester.listen(apiPort, "127.0.0.1");
|
|
65061
|
+
const { startApiServer: startApiServer2 } = await Promise.resolve().then(() => (init_serve(), serve_exports));
|
|
65062
|
+
const apiServer = startApiServer2({
|
|
65063
|
+
port: apiPort,
|
|
65064
|
+
ollamaUrl: currentConfig.backendUrl || "http://127.0.0.1:11434"
|
|
65107
65065
|
});
|
|
65108
|
-
|
|
65109
|
-
|
|
65110
|
-
|
|
65111
|
-
port: apiPort,
|
|
65112
|
-
ollamaUrl: currentConfig.backendUrl || "http://127.0.0.1:11434"
|
|
65113
|
-
});
|
|
65114
|
-
apiServer.on?.("error", () => {
|
|
65115
|
-
});
|
|
65066
|
+
let apiStarted = false;
|
|
65067
|
+
apiServer.on?.("listening", () => {
|
|
65068
|
+
apiStarted = true;
|
|
65116
65069
|
writeContent(() => renderInfo(`REST API: http://localhost:${apiPort}`));
|
|
65117
|
-
}
|
|
65070
|
+
});
|
|
65071
|
+
apiServer.on?.("error", () => {
|
|
65072
|
+
});
|
|
65118
65073
|
} catch {
|
|
65119
65074
|
}
|
|
65120
65075
|
try {
|
|
@@ -66459,6 +66414,11 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
66459
66414
|
}
|
|
66460
66415
|
};
|
|
66461
66416
|
commandCtxRef = commandCtx;
|
|
66417
|
+
if (headerBtnQueue) {
|
|
66418
|
+
const queued = headerBtnQueue;
|
|
66419
|
+
headerBtnQueue = null;
|
|
66420
|
+
setTimeout(() => statusBar.fireHeaderButton?.(queued), 100);
|
|
66421
|
+
}
|
|
66462
66422
|
showPrompt();
|
|
66463
66423
|
if (!isResumed) {
|
|
66464
66424
|
const savedCtx = loadSessionContext(repoRoot);
|
package/package.json
CHANGED