@kadaliao/dsh-bots 0.11.0 → 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 +32 -7
- package/README.zh-CN.md +23 -7
- package/client.js +128 -49
- package/index.js +94 -29
- package/lib/prompt.mjs +18 -2
- package/lib/settings.mjs +7 -0
- package/lib/team-migration.mjs +79 -0
- package/lib/teams-0.11.mjs +299 -0
- package/lib/teams.mjs +92 -92
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,12 +23,19 @@ It is built for two situations:
|
|
|
23
23
|
|
|
24
24
|
Open the Bots panel (sidebar, or `/bots`), pick a team template and click **Hire this team**:
|
|
25
25
|
|
|
26
|
-
| Team | Members | Scheduled tasks it
|
|
26
|
+
| Team | Members | Scheduled tasks it gives your dispatcher |
|
|
27
27
|
| --- | --- | --- |
|
|
28
|
-
| **One-person company** |
|
|
29
|
-
| **Software squad** |
|
|
30
|
-
| **Content studio** |
|
|
31
|
-
| **Research desk** |
|
|
28
|
+
| **One-person company** | Forge (engineer), Echo (growth), Harbor (customers), Ledger (finance) | Weekday 08:30 inbox sweep, weekday 09:00 morning brief, Monday numbers and market pulse, Friday 17:30 weekly review |
|
|
29
|
+
| **Software squad** | Builder, Tester, Review | — |
|
|
30
|
+
| **Content studio** | Scout (research), Quill (writer), Pixel (design) | Monday topic planning |
|
|
31
|
+
| **Research desk** | Memo (writer), Analyst, Market, Skeptic | — |
|
|
32
|
+
|
|
33
|
+
A team has no lead: there is one dispatcher, the front desk, and it hands out the work of every team you hire. Hire
|
|
34
|
+
a second team and it joins the same dispatcher; its bots are listed under their team, so the dispatcher sees who
|
|
35
|
+
belongs together. Within a team, the bot that delivers a kind of work asks its teammates for their parts: Builder has
|
|
36
|
+
Tester and Review check a change, Quill asks Scout for research and Pixel for visuals, Memo has Analyst and Market dig
|
|
37
|
+
and Skeptic check the draft. The dispatcher is an ordinary bot: rename it, give it another avatar or persona on its
|
|
38
|
+
**Profile**, or make another bot the dispatcher from its own Profile.
|
|
32
39
|
|
|
33
40
|
Hiring:
|
|
34
41
|
|
|
@@ -38,8 +45,9 @@ Hiring:
|
|
|
38
45
|
- imports role skills from [anthropics/skills](https://github.com/anthropics/skills) (webapp-testing,
|
|
39
46
|
frontend-design, brand-guidelines, …) with their scripts;
|
|
40
47
|
- adds the apps the role needs (GitHub, Stripe, HubSpot, …), whose keys you fill in later;
|
|
41
|
-
-
|
|
42
|
-
|
|
48
|
+
- gives your dispatcher the team's scheduled tasks (one it already has by that name is not added twice), and makes
|
|
49
|
+
one, Atlas, when you have none;
|
|
50
|
+
- offers to send the dispatcher a kickoff message, so the team starts working right away.
|
|
43
51
|
|
|
44
52
|

