import { FxError, Warning } from "@microsoft/teamsfx-api"; import { Result } from "neverthrow"; import { ConditionalExpression } from "../expression/evaluateExpression"; import { RenderVars, TemplateFileEntry } from "../model/dataModel"; /** `Warning.type` for a render path left untouched because the target already had that file. */ export declare const EXISTING_FILE_SKIPPED_WARNING = "v4ExistingFileSkipped"; /** A resolved step parameter value. */ export type ParamValue = string | boolean | string[]; /** A step's author-supplied `with` block, or its resolved form. */ export type StepParams = Record; /** One `pipeline.steps` entry. `produces` is reserved for future cross-step data flow. */ export interface PipelineStep extends ConditionalExpression { step: string; with?: StepParams; produces?: string[]; } /** One render-phase file filter. Paths are target-relative output paths after `.tpl` suffix stripping. */ export interface RenderFilter extends ConditionalExpression { exclude: string[]; } /** Render-phase controls declared by `pipeline.json`. */ export interface PipelineRender { filters?: RenderFilter[]; } /** A parsed, schema-valid `pipeline.json`. */ export interface Pipeline { pipeline: string; comment?: string; render?: PipelineRender; steps: PipelineStep[]; } /** The output directory plus its pre-run file snapshot. */ export interface TargetDir { path: string; existing: string[]; } /** A render-phase path skipped because it already existed. */ export interface SkippedFile { path: string; warning: string; } /** The result of a scaffold run. */ export interface ScaffoldOutcome { written: string[]; filtered: string[]; skipped: SkippedFile[]; stepsRun: string[]; stepsSkipped: string[]; } /** A resolved named orchestration. */ export interface Orchestration { name: string; } /** Minimal manifest wrapper face needed by registered steps. */ export interface ManifestWrapper { registerDeclarativeAgentAction(teamsManifestPath: string, pluginManifestPath: string): Result; setSensitivityLabel?(path: string, id: string): Result; } /** The capabilities the executor hands each registered step's `apply`. */ export interface StepContext { write(path: string, data: Buffer): void; /** Persist regular and `SECRET_*` values through the runtime's environment boundary. */ writeEnvironment(environment: string, values: Record): Promise>; manifestWrapper(kind: string): ManifestWrapper; /** Read current bytes at a target path, or `undefined` when absent. */ read(path: string): Buffer | undefined; /** * Emit a localized, user-visible warning without failing the pipeline. The `type` is what * lets a surface decide what to do with it (summary line, notification, log only), so it * travels with the message instead of being dropped at the boundary. */ warn?(warning: Warning): void; } /** An engine-registered, whitelist-dispatched post-render step. */ export interface RegisteredStep { validateParams(resolved: StepParams): string | undefined; apply(resolved: StepParams, ctx: StepContext): Result | Promise>; } /** Narrow pipeline port; `render` is the single Mustache surface for paths and values. */ export interface PipelineRuntimePort { pipelineRegistry(pipelineName: string): Orchestration | undefined; stepRegistry(stepName: string): RegisteredStep | undefined; evalWhen(expr: string, renderVars: RenderVars): Result; render(mustache: string, renderVars: RenderVars): Result; manifestWrapper(kind: string): ManifestWrapper; warn?(warning: Warning): void; write(path: string, data: Buffer): void; writeEnvironment(environment: string, values: Record): Promise>; /** Current bytes at a path, or `undefined` when absent. */ read(path: string): Buffer | undefined; } /** `SystemError` names for engine-side pipeline breaks. */ export declare const PIPELINE_UNKNOWN_PIPELINE = "PipelineUnknownPipeline"; export declare const PIPELINE_UNKNOWN_STEP = "PipelineUnknownStep"; export declare const PIPELINE_PARAMS_VIOLATION = "PipelineParamsViolation"; export declare const PIPELINE_CROSS_STEP_REFERENCE = "PipelineCrossStepReference"; /** `UserError` name for a non-empty create target. */ export declare const REQUIRE_EMPTY_TARGET = "RequireEmptyTarget"; /** Execute one template package's pipeline against a resolved render context. */ export declare function runScaffoldPipeline(pipeline: Pipeline, content: TemplateFileEntry[], renderVars: RenderVars, targetDir: TargetDir, port: PipelineRuntimePort): Promise>; //# sourceMappingURL=runScaffoldPipeline.d.ts.map