opencode-supertask 0.1.11 → 0.1.13
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/cli/index.js +33 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/index.js +33 -7
- package/dist/gateway/index.js.map +1 -1
- package/dist/web/index.js +30 -5
- package/dist/web/index.js.map +1 -1
- package/dist/worker/index.d.ts +0 -1
- package/dist/worker/index.js +3 -2
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
package/dist/web/index.js
CHANGED
|
@@ -17052,8 +17052,7 @@ var DEFAULT_CONFIG = {
|
|
|
17052
17052
|
maxConcurrency: 2,
|
|
17053
17053
|
pollIntervalMs: 1e3,
|
|
17054
17054
|
heartbeatIntervalMs: 3e4,
|
|
17055
|
-
taskTimeoutMs: 18e5
|
|
17056
|
-
defaultModel: "zhipuai-coding-plan/glm-4.7"
|
|
17055
|
+
taskTimeoutMs: 18e5
|
|
17057
17056
|
},
|
|
17058
17057
|
scheduler: {
|
|
17059
17058
|
enabled: true,
|
|
@@ -17244,15 +17243,25 @@ async function deleteTmpl(id){if(!confirm('\u786E\u5B9A\u5220\u9664\u6B64\u6A21\
|
|
|
17244
17243
|
async function triggerTmpl(id){if(!confirm('\u7ACB\u5373\u89E6\u53D1\u4E00\u6B21?'))return;const r=await fetch('/api/templates/'+id+'/trigger',{method:'POST'});const d=await r.json();if(d.success){alert('\u5DF2\u521B\u5EFA\u4EFB\u52A1 #'+d.taskId);location.reload();}else{alert('\u89E6\u53D1\u5931\u8D25');}}
|
|
17245
17244
|
function toggleLog(id){const el=document.getElementById('log-'+id);el.style.display=el.style.display==='none'?'block':'none';}
|
|
17246
17245
|
|
|
17246
|
+
async function clearDatabase(){
|
|
17247
|
+
if(!confirm('\u786E\u5B9A\u6E05\u7A7A\u6240\u6709\u4EFB\u52A1\u6570\u636E\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\uFF01'))return;
|
|
17248
|
+
if(!confirm('\u518D\u6B21\u786E\u8BA4\uFF1A\u5C06\u5220\u9664\u6240\u6709\u4EFB\u52A1\u3001\u6267\u884C\u8BB0\u5F55\u548C\u8C03\u5EA6\u6A21\u677F\u3002'))return;
|
|
17249
|
+
try{
|
|
17250
|
+
const r=await fetch('/api/database/clear',{method:'POST'});
|
|
17251
|
+
const d=await r.json();
|
|
17252
|
+
if(d.success){alert('\u6570\u636E\u5E93\u5DF2\u6E05\u7A7A');location.reload();}
|
|
17253
|
+
else{alert('\u6E05\u7A7A\u5931\u8D25: '+d.error);}
|
|
17254
|
+
}catch(e){alert('\u6E05\u7A7A\u5931\u8D25: '+e.message);}
|
|
17255
|
+
}
|
|
17256
|
+
|
|
17247
17257
|
async function saveConfig(){
|
|
17248
17258
|
const form=document.getElementById('config-form');
|
|
17249
|
-
|
|
17259
|
+
const data={
|
|
17250
17260
|
worker:{
|
|
17251
17261
|
maxConcurrency:Number(form.mc.value),
|
|
17252
17262
|
pollIntervalMs:Number(form.pi.value),
|
|
17253
17263
|
heartbeatIntervalMs:Number(form.hi.value)*1000,
|
|
17254
17264
|
taskTimeoutMs:Number(form.to.value)*60000,
|
|
17255
|
-
defaultModel:form.dm.value,
|
|
17256
17265
|
},
|
|
17257
17266
|
scheduler:{
|
|
17258
17267
|
enabled:form.se.checked,
|
|
@@ -17508,7 +17517,6 @@ app.get("/system", async (c) => {
|
|
|
17508
17517
|
<div class="form-row"><label>\u8F6E\u8BE2\u95F4\u9694(ms)</label><input type="number" name="pi" value="${config.worker.pollIntervalMs}" min="100" style="width:100px"></div>
|
|
17509
17518
|
<div class="form-row"><label>\u5FC3\u8DF3\u95F4\u9694(\u79D2)</label><input type="number" name="hi" value="${config.worker.heartbeatIntervalMs / 1e3}" min="5" style="width:100px"></div>
|
|
17510
17519
|
<div class="form-row"><label>\u4EFB\u52A1\u8D85\u65F6(\u5206\u949F)</label><input type="number" name="to" value="${config.worker.taskTimeoutMs / 6e4}" min="1" style="width:100px"></div>
|
|
17511
|
-
<div class="form-row"><label>\u9ED8\u8BA4\u6A21\u578B</label><input type="text" name="dm" value="${config.worker.defaultModel}" style="width:260px"></div>
|
|
17512
17520
|
</div>
|
|
17513
17521
|
<div class="card">
|
|
17514
17522
|
<h3 style="margin:0 0 12px;font-size:14px">Scheduler \u914D\u7F6E</h3>
|
|
@@ -17557,6 +17565,12 @@ app.get("/system", async (c) => {
|
|
|
17557
17565
|
<h3 style="margin:0 0 12px;font-size:14px">\u914D\u7F6E\u6587\u4EF6</h3>
|
|
17558
17566
|
<div class="ir"><span class="ik">\u8DEF\u5F84</span><span class="iv m sm">${CONFIG_PATH}</span></div>
|
|
17559
17567
|
<div class="ir"><span class="ik">\u6587\u4EF6\u5B58\u5728</span><span class="iv">${configFileStatus}</span></div>
|
|
17568
|
+
</div>
|
|
17569
|
+
|
|
17570
|
+
<div class="card mt16" style="border-color:var(--red)">
|
|
17571
|
+
<h3 style="margin:0 0 12px;font-size:14px;color:var(--red)">\u5371\u9669\u64CD\u4F5C</h3>
|
|
17572
|
+
<p class="sm mu" style="margin:0 0 12px">\u6E05\u7A7A\u6240\u6709\u4EFB\u52A1\u6570\u636E\uFF08tasks + task_runs + task_templates\uFF09\uFF0C\u4E0D\u53EF\u6062\u590D\u3002</p>
|
|
17573
|
+
<button class="btn btn-danger" style="border-color:var(--red);color:var(--red);padding:6px 16px" onclick="clearDatabase()">\u6E05\u7A7A\u6570\u636E\u5E93</button>
|
|
17560
17574
|
</div>`;
|
|
17561
17575
|
return c.html(renderLayout("\u7CFB\u7EDF\u72B6\u6001", "system", body));
|
|
17562
17576
|
});
|
|
@@ -17628,6 +17642,17 @@ app.put("/api/config", async (c) => {
|
|
|
17628
17642
|
return c.json({ success: false, error: err instanceof Error ? err.message : String(err) });
|
|
17629
17643
|
}
|
|
17630
17644
|
});
|
|
17645
|
+
app.post("/api/database/clear", async (c) => {
|
|
17646
|
+
try {
|
|
17647
|
+
const { tasks: tasks3, taskRuns: taskRuns3, taskTemplates: taskTemplates3 } = schema_exports;
|
|
17648
|
+
await db.delete(taskRuns3);
|
|
17649
|
+
await db.delete(taskTemplates3);
|
|
17650
|
+
await db.delete(tasks3);
|
|
17651
|
+
return c.json({ success: true });
|
|
17652
|
+
} catch (err) {
|
|
17653
|
+
return c.json({ success: false, error: err instanceof Error ? err.message : String(err) });
|
|
17654
|
+
}
|
|
17655
|
+
});
|
|
17631
17656
|
var dashboardApp = app;
|
|
17632
17657
|
var web_default = {
|
|
17633
17658
|
port: 4680,
|