import type { ComputeStateSignalArgs, ComputeStateSignalResult, Processor } from '@mastra/core/processors'; export type EnvironmentRepositorySetupStatus = 'ok' | 'failed' | 'skipped'; /** One repository of the booted environment as the agent is told about it: never a token or a clone URL. */ export interface SessionEnvironmentRepositoryState { slug: string; /** Absolute directory of the checkout under the workspace root. */ dir: string; /** The branch the checkout ended on after boot; `null` when it stays detached. */ branch: string | null; defaultBranch: string; position: number; /** `ok` ran or was already set up, `failed` exited non-zero, `skipped` has no setup command. */ setupStatus: EnvironmentRepositorySetupStatus; /** The change request this session opened in the repository, once it has. */ changeRequestUrl?: string; } export interface SessionEnvironmentState { /** The workspace root, the session's working directory; repositories sit beneath it. */ workingDirectory: string; repositories: SessionEnvironmentRepositoryState[]; /** One free-form line the boot wants the agent to know (never a credential), rendered last. */ note?: string; } /** A repository's teardown command and the directory it runs in; kept beside the state, never rendered. */ export interface SessionEnvironmentTeardown { slug: string; dir: string; command: string; } export declare function recordSessionEnvironment(sessionId: string, state: SessionEnvironmentState, teardown?: SessionEnvironmentTeardown[]): void; /** * Record what a source-control tool did in one environment repository (the * branch it pushed, the change request it opened) so the next signal snapshot * tells the agent. A no-op when the session's environment is not recorded in * this process or the slug is not part of it. */ export declare function updateSessionEnvironmentRepository(sessionId: string, slug: string, patch: { branch?: string; changeRequestUrl?: string; }): void; /** Set or clear the environment's note; a no-op when the session's environment is not recorded here. */ export declare function setSessionEnvironmentNote(sessionId: string, note: string | null): void; export declare function clearSessionEnvironment(sessionId: string): void; export declare function peekSessionEnvironment(sessionId: string): SessionEnvironmentState | undefined; /** Teardown commands of the booted environment, in position order. */ export declare function peekSessionEnvironmentTeardown(sessionId: string): SessionEnvironmentTeardown[]; export declare function __clearSessionEnvironmentsForTests(): void; /** * Tells the agent which repositories its sandbox holds and where: the * workspace root is the session's working directory and every environment * repository is a directory beneath it. Snapshot mode only; a new snapshot * is emitted when the booted set changes (a start after an environment edit). */ export declare class FactoryEnvironmentStateProcessor implements Processor<'factory-environment'> { readonly id = "factory-environment"; readonly stateId = "factory-environment"; computeStateSignal(args: ComputeStateSignalArgs): Promise; } //# sourceMappingURL=environment-state-processor.d.ts.map