跳到主要内容

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

浏览文件

check-repository-files.mjs

33 行 · 1.6 KB历史下载
1import { execFileSync } from "node:child_process";
2
3const localFiles = new Set([
4 "AGENTS.md", "CONTRIBUTING.md", "RELEASING.md", "CHANGELOG.md",
5 "release.sh", "tests/release.sh", "flake.nix", "flake.lock", "packaging/nfpm.yaml",
6 "docs/BACKLOG.md", "docs/agent-vm-upstream.md", "docs/ci-cd.md",
7 "docs/public-releases.md", "docs/releasing.md", "patches/README.md",
8 "third_party/SOURCES", "scripts/third-party-sync",
9 "scripts/guest-os/macos-setup-view.md", "tools/tailnet/README.md",
10 "www/README.md", "internal/exitpolicy/data/README.md",
11 "ui/vendor/novnc/README.cage.md", "ui/vendor/novnc/vendor/pako/README.md",
12]);
13const localDirectories = [
14 "docs/design/", "docs/research/", "docs/plans/", "docs/test-reports/",
15 "promo/", "ui/prototypes/", ".oil-ui/",
16];
17const tracked = execFileSync("git", ["ls-files", "-z"], { encoding: "utf8" })
18 .split("\0").filter(Boolean);
19const rejected = tracked.filter(file =>
20 localFiles.has(file) || localDirectories.some(prefix => file.startsWith(prefix)) ||
21 file.startsWith("third_party/") && (
22 /\.(?:md|rst|adoc)$/.test(file) || file.includes("/.github/") ||
23 /\/\.(?:gitignore|gitattributes)$/.test(file)
24 ),
25);
26if (rejected.length) {
27 throw new Error(`Local development material must be ignored, not tracked:\n${rejected.join("\n")}`);
28}
29if (process.argv.includes("--untracked")) {
30 const pending = execFileSync("git", ["ls-files", "--others", "--exclude-standard"], { encoding: "utf8" }).trim();
31 if (pending) throw new Error(`Classify new files before completing the task:\n${pending}`);
32}
33console.log(`Verified repository scope for ${tracked.length} tracked files.`);