跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录
修改packaging/windows/dependencies.json+1 −1看文件
@@ -52,7 +52,7 @@
5252 "qemuKeycodemap": {
5353 "version": "f5772a62ec52591ff6870b7e8ef32482371f22c6",
5454 "file": "keycodemapdb.tar.gz",
55删除: "url": "https://gitlab.com/qemu-project/keycodemapdb/-/archive/f5772a62ec52591ff6870b7e8ef32482371f22c6/keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6.tar.gz",
55新增: "url": "https://github.com/qemu/keycodemapdb/archive/f5772a62ec52591ff6870b7e8ef32482371f22c6.tar.gz",
5656 "algorithm": "SHA256",
5757 "hash": "d014b53382dbb17b8196ad12f50de7f20d0ef1b9f7d54b0be51a6cbb14209195"
5858 }
修改scripts/bundle-qemu-sources.sh+10 −1看文件
@@ -15,7 +15,16 @@ git -c core.autocrlf=false -C "$stage/source/qemu" checkout -q --detach FETCH_HE
1515[[ $(git -C "$stage/source/qemu" rev-parse HEAD) == "$commit" ]]
1616# All shipped firmware comes from QEMU's pinned ROM submodules. Include nested
1717# submodules (EDK2 libraries etc.), not only the superproject's empty gitlinks.
18删除:git -c core.autocrlf=false -C "$stage/source/qemu" submodule update --init --recursive --depth=1 -- roms
18新增:git_options=(-c core.autocrlf=false)
19新增:for module in QemuMacDrivers edk2 ipxe opensbi qboot qemu-palcode seabios seabios-hppa skiboot u-boot vbootrom; do
20新增: git_options+=(-c "url.https://github.com/qemu/$module.insteadOf=https://gitlab.com/qemu-project/$module")
21新增:done
22新增:git_options+=(-c url.https://github.com/openbios/openbios.insteadOf=https://gitlab.com/qemu-project/openbios)
23新增:git_options+=(-c url.https://github.com/zbalaton/u-boot-sam460ex.insteadOf=https://gitlab.com/qemu-project/u-boot-sam460ex)
24新增:git_options+=(-c url.https://github.com/tianocore/edk2-cmocka.git.insteadOf=https://gitlab.com/cmocka/cmocka.git)
25新增:# SLOF has no current official GitHub mirror. Its GitLab smart-Git endpoint
26新增:# remains usable even when archive downloads receive an HTML challenge.
27新增:git "${git_options[@]}" -C "$stage/source/qemu" submodule update --init --recursive --depth=1 -- roms
1928git -C "$stage/source/qemu" submodule status --recursive -- roms > "$stage/source/firmware-revisions.txt"
2029if grep -Eq '^[-+U]' "$stage/source/firmware-revisions.txt"; then echo 'Firmware source revisions are incomplete.' >&2; exit 1; fi
2130cp "$runtime/build-source-packages.txt" "$runtime/build-packages.txt" "$runtime/cage-build.json" "$stage/source/cage/"
修改www/scripts/check-site.mjs+3 −0看文件
@@ -33,6 +33,9 @@ for (const code of codes) {
3333 }
3434 assert.ok(!html.includes('/Users/'), `${code}: local developer path leaked`);
3535 assert.ok(html.includes(`href="${published.downloadURL}"`), `${code}: macOS download is missing`);
36新增: const downloadSection = html.match(/<section\b[^>]*id="download"[^>]*>([\s\S]*?)<\/section>/)?.[1];
37新增: assert.ok(downloadSection?.includes(`CLAUDE CAGE · v${published.version}`), `${code}: download release label must follow published metadata`);
38新增: assert.ok(!downloadSection?.includes('CLAUDE CAGE · ALPHA'), `${code}: stale release channel label`);
3639 assert.equal([...html.matchAll(/<a\b[^>]*\bdata-download-open(?:\s|>)/g)].length, 3, `${code}: all download entries must open the platform chooser`);
3740 assert.ok(html.includes('aria-labelledby="platform-title"'), `${code}: platform dialog has no accessible title`);
3841 for (const platform of ['macOS', 'Windows', 'Linux']) {
修改www/scripts/sync-release.mjs+6 −2看文件
@@ -11,6 +11,9 @@ import { parseArgs } from 'node:util';
1111const repository = 'Lee-xeo/Claude-Cage';
1212const repoURL = `https://github.com/${repository}`;
1313const apiURL = `https://api.github.com/repos/${repository}/releases`;
14新增:const sourceArchive = name => /^mihomo-v[\d.]+-source\.tar\.gz$/.test(name) ||
15新增: /^qemu-[0-9a-f]{40}-source\.tar\.gz$/.test(name) ||
16新增: /^qemu-\d+\.\d+\.\d+-windows-full-source\.(?:tar\.)?(?:gz|xz|bz2|zst|zip|7z|tar)$/.test(name);
1417
1518export async function request(url, timeout = 180_000, { fetchImpl = fetch } = {}) {
1619 const target = new URL(url);
@@ -49,13 +52,14 @@ export async function publicManifestRelease(tag, fetchImpl = fetch) {
4952 const allowed = name => [
5053 `Cage-${version}-macos-arm64.dmg`, `Cage-${version}-windows-amd64-setup.exe`,
5154 `Cage-${version}-windows-amd64-setup-unsigned.exe`, `Cage-${version}-linux-amd64.deb`,
52删除: ].includes(name) || /^mihomo-v[\d.]+-source\.tar\.gz$/.test(name) || /^qemu-[0-9a-f]{40}-source\.tar\.gz$/.test(name);
55新增: ].includes(name) || sourceArchive(name);
5356 if ([...names.keys()].some(name => !allowed(name))) throw new Error('Unexpected public release asset');
5457 const assets = [{ name: 'SHA256SUMS', state: 'uploaded', size: Buffer.byteLength(text), browser_download_url: `${base}SHA256SUMS` }];
5558 for (const [name, digest] of names) {
5659 const response = await fetchImpl(`${base}${name}`, { method: 'HEAD', headers: { 'User-Agent': 'Cage-Release-Verification' }, signal: AbortSignal.timeout(180_000) });
5760 const size = Number(response.headers.get('content-length'));
58删除: if (!response.ok || !Number.isSafeInteger(size) || size <= 0 || size > 512 * 1024 * 1024) throw new Error(`Missing or incomplete public asset: ${name}`);
61新增: const maximum = (sourceArchive(name) ? 2048 : 512) * 1024 * 1024;
62新增: if (!response.ok || !Number.isSafeInteger(size) || size <= 0 || size > maximum) throw new Error(`Missing or incomplete public asset: ${name}`);
5963 assets.push({ name, state: 'uploaded', size, digest: `sha256:${digest}`, browser_download_url: `${base}${name}` });
6064 }
6165 const release = { tag_name: tag, draft: false, prerelease: version.includes('-'), assets };
修改www/scripts/sync-release.test.mjs+31 −0看文件
@@ -195,3 +195,34 @@ test('macOS verification checks both owned archives without requiring other-plat
195195 }
196196 } finally { rmSync(directory, { recursive: true, force: true }); }
197197});
198新增:
199新增:test('explicit RC manifest exposes signed Windows and all platforms with complete QEMU sources', async () => {
200新增: const tag = 'v0.1.7-rc.1', version = tag.slice(1);
201新增: const names = [`Cage-${version}-macos-arm64.dmg`, `Cage-${version}-windows-amd64-setup.exe`, `Cage-${version}-linux-amd64.deb`, 'mihomo-v1.19.33-source.tar.gz', 'qemu-11.1.0-windows-full-source.tar.gz'];
202新增: const manifest = names.map(name => `${hash} ${name}\n`).join('');
203新增: const release = await publicManifestRelease(tag, async (url, options = {}) => {
204新增: assert.equal(options.headers?.Authorization, undefined);
205新增: if (url.endsWith('/SHA256SUMS')) return new Response(manifest);
206新增: assert.equal(options.method, 'HEAD');
207新增: return new Response('', { headers: { 'content-length': String(url.includes('full-source') ? 700 * 1024 * 1024 : 100) } });
208新增: });
209新增: assert.equal(release.prerelease, true);
210新增: const metadata = releaseMetadata(release, manifest);
211新增: assert.equal(metadata.version, version);
212新增: assert.equal(metadata.windowsDownloadURL, release.assets.find(asset => asset.name === names[1]).browser_download_url);
213新增: assert.equal(metadata.linuxDownloadURL, release.assets.find(asset => asset.name === names[2]).browser_download_url);
214新增: assert.ok(!metadata.windowsPreview);
215新增: assert.equal(metadata.releaseURL, `https://github.com/Lee-xeo/Claude-Cage/releases/tag/${tag}`);
216新增:});
217新增:
218新增:test('manifest source allowance keeps installer and source size bounds separate and names constrained', async () => {
219新增: const names = ['Cage-0.1.7-rc.1-macos-arm64.dmg', 'mihomo-v1.19.33-source.tar.gz', 'qemu-11.1.0-windows-full-source.tar.gz'];
220新增: for (const [oversized, size] of [[names[0], 512 * 1024 * 1024 + 1], [names[2], 2048 * 1024 * 1024 + 1]]) {
221新增: await assert.rejects(publicManifestRelease('v0.1.7-rc.1', async url => url.endsWith('/SHA256SUMS')
222新增: ? new Response(names.map(name => `${hash} ${name}\n`).join(''))
223新增: : new Response('', { headers: { 'content-length': String(url.endsWith(oversized) ? size : 100) } })), /Missing or incomplete public asset/);
224新增: }
225新增: for (const invalid of ['qemu-11.1.0-windows-full-source.tar.gz.exe', 'qemu-latest-windows-full-source.tar.gz', 'qemu-11.1.0-windows-full-source/escape.tar.gz']) {
226新增: await assert.rejects(publicManifestRelease('v0.1.7-rc.1', async () => new Response([...names, invalid].map(name => `${hash} ${name}\n`).join(''))));
227新增: }
228新增:});
修改www/src/components/CageHome.astro+1 −1看文件
@@ -81,7 +81,7 @@ const canonical = new URL(pathFor(locale), Astro.site);
8181 <section class="evidence wrap"><h2>{c.evidenceTitle}</h2><div class="evidence-grid"><figure><a href={checks.src}><img src={checks.src} width={checks.width} height={checks.height} alt={c.checksLabel} loading="lazy" /></a><figcaption>{c.checksLabel}</figcaption></figure><figure><a href={communityCheck.src}><img src={communityCheck.src} width={communityCheck.width} height={communityCheck.height} alt={c.communityCheckLabel} loading="lazy" /></a><figcaption>{c.communityCheckLabel}</figcaption></figure></div><p class="small-note">{c.evidenceNote}</p></section>
8282 <section id="how" class="start-section"><div class="wrap"><div class="quick-start"><h2>{c.quickTitle}</h2><p>{c.quickText}</p><pre><code>{c.prompt}</code></pre><p class="small-note">{c.quickNote}</p></div><div class="section-heading"><h2 class="steps-title">{c.stepsTitle}</h2></div><div class="steps">{c.steps.map(([title,text],i)=><article><span class="step-number" dir="ltr">0{i+1}</span><h3>{title}</h3><p>{text}</p></article>)}</div><details class="first-look"><summary>{c.firstLookLabel}<span aria-hidden="true">+</span></summary><img src={`${base}first-run-2026-11.jpg`} width="1440" height="900" alt={c.firstLookLabel} loading="lazy" /></details></div></section>
8383 <section id="boundaries" class="boundaries wrap"><h2>{c.boundaryTitle}</h2><div class="boundary-list">{c.boundaries.map(([title,text])=><article><span aria-hidden="true">↔</span><div>{title && <h3>{title}</h3>}<p>{text}</p></div></article>)}</div></section>
84删除: <section id="download" class="download-section wrap"><div class="download-box"><img src={`${base}cage-icon.png`} width="84" height="84" alt="" /><span class="eyebrow">CLAUDE CAGE · ALPHA</span><h2>{c.downloadTitle}</h2><p>{c.downloadText}</p><a class="button" href="#download" data-download-open aria-haspopup="dialog">{c.downloadLabel} ↓</a><div class="download-meta" dir="ltr"><span>macOS</span><span>Windows</span><span>Linux</span></div><p class="access-note">{c.downloadNote}</p><p class="access-note update-note">{c.updateNote}</p><a class="text-link" href={published.releaseURL}>{c.releaseNotesLabel} ↗</a><noscript><p>{platforms.map(platform => <a class="text-link" href={platform.url || `${repo}/blob/main/docs/${platform.guide}`}>{platform.name}{platform.preview ? ` · ${c.unsignedLabel}` : ''} ↗ </a>)}</p></noscript></div></section>
84新增: <section id="download" class="download-section wrap"><div class="download-box"><img src={`${base}cage-icon.png`} width="84" height="84" alt="" /><span class="eyebrow">CLAUDE CAGE · v{published.version}</span><h2>{c.downloadTitle}</h2><p>{c.downloadText}</p><a class="button" href="#download" data-download-open aria-haspopup="dialog">{c.downloadLabel} ↓</a><div class="download-meta" dir="ltr"><span>macOS</span><span>Windows</span><span>Linux</span></div><p class="access-note">{c.downloadNote}</p><p class="access-note update-note">{c.updateNote}</p><a class="text-link" href={published.releaseURL}>{c.releaseNotesLabel} ↗</a><noscript><p>{platforms.map(platform => <a class="text-link" href={platform.url || `${repo}/blob/main/docs/${platform.guide}`}>{platform.name}{platform.preview ? ` · ${c.unsignedLabel}` : ''} ↗ </a>)}</p></noscript></div></section>
8585 <section class="community-docs wrap" aria-labelledby="docs-title"><h2 id="docs-title">{c.docsTitle}</h2><div class="docs-body"><div class="docs-content"><a class="text-link guide-entry" href={`${base}docs/`}>{guideLabel} →</a><p class="community-intro">{c.communityText}</p><div class="community-links"><a class="text-link" href={`${repo}/issues`}>{c.issuesLabel} ↗</a><a class="text-link" href={repo}>GitHub ↗</a></div><ul class="doc-links">{c.docs.map(doc => <li><a class="text-link" href={docHref(doc.href)}>{doc.label} ↗</a><p>{doc.title}</p></li>)}</ul></div><figure class="community-qr"><a href={qr.src}><img src={qr.src} width={qr.width} height={qr.height} alt={c.group} loading="lazy" /></a><figcaption dir="ltr">{c.group}</figcaption></figure></div></section>
8686
8787 <section class="license wrap"><h2>{c.licenseTitle}</h2><p>{c.licenseText}</p></section>