import type { RequestContext } from '@mastra/core/request-context'; import type { ApiRoute } from '@mastra/core/server'; import type { MastraWorker } from '@mastra/core/worker'; import type { Intake } from '../../../capabilities/intake.js'; import type { RouteAuth } from '../../../routes/route.js'; import type { IntakeStorage } from '../../../storage/domains/intake/base.js'; import type { FactoryProjectsStorage } from '../../../storage/domains/projects/base.js'; import type { FactoryIntegration, IntegrationContext, IntegrationTools } from '../../base.js'; import type { IncidentioEventRules, IncidentioRuleOverrides } from '../../incidentio/default-rules.js'; import { type PlatformApiClientConfig } from '../api-client.js'; export interface PlatformIncidentioIntegrationConfig { clientConfig?: PlatformApiClientConfig; /** Per-event replacements for the default Factory incident.io rules. */ rules?: IncidentioRuleOverrides; } interface PlatformIntegrationConnection { id: string; integrationId: string; status: 'active' | 'needs_reauth'; accountLabel: string | null; } interface ScopedSourceId { connectionId: string; sourceId: string; } export declare function encodeScopedSourceId(connectionId: string, sourceId: string): string; export declare function decodeScopedSourceId(value: string): ScopedSourceId | null; export declare class PlatformIncidentioIntegration implements FactoryIntegration { #private; readonly id = "incidentio"; constructor(config?: PlatformIncidentioIntegrationConfig); /** Event rules driving automatic follow-up materialization and close handling. */ get rules(): IncidentioEventRules; initialize({ projects, auth, intake, }: { projects: FactoryProjectsStorage; auth: RouteAuth; intake: IntakeStorage; }): void; /** Cross-integration intake selection/binding domain — agent-tool authorization. */ get intakeStorage(): IntakeStorage; /** Factory projects domain — maps a session's resourceId to its owning org. */ get projects(): FactoryProjectsStorage; /** Whether the host runs with web auth enabled; every surface is inert without it. */ get authEnabled(): boolean; /** * Map a session's resourceId (the factory project id) to its owning org. * Same caching semantics as the Jira integration: definitive misses are * cached, transient database failures are not. */ resolveOrgId(resourceId: string): Promise; /** * Org-scoped agent tools: the read-only follow-up detail tool for sessions * whose resource is a factory project with an active Platform-managed * incident.io connection. */ agentTools(args: { requestContext: RequestContext; }): Promise; listConnections(): Promise; hasActiveConnections(): Promise; clearCaches(): void; readonly intake: Intake; workers(ctx: IntegrationContext): MastraWorker[]; /** * The integration's HTTP surface: `/web/incidentio/*` Mastra `apiRoutes` * (status + follow-up listing/detail for Intake), aggregated across every * discovered Platform connection. A board-scoped listing also feeds the * incident.io event rules. */ routes(ctx: IntegrationContext): ApiRoute[]; diagnostics(): Record; } export {}; //# sourceMappingURL=integration.d.ts.map