From 9542228c68a58c1c2137c1c4000b4eef68b61818 Mon Sep 17 00:00:00 2001 From: Harzva <49864959+Harzva@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:44:07 +0800 Subject: [PATCH] Add Git-backed DSH plugin marketplace and WeChat listing --- CHANGELOG.md | 7 + README.md | 6 +- README.zh-CN.md | 6 +- data/plugins.json | 210 +++++++ docs/plugins.md | 40 ++ package-lock.json | 87 ++- package.json | 5 +- scripts/build-site.mjs | 7 +- scripts/plugins.mjs | 86 +++ site/app.js | 6 +- site/index.html | 1 + site/plugins.css | 358 ++++++++++++ site/plugins.html | 93 +++ site/plugins.js | 545 ++++++++++++++++++ sources/plugin-market-reference-20261026.json | 17 + test/plugins.test.mjs | 51 ++ test/site-build.test.mjs | 2 + 17 files changed, 1519 insertions(+), 8 deletions(-) create mode 100644 data/plugins.json create mode 100644 docs/plugins.md create mode 100644 scripts/plugins.mjs create mode 100644 site/plugins.css create mode 100644 site/plugins.html create mode 100644 site/plugins.js create mode 100644 sources/plugin-market-reference-20261026.json create mode 100644 test/plugins.test.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index c25bfc0..84a32a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.10.0 — 2026-10-26 + +- Add a bilingual plugin marketplace with searchable capabilities, requirements, pinned source versions and actual release downloads. +- Generate a DSH format-1 Git index using the official validator; keep executable bundles separate from Bot configuration exports and desktop-host-only packages. +- List the independent UseChat adapter and existing desktop capture and SuperTerminal packages. Installation, permissions and real-device verification remain distinct. +- Preserve all existing Bot templates, published manifest versions, handbook and reference pages. + ## 0.9.3 — 2026-10-25 - Link marketplace scenarios and handbook task cards directly to their matching practice packs; search results now land on the individual scenario card. diff --git a/README.md b/README.md index 164162e..024d40e 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Use **Copy for Agent** in the market or an individual Bot detail, then paste the ## Run locally -Node.js **22 or newer**. No runtime package dependencies. +Node.js **22 or newer**. The static site has no browser runtime dependencies; its build uses the locked official DSH index validator. ```sh git clone https://github.com/Harzva/awesome-bot.git @@ -125,3 +125,7 @@ Format and import checks are not certifications that every role has completed re [Awesome DSH Plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) and [DSH Market](https://github.com/dsh-market/dsh-market) inform project organization and discovery. Roles, workflows, skills, plugins and execution runtimes remain distinct. See the [reference benchmark](docs/reference-benchmark.md), [source notes](SOURCE.md) and [App integration contract](INTEGRATION.md). Original content and code use [MIT](LICENSE). Upstream names and references retain their owners' rights; see [third-party notices](THIRD_PARTY_NOTICES.md). This is an independent project, unaffiliated with xAI or DeepSeek. + +## Plugins + +[Browse plugins](https://harzva.github.io/awesome-bot/plugins.html?lang=en) alongside Bot templates. DSH bundles use a separate [format-1 Git index](https://harzva.github.io/awesome-bot/dsh/index.json); OpenBot desktop plugins retain their own desktop installation contract. Plugin versions pin a Git commit and release archive checksum. Downloads do not install, enable, or grant permissions. See [the plugin guide](docs/plugins.md). diff --git a/README.zh-CN.md b/README.zh-CN.md index 93f709c..23e2314 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -59,7 +59,7 @@ ## 本地开发 -需要 Node.js 22 或更新版本,无运行时 npm 依赖。 +需要 Node.js 22 或更新版本。静态网页没有浏览器运行时依赖;构建使用锁定版本的 DSH 官方索引校验器。 ```sh git clone https://github.com/Harzva/awesome-bot.git @@ -92,3 +92,7 @@ PR 运行独立构建、格式与来源覆盖检查、导出和公开产物审 项目借鉴 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 的目录、贡献与维护机制,保留自己的 Bot 语义和安装格式。见[参考检查表](docs/reference-benchmark.md)。本项目不生成虚假评分、热度或下载数。 原创内容采用 [MIT](LICENSE)。上游名称和引用归原权利人;详见[来源说明](SOURCE.md)与[第三方声明](THIRD_PARTY_NOTICES.md)。本项目独立于 xAI 和 DeepSeek。 + +## 插件市场 + +[浏览插件](https://harzva.github.io/awesome-bot/plugins.html),为已有 Bot 增加能力。DSH 工具包提供独立的 [format-1 Git 索引](https://harzva.github.io/awesome-bot/dsh/index.json);OpenBot 桌面插件沿用自己的桌面安装流程。每个版本固定 Git 提交和下载包摘要,下载不等于安装、启用或授权。见[插件说明](docs/plugins.md)。 diff --git a/data/plugins.json b/data/plugins.json new file mode 100644 index 0000000..965ce3b --- /dev/null +++ b/data/plugins.json @@ -0,0 +1,210 @@ +{ + "schema": "awesome.bot.plugins/1", + "updatedAt": "2026-10-26", + "entries": [ + { + "id": "wechat-usechat", + "name": { + "zh": "微信 · UseChat", + "en": "WeChat · UseChat" + }, + "summary": { + "zh": "通过本机 UseChat 为 Bot 提供微信环境检查、指定对话读取与经批准的文字发送。", + "en": "Use local UseChat to diagnose WeChat setup, read selected visible chats and submit approved text." + }, + "packageName": "@harzva/dsh-wechat-usechat", + "version": "0.1.0", + "repository": "https://github.com/Harzva/dsh-wechat-usechat", + "revision": "4e546e1ddbb2e170fc6dce35aa1fceb67a074a3f", + "license": "MIT", + "platforms": [ + "macOS" + ], + "format": "dsh-bundle", + "downloadUrl": "https://github.com/Harzva/dsh-wechat-usechat/releases/download/v0.1.0/harzva-dsh-wechat-usechat-0.1.0.tgz", + "sha256": "e211069893163cc06609f9df3caad6d8ff59ee3dae77a5060226bb2294eea1cf", + "docsUrl": "https://github.com/Harzva/dsh-wechat-usechat/blob/4e546e1ddbb2e170fc6dce35aa1fceb67a074a3f/README.md", + "dsh": { + "engine": "0.2.1-rc.2", + "publishTimestamp": 1793000496 + }, + "capabilities": { + "zh": [ + "环境诊断 usechat_doctor", + "读取允许对话 usechat_read", + "逐次批准后发送文字 usechat_send_text" + ], + "en": [ + "Setup diagnosis: usechat_doctor", + "Allowed visible chat reading: usechat_read", + "Individually approved text sends: usechat_send_text" + ] + }, + "requirements": { + "zh": [ + "macOS、已登录的微信和独立安装的 UseChat Helper", + "Node.js 22.19+、DSH 0.2.1-rc.2", + "宿主配置允许对话、视觉模型和共享窗口操作锁;系统授予屏幕录制与辅助功能权限", + "发送需宿主显式开启,并接入真实逐次审批服务" + ], + "en": [ + "macOS, signed-in WeChat and separately installed UseChat Helper", + "Node.js 22.19+, DSH 0.2.1-rc.2", + "Host-selected chats, vision provider and shared UI lease; OS screen recording and accessibility permissions", + "Sending requires an explicit host write flag and a real per-call approval service" + ] + }, + "limitations": { + "zh": [ + "仅支持可见对话与文字发送;不承诺完整历史或视频号控制", + "远程视觉模型可能接收当前窗口截图和 OCR", + "发送默认关闭;不确定结果禁止自动重发", + "已验证 DSH 安装、工具注册与审批拦截,尚未操作真实微信消息" + ], + "en": [ + "Visible chats and text only; no full-history or video-channel control claim", + "A remote vision provider may receive window screenshots and OCR", + "Sending starts disabled; uncertain outcomes cannot automatically retry", + "DSH installation, tool registration and approval denial verified; real WeChat messages not exercised" + ] + }, + "openbot": { + "status": "git-adapter-required", + "note": { + "zh": "普通 DSH 可按固定 Git 提交安装;OpenBot 在线安装需要宿主 Git 来源适配更新。", + "en": "Standalone DSH can install the pinned Git commit; OpenBot online installation needs the host Git-source adapter update." + } + } + }, + { + "repository": "https://github.com/Harzva/dsh-desktop-capture", + "revision": "1592e6c8d637d92975f5505ece96b3e21f2eaa1c", + "license": "MIT", + "platforms": [ + "macOS" + ], + "format": "openbot-desktop", + "dsh": null, + "docsUrl": "https://github.com/Harzva/dsh-desktop-capture/blob/1592e6c8d637d92975f5505ece96b3e21f2eaa1c/README.md", + "openbot": { + "status": "desktop-host", + "note": { + "zh": "通过 OpenBot 桌面插件管理器安装、启用;普通 DSH 不能单独运行。", + "en": "Install and enable with the OpenBot desktop plugin manager; not a standalone DSH tool bundle." + } + }, + "id": "desktop-capture", + "name": { + "zh": "截图与录制", + "en": "Screen capture & recording" + }, + "summary": { + "zh": "让 Bot 查看界面,录制应用或桌面,制作带配音的演示素材。", + "en": "Let a Bot observe a screen, record an app or desktop, and create narrated demo material." + }, + "version": "0.3.1", + "packageName": "@openbot/dsh-desktop-capture", + "sha256": "40aa35bc0d7d3f633d76917c707e3a3d5aa57498fff88e42d88223f724c5fc86", + "downloadUrl": "https://github.com/Harzva/dsh-desktop-capture/releases/download/v0.3.1/openbot-dsh-desktop-capture-0.3.1.tgz", + "capabilities": { + "zh": [ + "应用与桌面截图", + "画面录制", + "演示与配音工具" + ], + "en": [ + "App and desktop screenshots", + "Screen recording", + "Demo and narration tools" + ] + }, + "requirements": { + "zh": [ + "Apple Silicon Mac,macOS 15 或更新", + "OpenBot Desktop Host API 1", + "按任务授予屏幕录制、麦克风或摄像头权限" + ], + "en": [ + "Apple Silicon Mac, macOS 15 or newer", + "OpenBot Desktop Host API 1", + "Screen recording, microphone or camera permission for the selected task" + ] + }, + "limitations": { + "zh": [ + "网站下载不会自动安装或启用", + "摄像头采集不代表已支持画中画成片" + ], + "en": [ + "A website download does not install or enable the plugin", + "Camera capture does not establish camera-overlay video support" + ] + } + }, + { + "repository": "https://github.com/Harzva/dsh-desktop-capture", + "revision": "1592e6c8d637d92975f5505ece96b3e21f2eaa1c", + "license": "MIT", + "platforms": [ + "macOS" + ], + "format": "openbot-desktop", + "dsh": null, + "docsUrl": "https://github.com/Harzva/dsh-desktop-capture/blob/1592e6c8d637d92975f5505ece96b3e21f2eaa1c/README.md", + "openbot": { + "status": "desktop-host", + "note": { + "zh": "通过 OpenBot 桌面插件管理器安装、启用;普通 DSH 不能单独运行。", + "en": "Install and enable with the OpenBot desktop plugin manager; not a standalone DSH tool bundle." + } + }, + "id": "superterminal", + "name": { + "zh": "超级终端", + "en": "SuperTerminal" + }, + "summary": { + "zh": "为 Bot 提供终端会话、输出读取与受控命令输入。", + "en": "Give a Bot terminal sessions, output reading and controlled command input." + }, + "version": "0.2.1", + "packageName": "@openbot/dsh-superterminal", + "sha256": "0359c51c9da46e56beb06ef4df7efe371757abf983f33f95ad2515f4a667b55e", + "downloadUrl": "https://github.com/Harzva/dsh-desktop-capture/releases/download/v0.3.1/openbot-dsh-superterminal-0.2.1.tgz", + "capabilities": { + "zh": [ + "打开与关闭终端", + "读取输出和命令记录", + "受控输入与终端设置" + ], + "en": [ + "Open and close terminals", + "Read output and command history", + "Controlled input and terminal settings" + ] + }, + "requirements": { + "zh": [ + "Apple Silicon 或 Intel Mac", + "OpenBot Desktop Host API 1", + "所选 Bot 具有相应终端权限" + ], + "en": [ + "Apple Silicon or Intel Mac", + "OpenBot Desktop Host API 1", + "Terminal permissions for the selected Bot" + ] + }, + "limitations": { + "zh": [ + "安装不授予命令执行权限", + "需要桌面宿主,不作为独立 DSH 工具包安装" + ], + "en": [ + "Installation grants no command execution permission", + "Requires the desktop host; not a standalone DSH tool bundle" + ] + } + } + ] +} diff --git a/docs/plugins.md b/docs/plugins.md new file mode 100644 index 0000000..a074e76 --- /dev/null +++ b/docs/plugins.md @@ -0,0 +1,40 @@ +# 插件市场 / Plugin marketplace + +Awesome Bot 同时收录 Bot 模板和可执行插件。Bot 模板是角色配置;插件为已存在的 Bot 提供工具。两类资产共用网站导航,但保留各自的安装格式和权限边界。 + +Awesome Bot lists both Bot templates and executable plugins. A template describes a role; a plugin adds tools to an existing Bot. They share discovery, not installation or permission semantics. + +## 使用 / Use + +1. 打开 [插件市场](https://harzva.github.io/awesome-bot/plugins.html),检查系统要求、版本、权限和限制。 +2. DSH 插件选择“安装说明”,复制固定提交的 Git 安装地址,按该版本 README 在自己的 DSH 环境安装。支持自定义市场的客户端可以添加 `https://harzva.github.io/awesome-bot/dsh/index.json`。 +3. OpenBot 桌面插件使用桌面插件管理器和对应发布目录,不能仅因含有 DSH 清单就当成独立 DSH 工具运行。 +4. 配置宿主提供的连接、允许操作的对象和权限后再启用。网站不会接入账号、操作聊天或静默安装本机 Helper。 + +Open the plugin page, inspect requirements and expand the installation details. DSH bundles use a commit-pinned Git source; compatible clients can add the format-1 index above. Desktop plugins use the OpenBot desktop manager. Downloading a file does not enable tools or connect an account. + +## DSH 格式 / DSH format + +`dsh/index.json` 是官方 format 1 索引,使用 `@deepseek-ai/dsh-plugin-market-index` 0.2.1-rc.2 校验并生成安装参数。每条 DSH 记录包含包名、精确版本、GitHub HTTPS 仓库、40 位提交 SHA 和 DSH 引擎要求。它不把 Bot 的 `fleet.json` 冒充插件,也不要求插件发布到 npm。 + +The DSH index is validated with the official format-1 parser. Each version points to a public GitHub repository and a complete immutable commit ID. Plugin publication does not require npm; dependencies declared by a plugin may still be downloaded by the DSH package manager from their registries. + +`plugins/catalogue.json` 是网站展示索引,另外包含平台、许可、下载包 SHA-256、权限说明和宿主兼容性。它不是 DSH 官方格式,也不是安装授权。Git SHA 和下载摘要用于追溯版本与核对字节,不代表发布者签名或真实任务验收。 + +The website catalogue includes desktop-host-only packages that are deliberately omitted from the DSH index. Hashes provide version and byte provenance, not publisher authentication or a real-account success claim. + +## 微信插件 / WeChat plugin + +独立仓库:[Harzva/dsh-wechat-usechat](https://github.com/Harzva/dsh-wechat-usechat)。适配器复用 UseChat,提供环境诊断、指定对话可见内容读取和受控文字发送。宿主必须提供配置与允许对话;发送默认关闭。原生 Helper 单独安装,屏幕和辅助功能权限由系统授权。使用远程视觉模型时,可见截图与 OCR 可能发送给所配置的模型。 + +The adapter reuses UseChat for setup diagnostics, visible-chat reading and controlled text submission. The host selects configuration and allowed chats. Writes start disabled. The native Helper and OS permissions require explicit setup. A remote vision provider may receive screenshots and OCR. This release does not claim full-history access, video-channel control or real WeChat message acceptance. + +OpenBot 1.0.3 的 Agent 插件安装器原先仅支持 npm 源;Git 源需要对应的宿主适配更新。市场显示“需要 Git 安装适配”时,不应把网站下载当作已在当前 App 安装。普通 DSH 客户端可以按固定 Git 地址安装,仍需配置 Helper 与权限。 + +OpenBot's previously delivered Agent plugin installer accepted npm sources only. Git sources need the corresponding host adapter. A listing marked as requiring that adapter is not a claim that the currently installed App can complete that path. Standalone DSH supports the pinned Git installation route. + +## 发布者 / Publishers + +在 `data/plugins.json` 维护双语条目,保留上游作者与许可。先发布不可变 Git 提交及实际下载包,计算摘要,再更新索引。运行 `npm ci --ignore-scripts`、`npm run check`、`npm test`、`npm run build:site` 和 `npm run audit:public`。不要上传用户配置、聊天、模型凭据、运行锁或安装回执;已发布版本的包字节不能改写。 + +Maintain bilingual entries, retain upstream notices, publish immutable artifacts first, then update the catalogue. Run the repository checks before publication. Keep credentials, conversations and local installation state out of public artifacts. Never rewrite an existing released version. diff --git a/package-lock.json b/package-lock.json index 00a3004..b38bef0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,99 @@ { "name": "awesome-bot-market", - "version": "0.9.4", + "version": "0.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "awesome-bot-market", - "version": "0.9.4", + "version": "0.10.0", "license": "MIT", + "devDependencies": { + "@deepseek-ai/dsh-plugin-market-index": "0.2.1-rc.2" + }, "engines": { "node": ">=22" } + }, + "node_modules/@deepseek-ai/cordis": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@deepseek-ai/cordis/-/cordis-4.0.5.tgz", + "integrity": "sha512-Sktq5axy0owk9PdnivBRNOJjHEVEibCt0+TDDZcv0+UH2KS1M910fX4kn5y45YFsrpZIi1mJf/1s5VzywMUnyg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@deepseek-ai/cosmokit": "~1.8.6", + "@standard-schema/spec": "^1.1.0" + }, + "bin": { + "cordis": "bin.js" + }, + "peerDependencies": { + "@deepseek-ai/cordis-plugin-include": "~1.0.10", + "@deepseek-ai/cordis-plugin-loader": "~1.0.6" + }, + "peerDependenciesMeta": { + "@deepseek-ai/cordis-plugin-include": { + "optional": true + }, + "@deepseek-ai/cordis-plugin-loader": { + "optional": true + } + } + }, + "node_modules/@deepseek-ai/cosmokit": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@deepseek-ai/cosmokit/-/cosmokit-1.8.6.tgz", + "integrity": "sha512-ZSD/fN52L498LBIOYwjIOlaLv5veY6ZEwI2yzvZUKQtctn0QAPqu8tKdJ+OF5+Tv6NBq1U+wJWH+QI6OGy5EvQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@deepseek-ai/dsh-package-manifest": { + "version": "0.2.1-rc.2", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-package-manifest/-/dsh-package-manifest-0.2.1-rc.2.tgz", + "integrity": "sha512-qJsGBj+T3oGzwK5GZbewneQNhD+3ENqIrCSOUAL8GKWQsl58daMAHDyqTuetvbkzuuXezwrv4Ll/BkKhx5FrQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@deepseek-ai/cordis": "~4.0.5" + } + }, + "node_modules/@deepseek-ai/dsh-plugin-market-index": { + "version": "0.2.1-rc.2", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-plugin-market-index/-/dsh-plugin-market-index-0.2.1-rc.2.tgz", + "integrity": "sha512-2ZJltdxQiMZct+BS5rcmwk8BojVfH16skGvwZRgGuZRdwGtMTvqpBOcUiASYOoS8yWynYUKOJonfOrN7LVVJqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@deepseek-ai/dsh-package-manifest": "0.2.1-rc.2", + "semver": "^7.8.5" + }, + "peerDependencies": { + "@deepseek-ai/cordis": "~4.0.5" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } } } } diff --git a/package.json b/package.json index 7ce6dae..9b79c28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "awesome-bot-market", - "version": "0.9.4", + "version": "0.10.0", "private": true, "type": "module", "description": "A source-backed Bot directory with original OpenBot roles, workflows and reproducible configuration downloads", @@ -30,5 +30,8 @@ "check:versions": "node scripts/check-versions.mjs", "sync:imports": "node scripts/sync-imported-roles.mjs", "check:imports": "node scripts/sync-imported-roles.mjs --check" + }, + "devDependencies": { + "@deepseek-ai/dsh-plugin-market-index": "0.2.1-rc.2" } } diff --git a/scripts/build-site.mjs b/scripts/build-site.mjs index 6f5c2ae..f638ed7 100644 --- a/scripts/build-site.mjs +++ b/scripts/build-site.mjs @@ -9,6 +9,7 @@ import { writeAgentSurface } from './agent-surface.mjs'; import { writeExternalProjects } from './external-projects.mjs'; import { writeSharedBots, readSharedBots } from './shared-bots.mjs'; import { writeHandbook } from './handbook.mjs'; +import { writePlugins } from './plugins.mjs'; const args = process.argv.slice(2); if (args.some(arg => !arg.startsWith('--out='))) throw new Error('Usage: node scripts/build-site.mjs [--out=]'); @@ -50,6 +51,9 @@ const indexFile = resolve(output, 'index.html'); const indexHtml = await readFile(indexFile, 'utf8'); await writeFile(indexFile, indexHtml.replace(/((?:href|src)=["'])(\.\/(?:styles\.css|navigation\.js|app\.js))(["'])/g, (_, prefix, asset, suffix) => `${prefix}${asset}?v=${encodeURIComponent(packageMetadata.version)}${suffix}`)); +const pluginPage = resolve(output, 'plugins.html'); +await writeFile(pluginPage, (await readFile(pluginPage, 'utf8')).replace(/((?:href|src)=["'])(\.\/(?:styles\.css|plugins\.css|plugins\.js))(["'])/g, + (_, prefix, asset, suffix) => `${prefix}${asset}?v=${encodeURIComponent(packageMetadata.version)}${suffix}`)); await cp(resolve(root, 'templates'), resolve(output, 'templates'), { recursive: true }); await cp(resolve(root, 'registry'), resolve(output, 'registry'), { recursive: true }); await cp(resolve(root, 'sources'), resolve(output, 'sources'), { recursive: true }); @@ -168,9 +172,10 @@ await writeFile(resolve(output, 'catalogue.json'), json(data)); await writeFile(resolve(output, 'catalogue.en.json'), json(englishData)); const agents = await writeAgentSurface({ output, catalogues: { zh: data, en: englishData }, contentRevision: packageMetadata.version }); await writeExternalProjects({ output, version: packageMetadata.version }); +await writePlugins({ output }); await writeSharedBots({ output, version: packageMetadata.version }); const handbook = await writeHandbook({ output, version: packageMetadata.version, catalogues: { zh: data, en: englishData }, shared: await readSharedBots() }); await writeFile(indexFile, (await readFile(indexFile, 'utf8')).replace('data-handbook-practices=""', `data-handbook-practices="${handbook.practiceScenarioIds.join(',')}"`)); await writeFile(resolve(output, 'robots.txt'), 'User-agent: *\nAllow: /\n'); -await writeFile(resolve(output, 'sitemap.xml'), '\nhttps://harzva.github.io/awesome-bot/https://harzva.github.io/awesome-bot/resources.htmlhttps://harzva.github.io/awesome-bot/resources.en.htmlhttps://harzva.github.io/awesome-bot/shared-bots.html' + handbook.pages.map(page => `https://harzva.github.io/awesome-bot/${page}`).join('') + '\n'); +await writeFile(resolve(output, 'sitemap.xml'), '\nhttps://harzva.github.io/awesome-bot/https://harzva.github.io/awesome-bot/plugins.htmlhttps://harzva.github.io/awesome-bot/resources.htmlhttps://harzva.github.io/awesome-bot/resources.en.htmlhttps://harzva.github.io/awesome-bot/shared-bots.html' + handbook.pages.map(page => `https://harzva.github.io/awesome-bot/${page}`).join('') + '\n'); console.log(JSON.stringify({ ok: true, output, ...counts, individualDownloads: entries.length, scenarioDownloads: scenarios.length, englishEntries: englishEntries.length, agentCards: agents.cards })); diff --git a/scripts/plugins.mjs b/scripts/plugins.mjs new file mode 100644 index 0000000..496ebd8 --- /dev/null +++ b/scripts/plugins.mjs @@ -0,0 +1,86 @@ +import { mkdir, readFile, writeFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; +import { parseMarketIndex, marketInstallTarget } from '@deepseek-ai/dsh-plugin-market-index'; +import { root } from './engine.mjs'; + +export const indexUrl = 'https://harzva.github.io/awesome-bot/dsh/index.json'; +const sha = /^[a-f0-9]{40}$/; +const digest = /^[a-f0-9]{64}$/; +const version = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[a-zA-Z0-9.-]+)?$/; +const fail = message => { throw new Error(`Invalid plugin catalogue: ${message}`); }; +function text(value) { return typeof value === 'string' && value.trim().length > 0 && value.length <= 4000; } +function localized(value, array = false) { + return value && ['zh', 'en'].every(language => array + ? Array.isArray(value[language]) && value[language].length > 0 && value[language].every(text) + : text(value[language])); +} +function github(value) { + let url; try { url = new URL(value); } catch { fail('URL'); } + if (url.protocol !== 'https:' || url.hostname !== 'github.com' || url.port || url.username || url.password || url.search || url.hash) fail('public GitHub HTTPS URL required'); + return url; +} + +export function validatePlugins(data) { + if (data?.schema !== 'awesome.bot.plugins/1' || !/^\d{4}-\d{2}-\d{2}$/.test(data.updatedAt) || !Array.isArray(data.entries) || !data.entries.length) fail('schema'); + const ids = new Set(), names = new Set(); + for (const item of data.entries) { + if (!/^[a-z][a-z0-9-]{1,63}$/.test(item.id) || ids.has(item.id) || names.has(item.packageName)) fail('duplicate or invalid identity'); + ids.add(item.id); names.add(item.packageName); + if (!/^(@[a-z0-9._-]+\/)?[a-z0-9][a-z0-9._-]+$/.test(item.packageName) || !version.test(item.version) || !sha.test(item.revision) || !digest.test(item.sha256)) fail('package identity or digest'); + if (!localized(item.name) || !localized(item.summary) || !['capabilities', 'requirements', 'limitations'].every(key => localized(item[key], true))) fail('complete Chinese and English content required'); + if (!Array.isArray(item.platforms) || !item.platforms.length || item.platforms.some(p => !['macOS', 'Windows', 'Linux'].includes(p)) || item.license !== 'MIT') fail('platform/license'); + const repo = github(item.repository); + if (!/^\/[\w.-]+\/[\w.-]+$/.test(repo.pathname)) fail('repository'); + const download = github(item.downloadUrl); + if (!download.pathname.startsWith(`${repo.pathname}/releases/download/`) || !download.pathname.endsWith('.tgz')) fail('versioned release download'); + const docs = github(item.docsUrl); + if (!docs.pathname.startsWith(`${repo.pathname}/blob/${item.revision}/`)) fail('pinned documentation'); + if (!['dsh-bundle', 'openbot-desktop'].includes(item.format)) fail('format'); + if (!['desktop-host', 'git-adapter-required', 'ready'].includes(item.openbot?.status) || !localized(item.openbot.note)) fail('OpenBot compatibility'); + if (item.format === 'dsh-bundle') { + if (!item.dsh || !text(item.dsh.engine) || !Number.isSafeInteger(item.dsh.publishTimestamp) || item.dsh.publishTimestamp <= 0) fail('DSH version metadata'); + } else if (item.dsh !== null) fail('desktop plugins are not standalone DSH tools'); + } + // Use DSH's own parser for its index and exact installation specification. + createDshIndex(data); + return data; +} + +export function createDshIndex(data) { + const index = { + format: 1, + title: { zh: 'Awesome Bot 插件市场', en: 'Awesome Bot plugins' }, + description: { zh: '固定 Git 提交的 DSH 插件。安装不授予工具或账号权限。', en: 'Commit-pinned DSH bundles. Installation does not grant tool or account permissions.' }, + plugins: data.entries.filter(item => item.format === 'dsh-bundle').map(item => ({ + name: item.packageName, title: item.name, description: item.summary, + author: 'Harzva', homepage: item.docsUrl, repository: { url: item.repository }, + metadata: { keywords: ['openbot', 'dsh', item.id] }, + versions: [{ version: item.version, publishTimestamp: item.dsh.publishTimestamp, + source: { type: 'git', url: `${item.repository}.git`, commit: item.revision }, + engines: { dsh: item.dsh.engine } }] + })) + }; + parseMarketIndex(index, indexUrl); + return index; +} + +export async function readPlugins() { + return validatePlugins(JSON.parse(await readFile(resolve(root, 'data/plugins.json'), 'utf8'))); +} + +export async function writePlugins({ output }) { + const data = await readPlugins(); + const index = createDshIndex(data); + const parsed = parseMarketIndex(index, indexUrl); + const listing = { ...data, indexUrl: 'dsh/index.json', entries: data.entries.map(item => { + if (item.format !== 'dsh-bundle') return item; + const plugin = parsed.plugins.find(plugin => plugin.name === item.packageName); + return { ...item, dsh: { ...item.dsh, indexUrl: 'dsh/index.json', installSpec: marketInstallTarget(plugin.name, plugin.versions[0]).spec } }; + }) }; + await mkdir(resolve(output, 'plugins'), { recursive: true }); + await mkdir(resolve(output, 'dsh'), { recursive: true }); + for (const [file, value] of [['plugins/catalogue.json', listing], ['dsh/index.json', index]]) { + await writeFile(resolve(output, file), JSON.stringify(value, null, 2) + '\n'); + } + return { plugins: listing.entries.length, dshBundles: parsed.plugins.length }; +} diff --git a/site/app.js b/site/app.js index d56eb92..55597ba 100644 --- a/site/app.js +++ b/site/app.js @@ -7,7 +7,7 @@ const copy = { zh: { - navCatalog: 'Bot 市场', navResources: '开源与参考', navHandbook: '使用手册', handbookStart: '从使用手册开始:上手、团队协作与开发接入', sharedBots: '原站 Bot', sourceInstructions: '原始角色指令(英文)', adaptedNote: '第三方来源适配;保留英文原始步骤,回复语言由用户指定。宿主连接、权限与预约需要另行设置。', licenseLabel: '许可证', navSubmit: '投稿', kicker: 'Awesome Bot', languageToggle: '切换语言与 Bot 内容', + navCatalog: 'Bot 市场', navResources: '开源与参考', navPlugins: '插件市场', navHandbook: '使用手册', handbookStart: '从使用手册开始:上手、团队协作与开发接入', sharedBots: '原站 Bot', sourceInstructions: '原始角色指令(英文)', adaptedNote: '第三方来源适配;保留英文原始步骤,回复语言由用户指定。宿主连接、权限与预约需要另行设置。', licenseLabel: '许可证', navSubmit: '投稿', kicker: 'Awesome Bot', languageToggle: '切换语言与 Bot 内容', filterLabel: '目录筛选', botTypeLabel: 'Bot 类型', categoryFilter: '按分类筛选', sortControlLabel: '排序方式', title: 'Bot 市场', lede: '探索角色与任务,找到适合你的 Bot。', @@ -44,7 +44,7 @@ scenarioPractice: '用虚构材料练习', notTestedValue: '尚未测试', noDetails: '暂未提供', copySuccess: '已复制索引 URL', copyFailed: '复制失败,请手动复制。' }, en: { - navCatalog: 'Marketplace', navResources: 'Projects & references', navHandbook: 'Handbook', handbookStart: 'Start with the handbook: first task, teamwork and integration', sharedBots: 'Shared Bots', sourceInstructions: 'Original role instructions (English)', adaptedNote: 'Attributed source adaptation. Original English steps retained; the user chooses the response language. Host connections, permissions and routines require separate setup.', licenseLabel: 'License', navSubmit: 'Submit', kicker: 'Awesome Bot', languageToggle: 'Switch language and Bot content', + navCatalog: 'Marketplace', navResources: 'Projects & references', navPlugins: 'Plugin marketplace', navHandbook: 'Handbook', handbookStart: 'Start with the handbook: first task, teamwork and integration', sharedBots: 'Shared Bots', sourceInstructions: 'Original role instructions (English)', adaptedNote: 'Attributed source adaptation. Original English steps retained; the user chooses the response language. Host connections, permissions and routines require separate setup.', licenseLabel: 'License', navSubmit: 'Submit', kicker: 'Awesome Bot', languageToggle: 'Switch language and Bot content', filterLabel: 'Directory filters', botTypeLabel: 'Bot type', categoryFilter: 'Filter by category', sortControlLabel: 'Sort order', title: 'Bot marketplace', lede: 'Explore roles and tasks. Find a Bot for your work.', @@ -482,6 +482,8 @@ ['handbook-link', 'handbook-start-link'].forEach(id => { const link = doc.getElementById(id); if (link) link.href = state.language === 'en' ? './handbook.en.html' : './handbook.html'; }); const resources = doc.getElementById('resources-link'); if (resources) resources.href = state.language === 'en' ? './resources.en.html' : './resources.html'; + const plugins = doc.getElementById('plugins-link'); + if (plugins) plugins.href = state.language === 'en' ? './plugins.html?lang=en' : './plugins.html'; const language = doc.getElementById('language-toggle'); if (language) language.textContent = state.language === 'zh' ? 'EN' : '中'; const home = doc.querySelector('.brand'); diff --git a/site/index.html b/site/index.html index 089c390..4d05f81 100644 --- a/site/index.html +++ b/site/index.html @@ -24,6 +24,7 @@