Skip to content

armgit / E2B

Public Imported from GitHub
0

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

[WIP] Generate python client

Tomas Valenta002a28870e8f
diff --git a/packages/python-sdk/Makefile b/packages/python-sdk/Makefile
index e882a18c1..45d271fdf 100644
--- a/packages/python-sdk/Makefile
+++ b/packages/python-sdk/Makefile
@@ -43,3 +43,8 @@ generate-v1:
.PHONY: generate
generate: generate-v1 generate-v2
+
+
+.PHONE: generate-grpc
+generate-grpc:
+ poetry run python -m grpc_tools.protoc -I ../../spec --python_out=. --pyi_out=. --grpc_python_out=. ../../spec/*.proto
diff --git a/packages/python-sdk/e2b/grpc/main.py b/packages/python-sdk/e2b/grpc/main.py
new file mode 100644
index 000000000..d8142774b
--- /dev/null
+++ b/packages/python-sdk/e2b/grpc/main.py
@@ -0,0 +1,21 @@
+from __future__ import print_function
+
+import logging
+
+import grpc.experimental
+import filesystem_pb2
+import filesystem_pb2_grpc
+
+
+def call_grpc():
+ print("Will try to greet world ...")
+ with grpc.insecure_channel("localhost:50051") as channel:
+
+ filesystem_pb2_grpc.Filesystem.ReadFile()
+ stub = filesystem_pb2_grpc.FilesystemStub(channel)
+ response = stub.ReadFile(filesystem_pb2.ReadFileRequest(path="/"))
+ print("Greeter client received: " + response.message)
+
+
+if __name__ == "__main__":
+ logging.basicConfig()
diff --git a/packages/python-sdk/filesystem_pb2.py b/packages/python-sdk/filesystem_pb2.py
new file mode 100644
index 000000000..9b004cae2
--- /dev/null
+++ b/packages/python-sdk/filesystem_pb2.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: filesystem.proto
+# Protobuf Python Version: 4.25.1
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf.internal import builder as _builder
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
+import permissions_pb2 as permissions__pb2
+
+
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x66ilesystem.proto\x12\nfilesystem\x1a\x1bgoogle/protobuf/empty.proto\x1a\x11permissions.proto\"e\n\x11\x43reateFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x16\n\x0e\x63reate_parents\x18\x02 \x01(\x08\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"p\n\x0eMakeDirRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x16\n\x0e\x63reate_parents\x18\x02 \x01(\x08\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12*\n\x06\x61\x63\x63\x65ss\x18\x04 \x01(\x0b\x32\x1a.permissions.AccessControl\"d\n\x11\x43reateLinkRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"g\n\x14\x43reateSymlinkRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"q\n\x0b\x43opyRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t\x12\x11\n\trecursive\x18\x03 \x01(\x08\x12*\n\x06\x61\x63\x63\x65ss\x18\x04 \x01(\x0b\x32\x1a.permissions.AccessControl\"V\n\x0c\x43hmodRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04mode\x18\x02 \x01(\r\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"b\n\x0c\x43hownRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0b\n\x03uid\x18\x02 \x01(\r\x12\x0b\n\x03gid\x18\x03 \x01(\r\x12*\n\x06\x61\x63\x63\x65ss\x18\x04 \x01(\x0b\x32\x1a.permissions.AccessControl\"\x8b\x01\n\x0fReadFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x13\n\x06offset\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12\x13\n\x06length\x18\x04 \x01(\x04H\x01\x88\x01\x01\x12*\n\x06\x61\x63\x63\x65ss\x18\x05 \x01(\x0b\x32\x1a.permissions.AccessControlB\t\n\x07_offsetB\t\n\x07_length\" \n\x10ReadFileResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"G\n\x0bStatRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12*\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32\x1a.permissions.AccessControl\"4\n\x0cStatResponse\x12$\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x15.filesystem.EntryInfo\"\xc8\x01\n\x10WriteFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x1c\n\x14\x63reate_if_not_exists\x18\x03 \x01(\x08\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x08\x12\x13\n\x06offset\x18\x05 \x01(\x04H\x00\x88\x01\x01\x12\x13\n\x06length\x18\x06 \x01(\x04H\x01\x88\x01\x01\x12*\n\x06\x61\x63\x63\x65ss\x18\x07 \x01(\x0b\x32\x1a.permissions.AccessControlB\t\n\x07_offsetB\t\n\x07_length\"V\n\rRemoveRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"^\n\x0bMoveRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"\x9b\x01\n\tEntryInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\"\n\x04type\x18\x02 \x01(\x0e\x32\x14.filesystem.FileType\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0c\n\x04size\x18\x04 \x01(\x04\x12\x15\n\rlast_modified\x18\x05 \x01(\x04\x12)\n\x05owner\x18\x06 \x01(\x0b\x32\x1a.permissions.AccessControl\"J\n\x0eReadDirRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12*\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32\x1a.permissions.AccessControl\"9\n\x0fReadDirResponse\x12&\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x15.filesystem.EntryInfo\"H\n\x0cWatchRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12*\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32\x1a.permissions.AccessControl\"j\n\x0f\x46ilesystemEvent\x12\x0c\n\x04path\x18\x01 \x01(\t\x12#\n\x04type\x18\x02 \x01(\x0e\x32\x15.filesystem.EventType\x12$\n\x05\x65ntry\x18\x03 \x01(\x0b\x32\x15.filesystem.EntryInfo*P\n\x08\x46ileType\x12\x14\n\x10UNKNOWN_FileType\x10\x00\x12\x08\n\x04\x46ILE\x10\x01\x12\r\n\tDIRECTORY\x10\x02\x12\x08\n\x04LINK\x10\x03\x12\x0b\n\x07SYMLINK\x10\x04*\\\n\tEventType\x12\x15\n\x11UNKNOWN_EventType\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\t\n\x05WRITE\x10\x02\x12\n\n\x06REMOVE\x10\x03\x12\n\n\x06RENAME\x10\x04\x12\t\n\x05\x43HMOD\x10\x05\x32\x94\x07\n\nFilesystem\x12\x39\n\x04Stat\x12\x17.filesystem.StatRequest\x1a\x18.filesystem.StatResponse\x12\x43\n\nCreateFile\x12\x1d.filesystem.CreateFileRequest\x1a\x16.google.protobuf.Empty\x12G\n\x08ReadFile\x12\x1b.filesystem.ReadFileRequest\x1a\x1c.filesystem.ReadFileResponse0\x01\x12\x41\n\tWriteFile\x12\x1c.filesystem.WriteFileRequest\x1a\x16.google.protobuf.Empty\x12=\n\x07MakeDir\x12\x1a.filesystem.MakeDirRequest\x1a\x16.google.protobuf.Empty\x12\x42\n\x07ReadDir\x12\x1a.filesystem.ReadDirRequest\x1a\x1b.filesystem.ReadDirResponse\x12\x43\n\nCreateLink\x12\x1d.filesystem.CreateLinkRequest\x1a\x16.google.protobuf.Empty\x12I\n\rCreateSymlink\x12 .filesystem.CreateSymlinkRequest\x1a\x16.google.protobuf.Empty\x12@\n\x05Watch\x12\x18.filesystem.WatchRequest\x1a\x1b.filesystem.FilesystemEvent0\x01\x12\x39\n\x06Rename\x12\x17.filesystem.MoveRequest\x1a\x16.google.protobuf.Empty\x12;\n\x06Remove\x12\x19.filesystem.RemoveRequest\x1a\x16.google.protobuf.Empty\x12\x39\n\x05\x43hmod\x12\x18.filesystem.ChmodRequest\x1a\x16.google.protobuf.Empty\x12\x39\n\x05\x43hown\x12\x18.filesystem.ChownRequest\x1a\x16.google.protobuf.Empty\x12\x37\n\x04\x43opy\x12\x17.filesystem.CopyRequest\x1a\x16.google.protobuf.EmptyB-Z+github.com/e2b-dev/infra/packages/envd/specb\x06proto3')
+
+_globals = globals()
+_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'filesystem_pb2', _globals)
+if _descriptor._USE_C_DESCRIPTORS == False:
+ _globals['DESCRIPTOR']._options = None
+ _globals['DESCRIPTOR']._serialized_options = b'Z+github.com/e2b-dev/infra/packages/envd/spec'
+ _globals['_FILETYPE']._serialized_start=1972
+ _globals['_FILETYPE']._serialized_end=2052
+ _globals['_EVENTTYPE']._serialized_start=2054
+ _globals['_EVENTTYPE']._serialized_end=2146
+ _globals['_CREATEFILEREQUEST']._serialized_start=80
+ _globals['_CREATEFILEREQUEST']._serialized_end=181
+ _globals['_MAKEDIRREQUEST']._serialized_start=183
+ _globals['_MAKEDIRREQUEST']._serialized_end=295
+ _globals['_CREATELINKREQUEST']._serialized_start=297
+ _globals['_CREATELINKREQUEST']._serialized_end=397
+ _globals['_CREATESYMLINKREQUEST']._serialized_start=399
+ _globals['_CREATESYMLINKREQUEST']._serialized_end=502
+ _globals['_COPYREQUEST']._serialized_start=504
+ _globals['_COPYREQUEST']._serialized_end=617
+ _globals['_CHMODREQUEST']._serialized_start=619
+ _globals['_CHMODREQUEST']._serialized_end=705
+ _globals['_CHOWNREQUEST']._serialized_start=707
+ _globals['_CHOWNREQUEST']._serialized_end=805
+ _globals['_READFILEREQUEST']._serialized_start=808
+ _globals['_READFILEREQUEST']._serialized_end=947
+ _globals['_READFILERESPONSE']._serialized_start=949
+ _globals['_READFILERESPONSE']._serialized_end=981
+ _globals['_STATREQUEST']._serialized_start=983
+ _globals['_STATREQUEST']._serialized_end=1054
+ _globals['_STATRESPONSE']._serialized_start=1056
+ _globals['_STATRESPONSE']._serialized_end=1108
+ _globals['_WRITEFILEREQUEST']._serialized_start=1111
+ _globals['_WRITEFILEREQUEST']._serialized_end=1311
+ _globals['_REMOVEREQUEST']._serialized_start=1313
+ _globals['_REMOVEREQUEST']._serialized_end=1399
+ _globals['_MOVEREQUEST']._serialized_start=1401
+ _globals['_MOVEREQUEST']._serialized_end=1495
+ _globals['_ENTRYINFO']._serialized_start=1498
+ _globals['_ENTRYINFO']._serialized_end=1653
+ _globals['_READDIRREQUEST']._serialized_start=1655
+ _globals['_READDIRREQUEST']._serialized_end=1729
+ _globals['_READDIRRESPONSE']._serialized_start=1731
+ _globals['_READDIRRESPONSE']._serialized_end=1788
+ _globals['_WATCHREQUEST']._serialized_start=1790
+ _globals['_WATCHREQUEST']._serialized_end=1862
+ _globals['_FILESYSTEMEVENT']._serialized_start=1864
+ _globals['_FILESYSTEMEVENT']._serialized_end=1970
+ _globals['_FILESYSTEM']._serialized_start=2149
+ _globals['_FILESYSTEM']._serialized_end=3065
+# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/filesystem_pb2.pyi b/packages/python-sdk/filesystem_pb2.pyi
new file mode 100644
index 000000000..130cc8bde
--- /dev/null
+++ b/packages/python-sdk/filesystem_pb2.pyi
@@ -0,0 +1,231 @@
+from google.protobuf import empty_pb2 as _empty_pb2
+import permissions_pb2 as _permissions_pb2
+from google.protobuf.internal import containers as _containers
+from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
+
+DESCRIPTOR: _descriptor.FileDescriptor
+
+class FileType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
+ __slots__ = ()
+ UNKNOWN_FileType: _ClassVar[FileType]
+ FILE: _ClassVar[FileType]
+ DIRECTORY: _ClassVar[FileType]
+ LINK: _ClassVar[FileType]
+ SYMLINK: _ClassVar[FileType]
+
+class EventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
+ __slots__ = ()
+ UNKNOWN_EventType: _ClassVar[EventType]
+ CREATE: _ClassVar[EventType]
+ WRITE: _ClassVar[EventType]
+ REMOVE: _ClassVar[EventType]
+ RENAME: _ClassVar[EventType]
+ CHMOD: _ClassVar[EventType]
+UNKNOWN_FileType: FileType
+FILE: FileType
+DIRECTORY: FileType
+LINK: FileType
+SYMLINK: FileType
+UNKNOWN_EventType: EventType
+CREATE: EventType
+WRITE: EventType
+REMOVE: EventType
+RENAME: EventType
+CHMOD: EventType
+
+class CreateFileRequest(_message.Message):
+ __slots__ = ("path", "create_parents", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ CREATE_PARENTS_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ create_parents: bool
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., create_parents: bool = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class MakeDirRequest(_message.Message):
+ __slots__ = ("path", "create_parents", "mode", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ CREATE_PARENTS_FIELD_NUMBER: _ClassVar[int]
+ MODE_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ create_parents: bool
+ mode: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., create_parents: bool = ..., mode: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class CreateLinkRequest(_message.Message):
+ __slots__ = ("source", "destination", "access")
+ SOURCE_FIELD_NUMBER: _ClassVar[int]
+ DESTINATION_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ source: str
+ destination: str
+ access: _permissions_pb2.AccessControl
+ def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class CreateSymlinkRequest(_message.Message):
+ __slots__ = ("source", "destination", "access")
+ SOURCE_FIELD_NUMBER: _ClassVar[int]
+ DESTINATION_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ source: str
+ destination: str
+ access: _permissions_pb2.AccessControl
+ def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class CopyRequest(_message.Message):
+ __slots__ = ("source", "destination", "recursive", "access")
+ SOURCE_FIELD_NUMBER: _ClassVar[int]
+ DESTINATION_FIELD_NUMBER: _ClassVar[int]
+ RECURSIVE_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ source: str
+ destination: str
+ recursive: bool
+ access: _permissions_pb2.AccessControl
+ def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., recursive: bool = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ChmodRequest(_message.Message):
+ __slots__ = ("path", "mode", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ MODE_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ mode: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., mode: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ChownRequest(_message.Message):
+ __slots__ = ("path", "uid", "gid", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ UID_FIELD_NUMBER: _ClassVar[int]
+ GID_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ uid: int
+ gid: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., uid: _Optional[int] = ..., gid: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ReadFileRequest(_message.Message):
+ __slots__ = ("path", "offset", "length", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ OFFSET_FIELD_NUMBER: _ClassVar[int]
+ LENGTH_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ offset: int
+ length: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., offset: _Optional[int] = ..., length: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ReadFileResponse(_message.Message):
+ __slots__ = ("data",)
+ DATA_FIELD_NUMBER: _ClassVar[int]
+ data: bytes
+ def __init__(self, data: _Optional[bytes] = ...) -> None: ...
+
+class StatRequest(_message.Message):
+ __slots__ = ("path", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class StatResponse(_message.Message):
+ __slots__ = ("entry",)
+ ENTRY_FIELD_NUMBER: _ClassVar[int]
+ entry: EntryInfo
+ def __init__(self, entry: _Optional[_Union[EntryInfo, _Mapping]] = ...) -> None: ...
+
+class WriteFileRequest(_message.Message):
+ __slots__ = ("path", "data", "create_if_not_exists", "append", "offset", "length", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ DATA_FIELD_NUMBER: _ClassVar[int]
+ CREATE_IF_NOT_EXISTS_FIELD_NUMBER: _ClassVar[int]
+ APPEND_FIELD_NUMBER: _ClassVar[int]
+ OFFSET_FIELD_NUMBER: _ClassVar[int]
+ LENGTH_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ data: bytes
+ create_if_not_exists: bool
+ append: bool
+ offset: int
+ length: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., data: _Optional[bytes] = ..., create_if_not_exists: bool = ..., append: bool = ..., offset: _Optional[int] = ..., length: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class RemoveRequest(_message.Message):
+ __slots__ = ("path", "all", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ ALL_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ all: bool
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., all: bool = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class MoveRequest(_message.Message):
+ __slots__ = ("source", "destination", "access")
+ SOURCE_FIELD_NUMBER: _ClassVar[int]
+ DESTINATION_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ source: str
+ destination: str
+ access: _permissions_pb2.AccessControl
+ def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class EntryInfo(_message.Message):
+ __slots__ = ("name", "type", "mode", "size", "last_modified", "owner")
+ NAME_FIELD_NUMBER: _ClassVar[int]
+ TYPE_FIELD_NUMBER: _ClassVar[int]
+ MODE_FIELD_NUMBER: _ClassVar[int]
+ SIZE_FIELD_NUMBER: _ClassVar[int]
+ LAST_MODIFIED_FIELD_NUMBER: _ClassVar[int]
+ OWNER_FIELD_NUMBER: _ClassVar[int]
+ name: str
+ type: FileType
+ mode: int
+ size: int
+ last_modified: int
+ owner: _permissions_pb2.AccessControl
+ def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[FileType, str]] = ..., mode: _Optional[int] = ..., size: _Optional[int] = ..., last_modified: _Optional[int] = ..., owner: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ReadDirRequest(_message.Message):
+ __slots__ = ("path", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ReadDirResponse(_message.Message):
+ __slots__ = ("entries",)
+ ENTRIES_FIELD_NUMBER: _ClassVar[int]
+ entries: _containers.RepeatedCompositeFieldContainer[EntryInfo]
+ def __init__(self, entries: _Optional[_Iterable[_Union[EntryInfo, _Mapping]]] = ...) -> None: ...
+
+class WatchRequest(_message.Message):
+ __slots__ = ("path", "access")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ access: _permissions_pb2.AccessControl
+ def __init__(self, path: _Optional[str] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class FilesystemEvent(_message.Message):
+ __slots__ = ("path", "type", "entry")
+ PATH_FIELD_NUMBER: _ClassVar[int]
+ TYPE_FIELD_NUMBER: _ClassVar[int]
+ ENTRY_FIELD_NUMBER: _ClassVar[int]
+ path: str
+ type: EventType
+ entry: EntryInfo
+ def __init__(self, path: _Optional[str] = ..., type: _Optional[_Union[EventType, str]] = ..., entry: _Optional[_Union[EntryInfo, _Mapping]] = ...) -> None: ...
diff --git a/packages/python-sdk/filesystem_pb2_grpc.py b/packages/python-sdk/filesystem_pb2_grpc.py
new file mode 100644
index 000000000..b4dcecc44
--- /dev/null
+++ b/packages/python-sdk/filesystem_pb2_grpc.py
@@ -0,0 +1,496 @@
+# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
+"""Client and server classes corresponding to protobuf-defined services."""
+import grpc
+
+import filesystem_pb2 as filesystem__pb2
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
+
+
+class FilesystemStub(object):
+ """Missing associated documentation comment in .proto file."""
+
+ def __init__(self, channel):
+ """Constructor.
+
+ Args:
+ channel: A grpc.Channel.
+ """
+ self.Stat = channel.unary_unary(
+ '/filesystem.Filesystem/Stat',
+ request_serializer=filesystem__pb2.StatRequest.SerializeToString,
+ response_deserializer=filesystem__pb2.StatResponse.FromString,
+ )
+ self.CreateFile = channel.unary_unary(
+ '/filesystem.Filesystem/CreateFile',
+ request_serializer=filesystem__pb2.CreateFileRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.ReadFile = channel.unary_stream(
+ '/filesystem.Filesystem/ReadFile',
+ request_serializer=filesystem__pb2.ReadFileRequest.SerializeToString,
+ response_deserializer=filesystem__pb2.ReadFileResponse.FromString,
+ )
+ self.WriteFile = channel.unary_unary(
+ '/filesystem.Filesystem/WriteFile',
+ request_serializer=filesystem__pb2.WriteFileRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.MakeDir = channel.unary_unary(
+ '/filesystem.Filesystem/MakeDir',
+ request_serializer=filesystem__pb2.MakeDirRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.ReadDir = channel.unary_unary(
+ '/filesystem.Filesystem/ReadDir',
+ request_serializer=filesystem__pb2.ReadDirRequest.SerializeToString,
+ response_deserializer=filesystem__pb2.ReadDirResponse.FromString,
+ )
+ self.CreateLink = channel.unary_unary(
+ '/filesystem.Filesystem/CreateLink',
+ request_serializer=filesystem__pb2.CreateLinkRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.CreateSymlink = channel.unary_unary(
+ '/filesystem.Filesystem/CreateSymlink',
+ request_serializer=filesystem__pb2.CreateSymlinkRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.Watch = channel.unary_stream(
+ '/filesystem.Filesystem/Watch',
+ request_serializer=filesystem__pb2.WatchRequest.SerializeToString,
+ response_deserializer=filesystem__pb2.FilesystemEvent.FromString,
+ )
+ self.Rename = channel.unary_unary(
+ '/filesystem.Filesystem/Rename',
+ request_serializer=filesystem__pb2.MoveRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.Remove = channel.unary_unary(
+ '/filesystem.Filesystem/Remove',
+ request_serializer=filesystem__pb2.RemoveRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.Chmod = channel.unary_unary(
+ '/filesystem.Filesystem/Chmod',
+ request_serializer=filesystem__pb2.ChmodRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.Chown = channel.unary_unary(
+ '/filesystem.Filesystem/Chown',
+ request_serializer=filesystem__pb2.ChownRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.Copy = channel.unary_unary(
+ '/filesystem.Filesystem/Copy',
+ request_serializer=filesystem__pb2.CopyRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+
+
+class FilesystemServicer(object):
+ """Missing associated documentation comment in .proto file."""
+
+ def Stat(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def CreateFile(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def ReadFile(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def WriteFile(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def MakeDir(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def ReadDir(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def CreateLink(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def CreateSymlink(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Watch(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Rename(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Remove(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Chmod(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Chown(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Copy(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+
+def add_FilesystemServicer_to_server(servicer, server):
+ rpc_method_handlers = {
+ 'Stat': grpc.unary_unary_rpc_method_handler(
+ servicer.Stat,
+ request_deserializer=filesystem__pb2.StatRequest.FromString,
+ response_serializer=filesystem__pb2.StatResponse.SerializeToString,
+ ),
+ 'CreateFile': grpc.unary_unary_rpc_method_handler(
+ servicer.CreateFile,
+ request_deserializer=filesystem__pb2.CreateFileRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'ReadFile': grpc.unary_stream_rpc_method_handler(
+ servicer.ReadFile,
+ request_deserializer=filesystem__pb2.ReadFileRequest.FromString,
+ response_serializer=filesystem__pb2.ReadFileResponse.SerializeToString,
+ ),
+ 'WriteFile': grpc.unary_unary_rpc_method_handler(
+ servicer.WriteFile,
+ request_deserializer=filesystem__pb2.WriteFileRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'MakeDir': grpc.unary_unary_rpc_method_handler(
+ servicer.MakeDir,
+ request_deserializer=filesystem__pb2.MakeDirRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'ReadDir': grpc.unary_unary_rpc_method_handler(
+ servicer.ReadDir,
+ request_deserializer=filesystem__pb2.ReadDirRequest.FromString,
+ response_serializer=filesystem__pb2.ReadDirResponse.SerializeToString,
+ ),
+ 'CreateLink': grpc.unary_unary_rpc_method_handler(
+ servicer.CreateLink,
+ request_deserializer=filesystem__pb2.CreateLinkRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'CreateSymlink': grpc.unary_unary_rpc_method_handler(
+ servicer.CreateSymlink,
+ request_deserializer=filesystem__pb2.CreateSymlinkRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'Watch': grpc.unary_stream_rpc_method_handler(
+ servicer.Watch,
+ request_deserializer=filesystem__pb2.WatchRequest.FromString,
+ response_serializer=filesystem__pb2.FilesystemEvent.SerializeToString,
+ ),
+ 'Rename': grpc.unary_unary_rpc_method_handler(
+ servicer.Rename,
+ request_deserializer=filesystem__pb2.MoveRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'Remove': grpc.unary_unary_rpc_method_handler(
+ servicer.Remove,
+ request_deserializer=filesystem__pb2.RemoveRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'Chmod': grpc.unary_unary_rpc_method_handler(
+ servicer.Chmod,
+ request_deserializer=filesystem__pb2.ChmodRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'Chown': grpc.unary_unary_rpc_method_handler(
+ servicer.Chown,
+ request_deserializer=filesystem__pb2.ChownRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'Copy': grpc.unary_unary_rpc_method_handler(
+ servicer.Copy,
+ request_deserializer=filesystem__pb2.CopyRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ }
+ generic_handler = grpc.method_handlers_generic_handler(
+ 'filesystem.Filesystem', rpc_method_handlers)
+ server.add_generic_rpc_handlers((generic_handler,))
+
+
+ # This class is part of an EXPERIMENTAL API.
+class Filesystem(object):
+ """Missing associated documentation comment in .proto file."""
+
+ @staticmethod
+ def Stat(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/Stat',
+ filesystem__pb2.StatRequest.SerializeToString,
+ filesystem__pb2.StatResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def CreateFile(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/CreateFile',
+ filesystem__pb2.CreateFileRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def ReadFile(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_stream(request, target, '/filesystem.Filesystem/ReadFile',
+ filesystem__pb2.ReadFileRequest.SerializeToString,
+ filesystem__pb2.ReadFileResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def WriteFile(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/WriteFile',
+ filesystem__pb2.WriteFileRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def MakeDir(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/MakeDir',
+ filesystem__pb2.MakeDirRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def ReadDir(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/ReadDir',
+ filesystem__pb2.ReadDirRequest.SerializeToString,
+ filesystem__pb2.ReadDirResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def CreateLink(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/CreateLink',
+ filesystem__pb2.CreateLinkRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def CreateSymlink(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/CreateSymlink',
+ filesystem__pb2.CreateSymlinkRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Watch(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_stream(request, target, '/filesystem.Filesystem/Watch',
+ filesystem__pb2.WatchRequest.SerializeToString,
+ filesystem__pb2.FilesystemEvent.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Rename(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/Rename',
+ filesystem__pb2.MoveRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Remove(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/Remove',
+ filesystem__pb2.RemoveRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Chmod(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/Chmod',
+ filesystem__pb2.ChmodRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Chown(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/Chown',
+ filesystem__pb2.ChownRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Copy(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/filesystem.Filesystem/Copy',
+ filesystem__pb2.CopyRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/packages/python-sdk/network_pb2.py b/packages/python-sdk/network_pb2.py
new file mode 100644
index 000000000..20319de6e
--- /dev/null
+++ b/packages/python-sdk/network_pb2.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: network.proto
+# Protobuf Python Version: 4.25.1
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf.internal import builder as _builder
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+import permissions_pb2 as permissions__pb2
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
+
+
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rnetwork.proto\x12\x07network\x1a\x11permissions.proto\x1a\x1bgoogle/protobuf/empty.proto\"s\n\x14\x43onfigurePortRequest\x12\x0c\n\x04port\x18\x01 \x01(\r\x12!\n\x05state\x18\x02 \x01(\x0e\x32\x12.network.PortState\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\">\n\x10ListPortsRequest\x12*\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0b\x32\x1a.permissions.AccessControl\"1\n\x11ListPortsResponse\x12\x1c\n\x05ports\x18\x01 \x03(\x0b\x32\r.network.Port\"N\n\x11WatchPortsRequest\x12\r\n\x05ports\x18\x01 \x03(\r\x12*\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32\x1a.permissions.AccessControl\"7\n\x04Port\x12\x0c\n\x04port\x18\x01 \x01(\r\x12!\n\x05state\x18\x02 \x01(\x0e\x32\x12.network.PortState*7\n\tPortState\x12\x15\n\x11UNKNOWN_PortState\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\t\n\x05\x43LOSE\x10\x02\x32\xd0\x01\n\x07Network\x12\x46\n\rConfigurePort\x12\x1d.network.ConfigurePortRequest\x1a\x16.google.protobuf.Empty\x12\x42\n\tListPorts\x12\x19.network.ListPortsRequest\x1a\x1a.network.ListPortsResponse\x12\x39\n\nWatchPorts\x12\x1a.network.WatchPortsRequest\x1a\r.network.Port0\x01\x42-Z+github.com/e2b-dev/infra/packages/envd/specb\x06proto3')
+
+_globals = globals()
+_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'network_pb2', _globals)
+if _descriptor._USE_C_DESCRIPTORS == False:
+ _globals['DESCRIPTOR']._options = None
+ _globals['DESCRIPTOR']._serialized_options = b'Z+github.com/e2b-dev/infra/packages/envd/spec'
+ _globals['_PORTSTATE']._serialized_start=443
+ _globals['_PORTSTATE']._serialized_end=498
+ _globals['_CONFIGUREPORTREQUEST']._serialized_start=74
+ _globals['_CONFIGUREPORTREQUEST']._serialized_end=189
+ _globals['_LISTPORTSREQUEST']._serialized_start=191
+ _globals['_LISTPORTSREQUEST']._serialized_end=253
+ _globals['_LISTPORTSRESPONSE']._serialized_start=255
+ _globals['_LISTPORTSRESPONSE']._serialized_end=304
+ _globals['_WATCHPORTSREQUEST']._serialized_start=306
+ _globals['_WATCHPORTSREQUEST']._serialized_end=384
+ _globals['_PORT']._serialized_start=386
+ _globals['_PORT']._serialized_end=441
+ _globals['_NETWORK']._serialized_start=501
+ _globals['_NETWORK']._serialized_end=709
+# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/network_pb2.pyi b/packages/python-sdk/network_pb2.pyi
new file mode 100644
index 000000000..e24df1574
--- /dev/null
+++ b/packages/python-sdk/network_pb2.pyi
@@ -0,0 +1,56 @@
+import permissions_pb2 as _permissions_pb2
+from google.protobuf import empty_pb2 as _empty_pb2
+from google.protobuf.internal import containers as _containers
+from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
+
+DESCRIPTOR: _descriptor.FileDescriptor
+
+class PortState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
+ __slots__ = ()
+ UNKNOWN_PortState: _ClassVar[PortState]
+ OPEN: _ClassVar[PortState]
+ CLOSE: _ClassVar[PortState]
+UNKNOWN_PortState: PortState
+OPEN: PortState
+CLOSE: PortState
+
+class ConfigurePortRequest(_message.Message):
+ __slots__ = ("port", "state", "access")
+ PORT_FIELD_NUMBER: _ClassVar[int]
+ STATE_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ port: int
+ state: PortState
+ access: _permissions_pb2.AccessControl
+ def __init__(self, port: _Optional[int] = ..., state: _Optional[_Union[PortState, str]] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ListPortsRequest(_message.Message):
+ __slots__ = ("access",)
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ access: _permissions_pb2.AccessControl
+ def __init__(self, access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ListPortsResponse(_message.Message):
+ __slots__ = ("ports",)
+ PORTS_FIELD_NUMBER: _ClassVar[int]
+ ports: _containers.RepeatedCompositeFieldContainer[Port]
+ def __init__(self, ports: _Optional[_Iterable[_Union[Port, _Mapping]]] = ...) -> None: ...
+
+class WatchPortsRequest(_message.Message):
+ __slots__ = ("ports", "access")
+ PORTS_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ ports: _containers.RepeatedScalarFieldContainer[int]
+ access: _permissions_pb2.AccessControl
+ def __init__(self, ports: _Optional[_Iterable[int]] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class Port(_message.Message):
+ __slots__ = ("port", "state")
+ PORT_FIELD_NUMBER: _ClassVar[int]
+ STATE_FIELD_NUMBER: _ClassVar[int]
+ port: int
+ state: PortState
+ def __init__(self, port: _Optional[int] = ..., state: _Optional[_Union[PortState, str]] = ...) -> None: ...
diff --git a/packages/python-sdk/network_pb2_grpc.py b/packages/python-sdk/network_pb2_grpc.py
new file mode 100644
index 000000000..d3e135680
--- /dev/null
+++ b/packages/python-sdk/network_pb2_grpc.py
@@ -0,0 +1,133 @@
+# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
+"""Client and server classes corresponding to protobuf-defined services."""
+import grpc
+
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
+import network_pb2 as network__pb2
+
+
+class NetworkStub(object):
+ """Missing associated documentation comment in .proto file."""
+
+ def __init__(self, channel):
+ """Constructor.
+
+ Args:
+ channel: A grpc.Channel.
+ """
+ self.ConfigurePort = channel.unary_unary(
+ '/network.Network/ConfigurePort',
+ request_serializer=network__pb2.ConfigurePortRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.ListPorts = channel.unary_unary(
+ '/network.Network/ListPorts',
+ request_serializer=network__pb2.ListPortsRequest.SerializeToString,
+ response_deserializer=network__pb2.ListPortsResponse.FromString,
+ )
+ self.WatchPorts = channel.unary_stream(
+ '/network.Network/WatchPorts',
+ request_serializer=network__pb2.WatchPortsRequest.SerializeToString,
+ response_deserializer=network__pb2.Port.FromString,
+ )
+
+
+class NetworkServicer(object):
+ """Missing associated documentation comment in .proto file."""
+
+ def ConfigurePort(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def ListPorts(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def WatchPorts(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+
+def add_NetworkServicer_to_server(servicer, server):
+ rpc_method_handlers = {
+ 'ConfigurePort': grpc.unary_unary_rpc_method_handler(
+ servicer.ConfigurePort,
+ request_deserializer=network__pb2.ConfigurePortRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'ListPorts': grpc.unary_unary_rpc_method_handler(
+ servicer.ListPorts,
+ request_deserializer=network__pb2.ListPortsRequest.FromString,
+ response_serializer=network__pb2.ListPortsResponse.SerializeToString,
+ ),
+ 'WatchPorts': grpc.unary_stream_rpc_method_handler(
+ servicer.WatchPorts,
+ request_deserializer=network__pb2.WatchPortsRequest.FromString,
+ response_serializer=network__pb2.Port.SerializeToString,
+ ),
+ }
+ generic_handler = grpc.method_handlers_generic_handler(
+ 'network.Network', rpc_method_handlers)
+ server.add_generic_rpc_handlers((generic_handler,))
+
+
+ # This class is part of an EXPERIMENTAL API.
+class Network(object):
+ """Missing associated documentation comment in .proto file."""
+
+ @staticmethod
+ def ConfigurePort(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/network.Network/ConfigurePort',
+ network__pb2.ConfigurePortRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def ListPorts(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/network.Network/ListPorts',
+ network__pb2.ListPortsRequest.SerializeToString,
+ network__pb2.ListPortsResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def WatchPorts(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_stream(request, target, '/network.Network/WatchPorts',
+ network__pb2.WatchPortsRequest.SerializeToString,
+ network__pb2.Port.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/packages/python-sdk/permissions_pb2.py b/packages/python-sdk/permissions_pb2.py
new file mode 100644
index 000000000..8e7e1290e
--- /dev/null
+++ b/packages/python-sdk/permissions_pb2.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: permissions.proto
+# Protobuf Python Version: 4.25.1
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf.internal import builder as _builder
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11permissions.proto\x12\x0bpermissions\"+\n\rAccessControl\x12\x11\n\x04user\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_userB-Z+github.com/e2b-dev/infra/packages/envd/specb\x06proto3')
+
+_globals = globals()
+_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'permissions_pb2', _globals)
+if _descriptor._USE_C_DESCRIPTORS == False:
+ _globals['DESCRIPTOR']._options = None
+ _globals['DESCRIPTOR']._serialized_options = b'Z+github.com/e2b-dev/infra/packages/envd/spec'
+ _globals['_ACCESSCONTROL']._serialized_start=34
+ _globals['_ACCESSCONTROL']._serialized_end=77
+# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/permissions_pb2.pyi b/packages/python-sdk/permissions_pb2.pyi
new file mode 100644
index 000000000..f72004f61
--- /dev/null
+++ b/packages/python-sdk/permissions_pb2.pyi
@@ -0,0 +1,11 @@
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from typing import ClassVar as _ClassVar, Optional as _Optional
+
+DESCRIPTOR: _descriptor.FileDescriptor
+
+class AccessControl(_message.Message):
+ __slots__ = ("user",)
+ USER_FIELD_NUMBER: _ClassVar[int]
+ user: str
+ def __init__(self, user: _Optional[str] = ...) -> None: ...
diff --git a/packages/python-sdk/permissions_pb2_grpc.py b/packages/python-sdk/permissions_pb2_grpc.py
new file mode 100644
index 000000000..2daafffeb
--- /dev/null
+++ b/packages/python-sdk/permissions_pb2_grpc.py
@@ -0,0 +1,4 @@
+# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
+"""Client and server classes corresponding to protobuf-defined services."""
+import grpc
+
diff --git a/packages/python-sdk/poetry.lock b/packages/python-sdk/poetry.lock
index 7f9c7e2f6..d41370bf5 100644
--- a/packages/python-sdk/poetry.lock
+++ b/packages/python-sdk/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
[[package]]
name = "aenum"
@@ -488,6 +488,140 @@ files = [
{file = "frozenlist-1.4.0.tar.gz", hash = "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251"},
]
+[[package]]
+name = "grpcio"
+version = "1.62.2"
+description = "HTTP/2-based RPC framework"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "grpcio-1.62.2-cp310-cp310-linux_armv7l.whl", hash = "sha256:66344ea741124c38588a664237ac2fa16dfd226964cca23ddc96bd4accccbde5"},
+ {file = "grpcio-1.62.2-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:5dab7ac2c1e7cb6179c6bfad6b63174851102cbe0682294e6b1d6f0981ad7138"},
+ {file = "grpcio-1.62.2-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:3ad00f3f0718894749d5a8bb0fa125a7980a2f49523731a9b1fabf2b3522aa43"},
+ {file = "grpcio-1.62.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2e72ddfee62430ea80133d2cbe788e0d06b12f865765cb24a40009668bd8ea05"},
+ {file = "grpcio-1.62.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53d3a59a10af4c2558a8e563aed9f256259d2992ae0d3037817b2155f0341de1"},
+ {file = "grpcio-1.62.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a1511a303f8074f67af4119275b4f954189e8313541da7b88b1b3a71425cdb10"},
+ {file = "grpcio-1.62.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b94d41b7412ef149743fbc3178e59d95228a7064c5ab4760ae82b562bdffb199"},
+ {file = "grpcio-1.62.2-cp310-cp310-win32.whl", hash = "sha256:a75af2fc7cb1fe25785be7bed1ab18cef959a376cdae7c6870184307614caa3f"},
+ {file = "grpcio-1.62.2-cp310-cp310-win_amd64.whl", hash = "sha256:80407bc007754f108dc2061e37480238b0dc1952c855e86a4fc283501ee6bb5d"},
+ {file = "grpcio-1.62.2-cp311-cp311-linux_armv7l.whl", hash = "sha256:c1624aa686d4b36790ed1c2e2306cc3498778dffaf7b8dd47066cf819028c3ad"},
+ {file = "grpcio-1.62.2-cp311-cp311-macosx_10_10_universal2.whl", hash = "sha256:1c1bb80299bdef33309dff03932264636450c8fdb142ea39f47e06a7153d3063"},
+ {file = "grpcio-1.62.2-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:db068bbc9b1fa16479a82e1ecf172a93874540cb84be69f0b9cb9b7ac3c82670"},
+ {file = "grpcio-1.62.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2cc8a308780edbe2c4913d6a49dbdb5befacdf72d489a368566be44cadaef1a"},
+ {file = "grpcio-1.62.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0695ae31a89f1a8fc8256050329a91a9995b549a88619263a594ca31b76d756"},
+ {file = "grpcio-1.62.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:88b4f9ee77191dcdd8810241e89340a12cbe050be3e0d5f2f091c15571cd3930"},
+ {file = "grpcio-1.62.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2a0204532aa2f1afd467024b02b4069246320405bc18abec7babab03e2644e75"},
+ {file = "grpcio-1.62.2-cp311-cp311-win32.whl", hash = "sha256:6e784f60e575a0de554ef9251cbc2ceb8790914fe324f11e28450047f264ee6f"},
+ {file = "grpcio-1.62.2-cp311-cp311-win_amd64.whl", hash = "sha256:112eaa7865dd9e6d7c0556c8b04ae3c3a2dc35d62ad3373ab7f6a562d8199200"},
+ {file = "grpcio-1.62.2-cp312-cp312-linux_armv7l.whl", hash = "sha256:65034473fc09628a02fb85f26e73885cf1ed39ebd9cf270247b38689ff5942c5"},
+ {file = "grpcio-1.62.2-cp312-cp312-macosx_10_10_universal2.whl", hash = "sha256:d2c1771d0ee3cf72d69bb5e82c6a82f27fbd504c8c782575eddb7839729fbaad"},
+ {file = "grpcio-1.62.2-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:3abe6838196da518863b5d549938ce3159d809218936851b395b09cad9b5d64a"},
+ {file = "grpcio-1.62.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5ffeb269f10cedb4f33142b89a061acda9f672fd1357331dbfd043422c94e9e"},
+ {file = "grpcio-1.62.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:404d3b4b6b142b99ba1cff0b2177d26b623101ea2ce51c25ef6e53d9d0d87bcc"},
+ {file = "grpcio-1.62.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:262cda97efdabb20853d3b5a4c546a535347c14b64c017f628ca0cc7fa780cc6"},
+ {file = "grpcio-1.62.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:17708db5b11b966373e21519c4c73e5a750555f02fde82276ea2a267077c68ad"},
+ {file = "grpcio-1.62.2-cp312-cp312-win32.whl", hash = "sha256:b7ec9e2f8ffc8436f6b642a10019fc513722858f295f7efc28de135d336ac189"},
+ {file = "grpcio-1.62.2-cp312-cp312-win_amd64.whl", hash = "sha256:aa787b83a3cd5e482e5c79be030e2b4a122ecc6c5c6c4c42a023a2b581fdf17b"},
+ {file = "grpcio-1.62.2-cp37-cp37m-linux_armv7l.whl", hash = "sha256:cfd23ad29bfa13fd4188433b0e250f84ec2c8ba66b14a9877e8bce05b524cf54"},
+ {file = "grpcio-1.62.2-cp37-cp37m-macosx_10_10_universal2.whl", hash = "sha256:af15e9efa4d776dfcecd1d083f3ccfb04f876d613e90ef8432432efbeeac689d"},
+ {file = "grpcio-1.62.2-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:f4aa94361bb5141a45ca9187464ae81a92a2a135ce2800b2203134f7a1a1d479"},
+ {file = "grpcio-1.62.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82af3613a219512a28ee5c95578eb38d44dd03bca02fd918aa05603c41018051"},
+ {file = "grpcio-1.62.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55ddaf53474e8caeb29eb03e3202f9d827ad3110475a21245f3c7712022882a9"},
+ {file = "grpcio-1.62.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c79b518c56dddeec79e5500a53d8a4db90da995dfe1738c3ac57fe46348be049"},
+ {file = "grpcio-1.62.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a5eb4844e5e60bf2c446ef38c5b40d7752c6effdee882f716eb57ae87255d20a"},
+ {file = "grpcio-1.62.2-cp37-cp37m-win_amd64.whl", hash = "sha256:aaae70364a2d1fb238afd6cc9fcb10442b66e397fd559d3f0968d28cc3ac929c"},
+ {file = "grpcio-1.62.2-cp38-cp38-linux_armv7l.whl", hash = "sha256:1bcfe5070e4406f489e39325b76caeadab28c32bf9252d3ae960c79935a4cc36"},
+ {file = "grpcio-1.62.2-cp38-cp38-macosx_10_10_universal2.whl", hash = "sha256:da6a7b6b938c15fa0f0568e482efaae9c3af31963eec2da4ff13a6d8ec2888e4"},
+ {file = "grpcio-1.62.2-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:41955b641c34db7d84db8d306937b72bc4968eef1c401bea73081a8d6c3d8033"},
+ {file = "grpcio-1.62.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c772f225483905f675cb36a025969eef9712f4698364ecd3a63093760deea1bc"},
+ {file = "grpcio-1.62.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07ce1f775d37ca18c7a141300e5b71539690efa1f51fe17f812ca85b5e73262f"},
+ {file = "grpcio-1.62.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:26f415f40f4a93579fd648f48dca1c13dfacdfd0290f4a30f9b9aeb745026811"},
+ {file = "grpcio-1.62.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:db707e3685ff16fc1eccad68527d072ac8bdd2e390f6daa97bc394ea7de4acea"},
+ {file = "grpcio-1.62.2-cp38-cp38-win32.whl", hash = "sha256:589ea8e75de5fd6df387de53af6c9189c5231e212b9aa306b6b0d4f07520fbb9"},
+ {file = "grpcio-1.62.2-cp38-cp38-win_amd64.whl", hash = "sha256:3c3ed41f4d7a3aabf0f01ecc70d6b5d00ce1800d4af652a549de3f7cf35c4abd"},
+ {file = "grpcio-1.62.2-cp39-cp39-linux_armv7l.whl", hash = "sha256:162ccf61499c893831b8437120600290a99c0bc1ce7b51f2c8d21ec87ff6af8b"},
+ {file = "grpcio-1.62.2-cp39-cp39-macosx_10_10_universal2.whl", hash = "sha256:f27246d7da7d7e3bd8612f63785a7b0c39a244cf14b8dd9dd2f2fab939f2d7f1"},
+ {file = "grpcio-1.62.2-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:2507006c8a478f19e99b6fe36a2464696b89d40d88f34e4b709abe57e1337467"},
+ {file = "grpcio-1.62.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a90ac47a8ce934e2c8d71e317d2f9e7e6aaceb2d199de940ce2c2eb611b8c0f4"},
+ {file = "grpcio-1.62.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99701979bcaaa7de8d5f60476487c5df8f27483624f1f7e300ff4669ee44d1f2"},
+ {file = "grpcio-1.62.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:af7dc3f7a44f10863b1b0ecab4078f0a00f561aae1edbd01fd03ad4dcf61c9e9"},
+ {file = "grpcio-1.62.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:fa63245271920786f4cb44dcada4983a3516be8f470924528cf658731864c14b"},
+ {file = "grpcio-1.62.2-cp39-cp39-win32.whl", hash = "sha256:c6ad9c39704256ed91a1cffc1379d63f7d0278d6a0bad06b0330f5d30291e3a3"},
+ {file = "grpcio-1.62.2-cp39-cp39-win_amd64.whl", hash = "sha256:16da954692fd61aa4941fbeda405a756cd96b97b5d95ca58a92547bba2c1624f"},
+ {file = "grpcio-1.62.2.tar.gz", hash = "sha256:c77618071d96b7a8be2c10701a98537823b9c65ba256c0b9067e0594cdbd954d"},
+]
+
+[package.extras]
+protobuf = ["grpcio-tools (>=1.62.2)"]
+
+[[package]]
+name = "grpcio-tools"
+version = "1.62.2"
+description = "Protobuf code generator for gRPC"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "grpcio-tools-1.62.2.tar.gz", hash = "sha256:5fd5e1582b678e6b941ee5f5809340be5e0724691df5299aae8226640f94e18f"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-linux_armv7l.whl", hash = "sha256:1679b4903aed2dc5bd8cb22a452225b05dc8470a076f14fd703581efc0740cdb"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:9d41e0e47dd075c075bb8f103422968a65dd0d8dc8613288f573ae91eb1053ba"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:987e774f74296842bbffd55ea8826370f70c499e5b5f71a8cf3103838b6ee9c3"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40cd4eeea4b25bcb6903b82930d579027d034ba944393c4751cdefd9c49e6989"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6746bc823958499a3cf8963cc1de00072962fb5e629f26d658882d3f4c35095"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2ed775e844566ce9ce089be9a81a8b928623b8ee5820f5e4d58c1a9d33dfc5ae"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bdc5dd3f57b5368d5d661d5d3703bcaa38bceca59d25955dff66244dbc987271"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-win32.whl", hash = "sha256:3a8d6f07e64c0c7756f4e0c4781d9d5a2b9cc9cbd28f7032a6fb8d4f847d0445"},
+ {file = "grpcio_tools-1.62.2-cp310-cp310-win_amd64.whl", hash = "sha256:e33b59fb3efdddeb97ded988a871710033e8638534c826567738d3edce528752"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-linux_armv7l.whl", hash = "sha256:472505d030135d73afe4143b0873efe0dcb385bd6d847553b4f3afe07679af00"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-macosx_10_10_universal2.whl", hash = "sha256:ec674b4440ef4311ac1245a709e87b36aca493ddc6850eebe0b278d1f2b6e7d1"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:184b4174d4bd82089d706e8223e46c42390a6ebac191073b9772abc77308f9fa"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c195d74fe98541178ece7a50dad2197d43991e0f77372b9a88da438be2486f12"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a34d97c62e61bfe9e6cff0410fe144ac8cca2fc979ad0be46b7edf026339d161"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cbb8453ae83a1db2452b7fe0f4b78e4a8dd32be0f2b2b73591ae620d4d784d3d"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4f989e5cebead3ae92c6abf6bf7b19949e1563a776aea896ac5933f143f0c45d"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-win32.whl", hash = "sha256:c48fabe40b9170f4e3d7dd2c252e4f1ff395dc24e49ac15fc724b1b6f11724da"},
+ {file = "grpcio_tools-1.62.2-cp311-cp311-win_amd64.whl", hash = "sha256:8c616d0ad872e3780693fce6a3ac8ef00fc0963e6d7815ce9dcfae68ba0fc287"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-linux_armv7l.whl", hash = "sha256:10cc3321704ecd17c93cf68c99c35467a8a97ffaaed53207e9b2da6ae0308ee1"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-macosx_10_10_universal2.whl", hash = "sha256:9be84ff6d47fd61462be7523b49d7ba01adf67ce4e1447eae37721ab32464dd8"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:d82f681c9a9d933a9d8068e8e382977768e7779ddb8870fa0cf918d8250d1532"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:04c607029ae3660fb1624ed273811ffe09d57d84287d37e63b5b802a35897329"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72b61332f1b439c14cbd3815174a8f1d35067a02047c32decd406b3a09bb9890"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8214820990d01b52845f9fbcb92d2b7384a0c321b303e3ac614c219dc7d1d3af"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:462e0ab8dd7c7b70bfd6e3195eebc177549ede5cf3189814850c76f9a340d7ce"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-win32.whl", hash = "sha256:fa107460c842e4c1a6266150881694fefd4f33baa544ea9489601810c2210ef8"},
+ {file = "grpcio_tools-1.62.2-cp312-cp312-win_amd64.whl", hash = "sha256:759c60f24c33a181bbbc1232a6752f9b49fbb1583312a4917e2b389fea0fb0f2"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-linux_armv7l.whl", hash = "sha256:45db5da2bcfa88f2b86b57ef35daaae85c60bd6754a051d35d9449c959925b57"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-macosx_10_10_universal2.whl", hash = "sha256:ab84bae88597133f6ea7a2bdc57b2fda98a266fe8d8d4763652cbefd20e73ad7"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:7a49bccae1c7d154b78e991885c3111c9ad8c8fa98e91233de425718f47c6139"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7e439476b29d6dac363b321781a113794397afceeb97dad85349db5f1cb5e9a"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ea369c4d1567d1acdf69c8ea74144f4ccad9e545df7f9a4fc64c94fa7684ba3"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4f955702dc4b530696375251319d05223b729ed24e8673c2129f7a75d2caefbb"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3708a747aa4b6b505727282ca887041174e146ae030ebcadaf4c1d346858df62"},
+ {file = "grpcio_tools-1.62.2-cp37-cp37m-win_amd64.whl", hash = "sha256:2ce149ea55eadb486a7fb75a20f63ef3ac065ee6a0240ed25f3549ce7954c653"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-linux_armv7l.whl", hash = "sha256:58cbb24b3fa6ae35aa9c210fcea3a51aa5fef0cd25618eb4fd94f746d5a9b703"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-macosx_10_10_universal2.whl", hash = "sha256:6413581e14a80e0b4532577766cf0586de4dd33766a31b3eb5374a746771c07d"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:47117c8a7e861382470d0e22d336e5a91fdc5f851d1db44fa784b9acea190d87"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9f1ba79a253df9e553d20319c615fa2b429684580fa042dba618d7f6649ac7e4"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04a394cf5e51ba9be412eb9f6c482b6270bd81016e033e8eb7d21b8cc28fe8b5"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:3c53b221378b035ae2f1881cbc3aca42a6075a8e90e1a342c2f205eb1d1aa6a1"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:c384c838b34d1b67068e51b5bbe49caa6aa3633acd158f1ab16b5da8d226bc53"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-win32.whl", hash = "sha256:19ea69e41c3565932aa28a202d1875ec56786aea46a2eab54a3b28e8a27f9517"},
+ {file = "grpcio_tools-1.62.2-cp38-cp38-win_amd64.whl", hash = "sha256:1d768a5c07279a4c461ebf52d0cec1c6ca85c6291c71ec2703fe3c3e7e28e8c4"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-linux_armv7l.whl", hash = "sha256:5b07b5874187e170edfbd7aa2ca3a54ebf3b2952487653e8c0b0d83601c33035"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-macosx_10_10_universal2.whl", hash = "sha256:d58389fe8be206ddfb4fa703db1e24c956856fcb9a81da62b13577b3a8f7fda7"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:7d8b4e00c3d7237b92260fc18a561cd81f1da82e8be100db1b7d816250defc66"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1fe08d2038f2b7c53259b5c49e0ad08c8e0ce2b548d8185993e7ef67e8592cca"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:19216e1fb26dbe23d12a810517e1b3fbb8d4f98b1a3fbebeec9d93a79f092de4"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b8574469ecc4ff41d6bb95f44e0297cdb0d95bade388552a9a444db9cd7485cd"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4f6f32d39283ea834a493fccf0ebe9cfddee7577bdcc27736ad4be1732a36399"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-win32.whl", hash = "sha256:76eb459bdf3fb666e01883270beee18f3f11ed44488486b61cd210b4e0e17cc1"},
+ {file = "grpcio_tools-1.62.2-cp39-cp39-win_amd64.whl", hash = "sha256:217c2ee6a7ce519a55958b8622e21804f6fdb774db08c322f4c9536c35fdce7c"},
+]
+
+[package.dependencies]
+grpcio = ">=1.62.2"
+protobuf = ">=4.21.6,<5.0dev"
+setuptools = "*"
+
[[package]]
name = "h11"
version = "0.14.0"
@@ -747,6 +881,26 @@ files = [
dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
+[[package]]
+name = "protobuf"
+version = "4.25.3"
+description = ""
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "protobuf-4.25.3-cp310-abi3-win32.whl", hash = "sha256:d4198877797a83cbfe9bffa3803602bbe1625dc30d8a097365dbc762e5790faa"},
+ {file = "protobuf-4.25.3-cp310-abi3-win_amd64.whl", hash = "sha256:209ba4cc916bab46f64e56b85b090607a676f66b473e6b762e6f1d9d591eb2e8"},
+ {file = "protobuf-4.25.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:f1279ab38ecbfae7e456a108c5c0681e4956d5b1090027c1de0f934dfdb4b35c"},
+ {file = "protobuf-4.25.3-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:e7cb0ae90dd83727f0c0718634ed56837bfeeee29a5f82a7514c03ee1364c019"},
+ {file = "protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:7c8daa26095f82482307bc717364e7c13f4f1c99659be82890dcfc215194554d"},
+ {file = "protobuf-4.25.3-cp38-cp38-win32.whl", hash = "sha256:f4f118245c4a087776e0a8408be33cf09f6c547442c00395fbfb116fac2f8ac2"},
+ {file = "protobuf-4.25.3-cp38-cp38-win_amd64.whl", hash = "sha256:c053062984e61144385022e53678fbded7aea14ebb3e0305ae3592fb219ccfa4"},
+ {file = "protobuf-4.25.3-cp39-cp39-win32.whl", hash = "sha256:19b270aeaa0099f16d3ca02628546b8baefe2955bbe23224aaf856134eccf1e4"},
+ {file = "protobuf-4.25.3-cp39-cp39-win_amd64.whl", hash = "sha256:e3c97a1555fd6388f857770ff8b9703083de6bf1f9274a002a332d65fbb56c8c"},
+ {file = "protobuf-4.25.3-py3-none-any.whl", hash = "sha256:f0700d54bcf45424477e46a9f0944155b46fb0639d69728739c0e47bab83f2b9"},
+ {file = "protobuf-4.25.3.tar.gz", hash = "sha256:25b5d0b42fd000320bd7830b349e3b696435f3b329810427a6bcce6a5492cc5c"},
+]
+
[[package]]
name = "pydantic"
version = "2.4.2"
@@ -990,6 +1144,22 @@ urllib3 = ">=1.21.1,<3"
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
+[[package]]
+name = "setuptools"
+version = "69.5.1"
+description = "Easily download, build, install, upgrade, and uninstall Python packages"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "setuptools-69.5.1-py3-none-any.whl", hash = "sha256:c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32"},
+ {file = "setuptools-69.5.1.tar.gz", hash = "sha256:6c1fccdac05a97e598fb0ae3bbed5904ccb317337a51139dcd51453611bbb987"},
+]
+
+[package.extras]
+docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"]
+testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"]
+testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"]
+
[[package]]
name = "six"
version = "1.16.0"
@@ -1242,4 +1412,4 @@ multidict = ">=4.0"
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
-content-hash = "dd06162caf65ee5493c6a0c66fdee779f97b209bf0c47f1a6a5e10e2c703604f"
+content-hash = "893f3b852fb2336ebdf4e6792b20ec8a114fa981a2737cdad2cd484b91f7811f"
diff --git a/packages/python-sdk/process_pb2.py b/packages/python-sdk/process_pb2.py
new file mode 100644
index 000000000..abe468156
--- /dev/null
+++ b/packages/python-sdk/process_pb2.py
@@ -0,0 +1,63 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: process.proto
+# Protobuf Python Version: 4.25.1
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf.internal import builder as _builder
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+import permissions_pb2 as permissions__pb2
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
+
+
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rprocess.proto\x12\x07process\x1a\x11permissions.proto\x1a\x1bgoogle/protobuf/empty.proto\"%\n\x07PTYSize\x12\x0c\n\x04\x63ols\x18\x01 \x01(\r\x12\x0c\n\x04rows\x18\x02 \x01(\r\"%\n\x03PTY\x12\x1e\n\x04size\x18\x01 \x01(\x0b\x32\x10.process.PTYSize\"\x91\x01\n\rProcessConfig\x12\x0b\n\x03\x63md\x18\x01 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x02 \x03(\t\x12,\n\x03\x65nv\x18\x03 \x03(\x0b\x32\x1f.process.ProcessConfig.EnvEntry\x12\x0b\n\x03\x63wd\x18\x04 \x01(\t\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"9\n\x0bListRequest\x12*\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0b\x32\x1a.permissions.AccessControl\"9\n\x0cListResponse\x12)\n\tprocesses\x18\x01 \x03(\x0b\x32\x16.process.ProcessConfig\"\x92\x01\n\x13StartProcessRequest\x12\'\n\x07process\x18\x01 \x01(\x0b\x32\x16.process.ProcessConfig\x12\x1e\n\x03pty\x18\x02 \x01(\x0b\x32\x0c.process.PTYH\x00\x88\x01\x01\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControlB\x06\n\x04_pty\"k\n\x10ResizePTYRequest\x12\x0b\n\x03pid\x18\x01 \x01(\r\x12\x1e\n\x04size\x18\x02 \x01(\x0b\x32\x10.process.PTYSize\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"\x19\n\nStartEvent\x12\x0b\n\x03pid\x18\x01 \x01(\r\"K\n\tDataEvent\x12\x13\n\x06stdout\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06stderr\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x42\t\n\x07_stdoutB\t\n\x07_stderr\":\n\x08\x45ndEvent\x12\x10\n\x08\x65xitCode\x18\x01 \x01(\x11\x12\x12\n\x05\x65rror\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x88\x01\n\x0cProcessEvent\x12$\n\x05start\x18\x05 \x01(\x0b\x32\x13.process.StartEventH\x00\x12\"\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x12.process.DataEventH\x00\x12 \n\x03\x65nd\x18\x07 \x01(\x0b\x32\x11.process.EndEventH\x00\x42\x0c\n\nevent_type\"F\n\x0bKillRequest\x12\x0b\n\x03pid\x18\x01 \x01(\r\x12*\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32\x1a.permissions.AccessControl\"Z\n\x10SendInputRequest\x12\x0b\n\x03pid\x18\x01 \x01(\r\x12\r\n\x05stdin\x18\x02 \x01(\x0c\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl\"I\n\x0e\x43onnectRequest\x12\x0b\n\x03pid\x18\x01 \x01(\r\x12*\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32\x1a.permissions.AccessControl\"S\n\x16SendInputStreamRequest\x12\r\n\x05stdin\x18\x02 \x01(\x0c\x12*\n\x06\x61\x63\x63\x65ss\x18\x03 \x01(\x0b\x32\x1a.permissions.AccessControl2\xf1\x02\n\x07Process\x12\x33\n\x04List\x12\x14.process.ListRequest\x1a\x15.process.ListResponse\x12;\n\x07\x43onnect\x12\x17.process.ConnectRequest\x1a\x15.process.ProcessEvent0\x01\x12>\n\x05Start\x12\x1c.process.StartProcessRequest\x1a\x15.process.ProcessEvent0\x01\x12>\n\tSendInput\x12\x19.process.SendInputRequest\x1a\x16.google.protobuf.Empty\x12\x34\n\x04Kill\x12\x14.process.KillRequest\x1a\x16.google.protobuf.Empty\x12>\n\tResizePTY\x12\x19.process.ResizePTYRequest\x1a\x16.google.protobuf.EmptyB-Z+github.com/e2b-dev/infra/packages/envd/specb\x06proto3')
+
+_globals = globals()
+_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'process_pb2', _globals)
+if _descriptor._USE_C_DESCRIPTORS == False:
+ _globals['DESCRIPTOR']._options = None
+ _globals['DESCRIPTOR']._serialized_options = b'Z+github.com/e2b-dev/infra/packages/envd/spec'
+ _globals['_PROCESSCONFIG_ENVENTRY']._options = None
+ _globals['_PROCESSCONFIG_ENVENTRY']._serialized_options = b'8\001'
+ _globals['_PTYSIZE']._serialized_start=74
+ _globals['_PTYSIZE']._serialized_end=111
+ _globals['_PTY']._serialized_start=113
+ _globals['_PTY']._serialized_end=150
+ _globals['_PROCESSCONFIG']._serialized_start=153
+ _globals['_PROCESSCONFIG']._serialized_end=298
+ _globals['_PROCESSCONFIG_ENVENTRY']._serialized_start=256
+ _globals['_PROCESSCONFIG_ENVENTRY']._serialized_end=298
+ _globals['_LISTREQUEST']._serialized_start=300
+ _globals['_LISTREQUEST']._serialized_end=357
+ _globals['_LISTRESPONSE']._serialized_start=359
+ _globals['_LISTRESPONSE']._serialized_end=416
+ _globals['_STARTPROCESSREQUEST']._serialized_start=419
+ _globals['_STARTPROCESSREQUEST']._serialized_end=565
+ _globals['_RESIZEPTYREQUEST']._serialized_start=567
+ _globals['_RESIZEPTYREQUEST']._serialized_end=674
+ _globals['_STARTEVENT']._serialized_start=676
+ _globals['_STARTEVENT']._serialized_end=701
+ _globals['_DATAEVENT']._serialized_start=703
+ _globals['_DATAEVENT']._serialized_end=778
+ _globals['_ENDEVENT']._serialized_start=780
+ _globals['_ENDEVENT']._serialized_end=838
+ _globals['_PROCESSEVENT']._serialized_start=841
+ _globals['_PROCESSEVENT']._serialized_end=977
+ _globals['_KILLREQUEST']._serialized_start=979
+ _globals['_KILLREQUEST']._serialized_end=1049
+ _globals['_SENDINPUTREQUEST']._serialized_start=1051
+ _globals['_SENDINPUTREQUEST']._serialized_end=1141
+ _globals['_CONNECTREQUEST']._serialized_start=1143
+ _globals['_CONNECTREQUEST']._serialized_end=1216
+ _globals['_SENDINPUTSTREAMREQUEST']._serialized_start=1218
+ _globals['_SENDINPUTSTREAMREQUEST']._serialized_end=1301
+ _globals['_PROCESS']._serialized_start=1304
+ _globals['_PROCESS']._serialized_end=1673
+# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/process_pb2.pyi b/packages/python-sdk/process_pb2.pyi
new file mode 100644
index 000000000..483827f5c
--- /dev/null
+++ b/packages/python-sdk/process_pb2.pyi
@@ -0,0 +1,139 @@
+import permissions_pb2 as _permissions_pb2
+from google.protobuf import empty_pb2 as _empty_pb2
+from google.protobuf.internal import containers as _containers
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
+
+DESCRIPTOR: _descriptor.FileDescriptor
+
+class PTYSize(_message.Message):
+ __slots__ = ("cols", "rows")
+ COLS_FIELD_NUMBER: _ClassVar[int]
+ ROWS_FIELD_NUMBER: _ClassVar[int]
+ cols: int
+ rows: int
+ def __init__(self, cols: _Optional[int] = ..., rows: _Optional[int] = ...) -> None: ...
+
+class PTY(_message.Message):
+ __slots__ = ("size",)
+ SIZE_FIELD_NUMBER: _ClassVar[int]
+ size: PTYSize
+ def __init__(self, size: _Optional[_Union[PTYSize, _Mapping]] = ...) -> None: ...
+
+class ProcessConfig(_message.Message):
+ __slots__ = ("cmd", "args", "env", "cwd")
+ class EnvEntry(_message.Message):
+ __slots__ = ("key", "value")
+ KEY_FIELD_NUMBER: _ClassVar[int]
+ VALUE_FIELD_NUMBER: _ClassVar[int]
+ key: str
+ value: str
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
+ CMD_FIELD_NUMBER: _ClassVar[int]
+ ARGS_FIELD_NUMBER: _ClassVar[int]
+ ENV_FIELD_NUMBER: _ClassVar[int]
+ CWD_FIELD_NUMBER: _ClassVar[int]
+ cmd: str
+ args: _containers.RepeatedScalarFieldContainer[str]
+ env: _containers.ScalarMap[str, str]
+ cwd: str
+ def __init__(self, cmd: _Optional[str] = ..., args: _Optional[_Iterable[str]] = ..., env: _Optional[_Mapping[str, str]] = ..., cwd: _Optional[str] = ...) -> None: ...
+
+class ListRequest(_message.Message):
+ __slots__ = ("access",)
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ access: _permissions_pb2.AccessControl
+ def __init__(self, access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ListResponse(_message.Message):
+ __slots__ = ("processes",)
+ PROCESSES_FIELD_NUMBER: _ClassVar[int]
+ processes: _containers.RepeatedCompositeFieldContainer[ProcessConfig]
+ def __init__(self, processes: _Optional[_Iterable[_Union[ProcessConfig, _Mapping]]] = ...) -> None: ...
+
+class StartProcessRequest(_message.Message):
+ __slots__ = ("process", "pty", "access")
+ PROCESS_FIELD_NUMBER: _ClassVar[int]
+ PTY_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ process: ProcessConfig
+ pty: PTY
+ access: _permissions_pb2.AccessControl
+ def __init__(self, process: _Optional[_Union[ProcessConfig, _Mapping]] = ..., pty: _Optional[_Union[PTY, _Mapping]] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ResizePTYRequest(_message.Message):
+ __slots__ = ("pid", "size", "access")
+ PID_FIELD_NUMBER: _ClassVar[int]
+ SIZE_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ pid: int
+ size: PTYSize
+ access: _permissions_pb2.AccessControl
+ def __init__(self, pid: _Optional[int] = ..., size: _Optional[_Union[PTYSize, _Mapping]] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class StartEvent(_message.Message):
+ __slots__ = ("pid",)
+ PID_FIELD_NUMBER: _ClassVar[int]
+ pid: int
+ def __init__(self, pid: _Optional[int] = ...) -> None: ...
+
+class DataEvent(_message.Message):
+ __slots__ = ("stdout", "stderr")
+ STDOUT_FIELD_NUMBER: _ClassVar[int]
+ STDERR_FIELD_NUMBER: _ClassVar[int]
+ stdout: bytes
+ stderr: bytes
+ def __init__(self, stdout: _Optional[bytes] = ..., stderr: _Optional[bytes] = ...) -> None: ...
+
+class EndEvent(_message.Message):
+ __slots__ = ("exitCode", "error")
+ EXITCODE_FIELD_NUMBER: _ClassVar[int]
+ ERROR_FIELD_NUMBER: _ClassVar[int]
+ exitCode: int
+ error: str
+ def __init__(self, exitCode: _Optional[int] = ..., error: _Optional[str] = ...) -> None: ...
+
+class ProcessEvent(_message.Message):
+ __slots__ = ("start", "data", "end")
+ START_FIELD_NUMBER: _ClassVar[int]
+ DATA_FIELD_NUMBER: _ClassVar[int]
+ END_FIELD_NUMBER: _ClassVar[int]
+ start: StartEvent
+ data: DataEvent
+ end: EndEvent
+ def __init__(self, start: _Optional[_Union[StartEvent, _Mapping]] = ..., data: _Optional[_Union[DataEvent, _Mapping]] = ..., end: _Optional[_Union[EndEvent, _Mapping]] = ...) -> None: ...
+
+class KillRequest(_message.Message):
+ __slots__ = ("pid", "access")
+ PID_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ pid: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, pid: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class SendInputRequest(_message.Message):
+ __slots__ = ("pid", "stdin", "access")
+ PID_FIELD_NUMBER: _ClassVar[int]
+ STDIN_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ pid: int
+ stdin: bytes
+ access: _permissions_pb2.AccessControl
+ def __init__(self, pid: _Optional[int] = ..., stdin: _Optional[bytes] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class ConnectRequest(_message.Message):
+ __slots__ = ("pid", "access")
+ PID_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ pid: int
+ access: _permissions_pb2.AccessControl
+ def __init__(self, pid: _Optional[int] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
+
+class SendInputStreamRequest(_message.Message):
+ __slots__ = ("stdin", "access")
+ STDIN_FIELD_NUMBER: _ClassVar[int]
+ ACCESS_FIELD_NUMBER: _ClassVar[int]
+ stdin: bytes
+ access: _permissions_pb2.AccessControl
+ def __init__(self, stdin: _Optional[bytes] = ..., access: _Optional[_Union[_permissions_pb2.AccessControl, _Mapping]] = ...) -> None: ...
diff --git a/packages/python-sdk/process_pb2_grpc.py b/packages/python-sdk/process_pb2_grpc.py
new file mode 100644
index 000000000..63c6d29db
--- /dev/null
+++ b/packages/python-sdk/process_pb2_grpc.py
@@ -0,0 +1,232 @@
+# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
+"""Client and server classes corresponding to protobuf-defined services."""
+import grpc
+
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
+import process_pb2 as process__pb2
+
+
+class ProcessStub(object):
+ """Missing associated documentation comment in .proto file."""
+
+ def __init__(self, channel):
+ """Constructor.
+
+ Args:
+ channel: A grpc.Channel.
+ """
+ self.List = channel.unary_unary(
+ '/process.Process/List',
+ request_serializer=process__pb2.ListRequest.SerializeToString,
+ response_deserializer=process__pb2.ListResponse.FromString,
+ )
+ self.Connect = channel.unary_stream(
+ '/process.Process/Connect',
+ request_serializer=process__pb2.ConnectRequest.SerializeToString,
+ response_deserializer=process__pb2.ProcessEvent.FromString,
+ )
+ self.Start = channel.unary_stream(
+ '/process.Process/Start',
+ request_serializer=process__pb2.StartProcessRequest.SerializeToString,
+ response_deserializer=process__pb2.ProcessEvent.FromString,
+ )
+ self.SendInput = channel.unary_unary(
+ '/process.Process/SendInput',
+ request_serializer=process__pb2.SendInputRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.Kill = channel.unary_unary(
+ '/process.Process/Kill',
+ request_serializer=process__pb2.KillRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+ self.ResizePTY = channel.unary_unary(
+ '/process.Process/ResizePTY',
+ request_serializer=process__pb2.ResizePTYRequest.SerializeToString,
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ )
+
+
+class ProcessServicer(object):
+ """Missing associated documentation comment in .proto file."""
+
+ def List(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Connect(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Start(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def SendInput(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def Kill(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+ def ResizePTY(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+
+def add_ProcessServicer_to_server(servicer, server):
+ rpc_method_handlers = {
+ 'List': grpc.unary_unary_rpc_method_handler(
+ servicer.List,
+ request_deserializer=process__pb2.ListRequest.FromString,
+ response_serializer=process__pb2.ListResponse.SerializeToString,
+ ),
+ 'Connect': grpc.unary_stream_rpc_method_handler(
+ servicer.Connect,
+ request_deserializer=process__pb2.ConnectRequest.FromString,
+ response_serializer=process__pb2.ProcessEvent.SerializeToString,
+ ),
+ 'Start': grpc.unary_stream_rpc_method_handler(
+ servicer.Start,
+ request_deserializer=process__pb2.StartProcessRequest.FromString,
+ response_serializer=process__pb2.ProcessEvent.SerializeToString,
+ ),
+ 'SendInput': grpc.unary_unary_rpc_method_handler(
+ servicer.SendInput,
+ request_deserializer=process__pb2.SendInputRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'Kill': grpc.unary_unary_rpc_method_handler(
+ servicer.Kill,
+ request_deserializer=process__pb2.KillRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ 'ResizePTY': grpc.unary_unary_rpc_method_handler(
+ servicer.ResizePTY,
+ request_deserializer=process__pb2.ResizePTYRequest.FromString,
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ ),
+ }
+ generic_handler = grpc.method_handlers_generic_handler(
+ 'process.Process', rpc_method_handlers)
+ server.add_generic_rpc_handlers((generic_handler,))
+
+
+ # This class is part of an EXPERIMENTAL API.
+class Process(object):
+ """Missing associated documentation comment in .proto file."""
+
+ @staticmethod
+ def List(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/process.Process/List',
+ process__pb2.ListRequest.SerializeToString,
+ process__pb2.ListResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Connect(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_stream(request, target, '/process.Process/Connect',
+ process__pb2.ConnectRequest.SerializeToString,
+ process__pb2.ProcessEvent.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Start(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_stream(request, target, '/process.Process/Start',
+ process__pb2.StartProcessRequest.SerializeToString,
+ process__pb2.ProcessEvent.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def SendInput(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/process.Process/SendInput',
+ process__pb2.SendInputRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def Kill(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/process.Process/Kill',
+ process__pb2.KillRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def ResizePTY(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/process.Process/ResizePTY',
+ process__pb2.ResizePTYRequest.SerializeToString,
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/packages/python-sdk/pyproject.toml b/packages/python-sdk/pyproject.toml
index 77d34fd2e..6981fecf5 100644
--- a/packages/python-sdk/pyproject.toml
+++ b/packages/python-sdk/pyproject.toml
@@ -21,6 +21,7 @@ websockets = ">=11.0.3"
jsonrpcclient = ">=4.0.3"
requests = ">=2.31.0"
typing-extensions = ">=4.8.0"
+grpcio = "^1.62.2"
[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
@@ -29,6 +30,7 @@ pytest-xdist = "^3.3.1"
python-dotenv = "^1.0.0"
pytest-dotenv = "^0.5.2"
openai = "^1.2.3"
+grpcio-tools = "^1.62.2"
[build-system]
requires = ["poetry-core"]
diff --git a/spec/envd.yml b/spec/envd.yml
new file mode 100644
index 000000000..a57c13ea4
--- /dev/null
+++ b/spec/envd.yml
@@ -0,0 +1,142 @@
+openapi: 3.0.0
+info:
+ title: envd
+ version: 0.1.0
+ description: API for managing file operations within the envd service sandbox
+
+paths:
+ /{path}:
+ get:
+ summary: Download a file or a specific byte range from the sandbox
+ parameters:
+ - $ref: "#/components/parameters/FilePath"
+ - $ref: "#/components/parameters/Range"
+ responses:
+ "200":
+ $ref: "#/components/responses/FileDownloadSuccess"
+ "206":
+ $ref: "#/components/responses/PartialContent"
+ "400":
+ $ref: "#/components/responses/DirectoryPathError"
+ "416":
+ $ref: "#/components/responses/RangeNotSatisfiableError"
+ post:
+ summary: Upload a file to the sandbox
+ parameters:
+ - $ref: "#/components/parameters/FilePath"
+ - $ref: "#/components/parameters/User"
+ - $ref: "#/components/parameters/Mode"
+ - $ref: "#/components/parameters/Overwrite"
+ - $ref: "#/components/parameters/Range"
+ requestBody:
+ $ref: "#/components/requestBodies/FileUpload"
+ responses:
+ "200":
+ description: The file was uploaded successfully.
+ "409":
+ $ref: "#/components/responses/ConflictError"
+ "400":
+ $ref: "#/components/responses/DirectoryPathError"
+ "416":
+ $ref: "#/components/responses/RangeNotSatisfiableError"
+
+components:
+ parameters:
+ FilePath:
+ name: path
+ in: path
+ required: true
+ allowReserved: true
+ allowEmptyValue: false
+ description: Absolute path in the sandbox to the file, URL encoded.
+ schema:
+ type: string
+ Range:
+ name: Range
+ in: header
+ required: false
+ description: Byte range for downloading or uploading a file, formatted as "bytes=start-end" for downloads and "bytes=start-end/total" for uploads.
+ schema:
+ type: string
+ pattern: '^bytes=\d*-\d*(,\d*-\d*)*|bytes \d*-\d*/\d+$'
+ User:
+ name: User
+ in: header
+ required: false
+ description: User owning the file
+ schema:
+ type: string
+ default: "root"
+ Mode:
+ name: Mode
+ in: header
+ required: false
+ description: File permissions in octal format (e.g., 0755)
+ schema:
+ type: string
+ default: "0644"
+ pattern: "^[0-7]{3,4}$"
+ Overwrite:
+ name: overwrite
+ in: header
+ required: false
+ description: Overwrite the file if it exists
+ schema:
+ type: boolean
+ default: false
+ requestBodies:
+ FileUpload:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ file:
+ type: string
+ format: binary
+ responses:
+ FileDownloadSuccess:
+ description: Entire file downloaded successfully.
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ format: binary
+ PartialContent:
+ description: Specified byte range(s) of the file downloaded successfully.
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ format: binary
+ DirectoryPathError:
+ description: Bad Request - The specified path is a directory. Only files can be downloaded.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ example: "The specified path is a directory. Only files can be downloaded."
+ RangeNotSatisfiableError:
+ description: Requested Range Not Satisfiable - The specified byte range is outside the size of the file, or the Range header is formatted incorrectly.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ example: "The specified byte range is outside the size of the file, or the Range header is formatted incorrectly."
+ ConflictError:
+ description: Conflict - The file already exists and overwrite is false.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ example: "The file already exists and overwrite is false."
diff --git a/spec/filesystem.proto b/spec/filesystem.proto
new file mode 100644
index 000000000..d5514a55d
--- /dev/null
+++ b/spec/filesystem.proto
@@ -0,0 +1,175 @@
+syntax = "proto3";
+
+import "google/protobuf/empty.proto";
+import "permissions.proto";
+
+option go_package = "github.com/e2b-dev/infra/packages/envd/spec";
+
+package filesystem;
+
+service Filesystem {
+ rpc Stat(StatRequest) returns (StatResponse);
+
+ rpc CreateFile(CreateFileRequest) returns (google.protobuf.Empty);
+ rpc ReadFile(ReadFileRequest) returns (stream ReadFileResponse);
+ rpc WriteFile(WriteFileRequest) returns (google.protobuf.Empty);
+
+ rpc MakeDir(MakeDirRequest) returns (google.protobuf.Empty);
+ rpc ReadDir(ReadDirRequest) returns (ReadDirResponse);
+
+ rpc CreateLink(CreateLinkRequest) returns (google.protobuf.Empty);
+ rpc CreateSymlink(CreateSymlinkRequest) returns (google.protobuf.Empty);
+
+ rpc Watch(WatchRequest) returns (stream FilesystemEvent);
+ rpc Rename(MoveRequest) returns (google.protobuf.Empty);
+ rpc Remove(RemoveRequest) returns (google.protobuf.Empty);
+
+ rpc Chmod(ChmodRequest) returns (google.protobuf.Empty);
+ rpc Chown(ChownRequest) returns (google.protobuf.Empty);
+
+ rpc Copy(CopyRequest) returns (google.protobuf.Empty);
+}
+
+message CreateFileRequest {
+ string path = 1;
+ bool create_parents = 2;
+
+ permissions.AccessControl access = 3;
+}
+
+message MakeDirRequest {
+ string path = 1;
+ bool create_parents = 2;
+ uint32 mode = 3;
+
+ permissions.AccessControl access = 4;
+}
+
+message CreateLinkRequest {
+ string source = 1;
+ string destination = 2;
+ permissions.AccessControl access = 3;
+}
+
+message CreateSymlinkRequest {
+ string source = 1;
+ string destination = 2;
+ permissions.AccessControl access = 3;
+}
+
+message CopyRequest {
+ string source = 1;
+ string destination = 2;
+ bool recursive = 3;
+ permissions.AccessControl access = 4;
+}
+
+message ChmodRequest {
+ string path = 1;
+ uint32 mode = 2;
+ permissions.AccessControl access = 3;
+}
+
+message ChownRequest {
+ string path = 1;
+ uint32 uid = 2;
+ uint32 gid = 3;
+ permissions.AccessControl access = 4;
+}
+
+message ReadFileRequest {
+ string path = 1;
+
+ // If specified, the file is read from the given byte offset.
+ optional uint64 offset = 3;
+ // If specified, the file is read up to this many bytes.
+ optional uint64 length = 4;
+
+ permissions.AccessControl access = 5;
+}
+
+message ReadFileResponse {
+ bytes data = 1;
+}
+
+message StatRequest {
+ string path = 1;
+ permissions.AccessControl access = 2;
+}
+
+message StatResponse {
+ EntryInfo entry = 1;
+}
+
+message WriteFileRequest {
+ string path = 1;
+ bytes data = 2;
+
+ bool create_if_not_exists = 3;
+ bool append = 4;
+
+ // If specified, the file is written at the given byte offset.
+ optional uint64 offset = 5;
+ // If specified, the new data overwrites the existing data with this length at the given byte offset.
+ optional uint64 length = 6;
+
+ permissions.AccessControl access = 7;
+}
+
+message RemoveRequest {
+ string path = 1;
+ bool all = 2;
+ permissions.AccessControl access = 3;
+}
+
+message MoveRequest {
+ string source = 1;
+ string destination = 2;
+ permissions.AccessControl access = 3;
+}
+
+message EntryInfo {
+ string name = 1;
+ FileType type = 2;
+ uint32 mode = 3;
+ uint64 size = 4;
+ uint64 last_modified = 5;
+ permissions.AccessControl owner = 6;
+}
+
+message ReadDirRequest {
+ string path = 1;
+ permissions.AccessControl access = 2;
+}
+
+message ReadDirResponse {
+ repeated EntryInfo entries = 1;
+}
+
+message WatchRequest {
+ string path = 1;
+ permissions.AccessControl access = 2;
+}
+
+enum FileType {
+ UNKNOWN_FileType = 0;
+ FILE = 1;
+ DIRECTORY = 2;
+ LINK = 3;
+ SYMLINK = 4;
+}
+
+enum EventType {
+ UNKNOWN_EventType = 0;
+ CREATE = 1;
+ WRITE = 2;
+ REMOVE = 3;
+ RENAME = 4;
+ CHMOD = 5;
+}
+
+message FilesystemEvent {
+ string path = 1;
+ EventType type = 2;
+ EntryInfo entry = 3;
+}
diff --git a/spec/network.proto b/spec/network.proto
new file mode 100644
index 000000000..e4f20283e
--- /dev/null
+++ b/spec/network.proto
@@ -0,0 +1,46 @@
+syntax = "proto3";
+
+import "permissions.proto";
+import "google/protobuf/empty.proto";
+
+option go_package = "github.com/e2b-dev/infra/packages/envd/spec";
+
+package network;
+
+service Network {
+ rpc ConfigurePort(ConfigurePortRequest) returns (google.protobuf.Empty);
+ rpc ListPorts(ListPortsRequest) returns (ListPortsResponse);
+ rpc WatchPorts(WatchPortsRequest) returns (stream Port);
+}
+
+message ConfigurePortRequest {
+ uint32 port = 1;
+ PortState state = 2;
+
+ permissions.AccessControl access = 3;
+}
+
+message ListPortsRequest {
+ permissions.AccessControl access = 1;
+}
+
+message ListPortsResponse {
+ repeated Port ports = 1;
+}
+
+message WatchPortsRequest {
+ repeated uint32 ports = 1;
+
+ permissions.AccessControl access = 2;
+}
+
+enum PortState {
+ UNKNOWN_PortState = 0;
+ OPEN = 1;
+ CLOSE = 2;
+}
+
+message Port {
+ uint32 port = 1;
+ PortState state = 2;
+}
diff --git a/spec/permissions.proto b/spec/permissions.proto
new file mode 100644
index 000000000..ef670771a
--- /dev/null
+++ b/spec/permissions.proto
@@ -0,0 +1,9 @@
+syntax = "proto3";
+
+package permissions;
+
+option go_package = "github.com/e2b-dev/infra/packages/envd/spec";
+
+message AccessControl {
+ optional string user = 1;
+}
diff --git a/spec/process.proto b/spec/process.proto
new file mode 100644
index 000000000..7ae1f3f2d
--- /dev/null
+++ b/spec/process.proto
@@ -0,0 +1,108 @@
+syntax = "proto3";
+
+import "permissions.proto";
+import "google/protobuf/empty.proto";
+
+option go_package = "github.com/e2b-dev/infra/packages/envd/spec";
+
+package process;
+
+service Process {
+ rpc List(ListRequest) returns (ListResponse);
+
+ rpc Connect(ConnectRequest) returns (stream ProcessEvent);
+ rpc Start(StartProcessRequest) returns (stream ProcessEvent);
+
+ rpc SendInput(SendInputRequest) returns (google.protobuf.Empty);
+ rpc Kill(KillRequest) returns (google.protobuf.Empty);
+
+ rpc ResizePTY(ResizePTYRequest) returns (google.protobuf.Empty);
+}
+
+message PTYSize {
+ uint32 cols = 1;
+ uint32 rows = 2;
+}
+
+message PTY {
+ PTYSize size = 1;
+}
+
+message ProcessConfig {
+ string cmd = 1;
+ repeated string args = 2;
+
+ map<string, string> env = 3;
+ string cwd = 4;
+}
+
+message ListRequest {
+ permissions.AccessControl access = 1;
+}
+
+message ListResponse {
+ repeated ProcessConfig processes = 1;
+}
+
+message StartProcessRequest {
+ ProcessConfig process = 1;
+ optional PTY pty = 2;
+
+ permissions.AccessControl access = 3;
+}
+
+message ResizePTYRequest {
+ uint32 pid = 1;
+
+ PTYSize size = 2;
+
+ permissions.AccessControl access = 3;
+}
+
+message StartEvent {
+ uint32 pid = 1;
+}
+
+message DataEvent {
+ optional bytes stdout = 1;
+ optional bytes stderr = 2;
+}
+
+message EndEvent {
+ sint32 exitCode = 1;
+ optional string error = 2;
+}
+
+message ProcessEvent {
+ oneof event_type {
+ StartEvent start = 5;
+ DataEvent data = 6;
+ EndEvent end = 7;
+ }
+}
+
+message KillRequest {
+ uint32 pid = 1;
+
+ permissions.AccessControl access = 2;
+}
+
+message SendInputRequest {
+ uint32 pid = 1;
+
+ bytes stdin = 2;
+
+ permissions.AccessControl access = 3;
+}
+
+message ConnectRequest {
+ uint32 pid = 1;
+
+ permissions.AccessControl access = 2;
+}
+
+message SendInputStreamRequest {
+ bytes stdin = 2;
+
+ permissions.AccessControl access = 3;
+}