import type { AwbConfig } from './rest.js'; import type { UpdateChecker } from './self-update.js'; import type { SpawnFailureSnapshot } from './spawn-failure-tracker.js'; import type { RuntimeCapabilityReport } from './runtime/runtime-health.js'; import type { AgentLaunchSpecEntry } from './launch-spec.js'; export type InstanceMode = 'manager'; export interface CliInstallEntry { cli: string; path: string; version: string | null; method: string; updatable: boolean; latest_version: string | null; needs_sudo: boolean; active: boolean; } export interface InstanceMeta { mode: InstanceMode; version: string; cli: string; cliAdapters: string[]; runtimeCapabilities?: RuntimeCapabilityReport | null; managerCapabilities?: string[] | null; availableModels?: Record | null; availableModelsProvider?: (() => Record | null) | null; availableModelsAtProvider?: (() => string | null) | null; cliVersionsProvider?: (() => Record | null) | null; cliLatestVersionsProvider?: (() => Record | null) | null; cliInstallsProvider?: (() => CliInstallEntry[] | null) | null; acpSessionClis?: string[] | null; agentSessionsProvider?: (() => AgentSessionHeartbeatEntry[]) | null; managedAgents?: ManagedAgentSnapshot | null; updateChecker?: UpdateChecker | null; agentCredentialMetaProvider?: AgentCredentialMetaProvider | null; worktreeStatusProvider?: WorktreeStatusProvider | null; runWorkspaceStatusProvider?: RunWorkspaceStatusProvider | null; openBreakerCountProvider?: (() => number) | null; dispatchSuppressionCountsProvider?: (() => Record) | null; dispatchBlockCountsProvider?: (() => Record) | null; spawnFailureProvider?: (() => SpawnFailureSnapshot) | null; agentLaunchSpecProvider?: AgentLaunchSpecProvider | null; onFirstPostSuccess?: (() => void) | null; } export interface ManagedAgentSnapshot { liveAgentIds(): string[]; workingDirs(): string[]; } export interface AgentCredentialEntry { agent_id: string; cli: string; kind: 'subscription' | 'api_key' | 'operator_home' | 'unknown' | 'missing'; expires_at_ms: number | null; refresh_token_present: boolean; } export type AgentCredentialMetaProvider = () => Promise; export interface WorktreeStatusEntry { working_dir: string; path: string; slot: string; mode: 'shared' | 'per_ticket'; ticket_id: string | null; branch: string | null; state: 'allocated' | 'idle' | 'orphaned'; live: boolean; } export type WorktreeStatusProvider = () => Promise; export interface RunWorkspaceStatusEntry { working_dir: string; path: string; kind: 'action' | 'chat' | 'orchestration'; leaf: string; last_used_at: string | null; live: boolean; } export type RunWorkspaceStatusProvider = () => Promise; export type AgentLaunchSpecProvider = () => AgentLaunchSpecEntry[]; export interface AgentSessionHeartbeatEntry { cli: string; session_id: string; status: string; } export interface InstanceHeartbeatPayload { instance_id: string; agent_id: string | null; workspace_id: string | null; mode: InstanceMode; hostname: string; plugin_version: string; cli: string; cli_adapters: string[]; runtime_capabilities?: RuntimeCapabilityReport; manager_capabilities?: string[]; pid: number; started_at: string; available_models?: Record; agent_ids?: string[]; working_dirs?: string[]; paired_at?: string; agent_credentials?: AgentCredentialEntry[]; agent_sessions?: AgentSessionHeartbeatEntry[]; agent_launch_specs?: AgentLaunchSpecEntry[]; active_worktrees?: WorktreeStatusEntry[]; active_run_workspaces?: RunWorkspaceStatusEntry[]; latest_version?: string | null; update_available?: boolean; install_mode?: string | null; update_channel?: string | null; update_last_checked_at?: string | null; update_last_error?: string | null; update_approval_pending_version?: string | null; open_breaker_count?: number; dispatch_suppression_counts?: Record; dispatch_block_counts?: Record; spawn_failure_count?: number; last_spawn_error?: string | null; last_spawn_error_cli?: string | null; last_spawn_error_at?: string | null; } export declare class InstanceHeartbeat { #private; constructor(config: AwbConfig, agentId: string | null, meta: InstanceMeta); start(): void; stop(): void; get instanceId(): string; postNow(): Promise; }