/**
 * Host session reference and related session-facing types (WP-01).
 */

export type HostSessionState =
  | "ready"
  | "running"
  | "idle"
  | "lost"
  | "closed"
  | "unknown";

export interface HostSessionRef {
  hostId: string;
  /** Opaque to Core — Core must not parse vendor session formats. */
  externalSessionId: string;
  mode?: "local" | "cloud" | "managed";
  metadata?: Record<string, string>;
}

export interface WorkerIdentity {
  workerId: string;
  roleId: string;
  layer: "leader" | "worker" | "governance" | "observer" | "admin";
  workspaceId?: string;
  labels?: Record<string, string>;
}

export interface PrepareSessionInput {
  worker: WorkerIdentity;
  existing?: HostSessionRef;
  workspace?: string;
  modelHint?: string;
}

export interface PreparedHostSession {
  reference: HostSessionRef;
  state: HostSessionState;
  created: boolean;
}
