import type { FabricMeshConfig } from "../config.js"; import { MeshStore, type MeshIdentity } from "../mesh/store.js"; import type { FabricMainAgentTarget } from "../main-agent.js"; import { SubagentManager } from "../subagents/manager.js"; import type { FabricActorDeliveryRequest, FabricActorHostEvent, FabricActorInfo, FabricActorLog, FabricActorMessage, FabricActorRequest } from "./types.js"; export declare class ActorManager { #private; readonly sessionId: string; readonly identity: MeshIdentity; readonly mesh: MeshStore; readonly meshConfig: FabricMeshConfig; readonly subagents: SubagentManager; readonly onDeliver: (request: FabricActorDeliveryRequest) => void; constructor(sessionId: string, identity: MeshIdentity, mesh: MeshStore, meshConfig: FabricMeshConfig, subagents: SubagentManager, onDeliver: (request: FabricActorDeliveryRequest) => void, options?: { actorRoot?: string; persistent?: boolean; mainAgent?: FabricMainAgentTarget; }); subscribe(listener: () => void): () => void; create(request: FabricActorRequest): Promise; list(): FabricActorInfo[]; status(id: string): FabricActorInfo; /** * Change an existing actor's model. Takes effect on the actor's next queued * message: #runRequest reads actor.model at run start, so an in-flight run * keeps the model it was launched with. Pass undefined (or an empty/whitespace * string) to clear the override so the actor uses its runner's Fabric default: * subagents.model/host inheritance for Pi, or subagents.claude.model/the * Claude Code runtime default for Claude. */ setModel(id: string, model: string | undefined): Promise; /** * Change an existing actor's thinking (reasoning effort) level. Takes effect * on the actor's next queued message: #runRequest reads actor.thinking at run * start, so an in-flight run keeps the level it was launched with. Pass * undefined (or an empty/whitespace string) to clear the override so the * actor inherits the Fabric default (subagents.thinking, default "medium"). */ setThinking(id: string, thinking: string | undefined): Promise; /** * Replace an existing actor's tool allowlist. The new list takes effect on * the next queued message; an in-flight run keeps its launch-time tools. An * empty list leaves a Pi actor with only its host-required fabric_exec tool * and a Claude actor with no tools — unless the Pi actor was created with * `extensions: false`, in which case an empty list leaves it with no tools. */ setTools(id: string, tools: string[]): Promise; /** * Replace an existing actor's host-event subscriptions. Already-queued work * for a removed event still runs, but future dispatches respect the new set. * Pass an empty array to pause host-event reactivity while keeping the actor * alive and reachable by direct messages and mesh topics. */ setEvents(id: string, events: FabricActorHostEvent[]): Promise; /** * Clear an actor's recorded inbox/outbox history. The actor keeps running; * only its bounded message log is reset — useful to declutter a long mailbox * from the dashboard without stopping the actor. */ clearMessages(id: string): Promise; /** * Replace an existing actor's default instruction (its persona / system-prompt * body). Takes effect on the actor's next queued message: #runRequest builds * the system prompt from actor.instructions at run start, so an in-flight run * keeps the instructions it was launched with. Lets a steering user refine an * actor's role from the dashboard without recreating it. */ setInstructions(id: string, instructions: string): Promise; tell(id: string, message: string, data?: unknown): { queued: true; messageId: string; }; /** * Publish a steer/followUp to the shared mesh addressed to an agent that is * not local to this process. The owning process's ActorManager polls the mesh * and relays the event to its local subagent or actor. This is the cross- * process half of "any agent can steer any other agent": callers steer local * targets directly via the agents provider and remote targets through here. */ steerRemote(targetId: string, message: string, kind: "steer" | "followUp", data?: unknown): Promise<{ queued: true; messageId: string; routed: "mesh"; }>; ask(id: string, message: string, data?: unknown, signal?: AbortSignal): Promise; messages(id: string, limit?: number): FabricActorMessage[]; /** * Read an actor's default instruction (its persona / system-prompt body). * Used by the dashboard to prefill the instructions editor; deliberately not * part of the mesh-presence FabricActorInfo to keep the persona text off the * shared mesh state. */ instructions(id: string): string; /** * Read an actor's portable definition — the fields that cross the * global⇄project boundary (name, instructions, subscriptions, run settings). * Excludes all history (messages, session transcript, run logs) so export * can save a project actor to the global registry with a clean slate. */ definition(id: string): FabricActorRequest; readLog(id: string, opts?: { type?: "session" | "run" | "all"; lines?: number; runId?: string; before?: number; }): FabricActorLog; dispatchHostEvent(event: FabricActorHostEvent, payload: unknown): number; stop(id: string): Promise; /** * Whether the stop-the-world gate is currently armed. haltAll() arms it * (ESC stop-the-world) and the "input" host event lifts it when the user * resumes with a new message. Read-only view of the private gate so the * ESC handler can treat a repeated lone Esc while already halted as a * no-op rather than re-arming and re-notifying. */ get halted(): boolean; /** * Interrupt every non-stopped actor: abort its in-flight run (if any) and * reject every queued message so subsequent execution is cancelled. Unlike * stop(), actors stay alive and idle — they keep their identity, session, * and subscriptions, and resume responding to future events. Returns the * number of actors that had work to cancel. Also arms a short cooldown that * suppresses host-event dispatch so the interrupt's own turn_end / * agent_settled events do not immediately re-enqueue the actors. */ haltAll(): { halted: number; }; remove(id: string): Promise<{ removed: boolean; }>; close(): Promise; } //# sourceMappingURL=manager.d.ts.map