Compare commits

..

No commits in common. "main" and "release/dock-0.14.0-2" have entirely different histories.

10 changed files with 93 additions and 371 deletions

View File

@ -1,8 +1,7 @@
# QQ 插件索引(DSH 插件市场索引 · 格式 1)
给 DSH「发现」页用的自定义插件索引,列出 QQ-dsh 全家桶和它的四个组件,
另收录两个外部插件:GitHub 上的 ds-harness-remote-fast 和 dsh-better-sidebar;
安装源是本组织在 git.qyhhh.top 上的仓库或对应的 GitHub 仓库,固定到发布提交。
安装源是本组织在 git.qyhhh.top 上的仓库,固定到发布提交。
## 在 DSH 里使用
@ -15,11 +14,16 @@
## 维护
发新版后重新生成索引(自动读取各仓库分支 HEAD 的提交号与时间):
发布批次统一记录在 `release-manifest.json`(组件版本、固定提交、全家桶版本)。
`make-index.mjs` 优先从该清单生成索引;清单不存在时才回退到读取各仓库分支 HEAD。
发版后:
```sh
node make-index.mjs
node verify-release.mjs --qq-dsh ../QQ-dsh --sources ..
```
生成后把 `index.json` 提交到本仓库即可。索引格式由 DSH 自带的
`@deepseek-ai/dsh-plugin-market-index` 校验器定义。
`verify-release.mjs` 同时检查独立插件索引与 QQ-dsh 全家桶的版本、固定提交和
构建产物是否存在,两个安装渠道不一致时直接失败。生成/校验后把 `index.json`
提交到本仓库即可。索引格式由 DSH 自带的 `@deepseek-ai/dsh-plugin-market-index`
校验器定义。

View File

@ -1,16 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#f8a91c"/>
<stop offset="1" stop-color="#d96c06"/>
</linearGradient>
</defs>
<rect width="512" height="512" rx="112" fill="url(#bg)"/>
<ellipse cx="256" cy="70" rx="300" ry="130" fill="#ffffff" opacity="0.08"/>
<g stroke="#ffffff" stroke-width="28" fill="none" stroke-linecap="round">
<path d="M135 183 A148 148 0 0 1 377 183"/>
<path d="M175 212 A99 99 0 0 1 337 212"/>
<path d="M213 239 A52 52 0 0 1 299 239"/>
</g>
<polygon points="276,244 218,330 250,330 232,404 300,308 264,308" fill="#ffffff"/>
</svg>

Before

Width:  |  Height:  |  Size: 731 B

View File

