import { FxError } from "@microsoft/teamsfx-api"; import { Result } from "neverthrow"; import { ExpressionNode } from "../expression/evaluateExpression"; /** The four worlds dispatch can hand off to. */ export type DispatchEngine = "v4" | "v3" | "v3-core-method" | "surface-action"; /** One parsed `selector.json` route. */ export interface SelectorRoute { when: string; engine: DispatchEngine; templateId?: string; v3Adapter?: 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 generator allow-list. */ v3Registry(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/v3 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; } /** `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"; /** Resolve a create/modify selector walk into a dispatched `BuildTarget`. */ export declare function resolveBuildTarget(selector: SelectorSpec, prefilled: Record, interactive: boolean, port: RouteResolverPort): Promise>; //# sourceMappingURL=resolveBuildTarget.d.ts.map