/** * Mastra `apiRoutes` for trusted external orchestrators to enqueue an * idempotent, deferred skill dispatch against a Factory work item. * * The endpoint is a constrained ingress in front of * `WorkItemsStorage.commitRuleEvaluation()`: it commits exactly one * `invokeSkill` decision, stamps a non-human system actor, and leaves * execution (session creation, auto-run/approval policy, retry, restart * recovery) to the `FactoryDecisionDispatcher`. * * Idempotency: the `requestId` becomes the ingress identity, so replaying the * same request returns the prior result without inserting a second decision. * Tenant-mode callers must administer the organization; local (no-auth) * deployments run under the shared `local` storage scope without inventing a * tenant user. */ import type { ApiRoute } from '@mastra/core/server'; import type { AuditEmitter, AuditRecorder } from '../storage/domains/audit/domain.js'; import type { FactoryProjectsStorage } from '../storage/domains/projects/base.js'; import type { WorkItemsStorage } from '../storage/domains/work-items/base.js'; import { Route } from './route.js'; import type { RouteDependencies } from './route.js'; export interface AutomationRunRoutesDeps extends RouteDependencies { audit: AuditEmitter & AuditRecorder; /** Factory projects domain — validates the `:id` project belongs to the caller's org. */ projects: FactoryProjectsStorage; /** Work-items domain backing `commitRuleEvaluation`. */ workItems: WorkItemsStorage; /** Config version stamped on the committed rule evaluation. */ configVersion: string; } export declare class AutomationRunRoutes extends Route { #private; routes(): ApiRoute[]; } export declare function buildAutomationRunRoutes(deps: AutomationRunRoutesDeps): ApiRoute[]; //# sourceMappingURL=automation-runs.d.ts.map