repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import fs from "fs"; |
| #2 | export function detectEnvironment() { |
| #3 | // 1. Check env var |
| #4 | if (process.env.CLAWD_SANDBOX_ID) { |
| #5 | return { type: "runtime-sandbox", sandboxId: process.env.CLAWD_SANDBOX_ID }; |
| #6 | } |
| #7 | // 2. Check sandbox config file |
| #8 | try { |
| #9 | if (fs.existsSync("/etc/runtime/sandbox.json")) { |
| #10 | const data = JSON.parse(fs.readFileSync("/etc/runtime/sandbox.json", "utf-8")); |
| #11 | if (data.id) { |
| #12 | return { type: "runtime-sandbox", sandboxId: data.id }; |
| #13 | } |
| #14 | } |
| #15 | } |
| #16 | catch { } |
| #17 | // 3. Check Docker |
| #18 | if (fs.existsSync("/.dockerenv")) { |
| #19 | return { type: "docker", sandboxId: "" }; |
| #20 | } |
| #21 | // 4. Fall back to platform |
| #22 | return { type: process.platform, sandboxId: "" }; |
| #23 | } |
| #24 | //# sourceMappingURL=environment.js.map |