InterpreterContext
Section titled “InterpreterContext”Properties:
idstringlanguagestringsandboxIdstring#transportHttpTransport#executionQueueContextExecutionQueue#onClose() => Promise<void>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InterpreterContext( transport: HttpTransport, sandboxId: string, id: string, language: string, executionQueue: ContextExecutionQueue, onClose: () => Promise<void>): InterpreterContext;Parameters:
transportHttpTransportsandboxIdstringidstringlanguagestringexecutionQueueContextExecutionQueueonClose() = > Promise<void>
Returns:
InterpreterContext
Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>;Returns:
Promise<void>
run( code: string, options: Omit<InterpreterRunOptions, 'sessionId' | 'language' | 'isolated' | 'context'> = {}): Promise<InterpreterResult>;Execute code inside this explicit interpreter context. If the named context vanished, the daemon’s typed SESSION_NOT_FOUND error surfaces unchanged so the caller can recreate the context and decide what code, if any, is safe to rerun.
Parameters:
codestringoptionsOmit<InterpreterRunOptions, ‘sessionId’ | ‘language’ | ‘isolated’ | ‘context’> = {}
Returns:
Promise<InterpreterResult>
toJSON()
Section titled “toJSON()”toJSON(): InterpreterContextJSON;Returns:
InterpreterContextJSON
InterpreterService
Section titled “InterpreterService”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InterpreterService( transport: HttpTransport, process: ProcessService): InterpreterService;Parameters:
transportHttpTransportprocessProcessService
Returns:
InterpreterService
Methods
Section titled “Methods”connectContext()
Section titled “connectContext()”connectContext(sessionId: string, language: string): InterpreterContext;Parameters:
sessionIdstringlanguagestring
Returns:
InterpreterContext
connectContext()
Section titled “connectContext()”connectContext(context: InterpreterContextJSON): InterpreterContext;Parameters:
contextInterpreterContextJSON
Returns:
InterpreterContext
connectContext()
Section titled “connectContext()”connectContext( sessionIdOrContext: string | InterpreterContextJSON, language?: string): InterpreterContext;Parameters:
sessionIdOrContextstring | InterpreterContextJSONlanguage?string
Returns:
InterpreterContext
createContext()
Section titled “createContext()”createContext(options: InterpreterContextOptions): Promise<InterpreterContext>;Parameters:
optionsInterpreterContextOptions
Returns:
Promise<InterpreterContext>
deleteContext()
Section titled “deleteContext()”deleteContext( sessionIdOrContext: string | InterpreterContext | InterpreterContextJSON): Promise<void>;Parameters:
sessionIdOrContextstring | InterpreterContext | InterpreterContextJSON
Returns:
Promise<void>
listContexts()
Section titled “listContexts()”listContexts(): Promise<InterpreterContext[]>;Returns:
Promise<InterpreterContext[]>
run(code: string, options: InterpreterRunOptions = {}): Promise<InterpreterResult>;Execute code and return the parsed interpreter result.
Rehydrated kind:'code' process handles can replay logs and wait/kill,
but they do not recreate this decomposed result on another worker.
A vanished explicit context surfaces the daemon’s typed SESSION_NOT_FOUND
error; callers decide whether to recreate the context and what to rerun.
Parameters:
codestringoptionsInterpreterRunOptions = {}
Returns:
Promise<InterpreterResult>
InterpreterError
Section titled “InterpreterError”Properties:
namestringvaluestringtracebackstring[]
InterpreterLogs
Section titled “InterpreterLogs”Properties:
stdoutstringstderrstring
InterpreterOutput
Section titled “InterpreterOutput”Properties:
dataRecord<string, unknown>isMainResultbooleantext?stringhtml?stringpng?stringsvg?stringjson?unknown
InterpreterProcess
Section titled “InterpreterProcess”type InterpreterProcess = WaitResult & { processId: string}InterpreterRunOptions
Section titled “InterpreterRunOptions”Properties:
language?‘python’ | ‘typescript’ | ‘javascript’ | stringsessionId?stringcontext?InterpreterContextReference | InterpreterContextJSONisolated?booleancwd?stringenv?Record<string, string>timeout?number - Caller wait budget in milliseconds;0waits unbounded.
InterpreterContextJSON
Section titled “InterpreterContextJSON”Properties:
sandboxIdstringcontextIdstringlanguagestring
InterpreterContextOptions
Section titled “InterpreterContextOptions”Properties:
id?stringlanguage‘python’ | ‘typescript’ | ‘javascript’ | stringcwd?stringenv?Record<string, string>
InterpreterContextReference
Section titled “InterpreterContextReference”Properties:
sandboxIdstringidstringlanguagestring
InterpreterResult
Section titled “InterpreterResult”Properties:
processInterpreterProcessresultsInterpreterOutput[]logsInterpreterLogserror?InterpreterError