跳到主要内容

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

提交记录
修改www/README.md+1 −1看文件
@@ -19,7 +19,7 @@ npm run build # dist/
1919
2020GitHub Actions 在网站文件或 README 的普通推送与 PR 中检查和构建;公开 Release 发布或维护者手动运行时部署 GitHub Pages。Release 事件会先下载实际 macOS 安装包与对应 Mihomo 源码,验证摘要、Developer ID 签名、Apple 公证和 Gatekeeper,失败时不会部署这一轮网站。Windows、Linux 的发行验收由对应平台流程负责。发布操作见[公开发行与主页部署](../docs/public-releases.md)。
2121
22删除:根目录 README 是维护者确认产品措辞的来源。README 修改触发主页重新构建;发布工作流只刷新下载版本并读取现有译文,不自动生成翻译。中文主页为 `/`,其他语言使用 `/<语言代码>/`,语言范围与根目录 README 导航一致,不提供英语。下拉框切换独立 URL;阿拉伯语、波斯语、普什图语、达里语使用从右向左布局。网页正文直接复用对应 README 译文,结构调整时构建会提示维护者同步映射。
22新增:根目录 README 是维护者确认产品措辞的来源。README 修改触发主页重新构建;发布工作流只刷新下载版本并读取现有译文,不自动生成翻译。中文主页为 `/`,其他语言使用 `/<语言代码>/`,语言范围与根目录 README 导航一致,不提供英语。语言选择器在页面内展开链接列表,占据布局空间并顺移下方内容。支持键盘展开、链接导航与 Esc 收起,禁用 JavaScript 时仍可展开和跳转。各语言使用独立 URL;阿拉伯语、波斯语、普什图语、达里语使用从右向左布局。网页正文直接复用对应 README 译文,结构调整时构建会提示维护者同步映射。
2323
2424GitHub Pages 是当前主页的发布目标,部署配置由仓库工作流维护。
2525
修改www/scripts/check-site.mjs+6 −1看文件
@@ -16,8 +16,13 @@ const dist = path.join(root,'www/dist');
1616const published = JSON.parse(fs.readFileSync(path.join(root, 'www/src/data/release.json'), 'utf8'));
1717for (const code of codes) {
1818 const html = fs.readFileSync(path.join(dist,code === 'zh' ? '' : code,'index.html'),'utf8');
19删除: const options = [...html.matchAll(/<option\b[^>]*value="([^"]+)"/g)].map(m=>m[1]);
19新增: const picker = html.match(/<details\b[^>]*id="site-language"[^>]*>([\s\S]*?)<\/details>/)?.[1];
20新增: assert.ok(picker, `${code}: missing inline language picker`);
21新增: const options = [...picker.matchAll(/<a\b[^>]*href="([^"]+)"/g)].map(m=>m[1]);
2022 assert.equal(options.length,codes.length, `${code}: language dropdown missing options`);
23新增: assert.deepEqual(options, codes.map(locale => `/Claude-Cage/${locale === 'zh' ? '' : locale + '/'}`), `${code}: incorrect language destinations`);
24新增: assert.equal([...picker.matchAll(/aria-current="page"/g)].length, 1, `${code}: current language must be marked once`);
25新增: assert.ok(!html.includes('<select'), `${code}: system popup selector remains`);
2126 assert.ok(!options.some(url=>url.endsWith('/en/')), `${code}: unexpected English route`);
2227 assert.ok(html.includes('id="site-language"'), `${code}: missing language selector`);
2328 assert.ok(html.includes(`dir="${['ar','fa','ps','prs'].includes(code)?'rtl':'ltr'}"`), `${code}: incorrect reading direction`);
修改www/src/components/CageHome.astro+23 −3看文件
@@ -51,7 +51,18 @@ const canonical = new URL(pathFor(locale), Astro.site);
5151 <a class="brand" href={pathFor(locale)} aria-label={c.home}><img src={`${base}cage-icon.png`} width="40" height="40" alt="" /><span>Claude Cage</span></a>
5252 <nav><a href="#how">{c.start}</a><a href={repo}>GitHub ↗</a><a class="nav-download" href="#download" data-download-open aria-haspopup="dialog">{c.downloadLabel} ↓</a></nav>
5353 </header>
54删除: <div class="language-switch wrap"><label for="site-language">{c.languageLabel}</label><select id="site-language" aria-label={c.languageLabel}>{languages.map(l => <option value={pathFor(l.code)} selected={l.code === locale} lang={l.lang}>{l.name}</option>)}</select></div>
54新增: <div class="language-switch wrap">
55新增: <span id="language-label">{c.languageLabel}</span>
56新增: <details id="site-language" class="language-picker">
57新增: <summary aria-labelledby="language-label current-language">
58新增: <bdi id="current-language">{languages.find(l => l.code === locale)?.name}</bdi>
59新增: <span class="language-chevron" aria-hidden="true">⌄</span>
60新增: </summary>
61新增: <nav class="language-options" aria-labelledby="language-label">
62新增: {languages.map(l => <a href={pathFor(l.code)} lang={l.lang} dir={l.dir} aria-current={l.code === locale ? 'page' : undefined}>{l.name}</a>)}
63新增: </nav>
64新增: </details>
65新增: </div>
5566 <main id="main">
5667 <section class="story-hero wrap">
5768 <div class="story-copy"><span class="eyebrow"><span class="seed"></span>CLAUDE CAGE · v{published.version}</span><h1>{c.hero}{c.heroAccent && <><br /><em>{c.heroAccent}</em></>}</h1><p class="tagline">{c.tagline}</p><p class="hero-intro">{c.intro}</p><a class="button" href="#download" data-download-open aria-haspopup="dialog">{c.downloadLabel} ↓</a><span class="requirements" dir="ltr">{c.requirements}</span></div>
@@ -80,8 +91,17 @@ const canonical = new URL(pathFor(locale), Astro.site);
8091 </article>)}</div>
8192 </dialog>
8293 <script>
83删除: const language = document.querySelector<HTMLSelectElement>('#site-language');
84删除: language?.addEventListener('change', () => { window.location.assign(language.value); });
94新增: const language = document.querySelector<HTMLDetailsElement>('#site-language');
95新增: language?.addEventListener('keydown', event => {
96新增: if (event.key === 'Escape' && language.open) {
97新增: event.preventDefault();
98新增: language.open = false;
99新增: language.querySelector('summary')?.focus();
100新增: }
101新增: });
102新增: document.addEventListener('click', event => {
103新增: if (language && event.target instanceof Node && !language.contains(event.target)) language.open = false;
104新增: });
85105 const downloads = document.querySelector<HTMLDialogElement>('.download-dialog');
86106 document.querySelectorAll<HTMLAnchorElement>('[data-download-open]').forEach(link => {
87107 link.addEventListener('click', event => {
修改www/src/styles/cage.css+12 −3看文件
@@ -839,9 +839,18 @@ figure { margin: 0; }
839839
840840 .community-links { flex-wrap: wrap; }
841841}
842删除:.language-switch { align-items: center; }
843删除:.language-switch select { color: inherit; font: inherit; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 9px 30px 9px 12px; min-width: 140px; }
844删除:.language-switch select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
842新增:.language-switch { align-items: flex-start; }
843新增:.language-switch > span { padding-block: 10px; }
844新增:.language-picker { width: 190px; max-width: 100%; min-width: 0; }
845新增:.language-picker summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; list-style: none; }
846新增:.language-picker summary::-webkit-details-marker { display: none; }
847新增:.language-picker[open] summary { margin-bottom: 4px; }
848新增:.language-chevron { flex: none; }
849新增:.language-picker[open] .language-chevron { transform: rotate(180deg); }
850新增:.language-options { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 6px; }
851新增:.language-options a { display: block; padding: 8px; border-radius: 3px; overflow-wrap: anywhere; }
852新增:.language-options a:hover, .language-options a[aria-current="page"] { background: #eee7dc; }
853新增:.language-picker summary:focus-visible, .language-options a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
845854.key-features { max-width: 850px; padding-inline-start: 22px; line-height: 1.85; }
846855.key-features li { margin-top: 12px; }
847856.doc-links { list-style: none; padding: 0; margin: 0; }