Merge pull request 'fix(update): 更新检查改查本仓 Gitea,修复查不到新版 (v0.5.3-local.6)' (#7) from fix/v0.5.3-local.6-update-source into main
[v0.5.3-local.6] 更新检查改查本仓 Gitea
This commit was merged in pull request #7.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "dsh-worktable",
|
||||
"description": "工作台:DSH 侧边栏的 agent 级项目容器,收纳如 TravelAtlas 等自装项目",
|
||||
"version": "0.5.3-local.5",
|
||||
"version": "0.5.3-local.6",
|
||||
"entry": {
|
||||
"name": "dsh-worktable",
|
||||
"inject": []
|
||||
|
||||
@@ -8967,9 +8967,10 @@ function hostPreviewUrl(path, surface = {
|
||||
if (url.protocol !== "http:" && url.protocol !== "https:") throw new Error("Unsupported Host preview protocol");
|
||||
return url.href;
|
||||
}
|
||||
var UPDATE_TGZ = "https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.6/dsh-worktable.tgz";
|
||||
function worktableUpgrade(protocol = typeof location === "undefined" ? "http:" : location.protocol) {
|
||||
const desktop = protocol === "dsh-app:";
|
||||
const command = "dsh plugin --profile " + (desktop ? "desktop" : "web") + ' add "https://github.com/Aisland-SJL/dsh-worktable/releases/latest/download/dsh-worktable.tgz"';
|
||||
const command = "dsh plugin --profile " + (desktop ? "desktop" : "web") + ' add "' + UPDATE_TGZ + '"';
|
||||
const prompt = desktop ? "\u5E2E\u6211\u5347\u7EA7 dsh-worktable\u3002\u6211\u5F53\u524D\u4F7F\u7528\u5B98\u65B9\u684C\u9762\u7AEF\uFF1A\u5148\u5B9A\u4F4D\u8BE5\u684C\u9762\u7AEF\u81EA\u5E26\u7684 dsh CLI \u5E76\u51C6\u5907\u66F4\u65B0\uFF0C\u518D\u63D0\u9192\u6211\u5B8C\u6574\u9000\u51FA\u684C\u9762\u7AEF\u3002\u786E\u8BA4\u9000\u51FA\u540E\u4F7F\u7528\u8BE5 CLI \u6267\u884C " + command + "\u3002\u4E0D\u8981\u4F7F\u7528\u7F51\u9875\u7AEF CLI\uFF0C\u4E0D\u8981\u4FEE\u6539 web profile\uFF0C\u4E0D\u8981\u81EA\u52A8\u6740\u8FDB\u7A0B\u6216\u91CD\u542F\uFF1B\u5B8C\u6210\u540E\u63D0\u9192\u6211\u624B\u52A8\u91CD\u65B0\u6253\u5F00\u684C\u9762\u7AEF\u3002" : "\u5E2E\u6211\u5347\u7EA7 dsh-worktable\uFF1A\u6267\u884C " + command + "\uFF0C\u5B8C\u6210\u540E\u63D0\u9192\u6211\u91CD\u542F dsh web \u5E76\u5237\u65B0\u9875\u9762";
|
||||
return { command, prompt, desktop };
|
||||
}
|
||||
@@ -9199,8 +9200,9 @@ var CHANGELOG_V030 = `\u66F4\u65B0\u516C\u544A \xB7 v0.5.1
|
||||
\u30103.1 \u6587\u5B57\u4E0E\u7EC6\u8282\u6253\u78E8\u3011\u5168\u5C40\u5B57\u4F53\u4E0E\u5B57\u53F7\u7EDF\u4E00\u4F18\u5316\u3001\u4E0B\u62C9\u9762\u677F\u73BB\u7483\u5316\u4E0E\u5BF9\u9F50\u3001\u83DC\u5355\u70B9\u9009\u540E\u4FDD\u6301\u6253\u5F00\u4FBF\u4E8E\u8FDE\u7EED\u9884\u89C8\u3001\u6309\u94AE\u63CF\u8FB9\u4E0E\u60AC\u505C\u53CD\u9988\u7B49\u4EA4\u4E92\u7EC6\u8282\uFF1B\u540C\u65F6\u4FEE\u590D\u4E86\u591A\u9879\u4F53\u9A8C\u95EE\u9898\uFF08\u7167\u7247\u4E0A\u4F20\u6E05\u6670\u5EA6\u3001\u80CC\u666F\u7F51\u683C\u7EBF\u5728\u7167\u7247\u6A21\u5F0F\u4E0B\u4E0D\u751F\u6548\u3001\u6D45\u8272\u4E3B\u9898\u4E0B\u5DE5\u4F5C\u72B6\u6001\u5149\u6548\u4E0D\u53EF\u89C1\u7B49\uFF09\u3002`;
|
||||
|
||||
// src/client/updateCheck.ts
|
||||
var LOCAL_VERSION = false ? "dev" : "0.5.3-local.5";
|
||||
var UPDATE_REPO = "Aisland-SJL/dsh-worktable";
|
||||
var LOCAL_VERSION = false ? "dev" : "0.5.3-local.6";
|
||||
var UPDATE_HOST = "https://gitea.ququclean.com";
|
||||
var UPDATE_REPO = "xiaoqu/dsh-worktable";
|
||||
var K_UPDATE_CHECK = "dsh.worktable.updateCheck.v1";
|
||||
var K_LAST_CHECK = "dsh.worktable.lastUpdateCheck.v1";
|
||||
var K_SKIP = "dsh.worktable.skipVersion.v1";
|
||||
@@ -9304,7 +9306,7 @@ async function checkUpdate(force = false) {
|
||||
const ctrl = new AbortController();
|
||||
const timer2 = setTimeout(() => ctrl.abort(), 8e3);
|
||||
try {
|
||||
const r = await fetch("https://api.github.com/repos/" + UPDATE_REPO + "/releases/latest", { headers: { Accept: "application/vnd.github+json" }, cache: "no-store", signal: ctrl.signal });
|
||||
const r = await fetch(UPDATE_HOST + "/api/v1/repos/" + UPDATE_REPO + "/releases/latest", { headers: { Accept: "application/json" }, cache: "no-store", signal: ctrl.signal });
|
||||
if (r.ok) d = await r.json();
|
||||
else if (r.status === 403 || r.status === 404) break;
|
||||
} catch {
|
||||
@@ -20869,7 +20871,8 @@ function flushHostSave() {
|
||||
|
||||
// src/client/index.tsx
|
||||
var import_jsx_runtime3 = require("react/jsx-runtime");
|
||||
var UPDATE_REPO2 = "Aisland-SJL/dsh-worktable";
|
||||
var UPDATE_HOST2 = "https://gitea.ququclean.com";
|
||||
var UPDATE_REPO2 = "xiaoqu/dsh-worktable";
|
||||
var { command: UPGRADE_CMD, prompt: UPGRADE_AI2, desktop: DESKTOP_HOST } = worktableUpgrade();
|
||||
var ICON_SYNC = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { viewBox: "0 0 16 16", "aria-hidden": true, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", d: "M1.5 8a6.5 6.5 0 0 1 11.1-4.6L14.5 5" }),
|
||||
@@ -21793,7 +21796,7 @@ function WorktableSection(props) {
|
||||
const ctrl = new AbortController();
|
||||
const timer2 = setTimeout(() => ctrl.abort(), 8e3);
|
||||
try {
|
||||
const r = await fetch("https://api.github.com/repos/" + UPDATE_REPO2 + "/releases/latest", { headers: { Accept: "application/vnd.github+json" }, cache: "no-store", signal: ctrl.signal });
|
||||
const r = await fetch(UPDATE_HOST2 + "/api/v1/repos/" + UPDATE_REPO2 + "/releases/latest", { headers: { Accept: "application/json" }, cache: "no-store", signal: ctrl.signal });
|
||||
if (r.ok) d = await r.json();
|
||||
else if (r.status === 403 || r.status === 404) break;
|
||||
} catch {
|
||||
|
||||
@@ -382,7 +382,7 @@ function resolveDshHomeSafe() {
|
||||
cachedDshHome = baseDshHome();
|
||||
return cachedDshHome;
|
||||
}
|
||||
var PLUGIN_VERSION = false ? "dev" : "0.5.3-local.5";
|
||||
var PLUGIN_VERSION = false ? "dev" : "0.5.3-local.6";
|
||||
var name = "dsh-worktable";
|
||||
var inject = ["webServer", "sessions"];
|
||||
var HEALTH_PATH = "/api/worktable/health";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "dsh-worktable",
|
||||
"description": "工作台 Worktable:DeepSeek Harness 侧边栏的 agent 级项目容器(应用抽屉)",
|
||||
"version": "0.5.3-local.5",
|
||||
"version": "0.5.3-local.6",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Aisland-SJL/dsh-worktable.git",
|
||||
|
||||
@@ -36,9 +36,13 @@ export function hostPreviewUrl(
|
||||
}
|
||||
|
||||
/** Keep update instructions on the active profile; Desktop must use its bundled CLI. */
|
||||
// 本仓发布在自建 Gitea:它不支持 GitHub 的 /releases/latest/download 简写,
|
||||
// 安装命令必须带具体 tag。这里给固定 tag(随发布更新),避免给出 404 的命令。
|
||||
const UPDATE_TGZ = 'https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.6/dsh-worktable.tgz'
|
||||
|
||||
export function worktableUpgrade(protocol = typeof location === 'undefined' ? 'http:' : location.protocol) {
|
||||
const desktop = protocol === 'dsh-app:'
|
||||
const command = 'dsh plugin --profile ' + (desktop ? 'desktop' : 'web') + ' add "https://github.com/Aisland-SJL/dsh-worktable/releases/latest/download/dsh-worktable.tgz"'
|
||||
const command = 'dsh plugin --profile ' + (desktop ? 'desktop' : 'web') + ' add "' + UPDATE_TGZ + '"'
|
||||
const prompt = desktop
|
||||
? '帮我升级 dsh-worktable。我当前使用官方桌面端:先定位该桌面端自带的 dsh CLI 并准备更新,再提醒我完整退出桌面端。确认退出后使用该 CLI 执行 ' + command + '。不要使用网页端 CLI,不要修改 web profile,不要自动杀进程或重启;完成后提醒我手动重新打开桌面端。'
|
||||
: '帮我升级 dsh-worktable:执行 ' + command + ',完成后提醒我重启 dsh web 并刷新页面'
|
||||
|
||||
@@ -30,8 +30,11 @@ import { loadHostState, queueHostSave, markHydrated, staysReadOnly, flushHostSav
|
||||
type OrderBy = 'manual' | 'recent'
|
||||
type DockMode = 'footer' | 'float'
|
||||
|
||||
// ── 更新检查(客户端直连 GitHub Releases API,只读 GET;失败静默)──
|
||||
const UPDATE_REPO = 'Aisland-SJL/dsh-worktable'
|
||||
// ── 更新检查(客户端直连本仓 Gitea Releases API,只读 GET;失败静默)──
|
||||
// 本仓是内部补丁分发仓:上游只发官方版(无本地补丁),
|
||||
// 查上游既看不到本仓版本,国内网络也常失败。
|
||||
const UPDATE_HOST = 'https://gitea.ququclean.com'
|
||||
const UPDATE_REPO = 'xiaoqu/dsh-worktable'
|
||||
const { command: UPGRADE_CMD, prompt: UPGRADE_AI, desktop: DESKTOP_HOST } = worktableUpgrade()
|
||||
// 更新提示图标(手绘 SVG,避免 emoji 跨平台渲染差异)
|
||||
const ICON_SYNC = (
|
||||
@@ -1094,7 +1097,7 @@ function WorktableSection(props: any) {
|
||||
const ctrl = new AbortController()
|
||||
const timer = setTimeout(() => ctrl.abort(), 8000) // 单次 8s 超时,计入下一轮重试
|
||||
try {
|
||||
const r = await fetch('https://api.github.com/repos/' + UPDATE_REPO + '/releases/latest', { headers: { Accept: 'application/vnd.github+json' }, cache: 'no-store', signal: ctrl.signal })
|
||||
const r = await fetch(UPDATE_HOST + '/api/v1/repos/' + UPDATE_REPO + '/releases/latest', { headers: { Accept: 'application/json' }, cache: 'no-store', signal: ctrl.signal })
|
||||
if (r.ok) d = await r.json() as { tag_name?: string; body?: string; html_url?: string }
|
||||
else if (r.status === 403 || r.status === 404) break // 限流/不存在:不再重试
|
||||
} catch { /* 网络抖动/超时:下一轮重试 */ }
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/** 更新检查核心(控制室公告页使用;设置面板保留自身实现,后续版本统一去重)。键与设置面板共用。 */
|
||||
declare const __WT_VERSION__: string
|
||||
export const LOCAL_VERSION = typeof __WT_VERSION__ === 'undefined' ? 'dev' : __WT_VERSION__
|
||||
const UPDATE_REPO = 'Aisland-SJL/dsh-worktable'
|
||||
// 本仓是内部补丁分发仓,更新源必须是自己的 Gitea,而不是上游 GitHub:
|
||||
// 上游只发布官方版(无本地补丁),查它既看不到本仓版本,国内网络也常失败。
|
||||
const UPDATE_HOST = 'https://gitea.ququclean.com'
|
||||
const UPDATE_REPO = 'xiaoqu/dsh-worktable'
|
||||
|
||||
export type UpdateStatus = 'idle' | 'checking' | 'uptodate' | 'failed'
|
||||
export type UpdateInfo = { latest: string; notes: string; url: string }
|
||||
@@ -92,7 +95,7 @@ export async function checkUpdate(force = false): Promise<{ status: UpdateStatus
|
||||
const ctrl = new AbortController()
|
||||
const timer = setTimeout(() => ctrl.abort(), 8000)
|
||||
try {
|
||||
const r = await fetch('https://api.github.com/repos/' + UPDATE_REPO + '/releases/latest', { headers: { Accept: 'application/vnd.github+json' }, cache: 'no-store', signal: ctrl.signal })
|
||||
const r = await fetch(UPDATE_HOST + '/api/v1/repos/' + UPDATE_REPO + '/releases/latest', { headers: { Accept: 'application/json' }, cache: 'no-store', signal: ctrl.signal })
|
||||
if (r.ok) d = (await r.json()) as { tag_name?: string; body?: string; html_url?: string }
|
||||
else if (r.status === 403 || r.status === 404) break
|
||||
} catch { /* 网络抖动/超时:下一轮重试 */ }
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
> 每条标注日期、动机、落点与验证方式。改动在 `01_content/src/`,经 `npm run build`
|
||||
> 产出 `lib/`;发布物由 `npm run pack`(`01_content/release-prep.mjs`)生成。
|
||||
|
||||
当前版本:**0.5.3-local.5**(2026-12-02)
|
||||
产物:`01_content/dist/v0.5.3-local.5/dsh-worktable.tgz`,485007 字节,
|
||||
sha256 `cf633ad71d175a7125d4d49da1732515f32e6d02dc8ae4b7786379e8f712a31d`
|
||||
当前版本:**0.5.3-local.6**(2026-12-02)
|
||||
产物:`01_content/dist/v0.5.3-local.6/dsh-worktable.tgz`,485062 字节,
|
||||
sha256 `95b2b6b1e434c001e653db7e855deba54a355c86b0d5b0d605c7ac47a3e680b9`
|
||||
|
||||
---
|
||||
|
||||
@@ -126,7 +126,40 @@ nav.bt-home-nav{display:none!important} /* 首
|
||||
|
||||
---
|
||||
|
||||
## 六、工具链修复(0.5.3-local.5,2026-12-02)
|
||||
## 六、更新检查改指本仓 Gitea(0.5.3-local.6,2026-12-02)
|
||||
|
||||
**现象**:控制室/设置里点「立即检查」,查不到本仓新发布的版本,还常显示「上次检查未成功」。
|
||||
|
||||
**根因**:本仓从上游 fork 后,更新检查仍查上游 GitHub:
|
||||
|
||||
```ts
|
||||
fetch('https://api.github.com/repos/Aisland-SJL/dsh-worktable/releases/latest')
|
||||
```
|
||||
|
||||
三重问题:
|
||||
1. 上游只发**官方版**(无本地补丁),本仓的 `-local.*` 版本它根本不知道
|
||||
2. 国内网络访问 `api.github.com` 常失败 → 「检查未成功」
|
||||
3. 安装命令也指向上游 `github.com/.../releases/latest/download/`
|
||||
|
||||
**改动**(三处):
|
||||
|
||||
| 文件 | 改动 |
|
||||
|---|---|
|
||||
| `src/client/updateCheck.ts` | 控制室用:`UPDATE_HOST` + Gitea API `/api/v1/repos/xiaoqu/dsh-worktable/releases/latest` |
|
||||
| `src/client/index.tsx` | 设置面板用(独立实现):同样改 Gitea API |
|
||||
| `src/client/hostTransport.ts` | `worktableUpgrade()` 的安装命令改为带具体 tag 的本仓 tgz |
|
||||
|
||||
**注意**:Gitea **不支持** GitHub 的 `/releases/latest/download/<asset>` 简写(实测 404),
|
||||
安装命令必须带具体 tag,所以 `UPDATE_TGZ` 是固定 URL,每次发版要同步更新。
|
||||
|
||||
**测试**:`04_test/sidebar-popup.test.mjs` 的 `releaseUrl` 断言同步改为新 API 地址。
|
||||
|
||||
**版本比较无需改动**:`cmpVer('v0.5.2-local.6', '0.5.3-local.5') = -1`,
|
||||
core 段 0.5.2 < 0.5.3 已能正确判定「有新版」。
|
||||
|
||||
---
|
||||
|
||||
## 七、工具链修复(0.5.3-local.5,2026-12-02)
|
||||
|
||||
三个 Windows 兼容缺陷,不修则 `npm run pack` 门禁过不去:
|
||||
|
||||
@@ -141,7 +174,7 @@ nav.bt-home-nav{display:none!important} /* 首
|
||||
|
||||
---
|
||||
|
||||
## 七、安装 / 重启
|
||||
## 八、安装 / 重启
|
||||
|
||||
- 发布版安装:`dsh plugin --profile web add "<release tgz URL>"`
|
||||
- **桌面端:先完全退出 Slark,再执行命令**,装完手动重开。
|
||||
@@ -151,7 +184,7 @@ nav.bt-home-nav{display:none!important} /* 首
|
||||
|
||||
---
|
||||
|
||||
## 八、回归入口
|
||||
## 九、回归入口
|
||||
|
||||
```bash
|
||||
cd 01_content
|
||||
@@ -170,7 +203,7 @@ sidebar/control-room/update 呈现 → 真实 Chromium 分栏边距(5 场景
|
||||
|
||||
---
|
||||
|
||||
## 九、已知边界
|
||||
## 十、已知边界
|
||||
|
||||
1. **同 tag 资产不可覆盖**:坏包处理 = 发新版本号 + 旧 Release 正文标注问题。
|
||||
2. 平台边界:Windows 网页端为已测范围;macOS 为核心路径已做跨平台适配、
|
||||
|
||||
@@ -304,7 +304,8 @@ function testConsolePresentation() {
|
||||
}
|
||||
|
||||
async function testUpdatePresentation() {
|
||||
const releaseUrl = 'https://api.github.com/repos/Aisland-SJL/dsh-worktable/releases/latest'
|
||||
// 更新源是本仓 Gitea(内部补丁分发仓),不是上游 GitHub
|
||||
const releaseUrl = 'https://gitea.ququclean.com/api/v1/repos/xiaoqu/dsh-worktable/releases/latest'
|
||||
for (const outcome of ['older', 'same', 'forbidden', 'invalid', 'invalid-prefix', 'skip']) {
|
||||
let response = { status: 200, tag: 'v9.0.0' }
|
||||
let requests = 0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> ## 📦 本仓库是内部补丁分发仓,不是上游源码仓
|
||||
>
|
||||
> 上游:<https://github.com/Aisland-SJL/dsh-worktable> | 本仓 = 上游 **v0.5.1** + 桌面端状态持久化补丁 + 本项目自用的若干增强(`0.5.3-local.5`)。
|
||||
> 上游:<https://github.com/Aisland-SJL/dsh-worktable> | 本仓 = 上游 **v0.5.1** + 桌面端状态持久化补丁 + 本项目自用的若干增强(`0.5.3-local.6`)。
|
||||
> 下面从「Screenshots」开始的全部内容是上游 README 原文;本地改动逐条记录见 [LOCAL-CHANGES.md](02_process/LOCAL-CHANGES.md)。
|
||||
|
||||
### 要不要装
|
||||
@@ -16,16 +16,16 @@
|
||||
|
||||
### 安装
|
||||
|
||||
当前版本 **v0.5.3-local.5**:
|
||||
当前版本 **v0.5.3-local.6**:
|
||||
|
||||
```bash
|
||||
dsh plugin --profile web add "https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.5/dsh-worktable.tgz"
|
||||
dsh plugin --profile web add "https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.6/dsh-worktable.tgz"
|
||||
```
|
||||
|
||||
- **桌面端:先完全退出 Slark,再执行命令**,装完手动重开;不要在宿主运行时安装。
|
||||
- `--profile web` 按你自己的 profile 名字改。
|
||||
- 资产 `dsh-worktable.tgz`,485007 字节,sha256:
|
||||
`cf633ad71d175a7125d4d49da1732515f32e6d02dc8ae4b7786379e8f712a31d`
|
||||
- 资产 `dsh-worktable.tgz`,485062 字节,sha256:
|
||||
`95b2b6b1e434c001e653db7e855deba54a355c86b0d5b0d605c7ac47a3e680b9`
|
||||
(下载后可 `Get-FileHash dsh-worktable.tgz -Algorithm SHA256` 核对)
|
||||
- 声明兼容的 DSH 版本:`0.2.0-rc.2` / `0.2.1-rc.3` / `0.2.1-rc.5` / `0.2.2-alpha.2`。
|
||||
宿主不在这个列表里时,安装会被兼容性检查直接拒绝并回滚。
|
||||
@@ -50,7 +50,7 @@ dsh plugin --profile web add "https://gitea.ququclean.com/xiaoqu/dsh-worktable/r
|
||||
|
||||
### 升级与回退
|
||||
|
||||
- 装上 `0.5.3-local.5` 后,插件不会提示升级到 0.5.1。
|
||||
- 装上 `0.5.3-local.6` 后,插件不会提示升级到 0.5.1。
|
||||
- 上游发布 0.5.2 及以上时插件会提示升级;**一旦升级就回到没有补丁的状态**,重启又会丢数据。新版本需要把补丁重新合并(改动清单见 [LOCAL-CHANGES.md](02_process/LOCAL-CHANGES.md))。
|
||||
- 回退官方版:
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user