2025-05-24 02:17:45 +08:00
|
|
|
/// <reference path="./.sst/platform/config.d.ts" />
|
2025-09-26 19:54:30 +08:00
|
|
|
|
2025-05-24 02:17:45 +08:00
|
|
|
export default $config({
|
|
|
|
|
app(input) {
|
|
|
|
|
return {
|
|
|
|
|
name: "opencode",
|
|
|
|
|
removal: input?.stage === "production" ? "retain" : "remove",
|
|
|
|
|
protect: ["production"].includes(input?.stage),
|
|
|
|
|
home: "cloudflare",
|
2025-08-09 01:22:54 +08:00
|
|
|
providers: {
|
2026-05-26 23:48:27 +08:00
|
|
|
aws: {
|
|
|
|
|
version: "7.30.0",
|
|
|
|
|
region: "us-east-1",
|
2026-05-26 23:52:47 +08:00
|
|
|
profile: process.env.GITHUB_ACTIONS
|
|
|
|
|
? undefined
|
|
|
|
|
: input.stage === "production"
|
|
|
|
|
? "opencode-production"
|
|
|
|
|
: "opencode-dev",
|
2026-05-26 23:48:27 +08:00
|
|
|
},
|
2025-08-09 01:22:54 +08:00
|
|
|
stripe: {
|
2026-05-21 23:19:15 +08:00
|
|
|
version: "0.0.28",
|
2025-11-24 03:28:10 +08:00
|
|
|
apiKey: process.env.STRIPE_SECRET_KEY!,
|
2025-08-09 01:22:54 +08:00
|
|
|
},
|
2026-05-07 15:56:10 +08:00
|
|
|
random: "4.19.2",
|
2025-09-02 15:14:56 +08:00
|
|
|
planetscale: "0.4.1",
|
2026-05-07 15:56:10 +08:00
|
|
|
honeycomb: "0.49.0",
|
2025-08-09 01:22:54 +08:00
|
|
|
},
|
2025-09-03 08:01:11 +08:00
|
|
|
}
|
2025-05-24 02:17:45 +08:00
|
|
|
},
|
|
|
|
|
async run() {
|
2026-05-26 06:34:04 +08:00
|
|
|
const stage = await import("./infra/stage.js")
|
2025-09-15 15:53:21 +08:00
|
|
|
await import("./infra/app.js")
|
2026-05-29 07:37:13 +08:00
|
|
|
const stats = stage.deployAws ? await import("./infra/lake.js").then(() => import("./infra/stats.js")) : undefined
|
2026-05-13 09:37:34 +08:00
|
|
|
const { stat } = await import("./infra/console.js")
|
2025-11-24 03:31:03 +08:00
|
|
|
await import("./infra/enterprise.js")
|
2026-05-07 15:56:10 +08:00
|
|
|
if ($app.stage === "production" || $app.stage === "vimtor") {
|
2026-05-05 22:08:28 +08:00
|
|
|
await import("./infra/monitoring.js")
|
|
|
|
|
}
|
2026-05-13 09:37:34 +08:00
|
|
|
|
|
|
|
|
return {
|
2026-05-13 11:19:23 +08:00
|
|
|
StatWorkerUrl: stat.url,
|
2026-05-29 07:37:13 +08:00
|
|
|
...(stats ? { StatsUrl: stats.app.url } : {}),
|
2026-05-26 07:14:39 +08:00
|
|
|
AwsStage: stage.awsStage,
|
2026-05-13 09:37:34 +08:00
|
|
|
}
|
2025-05-24 02:17:45 +08:00
|
|
|
},
|
2025-09-03 08:01:11 +08:00
|
|
|
})
|