open-agents-ai 0.187.325 → 0.187.326
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 +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -299423,9 +299423,17 @@ sleep 1
|
|
|
299423
299423
|
const tokens = (arg || "").trim().length ? (arg || "").trim().split(/\s+/) : [];
|
|
299424
299424
|
const sub = (tokens[0] || "menu").toLowerCase();
|
|
299425
299425
|
const base3 = `http://127.0.0.1:${process.env["OA_PORT"] || "11435"}`;
|
|
299426
|
+
const defaultHeaders = () => {
|
|
299427
|
+
const h = {};
|
|
299428
|
+
const token = process.env["OA_API_KEY"] || "";
|
|
299429
|
+
if (token) h["Authorization"] = `Bearer ${token}`;
|
|
299430
|
+
return h;
|
|
299431
|
+
};
|
|
299426
299432
|
const doFetch = async (path5, init2) => {
|
|
299427
299433
|
const url = base3 + path5;
|
|
299428
|
-
|
|
299434
|
+
const merged = init2 || {};
|
|
299435
|
+
merged.headers = { ...defaultHeaders(), ...init2?.headers || {} };
|
|
299436
|
+
return await fetch(url, merged);
|
|
299429
299437
|
};
|
|
299430
299438
|
if (sub === "menu") {
|
|
299431
299439
|
try {
|
|
@@ -327893,7 +327901,7 @@ async function handleRequest(req2, res, ollamaUrl, verbose) {
|
|
|
327893
327901
|
if (pathname === "/v1/scheduled/kill" && method === "POST") {
|
|
327894
327902
|
const body = await parseJsonBody(req2);
|
|
327895
327903
|
const pids = Array.isArray(body?.pids) ? body.pids.filter((n2) => Number.isInteger(n2)) : void 0;
|
|
327896
|
-
const pattern = typeof body?.pattern === "string" && body.pattern.trim() ? body.pattern.trim() : "(/bin/oa|open-agents-ai|nexus-daemon|OPEN-AGENTS-SCHEDULED|ollama)";
|
|
327904
|
+
const pattern = typeof body?.pattern === "string" && body.pattern.trim() ? body.pattern.trim() : "(/bin/oa|open-agents-ai|nexus-daemon|OPEN-AGENTS-SCHEDULED|oa-sched-|ollama)";
|
|
327897
327905
|
const timersDisabled = disableAllOaTimers();
|
|
327898
327906
|
const cronRemoved = removeAllOaCrons();
|
|
327899
327907
|
const procsBefore = listMatchingProcesses(pattern);
|
package/package.json
CHANGED