import { type ProcessInstance, type ProcessProject, type ProcessTurnStartSelection, type ProcessTurnTerminalLifecycleStatus, type ScopedSettingsSnapshot, type TurnId, type TurnProgressReport } from "@leitwerk-dev/domain"; import type { AutomaticTurnDefinition, ExternalTurnDefinition, HumanTurnDefinition, HumanTurnOperatorAttention, LlmModelPurpose, LlmOutcomeSubmission, LlmTurnDefinition, OutcomeParameterContext, ProcessEffectPlan, ProcessHumanTurnActionSpec, ProcessHumanTurnExternalActionSpec, ProcessOutcomeBranchSpec, ProcessOutcomeEffect, ProcessOutcomeExecution, ProcessRuntimeTurnContext, ProcessToolOutcomeSpec, ProcessTurnEndSpec, TurnDefinition } from "./define-process.js"; import type { Codec, ExtensionProcessDefinition, ExternalActionSource, ExternalSourceEffect, ExternalSourceEffectContext, FormDefinition, ProcessActionDefinition, ProcessLauncherAPI, ProcessLauncherDefinition, ProcessWatcherAPI, ProcessWatcherDefinition, ServerProcessAPI, TurnDiagnosticReport, UiProcessAPI, WorkerCompleteInput } from "./extension-api.js"; import type { MappedCollect, MappedCollectRouting, MappedItemYield, MappedLlmTurnSpec, MappedTurnItemContext, MappedTurnServerContext } from "./mapped-turn.js"; import type { TurnWaitPredicate } from "./turn-wait.js"; import type { OutcomeToolArrayItemSpec, OutcomeToolParameterSpec, PiBuiltInToolName, ProcessPiConfig } from "./types.js"; /** @public */ type MaybePromise = T | Promise; /** @internal */ export declare const DEFAULT_PLAN_RESULT_OUTCOME_ID: "plan_saved"; /** @internal */ export declare const DEFAULT_FLOW_PRODUCT_NAME: "default"; /** @public */ export interface FlowLlmTurn { /** @public */ id: TurnId; /** @public */ definition: LlmTurnDefinition; } /** @public */ export interface FlowAutomaticTurn { /** @public */ id: TurnId; /** @public */ definition: AutomaticTurnDefinition; } /** @public */ export interface FlowHumanTurn { /** @public */ id: TurnId; /** @public */ definition: HumanTurnDefinition; } /** @public */ export interface FlowExternalTurn { /** @public */ id: TurnId; /** @public */ definition: ExternalTurnDefinition; } /** @public */ export type FlowTurn = FlowLlmTurn | FlowAutomaticTurn | FlowHumanTurn | FlowExternalTurn | { /** @public */ id: TurnId; /** @public */ definition: TurnDefinition; }; /** @internal */ export interface PlanFieldOptions { /** @internal */ description?: string; /** @internal */ requiredErrorCode?: string; } /** @internal */ export interface PlanAcceptanceCriteriaOptions extends PlanFieldOptions { /** @internal */ minItems?: number; /** @internal */ minItemsErrorCode?: string; } export interface PlanSavedStateInput { effect: ProcessOutcomeEffect; } /** @public */ export interface FlowRepoContext { /** @internal */ key: string; /** @public */ fsPath: string; /** @internal */ workspaceClonePath: string; /** @public */ baseBranch: string; /** @public */ workBranch: string; /** @internal */ locator: string; } /** @public */ export interface FlowRepoLookup { /** @public */ get(key: string): FlowRepoContext; /** @internal */ optional(key: string): FlowRepoContext | undefined; /** @internal */ all(): FlowRepoContext[]; } /** @public */ export type FlowPromptContext = { /** @internal */ process: ProcessInstance; /** @internal */ projects: readonly ProcessProject[]; /** @public */ params: TParams; /** @public */ state: TState; /** @internal */ workspaceRoot?: string; /** @internal */ prompts: { /** @internal */ initial: string; }; /** @public */ input: Readonly>>; /** @internal */ repo: FlowRepoLookup; } & ([TPrepared] extends [undefined] ? { /** @internal */ prepared?: undefined; } : { /** @internal */ prepared: TPrepared; }); /** @public */ export interface FlowAutomaticRunContext { /** Immutable non-secret settings captured for this turn. @public */ readonly scopedSettings?: ScopedSettingsSnapshot; /** @public */ process: ProcessInstance; /** @public */ projects: readonly ProcessProject[]; /** @public */ params: TParams; /** @public */ state: TState; /** @public */ workspaceRoot?: string; /** @public */ repo: FlowRepoLookup; /** @public */ callIntegrationTool(name: string, args: Record): Promise; /** @public */ reportProgress(report: TurnProgressReport): void; /** Append a non-secret worker diagnostic for this turn attempt. @internal */ reportDiagnostic(report: TurnDiagnosticReport): void; } /** Worker context for correcting a submission before accepting it. @public */ export interface FlowOutcomeValidationContext extends FlowAutomaticRunContext { /** Preparation captured before prompting. @public */ prepared?: unknown; } /** @public */ export type FlowLlmPreparationContext = FlowAutomaticRunContext; /** @public */ interface FlowOutcomeEffectContext { /** @public */ process: ProcessInstance; /** @internal */ projects: readonly ProcessProject[]; /** @internal */ params: TParams; /** @public */ state: TState; /** @internal */ output: { /** @internal */ content: string | null; } | null; } /** @public */ export interface FlowLlmOutcomeEffectContext extends FlowOutcomeEffectContext { } /** @public */ export interface FlowAutomaticOutcomeEffectContext extends FlowOutcomeEffectContext { } /** @internal */ export interface FlowExternalSourceContext = Record> extends ExternalSourceEffectContext { } /** @public */ type FlowOutcomeEffectInput = { /** @public */ ctx: TContext; /** @public */ event: ProcessOutcomeExecution["event"]; /** @internal */ turnId: TurnId; /** @internal */ outcome: string; }; /** @public */ type FlowOutcomeEffect = (input: FlowOutcomeEffectInput) => MaybePromise | undefined>; /** @public */ type FlowOutcomeStateEffect = (input: FlowOutcomeEffectInput) => MaybePromise; /** @internal */ export declare function createFlowPromptContext(ctx: ProcessRuntimeTurnContext, consumedProducts: readonly TConsumedProducts[], optionalConsumedProducts?: readonly string[]): FlowPromptContext; /** @internal */ export declare function createFlowAutomaticRunContext(ctx: ProcessRuntimeTurnContext): FlowAutomaticRunContext; /** @public */ declare class RouteAndEffectBuilder { /** @internal */ protected target: FlowTargetSpec; /** @internal */ protected flowEffect: FlowOutcomeEffect | undefined; /** @internal */ protected setTarget(next: FlowTargetSpec): this; /** @public */ to(turnId: TurnId): this; /** @public */ complete(): this; /** @public */ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this; /** @internal */ stay(): this; /** @public */ state(fn: FlowOutcomeStateEffect): this; /** @public */ effect(fn: FlowOutcomeEffect): this; /** @internal */ getEffect(): FlowOutcomeEffect | undefined; /** @internal */ hasRoute(): boolean; /** @internal */ buildRouteTarget(): Pick; } /** @internal */ export type FlowTargetSpec = { /** @internal */ to: TurnId; } | { /** @internal */ complete: true; } | { /** @internal */ lifecycleStatus: ProcessTurnTerminalLifecycleStatus; } | null; /** @public */ interface ParameterOptions extends Partial> { /** @public */ description?: string; /** @internal */ requiredErrorCode?: string; } /** @public */ interface ArrayParameterOptions extends ParameterOptions { /** @public */ items?: OutcomeToolParameterSpec["items"]; } /** @internal */ interface EnumParameterOptions extends ParameterOptions { /** @internal */ values?: readonly string[]; } /** @public */ interface MarkdownParameterOptions extends ParameterOptions { /** @public */ publish?: true; } /** @public */ declare class OutcomeParametersBuilder { /** @internal */ protected outcomeDescription: string | null; /** @internal */ protected parameters: Record; /** @internal */ protected summaryParameter: string | null; private enforceSchema; /** @internal */ protected parameterResolver?: (ctx: OutcomeParameterContext) => Record; /** Enforce a closed schema with no optional properties at supported providers. @public */ strictSchema(): this; /** Declare alternatives for one argument. @public */ union(name: string, variants: readonly OutcomeToolArrayItemSpec[], options?: string | ParameterOptions): this; /** Optional concise result publication, separate from the full Markdown. @public */ resultSummary(name?: string): this; /** @internal */ protected buildParameterSpec(kind: string): Pick; /** @public */ description(text: string): this; /** @internal */ parameter(name: string, spec: OutcomeToolParameterSpec): this; private withRequired; /** @internal */ protected typedParameter(name: string, type: OutcomeToolParameterSpec["type"], options?: string | ArrayParameterOptions): this; /** @public */ string(name: string, options?: string | ParameterOptions): this; /** @public */ requiredString(name: string, options?: string | ParameterOptions): this; /** @internal */ number(name: string, options?: string | ParameterOptions): this; /** @public */ requiredNumber(name: string, options?: string | ParameterOptions): this; /** @internal */ boolean(name: string, options?: string | ParameterOptions): this; /** @public */ requiredBoolean(name: string, options?: string | ParameterOptions): this; /** @internal */ stringArray(name: string, options?: string | ArrayParameterOptions): this; /** @public */ requiredStringArray(name: string, options?: string | ArrayParameterOptions): this; /** @internal */ enum(name: string, valuesOrOptions: readonly string[] | EnumParameterOptions): this; /** @public */ object(name: string, options?: string | ParameterOptions): this; /** @internal */ array(name: string, options?: string | ArrayParameterOptions): this; /** @public */ requiredArray(name: string, options?: string | ArrayParameterOptions): this; } /** @public */ declare class ParameterizedOutcomeBuilder extends OutcomeParametersBuilder { private readonly route; private publishedMarkdownParameter; /** @public */ to(turnId: TurnId): this; /** @public */ complete(): this; /** @public */ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this; /** @internal */ stay(): this; /** @public */ state(fn: FlowOutcomeStateEffect): this; /** @public */ effect(fn: FlowOutcomeEffect): this; /** @internal */ hasRoute(): boolean; /** @internal */ protected get flowEffect(): FlowOutcomeEffect | undefined; /** @internal */ protected buildRouteTarget(): Pick, "to" | "complete" | "lifecycleStatus">; /** @internal */ protected buildParameterSpec(kind: string): ProcessToolOutcomeSpec; /** @public */ markdown(name: string, options?: string | MarkdownParameterOptions): this; } /** @public */ export declare class OutcomeToolBuilder extends ParameterizedOutcomeBuilder> { /** Pure synchronous resolution at turn-start preparation. @public */ resolveParameters(fn: (ctx: OutcomeParameterContext) => Record): this; private stateRouting; /** @public */ routeByState(branches: Record, choose: (input: FlowOutcomeEffectInput>) => MaybePromise): this; /** @internal */ build(): ProcessToolOutcomeSpec; } /** @public */ export declare class AutomaticOutcomeBuilder extends ParameterizedOutcomeBuilder> { private waits; /** @public */ wait(): this; /** @internal */ build(): ProcessToolOutcomeSpec; } /** @internal */ export declare class PlanResultBuilder extends RouteAndEffectBuilder> { private resultDescription; private summarySpec; private acceptanceCriteriaSpec; private reviewTurnId; /** @internal */ description(text: string): this; /** @internal */ summary(options?: string | PlanFieldOptions): this; /** @internal */ acceptanceCriteria(options?: string | PlanAcceptanceCriteriaOptions): this; /** @internal */ review(turnId: TurnId): this; /** @internal */ buildOutcome(): ProcessToolOutcomeSpec; } /** @public */ export declare class LlmTurnEndBuilder extends RouteAndEffectBuilder> implements FlowLlmTurn { private readonly outcomeId; private readonly parent?; /** @internal */ protected readonly builderName: string; /** @internal */ constructor(outcomeId: string, parent?: FlowLlmTurn | undefined); private get turn(); /** @internal */ get id(): TurnId; /** @internal */ get definition(): LlmTurnDefinition; /** @internal */ build(): ProcessTurnEndSpec; } /** @public */ export declare class PublishedResultBuilder extends LlmTurnEndBuilder { /** @internal */ protected readonly builderName = "Published result"; /** @internal */ buildTurnEnd(): ProcessTurnEndSpec; } /** @public */ declare abstract class DescribedTurnBuilder { /** @internal */ protected readonly turnId: TurnId; /** @internal */ protected turnDescription: string | null; /** @internal */ constructor( /** @internal */ turnId: TurnId); /** @internal */ get id(): TurnId; /** @public */ description(description: string): this; } /** @public */ declare abstract class ExternalActionTurnBuilder extends DescribedTurnBuilder { /** @internal */ protected abstract readonly turnKind: "LLM" | "Automatic" | "Human"; private externalActionBuilders; /** @public */ externalAction = Record>(externalActionId: string, source: ExternalActionSource, configure: (external: ExternalActionBuilder) => ExternalActionBuilder | undefined): this; /** @internal */ protected buildExternalActions(): Record> | undefined; } /** LLM authoring families used to preserve fluent context and completion types. @public */ type LlmBuilderFamily = { /** @public */ kind: "ordinary"; } | { /** @public */ kind: "mapped"; /** @public */ item: unknown; /** @public */ result: unknown; }; /** Active-item context supplied by an LLM authoring family. @public */ type LlmItemContext = TFamily extends { kind: "mapped"; item: infer TItem; } ? MappedTurnItemContext : Record; /** Preserve the concrete completion API when preparation or products refine its types. @public */ type ConfiguredLlmBuilder = TFamily extends { kind: "mapped"; item: infer TItem; result: infer TResult; } ? MappedLlmFlowBuilder : LlmFlowBuilder; /** @public */ declare abstract class LlmConfigurationBuilder extends ExternalActionTurnBuilder { /** @internal */ protected readonly turnKind = "LLM"; private readonly configuration; /** Wait on the server before this turn may allocate a worker. @public */ waitFor(predicate: TurnWaitPredicate): this; private promptBuilder; private readonly consumedProductNames; private readonly optionalConsumedProductNames; /** @internal */ protected abstract itemContext(ctx: ProcessRuntimeTurnContext): LlmItemContext; /** @public */ executionPurpose(purpose: string): this; /** @internal */ modelPurpose(purpose: LlmModelPurpose): this; /** @public */ tools(...tools: readonly PiBuiltInToolName[]): this; /** @public */ integrationTools(...tools: readonly string[]): this; /** @public */ resolveIntegrationTools(resolver: (params: TParams, state: TState) => readonly string[]): this; /** @public */ prepare(fn: (ctx: FlowLlmPreparationContext & LlmItemContext) => MaybePromise): ConfiguredLlmBuilder; /** Return correction errors before accepting an outcome. @public */ validateOutcome(fn: (ctx: FlowOutcomeValidationContext & LlmItemContext, outcome: LlmOutcomeSubmission) => MaybePromise): this; /** Enable durable questions, optionally constrained by captured input. @public */ askQuestions(when?: (ctx: FlowPromptContext & LlmItemContext) => boolean): this; /** @public */ freshPrimary(): this; /** @internal */ freshSeededPrimary(): this; /** @public */ fullPrimary(): this; /** @internal */ rootBranchReview(): this; /** @public */ continueFromPrimaryLeaf(): this; /** @internal */ continueFromReviewBranch(): this; /** @internal */ continueFromProductBranch(productName: string, fallback?: ProcessTurnStartSelection): this; /** @internal */ startFromReviewBranch(): this; /** @internal */ startFromProductBranch(productName: string, fallback?: ProcessTurnStartSelection): this; /** @internal */ startFromRoot(): this; /** @public */ consume(productName: TProductName): ConfiguredLlmBuilder; /** @public */ optionalConsume(productName: TProductName): ConfiguredLlmBuilder; private refineContext; /** @public */ buildPrompt(fn: (ctx: FlowPromptContext & LlmItemContext) => MaybePromise): this; /** @public */ prompt(prompt: string | ((ctx: ProcessRuntimeTurnContext) => MaybePromise)): this; /** @internal */ protected buildBaseDefinition(): Omit, "outcomes" | "turnEnd" | "forEach">; } /** @public */ export declare class LlmFlowBuilder extends LlmConfigurationBuilder implements FlowLlmTurn { private publishedResult; private endResult; private outcomeToolBuilders; /** @internal */ protected itemContext(): Record; /** @public */ publish(productName: string): PublishedResultBuilder; /** @public */ end(outcomeId: string): LlmTurnEndBuilder; /** @public */ outcomeTool(id: string, configure: (tool: OutcomeToolBuilder) => OutcomeToolBuilder | undefined): this; /** @internal */ producesPlan(configure: (plan: PlanResultBuilder) => PlanResultBuilder): FlowLlmTurn; /** @internal */ get definition(): LlmTurnDefinition; } /** Item selection for `flow.mappedLlm(...)`. @public */ export type FlowForEachOptions = Pick, "items" | "itemCodec" | "resultCodec" | "key" | "label" | "stateAfterSnapshot">; /** @public */ export type FlowMappedPromptContext = FlowPromptContext & MappedTurnItemContext; /** @public */ export type FlowMappedPreparationContext = FlowLlmPreparationContext & MappedTurnItemContext; /** * Outcome of one mapped item. It declares parameters and yields the item's * result; it cannot route, change process state, or publish products. * @public */ export declare class MappedOutcomeBuilder extends OutcomeParametersBuilder { /** Resolve parameters from captured state and the frozen mapped item. @public */ resolveParameters(fn: (ctx: OutcomeParameterContext & MappedTurnItemContext) => Record): this; private yieldResult; /** Map this outcome to the item's typed result. @public */ yield(fn: MappedItemYield): this; /** @internal */ build(): { /** @internal */ tool: ProcessToolOutcomeSpec; /** @internal */ yieldResult: MappedItemYield; }; } /** Routes a mapped turn once, after all item results are collected. @public */ export declare class MappedCollectBuilder implements FlowLlmTurn { private readonly turn; private readonly setRouting; /** @internal */ constructor(turn: FlowLlmTurn, setRouting: (routing: MappedCollectRouting) => void); /** @internal */ get id(): TurnId; /** @internal */ get definition(): LlmTurnDefinition; /** @public */ to(turnId: TurnId): this; /** @public */ complete(): this; /** @public */ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this; /** Choose the next turn from the collected state. @public */ routeByState(branches: Record, choose: (ctx: MappedTurnServerContext) => MaybePromise): this; } /** * LLM turn that runs once per frozen item. Business state and routing belong * to `.collect(...)`. * @public */ export declare class MappedLlmFlowBuilder extends LlmConfigurationBuilder implements FlowLlmTurn { private readonly items; private readonly outcomes; private collection; private routing; /** @internal */ constructor(turnId: TurnId, items: FlowForEachOptions); /** @internal */ protected itemContext(ctx: ProcessRuntimeTurnContext): MappedTurnItemContext; /** @public */ outcomeTool(id: string, configure: (outcome: MappedOutcomeBuilder) => MappedOutcomeBuilder | undefined): this; /** Combine ordered item results into process state, once. @public */ collect(fn: MappedCollect): MappedCollectBuilder; /** @internal */ get definition(): LlmTurnDefinition; } /** @public */ export declare class AutomaticFlowBuilder extends ExternalActionTurnBuilder implements FlowAutomaticTurn { /** @internal */ protected readonly turnKind = "Automatic"; private runFn; private outcomeBuilders; private availableIntegrationTools; private waitPredicate; /** Wait on the server before this turn may allocate a worker. @public */ waitFor(predicate: TurnWaitPredicate): this; /** @public */ run(fn: (ctx: FlowAutomaticRunContext) => MaybePromise>): this; /** @public */ integrationTools(...tools: readonly string[]): this; /** @public */ outcome(id: string, configure: (outcome: AutomaticOutcomeBuilder) => AutomaticOutcomeBuilder | undefined): this; /** @internal */ get definition(): AutomaticTurnDefinition; } /** @public */ export declare class HumanActionBuilder { private readonly actionId; private spec; /** @internal */ constructor(actionId: string); /** @public */ label(label: string): this; /** @internal */ description(description: string): this; /** @public */ acceptanceState(state: ProcessHumanTurnActionSpec["acceptanceState"]): this; /** @public */ form(form: FormDefinition): this; /** @public */ to(turnId: TurnId): this; /** @internal */ complete(): this; /** @public */ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this; /** @internal */ trigger(trigger: string): this; /** @internal */ schedulable(value?: boolean): this; /** @public */ effect(effect: ProcessHumanTurnActionSpec["effect"]): this; /** @internal */ build(): ProcessHumanTurnActionSpec; } /** @public */ export declare class ExternalActionBuilder = Record> { private spec; /** @internal */ constructor(actionId: string, source: ExternalActionSource); /** @public */ label(label: string): this; /** @public */ description(description: string): this; /** @public */ when(condition: NonNullable["when"]>): this; /** @public */ to(turnId: TurnId): this; /** @internal */ complete(): this; /** @public */ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this; /** @internal */ publishInput(productName: string, options: { /** @internal */ inputField: string; }): this; /** @public */ effect(effect: ExternalSourceEffect): this; /** @internal */ build(): ProcessHumanTurnExternalActionSpec; } /** @public */ export declare class HumanFlowBuilder extends ExternalActionTurnBuilder implements FlowHumanTurn { /** @internal */ protected readonly turnKind = "Human"; private readonly metadata; private actions; /** @public */ get definition(): HumanTurnDefinition; /** @public */ reviewProduct(productName: string): this; /** @public */ operatorAttention(attention: HumanTurnOperatorAttention): this; /** @internal */ commentary(commentary: string): this; /** @internal */ notesFields(notes: HumanTurnDefinition["notesFields"]): this; /** @public */ action(actionId: string, configure: (action: HumanActionBuilder) => HumanActionBuilder | undefined): this; } /** @public */ export declare class ExternalRouteBuilder = Record> implements FlowExternalTurn { private readonly parent; private readonly source; private externalEffect; private target; /** @internal */ constructor(parent: ExternalFlowBuilder, source: ExternalActionSource); /** @internal */ get id(): TurnId; /** @internal */ get definition(): ExternalTurnDefinition; private setTarget; /** @public */ to(turnId: TurnId): this; /** @internal */ complete(): this; /** @internal */ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this; /** @internal */ state(fn: (input: { /** @internal */ ctx: FlowExternalSourceContext; /** @internal */ event: TEvent; /** @internal */ input: TInput; }) => MaybePromise): this; /** @internal */ effect(fn: (input: { /** @internal */ ctx: FlowExternalSourceContext; /** @internal */ event: TEvent; /** @internal */ input: TInput; }) => MaybePromise | undefined>): this; /** @internal */ build(): { /** @internal */ effect?: ExternalSourceEffect | undefined; /** @internal */ source: ExternalActionSource; } | { /** @internal */ effect?: ExternalSourceEffect | undefined; /** @internal */ to: TurnId; /** @internal */ source: ExternalActionSource; } | { /** @internal */ effect?: ExternalSourceEffect | undefined; /** @internal */ complete: true; /** @internal */ source: ExternalActionSource; } | { /** @internal */ effect?: ExternalSourceEffect | undefined; /** @internal */ lifecycleStatus: ProcessTurnTerminalLifecycleStatus; /** @internal */ source: ExternalActionSource; }; } /** @public */ export declare class ExternalFlowBuilder extends DescribedTurnBuilder implements FlowExternalTurn { private routeBuilders; /** @internal */ get definition(): ExternalTurnDefinition; /** @public */ from = Record>(source: ExternalActionSource): ExternalRouteBuilder; } /** @public */ type Hook = (api: TApi) => void; /** @public */ export declare abstract class FlowComponentBuilder { /** @internal */ readonly turns: FlowTurn[]; /** @internal */ readonly serverHooks: Hook>[]; /** @internal */ readonly uiHooks: Hook>[]; /** @internal */ readonly launcherHooks: Hook>[]; /** @internal */ readonly watcherHooks: Hook>[]; /** @public */ turn(turn: FlowTurn): this; /** @internal */ server(hook: Hook>): this; /** @internal */ action(definition: ProcessActionDefinition): this; /** @internal */ ui(hook: Hook>): this; /** @public */ launcher(definitionOrHook: ProcessLauncherDefinition | Hook>): this; /** @public */ watcher(definitionOrHook: ProcessWatcherDefinition | Hook>): this; } /** @public */ export declare class FlowFragmentBuilder extends FlowComponentBuilder { /** @internal */ readonly name: string; /** @internal */ constructor(name: string); } /** @public */ export declare class FlowProcessBuilder extends FlowComponentBuilder { private readonly processId; private readonly configuration; private readonly alternateEntryTurnIds; /** @internal */ constructor(processId: string); /** @public */ displayName(displayName: string): this; /** @public */ entry(turnId: TurnId): this; /** Declare an additional turn that launchers may select as the first turn. @internal */ alternateEntry(turnId: TurnId): this; /** * Declare the happy path: the ordered spine of turns a successful run walks * through. Flow diagrams render this as the main line. Must start at the entry * turn and reference only declared turns without repeats. */ /** @public */ happyPath(...turnIds: readonly TurnId[]): this; /** @public */ codecs(input: { /** @public */ params: Codec; /** @public */ state: Codec; }): this; /** @public */ initialState(fn: (params: TParams) => TState): this; /** @public */ repositoryCredentials(fn: NonNullable["repositoryCredentials"]>): this; /** Resolve new process-volume capacity on the server; operator configuration wins. @internal */ resolveStorageSize(fn: NonNullable["resolveStorageSize"]>): this; /** @public */ piConfig(config: ProcessPiConfig): this; /** Declare runner-provided process runtime capabilities. @public */ runtime(capabilities: { /** @internal */ developmentTools?: boolean; /** @public */ docker?: boolean; /** @internal */ repositoryCheckout?: "eager" | "on_demand" | "none"; }): this; /** @internal */ use(fragment: FlowFragmentBuilder): this; /** @public */ define(): ExtensionProcessDefinition; } /** @public */ export declare const flow: { /** @public */ llm(turnId: TurnId): LlmFlowBuilder; /** Run an LLM turn sequentially over frozen items, then collect and route once. @public */ mappedLlm(turnId: TurnId, items: FlowForEachOptions): MappedLlmFlowBuilder; /** @public */ automatic(turnId: TurnId): AutomaticFlowBuilder; /** @public */ human(turnId: TurnId): HumanFlowBuilder; /** @public */ external(turnId: TurnId): ExternalFlowBuilder; /** @public */ fragment(name: string): FlowFragmentBuilder; /** @public */ process(processId: string): FlowProcessBuilder; }; export {}; //# sourceMappingURL=flow.d.ts.map