@auto-ai/agent 2.1.132 → 2.1.138
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/404/index.html +1 -1
- package/dist/404.html +1 -1
- package/dist/_next/static/chunks/0ce6504fc10ce408.js +1 -0
- package/dist/_next/static/chunks/0fa3b1f693a23b15.js +1 -0
- package/dist/_next/static/chunks/{b99d7c931432a00e.js → 106955e3cc6a6843.js} +1 -1
- package/dist/_next/static/chunks/14e9e2677e576a10.js +1 -0
- package/dist/_next/static/chunks/1c9321874fea5f0d.js +1 -0
- package/dist/_next/static/chunks/21d1bfb869271a9f.js +1 -0
- package/dist/_next/static/chunks/{c5af60c028e52cf8.js → 270d7571d2eea071.js} +1 -1
- package/dist/_next/static/chunks/2c10ed308692c3a0.js +1 -0
- package/dist/_next/static/chunks/2df3e464b6247e75.js +1 -0
- package/dist/_next/static/chunks/32b9bdd82a961878.js +1 -0
- package/dist/_next/static/chunks/35dbce6fecd1f0ea.css +1 -0
- package/dist/_next/static/chunks/371449b804c846f7.js +1 -0
- package/dist/_next/static/chunks/38b035f49fa68570.js +1 -0
- package/dist/_next/static/chunks/{9aea16dd9db3a8bd.js → 3dcb1dcf23e7ab9c.js} +1 -1
- package/dist/_next/static/chunks/{59baceab6698f9f7.js → 4d129d4e15c8c424.js} +1 -1
- package/dist/_next/static/chunks/4daa80520fa470d9.js +1 -0
- package/dist/_next/static/chunks/5bad5163b6e015f5.js +1 -0
- package/dist/_next/static/chunks/{6c49d19eb7e88b9c.js → 5d79b7f202080232.js} +1 -1
- package/dist/_next/static/chunks/{cbb200599eb3e6d0.js → 63ec034afca4b5d6.js} +1 -1
- package/dist/_next/static/chunks/68142a0bc2fa2b35.js +1 -0
- package/dist/_next/static/chunks/688707d29c1b22a8.js +1 -0
- package/dist/_next/static/chunks/690434349e97572c.js +1 -0
- package/dist/_next/static/chunks/6d1c0d0ee56899fb.js +1 -0
- package/dist/_next/static/chunks/6e61f670898cb297.css +1 -0
- package/dist/_next/static/chunks/6f4460bd0b8a57af.js +1 -0
- package/dist/_next/static/chunks/{fa361913d47fdc14.css → 7bdf0e5b41aeb209.css} +0 -3
- package/dist/_next/static/chunks/{314d4f64173e0e4f.js → 87e12ecbe9521f9b.js} +1 -1
- package/dist/_next/static/chunks/{93102efda2769ba5.js → 8f5be275907dd98c.js} +1 -1
- package/dist/_next/static/chunks/{83e39d76d6f07968.js → 94029062f236cadc.js} +1 -1
- package/dist/_next/static/chunks/9518ddfa15493676.js +1 -0
- package/dist/_next/static/chunks/a6737fc58619eae5.js +1 -0
- package/dist/_next/static/chunks/a7d1ae46740fe1db.js +1 -0
- package/dist/_next/static/chunks/{b929fc868619ccb9.js → b30f1da4e57f459a.js} +1 -1
- package/dist/_next/static/chunks/b3272f80bcfc5de5.js +1 -0
- package/dist/_next/static/chunks/bbcf9daa108b22fb.js +1 -0
- package/dist/_next/static/chunks/bf2c1c402dbcccdf.js +1 -0
- package/dist/_next/static/chunks/bfc6ee42cec583d5.js +1 -0
- package/dist/_next/static/chunks/c933951b3113492f.js +1 -0
- package/dist/_next/static/chunks/{aadf128359998a2d.js → cd5eec7d305aa041.js} +1 -1
- package/dist/_next/static/chunks/cfe5b3f488f0424e.js +1 -0
- package/dist/_next/static/chunks/d2d432a9facf4278.js +1 -0
- package/dist/_next/static/chunks/d43dd46799168929.js +1 -0
- package/dist/_next/static/chunks/d4fd1b2f761be57f.css +7 -0
- package/dist/_next/static/chunks/d5e3d29f769997cc.js +1 -0
- package/dist/_next/static/chunks/e0e34f74c79fccad.js +1 -0
- package/dist/_next/static/chunks/e7bcbeb465fa49cf.js +1 -0
- package/dist/_next/static/chunks/f430e6f74ab444e1.js +1 -0
- package/dist/_next/static/chunks/f88c07614ca15868.js +1 -0
- package/dist/index.html +2 -2
- package/dist/index.txt +21 -21
- package/dist/manage/about/index.html +2 -2
- package/dist/manage/about/index.txt +23 -22
- package/dist/manage/env/index.html +2 -2
- package/dist/manage/env/index.txt +25 -24
- package/dist/manage/general/index.html +2 -2
- package/dist/manage/general/index.txt +23 -22
- package/dist/manage/index.html +2 -2
- package/dist/manage/index.txt +20 -19
- package/dist/manage/mcp/index.html +2 -2
- package/dist/manage/mcp/index.txt +22 -21
- package/dist/manage/permissions/index.html +2 -2
- package/dist/manage/permissions/index.txt +23 -22
- package/dist/manage/skills/index.html +2 -2
- package/dist/manage/skills/index.txt +22 -21
- package/dist/manage/task/index.html +2 -2
- package/dist/manage/task/index.txt +22 -21
- package/dist/manage/teams/index.html +2 -2
- package/dist/manage/teams/index.txt +22 -21
- package/dist/manage/tools/index.html +2 -2
- package/dist/manage/tools/index.txt +22 -21
- package/dist/ws-test.html +373 -53
- package/package.json +6 -6
- package/.env.example +0 -7
- package/dist/_next/static/chunks/0bb72b120dc81a85.js +0 -1
- package/dist/_next/static/chunks/0eeaf05fe8e92617.js +0 -1
- package/dist/_next/static/chunks/14114800ef3e692e.js +0 -1
- package/dist/_next/static/chunks/1d51ed7830318474.js +0 -1
- package/dist/_next/static/chunks/1ffb3acecdbda566.js +0 -1
- package/dist/_next/static/chunks/22d483db0dece6fa.js +0 -1
- package/dist/_next/static/chunks/289e2d5005a099d3.js +0 -1
- package/dist/_next/static/chunks/292d0b687a419387.js +0 -1
- package/dist/_next/static/chunks/2bbdc3c6bbaac93f.js +0 -1
- package/dist/_next/static/chunks/376aaeae24164c1a.js +0 -1
- package/dist/_next/static/chunks/39fed6244d398269.js +0 -1
- package/dist/_next/static/chunks/48bc54794d1c3561.js +0 -1
- package/dist/_next/static/chunks/5534f66638e5a2e8.js +0 -1
- package/dist/_next/static/chunks/5817c66b26ce8538.css +0 -1
- package/dist/_next/static/chunks/5d5fe2c255f43fec.js +0 -1
- package/dist/_next/static/chunks/67bb401596b3c723.js +0 -1
- package/dist/_next/static/chunks/7de1ab3b78f48430.js +0 -1
- package/dist/_next/static/chunks/98a41a7efbe71682.js +0 -1
- package/dist/_next/static/chunks/9e2cffe3c17fd0e7.js +0 -1
- package/dist/_next/static/chunks/a79654d570ac30eb.js +0 -1
- package/dist/_next/static/chunks/a8e06ee8243e3389.js +0 -1
- package/dist/_next/static/chunks/ad419be63e291696.js +0 -1
- package/dist/_next/static/chunks/bcefc2c679f3ada6.js +0 -1
- package/dist/_next/static/chunks/c1cfc60c17638a73.js +0 -1
- package/dist/_next/static/chunks/c26f95ab8ad3dcf0.js +0 -1
- package/dist/_next/static/chunks/cb4dec27441d471a.js +0 -1
- package/dist/_next/static/chunks/d3af8988bf25a7de.js +0 -1
- package/dist/_next/static/chunks/d3ccfb3dcef5974f.js +0 -1
- package/dist/_next/static/chunks/d504c4e2ebc5319a.js +0 -1
- package/dist/_next/static/chunks/e2833182a81cd867.js +0 -1
- package/dist/_next/static/chunks/e520aa06a5014225.js +0 -1
- package/dist/_next/static/chunks/e7bd145455a541af.css +0 -4
- package/dist/_next/static/chunks/eae304701469d3a8.js +0 -1
- package/dist/_next/static/chunks/eba0719a42605421.js +0 -1
- package/dist/_next/static/chunks/f2a87f0c7c1ec9f4.js +0 -1
- package/dist/_next/static/chunks/faaf4e0c2d5cffda.js +0 -1
- package/dist/_next/static/chunks/fc4be3bcf72559a0.js +0 -1
- package/dist/manage/add-account/basic/index.html +0 -2
- package/dist/manage/add-account/basic/index.txt +0 -38
- package/dist/manage/add-account/index.html +0 -2
- package/dist/manage/add-account/index.txt +0 -36
- /package/dist/_next/static/{WYrSrJ9dye9qgdGCYVOpA → Y_Dm3_WktIgcGlMTlKsrp}/_buildManifest.js +0 -0
- /package/dist/_next/static/{WYrSrJ9dye9qgdGCYVOpA → Y_Dm3_WktIgcGlMTlKsrp}/_clientMiddlewareManifest.json +0 -0
- /package/dist/_next/static/{WYrSrJ9dye9qgdGCYVOpA → Y_Dm3_WktIgcGlMTlKsrp}/_ssgManifest.js +0 -0
package/dist/ws-test.html
CHANGED
|
@@ -675,6 +675,33 @@
|
|
|
675
675
|
align-items: center;
|
|
676
676
|
margin-bottom: 0.65rem;
|
|
677
677
|
}
|
|
678
|
+
.schedule-run-status--pending {
|
|
679
|
+
color: var(--ds-text-soft);
|
|
680
|
+
}
|
|
681
|
+
.schedule-run-status--running {
|
|
682
|
+
color: var(--ds-accent);
|
|
683
|
+
}
|
|
684
|
+
.schedule-run-status--succeeded {
|
|
685
|
+
color: #0d7a3a;
|
|
686
|
+
}
|
|
687
|
+
.schedule-run-status--failed {
|
|
688
|
+
color: #c0392b;
|
|
689
|
+
}
|
|
690
|
+
.schedule-runs-result-pre {
|
|
691
|
+
margin-top: 0.75rem;
|
|
692
|
+
padding: 0.65rem;
|
|
693
|
+
max-height: 200px;
|
|
694
|
+
overflow: auto;
|
|
695
|
+
border: 1px solid var(--ds-border);
|
|
696
|
+
border-radius: var(--ds-radius-sm);
|
|
697
|
+
background: #f8fafc;
|
|
698
|
+
font-size: 0.75rem;
|
|
699
|
+
white-space: pre-wrap;
|
|
700
|
+
word-break: break-word;
|
|
701
|
+
}
|
|
702
|
+
.schedule-runs-result-pre[hidden] {
|
|
703
|
+
display: none !important;
|
|
704
|
+
}
|
|
678
705
|
.schedule-manage-empty {
|
|
679
706
|
padding: 1rem;
|
|
680
707
|
text-align: center;
|
|
@@ -3231,8 +3258,8 @@
|
|
|
3231
3258
|
</div>
|
|
3232
3259
|
<div id="scheduleCreateForm" class="schedule-create-form" hidden>
|
|
3233
3260
|
<div class="schedule-create-row">
|
|
3234
|
-
<label for="
|
|
3235
|
-
<
|
|
3261
|
+
<label for="scheduleTaskNameInput">任务名称</label>
|
|
3262
|
+
<input id="scheduleTaskNameInput" type="text" maxlength="120" placeholder="例如:每日巡检" spellcheck="false" />
|
|
3236
3263
|
</div>
|
|
3237
3264
|
<div class="schedule-create-row">
|
|
3238
3265
|
<label for="schedulePromptInput">Prompt</label>
|
|
@@ -3264,11 +3291,12 @@
|
|
|
3264
3291
|
<thead>
|
|
3265
3292
|
<tr>
|
|
3266
3293
|
<th>ID</th>
|
|
3267
|
-
<th
|
|
3294
|
+
<th>任务名称</th>
|
|
3268
3295
|
<th>Cron</th>
|
|
3269
3296
|
<th>下次执行</th>
|
|
3270
3297
|
<th>Prompt</th>
|
|
3271
3298
|
<th>类型</th>
|
|
3299
|
+
<th>状态</th>
|
|
3272
3300
|
<th>操作</th>
|
|
3273
3301
|
</tr>
|
|
3274
3302
|
</thead>
|
|
@@ -3280,6 +3308,44 @@
|
|
|
3280
3308
|
</div>
|
|
3281
3309
|
</div>
|
|
3282
3310
|
|
|
3311
|
+
<div id="scheduleRunsModal" class="agent-md-modal" aria-hidden="true">
|
|
3312
|
+
<div class="agent-md-modal-backdrop" id="scheduleRunsModalBackdrop"></div>
|
|
3313
|
+
<div id="scheduleRunsModalCard" class="agent-md-modal-card modal-unified" role="dialog" aria-modal="true" aria-labelledby="scheduleRunsModalTitle">
|
|
3314
|
+
<div class="agent-md-modal-head">
|
|
3315
|
+
<h2 id="scheduleRunsModalTitle">执行记录</h2>
|
|
3316
|
+
<div class="modal-head-actions modal-head-actions--close-only">
|
|
3317
|
+
<button type="button" class="agent-md-modal-close" id="btnScheduleRunsModalClose" aria-label="关闭">
|
|
3318
|
+
×
|
|
3319
|
+
</button>
|
|
3320
|
+
</div>
|
|
3321
|
+
</div>
|
|
3322
|
+
<div class="tool-files-body">
|
|
3323
|
+
<p id="scheduleRunsMeta" class="tool-files-meta" style="margin: 0 0 0.5rem"></p>
|
|
3324
|
+
<div class="schedule-manage-toolbar">
|
|
3325
|
+
<button type="button" class="btn-system-settings" id="btnScheduleRunsRefresh">刷新</button>
|
|
3326
|
+
</div>
|
|
3327
|
+
<div class="schedule-manage-table-wrap">
|
|
3328
|
+
<table class="schedule-manage-table">
|
|
3329
|
+
<thead>
|
|
3330
|
+
<tr>
|
|
3331
|
+
<th>Run ID</th>
|
|
3332
|
+
<th>创建时间</th>
|
|
3333
|
+
<th>触发</th>
|
|
3334
|
+
<th>状态</th>
|
|
3335
|
+
<th>耗时</th>
|
|
3336
|
+
<th>结果摘要</th>
|
|
3337
|
+
<th>操作</th>
|
|
3338
|
+
</tr>
|
|
3339
|
+
</thead>
|
|
3340
|
+
<tbody id="scheduleRunsTableBody"></tbody>
|
|
3341
|
+
</table>
|
|
3342
|
+
<div id="scheduleRunsEmpty" class="schedule-manage-empty" hidden>暂无执行记录</div>
|
|
3343
|
+
</div>
|
|
3344
|
+
<pre id="scheduleRunResultPre" class="schedule-runs-result-pre" hidden></pre>
|
|
3345
|
+
</div>
|
|
3346
|
+
</div>
|
|
3347
|
+
</div>
|
|
3348
|
+
|
|
3283
3349
|
</div>
|
|
3284
3350
|
|
|
3285
3351
|
<div id="sidebarHoverTip" class="sidebar-hover-tip" role="tooltip" hidden></div>
|
|
@@ -3404,13 +3470,22 @@
|
|
|
3404
3470
|
const btnScheduleRefresh = $('btnScheduleRefresh')
|
|
3405
3471
|
const btnScheduleCreateToggle = $('btnScheduleCreateToggle')
|
|
3406
3472
|
const scheduleCreateForm = $('scheduleCreateForm')
|
|
3407
|
-
const
|
|
3473
|
+
const scheduleTaskNameInput = $('scheduleTaskNameInput')
|
|
3408
3474
|
const schedulePromptInput = $('schedulePromptInput')
|
|
3409
3475
|
const scheduleDelayMinutesInput = $('scheduleDelayMinutesInput')
|
|
3410
3476
|
const scheduleCronInput = $('scheduleCronInput')
|
|
3411
3477
|
const scheduleRecurringInput = $('scheduleRecurringInput')
|
|
3412
3478
|
const scheduleDelayRow = $('scheduleDelayRow')
|
|
3413
3479
|
const scheduleCronRow = $('scheduleCronRow')
|
|
3480
|
+
const scheduleRunsModal = $('scheduleRunsModal')
|
|
3481
|
+
const scheduleRunsModalBackdrop = $('scheduleRunsModalBackdrop')
|
|
3482
|
+
const scheduleRunsModalTitle = $('scheduleRunsModalTitle')
|
|
3483
|
+
const scheduleRunsMeta = $('scheduleRunsMeta')
|
|
3484
|
+
const scheduleRunsTableBody = $('scheduleRunsTableBody')
|
|
3485
|
+
const scheduleRunsEmpty = $('scheduleRunsEmpty')
|
|
3486
|
+
const scheduleRunResultPre = $('scheduleRunResultPre')
|
|
3487
|
+
let scheduleRunsViewTaskId = null
|
|
3488
|
+
let scheduleRunsViewTaskName = ''
|
|
3414
3489
|
const btnScheduleCreateCancel = $('btnScheduleCreateCancel')
|
|
3415
3490
|
const btnScheduleCreateSubmit = $('btnScheduleCreateSubmit')
|
|
3416
3491
|
const btnManageAgents = $('btnManageAgents')
|
|
@@ -5287,21 +5362,6 @@
|
|
|
5287
5362
|
return u.toString()
|
|
5288
5363
|
}
|
|
5289
5364
|
|
|
5290
|
-
/** 从已加载 session 列表解析会话标题 */
|
|
5291
|
-
function scheduleSessionLabel(sessionId) {
|
|
5292
|
-
const sid = String(sessionId || '')
|
|
5293
|
-
const sessions = window.__lastSessions
|
|
5294
|
-
if (Array.isArray(sessions)) {
|
|
5295
|
-
for (let i = 0; i < sessions.length; i++) {
|
|
5296
|
-
const s = sessions[i]
|
|
5297
|
-
if (s && s.sessionId === sid) {
|
|
5298
|
-
return sessionTitle(s)
|
|
5299
|
-
}
|
|
5300
|
-
}
|
|
5301
|
-
}
|
|
5302
|
-
return sid.slice(0, 8) + '…'
|
|
5303
|
-
}
|
|
5304
|
-
|
|
5305
5365
|
function formatScheduleFireAt(ms) {
|
|
5306
5366
|
if (typeof ms !== 'number' || !Number.isFinite(ms)) return '—'
|
|
5307
5367
|
try {
|
|
@@ -5311,28 +5371,16 @@
|
|
|
5311
5371
|
}
|
|
5312
5372
|
}
|
|
5313
5373
|
|
|
5314
|
-
/**
|
|
5315
|
-
function
|
|
5316
|
-
if (
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
opt.value = currentSid
|
|
5323
|
-
opt.textContent = currentSid ? currentSid.slice(0, 8) + '…' : '(当前会话)'
|
|
5324
|
-
scheduleSessionSelect.appendChild(opt)
|
|
5325
|
-
return
|
|
5326
|
-
}
|
|
5327
|
-
for (let i = 0; i < sessions.length; i++) {
|
|
5328
|
-
const s = sessions[i]
|
|
5329
|
-
if (!s || !s.sessionId) continue
|
|
5330
|
-
const opt = document.createElement('option')
|
|
5331
|
-
opt.value = s.sessionId
|
|
5332
|
-
opt.textContent = sessionTitle(s) + ' (' + s.sessionId.slice(0, 8) + '…)'
|
|
5333
|
-
if (s.sessionId === currentSid) opt.selected = true
|
|
5334
|
-
scheduleSessionSelect.appendChild(opt)
|
|
5374
|
+
/** 列表「下次执行」:一次性已跑完显示已执行 */
|
|
5375
|
+
function formatScheduleNextFireCell(task) {
|
|
5376
|
+
if (
|
|
5377
|
+
!task.recurring &&
|
|
5378
|
+
task.lastFiredAt != null &&
|
|
5379
|
+
(task.nextFireAt == null || !Number.isFinite(task.nextFireAt))
|
|
5380
|
+
) {
|
|
5381
|
+
return '已执行'
|
|
5335
5382
|
}
|
|
5383
|
+
return formatScheduleFireAt(task.nextFireAt)
|
|
5336
5384
|
}
|
|
5337
5385
|
|
|
5338
5386
|
/** 渲染定时任务表格 */
|
|
@@ -5351,7 +5399,7 @@
|
|
|
5351
5399
|
const sessionBtn = document.createElement('button')
|
|
5352
5400
|
sessionBtn.type = 'button'
|
|
5353
5401
|
sessionBtn.className = 'schedule-manage-session-link'
|
|
5354
|
-
sessionBtn.textContent =
|
|
5402
|
+
sessionBtn.textContent = task.taskName || task.id || task.sessionId.slice(0, 8) + '…'
|
|
5355
5403
|
sessionBtn.title = task.sessionId
|
|
5356
5404
|
sessionBtn.addEventListener('click', function () {
|
|
5357
5405
|
closeScheduleManageModal()
|
|
@@ -5361,13 +5409,37 @@
|
|
|
5361
5409
|
const tdCron = document.createElement('td')
|
|
5362
5410
|
tdCron.textContent = task.cron || '—'
|
|
5363
5411
|
const tdNext = document.createElement('td')
|
|
5364
|
-
tdNext.textContent =
|
|
5412
|
+
tdNext.textContent = formatScheduleNextFireCell(task)
|
|
5365
5413
|
const tdPrompt = document.createElement('td')
|
|
5366
5414
|
tdPrompt.className = 'schedule-manage-prompt'
|
|
5367
5415
|
tdPrompt.textContent = task.prompt || ''
|
|
5368
5416
|
const tdType = document.createElement('td')
|
|
5369
5417
|
tdType.textContent = task.recurring ? '循环' : '一次性'
|
|
5418
|
+
const tdEnabled = document.createElement('td')
|
|
5419
|
+
const isEnabled = task.enabled !== false
|
|
5420
|
+
tdEnabled.textContent = isEnabled ? '启用中' : '已禁用'
|
|
5370
5421
|
const tdAction = document.createElement('td')
|
|
5422
|
+
const runsBtn = document.createElement('button')
|
|
5423
|
+
runsBtn.type = 'button'
|
|
5424
|
+
runsBtn.className = 'btn-system-settings'
|
|
5425
|
+
runsBtn.textContent = '执行记录'
|
|
5426
|
+
runsBtn.addEventListener('click', function () {
|
|
5427
|
+
void openScheduleRunsModal(task.id, task.taskName || task.id)
|
|
5428
|
+
})
|
|
5429
|
+
const runBtn = document.createElement('button')
|
|
5430
|
+
runBtn.type = 'button'
|
|
5431
|
+
runBtn.className = 'btn-system-settings'
|
|
5432
|
+
runBtn.textContent = '立即执行'
|
|
5433
|
+
runBtn.addEventListener('click', function () {
|
|
5434
|
+
void runScheduleTaskNow(task.id)
|
|
5435
|
+
})
|
|
5436
|
+
const toggleBtn = document.createElement('button')
|
|
5437
|
+
toggleBtn.type = 'button'
|
|
5438
|
+
toggleBtn.className = 'btn-system-settings'
|
|
5439
|
+
toggleBtn.textContent = isEnabled ? '禁用' : '启用'
|
|
5440
|
+
toggleBtn.addEventListener('click', function () {
|
|
5441
|
+
void patchScheduleTaskEnabled(task.id, !isEnabled)
|
|
5442
|
+
})
|
|
5371
5443
|
const delBtn = document.createElement('button')
|
|
5372
5444
|
delBtn.type = 'button'
|
|
5373
5445
|
delBtn.className = 'btn-system-settings'
|
|
@@ -5375,6 +5447,9 @@
|
|
|
5375
5447
|
delBtn.addEventListener('click', function () {
|
|
5376
5448
|
void deleteScheduleTask(task.id)
|
|
5377
5449
|
})
|
|
5450
|
+
tdAction.appendChild(runsBtn)
|
|
5451
|
+
tdAction.appendChild(runBtn)
|
|
5452
|
+
tdAction.appendChild(toggleBtn)
|
|
5378
5453
|
tdAction.appendChild(delBtn)
|
|
5379
5454
|
tr.appendChild(tdId)
|
|
5380
5455
|
tr.appendChild(tdSession)
|
|
@@ -5382,6 +5457,7 @@
|
|
|
5382
5457
|
tr.appendChild(tdNext)
|
|
5383
5458
|
tr.appendChild(tdPrompt)
|
|
5384
5459
|
tr.appendChild(tdType)
|
|
5460
|
+
tr.appendChild(tdEnabled)
|
|
5385
5461
|
tr.appendChild(tdAction)
|
|
5386
5462
|
scheduleTaskTableBody.appendChild(tr)
|
|
5387
5463
|
}
|
|
@@ -5404,11 +5480,11 @@
|
|
|
5404
5480
|
|
|
5405
5481
|
/** 创建定时任务 */
|
|
5406
5482
|
async function createScheduleTask() {
|
|
5407
|
-
if (!
|
|
5408
|
-
const
|
|
5483
|
+
if (!scheduleTaskNameInput || !schedulePromptInput) return
|
|
5484
|
+
const taskName = scheduleTaskNameInput.value.trim()
|
|
5409
5485
|
const prompt = schedulePromptInput.value.trim()
|
|
5410
|
-
if (!
|
|
5411
|
-
window.alert('
|
|
5486
|
+
if (!taskName) {
|
|
5487
|
+
window.alert('请填写任务名称')
|
|
5412
5488
|
return
|
|
5413
5489
|
}
|
|
5414
5490
|
if (!prompt) {
|
|
@@ -5418,7 +5494,7 @@
|
|
|
5418
5494
|
const modeEl = document.querySelector('input[name="scheduleTriggerMode"]:checked')
|
|
5419
5495
|
const mode = modeEl ? modeEl.value : 'delay'
|
|
5420
5496
|
const payload = {
|
|
5421
|
-
|
|
5497
|
+
taskName: taskName,
|
|
5422
5498
|
prompt: prompt,
|
|
5423
5499
|
recurring: !!(scheduleRecurringInput && scheduleRecurringInput.checked),
|
|
5424
5500
|
}
|
|
@@ -5449,10 +5525,237 @@
|
|
|
5449
5525
|
throw new Error(body.message || body.error || res.statusText)
|
|
5450
5526
|
}
|
|
5451
5527
|
if (scheduleCreateForm) scheduleCreateForm.hidden = true
|
|
5528
|
+
if (scheduleTaskNameInput) scheduleTaskNameInput.value = ''
|
|
5452
5529
|
if (schedulePromptInput) schedulePromptInput.value = ''
|
|
5453
5530
|
await loadScheduleTasks()
|
|
5454
5531
|
}
|
|
5455
5532
|
|
|
5533
|
+
function buildScheduleRunUrl(id) {
|
|
5534
|
+
const u = new URL('/api/schedules/run', httpOriginForApi() + '/')
|
|
5535
|
+
u.searchParams.set('agent', currentAgentParam())
|
|
5536
|
+
u.searchParams.set('id', id)
|
|
5537
|
+
return u.toString()
|
|
5538
|
+
}
|
|
5539
|
+
|
|
5540
|
+
function buildScheduleRunsUrl(taskId) {
|
|
5541
|
+
const u = new URL('/api/schedules/runs', httpOriginForApi() + '/')
|
|
5542
|
+
u.searchParams.set('agent', currentAgentParam())
|
|
5543
|
+
u.searchParams.set('taskId', taskId)
|
|
5544
|
+
return u.toString()
|
|
5545
|
+
}
|
|
5546
|
+
|
|
5547
|
+
function scheduleRunStatusLabel(status) {
|
|
5548
|
+
switch (status) {
|
|
5549
|
+
case 'pending':
|
|
5550
|
+
return '待执行'
|
|
5551
|
+
case 'running':
|
|
5552
|
+
return '执行中'
|
|
5553
|
+
case 'succeeded':
|
|
5554
|
+
return '成功'
|
|
5555
|
+
case 'failed':
|
|
5556
|
+
return '失败'
|
|
5557
|
+
default:
|
|
5558
|
+
return status || '—'
|
|
5559
|
+
}
|
|
5560
|
+
}
|
|
5561
|
+
|
|
5562
|
+
function scheduleRunTriggerLabel(trigger) {
|
|
5563
|
+
return trigger === 'manual' ? '立即执行' : '定时触发'
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
/** 将毫秒格式化为可读耗时 */
|
|
5567
|
+
function formatScheduleRunDurationMs(ms) {
|
|
5568
|
+
if (typeof ms !== 'number' || !Number.isFinite(ms) || ms < 0) return '—'
|
|
5569
|
+
if (ms < 1000) return ms + ' ms'
|
|
5570
|
+
const sec = Math.floor(ms / 1000)
|
|
5571
|
+
if (sec < 60) return sec + ' s'
|
|
5572
|
+
const min = Math.floor(sec / 60)
|
|
5573
|
+
const remSec = sec % 60
|
|
5574
|
+
if (min < 60) return min + ' m ' + remSec + ' s'
|
|
5575
|
+
const hour = Math.floor(min / 60)
|
|
5576
|
+
const remMin = min % 60
|
|
5577
|
+
return hour + ' h ' + remMin + ' m'
|
|
5578
|
+
}
|
|
5579
|
+
|
|
5580
|
+
function scheduleRunResultSummary(run) {
|
|
5581
|
+
if (run.status === 'succeeded' && run.resultText) {
|
|
5582
|
+
const t = String(run.resultText).trim()
|
|
5583
|
+
return t.length > 60 ? t.slice(0, 60) + '…' : t
|
|
5584
|
+
}
|
|
5585
|
+
if (run.status === 'failed' && run.errorMessage) {
|
|
5586
|
+
return String(run.errorMessage)
|
|
5587
|
+
}
|
|
5588
|
+
return '—'
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5591
|
+
function showScheduleRunResultText(text) {
|
|
5592
|
+
if (!scheduleRunResultPre) return
|
|
5593
|
+
const t = String(text || '').trim()
|
|
5594
|
+
if (!t) {
|
|
5595
|
+
scheduleRunResultPre.hidden = true
|
|
5596
|
+
scheduleRunResultPre.textContent = ''
|
|
5597
|
+
return
|
|
5598
|
+
}
|
|
5599
|
+
scheduleRunResultPre.hidden = false
|
|
5600
|
+
scheduleRunResultPre.textContent = t
|
|
5601
|
+
}
|
|
5602
|
+
|
|
5603
|
+
/** 渲染某任务的执行记录表 */
|
|
5604
|
+
function renderScheduleRunsTable(runs) {
|
|
5605
|
+
if (!scheduleRunsTableBody || !scheduleRunsEmpty) return
|
|
5606
|
+
scheduleRunsTableBody.innerHTML = ''
|
|
5607
|
+
const list = Array.isArray(runs) ? runs : []
|
|
5608
|
+
scheduleRunsEmpty.hidden = list.length > 0
|
|
5609
|
+
if (scheduleRunResultPre) {
|
|
5610
|
+
scheduleRunResultPre.hidden = true
|
|
5611
|
+
scheduleRunResultPre.textContent = ''
|
|
5612
|
+
}
|
|
5613
|
+
for (let i = 0; i < list.length; i++) {
|
|
5614
|
+
const run = list[i]
|
|
5615
|
+
if (!run || !run.id) continue
|
|
5616
|
+
const tr = document.createElement('tr')
|
|
5617
|
+
const tdId = document.createElement('td')
|
|
5618
|
+
tdId.textContent = run.id
|
|
5619
|
+
const tdCreated = document.createElement('td')
|
|
5620
|
+
tdCreated.textContent = formatScheduleFireAt(run.createdAt)
|
|
5621
|
+
const tdTrigger = document.createElement('td')
|
|
5622
|
+
tdTrigger.textContent = scheduleRunTriggerLabel(run.trigger)
|
|
5623
|
+
const tdStatus = document.createElement('td')
|
|
5624
|
+
const statusSpan = document.createElement('span')
|
|
5625
|
+
statusSpan.textContent = scheduleRunStatusLabel(run.status)
|
|
5626
|
+
statusSpan.className = 'schedule-run-status--' + (run.status || 'pending')
|
|
5627
|
+
tdStatus.appendChild(statusSpan)
|
|
5628
|
+
const tdDuration = document.createElement('td')
|
|
5629
|
+
tdDuration.textContent = formatScheduleRunDurationMs(run.durationMs)
|
|
5630
|
+
tdDuration.title =
|
|
5631
|
+
typeof run.durationMs === 'number' ? run.durationMs + ' ms' : ''
|
|
5632
|
+
const tdSummary = document.createElement('td')
|
|
5633
|
+
tdSummary.className = 'schedule-manage-prompt'
|
|
5634
|
+
tdSummary.textContent = scheduleRunResultSummary(run)
|
|
5635
|
+
tdSummary.title = run.resultText || run.errorMessage || ''
|
|
5636
|
+
const tdAction = document.createElement('td')
|
|
5637
|
+
if (run.resultText && String(run.resultText).trim()) {
|
|
5638
|
+
const viewBtn = document.createElement('button')
|
|
5639
|
+
viewBtn.type = 'button'
|
|
5640
|
+
viewBtn.className = 'btn-system-settings'
|
|
5641
|
+
viewBtn.textContent = '查看'
|
|
5642
|
+
viewBtn.addEventListener('click', function () {
|
|
5643
|
+
showScheduleRunResultText(run.resultText)
|
|
5644
|
+
})
|
|
5645
|
+
tdAction.appendChild(viewBtn)
|
|
5646
|
+
}
|
|
5647
|
+
tr.appendChild(tdId)
|
|
5648
|
+
tr.appendChild(tdCreated)
|
|
5649
|
+
tr.appendChild(tdTrigger)
|
|
5650
|
+
tr.appendChild(tdStatus)
|
|
5651
|
+
tr.appendChild(tdDuration)
|
|
5652
|
+
tr.appendChild(tdSummary)
|
|
5653
|
+
tr.appendChild(tdAction)
|
|
5654
|
+
scheduleRunsTableBody.appendChild(tr)
|
|
5655
|
+
}
|
|
5656
|
+
if (scheduleRunsMeta) {
|
|
5657
|
+
scheduleRunsMeta.textContent =
|
|
5658
|
+
'任务: ' +
|
|
5659
|
+
(scheduleRunsViewTaskName || scheduleRunsViewTaskId || '—') +
|
|
5660
|
+
' · 共 ' +
|
|
5661
|
+
list.length +
|
|
5662
|
+
' 条记录'
|
|
5663
|
+
}
|
|
5664
|
+
}
|
|
5665
|
+
|
|
5666
|
+
/** 拉取任务执行记录 */
|
|
5667
|
+
async function loadScheduleRuns(taskId) {
|
|
5668
|
+
const res = await fetch(buildScheduleRunsUrl(taskId))
|
|
5669
|
+
const body = await res.json()
|
|
5670
|
+
if (!res.ok) {
|
|
5671
|
+
throw new Error(body.message || body.error || res.statusText)
|
|
5672
|
+
}
|
|
5673
|
+
renderScheduleRunsTable(body.runs)
|
|
5674
|
+
return body
|
|
5675
|
+
}
|
|
5676
|
+
|
|
5677
|
+
function closeScheduleRunsModal() {
|
|
5678
|
+
if (!scheduleRunsModal) return
|
|
5679
|
+
scheduleRunsModal.classList.remove('is-open')
|
|
5680
|
+
scheduleRunsModal.setAttribute('aria-hidden', 'true')
|
|
5681
|
+
document.body.style.overflow = ''
|
|
5682
|
+
scheduleRunsViewTaskId = null
|
|
5683
|
+
scheduleRunsViewTaskName = ''
|
|
5684
|
+
if (scheduleRunResultPre) {
|
|
5685
|
+
scheduleRunResultPre.hidden = true
|
|
5686
|
+
scheduleRunResultPre.textContent = ''
|
|
5687
|
+
}
|
|
5688
|
+
}
|
|
5689
|
+
|
|
5690
|
+
/** 打开执行记录弹窗 */
|
|
5691
|
+
async function openScheduleRunsModal(taskId, taskName) {
|
|
5692
|
+
if (!scheduleRunsModal || !taskId) return
|
|
5693
|
+
scheduleRunsViewTaskId = taskId
|
|
5694
|
+
scheduleRunsViewTaskName = taskName || taskId
|
|
5695
|
+
if (scheduleRunsModalTitle) {
|
|
5696
|
+
scheduleRunsModalTitle.textContent = '执行记录 · ' + scheduleRunsViewTaskName
|
|
5697
|
+
}
|
|
5698
|
+
scheduleRunsModal.classList.add('is-open')
|
|
5699
|
+
scheduleRunsModal.setAttribute('aria-hidden', 'false')
|
|
5700
|
+
document.body.style.overflow = 'hidden'
|
|
5701
|
+
if (scheduleRunsTableBody) {
|
|
5702
|
+
scheduleRunsTableBody.innerHTML =
|
|
5703
|
+
'<tr><td colspan="7" style="padding:1rem;text-align:center;color:#8892a8">加载中…</td></tr>'
|
|
5704
|
+
}
|
|
5705
|
+
try {
|
|
5706
|
+
await loadScheduleRuns(taskId)
|
|
5707
|
+
} catch (e) {
|
|
5708
|
+
if (scheduleRunsTableBody) {
|
|
5709
|
+
scheduleRunsTableBody.innerHTML =
|
|
5710
|
+
'<tr><td colspan="7" style="padding:1rem;color:#c0392b">加载失败: ' +
|
|
5711
|
+
String(e) +
|
|
5712
|
+
'</td></tr>'
|
|
5713
|
+
}
|
|
5714
|
+
}
|
|
5715
|
+
}
|
|
5716
|
+
|
|
5717
|
+
/** 立即执行定时任务 */
|
|
5718
|
+
async function runScheduleTaskNow(id) {
|
|
5719
|
+
const res = await fetch(buildScheduleRunUrl(id), {
|
|
5720
|
+
method: 'POST',
|
|
5721
|
+
headers: { 'Content-Type': 'application/json; charset=utf-8' },
|
|
5722
|
+
body: '{}',
|
|
5723
|
+
})
|
|
5724
|
+
const body = await res.json()
|
|
5725
|
+
if (!res.ok) {
|
|
5726
|
+
window.alert('立即执行失败: ' + (body.message || body.error || res.statusText))
|
|
5727
|
+
return
|
|
5728
|
+
}
|
|
5729
|
+
const run = body.run
|
|
5730
|
+
const runHint =
|
|
5731
|
+
run && run.id
|
|
5732
|
+
? '\n执行记录 ID: ' + run.id + '(状态: ' + scheduleRunStatusLabel(run.status) + ')'
|
|
5733
|
+
: ''
|
|
5734
|
+
window.alert('已加入执行队列' + runHint)
|
|
5735
|
+
if (scheduleRunsViewTaskId === id && scheduleRunsModal && scheduleRunsModal.classList.contains('is-open')) {
|
|
5736
|
+
try {
|
|
5737
|
+
await loadScheduleRuns(id)
|
|
5738
|
+
} catch (e) {
|
|
5739
|
+
window.alert('刷新执行记录失败: ' + String(e))
|
|
5740
|
+
}
|
|
5741
|
+
}
|
|
5742
|
+
}
|
|
5743
|
+
|
|
5744
|
+
/** 启用/禁用定时任务 */
|
|
5745
|
+
async function patchScheduleTaskEnabled(id, enabled) {
|
|
5746
|
+
const res = await fetch(buildScheduleDeleteUrl(id), {
|
|
5747
|
+
method: 'PATCH',
|
|
5748
|
+
headers: { 'Content-Type': 'application/json; charset=utf-8' },
|
|
5749
|
+
body: JSON.stringify({ enabled: !!enabled }),
|
|
5750
|
+
})
|
|
5751
|
+
const body = await res.json()
|
|
5752
|
+
if (!res.ok) {
|
|
5753
|
+
window.alert('更新失败: ' + (body.message || body.error || res.statusText))
|
|
5754
|
+
return
|
|
5755
|
+
}
|
|
5756
|
+
await loadScheduleTasks()
|
|
5757
|
+
}
|
|
5758
|
+
|
|
5456
5759
|
/** 删除定时任务 */
|
|
5457
5760
|
async function deleteScheduleTask(id) {
|
|
5458
5761
|
if (!window.confirm('确定删除定时任务 ' + id + '?')) return
|
|
@@ -5479,19 +5782,16 @@
|
|
|
5479
5782
|
scheduleManageModal.classList.add('is-open')
|
|
5480
5783
|
scheduleManageModal.setAttribute('aria-hidden', 'false')
|
|
5481
5784
|
document.body.style.overflow = 'hidden'
|
|
5482
|
-
populateScheduleSessionSelect()
|
|
5483
5785
|
if (scheduleTaskTableBody) {
|
|
5484
5786
|
scheduleTaskTableBody.innerHTML =
|
|
5485
|
-
'<tr><td colspan="
|
|
5787
|
+
'<tr><td colspan="8" style="padding:1rem;text-align:center;color:#8892a8">加载中…</td></tr>'
|
|
5486
5788
|
}
|
|
5487
5789
|
try {
|
|
5488
|
-
await loadSessions()
|
|
5489
|
-
populateScheduleSessionSelect()
|
|
5490
5790
|
await loadScheduleTasks()
|
|
5491
5791
|
} catch (e) {
|
|
5492
5792
|
if (scheduleTaskTableBody) {
|
|
5493
5793
|
scheduleTaskTableBody.innerHTML =
|
|
5494
|
-
'<tr><td colspan="
|
|
5794
|
+
'<tr><td colspan="8" style="padding:1rem;color:#c0392b">加载失败: ' +
|
|
5495
5795
|
String(e) +
|
|
5496
5796
|
'</td></tr>'
|
|
5497
5797
|
}
|
|
@@ -9073,6 +9373,22 @@
|
|
|
9073
9373
|
if (scheduleManageModalBackdrop) {
|
|
9074
9374
|
scheduleManageModalBackdrop.addEventListener('click', closeScheduleManageModal)
|
|
9075
9375
|
}
|
|
9376
|
+
const btnScheduleRunsModalClose = $('btnScheduleRunsModalClose')
|
|
9377
|
+
const btnScheduleRunsRefresh = $('btnScheduleRunsRefresh')
|
|
9378
|
+
if (btnScheduleRunsModalClose) {
|
|
9379
|
+
btnScheduleRunsModalClose.addEventListener('click', closeScheduleRunsModal)
|
|
9380
|
+
}
|
|
9381
|
+
if (scheduleRunsModalBackdrop) {
|
|
9382
|
+
scheduleRunsModalBackdrop.addEventListener('click', closeScheduleRunsModal)
|
|
9383
|
+
}
|
|
9384
|
+
if (btnScheduleRunsRefresh) {
|
|
9385
|
+
btnScheduleRunsRefresh.addEventListener('click', function () {
|
|
9386
|
+
if (!scheduleRunsViewTaskId) return
|
|
9387
|
+
void loadScheduleRuns(scheduleRunsViewTaskId).catch(function (e) {
|
|
9388
|
+
window.alert('刷新失败: ' + e)
|
|
9389
|
+
})
|
|
9390
|
+
})
|
|
9391
|
+
}
|
|
9076
9392
|
if (btnScheduleRefresh) {
|
|
9077
9393
|
btnScheduleRefresh.addEventListener('click', function () {
|
|
9078
9394
|
void loadScheduleTasks().catch(function (e) {
|
|
@@ -9083,7 +9399,7 @@
|
|
|
9083
9399
|
if (btnScheduleCreateToggle && scheduleCreateForm) {
|
|
9084
9400
|
btnScheduleCreateToggle.addEventListener('click', function () {
|
|
9085
9401
|
scheduleCreateForm.hidden = !scheduleCreateForm.hidden
|
|
9086
|
-
if (!scheduleCreateForm.hidden)
|
|
9402
|
+
if (!scheduleCreateForm.hidden && scheduleTaskNameInput) scheduleTaskNameInput.focus()
|
|
9087
9403
|
})
|
|
9088
9404
|
}
|
|
9089
9405
|
if (btnScheduleCreateCancel && scheduleCreateForm) {
|
|
@@ -9943,6 +10259,10 @@
|
|
|
9943
10259
|
closeAgentEnvModal()
|
|
9944
10260
|
return
|
|
9945
10261
|
}
|
|
10262
|
+
if (scheduleRunsModal && scheduleRunsModal.classList.contains('is-open')) {
|
|
10263
|
+
closeScheduleRunsModal()
|
|
10264
|
+
return
|
|
10265
|
+
}
|
|
9946
10266
|
if (scheduleManageModal && scheduleManageModal.classList.contains('is-open')) {
|
|
9947
10267
|
closeScheduleManageModal()
|
|
9948
10268
|
return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-ai/agent",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.138",
|
|
4
4
|
"description": "Auto AI Agent 网关 CLI(WebSocket,独立二进制,无需 Bun)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"maintainers": [
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"zod": "^4.3.6"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@auto-ai/agent-linux-x64": "2.1.
|
|
36
|
-
"@auto-ai/agent-linux-arm64": "2.1.
|
|
37
|
-
"@auto-ai/agent-darwin-x64": "2.1.
|
|
38
|
-
"@auto-ai/agent-darwin-arm64": "2.1.
|
|
39
|
-
"@auto-ai/agent-win-x64": "2.1.
|
|
35
|
+
"@auto-ai/agent-linux-x64": "2.1.138",
|
|
36
|
+
"@auto-ai/agent-linux-arm64": "2.1.138",
|
|
37
|
+
"@auto-ai/agent-darwin-x64": "2.1.138",
|
|
38
|
+
"@auto-ai/agent-darwin-arm64": "2.1.138",
|
|
39
|
+
"@auto-ai/agent-win-x64": "2.1.138"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"prepare": "node ../../scripts/sync-launcher-env.js",
|
package/.env.example
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93479,e=>{"use strict";e.s(["Input",()=>t]);var o=e.i(18050),r=e.i(75157);function t(e){let{className:t,type:n="text",size:s="default",...a}=e;return(0,o.jsx)("input",{type:n,"data-slot":"input","data-size":s,className:(0,r.cn)("h-9 w-full appearance-none rounded-md border border-solid border-border bg-transparent px-3 text-base outline-none transition-[color,box-shadow,border-color] duration-150 ease-in-out placeholder:text-muted-foreground hover:border-[#e0e0e0] focus-visible:border-[var(--border-focus)] focus-visible:[box-shadow:var(--ring-focus-sm)] read-only:focus-visible:border-border read-only:focus-visible:[box-shadow:none] disabled:cursor-not-allowed disabled:opacity-50 disabled:focus-visible:border-border disabled:focus-visible:[box-shadow:none] data-[size=default]:h-9 data-[size=lg]:h-10 data-[size=sm]:h-7",t),...a})}},20783,e=>{"use strict";e.s(["composeRefs",()=>t,"useComposedRefs",()=>n]);var o=e.i(71645);function r(e,o){if("function"==typeof e)return e(o);null!=e&&(e.current=o)}function t(){for(var e=arguments.length,o=Array(e),t=0;t<e;t++)o[t]=arguments[t];return e=>{let t=!1,n=o.map(o=>{let n=r(o,e);return t||"function"!=typeof n||(t=!0),n});if(t)return()=>{for(let e=0;e<n.length;e++){let t=n[e];"function"==typeof t?t():r(o[e],null)}}}}function n(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return o.useCallback(t(...r),r)}}]);
|