@kadaliao/dsh-bots 0.3.3 → 0.4.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 +64 -4
- package/README.zh-CN.md +55 -3
- package/client.js +246 -13
- package/index.js +125 -18
- package/lib/apps.mjs +67 -3
- package/lib/channels/discord.mjs +590 -0
- package/lib/channels/telegram.mjs +300 -0
- package/lib/channels.mjs +889 -0
- package/lib/logos.mjs +52 -0
- package/lib/prompt.mjs +9 -1
- package/lib/skills.mjs +1 -1
- 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,52 @@
|
|
|
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
|
+
telegram: 'telegram',
|
|
33
|
+
discord: 'discord',
|
|
34
|
+
feishu: 'feishu',
|
|
35
|
+
stripe: 'stripe',
|
|
36
|
+
hubspot: 'hubspot',
|
|
37
|
+
supabase: 'supabase',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Logos used outside the app catalog (the featured skill source). */
|
|
41
|
+
const OTHER = ['anthropic'];
|
|
42
|
+
|
|
43
|
+
const NAME_RE = /^[a-z0-9-]{1,40}$/;
|
|
44
|
+
|
|
45
|
+
/** Whether `name` is a logo file name the plugin may serve. */
|
|
46
|
+
export const isLogoName = (name) => NAME_RE.test(String(name ?? '')) && (Object.values(LOGOS).includes(name) || OTHER.includes(name));
|
|
47
|
+
|
|
48
|
+
/** A catalog entry with its `logo` file name, when it has one. */
|
|
49
|
+
export function withLogo(entry) {
|
|
50
|
+
const logo = LOGOS[entry?.id];
|
|
51
|
+
return logo ? { ...entry, logo } : entry;
|
|
52
|
+
}
|
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
|
@@ -14,7 +14,7 @@ import { dirname, join, normalize } from 'node:path';
|
|
|
14
14
|
|
|
15
15
|
/** Skill collections worth browsing, shown as one-click sources. */
|
|
16
16
|
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 开发、品牌与内部沟通。' } },
|
|
17
|
+
{ 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
18
|
];
|
|
19
19
|
|
|
20
20
|
/** Split YAML-ish front matter: `name`, `description` (folded or quoted). */
|
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.4.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",
|