@ -1,14 +0,0 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="6.5" y="9" width="23" height="18" rx="2.5" fill="url(#a)" />
<rect x="21.5" y="9" width="8" height="18" rx="2.5" fill="url(#b)" />
<defs>
<linearGradient id="a" x1="6.5" y1="9" x2="29.5" y2="27" gradientUnits="userSpaceOnUse">
<stop stop-color="#69B9FF" />
<stop offset="1" stop-color="#324DE2" />
</linearGradient>
<linearGradient id="b" x1="25.5" y1="9" x2="25.5" y2="27" gradientUnits="userSpaceOnUse">
<stop stop-color="#45E7A4" />
<stop offset="1" stop-color="#05909D" />
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,7 +1,7 @@
{
"format": 1,
"title": "QQ 插件索引",
"description": "newbie 的 DSH 插件索引:QQ-dsh 全家桶及其四个组件,另收录外部依赖 Better Sidebar;源码托管在 git.qyhhh.top 的 DeepsSeekHarness 组织。",
"description": "newbie 的 DSH 插件索引:QQ-dsh 全家桶及其四个组件,源码托管在 git.qyhhh.top 的 DeepsSeekHarness 组织。",
"metadata": {
"categories": {},
"labels": {},
@ -9,10 +9,10 @@
},
"plugins": [
{
"name": "dsh-sansheng-liubu",
"title": "三省六部 · 十席工作台",
"name": "dsh-sansheng-liubu-mode",
"title": "三省六部工作台",
"icon": "icons/sansheng.png",
"description": "每个项目固定十席角色与独立会话。丞相自然下派,关键歧义才启动 Grill Me。门下通过后尚书并行派工,部门可在任务里会商。项目决定与原生审批集中在「待你处理」,丞相可用原生后台助手整理需求、跟踪进度和汇总反馈。",
"description": "十个独立部门会话的派发、审批与三层记忆(部门 / 项目 / 长期),原生 DSH 工作台后端。右侧栏「朝堂」朝堂面板已并入本包,装这一条即可。",
"author": "newbie",
"homepage": "https://git.qyhhh.top/DeepsSeekHarness/dsh-sansheng-liubu",
"repository": {
@ -29,12 +29,12 @@
},
"versions": [
{
"version": "1.1.5",
"publishTimestamp": 1795864370,
"version": "0.14.0",
"publishTimestamp": 1794480735,
"source": {
"type": "git",
"url": "https://git.qyhhh.top/DeepsSeekHarness/dsh-sansheng-liubu",
"commit": "819a57d7694723cb279f84a10b33398d66253229"
"commit": "efc4a32c758d1df9bb3c22bb53f1359e0d433ab1"
},
"engines": {}
}
@ -62,12 +62,12 @@
},
"versions": [
{
"version": "0.10.5",
"publishTimestamp": 1795835418,
"version": "0.9.1",
"publishTimestamp": 1794480737,
"source": {
"type": "git",
"url": "https://git.qyhhh.top/DeepsSeekHarness/dsh-brain",
"commit": "645e47bd5908a94d0b91945952e5fa7eda92bcb7"
"commit": "89af1f4c7c6acf65be93792f68eade383ec0d794"
},
"engines": {}
}
@ -95,12 +95,12 @@
},
"versions": [
{
"version": "1.3.1",
"publishTimestamp": 1795054575,
"version": "1.1.0",
"publishTimestamp": 1794480736,
"source": {
"type": "git",
"url": "https://git.qyhhh.top/DeepsSeekHarness/workspace-groups-remote",
"commit": "97f4c3e07ffa665cfa2b5476625b4f1715f18295"
"commit": "413a98ba83aadb4b20ddea908b4fb2c1b47d9513"
},
"engines": {}
}
@ -110,7 +110,7 @@
"name": "dsh-better-chat",
"title": "dsh-better-chat · 聊天增强",
"icon": "icons/chat.png",
"description": "审批卡快捷键(可自定义)、权限界面移除「完全权限」、插件商店更新按钮;对话页提供左侧 AI 回复气泡与下方过程折叠、默认 6 轮长会话渲染窗口与顶部锚定加载、WorkBuddy 风格右侧目录时间轴,以及外观/气泡样式/宽度自定义设置,并保留官方聊天契约让 dsh-btw 等插件照常工作。",
"description": "审批卡回车确认 / Esc 拒绝;权限界面移除「完全权限」,且不再改写已有会话的权限选择。",
"author": "newbie",
"homepage": "https://git.qyhhh.top/DeepsSeekHarness/dsh-better-chat",
"repository": {
@ -127,77 +127,12 @@
},
"versions": [
{
"version": "1.4.0",
"publishTimestamp": 1795931763,
"version": "0.3.1",
"publishTimestamp": 1794480736,
"source": {
"type": "git",
"url": "https://git.qyhhh.top/DeepsSeekHarness/dsh-better-chat",
"commit": "7d8dfb1e5dc6e943961a874d346179e24e15a74f"
},
"engines": {}
}
]
},
{
"name": "ds-harness-remote-fast",
"title": "ds-harness-remote-fast · 远程极速版",
"icon": "icons/remote-fast.png",
"description": "ds-harness-remote 的极速分支(rainow):主机端首屏快照裁剪,解决大会话帧超限断连;服务端与客户端不用换,加密与配对与原版一致。安装源为 GitHub 上的 rainow/ds-harness-remote-fast。",
"author": "newbie",
"homepage": "https://github.com/rainow/ds-harness-remote-fast",
"repository": {
"url": "https://github.com/rainow/ds-harness-remote-fast"
},
"metadata": {
"keywords": [
"remote",
"远程",
"fast"
],
"labels": [],
"sortKeys": {}
},
"versions": [
{
"version": "0.6.8-fast.1",
"publishTimestamp": 1795665151,
"source": {
"type": "git",
"url": "https://github.com/rainow/ds-harness-remote-fast",
"commit": "20188ec9044a4b4add15651ba89f240dd96a4a42"
},
"engines": {}
}
]
},
{
"name": "dsh-better-sidebar",
"title": "Better Sidebar · 右栏整合",
"icon": "icons/better-sidebar.svg",
"description": "把文件树、编辑器、改动、任务与侧边对话收进一列右栏,按会话分开;并向其他插件提供注册右栏标签与文件查看器的服务。三省六部的 Better Sidebar 子插件依赖它。安装源为 GitHub 上的 omdsh-dev/DSH-better-sidebar,固定到 v0.33.0。",
"author": "omdsh-dev",
"homepage": "https://github.com/omdsh-dev/DSH-better-sidebar",
"repository": {
"url": "https://github.com/omdsh-dev/DSH-better-sidebar"
},
"metadata": {
"keywords": [
"sidebar",
"editor",
"files",
"better-sidebar"
],
"labels": [],
"sortKeys": {}
},
"versions": [
{
"version": "0.33.0",
"publishTimestamp": 1795502227,
"source": {
"type": "git",
"url": "https://github.com/omdsh-dev/DSH-better-sidebar",
"commit": "0f4b87c49dc6ae4aef7371be0a78f9d277a7b4e0"
"commit": "f2f11528bdd8779b247265ca8ba667287af12cd7"
},
"engines": {}
}

View File

@ -1,12 +1,10 @@
// Regenerate the QQ plugin market index (DSH plugin-market index format 1).
//
// The index lists the four QQ-dsh component plugins, plus one external plugin
// (ds-harness-remote-fast) whose canonical source is GitHub's rainow fork, not
// our Gitea mirror. Each entry's install source is a git source pinned to the
// repo HEAD commit; versions are read live from each repo's package.json, so
// re-running this after a release is the whole maintenance story. The repos are
// public, so the endpoints are read anonymously. Output: ./index.json next to
// this script.
// The index lists the four QQ-dsh component plugins. Each entry's install
// source is a git source pinned to the repo HEAD commit; versions are read
// live from each repo's package.json, so re-running this after a release is
// the whole maintenance story. The Gitea repos are public, so the branch
// endpoints are read anonymously. Output: ./index.json next to this script.
//
// Why git and not the org's Gitea npm registry (tried 2026-11-12, reverted
// the same day): Gitea's npm registry strips the `dsh` field from the
@ -19,22 +17,23 @@
// overwrite); DSH's native update button does not apply to git sources.
//
// node make-index.mjs
import { writeFileSync } from 'node:fs'
import { existsSync, readFileSync, writeFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const API = 'https://git.qyhhh.top/api/v1'
const WEB = 'https://git.qyhhh.top/DeepsSeekHarness'
const GITHUB = 'https://api.github.com'
const ROOT = dirname(fileURLToPath(import.meta.url))
const MANIFEST = join(ROOT, 'release-manifest.json')
const PLUGINS = [
{
name: 'dsh-sansheng-liubu',
name: 'dsh-sansheng-liubu-mode',
icon: 'icons/sansheng.png',
repo: 'dsh-sansheng-liubu',
branch: 'release/v1.1.5',
title: '三省六部 · 十席工作台',
description: '每个项目固定十席角色与独立会话。丞相自然下派,关键歧义才启动 Grill Me。门下通过后尚书并行派工,部门可在任务里会商。项目决定与原生审批集中在「待你处理」,丞相可用原生后台助手整理需求、跟踪进度和汇总反馈。',
branch: 'master',
title: '三省六部工作台',
description: '十个独立部门会话的派发、审批与三层记忆(部门 / 项目 / 长期),原生 DSH 工作台后端。右侧栏「朝堂」朝堂面板已并入本包,装这一条即可。',
keywords: ['workbench', 'sansheng', '三省六部'],
},
{
@ -61,109 +60,72 @@ const PLUGINS = [
repo: 'dsh-better-chat',
branch: 'main',
title: 'dsh-better-chat · 聊天增强',
description: '审批卡快捷键(可自定义)、权限界面移除「完全权限」、插件商店更新按钮;对话页提供左侧 AI 回复气泡与下方过程折叠、默认 6 轮长会话渲染窗口与顶部锚定加载、WorkBuddy 风格右侧目录时间轴,以及外观/气泡样式/宽度自定义设置,并保留官方聊天契约让 dsh-btw 等插件照常工作。',
description: '审批卡回车确认 / Esc 拒绝;权限界面移除「完全权限」,且不再改写已有会话的权限选择。',
keywords: ['chat', 'approval', 'permission'],
},
{
name: 'ds-harness-remote-fast',
icon: 'icons/remote-fast.png',
repo: 'ds-harness-remote-fast',
branch: 'lite',
github: true,
owner: 'rainow',
title: 'ds-harness-remote-fast · 远程极速版',
description: 'ds-harness-remote 的极速分支(rainow):主机端首屏快照裁剪,解决大会话帧超限断连;服务端与客户端不用换,加密与配对与原版一致。安装源为 GitHub 上的 rainow/ds-harness-remote-fast。',
keywords: ['remote', '远程', 'fast'],
},
{
name: 'dsh-better-sidebar',
icon: 'icons/better-sidebar.svg',
repo: 'DSH-better-sidebar',
branch: 'v0.33.0',
github: true,
owner: 'omdsh-dev',
author: 'omdsh-dev',
title: 'Better Sidebar · 右栏整合',
description: '把文件树、编辑器、改动、任务与侧边对话收进一列右栏,按会话分开;并向其他插件提供注册右栏标签与文件查看器的服务。三省六部的 Better Sidebar 子插件依赖它。安装源为 GitHub 上的 omdsh-dev/DSH-better-sidebar,固定到 v0.33.0。',
keywords: ['sidebar', 'editor', 'files', 'better-sidebar'],
},
]
// Transient resets to GitHub are common from this host; retry a few times
// with a growing pause before giving up (the unattended updater relies on it).
async function fetchRetry(url, options = {}, attempts = 5) {
let lastError
for (let attempt = 1; attempt <= attempts; attempt += 1) {
try {
return await fetch(url, options)
} catch (error) {
lastError = error
if (attempt < attempts) await new Promise((resolve) => setTimeout(resolve, attempt * 500))
}
}
throw lastError
}
async function headOf(repo, branch) {
const response = await fetchRetry(`${API}/repos/DeepsSeekHarness/${repo}/branches/${encodeURIComponent(branch)}`)
const response = await fetch(`${API}/repos/DeepsSeekHarness/${repo}/branches/${branch}`)
if (!response.ok) throw new Error(`branch lookup failed for ${repo}/${branch}: HTTP ${response.status}`)
const body = await response.json()
return { commit: body.commit.id, timestamp: Math.floor(Date.parse(body.commit.timestamp) / 1000) }
}
async function githubHead(owner, repo, branch) {
const response = await fetchRetry(`${GITHUB}/repos/${owner}/${repo}/commits/${encodeURIComponent(branch)}`, {
headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'dsh-market-index' },
})
if (!response.ok) throw new Error(`github commit lookup failed for ${owner}/${repo}@${branch}: HTTP ${response.status}`)
const body = await response.json()
return { commit: body.sha, timestamp: Math.floor(Date.parse(body.commit.committer.date) / 1000) }
}
const release = existsSync(MANIFEST) ? JSON.parse(readFileSync(MANIFEST, 'utf8')) : null
const componentByRepo = new Map()
for (const component of release?.components ?? []) componentByRepo.set(component.repo, component)
const plugins = []
for (const plugin of PLUGINS) {
const onGithub = plugin.github === true
const head = onGithub ? await githubHead(plugin.owner, plugin.repo, plugin.branch) : await headOf(plugin.repo, plugin.branch)
const web = onGithub ? `https://github.com/${plugin.owner}/${plugin.repo}` : `${WEB}/${plugin.repo}`
// Read package.json through each host's API. For GitHub we deliberately use
// the contents API (api.github.com), not raw.githubusercontent.com: the raw
// host resets TLS connections from this machine while the API stays reliable.
const pkgUrl = onGithub
? `${GITHUB}/repos/${plugin.owner}/${plugin.repo}/contents/package.json?ref=${head.commit}`
: `${API}/repos/DeepsSeekHarness/${plugin.repo}/contents/package.json?ref=${head.commit}`
const pkgResponse = await fetchRetry(pkgUrl, onGithub
? { headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'dsh-market-index' } }
: {})
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
let version
let commit
let timestamp
const pinned = componentByRepo.get(plugin.repo)
if (pinned !== undefined) {
// The checked-in release manifest is the source of truth for a published
// batch: version, commit and index entry are generated from the SAME record.
if (pinned.package !== plugin.name) throw new Error(`release manifest package mismatch for ${plugin.repo}: ${pinned.package} vs ${plugin.name}`)
version = pinned.version
commit = pinned.sourceCommit
timestamp = pinned.publishTimestamp ?? Math.floor(Date.now() / 1000)
if (!/^[0-9a-f]{40}$/i.test(commit)) throw new Error(`release manifest has no pinned commit for ${plugin.repo}`)
} else {
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}`)
version = pkg.version
commit = head.commit
timestamp = head.timestamp
}
plugins.push({
name: plugin.name,
title: plugin.title,
icon: plugin.icon,
description: plugin.description,
author: plugin.author || 'newbie',
homepage: web,
repository: { url: web },
author: 'newbie',
homepage: `${WEB}/${plugin.repo}`,
repository: { url: `${WEB}/${plugin.repo}` },
metadata: { keywords: plugin.keywords, labels: [], sortKeys: {} },
versions: [
{
version: version,
publishTimestamp: head.timestamp,
source: { type: 'git', url: web, commit: head.commit },
publishTimestamp: timestamp,
source: { type: 'git', url: `${WEB}/${plugin.repo}`, commit: commit },
engines: {},
},
],
})
console.log(`${plugin.name} ${version} @ ${head.commit.slice(0, 8)}`)
console.log(`${plugin.name} ${version} @ ${String(commit).slice(0, 8)}${pinned ? ' (release-manifest)' : ' (live)'}`)
}
const index = {
format: 1,
title: 'QQ 插件索引',
description: 'newbie 的 DSH 插件索引:QQ-dsh 全家桶及其四个组件,另收录外部依赖 Better Sidebar;源码托管在 git.qyhhh.top 的 DeepsSeekHarness 组织。',
description: 'newbie 的 DSH 插件索引:QQ-dsh 全家桶及其四个组件,源码托管在 git.qyhhh.top 的 DeepsSeekHarness 组织。',
metadata: { categories: {}, labels: {}, sortKeys: {} },
plugins,
}

View File

@ -1,50 +1,50 @@
{
"format": 1,
"generatedAt": "2026-11-29T05:56:03.000Z",
"generatedAt": "2026-11-12T18:53:45+08:00",
"components": [
{
"id": "dsh-sansheng-liubu",
"package": "dsh-sansheng-liubu",
"version": "1.1.2",
"package": "dsh-sansheng-liubu-mode",
"version": "0.14.0",
"repo": "dsh-sansheng-liubu",
"branch": "release/v1.1.2",
"sourceCommit": "fc414a542b4306f8469ccf028ce933cee3b1b938",
"publishTimestamp": 1795684440
"branch": "fix/workbench-entry-project-isolation",
"sourceCommit": "efc4a32c758d1df9bb3c22bb53f1359e0d433ab1",
"publishTimestamp": 1794480735
},
{
"id": "dsh-brain",
"package": "dsh-brain",
"version": "0.10.2",
"version": "0.9.1",
"repo": "dsh-brain",
"branch": "main",
"sourceCommit": "7a4ad249fc469ebbd4872f827f1b6b89c7a1a574",
"publishTimestamp": 1795695017
"branch": "fix/skill-sync-source-state",
"sourceCommit": "89af1f4c7c6acf65be93792f68eade383ec0d794",
"publishTimestamp": 1794480737
},
{
"id": "workspace-groups-remote",
"package": "workspace-groups-remote",
"version": "1.3.1",
"version": "1.1.0",
"repo": "workspace-groups-remote",
"branch": "main",
"sourceCommit": "97f4c3e07ffa665cfa2b5476625b4f1715f18295",
"publishTimestamp": 1795054575
"branch": "fix/folders-state-display-dedupe",
"sourceCommit": "413a98ba83aadb4b20ddea908b4fb2c1b47d9513",
"publishTimestamp": 1794480736
},
{
"id": "dsh-better-chat",
"package": "dsh-better-chat",
"version": "1.4.0",
"version": "0.3.1",
"repo": "dsh-better-chat",
"branch": "main",
"sourceCommit": "7d8dfb1e5dc6e943961a874d346179e24e15a74f",
"publishTimestamp": 1795931763
"branch": "fix/permission-no-overwrite",
"sourceCommit": "f2f11528bdd8779b247265ca8ba667287af12cd7",
"publishTimestamp": 1794480736
}
],
"bundle": {
"name": "qq-dsh",
"package": "qq-dsh",
"version": "1.5.1",
"version": "1.4.0",
"repo": "QQ-dsh",
"branch": "feat/components-0.14",
"sourceCommit": "3960386d138b0cbe1d65ecb8e8cdc162352c562b"
"sourceCommit": "2f2d049ad8039ef772f8d129e21249bdbef38479"
}
}

View File

@ -1,22 +0,0 @@
import { readFileSync, writeFileSync } from 'node:fs'
const API='https://git.qyhhh.top/api/v1'
const repo='dsh-better-chat'
const br=await (await fetch(API+'/repos/DeepsSeekHarness/'+repo+'/branches/main')).json()
const commit=br.commit.id
const ts=Math.floor(Date.parse(br.commit.timestamp)/1000)
const pkg=JSON.parse(Buffer.from((await (await fetch(API+'/repos/DeepsSeekHarness/'+repo+'/contents/package.json?ref=main')).json()).content,'base64').toString('utf8'))
console.log('live',pkg.version,commit.slice(0,8),ts)
const idx=JSON.parse(readFileSync('index.json','utf8'))
const p=idx.plugins.find(x=>x.name===repo)
p.title='dsh-better-chat · 聊天增强'
p.description='审批卡快捷键(可自定义)、权限界面移除「完全权限」、插件商店更新按钮;1.2 起把阅读页搬进对话页:过程自动折叠、逐字动效、mcp-app 交互卡片、公式与表格排版,并保留官方聊天契约让 dsh-btw 等插件照常工作。'
p.metadata = p.metadata||{}
p.metadata.keywords=['chat','approval','permission']
p.versions=[{version:pkg.version,publishTimestamp:ts,source:{type:'git',url:'https://git.qyhhh.top/DeepsSeekHarness/'+repo,commit},engines:{}}]
writeFileSync('index.json',JSON.stringify(idx,null,2)+'\n')
const mf=JSON.parse(readFileSync('release-manifest.json','utf8'))
const c=mf.components.find(x=>x.repo===repo)
c.version=pkg.version;c.sourceCommit=commit;c.publishTimestamp=ts;c.branch='main'
mf.generatedAt=new Date().toISOString().replace(/\.\d+Z$/,'.000Z')
writeFileSync('release-manifest.json',JSON.stringify(mf,null,2)+'\n')
console.log('done',p.versions[0].version,c.version,c.sourceCommit.slice(0,8))

View File

@ -1,5 +0,0 @@
@echo off
rem Unattended market-index refresh. Registered as the Windows scheduled task
rem "dsh-market-index-update"; logs to update-index.log next to this file.
set NODE=C:\Users\qyh15\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin\node.exe
"%NODE%" "%~dp0update-index.mjs"

View File

@ -1,122 +0,0 @@
// Unattended index updater.
//
// make-index.mjs reads each plugin repo's live HEAD and rewrites index.json from
// scratch. That is right for a release, but unsafe to run unattended: a plugin
// whose PLUGINS branch lags behind what the index already advertises (today:
// dsh-sansheng-liubu is pinned to release/v1.1.1 while the index says 1.1.2)
// would be downgraded, and plugins missing from PLUGINS would be dropped.
//
// This wrapper regenerates, then merges with a no-downgrade rule and pushes only
// when something really changed. Safe to run on a schedule.
//
// node update-index.mjs # pull, regenerate, merge, commit, push
// node update-index.mjs --dry-run # show what would change, write nothing
import { spawnSync } from 'node:child_process'
import { readFileSync, writeFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const ROOT = dirname(fileURLToPath(import.meta.url))
const INDEX = join(ROOT, 'index.json')
const DRY = process.argv.includes('--dry-run')
const LOG = join(ROOT, 'update-index.log')
function log(message) {
const line = `[${new Date().toISOString()}] ${message}`
console.log(line)
try {
const previous = readFileSync(LOG, 'utf8').split('\n').filter(Boolean).slice(-500).join('\n')
writeFileSync(LOG, `${previous}${previous === '' ? '' : '\n'}${line}\n`, 'utf8')
} catch {
// Logging must never break the update.
}
}
function run(command, args) {
const result = spawnSync(command, args, { cwd: ROOT, encoding: 'utf8' })
if (result.status !== 0) {
throw new Error(`${command} ${args.join(' ')} failed (${result.status}): ${(result.stderr || '').trim().slice(0, 400)}`)
}
return (result.stdout || '').trim()
}
/** Compare dotted versions; returns >0 when left is newer. */
function compareVersions(left, right) {
const a = String(left ?? '').split('.').map((part) => Number.parseInt(part, 10) || 0)
const b = String(right ?? '').split('.').map((part) => Number.parseInt(part, 10) || 0)
for (let index = 0; index < Math.max(a.length, b.length); index += 1) {
const diff = (a[index] ?? 0) - (b[index] ?? 0)
if (diff !== 0) return diff
}
return 0
}
try {
log('update-index: start')
run('git', ['pull', '--ff-only', '--quiet'])
// make-index.mjs overwrites index.json in place, so keep the committed text
// to diff against and to restore for --dry-run.
const beforeText = readFileSync(INDEX, 'utf8')
const before = JSON.parse(beforeText)
run(process.execPath, [join(ROOT, 'make-index.mjs')])
const generated = JSON.parse(readFileSync(INDEX, 'utf8'))
const existing = new Map((before.plugins ?? []).map((plugin) => [plugin.name, plugin]))
const merged = []
const notes = []
for (const plugin of generated.plugins ?? []) {
const current = existing.get(plugin.name)
if (current === undefined) {
merged.push(plugin)
notes.push(`add ${plugin.name} ${plugin.versions?.[0]?.version}`)
continue
}
const nextVersion = plugin.versions?.[0]?.version
const currentVersion = current.versions?.[0]?.version
if (compareVersions(nextVersion, currentVersion) < 0) {
merged.push(current)
notes.push(`keep ${plugin.name} ${currentVersion} (regenerator saw ${nextVersion})`)
continue
}
if (compareVersions(nextVersion, currentVersion) === 0
&& plugin.versions?.[0]?.source?.commit === current.versions?.[0]?.source?.commit) {
merged.push(current)
continue
}
merged.push(plugin)
notes.push(`update ${plugin.name} ${currentVersion} -> ${nextVersion}`)
}
// Plugins the regenerator no longer knows about stay in the index.
for (const [name, plugin] of existing) {
if (!merged.some((item) => item.name === name)) {
merged.push(plugin)
notes.push(`keep ${name} (absent from generator)`)
}
}
const next = { ...generated, plugins: merged }
const text = `${JSON.stringify(next, null, 2)}\n`
const unchanged = text === beforeText
if (unchanged) {
if (readFileSync(INDEX, 'utf8') !== beforeText) writeFileSync(INDEX, beforeText, 'utf8')
log('update-index: nothing to do')
process.exit(0)
}
for (const note of notes) log(` ${note}`)
if (DRY) {
writeFileSync(INDEX, beforeText, 'utf8')
log('update-index: dry run, not writing')
process.exit(0)
}
writeFileSync(INDEX, text, 'utf8')
run('git', ['add', 'index.json'])
run('git', ['-c', 'user.name=newbie', '-c', 'user.email=newbie@git.qyhhh.top',
'commit', '--quiet', '-m', `market: refresh index\n\n${notes.join('\n')}`])
run('git', ['push', '--quiet', 'origin', 'HEAD:main'])
log('update-index: pushed')
} catch (error) {
log(`update-index: FAILED ${error instanceof Error ? error.message : String(error)}`)
process.exitCode = 1
}