/** Private owner/operator workflow. None of this catalog belongs in public runtime descriptors. */ export declare const WORK_SESSION_SCHEMA: "canon.work-sessions.v1"; export declare const WORK_SESSION_LEASE_MS = 90000; export declare const WORK_SESSION_REQUEST_TTL_MS: number; export interface WorkSessionChoice { id: string; label: string; description?: string; } export interface WorkSessionModelChoice extends WorkSessionChoice { reasoningEfforts?: WorkSessionChoice[]; defaultReasoningEffort?: string; } export interface WorkSessionSettings { projectId?: string; modelId?: string; reasoningEffort?: string; permissionMode?: string; executionMode?: string; } export type WorkSessionSelection = ({ mode: 'create'; projectId: string; } & Omit) | { mode: 'attach'; sessionId: string; }; export interface WorkSessionLoadedSession { id: string; title: string; status: 'idle' | 'running'; settings: WorkSessionSettings; projectLabel?: string; modelLabel?: string; } export interface WorkSessionCatalog { revision: string; provider: string; canCreate: boolean; canAttach: boolean; projects: WorkSessionChoice[]; models?: WorkSessionModelChoice[]; reasoningEfforts?: WorkSessionChoice[]; permissionModes?: WorkSessionChoice[]; executionModes?: WorkSessionChoice[]; defaults?: WorkSessionSettings; sessions: WorkSessionLoadedSession[]; } export interface WorkSessionRuntimeIdentity { hostId: string; runtimeEpoch: string; } export interface WorkSessionRuntimeLease extends WorkSessionRuntimeIdentity { /** Agent-only fencing credential. Never expose in the owner catalog or request status. */ leaseToken: string; expiresAt: number; } export interface WorkSessionRuntimeRegistration extends WorkSessionRuntimeIdentity { displayName: string; catalog: WorkSessionCatalog; } export interface WorkSessionBinding { workSessionId: string; conversationId: string; hostId: string; provider: string; nativeSessionId: string; settings: WorkSessionSettings; createdAt: number; } export interface WorkSessionRuntimeState { ownerId: string; lease: WorkSessionRuntimeLease; bindings: WorkSessionBinding[]; } export interface WorkSessionCatalogResult { status: 'available' | 'offline' | 'unavailable'; agentId: string; hostId?: string; runtimeEpoch?: string; displayName?: string; expiresAt?: number; catalog?: WorkSessionCatalog; bindings: WorkSessionBinding[]; } export interface RequestWorkSessionInput extends WorkSessionRuntimeIdentity { agentId: string; conversationId: string; requestId: string; catalogRevision: string; selection: WorkSessionSelection; } export type WorkSessionRequestStatus = 'pending' | 'claimed' | 'attached' | 'failed' | 'uncertain' | 'expired'; export interface WorkSessionRequest extends RequestWorkSessionInput { schema: typeof WORK_SESSION_SCHEMA; requestedBy: string; status: WorkSessionRequestStatus; createdAt: number; updatedAt: number; expiresAt: number; binding?: WorkSessionBinding; error?: { code: string; message: string; }; } export type WorkSessionCompletion = { status: 'attached'; nativeSessionId: string; settings: WorkSessionSettings; } | { status: 'failed' | 'uncertain'; error: { code: string; message: string; }; }; export type WorkSessionRuntimeAuth = Pick; export interface WorkSessionClaimInput extends WorkSessionRuntimeAuth { requestId?: string; } export interface WorkSessionClaimResult { request: WorkSessionRequest | null; /** Previously claimed: reconcile the durable host journal, never blindly execute again. */ replayed: boolean; } export interface CompleteWorkSessionInput extends WorkSessionRuntimeAuth { requestId: string; result: WorkSessionCompletion; } export interface WorkSessionHeartbeatInput extends WorkSessionRuntimeAuth { catalog?: WorkSessionCatalog; } export interface ReleaseWorkSessionBindingInput extends WorkSessionRuntimeAuth { conversationId: string; workSessionId: string; } export interface ResolveWorkSessionRequestInput { agentId: string; requestId: string; } export interface GetWorkSessionRequestInput { agentId: string; /** Exactly one selector. Conversation lookup recovers the latest operation after reload. */ requestId?: string; conversationId?: string; } export declare function workSessionId(value: unknown, label?: string): string; export declare function parseWorkSessionSettings(value: unknown): WorkSessionSettings; export declare function parseWorkSessionCatalog(value: unknown): WorkSessionCatalog; export declare function parseWorkSessionSelection(value: unknown): WorkSessionSelection; export declare function assertWorkSessionSelectionAvailable(selection: WorkSessionSelection, catalog: WorkSessionCatalog): void; export declare function parseWorkSessionRuntimeRegistration(value: unknown): WorkSessionRuntimeRegistration; export declare function parseWorkSessionRuntimeAuth(value: unknown, extraKeys?: string[]): WorkSessionRuntimeAuth; export declare function parseRequestWorkSessionInput(value: unknown): RequestWorkSessionInput; export declare function parseWorkSessionCompletion(value: unknown): WorkSessionCompletion;