/** * Mastra `apiRoutes` for Factory work items (the kanban board). * * Registered alongside the other `/web/*` routes behind the host auth gate. * The board is org-wide: every route re-resolves the caller's `(orgId, userId)` * tenant and scopes reads/writes by `orgId`, so any org member sees and moves * the same cards while `created_by` / stage history record who acted. */ import type { ApiRoute } from '@mastra/core/server'; import type { BoardRegistry } from '../boards/index.js'; import type { FactoryStartCoordinator } from '../rules/start-coordinator.js'; import type { FactoryTransitionService } from '../rules/transition-service.js'; import type { LiveSessions } from '../session/live-sessions.js'; import type { AuditEmitter } from '../storage/domains/audit/domain.js'; import type { WorkItemCommentsStorage } from '../storage/domains/comments/base.js'; import type { FactoryProjectsStorage } from '../storage/domains/projects/base.js'; import type { QueueHealthStorage } from '../storage/domains/queue-health/base.js'; import type { CreateWorkItemInput, UpdateWorkItemInput, WorkItemsStorage } from '../storage/domains/work-items/base.js'; import type { RouteDependencies } from './route.js'; import { Route } from './route.js'; export interface WorkItemRoutesDeps extends RouteDependencies { audit: AuditEmitter; /** Factory projects domain — validates the `:id` project belongs to the caller's org. */ projects: FactoryProjectsStorage; /** Work-items domain backing the kanban board. */ workItems: WorkItemsStorage; /** Boards installed for this Factory instance. */ boardRegistry?: BoardRegistry; /** Comments domain — backs the mention attention provider. */ comments: WorkItemCommentsStorage; /** Per-project queue-health threshold config. */ queueHealth: QueueHealthStorage; /** Governed stage-transition service. Stage moves 503 when absent. */ transitionService?: Pick; /** Coordinator that binds a Factory run before dispatching its kickoff. */ startCoordinator?: Pick; /** Materialized sessions, read to report which of the listed cards are being worked or wait on someone. */ liveSessions: Pick; } /** Validate an untrusted create body. Unknown keys are dropped. */ export declare function parseCreateWorkItem(body: unknown): CreateWorkItemInput | null; /** Validate an untrusted patch body. Unknown keys are dropped. */ export declare function parseUpdateWorkItem(body: unknown): UpdateWorkItemInput | null; export declare class WorkItemRoutes extends Route { #private; /** Build the Factory work-item routes as Mastra `apiRoutes`. */ routes(): ApiRoute[]; } //# sourceMappingURL=work-items.d.ts.map