diff --git a/crates/openshell-core/src/proto/openshell.datamodel.v1.rs b/crates/openshell-core/src/proto/openshell.datamodel.v1.rs deleted file mode 100644 index 310497d1a..000000000 --- a/crates/openshell-core/src/proto/openshell.datamodel.v1.rs +++ /dev/null @@ -1,146 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -// This file is @generated by prost-build. -/// Sandbox model stored by OpenShell. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Sandbox { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub namespace: ::prost::alloc::string::String, - #[prost(message, optional, tag = "4")] - pub spec: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub status: ::core::option::Option, - #[prost(enumeration = "SandboxPhase", tag = "6")] - pub phase: i32, -} -/// OpenShell-level sandbox spec. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxSpec { - #[prost(string, tag = "1")] - pub log_level: ::prost::alloc::string::String, - #[prost(map = "string, string", tag = "5")] - pub environment: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub template: ::core::option::Option, - /// Required sandbox policy configuration. - #[prost(message, optional, tag = "7")] - pub policy: ::core::option::Option, - /// Provider names to attach to this sandbox. - #[prost(string, repeated, tag = "8")] - pub providers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Sandbox template mapped onto Kubernetes pod template inputs. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxTemplate { - #[prost(string, tag = "1")] - pub image: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub runtime_class_name: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub agent_socket: ::prost::alloc::string::String, - #[prost(map = "string, string", tag = "4")] - pub labels: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - #[prost(map = "string, string", tag = "5")] - pub annotations: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - #[prost(map = "string, string", tag = "6")] - pub environment: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub resources: ::core::option::Option<::prost_types::Struct>, - #[prost(message, optional, tag = "9")] - pub volume_claim_templates: ::core::option::Option<::prost_types::Struct>, -} -/// Sandbox status captured from Kubernetes. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxStatus { - #[prost(string, tag = "1")] - pub sandbox_name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub agent_pod: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub agent_fd: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub sandbox_fd: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "5")] - pub conditions: ::prost::alloc::vec::Vec, -} -/// Sandbox condition mirrors Kubernetes conditions. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxCondition { - #[prost(string, tag = "1")] - pub r#type: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub status: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub reason: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub message: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub last_transition_time: ::prost::alloc::string::String, -} -/// Provider model stored by OpenShell. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Provider { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - /// Canonical provider type slug (for example: "claude", "gitlab"). - #[prost(string, tag = "3")] - pub r#type: ::prost::alloc::string::String, - /// Secret values used for authentication. - #[prost(map = "string, string", tag = "4")] - pub credentials: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - /// Non-secret provider configuration. - #[prost(map = "string, string", tag = "5")] - pub config: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, -} -/// High-level sandbox lifecycle phase. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum SandboxPhase { - Unspecified = 0, - Provisioning = 1, - Ready = 2, - Error = 3, - Deleting = 4, - Unknown = 5, -} -impl SandboxPhase { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "SANDBOX_PHASE_UNSPECIFIED", - Self::Provisioning => "SANDBOX_PHASE_PROVISIONING", - Self::Ready => "SANDBOX_PHASE_READY", - Self::Error => "SANDBOX_PHASE_ERROR", - Self::Deleting => "SANDBOX_PHASE_DELETING", - Self::Unknown => "SANDBOX_PHASE_UNKNOWN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SANDBOX_PHASE_UNSPECIFIED" => Some(Self::Unspecified), - "SANDBOX_PHASE_PROVISIONING" => Some(Self::Provisioning), - "SANDBOX_PHASE_READY" => Some(Self::Ready), - "SANDBOX_PHASE_ERROR" => Some(Self::Error), - "SANDBOX_PHASE_DELETING" => Some(Self::Deleting), - "SANDBOX_PHASE_UNKNOWN" => Some(Self::Unknown), - _ => None, - } - } -} diff --git a/crates/openshell-core/src/proto/openshell.sandbox.v1.rs b/crates/openshell-core/src/proto/openshell.sandbox.v1.rs deleted file mode 100644 index c7fbb178b..000000000 --- a/crates/openshell-core/src/proto/openshell.sandbox.v1.rs +++ /dev/null @@ -1,160 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -// This file is @generated by prost-build. -/// Sandbox security policy configuration. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxPolicy { - /// Policy version. - #[prost(uint32, tag = "1")] - pub version: u32, - /// Filesystem access policy. - #[prost(message, optional, tag = "2")] - pub filesystem: ::core::option::Option, - /// Network access policy. - #[prost(message, optional, tag = "3")] - pub network: ::core::option::Option, - /// Landlock configuration. - #[prost(message, optional, tag = "4")] - pub landlock: ::core::option::Option, - /// Process execution policy. - #[prost(message, optional, tag = "5")] - pub process: ::core::option::Option, -} -/// Filesystem access policy. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FilesystemPolicy { - /// Read-only directory allow list. - #[prost(string, repeated, tag = "1")] - pub read_only: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Read-write directory allow list. - #[prost(string, repeated, tag = "2")] - pub read_write: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Automatically include the workdir as read-write. - #[prost(bool, tag = "3")] - pub include_workdir: bool, -} -/// Network access policy. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NetworkPolicy { - /// Network access mode. - #[prost(enumeration = "NetworkMode", tag = "1")] - pub mode: i32, - /// Proxy configuration (required when mode is PROXY). - #[prost(message, optional, tag = "2")] - pub proxy: ::core::option::Option, -} -/// Proxy configuration for network policy. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProxyPolicy { - /// Unix socket path for a local proxy (preferred for strict seccomp rules). - #[prost(string, tag = "1")] - pub unix_socket: ::prost::alloc::string::String, - /// TCP address for a local HTTP proxy (loopback-only). - #[prost(string, tag = "2")] - pub http_addr: ::prost::alloc::string::String, - /// Allowed hostnames for proxy traffic. Empty means allow all. - #[prost(string, repeated, tag = "3")] - pub allow_hosts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Landlock policy configuration. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct LandlockPolicy { - /// Compatibility mode. - #[prost(enumeration = "LandlockCompatibility", tag = "1")] - pub compatibility: i32, -} -/// Process execution policy. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProcessPolicy { - /// User name to run the sandboxed process as. - #[prost(string, tag = "1")] - pub run_as_user: ::prost::alloc::string::String, - /// Group name to run the sandboxed process as. - #[prost(string, tag = "2")] - pub run_as_group: ::prost::alloc::string::String, -} -/// Request to get sandbox policy by sandbox ID. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetSandboxPolicyRequest { - /// The sandbox ID. - #[prost(string, tag = "1")] - pub sandbox_id: ::prost::alloc::string::String, -} -/// Response containing sandbox policy. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetSandboxPolicyResponse { - /// The sandbox policy configuration. - #[prost(message, optional, tag = "1")] - pub policy: ::core::option::Option, -} -/// Network access mode. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum NetworkMode { - /// Unspecified defaults to BLOCK. - Unspecified = 0, - /// Block all network access. - Block = 1, - /// Route traffic through a proxy. - Proxy = 2, - /// Allow all network access. - Allow = 3, -} -impl NetworkMode { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "NETWORK_MODE_UNSPECIFIED", - Self::Block => "NETWORK_MODE_BLOCK", - Self::Proxy => "NETWORK_MODE_PROXY", - Self::Allow => "NETWORK_MODE_ALLOW", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NETWORK_MODE_UNSPECIFIED" => Some(Self::Unspecified), - "NETWORK_MODE_BLOCK" => Some(Self::Block), - "NETWORK_MODE_PROXY" => Some(Self::Proxy), - "NETWORK_MODE_ALLOW" => Some(Self::Allow), - _ => None, - } - } -} -/// Landlock compatibility mode. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LandlockCompatibility { - /// Unspecified defaults to BEST_EFFORT. - Unspecified = 0, - /// Use best effort - degrade gracefully on older kernels. - BestEffort = 1, - /// Require full Landlock support or fail. - HardRequirement = 2, -} -impl LandlockCompatibility { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "LANDLOCK_COMPATIBILITY_UNSPECIFIED", - Self::BestEffort => "LANDLOCK_COMPATIBILITY_BEST_EFFORT", - Self::HardRequirement => "LANDLOCK_COMPATIBILITY_HARD_REQUIREMENT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "LANDLOCK_COMPATIBILITY_UNSPECIFIED" => Some(Self::Unspecified), - "LANDLOCK_COMPATIBILITY_BEST_EFFORT" => Some(Self::BestEffort), - "LANDLOCK_COMPATIBILITY_HARD_REQUIREMENT" => Some(Self::HardRequirement), - _ => None, - } - } -} diff --git a/crates/openshell-core/src/proto/openshell.test.v1.rs b/crates/openshell-core/src/proto/openshell.test.v1.rs deleted file mode 100644 index 319b3fd3a..000000000 --- a/crates/openshell-core/src/proto/openshell.test.v1.rs +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -// This file is @generated by prost-build. -/// Simple object for persistence tests. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ObjectForTest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(uint32, tag = "3")] - pub count: u32, -} diff --git a/crates/openshell-core/src/proto/openshell.v1.rs b/crates/openshell-core/src/proto/openshell.v1.rs deleted file mode 100644 index a2735b076..000000000 --- a/crates/openshell-core/src/proto/openshell.v1.rs +++ /dev/null @@ -1,1188 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -// This file is @generated by prost-build. -/// Health check request. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct HealthRequest {} -/// Health check response. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HealthResponse { - /// Service status. - #[prost(enumeration = "ServiceStatus", tag = "1")] - pub status: i32, - /// Service version. - #[prost(string, tag = "2")] - pub version: ::prost::alloc::string::String, -} -/// Create sandbox request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateSandboxRequest { - #[prost(message, optional, tag = "1")] - pub spec: ::core::option::Option, - /// Optional user-supplied sandbox name. When empty the server generates one. - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, -} -/// Get sandbox request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetSandboxRequest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, -} -/// List sandboxes request. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ListSandboxesRequest { - #[prost(uint32, tag = "1")] - pub limit: u32, - #[prost(uint32, tag = "2")] - pub offset: u32, -} -/// Delete sandbox request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteSandboxRequest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, -} -/// Sandbox response. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxResponse { - #[prost(message, optional, tag = "1")] - pub sandbox: ::core::option::Option, -} -/// List sandboxes response. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListSandboxesResponse { - #[prost(message, repeated, tag = "1")] - pub sandboxes: ::prost::alloc::vec::Vec, -} -/// Delete sandbox response. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct DeleteSandboxResponse { - #[prost(bool, tag = "1")] - pub deleted: bool, -} -/// Create SSH session request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateSshSessionRequest { - /// Sandbox id. - #[prost(string, tag = "1")] - pub sandbox_id: ::prost::alloc::string::String, -} -/// Create SSH session response. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateSshSessionResponse { - /// Sandbox id. - #[prost(string, tag = "1")] - pub sandbox_id: ::prost::alloc::string::String, - /// Session token for the gateway tunnel. - #[prost(string, tag = "2")] - pub token: ::prost::alloc::string::String, - /// Gateway host for SSH proxy connection. - #[prost(string, tag = "3")] - pub gateway_host: ::prost::alloc::string::String, - /// Gateway port for SSH proxy connection. - #[prost(uint32, tag = "4")] - pub gateway_port: u32, - /// Gateway scheme (http or https). - #[prost(string, tag = "5")] - pub gateway_scheme: ::prost::alloc::string::String, - /// HTTP path for the CONNECT/upgrade endpoint. - #[prost(string, tag = "6")] - pub connect_path: ::prost::alloc::string::String, - /// Optional host key fingerprint. - #[prost(string, tag = "7")] - pub host_key_fingerprint: ::prost::alloc::string::String, -} -/// Revoke SSH session request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RevokeSshSessionRequest { - /// Session token to revoke. - #[prost(string, tag = "1")] - pub token: ::prost::alloc::string::String, -} -/// Revoke SSH session response. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RevokeSshSessionResponse { - /// True when a session was revoked. - #[prost(bool, tag = "1")] - pub revoked: bool, -} -/// SSH session record stored in persistence. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SshSession { - /// Unique id (token). - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// Sandbox id. - #[prost(string, tag = "2")] - pub sandbox_id: ::prost::alloc::string::String, - /// Session token. - #[prost(string, tag = "3")] - pub token: ::prost::alloc::string::String, - /// Creation timestamp in milliseconds since epoch. - #[prost(int64, tag = "4")] - pub created_at_ms: i64, - /// Revoked flag. - #[prost(bool, tag = "5")] - pub revoked: bool, -} -/// Watch sandbox request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WatchSandboxRequest { - /// Sandbox id. - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// Stream sandbox status snapshots. - #[prost(bool, tag = "2")] - pub follow_status: bool, - /// Stream openshell-server process logs correlated to this sandbox. - #[prost(bool, tag = "3")] - pub follow_logs: bool, - /// Stream platform events correlated to this sandbox. - #[prost(bool, tag = "4")] - pub follow_events: bool, - /// Replay the last N log lines (best-effort) before following. - #[prost(uint32, tag = "5")] - pub log_tail_lines: u32, - /// Replay the last N platform events (best-effort) before following. - #[prost(uint32, tag = "6")] - pub event_tail: u32, - /// Stop streaming once the sandbox reaches a terminal phase (READY or ERROR). - #[prost(bool, tag = "7")] - pub stop_on_terminal: bool, -} -/// One event in a sandbox watch stream. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxStreamEvent { - #[prost(oneof = "sandbox_stream_event::Payload", tags = "1, 2, 3, 4")] - pub payload: ::core::option::Option, -} -/// Nested message and enum types in `SandboxStreamEvent`. -pub mod sandbox_stream_event { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Payload { - /// Latest sandbox snapshot. - #[prost(message, tag = "1")] - Sandbox(super::super::datamodel::v1::Sandbox), - /// One server log line/event. - #[prost(message, tag = "2")] - Log(super::SandboxLogLine), - /// One platform event. - #[prost(message, tag = "3")] - Event(super::PlatformEvent), - /// Warning from the server (e.g. missed messages due to lag). - #[prost(message, tag = "4")] - Warning(super::SandboxStreamWarning), - } -} -/// OpenShell server process log line correlated to a sandbox. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxLogLine { - #[prost(string, tag = "1")] - pub sandbox_id: ::prost::alloc::string::String, - #[prost(int64, tag = "2")] - pub timestamp_ms: i64, - #[prost(string, tag = "3")] - pub level: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub target: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub message: ::prost::alloc::string::String, -} -/// Platform event correlated to a sandbox. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PlatformEvent { - /// Event timestamp in milliseconds since epoch. - #[prost(int64, tag = "1")] - pub timestamp_ms: i64, - /// Event source (e.g. "kubernetes", "docker", "process"). - #[prost(string, tag = "2")] - pub source: ::prost::alloc::string::String, - /// Event type/severity (e.g. "Normal", "Warning"). - #[prost(string, tag = "3")] - pub r#type: ::prost::alloc::string::String, - /// Short reason code (e.g. "Started", "Pulled", "Failed"). - #[prost(string, tag = "4")] - pub reason: ::prost::alloc::string::String, - /// Human-readable event message. - #[prost(string, tag = "5")] - pub message: ::prost::alloc::string::String, - /// Optional metadata as key-value pairs. - #[prost(map = "string, string", tag = "6")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SandboxStreamWarning { - #[prost(string, tag = "1")] - pub message: ::prost::alloc::string::String, -} -/// Service status enum. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ServiceStatus { - Unspecified = 0, - Healthy = 1, - Degraded = 2, - Unhealthy = 3, -} -impl ServiceStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "SERVICE_STATUS_UNSPECIFIED", - Self::Healthy => "SERVICE_STATUS_HEALTHY", - Self::Degraded => "SERVICE_STATUS_DEGRADED", - Self::Unhealthy => "SERVICE_STATUS_UNHEALTHY", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SERVICE_STATUS_UNSPECIFIED" => Some(Self::Unspecified), - "SERVICE_STATUS_HEALTHY" => Some(Self::Healthy), - "SERVICE_STATUS_DEGRADED" => Some(Self::Degraded), - "SERVICE_STATUS_UNHEALTHY" => Some(Self::Unhealthy), - _ => None, - } - } -} -/// Generated client implementations. -pub mod open_shell_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// OpenShell service provides agent execution and management capabilities. - #[derive(Debug, Clone)] - pub struct OpenShellClient { - inner: tonic::client::Grpc, - } - impl OpenShellClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl OpenShellClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> OpenShellClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - OpenShellClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Check the health of the service. - pub async fn health( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/Health", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "Health")); - self.inner.unary(req, path, codec).await - } - /// Create a new sandbox. - pub async fn create_sandbox( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/CreateSandbox", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "CreateSandbox")); - self.inner.unary(req, path, codec).await - } - /// Fetch a sandbox by id. - pub async fn get_sandbox( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/GetSandbox", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "GetSandbox")); - self.inner.unary(req, path, codec).await - } - /// List sandboxes. - pub async fn list_sandboxes( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/ListSandboxes", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "ListSandboxes")); - self.inner.unary(req, path, codec).await - } - /// Delete a sandbox by id. - pub async fn delete_sandbox( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/DeleteSandbox", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "DeleteSandbox")); - self.inner.unary(req, path, codec).await - } - /// Create a short-lived SSH session for a sandbox. - pub async fn create_ssh_session( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/CreateSshSession", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "CreateSshSession")); - self.inner.unary(req, path, codec).await - } - /// Revoke a previously issued SSH session. - pub async fn revoke_ssh_session( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/RevokeSshSession", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "RevokeSshSession")); - self.inner.unary(req, path, codec).await - } - /// Get sandbox policy by id (called by sandbox entrypoint at startup). - pub async fn get_sandbox_policy( - &mut self, - request: impl tonic::IntoRequest< - super::super::sandbox::v1::GetSandboxPolicyRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/GetSandboxPolicy", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "GetSandboxPolicy")); - self.inner.unary(req, path, codec).await - } - /// Watch a sandbox and stream updates. - /// - /// This stream can include: - /// - Sandbox status snapshots (phase/status) - /// - OpenShell server process logs correlated by sandbox_id - /// - Platform events correlated to the sandbox - pub async fn watch_sandbox( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/openshell.v1.OpenShell/WatchSandbox", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("openshell.v1.OpenShell", "WatchSandbox")); - self.inner.server_streaming(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod open_shell_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with OpenShellServer. - #[async_trait] - pub trait OpenShell: std::marker::Send + std::marker::Sync + 'static { - /// Check the health of the service. - async fn health( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Create a new sandbox. - async fn create_sandbox( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Fetch a sandbox by id. - async fn get_sandbox( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// List sandboxes. - async fn list_sandboxes( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delete a sandbox by id. - async fn delete_sandbox( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Create a short-lived SSH session for a sandbox. - async fn create_ssh_session( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Revoke a previously issued SSH session. - async fn revoke_ssh_session( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get sandbox policy by id (called by sandbox entrypoint at startup). - async fn get_sandbox_policy( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Server streaming response type for the WatchSandbox method. - type WatchSandboxStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result, - > - + std::marker::Send - + 'static; - /// Watch a sandbox and stream updates. - /// - /// This stream can include: - /// - Sandbox status snapshots (phase/status) - /// - OpenShell server process logs correlated by sandbox_id - /// - Platform events correlated to the sandbox - async fn watch_sandbox( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// OpenShell service provides agent execution and management capabilities. - #[derive(Debug)] - pub struct OpenShellServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl OpenShellServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for OpenShellServer - where - T: OpenShell, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - match req.uri().path() { - "/openshell.v1.OpenShell/Health" => { - #[allow(non_camel_case_types)] - struct HealthSvc(pub Arc); - impl tonic::server::UnaryService - for HealthSvc { - type Response = super::HealthResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::health(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = HealthSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/CreateSandbox" => { - #[allow(non_camel_case_types)] - struct CreateSandboxSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService - for CreateSandboxSvc { - type Response = super::SandboxResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_sandbox(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = CreateSandboxSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/GetSandbox" => { - #[allow(non_camel_case_types)] - struct GetSandboxSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService - for GetSandboxSvc { - type Response = super::SandboxResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_sandbox(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = GetSandboxSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/ListSandboxes" => { - #[allow(non_camel_case_types)] - struct ListSandboxesSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService - for ListSandboxesSvc { - type Response = super::ListSandboxesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::list_sandboxes(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = ListSandboxesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/DeleteSandbox" => { - #[allow(non_camel_case_types)] - struct DeleteSandboxSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService - for DeleteSandboxSvc { - type Response = super::DeleteSandboxResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_sandbox(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = DeleteSandboxSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/CreateSshSession" => { - #[allow(non_camel_case_types)] - struct CreateSshSessionSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService - for CreateSshSessionSvc { - type Response = super::CreateSshSessionResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_ssh_session(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = CreateSshSessionSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/RevokeSshSession" => { - #[allow(non_camel_case_types)] - struct RevokeSshSessionSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService - for RevokeSshSessionSvc { - type Response = super::RevokeSshSessionResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::revoke_ssh_session(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = RevokeSshSessionSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/GetSandboxPolicy" => { - #[allow(non_camel_case_types)] - struct GetSandboxPolicySvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::UnaryService< - super::super::sandbox::v1::GetSandboxPolicyRequest, - > for GetSandboxPolicySvc { - type Response = super::super::sandbox::v1::GetSandboxPolicyResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::sandbox::v1::GetSandboxPolicyRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_sandbox_policy(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = GetSandboxPolicySvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/openshell.v1.OpenShell/WatchSandbox" => { - #[allow(non_camel_case_types)] - struct WatchSandboxSvc(pub Arc); - impl< - T: OpenShell, - > tonic::server::ServerStreamingService - for WatchSandboxSvc { - type Response = super::SandboxStreamEvent; - type ResponseStream = T::WatchSandboxStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::watch_sandbox(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = WatchSandboxSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } - } - } - } - impl Clone for OpenShellServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "openshell.v1.OpenShell"; - impl tonic::server::NamedService for OpenShellServer { - const NAME: &'static str = SERVICE_NAME; - } -} diff --git a/proto/inference.proto b/proto/inference.proto index 1fefe87c6..a14ce70ea 100644 --- a/proto/inference.proto +++ b/proto/inference.proto @@ -5,9 +5,6 @@ syntax = "proto3"; package openshell.inference.v1; -option java_multiple_files = true; -option java_package = "com.anthropic.openshell.inference.v1"; - // Inference service provides cluster inference configuration and bundle delivery. service Inference { // Return the resolved inference route bundle for sandbox-local execution. diff --git a/proto/openshell.proto b/proto/openshell.proto index 625a54130..04f705020 100644 --- a/proto/openshell.proto +++ b/proto/openshell.proto @@ -8,9 +8,6 @@ package openshell.v1; import "datamodel.proto"; import "sandbox.proto"; -option java_multiple_files = true; -option java_package = "com.anthropic.openshell.v1"; - // OpenShell service provides sandbox, provider, and runtime management capabilities. service OpenShell { // Check the health of the service.