@kadaliao/dsh-bots 0.3.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -4
- package/README.zh-CN.md +119 -3
- package/client.js +564 -43
- package/index.js +186 -25
- package/lib/apps.mjs +150 -5
- package/lib/channels/discord.mjs +590 -0
- package/lib/channels/feishu.mjs +1249 -0
- package/lib/channels/slack.mjs +906 -0
- package/lib/channels/telegram.mjs +300 -0
- package/lib/channels.mjs +893 -0
- package/lib/logos.mjs +54 -0
- package/lib/prompt.mjs +9 -1
- package/lib/skills.mjs +199 -6
- package/lib/store.mjs +22 -3
- package/logos/amap.png +0 -0
- package/logos/anthropic.png +0 -0
- package/logos/baidu-map.png +0 -0
- package/logos/brave.png +0 -0
- package/logos/context7.png +0 -0
- package/logos/discord.png +0 -0
- package/logos/exa.png +0 -0
- package/logos/feishu.png +0 -0
- package/logos/firecrawl.png +0 -0
- package/logos/git.png +0 -0
- package/logos/github.png +0 -0
- package/logos/hubspot.png +0 -0
- package/logos/mcp.png +0 -0
- package/logos/notion.png +0 -0
- package/logos/playwright.png +0 -0
- package/logos/postgres.png +0 -0
- package/logos/sentry.png +0 -0
- package/logos/slack.png +0 -0
- package/logos/sqlite.png +0 -0
- package/logos/stripe.png +0 -0
- package/logos/supabase.png +0 -0
- package/logos/tavily.png +0 -0
- package/logos/telegram.png +0 -0
- package/package.json +3 -1
package/lib/logos.mjs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App logos: each catalog app is shown with its vendor's own logo
|
|
3
|
+
* (`logos/<name>.png`, 128 px, square; the page rounds the corners). Apps
|
|
4
|
+
* without one, such as the custom servers, keep their letter tile.
|
|
5
|
+
*
|
|
6
|
+
* Sources: the App Store icon where the vendor ships an app, otherwise the
|
|
7
|
+
* logo from the vendor's site or repository, or the Simple Icons mark (CC0)
|
|
8
|
+
* in the brand colour. The logos are the trademarks of their owners and are
|
|
9
|
+
* used only to identify each service.
|
|
10
|
+
*
|
|
11
|
+
* @module @kadaliao/dsh-bots/lib/logos
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Catalog app id → logo file name (without `.png`). */
|
|
15
|
+
export const LOGOS = {
|
|
16
|
+
playwright: 'playwright',
|
|
17
|
+
exa: 'exa',
|
|
18
|
+
tavily: 'tavily',
|
|
19
|
+
'brave-search': 'brave',
|
|
20
|
+
firecrawl: 'firecrawl',
|
|
21
|
+
github: 'github',
|
|
22
|
+
git: 'git',
|
|
23
|
+
context7: 'context7',
|
|
24
|
+
sentry: 'sentry',
|
|
25
|
+
notion: 'notion',
|
|
26
|
+
memory: 'mcp',
|
|
27
|
+
sqlite: 'sqlite',
|
|
28
|
+
postgres: 'postgres',
|
|
29
|
+
amap: 'amap',
|
|
30
|
+
'baidu-map': 'baidu-map',
|
|
31
|
+
slack: 'slack',
|
|
32
|
+
'slack-chat': 'slack',
|
|
33
|
+
telegram: 'telegram',
|
|
34
|
+
discord: 'discord',
|
|
35
|
+
'feishu-chat': 'feishu',
|
|
36
|
+
feishu: 'feishu',
|
|
37
|
+
stripe: 'stripe',
|
|
38
|
+
hubspot: 'hubspot',
|
|
39
|
+
supabase: 'supabase',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Logos used outside the app catalog (the featured skill source). */
|
|
43
|
+
const OTHER = ['anthropic'];
|
|
44
|
+
|
|
45
|
+
const NAME_RE = /^[a-z0-9-]{1,40}$/;
|
|
46
|
+
|
|
47
|
+
/** Whether `name` is a logo file name the plugin may serve. */
|
|
48
|
+
export const isLogoName = (name) => NAME_RE.test(String(name ?? '')) && (Object.values(LOGOS).includes(name) || OTHER.includes(name));
|
|
49
|
+
|
|
50
|
+
/** A catalog entry with its `logo` file name, when it has one. */
|
|
51
|
+
export function withLogo(entry) {
|
|
52
|
+
const logo = LOGOS[entry?.id];
|
|
53
|
+
return logo ? { ...entry, logo } : entry;
|
|
54
|
+
}
|
package/lib/prompt.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export function rosterLine(bot, selfId) {
|
|
|
16
16
|
* bot's conversation only.
|
|
17
17
|
* @param {object} bot
|
|
18
18
|
* @param {object[]} roster - every bot, the bot itself included.
|
|
19
|
-
* @param {{skillsInline?: boolean, apps?: string[]}} [extra]
|
|
19
|
+
* @param {{skillsInline?: boolean, apps?: string[], skillNames?: object, channels?: string[]}} [extra] - `channels`: chat apps the team is reachable from ('Telegram').
|
|
20
20
|
*/
|
|
21
21
|
export function personaText(bot, roster, extra = {}) {
|
|
22
22
|
const lines = [];
|
|
@@ -61,6 +61,14 @@ export function personaText(bot, roster, extra = {}) {
|
|
|
61
61
|
for (const s of inline) lines.push('', `### ${s.name}`, s.description, '', s.content.trim());
|
|
62
62
|
}
|
|
63
63
|
if (extra.apps?.length) lines.push('', '## Your apps', `Tools from these connected apps are yours: ${extra.apps.join(', ')} (named \`mcp__<app>__<tool>\`).`);
|
|
64
|
+
if (extra.channels?.length) {
|
|
65
|
+
const first = extra.channels[0];
|
|
66
|
+
lines.push(
|
|
67
|
+
'',
|
|
68
|
+
'## Chat apps',
|
|
69
|
+
`The user can also reach the team from ${extra.channels.join(' and ')}. A message that starts with "[${first} · Name]" was sent from that chat app by someone the user paired (usually the user). Treat it like any request from the user: your reply is sent back to that chat as plain text, so keep it short, skip tables, and say plainly what you did or who is on it.`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
64
72
|
return lines.join('\n');
|
|
65
73
|
}
|
|
66
74
|
|
package/lib/skills.mjs
CHANGED
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
* Where a bot's skills come from, besides writing one by hand:
|
|
3
3
|
* - the skills already installed in DeepSeek Harness (~/.agents/skills, ~/.dsh/skills, bundled);
|
|
4
4
|
* - a GitHub folder or repository that holds SKILL.md files (anthropics/skills and the like);
|
|
5
|
-
* - a raw SKILL.md URL
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* - a raw SKILL.md URL;
|
|
6
|
+
* - a folder on this machine (a skill folder, or a folder of them).
|
|
7
|
+
* A GitHub import copies the whole skill folder under the bots cache, so scripts and
|
|
8
|
+
* references the skill mentions keep working. A local folder is linked, never copied:
|
|
9
|
+
* the bot reads it where it is, so editing it there is enough.
|
|
8
10
|
*
|
|
9
11
|
* @module @kadaliao/dsh-bots/lib/skills
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
|
-
import { mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
13
|
-
import {
|
|
14
|
+
import { mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
15
|
+
import { homedir } from 'node:os';
|
|
16
|
+
import { basename, dirname, join, normalize, resolve } from 'node:path';
|
|
14
17
|
|
|
15
18
|
/** Skill collections worth browsing, shown as one-click sources. */
|
|
16
19
|
export const SKILL_SOURCES = [
|
|
17
|
-
{ id: 'anthropics', repo: 'anthropics/skills', path: 'skills', name: { en: 'Anthropic skills', zh: 'Anthropic 官方技能' }, description: { en: 'Documents, design, web apps, MCP building, brand and comms.', zh: '文档、设计、网页应用、MCP 开发、品牌与内部沟通。' } },
|
|
20
|
+
{ id: 'anthropics', repo: 'anthropics/skills', path: 'skills', logo: 'anthropic', name: { en: 'Anthropic skills', zh: 'Anthropic 官方技能' }, description: { en: 'Documents, design, web apps, MCP building, brand and comms.', zh: '文档、设计、网页应用、MCP 开发、品牌与内部沟通。' } },
|
|
18
21
|
];
|
|
19
22
|
|
|
20
23
|
/** Split YAML-ish front matter: `name`, `description` (folded or quoted). */
|
|
@@ -144,3 +147,193 @@ export async function importUrlSkill(url, { fetchImpl = fetch, signal } = {}) {
|
|
|
144
147
|
const fallback = url.split('/').filter(Boolean).slice(-2, -1)[0] ?? 'skill';
|
|
145
148
|
return { name: meta.name || fallback, description: meta.description, content: meta.body.trim(), origin: url };
|
|
146
149
|
}
|
|
150
|
+
|
|
151
|
+
// --- a folder on this machine ----------------------------------------------------------
|
|
152
|
+
|
|
153
|
+
/** Folders never walked into: dependencies, and anything hidden. */
|
|
154
|
+
const skipDir = (name) => name.startsWith('.') || name === 'node_modules';
|
|
155
|
+
/** How deep below the chosen folder skills are looked for, and how many folders are read. */
|
|
156
|
+
const LOCAL_DEPTH = 4;
|
|
157
|
+
const LOCAL_DIRS = 3000;
|
|
158
|
+
const LOCAL_SKILLS = 200;
|
|
159
|
+
|
|
160
|
+
/** What a user types or pastes as a folder: `~`, quotes and a trailing SKILL.md are accepted. */
|
|
161
|
+
export function resolveLocalPath(input, home = homedir()) {
|
|
162
|
+
let p = String(input ?? '').trim().replace(/^(['"])(.*)\1$/, '$2').replace(/^file:\/\//, '');
|
|
163
|
+
if (p === '') return '';
|
|
164
|
+
if (p === '~' || p.startsWith('~/') || p.startsWith('~\\')) p = join(home, p.slice(1));
|
|
165
|
+
p = resolve(p);
|
|
166
|
+
if (/^SKILL\.md$/i.test(basename(p))) p = dirname(p);
|
|
167
|
+
return p;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const statOf = (p) => {
|
|
171
|
+
try {
|
|
172
|
+
return statSync(p);
|
|
173
|
+
} catch {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const entriesOf = (dir) => {
|
|
178
|
+
try {
|
|
179
|
+
return readdirSync(dir).sort();
|
|
180
|
+
} catch {
|
|
181
|
+
return [];
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
/** The SKILL.md of a folder, whatever its letter case; '' when there is none. */
|
|
185
|
+
const skillFileOf = (dir, names = entriesOf(dir)) => {
|
|
186
|
+
const name = names.find((n) => /^SKILL\.md$/i.test(n));
|
|
187
|
+
return name && statOf(join(dir, name))?.isFile() ? join(dir, name) : '';
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/** Every file of one skill folder (links followed once, hidden entries and dependencies left out). */
|
|
191
|
+
function localFiles(root) {
|
|
192
|
+
const files = [];
|
|
193
|
+
const seen = new Set();
|
|
194
|
+
let bytes = 0;
|
|
195
|
+
const walk = (dir, rel) => {
|
|
196
|
+
let real;
|
|
197
|
+
try {
|
|
198
|
+
real = realpathSync(dir);
|
|
199
|
+
} catch {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (seen.has(real)) return;
|
|
203
|
+
seen.add(real);
|
|
204
|
+
for (const name of entriesOf(dir)) {
|
|
205
|
+
if (skipDir(name)) continue;
|
|
206
|
+
const st = statOf(join(dir, name));
|
|
207
|
+
if (!st) continue;
|
|
208
|
+
if (st.isDirectory()) walk(join(dir, name), rel ? `${rel}/${name}` : name);
|
|
209
|
+
else if (st.isFile()) {
|
|
210
|
+
files.push({ rel: rel ? `${rel}/${name}` : name, path: join(dir, name), size: st.size });
|
|
211
|
+
bytes += st.size;
|
|
212
|
+
}
|
|
213
|
+
if (files.length > MAX_FILES) return;
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
walk(root, '');
|
|
217
|
+
return { files, bytes };
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The skills inside a local folder: the folder itself when it holds a SKILL.md,
|
|
222
|
+
* else every folder below it (a few levels) that does.
|
|
223
|
+
* @returns {{root: string, skills: {name, description, path, files: number}[], truncated: boolean}}
|
|
224
|
+
*/
|
|
225
|
+
export function listLocalSkills(input, { home } = {}) {
|
|
226
|
+
const root = resolveLocalPath(input, home);
|
|
227
|
+
if (root === '') throw new Error('give a folder');
|
|
228
|
+
const st = statOf(root);
|
|
229
|
+
if (!st) throw new Error(`no such folder: ${root}`);
|
|
230
|
+
if (!st.isDirectory()) throw new Error(`not a folder: ${root}`);
|
|
231
|
+
const found = [];
|
|
232
|
+
const seen = new Set();
|
|
233
|
+
let read = 0;
|
|
234
|
+
let truncated = false;
|
|
235
|
+
const walk = (dir, depth) => {
|
|
236
|
+
if (found.length >= LOCAL_SKILLS || read >= LOCAL_DIRS) {
|
|
237
|
+
truncated = true;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
let real;
|
|
241
|
+
try {
|
|
242
|
+
real = realpathSync(dir);
|
|
243
|
+
} catch {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (seen.has(real)) return;
|
|
247
|
+
seen.add(real);
|
|
248
|
+
read += 1;
|
|
249
|
+
const names = entriesOf(dir);
|
|
250
|
+
const file = skillFileOf(dir, names);
|
|
251
|
+
if (file) {
|
|
252
|
+
found.push({ dir, file });
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (depth >= LOCAL_DEPTH) return;
|
|
256
|
+
for (const name of names) if (!skipDir(name) && statOf(join(dir, name))?.isDirectory()) walk(join(dir, name), depth + 1);
|
|
257
|
+
};
|
|
258
|
+
walk(root, 0);
|
|
259
|
+
const skills = found.map(({ dir, file }) => {
|
|
260
|
+
let meta = { name: '', description: '' };
|
|
261
|
+
try {
|
|
262
|
+
meta = parseSkillMd(readFileSync(file, 'utf8'));
|
|
263
|
+
} catch {
|
|
264
|
+
// Listed by its folder name.
|
|
265
|
+
}
|
|
266
|
+
return { name: meta.name || basename(dir), description: meta.description.slice(0, 600), path: dir, files: localFiles(dir).files.length };
|
|
267
|
+
});
|
|
268
|
+
return { root, skills: skills.sort((a, b) => a.name.localeCompare(b.name)), truncated };
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** What a linked skill folder says right now; null when the folder or its SKILL.md is gone. */
|
|
272
|
+
export function readLinkedSkill(dir) {
|
|
273
|
+
const file = skillFileOf(dir);
|
|
274
|
+
if (!file) return null;
|
|
275
|
+
try {
|
|
276
|
+
const meta = parseSkillMd(readFileSync(file, 'utf8'));
|
|
277
|
+
return { name: meta.name || basename(dir), description: meta.description, content: meta.body.trim(), stamp: `${statSync(file).mtimeMs}:${statSync(file).size}` };
|
|
278
|
+
} catch {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Link one local skill folder: nothing is copied, the bot reads the folder itself,
|
|
285
|
+
* so an edit there reaches the bot. `content` is what it said when linked, kept as a fallback.
|
|
286
|
+
* @returns {{name, description, content, dir, origin, linked: true}}
|
|
287
|
+
*/
|
|
288
|
+
export function linkLocalSkill(input, { home } = {}) {
|
|
289
|
+
const src = resolveLocalPath(input, home);
|
|
290
|
+
if (src === '' || !statOf(src)?.isDirectory()) throw new Error(`no such folder: ${src || input}`);
|
|
291
|
+
const now = readLinkedSkill(src);
|
|
292
|
+
if (!now) throw new Error(`no SKILL.md in ${src}`);
|
|
293
|
+
return { name: now.name, description: now.description, content: now.content, dir: src, origin: src, linked: true };
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** Whether a skill's origin is a folder on this machine (not a URL). */
|
|
297
|
+
export const isLocalOrigin = (origin) => typeof origin === 'string' && origin !== '' && !/^https?:\/\//i.test(origin);
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Merge freshly imported skills into a bot's list without doubling any:
|
|
301
|
+
* - a new name is added;
|
|
302
|
+
* - the same name from the same origin replaces the old entry in place (an update: id and on/off kept);
|
|
303
|
+
* - the same name from anywhere else is left alone and reported (`exists`), as is one past the limit (`full`).
|
|
304
|
+
* Names compare case-insensitively.
|
|
305
|
+
* @returns {{skills: object[], added: string[], updated: string[], skipped: {name, reason}[], dropped: object[]}}
|
|
306
|
+
* `dropped` are skill objects whose copied folder is no longer used.
|
|
307
|
+
*/
|
|
308
|
+
export function mergeImported(current, incoming, { limit = 50 } = {}) {
|
|
309
|
+
const skills = [...current];
|
|
310
|
+
const added = [];
|
|
311
|
+
const updated = [];
|
|
312
|
+
const skipped = [];
|
|
313
|
+
const dropped = [];
|
|
314
|
+
const key = (s) => String(s.name).trim().toLowerCase();
|
|
315
|
+
for (const item of incoming) {
|
|
316
|
+
const at = skills.findIndex((s) => key(s) === key(item));
|
|
317
|
+
if (at < 0) {
|
|
318
|
+
if (skills.length >= limit) {
|
|
319
|
+
skipped.push({ name: item.name, reason: 'full' });
|
|
320
|
+
dropped.push(item);
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
skills.push(item);
|
|
324
|
+
added.push(item.name);
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
const old = skills[at];
|
|
328
|
+
const fresh = added.includes(old.name) || updated.includes(old.name);
|
|
329
|
+
if (!fresh && old.source === 'import' && old.origin && old.origin === item.origin) {
|
|
330
|
+
skills[at] = { ...item, id: old.id, enabled: old.enabled };
|
|
331
|
+
updated.push(item.name);
|
|
332
|
+
if (old.dir && old.dir !== item.dir) dropped.push(old);
|
|
333
|
+
} else {
|
|
334
|
+
skipped.push({ name: item.name, reason: 'exists' });
|
|
335
|
+
dropped.push(item);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return { skills, added, updated, skipped, dropped };
|
|
339
|
+
}
|
package/lib/store.mjs
CHANGED
|
@@ -102,7 +102,8 @@ function normalizeAvatar(a, seed = 0) {
|
|
|
102
102
|
* One skill of a bot:
|
|
103
103
|
* - `own`: written for this bot (content kept here);
|
|
104
104
|
* - `dsh`: an installed Harness skill, by name (content read live from DSH);
|
|
105
|
-
* - `import`: copied from GitHub or a URL
|
|
105
|
+
* - `import`: copied from GitHub or a URL (`dir` holds the copy), or `linked` to a local
|
|
106
|
+
* folder (`dir` is that folder, read live).
|
|
106
107
|
*/
|
|
107
108
|
function normalizeSkill(s) {
|
|
108
109
|
const name = str(s?.name, 80).trim();
|
|
@@ -116,10 +117,27 @@ function normalizeSkill(s) {
|
|
|
116
117
|
content: source === 'dsh' ? '' : str(s?.content, 200_000),
|
|
117
118
|
enabled: bool(s?.enabled, true),
|
|
118
119
|
...(source === 'import' && typeof s?.dir === 'string' ? { dir: s.dir } : {}),
|
|
120
|
+
...(source === 'import' && typeof s?.dir === 'string' && s?.linked === true ? { linked: true } : {}),
|
|
119
121
|
...(typeof s?.origin === 'string' && s.origin ? { origin: str(s.origin, 500) } : {}),
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Drop the repeats of a skill that is there twice for certain: a Harness skill linked
|
|
127
|
+
* twice by name, or the same import (name and origin) made twice. The first one stays.
|
|
128
|
+
* Same-named skills that differ are kept; the import route and the editor refuse those.
|
|
129
|
+
*/
|
|
130
|
+
function dedupeSkills(list) {
|
|
131
|
+
const seen = new Set();
|
|
132
|
+
return list.filter((s) => {
|
|
133
|
+
if (s.source === 'own' || (s.source === 'import' && !s.origin)) return true;
|
|
134
|
+
const key = `${s.source}\n${s.name.toLowerCase()}\n${s.source === 'import' ? s.origin : ''}`;
|
|
135
|
+
if (seen.has(key)) return false;
|
|
136
|
+
seen.add(key);
|
|
137
|
+
return true;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
123
141
|
const kv = (o) => {
|
|
124
142
|
const out = {};
|
|
125
143
|
if (o && typeof o === 'object' && !Array.isArray(o)) {
|
|
@@ -158,7 +176,7 @@ export function normalizeBot(input, prev, seed = 0) {
|
|
|
158
176
|
const b = { ...(prev ?? {}), ...(input ?? {}) };
|
|
159
177
|
const now = Date.now();
|
|
160
178
|
const name = str(b.name, 60).trim() || prev?.name || 'New bot';
|
|
161
|
-
const skills = (Array.isArray(b.skills) ? b.skills : []).map(normalizeSkill).filter(Boolean).slice(0, 50);
|
|
179
|
+
const skills = dedupeSkills((Array.isArray(b.skills) ? b.skills : []).map(normalizeSkill).filter(Boolean)).slice(0, 50);
|
|
162
180
|
const apps = (Array.isArray(b.apps) ? b.apps : []).map(normalizeApp).filter(Boolean).slice(0, 20);
|
|
163
181
|
const deny = Array.isArray(b.tools?.deny) ? [...new Set(b.tools.deny.map(String).filter(Boolean))].slice(0, 200) : [];
|
|
164
182
|
const model = b.model && typeof b.model === 'object' && str(b.model.provider) && str(b.model.model) ? { provider: str(b.model.provider, 200), model: str(b.model.model, 200) } : null;
|
|
@@ -217,7 +235,8 @@ export function createStore(dir) {
|
|
|
217
235
|
mkdirSync(dir, { recursive: true });
|
|
218
236
|
state.version += 1;
|
|
219
237
|
const tmp = `${file}.tmp`;
|
|
220
|
-
|
|
238
|
+
// Bots carry app keys and chat bot tokens: readable by this user only.
|
|
239
|
+
writeFileSync(tmp, JSON.stringify(state, null, 2), { encoding: 'utf8', mode: 0o600 });
|
|
221
240
|
renameSync(tmp, file);
|
|
222
241
|
seen = mtime(file);
|
|
223
242
|
for (const fn of listeners) {
|
package/logos/amap.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/logos/brave.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/logos/exa.png
ADDED
|
Binary file
|
package/logos/feishu.png
ADDED
|
Binary file
|
|
Binary file
|
package/logos/git.png
ADDED
|
Binary file
|
package/logos/github.png
ADDED
|
Binary file
|
|
Binary file
|
package/logos/mcp.png
ADDED
|
Binary file
|
package/logos/notion.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/logos/sentry.png
ADDED
|
Binary file
|
package/logos/slack.png
ADDED
|
Binary file
|
package/logos/sqlite.png
ADDED
|
Binary file
|
package/logos/stripe.png
ADDED
|
Binary file
|
|
Binary file
|
package/logos/tavily.png
ADDED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kadaliao/dsh-bots",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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": {
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"index.js",
|
|
14
14
|
"client.js",
|
|
15
15
|
"lib/*.mjs",
|
|
16
|
+
"lib/channels/*.mjs",
|
|
17
|
+
"logos/*.png",
|
|
16
18
|
"cordis.patch.yml",
|
|
17
19
|
"locale/*.json",
|
|
18
20
|
"icon.svg",
|