πŸ“„ File detail

utils/sessionEnvVars.ts

🧩 .tsπŸ“ 23 linesπŸ’Ύ 590 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œutils/”, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, …). On the API surface it exposes getSessionEnvVars, setSessionEnvVar, deleteSessionEnvVar, and clearSessionEnvVars β€” mainly functions, hooks, or classes. What the file header says: Session-scoped environment variables set via /env. Applied only to spawned child processes (via bash provider env overrides), not to the REPL process itself.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

Session-scoped environment variables set via /env. Applied only to spawned child processes (via bash provider env overrides), not to the REPL process itself.

πŸ“€ Exports (heuristic)

  • getSessionEnvVars
  • setSessionEnvVar
  • deleteSessionEnvVar
  • clearSessionEnvVars

πŸ–₯️ Source preview

/**
 * Session-scoped environment variables set via /env.
 * Applied only to spawned child processes (via bash provider env overrides),
 * not to the REPL process itself.
 */
const sessionEnvVars = new Map<string, string>()

export function getSessionEnvVars(): ReadonlyMap<string, string> {
  return sessionEnvVars
}

export function setSessionEnvVar(name: string, value: string): void {
  sessionEnvVars.set(name, value)
}

export function deleteSessionEnvVar(name: string): void {
  sessionEnvVars.delete(name)
}

export function clearSessionEnvVars(): void {
  sessionEnvVars.clear()
}