|
|
45
53
|
|
|
@@ -599,6 +607,23 @@ For the latest unreleased code, use the Git spec `git+https://github.com/kadalia
|
|
|
599
607
|
|
|
600
608
|
Refresh the page once after installing. For AI avatars, install [Images](https://github.com/kadaliao/dsh-images) too.
|
|
601
609
|
|
|
610
|
+
## Upgrading from 0.11.0
|
|
611
|
+
|
|
612
|
+
- Team templates have no lead any more, and teams you hired are brought along at the first start. Only what still reads
|
|
613
|
+
exactly as it was hired changes; a persona, bio or scheduled task you edited stays as it is:
|
|
614
|
+
- a lead that is your dispatcher (Atlas, Lead, Editor or Desk) keeps its name and becomes the front desk: its persona
|
|
615
|
+
and bio are the dispatcher's, the skills of its lead role go, and an app of that role (Lead's GitHub) is turned
|
|
616
|
+
off, its keys kept;
|
|
617
|
+
- members get their current persona and bio (Forge asks you itself, Builder has Tester and Review check its change,
|
|
618
|
+
Quill keeps the calendar…);
|
|
619
|
+
- the team's routine (morning brief, weekly review, inbox sweep, numbers, market pulse, topic planning) is the
|
|
620
|
+
dispatcher's, at the times it had; one the dispatcher already has by that name is not added twice.
|
|
621
|
+
- A lead that is not your dispatcher would only pass its messages on: the panel names it once and offers to remove it
|
|
622
|
+
(its teammates stay, its routine is already the dispatcher's).
|
|
623
|
+
- New members and skills (the research desk's Memo, Builder's GitHub, Echo's deep-research) come when you hire the
|
|
624
|
+
team again, which updates the members you have, their personas included.
|
|
625
|
+
- Hiring no longer asks whether the team's lead becomes the dispatcher: the team joins the one you have.
|
|
626
|
+
|
|
602
627
|
## Upgrading from 0.10
|
|
603
628
|
|
|
604
629
|
- Nothing to do: bots, tasks, memory, schedules, chat apps and pairings stay as they are; 0.11 adds `needs.json`
|
package/README.zh-CN.md
CHANGED
|
@@ -19,12 +19,17 @@ bot 在它的**讨论串**里回答,只看得到这条消息和它之前的内
|
|
|
19
19
|
|
|
20
20
|
打开 Bots 面板(左侧栏或 `/bots`),挑一个团队模板,点「雇用这个团队」:
|
|
21
21
|
|
|
22
|
-
| 团队 | 成员 |
|
|
22
|
+
| 团队 | 成员 | 交给调度员的定时任务 |
|
|
23
23
|
| --- | --- | --- |
|
|
24
|
-
| **一人公司** |
|
|
25
|
-
| **研发小队** |
|
|
26
|
-
| **内容工作室** |
|
|
27
|
-
| **研究台** |
|
|
24
|
+
| **一人公司** | Forge 工程师、Echo 增长、Harbor 客户、Ledger 财务 | 工作日 08:30 收件箱巡检、工作日 09:00 早间简报、周一财务数据和市场脉搏、周五 17:30 周复盘 |
|
|
25
|
+
| **研发小队** | Builder 开发、Tester 测试、Review 审查 | — |
|
|
26
|
+
| **内容工作室** | Scout 研究员、Quill 写手、Pixel 设计 | 周一选题会 |
|
|
27
|
+
| **研究台** | Memo 撰稿人、Analyst 分析师、Market 市场、Skeptic 怀疑者 | — |
|
|
28
|
+
|
|
29
|
+
团队不带负责人:调度员只有一个,是总前台,你雇的每个团队都由它分派工作。再雇一个团队,也是接到同一个调度员后面;
|
|
30
|
+
它看到的名单按团队分组,分得清谁和谁是一伙的。团队内部,交付某类工作的 bot 自己找队友要各自那一份:Builder 请 Tester
|
|
31
|
+
测试、Review 审查,Quill 请 Scout 调研、Pixel 配图,Memo 请 Analyst 和 Market 调研、Skeptic 核查草稿。
|
|
32
|
+
调度员是个普通 bot:可以在它的 **资料** 页改名字、换头像和人设,也可以在别的 bot 的资料页把它设为调度员。
|
|
28
33
|
|
|
29
34
|
雇用时会:
|
|
30
35
|
|
|
@@ -32,8 +37,8 @@ bot 在它的**讨论串**里回答,只看得到这条消息和它之前的内
|
|
|
32
37
|
- 给每个成员挂上**你这台 Harness 里已有的技能**(如 deep-research、last30days、xlsx、high-signal-review),没装的跳过并告诉你;
|
|
33
38
|
- 从 [anthropics/skills](https://github.com/anthropics/skills) 导入岗位需要的技能(如 webapp-testing、frontend-design、brand-guidelines),连同脚本一起下载;
|
|
34
39
|
- 加上岗位需要的应用(GitHub、Stripe、HubSpot 等),Key 之后在「应用」页补;
|
|
35
|
-
-
|
|
36
|
-
-
|
|
40
|
+
- 把团队的定时任务交给你的调度员(它已有同名任务的不重复添加),还没有调度员时新建一个 Atlas;
|
|
41
|
+
- 最后可以一键把「开场任务」发给调度员,团队就开始干活了。
|
|
37
42
|
|
|
38
43
|

|
|
39
44
|
|
|
@@ -473,6 +478,17 @@ https://raw.githubusercontent.com/kadaliao/dsh-plugins/main/marketplace.json
|
|
|
473
478
|
|
|
474
479
|
安装后刷新一次页面。想要 AI 头像,再装上[图片插件](https://github.com/kadaliao/dsh-images)。
|
|
475
480
|
|
|
481
|
+
## 从 0.11.0 升级
|
|
482
|
+
|
|
483
|
+
- 团队模板不再带负责人,已经雇的团队在第一次启动时自动跟上。只改仍和雇用时一字不差的内容;你改过的人设、简介或定时任务原样保留:
|
|
484
|
+
- 当调度员的负责人(Atlas、Lead、Editor 或 Desk)名字不变,变成总前台:人设和简介换成调度员的,负责人岗位带的技能去掉,
|
|
485
|
+
岗位带的应用(Lead 的 GitHub)关掉,Key 保留;
|
|
486
|
+
- 成员换成现在的人设和简介(Forge 自己问你、Builder 找 Tester 和 Review 检查、Quill 维护发布日历……);
|
|
487
|
+
- 团队的日常任务(早间简报、周复盘、收件箱巡检、每周数据、市场脉搏、本周选题)交给调度员,时间不变;调度员已有同名任务的不重复添加。
|
|
488
|
+
- 不是调度员的负责人只会替它传话:面板会列出一次,问你要不要删除(团队其他成员保留,日常任务已经交给调度员)。
|
|
489
|
+
- 新成员和新技能(研究台的 Memo、Builder 的 GitHub、Echo 的 deep-research)要再雇一次这个团队才会加上,已有成员会一并更新(人设也会换成模板的)。
|
|
490
|
+
- 雇用时不再问要不要让负责人当调度员:团队直接接到你现有的调度员后面。
|
|
491
|
+
|
|
476
492
|
## 从 0.10 升级
|
|
477
493
|
|
|
478
494
|
- 不用做什么:bot、任务、记忆、定时任务、聊天应用和配对都原样保留;新增 `needs.json` 存放需求。
|
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.11.
|
|
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/';
|
|
@@ -1152,22 +1152,27 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
1152
1152
|
|
|
1153
1153
|
// --- the panel: left rail ----------------------------------------------------------
|
|
1154
1154
|
|
|
1155
|
-
/**
|
|
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
|
+
*/
|
|
1156
1159
|
function groupByTeam(t, lang, bots) {
|
|
1157
1160
|
if (!bots.some((b) => b.team)) return null;
|
|
1158
1161
|
const groups = [];
|
|
1159
1162
|
for (const b of bots) {
|
|
1160
|
-
const id = b.team || '';
|
|
1163
|
+
const id = b.role === 'primary' ? 'desk' : b.team || '';
|
|
1161
1164
|
let g = groups.find((x) => x.id === id);
|
|
1162
1165
|
if (!g) groups.push((g = { id, bots: [] }));
|
|
1163
1166
|
g.bots.push(b);
|
|
1164
1167
|
}
|
|
1165
1168
|
const label = (id) => {
|
|
1169
|
+
if (id === 'desk') return t('dispatcher');
|
|
1166
1170
|
if (!id) return t('otherBots');
|
|
1167
1171
|
const team = teamsOf().find((x) => x.id === id);
|
|
1168
1172
|
return team ? pick(team.name, lang) : id;
|
|
1169
1173
|
};
|
|
1170
|
-
|
|
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) }));
|
|
1171
1176
|
}
|
|
1172
1177
|
|
|
1173
1178
|
/** A red count of what needs you (tasks, or a bot's questions). */
|
|
@@ -3978,6 +3983,48 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
3978
3983
|
);
|
|
3979
3984
|
}
|
|
3980
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
|
+
|
|
3981
4028
|
// --- avatar editor -----------------------------------------------------------------
|
|
3982
4029
|
|
|
3983
4030
|
function readDataUrl(file) {
|
|
@@ -7254,7 +7301,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7254
7301
|
const memberName = (m, lang) => pick(m.name, 'en') || pick(m.name, lang);
|
|
7255
7302
|
const teamCounts = (team) => ({
|
|
7256
7303
|
skills: (team.bots ?? []).reduce((n, b) => n + (b.skills ?? []).length, 0),
|
|
7257
|
-
tasks: (team.bots ?? []).reduce((n, b) => n + (b.tasks ?? []).length,
|
|
7304
|
+
tasks: (team.bots ?? []).reduce((n, b) => n + (b.tasks ?? []).length, (team.desk ?? []).length),
|
|
7258
7305
|
});
|
|
7259
7306
|
|
|
7260
7307
|
function TeamCard({ t, lang, team, onHire, onDetail, busy }) {
|
|
@@ -7289,7 +7336,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7289
7336
|
h('span', { style: { width: 7, height: 7, borderRadius: '50%', background: m.color, flex: 'none' } }),
|
|
7290
7337
|
h('span', { style: { fontWeight: 600, flex: 'none' } }, memberName(m, lang)),
|
|
7291
7338
|
h('span', { style: { color: C.muted, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, roleOf(m, lang)),
|
|
7292
|
-
m.role === 'primary' ? h('span', { title: t('dispatcher'), style: { color: '#f5b301', display: 'inline-flex', flex: 'none' } }, Icon.crown(11)) : null,
|
|
7293
7339
|
),
|
|
7294
7340
|
),
|
|
7295
7341
|
),
|
|
@@ -7383,7 +7429,40 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7383
7429
|
h('span', { style: { fontSize: TINY, color: C.faint, width: 36, flex: 'none', lineHeight: '22px' } }, label),
|
|
7384
7430
|
h('div', { style: { display: 'flex', alignItems: 'center', gap: 5, flexWrap: 'wrap', flex: 1, minWidth: 0 } }, chips),
|
|
7385
7431
|
);
|
|
7386
|
-
|
|
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 }) {
|
|
7387
7466
|
const members = Array.isArray(team.bots) ? team.bots : [];
|
|
7388
7467
|
const appName = (id) => {
|
|
7389
7468
|
const e = (entries ?? []).find((x) => x.id === id);
|
|
@@ -7397,7 +7476,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7397
7476
|
width: 760,
|
|
7398
7477
|
onClose,
|
|
7399
7478
|
footer: [
|
|
7400
|
-
|
|
7479
|
+
h('span', { key: 'p', style: { flex: 1 } }),
|
|
7401
7480
|
h(Btn, { key: 'c', onClick: onClose }, t('cancel')),
|
|
7402
7481
|
h(Btn, { key: 'h', kind: 'primary', icon: Icon.team(14), onClick: () => onHire(team), 'data-dsh-bots-hire-modal': team.id }, t('hireTeam')),
|
|
7403
7482
|
],
|
|
@@ -7406,11 +7485,12 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7406
7485
|
h(
|
|
7407
7486
|
'div',
|
|
7408
7487
|
{ style: { display: 'flex', flexDirection: 'column', gap: 10 } },
|
|
7488
|
+
h(TeamDeskRow, { t, lang, team, desk }),
|
|
7409
7489
|
members.map((m) =>
|
|
7410
7490
|
h(
|
|
7411
7491
|
'div',
|
|
7412
7492
|
{ key: m.key, className: 'dshb-card', 'data-dsh-bots-member': m.key, style: { display: 'flex', gap: 12, alignItems: 'flex-start' } },
|
|
7413
|
-
h(Avatar, { avatar: memberAvatar(m), name: memberName(m, lang), size: 40
|
|
7493
|
+
h(Avatar, { avatar: memberAvatar(m), name: memberName(m, lang), size: 40 }),
|
|
7414
7494
|
h(
|
|
7415
7495
|
'div',
|
|
7416
7496
|
{ style: { flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 7 } },
|
|
@@ -7419,7 +7499,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7419
7499
|
{ style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' } },
|
|
7420
7500
|
h('span', { style: { fontWeight: 700 } }, pick(m.name, lang)),
|
|
7421
7501
|
h('span', { className: 'dshb-mono', style: { fontSize: TINY, color: C.faint } }, `@${m.handle}`),
|
|
7422
|
-
m.role === 'primary' ? h(Badge, { color: '#d99a00' }, Icon.crown(10), t('dispatcher')) : null,
|
|
7423
7502
|
),
|
|
7424
7503
|
h('div', { style: { fontSize: SMALL, color: C.muted, lineHeight: 1.55 } }, pick(m.bio, lang)),
|
|
7425
7504
|
(m.skills ?? []).length ? chipRow(t('tab_skills'), m.skills.map((s) => h(SkillChip, { key: `${s.source}:${s.name}`, t, skill: s }))) : null,
|
|
@@ -7437,20 +7516,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7437
7516
|
h('span', { key: 'later', style: { fontSize: TINY, color: C.faint } }, t('appKeyLater')),
|
|
7438
7517
|
)
|
|
7439
7518
|
: null,
|
|
7440
|
-
(m.tasks ?? []).length
|
|
7441
|
-
? chipRow(
|
|
7442
|
-
t('teamTasks'),
|
|
7443
|
-
m.tasks.map((task, i) =>
|
|
7444
|
-
h(
|
|
7445
|
-
'span',
|
|
7446
|
-
{ 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 } },
|
|
7447
|
-
Icon.clock(10),
|
|
7448
|
-
h('span', { style: { fontWeight: 600 } }, pick(task.title, lang)),
|
|
7449
|
-
h('span', { style: { color: C.muted } }, teamWhen(t, task.when)),
|
|
7450
|
-
),
|
|
7451
|
-
),
|
|
7452
|
-
)
|
|
7453
|
-
: null,
|
|
7519
|
+
(m.tasks ?? []).length ? chipRow(t('teamTasks'), m.tasks.map((task, i) => routineChip(t, lang, task, i))) : null,
|
|
7454
7520
|
),
|
|
7455
7521
|
),
|
|
7456
7522
|
),
|
|
@@ -7464,26 +7530,17 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7464
7530
|
),
|
|
7465
7531
|
);
|
|
7466
7532
|
}
|
|
7467
|
-
function PrimaryTick({ t, primary, setPrimary }) {
|
|
7468
|
-
return h(
|
|
7469
|
-
'label',
|
|
7470
|
-
{ style: { flex: 1, display: 'inline-flex', alignItems: 'center', gap: 7, fontSize: SMALL, color: C.muted, cursor: 'pointer' } },
|
|
7471
|
-
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)' } }),
|
|
7472
|
-
t('leadAsDispatcher'),
|
|
7473
|
-
);
|
|
7474
|
-
}
|
|
7475
|
-
|
|
7476
7533
|
/**
|
|
7477
7534
|
* Hiring a team: confirm (only when a roster exists), then a progress state,
|
|
7478
7535
|
* then what was created, skipped and still needs keys, with the kickoff.
|
|
7479
7536
|
*/
|
|
7480
7537
|
function HireModal({ t, lang, hire, setHire, onDone, onOpenBot, toast, catalog }) {
|
|
7481
|
-
const { team, phase, result
|
|
7538
|
+
const { team, phase, result } = hire;
|
|
7482
7539
|
const [sending, setSending] = useState(false);
|
|
7483
7540
|
const close = () => setHire(null);
|
|
7484
7541
|
const go = () => {
|
|
7485
7542
|
setHire({ ...hire, phase: 'busy' });
|
|
7486
|
-
postJson('teams/hire', { id: team.id, lang
|
|
7543
|
+
postJson('teams/hire', { id: team.id, lang })
|
|
7487
7544
|
.then((r) => {
|
|
7488
7545
|
if (r?.ok) {
|
|
7489
7546
|
setHire({ ...hire, phase: 'done', result: r });
|
|
@@ -7506,7 +7563,6 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7506
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'))],
|
|
7507
7564
|
},
|
|
7508
7565
|
h('div', { style: { fontSize: FONT, color: C.muted, lineHeight: 1.6 } }, t('hireConfirmBody', { n: (team.bots ?? []).length })),
|
|
7509
|
-
h(PrimaryTick, { t, primary, setPrimary: (v) => setHire({ ...hire, primary: v }) }),
|
|
7510
7566
|
);
|
|
7511
7567
|
if (phase === 'busy' || phase === 'start')
|
|
7512
7568
|
return h(
|
|
@@ -7529,7 +7585,8 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7529
7585
|
// done
|
|
7530
7586
|
const r = result ?? {};
|
|
7531
7587
|
const made = (Array.isArray(r.bots) ? r.bots : []).map((b) => botById(b.id) ?? b);
|
|
7532
|
-
|
|
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;
|
|
7533
7590
|
const skipped = Array.isArray(r.skipped) ? r.skipped : [];
|
|
7534
7591
|
const entries = Array.isArray(catalog?.templates) ? catalog.templates : [];
|
|
7535
7592
|
const needKeys = [];
|
|
@@ -7582,7 +7639,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7582
7639
|
{ key: b.id, className: 'dshb-chip', style: { height: 32, paddingLeft: 4, cursor: 'default', color: C.primary } },
|
|
7583
7640
|
h(Avatar, { avatar: b.avatar, name: b.name, size: 24 }),
|
|
7584
7641
|
h('span', { style: { fontWeight: 600 } }, b.name),
|
|
7585
|
-
b.id === r.
|
|
7642
|
+
b.id === r.dispatcherId ? h('span', { style: { color: '#f5b301', display: 'inline-flex' } }, Icon.crown(10)) : null,
|
|
7586
7643
|
),
|
|
7587
7644
|
),
|
|
7588
7645
|
),
|
|
@@ -7655,12 +7712,12 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7655
7712
|
const [creating, setCreating] = useState(false);
|
|
7656
7713
|
const [detail, setDetail] = useState(null); // a team shown in the detail modal
|
|
7657
7714
|
const [hire, setHire] = useState(null); // {team, phase: confirm|start|busy|done|error, primary, result?}
|
|
7658
|
-
const [primaryTick, setPrimaryTick] = useState(true);
|
|
7659
7715
|
const [settings, setSettings] = useState(false);
|
|
7660
7716
|
const [ticketId, setTicketId] = useState(null); // the task shown in the Tasks view
|
|
7661
7717
|
const [needId, setNeedId] = useState(null); // the request shown in the Requests view
|
|
7662
7718
|
const [tasksBot, setTasksBot] = useState(''); // the Tasks view's bot filter when another view asked for it
|
|
7663
7719
|
const [noticeGone, setNoticeGone] = useState(false);
|
|
7720
|
+
const [leadsGone, setLeadsGone] = useState(false);
|
|
7664
7721
|
const [toast, showToast] = useToast();
|
|
7665
7722
|
const seenNav = useRef(0);
|
|
7666
7723
|
const bots = Array.isArray(s.state?.bots) ? s.state.bots : [];
|
|
@@ -7684,13 +7741,11 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7684
7741
|
}, [s.nav.tick]);
|
|
7685
7742
|
const current = bots.find((b) => b.id === selected) ?? bots.find((b) => b.id === primaryId) ?? bots[0] ?? null;
|
|
7686
7743
|
const shownView = view ?? (s.state && bots.length <= 1 && !bots.some((b) => b.team) ? 'hero' : 'bot');
|
|
7687
|
-
|
|
7688
|
-
/** 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. */
|
|
7689
7745
|
const startHire = (team, fromDetail = false) => {
|
|
7690
7746
|
setDetail(null);
|
|
7691
7747
|
const real = bots.filter((b) => !(b.role === 'primary' && bots.length === 1 && !b.team && (b.skills ?? []).length === 0));
|
|
7692
|
-
|
|
7693
|
-
setHire({ team, primary, phase: real.length === 0 || fromDetail ? 'start' : 'confirm' });
|
|
7748
|
+
setHire({ team, phase: real.length === 0 || fromDetail ? 'start' : 'confirm' });
|
|
7694
7749
|
};
|
|
7695
7750
|
const openBotTab = (id, tabId) => {
|
|
7696
7751
|
setSelected(id);
|
|
@@ -7723,7 +7778,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7723
7778
|
} else if (shownView === 'memory') {
|
|
7724
7779
|
main = h(TeamMemoryView, { t, toast: showToast, onSettings: () => setSettings(true) });
|
|
7725
7780
|
} else if (shownView === 'hero' || shownView === 'teams' || !current) {
|
|
7726
|
-
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) });
|
|
7727
7782
|
} else {
|
|
7728
7783
|
main = h(BotDetail, { t, bot: current, primaryId, env: env2, toast: showToast, catalog, tab, setTab, onDeleted: () => setSelected(null), onSettings: () => setSettings(true) });
|
|
7729
7784
|
}
|
|
@@ -7776,6 +7831,18 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7776
7831
|
},
|
|
7777
7832
|
})
|
|
7778
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,
|
|
7779
7846
|
main,
|
|
7780
7847
|
),
|
|
7781
7848
|
creating
|
|
@@ -7791,7 +7858,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
7791
7858
|
})
|
|
7792
7859
|
: null,
|
|
7793
7860
|
detail
|
|
7794
|
-
? 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) })
|
|
7795
7862
|
: null,
|
|
7796
7863
|
hire ? h(HireModal, { t, lang, hire, setHire, toast: showToast, catalog, onDone: openBotTab, onOpenBot: openBotTab }) : null,
|
|
7797
7864
|
settings ? h(SettingsModal, { t, catalog, toast: showToast, onClose: () => setSettings(false) }) : null,
|
|
@@ -8494,7 +8561,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
8494
8561
|
teamTemplatesHint: "Hire a ready-made team",
|
|
8495
8562
|
teamTemplatesSub: "Each team comes with personas, Harness skills, apps and scheduled tasks. Anything this Harness lacks is skipped.",
|
|
8496
8563
|
teamsHeroTitle: "Build your bot team",
|
|
8497
|
-
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.",
|
|
8498
8565
|
noTeams: "No team templates.",
|
|
8499
8566
|
orBlank: "Prefer to start from scratch?",
|
|
8500
8567
|
teamDaily: "Daily {time}",
|
|
@@ -8512,7 +8579,13 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
8512
8579
|
legendHarness: "Harness skill",
|
|
8513
8580
|
legendGithub: "imported from GitHub",
|
|
8514
8581
|
legendMissing: "not installed, skipped",
|
|
8515
|
-
|
|
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}.",
|
|
8516
8589
|
hireFailed: "Could not hire the team.",
|
|
8517
8590
|
hireTitle: "Hire {name}",
|
|
8518
8591
|
hireConfirmBody: "This adds {n} bots next to the ones you have. Their skills, apps and scheduled tasks are set up for you.",
|
|
@@ -9418,7 +9491,7 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
9418
9491
|
teamTemplatesHint: "雇用一支现成的团队",
|
|
9419
9492
|
teamTemplatesSub: "每个团队都配好了人设、Harness 技能、应用和定时任务。当前 Harness 没有的会自动跳过。",
|
|
9420
9493
|
teamsHeroTitle: "组建你的 Bot 团队",
|
|
9421
|
-
teamsHeroBody: "为一人公司或需要多人协作的工作,直接雇用一支现成的团队。每个 Bot 都带着人设、你 Harness
|
|
9494
|
+
teamsHeroBody: "为一人公司或需要多人协作的工作,直接雇用一支现成的团队。每个 Bot 都带着人设、你 Harness 里已有的技能、应用和日常任务上岗;雇几个团队,都由你的调度员统一分派工作。",
|
|
9422
9495
|
noTeams: "没有团队模板。",
|
|
9423
9496
|
orBlank: "想从零开始?",
|
|
9424
9497
|
teamDaily: "每天 {time}",
|
|
@@ -9436,7 +9509,13 @@ button.dshb-qline-light:hover{color:inherit;opacity:1}
|
|
|
9436
9509
|
legendHarness: "Harness 技能",
|
|
9437
9510
|
legendGithub: "从 GitHub 导入",
|
|
9438
9511
|
legendMissing: "未安装,将跳过",
|
|
9439
|
-
|
|
9512
|
+
teamDesk: "这个团队的工作和其他团队一样,由你的调度员统一分派,团队的日常任务也交给它。",
|
|
9513
|
+
teamDeskNew: "你还没有调度员:雇用时会新建一个 Atlas 来分派工作,可以在它的资料页改名。",
|
|
9514
|
+
oldLeadsTitle: "团队不再有负责人",
|
|
9515
|
+
oldLeadsBody: "{desk} 统一分派所有团队的工作,以负责人身份雇来的 {names} 只会替它传话。要删除吗?它们手上的任务会停止,定时任务一并删除;团队其他成员保留。",
|
|
9516
|
+
oldLeadsRemove: "删除",
|
|
9517
|
+
oldLeadsKeep: "保留",
|
|
9518
|
+
oldLeadsFailed: "没能删除 {names}。",
|
|
9440
9519
|
hireFailed: "没能雇用这个团队。",
|
|
9441
9520
|
hireTitle: "雇用{name}",
|
|
9442
9521
|
hireConfirmBody: "将在现有 Bot 之外新增 {n} 个 Bot,并自动配好它们的技能、应用和定时任务。",
|