@xiangyixie/dsh-superagent 0.18.1 → 0.18.3

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/lib/client.js +25 -10
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -233,6 +233,7 @@ window.__ModuleLoader__.load({
233
233
  .dsa-rail-count{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,rgb(129,133,140))}
234
234
  .dsa-rowdot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-label-caption,rgb(129,133,140))}
235
235
  .dsa-rowdot[data-status=running]{background:var(--dsw-alias-state-success-primary,#22c55e)}
236
+ .dsa-rowdot[data-status=waiting]{background:var(--dsw-alias-state-warning-primary,#ffc140)}
236
237
  .dsa-rowdot[data-status=stopped]{background:var(--dsw-alias-state-warn-primary,#f59e0b)}
237
238
  .dsa-rail-head{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 8px;font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary,rgb(129,133,140))}
238
239
  .dsa-rail-list{display:flex;flex:1;flex-direction:column;gap:2px;min-height:0;overflow-y:auto;margin-bottom:8px}
@@ -575,6 +576,15 @@ window.__ModuleLoader__.load({
575
576
  const others = model.approvals.filter(entry => entry.id !== approval.id)
576
577
  return { ...model, approvals: [...others, approval], unread: (model.unread ?? 0) + 1 }
577
578
  }
579
+ if (frame.action === 'expired' && frame.id) {
580
+ // The card must not vanish silently: the tool call it guarded is
581
+ // already cancelled, and the user should know why.
582
+ return {
583
+ ...model,
584
+ approvals: model.approvals.filter(entry => entry.id !== frame.id),
585
+ toast: { kind: 'err', text: '这个审批已超时,工具调用已取消' },
586
+ }
587
+ }
578
588
  if (frame.id) {
579
589
  return { ...model, approvals: model.approvals.filter(entry => entry.id !== frame.id) }
580
590
  }
@@ -852,16 +862,21 @@ window.__ModuleLoader__.load({
852
862
  h('div', { className: 'dsa-rail-list' },
853
863
  runs.length === 0
854
864
  ? h('div', { className: 'dsa-hint', style: { padding: '8px' } }, '超级智能体还没有调度新的会话')
855
- : runs.map(run => tipped(run.goal ?? '', h('button', {
856
- key: run.id,
857
- type: 'button',
858
- className: 'dsa-rowitem',
859
- title: '查看任务详情',
860
- onClick: () => props.onOpen?.(run.id),
861
- },
862
- h('span', { className: 'dsa-rowdot', 'data-status': run.status }),
863
- h('span', { className: 'dsa-rowtitle' }, run.goal ?? '调度中的会话'),
864
- h('span', { className: 'dsa-rowtime' }, run.status === 'running' ? '运行中' : run.status === 'completed' ? '完成' : '已停')), 'left', run.id))))
865
+ : runs.map(run => {
866
+ // A run with an unanswered attention item is waiting on the user,
867
+ // not running: show that as its own amber state.
868
+ const waiting = Array.isArray(run.attention) && run.attention.length > 0
869
+ return tipped(run.goal ?? '', h('button', {
870
+ key: run.id,
871
+ type: 'button',
872
+ className: 'dsa-rowitem',
873
+ title: '查看任务详情',
874
+ onClick: () => props.onOpen?.(run.id),
875
+ },
876
+ h('span', { className: 'dsa-rowdot', 'data-status': waiting ? 'waiting' : run.status }),
877
+ h('span', { className: 'dsa-rowtitle' }, run.goal ?? '调度中的会话'),
878
+ h('span', { className: 'dsa-rowtime' }, waiting ? '等你决定' : run.status === 'running' ? '运行中' : run.status === 'completed' ? '完成' : '已停')), 'left', run.id)
879
+ })))
865
880
  }
866
881
 
867
882
  /** Artifacts are whatever the run report links to, same rule as the console page. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiangyixie/dsh-superagent",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "长周期自主执行插件:一个目标拆成可并行的子任务,交付一份合并报告,重启后仍可继续。",
5
5
  "author": "Admire (LittleChenLiya)",
6
6
  "type": "module",