/** * Placeholder type system — validation, defaults, type coercion. * * Supports 8 types: text, multiline, secret, number, boolean, enum, oauth, instance-picker. * * Each type defines: * - Validation rules * - Default value handling * - Coercion from string input (CLI prompting returns strings) * * The `instance-picker` type queries the LocalIndex for available instances * matching a filter (kind, defRef prefix). * * @docLink packages/library/concepts#placeholder-system */ import type { Placeholder } from "@skaile/workspaces/types/manifests"; import type { IAssetIndex } from "../library.js"; /** * Result of validating a single placeholder value. * * @docLink packages/library/concepts#placeholder-system */ export interface PlaceholderValidationResult { /** Whether the value passed validation. */ valid: boolean; /** Validation error messages (empty when valid). */ errors: string[]; /** Coerced value (type-appropriate). */ value?: unknown; } /** * Filter options for the `instance-picker` placeholder type. * * @docLink packages/library/concepts#placeholder-system */ export interface InstancePickerOptions { /** Filter instances by asset kind. */ kind?: string; /** Filter instances by defRef prefix. */ defRefPrefix?: string; } /** * A selectable instance entry returned by {@link queryInstancePickerChoices}. * * @docLink packages/library/concepts#placeholder-system */ export interface InstancePickerChoice { /** UUID of the selectable instance. */ instanceId: string; /** Asset definition ref for the instance. */ defRef: string; /** Human-readable display label. */ label: string; } /** * Validate a single placeholder value against its schema. * * @param placeholder - The placeholder definition. * @param value - The user-provided value (may be undefined if optional). * @returns Validation result with coerced value. * @docLink packages/library/concepts#placeholder-system */ export declare function validatePlaceholder(placeholder: Placeholder, value: unknown): PlaceholderValidationResult; /** * Validate all placeholders for an item. * * @param placeholders - Array of placeholder definitions. * @param inputs - Map of key to user-provided value. * @returns Map of key to validated value plus aggregate errors. * @docLink packages/library/concepts#placeholder-system */ export declare function validateAllPlaceholders(placeholders: Placeholder[], inputs: Record): { valid: boolean; values: Record; errors: string[]; }; /** * Query available instances for an `instance-picker` placeholder. * * @param library - The library to query. * @param options - Optional filter by kind or defRef prefix. * @returns Available instance choices for display in a CLI prompt. * @docLink packages/library/concepts#placeholder-system */ export declare function queryInstancePickerChoices(library: IAssetIndex, options?: InstancePickerOptions): Promise; /** * Get the effective default value for a placeholder. * * @param placeholder - The placeholder definition. * @returns The declared default, or undefined if none. * @docLink packages/library/concepts#placeholder-system */ export declare function getDefaultValue(placeholder: Placeholder): unknown; /** * Check if a placeholder holds a secret value (should be routed through SecretsRouter). * * Returns true for `secret` and `oauth` types. * * @param placeholder - The placeholder definition. * @docLink packages/library/concepts#placeholder-system */ export declare function isSecretPlaceholder(placeholder: Placeholder): boolean; //# sourceMappingURL=placeholders.d.ts.map