import { mergeWorkspaceYamlListItems, mergeWorkspaceYamlSections } from "./workspace-yaml.js"; import { parseWorkspaceScope } from "./workspacify.js"; declare const REPO = "BuilderIO/agent-native"; declare const TEMPLATES_DIR = "templates"; export declare class ValidationError extends Error { constructor(message: string); } declare class CreateWizardCancelledError extends Error { constructor(); } export interface CreateAppOptions { template?: string; standalone?: boolean; noInstall?: boolean; forceWorkspace?: boolean; inPlace?: boolean; _communityAppPicker?: (apps: CommunityWorkspaceAppOption[]) => Promise; } export declare function runCreateCommand(name?: string, opts?: CreateAppOptions): Promise; export declare function createApp(name?: string, opts?: CreateAppOptions): Promise; declare function startShapePromptOptions(): { message: string; initialValue: string; options: { value: string; label: string; hint: string; }[]; }; interface CommunityWorkspaceAppOption { name: string; label: string; } declare function workspaceAppNameForTemplateSelection(templateName: string): string; declare function scaffoldWorkspaceRoot(targetDir: string, name: string): Promise; export declare function addAppToWorkspace(name?: string, opts?: CreateAppOptions): Promise; declare function scaffoldOneAppIntoWorkspace(workspace: { workspaceRoot: string; workspaceCoreName: string; }, appName: string, templateName: string, clack: typeof import("@clack/prompts"), showOutro?: boolean, appPicker?: (apps: CommunityWorkspaceAppOption[]) => Promise, scaffoldTemplate?: typeof scaffoldAppTemplate, prepareWorkspaceOverrides?: typeof prepareLocalWorkspaceOverrides): Promise; declare function standaloneTemplatePromptOptions(): { value: string; label: string; hint: string; }[]; type RepoDiscovery = { state: "inside"; root: string; } | { state: "outside"; } | { state: "unknown"; reason: string; }; declare function discoverEnclosingRepo(dir: string): RepoDiscovery; export interface ScaffoldTemplateResolution { templateRef?: string; templateSource?: "github" | "bundled" | "local-checkout"; sourceIdentity?: ScaffoldSourceIdentity; communityTemplate?: { source: string; ref: string; app?: string; }; } interface ScaffoldSourceIdentity { appName: string; appTitle: string; } interface ScaffoldAppTemplateOptions { shape?: "standalone" | "workspace"; destinationAppName?: string; targetWorkspaceCoreName?: string; selectCommunityWorkspaceApp?: (apps: CommunityWorkspaceAppOption[]) => Promise; } export interface ScaffoldProvenance extends ScaffoldTemplateResolution { shape?: "workspace" | "standalone"; } declare function scaffoldAppTemplate(targetDir: string, template: string, options?: ScaffoldAppTemplateOptions): Promise; declare function removeWorkspaceOnlyTemplateWiring(appDir: string): void; /** Copies a bundled template's source tree, resolving template layers. */ declare function copyTemplateTree(templateDir: string, dest: string): void; declare function localTemplateSourceKind(localTemplate: string): "bundled" | "local-checkout"; declare function templateSourceName(name: string): string; declare function findLocalTemplate(name: string): string | undefined; declare function findLocalTemplateFrom(startDir: string, name: string): string | undefined; declare function normalizeTemplateName(template: string): string; interface CommunityTemplateSelection { repo: string; app?: string; ref?: string; canonical: string; } declare function parseCommunityTemplateSelection(selection: string): CommunityTemplateSelection; declare function parseCommunityTemplateSelection(selection: string, required: true): CommunityTemplateSelection; declare function parseCommunityTemplateSelection(selection: string, required: false): CommunityTemplateSelection | undefined; declare function communityTemplateTrustMessage(selection: string): string | undefined; declare function ensureLocalPackageBuildOutputs(packageDir: string): void; declare function scaffoldRequiredPackages(templateNames: string[], workspaceRoot: string): Promise; declare function ensureGuardedScaffold(appDir: string): void; declare function postProcessStandalone(name: string, targetDir: string, templateName?: string, resolution?: ScaffoldTemplateResolution): void; export declare function _addConfiguredFeatureDependencies(appDir: string, workspaceRoot?: string): void; export declare function detectWorkspace(startDir: string): { workspaceRoot: string; workspaceCoreName: string; } | null; export { parseWorkspaceScope }; /** @internal — exported for E2E tests */ export { mergeWorkspaceYamlSections as _mergeWorkspaceYamlSections, scaffoldWorkspaceRoot as _scaffoldWorkspaceRoot, mergeWorkspaceYamlListItems as _mergeWorkspaceYamlListItems, scaffoldOneAppIntoWorkspace as _scaffoldOneAppIntoWorkspace, CreateWizardCancelledError as _CreateWizardCancelledError, ensureGuardedScaffold as _ensureGuardedScaffold, scaffoldAppTemplate as _scaffoldAppTemplate, scaffoldRequiredPackages as _scaffoldRequiredPackages, postProcessStandalone as _postProcessStandalone, loadCatalog as _loadCatalog, fixPackageJsonName as _fixPackageJsonName, renameGitignore as _renameGitignore, discoverEnclosingRepo as _discoverEnclosingRepo, rewriteNetlifyToml as _rewriteNetlifyToml, getCoreDependencyVersion as _getCoreDependencyVersion, getDispatchDependencyVersion as _getDispatchDependencyVersion, getOtelDependencyVersion as _getOtelDependencyVersion, getToolkitDependencyVersion as _getToolkitDependencyVersion, getAgentKitDependencyVersion as _getAgentKitDependencyVersion, prepareLocalWorkspaceOverrides as _prepareLocalWorkspaceOverrides, ensureLocalPackageBuildOutputs as _ensureLocalPackageBuildOutputs, getCorePackageVersion as _getCorePackageVersion, getGitHubTemplateRef as _getGitHubTemplateRef, getGitHubTemplateRefCandidates as _getGitHubTemplateRefCandidates, githubTarballUrl as _githubTarballUrl, findLocalTemplateFrom as _findLocalTemplateFrom, workspaceAppNameForTemplateSelection as _workspaceAppNameForTemplateSelection, startShapePromptOptions as _startShapePromptOptions, standaloneTemplatePromptOptions as _standaloneTemplatePromptOptions, parseCommunityTemplateSelection as _parseCommunityTemplateSelection, communityTemplateTrustMessage as _communityTemplateTrustMessage, communityTemplateTarballUrl as _communityTemplateTarballUrl, assertCommunityTemplateRoot as _assertCommunityTemplateRoot, assertSafeCommunityArchiveListing as _assertSafeCommunityArchiveListing, assertCommunityArchiveLogicalSize as _assertCommunityArchiveLogicalSize, validateCommunityArchive as _validateCommunityArchive, resolveCommunityTemplateSource as _resolveCommunityTemplateSource, discoverCommunityWorkspaceApps as _discoverCommunityWorkspaceApps, normalizeCommunityWorkspaceAppDependencies as _normalizeCommunityWorkspaceAppDependencies, shouldSkipScaffoldEntry as _shouldSkipScaffoldEntry, removeWorkspaceOnlyTemplateWiring as _removeWorkspaceOnlyTemplateWiring, tarExtractArgs as _tarExtractArgs, extractTarball as _extractTarball, materializeArchiveSymlinks as _materializeArchiveSymlinks, downloadGitHubSubdir as _downloadGitHubSubdir, findLocalTemplate as _findLocalTemplate, templateSourceName as _templateSourceName, normalizeTemplateName as _normalizeTemplateName, appTitleForScaffold as _appTitleForScaffold, replacePlaceholders as _replacePlaceholders, rewriteTrackingAppId as _rewriteTrackingAppId, rewriteAgentChatAppId as _rewriteAgentChatAppId, applyScaffoldIdentity as _applyScaffoldIdentity, ensureScaffoldEmailBrandingConfig as _ensureScaffoldEmailBrandingConfig, fixWebManifestName as _fixWebManifestName, copyDir as _copyDir, copyTemplateTree as _copyTemplateTree, localTemplateSourceKind as _localTemplateSourceKind, REPO as _REPO, TEMPLATES_DIR as _TEMPLATES_DIR, }; declare function tarExtractArgs(tarPath: string, destDir: string, options?: { skipAgentSymlinks?: boolean; untrustedCommunityArchive?: boolean; additionalExcludes?: string[]; }): string[]; interface ArchiveSymlink { archivePath: string; target: string; } declare function materializeArchiveSymlinks(destDir: string, symlinks: ArchiveSymlink[]): void; declare function extractTarball(tarPath: string, destDir: string, options?: { skipAgentSymlinks?: boolean; untrustedCommunityArchive?: boolean; }): void; export declare function _downloadToFile(url: string, tarPath: string, maxBytes?: number): Promise; export declare function _downloadAndExtract(url: string, destDir: string, options?: { skipAgentSymlinks?: boolean; untrustedCommunityArchive?: boolean; }): Promise; declare function validateCommunityArchive(tarPath: string, limits?: { maxExpandedBytes?: number; maxEntries?: number; }): Promise; declare function assertCommunityArchiveLogicalSize(listing: string, maxBytes: number): void; declare function assertSafeCommunityArchiveListing(listing: string): void; declare function downloadGitHubSubdir(repo: string, subdir: string, targetDir: string, refOverride?: string[]): Promise; declare function communityTemplateTarballUrl(repo: string, ref: string): string; declare function assertCommunityTemplateRoot(targetDir: string, repo: string): void; interface ResolvedCommunityTemplateSource { sourceDir: string; sourceIdentity: ScaffoldSourceIdentity; app?: string; workspaceRoot?: string; } declare function resolveCommunityTemplateSource(stagingDir: string, selection: CommunityTemplateSelection, options?: ScaffoldAppTemplateOptions): Promise; interface DiscoveredCommunityWorkspaceApp extends CommunityWorkspaceAppOption { dir: string; sourceIdentity: ScaffoldSourceIdentity; } declare function discoverCommunityWorkspaceApps(workspaceRoot: string): DiscoveredCommunityWorkspaceApp[]; declare function normalizeCommunityWorkspaceAppDependencies(appDir: string, sourceWorkspaceRoot: string, options: { shape?: "standalone" | "workspace"; destinationAppName: string; targetWorkspaceCoreName?: string; sourceIdentity: ScaffoldSourceIdentity; }): void; declare function githubTarballUrl(repo: string, ref: string, kind: "branch" | "tag"): string; declare function loadCatalog(): Record; declare function appTitleForScaffold(appName: string): string; declare function fixPackageJsonName(appDir: string, name: string, templateName?: string, provenance?: ScaffoldProvenance): void; declare function ensureScaffoldEmailBrandingConfig(appDir: string, appName: string, templateName?: string): void; declare function fixWebManifestName(appDir: string, name: string, templateName?: string, sourceIdentity?: ScaffoldSourceIdentity): void; declare function getCoreDependencyVersion(): string; declare function getDispatchDependencyVersion(): string; declare function getOtelDependencyVersion(): string; declare function getToolkitDependencyVersion(): string; declare function getAgentKitDependencyVersion(): string; interface PreparedWorkspaceOverrides { path: string; content: string; } declare function prepareLocalWorkspaceOverrides(targetDir: string, localFrameworkOverrides?: Record, localRecapCli?: string | null): PreparedWorkspaceOverrides | undefined; declare function getCorePackageVersion(): string | undefined; declare function getGitHubTemplateRefCandidates(): string[]; /** @deprecated Kept for backward-compatible test imports. Returns the * highest-priority candidate; callers that need the full fallback list * should use `getGitHubTemplateRefCandidates()`. */ declare function getGitHubTemplateRef(): string; declare function rewriteNetlifyToml(appDir: string, appName: string, mode: "standalone" | "workspace"): void; declare function applyScaffoldIdentity(appDir: string, appName: string, templateName?: string, sourceIdentity?: ScaffoldSourceIdentity): void; declare function rewriteAgentChatAppId(appDir: string, appName: string, templateName?: string, sourceIdentity?: ScaffoldSourceIdentity): void; declare function rewriteTrackingAppId(appDir: string, appName: string, templateName?: string, sourceIdentity?: ScaffoldSourceIdentity): void; declare function renameGitignore(dir: string): void; declare function replacePlaceholders(dir: string, appName: string, appTitle: string, workspaceName?: string): void; declare function copyDir(src: string, dest: string, root?: string, opts?: { skipExisting?: boolean; materializeSymlinks?: boolean; }, destinationRoot?: string): void; declare function shouldSkipScaffoldEntry(name: string, srcPath?: string): boolean;