import type { FabricOwnedModelGuidance } from "../components/model-guidance.js"; import type { FabricModelAliases, FabricModelCandidate } from "../core/model-resolution.js"; import type { FabricAgentConfig, FabricMeshConfig, FabricRetentionConfig } from "../config.js"; import type { FabricActorInfo, FabricActorRequest } from "../actors/types.js"; import type { AgentHandleInfo, AgentRunRequest, FabricRunOutcome } from "../agents/types.js"; import type { FabricKernel } from "../runtime/kernel.js"; import type { MeshIdentity } from "../mesh/store.js"; import type { OwnerHeartbeatFields } from "../core/atomic-write.js"; import type { FabricScope } from "../protocol.js"; export declare const sleepUnlessAborted: (ms: number, signal?: AbortSignal) => Promise; /** * Remove an abandoned file-exchange request. The resident host renames * unstarted requests out of `requests/` before running them, so deleting our * file cancels work the host has not picked up yet; a late host response is * removed as well. Deleting a request the host already moved is a no-op, and * in-flight work still runs to completion. Best effort: never throws. */ export declare const abandonResidentRequest: (requestsPath: string, responsesPath: string, requestId: string) => void; export declare const RESIDENT_HOST_FORMAT: 1; export declare const residentHostId: (rootId: string) => string; export declare const residentRoot: (meshRoot: string, rootId: string) => string; export declare const residentDeliveryPrefix: (rootId: string) => string; export interface ResidentPiModelState { available: FabricModelCandidate[]; aliases: FabricModelAliases; defaultModel?: string; } export interface ResidentHostConfig { format: typeof RESIDENT_HOST_FORMAT; rootId: string; sessionId: string; cwd: string; projectRoot: string; meshRoot: string; actorRoot: string; sessionActorRoot?: string; residencyRoot: string; fullCodeMode: boolean; kernel?: FabricKernel; pythonRuntime?: "cpython" | "monty"; agents: FabricAgentConfig; mesh: FabricMeshConfig; retention: FabricRetentionConfig; workerPath: string; fabricExtensionPath: string; piBinary: string; claudeBinary: string; vedaBinary: string; piModels?: ResidentPiModelState; modelGuidance?: FabricOwnedModelGuidance[]; } export interface ResidentHostOwner extends OwnerHeartbeatFields { format: typeof RESIDENT_HOST_FORMAT; hostId: string; pid: number; token: string; startedAt: number; readyAt: number; } interface ResidentSpawnCommand { format: typeof RESIDENT_HOST_FORMAT; operation: "spawn"; requestId: string; rootId: string; /** Carries the host-only recursiveToolAuthority deny cap. Absence is not a grant; * the receiving manager also applies its own inherited authority. Format stays 1. */ request: AgentRunRequest; /** A registered runner's residentModule, imported by the host before launch. */ runnerModule?: string; createdAt: number; } interface ResidentCleanupCommand { format: typeof RESIDENT_HOST_FORMAT; operation: "cleanup"; requestId: string; rootId: string; id: string; deleteBranch: boolean; createdAt: number; } interface ResidentForegroundCommand { format: typeof RESIDENT_HOST_FORMAT; operation: "foreground"; requestId: string; rootId: string; id: string; createdAt: number; } interface ResidentRemoveActorCommand { format: typeof RESIDENT_HOST_FORMAT; operation: "removeActor"; requestId: string; rootId: string; id: string; createdAt: number; } interface ResidentCreateActorCommand { format: typeof RESIDENT_HOST_FORMAT; operation: "createActor"; requestId: string; rootId: string; request: FabricActorRequest; createdAt: number; } export type ResidentCommand = ResidentSpawnCommand | ResidentCleanupCommand | ResidentForegroundCommand | ResidentRemoveActorCommand | ResidentCreateActorCommand; export interface ResidentCommandResponse { format: typeof RESIDENT_HOST_FORMAT; requestId: string; ok: boolean; handle?: AgentHandleInfo; actor?: FabricActorInfo; error?: string; /** Set when a claimed request was interrupted; the same concept as a run record's outcome. */ outcome?: FabricRunOutcome; completedAt: number; } export interface ResidentAgentMetadata { format: typeof RESIDENT_HOST_FORMAT; rootId: string; id: string; runDirectory: string; handle: AgentHandleInfo; worktreeGitRoot?: string; /** Imported again by a restarted host before it re-attaches hosted runs. */ runnerModule?: string; /** The scope the durable child launched with (forwarded by the requesting session). */ scope?: FabricScope; /** Main consumed this terminal result; suppress queued delivery across reconnects. */ completionConsumedAt?: number; createdAt: number; updatedAt: number; } export interface ResidentDeliveryRecord { format: typeof RESIDENT_HOST_FORMAT; /** Survives payload truncation; lets Main read the authoritative terminal result. */ agentCompletionId?: string; id: string; rootId: string; from: MeshIdentity; delivery: "steer" | "followUp"; triggerTurn: boolean; message: string; data?: unknown; createdAt: number; } export {}; //# sourceMappingURL=protocol.d.ts.map