From 2c1de28a16727b52cebd420b95ffc9f0aed83b0e Mon Sep 17 00:00:00 2001 From: yunyingk Date: Wed, 26 Aug 2026 16:31:00 +0800 Subject: [PATCH] Release v0.9.4: Optimize update fail-safe fallback routing and enforce global skill sync --- .zcode-plugin/plugin.json | 2 +- CHANGELOG.md | 9 ++++++ dist/mcp/server.js | 63 +++++++++++++++++++++++--------------- dist/openapi.json | 2 +- openapi/openapi.yaml | 2 +- package.json | 2 +- skills/seal-home/SKILL.md | 8 ++--- src/cli/commands/update.ts | 53 ++++++++++++++++++++++---------- src/core/embedded-skill.ts | 7 ++--- 9 files changed, 93 insertions(+), 55 deletions(-) diff --git a/.zcode-plugin/plugin.json b/.zcode-plugin/plugin.json index bbaaf0c..8850ef0 100644 --- a/.zcode-plugin/plugin.json +++ b/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "seal-home", - "version": "0.9.3", + "version": "0.9.4", "description": "Seal Home tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.", "author": { "name": "yingqing" diff --git a/CHANGELOG.md b/CHANGELOG.md index a1579e9..81179d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [0.9.4] - 2026-08-26 + +### Fixed & Enhanced +- **Seamless Release Mirror Fallback & Fail-Safe Routing**: Enhanced `seal-home update` release discovery and asset downloading to automatically fall through to fast CDN and GitHub direct mirrors if a primary mirror returns an incomplete/empty asset list or times out, preventing update failures during in-progress release publishing. +- **Unconditional Global Skill Synchronization**: Ensured `seal-home update` and `skill install` always overwrite and synchronize all latest embedded skill files (including `SKILL.md` and all references) to `~/.agents/skills/seal-home/`. +- **Parallel Gitea Asset Release Upload**: Optimized CI release workflow to upload release binaries in parallel, reducing publishing latency from 6+ minutes down to ~30 seconds. + +--- + ## [0.9.3] - 2026-08-26 ### Added diff --git a/dist/mcp/server.js b/dist/mcp/server.js index 7016b1c..93fe02f 100644 --- a/dist/mcp/server.js +++ b/dist/mcp/server.js @@ -25094,7 +25094,7 @@ async function createSealClientForToken(corp, token) { // package.json var package_default = { name: "seal-home", - version: "0.9.3", + version: "0.9.4", type: "module", module: "src/server.ts", bin: { @@ -30473,7 +30473,7 @@ var openapi_default = { openapi: "3.1.0", info: { title: "seal-home Wrapped API", - version: "0.9.3", + version: "0.9.4", description: `Planned HTTP contract for the seal-home wrapped backend API. These endpoints describe the intended stable API for frontend developers and agents once @@ -34768,20 +34768,20 @@ import { existsSync as existsSync7 } from "node:fs"; import { join as join7 } from "node:path"; // src/core/embedded-skill.ts -import { existsSync as existsSync6, mkdirSync as mkdirSync5, writeFileSync as writeFileSync6 } from "node:fs"; +import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync6 } from "node:fs"; import { homedir as homedir4 } from "node:os"; import { dirname as dirname3, join as join6 } from "node:path"; // skills/seal-home/SKILL.md var SKILL_default = `--- name: seal-home -description: "v0.9.3: Use when working with Seal Home tenant operations: packaged customer feedback from WeChat or screenshots, target-enterprise discovery, approval-run and Langfuse diagnosis, simulation test batch creation and publishing, minimal approval-rule remediation and publishing, delegation links, Hose/合思 authorization, LLM config, permissions, billing, users, rules, documents, and search." +description: "v0.9.4: Use when working with Seal Home tenant operations: packaged customer feedback from WeChat or screenshots, target-enterprise discovery, approval-run and Langfuse diagnosis, simulation test batch creation and publishing, minimal approval-rule remediation and publishing, delegation links, Hose/合思 authorization, LLM config, permissions, billing, users, rules, documents, and search." metadata: - version: 0.9.3 - short-description: Seal tenant and Hose approval automation (v0.9.3) + version: 0.9.4 + short-description: Seal tenant and Hose approval automation (v0.9.4) --- -# Seal Home (v0.9.3) +# Seal Home (v0.9.4) Use the \`seal_cli\` MCP tool when it is available; pass the command string as its \`command\` argument. If MCP is unavailable, fall back to the global \`seal-home\` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail. @@ -36013,11 +36013,8 @@ function installSkillFiles(targetDir = getDefaultGlobalSkillDir()) { } function syncGlobalSkillIfPresent() { const globalDir = getDefaultGlobalSkillDir(); - if (existsSync6(globalDir)) { - installSkillFiles(globalDir); - return { synced: true, targetDir: globalDir }; - } - return { synced: false }; + installSkillFiles(globalDir); + return { synced: true, targetDir: globalDir }; } // src/cli/commands/skill.ts @@ -36377,6 +36374,7 @@ async function fetchGitHubRelease(repo, targetVersion) { `https://git.ying-qing.cn/api/v1/repos/gitea/seal-home/releases/latest`, `https://api.github.com/repos/${repo}/releases/latest` ]; + let fallbackRelease; for (const url2 of urls) { try { const res = await fetch(url2, { headers, signal: AbortSignal.timeout(5000) }); @@ -36392,7 +36390,7 @@ async function fetchGitHubRelease(repo, targetVersion) { downloadUrl: item.browser_download_url, size: item.size ?? 0 })); - return { + const candidateRelease = { version: version2, tagName, name: json2.name ?? tagName, @@ -36402,9 +36400,15 @@ async function fetchGitHubRelease(repo, targetVersion) { htmlUrl: json2.html_url ?? "", assets }; + if (assets.length > 0) { + return candidateRelease; + } + if (!fallbackRelease) { + fallbackRelease = candidateRelease; + } } catch {} } - return; + return fallbackRelease; } function matchAssetForPlatform(assets, platform, arch) { const platformKeywords = { @@ -36439,19 +36443,28 @@ function logProgress(msg) { } async function downloadFile(url2, destPath, tagName, assetName) { const candidates = []; - if (tagName && assetName) { - const tag = tagName.startsWith("v") ? tagName : `v${tagName}`; - candidates.push(`https://git.ying-qing.cn/gitea/seal-home/releases/download/${tag}/${assetName}`); + const tag = tagName ? tagName.startsWith("v") ? tagName : `v${tagName}` : undefined; + const fileName = assetName || url2.split("/").pop() || ""; + if (tag && fileName) { + candidates.push(`https://git.ying-qing.cn/gitea/seal-home/releases/download/${tag}/${fileName}`); } if (url2.startsWith("https://git.ying-qing.cn")) { - candidates.unshift(url2); + candidates.push(url2); + } + if (tag && fileName) { + const ghDirectUrl = `https://github.com/${DEFAULT_GITHUB_REPO}/releases/download/${tag}/${fileName}`; + candidates.push(`https://ghfast.top/${ghDirectUrl}`); + candidates.push(`https://ghproxy.net/${ghDirectUrl}`); + candidates.push(`https://gh.ddlc.top/${ghDirectUrl}`); + candidates.push(`https://mirror.ghproxy.com/${ghDirectUrl}`); + candidates.push(ghDirectUrl); + } else if (url2.includes("github.com")) { + candidates.push(`https://ghfast.top/${url2}`); + candidates.push(`https://ghproxy.net/${url2}`); + candidates.push(`https://gh.ddlc.top/${url2}`); + candidates.push(`https://mirror.ghproxy.com/${url2}`); + candidates.push(url2); } else { - if (url2.includes("github.com")) { - candidates.push(`https://ghfast.top/${url2}`); - candidates.push(`https://ghproxy.net/${url2}`); - candidates.push(`https://gh.ddlc.top/${url2}`); - candidates.push(`https://mirror.ghproxy.com/${url2}`); - } candidates.push(url2); } const uniqueCandidates = Array.from(new Set(candidates)); @@ -36460,7 +36473,7 @@ async function downloadFile(url2, destPath, tagName, assetName) { const candidate = uniqueCandidates[i]; try { logProgress(`==> [${i + 1}/${uniqueCandidates.length}] Downloading via: ${candidate}`); - const res = await fetch(candidate, { signal: AbortSignal.timeout(1e4) }); + const res = await fetch(candidate, { signal: AbortSignal.timeout(6000) }); if (!res.ok) { throw new Error(`HTTP ${res.status} ${res.statusText}`); } diff --git a/dist/openapi.json b/dist/openapi.json index d688b4b..e4e46ab 100644 --- a/dist/openapi.json +++ b/dist/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "seal-home Wrapped API", - "version": "0.9.3", + "version": "0.9.4", "description": "Planned HTTP contract for the seal-home wrapped backend API.\n\nThese endpoints describe the intended stable API for frontend developers and agents once\nthe HTTP adapter is implemented.\nThey are not the raw downstream Seal endpoints. seal-home is responsible for enterprise\nselection, source authentication, response compaction, and diagnostics-friendly fields.\n" }, "servers": [ diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index f20a509..935a7d6 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: seal-home Wrapped API - version: 0.9.3 + version: 0.9.4 description: | Planned HTTP contract for the seal-home wrapped backend API. diff --git a/package.json b/package.json index b0d4194..3d6e9f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seal-home", - "version": "0.9.3", + "version": "0.9.4", "type": "module", "module": "src/server.ts", "bin": { diff --git a/skills/seal-home/SKILL.md b/skills/seal-home/SKILL.md index c41624e..a4ab242 100644 --- a/skills/seal-home/SKILL.md +++ b/skills/seal-home/SKILL.md @@ -1,12 +1,12 @@ --- name: seal-home -description: "v0.9.3: Use when working with Seal Home tenant operations: packaged customer feedback from WeChat or screenshots, target-enterprise discovery, approval-run and Langfuse diagnosis, simulation test batch creation and publishing, minimal approval-rule remediation and publishing, delegation links, Hose/合思 authorization, LLM config, permissions, billing, users, rules, documents, and search." +description: "v0.9.4: Use when working with Seal Home tenant operations: packaged customer feedback from WeChat or screenshots, target-enterprise discovery, approval-run and Langfuse diagnosis, simulation test batch creation and publishing, minimal approval-rule remediation and publishing, delegation links, Hose/合思 authorization, LLM config, permissions, billing, users, rules, documents, and search." metadata: - version: 0.9.3 - short-description: Seal tenant and Hose approval automation (v0.9.3) + version: 0.9.4 + short-description: Seal tenant and Hose approval automation (v0.9.4) --- -# Seal Home (v0.9.3) +# Seal Home (v0.9.4) Use the `seal_cli` MCP tool when it is available; pass the command string as its `command` argument. If MCP is unavailable, fall back to the global `seal-home` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail. diff --git a/src/cli/commands/update.ts b/src/cli/commands/update.ts index a212d3f..bf058a4 100644 --- a/src/cli/commands/update.ts +++ b/src/cli/commands/update.ts @@ -379,6 +379,8 @@ async function fetchGitHubRelease(repo: string, targetVersion?: string): Promise `https://api.github.com/repos/${repo}/releases/latest` ]; + let fallbackRelease: GitHubRelease | undefined; + for (const url of urls) { try { const res = await fetch(url, { headers, signal: AbortSignal.timeout(5000) }); @@ -403,7 +405,7 @@ async function fetchGitHubRelease(repo: string, targetVersion?: string): Promise size: item.size ?? 0 })); - return { + const candidateRelease: GitHubRelease = { version, tagName, name: json.name ?? tagName, @@ -413,12 +415,22 @@ async function fetchGitHubRelease(repo: string, targetVersion?: string): Promise htmlUrl: json.html_url ?? "", assets }; + + // If this source already has uploaded assets, return it immediately. + if (assets.length > 0) { + return candidateRelease; + } + + // Otherwise keep as fallback (in case all sources have no assets) + if (!fallbackRelease) { + fallbackRelease = candidateRelease; + } } catch { // try next source } } - return undefined; + return fallbackRelease; } function matchAssetForPlatform( @@ -470,25 +482,32 @@ function logProgress(msg: string) { async function downloadFile(url: string, destPath: string, tagName?: string, assetName?: string) { const candidates: string[] = []; + const tag = tagName ? (tagName.startsWith("v") ? tagName : `v${tagName}`) : undefined; + const fileName = assetName || url.split("/").pop() || ""; // 1. High-speed Gitea direct mirror first - if (tagName && assetName) { - const tag = tagName.startsWith("v") ? tagName : `v${tagName}`; - candidates.push(`https://git.ying-qing.cn/gitea/seal-home/releases/download/${tag}/${assetName}`); + if (tag && fileName) { + candidates.push(`https://git.ying-qing.cn/gitea/seal-home/releases/download/${tag}/${fileName}`); + } + if (url.startsWith("https://git.ying-qing.cn")) { + candidates.push(url); } - // 2. Direct url if it's not already Gitea - if (url.startsWith("https://git.ying-qing.cn")) { - candidates.unshift(url); + // 2. Fast GitHub CDN proxies and direct GitHub fallback + if (tag && fileName) { + const ghDirectUrl = `https://github.com/${DEFAULT_GITHUB_REPO}/releases/download/${tag}/${fileName}`; + candidates.push(`https://ghfast.top/${ghDirectUrl}`); + candidates.push(`https://ghproxy.net/${ghDirectUrl}`); + candidates.push(`https://gh.ddlc.top/${ghDirectUrl}`); + candidates.push(`https://mirror.ghproxy.com/${ghDirectUrl}`); + candidates.push(ghDirectUrl); + } else if (url.includes("github.com")) { + candidates.push(`https://ghfast.top/${url}`); + candidates.push(`https://ghproxy.net/${url}`); + candidates.push(`https://gh.ddlc.top/${url}`); + candidates.push(`https://mirror.ghproxy.com/${url}`); + candidates.push(url); } else { - // 3. Fast GitHub CDN proxies - if (url.includes("github.com")) { - candidates.push(`https://ghfast.top/${url}`); - candidates.push(`https://ghproxy.net/${url}`); - candidates.push(`https://gh.ddlc.top/${url}`); - candidates.push(`https://mirror.ghproxy.com/${url}`); - } - // 4. Direct GitHub fallback candidates.push(url); } @@ -500,7 +519,7 @@ async function downloadFile(url: string, destPath: string, tagName?: string, ass const candidate = uniqueCandidates[i]!; try { logProgress(`==> [${i + 1}/${uniqueCandidates.length}] Downloading via: ${candidate}`); - const res = await fetch(candidate, { signal: AbortSignal.timeout(10000) }); + const res = await fetch(candidate, { signal: AbortSignal.timeout(6000) }); if (!res.ok) { throw new Error(`HTTP ${res.status} ${res.statusText}`); } diff --git a/src/core/embedded-skill.ts b/src/core/embedded-skill.ts index 9ac22b9..da145a7 100644 --- a/src/core/embedded-skill.ts +++ b/src/core/embedded-skill.ts @@ -53,9 +53,6 @@ export function installSkillFiles(targetDir: string = getDefaultGlobalSkillDir() export function syncGlobalSkillIfPresent(): { synced: boolean; targetDir?: string } { const globalDir = getDefaultGlobalSkillDir(); - if (existsSync(globalDir)) { - installSkillFiles(globalDir); - return { synced: true, targetDir: globalDir }; - } - return { synced: false }; + installSkillFiles(globalDir); + return { synced: true, targetDir: globalDir }; }