diff --git a/examples/android/RunAnywhereAI/app/src/main/AndroidManifest.xml b/examples/android/RunAnywhereAI/app/src/main/AndroidManifest.xml index d9e2c47e92..2c192735c6 100644 --- a/examples/android/RunAnywhereAI/app/src/main/AndroidManifest.xml +++ b/examples/android/RunAnywhereAI/app/src/main/AndroidManifest.xml @@ -4,6 +4,8 @@ + + NSSupportsLiveActivities diff --git a/examples/react-native/RunAnywhereAI/android/app/src/main/AndroidManifest.xml b/examples/react-native/RunAnywhereAI/android/app/src/main/AndroidManifest.xml index 814d0a2f4d..687097f163 100644 --- a/examples/react-native/RunAnywhereAI/android/app/src/main/AndroidManifest.xml +++ b/examples/react-native/RunAnywhereAI/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,8 @@ + + diff --git a/examples/react-native/RunAnywhereAI/ios/RunAnywhereAI/Info.plist b/examples/react-native/RunAnywhereAI/ios/RunAnywhereAI/Info.plist index 1b80e65c17..a3a6a14d20 100644 --- a/examples/react-native/RunAnywhereAI/ios/RunAnywhereAI/Info.plist +++ b/examples/react-native/RunAnywhereAI/ios/RunAnywhereAI/Info.plist @@ -33,6 +33,12 @@ Vision AI needs camera access to describe what you see NSMicrophoneUsageDescription RunAnywhere needs access to your microphone for speech-to-text transcription. + NSLocalNetworkUsageDescription + RunAnywhere searches for a language-model host only when you choose Find Host. + NSBonjourServices + + _runanywhere-connect._tcp + NSPhotoLibraryUsageDescription Vision AI needs photo library access to describe images NSSpeechRecognitionUsageDescription diff --git a/examples/react-native/RunAnywhereAI/package.json b/examples/react-native/RunAnywhereAI/package.json index d565f656a3..f0a2ac75f0 100644 --- a/examples/react-native/RunAnywhereAI/package.json +++ b/examples/react-native/RunAnywhereAI/package.json @@ -49,9 +49,11 @@ "react-native-safe-area-context": "^5.6.2", "react-native-screens": "~4.18.0", "react-native-svg": "^15.15.5", + "react-native-tcp-socket": "^6.4.1", "react-native-vector-icons": "^10.3.0", "react-native-vision-camera": "^4.7.3", "react-native-worklets": "^0.9.2", + "react-native-zeroconf": "^0.14.0", "zustand": "^5.0.13" }, "devDependencies": { diff --git a/examples/react-native/RunAnywhereAI/src/components/model/ModelSelectionSheet.tsx b/examples/react-native/RunAnywhereAI/src/components/model/ModelSelectionSheet.tsx index 4ac22ca601..1779cf6dfc 100644 --- a/examples/react-native/RunAnywhereAI/src/components/model/ModelSelectionSheet.tsx +++ b/examples/react-native/RunAnywhereAI/src/components/model/ModelSelectionSheet.tsx @@ -32,6 +32,7 @@ import { getPrimaryFramework, } from '../../utils/modelDisplay'; import { RunAnywhere } from '@runanywhere/core'; +import type { ConnectHost } from '@runanywhere/core'; import { InferenceFramework, ModelCategory, @@ -42,6 +43,7 @@ import { subscribeNpuCatalog, } from '../../services/NpuModelCatalog'; import { listVisibleCatalogModels } from '../../services/ModelRegistryQueries'; +import { ConnectService } from '../../services/ConnectService'; const downloadModelStreamHelper = RunAnywhere.downloadModelStream; @@ -190,6 +192,23 @@ export const ModelSelectionSheet: React.FC = ({ getNpuCatalogSnapshot, getNpuCatalogSnapshot ); + const connectState = useSyncExternalStore( + ConnectService.subscribe, + ConnectService.getSnapshot, + ConnectService.getSnapshot + ); + + const handleConnect = useCallback( + async (host: ConnectHost) => { + try { + await ConnectService.connect(host); + onClose(); + } catch (error) { + console.error('[ModelSelectionSheet] Connect failed:', error); + } + }, + [onClose] + ); const loadData = useCallback(async () => { setIsLoading(true); @@ -266,6 +285,9 @@ export const ModelSelectionSheet: React.FC = ({ setLoadingId(model.id); try { await onModelSelected(model); + if (context === ModelSelectionContext.LLM) { + ConnectService.disconnect(); + } setActiveId(model.id); if (isRAGContext(context)) onClose(); } catch (error) { @@ -443,7 +465,10 @@ export const ModelSelectionSheet: React.FC = ({ {title} {list.map((m) => renderRow(m, ready))} @@ -458,18 +483,199 @@ export const ModelSelectionSheet: React.FC = ({ > {getContextTitle(context)} + {context === ModelSelectionContext.LLM && ( + + + Connect + + + {connectState.status === 'connected' ? ( + + + + + + + {connectState.activeHost?.displayName || 'Connected Host'} + + + {connectState.activeModel?.displayName || + 'Hosted language model'} + + + + Use + + + ) : connectState.availableHosts.length === 0 ? ( + { + ConnectService.findHosts().catch(() => undefined); + }} + disabled={connectState.status === 'discovering'} + > + + + + + + {connectState.status === 'discovering' + ? 'Looking for Hosts' + : connectState.status === 'disconnected' + ? 'Find a Host again' + : 'Connect to a Host'} + + + {connectState.message || + 'Use a language model hosted on your local network'} + + + {connectState.status === 'discovering' ? ( + + ) : ( + + {connectState.status === 'disconnected' || + connectState.status === 'failed' + ? 'Retry' + : 'Find Host'} + + )} + + ) : ( + connectState.availableHosts.map((host) => ( + { + handleConnect(host).catch(() => undefined); + }} + disabled={connectState.status === 'connecting'} + > + + + + + + {host.displayName} + + + Language model available on this host + + + {connectState.status === 'connecting' ? ( + + ) : ( + + Connect + + )} + + )) + )} + + + )} {isLoading ? ( Loading models… @@ -484,7 +690,10 @@ export const ModelSelectionSheet: React.FC = ({ > @@ -551,7 +760,8 @@ export const ModelSelectionSheet: React.FC = ({ { color: colors.onPrimaryContainer }, ]} > - {formatBytes(storage?.totalModelsBytes ?? 0)} in models · {onDeviceModels.length} on device + {formatBytes(storage?.totalModelsBytes ?? 0)} in models ·{' '} + {onDeviceModels.length} on device @@ -664,6 +874,13 @@ const styles = StyleSheet.create({ paddingHorizontal: 12, paddingVertical: 12, }, + connectRow: { + flexDirection: 'row', + alignItems: 'center', + gap: 12, + paddingHorizontal: 12, + paddingVertical: 14, + }, tile: { width: 40, height: 40, diff --git a/examples/react-native/RunAnywhereAI/src/screens/ChatScreen.tsx b/examples/react-native/RunAnywhereAI/src/screens/ChatScreen.tsx index 6e2092a7d2..b91848244b 100644 --- a/examples/react-native/RunAnywhereAI/src/screens/ChatScreen.tsx +++ b/examples/react-native/RunAnywhereAI/src/screens/ChatScreen.tsx @@ -21,7 +21,13 @@ * Reference: iOS examples/ios/RunAnywhereAI/RunAnywhereAI/Features/Chat/Views/ChatInterfaceView.swift */ -import React, { useState, useRef, useCallback, useEffect } from 'react'; +import React, { + useState, + useRef, + useCallback, + useEffect, + useSyncExternalStore, +} from 'react'; import { View, Text, @@ -63,6 +69,7 @@ import { getPrimaryFramework } from '../utils/modelDisplay'; // Import RunAnywhere SDK (Multi-Package Architecture) import { RunAnywhere } from '@runanywhere/core'; +import { ConnectService } from '../services/ConnectService'; import { LLMGenerationOptions } from '@runanywhere/proto-ts/llm_options'; import { ToolCallFormatName, @@ -139,6 +146,12 @@ export const ChatScreen: React.FC = () => { // LoRA adapter management (mirrors iOS LLMViewModel.loraAdapters). const [showLoRASheet, setShowLoRASheet] = useState(false); const [loraAdapterCount, setLoraAdapterCount] = useState(0); + const connectState = useSyncExternalStore( + ConnectService.subscribe, + ConnectService.getSnapshot, + ConnectService.getSnapshot + ); + const [showConnectBanner, setShowConnectBanner] = useState(false); // Refs const flatListRef = useRef(null); @@ -147,6 +160,20 @@ export const ChatScreen: React.FC = () => { // Safe area insets for header status bar handling const insets = useSafeAreaInsets(); + useEffect(() => { + if ( + connectState.status !== 'connected' && + connectState.status !== 'disconnected' && + connectState.status !== 'failed' + ) { + return; + } + setShowConnectBanner(true); + if (connectState.status !== 'connected') return; + const timer = setTimeout(() => setShowConnectBanner(false), 6000); + return () => clearTimeout(timer); + }, [connectState.status, connectState.activeHost?.id, connectState.message]); + // Initialize conversation store and create first conversation useEffect(() => { const init = async () => { @@ -357,10 +384,10 @@ export const ChatScreen: React.FC = () => { const handleToggleTools = useCallback(() => { setToolsEnabled((prev) => { const next = !prev; - void AsyncStorage.setItem( + AsyncStorage.setItem( APP_STORAGE_KEYS.TOOL_CALLING_ENABLED, next ? 'true' : 'false' - ); + ).catch(() => undefined); return next; }); }, []); @@ -378,7 +405,14 @@ export const ChatScreen: React.FC = () => { const text = ( typeof promptOverride === 'string' ? promptOverride : inputText ).trim(); - if (isLoading || !text || !currentConversation) return; + const hostedModel = connectState.activeModel; + if ( + isLoading || + !text || + !currentConversation || + (!currentModel && !hostedModel) + ) + return; const userMessage: Message = { id: generateId(), @@ -413,7 +447,8 @@ export const ChatScreen: React.FC = () => { ); const registeredTools = await RunAnywhere.getRegisteredTools(); - const shouldUseTools = toolsEnabled && registeredTools.length > 0; + const shouldUseTools = + !hostedModel && toolsEnabled && registeredTools.length > 0; const supportsThinking = currentModel?.supportsThinking ?? false; const wasThinkingMode = supportsThinking && options.thinkingModeEnabled; const disableThinking = @@ -442,9 +477,14 @@ export const ChatScreen: React.FC = () => { disableThinking, }); - const frameworkName = RunAnywhere.formatFramework( - currentModel?.preferredFramework ?? currentModel?.framework - ); + const activeModelId = hostedModel?.id || currentModel?.id || 'unknown'; + const activeModelName = + hostedModel?.displayName || currentModel?.name || 'Unknown Model'; + const frameworkName = hostedModel?.framework + ? hostedModel.framework + : RunAnywhere.formatFramework( + currentModel?.preferredFramework ?? currentModel?.framework + ); // Insert the initial empty assistant message once (matches iOS two-phase pattern). const initialAssistantMessage: Message = { @@ -454,8 +494,8 @@ export const ChatScreen: React.FC = () => { timestamp: new Date(), isStreaming: true, modelInfo: { - modelId: currentModel?.id || 'unknown', - modelName: currentModel?.name || 'Unknown Model', + modelId: activeModelId, + modelName: activeModelName, framework: frameworkName, frameworkDisplayName: frameworkName, }, @@ -531,7 +571,18 @@ export const ChatScreen: React.FC = () => { // Stream tokens as they arrive — canonical cross-SDK path. We drive // the SDK's `aggregateStream(prompt, events, onToken)` helper exactly // like iOS LLMViewModel+Generation.swift. - const eventStream = RunAnywhere.generateStream(prompt, genOptions); + const eventStream = hostedModel + ? ConnectService.session.generateStream({ + prompt, + emitThoughts: options.thinkingModeEnabled, + requestId: assistantMessageId, + modelId: hostedModel.id, + conversationId: currentConversation.id, + metadata: {}, + options: genOptions, + history: [], + }) + : RunAnywhere.generateStream(prompt, genOptions); const result = await RunAnywhere.aggregateStream( prompt, eventStream, @@ -545,8 +596,8 @@ export const ChatScreen: React.FC = () => { timestamp: new Date(), isStreaming: true, modelInfo: { - modelId: currentModel?.id || 'unknown', - modelName: currentModel?.name || 'Unknown Model', + modelId: activeModelId, + modelName: activeModelName, framework: frameworkName, frameworkDisplayName: frameworkName, }, @@ -570,8 +621,8 @@ export const ChatScreen: React.FC = () => { thinkingContent: result.thinkingContent, timestamp: new Date(), modelInfo: { - modelId: currentModel?.id || 'unknown', - modelName: currentModel?.name || 'Unknown Model', + modelId: activeModelId, + modelName: activeModelName, framework: frameworkName, frameworkDisplayName: frameworkName, }, @@ -648,6 +699,7 @@ export const ChatScreen: React.FC = () => { inputText, currentConversation, currentModel, + connectState.activeModel, toolsEnabled, addMessage, updateMessage, @@ -657,7 +709,7 @@ export const ChatScreen: React.FC = () => { const handleStopGeneration = useCallback(() => { generationAbortRef.current?.abort(); - void RunAnywhere.cancelGeneration(); + RunAnywhere.cancelGeneration().catch(() => undefined); setIsLoading(false); }, []); @@ -726,8 +778,8 @@ export const ChatScreen: React.FC = () => { */ const renderHeader = () => ( 0} onModelPress={handleSelectModel} @@ -737,12 +789,56 @@ export const ChatScreen: React.FC = () => { /> ); - const showOverlay = !currentModel && !isModelLoading; + const hasUsableModel = !!currentModel || connectState.status === 'connected'; + const showOverlay = !hasUsableModel && !isModelLoading; return ( {renderHeader()} + {showConnectBanner && ( + + + + + + + {connectState.status === 'connected' + ? `Connected to ${connectState.activeHost?.displayName || 'Host'}` + : 'Host connection ended'} + + + {connectState.status === 'connected' + ? connectState.activeModel?.displayName + : connectState.message || 'Choose a local model or reconnect'} + + + {connectState.status === 'connected' && ( + ConnectService.disconnect()} + > + Disconnect + + )} + setShowConnectBanner(false)}> + + + + )} + {showOverlay ? ( { /> {/* Tool Calling Badge (shows when tools are enabled) */} - {currentModel && registeredToolCount > 0 && ( - - )} + {currentModel && + connectState.status !== 'connected' && + registeredToolCount > 0 && ( + + )} {/* LoRA pill (mirrors iOS ChatMessageListView's LoRA row above input) */} - {currentModel && ( + {currentModel && connectState.status !== 'connected' && ( { )} {/* Example prompts (mode follows tool/LoRA state), shown on an empty chat */} - {currentModel && messages.length === 0 && ( + {hasUsableModel && messages.length === 0 && ( 0} - onSelect={(p) => void handleSend(p)} + onSelect={(p) => { + handleSend(p).catch(() => undefined); + }} /> )} @@ -818,12 +920,18 @@ export const ChatScreen: React.FC = () => { onChangeText={setInputText} onSend={handleSend} onStop={handleStopGeneration} - disabled={!currentModel || !currentConversation} + disabled={!hasUsableModel || !currentConversation} isLoading={isLoading} - toolsEnabled={toolsEnabled} - onToggleTools={currentModel ? handleToggleTools : undefined} + toolsEnabled={ + connectState.status === 'connected' ? false : toolsEnabled + } + onToggleTools={ + currentModel && connectState.status !== 'connected' + ? handleToggleTools + : undefined + } placeholder={ - currentModel + hasUsableModel ? 'Type a message...' : 'Select a model to start chatting' } @@ -876,6 +984,58 @@ const styles = StyleSheet.create({ flex: 1, backgroundColor: Colors.backgroundPrimary, }, + connectBanner: { + position: 'absolute', + left: 16, + right: 16, + zIndex: 50, + minHeight: 68, + flexDirection: 'row', + alignItems: 'center', + gap: 10, + paddingHorizontal: 14, + paddingVertical: 10, + borderRadius: 24, + backgroundColor: 'rgba(255,255,255,0.96)', + borderWidth: 1, + borderColor: Colors.borderLight, + shadowColor: '#000000', + shadowOpacity: 0.14, + shadowRadius: 16, + shadowOffset: { width: 0, height: 8 }, + elevation: 8, + }, + connectBannerIcon: { + width: 36, + height: 36, + borderRadius: 18, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: Colors.badgeGreen, + }, + connectBannerText: { + flex: 1, + }, + connectBannerTitle: { + ...Typography.headline, + color: Colors.textPrimary, + }, + connectBannerSubtitle: { + ...Typography.caption, + color: Colors.textSecondary, + marginTop: 2, + }, + connectBannerAction: { + paddingHorizontal: 10, + paddingVertical: 7, + borderRadius: 999, + backgroundColor: Colors.backgroundSecondary, + }, + connectBannerActionText: { + ...Typography.caption, + color: Colors.primaryRed, + fontWeight: '600', + }, header: { flexDirection: 'row', alignItems: 'center', diff --git a/examples/react-native/RunAnywhereAI/src/services/ConnectService.ts b/examples/react-native/RunAnywhereAI/src/services/ConnectService.ts new file mode 100644 index 0000000000..570b08ccdb --- /dev/null +++ b/examples/react-native/RunAnywhereAI/src/services/ConnectService.ts @@ -0,0 +1,17 @@ +import { + ConnectSession, + type ConnectHost, + type ConnectState, +} from '@runanywhere/core'; + +const session = new ConnectSession('React Native device'); + +export const ConnectService = { + session, + getSnapshot: (): ConnectState => session.state, + subscribe: (listener: () => void): (() => void) => + session.subscribe(() => listener()), + findHosts: (): Promise => session.startBrowsing(), + connect: (host: ConnectHost): Promise => session.connect(host), + disconnect: (): void => session.disconnect(), +}; diff --git a/examples/react-native/RunAnywhereAI/src/theme/system/icons.tsx b/examples/react-native/RunAnywhereAI/src/theme/system/icons.tsx index a27b0d44c4..9f29b4227a 100644 --- a/examples/react-native/RunAnywhereAI/src/theme/system/icons.tsx +++ b/examples/react-native/RunAnywhereAI/src/theme/system/icons.tsx @@ -43,6 +43,7 @@ import { Battery, Calculator, Zap, + Monitor, } from 'lucide-react-native'; const ICONS = { @@ -82,6 +83,7 @@ const ICONS = { battery: Battery, calculator: Calculator, bolt: Zap, + host: Monitor, } as const; export type IconName = keyof typeof ICONS; diff --git a/idl/connect.proto b/idl/connect.proto new file mode 100644 index 0000000000..b4a8993b0f --- /dev/null +++ b/idl/connect.proto @@ -0,0 +1,208 @@ +// RunAnywhere IDL — LAN host/client session contract. +// +// This schema defines the transport-independent control plane for a local +// runtime host. Discovery and sockets remain platform adapters; commons owns +// the role constraints, protocol compatibility checks, session state, and +// validation of typed remote generation requests. + +syntax = "proto3"; + +package runanywhere.v1; + +import "llm_service.proto"; + +option cc_enable_arenas = true; +option java_multiple_files = true; +option java_package = "ai.runanywhere.proto.v1"; +option java_outer_classname = "ConnectProto"; +option objc_class_prefix = "RAV1"; +option csharp_namespace = "Runanywhere.V1"; +option swift_prefix = "RA"; +option go_package = "github.com/runanywhere/runanywhere-sdks/idl/v1;runanywherev1"; + +// Platform identity is explicit so commons can evaluate role availability +// from one policy table. Platform SDKs must not hardcode the host/client +// matrix in UI or transport code. +enum ConnectPlatform { + CONNECT_PLATFORM_UNSPECIFIED = 0; + CONNECT_PLATFORM_MACOS = 1; + CONNECT_PLATFORM_IOS = 2; + CONNECT_PLATFORM_IPADOS = 3; + + // Reserved for the follow-on SDK integrations. Keeping the values in the + // canonical IDL avoids a later wire-format migration. + CONNECT_PLATFORM_ANDROID = 4; + CONNECT_PLATFORM_REACT_NATIVE = 5; + CONNECT_PLATFORM_FLUTTER = 6; + CONNECT_PLATFORM_WEB = 7; + + // Reserved now so adding the planned Windows host adapter does not require + // a platform-identity wire migration. Its host role remains PLANNED until + // the native transport, discovery, and protected-storage adapter ships. + CONNECT_PLATFORM_WINDOWS = 8; +} + +// Role availability is richer than a boolean so the wire contract can reserve +// planned platforms without accidentally advertising them as usable. +enum ConnectRoleAvailability { + CONNECT_ROLE_AVAILABILITY_UNSPECIFIED = 0; + CONNECT_ROLE_AVAILABILITY_DISABLED = 1; + CONNECT_ROLE_AVAILABILITY_PLANNED = 2; + CONNECT_ROLE_AVAILABILITY_ENABLED = 3; +} + +message ConnectPlatformPolicyRequest { + ConnectPlatform platform = 1; +} + +// Commons is the authority for this policy. SDKs may query it to shape UI, +// but every host/client entrypoint also enforces it inside C++. +message ConnectPlatformPolicy { + ConnectPlatform platform = 1; + ConnectRoleAvailability host_role = 2; + ConnectRoleAvailability client_role = 3; +} + +enum ConnectHandshakeStatus { + CONNECT_HANDSHAKE_STATUS_UNSPECIFIED = 0; + CONNECT_HANDSHAKE_STATUS_ACCEPTED = 1; + CONNECT_HANDSHAKE_STATUS_REJECTED = 2; +} + +enum ConnectSessionState { + CONNECT_SESSION_STATE_UNSPECIFIED = 0; + CONNECT_SESSION_STATE_CONNECTING = 1; + CONNECT_SESSION_STATE_CONNECTED = 2; + CONNECT_SESSION_STATE_DISCONNECTED = 3; + CONNECT_SESSION_STATE_FAILED = 4; +} + +// Non-secret metadata published through LAN service discovery and echoed by +// the handshake. `instance_id` is generated anew whenever the host starts; +// it is not a persistent device identifier or a credential. +message ConnectDiscoveryMetadata { + string instance_id = 1; + string display_name = 2; + ConnectPlatform platform = 3; + uint32 protocol_version = 4; +} + +// The single language model currently shared by a host. A host must select a +// loaded model before it starts publishing; this lets clients enter chat +// immediately without downloading or selecting a local model. +message ConnectModelDescriptor { + string model_id = 1; + string display_name = 2; + string framework = 3; + uint32 context_window = 4; + bool supports_streaming = 5; +} + +message ConnectHostStartRequest { + string display_name = 1; + ConnectPlatform platform = 2; + uint32 protocol_version = 3; + ConnectModelDescriptor model = 4; +} + +message ConnectHostStopRequest {} + +message ConnectHostState { + bool is_hosting = 1; + ConnectDiscoveryMetadata discovery_metadata = 2; + uint32 active_client_count = 3; + string error_message = 4; + ConnectModelDescriptor model = 5; +} + +message ConnectClientStartRequest { + string display_name = 1; + ConnectPlatform platform = 2; + uint32 protocol_version = 3; +} + +// Sent by a client immediately after the platform transport is connected. +message ConnectClientHello { + string instance_id = 1; + string display_name = 2; + ConnectPlatform platform = 3; + uint32 protocol_version = 4; +} + +// Sent by the host after commons has accepted or rejected a client hello. +message ConnectHandshakeResponse { + ConnectHandshakeStatus status = 1; + string session_id = 2; + ConnectDiscoveryMetadata host = 3; + string rejection_reason = 4; + ConnectModelDescriptor model = 5; +} + +// The client validates the host response through commons and receives the +// public session state it can expose to its platform UI. +message ConnectClientSessionState { + ConnectSessionState state = 1; + string session_id = 2; + ConnectDiscoveryMetadata host = 3; + string error_message = 4; + ConnectModelDescriptor model = 5; +} + +message ConnectSessionCloseRequest { + string session_id = 1; +} + +// A client sends the existing typed LLM request to the selected host model. +// `session_id` binds the request to the prior handshake; `generation.model_id` +// must match the model the host published for that session. +message ConnectInvocationRequest { + string session_id = 1; + string request_id = 2; + LLMGenerateRequest generation = 3; +} + +// Commons validates that an invocation belongs to an active session and uses +// the host's published model before any platform runtime receives the prompt. +message ConnectInvocationValidation { + bool accepted = 1; + string rejection_reason = 2; +} + +// Hosts forward the SDK's canonical stream events without translating them to +// a platform-specific token shape. This is the portable streaming surface for +// future Kotlin, React Native, Flutter, and Web clients. +message ConnectInvocationEvent { + string request_id = 1; + LLMStreamEvent event = 2; +} + +// The connection stays open between generations, so the client needs a +// control-plane exchange that can detect a host stopped while chat is idle. +// These frames deliberately remain separate from LLM invocation payloads: +// a health check must never reach a model or appear as an assistant message. +message ConnectHeartbeatRequest { + string session_id = 1; + uint64 sequence = 2; +} + +message ConnectHeartbeatResponse { + string session_id = 1; + uint64 sequence = 2; +} + +// Every frame after the initial ClientHello handshake is carried in one of +// these explicit envelopes. This leaves typed inference traffic untouched +// while allowing clients to verify an otherwise-idle host connection. +message ConnectClientFrame { + oneof payload { + ConnectInvocationRequest invocation = 1; + ConnectHeartbeatRequest heartbeat = 2; + } +} + +message ConnectHostFrame { + oneof payload { + ConnectInvocationEvent invocation_event = 1; + ConnectHeartbeatResponse heartbeat = 2; + } +} diff --git a/sdk/runanywhere-commons/CMakeLists.txt b/sdk/runanywhere-commons/CMakeLists.txt index e3a44d0d9f..3d3db81f57 100644 --- a/sdk/runanywhere-commons/CMakeLists.txt +++ b/sdk/runanywhere-commons/CMakeLists.txt @@ -716,6 +716,11 @@ set(RAC_CORE_SOURCES src/core/rac_error_proto.cpp src/foundation/rac_proto_buffer.cpp src/foundation/rac_sha256.cpp + # Connect owns platform-role policy and transport-independent session + # coordination in commons. Platform SDKs register concrete discovery and + # channel adapters through the transport vtable. + src/connect/rac_connect.cpp + src/connect/rac_connect_transport.cpp # Canonical two-phase SDK init ABI. Wraps existing rac_state / # rac_auth / rac_device_manager / rac_model_assignment internals behind # one rac_sdk_init_phase{1,2}_proto + rac_sdk_retry_http_proto surface so @@ -1383,6 +1388,8 @@ set(_RAC_PROTO_GENERATED_SOURCES ${_RAC_PROTO_GEN_DIR}/device_info.pb.cc # Plugin loader descriptors (PluginInfo / PluginInfoList). ${_RAC_PROTO_GEN_DIR}/plugin_loader.pb.cc + # Cross-platform Connect policy, handshake, and invocation envelopes. + ${_RAC_PROTO_GEN_DIR}/connect.pb.cc # rac_options.proto — custom FieldOptions / EnumValueOptions extensions # imported by codegen post-processors and several option protos. Required # at link time by every .pb.cc that imports rac_options.proto. diff --git a/sdk/runanywhere-commons/exports/RACommons.exports b/sdk/runanywhere-commons/exports/RACommons.exports index 764cbbcacc..919699454b 100644 --- a/sdk/runanywhere-commons/exports/RACommons.exports +++ b/sdk/runanywhere-commons/exports/RACommons.exports @@ -83,6 +83,22 @@ _rac_platform_services_register_availability_callback _rac_http_download _rac_http_download_cancel +# Connect — protocol/session policy plus the platform transport adapter ABI. +_rac_connect_client_create_hello_proto +_rac_connect_client_validate_host_proto +_rac_connect_get_platform_policy_proto +_rac_connect_host_accept_client_proto +_rac_connect_host_close_session_proto +_rac_connect_host_start_proto +_rac_connect_host_stop_proto +_rac_connect_host_validate_invocation_proto +_rac_connect_transport_close +_rac_connect_transport_is_registered +_rac_connect_transport_open +_rac_connect_transport_receive +_rac_connect_transport_register +_rac_connect_transport_send + # Events — internal lower-level publisher used by lifecycle manager, # storage analyzer, device manager, and engine plugins for telemetry # breadcrumbs. Public SDK event stream is rac_sdk_event_* below. diff --git a/sdk/runanywhere-commons/include/rac/connect/rac_connect.h b/sdk/runanywhere-commons/include/rac/connect/rac_connect.h new file mode 100644 index 0000000000..b6e1b2f7b4 --- /dev/null +++ b/sdk/runanywhere-commons/include/rac/connect/rac_connect.h @@ -0,0 +1,100 @@ +/** + * @file rac_connect.h + * @brief Transport-independent host/client policy and session ABI. + * + * Commons owns the platform-role policy, protocol version, host session + * registry, protobuf handshake, and remote invocation validation. Platform + * SDKs own discovery, transport adapters, permissions, and user-visible state. + */ + +#ifndef RAC_CONNECT_H +#define RAC_CONNECT_H + +#include +#include + +#include "rac/core/rac_error.h" +#include "rac/core/rac_types.h" +#include "rac/foundation/rac_proto_buffer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return the authoritative host/client role availability for a platform. + * + * Accepts ConnectPlatformPolicyRequest and returns ConnectPlatformPolicy. + * Platform SDKs may use this to shape UI, while every C++ entrypoint still + * enforces the same policy independently. + */ +RAC_API rac_result_t rac_connect_get_platform_policy_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_platform_policy); + +/** + * Start the process-local host state from a serialized + * runanywhere.v1.ConnectHostStartRequest. + * + * Commons evaluates the requested platform through its role policy, validates + * the selected loaded model, generates an ephemeral host instance id, and + * returns ConnectHostState. + * The platform adapter publishes the returned discovery metadata only after + * this call succeeds. + */ +RAC_API rac_result_t rac_connect_host_start_proto(const uint8_t* request_bytes, size_t request_size, + rac_proto_buffer_t* out_host_state); + +/** Stop the process-local host state and invalidate every active session. */ +RAC_API rac_result_t rac_connect_host_stop_proto(const uint8_t* request_bytes, size_t request_size, + rac_proto_buffer_t* out_host_state); + +/** + * Create a canonical client hello from ConnectClientStartRequest. + * + * Commons accepts only platforms whose client role is currently enabled. The + * generated instance id is ephemeral and non-secret. + */ +RAC_API rac_result_t rac_connect_client_create_hello_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_client_hello); + +/** + * Validate a client hello against the active host and return an accepted + * or rejected ConnectHandshakeResponse. Accepted responses reserve a session + * id in the commons host registry until closed or hosting stops. + */ +RAC_API rac_result_t rac_connect_host_accept_client_proto(const uint8_t* hello_bytes, + size_t hello_size, + rac_proto_buffer_t* out_response); + +/** + * Validate the host's ConnectHandshakeResponse on a client and return its + * typed ConnectClientSessionState. + */ +RAC_API rac_result_t rac_connect_client_validate_host_proto(const uint8_t* response_bytes, + size_t response_size, + rac_proto_buffer_t* out_session_state); + +/** + * Release an active host session after its platform transport terminates. + * Unknown session ids are rejected to keep the host registry authoritative. + */ +RAC_API rac_result_t rac_connect_host_close_session_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_host_state); + +/** + * Validate a typed remote generation request before the platform host runtime + * executes it. The request must belong to an active Connect session and name + * the model published when the host started. + */ +RAC_API rac_result_t rac_connect_host_validate_invocation_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_validation); + +#ifdef __cplusplus +} +#endif + +#endif // RAC_CONNECT_H diff --git a/sdk/runanywhere-commons/include/rac/connect/rac_connect_transport.h b/sdk/runanywhere-commons/include/rac/connect/rac_connect_transport.h new file mode 100644 index 0000000000..0dac2cf488 --- /dev/null +++ b/sdk/runanywhere-commons/include/rac/connect/rac_connect_transport.h @@ -0,0 +1,95 @@ +/** + * @file rac_connect_transport.h + * @brief Platform-neutral channel transport vtable for RunAnywhere Connect. + * + * Commons owns Connect protocol messages, role/session policy, and dispatch. + * Platform SDKs provide discovery plus a channel adapter through this ABI. + * Endpoint bytes are opaque to commons: Bonjour, Android NSD, a future + * Windows discovery provider, and a future relay may each use their native + * endpoint representation without changing the Connect state machine. + * + * The operations are synchronous by contract and may block. SDKs must invoke + * the public dispatch functions from a worker/transport queue, never from a UI + * thread. Every logical payload is one complete protobuf frame; stream + * segmentation and reassembly belong to the adapter. + */ + +#ifndef RAC_CONNECT_TRANSPORT_H +#define RAC_CONNECT_TRANSPORT_H + +#include +#include + +#include "rac/core/rac_error.h" +#include "rac/core/rac_types.h" +#include "rac/foundation/rac_proto_buffer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RAC_CONNECT_TRANSPORT_ABI_VERSION ((uint32_t)1u) + +typedef uint64_t rac_connect_channel_t; +#define RAC_CONNECT_INVALID_CHANNEL ((rac_connect_channel_t)0u) + +/** + * Opaque endpoint token produced by a platform discovery adapter. + * + * The bytes are borrowed for the duration of open(). Commons never parses or + * persists them. + */ +typedef struct rac_connect_endpoint { + const uint8_t* data; + size_t size; +} rac_connect_endpoint_t; + +/** + * Platform channel operations. + * + * open/send/receive/close are mandatory. init/destroy are optional lifecycle + * hooks. The adapter must be thread-safe because commons may dispatch on more + * than one worker. + */ +typedef struct rac_connect_transport_ops { + uint32_t abi_version; + size_t struct_size; + + rac_result_t (*open)(void* user_data, const rac_connect_endpoint_t* endpoint, + rac_connect_channel_t* out_channel); + rac_result_t (*send)(void* user_data, rac_connect_channel_t channel, const uint8_t* payload, + size_t payload_size); + rac_result_t (*receive)(void* user_data, rac_connect_channel_t channel, + rac_proto_buffer_t* out_payload); + rac_result_t (*close)(void* user_data, rac_connect_channel_t channel); + + rac_result_t (*init)(void* user_data); + void (*destroy)(void* user_data); +} rac_connect_transport_ops_t; + +/** + * Install or replace the process-wide Connect transport. + * + * The vtable is copied during registration. Passing NULL unregisters the + * active adapter. Replaced adapters are destroyed only after all in-flight + * calls release their registry snapshot. + */ +RAC_API rac_result_t rac_connect_transport_register(const rac_connect_transport_ops_t* ops, + void* user_data); + +RAC_API rac_bool_t rac_connect_transport_is_registered(void); + +/** Dispatch one operation through the currently registered adapter. */ +RAC_API rac_result_t rac_connect_transport_open(const rac_connect_endpoint_t* endpoint, + rac_connect_channel_t* out_channel); +RAC_API rac_result_t rac_connect_transport_send(rac_connect_channel_t channel, + const uint8_t* payload, size_t payload_size); +RAC_API rac_result_t rac_connect_transport_receive(rac_connect_channel_t channel, + rac_proto_buffer_t* out_payload); +RAC_API rac_result_t rac_connect_transport_close(rac_connect_channel_t channel); + +#ifdef __cplusplus +} +#endif + +#endif // RAC_CONNECT_TRANSPORT_H diff --git a/sdk/runanywhere-commons/src/connect/rac_connect.cpp b/sdk/runanywhere-commons/src/connect/rac_connect.cpp new file mode 100644 index 0000000000..b935e5bd49 --- /dev/null +++ b/sdk/runanywhere-commons/src/connect/rac_connect.cpp @@ -0,0 +1,580 @@ +/** + * @file rac_connect.cpp + * @brief Commons-owned validation and session state for LAN host/client setup. + */ + +#include "rac/connect/rac_connect.h" + +#include +#include +#include +#include +#include + +#include "rac/core/rac_uuid.h" + +#if defined(RAC_HAVE_PROTOBUF) +#include "connect.pb.h" +#endif + +namespace { + +constexpr uint32_t kConnectProtocolVersion = 1; +constexpr size_t kMaxDisplayNameLength = 128; +constexpr size_t kMaxModelIdLength = 512; + +#if defined(RAC_HAVE_PROTOBUF) + +namespace v1 = ::runanywhere::v1; + +struct HostRuntime { + bool is_hosting = false; + v1::ConnectDiscoveryMetadata metadata; + v1::ConnectModelDescriptor model; + // One active session per client instance. A reconnect replaces the stale + // session from the same SDK instance instead of inflating the device count. + std::unordered_map session_clients; +}; + +struct PlatformRolePolicy { + v1::ConnectPlatform platform; + v1::ConnectRoleAvailability host_role; + v1::ConnectRoleAvailability client_role; +}; + +// Product availability is data, not platform-specific control flow. A new +// adapter changes one table row after its transport/security requirements are +// met; the host and handshake validation paths remain unchanged. +constexpr std::array kPlatformRolePolicies{{ + {v1::CONNECT_PLATFORM_MACOS, v1::CONNECT_ROLE_AVAILABILITY_ENABLED, + v1::CONNECT_ROLE_AVAILABILITY_DISABLED}, + {v1::CONNECT_PLATFORM_IOS, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED}, + {v1::CONNECT_PLATFORM_IPADOS, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED}, + {v1::CONNECT_PLATFORM_ANDROID, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED}, + {v1::CONNECT_PLATFORM_REACT_NATIVE, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED}, + {v1::CONNECT_PLATFORM_FLUTTER, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED}, + {v1::CONNECT_PLATFORM_WEB, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_PLANNED}, + {v1::CONNECT_PLATFORM_WINDOWS, v1::CONNECT_ROLE_AVAILABILITY_PLANNED, + v1::CONNECT_ROLE_AVAILABILITY_PLANNED}, +}}; + +std::mutex& runtime_mutex() { + static std::mutex mutex; + return mutex; +} + +HostRuntime& runtime() { + static HostRuntime instance; + return instance; +} + +bool has_non_whitespace(const std::string& value) { + for (const char character : value) { + if (character != ' ' && character != '\t' && character != '\n' && character != '\r') { + return true; + } + } + return false; +} + +bool is_valid_display_name(const std::string& value) { + return !value.empty() && value.size() <= kMaxDisplayNameLength && has_non_whitespace(value); +} + +bool is_valid_model(const v1::ConnectModelDescriptor& model) { + return !model.model_id().empty() && model.model_id().size() <= kMaxModelIdLength && + is_valid_display_name(model.display_name()); +} + +const PlatformRolePolicy* find_platform_policy(v1::ConnectPlatform platform) { + for (const PlatformRolePolicy& policy : kPlatformRolePolicies) { + if (policy.platform == platform) { + return &policy; + } + } + return nullptr; +} + +bool is_host_role_enabled(v1::ConnectPlatform platform) { + const PlatformRolePolicy* policy = find_platform_policy(platform); + return policy != nullptr && policy->host_role == v1::CONNECT_ROLE_AVAILABILITY_ENABLED; +} + +bool is_client_role_enabled(v1::ConnectPlatform platform) { + const PlatformRolePolicy* policy = find_platform_policy(platform); + return policy != nullptr && policy->client_role == v1::CONNECT_ROLE_AVAILABILITY_ENABLED; +} + +v1::ConnectPlatformPolicy make_platform_policy(const PlatformRolePolicy& policy) { + v1::ConnectPlatformPolicy response; + response.set_platform(policy.platform); + response.set_host_role(policy.host_role); + response.set_client_role(policy.client_role); + return response; +} + +template +rac_result_t serialize_message(const Message& message, rac_proto_buffer_t* out_buffer) { + if (out_buffer == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + + std::string bytes; + if (!message.SerializeToString(&bytes)) { + rac_proto_buffer_set_error(out_buffer, RAC_ERROR_PROCESSING_FAILED, + "Failed to serialize Connect protobuf response"); + return RAC_ERROR_PROCESSING_FAILED; + } + return rac_proto_buffer_copy(reinterpret_cast(bytes.data()), bytes.size(), + out_buffer); +} + +template +rac_result_t parse_message(const uint8_t* bytes, size_t size, Message* out_message, + rac_proto_buffer_t* out_buffer, const char* error_context) { + if (out_message == nullptr || out_buffer == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + + const rac_result_t validation = rac_proto_bytes_validate(bytes, size); + if (validation != RAC_SUCCESS) { + rac_proto_buffer_set_error(out_buffer, validation, error_context); + return validation; + } + if (!out_message->ParseFromArray(rac_proto_bytes_data_or_empty(bytes, size), + static_cast(size))) { + rac_proto_buffer_set_error(out_buffer, RAC_ERROR_DECODING_ERROR, error_context); + return RAC_ERROR_DECODING_ERROR; + } + return RAC_SUCCESS; +} + +rac_result_t generate_ephemeral_id(std::string* out_id, rac_proto_buffer_t* out_buffer) { + if (out_id == nullptr || out_buffer == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + std::array uuid{}; + const rac_result_t result = rac_uuid_v4(uuid.data(), uuid.size()); + if (result != RAC_SUCCESS) { + rac_proto_buffer_set_error(out_buffer, result, "Failed to generate Connect instance id"); + return result; + } + *out_id = uuid.data(); + return RAC_SUCCESS; +} + +v1::ConnectHostState make_host_state(const HostRuntime& host) { + v1::ConnectHostState state; + state.set_is_hosting(host.is_hosting); + state.set_active_client_count(static_cast(host.session_clients.size())); + if (host.is_hosting) { + *state.mutable_discovery_metadata() = host.metadata; + *state.mutable_model() = host.model; + } + return state; +} + +rac_result_t reject_handshake(const HostRuntime& host, const char* reason, + rac_proto_buffer_t* out_response) { + v1::ConnectHandshakeResponse response; + response.set_status(v1::CONNECT_HANDSHAKE_STATUS_REJECTED); + response.set_rejection_reason(reason); + if (host.is_hosting) { + *response.mutable_host() = host.metadata; + *response.mutable_model() = host.model; + } + return serialize_message(response, out_response); +} + +#endif // RAC_HAVE_PROTOBUF + +} // namespace + +extern "C" { + +rac_result_t rac_connect_get_platform_policy_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_platform_policy) { + if (out_platform_policy == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_platform_policy); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)request_bytes; + (void)request_size; + rac_proto_buffer_set_error(out_platform_policy, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectPlatformPolicyRequest request; + const rac_result_t parse_result = + parse_message(request_bytes, request_size, &request, out_platform_policy, + "Invalid ConnectPlatformPolicyRequest protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + + const PlatformRolePolicy* policy = find_platform_policy(request.platform()); + if (policy == nullptr) { + rac_proto_buffer_set_error(out_platform_policy, RAC_ERROR_NOT_SUPPORTED, + "Connect platform is not present in the role policy"); + return RAC_ERROR_NOT_SUPPORTED; + } + return serialize_message(make_platform_policy(*policy), out_platform_policy); +#endif +} + +rac_result_t rac_connect_host_start_proto(const uint8_t* request_bytes, size_t request_size, + rac_proto_buffer_t* out_host_state) { + if (out_host_state == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_host_state); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)request_bytes; + (void)request_size; + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectHostStartRequest request; + const rac_result_t parse_result = + parse_message(request_bytes, request_size, &request, out_host_state, + "Invalid ConnectHostStartRequest protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + if (!is_host_role_enabled(request.platform())) { + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_NOT_SUPPORTED, + "This platform is not enabled for Connect hosting"); + return RAC_ERROR_NOT_SUPPORTED; + } + if (request.protocol_version() != kConnectProtocolVersion) { + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_INVALID_CONFIGURATION, + "Unsupported Connect protocol version"); + return RAC_ERROR_INVALID_CONFIGURATION; + } + if (!is_valid_display_name(request.display_name())) { + rac_proto_buffer_set_error( + out_host_state, RAC_ERROR_INVALID_INPUT, + "Connect host display name must be non-empty and at most 128 characters"); + return RAC_ERROR_INVALID_INPUT; + } + if (!request.has_model() || !is_valid_model(request.model())) { + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_INVALID_INPUT, + "Connect host requires a selected loaded model"); + return RAC_ERROR_INVALID_INPUT; + } + + std::lock_guard lock(runtime_mutex()); + HostRuntime& host = runtime(); + if (!host.is_hosting) { + std::string instance_id; + const rac_result_t id_result = generate_ephemeral_id(&instance_id, out_host_state); + if (id_result != RAC_SUCCESS) { + return id_result; + } + host.metadata.Clear(); + host.metadata.set_instance_id(std::move(instance_id)); + host.metadata.set_display_name(request.display_name()); + host.metadata.set_platform(request.platform()); + host.metadata.set_protocol_version(kConnectProtocolVersion); + host.model = request.model(); + host.session_clients.clear(); + host.is_hosting = true; + } else if (host.model.model_id() != request.model().model_id()) { + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_INVALID_CONFIGURATION, + "Stop the active Connect host before changing its shared model"); + return RAC_ERROR_INVALID_CONFIGURATION; + } + + return serialize_message(make_host_state(host), out_host_state); +#endif +} + +rac_result_t rac_connect_host_stop_proto(const uint8_t* request_bytes, size_t request_size, + rac_proto_buffer_t* out_host_state) { + if (out_host_state == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_host_state); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)request_bytes; + (void)request_size; + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectHostStopRequest request; + const rac_result_t parse_result = + parse_message(request_bytes, request_size, &request, out_host_state, + "Invalid ConnectHostStopRequest protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + + std::lock_guard lock(runtime_mutex()); + HostRuntime& host = runtime(); + host.is_hosting = false; + host.metadata.Clear(); + host.model.Clear(); + host.session_clients.clear(); + return serialize_message(make_host_state(host), out_host_state); +#endif +} + +rac_result_t rac_connect_client_create_hello_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_client_hello) { + if (out_client_hello == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_client_hello); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)request_bytes; + (void)request_size; + rac_proto_buffer_set_error(out_client_hello, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectClientStartRequest request; + const rac_result_t parse_result = + parse_message(request_bytes, request_size, &request, out_client_hello, + "Invalid ConnectClientStartRequest protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + if (!is_client_role_enabled(request.platform())) { + rac_proto_buffer_set_error(out_client_hello, RAC_ERROR_NOT_SUPPORTED, + "This platform is not enabled as a Connect client"); + return RAC_ERROR_NOT_SUPPORTED; + } + if (request.protocol_version() != kConnectProtocolVersion) { + rac_proto_buffer_set_error(out_client_hello, RAC_ERROR_INVALID_CONFIGURATION, + "Unsupported Connect protocol version"); + return RAC_ERROR_INVALID_CONFIGURATION; + } + if (!is_valid_display_name(request.display_name())) { + rac_proto_buffer_set_error( + out_client_hello, RAC_ERROR_INVALID_INPUT, + "Connect client display name must be non-empty and at most 128 characters"); + return RAC_ERROR_INVALID_INPUT; + } + + std::string instance_id; + const rac_result_t id_result = generate_ephemeral_id(&instance_id, out_client_hello); + if (id_result != RAC_SUCCESS) { + return id_result; + } + + v1::ConnectClientHello hello; + hello.set_instance_id(std::move(instance_id)); + hello.set_display_name(request.display_name()); + hello.set_platform(request.platform()); + hello.set_protocol_version(kConnectProtocolVersion); + return serialize_message(hello, out_client_hello); +#endif +} + +rac_result_t rac_connect_host_accept_client_proto(const uint8_t* hello_bytes, size_t hello_size, + rac_proto_buffer_t* out_response) { + if (out_response == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_response); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)hello_bytes; + (void)hello_size; + rac_proto_buffer_set_error(out_response, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectClientHello hello; + const rac_result_t parse_result = parse_message(hello_bytes, hello_size, &hello, out_response, + "Invalid ConnectClientHello protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + + std::lock_guard lock(runtime_mutex()); + HostRuntime& host = runtime(); + if (!host.is_hosting) { + return reject_handshake(host, "Connect host is not active", out_response); + } + if (!is_client_role_enabled(hello.platform())) { + return reject_handshake(host, "Client platform is not supported by this host", + out_response); + } + if (hello.protocol_version() != host.metadata.protocol_version()) { + return reject_handshake(host, "Connect protocol versions are incompatible", out_response); + } + if (hello.instance_id().empty() || !is_valid_display_name(hello.display_name())) { + return reject_handshake(host, "Client identity is invalid", out_response); + } + + std::string session_id; + const rac_result_t id_result = generate_ephemeral_id(&session_id, out_response); + if (id_result != RAC_SUCCESS) { + return id_result; + } + + // Network transitions can leave the old transport connection alive long + // enough for the same device to complete a new handshake. Invalidate that + // device's previous session before registering the replacement. + for (auto it = host.session_clients.begin(); it != host.session_clients.end();) { + if (it->second == hello.instance_id()) { + it = host.session_clients.erase(it); + } else { + ++it; + } + } + host.session_clients.emplace(session_id, hello.instance_id()); + + v1::ConnectHandshakeResponse response; + response.set_status(v1::CONNECT_HANDSHAKE_STATUS_ACCEPTED); + response.set_session_id(std::move(session_id)); + *response.mutable_host() = host.metadata; + *response.mutable_model() = host.model; + return serialize_message(response, out_response); +#endif +} + +rac_result_t rac_connect_client_validate_host_proto(const uint8_t* response_bytes, + size_t response_size, + rac_proto_buffer_t* out_session_state) { + if (out_session_state == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_session_state); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)response_bytes; + (void)response_size; + rac_proto_buffer_set_error(out_session_state, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectHandshakeResponse response; + const rac_result_t parse_result = + parse_message(response_bytes, response_size, &response, out_session_state, + "Invalid ConnectHandshakeResponse protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + + v1::ConnectClientSessionState state; + if (response.status() != v1::CONNECT_HANDSHAKE_STATUS_ACCEPTED) { + state.set_state(v1::CONNECT_SESSION_STATE_FAILED); + state.set_error_message(response.rejection_reason()); + return serialize_message(state, out_session_state); + } + if (!response.has_host() || !response.has_model() || + !is_host_role_enabled(response.host().platform()) || + response.host().protocol_version() != kConnectProtocolVersion || + response.session_id().empty() || !is_valid_model(response.model())) { + state.set_state(v1::CONNECT_SESSION_STATE_FAILED); + state.set_error_message("Host handshake response is incompatible"); + return serialize_message(state, out_session_state); + } + + state.set_state(v1::CONNECT_SESSION_STATE_CONNECTED); + state.set_session_id(response.session_id()); + *state.mutable_host() = response.host(); + *state.mutable_model() = response.model(); + return serialize_message(state, out_session_state); +#endif +} + +rac_result_t rac_connect_host_close_session_proto(const uint8_t* request_bytes, size_t request_size, + rac_proto_buffer_t* out_host_state) { + if (out_host_state == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_host_state); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)request_bytes; + (void)request_size; + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectSessionCloseRequest request; + const rac_result_t parse_result = + parse_message(request_bytes, request_size, &request, out_host_state, + "Invalid ConnectSessionCloseRequest protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + if (request.session_id().empty()) { + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_INVALID_INPUT, + "Connect session id is required"); + return RAC_ERROR_INVALID_INPUT; + } + + std::lock_guard lock(runtime_mutex()); + HostRuntime& host = runtime(); + if (!host.is_hosting || host.session_clients.erase(request.session_id()) == 0) { + rac_proto_buffer_set_error(out_host_state, RAC_ERROR_NOT_FOUND, + "Connect session is not active"); + return RAC_ERROR_NOT_FOUND; + } + return serialize_message(make_host_state(host), out_host_state); +#endif +} + +rac_result_t rac_connect_host_validate_invocation_proto(const uint8_t* request_bytes, + size_t request_size, + rac_proto_buffer_t* out_validation) { + if (out_validation == nullptr) { + return RAC_ERROR_NULL_POINTER; + } + rac_proto_buffer_init(out_validation); + +#if !defined(RAC_HAVE_PROTOBUF) + (void)request_bytes; + (void)request_size; + rac_proto_buffer_set_error(out_validation, RAC_ERROR_FEATURE_NOT_AVAILABLE, + "Connect requires protobuf support"); + return RAC_ERROR_FEATURE_NOT_AVAILABLE; +#else + v1::ConnectInvocationRequest request; + const rac_result_t parse_result = + parse_message(request_bytes, request_size, &request, out_validation, + "Invalid ConnectInvocationRequest protobuf payload"); + if (parse_result != RAC_SUCCESS) { + return parse_result; + } + + v1::ConnectInvocationValidation validation; + std::lock_guard lock(runtime_mutex()); + const HostRuntime& host = runtime(); + if (!host.is_hosting) { + validation.set_rejection_reason("Connect host is not active"); + } else if (request.session_id().empty() || + host.session_clients.find(request.session_id()) == host.session_clients.end()) { + validation.set_rejection_reason("Connect session is not active"); + } else if (request.request_id().empty() || !request.has_generation() || + request.generation().prompt().empty()) { + validation.set_rejection_reason("Connect generation request is incomplete"); + } else if (request.generation().model_id() != host.model.model_id()) { + validation.set_rejection_reason("Requested model is not shared by this host"); + } else { + validation.set_accepted(true); + } + return serialize_message(validation, out_validation); +#endif +} + +} // extern "C" diff --git a/sdk/runanywhere-commons/src/connect/rac_connect_transport.cpp b/sdk/runanywhere-commons/src/connect/rac_connect_transport.cpp new file mode 100644 index 0000000000..84b8497f0b --- /dev/null +++ b/sdk/runanywhere-commons/src/connect/rac_connect_transport.cpp @@ -0,0 +1,175 @@ +/** + * @file rac_connect_transport.cpp + * @brief Registry and dispatch for platform-provided Connect channels. + */ + +#include "rac/connect/rac_connect_transport.h" + +#include +#include +#include + +#include "rac/core/rac_logger.h" + +namespace { + +constexpr const char* kTag = "rac_connect_transport"; + +struct TransportSlot { + rac_connect_transport_ops_t ops{}; + void* user_data = nullptr; + + ~TransportSlot() { + if (ops.destroy != nullptr) { + ops.destroy(user_data); + } + } +}; + +struct TransportRegistry { + std::mutex mutex; + std::shared_ptr active; +}; + +TransportRegistry& registry() { + static TransportRegistry instance; + return instance; +} + +std::shared_ptr acquire_transport() { + std::lock_guard lock(registry().mutex); + return registry().active; +} + +rac_result_t validate_ops(const rac_connect_transport_ops_t* ops) { + if (ops->abi_version != RAC_CONNECT_TRANSPORT_ABI_VERSION || + ops->struct_size < sizeof(rac_connect_transport_ops_t)) { + return RAC_ERROR_ABI_VERSION_MISMATCH; + } + if (ops->open == nullptr || ops->send == nullptr || ops->receive == nullptr || + ops->close == nullptr) { + return RAC_ERROR_INVALID_ARGUMENT; + } + return RAC_SUCCESS; +} + +} // namespace + +extern "C" { + +rac_result_t rac_connect_transport_register(const rac_connect_transport_ops_t* ops, + void* user_data) { + if (ops == nullptr) { + std::shared_ptr retiring; + { + std::lock_guard lock(registry().mutex); + retiring = std::move(registry().active); + } + retiring.reset(); + RAC_LOG_INFO(kTag, "Connect transport unregistered"); + return RAC_SUCCESS; + } + + const rac_result_t validation = validate_ops(ops); + if (validation != RAC_SUCCESS) { + RAC_LOG_ERROR(kTag, "Connect transport rejected: invalid ABI or mandatory operation"); + return validation; + } + + auto replacement = std::make_shared(); + replacement->ops = *ops; + replacement->user_data = user_data; + + if (replacement->ops.init != nullptr) { + const rac_result_t init_result = replacement->ops.init(user_data); + if (init_result != RAC_SUCCESS) { + RAC_LOG_ERROR(kTag, "Connect transport init failed: rc=%d", + static_cast(init_result)); + return init_result; + } + } + + std::shared_ptr retiring; + { + std::lock_guard lock(registry().mutex); + retiring = std::move(registry().active); + registry().active = replacement; + } + retiring.reset(); + + RAC_LOG_INFO(kTag, "Connect transport registered"); + return RAC_SUCCESS; +} + +rac_bool_t rac_connect_transport_is_registered(void) { + std::lock_guard lock(registry().mutex); + return registry().active != nullptr ? RAC_TRUE : RAC_FALSE; +} + +rac_result_t rac_connect_transport_open(const rac_connect_endpoint_t* endpoint, + rac_connect_channel_t* out_channel) { + if (endpoint == nullptr || out_channel == nullptr || + (endpoint->data == nullptr && endpoint->size > 0)) { + return RAC_ERROR_INVALID_ARGUMENT; + } + *out_channel = RAC_CONNECT_INVALID_CHANNEL; + + const std::shared_ptr slot = acquire_transport(); + if (slot == nullptr) { + return RAC_ERROR_ADAPTER_NOT_SET; + } + + const rac_result_t result = slot->ops.open(slot->user_data, endpoint, out_channel); + if (result == RAC_SUCCESS && *out_channel == RAC_CONNECT_INVALID_CHANNEL) { + return RAC_ERROR_PROCESSING_FAILED; + } + return result; +} + +rac_result_t rac_connect_transport_send(rac_connect_channel_t channel, const uint8_t* payload, + size_t payload_size) { + if (channel == RAC_CONNECT_INVALID_CHANNEL || payload == nullptr || payload_size == 0) { + return RAC_ERROR_INVALID_ARGUMENT; + } + + const std::shared_ptr slot = acquire_transport(); + if (slot == nullptr) { + return RAC_ERROR_ADAPTER_NOT_SET; + } + return slot->ops.send(slot->user_data, channel, payload, payload_size); +} + +rac_result_t rac_connect_transport_receive(rac_connect_channel_t channel, + rac_proto_buffer_t* out_payload) { + if (channel == RAC_CONNECT_INVALID_CHANNEL || out_payload == nullptr) { + return RAC_ERROR_INVALID_ARGUMENT; + } + rac_proto_buffer_init(out_payload); + + const std::shared_ptr slot = acquire_transport(); + if (slot == nullptr) { + rac_proto_buffer_set_error(out_payload, RAC_ERROR_ADAPTER_NOT_SET, + "Connect transport adapter is not registered"); + return RAC_ERROR_ADAPTER_NOT_SET; + } + + const rac_result_t result = slot->ops.receive(slot->user_data, channel, out_payload); + if (result != RAC_SUCCESS && out_payload->status == RAC_SUCCESS) { + rac_proto_buffer_set_error(out_payload, result, "Connect transport receive failed"); + } + return result; +} + +rac_result_t rac_connect_transport_close(rac_connect_channel_t channel) { + if (channel == RAC_CONNECT_INVALID_CHANNEL) { + return RAC_ERROR_INVALID_ARGUMENT; + } + + const std::shared_ptr slot = acquire_transport(); + if (slot == nullptr) { + return RAC_ERROR_ADAPTER_NOT_SET; + } + return slot->ops.close(slot->user_data, channel); +} + +} // extern "C" diff --git a/sdk/runanywhere-commons/src/generated/proto/connect.pb.cc b/sdk/runanywhere-commons/src/generated/proto/connect.pb.cc new file mode 100644 index 0000000000..76f96a7d85 --- /dev/null +++ b/sdk/runanywhere-commons/src/generated/proto/connect.pb.cc @@ -0,0 +1,8752 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: connect.proto +// Protobuf C++ Version: 7.35.1 + +#include "connect.pb.h" + +#include +#include +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/generated_message_tctable_impl.h" +#include "google/protobuf/internal_visibility.h" +#include "google/protobuf/extension_set.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/wire_format_lite.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/reflection_ops.h" +#include "google/protobuf/wire_format.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" +PROTOBUF_PRAGMA_INIT_SEG +namespace _pb = ::google::protobuf; +namespace _pbi = ::google::protobuf::internal; +namespace _fl = ::google::protobuf::internal::field_layout; +#ifdef PROTOBUF_MESSAGE_GLOBALS +namespace { +PROTOBUF_CONSTINIT ::google::protobuf::internal::ReflectionData + file_reflection_data[] = { + // ::runanywhere::v1::ConnectPlatformPolicyRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectPlatformPolicy + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectDiscoveryMetadata + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectModelDescriptor + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHostStartRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHostStopRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHostState + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectClientStartRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectClientHello + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHandshakeResponse + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectClientSessionState + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectSessionCloseRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectInvocationRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectInvocationValidation + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectInvocationEvent + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHeartbeatRequest + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHeartbeatResponse + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectClientFrame + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, + // ::runanywhere::v1::ConnectHostFrame + {&::_pbi::kDescriptorMethods, &::descriptor_table_connect_2eproto, /* tracker*/ nullptr,}, +}; +} // namespace +#endif +namespace runanywhere { +namespace v1 { +class ConnectSessionCloseRequest::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectSessionCloseRequest, _impl_._has_bits_); +}; + +constexpr ConnectSessionCloseRequest::ParseTableT_ ConnectSessionCloseRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectSessionCloseRequest, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967294, // skipmap + offsetof(ParseTableT_, field_entries), + 1, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectSessionCloseRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // string session_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectSessionCloseRequest, _impl_.session_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string session_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectSessionCloseRequest, _impl_.session_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\51\12\0\0\0\0\0\0" + "runanywhere.v1.ConnectSessionCloseRequest" + "session_id" + }}, + }; +} + + +inline constexpr ConnectSessionCloseRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + session_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()) {} + +template +constexpr ConnectSessionCloseRequest::ConnectSessionCloseRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectSessionCloseRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectSessionCloseRequest(arena); +} +constexpr auto ConnectSessionCloseRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectSessionCloseRequest), alignof(ConnectSessionCloseRequest)); +} +constexpr auto ConnectSessionCloseRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectSessionCloseRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectSessionCloseRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectSessionCloseRequest::ByteSizeLong, + &ConnectSessionCloseRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectSessionCloseRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[11], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectSessionCloseRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectSessionCloseRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectSessionCloseRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectSessionCloseRequest::InternalGenerateClassData_( + _default, &ConnectSessionCloseRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectSessionCloseRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectSessionCloseRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectSessionCloseRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectSessionCloseRequestGlobalsTypeInternal ConnectSessionCloseRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectSessionCloseRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectSessionCloseRequest_globals_.GetClassData(); +#else + return ConnectSessionCloseRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectPlatformPolicyRequest::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyRequest, _impl_._has_bits_); +}; + +constexpr ConnectPlatformPolicyRequest::ParseTableT_ ConnectPlatformPolicyRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyRequest, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967294, // skipmap + offsetof(ParseTableT_, field_entries), + 1, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectPlatformPolicyRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .runanywhere.v1.ConnectPlatform platform = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectPlatformPolicyRequest, _impl_.platform_), 0>(), + {8, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyRequest, _impl_.platform_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .runanywhere.v1.ConnectPlatform platform = 1; + {PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyRequest, _impl_.platform_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + }}, + // no aux_entries + {{ + }}, + }; +} + + +inline constexpr ConnectPlatformPolicyRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + platform_{static_cast< ::runanywhere::v1::ConnectPlatform >(0)} {} + +template +constexpr ConnectPlatformPolicyRequest::ConnectPlatformPolicyRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectPlatformPolicyRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectPlatformPolicyRequest(arena); +} +constexpr auto ConnectPlatformPolicyRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(ConnectPlatformPolicyRequest), alignof(ConnectPlatformPolicyRequest)); +} +constexpr auto ConnectPlatformPolicyRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectPlatformPolicyRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectPlatformPolicyRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectPlatformPolicyRequest::ByteSizeLong, + &ConnectPlatformPolicyRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[0], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectPlatformPolicyRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectPlatformPolicyRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectPlatformPolicyRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectPlatformPolicyRequest::InternalGenerateClassData_( + _default, &ConnectPlatformPolicyRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectPlatformPolicyRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectPlatformPolicyRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectPlatformPolicyRequestGlobalsTypeInternal ConnectPlatformPolicyRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectPlatformPolicyRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectPlatformPolicyRequest_globals_.GetClassData(); +#else + return ConnectPlatformPolicyRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectPlatformPolicy::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_._has_bits_); +}; + +constexpr ConnectPlatformPolicy::ParseTableT_ ConnectPlatformPolicy::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_._has_bits_), + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967288, // skipmap + offsetof(ParseTableT_, field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectPlatformPolicy>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // .runanywhere.v1.ConnectPlatform platform = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectPlatformPolicy, _impl_.platform_), 0>(), + {8, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.platform_)}}, + // .runanywhere.v1.ConnectRoleAvailability host_role = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectPlatformPolicy, _impl_.host_role_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.host_role_)}}, + // .runanywhere.v1.ConnectRoleAvailability client_role = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectPlatformPolicy, _impl_.client_role_), 2>(), + {24, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.client_role_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .runanywhere.v1.ConnectPlatform platform = 1; + {PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.platform_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // .runanywhere.v1.ConnectRoleAvailability host_role = 2; + {PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.host_role_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // .runanywhere.v1.ConnectRoleAvailability client_role = 3; + {PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.client_role_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + }}, + // no aux_entries + {{ + }}, + }; +} + + +inline constexpr ConnectPlatformPolicy::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + platform_{static_cast< ::runanywhere::v1::ConnectPlatform >(0)}, + host_role_{static_cast< ::runanywhere::v1::ConnectRoleAvailability >(0)}, + client_role_{static_cast< ::runanywhere::v1::ConnectRoleAvailability >(0)} {} + +template +constexpr ConnectPlatformPolicy::ConnectPlatformPolicy(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectPlatformPolicy::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectPlatformPolicy(arena); +} +constexpr auto ConnectPlatformPolicy::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(ConnectPlatformPolicy), alignof(ConnectPlatformPolicy)); +} +constexpr auto ConnectPlatformPolicy::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectPlatformPolicy::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectPlatformPolicy::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectPlatformPolicy::ByteSizeLong, + &ConnectPlatformPolicy::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[1], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectPlatformPolicyGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectPlatformPolicyGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectPlatformPolicy_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectPlatformPolicy::InternalGenerateClassData_( + _default, &ConnectPlatformPolicy_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectPlatformPolicyGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectPlatformPolicy _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicyGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectPlatformPolicyGlobalsTypeInternal ConnectPlatformPolicy_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectPlatformPolicy_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectPlatformPolicy_globals_.GetClassData(); +#else + return ConnectPlatformPolicy_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectModelDescriptor::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_._has_bits_); +}; + +constexpr ConnectModelDescriptor::ParseTableT_ ConnectModelDescriptor::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_._has_bits_), + 0, // no _extensions_ + 5, 56, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967264, // skipmap + offsetof(ParseTableT_, field_entries), + 5, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectModelDescriptor>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string model_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.model_id_)}}, + // string display_name = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.display_name_)}}, + // string framework = 3; + {::_pbi::TcParser::FastUS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.framework_)}}, + // uint32 context_window = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectModelDescriptor, _impl_.context_window_), 3>(), + {32, 3, 0, + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.context_window_)}}, + // bool supports_streaming = 5; + {::_pbi::TcParser::SingularVarintNoZag1(), + {40, 4, 0, + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.supports_streaming_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // string model_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.model_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string display_name = 2; + {PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.display_name_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string framework = 3; + {PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.framework_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // uint32 context_window = 4; + {PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.context_window_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + // bool supports_streaming = 5; + {PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.supports_streaming_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + }}, + // no aux_entries + {{ + "\45\10\14\11\0\0\0\0" + "runanywhere.v1.ConnectModelDescriptor" + "model_id" + "display_name" + "framework" + }}, + }; +} + + +inline constexpr ConnectModelDescriptor::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + model_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + display_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + framework_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + context_window_{0u}, + supports_streaming_{false} {} + +template +constexpr ConnectModelDescriptor::ConnectModelDescriptor(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectModelDescriptor::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectModelDescriptor(arena); +} +constexpr auto ConnectModelDescriptor::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectModelDescriptor), alignof(ConnectModelDescriptor)); +} +constexpr auto ConnectModelDescriptor::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectModelDescriptor::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectModelDescriptor::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectModelDescriptor::ByteSizeLong, + &ConnectModelDescriptor::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[3], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectModelDescriptorGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectModelDescriptorGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectModelDescriptor_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectModelDescriptor::InternalGenerateClassData_( + _default, &ConnectModelDescriptor_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectModelDescriptorGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectModelDescriptor _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectModelDescriptorGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectModelDescriptorGlobalsTypeInternal ConnectModelDescriptor_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectModelDescriptor_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectModelDescriptor_globals_.GetClassData(); +#else + return ConnectModelDescriptor_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectInvocationValidation::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_._has_bits_); +}; + +constexpr ConnectInvocationValidation::ParseTableT_ ConnectInvocationValidation::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967292, // skipmap + offsetof(ParseTableT_, field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectInvocationValidation>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // string rejection_reason = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_.rejection_reason_)}}, + // bool accepted = 1; + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_.accepted_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // bool accepted = 1; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_.accepted_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // string rejection_reason = 2; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_.rejection_reason_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\52\0\20\0\0\0\0\0" + "runanywhere.v1.ConnectInvocationValidation" + "rejection_reason" + }}, + }; +} + + +inline constexpr ConnectInvocationValidation::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + rejection_reason_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + accepted_{false} {} + +template +constexpr ConnectInvocationValidation::ConnectInvocationValidation(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectInvocationValidation::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectInvocationValidation(arena); +} +constexpr auto ConnectInvocationValidation::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectInvocationValidation), alignof(ConnectInvocationValidation)); +} +constexpr auto ConnectInvocationValidation::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectInvocationValidation::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectInvocationValidation::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectInvocationValidation::ByteSizeLong, + &ConnectInvocationValidation::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectInvocationValidation, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[13], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectInvocationValidationGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectInvocationValidationGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectInvocationValidation_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectInvocationValidation::InternalGenerateClassData_( + _default, &ConnectInvocationValidation_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectInvocationValidationGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectInvocationValidation _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectInvocationValidationGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectInvocationValidationGlobalsTypeInternal ConnectInvocationValidation_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectInvocationValidation_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectInvocationValidation_globals_.GetClassData(); +#else + return ConnectInvocationValidation_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHostStopRequest::_Internal { + public: +}; + +constexpr ConnectHostStopRequest::ParseTableT_ ConnectHostStopRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHostStopRequest, + _impl_._cached_size_), // no hasbits + 0, // no _extensions_ + 0, 0, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967295, // skipmap + offsetof(ParseTableT_, field_names), // no field_entries + 0, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHostStopRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, // no field_entries, or aux_entries + {{ + }}, + }; +} + +template +constexpr ConnectHostStopRequest::ConnectHostStopRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::internal::ZeroFieldsBase( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ) { +} +inline void* PROTOBUF_NONNULL ConnectHostStopRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHostStopRequest(arena); +} +constexpr auto ConnectHostStopRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(ConnectHostStopRequest), alignof(ConnectHostStopRequest)); +} +constexpr auto ConnectHostStopRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHostStopRequest::MergeImpl, + ::google::protobuf::internal::ZeroFieldsBase::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHostStopRequest::SharedDtor, + ::google::protobuf::internal::ZeroFieldsBase::GetClearImpl(), &ConnectHostStopRequest::ByteSizeLong, + &ConnectHostStopRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHostStopRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[5], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHostStopRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHostStopRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHostStopRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHostStopRequest::InternalGenerateClassData_( + _default, &ConnectHostStopRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHostStopRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHostStopRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHostStopRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHostStopRequestGlobalsTypeInternal ConnectHostStopRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHostStopRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHostStopRequest_globals_.GetClassData(); +#else + return ConnectHostStopRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHeartbeatResponse::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_._has_bits_); +}; + +constexpr ConnectHeartbeatResponse::ParseTableT_ ConnectHeartbeatResponse::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967292, // skipmap + offsetof(ParseTableT_, field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHeartbeatResponse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint64 sequence = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ConnectHeartbeatResponse, _impl_.sequence_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_.sequence_)}}, + // string session_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_.session_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string session_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_.session_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // uint64 sequence = 2; + {PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_.sequence_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + }}, + // no aux_entries + {{ + "\47\12\0\0\0\0\0\0" + "runanywhere.v1.ConnectHeartbeatResponse" + "session_id" + }}, + }; +} + + +inline constexpr ConnectHeartbeatResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + session_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + sequence_{::uint64_t{0u}} {} + +template +constexpr ConnectHeartbeatResponse::ConnectHeartbeatResponse(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectHeartbeatResponse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHeartbeatResponse(arena); +} +constexpr auto ConnectHeartbeatResponse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectHeartbeatResponse), alignof(ConnectHeartbeatResponse)); +} +constexpr auto ConnectHeartbeatResponse::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHeartbeatResponse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHeartbeatResponse::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectHeartbeatResponse::ByteSizeLong, + &ConnectHeartbeatResponse::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponse, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[16], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHeartbeatResponseGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHeartbeatResponseGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHeartbeatResponse_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHeartbeatResponse::InternalGenerateClassData_( + _default, &ConnectHeartbeatResponse_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHeartbeatResponseGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHeartbeatResponse _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHeartbeatResponseGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHeartbeatResponseGlobalsTypeInternal ConnectHeartbeatResponse_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHeartbeatResponse_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHeartbeatResponse_globals_.GetClassData(); +#else + return ConnectHeartbeatResponse_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHeartbeatRequest::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_._has_bits_); +}; + +constexpr ConnectHeartbeatRequest::ParseTableT_ ConnectHeartbeatRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967292, // skipmap + offsetof(ParseTableT_, field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHeartbeatRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint64 sequence = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ConnectHeartbeatRequest, _impl_.sequence_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_.sequence_)}}, + // string session_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_.session_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string session_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_.session_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // uint64 sequence = 2; + {PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_.sequence_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + }}, + // no aux_entries + {{ + "\46\12\0\0\0\0\0\0" + "runanywhere.v1.ConnectHeartbeatRequest" + "session_id" + }}, + }; +} + + +inline constexpr ConnectHeartbeatRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + session_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + sequence_{::uint64_t{0u}} {} + +template +constexpr ConnectHeartbeatRequest::ConnectHeartbeatRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectHeartbeatRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHeartbeatRequest(arena); +} +constexpr auto ConnectHeartbeatRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectHeartbeatRequest), alignof(ConnectHeartbeatRequest)); +} +constexpr auto ConnectHeartbeatRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHeartbeatRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHeartbeatRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectHeartbeatRequest::ByteSizeLong, + &ConnectHeartbeatRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[15], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHeartbeatRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHeartbeatRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHeartbeatRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHeartbeatRequest::InternalGenerateClassData_( + _default, &ConnectHeartbeatRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHeartbeatRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHeartbeatRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHeartbeatRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHeartbeatRequestGlobalsTypeInternal ConnectHeartbeatRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHeartbeatRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHeartbeatRequest_globals_.GetClassData(); +#else + return ConnectHeartbeatRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectDiscoveryMetadata::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_._has_bits_); +}; + +constexpr ConnectDiscoveryMetadata::ParseTableT_ ConnectDiscoveryMetadata::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967280, // skipmap + offsetof(ParseTableT_, field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectDiscoveryMetadata>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint32 protocol_version = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectDiscoveryMetadata, _impl_.protocol_version_), 3>(), + {32, 3, 0, + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.protocol_version_)}}, + // string instance_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.instance_id_)}}, + // string display_name = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.display_name_)}}, + // .runanywhere.v1.ConnectPlatform platform = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectDiscoveryMetadata, _impl_.platform_), 2>(), + {24, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.platform_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string instance_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.instance_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string display_name = 2; + {PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.display_name_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectPlatform platform = 3; + {PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.platform_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // uint32 protocol_version = 4; + {PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.protocol_version_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\47\13\14\0\0\0\0\0" + "runanywhere.v1.ConnectDiscoveryMetadata" + "instance_id" + "display_name" + }}, + }; +} + + +inline constexpr ConnectDiscoveryMetadata::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + instance_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + display_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + platform_{static_cast< ::runanywhere::v1::ConnectPlatform >(0)}, + protocol_version_{0u} {} + +template +constexpr ConnectDiscoveryMetadata::ConnectDiscoveryMetadata(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectDiscoveryMetadata::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectDiscoveryMetadata(arena); +} +constexpr auto ConnectDiscoveryMetadata::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectDiscoveryMetadata), alignof(ConnectDiscoveryMetadata)); +} +constexpr auto ConnectDiscoveryMetadata::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectDiscoveryMetadata::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectDiscoveryMetadata::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectDiscoveryMetadata::ByteSizeLong, + &ConnectDiscoveryMetadata::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[2], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectDiscoveryMetadataGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectDiscoveryMetadataGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectDiscoveryMetadata_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectDiscoveryMetadata::InternalGenerateClassData_( + _default, &ConnectDiscoveryMetadata_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectDiscoveryMetadataGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectDiscoveryMetadata _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadataGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectDiscoveryMetadataGlobalsTypeInternal ConnectDiscoveryMetadata_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectDiscoveryMetadata_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectDiscoveryMetadata_globals_.GetClassData(); +#else + return ConnectDiscoveryMetadata_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectClientStartRequest::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_._has_bits_); +}; + +constexpr ConnectClientStartRequest::ParseTableT_ ConnectClientStartRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_._has_bits_), + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967288, // skipmap + offsetof(ParseTableT_, field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectClientStartRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string display_name = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.display_name_)}}, + // .runanywhere.v1.ConnectPlatform platform = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectClientStartRequest, _impl_.platform_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.platform_)}}, + // uint32 protocol_version = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectClientStartRequest, _impl_.protocol_version_), 2>(), + {24, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.protocol_version_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string display_name = 1; + {PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.display_name_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectPlatform platform = 2; + {PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.platform_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // uint32 protocol_version = 3; + {PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.protocol_version_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\50\14\0\0\0\0\0\0" + "runanywhere.v1.ConnectClientStartRequest" + "display_name" + }}, + }; +} + + +inline constexpr ConnectClientStartRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + display_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + platform_{static_cast< ::runanywhere::v1::ConnectPlatform >(0)}, + protocol_version_{0u} {} + +template +constexpr ConnectClientStartRequest::ConnectClientStartRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectClientStartRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectClientStartRequest(arena); +} +constexpr auto ConnectClientStartRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectClientStartRequest), alignof(ConnectClientStartRequest)); +} +constexpr auto ConnectClientStartRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectClientStartRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectClientStartRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectClientStartRequest::ByteSizeLong, + &ConnectClientStartRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[7], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectClientStartRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectClientStartRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectClientStartRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectClientStartRequest::InternalGenerateClassData_( + _default, &ConnectClientStartRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectClientStartRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectClientStartRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectClientStartRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectClientStartRequestGlobalsTypeInternal ConnectClientStartRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectClientStartRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectClientStartRequest_globals_.GetClassData(); +#else + return ConnectClientStartRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectClientHello::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_._has_bits_); +}; + +constexpr ConnectClientHello::ParseTableT_ ConnectClientHello::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967280, // skipmap + offsetof(ParseTableT_, field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(ParseTableT_, field_names), // no aux_entries + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectClientHello>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint32 protocol_version = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectClientHello, _impl_.protocol_version_), 3>(), + {32, 3, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.protocol_version_)}}, + // string instance_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.instance_id_)}}, + // string display_name = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.display_name_)}}, + // .runanywhere.v1.ConnectPlatform platform = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectClientHello, _impl_.platform_), 2>(), + {24, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.platform_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string instance_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.instance_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string display_name = 2; + {PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.display_name_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectPlatform platform = 3; + {PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.platform_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // uint32 protocol_version = 4; + {PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.protocol_version_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\41\13\14\0\0\0\0\0" + "runanywhere.v1.ConnectClientHello" + "instance_id" + "display_name" + }}, + }; +} + + +inline constexpr ConnectClientHello::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + instance_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + display_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + platform_{static_cast< ::runanywhere::v1::ConnectPlatform >(0)}, + protocol_version_{0u} {} + +template +constexpr ConnectClientHello::ConnectClientHello(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectClientHello::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectClientHello(arena); +} +constexpr auto ConnectClientHello::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectClientHello), alignof(ConnectClientHello)); +} +constexpr auto ConnectClientHello::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectClientHello::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectClientHello::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectClientHello::ByteSizeLong, + &ConnectClientHello::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[8], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectClientHelloGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectClientHelloGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectClientHello_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectClientHello::InternalGenerateClassData_( + _default, &ConnectClientHello_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectClientHelloGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectClientHello _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectClientHelloGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectClientHelloGlobalsTypeInternal ConnectClientHello_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectClientHello_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectClientHello_globals_.GetClassData(); +#else + return ConnectClientHello_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHostState::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_._has_bits_); +}; + +constexpr ConnectHostState::ParseTableT_ ConnectHostState::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_._has_bits_), + 0, // no _extensions_ + 5, 56, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967264, // skipmap + offsetof(ParseTableT_, field_entries), + 5, // num_field_entries + 2, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHostState>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // bool is_hosting = 1; + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 3, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.is_hosting_)}}, + // .runanywhere.v1.ConnectDiscoveryMetadata discovery_metadata = 2; + {::_pbi::TcParser::FastMtS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.discovery_metadata_)}}, + // uint32 active_client_count = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectHostState, _impl_.active_client_count_), 4>(), + {24, 4, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.active_client_count_)}}, + // string error_message = 4; + {::_pbi::TcParser::FastUS1, + {34, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.error_message_)}}, + // .runanywhere.v1.ConnectModelDescriptor model = 5; + {::_pbi::TcParser::FastMtS1, + {42, 2, 1, + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.model_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // bool is_hosting = 1; + {PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.is_hosting_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // .runanywhere.v1.ConnectDiscoveryMetadata discovery_metadata = 2; + {PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.discovery_metadata_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // uint32 active_client_count = 3; + {PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.active_client_count_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + // string error_message = 4; + {PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.error_message_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectModelDescriptor model = 5; + {PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.model_), _Internal::kHasBitsOffset + 2, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectDiscoveryMetadata>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectDiscoveryMetadata_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectModelDescriptor>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectModelDescriptor_globals_}, + #endif + }}, + {{ + "\37\0\0\0\15\0\0\0" + "runanywhere.v1.ConnectHostState" + "error_message" + }}, + }; +} + + +inline constexpr ConnectHostState::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + error_message_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + discovery_metadata_{nullptr}, + model_{nullptr}, + is_hosting_{false}, + active_client_count_{0u} {} + +template +constexpr ConnectHostState::ConnectHostState(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectHostState::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHostState(arena); +} +constexpr auto ConnectHostState::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectHostState), alignof(ConnectHostState)); +} +constexpr auto ConnectHostState::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHostState::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHostState::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectHostState::ByteSizeLong, + &ConnectHostState::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[6], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHostStateGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHostStateGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHostState_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHostState::InternalGenerateClassData_( + _default, &ConnectHostState_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHostStateGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHostState _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHostStateGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHostStateGlobalsTypeInternal ConnectHostState_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHostState_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHostState_globals_.GetClassData(); +#else + return ConnectHostState_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHostStartRequest::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_._has_bits_); +}; + +constexpr ConnectHostStartRequest::ParseTableT_ ConnectHostStartRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967280, // skipmap + offsetof(ParseTableT_, field_entries), + 4, // num_field_entries + 1, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHostStartRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .runanywhere.v1.ConnectModelDescriptor model = 4; + {::_pbi::TcParser::FastMtS1, + {34, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.model_)}}, + // string display_name = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.display_name_)}}, + // .runanywhere.v1.ConnectPlatform platform = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectHostStartRequest, _impl_.platform_), 2>(), + {16, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.platform_)}}, + // uint32 protocol_version = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectHostStartRequest, _impl_.protocol_version_), 3>(), + {24, 3, 0, + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.protocol_version_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string display_name = 1; + {PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.display_name_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectPlatform platform = 2; + {PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.platform_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // uint32 protocol_version = 3; + {PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.protocol_version_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + // .runanywhere.v1.ConnectModelDescriptor model = 4; + {PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.model_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectModelDescriptor>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectModelDescriptor_globals_}, + #endif + }}, + {{ + "\46\14\0\0\0\0\0\0" + "runanywhere.v1.ConnectHostStartRequest" + "display_name" + }}, + }; +} + + +inline constexpr ConnectHostStartRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + display_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + model_{nullptr}, + platform_{static_cast< ::runanywhere::v1::ConnectPlatform >(0)}, + protocol_version_{0u} {} + +template +constexpr ConnectHostStartRequest::ConnectHostStartRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectHostStartRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHostStartRequest(arena); +} +constexpr auto ConnectHostStartRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectHostStartRequest), alignof(ConnectHostStartRequest)); +} +constexpr auto ConnectHostStartRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHostStartRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHostStartRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectHostStartRequest::ByteSizeLong, + &ConnectHostStartRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[4], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHostStartRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHostStartRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHostStartRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHostStartRequest::InternalGenerateClassData_( + _default, &ConnectHostStartRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHostStartRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHostStartRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHostStartRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHostStartRequestGlobalsTypeInternal ConnectHostStartRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHostStartRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHostStartRequest_globals_.GetClassData(); +#else + return ConnectHostStartRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHandshakeResponse::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_._has_bits_); +}; + +constexpr ConnectHandshakeResponse::ParseTableT_ ConnectHandshakeResponse::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_._has_bits_), + 0, // no _extensions_ + 5, 56, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967264, // skipmap + offsetof(ParseTableT_, field_entries), + 5, // num_field_entries + 2, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHandshakeResponse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // .runanywhere.v1.ConnectHandshakeStatus status = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectHandshakeResponse, _impl_.status_), 4>(), + {8, 4, 0, + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.status_)}}, + // string session_id = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.session_id_)}}, + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + {::_pbi::TcParser::FastMtS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.host_)}}, + // string rejection_reason = 4; + {::_pbi::TcParser::FastUS1, + {34, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.rejection_reason_)}}, + // .runanywhere.v1.ConnectModelDescriptor model = 5; + {::_pbi::TcParser::FastMtS1, + {42, 3, 1, + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.model_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // .runanywhere.v1.ConnectHandshakeStatus status = 1; + {PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.status_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // string session_id = 2; + {PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.session_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + {PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.host_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // string rejection_reason = 4; + {PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.rejection_reason_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectModelDescriptor model = 5; + {PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.model_), _Internal::kHasBitsOffset + 3, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectDiscoveryMetadata>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectDiscoveryMetadata_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectModelDescriptor>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectModelDescriptor_globals_}, + #endif + }}, + {{ + "\47\0\12\0\20\0\0\0" + "runanywhere.v1.ConnectHandshakeResponse" + "session_id" + "rejection_reason" + }}, + }; +} + + +inline constexpr ConnectHandshakeResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + session_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + rejection_reason_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + host_{nullptr}, + model_{nullptr}, + status_{static_cast< ::runanywhere::v1::ConnectHandshakeStatus >(0)} {} + +template +constexpr ConnectHandshakeResponse::ConnectHandshakeResponse(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectHandshakeResponse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHandshakeResponse(arena); +} +constexpr auto ConnectHandshakeResponse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectHandshakeResponse), alignof(ConnectHandshakeResponse)); +} +constexpr auto ConnectHandshakeResponse::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHandshakeResponse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHandshakeResponse::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectHandshakeResponse::ByteSizeLong, + &ConnectHandshakeResponse::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[9], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHandshakeResponseGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHandshakeResponseGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHandshakeResponse_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHandshakeResponse::InternalGenerateClassData_( + _default, &ConnectHandshakeResponse_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHandshakeResponseGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHandshakeResponse _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponseGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHandshakeResponseGlobalsTypeInternal ConnectHandshakeResponse_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHandshakeResponse_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHandshakeResponse_globals_.GetClassData(); +#else + return ConnectHandshakeResponse_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectClientSessionState::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_._has_bits_); +}; + +constexpr ConnectClientSessionState::ParseTableT_ ConnectClientSessionState::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_._has_bits_), + 0, // no _extensions_ + 5, 56, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967264, // skipmap + offsetof(ParseTableT_, field_entries), + 5, // num_field_entries + 2, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectClientSessionState>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // .runanywhere.v1.ConnectSessionState state = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ConnectClientSessionState, _impl_.state_), 4>(), + {8, 4, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.state_)}}, + // string session_id = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.session_id_)}}, + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + {::_pbi::TcParser::FastMtS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.host_)}}, + // string error_message = 4; + {::_pbi::TcParser::FastUS1, + {34, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.error_message_)}}, + // .runanywhere.v1.ConnectModelDescriptor model = 5; + {::_pbi::TcParser::FastMtS1, + {42, 3, 1, + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.model_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // .runanywhere.v1.ConnectSessionState state = 1; + {PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.state_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // string session_id = 2; + {PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.session_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + {PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.host_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // string error_message = 4; + {PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.error_message_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.ConnectModelDescriptor model = 5; + {PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.model_), _Internal::kHasBitsOffset + 3, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectDiscoveryMetadata>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectDiscoveryMetadata_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectModelDescriptor>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectModelDescriptor_globals_}, + #endif + }}, + {{ + "\50\0\12\0\15\0\0\0" + "runanywhere.v1.ConnectClientSessionState" + "session_id" + "error_message" + }}, + }; +} + + +inline constexpr ConnectClientSessionState::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + session_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + error_message_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + host_{nullptr}, + model_{nullptr}, + state_{static_cast< ::runanywhere::v1::ConnectSessionState >(0)} {} + +template +constexpr ConnectClientSessionState::ConnectClientSessionState(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectClientSessionState::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectClientSessionState(arena); +} +constexpr auto ConnectClientSessionState::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectClientSessionState), alignof(ConnectClientSessionState)); +} +constexpr auto ConnectClientSessionState::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectClientSessionState::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectClientSessionState::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectClientSessionState::ByteSizeLong, + &ConnectClientSessionState::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[10], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectClientSessionStateGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectClientSessionStateGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectClientSessionState_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectClientSessionState::InternalGenerateClassData_( + _default, &ConnectClientSessionState_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectClientSessionStateGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectClientSessionState _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectClientSessionStateGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectClientSessionStateGlobalsTypeInternal ConnectClientSessionState_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectClientSessionState_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectClientSessionState_globals_.GetClassData(); +#else + return ConnectClientSessionState_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectInvocationEvent::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_._has_bits_); +}; + +constexpr ConnectInvocationEvent::ParseTableT_ ConnectInvocationEvent::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967292, // skipmap + offsetof(ParseTableT_, field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectInvocationEvent>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .runanywhere.v1.LLMStreamEvent event = 2; + {::_pbi::TcParser::FastMtS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_.event_)}}, + // string request_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_.request_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string request_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_.request_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.LLMStreamEvent event = 2; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_.event_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::LLMStreamEvent>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::LLMStreamEvent_globals_}, + #endif + }}, + {{ + "\45\12\0\0\0\0\0\0" + "runanywhere.v1.ConnectInvocationEvent" + "request_id" + }}, + }; +} + + +inline constexpr ConnectInvocationEvent::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + request_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + event_{nullptr} {} + +template +constexpr ConnectInvocationEvent::ConnectInvocationEvent(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectInvocationEvent::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectInvocationEvent(arena); +} +constexpr auto ConnectInvocationEvent::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectInvocationEvent), alignof(ConnectInvocationEvent)); +} +constexpr auto ConnectInvocationEvent::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectInvocationEvent::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectInvocationEvent::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectInvocationEvent::ByteSizeLong, + &ConnectInvocationEvent::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectInvocationEvent, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[14], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectInvocationEventGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectInvocationEventGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectInvocationEvent_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectInvocationEvent::InternalGenerateClassData_( + _default, &ConnectInvocationEvent_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectInvocationEventGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectInvocationEvent _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectInvocationEventGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectInvocationEventGlobalsTypeInternal ConnectInvocationEvent_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectInvocationEvent_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectInvocationEvent_globals_.GetClassData(); +#else + return ConnectInvocationEvent_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectHostFrame::_Internal { + public: + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostFrame, _impl_._oneof_case_); +}; + +constexpr ConnectHostFrame::ParseTableT_ ConnectHostFrame::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectHostFrame, + _impl_._cached_size_), // no hasbits + 0, // no _extensions_ + 2, 0, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967292, // skipmap + offsetof(ParseTableT_, field_entries), + 2, // num_field_entries + 2, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHostFrame>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // .runanywhere.v1.ConnectInvocationEvent invocation_event = 1; + {PROTOBUF_FIELD_OFFSET(ConnectHostFrame, _impl_.payload_.invocation_event_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .runanywhere.v1.ConnectHeartbeatResponse heartbeat = 2; + {PROTOBUF_FIELD_OFFSET(ConnectHostFrame, _impl_.payload_.heartbeat_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectInvocationEvent>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectInvocationEvent_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHeartbeatResponse>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectHeartbeatResponse_globals_}, + #endif + }}, + {{ + }}, + }; +} + + +inline constexpr ConnectHostFrame::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : payload_{}, + _cached_size_{0}, + _oneof_case_{} {} + +template +constexpr ConnectHostFrame::ConnectHostFrame(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectHostFrame::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectHostFrame(arena); +} +constexpr auto ConnectHostFrame::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(ConnectHostFrame), alignof(ConnectHostFrame)); +} +constexpr auto ConnectHostFrame::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectHostFrame::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectHostFrame::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectHostFrame::ByteSizeLong, + &ConnectHostFrame::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectHostFrame, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[18], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectHostFrameGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectHostFrameGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectHostFrame_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectHostFrame::InternalGenerateClassData_( + _default, &ConnectHostFrame_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectHostFrameGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectHostFrame _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectHostFrameGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectHostFrameGlobalsTypeInternal ConnectHostFrame_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectHostFrame_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectHostFrame_globals_.GetClassData(); +#else + return ConnectHostFrame_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectInvocationRequest::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_._has_bits_); +}; + +constexpr ConnectInvocationRequest::ParseTableT_ ConnectInvocationRequest::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_._has_bits_), + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967288, // skipmap + offsetof(ParseTableT_, field_entries), + 3, // num_field_entries + 1, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectInvocationRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string session_id = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_.session_id_)}}, + // string request_id = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_.request_id_)}}, + // .runanywhere.v1.LLMGenerateRequest generation = 3; + {::_pbi::TcParser::FastMtS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_.generation_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string session_id = 1; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_.session_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string request_id = 2; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_.request_id_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .runanywhere.v1.LLMGenerateRequest generation = 3; + {PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_.generation_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::LLMGenerateRequest>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::LLMGenerateRequest_globals_}, + #endif + }}, + {{ + "\47\12\12\0\0\0\0\0" + "runanywhere.v1.ConnectInvocationRequest" + "session_id" + "request_id" + }}, + }; +} + + +inline constexpr ConnectInvocationRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + session_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + request_id_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + generation_{nullptr} {} + +template +constexpr ConnectInvocationRequest::ConnectInvocationRequest(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectInvocationRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectInvocationRequest(arena); +} +constexpr auto ConnectInvocationRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ConnectInvocationRequest), alignof(ConnectInvocationRequest)); +} +constexpr auto ConnectInvocationRequest::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectInvocationRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectInvocationRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectInvocationRequest::ByteSizeLong, + &ConnectInvocationRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectInvocationRequest, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[12], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectInvocationRequestGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectInvocationRequestGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectInvocationRequest_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectInvocationRequest::InternalGenerateClassData_( + _default, &ConnectInvocationRequest_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectInvocationRequestGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectInvocationRequest _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectInvocationRequestGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectInvocationRequestGlobalsTypeInternal ConnectInvocationRequest_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectInvocationRequest_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectInvocationRequest_globals_.GetClassData(); +#else + return ConnectInvocationRequest_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +class ConnectClientFrame::_Internal { + public: + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientFrame, _impl_._oneof_case_); +}; + +constexpr ConnectClientFrame::ParseTableT_ ConnectClientFrame::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(ConnectClientFrame, + _impl_._cached_size_), // no hasbits + 0, // no _extensions_ + 2, 0, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967292, // skipmap + offsetof(ParseTableT_, field_entries), + 2, // num_field_entries + 2, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectClientFrame>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // .runanywhere.v1.ConnectInvocationRequest invocation = 1; + {PROTOBUF_FIELD_OFFSET(ConnectClientFrame, _impl_.payload_.invocation_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .runanywhere.v1.ConnectHeartbeatRequest heartbeat = 2; + {PROTOBUF_FIELD_OFFSET(ConnectClientFrame, _impl_.payload_.heartbeat_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectInvocationRequest>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectInvocationRequest_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::runanywhere::v1::ConnectHeartbeatRequest>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::runanywhere::v1::ConnectHeartbeatRequest_globals_}, + #endif + }}, + {{ + }}, + }; +} + + +inline constexpr ConnectClientFrame::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : payload_{}, + _cached_size_{0}, + _oneof_case_{} {} + +template +constexpr ConnectClientFrame::ConnectClientFrame(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : ::google::protobuf::Message( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL ConnectClientFrame::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ConnectClientFrame(arena); +} +constexpr auto ConnectClientFrame::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(ConnectClientFrame), alignof(ConnectClientFrame)); +} +constexpr auto ConnectClientFrame::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &ConnectClientFrame::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ConnectClientFrame::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ConnectClientFrame::ByteSizeLong, + &ConnectClientFrame::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ConnectClientFrame, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[17], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_connect_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ConnectClientFrameGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ConnectClientFrameGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + ConnectClientFrame_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(ConnectClientFrame::InternalGenerateClassData_( + _default, &ConnectClientFrame_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ConnectClientFrameGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) ConnectClientFrame _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ConnectClientFrameGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ConnectClientFrameGlobalsTypeInternal ConnectClientFrame_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* ConnectClientFrame_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return ConnectClientFrame_globals_.GetClassData(); +#else + return ConnectClientFrame_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE +} // namespace v1 +} // namespace runanywhere +static const ::_pb::EnumDescriptor* PROTOBUF_NONNULL + file_level_enum_descriptors_connect_2eproto[4]; +static constexpr const ::_pb::ServiceDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE + file_level_service_descriptors_connect_2eproto = nullptr; +const ::uint32_t + TableStruct_connect_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectPlatformPolicyRequest, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectPlatformPolicyRequest, _impl_.platform_), + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectPlatformPolicy, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectPlatformPolicy, _impl_.platform_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectPlatformPolicy, _impl_.host_role_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectPlatformPolicy, _impl_.client_role_), + 0, + 1, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectDiscoveryMetadata, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectDiscoveryMetadata, _impl_.instance_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectDiscoveryMetadata, _impl_.display_name_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectDiscoveryMetadata, _impl_.platform_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectDiscoveryMetadata, _impl_.protocol_version_), + 0, + 1, + 2, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectModelDescriptor, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectModelDescriptor, _impl_.model_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectModelDescriptor, _impl_.display_name_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectModelDescriptor, _impl_.framework_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectModelDescriptor, _impl_.context_window_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectModelDescriptor, _impl_.supports_streaming_), + 0, + 1, + 2, + 3, + 4, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostStartRequest, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostStartRequest, _impl_.display_name_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostStartRequest, _impl_.platform_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostStartRequest, _impl_.protocol_version_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostStartRequest, _impl_.model_), + 0, + 2, + 3, + 1, + 0x000, // bitmap + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostState, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostState, _impl_.is_hosting_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostState, _impl_.discovery_metadata_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostState, _impl_.active_client_count_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostState, _impl_.error_message_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostState, _impl_.model_), + 3, + 1, + 4, + 0, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientStartRequest, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientStartRequest, _impl_.display_name_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientStartRequest, _impl_.platform_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientStartRequest, _impl_.protocol_version_), + 0, + 1, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientHello, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientHello, _impl_.instance_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientHello, _impl_.display_name_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientHello, _impl_.platform_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientHello, _impl_.protocol_version_), + 0, + 1, + 2, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHandshakeResponse, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHandshakeResponse, _impl_.status_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHandshakeResponse, _impl_.session_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHandshakeResponse, _impl_.host_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHandshakeResponse, _impl_.rejection_reason_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHandshakeResponse, _impl_.model_), + 4, + 0, + 2, + 1, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientSessionState, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientSessionState, _impl_.state_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientSessionState, _impl_.session_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientSessionState, _impl_.host_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientSessionState, _impl_.error_message_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientSessionState, _impl_.model_), + 4, + 0, + 2, + 1, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectSessionCloseRequest, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectSessionCloseRequest, _impl_.session_id_), + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationRequest, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationRequest, _impl_.session_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationRequest, _impl_.request_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationRequest, _impl_.generation_), + 0, + 1, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationValidation, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationValidation, _impl_.accepted_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationValidation, _impl_.rejection_reason_), + 1, + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationEvent, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationEvent, _impl_.request_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectInvocationEvent, _impl_.event_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHeartbeatRequest, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHeartbeatRequest, _impl_.session_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHeartbeatRequest, _impl_.sequence_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHeartbeatResponse, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHeartbeatResponse, _impl_.session_id_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHeartbeatResponse, _impl_.sequence_), + 0, + 1, + 0x004, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientFrame, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientFrame, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientFrame, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectClientFrame, _impl_.payload_), + 0x004, // bitmap + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostFrame, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostFrame, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostFrame, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::runanywhere::v1::ConnectHostFrame, _impl_.payload_), +}; + +static const ::_pbi::MigrationSchema + schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, sizeof(::runanywhere::v1::ConnectPlatformPolicyRequest)}, + {5, sizeof(::runanywhere::v1::ConnectPlatformPolicy)}, + {14, sizeof(::runanywhere::v1::ConnectDiscoveryMetadata)}, + {25, sizeof(::runanywhere::v1::ConnectModelDescriptor)}, + {38, sizeof(::runanywhere::v1::ConnectHostStartRequest)}, + {49, sizeof(::runanywhere::v1::ConnectHostStopRequest)}, + {50, sizeof(::runanywhere::v1::ConnectHostState)}, + {63, sizeof(::runanywhere::v1::ConnectClientStartRequest)}, + {72, sizeof(::runanywhere::v1::ConnectClientHello)}, + {83, sizeof(::runanywhere::v1::ConnectHandshakeResponse)}, + {96, sizeof(::runanywhere::v1::ConnectClientSessionState)}, + {109, sizeof(::runanywhere::v1::ConnectSessionCloseRequest)}, + {114, sizeof(::runanywhere::v1::ConnectInvocationRequest)}, + {123, sizeof(::runanywhere::v1::ConnectInvocationValidation)}, + {130, sizeof(::runanywhere::v1::ConnectInvocationEvent)}, + {137, sizeof(::runanywhere::v1::ConnectHeartbeatRequest)}, + {144, sizeof(::runanywhere::v1::ConnectHeartbeatResponse)}, + {151, sizeof(::runanywhere::v1::ConnectClientFrame)}, + {156, sizeof(::runanywhere::v1::ConnectHostFrame)}, +}; +static const ::_pbi::MessageGlobalsBase* PROTOBUF_NONNULL const + file_message_globals[] = { + &::runanywhere::v1::ConnectPlatformPolicyRequest_globals_, + &::runanywhere::v1::ConnectPlatformPolicy_globals_, + &::runanywhere::v1::ConnectDiscoveryMetadata_globals_, + &::runanywhere::v1::ConnectModelDescriptor_globals_, + &::runanywhere::v1::ConnectHostStartRequest_globals_, + &::runanywhere::v1::ConnectHostStopRequest_globals_, + &::runanywhere::v1::ConnectHostState_globals_, + &::runanywhere::v1::ConnectClientStartRequest_globals_, + &::runanywhere::v1::ConnectClientHello_globals_, + &::runanywhere::v1::ConnectHandshakeResponse_globals_, + &::runanywhere::v1::ConnectClientSessionState_globals_, + &::runanywhere::v1::ConnectSessionCloseRequest_globals_, + &::runanywhere::v1::ConnectInvocationRequest_globals_, + &::runanywhere::v1::ConnectInvocationValidation_globals_, + &::runanywhere::v1::ConnectInvocationEvent_globals_, + &::runanywhere::v1::ConnectHeartbeatRequest_globals_, + &::runanywhere::v1::ConnectHeartbeatResponse_globals_, + &::runanywhere::v1::ConnectClientFrame_globals_, + &::runanywhere::v1::ConnectHostFrame_globals_, +}; +const char descriptor_table_protodef_connect_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + "\n\rconnect.proto\022\016runanywhere.v1\032\021llm_ser" + "vice.proto\"Q\n\034ConnectPlatformPolicyReque" + "st\0221\n\010platform\030\001 \001(\0162\037.runanywhere.v1.Co" + "nnectPlatform\"\304\001\n\025ConnectPlatformPolicy\022" + "1\n\010platform\030\001 \001(\0162\037.runanywhere.v1.Conne" + "ctPlatform\022:\n\thost_role\030\002 \001(\0162\'.runanywh" + "ere.v1.ConnectRoleAvailability\022<\n\013client" + "_role\030\003 \001(\0162\'.runanywhere.v1.ConnectRole" + "Availability\"\222\001\n\030ConnectDiscoveryMetadat" + "a\022\023\n\013instance_id\030\001 \001(\t\022\024\n\014display_name\030\002" + " \001(\t\0221\n\010platform\030\003 \001(\0162\037.runanywhere.v1." + "ConnectPlatform\022\030\n\020protocol_version\030\004 \001(" + "\r\"\207\001\n\026ConnectModelDescriptor\022\020\n\010model_id" + "\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\021\n\tframewor" + "k\030\003 \001(\t\022\026\n\016context_window\030\004 \001(\r\022\032\n\022suppo" + "rts_streaming\030\005 \001(\010\"\263\001\n\027ConnectHostStart" + "Request\022\024\n\014display_name\030\001 \001(\t\0221\n\010platfor" + "m\030\002 \001(\0162\037.runanywhere.v1.ConnectPlatform" + "\022\030\n\020protocol_version\030\003 \001(\r\0225\n\005model\030\004 \001(" + "\0132&.runanywhere.v1.ConnectModelDescripto" + "r\"\030\n\026ConnectHostStopRequest\"\327\001\n\020ConnectH" + "ostState\022\022\n\nis_hosting\030\001 \001(\010\022D\n\022discover" + "y_metadata\030\002 \001(\0132(.runanywhere.v1.Connec" + "tDiscoveryMetadata\022\033\n\023active_client_coun" + "t\030\003 \001(\r\022\025\n\rerror_message\030\004 \001(\t\0225\n\005model\030" + "\005 \001(\0132&.runanywhere.v1.ConnectModelDescr" + "iptor\"~\n\031ConnectClientStartRequest\022\024\n\014di" + "splay_name\030\001 \001(\t\0221\n\010platform\030\002 \001(\0162\037.run" + "anywhere.v1.ConnectPlatform\022\030\n\020protocol_" + "version\030\003 \001(\r\"\214\001\n\022ConnectClientHello\022\023\n\013" + "instance_id\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022" + "1\n\010platform\030\003 \001(\0162\037.runanywhere.v1.Conne" + "ctPlatform\022\030\n\020protocol_version\030\004 \001(\r\"\357\001\n" + "\030ConnectHandshakeResponse\0226\n\006status\030\001 \001(" + "\0162&.runanywhere.v1.ConnectHandshakeStatu" + "s\022\022\n\nsession_id\030\002 \001(\t\0226\n\004host\030\003 \001(\0132(.ru" + "nanywhere.v1.ConnectDiscoveryMetadata\022\030\n" + "\020rejection_reason\030\004 \001(\t\0225\n\005model\030\005 \001(\0132&" + ".runanywhere.v1.ConnectModelDescriptor\"\351" + "\001\n\031ConnectClientSessionState\0222\n\005state\030\001 " + "\001(\0162#.runanywhere.v1.ConnectSessionState" + "\022\022\n\nsession_id\030\002 \001(\t\0226\n\004host\030\003 \001(\0132(.run" + "anywhere.v1.ConnectDiscoveryMetadata\022\025\n\r" + "error_message\030\004 \001(\t\0225\n\005model\030\005 \001(\0132&.run" + "anywhere.v1.ConnectModelDescriptor\"0\n\032Co" + "nnectSessionCloseRequest\022\022\n\nsession_id\030\001" + " \001(\t\"z\n\030ConnectInvocationRequest\022\022\n\nsess" + "ion_id\030\001 \001(\t\022\022\n\nrequest_id\030\002 \001(\t\0226\n\ngene" + "ration\030\003 \001(\0132\".runanywhere.v1.LLMGenerat" + "eRequest\"I\n\033ConnectInvocationValidation\022" + "\020\n\010accepted\030\001 \001(\010\022\030\n\020rejection_reason\030\002 " + "\001(\t\"[\n\026ConnectInvocationEvent\022\022\n\nrequest" + "_id\030\001 \001(\t\022-\n\005event\030\002 \001(\0132\036.runanywhere.v" + "1.LLMStreamEvent\"\?\n\027ConnectHeartbeatRequ" + "est\022\022\n\nsession_id\030\001 \001(\t\022\020\n\010sequence\030\002 \001(" + "\004\"@\n\030ConnectHeartbeatResponse\022\022\n\nsession" + "_id\030\001 \001(\t\022\020\n\010sequence\030\002 \001(\004\"\235\001\n\022ConnectC" + "lientFrame\022>\n\ninvocation\030\001 \001(\0132(.runanyw" + "here.v1.ConnectInvocationRequestH\000\022<\n\the" + "artbeat\030\002 \001(\0132\'.runanywhere.v1.ConnectHe" + "artbeatRequestH\000B\t\n\007payload\"\240\001\n\020ConnectH" + "ostFrame\022B\n\020invocation_event\030\001 \001(\0132&.run" + "anywhere.v1.ConnectInvocationEventH\000\022=\n\t" + "heartbeat\030\002 \001(\0132(.runanywhere.v1.Connect" + "HeartbeatResponseH\000B\t\n\007payload*\235\002\n\017Conne" + "ctPlatform\022 \n\034CONNECT_PLATFORM_UNSPECIFI" + "ED\020\000\022\032\n\026CONNECT_PLATFORM_MACOS\020\001\022\030\n\024CONN" + "ECT_PLATFORM_IOS\020\002\022\033\n\027CONNECT_PLATFORM_I" + "PADOS\020\003\022\034\n\030CONNECT_PLATFORM_ANDROID\020\004\022!\n" + "\035CONNECT_PLATFORM_REACT_NATIVE\020\005\022\034\n\030CONN" + "ECT_PLATFORM_FLUTTER\020\006\022\030\n\024CONNECT_PLATFO" + "RM_WEB\020\007\022\034\n\030CONNECT_PLATFORM_WINDOWS\020\010*\272" + "\001\n\027ConnectRoleAvailability\022)\n%CONNECT_RO" + "LE_AVAILABILITY_UNSPECIFIED\020\000\022&\n\"CONNECT" + "_ROLE_AVAILABILITY_DISABLED\020\001\022%\n!CONNECT" + "_ROLE_AVAILABILITY_PLANNED\020\002\022%\n!CONNECT_" + "ROLE_AVAILABILITY_ENABLED\020\003*\220\001\n\026ConnectH" + "andshakeStatus\022(\n$CONNECT_HANDSHAKE_STAT" + "US_UNSPECIFIED\020\000\022%\n!CONNECT_HANDSHAKE_ST" + "ATUS_ACCEPTED\020\001\022%\n!CONNECT_HANDSHAKE_STA" + "TUS_REJECTED\020\002*\321\001\n\023ConnectSessionState\022%" + "\n!CONNECT_SESSION_STATE_UNSPECIFIED\020\000\022$\n" + " CONNECT_SESSION_STATE_CONNECTING\020\001\022#\n\037C" + "ONNECT_SESSION_STATE_CONNECTED\020\002\022&\n\"CONN" + "ECT_SESSION_STATE_DISCONNECTED\020\003\022 \n\034CONN" + "ECT_SESSION_STATE_FAILED\020\004B\207\001\n\027ai.runany" + "where.proto.v1B\014ConnectProtoP\001Z( + from._internal_metadata_); +} +PROTOBUF_NDEBUG_INLINE ConnectPlatformPolicyRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void ConnectPlatformPolicyRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.platform_ = {}; +} +ConnectPlatformPolicyRequest::~ConnectPlatformPolicyRequest() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectPlatformPolicyRequest) + SharedDtor(*this); +} +inline void ConnectPlatformPolicyRequest::SharedDtor(MessageLite& self) { + ConnectPlatformPolicyRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectPlatformPolicyRequest_class_data_ = + ConnectPlatformPolicyRequest::InternalGenerateClassData_(ConnectPlatformPolicyRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectPlatformPolicyRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectPlatformPolicyRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectPlatformPolicyRequest_class_data_.tc_table); + return ConnectPlatformPolicyRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectPlatformPolicyRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectPlatformPolicyRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectPlatformPolicyRequest_globals_)); + return ConnectPlatformPolicyRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectPlatformPolicyRequest::ParseTableT_ + ConnectPlatformPolicyRequest::_table_ = + ConnectPlatformPolicyRequest::InternalGenerateParseTable_(ConnectPlatformPolicyRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectPlatformPolicyRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectPlatformPolicyRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.platform_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectPlatformPolicyRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectPlatformPolicyRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectPlatformPolicyRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectPlatformPolicyRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectPlatformPolicyRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .runanywhere.v1.ConnectPlatform platform = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_platform() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this_._internal_platform(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectPlatformPolicyRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectPlatformPolicyRequest::ByteSizeLong(const MessageLite& base) { + const ConnectPlatformPolicyRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectPlatformPolicyRequest::ByteSizeLong() const { + const ConnectPlatformPolicyRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectPlatformPolicyRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + { + // .runanywhere.v1.ConnectPlatform platform = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_platform() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_platform()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectPlatformPolicyRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectPlatformPolicyRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (from._internal_platform() != 0) { + _this->_impl_.platform_ = from._impl_.platform_; + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectPlatformPolicyRequest::CopyFrom(const ConnectPlatformPolicyRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectPlatformPolicyRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectPlatformPolicyRequest::InternalSwap(ConnectPlatformPolicyRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + swap(_impl_.platform_, other->_impl_.platform_); +} + +::google::protobuf::Metadata ConnectPlatformPolicyRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectPlatformPolicy::ConnectPlatformPolicy(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectPlatformPolicy_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectPlatformPolicy) +} +ConnectPlatformPolicy::ConnectPlatformPolicy( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectPlatformPolicy& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectPlatformPolicy_get_class_data()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(from._impl_) { + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} +PROTOBUF_NDEBUG_INLINE ConnectPlatformPolicy::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void ConnectPlatformPolicy::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + 0, + offsetof(Impl_, client_role_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::client_role_)); +} +ConnectPlatformPolicy::~ConnectPlatformPolicy() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectPlatformPolicy) + SharedDtor(*this); +} +inline void ConnectPlatformPolicy::SharedDtor(MessageLite& self) { + ConnectPlatformPolicy& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectPlatformPolicy_class_data_ = + ConnectPlatformPolicy::InternalGenerateClassData_(ConnectPlatformPolicy_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectPlatformPolicy::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectPlatformPolicy_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectPlatformPolicy_class_data_.tc_table); + return ConnectPlatformPolicy_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectPlatformPolicy::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectPlatformPolicy_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectPlatformPolicy_globals_)); + return ConnectPlatformPolicy_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectPlatformPolicy::ParseTableT_ + ConnectPlatformPolicy::_table_ = + ConnectPlatformPolicy::InternalGenerateParseTable_(ConnectPlatformPolicy_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectPlatformPolicy::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectPlatformPolicy) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + ::memset(&_impl_.platform_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.client_role_) - + reinterpret_cast(&_impl_.platform_)) + sizeof(_impl_.client_role_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectPlatformPolicy::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectPlatformPolicy& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectPlatformPolicy::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectPlatformPolicy& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectPlatformPolicy) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .runanywhere.v1.ConnectPlatform platform = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_platform() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this_._internal_platform(), target); + } + } + + // .runanywhere.v1.ConnectRoleAvailability host_role = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_host_role() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this_._internal_host_role(), target); + } + } + + // .runanywhere.v1.ConnectRoleAvailability client_role = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_client_role() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this_._internal_client_role(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectPlatformPolicy) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectPlatformPolicy::ByteSizeLong(const MessageLite& base) { + const ConnectPlatformPolicy& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectPlatformPolicy::ByteSizeLong() const { + const ConnectPlatformPolicy& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectPlatformPolicy) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + // .runanywhere.v1.ConnectPlatform platform = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_platform() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_platform()); + } + } + // .runanywhere.v1.ConnectRoleAvailability host_role = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_host_role() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_host_role()); + } + } + // .runanywhere.v1.ConnectRoleAvailability client_role = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_client_role() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_client_role()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectPlatformPolicy::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectPlatformPolicy) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (from._internal_platform() != 0) { + _this->_impl_.platform_ = from._impl_.platform_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_host_role() != 0) { + _this->_impl_.host_role_ = from._impl_.host_role_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_client_role() != 0) { + _this->_impl_.client_role_ = from._impl_.client_role_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectPlatformPolicy::CopyFrom(const ConnectPlatformPolicy& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectPlatformPolicy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectPlatformPolicy::InternalSwap(ConnectPlatformPolicy* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.client_role_) + + sizeof(ConnectPlatformPolicy::_impl_.client_role_) + - PROTOBUF_FIELD_OFFSET(ConnectPlatformPolicy, _impl_.platform_)>( + reinterpret_cast(&_impl_.platform_), + reinterpret_cast(&other->_impl_.platform_)); +} + +::google::protobuf::Metadata ConnectPlatformPolicy::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectDiscoveryMetadata::ConnectDiscoveryMetadata(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectDiscoveryMetadata_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectDiscoveryMetadata) +} +PROTOBUF_NDEBUG_INLINE ConnectDiscoveryMetadata::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectDiscoveryMetadata& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + instance_id_(arena, from.instance_id_), + display_name_(arena, from.display_name_) {} + +ConnectDiscoveryMetadata::ConnectDiscoveryMetadata( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectDiscoveryMetadata& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectDiscoveryMetadata_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectDiscoveryMetadata* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, platform_), + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectDiscoveryMetadata) +} +PROTOBUF_NDEBUG_INLINE ConnectDiscoveryMetadata::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + instance_id_(arena), + display_name_(arena) {} + +inline void ConnectDiscoveryMetadata::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + 0, + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); +} +ConnectDiscoveryMetadata::~ConnectDiscoveryMetadata() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectDiscoveryMetadata) + SharedDtor(*this); +} +inline void ConnectDiscoveryMetadata::SharedDtor(MessageLite& self) { + ConnectDiscoveryMetadata& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.instance_id_.Destroy(); + this_._impl_.display_name_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectDiscoveryMetadata_class_data_ = + ConnectDiscoveryMetadata::InternalGenerateClassData_(ConnectDiscoveryMetadata_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectDiscoveryMetadata::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectDiscoveryMetadata_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectDiscoveryMetadata_class_data_.tc_table); + return ConnectDiscoveryMetadata_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectDiscoveryMetadata::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectDiscoveryMetadata_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectDiscoveryMetadata_globals_)); + return ConnectDiscoveryMetadata_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectDiscoveryMetadata::ParseTableT_ + ConnectDiscoveryMetadata::_table_ = + ConnectDiscoveryMetadata::InternalGenerateParseTable_(ConnectDiscoveryMetadata_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectDiscoveryMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectDiscoveryMetadata) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.instance_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.display_name_.ClearNonDefaultToEmpty(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000000cU)) { + ::memset(&_impl_.platform_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.protocol_version_) - + reinterpret_cast(&_impl_.platform_)) + sizeof(_impl_.protocol_version_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectDiscoveryMetadata::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectDiscoveryMetadata& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectDiscoveryMetadata::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectDiscoveryMetadata& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectDiscoveryMetadata) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string instance_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_instance_id().empty()) { + const ::std::string& _s = this_._internal_instance_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectDiscoveryMetadata.instance_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string display_name = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_display_name().empty()) { + const ::std::string& _s = this_._internal_display_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectDiscoveryMetadata.display_name"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // .runanywhere.v1.ConnectPlatform platform = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_platform() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this_._internal_platform(), target); + } + } + + // uint32 protocol_version = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_protocol_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this_._internal_protocol_version(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectDiscoveryMetadata) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectDiscoveryMetadata::ByteSizeLong(const MessageLite& base) { + const ConnectDiscoveryMetadata& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectDiscoveryMetadata::ByteSizeLong() const { + const ConnectDiscoveryMetadata& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectDiscoveryMetadata) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + // string instance_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_instance_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_instance_id()); + } + } + // string display_name = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_display_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_display_name()); + } + } + // .runanywhere.v1.ConnectPlatform platform = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_platform() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_platform()); + } + } + // uint32 protocol_version = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_protocol_version()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectDiscoveryMetadata::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectDiscoveryMetadata) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_instance_id().empty()) { + _this->_internal_set_instance_id(from._internal_instance_id()); + } else { + if (_this->_impl_.instance_id_.IsDefault()) { + _this->_internal_set_instance_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_display_name().empty()) { + _this->_internal_set_display_name(from._internal_display_name()); + } else { + if (_this->_impl_.display_name_.IsDefault()) { + _this->_internal_set_display_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_platform() != 0) { + _this->_impl_.platform_ = from._impl_.platform_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_protocol_version() != 0) { + _this->_impl_.protocol_version_ = from._impl_.protocol_version_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectDiscoveryMetadata::CopyFrom(const ConnectDiscoveryMetadata& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectDiscoveryMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectDiscoveryMetadata::InternalSwap(ConnectDiscoveryMetadata* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.instance_id_, &other->_impl_.instance_id_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.display_name_, &other->_impl_.display_name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.protocol_version_) + + sizeof(ConnectDiscoveryMetadata::_impl_.protocol_version_) + - PROTOBUF_FIELD_OFFSET(ConnectDiscoveryMetadata, _impl_.platform_)>( + reinterpret_cast(&_impl_.platform_), + reinterpret_cast(&other->_impl_.platform_)); +} + +::google::protobuf::Metadata ConnectDiscoveryMetadata::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectModelDescriptor::ConnectModelDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectModelDescriptor_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectModelDescriptor) +} +PROTOBUF_NDEBUG_INLINE ConnectModelDescriptor::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectModelDescriptor& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + model_id_(arena, from.model_id_), + display_name_(arena, from.display_name_), + framework_(arena, from.framework_) {} + +ConnectModelDescriptor::ConnectModelDescriptor( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectModelDescriptor& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectModelDescriptor_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectModelDescriptor* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, context_window_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, context_window_), + offsetof(Impl_, supports_streaming_) - + offsetof(Impl_, context_window_) + + sizeof(Impl_::supports_streaming_)); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectModelDescriptor) +} +PROTOBUF_NDEBUG_INLINE ConnectModelDescriptor::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + model_id_(arena), + display_name_(arena), + framework_(arena) {} + +inline void ConnectModelDescriptor::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, context_window_), + 0, + offsetof(Impl_, supports_streaming_) - + offsetof(Impl_, context_window_) + + sizeof(Impl_::supports_streaming_)); +} +ConnectModelDescriptor::~ConnectModelDescriptor() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectModelDescriptor) + SharedDtor(*this); +} +inline void ConnectModelDescriptor::SharedDtor(MessageLite& self) { + ConnectModelDescriptor& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.model_id_.Destroy(); + this_._impl_.display_name_.Destroy(); + this_._impl_.framework_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectModelDescriptor_class_data_ = + ConnectModelDescriptor::InternalGenerateClassData_(ConnectModelDescriptor_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectModelDescriptor::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectModelDescriptor_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectModelDescriptor_class_data_.tc_table); + return ConnectModelDescriptor_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectModelDescriptor::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectModelDescriptor_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectModelDescriptor_globals_)); + return ConnectModelDescriptor_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectModelDescriptor::ParseTableT_ + ConnectModelDescriptor::_table_ = + ConnectModelDescriptor::InternalGenerateParseTable_(ConnectModelDescriptor_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectModelDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectModelDescriptor) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.model_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.display_name_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.framework_.ClearNonDefaultToEmpty(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x00000018U)) { + ::memset(&_impl_.context_window_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.supports_streaming_) - + reinterpret_cast(&_impl_.context_window_)) + sizeof(_impl_.supports_streaming_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectModelDescriptor::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectModelDescriptor& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectModelDescriptor::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectModelDescriptor& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectModelDescriptor) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string model_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_model_id().empty()) { + const ::std::string& _s = this_._internal_model_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectModelDescriptor.model_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string display_name = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_display_name().empty()) { + const ::std::string& _s = this_._internal_display_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectModelDescriptor.display_name"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // string framework = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_framework().empty()) { + const ::std::string& _s = this_._internal_framework(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectModelDescriptor.framework"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + } + + // uint32 context_window = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_context_window() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this_._internal_context_window(), target); + } + } + + // bool supports_streaming = 5; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_supports_streaming() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 5, this_._internal_supports_streaming(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectModelDescriptor) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectModelDescriptor::ByteSizeLong(const MessageLite& base) { + const ConnectModelDescriptor& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectModelDescriptor::ByteSizeLong() const { + const ConnectModelDescriptor& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectModelDescriptor) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + // string model_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_model_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_model_id()); + } + } + // string display_name = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_display_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_display_name()); + } + } + // string framework = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_framework().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_framework()); + } + } + // uint32 context_window = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_context_window() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_context_window()); + } + } + // bool supports_streaming = 5; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_supports_streaming() != 0) { + total_size += 2; + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectModelDescriptor::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectModelDescriptor) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_model_id().empty()) { + _this->_internal_set_model_id(from._internal_model_id()); + } else { + if (_this->_impl_.model_id_.IsDefault()) { + _this->_internal_set_model_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_display_name().empty()) { + _this->_internal_set_display_name(from._internal_display_name()); + } else { + if (_this->_impl_.display_name_.IsDefault()) { + _this->_internal_set_display_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_framework().empty()) { + _this->_internal_set_framework(from._internal_framework()); + } else { + if (_this->_impl_.framework_.IsDefault()) { + _this->_internal_set_framework(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_context_window() != 0) { + _this->_impl_.context_window_ = from._impl_.context_window_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_supports_streaming() != 0) { + _this->_impl_.supports_streaming_ = from._impl_.supports_streaming_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectModelDescriptor::CopyFrom(const ConnectModelDescriptor& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectModelDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectModelDescriptor::InternalSwap(ConnectModelDescriptor* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.model_id_, &other->_impl_.model_id_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.display_name_, &other->_impl_.display_name_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.framework_, &other->_impl_.framework_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.supports_streaming_) + + sizeof(ConnectModelDescriptor::_impl_.supports_streaming_) + - PROTOBUF_FIELD_OFFSET(ConnectModelDescriptor, _impl_.context_window_)>( + reinterpret_cast(&_impl_.context_window_), + reinterpret_cast(&other->_impl_.context_window_)); +} + +::google::protobuf::Metadata ConnectModelDescriptor::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectHostStartRequest::ConnectHostStartRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHostStartRequest_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHostStartRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectHostStartRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectHostStartRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + display_name_(arena, from.display_name_) {} + +ConnectHostStartRequest::ConnectHostStartRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHostStartRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHostStartRequest_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHostStartRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.model_ = (CheckHasBit(cached_has_bits, 0x00000002U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_) + : nullptr; + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, platform_), + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHostStartRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectHostStartRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + display_name_(arena) {} + +inline void ConnectHostStartRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, model_), + 0, + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, model_) + + sizeof(Impl_::protocol_version_)); +} +ConnectHostStartRequest::~ConnectHostStartRequest() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectHostStartRequest) + SharedDtor(*this); +} +inline void ConnectHostStartRequest::SharedDtor(MessageLite& self) { + ConnectHostStartRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.display_name_.Destroy(); + delete this_._impl_.model_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHostStartRequest_class_data_ = + ConnectHostStartRequest::InternalGenerateClassData_(ConnectHostStartRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostStartRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostStartRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHostStartRequest_class_data_.tc_table); + return ConnectHostStartRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostStartRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostStartRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHostStartRequest_globals_)); + return ConnectHostStartRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHostStartRequest::ParseTableT_ + ConnectHostStartRequest::_table_ = + ConnectHostStartRequest::InternalGenerateParseTable_(ConnectHostStartRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectHostStartRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectHostStartRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.display_name_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(_impl_.model_ != nullptr); + _impl_.model_->Clear(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000000cU)) { + ::memset(&_impl_.platform_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.protocol_version_) - + reinterpret_cast(&_impl_.platform_)) + sizeof(_impl_.protocol_version_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectHostStartRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectHostStartRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectHostStartRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectHostStartRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectHostStartRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string display_name = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_display_name().empty()) { + const ::std::string& _s = this_._internal_display_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectHostStartRequest.display_name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // .runanywhere.v1.ConnectPlatform platform = 2; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_platform() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this_._internal_platform(), target); + } + } + + // uint32 protocol_version = 3; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_protocol_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this_._internal_protocol_version(), target); + } + } + + // .runanywhere.v1.ConnectModelDescriptor model = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 4, *this_._impl_.model_, this_._impl_.model_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectHostStartRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectHostStartRequest::ByteSizeLong(const MessageLite& base) { + const ConnectHostStartRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectHostStartRequest::ByteSizeLong() const { + const ConnectHostStartRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectHostStartRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + // string display_name = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_display_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_display_name()); + } + } + // .runanywhere.v1.ConnectModelDescriptor model = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.model_); + } + // .runanywhere.v1.ConnectPlatform platform = 2; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_platform() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_platform()); + } + } + // uint32 protocol_version = 3; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_protocol_version()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectHostStartRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectHostStartRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_display_name().empty()) { + _this->_internal_set_display_name(from._internal_display_name()); + } else { + if (_this->_impl_.display_name_.IsDefault()) { + _this->_internal_set_display_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(from._impl_.model_ != nullptr); + if (_this->_impl_.model_ == nullptr) { + _this->_impl_.model_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_); + } else { + _this->_impl_.model_->MergeFrom(*from._impl_.model_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_platform() != 0) { + _this->_impl_.platform_ = from._impl_.platform_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_protocol_version() != 0) { + _this->_impl_.protocol_version_ = from._impl_.protocol_version_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectHostStartRequest::CopyFrom(const ConnectHostStartRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectHostStartRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectHostStartRequest::InternalSwap(ConnectHostStartRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.display_name_, &other->_impl_.display_name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.protocol_version_) + + sizeof(ConnectHostStartRequest::_impl_.protocol_version_) + - PROTOBUF_FIELD_OFFSET(ConnectHostStartRequest, _impl_.model_)>( + reinterpret_cast(&_impl_.model_), + reinterpret_cast(&other->_impl_.model_)); +} + +::google::protobuf::Metadata ConnectHostStartRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectHostStopRequest::ConnectHostStopRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::internal::ZeroFieldsBase(arena, ConnectHostStopRequest_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::internal::ZeroFieldsBase(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHostStopRequest) +} +ConnectHostStopRequest::ConnectHostStopRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHostStopRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::internal::ZeroFieldsBase(arena, ConnectHostStopRequest_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::internal::ZeroFieldsBase(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHostStopRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHostStopRequest) +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHostStopRequest_class_data_ = + ConnectHostStopRequest::InternalGenerateClassData_(ConnectHostStopRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostStopRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostStopRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHostStopRequest_class_data_.tc_table); + return ConnectHostStopRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostStopRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostStopRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHostStopRequest_globals_)); + return ConnectHostStopRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHostStopRequest::ParseTableT_ + ConnectHostStopRequest::_table_ = + ConnectHostStopRequest::InternalGenerateParseTable_(ConnectHostStopRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS + + + + + + + +::google::protobuf::Metadata ConnectHostStopRequest::GetMetadata() const { + return ::google::protobuf::internal::ZeroFieldsBase::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectHostState::ConnectHostState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHostState_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHostState) +} +PROTOBUF_NDEBUG_INLINE ConnectHostState::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectHostState& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + error_message_(arena, from.error_message_) {} + +ConnectHostState::ConnectHostState( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHostState& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHostState_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHostState* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.discovery_metadata_ = (CheckHasBit(cached_has_bits, 0x00000002U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.discovery_metadata_) + : nullptr; + _impl_.model_ = (CheckHasBit(cached_has_bits, 0x00000004U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_) + : nullptr; + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, is_hosting_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, is_hosting_), + offsetof(Impl_, active_client_count_) - + offsetof(Impl_, is_hosting_) + + sizeof(Impl_::active_client_count_)); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHostState) +} +PROTOBUF_NDEBUG_INLINE ConnectHostState::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + error_message_(arena) {} + +inline void ConnectHostState::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, discovery_metadata_), + 0, + offsetof(Impl_, active_client_count_) - + offsetof(Impl_, discovery_metadata_) + + sizeof(Impl_::active_client_count_)); +} +ConnectHostState::~ConnectHostState() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectHostState) + SharedDtor(*this); +} +inline void ConnectHostState::SharedDtor(MessageLite& self) { + ConnectHostState& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.error_message_.Destroy(); + delete this_._impl_.discovery_metadata_; + delete this_._impl_.model_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHostState_class_data_ = + ConnectHostState::InternalGenerateClassData_(ConnectHostState_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostState::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostState_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHostState_class_data_.tc_table); + return ConnectHostState_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostState::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostState_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHostState_globals_)); + return ConnectHostState_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHostState::ParseTableT_ + ConnectHostState::_table_ = + ConnectHostState::InternalGenerateParseTable_(ConnectHostState_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectHostState::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectHostState) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.error_message_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(_impl_.discovery_metadata_ != nullptr); + _impl_.discovery_metadata_->Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(_impl_.model_ != nullptr); + _impl_.model_->Clear(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x00000018U)) { + ::memset(&_impl_.is_hosting_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.active_client_count_) - + reinterpret_cast(&_impl_.is_hosting_)) + sizeof(_impl_.active_client_count_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectHostState::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectHostState& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectHostState::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectHostState& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectHostState) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // bool is_hosting = 1; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_is_hosting() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 1, this_._internal_is_hosting(), target); + } + } + + // .runanywhere.v1.ConnectDiscoveryMetadata discovery_metadata = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, *this_._impl_.discovery_metadata_, this_._impl_.discovery_metadata_->GetCachedSize(), target, + stream); + } + + // uint32 active_client_count = 3; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_active_client_count() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this_._internal_active_client_count(), target); + } + } + + // string error_message = 4; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_error_message().empty()) { + const ::std::string& _s = this_._internal_error_message(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectHostState.error_message"); + target = stream->WriteStringMaybeAliased(4, _s, target); + } + } + + // .runanywhere.v1.ConnectModelDescriptor model = 5; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 5, *this_._impl_.model_, this_._impl_.model_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectHostState) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectHostState::ByteSizeLong(const MessageLite& base) { + const ConnectHostState& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectHostState::ByteSizeLong() const { + const ConnectHostState& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectHostState) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + // string error_message = 4; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_error_message().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_error_message()); + } + } + // .runanywhere.v1.ConnectDiscoveryMetadata discovery_metadata = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.discovery_metadata_); + } + // .runanywhere.v1.ConnectModelDescriptor model = 5; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.model_); + } + // bool is_hosting = 1; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_is_hosting() != 0) { + total_size += 2; + } + } + // uint32 active_client_count = 3; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_active_client_count() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_active_client_count()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectHostState::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectHostState) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_error_message().empty()) { + _this->_internal_set_error_message(from._internal_error_message()); + } else { + if (_this->_impl_.error_message_.IsDefault()) { + _this->_internal_set_error_message(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(from._impl_.discovery_metadata_ != nullptr); + if (_this->_impl_.discovery_metadata_ == nullptr) { + _this->_impl_.discovery_metadata_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.discovery_metadata_); + } else { + _this->_impl_.discovery_metadata_->MergeFrom(*from._impl_.discovery_metadata_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(from._impl_.model_ != nullptr); + if (_this->_impl_.model_ == nullptr) { + _this->_impl_.model_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_); + } else { + _this->_impl_.model_->MergeFrom(*from._impl_.model_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_is_hosting() != 0) { + _this->_impl_.is_hosting_ = from._impl_.is_hosting_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_active_client_count() != 0) { + _this->_impl_.active_client_count_ = from._impl_.active_client_count_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectHostState::CopyFrom(const ConnectHostState& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectHostState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectHostState::InternalSwap(ConnectHostState* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_message_, &other->_impl_.error_message_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.active_client_count_) + + sizeof(ConnectHostState::_impl_.active_client_count_) + - PROTOBUF_FIELD_OFFSET(ConnectHostState, _impl_.discovery_metadata_)>( + reinterpret_cast(&_impl_.discovery_metadata_), + reinterpret_cast(&other->_impl_.discovery_metadata_)); +} + +::google::protobuf::Metadata ConnectHostState::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectClientStartRequest::ConnectClientStartRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientStartRequest_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectClientStartRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectClientStartRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectClientStartRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + display_name_(arena, from.display_name_) {} + +ConnectClientStartRequest::ConnectClientStartRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectClientStartRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientStartRequest_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectClientStartRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, platform_), + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectClientStartRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectClientStartRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + display_name_(arena) {} + +inline void ConnectClientStartRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + 0, + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); +} +ConnectClientStartRequest::~ConnectClientStartRequest() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectClientStartRequest) + SharedDtor(*this); +} +inline void ConnectClientStartRequest::SharedDtor(MessageLite& self) { + ConnectClientStartRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.display_name_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectClientStartRequest_class_data_ = + ConnectClientStartRequest::InternalGenerateClassData_(ConnectClientStartRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientStartRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientStartRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectClientStartRequest_class_data_.tc_table); + return ConnectClientStartRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientStartRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientStartRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectClientStartRequest_globals_)); + return ConnectClientStartRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectClientStartRequest::ParseTableT_ + ConnectClientStartRequest::_table_ = + ConnectClientStartRequest::InternalGenerateParseTable_(ConnectClientStartRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectClientStartRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectClientStartRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.display_name_.ClearNonDefaultToEmpty(); + } + if (BatchCheckHasBit(cached_has_bits, 0x00000006U)) { + ::memset(&_impl_.platform_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.protocol_version_) - + reinterpret_cast(&_impl_.platform_)) + sizeof(_impl_.protocol_version_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectClientStartRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectClientStartRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectClientStartRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectClientStartRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectClientStartRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string display_name = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_display_name().empty()) { + const ::std::string& _s = this_._internal_display_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectClientStartRequest.display_name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // .runanywhere.v1.ConnectPlatform platform = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_platform() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this_._internal_platform(), target); + } + } + + // uint32 protocol_version = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_protocol_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this_._internal_protocol_version(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectClientStartRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectClientStartRequest::ByteSizeLong(const MessageLite& base) { + const ConnectClientStartRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectClientStartRequest::ByteSizeLong() const { + const ConnectClientStartRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectClientStartRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + // string display_name = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_display_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_display_name()); + } + } + // .runanywhere.v1.ConnectPlatform platform = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_platform() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_platform()); + } + } + // uint32 protocol_version = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_protocol_version()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectClientStartRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectClientStartRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_display_name().empty()) { + _this->_internal_set_display_name(from._internal_display_name()); + } else { + if (_this->_impl_.display_name_.IsDefault()) { + _this->_internal_set_display_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_platform() != 0) { + _this->_impl_.platform_ = from._impl_.platform_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_protocol_version() != 0) { + _this->_impl_.protocol_version_ = from._impl_.protocol_version_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectClientStartRequest::CopyFrom(const ConnectClientStartRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectClientStartRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectClientStartRequest::InternalSwap(ConnectClientStartRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.display_name_, &other->_impl_.display_name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.protocol_version_) + + sizeof(ConnectClientStartRequest::_impl_.protocol_version_) + - PROTOBUF_FIELD_OFFSET(ConnectClientStartRequest, _impl_.platform_)>( + reinterpret_cast(&_impl_.platform_), + reinterpret_cast(&other->_impl_.platform_)); +} + +::google::protobuf::Metadata ConnectClientStartRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectClientHello::ConnectClientHello(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientHello_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectClientHello) +} +PROTOBUF_NDEBUG_INLINE ConnectClientHello::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectClientHello& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + instance_id_(arena, from.instance_id_), + display_name_(arena, from.display_name_) {} + +ConnectClientHello::ConnectClientHello( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectClientHello& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientHello_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectClientHello* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, platform_), + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectClientHello) +} +PROTOBUF_NDEBUG_INLINE ConnectClientHello::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + instance_id_(arena), + display_name_(arena) {} + +inline void ConnectClientHello::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, platform_), + 0, + offsetof(Impl_, protocol_version_) - + offsetof(Impl_, platform_) + + sizeof(Impl_::protocol_version_)); +} +ConnectClientHello::~ConnectClientHello() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectClientHello) + SharedDtor(*this); +} +inline void ConnectClientHello::SharedDtor(MessageLite& self) { + ConnectClientHello& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.instance_id_.Destroy(); + this_._impl_.display_name_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectClientHello_class_data_ = + ConnectClientHello::InternalGenerateClassData_(ConnectClientHello_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientHello::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientHello_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectClientHello_class_data_.tc_table); + return ConnectClientHello_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientHello::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientHello_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectClientHello_globals_)); + return ConnectClientHello_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectClientHello::ParseTableT_ + ConnectClientHello::_table_ = + ConnectClientHello::InternalGenerateParseTable_(ConnectClientHello_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectClientHello::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectClientHello) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.instance_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.display_name_.ClearNonDefaultToEmpty(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000000cU)) { + ::memset(&_impl_.platform_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.protocol_version_) - + reinterpret_cast(&_impl_.platform_)) + sizeof(_impl_.protocol_version_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectClientHello::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectClientHello& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectClientHello::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectClientHello& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectClientHello) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string instance_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_instance_id().empty()) { + const ::std::string& _s = this_._internal_instance_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectClientHello.instance_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string display_name = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_display_name().empty()) { + const ::std::string& _s = this_._internal_display_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectClientHello.display_name"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // .runanywhere.v1.ConnectPlatform platform = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_platform() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this_._internal_platform(), target); + } + } + + // uint32 protocol_version = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_protocol_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this_._internal_protocol_version(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectClientHello) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectClientHello::ByteSizeLong(const MessageLite& base) { + const ConnectClientHello& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectClientHello::ByteSizeLong() const { + const ConnectClientHello& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectClientHello) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + // string instance_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_instance_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_instance_id()); + } + } + // string display_name = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_display_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_display_name()); + } + } + // .runanywhere.v1.ConnectPlatform platform = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_platform() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_platform()); + } + } + // uint32 protocol_version = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_protocol_version()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectClientHello::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectClientHello) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_instance_id().empty()) { + _this->_internal_set_instance_id(from._internal_instance_id()); + } else { + if (_this->_impl_.instance_id_.IsDefault()) { + _this->_internal_set_instance_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_display_name().empty()) { + _this->_internal_set_display_name(from._internal_display_name()); + } else { + if (_this->_impl_.display_name_.IsDefault()) { + _this->_internal_set_display_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_platform() != 0) { + _this->_impl_.platform_ = from._impl_.platform_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_protocol_version() != 0) { + _this->_impl_.protocol_version_ = from._impl_.protocol_version_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectClientHello::CopyFrom(const ConnectClientHello& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectClientHello) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectClientHello::InternalSwap(ConnectClientHello* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.instance_id_, &other->_impl_.instance_id_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.display_name_, &other->_impl_.display_name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.protocol_version_) + + sizeof(ConnectClientHello::_impl_.protocol_version_) + - PROTOBUF_FIELD_OFFSET(ConnectClientHello, _impl_.platform_)>( + reinterpret_cast(&_impl_.platform_), + reinterpret_cast(&other->_impl_.platform_)); +} + +::google::protobuf::Metadata ConnectClientHello::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectHandshakeResponse::ConnectHandshakeResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHandshakeResponse_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHandshakeResponse) +} +PROTOBUF_NDEBUG_INLINE ConnectHandshakeResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectHandshakeResponse& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + session_id_(arena, from.session_id_), + rejection_reason_(arena, from.rejection_reason_) {} + +ConnectHandshakeResponse::ConnectHandshakeResponse( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHandshakeResponse& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHandshakeResponse_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHandshakeResponse* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.host_ = (CheckHasBit(cached_has_bits, 0x00000004U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.host_) + : nullptr; + _impl_.model_ = (CheckHasBit(cached_has_bits, 0x00000008U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_) + : nullptr; + _impl_.status_ = from._impl_.status_; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHandshakeResponse) +} +PROTOBUF_NDEBUG_INLINE ConnectHandshakeResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + session_id_(arena), + rejection_reason_(arena) {} + +inline void ConnectHandshakeResponse::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, host_), + 0, + offsetof(Impl_, status_) - + offsetof(Impl_, host_) + + sizeof(Impl_::status_)); +} +ConnectHandshakeResponse::~ConnectHandshakeResponse() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectHandshakeResponse) + SharedDtor(*this); +} +inline void ConnectHandshakeResponse::SharedDtor(MessageLite& self) { + ConnectHandshakeResponse& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.session_id_.Destroy(); + this_._impl_.rejection_reason_.Destroy(); + delete this_._impl_.host_; + delete this_._impl_.model_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHandshakeResponse_class_data_ = + ConnectHandshakeResponse::InternalGenerateClassData_(ConnectHandshakeResponse_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHandshakeResponse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHandshakeResponse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHandshakeResponse_class_data_.tc_table); + return ConnectHandshakeResponse_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHandshakeResponse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHandshakeResponse_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHandshakeResponse_globals_)); + return ConnectHandshakeResponse_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHandshakeResponse::ParseTableT_ + ConnectHandshakeResponse::_table_ = + ConnectHandshakeResponse::InternalGenerateParseTable_(ConnectHandshakeResponse_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectHandshakeResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectHandshakeResponse) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.session_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.rejection_reason_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(_impl_.host_ != nullptr); + _impl_.host_->Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + ABSL_DCHECK(_impl_.model_ != nullptr); + _impl_.model_->Clear(); + } + } + _impl_.status_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectHandshakeResponse::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectHandshakeResponse& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectHandshakeResponse::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectHandshakeResponse& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectHandshakeResponse) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .runanywhere.v1.ConnectHandshakeStatus status = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_status() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this_._internal_status(), target); + } + } + + // string session_id = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + const ::std::string& _s = this_._internal_session_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectHandshakeResponse.session_id"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 3, *this_._impl_.host_, this_._impl_.host_->GetCachedSize(), target, + stream); + } + + // string rejection_reason = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_rejection_reason().empty()) { + const ::std::string& _s = this_._internal_rejection_reason(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectHandshakeResponse.rejection_reason"); + target = stream->WriteStringMaybeAliased(4, _s, target); + } + } + + // .runanywhere.v1.ConnectModelDescriptor model = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 5, *this_._impl_.model_, this_._impl_.model_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectHandshakeResponse) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectHandshakeResponse::ByteSizeLong(const MessageLite& base) { + const ConnectHandshakeResponse& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectHandshakeResponse::ByteSizeLong() const { + const ConnectHandshakeResponse& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectHandshakeResponse) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + // string session_id = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_session_id()); + } + } + // string rejection_reason = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_rejection_reason().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_rejection_reason()); + } + } + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.host_); + } + // .runanywhere.v1.ConnectModelDescriptor model = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.model_); + } + // .runanywhere.v1.ConnectHandshakeStatus status = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_status() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_status()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectHandshakeResponse::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectHandshakeResponse) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_session_id().empty()) { + _this->_internal_set_session_id(from._internal_session_id()); + } else { + if (_this->_impl_.session_id_.IsDefault()) { + _this->_internal_set_session_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_rejection_reason().empty()) { + _this->_internal_set_rejection_reason(from._internal_rejection_reason()); + } else { + if (_this->_impl_.rejection_reason_.IsDefault()) { + _this->_internal_set_rejection_reason(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(from._impl_.host_ != nullptr); + if (_this->_impl_.host_ == nullptr) { + _this->_impl_.host_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.host_); + } else { + _this->_impl_.host_->MergeFrom(*from._impl_.host_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + ABSL_DCHECK(from._impl_.model_ != nullptr); + if (_this->_impl_.model_ == nullptr) { + _this->_impl_.model_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_); + } else { + _this->_impl_.model_->MergeFrom(*from._impl_.model_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_status() != 0) { + _this->_impl_.status_ = from._impl_.status_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectHandshakeResponse::CopyFrom(const ConnectHandshakeResponse& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectHandshakeResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectHandshakeResponse::InternalSwap(ConnectHandshakeResponse* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.session_id_, &other->_impl_.session_id_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.rejection_reason_, &other->_impl_.rejection_reason_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.status_) + + sizeof(ConnectHandshakeResponse::_impl_.status_) + - PROTOBUF_FIELD_OFFSET(ConnectHandshakeResponse, _impl_.host_)>( + reinterpret_cast(&_impl_.host_), + reinterpret_cast(&other->_impl_.host_)); +} + +::google::protobuf::Metadata ConnectHandshakeResponse::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectClientSessionState::ConnectClientSessionState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientSessionState_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectClientSessionState) +} +PROTOBUF_NDEBUG_INLINE ConnectClientSessionState::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectClientSessionState& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + session_id_(arena, from.session_id_), + error_message_(arena, from.error_message_) {} + +ConnectClientSessionState::ConnectClientSessionState( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectClientSessionState& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientSessionState_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectClientSessionState* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.host_ = (CheckHasBit(cached_has_bits, 0x00000004U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.host_) + : nullptr; + _impl_.model_ = (CheckHasBit(cached_has_bits, 0x00000008U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_) + : nullptr; + _impl_.state_ = from._impl_.state_; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectClientSessionState) +} +PROTOBUF_NDEBUG_INLINE ConnectClientSessionState::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + session_id_(arena), + error_message_(arena) {} + +inline void ConnectClientSessionState::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, host_), + 0, + offsetof(Impl_, state_) - + offsetof(Impl_, host_) + + sizeof(Impl_::state_)); +} +ConnectClientSessionState::~ConnectClientSessionState() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectClientSessionState) + SharedDtor(*this); +} +inline void ConnectClientSessionState::SharedDtor(MessageLite& self) { + ConnectClientSessionState& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.session_id_.Destroy(); + this_._impl_.error_message_.Destroy(); + delete this_._impl_.host_; + delete this_._impl_.model_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectClientSessionState_class_data_ = + ConnectClientSessionState::InternalGenerateClassData_(ConnectClientSessionState_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientSessionState::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientSessionState_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectClientSessionState_class_data_.tc_table); + return ConnectClientSessionState_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientSessionState::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientSessionState_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectClientSessionState_globals_)); + return ConnectClientSessionState_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectClientSessionState::ParseTableT_ + ConnectClientSessionState::_table_ = + ConnectClientSessionState::InternalGenerateParseTable_(ConnectClientSessionState_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectClientSessionState::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectClientSessionState) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.session_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.error_message_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(_impl_.host_ != nullptr); + _impl_.host_->Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + ABSL_DCHECK(_impl_.model_ != nullptr); + _impl_.model_->Clear(); + } + } + _impl_.state_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectClientSessionState::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectClientSessionState& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectClientSessionState::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectClientSessionState& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectClientSessionState) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .runanywhere.v1.ConnectSessionState state = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_state() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this_._internal_state(), target); + } + } + + // string session_id = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + const ::std::string& _s = this_._internal_session_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectClientSessionState.session_id"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 3, *this_._impl_.host_, this_._impl_.host_->GetCachedSize(), target, + stream); + } + + // string error_message = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_error_message().empty()) { + const ::std::string& _s = this_._internal_error_message(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectClientSessionState.error_message"); + target = stream->WriteStringMaybeAliased(4, _s, target); + } + } + + // .runanywhere.v1.ConnectModelDescriptor model = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 5, *this_._impl_.model_, this_._impl_.model_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectClientSessionState) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectClientSessionState::ByteSizeLong(const MessageLite& base) { + const ConnectClientSessionState& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectClientSessionState::ByteSizeLong() const { + const ConnectClientSessionState& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectClientSessionState) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + // string session_id = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_session_id()); + } + } + // string error_message = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_error_message().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_error_message()); + } + } + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.host_); + } + // .runanywhere.v1.ConnectModelDescriptor model = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.model_); + } + // .runanywhere.v1.ConnectSessionState state = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_state() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_state()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectClientSessionState::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectClientSessionState) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_session_id().empty()) { + _this->_internal_set_session_id(from._internal_session_id()); + } else { + if (_this->_impl_.session_id_.IsDefault()) { + _this->_internal_set_session_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_error_message().empty()) { + _this->_internal_set_error_message(from._internal_error_message()); + } else { + if (_this->_impl_.error_message_.IsDefault()) { + _this->_internal_set_error_message(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(from._impl_.host_ != nullptr); + if (_this->_impl_.host_ == nullptr) { + _this->_impl_.host_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.host_); + } else { + _this->_impl_.host_->MergeFrom(*from._impl_.host_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + ABSL_DCHECK(from._impl_.model_ != nullptr); + if (_this->_impl_.model_ == nullptr) { + _this->_impl_.model_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.model_); + } else { + _this->_impl_.model_->MergeFrom(*from._impl_.model_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_state() != 0) { + _this->_impl_.state_ = from._impl_.state_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectClientSessionState::CopyFrom(const ConnectClientSessionState& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectClientSessionState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectClientSessionState::InternalSwap(ConnectClientSessionState* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.session_id_, &other->_impl_.session_id_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_message_, &other->_impl_.error_message_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.state_) + + sizeof(ConnectClientSessionState::_impl_.state_) + - PROTOBUF_FIELD_OFFSET(ConnectClientSessionState, _impl_.host_)>( + reinterpret_cast(&_impl_.host_), + reinterpret_cast(&other->_impl_.host_)); +} + +::google::protobuf::Metadata ConnectClientSessionState::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectSessionCloseRequest::ConnectSessionCloseRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectSessionCloseRequest_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectSessionCloseRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectSessionCloseRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectSessionCloseRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + session_id_(arena, from.session_id_) {} + +ConnectSessionCloseRequest::ConnectSessionCloseRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectSessionCloseRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectSessionCloseRequest_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectSessionCloseRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectSessionCloseRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectSessionCloseRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + session_id_(arena) {} + +inline void ConnectSessionCloseRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +ConnectSessionCloseRequest::~ConnectSessionCloseRequest() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectSessionCloseRequest) + SharedDtor(*this); +} +inline void ConnectSessionCloseRequest::SharedDtor(MessageLite& self) { + ConnectSessionCloseRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.session_id_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectSessionCloseRequest_class_data_ = + ConnectSessionCloseRequest::InternalGenerateClassData_(ConnectSessionCloseRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectSessionCloseRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectSessionCloseRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectSessionCloseRequest_class_data_.tc_table); + return ConnectSessionCloseRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectSessionCloseRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectSessionCloseRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectSessionCloseRequest_globals_)); + return ConnectSessionCloseRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectSessionCloseRequest::ParseTableT_ + ConnectSessionCloseRequest::_table_ = + ConnectSessionCloseRequest::InternalGenerateParseTable_(ConnectSessionCloseRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectSessionCloseRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectSessionCloseRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.session_id_.ClearNonDefaultToEmpty(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectSessionCloseRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectSessionCloseRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectSessionCloseRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectSessionCloseRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectSessionCloseRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + const ::std::string& _s = this_._internal_session_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectSessionCloseRequest.session_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectSessionCloseRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectSessionCloseRequest::ByteSizeLong(const MessageLite& base) { + const ConnectSessionCloseRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectSessionCloseRequest::ByteSizeLong() const { + const ConnectSessionCloseRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectSessionCloseRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + { + // string session_id = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_session_id()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectSessionCloseRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectSessionCloseRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_session_id().empty()) { + _this->_internal_set_session_id(from._internal_session_id()); + } else { + if (_this->_impl_.session_id_.IsDefault()) { + _this->_internal_set_session_id(""); + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectSessionCloseRequest::CopyFrom(const ConnectSessionCloseRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectSessionCloseRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectSessionCloseRequest::InternalSwap(ConnectSessionCloseRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.session_id_, &other->_impl_.session_id_, arena); +} + +::google::protobuf::Metadata ConnectSessionCloseRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +void ConnectInvocationRequest::clear_generation() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.generation_ != nullptr) _impl_.generation_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +ConnectInvocationRequest::ConnectInvocationRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectInvocationRequest_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectInvocationRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectInvocationRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectInvocationRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + session_id_(arena, from.session_id_), + request_id_(arena, from.request_id_) {} + +ConnectInvocationRequest::ConnectInvocationRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectInvocationRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectInvocationRequest_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectInvocationRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.generation_ = (CheckHasBit(cached_has_bits, 0x00000004U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.generation_) + : nullptr; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectInvocationRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectInvocationRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + session_id_(arena), + request_id_(arena) {} + +inline void ConnectInvocationRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.generation_ = {}; +} +ConnectInvocationRequest::~ConnectInvocationRequest() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectInvocationRequest) + SharedDtor(*this); +} +inline void ConnectInvocationRequest::SharedDtor(MessageLite& self) { + ConnectInvocationRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.session_id_.Destroy(); + this_._impl_.request_id_.Destroy(); + delete this_._impl_.generation_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectInvocationRequest_class_data_ = + ConnectInvocationRequest::InternalGenerateClassData_(ConnectInvocationRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectInvocationRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectInvocationRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectInvocationRequest_class_data_.tc_table); + return ConnectInvocationRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectInvocationRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectInvocationRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectInvocationRequest_globals_)); + return ConnectInvocationRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectInvocationRequest::ParseTableT_ + ConnectInvocationRequest::_table_ = + ConnectInvocationRequest::InternalGenerateParseTable_(ConnectInvocationRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectInvocationRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectInvocationRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.session_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.request_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(_impl_.generation_ != nullptr); + _impl_.generation_->Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectInvocationRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectInvocationRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectInvocationRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectInvocationRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectInvocationRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + const ::std::string& _s = this_._internal_session_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectInvocationRequest.session_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string request_id = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_request_id().empty()) { + const ::std::string& _s = this_._internal_request_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectInvocationRequest.request_id"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // .runanywhere.v1.LLMGenerateRequest generation = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 3, *this_._impl_.generation_, this_._impl_.generation_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectInvocationRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectInvocationRequest::ByteSizeLong(const MessageLite& base) { + const ConnectInvocationRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectInvocationRequest::ByteSizeLong() const { + const ConnectInvocationRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectInvocationRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_session_id()); + } + } + // string request_id = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_request_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_request_id()); + } + } + // .runanywhere.v1.LLMGenerateRequest generation = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.generation_); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectInvocationRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectInvocationRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_session_id().empty()) { + _this->_internal_set_session_id(from._internal_session_id()); + } else { + if (_this->_impl_.session_id_.IsDefault()) { + _this->_internal_set_session_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_request_id().empty()) { + _this->_internal_set_request_id(from._internal_request_id()); + } else { + if (_this->_impl_.request_id_.IsDefault()) { + _this->_internal_set_request_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(from._impl_.generation_ != nullptr); + if (_this->_impl_.generation_ == nullptr) { + _this->_impl_.generation_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.generation_); + } else { + _this->_impl_.generation_->MergeFrom(*from._impl_.generation_); + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectInvocationRequest::CopyFrom(const ConnectInvocationRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectInvocationRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectInvocationRequest::InternalSwap(ConnectInvocationRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.session_id_, &other->_impl_.session_id_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.request_id_, &other->_impl_.request_id_, arena); + swap(_impl_.generation_, other->_impl_.generation_); +} + +::google::protobuf::Metadata ConnectInvocationRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectInvocationValidation::ConnectInvocationValidation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectInvocationValidation_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectInvocationValidation) +} +PROTOBUF_NDEBUG_INLINE ConnectInvocationValidation::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectInvocationValidation& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + rejection_reason_(arena, from.rejection_reason_) {} + +ConnectInvocationValidation::ConnectInvocationValidation( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectInvocationValidation& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectInvocationValidation_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectInvocationValidation* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.accepted_ = from._impl_.accepted_; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectInvocationValidation) +} +PROTOBUF_NDEBUG_INLINE ConnectInvocationValidation::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + rejection_reason_(arena) {} + +inline void ConnectInvocationValidation::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.accepted_ = {}; +} +ConnectInvocationValidation::~ConnectInvocationValidation() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectInvocationValidation) + SharedDtor(*this); +} +inline void ConnectInvocationValidation::SharedDtor(MessageLite& self) { + ConnectInvocationValidation& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.rejection_reason_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectInvocationValidation_class_data_ = + ConnectInvocationValidation::InternalGenerateClassData_(ConnectInvocationValidation_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectInvocationValidation::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectInvocationValidation_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectInvocationValidation_class_data_.tc_table); + return ConnectInvocationValidation_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectInvocationValidation::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectInvocationValidation_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectInvocationValidation_globals_)); + return ConnectInvocationValidation_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectInvocationValidation::ParseTableT_ + ConnectInvocationValidation::_table_ = + ConnectInvocationValidation::InternalGenerateParseTable_(ConnectInvocationValidation_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectInvocationValidation::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectInvocationValidation) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.rejection_reason_.ClearNonDefaultToEmpty(); + } + _impl_.accepted_ = false; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectInvocationValidation::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectInvocationValidation& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectInvocationValidation::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectInvocationValidation& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectInvocationValidation) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // bool accepted = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_accepted() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 1, this_._internal_accepted(), target); + } + } + + // string rejection_reason = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_rejection_reason().empty()) { + const ::std::string& _s = this_._internal_rejection_reason(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectInvocationValidation.rejection_reason"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectInvocationValidation) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectInvocationValidation::ByteSizeLong(const MessageLite& base) { + const ConnectInvocationValidation& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectInvocationValidation::ByteSizeLong() const { + const ConnectInvocationValidation& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectInvocationValidation) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // string rejection_reason = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_rejection_reason().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_rejection_reason()); + } + } + // bool accepted = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_accepted() != 0) { + total_size += 2; + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectInvocationValidation::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectInvocationValidation) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_rejection_reason().empty()) { + _this->_internal_set_rejection_reason(from._internal_rejection_reason()); + } else { + if (_this->_impl_.rejection_reason_.IsDefault()) { + _this->_internal_set_rejection_reason(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_accepted() != 0) { + _this->_impl_.accepted_ = from._impl_.accepted_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectInvocationValidation::CopyFrom(const ConnectInvocationValidation& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectInvocationValidation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectInvocationValidation::InternalSwap(ConnectInvocationValidation* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.rejection_reason_, &other->_impl_.rejection_reason_, arena); + swap(_impl_.accepted_, other->_impl_.accepted_); +} + +::google::protobuf::Metadata ConnectInvocationValidation::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +void ConnectInvocationEvent::clear_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.event_ != nullptr) _impl_.event_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +ConnectInvocationEvent::ConnectInvocationEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectInvocationEvent_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectInvocationEvent) +} +PROTOBUF_NDEBUG_INLINE ConnectInvocationEvent::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectInvocationEvent& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + request_id_(arena, from.request_id_) {} + +ConnectInvocationEvent::ConnectInvocationEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectInvocationEvent& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectInvocationEvent_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectInvocationEvent* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.event_ = (CheckHasBit(cached_has_bits, 0x00000002U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.event_) + : nullptr; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectInvocationEvent) +} +PROTOBUF_NDEBUG_INLINE ConnectInvocationEvent::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + request_id_(arena) {} + +inline void ConnectInvocationEvent::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.event_ = {}; +} +ConnectInvocationEvent::~ConnectInvocationEvent() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectInvocationEvent) + SharedDtor(*this); +} +inline void ConnectInvocationEvent::SharedDtor(MessageLite& self) { + ConnectInvocationEvent& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.request_id_.Destroy(); + delete this_._impl_.event_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectInvocationEvent_class_data_ = + ConnectInvocationEvent::InternalGenerateClassData_(ConnectInvocationEvent_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectInvocationEvent::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectInvocationEvent_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectInvocationEvent_class_data_.tc_table); + return ConnectInvocationEvent_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectInvocationEvent::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectInvocationEvent_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectInvocationEvent_globals_)); + return ConnectInvocationEvent_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectInvocationEvent::ParseTableT_ + ConnectInvocationEvent::_table_ = + ConnectInvocationEvent::InternalGenerateParseTable_(ConnectInvocationEvent_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectInvocationEvent::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectInvocationEvent) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.request_id_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(_impl_.event_ != nullptr); + _impl_.event_->Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectInvocationEvent::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectInvocationEvent& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectInvocationEvent::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectInvocationEvent& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectInvocationEvent) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string request_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_request_id().empty()) { + const ::std::string& _s = this_._internal_request_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectInvocationEvent.request_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // .runanywhere.v1.LLMStreamEvent event = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, *this_._impl_.event_, this_._impl_.event_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectInvocationEvent) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectInvocationEvent::ByteSizeLong(const MessageLite& base) { + const ConnectInvocationEvent& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectInvocationEvent::ByteSizeLong() const { + const ConnectInvocationEvent& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectInvocationEvent) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // string request_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_request_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_request_id()); + } + } + // .runanywhere.v1.LLMStreamEvent event = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.event_); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectInvocationEvent::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectInvocationEvent) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_request_id().empty()) { + _this->_internal_set_request_id(from._internal_request_id()); + } else { + if (_this->_impl_.request_id_.IsDefault()) { + _this->_internal_set_request_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(from._impl_.event_ != nullptr); + if (_this->_impl_.event_ == nullptr) { + _this->_impl_.event_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.event_); + } else { + _this->_impl_.event_->MergeFrom(*from._impl_.event_); + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectInvocationEvent::CopyFrom(const ConnectInvocationEvent& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectInvocationEvent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectInvocationEvent::InternalSwap(ConnectInvocationEvent* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.request_id_, &other->_impl_.request_id_, arena); + swap(_impl_.event_, other->_impl_.event_); +} + +::google::protobuf::Metadata ConnectInvocationEvent::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectHeartbeatRequest::ConnectHeartbeatRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHeartbeatRequest_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHeartbeatRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectHeartbeatRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectHeartbeatRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + session_id_(arena, from.session_id_) {} + +ConnectHeartbeatRequest::ConnectHeartbeatRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHeartbeatRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHeartbeatRequest_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHeartbeatRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.sequence_ = from._impl_.sequence_; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHeartbeatRequest) +} +PROTOBUF_NDEBUG_INLINE ConnectHeartbeatRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + session_id_(arena) {} + +inline void ConnectHeartbeatRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.sequence_ = {}; +} +ConnectHeartbeatRequest::~ConnectHeartbeatRequest() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectHeartbeatRequest) + SharedDtor(*this); +} +inline void ConnectHeartbeatRequest::SharedDtor(MessageLite& self) { + ConnectHeartbeatRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.session_id_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHeartbeatRequest_class_data_ = + ConnectHeartbeatRequest::InternalGenerateClassData_(ConnectHeartbeatRequest_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHeartbeatRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHeartbeatRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHeartbeatRequest_class_data_.tc_table); + return ConnectHeartbeatRequest_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHeartbeatRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHeartbeatRequest_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHeartbeatRequest_globals_)); + return ConnectHeartbeatRequest_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHeartbeatRequest::ParseTableT_ + ConnectHeartbeatRequest::_table_ = + ConnectHeartbeatRequest::InternalGenerateParseTable_(ConnectHeartbeatRequest_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectHeartbeatRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectHeartbeatRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.session_id_.ClearNonDefaultToEmpty(); + } + _impl_.sequence_ = ::uint64_t{0u}; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectHeartbeatRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectHeartbeatRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectHeartbeatRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectHeartbeatRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectHeartbeatRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + const ::std::string& _s = this_._internal_session_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectHeartbeatRequest.session_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // uint64 sequence = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_sequence() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 2, this_._internal_sequence(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectHeartbeatRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectHeartbeatRequest::ByteSizeLong(const MessageLite& base) { + const ConnectHeartbeatRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectHeartbeatRequest::ByteSizeLong() const { + const ConnectHeartbeatRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectHeartbeatRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_session_id()); + } + } + // uint64 sequence = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_sequence() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_sequence()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectHeartbeatRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectHeartbeatRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_session_id().empty()) { + _this->_internal_set_session_id(from._internal_session_id()); + } else { + if (_this->_impl_.session_id_.IsDefault()) { + _this->_internal_set_session_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_sequence() != 0) { + _this->_impl_.sequence_ = from._impl_.sequence_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectHeartbeatRequest::CopyFrom(const ConnectHeartbeatRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectHeartbeatRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectHeartbeatRequest::InternalSwap(ConnectHeartbeatRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.session_id_, &other->_impl_.session_id_, arena); + swap(_impl_.sequence_, other->_impl_.sequence_); +} + +::google::protobuf::Metadata ConnectHeartbeatRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +ConnectHeartbeatResponse::ConnectHeartbeatResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHeartbeatResponse_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHeartbeatResponse) +} +PROTOBUF_NDEBUG_INLINE ConnectHeartbeatResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectHeartbeatResponse& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + session_id_(arena, from.session_id_) {} + +ConnectHeartbeatResponse::ConnectHeartbeatResponse( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHeartbeatResponse& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHeartbeatResponse_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHeartbeatResponse* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.sequence_ = from._impl_.sequence_; + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHeartbeatResponse) +} +PROTOBUF_NDEBUG_INLINE ConnectHeartbeatResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + session_id_(arena) {} + +inline void ConnectHeartbeatResponse::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.sequence_ = {}; +} +ConnectHeartbeatResponse::~ConnectHeartbeatResponse() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectHeartbeatResponse) + SharedDtor(*this); +} +inline void ConnectHeartbeatResponse::SharedDtor(MessageLite& self) { + ConnectHeartbeatResponse& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.session_id_.Destroy(); + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHeartbeatResponse_class_data_ = + ConnectHeartbeatResponse::InternalGenerateClassData_(ConnectHeartbeatResponse_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHeartbeatResponse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHeartbeatResponse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHeartbeatResponse_class_data_.tc_table); + return ConnectHeartbeatResponse_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHeartbeatResponse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHeartbeatResponse_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHeartbeatResponse_globals_)); + return ConnectHeartbeatResponse_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHeartbeatResponse::ParseTableT_ + ConnectHeartbeatResponse::_table_ = + ConnectHeartbeatResponse::InternalGenerateParseTable_(ConnectHeartbeatResponse_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectHeartbeatResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectHeartbeatResponse) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.session_id_.ClearNonDefaultToEmpty(); + } + _impl_.sequence_ = ::uint64_t{0u}; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectHeartbeatResponse::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectHeartbeatResponse& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectHeartbeatResponse::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectHeartbeatResponse& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectHeartbeatResponse) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + const ::std::string& _s = this_._internal_session_id(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "runanywhere.v1.ConnectHeartbeatResponse.session_id"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // uint64 sequence = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_sequence() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 2, this_._internal_sequence(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectHeartbeatResponse) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectHeartbeatResponse::ByteSizeLong(const MessageLite& base) { + const ConnectHeartbeatResponse& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectHeartbeatResponse::ByteSizeLong() const { + const ConnectHeartbeatResponse& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectHeartbeatResponse) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // string session_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_session_id().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_session_id()); + } + } + // uint64 sequence = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_sequence() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_sequence()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectHeartbeatResponse::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectHeartbeatResponse) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_session_id().empty()) { + _this->_internal_set_session_id(from._internal_session_id()); + } else { + if (_this->_impl_.session_id_.IsDefault()) { + _this->_internal_set_session_id(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_sequence() != 0) { + _this->_impl_.sequence_ = from._impl_.sequence_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectHeartbeatResponse::CopyFrom(const ConnectHeartbeatResponse& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectHeartbeatResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectHeartbeatResponse::InternalSwap(ConnectHeartbeatResponse* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.session_id_, &other->_impl_.session_id_, arena); + swap(_impl_.sequence_, other->_impl_.sequence_); +} + +::google::protobuf::Metadata ConnectHeartbeatResponse::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +void ConnectClientFrame::set_allocated_invocation(::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE invocation) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_payload(); + if (invocation) { + ::google::protobuf::Arena* submessage_arena = invocation->GetArena(); + if (message_arena != submessage_arena) { + invocation = ::google::protobuf::internal::GetOwnedMessage(message_arena, invocation, submessage_arena); + } + set_has_invocation(); + _impl_.payload_.invocation_ = invocation; + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientFrame.invocation) +} +void ConnectClientFrame::set_allocated_heartbeat(::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE heartbeat) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_payload(); + if (heartbeat) { + ::google::protobuf::Arena* submessage_arena = heartbeat->GetArena(); + if (message_arena != submessage_arena) { + heartbeat = ::google::protobuf::internal::GetOwnedMessage(message_arena, heartbeat, submessage_arena); + } + set_has_heartbeat(); + _impl_.payload_.heartbeat_ = heartbeat; + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientFrame.heartbeat) +} +ConnectClientFrame::ConnectClientFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientFrame_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectClientFrame) +} +PROTOBUF_NDEBUG_INLINE ConnectClientFrame::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectClientFrame& from_msg) + : payload_{}, + _cached_size_{0}, + _oneof_case_{from._oneof_case_[0]} {} + +ConnectClientFrame::ConnectClientFrame( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectClientFrame& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectClientFrame_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectClientFrame* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + switch (payload_case()) { + case PAYLOAD_NOT_SET: + break; + case kInvocation: + _impl_.payload_.invocation_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.invocation_); + break; + case kHeartbeat: + _impl_.payload_.heartbeat_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.heartbeat_); + break; + } + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectClientFrame) +} +PROTOBUF_NDEBUG_INLINE ConnectClientFrame::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : payload_{}, + _cached_size_{0}, + _oneof_case_{} {} + +inline void ConnectClientFrame::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +ConnectClientFrame::~ConnectClientFrame() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectClientFrame) + SharedDtor(*this); +} +inline void ConnectClientFrame::SharedDtor(MessageLite& self) { + ConnectClientFrame& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + if (this_.has_payload()) { + this_.clear_payload(); + } + this_._impl_.~Impl_(); +} + +void ConnectClientFrame::clear_payload() { +// @@protoc_insertion_point(one_of_clear_start:runanywhere.v1.ConnectClientFrame) + ::google::protobuf::internal::TSanWrite(&_impl_); + switch (payload_case()) { + case kInvocation: { + if (GetArena() == nullptr) { + delete _impl_.payload_.invocation_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.invocation_); + } + break; + } + case kHeartbeat: { + if (GetArena() == nullptr) { + delete _impl_.payload_.heartbeat_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.heartbeat_); + } + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = PAYLOAD_NOT_SET; +} + + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectClientFrame_class_data_ = + ConnectClientFrame::InternalGenerateClassData_(ConnectClientFrame_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientFrame::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientFrame_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectClientFrame_class_data_.tc_table); + return ConnectClientFrame_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectClientFrame::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectClientFrame_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectClientFrame_globals_)); + return ConnectClientFrame_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectClientFrame::ParseTableT_ + ConnectClientFrame::_table_ = + ConnectClientFrame::InternalGenerateParseTable_(ConnectClientFrame_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectClientFrame::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectClientFrame) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_payload(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectClientFrame::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectClientFrame& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectClientFrame::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectClientFrame& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectClientFrame) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + switch (this_.payload_case()) { + case kInvocation: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, *this_._impl_.payload_.invocation_, this_._impl_.payload_.invocation_->GetCachedSize(), target, + stream); + break; + } + case kHeartbeat: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, *this_._impl_.payload_.heartbeat_, this_._impl_.payload_.heartbeat_->GetCachedSize(), target, + stream); + break; + } + default: + break; + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectClientFrame) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectClientFrame::ByteSizeLong(const MessageLite& base) { + const ConnectClientFrame& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectClientFrame::ByteSizeLong() const { + const ConnectClientFrame& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectClientFrame) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + switch (this_.payload_case()) { + // .runanywhere.v1.ConnectInvocationRequest invocation = 1; + case kInvocation: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.payload_.invocation_); + break; + } + // .runanywhere.v1.ConnectHeartbeatRequest heartbeat = 2; + case kHeartbeat: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.payload_.heartbeat_); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectClientFrame::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectClientFrame) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + if (const uint32_t oneof_from_case = + from._impl_._oneof_case_[0]) { + const uint32_t oneof_to_case = _this->_impl_._oneof_case_[0]; + const bool oneof_needs_init = oneof_to_case != oneof_from_case; + if (oneof_needs_init) { + if (oneof_to_case != 0) { + _this->clear_payload(); + } + _this->_impl_._oneof_case_[0] = oneof_from_case; + } + + switch (oneof_from_case) { + case kInvocation: { + if (oneof_needs_init) { + _this->_impl_.payload_.invocation_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.invocation_); + } else { + _this->_impl_.payload_.invocation_->MergeFrom(*from._impl_.payload_.invocation_); + } + break; + } + case kHeartbeat: { + if (oneof_needs_init) { + _this->_impl_.payload_.heartbeat_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.heartbeat_); + } else { + _this->_impl_.payload_.heartbeat_->MergeFrom(*from._impl_.payload_.heartbeat_); + } + break; + } + case PAYLOAD_NOT_SET: + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectClientFrame::CopyFrom(const ConnectClientFrame& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectClientFrame) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectClientFrame::InternalSwap(ConnectClientFrame* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.payload_, other->_impl_.payload_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata ConnectClientFrame::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +void ConnectHostFrame::set_allocated_invocation_event(::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE invocation_event) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_payload(); + if (invocation_event) { + ::google::protobuf::Arena* submessage_arena = invocation_event->GetArena(); + if (message_arena != submessage_arena) { + invocation_event = ::google::protobuf::internal::GetOwnedMessage(message_arena, invocation_event, submessage_arena); + } + set_has_invocation_event(); + _impl_.payload_.invocation_event_ = invocation_event; + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostFrame.invocation_event) +} +void ConnectHostFrame::set_allocated_heartbeat(::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE heartbeat) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_payload(); + if (heartbeat) { + ::google::protobuf::Arena* submessage_arena = heartbeat->GetArena(); + if (message_arena != submessage_arena) { + heartbeat = ::google::protobuf::internal::GetOwnedMessage(message_arena, heartbeat, submessage_arena); + } + set_has_heartbeat(); + _impl_.payload_.heartbeat_ = heartbeat; + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostFrame.heartbeat) +} +ConnectHostFrame::ConnectHostFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHostFrame_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:runanywhere.v1.ConnectHostFrame) +} +PROTOBUF_NDEBUG_INLINE ConnectHostFrame::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::runanywhere::v1::ConnectHostFrame& from_msg) + : payload_{}, + _cached_size_{0}, + _oneof_case_{from._oneof_case_[0]} {} + +ConnectHostFrame::ConnectHostFrame( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ConnectHostFrame& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ConnectHostFrame_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ConnectHostFrame* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + switch (payload_case()) { + case PAYLOAD_NOT_SET: + break; + case kInvocationEvent: + _impl_.payload_.invocation_event_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.invocation_event_); + break; + case kHeartbeat: + _impl_.payload_.heartbeat_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.heartbeat_); + break; + } + + // @@protoc_insertion_point(copy_constructor:runanywhere.v1.ConnectHostFrame) +} +PROTOBUF_NDEBUG_INLINE ConnectHostFrame::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : payload_{}, + _cached_size_{0}, + _oneof_case_{} {} + +inline void ConnectHostFrame::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +ConnectHostFrame::~ConnectHostFrame() { + // @@protoc_insertion_point(destructor:runanywhere.v1.ConnectHostFrame) + SharedDtor(*this); +} +inline void ConnectHostFrame::SharedDtor(MessageLite& self) { + ConnectHostFrame& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + if (this_.has_payload()) { + this_.clear_payload(); + } + this_._impl_.~Impl_(); +} + +void ConnectHostFrame::clear_payload() { +// @@protoc_insertion_point(one_of_clear_start:runanywhere.v1.ConnectHostFrame) + ::google::protobuf::internal::TSanWrite(&_impl_); + switch (payload_case()) { + case kInvocationEvent: { + if (GetArena() == nullptr) { + delete _impl_.payload_.invocation_event_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.invocation_event_); + } + break; + } + case kHeartbeat: { + if (GetArena() == nullptr) { + delete _impl_.payload_.heartbeat_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.heartbeat_); + } + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = PAYLOAD_NOT_SET; +} + + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ConnectHostFrame_class_data_ = + ConnectHostFrame::InternalGenerateClassData_(ConnectHostFrame_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostFrame::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostFrame_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ConnectHostFrame_class_data_.tc_table); + return ConnectHostFrame_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ConnectHostFrame::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ConnectHostFrame_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&ConnectHostFrame_globals_)); + return ConnectHostFrame_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ConnectHostFrame::ParseTableT_ + ConnectHostFrame::_table_ = + ConnectHostFrame::InternalGenerateParseTable_(ConnectHostFrame_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void ConnectHostFrame::Clear() { +// @@protoc_insertion_point(message_clear_start:runanywhere.v1.ConnectHostFrame) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_payload(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ConnectHostFrame::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ConnectHostFrame& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ConnectHostFrame::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ConnectHostFrame& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:runanywhere.v1.ConnectHostFrame) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + switch (this_.payload_case()) { + case kInvocationEvent: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, *this_._impl_.payload_.invocation_event_, this_._impl_.payload_.invocation_event_->GetCachedSize(), target, + stream); + break; + } + case kHeartbeat: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, *this_._impl_.payload_.heartbeat_, this_._impl_.payload_.heartbeat_->GetCachedSize(), target, + stream); + break; + } + default: + break; + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:runanywhere.v1.ConnectHostFrame) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ConnectHostFrame::ByteSizeLong(const MessageLite& base) { + const ConnectHostFrame& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ConnectHostFrame::ByteSizeLong() const { + const ConnectHostFrame& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:runanywhere.v1.ConnectHostFrame) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + switch (this_.payload_case()) { + // .runanywhere.v1.ConnectInvocationEvent invocation_event = 1; + case kInvocationEvent: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.payload_.invocation_event_); + break; + } + // .runanywhere.v1.ConnectHeartbeatResponse heartbeat = 2; + case kHeartbeat: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.payload_.heartbeat_); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ConnectHostFrame::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:runanywhere.v1.ConnectHostFrame) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + if (const uint32_t oneof_from_case = + from._impl_._oneof_case_[0]) { + const uint32_t oneof_to_case = _this->_impl_._oneof_case_[0]; + const bool oneof_needs_init = oneof_to_case != oneof_from_case; + if (oneof_needs_init) { + if (oneof_to_case != 0) { + _this->clear_payload(); + } + _this->_impl_._oneof_case_[0] = oneof_from_case; + } + + switch (oneof_from_case) { + case kInvocationEvent: { + if (oneof_needs_init) { + _this->_impl_.payload_.invocation_event_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.invocation_event_); + } else { + _this->_impl_.payload_.invocation_event_->MergeFrom(*from._impl_.payload_.invocation_event_); + } + break; + } + case kHeartbeat: { + if (oneof_needs_init) { + _this->_impl_.payload_.heartbeat_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.payload_.heartbeat_); + } else { + _this->_impl_.payload_.heartbeat_->MergeFrom(*from._impl_.payload_.heartbeat_); + } + break; + } + case PAYLOAD_NOT_SET: + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ConnectHostFrame::CopyFrom(const ConnectHostFrame& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:runanywhere.v1.ConnectHostFrame) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ConnectHostFrame::InternalSwap(ConnectHostFrame* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.payload_, other->_impl_.payload_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata ConnectHostFrame::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// @@protoc_insertion_point(namespace_scope) +} // namespace v1 +} // namespace runanywhere +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google +// @@protoc_insertion_point(global_scope) +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::std::false_type + _static_init2_ [[maybe_unused]] = + (::_pbi::AddDescriptors(&descriptor_table_connect_2eproto), + ::std::false_type{}); +#include "google/protobuf/port_undef.inc" diff --git a/sdk/runanywhere-commons/src/generated/proto/connect.pb.h b/sdk/runanywhere-commons/src/generated/proto/connect.pb.h new file mode 100644 index 0000000000..8d39fbc315 --- /dev/null +++ b/sdk/runanywhere-commons/src/generated/proto/connect.pb.h @@ -0,0 +1,8050 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: connect.proto +// Protobuf C++ Version: 7.35.1 + +#ifndef connect_2eproto_2epb_2eh +#define connect_2eproto_2epb_2eh + +#include +#include +#include +#include + +// clang-format off +#include "google/protobuf/runtime_version.h" +#if PROTOBUF_VERSION != 7035001 +#error "Protobuf C++ gencode is built with an incompatible version of" +#error "Protobuf C++ headers/runtime. See" +#error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp" +#endif +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/arena.h" +#include "google/protobuf/arenastring.h" +#include "google/protobuf/generated_message_bases.h" +#include "google/protobuf/generated_message_tctable_decl.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/metadata_lite.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/message.h" +#include "google/protobuf/message_lite.h" +#include "google/protobuf/repeated_field.h" // IWYU pragma: export +#include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/generated_enum_reflection.h" +#include "google/protobuf/unknown_field_set.h" +#include "llm_service.pb.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define PROTOBUF_INTERNAL_EXPORT_connect_2eproto + +namespace google { +namespace protobuf { +namespace internal { +template +::absl::string_view GetAnyMessageName(); +} // namespace internal +} // namespace protobuf +} // namespace google + +// Internal implementation detail -- do not use these members. +struct TableStruct_connect_2eproto { + static const ::uint32_t offsets[]; +}; +extern "C" { +extern const ::google::protobuf::internal::DescriptorTable descriptor_table_connect_2eproto; +} // extern "C" +namespace runanywhere { +namespace v1 { +enum ConnectHandshakeStatus : int; +extern const uint32_t ConnectHandshakeStatus_internal_data_[]; +enum ConnectPlatform : int; +extern const uint32_t ConnectPlatform_internal_data_[]; +enum ConnectRoleAvailability : int; +extern const uint32_t ConnectRoleAvailability_internal_data_[]; +enum ConnectSessionState : int; +extern const uint32_t ConnectSessionState_internal_data_[]; +class ConnectClientFrame; +struct ConnectClientFrameGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectClientFrameGlobalsTypeInternal ConnectClientFrame_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectClientFrame_class_data_; +#else +extern const ConnectClientFrameGlobalsTypeInternal ConnectClientFrame_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectClientHello; +struct ConnectClientHelloGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectClientHelloGlobalsTypeInternal ConnectClientHello_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectClientHello_class_data_; +#else +extern const ConnectClientHelloGlobalsTypeInternal ConnectClientHello_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectClientSessionState; +struct ConnectClientSessionStateGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectClientSessionStateGlobalsTypeInternal ConnectClientSessionState_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectClientSessionState_class_data_; +#else +extern const ConnectClientSessionStateGlobalsTypeInternal ConnectClientSessionState_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectClientStartRequest; +struct ConnectClientStartRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectClientStartRequestGlobalsTypeInternal ConnectClientStartRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectClientStartRequest_class_data_; +#else +extern const ConnectClientStartRequestGlobalsTypeInternal ConnectClientStartRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectDiscoveryMetadata; +struct ConnectDiscoveryMetadataGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectDiscoveryMetadataGlobalsTypeInternal ConnectDiscoveryMetadata_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectDiscoveryMetadata_class_data_; +#else +extern const ConnectDiscoveryMetadataGlobalsTypeInternal ConnectDiscoveryMetadata_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHandshakeResponse; +struct ConnectHandshakeResponseGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHandshakeResponseGlobalsTypeInternal ConnectHandshakeResponse_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHandshakeResponse_class_data_; +#else +extern const ConnectHandshakeResponseGlobalsTypeInternal ConnectHandshakeResponse_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHeartbeatRequest; +struct ConnectHeartbeatRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHeartbeatRequestGlobalsTypeInternal ConnectHeartbeatRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHeartbeatRequest_class_data_; +#else +extern const ConnectHeartbeatRequestGlobalsTypeInternal ConnectHeartbeatRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHeartbeatResponse; +struct ConnectHeartbeatResponseGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHeartbeatResponseGlobalsTypeInternal ConnectHeartbeatResponse_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHeartbeatResponse_class_data_; +#else +extern const ConnectHeartbeatResponseGlobalsTypeInternal ConnectHeartbeatResponse_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHostFrame; +struct ConnectHostFrameGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHostFrameGlobalsTypeInternal ConnectHostFrame_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHostFrame_class_data_; +#else +extern const ConnectHostFrameGlobalsTypeInternal ConnectHostFrame_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHostStartRequest; +struct ConnectHostStartRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHostStartRequestGlobalsTypeInternal ConnectHostStartRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHostStartRequest_class_data_; +#else +extern const ConnectHostStartRequestGlobalsTypeInternal ConnectHostStartRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHostState; +struct ConnectHostStateGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHostStateGlobalsTypeInternal ConnectHostState_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHostState_class_data_; +#else +extern const ConnectHostStateGlobalsTypeInternal ConnectHostState_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectHostStopRequest; +struct ConnectHostStopRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectHostStopRequestGlobalsTypeInternal ConnectHostStopRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectHostStopRequest_class_data_; +#else +extern const ConnectHostStopRequestGlobalsTypeInternal ConnectHostStopRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectInvocationEvent; +struct ConnectInvocationEventGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectInvocationEventGlobalsTypeInternal ConnectInvocationEvent_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectInvocationEvent_class_data_; +#else +extern const ConnectInvocationEventGlobalsTypeInternal ConnectInvocationEvent_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectInvocationRequest; +struct ConnectInvocationRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectInvocationRequestGlobalsTypeInternal ConnectInvocationRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectInvocationRequest_class_data_; +#else +extern const ConnectInvocationRequestGlobalsTypeInternal ConnectInvocationRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectInvocationValidation; +struct ConnectInvocationValidationGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectInvocationValidationGlobalsTypeInternal ConnectInvocationValidation_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectInvocationValidation_class_data_; +#else +extern const ConnectInvocationValidationGlobalsTypeInternal ConnectInvocationValidation_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectModelDescriptor; +struct ConnectModelDescriptorGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectModelDescriptorGlobalsTypeInternal ConnectModelDescriptor_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectModelDescriptor_class_data_; +#else +extern const ConnectModelDescriptorGlobalsTypeInternal ConnectModelDescriptor_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectPlatformPolicy; +struct ConnectPlatformPolicyGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectPlatformPolicyGlobalsTypeInternal ConnectPlatformPolicy_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectPlatformPolicy_class_data_; +#else +extern const ConnectPlatformPolicyGlobalsTypeInternal ConnectPlatformPolicy_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectPlatformPolicyRequest; +struct ConnectPlatformPolicyRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectPlatformPolicyRequestGlobalsTypeInternal ConnectPlatformPolicyRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectPlatformPolicyRequest_class_data_; +#else +extern const ConnectPlatformPolicyRequestGlobalsTypeInternal ConnectPlatformPolicyRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +class ConnectSessionCloseRequest; +struct ConnectSessionCloseRequestGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ConnectSessionCloseRequestGlobalsTypeInternal ConnectSessionCloseRequest_globals_; +extern const ::google::protobuf::internal::ClassDataFull ConnectSessionCloseRequest_class_data_; +#else +extern const ConnectSessionCloseRequestGlobalsTypeInternal ConnectSessionCloseRequest_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS +} // namespace v1 +} // namespace runanywhere +namespace google { +namespace protobuf { +template <> +internal::EnumTraitsT<::runanywhere::v1::ConnectHandshakeStatus_internal_data_> + internal::EnumTraitsImpl::value<::runanywhere::v1::ConnectHandshakeStatus>; +template <> +internal::EnumTraitsT<::runanywhere::v1::ConnectPlatform_internal_data_> + internal::EnumTraitsImpl::value<::runanywhere::v1::ConnectPlatform>; +template <> +internal::EnumTraitsT<::runanywhere::v1::ConnectRoleAvailability_internal_data_> + internal::EnumTraitsImpl::value<::runanywhere::v1::ConnectRoleAvailability>; +template <> +internal::EnumTraitsT<::runanywhere::v1::ConnectSessionState_internal_data_> + internal::EnumTraitsImpl::value<::runanywhere::v1::ConnectSessionState>; +} // namespace protobuf +} // namespace google + +namespace runanywhere { +namespace v1 { +enum ConnectPlatform : int { + CONNECT_PLATFORM_UNSPECIFIED = 0, + CONNECT_PLATFORM_MACOS = 1, + CONNECT_PLATFORM_IOS = 2, + CONNECT_PLATFORM_IPADOS = 3, + CONNECT_PLATFORM_ANDROID = 4, + CONNECT_PLATFORM_REACT_NATIVE = 5, + CONNECT_PLATFORM_FLUTTER = 6, + CONNECT_PLATFORM_WEB = 7, + CONNECT_PLATFORM_WINDOWS = 8, + ConnectPlatform_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + ConnectPlatform_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t ConnectPlatform_internal_data_[]; +inline constexpr ConnectPlatform ConnectPlatform_MIN = + static_cast(0); +inline constexpr ConnectPlatform ConnectPlatform_MAX = + static_cast(8); +[[nodiscard]] inline bool ConnectPlatform_IsValid(int value) { + return 0 <= value && value <= 8; +} +inline constexpr int ConnectPlatform_ARRAYSIZE = 8 + 1; +[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL +ConnectPlatform_descriptor(); +[[nodiscard]] inline auto ProtobufInternalGetEnumDescriptor(ConnectPlatform) { + return ConnectPlatform_descriptor(); +} +template +[[nodiscard]] const ::std::string& ConnectPlatform_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to ConnectPlatform_Name()."); + return ConnectPlatform_Name(static_cast(value)); +} +template <> +[[nodiscard]] inline const ::std::string& ConnectPlatform_Name(ConnectPlatform value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +[[nodiscard]] inline bool ConnectPlatform_Parse( + ::absl::string_view name, ConnectPlatform* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(ConnectPlatform_descriptor(), name, + value); +} +enum ConnectRoleAvailability : int { + CONNECT_ROLE_AVAILABILITY_UNSPECIFIED = 0, + CONNECT_ROLE_AVAILABILITY_DISABLED = 1, + CONNECT_ROLE_AVAILABILITY_PLANNED = 2, + CONNECT_ROLE_AVAILABILITY_ENABLED = 3, + ConnectRoleAvailability_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + ConnectRoleAvailability_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t ConnectRoleAvailability_internal_data_[]; +inline constexpr ConnectRoleAvailability ConnectRoleAvailability_MIN = + static_cast(0); +inline constexpr ConnectRoleAvailability ConnectRoleAvailability_MAX = + static_cast(3); +[[nodiscard]] inline bool ConnectRoleAvailability_IsValid(int value) { + return 0 <= value && value <= 3; +} +inline constexpr int ConnectRoleAvailability_ARRAYSIZE = 3 + 1; +[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL +ConnectRoleAvailability_descriptor(); +[[nodiscard]] inline auto ProtobufInternalGetEnumDescriptor(ConnectRoleAvailability) { + return ConnectRoleAvailability_descriptor(); +} +template +[[nodiscard]] const ::std::string& ConnectRoleAvailability_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to ConnectRoleAvailability_Name()."); + return ConnectRoleAvailability_Name(static_cast(value)); +} +template <> +[[nodiscard]] inline const ::std::string& ConnectRoleAvailability_Name(ConnectRoleAvailability value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +[[nodiscard]] inline bool ConnectRoleAvailability_Parse( + ::absl::string_view name, ConnectRoleAvailability* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(ConnectRoleAvailability_descriptor(), name, + value); +} +enum ConnectHandshakeStatus : int { + CONNECT_HANDSHAKE_STATUS_UNSPECIFIED = 0, + CONNECT_HANDSHAKE_STATUS_ACCEPTED = 1, + CONNECT_HANDSHAKE_STATUS_REJECTED = 2, + ConnectHandshakeStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + ConnectHandshakeStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t ConnectHandshakeStatus_internal_data_[]; +inline constexpr ConnectHandshakeStatus ConnectHandshakeStatus_MIN = + static_cast(0); +inline constexpr ConnectHandshakeStatus ConnectHandshakeStatus_MAX = + static_cast(2); +[[nodiscard]] inline bool ConnectHandshakeStatus_IsValid(int value) { + return 0 <= value && value <= 2; +} +inline constexpr int ConnectHandshakeStatus_ARRAYSIZE = 2 + 1; +[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL +ConnectHandshakeStatus_descriptor(); +[[nodiscard]] inline auto ProtobufInternalGetEnumDescriptor(ConnectHandshakeStatus) { + return ConnectHandshakeStatus_descriptor(); +} +template +[[nodiscard]] const ::std::string& ConnectHandshakeStatus_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to ConnectHandshakeStatus_Name()."); + return ConnectHandshakeStatus_Name(static_cast(value)); +} +template <> +[[nodiscard]] inline const ::std::string& ConnectHandshakeStatus_Name(ConnectHandshakeStatus value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +[[nodiscard]] inline bool ConnectHandshakeStatus_Parse( + ::absl::string_view name, ConnectHandshakeStatus* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(ConnectHandshakeStatus_descriptor(), name, + value); +} +enum ConnectSessionState : int { + CONNECT_SESSION_STATE_UNSPECIFIED = 0, + CONNECT_SESSION_STATE_CONNECTING = 1, + CONNECT_SESSION_STATE_CONNECTED = 2, + CONNECT_SESSION_STATE_DISCONNECTED = 3, + CONNECT_SESSION_STATE_FAILED = 4, + ConnectSessionState_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + ConnectSessionState_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t ConnectSessionState_internal_data_[]; +inline constexpr ConnectSessionState ConnectSessionState_MIN = + static_cast(0); +inline constexpr ConnectSessionState ConnectSessionState_MAX = + static_cast(4); +[[nodiscard]] inline bool ConnectSessionState_IsValid(int value) { + return 0 <= value && value <= 4; +} +inline constexpr int ConnectSessionState_ARRAYSIZE = 4 + 1; +[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL +ConnectSessionState_descriptor(); +[[nodiscard]] inline auto ProtobufInternalGetEnumDescriptor(ConnectSessionState) { + return ConnectSessionState_descriptor(); +} +template +[[nodiscard]] const ::std::string& ConnectSessionState_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to ConnectSessionState_Name()."); + return ConnectSessionState_Name(static_cast(value)); +} +template <> +[[nodiscard]] inline const ::std::string& ConnectSessionState_Name(ConnectSessionState value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +[[nodiscard]] inline bool ConnectSessionState_Parse( + ::absl::string_view name, ConnectSessionState* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(ConnectSessionState_descriptor(), name, + value); +} +using ::google::protobuf::internal::generated_enum::AbslParseFlag; +using ::google::protobuf::internal::generated_enum::AbslUnparseFlag; + +// =================================================================== + + +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectSessionCloseRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectSessionCloseRequest) */ { + public: + inline ConnectSessionCloseRequest() : ConnectSessionCloseRequest(nullptr) {} + ~ConnectSessionCloseRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectSessionCloseRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectSessionCloseRequest)); + } +#endif + + template + explicit constexpr ConnectSessionCloseRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectSessionCloseRequest(const ConnectSessionCloseRequest& from) : ConnectSessionCloseRequest(nullptr, from) {} + inline ConnectSessionCloseRequest(ConnectSessionCloseRequest&& from) noexcept : ConnectSessionCloseRequest(nullptr, ::std::move(from)) {} + inline ConnectSessionCloseRequest& operator=(const ConnectSessionCloseRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectSessionCloseRequest& operator=(ConnectSessionCloseRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectSessionCloseRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectSessionCloseRequest_globals_); + } + static constexpr int kIndexInFileMessages = 11; + friend void swap(ConnectSessionCloseRequest& a, ConnectSessionCloseRequest& b) { a.Swap(&b); } + inline void Swap(ConnectSessionCloseRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectSessionCloseRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectSessionCloseRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectSessionCloseRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectSessionCloseRequest& from) { ConnectSessionCloseRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectSessionCloseRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectSessionCloseRequest"; } + + explicit ConnectSessionCloseRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectSessionCloseRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectSessionCloseRequest& from); + ConnectSessionCloseRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectSessionCloseRequest&& from) noexcept + : ConnectSessionCloseRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSessionIdFieldNumber = 1, + }; + // string session_id = 1; + void clear_session_id() ; + [[nodiscard]] const ::std::string& session_id() const; + template + void set_session_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_session_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_session_id(); + void set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_session_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_session_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_session_id(); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectSessionCloseRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<0, 1, + 0, 60, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectSessionCloseRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectPlatformPolicyRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectPlatformPolicyRequest) */ { + public: + inline ConnectPlatformPolicyRequest() : ConnectPlatformPolicyRequest(nullptr) {} + ~ConnectPlatformPolicyRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectPlatformPolicyRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectPlatformPolicyRequest)); + } +#endif + + template + explicit constexpr ConnectPlatformPolicyRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectPlatformPolicyRequest(const ConnectPlatformPolicyRequest& from) : ConnectPlatformPolicyRequest(nullptr, from) {} + inline ConnectPlatformPolicyRequest(ConnectPlatformPolicyRequest&& from) noexcept : ConnectPlatformPolicyRequest(nullptr, ::std::move(from)) {} + inline ConnectPlatformPolicyRequest& operator=(const ConnectPlatformPolicyRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectPlatformPolicyRequest& operator=(ConnectPlatformPolicyRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectPlatformPolicyRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectPlatformPolicyRequest_globals_); + } + static constexpr int kIndexInFileMessages = 0; + friend void swap(ConnectPlatformPolicyRequest& a, ConnectPlatformPolicyRequest& b) { a.Swap(&b); } + inline void Swap(ConnectPlatformPolicyRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectPlatformPolicyRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectPlatformPolicyRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectPlatformPolicyRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectPlatformPolicyRequest& from) { ConnectPlatformPolicyRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectPlatformPolicyRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectPlatformPolicyRequest"; } + + explicit ConnectPlatformPolicyRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectPlatformPolicyRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectPlatformPolicyRequest& from); + ConnectPlatformPolicyRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectPlatformPolicyRequest&& from) noexcept + : ConnectPlatformPolicyRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kPlatformFieldNumber = 1, + }; + // .runanywhere.v1.ConnectPlatform platform = 1; + void clear_platform() ; + [[nodiscard]] ::runanywhere::v1::ConnectPlatform platform() const; + void set_platform(::runanywhere::v1::ConnectPlatform value); + + private: + ::runanywhere::v1::ConnectPlatform _internal_platform() const; + void _internal_set_platform(::runanywhere::v1::ConnectPlatform value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectPlatformPolicyRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<0, 1, + 0, 0, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectPlatformPolicyRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + int platform_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectPlatformPolicy final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectPlatformPolicy) */ { + public: + inline ConnectPlatformPolicy() : ConnectPlatformPolicy(nullptr) {} + ~ConnectPlatformPolicy() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectPlatformPolicy* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectPlatformPolicy)); + } +#endif + + template + explicit constexpr ConnectPlatformPolicy(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectPlatformPolicy(const ConnectPlatformPolicy& from) : ConnectPlatformPolicy(nullptr, from) {} + inline ConnectPlatformPolicy(ConnectPlatformPolicy&& from) noexcept : ConnectPlatformPolicy(nullptr, ::std::move(from)) {} + inline ConnectPlatformPolicy& operator=(const ConnectPlatformPolicy& from) { + CopyFrom(from); + return *this; + } + inline ConnectPlatformPolicy& operator=(ConnectPlatformPolicy&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectPlatformPolicy& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectPlatformPolicy_globals_); + } + static constexpr int kIndexInFileMessages = 1; + friend void swap(ConnectPlatformPolicy& a, ConnectPlatformPolicy& b) { a.Swap(&b); } + inline void Swap(ConnectPlatformPolicy* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectPlatformPolicy* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectPlatformPolicy* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectPlatformPolicy& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectPlatformPolicy& from) { ConnectPlatformPolicy::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectPlatformPolicy* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectPlatformPolicy"; } + + explicit ConnectPlatformPolicy(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectPlatformPolicy(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectPlatformPolicy& from); + ConnectPlatformPolicy( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectPlatformPolicy&& from) noexcept + : ConnectPlatformPolicy(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kPlatformFieldNumber = 1, + kHostRoleFieldNumber = 2, + kClientRoleFieldNumber = 3, + }; + // .runanywhere.v1.ConnectPlatform platform = 1; + void clear_platform() ; + [[nodiscard]] ::runanywhere::v1::ConnectPlatform platform() const; + void set_platform(::runanywhere::v1::ConnectPlatform value); + + private: + ::runanywhere::v1::ConnectPlatform _internal_platform() const; + void _internal_set_platform(::runanywhere::v1::ConnectPlatform value); + + public: + // .runanywhere.v1.ConnectRoleAvailability host_role = 2; + void clear_host_role() ; + [[nodiscard]] ::runanywhere::v1::ConnectRoleAvailability host_role() const; + void set_host_role(::runanywhere::v1::ConnectRoleAvailability value); + + private: + ::runanywhere::v1::ConnectRoleAvailability _internal_host_role() const; + void _internal_set_host_role(::runanywhere::v1::ConnectRoleAvailability value); + + public: + // .runanywhere.v1.ConnectRoleAvailability client_role = 3; + void clear_client_role() ; + [[nodiscard]] ::runanywhere::v1::ConnectRoleAvailability client_role() const; + void set_client_role(::runanywhere::v1::ConnectRoleAvailability value); + + private: + ::runanywhere::v1::ConnectRoleAvailability _internal_client_role() const; + void _internal_set_client_role(::runanywhere::v1::ConnectRoleAvailability value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectPlatformPolicy) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<2, 3, + 0, 0, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectPlatformPolicy& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + int platform_; + int host_role_; + int client_role_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectModelDescriptor final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectModelDescriptor) */ { + public: + inline ConnectModelDescriptor() : ConnectModelDescriptor(nullptr) {} + ~ConnectModelDescriptor() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectModelDescriptor* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectModelDescriptor)); + } +#endif + + template + explicit constexpr ConnectModelDescriptor(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectModelDescriptor(const ConnectModelDescriptor& from) : ConnectModelDescriptor(nullptr, from) {} + inline ConnectModelDescriptor(ConnectModelDescriptor&& from) noexcept : ConnectModelDescriptor(nullptr, ::std::move(from)) {} + inline ConnectModelDescriptor& operator=(const ConnectModelDescriptor& from) { + CopyFrom(from); + return *this; + } + inline ConnectModelDescriptor& operator=(ConnectModelDescriptor&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectModelDescriptor& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectModelDescriptor_globals_); + } + static constexpr int kIndexInFileMessages = 3; + friend void swap(ConnectModelDescriptor& a, ConnectModelDescriptor& b) { a.Swap(&b); } + inline void Swap(ConnectModelDescriptor* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectModelDescriptor* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectModelDescriptor* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectModelDescriptor& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectModelDescriptor& from) { ConnectModelDescriptor::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectModelDescriptor* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectModelDescriptor"; } + + explicit ConnectModelDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectModelDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectModelDescriptor& from); + ConnectModelDescriptor( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectModelDescriptor&& from) noexcept + : ConnectModelDescriptor(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kModelIdFieldNumber = 1, + kDisplayNameFieldNumber = 2, + kFrameworkFieldNumber = 3, + kContextWindowFieldNumber = 4, + kSupportsStreamingFieldNumber = 5, + }; + // string model_id = 1; + void clear_model_id() ; + [[nodiscard]] const ::std::string& model_id() const; + template + void set_model_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_model_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_model_id(); + void set_allocated_model_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_model_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_model_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_model_id(); + + public: + // string display_name = 2; + void clear_display_name() ; + [[nodiscard]] const ::std::string& display_name() const; + template + void set_display_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_display_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_display_name(); + void set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_display_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_display_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_display_name(); + + public: + // string framework = 3; + void clear_framework() ; + [[nodiscard]] const ::std::string& framework() const; + template + void set_framework(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_framework(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_framework(); + void set_allocated_framework(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_framework() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_framework(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_framework(); + + public: + // uint32 context_window = 4; + void clear_context_window() ; + [[nodiscard]] ::uint32_t context_window() const; + void set_context_window(::uint32_t value); + + private: + ::uint32_t _internal_context_window() const; + void _internal_set_context_window(::uint32_t value); + + public: + // bool supports_streaming = 5; + void clear_supports_streaming() ; + [[nodiscard]] bool supports_streaming() const; + void set_supports_streaming(bool value); + + private: + bool _internal_supports_streaming() const; + void _internal_set_supports_streaming(bool value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectModelDescriptor) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<3, 5, + 0, 75, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectModelDescriptor& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr model_id_; + ::google::protobuf::internal::ArenaStringPtr display_name_; + ::google::protobuf::internal::ArenaStringPtr framework_; + ::uint32_t context_window_; + bool supports_streaming_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectInvocationValidation final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectInvocationValidation) */ { + public: + inline ConnectInvocationValidation() : ConnectInvocationValidation(nullptr) {} + ~ConnectInvocationValidation() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectInvocationValidation* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectInvocationValidation)); + } +#endif + + template + explicit constexpr ConnectInvocationValidation(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectInvocationValidation(const ConnectInvocationValidation& from) : ConnectInvocationValidation(nullptr, from) {} + inline ConnectInvocationValidation(ConnectInvocationValidation&& from) noexcept : ConnectInvocationValidation(nullptr, ::std::move(from)) {} + inline ConnectInvocationValidation& operator=(const ConnectInvocationValidation& from) { + CopyFrom(from); + return *this; + } + inline ConnectInvocationValidation& operator=(ConnectInvocationValidation&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectInvocationValidation& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectInvocationValidation_globals_); + } + static constexpr int kIndexInFileMessages = 13; + friend void swap(ConnectInvocationValidation& a, ConnectInvocationValidation& b) { a.Swap(&b); } + inline void Swap(ConnectInvocationValidation* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectInvocationValidation* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectInvocationValidation* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectInvocationValidation& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectInvocationValidation& from) { ConnectInvocationValidation::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectInvocationValidation* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectInvocationValidation"; } + + explicit ConnectInvocationValidation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectInvocationValidation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectInvocationValidation& from); + ConnectInvocationValidation( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectInvocationValidation&& from) noexcept + : ConnectInvocationValidation(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRejectionReasonFieldNumber = 2, + kAcceptedFieldNumber = 1, + }; + // string rejection_reason = 2; + void clear_rejection_reason() ; + [[nodiscard]] const ::std::string& rejection_reason() const; + template + void set_rejection_reason(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_rejection_reason(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_rejection_reason(); + void set_allocated_rejection_reason(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_rejection_reason() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_rejection_reason(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_rejection_reason(); + + public: + // bool accepted = 1; + void clear_accepted() ; + [[nodiscard]] bool accepted() const; + void set_accepted(bool value); + + private: + bool _internal_accepted() const; + void _internal_set_accepted(bool value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectInvocationValidation) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<1, 2, + 0, 67, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectInvocationValidation& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr rejection_reason_; + bool accepted_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHostStopRequest final : public ::google::protobuf::internal::ZeroFieldsBase +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHostStopRequest) */ { + public: + inline ConnectHostStopRequest() : ConnectHostStopRequest(nullptr) {} + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHostStopRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHostStopRequest)); + } +#endif + + template + explicit constexpr ConnectHostStopRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHostStopRequest(const ConnectHostStopRequest& from) : ConnectHostStopRequest(nullptr, from) {} + inline ConnectHostStopRequest(ConnectHostStopRequest&& from) noexcept : ConnectHostStopRequest(nullptr, ::std::move(from)) {} + inline ConnectHostStopRequest& operator=(const ConnectHostStopRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectHostStopRequest& operator=(ConnectHostStopRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHostStopRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHostStopRequest_globals_); + } + static constexpr int kIndexInFileMessages = 5; + friend void swap(ConnectHostStopRequest& a, ConnectHostStopRequest& b) { a.Swap(&b); } + inline void Swap(ConnectHostStopRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHostStopRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHostStopRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::internal::ZeroFieldsBase::DefaultConstruct(arena); + } + using ::google::protobuf::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const ConnectHostStopRequest& from) { ::google::protobuf::internal::ZeroFieldsBase::CopyImpl(*this, from); } + using ::google::protobuf::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const ConnectHostStopRequest& from) { ::google::protobuf::internal::ZeroFieldsBase::MergeImpl(*this, from); } + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHostStopRequest"; } + + explicit ConnectHostStopRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHostStopRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHostStopRequest& from); + ConnectHostStopRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHostStopRequest&& from) noexcept + : ConnectHostStopRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHostStopRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<0, 0, + 0, 0, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHeartbeatResponse final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHeartbeatResponse) */ { + public: + inline ConnectHeartbeatResponse() : ConnectHeartbeatResponse(nullptr) {} + ~ConnectHeartbeatResponse() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHeartbeatResponse* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHeartbeatResponse)); + } +#endif + + template + explicit constexpr ConnectHeartbeatResponse(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHeartbeatResponse(const ConnectHeartbeatResponse& from) : ConnectHeartbeatResponse(nullptr, from) {} + inline ConnectHeartbeatResponse(ConnectHeartbeatResponse&& from) noexcept : ConnectHeartbeatResponse(nullptr, ::std::move(from)) {} + inline ConnectHeartbeatResponse& operator=(const ConnectHeartbeatResponse& from) { + CopyFrom(from); + return *this; + } + inline ConnectHeartbeatResponse& operator=(ConnectHeartbeatResponse&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHeartbeatResponse& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHeartbeatResponse_globals_); + } + static constexpr int kIndexInFileMessages = 16; + friend void swap(ConnectHeartbeatResponse& a, ConnectHeartbeatResponse& b) { a.Swap(&b); } + inline void Swap(ConnectHeartbeatResponse* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHeartbeatResponse* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHeartbeatResponse* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectHeartbeatResponse& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectHeartbeatResponse& from) { ConnectHeartbeatResponse::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectHeartbeatResponse* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHeartbeatResponse"; } + + explicit ConnectHeartbeatResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHeartbeatResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHeartbeatResponse& from); + ConnectHeartbeatResponse( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHeartbeatResponse&& from) noexcept + : ConnectHeartbeatResponse(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSessionIdFieldNumber = 1, + kSequenceFieldNumber = 2, + }; + // string session_id = 1; + void clear_session_id() ; + [[nodiscard]] const ::std::string& session_id() const; + template + void set_session_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_session_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_session_id(); + void set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_session_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_session_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_session_id(); + + public: + // uint64 sequence = 2; + void clear_sequence() ; + [[nodiscard]] ::uint64_t sequence() const; + void set_sequence(::uint64_t value); + + private: + ::uint64_t _internal_sequence() const; + void _internal_set_sequence(::uint64_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHeartbeatResponse) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<1, 2, + 0, 58, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectHeartbeatResponse& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::uint64_t sequence_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHeartbeatRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHeartbeatRequest) */ { + public: + inline ConnectHeartbeatRequest() : ConnectHeartbeatRequest(nullptr) {} + ~ConnectHeartbeatRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHeartbeatRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHeartbeatRequest)); + } +#endif + + template + explicit constexpr ConnectHeartbeatRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHeartbeatRequest(const ConnectHeartbeatRequest& from) : ConnectHeartbeatRequest(nullptr, from) {} + inline ConnectHeartbeatRequest(ConnectHeartbeatRequest&& from) noexcept : ConnectHeartbeatRequest(nullptr, ::std::move(from)) {} + inline ConnectHeartbeatRequest& operator=(const ConnectHeartbeatRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectHeartbeatRequest& operator=(ConnectHeartbeatRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHeartbeatRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHeartbeatRequest_globals_); + } + static constexpr int kIndexInFileMessages = 15; + friend void swap(ConnectHeartbeatRequest& a, ConnectHeartbeatRequest& b) { a.Swap(&b); } + inline void Swap(ConnectHeartbeatRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHeartbeatRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHeartbeatRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectHeartbeatRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectHeartbeatRequest& from) { ConnectHeartbeatRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectHeartbeatRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHeartbeatRequest"; } + + explicit ConnectHeartbeatRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHeartbeatRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHeartbeatRequest& from); + ConnectHeartbeatRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHeartbeatRequest&& from) noexcept + : ConnectHeartbeatRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSessionIdFieldNumber = 1, + kSequenceFieldNumber = 2, + }; + // string session_id = 1; + void clear_session_id() ; + [[nodiscard]] const ::std::string& session_id() const; + template + void set_session_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_session_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_session_id(); + void set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_session_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_session_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_session_id(); + + public: + // uint64 sequence = 2; + void clear_sequence() ; + [[nodiscard]] ::uint64_t sequence() const; + void set_sequence(::uint64_t value); + + private: + ::uint64_t _internal_sequence() const; + void _internal_set_sequence(::uint64_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHeartbeatRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<1, 2, + 0, 57, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectHeartbeatRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::uint64_t sequence_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectDiscoveryMetadata final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectDiscoveryMetadata) */ { + public: + inline ConnectDiscoveryMetadata() : ConnectDiscoveryMetadata(nullptr) {} + ~ConnectDiscoveryMetadata() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectDiscoveryMetadata* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectDiscoveryMetadata)); + } +#endif + + template + explicit constexpr ConnectDiscoveryMetadata(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectDiscoveryMetadata(const ConnectDiscoveryMetadata& from) : ConnectDiscoveryMetadata(nullptr, from) {} + inline ConnectDiscoveryMetadata(ConnectDiscoveryMetadata&& from) noexcept : ConnectDiscoveryMetadata(nullptr, ::std::move(from)) {} + inline ConnectDiscoveryMetadata& operator=(const ConnectDiscoveryMetadata& from) { + CopyFrom(from); + return *this; + } + inline ConnectDiscoveryMetadata& operator=(ConnectDiscoveryMetadata&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectDiscoveryMetadata& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectDiscoveryMetadata_globals_); + } + static constexpr int kIndexInFileMessages = 2; + friend void swap(ConnectDiscoveryMetadata& a, ConnectDiscoveryMetadata& b) { a.Swap(&b); } + inline void Swap(ConnectDiscoveryMetadata* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectDiscoveryMetadata* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectDiscoveryMetadata* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectDiscoveryMetadata& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectDiscoveryMetadata& from) { ConnectDiscoveryMetadata::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectDiscoveryMetadata* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectDiscoveryMetadata"; } + + explicit ConnectDiscoveryMetadata(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectDiscoveryMetadata(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectDiscoveryMetadata& from); + ConnectDiscoveryMetadata( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectDiscoveryMetadata&& from) noexcept + : ConnectDiscoveryMetadata(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kInstanceIdFieldNumber = 1, + kDisplayNameFieldNumber = 2, + kPlatformFieldNumber = 3, + kProtocolVersionFieldNumber = 4, + }; + // string instance_id = 1; + void clear_instance_id() ; + [[nodiscard]] const ::std::string& instance_id() const; + template + void set_instance_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_instance_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_instance_id(); + void set_allocated_instance_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_instance_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_instance_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_instance_id(); + + public: + // string display_name = 2; + void clear_display_name() ; + [[nodiscard]] const ::std::string& display_name() const; + template + void set_display_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_display_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_display_name(); + void set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_display_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_display_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_display_name(); + + public: + // .runanywhere.v1.ConnectPlatform platform = 3; + void clear_platform() ; + [[nodiscard]] ::runanywhere::v1::ConnectPlatform platform() const; + void set_platform(::runanywhere::v1::ConnectPlatform value); + + private: + ::runanywhere::v1::ConnectPlatform _internal_platform() const; + void _internal_set_platform(::runanywhere::v1::ConnectPlatform value); + + public: + // uint32 protocol_version = 4; + void clear_protocol_version() ; + [[nodiscard]] ::uint32_t protocol_version() const; + void set_protocol_version(::uint32_t value); + + private: + ::uint32_t _internal_protocol_version() const; + void _internal_set_protocol_version(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectDiscoveryMetadata) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<2, 4, + 0, 71, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectDiscoveryMetadata& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr instance_id_; + ::google::protobuf::internal::ArenaStringPtr display_name_; + int platform_; + ::uint32_t protocol_version_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectClientStartRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectClientStartRequest) */ { + public: + inline ConnectClientStartRequest() : ConnectClientStartRequest(nullptr) {} + ~ConnectClientStartRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectClientStartRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectClientStartRequest)); + } +#endif + + template + explicit constexpr ConnectClientStartRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectClientStartRequest(const ConnectClientStartRequest& from) : ConnectClientStartRequest(nullptr, from) {} + inline ConnectClientStartRequest(ConnectClientStartRequest&& from) noexcept : ConnectClientStartRequest(nullptr, ::std::move(from)) {} + inline ConnectClientStartRequest& operator=(const ConnectClientStartRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectClientStartRequest& operator=(ConnectClientStartRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectClientStartRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectClientStartRequest_globals_); + } + static constexpr int kIndexInFileMessages = 7; + friend void swap(ConnectClientStartRequest& a, ConnectClientStartRequest& b) { a.Swap(&b); } + inline void Swap(ConnectClientStartRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectClientStartRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectClientStartRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectClientStartRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectClientStartRequest& from) { ConnectClientStartRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectClientStartRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectClientStartRequest"; } + + explicit ConnectClientStartRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectClientStartRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectClientStartRequest& from); + ConnectClientStartRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectClientStartRequest&& from) noexcept + : ConnectClientStartRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kDisplayNameFieldNumber = 1, + kPlatformFieldNumber = 2, + kProtocolVersionFieldNumber = 3, + }; + // string display_name = 1; + void clear_display_name() ; + [[nodiscard]] const ::std::string& display_name() const; + template + void set_display_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_display_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_display_name(); + void set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_display_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_display_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_display_name(); + + public: + // .runanywhere.v1.ConnectPlatform platform = 2; + void clear_platform() ; + [[nodiscard]] ::runanywhere::v1::ConnectPlatform platform() const; + void set_platform(::runanywhere::v1::ConnectPlatform value); + + private: + ::runanywhere::v1::ConnectPlatform _internal_platform() const; + void _internal_set_platform(::runanywhere::v1::ConnectPlatform value); + + public: + // uint32 protocol_version = 3; + void clear_protocol_version() ; + [[nodiscard]] ::uint32_t protocol_version() const; + void set_protocol_version(::uint32_t value); + + private: + ::uint32_t _internal_protocol_version() const; + void _internal_set_protocol_version(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectClientStartRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<2, 3, + 0, 61, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectClientStartRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr display_name_; + int platform_; + ::uint32_t protocol_version_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectClientHello final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectClientHello) */ { + public: + inline ConnectClientHello() : ConnectClientHello(nullptr) {} + ~ConnectClientHello() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectClientHello* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectClientHello)); + } +#endif + + template + explicit constexpr ConnectClientHello(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectClientHello(const ConnectClientHello& from) : ConnectClientHello(nullptr, from) {} + inline ConnectClientHello(ConnectClientHello&& from) noexcept : ConnectClientHello(nullptr, ::std::move(from)) {} + inline ConnectClientHello& operator=(const ConnectClientHello& from) { + CopyFrom(from); + return *this; + } + inline ConnectClientHello& operator=(ConnectClientHello&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectClientHello& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectClientHello_globals_); + } + static constexpr int kIndexInFileMessages = 8; + friend void swap(ConnectClientHello& a, ConnectClientHello& b) { a.Swap(&b); } + inline void Swap(ConnectClientHello* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectClientHello* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectClientHello* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectClientHello& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectClientHello& from) { ConnectClientHello::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectClientHello* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectClientHello"; } + + explicit ConnectClientHello(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectClientHello(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectClientHello& from); + ConnectClientHello( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectClientHello&& from) noexcept + : ConnectClientHello(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kInstanceIdFieldNumber = 1, + kDisplayNameFieldNumber = 2, + kPlatformFieldNumber = 3, + kProtocolVersionFieldNumber = 4, + }; + // string instance_id = 1; + void clear_instance_id() ; + [[nodiscard]] const ::std::string& instance_id() const; + template + void set_instance_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_instance_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_instance_id(); + void set_allocated_instance_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_instance_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_instance_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_instance_id(); + + public: + // string display_name = 2; + void clear_display_name() ; + [[nodiscard]] const ::std::string& display_name() const; + template + void set_display_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_display_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_display_name(); + void set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_display_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_display_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_display_name(); + + public: + // .runanywhere.v1.ConnectPlatform platform = 3; + void clear_platform() ; + [[nodiscard]] ::runanywhere::v1::ConnectPlatform platform() const; + void set_platform(::runanywhere::v1::ConnectPlatform value); + + private: + ::runanywhere::v1::ConnectPlatform _internal_platform() const; + void _internal_set_platform(::runanywhere::v1::ConnectPlatform value); + + public: + // uint32 protocol_version = 4; + void clear_protocol_version() ; + [[nodiscard]] ::uint32_t protocol_version() const; + void set_protocol_version(::uint32_t value); + + private: + ::uint32_t _internal_protocol_version() const; + void _internal_set_protocol_version(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectClientHello) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<2, 4, + 0, 65, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectClientHello& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr instance_id_; + ::google::protobuf::internal::ArenaStringPtr display_name_; + int platform_; + ::uint32_t protocol_version_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHostState final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHostState) */ { + public: + inline ConnectHostState() : ConnectHostState(nullptr) {} + ~ConnectHostState() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHostState* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHostState)); + } +#endif + + template + explicit constexpr ConnectHostState(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHostState(const ConnectHostState& from) : ConnectHostState(nullptr, from) {} + inline ConnectHostState(ConnectHostState&& from) noexcept : ConnectHostState(nullptr, ::std::move(from)) {} + inline ConnectHostState& operator=(const ConnectHostState& from) { + CopyFrom(from); + return *this; + } + inline ConnectHostState& operator=(ConnectHostState&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHostState& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHostState_globals_); + } + static constexpr int kIndexInFileMessages = 6; + friend void swap(ConnectHostState& a, ConnectHostState& b) { a.Swap(&b); } + inline void Swap(ConnectHostState* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHostState* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHostState* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectHostState& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectHostState& from) { ConnectHostState::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectHostState* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHostState"; } + + explicit ConnectHostState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHostState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHostState& from); + ConnectHostState( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHostState&& from) noexcept + : ConnectHostState(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kErrorMessageFieldNumber = 4, + kDiscoveryMetadataFieldNumber = 2, + kModelFieldNumber = 5, + kIsHostingFieldNumber = 1, + kActiveClientCountFieldNumber = 3, + }; + // string error_message = 4; + void clear_error_message() ; + [[nodiscard]] const ::std::string& error_message() const; + template + void set_error_message(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_error_message(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error_message(); + void set_allocated_error_message(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_error_message() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_error_message(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_error_message(); + + public: + // .runanywhere.v1.ConnectDiscoveryMetadata discovery_metadata = 2; + [[nodiscard]] bool has_discovery_metadata() + const; + void clear_discovery_metadata() ; + [[nodiscard]] const ::runanywhere::v1::ConnectDiscoveryMetadata& discovery_metadata() const; + [[nodiscard]] ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE release_discovery_metadata(); + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL mutable_discovery_metadata(); + void set_allocated_discovery_metadata(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_discovery_metadata(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE unsafe_arena_release_discovery_metadata(); + + private: + const ::runanywhere::v1::ConnectDiscoveryMetadata& _internal_discovery_metadata() const; + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL _internal_mutable_discovery_metadata(); + + public: + // .runanywhere.v1.ConnectModelDescriptor model = 5; + [[nodiscard]] bool has_model() + const; + void clear_model() ; + [[nodiscard]] const ::runanywhere::v1::ConnectModelDescriptor& model() const; + [[nodiscard]] ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE release_model(); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL mutable_model(); + void set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE unsafe_arena_release_model(); + + private: + const ::runanywhere::v1::ConnectModelDescriptor& _internal_model() const; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL _internal_mutable_model(); + + public: + // bool is_hosting = 1; + void clear_is_hosting() ; + [[nodiscard]] bool is_hosting() const; + void set_is_hosting(bool value); + + private: + bool _internal_is_hosting() const; + void _internal_set_is_hosting(bool value); + + public: + // uint32 active_client_count = 3; + void clear_active_client_count() ; + [[nodiscard]] ::uint32_t active_client_count() const; + void set_active_client_count(::uint32_t value); + + private: + ::uint32_t _internal_active_client_count() const; + void _internal_set_active_client_count(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHostState) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<3, 5, + 2, 53, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectHostState& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE discovery_metadata_; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE model_; + bool is_hosting_; + ::uint32_t active_client_count_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHostStartRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHostStartRequest) */ { + public: + inline ConnectHostStartRequest() : ConnectHostStartRequest(nullptr) {} + ~ConnectHostStartRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHostStartRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHostStartRequest)); + } +#endif + + template + explicit constexpr ConnectHostStartRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHostStartRequest(const ConnectHostStartRequest& from) : ConnectHostStartRequest(nullptr, from) {} + inline ConnectHostStartRequest(ConnectHostStartRequest&& from) noexcept : ConnectHostStartRequest(nullptr, ::std::move(from)) {} + inline ConnectHostStartRequest& operator=(const ConnectHostStartRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectHostStartRequest& operator=(ConnectHostStartRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHostStartRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHostStartRequest_globals_); + } + static constexpr int kIndexInFileMessages = 4; + friend void swap(ConnectHostStartRequest& a, ConnectHostStartRequest& b) { a.Swap(&b); } + inline void Swap(ConnectHostStartRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHostStartRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHostStartRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectHostStartRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectHostStartRequest& from) { ConnectHostStartRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectHostStartRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHostStartRequest"; } + + explicit ConnectHostStartRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHostStartRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHostStartRequest& from); + ConnectHostStartRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHostStartRequest&& from) noexcept + : ConnectHostStartRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kDisplayNameFieldNumber = 1, + kModelFieldNumber = 4, + kPlatformFieldNumber = 2, + kProtocolVersionFieldNumber = 3, + }; + // string display_name = 1; + void clear_display_name() ; + [[nodiscard]] const ::std::string& display_name() const; + template + void set_display_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_display_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_display_name(); + void set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_display_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_display_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_display_name(); + + public: + // .runanywhere.v1.ConnectModelDescriptor model = 4; + [[nodiscard]] bool has_model() + const; + void clear_model() ; + [[nodiscard]] const ::runanywhere::v1::ConnectModelDescriptor& model() const; + [[nodiscard]] ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE release_model(); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL mutable_model(); + void set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE unsafe_arena_release_model(); + + private: + const ::runanywhere::v1::ConnectModelDescriptor& _internal_model() const; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL _internal_mutable_model(); + + public: + // .runanywhere.v1.ConnectPlatform platform = 2; + void clear_platform() ; + [[nodiscard]] ::runanywhere::v1::ConnectPlatform platform() const; + void set_platform(::runanywhere::v1::ConnectPlatform value); + + private: + ::runanywhere::v1::ConnectPlatform _internal_platform() const; + void _internal_set_platform(::runanywhere::v1::ConnectPlatform value); + + public: + // uint32 protocol_version = 3; + void clear_protocol_version() ; + [[nodiscard]] ::uint32_t protocol_version() const; + void set_protocol_version(::uint32_t value); + + private: + ::uint32_t _internal_protocol_version() const; + void _internal_set_protocol_version(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHostStartRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<2, 4, + 1, 59, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectHostStartRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr display_name_; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE model_; + int platform_; + ::uint32_t protocol_version_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHandshakeResponse final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHandshakeResponse) */ { + public: + inline ConnectHandshakeResponse() : ConnectHandshakeResponse(nullptr) {} + ~ConnectHandshakeResponse() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHandshakeResponse* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHandshakeResponse)); + } +#endif + + template + explicit constexpr ConnectHandshakeResponse(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHandshakeResponse(const ConnectHandshakeResponse& from) : ConnectHandshakeResponse(nullptr, from) {} + inline ConnectHandshakeResponse(ConnectHandshakeResponse&& from) noexcept : ConnectHandshakeResponse(nullptr, ::std::move(from)) {} + inline ConnectHandshakeResponse& operator=(const ConnectHandshakeResponse& from) { + CopyFrom(from); + return *this; + } + inline ConnectHandshakeResponse& operator=(ConnectHandshakeResponse&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHandshakeResponse& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHandshakeResponse_globals_); + } + static constexpr int kIndexInFileMessages = 9; + friend void swap(ConnectHandshakeResponse& a, ConnectHandshakeResponse& b) { a.Swap(&b); } + inline void Swap(ConnectHandshakeResponse* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHandshakeResponse* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHandshakeResponse* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectHandshakeResponse& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectHandshakeResponse& from) { ConnectHandshakeResponse::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectHandshakeResponse* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHandshakeResponse"; } + + explicit ConnectHandshakeResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHandshakeResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHandshakeResponse& from); + ConnectHandshakeResponse( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHandshakeResponse&& from) noexcept + : ConnectHandshakeResponse(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSessionIdFieldNumber = 2, + kRejectionReasonFieldNumber = 4, + kHostFieldNumber = 3, + kModelFieldNumber = 5, + kStatusFieldNumber = 1, + }; + // string session_id = 2; + void clear_session_id() ; + [[nodiscard]] const ::std::string& session_id() const; + template + void set_session_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_session_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_session_id(); + void set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_session_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_session_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_session_id(); + + public: + // string rejection_reason = 4; + void clear_rejection_reason() ; + [[nodiscard]] const ::std::string& rejection_reason() const; + template + void set_rejection_reason(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_rejection_reason(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_rejection_reason(); + void set_allocated_rejection_reason(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_rejection_reason() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_rejection_reason(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_rejection_reason(); + + public: + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + [[nodiscard]] bool has_host() + const; + void clear_host() ; + [[nodiscard]] const ::runanywhere::v1::ConnectDiscoveryMetadata& host() const; + [[nodiscard]] ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE release_host(); + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL mutable_host(); + void set_allocated_host(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_host(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE unsafe_arena_release_host(); + + private: + const ::runanywhere::v1::ConnectDiscoveryMetadata& _internal_host() const; + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL _internal_mutable_host(); + + public: + // .runanywhere.v1.ConnectModelDescriptor model = 5; + [[nodiscard]] bool has_model() + const; + void clear_model() ; + [[nodiscard]] const ::runanywhere::v1::ConnectModelDescriptor& model() const; + [[nodiscard]] ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE release_model(); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL mutable_model(); + void set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE unsafe_arena_release_model(); + + private: + const ::runanywhere::v1::ConnectModelDescriptor& _internal_model() const; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL _internal_mutable_model(); + + public: + // .runanywhere.v1.ConnectHandshakeStatus status = 1; + void clear_status() ; + [[nodiscard]] ::runanywhere::v1::ConnectHandshakeStatus status() const; + void set_status(::runanywhere::v1::ConnectHandshakeStatus value); + + private: + ::runanywhere::v1::ConnectHandshakeStatus _internal_status() const; + void _internal_set_status(::runanywhere::v1::ConnectHandshakeStatus value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHandshakeResponse) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<3, 5, + 2, 74, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectHandshakeResponse& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::google::protobuf::internal::ArenaStringPtr rejection_reason_; + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE host_; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE model_; + int status_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectClientSessionState final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectClientSessionState) */ { + public: + inline ConnectClientSessionState() : ConnectClientSessionState(nullptr) {} + ~ConnectClientSessionState() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectClientSessionState* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectClientSessionState)); + } +#endif + + template + explicit constexpr ConnectClientSessionState(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectClientSessionState(const ConnectClientSessionState& from) : ConnectClientSessionState(nullptr, from) {} + inline ConnectClientSessionState(ConnectClientSessionState&& from) noexcept : ConnectClientSessionState(nullptr, ::std::move(from)) {} + inline ConnectClientSessionState& operator=(const ConnectClientSessionState& from) { + CopyFrom(from); + return *this; + } + inline ConnectClientSessionState& operator=(ConnectClientSessionState&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectClientSessionState& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectClientSessionState_globals_); + } + static constexpr int kIndexInFileMessages = 10; + friend void swap(ConnectClientSessionState& a, ConnectClientSessionState& b) { a.Swap(&b); } + inline void Swap(ConnectClientSessionState* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectClientSessionState* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectClientSessionState* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectClientSessionState& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectClientSessionState& from) { ConnectClientSessionState::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectClientSessionState* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectClientSessionState"; } + + explicit ConnectClientSessionState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectClientSessionState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectClientSessionState& from); + ConnectClientSessionState( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectClientSessionState&& from) noexcept + : ConnectClientSessionState(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSessionIdFieldNumber = 2, + kErrorMessageFieldNumber = 4, + kHostFieldNumber = 3, + kModelFieldNumber = 5, + kStateFieldNumber = 1, + }; + // string session_id = 2; + void clear_session_id() ; + [[nodiscard]] const ::std::string& session_id() const; + template + void set_session_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_session_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_session_id(); + void set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_session_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_session_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_session_id(); + + public: + // string error_message = 4; + void clear_error_message() ; + [[nodiscard]] const ::std::string& error_message() const; + template + void set_error_message(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_error_message(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error_message(); + void set_allocated_error_message(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_error_message() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_error_message(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_error_message(); + + public: + // .runanywhere.v1.ConnectDiscoveryMetadata host = 3; + [[nodiscard]] bool has_host() + const; + void clear_host() ; + [[nodiscard]] const ::runanywhere::v1::ConnectDiscoveryMetadata& host() const; + [[nodiscard]] ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE release_host(); + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL mutable_host(); + void set_allocated_host(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_host(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE unsafe_arena_release_host(); + + private: + const ::runanywhere::v1::ConnectDiscoveryMetadata& _internal_host() const; + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL _internal_mutable_host(); + + public: + // .runanywhere.v1.ConnectModelDescriptor model = 5; + [[nodiscard]] bool has_model() + const; + void clear_model() ; + [[nodiscard]] const ::runanywhere::v1::ConnectModelDescriptor& model() const; + [[nodiscard]] ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE release_model(); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL mutable_model(); + void set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE unsafe_arena_release_model(); + + private: + const ::runanywhere::v1::ConnectModelDescriptor& _internal_model() const; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL _internal_mutable_model(); + + public: + // .runanywhere.v1.ConnectSessionState state = 1; + void clear_state() ; + [[nodiscard]] ::runanywhere::v1::ConnectSessionState state() const; + void set_state(::runanywhere::v1::ConnectSessionState value); + + private: + ::runanywhere::v1::ConnectSessionState _internal_state() const; + void _internal_set_state(::runanywhere::v1::ConnectSessionState value); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectClientSessionState) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<3, 5, + 2, 72, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectClientSessionState& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE host_; + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE model_; + int state_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectInvocationEvent final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectInvocationEvent) */ { + public: + inline ConnectInvocationEvent() : ConnectInvocationEvent(nullptr) {} + ~ConnectInvocationEvent() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectInvocationEvent* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectInvocationEvent)); + } +#endif + + template + explicit constexpr ConnectInvocationEvent(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectInvocationEvent(const ConnectInvocationEvent& from) : ConnectInvocationEvent(nullptr, from) {} + inline ConnectInvocationEvent(ConnectInvocationEvent&& from) noexcept : ConnectInvocationEvent(nullptr, ::std::move(from)) {} + inline ConnectInvocationEvent& operator=(const ConnectInvocationEvent& from) { + CopyFrom(from); + return *this; + } + inline ConnectInvocationEvent& operator=(ConnectInvocationEvent&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectInvocationEvent& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectInvocationEvent_globals_); + } + static constexpr int kIndexInFileMessages = 14; + friend void swap(ConnectInvocationEvent& a, ConnectInvocationEvent& b) { a.Swap(&b); } + inline void Swap(ConnectInvocationEvent* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectInvocationEvent* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectInvocationEvent* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectInvocationEvent& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectInvocationEvent& from) { ConnectInvocationEvent::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectInvocationEvent* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectInvocationEvent"; } + + explicit ConnectInvocationEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectInvocationEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectInvocationEvent& from); + ConnectInvocationEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectInvocationEvent&& from) noexcept + : ConnectInvocationEvent(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRequestIdFieldNumber = 1, + kEventFieldNumber = 2, + }; + // string request_id = 1; + void clear_request_id() ; + [[nodiscard]] const ::std::string& request_id() const; + template + void set_request_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_request_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_request_id(); + void set_allocated_request_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_request_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_request_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_request_id(); + + public: + // .runanywhere.v1.LLMStreamEvent event = 2; + [[nodiscard]] bool has_event() + const; + void clear_event() ; + [[nodiscard]] const ::runanywhere::v1::LLMStreamEvent& event() const; + [[nodiscard]] ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE release_event(); + ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NONNULL mutable_event(); + void set_allocated_event(::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_event(::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE value); + ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE unsafe_arena_release_event(); + + private: + const ::runanywhere::v1::LLMStreamEvent& _internal_event() const; + ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NONNULL _internal_mutable_event(); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectInvocationEvent) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<1, 2, + 1, 56, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectInvocationEvent& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr request_id_; + ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE event_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectHostFrame final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectHostFrame) */ { + public: + inline ConnectHostFrame() : ConnectHostFrame(nullptr) {} + ~ConnectHostFrame() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectHostFrame* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectHostFrame)); + } +#endif + + template + explicit constexpr ConnectHostFrame(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectHostFrame(const ConnectHostFrame& from) : ConnectHostFrame(nullptr, from) {} + inline ConnectHostFrame(ConnectHostFrame&& from) noexcept : ConnectHostFrame(nullptr, ::std::move(from)) {} + inline ConnectHostFrame& operator=(const ConnectHostFrame& from) { + CopyFrom(from); + return *this; + } + inline ConnectHostFrame& operator=(ConnectHostFrame&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectHostFrame& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectHostFrame_globals_); + } + enum PayloadCase { + kInvocationEvent = 1, + kHeartbeat = 2, + PAYLOAD_NOT_SET = 0, + }; + static constexpr int kIndexInFileMessages = 18; + friend void swap(ConnectHostFrame& a, ConnectHostFrame& b) { a.Swap(&b); } + inline void Swap(ConnectHostFrame* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectHostFrame* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectHostFrame* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectHostFrame& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectHostFrame& from) { ConnectHostFrame::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectHostFrame* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectHostFrame"; } + + explicit ConnectHostFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectHostFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectHostFrame& from); + ConnectHostFrame( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectHostFrame&& from) noexcept + : ConnectHostFrame(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kInvocationEventFieldNumber = 1, + kHeartbeatFieldNumber = 2, + }; + // .runanywhere.v1.ConnectInvocationEvent invocation_event = 1; + [[nodiscard]] bool has_invocation_event() + const; + private: + bool _internal_has_invocation_event() const; + + public: + void clear_invocation_event() ; + [[nodiscard]] const ::runanywhere::v1::ConnectInvocationEvent& invocation_event() const; + [[nodiscard]] ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE release_invocation_event(); + ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NONNULL mutable_invocation_event(); + void set_allocated_invocation_event(::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_invocation_event(::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE unsafe_arena_release_invocation_event(); + + private: + const ::runanywhere::v1::ConnectInvocationEvent& _internal_invocation_event() const; + ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NONNULL _internal_mutable_invocation_event(); + + public: + // .runanywhere.v1.ConnectHeartbeatResponse heartbeat = 2; + [[nodiscard]] bool has_heartbeat() + const; + private: + bool _internal_has_heartbeat() const; + + public: + void clear_heartbeat() ; + [[nodiscard]] const ::runanywhere::v1::ConnectHeartbeatResponse& heartbeat() const; + [[nodiscard]] ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE release_heartbeat(); + ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NONNULL mutable_heartbeat(); + void set_allocated_heartbeat(::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_heartbeat(::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE unsafe_arena_release_heartbeat(); + + private: + const ::runanywhere::v1::ConnectHeartbeatResponse& _internal_heartbeat() const; + ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NONNULL _internal_mutable_heartbeat(); + + public: + void clear_payload(); + PayloadCase payload_case() const; + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectHostFrame) + private: + class _Internal; + void set_has_invocation_event(); + void set_has_heartbeat(); + [[nodiscard]] inline bool has_payload() const; + inline void clear_has_payload(); + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<0, 2, + 2, 0, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectHostFrame& from_msg); + union PayloadUnion { + constexpr PayloadUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE invocation_event_; + ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE heartbeat_; + } payload_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectInvocationRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectInvocationRequest) */ { + public: + inline ConnectInvocationRequest() : ConnectInvocationRequest(nullptr) {} + ~ConnectInvocationRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectInvocationRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectInvocationRequest)); + } +#endif + + template + explicit constexpr ConnectInvocationRequest(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectInvocationRequest(const ConnectInvocationRequest& from) : ConnectInvocationRequest(nullptr, from) {} + inline ConnectInvocationRequest(ConnectInvocationRequest&& from) noexcept : ConnectInvocationRequest(nullptr, ::std::move(from)) {} + inline ConnectInvocationRequest& operator=(const ConnectInvocationRequest& from) { + CopyFrom(from); + return *this; + } + inline ConnectInvocationRequest& operator=(ConnectInvocationRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectInvocationRequest& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectInvocationRequest_globals_); + } + static constexpr int kIndexInFileMessages = 12; + friend void swap(ConnectInvocationRequest& a, ConnectInvocationRequest& b) { a.Swap(&b); } + inline void Swap(ConnectInvocationRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectInvocationRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectInvocationRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectInvocationRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectInvocationRequest& from) { ConnectInvocationRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectInvocationRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectInvocationRequest"; } + + explicit ConnectInvocationRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectInvocationRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectInvocationRequest& from); + ConnectInvocationRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectInvocationRequest&& from) noexcept + : ConnectInvocationRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSessionIdFieldNumber = 1, + kRequestIdFieldNumber = 2, + kGenerationFieldNumber = 3, + }; + // string session_id = 1; + void clear_session_id() ; + [[nodiscard]] const ::std::string& session_id() const; + template + void set_session_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_session_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_session_id(); + void set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_session_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_session_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_session_id(); + + public: + // string request_id = 2; + void clear_request_id() ; + [[nodiscard]] const ::std::string& request_id() const; + template + void set_request_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_request_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_request_id(); + void set_allocated_request_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_request_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_request_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_request_id(); + + public: + // .runanywhere.v1.LLMGenerateRequest generation = 3; + [[nodiscard]] bool has_generation() + const; + void clear_generation() ; + [[nodiscard]] const ::runanywhere::v1::LLMGenerateRequest& generation() const; + [[nodiscard]] ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE release_generation(); + ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NONNULL mutable_generation(); + void set_allocated_generation(::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_generation(::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE value); + ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE unsafe_arena_release_generation(); + + private: + const ::runanywhere::v1::LLMGenerateRequest& _internal_generation() const; + ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NONNULL _internal_mutable_generation(); + + public: + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectInvocationRequest) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<2, 3, + 1, 68, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectInvocationRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::google::protobuf::internal::ArenaStringPtr request_id_; + ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE generation_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ConnectClientFrame final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:runanywhere.v1.ConnectClientFrame) */ { + public: + inline ConnectClientFrame() : ConnectClientFrame(nullptr) {} + ~ConnectClientFrame() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ConnectClientFrame* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ConnectClientFrame)); + } +#endif + + template + explicit constexpr ConnectClientFrame(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline ConnectClientFrame(const ConnectClientFrame& from) : ConnectClientFrame(nullptr, from) {} + inline ConnectClientFrame(ConnectClientFrame&& from) noexcept : ConnectClientFrame(nullptr, ::std::move(from)) {} + inline ConnectClientFrame& operator=(const ConnectClientFrame& from) { + CopyFrom(from); + return *this; + } + inline ConnectClientFrame& operator=(ConnectClientFrame&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const ConnectClientFrame& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&ConnectClientFrame_globals_); + } + enum PayloadCase { + kInvocation = 1, + kHeartbeat = 2, + PAYLOAD_NOT_SET = 0, + }; + static constexpr int kIndexInFileMessages = 17; + friend void swap(ConnectClientFrame& a, ConnectClientFrame& b) { a.Swap(&b); } + inline void Swap(ConnectClientFrame* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConnectClientFrame* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] ConnectClientFrame* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ConnectClientFrame& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ConnectClientFrame& from) { ConnectClientFrame::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ConnectClientFrame* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "runanywhere.v1.ConnectClientFrame"; } + + explicit ConnectClientFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ConnectClientFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ConnectClientFrame& from); + ConnectClientFrame( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ConnectClientFrame&& from) noexcept + : ConnectClientFrame(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kInvocationFieldNumber = 1, + kHeartbeatFieldNumber = 2, + }; + // .runanywhere.v1.ConnectInvocationRequest invocation = 1; + [[nodiscard]] bool has_invocation() + const; + private: + bool _internal_has_invocation() const; + + public: + void clear_invocation() ; + [[nodiscard]] const ::runanywhere::v1::ConnectInvocationRequest& invocation() const; + [[nodiscard]] ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE release_invocation(); + ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NONNULL mutable_invocation(); + void set_allocated_invocation(::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_invocation(::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE unsafe_arena_release_invocation(); + + private: + const ::runanywhere::v1::ConnectInvocationRequest& _internal_invocation() const; + ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NONNULL _internal_mutable_invocation(); + + public: + // .runanywhere.v1.ConnectHeartbeatRequest heartbeat = 2; + [[nodiscard]] bool has_heartbeat() + const; + private: + bool _internal_has_heartbeat() const; + + public: + void clear_heartbeat() ; + [[nodiscard]] const ::runanywhere::v1::ConnectHeartbeatRequest& heartbeat() const; + [[nodiscard]] ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE release_heartbeat(); + ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NONNULL mutable_heartbeat(); + void set_allocated_heartbeat(::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_heartbeat(::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE value); + ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE unsafe_arena_release_heartbeat(); + + private: + const ::runanywhere::v1::ConnectHeartbeatRequest& _internal_heartbeat() const; + ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NONNULL _internal_mutable_heartbeat(); + + public: + void clear_payload(); + PayloadCase payload_case() const; + // @@protoc_insertion_point(class_scope:runanywhere.v1.ConnectClientFrame) + private: + class _Internal; + void set_has_invocation(); + void set_has_heartbeat(); + [[nodiscard]] inline bool has_payload() const; + inline void clear_has_payload(); + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<0, 2, + 2, 0, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ConnectClientFrame& from_msg); + union PayloadUnion { + constexpr PayloadUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE invocation_; + ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE heartbeat_; + } payload_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_connect_2eproto; +}; + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ConnectPlatformPolicyRequest + +// .runanywhere.v1.ConnectPlatform platform = 1; +inline void ConnectPlatformPolicyRequest::clear_platform() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline ::runanywhere::v1::ConnectPlatform ConnectPlatformPolicyRequest::platform() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectPlatformPolicyRequest.platform) + return _internal_platform(); +} +inline void ConnectPlatformPolicyRequest::set_platform(::runanywhere::v1::ConnectPlatform value) { + _internal_set_platform(value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectPlatformPolicyRequest.platform) +} +inline ::runanywhere::v1::ConnectPlatform ConnectPlatformPolicyRequest::_internal_platform() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectPlatform>(_impl_.platform_); +} +inline void ConnectPlatformPolicyRequest::_internal_set_platform(::runanywhere::v1::ConnectPlatform value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectPlatformPolicy + +// .runanywhere.v1.ConnectPlatform platform = 1; +inline void ConnectPlatformPolicy::clear_platform() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline ::runanywhere::v1::ConnectPlatform ConnectPlatformPolicy::platform() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectPlatformPolicy.platform) + return _internal_platform(); +} +inline void ConnectPlatformPolicy::set_platform(::runanywhere::v1::ConnectPlatform value) { + _internal_set_platform(value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectPlatformPolicy.platform) +} +inline ::runanywhere::v1::ConnectPlatform ConnectPlatformPolicy::_internal_platform() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectPlatform>(_impl_.platform_); +} +inline void ConnectPlatformPolicy::_internal_set_platform(::runanywhere::v1::ConnectPlatform value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = value; +} + +// .runanywhere.v1.ConnectRoleAvailability host_role = 2; +inline void ConnectPlatformPolicy::clear_host_role() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.host_role_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline ::runanywhere::v1::ConnectRoleAvailability ConnectPlatformPolicy::host_role() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectPlatformPolicy.host_role) + return _internal_host_role(); +} +inline void ConnectPlatformPolicy::set_host_role(::runanywhere::v1::ConnectRoleAvailability value) { + _internal_set_host_role(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectPlatformPolicy.host_role) +} +inline ::runanywhere::v1::ConnectRoleAvailability ConnectPlatformPolicy::_internal_host_role() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectRoleAvailability>(_impl_.host_role_); +} +inline void ConnectPlatformPolicy::_internal_set_host_role(::runanywhere::v1::ConnectRoleAvailability value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.host_role_ = value; +} + +// .runanywhere.v1.ConnectRoleAvailability client_role = 3; +inline void ConnectPlatformPolicy::clear_client_role() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.client_role_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline ::runanywhere::v1::ConnectRoleAvailability ConnectPlatformPolicy::client_role() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectPlatformPolicy.client_role) + return _internal_client_role(); +} +inline void ConnectPlatformPolicy::set_client_role(::runanywhere::v1::ConnectRoleAvailability value) { + _internal_set_client_role(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectPlatformPolicy.client_role) +} +inline ::runanywhere::v1::ConnectRoleAvailability ConnectPlatformPolicy::_internal_client_role() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectRoleAvailability>(_impl_.client_role_); +} +inline void ConnectPlatformPolicy::_internal_set_client_role(::runanywhere::v1::ConnectRoleAvailability value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.client_role_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectDiscoveryMetadata + +// string instance_id = 1; +inline void ConnectDiscoveryMetadata::clear_instance_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.instance_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectDiscoveryMetadata::instance_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectDiscoveryMetadata.instance_id) + return _internal_instance_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectDiscoveryMetadata::set_instance_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.instance_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectDiscoveryMetadata.instance_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectDiscoveryMetadata::mutable_instance_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_instance_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectDiscoveryMetadata.instance_id) + return _s; +} +inline const ::std::string& ConnectDiscoveryMetadata::_internal_instance_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.instance_id_.Get(); +} +inline void ConnectDiscoveryMetadata::_internal_set_instance_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.instance_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectDiscoveryMetadata::_internal_mutable_instance_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.instance_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectDiscoveryMetadata::release_instance_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectDiscoveryMetadata.instance_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.instance_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.instance_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectDiscoveryMetadata::set_allocated_instance_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.instance_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.instance_id_.IsDefault()) { + _impl_.instance_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectDiscoveryMetadata.instance_id) +} + +// string display_name = 2; +inline void ConnectDiscoveryMetadata::clear_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& ConnectDiscoveryMetadata::display_name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectDiscoveryMetadata.display_name) + return _internal_display_name(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectDiscoveryMetadata::set_display_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.display_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectDiscoveryMetadata.display_name) +} +inline ::std::string* PROTOBUF_NONNULL ConnectDiscoveryMetadata::mutable_display_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_display_name(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectDiscoveryMetadata.display_name) + return _s; +} +inline const ::std::string& ConnectDiscoveryMetadata::_internal_display_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.display_name_.Get(); +} +inline void ConnectDiscoveryMetadata::_internal_set_display_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectDiscoveryMetadata::_internal_mutable_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.display_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectDiscoveryMetadata::release_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectDiscoveryMetadata.display_name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.display_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.display_name_.Set("", GetArena()); + } + return released; +} +inline void ConnectDiscoveryMetadata::set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.display_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.display_name_.IsDefault()) { + _impl_.display_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectDiscoveryMetadata.display_name) +} + +// .runanywhere.v1.ConnectPlatform platform = 3; +inline void ConnectDiscoveryMetadata::clear_platform() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline ::runanywhere::v1::ConnectPlatform ConnectDiscoveryMetadata::platform() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectDiscoveryMetadata.platform) + return _internal_platform(); +} +inline void ConnectDiscoveryMetadata::set_platform(::runanywhere::v1::ConnectPlatform value) { + _internal_set_platform(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectDiscoveryMetadata.platform) +} +inline ::runanywhere::v1::ConnectPlatform ConnectDiscoveryMetadata::_internal_platform() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectPlatform>(_impl_.platform_); +} +inline void ConnectDiscoveryMetadata::_internal_set_platform(::runanywhere::v1::ConnectPlatform value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = value; +} + +// uint32 protocol_version = 4; +inline void ConnectDiscoveryMetadata::clear_protocol_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = 0u; + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline ::uint32_t ConnectDiscoveryMetadata::protocol_version() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectDiscoveryMetadata.protocol_version) + return _internal_protocol_version(); +} +inline void ConnectDiscoveryMetadata::set_protocol_version(::uint32_t value) { + _internal_set_protocol_version(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectDiscoveryMetadata.protocol_version) +} +inline ::uint32_t ConnectDiscoveryMetadata::_internal_protocol_version() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.protocol_version_; +} +inline void ConnectDiscoveryMetadata::_internal_set_protocol_version(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectModelDescriptor + +// string model_id = 1; +inline void ConnectModelDescriptor::clear_model_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.model_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectModelDescriptor::model_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectModelDescriptor.model_id) + return _internal_model_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectModelDescriptor::set_model_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.model_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectModelDescriptor.model_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectModelDescriptor::mutable_model_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_model_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectModelDescriptor.model_id) + return _s; +} +inline const ::std::string& ConnectModelDescriptor::_internal_model_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.model_id_.Get(); +} +inline void ConnectModelDescriptor::_internal_set_model_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.model_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectModelDescriptor::_internal_mutable_model_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.model_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectModelDescriptor::release_model_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectModelDescriptor.model_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.model_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.model_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectModelDescriptor::set_allocated_model_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.model_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.model_id_.IsDefault()) { + _impl_.model_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectModelDescriptor.model_id) +} + +// string display_name = 2; +inline void ConnectModelDescriptor::clear_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& ConnectModelDescriptor::display_name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectModelDescriptor.display_name) + return _internal_display_name(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectModelDescriptor::set_display_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.display_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectModelDescriptor.display_name) +} +inline ::std::string* PROTOBUF_NONNULL ConnectModelDescriptor::mutable_display_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_display_name(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectModelDescriptor.display_name) + return _s; +} +inline const ::std::string& ConnectModelDescriptor::_internal_display_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.display_name_.Get(); +} +inline void ConnectModelDescriptor::_internal_set_display_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectModelDescriptor::_internal_mutable_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.display_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectModelDescriptor::release_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectModelDescriptor.display_name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.display_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.display_name_.Set("", GetArena()); + } + return released; +} +inline void ConnectModelDescriptor::set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.display_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.display_name_.IsDefault()) { + _impl_.display_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectModelDescriptor.display_name) +} + +// string framework = 3; +inline void ConnectModelDescriptor::clear_framework() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.framework_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline const ::std::string& ConnectModelDescriptor::framework() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectModelDescriptor.framework) + return _internal_framework(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectModelDescriptor::set_framework(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.framework_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectModelDescriptor.framework) +} +inline ::std::string* PROTOBUF_NONNULL ConnectModelDescriptor::mutable_framework() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_framework(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectModelDescriptor.framework) + return _s; +} +inline const ::std::string& ConnectModelDescriptor::_internal_framework() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.framework_.Get(); +} +inline void ConnectModelDescriptor::_internal_set_framework(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.framework_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectModelDescriptor::_internal_mutable_framework() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.framework_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectModelDescriptor::release_framework() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectModelDescriptor.framework) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.framework_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.framework_.Set("", GetArena()); + } + return released; +} +inline void ConnectModelDescriptor::set_allocated_framework(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + _impl_.framework_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.framework_.IsDefault()) { + _impl_.framework_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectModelDescriptor.framework) +} + +// uint32 context_window = 4; +inline void ConnectModelDescriptor::clear_context_window() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.context_window_ = 0u; + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline ::uint32_t ConnectModelDescriptor::context_window() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectModelDescriptor.context_window) + return _internal_context_window(); +} +inline void ConnectModelDescriptor::set_context_window(::uint32_t value) { + _internal_set_context_window(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectModelDescriptor.context_window) +} +inline ::uint32_t ConnectModelDescriptor::_internal_context_window() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.context_window_; +} +inline void ConnectModelDescriptor::_internal_set_context_window(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.context_window_ = value; +} + +// bool supports_streaming = 5; +inline void ConnectModelDescriptor::clear_supports_streaming() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.supports_streaming_ = false; + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); +} +inline bool ConnectModelDescriptor::supports_streaming() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectModelDescriptor.supports_streaming) + return _internal_supports_streaming(); +} +inline void ConnectModelDescriptor::set_supports_streaming(bool value) { + _internal_set_supports_streaming(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectModelDescriptor.supports_streaming) +} +inline bool ConnectModelDescriptor::_internal_supports_streaming() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.supports_streaming_; +} +inline void ConnectModelDescriptor::_internal_set_supports_streaming(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.supports_streaming_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectHostStartRequest + +// string display_name = 1; +inline void ConnectHostStartRequest::clear_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectHostStartRequest::display_name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostStartRequest.display_name) + return _internal_display_name(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectHostStartRequest::set_display_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.display_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHostStartRequest.display_name) +} +inline ::std::string* PROTOBUF_NONNULL ConnectHostStartRequest::mutable_display_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_display_name(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostStartRequest.display_name) + return _s; +} +inline const ::std::string& ConnectHostStartRequest::_internal_display_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.display_name_.Get(); +} +inline void ConnectHostStartRequest::_internal_set_display_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectHostStartRequest::_internal_mutable_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.display_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectHostStartRequest::release_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostStartRequest.display_name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.display_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.display_name_.Set("", GetArena()); + } + return released; +} +inline void ConnectHostStartRequest::set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.display_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.display_name_.IsDefault()) { + _impl_.display_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostStartRequest.display_name) +} + +// .runanywhere.v1.ConnectPlatform platform = 2; +inline void ConnectHostStartRequest::clear_platform() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline ::runanywhere::v1::ConnectPlatform ConnectHostStartRequest::platform() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostStartRequest.platform) + return _internal_platform(); +} +inline void ConnectHostStartRequest::set_platform(::runanywhere::v1::ConnectPlatform value) { + _internal_set_platform(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHostStartRequest.platform) +} +inline ::runanywhere::v1::ConnectPlatform ConnectHostStartRequest::_internal_platform() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectPlatform>(_impl_.platform_); +} +inline void ConnectHostStartRequest::_internal_set_platform(::runanywhere::v1::ConnectPlatform value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = value; +} + +// uint32 protocol_version = 3; +inline void ConnectHostStartRequest::clear_protocol_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = 0u; + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline ::uint32_t ConnectHostStartRequest::protocol_version() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostStartRequest.protocol_version) + return _internal_protocol_version(); +} +inline void ConnectHostStartRequest::set_protocol_version(::uint32_t value) { + _internal_set_protocol_version(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHostStartRequest.protocol_version) +} +inline ::uint32_t ConnectHostStartRequest::_internal_protocol_version() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.protocol_version_; +} +inline void ConnectHostStartRequest::_internal_set_protocol_version(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = value; +} + +// .runanywhere.v1.ConnectModelDescriptor model = 4; +inline bool ConnectHostStartRequest::has_model() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.model_ != nullptr); + return value; +} +inline void ConnectHostStartRequest::clear_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ != nullptr) _impl_.model_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectHostStartRequest::_internal_model() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectModelDescriptor* p = _impl_.model_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectModelDescriptor>(&::runanywhere::v1::ConnectModelDescriptor_globals_); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectHostStartRequest::model() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostStartRequest.model) + return _internal_model(); +} +inline void ConnectHostStartRequest::unsafe_arena_set_allocated_model( + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHostStartRequest.model) +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectHostStartRequest::release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::ConnectModelDescriptor* released = _impl_.model_; + _impl_.model_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectHostStartRequest::unsafe_arena_release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostStartRequest.model) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::ConnectModelDescriptor* temp = _impl_.model_; + _impl_.model_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectHostStartRequest::_internal_mutable_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectModelDescriptor>(GetArena()); + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(p); + } + return _impl_.model_; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectHostStartRequest::mutable_model() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::ConnectModelDescriptor* _msg = _internal_mutable_model(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostStartRequest.model) + return _msg; +} +inline void ConnectHostStartRequest::set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostStartRequest.model) +} + +// ------------------------------------------------------------------- + +// ConnectHostStopRequest + +// ------------------------------------------------------------------- + +// ConnectHostState + +// bool is_hosting = 1; +inline void ConnectHostState::clear_is_hosting() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.is_hosting_ = false; + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline bool ConnectHostState::is_hosting() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostState.is_hosting) + return _internal_is_hosting(); +} +inline void ConnectHostState::set_is_hosting(bool value) { + _internal_set_is_hosting(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHostState.is_hosting) +} +inline bool ConnectHostState::_internal_is_hosting() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.is_hosting_; +} +inline void ConnectHostState::_internal_set_is_hosting(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.is_hosting_ = value; +} + +// .runanywhere.v1.ConnectDiscoveryMetadata discovery_metadata = 2; +inline bool ConnectHostState::has_discovery_metadata() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.discovery_metadata_ != nullptr); + return value; +} +inline void ConnectHostState::clear_discovery_metadata() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.discovery_metadata_ != nullptr) _impl_.discovery_metadata_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::runanywhere::v1::ConnectDiscoveryMetadata& ConnectHostState::_internal_discovery_metadata() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectDiscoveryMetadata* p = _impl_.discovery_metadata_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectDiscoveryMetadata>(&::runanywhere::v1::ConnectDiscoveryMetadata_globals_); +} +inline const ::runanywhere::v1::ConnectDiscoveryMetadata& ConnectHostState::discovery_metadata() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostState.discovery_metadata) + return _internal_discovery_metadata(); +} +inline void ConnectHostState::unsafe_arena_set_allocated_discovery_metadata( + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.discovery_metadata_); + } + _impl_.discovery_metadata_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHostState.discovery_metadata) +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE ConnectHostState::release_discovery_metadata() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::ConnectDiscoveryMetadata* released = _impl_.discovery_metadata_; + _impl_.discovery_metadata_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE ConnectHostState::unsafe_arena_release_discovery_metadata() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostState.discovery_metadata) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::ConnectDiscoveryMetadata* temp = _impl_.discovery_metadata_; + _impl_.discovery_metadata_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL ConnectHostState::_internal_mutable_discovery_metadata() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.discovery_metadata_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectDiscoveryMetadata>(GetArena()); + _impl_.discovery_metadata_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(p); + } + return _impl_.discovery_metadata_; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL ConnectHostState::mutable_discovery_metadata() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::ConnectDiscoveryMetadata* _msg = _internal_mutable_discovery_metadata(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostState.discovery_metadata) + return _msg; +} +inline void ConnectHostState::set_allocated_discovery_metadata(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.discovery_metadata_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + + _impl_.discovery_metadata_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostState.discovery_metadata) +} + +// uint32 active_client_count = 3; +inline void ConnectHostState::clear_active_client_count() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.active_client_count_ = 0u; + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); +} +inline ::uint32_t ConnectHostState::active_client_count() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostState.active_client_count) + return _internal_active_client_count(); +} +inline void ConnectHostState::set_active_client_count(::uint32_t value) { + _internal_set_active_client_count(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHostState.active_client_count) +} +inline ::uint32_t ConnectHostState::_internal_active_client_count() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.active_client_count_; +} +inline void ConnectHostState::_internal_set_active_client_count(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.active_client_count_ = value; +} + +// string error_message = 4; +inline void ConnectHostState::clear_error_message() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_message_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectHostState::error_message() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostState.error_message) + return _internal_error_message(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectHostState::set_error_message(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.error_message_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHostState.error_message) +} +inline ::std::string* PROTOBUF_NONNULL ConnectHostState::mutable_error_message() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_error_message(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostState.error_message) + return _s; +} +inline const ::std::string& ConnectHostState::_internal_error_message() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.error_message_.Get(); +} +inline void ConnectHostState::_internal_set_error_message(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_message_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectHostState::_internal_mutable_error_message() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.error_message_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectHostState::release_error_message() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostState.error_message) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.error_message_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.error_message_.Set("", GetArena()); + } + return released; +} +inline void ConnectHostState::set_allocated_error_message(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.error_message_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_message_.IsDefault()) { + _impl_.error_message_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostState.error_message) +} + +// .runanywhere.v1.ConnectModelDescriptor model = 5; +inline bool ConnectHostState::has_model() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000004U); + PROTOBUF_ASSUME(!value || _impl_.model_ != nullptr); + return value; +} +inline void ConnectHostState::clear_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ != nullptr) _impl_.model_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectHostState::_internal_model() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectModelDescriptor* p = _impl_.model_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectModelDescriptor>(&::runanywhere::v1::ConnectModelDescriptor_globals_); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectHostState::model() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostState.model) + return _internal_model(); +} +inline void ConnectHostState::unsafe_arena_set_allocated_model( + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHostState.model) +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectHostState::release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectModelDescriptor* released = _impl_.model_; + _impl_.model_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectHostState::unsafe_arena_release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostState.model) + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectModelDescriptor* temp = _impl_.model_; + _impl_.model_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectHostState::_internal_mutable_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectModelDescriptor>(GetArena()); + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(p); + } + return _impl_.model_; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectHostState::mutable_model() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectModelDescriptor* _msg = _internal_mutable_model(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostState.model) + return _msg; +} +inline void ConnectHostState::set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHostState.model) +} + +// ------------------------------------------------------------------- + +// ConnectClientStartRequest + +// string display_name = 1; +inline void ConnectClientStartRequest::clear_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectClientStartRequest::display_name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientStartRequest.display_name) + return _internal_display_name(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectClientStartRequest::set_display_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.display_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientStartRequest.display_name) +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientStartRequest::mutable_display_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_display_name(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientStartRequest.display_name) + return _s; +} +inline const ::std::string& ConnectClientStartRequest::_internal_display_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.display_name_.Get(); +} +inline void ConnectClientStartRequest::_internal_set_display_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientStartRequest::_internal_mutable_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.display_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectClientStartRequest::release_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientStartRequest.display_name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.display_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.display_name_.Set("", GetArena()); + } + return released; +} +inline void ConnectClientStartRequest::set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.display_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.display_name_.IsDefault()) { + _impl_.display_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientStartRequest.display_name) +} + +// .runanywhere.v1.ConnectPlatform platform = 2; +inline void ConnectClientStartRequest::clear_platform() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline ::runanywhere::v1::ConnectPlatform ConnectClientStartRequest::platform() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientStartRequest.platform) + return _internal_platform(); +} +inline void ConnectClientStartRequest::set_platform(::runanywhere::v1::ConnectPlatform value) { + _internal_set_platform(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientStartRequest.platform) +} +inline ::runanywhere::v1::ConnectPlatform ConnectClientStartRequest::_internal_platform() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectPlatform>(_impl_.platform_); +} +inline void ConnectClientStartRequest::_internal_set_platform(::runanywhere::v1::ConnectPlatform value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = value; +} + +// uint32 protocol_version = 3; +inline void ConnectClientStartRequest::clear_protocol_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = 0u; + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline ::uint32_t ConnectClientStartRequest::protocol_version() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientStartRequest.protocol_version) + return _internal_protocol_version(); +} +inline void ConnectClientStartRequest::set_protocol_version(::uint32_t value) { + _internal_set_protocol_version(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientStartRequest.protocol_version) +} +inline ::uint32_t ConnectClientStartRequest::_internal_protocol_version() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.protocol_version_; +} +inline void ConnectClientStartRequest::_internal_set_protocol_version(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectClientHello + +// string instance_id = 1; +inline void ConnectClientHello::clear_instance_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.instance_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectClientHello::instance_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientHello.instance_id) + return _internal_instance_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectClientHello::set_instance_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.instance_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientHello.instance_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientHello::mutable_instance_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_instance_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientHello.instance_id) + return _s; +} +inline const ::std::string& ConnectClientHello::_internal_instance_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.instance_id_.Get(); +} +inline void ConnectClientHello::_internal_set_instance_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.instance_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientHello::_internal_mutable_instance_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.instance_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectClientHello::release_instance_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientHello.instance_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.instance_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.instance_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectClientHello::set_allocated_instance_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.instance_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.instance_id_.IsDefault()) { + _impl_.instance_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientHello.instance_id) +} + +// string display_name = 2; +inline void ConnectClientHello::clear_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& ConnectClientHello::display_name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientHello.display_name) + return _internal_display_name(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectClientHello::set_display_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.display_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientHello.display_name) +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientHello::mutable_display_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_display_name(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientHello.display_name) + return _s; +} +inline const ::std::string& ConnectClientHello::_internal_display_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.display_name_.Get(); +} +inline void ConnectClientHello::_internal_set_display_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.display_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientHello::_internal_mutable_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.display_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectClientHello::release_display_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientHello.display_name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.display_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.display_name_.Set("", GetArena()); + } + return released; +} +inline void ConnectClientHello::set_allocated_display_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.display_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.display_name_.IsDefault()) { + _impl_.display_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientHello.display_name) +} + +// .runanywhere.v1.ConnectPlatform platform = 3; +inline void ConnectClientHello::clear_platform() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline ::runanywhere::v1::ConnectPlatform ConnectClientHello::platform() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientHello.platform) + return _internal_platform(); +} +inline void ConnectClientHello::set_platform(::runanywhere::v1::ConnectPlatform value) { + _internal_set_platform(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientHello.platform) +} +inline ::runanywhere::v1::ConnectPlatform ConnectClientHello::_internal_platform() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectPlatform>(_impl_.platform_); +} +inline void ConnectClientHello::_internal_set_platform(::runanywhere::v1::ConnectPlatform value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.platform_ = value; +} + +// uint32 protocol_version = 4; +inline void ConnectClientHello::clear_protocol_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = 0u; + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline ::uint32_t ConnectClientHello::protocol_version() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientHello.protocol_version) + return _internal_protocol_version(); +} +inline void ConnectClientHello::set_protocol_version(::uint32_t value) { + _internal_set_protocol_version(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientHello.protocol_version) +} +inline ::uint32_t ConnectClientHello::_internal_protocol_version() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.protocol_version_; +} +inline void ConnectClientHello::_internal_set_protocol_version(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.protocol_version_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectHandshakeResponse + +// .runanywhere.v1.ConnectHandshakeStatus status = 1; +inline void ConnectHandshakeResponse::clear_status() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.status_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); +} +inline ::runanywhere::v1::ConnectHandshakeStatus ConnectHandshakeResponse::status() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHandshakeResponse.status) + return _internal_status(); +} +inline void ConnectHandshakeResponse::set_status(::runanywhere::v1::ConnectHandshakeStatus value) { + _internal_set_status(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHandshakeResponse.status) +} +inline ::runanywhere::v1::ConnectHandshakeStatus ConnectHandshakeResponse::_internal_status() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectHandshakeStatus>(_impl_.status_); +} +inline void ConnectHandshakeResponse::_internal_set_status(::runanywhere::v1::ConnectHandshakeStatus value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.status_ = value; +} + +// string session_id = 2; +inline void ConnectHandshakeResponse::clear_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectHandshakeResponse::session_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHandshakeResponse.session_id) + return _internal_session_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectHandshakeResponse::set_session_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.session_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHandshakeResponse.session_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectHandshakeResponse::mutable_session_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_session_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHandshakeResponse.session_id) + return _s; +} +inline const ::std::string& ConnectHandshakeResponse::_internal_session_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.session_id_.Get(); +} +inline void ConnectHandshakeResponse::_internal_set_session_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectHandshakeResponse::_internal_mutable_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.session_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectHandshakeResponse::release_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHandshakeResponse.session_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.session_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.session_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectHandshakeResponse::set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.session_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.session_id_.IsDefault()) { + _impl_.session_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHandshakeResponse.session_id) +} + +// .runanywhere.v1.ConnectDiscoveryMetadata host = 3; +inline bool ConnectHandshakeResponse::has_host() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000004U); + PROTOBUF_ASSUME(!value || _impl_.host_ != nullptr); + return value; +} +inline void ConnectHandshakeResponse::clear_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.host_ != nullptr) _impl_.host_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline const ::runanywhere::v1::ConnectDiscoveryMetadata& ConnectHandshakeResponse::_internal_host() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectDiscoveryMetadata* p = _impl_.host_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectDiscoveryMetadata>(&::runanywhere::v1::ConnectDiscoveryMetadata_globals_); +} +inline const ::runanywhere::v1::ConnectDiscoveryMetadata& ConnectHandshakeResponse::host() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHandshakeResponse.host) + return _internal_host(); +} +inline void ConnectHandshakeResponse::unsafe_arena_set_allocated_host( + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.host_); + } + _impl_.host_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHandshakeResponse.host) +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE ConnectHandshakeResponse::release_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectDiscoveryMetadata* released = _impl_.host_; + _impl_.host_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE ConnectHandshakeResponse::unsafe_arena_release_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHandshakeResponse.host) + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectDiscoveryMetadata* temp = _impl_.host_; + _impl_.host_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL ConnectHandshakeResponse::_internal_mutable_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.host_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectDiscoveryMetadata>(GetArena()); + _impl_.host_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(p); + } + return _impl_.host_; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL ConnectHandshakeResponse::mutable_host() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectDiscoveryMetadata* _msg = _internal_mutable_host(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHandshakeResponse.host) + return _msg; +} +inline void ConnectHandshakeResponse::set_allocated_host(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.host_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + + _impl_.host_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHandshakeResponse.host) +} + +// string rejection_reason = 4; +inline void ConnectHandshakeResponse::clear_rejection_reason() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rejection_reason_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& ConnectHandshakeResponse::rejection_reason() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHandshakeResponse.rejection_reason) + return _internal_rejection_reason(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectHandshakeResponse::set_rejection_reason(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.rejection_reason_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHandshakeResponse.rejection_reason) +} +inline ::std::string* PROTOBUF_NONNULL ConnectHandshakeResponse::mutable_rejection_reason() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_rejection_reason(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHandshakeResponse.rejection_reason) + return _s; +} +inline const ::std::string& ConnectHandshakeResponse::_internal_rejection_reason() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.rejection_reason_.Get(); +} +inline void ConnectHandshakeResponse::_internal_set_rejection_reason(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rejection_reason_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectHandshakeResponse::_internal_mutable_rejection_reason() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.rejection_reason_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectHandshakeResponse::release_rejection_reason() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHandshakeResponse.rejection_reason) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.rejection_reason_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.rejection_reason_.Set("", GetArena()); + } + return released; +} +inline void ConnectHandshakeResponse::set_allocated_rejection_reason(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.rejection_reason_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.rejection_reason_.IsDefault()) { + _impl_.rejection_reason_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHandshakeResponse.rejection_reason) +} + +// .runanywhere.v1.ConnectModelDescriptor model = 5; +inline bool ConnectHandshakeResponse::has_model() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000008U); + PROTOBUF_ASSUME(!value || _impl_.model_ != nullptr); + return value; +} +inline void ConnectHandshakeResponse::clear_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ != nullptr) _impl_.model_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectHandshakeResponse::_internal_model() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectModelDescriptor* p = _impl_.model_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectModelDescriptor>(&::runanywhere::v1::ConnectModelDescriptor_globals_); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectHandshakeResponse::model() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHandshakeResponse.model) + return _internal_model(); +} +inline void ConnectHandshakeResponse::unsafe_arena_set_allocated_model( + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHandshakeResponse.model) +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectHandshakeResponse::release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ::runanywhere::v1::ConnectModelDescriptor* released = _impl_.model_; + _impl_.model_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectHandshakeResponse::unsafe_arena_release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHandshakeResponse.model) + + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ::runanywhere::v1::ConnectModelDescriptor* temp = _impl_.model_; + _impl_.model_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectHandshakeResponse::_internal_mutable_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectModelDescriptor>(GetArena()); + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(p); + } + return _impl_.model_; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectHandshakeResponse::mutable_model() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::runanywhere::v1::ConnectModelDescriptor* _msg = _internal_mutable_model(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHandshakeResponse.model) + return _msg; +} +inline void ConnectHandshakeResponse::set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHandshakeResponse.model) +} + +// ------------------------------------------------------------------- + +// ConnectClientSessionState + +// .runanywhere.v1.ConnectSessionState state = 1; +inline void ConnectClientSessionState::clear_state() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.state_ = 0; + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); +} +inline ::runanywhere::v1::ConnectSessionState ConnectClientSessionState::state() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientSessionState.state) + return _internal_state(); +} +inline void ConnectClientSessionState::set_state(::runanywhere::v1::ConnectSessionState value) { + _internal_set_state(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientSessionState.state) +} +inline ::runanywhere::v1::ConnectSessionState ConnectClientSessionState::_internal_state() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::runanywhere::v1::ConnectSessionState>(_impl_.state_); +} +inline void ConnectClientSessionState::_internal_set_state(::runanywhere::v1::ConnectSessionState value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.state_ = value; +} + +// string session_id = 2; +inline void ConnectClientSessionState::clear_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectClientSessionState::session_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientSessionState.session_id) + return _internal_session_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectClientSessionState::set_session_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.session_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientSessionState.session_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientSessionState::mutable_session_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_session_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientSessionState.session_id) + return _s; +} +inline const ::std::string& ConnectClientSessionState::_internal_session_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.session_id_.Get(); +} +inline void ConnectClientSessionState::_internal_set_session_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientSessionState::_internal_mutable_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.session_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectClientSessionState::release_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientSessionState.session_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.session_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.session_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectClientSessionState::set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.session_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.session_id_.IsDefault()) { + _impl_.session_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientSessionState.session_id) +} + +// .runanywhere.v1.ConnectDiscoveryMetadata host = 3; +inline bool ConnectClientSessionState::has_host() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000004U); + PROTOBUF_ASSUME(!value || _impl_.host_ != nullptr); + return value; +} +inline void ConnectClientSessionState::clear_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.host_ != nullptr) _impl_.host_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline const ::runanywhere::v1::ConnectDiscoveryMetadata& ConnectClientSessionState::_internal_host() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectDiscoveryMetadata* p = _impl_.host_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectDiscoveryMetadata>(&::runanywhere::v1::ConnectDiscoveryMetadata_globals_); +} +inline const ::runanywhere::v1::ConnectDiscoveryMetadata& ConnectClientSessionState::host() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientSessionState.host) + return _internal_host(); +} +inline void ConnectClientSessionState::unsafe_arena_set_allocated_host( + ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.host_); + } + _impl_.host_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectClientSessionState.host) +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE ConnectClientSessionState::release_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectDiscoveryMetadata* released = _impl_.host_; + _impl_.host_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE ConnectClientSessionState::unsafe_arena_release_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientSessionState.host) + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectDiscoveryMetadata* temp = _impl_.host_; + _impl_.host_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL ConnectClientSessionState::_internal_mutable_host() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.host_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectDiscoveryMetadata>(GetArena()); + _impl_.host_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(p); + } + return _impl_.host_; +} +inline ::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NONNULL ConnectClientSessionState::mutable_host() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::ConnectDiscoveryMetadata* _msg = _internal_mutable_host(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientSessionState.host) + return _msg; +} +inline void ConnectClientSessionState::set_allocated_host(::runanywhere::v1::ConnectDiscoveryMetadata* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.host_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + + _impl_.host_ = reinterpret_cast<::runanywhere::v1::ConnectDiscoveryMetadata*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientSessionState.host) +} + +// string error_message = 4; +inline void ConnectClientSessionState::clear_error_message() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_message_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& ConnectClientSessionState::error_message() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientSessionState.error_message) + return _internal_error_message(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectClientSessionState::set_error_message(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.error_message_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectClientSessionState.error_message) +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientSessionState::mutable_error_message() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_error_message(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientSessionState.error_message) + return _s; +} +inline const ::std::string& ConnectClientSessionState::_internal_error_message() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.error_message_.Get(); +} +inline void ConnectClientSessionState::_internal_set_error_message(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_message_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectClientSessionState::_internal_mutable_error_message() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.error_message_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectClientSessionState::release_error_message() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientSessionState.error_message) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.error_message_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.error_message_.Set("", GetArena()); + } + return released; +} +inline void ConnectClientSessionState::set_allocated_error_message(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.error_message_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_message_.IsDefault()) { + _impl_.error_message_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientSessionState.error_message) +} + +// .runanywhere.v1.ConnectModelDescriptor model = 5; +inline bool ConnectClientSessionState::has_model() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000008U); + PROTOBUF_ASSUME(!value || _impl_.model_ != nullptr); + return value; +} +inline void ConnectClientSessionState::clear_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ != nullptr) _impl_.model_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectClientSessionState::_internal_model() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::ConnectModelDescriptor* p = _impl_.model_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectModelDescriptor>(&::runanywhere::v1::ConnectModelDescriptor_globals_); +} +inline const ::runanywhere::v1::ConnectModelDescriptor& ConnectClientSessionState::model() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientSessionState.model) + return _internal_model(); +} +inline void ConnectClientSessionState::unsafe_arena_set_allocated_model( + ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectClientSessionState.model) +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectClientSessionState::release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ::runanywhere::v1::ConnectModelDescriptor* released = _impl_.model_; + _impl_.model_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE ConnectClientSessionState::unsafe_arena_release_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientSessionState.model) + + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ::runanywhere::v1::ConnectModelDescriptor* temp = _impl_.model_; + _impl_.model_ = nullptr; + return temp; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectClientSessionState::_internal_mutable_model() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.model_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectModelDescriptor>(GetArena()); + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(p); + } + return _impl_.model_; +} +inline ::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NONNULL ConnectClientSessionState::mutable_model() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::runanywhere::v1::ConnectModelDescriptor* _msg = _internal_mutable_model(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientSessionState.model) + return _msg; +} +inline void ConnectClientSessionState::set_allocated_model(::runanywhere::v1::ConnectModelDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.model_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + + _impl_.model_ = reinterpret_cast<::runanywhere::v1::ConnectModelDescriptor*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectClientSessionState.model) +} + +// ------------------------------------------------------------------- + +// ConnectSessionCloseRequest + +// string session_id = 1; +inline void ConnectSessionCloseRequest::clear_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectSessionCloseRequest::session_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectSessionCloseRequest.session_id) + return _internal_session_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectSessionCloseRequest::set_session_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.session_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectSessionCloseRequest.session_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectSessionCloseRequest::mutable_session_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_session_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectSessionCloseRequest.session_id) + return _s; +} +inline const ::std::string& ConnectSessionCloseRequest::_internal_session_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.session_id_.Get(); +} +inline void ConnectSessionCloseRequest::_internal_set_session_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectSessionCloseRequest::_internal_mutable_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.session_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectSessionCloseRequest::release_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectSessionCloseRequest.session_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.session_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.session_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectSessionCloseRequest::set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.session_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.session_id_.IsDefault()) { + _impl_.session_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectSessionCloseRequest.session_id) +} + +// ------------------------------------------------------------------- + +// ConnectInvocationRequest + +// string session_id = 1; +inline void ConnectInvocationRequest::clear_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectInvocationRequest::session_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationRequest.session_id) + return _internal_session_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectInvocationRequest::set_session_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.session_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectInvocationRequest.session_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationRequest::mutable_session_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_session_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectInvocationRequest.session_id) + return _s; +} +inline const ::std::string& ConnectInvocationRequest::_internal_session_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.session_id_.Get(); +} +inline void ConnectInvocationRequest::_internal_set_session_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationRequest::_internal_mutable_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.session_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectInvocationRequest::release_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectInvocationRequest.session_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.session_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.session_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectInvocationRequest::set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.session_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.session_id_.IsDefault()) { + _impl_.session_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectInvocationRequest.session_id) +} + +// string request_id = 2; +inline void ConnectInvocationRequest::clear_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& ConnectInvocationRequest::request_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationRequest.request_id) + return _internal_request_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectInvocationRequest::set_request_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.request_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectInvocationRequest.request_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationRequest::mutable_request_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_request_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectInvocationRequest.request_id) + return _s; +} +inline const ::std::string& ConnectInvocationRequest::_internal_request_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.request_id_.Get(); +} +inline void ConnectInvocationRequest::_internal_set_request_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationRequest::_internal_mutable_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.request_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectInvocationRequest::release_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectInvocationRequest.request_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.request_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.request_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectInvocationRequest::set_allocated_request_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.request_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.request_id_.IsDefault()) { + _impl_.request_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectInvocationRequest.request_id) +} + +// .runanywhere.v1.LLMGenerateRequest generation = 3; +inline bool ConnectInvocationRequest::has_generation() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000004U); + PROTOBUF_ASSUME(!value || _impl_.generation_ != nullptr); + return value; +} +inline const ::runanywhere::v1::LLMGenerateRequest& ConnectInvocationRequest::_internal_generation() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::LLMGenerateRequest* p = _impl_.generation_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::LLMGenerateRequest>(&::runanywhere::v1::LLMGenerateRequest_globals_); +} +inline const ::runanywhere::v1::LLMGenerateRequest& ConnectInvocationRequest::generation() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationRequest.generation) + return _internal_generation(); +} +inline void ConnectInvocationRequest::unsafe_arena_set_allocated_generation( + ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generation_); + } + _impl_.generation_ = reinterpret_cast<::runanywhere::v1::LLMGenerateRequest*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectInvocationRequest.generation) +} +inline ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE ConnectInvocationRequest::release_generation() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::LLMGenerateRequest* released = _impl_.generation_; + _impl_.generation_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE ConnectInvocationRequest::unsafe_arena_release_generation() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectInvocationRequest.generation) + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::LLMGenerateRequest* temp = _impl_.generation_; + _impl_.generation_ = nullptr; + return temp; +} +inline ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NONNULL ConnectInvocationRequest::_internal_mutable_generation() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.generation_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::LLMGenerateRequest>(GetArena()); + _impl_.generation_ = reinterpret_cast<::runanywhere::v1::LLMGenerateRequest*>(p); + } + return _impl_.generation_; +} +inline ::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NONNULL ConnectInvocationRequest::mutable_generation() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::runanywhere::v1::LLMGenerateRequest* _msg = _internal_mutable_generation(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectInvocationRequest.generation) + return _msg; +} +inline void ConnectInvocationRequest::set_allocated_generation(::runanywhere::v1::LLMGenerateRequest* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generation_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(value)->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + + _impl_.generation_ = reinterpret_cast<::runanywhere::v1::LLMGenerateRequest*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectInvocationRequest.generation) +} + +// ------------------------------------------------------------------- + +// ConnectInvocationValidation + +// bool accepted = 1; +inline void ConnectInvocationValidation::clear_accepted() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.accepted_ = false; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline bool ConnectInvocationValidation::accepted() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationValidation.accepted) + return _internal_accepted(); +} +inline void ConnectInvocationValidation::set_accepted(bool value) { + _internal_set_accepted(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectInvocationValidation.accepted) +} +inline bool ConnectInvocationValidation::_internal_accepted() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.accepted_; +} +inline void ConnectInvocationValidation::_internal_set_accepted(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.accepted_ = value; +} + +// string rejection_reason = 2; +inline void ConnectInvocationValidation::clear_rejection_reason() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rejection_reason_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectInvocationValidation::rejection_reason() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationValidation.rejection_reason) + return _internal_rejection_reason(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectInvocationValidation::set_rejection_reason(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.rejection_reason_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectInvocationValidation.rejection_reason) +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationValidation::mutable_rejection_reason() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_rejection_reason(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectInvocationValidation.rejection_reason) + return _s; +} +inline const ::std::string& ConnectInvocationValidation::_internal_rejection_reason() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.rejection_reason_.Get(); +} +inline void ConnectInvocationValidation::_internal_set_rejection_reason(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rejection_reason_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationValidation::_internal_mutable_rejection_reason() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.rejection_reason_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectInvocationValidation::release_rejection_reason() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectInvocationValidation.rejection_reason) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.rejection_reason_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.rejection_reason_.Set("", GetArena()); + } + return released; +} +inline void ConnectInvocationValidation::set_allocated_rejection_reason(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.rejection_reason_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.rejection_reason_.IsDefault()) { + _impl_.rejection_reason_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectInvocationValidation.rejection_reason) +} + +// ------------------------------------------------------------------- + +// ConnectInvocationEvent + +// string request_id = 1; +inline void ConnectInvocationEvent::clear_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectInvocationEvent::request_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationEvent.request_id) + return _internal_request_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectInvocationEvent::set_request_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.request_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectInvocationEvent.request_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationEvent::mutable_request_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_request_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectInvocationEvent.request_id) + return _s; +} +inline const ::std::string& ConnectInvocationEvent::_internal_request_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.request_id_.Get(); +} +inline void ConnectInvocationEvent::_internal_set_request_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectInvocationEvent::_internal_mutable_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.request_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectInvocationEvent::release_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectInvocationEvent.request_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.request_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.request_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectInvocationEvent::set_allocated_request_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.request_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.request_id_.IsDefault()) { + _impl_.request_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectInvocationEvent.request_id) +} + +// .runanywhere.v1.LLMStreamEvent event = 2; +inline bool ConnectInvocationEvent::has_event() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.event_ != nullptr); + return value; +} +inline const ::runanywhere::v1::LLMStreamEvent& ConnectInvocationEvent::_internal_event() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::runanywhere::v1::LLMStreamEvent* p = _impl_.event_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::LLMStreamEvent>(&::runanywhere::v1::LLMStreamEvent_globals_); +} +inline const ::runanywhere::v1::LLMStreamEvent& ConnectInvocationEvent::event() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectInvocationEvent.event) + return _internal_event(); +} +inline void ConnectInvocationEvent::unsafe_arena_set_allocated_event( + ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.event_); + } + _impl_.event_ = reinterpret_cast<::runanywhere::v1::LLMStreamEvent*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectInvocationEvent.event) +} +inline ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE ConnectInvocationEvent::release_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::LLMStreamEvent* released = _impl_.event_; + _impl_.event_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE ConnectInvocationEvent::unsafe_arena_release_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectInvocationEvent.event) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::LLMStreamEvent* temp = _impl_.event_; + _impl_.event_ = nullptr; + return temp; +} +inline ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NONNULL ConnectInvocationEvent::_internal_mutable_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.event_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::LLMStreamEvent>(GetArena()); + _impl_.event_ = reinterpret_cast<::runanywhere::v1::LLMStreamEvent*>(p); + } + return _impl_.event_; +} +inline ::runanywhere::v1::LLMStreamEvent* PROTOBUF_NONNULL ConnectInvocationEvent::mutable_event() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::runanywhere::v1::LLMStreamEvent* _msg = _internal_mutable_event(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectInvocationEvent.event) + return _msg; +} +inline void ConnectInvocationEvent::set_allocated_event(::runanywhere::v1::LLMStreamEvent* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.event_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(value)->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + + _impl_.event_ = reinterpret_cast<::runanywhere::v1::LLMStreamEvent*>(value); + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectInvocationEvent.event) +} + +// ------------------------------------------------------------------- + +// ConnectHeartbeatRequest + +// string session_id = 1; +inline void ConnectHeartbeatRequest::clear_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectHeartbeatRequest::session_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHeartbeatRequest.session_id) + return _internal_session_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectHeartbeatRequest::set_session_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.session_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHeartbeatRequest.session_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectHeartbeatRequest::mutable_session_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_session_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHeartbeatRequest.session_id) + return _s; +} +inline const ::std::string& ConnectHeartbeatRequest::_internal_session_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.session_id_.Get(); +} +inline void ConnectHeartbeatRequest::_internal_set_session_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectHeartbeatRequest::_internal_mutable_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.session_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectHeartbeatRequest::release_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHeartbeatRequest.session_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.session_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.session_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectHeartbeatRequest::set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.session_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.session_id_.IsDefault()) { + _impl_.session_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHeartbeatRequest.session_id) +} + +// uint64 sequence = 2; +inline void ConnectHeartbeatRequest::clear_sequence() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sequence_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline ::uint64_t ConnectHeartbeatRequest::sequence() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHeartbeatRequest.sequence) + return _internal_sequence(); +} +inline void ConnectHeartbeatRequest::set_sequence(::uint64_t value) { + _internal_set_sequence(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHeartbeatRequest.sequence) +} +inline ::uint64_t ConnectHeartbeatRequest::_internal_sequence() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.sequence_; +} +inline void ConnectHeartbeatRequest::_internal_set_sequence(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sequence_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectHeartbeatResponse + +// string session_id = 1; +inline void ConnectHeartbeatResponse::clear_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline const ::std::string& ConnectHeartbeatResponse::session_id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHeartbeatResponse.session_id) + return _internal_session_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ConnectHeartbeatResponse::set_session_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.session_id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHeartbeatResponse.session_id) +} +inline ::std::string* PROTOBUF_NONNULL ConnectHeartbeatResponse::mutable_session_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_session_id(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHeartbeatResponse.session_id) + return _s; +} +inline const ::std::string& ConnectHeartbeatResponse::_internal_session_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.session_id_.Get(); +} +inline void ConnectHeartbeatResponse::_internal_set_session_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.session_id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ConnectHeartbeatResponse::_internal_mutable_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.session_id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ConnectHeartbeatResponse::release_session_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHeartbeatResponse.session_id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.session_id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.session_id_.Set("", GetArena()); + } + return released; +} +inline void ConnectHeartbeatResponse::set_allocated_session_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.session_id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.session_id_.IsDefault()) { + _impl_.session_id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:runanywhere.v1.ConnectHeartbeatResponse.session_id) +} + +// uint64 sequence = 2; +inline void ConnectHeartbeatResponse::clear_sequence() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sequence_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline ::uint64_t ConnectHeartbeatResponse::sequence() const { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHeartbeatResponse.sequence) + return _internal_sequence(); +} +inline void ConnectHeartbeatResponse::set_sequence(::uint64_t value) { + _internal_set_sequence(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:runanywhere.v1.ConnectHeartbeatResponse.sequence) +} +inline ::uint64_t ConnectHeartbeatResponse::_internal_sequence() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.sequence_; +} +inline void ConnectHeartbeatResponse::_internal_set_sequence(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sequence_ = value; +} + +// ------------------------------------------------------------------- + +// ConnectClientFrame + +// .runanywhere.v1.ConnectInvocationRequest invocation = 1; +inline bool ConnectClientFrame::has_invocation() const { + return payload_case() == kInvocation; +} +inline bool ConnectClientFrame::_internal_has_invocation() const { + return payload_case() == kInvocation; +} +inline void ConnectClientFrame::set_has_invocation() { + _impl_._oneof_case_[0] = kInvocation; +} +inline void ConnectClientFrame::clear_invocation() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (payload_case() == kInvocation) { + if (GetArena() == nullptr) { + delete _impl_.payload_.invocation_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.invocation_); + } + clear_has_payload(); + } +} +inline ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE ConnectClientFrame::release_invocation() { + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientFrame.invocation) + if (payload_case() == kInvocation) { + clear_has_payload(); + auto* temp = _impl_.payload_.invocation_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.payload_.invocation_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::runanywhere::v1::ConnectInvocationRequest& ConnectClientFrame::_internal_invocation() const { + return payload_case() == kInvocation ? static_cast(*_impl_.payload_.invocation_) + : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectInvocationRequest>(&::runanywhere::v1::ConnectInvocationRequest_globals_); +} +inline const ::runanywhere::v1::ConnectInvocationRequest& ConnectClientFrame::invocation() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientFrame.invocation) + return _internal_invocation(); +} +inline ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE ConnectClientFrame::unsafe_arena_release_invocation() { + // @@protoc_insertion_point(field_unsafe_arena_release:runanywhere.v1.ConnectClientFrame.invocation) + if (payload_case() == kInvocation) { + clear_has_payload(); + auto* temp = _impl_.payload_.invocation_; + _impl_.payload_.invocation_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ConnectClientFrame::unsafe_arena_set_allocated_invocation( + ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NULLABLE value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_payload(); + if (value) { + set_has_invocation(); + _impl_.payload_.invocation_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectClientFrame.invocation) +} +inline ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NONNULL ConnectClientFrame::_internal_mutable_invocation() { + if (payload_case() != kInvocation) { + clear_payload(); + set_has_invocation(); + _impl_.payload_.invocation_ = + ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectInvocationRequest>(GetArena()); + } + return _impl_.payload_.invocation_; +} +inline ::runanywhere::v1::ConnectInvocationRequest* PROTOBUF_NONNULL ConnectClientFrame::mutable_invocation() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::runanywhere::v1::ConnectInvocationRequest* _msg = _internal_mutable_invocation(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientFrame.invocation) + return _msg; +} + +// .runanywhere.v1.ConnectHeartbeatRequest heartbeat = 2; +inline bool ConnectClientFrame::has_heartbeat() const { + return payload_case() == kHeartbeat; +} +inline bool ConnectClientFrame::_internal_has_heartbeat() const { + return payload_case() == kHeartbeat; +} +inline void ConnectClientFrame::set_has_heartbeat() { + _impl_._oneof_case_[0] = kHeartbeat; +} +inline void ConnectClientFrame::clear_heartbeat() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (payload_case() == kHeartbeat) { + if (GetArena() == nullptr) { + delete _impl_.payload_.heartbeat_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.heartbeat_); + } + clear_has_payload(); + } +} +inline ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE ConnectClientFrame::release_heartbeat() { + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectClientFrame.heartbeat) + if (payload_case() == kHeartbeat) { + clear_has_payload(); + auto* temp = _impl_.payload_.heartbeat_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.payload_.heartbeat_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::runanywhere::v1::ConnectHeartbeatRequest& ConnectClientFrame::_internal_heartbeat() const { + return payload_case() == kHeartbeat ? static_cast(*_impl_.payload_.heartbeat_) + : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectHeartbeatRequest>(&::runanywhere::v1::ConnectHeartbeatRequest_globals_); +} +inline const ::runanywhere::v1::ConnectHeartbeatRequest& ConnectClientFrame::heartbeat() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectClientFrame.heartbeat) + return _internal_heartbeat(); +} +inline ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE ConnectClientFrame::unsafe_arena_release_heartbeat() { + // @@protoc_insertion_point(field_unsafe_arena_release:runanywhere.v1.ConnectClientFrame.heartbeat) + if (payload_case() == kHeartbeat) { + clear_has_payload(); + auto* temp = _impl_.payload_.heartbeat_; + _impl_.payload_.heartbeat_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ConnectClientFrame::unsafe_arena_set_allocated_heartbeat( + ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NULLABLE value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_payload(); + if (value) { + set_has_heartbeat(); + _impl_.payload_.heartbeat_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectClientFrame.heartbeat) +} +inline ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NONNULL ConnectClientFrame::_internal_mutable_heartbeat() { + if (payload_case() != kHeartbeat) { + clear_payload(); + set_has_heartbeat(); + _impl_.payload_.heartbeat_ = + ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectHeartbeatRequest>(GetArena()); + } + return _impl_.payload_.heartbeat_; +} +inline ::runanywhere::v1::ConnectHeartbeatRequest* PROTOBUF_NONNULL ConnectClientFrame::mutable_heartbeat() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::runanywhere::v1::ConnectHeartbeatRequest* _msg = _internal_mutable_heartbeat(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectClientFrame.heartbeat) + return _msg; +} + +inline bool ConnectClientFrame::has_payload() const { + return payload_case() != PAYLOAD_NOT_SET; +} +inline void ConnectClientFrame::clear_has_payload() { + _impl_._oneof_case_[0] = PAYLOAD_NOT_SET; +} +inline ConnectClientFrame::PayloadCase ConnectClientFrame::payload_case() const { + return ConnectClientFrame::PayloadCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ConnectHostFrame + +// .runanywhere.v1.ConnectInvocationEvent invocation_event = 1; +inline bool ConnectHostFrame::has_invocation_event() const { + return payload_case() == kInvocationEvent; +} +inline bool ConnectHostFrame::_internal_has_invocation_event() const { + return payload_case() == kInvocationEvent; +} +inline void ConnectHostFrame::set_has_invocation_event() { + _impl_._oneof_case_[0] = kInvocationEvent; +} +inline void ConnectHostFrame::clear_invocation_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (payload_case() == kInvocationEvent) { + if (GetArena() == nullptr) { + delete _impl_.payload_.invocation_event_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.invocation_event_); + } + clear_has_payload(); + } +} +inline ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE ConnectHostFrame::release_invocation_event() { + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostFrame.invocation_event) + if (payload_case() == kInvocationEvent) { + clear_has_payload(); + auto* temp = _impl_.payload_.invocation_event_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.payload_.invocation_event_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::runanywhere::v1::ConnectInvocationEvent& ConnectHostFrame::_internal_invocation_event() const { + return payload_case() == kInvocationEvent ? static_cast(*_impl_.payload_.invocation_event_) + : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectInvocationEvent>(&::runanywhere::v1::ConnectInvocationEvent_globals_); +} +inline const ::runanywhere::v1::ConnectInvocationEvent& ConnectHostFrame::invocation_event() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostFrame.invocation_event) + return _internal_invocation_event(); +} +inline ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE ConnectHostFrame::unsafe_arena_release_invocation_event() { + // @@protoc_insertion_point(field_unsafe_arena_release:runanywhere.v1.ConnectHostFrame.invocation_event) + if (payload_case() == kInvocationEvent) { + clear_has_payload(); + auto* temp = _impl_.payload_.invocation_event_; + _impl_.payload_.invocation_event_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ConnectHostFrame::unsafe_arena_set_allocated_invocation_event( + ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NULLABLE value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_payload(); + if (value) { + set_has_invocation_event(); + _impl_.payload_.invocation_event_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHostFrame.invocation_event) +} +inline ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NONNULL ConnectHostFrame::_internal_mutable_invocation_event() { + if (payload_case() != kInvocationEvent) { + clear_payload(); + set_has_invocation_event(); + _impl_.payload_.invocation_event_ = + ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectInvocationEvent>(GetArena()); + } + return _impl_.payload_.invocation_event_; +} +inline ::runanywhere::v1::ConnectInvocationEvent* PROTOBUF_NONNULL ConnectHostFrame::mutable_invocation_event() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::runanywhere::v1::ConnectInvocationEvent* _msg = _internal_mutable_invocation_event(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostFrame.invocation_event) + return _msg; +} + +// .runanywhere.v1.ConnectHeartbeatResponse heartbeat = 2; +inline bool ConnectHostFrame::has_heartbeat() const { + return payload_case() == kHeartbeat; +} +inline bool ConnectHostFrame::_internal_has_heartbeat() const { + return payload_case() == kHeartbeat; +} +inline void ConnectHostFrame::set_has_heartbeat() { + _impl_._oneof_case_[0] = kHeartbeat; +} +inline void ConnectHostFrame::clear_heartbeat() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (payload_case() == kHeartbeat) { + if (GetArena() == nullptr) { + delete _impl_.payload_.heartbeat_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.payload_.heartbeat_); + } + clear_has_payload(); + } +} +inline ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE ConnectHostFrame::release_heartbeat() { + // @@protoc_insertion_point(field_release:runanywhere.v1.ConnectHostFrame.heartbeat) + if (payload_case() == kHeartbeat) { + clear_has_payload(); + auto* temp = _impl_.payload_.heartbeat_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.payload_.heartbeat_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::runanywhere::v1::ConnectHeartbeatResponse& ConnectHostFrame::_internal_heartbeat() const { + return payload_case() == kHeartbeat ? static_cast(*_impl_.payload_.heartbeat_) + : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::runanywhere::v1::ConnectHeartbeatResponse>(&::runanywhere::v1::ConnectHeartbeatResponse_globals_); +} +inline const ::runanywhere::v1::ConnectHeartbeatResponse& ConnectHostFrame::heartbeat() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:runanywhere.v1.ConnectHostFrame.heartbeat) + return _internal_heartbeat(); +} +inline ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE ConnectHostFrame::unsafe_arena_release_heartbeat() { + // @@protoc_insertion_point(field_unsafe_arena_release:runanywhere.v1.ConnectHostFrame.heartbeat) + if (payload_case() == kHeartbeat) { + clear_has_payload(); + auto* temp = _impl_.payload_.heartbeat_; + _impl_.payload_.heartbeat_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ConnectHostFrame::unsafe_arena_set_allocated_heartbeat( + ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NULLABLE value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_payload(); + if (value) { + set_has_heartbeat(); + _impl_.payload_.heartbeat_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:runanywhere.v1.ConnectHostFrame.heartbeat) +} +inline ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NONNULL ConnectHostFrame::_internal_mutable_heartbeat() { + if (payload_case() != kHeartbeat) { + clear_payload(); + set_has_heartbeat(); + _impl_.payload_.heartbeat_ = + ::google::protobuf::Message::DefaultConstruct<::runanywhere::v1::ConnectHeartbeatResponse>(GetArena()); + } + return _impl_.payload_.heartbeat_; +} +inline ::runanywhere::v1::ConnectHeartbeatResponse* PROTOBUF_NONNULL ConnectHostFrame::mutable_heartbeat() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::runanywhere::v1::ConnectHeartbeatResponse* _msg = _internal_mutable_heartbeat(); + // @@protoc_insertion_point(field_mutable:runanywhere.v1.ConnectHostFrame.heartbeat) + return _msg; +} + +inline bool ConnectHostFrame::has_payload() const { + return payload_case() != PAYLOAD_NOT_SET; +} +inline void ConnectHostFrame::clear_has_payload() { + _impl_._oneof_case_[0] = PAYLOAD_NOT_SET; +} +inline ConnectHostFrame::PayloadCase ConnectHostFrame::payload_case() const { + return ConnectHostFrame::PayloadCase(_impl_._oneof_case_[0]); +} +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) +} // namespace v1 +} // namespace runanywhere + + +namespace google { +namespace protobuf { + +template <> +struct is_proto_enum<::runanywhere::v1::ConnectPlatform> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::runanywhere::v1::ConnectPlatform>() { + return ::runanywhere::v1::ConnectPlatform_descriptor(); +} +template <> +struct is_proto_enum<::runanywhere::v1::ConnectRoleAvailability> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::runanywhere::v1::ConnectRoleAvailability>() { + return ::runanywhere::v1::ConnectRoleAvailability_descriptor(); +} +template <> +struct is_proto_enum<::runanywhere::v1::ConnectHandshakeStatus> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::runanywhere::v1::ConnectHandshakeStatus>() { + return ::runanywhere::v1::ConnectHandshakeStatus_descriptor(); +} +template <> +struct is_proto_enum<::runanywhere::v1::ConnectSessionState> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::runanywhere::v1::ConnectSessionState>() { + return ::runanywhere::v1::ConnectSessionState_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include "google/protobuf/port_undef.inc" +// clang-format on + +#endif // connect_2eproto_2epb_2eh diff --git a/sdk/runanywhere-commons/src/jni/runanywhere_commons_jni.cpp b/sdk/runanywhere-commons/src/jni/runanywhere_commons_jni.cpp index 21600ac1f7..7bf4e5997d 100644 --- a/sdk/runanywhere-commons/src/jni/runanywhere_commons_jni.cpp +++ b/sdk/runanywhere-commons/src/jni/runanywhere_commons_jni.cpp @@ -62,6 +62,7 @@ #include "../features/vlm/rac_vlm_lifecycle_bridge.h" #include "../infrastructure/http/rac_http_internal.h" +#include "rac/connect/rac_connect.h" #include "rac/core/rac_audio_utils.h" #include "rac/core/rac_core.h" #include "rac/core/rac_error.h" @@ -7799,6 +7800,33 @@ Java_com_runanywhere_sdk_native_bridge_RunAnywhereBridge_racArtifactExpectedFile "racArtifactExpectedFilesProto"); } +// ============================================================================= +// CONNECT CLIENT — commons-owned role policy and handshake validation. +// Android owns discovery and the socket transport, while these proto thunks +// keep platform eligibility, protocol negotiation, and model binding in C++. +// ============================================================================= + +JNIEXPORT jbyteArray JNICALL +Java_com_runanywhere_sdk_native_bridge_RunAnywhereBridge_racConnectGetPlatformPolicyProto( + JNIEnv* env, jclass clazz, jbyteArray requestProto) { + return callProtoBufferFn(env, requestProto, rac_connect_get_platform_policy_proto, + "racConnectGetPlatformPolicyProto"); +} + +JNIEXPORT jbyteArray JNICALL +Java_com_runanywhere_sdk_native_bridge_RunAnywhereBridge_racConnectClientCreateHelloProto( + JNIEnv* env, jclass clazz, jbyteArray requestProto) { + return callProtoBufferFn(env, requestProto, rac_connect_client_create_hello_proto, + "racConnectClientCreateHelloProto"); +} + +JNIEXPORT jbyteArray JNICALL +Java_com_runanywhere_sdk_native_bridge_RunAnywhereBridge_racConnectClientValidateHostProto( + JNIEnv* env, jclass clazz, jbyteArray responseProto) { + return callProtoBufferFn(env, responseProto, rac_connect_client_validate_host_proto, + "racConnectClientValidateHostProto"); +} + // ============================================================================= // TWO-PHASE SDK INIT — rac_sdk_init_phase1_proto / // rac_sdk_init_phase2_proto / rac_sdk_retry_http_proto. Mirrors Swift's diff --git a/sdk/runanywhere-commons/tests/CMakeLists.txt b/sdk/runanywhere-commons/tests/CMakeLists.txt index 7a8b6ffd47..fa81e320f5 100644 --- a/sdk/runanywhere-commons/tests/CMakeLists.txt +++ b/sdk/runanywhere-commons/tests/CMakeLists.txt @@ -63,6 +63,21 @@ function(rac_test_define_have_solutions target) endif() endfunction() +# --- Connect role policy + transport-independent handshake ----------------- +# Covers the shared contract used by Swift, Kotlin, Flutter, and React Native: +# role admission, protocol negotiation, model adoption, and reconnect +# deduplication. Platform discovery/socket adapters are tested in their SDKs. +add_executable(test_connect_proto_abi test_connect_proto_abi.cpp) +target_include_directories(test_connect_proto_abi PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/include +) +target_link_libraries(test_connect_proto_abi PRIVATE rac_commons) +rac_link_archive_deps(test_connect_proto_abi) +target_compile_features(test_connect_proto_abi PRIVATE cxx_std_17) +rac_test_define_have_protobuf(test_connect_proto_abi) +add_test(NAME connect_proto_abi_tests COMMAND test_connect_proto_abi) + set(RAC_COMMONS_THIRD_PARTY_DIR "${CMAKE_CURRENT_LIST_DIR}/../third_party") # Tests may need access to commons private headers (e.g. the internal diff --git a/sdk/runanywhere-commons/tests/test_connect_proto_abi.cpp b/sdk/runanywhere-commons/tests/test_connect_proto_abi.cpp new file mode 100644 index 0000000000..507169b915 --- /dev/null +++ b/sdk/runanywhere-commons/tests/test_connect_proto_abi.cpp @@ -0,0 +1,239 @@ +/** + * @file test_connect_proto_abi.cpp + * @brief Contract tests for the transport-independent Connect policy and handshake. + */ + +#include +#include + +#include "rac/connect/rac_connect.h" +#include "rac/foundation/rac_proto_buffer.h" + +#if defined(RAC_HAVE_PROTOBUF) +#include "connect.pb.h" +#endif + +namespace { + +int g_checks = 0; +int g_failures = 0; + +#define CHECK(condition, label) \ + do { \ + ++g_checks; \ + if (condition) { \ + std::fprintf(stdout, " ok: %s\n", label); \ + } else { \ + ++g_failures; \ + std::fprintf(stderr, " FAIL: %s (%s:%d)\n", label, __FILE__, __LINE__); \ + } \ + } while (0) + +#if defined(RAC_HAVE_PROTOBUF) + +namespace v1 = runanywhere::v1; + +template +rac_result_t call_proto(rac_result_t (*function)(const uint8_t*, size_t, rac_proto_buffer_t*), + const Request& request, Response* response) { + std::string request_bytes; + if (!request.SerializeToString(&request_bytes)) { + return RAC_ERROR_PROCESSING_FAILED; + } + + rac_proto_buffer_t output; + rac_proto_buffer_init(&output); + const rac_result_t result = function(reinterpret_cast(request_bytes.data()), + request_bytes.size(), &output); + if (result == RAC_SUCCESS && response != nullptr) { + if (!response->ParseFromArray(output.data, static_cast(output.size))) { + rac_proto_buffer_free(&output); + return RAC_ERROR_PROCESSING_FAILED; + } + } + rac_proto_buffer_free(&output); + return result; +} + +void check_policy(v1::ConnectPlatform platform, v1::ConnectRoleAvailability expected_host, + v1::ConnectRoleAvailability expected_client, const char* label) { + v1::ConnectPlatformPolicyRequest request; + request.set_platform(platform); + v1::ConnectPlatformPolicy policy; + const rac_result_t result = call_proto(rac_connect_get_platform_policy_proto, request, &policy); + CHECK(result == RAC_SUCCESS, label); + if (result != RAC_SUCCESS) { + return; + } + CHECK(policy.platform() == platform, "Connect policy preserves platform identity"); + CHECK(policy.host_role() == expected_host, "Connect policy exposes expected host role"); + CHECK(policy.client_role() == expected_client, "Connect policy exposes expected client role"); +} + +v1::ConnectHostStartRequest make_host_start(v1::ConnectPlatform platform) { + v1::ConnectHostStartRequest request; + request.set_display_name("Test Host"); + request.set_platform(platform); + request.set_protocol_version(1); + request.mutable_model()->set_model_id("test-model"); + request.mutable_model()->set_display_name("Test Model"); + request.mutable_model()->set_framework("Test Runtime"); + request.mutable_model()->set_context_window(4096); + request.mutable_model()->set_supports_streaming(true); + return request; +} + +v1::ConnectClientHello make_client_hello(v1::ConnectPlatform platform, + const std::string& instance_id = "client-instance") { + v1::ConnectClientHello hello; + hello.set_instance_id(instance_id); + hello.set_display_name("Test Client"); + hello.set_platform(platform); + hello.set_protocol_version(1); + return hello; +} + +void stop_host() { + v1::ConnectHostStopRequest request; + v1::ConnectHostState ignored; + call_proto(rac_connect_host_stop_proto, request, &ignored); +} + +void test_platform_role_policy() { + check_policy(v1::CONNECT_PLATFORM_MACOS, v1::CONNECT_ROLE_AVAILABILITY_ENABLED, + v1::CONNECT_ROLE_AVAILABILITY_DISABLED, "macOS is enabled as host only"); + check_policy(v1::CONNECT_PLATFORM_IOS, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED, "iOS is enabled as client only"); + check_policy(v1::CONNECT_PLATFORM_IPADOS, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED, "iPadOS is enabled as client only"); + check_policy(v1::CONNECT_PLATFORM_ANDROID, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED, "Android is enabled as client only"); + check_policy(v1::CONNECT_PLATFORM_REACT_NATIVE, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED, "React Native is enabled as client only"); + check_policy(v1::CONNECT_PLATFORM_FLUTTER, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_ENABLED, "Flutter is enabled as client only"); + check_policy(v1::CONNECT_PLATFORM_WEB, v1::CONNECT_ROLE_AVAILABILITY_DISABLED, + v1::CONNECT_ROLE_AVAILABILITY_PLANNED, "Web client remains planned"); + check_policy(v1::CONNECT_PLATFORM_WINDOWS, v1::CONNECT_ROLE_AVAILABILITY_PLANNED, + v1::CONNECT_ROLE_AVAILABILITY_PLANNED, "Windows host and client remain planned"); + + v1::ConnectPlatformPolicyRequest unspecified; + v1::ConnectPlatformPolicy ignored; + CHECK(call_proto(rac_connect_get_platform_policy_proto, unspecified, &ignored) == + RAC_ERROR_NOT_SUPPORTED, + "Unspecified platform is rejected"); +} + +void test_client_admission() { + for (const v1::ConnectPlatform platform : + {v1::CONNECT_PLATFORM_IOS, v1::CONNECT_PLATFORM_IPADOS, v1::CONNECT_PLATFORM_ANDROID, + v1::CONNECT_PLATFORM_REACT_NATIVE, v1::CONNECT_PLATFORM_FLUTTER}) { + v1::ConnectClientStartRequest request; + request.set_display_name("Portable Client"); + request.set_platform(platform); + request.set_protocol_version(1); + v1::ConnectClientHello hello; + CHECK(call_proto(rac_connect_client_create_hello_proto, request, &hello) == RAC_SUCCESS, + "Enabled mobile client can create a hello"); + CHECK(!hello.instance_id().empty(), "Commons assigns an ephemeral client instance id"); + CHECK(hello.platform() == platform, "Client hello preserves platform identity"); + } + + for (const v1::ConnectPlatform platform : + {v1::CONNECT_PLATFORM_MACOS, v1::CONNECT_PLATFORM_WEB, v1::CONNECT_PLATFORM_WINDOWS}) { + v1::ConnectClientStartRequest request; + request.set_display_name("Unsupported Client"); + request.set_platform(platform); + request.set_protocol_version(1); + v1::ConnectClientHello ignored; + CHECK(call_proto(rac_connect_client_create_hello_proto, request, &ignored) == + RAC_ERROR_NOT_SUPPORTED, + "Non-enabled client role is rejected by Commons"); + } +} + +void test_host_handshake_and_reconnect_deduplication() { + stop_host(); + + v1::ConnectHostState host_state; + const v1::ConnectHostStartRequest android_host = make_host_start(v1::CONNECT_PLATFORM_ANDROID); + CHECK(call_proto(rac_connect_host_start_proto, android_host, &host_state) == + RAC_ERROR_NOT_SUPPORTED, + "Android cannot start a Connect host"); + + const v1::ConnectHostStartRequest mac_host = make_host_start(v1::CONNECT_PLATFORM_MACOS); + CHECK(call_proto(rac_connect_host_start_proto, mac_host, &host_state) == RAC_SUCCESS, + "macOS can start a Connect host"); + CHECK(host_state.is_hosting(), "Host state becomes active"); + CHECK(host_state.active_client_count() == 0, "New host begins without clients"); + + const v1::ConnectClientHello first_hello = + make_client_hello(v1::CONNECT_PLATFORM_ANDROID, "stable-client-id"); + v1::ConnectHandshakeResponse first_response; + CHECK(call_proto(rac_connect_host_accept_client_proto, first_hello, &first_response) == + RAC_SUCCESS, + "Host processes Android client hello"); + CHECK(first_response.status() == v1::CONNECT_HANDSHAKE_STATUS_ACCEPTED, + "Android client handshake is accepted"); + CHECK(!first_response.session_id().empty(), "Accepted handshake creates a session id"); + + v1::ConnectClientSessionState client_state; + CHECK(call_proto(rac_connect_client_validate_host_proto, first_response, &client_state) == + RAC_SUCCESS, + "Client validates accepted host response"); + CHECK(client_state.state() == v1::CONNECT_SESSION_STATE_CONNECTED, + "Validated client state is connected"); + CHECK(client_state.model().model_id() == "test-model", + "Validated client adopts the host model"); + + v1::ConnectHandshakeResponse reconnect_response; + CHECK(call_proto(rac_connect_host_accept_client_proto, first_hello, &reconnect_response) == + RAC_SUCCESS, + "Same client instance can reconnect"); + CHECK(reconnect_response.session_id() != first_response.session_id(), + "Reconnect replaces the stale session id"); + + v1::ConnectHostState refreshed_state; + CHECK(call_proto(rac_connect_host_start_proto, mac_host, &refreshed_state) == RAC_SUCCESS, + "Active host state can be queried idempotently"); + CHECK(refreshed_state.active_client_count() == 1, + "Reconnect does not inflate connected-device count"); + + v1::ConnectSessionCloseRequest close_request; + close_request.set_session_id(reconnect_response.session_id()); + v1::ConnectHostState closed_state; + CHECK(call_proto(rac_connect_host_close_session_proto, close_request, &closed_state) == + RAC_SUCCESS, + "Active client session closes cleanly"); + CHECK(closed_state.active_client_count() == 0, + "Closing the session decrements connected-device count"); + + v1::ConnectClientHello incompatible = + make_client_hello(v1::CONNECT_PLATFORM_FLUTTER, "flutter-client"); + incompatible.set_protocol_version(2); + v1::ConnectHandshakeResponse rejected; + CHECK(call_proto(rac_connect_host_accept_client_proto, incompatible, &rejected) == RAC_SUCCESS, + "Incompatible handshake returns a typed response"); + CHECK(rejected.status() == v1::CONNECT_HANDSHAKE_STATUS_REJECTED, + "Protocol mismatch is rejected"); + + stop_host(); +} + +#endif + +} // namespace + +int main() { + std::fprintf(stdout, "test_connect_proto_abi\n"); +#if !defined(RAC_HAVE_PROTOBUF) + std::fprintf(stdout, " skip: Connect proto ABI tests (no protobuf)\n"); + return 0; +#else + test_platform_role_policy(); + test_client_admission(); + test_host_handshake_and_reconnect_deduplication(); + std::fprintf(stdout, " %d checks, %d failures\n", g_checks, g_failures); + return g_failures == 0 ? 0 : 1; +#endif +} diff --git a/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/AndroidManifest.xml b/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/AndroidManifest.xml index b1d0eaa8c6..6f8e52039b 100644 --- a/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/AndroidManifest.xml +++ b/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/AndroidManifest.xml @@ -4,6 +4,8 @@ + + diff --git a/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/kotlin/ai/runanywhere/sdk/RunAnywherePlugin.kt b/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/kotlin/ai/runanywhere/sdk/RunAnywherePlugin.kt index 584df22c13..1fb52d36f1 100644 --- a/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/kotlin/ai/runanywhere/sdk/RunAnywherePlugin.kt +++ b/sdk/runanywhere-flutter/packages/runanywhere/android/src/main/kotlin/ai/runanywhere/sdk/RunAnywherePlugin.kt @@ -1,6 +1,8 @@ package ai.runanywhere.sdk import android.os.Build +import android.content.Context +import android.net.wifi.WifiManager import android.util.Log import com.runanywhere.sdk.httptransport.OkHttpHttpTransport import io.flutter.embedding.engine.plugins.FlutterPlugin @@ -17,6 +19,8 @@ import io.flutter.plugin.common.MethodChannel.Result */ class RunAnywherePlugin : FlutterPlugin, MethodCallHandler { private lateinit var channel: MethodChannel + private var multicastLock: WifiManager.MulticastLock? = null + private var applicationContext: Context? = null companion object { private const val TAG = "RunAnywherePlugin" @@ -58,6 +62,7 @@ class RunAnywherePlugin : FlutterPlugin, MethodCallHandler { } override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + applicationContext = flutterPluginBinding.applicationContext try { FlutterSecureStorageBridge.initialize(flutterPluginBinding.applicationContext) } catch (_: Throwable) { @@ -83,6 +88,13 @@ class RunAnywherePlugin : FlutterPlugin, MethodCallHandler { "getSocModel" -> { result.success(getSocModel()) } + "connectAcquireMulticastLock" -> { + result.success(acquireMulticastLock()) + } + "connectReleaseMulticastLock" -> { + releaseMulticastLock() + result.success(null) + } else -> { result.notImplemented() } @@ -90,9 +102,38 @@ class RunAnywherePlugin : FlutterPlugin, MethodCallHandler { } override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + releaseMulticastLock() + applicationContext = null channel.setMethodCallHandler(null) } + /** Allow the SDK's Dart mDNS client to receive multicast packets on Android Wi-Fi. */ + private fun acquireMulticastLock(): Boolean { + if (multicastLock?.isHeld == true) return true + val context = applicationContext ?: return false + val wifiManager = context.getSystemService(Context.WIFI_SERVICE) as? WifiManager ?: return false + return try { + multicastLock = + wifiManager.createMulticastLock("runanywhere-connect-discovery").apply { + setReferenceCounted(false) + acquire() + } + true + } catch (error: Throwable) { + Log.w(TAG, "Unable to acquire Connect multicast lock", error) + multicastLock = null + false + } + } + + private fun releaseMulticastLock() { + val lock = multicastLock + multicastLock = null + if (lock?.isHeld == true) { + runCatching { lock.release() } + } + } + /** * Get the SoC model string for NPU chip detection. * Uses Build.SOC_MODEL (API 31+) with Build.HARDWARE fallback. diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/connect.pb.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/connect.pb.dart new file mode 100644 index 0000000000..4759f53505 --- /dev/null +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/connect.pb.dart @@ -0,0 +1,1623 @@ +// This is a generated file - do not edit. +// +// Generated from connect.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_relative_imports + +import 'dart:core' as $core; + +import 'package:fixnum/fixnum.dart' as $fixnum; +import 'package:protobuf/protobuf.dart' as $pb; + +import 'connect.pbenum.dart'; +import 'llm_service.pb.dart' as $0; + +export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions; + +export 'connect.pbenum.dart'; + +class ConnectPlatformPolicyRequest extends $pb.GeneratedMessage { + factory ConnectPlatformPolicyRequest({ + ConnectPlatform? platform, + }) { + final result = create(); + if (platform != null) result.platform = platform; + return result; + } + + ConnectPlatformPolicyRequest._(); + + factory ConnectPlatformPolicyRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectPlatformPolicyRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectPlatformPolicyRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aE(1, _omitFieldNames ? '' : 'platform', + enumValues: ConnectPlatform.values) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectPlatformPolicyRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectPlatformPolicyRequest copyWith( + void Function(ConnectPlatformPolicyRequest) updates) => + super.copyWith( + (message) => updates(message as ConnectPlatformPolicyRequest)) + as ConnectPlatformPolicyRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectPlatformPolicyRequest create() => + ConnectPlatformPolicyRequest._(); + @$core.override + ConnectPlatformPolicyRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectPlatformPolicyRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectPlatformPolicyRequest? _defaultInstance; + + @$pb.TagNumber(1) + ConnectPlatform get platform => $_getN(0); + @$pb.TagNumber(1) + set platform(ConnectPlatform value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasPlatform() => $_has(0); + @$pb.TagNumber(1) + void clearPlatform() => $_clearField(1); +} + +/// Commons is the authority for this policy. SDKs may query it to shape UI, +/// but every host/client entrypoint also enforces it inside C++. +class ConnectPlatformPolicy extends $pb.GeneratedMessage { + factory ConnectPlatformPolicy({ + ConnectPlatform? platform, + ConnectRoleAvailability? hostRole, + ConnectRoleAvailability? clientRole, + }) { + final result = create(); + if (platform != null) result.platform = platform; + if (hostRole != null) result.hostRole = hostRole; + if (clientRole != null) result.clientRole = clientRole; + return result; + } + + ConnectPlatformPolicy._(); + + factory ConnectPlatformPolicy.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectPlatformPolicy.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectPlatformPolicy', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aE(1, _omitFieldNames ? '' : 'platform', + enumValues: ConnectPlatform.values) + ..aE(2, _omitFieldNames ? '' : 'hostRole', + enumValues: ConnectRoleAvailability.values) + ..aE(3, _omitFieldNames ? '' : 'clientRole', + enumValues: ConnectRoleAvailability.values) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectPlatformPolicy clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectPlatformPolicy copyWith( + void Function(ConnectPlatformPolicy) updates) => + super.copyWith((message) => updates(message as ConnectPlatformPolicy)) + as ConnectPlatformPolicy; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectPlatformPolicy create() => ConnectPlatformPolicy._(); + @$core.override + ConnectPlatformPolicy createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectPlatformPolicy getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectPlatformPolicy? _defaultInstance; + + @$pb.TagNumber(1) + ConnectPlatform get platform => $_getN(0); + @$pb.TagNumber(1) + set platform(ConnectPlatform value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasPlatform() => $_has(0); + @$pb.TagNumber(1) + void clearPlatform() => $_clearField(1); + + @$pb.TagNumber(2) + ConnectRoleAvailability get hostRole => $_getN(1); + @$pb.TagNumber(2) + set hostRole(ConnectRoleAvailability value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasHostRole() => $_has(1); + @$pb.TagNumber(2) + void clearHostRole() => $_clearField(2); + + @$pb.TagNumber(3) + ConnectRoleAvailability get clientRole => $_getN(2); + @$pb.TagNumber(3) + set clientRole(ConnectRoleAvailability value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasClientRole() => $_has(2); + @$pb.TagNumber(3) + void clearClientRole() => $_clearField(3); +} + +/// Non-secret metadata published through LAN service discovery and echoed by +/// the handshake. `instance_id` is generated anew whenever the host starts; +/// it is not a persistent device identifier or a credential. +class ConnectDiscoveryMetadata extends $pb.GeneratedMessage { + factory ConnectDiscoveryMetadata({ + $core.String? instanceId, + $core.String? displayName, + ConnectPlatform? platform, + $core.int? protocolVersion, + }) { + final result = create(); + if (instanceId != null) result.instanceId = instanceId; + if (displayName != null) result.displayName = displayName; + if (platform != null) result.platform = platform; + if (protocolVersion != null) result.protocolVersion = protocolVersion; + return result; + } + + ConnectDiscoveryMetadata._(); + + factory ConnectDiscoveryMetadata.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectDiscoveryMetadata.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectDiscoveryMetadata', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'instanceId') + ..aOS(2, _omitFieldNames ? '' : 'displayName') + ..aE(3, _omitFieldNames ? '' : 'platform', + enumValues: ConnectPlatform.values) + ..aI(4, _omitFieldNames ? '' : 'protocolVersion', + fieldType: $pb.PbFieldType.OU3) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectDiscoveryMetadata clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectDiscoveryMetadata copyWith( + void Function(ConnectDiscoveryMetadata) updates) => + super.copyWith((message) => updates(message as ConnectDiscoveryMetadata)) + as ConnectDiscoveryMetadata; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectDiscoveryMetadata create() => ConnectDiscoveryMetadata._(); + @$core.override + ConnectDiscoveryMetadata createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectDiscoveryMetadata getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectDiscoveryMetadata? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get instanceId => $_getSZ(0); + @$pb.TagNumber(1) + set instanceId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasInstanceId() => $_has(0); + @$pb.TagNumber(1) + void clearInstanceId() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get displayName => $_getSZ(1); + @$pb.TagNumber(2) + set displayName($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasDisplayName() => $_has(1); + @$pb.TagNumber(2) + void clearDisplayName() => $_clearField(2); + + @$pb.TagNumber(3) + ConnectPlatform get platform => $_getN(2); + @$pb.TagNumber(3) + set platform(ConnectPlatform value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasPlatform() => $_has(2); + @$pb.TagNumber(3) + void clearPlatform() => $_clearField(3); + + @$pb.TagNumber(4) + $core.int get protocolVersion => $_getIZ(3); + @$pb.TagNumber(4) + set protocolVersion($core.int value) => $_setUnsignedInt32(3, value); + @$pb.TagNumber(4) + $core.bool hasProtocolVersion() => $_has(3); + @$pb.TagNumber(4) + void clearProtocolVersion() => $_clearField(4); +} + +/// The single language model currently shared by a host. A host must select a +/// loaded model before it starts publishing; this lets clients enter chat +/// immediately without downloading or selecting a local model. +class ConnectModelDescriptor extends $pb.GeneratedMessage { + factory ConnectModelDescriptor({ + $core.String? modelId, + $core.String? displayName, + $core.String? framework, + $core.int? contextWindow, + $core.bool? supportsStreaming, + }) { + final result = create(); + if (modelId != null) result.modelId = modelId; + if (displayName != null) result.displayName = displayName; + if (framework != null) result.framework = framework; + if (contextWindow != null) result.contextWindow = contextWindow; + if (supportsStreaming != null) result.supportsStreaming = supportsStreaming; + return result; + } + + ConnectModelDescriptor._(); + + factory ConnectModelDescriptor.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectModelDescriptor.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectModelDescriptor', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'modelId') + ..aOS(2, _omitFieldNames ? '' : 'displayName') + ..aOS(3, _omitFieldNames ? '' : 'framework') + ..aI(4, _omitFieldNames ? '' : 'contextWindow', + fieldType: $pb.PbFieldType.OU3) + ..aOB(5, _omitFieldNames ? '' : 'supportsStreaming') + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectModelDescriptor clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectModelDescriptor copyWith( + void Function(ConnectModelDescriptor) updates) => + super.copyWith((message) => updates(message as ConnectModelDescriptor)) + as ConnectModelDescriptor; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectModelDescriptor create() => ConnectModelDescriptor._(); + @$core.override + ConnectModelDescriptor createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectModelDescriptor getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectModelDescriptor? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get modelId => $_getSZ(0); + @$pb.TagNumber(1) + set modelId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasModelId() => $_has(0); + @$pb.TagNumber(1) + void clearModelId() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get displayName => $_getSZ(1); + @$pb.TagNumber(2) + set displayName($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasDisplayName() => $_has(1); + @$pb.TagNumber(2) + void clearDisplayName() => $_clearField(2); + + @$pb.TagNumber(3) + $core.String get framework => $_getSZ(2); + @$pb.TagNumber(3) + set framework($core.String value) => $_setString(2, value); + @$pb.TagNumber(3) + $core.bool hasFramework() => $_has(2); + @$pb.TagNumber(3) + void clearFramework() => $_clearField(3); + + @$pb.TagNumber(4) + $core.int get contextWindow => $_getIZ(3); + @$pb.TagNumber(4) + set contextWindow($core.int value) => $_setUnsignedInt32(3, value); + @$pb.TagNumber(4) + $core.bool hasContextWindow() => $_has(3); + @$pb.TagNumber(4) + void clearContextWindow() => $_clearField(4); + + @$pb.TagNumber(5) + $core.bool get supportsStreaming => $_getBF(4); + @$pb.TagNumber(5) + set supportsStreaming($core.bool value) => $_setBool(4, value); + @$pb.TagNumber(5) + $core.bool hasSupportsStreaming() => $_has(4); + @$pb.TagNumber(5) + void clearSupportsStreaming() => $_clearField(5); +} + +class ConnectHostStartRequest extends $pb.GeneratedMessage { + factory ConnectHostStartRequest({ + $core.String? displayName, + ConnectPlatform? platform, + $core.int? protocolVersion, + ConnectModelDescriptor? model, + }) { + final result = create(); + if (displayName != null) result.displayName = displayName; + if (platform != null) result.platform = platform; + if (protocolVersion != null) result.protocolVersion = protocolVersion; + if (model != null) result.model = model; + return result; + } + + ConnectHostStartRequest._(); + + factory ConnectHostStartRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHostStartRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHostStartRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'displayName') + ..aE(2, _omitFieldNames ? '' : 'platform', + enumValues: ConnectPlatform.values) + ..aI(3, _omitFieldNames ? '' : 'protocolVersion', + fieldType: $pb.PbFieldType.OU3) + ..aOM(4, _omitFieldNames ? '' : 'model', + subBuilder: ConnectModelDescriptor.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostStartRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostStartRequest copyWith( + void Function(ConnectHostStartRequest) updates) => + super.copyWith((message) => updates(message as ConnectHostStartRequest)) + as ConnectHostStartRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHostStartRequest create() => ConnectHostStartRequest._(); + @$core.override + ConnectHostStartRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHostStartRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHostStartRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get displayName => $_getSZ(0); + @$pb.TagNumber(1) + set displayName($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasDisplayName() => $_has(0); + @$pb.TagNumber(1) + void clearDisplayName() => $_clearField(1); + + @$pb.TagNumber(2) + ConnectPlatform get platform => $_getN(1); + @$pb.TagNumber(2) + set platform(ConnectPlatform value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasPlatform() => $_has(1); + @$pb.TagNumber(2) + void clearPlatform() => $_clearField(2); + + @$pb.TagNumber(3) + $core.int get protocolVersion => $_getIZ(2); + @$pb.TagNumber(3) + set protocolVersion($core.int value) => $_setUnsignedInt32(2, value); + @$pb.TagNumber(3) + $core.bool hasProtocolVersion() => $_has(2); + @$pb.TagNumber(3) + void clearProtocolVersion() => $_clearField(3); + + @$pb.TagNumber(4) + ConnectModelDescriptor get model => $_getN(3); + @$pb.TagNumber(4) + set model(ConnectModelDescriptor value) => $_setField(4, value); + @$pb.TagNumber(4) + $core.bool hasModel() => $_has(3); + @$pb.TagNumber(4) + void clearModel() => $_clearField(4); + @$pb.TagNumber(4) + ConnectModelDescriptor ensureModel() => $_ensure(3); +} + +class ConnectHostStopRequest extends $pb.GeneratedMessage { + factory ConnectHostStopRequest() => create(); + + ConnectHostStopRequest._(); + + factory ConnectHostStopRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHostStopRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHostStopRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostStopRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostStopRequest copyWith( + void Function(ConnectHostStopRequest) updates) => + super.copyWith((message) => updates(message as ConnectHostStopRequest)) + as ConnectHostStopRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHostStopRequest create() => ConnectHostStopRequest._(); + @$core.override + ConnectHostStopRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHostStopRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHostStopRequest? _defaultInstance; +} + +class ConnectHostState extends $pb.GeneratedMessage { + factory ConnectHostState({ + $core.bool? isHosting, + ConnectDiscoveryMetadata? discoveryMetadata, + $core.int? activeClientCount, + $core.String? errorMessage, + ConnectModelDescriptor? model, + }) { + final result = create(); + if (isHosting != null) result.isHosting = isHosting; + if (discoveryMetadata != null) result.discoveryMetadata = discoveryMetadata; + if (activeClientCount != null) result.activeClientCount = activeClientCount; + if (errorMessage != null) result.errorMessage = errorMessage; + if (model != null) result.model = model; + return result; + } + + ConnectHostState._(); + + factory ConnectHostState.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHostState.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHostState', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOB(1, _omitFieldNames ? '' : 'isHosting') + ..aOM( + 2, _omitFieldNames ? '' : 'discoveryMetadata', + subBuilder: ConnectDiscoveryMetadata.create) + ..aI(3, _omitFieldNames ? '' : 'activeClientCount', + fieldType: $pb.PbFieldType.OU3) + ..aOS(4, _omitFieldNames ? '' : 'errorMessage') + ..aOM(5, _omitFieldNames ? '' : 'model', + subBuilder: ConnectModelDescriptor.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostState clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostState copyWith(void Function(ConnectHostState) updates) => + super.copyWith((message) => updates(message as ConnectHostState)) + as ConnectHostState; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHostState create() => ConnectHostState._(); + @$core.override + ConnectHostState createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHostState getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHostState? _defaultInstance; + + @$pb.TagNumber(1) + $core.bool get isHosting => $_getBF(0); + @$pb.TagNumber(1) + set isHosting($core.bool value) => $_setBool(0, value); + @$pb.TagNumber(1) + $core.bool hasIsHosting() => $_has(0); + @$pb.TagNumber(1) + void clearIsHosting() => $_clearField(1); + + @$pb.TagNumber(2) + ConnectDiscoveryMetadata get discoveryMetadata => $_getN(1); + @$pb.TagNumber(2) + set discoveryMetadata(ConnectDiscoveryMetadata value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasDiscoveryMetadata() => $_has(1); + @$pb.TagNumber(2) + void clearDiscoveryMetadata() => $_clearField(2); + @$pb.TagNumber(2) + ConnectDiscoveryMetadata ensureDiscoveryMetadata() => $_ensure(1); + + @$pb.TagNumber(3) + $core.int get activeClientCount => $_getIZ(2); + @$pb.TagNumber(3) + set activeClientCount($core.int value) => $_setUnsignedInt32(2, value); + @$pb.TagNumber(3) + $core.bool hasActiveClientCount() => $_has(2); + @$pb.TagNumber(3) + void clearActiveClientCount() => $_clearField(3); + + @$pb.TagNumber(4) + $core.String get errorMessage => $_getSZ(3); + @$pb.TagNumber(4) + set errorMessage($core.String value) => $_setString(3, value); + @$pb.TagNumber(4) + $core.bool hasErrorMessage() => $_has(3); + @$pb.TagNumber(4) + void clearErrorMessage() => $_clearField(4); + + @$pb.TagNumber(5) + ConnectModelDescriptor get model => $_getN(4); + @$pb.TagNumber(5) + set model(ConnectModelDescriptor value) => $_setField(5, value); + @$pb.TagNumber(5) + $core.bool hasModel() => $_has(4); + @$pb.TagNumber(5) + void clearModel() => $_clearField(5); + @$pb.TagNumber(5) + ConnectModelDescriptor ensureModel() => $_ensure(4); +} + +class ConnectClientStartRequest extends $pb.GeneratedMessage { + factory ConnectClientStartRequest({ + $core.String? displayName, + ConnectPlatform? platform, + $core.int? protocolVersion, + }) { + final result = create(); + if (displayName != null) result.displayName = displayName; + if (platform != null) result.platform = platform; + if (protocolVersion != null) result.protocolVersion = protocolVersion; + return result; + } + + ConnectClientStartRequest._(); + + factory ConnectClientStartRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectClientStartRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectClientStartRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'displayName') + ..aE(2, _omitFieldNames ? '' : 'platform', + enumValues: ConnectPlatform.values) + ..aI(3, _omitFieldNames ? '' : 'protocolVersion', + fieldType: $pb.PbFieldType.OU3) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientStartRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientStartRequest copyWith( + void Function(ConnectClientStartRequest) updates) => + super.copyWith((message) => updates(message as ConnectClientStartRequest)) + as ConnectClientStartRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectClientStartRequest create() => ConnectClientStartRequest._(); + @$core.override + ConnectClientStartRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectClientStartRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectClientStartRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get displayName => $_getSZ(0); + @$pb.TagNumber(1) + set displayName($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasDisplayName() => $_has(0); + @$pb.TagNumber(1) + void clearDisplayName() => $_clearField(1); + + @$pb.TagNumber(2) + ConnectPlatform get platform => $_getN(1); + @$pb.TagNumber(2) + set platform(ConnectPlatform value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasPlatform() => $_has(1); + @$pb.TagNumber(2) + void clearPlatform() => $_clearField(2); + + @$pb.TagNumber(3) + $core.int get protocolVersion => $_getIZ(2); + @$pb.TagNumber(3) + set protocolVersion($core.int value) => $_setUnsignedInt32(2, value); + @$pb.TagNumber(3) + $core.bool hasProtocolVersion() => $_has(2); + @$pb.TagNumber(3) + void clearProtocolVersion() => $_clearField(3); +} + +/// Sent by a client immediately after the platform transport is connected. +class ConnectClientHello extends $pb.GeneratedMessage { + factory ConnectClientHello({ + $core.String? instanceId, + $core.String? displayName, + ConnectPlatform? platform, + $core.int? protocolVersion, + }) { + final result = create(); + if (instanceId != null) result.instanceId = instanceId; + if (displayName != null) result.displayName = displayName; + if (platform != null) result.platform = platform; + if (protocolVersion != null) result.protocolVersion = protocolVersion; + return result; + } + + ConnectClientHello._(); + + factory ConnectClientHello.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectClientHello.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectClientHello', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'instanceId') + ..aOS(2, _omitFieldNames ? '' : 'displayName') + ..aE(3, _omitFieldNames ? '' : 'platform', + enumValues: ConnectPlatform.values) + ..aI(4, _omitFieldNames ? '' : 'protocolVersion', + fieldType: $pb.PbFieldType.OU3) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientHello clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientHello copyWith(void Function(ConnectClientHello) updates) => + super.copyWith((message) => updates(message as ConnectClientHello)) + as ConnectClientHello; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectClientHello create() => ConnectClientHello._(); + @$core.override + ConnectClientHello createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectClientHello getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectClientHello? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get instanceId => $_getSZ(0); + @$pb.TagNumber(1) + set instanceId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasInstanceId() => $_has(0); + @$pb.TagNumber(1) + void clearInstanceId() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get displayName => $_getSZ(1); + @$pb.TagNumber(2) + set displayName($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasDisplayName() => $_has(1); + @$pb.TagNumber(2) + void clearDisplayName() => $_clearField(2); + + @$pb.TagNumber(3) + ConnectPlatform get platform => $_getN(2); + @$pb.TagNumber(3) + set platform(ConnectPlatform value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasPlatform() => $_has(2); + @$pb.TagNumber(3) + void clearPlatform() => $_clearField(3); + + @$pb.TagNumber(4) + $core.int get protocolVersion => $_getIZ(3); + @$pb.TagNumber(4) + set protocolVersion($core.int value) => $_setUnsignedInt32(3, value); + @$pb.TagNumber(4) + $core.bool hasProtocolVersion() => $_has(3); + @$pb.TagNumber(4) + void clearProtocolVersion() => $_clearField(4); +} + +/// Sent by the host after commons has accepted or rejected a client hello. +class ConnectHandshakeResponse extends $pb.GeneratedMessage { + factory ConnectHandshakeResponse({ + ConnectHandshakeStatus? status, + $core.String? sessionId, + ConnectDiscoveryMetadata? host, + $core.String? rejectionReason, + ConnectModelDescriptor? model, + }) { + final result = create(); + if (status != null) result.status = status; + if (sessionId != null) result.sessionId = sessionId; + if (host != null) result.host = host; + if (rejectionReason != null) result.rejectionReason = rejectionReason; + if (model != null) result.model = model; + return result; + } + + ConnectHandshakeResponse._(); + + factory ConnectHandshakeResponse.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHandshakeResponse.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHandshakeResponse', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aE(1, _omitFieldNames ? '' : 'status', + enumValues: ConnectHandshakeStatus.values) + ..aOS(2, _omitFieldNames ? '' : 'sessionId') + ..aOM(3, _omitFieldNames ? '' : 'host', + subBuilder: ConnectDiscoveryMetadata.create) + ..aOS(4, _omitFieldNames ? '' : 'rejectionReason') + ..aOM(5, _omitFieldNames ? '' : 'model', + subBuilder: ConnectModelDescriptor.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHandshakeResponse clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHandshakeResponse copyWith( + void Function(ConnectHandshakeResponse) updates) => + super.copyWith((message) => updates(message as ConnectHandshakeResponse)) + as ConnectHandshakeResponse; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHandshakeResponse create() => ConnectHandshakeResponse._(); + @$core.override + ConnectHandshakeResponse createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHandshakeResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHandshakeResponse? _defaultInstance; + + @$pb.TagNumber(1) + ConnectHandshakeStatus get status => $_getN(0); + @$pb.TagNumber(1) + set status(ConnectHandshakeStatus value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasStatus() => $_has(0); + @$pb.TagNumber(1) + void clearStatus() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get sessionId => $_getSZ(1); + @$pb.TagNumber(2) + set sessionId($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasSessionId() => $_has(1); + @$pb.TagNumber(2) + void clearSessionId() => $_clearField(2); + + @$pb.TagNumber(3) + ConnectDiscoveryMetadata get host => $_getN(2); + @$pb.TagNumber(3) + set host(ConnectDiscoveryMetadata value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasHost() => $_has(2); + @$pb.TagNumber(3) + void clearHost() => $_clearField(3); + @$pb.TagNumber(3) + ConnectDiscoveryMetadata ensureHost() => $_ensure(2); + + @$pb.TagNumber(4) + $core.String get rejectionReason => $_getSZ(3); + @$pb.TagNumber(4) + set rejectionReason($core.String value) => $_setString(3, value); + @$pb.TagNumber(4) + $core.bool hasRejectionReason() => $_has(3); + @$pb.TagNumber(4) + void clearRejectionReason() => $_clearField(4); + + @$pb.TagNumber(5) + ConnectModelDescriptor get model => $_getN(4); + @$pb.TagNumber(5) + set model(ConnectModelDescriptor value) => $_setField(5, value); + @$pb.TagNumber(5) + $core.bool hasModel() => $_has(4); + @$pb.TagNumber(5) + void clearModel() => $_clearField(5); + @$pb.TagNumber(5) + ConnectModelDescriptor ensureModel() => $_ensure(4); +} + +/// The client validates the host response through commons and receives the +/// public session state it can expose to its platform UI. +class ConnectClientSessionState extends $pb.GeneratedMessage { + factory ConnectClientSessionState({ + ConnectSessionState? state, + $core.String? sessionId, + ConnectDiscoveryMetadata? host, + $core.String? errorMessage, + ConnectModelDescriptor? model, + }) { + final result = create(); + if (state != null) result.state = state; + if (sessionId != null) result.sessionId = sessionId; + if (host != null) result.host = host; + if (errorMessage != null) result.errorMessage = errorMessage; + if (model != null) result.model = model; + return result; + } + + ConnectClientSessionState._(); + + factory ConnectClientSessionState.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectClientSessionState.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectClientSessionState', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aE(1, _omitFieldNames ? '' : 'state', + enumValues: ConnectSessionState.values) + ..aOS(2, _omitFieldNames ? '' : 'sessionId') + ..aOM(3, _omitFieldNames ? '' : 'host', + subBuilder: ConnectDiscoveryMetadata.create) + ..aOS(4, _omitFieldNames ? '' : 'errorMessage') + ..aOM(5, _omitFieldNames ? '' : 'model', + subBuilder: ConnectModelDescriptor.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientSessionState clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientSessionState copyWith( + void Function(ConnectClientSessionState) updates) => + super.copyWith((message) => updates(message as ConnectClientSessionState)) + as ConnectClientSessionState; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectClientSessionState create() => ConnectClientSessionState._(); + @$core.override + ConnectClientSessionState createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectClientSessionState getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectClientSessionState? _defaultInstance; + + @$pb.TagNumber(1) + ConnectSessionState get state => $_getN(0); + @$pb.TagNumber(1) + set state(ConnectSessionState value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasState() => $_has(0); + @$pb.TagNumber(1) + void clearState() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get sessionId => $_getSZ(1); + @$pb.TagNumber(2) + set sessionId($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasSessionId() => $_has(1); + @$pb.TagNumber(2) + void clearSessionId() => $_clearField(2); + + @$pb.TagNumber(3) + ConnectDiscoveryMetadata get host => $_getN(2); + @$pb.TagNumber(3) + set host(ConnectDiscoveryMetadata value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasHost() => $_has(2); + @$pb.TagNumber(3) + void clearHost() => $_clearField(3); + @$pb.TagNumber(3) + ConnectDiscoveryMetadata ensureHost() => $_ensure(2); + + @$pb.TagNumber(4) + $core.String get errorMessage => $_getSZ(3); + @$pb.TagNumber(4) + set errorMessage($core.String value) => $_setString(3, value); + @$pb.TagNumber(4) + $core.bool hasErrorMessage() => $_has(3); + @$pb.TagNumber(4) + void clearErrorMessage() => $_clearField(4); + + @$pb.TagNumber(5) + ConnectModelDescriptor get model => $_getN(4); + @$pb.TagNumber(5) + set model(ConnectModelDescriptor value) => $_setField(5, value); + @$pb.TagNumber(5) + $core.bool hasModel() => $_has(4); + @$pb.TagNumber(5) + void clearModel() => $_clearField(5); + @$pb.TagNumber(5) + ConnectModelDescriptor ensureModel() => $_ensure(4); +} + +class ConnectSessionCloseRequest extends $pb.GeneratedMessage { + factory ConnectSessionCloseRequest({ + $core.String? sessionId, + }) { + final result = create(); + if (sessionId != null) result.sessionId = sessionId; + return result; + } + + ConnectSessionCloseRequest._(); + + factory ConnectSessionCloseRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectSessionCloseRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectSessionCloseRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'sessionId') + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectSessionCloseRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectSessionCloseRequest copyWith( + void Function(ConnectSessionCloseRequest) updates) => + super.copyWith( + (message) => updates(message as ConnectSessionCloseRequest)) + as ConnectSessionCloseRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectSessionCloseRequest create() => ConnectSessionCloseRequest._(); + @$core.override + ConnectSessionCloseRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectSessionCloseRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectSessionCloseRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get sessionId => $_getSZ(0); + @$pb.TagNumber(1) + set sessionId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasSessionId() => $_has(0); + @$pb.TagNumber(1) + void clearSessionId() => $_clearField(1); +} + +/// A client sends the existing typed LLM request to the selected host model. +/// `session_id` binds the request to the prior handshake; `generation.model_id` +/// must match the model the host published for that session. +class ConnectInvocationRequest extends $pb.GeneratedMessage { + factory ConnectInvocationRequest({ + $core.String? sessionId, + $core.String? requestId, + $0.LLMGenerateRequest? generation, + }) { + final result = create(); + if (sessionId != null) result.sessionId = sessionId; + if (requestId != null) result.requestId = requestId; + if (generation != null) result.generation = generation; + return result; + } + + ConnectInvocationRequest._(); + + factory ConnectInvocationRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectInvocationRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectInvocationRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'sessionId') + ..aOS(2, _omitFieldNames ? '' : 'requestId') + ..aOM<$0.LLMGenerateRequest>(3, _omitFieldNames ? '' : 'generation', + subBuilder: $0.LLMGenerateRequest.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectInvocationRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectInvocationRequest copyWith( + void Function(ConnectInvocationRequest) updates) => + super.copyWith((message) => updates(message as ConnectInvocationRequest)) + as ConnectInvocationRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectInvocationRequest create() => ConnectInvocationRequest._(); + @$core.override + ConnectInvocationRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectInvocationRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectInvocationRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get sessionId => $_getSZ(0); + @$pb.TagNumber(1) + set sessionId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasSessionId() => $_has(0); + @$pb.TagNumber(1) + void clearSessionId() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get requestId => $_getSZ(1); + @$pb.TagNumber(2) + set requestId($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasRequestId() => $_has(1); + @$pb.TagNumber(2) + void clearRequestId() => $_clearField(2); + + @$pb.TagNumber(3) + $0.LLMGenerateRequest get generation => $_getN(2); + @$pb.TagNumber(3) + set generation($0.LLMGenerateRequest value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasGeneration() => $_has(2); + @$pb.TagNumber(3) + void clearGeneration() => $_clearField(3); + @$pb.TagNumber(3) + $0.LLMGenerateRequest ensureGeneration() => $_ensure(2); +} + +/// Commons validates that an invocation belongs to an active session and uses +/// the host's published model before any platform runtime receives the prompt. +class ConnectInvocationValidation extends $pb.GeneratedMessage { + factory ConnectInvocationValidation({ + $core.bool? accepted, + $core.String? rejectionReason, + }) { + final result = create(); + if (accepted != null) result.accepted = accepted; + if (rejectionReason != null) result.rejectionReason = rejectionReason; + return result; + } + + ConnectInvocationValidation._(); + + factory ConnectInvocationValidation.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectInvocationValidation.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectInvocationValidation', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOB(1, _omitFieldNames ? '' : 'accepted') + ..aOS(2, _omitFieldNames ? '' : 'rejectionReason') + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectInvocationValidation clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectInvocationValidation copyWith( + void Function(ConnectInvocationValidation) updates) => + super.copyWith( + (message) => updates(message as ConnectInvocationValidation)) + as ConnectInvocationValidation; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectInvocationValidation create() => + ConnectInvocationValidation._(); + @$core.override + ConnectInvocationValidation createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectInvocationValidation getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectInvocationValidation? _defaultInstance; + + @$pb.TagNumber(1) + $core.bool get accepted => $_getBF(0); + @$pb.TagNumber(1) + set accepted($core.bool value) => $_setBool(0, value); + @$pb.TagNumber(1) + $core.bool hasAccepted() => $_has(0); + @$pb.TagNumber(1) + void clearAccepted() => $_clearField(1); + + @$pb.TagNumber(2) + $core.String get rejectionReason => $_getSZ(1); + @$pb.TagNumber(2) + set rejectionReason($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasRejectionReason() => $_has(1); + @$pb.TagNumber(2) + void clearRejectionReason() => $_clearField(2); +} + +/// Hosts forward the SDK's canonical stream events without translating them to +/// a platform-specific token shape. This is the portable streaming surface for +/// future Kotlin, React Native, Flutter, and Web clients. +class ConnectInvocationEvent extends $pb.GeneratedMessage { + factory ConnectInvocationEvent({ + $core.String? requestId, + $0.LLMStreamEvent? event, + }) { + final result = create(); + if (requestId != null) result.requestId = requestId; + if (event != null) result.event = event; + return result; + } + + ConnectInvocationEvent._(); + + factory ConnectInvocationEvent.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectInvocationEvent.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectInvocationEvent', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'requestId') + ..aOM<$0.LLMStreamEvent>(2, _omitFieldNames ? '' : 'event', + subBuilder: $0.LLMStreamEvent.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectInvocationEvent clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectInvocationEvent copyWith( + void Function(ConnectInvocationEvent) updates) => + super.copyWith((message) => updates(message as ConnectInvocationEvent)) + as ConnectInvocationEvent; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectInvocationEvent create() => ConnectInvocationEvent._(); + @$core.override + ConnectInvocationEvent createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectInvocationEvent getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectInvocationEvent? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get requestId => $_getSZ(0); + @$pb.TagNumber(1) + set requestId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasRequestId() => $_has(0); + @$pb.TagNumber(1) + void clearRequestId() => $_clearField(1); + + @$pb.TagNumber(2) + $0.LLMStreamEvent get event => $_getN(1); + @$pb.TagNumber(2) + set event($0.LLMStreamEvent value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasEvent() => $_has(1); + @$pb.TagNumber(2) + void clearEvent() => $_clearField(2); + @$pb.TagNumber(2) + $0.LLMStreamEvent ensureEvent() => $_ensure(1); +} + +/// The connection stays open between generations, so the client needs a +/// control-plane exchange that can detect a host stopped while chat is idle. +/// These frames deliberately remain separate from LLM invocation payloads: +/// a health check must never reach a model or appear as an assistant message. +class ConnectHeartbeatRequest extends $pb.GeneratedMessage { + factory ConnectHeartbeatRequest({ + $core.String? sessionId, + $fixnum.Int64? sequence, + }) { + final result = create(); + if (sessionId != null) result.sessionId = sessionId; + if (sequence != null) result.sequence = sequence; + return result; + } + + ConnectHeartbeatRequest._(); + + factory ConnectHeartbeatRequest.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHeartbeatRequest.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHeartbeatRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'sessionId') + ..a<$fixnum.Int64>( + 2, _omitFieldNames ? '' : 'sequence', $pb.PbFieldType.OU6, + defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHeartbeatRequest clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHeartbeatRequest copyWith( + void Function(ConnectHeartbeatRequest) updates) => + super.copyWith((message) => updates(message as ConnectHeartbeatRequest)) + as ConnectHeartbeatRequest; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHeartbeatRequest create() => ConnectHeartbeatRequest._(); + @$core.override + ConnectHeartbeatRequest createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHeartbeatRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHeartbeatRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get sessionId => $_getSZ(0); + @$pb.TagNumber(1) + set sessionId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasSessionId() => $_has(0); + @$pb.TagNumber(1) + void clearSessionId() => $_clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get sequence => $_getI64(1); + @$pb.TagNumber(2) + set sequence($fixnum.Int64 value) => $_setInt64(1, value); + @$pb.TagNumber(2) + $core.bool hasSequence() => $_has(1); + @$pb.TagNumber(2) + void clearSequence() => $_clearField(2); +} + +class ConnectHeartbeatResponse extends $pb.GeneratedMessage { + factory ConnectHeartbeatResponse({ + $core.String? sessionId, + $fixnum.Int64? sequence, + }) { + final result = create(); + if (sessionId != null) result.sessionId = sessionId; + if (sequence != null) result.sequence = sequence; + return result; + } + + ConnectHeartbeatResponse._(); + + factory ConnectHeartbeatResponse.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHeartbeatResponse.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHeartbeatResponse', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'sessionId') + ..a<$fixnum.Int64>( + 2, _omitFieldNames ? '' : 'sequence', $pb.PbFieldType.OU6, + defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHeartbeatResponse clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHeartbeatResponse copyWith( + void Function(ConnectHeartbeatResponse) updates) => + super.copyWith((message) => updates(message as ConnectHeartbeatResponse)) + as ConnectHeartbeatResponse; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHeartbeatResponse create() => ConnectHeartbeatResponse._(); + @$core.override + ConnectHeartbeatResponse createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHeartbeatResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHeartbeatResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get sessionId => $_getSZ(0); + @$pb.TagNumber(1) + set sessionId($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasSessionId() => $_has(0); + @$pb.TagNumber(1) + void clearSessionId() => $_clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get sequence => $_getI64(1); + @$pb.TagNumber(2) + set sequence($fixnum.Int64 value) => $_setInt64(1, value); + @$pb.TagNumber(2) + $core.bool hasSequence() => $_has(1); + @$pb.TagNumber(2) + void clearSequence() => $_clearField(2); +} + +enum ConnectClientFrame_Payload { invocation, heartbeat, notSet } + +/// Every frame after the initial ClientHello handshake is carried in one of +/// these explicit envelopes. This leaves typed inference traffic untouched +/// while allowing clients to verify an otherwise-idle host connection. +class ConnectClientFrame extends $pb.GeneratedMessage { + factory ConnectClientFrame({ + ConnectInvocationRequest? invocation, + ConnectHeartbeatRequest? heartbeat, + }) { + final result = create(); + if (invocation != null) result.invocation = invocation; + if (heartbeat != null) result.heartbeat = heartbeat; + return result; + } + + ConnectClientFrame._(); + + factory ConnectClientFrame.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectClientFrame.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static const $core.Map<$core.int, ConnectClientFrame_Payload> + _ConnectClientFrame_PayloadByTag = { + 1: ConnectClientFrame_Payload.invocation, + 2: ConnectClientFrame_Payload.heartbeat, + 0: ConnectClientFrame_Payload.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectClientFrame', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..oo(0, [1, 2]) + ..aOM(1, _omitFieldNames ? '' : 'invocation', + subBuilder: ConnectInvocationRequest.create) + ..aOM(2, _omitFieldNames ? '' : 'heartbeat', + subBuilder: ConnectHeartbeatRequest.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientFrame clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectClientFrame copyWith(void Function(ConnectClientFrame) updates) => + super.copyWith((message) => updates(message as ConnectClientFrame)) + as ConnectClientFrame; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectClientFrame create() => ConnectClientFrame._(); + @$core.override + ConnectClientFrame createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectClientFrame getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectClientFrame? _defaultInstance; + + @$pb.TagNumber(1) + @$pb.TagNumber(2) + ConnectClientFrame_Payload whichPayload() => + _ConnectClientFrame_PayloadByTag[$_whichOneof(0)]!; + @$pb.TagNumber(1) + @$pb.TagNumber(2) + void clearPayload() => $_clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + ConnectInvocationRequest get invocation => $_getN(0); + @$pb.TagNumber(1) + set invocation(ConnectInvocationRequest value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasInvocation() => $_has(0); + @$pb.TagNumber(1) + void clearInvocation() => $_clearField(1); + @$pb.TagNumber(1) + ConnectInvocationRequest ensureInvocation() => $_ensure(0); + + @$pb.TagNumber(2) + ConnectHeartbeatRequest get heartbeat => $_getN(1); + @$pb.TagNumber(2) + set heartbeat(ConnectHeartbeatRequest value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasHeartbeat() => $_has(1); + @$pb.TagNumber(2) + void clearHeartbeat() => $_clearField(2); + @$pb.TagNumber(2) + ConnectHeartbeatRequest ensureHeartbeat() => $_ensure(1); +} + +enum ConnectHostFrame_Payload { invocationEvent, heartbeat, notSet } + +class ConnectHostFrame extends $pb.GeneratedMessage { + factory ConnectHostFrame({ + ConnectInvocationEvent? invocationEvent, + ConnectHeartbeatResponse? heartbeat, + }) { + final result = create(); + if (invocationEvent != null) result.invocationEvent = invocationEvent; + if (heartbeat != null) result.heartbeat = heartbeat; + return result; + } + + ConnectHostFrame._(); + + factory ConnectHostFrame.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConnectHostFrame.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static const $core.Map<$core.int, ConnectHostFrame_Payload> + _ConnectHostFrame_PayloadByTag = { + 1: ConnectHostFrame_Payload.invocationEvent, + 2: ConnectHostFrame_Payload.heartbeat, + 0: ConnectHostFrame_Payload.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConnectHostFrame', + package: const $pb.PackageName(_omitMessageNames ? '' : 'runanywhere.v1'), + createEmptyInstance: create) + ..oo(0, [1, 2]) + ..aOM(1, _omitFieldNames ? '' : 'invocationEvent', + subBuilder: ConnectInvocationEvent.create) + ..aOM(2, _omitFieldNames ? '' : 'heartbeat', + subBuilder: ConnectHeartbeatResponse.create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostFrame clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConnectHostFrame copyWith(void Function(ConnectHostFrame) updates) => + super.copyWith((message) => updates(message as ConnectHostFrame)) + as ConnectHostFrame; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConnectHostFrame create() => ConnectHostFrame._(); + @$core.override + ConnectHostFrame createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConnectHostFrame getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConnectHostFrame? _defaultInstance; + + @$pb.TagNumber(1) + @$pb.TagNumber(2) + ConnectHostFrame_Payload whichPayload() => + _ConnectHostFrame_PayloadByTag[$_whichOneof(0)]!; + @$pb.TagNumber(1) + @$pb.TagNumber(2) + void clearPayload() => $_clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + ConnectInvocationEvent get invocationEvent => $_getN(0); + @$pb.TagNumber(1) + set invocationEvent(ConnectInvocationEvent value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasInvocationEvent() => $_has(0); + @$pb.TagNumber(1) + void clearInvocationEvent() => $_clearField(1); + @$pb.TagNumber(1) + ConnectInvocationEvent ensureInvocationEvent() => $_ensure(0); + + @$pb.TagNumber(2) + ConnectHeartbeatResponse get heartbeat => $_getN(1); + @$pb.TagNumber(2) + set heartbeat(ConnectHeartbeatResponse value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasHeartbeat() => $_has(1); + @$pb.TagNumber(2) + void clearHeartbeat() => $_clearField(2); + @$pb.TagNumber(2) + ConnectHeartbeatResponse ensureHeartbeat() => $_ensure(1); +} + +const $core.bool _omitFieldNames = + $core.bool.fromEnvironment('protobuf.omit_field_names'); +const $core.bool _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/connect.pbenum.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/connect.pbenum.dart new file mode 100644 index 0000000000..6c74b06aa1 --- /dev/null +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/connect.pbenum.dart @@ -0,0 +1,160 @@ +// This is a generated file - do not edit. +// +// Generated from connect.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_relative_imports + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +/// Platform identity is explicit so commons can evaluate role availability +/// from one policy table. Platform SDKs must not hardcode the host/client +/// matrix in UI or transport code. +class ConnectPlatform extends $pb.ProtobufEnum { + static const ConnectPlatform CONNECT_PLATFORM_UNSPECIFIED = ConnectPlatform._( + 0, _omitEnumNames ? '' : 'CONNECT_PLATFORM_UNSPECIFIED'); + static const ConnectPlatform CONNECT_PLATFORM_MACOS = + ConnectPlatform._(1, _omitEnumNames ? '' : 'CONNECT_PLATFORM_MACOS'); + static const ConnectPlatform CONNECT_PLATFORM_IOS = + ConnectPlatform._(2, _omitEnumNames ? '' : 'CONNECT_PLATFORM_IOS'); + static const ConnectPlatform CONNECT_PLATFORM_IPADOS = + ConnectPlatform._(3, _omitEnumNames ? '' : 'CONNECT_PLATFORM_IPADOS'); + + /// Reserved for the follow-on SDK integrations. Keeping the values in the + /// canonical IDL avoids a later wire-format migration. + static const ConnectPlatform CONNECT_PLATFORM_ANDROID = + ConnectPlatform._(4, _omitEnumNames ? '' : 'CONNECT_PLATFORM_ANDROID'); + static const ConnectPlatform CONNECT_PLATFORM_REACT_NATIVE = + ConnectPlatform._( + 5, _omitEnumNames ? '' : 'CONNECT_PLATFORM_REACT_NATIVE'); + static const ConnectPlatform CONNECT_PLATFORM_FLUTTER = + ConnectPlatform._(6, _omitEnumNames ? '' : 'CONNECT_PLATFORM_FLUTTER'); + static const ConnectPlatform CONNECT_PLATFORM_WEB = + ConnectPlatform._(7, _omitEnumNames ? '' : 'CONNECT_PLATFORM_WEB'); + + /// Reserved now so adding the planned Windows host adapter does not require + /// a platform-identity wire migration. Its host role remains PLANNED until + /// the native transport, discovery, and protected-storage adapter ships. + static const ConnectPlatform CONNECT_PLATFORM_WINDOWS = + ConnectPlatform._(8, _omitEnumNames ? '' : 'CONNECT_PLATFORM_WINDOWS'); + + static const $core.List values = [ + CONNECT_PLATFORM_UNSPECIFIED, + CONNECT_PLATFORM_MACOS, + CONNECT_PLATFORM_IOS, + CONNECT_PLATFORM_IPADOS, + CONNECT_PLATFORM_ANDROID, + CONNECT_PLATFORM_REACT_NATIVE, + CONNECT_PLATFORM_FLUTTER, + CONNECT_PLATFORM_WEB, + CONNECT_PLATFORM_WINDOWS, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 8); + static ConnectPlatform? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const ConnectPlatform._(super.value, super.name); +} + +/// Role availability is richer than a boolean so the wire contract can reserve +/// planned platforms without accidentally advertising them as usable. +class ConnectRoleAvailability extends $pb.ProtobufEnum { + static const ConnectRoleAvailability CONNECT_ROLE_AVAILABILITY_UNSPECIFIED = + ConnectRoleAvailability._( + 0, _omitEnumNames ? '' : 'CONNECT_ROLE_AVAILABILITY_UNSPECIFIED'); + static const ConnectRoleAvailability CONNECT_ROLE_AVAILABILITY_DISABLED = + ConnectRoleAvailability._( + 1, _omitEnumNames ? '' : 'CONNECT_ROLE_AVAILABILITY_DISABLED'); + static const ConnectRoleAvailability CONNECT_ROLE_AVAILABILITY_PLANNED = + ConnectRoleAvailability._( + 2, _omitEnumNames ? '' : 'CONNECT_ROLE_AVAILABILITY_PLANNED'); + static const ConnectRoleAvailability CONNECT_ROLE_AVAILABILITY_ENABLED = + ConnectRoleAvailability._( + 3, _omitEnumNames ? '' : 'CONNECT_ROLE_AVAILABILITY_ENABLED'); + + static const $core.List values = + [ + CONNECT_ROLE_AVAILABILITY_UNSPECIFIED, + CONNECT_ROLE_AVAILABILITY_DISABLED, + CONNECT_ROLE_AVAILABILITY_PLANNED, + CONNECT_ROLE_AVAILABILITY_ENABLED, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 3); + static ConnectRoleAvailability? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const ConnectRoleAvailability._(super.value, super.name); +} + +class ConnectHandshakeStatus extends $pb.ProtobufEnum { + static const ConnectHandshakeStatus CONNECT_HANDSHAKE_STATUS_UNSPECIFIED = + ConnectHandshakeStatus._( + 0, _omitEnumNames ? '' : 'CONNECT_HANDSHAKE_STATUS_UNSPECIFIED'); + static const ConnectHandshakeStatus CONNECT_HANDSHAKE_STATUS_ACCEPTED = + ConnectHandshakeStatus._( + 1, _omitEnumNames ? '' : 'CONNECT_HANDSHAKE_STATUS_ACCEPTED'); + static const ConnectHandshakeStatus CONNECT_HANDSHAKE_STATUS_REJECTED = + ConnectHandshakeStatus._( + 2, _omitEnumNames ? '' : 'CONNECT_HANDSHAKE_STATUS_REJECTED'); + + static const $core.List values = + [ + CONNECT_HANDSHAKE_STATUS_UNSPECIFIED, + CONNECT_HANDSHAKE_STATUS_ACCEPTED, + CONNECT_HANDSHAKE_STATUS_REJECTED, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static ConnectHandshakeStatus? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const ConnectHandshakeStatus._(super.value, super.name); +} + +class ConnectSessionState extends $pb.ProtobufEnum { + static const ConnectSessionState CONNECT_SESSION_STATE_UNSPECIFIED = + ConnectSessionState._( + 0, _omitEnumNames ? '' : 'CONNECT_SESSION_STATE_UNSPECIFIED'); + static const ConnectSessionState CONNECT_SESSION_STATE_CONNECTING = + ConnectSessionState._( + 1, _omitEnumNames ? '' : 'CONNECT_SESSION_STATE_CONNECTING'); + static const ConnectSessionState CONNECT_SESSION_STATE_CONNECTED = + ConnectSessionState._( + 2, _omitEnumNames ? '' : 'CONNECT_SESSION_STATE_CONNECTED'); + static const ConnectSessionState CONNECT_SESSION_STATE_DISCONNECTED = + ConnectSessionState._( + 3, _omitEnumNames ? '' : 'CONNECT_SESSION_STATE_DISCONNECTED'); + static const ConnectSessionState CONNECT_SESSION_STATE_FAILED = + ConnectSessionState._( + 4, _omitEnumNames ? '' : 'CONNECT_SESSION_STATE_FAILED'); + + static const $core.List values = [ + CONNECT_SESSION_STATE_UNSPECIFIED, + CONNECT_SESSION_STATE_CONNECTING, + CONNECT_SESSION_STATE_CONNECTED, + CONNECT_SESSION_STATE_DISCONNECTED, + CONNECT_SESSION_STATE_FAILED, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static ConnectSessionState? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const ConnectSessionState._(super.value, super.name); +} + +const $core.bool _omitEnumNames = + $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/convenience/ra_convenience.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/convenience/ra_convenience.dart index e24a64d4cb..ed7bbb8e86 100644 --- a/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/convenience/ra_convenience.dart +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/generated/convenience/ra_convenience.dart @@ -224,6 +224,39 @@ ArchiveStructure? archiveStructureFromWireString(String value) { return null; } +extension VADConfigurationConvenience on VADConfiguration { + static VADConfiguration defaults() { + final r = VADConfiguration(); + r.sampleRate = 16000; + r.frameLengthMs = 100; + r.threshold = 0.015; + return r; + } +} + +extension VADConfigurationValidate on VADConfiguration { + void validate() { + if (sampleRate < 1 || sampleRate > 48000) { + throw SDKException.validationFailed( + 'sample_rate must be in 1...48000 (got $sampleRate)', + fieldPath: 'VADConfiguration.sample_rate', + ); + } + if (frameLengthMs < 1 || frameLengthMs > 1000) { + throw SDKException.validationFailed( + 'frame_length_ms must be in 1...1000 (got $frameLengthMs)', + fieldPath: 'VADConfiguration.frame_length_ms', + ); + } + if (threshold < 0.0 || threshold > 1.0) { + throw SDKException.validationFailed( + 'threshold must be in 0.0...1.0 (got $threshold)', + fieldPath: 'VADConfiguration.threshold', + ); + } + } +} + extension EmbeddingsConfigurationConvenience on EmbeddingsConfiguration { static EmbeddingsConfiguration defaults() { final r = EmbeddingsConfiguration(); @@ -265,39 +298,6 @@ extension EmbeddingsOptionsConvenience on EmbeddingsOptions { } } -extension VADConfigurationConvenience on VADConfiguration { - static VADConfiguration defaults() { - final r = VADConfiguration(); - r.sampleRate = 16000; - r.frameLengthMs = 100; - r.threshold = 0.015; - return r; - } -} - -extension VADConfigurationValidate on VADConfiguration { - void validate() { - if (sampleRate < 1 || sampleRate > 48000) { - throw SDKException.validationFailed( - 'sample_rate must be in 1...48000 (got $sampleRate)', - fieldPath: 'VADConfiguration.sample_rate', - ); - } - if (frameLengthMs < 1 || frameLengthMs > 1000) { - throw SDKException.validationFailed( - 'frame_length_ms must be in 1...1000 (got $frameLengthMs)', - fieldPath: 'VADConfiguration.frame_length_ms', - ); - } - if (threshold < 0.0 || threshold > 1.0) { - throw SDKException.validationFailed( - 'threshold must be in 0.0...1.0 (got $threshold)', - fieldPath: 'VADConfiguration.threshold', - ); - } - } -} - extension LogLevelWireString on LogLevel { String get wireString { switch (this) { diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_connect.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_connect.dart new file mode 100644 index 0000000000..74437ac431 --- /dev/null +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_connect.dart @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 + +import 'dart:ffi' as ffi; + +import 'package:protobuf/protobuf.dart'; +import 'package:runanywhere/core/native/rac_native.dart'; +import 'package:runanywhere/generated/connect.pb.dart'; +import 'package:runanywhere/native/dart_bridge_proto_utils.dart'; +import 'package:runanywhere/native/platform_loader.dart'; + +typedef _ConnectProtoNative = + ffi.Int32 Function( + ffi.Pointer, + ffi.Size, + ffi.Pointer, + ); +typedef _ConnectProtoDart = + int Function(ffi.Pointer, int, ffi.Pointer); + +/// Thin protobuf facade over the Commons-owned Connect policy and handshake. +abstract final class DartBridgeConnect { + static final ffi.DynamicLibrary _library = PlatformLoader.loadCommons(); + + static ConnectPlatformPolicy platformPolicy( + ConnectPlatformPolicyRequest request, + ) => _call( + request: request, + symbol: 'rac_connect_get_platform_policy_proto', + decode: ConnectPlatformPolicy.fromBuffer, + ); + + static ConnectClientHello createClientHello( + ConnectClientStartRequest request, + ) => _call( + request: request, + symbol: 'rac_connect_client_create_hello_proto', + decode: ConnectClientHello.fromBuffer, + ); + + static ConnectClientSessionState validateHost( + ConnectHandshakeResponse response, + ) => _call( + request: response, + symbol: 'rac_connect_client_validate_host_proto', + decode: ConnectClientSessionState.fromBuffer, + ); + + static T _call({ + required GeneratedMessage request, + required String symbol, + required T Function(List) decode, + }) { + final function = _library + .lookupFunction<_ConnectProtoNative, _ConnectProtoDart>(symbol); + return DartBridgeProtoUtils.callRequest( + request: request, + invoke: function, + decode: decode, + symbol: symbol, + ); + } +} diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/public/connect/connect_session.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/public/connect/connect_session.dart new file mode 100644 index 0000000000..d15dedd3fa --- /dev/null +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/public/connect/connect_session.dart @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: Apache-2.0 + +import 'dart:async'; +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:fixnum/fixnum.dart'; +import 'package:flutter/services.dart'; +import 'package:multicast_dns/multicast_dns.dart'; +import 'package:runanywhere/foundation/errors/sdk_exception.dart'; +import 'package:runanywhere/generated/connect.pb.dart' as connect_pb; +import 'package:runanywhere/generated/connect.pbenum.dart'; +import 'package:runanywhere/generated/llm_service.pb.dart'; +import 'package:runanywhere/native/dart_bridge.dart'; +import 'package:runanywhere/native/dart_bridge_connect.dart'; +import 'package:uuid/uuid.dart'; + +/// A runtime host discovered on the local network. +final class ConnectHost { + const ConnectHost({ + required this.id, + required this.displayName, + required this.protocolVersion, + }); + + final String id; + final String displayName; + final int protocolVersion; +} + +/// The single language model selected and published by a connected host. +final class ConnectModel { + const ConnectModel({ + required this.id, + required this.displayName, + required this.framework, + required this.contextWindow, + required this.supportsStreaming, + }); + + final String id; + final String displayName; + final String framework; + final int contextWindow; + final bool supportsStreaming; +} + +enum ConnectStatus { + idle, + discovering, + connecting, + connected, + disconnected, + failed, +} + +/// One observable snapshot for discovery, connection, model, and failure UI. +final class ConnectState { + const ConnectState({ + this.status = ConnectStatus.idle, + this.availableHosts = const [], + this.connectingHost, + this.activeHost, + this.activeModel, + this.lastDisconnectedHost, + this.lastDisconnectedModel, + this.message, + }); + + final ConnectStatus status; + final List availableHosts; + final ConnectHost? connectingHost; + final ConnectHost? activeHost; + final ConnectModel? activeModel; + final ConnectHost? lastDisconnectedHost; + final ConnectModel? lastDisconnectedModel; + final String? message; + + bool get isConnected => status == ConnectStatus.connected; + + ConnectState copyWith({ + ConnectStatus? status, + List? availableHosts, + ConnectHost? connectingHost, + bool clearConnectingHost = false, + ConnectHost? activeHost, + bool clearActiveHost = false, + ConnectModel? activeModel, + bool clearActiveModel = false, + ConnectHost? lastDisconnectedHost, + bool clearLastDisconnectedHost = false, + ConnectModel? lastDisconnectedModel, + bool clearLastDisconnectedModel = false, + String? message, + bool clearMessage = false, + }) => ConnectState( + status: status ?? this.status, + availableHosts: availableHosts ?? this.availableHosts, + connectingHost: clearConnectingHost + ? null + : connectingHost ?? this.connectingHost, + activeHost: clearActiveHost ? null : activeHost ?? this.activeHost, + activeModel: clearActiveModel ? null : activeModel ?? this.activeModel, + lastDisconnectedHost: clearLastDisconnectedHost + ? null + : lastDisconnectedHost ?? this.lastDisconnectedHost, + lastDisconnectedModel: clearLastDisconnectedModel + ? null + : lastDisconnectedModel ?? this.lastDisconnectedModel, + message: clearMessage ? null : message ?? this.message, + ); +} + +/// Flutter client for a RunAnywhere language model published by a host. +/// +/// Discovery is opt-in. Commons owns role policy and handshake validation; +/// this SDK layer owns mDNS, framed TCP, heartbeat, and session observation. +final class ConnectSession { + ConnectSession({String displayName = 'Flutter device'}) + : _displayName = displayName.trim().isEmpty + ? 'Flutter device' + : displayName.trim(); + + static const int protocolVersion = 1; + static const String _serviceName = '_runanywhere-connect._tcp.local'; + + final String _displayName; + final String _clientInstanceId = const Uuid().v4(); + final StreamController _states = StreamController.broadcast(); + final Map _endpoints = {}; + final _ConnectSocket _socket = _ConnectSocket(); + + ConnectState _state = const ConnectState(); + bool _browsing = false; + bool _stopped = false; + bool _discoveryResourcesHeld = false; + String? _activeSessionId; + + ConnectState get state => _state; + Stream get states => _states.stream; + + Future startBrowsing() async { + _requireInitialized(); + final policy = DartBridgeConnect.platformPolicy( + connect_pb.ConnectPlatformPolicyRequest( + platform: ConnectPlatform.CONNECT_PLATFORM_FLUTTER, + ), + ); + if (policy.clientRole != + ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED) { + throw SDKException.networkError( + 'Connect client support is not enabled for Flutter', + ); + } + if (_browsing) return; + await _acquireDiscoveryResources(); + _browsing = true; + _emit( + _state.copyWith( + status: _state.isConnected ? _state.status : ConnectStatus.discovering, + clearMessage: true, + ), + ); + unawaited(_browseLoop()); + } + + void stopBrowsing() { + _browsing = false; + unawaited(_releaseDiscoveryResources()); + _endpoints.clear(); + _emit( + _state.copyWith( + status: _state.status == ConnectStatus.discovering + ? ConnectStatus.idle + : _state.status, + availableHosts: const [], + ), + ); + } + + Future connect(ConnectHost host) async { + _requireInitialized(); + final endpoint = _endpoints[host.id]; + if (endpoint == null) { + throw SDKException.networkError( + 'The selected host is no longer available', + ); + } + await _socket.close(); + _activeSessionId = null; + _emit( + _state.copyWith( + status: ConnectStatus.connecting, + connectingHost: host, + clearActiveHost: true, + clearActiveModel: true, + clearMessage: true, + ), + ); + + try { + final hello = DartBridgeConnect.createClientHello( + connect_pb.ConnectClientStartRequest( + displayName: _displayName.length <= 128 + ? _displayName + : _displayName.substring(0, 128), + platform: ConnectPlatform.CONNECT_PLATFORM_FLUTTER, + protocolVersion: protocolVersion, + ), + )..instanceId = _clientInstanceId; + final response = await _socket.connect(endpoint, hello); + final session = DartBridgeConnect.validateHost(response); + if (session.state != + ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED || + session.sessionId.isEmpty || + !session.hasHost() || + !session.hasModel() || + session.model.modelId.isEmpty) { + throw SDKException.networkError( + session.errorMessage.isEmpty + ? 'The selected host could not provide a language model' + : session.errorMessage, + ); + } + final connectedHost = ConnectHost( + id: host.id, + displayName: session.host.displayName.isEmpty + ? host.displayName + : session.host.displayName, + protocolVersion: session.host.protocolVersion, + ); + final connectedModel = ConnectModel( + id: session.model.modelId, + displayName: session.model.displayName, + framework: session.model.framework, + contextWindow: session.model.contextWindow, + supportsStreaming: session.model.supportsStreaming, + ); + _activeSessionId = session.sessionId; + _emit( + ConnectState( + status: ConnectStatus.connected, + availableHosts: _state.availableHosts, + activeHost: connectedHost, + activeModel: connectedModel, + ), + ); + _socket.startHeartbeat(session.sessionId, _handleDisconnect); + } catch (error) { + await _socket.close(); + _activeSessionId = null; + _emit( + _state.copyWith( + status: ConnectStatus.failed, + clearConnectingHost: true, + clearActiveHost: true, + clearActiveModel: true, + message: _message(error, 'Unable to connect to the selected host'), + ), + ); + rethrow; + } + } + + Stream generateStream(LLMGenerateRequest request) async* { + final sessionId = _activeSessionId; + final model = _state.activeModel; + if (!_state.isConnected || sessionId == null || model == null) { + throw SDKException.networkError( + 'Connect to a host before generating text', + ); + } + final requestId = request.requestId.isEmpty + ? const Uuid().v4() + : request.requestId; + final generation = request.deepCopy() + ..requestId = requestId + ..modelId = model.id; + try { + yield* _socket.generate( + connect_pb.ConnectInvocationRequest( + sessionId: sessionId, + requestId: requestId, + generation: generation, + ), + ); + } catch (error) { + _handleDisconnect(error); + rethrow; + } + } + + Future disconnect() async { + await _socket.close(); + _activeSessionId = null; + _emit(ConnectState(availableHosts: _state.availableHosts)); + } + + Future stop() async { + if (_stopped) return; + _stopped = true; + _browsing = false; + await _releaseDiscoveryResources(); + _endpoints.clear(); + await _socket.close(); + _activeSessionId = null; + _emit(const ConnectState()); + await _states.close(); + } + + Future _browseLoop() async { + while (_browsing && !_stopped) { + try { + final endpoints = await _discoverOnce(); + if (!_browsing) return; + _endpoints + ..clear() + ..addEntries(endpoints.map((value) => MapEntry(value.id, value))); + final hosts = endpoints + .map( + (value) => ConnectHost( + id: value.id, + displayName: value.displayName, + protocolVersion: protocolVersion, + ), + ) + .toList(growable: false); + _emit( + _state.copyWith( + status: _state.status == ConnectStatus.failed + ? ConnectStatus.discovering + : _state.status, + availableHosts: hosts, + clearMessage: _state.status == ConnectStatus.failed, + ), + ); + } catch (error) { + if (!_browsing) return; + // Discovery is only needed to find another host. A transient mDNS + // failure must not invalidate an already healthy TCP session; the + // heartbeat remains authoritative for that connection. + if (_state.isConnected) { + await Future.delayed(const Duration(seconds: 3)); + continue; + } + _emit( + _state.copyWith( + status: ConnectStatus.failed, + message: _message(error, 'Unable to search the local network'), + ), + ); + } + await Future.delayed(const Duration(seconds: 3)); + } + } + + Future> _discoverOnce() async { + final client = MDnsClient(); + final endpoints = {}; + try { + await client.start(onError: (Object error) {}); + final pointers = await client + .lookup( + ResourceRecordQuery.serverPointer(_serviceName), + timeout: const Duration(seconds: 2), + ) + .toList(); + for (final pointer in pointers) { + final records = await client + .lookup( + ResourceRecordQuery.service(pointer.domainName), + timeout: const Duration(seconds: 2), + ) + .toList(); + for (final record in records) { + final target = record.target.trim().replaceFirst(RegExp(r'\.$'), ''); + if (target.isEmpty || record.port < 1 || record.port > 65535) { + continue; + } + final addressRecords = await client + .lookup( + ResourceRecordQuery.addressIPv4(record.target), + timeout: const Duration(milliseconds: 750), + ) + .toList(); + final resolvedHost = addressRecords.isEmpty + ? target + : addressRecords.first.address.address; + endpoints[pointer.domainName] = _ConnectEndpoint( + id: pointer.domainName, + displayName: pointer.domainName + .split('._runanywhere-connect') + .first, + host: resolvedHost, + port: record.port, + ); + } + } + return endpoints.values.toList() + ..sort((left, right) => left.displayName.compareTo(right.displayName)); + } finally { + client.stop(); + } + } + + Future _acquireDiscoveryResources() async { + if (!Platform.isAndroid || _discoveryResourcesHeld) return; + try { + const channel = MethodChannel('runanywhere'); + final acquired = + await channel.invokeMethod('connectAcquireMulticastLock') ?? + false; + if (!acquired) { + throw SDKException.networkError( + 'Unable to enable local-network discovery on Android', + ); + } + _discoveryResourcesHeld = true; + } on SDKException { + rethrow; + } catch (error) { + throw SDKException.networkError( + 'Unable to enable local-network discovery on Android: $error', + ); + } + } + + Future _releaseDiscoveryResources() async { + if (!Platform.isAndroid || !_discoveryResourcesHeld) return; + _discoveryResourcesHeld = false; + try { + const channel = MethodChannel('runanywhere'); + await channel.invokeMethod('connectReleaseMulticastLock'); + } catch (_) { + // The Flutter engine may already be detaching; Android releases the lock + // from the plugin lifecycle as a final safety net. + } + } + + void _handleDisconnect(Object error) { + if (!_state.isConnected) return; + final previous = _state; + _activeSessionId = null; + unawaited(_socket.close()); + final hostName = previous.activeHost?.displayName ?? 'the host'; + _emit( + previous.copyWith( + status: ConnectStatus.disconnected, + clearConnectingHost: true, + clearActiveHost: true, + clearActiveModel: true, + lastDisconnectedHost: previous.activeHost, + lastDisconnectedModel: previous.activeModel, + message: + 'Connection to $hostName ended. The host may have stopped or left the network.', + ), + ); + } + + void _emit(ConnectState value) { + _state = value; + if (!_states.isClosed) _states.add(value); + } + + void _requireInitialized() { + if (!DartBridge.isInitialized) { + throw SDKException.notInitialized('RunAnywhere Connect'); + } + } + + String _message(Object error, String fallback) { + if (error is SDKException && error.message.isNotEmpty) return error.message; + final value = error.toString().trim(); + return value.isEmpty ? fallback : value; + } +} + +final class _ConnectEndpoint { + const _ConnectEndpoint({ + required this.id, + required this.displayName, + required this.host, + required this.port, + }); + + final String id; + final String displayName; + final String host; + final int port; +} + +final class _ConnectSocket { + Socket? _socket; + StreamIterator? _iterator; + final List _buffer = []; + Timer? _heartbeat; + bool _operationActive = false; + bool _closed = true; + + Future connect( + _ConnectEndpoint endpoint, + connect_pb.ConnectClientHello hello, + ) async { + await close(); + try { + // Ownership is transferred to this transport and released by close(). + // ignore: close_sinks + final socket = await Socket.connect( + endpoint.host, + endpoint.port, + timeout: const Duration(seconds: 5), + ); + socket.setOption(SocketOption.tcpNoDelay, true); + _socket = socket; + _iterator = StreamIterator(socket); + _closed = false; + _writeFrame(hello.writeToBuffer()); + return connect_pb.ConnectHandshakeResponse.fromBuffer( + await _readFrame().timeout(const Duration(seconds: 5)), + ); + } catch (error) { + await close(); + throw SDKException.networkError( + 'Unable to connect to ${endpoint.displayName}: $error', + ); + } + } + + void startHeartbeat(String sessionId, void Function(Object) onDisconnected) { + _heartbeat?.cancel(); + var sequence = 0; + _heartbeat = Timer.periodic(const Duration(seconds: 3), (_) { + if (_closed || _operationActive) return; + unawaited(() async { + _operationActive = true; + try { + sequence += 1; + _writeFrame( + connect_pb.ConnectClientFrame( + heartbeat: connect_pb.ConnectHeartbeatRequest( + sessionId: sessionId, + sequence: Int64(sequence), + ), + ).writeToBuffer(), + ); + final frame = connect_pb.ConnectHostFrame.fromBuffer( + await _readFrame().timeout(const Duration(seconds: 2)), + ); + if (!frame.hasHeartbeat() || + frame.heartbeat.sessionId != sessionId || + frame.heartbeat.sequence.toInt() != sequence) { + throw SDKException.networkError( + 'The Connect host returned an invalid heartbeat', + ); + } + } catch (error) { + onDisconnected(error); + } finally { + _operationActive = false; + } + }()); + }); + } + + Stream generate( + connect_pb.ConnectInvocationRequest request, + ) async* { + if (_closed || _socket == null) { + throw SDKException.networkError( + 'The selected host is no longer connected', + ); + } + if (_operationActive) { + throw SDKException.networkError( + 'Another Connect operation is already running', + ); + } + _operationActive = true; + try { + _writeFrame( + connect_pb.ConnectClientFrame(invocation: request).writeToBuffer(), + ); + while (true) { + final frame = connect_pb.ConnectHostFrame.fromBuffer( + await _readFrame(), + ); + if (!frame.hasInvocationEvent() || + frame.invocationEvent.requestId != request.requestId || + !frame.invocationEvent.hasEvent()) { + throw SDKException.networkError( + 'The Connect host returned an invalid response', + ); + } + final event = frame.invocationEvent.event; + yield event; + if (event.isFinal) break; + } + } finally { + _operationActive = false; + } + } + + Future close() async { + _heartbeat?.cancel(); + _heartbeat = null; + _closed = true; + _operationActive = false; + final iterator = _iterator; + _iterator = null; + final socket = _socket; + _socket = null; + _buffer.clear(); + await iterator?.cancel(); + await socket?.close(); + } + + void _writeFrame(List payload) { + if (payload.isEmpty || payload.length > 4 * 1024 * 1024) { + throw SDKException.networkError('Connect frame size is invalid'); + } + final header = ByteData(4)..setUint32(0, payload.length, Endian.big); + _socket + ?..add(header.buffer.asUint8List()) + ..add(payload); + } + + Future _readFrame() async { + while (_buffer.length < 4) { + await _readChunk(); + } + final header = Uint8List.fromList(_buffer.sublist(0, 4)); + final length = ByteData.sublistView(header).getUint32(0, Endian.big); + if (length < 1 || length > 4 * 1024 * 1024) { + throw SDKException.networkError( + 'The Connect host returned an invalid frame size', + ); + } + while (_buffer.length < 4 + length) { + await _readChunk(); + } + final payload = Uint8List.fromList(_buffer.sublist(4, 4 + length)); + _buffer.removeRange(0, 4 + length); + return payload; + } + + Future _readChunk() async { + final iterator = _iterator; + if (iterator == null || !await iterator.moveNext()) { + throw const SocketException('The connection to the host ended'); + } + _buffer.addAll(iterator.current); + } +} diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart index d61f0a935e..8f8e85ccb8 100644 --- a/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart @@ -43,6 +43,8 @@ export 'public/capabilities/runanywhere_vad.dart' show RunAnywhereVAD; export 'public/capabilities/runanywhere_vlm.dart' show RunAnywhereVLM; export 'public/capabilities/runanywhere_voice.dart' show RunAnywhereVoice; export 'public/configuration/sdk_environment.dart'; +export 'public/connect/connect_session.dart' + show ConnectHost, ConnectModel, ConnectSession, ConnectState, ConnectStatus; export 'public/events/event_bus.dart' show EventBus, diff --git a/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere_protos.dart b/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere_protos.dart index 9cd6232ad5..05c4784ec6 100644 --- a/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere_protos.dart +++ b/sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere_protos.dart @@ -12,6 +12,8 @@ export 'generated/chat.pb.dart'; export 'generated/chat.pbenum.dart'; export 'generated/component_types.pb.dart'; export 'generated/component_types.pbenum.dart'; +export 'generated/connect.pb.dart'; +export 'generated/connect.pbenum.dart'; export 'generated/diffusion_options.pb.dart'; export 'generated/diffusion_options.pbenum.dart'; export 'generated/download_service.pb.dart'; diff --git a/sdk/runanywhere-flutter/packages/runanywhere/pubspec.yaml b/sdk/runanywhere-flutter/packages/runanywhere/pubspec.yaml index 525fcec06b..b0c5cc26b8 100644 --- a/sdk/runanywhere-flutter/packages/runanywhere/pubspec.yaml +++ b/sdk/runanywhere-flutter/packages/runanywhere/pubspec.yaml @@ -52,6 +52,9 @@ dependencies: device_info_plus: ^13.1.0 flutter_timezone: ^5.1.0 package_info_plus: ^10.1.0 + # Local-network discovery for the platform-neutral Connect client. The + # framed TCP protocol and handshake remain SDK-owned. + multicast_dns: ^0.3.3+1 # Utilities uuid: ^4.5.3 diff --git a/sdk/runanywhere-kotlin/modules/runanywhere-core-qhexrt/src/main/kotlin/com/runanywhere/sdk/npu/qhexrt/QHexRTSkelInstaller.kt b/sdk/runanywhere-kotlin/modules/runanywhere-core-qhexrt/src/main/kotlin/com/runanywhere/sdk/npu/qhexrt/QHexRTSkelInstaller.kt index b5c8cadbf9..fba224758a 100644 --- a/sdk/runanywhere-kotlin/modules/runanywhere-core-qhexrt/src/main/kotlin/com/runanywhere/sdk/npu/qhexrt/QHexRTSkelInstaller.kt +++ b/sdk/runanywhere-kotlin/modules/runanywhere-core-qhexrt/src/main/kotlin/com/runanywhere/sdk/npu/qhexrt/QHexRTSkelInstaller.kt @@ -43,8 +43,7 @@ internal object QHexRTSkelInstaller { // resolves it by name via ADSP_LIBRARY_PATH, so it must be // installed into the skel dir alongside the QNN skels. it == "librun_main_on_hexagon_skel.so" - } - .orEmpty() + }.orEmpty() .sorted() if (skelNames.isEmpty()) { logger.warning("QHexRT DSP skel assets missing at $assetDir") diff --git a/sdk/runanywhere-kotlin/src/main/AndroidManifest.xml b/sdk/runanywhere-kotlin/src/main/AndroidManifest.xml index 6d1593d4ab..a191eebe95 100644 --- a/sdk/runanywhere-kotlin/src/main/AndroidManifest.xml +++ b/sdk/runanywhere-kotlin/src/main/AndroidManifest.xml @@ -1,4 +1,10 @@ - + + + + diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/foundation/bridge/extensions/CppBridgeConnect.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/foundation/bridge/extensions/CppBridgeConnect.kt new file mode 100644 index 0000000000..054682a5dc --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/foundation/bridge/extensions/CppBridgeConnect.kt @@ -0,0 +1,63 @@ +/* + * Copyright 2026 RunAnywhere SDK + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.runanywhere.sdk.foundation.bridge.extensions + +import ai.runanywhere.proto.v1.ConnectClientHello +import ai.runanywhere.proto.v1.ConnectClientSessionState +import ai.runanywhere.proto.v1.ConnectClientStartRequest +import ai.runanywhere.proto.v1.ConnectHandshakeResponse +import ai.runanywhere.proto.v1.ConnectPlatformPolicy +import ai.runanywhere.proto.v1.ConnectPlatformPolicyRequest +import com.runanywhere.sdk.foundation.errors.SDKException +import com.runanywhere.sdk.native.bridge.RunAnywhereBridge + +/** Thin protobuf facade over the commons-owned Connect policy and handshake ABI. */ +internal object CppBridgeConnect { + fun platformPolicy(request: ConnectPlatformPolicyRequest): ConnectPlatformPolicy = + decode( + bytes = + RunAnywhereBridge.racConnectGetPlatformPolicyProto( + ConnectPlatformPolicyRequest.ADAPTER.encode(request), + ), + operation = "read Connect platform policy", + decode = ConnectPlatformPolicy.ADAPTER::decode, + ) + + fun createClientHello(request: ConnectClientStartRequest): ConnectClientHello = + decode( + bytes = + RunAnywhereBridge.racConnectClientCreateHelloProto( + ConnectClientStartRequest.ADAPTER.encode(request), + ), + operation = "create Connect client hello", + decode = ConnectClientHello.ADAPTER::decode, + ) + + fun validateHost(response: ConnectHandshakeResponse): ConnectClientSessionState = + decode( + bytes = + RunAnywhereBridge.racConnectClientValidateHostProto( + ConnectHandshakeResponse.ADAPTER.encode(response), + ), + operation = "validate Connect host", + decode = ConnectClientSessionState.ADAPTER::decode, + ) + + private fun decode( + bytes: ByteArray?, + operation: String, + decode: (ByteArray) -> T, + ): T { + if (bytes == null) { + throw SDKException.networkError("Unable to $operation") + } + return try { + decode(bytes) + } catch (error: Exception) { + throw SDKException.networkError("Unable to $operation", error) + } + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/foundation/connect/AndroidConnectTransport.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/foundation/connect/AndroidConnectTransport.kt new file mode 100644 index 0000000000..6af43a815c --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/foundation/connect/AndroidConnectTransport.kt @@ -0,0 +1,345 @@ +/* + * Copyright 2026 RunAnywhere SDK + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.runanywhere.sdk.foundation.connect + +import ai.runanywhere.proto.v1.ConnectClientFrame +import ai.runanywhere.proto.v1.ConnectClientHello +import ai.runanywhere.proto.v1.ConnectHandshakeResponse +import ai.runanywhere.proto.v1.ConnectHeartbeatRequest +import ai.runanywhere.proto.v1.ConnectHostFrame +import ai.runanywhere.proto.v1.ConnectInvocationRequest +import android.content.Context +import android.net.nsd.NsdManager +import android.net.nsd.NsdServiceInfo +import com.runanywhere.sdk.foundation.errors.SDKException +import com.runanywhere.sdk.public.types.RALLMStreamEvent +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.isActive +import kotlinx.coroutines.launch +import kotlinx.coroutines.sync.Mutex +import kotlinx.coroutines.withContext +import java.io.BufferedInputStream +import java.io.BufferedOutputStream +import java.io.DataInputStream +import java.io.DataOutputStream +import java.io.EOFException +import java.net.InetSocketAddress +import java.net.Socket +import java.net.SocketTimeoutException +import java.util.concurrent.atomic.AtomicBoolean + +internal data class AndroidConnectEndpoint( + val id: String, + val displayName: String, + val address: InetSocketAddress, +) + +/** Android NSD adapter for the Bonjour service published by a Connect host. */ +internal class AndroidConnectDiscovery( + context: Context, + private val onEndpointsChanged: (List) -> Unit, + private val onFailure: (Throwable) -> Unit, +) { + private val nsdManager = context.applicationContext.getSystemService(NsdManager::class.java) + private val lock = Any() + private val endpoints = mutableMapOf() + private val resolving = mutableSetOf() + private var listener: NsdManager.DiscoveryListener? = null + + fun start() { + synchronized(lock) { + if (listener != null) return + val candidate = discoveryListener() + listener = candidate + try { + nsdManager.discoverServices(SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, candidate) + } catch (error: Throwable) { + listener = null + throw error + } + } + } + + fun stop() { + val current = + synchronized(lock) { + val value = listener + listener = null + endpoints.clear() + resolving.clear() + value + } + if (current != null) { + runCatching { nsdManager.stopServiceDiscovery(current) } + } + onEndpointsChanged(emptyList()) + } + + private fun discoveryListener() = + object : NsdManager.DiscoveryListener { + override fun onDiscoveryStarted(serviceType: String) = Unit + + override fun onServiceFound(serviceInfo: NsdServiceInfo) { + if (!serviceInfo.serviceType.normalizedServiceType().startsWith(SERVICE_TYPE_BASE)) return + resolve(serviceInfo) + } + + override fun onServiceLost(serviceInfo: NsdServiceInfo) { + synchronized(lock) { + endpoints.remove(serviceInfo.serviceName) + resolving.remove(serviceInfo.serviceName) + publishLocked() + } + } + + override fun onDiscoveryStopped(serviceType: String) = Unit + + override fun onStartDiscoveryFailed(serviceType: String, errorCode: Int) { + synchronized(lock) { listener = null } + onFailure(SDKException.networkError("Unable to search the local network (NSD $errorCode)")) + } + + override fun onStopDiscoveryFailed(serviceType: String, errorCode: Int) { + synchronized(lock) { listener = null } + onFailure(SDKException.networkError("Unable to stop local-network discovery (NSD $errorCode)")) + } + } + + @Suppress("DEPRECATION") + private fun resolve(serviceInfo: NsdServiceInfo) { + val id = serviceInfo.serviceName + synchronized(lock) { + if (!resolving.add(id)) return + } + nsdManager.resolveService( + serviceInfo, + object : NsdManager.ResolveListener { + override fun onResolveFailed(serviceInfo: NsdServiceInfo, errorCode: Int) { + synchronized(lock) { resolving.remove(id) } + } + + override fun onServiceResolved(serviceInfo: NsdServiceInfo) { + val host = serviceInfo.host + val port = serviceInfo.port + synchronized(lock) { + resolving.remove(id) + if (host != null && port in 1..65535) { + endpoints[id] = + AndroidConnectEndpoint( + id = id, + displayName = serviceInfo.serviceName, + address = InetSocketAddress(host, port), + ) + publishLocked() + } + } + } + }, + ) + } + + private fun publishLocked() { + onEndpointsChanged( + endpoints.values.sortedBy { it.displayName.lowercase() }, + ) + } + + private fun String.normalizedServiceType(): String = trim().trimEnd('.').lowercase() + + internal companion object { + const val SERVICE_TYPE_BASE = "_runanywhere-connect._tcp" + const val SERVICE_TYPE = "$SERVICE_TYPE_BASE." + } +} + +/** One framed TCP connection to the host selected by the Android client. */ +internal class AndroidConnectSocket( + private val scope: CoroutineScope, + private val onDisconnected: (Throwable) -> Unit, +) { + private val operationMutex = Mutex() + private val disconnected = AtomicBoolean(true) + private var socket: Socket? = null + private var input: DataInputStream? = null + private var output: DataOutputStream? = null + private var heartbeatJob: Job? = null + + suspend fun connect( + endpoint: AndroidConnectEndpoint, + hello: ConnectClientHello, + ): ConnectHandshakeResponse = + withContext(Dispatchers.IO) { + close(notify = false) + val candidate = Socket() + try { + candidate.connect(endpoint.address, CONNECT_TIMEOUT_MS) + candidate.soTimeout = HANDSHAKE_TIMEOUT_MS + candidate.tcpNoDelay = true + val candidateInput = DataInputStream(BufferedInputStream(candidate.getInputStream())) + val candidateOutput = DataOutputStream(BufferedOutputStream(candidate.getOutputStream())) + socket = candidate + input = candidateInput + output = candidateOutput + disconnected.set(false) + writeFrame(ConnectClientHello.ADAPTER.encode(hello)) + val response = ConnectHandshakeResponse.ADAPTER.decode(readFrame()) + candidate.soTimeout = 0 + response + } catch (error: Throwable) { + runCatching { candidate.close() } + socket = null + input = null + output = null + disconnected.set(true) + throw mapNetworkError("Unable to connect to ${endpoint.displayName}", error) + } + } + + fun startHeartbeat(sessionId: String) { + heartbeatJob?.cancel() + heartbeatJob = + scope.launch(Dispatchers.IO) { + var sequence = 0L + while (isActive && !disconnected.get()) { + delay(HEARTBEAT_INTERVAL_MS) + if (!operationMutex.tryLock()) continue + try { + sequence += 1 + val activeSocket = requireSocket() + activeSocket.soTimeout = HEARTBEAT_TIMEOUT_MS + writeFrame( + ConnectClientFrame.ADAPTER.encode( + ConnectClientFrame( + heartbeat = + ConnectHeartbeatRequest( + session_id = sessionId, + sequence = sequence, + ), + ), + ), + ) + val frame = ConnectHostFrame.ADAPTER.decode(readFrame()) + val response = frame.heartbeat + if (response?.session_id != sessionId || response.sequence != sequence) { + throw SDKException.networkError("The Connect host returned an invalid heartbeat") + } + activeSocket.soTimeout = 0 + } catch (error: Throwable) { + if (error !is CancellationException) { + close( + notify = true, + reason = + if (error is SocketTimeoutException) { + SDKException.timeout( + "The host stopped responding. It may have stopped or left the network.", + error, + ) + } else { + mapNetworkError("The connection to the host ended", error) + }, + ) + } + return@launch + } finally { + operationMutex.unlock() + } + } + } + } + + fun generate(invocation: ConnectInvocationRequest): Flow = + flow { + operationMutex.lock() + try { + requireSocket().soTimeout = 0 + writeFrame( + ConnectClientFrame.ADAPTER.encode( + ConnectClientFrame(invocation = invocation), + ), + ) + while (true) { + val frame = ConnectHostFrame.ADAPTER.decode(readFrame()) + val envelope = + frame.invocation_event + ?: throw SDKException.networkError("The Connect host returned an invalid response") + if (envelope.request_id != invocation.request_id || envelope.event == null) { + throw SDKException.networkError("The Connect host returned a response for another request") + } + emit(envelope.event) + if (envelope.event.is_final) break + } + } catch (error: CancellationException) { + // A partially consumed framed stream cannot be reused safely. + close(notify = true, reason = error) + throw error + } catch (error: Throwable) { + val mapped = mapNetworkError("Generation through the host failed", error) + close(notify = true, reason = mapped) + throw mapped + } finally { + operationMutex.unlock() + } + } + + fun close( + notify: Boolean = false, + reason: Throwable = SDKException.networkError("The connection to the host ended"), + ) { + heartbeatJob?.cancel() + heartbeatJob = null + val hadConnection = !disconnected.getAndSet(true) + val current = socket + socket = null + input = null + output = null + runCatching { current?.close() } + if (notify && hadConnection) onDisconnected(reason) + } + + private fun requireSocket(): Socket = + socket?.takeUnless { it.isClosed } + ?: throw SDKException.networkError("The selected host is no longer connected") + + private fun writeFrame(payload: ByteArray) { + require(payload.isNotEmpty() && payload.size <= MAXIMUM_FRAME_LENGTH) { + "Connect frame size is invalid" + } + val stream = output ?: throw EOFException("Connect output stream is closed") + stream.writeInt(payload.size) + stream.write(payload) + stream.flush() + } + + private fun readFrame(): ByteArray { + val stream = input ?: throw EOFException("Connect input stream is closed") + val length = stream.readInt() + if (length !in 1..MAXIMUM_FRAME_LENGTH) { + throw SDKException.networkError("The Connect host returned an invalid frame size") + } + return ByteArray(length).also(stream::readFully) + } + + private fun mapNetworkError(message: String, error: Throwable): Throwable = + when (error) { + is SDKException -> error + is SocketTimeoutException -> SDKException.timeout(message, error) + else -> SDKException.networkError("$message: ${error.message ?: "network error"}", error) + } + + private companion object { + const val MAXIMUM_FRAME_LENGTH = 4 * 1024 * 1024 + const val CONNECT_TIMEOUT_MS = 5_000 + const val HANDSHAKE_TIMEOUT_MS = 5_000 + const val HEARTBEAT_INTERVAL_MS = 3_000L + const val HEARTBEAT_TIMEOUT_MS = 2_000 + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientFrame.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientFrame.kt new file mode 100644 index 0000000000..34ebd56df5 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientFrame.kt @@ -0,0 +1,155 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectClientFrame in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.countNonNull +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Every frame after the initial ClientHello handshake is carried in one of + * these explicit envelopes. This leaves typed inference traffic untouched + * while allowing clients to verify an otherwise-idle host connection. + */ +public class ConnectClientFrame( + @field:WireField( + tag = 1, + adapter = "ai.runanywhere.proto.v1.ConnectInvocationRequest#ADAPTER", + oneofName = "payload", + schemaIndex = 0, + ) + public val invocation: ConnectInvocationRequest? = null, + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.ConnectHeartbeatRequest#ADAPTER", + oneofName = "payload", + schemaIndex = 1, + ) + public val heartbeat: ConnectHeartbeatRequest? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + init { + require(countNonNull(invocation, heartbeat) <= 1) { + "At most one of invocation, heartbeat may be non-null" + } + } + + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectClientFrame) return false + if (unknownFields != other.unknownFields) return false + if (invocation != other.invocation) return false + if (heartbeat != other.heartbeat) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + (invocation?.hashCode() ?: 0) + result = result * 37 + (heartbeat?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + if (invocation != null) result += """invocation=$invocation""" + if (heartbeat != null) result += """heartbeat=$heartbeat""" + return result.joinToString(prefix = "ConnectClientFrame{", separator = ", ", postfix = "}") + } + + public fun copy( + invocation: ConnectInvocationRequest? = this.invocation, + heartbeat: ConnectHeartbeatRequest? = this.heartbeat, + unknownFields: ByteString = this.unknownFields, + ): ConnectClientFrame = ConnectClientFrame(invocation, heartbeat, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectClientFrame::class, + "type.googleapis.com/runanywhere.v1.ConnectClientFrame", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectClientFrame): Int { + var size = value.unknownFields.size + size += ConnectInvocationRequest.ADAPTER.encodedSizeWithTag(1, value.invocation) + size += ConnectHeartbeatRequest.ADAPTER.encodedSizeWithTag(2, value.heartbeat) + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectClientFrame) { + ConnectInvocationRequest.ADAPTER.encodeWithTag(writer, 1, value.invocation) + ConnectHeartbeatRequest.ADAPTER.encodeWithTag(writer, 2, value.heartbeat) + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectClientFrame) { + writer.writeBytes(value.unknownFields) + ConnectHeartbeatRequest.ADAPTER.encodeWithTag(writer, 2, value.heartbeat) + ConnectInvocationRequest.ADAPTER.encodeWithTag(writer, 1, value.invocation) + } + + override fun decode(reader: ProtoReader): ConnectClientFrame { + var invocation: ConnectInvocationRequest? = null + var heartbeat: ConnectHeartbeatRequest? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> invocation = ConnectInvocationRequest.ADAPTER.decode(reader) + 2 -> heartbeat = ConnectHeartbeatRequest.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectClientFrame( + invocation = invocation, + heartbeat = heartbeat, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectClientFrame): ConnectClientFrame = value.copy( + invocation = value.invocation?.let(ConnectInvocationRequest.ADAPTER::redact), + heartbeat = value.heartbeat?.let(ConnectHeartbeatRequest.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientHello.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientHello.kt new file mode 100644 index 0000000000..98428752da --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientHello.kt @@ -0,0 +1,210 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectClientHello in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Sent by a client immediately after the platform transport is connected. + */ +public class ConnectClientHello( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "instanceId", + schemaIndex = 0, + ) + public val instance_id: String = "", + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "displayName", + schemaIndex = 1, + ) + public val display_name: String = "", + @field:WireField( + tag = 3, + adapter = "ai.runanywhere.proto.v1.ConnectPlatform#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 2, + ) + public val platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED, + @field:WireField( + tag = 4, + adapter = "com.squareup.wire.ProtoAdapter#UINT32", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "protocolVersion", + schemaIndex = 3, + ) + public val protocol_version: Int = 0, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectClientHello) return false + if (unknownFields != other.unknownFields) return false + if (instance_id != other.instance_id) return false + if (display_name != other.display_name) return false + if (platform != other.platform) return false + if (protocol_version != other.protocol_version) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + instance_id.hashCode() + result = result * 37 + display_name.hashCode() + result = result * 37 + platform.hashCode() + result = result * 37 + protocol_version.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """instance_id=${sanitize(instance_id)}""" + result += """display_name=${sanitize(display_name)}""" + result += """platform=$platform""" + result += """protocol_version=$protocol_version""" + return result.joinToString(prefix = "ConnectClientHello{", separator = ", ", postfix = "}") + } + + public fun copy( + instance_id: String = this.instance_id, + display_name: String = this.display_name, + platform: ConnectPlatform = this.platform, + protocol_version: Int = this.protocol_version, + unknownFields: ByteString = this.unknownFields, + ): ConnectClientHello = ConnectClientHello(instance_id, display_name, platform, protocol_version, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectClientHello::class, + "type.googleapis.com/runanywhere.v1.ConnectClientHello", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectClientHello): Int { + var size = value.unknownFields.size + if (value.instance_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.instance_id) + } + if (value.display_name != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + size += ConnectPlatform.ADAPTER.encodedSizeWithTag(3, value.platform) + } + if (value.protocol_version != 0) { + size += ProtoAdapter.UINT32.encodedSizeWithTag(4, value.protocol_version) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectClientHello) { + if (value.instance_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.instance_id) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 3, value.platform) + } + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.protocol_version) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectClientHello) { + writer.writeBytes(value.unknownFields) + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.protocol_version) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 3, value.platform) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.display_name) + } + if (value.instance_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.instance_id) + } + } + + override fun decode(reader: ProtoReader): ConnectClientHello { + var instance_id: String = "" + var display_name: String = "" + var platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + var protocol_version: Int = 0 + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> instance_id = ProtoAdapter.STRING.decode(reader) + 2 -> display_name = ProtoAdapter.STRING.decode(reader) + 3 -> try { + platform = ConnectPlatform.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 4 -> protocol_version = ProtoAdapter.UINT32.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectClientHello( + instance_id = instance_id, + display_name = display_name, + platform = platform, + protocol_version = protocol_version, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectClientHello): ConnectClientHello = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientSessionState.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientSessionState.kt new file mode 100644 index 0000000000..fc4b2b5b69 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientSessionState.kt @@ -0,0 +1,235 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectClientSessionState in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * The client validates the host response through commons and receives the + * public session state it can expose to its platform UI. + */ +public class ConnectClientSessionState( + @field:WireField( + tag = 1, + adapter = "ai.runanywhere.proto.v1.ConnectSessionState#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 0, + ) + public val state: ConnectSessionState = ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED, + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "sessionId", + schemaIndex = 1, + ) + public val session_id: String = "", + @field:WireField( + tag = 3, + adapter = "ai.runanywhere.proto.v1.ConnectDiscoveryMetadata#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 2, + ) + public val host: ConnectDiscoveryMetadata? = null, + @field:WireField( + tag = 4, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "errorMessage", + schemaIndex = 3, + ) + public val error_message: String = "", + @field:WireField( + tag = 5, + adapter = "ai.runanywhere.proto.v1.ConnectModelDescriptor#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 4, + ) + public val model: ConnectModelDescriptor? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectClientSessionState) return false + if (unknownFields != other.unknownFields) return false + if (state != other.state) return false + if (session_id != other.session_id) return false + if (host != other.host) return false + if (error_message != other.error_message) return false + if (model != other.model) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + state.hashCode() + result = result * 37 + session_id.hashCode() + result = result * 37 + (host?.hashCode() ?: 0) + result = result * 37 + error_message.hashCode() + result = result * 37 + (model?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """state=$state""" + result += """session_id=${sanitize(session_id)}""" + if (host != null) result += """host=$host""" + result += """error_message=${sanitize(error_message)}""" + if (model != null) result += """model=$model""" + return result.joinToString(prefix = "ConnectClientSessionState{", separator = ", ", postfix = "}") + } + + public fun copy( + state: ConnectSessionState = this.state, + session_id: String = this.session_id, + host: ConnectDiscoveryMetadata? = this.host, + error_message: String = this.error_message, + model: ConnectModelDescriptor? = this.model, + unknownFields: ByteString = this.unknownFields, + ): ConnectClientSessionState = ConnectClientSessionState(state, session_id, host, error_message, model, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectClientSessionState::class, + "type.googleapis.com/runanywhere.v1.ConnectClientSessionState", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectClientSessionState): Int { + var size = value.unknownFields.size + if (value.state != ai.runanywhere.proto.v1.ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED) { + size += ConnectSessionState.ADAPTER.encodedSizeWithTag(1, value.state) + } + if (value.session_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.session_id) + } + if (value.host != null) { + size += ConnectDiscoveryMetadata.ADAPTER.encodedSizeWithTag(3, value.host) + } + if (value.error_message != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.error_message) + } + if (value.model != null) { + size += ConnectModelDescriptor.ADAPTER.encodedSizeWithTag(5, value.model) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectClientSessionState) { + if (value.state != ai.runanywhere.proto.v1.ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED) { + ConnectSessionState.ADAPTER.encodeWithTag(writer, 1, value.state) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.session_id) + } + if (value.host != null) { + ConnectDiscoveryMetadata.ADAPTER.encodeWithTag(writer, 3, value.host) + } + if (value.error_message != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 4, value.error_message) + } + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 5, value.model) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectClientSessionState) { + writer.writeBytes(value.unknownFields) + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 5, value.model) + } + if (value.error_message != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 4, value.error_message) + } + if (value.host != null) { + ConnectDiscoveryMetadata.ADAPTER.encodeWithTag(writer, 3, value.host) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.session_id) + } + if (value.state != ai.runanywhere.proto.v1.ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED) { + ConnectSessionState.ADAPTER.encodeWithTag(writer, 1, value.state) + } + } + + override fun decode(reader: ProtoReader): ConnectClientSessionState { + var state: ConnectSessionState = ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED + var session_id: String = "" + var host: ConnectDiscoveryMetadata? = null + var error_message: String = "" + var model: ConnectModelDescriptor? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> try { + state = ConnectSessionState.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 2 -> session_id = ProtoAdapter.STRING.decode(reader) + 3 -> host = ConnectDiscoveryMetadata.ADAPTER.decode(reader) + 4 -> error_message = ProtoAdapter.STRING.decode(reader) + 5 -> model = ConnectModelDescriptor.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectClientSessionState( + state = state, + session_id = session_id, + host = host, + error_message = error_message, + model = model, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectClientSessionState): ConnectClientSessionState = value.copy( + host = value.host?.let(ConnectDiscoveryMetadata.ADAPTER::redact), + model = value.model?.let(ConnectModelDescriptor.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientStartRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientStartRequest.kt new file mode 100644 index 0000000000..de962f0331 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectClientStartRequest.kt @@ -0,0 +1,183 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectClientStartRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectClientStartRequest( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "displayName", + schemaIndex = 0, + ) + public val display_name: String = "", + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.ConnectPlatform#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 1, + ) + public val platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED, + @field:WireField( + tag = 3, + adapter = "com.squareup.wire.ProtoAdapter#UINT32", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "protocolVersion", + schemaIndex = 2, + ) + public val protocol_version: Int = 0, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectClientStartRequest) return false + if (unknownFields != other.unknownFields) return false + if (display_name != other.display_name) return false + if (platform != other.platform) return false + if (protocol_version != other.protocol_version) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + display_name.hashCode() + result = result * 37 + platform.hashCode() + result = result * 37 + protocol_version.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """display_name=${sanitize(display_name)}""" + result += """platform=$platform""" + result += """protocol_version=$protocol_version""" + return result.joinToString(prefix = "ConnectClientStartRequest{", separator = ", ", postfix = "}") + } + + public fun copy( + display_name: String = this.display_name, + platform: ConnectPlatform = this.platform, + protocol_version: Int = this.protocol_version, + unknownFields: ByteString = this.unknownFields, + ): ConnectClientStartRequest = ConnectClientStartRequest(display_name, platform, protocol_version, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectClientStartRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectClientStartRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectClientStartRequest): Int { + var size = value.unknownFields.size + if (value.display_name != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + size += ConnectPlatform.ADAPTER.encodedSizeWithTag(2, value.platform) + } + if (value.protocol_version != 0) { + size += ProtoAdapter.UINT32.encodedSizeWithTag(3, value.protocol_version) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectClientStartRequest) { + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 2, value.platform) + } + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.protocol_version) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectClientStartRequest) { + writer.writeBytes(value.unknownFields) + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.protocol_version) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 2, value.platform) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.display_name) + } + } + + override fun decode(reader: ProtoReader): ConnectClientStartRequest { + var display_name: String = "" + var platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + var protocol_version: Int = 0 + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> display_name = ProtoAdapter.STRING.decode(reader) + 2 -> try { + platform = ConnectPlatform.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 3 -> protocol_version = ProtoAdapter.UINT32.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectClientStartRequest( + display_name = display_name, + platform = platform, + protocol_version = protocol_version, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectClientStartRequest): ConnectClientStartRequest = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectDiscoveryMetadata.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectDiscoveryMetadata.kt new file mode 100644 index 0000000000..892cea2ad0 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectDiscoveryMetadata.kt @@ -0,0 +1,212 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectDiscoveryMetadata in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Non-secret metadata published through LAN service discovery and echoed by + * the handshake. `instance_id` is generated anew whenever the host starts; + * it is not a persistent device identifier or a credential. + */ +public class ConnectDiscoveryMetadata( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "instanceId", + schemaIndex = 0, + ) + public val instance_id: String = "", + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "displayName", + schemaIndex = 1, + ) + public val display_name: String = "", + @field:WireField( + tag = 3, + adapter = "ai.runanywhere.proto.v1.ConnectPlatform#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 2, + ) + public val platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED, + @field:WireField( + tag = 4, + adapter = "com.squareup.wire.ProtoAdapter#UINT32", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "protocolVersion", + schemaIndex = 3, + ) + public val protocol_version: Int = 0, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectDiscoveryMetadata) return false + if (unknownFields != other.unknownFields) return false + if (instance_id != other.instance_id) return false + if (display_name != other.display_name) return false + if (platform != other.platform) return false + if (protocol_version != other.protocol_version) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + instance_id.hashCode() + result = result * 37 + display_name.hashCode() + result = result * 37 + platform.hashCode() + result = result * 37 + protocol_version.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """instance_id=${sanitize(instance_id)}""" + result += """display_name=${sanitize(display_name)}""" + result += """platform=$platform""" + result += """protocol_version=$protocol_version""" + return result.joinToString(prefix = "ConnectDiscoveryMetadata{", separator = ", ", postfix = "}") + } + + public fun copy( + instance_id: String = this.instance_id, + display_name: String = this.display_name, + platform: ConnectPlatform = this.platform, + protocol_version: Int = this.protocol_version, + unknownFields: ByteString = this.unknownFields, + ): ConnectDiscoveryMetadata = ConnectDiscoveryMetadata(instance_id, display_name, platform, protocol_version, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectDiscoveryMetadata::class, + "type.googleapis.com/runanywhere.v1.ConnectDiscoveryMetadata", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectDiscoveryMetadata): Int { + var size = value.unknownFields.size + if (value.instance_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.instance_id) + } + if (value.display_name != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + size += ConnectPlatform.ADAPTER.encodedSizeWithTag(3, value.platform) + } + if (value.protocol_version != 0) { + size += ProtoAdapter.UINT32.encodedSizeWithTag(4, value.protocol_version) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectDiscoveryMetadata) { + if (value.instance_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.instance_id) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 3, value.platform) + } + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.protocol_version) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectDiscoveryMetadata) { + writer.writeBytes(value.unknownFields) + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.protocol_version) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 3, value.platform) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.display_name) + } + if (value.instance_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.instance_id) + } + } + + override fun decode(reader: ProtoReader): ConnectDiscoveryMetadata { + var instance_id: String = "" + var display_name: String = "" + var platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + var protocol_version: Int = 0 + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> instance_id = ProtoAdapter.STRING.decode(reader) + 2 -> display_name = ProtoAdapter.STRING.decode(reader) + 3 -> try { + platform = ConnectPlatform.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 4 -> protocol_version = ProtoAdapter.UINT32.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectDiscoveryMetadata( + instance_id = instance_id, + display_name = display_name, + platform = platform, + protocol_version = protocol_version, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectDiscoveryMetadata): ConnectDiscoveryMetadata = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHandshakeResponse.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHandshakeResponse.kt new file mode 100644 index 0000000000..d962df1208 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHandshakeResponse.kt @@ -0,0 +1,235 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHandshakeResponse in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Sent by the host after commons has accepted or rejected a client hello. + */ +public class ConnectHandshakeResponse( + @field:WireField( + tag = 1, + adapter = "ai.runanywhere.proto.v1.ConnectHandshakeStatus#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 0, + ) + public val status: + ConnectHandshakeStatus = ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED, + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "sessionId", + schemaIndex = 1, + ) + public val session_id: String = "", + @field:WireField( + tag = 3, + adapter = "ai.runanywhere.proto.v1.ConnectDiscoveryMetadata#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 2, + ) + public val host: ConnectDiscoveryMetadata? = null, + @field:WireField( + tag = 4, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "rejectionReason", + schemaIndex = 3, + ) + public val rejection_reason: String = "", + @field:WireField( + tag = 5, + adapter = "ai.runanywhere.proto.v1.ConnectModelDescriptor#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 4, + ) + public val model: ConnectModelDescriptor? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHandshakeResponse) return false + if (unknownFields != other.unknownFields) return false + if (status != other.status) return false + if (session_id != other.session_id) return false + if (host != other.host) return false + if (rejection_reason != other.rejection_reason) return false + if (model != other.model) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + status.hashCode() + result = result * 37 + session_id.hashCode() + result = result * 37 + (host?.hashCode() ?: 0) + result = result * 37 + rejection_reason.hashCode() + result = result * 37 + (model?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """status=$status""" + result += """session_id=${sanitize(session_id)}""" + if (host != null) result += """host=$host""" + result += """rejection_reason=${sanitize(rejection_reason)}""" + if (model != null) result += """model=$model""" + return result.joinToString(prefix = "ConnectHandshakeResponse{", separator = ", ", postfix = "}") + } + + public fun copy( + status: ConnectHandshakeStatus = this.status, + session_id: String = this.session_id, + host: ConnectDiscoveryMetadata? = this.host, + rejection_reason: String = this.rejection_reason, + model: ConnectModelDescriptor? = this.model, + unknownFields: ByteString = this.unknownFields, + ): ConnectHandshakeResponse = ConnectHandshakeResponse(status, session_id, host, rejection_reason, model, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHandshakeResponse::class, + "type.googleapis.com/runanywhere.v1.ConnectHandshakeResponse", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHandshakeResponse): Int { + var size = value.unknownFields.size + if (value.status != ai.runanywhere.proto.v1.ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED) { + size += ConnectHandshakeStatus.ADAPTER.encodedSizeWithTag(1, value.status) + } + if (value.session_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.session_id) + } + if (value.host != null) { + size += ConnectDiscoveryMetadata.ADAPTER.encodedSizeWithTag(3, value.host) + } + if (value.rejection_reason != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.rejection_reason) + } + if (value.model != null) { + size += ConnectModelDescriptor.ADAPTER.encodedSizeWithTag(5, value.model) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHandshakeResponse) { + if (value.status != ai.runanywhere.proto.v1.ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED) { + ConnectHandshakeStatus.ADAPTER.encodeWithTag(writer, 1, value.status) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.session_id) + } + if (value.host != null) { + ConnectDiscoveryMetadata.ADAPTER.encodeWithTag(writer, 3, value.host) + } + if (value.rejection_reason != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 4, value.rejection_reason) + } + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 5, value.model) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHandshakeResponse) { + writer.writeBytes(value.unknownFields) + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 5, value.model) + } + if (value.rejection_reason != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 4, value.rejection_reason) + } + if (value.host != null) { + ConnectDiscoveryMetadata.ADAPTER.encodeWithTag(writer, 3, value.host) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.session_id) + } + if (value.status != ai.runanywhere.proto.v1.ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED) { + ConnectHandshakeStatus.ADAPTER.encodeWithTag(writer, 1, value.status) + } + } + + override fun decode(reader: ProtoReader): ConnectHandshakeResponse { + var status: ConnectHandshakeStatus = ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED + var session_id: String = "" + var host: ConnectDiscoveryMetadata? = null + var rejection_reason: String = "" + var model: ConnectModelDescriptor? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> try { + status = ConnectHandshakeStatus.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 2 -> session_id = ProtoAdapter.STRING.decode(reader) + 3 -> host = ConnectDiscoveryMetadata.ADAPTER.decode(reader) + 4 -> rejection_reason = ProtoAdapter.STRING.decode(reader) + 5 -> model = ConnectModelDescriptor.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectHandshakeResponse( + status = status, + session_id = session_id, + host = host, + rejection_reason = rejection_reason, + model = model, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHandshakeResponse): ConnectHandshakeResponse = value.copy( + host = value.host?.let(ConnectDiscoveryMetadata.ADAPTER::redact), + model = value.model?.let(ConnectModelDescriptor.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHandshakeStatus.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHandshakeStatus.kt new file mode 100644 index 0000000000..b89727b1b1 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHandshakeStatus.kt @@ -0,0 +1,46 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHandshakeStatus in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.EnumAdapter +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireEnum +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.JvmStatic +import kotlin.Int +import kotlin.Suppress + +public enum class ConnectHandshakeStatus( + override val `value`: Int, +) : WireEnum { + CONNECT_HANDSHAKE_STATUS_UNSPECIFIED(0), + CONNECT_HANDSHAKE_STATUS_ACCEPTED(1), + CONNECT_HANDSHAKE_STATUS_REJECTED(2), + ; + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : EnumAdapter( + ConnectHandshakeStatus::class, + PROTO_3, + ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED + ) { + override fun fromValue(`value`: Int): ConnectHandshakeStatus? = ConnectHandshakeStatus.fromValue(`value`) + } + + @JvmStatic + public fun fromValue(`value`: Int): ConnectHandshakeStatus? = when (`value`) { + 0 -> CONNECT_HANDSHAKE_STATUS_UNSPECIFIED + 1 -> CONNECT_HANDSHAKE_STATUS_ACCEPTED + 2 -> CONNECT_HANDSHAKE_STATUS_REJECTED + else -> null + } + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHeartbeatRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHeartbeatRequest.kt new file mode 100644 index 0000000000..da7e5034dd --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHeartbeatRequest.kt @@ -0,0 +1,161 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHeartbeatRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * The connection stays open between generations, so the client needs a + * control-plane exchange that can detect a host stopped while chat is idle. + * These frames deliberately remain separate from LLM invocation payloads: + * a health check must never reach a model or appear as an assistant message. + */ +public class ConnectHeartbeatRequest( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "sessionId", + schemaIndex = 0, + ) + public val session_id: String = "", + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#UINT64", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 1, + ) + public val sequence: Long = 0L, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHeartbeatRequest) return false + if (unknownFields != other.unknownFields) return false + if (session_id != other.session_id) return false + if (sequence != other.sequence) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + session_id.hashCode() + result = result * 37 + sequence.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """session_id=${sanitize(session_id)}""" + result += """sequence=$sequence""" + return result.joinToString(prefix = "ConnectHeartbeatRequest{", separator = ", ", postfix = "}") + } + + public fun copy( + session_id: String = this.session_id, + sequence: Long = this.sequence, + unknownFields: ByteString = this.unknownFields, + ): ConnectHeartbeatRequest = ConnectHeartbeatRequest(session_id, sequence, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHeartbeatRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectHeartbeatRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHeartbeatRequest): Int { + var size = value.unknownFields.size + if (value.session_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.session_id) + } + if (value.sequence != 0L) { + size += ProtoAdapter.UINT64.encodedSizeWithTag(2, value.sequence) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHeartbeatRequest) { + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + if (value.sequence != 0L) { + ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.sequence) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHeartbeatRequest) { + writer.writeBytes(value.unknownFields) + if (value.sequence != 0L) { + ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.sequence) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + } + + override fun decode(reader: ProtoReader): ConnectHeartbeatRequest { + var session_id: String = "" + var sequence: Long = 0L + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> session_id = ProtoAdapter.STRING.decode(reader) + 2 -> sequence = ProtoAdapter.UINT64.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectHeartbeatRequest( + session_id = session_id, + sequence = sequence, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHeartbeatRequest): ConnectHeartbeatRequest = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHeartbeatResponse.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHeartbeatResponse.kt new file mode 100644 index 0000000000..2522a5c610 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHeartbeatResponse.kt @@ -0,0 +1,155 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHeartbeatResponse in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectHeartbeatResponse( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "sessionId", + schemaIndex = 0, + ) + public val session_id: String = "", + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#UINT64", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 1, + ) + public val sequence: Long = 0L, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHeartbeatResponse) return false + if (unknownFields != other.unknownFields) return false + if (session_id != other.session_id) return false + if (sequence != other.sequence) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + session_id.hashCode() + result = result * 37 + sequence.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """session_id=${sanitize(session_id)}""" + result += """sequence=$sequence""" + return result.joinToString(prefix = "ConnectHeartbeatResponse{", separator = ", ", postfix = "}") + } + + public fun copy( + session_id: String = this.session_id, + sequence: Long = this.sequence, + unknownFields: ByteString = this.unknownFields, + ): ConnectHeartbeatResponse = ConnectHeartbeatResponse(session_id, sequence, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHeartbeatResponse::class, + "type.googleapis.com/runanywhere.v1.ConnectHeartbeatResponse", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHeartbeatResponse): Int { + var size = value.unknownFields.size + if (value.session_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.session_id) + } + if (value.sequence != 0L) { + size += ProtoAdapter.UINT64.encodedSizeWithTag(2, value.sequence) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHeartbeatResponse) { + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + if (value.sequence != 0L) { + ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.sequence) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHeartbeatResponse) { + writer.writeBytes(value.unknownFields) + if (value.sequence != 0L) { + ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.sequence) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + } + + override fun decode(reader: ProtoReader): ConnectHeartbeatResponse { + var session_id: String = "" + var sequence: Long = 0L + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> session_id = ProtoAdapter.STRING.decode(reader) + 2 -> sequence = ProtoAdapter.UINT64.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectHeartbeatResponse( + session_id = session_id, + sequence = sequence, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHeartbeatResponse): ConnectHeartbeatResponse = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostFrame.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostFrame.kt new file mode 100644 index 0000000000..22a96cb49d --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostFrame.kt @@ -0,0 +1,150 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHostFrame in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.countNonNull +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectHostFrame( + @field:WireField( + tag = 1, + adapter = "ai.runanywhere.proto.v1.ConnectInvocationEvent#ADAPTER", + jsonName = "invocationEvent", + oneofName = "payload", + schemaIndex = 0, + ) + public val invocation_event: ConnectInvocationEvent? = null, + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.ConnectHeartbeatResponse#ADAPTER", + oneofName = "payload", + schemaIndex = 1, + ) + public val heartbeat: ConnectHeartbeatResponse? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + init { + require(countNonNull(invocation_event, heartbeat) <= 1) { + "At most one of invocation_event, heartbeat may be non-null" + } + } + + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHostFrame) return false + if (unknownFields != other.unknownFields) return false + if (invocation_event != other.invocation_event) return false + if (heartbeat != other.heartbeat) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + (invocation_event?.hashCode() ?: 0) + result = result * 37 + (heartbeat?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + if (invocation_event != null) result += """invocation_event=$invocation_event""" + if (heartbeat != null) result += """heartbeat=$heartbeat""" + return result.joinToString(prefix = "ConnectHostFrame{", separator = ", ", postfix = "}") + } + + public fun copy( + invocation_event: ConnectInvocationEvent? = this.invocation_event, + heartbeat: ConnectHeartbeatResponse? = this.heartbeat, + unknownFields: ByteString = this.unknownFields, + ): ConnectHostFrame = ConnectHostFrame(invocation_event, heartbeat, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHostFrame::class, + "type.googleapis.com/runanywhere.v1.ConnectHostFrame", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHostFrame): Int { + var size = value.unknownFields.size + size += ConnectInvocationEvent.ADAPTER.encodedSizeWithTag(1, value.invocation_event) + size += ConnectHeartbeatResponse.ADAPTER.encodedSizeWithTag(2, value.heartbeat) + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHostFrame) { + ConnectInvocationEvent.ADAPTER.encodeWithTag(writer, 1, value.invocation_event) + ConnectHeartbeatResponse.ADAPTER.encodeWithTag(writer, 2, value.heartbeat) + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHostFrame) { + writer.writeBytes(value.unknownFields) + ConnectHeartbeatResponse.ADAPTER.encodeWithTag(writer, 2, value.heartbeat) + ConnectInvocationEvent.ADAPTER.encodeWithTag(writer, 1, value.invocation_event) + } + + override fun decode(reader: ProtoReader): ConnectHostFrame { + var invocation_event: ConnectInvocationEvent? = null + var heartbeat: ConnectHeartbeatResponse? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> invocation_event = ConnectInvocationEvent.ADAPTER.decode(reader) + 2 -> heartbeat = ConnectHeartbeatResponse.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectHostFrame( + invocation_event = invocation_event, + heartbeat = heartbeat, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHostFrame): ConnectHostFrame = value.copy( + invocation_event = value.invocation_event?.let(ConnectInvocationEvent.ADAPTER::redact), + heartbeat = value.heartbeat?.let(ConnectHeartbeatResponse.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostStartRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostStartRequest.kt new file mode 100644 index 0000000000..c044d485e9 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostStartRequest.kt @@ -0,0 +1,207 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHostStartRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectHostStartRequest( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "displayName", + schemaIndex = 0, + ) + public val display_name: String = "", + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.ConnectPlatform#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 1, + ) + public val platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED, + @field:WireField( + tag = 3, + adapter = "com.squareup.wire.ProtoAdapter#UINT32", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "protocolVersion", + schemaIndex = 2, + ) + public val protocol_version: Int = 0, + @field:WireField( + tag = 4, + adapter = "ai.runanywhere.proto.v1.ConnectModelDescriptor#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 3, + ) + public val model: ConnectModelDescriptor? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHostStartRequest) return false + if (unknownFields != other.unknownFields) return false + if (display_name != other.display_name) return false + if (platform != other.platform) return false + if (protocol_version != other.protocol_version) return false + if (model != other.model) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + display_name.hashCode() + result = result * 37 + platform.hashCode() + result = result * 37 + protocol_version.hashCode() + result = result * 37 + (model?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """display_name=${sanitize(display_name)}""" + result += """platform=$platform""" + result += """protocol_version=$protocol_version""" + if (model != null) result += """model=$model""" + return result.joinToString(prefix = "ConnectHostStartRequest{", separator = ", ", postfix = "}") + } + + public fun copy( + display_name: String = this.display_name, + platform: ConnectPlatform = this.platform, + protocol_version: Int = this.protocol_version, + model: ConnectModelDescriptor? = this.model, + unknownFields: ByteString = this.unknownFields, + ): ConnectHostStartRequest = ConnectHostStartRequest(display_name, platform, protocol_version, model, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHostStartRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectHostStartRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHostStartRequest): Int { + var size = value.unknownFields.size + if (value.display_name != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + size += ConnectPlatform.ADAPTER.encodedSizeWithTag(2, value.platform) + } + if (value.protocol_version != 0) { + size += ProtoAdapter.UINT32.encodedSizeWithTag(3, value.protocol_version) + } + if (value.model != null) { + size += ConnectModelDescriptor.ADAPTER.encodedSizeWithTag(4, value.model) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHostStartRequest) { + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.display_name) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 2, value.platform) + } + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.protocol_version) + } + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 4, value.model) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHostStartRequest) { + writer.writeBytes(value.unknownFields) + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 4, value.model) + } + if (value.protocol_version != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.protocol_version) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 2, value.platform) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.display_name) + } + } + + override fun decode(reader: ProtoReader): ConnectHostStartRequest { + var display_name: String = "" + var platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + var protocol_version: Int = 0 + var model: ConnectModelDescriptor? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> display_name = ProtoAdapter.STRING.decode(reader) + 2 -> try { + platform = ConnectPlatform.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 3 -> protocol_version = ProtoAdapter.UINT32.decode(reader) + 4 -> model = ConnectModelDescriptor.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectHostStartRequest( + display_name = display_name, + platform = platform, + protocol_version = protocol_version, + model = model, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHostStartRequest): ConnectHostStartRequest = value.copy( + model = value.model?.let(ConnectModelDescriptor.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostState.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostState.kt new file mode 100644 index 0000000000..0d787fee0a --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostState.kt @@ -0,0 +1,228 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHostState in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectHostState( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#BOOL", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "isHosting", + schemaIndex = 0, + ) + public val is_hosting: Boolean = false, + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.ConnectDiscoveryMetadata#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "discoveryMetadata", + schemaIndex = 1, + ) + public val discovery_metadata: ConnectDiscoveryMetadata? = null, + @field:WireField( + tag = 3, + adapter = "com.squareup.wire.ProtoAdapter#UINT32", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "activeClientCount", + schemaIndex = 2, + ) + public val active_client_count: Int = 0, + @field:WireField( + tag = 4, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "errorMessage", + schemaIndex = 3, + ) + public val error_message: String = "", + @field:WireField( + tag = 5, + adapter = "ai.runanywhere.proto.v1.ConnectModelDescriptor#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 4, + ) + public val model: ConnectModelDescriptor? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHostState) return false + if (unknownFields != other.unknownFields) return false + if (is_hosting != other.is_hosting) return false + if (discovery_metadata != other.discovery_metadata) return false + if (active_client_count != other.active_client_count) return false + if (error_message != other.error_message) return false + if (model != other.model) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + is_hosting.hashCode() + result = result * 37 + (discovery_metadata?.hashCode() ?: 0) + result = result * 37 + active_client_count.hashCode() + result = result * 37 + error_message.hashCode() + result = result * 37 + (model?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """is_hosting=$is_hosting""" + if (discovery_metadata != null) result += """discovery_metadata=$discovery_metadata""" + result += """active_client_count=$active_client_count""" + result += """error_message=${sanitize(error_message)}""" + if (model != null) result += """model=$model""" + return result.joinToString(prefix = "ConnectHostState{", separator = ", ", postfix = "}") + } + + public fun copy( + is_hosting: Boolean = this.is_hosting, + discovery_metadata: ConnectDiscoveryMetadata? = this.discovery_metadata, + active_client_count: Int = this.active_client_count, + error_message: String = this.error_message, + model: ConnectModelDescriptor? = this.model, + unknownFields: ByteString = this.unknownFields, + ): ConnectHostState = ConnectHostState(is_hosting, discovery_metadata, active_client_count, error_message, model, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHostState::class, + "type.googleapis.com/runanywhere.v1.ConnectHostState", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHostState): Int { + var size = value.unknownFields.size + if (value.is_hosting != false) { + size += ProtoAdapter.BOOL.encodedSizeWithTag(1, value.is_hosting) + } + if (value.discovery_metadata != null) { + size += ConnectDiscoveryMetadata.ADAPTER.encodedSizeWithTag(2, value.discovery_metadata) + } + if (value.active_client_count != 0) { + size += ProtoAdapter.UINT32.encodedSizeWithTag(3, value.active_client_count) + } + if (value.error_message != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.error_message) + } + if (value.model != null) { + size += ConnectModelDescriptor.ADAPTER.encodedSizeWithTag(5, value.model) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHostState) { + if (value.is_hosting != false) { + ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.is_hosting) + } + if (value.discovery_metadata != null) { + ConnectDiscoveryMetadata.ADAPTER.encodeWithTag(writer, 2, value.discovery_metadata) + } + if (value.active_client_count != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.active_client_count) + } + if (value.error_message != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 4, value.error_message) + } + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 5, value.model) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHostState) { + writer.writeBytes(value.unknownFields) + if (value.model != null) { + ConnectModelDescriptor.ADAPTER.encodeWithTag(writer, 5, value.model) + } + if (value.error_message != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 4, value.error_message) + } + if (value.active_client_count != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.active_client_count) + } + if (value.discovery_metadata != null) { + ConnectDiscoveryMetadata.ADAPTER.encodeWithTag(writer, 2, value.discovery_metadata) + } + if (value.is_hosting != false) { + ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.is_hosting) + } + } + + override fun decode(reader: ProtoReader): ConnectHostState { + var is_hosting: Boolean = false + var discovery_metadata: ConnectDiscoveryMetadata? = null + var active_client_count: Int = 0 + var error_message: String = "" + var model: ConnectModelDescriptor? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> is_hosting = ProtoAdapter.BOOL.decode(reader) + 2 -> discovery_metadata = ConnectDiscoveryMetadata.ADAPTER.decode(reader) + 3 -> active_client_count = ProtoAdapter.UINT32.decode(reader) + 4 -> error_message = ProtoAdapter.STRING.decode(reader) + 5 -> model = ConnectModelDescriptor.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectHostState( + is_hosting = is_hosting, + discovery_metadata = discovery_metadata, + active_client_count = active_client_count, + error_message = error_message, + model = model, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHostState): ConnectHostState = value.copy( + discovery_metadata = value.discovery_metadata?.let(ConnectDiscoveryMetadata.ADAPTER::redact), + model = value.model?.let(ConnectModelDescriptor.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostStopRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostStopRequest.kt new file mode 100644 index 0000000000..86c1919efa --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectHostStopRequest.kt @@ -0,0 +1,90 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectHostStopRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.`internal`.JvmField +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectHostStopRequest( + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectHostStopRequest) return false + if (unknownFields != other.unknownFields) return false + return true + } + + override fun hashCode(): Int = unknownFields.hashCode() + + override fun toString(): String = "ConnectHostStopRequest{}" + + public fun copy(unknownFields: ByteString = this.unknownFields): ConnectHostStopRequest = ConnectHostStopRequest(unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectHostStopRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectHostStopRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectHostStopRequest): Int { + var size = value.unknownFields.size + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectHostStopRequest) { + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectHostStopRequest) { + writer.writeBytes(value.unknownFields) + } + + override fun decode(reader: ProtoReader): ConnectHostStopRequest { + val unknownFields = reader.forEachTag(reader::readUnknownField) + return ConnectHostStopRequest( + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectHostStopRequest): ConnectHostStopRequest = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationEvent.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationEvent.kt new file mode 100644 index 0000000000..bf925bab7d --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationEvent.kt @@ -0,0 +1,161 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectInvocationEvent in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Hosts forward the SDK's canonical stream events without translating them to + * a platform-specific token shape. This is the portable streaming surface for + * future Kotlin, React Native, Flutter, and Web clients. + */ +public class ConnectInvocationEvent( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "requestId", + schemaIndex = 0, + ) + public val request_id: String = "", + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.LLMStreamEvent#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 1, + ) + public val event: LLMStreamEvent? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectInvocationEvent) return false + if (unknownFields != other.unknownFields) return false + if (request_id != other.request_id) return false + if (event != other.event) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + request_id.hashCode() + result = result * 37 + (event?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """request_id=${sanitize(request_id)}""" + if (event != null) result += """event=$event""" + return result.joinToString(prefix = "ConnectInvocationEvent{", separator = ", ", postfix = "}") + } + + public fun copy( + request_id: String = this.request_id, + event: LLMStreamEvent? = this.event, + unknownFields: ByteString = this.unknownFields, + ): ConnectInvocationEvent = ConnectInvocationEvent(request_id, event, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectInvocationEvent::class, + "type.googleapis.com/runanywhere.v1.ConnectInvocationEvent", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectInvocationEvent): Int { + var size = value.unknownFields.size + if (value.request_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.request_id) + } + if (value.event != null) { + size += LLMStreamEvent.ADAPTER.encodedSizeWithTag(2, value.event) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectInvocationEvent) { + if (value.request_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.request_id) + } + if (value.event != null) { + LLMStreamEvent.ADAPTER.encodeWithTag(writer, 2, value.event) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectInvocationEvent) { + writer.writeBytes(value.unknownFields) + if (value.event != null) { + LLMStreamEvent.ADAPTER.encodeWithTag(writer, 2, value.event) + } + if (value.request_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.request_id) + } + } + + override fun decode(reader: ProtoReader): ConnectInvocationEvent { + var request_id: String = "" + var event: LLMStreamEvent? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> request_id = ProtoAdapter.STRING.decode(reader) + 2 -> event = LLMStreamEvent.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectInvocationEvent( + request_id = request_id, + event = event, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectInvocationEvent): ConnectInvocationEvent = value.copy( + event = value.event?.let(LLMStreamEvent.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationRequest.kt new file mode 100644 index 0000000000..3384982dc8 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationRequest.kt @@ -0,0 +1,185 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectInvocationRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * A client sends the existing typed LLM request to the selected host model. + * `session_id` binds the request to the prior handshake; `generation.model_id` + * must match the model the host published for that session. + */ +public class ConnectInvocationRequest( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "sessionId", + schemaIndex = 0, + ) + public val session_id: String = "", + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "requestId", + schemaIndex = 1, + ) + public val request_id: String = "", + @field:WireField( + tag = 3, + adapter = "ai.runanywhere.proto.v1.LLMGenerateRequest#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 2, + ) + public val generation: LLMGenerateRequest? = null, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectInvocationRequest) return false + if (unknownFields != other.unknownFields) return false + if (session_id != other.session_id) return false + if (request_id != other.request_id) return false + if (generation != other.generation) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + session_id.hashCode() + result = result * 37 + request_id.hashCode() + result = result * 37 + (generation?.hashCode() ?: 0) + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """session_id=${sanitize(session_id)}""" + result += """request_id=${sanitize(request_id)}""" + if (generation != null) result += """generation=$generation""" + return result.joinToString(prefix = "ConnectInvocationRequest{", separator = ", ", postfix = "}") + } + + public fun copy( + session_id: String = this.session_id, + request_id: String = this.request_id, + generation: LLMGenerateRequest? = this.generation, + unknownFields: ByteString = this.unknownFields, + ): ConnectInvocationRequest = ConnectInvocationRequest(session_id, request_id, generation, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectInvocationRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectInvocationRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectInvocationRequest): Int { + var size = value.unknownFields.size + if (value.session_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.session_id) + } + if (value.request_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.request_id) + } + if (value.generation != null) { + size += LLMGenerateRequest.ADAPTER.encodedSizeWithTag(3, value.generation) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectInvocationRequest) { + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + if (value.request_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.request_id) + } + if (value.generation != null) { + LLMGenerateRequest.ADAPTER.encodeWithTag(writer, 3, value.generation) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectInvocationRequest) { + writer.writeBytes(value.unknownFields) + if (value.generation != null) { + LLMGenerateRequest.ADAPTER.encodeWithTag(writer, 3, value.generation) + } + if (value.request_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.request_id) + } + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + } + + override fun decode(reader: ProtoReader): ConnectInvocationRequest { + var session_id: String = "" + var request_id: String = "" + var generation: LLMGenerateRequest? = null + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> session_id = ProtoAdapter.STRING.decode(reader) + 2 -> request_id = ProtoAdapter.STRING.decode(reader) + 3 -> generation = LLMGenerateRequest.ADAPTER.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectInvocationRequest( + session_id = session_id, + request_id = request_id, + generation = generation, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectInvocationRequest): ConnectInvocationRequest = value.copy( + generation = value.generation?.let(LLMGenerateRequest.ADAPTER::redact), + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationValidation.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationValidation.kt new file mode 100644 index 0000000000..06b1e59c75 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectInvocationValidation.kt @@ -0,0 +1,159 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectInvocationValidation in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Commons validates that an invocation belongs to an active session and uses + * the host's published model before any platform runtime receives the prompt. + */ +public class ConnectInvocationValidation( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#BOOL", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 0, + ) + public val accepted: Boolean = false, + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "rejectionReason", + schemaIndex = 1, + ) + public val rejection_reason: String = "", + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectInvocationValidation) return false + if (unknownFields != other.unknownFields) return false + if (accepted != other.accepted) return false + if (rejection_reason != other.rejection_reason) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + accepted.hashCode() + result = result * 37 + rejection_reason.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """accepted=$accepted""" + result += """rejection_reason=${sanitize(rejection_reason)}""" + return result.joinToString(prefix = "ConnectInvocationValidation{", separator = ", ", postfix = "}") + } + + public fun copy( + accepted: Boolean = this.accepted, + rejection_reason: String = this.rejection_reason, + unknownFields: ByteString = this.unknownFields, + ): ConnectInvocationValidation = ConnectInvocationValidation(accepted, rejection_reason, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectInvocationValidation::class, + "type.googleapis.com/runanywhere.v1.ConnectInvocationValidation", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectInvocationValidation): Int { + var size = value.unknownFields.size + if (value.accepted != false) { + size += ProtoAdapter.BOOL.encodedSizeWithTag(1, value.accepted) + } + if (value.rejection_reason != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.rejection_reason) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectInvocationValidation) { + if (value.accepted != false) { + ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.accepted) + } + if (value.rejection_reason != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.rejection_reason) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectInvocationValidation) { + writer.writeBytes(value.unknownFields) + if (value.rejection_reason != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.rejection_reason) + } + if (value.accepted != false) { + ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.accepted) + } + } + + override fun decode(reader: ProtoReader): ConnectInvocationValidation { + var accepted: Boolean = false + var rejection_reason: String = "" + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> accepted = ProtoAdapter.BOOL.decode(reader) + 2 -> rejection_reason = ProtoAdapter.STRING.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectInvocationValidation( + accepted = accepted, + rejection_reason = rejection_reason, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectInvocationValidation): ConnectInvocationValidation = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectModelDescriptor.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectModelDescriptor.kt new file mode 100644 index 0000000000..7f03dac3fb --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectModelDescriptor.kt @@ -0,0 +1,232 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectModelDescriptor in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * The single language model currently shared by a host. A host must select a + * loaded model before it starts publishing; this lets clients enter chat + * immediately without downloading or selecting a local model. + */ +public class ConnectModelDescriptor( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "modelId", + schemaIndex = 0, + ) + public val model_id: String = "", + @field:WireField( + tag = 2, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "displayName", + schemaIndex = 1, + ) + public val display_name: String = "", + @field:WireField( + tag = 3, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 2, + ) + public val framework: String = "", + @field:WireField( + tag = 4, + adapter = "com.squareup.wire.ProtoAdapter#UINT32", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "contextWindow", + schemaIndex = 3, + ) + public val context_window: Int = 0, + @field:WireField( + tag = 5, + adapter = "com.squareup.wire.ProtoAdapter#BOOL", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "supportsStreaming", + schemaIndex = 4, + ) + public val supports_streaming: Boolean = false, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectModelDescriptor) return false + if (unknownFields != other.unknownFields) return false + if (model_id != other.model_id) return false + if (display_name != other.display_name) return false + if (framework != other.framework) return false + if (context_window != other.context_window) return false + if (supports_streaming != other.supports_streaming) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + model_id.hashCode() + result = result * 37 + display_name.hashCode() + result = result * 37 + framework.hashCode() + result = result * 37 + context_window.hashCode() + result = result * 37 + supports_streaming.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """model_id=${sanitize(model_id)}""" + result += """display_name=${sanitize(display_name)}""" + result += """framework=${sanitize(framework)}""" + result += """context_window=$context_window""" + result += """supports_streaming=$supports_streaming""" + return result.joinToString(prefix = "ConnectModelDescriptor{", separator = ", ", postfix = "}") + } + + public fun copy( + model_id: String = this.model_id, + display_name: String = this.display_name, + framework: String = this.framework, + context_window: Int = this.context_window, + supports_streaming: Boolean = this.supports_streaming, + unknownFields: ByteString = this.unknownFields, + ): ConnectModelDescriptor = ConnectModelDescriptor(model_id, display_name, framework, context_window, supports_streaming, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectModelDescriptor::class, + "type.googleapis.com/runanywhere.v1.ConnectModelDescriptor", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectModelDescriptor): Int { + var size = value.unknownFields.size + if (value.model_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.model_id) + } + if (value.display_name != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.display_name) + } + if (value.framework != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.framework) + } + if (value.context_window != 0) { + size += ProtoAdapter.UINT32.encodedSizeWithTag(4, value.context_window) + } + if (value.supports_streaming != false) { + size += ProtoAdapter.BOOL.encodedSizeWithTag(5, value.supports_streaming) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectModelDescriptor) { + if (value.model_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.model_id) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.display_name) + } + if (value.framework != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 3, value.framework) + } + if (value.context_window != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.context_window) + } + if (value.supports_streaming != false) { + ProtoAdapter.BOOL.encodeWithTag(writer, 5, value.supports_streaming) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectModelDescriptor) { + writer.writeBytes(value.unknownFields) + if (value.supports_streaming != false) { + ProtoAdapter.BOOL.encodeWithTag(writer, 5, value.supports_streaming) + } + if (value.context_window != 0) { + ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.context_window) + } + if (value.framework != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 3, value.framework) + } + if (value.display_name != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 2, value.display_name) + } + if (value.model_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.model_id) + } + } + + override fun decode(reader: ProtoReader): ConnectModelDescriptor { + var model_id: String = "" + var display_name: String = "" + var framework: String = "" + var context_window: Int = 0 + var supports_streaming: Boolean = false + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> model_id = ProtoAdapter.STRING.decode(reader) + 2 -> display_name = ProtoAdapter.STRING.decode(reader) + 3 -> framework = ProtoAdapter.STRING.decode(reader) + 4 -> context_window = ProtoAdapter.UINT32.decode(reader) + 5 -> supports_streaming = ProtoAdapter.BOOL.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectModelDescriptor( + model_id = model_id, + display_name = display_name, + framework = framework, + context_window = context_window, + supports_streaming = supports_streaming, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectModelDescriptor): ConnectModelDescriptor = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatform.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatform.kt new file mode 100644 index 0000000000..1f0092bedf --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatform.kt @@ -0,0 +1,71 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectPlatform in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.EnumAdapter +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireEnum +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.JvmStatic +import kotlin.Int +import kotlin.Suppress + +/** + * Platform identity is explicit so commons can evaluate role availability + * from one policy table. Platform SDKs must not hardcode the host/client + * matrix in UI or transport code. + */ +public enum class ConnectPlatform( + override val `value`: Int, +) : WireEnum { + CONNECT_PLATFORM_UNSPECIFIED(0), + CONNECT_PLATFORM_MACOS(1), + CONNECT_PLATFORM_IOS(2), + CONNECT_PLATFORM_IPADOS(3), + /** + * Reserved for the follow-on SDK integrations. Keeping the values in the + * canonical IDL avoids a later wire-format migration. + */ + CONNECT_PLATFORM_ANDROID(4), + CONNECT_PLATFORM_REACT_NATIVE(5), + CONNECT_PLATFORM_FLUTTER(6), + CONNECT_PLATFORM_WEB(7), + /** + * Reserved now so adding the planned Windows host adapter does not require + * a platform-identity wire migration. Its host role remains PLANNED until + * the native transport, discovery, and protected-storage adapter ships. + */ + CONNECT_PLATFORM_WINDOWS(8), + ; + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = object : EnumAdapter( + ConnectPlatform::class, + PROTO_3, + ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + ) { + override fun fromValue(`value`: Int): ConnectPlatform? = ConnectPlatform.fromValue(`value`) + } + + @JvmStatic + public fun fromValue(`value`: Int): ConnectPlatform? = when (`value`) { + 0 -> CONNECT_PLATFORM_UNSPECIFIED + 1 -> CONNECT_PLATFORM_MACOS + 2 -> CONNECT_PLATFORM_IOS + 3 -> CONNECT_PLATFORM_IPADOS + 4 -> CONNECT_PLATFORM_ANDROID + 5 -> CONNECT_PLATFORM_REACT_NATIVE + 6 -> CONNECT_PLATFORM_FLUTTER + 7 -> CONNECT_PLATFORM_WEB + 8 -> CONNECT_PLATFORM_WINDOWS + else -> null + } + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatformPolicy.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatformPolicy.kt new file mode 100644 index 0000000000..d24ba4c1a0 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatformPolicy.kt @@ -0,0 +1,196 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectPlatformPolicy in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +/** + * Commons is the authority for this policy. SDKs may query it to shape UI, + * but every host/client entrypoint also enforces it inside C++. + */ +public class ConnectPlatformPolicy( + @field:WireField( + tag = 1, + adapter = "ai.runanywhere.proto.v1.ConnectPlatform#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 0, + ) + public val platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED, + @field:WireField( + tag = 2, + adapter = "ai.runanywhere.proto.v1.ConnectRoleAvailability#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "hostRole", + schemaIndex = 1, + ) + public val host_role: + ConnectRoleAvailability = ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED, + @field:WireField( + tag = 3, + adapter = "ai.runanywhere.proto.v1.ConnectRoleAvailability#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "clientRole", + schemaIndex = 2, + ) + public val client_role: + ConnectRoleAvailability = ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectPlatformPolicy) return false + if (unknownFields != other.unknownFields) return false + if (platform != other.platform) return false + if (host_role != other.host_role) return false + if (client_role != other.client_role) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + platform.hashCode() + result = result * 37 + host_role.hashCode() + result = result * 37 + client_role.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """platform=$platform""" + result += """host_role=$host_role""" + result += """client_role=$client_role""" + return result.joinToString(prefix = "ConnectPlatformPolicy{", separator = ", ", postfix = "}") + } + + public fun copy( + platform: ConnectPlatform = this.platform, + host_role: ConnectRoleAvailability = this.host_role, + client_role: ConnectRoleAvailability = this.client_role, + unknownFields: ByteString = this.unknownFields, + ): ConnectPlatformPolicy = ConnectPlatformPolicy(platform, host_role, client_role, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectPlatformPolicy::class, + "type.googleapis.com/runanywhere.v1.ConnectPlatformPolicy", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectPlatformPolicy): Int { + var size = value.unknownFields.size + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + size += ConnectPlatform.ADAPTER.encodedSizeWithTag(1, value.platform) + } + if (value.host_role != ai.runanywhere.proto.v1.ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED) { + size += ConnectRoleAvailability.ADAPTER.encodedSizeWithTag(2, value.host_role) + } + if (value.client_role != ai.runanywhere.proto.v1.ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED) { + size += ConnectRoleAvailability.ADAPTER.encodedSizeWithTag(3, value.client_role) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectPlatformPolicy) { + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 1, value.platform) + } + if (value.host_role != ai.runanywhere.proto.v1.ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED) { + ConnectRoleAvailability.ADAPTER.encodeWithTag(writer, 2, value.host_role) + } + if (value.client_role != ai.runanywhere.proto.v1.ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED) { + ConnectRoleAvailability.ADAPTER.encodeWithTag(writer, 3, value.client_role) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectPlatformPolicy) { + writer.writeBytes(value.unknownFields) + if (value.client_role != ai.runanywhere.proto.v1.ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED) { + ConnectRoleAvailability.ADAPTER.encodeWithTag(writer, 3, value.client_role) + } + if (value.host_role != ai.runanywhere.proto.v1.ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED) { + ConnectRoleAvailability.ADAPTER.encodeWithTag(writer, 2, value.host_role) + } + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 1, value.platform) + } + } + + override fun decode(reader: ProtoReader): ConnectPlatformPolicy { + var platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + var host_role: ConnectRoleAvailability = ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED + var client_role: ConnectRoleAvailability = ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> try { + platform = ConnectPlatform.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 2 -> try { + host_role = ConnectRoleAvailability.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + 3 -> try { + client_role = ConnectRoleAvailability.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + else -> reader.readUnknownField(tag) + } + } + return ConnectPlatformPolicy( + platform = platform, + host_role = host_role, + client_role = client_role, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectPlatformPolicy): ConnectPlatformPolicy = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatformPolicyRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatformPolicyRequest.kt new file mode 100644 index 0000000000..d562e665e0 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectPlatformPolicyRequest.kt @@ -0,0 +1,131 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectPlatformPolicyRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectPlatformPolicyRequest( + @field:WireField( + tag = 1, + adapter = "ai.runanywhere.proto.v1.ConnectPlatform#ADAPTER", + label = WireField.Label.OMIT_IDENTITY, + schemaIndex = 0, + ) + public val platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED, + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectPlatformPolicyRequest) return false + if (unknownFields != other.unknownFields) return false + if (platform != other.platform) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + platform.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """platform=$platform""" + return result.joinToString(prefix = "ConnectPlatformPolicyRequest{", separator = ", ", postfix = "}") + } + + public fun copy(platform: ConnectPlatform = this.platform, unknownFields: ByteString = this.unknownFields): ConnectPlatformPolicyRequest = ConnectPlatformPolicyRequest(platform, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectPlatformPolicyRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectPlatformPolicyRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectPlatformPolicyRequest): Int { + var size = value.unknownFields.size + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + size += ConnectPlatform.ADAPTER.encodedSizeWithTag(1, value.platform) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectPlatformPolicyRequest) { + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 1, value.platform) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectPlatformPolicyRequest) { + writer.writeBytes(value.unknownFields) + if (value.platform != ai.runanywhere.proto.v1.ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED) { + ConnectPlatform.ADAPTER.encodeWithTag(writer, 1, value.platform) + } + } + + override fun decode(reader: ProtoReader): ConnectPlatformPolicyRequest { + var platform: ConnectPlatform = ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> try { + platform = ConnectPlatform.ADAPTER.decode(reader) + } catch (e: ProtoAdapter.EnumConstantNotFoundException) { + reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong()) + } + else -> reader.readUnknownField(tag) + } + } + return ConnectPlatformPolicyRequest( + platform = platform, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectPlatformPolicyRequest): ConnectPlatformPolicyRequest = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectRoleAvailability.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectRoleAvailability.kt new file mode 100644 index 0000000000..fe97c29bc4 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectRoleAvailability.kt @@ -0,0 +1,52 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectRoleAvailability in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.EnumAdapter +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireEnum +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.JvmStatic +import kotlin.Int +import kotlin.Suppress + +/** + * Role availability is richer than a boolean so the wire contract can reserve + * planned platforms without accidentally advertising them as usable. + */ +public enum class ConnectRoleAvailability( + override val `value`: Int, +) : WireEnum { + CONNECT_ROLE_AVAILABILITY_UNSPECIFIED(0), + CONNECT_ROLE_AVAILABILITY_DISABLED(1), + CONNECT_ROLE_AVAILABILITY_PLANNED(2), + CONNECT_ROLE_AVAILABILITY_ENABLED(3), + ; + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : EnumAdapter( + ConnectRoleAvailability::class, + PROTO_3, + ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED + ) { + override fun fromValue(`value`: Int): ConnectRoleAvailability? = ConnectRoleAvailability.fromValue(`value`) + } + + @JvmStatic + public fun fromValue(`value`: Int): ConnectRoleAvailability? = when (`value`) { + 0 -> CONNECT_ROLE_AVAILABILITY_UNSPECIFIED + 1 -> CONNECT_ROLE_AVAILABILITY_DISABLED + 2 -> CONNECT_ROLE_AVAILABILITY_PLANNED + 3 -> CONNECT_ROLE_AVAILABILITY_ENABLED + else -> null + } + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectSessionCloseRequest.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectSessionCloseRequest.kt new file mode 100644 index 0000000000..6e90eeacb0 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectSessionCloseRequest.kt @@ -0,0 +1,129 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectSessionCloseRequest in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.FieldEncoding +import com.squareup.wire.Message +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.ProtoReader +import com.squareup.wire.ProtoWriter +import com.squareup.wire.ReverseProtoWriter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireField +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.sanitize +import kotlin.Any +import kotlin.AssertionError +import kotlin.Boolean +import kotlin.Deprecated +import kotlin.DeprecationLevel +import kotlin.Int +import kotlin.Long +import kotlin.Nothing +import kotlin.String +import kotlin.Suppress +import okio.ByteString + +public class ConnectSessionCloseRequest( + @field:WireField( + tag = 1, + adapter = "com.squareup.wire.ProtoAdapter#STRING", + label = WireField.Label.OMIT_IDENTITY, + jsonName = "sessionId", + schemaIndex = 0, + ) + public val session_id: String = "", + unknownFields: ByteString = ByteString.EMPTY, +) : Message(ADAPTER, unknownFields) { + @Deprecated( + message = "Shouldn't be used in Kotlin", + level = DeprecationLevel.HIDDEN, + ) + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is ConnectSessionCloseRequest) return false + if (unknownFields != other.unknownFields) return false + if (session_id != other.session_id) return false + return true + } + + override fun hashCode(): Int { + var result = super.hashCode + if (result == 0) { + result = unknownFields.hashCode() + result = result * 37 + session_id.hashCode() + super.hashCode = result + } + return result + } + + override fun toString(): String { + val result = mutableListOf() + result += """session_id=${sanitize(session_id)}""" + return result.joinToString(prefix = "ConnectSessionCloseRequest{", separator = ", ", postfix = "}") + } + + public fun copy(session_id: String = this.session_id, unknownFields: ByteString = this.unknownFields): ConnectSessionCloseRequest = ConnectSessionCloseRequest(session_id, unknownFields) + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( + FieldEncoding.LENGTH_DELIMITED, + ConnectSessionCloseRequest::class, + "type.googleapis.com/runanywhere.v1.ConnectSessionCloseRequest", + PROTO_3, + null, + "connect.proto" + ) { + override fun encodedSize(`value`: ConnectSessionCloseRequest): Int { + var size = value.unknownFields.size + if (value.session_id != "") { + size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.session_id) + } + return size + } + + override fun encode(writer: ProtoWriter, `value`: ConnectSessionCloseRequest) { + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + writer.writeBytes(value.unknownFields) + } + + override fun encode(writer: ReverseProtoWriter, `value`: ConnectSessionCloseRequest) { + writer.writeBytes(value.unknownFields) + if (value.session_id != "") { + ProtoAdapter.STRING.encodeWithTag(writer, 1, value.session_id) + } + } + + override fun decode(reader: ProtoReader): ConnectSessionCloseRequest { + var session_id: String = "" + val unknownFields = reader.forEachTag { tag -> + when (tag) { + 1 -> session_id = ProtoAdapter.STRING.decode(reader) + else -> reader.readUnknownField(tag) + } + } + return ConnectSessionCloseRequest( + session_id = session_id, + unknownFields = unknownFields + ) + } + + override fun redact(`value`: ConnectSessionCloseRequest): ConnectSessionCloseRequest = value.copy( + unknownFields = ByteString.EMPTY + ) + } + + private const val serialVersionUID: Long = 0L + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectSessionState.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectSessionState.kt new file mode 100644 index 0000000000..cec0ff9780 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/ai/runanywhere/proto/v1/ConnectSessionState.kt @@ -0,0 +1,50 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source: runanywhere.v1.ConnectSessionState in connect.proto +@file:Suppress( + "DEPRECATION", + "RUNTIME_ANNOTATION_NOT_SUPPORTED", +) + +package ai.runanywhere.proto.v1 + +import com.squareup.wire.EnumAdapter +import com.squareup.wire.ProtoAdapter +import com.squareup.wire.Syntax.PROTO_3 +import com.squareup.wire.WireEnum +import com.squareup.wire.`internal`.JvmField +import com.squareup.wire.`internal`.JvmStatic +import kotlin.Int +import kotlin.Suppress + +public enum class ConnectSessionState( + override val `value`: Int, +) : WireEnum { + CONNECT_SESSION_STATE_UNSPECIFIED(0), + CONNECT_SESSION_STATE_CONNECTING(1), + CONNECT_SESSION_STATE_CONNECTED(2), + CONNECT_SESSION_STATE_DISCONNECTED(3), + CONNECT_SESSION_STATE_FAILED(4), + ; + + public companion object { + @JvmField + public val ADAPTER: ProtoAdapter = + object : EnumAdapter( + ConnectSessionState::class, + PROTO_3, + ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED + ) { + override fun fromValue(`value`: Int): ConnectSessionState? = ConnectSessionState.fromValue(`value`) + } + + @JvmStatic + public fun fromValue(`value`: Int): ConnectSessionState? = when (`value`) { + 0 -> CONNECT_SESSION_STATE_UNSPECIFIED + 1 -> CONNECT_SESSION_STATE_CONNECTING + 2 -> CONNECT_SESSION_STATE_CONNECTED + 3 -> CONNECT_SESSION_STATE_DISCONNECTED + 4 -> CONNECT_SESSION_STATE_FAILED + else -> null + } + } +} diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/convenience/RAConvenience.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/convenience/RAConvenience.kt index e7bc4062fa..9af61d46cf 100644 --- a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/convenience/RAConvenience.kt +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/generated/convenience/RAConvenience.kt @@ -161,6 +161,36 @@ public fun ArchiveStructure.Companion.fromWireString(value: String): ArchiveStru else -> null } +/** Generated from `(runanywhere.v1.rac_default)` annotations in idl/. */ +public fun VADConfiguration.Companion.defaults(): VADConfiguration = + VADConfiguration( + sample_rate = 16000, + frame_length_ms = 100, + threshold = 0.015f, + ) + +/** Generated from `(runanywhere.v1.rac_required / rac_min / rac_max / rac_min_float / rac_max_float)` annotations in idl/. */ +public fun VADConfiguration.validate() { + if (sample_rate < 1 || sample_rate > 48000) { + throw SDKException.validationFailed( + fieldPath = "VADConfiguration.sample_rate", + message = "sample_rate must be in 1...48000 (got ${sample_rate})", + ) + } + if (frame_length_ms < 1 || frame_length_ms > 1000) { + throw SDKException.validationFailed( + fieldPath = "VADConfiguration.frame_length_ms", + message = "frame_length_ms must be in 1...1000 (got ${frame_length_ms})", + ) + } + if (threshold < 0.0 || threshold > 1.0) { + throw SDKException.validationFailed( + fieldPath = "VADConfiguration.threshold", + message = "threshold must be in 0.0...1.0 (got ${threshold})", + ) + } +} + /** Generated from `(runanywhere.v1.rac_default)` annotations in idl/. */ public fun EmbeddingsConfiguration.Companion.defaults(): EmbeddingsConfiguration = EmbeddingsConfiguration( @@ -197,36 +227,6 @@ public fun EmbeddingsOptions.Companion.defaults(): EmbeddingsOptions = normalize = true, ) -/** Generated from `(runanywhere.v1.rac_default)` annotations in idl/. */ -public fun VADConfiguration.Companion.defaults(): VADConfiguration = - VADConfiguration( - sample_rate = 16000, - frame_length_ms = 100, - threshold = 0.015f, - ) - -/** Generated from `(runanywhere.v1.rac_required / rac_min / rac_max / rac_min_float / rac_max_float)` annotations in idl/. */ -public fun VADConfiguration.validate() { - if (sample_rate < 1 || sample_rate > 48000) { - throw SDKException.validationFailed( - fieldPath = "VADConfiguration.sample_rate", - message = "sample_rate must be in 1...48000 (got ${sample_rate})", - ) - } - if (frame_length_ms < 1 || frame_length_ms > 1000) { - throw SDKException.validationFailed( - fieldPath = "VADConfiguration.frame_length_ms", - message = "frame_length_ms must be in 1...1000 (got ${frame_length_ms})", - ) - } - if (threshold < 0.0 || threshold > 1.0) { - throw SDKException.validationFailed( - fieldPath = "VADConfiguration.threshold", - message = "threshold must be in 0.0...1.0 (got ${threshold})", - ) - } -} - /** Generated from `(runanywhere.v1.rac_display_name)` annotations in idl/. */ public val LogLevel.displayName: String get() = when (this) { diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/native/bridge/RunAnywhereBridge.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/native/bridge/RunAnywhereBridge.kt index cc60341d93..b2b4cf76a2 100644 --- a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/native/bridge/RunAnywhereBridge.kt +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/native/bridge/RunAnywhereBridge.kt @@ -942,6 +942,20 @@ object RunAnywhereBridge { @JvmStatic external fun racDevConfigIsUsableHttpUrl(value: String): Boolean + // CONNECT CLIENT API (rac_connect.h) + + /** Return the commons-owned role policy for a serialized Connect platform request. */ + @JvmStatic + external fun racConnectGetPlatformPolicyProto(requestProto: ByteArray): ByteArray? + + /** Validate client eligibility and create the typed Connect handshake hello. */ + @JvmStatic + external fun racConnectClientCreateHelloProto(requestProto: ByteArray): ByteArray? + + /** Validate the host response and return the model-bound client session state. */ + @JvmStatic + external fun racConnectClientValidateHostProto(responseProto: ByteArray): ByteArray? + // SDK configuration initialization /** diff --git a/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/public/connect/ConnectSession.kt b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/public/connect/ConnectSession.kt new file mode 100644 index 0000000000..cae3d9d950 --- /dev/null +++ b/sdk/runanywhere-kotlin/src/main/kotlin/com/runanywhere/sdk/public/connect/ConnectSession.kt @@ -0,0 +1,360 @@ +/* + * Copyright 2026 RunAnywhere SDK + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.runanywhere.sdk.public.connect + +import ai.runanywhere.proto.v1.ConnectClientStartRequest +import ai.runanywhere.proto.v1.ConnectInvocationRequest +import ai.runanywhere.proto.v1.ConnectPlatform +import ai.runanywhere.proto.v1.ConnectPlatformPolicyRequest +import ai.runanywhere.proto.v1.ConnectRoleAvailability +import ai.runanywhere.proto.v1.ConnectSessionState +import android.content.Context +import android.os.Build +import com.runanywhere.sdk.foundation.bridge.extensions.CppBridgeConnect +import com.runanywhere.sdk.foundation.connect.AndroidConnectDiscovery +import com.runanywhere.sdk.foundation.connect.AndroidConnectEndpoint +import com.runanywhere.sdk.foundation.connect.AndroidConnectSocket +import com.runanywhere.sdk.foundation.errors.SDKException +import com.runanywhere.sdk.public.RunAnywhere +import com.runanywhere.sdk.public.types.RALLMGenerateRequest +import com.runanywhere.sdk.public.types.RALLMStreamEvent +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.cancel +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import java.util.UUID + +/** A runtime host discovered on the Android device's local network. */ +data class ConnectHost( + val id: String, + val displayName: String, + val protocolVersion: Int, +) + +/** The single language model selected and published by the connected host. */ +data class ConnectModel( + val id: String, + val displayName: String, + val framework: String, + val contextWindow: Int, + val supportsStreaming: Boolean, +) + +enum class ConnectStatus { + IDLE, + DISCOVERING, + CONNECTING, + CONNECTED, + DISCONNECTED, + FAILED, +} + +/** One observable snapshot for discovery, connection, model, and failure UI. */ +data class ConnectState( + val status: ConnectStatus = ConnectStatus.IDLE, + val availableHosts: List = emptyList(), + val connectingHost: ConnectHost? = null, + val activeHost: ConnectHost? = null, + val activeModel: ConnectModel? = null, + val lastDisconnectedHost: ConnectHost? = null, + val lastDisconnectedModel: ConnectModel? = null, + val message: String? = null, +) { + val isConnected: Boolean get() = status == ConnectStatus.CONNECTED +} + +/** + * Android client for a RunAnywhere language model published by a host. + * + * Discovery is opt-in: creating a session never touches the local network. + * Call [startBrowsing] only after the user selects the Connect entry point. + * Commons remains authoritative for role policy, protocol negotiation, and + * model binding; Android owns NSD and the framed TCP channel. + */ +class ConnectSession( + context: Context, +) { + private val applicationContext = context.applicationContext + private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO) + private val endpointsLock = Any() + private val endpoints = mutableMapOf() + private val clientInstanceId = UUID.randomUUID().toString() + + private val _state = MutableStateFlow(ConnectState()) + val state: StateFlow = _state.asStateFlow() + + private val socket = AndroidConnectSocket(scope, ::handleDisconnect) + private val discovery = + AndroidConnectDiscovery( + context = applicationContext, + onEndpointsChanged = ::handleEndpointsChanged, + onFailure = ::handleFailure, + ) + + private var activeSessionId: String? = null + + /** Begin Android NSD discovery. This is the point that may trigger local-network permission UI. */ + suspend fun startBrowsing() { + requireInitialized() + val policy = + CppBridgeConnect.platformPolicy( + ConnectPlatformPolicyRequest(platform = ConnectPlatform.CONNECT_PLATFORM_ANDROID), + ) + if (policy.client_role != ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED) { + throw SDKException.invalidState("Connect client support is not enabled for Android") + } + + _state.update { current -> + current.copy( + status = if (current.isConnected) current.status else ConnectStatus.DISCOVERING, + message = null, + ) + } + try { + discovery.start() + } catch (error: Throwable) { + handleFailure(error) + throw error + } + } + + /** Stop discovery without ending an established hosted-model session. */ + fun stopBrowsing() { + discovery.stop() + _state.update { current -> + if (current.status == ConnectStatus.DISCOVERING) { + current.copy(status = ConnectStatus.IDLE, availableHosts = emptyList()) + } else { + current.copy(availableHosts = emptyList()) + } + } + } + + /** Connect to a discovered host and adopt its selected model. */ + suspend fun connect(host: ConnectHost) { + requireInitialized() + val endpoint = + synchronized(endpointsLock) { endpoints[host.id] } + ?: throw SDKException.networkError("The selected host is no longer available") + + socket.close(notify = false) + activeSessionId = null + _state.update { + it.copy( + status = ConnectStatus.CONNECTING, + connectingHost = host, + activeHost = null, + activeModel = null, + message = null, + ) + } + + try { + val baseHello = + CppBridgeConnect.createClientHello( + ConnectClientStartRequest( + display_name = androidDisplayName(), + platform = ConnectPlatform.CONNECT_PLATFORM_ANDROID, + protocol_version = PROTOCOL_VERSION, + ), + ) + val response = + socket.connect( + endpoint = endpoint, + hello = baseHello.copy(instance_id = clientInstanceId), + ) + val session = CppBridgeConnect.validateHost(response) + val hostMetadata = session.host + val modelDescriptor = session.model + if ( + session.state != ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED || + session.session_id.isBlank() || + hostMetadata == null || + modelDescriptor == null || + modelDescriptor.model_id.isBlank() + ) { + throw SDKException.networkError( + session.error_message.ifBlank { + "The selected host could not provide a language model" + }, + ) + } + + val connectedHost = + ConnectHost( + id = host.id, + displayName = hostMetadata.display_name.ifBlank { host.displayName }, + protocolVersion = hostMetadata.protocol_version, + ) + val connectedModel = + ConnectModel( + id = modelDescriptor.model_id, + displayName = modelDescriptor.display_name, + framework = modelDescriptor.framework, + contextWindow = modelDescriptor.context_window, + supportsStreaming = modelDescriptor.supports_streaming, + ) + activeSessionId = session.session_id + _state.update { + it.copy( + status = ConnectStatus.CONNECTED, + connectingHost = null, + activeHost = connectedHost, + activeModel = connectedModel, + lastDisconnectedHost = null, + lastDisconnectedModel = null, + message = null, + ) + } + socket.startHeartbeat(session.session_id) + } catch (error: Throwable) { + socket.close(notify = false) + activeSessionId = null + val message = error.message ?: "Unable to connect to the selected host" + _state.update { + it.copy( + status = ConnectStatus.FAILED, + connectingHost = null, + activeHost = null, + activeModel = null, + message = message, + ) + } + throw error + } + } + + /** Run text generation on the active host model without loading a local model. */ + fun generateStream(request: RALLMGenerateRequest): Flow { + val snapshot = _state.value + val sessionId = activeSessionId + val model = snapshot.activeModel + if (snapshot.status != ConnectStatus.CONNECTED || sessionId.isNullOrBlank() || model == null) { + throw SDKException.networkError("Connect to a host before generating text") + } + val requestId = request.request_id.ifBlank { UUID.randomUUID().toString() } + val generation = request.copy(request_id = requestId, model_id = model.id) + return socket.generate( + ConnectInvocationRequest( + session_id = sessionId, + request_id = requestId, + generation = generation, + ), + ) + } + + /** End the active connection while leaving the session reusable. */ + fun disconnect() { + socket.close(notify = false) + activeSessionId = null + _state.update { + it.copy( + status = ConnectStatus.IDLE, + connectingHost = null, + activeHost = null, + activeModel = null, + lastDisconnectedHost = null, + lastDisconnectedModel = null, + message = null, + ) + } + } + + /** Release discovery and connection resources. */ + fun stop() { + discovery.stop() + socket.close(notify = false) + activeSessionId = null + synchronized(endpointsLock) { endpoints.clear() } + _state.value = ConnectState() + scope.cancel() + } + + private fun handleEndpointsChanged(resolved: List) { + synchronized(endpointsLock) { + endpoints.clear() + resolved.associateByTo(endpoints) { it.id } + } + val hosts = + resolved.map { + ConnectHost( + id = it.id, + displayName = it.displayName, + protocolVersion = PROTOCOL_VERSION, + ) + } + _state.update { it.copy(availableHosts = hosts) } + } + + private fun handleDisconnect(error: Throwable) { + val previous = _state.value + if (previous.status != ConnectStatus.CONNECTED) return + activeSessionId = null + val host = previous.activeHost + val model = previous.activeModel + val reason = disconnectMessage(error, host) + _state.update { + it.copy( + status = ConnectStatus.DISCONNECTED, + connectingHost = null, + activeHost = null, + activeModel = null, + lastDisconnectedHost = host, + lastDisconnectedModel = model, + message = reason, + ) + } + } + + private fun handleFailure(error: Throwable) { + if (_state.value.status == ConnectStatus.CONNECTED) { + socket.close(notify = false) + handleDisconnect(error) + return + } + _state.update { + it.copy( + status = ConnectStatus.FAILED, + connectingHost = null, + message = error.message ?: "Connect failed", + ) + } + } + + private fun disconnectMessage(error: Throwable, host: ConnectHost?): String { + val hostName = host?.displayName ?: "the host" + val detail = error.message?.trim().orEmpty() + return if (detail.isBlank() || detail == "The connection to the host ended") { + "Connection to $hostName ended. The host may have stopped or left the network." + } else { + "Connection to $hostName ended: $detail" + } + } + + private fun requireInitialized() { + if (!RunAnywhere.isInitialized) { + throw SDKException.notInitialized("RunAnywhere Connect") + } + } + + private fun androidDisplayName(): String { + val candidate = + listOf(Build.MANUFACTURER, Build.MODEL) + .filter { it.isNotBlank() } + .joinToString(" ") + .trim() + return candidate.take(128).ifBlank { "Android device" } + } + + private companion object { + const val PROTOCOL_VERSION = 1 + } +} diff --git a/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore+Connect.cpp b/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore+Connect.cpp new file mode 100644 index 0000000000..6c19e6ee71 --- /dev/null +++ b/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore+Connect.cpp @@ -0,0 +1,71 @@ +/** + * React Native Connect bridge. + * + * Transport and discovery stay platform-owned, while policy and handshake + * validation are delegated to the same C++ commons ABI used by Swift, + * Kotlin, and Flutter. + */ +#include "HybridRunAnywhereCore+Common.hpp" +#include "rac/connect/rac_connect.h" + +#include + +namespace margelo::nitro::runanywhere { + +namespace { + +using ConnectProtoFunction = rac_result_t (*)(const uint8_t *, size_t, + rac_proto_buffer_t *); + +std::shared_ptr +callConnectProto(const std::shared_ptr &input, + ConnectProtoFunction function, const char *operation) { + rac_proto_buffer_t output; + rac_proto_buffer_init(&output); + const auto result = function(input->data(), input->size(), &output); + if (result != RAC_SUCCESS) { + rac_proto_buffer_free(&output); + throw std::runtime_error(std::string(operation) + " failed: " + + std::to_string(result)); + } + + auto buffer = output.data && output.size > 0 + ? ArrayBuffer::copy(output.data, output.size) + : ArrayBuffer::allocate(0); + rac_proto_buffer_free(&output); + return buffer; +} + +} // namespace + +std::shared_ptr>> +HybridRunAnywhereCore::connectGetPlatformPolicyProto( + const std::shared_ptr &requestBytes) { + return Promise>::async([requestBytes]() { + return callConnectProto(requestBytes, + rac_connect_get_platform_policy_proto, + "Connect platform policy"); + }); +} + +std::shared_ptr>> +HybridRunAnywhereCore::connectClientCreateHelloProto( + const std::shared_ptr &requestBytes) { + return Promise>::async([requestBytes]() { + return callConnectProto(requestBytes, + rac_connect_client_create_hello_proto, + "Connect client hello"); + }); +} + +std::shared_ptr>> +HybridRunAnywhereCore::connectClientValidateHostProto( + const std::shared_ptr &responseBytes) { + return Promise>::async([responseBytes]() { + return callConnectProto(responseBytes, + rac_connect_client_validate_host_proto, + "Connect host validation"); + }); +} + +} // namespace margelo::nitro::runanywhere diff --git a/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore.hpp b/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore.hpp index 75b0353275..01d0b3fe1a 100644 --- a/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore.hpp +++ b/sdk/runanywhere-react-native/packages/core/cpp/HybridRunAnywhereCore.hpp @@ -107,6 +107,17 @@ class HybridRunAnywhereCore : public HybridRunAnywhereCoreSpec { std::shared_ptr> isDeviceRegistered() override; std::shared_ptr> getDeviceId() override; + // Connect client policy and handshake + std::shared_ptr>> + connectGetPlatformPolicyProto( + const std::shared_ptr &requestBytes) override; + std::shared_ptr>> + connectClientCreateHelloProto( + const std::shared_ptr &requestBytes) override; + std::shared_ptr>> + connectClientValidateHostProto( + const std::shared_ptr &responseBytes) override; + // ============================================================================ // Model Registry - Delegates to ModelRegistryBridge // ============================================================================ diff --git a/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp b/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp index 2205bfa4fe..ef12c09ad5 100644 --- a/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp +++ b/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp @@ -36,6 +36,9 @@ namespace margelo::nitro::runanywhere { prototype.registerHybridMethod("getOrganizationId", &HybridRunAnywhereCoreSpec::getOrganizationId); prototype.registerHybridMethod("isDeviceRegistered", &HybridRunAnywhereCoreSpec::isDeviceRegistered); prototype.registerHybridMethod("getDeviceId", &HybridRunAnywhereCoreSpec::getDeviceId); + prototype.registerHybridMethod("connectGetPlatformPolicyProto", &HybridRunAnywhereCoreSpec::connectGetPlatformPolicyProto); + prototype.registerHybridMethod("connectClientCreateHelloProto", &HybridRunAnywhereCoreSpec::connectClientCreateHelloProto); + prototype.registerHybridMethod("connectClientValidateHostProto", &HybridRunAnywhereCoreSpec::connectClientValidateHostProto); prototype.registerHybridMethod("getAvailableModelsProto", &HybridRunAnywhereCoreSpec::getAvailableModelsProto); prototype.registerHybridMethod("frameworkDisplayName", &HybridRunAnywhereCoreSpec::frameworkDisplayName); prototype.registerHybridMethod("modelCategoryDefaultFramework", &HybridRunAnywhereCoreSpec::modelCategoryDefaultFramework); diff --git a/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp b/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp index b5cd99ba09..b3e71af929 100644 --- a/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp +++ b/sdk/runanywhere-react-native/packages/core/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp @@ -73,6 +73,9 @@ namespace margelo::nitro::runanywhere { virtual std::shared_ptr> getOrganizationId() = 0; virtual std::shared_ptr> isDeviceRegistered() = 0; virtual std::shared_ptr> getDeviceId() = 0; + virtual std::shared_ptr>> connectGetPlatformPolicyProto(const std::shared_ptr& requestBytes) = 0; + virtual std::shared_ptr>> connectClientCreateHelloProto(const std::shared_ptr& requestBytes) = 0; + virtual std::shared_ptr>> connectClientValidateHostProto(const std::shared_ptr& responseBytes) = 0; virtual std::shared_ptr>> getAvailableModelsProto() = 0; virtual std::string frameworkDisplayName(double frameworkProto) = 0; virtual double modelCategoryDefaultFramework(double categoryProto) = 0; diff --git a/sdk/runanywhere-react-native/packages/core/package.json b/sdk/runanywhere-react-native/packages/core/package.json index 833c895b1b..dab726ffc6 100644 --- a/sdk/runanywhere-react-native/packages/core/package.json +++ b/sdk/runanywhere-react-native/packages/core/package.json @@ -78,7 +78,9 @@ "react-native-blob-util": ">=0.19.0", "react-native-device-info": ">=11.0.0", "react-native-fs": ">=2.20.0", - "react-native-nitro-modules": "^0.33.9" + "react-native-nitro-modules": "^0.33.9", + "react-native-tcp-socket": ">=6.4.1", + "react-native-zeroconf": ">=0.14.0" }, "peerDependenciesMeta": { "react-native-blob-util": { @@ -97,7 +99,11 @@ "eslint": "^9.39.4", "jest": "^29.7.0", "nitrogen": "^0.34.1", + "react": "19.2.3", + "react-native": "0.85.3", "react-native-nitro-modules": "^0.33.9", + "react-native-tcp-socket": "^6.4.1", + "react-native-zeroconf": "^0.14.0", "ts-jest": "^29.1.2", "typescript": "^5.9.3" }, diff --git a/sdk/runanywhere-react-native/packages/core/src/Public/Connect/ConnectSession.ts b/sdk/runanywhere-react-native/packages/core/src/Public/Connect/ConnectSession.ts new file mode 100644 index 0000000000..e6f7739cf9 --- /dev/null +++ b/sdk/runanywhere-react-native/packages/core/src/Public/Connect/ConnectSession.ts @@ -0,0 +1,632 @@ +import { Platform } from 'react-native'; +import TcpSocket from 'react-native-tcp-socket'; +import { + ConnectClientFrame, + ConnectClientHello, + ConnectClientSessionState, + ConnectClientStartRequest, + ConnectHandshakeResponse, + ConnectHostFrame, + ConnectPlatform, + ConnectPlatformPolicy, + ConnectPlatformPolicyRequest, + ConnectRoleAvailability, + ConnectSessionState, + type ConnectInvocationRequest, + type ConnectModelDescriptor, +} from '@runanywhere/proto-ts/connect'; +import { + type LLMGenerateRequest, + type LLMStreamEvent, +} from '@runanywhere/proto-ts/llm_service'; +import { requireInitialized } from '../../Foundation/Initialization/InitializedGuard'; +import { SDKException } from '../../Foundation/Errors/SDKException'; +import { requireNativeModule } from '../../native/NativeRunAnywhereCore'; +import { + arrayBufferToBytes, + bytesToArrayBuffer, +} from '../../services/ProtoBytes'; + +export interface ConnectHost { + id: string; + displayName: string; + protocolVersion: number; +} + +export interface ConnectModel { + id: string; + displayName: string; + framework: string; + contextWindow: number; + supportsStreaming: boolean; +} + +export type ConnectStatus = + | 'idle' + | 'discovering' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed'; + +export interface ConnectState { + status: ConnectStatus; + availableHosts: readonly ConnectHost[]; + connectingHost?: ConnectHost; + activeHost?: ConnectHost; + activeModel?: ConnectModel; + lastDisconnectedHost?: ConnectHost; + lastDisconnectedModel?: ConnectModel; + message?: string; +} + +type StateListener = (state: ConnectState) => void; + +interface ConnectEndpoint { + id: string; + displayName: string; + host: string; + port: number; +} + +const PROTOCOL_VERSION = 1; +const MAX_FRAME_LENGTH = 4 * 1024 * 1024; +type NativeSocket = ReturnType; + +interface ZeroconfService { + name: string; + fullName?: string; + host?: string; + port: number; + addresses?: string[]; +} + +interface ZeroconfInstance { + scan( + type: string, + protocol?: string, + domain?: string, + implType?: string + ): void; + stop(implType?: string): void; + removeDeviceListeners(): void; + on(event: 'resolved', listener: (service: ZeroconfService) => void): void; + on(event: 'remove', listener: (name: string) => void): void; + on(event: 'error', listener: (error: Error) => void): void; +} + +type ZeroconfConstructor = new () => ZeroconfInstance; + +// The package does not publish TypeScript declarations. Keeping the narrow +// adapter type here avoids leaking its untyped event surface into the SDK. +const ZeroconfModule = require('react-native-zeroconf') as { + default: ZeroconfConstructor; + ImplType: { DNSSD: string; NSD: string }; +}; +const Zeroconf = ZeroconfModule.default; +const { ImplType } = ZeroconfModule; + +/** + * React Native client for a language model published by a Connect host. + * + * Discovery is intentionally opt-in. C++ commons owns role policy and + * handshake validation; React Native owns mDNS, framed TCP, heartbeat, and + * observable UI state. + */ +export class ConnectSession { + private readonly displayName: string; + private readonly endpoints = new Map(); + private readonly listeners = new Set(); + private readonly transport = new ConnectSocket((error) => + this.handleDisconnect(error) + ); + private zeroconf?: ZeroconfInstance; + private activeSessionId?: string; + private stateValue: ConnectState = { + status: 'idle', + availableHosts: [], + }; + + constructor(displayName = `${Platform.OS} device`) { + this.displayName = displayName.trim() || `${Platform.OS} device`; + } + + get state(): ConnectState { + return this.stateValue; + } + + subscribe(listener: StateListener): () => void { + this.listeners.add(listener); + listener(this.stateValue); + return () => this.listeners.delete(listener); + } + + async startBrowsing(): Promise { + requireInitialized(); + const native = requireNativeModule(); + const policyRequest = ConnectPlatformPolicyRequest.encode({ + platform: ConnectPlatform.CONNECT_PLATFORM_REACT_NATIVE, + }).finish(); + const policyBytes = await native.connectGetPlatformPolicyProto( + bytesToArrayBuffer(policyRequest) + ); + const policy = ConnectPlatformPolicy.decode( + arrayBufferToBytes(policyBytes) + ); + if ( + policy.clientRole !== + ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED + ) { + throw SDKException.networkError( + 'Connect client support is not enabled for React Native' + ); + } + if (this.zeroconf) return; + + this.emit({ + ...this.stateValue, + status: + this.stateValue.status === 'connected' ? 'connected' : 'discovering', + message: undefined, + }); + const zeroconf = new Zeroconf(); + zeroconf.on('resolved', (service) => this.resolveService(service)); + zeroconf.on('remove', (name) => this.removeService(name)); + zeroconf.on('error', (error) => { + // The active framed TCP channel and heartbeat are authoritative after + // connection. Losing the discovery browser must not demote a healthy + // hosted-model session. + if (this.stateValue.status === 'connected') return; + this.releaseDiscovery(); + this.emit({ + ...this.stateValue, + status: 'failed', + availableHosts: [], + message: messageFor(error, 'Unable to search the local network'), + }); + }); + this.zeroconf = zeroconf; + zeroconf.scan( + 'runanywhere-connect', + 'tcp', + 'local.', + Platform.OS === 'android' ? ImplType.DNSSD : undefined + ); + } + + stopBrowsing(): void { + this.releaseDiscovery(); + this.emit({ + ...this.stateValue, + status: + this.stateValue.status === 'discovering' + ? 'idle' + : this.stateValue.status, + availableHosts: [], + }); + } + + async connect(host: ConnectHost): Promise { + requireInitialized(); + const endpoint = this.endpoints.get(host.id); + if (!endpoint) { + throw SDKException.networkError( + 'The selected host is no longer available' + ); + } + + this.activeSessionId = undefined; + this.emit({ + status: 'connecting', + availableHosts: this.stateValue.availableHosts, + connectingHost: host, + }); + + try { + const native = requireNativeModule(); + const request = ConnectClientStartRequest.encode({ + displayName: this.displayName.slice(0, 128), + platform: ConnectPlatform.CONNECT_PLATFORM_REACT_NATIVE, + protocolVersion: PROTOCOL_VERSION, + }).finish(); + const helloBytes = await native.connectClientCreateHelloProto( + bytesToArrayBuffer(request) + ); + const hello = ConnectClientHello.decode(arrayBufferToBytes(helloBytes)); + const response = await this.transport.connect(endpoint, hello); + const responseBytes = ConnectHandshakeResponse.encode(response).finish(); + const sessionBytes = await native.connectClientValidateHostProto( + bytesToArrayBuffer(responseBytes) + ); + const session = ConnectClientSessionState.decode( + arrayBufferToBytes(sessionBytes) + ); + if ( + session.state !== ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED || + !session.sessionId || + !session.host || + !session.model?.modelId + ) { + throw SDKException.networkError( + session.errorMessage || + 'The selected host could not provide a language model' + ); + } + + const activeHost: ConnectHost = { + id: host.id, + displayName: session.host.displayName || host.displayName, + protocolVersion: session.host.protocolVersion, + }; + const activeModel = modelFromDescriptor(session.model); + this.activeSessionId = session.sessionId; + this.emit({ + status: 'connected', + availableHosts: this.stateValue.availableHosts, + activeHost, + activeModel, + }); + this.transport.startHeartbeat(session.sessionId); + } catch (error) { + this.transport.close(); + this.activeSessionId = undefined; + this.emit({ + status: 'failed', + availableHosts: this.stateValue.availableHosts, + message: messageFor(error, 'Unable to connect to the selected host'), + }); + throw error; + } + } + + async *generateStream( + request: LLMGenerateRequest + ): AsyncGenerator { + const sessionId = this.activeSessionId; + const model = this.stateValue.activeModel; + if (this.stateValue.status !== 'connected' || !sessionId || !model) { + throw SDKException.networkError( + 'Connect to a host before generating text' + ); + } + const requestId = request.requestId || randomId(); + const invocation: ConnectInvocationRequest = { + sessionId, + requestId, + generation: { + ...request, + requestId, + modelId: model.id, + }, + }; + try { + yield* this.transport.generate(invocation); + } catch (error) { + this.handleDisconnect(error); + throw error; + } + } + + disconnect(): void { + this.transport.close(); + this.activeSessionId = undefined; + this.emit({ + status: 'idle', + availableHosts: this.stateValue.availableHosts, + }); + } + + stop(): void { + this.stopBrowsing(); + this.transport.close(); + this.activeSessionId = undefined; + this.listeners.clear(); + this.stateValue = { status: 'idle', availableHosts: [] }; + } + + private resolveService(service: ZeroconfService): void { + if (!service.name || service.port < 1 || service.port > 65535) return; + const address = + service.addresses?.find((value) => + /^\d{1,3}(\.\d{1,3}){3}$/.test(value) + ) || + service.addresses?.[0] || + service.host; + if (!address) return; + const id = service.fullName || service.name; + this.endpoints.set(id, { + id, + displayName: service.name, + host: address.replace(/\.$/, ''), + port: service.port, + }); + this.publishHosts(); + } + + private releaseDiscovery(): void { + const zeroconf = this.zeroconf; + this.zeroconf = undefined; + this.endpoints.clear(); + if (!zeroconf) return; + // Remove callbacks first so a native stop error cannot recursively enter + // the discovery error handler while teardown is in progress. + zeroconf.removeDeviceListeners(); + zeroconf.stop(Platform.OS === 'android' ? ImplType.DNSSD : undefined); + } + + private removeService(name: string): void { + for (const [id, endpoint] of this.endpoints) { + if (id === name || endpoint.displayName === name) + this.endpoints.delete(id); + } + this.publishHosts(); + } + + private publishHosts(): void { + const availableHosts = [...this.endpoints.values()] + .sort((a, b) => a.displayName.localeCompare(b.displayName)) + .map((endpoint) => ({ + id: endpoint.id, + displayName: endpoint.displayName, + protocolVersion: PROTOCOL_VERSION, + })); + this.emit({ ...this.stateValue, availableHosts }); + } + + private handleDisconnect(error: unknown): void { + if (this.stateValue.status !== 'connected') return; + const previous = this.stateValue; + this.activeSessionId = undefined; + this.transport.close(); + const hostName = previous.activeHost?.displayName || 'the host'; + this.emit({ + status: 'disconnected', + availableHosts: previous.availableHosts, + lastDisconnectedHost: previous.activeHost, + lastDisconnectedModel: previous.activeModel, + message: + messageFor(error, '') || + `Connection to ${hostName} ended. The host may have stopped or left the network.`, + }); + } + + private emit(state: ConnectState): void { + this.stateValue = state; + for (const listener of this.listeners) listener(state); + } +} + +class ConnectSocket { + private socket?: NativeSocket; + private buffer: number[] = []; + private frames: Uint8Array[] = []; + private waiters: Array<{ + resolve: (frame: Uint8Array) => void; + reject: (error: Error) => void; + }> = []; + private heartbeat?: ReturnType; + private operationActive = false; + private closed = true; + private manualClose = false; + + constructor(private readonly onDisconnected: (error: Error) => void) {} + + async connect( + endpoint: ConnectEndpoint, + hello: ConnectClientHello + ): Promise { + this.close(); + this.closed = false; + this.manualClose = false; + const socket = await new Promise((resolve, reject) => { + const candidate = TcpSocket.createConnection( + { host: endpoint.host, port: endpoint.port, connectTimeout: 5000 }, + () => resolve(candidate) + ); + this.socket = candidate; + candidate.once('error', reject); + }); + this.socket = socket; + socket.setNoDelay(true); + socket.removeAllListeners('error'); + socket.on('data', (data: Uint8Array | string) => this.receiveData(data)); + socket.on('error', (error: Error) => this.fail(error)); + socket.on('close', () => { + if (!this.manualClose) + this.fail(new Error('The connection to the host ended')); + }); + this.writeFrame(ConnectClientHello.encode(hello).finish()); + return ConnectHandshakeResponse.decode( + await withTimeout(this.nextFrame(), 5000, 'Connect handshake timed out') + ); + } + + startHeartbeat(sessionId: string): void { + if (this.heartbeat) clearInterval(this.heartbeat); + let sequence = 0; + this.heartbeat = setInterval(() => { + if (this.closed || this.operationActive) return; + void (async () => { + this.operationActive = true; + try { + sequence += 1; + this.writeFrame( + ConnectClientFrame.encode({ + heartbeat: { sessionId, sequence }, + }).finish() + ); + const frame = ConnectHostFrame.decode( + await withTimeout( + this.nextFrame(), + 2000, + 'Host heartbeat timed out' + ) + ); + if ( + frame.heartbeat?.sessionId !== sessionId || + frame.heartbeat.sequence !== sequence + ) { + throw new Error('The Connect host returned an invalid heartbeat'); + } + } catch (error) { + this.fail(asError(error)); + } finally { + this.operationActive = false; + } + })(); + }, 3000); + } + + async *generate( + invocation: ConnectInvocationRequest + ): AsyncGenerator { + if (this.closed || !this.socket) { + throw SDKException.networkError( + 'The selected host is no longer connected' + ); + } + if (this.operationActive) { + throw SDKException.networkError( + 'Another Connect operation is already running' + ); + } + this.operationActive = true; + try { + this.writeFrame(ConnectClientFrame.encode({ invocation }).finish()); + while (true) { + const frame = ConnectHostFrame.decode(await this.nextFrame()); + const event = frame.invocationEvent; + if (event?.requestId !== invocation.requestId || !event.event) { + throw SDKException.networkError( + 'The Connect host returned an invalid response' + ); + } + yield event.event; + if (event.event.isFinal) return; + } + } finally { + this.operationActive = false; + } + } + + close(): void { + this.manualClose = true; + this.closed = true; + this.operationActive = false; + if (this.heartbeat) clearInterval(this.heartbeat); + this.heartbeat = undefined; + this.socket?.destroy(); + this.socket = undefined; + this.rejectWaiters(new Error('Connect session closed')); + this.buffer = []; + this.frames = []; + } + + private receiveData(data: Uint8Array | string): void { + if (typeof data === 'string') return; + this.buffer.push(...data); + while (this.buffer.length >= 4) { + const length = + ((this.buffer[0] << 24) >>> 0) | + (this.buffer[1] << 16) | + (this.buffer[2] << 8) | + this.buffer[3]; + if (length < 1 || length > MAX_FRAME_LENGTH) { + this.fail(new Error('The Connect host returned an invalid frame size')); + return; + } + if (this.buffer.length < length + 4) return; + const frame = Uint8Array.from(this.buffer.slice(4, length + 4)); + this.buffer.splice(0, length + 4); + const waiter = this.waiters.shift(); + if (waiter) waiter.resolve(frame); + else this.frames.push(frame); + } + } + + private writeFrame(payload: Uint8Array): void { + if ( + !this.socket || + payload.length < 1 || + payload.length > MAX_FRAME_LENGTH + ) { + throw SDKException.networkError('Connect frame size is invalid'); + } + const frame = new Uint8Array(payload.length + 4); + const view = new DataView(frame.buffer); + view.setUint32(0, payload.length, false); + frame.set(payload, 4); + this.socket.write(frame); + } + + private nextFrame(): Promise { + const frame = this.frames.shift(); + if (frame) return Promise.resolve(frame); + if (this.closed) return Promise.reject(new Error('Connect session closed')); + return new Promise((resolve, reject) => + this.waiters.push({ resolve, reject }) + ); + } + + private fail(error: Error): void { + if (this.closed) return; + this.closed = true; + if (this.heartbeat) clearInterval(this.heartbeat); + this.heartbeat = undefined; + this.operationActive = false; + this.rejectWaiters(error); + this.socket?.destroy(); + this.socket = undefined; + this.onDisconnected(error); + } + + private rejectWaiters(error: Error): void { + const waiters = this.waiters.splice(0); + for (const waiter of waiters) waiter.reject(error); + } +} + +function modelFromDescriptor(model: ConnectModelDescriptor): ConnectModel { + return { + id: model.modelId, + displayName: model.displayName, + framework: model.framework, + contextWindow: model.contextWindow, + supportsStreaming: model.supportsStreaming, + }; +} + +function randomId(): string { + return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`; +} + +function asError(error: unknown): Error { + return error instanceof Error ? error : new Error(String(error)); +} + +function messageFor(error: unknown, fallback: string): string { + const value = + error instanceof Error ? error.message.trim() : String(error).trim(); + return value || fallback; +} + +async function withTimeout( + promise: Promise, + milliseconds: number, + message: string +): Promise { + let timer: ReturnType | undefined; + try { + return await Promise.race([ + promise, + new Promise((_, reject) => { + timer = setTimeout( + () => reject(SDKException.timeout(message)), + milliseconds + ); + }), + ]); + } finally { + if (timer) clearTimeout(timer); + } +} diff --git a/sdk/runanywhere-react-native/packages/core/src/index.ts b/sdk/runanywhere-react-native/packages/core/src/index.ts index ff4314a03c..91fe33b987 100644 --- a/sdk/runanywhere-react-native/packages/core/src/index.ts +++ b/sdk/runanywhere-react-native/packages/core/src/index.ts @@ -13,6 +13,14 @@ export { RunAnywhere } from './Public/RunAnywhere'; +export { ConnectSession } from './Public/Connect/ConnectSession'; +export type { + ConnectHost, + ConnectModel, + ConnectState, + ConnectStatus, +} from './Public/Connect/ConnectSession'; + // Hybrid STT router (offline sherpa <-> cloud). THIN binding over the // commons hybrid router — commons owns all routing. Mirrors Swift `Hybrid/*` // and Kotlin `public/hybrid/*` (RACRouter / CloudSTT / RoutingPolicy). diff --git a/sdk/runanywhere-react-native/packages/core/src/specs/RunAnywhereCore.nitro.ts b/sdk/runanywhere-react-native/packages/core/src/specs/RunAnywhereCore.nitro.ts index 8fc23464c6..dc204e8b18 100644 --- a/sdk/runanywhere-react-native/packages/core/src/specs/RunAnywhereCore.nitro.ts +++ b/sdk/runanywhere-react-native/packages/core/src/specs/RunAnywhereCore.nitro.ts @@ -160,6 +160,25 @@ export interface RunAnywhereCore extends HybridObject<{ */ getDeviceId(): Promise; + // ============================================================================ + // Connect client policy and handshake + // ============================================================================ + + /** Return the C++-owned platform role policy. */ + connectGetPlatformPolicyProto( + requestBytes: ArrayBuffer + ): Promise; + + /** Create a canonical client hello after C++ policy validation. */ + connectClientCreateHelloProto( + requestBytes: ArrayBuffer + ): Promise; + + /** Validate a host handshake and return the typed client session state. */ + connectClientValidateHostProto( + responseBytes: ArrayBuffer + ): Promise; + // ============================================================================ // Model Registry // Matches Swift: CppBridge+ModelRegistry.swift diff --git a/sdk/runanywhere-react-native/yarn.lock b/sdk/runanywhere-react-native/yarn.lock index c36fb312e8..a8c3a53ac4 100644 --- a/sdk/runanywhere-react-native/yarn.lock +++ b/sdk/runanywhere-react-native/yarn.lock @@ -2064,7 +2064,11 @@ __metadata: long: ^5.3.2 nitrogen: ^0.34.1 protobufjs: ^7.5.8 + react: 19.2.3 + react-native: 0.85.3 react-native-nitro-modules: ^0.33.9 + react-native-tcp-socket: ^6.4.1 + react-native-zeroconf: ^0.14.0 ts-jest: ^29.1.2 typescript: ^5.9.3 peerDependencies: @@ -2074,6 +2078,8 @@ __metadata: react-native-device-info: ">=11.0.0" react-native-fs: ">=2.20.0" react-native-nitro-modules: ^0.33.9 + react-native-tcp-socket: ">=6.4.1" + react-native-zeroconf: ">=0.14.0" peerDependenciesMeta: react-native-blob-util: optional: true @@ -3163,7 +3169,7 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^5.5.0": +"buffer@npm:^5.4.3, buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" dependencies: @@ -4501,13 +4507,20 @@ __metadata: languageName: node linkType: hard -"eventemitter3@npm:^4.0.4": +"eventemitter3@npm:^4.0.4, eventemitter3@npm:^4.0.7": version: 4.0.7 resolution: "eventemitter3@npm:4.0.7" checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 languageName: node linkType: hard +"events@npm:^3.0.0": + version: 3.3.0 + resolution: "events@npm:3.3.0" + checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 + languageName: node + linkType: hard + "execa@npm:5.0.0": version: 5.0.0 resolution: "execa@npm:5.0.0" @@ -8595,6 +8608,29 @@ __metadata: languageName: node linkType: hard +"react-native-tcp-socket@npm:^6.4.1": + version: 6.4.1 + resolution: "react-native-tcp-socket@npm:6.4.1" + dependencies: + buffer: ^5.4.3 + eventemitter3: ^4.0.7 + peerDependencies: + react-native: ">=0.60.0" + checksum: 0c0af3a3044a3edeb9fb5077476eba7ba26675b4af2a1d6b11a63cd56a939a63e4675a63cc1da72cd573cf37ae386a4e98b16b442e4adc11c0addbccaf48b925 + languageName: node + linkType: hard + +"react-native-zeroconf@npm:^0.14.0": + version: 0.14.0 + resolution: "react-native-zeroconf@npm:0.14.0" + dependencies: + events: ^3.0.0 + peerDependencies: + react-native: ">=0.60" + checksum: f944fe1208849e2b6e68584732bfcb53cc39b16c6958afdd60b348bab834711e721a3eeb3243f107bef297b5e05dd9ad5c5d11f90e6038514cba4b3a40dc9644 + languageName: node + linkType: hard + "react-native@npm:0.85.3": version: 0.85.3 resolution: "react-native@npm:0.85.3" diff --git a/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/CRACommons.h b/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/CRACommons.h index bab8921f96..4b31ed56d0 100644 --- a/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/CRACommons.h +++ b/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/CRACommons.h @@ -141,9 +141,10 @@ #include "rac_tts_platform.h" // ============================================================================= -// NETWORK - Environment, Auth, API Types, Dev Config +// NETWORK - Connect, Environment, Auth, API Types, Dev Config // ============================================================================= +#include "rac_connect.h" #include "rac_api_types.h" #include "rac_auth_manager.h" #include "rac_client_info.h" diff --git a/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/rac_connect.h b/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/rac_connect.h new file mode 100644 index 0000000000..d140664f30 --- /dev/null +++ b/sdk/runanywhere-swift/Sources/RunAnywhere/CRACommons/include/rac_connect.h @@ -0,0 +1,6 @@ +#ifndef RAC_SWIFT_CONNECT_FORWARDER_H +#define RAC_SWIFT_CONNECT_FORWARDER_H + +#include "rac/connect/rac_connect.h" + +#endif // RAC_SWIFT_CONNECT_FORWARDER_H diff --git a/sdk/runanywhere-swift/Sources/RunAnywhere/Foundation/Bridge/Extensions/CppBridge+Connect.swift b/sdk/runanywhere-swift/Sources/RunAnywhere/Foundation/Bridge/Extensions/CppBridge+Connect.swift new file mode 100644 index 0000000000..38b8b0d05f --- /dev/null +++ b/sdk/runanywhere-swift/Sources/RunAnywhere/Foundation/Bridge/Extensions/CppBridge+Connect.swift @@ -0,0 +1,135 @@ +// +// CppBridge+Connect.swift +// RunAnywhere SDK +// +// Native protocol bridge for local runtime session coordination. +// + +import CRACommons +import Foundation +import SwiftProtobuf + +private enum ConnectProtoABI { + static let platformPolicy = NativeProtoABI.load( + "rac_connect_get_platform_policy_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let hostStart = NativeProtoABI.load( + "rac_connect_host_start_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let hostStop = NativeProtoABI.load( + "rac_connect_host_stop_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let clientCreateHello = NativeProtoABI.load( + "rac_connect_client_create_hello_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let hostAcceptClient = NativeProtoABI.load( + "rac_connect_host_accept_client_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let clientValidateHost = NativeProtoABI.load( + "rac_connect_client_validate_host_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let hostCloseSession = NativeProtoABI.load( + "rac_connect_host_close_session_proto", + as: NativeProtoABI.ProtoRequest.self + ) + static let hostValidateInvocation = NativeProtoABI.load( + "rac_connect_host_validate_invocation_proto", + as: NativeProtoABI.ProtoRequest.self + ) +} + +extension CppBridge { + + /// Typed C++ coordination for local runtime hosts and clients. + /// Platform SDKs provide discovery and channel transport adapters. + public enum Connect { + + static func platformPolicy( + _ request: RAConnectPlatformPolicyRequest + ) throws -> RAConnectPlatformPolicy { + try NativeProtoABI.invoke( + request, + symbol: ConnectProtoABI.platformPolicy, + symbolName: "rac_connect_get_platform_policy_proto", + responseType: RAConnectPlatformPolicy.self + ) + } + + static func startHost(_ request: RAConnectHostStartRequest) throws -> RAConnectHostState { + try NativeProtoABI.invoke( + request, + symbol: ConnectProtoABI.hostStart, + symbolName: "rac_connect_host_start_proto", + responseType: RAConnectHostState.self + ) + } + + static func stopHost(_ request: RAConnectHostStopRequest = .init()) throws -> RAConnectHostState { + try NativeProtoABI.invoke( + request, + symbol: ConnectProtoABI.hostStop, + symbolName: "rac_connect_host_stop_proto", + responseType: RAConnectHostState.self + ) + } + + static func createClientHello( + _ request: RAConnectClientStartRequest + ) throws -> RAConnectClientHello { + try NativeProtoABI.invoke( + request, + symbol: ConnectProtoABI.clientCreateHello, + symbolName: "rac_connect_client_create_hello_proto", + responseType: RAConnectClientHello.self + ) + } + + static func acceptClient(_ hello: RAConnectClientHello) throws -> RAConnectHandshakeResponse { + try NativeProtoABI.invoke( + hello, + symbol: ConnectProtoABI.hostAcceptClient, + symbolName: "rac_connect_host_accept_client_proto", + responseType: RAConnectHandshakeResponse.self + ) + } + + static func validateHost( + _ response: RAConnectHandshakeResponse + ) throws -> RAConnectClientSessionState { + try NativeProtoABI.invoke( + response, + symbol: ConnectProtoABI.clientValidateHost, + symbolName: "rac_connect_client_validate_host_proto", + responseType: RAConnectClientSessionState.self + ) + } + + static func closeSession( + _ request: RAConnectSessionCloseRequest + ) throws -> RAConnectHostState { + try NativeProtoABI.invoke( + request, + symbol: ConnectProtoABI.hostCloseSession, + symbolName: "rac_connect_host_close_session_proto", + responseType: RAConnectHostState.self + ) + } + + static func validateInvocation( + _ request: RAConnectInvocationRequest + ) throws -> RAConnectInvocationValidation { + try NativeProtoABI.invoke( + request, + symbol: ConnectProtoABI.hostValidateInvocation, + symbolName: "rac_connect_host_validate_invocation_proto", + responseType: RAConnectInvocationValidation.self + ) + } + } +} diff --git a/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/RAConvenience.swift b/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/RAConvenience.swift index da16b5b6d6..a0ab188196 100644 --- a/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/RAConvenience.swift +++ b/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/RAConvenience.swift @@ -177,6 +177,41 @@ extension RAArchiveStructure { } } +extension RAVADConfiguration { + /// Generated from `(runanywhere.v1.rac_default)` annotations in idl/. + public static func defaults() -> RAVADConfiguration { + var r = RAVADConfiguration() + r.sampleRate = 16000 + r.frameLengthMs = 100 + r.threshold = 0.015 + return r + } +} + +extension RAVADConfiguration { + /// Generated from `(runanywhere.v1.rac_required / rac_min / rac_max / rac_min_float / rac_max_float)` annotations in idl/. + public func validate() throws { + if sampleRate < 1 || sampleRate > 48000 { + throw SDKException.validationFailed( + fieldPath: "VADConfiguration.sample_rate", + message: "sample_rate must be in 1...48000 (got \(sampleRate))" + ) + } + if frameLengthMs < 1 || frameLengthMs > 1000 { + throw SDKException.validationFailed( + fieldPath: "VADConfiguration.frame_length_ms", + message: "frame_length_ms must be in 1...1000 (got \(frameLengthMs))" + ) + } + if threshold < 0.0 || threshold > 1.0 { + throw SDKException.validationFailed( + fieldPath: "VADConfiguration.threshold", + message: "threshold must be in 0.0...1.0 (got \(threshold))" + ) + } + } +} + extension RAEmbeddingsConfiguration { /// Generated from `(runanywhere.v1.rac_default)` annotations in idl/. public static func defaults() -> RAEmbeddingsConfiguration { @@ -221,41 +256,6 @@ extension RAEmbeddingsOptions { } } -extension RAVADConfiguration { - /// Generated from `(runanywhere.v1.rac_default)` annotations in idl/. - public static func defaults() -> RAVADConfiguration { - var r = RAVADConfiguration() - r.sampleRate = 16000 - r.frameLengthMs = 100 - r.threshold = 0.015 - return r - } -} - -extension RAVADConfiguration { - /// Generated from `(runanywhere.v1.rac_required / rac_min / rac_max / rac_min_float / rac_max_float)` annotations in idl/. - public func validate() throws { - if sampleRate < 1 || sampleRate > 48000 { - throw SDKException.validationFailed( - fieldPath: "VADConfiguration.sample_rate", - message: "sample_rate must be in 1...48000 (got \(sampleRate))" - ) - } - if frameLengthMs < 1 || frameLengthMs > 1000 { - throw SDKException.validationFailed( - fieldPath: "VADConfiguration.frame_length_ms", - message: "frame_length_ms must be in 1...1000 (got \(frameLengthMs))" - ) - } - if threshold < 0.0 || threshold > 1.0 { - throw SDKException.validationFailed( - fieldPath: "VADConfiguration.threshold", - message: "threshold must be in 0.0...1.0 (got \(threshold))" - ) - } - } -} - extension RALogLevel { /// Generated from `(runanywhere.v1.rac_display_name)` annotations in idl/. public var displayName: String { diff --git a/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/connect.pb.swift b/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/connect.pb.swift new file mode 100644 index 0000000000..657158f32a --- /dev/null +++ b/sdk/runanywhere-swift/Sources/RunAnywhere/Generated/connect.pb.swift @@ -0,0 +1,1525 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// swiftlint:disable all +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: connect.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// RunAnywhere IDL — LAN host/client session contract. +// +// This schema defines the transport-independent control plane for a local +// runtime host. Discovery and sockets remain platform adapters; commons owns +// the role constraints, protocol compatibility checks, session state, and +// validation of typed remote generation requests. + +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate nonisolated struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +/// Platform identity is explicit so commons can evaluate role availability +/// from one policy table. Platform SDKs must not hardcode the host/client +/// matrix in UI or transport code. +public nonisolated enum RAConnectPlatform: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unspecified // = 0 + case macos // = 1 + case ios // = 2 + case ipados // = 3 + + /// Reserved for the follow-on SDK integrations. Keeping the values in the + /// canonical IDL avoids a later wire-format migration. + case android // = 4 + case reactNative // = 5 + case flutter // = 6 + case web // = 7 + + /// Reserved now so adding the planned Windows host adapter does not require + /// a platform-identity wire migration. Its host role remains PLANNED until + /// the native transport, discovery, and protected-storage adapter ships. + case windows // = 8 + case UNRECOGNIZED(Int) + + public init() { + self = .unspecified + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecified + case 1: self = .macos + case 2: self = .ios + case 3: self = .ipados + case 4: self = .android + case 5: self = .reactNative + case 6: self = .flutter + case 7: self = .web + case 8: self = .windows + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unspecified: return 0 + case .macos: return 1 + case .ios: return 2 + case .ipados: return 3 + case .android: return 4 + case .reactNative: return 5 + case .flutter: return 6 + case .web: return 7 + case .windows: return 8 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [RAConnectPlatform] = [ + .unspecified, + .macos, + .ios, + .ipados, + .android, + .reactNative, + .flutter, + .web, + .windows, + ] + +} + +/// Role availability is richer than a boolean so the wire contract can reserve +/// planned platforms without accidentally advertising them as usable. +public nonisolated enum RAConnectRoleAvailability: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unspecified // = 0 + case disabled // = 1 + case planned // = 2 + case enabled // = 3 + case UNRECOGNIZED(Int) + + public init() { + self = .unspecified + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecified + case 1: self = .disabled + case 2: self = .planned + case 3: self = .enabled + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unspecified: return 0 + case .disabled: return 1 + case .planned: return 2 + case .enabled: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [RAConnectRoleAvailability] = [ + .unspecified, + .disabled, + .planned, + .enabled, + ] + +} + +public nonisolated enum RAConnectHandshakeStatus: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unspecified // = 0 + case accepted // = 1 + case rejected // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .unspecified + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecified + case 1: self = .accepted + case 2: self = .rejected + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unspecified: return 0 + case .accepted: return 1 + case .rejected: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [RAConnectHandshakeStatus] = [ + .unspecified, + .accepted, + .rejected, + ] + +} + +public nonisolated enum RAConnectSessionState: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unspecified // = 0 + case connecting // = 1 + case connected // = 2 + case disconnected // = 3 + case failed // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .unspecified + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecified + case 1: self = .connecting + case 2: self = .connected + case 3: self = .disconnected + case 4: self = .failed + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unspecified: return 0 + case .connecting: return 1 + case .connected: return 2 + case .disconnected: return 3 + case .failed: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [RAConnectSessionState] = [ + .unspecified, + .connecting, + .connected, + .disconnected, + .failed, + ] + +} + +public nonisolated struct RAConnectPlatformPolicyRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var platform: RAConnectPlatform = .unspecified + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// Commons is the authority for this policy. SDKs may query it to shape UI, +/// but every host/client entrypoint also enforces it inside C++. +public nonisolated struct RAConnectPlatformPolicy: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var platform: RAConnectPlatform = .unspecified + + public var hostRole: RAConnectRoleAvailability = .unspecified + + public var clientRole: RAConnectRoleAvailability = .unspecified + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// Non-secret metadata published through LAN service discovery and echoed by +/// the handshake. `instance_id` is generated anew whenever the host starts; +/// it is not a persistent device identifier or a credential. +public nonisolated struct RAConnectDiscoveryMetadata: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var instanceID: String = String() + + public var displayName: String = String() + + public var platform: RAConnectPlatform = .unspecified + + public var protocolVersion: UInt32 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// The single language model currently shared by a host. A host must select a +/// loaded model before it starts publishing; this lets clients enter chat +/// immediately without downloading or selecting a local model. +public nonisolated struct RAConnectModelDescriptor: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var modelID: String = String() + + public var displayName: String = String() + + public var framework: String = String() + + public var contextWindow: UInt32 = 0 + + public var supportsStreaming: Bool = false + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +public nonisolated struct RAConnectHostStartRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var displayName: String = String() + + public var platform: RAConnectPlatform = .unspecified + + public var protocolVersion: UInt32 = 0 + + public var model: RAConnectModelDescriptor { + get {_model ?? RAConnectModelDescriptor()} + set {_model = newValue} + } + /// Returns true if `model` has been explicitly set. + public var hasModel: Bool {self._model != nil} + /// Clears the value of `model`. Subsequent reads from it will return its default value. + public mutating func clearModel() {self._model = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _model: RAConnectModelDescriptor? = nil +} + +public nonisolated struct RAConnectHostStopRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +public nonisolated struct RAConnectHostState: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var isHosting: Bool = false + + public var discoveryMetadata: RAConnectDiscoveryMetadata { + get {_discoveryMetadata ?? RAConnectDiscoveryMetadata()} + set {_discoveryMetadata = newValue} + } + /// Returns true if `discoveryMetadata` has been explicitly set. + public var hasDiscoveryMetadata: Bool {self._discoveryMetadata != nil} + /// Clears the value of `discoveryMetadata`. Subsequent reads from it will return its default value. + public mutating func clearDiscoveryMetadata() {self._discoveryMetadata = nil} + + public var activeClientCount: UInt32 = 0 + + public var errorMessage: String = String() + + public var model: RAConnectModelDescriptor { + get {_model ?? RAConnectModelDescriptor()} + set {_model = newValue} + } + /// Returns true if `model` has been explicitly set. + public var hasModel: Bool {self._model != nil} + /// Clears the value of `model`. Subsequent reads from it will return its default value. + public mutating func clearModel() {self._model = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _discoveryMetadata: RAConnectDiscoveryMetadata? = nil + fileprivate var _model: RAConnectModelDescriptor? = nil +} + +public nonisolated struct RAConnectClientStartRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var displayName: String = String() + + public var platform: RAConnectPlatform = .unspecified + + public var protocolVersion: UInt32 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// Sent by a client immediately after the platform transport is connected. +public nonisolated struct RAConnectClientHello: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var instanceID: String = String() + + public var displayName: String = String() + + public var platform: RAConnectPlatform = .unspecified + + public var protocolVersion: UInt32 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// Sent by the host after commons has accepted or rejected a client hello. +public nonisolated struct RAConnectHandshakeResponse: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var status: RAConnectHandshakeStatus = .unspecified + + public var sessionID: String = String() + + public var host: RAConnectDiscoveryMetadata { + get {_host ?? RAConnectDiscoveryMetadata()} + set {_host = newValue} + } + /// Returns true if `host` has been explicitly set. + public var hasHost: Bool {self._host != nil} + /// Clears the value of `host`. Subsequent reads from it will return its default value. + public mutating func clearHost() {self._host = nil} + + public var rejectionReason: String = String() + + public var model: RAConnectModelDescriptor { + get {_model ?? RAConnectModelDescriptor()} + set {_model = newValue} + } + /// Returns true if `model` has been explicitly set. + public var hasModel: Bool {self._model != nil} + /// Clears the value of `model`. Subsequent reads from it will return its default value. + public mutating func clearModel() {self._model = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _host: RAConnectDiscoveryMetadata? = nil + fileprivate var _model: RAConnectModelDescriptor? = nil +} + +/// The client validates the host response through commons and receives the +/// public session state it can expose to its platform UI. +public nonisolated struct RAConnectClientSessionState: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var state: RAConnectSessionState = .unspecified + + public var sessionID: String = String() + + public var host: RAConnectDiscoveryMetadata { + get {_host ?? RAConnectDiscoveryMetadata()} + set {_host = newValue} + } + /// Returns true if `host` has been explicitly set. + public var hasHost: Bool {self._host != nil} + /// Clears the value of `host`. Subsequent reads from it will return its default value. + public mutating func clearHost() {self._host = nil} + + public var errorMessage: String = String() + + public var model: RAConnectModelDescriptor { + get {_model ?? RAConnectModelDescriptor()} + set {_model = newValue} + } + /// Returns true if `model` has been explicitly set. + public var hasModel: Bool {self._model != nil} + /// Clears the value of `model`. Subsequent reads from it will return its default value. + public mutating func clearModel() {self._model = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _host: RAConnectDiscoveryMetadata? = nil + fileprivate var _model: RAConnectModelDescriptor? = nil +} + +public nonisolated struct RAConnectSessionCloseRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var sessionID: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// A client sends the existing typed LLM request to the selected host model. +/// `session_id` binds the request to the prior handshake; `generation.model_id` +/// must match the model the host published for that session. +public nonisolated struct RAConnectInvocationRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var sessionID: String = String() + + public var requestID: String = String() + + public var generation: RALLMGenerateRequest { + get {_generation ?? RALLMGenerateRequest()} + set {_generation = newValue} + } + /// Returns true if `generation` has been explicitly set. + public var hasGeneration: Bool {self._generation != nil} + /// Clears the value of `generation`. Subsequent reads from it will return its default value. + public mutating func clearGeneration() {self._generation = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _generation: RALLMGenerateRequest? = nil +} + +/// Commons validates that an invocation belongs to an active session and uses +/// the host's published model before any platform runtime receives the prompt. +public nonisolated struct RAConnectInvocationValidation: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var accepted: Bool = false + + public var rejectionReason: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// Hosts forward the SDK's canonical stream events without translating them to +/// a platform-specific token shape. This is the portable streaming surface for +/// future Kotlin, React Native, Flutter, and Web clients. +public nonisolated struct RAConnectInvocationEvent: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var requestID: String = String() + + public var event: RALLMStreamEvent { + get {_event ?? RALLMStreamEvent()} + set {_event = newValue} + } + /// Returns true if `event` has been explicitly set. + public var hasEvent: Bool {self._event != nil} + /// Clears the value of `event`. Subsequent reads from it will return its default value. + public mutating func clearEvent() {self._event = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _event: RALLMStreamEvent? = nil +} + +/// The connection stays open between generations, so the client needs a +/// control-plane exchange that can detect a host stopped while chat is idle. +/// These frames deliberately remain separate from LLM invocation payloads: +/// a health check must never reach a model or appear as an assistant message. +public nonisolated struct RAConnectHeartbeatRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var sessionID: String = String() + + public var sequence: UInt64 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +public nonisolated struct RAConnectHeartbeatResponse: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var sessionID: String = String() + + public var sequence: UInt64 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// Every frame after the initial ClientHello handshake is carried in one of +/// these explicit envelopes. This leaves typed inference traffic untouched +/// while allowing clients to verify an otherwise-idle host connection. +public nonisolated struct RAConnectClientFrame: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var payload: RAConnectClientFrame.OneOf_Payload? = nil + + public var invocation: RAConnectInvocationRequest { + get { + if case .invocation(let v)? = payload {return v} + return RAConnectInvocationRequest() + } + set {payload = .invocation(newValue)} + } + + public var heartbeat: RAConnectHeartbeatRequest { + get { + if case .heartbeat(let v)? = payload {return v} + return RAConnectHeartbeatRequest() + } + set {payload = .heartbeat(newValue)} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public nonisolated enum OneOf_Payload: Equatable, Sendable { + case invocation(RAConnectInvocationRequest) + case heartbeat(RAConnectHeartbeatRequest) + + } + + public init() {} +} + +public nonisolated struct RAConnectHostFrame: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var payload: RAConnectHostFrame.OneOf_Payload? = nil + + public var invocationEvent: RAConnectInvocationEvent { + get { + if case .invocationEvent(let v)? = payload {return v} + return RAConnectInvocationEvent() + } + set {payload = .invocationEvent(newValue)} + } + + public var heartbeat: RAConnectHeartbeatResponse { + get { + if case .heartbeat(let v)? = payload {return v} + return RAConnectHeartbeatResponse() + } + set {payload = .heartbeat(newValue)} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public nonisolated enum OneOf_Payload: Equatable, Sendable { + case invocationEvent(RAConnectInvocationEvent) + case heartbeat(RAConnectHeartbeatResponse) + + } + + public init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate nonisolated let _protobuf_package = "runanywhere.v1" + +nonisolated extension RAConnectPlatform: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONNECT_PLATFORM_UNSPECIFIED\0\u{1}CONNECT_PLATFORM_MACOS\0\u{1}CONNECT_PLATFORM_IOS\0\u{1}CONNECT_PLATFORM_IPADOS\0\u{1}CONNECT_PLATFORM_ANDROID\0\u{1}CONNECT_PLATFORM_REACT_NATIVE\0\u{1}CONNECT_PLATFORM_FLUTTER\0\u{1}CONNECT_PLATFORM_WEB\0\u{1}CONNECT_PLATFORM_WINDOWS\0") +} + +nonisolated extension RAConnectRoleAvailability: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONNECT_ROLE_AVAILABILITY_UNSPECIFIED\0\u{1}CONNECT_ROLE_AVAILABILITY_DISABLED\0\u{1}CONNECT_ROLE_AVAILABILITY_PLANNED\0\u{1}CONNECT_ROLE_AVAILABILITY_ENABLED\0") +} + +nonisolated extension RAConnectHandshakeStatus: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONNECT_HANDSHAKE_STATUS_UNSPECIFIED\0\u{1}CONNECT_HANDSHAKE_STATUS_ACCEPTED\0\u{1}CONNECT_HANDSHAKE_STATUS_REJECTED\0") +} + +nonisolated extension RAConnectSessionState: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONNECT_SESSION_STATE_UNSPECIFIED\0\u{1}CONNECT_SESSION_STATE_CONNECTING\0\u{1}CONNECT_SESSION_STATE_CONNECTED\0\u{1}CONNECT_SESSION_STATE_DISCONNECTED\0\u{1}CONNECT_SESSION_STATE_FAILED\0") +} + +nonisolated extension RAConnectPlatformPolicyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectPlatformPolicyRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}platform\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.platform) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.platform != .unspecified { + try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectPlatformPolicyRequest, rhs: RAConnectPlatformPolicyRequest) -> Bool { + if lhs.platform != rhs.platform {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectPlatformPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectPlatformPolicy" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}platform\0\u{3}host_role\0\u{3}client_role\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.platform) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.hostRole) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.clientRole) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.platform != .unspecified { + try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 1) + } + if self.hostRole != .unspecified { + try visitor.visitSingularEnumField(value: self.hostRole, fieldNumber: 2) + } + if self.clientRole != .unspecified { + try visitor.visitSingularEnumField(value: self.clientRole, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectPlatformPolicy, rhs: RAConnectPlatformPolicy) -> Bool { + if lhs.platform != rhs.platform {return false} + if lhs.hostRole != rhs.hostRole {return false} + if lhs.clientRole != rhs.clientRole {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectDiscoveryMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectDiscoveryMetadata" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}instance_id\0\u{3}display_name\0\u{1}platform\0\u{3}protocol_version\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.instanceID) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.displayName) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.platform) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.protocolVersion) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.instanceID.isEmpty { + try visitor.visitSingularStringField(value: self.instanceID, fieldNumber: 1) + } + if !self.displayName.isEmpty { + try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 2) + } + if self.platform != .unspecified { + try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 3) + } + if self.protocolVersion != 0 { + try visitor.visitSingularUInt32Field(value: self.protocolVersion, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectDiscoveryMetadata, rhs: RAConnectDiscoveryMetadata) -> Bool { + if lhs.instanceID != rhs.instanceID {return false} + if lhs.displayName != rhs.displayName {return false} + if lhs.platform != rhs.platform {return false} + if lhs.protocolVersion != rhs.protocolVersion {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectModelDescriptor: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectModelDescriptor" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}model_id\0\u{3}display_name\0\u{1}framework\0\u{3}context_window\0\u{3}supports_streaming\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.modelID) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.displayName) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.framework) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.contextWindow) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self.supportsStreaming) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.modelID.isEmpty { + try visitor.visitSingularStringField(value: self.modelID, fieldNumber: 1) + } + if !self.displayName.isEmpty { + try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 2) + } + if !self.framework.isEmpty { + try visitor.visitSingularStringField(value: self.framework, fieldNumber: 3) + } + if self.contextWindow != 0 { + try visitor.visitSingularUInt32Field(value: self.contextWindow, fieldNumber: 4) + } + if self.supportsStreaming != false { + try visitor.visitSingularBoolField(value: self.supportsStreaming, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectModelDescriptor, rhs: RAConnectModelDescriptor) -> Bool { + if lhs.modelID != rhs.modelID {return false} + if lhs.displayName != rhs.displayName {return false} + if lhs.framework != rhs.framework {return false} + if lhs.contextWindow != rhs.contextWindow {return false} + if lhs.supportsStreaming != rhs.supportsStreaming {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHostStartRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHostStartRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}display_name\0\u{1}platform\0\u{3}protocol_version\0\u{1}model\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.displayName) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.platform) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.protocolVersion) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._model) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.displayName.isEmpty { + try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 1) + } + if self.platform != .unspecified { + try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 2) + } + if self.protocolVersion != 0 { + try visitor.visitSingularUInt32Field(value: self.protocolVersion, fieldNumber: 3) + } + try { if let v = self._model { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHostStartRequest, rhs: RAConnectHostStartRequest) -> Bool { + if lhs.displayName != rhs.displayName {return false} + if lhs.platform != rhs.platform {return false} + if lhs.protocolVersion != rhs.protocolVersion {return false} + if lhs._model != rhs._model {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHostStopRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHostStopRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public mutating func decodeMessage(decoder: inout D) throws { + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} + } + + public func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHostStopRequest, rhs: RAConnectHostStopRequest) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHostState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHostState" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}is_hosting\0\u{3}discovery_metadata\0\u{3}active_client_count\0\u{3}error_message\0\u{1}model\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.isHosting) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._discoveryMetadata) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.activeClientCount) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._model) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.isHosting != false { + try visitor.visitSingularBoolField(value: self.isHosting, fieldNumber: 1) + } + try { if let v = self._discoveryMetadata { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if self.activeClientCount != 0 { + try visitor.visitSingularUInt32Field(value: self.activeClientCount, fieldNumber: 3) + } + if !self.errorMessage.isEmpty { + try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 4) + } + try { if let v = self._model { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHostState, rhs: RAConnectHostState) -> Bool { + if lhs.isHosting != rhs.isHosting {return false} + if lhs._discoveryMetadata != rhs._discoveryMetadata {return false} + if lhs.activeClientCount != rhs.activeClientCount {return false} + if lhs.errorMessage != rhs.errorMessage {return false} + if lhs._model != rhs._model {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectClientStartRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectClientStartRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}display_name\0\u{1}platform\0\u{3}protocol_version\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.displayName) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.platform) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.protocolVersion) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.displayName.isEmpty { + try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 1) + } + if self.platform != .unspecified { + try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 2) + } + if self.protocolVersion != 0 { + try visitor.visitSingularUInt32Field(value: self.protocolVersion, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectClientStartRequest, rhs: RAConnectClientStartRequest) -> Bool { + if lhs.displayName != rhs.displayName {return false} + if lhs.platform != rhs.platform {return false} + if lhs.protocolVersion != rhs.protocolVersion {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectClientHello: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectClientHello" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}instance_id\0\u{3}display_name\0\u{1}platform\0\u{3}protocol_version\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.instanceID) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.displayName) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.platform) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.protocolVersion) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.instanceID.isEmpty { + try visitor.visitSingularStringField(value: self.instanceID, fieldNumber: 1) + } + if !self.displayName.isEmpty { + try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 2) + } + if self.platform != .unspecified { + try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 3) + } + if self.protocolVersion != 0 { + try visitor.visitSingularUInt32Field(value: self.protocolVersion, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectClientHello, rhs: RAConnectClientHello) -> Bool { + if lhs.instanceID != rhs.instanceID {return false} + if lhs.displayName != rhs.displayName {return false} + if lhs.platform != rhs.platform {return false} + if lhs.protocolVersion != rhs.protocolVersion {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHandshakeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHandshakeResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}status\0\u{3}session_id\0\u{1}host\0\u{3}rejection_reason\0\u{1}model\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.status) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.sessionID) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._host) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.rejectionReason) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._model) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.status != .unspecified { + try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1) + } + if !self.sessionID.isEmpty { + try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 2) + } + try { if let v = self._host { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.rejectionReason.isEmpty { + try visitor.visitSingularStringField(value: self.rejectionReason, fieldNumber: 4) + } + try { if let v = self._model { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHandshakeResponse, rhs: RAConnectHandshakeResponse) -> Bool { + if lhs.status != rhs.status {return false} + if lhs.sessionID != rhs.sessionID {return false} + if lhs._host != rhs._host {return false} + if lhs.rejectionReason != rhs.rejectionReason {return false} + if lhs._model != rhs._model {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectClientSessionState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectClientSessionState" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}state\0\u{3}session_id\0\u{1}host\0\u{3}error_message\0\u{1}model\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.state) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.sessionID) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._host) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._model) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.state != .unspecified { + try visitor.visitSingularEnumField(value: self.state, fieldNumber: 1) + } + if !self.sessionID.isEmpty { + try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 2) + } + try { if let v = self._host { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.errorMessage.isEmpty { + try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 4) + } + try { if let v = self._model { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectClientSessionState, rhs: RAConnectClientSessionState) -> Bool { + if lhs.state != rhs.state {return false} + if lhs.sessionID != rhs.sessionID {return false} + if lhs._host != rhs._host {return false} + if lhs.errorMessage != rhs.errorMessage {return false} + if lhs._model != rhs._model {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectSessionCloseRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectSessionCloseRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}session_id\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.sessionID) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.sessionID.isEmpty { + try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectSessionCloseRequest, rhs: RAConnectSessionCloseRequest) -> Bool { + if lhs.sessionID != rhs.sessionID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectInvocationRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectInvocationRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}session_id\0\u{3}request_id\0\u{1}generation\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.sessionID) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.requestID) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._generation) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.sessionID.isEmpty { + try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 1) + } + if !self.requestID.isEmpty { + try visitor.visitSingularStringField(value: self.requestID, fieldNumber: 2) + } + try { if let v = self._generation { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectInvocationRequest, rhs: RAConnectInvocationRequest) -> Bool { + if lhs.sessionID != rhs.sessionID {return false} + if lhs.requestID != rhs.requestID {return false} + if lhs._generation != rhs._generation {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectInvocationValidation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectInvocationValidation" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}accepted\0\u{3}rejection_reason\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.accepted) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.rejectionReason) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.accepted != false { + try visitor.visitSingularBoolField(value: self.accepted, fieldNumber: 1) + } + if !self.rejectionReason.isEmpty { + try visitor.visitSingularStringField(value: self.rejectionReason, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectInvocationValidation, rhs: RAConnectInvocationValidation) -> Bool { + if lhs.accepted != rhs.accepted {return false} + if lhs.rejectionReason != rhs.rejectionReason {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectInvocationEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectInvocationEvent" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}request_id\0\u{1}event\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.requestID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._event) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.requestID.isEmpty { + try visitor.visitSingularStringField(value: self.requestID, fieldNumber: 1) + } + try { if let v = self._event { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectInvocationEvent, rhs: RAConnectInvocationEvent) -> Bool { + if lhs.requestID != rhs.requestID {return false} + if lhs._event != rhs._event {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHeartbeatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHeartbeatRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}session_id\0\u{1}sequence\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.sessionID) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.sequence) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.sessionID.isEmpty { + try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 1) + } + if self.sequence != 0 { + try visitor.visitSingularUInt64Field(value: self.sequence, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHeartbeatRequest, rhs: RAConnectHeartbeatRequest) -> Bool { + if lhs.sessionID != rhs.sessionID {return false} + if lhs.sequence != rhs.sequence {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHeartbeatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHeartbeatResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}session_id\0\u{1}sequence\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.sessionID) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.sequence) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.sessionID.isEmpty { + try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 1) + } + if self.sequence != 0 { + try visitor.visitSingularUInt64Field(value: self.sequence, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHeartbeatResponse, rhs: RAConnectHeartbeatResponse) -> Bool { + if lhs.sessionID != rhs.sessionID {return false} + if lhs.sequence != rhs.sequence {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectClientFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectClientFrame" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}invocation\0\u{1}heartbeat\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: RAConnectInvocationRequest? + var hadOneofValue = false + if let current = self.payload { + hadOneofValue = true + if case .invocation(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.payload = .invocation(v) + } + }() + case 2: try { + var v: RAConnectHeartbeatRequest? + var hadOneofValue = false + if let current = self.payload { + hadOneofValue = true + if case .heartbeat(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.payload = .heartbeat(v) + } + }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.payload { + case .invocation?: try { + guard case .invocation(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .heartbeat?: try { + guard case .heartbeat(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectClientFrame, rhs: RAConnectClientFrame) -> Bool { + if lhs.payload != rhs.payload {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +nonisolated extension RAConnectHostFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConnectHostFrame" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}invocation_event\0\u{1}heartbeat\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: RAConnectInvocationEvent? + var hadOneofValue = false + if let current = self.payload { + hadOneofValue = true + if case .invocationEvent(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.payload = .invocationEvent(v) + } + }() + case 2: try { + var v: RAConnectHeartbeatResponse? + var hadOneofValue = false + if let current = self.payload { + hadOneofValue = true + if case .heartbeat(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.payload = .heartbeat(v) + } + }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.payload { + case .invocationEvent?: try { + guard case .invocationEvent(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .heartbeat?: try { + guard case .heartbeat(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: RAConnectHostFrame, rhs: RAConnectHostFrame) -> Bool { + if lhs.payload != rhs.payload {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/sdk/runanywhere-swift/Sources/RunAnywhere/Public/Connect/ConnectSession.swift b/sdk/runanywhere-swift/Sources/RunAnywhere/Public/Connect/ConnectSession.swift new file mode 100644 index 0000000000..46bdf5a74a --- /dev/null +++ b/sdk/runanywhere-swift/Sources/RunAnywhere/Public/Connect/ConnectSession.swift @@ -0,0 +1,1311 @@ +// +// ConnectSession.swift +// RunAnywhere SDK +// +// Apple LAN discovery, host selection, and typed remote generation. +// + +import Combine +import Foundation +import Network +import SwiftProtobuf + +// The transport below is one queue-confined protocol state machine. Keeping its +// framing, heartbeat, host, and client transitions together makes ownership and +// cancellation invariants auditable. +// swiftlint:disable file_length + +#if os(iOS) +import UIKit +#endif + +/// A macOS runtime host discovered on the local network. +public struct ConnectHost: Identifiable, Equatable, Sendable { + public let id: String + public let displayName: String + public let protocolVersion: UInt32 + + public init(id: String, displayName: String, protocolVersion: UInt32) { + self.id = id + self.displayName = displayName + self.protocolVersion = protocolVersion + } +} + +/// A language model selected by a Mac host and made available to a client. +/// +/// Connect intentionally exposes the one model the host has loaded, rather +/// than a client-side catalog. A connected client can start text chat without +/// downloading, loading, or selecting a local language model. +public struct ConnectModel: Identifiable, Equatable, Sendable { + public let id: String + public let displayName: String + public let framework: String + public let contextWindow: UInt32 + public let supportsStreaming: Bool + + public init( + id: String, + displayName: String, + framework: String, + contextWindow: UInt32 = 0, + supportsStreaming: Bool = true + ) { + self.id = id + self.displayName = displayName + self.framework = framework + self.contextWindow = contextWindow + self.supportsStreaming = supportsStreaming + } + + init(_ descriptor: RAConnectModelDescriptor) { + self.init( + id: descriptor.modelID, + displayName: descriptor.displayName, + framework: descriptor.framework, + contextWindow: descriptor.contextWindow, + supportsStreaming: descriptor.supportsStreaming + ) + } + + var proto: RAConnectModelDescriptor { + var descriptor = RAConnectModelDescriptor() + descriptor.modelID = id + descriptor.displayName = displayName + descriptor.framework = framework + descriptor.contextWindow = contextWindow + descriptor.supportsStreaming = supportsStreaming + return descriptor + } +} + +/// The host-side operation that runs a validated text-generation request. +public typealias ConnectHostGenerationHandler = @Sendable ( + RALLMGenerateRequest +) async throws -> AsyncStream + +/// The UI-safe lifecycle state for a local runtime connection. +public enum ConnectSessionStatus: Equatable, Sendable { + case idle + case discovering + case connecting + case hosting + case connected + case disconnected(String) + case failed(String) +} + +/// Owns the Apple transport for a local runtime session. +/// +/// Commons remains the source of truth for protocol version, role validation, +/// model binding, and host-side session accounting. This type owns Bonjour and +/// the framed platform transport. It forwards the SDK's canonical streaming +/// events unchanged, so the model never needs to exist on the client device. +@MainActor +public final class ConnectSession: ObservableObject { + @Published public private(set) var status: ConnectSessionStatus = .idle + @Published public private(set) var availableHosts: [ConnectHost] = [] + @Published public private(set) var activeHost: ConnectHost? + @Published public private(set) var activeModel: ConnectModel? + @Published public private(set) var activeClientCount = 0 + @Published public private(set) var lastError: String? + @Published public private(set) var connectingHost: ConnectHost? + @Published public private(set) var lastDisconnectedHost: ConnectHost? + @Published public private(set) var lastDisconnectedModel: ConnectModel? + @Published public private(set) var lastDisconnectReason: String? + + private let transport = ConnectTransport() + // Stable for this SDK session so a network reconnect replaces the old + // host-side connection instead of being counted as another device. + private let clientInstanceID = UUID().uuidString + private var activeSessionID: String? + + public init() { + transport.onHostsChanged = { [weak self] hosts in + DispatchQueue.main.async { + self?.availableHosts = hosts + } + } + transport.onHostClientCountChanged = { [weak self] count in + DispatchQueue.main.async { + self?.activeClientCount = count + } + } + transport.onClientDisconnected = { [weak self] error in + DispatchQueue.main.async { + self?.handleClientDisconnect(error) + } + } + transport.onFailure = { [weak self] error in + DispatchQueue.main.async { + self?.handleTransportFailure(error) + } + } + } + + deinit { + transport.stop() + } + + /// Start browsing for Mac hosts over the local network. + public func startBrowsing() async throws { + try requireInitialized() + #if os(iOS) + lastError = nil + transport.startBrowsing() + if status != .connected { + status = .discovering + } + #else + throw unsupported("Only iPhone and iPad may browse for a Connect host in this release.") + #endif + } + + /// Stop local-network discovery without affecting an established session. + public func stopBrowsing() { + transport.stopBrowsing() + if status == .discovering { + status = .idle + } + } + + /// Publish this Mac together with the language model it has selected. + /// + /// A host cannot be started without a model. This avoids a connected + /// client reaching a local-model picker after it has already joined a host. + public func startHosting( + displayName: String? = nil, + model: ConnectModel, + generationHandler: @escaping ConnectHostGenerationHandler + ) async throws { + try requireInitialized() + #if os(macOS) + lastError = nil + var request = RAConnectHostStartRequest() + request.displayName = sanitizedDisplayName(displayName ?? ProcessInfo.processInfo.hostName) + request.platform = .macos + request.protocolVersion = ConnectTransport.protocolVersion + request.model = model.proto + + do { + let hostState = try CppBridge.Connect.startHost(request) + guard hostState.isHosting, hostState.hasDiscoveryMetadata, hostState.hasModel else { + throw SDKException( + code: .processingFailed, + message: hostState.errorMessage.isEmpty + ? "Connect host could not be started" + : hostState.errorMessage, + category: .network + ) + } + try transport.startHosting( + metadata: hostState.discoveryMetadata, + generationHandler: generationHandler + ) + activeModel = ConnectModel(hostState.model) + activeClientCount = Int(hostState.activeClientCount) + status = .hosting + } catch { + _ = try? CppBridge.Connect.stopHost() + activeModel = nil + lastError = error.localizedDescription + status = .failed(error.localizedDescription) + throw error + } + #else + throw unsupported("Only macOS may host in this release.") + #endif + } + + /// Stop publishing this Mac and disconnect all attached clients. + public func stopHosting() { + transport.stopHosting() + _ = try? CppBridge.Connect.stopHost() + activeModel = nil + activeClientCount = 0 + if status == .hosting { + status = .idle + } + } + + /// Pair the current iPhone or iPad with a discovered Mac host. + public func connect(to host: ConnectHost) async throws { + try requireInitialized() + #if os(iOS) + lastError = nil + connectingHost = host + status = .connecting + + var request = RAConnectClientStartRequest() + request.displayName = sanitizedDisplayName(UIDevice.current.name) + request.platform = UIDevice.current.userInterfaceIdiom == .pad ? .ipados : .ios + request.protocolVersion = ConnectTransport.protocolVersion + + do { + var hello = try CppBridge.Connect.createClientHello(request) + hello.instanceID = clientInstanceID + let response = try await transport.connect(to: host, hello: hello) + let sessionState = try CppBridge.Connect.validateHost(response) + guard sessionState.state == .connected, + !sessionState.sessionID.isEmpty, + sessionState.hasModel, + !sessionState.model.modelID.isEmpty else { + transport.disconnectClient() + throw SDKException( + code: .networkUnavailable, + message: sessionState.errorMessage.isEmpty + ? "The selected Mac could not provide a language model" + : sessionState.errorMessage, + category: .network + ) + } + + activeHost = ConnectHost( + id: host.id, + displayName: sessionState.host.displayName, + protocolVersion: sessionState.host.protocolVersion + ) + activeModel = ConnectModel(sessionState.model) + activeSessionID = sessionState.sessionID + connectingHost = nil + lastDisconnectedHost = nil + lastDisconnectedModel = nil + lastDisconnectReason = nil + status = .connected + transport.startClientHeartbeat(sessionID: sessionState.sessionID) + } catch { + clearClientState() + connectingHost = nil + status = .failed(error.localizedDescription) + lastError = error.localizedDescription + throw error + } + #else + throw unsupported("Only iPhone and iPad may connect to a Connect host in this release.") + #endif + } + + /// Run a text-generation request on the active Mac host. + /// + /// The session binds every invocation to the model selected by the host; + /// callers cannot substitute a local or arbitrary remote model identifier. + public func generateStream( + _ request: RALLMGenerateRequest + ) async throws -> AsyncStream { + #if os(iOS) + guard status == .connected, + let activeModel, + let activeSessionID, + !activeSessionID.isEmpty else { + throw SDKException( + code: .networkUnavailable, + message: "Connect to a Mac with a selected model before generating text.", + category: .network + ) + } + + var invocation = RAConnectInvocationRequest() + invocation.sessionID = activeSessionID + invocation.requestID = request.requestID.isEmpty ? UUID().uuidString : request.requestID + var generation = request + generation.requestID = invocation.requestID + generation.modelID = activeModel.id + invocation.generation = generation + return try await transport.invoke(invocation) + #else + throw unsupported("Only iPhone and iPad may generate through a Connect host in this release.") + #endif + } + + /// End the active client connection, if any. + public func disconnect() { + transport.disconnectClient() + clearClientState() + clearDisconnectContext() + switch status { + case .connected, .connecting, .disconnected, .failed: + status = .idle + default: + break + } + } + + /// Release all local-network resources owned by this session. + public func stop() { + transport.stop() + _ = try? CppBridge.Connect.stopHost() + availableHosts = [] + clearClientState() + clearDisconnectContext() + activeModel = nil + activeClientCount = 0 + status = .idle + } + + private func clearClientState() { + activeHost = nil + activeModel = status == .hosting ? activeModel : nil + activeSessionID = nil + } + + private func clearDisconnectContext() { + connectingHost = nil + lastDisconnectedHost = nil + lastDisconnectedModel = nil + lastDisconnectReason = nil + } + + private func handleClientDisconnect(_ error: Error) { + guard status == .connected else { return } + + let host = activeHost + let model = activeModel + let reason = disconnectMessage(for: error, host: host) + + clearClientState() + connectingHost = nil + lastDisconnectedHost = host + lastDisconnectedModel = model + lastDisconnectReason = reason + lastError = reason + status = .disconnected(reason) + } + + private func disconnectMessage(for error: Error, host: ConnectHost?) -> String { + let hostName = host?.displayName ?? "the Mac" + let detail = error.localizedDescription.trimmingCharacters(in: .whitespacesAndNewlines) + let genericReasons = [ + "The connection to the Mac ended.", + "The connection to the Mac was closed.", + "The Connect request was cancelled." + ] + + if detail.isEmpty || genericReasons.contains(detail) { + return "Connection to \(hostName) ended. The Mac may have stopped hosting or left the network." + } + return "Connection to \(hostName) ended: \(detail)" + } + + private func handleTransportFailure(_ error: Error) { + if status == .connected { + transport.disconnectClient() + handleClientDisconnect(error) + return + } + if case .disconnected = status { + return + } + + let message = error.localizedDescription + lastError = message + if status == .hosting { + _ = try? CppBridge.Connect.stopHost() + activeModel = nil + activeClientCount = 0 + } else { + clearClientState() + connectingHost = nil + } + status = .failed(message) + } + + private func requireInitialized() throws { + guard RunAnywhere.isInitialized else { + throw SDKException( + code: .notInitialized, + message: "Initialize the SDK before starting a Connect session", + category: .internal + ) + } + } + + private func unsupported(_ message: String) -> SDKException { + SDKException(code: .notSupported, message: message, category: .network) + } + + private func sanitizedDisplayName(_ candidate: String) -> String { + let trimmed = candidate.trimmingCharacters(in: .whitespacesAndNewlines) + return String(trimmed.prefix(128)).isEmpty ? "RunAnywhere device" : String(trimmed.prefix(128)) + } +} + +private enum ConnectTransportError: LocalizedError { + case hostUnavailable + case malformedFrame + case frameTooLarge + case invocationInProgress + case network(String) + + var errorDescription: String? { + switch self { + case .hostUnavailable: + return "The selected Mac is no longer available on the local network." + case .malformedFrame: + return "The Connect session returned an invalid response." + case .frameTooLarge: + return "The Connect session exceeded the allowed message size." + case .invocationInProgress: + return "Wait for the current response to finish before sending another message." + case let .network(message): + return message + } + } +} + +// Serial-queue-confined Network.framework adapter. +// swiftlint:disable:next type_body_length +private final class ConnectTransport: @unchecked Sendable { + static let serviceType = "_runanywhere-connect._tcp" + static let protocolVersion: UInt32 = 1 + private static let maximumFrameLength = 4 * 1024 * 1024 + private static let heartbeatInterval: DispatchTimeInterval = .seconds(3) + private static let heartbeatTimeout: DispatchTimeInterval = .seconds(2) + + var onHostsChanged: (([ConnectHost]) -> Void)? + var onHostClientCountChanged: ((Int) -> Void)? + var onClientDisconnected: ((Error) -> Void)? + var onFailure: ((Error) -> Void)? + + private let queue = DispatchQueue(label: "ai.runanywhere.connect.transport") + private var browser: NWBrowser? + private var listener: NWListener? + private var discoveredEndpoints: [String: NWEndpoint] = [:] + private var hostedConnections: [ObjectIdentifier: HostedConnection] = [:] + private var hostGenerationHandler: ConnectHostGenerationHandler? + private var clientConnection: NWConnection? + private var activeClientRequestID: String? + private var clientEventContinuation: AsyncStream.Continuation? + private var clientHeartbeatTimer: DispatchSourceTimer? + private var clientHeartbeatTimeout: DispatchWorkItem? + private var activeClientSessionID: String? + private var clientHeartbeatSequence: UInt64 = 0 + private var clientHeartbeatInFlight = false + private var pendingClientInvocation: PendingClientInvocation? + + func startBrowsing() { + queue.async { [weak self] in + guard let self, self.browser == nil else { return } + + let browser = NWBrowser( + for: .bonjour(type: Self.serviceType, domain: nil), + using: .tcp + ) + browser.stateUpdateHandler = { [weak self] state in + guard let self, case let .failed(error) = state else { return } + self.onFailure?(ConnectTransportError.network(error.localizedDescription)) + } + browser.browseResultsChangedHandler = { [weak self] results, _ in + self?.updateDiscoveredHosts(results) + } + self.browser = browser + browser.start(queue: self.queue) + } + } + + func stopBrowsing() { + queue.async { [weak self] in + guard let self else { return } + self.browser?.cancel() + self.browser = nil + self.discoveredEndpoints = [:] + self.onHostsChanged?([]) + } + } + + func startHosting( + metadata: RAConnectDiscoveryMetadata, + generationHandler: @escaping ConnectHostGenerationHandler + ) throws { + try queue.sync { [weak self] in + guard let self, self.listener == nil else { return } + + let listener = try NWListener(using: .tcp) + listener.service = NWListener.Service( + name: metadata.displayName, + type: Self.serviceType + ) + listener.stateUpdateHandler = { [weak self] state in + guard let self, case let .failed(error) = state else { return } + self.listener?.cancel() + self.listener = nil + self.onFailure?(ConnectTransportError.network(error.localizedDescription)) + } + listener.newConnectionHandler = { [weak self] connection in + self?.accept(connection) + } + self.hostGenerationHandler = generationHandler + self.listener = listener + listener.start(queue: self.queue) + } + } + + func stopHosting() { + queue.async { [weak self] in + guard let self else { return } + self.listener?.cancel() + self.listener = nil + self.hostGenerationHandler = nil + let connections = self.hostedConnections.values + self.hostedConnections = [:] + connections.forEach { $0.connection.cancel() } + self.onHostClientCountChanged?(0) + } + } + + func connect( + to host: ConnectHost, + hello: RAConnectClientHello + ) async throws -> RAConnectHandshakeResponse { + try await withCheckedThrowingContinuation { continuation in + queue.async { [weak self] in + guard let self, + let endpoint = self.discoveredEndpoints[host.id] else { + continuation.resume(throwing: ConnectTransportError.hostUnavailable) + return + } + + self.clearClientConnection(notify: false) + let connection = NWConnection(to: endpoint, using: .tcp) + let attempt = ClientAttempt(continuation: continuation) + connection.stateUpdateHandler = { [weak self, weak connection] state in + guard let self, let connection else { return } + self.handleClientState(state, connection: connection, hello: hello, attempt: attempt) + } + self.clientConnection = connection + connection.start(queue: self.queue) + } + } + } + + func invoke(_ invocation: RAConnectInvocationRequest) async throws -> AsyncStream { + try await withCheckedThrowingContinuation { continuation in + queue.async { [weak self] in + guard let self else { + continuation.resume(throwing: ConnectTransportError.hostUnavailable) + return + } + self.beginClientInvocation(invocation, continuation: continuation) + } + } + } + + /// Keeps an idle client connection observable. NWConnection alone only + /// reports a remote close when it has pending I/O, so a lightweight typed + /// request/response makes a stopped Mac visible without waiting for the + /// user to send another prompt. + func startClientHeartbeat(sessionID: String) { + queue.async { [weak self] in + guard let self, self.clientConnection != nil else { return } + self.stopClientHeartbeat() + self.activeClientSessionID = sessionID + + let timer = DispatchSource.makeTimerSource(queue: self.queue) + timer.schedule( + deadline: .now() + Self.heartbeatInterval, + repeating: Self.heartbeatInterval, + leeway: .milliseconds(250) + ) + timer.setEventHandler { [weak self] in + self?.sendClientHeartbeatIfIdle() + } + self.clientHeartbeatTimer = timer + timer.resume() + } + } + + private func beginClientInvocation( + _ invocation: RAConnectInvocationRequest, + continuation: CheckedContinuation, Error> + ) { + guard let connection = clientConnection else { + continuation.resume(throwing: ConnectTransportError.hostUnavailable) + return + } + guard activeClientRequestID == nil else { + continuation.resume(throwing: ConnectTransportError.invocationInProgress) + return + } + guard !clientHeartbeatInFlight else { + // A heartbeat owns the one outstanding receive on this TCP + // connection. Queue the user's turn for the few milliseconds + // until it completes instead of surfacing a spurious failure. + guard pendingClientInvocation == nil else { + continuation.resume(throwing: ConnectTransportError.invocationInProgress) + return + } + pendingClientInvocation = PendingClientInvocation( + invocation: invocation, + continuation: continuation + ) + return + } + + let requestID = invocation.requestID + var streamContinuation: AsyncStream.Continuation? + let stream = AsyncStream { streamContinuation = $0 } + guard let streamContinuation else { + continuation.resume(throwing: ConnectTransportError.malformedFrame) + return + } + + activeClientRequestID = requestID + clientEventContinuation = streamContinuation + streamContinuation.onTermination = { [weak self] _ in + guard let transport = self else { return } + transport.queue.async { [transport] in + guard transport.activeClientRequestID == requestID else { return } + transport.finishClientInvocation() + } + } + + do { + var frame = RAConnectClientFrame() + frame.invocation = invocation + try sendFrame(try frame.serializedData(), on: connection) { [weak self] result in + guard let self else { return } + switch result { + case .success: + self.receiveClientInvocationEvent(on: connection, requestID: requestID) + case let .failure(error): + self.finishClientInvocation(with: error) + self.clearClientConnection(connection, notify: true, reason: error) + } + } + continuation.resume(returning: stream) + } catch { + finishClientInvocation(with: error) + clearClientConnection(connection, notify: true, reason: error) + continuation.resume(throwing: error) + } + } + + private func sendClientHeartbeatIfIdle() { + guard let connection = clientConnection, + let sessionID = activeClientSessionID, + activeClientRequestID == nil, + !clientHeartbeatInFlight else { + return + } + + clientHeartbeatSequence &+= 1 + let sequence = clientHeartbeatSequence + clientHeartbeatInFlight = true + + var heartbeat = RAConnectHeartbeatRequest() + heartbeat.sessionID = sessionID + heartbeat.sequence = sequence + var frame = RAConnectClientFrame() + frame.heartbeat = heartbeat + + let timeout = DispatchWorkItem { [weak self, weak connection] in + guard let self, + let connection, + self.clientConnection === connection, + self.clientHeartbeatInFlight, + self.clientHeartbeatSequence == sequence else { + return + } + self.clearClientConnection( + connection, + notify: true, + reason: ConnectTransportError.network( + "The Mac stopped responding. It may have stopped hosting or left the network." + ) + ) + } + clientHeartbeatTimeout = timeout + queue.asyncAfter(deadline: .now() + Self.heartbeatTimeout, execute: timeout) + + do { + try sendFrame(try frame.serializedData(), on: connection) { [weak self] result in + guard let self else { return } + switch result { + case .success: + self.receiveClientHeartbeat( + on: connection, + sessionID: sessionID, + sequence: sequence + ) + case let .failure(error): + self.clearClientConnection(connection, notify: true, reason: error) + } + } + } catch { + clearClientConnection(connection, notify: true, reason: error) + } + } + + private func receiveClientHeartbeat( + on connection: NWConnection, + sessionID: String, + sequence: UInt64 + ) { + receiveFrame(on: connection) { [weak self] result in + guard let self, + self.clientConnection === connection, + self.clientHeartbeatInFlight else { + return + } + + switch result { + case let .success(data): + do { + let frame = try RAConnectHostFrame(serializedBytes: data) + guard case let .heartbeat(response)? = frame.payload, + response.sessionID == sessionID, + response.sequence == sequence else { + throw ConnectTransportError.malformedFrame + } + self.finishClientHeartbeat() + } catch { + self.clearClientConnection(connection, notify: true, reason: error) + } + case let .failure(error): + self.clearClientConnection(connection, notify: true, reason: error) + } + } + } + + private func finishClientHeartbeat() { + clientHeartbeatTimeout?.cancel() + clientHeartbeatTimeout = nil + clientHeartbeatInFlight = false + + guard let pending = pendingClientInvocation else { return } + pendingClientInvocation = nil + beginClientInvocation(pending.invocation, continuation: pending.continuation) + } + + private func stopClientHeartbeat() { + clientHeartbeatTimer?.cancel() + clientHeartbeatTimer = nil + clientHeartbeatTimeout?.cancel() + clientHeartbeatTimeout = nil + activeClientSessionID = nil + clientHeartbeatInFlight = false + } + + func disconnectClient() { + queue.async { [weak self] in + self?.clearClientConnection(notify: false) + } + } + + func stop() { + stopBrowsing() + stopHosting() + disconnectClient() + } + + private func updateDiscoveredHosts(_ results: Set) { + var endpoints: [String: NWEndpoint] = [:] + let hosts = results.compactMap { result -> ConnectHost? in + guard case let .service(name, _, domain, _) = result.endpoint else { return nil } + let id = "\(name)@\(domain)" + endpoints[id] = result.endpoint + return ConnectHost( + id: id, + displayName: name, + protocolVersion: Self.protocolVersion + ) + } + discoveredEndpoints = endpoints + onHostsChanged?(hosts.sorted { + $0.displayName.localizedCaseInsensitiveCompare($1.displayName) == .orderedAscending + }) + } + + private func accept(_ connection: NWConnection) { + let key = ObjectIdentifier(connection) + connection.stateUpdateHandler = { [weak self, weak connection] state in + guard let self, let connection else { return } + switch state { + case .failed, .cancelled: + self.removeHostedConnection(for: connection) + default: + break + } + } + connection.start(queue: queue) + receiveFrame(on: connection) { [weak self] result in + guard let self else { return } + switch result { + case let .success(data): + do { + let hello = try RAConnectClientHello(serializedBytes: data) + + // The commons layer invalidates the previous session for + // this client identity. Mirror that replacement in the + // platform transport so the live UI count stays accurate. + let staleConnections = self.hostedConnections.values.filter { + $0.clientInstanceID == hello.instanceID + } + staleConnections.forEach { + self.removeHostedConnection(for: $0.connection) + $0.connection.cancel() + } + + let response = try CppBridge.Connect.acceptClient(hello) + + guard response.status == .accepted, !response.sessionID.isEmpty else { + try self.sendFrame(try response.serializedData(), on: connection) { _ in + connection.cancel() + } + return + } + + let hosted = HostedConnection( + connection: connection, + sessionID: response.sessionID, + clientInstanceID: hello.instanceID + ) + self.hostedConnections[key] = hosted + try self.sendFrame(try response.serializedData(), on: connection) { [weak self] sendResult in + guard let self else { return } + guard case .success = sendResult else { + self.removeHostedConnection(for: connection) + connection.cancel() + return + } + self.onHostClientCountChanged?(self.hostedConnections.count) + self.receiveHostFrame(on: hosted) + } + } catch { + self.onFailure?(error) + connection.cancel() + } + case .failure: + connection.cancel() + } + } + } + + private func receiveHostFrame(on hosted: HostedConnection) { + receiveFrame(on: hosted.connection) { [weak self, weak hosted] result in + guard let self, let hosted else { return } + switch result { + case let .success(data): + do { + let frame = try RAConnectClientFrame(serializedBytes: data) + guard let payload = frame.payload else { + throw ConnectTransportError.malformedFrame + } + switch payload { + case let .invocation(invocation): + self.handleHostInvocation(invocation, on: hosted) + case let .heartbeat(heartbeat): + self.respondToHeartbeat(heartbeat, on: hosted) + } + } catch { + hosted.connection.cancel() + } + case .failure: + hosted.connection.cancel() + } + } + } + + private func handleHostInvocation(_ invocation: RAConnectInvocationRequest, on hosted: HostedConnection) { + do { + let validation = try CppBridge.Connect.validateInvocation(invocation) + guard validation.accepted, invocation.sessionID == hosted.sessionID else { + sendHostTerminalError( + validation.rejectionReason.isEmpty + ? "The Mac rejected this generation request." + : validation.rejectionReason, + requestID: invocation.requestID, + on: hosted + ) + return + } + guard let handler = hostGenerationHandler else { + sendHostTerminalError( + "This Mac is not ready to run the selected model.", + requestID: invocation.requestID, + on: hosted + ) + return + } + forwardHostGeneration( + invocation.generation, + requestID: invocation.requestID, + handler: handler, + on: hosted + ) + } catch { + sendHostTerminalError( + error.localizedDescription, + requestID: invocation.requestID, + on: hosted + ) + } + } + + private func respondToHeartbeat(_ heartbeat: RAConnectHeartbeatRequest, on hosted: HostedConnection) { + guard heartbeat.sessionID == hosted.sessionID else { + hosted.connection.cancel() + return + } + + var response = RAConnectHeartbeatResponse() + response.sessionID = hosted.sessionID + response.sequence = heartbeat.sequence + var frame = RAConnectHostFrame() + frame.heartbeat = response + + do { + try sendFrame(try frame.serializedData(), on: hosted.connection) { [weak self, weak hosted] result in + guard let self, let hosted else { return } + switch result { + case .success: + self.receiveHostFrame(on: hosted) + case .failure: + hosted.connection.cancel() + } + } + } catch { + hosted.connection.cancel() + } + } + + private func forwardHostGeneration( + _ request: RALLMGenerateRequest, + requestID: String, + handler: @escaping ConnectHostGenerationHandler, + on hosted: HostedConnection + ) { + Task { [weak self, weak hosted] in + guard let self, let hosted else { return } + do { + let events = try await handler(request) + var receivedTerminalEvent = false + for await event in events { + var envelope = RAConnectInvocationEvent() + envelope.requestID = requestID + envelope.event = event + var frame = RAConnectHostFrame() + frame.invocationEvent = envelope + try await self.sendFrameAsync(try frame.serializedData(), on: hosted.connection) + if event.isFinal { + receivedTerminalEvent = true + break + } + } + if !receivedTerminalEvent { + try await self.sendTerminalErrorFrame( + "The Mac ended generation without a final result.", + requestID: requestID, + on: hosted.connection + ) + } + } catch { + try? await self.sendTerminalErrorFrame( + error.localizedDescription, + requestID: requestID, + on: hosted.connection + ) + } + self.queue.async { [weak self, weak hosted] in + guard let self, let hosted else { return } + self.receiveHostFrame(on: hosted) + } + } + } + + private func sendHostTerminalError( + _ message: String, + requestID: String, + on hosted: HostedConnection + ) { + Task { [weak self, weak hosted] in + guard let self, let hosted else { return } + try? await self.sendTerminalErrorFrame(message, requestID: requestID, on: hosted.connection) + self.queue.async { [weak self, weak hosted] in + guard let self, let hosted else { return } + self.receiveHostFrame(on: hosted) + } + } + } + + private func sendTerminalErrorFrame( + _ message: String, + requestID: String, + on connection: NWConnection + ) async throws { + var event = RALLMStreamEvent() + event.requestID = requestID + event.isFinal = true + event.finishReason = "error" + event.errorMessage = message + event.eventKind = .error + + var envelope = RAConnectInvocationEvent() + envelope.requestID = requestID + envelope.event = event + var frame = RAConnectHostFrame() + frame.invocationEvent = envelope + try await sendFrameAsync(try frame.serializedData(), on: connection) + } + + private func receiveClientInvocationEvent(on connection: NWConnection, requestID: String) { + receiveFrame(on: connection) { [weak self] result in + guard let self, self.clientConnection === connection, + self.activeClientRequestID == requestID else { return } + switch result { + case let .success(data): + do { + let frame = try RAConnectHostFrame(serializedBytes: data) + guard case let .invocationEvent(envelope)? = frame.payload, + envelope.requestID == requestID, + envelope.hasEvent else { + throw ConnectTransportError.malformedFrame + } + self.clientEventContinuation?.yield(envelope.event) + if envelope.event.isFinal { + self.finishClientInvocation() + } else { + self.receiveClientInvocationEvent(on: connection, requestID: requestID) + } + } catch { + self.finishClientInvocation(with: error) + self.clearClientConnection(connection, notify: true, reason: error) + } + case let .failure(error): + self.finishClientInvocation(with: error) + self.clearClientConnection(connection, notify: true, reason: error) + } + } + } + + private func removeHostedConnection(for connection: NWConnection) { + let key = ObjectIdentifier(connection) + guard let hosted = hostedConnections.removeValue(forKey: key) else { return } + var request = RAConnectSessionCloseRequest() + request.sessionID = hosted.sessionID + _ = try? CppBridge.Connect.closeSession(request) + onHostClientCountChanged?(hostedConnections.count) + } + + private func handleClientState( + _ state: NWConnection.State, + connection: NWConnection, + hello: RAConnectClientHello, + attempt: ClientAttempt + ) { + switch state { + case .ready: + guard !attempt.didStartHandshake else { return } + attempt.didStartHandshake = true + do { + try sendFrame(try hello.serializedData(), on: connection) { [weak self] result in + guard let self else { return } + switch result { + case .success: + self.receiveFrame(on: connection) { result in + switch result { + case let .success(data): + do { + attempt.finish(.success(try RAConnectHandshakeResponse(serializedBytes: data))) + } catch { + attempt.finish(.failure(error)) + connection.cancel() + } + case let .failure(error): + attempt.finish(.failure(error)) + connection.cancel() + } + } + case let .failure(error): + attempt.finish(.failure(error)) + connection.cancel() + } + } + } catch { + attempt.finish(.failure(error)) + connection.cancel() + } + case let .failed(error): + let reason = ConnectTransportError.network(error.localizedDescription) + attempt.finish(.failure(reason)) + clearClientConnection(connection, notify: true, reason: reason) + case .cancelled: + let reason = ConnectTransportError.network("The connection to the Mac was closed.") + if !attempt.didFinish { + attempt.finish(.failure(reason)) + } + clearClientConnection(connection, notify: true, reason: reason) + default: + break + } + } + + private func clearClientConnection( + _ expected: NWConnection? = nil, + notify: Bool, + reason: Error = ConnectTransportError.network("The connection to the Mac ended.") + ) { + guard expected == nil || expected === clientConnection else { return } + let connection = clientConnection + clientConnection = nil + connection?.cancel() + stopClientHeartbeat() + finishPendingClientInvocation(with: reason) + finishClientInvocation( + with: reason, + emitError: false + ) + if notify, connection != nil { + onClientDisconnected?(reason) + } + } + + private func finishPendingClientInvocation(with error: Error) { + guard let pending = pendingClientInvocation else { return } + pendingClientInvocation = nil + pending.continuation.resume(throwing: error) + } + + private func finishClientInvocation( + with error: Error? = nil, + emitError: Bool = true + ) { + guard let continuation = clientEventContinuation else { return } + if let error, emitError { + var event = RALLMStreamEvent() + event.requestID = activeClientRequestID ?? "" + event.isFinal = true + event.finishReason = "error" + event.errorMessage = error.localizedDescription + event.eventKind = .error + continuation.yield(event) + } + continuation.finish() + activeClientRequestID = nil + clientEventContinuation = nil + } + + private func sendFrameAsync(_ payload: Data, on connection: NWConnection) async throws { + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in + queue.async { [weak self] in + guard let self else { + continuation.resume(throwing: ConnectTransportError.hostUnavailable) + return + } + do { + try self.sendFrame(payload, on: connection) { result in + continuation.resume(with: result) + } + } catch { + continuation.resume(throwing: error) + } + } + } + } + + private func sendFrame( + _ payload: Data, + on connection: NWConnection, + completion: @escaping @Sendable (Result) -> Void + ) throws { + guard payload.count <= Self.maximumFrameLength else { + throw ConnectTransportError.frameTooLarge + } + var length = UInt32(payload.count).bigEndian + var frame = Data(bytes: &length, count: MemoryLayout.size) + frame.append(payload) + connection.send(content: frame, completion: .contentProcessed { error in + if let error { + completion(.failure(ConnectTransportError.network(error.localizedDescription))) + } else { + completion(.success(())) + } + }) + } + + private func receiveFrame( + on connection: NWConnection, + completion: @escaping @Sendable (Result) -> Void + ) { + receiveExactly(4, on: connection) { [weak self] headerResult in + guard let self else { return } + switch headerResult { + case let .success(header): + let length = header.reduce(UInt32(0)) { partial, byte in + (partial << 8) | UInt32(byte) + } + guard length > 0, length <= Self.maximumFrameLength else { + completion(.failure(ConnectTransportError.frameTooLarge)) + return + } + self.receiveExactly(Int(length), on: connection, completion: completion) + case let .failure(error): + completion(.failure(error)) + } + } + } + + private func receiveExactly( + _ length: Int, + on connection: NWConnection, + completion: @escaping @Sendable (Result) -> Void + ) { + connection.receive(minimumIncompleteLength: length, maximumLength: length) { data, _, _, error in + if let error { + completion(.failure(ConnectTransportError.network(error.localizedDescription))) + return + } + guard let data, data.count == length else { + completion(.failure(ConnectTransportError.malformedFrame)) + return + } + completion(.success(data)) + } + } +} + +/// Holds a Network.framework connection that is serialized by `ConnectTransport.queue`. +/// Generation tasks never mutate it directly; they only schedule framed sends back onto +/// that queue through `sendFrameAsync`. +private final class HostedConnection: @unchecked Sendable { + let connection: NWConnection + let sessionID: String + let clientInstanceID: String + + init(connection: NWConnection, sessionID: String, clientInstanceID: String) { + self.connection = connection + self.sessionID = sessionID + self.clientInstanceID = clientInstanceID + } +} + +/// A user turn that arrived while the control-plane heartbeat owned the +/// connection's receive callback. Connect permits one generation at a time, +/// so a single queued turn preserves that invariant without dropping input. +private final class PendingClientInvocation { + let invocation: RAConnectInvocationRequest + let continuation: CheckedContinuation, Error> + + init( + invocation: RAConnectInvocationRequest, + continuation: CheckedContinuation, Error> + ) { + self.invocation = invocation + self.continuation = continuation + } +} + +private final class ClientAttempt: @unchecked Sendable { + let continuation: CheckedContinuation + var didStartHandshake = false + var didFinish = false + + init(continuation: CheckedContinuation) { + self.continuation = continuation + } + + func finish(_ result: Result) { + guard !didFinish else { return } + didFinish = true + continuation.resume(with: result) + } +} diff --git a/sdk/shared/proto-ts/dist/connect.d.ts b/sdk/shared/proto-ts/dist/connect.d.ts new file mode 100644 index 0000000000..171589cb1a --- /dev/null +++ b/sdk/shared/proto-ts/dist/connect.d.ts @@ -0,0 +1,238 @@ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { LLMGenerateRequest, LLMStreamEvent } from "./llm_service"; +export declare const protobufPackage = "runanywhere.v1"; +/** + * Platform identity is explicit so commons can evaluate role availability + * from one policy table. Platform SDKs must not hardcode the host/client + * matrix in UI or transport code. + */ +export declare enum ConnectPlatform { + CONNECT_PLATFORM_UNSPECIFIED = 0, + CONNECT_PLATFORM_MACOS = 1, + CONNECT_PLATFORM_IOS = 2, + CONNECT_PLATFORM_IPADOS = 3, + /** + * CONNECT_PLATFORM_ANDROID - Reserved for the follow-on SDK integrations. Keeping the values in the + * canonical IDL avoids a later wire-format migration. + */ + CONNECT_PLATFORM_ANDROID = 4, + CONNECT_PLATFORM_REACT_NATIVE = 5, + CONNECT_PLATFORM_FLUTTER = 6, + CONNECT_PLATFORM_WEB = 7, + /** + * CONNECT_PLATFORM_WINDOWS - Reserved now so adding the planned Windows host adapter does not require + * a platform-identity wire migration. Its host role remains PLANNED until + * the native transport, discovery, and protected-storage adapter ships. + */ + CONNECT_PLATFORM_WINDOWS = 8, + UNRECOGNIZED = -1 +} +export declare function connectPlatformFromJSON(object: any): ConnectPlatform; +export declare function connectPlatformToJSON(object: ConnectPlatform): string; +/** + * Role availability is richer than a boolean so the wire contract can reserve + * planned platforms without accidentally advertising them as usable. + */ +export declare enum ConnectRoleAvailability { + CONNECT_ROLE_AVAILABILITY_UNSPECIFIED = 0, + CONNECT_ROLE_AVAILABILITY_DISABLED = 1, + CONNECT_ROLE_AVAILABILITY_PLANNED = 2, + CONNECT_ROLE_AVAILABILITY_ENABLED = 3, + UNRECOGNIZED = -1 +} +export declare function connectRoleAvailabilityFromJSON(object: any): ConnectRoleAvailability; +export declare function connectRoleAvailabilityToJSON(object: ConnectRoleAvailability): string; +export declare enum ConnectHandshakeStatus { + CONNECT_HANDSHAKE_STATUS_UNSPECIFIED = 0, + CONNECT_HANDSHAKE_STATUS_ACCEPTED = 1, + CONNECT_HANDSHAKE_STATUS_REJECTED = 2, + UNRECOGNIZED = -1 +} +export declare function connectHandshakeStatusFromJSON(object: any): ConnectHandshakeStatus; +export declare function connectHandshakeStatusToJSON(object: ConnectHandshakeStatus): string; +export declare enum ConnectSessionState { + CONNECT_SESSION_STATE_UNSPECIFIED = 0, + CONNECT_SESSION_STATE_CONNECTING = 1, + CONNECT_SESSION_STATE_CONNECTED = 2, + CONNECT_SESSION_STATE_DISCONNECTED = 3, + CONNECT_SESSION_STATE_FAILED = 4, + UNRECOGNIZED = -1 +} +export declare function connectSessionStateFromJSON(object: any): ConnectSessionState; +export declare function connectSessionStateToJSON(object: ConnectSessionState): string; +export interface ConnectPlatformPolicyRequest { + platform: ConnectPlatform; +} +/** + * Commons is the authority for this policy. SDKs may query it to shape UI, + * but every host/client entrypoint also enforces it inside C++. + */ +export interface ConnectPlatformPolicy { + platform: ConnectPlatform; + hostRole: ConnectRoleAvailability; + clientRole: ConnectRoleAvailability; +} +/** + * Non-secret metadata published through LAN service discovery and echoed by + * the handshake. `instance_id` is generated anew whenever the host starts; + * it is not a persistent device identifier or a credential. + */ +export interface ConnectDiscoveryMetadata { + instanceId: string; + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; +} +/** + * The single language model currently shared by a host. A host must select a + * loaded model before it starts publishing; this lets clients enter chat + * immediately without downloading or selecting a local model. + */ +export interface ConnectModelDescriptor { + modelId: string; + displayName: string; + framework: string; + contextWindow: number; + supportsStreaming: boolean; +} +export interface ConnectHostStartRequest { + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; + model?: ConnectModelDescriptor | undefined; +} +export interface ConnectHostStopRequest { +} +export interface ConnectHostState { + isHosting: boolean; + discoveryMetadata?: ConnectDiscoveryMetadata | undefined; + activeClientCount: number; + errorMessage: string; + model?: ConnectModelDescriptor | undefined; +} +export interface ConnectClientStartRequest { + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; +} +/** Sent by a client immediately after the platform transport is connected. */ +export interface ConnectClientHello { + instanceId: string; + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; +} +/** Sent by the host after commons has accepted or rejected a client hello. */ +export interface ConnectHandshakeResponse { + status: ConnectHandshakeStatus; + sessionId: string; + host?: ConnectDiscoveryMetadata | undefined; + rejectionReason: string; + model?: ConnectModelDescriptor | undefined; +} +/** + * The client validates the host response through commons and receives the + * public session state it can expose to its platform UI. + */ +export interface ConnectClientSessionState { + state: ConnectSessionState; + sessionId: string; + host?: ConnectDiscoveryMetadata | undefined; + errorMessage: string; + model?: ConnectModelDescriptor | undefined; +} +export interface ConnectSessionCloseRequest { + sessionId: string; +} +/** + * A client sends the existing typed LLM request to the selected host model. + * `session_id` binds the request to the prior handshake; `generation.model_id` + * must match the model the host published for that session. + */ +export interface ConnectInvocationRequest { + sessionId: string; + requestId: string; + generation?: LLMGenerateRequest | undefined; +} +/** + * Commons validates that an invocation belongs to an active session and uses + * the host's published model before any platform runtime receives the prompt. + */ +export interface ConnectInvocationValidation { + accepted: boolean; + rejectionReason: string; +} +/** + * Hosts forward the SDK's canonical stream events without translating them to + * a platform-specific token shape. This is the portable streaming surface for + * future Kotlin, React Native, Flutter, and Web clients. + */ +export interface ConnectInvocationEvent { + requestId: string; + event?: LLMStreamEvent | undefined; +} +/** + * The connection stays open between generations, so the client needs a + * control-plane exchange that can detect a host stopped while chat is idle. + * These frames deliberately remain separate from LLM invocation payloads: + * a health check must never reach a model or appear as an assistant message. + */ +export interface ConnectHeartbeatRequest { + sessionId: string; + sequence: number; +} +export interface ConnectHeartbeatResponse { + sessionId: string; + sequence: number; +} +/** + * Every frame after the initial ClientHello handshake is carried in one of + * these explicit envelopes. This leaves typed inference traffic untouched + * while allowing clients to verify an otherwise-idle host connection. + */ +export interface ConnectClientFrame { + invocation?: ConnectInvocationRequest | undefined; + heartbeat?: ConnectHeartbeatRequest | undefined; +} +export interface ConnectHostFrame { + invocationEvent?: ConnectInvocationEvent | undefined; + heartbeat?: ConnectHeartbeatResponse | undefined; +} +export declare const ConnectPlatformPolicyRequest: MessageFns; +export declare const ConnectPlatformPolicy: MessageFns; +export declare const ConnectDiscoveryMetadata: MessageFns; +export declare const ConnectModelDescriptor: MessageFns; +export declare const ConnectHostStartRequest: MessageFns; +export declare const ConnectHostStopRequest: MessageFns; +export declare const ConnectHostState: MessageFns; +export declare const ConnectClientStartRequest: MessageFns; +export declare const ConnectClientHello: MessageFns; +export declare const ConnectHandshakeResponse: MessageFns; +export declare const ConnectClientSessionState: MessageFns; +export declare const ConnectSessionCloseRequest: MessageFns; +export declare const ConnectInvocationRequest: MessageFns; +export declare const ConnectInvocationValidation: MessageFns; +export declare const ConnectInvocationEvent: MessageFns; +export declare const ConnectHeartbeatRequest: MessageFns; +export declare const ConnectHeartbeatResponse: MessageFns; +export declare const ConnectClientFrame: MessageFns; +export declare const ConnectHostFrame: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P : P & { + [K in keyof P]: Exact; +} & { + [K in Exclude>]: never; +}; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} +export {}; diff --git a/sdk/shared/proto-ts/dist/connect.js b/sdk/shared/proto-ts/dist/connect.js new file mode 100644 index 0000000000..ddab3df9b8 --- /dev/null +++ b/sdk/shared/proto-ts/dist/connect.js @@ -0,0 +1,1951 @@ +"use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.8 +// protoc v7.35.1 +// source: connect.proto +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectHostFrame = exports.ConnectClientFrame = exports.ConnectHeartbeatResponse = exports.ConnectHeartbeatRequest = exports.ConnectInvocationEvent = exports.ConnectInvocationValidation = exports.ConnectInvocationRequest = exports.ConnectSessionCloseRequest = exports.ConnectClientSessionState = exports.ConnectHandshakeResponse = exports.ConnectClientHello = exports.ConnectClientStartRequest = exports.ConnectHostState = exports.ConnectHostStopRequest = exports.ConnectHostStartRequest = exports.ConnectModelDescriptor = exports.ConnectDiscoveryMetadata = exports.ConnectPlatformPolicy = exports.ConnectPlatformPolicyRequest = exports.ConnectSessionState = exports.ConnectHandshakeStatus = exports.ConnectRoleAvailability = exports.ConnectPlatform = exports.protobufPackage = void 0; +exports.connectPlatformFromJSON = connectPlatformFromJSON; +exports.connectPlatformToJSON = connectPlatformToJSON; +exports.connectRoleAvailabilityFromJSON = connectRoleAvailabilityFromJSON; +exports.connectRoleAvailabilityToJSON = connectRoleAvailabilityToJSON; +exports.connectHandshakeStatusFromJSON = connectHandshakeStatusFromJSON; +exports.connectHandshakeStatusToJSON = connectHandshakeStatusToJSON; +exports.connectSessionStateFromJSON = connectSessionStateFromJSON; +exports.connectSessionStateToJSON = connectSessionStateToJSON; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +const llm_service_1 = require("./llm_service"); +exports.protobufPackage = "runanywhere.v1"; +/** + * Platform identity is explicit so commons can evaluate role availability + * from one policy table. Platform SDKs must not hardcode the host/client + * matrix in UI or transport code. + */ +var ConnectPlatform; +(function (ConnectPlatform) { + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_UNSPECIFIED"] = 0] = "CONNECT_PLATFORM_UNSPECIFIED"; + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_MACOS"] = 1] = "CONNECT_PLATFORM_MACOS"; + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_IOS"] = 2] = "CONNECT_PLATFORM_IOS"; + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_IPADOS"] = 3] = "CONNECT_PLATFORM_IPADOS"; + /** + * CONNECT_PLATFORM_ANDROID - Reserved for the follow-on SDK integrations. Keeping the values in the + * canonical IDL avoids a later wire-format migration. + */ + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_ANDROID"] = 4] = "CONNECT_PLATFORM_ANDROID"; + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_REACT_NATIVE"] = 5] = "CONNECT_PLATFORM_REACT_NATIVE"; + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_FLUTTER"] = 6] = "CONNECT_PLATFORM_FLUTTER"; + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_WEB"] = 7] = "CONNECT_PLATFORM_WEB"; + /** + * CONNECT_PLATFORM_WINDOWS - Reserved now so adding the planned Windows host adapter does not require + * a platform-identity wire migration. Its host role remains PLANNED until + * the native transport, discovery, and protected-storage adapter ships. + */ + ConnectPlatform[ConnectPlatform["CONNECT_PLATFORM_WINDOWS"] = 8] = "CONNECT_PLATFORM_WINDOWS"; + ConnectPlatform[ConnectPlatform["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ConnectPlatform || (exports.ConnectPlatform = ConnectPlatform = {})); +function connectPlatformFromJSON(object) { + switch (object) { + case 0: + case "CONNECT_PLATFORM_UNSPECIFIED": + return ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED; + case 1: + case "CONNECT_PLATFORM_MACOS": + return ConnectPlatform.CONNECT_PLATFORM_MACOS; + case 2: + case "CONNECT_PLATFORM_IOS": + return ConnectPlatform.CONNECT_PLATFORM_IOS; + case 3: + case "CONNECT_PLATFORM_IPADOS": + return ConnectPlatform.CONNECT_PLATFORM_IPADOS; + case 4: + case "CONNECT_PLATFORM_ANDROID": + return ConnectPlatform.CONNECT_PLATFORM_ANDROID; + case 5: + case "CONNECT_PLATFORM_REACT_NATIVE": + return ConnectPlatform.CONNECT_PLATFORM_REACT_NATIVE; + case 6: + case "CONNECT_PLATFORM_FLUTTER": + return ConnectPlatform.CONNECT_PLATFORM_FLUTTER; + case 7: + case "CONNECT_PLATFORM_WEB": + return ConnectPlatform.CONNECT_PLATFORM_WEB; + case 8: + case "CONNECT_PLATFORM_WINDOWS": + return ConnectPlatform.CONNECT_PLATFORM_WINDOWS; + case -1: + case "UNRECOGNIZED": + default: + return ConnectPlatform.UNRECOGNIZED; + } +} +function connectPlatformToJSON(object) { + switch (object) { + case ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED: + return "CONNECT_PLATFORM_UNSPECIFIED"; + case ConnectPlatform.CONNECT_PLATFORM_MACOS: + return "CONNECT_PLATFORM_MACOS"; + case ConnectPlatform.CONNECT_PLATFORM_IOS: + return "CONNECT_PLATFORM_IOS"; + case ConnectPlatform.CONNECT_PLATFORM_IPADOS: + return "CONNECT_PLATFORM_IPADOS"; + case ConnectPlatform.CONNECT_PLATFORM_ANDROID: + return "CONNECT_PLATFORM_ANDROID"; + case ConnectPlatform.CONNECT_PLATFORM_REACT_NATIVE: + return "CONNECT_PLATFORM_REACT_NATIVE"; + case ConnectPlatform.CONNECT_PLATFORM_FLUTTER: + return "CONNECT_PLATFORM_FLUTTER"; + case ConnectPlatform.CONNECT_PLATFORM_WEB: + return "CONNECT_PLATFORM_WEB"; + case ConnectPlatform.CONNECT_PLATFORM_WINDOWS: + return "CONNECT_PLATFORM_WINDOWS"; + case ConnectPlatform.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Role availability is richer than a boolean so the wire contract can reserve + * planned platforms without accidentally advertising them as usable. + */ +var ConnectRoleAvailability; +(function (ConnectRoleAvailability) { + ConnectRoleAvailability[ConnectRoleAvailability["CONNECT_ROLE_AVAILABILITY_UNSPECIFIED"] = 0] = "CONNECT_ROLE_AVAILABILITY_UNSPECIFIED"; + ConnectRoleAvailability[ConnectRoleAvailability["CONNECT_ROLE_AVAILABILITY_DISABLED"] = 1] = "CONNECT_ROLE_AVAILABILITY_DISABLED"; + ConnectRoleAvailability[ConnectRoleAvailability["CONNECT_ROLE_AVAILABILITY_PLANNED"] = 2] = "CONNECT_ROLE_AVAILABILITY_PLANNED"; + ConnectRoleAvailability[ConnectRoleAvailability["CONNECT_ROLE_AVAILABILITY_ENABLED"] = 3] = "CONNECT_ROLE_AVAILABILITY_ENABLED"; + ConnectRoleAvailability[ConnectRoleAvailability["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ConnectRoleAvailability || (exports.ConnectRoleAvailability = ConnectRoleAvailability = {})); +function connectRoleAvailabilityFromJSON(object) { + switch (object) { + case 0: + case "CONNECT_ROLE_AVAILABILITY_UNSPECIFIED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED; + case 1: + case "CONNECT_ROLE_AVAILABILITY_DISABLED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_DISABLED; + case 2: + case "CONNECT_ROLE_AVAILABILITY_PLANNED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_PLANNED; + case 3: + case "CONNECT_ROLE_AVAILABILITY_ENABLED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED; + case -1: + case "UNRECOGNIZED": + default: + return ConnectRoleAvailability.UNRECOGNIZED; + } +} +function connectRoleAvailabilityToJSON(object) { + switch (object) { + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED: + return "CONNECT_ROLE_AVAILABILITY_UNSPECIFIED"; + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_DISABLED: + return "CONNECT_ROLE_AVAILABILITY_DISABLED"; + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_PLANNED: + return "CONNECT_ROLE_AVAILABILITY_PLANNED"; + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED: + return "CONNECT_ROLE_AVAILABILITY_ENABLED"; + case ConnectRoleAvailability.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +var ConnectHandshakeStatus; +(function (ConnectHandshakeStatus) { + ConnectHandshakeStatus[ConnectHandshakeStatus["CONNECT_HANDSHAKE_STATUS_UNSPECIFIED"] = 0] = "CONNECT_HANDSHAKE_STATUS_UNSPECIFIED"; + ConnectHandshakeStatus[ConnectHandshakeStatus["CONNECT_HANDSHAKE_STATUS_ACCEPTED"] = 1] = "CONNECT_HANDSHAKE_STATUS_ACCEPTED"; + ConnectHandshakeStatus[ConnectHandshakeStatus["CONNECT_HANDSHAKE_STATUS_REJECTED"] = 2] = "CONNECT_HANDSHAKE_STATUS_REJECTED"; + ConnectHandshakeStatus[ConnectHandshakeStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ConnectHandshakeStatus || (exports.ConnectHandshakeStatus = ConnectHandshakeStatus = {})); +function connectHandshakeStatusFromJSON(object) { + switch (object) { + case 0: + case "CONNECT_HANDSHAKE_STATUS_UNSPECIFIED": + return ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED; + case 1: + case "CONNECT_HANDSHAKE_STATUS_ACCEPTED": + return ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_ACCEPTED; + case 2: + case "CONNECT_HANDSHAKE_STATUS_REJECTED": + return ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_REJECTED; + case -1: + case "UNRECOGNIZED": + default: + return ConnectHandshakeStatus.UNRECOGNIZED; + } +} +function connectHandshakeStatusToJSON(object) { + switch (object) { + case ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED: + return "CONNECT_HANDSHAKE_STATUS_UNSPECIFIED"; + case ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_ACCEPTED: + return "CONNECT_HANDSHAKE_STATUS_ACCEPTED"; + case ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_REJECTED: + return "CONNECT_HANDSHAKE_STATUS_REJECTED"; + case ConnectHandshakeStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +var ConnectSessionState; +(function (ConnectSessionState) { + ConnectSessionState[ConnectSessionState["CONNECT_SESSION_STATE_UNSPECIFIED"] = 0] = "CONNECT_SESSION_STATE_UNSPECIFIED"; + ConnectSessionState[ConnectSessionState["CONNECT_SESSION_STATE_CONNECTING"] = 1] = "CONNECT_SESSION_STATE_CONNECTING"; + ConnectSessionState[ConnectSessionState["CONNECT_SESSION_STATE_CONNECTED"] = 2] = "CONNECT_SESSION_STATE_CONNECTED"; + ConnectSessionState[ConnectSessionState["CONNECT_SESSION_STATE_DISCONNECTED"] = 3] = "CONNECT_SESSION_STATE_DISCONNECTED"; + ConnectSessionState[ConnectSessionState["CONNECT_SESSION_STATE_FAILED"] = 4] = "CONNECT_SESSION_STATE_FAILED"; + ConnectSessionState[ConnectSessionState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ConnectSessionState || (exports.ConnectSessionState = ConnectSessionState = {})); +function connectSessionStateFromJSON(object) { + switch (object) { + case 0: + case "CONNECT_SESSION_STATE_UNSPECIFIED": + return ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED; + case 1: + case "CONNECT_SESSION_STATE_CONNECTING": + return ConnectSessionState.CONNECT_SESSION_STATE_CONNECTING; + case 2: + case "CONNECT_SESSION_STATE_CONNECTED": + return ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED; + case 3: + case "CONNECT_SESSION_STATE_DISCONNECTED": + return ConnectSessionState.CONNECT_SESSION_STATE_DISCONNECTED; + case 4: + case "CONNECT_SESSION_STATE_FAILED": + return ConnectSessionState.CONNECT_SESSION_STATE_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ConnectSessionState.UNRECOGNIZED; + } +} +function connectSessionStateToJSON(object) { + switch (object) { + case ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED: + return "CONNECT_SESSION_STATE_UNSPECIFIED"; + case ConnectSessionState.CONNECT_SESSION_STATE_CONNECTING: + return "CONNECT_SESSION_STATE_CONNECTING"; + case ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED: + return "CONNECT_SESSION_STATE_CONNECTED"; + case ConnectSessionState.CONNECT_SESSION_STATE_DISCONNECTED: + return "CONNECT_SESSION_STATE_DISCONNECTED"; + case ConnectSessionState.CONNECT_SESSION_STATE_FAILED: + return "CONNECT_SESSION_STATE_FAILED"; + case ConnectSessionState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +function createBaseConnectPlatformPolicyRequest() { + return { platform: 0 }; +} +exports.ConnectPlatformPolicyRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.platform !== 0) { + writer.uint32(8).int32(message.platform); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectPlatformPolicyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.platform = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + return obj; + }, + create(base) { + return exports.ConnectPlatformPolicyRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectPlatformPolicyRequest(); + message.platform = object.platform ?? 0; + return message; + }, +}; +function createBaseConnectPlatformPolicy() { + return { platform: 0, hostRole: 0, clientRole: 0 }; +} +exports.ConnectPlatformPolicy = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.platform !== 0) { + writer.uint32(8).int32(message.platform); + } + if (message.hostRole !== 0) { + writer.uint32(16).int32(message.hostRole); + } + if (message.clientRole !== 0) { + writer.uint32(24).int32(message.clientRole); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectPlatformPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.platform = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.hostRole = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.clientRole = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + hostRole: isSet(object.hostRole) + ? connectRoleAvailabilityFromJSON(object.hostRole) + : isSet(object.host_role) + ? connectRoleAvailabilityFromJSON(object.host_role) + : 0, + clientRole: isSet(object.clientRole) + ? connectRoleAvailabilityFromJSON(object.clientRole) + : isSet(object.client_role) + ? connectRoleAvailabilityFromJSON(object.client_role) + : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.hostRole !== 0) { + obj.hostRole = connectRoleAvailabilityToJSON(message.hostRole); + } + if (message.clientRole !== 0) { + obj.clientRole = connectRoleAvailabilityToJSON(message.clientRole); + } + return obj; + }, + create(base) { + return exports.ConnectPlatformPolicy.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectPlatformPolicy(); + message.platform = object.platform ?? 0; + message.hostRole = object.hostRole ?? 0; + message.clientRole = object.clientRole ?? 0; + return message; + }, +}; +function createBaseConnectDiscoveryMetadata() { + return { instanceId: "", displayName: "", platform: 0, protocolVersion: 0 }; +} +exports.ConnectDiscoveryMetadata = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(24).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(32).uint32(message.protocolVersion); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectDiscoveryMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.instanceId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.displayName = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.platform = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.protocolVersion = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + instanceId: isSet(object.instanceId) + ? globalThis.String(object.instanceId) + : isSet(object.instance_id) + ? globalThis.String(object.instance_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.instanceId !== "") { + obj.instanceId = message.instanceId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + return obj; + }, + create(base) { + return exports.ConnectDiscoveryMetadata.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectDiscoveryMetadata(); + message.instanceId = object.instanceId ?? ""; + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + return message; + }, +}; +function createBaseConnectModelDescriptor() { + return { modelId: "", displayName: "", framework: "", contextWindow: 0, supportsStreaming: false }; +} +exports.ConnectModelDescriptor = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.modelId !== "") { + writer.uint32(10).string(message.modelId); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.framework !== "") { + writer.uint32(26).string(message.framework); + } + if (message.contextWindow !== 0) { + writer.uint32(32).uint32(message.contextWindow); + } + if (message.supportsStreaming !== false) { + writer.uint32(40).bool(message.supportsStreaming); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectModelDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.modelId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.displayName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.framework = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.contextWindow = reader.uint32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.supportsStreaming = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + modelId: isSet(object.modelId) + ? globalThis.String(object.modelId) + : isSet(object.model_id) + ? globalThis.String(object.model_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + framework: isSet(object.framework) ? globalThis.String(object.framework) : "", + contextWindow: isSet(object.contextWindow) + ? globalThis.Number(object.contextWindow) + : isSet(object.context_window) + ? globalThis.Number(object.context_window) + : 0, + supportsStreaming: isSet(object.supportsStreaming) + ? globalThis.Boolean(object.supportsStreaming) + : isSet(object.supports_streaming) + ? globalThis.Boolean(object.supports_streaming) + : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.modelId !== "") { + obj.modelId = message.modelId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.framework !== "") { + obj.framework = message.framework; + } + if (message.contextWindow !== 0) { + obj.contextWindow = Math.round(message.contextWindow); + } + if (message.supportsStreaming !== false) { + obj.supportsStreaming = message.supportsStreaming; + } + return obj; + }, + create(base) { + return exports.ConnectModelDescriptor.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectModelDescriptor(); + message.modelId = object.modelId ?? ""; + message.displayName = object.displayName ?? ""; + message.framework = object.framework ?? ""; + message.contextWindow = object.contextWindow ?? 0; + message.supportsStreaming = object.supportsStreaming ?? false; + return message; + }, +}; +function createBaseConnectHostStartRequest() { + return { displayName: "", platform: 0, protocolVersion: 0, model: undefined }; +} +exports.ConnectHostStartRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.displayName !== "") { + writer.uint32(10).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(16).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(24).uint32(message.protocolVersion); + } + if (message.model !== undefined) { + exports.ConnectModelDescriptor.encode(message.model, writer.uint32(34).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostStartRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.displayName = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.platform = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.protocolVersion = reader.uint32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.model = exports.ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + model: isSet(object.model) ? exports.ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + if (message.model !== undefined) { + obj.model = exports.ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + create(base) { + return exports.ConnectHostStartRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectHostStartRequest(); + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + message.model = (object.model !== undefined && object.model !== null) + ? exports.ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; +function createBaseConnectHostStopRequest() { + return {}; +} +exports.ConnectHostStopRequest = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostStopRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.ConnectHostStopRequest.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseConnectHostStopRequest(); + return message; + }, +}; +function createBaseConnectHostState() { + return { isHosting: false, discoveryMetadata: undefined, activeClientCount: 0, errorMessage: "", model: undefined }; +} +exports.ConnectHostState = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.isHosting !== false) { + writer.uint32(8).bool(message.isHosting); + } + if (message.discoveryMetadata !== undefined) { + exports.ConnectDiscoveryMetadata.encode(message.discoveryMetadata, writer.uint32(18).fork()).join(); + } + if (message.activeClientCount !== 0) { + writer.uint32(24).uint32(message.activeClientCount); + } + if (message.errorMessage !== "") { + writer.uint32(34).string(message.errorMessage); + } + if (message.model !== undefined) { + exports.ConnectModelDescriptor.encode(message.model, writer.uint32(42).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.isHosting = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.discoveryMetadata = exports.ConnectDiscoveryMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.activeClientCount = reader.uint32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.errorMessage = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.model = exports.ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + isHosting: isSet(object.isHosting) + ? globalThis.Boolean(object.isHosting) + : isSet(object.is_hosting) + ? globalThis.Boolean(object.is_hosting) + : false, + discoveryMetadata: isSet(object.discoveryMetadata) + ? exports.ConnectDiscoveryMetadata.fromJSON(object.discoveryMetadata) + : isSet(object.discovery_metadata) + ? exports.ConnectDiscoveryMetadata.fromJSON(object.discovery_metadata) + : undefined, + activeClientCount: isSet(object.activeClientCount) + ? globalThis.Number(object.activeClientCount) + : isSet(object.active_client_count) + ? globalThis.Number(object.active_client_count) + : 0, + errorMessage: isSet(object.errorMessage) + ? globalThis.String(object.errorMessage) + : isSet(object.error_message) + ? globalThis.String(object.error_message) + : "", + model: isSet(object.model) ? exports.ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.isHosting !== false) { + obj.isHosting = message.isHosting; + } + if (message.discoveryMetadata !== undefined) { + obj.discoveryMetadata = exports.ConnectDiscoveryMetadata.toJSON(message.discoveryMetadata); + } + if (message.activeClientCount !== 0) { + obj.activeClientCount = Math.round(message.activeClientCount); + } + if (message.errorMessage !== "") { + obj.errorMessage = message.errorMessage; + } + if (message.model !== undefined) { + obj.model = exports.ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + create(base) { + return exports.ConnectHostState.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectHostState(); + message.isHosting = object.isHosting ?? false; + message.discoveryMetadata = (object.discoveryMetadata !== undefined && object.discoveryMetadata !== null) + ? exports.ConnectDiscoveryMetadata.fromPartial(object.discoveryMetadata) + : undefined; + message.activeClientCount = object.activeClientCount ?? 0; + message.errorMessage = object.errorMessage ?? ""; + message.model = (object.model !== undefined && object.model !== null) + ? exports.ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; +function createBaseConnectClientStartRequest() { + return { displayName: "", platform: 0, protocolVersion: 0 }; +} +exports.ConnectClientStartRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.displayName !== "") { + writer.uint32(10).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(16).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(24).uint32(message.protocolVersion); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientStartRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.displayName = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.platform = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.protocolVersion = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + return obj; + }, + create(base) { + return exports.ConnectClientStartRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectClientStartRequest(); + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + return message; + }, +}; +function createBaseConnectClientHello() { + return { instanceId: "", displayName: "", platform: 0, protocolVersion: 0 }; +} +exports.ConnectClientHello = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(24).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(32).uint32(message.protocolVersion); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientHello(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.instanceId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.displayName = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.platform = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.protocolVersion = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + instanceId: isSet(object.instanceId) + ? globalThis.String(object.instanceId) + : isSet(object.instance_id) + ? globalThis.String(object.instance_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.instanceId !== "") { + obj.instanceId = message.instanceId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + return obj; + }, + create(base) { + return exports.ConnectClientHello.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectClientHello(); + message.instanceId = object.instanceId ?? ""; + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + return message; + }, +}; +function createBaseConnectHandshakeResponse() { + return { status: 0, sessionId: "", host: undefined, rejectionReason: "", model: undefined }; +} +exports.ConnectHandshakeResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.sessionId !== "") { + writer.uint32(18).string(message.sessionId); + } + if (message.host !== undefined) { + exports.ConnectDiscoveryMetadata.encode(message.host, writer.uint32(26).fork()).join(); + } + if (message.rejectionReason !== "") { + writer.uint32(34).string(message.rejectionReason); + } + if (message.model !== undefined) { + exports.ConnectModelDescriptor.encode(message.model, writer.uint32(42).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHandshakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.status = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.sessionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.host = exports.ConnectDiscoveryMetadata.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.rejectionReason = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.model = exports.ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + status: isSet(object.status) ? connectHandshakeStatusFromJSON(object.status) : 0, + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + host: isSet(object.host) ? exports.ConnectDiscoveryMetadata.fromJSON(object.host) : undefined, + rejectionReason: isSet(object.rejectionReason) + ? globalThis.String(object.rejectionReason) + : isSet(object.rejection_reason) + ? globalThis.String(object.rejection_reason) + : "", + model: isSet(object.model) ? exports.ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.status !== 0) { + obj.status = connectHandshakeStatusToJSON(message.status); + } + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.host !== undefined) { + obj.host = exports.ConnectDiscoveryMetadata.toJSON(message.host); + } + if (message.rejectionReason !== "") { + obj.rejectionReason = message.rejectionReason; + } + if (message.model !== undefined) { + obj.model = exports.ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + create(base) { + return exports.ConnectHandshakeResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectHandshakeResponse(); + message.status = object.status ?? 0; + message.sessionId = object.sessionId ?? ""; + message.host = (object.host !== undefined && object.host !== null) + ? exports.ConnectDiscoveryMetadata.fromPartial(object.host) + : undefined; + message.rejectionReason = object.rejectionReason ?? ""; + message.model = (object.model !== undefined && object.model !== null) + ? exports.ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; +function createBaseConnectClientSessionState() { + return { state: 0, sessionId: "", host: undefined, errorMessage: "", model: undefined }; +} +exports.ConnectClientSessionState = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.sessionId !== "") { + writer.uint32(18).string(message.sessionId); + } + if (message.host !== undefined) { + exports.ConnectDiscoveryMetadata.encode(message.host, writer.uint32(26).fork()).join(); + } + if (message.errorMessage !== "") { + writer.uint32(34).string(message.errorMessage); + } + if (message.model !== undefined) { + exports.ConnectModelDescriptor.encode(message.model, writer.uint32(42).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientSessionState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.state = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.sessionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.host = exports.ConnectDiscoveryMetadata.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.errorMessage = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.model = exports.ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + state: isSet(object.state) ? connectSessionStateFromJSON(object.state) : 0, + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + host: isSet(object.host) ? exports.ConnectDiscoveryMetadata.fromJSON(object.host) : undefined, + errorMessage: isSet(object.errorMessage) + ? globalThis.String(object.errorMessage) + : isSet(object.error_message) + ? globalThis.String(object.error_message) + : "", + model: isSet(object.model) ? exports.ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.state !== 0) { + obj.state = connectSessionStateToJSON(message.state); + } + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.host !== undefined) { + obj.host = exports.ConnectDiscoveryMetadata.toJSON(message.host); + } + if (message.errorMessage !== "") { + obj.errorMessage = message.errorMessage; + } + if (message.model !== undefined) { + obj.model = exports.ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + create(base) { + return exports.ConnectClientSessionState.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectClientSessionState(); + message.state = object.state ?? 0; + message.sessionId = object.sessionId ?? ""; + message.host = (object.host !== undefined && object.host !== null) + ? exports.ConnectDiscoveryMetadata.fromPartial(object.host) + : undefined; + message.errorMessage = object.errorMessage ?? ""; + message.model = (object.model !== undefined && object.model !== null) + ? exports.ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; +function createBaseConnectSessionCloseRequest() { + return { sessionId: "" }; +} +exports.ConnectSessionCloseRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectSessionCloseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.sessionId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + return obj; + }, + create(base) { + return exports.ConnectSessionCloseRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectSessionCloseRequest(); + message.sessionId = object.sessionId ?? ""; + return message; + }, +}; +function createBaseConnectInvocationRequest() { + return { sessionId: "", requestId: "", generation: undefined }; +} +exports.ConnectInvocationRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + if (message.requestId !== "") { + writer.uint32(18).string(message.requestId); + } + if (message.generation !== undefined) { + llm_service_1.LLMGenerateRequest.encode(message.generation, writer.uint32(26).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectInvocationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.sessionId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.requestId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.generation = llm_service_1.LLMGenerateRequest.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + requestId: isSet(object.requestId) + ? globalThis.String(object.requestId) + : isSet(object.request_id) + ? globalThis.String(object.request_id) + : "", + generation: isSet(object.generation) ? llm_service_1.LLMGenerateRequest.fromJSON(object.generation) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.requestId !== "") { + obj.requestId = message.requestId; + } + if (message.generation !== undefined) { + obj.generation = llm_service_1.LLMGenerateRequest.toJSON(message.generation); + } + return obj; + }, + create(base) { + return exports.ConnectInvocationRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectInvocationRequest(); + message.sessionId = object.sessionId ?? ""; + message.requestId = object.requestId ?? ""; + message.generation = (object.generation !== undefined && object.generation !== null) + ? llm_service_1.LLMGenerateRequest.fromPartial(object.generation) + : undefined; + return message; + }, +}; +function createBaseConnectInvocationValidation() { + return { accepted: false, rejectionReason: "" }; +} +exports.ConnectInvocationValidation = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.accepted !== false) { + writer.uint32(8).bool(message.accepted); + } + if (message.rejectionReason !== "") { + writer.uint32(18).string(message.rejectionReason); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectInvocationValidation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.accepted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.rejectionReason = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + accepted: isSet(object.accepted) ? globalThis.Boolean(object.accepted) : false, + rejectionReason: isSet(object.rejectionReason) + ? globalThis.String(object.rejectionReason) + : isSet(object.rejection_reason) + ? globalThis.String(object.rejection_reason) + : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.accepted !== false) { + obj.accepted = message.accepted; + } + if (message.rejectionReason !== "") { + obj.rejectionReason = message.rejectionReason; + } + return obj; + }, + create(base) { + return exports.ConnectInvocationValidation.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectInvocationValidation(); + message.accepted = object.accepted ?? false; + message.rejectionReason = object.rejectionReason ?? ""; + return message; + }, +}; +function createBaseConnectInvocationEvent() { + return { requestId: "", event: undefined }; +} +exports.ConnectInvocationEvent = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.event !== undefined) { + llm_service_1.LLMStreamEvent.encode(message.event, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectInvocationEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.requestId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.event = llm_service_1.LLMStreamEvent.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + requestId: isSet(object.requestId) + ? globalThis.String(object.requestId) + : isSet(object.request_id) + ? globalThis.String(object.request_id) + : "", + event: isSet(object.event) ? llm_service_1.LLMStreamEvent.fromJSON(object.event) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.requestId !== "") { + obj.requestId = message.requestId; + } + if (message.event !== undefined) { + obj.event = llm_service_1.LLMStreamEvent.toJSON(message.event); + } + return obj; + }, + create(base) { + return exports.ConnectInvocationEvent.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectInvocationEvent(); + message.requestId = object.requestId ?? ""; + message.event = (object.event !== undefined && object.event !== null) + ? llm_service_1.LLMStreamEvent.fromPartial(object.event) + : undefined; + return message; + }, +}; +function createBaseConnectHeartbeatRequest() { + return { sessionId: "", sequence: 0 }; +} +exports.ConnectHeartbeatRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + if (message.sequence !== 0) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHeartbeatRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.sessionId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.sequence = longToNumber(reader.uint64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.sequence !== 0) { + obj.sequence = Math.round(message.sequence); + } + return obj; + }, + create(base) { + return exports.ConnectHeartbeatRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectHeartbeatRequest(); + message.sessionId = object.sessionId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; +function createBaseConnectHeartbeatResponse() { + return { sessionId: "", sequence: 0 }; +} +exports.ConnectHeartbeatResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + if (message.sequence !== 0) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHeartbeatResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.sessionId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.sequence = longToNumber(reader.uint64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.sequence !== 0) { + obj.sequence = Math.round(message.sequence); + } + return obj; + }, + create(base) { + return exports.ConnectHeartbeatResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectHeartbeatResponse(); + message.sessionId = object.sessionId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; +function createBaseConnectClientFrame() { + return { invocation: undefined, heartbeat: undefined }; +} +exports.ConnectClientFrame = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.invocation !== undefined) { + exports.ConnectInvocationRequest.encode(message.invocation, writer.uint32(10).fork()).join(); + } + if (message.heartbeat !== undefined) { + exports.ConnectHeartbeatRequest.encode(message.heartbeat, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientFrame(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.invocation = exports.ConnectInvocationRequest.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.heartbeat = exports.ConnectHeartbeatRequest.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + invocation: isSet(object.invocation) ? exports.ConnectInvocationRequest.fromJSON(object.invocation) : undefined, + heartbeat: isSet(object.heartbeat) ? exports.ConnectHeartbeatRequest.fromJSON(object.heartbeat) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.invocation !== undefined) { + obj.invocation = exports.ConnectInvocationRequest.toJSON(message.invocation); + } + if (message.heartbeat !== undefined) { + obj.heartbeat = exports.ConnectHeartbeatRequest.toJSON(message.heartbeat); + } + return obj; + }, + create(base) { + return exports.ConnectClientFrame.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectClientFrame(); + message.invocation = (object.invocation !== undefined && object.invocation !== null) + ? exports.ConnectInvocationRequest.fromPartial(object.invocation) + : undefined; + message.heartbeat = (object.heartbeat !== undefined && object.heartbeat !== null) + ? exports.ConnectHeartbeatRequest.fromPartial(object.heartbeat) + : undefined; + return message; + }, +}; +function createBaseConnectHostFrame() { + return { invocationEvent: undefined, heartbeat: undefined }; +} +exports.ConnectHostFrame = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.invocationEvent !== undefined) { + exports.ConnectInvocationEvent.encode(message.invocationEvent, writer.uint32(10).fork()).join(); + } + if (message.heartbeat !== undefined) { + exports.ConnectHeartbeatResponse.encode(message.heartbeat, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostFrame(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.invocationEvent = exports.ConnectInvocationEvent.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.heartbeat = exports.ConnectHeartbeatResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + invocationEvent: isSet(object.invocationEvent) + ? exports.ConnectInvocationEvent.fromJSON(object.invocationEvent) + : isSet(object.invocation_event) + ? exports.ConnectInvocationEvent.fromJSON(object.invocation_event) + : undefined, + heartbeat: isSet(object.heartbeat) ? exports.ConnectHeartbeatResponse.fromJSON(object.heartbeat) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.invocationEvent !== undefined) { + obj.invocationEvent = exports.ConnectInvocationEvent.toJSON(message.invocationEvent); + } + if (message.heartbeat !== undefined) { + obj.heartbeat = exports.ConnectHeartbeatResponse.toJSON(message.heartbeat); + } + return obj; + }, + create(base) { + return exports.ConnectHostFrame.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseConnectHostFrame(); + message.invocationEvent = (object.invocationEvent !== undefined && object.invocationEvent !== null) + ? exports.ConnectInvocationEvent.fromPartial(object.invocationEvent) + : undefined; + message.heartbeat = (object.heartbeat !== undefined && object.heartbeat !== null) + ? exports.ConnectHeartbeatResponse.fromPartial(object.heartbeat) + : undefined; + return message; + }, +}; +function longToNumber(int64) { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} +function isSet(value) { + return value !== null && value !== undefined; +} diff --git a/sdk/shared/proto-ts/src/connect.ts b/sdk/shared/proto-ts/src/connect.ts new file mode 100644 index 0000000000..17d9186b82 --- /dev/null +++ b/sdk/shared/proto-ts/src/connect.ts @@ -0,0 +1,2299 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.8 +// protoc v7.35.1 +// source: connect.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { LLMGenerateRequest, LLMStreamEvent } from "./llm_service"; + +export const protobufPackage = "runanywhere.v1"; + +/** + * Platform identity is explicit so commons can evaluate role availability + * from one policy table. Platform SDKs must not hardcode the host/client + * matrix in UI or transport code. + */ +export enum ConnectPlatform { + CONNECT_PLATFORM_UNSPECIFIED = 0, + CONNECT_PLATFORM_MACOS = 1, + CONNECT_PLATFORM_IOS = 2, + CONNECT_PLATFORM_IPADOS = 3, + /** + * CONNECT_PLATFORM_ANDROID - Reserved for the follow-on SDK integrations. Keeping the values in the + * canonical IDL avoids a later wire-format migration. + */ + CONNECT_PLATFORM_ANDROID = 4, + CONNECT_PLATFORM_REACT_NATIVE = 5, + CONNECT_PLATFORM_FLUTTER = 6, + CONNECT_PLATFORM_WEB = 7, + /** + * CONNECT_PLATFORM_WINDOWS - Reserved now so adding the planned Windows host adapter does not require + * a platform-identity wire migration. Its host role remains PLANNED until + * the native transport, discovery, and protected-storage adapter ships. + */ + CONNECT_PLATFORM_WINDOWS = 8, + UNRECOGNIZED = -1, +} + +export function connectPlatformFromJSON(object: any): ConnectPlatform { + switch (object) { + case 0: + case "CONNECT_PLATFORM_UNSPECIFIED": + return ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED; + case 1: + case "CONNECT_PLATFORM_MACOS": + return ConnectPlatform.CONNECT_PLATFORM_MACOS; + case 2: + case "CONNECT_PLATFORM_IOS": + return ConnectPlatform.CONNECT_PLATFORM_IOS; + case 3: + case "CONNECT_PLATFORM_IPADOS": + return ConnectPlatform.CONNECT_PLATFORM_IPADOS; + case 4: + case "CONNECT_PLATFORM_ANDROID": + return ConnectPlatform.CONNECT_PLATFORM_ANDROID; + case 5: + case "CONNECT_PLATFORM_REACT_NATIVE": + return ConnectPlatform.CONNECT_PLATFORM_REACT_NATIVE; + case 6: + case "CONNECT_PLATFORM_FLUTTER": + return ConnectPlatform.CONNECT_PLATFORM_FLUTTER; + case 7: + case "CONNECT_PLATFORM_WEB": + return ConnectPlatform.CONNECT_PLATFORM_WEB; + case 8: + case "CONNECT_PLATFORM_WINDOWS": + return ConnectPlatform.CONNECT_PLATFORM_WINDOWS; + case -1: + case "UNRECOGNIZED": + default: + return ConnectPlatform.UNRECOGNIZED; + } +} + +export function connectPlatformToJSON(object: ConnectPlatform): string { + switch (object) { + case ConnectPlatform.CONNECT_PLATFORM_UNSPECIFIED: + return "CONNECT_PLATFORM_UNSPECIFIED"; + case ConnectPlatform.CONNECT_PLATFORM_MACOS: + return "CONNECT_PLATFORM_MACOS"; + case ConnectPlatform.CONNECT_PLATFORM_IOS: + return "CONNECT_PLATFORM_IOS"; + case ConnectPlatform.CONNECT_PLATFORM_IPADOS: + return "CONNECT_PLATFORM_IPADOS"; + case ConnectPlatform.CONNECT_PLATFORM_ANDROID: + return "CONNECT_PLATFORM_ANDROID"; + case ConnectPlatform.CONNECT_PLATFORM_REACT_NATIVE: + return "CONNECT_PLATFORM_REACT_NATIVE"; + case ConnectPlatform.CONNECT_PLATFORM_FLUTTER: + return "CONNECT_PLATFORM_FLUTTER"; + case ConnectPlatform.CONNECT_PLATFORM_WEB: + return "CONNECT_PLATFORM_WEB"; + case ConnectPlatform.CONNECT_PLATFORM_WINDOWS: + return "CONNECT_PLATFORM_WINDOWS"; + case ConnectPlatform.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * Role availability is richer than a boolean so the wire contract can reserve + * planned platforms without accidentally advertising them as usable. + */ +export enum ConnectRoleAvailability { + CONNECT_ROLE_AVAILABILITY_UNSPECIFIED = 0, + CONNECT_ROLE_AVAILABILITY_DISABLED = 1, + CONNECT_ROLE_AVAILABILITY_PLANNED = 2, + CONNECT_ROLE_AVAILABILITY_ENABLED = 3, + UNRECOGNIZED = -1, +} + +export function connectRoleAvailabilityFromJSON(object: any): ConnectRoleAvailability { + switch (object) { + case 0: + case "CONNECT_ROLE_AVAILABILITY_UNSPECIFIED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED; + case 1: + case "CONNECT_ROLE_AVAILABILITY_DISABLED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_DISABLED; + case 2: + case "CONNECT_ROLE_AVAILABILITY_PLANNED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_PLANNED; + case 3: + case "CONNECT_ROLE_AVAILABILITY_ENABLED": + return ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED; + case -1: + case "UNRECOGNIZED": + default: + return ConnectRoleAvailability.UNRECOGNIZED; + } +} + +export function connectRoleAvailabilityToJSON(object: ConnectRoleAvailability): string { + switch (object) { + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_UNSPECIFIED: + return "CONNECT_ROLE_AVAILABILITY_UNSPECIFIED"; + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_DISABLED: + return "CONNECT_ROLE_AVAILABILITY_DISABLED"; + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_PLANNED: + return "CONNECT_ROLE_AVAILABILITY_PLANNED"; + case ConnectRoleAvailability.CONNECT_ROLE_AVAILABILITY_ENABLED: + return "CONNECT_ROLE_AVAILABILITY_ENABLED"; + case ConnectRoleAvailability.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum ConnectHandshakeStatus { + CONNECT_HANDSHAKE_STATUS_UNSPECIFIED = 0, + CONNECT_HANDSHAKE_STATUS_ACCEPTED = 1, + CONNECT_HANDSHAKE_STATUS_REJECTED = 2, + UNRECOGNIZED = -1, +} + +export function connectHandshakeStatusFromJSON(object: any): ConnectHandshakeStatus { + switch (object) { + case 0: + case "CONNECT_HANDSHAKE_STATUS_UNSPECIFIED": + return ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED; + case 1: + case "CONNECT_HANDSHAKE_STATUS_ACCEPTED": + return ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_ACCEPTED; + case 2: + case "CONNECT_HANDSHAKE_STATUS_REJECTED": + return ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_REJECTED; + case -1: + case "UNRECOGNIZED": + default: + return ConnectHandshakeStatus.UNRECOGNIZED; + } +} + +export function connectHandshakeStatusToJSON(object: ConnectHandshakeStatus): string { + switch (object) { + case ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_UNSPECIFIED: + return "CONNECT_HANDSHAKE_STATUS_UNSPECIFIED"; + case ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_ACCEPTED: + return "CONNECT_HANDSHAKE_STATUS_ACCEPTED"; + case ConnectHandshakeStatus.CONNECT_HANDSHAKE_STATUS_REJECTED: + return "CONNECT_HANDSHAKE_STATUS_REJECTED"; + case ConnectHandshakeStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum ConnectSessionState { + CONNECT_SESSION_STATE_UNSPECIFIED = 0, + CONNECT_SESSION_STATE_CONNECTING = 1, + CONNECT_SESSION_STATE_CONNECTED = 2, + CONNECT_SESSION_STATE_DISCONNECTED = 3, + CONNECT_SESSION_STATE_FAILED = 4, + UNRECOGNIZED = -1, +} + +export function connectSessionStateFromJSON(object: any): ConnectSessionState { + switch (object) { + case 0: + case "CONNECT_SESSION_STATE_UNSPECIFIED": + return ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED; + case 1: + case "CONNECT_SESSION_STATE_CONNECTING": + return ConnectSessionState.CONNECT_SESSION_STATE_CONNECTING; + case 2: + case "CONNECT_SESSION_STATE_CONNECTED": + return ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED; + case 3: + case "CONNECT_SESSION_STATE_DISCONNECTED": + return ConnectSessionState.CONNECT_SESSION_STATE_DISCONNECTED; + case 4: + case "CONNECT_SESSION_STATE_FAILED": + return ConnectSessionState.CONNECT_SESSION_STATE_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ConnectSessionState.UNRECOGNIZED; + } +} + +export function connectSessionStateToJSON(object: ConnectSessionState): string { + switch (object) { + case ConnectSessionState.CONNECT_SESSION_STATE_UNSPECIFIED: + return "CONNECT_SESSION_STATE_UNSPECIFIED"; + case ConnectSessionState.CONNECT_SESSION_STATE_CONNECTING: + return "CONNECT_SESSION_STATE_CONNECTING"; + case ConnectSessionState.CONNECT_SESSION_STATE_CONNECTED: + return "CONNECT_SESSION_STATE_CONNECTED"; + case ConnectSessionState.CONNECT_SESSION_STATE_DISCONNECTED: + return "CONNECT_SESSION_STATE_DISCONNECTED"; + case ConnectSessionState.CONNECT_SESSION_STATE_FAILED: + return "CONNECT_SESSION_STATE_FAILED"; + case ConnectSessionState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface ConnectPlatformPolicyRequest { + platform: ConnectPlatform; +} + +/** + * Commons is the authority for this policy. SDKs may query it to shape UI, + * but every host/client entrypoint also enforces it inside C++. + */ +export interface ConnectPlatformPolicy { + platform: ConnectPlatform; + hostRole: ConnectRoleAvailability; + clientRole: ConnectRoleAvailability; +} + +/** + * Non-secret metadata published through LAN service discovery and echoed by + * the handshake. `instance_id` is generated anew whenever the host starts; + * it is not a persistent device identifier or a credential. + */ +export interface ConnectDiscoveryMetadata { + instanceId: string; + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; +} + +/** + * The single language model currently shared by a host. A host must select a + * loaded model before it starts publishing; this lets clients enter chat + * immediately without downloading or selecting a local model. + */ +export interface ConnectModelDescriptor { + modelId: string; + displayName: string; + framework: string; + contextWindow: number; + supportsStreaming: boolean; +} + +export interface ConnectHostStartRequest { + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; + model?: ConnectModelDescriptor | undefined; +} + +export interface ConnectHostStopRequest { +} + +export interface ConnectHostState { + isHosting: boolean; + discoveryMetadata?: ConnectDiscoveryMetadata | undefined; + activeClientCount: number; + errorMessage: string; + model?: ConnectModelDescriptor | undefined; +} + +export interface ConnectClientStartRequest { + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; +} + +/** Sent by a client immediately after the platform transport is connected. */ +export interface ConnectClientHello { + instanceId: string; + displayName: string; + platform: ConnectPlatform; + protocolVersion: number; +} + +/** Sent by the host after commons has accepted or rejected a client hello. */ +export interface ConnectHandshakeResponse { + status: ConnectHandshakeStatus; + sessionId: string; + host?: ConnectDiscoveryMetadata | undefined; + rejectionReason: string; + model?: ConnectModelDescriptor | undefined; +} + +/** + * The client validates the host response through commons and receives the + * public session state it can expose to its platform UI. + */ +export interface ConnectClientSessionState { + state: ConnectSessionState; + sessionId: string; + host?: ConnectDiscoveryMetadata | undefined; + errorMessage: string; + model?: ConnectModelDescriptor | undefined; +} + +export interface ConnectSessionCloseRequest { + sessionId: string; +} + +/** + * A client sends the existing typed LLM request to the selected host model. + * `session_id` binds the request to the prior handshake; `generation.model_id` + * must match the model the host published for that session. + */ +export interface ConnectInvocationRequest { + sessionId: string; + requestId: string; + generation?: LLMGenerateRequest | undefined; +} + +/** + * Commons validates that an invocation belongs to an active session and uses + * the host's published model before any platform runtime receives the prompt. + */ +export interface ConnectInvocationValidation { + accepted: boolean; + rejectionReason: string; +} + +/** + * Hosts forward the SDK's canonical stream events without translating them to + * a platform-specific token shape. This is the portable streaming surface for + * future Kotlin, React Native, Flutter, and Web clients. + */ +export interface ConnectInvocationEvent { + requestId: string; + event?: LLMStreamEvent | undefined; +} + +/** + * The connection stays open between generations, so the client needs a + * control-plane exchange that can detect a host stopped while chat is idle. + * These frames deliberately remain separate from LLM invocation payloads: + * a health check must never reach a model or appear as an assistant message. + */ +export interface ConnectHeartbeatRequest { + sessionId: string; + sequence: number; +} + +export interface ConnectHeartbeatResponse { + sessionId: string; + sequence: number; +} + +/** + * Every frame after the initial ClientHello handshake is carried in one of + * these explicit envelopes. This leaves typed inference traffic untouched + * while allowing clients to verify an otherwise-idle host connection. + */ +export interface ConnectClientFrame { + invocation?: ConnectInvocationRequest | undefined; + heartbeat?: ConnectHeartbeatRequest | undefined; +} + +export interface ConnectHostFrame { + invocationEvent?: ConnectInvocationEvent | undefined; + heartbeat?: ConnectHeartbeatResponse | undefined; +} + +function createBaseConnectPlatformPolicyRequest(): ConnectPlatformPolicyRequest { + return { platform: 0 }; +} + +export const ConnectPlatformPolicyRequest: MessageFns = { + encode(message: ConnectPlatformPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.platform !== 0) { + writer.uint32(8).int32(message.platform); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectPlatformPolicyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectPlatformPolicyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.platform = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectPlatformPolicyRequest { + return { platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0 }; + }, + + toJSON(message: ConnectPlatformPolicyRequest): unknown { + const obj: any = {}; + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + return obj; + }, + + create, I>>(base?: I): ConnectPlatformPolicyRequest { + return ConnectPlatformPolicyRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectPlatformPolicyRequest { + const message = createBaseConnectPlatformPolicyRequest(); + message.platform = object.platform ?? 0; + return message; + }, +}; + +function createBaseConnectPlatformPolicy(): ConnectPlatformPolicy { + return { platform: 0, hostRole: 0, clientRole: 0 }; +} + +export const ConnectPlatformPolicy: MessageFns = { + encode(message: ConnectPlatformPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.platform !== 0) { + writer.uint32(8).int32(message.platform); + } + if (message.hostRole !== 0) { + writer.uint32(16).int32(message.hostRole); + } + if (message.clientRole !== 0) { + writer.uint32(24).int32(message.clientRole); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectPlatformPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectPlatformPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.platform = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.hostRole = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.clientRole = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectPlatformPolicy { + return { + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + hostRole: isSet(object.hostRole) + ? connectRoleAvailabilityFromJSON(object.hostRole) + : isSet(object.host_role) + ? connectRoleAvailabilityFromJSON(object.host_role) + : 0, + clientRole: isSet(object.clientRole) + ? connectRoleAvailabilityFromJSON(object.clientRole) + : isSet(object.client_role) + ? connectRoleAvailabilityFromJSON(object.client_role) + : 0, + }; + }, + + toJSON(message: ConnectPlatformPolicy): unknown { + const obj: any = {}; + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.hostRole !== 0) { + obj.hostRole = connectRoleAvailabilityToJSON(message.hostRole); + } + if (message.clientRole !== 0) { + obj.clientRole = connectRoleAvailabilityToJSON(message.clientRole); + } + return obj; + }, + + create, I>>(base?: I): ConnectPlatformPolicy { + return ConnectPlatformPolicy.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectPlatformPolicy { + const message = createBaseConnectPlatformPolicy(); + message.platform = object.platform ?? 0; + message.hostRole = object.hostRole ?? 0; + message.clientRole = object.clientRole ?? 0; + return message; + }, +}; + +function createBaseConnectDiscoveryMetadata(): ConnectDiscoveryMetadata { + return { instanceId: "", displayName: "", platform: 0, protocolVersion: 0 }; +} + +export const ConnectDiscoveryMetadata: MessageFns = { + encode(message: ConnectDiscoveryMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(24).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(32).uint32(message.protocolVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectDiscoveryMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectDiscoveryMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.instanceId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.displayName = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.platform = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.protocolVersion = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectDiscoveryMetadata { + return { + instanceId: isSet(object.instanceId) + ? globalThis.String(object.instanceId) + : isSet(object.instance_id) + ? globalThis.String(object.instance_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + }; + }, + + toJSON(message: ConnectDiscoveryMetadata): unknown { + const obj: any = {}; + if (message.instanceId !== "") { + obj.instanceId = message.instanceId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + return obj; + }, + + create, I>>(base?: I): ConnectDiscoveryMetadata { + return ConnectDiscoveryMetadata.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectDiscoveryMetadata { + const message = createBaseConnectDiscoveryMetadata(); + message.instanceId = object.instanceId ?? ""; + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + return message; + }, +}; + +function createBaseConnectModelDescriptor(): ConnectModelDescriptor { + return { modelId: "", displayName: "", framework: "", contextWindow: 0, supportsStreaming: false }; +} + +export const ConnectModelDescriptor: MessageFns = { + encode(message: ConnectModelDescriptor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.modelId !== "") { + writer.uint32(10).string(message.modelId); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.framework !== "") { + writer.uint32(26).string(message.framework); + } + if (message.contextWindow !== 0) { + writer.uint32(32).uint32(message.contextWindow); + } + if (message.supportsStreaming !== false) { + writer.uint32(40).bool(message.supportsStreaming); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectModelDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectModelDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.modelId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.displayName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.framework = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.contextWindow = reader.uint32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.supportsStreaming = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectModelDescriptor { + return { + modelId: isSet(object.modelId) + ? globalThis.String(object.modelId) + : isSet(object.model_id) + ? globalThis.String(object.model_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + framework: isSet(object.framework) ? globalThis.String(object.framework) : "", + contextWindow: isSet(object.contextWindow) + ? globalThis.Number(object.contextWindow) + : isSet(object.context_window) + ? globalThis.Number(object.context_window) + : 0, + supportsStreaming: isSet(object.supportsStreaming) + ? globalThis.Boolean(object.supportsStreaming) + : isSet(object.supports_streaming) + ? globalThis.Boolean(object.supports_streaming) + : false, + }; + }, + + toJSON(message: ConnectModelDescriptor): unknown { + const obj: any = {}; + if (message.modelId !== "") { + obj.modelId = message.modelId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.framework !== "") { + obj.framework = message.framework; + } + if (message.contextWindow !== 0) { + obj.contextWindow = Math.round(message.contextWindow); + } + if (message.supportsStreaming !== false) { + obj.supportsStreaming = message.supportsStreaming; + } + return obj; + }, + + create, I>>(base?: I): ConnectModelDescriptor { + return ConnectModelDescriptor.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectModelDescriptor { + const message = createBaseConnectModelDescriptor(); + message.modelId = object.modelId ?? ""; + message.displayName = object.displayName ?? ""; + message.framework = object.framework ?? ""; + message.contextWindow = object.contextWindow ?? 0; + message.supportsStreaming = object.supportsStreaming ?? false; + return message; + }, +}; + +function createBaseConnectHostStartRequest(): ConnectHostStartRequest { + return { displayName: "", platform: 0, protocolVersion: 0, model: undefined }; +} + +export const ConnectHostStartRequest: MessageFns = { + encode(message: ConnectHostStartRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.displayName !== "") { + writer.uint32(10).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(16).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(24).uint32(message.protocolVersion); + } + if (message.model !== undefined) { + ConnectModelDescriptor.encode(message.model, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHostStartRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostStartRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.displayName = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.platform = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.protocolVersion = reader.uint32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.model = ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectHostStartRequest { + return { + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + model: isSet(object.model) ? ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + + toJSON(message: ConnectHostStartRequest): unknown { + const obj: any = {}; + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + if (message.model !== undefined) { + obj.model = ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + + create, I>>(base?: I): ConnectHostStartRequest { + return ConnectHostStartRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectHostStartRequest { + const message = createBaseConnectHostStartRequest(); + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + message.model = (object.model !== undefined && object.model !== null) + ? ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; + +function createBaseConnectHostStopRequest(): ConnectHostStopRequest { + return {}; +} + +export const ConnectHostStopRequest: MessageFns = { + encode(_: ConnectHostStopRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHostStopRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostStopRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ConnectHostStopRequest { + return {}; + }, + + toJSON(_: ConnectHostStopRequest): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): ConnectHostStopRequest { + return ConnectHostStopRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): ConnectHostStopRequest { + const message = createBaseConnectHostStopRequest(); + return message; + }, +}; + +function createBaseConnectHostState(): ConnectHostState { + return { isHosting: false, discoveryMetadata: undefined, activeClientCount: 0, errorMessage: "", model: undefined }; +} + +export const ConnectHostState: MessageFns = { + encode(message: ConnectHostState, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.isHosting !== false) { + writer.uint32(8).bool(message.isHosting); + } + if (message.discoveryMetadata !== undefined) { + ConnectDiscoveryMetadata.encode(message.discoveryMetadata, writer.uint32(18).fork()).join(); + } + if (message.activeClientCount !== 0) { + writer.uint32(24).uint32(message.activeClientCount); + } + if (message.errorMessage !== "") { + writer.uint32(34).string(message.errorMessage); + } + if (message.model !== undefined) { + ConnectModelDescriptor.encode(message.model, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHostState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.isHosting = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.discoveryMetadata = ConnectDiscoveryMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.activeClientCount = reader.uint32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.errorMessage = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.model = ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectHostState { + return { + isHosting: isSet(object.isHosting) + ? globalThis.Boolean(object.isHosting) + : isSet(object.is_hosting) + ? globalThis.Boolean(object.is_hosting) + : false, + discoveryMetadata: isSet(object.discoveryMetadata) + ? ConnectDiscoveryMetadata.fromJSON(object.discoveryMetadata) + : isSet(object.discovery_metadata) + ? ConnectDiscoveryMetadata.fromJSON(object.discovery_metadata) + : undefined, + activeClientCount: isSet(object.activeClientCount) + ? globalThis.Number(object.activeClientCount) + : isSet(object.active_client_count) + ? globalThis.Number(object.active_client_count) + : 0, + errorMessage: isSet(object.errorMessage) + ? globalThis.String(object.errorMessage) + : isSet(object.error_message) + ? globalThis.String(object.error_message) + : "", + model: isSet(object.model) ? ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + + toJSON(message: ConnectHostState): unknown { + const obj: any = {}; + if (message.isHosting !== false) { + obj.isHosting = message.isHosting; + } + if (message.discoveryMetadata !== undefined) { + obj.discoveryMetadata = ConnectDiscoveryMetadata.toJSON(message.discoveryMetadata); + } + if (message.activeClientCount !== 0) { + obj.activeClientCount = Math.round(message.activeClientCount); + } + if (message.errorMessage !== "") { + obj.errorMessage = message.errorMessage; + } + if (message.model !== undefined) { + obj.model = ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + + create, I>>(base?: I): ConnectHostState { + return ConnectHostState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectHostState { + const message = createBaseConnectHostState(); + message.isHosting = object.isHosting ?? false; + message.discoveryMetadata = (object.discoveryMetadata !== undefined && object.discoveryMetadata !== null) + ? ConnectDiscoveryMetadata.fromPartial(object.discoveryMetadata) + : undefined; + message.activeClientCount = object.activeClientCount ?? 0; + message.errorMessage = object.errorMessage ?? ""; + message.model = (object.model !== undefined && object.model !== null) + ? ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; + +function createBaseConnectClientStartRequest(): ConnectClientStartRequest { + return { displayName: "", platform: 0, protocolVersion: 0 }; +} + +export const ConnectClientStartRequest: MessageFns = { + encode(message: ConnectClientStartRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.displayName !== "") { + writer.uint32(10).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(16).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(24).uint32(message.protocolVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectClientStartRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientStartRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.displayName = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.platform = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.protocolVersion = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectClientStartRequest { + return { + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + }; + }, + + toJSON(message: ConnectClientStartRequest): unknown { + const obj: any = {}; + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + return obj; + }, + + create, I>>(base?: I): ConnectClientStartRequest { + return ConnectClientStartRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectClientStartRequest { + const message = createBaseConnectClientStartRequest(); + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + return message; + }, +}; + +function createBaseConnectClientHello(): ConnectClientHello { + return { instanceId: "", displayName: "", platform: 0, protocolVersion: 0 }; +} + +export const ConnectClientHello: MessageFns = { + encode(message: ConnectClientHello, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.platform !== 0) { + writer.uint32(24).int32(message.platform); + } + if (message.protocolVersion !== 0) { + writer.uint32(32).uint32(message.protocolVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectClientHello { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientHello(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.instanceId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.displayName = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.platform = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.protocolVersion = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectClientHello { + return { + instanceId: isSet(object.instanceId) + ? globalThis.String(object.instanceId) + : isSet(object.instance_id) + ? globalThis.String(object.instance_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + platform: isSet(object.platform) ? connectPlatformFromJSON(object.platform) : 0, + protocolVersion: isSet(object.protocolVersion) + ? globalThis.Number(object.protocolVersion) + : isSet(object.protocol_version) + ? globalThis.Number(object.protocol_version) + : 0, + }; + }, + + toJSON(message: ConnectClientHello): unknown { + const obj: any = {}; + if (message.instanceId !== "") { + obj.instanceId = message.instanceId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.platform !== 0) { + obj.platform = connectPlatformToJSON(message.platform); + } + if (message.protocolVersion !== 0) { + obj.protocolVersion = Math.round(message.protocolVersion); + } + return obj; + }, + + create, I>>(base?: I): ConnectClientHello { + return ConnectClientHello.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectClientHello { + const message = createBaseConnectClientHello(); + message.instanceId = object.instanceId ?? ""; + message.displayName = object.displayName ?? ""; + message.platform = object.platform ?? 0; + message.protocolVersion = object.protocolVersion ?? 0; + return message; + }, +}; + +function createBaseConnectHandshakeResponse(): ConnectHandshakeResponse { + return { status: 0, sessionId: "", host: undefined, rejectionReason: "", model: undefined }; +} + +export const ConnectHandshakeResponse: MessageFns = { + encode(message: ConnectHandshakeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.sessionId !== "") { + writer.uint32(18).string(message.sessionId); + } + if (message.host !== undefined) { + ConnectDiscoveryMetadata.encode(message.host, writer.uint32(26).fork()).join(); + } + if (message.rejectionReason !== "") { + writer.uint32(34).string(message.rejectionReason); + } + if (message.model !== undefined) { + ConnectModelDescriptor.encode(message.model, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHandshakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHandshakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.status = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.sessionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.host = ConnectDiscoveryMetadata.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.rejectionReason = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.model = ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectHandshakeResponse { + return { + status: isSet(object.status) ? connectHandshakeStatusFromJSON(object.status) : 0, + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + host: isSet(object.host) ? ConnectDiscoveryMetadata.fromJSON(object.host) : undefined, + rejectionReason: isSet(object.rejectionReason) + ? globalThis.String(object.rejectionReason) + : isSet(object.rejection_reason) + ? globalThis.String(object.rejection_reason) + : "", + model: isSet(object.model) ? ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + + toJSON(message: ConnectHandshakeResponse): unknown { + const obj: any = {}; + if (message.status !== 0) { + obj.status = connectHandshakeStatusToJSON(message.status); + } + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.host !== undefined) { + obj.host = ConnectDiscoveryMetadata.toJSON(message.host); + } + if (message.rejectionReason !== "") { + obj.rejectionReason = message.rejectionReason; + } + if (message.model !== undefined) { + obj.model = ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + + create, I>>(base?: I): ConnectHandshakeResponse { + return ConnectHandshakeResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectHandshakeResponse { + const message = createBaseConnectHandshakeResponse(); + message.status = object.status ?? 0; + message.sessionId = object.sessionId ?? ""; + message.host = (object.host !== undefined && object.host !== null) + ? ConnectDiscoveryMetadata.fromPartial(object.host) + : undefined; + message.rejectionReason = object.rejectionReason ?? ""; + message.model = (object.model !== undefined && object.model !== null) + ? ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; + +function createBaseConnectClientSessionState(): ConnectClientSessionState { + return { state: 0, sessionId: "", host: undefined, errorMessage: "", model: undefined }; +} + +export const ConnectClientSessionState: MessageFns = { + encode(message: ConnectClientSessionState, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.sessionId !== "") { + writer.uint32(18).string(message.sessionId); + } + if (message.host !== undefined) { + ConnectDiscoveryMetadata.encode(message.host, writer.uint32(26).fork()).join(); + } + if (message.errorMessage !== "") { + writer.uint32(34).string(message.errorMessage); + } + if (message.model !== undefined) { + ConnectModelDescriptor.encode(message.model, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectClientSessionState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientSessionState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.state = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.sessionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.host = ConnectDiscoveryMetadata.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.errorMessage = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.model = ConnectModelDescriptor.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectClientSessionState { + return { + state: isSet(object.state) ? connectSessionStateFromJSON(object.state) : 0, + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + host: isSet(object.host) ? ConnectDiscoveryMetadata.fromJSON(object.host) : undefined, + errorMessage: isSet(object.errorMessage) + ? globalThis.String(object.errorMessage) + : isSet(object.error_message) + ? globalThis.String(object.error_message) + : "", + model: isSet(object.model) ? ConnectModelDescriptor.fromJSON(object.model) : undefined, + }; + }, + + toJSON(message: ConnectClientSessionState): unknown { + const obj: any = {}; + if (message.state !== 0) { + obj.state = connectSessionStateToJSON(message.state); + } + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.host !== undefined) { + obj.host = ConnectDiscoveryMetadata.toJSON(message.host); + } + if (message.errorMessage !== "") { + obj.errorMessage = message.errorMessage; + } + if (message.model !== undefined) { + obj.model = ConnectModelDescriptor.toJSON(message.model); + } + return obj; + }, + + create, I>>(base?: I): ConnectClientSessionState { + return ConnectClientSessionState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectClientSessionState { + const message = createBaseConnectClientSessionState(); + message.state = object.state ?? 0; + message.sessionId = object.sessionId ?? ""; + message.host = (object.host !== undefined && object.host !== null) + ? ConnectDiscoveryMetadata.fromPartial(object.host) + : undefined; + message.errorMessage = object.errorMessage ?? ""; + message.model = (object.model !== undefined && object.model !== null) + ? ConnectModelDescriptor.fromPartial(object.model) + : undefined; + return message; + }, +}; + +function createBaseConnectSessionCloseRequest(): ConnectSessionCloseRequest { + return { sessionId: "" }; +} + +export const ConnectSessionCloseRequest: MessageFns = { + encode(message: ConnectSessionCloseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectSessionCloseRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectSessionCloseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sessionId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectSessionCloseRequest { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + }; + }, + + toJSON(message: ConnectSessionCloseRequest): unknown { + const obj: any = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + return obj; + }, + + create, I>>(base?: I): ConnectSessionCloseRequest { + return ConnectSessionCloseRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectSessionCloseRequest { + const message = createBaseConnectSessionCloseRequest(); + message.sessionId = object.sessionId ?? ""; + return message; + }, +}; + +function createBaseConnectInvocationRequest(): ConnectInvocationRequest { + return { sessionId: "", requestId: "", generation: undefined }; +} + +export const ConnectInvocationRequest: MessageFns = { + encode(message: ConnectInvocationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + if (message.requestId !== "") { + writer.uint32(18).string(message.requestId); + } + if (message.generation !== undefined) { + LLMGenerateRequest.encode(message.generation, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectInvocationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectInvocationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sessionId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.requestId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.generation = LLMGenerateRequest.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectInvocationRequest { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + requestId: isSet(object.requestId) + ? globalThis.String(object.requestId) + : isSet(object.request_id) + ? globalThis.String(object.request_id) + : "", + generation: isSet(object.generation) ? LLMGenerateRequest.fromJSON(object.generation) : undefined, + }; + }, + + toJSON(message: ConnectInvocationRequest): unknown { + const obj: any = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.requestId !== "") { + obj.requestId = message.requestId; + } + if (message.generation !== undefined) { + obj.generation = LLMGenerateRequest.toJSON(message.generation); + } + return obj; + }, + + create, I>>(base?: I): ConnectInvocationRequest { + return ConnectInvocationRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectInvocationRequest { + const message = createBaseConnectInvocationRequest(); + message.sessionId = object.sessionId ?? ""; + message.requestId = object.requestId ?? ""; + message.generation = (object.generation !== undefined && object.generation !== null) + ? LLMGenerateRequest.fromPartial(object.generation) + : undefined; + return message; + }, +}; + +function createBaseConnectInvocationValidation(): ConnectInvocationValidation { + return { accepted: false, rejectionReason: "" }; +} + +export const ConnectInvocationValidation: MessageFns = { + encode(message: ConnectInvocationValidation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.accepted !== false) { + writer.uint32(8).bool(message.accepted); + } + if (message.rejectionReason !== "") { + writer.uint32(18).string(message.rejectionReason); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectInvocationValidation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectInvocationValidation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.accepted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.rejectionReason = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectInvocationValidation { + return { + accepted: isSet(object.accepted) ? globalThis.Boolean(object.accepted) : false, + rejectionReason: isSet(object.rejectionReason) + ? globalThis.String(object.rejectionReason) + : isSet(object.rejection_reason) + ? globalThis.String(object.rejection_reason) + : "", + }; + }, + + toJSON(message: ConnectInvocationValidation): unknown { + const obj: any = {}; + if (message.accepted !== false) { + obj.accepted = message.accepted; + } + if (message.rejectionReason !== "") { + obj.rejectionReason = message.rejectionReason; + } + return obj; + }, + + create, I>>(base?: I): ConnectInvocationValidation { + return ConnectInvocationValidation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectInvocationValidation { + const message = createBaseConnectInvocationValidation(); + message.accepted = object.accepted ?? false; + message.rejectionReason = object.rejectionReason ?? ""; + return message; + }, +}; + +function createBaseConnectInvocationEvent(): ConnectInvocationEvent { + return { requestId: "", event: undefined }; +} + +export const ConnectInvocationEvent: MessageFns = { + encode(message: ConnectInvocationEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.event !== undefined) { + LLMStreamEvent.encode(message.event, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectInvocationEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectInvocationEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.requestId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.event = LLMStreamEvent.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectInvocationEvent { + return { + requestId: isSet(object.requestId) + ? globalThis.String(object.requestId) + : isSet(object.request_id) + ? globalThis.String(object.request_id) + : "", + event: isSet(object.event) ? LLMStreamEvent.fromJSON(object.event) : undefined, + }; + }, + + toJSON(message: ConnectInvocationEvent): unknown { + const obj: any = {}; + if (message.requestId !== "") { + obj.requestId = message.requestId; + } + if (message.event !== undefined) { + obj.event = LLMStreamEvent.toJSON(message.event); + } + return obj; + }, + + create, I>>(base?: I): ConnectInvocationEvent { + return ConnectInvocationEvent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectInvocationEvent { + const message = createBaseConnectInvocationEvent(); + message.requestId = object.requestId ?? ""; + message.event = (object.event !== undefined && object.event !== null) + ? LLMStreamEvent.fromPartial(object.event) + : undefined; + return message; + }, +}; + +function createBaseConnectHeartbeatRequest(): ConnectHeartbeatRequest { + return { sessionId: "", sequence: 0 }; +} + +export const ConnectHeartbeatRequest: MessageFns = { + encode(message: ConnectHeartbeatRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + if (message.sequence !== 0) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHeartbeatRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHeartbeatRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sessionId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.sequence = longToNumber(reader.uint64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectHeartbeatRequest { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0, + }; + }, + + toJSON(message: ConnectHeartbeatRequest): unknown { + const obj: any = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.sequence !== 0) { + obj.sequence = Math.round(message.sequence); + } + return obj; + }, + + create, I>>(base?: I): ConnectHeartbeatRequest { + return ConnectHeartbeatRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectHeartbeatRequest { + const message = createBaseConnectHeartbeatRequest(); + message.sessionId = object.sessionId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +function createBaseConnectHeartbeatResponse(): ConnectHeartbeatResponse { + return { sessionId: "", sequence: 0 }; +} + +export const ConnectHeartbeatResponse: MessageFns = { + encode(message: ConnectHeartbeatResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sessionId !== "") { + writer.uint32(10).string(message.sessionId); + } + if (message.sequence !== 0) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHeartbeatResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHeartbeatResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sessionId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.sequence = longToNumber(reader.uint64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectHeartbeatResponse { + return { + sessionId: isSet(object.sessionId) + ? globalThis.String(object.sessionId) + : isSet(object.session_id) + ? globalThis.String(object.session_id) + : "", + sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0, + }; + }, + + toJSON(message: ConnectHeartbeatResponse): unknown { + const obj: any = {}; + if (message.sessionId !== "") { + obj.sessionId = message.sessionId; + } + if (message.sequence !== 0) { + obj.sequence = Math.round(message.sequence); + } + return obj; + }, + + create, I>>(base?: I): ConnectHeartbeatResponse { + return ConnectHeartbeatResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectHeartbeatResponse { + const message = createBaseConnectHeartbeatResponse(); + message.sessionId = object.sessionId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +function createBaseConnectClientFrame(): ConnectClientFrame { + return { invocation: undefined, heartbeat: undefined }; +} + +export const ConnectClientFrame: MessageFns = { + encode(message: ConnectClientFrame, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.invocation !== undefined) { + ConnectInvocationRequest.encode(message.invocation, writer.uint32(10).fork()).join(); + } + if (message.heartbeat !== undefined) { + ConnectHeartbeatRequest.encode(message.heartbeat, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectClientFrame { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectClientFrame(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.invocation = ConnectInvocationRequest.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.heartbeat = ConnectHeartbeatRequest.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectClientFrame { + return { + invocation: isSet(object.invocation) ? ConnectInvocationRequest.fromJSON(object.invocation) : undefined, + heartbeat: isSet(object.heartbeat) ? ConnectHeartbeatRequest.fromJSON(object.heartbeat) : undefined, + }; + }, + + toJSON(message: ConnectClientFrame): unknown { + const obj: any = {}; + if (message.invocation !== undefined) { + obj.invocation = ConnectInvocationRequest.toJSON(message.invocation); + } + if (message.heartbeat !== undefined) { + obj.heartbeat = ConnectHeartbeatRequest.toJSON(message.heartbeat); + } + return obj; + }, + + create, I>>(base?: I): ConnectClientFrame { + return ConnectClientFrame.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectClientFrame { + const message = createBaseConnectClientFrame(); + message.invocation = (object.invocation !== undefined && object.invocation !== null) + ? ConnectInvocationRequest.fromPartial(object.invocation) + : undefined; + message.heartbeat = (object.heartbeat !== undefined && object.heartbeat !== null) + ? ConnectHeartbeatRequest.fromPartial(object.heartbeat) + : undefined; + return message; + }, +}; + +function createBaseConnectHostFrame(): ConnectHostFrame { + return { invocationEvent: undefined, heartbeat: undefined }; +} + +export const ConnectHostFrame: MessageFns = { + encode(message: ConnectHostFrame, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.invocationEvent !== undefined) { + ConnectInvocationEvent.encode(message.invocationEvent, writer.uint32(10).fork()).join(); + } + if (message.heartbeat !== undefined) { + ConnectHeartbeatResponse.encode(message.heartbeat, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConnectHostFrame { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectHostFrame(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.invocationEvent = ConnectInvocationEvent.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.heartbeat = ConnectHeartbeatResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConnectHostFrame { + return { + invocationEvent: isSet(object.invocationEvent) + ? ConnectInvocationEvent.fromJSON(object.invocationEvent) + : isSet(object.invocation_event) + ? ConnectInvocationEvent.fromJSON(object.invocation_event) + : undefined, + heartbeat: isSet(object.heartbeat) ? ConnectHeartbeatResponse.fromJSON(object.heartbeat) : undefined, + }; + }, + + toJSON(message: ConnectHostFrame): unknown { + const obj: any = {}; + if (message.invocationEvent !== undefined) { + obj.invocationEvent = ConnectInvocationEvent.toJSON(message.invocationEvent); + } + if (message.heartbeat !== undefined) { + obj.heartbeat = ConnectHeartbeatResponse.toJSON(message.heartbeat); + } + return obj; + }, + + create, I>>(base?: I): ConnectHostFrame { + return ConnectHostFrame.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ConnectHostFrame { + const message = createBaseConnectHostFrame(); + message.invocationEvent = (object.invocationEvent !== undefined && object.invocationEvent !== null) + ? ConnectInvocationEvent.fromPartial(object.invocationEvent) + : undefined; + message.heartbeat = (object.heartbeat !== undefined && object.heartbeat !== null) + ? ConnectHeartbeatResponse.fromPartial(object.heartbeat) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(int64: { toString(): string }): number { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/yarn.lock b/yarn.lock index fc5fd36e79..24b989177b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2738,7 +2738,11 @@ __metadata: long: ^5.3.2 nitrogen: ^0.34.1 protobufjs: ^7.5.8 + react: 19.2.3 + react-native: 0.85.3 react-native-nitro-modules: ^0.33.9 + react-native-tcp-socket: ^6.4.1 + react-native-zeroconf: ^0.14.0 ts-jest: ^29.1.2 typescript: ^5.9.3 peerDependencies: @@ -2748,6 +2752,8 @@ __metadata: react-native-device-info: ">=11.0.0" react-native-fs: ">=2.20.0" react-native-nitro-modules: ^0.33.9 + react-native-tcp-socket: ">=6.4.1" + react-native-zeroconf: ">=0.14.0" peerDependenciesMeta: react-native-blob-util: optional: true @@ -3953,7 +3959,7 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^5.5.0": +"buffer@npm:^5.4.3, buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" dependencies: @@ -5273,6 +5279,20 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^4.0.7": + version: 4.0.7 + resolution: "eventemitter3@npm:4.0.7" + checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 + languageName: node + linkType: hard + +"events@npm:^3.0.0": + version: 3.3.0 + resolution: "events@npm:3.3.0" + checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 + languageName: node + linkType: hard + "execa@npm:^5.0.0": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -8692,6 +8712,18 @@ __metadata: languageName: node linkType: hard +"react-native-tcp-socket@npm:^6.4.1": + version: 6.4.1 + resolution: "react-native-tcp-socket@npm:6.4.1" + dependencies: + buffer: ^5.4.3 + eventemitter3: ^4.0.7 + peerDependencies: + react-native: ">=0.60.0" + checksum: 0c0af3a3044a3edeb9fb5077476eba7ba26675b4af2a1d6b11a63cd56a939a63e4675a63cc1da72cd573cf37ae386a4e98b16b442e4adc11c0addbccaf48b925 + languageName: node + linkType: hard + "react-native-vector-icons@npm:^10.3.0": version: 10.3.0 resolution: "react-native-vector-icons@npm:10.3.0" @@ -8775,6 +8807,17 @@ __metadata: languageName: node linkType: hard +"react-native-zeroconf@npm:^0.14.0": + version: 0.14.0 + resolution: "react-native-zeroconf@npm:0.14.0" + dependencies: + events: ^3.0.0 + peerDependencies: + react-native: ">=0.60" + checksum: f944fe1208849e2b6e68584732bfcb53cc39b16c6958afdd60b348bab834711e721a3eeb3243f107bef297b5e05dd9ad5c5d11f90e6038514cba4b3a40dc9644 + languageName: node + linkType: hard + "react-native@npm:0.85.3": version: 0.85.3 resolution: "react-native@npm:0.85.3" @@ -9123,9 +9166,11 @@ __metadata: react-native-safe-area-context: ^5.6.2 react-native-screens: ~4.18.0 react-native-svg: ^15.15.5 + react-native-tcp-socket: ^6.4.1 react-native-vector-icons: ^10.3.0 react-native-vision-camera: ^4.7.3 react-native-worklets: ^0.9.2 + react-native-zeroconf: ^0.14.0 ts-jest: ^29.1.2 typescript: ^5.9.3 zustand: ^5.0.13