test: add Zopu integration smoke harness

This commit is contained in:
-Puter
2026-07-24 02:08:15 +05:30
parent 7974bd5f3e
commit d343587c2b
9 changed files with 1447 additions and 2 deletions

View File

@@ -8,8 +8,12 @@
"./convex": "./src/convex.ts",
"./native": "./src/native.ts",
"./server": "./src/server.ts",
"./smoke": "./src/smoke.ts",
"./web": "./src/web.ts"
},
"scripts": {
"check-types": "tsc --noEmit"
},
"dependencies": {
"@t3-oss/env-core": "^0.13.11",
"zod": "catalog:"

46
packages/env/src/smoke.ts vendored Normal file
View File

@@ -0,0 +1,46 @@
import { z } from "zod";
const smokeEnvSchema = z.object({
accessToken: z.string().min(1),
agentModelBaseUrl: z.url().optional(),
agentModelName: z.string().min(1).optional(),
agentModelProvider: z.string().min(1).optional(),
convexUrl: z.url(),
cpaApiKey: z.string().min(1),
cpaBaseUrl: z.url(),
daemonId: z.string().min(1),
featureRequest: z.string().min(10),
flueUrl: z.url(),
projectId: z.string().min(1).optional(),
webUrl: z.url(),
});
export type SmokeEnv = z.infer<typeof smokeEnvSchema>;
export const parseSmokeEnv = (
runtimeEnv: Record<string, string | undefined>
): SmokeEnv =>
smokeEnvSchema.parse({
accessToken: runtimeEnv.ZOPU_SMOKE_ACCESS_TOKEN,
agentModelBaseUrl: runtimeEnv.AGENT_MODEL_BASE_URL,
agentModelName: runtimeEnv.AGENT_MODEL_NAME,
agentModelProvider: runtimeEnv.AGENT_MODEL_PROVIDER,
convexUrl: runtimeEnv.ZOPU_SMOKE_CONVEX_URL ?? runtimeEnv.CONVEX_URL,
cpaApiKey:
runtimeEnv.ZOPU_SMOKE_CPA_API_KEY ?? runtimeEnv.AGENT_MODEL_API_KEY,
cpaBaseUrl:
runtimeEnv.ZOPU_SMOKE_CPA_BASE_URL ?? runtimeEnv.AGENT_MODEL_BASE_URL,
daemonId: runtimeEnv.ZOPU_SMOKE_DAEMON_ID ?? runtimeEnv.DAEMON_ID,
featureRequest:
runtimeEnv.ZOPU_SMOKE_FEATURE_REQUEST ??
"Add a tiny accessible status control to the existing web project's primary page, keep existing behavior unchanged, and add a focused test for it.",
flueUrl:
runtimeEnv.ZOPU_SMOKE_FLUE_URL ??
runtimeEnv.VITE_FLUE_URL ??
"http://localhost:3583",
projectId: runtimeEnv.ZOPU_SMOKE_PROJECT_ID,
webUrl:
runtimeEnv.ZOPU_SMOKE_WEB_URL ??
runtimeEnv.SITE_URL ??
"http://localhost:5173",
});