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 { VersionControl } from '../../../capabilities/version-control.js'; import type { IntegrationStorageHandle } from '../../../storage/domains/integrations/base.js'; import type { SourceControlStorageHandle } from '../../../storage/domains/source-control/base.js'; import type { FactoryIntegration, IntegrationContext, IntegrationTools } from '../../base.js'; import { GithubAppIdentity } from '../../github/app-identity.js'; import type { GithubEventRules, GithubRuleOverrides } from '../../github/default-rules.js'; import type { GithubIntegration, GithubRepositoryPermission, GithubTriageCommentUpsertInput, GithubTriageCommentUpsertResult, RepoSummary } from '../../github/integration.js'; import type { ReconcileIssueState, ReconcilePullRequestState } from '../../github/rules.js'; import type { GithubSubscriptionStorage } from '../../github/subscriptions.js'; export declare class PlatformGithubIntegration implements FactoryIntegration { #private; readonly id = "github"; get rules(): GithubEventRules; /** * Factory's own GitHub identity. Platform credentials do not carry the login * they post as, so this starts from the configured slug (usually absent on a * Platform deployment) and is corrected the first time Factory writes. */ readonly identity: GithubAppIdentity; /** * Extra reviewer bot logins this deployment trusts for author-gated * notifications, merged over the built-in defaults. */ readonly authorizedBots: readonly string[]; readonly intake: Intake; readonly versionControl: VersionControl; constructor(options?: { /** Replace an event handler, or disable it with null; omitted events keep defaults. */ rules?: GithubRuleOverrides; /** GitHub App slug used to recognize Factory's own webhook writes. */ slug?: string; }); /** GitHub App slug when the deployment explicitly provides it. */ get slug(): string | undefined; isFactoryCommentAuthor(login: string | null | undefined): boolean; get storage(): SourceControlStorageHandle; get sourceControlStorage(): SourceControlStorageHandle; get integrationStorage(): GithubSubscriptionStorage; initialize({ storage }: { storage: IntegrationStorageHandle; }): void; routes(ctx: IntegrationContext): ApiRoute[]; workers(ctx: IntegrationContext): MastraWorker[]; /** * Reads live PR state through the Platform GitHub proxy for the merge * reconciler. Returns undefined when the PR cannot be resolved (missing, * proxy error) so a sweep never fabricates a merge. */ fetchPullRequestState(input: { installationId: number; repository: string; number: number; }): Promise; /** * Reads live issue state through the Platform GitHub proxy for the * reconciler. Returns undefined when the issue cannot be resolved (missing, * is actually a PR, proxy error) so a sweep never fabricates a close. */ fetchIssueState(input: { installationId: number; repository: string; number: number; }): Promise; upsertFactoryTriageComment(input: GithubTriageCommentUpsertInput): Promise; sessionTools({ requestContext }: { requestContext: RequestContext; }): IntegrationTools; postToolObserver({ toolContext, requestContext, }: Parameters>[0]): Promise; diagnostics(): Record; getRepositoryCollaboratorPermission(_installationId: number, repoFullName: string, username: string, signal?: AbortSignal): Promise; listInstallationRepos(installationId: number): Promise; mintInstallationToken(installationId: number): Promise; addIssueLabels(_installationId: number, sourceId: string, issueNumber: number, labels: string[]): Promise; removeIssueLabel(_installationId: number, sourceId: string, issueNumber: number, label: string): Promise; getInstallationOctokit(_installationId: number): ReturnType; } //# sourceMappingURL=integration.d.ts.map