/** * The supervisor session: one per factory, addressed by a self-describing * resourceId so a restarted server can recover its scope without a lookup * table. The session has no repository, no sandbox and no work-item seat — * its tools talk to storage directly. */ import type { MastraCodeState } from '@mastra/code-sdk/schema'; import type { AgentController } from '@mastra/core/agent-controller'; import type { RequestContext } from '@mastra/core/request-context'; import type { MemorySettingsStorage } from '../storage/domains/memory-settings/base.js'; import type { FactoryProjectsStorage } from '../storage/domains/projects/base.js'; import type { SupervisorScope } from './read-tools.js'; type FactorySession = Awaited['createSession']>>; export declare function supervisorResourceId(factoryProjectId: string): string; /** The supervisor thread shares the session's id: one thread per factory. */ export declare function supervisorThreadId(factoryProjectId: string): string; export declare function parseSupervisorResourceId(resourceId: string | undefined | null): string | null; /** * Scope a request to a supervisor session the caller is allowed to drive: * the resourceId must name a project, and the caller's org must own it. * Anything else yields null and the supervisor tools stay unregistered. */ export declare function resolveSupervisorScope(options: { requestContext: RequestContext | undefined; projects: Pick; }): Promise; /** * Session-start hook: stamp the owning project onto a supervisor session and * apply the factory's default model and memory settings. Runs on every * (re)creation so a restarted server heals the in-memory state. Sessions * that are not supervisors are left untouched. */ export declare function hydrateSupervisorSession(session: FactorySession, deps: { projects: Pick; memorySettings?: MemorySettingsStorage; }): Promise; export {}; //# sourceMappingURL=session.d.ts.map