import { FxError } from "@microsoft/teamsfx-api"; import { Result } from "neverthrow"; import { WalkHistoryEntry } from "../collectInputs/collectInputs"; import { ExpressionNode } from "../expression/evaluateExpression"; /** The worlds dispatch can hand off to. */ export type DispatchEngine = "v4" | "v3-core-method" | "surface-action"; /** One parsed `selector.json` route. */ export interface SelectorRoute { when: string; engine: DispatchEngine; templateId?: string; coreMethod?: string; action?: string; surfaces?: string[]; } /** Minimal Q1 routing question shape; presentation belongs to the prompt face. */ export interface RouteQuestion { name: string; condition?: ExpressionNode; } /** The parsed per-kind `selector.json`. */ export interface SelectorSpec { questions: RouteQuestion[]; routes: SelectorRoute[]; } /** Build a v4 membership test from the selector's own v4 routes. */ export declare function v4RouteRegistryFromSelector(spec: SelectorSpec): (templateId: string) => boolean; /** One interactive Q1 prompt outcome. */ export type PromptResult = { kind: "value"; value: string; } | { kind: "back"; }; /** Narrow selector-resolution port; package opening and language selection stay downstream. */ export interface RouteResolverPort { /** Interactive Q1 prompt for dimensions not supplied by prefill. */ prompt(question: RouteQuestion, step: number): Promise; /** Evaluate `featureFlag('…')` inside a route predicate / question condition. */ featureFlag(name: string): boolean; /** Membership test for the v4 world. */ v4Registry(templateId: string): boolean; /** Membership test for the frozen v3 core-method allow-list. */ v3CoreMethodRegistry(coreMethod: string): boolean; } /** The resolved dispatch outcome. */ export interface BuildTarget { /** The v4 template id, core method, or surface action id. */ templateId: string; /** Which world dispatch hands off to. */ engine: DispatchEngine; /** The Q1 dimension picks that produced this target. */ answers?: Record; } /** * A `BuildTarget` plus the Q1 walk state the front door retains for cross-phase * back (a superset, so existing `BuildTarget` reads are unaffected). `history` is * opaque to the front door — it is only handed back via `resume`; `promptCount` * is the number of Q1 dimensions actually prompted (Q2's `baseStep`). */ export interface SelectorWalkResult extends BuildTarget { history: WalkHistoryEntry[]; promptCount: number; } /** `UserError` name: a resolved/supplied `templateId` belongs to no world. */ export declare const BUILD_TARGET_UNKNOWN_TEMPLATE = "BuildTargetUnknownTemplate"; /** `UserError` name: a route carries the wrong engine-specific key set. */ export declare const BUILD_TARGET_MALFORMED_ROUTE = "BuildTargetMalformedRoute"; /** `UserError` name: a `v4` route's `templateId` has no descriptor. */ export declare const BUILD_TARGET_DANGLING_V4_ROUTE = "BuildTargetDanglingV4Route"; /** `UserError` name: no route predicate matched the resolved answers. */ export declare const BUILD_TARGET_NO_MATCHING_ROUTE = "BuildTargetNoMatchingRoute"; /** `UserError` name: a non-interactive walk lacks a required dimension. */ export declare const BUILD_TARGET_MISSING_DIMENSION = "BuildTargetMissingDimension"; /** `UserError` name: the user backed out of the first Q1 prompt. */ export declare const BUILD_TARGET_WALK_CANCELLED = "BuildTargetWalkCancelled"; /** Validate only a selector route's engine-specific key shape. */ export declare function validateSelectorRouteShape(route: SelectorRoute): Result; /** Resolve a create/modify selector walk into a dispatched `BuildTarget`. */ export declare function resolveBuildTarget(selector: SelectorSpec, prefilled: Record, interactive: boolean, port: RouteResolverPort, options?: { resume?: { history: WalkHistoryEntry[]; }; }): Promise>; //# sourceMappingURL=resolveBuildTarget.d.ts.map