From 6dc86d9314cf61bda32a20e6faad2a774dcc3dec Mon Sep 17 00:00:00 2001 From: QQ Date: Thu, 12 Nov 2026 10:49:31 +0800 Subject: [PATCH] Import make-index.mjs --- make-index.mjs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/make-index.mjs b/make-index.mjs index 04f7f18..2f2b29d 100644 --- a/make-index.mjs +++ b/make-index.mjs @@ -20,7 +20,6 @@ const PLUGINS = [ icon: 'icons/sansheng.png', repo: 'dsh-sansheng-liubu', branch: 'master', - version: '0.12.1', title: '三省六部工作台', description: '十个独立部门会话的派发、审批与三层记忆(部门 / 项目 / 长期),原生 DSH 工作台。注意:本条只装后端,「朝堂」面板需另克隆本仓库运行 scripts/workbench-install.mjs on 并彻底重启 DSH。', keywords: ['workbench', 'sansheng', '三省六部'], @@ -30,7 +29,6 @@ const PLUGINS = [ icon: 'icons/brain.png', repo: 'dsh-brain', branch: 'main', - version: '0.9.0', title: 'dsh-brain · 云端记忆', description: '把 DSH 接到自托管的 LongMemory:Mnemon 供应方、技能双向同步、从其他软件导入技能。', keywords: ['memory', 'longmemory', 'mnemon', 'skills'], @@ -40,7 +38,6 @@ const PLUGINS = [ icon: 'icons/groups.png', repo: 'workspace-groups-remote', branch: 'main', - version: '1.0.0', title: '工作区分组与远程', description: '多文件夹分组与远程 SSH 工作区:镜像、终端直连与重复目录防护。', keywords: ['workspace', 'ssh', 'remote', 'groups'], @@ -50,7 +47,6 @@ const PLUGINS = [ icon: 'icons/chat.png', repo: 'dsh-better-chat', branch: 'main', - version: '0.2.0', title: 'dsh-better-chat · 聊天增强', description: '审批卡回车确认 / Esc 拒绝;默认自动审查,并从界面移除「完全权限」选项。', keywords: ['chat', 'approval', 'permission'], @@ -67,6 +63,12 @@ async function headOf(repo, branch) { const plugins = [] for (const plugin of PLUGINS) { const head = await headOf(plugin.repo, plugin.branch) + const pkgResponse = await fetch(`${API}/repos/DeepsSeekHarness/${plugin.repo}/contents/package.json?ref=${plugin.branch}`) + if (!pkgResponse.ok) throw new Error(`package.json fetch failed for ${plugin.repo}: HTTP ${pkgResponse.status}`) + const pkgFile = await pkgResponse.json() + const pkg = JSON.parse(Buffer.from(pkgFile.content, 'base64').toString('utf8')) + if (pkg.name !== plugin.name) throw new Error(`name mismatch for ${plugin.repo}: index says ${plugin.name}, package.json says ${pkg.name}`) + const version = pkg.version plugins.push({ name: plugin.name, title: plugin.title, @@ -78,14 +80,14 @@ for (const plugin of PLUGINS) { metadata: { keywords: plugin.keywords, labels: [], sortKeys: {} }, versions: [ { - version: plugin.version, + version: version, publishTimestamp: head.timestamp, source: { type: 'git', url: `${WEB}/${plugin.repo}`, commit: head.commit }, engines: {}, }, ], }) - console.log(`${plugin.name} ${plugin.version} @ ${head.commit.slice(0, 8)}`) + console.log(`${plugin.name} ${version} @ ${head.commit.slice(0, 8)}`) } const index = {