/** * Per-user intake selections for every configured intake integration. * * Integration ids are dynamic. Each integration contributes provider-neutral * sources through `FactoryIntegration.intake`; this domain only persists which * source ids the user selected. */ import { FactoryStorageDomain } from '@mastra/core/storage'; import type { CollectionSchema } from '@mastra/core/storage'; export interface IntakeSelection { enabled: boolean; /** Provider-owned source ids; `null` means nothing is selected. */ sourceIds: string[] | null; } export type IntakeConfig = Record; export declare const DEFAULT_INTAKE_CONFIG: IntakeConfig; export declare const INTAKE_SETTINGS_SCHEMA: CollectionSchema; /** * Binds an intake source to the Factory project its items belong to. * * Intake selections are per user and org-wide, so they cannot say *where* an * ingested item should land. GitHub items are naturally scoped by their linked * repository; providers without that link (Linear) need this explicit binding * so viewing one project's board cannot materialize another project's items. */ export declare const INTAKE_SOURCE_BINDINGS_SCHEMA: CollectionSchema; export interface IntakeSourceBinding { integrationId: string; sourceId: string; factoryProjectId: string; /** Installed board the source feeds, or `null` for legacy source-type routing. */ board: string | null; } /** * Routes items carrying a label to an installed board, per Factory project. * * Repository-scoped providers (GitHub) already know which project an item * belongs to, but one repository can feed several boards: an issue labelled * `release` belongs on a release board while the rest stay on Work. Labels * without a route fall back to the provider's built-in board. */ export declare const INTAKE_LABEL_ROUTES_SCHEMA: CollectionSchema; export interface IntakeLabelRoute { factoryProjectId: string; integrationId: string; label: string; board: string; } /** Labels are matched the way GitHub treats them: case-insensitively. */ export declare function normalizeIntakeLabel(label: string): string; /** * The board a labelled item should land on under `routes`, or `undefined` when * none of its labels is routed. Ties resolve to the first route in `routes` * order, so callers should pass a deterministically ordered list. */ export declare function resolveIntakeLabelRoute(routes: readonly IntakeLabelRoute[], labels: readonly string[] | undefined): IntakeLabelRoute | undefined; export declare class IntakeStorage extends FactoryStorageDomain { #private; constructor(); init(): Promise; dangerouslyClearAll(): Promise; getConfig({ orgId, userId, integrationIds, }: { orgId: string; userId: string; /** * When provided, the result contains exactly these integration ids, with * unset integrations defaulting to `{ enabled: true, sourceIds: null }`. */ integrationIds?: string[]; }): Promise; saveConfig({ orgId, userId, config }: { orgId: string; userId: string; config: IntakeConfig; }): Promise; /** Every source binding in the org, optionally narrowed to one integration. */ listBindings({ orgId, integrationId, }: { orgId: string; integrationId?: string; }): Promise; /** Source ids bound to one Factory project. Empty means "nothing bound". */ listBoundSourceIds({ orgId, integrationId, factoryProjectId, }: { orgId: string; integrationId: string; factoryProjectId: string; }): Promise; /** The binding for one source, or `null` when it is unbound. */ getBinding({ orgId, integrationId, sourceId, }: { orgId: string; integrationId: string; sourceId: string; }): Promise; clearBinding({ orgId, integrationId, sourceId, }: { orgId: string; integrationId: string; sourceId: string; }): Promise; setBinding({ orgId, integrationId, sourceId, factoryProjectId, board, userId, }: { orgId: string; integrationId: string; sourceId: string; factoryProjectId: string; board?: string | null; userId?: string; }): Promise; /** Label routes in the org, optionally narrowed to one project and/or integration. Sorted by label. */ listLabelRoutes({ orgId, factoryProjectId, integrationId, }: { orgId: string; factoryProjectId?: string; integrationId?: string; }): Promise; setLabelRoute({ orgId, factoryProjectId, integrationId, label, board, userId, }: { orgId: string; factoryProjectId: string; integrationId: string; label: string; board: string; userId?: string; }): Promise; /** Remove a label route; returns the route that was removed, or `null` when none existed. */ clearLabelRoute({ orgId, factoryProjectId, integrationId, label, }: { orgId: string; factoryProjectId: string; integrationId: string; label: string; }): Promise; } //# sourceMappingURL=base.d.ts.map