open-agents-ai 0.187.305 → 0.187.306

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.
Files changed (2) hide show
  1. package/dist/index.js +255 -30
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -88532,7 +88532,7 @@ var require_auto = __commonJS({
88532
88532
  // ../node_modules/acme-client/src/client.js
88533
88533
  var require_client = __commonJS({
88534
88534
  "../node_modules/acme-client/src/client.js"(exports, module) {
88535
- var { createHash: createHash10 } = __require("crypto");
88535
+ var { createHash: createHash11 } = __require("crypto");
88536
88536
  var { getPemBodyAsB64u } = require_crypto();
88537
88537
  var { log: log22 } = require_logger();
88538
88538
  var HttpClient = require_http();
@@ -88843,14 +88843,14 @@ var require_client = __commonJS({
88843
88843
  */
88844
88844
  async getChallengeKeyAuthorization(challenge) {
88845
88845
  const jwk = this.http.getJwk();
88846
- const keysum = createHash10("sha256").update(JSON.stringify(jwk));
88846
+ const keysum = createHash11("sha256").update(JSON.stringify(jwk));
88847
88847
  const thumbprint = keysum.digest("base64url");
88848
88848
  const result = `${challenge.token}.${thumbprint}`;
88849
88849
  if (challenge.type === "http-01") {
88850
88850
  return result;
88851
88851
  }
88852
88852
  if (challenge.type === "dns-01") {
88853
- return createHash10("sha256").update(result).digest("base64url");
88853
+ return createHash11("sha256").update(result).digest("base64url");
88854
88854
  }
88855
88855
  if (challenge.type === "tls-alpn-01") {
88856
88856
  return result;
@@ -231530,7 +231530,7 @@ var require_websocket2 = __commonJS({
231530
231530
  var http6 = __require("http");
231531
231531
  var net5 = __require("net");
231532
231532
  var tls2 = __require("tls");
231533
- var { randomBytes: randomBytes23, createHash: createHash10 } = __require("crypto");
231533
+ var { randomBytes: randomBytes23, createHash: createHash11 } = __require("crypto");
231534
231534
  var { Duplex: Duplex3, Readable } = __require("stream");
231535
231535
  var { URL: URL3 } = __require("url");
231536
231536
  var PerMessageDeflate2 = require_permessage_deflate2();
@@ -232190,7 +232190,7 @@ var require_websocket2 = __commonJS({
232190
232190
  abortHandshake(websocket, socket, "Invalid Upgrade header");
232191
232191
  return;
232192
232192
  }
232193
- const digest3 = createHash10("sha1").update(key + GUID).digest("base64");
232193
+ const digest3 = createHash11("sha1").update(key + GUID).digest("base64");
232194
232194
  if (res.headers["sec-websocket-accept"] !== digest3) {
232195
232195
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
232196
232196
  return;
@@ -232557,7 +232557,7 @@ var require_websocket_server = __commonJS({
232557
232557
  var EventEmitter11 = __require("events");
232558
232558
  var http6 = __require("http");
232559
232559
  var { Duplex: Duplex3 } = __require("stream");
232560
- var { createHash: createHash10 } = __require("crypto");
232560
+ var { createHash: createHash11 } = __require("crypto");
232561
232561
  var extension2 = require_extension2();
232562
232562
  var PerMessageDeflate2 = require_permessage_deflate2();
232563
232563
  var subprotocol2 = require_subprotocol();
@@ -232858,7 +232858,7 @@ var require_websocket_server = __commonJS({
232858
232858
  );
232859
232859
  }
232860
232860
  if (this._state > RUNNING) return abortHandshake(socket, 503);
232861
- const digest3 = createHash10("sha1").update(key + GUID).digest("base64");
232861
+ const digest3 = createHash11("sha1").update(key + GUID).digest("base64");
232862
232862
  const headers = [
232863
232863
  "HTTP/1.1 101 Switching Protocols",
232864
232864
  "Upgrade: websocket",
@@ -240032,7 +240032,7 @@ var require_compile = __commonJS({
240032
240032
  var fill = require_fill_range();
240033
240033
  var utils = require_utils3();
240034
240034
  var compile = (ast, options2 = {}) => {
240035
- const walk = (node, parent = {}) => {
240035
+ const walk2 = (node, parent = {}) => {
240036
240036
  const invalidBlock = utils.isInvalidBrace(parent);
240037
240037
  const invalidNode = node.invalid === true && options2.escapeInvalid === true;
240038
240038
  const invalid = invalidBlock === true || invalidNode === true;
@@ -240066,12 +240066,12 @@ var require_compile = __commonJS({
240066
240066
  }
240067
240067
  if (node.nodes) {
240068
240068
  for (const child of node.nodes) {
240069
- output += walk(child, node);
240069
+ output += walk2(child, node);
240070
240070
  }
240071
240071
  }
240072
240072
  return output;
240073
240073
  };
240074
- return walk(ast);
240074
+ return walk2(ast);
240075
240075
  };
240076
240076
  module.exports = compile;
240077
240077
  }
@@ -240108,7 +240108,7 @@ var require_expand = __commonJS({
240108
240108
  };
240109
240109
  var expand2 = (ast, options2 = {}) => {
240110
240110
  const rangeLimit = options2.rangeLimit === void 0 ? 1e3 : options2.rangeLimit;
240111
- const walk = (node, parent = {}) => {
240111
+ const walk2 = (node, parent = {}) => {
240112
240112
  node.queue = [];
240113
240113
  let p2 = parent;
240114
240114
  let q = parent.queue;
@@ -240160,12 +240160,12 @@ var require_expand = __commonJS({
240160
240160
  continue;
240161
240161
  }
240162
240162
  if (child.nodes) {
240163
- walk(child, node);
240163
+ walk2(child, node);
240164
240164
  }
240165
240165
  }
240166
240166
  return queue;
240167
240167
  };
240168
- return utils.flatten(walk(ast));
240168
+ return utils.flatten(walk2(ast));
240169
240169
  };
240170
240170
  module.exports = expand2;
240171
240171
  }
@@ -244128,14 +244128,14 @@ var require_out3 = __commonJS({
244128
244128
  var sync_1 = require_sync4();
244129
244129
  var settings_1 = require_settings3();
244130
244130
  exports.Settings = settings_1.default;
244131
- function walk(directory, optionsOrSettingsOrCallback, callback) {
244131
+ function walk2(directory, optionsOrSettingsOrCallback, callback) {
244132
244132
  if (typeof optionsOrSettingsOrCallback === "function") {
244133
244133
  new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
244134
244134
  return;
244135
244135
  }
244136
244136
  new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
244137
244137
  }
244138
- exports.walk = walk;
244138
+ exports.walk = walk2;
244139
244139
  function walkSync(directory, optionsOrSettings) {
244140
244140
  const settings = getSettings(optionsOrSettings);
244141
244141
  const provider = new sync_1.default(directory, settings);
@@ -245665,13 +245665,13 @@ Justification: ${justification || "(none provided)"}`,
245665
245665
  }
245666
245666
  const snapshot = JSON.stringify(this.selfState, null, 2);
245667
245667
  try {
245668
- const { createHash: createHash10 } = await import("node:crypto");
245668
+ const { createHash: createHash11 } = await import("node:crypto");
245669
245669
  const snapshotDir = join23(this.cwd, ".oa", "identity", "snapshots");
245670
245670
  await mkdir6(snapshotDir, { recursive: true });
245671
245671
  const version4 = this.selfState.version;
245672
245672
  const snapshotPath = join23(snapshotDir, `v${version4}.json`);
245673
245673
  await writeFile11(snapshotPath, snapshot, "utf8");
245674
- const hash = createHash10("sha256").update(snapshot).digest("hex");
245674
+ const hash = createHash11("sha256").update(snapshot).digest("hex");
245675
245675
  await writeFile11(join23(this.cwd, ".oa", "identity", "latest-hash.txt"), hash, "utf8");
245676
245676
  let ipfsCid = "";
245677
245677
  try {
@@ -245804,8 +245804,8 @@ New: ${newNarrative.slice(0, 200)}...`,
245804
245804
  }
245805
245805
  // ── Helpers ──────────────────────────────────────────────────────────────
245806
245806
  createDefaultState() {
245807
- const { createHash: createHash10 } = __require("node:crypto");
245808
- const machineId = createHash10("sha256").update(this.cwd).digest("hex").slice(0, 12);
245807
+ const { createHash: createHash11 } = __require("node:crypto");
245808
+ const machineId = createHash11("sha256").update(this.cwd).digest("hex").slice(0, 12);
245809
245809
  return {
245810
245810
  self_id: `oa-${machineId}`,
245811
245811
  version: 1,
@@ -245887,9 +245887,9 @@ New: ${newNarrative.slice(0, 200)}...`,
245887
245887
  let cid;
245888
245888
  if (this.selfState.version > prevVersion) {
245889
245889
  try {
245890
- const { createHash: createHash10 } = await import("node:crypto");
245890
+ const { createHash: createHash11 } = await import("node:crypto");
245891
245891
  const stateJson = JSON.stringify(this.selfState);
245892
- const hash = createHash10("sha256").update(stateJson).digest("hex").slice(0, 32);
245892
+ const hash = createHash11("sha256").update(stateJson).digest("hex").slice(0, 32);
245893
245893
  const cidsPath = join23(this.cwd, ".oa", "identity", "cids.json");
245894
245894
  const cidsData = { latest: "", hash, version: this.selfState.version };
245895
245895
  try {
@@ -280714,7 +280714,7 @@ var require_websocket3 = __commonJS({
280714
280714
  var http6 = __require("http");
280715
280715
  var net5 = __require("net");
280716
280716
  var tls2 = __require("tls");
280717
- var { randomBytes: randomBytes23, createHash: createHash10 } = __require("crypto");
280717
+ var { randomBytes: randomBytes23, createHash: createHash11 } = __require("crypto");
280718
280718
  var { Duplex: Duplex3, Readable } = __require("stream");
280719
280719
  var { URL: URL3 } = __require("url");
280720
280720
  var PerMessageDeflate2 = require_permessage_deflate3();
@@ -281374,7 +281374,7 @@ var require_websocket3 = __commonJS({
281374
281374
  abortHandshake(websocket, socket, "Invalid Upgrade header");
281375
281375
  return;
281376
281376
  }
281377
- const digest3 = createHash10("sha1").update(key + GUID).digest("base64");
281377
+ const digest3 = createHash11("sha1").update(key + GUID).digest("base64");
281378
281378
  if (res.headers["sec-websocket-accept"] !== digest3) {
281379
281379
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
281380
281380
  return;
@@ -281741,7 +281741,7 @@ var require_websocket_server2 = __commonJS({
281741
281741
  var EventEmitter11 = __require("events");
281742
281742
  var http6 = __require("http");
281743
281743
  var { Duplex: Duplex3 } = __require("stream");
281744
- var { createHash: createHash10 } = __require("crypto");
281744
+ var { createHash: createHash11 } = __require("crypto");
281745
281745
  var extension2 = require_extension3();
281746
281746
  var PerMessageDeflate2 = require_permessage_deflate3();
281747
281747
  var subprotocol2 = require_subprotocol2();
@@ -282042,7 +282042,7 @@ var require_websocket_server2 = __commonJS({
282042
282042
  );
282043
282043
  }
282044
282044
  if (this._state > RUNNING) return abortHandshake(socket, 503);
282045
- const digest3 = createHash10("sha1").update(key + GUID).digest("base64");
282045
+ const digest3 = createHash11("sha1").update(key + GUID).digest("base64");
282046
282046
  const headers = [
282047
282047
  "HTTP/1.1 101 Switching Protocols",
282048
282048
  "Upgrade: websocket",
@@ -299192,6 +299192,54 @@ The session corrections MUST become hard rules in the SKILL.md Rules section.`;
299192
299192
  }
299193
299193
  return "handled";
299194
299194
  }
299195
+ case "scheduler": {
299196
+ const sub = (args[1] || "list").toLowerCase();
299197
+ const base3 = `http://127.0.0.1:${process.env["OA_PORT"] || "11435"}`;
299198
+ const doFetch = async (path5, init2) => {
299199
+ const url = base3 + path5;
299200
+ return await fetch(url, init2);
299201
+ };
299202
+ if (sub === "list") {
299203
+ try {
299204
+ const r2 = await doFetch("/v1/scheduled");
299205
+ const d2 = await r2.json();
299206
+ const tasks = Array.isArray(d2.tasks) ? d2.tasks : [];
299207
+ if (!tasks.length) {
299208
+ renderInfo2("No scheduled tasks found.");
299209
+ return "handled";
299210
+ }
299211
+ for (const t2 of tasks) {
299212
+ renderInfo2(`${t2.enabled ? "[on ]" : "[off]"} ${t2.id} ${t2.name || "(task)"} ${t2.schedule || ""}`);
299213
+ renderInfo2(` ${t2.file}#${t2.index}`);
299214
+ }
299215
+ } catch (e2) {
299216
+ renderError2(e2?.message || String(e2));
299217
+ }
299218
+ return "handled";
299219
+ }
299220
+ if ((sub === "enable" || sub === "disable") && args[2]) {
299221
+ const id = args[2];
299222
+ try {
299223
+ const r2 = await doFetch(`/v1/scheduled/${encodeURIComponent(id)}`, { method: "POST", body: JSON.stringify({ enabled: sub === "enable" }), headers: { "Content-Type": "application/json" } });
299224
+ if (r2.ok) renderInfo2(`${sub}d ${id}`);
299225
+ else renderWarning2(`Failed to ${sub} ${id}`);
299226
+ } catch (e2) {
299227
+ renderError2(e2?.message || String(e2));
299228
+ }
299229
+ return "handled";
299230
+ }
299231
+ if (sub === "kill") {
299232
+ try {
299233
+ await doFetch("/v1/scheduled/kill", { method: "POST", body: JSON.stringify({}), headers: { "Content-Type": "application/json" } });
299234
+ renderInfo2("Kill signal sent to OA scheduler processes.");
299235
+ } catch (e2) {
299236
+ renderError2(e2?.message || String(e2));
299237
+ }
299238
+ return "handled";
299239
+ }
299240
+ renderInfo2("Usage: /scheduler [list|enable <id>|disable <id>|kill]");
299241
+ return "handled";
299242
+ }
299195
299243
  case "listen":
299196
299244
  case "mic": {
299197
299245
  if (!ctx3.listenToggle) {
@@ -320291,6 +320339,7 @@ body {
320291
320339
  <div id="jobs-panel" style="display:none;flex:1;overflow-y:auto;padding:12px 16px">
320292
320340
  <div id="dashboard-health" style="display:flex;gap:12px;margin-bottom:16px;flex-wrap:wrap"></div>
320293
320341
  <div id="dashboard-daemons" style="margin-bottom:16px"></div>
320342
+ <div id="dashboard-scheduled" style="margin-bottom:16px"></div>
320294
320343
  <div id="dashboard-usage" style="margin-bottom:16px"></div>
320295
320344
  <h3 style="color:#b2920a;font-size:0.7rem;margin-bottom:8px">Job History</h3>
320296
320345
  <div id="jobs-list" style="font-size:0.78rem"></div>
@@ -321470,6 +321519,50 @@ async function loadDaemons() {
321470
321519
  } catch {}
321471
321520
  }
321472
321521
 
321522
+ // Scheduled jobs panel
321523
+ async function loadScheduled() {
321524
+ try {
321525
+ const r = await fetch('/v1/scheduled', { headers: headers() });
321526
+ const d = await r.json();
321527
+ const el = document.getElementById('dashboard-scheduled');
321528
+ if (!el) return;
321529
+ const tasks = Array.isArray(d.tasks) ? d.tasks : [];
321530
+ if (tasks.length === 0) {
321531
+ el.innerHTML = '<div style="background:#1e1e22;border:1px solid #2a2a30;border-radius:3px;padding:8px 12px;color:#555;font-size:0.7rem">No scheduled tasks found</div>';
321532
+ return;
321533
+ }
321534
+ const rows = tasks.map(t => {
321535
+ const enabled = !!t.enabled;
321536
+ const btn = enabled
321537
+ ? '<button onclick="toggleScheduled('' + t.id + '',false)" style="background:#2a2a30;border:1px solid #5a2a2a;color:#b25f5f;padding:2px 6px;border-radius:3px;font-size:0.65rem;cursor:pointer">disable</button>'
321538
+ : '<button onclick="toggleScheduled('' + t.id + '',true)" style="background:#2a2a30;border:1px solid #2a3a2a;color:#4ec94e;padding:2px 6px;border-radius:3px;font-size:0.65rem;cursor:pointer">enable</button>';
321539
+ const color = enabled ? '#4ec94e' : '#5a2a2a';
321540
+ const row = '<div style="background:#1e1e22;border-left:2px solid ' + color + ';padding:6px 10px;margin:4px 0;font-size:0.72rem">'
321541
+ + '<div style="color:#b0b0b0">' + (t.name || '(task)') + ' <span style="color:#555">' + (t.schedule || '') + '</span></div>'
321542
+ + '<div style="color:#555;font-size:0.6rem">' + t.file + '#' + t.index + '</div>'
321543
+ + '<div style="margin-top:4px">' + btn + '</div>'
321544
+ + '</div>';
321545
+ return row;
321546
+ }).join('');
321547
+ el.innerHTML = '<h3 style="color:#b2920a;font-size:0.7rem;margin-bottom:8px">Scheduled Tasks</h3>' + rows
321548
+ + '<div style="margin-top:6px"><button onclick="killScheduled()" title="Kill OA scheduler processes" style="background:#2a2a30;border:1px solid #5a2a2a;color:#b25f5f;padding:3px 8px;border-radius:3px;font-size:0.65rem;cursor:pointer">kill OA schedulers</button></div>';
321549
+ } catch {}
321550
+ }
321551
+
321552
+ (window as any).toggleScheduled = async function(id: string, enabled: boolean) {
321553
+ try {
321554
+ await fetch('/v1/scheduled/' + encodeURIComponent(id), { method:'POST', headers: headers(), body: JSON.stringify({enabled}) });
321555
+ loadScheduled();
321556
+ } catch {}
321557
+ }
321558
+
321559
+ (window as any).killScheduled = async function() {
321560
+ try {
321561
+ await fetch('/v1/scheduled/kill', { method:'POST', headers: headers(), body: JSON.stringify({}) });
321562
+ alert('Kill signal sent to OA scheduler processes');
321563
+ } catch {}
321564
+ }
321565
+
321473
321566
  // Agent task
321474
321567
  let currentRunId = null;
321475
321568
  async function loadProfiles() {
@@ -322599,6 +322692,7 @@ async function doUpdate() {
322599
322692
  try { loadModels(); } catch {}
322600
322693
  try { checkHealth(); } catch {}
322601
322694
  try { pollMetrics(); } catch {}
322695
+ try { loadScheduled(); } catch {}
322602
322696
 
322603
322697
  btn.textContent = 'updated v' + newVersion;
322604
322698
  btn.style.background = '#1a3a1a';
@@ -323232,6 +323326,7 @@ updateAgentRunSelect(); // WO-TASK-02 — populate agent runs dropdown
323232
323326
  restoreChatSession(); // WO-CHAT-RESUME — rehydrate from server state
323233
323327
  setInterval(checkHealth, 30000);
323234
323328
  setInterval(pollMetrics, 10000);
323329
+ setInterval(loadScheduled, 15000);
323235
323330
  setInterval(pollVersionBump, 5000);
323236
323331
  input.focus();
323237
323332
  </script>
@@ -324523,8 +324618,9 @@ import { fileURLToPath as fileURLToPath17 } from "node:url";
324523
324618
  import { dirname as dirname29, join as join99, resolve as resolve35 } from "node:path";
324524
324619
  import { homedir as homedir38 } from "node:os";
324525
324620
  import { spawn as spawn25, execSync as execSync55 } from "node:child_process";
324526
- import { mkdirSync as mkdirSync51, readFileSync as readFileSync65, readdirSync as readdirSync28, existsSync as existsSync83, watch as fsWatch3 } from "node:fs";
324621
+ import { mkdirSync as mkdirSync51, writeFileSync as writeFileSync45, readFileSync as readFileSync65, readdirSync as readdirSync28, existsSync as existsSync83, watch as fsWatch3 } from "node:fs";
324527
324622
  import { randomBytes as randomBytes21, randomUUID as randomUUID11 } from "node:crypto";
324623
+ import { createHash as createHash9 } from "node:crypto";
324528
324624
  function getVersion3() {
324529
324625
  try {
324530
324626
  const require3 = createRequire4(import.meta.url);
@@ -327269,6 +327365,31 @@ async function handleRequest(req2, res, ollamaUrl, verbose) {
327269
327365
  });
327270
327366
  return;
327271
327367
  }
327368
+ if (pathname === "/v1/scheduled" && method === "GET") {
327369
+ jsonResponse(res, 200, { tasks: listScheduledTasks() });
327370
+ return;
327371
+ }
327372
+ if (pathname?.startsWith("/v1/scheduled/") && method === "POST") {
327373
+ const parts = pathname.split("/");
327374
+ const id = parts[3] ?? "";
327375
+ const body = await parseJsonBody(req2);
327376
+ const enabled2 = typeof body?.enabled === "boolean" ? body.enabled : void 0;
327377
+ if (!id || typeof enabled2 === "undefined") {
327378
+ jsonResponse(res, 400, { error: "Missing id or enabled flag" });
327379
+ return;
327380
+ }
327381
+ const ok2 = setScheduledEnabled(id, enabled2);
327382
+ jsonResponse(res, ok2 ? 200 : 404, ok2 ? { id, enabled: enabled2 } : { error: "Not found" });
327383
+ return;
327384
+ }
327385
+ if (pathname === "/v1/scheduled/kill" && method === "POST") {
327386
+ const body = await parseJsonBody(req2);
327387
+ const pids = Array.isArray(body?.pids) ? body.pids.filter((n2) => Number.isInteger(n2)) : void 0;
327388
+ const pattern = typeof body?.pattern === "string" && body.pattern.trim() ? body.pattern.trim() : "(/bin/oa|open-agents-ai|nexus-daemon|OPEN-AGENTS-SCHEDULED)";
327389
+ const killed = killScheduledProcesses(pids, pattern);
327390
+ jsonResponse(res, 200, { killed_count: killed.length, killed });
327391
+ return;
327392
+ }
327272
327393
  if ((pathname === "/v1/chat" || pathname === "/api/chat") && method === "POST") {
327273
327394
  if (!checkAuth(req2, res, "run")) {
327274
327395
  status = 401;
@@ -328144,6 +328265,110 @@ ${steering}`;
328144
328265
  });
328145
328266
  }
328146
328267
  }
328268
+ function getScheduleRoots() {
328269
+ const rootsEnv = process.env["OA_SCHEDULE_ROOTS"] || "";
328270
+ const roots = rootsEnv.split(rootsEnv.includes(";") ? ";" : ":").filter(Boolean);
328271
+ const defaults3 = [process.cwd(), join99(homedir38(), "Documents")];
328272
+ const set = /* @__PURE__ */ new Set([...defaults3, ...roots]);
328273
+ return [...set];
328274
+ }
328275
+ function listScheduledTasks() {
328276
+ const results = [];
328277
+ const seen = /* @__PURE__ */ new Set();
328278
+ const roots = getScheduleRoots();
328279
+ const maxDepth = 6;
328280
+ for (const root of roots) {
328281
+ try {
328282
+ walk(root, 0, (dir) => {
328283
+ if (dir.endsWith(`${join99(".oa", "scheduled")}`) || dir.includes(`${join99(".oa", "scheduled")}`)) {
328284
+ const file = join99(dir, "tasks.json");
328285
+ try {
328286
+ const raw = readFileSync65(file, "utf-8");
328287
+ const json = JSON.parse(raw);
328288
+ const tasks = Array.isArray(json?.tasks) ? json.tasks : Array.isArray(json) ? json : [];
328289
+ tasks.forEach((t2, i2) => {
328290
+ const name11 = String(t2?.name || t2?.task || t2?.command || `task-${i2}`);
328291
+ const schedule = String(t2?.schedule || t2?.cron || t2?.when || "");
328292
+ const enabled2 = typeof t2?.enabled === "boolean" ? t2.enabled : true;
328293
+ const uid = createHash9("sha1").update(`${file}#${i2}`).digest("hex").slice(0, 16);
328294
+ const key = `${uid}`;
328295
+ if (seen.has(key)) return;
328296
+ seen.add(key);
328297
+ results.push({ id: uid, file, index: i2, name: name11, schedule, enabled: enabled2 });
328298
+ });
328299
+ } catch {
328300
+ }
328301
+ }
328302
+ }, maxDepth);
328303
+ } catch {
328304
+ }
328305
+ }
328306
+ return results;
328307
+ }
328308
+ function walk(dir, depth, onDir, maxDepth) {
328309
+ if (depth > maxDepth) return;
328310
+ onDir(dir);
328311
+ let entries = [];
328312
+ try {
328313
+ entries = readdirSync28(dir, { withFileTypes: true });
328314
+ } catch {
328315
+ return;
328316
+ }
328317
+ for (const e2 of entries) {
328318
+ if (!e2.isDirectory()) continue;
328319
+ if (e2.name === "node_modules" || e2.name.startsWith(".")) {
328320
+ if (e2.name !== ".oa") continue;
328321
+ }
328322
+ const child = join99(dir, e2.name);
328323
+ walk(child, depth + 1, onDir, maxDepth);
328324
+ }
328325
+ }
328326
+ function setScheduledEnabled(id, enabled2) {
328327
+ const tasks = listScheduledTasks();
328328
+ const target = tasks.find((t2) => t2.id === id);
328329
+ if (!target) return false;
328330
+ try {
328331
+ const raw = readFileSync65(target.file, "utf-8");
328332
+ const json = JSON.parse(raw);
328333
+ const arr = Array.isArray(json?.tasks) ? json.tasks : Array.isArray(json) ? json : [];
328334
+ if (!arr[target.index]) return false;
328335
+ arr[target.index].enabled = enabled2;
328336
+ if (Array.isArray(json?.tasks)) {
328337
+ json.tasks = arr;
328338
+ writeFileSync45(target.file, JSON.stringify(json, null, 2));
328339
+ } else if (Array.isArray(json)) {
328340
+ writeFileSync45(target.file, JSON.stringify(arr, null, 2));
328341
+ } else {
328342
+ writeFileSync45(target.file, JSON.stringify({ tasks: arr }, null, 2));
328343
+ }
328344
+ return true;
328345
+ } catch {
328346
+ return false;
328347
+ }
328348
+ }
328349
+ function killScheduledProcesses(pids, pattern) {
328350
+ const killed = [];
328351
+ try {
328352
+ const { execSync: es } = __require("node:child_process");
328353
+ if (pids && pids.length > 0) {
328354
+ for (const pid of pids) {
328355
+ try {
328356
+ process.kill(pid, "SIGTERM");
328357
+ killed.push({ pid, ok: true });
328358
+ } catch {
328359
+ killed.push({ pid, ok: false });
328360
+ }
328361
+ }
328362
+ } else {
328363
+ try {
328364
+ es(`pkill -f '${pattern.replace(/'/g, "'")}'`);
328365
+ } catch {
328366
+ }
328367
+ }
328368
+ } catch {
328369
+ }
328370
+ return killed;
328371
+ }
328147
328372
  function startApiServer(options2 = {}) {
328148
328373
  if (options2.quiet) setQuiet(true);
328149
328374
  const log22 = options2.quiet ? (_msg) => {
@@ -335281,13 +335506,13 @@ ${fullInput}`;
335281
335506
  writeContent(() => renderError2(errMsg));
335282
335507
  if (failureStore) {
335283
335508
  try {
335284
- const { createHash: createHash10 } = await import("node:crypto");
335509
+ const { createHash: createHash11 } = await import("node:crypto");
335285
335510
  failureStore.insert({
335286
335511
  taskId: "",
335287
335512
  sessionId: `${Date.now()}`,
335288
335513
  repoRoot,
335289
335514
  failureType: "runtime-error",
335290
- fingerprint: createHash10("sha256").update(errMsg.slice(0, 200)).digest("hex").slice(0, 16),
335515
+ fingerprint: createHash11("sha256").update(errMsg.slice(0, 200)).digest("hex").slice(0, 16),
335291
335516
  filePath: null,
335292
335517
  errorMessage: errMsg.slice(0, 500),
335293
335518
  context: null,
@@ -336140,7 +336365,7 @@ var init_run = __esm({
336140
336365
  import { glob as glob2 } from "glob";
336141
336366
  import ignore from "ignore";
336142
336367
  import { readFile as readFile23, stat as stat5 } from "node:fs/promises";
336143
- import { createHash as createHash9 } from "node:crypto";
336368
+ import { createHash as createHash10 } from "node:crypto";
336144
336369
  import { join as join102, relative as relative5, extname as extname12, basename as basename18 } from "node:path";
336145
336370
  var DEFAULT_EXCLUDE, LANGUAGE_MAP, CodebaseIndexer;
336146
336371
  var init_codebase_indexer = __esm({
@@ -336206,7 +336431,7 @@ var init_codebase_indexer = __esm({
336206
336431
  if (fileStat.size > this.config.maxFileSize)
336207
336432
  continue;
336208
336433
  const content = await readFile23(fullPath);
336209
- const hash = createHash9("sha256").update(content).digest("hex");
336434
+ const hash = createHash10("sha256").update(content).digest("hex");
336210
336435
  const ext = extname12(relativePath);
336211
336436
  indexed.push({
336212
336437
  path: fullPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.305",
3
+ "version": "0.187.306",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",