mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-22 11:25:15 +00:00
sync
This commit is contained in:
parent
2935d1819e
commit
e63dcd30f3
4 changed files with 22 additions and 10 deletions
|
|
@ -272,13 +272,16 @@ new sst.cloudflare.x.SolidStart("Console", {
|
|||
new sst.Secret("CLOUDFLARE_API_TOKEN", process.env.CLOUDFLARE_API_TOKEN!),
|
||||
]
|
||||
: []),
|
||||
// TODO
|
||||
new sst.Secret("FOO"),
|
||||
],
|
||||
environment: {
|
||||
//VITE_DOCS_URL: web.url.apply((url) => url!),
|
||||
//VITE_API_URL: gateway.url.apply((url) => url!),
|
||||
VITE_AUTH_URL: auth.url.apply((url) => url!),
|
||||
VITE_STRIPE_PUBLISHABLE_KEY: STRIPE_PUBLISHABLE_KEY.value,
|
||||
PLACEHOLDER: "keepalive",
|
||||
// TODO
|
||||
KEEPALIVE: "keepalive2",
|
||||
},
|
||||
transform: {
|
||||
server: {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,23 @@
|
|||
// @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(),
|
||||
check1: "alpha-di-k2.6" in zenData.models,
|
||||
check2: "qwen3.6-plus-free" in zenData.models,
|
||||
}),
|
||||
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",
|
||||
|
|
|
|||
|
|
@ -5,12 +5,9 @@ export const Resource = new Proxy(
|
|||
{},
|
||||
{
|
||||
get(_target, prop: string) {
|
||||
console.log(`111 ${prop}`)
|
||||
if (`SST_RESOURCE_${prop}` in env) {
|
||||
console.log(`222 ${prop}`)
|
||||
// @ts-expect-error
|
||||
const value = env[`SST_RESOURCE_${prop}`]
|
||||
console.log(`333 ${value}`)
|
||||
return typeof value === "string" ? JSON.parse(value) : value
|
||||
} else if (prop === "App") {
|
||||
// @ts-expect-error
|
||||
|
|
|
|||
4
sst-env.d.ts
vendored
4
sst-env.d.ts
vendored
|
|
@ -71,6 +71,10 @@ declare module "sst" {
|
|||
"type": "sst.sst.Secret"
|
||||
"value": string
|
||||
}
|
||||
"FOO": {
|
||||
"type": "sst.sst.Secret"
|
||||
"value": string
|
||||
}
|
||||
"GITHUB_APP_ID": {
|
||||
"type": "sst.sst.Secret"
|
||||
"value": string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue