import type { WorkflowEffect, WorkflowState, WorkflowStep } from '../../models/types.js'; import type { MergeMethod } from '../../models/config-types.js'; import type { PrMergeOptions, PrStatus, PrStatusFetchOptions } from './pr-execution-context.js'; import type { PrCiFailure, PrCiRerunResult } from './pr-ci.js'; import type { RunPaths } from '../run/run-paths.js'; import type { ProviderType, StreamCallback } from '../../../shared/types/provider.js'; export interface SystemStepTaskContext { readonly issueNumber?: number; readonly runSlug?: string; } export interface SystemStepRuntimeState { readonly cache: Map; readonly cleanupHandlers: Set<() => void>; } export type SystemStepCliStatus = { available: true; } | { available: false; error: string; }; export interface SystemStepIssue { number: number; title: string; body: string; labels: string[]; comments: Array<{ author: string; body: string; }>; } export interface SystemStepExistingPr { number: number; url: string; } export interface SystemStepIssueListItem { number: number; title: string; labels: string[]; updated_at: string; } export interface SystemStepPrListItem { number: number; author: string; base_branch: string; head_branch: string; managed_by_takt: boolean; labels: string[]; same_repository: boolean; draft: boolean; updated_at: string; } export interface SystemStepCreateIssueOptions { title: string; body: string; labels?: string[]; } export type SystemStepCreateIssueResult = { success: true; issueNumber: number; url?: string; } | { success: false; error: string; }; export type SystemStepCloseIssueResult = { success: true; commentCreated?: boolean; } | { success: false; error: string; commentCreated?: boolean; }; export interface SystemStepCommentResult { success: boolean; error?: string; } export interface SystemStepMergeResult { success: boolean; error?: string; } export interface SystemStepPrReviewComment { author: string; body: string; path?: string; line?: number; url?: string; threadState?: 'active' | 'outdated-unresolved' | 'resolved'; resolvedBy?: string; isOutdated?: boolean; } export interface SystemStepPrReviewData { number: number; title: string; body: string; url: string; headRefName: string; baseRefName?: string; comments: SystemStepPrReviewComment[]; reviews: SystemStepPrReviewComment[]; files: string[]; } export interface SystemStepGitProvider { checkCliStatus(cwd?: string): SystemStepCliStatus; fetchIssue(issueNumber: number, cwd?: string): SystemStepIssue; createIssue(options: SystemStepCreateIssueOptions, cwd?: string): SystemStepCreateIssueResult; closeIssue(issueNumber: number, comment: string, cwd?: string): SystemStepCloseIssueResult; fetchPrReviewComments(prNumber: number, cwd?: string): SystemStepPrReviewData; listOpenIssues(cwd?: string): SystemStepIssueListItem[]; listOpenPrs(cwd?: string): SystemStepPrListItem[]; findExistingPr(branch: string, cwd?: string): SystemStepExistingPr | undefined; commentOnPr(prNumber: number, body: string, cwd?: string): SystemStepCommentResult; closePr(prNumber: number, cwd?: string): SystemStepMergeResult; mergePr(prNumber: number, cwd?: string, method?: MergeMethod, expectedHeadSha?: string): SystemStepMergeResult; fetchPrStatus?(prNumber: number, cwd?: string, options?: PrStatusFetchOptions): Promise; fetchPrCiFailure?(prNumber: number, headSha: string, cwd: string, options?: PrStatusFetchOptions): Promise; rerunPrCi?(failure: PrCiFailure, cwd: string, options?: PrStatusFetchOptions): Promise; } export interface SystemStepServicesOptions extends PrMergeOptions { readonly runPaths?: RunPaths; readonly cacciaService?: { execute(prNumber: number): Promise>; }; readonly abortSignal?: AbortSignal; readonly createProviderStream?: (provider: ProviderType, model: string | undefined) => StreamCallback | undefined; readonly allowGitHooks?: boolean; readonly allowGitFilters?: boolean; readonly cwd: string; readonly contextDirectory?: string; readonly projectCwd: string; readonly task: string; readonly taskContext?: SystemStepTaskContext; readonly runtimeState?: SystemStepRuntimeState; readonly gitProvider?: SystemStepGitProvider; } export interface SystemStepInputResolutionContext { readonly prStatusFetchOptions?: PrStatusFetchOptions; readonly cache: Map; readonly resolvedBindings: Map; } export interface SystemStepServices { resolveSystemInput(input: NonNullable[number], state?: WorkflowState, stepName?: string, resolutionContext?: SystemStepInputResolutionContext): unknown; executeEffect(effect: WorkflowEffect, payload: Record, state: WorkflowState): Promise>; } export type SystemStepServicesFactory = (options: SystemStepServicesOptions) => SystemStepServices; //# sourceMappingURL=system-step-services.d.ts.map