import { PlatformApiError, type PlatformClientConfig } from "./platform-client.js"; type PartialRuntimeSelfClaimResponse = Omit, "target_ref"> & { target_ref?: RuntimeWorkTargetRef; }; export { PlatformApiError, type PlatformClientConfig }; export type RuntimeKind = "claude-code" | "openclaw" | "codex" | "passport" | "custom" | (string & {}); export type RuntimeEndpointCapability = "remote_spawn_v1" | "background_exchange_v1" | "foreground_channel_v1" | "owner_session_delivery_v1" | (string & {}); export type RuntimeAssignmentFailureCategory = "assignment_in_progress" | "target_unavailable_before_acceptance" | "acceptance_rejected" | "processing_failed_or_expired" | "reply_handle_stale"; export type EndpointExecutionSurface = "owner_attached" | "headless" | (string & {}); export type EndpointBackgroundExchangeMode = "resident_endpoint" | "adapter_managed_turn" | (string & {}); export type RuntimeWorkTargetRef = { kind: "projection_endpoint"; projection_endpoint_id: string; background_exchange_mode: "resident_endpoint"; } | { kind: "projection_endpoint"; projection_endpoint_id: string; runtime_session_id: string; background_exchange_mode: "adapter_managed_turn"; }; export interface WorkspaceMetadata { root: string; cwd: string; remote?: string; branch?: string; } export type ShareWithPeerField = "workspace" | "tracking_ref" | "fingerprint" | (string & {}); export interface RegisterRuntimeEndpointParams { as?: string; runtime_kind: RuntimeKind; runtime_session_id?: string; endpoint_nonce: string; display_label: string; session_name?: string; task_hint?: string; workspace?: WorkspaceMetadata; tracking_ref?: string; runtime_capabilities?: RuntimeEndpointCapability[]; execution_surface?: EndpointExecutionSurface; background_exchange_mode?: EndpointBackgroundExchangeMode; share_with_peer?: ShareWithPeerField[]; } export interface SessionNamingBlock { nickname: string; owner_edited_name: string | null; } export interface RegisterRuntimeEndpointResponse { endpoint_id: string; node_id: string; display_label: string; runtime_capabilities?: RuntimeEndpointCapability[]; execution_surface?: EndpointExecutionSurface; background_exchange_mode?: EndpointBackgroundExchangeMode; heartbeat_after_seconds: number; lease_ttl_seconds: number; soft_retention_seconds: number; registered_at: string; session_naming?: SessionNamingBlock; } export interface OwnedRuntimeEndpointView { endpoint_id: string; node_id: string; node_handle?: string; runtime_kind: RuntimeKind; runtime_session_id?: string; display_label: string; workspace?: WorkspaceMetadata; tracking_ref?: string; fingerprint?: { workspace_hash_per_peer?: Record; }; runtime_capabilities?: RuntimeEndpointCapability[]; execution_surface?: EndpointExecutionSurface; background_exchange_mode?: EndpointBackgroundExchangeMode; runtime_work_target_ref?: RuntimeWorkTargetRef; registered_at: string; retired_at?: string; is_self: boolean; } export interface ListOwnedRuntimeEndpointsResponse { total: number; items: OwnedRuntimeEndpointView[]; } export type HeartbeatRuntimeEndpointResponse = Record; export type UnregisterRuntimeEndpointResponse = Record; export interface TransitionRuntimeEndpointStateParams { state: "active" | "reconnecting" | "closed"; reason: string; ts: string; } export type TransitionRuntimeEndpointStateResponse = Record; export interface UpdateRuntimeEndpointDisplayMetadataParams { session_name?: string; task_hint?: string; } export interface RuntimeSelfClaimParams { undispatched_id: string; target_endpoint_id: string; endpoint_nonce: string; recover_existing?: boolean; assignment_mode?: "staged"; } export interface RuntimeClaimCandidatesParams { endpoint_id: string; endpoint_nonce: string; limit?: number; } export interface RuntimeConversationRef { kind: "session_conversation"; id: string; } export interface RuntimeClaimCandidate { undispatched_id: string; source_message_id: string; sender_address: string; content_preview: string; reason: "no_target_endpoint" | "closed_session_continuation" | "correlated_continuation" | string; claim_policy: "owner_select_required" | "bound_session_pull_only" | "node_pull_only" | "continuation_session_unavailable" | "assigned_in_progress" | "unavailable" | string; target_endpoint_id_hint?: string; in_reply_to?: string; origin_scid?: string; origin_ncid?: string; conversation_ref?: RuntimeConversationRef; active_assignment_id?: string; active_target_endpoint_id?: string; arrived_at: number; } export interface RuntimeClaimCandidatesResponse { items: RuntimeClaimCandidate[]; } export interface RuntimeSessionConversationHistoryParams { endpoint_id: string; endpoint_nonce: string; conversation_ref: RuntimeConversationRef; limit?: number; before?: string; after?: string; } export interface RuntimeSessionConversationHistoryMessage { message_id: string; source_node_id: string; target_node_id: string; timestamp: string; content?: string; content_type?: string; } export interface RuntimeSessionConversationHistoryResponse { conversation_ref: RuntimeConversationRef; items: RuntimeSessionConversationHistoryMessage[]; has_more: boolean; } export interface RuntimeSelfClaimResponse { assignment_id: string; undispatched_id: string; source_message_id: string; target_ref: RuntimeWorkTargetRef; broker_projection_token: string; assigned_at: number; claimed: boolean; message: { from: string; content: string; contentType: string; metadata?: Record; sourceMessageId: string; }; } export interface RuntimeSelfClaimReleaseParams { undispatched_id: string; source_message_id: string; assignment_id: string; target_ref: RuntimeWorkTargetRef; endpoint_nonce: string; broker_projection_token: string; } export interface RuntimeSelfSettleParams { undispatched_id: string; endpoint_id: string; endpoint_nonce: string; } export interface RuntimeSelfSettleResponse { settled: true; undispatched_id: string; remove_reason: "handled_no_reply"; } export type RuntimeSelfSettleOutcome = { ok: true; settle: RuntimeSelfSettleResponse; } | { ok: false; terminal: boolean; status?: number; code?: string; detail?: string; }; export declare function registerRuntimeEndpoint(cfg: PlatformClientConfig, runtimeKey: string, params: RegisterRuntimeEndpointParams): Promise; export declare function heartbeatRuntimeEndpoint(cfg: PlatformClientConfig, runtimeKey: string, endpointId: string): Promise; export declare function transitionRuntimeEndpointState(cfg: PlatformClientConfig, runtimeKey: string, endpointId: string, params: TransitionRuntimeEndpointStateParams): Promise; export declare function updateRuntimeEndpointDisplayMetadata(cfg: PlatformClientConfig, runtimeKey: string, endpointId: string, params: UpdateRuntimeEndpointDisplayMetadataParams): Promise; export declare function unregisterRuntimeEndpoint(cfg: PlatformClientConfig, runtimeKey: string, endpointId: string, asNodeId?: string): Promise; export declare function listOwnedRuntimeEndpoints(cfg: PlatformClientConfig, runtimeKey: string, asNodeId: string): Promise; export declare function getOwnedRuntimeEndpoint(cfg: PlatformClientConfig, runtimeKey: string, endpointId: string, asNodeId: string): Promise; export declare function emitRuntimeUndispatchedChanged(cfg: PlatformClientConfig, runtimeKey: string, event: Readonly>): Promise; export type EmitUndispatchedChangedOutcome = { ok: true; } | { ok: false; terminal: boolean; status?: number; detail?: string; assignmentFailureCategory?: RuntimeAssignmentFailureCategory; }; export type RuntimeInboundRouteClaimOutcome = { ok: true; action: "route" | "skip"; } | { ok: false; terminal: boolean; status?: number; detail?: string; }; export type RuntimeSelfClaimOutcome = { ok: true; claim: RuntimeSelfClaimResponse; } | { ok: false; terminal: boolean; status?: number; detail?: string; postCasInvalidClaim?: PartialRuntimeSelfClaimResponse; }; export declare function emitRuntimeNetworkPresenceChanged(cfg: PlatformClientConfig, runtimeKey: string, event: Readonly>): Promise; export declare function claimRuntimeInboundRoute(cfg: PlatformClientConfig, runtimeKey: string, event: Readonly>): Promise; export interface RuntimeCapabilities { staged_assignment: boolean; staged_delivery: boolean; } export type RuntimeCapabilitiesOutcome = { ok: true; capabilities: RuntimeCapabilities; } | { ok: false; status?: number; detail?: string; }; export declare function getRuntimeCapabilities(cfg: PlatformClientConfig, runtimeKey: string): Promise; export declare function listRuntimeClaimCandidates(cfg: PlatformClientConfig, runtimeKey: string, params: RuntimeClaimCandidatesParams): Promise; export declare function readRuntimeSessionConversationHistory(cfg: PlatformClientConfig, runtimeKey: string, params: RuntimeSessionConversationHistoryParams): Promise; export declare function claimRuntimeSelfAssignment(cfg: PlatformClientConfig, runtimeKey: string, params: RuntimeSelfClaimParams): Promise; export declare function releaseRuntimeSelfAssignment(cfg: PlatformClientConfig, runtimeKey: string, params: RuntimeSelfClaimReleaseParams): Promise; export declare function selfSettleRuntimeAssignment(cfg: PlatformClientConfig, runtimeKey: string, params: RuntimeSelfSettleParams): Promise; export declare function emitRuntimeInboundRouted(cfg: PlatformClientConfig, runtimeKey: string, event: Readonly>): Promise; export declare function emitRuntimeProcessingState(cfg: PlatformClientConfig, runtimeKey: string, event: Readonly>): Promise; //# sourceMappingURL=runtime-endpoint-client.d.ts.map