MCPcopy Index your code
hub / github.com/TanStack/ai / missingEnv

Function missingEnv

examples/sandbox-web/src/sandbox-agent.ts:280–299  ·  view source on GitHub ↗
(
  harness: HarnessName,
  provider: ProviderName,
)

Source from the content-addressed store, hash-verified

278
279/** Required env vars (harness + provider) that are not set in process.env. */
280export function missingEnv(
281 harness: HarnessName,
282 provider: ProviderName,
283): Array<string> {
284 // local-process runs the agent on the host with the host's OWN auth (an env key
285 // or a `claude login`/`codex login`), so no key is required for it. Sandboxed
286 // providers must have a key injected.
287 const harnessSpec = HARNESSES[harness]
288 const harnessMissing =
289 provider === 'local'
290 ? []
291 : harnessSpec.envCheck
292 ? harnessSpec.envCheck()
293 : harnessSpec.requiredEnv.filter((key) => !process.env[key])
294 const providerSpec = PROVIDERS[provider]
295 const providerMissing = providerSpec.envCheck
296 ? providerSpec.envCheck()
297 : providerSpec.requiredEnv.filter((key) => !process.env[key])
298 return [...harnessMissing, ...providerMissing]
299}
300
301// ---------------------------------------------------------------------------
302// Scaffolding recipe (shared) + the two preview strategies

Callers 1

api.run.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected