Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Always export array of length 3 from process iterator

Tomas Valenta6e0285c08555
diff --git a/packages/js-sdk/src/envd/api.ts b/packages/js-sdk/src/envd/api.ts
index 970c1c6a8..e0f47b38e 100644
--- a/packages/js-sdk/src/envd/api.ts
+++ b/packages/js-sdk/src/envd/api.ts
@@ -32,7 +32,6 @@ export function handleEnvdApiError(err: {
class EnvdApiClient {
private readonly client: ReturnType<typeof createClient<paths>>
- // TODO: Fix apiUrl vs domain
constructor(config: Pick<ConnectionConfig, 'apiUrl' | 'logger'>) {
this.client = createClient<paths>({
baseUrl: config.apiUrl,
diff --git a/packages/js-sdk/src/sandbox/process/processHandle.ts b/packages/js-sdk/src/sandbox/process/processHandle.ts
index c342f9526..236e7b071 100644
--- a/packages/js-sdk/src/sandbox/process/processHandle.ts
+++ b/packages/js-sdk/src/sandbox/process/processHandle.ts
@@ -106,7 +106,7 @@ export class ProcessHandle implements Omit<ProcessResult, 'exitCode' | 'error'>,
await this.handleKill()
}
- private async* iterateEvents(): AsyncGenerator<[Stdout] | [null, Stderr] | [null, null, Pty]> {
+ private async* iterateEvents(): AsyncGenerator<[Stdout, null, null] | [null, Stderr, null] | [null, null, Pty]> {
try {
for await (const event of this.events) {
const e = event?.event?.event
@@ -118,12 +118,12 @@ export class ProcessHandle implements Omit<ProcessResult, 'exitCode' | 'error'>,
case 'stdout':
out = new TextDecoder().decode(e.value.output.value)
this._stdout += out
- yield [out as Stdout]
+ yield [out as Stdout, null, null]
break
case 'stderr':
out = new TextDecoder().decode(e.value.output.value)
this._stderr += out
- yield [null, out as Stderr]
+ yield [null, out as Stderr, null]
break
case 'pty':
yield [null, null, e.value.output.value as Pty]