import type { FullstackTemplateValues, PluginTemplateValues, ProjectTemplateMetadata, TemplateDefinition, TemplateUpstream } from "./types.js";
/**
 * Paths inside the freshly-hydrated upstream submodule (eliza) that we always
 * remove before bun install. These pull in workspace dependencies (chiefly
 * `@elizaos/cloud-sdk`) that Tokagent does not ship and that would otherwise
 * cause `bun install` to fail with "Workspace dependency ... not found".
 *
 * - `plugins/plugin-elizacloud` declares `@elizaos/cloud-sdk: workspace:*`
 *   and is matched by the scaffolded project's `tokagent/plugins/plugin-*\/typescript`
 *   workspace glob. Removing the directory takes it out of the workspace set.
 * - `cloud` is the eliza Cloud monorepo provided as a git submodule; we don't
 *   use it. Removing it keeps `tokagent/package.json` workspace entries
 *   `cloud/packages/sdk` and `cloud/packages/services/billing` from resolving
 *   if a developer ever runs `bun install` inside `tokagent/` directly.
 */
export declare const UPSTREAM_PRUNE_PATHS: readonly ["plugins/plugin-elizacloud", "cloud", "plugins/plugin-agent-skills", "plugins/plugin-anthropic", "plugins/plugin-discord", "plugins/plugin-evm", "plugins/plugin-google-genai", "plugins/plugin-groq", "plugins/plugin-imessage", "plugins/plugin-local-ai", "plugins/plugin-local-embedding", "plugins/plugin-ollama", "plugins/plugin-openai", "plugins/plugin-openrouter", "plugins/plugin-pdf", "plugins/plugin-shopify", "plugins/plugin-sql", "plugins/plugin-telegram", "plugins/plugin-twitter", "plugins/plugin-wechat", "plugins/plugin-whatsapp", "plugins/plugin-agent-orchestrator", "plugins/plugin-cli", "plugins/plugin-commands", "plugins/plugin-cron", "plugins/plugin-edge-tts", "plugins/plugin-music-library", "plugins/plugin-music-player", "plugins/plugin-plugin-manager", "plugins/plugin-shell", "plugins/plugin-solana", "packages/examples"];
/**
 * npm version pins for `@elizaos/plugin-*` packages whose source repos
 * were depopulated from `elizaos-plugins/*` (404 on GitHub). When upstream
 * eliza's package.json files declare `"workspace:*"` for these, the
 * workspace can't resolve because the plugin source isn't on disk.
 * Rewrite each `"workspace:*"` to the matching npm version so `bun install`
 * resolves from the registry instead.
 *
 * Versions verified during scaffold-recovery follow-up on 2026-05-05.
 * Refresh procedure: when bumping the upstream eliza commit, run
 * `bun install` against a fresh scaffold and add npm pins for any
 * newly-failing `@elizaos/plugin-*` workspace deps.
 */
export declare const UPSTREAM_PLUGIN_NPM_PINS: Readonly<Record<string, string>>;
/**
 * Narrow surgical edits applied to upstream eliza files after hydration.
 *
 * Use these instead of full-file scaffold-patch overlays when the change is
 * a single semantic edit and the surrounding code can be tracked verbatim
 * with upstream. Each `find` string is replaced with `replaceWith` exactly
 * once; if the find string isn't present in the upstream file, the error is
 * loud (an exception) so we know to revisit when upstream changes.
 *
 * Trade-off vs. a full-file overlay:
 *   + Almost zero divergence from upstream — easy to keep current
 *   + Forces a code review on upstream-side changes via the loud-error
 *   - Brittle if upstream reformats whitespace inside the matched span
 *
 * Use full overlays for major rewrites; use surgical patches for one-line
 * UX fixes like removing a hardcoded canned response.
 */
export declare const UPSTREAM_SURGICAL_PATCHES: ReadonlyArray<{
    readonly path: string;
    readonly description: string;
    readonly find: string;
    readonly replaceWith: string;
}>;
export declare function toDisplayName(value: string): string;
export declare function buildPluginTemplateValues(input: {
    tokagentVersion: string;
    githubUsername: string;
    pluginDescription: string;
    projectName: string;
    repoUrl: string;
}): PluginTemplateValues;
export declare function buildFullstackTemplateValues(projectName: string): FullstackTemplateValues;
export declare function getPluginReplacementEntries(values: PluginTemplateValues): Array<[string, string]>;
export declare function getFullstackReplacementEntries(values: FullstackTemplateValues): Array<[string, string]>;
export declare function getTemplateReplacementEntries(options: {
    templateId: TemplateDefinition["id"];
    values: Record<string, string>;
}): Array<[string, string]>;
export declare function resolveTemplateSourceDir(options: {
    language?: string;
    template: TemplateDefinition;
    templatesDir: string;
}): string;
export declare function renderTemplateTree(options: {
    destinationDir: string;
    replacements: Array<[string, string]>;
    sourceDir: string;
}): Record<string, string>;
export declare function createRenderedTempDir(options: {
    replacements: Array<[string, string]>;
    sourceDir: string;
}): {
    dir: string;
    managedFiles: Record<string, string>;
};
export declare function resolveTemplateUpstream(upstream: TemplateUpstream): TemplateUpstream;
export declare function ensurePackageJsonWorkspaces(packageJsonPath: string, workspaceEntries: string[]): boolean;
export declare function removePackageJsonWorkspaces(packageJsonPath: string, workspaceEntries: readonly string[]): boolean;
/**
 * Remove upstream paths that pull in workspace dependencies Tokagent does not
 * ship. Called after `git submodule update --init --recursive` hydrates the
 * upstream tree but before bun install runs. Returns the list of paths that
 * were actually removed so the caller can log them.
 *
 * The upstream submodule is freshly cloned and is not part of the user's
 * commit history, so a plain rmSync is safe — there is no working-tree state
 * to preserve.
 */
