import type { ApiRoute } from '@mastra/core/server'; import type { FactorySandbox } from '@mastra/core/workspace'; import type { EnvironmentBuildRunner } from '../environment/build-runner.js'; import type { SessionRetirementCoordinator } from '../sandbox/session-retirement.js'; import type { FactoryProjectsStorage } from '../storage/domains/projects/base.js'; import type { ProjectRepository, SourceControlRepository, SourceControlStorage } from '../storage/domains/source-control/base.js'; import type { WorkItemsStorage } from '../storage/domains/work-items/base.js'; import type { RouteDependencies } from './route.js'; import { Route } from './route.js'; interface ModelApplySession { thread: { getById: (args: { threadId: string; }) => Promise<{ metadata?: Record | null; } | null>; setSettingOn: (args: { threadId: string; key: string; value: unknown; }) => Promise | unknown; }; } interface ModelApplyController { getSessionByResource: (resourceId: string) => Promise; } export interface ProjectRoutesDeps extends RouteDependencies { /** Factory projects domain backing the CRUD surface. */ projects: FactoryProjectsStorage; /** Source-control domain the connection/repository routes fan out over. */ sourceControl: SourceControlStorage; /** Integration ids allowed as source-control connection targets. */ versionControlIntegrationIds?: string[]; /** Validate and persist a repository selected from a provider-backed listing. */ resolveRepository?: (input: { integrationId: string; orgId: string; userId: string; installationId: string; externalId: string; slug: string; }) => Promise; /** * Fire-and-forget hook invoked after a repository is linked to a project — * kicks the initial base-checkpoint build. Must never throw. */ onProjectRepositoryLinked?: (args: { orgId: string; projectRepository: ProjectRepository; }) => void; /** Shared lifecycle for retiring sessions before their owning records are deleted. */ sessionRetirement?: SessionRetirementCoordinator; /** Work-items domain used by session retirement and running-thread model updates. */ workItems?: Pick; /** Controller used to reach the thread store behind each active binding. */ controller?: ModelApplyController; /** The factory's normalized sandbox; describes and validates the environment settings. */ sandbox?: FactorySandbox; /** Environment builds, present only when the sandbox has a `builds` capability. */ environmentBuilds?: EnvironmentBuildRunner; } export declare class ProjectRoutes extends Route { #private; constructor(deps: ProjectRoutesDeps); routes(): ApiRoute[]; } export {}; //# sourceMappingURL=projects.d.ts.map