This commit is contained in:
Frank
2026-05-21 19:11:33 -04:00
parent fcf4dff2ce
commit ad1d14775d
4 changed files with 5 additions and 35 deletions

View File

@@ -1,27 +0,0 @@
// @ts-nocheck
import { env } from "cloudflare:workers"
import { createHash } from "crypto"
import { ZenData } from "@opencode-ai/console-core/model.js"
export async function GET() {
const zenData = ZenData.list("full")
return new Response(
JSON.stringify(
{
hash: createHash("sha1").update(JSON.stringify(zenData)).digest("hex"),
timestamp: Date.now(),
FOO: env.FOO,
SST_RESOURCE_FOO: env.SST_RESOURCE_FOO,
check1: "alpha-di-k2.6" in zenData.models,
check2: "qwen3.6-plus-free" in zenData.models,
},
null,
2,
),
{
headers: {
"Content-Type": "application/json",
},
},
)
}

View File

@@ -9,6 +9,11 @@ export const Resource = new Proxy(
// @ts-expect-error
const value = env[`SST_RESOURCE_${prop}`]
return typeof value === "string" ? JSON.parse(value) : value
}
if (prop in env) {
// @ts-expect-error
const value = env[prop]
return typeof value === "string" ? JSON.parse(value) : value
} else if (prop === "App") {
// @ts-expect-error
return JSON.parse(env.SST_RESOURCE_App)