@kadaliao/dsh-bots 0.3.0 → 0.3.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/index.js +9 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -821,6 +821,8 @@ export function apply(ctx, config) {
|
|
|
821
821
|
const live = agents();
|
|
822
822
|
return store.list().map((b) => (b.sessionId ? live?.get?.(b.sessionId) : undefined)).find(Boolean) ?? live?.list?.()?.[0];
|
|
823
823
|
}
|
|
824
|
+
/** Description of each Harness skill as of the last registry read; fills skills stored without one. */
|
|
825
|
+
const dshSkillInfo = new Map();
|
|
824
826
|
/** The skills installed in this Harness, as a bot would see them (bot-registered ones left out). */
|
|
825
827
|
async function dshSkills() {
|
|
826
828
|
const registry = service(ctx, 'skills');
|
|
@@ -836,10 +838,12 @@ export function apply(ctx, config) {
|
|
|
836
838
|
rows = [];
|
|
837
839
|
}
|
|
838
840
|
}
|
|
839
|
-
|
|
841
|
+
const out = rows
|
|
840
842
|
.filter((r) => r.provider !== 'runtime' && r.source !== 'bots')
|
|
841
843
|
.map((r) => ({ name: r.name, description: String(r.description ?? '').replace(/\s+/g, ' ').slice(0, 400), source: r.source ?? '' }))
|
|
842
844
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
845
|
+
for (const r of out) dshSkillInfo.set(r.name, r.description);
|
|
846
|
+
return out;
|
|
843
847
|
}
|
|
844
848
|
|
|
845
849
|
async function catalog() {
|
|
@@ -897,7 +901,8 @@ export function apply(ctx, config) {
|
|
|
897
901
|
appIssues[app.id] = error?.message ?? String(error);
|
|
898
902
|
}
|
|
899
903
|
}
|
|
900
|
-
|
|
904
|
+
const skills = b.skills.map((s) => (s.source === 'dsh' && !s.description && dshSkillInfo.get(s.name) ? { ...s, description: dshSkillInfo.get(s.name) } : s));
|
|
905
|
+
return { ...b, skills, status: botStatus(b), appIssues };
|
|
901
906
|
});
|
|
902
907
|
const sessionMap = {};
|
|
903
908
|
for (const b of bots) if (b.sessionId) sessionMap[b.sessionId] = b.id;
|
|
@@ -937,7 +942,7 @@ export function apply(ctx, config) {
|
|
|
937
942
|
if (!team) throw new Error(`no team "${teamId}"`);
|
|
938
943
|
const zh = lang === 'zh';
|
|
939
944
|
const pick = (v) => (zh ? v.zh : v.en);
|
|
940
|
-
const have = new
|
|
945
|
+
const have = new Map((await dshSkills()).map((x) => [x.name, x.description]));
|
|
941
946
|
const tpl = templates();
|
|
942
947
|
const created = [];
|
|
943
948
|
const skipped = [];
|
|
@@ -945,7 +950,7 @@ export function apply(ctx, config) {
|
|
|
945
950
|
for (const b of team.bots) {
|
|
946
951
|
const skills = [];
|
|
947
952
|
for (const n of b.dshSkills ?? []) {
|
|
948
|
-
if (have.has(n)) skills.push({ name: n, source: 'dsh', description: '', enabled: true });
|
|
953
|
+
if (have.has(n)) skills.push({ name: n, source: 'dsh', description: have.get(n) ?? '', enabled: true });
|
|
949
954
|
else skipped.push({ bot: b.handle, kind: 'skill', name: n });
|
|
950
955
|
}
|
|
951
956
|
for (const spec of b.importSkills ?? []) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kadaliao/dsh-bots",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Grok-style bots for DeepSeek Harness: create bots with their own avatar, persona, skills, apps and scheduled tasks; they message each other and a dispatcher bot hands out the work.",
|
|
6
6
|
"exports": {
|