/**
 * Strip the named entries from `dependencies`, `devDependencies`, and
 * `peerDependencies` in a package.json. Returns true if any removal occurred.
 * Used to scrub references to packages that we prune from the upstream tree
 * (e.g., `@elizaos/plugin-elizacloud`) so bun install doesn't fail trying
 * to resolve them as workspace deps.
 */
export declare function removePackageJsonDependencies(packageJsonPath: string, depNames: readonly string[]): boolean;
/**
 * Apply all configured `UPSTREAM_DEPENDENCY_REMOVALS` against the freshly
 * hydrated upstream tree. Returns the list of package.json files that were
 * actually modified.
 */
export declare function pruneUpstreamPackageDependencies(submoduleRoot: string, removals?: ReadonlyArray<{
    readonly path: string;
    readonly names: readonly string[];
}>): string[];
/**
 * Rewrite `"workspace:*"` declarations to npm version pins for known-dead
 * `@elizaos/plugin-*` workspace deps. Run AFTER submodule init + pruning
 * so the package.json files we touch reflect the post-pruned tree.
 *
 * Returns the list of package.json paths (relative to submoduleRoot) that
 * were modified.
 */
export declare function rewriteUpstreamWorkspaceDeps(submoduleRoot: string, pins?: Readonly<Record<string, string>>): string[];
/**
 * Strip `[submodule "<path>"] ... path = <path>` blocks out of the
 * upstream `.gitmodules` for the given submodule paths, so subsequent
 * `git submodule update --init --recursive` calls don't try to clone
 * them. Used to avoid fetching the cloud/ submodule whose pinned ref
 * is force-rewritten periodically and breaks scaffolds.
 *
 * If `.gitmodules` is missing or the entries aren't present, no-op.
 */
export declare function removeSubmodulesFromGitmodules(submoduleRoot: string, paths: readonly string[]): void;
export declare function pruneUpstreamUnusedPaths(submoduleRoot: string, paths?: readonly string[]): string[];
/**
 * Apply each `UPSTREAM_SURGICAL_PATCHES` entry as a literal find/replace on
 * the named upstream file. Throws if a patch's `find` string isn't present
 * (so we can't silently ship an unapplied surgical patch when upstream
 * shifts the surrounding code). Returns the list of paths actually edited.
 */
export declare function applyUpstreamSurgicalPatches(submoduleRoot: string, patches?: ReadonlyArray<{
    readonly path: string;
    readonly description: string;
    readonly find: string;
    readonly replaceWith: string;
}>): string[];
export declare function ensureUpstreamCompatibilityFiles(submoduleRoot: string): string[];
export declare function buildMetadata(options: {
    cliVersion: string;
    language?: string;
    managedFiles: Record<string, string>;
    template: TemplateDefinition;
    values: Record<string, string>;
}): ProjectTemplateMetadata;
export declare function updateManagedFiles(options: {
    currentMetadata: ProjectTemplateMetadata;
    dryRun?: boolean;
    projectRoot: string;
    renderedDir: string;
    renderedManagedFiles: Record<string, string>;
}): {
    conflicts: string[];
    created: string[];
    deleted: string[];
    nextManagedFiles: Record<string, string>;
    unchanged: string[];
    updated: string[];
};
export declare function hydrateGitSubmoduleWorkspace(options: {
    dryRun?: boolean;
    projectRoot: string;
    upstream: TemplateUpstream;
}): void;
/**
 * Overlay Tokagent-specific patches onto a freshly-hydrated upstream clone.
 * Each file under `scaffold-patches/` is copied to the same relative path
 * inside `<submoduleRoot>/` (i.e., the user's `<project>/tokagent/` directory).
 *
 * Returns a list of relative paths that were overlaid so the caller can log
 * them. Conflicts (target path missing) throw with a clear error — upstream
 * reorganizations must be reconciled in scaffold-patches before the next
 * tokagentos release.
 */
export declare function applyTokagentScaffoldPatches(options: {
    dryRun?: boolean;
    submoduleRoot: string;
}): {
    applied: string[];
    missing: string[];
};
export declare function initializeGitSubmodule(options: {
    branch?: string;
    commit?: string;
    projectRoot: string;
    repo: string;
    submodulePath: string;
}): void;
export declare function updateGitSubmodule(options: {
    branch?: string;
    commit?: string;
    dryRun?: boolean;
    projectRoot: string;
    repo: string;
    submodulePath: string;
}): void;
//# sourceMappingURL=scaffold.d.ts.map