@kadaliao/dsh-bots 0.10.2 → 0.11.0

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/client.js CHANGED
@@ -21,7 +21,7 @@ window.__ModuleLoader__.load({
21
21
  const NS = 'bots';
22
22
  const PANEL_ID = 'bots';
23
23
  /** The Bots this page is (package.json): the Host says which one it runs, and a stale Host is pointed out. */
24
- const BOTS_VERSION = '0.10.2';
24
+ const BOTS_VERSION = '0.11.0';
25
25
  /** How close to a new topic Harness closing the panel counts as caused by it (it archived the conversation behind). */
26
26
  const ROTATE_WINDOW_MS = 3000;
27
27
  const R = '/__dsh_bots/';
@@ -371,22 +371,15 @@ window.__ModuleLoader__.load({
371
371
 
372
372
  // --- tasks (tickets in the Host; "tasks" on screen) ----------------------------------
373
373
 
374
- /** How the dispatcher works ('router' | 'hands-on'), a team setting: the polled state's, else the settings'; router unless either says otherwise. */
375
- const dispatcherOf = () => {
376
- const v = store.state?.dispatcher ?? store.settings?.settings?.dispatcher;
377
- return v === 'hands-on' ? 'hands-on' : 'router';
378
- };
379
374
  /**
380
- * Whether the dispatcher routes now: router mode, and a teammate to hand work to (the Host's
381
- * `routerActive`). The only bot of a team works hands-on whatever the setting says.
375
+ * Whether the dispatcher routes now: it has a teammate to hand work to (the Host's `routerActive`).
376
+ * The only bot of a team does the work itself. There is no other mode since 0.11.
382
377
  */
383
- const routerActiveOf = (state = store.state) => dispatcherOf() === 'router' && state?.routerActive !== false;
378
+ const routerActiveOf = (state = store.state) => state?.routerActive !== false;
384
379
  /** Keep the shared copies of the settings after a save, so the page shows them before the next poll. */
385
380
  function tookSettings(next) {
386
381
  if (next && typeof next === 'object') {
387
382
  store.settings = { ...(store.settings ?? {}), settings: next };
388
- // Until the next poll says, router mode is in effect when the dispatcher has a teammate.
389
- if (store.state && typeof next.dispatcher === 'string') store.state = { ...store.state, dispatcher: next.dispatcher, routerActive: next.dispatcher === 'router' && (store.state.bots?.length ?? 0) > 1 };
390
383
  // Chats show the new level of bot-to-bot detail at once.
391
384
  if (store.state && next.display && typeof next.display === 'object') store.state = { ...store.state, display: next.display };
392
385
  notify();
@@ -641,6 +634,7 @@ window.__ModuleLoader__.load({
641
634
  chevron: (s = 12) => svg(s, ['M6 9l6 6 6-6']),
642
635
  back: (s = 12) => svg(s, ['M19 12H5', 'M11 6l-6 6 6 6']),
643
636
  tasks: (s = 14) => svg(s, ['M10 6h10', 'M10 12h10', 'M10 18h10', 'M3.5 6l1.5 1.5L7.5 5', 'M3.5 12l1.5 1.5 2.5-2.5', 'M3.5 18l1.5 1.5 2.5-2.5']),
637
+ target: (s = 14) => svg(s, ['M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z', 'M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8z', 'M12 12h.01']),
644
638
  stop: (s = 13) => svg(s, ['M7 7h10v10H7z']),
645
639
  chart: (s = 14) => svg(s, ['M4 20V10', 'M10 20V4', 'M16 20v-7', 'M21 20H3']),
646
640
  brain: (s = 14) => svg(s, ['M9 4a3 3 0 0 0-3 3v.2A3 3 0 0 0 4 10a3 3 0 0 0 1 2.2A3 3 0 0 0 6 17a3 3 0 0 0 3 3h0V4z', 'M15 4a3 3 0 0 1 3 3v.2A3 3 0 0 1 20 10a3 3 0 0 1-1 2.2A3 3 0 0 1 18 17a3 3 0 0 1-3 3h0V4z']),
@@ -1179,7 +1173,9 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
1179
1173
  /** A red count of what needs you (tasks, or a bot's questions). */
1180
1174
  const NeedsBadge = ({ n, label, attr }) =>
1181
1175
  h('span', { [attr]: n, 'aria-label': label, title: label, style: { minWidth: 20, height: 20, padding: '0 6px', borderRadius: 999, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', background: C.error, color: '#fff', fontSize: TINY, fontWeight: 700, fontVariantNumeric: 'tabular-nums', flex: 'none' } }, n > 99 ? '99+' : String(n));
1182
- function Rail({ t, bots, primaryId, selected, onSelect, onNew, onTeams, view, onActivity, messageCount, onUsage, onMemory, onSettings, teamNotes, onTasks, attention = 0, openTasks = 0 }) {
1176
+ function Rail({ t, bots, primaryId, selected, onSelect, onNew, onTeams, view, onActivity, messageCount, onUsage, onMemory, onSettings, teamNotes, onTasks, attention = 0, openTasks = 0, onNeeds, needCounts = {} }) {
1177
+ const needsWaiting = Number(needCounts?.waiting) || 0;
1178
+ const needsWorking = Number(needCounts?.working) || 0;
1183
1179
  const lang = langOf(t);
1184
1180
  const [q, setQ] = useState('');
1185
1181
  const [menu, setMenu] = useState(false);
@@ -1268,6 +1264,21 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
1268
1264
  h(
1269
1265
  'div',
1270
1266
  { style: { padding: 8, borderTop: `1px solid ${C.border1}` } },
1267
+ // What you asked for (Bots 0.11), above the tasks that do it.
1268
+ onNeeds
1269
+ ? h(
1270
+ 'button',
1271
+ { type: 'button', className: 'dshb-row', 'data-active': view === 'needs', 'data-dsh-bots-needs-entry': true, onClick: onNeeds },
1272
+ h('span', { style: { width: 36, height: 36, borderRadius: '50%', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', background: C.layer2, color: C.label, flex: 'none' } }, Icon.target(16)),
1273
+ h(
1274
+ 'span',
1275
+ { style: { display: 'flex', flexDirection: 'column', flex: 1, minWidth: 0 } },
1276
+ h('span', { style: { fontWeight: 600 } }, t('needs')),
1277
+ h('span', { style: { fontSize: TINY, color: needsWaiting > 0 ? C.warn : C.muted } }, needsWaiting > 0 ? t('needsWaitingHint', { n: needsWaiting }) : needsWorking > 0 ? t('needsWorkingHint', { n: needsWorking }) : t('needsHint')),
1278
+ ),
1279
+ needsWaiting > 0 ? h(NeedsBadge, { n: needsWaiting, label: t('needsWaitingHint', { n: needsWaiting }), attr: 'data-dsh-bots-needs-badge' }) : null,
1280
+ )
1281
+ : null,
1271
1282
  onTasks
1272
1283
  ? h(
1273
1284
  'button',
@@ -3383,6 +3394,299 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
3383
3394
  );
3384
3395
  }
3385
3396
 
3397
+ // --- needs: what the person asked for, one level above the tasks (Bots 0.11) ------------------
3398
+
3399
+ const NEED_COLOR = { waiting: C.warn, working: C.ok, failed: C.error, done: C.label, stopped: C.muted };
3400
+ /** The board's group of a need: what needs you (a question, or it did not get done), what moves, what finished, what was dropped. */
3401
+ const needGroupOf = (r) => (r?.status === 'waiting' || r?.status === 'failed' ? 'needs' : r?.status === 'done' ? 'done' : r?.status === 'stopped' ? 'stopped' : 'working');
3402
+ const needIcon = (status) => (status === 'waiting' ? Icon.question(14) : status === 'failed' ? Icon.alert(14) : status === 'done' ? Icon.check(14) : status === 'stopped' ? Icon.stop(12) : Icon.target(14));
3403
+ const needRows = (data) => (Array.isArray(data?.items) ? data.items : []).filter((r) => r && typeof r.id === 'string' && typeof r.status === 'string');
3404
+ /** A need's status as a badge; one in progress with several tasks says how many are done. */
3405
+ function NeedChip({ t, row }) {
3406
+ const color = NEED_COLOR[row?.status] ?? C.muted;
3407
+ const label = row?.status === 'working' && Number(row.total) > 1 ? t('needWorkingOf', { done: Number(row.done) || 0, total: Number(row.total) }) : t(`need_${row?.status ?? 'working'}`);
3408
+ return h(Badge, { color, 'data-dsh-bots-need-status': row?.status }, row?.status === 'working' ? h(StatusDot, { status: 'running', size: 6 }) : null, label);
3409
+ }
3410
+ /** One need on the board: what you asked for, how far it got, who works on it, and the latest word. */
3411
+ function NeedRow({ t, row, onOpen }) {
3412
+ const latest = row.latest && typeof row.latest === 'object' && str(row.latest.preview).trim() ? row.latest : null;
3413
+ const bots = (Array.isArray(row.bots) ? row.bots : []).filter((b) => typeof b === 'string').slice(0, 4);
3414
+ const when = row.status === 'done' && row.endedAt ? t('needDelivered', { when: fmtAgo(t, row.endedAt) }) : fmtAgo(t, row.updatedAt);
3415
+ return h(
3416
+ 'button',
3417
+ { type: 'button', className: 'dshb-row', 'data-dsh-bots-need': row.id, 'data-status': row.status, onClick: () => onOpen(row.id), style: { alignItems: 'flex-start', padding: '10px 10px' } },
3418
+ h('span', { style: { width: 30, height: 30, borderRadius: '50%', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flex: 'none', background: tint(NEED_COLOR[row.status] ?? C.muted, 14), color: NEED_COLOR[row.status] ?? C.muted } }, needIcon(row.status)),
3419
+ h(
3420
+ 'span',
3421
+ { style: { display: 'flex', flexDirection: 'column', gap: 4, flex: 1, minWidth: 0 } },
3422
+ h(
3423
+ 'span',
3424
+ { style: { display: 'flex', alignItems: 'center', gap: 8, minWidth: 0 } },
3425
+ h('span', { style: { fontWeight: 600, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0, flex: 1 } }, str(row.title).trim() || t('untitledTask')),
3426
+ h(NeedChip, { t, row }),
3427
+ ),
3428
+ h(
3429
+ 'span',
3430
+ { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: TINY, color: C.muted, minWidth: 0, flexWrap: 'wrap' } },
3431
+ bots.length ? h('span', { 'data-dsh-bots-need-bots': bots.length, style: { display: 'inline-flex', alignItems: 'center', gap: 2 } }, bots.map((b) => h(BotFace, { key: b, id: b, size: 16 }))) : null,
3432
+ bots.length ? h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: 220 } }, bots.map((b) => botName(t, b)).join('、')) : null,
3433
+ bots.length ? dotSep() : null,
3434
+ viaBadge(t, row.via, row.who),
3435
+ h('span', { style: { color: C.faint }, title: fmtDate(toMs(row.updatedAt)) }, when),
3436
+ ),
3437
+ latest
3438
+ ? h(
3439
+ 'span',
3440
+ { 'data-dsh-bots-need-latest': latest.status, style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: TINY, color: C.muted, minWidth: 0 } },
3441
+ // A delivered need says "done" once, on its own chip.
3442
+ row.status === 'done' ? null : h(ReportChip, { t, status: latest.status }),
3443
+ h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 } }, str(latest.preview)),
3444
+ )
3445
+ : str(row.asked).trim()
3446
+ ? h('span', { style: { fontSize: TINY, color: C.faint, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 } }, t('needYouSaid', { text: str(row.asked) }))
3447
+ : null,
3448
+ Number(row.failed) > 0 && row.status !== 'failed' ? h('span', { 'data-dsh-bots-need-failed': row.failed, style: { fontSize: TINY, color: C.error } }, t('needSomeFailed', { n: Number(row.failed) })) : null,
3449
+ Number(row.stalled) > 0 && row.status === 'working' ? h('span', { 'data-dsh-bots-need-stalled': row.stalled, style: { fontSize: TINY, color: C.warn } }, t('needSomeStalled', { n: Number(row.stalled) })) : null,
3450
+ ),
3451
+ );
3452
+ }
3453
+ /** Every request of the person's: what waits for them, what moves, what was delivered (the tasks stay one level down). */
3454
+ function NeedsView({ t, onOpen, onTasks }) {
3455
+ const { data, failed } = useJson('needs?limit=300', STATE_POLL_MS);
3456
+ const [doneShown, setDoneShown] = useState(DONE_PAGE);
3457
+ const [showStopped, setShowStopped] = useState(false);
3458
+ const items = needRows(data);
3459
+ const byNewest = (a, b) => (toMs(b.updatedAt) || 0) - (toMs(a.updatedAt) || 0);
3460
+ const groups = [
3461
+ { id: 'needs', title: t('needsYou'), empty: t('needsYouEmpty') },
3462
+ { id: 'working', title: t('needsWorking'), empty: t('needsWorkingEmpty') },
3463
+ { id: 'done', title: t('needsDone'), empty: t('needsDoneEmpty') },
3464
+ ].map((g) => ({ ...g, rows: items.filter((r) => needGroupOf(r) === g.id).sort(byNewest) }));
3465
+ const stopped = items.filter((r) => needGroupOf(r) === 'stopped').sort(byNewest);
3466
+ const doneCount = groups[2].rows.length;
3467
+ groups[2].rows = groups[2].rows.slice(0, doneShown);
3468
+ // This week, as the person counts it: what they asked for since, and where it stands.
3469
+ const since = Date.now() - 7 * 86_400_000;
3470
+ const week = items.filter((r) => (toMs(r.createdAt) || 0) >= since);
3471
+ const weekOf = (fn) => week.filter(fn).length;
3472
+ let body;
3473
+ if (!data && items.length === 0) body = h('div', { style: { padding: 24, color: C.faint, fontSize: SMALL, textAlign: 'center' } }, failed ? t('needsUnavailable') : t('loading'));
3474
+ else if (items.length === 0) body = h(Empty, { icon: Icon.target(28), title: t('needsEmptyTitle'), body: t('needsEmptyBody') });
3475
+ else {
3476
+ body = h(
3477
+ 'div',
3478
+ { style: { display: 'flex', flexDirection: 'column', gap: 24 } },
3479
+ week.length
3480
+ ? h(
3481
+ 'div',
3482
+ { 'data-dsh-bots-needs-week': week.length, style: { fontSize: SMALL, color: C.muted } },
3483
+ t('needsWeek', { n: week.length, done: weekOf((r) => r.status === 'done'), working: weekOf((r) => r.status === 'working'), waiting: weekOf((r) => needGroupOf(r) === 'needs') }),
3484
+ )
3485
+ : null,
3486
+ groups.map((g) =>
3487
+ h(
3488
+ 'div',
3489
+ { key: g.id, 'data-dsh-bots-need-group': g.id, 'data-count': g.rows.length },
3490
+ h(
3491
+ Section,
3492
+ { title: [g.title, h('span', { key: 'n', style: { marginLeft: 6, fontWeight: 500, color: C.faint } }, g.id === 'done' ? doneCount : g.rows.length)] },
3493
+ g.rows.length === 0 ? h('div', { style: { fontSize: SMALL, color: C.faint, padding: '2px 2px 4px' } }, g.empty) : h(TaskList, { attr: 'data-dsh-bots-need-list', rows: g.rows.map((r) => h(NeedRow, { key: r.id, t, row: r, onOpen })) }),
3494
+ g.id === 'done' && doneCount > doneShown ? h('div', null, h(Btn, { size: 'sm', kind: 'ghost', onClick: () => setDoneShown((n) => n + DONE_PAGE), 'data-dsh-bots-needs-more': true }, t('showMore'))) : null,
3495
+ ),
3496
+ ),
3497
+ ),
3498
+ stopped.length
3499
+ ? h(
3500
+ 'div',
3501
+ { 'data-dsh-bots-need-group': 'stopped', 'data-count': stopped.length },
3502
+ h(Btn, { size: 'sm', kind: 'ghost', onClick: () => setShowStopped((x) => !x), 'data-dsh-bots-needs-stopped': true }, showStopped ? t('needsHideStopped') : t('needsShowStopped', { n: stopped.length })),
3503
+ showStopped ? h('div', { style: { marginTop: 8 } }, h(TaskList, { attr: 'data-dsh-bots-need-list', rows: stopped.map((r) => h(NeedRow, { key: r.id, t, row: r, onOpen })) })) : null,
3504
+ )
3505
+ : null,
3506
+ );
3507
+ }
3508
+ return h(
3509
+ 'div',
3510
+ { 'data-dsh-bots-needs': true, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 } },
3511
+ h(
3512
+ 'div',
3513
+ { style: { display: 'flex', alignItems: 'center', gap: 12, padding: '18px 24px 12px', borderBottom: `1px solid ${C.border1}` } },
3514
+ h('span', { style: { width: 44, height: 44, borderRadius: '50%', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', background: C.layer2, color: C.label } }, Icon.target(20)),
3515
+ h('div', { style: { flex: 1, minWidth: 0 } }, h('div', { style: { fontWeight: 700, fontSize: 17 } }, t('needs')), h('div', { style: { fontSize: SMALL, color: C.muted } }, t('needsSub'))),
3516
+ onTasks ? h(Btn, { size: 'sm', kind: 'ghost', icon: Icon.tasks(13), onClick: onTasks, 'data-dsh-bots-needs-tasks': true }, t('needsAllTasks')) : null,
3517
+ ),
3518
+ h('div', { className: 'dshb-scroll', style: { flex: 1, padding: '18px 24px 28px' } }, h('div', { style: { maxWidth: 900, margin: '0 auto' } }, body)),
3519
+ );
3520
+ }
3521
+
3522
+ /** One request: what you said, what was delivered, what waits for you, and the tasks behind it. */
3523
+ function NeedDetail({ t, id, toast, onBack, onOpenTask }) {
3524
+ const { data, failed, reload } = useJson(`needs/${encodeURIComponent(id)}`, STATE_POLL_MS);
3525
+ const [confirm, setConfirm] = useState(false);
3526
+ const [draft, setDraft] = useState(null);
3527
+ const [busy, setBusy] = useState(false);
3528
+ const v = data && typeof data === 'object' && typeof data.id === 'string' ? data : null;
3529
+ const back = h('button', { type: 'button', className: 'dshb-link', 'data-dsh-bots-needs-back': true, onClick: onBack, style: { display: 'inline-flex', alignItems: 'center', gap: 5, fontSize: SMALL } }, Icon.back(12), t('allNeeds'));
3530
+ if (!v) {
3531
+ return h(
3532
+ 'div',
3533
+ { 'data-dsh-bots-need-detail': id, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0, padding: '18px 24px' } },
3534
+ back,
3535
+ h('div', { style: { padding: 24, color: C.faint, fontSize: SMALL, textAlign: 'center' } }, failed ? t('needMissing') : t('loading')),
3536
+ );
3537
+ }
3538
+ const post = (path, body, okText) => {
3539
+ if (busy) return Promise.resolve(false);
3540
+ setBusy(true);
3541
+ return postJson(`needs/${encodeURIComponent(v.id)}/${path}`, body)
3542
+ .then((r) => {
3543
+ if (r && r.ok !== false) {
3544
+ toast(okText);
3545
+ void reload();
3546
+ void refreshState();
3547
+ return true;
3548
+ }
3549
+ toast(r?.reason || t('actionFailed'), 'error');
3550
+ return false;
3551
+ })
3552
+ .finally(() => setBusy(false));
3553
+ };
3554
+ const saveTitle = () => {
3555
+ const title = str(draft).trim();
3556
+ if (!title) return;
3557
+ void post('rename', { title }, t('needRenamed')).then((ok) => ok && setDraft(null));
3558
+ };
3559
+ const asks = (Array.isArray(v.asks) ? v.asks : []).filter((a) => a && str(a.text).trim());
3560
+ const results = (Array.isArray(v.results) ? v.results : []).filter((r) => r && str(r.text).trim());
3561
+ const tasks = (Array.isArray(v.tickets) ? v.tickets : []).filter((r) => r && typeof r.id === 'string');
3562
+ const waiting = new Set(Array.isArray(v.waiting) ? v.waiting : []);
3563
+ const asking = v.latest && waiting.has(v.latest.ticket) ? v.latest : null;
3564
+ const open = v.status === 'waiting' || v.status === 'working' || v.status === 'failed';
3565
+ return h(
3566
+ 'div',
3567
+ { 'data-dsh-bots-need-detail': v.id, 'data-status': v.status, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 } },
3568
+ h(
3569
+ 'header',
3570
+ { style: { padding: '14px 24px 14px', borderBottom: `1px solid ${C.border1}`, display: 'flex', flexDirection: 'column', gap: 8 } },
3571
+ h('div', null, back),
3572
+ h(
3573
+ 'div',
3574
+ { style: { display: 'flex', alignItems: 'flex-start', gap: 12, flexWrap: 'wrap' } },
3575
+ h(
3576
+ 'div',
3577
+ { style: { flex: 1, minWidth: 240, display: 'flex', flexDirection: 'column', gap: 4 } },
3578
+ draft !== null
3579
+ ? h(
3580
+ 'div',
3581
+ { style: { display: 'flex', alignItems: 'center', gap: 6 } },
3582
+ h(Input, {
3583
+ value: draft,
3584
+ maxLength: 80,
3585
+ 'aria-label': t('needTitleLabel'),
3586
+ 'data-dsh-bots-need-title-input': true,
3587
+ onChange: (e) => setDraft(e.target.value),
3588
+ onKeyDown: (e) => {
3589
+ if (e.key === 'Enter' && !e.isComposing && !e.nativeEvent?.isComposing) saveTitle();
3590
+ if (e.key === 'Escape') setDraft(null);
3591
+ },
3592
+ style: { flex: 1, fontSize: 16, fontWeight: 600 },
3593
+ }),
3594
+ h(Btn, { kind: 'primary', size: 'sm', disabled: busy || !str(draft).trim(), onClick: saveTitle, 'data-dsh-bots-need-title-save': true }, t('save')),
3595
+ h(Btn, { size: 'sm', onClick: () => setDraft(null) }, t('cancel')),
3596
+ )
3597
+ : h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, minWidth: 0 } }, h('span', { 'data-dsh-bots-need-title': true, style: { fontWeight: 700, fontSize: 19, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, str(v.title)), h(NeedChip, { t, row: v })),
3598
+ h(
3599
+ 'div',
3600
+ { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: SMALL, color: C.muted, flexWrap: 'wrap' } },
3601
+ h('span', { title: fmtDate(toMs(v.createdAt)) }, t('needAsked', { when: fmtAgo(t, v.createdAt) })),
3602
+ viaBadge(t, v.via, v.who),
3603
+ v.status === 'done' && v.endedAt ? dotSep() : null,
3604
+ v.status === 'done' && v.endedAt ? h('span', { title: fmtDate(toMs(v.endedAt)) }, t('needDelivered', { when: fmtAgo(t, v.endedAt) })) : null,
3605
+ ),
3606
+ v.auto ? h('div', { 'data-dsh-bots-need-auto': true, style: { fontSize: TINY, color: C.faint } }, t('needAutoHint')) : null,
3607
+ ),
3608
+ h(
3609
+ 'div',
3610
+ { style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' } },
3611
+ draft === null ? h(Btn, { icon: Icon.edit(13), disabled: busy, onClick: () => setDraft(str(v.title)), 'data-dsh-bots-need-rename': v.id }, t('needRename')) : null,
3612
+ open ? h(Btn, { kind: 'danger', icon: Icon.stop(12), disabled: busy, onClick: () => setConfirm(true), 'data-dsh-bots-need-drop': v.id }, t('needDrop')) : null,
3613
+ ),
3614
+ ),
3615
+ ),
3616
+ h(
3617
+ 'div',
3618
+ { className: 'dshb-scroll', style: { flex: 1, padding: '18px 24px 24px' } },
3619
+ h(
3620
+ 'div',
3621
+ { style: { maxWidth: 820, display: 'flex', flexDirection: 'column', gap: 22 } },
3622
+ asking
3623
+ ? h(
3624
+ 'div',
3625
+ { 'data-dsh-bots-need-asking': asking.ticket, className: 'dshb-card', style: { display: 'flex', flexDirection: 'column', gap: 8, borderColor: tint(C.warn, 45), background: tint(C.warn, 6) } },
3626
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: SMALL, fontWeight: 600 } }, h(BotFace, { id: asking.botId, size: 18 }), t('needQuestion', { name: botName(t, asking.botId) })),
3627
+ h(Clamp, { t, text: str(asking.preview), lines: 6, style: { fontSize: SMALL } }),
3628
+ h('div', null, h(Btn, { kind: 'primary', size: 'sm', onClick: () => onOpenTask(asking.ticket), 'data-dsh-bots-need-answer': asking.ticket }, t('needAnswer'))),
3629
+ )
3630
+ : null,
3631
+ h(
3632
+ Section,
3633
+ { title: t('needYourWords') },
3634
+ asks.length === 0
3635
+ ? h('div', { style: { fontSize: SMALL, color: C.faint } }, '—')
3636
+ : h(
3637
+ 'div',
3638
+ { 'data-dsh-bots-need-asks': asks.length, style: { display: 'flex', flexDirection: 'column', gap: 8 } },
3639
+ asks.map((a, i) =>
3640
+ h(
3641
+ 'div',
3642
+ { key: `${a.at}-${i}`, style: { display: 'flex', flexDirection: 'column', gap: 4 } },
3643
+ h('span', { style: { fontSize: TINY, color: C.faint }, title: fmtDate(toMs(a.at)) }, fmtAgo(t, a.at)),
3644
+ h('div', { style: { padding: '8px 12px', borderRadius: '14px 4px 14px 14px', background: tint(C.label, 8), border: `1px solid ${C.border1}`, fontSize: FONT, alignSelf: 'flex-start', maxWidth: '100%' } }, h(Clamp, { t, text: str(a.text), lines: 6 })),
3645
+ ),
3646
+ ),
3647
+ ),
3648
+ ),
3649
+ h(
3650
+ Section,
3651
+ { title: t('needResults') },
3652
+ results.length === 0
3653
+ ? h('div', { style: { fontSize: SMALL, color: C.faint } }, t('needNoResults'))
3654
+ : h(
3655
+ 'div',
3656
+ { 'data-dsh-bots-need-results': results.length, style: { display: 'flex', flexDirection: 'column', gap: 12 } },
3657
+ results.map((r, i) =>
3658
+ h(
3659
+ 'div',
3660
+ { key: `${r.at}-${i}`, style: { display: 'flex', flexDirection: 'column', gap: 5 } },
3661
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: TINY, color: C.faint } }, h(BotFace, { id: r.botId, size: 16 }), h('span', { style: { fontWeight: 600, color: C.muted } }, botName(t, r.botId)), h('span', { title: fmtDate(toMs(r.at)) }, fmtAgo(t, r.at))),
3662
+ h('div', { style: { padding: '8px 12px', borderRadius: '4px 14px 14px 14px', background: C.layer2, border: `1px solid ${C.border1}`, fontSize: FONT, minWidth: 0 } }, h(Clamp, { t, text: str(r.text), lines: 10 })),
3663
+ ),
3664
+ ),
3665
+ ),
3666
+ ),
3667
+ h(
3668
+ Section,
3669
+ { title: t('needTasks', { n: tasks.length }) },
3670
+ tasks.length === 0 ? h('div', { style: { fontSize: SMALL, color: C.faint } }, '—') : h(TaskList, { rows: tasks.map((r) => h(TaskRow, { key: r.id, t, row: r, onOpen: onOpenTask })) }),
3671
+ ),
3672
+ ),
3673
+ ),
3674
+ confirm
3675
+ ? h(Confirm, {
3676
+ t,
3677
+ title: t('needDropTitle', { title: str(v.title) }),
3678
+ body: t('needDropBody'),
3679
+ confirmLabel: t('needDrop'),
3680
+ onClose: () => setConfirm(false),
3681
+ onConfirm: () => {
3682
+ setConfirm(false);
3683
+ void post('drop', {}, t('needDropped'));
3684
+ },
3685
+ })
3686
+ : null,
3687
+ );
3688
+ }
3689
+
3386
3690
  /** One task: who does it and for whom, where it came from, the reports, its usage, and what you can do with it. */
3387
3691
  function TicketDetail({ t, id, env, toast, onBack }) {
3388
3692
  const { data, failed, reload } = useJson(`tickets/${encodeURIComponent(id)}`, STATE_POLL_MS);
@@ -3866,7 +4170,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
3866
4170
  /**
3867
4171
  * The tool lists after switching one ability of a router dispatcher. An ability made only of tools a
3868
4172
  * router goes without (commands, sub-agents, images, Office) is switched through `routerAllow`, so it
3869
- * keeps its own setting for hands-on mode. One with other tools too (files) switches as before and
4173
+ * keeps its own setting for when the dispatcher works alone. One with other tools too (files) switches as before and
3870
4174
  * comes back with the router's default; its writing tools are allowed back on their own.
3871
4175
  */
3872
4176
  function toggleRouterAbility(draft, ab, on, routerDeny) {
@@ -3880,58 +4184,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
3880
4184
  for (const x of [...(ab.tools ?? []), ...gated]) allow.delete(x);
3881
4185
  return { deny: whole ? draft.deny : toggleAbility(draft.deny, ab, false), routerAllow: sorted(allow) };
3882
4186
  }
3883
- /** How the dispatcher works: only hand out (router) or also do small things itself (hands-on). A team setting. */
3884
- function DispatcherMode({ t, name, toast }) {
3885
- const mode = dispatcherOf();
3886
- const [busy, setBusy] = useState(false);
3887
- const choose = (next) => {
3888
- if (busy || next === mode) return;
3889
- setBusy(true);
3890
- postJson('settings', { patch: { dispatcher: next } })
3891
- .then((r) => {
3892
- if (r?.ok) {
3893
- tookSettings(r.settings && typeof r.settings === 'object' ? r.settings : { ...(store.settings?.settings ?? {}), dispatcher: next });
3894
- toast(t(next === 'hands-on' ? 'modeSavedHandsOn' : 'modeSavedRouter', { name }));
3895
- void refreshState();
3896
- } else toast(r?.reason || t('saveFailed'), 'error');
3897
- })
3898
- .finally(() => setBusy(false));
3899
- };
3900
- const option = (id, title, body) => {
3901
- const on = mode === id;
3902
- return h(
3903
- 'button',
3904
- {
3905
- key: id,
3906
- type: 'button',
3907
- role: 'radio',
3908
- 'aria-checked': on,
3909
- className: 'dshb-row',
3910
- 'data-active': on,
3911
- 'data-dsh-bots-dispatcher-mode': id,
3912
- disabled: busy,
3913
- onClick: () => choose(id),
3914
- style: { alignItems: 'flex-start', gap: 10, padding: '10px 12px', border: `1px solid ${on ? C.label : C.border1}`, background: on ? tint(C.label, 8) : C.layer1 },
3915
- },
3916
- h('span', { style: { width: 16, height: 16, marginTop: 1, borderRadius: '50%', border: `2px solid ${on ? C.label : C.border}`, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flex: 'none' } }, on ? h('span', { style: { width: 7, height: 7, borderRadius: '50%', background: C.label } }) : null),
3917
- h('span', { style: { display: 'flex', flexDirection: 'column', gap: 2, minWidth: 0 } }, h('span', { style: { fontWeight: 600 } }, title), h('span', { style: { fontSize: TINY, color: C.muted, lineHeight: 1.5 } }, body)),
3918
- );
3919
- };
3920
- return h(
3921
- 'div',
3922
- { style: { display: 'flex', flexDirection: 'column', gap: 8 } },
3923
- h(
3924
- 'div',
3925
- { role: 'radiogroup', 'aria-label': t('dispatcherMode'), 'data-dsh-bots-dispatcher-modes': mode, style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', gap: 10 } },
3926
- option('router', t('modeRouter'), t('modeRouterBody')),
3927
- option('hands-on', t('modeHandsOn'), t('modeHandsOnBody')),
3928
- ),
3929
- // Router mode asked for, but nobody to hand work to yet.
3930
- mode === 'router' && !routerActiveOf()
3931
- ? h('div', { 'data-dsh-bots-router-waiting': true, style: { display: 'flex', alignItems: 'flex-start', gap: 6, fontSize: TINY, color: C.muted, lineHeight: 1.5 } }, h('span', { style: { color: C.warn, display: 'inline-flex', paddingTop: 1 } }, Icon.alert(12)), t('routerWaiting', { name }))
3932
- : null,
3933
- );
3934
- }
3935
4187
  const ABILITY_ICON = {
3936
4188
  web: () => Icon.search(15),
3937
4189
  files: () => Icon.edit(15),
@@ -4068,7 +4320,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
4068
4320
  h(Field, { label: t('bio'), hint: t('bioHint'), style: { gridColumn: '1 / -1' } }, h(Input, { value: draft.bio, maxLength: 160, placeholder: t('bioPlaceholder'), onChange: (e) => set({ bio: e.target.value }) })),
4069
4321
  ),
4070
4322
  ),
4071
- isPrimary ? h(Section, { title: t('dispatcherMode'), hint: t('dispatcherModeHint') }, h(DispatcherMode, { t, name: botLabel, toast })) : null,
4072
4323
  h(
4073
4324
  Section,
4074
4325
  { title: t('persona'), hint: t('personaHint') },
@@ -7407,6 +7658,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
7407
7658
  const [primaryTick, setPrimaryTick] = useState(true);
7408
7659
  const [settings, setSettings] = useState(false);
7409
7660
  const [ticketId, setTicketId] = useState(null); // the task shown in the Tasks view
7661
+ const [needId, setNeedId] = useState(null); // the request shown in the Requests view
7410
7662
  const [tasksBot, setTasksBot] = useState(''); // the Tasks view's bot filter when another view asked for it
7411
7663
  const [noticeGone, setNoticeGone] = useState(false);
7412
7664
  const [toast, showToast] = useToast();
@@ -7421,6 +7673,9 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
7421
7673
  setView('tasks');
7422
7674
  setTicketId(s.nav.ticket ?? null);
7423
7675
  setTasksBot(s.nav.ticket ? '' : (s.nav.botId ?? ''));
7676
+ } else if (s.nav.view === 'needs') {
7677
+ setView('needs');
7678
+ setNeedId(s.nav.ticket ?? null);
7424
7679
  } else if (s.nav.view === 'activity') setView('activity');
7425
7680
  else if (s.nav.botId) {
7426
7681
  setSelected(s.nav.botId);
@@ -7452,6 +7707,13 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
7452
7707
  let main;
7453
7708
  if (!s.state) {
7454
7709
  main = h('div', { style: { flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.faint, fontSize: SMALL } }, s.failed ? t('unavailable') : t('loading'));
7710
+ } else if (shownView === 'needs') {
7711
+ const toTask = (id) => {
7712
+ setView('tasks');
7713
+ setTasksBot('');
7714
+ setTicketId(id ?? null);
7715
+ };
7716
+ main = needId ? h(NeedDetail, { key: needId, t, id: needId, toast: showToast, onBack: () => setNeedId(null), onOpenTask: toTask }) : h(NeedsView, { t, onOpen: setNeedId, onTasks: () => toTask(null) });
7455
7717
  } else if (shownView === 'tasks') {
7456
7718
  main = ticketId ? h(TicketDetail, { key: ticketId, t, id: ticketId, env: env2, toast: showToast, onBack: () => setTicketId(null) }) : h(TasksView, { t, bots, focusBot: tasksBot, onOpen: setTicketId });
7457
7719
  } else if (shownView === 'activity') {
@@ -7494,6 +7756,11 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
7494
7756
  },
7495
7757
  attention: Array.isArray(s.state?.attention) ? s.state.attention.length : 0,
7496
7758
  openTasks: bots.reduce((n, b) => n + openTaskCount(b), 0),
7759
+ onNeeds: () => {
7760
+ setView('needs');
7761
+ setNeedId(null);
7762
+ },
7763
+ needCounts: s.state?.needs ?? {},
7497
7764
  }),
7498
7765
  h(
7499
7766
  'div',
@@ -8418,6 +8685,52 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
8418
8685
  askingBadge: '{n} waiting for your answer',
8419
8686
  askingChip: 'Asks you',
8420
8687
  tasksInProgress: '{n} in progress',
8688
+ // requests (needs, Bots 0.11)
8689
+ needs: 'Requests',
8690
+ needsHint: 'What you asked for',
8691
+ needsWaitingHint: '{n} waiting for you',
8692
+ needsWorkingHint: '{n} in progress',
8693
+ needsSub: 'Everything you asked the team for, in a line, and how far each got. The tasks behind each are one click away.',
8694
+ needsYou: 'Waiting for you',
8695
+ needsYouEmpty: 'Nothing waits for you.',
8696
+ needsWorking: 'In progress',
8697
+ needsWorkingEmpty: 'Nothing is in progress.',
8698
+ needsDone: 'Done',
8699
+ needsDoneEmpty: 'Nothing delivered yet.',
8700
+ needsShowStopped: 'Show dropped ({n})',
8701
+ needsHideStopped: 'Hide dropped',
8702
+ needsEmptyTitle: 'No requests yet',
8703
+ needsEmptyBody: 'Ask your dispatcher for something in the chat. Each request shows up here in a line, with how far the team got.',
8704
+ needsUnavailable: 'Could not load your requests.',
8705
+ needsWeek: 'This week: {n} requests · {done} done · {working} in progress · {waiting} waiting for you',
8706
+ needsAllTasks: 'All tasks',
8707
+ need_waiting: 'Waiting for you',
8708
+ need_working: 'In progress',
8709
+ need_failed: 'Not done',
8710
+ need_done: 'Done',
8711
+ need_stopped: 'Dropped',
8712
+ needWorkingOf: '{done}/{total} done',
8713
+ needSomeFailed: '{n} of its tasks did not get done',
8714
+ needSomeStalled: '{n} of its tasks got stuck',
8715
+ needDelivered: 'delivered {when}',
8716
+ needAsked: 'asked {when}',
8717
+ needYouSaid: 'You said: {text}',
8718
+ allNeeds: 'All requests',
8719
+ needMissing: 'This request is not available.',
8720
+ needYourWords: 'What you said',
8721
+ needAutoHint: 'Titled with your own words: the dispatcher did not restate it.',
8722
+ needResults: 'What was delivered',
8723
+ needNoResults: 'Nothing delivered yet.',
8724
+ needTasks: 'The tasks behind it ({n})',
8725
+ needQuestion: '{name} asks:',
8726
+ needAnswer: 'Answer',
8727
+ needRename: 'Rename',
8728
+ needRenamed: 'Renamed.',
8729
+ needTitleLabel: 'Title',
8730
+ needDrop: 'Drop it',
8731
+ needDropTitle: 'Drop “{title}”?',
8732
+ needDropBody: 'Its unfinished tasks stop, and it shows as dropped.',
8733
+ needDropped: 'Dropped.',
8421
8734
  tasksSub: 'Work your bots have taken on. Each task runs in its own conversation, so several move at once.',
8422
8735
  tasksNeeds: 'Needs you',
8423
8736
  tasksNeedsEmpty: 'Nothing needs you right now.',
@@ -8490,27 +8803,18 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
8490
8803
  botNoOpenTasks: '{name} has no open tasks.',
8491
8804
  toolReport: 'Report',
8492
8805
  requesterShort: 'whoever asked',
8493
- // the dispatcher's mode
8494
- dispatcherMode: 'How it works',
8495
- dispatcherModeHint: 'For the whole team. Each piece of work the dispatcher hands out becomes a task with its own conversation.',
8496
- modeRouter: 'Router',
8497
- modeRouterBody: 'Understands, hands out, reports. Teammates do the work.',
8498
- modeHandsOn: 'Hands-on',
8499
- modeHandsOnBody: 'Also does small things itself, as before.',
8500
- modeSavedRouter: '{name} now only hands out the work.',
8501
- modeSavedHandsOn: '{name} does small things itself again.',
8502
- routerModelHint: 'In Router mode it only understands, hands out and reports, so a light, fast model is enough, and every request stays quick and cheap.',
8503
- routerWaiting: 'Router mode starts once the team has another bot; until then {name} does the work itself.',
8504
- abilitiesRouterHint: 'What {name} can do with the Harness’s built-in tools. In Router mode it does not search the web, run commands, write files, use sub-agents, draw, make Office files or put question cards to you (a card holds every message after it until you answer); turn one back on below if it needs it.',
8505
- routerOff: 'Off in Router mode',
8806
+ // the dispatcher
8807
+ routerModelHint: 'It only understands, hands out and reports, so a light, fast model is enough, and every request stays quick and cheap.',
8808
+ abilitiesRouterHint: 'What {name} can do with the Harness’s built-in tools. As the dispatcher it does not search the web, run commands, write files, use sub-agents, draw, make Office files or put question cards to you (a card holds every message after it until you answer); turn one back on below if it needs it.',
8809
+ routerOff: 'Off for dispatching',
8506
8810
  teamOff: 'Off for the dispatcher',
8507
8811
  teamOffHint: 'The dispatcher hands work in parallel to its teammates, so the panel shows it as their tasks. The other bots keep sub-agents.',
8508
- routerPartOff: 'Partly off in Router mode',
8509
- routerAllowed: 'On in Router mode',
8812
+ routerPartOff: 'Partly off for dispatching',
8813
+ routerAllowed: 'On for dispatching',
8510
8814
  routerAllowBack: 'Turn back on',
8511
- routerOffShort: 'off in Router mode',
8815
+ routerOffShort: 'off for dispatching',
8512
8816
  routerNoticeTitle: 'Your dispatcher now hands out the work',
8513
- routerNoticeBody: 'It listens, hands each request to a teammate as a task and reports back; every task runs in its own conversation, so several can move at once. To let it do small jobs itself again, open its profile and set How it works to Hands-on.',
8817
+ routerNoticeBody: 'It listens, hands each request to a teammate as a task and reports back; every task runs in its own conversation, so several can move at once. To let it do a small job itself (a quick web search, say), turn that ability on under Abilities on its profile.',
8514
8818
  routerNoticeOpen: 'Open its profile',
8515
8819
  routerNoticeOk: 'Got it',
8516
8820
  setTasks: 'Tasks',
@@ -9305,6 +9609,52 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
9305
9609
  askingBadge: '{n} 个问题等你回答',
9306
9610
  askingChip: '在问你',
9307
9611
  tasksInProgress: '{n} 个进行中',
9612
+ // requests (needs, Bots 0.11)
9613
+ needs: '需求',
9614
+ needsHint: '你提的每件事',
9615
+ needsWaitingHint: '{n} 个等你处理',
9616
+ needsWorkingHint: '{n} 个进行中',
9617
+ needsSub: '你交给团队的每件事,一句话说清楚要什么、做到哪一步了。每件事背后的任务点开就能看到。',
9618
+ needsYou: '等你处理',
9619
+ needsYouEmpty: '没有要你处理的事。',
9620
+ needsWorking: '进行中',
9621
+ needsWorkingEmpty: '没有进行中的事。',
9622
+ needsDone: '已完成',
9623
+ needsDoneEmpty: '还没有交付的事。',
9624
+ needsShowStopped: '显示已取消的({n})',
9625
+ needsHideStopped: '收起已取消的',
9626
+ needsEmptyTitle: '还没有需求',
9627
+ needsEmptyBody: '在聊天里交给调度者一件事,它就会出现在这里:一句话说清楚要什么,以及团队做到了哪一步。',
9628
+ needsUnavailable: '没能加载需求。',
9629
+ needsWeek: '本周 {n} 个需求 · 完成 {done} · 进行中 {working} · 等你 {waiting}',
9630
+ needsAllTasks: '全部任务',
9631
+ need_waiting: '等你处理',
9632
+ need_working: '进行中',
9633
+ need_failed: '没做成',
9634
+ need_done: '已完成',
9635
+ need_stopped: '已取消',
9636
+ needWorkingOf: '完成 {done}/{total}',
9637
+ needSomeFailed: '其中 {n} 项没做成',
9638
+ needSomeStalled: '其中 {n} 项卡住了',
9639
+ needDelivered: '{when}交付',
9640
+ needAsked: '{when}提出',
9641
+ needYouSaid: '你说的:{text}',
9642
+ allNeeds: '全部需求',
9643
+ needMissing: '这个需求不可用。',
9644
+ needYourWords: '你的原话',
9645
+ needAutoHint: '标题取自你的原话,调度者没有另外转述。',
9646
+ needResults: '交付的结果',
9647
+ needNoResults: '还没有交付。',
9648
+ needTasks: '背后的任务({n})',
9649
+ needQuestion: '{name} 在问:',
9650
+ needAnswer: '去回答',
9651
+ needRename: '改标题',
9652
+ needRenamed: '标题已更新。',
9653
+ needTitleLabel: '标题',
9654
+ needDrop: '不用做了',
9655
+ needDropTitle: '不做「{title}」了?',
9656
+ needDropBody: '它下面还没完成的任务会停下,这件事算作已取消。',
9657
+ needDropped: '已取消。',
9308
9658
  tasksSub: 'Bot 们接手的工作。每个任务在自己的会话里进行,几件事可以同时推进。',
9309
9659
  tasksNeeds: '需要你处理',
9310
9660
  tasksNeedsEmpty: '现在没有需要你处理的。',
@@ -9377,27 +9727,18 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
9377
9727
  botNoOpenTasks: '{name} 手上没有进行中的任务。',
9378
9728
  toolReport: '汇报',
9379
9729
  requesterShort: '发起方',
9380
- // the dispatcher's mode
9381
- dispatcherMode: '调度方式',
9382
- dispatcherModeHint: '对整个团队生效。调度者分出去的每件工作都是一个任务,有自己的会话。',
9383
- modeRouter: '只调度',
9384
- modeRouterBody: '听懂、分派、汇报,具体工作交给队友。',
9385
- modeHandsOn: '亲自动手',
9386
- modeHandsOnBody: '小事自己顺手做掉,和以前一样。',
9387
- modeSavedRouter: '{name} 现在只负责分派。',
9388
- modeSavedHandsOn: '{name} 又会自己做小事了。',
9389
- routerModelHint: '只调度时它只负责听懂、分派、汇报,用轻量、快速的模型就够了,每次请求都更快、更省。',
9390
- routerWaiting: '团队里再有一个 Bot 后才开始只调度,在此之前 {name} 自己动手。',
9391
- abilitiesRouterHint: '{name} 能用 Harness 内置工具做哪些事。只调度时它不联网、不执行命令、不写文件、不用子代理、不作图、不做 Office 文档,也不弹提问卡片(卡片没答之前,后面的消息都得排队);确实需要时可以在下面逐项打开。',
9392
- routerOff: '只调度时关闭',
9730
+ // the dispatcher
9731
+ routerModelHint: '它只负责听懂、分派、汇报,用轻量、快速的模型就够了,每次请求都更快、更省。',
9732
+ abilitiesRouterHint: '{name} 能用 Harness 内置工具做哪些事。作为调度者,它不联网、不执行命令、不写文件、不用子代理、不作图、不做 Office 文档,也不弹提问卡片(卡片没答之前,后面的消息都得排队);确实需要时可以在下面逐项打开。',
9733
+ routerOff: '调度时关闭',
9393
9734
  teamOff: '调度员不用',
9394
9735
  teamOffHint: '调度员把要并行的活交给队友,面板里能看到他们各自的任务;其他 bot 照常可以用子代理。',
9395
- routerPartOff: '只调度时部分关闭',
9396
- routerAllowed: '只调度时也可用',
9736
+ routerPartOff: '调度时部分关闭',
9737
+ routerAllowed: '调度时也可用',
9397
9738
  routerAllowBack: '重新打开',
9398
- routerOffShort: '只调度时关闭',
9739
+ routerOffShort: '调度时关闭',
9399
9740
  routerNoticeTitle: '调度者现在只负责分派',
9400
- routerNoticeBody: '它会听懂请求、把每件事作为任务交给队友并汇报结果;每个任务在自己的会话里进行,几件事可以同时推进。想让它像以前一样顺手做小事,打开它的资料页,把「调度方式」改成「亲自动手」。',
9741
+ routerNoticeBody: '它会听懂请求、把每件事作为任务交给队友并汇报结果;每个任务在自己的会话里进行,几件事可以同时推进。想让它顺手做些小事(比如联网查一下),在它资料页的「能力」里把那一项打开。',
9401
9742
  routerNoticeOpen: '打开它的资料页',
9402
9743
  routerNoticeOk: '知道了',
9403
9744
  setTasks: '任务',