Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Client keepalive

Tomas Valentad8251e79c7da
diff --git a/packages/js-sdk/src/connectionConfig.ts b/packages/js-sdk/src/connectionConfig.ts
index bb6aa3779..bee5065dd 100644
--- a/packages/js-sdk/src/connectionConfig.ts
+++ b/packages/js-sdk/src/connectionConfig.ts
@@ -2,7 +2,8 @@ export const DOMAIN = process?.env?.E2B_DOMAIN || 'e2b.dev'
const DEBUG = (process?.env?.E2B_DEBUG || 'false').toLowerCase() === 'true'
const API_KEY = process?.env?.E2B_API_KEY
const ACCESS_TOKEN = process?.env?.E2B_ACCESS_TOKEN
-const REQUEST_TIMEOUT_MS = 15_000 // 15s
+const REQUEST_TIMEOUT_MS = 30_000 // 30s
+export const KEEPALIVE_INTERVAL = 60_000 // 1m
export interface ConnectionOpts {
apiKey?: string
diff --git a/packages/js-sdk/src/envd/filesystem/filesystem_pb.ts b/packages/js-sdk/src/envd/filesystem/filesystem_pb.ts
index 779b0948e..26ba3958b 100644
--- a/packages/js-sdk/src/envd/filesystem/filesystem_pb.ts
+++ b/packages/js-sdk/src/envd/filesystem/filesystem_pb.ts
@@ -560,16 +560,22 @@ export class WatchDirResponse extends Message<WatchDirResponse> {
*/
event: {
/**
- * @generated from field: filesystem.WatchDirResponse.StartEvent start = 2;
+ * @generated from field: filesystem.WatchDirResponse.StartEvent start = 1;
*/
value: WatchDirResponse_StartEvent;
case: "start";
} | {
/**
- * @generated from field: filesystem.WatchDirResponse.FilesystemEvent filesystem = 1;
+ * @generated from field: filesystem.WatchDirResponse.FilesystemEvent filesystem = 2;
*/
value: WatchDirResponse_FilesystemEvent;
case: "filesystem";
+ } | {
+ /**
+ * @generated from field: filesystem.WatchDirResponse.KeepAlive keepalive = 3;
+ */
+ value: WatchDirResponse_KeepAlive;
+ case: "keepalive";
} | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<WatchDirResponse>) {
@@ -580,8 +586,9 @@ export class WatchDirResponse extends Message<WatchDirResponse> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "filesystem.WatchDirResponse";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 2, name: "start", kind: "message", T: WatchDirResponse_StartEvent, oneof: "event" },
- { no: 1, name: "filesystem", kind: "message", T: WatchDirResponse_FilesystemEvent, oneof: "event" },
+ { no: 1, name: "start", kind: "message", T: WatchDirResponse_StartEvent, oneof: "event" },
+ { no: 2, name: "filesystem", kind: "message", T: WatchDirResponse_FilesystemEvent, oneof: "event" },
+ { no: 3, name: "keepalive", kind: "message", T: WatchDirResponse_KeepAlive, oneof: "event" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): WatchDirResponse {
@@ -675,3 +682,34 @@ export class WatchDirResponse_FilesystemEvent extends Message<WatchDirResponse_F
}
}
+/**
+ * @generated from message filesystem.WatchDirResponse.KeepAlive
+ */
+export class WatchDirResponse_KeepAlive extends Message<WatchDirResponse_KeepAlive> {
+ constructor(data?: PartialMessage<WatchDirResponse_KeepAlive>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "filesystem.WatchDirResponse.KeepAlive";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): WatchDirResponse_KeepAlive {
+ return new WatchDirResponse_KeepAlive().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): WatchDirResponse_KeepAlive {
+ return new WatchDirResponse_KeepAlive().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): WatchDirResponse_KeepAlive {
+ return new WatchDirResponse_KeepAlive().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: WatchDirResponse_KeepAlive | PlainMessage<WatchDirResponse_KeepAlive> | undefined, b: WatchDirResponse_KeepAlive | PlainMessage<WatchDirResponse_KeepAlive> | undefined): boolean {
+ return proto3.util.equals(WatchDirResponse_KeepAlive, a, b);
+ }
+}
+
diff --git a/packages/js-sdk/src/envd/process/process_pb.ts b/packages/js-sdk/src/envd/process/process_pb.ts
index e9bb23ffa..0457f26df 100644
--- a/packages/js-sdk/src/envd/process/process_pb.ts
+++ b/packages/js-sdk/src/envd/process/process_pb.ts
@@ -439,6 +439,12 @@ export class ProcessEvent extends Message<ProcessEvent> {
*/
value: ProcessEvent_EndEvent;
case: "end";
+ } | {
+ /**
+ * @generated from field: process.ProcessEvent.KeepAlive keepalive = 4;
+ */
+ value: ProcessEvent_KeepAlive;
+ case: "keepalive";
} | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<ProcessEvent>) {
@@ -452,6 +458,7 @@ export class ProcessEvent extends Message<ProcessEvent> {
{ no: 1, name: "start", kind: "message", T: ProcessEvent_StartEvent, oneof: "event" },
{ no: 2, name: "data", kind: "message", T: ProcessEvent_DataEvent, oneof: "event" },
{ no: 3, name: "end", kind: "message", T: ProcessEvent_EndEvent, oneof: "event" },
+ { no: 4, name: "keepalive", kind: "message", T: ProcessEvent_KeepAlive, oneof: "event" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessEvent {
@@ -620,6 +627,37 @@ export class ProcessEvent_EndEvent extends Message<ProcessEvent_EndEvent> {
}
}
+/**
+ * @generated from message process.ProcessEvent.KeepAlive
+ */
+export class ProcessEvent_KeepAlive extends Message<ProcessEvent_KeepAlive> {
+ constructor(data?: PartialMessage<ProcessEvent_KeepAlive>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "process.ProcessEvent.KeepAlive";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessEvent_KeepAlive {
+ return new ProcessEvent_KeepAlive().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ProcessEvent_KeepAlive {
+ return new ProcessEvent_KeepAlive().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ProcessEvent_KeepAlive {
+ return new ProcessEvent_KeepAlive().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: ProcessEvent_KeepAlive | PlainMessage<ProcessEvent_KeepAlive> | undefined, b: ProcessEvent_KeepAlive | PlainMessage<ProcessEvent_KeepAlive> | undefined): boolean {
+ return proto3.util.equals(ProcessEvent_KeepAlive, a, b);
+ }
+}
+
/**
* @generated from message process.StartResponse
*/
@@ -837,6 +875,12 @@ export class StreamInputRequest extends Message<StreamInputRequest> {
*/
value: StreamInputRequest_DataEvent;
case: "data";
+ } | {
+ /**
+ * @generated from field: process.StreamInputRequest.KeepAlive keepalive = 3;
+ */
+ value: StreamInputRequest_KeepAlive;
+ case: "keepalive";
} | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<StreamInputRequest>) {
@@ -849,6 +893,7 @@ export class StreamInputRequest extends Message<StreamInputRequest> {
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "start", kind: "message", T: StreamInputRequest_StartEvent, oneof: "event" },
{ no: 2, name: "data", kind: "message", T: StreamInputRequest_DataEvent, oneof: "event" },
+ { no: 3, name: "keepalive", kind: "message", T: StreamInputRequest_KeepAlive, oneof: "event" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): StreamInputRequest {
@@ -942,6 +987,37 @@ export class StreamInputRequest_DataEvent extends Message<StreamInputRequest_Dat
}
}
+/**
+ * @generated from message process.StreamInputRequest.KeepAlive
+ */
+export class StreamInputRequest_KeepAlive extends Message<StreamInputRequest_KeepAlive> {
+ constructor(data?: PartialMessage<StreamInputRequest_KeepAlive>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "process.StreamInputRequest.KeepAlive";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): StreamInputRequest_KeepAlive {
+ return new StreamInputRequest_KeepAlive().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): StreamInputRequest_KeepAlive {
+ return new StreamInputRequest_KeepAlive().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): StreamInputRequest_KeepAlive {
+ return new StreamInputRequest_KeepAlive().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: StreamInputRequest_KeepAlive | PlainMessage<StreamInputRequest_KeepAlive> | undefined, b: StreamInputRequest_KeepAlive | PlainMessage<StreamInputRequest_KeepAlive> | undefined): boolean {
+ return proto3.util.equals(StreamInputRequest_KeepAlive, a, b);
+ }
+}
+
/**
* @generated from message process.StreamInputResponse
*/
diff --git a/packages/js-sdk/src/index.ts b/packages/js-sdk/src/index.ts
index 0d7ceae18..1ba5167da 100644
--- a/packages/js-sdk/src/index.ts
+++ b/packages/js-sdk/src/index.ts
@@ -4,7 +4,7 @@ export {
} from './api'
export type { components, paths } from './api'
-export { ConnectionConfig, SandboxError, DOMAIN } from './connectionConfig'
+export { ConnectionConfig, SandboxError, DOMAIN, InvalidUserError } from './connectionConfig'
export type { ConnectionOpts, Username } from './connectionConfig'
export type { FilesystemEvent, WatchHandle, FilesystemEventType, } from './sandbox/filesystem/watchHandle'
@@ -13,7 +13,6 @@ export type {
} from './sandbox/filesystem'
export {
NotEnoughDiskSpaceError,
- InvalidUserError,
NotFoundError as FileNotFoundError,
FilesystemError,
InvalidPathError,
diff --git a/packages/js-sdk/src/sandbox/filesystem/index.ts b/packages/js-sdk/src/sandbox/filesystem/index.ts
index b17ef12b3..f44a929e2 100644
--- a/packages/js-sdk/src/sandbox/filesystem/index.ts
+++ b/packages/js-sdk/src/sandbox/filesystem/index.ts
@@ -14,6 +14,7 @@ import {
ConnectionOpts,
TimeoutError,
InvalidUserError,
+ KEEPALIVE_INTERVAL,
} from '../../connectionConfig'
import { EnvdApiClient } from '../../envd/api'
import { Filesystem as FilesystemService } from '../../envd/filesystem/filesystem_connect'
@@ -355,6 +356,9 @@ export class Filesystem {
}, requestTimeoutMs)
: undefined
+ const headers = new Headers()
+ headers.set('X-Keepalive-Interval', (KEEPALIVE_INTERVAL / 1000).toString())
+
const events = this.rpc.watchDir({
path,
user: {
@@ -364,6 +368,7 @@ export class Filesystem {
},
},
}, {
+ headers,
signal: controller.signal,
timeoutMs: opts?.timeout ?? 60_000,
})
diff --git a/packages/js-sdk/src/sandbox/filesystem/watchHandle.ts b/packages/js-sdk/src/sandbox/filesystem/watchHandle.ts
index 66a451209..f232551a7 100644
--- a/packages/js-sdk/src/sandbox/filesystem/watchHandle.ts
+++ b/packages/js-sdk/src/sandbox/filesystem/watchHandle.ts
@@ -58,8 +58,6 @@ export class WatchHandle {
case 'filesystem':
yield event.event
break
- default:
- throw new Error(`Unknown event type: ${event.event.case}`)
}
}
} catch (err) {
diff --git a/packages/js-sdk/src/sandbox/index.ts b/packages/js-sdk/src/sandbox/index.ts
index 576840820..5c54421ec 100644
--- a/packages/js-sdk/src/sandbox/index.ts
+++ b/packages/js-sdk/src/sandbox/index.ts
@@ -24,7 +24,7 @@ export interface SandboxOpts extends ConnectionOpts {
export class Sandbox extends SandboxApi {
protected static readonly defaultTemplate = 'base-v1'
- protected static readonly defaultSandboxTimeoutMs = 300_000
+ protected static readonly defaultSandboxTimeoutMs = 10_000
readonly files: Filesystem
readonly commands: Process
@@ -66,7 +66,7 @@ export class Sandbox extends SandboxApi {
const sandboxID = config.debug
? 'debug_sandbox_id'
- : await this.createSandbox(template, this.defaultSandboxTimeoutMs, sandboxOpts)
+ : await this.createSandbox(template, sandboxOpts?.timeoutMs ?? this.defaultSandboxTimeoutMs, sandboxOpts)
return new this(sandboxID, sandboxOpts) as InstanceType<S>
}
diff --git a/packages/js-sdk/src/sandbox/process/index.ts b/packages/js-sdk/src/sandbox/process/index.ts
index 41d8e9ce4..eb86ac153 100644
--- a/packages/js-sdk/src/sandbox/process/index.ts
+++ b/packages/js-sdk/src/sandbox/process/index.ts
@@ -12,7 +12,7 @@ import {
Signal,
StartResponse,
} from '../../envd/process/process_pb'
-import { ConnectionConfig, defaultUsername, Username, ConnectionOpts, SandboxError } from '../../connectionConfig'
+import { ConnectionConfig, defaultUsername, Username, ConnectionOpts, SandboxError, KEEPALIVE_INTERVAL } from '../../connectionConfig'
import { ProcessHandle, ProcessResult } from './processHandle'
export type ProcessInfo = PlainMessage<PsProcessInfo>
@@ -100,6 +100,9 @@ export class Process {
}, requestTimeoutMs)
: undefined
+ const headers = new Headers()
+ headers.set('X-Keepalive-Interval', (KEEPALIVE_INTERVAL / 1000).toString())
+
const events = this.rpc.connect({
process: {
selector: {
@@ -108,6 +111,7 @@ export class Process {
}
},
}, {
+ headers,
signal: controller.signal,
timeoutMs: opts?.timeout ?? 60_000,
})
@@ -146,6 +150,10 @@ export class Process {
}, requestTimeoutMs)
: undefined
+ const headers = new Headers()
+ headers.set('X-Keepalive-Interval', (KEEPALIVE_INTERVAL / 1000).toString())
+
+
try {
const events = this.rpc.start({
user: {
@@ -161,6 +169,7 @@ export class Process {
args: ['-l', '-c', cmd],
},
}, {
+ headers,
signal: controller.signal,
timeoutMs: opts?.timeout ?? 60_000,
})
diff --git a/packages/js-sdk/src/sandbox/pty.ts b/packages/js-sdk/src/sandbox/pty.ts
index 87e5853f3..9dfc8f408 100644
--- a/packages/js-sdk/src/sandbox/pty.ts
+++ b/packages/js-sdk/src/sandbox/pty.ts
@@ -10,7 +10,7 @@ import {
StartResponse,
StreamInputRequest,
} from '../envd/process/process_pb'
-import { ConnectionConfig, ConnectionOpts, defaultUsername, Username } from '../connectionConfig'
+import { ConnectionConfig, ConnectionOpts, defaultUsername, KEEPALIVE_INTERVAL, Username } from '../connectionConfig'
import { PartialMessage } from '@bufbuild/protobuf'
import { ProcessHandle } from './process/processHandle'
@@ -38,6 +38,9 @@ export class Pty {
controller.abort()
}, requestTimeoutMs)
+ const headers = new Headers()
+ headers.set('X-Keepalive-Interval', (KEEPALIVE_INTERVAL / 1000).toString())
+
const events = this.rpc.start({
user: {
selector: {
@@ -59,6 +62,7 @@ export class Pty {
},
},
}, {
+ headers,
signal: controller.signal,
timeoutMs: opts?.timeout ?? 60_000,
})
@@ -116,10 +120,20 @@ export class Pty {
},
})
+ const keepaliveInterval = setInterval(() => {
+ events.enqueue({
+ event: {
+ case: 'keepalive',
+ value: {},
+ }
+ })
+ }, KEEPALIVE_INTERVAL)
+
return {
stop: () => {
controller.abort()
events.stop()
+ clearInterval(keepaliveInterval)
},
sendData: (data: Uint8Array) => events.enqueue({
event: {
diff --git a/packages/python-sdk/e2b/connection_config.py b/packages/python-sdk/e2b/connection_config.py
index 89fd246e9..e217e1138 100644
--- a/packages/python-sdk/e2b/connection_config.py
+++ b/packages/python-sdk/e2b/connection_config.py
@@ -8,7 +8,7 @@ DEBUG = os.getenv("E2B_DEBUG", "false") == "true"
API_KEY = os.getenv("E2B_API_KEY")
ACCESS_TOKEN = os.getenv("E2B_ACCESS_TOKEN")
-REQUEST_TIMEOUT: float = 15 # 15s
+REQUEST_TIMEOUT: float = 30 # 30s
class SandboxException(Exception):
diff --git a/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py b/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py
index 6822442a5..d90b7b97b 100644
--- a/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py
+++ b/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
from e2b.envd.permissions import permissions_pb2 as permissions_dot_permissions__pb2
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x66ilesystem/filesystem.proto\x12\nfilesystem\x1a\x1dpermissions/permissions.proto\"n\n\x0bMoveRequest\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12 \n\x0b\x64\x65stination\x18\x02 \x01(\tR\x0b\x64\x65stination\x12%\n\x04user\x18\x03 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x0e\n\x0cMoveResponse\"K\n\x0eMakeDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x11\n\x0fMakeDirResponse\"J\n\rRemoveRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x10\n\x0eRemoveResponse\"H\n\x0bStatRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\";\n\x0cStatResponse\x12+\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x15.filesystem.EntryInfoR\x05\x65ntry\"I\n\tEntryInfo\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12(\n\x04type\x18\x02 \x01(\x0e\x32\x14.filesystem.FileTypeR\x04type\"K\n\x0eListDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"B\n\x0fListDirResponse\x12/\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x15.filesystem.EntryInfoR\x07\x65ntries\"L\n\x0fWatchDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x8c\x02\n\x10WatchDirResponse\x12?\n\x05start\x18\x02 \x01(\x0b\x32\'.filesystem.WatchDirResponse.StartEventH\x00R\x05start\x12N\n\nfilesystem\x18\x01 \x01(\x0b\x32,.filesystem.WatchDirResponse.FilesystemEventH\x00R\nfilesystem\x1a\x0c\n\nStartEvent\x1aP\n\x0f\x46ilesystemEvent\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12)\n\x04type\x18\x02 \x01(\x0e\x32\x15.filesystem.EventTypeR\x04typeB\x07\n\x05\x65vent*R\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46ILE_TYPE_FILE\x10\x01\x12\x17\n\x13\x46ILE_TYPE_DIRECTORY\x10\x02*\x98\x01\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x45VENT_TYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENT_TYPE_WRITE\x10\x02\x12\x15\n\x11\x45VENT_TYPE_REMOVE\x10\x03\x12\x15\n\x11\x45VENT_TYPE_RENAME\x10\x04\x12\x14\n\x10\x45VENT_TYPE_CHMOD\x10\x05\x32\x94\x03\n\nFilesystem\x12\x39\n\x04Stat\x12\x17.filesystem.StatRequest\x1a\x18.filesystem.StatResponse\x12\x42\n\x07MakeDir\x12\x1a.filesystem.MakeDirRequest\x1a\x1b.filesystem.MakeDirResponse\x12\x39\n\x04Move\x12\x17.filesystem.MoveRequest\x1a\x18.filesystem.MoveResponse\x12\x42\n\x07ListDir\x12\x1a.filesystem.ListDirRequest\x1a\x1b.filesystem.ListDirResponse\x12G\n\x08WatchDir\x12\x1b.filesystem.WatchDirRequest\x1a\x1c.filesystem.WatchDirResponse0\x01\x12?\n\x06Remove\x12\x19.filesystem.RemoveRequest\x1a\x1a.filesystem.RemoveResponseBi\n\x0e\x63om.filesystemB\x0f\x46ilesystemProtoP\x01\xa2\x02\x03\x46XX\xaa\x02\nFilesystem\xca\x02\nFilesystem\xe2\x02\x16\x46ilesystem\\GPBMetadata\xea\x02\nFilesystemb\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x66ilesystem/filesystem.proto\x12\nfilesystem\x1a\x1dpermissions/permissions.proto\"n\n\x0bMoveRequest\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12 \n\x0b\x64\x65stination\x18\x02 \x01(\tR\x0b\x64\x65stination\x12%\n\x04user\x18\x03 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x0e\n\x0cMoveResponse\"K\n\x0eMakeDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x11\n\x0fMakeDirResponse\"J\n\rRemoveRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\x10\n\x0eRemoveResponse\"H\n\x0bStatRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\";\n\x0cStatResponse\x12+\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x15.filesystem.EntryInfoR\x05\x65ntry\"I\n\tEntryInfo\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12(\n\x04type\x18\x02 \x01(\x0e\x32\x14.filesystem.FileTypeR\x04type\"K\n\x0eListDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"B\n\x0fListDirResponse\x12/\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x15.filesystem.EntryInfoR\x07\x65ntries\"L\n\x0fWatchDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x04user\x18\x02 \x01(\x0b\x32\x11.permissions.UserR\x04user\"\xe1\x02\n\x10WatchDirResponse\x12?\n\x05start\x18\x01 \x01(\x0b\x32\'.filesystem.WatchDirResponse.StartEventH\x00R\x05start\x12N\n\nfilesystem\x18\x02 \x01(\x0b\x32,.filesystem.WatchDirResponse.FilesystemEventH\x00R\nfilesystem\x12\x46\n\tkeepalive\x18\x03 \x01(\x0b\x32&.filesystem.WatchDirResponse.KeepAliveH\x00R\tkeepalive\x1a\x0c\n\nStartEvent\x1aP\n\x0f\x46ilesystemEvent\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12)\n\x04type\x18\x02 \x01(\x0e\x32\x15.filesystem.EventTypeR\x04type\x1a\x0b\n\tKeepAliveB\x07\n\x05\x65vent*R\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46ILE_TYPE_FILE\x10\x01\x12\x17\n\x13\x46ILE_TYPE_DIRECTORY\x10\x02*\x98\x01\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x45VENT_TYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENT_TYPE_WRITE\x10\x02\x12\x15\n\x11\x45VENT_TYPE_REMOVE\x10\x03\x12\x15\n\x11\x45VENT_TYPE_RENAME\x10\x04\x12\x14\n\x10\x45VENT_TYPE_CHMOD\x10\x05\x32\x94\x03\n\nFilesystem\x12\x39\n\x04Stat\x12\x17.filesystem.StatRequest\x1a\x18.filesystem.StatResponse\x12\x42\n\x07MakeDir\x12\x1a.filesystem.MakeDirRequest\x1a\x1b.filesystem.MakeDirResponse\x12\x39\n\x04Move\x12\x17.filesystem.MoveRequest\x1a\x18.filesystem.MoveResponse\x12\x42\n\x07ListDir\x12\x1a.filesystem.ListDirRequest\x1a\x1b.filesystem.ListDirResponse\x12G\n\x08WatchDir\x12\x1b.filesystem.WatchDirRequest\x1a\x1c.filesystem.WatchDirResponse0\x01\x12?\n\x06Remove\x12\x19.filesystem.RemoveRequest\x1a\x1a.filesystem.RemoveResponseBi\n\x0e\x63om.filesystemB\x0f\x46ilesystemProtoP\x01\xa2\x02\x03\x46XX\xaa\x02\nFilesystem\xca\x02\nFilesystem\xe2\x02\x16\x46ilesystem\\GPBMetadata\xea\x02\nFilesystemb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -23,10 +23,10 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'filesystem.filesystem_pb2',
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\n\016com.filesystemB\017FilesystemProtoP\001\242\002\003FXX\252\002\nFilesystem\312\002\nFilesystem\342\002\026Filesystem\\GPBMetadata\352\002\nFilesystem'
- _globals['_FILETYPE']._serialized_start=1096
- _globals['_FILETYPE']._serialized_end=1178
- _globals['_EVENTTYPE']._serialized_start=1181
- _globals['_EVENTTYPE']._serialized_end=1333
+ _globals['_FILETYPE']._serialized_start=1181
+ _globals['_FILETYPE']._serialized_end=1263
+ _globals['_EVENTTYPE']._serialized_start=1266
+ _globals['_EVENTTYPE']._serialized_end=1418
_globals['_MOVEREQUEST']._serialized_start=74
_globals['_MOVEREQUEST']._serialized_end=184
_globals['_MOVERESPONSE']._serialized_start=186
@@ -52,11 +52,13 @@ if not _descriptor._USE_C_DESCRIPTORS:
_globals['_WATCHDIRREQUEST']._serialized_start=747
_globals['_WATCHDIRREQUEST']._serialized_end=823
_globals['_WATCHDIRRESPONSE']._serialized_start=826
- _globals['_WATCHDIRRESPONSE']._serialized_end=1094
- _globals['_WATCHDIRRESPONSE_STARTEVENT']._serialized_start=991
- _globals['_WATCHDIRRESPONSE_STARTEVENT']._serialized_end=1003
- _globals['_WATCHDIRRESPONSE_FILESYSTEMEVENT']._serialized_start=1005
- _globals['_WATCHDIRRESPONSE_FILESYSTEMEVENT']._serialized_end=1085
- _globals['_FILESYSTEM']._serialized_start=1336
- _globals['_FILESYSTEM']._serialized_end=1740
+ _globals['_WATCHDIRRESPONSE']._serialized_end=1179
+ _globals['_WATCHDIRRESPONSE_STARTEVENT']._serialized_start=1063
+ _globals['_WATCHDIRRESPONSE_STARTEVENT']._serialized_end=1075
+ _globals['_WATCHDIRRESPONSE_FILESYSTEMEVENT']._serialized_start=1077
+ _globals['_WATCHDIRRESPONSE_FILESYSTEMEVENT']._serialized_end=1157
+ _globals['_WATCHDIRRESPONSE_KEEPALIVE']._serialized_start=1159
+ _globals['_WATCHDIRRESPONSE_KEEPALIVE']._serialized_end=1170
+ _globals['_FILESYSTEM']._serialized_start=1421
+ _globals['_FILESYSTEM']._serialized_end=1825
# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.pyi b/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.pyi
index 1982db1d3..7733db9db 100644
--- a/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.pyi
+++ b/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.pyi
@@ -114,7 +114,7 @@ class WatchDirRequest(_message.Message):
def __init__(self, path: _Optional[str] = ..., user: _Optional[_Union[_permissions_pb2.User, _Mapping]] = ...) -> None: ...
class WatchDirResponse(_message.Message):
- __slots__ = ("start", "filesystem")
+ __slots__ = ("start", "filesystem", "keepalive")
class StartEvent(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
@@ -125,8 +125,13 @@ class WatchDirResponse(_message.Message):
name: str
type: EventType
def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[EventType, str]] = ...) -> None: ...
+ class KeepAlive(_message.Message):
+ __slots__ = ()
+ def __init__(self) -> None: ...
START_FIELD_NUMBER: _ClassVar[int]
FILESYSTEM_FIELD_NUMBER: _ClassVar[int]
+ KEEPALIVE_FIELD_NUMBER: _ClassVar[int]
start: WatchDirResponse.StartEvent
filesystem: WatchDirResponse.FilesystemEvent
- def __init__(self, start: _Optional[_Union[WatchDirResponse.StartEvent, _Mapping]] = ..., filesystem: _Optional[_Union[WatchDirResponse.FilesystemEvent, _Mapping]] = ...) -> None: ...
+ keepalive: WatchDirResponse.KeepAlive
+ def __init__(self, start: _Optional[_Union[WatchDirResponse.StartEvent, _Mapping]] = ..., filesystem: _Optional[_Union[WatchDirResponse.FilesystemEvent, _Mapping]] = ..., keepalive: _Optional[_Union[WatchDirResponse.KeepAlive, _Mapping]] = ...) -> None: ...
diff --git a/packages/python-sdk/e2b/envd/process/process_pb2.py b/packages/python-sdk/e2b/envd/process/process_pb2.py
index b58e7f235..c43141f04 100644
--- a/packages/python-sdk/e2b/envd/process/process_pb2.py
+++ b/packages/python-sdk/e2b/envd/process/process_pb2.py
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
from e2b.envd.permissions import permissions_pb2 as permissions_dot_permissions__pb2
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15process/process.proto\x12\x07process\x1a\x1dpermissions/permissions.proto\"\\\n\x03PTY\x12%\n\x04size\x18\x01 \x01(\x0b\x32\x11.process.PTY.SizeR\x04size\x1a.\n\x04Size\x12\x12\n\x04\x63ols\x18\x01 \x01(\rR\x04\x63ols\x12\x12\n\x04rows\x18\x02 \x01(\rR\x04rows\"\xc3\x01\n\rProcessConfig\x12\x10\n\x03\x63md\x18\x01 \x01(\tR\x03\x63md\x12\x12\n\x04\x61rgs\x18\x02 \x03(\tR\x04\x61rgs\x12\x34\n\x04\x65nvs\x18\x03 \x03(\x0b\x32 .process.ProcessConfig.EnvsEntryR\x04\x65nvs\x12\x15\n\x03\x63wd\x18\x04 \x01(\tH\x00R\x03\x63wd\x88\x01\x01\x1a\x37\n\tEnvsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x06\n\x04_cwd\"\r\n\x0bListRequest\"n\n\x0bProcessInfo\x12.\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x16.process.ProcessConfigR\x06\x63onfig\x12\x10\n\x03pid\x18\x02 \x01(\rR\x03pid\x12\x15\n\x03tag\x18\x03 \x01(\tH\x00R\x03tag\x88\x01\x01\x42\x06\n\x04_tag\"B\n\x0cListResponse\x12\x32\n\tprocesses\x18\x01 \x03(\x0b\x32\x14.process.ProcessInfoR\tprocesses\"\xb3\x01\n\x0cStartRequest\x12\x30\n\x07process\x18\x01 \x01(\x0b\x32\x16.process.ProcessConfigR\x07process\x12#\n\x03pty\x18\x02 \x01(\x0b\x32\x0c.process.PTYH\x00R\x03pty\x88\x01\x01\x12\x15\n\x03tag\x18\x03 \x01(\tH\x01R\x03tag\x88\x01\x01\x12%\n\x04user\x18\x04 \x01(\x0b\x32\x11.permissions.UserR\x04userB\x06\n\x04_ptyB\x06\n\x04_tag\"p\n\rUpdateRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x12#\n\x03pty\x18\x02 \x01(\x0b\x32\x0c.process.PTYH\x00R\x03pty\x88\x01\x01\x42\x06\n\x04_pty\"\x10\n\x0eUpdateResponse\"\xb9\x03\n\x0cProcessEvent\x12\x38\n\x05start\x18\x01 \x01(\x0b\x32 .process.ProcessEvent.StartEventH\x00R\x05start\x12\x35\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x1f.process.ProcessEvent.DataEventH\x00R\x04\x64\x61ta\x12\x32\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x1e.process.ProcessEvent.EndEventH\x00R\x03\x65nd\x1a\x1e\n\nStartEvent\x12\x10\n\x03pid\x18\x01 \x01(\rR\x03pid\x1a]\n\tDataEvent\x12\x18\n\x06stdout\x18\x01 \x01(\x0cH\x00R\x06stdout\x12\x18\n\x06stderr\x18\x02 \x01(\x0cH\x00R\x06stderr\x12\x12\n\x03pty\x18\x03 \x01(\x0cH\x00R\x03ptyB\x08\n\x06output\x1a|\n\x08\x45ndEvent\x12\x1b\n\texit_code\x18\x01 \x01(\x11R\x08\x65xitCode\x12\x16\n\x06\x65xited\x18\x02 \x01(\x08R\x06\x65xited\x12\x16\n\x06status\x18\x03 \x01(\tR\x06status\x12\x19\n\x05\x65rror\x18\x04 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_errorB\x07\n\x05\x65vent\"<\n\rStartResponse\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x15.process.ProcessEventR\x05\x65vent\">\n\x0f\x43onnectResponse\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x15.process.ProcessEventR\x05\x65vent\"s\n\x10SendInputRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x15.process.ProcessInputR\x05input\"\x13\n\x11SendInputResponse\"C\n\x0cProcessInput\x12\x16\n\x05stdin\x18\x01 \x01(\x0cH\x00R\x05stdin\x12\x12\n\x03pty\x18\x02 \x01(\x0cH\x00R\x03ptyB\x07\n\x05input\"\x96\x02\n\x12StreamInputRequest\x12>\n\x05start\x18\x01 \x01(\x0b\x32&.process.StreamInputRequest.StartEventH\x00R\x05start\x12;\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32%.process.StreamInputRequest.DataEventH\x00R\x04\x64\x61ta\x1a@\n\nStartEvent\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x1a\x38\n\tDataEvent\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x15.process.ProcessInputR\x05inputB\x07\n\x05\x65vent\"\x15\n\x13StreamInputResponse\"p\n\x11SendSignalRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x12\'\n\x06signal\x18\x02 \x01(\x0e\x32\x0f.process.SignalR\x06signal\"\x14\n\x12SendSignalResponse\"D\n\x0e\x43onnectRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\"E\n\x0fProcessSelector\x12\x12\n\x03pid\x18\x01 \x01(\rH\x00R\x03pid\x12\x12\n\x03tag\x18\x02 \x01(\tH\x00R\x03tagB\n\n\x08selector*H\n\x06Signal\x12\x16\n\x12SIGNAL_UNSPECIFIED\x10\x00\x12\x12\n\x0eSIGNAL_SIGTERM\x10\x0f\x12\x12\n\x0eSIGNAL_SIGKILL\x10\t2\xca\x03\n\x07Process\x12\x33\n\x04List\x12\x14.process.ListRequest\x1a\x15.process.ListResponse\x12>\n\x07\x43onnect\x12\x17.process.ConnectRequest\x1a\x18.process.ConnectResponse0\x01\x12\x38\n\x05Start\x12\x15.process.StartRequest\x1a\x16.process.StartResponse0\x01\x12\x39\n\x06Update\x12\x16.process.UpdateRequest\x1a\x17.process.UpdateResponse\x12J\n\x0bStreamInput\x12\x1b.process.StreamInputRequest\x1a\x1c.process.StreamInputResponse(\x01\x12\x42\n\tSendInput\x12\x19.process.SendInputRequest\x1a\x1a.process.SendInputResponse\x12\x45\n\nSendSignal\x12\x1a.process.SendSignalRequest\x1a\x1b.process.SendSignalResponseBW\n\x0b\x63om.processB\x0cProcessProtoP\x01\xa2\x02\x03PXX\xaa\x02\x07Process\xca\x02\x07Process\xe2\x02\x13Process\\GPBMetadata\xea\x02\x07Processb\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15process/process.proto\x12\x07process\x1a\x1dpermissions/permissions.proto\"\\\n\x03PTY\x12%\n\x04size\x18\x01 \x01(\x0b\x32\x11.process.PTY.SizeR\x04size\x1a.\n\x04Size\x12\x12\n\x04\x63ols\x18\x01 \x01(\rR\x04\x63ols\x12\x12\n\x04rows\x18\x02 \x01(\rR\x04rows\"\xc3\x01\n\rProcessConfig\x12\x10\n\x03\x63md\x18\x01 \x01(\tR\x03\x63md\x12\x12\n\x04\x61rgs\x18\x02 \x03(\tR\x04\x61rgs\x12\x34\n\x04\x65nvs\x18\x03 \x03(\x0b\x32 .process.ProcessConfig.EnvsEntryR\x04\x65nvs\x12\x15\n\x03\x63wd\x18\x04 \x01(\tH\x00R\x03\x63wd\x88\x01\x01\x1a\x37\n\tEnvsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x06\n\x04_cwd\"\r\n\x0bListRequest\"n\n\x0bProcessInfo\x12.\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x16.process.ProcessConfigR\x06\x63onfig\x12\x10\n\x03pid\x18\x02 \x01(\rR\x03pid\x12\x15\n\x03tag\x18\x03 \x01(\tH\x00R\x03tag\x88\x01\x01\x42\x06\n\x04_tag\"B\n\x0cListResponse\x12\x32\n\tprocesses\x18\x01 \x03(\x0b\x32\x14.process.ProcessInfoR\tprocesses\"\xb3\x01\n\x0cStartRequest\x12\x30\n\x07process\x18\x01 \x01(\x0b\x32\x16.process.ProcessConfigR\x07process\x12#\n\x03pty\x18\x02 \x01(\x0b\x32\x0c.process.PTYH\x00R\x03pty\x88\x01\x01\x12\x15\n\x03tag\x18\x03 \x01(\tH\x01R\x03tag\x88\x01\x01\x12%\n\x04user\x18\x04 \x01(\x0b\x32\x11.permissions.UserR\x04userB\x06\n\x04_ptyB\x06\n\x04_tag\"p\n\rUpdateRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x12#\n\x03pty\x18\x02 \x01(\x0b\x32\x0c.process.PTYH\x00R\x03pty\x88\x01\x01\x42\x06\n\x04_pty\"\x10\n\x0eUpdateResponse\"\x87\x04\n\x0cProcessEvent\x12\x38\n\x05start\x18\x01 \x01(\x0b\x32 .process.ProcessEvent.StartEventH\x00R\x05start\x12\x35\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x1f.process.ProcessEvent.DataEventH\x00R\x04\x64\x61ta\x12\x32\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x1e.process.ProcessEvent.EndEventH\x00R\x03\x65nd\x12?\n\tkeepalive\x18\x04 \x01(\x0b\x32\x1f.process.ProcessEvent.KeepAliveH\x00R\tkeepalive\x1a\x1e\n\nStartEvent\x12\x10\n\x03pid\x18\x01 \x01(\rR\x03pid\x1a]\n\tDataEvent\x12\x18\n\x06stdout\x18\x01 \x01(\x0cH\x00R\x06stdout\x12\x18\n\x06stderr\x18\x02 \x01(\x0cH\x00R\x06stderr\x12\x12\n\x03pty\x18\x03 \x01(\x0cH\x00R\x03ptyB\x08\n\x06output\x1a|\n\x08\x45ndEvent\x12\x1b\n\texit_code\x18\x01 \x01(\x11R\x08\x65xitCode\x12\x16\n\x06\x65xited\x18\x02 \x01(\x08R\x06\x65xited\x12\x16\n\x06status\x18\x03 \x01(\tR\x06status\x12\x19\n\x05\x65rror\x18\x04 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_error\x1a\x0b\n\tKeepAliveB\x07\n\x05\x65vent\"<\n\rStartResponse\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x15.process.ProcessEventR\x05\x65vent\">\n\x0f\x43onnectResponse\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x15.process.ProcessEventR\x05\x65vent\"s\n\x10SendInputRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x15.process.ProcessInputR\x05input\"\x13\n\x11SendInputResponse\"C\n\x0cProcessInput\x12\x16\n\x05stdin\x18\x01 \x01(\x0cH\x00R\x05stdin\x12\x12\n\x03pty\x18\x02 \x01(\x0cH\x00R\x03ptyB\x07\n\x05input\"\xea\x02\n\x12StreamInputRequest\x12>\n\x05start\x18\x01 \x01(\x0b\x32&.process.StreamInputRequest.StartEventH\x00R\x05start\x12;\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32%.process.StreamInputRequest.DataEventH\x00R\x04\x64\x61ta\x12\x45\n\tkeepalive\x18\x03 \x01(\x0b\x32%.process.StreamInputRequest.KeepAliveH\x00R\tkeepalive\x1a@\n\nStartEvent\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x1a\x38\n\tDataEvent\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x15.process.ProcessInputR\x05input\x1a\x0b\n\tKeepAliveB\x07\n\x05\x65vent\"\x15\n\x13StreamInputResponse\"p\n\x11SendSignalRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\x12\'\n\x06signal\x18\x02 \x01(\x0e\x32\x0f.process.SignalR\x06signal\"\x14\n\x12SendSignalResponse\"D\n\x0e\x43onnectRequest\x12\x32\n\x07process\x18\x01 \x01(\x0b\x32\x18.process.ProcessSelectorR\x07process\"E\n\x0fProcessSelector\x12\x12\n\x03pid\x18\x01 \x01(\rH\x00R\x03pid\x12\x12\n\x03tag\x18\x02 \x01(\tH\x00R\x03tagB\n\n\x08selector*H\n\x06Signal\x12\x16\n\x12SIGNAL_UNSPECIFIED\x10\x00\x12\x12\n\x0eSIGNAL_SIGTERM\x10\x0f\x12\x12\n\x0eSIGNAL_SIGKILL\x10\t2\xca\x03\n\x07Process\x12\x33\n\x04List\x12\x14.process.ListRequest\x1a\x15.process.ListResponse\x12>\n\x07\x43onnect\x12\x17.process.ConnectRequest\x1a\x18.process.ConnectResponse0\x01\x12\x38\n\x05Start\x12\x15.process.StartRequest\x1a\x16.process.StartResponse0\x01\x12\x39\n\x06Update\x12\x16.process.UpdateRequest\x1a\x17.process.UpdateResponse\x12J\n\x0bStreamInput\x12\x1b.process.StreamInputRequest\x1a\x1c.process.StreamInputResponse(\x01\x12\x42\n\tSendInput\x12\x19.process.SendInputRequest\x1a\x1a.process.SendInputResponse\x12\x45\n\nSendSignal\x12\x1a.process.SendSignalRequest\x1a\x1b.process.SendSignalResponseBW\n\x0b\x63om.processB\x0cProcessProtoP\x01\xa2\x02\x03PXX\xaa\x02\x07Process\xca\x02\x07Process\xe2\x02\x13Process\\GPBMetadata\xea\x02\x07Processb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -25,8 +25,8 @@ if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._serialized_options = b'\n\013com.processB\014ProcessProtoP\001\242\002\003PXX\252\002\007Process\312\002\007Process\342\002\023Process\\GPBMetadata\352\002\007Process'
_globals['_PROCESSCONFIG_ENVSENTRY']._loaded_options = None
_globals['_PROCESSCONFIG_ENVSENTRY']._serialized_options = b'8\001'
- _globals['_SIGNAL']._serialized_start=2224
- _globals['_SIGNAL']._serialized_end=2296
+ _globals['_SIGNAL']._serialized_start=2386
+ _globals['_SIGNAL']._serialized_end=2458
_globals['_PTY']._serialized_start=65
_globals['_PTY']._serialized_end=157
_globals['_PTY_SIZE']._serialized_start=111
@@ -48,39 +48,43 @@ if not _descriptor._USE_C_DESCRIPTORS:
_globals['_UPDATERESPONSE']._serialized_start=848
_globals['_UPDATERESPONSE']._serialized_end=864
_globals['_PROCESSEVENT']._serialized_start=867
- _globals['_PROCESSEVENT']._serialized_end=1308
- _globals['_PROCESSEVENT_STARTEVENT']._serialized_start=1048
- _globals['_PROCESSEVENT_STARTEVENT']._serialized_end=1078
- _globals['_PROCESSEVENT_DATAEVENT']._serialized_start=1080
- _globals['_PROCESSEVENT_DATAEVENT']._serialized_end=1173
- _globals['_PROCESSEVENT_ENDEVENT']._serialized_start=1175
- _globals['_PROCESSEVENT_ENDEVENT']._serialized_end=1299
- _globals['_STARTRESPONSE']._serialized_start=1310
- _globals['_STARTRESPONSE']._serialized_end=1370
- _globals['_CONNECTRESPONSE']._serialized_start=1372
- _globals['_CONNECTRESPONSE']._serialized_end=1434
- _globals['_SENDINPUTREQUEST']._serialized_start=1436
- _globals['_SENDINPUTREQUEST']._serialized_end=1551
- _globals['_SENDINPUTRESPONSE']._serialized_start=1553
- _globals['_SENDINPUTRESPONSE']._serialized_end=1572
- _globals['_PROCESSINPUT']._serialized_start=1574
- _globals['_PROCESSINPUT']._serialized_end=1641
- _globals['_STREAMINPUTREQUEST']._serialized_start=1644
- _globals['_STREAMINPUTREQUEST']._serialized_end=1922
- _globals['_STREAMINPUTREQUEST_STARTEVENT']._serialized_start=1791
- _globals['_STREAMINPUTREQUEST_STARTEVENT']._serialized_end=1855
- _globals['_STREAMINPUTREQUEST_DATAEVENT']._serialized_start=1857
- _globals['_STREAMINPUTREQUEST_DATAEVENT']._serialized_end=1913
- _globals['_STREAMINPUTRESPONSE']._serialized_start=1924
- _globals['_STREAMINPUTRESPONSE']._serialized_end=1945
- _globals['_SENDSIGNALREQUEST']._serialized_start=1947
- _globals['_SENDSIGNALREQUEST']._serialized_end=2059
- _globals['_SENDSIGNALRESPONSE']._serialized_start=2061
- _globals['_SENDSIGNALRESPONSE']._serialized_end=2081
- _globals['_CONNECTREQUEST']._serialized_start=2083
- _globals['_CONNECTREQUEST']._serialized_end=2151
- _globals['_PROCESSSELECTOR']._serialized_start=2153
- _globals['_PROCESSSELECTOR']._serialized_end=2222
- _globals['_PROCESS']._serialized_start=2299
- _globals['_PROCESS']._serialized_end=2757
+ _globals['_PROCESSEVENT']._serialized_end=1386
+ _globals['_PROCESSEVENT_STARTEVENT']._serialized_start=1113
+ _globals['_PROCESSEVENT_STARTEVENT']._serialized_end=1143
+ _globals['_PROCESSEVENT_DATAEVENT']._serialized_start=1145
+ _globals['_PROCESSEVENT_DATAEVENT']._serialized_end=1238
+ _globals['_PROCESSEVENT_ENDEVENT']._serialized_start=1240
+ _globals['_PROCESSEVENT_ENDEVENT']._serialized_end=1364
+ _globals['_PROCESSEVENT_KEEPALIVE']._serialized_start=1366
+ _globals['_PROCESSEVENT_KEEPALIVE']._serialized_end=1377
+ _globals['_STARTRESPONSE']._serialized_start=1388
+ _globals['_STARTRESPONSE']._serialized_end=1448
+ _globals['_CONNECTRESPONSE']._serialized_start=1450
+ _globals['_CONNECTRESPONSE']._serialized_end=1512
+ _globals['_SENDINPUTREQUEST']._serialized_start=1514
+ _globals['_SENDINPUTREQUEST']._serialized_end=1629
+ _globals['_SENDINPUTRESPONSE']._serialized_start=1631
+ _globals['_SENDINPUTRESPONSE']._serialized_end=1650
+ _globals['_PROCESSINPUT']._serialized_start=1652
+ _globals['_PROCESSINPUT']._serialized_end=1719
+ _globals['_STREAMINPUTREQUEST']._serialized_start=1722
+ _globals['_STREAMINPUTREQUEST']._serialized_end=2084
+ _globals['_STREAMINPUTREQUEST_STARTEVENT']._serialized_start=1940
+ _globals['_STREAMINPUTREQUEST_STARTEVENT']._serialized_end=2004
+ _globals['_STREAMINPUTREQUEST_DATAEVENT']._serialized_start=2006
+ _globals['_STREAMINPUTREQUEST_DATAEVENT']._serialized_end=2062
+ _globals['_STREAMINPUTREQUEST_KEEPALIVE']._serialized_start=1366
+ _globals['_STREAMINPUTREQUEST_KEEPALIVE']._serialized_end=1377
+ _globals['_STREAMINPUTRESPONSE']._serialized_start=2086
+ _globals['_STREAMINPUTRESPONSE']._serialized_end=2107
+ _globals['_SENDSIGNALREQUEST']._serialized_start=2109
+ _globals['_SENDSIGNALREQUEST']._serialized_end=2221
+ _globals['_SENDSIGNALRESPONSE']._serialized_start=2223
+ _globals['_SENDSIGNALRESPONSE']._serialized_end=2243
+ _globals['_CONNECTREQUEST']._serialized_start=2245
+ _globals['_CONNECTREQUEST']._serialized_end=2313
+ _globals['_PROCESSSELECTOR']._serialized_start=2315
+ _globals['_PROCESSSELECTOR']._serialized_end=2384
+ _globals['_PROCESS']._serialized_start=2461
+ _globals['_PROCESS']._serialized_end=2919
# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/e2b/envd/process/process_pb2.pyi b/packages/python-sdk/e2b/envd/process/process_pb2.pyi
index f7ce0a5ae..fbd5f3a34 100644
--- a/packages/python-sdk/e2b/envd/process/process_pb2.pyi
+++ b/packages/python-sdk/e2b/envd/process/process_pb2.pyi
@@ -93,7 +93,7 @@ class UpdateResponse(_message.Message):
def __init__(self) -> None: ...
class ProcessEvent(_message.Message):
- __slots__ = ("start", "data", "end")
+ __slots__ = ("start", "data", "end", "keepalive")
class StartEvent(_message.Message):
__slots__ = ("pid",)
PID_FIELD_NUMBER: _ClassVar[int]
@@ -119,13 +119,18 @@ class ProcessEvent(_message.Message):
status: str
error: str
def __init__(self, exit_code: _Optional[int] = ..., exited: bool = ..., status: _Optional[str] = ..., error: _Optional[str] = ...) -> None: ...
+ class KeepAlive(_message.Message):
+ __slots__ = ()
+ def __init__(self) -> None: ...
START_FIELD_NUMBER: _ClassVar[int]
DATA_FIELD_NUMBER: _ClassVar[int]
END_FIELD_NUMBER: _ClassVar[int]
+ KEEPALIVE_FIELD_NUMBER: _ClassVar[int]
start: ProcessEvent.StartEvent
data: ProcessEvent.DataEvent
end: ProcessEvent.EndEvent
- def __init__(self, start: _Optional[_Union[ProcessEvent.StartEvent, _Mapping]] = ..., data: _Optional[_Union[ProcessEvent.DataEvent, _Mapping]] = ..., end: _Optional[_Union[ProcessEvent.EndEvent, _Mapping]] = ...) -> None: ...
+ keepalive: ProcessEvent.KeepAlive
+ def __init__(self, start: _Optional[_Union[ProcessEvent.StartEvent, _Mapping]] = ..., data: _Optional[_Union[ProcessEvent.DataEvent, _Mapping]] = ..., end: _Optional[_Union[ProcessEvent.EndEvent, _Mapping]] = ..., keepalive: _Optional[_Union[ProcessEvent.KeepAlive, _Mapping]] = ...) -> None: ...
class StartResponse(_message.Message):
__slots__ = ("event",)
@@ -160,7 +165,7 @@ class ProcessInput(_message.Message):
def __init__(self, stdin: _Optional[bytes] = ..., pty: _Optional[bytes] = ...) -> None: ...
class StreamInputRequest(_message.Message):
- __slots__ = ("start", "data")
+ __slots__ = ("start", "data", "keepalive")
class StartEvent(_message.Message):
__slots__ = ("process",)
PROCESS_FIELD_NUMBER: _ClassVar[int]
@@ -171,11 +176,16 @@ class StreamInputRequest(_message.Message):
INPUT_FIELD_NUMBER: _ClassVar[int]
input: ProcessInput
def __init__(self, input: _Optional[_Union[ProcessInput, _Mapping]] = ...) -> None: ...
+ class KeepAlive(_message.Message):
+ __slots__ = ()
+ def __init__(self) -> None: ...
START_FIELD_NUMBER: _ClassVar[int]
DATA_FIELD_NUMBER: _ClassVar[int]
+ KEEPALIVE_FIELD_NUMBER: _ClassVar[int]
start: StreamInputRequest.StartEvent
data: StreamInputRequest.DataEvent
- def __init__(self, start: _Optional[_Union[StreamInputRequest.StartEvent, _Mapping]] = ..., data: _Optional[_Union[StreamInputRequest.DataEvent, _Mapping]] = ...) -> None: ...
+ keepalive: StreamInputRequest.KeepAlive
+ def __init__(self, start: _Optional[_Union[StreamInputRequest.StartEvent, _Mapping]] = ..., data: _Optional[_Union[StreamInputRequest.DataEvent, _Mapping]] = ..., keepalive: _Optional[_Union[StreamInputRequest.KeepAlive, _Mapping]] = ...) -> None: ...
class StreamInputResponse(_message.Message):
__slots__ = ()
diff --git a/spec/envd/filesystem/filesystem.proto b/spec/envd/filesystem/filesystem.proto
index 93a2f3020..2c5009b74 100644
--- a/spec/envd/filesystem/filesystem.proto
+++ b/spec/envd/filesystem/filesystem.proto
@@ -77,8 +77,9 @@ message WatchDirRequest {
message WatchDirResponse {
oneof event {
- StartEvent start = 2;
- FilesystemEvent filesystem = 1;
+ StartEvent start = 1;
+ FilesystemEvent filesystem = 2;
+ KeepAlive keepalive = 3;
}
message StartEvent {}
@@ -87,6 +88,8 @@ message WatchDirResponse {
string name = 1;
EventType type = 2;
}
+
+ message KeepAlive {}
}
enum EventType {
diff --git a/spec/envd/process/process.proto b/spec/envd/process/process.proto
index 7d7ab6798..5e767ce79 100644
--- a/spec/envd/process/process.proto
+++ b/spec/envd/process/process.proto
@@ -69,6 +69,7 @@ message ProcessEvent {
StartEvent start = 1;
DataEvent data = 2;
EndEvent end = 3;
+ KeepAlive keepalive = 4;
}
message StartEvent {
@@ -89,6 +90,8 @@ message ProcessEvent {
string status = 3;
optional string error = 4;
}
+
+ message KeepAlive {}
}
message StartResponse {
@@ -118,6 +121,7 @@ message StreamInputRequest {
oneof event {
StartEvent start = 1;
DataEvent data = 2;
+ KeepAlive keepalive = 3;
}
message StartEvent {
@@ -127,6 +131,8 @@ message StreamInputRequest {
message DataEvent {
ProcessInput input = 2;
}
+
+ message KeepAlive {}
}
message StreamInputResponse {}