import { type CacheDirective, type CachePolicy, type CacheRef, type CacheRegistryDefinition, type CacheRegistryInput } from "./cache.js"; export * from "./cache.js"; export * from "./declaration.js"; export * from "./errors.js"; export type TaskId = string; export type JobId = string; export type TriggerId = string; export type SourceId = string; export type SandboxId = string; export type ExecutionProfileId = string; export type SourceType = "git" | "path"; export type ExecutionMode = "manual" | "ci"; export type CacheSharing = "shared" | "private" | "locked"; export type TaskStatus = "pending" | "running" | "passed" | "failed" | "skipped" | "cached"; export type EnvVarMap = Record; export type EnvValue = string | EnvSecretRef | EnvVarRef; export type SandboxKind = "host" | "lima" | "docker" | "container"; export type ContainerProvider = "auto" | "docker" | "apple-container" | "lima"; export declare const DEFAULT_PIPELINE_CONFIG_FILES: readonly ["pipeline.ts", "pipeline.js", "pipeline.mjs", "pipeline.mts"]; export interface ShellCommand { kind: "shell"; command: string; } export type DeferredShellCommandFactory = (context: TaskContext) => ShellCommand | Promise; export interface DeferredShellCommand { kind: "deferred-shell"; command: DeferredShellCommandFactory; } export type TaskRunFunction = (context: TaskContext) => void | Promise; export type TaskStep = ShellCommand | DeferredShellCommand | AgentStep | TaskRunFunction; export interface CandidateContext { dir: string; fingerprint: string; commit?: string; ref?: string; dirty?: boolean; } export interface TaskSourceContext { name: SourceId; dir: string; type: SourceType; ref?: string; commit?: string; } export interface TaskContext { taskId: TaskId; runId: string; cwd: string; env: Record; root: { dir: string; }; candidate: CandidateContext; source?: TaskSourceContext; meta(metadata: Record): void; log(message: string): void; sh: typeof sh; } export interface RetryPolicy { attempts: number; delayMs?: number; } export interface CacheDirectory { path: string; sharing?: CacheSharing; } export interface TaskCacheOptions { enabled?: boolean; directories?: CacheDirectory[]; ref?: CacheRef; store?: string; policy?: CachePolicy; ttlMs?: number; key?: unknown; } export interface TaskRequirements { tools?: string[]; secrets?: string[]; runtime?: "node" | "deno" | "shell"; } export type JobEnvironment = string | { name: string; url?: string; }; export interface JobRequirements { provenance?: boolean; } export interface SandboxVolume { source: string; target: string; readonly?: boolean; } export interface HostSandboxDefinition { kind: "host"; } export interface LimaSandboxDefinition { kind: "lima"; vm?: string; } export interface DockerSandboxDefinition { kind: "docker"; image: string; workdir?: string; volumes?: SandboxVolume[]; } export interface ContainerSandboxDefinition { kind: "container"; image: string; workdir?: string; volumes?: SandboxVolume[]; } export type SandboxDefinition = HostSandboxDefinition | LimaSandboxDefinition | DockerSandboxDefinition | ContainerSandboxDefinition; export interface LocalExecutionProfileDefinition { kind: "local"; sandbox?: SandboxId; provider?: ContainerProvider; } export interface GitHubExecutionProfileDefinition { kind: "github"; sandbox?: SandboxId; provider?: ContainerProvider; runsOn?: string | string[]; runsOnMatrix?: Array; } export interface CloudflareExecutionProfileDefinition { kind: "cloudflare"; runner?: CloudflareRunnerConfig; } export type ExecutionProfileDefinition = LocalExecutionProfileDefinition | GitHubExecutionProfileDefinition | CloudflareExecutionProfileDefinition; export interface CommandOutputPolicy { maxBytes?: number; redactSecrets?: boolean; } export type CommandAction = { kind: "async-pipeline.command.allow"; output?: CommandOutputPolicy; } | { kind: "async-pipeline.command.deny"; message?: string; output?: CommandOutputPolicy; } | { kind: "async-pipeline.command.mock"; code?: number; stdout?: string; stderr?: string; output?: CommandOutputPolicy; } | { kind: "async-pipeline.command.requireApproval"; message?: string; output?: CommandOutputPolicy; } | { kind: "async-pipeline.command.requireEnvironment"; name: string; output?: CommandOutputPolicy; }; export interface CommandRule { exact?: string[]; prefix?: string[]; action: CommandAction; } export interface CommandPolicy { rules: CommandRule[]; fallback?: CommandAction; record?: boolean; output?: CommandOutputPolicy; shims?: string[]; } export interface EnvSecretRef { kind: "async-pipeline.env.secret"; name: string; } export interface EnvVarRef { kind: "async-pipeline.env.var"; name: string; values?: EnvVarMap; default?: string; } export type AgentProfileId = string; export interface AgentProfileDefinition { /** * Argv prefix for the adapter CLI (e.g. ["claude", "-p"]). The resolved * prompt is delivered on stdin. The command never enters any cache key: * cache identity comes from the profile id and model, not from where a * binary happens to live. */ command: readonly string[]; /** Model identity. Enters agent cache keys; supports env.var(...) selection. */ model: string | EnvVarRef; } export interface AgentStep { kind: "agent"; /** Profile id declared in pipeline `agents`, or env.var(...) selecting one at run time. */ use: AgentProfileId | EnvVarRef; prompt: string; /** Optional model override of the profile's model. */ model?: string | EnvVarRef; /** * Write the adapter's stdout to this file (relative to the task's cwd) * after the step succeeds. The propose-only mechanism: an agent emits a * patch or report on stdout, the runner lands it as a reviewable artifact. * Declare the path in the task's `outputs` to cache and restore it. */ stdoutTo?: string; } /** An agent step after run-time resolution: profile and model are concrete and the adapter argv is attached for execution. */ export interface ResolvedAgentStep extends AgentStep { use: AgentProfileId; model: string; command: readonly string[]; } export interface TriggerDefinition { type: "manual" | "github" | "schedule"; events?: string[]; types?: string[]; cron?: string; branches?: string[]; paths?: string[]; tags?: string[]; timezone?: string; } export type PipelineWorkflowEventSource = "github" | "cloudflare"; export type PipelineWorkflowEventName = "push" | "pull_request" | "release" | "schedule" | "manual"; export interface PipelineEventEnvelope { source: PipelineWorkflowEventSource; event: PipelineWorkflowEventName; ref?: string; branch?: string; sha?: string; pullRequest?: { number: number; headSha: string; sameRepository: boolean; }; release?: { tagName: string; action: string; }; requestedJob?: string; } export type PipelineWorkflowLifecycleStepKind = "plan" | "render" | "check" | "run" | "deploy" | "report" | "record"; export interface PipelineWorkflowTrustPolicy { event: PipelineWorkflowEventName; sameRepository: boolean | null; writeCredentials: boolean; cacheSave: boolean; reason: string; } export interface PipelineWorkflowEffectPlan { kind: "deploy" | "report"; host: "cloudflare" | "github"; effect: DeployDefinition | ReportDefinition; idempotencyKey: string; receiptPath: string; network: "mock" | "host"; } export interface PipelineWorkflowJobPlan { id: JobId; target: TaskId[]; trigger: TriggerId[]; execution?: ExecutionProfileId; lifecycle: PipelineWorkflowLifecycleStepKind[]; idempotencyKey: string; trust: PipelineWorkflowTrustPolicy; effects: PipelineWorkflowEffectPlan[]; receipts: { run: string; deploy?: string; report?: string; }; } export interface PipelineWorkflowPlan { version: 1; generatedBy: "@async/pipeline"; pipeline: string; event: PipelineEventEnvelope; lifecycle: PipelineWorkflowLifecycleStepKind[]; jobs: PipelineWorkflowJobPlan[]; skippedJobs: Array<{ id: JobId; reason: string; trigger: TriggerId[]; }>; } export type PipelineCloudflareEventName = "push" | "pull_request" | "release" | "workflow_dispatch"; export interface PipelineCloudflareEvent { source: "github"; event: PipelineCloudflareEventName; owner: string; repo: string; sha: string; ref: string; branch?: string; pullRequest?: { number: number; headSha: string; headRepoFullName: string; sameRepository: boolean; }; release?: { tagName: string; action: string; }; installationId?: number; requestedJob?: string; } export type PipelineCloudflareResultStatus = "queued" | "in_progress" | "passed" | "failed" | "cancelled"; export interface PipelineCloudflareResult { job: JobId; status: PipelineCloudflareResultStatus; sha: string; evidence?: { manifestPath: string; summaryPath: string; }; preview?: { kind: "pages" | "worker"; environment: "preview" | "production"; urlAlias?: string; }; } export interface CloudflareRunnerExecOptions { cwd?: string; env?: Record; capture?: boolean; timeoutMs?: number; } export interface CloudflareRunnerResult { exitCode: number; stdout?: string; stderr?: string; durationMs?: number; } export interface CloudflareRunnerCapability { exec(command: string, options?: CloudflareRunnerExecOptions): Promise; } export interface CloudflareRunnerCommandPlan { job: JobId; execution: ExecutionProfileId; command: string; cwd: "."; runner: NormalizedCloudflareRunnerConfig; cache: NormalizedCloudflareCacheConfig; capabilities: { github: { required: boolean; enabled: boolean; }; cloudflare: { required: boolean; enabled: boolean; }; artifacts: { required: boolean; enabled: boolean; }; }; permissions: string[]; evidence: { runPath: string; resultPath: string; cacheNamespace: string; }; mockAvailable: true; } export type SyncRunner = "package" | "deno"; export type SyncSelection = "all" | string[]; export type SyncTargetSelector = { package: string; allowMultiple?: boolean; } | { path: string; allowMultiple?: boolean; }; export type SyncTargets = "root" | SyncTargetSelector[]; export type GitHubSetupProvider = "auto" | "async" | "pnpm" | "node"; export type GitHubRuntimeName = "node" | "deno" | "bun"; export type DependabotAutoMergeEcosystem = "github-actions" | "npm" | "deno"; export interface DependabotAutoMergeConfig { ecosystems?: DependabotAutoMergeEcosystem[]; } export type DependabotAutoMergeInput = boolean | DependabotAutoMergeConfig; export interface PackagePreviewsConfig { package?: string; target?: string; registry?: string; namespace?: string; tokenEnv?: string; comment?: boolean; } export type PackagePreviewsInput = boolean | PackagePreviewsConfig; export type EvidenceIfNoFilesFound = "ignore" | "warn" | "error"; export interface GitHubEvidenceConfig { job?: string; paths?: string[]; receiptPaths?: string[]; artifactNamePrefix?: string; retentionDays?: number; ifNoFilesFound?: EvidenceIfNoFilesFound; includeSummary?: boolean; } export type GitHubEvidenceInput = boolean | GitHubEvidenceConfig; export type GitHubBridgeMode = "actions" | "off"; export interface GitHubBridgeSyncConfig { mode?: GitHubBridgeMode; schedule?: string | false; pullRequest?: boolean; branchPrefix?: string; allowedPaths?: string[]; endpointVar?: string; tokenEnv?: string; packageVersion?: string; } export type GitHubBridgeSyncInput = false | GitHubBridgeSyncConfig; export interface GitHubPagesSyncTriggersConfig { pullRequest?: boolean; main?: boolean | { branch?: string; }; manual?: boolean; } export interface GitHubPagesSyncConfig extends Partial { target?: string; job?: string; triggers?: GitHubPagesSyncTriggersConfig; } export type GitHubPagesSyncInput = boolean | GitHubPagesSyncConfig; export interface GitHubSourceImpactConfig { jobs?: JobId[]; } export type GitHubSourceImpactInput = boolean | GitHubSourceImpactConfig; export interface GitHubAttestConfig { packagePath?: string; artifacts?: string[]; subjectManifest?: string; sbomPath?: string; evidencePath?: string; requireNpmProvenance?: boolean; tarballScan?: boolean; githubAttestation?: boolean; } export type GitHubAttestInput = boolean | GitHubAttestConfig; export type GitHubContractMode = "off" | "report" | "check" | "strict" | "release"; export interface GitHubContractSchemaConfig { enabled?: boolean; sources?: string[]; output?: string; } export interface GitHubContractConfig { mode?: GitHubContractMode; job?: string; api?: boolean; claims?: boolean; schema?: boolean | GitHubContractSchemaConfig; packagePath?: string; evidenceDir?: string; annotations?: boolean; } export type GitHubContractInput = boolean | GitHubContractConfig; export type GitHubHygieneMode = "off" | "report" | "check" | "strict" | "release"; export type GitHubHygieneProfile = "package" | "github" | "docs" | "repo" | "release" | "mixed"; export interface GitHubHygieneConfig { mode?: GitHubHygieneMode; job?: string; profiles?: GitHubHygieneProfile[]; releaseGate?: boolean; packagePath?: string; evidenceDir?: string; annotations?: boolean; } export type GitHubHygieneInput = boolean | GitHubHygieneConfig; export interface GitHubUpdateTrainConfig { job?: string; package?: string; repositories?: string[]; event?: string; tokenEnv?: string; after?: string; } export type GitHubUpdateTrainInput = boolean | GitHubUpdateTrainConfig; export type GitHubDependencyBumpLanding = "pull-request" | "push" | "none"; export type GitHubDependencyBumpPackageManager = "auto" | "pnpm" | "npm" | "yarn" | "bun"; export interface GitHubDependencyBumpConfig { job?: string; packages?: string[]; event?: string; tokenEnv?: string; packageManager?: GitHubDependencyBumpPackageManager; verify?: string | string[]; success?: GitHubDependencyBumpLanding; failure?: Exclude; branchPrefix?: string; baseBranch?: string; } export type GitHubDependencyBumpInput = boolean | GitHubDependencyBumpConfig; export interface GitHubSyncConfig { workflow?: string; lock?: string; setup?: GitHubSetupProvider; nodeVersion?: number | string; runtime?: string | string[]; cache?: boolean; dependencyCache?: boolean; dependabotAutoMerge?: DependabotAutoMergeInput; packagePreviews?: PackagePreviewsInput; evidence?: GitHubEvidenceInput; bridge?: GitHubBridgeSyncInput; pages?: GitHubPagesSyncInput; sourceImpact?: GitHubSourceImpactInput; attest?: GitHubAttestInput; contract?: GitHubContractInput; hygiene?: GitHubHygieneInput; updateTrain?: GitHubUpdateTrainInput; dependencyBump?: GitHubDependencyBumpInput; } export type GitHubSyncInput = boolean | GitHubSyncConfig; export type CloudflareBridgeMode = "github-app" | "github-actions"; export type CloudflareRunnerKind = "container"; export type CloudflarePackageManager = "pnpm" | "npm" | "yarn" | "bun"; export type CloudflareCacheKind = "artifacts" | "r2" | "kv"; export interface CloudflareRunnerConfig { kind?: CloudflareRunnerKind; image?: string; packageManager?: CloudflarePackageManager; network?: boolean; } export interface CloudflareBridgeConfig { mode?: CloudflareBridgeMode; } export interface CloudflareCacheConfig { kind?: CloudflareCacheKind; namespace?: string; } export interface CloudflareCapabilitiesConfig { github?: boolean; cloudflare?: boolean; artifacts?: boolean; } export interface CloudflareSyncConfig { worker?: string; queue?: string; workflow?: string; outputDir?: string; lock?: string; bridge?: CloudflareBridgeConfig; runner?: CloudflareRunnerConfig; cache?: CloudflareCacheConfig; capabilities?: CloudflareCapabilitiesConfig; } export type CloudflareSyncInput = false | CloudflareSyncConfig; export interface NormalizedCloudflareRunnerConfig { kind: CloudflareRunnerKind; image: string; packageManager: CloudflarePackageManager; network: boolean; } export interface NormalizedCloudflareBridgeConfig { enabled: boolean; mode: CloudflareBridgeMode; } export interface NormalizedCloudflareCacheConfig { kind: CloudflareCacheKind; namespace: string; } export interface NormalizedCloudflareCapabilitiesConfig { github: boolean; cloudflare: boolean; artifacts: boolean; } export interface NormalizedCloudflareSyncConfig { enabled: boolean; worker: string; queue: string; workflow: string; outputDir: string; lock: string; bridge: NormalizedCloudflareBridgeConfig; runner: NormalizedCloudflareRunnerConfig; cache: NormalizedCloudflareCacheConfig; capabilities: NormalizedCloudflareCapabilitiesConfig; } export interface TaskSyncConfig { prefix?: string; runners?: "all" | SyncRunner[]; targets?: SyncTargets; jobs?: SyncSelection; tasks?: SyncSelection; scripts?: Record; } export type TaskSyncInput = boolean | TaskSyncConfig; export interface PipelineSyncConfig { command?: string; github?: GitHubSyncInput; tasks?: TaskSyncInput; cloudflare?: CloudflareSyncInput; } export interface NormalizedGitHubSyncConfig { enabled: boolean; workflow: string; lock: string; setup: Exclude; nodeVersion: string; runtime: string[]; cache: boolean; dependencyCache: boolean; dependabotAutoMerge: NormalizedDependabotAutoMergeConfig; packagePreviews: NormalizedPackagePreviewsConfig; evidence: NormalizedGitHubEvidenceConfig; bridge: NormalizedGitHubBridgeSyncConfig; pages: NormalizedGitHubPagesSyncConfig; sourceImpact: NormalizedGitHubSourceImpactConfig; attest: NormalizedGitHubAttestConfig; contract: NormalizedGitHubContractConfig; hygiene: NormalizedGitHubHygieneConfig; updateTrain: NormalizedGitHubUpdateTrainConfig; dependencyBump: NormalizedGitHubDependencyBumpConfig; } export interface NormalizedDependabotAutoMergeConfig { enabled: boolean; ecosystems: DependabotAutoMergeEcosystem[]; } export interface NormalizedPackagePreviewsConfig { enabled: boolean; package?: string; target?: string; registry: string; namespace?: string; tokenEnv: string; comment: boolean; } export interface NormalizedGitHubUpdateTrainConfig { enabled: boolean; job: string; packagePath: string; repositories: string[]; event: string; tokenEnv: string; after?: string; } export interface NormalizedGitHubDependencyBumpConfig { enabled: boolean; job: string; packages: string[]; event: string; tokenEnv: string; packageManager: GitHubDependencyBumpPackageManager; verify: string[]; success: GitHubDependencyBumpLanding; failure: Exclude; branchPrefix: string; baseBranch: string; } export interface NormalizedGitHubEvidenceConfig { enabled: boolean; job: string; paths: string[]; receiptPaths: string[]; artifactNamePrefix: string; retentionDays: number; ifNoFilesFound: EvidenceIfNoFilesFound; includeSummary: boolean; } export interface NormalizedGitHubBridgeSyncConfig { enabled: boolean; mode: GitHubBridgeMode; schedule: string | false; pullRequest: boolean; branchPrefix: string; allowedPaths: string[]; endpointVar: string; tokenEnv: string; packageVersion: string; } export interface NormalizedGitHubPagesSyncTriggersConfig { pullRequest: boolean; main: false | { branch: string; }; manual: boolean; } export interface NormalizedGitHubPagesSyncConfig extends GitHubPagesConfig { enabled: boolean; target?: string; job: string; triggers: NormalizedGitHubPagesSyncTriggersConfig; } export interface NormalizedGitHubSourceImpactConfig { enabled: boolean; jobs: JobId[]; } export interface NormalizedGitHubAttestConfig { enabled: boolean; packagePath?: string; artifacts: string[]; subjectManifest: string; sbomPath: string; evidencePath: string; requireNpmProvenance: boolean; tarballScan: boolean; githubAttestation: boolean; } export interface NormalizedGitHubContractSchemaConfig { enabled: boolean; sources: string[]; output: string; } export interface NormalizedGitHubContractConfig { enabled: boolean; mode: GitHubContractMode; job: string; api: boolean; claims: boolean; schema: NormalizedGitHubContractSchemaConfig; packagePath: string; evidenceDir: string; annotations: boolean; } export interface NormalizedGitHubHygieneConfig { enabled: boolean; mode: GitHubHygieneMode; job: string; profiles: GitHubHygieneProfile[]; releaseGate: boolean; packagePath: string; evidenceDir: string; annotations: boolean; } export interface NormalizedTaskSyncConfig { enabled: boolean; prefix: string; runners: "all" | SyncRunner[]; targets: SyncTargets; jobs: SyncSelection; tasks?: SyncSelection; scripts: Record; } export interface NormalizedPipelineSync { command: string; github: NormalizedGitHubSyncConfig; tasks: NormalizedTaskSyncConfig; cloudflare: NormalizedCloudflareSyncConfig; } export interface DependsOnDirective { kind: "async-pipeline.directive.dependsOn"; taskIds: TaskId[]; } export type TaskDirective = CacheDirective | DependsOnDirective; export interface TaskDefinition { description?: string; dependsOn?: TaskId[]; inputs?: string[]; outputs?: string[]; cache?: boolean | CacheRef | TaskCacheOptions; retry?: number | RetryPolicy; timeout?: string | number; requires?: TaskRequirements; run?: TaskRunDefinition; steps?: TaskRunItem[]; } export interface TaskGroupDefinition { [taskId: string]: TaskTreeDefinition; } export type TaskTreeDefinition = TaskDefinition | TaskGroupDefinition; export type TaskSectionDefinition = Record; export type TaskRunItem = TaskStep | TaskDirective; export type TaskRunDefinition = TaskRunItem | readonly TaskRunItem[]; export interface NormalizedTask extends Omit { id: TaskId; dependsOn: TaskId[]; steps: TaskStep[]; cache: TaskCacheOptions; retry: RetryPolicy; timeoutMs?: number; inputs: string[]; outputs: string[]; source?: TaskSourceContext; } export interface SourceBaseDefinition { pipeline?: string; prepare?: TaskStep[]; } export interface GitSourceDefinition extends SourceBaseDefinition { type: "git"; url: string; ref: string; } export interface PathSourceDefinition extends SourceBaseDefinition { type: "path"; path: string; writable?: boolean; } export type SourceDefinition = GitSourceDefinition | PathSourceDefinition; export type NormalizedSource = (Omit & { id: SourceId; pipeline: string; prepare: TaskStep[]; }) | (Omit & { id: SourceId; pipeline: string; prepare: TaskStep[]; }); export interface JobDefinition { description?: string; target: TaskId | TaskId[]; trigger?: TriggerId[]; environment?: JobEnvironment; env?: Record; requires?: JobRequirements; execution?: ExecutionProfileId; github?: GitHubJobConfig; deploy?: DeployDefinition; report?: ReportDefinition; } export interface NormalizedJob extends Omit { id: JobId; target: TaskId[]; trigger: TriggerId[]; } export type GitHubPermission = "read" | "write" | "none"; export interface CloudflarePagesDeployDefinition { kind: "cloudflare.pages"; project: string; directory: string; productionBranch?: string; } export interface CloudflareWorkerDeployDefinition { kind: "cloudflare.worker"; script: string; alias?: string; productionBranch?: string; } export type DeployDefinition = CloudflarePagesDeployDefinition | CloudflareWorkerDeployDefinition; export interface GitHubPrPreviewReportDefinition { kind: "github.prPreview"; comment?: boolean; } export interface GitHubDeploymentReportDefinition { kind: "github.deployment"; environment?: string; } export type ReportDefinition = GitHubPrPreviewReportDefinition | GitHubDeploymentReportDefinition; export type GitHubPagesBuild = { kind: "jekyll"; source: string; destination?: string; } | { kind: "static"; path: string; } | { kind: "prerender"; path: string; validateIndex?: boolean; spaFallback?: boolean; }; export interface GitHubPagesConfig { build: GitHubPagesBuild; artifactName?: string; environment?: JobEnvironment; } export interface GitHubJobConfig { environment?: string; pages?: GitHubPagesConfig; permissions?: { contents?: GitHubPermission; idToken?: "write" | "none"; /** Renders `issues: ` (issue comments need `write`). */ issues?: GitHubPermission; /** Renders `packages: ` (GitHub Packages publishing needs `write`). */ packages?: GitHubPermission; /** Renders `pull-requests: ` (commenting on a PR needs `write`). */ pullRequests?: GitHubPermission; }; /** * Runner for the generated GitHub Actions job. A string targets a hosted * runner ("ubuntu-latest"); a string array is a self-hosted label set that * a single runner must match entirely (["self-hosted", "macos", "tart"]). */ runsOn?: string | string[]; /** * Run the generated job once per entry through a GitHub Actions matrix. * Each entry follows the `runsOn` shape. Mutually exclusive with `runsOn`. */ runsOnMatrix?: Array; } export interface PipelineDefinition { name: string; env?: Record; commands?: CommandPolicy; agents?: Record; sandboxes?: Record; execution?: Record; cache?: CacheRef | CacheRegistryDefinition | CacheRegistryInput | false; namedInputs?: Record; taskDefaults?: Record>; triggers?: Record; sync?: PipelineSyncConfig; sources?: Record; tasks: TaskSectionDefinition; jobs: Record; } export interface NormalizedPipeline { name: string; env: Record; commands?: CommandPolicy; agents: Record; sandboxes: Record; execution: Record; cache: CacheRegistryDefinition; namedInputs: Record; triggers: Record; sync: NormalizedPipelineSync; sources: Record; tasks: Record; jobs: Record; } export interface TaskResult { /** Present on stored cache entries; absent inside in-memory results. */ schemaVersion?: number; id: TaskId; status: TaskStatus; startedAt?: string; finishedAt?: string; durationMs?: number; attempts: number; cacheKey?: string; cacheHit?: boolean; error?: string; metadata?: Record; } export interface ExecutionRecord { /** Record format version. Consumers should ignore fields they do not know. */ schemaVersion: number; id: string; pipelineName: string; jobId: JobId; cwd: string; /** Pid of the process that owns this run; used to detect crashed runs. */ pid?: number; startedAt: string; finishedAt?: string; status: "running" | "passed" | "failed"; mode: ExecutionMode; tasks: TaskResult[]; git?: ExecutionGitRecord; sources?: Record; } export interface ExecutionGitRecord { sha: string; branch?: string; remote?: string; upstream?: string; dirty?: boolean; pushed?: boolean; } export interface ExecutionSourceRecord { id: SourceId; type: SourceType; dir: string; pipeline: string; url?: string; path?: string; ref?: string; commit?: string; dirty?: boolean; prepare?: string[]; } export interface TaskGraphNode { id: TaskId; dependsOn: TaskId[]; dependents: TaskId[]; } export interface PipelineGraph { tasks: TaskGraphNode[]; executionOrder: TaskId[]; } export interface ParsedTaskRef { source?: SourceId; taskId: TaskId; } export interface ComposeSourcePipeline { pipeline: NormalizedPipeline; context?: TaskSourceContext; } export declare function sh(factory: DeferredShellCommandFactory): DeferredShellCommand; export declare function sh(strings: TemplateStringsArray, ...values: unknown[]): ShellCommand; export declare function agent(options: { use: AgentProfileId | EnvVarRef; prompt: string; model?: string | EnvVarRef; stdoutTo?: string; }): AgentStep; export declare function isAgentStep(step: TaskStep): step is AgentStep; export declare function isResolvedAgentStep(step: TaskStep): step is ResolvedAgentStep; export declare function task(definition: TaskDefinition): TaskDefinition; export declare function task(definition: TaskDefinition, run: TaskRunDefinition): TaskDefinition; export declare function job(definition: JobDefinition): JobDefinition; declare function envVar(name: string): EnvVarRef; declare function envVar(name: string, options: { default: string; }): EnvVarRef; declare function envVar(name: string, values: EnvVarMap, options?: { default?: string; }): EnvVarRef; export declare const env: { secret(name: string): EnvSecretRef; var: typeof envVar; }; export declare const sandbox: { host(): HostSandboxDefinition; lima(options?: Omit): LimaSandboxDefinition; docker(options: Omit): DockerSandboxDefinition; container(options: Omit): ContainerSandboxDefinition; }; export declare const execution: { local(options?: Omit): LocalExecutionProfileDefinition; github(options: Omit): GitHubExecutionProfileDefinition; cloudflare(options?: Omit): CloudflareExecutionProfileDefinition; }; export declare const cloudflare: { pages(options: Omit): CloudflarePagesDeployDefinition; worker(options: Omit): CloudflareWorkerDeployDefinition; }; export declare const github: { prPreview(options?: Omit): GitHubPrPreviewReportDefinition; deployment(options?: Omit): GitHubDeploymentReportDefinition; }; export declare const command: { policy(options?: Omit & { rules?: CommandRule[]; }): CommandPolicy; rule(options: CommandRule): CommandRule; allow(options?: { output?: CommandOutputPolicy; }): CommandAction; deny(options?: { message?: string; output?: CommandOutputPolicy; }): CommandAction; mock(options?: { code?: number; stdout?: string; stderr?: string; output?: CommandOutputPolicy; }): CommandAction; requireApproval(options?: { message?: string; output?: CommandOutputPolicy; }): CommandAction; requireEnvironment(options: { name: string; output?: CommandOutputPolicy; }): CommandAction; }; export declare const trigger: { manual(): TriggerDefinition; github(options: { events: string[]; types?: string[]; branches?: string[]; paths?: string[]; tags?: string[]; }): TriggerDefinition; cron(cron: string, options?: { timezone?: string; }): TriggerDefinition; schedule(cron: string): TriggerDefinition; }; export declare function dependsOn(...taskIds: TaskId[]): DependsOnDirective; export declare const source: { git(definition: Omit): GitSourceDefinition; path(definition: Omit): PathSourceDefinition; }; export declare function tasks(definitions: TaskSectionDefinition): TaskSectionDefinition; export declare function jobs(definitions: Record): Record; export declare function triggers(definitions: Record): Record; export declare function sources(definitions: Record): Record; export declare function taskDefaults(definitions: Record>): Record>; export declare function agents(definitions: Record): Record; export declare function sandboxes(definitions: Record): Record; export declare function definePipeline(definition: PipelineDefinition): NormalizedPipeline; export declare function normalizePipeline(definition: PipelineDefinition): NormalizedPipeline; export declare function githubConfigForJob(pipeline: NormalizedPipeline, jobDefinition: NormalizedJob): GitHubJobConfig | undefined; export declare function validatePipeline(pipeline: NormalizedPipeline): void; export declare function composePipelines(root: NormalizedPipeline, sourcePipelines: Record): NormalizedPipeline; export declare function parseTaskRef(taskRef: TaskId): ParsedTaskRef; export declare function isNamespacedTaskRef(taskRef: TaskId): boolean; export declare function namespaceTaskRef(sourceId: SourceId, taskId: TaskId): TaskId; export declare function buildGraph(pipeline: NormalizedPipeline, targets?: TaskId[]): PipelineGraph; export declare function tasksForJob(pipeline: NormalizedPipeline, jobId: JobId): PipelineGraph; export declare function expandInputs(pipeline: NormalizedPipeline, inputs: string[]): string[]; export declare function sourceUsesDefaultPipelineConfig(sourceDefinition: NormalizedSource): boolean; //# sourceMappingURL=index.d.ts.map