open-agents-ai 0.187.309 → 0.187.310
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 +66 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -299270,11 +299270,34 @@ The session corrections MUST become hard rules in the SKILL.md Rules section.`;
|
|
|
299270
299270
|
return "handled";
|
|
299271
299271
|
}
|
|
299272
299272
|
if ((sub === "enable" || sub === "disable") && tokens[1]) {
|
|
299273
|
-
const
|
|
299273
|
+
const target = tokens[1];
|
|
299274
|
+
if (target.toLowerCase() === "all") {
|
|
299275
|
+
try {
|
|
299276
|
+
const r2 = await doFetch("/v1/scheduled");
|
|
299277
|
+
const d2 = await r2.json();
|
|
299278
|
+
const tasks = Array.isArray(d2.tasks) ? d2.tasks : [];
|
|
299279
|
+
if (!tasks.length) {
|
|
299280
|
+
renderInfo2("No scheduled tasks found.");
|
|
299281
|
+
return "handled";
|
|
299282
|
+
}
|
|
299283
|
+
const want = sub === "enable";
|
|
299284
|
+
let changed = 0, failed = 0;
|
|
299285
|
+
for (const t2 of tasks) {
|
|
299286
|
+
if (!!t2.enabled === want) continue;
|
|
299287
|
+
const rr = await doFetch(`/v1/scheduled/${encodeURIComponent(t2.id)}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ enabled: want }) });
|
|
299288
|
+
if (rr.ok) changed++;
|
|
299289
|
+
else failed++;
|
|
299290
|
+
}
|
|
299291
|
+
renderInfo2(`${sub} all: ${changed} changed${failed ? `, ${failed} failed` : ""}.`);
|
|
299292
|
+
} catch (e2) {
|
|
299293
|
+
renderError2(e2?.message || String(e2));
|
|
299294
|
+
}
|
|
299295
|
+
return "handled";
|
|
299296
|
+
}
|
|
299274
299297
|
try {
|
|
299275
|
-
const r2 = await doFetch(`/v1/scheduled/${encodeURIComponent(
|
|
299276
|
-
if (r2.ok) renderInfo2(`${sub}d ${
|
|
299277
|
-
else renderWarning2(`Failed to ${sub} ${
|
|
299298
|
+
const r2 = await doFetch(`/v1/scheduled/${encodeURIComponent(target)}`, { method: "POST", body: JSON.stringify({ enabled: sub === "enable" }), headers: { "Content-Type": "application/json" } });
|
|
299299
|
+
if (r2.ok) renderInfo2(`${sub}d ${target}`);
|
|
299300
|
+
else renderWarning2(`Failed to ${sub} ${target}`);
|
|
299278
299301
|
} catch (e2) {
|
|
299279
299302
|
renderError2(e2?.message || String(e2));
|
|
299280
299303
|
}
|
|
@@ -321597,7 +321620,11 @@ async function loadScheduled() {
|
|
|
321597
321620
|
return row;
|
|
321598
321621
|
}).join('');
|
|
321599
321622
|
el.innerHTML = '<h3 style="color:#b2920a;font-size:0.7rem;margin-bottom:8px">Scheduled Tasks</h3>' + rows
|
|
321600
|
-
+ '<div style="margin-top:6px
|
|
321623
|
+
+ '<div style="margin-top:6px;display:flex;gap:8px">'
|
|
321624
|
+
+ '<button onclick="disableAllScheduled()" title="Disable all scheduled tasks" style="background:#2a2a30;border:1px solid #5a2a2a;color:#b25f5f;padding:3px 8px;border-radius:3px;font-size:0.65rem;cursor:pointer">disable all</button>'
|
|
321625
|
+
+ '<button onclick="enableAllScheduled()" title="Enable all scheduled tasks" style="background:#2a2a30;border:1px solid #2a3a2a;color:#4ec94e;padding:3px 8px;border-radius:3px;font-size:0.65rem;cursor:pointer">enable all</button>'
|
|
321626
|
+
+ '<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>'
|
|
321627
|
+
+ '</div>';
|
|
321601
321628
|
} catch {}
|
|
321602
321629
|
}
|
|
321603
321630
|
|
|
@@ -321615,6 +321642,40 @@ async function loadScheduled() {
|
|
|
321615
321642
|
} catch {}
|
|
321616
321643
|
}
|
|
321617
321644
|
|
|
321645
|
+
(window as any).disableAllScheduled = async function() {
|
|
321646
|
+
try {
|
|
321647
|
+
const r = await fetch('/v1/scheduled', { headers: headers() });
|
|
321648
|
+
const d = await r.json();
|
|
321649
|
+
const tasks = Array.isArray(d.tasks) ? d.tasks : [];
|
|
321650
|
+
let changed = 0;
|
|
321651
|
+
for (const t of tasks) {
|
|
321652
|
+
if (t.enabled) {
|
|
321653
|
+
const rr = await fetch('/v1/scheduled/' + encodeURIComponent(t.id), { method:'POST', headers: headers(), body: JSON.stringify({ enabled: false }) });
|
|
321654
|
+
if (rr.ok) changed++;
|
|
321655
|
+
}
|
|
321656
|
+
}
|
|
321657
|
+
alert('Disabled ' + changed + ' tasks');
|
|
321658
|
+
loadScheduled();
|
|
321659
|
+
} catch {}
|
|
321660
|
+
}
|
|
321661
|
+
|
|
321662
|
+
(window as any).enableAllScheduled = async function() {
|
|
321663
|
+
try {
|
|
321664
|
+
const r = await fetch('/v1/scheduled', { headers: headers() });
|
|
321665
|
+
const d = await r.json();
|
|
321666
|
+
const tasks = Array.isArray(d.tasks) ? d.tasks : [];
|
|
321667
|
+
let changed = 0;
|
|
321668
|
+
for (const t of tasks) {
|
|
321669
|
+
if (!t.enabled) {
|
|
321670
|
+
const rr = await fetch('/v1/scheduled/' + encodeURIComponent(t.id), { method:'POST', headers: headers(), body: JSON.stringify({ enabled: true }) });
|
|
321671
|
+
if (rr.ok) changed++;
|
|
321672
|
+
}
|
|
321673
|
+
}
|
|
321674
|
+
alert('Enabled ' + changed + ' tasks');
|
|
321675
|
+
loadScheduled();
|
|
321676
|
+
} catch {}
|
|
321677
|
+
}
|
|
321678
|
+
|
|
321618
321679
|
// Agent task
|
|
321619
321680
|
let currentRunId = null;
|
|
321620
321681
|
async function loadProfiles() {
|
package/package.json
CHANGED