@kadaliao/dsh-bots 0.10.2 → 0.11.1
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/README.md +99 -43
- package/README.zh-CN.md +70 -29
- package/client.js +568 -148
- package/index.js +394 -72
- package/lib/needs.mjs +400 -0
- package/lib/prompt.mjs +46 -10
- package/lib/settings.mjs +15 -5
- package/lib/team-migration.mjs +79 -0
- package/lib/teams-0.11.mjs +299 -0
- package/lib/teams.mjs +92 -92
- package/lib/watchdog.mjs +13 -0
- package/package.json +1 -1
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.
|
|
24
|
+
const BOTS_VERSION = '0.11.1';
|
|
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:
|
|
381
|
-
*
|
|
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) =>
|
|
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']),
|
|
@@ -1158,28 +1152,35 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
1158
1152
|
|
|
1159
1153
|
// --- the panel: left rail ----------------------------------------------------------
|
|
1160
1154
|
|
|
1161
|
-
/**
|
|
1155
|
+
/**
|
|
1156
|
+
* Bots grouped by `team` (team order = first appearance), with the dispatcher on its own on top:
|
|
1157
|
+
* it belongs to no team, it hands out the work of all of them. Null when no bot has a team.
|
|
1158
|
+
*/
|
|
1162
1159
|
function groupByTeam(t, lang, bots) {
|
|
1163
1160
|
if (!bots.some((b) => b.team)) return null;
|
|
1164
1161
|
const groups = [];
|
|
1165
1162
|
for (const b of bots) {
|
|
1166
|
-
const id = b.team || '';
|
|
1163
|
+
const id = b.role === 'primary' ? 'desk' : b.team || '';
|
|
1167
1164
|
let g = groups.find((x) => x.id === id);
|
|
1168
1165
|
if (!g) groups.push((g = { id, bots: [] }));
|
|
1169
1166
|
g.bots.push(b);
|
|
1170
1167
|
}
|
|
1171
1168
|
const label = (id) => {
|
|
1169
|
+
if (id === 'desk') return t('dispatcher');
|
|
1172
1170
|
if (!id) return t('otherBots');
|
|
1173
1171
|
const team = teamsOf().find((x) => x.id === id);
|
|
1174
1172
|
return team ? pick(team.name, lang) : id;
|
|
1175
1173
|
};
|
|
1176
|
-
|
|
1174
|
+
const rank = (g) => (g.id === 'desk' ? 0 : g.id === '' ? 2 : 1);
|
|
1175
|
+
return groups.sort((a, b) => rank(a) - rank(b)).map((g) => ({ ...g, label: label(g.id) }));
|
|
1177
1176
|
}
|
|
1178
1177
|
|
|
1179
1178
|
/** A red count of what needs you (tasks, or a bot's questions). */
|
|
1180
1179
|
const NeedsBadge = ({ n, label, attr }) =>
|
|
1181
1180
|
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 }) {
|
|
1181
|
+
function Rail({ t, bots, primaryId, selected, onSelect, onNew, onTeams, view, onActivity, messageCount, onUsage, onMemory, onSettings, teamNotes, onTasks, attention = 0, openTasks = 0, onNeeds, needCounts = {} }) {
|
|
1182
|
+
const needsWaiting = Number(needCounts?.waiting) || 0;
|
|
1183
|
+
const needsWorking = Number(needCounts?.working) || 0;
|
|
1183
1184
|
const lang = langOf(t);
|
|
1184
1185
|
const [q, setQ] = useState('');
|
|
1185
1186
|
const [menu, setMenu] = useState(false);
|
|
@@ -1268,6 +1269,21 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
1268
1269
|
h(
|
|
1269
1270
|
'div',
|
|
1270
1271
|
{ style: { padding: 8, borderTop: `1px solid ${C.border1}` } },
|
|
1272
|
+
// What you asked for (Bots 0.11), above the tasks that do it.
|
|
1273
|
+
onNeeds
|
|
1274
|
+
? h(
|
|
1275
|
+
'button',
|
|
1276
|
+
{ type: 'button', className: 'dshb-row', 'data-active': view === 'needs', 'data-dsh-bots-needs-entry': true, onClick: onNeeds },
|
|
1277
|
+
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)),
|
|
1278
|
+
h(
|
|
1279
|
+
'span',
|
|
1280
|
+
{ style: { display: 'flex', flexDirection: 'column', flex: 1, minWidth: 0 } },
|
|
1281
|
+
h('span', { style: { fontWeight: 600 } }, t('needs')),
|
|
1282
|
+
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')),
|
|
1283
|
+
),
|
|
1284
|
+
needsWaiting > 0 ? h(NeedsBadge, { n: needsWaiting, label: t('needsWaitingHint', { n: needsWaiting }), attr: 'data-dsh-bots-needs-badge' }) : null,
|
|
1285
|
+
)
|
|
1286
|
+
: null,
|
|
1271
1287
|
onTasks
|
|
1272
1288
|
? h(
|
|
1273
1289
|
'button',
|
|
@@ -3383,6 +3399,299 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
3383
3399
|
);
|
|
3384
3400
|
}
|
|
3385
3401
|
|
|
3402
|
+
// --- needs: what the person asked for, one level above the tasks (Bots 0.11) ------------------
|
|
3403
|
+
|
|
3404
|
+
const NEED_COLOR = { waiting: C.warn, working: C.ok, failed: C.error, done: C.label, stopped: C.muted };
|
|
3405
|
+
/** 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. */
|
|
3406
|
+
const needGroupOf = (r) => (r?.status === 'waiting' || r?.status === 'failed' ? 'needs' : r?.status === 'done' ? 'done' : r?.status === 'stopped' ? 'stopped' : 'working');
|
|
3407
|
+
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));
|
|
3408
|
+
const needRows = (data) => (Array.isArray(data?.items) ? data.items : []).filter((r) => r && typeof r.id === 'string' && typeof r.status === 'string');
|
|
3409
|
+
/** A need's status as a badge; one in progress with several tasks says how many are done. */
|
|
3410
|
+
function NeedChip({ t, row }) {
|
|
3411
|
+
const color = NEED_COLOR[row?.status] ?? C.muted;
|
|
3412
|
+
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'}`);
|
|
3413
|
+
return h(Badge, { color, 'data-dsh-bots-need-status': row?.status }, row?.status === 'working' ? h(StatusDot, { status: 'running', size: 6 }) : null, label);
|
|
3414
|
+
}
|
|
3415
|
+
/** One need on the board: what you asked for, how far it got, who works on it, and the latest word. */
|
|
3416
|
+
function NeedRow({ t, row, onOpen }) {
|
|
3417
|
+
const latest = row.latest && typeof row.latest === 'object' && str(row.latest.preview).trim() ? row.latest : null;
|
|
3418
|
+
const bots = (Array.isArray(row.bots) ? row.bots : []).filter((b) => typeof b === 'string').slice(0, 4);
|
|
3419
|
+
const when = row.status === 'done' && row.endedAt ? t('needDelivered', { when: fmtAgo(t, row.endedAt) }) : fmtAgo(t, row.updatedAt);
|
|
3420
|
+
return h(
|
|
3421
|
+
'button',
|
|
3422
|
+
{ 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' } },
|
|
3423
|
+
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)),
|
|
3424
|
+
h(
|
|
3425
|
+
'span',
|
|
3426
|
+
{ style: { display: 'flex', flexDirection: 'column', gap: 4, flex: 1, minWidth: 0 } },
|
|
3427
|
+
h(
|
|
3428
|
+
'span',
|
|
3429
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 8, minWidth: 0 } },
|
|
3430
|
+
h('span', { style: { fontWeight: 600, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0, flex: 1 } }, str(row.title).trim() || t('untitledTask')),
|
|
3431
|
+
h(NeedChip, { t, row }),
|
|
3432
|
+
),
|
|
3433
|
+
h(
|
|
3434
|
+
'span',
|
|
3435
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: TINY, color: C.muted, minWidth: 0, flexWrap: 'wrap' } },
|
|
3436
|
+
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,
|
|
3437
|
+
bots.length ? h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: 220 } }, bots.map((b) => botName(t, b)).join('、')) : null,
|
|
3438
|
+
bots.length ? dotSep() : null,
|
|
3439
|
+
viaBadge(t, row.via, row.who),
|
|
3440
|
+
h('span', { style: { color: C.faint }, title: fmtDate(toMs(row.updatedAt)) }, when),
|
|
3441
|
+
),
|
|
3442
|
+
latest
|
|
3443
|
+
? h(
|
|
3444
|
+
'span',
|
|
3445
|
+
{ 'data-dsh-bots-need-latest': latest.status, style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: TINY, color: C.muted, minWidth: 0 } },
|
|
3446
|
+
// A delivered need says "done" once, on its own chip.
|
|
3447
|
+
row.status === 'done' ? null : h(ReportChip, { t, status: latest.status }),
|
|
3448
|
+
h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 } }, str(latest.preview)),
|
|
3449
|
+
)
|
|
3450
|
+
: str(row.asked).trim()
|
|
3451
|
+
? h('span', { style: { fontSize: TINY, color: C.faint, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 } }, t('needYouSaid', { text: str(row.asked) }))
|
|
3452
|
+
: null,
|
|
3453
|
+
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,
|
|
3454
|
+
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,
|
|
3455
|
+
),
|
|
3456
|
+
);
|
|
3457
|
+
}
|
|
3458
|
+
/** Every request of the person's: what waits for them, what moves, what was delivered (the tasks stay one level down). */
|
|
3459
|
+
function NeedsView({ t, onOpen, onTasks }) {
|
|
3460
|
+
const { data, failed } = useJson('needs?limit=300', STATE_POLL_MS);
|
|
3461
|
+
const [doneShown, setDoneShown] = useState(DONE_PAGE);
|
|
3462
|
+
const [showStopped, setShowStopped] = useState(false);
|
|
3463
|
+
const items = needRows(data);
|
|
3464
|
+
const byNewest = (a, b) => (toMs(b.updatedAt) || 0) - (toMs(a.updatedAt) || 0);
|
|
3465
|
+
const groups = [
|
|
3466
|
+
{ id: 'needs', title: t('needsYou'), empty: t('needsYouEmpty') },
|
|
3467
|
+
{ id: 'working', title: t('needsWorking'), empty: t('needsWorkingEmpty') },
|
|
3468
|
+
{ id: 'done', title: t('needsDone'), empty: t('needsDoneEmpty') },
|
|
3469
|
+
].map((g) => ({ ...g, rows: items.filter((r) => needGroupOf(r) === g.id).sort(byNewest) }));
|
|
3470
|
+
const stopped = items.filter((r) => needGroupOf(r) === 'stopped').sort(byNewest);
|
|
3471
|
+
const doneCount = groups[2].rows.length;
|
|
3472
|
+
groups[2].rows = groups[2].rows.slice(0, doneShown);
|
|
3473
|
+
// This week, as the person counts it: what they asked for since, and where it stands.
|
|
3474
|
+
const since = Date.now() - 7 * 86_400_000;
|
|
3475
|
+
const week = items.filter((r) => (toMs(r.createdAt) || 0) >= since);
|
|
3476
|
+
const weekOf = (fn) => week.filter(fn).length;
|
|
3477
|
+
let body;
|
|
3478
|
+
if (!data && items.length === 0) body = h('div', { style: { padding: 24, color: C.faint, fontSize: SMALL, textAlign: 'center' } }, failed ? t('needsUnavailable') : t('loading'));
|
|
3479
|
+
else if (items.length === 0) body = h(Empty, { icon: Icon.target(28), title: t('needsEmptyTitle'), body: t('needsEmptyBody') });
|
|
3480
|
+
else {
|
|
3481
|
+
body = h(
|
|
3482
|
+
'div',
|
|
3483
|
+
{ style: { display: 'flex', flexDirection: 'column', gap: 24 } },
|
|
3484
|
+
week.length
|
|
3485
|
+
? h(
|
|
3486
|
+
'div',
|
|
3487
|
+
{ 'data-dsh-bots-needs-week': week.length, style: { fontSize: SMALL, color: C.muted } },
|
|
3488
|
+
t('needsWeek', { n: week.length, done: weekOf((r) => r.status === 'done'), working: weekOf((r) => r.status === 'working'), waiting: weekOf((r) => needGroupOf(r) === 'needs') }),
|
|
3489
|
+
)
|
|
3490
|
+
: null,
|
|
3491
|
+
groups.map((g) =>
|
|
3492
|
+
h(
|
|
3493
|
+
'div',
|
|
3494
|
+
{ key: g.id, 'data-dsh-bots-need-group': g.id, 'data-count': g.rows.length },
|
|
3495
|
+
h(
|
|
3496
|
+
Section,
|
|
3497
|
+
{ title: [g.title, h('span', { key: 'n', style: { marginLeft: 6, fontWeight: 500, color: C.faint } }, g.id === 'done' ? doneCount : g.rows.length)] },
|
|
3498
|
+
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 })) }),
|
|
3499
|
+
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,
|
|
3500
|
+
),
|
|
3501
|
+
),
|
|
3502
|
+
),
|
|
3503
|
+
stopped.length
|
|
3504
|
+
? h(
|
|
3505
|
+
'div',
|
|
3506
|
+
{ 'data-dsh-bots-need-group': 'stopped', 'data-count': stopped.length },
|
|
3507
|
+
h(Btn, { size: 'sm', kind: 'ghost', onClick: () => setShowStopped((x) => !x), 'data-dsh-bots-needs-stopped': true }, showStopped ? t('needsHideStopped') : t('needsShowStopped', { n: stopped.length })),
|
|
3508
|
+
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,
|
|
3509
|
+
)
|
|
3510
|
+
: null,
|
|
3511
|
+
);
|
|
3512
|
+
}
|
|
3513
|
+
return h(
|
|
3514
|
+
'div',
|
|
3515
|
+
{ 'data-dsh-bots-needs': true, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 } },
|
|
3516
|
+
h(
|
|
3517
|
+
'div',
|
|
3518
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 12, padding: '18px 24px 12px', borderBottom: `1px solid ${C.border1}` } },
|
|
3519
|
+
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)),
|
|
3520
|
+
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'))),
|
|
3521
|
+
onTasks ? h(Btn, { size: 'sm', kind: 'ghost', icon: Icon.tasks(13), onClick: onTasks, 'data-dsh-bots-needs-tasks': true }, t('needsAllTasks')) : null,
|
|
3522
|
+
),
|
|
3523
|
+
h('div', { className: 'dshb-scroll', style: { flex: 1, padding: '18px 24px 28px' } }, h('div', { style: { maxWidth: 900, margin: '0 auto' } }, body)),
|
|
3524
|
+
);
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
/** One request: what you said, what was delivered, what waits for you, and the tasks behind it. */
|
|
3528
|
+
function NeedDetail({ t, id, toast, onBack, onOpenTask }) {
|
|
3529
|
+
const { data, failed, reload } = useJson(`needs/${encodeURIComponent(id)}`, STATE_POLL_MS);
|
|
3530
|
+
const [confirm, setConfirm] = useState(false);
|
|
3531
|
+
const [draft, setDraft] = useState(null);
|
|
3532
|
+
const [busy, setBusy] = useState(false);
|
|
3533
|
+
const v = data && typeof data === 'object' && typeof data.id === 'string' ? data : null;
|
|
3534
|
+
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'));
|
|
3535
|
+
if (!v) {
|
|
3536
|
+
return h(
|
|
3537
|
+
'div',
|
|
3538
|
+
{ 'data-dsh-bots-need-detail': id, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0, padding: '18px 24px' } },
|
|
3539
|
+
back,
|
|
3540
|
+
h('div', { style: { padding: 24, color: C.faint, fontSize: SMALL, textAlign: 'center' } }, failed ? t('needMissing') : t('loading')),
|
|
3541
|
+
);
|
|
3542
|
+
}
|
|
3543
|
+
const post = (path, body, okText) => {
|
|
3544
|
+
if (busy) return Promise.resolve(false);
|
|
3545
|
+
setBusy(true);
|
|
3546
|
+
return postJson(`needs/${encodeURIComponent(v.id)}/${path}`, body)
|
|
3547
|
+
.then((r) => {
|
|
3548
|
+
if (r && r.ok !== false) {
|
|
3549
|
+
toast(okText);
|
|
3550
|
+
void reload();
|
|
3551
|
+
void refreshState();
|
|
3552
|
+
return true;
|
|
3553
|
+
}
|
|
3554
|
+
toast(r?.reason || t('actionFailed'), 'error');
|
|
3555
|
+
return false;
|
|
3556
|
+
})
|
|
3557
|
+
.finally(() => setBusy(false));
|
|
3558
|
+
};
|
|
3559
|
+
const saveTitle = () => {
|
|
3560
|
+
const title = str(draft).trim();
|
|
3561
|
+
if (!title) return;
|
|
3562
|
+
void post('rename', { title }, t('needRenamed')).then((ok) => ok && setDraft(null));
|
|
3563
|
+
};
|
|
3564
|
+
const asks = (Array.isArray(v.asks) ? v.asks : []).filter((a) => a && str(a.text).trim());
|
|
3565
|
+
const results = (Array.isArray(v.results) ? v.results : []).filter((r) => r && str(r.text).trim());
|
|
3566
|
+
const tasks = (Array.isArray(v.tickets) ? v.tickets : []).filter((r) => r && typeof r.id === 'string');
|
|
3567
|
+
const waiting = new Set(Array.isArray(v.waiting) ? v.waiting : []);
|
|
3568
|
+
const asking = v.latest && waiting.has(v.latest.ticket) ? v.latest : null;
|
|
3569
|
+
const open = v.status === 'waiting' || v.status === 'working' || v.status === 'failed';
|
|
3570
|
+
return h(
|
|
3571
|
+
'div',
|
|
3572
|
+
{ 'data-dsh-bots-need-detail': v.id, 'data-status': v.status, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 } },
|
|
3573
|
+
h(
|
|
3574
|
+
'header',
|
|
3575
|
+
{ style: { padding: '14px 24px 14px', borderBottom: `1px solid ${C.border1}`, display: 'flex', flexDirection: 'column', gap: 8 } },
|
|
3576
|
+
h('div', null, back),
|
|
3577
|
+
h(
|
|
3578
|
+
'div',
|
|
3579
|
+
{ style: { display: 'flex', alignItems: 'flex-start', gap: 12, flexWrap: 'wrap' } },
|
|
3580
|
+
h(
|
|
3581
|
+
'div',
|
|
3582
|
+
{ style: { flex: 1, minWidth: 240, display: 'flex', flexDirection: 'column', gap: 4 } },
|
|
3583
|
+
draft !== null
|
|
3584
|
+
? h(
|
|
3585
|
+
'div',
|
|
3586
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 6 } },
|
|
3587
|
+
h(Input, {
|
|
3588
|
+
value: draft,
|
|
3589
|
+
maxLength: 80,
|
|
3590
|
+
'aria-label': t('needTitleLabel'),
|
|
3591
|
+
'data-dsh-bots-need-title-input': true,
|
|
3592
|
+
onChange: (e) => setDraft(e.target.value),
|
|
3593
|
+
onKeyDown: (e) => {
|
|
3594
|
+
if (e.key === 'Enter' && !e.isComposing && !e.nativeEvent?.isComposing) saveTitle();
|
|
3595
|
+
if (e.key === 'Escape') setDraft(null);
|
|
3596
|
+
},
|
|
3597
|
+
style: { flex: 1, fontSize: 16, fontWeight: 600 },
|
|
3598
|
+
}),
|
|
3599
|
+
h(Btn, { kind: 'primary', size: 'sm', disabled: busy || !str(draft).trim(), onClick: saveTitle, 'data-dsh-bots-need-title-save': true }, t('save')),
|
|
3600
|
+
h(Btn, { size: 'sm', onClick: () => setDraft(null) }, t('cancel')),
|
|
3601
|
+
)
|
|
3602
|
+
: 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 })),
|
|
3603
|
+
h(
|
|
3604
|
+
'div',
|
|
3605
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: SMALL, color: C.muted, flexWrap: 'wrap' } },
|
|
3606
|
+
h('span', { title: fmtDate(toMs(v.createdAt)) }, t('needAsked', { when: fmtAgo(t, v.createdAt) })),
|
|
3607
|
+
viaBadge(t, v.via, v.who),
|
|
3608
|
+
v.status === 'done' && v.endedAt ? dotSep() : null,
|
|
3609
|
+
v.status === 'done' && v.endedAt ? h('span', { title: fmtDate(toMs(v.endedAt)) }, t('needDelivered', { when: fmtAgo(t, v.endedAt) })) : null,
|
|
3610
|
+
),
|
|
3611
|
+
v.auto ? h('div', { 'data-dsh-bots-need-auto': true, style: { fontSize: TINY, color: C.faint } }, t('needAutoHint')) : null,
|
|
3612
|
+
),
|
|
3613
|
+
h(
|
|
3614
|
+
'div',
|
|
3615
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' } },
|
|
3616
|
+
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,
|
|
3617
|
+
open ? h(Btn, { kind: 'danger', icon: Icon.stop(12), disabled: busy, onClick: () => setConfirm(true), 'data-dsh-bots-need-drop': v.id }, t('needDrop')) : null,
|
|
3618
|
+
),
|
|
3619
|
+
),
|
|
3620
|
+
),
|
|
3621
|
+
h(
|
|
3622
|
+
'div',
|
|
3623
|
+
{ className: 'dshb-scroll', style: { flex: 1, padding: '18px 24px 24px' } },
|
|
3624
|
+
h(
|
|
3625
|
+
'div',
|
|
3626
|
+
{ style: { maxWidth: 820, display: 'flex', flexDirection: 'column', gap: 22 } },
|
|
3627
|
+
asking
|
|
3628
|
+
? h(
|
|
3629
|
+
'div',
|
|
3630
|
+
{ '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) } },
|
|
3631
|
+
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) })),
|
|
3632
|
+
h(Clamp, { t, text: str(asking.preview), lines: 6, style: { fontSize: SMALL } }),
|
|
3633
|
+
h('div', null, h(Btn, { kind: 'primary', size: 'sm', onClick: () => onOpenTask(asking.ticket), 'data-dsh-bots-need-answer': asking.ticket }, t('needAnswer'))),
|
|
3634
|
+
)
|
|
3635
|
+
: null,
|
|
3636
|
+
h(
|
|
3637
|
+
Section,
|
|
3638
|
+
{ title: t('needYourWords') },
|
|
3639
|
+
asks.length === 0
|
|
3640
|
+
? h('div', { style: { fontSize: SMALL, color: C.faint } }, '—')
|
|
3641
|
+
: h(
|
|
3642
|
+
'div',
|
|
3643
|
+
{ 'data-dsh-bots-need-asks': asks.length, style: { display: 'flex', flexDirection: 'column', gap: 8 } },
|
|
3644
|
+
asks.map((a, i) =>
|
|
3645
|
+
h(
|
|
3646
|
+
'div',
|
|
3647
|
+
{ key: `${a.at}-${i}`, style: { display: 'flex', flexDirection: 'column', gap: 4 } },
|
|
3648
|
+
h('span', { style: { fontSize: TINY, color: C.faint }, title: fmtDate(toMs(a.at)) }, fmtAgo(t, a.at)),
|
|
3649
|
+
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 })),
|
|
3650
|
+
),
|
|
3651
|
+
),
|
|
3652
|
+
),
|
|
3653
|
+
),
|
|
3654
|
+
h(
|
|
3655
|
+
Section,
|
|
3656
|
+
{ title: t('needResults') },
|
|
3657
|
+
results.length === 0
|
|
3658
|
+
? h('div', { style: { fontSize: SMALL, color: C.faint } }, t('needNoResults'))
|
|
3659
|
+
: h(
|
|
3660
|
+
'div',
|
|
3661
|
+
{ 'data-dsh-bots-need-results': results.length, style: { display: 'flex', flexDirection: 'column', gap: 12 } },
|
|
3662
|
+
results.map((r, i) =>
|
|
3663
|
+
h(
|
|
3664
|
+
'div',
|
|
3665
|
+
{ key: `${r.at}-${i}`, style: { display: 'flex', flexDirection: 'column', gap: 5 } },
|
|
3666
|
+
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))),
|
|
3667
|
+
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 })),
|
|
3668
|
+
),
|
|
3669
|
+
),
|
|
3670
|
+
),
|
|
3671
|
+
),
|
|
3672
|
+
h(
|
|
3673
|
+
Section,
|
|
3674
|
+
{ title: t('needTasks', { n: tasks.length }) },
|
|
3675
|
+
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 })) }),
|
|
3676
|
+
),
|
|
3677
|
+
),
|
|
3678
|
+
),
|
|
3679
|
+
confirm
|
|
3680
|
+
? h(Confirm, {
|
|
3681
|
+
t,
|
|
3682
|
+
title: t('needDropTitle', { title: str(v.title) }),
|
|
3683
|
+
body: t('needDropBody'),
|
|
3684
|
+
confirmLabel: t('needDrop'),
|
|
3685
|
+
onClose: () => setConfirm(false),
|
|
3686
|
+
onConfirm: () => {
|
|
3687
|
+
setConfirm(false);
|
|
3688
|
+
void post('drop', {}, t('needDropped'));
|
|
3689
|
+
},
|
|
3690
|
+
})
|
|
3691
|
+
: null,
|
|
3692
|
+
);
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3386
3695
|
/** One task: who does it and for whom, where it came from, the reports, its usage, and what you can do with it. */
|
|
3387
3696
|
function TicketDetail({ t, id, env, toast, onBack }) {
|
|
3388
3697
|
const { data, failed, reload } = useJson(`tickets/${encodeURIComponent(id)}`, STATE_POLL_MS);
|
|
@@ -3674,6 +3983,48 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
3674
3983
|
);
|
|
3675
3984
|
}
|
|
3676
3985
|
|
|
3986
|
+
/**
|
|
3987
|
+
* The one-time notice (0.11.1) that team templates have no lead any more: the leads of teams
|
|
3988
|
+
* hired before that are not the dispatcher only pass its messages on. Remove them, or keep them.
|
|
3989
|
+
*/
|
|
3990
|
+
function OldLeadsBanner({ t, leads, desk, onDone, toast }) {
|
|
3991
|
+
const [busy, setBusy] = useState(false);
|
|
3992
|
+
const names = leads.map((b) => `${b.name} (@${b.handle})`).join(t('listSep'));
|
|
3993
|
+
const finish = () => Promise.resolve(postJson('lead-notice/dismiss', {})).finally(onDone);
|
|
3994
|
+
const remove = async () => {
|
|
3995
|
+
setBusy(true);
|
|
3996
|
+
const failed = [];
|
|
3997
|
+
for (const b of leads) {
|
|
3998
|
+
const r = await postJson('delete', { id: b.id }).catch(() => null);
|
|
3999
|
+
if (!r?.ok) failed.push(b.name);
|
|
4000
|
+
}
|
|
4001
|
+
if (failed.length) {
|
|
4002
|
+
setBusy(false);
|
|
4003
|
+
toast(t('oldLeadsFailed', { names: failed.join(t('listSep')) }), 'error');
|
|
4004
|
+
onDone();
|
|
4005
|
+
return;
|
|
4006
|
+
}
|
|
4007
|
+
await finish();
|
|
4008
|
+
};
|
|
4009
|
+
return h(
|
|
4010
|
+
'div',
|
|
4011
|
+
{ role: 'region', 'aria-label': t('oldLeadsTitle'), 'data-dsh-bots-old-leads': leads.length, className: 'dshb-fade', style: { display: 'flex', alignItems: 'flex-start', gap: 12, margin: '12px 24px 0', padding: '12px 14px', borderRadius: 12, border: `1px solid ${tint(C.label, 35)}`, background: tint(C.label, 8) } },
|
|
4012
|
+
h('span', { style: { color: C.label, display: 'inline-flex', paddingTop: 2 } }, Icon.team(16)),
|
|
4013
|
+
h(
|
|
4014
|
+
'div',
|
|
4015
|
+
{ style: { flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 4 } },
|
|
4016
|
+
h('div', { style: { fontWeight: 700, fontSize: SMALL } }, t('oldLeadsTitle')),
|
|
4017
|
+
h('div', { style: { fontSize: SMALL, color: C.muted, lineHeight: 1.6 } }, t('oldLeadsBody', { names, desk: desk?.name ?? t('dispatcher') })),
|
|
4018
|
+
h(
|
|
4019
|
+
'div',
|
|
4020
|
+
{ style: { display: 'flex', gap: 8, marginTop: 6, flexWrap: 'wrap' } },
|
|
4021
|
+
h(Btn, { size: 'sm', kind: 'primary', disabled: busy, onClick: () => void remove(), 'data-dsh-bots-old-leads-remove': true }, t('oldLeadsRemove')),
|
|
4022
|
+
h(Btn, { size: 'sm', disabled: busy, onClick: () => void finish(), 'data-dsh-bots-old-leads-keep': true }, t('oldLeadsKeep')),
|
|
4023
|
+
),
|
|
4024
|
+
),
|
|
4025
|
+
);
|
|
4026
|
+
}
|
|
4027
|
+
|
|
3677
4028
|
// --- avatar editor -----------------------------------------------------------------
|
|
3678
4029
|
|
|
3679
4030
|
function readDataUrl(file) {
|
|
@@ -3866,7 +4217,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
3866
4217
|
/**
|
|
3867
4218
|
* The tool lists after switching one ability of a router dispatcher. An ability made only of tools a
|
|
3868
4219
|
* router goes without (commands, sub-agents, images, Office) is switched through `routerAllow`, so it
|
|
3869
|
-
* keeps its own setting for
|
|
4220
|
+
* keeps its own setting for when the dispatcher works alone. One with other tools too (files) switches as before and
|
|
3870
4221
|
* comes back with the router's default; its writing tools are allowed back on their own.
|
|
3871
4222
|
*/
|
|
3872
4223
|
function toggleRouterAbility(draft, ab, on, routerDeny) {
|
|
@@ -3880,58 +4231,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
3880
4231
|
for (const x of [...(ab.tools ?? []), ...gated]) allow.delete(x);
|
|
3881
4232
|
return { deny: whole ? draft.deny : toggleAbility(draft.deny, ab, false), routerAllow: sorted(allow) };
|
|
3882
4233
|
}
|
|
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
4234
|
const ABILITY_ICON = {
|
|
3936
4235
|
web: () => Icon.search(15),
|
|
3937
4236
|
files: () => Icon.edit(15),
|
|
@@ -4068,7 +4367,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
4068
4367
|
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
4368
|
),
|
|
4070
4369
|
),
|
|
4071
|
-
isPrimary ? h(Section, { title: t('dispatcherMode'), hint: t('dispatcherModeHint') }, h(DispatcherMode, { t, name: botLabel, toast })) : null,
|
|
4072
4370
|
h(
|
|
4073
4371
|
Section,
|
|
4074
4372
|
{ title: t('persona'), hint: t('personaHint') },
|
|
@@ -7003,7 +7301,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7003
7301
|
const memberName = (m, lang) => pick(m.name, 'en') || pick(m.name, lang);
|
|
7004
7302
|
const teamCounts = (team) => ({
|
|
7005
7303
|
skills: (team.bots ?? []).reduce((n, b) => n + (b.skills ?? []).length, 0),
|
|
7006
|
-
tasks: (team.bots ?? []).reduce((n, b) => n + (b.tasks ?? []).length,
|
|
7304
|
+
tasks: (team.bots ?? []).reduce((n, b) => n + (b.tasks ?? []).length, (team.desk ?? []).length),
|
|
7007
7305
|
});
|
|
7008
7306
|
|
|
7009
7307
|
function TeamCard({ t, lang, team, onHire, onDetail, busy }) {
|
|
@@ -7038,7 +7336,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7038
7336
|
h('span', { style: { width: 7, height: 7, borderRadius: '50%', background: m.color, flex: 'none' } }),
|
|
7039
7337
|
h('span', { style: { fontWeight: 600, flex: 'none' } }, memberName(m, lang)),
|
|
7040
7338
|
h('span', { style: { color: C.muted, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, roleOf(m, lang)),
|
|
7041
|
-
m.role === 'primary' ? h('span', { title: t('dispatcher'), style: { color: '#f5b301', display: 'inline-flex', flex: 'none' } }, Icon.crown(11)) : null,
|
|
7042
7339
|
),
|
|
7043
7340
|
),
|
|
7044
7341
|
),
|
|
@@ -7132,7 +7429,40 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7132
7429
|
h('span', { style: { fontSize: TINY, color: C.faint, width: 36, flex: 'none', lineHeight: '22px' } }, label),
|
|
7133
7430
|
h('div', { style: { display: 'flex', alignItems: 'center', gap: 5, flexWrap: 'wrap', flex: 1, minWidth: 0 } }, chips),
|
|
7134
7431
|
);
|
|
7135
|
-
|
|
7432
|
+
/** A routine chip: a scheduled task's title and when it runs. */
|
|
7433
|
+
const routineChip = (t, lang, task, i) =>
|
|
7434
|
+
h(
|
|
7435
|
+
'span',
|
|
7436
|
+
{ key: i, 'data-dsh-bots-team-task': true, style: { display: 'inline-flex', alignItems: 'center', gap: 5, height: 22, padding: '0 8px', borderRadius: 6, fontSize: TINY, background: tint(C.label, 8), color: C.primary } },
|
|
7437
|
+
Icon.clock(10),
|
|
7438
|
+
h('span', { style: { fontWeight: 600 } }, pick(task.title, lang)),
|
|
7439
|
+
h('span', { style: { color: C.muted } }, teamWhen(t, task.when)),
|
|
7440
|
+
);
|
|
7441
|
+
/**
|
|
7442
|
+
* Who hands out a team's work: the dispatcher you have (`desk`), or the Atlas hiring makes when
|
|
7443
|
+
* there is none, with the routine the team gives it.
|
|
7444
|
+
*/
|
|
7445
|
+
function TeamDeskRow({ t, lang, team, desk }) {
|
|
7446
|
+
const routine = Array.isArray(team.desk) ? team.desk : [];
|
|
7447
|
+
return h(
|
|
7448
|
+
'div',
|
|
7449
|
+
{ className: 'dshb-card', 'data-dsh-bots-team-desk': desk?.id ?? 'new', style: { display: 'flex', gap: 12, alignItems: 'flex-start', background: tint(C.label, 6) } },
|
|
7450
|
+
h(Avatar, { avatar: desk?.avatar ?? { kind: 'initials', text: 'AT', color: '#7c5cff' }, name: desk?.name ?? 'Atlas', size: 40, ring: true }),
|
|
7451
|
+
h(
|
|
7452
|
+
'div',
|
|
7453
|
+
{ style: { flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 7 } },
|
|
7454
|
+
h(
|
|
7455
|
+
'div',
|
|
7456
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' } },
|
|
7457
|
+
h('span', { style: { fontWeight: 700 } }, desk?.name ?? 'Atlas'),
|
|
7458
|
+
h(Badge, { color: '#d99a00' }, Icon.crown(10), t('dispatcher')),
|
|
7459
|
+
),
|
|
7460
|
+
h('div', { style: { fontSize: SMALL, color: C.muted, lineHeight: 1.55 } }, desk ? t('teamDesk') : t('teamDeskNew')),
|
|
7461
|
+
routine.length ? chipRow(t('teamTasks'), routine.map((task, i) => routineChip(t, lang, task, i))) : null,
|
|
7462
|
+
),
|
|
7463
|
+
);
|
|
7464
|
+
}
|
|
7465
|
+
function TeamDetailModal({ t, lang, team, desk, onClose, onHire, entries }) {
|
|
7136
7466
|
const members = Array.isArray(team.bots) ? team.bots : [];
|
|
7137
7467
|
const appName = (id) => {
|
|
7138
7468
|
const e = (entries ?? []).find((x) => x.id === id);
|
|
@@ -7146,7 +7476,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7146
7476
|
width: 760,
|
|
7147
7477
|
onClose,
|
|
7148
7478
|
footer: [
|
|
7149
|
-
|
|
7479
|
+
h('span', { key: 'p', style: { flex: 1 } }),
|
|
7150
7480
|
h(Btn, { key: 'c', onClick: onClose }, t('cancel')),
|
|
7151
7481
|
h(Btn, { key: 'h', kind: 'primary', icon: Icon.team(14), onClick: () => onHire(team), 'data-dsh-bots-hire-modal': team.id }, t('hireTeam')),
|
|
7152
7482
|
],
|
|
@@ -7155,11 +7485,12 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7155
7485
|
h(
|
|
7156
7486
|
'div',
|
|
7157
7487
|
{ style: { display: 'flex', flexDirection: 'column', gap: 10 } },
|
|
7488
|
+
h(TeamDeskRow, { t, lang, team, desk }),
|
|
7158
7489
|
members.map((m) =>
|
|
7159
7490
|
h(
|
|
7160
7491
|
'div',
|
|
7161
7492
|
{ key: m.key, className: 'dshb-card', 'data-dsh-bots-member': m.key, style: { display: 'flex', gap: 12, alignItems: 'flex-start' } },
|
|
7162
|
-
h(Avatar, { avatar: memberAvatar(m), name: memberName(m, lang), size: 40
|
|
7493
|
+
h(Avatar, { avatar: memberAvatar(m), name: memberName(m, lang), size: 40 }),
|
|
7163
7494
|
h(
|
|
7164
7495
|
'div',
|
|
7165
7496
|
{ style: { flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 7 } },
|
|
@@ -7168,7 +7499,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7168
7499
|
{ style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' } },
|
|
7169
7500
|
h('span', { style: { fontWeight: 700 } }, pick(m.name, lang)),
|
|
7170
7501
|
h('span', { className: 'dshb-mono', style: { fontSize: TINY, color: C.faint } }, `@${m.handle}`),
|
|
7171
|
-
m.role === 'primary' ? h(Badge, { color: '#d99a00' }, Icon.crown(10), t('dispatcher')) : null,
|
|
7172
7502
|
),
|
|
7173
7503
|
h('div', { style: { fontSize: SMALL, color: C.muted, lineHeight: 1.55 } }, pick(m.bio, lang)),
|
|
7174
7504
|
(m.skills ?? []).length ? chipRow(t('tab_skills'), m.skills.map((s) => h(SkillChip, { key: `${s.source}:${s.name}`, t, skill: s }))) : null,
|
|
@@ -7186,20 +7516,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7186
7516
|
h('span', { key: 'later', style: { fontSize: TINY, color: C.faint } }, t('appKeyLater')),
|
|
7187
7517
|
)
|
|
7188
7518
|
: null,
|
|
7189
|
-
(m.tasks ?? []).length
|
|
7190
|
-
? chipRow(
|
|
7191
|
-
t('teamTasks'),
|
|
7192
|
-
m.tasks.map((task, i) =>
|
|
7193
|
-
h(
|
|
7194
|
-
'span',
|
|
7195
|
-
{ key: i, 'data-dsh-bots-team-task': true, style: { display: 'inline-flex', alignItems: 'center', gap: 5, height: 22, padding: '0 8px', borderRadius: 6, fontSize: TINY, background: tint(C.label, 8), color: C.primary } },
|
|
7196
|
-
Icon.clock(10),
|
|
7197
|
-
h('span', { style: { fontWeight: 600 } }, pick(task.title, lang)),
|
|
7198
|
-
h('span', { style: { color: C.muted } }, teamWhen(t, task.when)),
|
|
7199
|
-
),
|
|
7200
|
-
),
|
|
7201
|
-
)
|
|
7202
|
-
: null,
|
|
7519
|
+
(m.tasks ?? []).length ? chipRow(t('teamTasks'), m.tasks.map((task, i) => routineChip(t, lang, task, i))) : null,
|
|
7203
7520
|
),
|
|
7204
7521
|
),
|
|
7205
7522
|
),
|
|
@@ -7213,26 +7530,17 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7213
7530
|
),
|
|
7214
7531
|
);
|
|
7215
7532
|
}
|
|
7216
|
-
function PrimaryTick({ t, primary, setPrimary }) {
|
|
7217
|
-
return h(
|
|
7218
|
-
'label',
|
|
7219
|
-
{ style: { flex: 1, display: 'inline-flex', alignItems: 'center', gap: 7, fontSize: SMALL, color: C.muted, cursor: 'pointer' } },
|
|
7220
|
-
h('input', { type: 'checkbox', checked: primary, onChange: (e) => setPrimary(e.target.checked), 'data-dsh-bots-hire-primary': true, style: { accentColor: 'var(--dsw-alias-brand-primary)' } }),
|
|
7221
|
-
t('leadAsDispatcher'),
|
|
7222
|
-
);
|
|
7223
|
-
}
|
|
7224
|
-
|
|
7225
7533
|
/**
|
|
7226
7534
|
* Hiring a team: confirm (only when a roster exists), then a progress state,
|
|
7227
7535
|
* then what was created, skipped and still needs keys, with the kickoff.
|
|
7228
7536
|
*/
|
|
7229
7537
|
function HireModal({ t, lang, hire, setHire, onDone, onOpenBot, toast, catalog }) {
|
|
7230
|
-
const { team, phase, result
|
|
7538
|
+
const { team, phase, result } = hire;
|
|
7231
7539
|
const [sending, setSending] = useState(false);
|
|
7232
7540
|
const close = () => setHire(null);
|
|
7233
7541
|
const go = () => {
|
|
7234
7542
|
setHire({ ...hire, phase: 'busy' });
|
|
7235
|
-
postJson('teams/hire', { id: team.id, lang
|
|
7543
|
+
postJson('teams/hire', { id: team.id, lang })
|
|
7236
7544
|
.then((r) => {
|
|
7237
7545
|
if (r?.ok) {
|
|
7238
7546
|
setHire({ ...hire, phase: 'done', result: r });
|
|
@@ -7255,7 +7563,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7255
7563
|
footer: [h(Btn, { key: 'c', onClick: close }, t('cancel')), h(Btn, { key: 'h', kind: 'primary', icon: Icon.team(14), onClick: go, 'data-dsh-bots-hire-go': true }, t('hireTeam'))],
|
|
7256
7564
|
},
|
|
7257
7565
|
h('div', { style: { fontSize: FONT, color: C.muted, lineHeight: 1.6 } }, t('hireConfirmBody', { n: (team.bots ?? []).length })),
|
|
7258
|
-
h(PrimaryTick, { t, primary, setPrimary: (v) => setHire({ ...hire, primary: v }) }),
|
|
7259
7566
|
);
|
|
7260
7567
|
if (phase === 'busy' || phase === 'start')
|
|
7261
7568
|
return h(
|
|
@@ -7278,7 +7585,8 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7278
7585
|
// done
|
|
7279
7586
|
const r = result ?? {};
|
|
7280
7587
|
const made = (Array.isArray(r.bots) ? r.bots : []).map((b) => botById(b.id) ?? b);
|
|
7281
|
-
|
|
7588
|
+
// The kickoff goes to the dispatcher: the one you had, or the one this hire made.
|
|
7589
|
+
const lead = botById(r.dispatcherId) ?? made.find((b) => b.id === r.dispatcherId) ?? null;
|
|
7282
7590
|
const skipped = Array.isArray(r.skipped) ? r.skipped : [];
|
|
7283
7591
|
const entries = Array.isArray(catalog?.templates) ? catalog.templates : [];
|
|
7284
7592
|
const needKeys = [];
|
|
@@ -7331,7 +7639,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7331
7639
|
{ key: b.id, className: 'dshb-chip', style: { height: 32, paddingLeft: 4, cursor: 'default', color: C.primary } },
|
|
7332
7640
|
h(Avatar, { avatar: b.avatar, name: b.name, size: 24 }),
|
|
7333
7641
|
h('span', { style: { fontWeight: 600 } }, b.name),
|
|
7334
|
-
b.id === r.
|
|
7642
|
+
b.id === r.dispatcherId ? h('span', { style: { color: '#f5b301', display: 'inline-flex' } }, Icon.crown(10)) : null,
|
|
7335
7643
|
),
|
|
7336
7644
|
),
|
|
7337
7645
|
),
|
|
@@ -7404,11 +7712,12 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7404
7712
|
const [creating, setCreating] = useState(false);
|
|
7405
7713
|
const [detail, setDetail] = useState(null); // a team shown in the detail modal
|
|
7406
7714
|
const [hire, setHire] = useState(null); // {team, phase: confirm|start|busy|done|error, primary, result?}
|
|
7407
|
-
const [primaryTick, setPrimaryTick] = useState(true);
|
|
7408
7715
|
const [settings, setSettings] = useState(false);
|
|
7409
7716
|
const [ticketId, setTicketId] = useState(null); // the task shown in the Tasks view
|
|
7717
|
+
const [needId, setNeedId] = useState(null); // the request shown in the Requests view
|
|
7410
7718
|
const [tasksBot, setTasksBot] = useState(''); // the Tasks view's bot filter when another view asked for it
|
|
7411
7719
|
const [noticeGone, setNoticeGone] = useState(false);
|
|
7720
|
+
const [leadsGone, setLeadsGone] = useState(false);
|
|
7412
7721
|
const [toast, showToast] = useToast();
|
|
7413
7722
|
const seenNav = useRef(0);
|
|
7414
7723
|
const bots = Array.isArray(s.state?.bots) ? s.state.bots : [];
|
|
@@ -7421,6 +7730,9 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7421
7730
|
setView('tasks');
|
|
7422
7731
|
setTicketId(s.nav.ticket ?? null);
|
|
7423
7732
|
setTasksBot(s.nav.ticket ? '' : (s.nav.botId ?? ''));
|
|
7733
|
+
} else if (s.nav.view === 'needs') {
|
|
7734
|
+
setView('needs');
|
|
7735
|
+
setNeedId(s.nav.ticket ?? null);
|
|
7424
7736
|
} else if (s.nav.view === 'activity') setView('activity');
|
|
7425
7737
|
else if (s.nav.botId) {
|
|
7426
7738
|
setSelected(s.nav.botId);
|
|
@@ -7429,13 +7741,11 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7429
7741
|
}, [s.nav.tick]);
|
|
7430
7742
|
const current = bots.find((b) => b.id === selected) ?? bots.find((b) => b.id === primaryId) ?? bots[0] ?? null;
|
|
7431
7743
|
const shownView = view ?? (s.state && bots.length <= 1 && !bots.some((b) => b.team) ? 'hero' : 'bot');
|
|
7432
|
-
|
|
7433
|
-
/** Start hiring: straight away on an empty roster, else confirm (and ask about the dispatcher). */
|
|
7744
|
+
/** Start hiring: straight away on an empty roster or from the details, else confirm. */
|
|
7434
7745
|
const startHire = (team, fromDetail = false) => {
|
|
7435
7746
|
setDetail(null);
|
|
7436
7747
|
const real = bots.filter((b) => !(b.role === 'primary' && bots.length === 1 && !b.team && (b.skills ?? []).length === 0));
|
|
7437
|
-
|
|
7438
|
-
setHire({ team, primary, phase: real.length === 0 || fromDetail ? 'start' : 'confirm' });
|
|
7748
|
+
setHire({ team, phase: real.length === 0 || fromDetail ? 'start' : 'confirm' });
|
|
7439
7749
|
};
|
|
7440
7750
|
const openBotTab = (id, tabId) => {
|
|
7441
7751
|
setSelected(id);
|
|
@@ -7452,6 +7762,13 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7452
7762
|
let main;
|
|
7453
7763
|
if (!s.state) {
|
|
7454
7764
|
main = h('div', { style: { flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.faint, fontSize: SMALL } }, s.failed ? t('unavailable') : t('loading'));
|
|
7765
|
+
} else if (shownView === 'needs') {
|
|
7766
|
+
const toTask = (id) => {
|
|
7767
|
+
setView('tasks');
|
|
7768
|
+
setTasksBot('');
|
|
7769
|
+
setTicketId(id ?? null);
|
|
7770
|
+
};
|
|
7771
|
+
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
7772
|
} else if (shownView === 'tasks') {
|
|
7456
7773
|
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
7774
|
} else if (shownView === 'activity') {
|
|
@@ -7461,7 +7778,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7461
7778
|
} else if (shownView === 'memory') {
|
|
7462
7779
|
main = h(TeamMemoryView, { t, toast: showToast, onSettings: () => setSettings(true) });
|
|
7463
7780
|
} else if (shownView === 'hero' || shownView === 'teams' || !current) {
|
|
7464
|
-
main = h(TeamsGallery, { t, lang, teams, hero: shownView !== 'teams', onHire: (team) => startHire(team), onDetail: (team) =>
|
|
7781
|
+
main = h(TeamsGallery, { t, lang, teams, hero: shownView !== 'teams', onHire: (team) => startHire(team), onDetail: (team) => setDetail(team), onBlank: () => setCreating(true), busy: Boolean(hire) });
|
|
7465
7782
|
} else {
|
|
7466
7783
|
main = h(BotDetail, { t, bot: current, primaryId, env: env2, toast: showToast, catalog, tab, setTab, onDeleted: () => setSelected(null), onSettings: () => setSettings(true) });
|
|
7467
7784
|
}
|
|
@@ -7494,6 +7811,11 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7494
7811
|
},
|
|
7495
7812
|
attention: Array.isArray(s.state?.attention) ? s.state.attention.length : 0,
|
|
7496
7813
|
openTasks: bots.reduce((n, b) => n + openTaskCount(b), 0),
|
|
7814
|
+
onNeeds: () => {
|
|
7815
|
+
setView('needs');
|
|
7816
|
+
setNeedId(null);
|
|
7817
|
+
},
|
|
7818
|
+
needCounts: s.state?.needs ?? {},
|
|
7497
7819
|
}),
|
|
7498
7820
|
h(
|
|
7499
7821
|
'div',
|
|
@@ -7509,6 +7831,18 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7509
7831
|
},
|
|
7510
7832
|
})
|
|
7511
7833
|
: null,
|
|
7834
|
+
!leadsGone && (s.state?.oldLeads ?? []).length
|
|
7835
|
+
? h(OldLeadsBanner, {
|
|
7836
|
+
t,
|
|
7837
|
+
leads: s.state.oldLeads,
|
|
7838
|
+
desk: bots.find((b) => b.id === primaryId) ?? null,
|
|
7839
|
+
onDone: () => {
|
|
7840
|
+
setLeadsGone(true);
|
|
7841
|
+
void refreshState();
|
|
7842
|
+
},
|
|
7843
|
+
toast: showToast,
|
|
7844
|
+
})
|
|
7845
|
+
: null,
|
|
7512
7846
|
main,
|
|
7513
7847
|
),
|
|
7514
7848
|
creating
|
|
@@ -7524,7 +7858,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7524
7858
|
})
|
|
7525
7859
|
: null,
|
|
7526
7860
|
detail
|
|
7527
|
-
? h(TeamDetailModal, { t, lang, team: detail, entries: catalog?.templates, onClose: () => setDetail(null), onHire: (team) => startHire(team, true)
|
|
7861
|
+
? h(TeamDetailModal, { t, lang, team: detail, desk: bots.find((b) => b.id === primaryId) ?? null, entries: catalog?.templates, onClose: () => setDetail(null), onHire: (team) => startHire(team, true) })
|
|
7528
7862
|
: null,
|
|
7529
7863
|
hire ? h(HireModal, { t, lang, hire, setHire, toast: showToast, catalog, onDone: openBotTab, onOpenBot: openBotTab }) : null,
|
|
7530
7864
|
settings ? h(SettingsModal, { t, catalog, toast: showToast, onClose: () => setSettings(false) }) : null,
|
|
@@ -8227,7 +8561,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
8227
8561
|
teamTemplatesHint: "Hire a ready-made team",
|
|
8228
8562
|
teamTemplatesSub: "Each team comes with personas, Harness skills, apps and scheduled tasks. Anything this Harness lacks is skipped.",
|
|
8229
8563
|
teamsHeroTitle: "Build your bot team",
|
|
8230
|
-
teamsHeroBody: "Hire a ready-made team for a one-person company or a job that needs several roles. Each bot arrives with its persona, the skills already in your Harness, apps and a routine
|
|
8564
|
+
teamsHeroBody: "Hire a ready-made team for a one-person company or a job that needs several roles. Each bot arrives with its persona, the skills already in your Harness, apps and a routine; your dispatcher hands out the work of every team you hire.",
|
|
8231
8565
|
noTeams: "No team templates.",
|
|
8232
8566
|
orBlank: "Prefer to start from scratch?",
|
|
8233
8567
|
teamDaily: "Daily {time}",
|
|
@@ -8245,7 +8579,13 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
8245
8579
|
legendHarness: "Harness skill",
|
|
8246
8580
|
legendGithub: "imported from GitHub",
|
|
8247
8581
|
legendMissing: "not installed, skipped",
|
|
8248
|
-
|
|
8582
|
+
teamDesk: "Your dispatcher hands out this team's work, as it does for every team, and takes on its routine.",
|
|
8583
|
+
teamDeskNew: "You have no dispatcher yet: hiring adds Atlas to hand out the work. Rename it on its profile.",
|
|
8584
|
+
oldLeadsTitle: "Teams no longer have a lead",
|
|
8585
|
+
oldLeadsBody: "{desk} hands out the work of every team, so {names}, hired as a team lead, would only pass its messages on. Remove them? Their tasks stop and their scheduled tasks go; their teammates stay.",
|
|
8586
|
+
oldLeadsRemove: "Remove",
|
|
8587
|
+
oldLeadsKeep: "Keep them",
|
|
8588
|
+
oldLeadsFailed: "Could not remove {names}.",
|
|
8249
8589
|
hireFailed: "Could not hire the team.",
|
|
8250
8590
|
hireTitle: "Hire {name}",
|
|
8251
8591
|
hireConfirmBody: "This adds {n} bots next to the ones you have. Their skills, apps and scheduled tasks are set up for you.",
|
|
@@ -8418,6 +8758,52 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
8418
8758
|
askingBadge: '{n} waiting for your answer',
|
|
8419
8759
|
askingChip: 'Asks you',
|
|
8420
8760
|
tasksInProgress: '{n} in progress',
|
|
8761
|
+
// requests (needs, Bots 0.11)
|
|
8762
|
+
needs: 'Requests',
|
|
8763
|
+
needsHint: 'What you asked for',
|
|
8764
|
+
needsWaitingHint: '{n} waiting for you',
|
|
8765
|
+
needsWorkingHint: '{n} in progress',
|
|
8766
|
+
needsSub: 'Everything you asked the team for, in a line, and how far each got. The tasks behind each are one click away.',
|
|
8767
|
+
needsYou: 'Waiting for you',
|
|
8768
|
+
needsYouEmpty: 'Nothing waits for you.',
|
|
8769
|
+
needsWorking: 'In progress',
|
|
8770
|
+
needsWorkingEmpty: 'Nothing is in progress.',
|
|
8771
|
+
needsDone: 'Done',
|
|
8772
|
+
needsDoneEmpty: 'Nothing delivered yet.',
|
|
8773
|
+
needsShowStopped: 'Show dropped ({n})',
|
|
8774
|
+
needsHideStopped: 'Hide dropped',
|
|
8775
|
+
needsEmptyTitle: 'No requests yet',
|
|
8776
|
+
needsEmptyBody: 'Ask your dispatcher for something in the chat. Each request shows up here in a line, with how far the team got.',
|
|
8777
|
+
needsUnavailable: 'Could not load your requests.',
|
|
8778
|
+
needsWeek: 'This week: {n} requests · {done} done · {working} in progress · {waiting} waiting for you',
|
|
8779
|
+
needsAllTasks: 'All tasks',
|
|
8780
|
+
need_waiting: 'Waiting for you',
|
|
8781
|
+
need_working: 'In progress',
|
|
8782
|
+
need_failed: 'Not done',
|
|
8783
|
+
need_done: 'Done',
|
|
8784
|
+
need_stopped: 'Dropped',
|
|
8785
|
+
needWorkingOf: '{done}/{total} done',
|
|
8786
|
+
needSomeFailed: '{n} of its tasks did not get done',
|
|
8787
|
+
needSomeStalled: '{n} of its tasks got stuck',
|
|
8788
|
+
needDelivered: 'delivered {when}',
|
|
8789
|
+
needAsked: 'asked {when}',
|
|
8790
|
+
needYouSaid: 'You said: {text}',
|
|
8791
|
+
allNeeds: 'All requests',
|
|
8792
|
+
needMissing: 'This request is not available.',
|
|
8793
|
+
needYourWords: 'What you said',
|
|
8794
|
+
needAutoHint: 'Titled with your own words: the dispatcher did not restate it.',
|
|
8795
|
+
needResults: 'What was delivered',
|
|
8796
|
+
needNoResults: 'Nothing delivered yet.',
|
|
8797
|
+
needTasks: 'The tasks behind it ({n})',
|
|
8798
|
+
needQuestion: '{name} asks:',
|
|
8799
|
+
needAnswer: 'Answer',
|
|
8800
|
+
needRename: 'Rename',
|
|
8801
|
+
needRenamed: 'Renamed.',
|
|
8802
|
+
needTitleLabel: 'Title',
|
|
8803
|
+
needDrop: 'Drop it',
|
|
8804
|
+
needDropTitle: 'Drop “{title}”?',
|
|
8805
|
+
needDropBody: 'Its unfinished tasks stop, and it shows as dropped.',
|
|
8806
|
+
needDropped: 'Dropped.',
|
|
8421
8807
|
tasksSub: 'Work your bots have taken on. Each task runs in its own conversation, so several move at once.',
|
|
8422
8808
|
tasksNeeds: 'Needs you',
|
|
8423
8809
|
tasksNeedsEmpty: 'Nothing needs you right now.',
|
|
@@ -8490,27 +8876,18 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
8490
8876
|
botNoOpenTasks: '{name} has no open tasks.',
|
|
8491
8877
|
toolReport: 'Report',
|
|
8492
8878
|
requesterShort: 'whoever asked',
|
|
8493
|
-
// the dispatcher
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
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',
|
|
8879
|
+
// the dispatcher
|
|
8880
|
+
routerModelHint: 'It only understands, hands out and reports, so a light, fast model is enough, and every request stays quick and cheap.',
|
|
8881
|
+
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.',
|
|
8882
|
+
routerOff: 'Off for dispatching',
|
|
8506
8883
|
teamOff: 'Off for the dispatcher',
|
|
8507
8884
|
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
|
|
8509
|
-
routerAllowed: 'On
|
|
8885
|
+
routerPartOff: 'Partly off for dispatching',
|
|
8886
|
+
routerAllowed: 'On for dispatching',
|
|
8510
8887
|
routerAllowBack: 'Turn back on',
|
|
8511
|
-
routerOffShort: 'off
|
|
8888
|
+
routerOffShort: 'off for dispatching',
|
|
8512
8889
|
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
|
|
8890
|
+
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
8891
|
routerNoticeOpen: 'Open its profile',
|
|
8515
8892
|
routerNoticeOk: 'Got it',
|
|
8516
8893
|
setTasks: 'Tasks',
|
|
@@ -9114,7 +9491,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
9114
9491
|
teamTemplatesHint: "雇用一支现成的团队",
|
|
9115
9492
|
teamTemplatesSub: "每个团队都配好了人设、Harness 技能、应用和定时任务。当前 Harness 没有的会自动跳过。",
|
|
9116
9493
|
teamsHeroTitle: "组建你的 Bot 团队",
|
|
9117
|
-
teamsHeroBody: "为一人公司或需要多人协作的工作,直接雇用一支现成的团队。每个 Bot 都带着人设、你 Harness
|
|
9494
|
+
teamsHeroBody: "为一人公司或需要多人协作的工作,直接雇用一支现成的团队。每个 Bot 都带着人设、你 Harness 里已有的技能、应用和日常任务上岗;雇几个团队,都由你的调度员统一分派工作。",
|
|
9118
9495
|
noTeams: "没有团队模板。",
|
|
9119
9496
|
orBlank: "想从零开始?",
|
|
9120
9497
|
teamDaily: "每天 {time}",
|
|
@@ -9132,7 +9509,13 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
9132
9509
|
legendHarness: "Harness 技能",
|
|
9133
9510
|
legendGithub: "从 GitHub 导入",
|
|
9134
9511
|
legendMissing: "未安装,将跳过",
|
|
9135
|
-
|
|
9512
|
+
teamDesk: "这个团队的工作和其他团队一样,由你的调度员统一分派,团队的日常任务也交给它。",
|
|
9513
|
+
teamDeskNew: "你还没有调度员:雇用时会新建一个 Atlas 来分派工作,可以在它的资料页改名。",
|
|
9514
|
+
oldLeadsTitle: "团队不再有负责人",
|
|
9515
|
+
oldLeadsBody: "{desk} 统一分派所有团队的工作,以负责人身份雇来的 {names} 只会替它传话。要删除吗?它们手上的任务会停止,定时任务一并删除;团队其他成员保留。",
|
|
9516
|
+
oldLeadsRemove: "删除",
|
|
9517
|
+
oldLeadsKeep: "保留",
|
|
9518
|
+
oldLeadsFailed: "没能删除 {names}。",
|
|
9136
9519
|
hireFailed: "没能雇用这个团队。",
|
|
9137
9520
|
hireTitle: "雇用{name}",
|
|
9138
9521
|
hireConfirmBody: "将在现有 Bot 之外新增 {n} 个 Bot,并自动配好它们的技能、应用和定时任务。",
|
|
@@ -9305,6 +9688,52 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
9305
9688
|
askingBadge: '{n} 个问题等你回答',
|
|
9306
9689
|
askingChip: '在问你',
|
|
9307
9690
|
tasksInProgress: '{n} 个进行中',
|
|
9691
|
+
// requests (needs, Bots 0.11)
|
|
9692
|
+
needs: '需求',
|
|
9693
|
+
needsHint: '你提的每件事',
|
|
9694
|
+
needsWaitingHint: '{n} 个等你处理',
|
|
9695
|
+
needsWorkingHint: '{n} 个进行中',
|
|
9696
|
+
needsSub: '你交给团队的每件事,一句话说清楚要什么、做到哪一步了。每件事背后的任务点开就能看到。',
|
|
9697
|
+
needsYou: '等你处理',
|
|
9698
|
+
needsYouEmpty: '没有要你处理的事。',
|
|
9699
|
+
needsWorking: '进行中',
|
|
9700
|
+
needsWorkingEmpty: '没有进行中的事。',
|
|
9701
|
+
needsDone: '已完成',
|
|
9702
|
+
needsDoneEmpty: '还没有交付的事。',
|
|
9703
|
+
needsShowStopped: '显示已取消的({n})',
|
|
9704
|
+
needsHideStopped: '收起已取消的',
|
|
9705
|
+
needsEmptyTitle: '还没有需求',
|
|
9706
|
+
needsEmptyBody: '在聊天里交给调度者一件事,它就会出现在这里:一句话说清楚要什么,以及团队做到了哪一步。',
|
|
9707
|
+
needsUnavailable: '没能加载需求。',
|
|
9708
|
+
needsWeek: '本周 {n} 个需求 · 完成 {done} · 进行中 {working} · 等你 {waiting}',
|
|
9709
|
+
needsAllTasks: '全部任务',
|
|
9710
|
+
need_waiting: '等你处理',
|
|
9711
|
+
need_working: '进行中',
|
|
9712
|
+
need_failed: '没做成',
|
|
9713
|
+
need_done: '已完成',
|
|
9714
|
+
need_stopped: '已取消',
|
|
9715
|
+
needWorkingOf: '完成 {done}/{total}',
|
|
9716
|
+
needSomeFailed: '其中 {n} 项没做成',
|
|
9717
|
+
needSomeStalled: '其中 {n} 项卡住了',
|
|
9718
|
+
needDelivered: '{when}交付',
|
|
9719
|
+
needAsked: '{when}提出',
|
|
9720
|
+
needYouSaid: '你说的:{text}',
|
|
9721
|
+
allNeeds: '全部需求',
|
|
9722
|
+
needMissing: '这个需求不可用。',
|
|
9723
|
+
needYourWords: '你的原话',
|
|
9724
|
+
needAutoHint: '标题取自你的原话,调度者没有另外转述。',
|
|
9725
|
+
needResults: '交付的结果',
|
|
9726
|
+
needNoResults: '还没有交付。',
|
|
9727
|
+
needTasks: '背后的任务({n})',
|
|
9728
|
+
needQuestion: '{name} 在问:',
|
|
9729
|
+
needAnswer: '去回答',
|
|
9730
|
+
needRename: '改标题',
|
|
9731
|
+
needRenamed: '标题已更新。',
|
|
9732
|
+
needTitleLabel: '标题',
|
|
9733
|
+
needDrop: '不用做了',
|
|
9734
|
+
needDropTitle: '不做「{title}」了?',
|
|
9735
|
+
needDropBody: '它下面还没完成的任务会停下,这件事算作已取消。',
|
|
9736
|
+
needDropped: '已取消。',
|
|
9308
9737
|
tasksSub: 'Bot 们接手的工作。每个任务在自己的会话里进行,几件事可以同时推进。',
|
|
9309
9738
|
tasksNeeds: '需要你处理',
|
|
9310
9739
|
tasksNeedsEmpty: '现在没有需要你处理的。',
|
|
@@ -9377,27 +9806,18 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
9377
9806
|
botNoOpenTasks: '{name} 手上没有进行中的任务。',
|
|
9378
9807
|
toolReport: '汇报',
|
|
9379
9808
|
requesterShort: '发起方',
|
|
9380
|
-
// the dispatcher
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
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: '只调度时关闭',
|
|
9809
|
+
// the dispatcher
|
|
9810
|
+
routerModelHint: '它只负责听懂、分派、汇报,用轻量、快速的模型就够了,每次请求都更快、更省。',
|
|
9811
|
+
abilitiesRouterHint: '{name} 能用 Harness 内置工具做哪些事。作为调度者,它不联网、不执行命令、不写文件、不用子代理、不作图、不做 Office 文档,也不弹提问卡片(卡片没答之前,后面的消息都得排队);确实需要时可以在下面逐项打开。',
|
|
9812
|
+
routerOff: '调度时关闭',
|
|
9393
9813
|
teamOff: '调度员不用',
|
|
9394
9814
|
teamOffHint: '调度员把要并行的活交给队友,面板里能看到他们各自的任务;其他 bot 照常可以用子代理。',
|
|
9395
|
-
routerPartOff: '
|
|
9396
|
-
routerAllowed: '
|
|
9815
|
+
routerPartOff: '调度时部分关闭',
|
|
9816
|
+
routerAllowed: '调度时也可用',
|
|
9397
9817
|
routerAllowBack: '重新打开',
|
|
9398
|
-
routerOffShort: '
|
|
9818
|
+
routerOffShort: '调度时关闭',
|
|
9399
9819
|
routerNoticeTitle: '调度者现在只负责分派',
|
|
9400
|
-
routerNoticeBody: '
|
|
9820
|
+
routerNoticeBody: '它会听懂请求、把每件事作为任务交给队友并汇报结果;每个任务在自己的会话里进行,几件事可以同时推进。想让它顺手做些小事(比如联网查一下),在它资料页的「能力」里把那一项打开。',
|
|
9401
9821
|
routerNoticeOpen: '打开它的资料页',
|
|
9402
9822
|
routerNoticeOk: '知道了',
|
|
9403
9823
|
setTasks: '任务',
|