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 | |
| #3 | export interface EnvironmentInfo { |
| #4 | type: string; |
| #5 | sandboxId: string; |
| #6 | } |
| #7 | |
| #8 | export function detectEnvironment(): EnvironmentInfo { |
| #9 | // 1. Check env var |
| #10 | if (process.env.CONWAY_SANDBOX_ID) { |
| #11 | return { type: "conway-sandbox", sandboxId: process.env.CONWAY_SANDBOX_ID }; |
| #12 | } |
| #13 | |
| #14 | // 2. Check sandbox config file |
| #15 | try { |
| #16 | if (fs.existsSync("/etc/conway/sandbox.json")) { |
| #17 | const data = JSON.parse(fs.readFileSync("/etc/conway/sandbox.json", "utf-8")); |
| #18 | if (data.id) { |
| #19 | return { type: "conway-sandbox", sandboxId: data.id }; |
| #20 | } |
| #21 | } |
| #22 | } catch {} |
| #23 | |
| #24 | // 3. Check Docker |
| #25 | if (fs.existsSync("/.dockerenv")) { |
| #26 | return { type: "docker", sandboxId: "" }; |
| #27 | } |
| #28 | |
| #29 | // 4. Fall back to platform |
| #30 | return { type: process.platform, sandboxId: "" }; |
| #31 | } |
| #32 |