import type { RequestContext } from '@mastra/core/request-context'; import type { FactoryRunBindingAddress, FactoryRunBindingRecord, FactoryRunBindingSessionAddress, WorkItemsStorage } from '../storage/domains/work-items/base.js'; /** Minimal source-control session lookup used to heal recovered session state. */ export interface FactorySessionSourceLookup { getBySessionId(sessionId: string): Promise<{ orgId: string; projectRepositoryId: string; baseBranch: string; } | null>; } export declare function getFactorySessionCoordinates(requestContext: RequestContext | undefined): FactoryRunBindingSessionAddress | null; export declare function getFactorySessionAddress(requestContext: RequestContext | undefined): FactoryRunBindingAddress | null; export interface FactorySessionAddressResolution { address: FactoryRunBindingAddress; /** Present only when the address was recovered from the binding table. */ binding?: FactoryRunBindingRecord; } /** * Resolve the bound session address, falling back to the active binding row * when the in-memory session state is missing `factoryProjectId` — a server * crash drops controller sessions, and a resumed session ("Continue") is * recreated with empty state, which silently unregistered the transition * tool. On recovery the lost state is healed back onto the session (including * the `untrustedCheckout`/`baseRef` security posture the start coordinator * originally seeded) so later reads resolve directly. */ export declare function resolveFactorySessionAddress(options: { requestContext: RequestContext | undefined; storage: Pick; sessions?: FactorySessionSourceLookup; }): Promise; //# sourceMappingURL=binding-context.d.ts.map