/** * Execution-context autodetection for prompt gating. * * Detects whether the CLI is running inside GitHub Actions, a generic CI * runner, or a local development environment, plus the inferred trigger * (pr-opened, push-to-main, build-failure, merge-conflict, scheduled, etc.) * and branch/actor metadata. Prompt parts can key off these fields to * include or omit guidance that only makes sense in specific contexts. * * @module prompts/contextDetect */ export type CiKind = 'github-actions' | 'generic-ci' | 'local'; export type TriggerKind = 'pr-opened' | 'pr-synchronize' | 'pr-comment-mention' | 'issue-comment-mention' | 'push-to-main' | 'push-to-branch' | 'build-failure' | 'merge-conflict' | 'scheduled' | 'workflow-dispatch' | 'manual'; export interface ExecutionContext { ci: CiKind; trigger: TriggerKind; branch: { ref: string | null; headRef: string | null; baseRef: string | null; isMain: boolean; }; actor: { login: string | null; isBot: boolean; }; mergeableState: 'clean' | 'dirty' | 'unknown'; eventName: string | null; repo: { owner: string | null; name: string | null; }; } export interface DetectOptions { /** Override env for testing. Defaults to process.env. */ env?: NodeJS.ProcessEnv; /** Override trigger detection — primarily for tests. */ triggerOverride?: TriggerKind; } export declare function detectExecutionContext(options?: DetectOptions): ExecutionContext; /** * Capability flag map derived from an ExecutionContext. * * Each field corresponds to a PromptContext `hasXxx` flag. Used by prompt * composers to auto-enable gated parts based on execution context. */ export interface ContextCapabilityFlags { hasPrPolicies: boolean; hasBranchPolicies: boolean; hasIssueLinking: boolean; hasDraftPrProhibition: boolean; hasLabelTaxonomy: boolean; hasSingleChannelRule: boolean; hasSourceQuoteCap: boolean; hasHandoffConventions: boolean; hasIdempotencyAndAbort: boolean; hasIssueOnlyNoDirectCommits: boolean; hasPrCommentFormat: boolean; hasSixDimensionReview: boolean; hasScheduledReportFormat: boolean; hasLocalDevRelax: boolean; } export declare function deriveCapabilityFlags(ctx: ExecutionContext): ContextCapabilityFlags; //# sourceMappingURL=contextDetect.d.ts.map