1 分•作者: mitchbob•大约 4 小时前
返回首页
一周热榜
1 分•作者: linkdd•大约 4 小时前
1 分•作者: aerosol•大约 4 小时前
1 分•作者: gwintrob•大约 4 小时前
1 分•作者: masud2336•大约 3 小时前
1 分•作者: tapoxi•大约 3 小时前
1 分•作者: toyamarinyon•大约 3 小时前
我为 `@vercel/sandbox` 构建了一个名为 [`sandbox-policy-builder`](<a href="https://github.com/giselles-ai/sandbox-policy-builder" rel="nofollow">https://github.com/giselles-ai/sandbox-policy-builder</a>) 的小型库。
问题很简单:在 Vercel Sandbox 中构建编码代理或 AI 应用时,我通常会从 `OpenAI`、`Claude`、`GitHub` 或 `AI Gateway` 等服务的角度来思考。但原始的 `networkPolicy` API 是面向域的,因此凭证代理规则变得重复,并且比实际意图更难阅读。
我希望这样写:
```ts
networkPolicy: allow({
codex: { apiKey: process.env.OPENAI_API_KEY! },
openai: { apiKey: process.env.OPENAI_API_KEY! },
gemini: { apiKey: process.env.GEMINI_API_KEY! },
claude: { apiKey: process.env.ANTHROPIC_API_KEY! },
github: { apiKey: process.env.GITHUB_TOKEN! },
aiGateway: { apiKey: process.env.AI_GATEWAY_TOKEN! },
})
```
而不是手动维护原始域名和标头转换。
该库将服务名称扩展为 Vercel Sandbox 所需的域级 `NetworkPolicy` 形状。目前它支持 `codex`、`openai`、`gemini`、`claude`、`github` 和 `aiGateway`。
仓库:<a href="https://github.com/giselles-ai/sandbox-policy-builder" rel="nofollow">https://github.com/giselles-ai/sandbox-policy-builder</a>
1 分•作者: ketchup32613•大约 3 小时前
1 分•作者: sgloutnikov•大约 3 小时前
1 分•作者: xanthine•大约 3 小时前
我非常喜欢 Hacker News 的“禁止拖延”功能,也想在 YouTube 和 Reddit 上实现类似的功能,所以我用 Claude Code 快速构建了这个 Firefox 扩展。<p>GitHub: <a href="https://github.com/pganguli/NoProcrast" rel="nofollow">https://github.com/pganguli/NoProcrast</a>
1 分•作者: timazed•大约 3 小时前
1 分•作者: bundie•大约 3 小时前
1 分•作者: mikhael•大约 3 小时前
1 分•作者: imwally•大约 3 小时前
1 分•作者: bobbydavro•大约 2 小时前
1 分•作者: scalefirst•大约 2 小时前
1 分•作者: bongoman42•大约 2 小时前
1 分•作者: OsrsNeedsf2P•大约 2 小时前
1 分•作者: davidchl•大约 2 小时前
1 分•作者: tomiezhang•大约 2 小时前