import { BosConfigInput, ParentStarterConfig, StarterLevel } from "../../types.mjs";
import { OverrideSection } from "../../contract.mjs";
import { CatalogChainSource, SourceResult, downloadTarball, fetchParentConfig, parseGitHubUrl, releaseRefCandidates, resolveCatalogChainSource, resolveRepositoryViaExtendsChain, resolveSourceDir } from "../resolution/init-source.mjs";
//#region src/services/scaffold/init.d.ts
declare const PNPM_PACKAGE_MANAGER = "pnpm@12.10.1";
/**
 * The child's workspace manifest: pnpm-workspace.yaml is canonical (v2, ADR
 * 0026) — packages globs synthesized from the child's override sections, the
 * catalog merged over any local entry, plus the fleet-wide linker posture and
 * singleton overrides. Re-running (sync/upgrade) merges instead of clobbering.
 */
declare function writeChildWorkspaceYaml(projectDir: string, next: {
  packages: string[];
  catalog: Record<string, string>;
}): boolean;
/**
 * Init must never reuse a lockfile left in the target (copied from a parent
 * checkout or left by a previous run) — stale framework resolutions would
 * survive the fresh install. Bun's bun.lock is deleted on sight (ADR 0026's
 * silent-revert footgun); the child's own pnpm-lock.yaml is re-resolved.
 */
declare function removeStrayLockfiles(projectDir: string): void;
declare const INIT_ROOT_PATTERNS: readonly ["bos.config.json", "package.json", ".env.example", ".gitignore", "biome.json", "AGENTS.md", ".agents/skills/**", "skills-lock.json", "docs/agents/**", ".changeset/config.json", ".changeset/README.md", "README.md", "CONTRIBUTING.md", ".github/templates/**"];
declare function buildInitPatterns(overrides: OverrideSection[], plugins?: string[], pluginDirMap?: Record<string, string>): string[];
declare function isApiTemplatePath(filePath: string): boolean;
declare function isComposeTemplatePath(filePath: string): boolean;
declare function buildPluginRouteExclusions(parentConfig: {
  plugins?: Record<string, unknown>;
} | null | undefined, selectedPlugins: string[]): string[];
/**
 * Route-file globs (relative to the child's `ui/src/routes/`) that a starter
 * of the given level must not receive. Parent `starter` config can add
 * exclusions (`exclude`, `levels[level].exclude`) or reclaim routes for a
 * level (`levels[level].include`). Entries are prefixed with
 * `ui/src/routes/` so they compose with `copyFilteredFiles`'s ignore list.
 */
declare function buildStarterRouteExclusions(level: StarterLevel, parentConfig: {
  starter?: ParentStarterConfig;
} | null | undefined): string[];
declare function sourcePathToDestinationPath(filePath: string): string;
declare function detectGitRemoteUrl(directory: string): Promise<string | undefined>;
declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[], options: {
  overrides: OverrideSection[];
  plugins?: string[];
  ignore?: string[];
}): Promise<number>;
/**
 * Scaffold the authored config as the TS form: the personalized
 * bos.config.json materializes into an authored `bos.app.ts` descriptor and
 * the JSON copy is removed — publish/sync still canonicalize to JSON for
 * FastKV from the resolved config. Returns the config that was converted, so
 * callers that need it (before the child has node_modules to import the
 * descriptor) can pass it onward.
 */
declare function convertChildConfigToAppForm(destination: string): Promise<BosConfigInput | null>;
/**
 * Scaffold the root dev-overlay starter (`bos.dev.ts`). Idempotent — never
 * overwrites an existing overlay. Dev overlays are merged child-wins over
 * the resolved config in development and are never published.
 */
declare function writeDevOverlayTemplate(destination: string, opts?: {
  extendsRef?: string;
}): void;
declare function getParentOnlyScriptKeys(projectDir: string): string[];
/**
 * The child root manifest carries exactly the framework packages plus the
 * optional peers whose absence trips bundler warnings: `@better-auth/core`
 * optionally peers `@opentelemetry/api`, pnpm does not auto-install optional
 * peers, and nothing else in the child resolves it — undeclared, every child
 * build warns "Module not found: Can't resolve '@opentelemetry/api'".
 */
declare function childFrameworkDependencies(): Record<string, string>;
declare function buildChildRootScripts(sections: {
  ui: boolean;
  api: boolean;
  host: boolean;
  plugins: boolean;
}): Record<string, string>;
declare function personalizeConfig(destination: string, opts: {
  extendsAccount: string;
  extendsGateway: string;
  account?: string;
  domain?: string;
  plugins?: string[];
  overrides: OverrideSection[];
  pluginRoutes?: Record<string, string[]>;
  workspaceOpts?: {
    localOverrides?: boolean;
    sourceDir?: string;
  };
  mode?: "init" | "sync";
  existingConfig?: Record<string, unknown>;
  repository?: string;
  title?: string;
  description?: string;
  testnet?: string;
  staging?: unknown;
  starter?: StarterLevel;
  /** The platform release's catalog (ADR 0034) — skips the local chain walk. */
  catalog?: Record<string, string>;
  /** The framework version to pin (ADR 0034) — stamped onto the authored
   * config; absent in sync mode, the child's existing pin is preserved. */
  platform?: string;
}): Promise<void>;
declare function runPnpmInstall(destination: string, opts?: {
  spinner?: {
    message: (msg: string) => void;
  };
}): Promise<void>;
declare function runPnpmInstallForUpgrade(destination: string, opts?: {
  spinner?: {
    message: (msg: string) => void;
  };
}): Promise<void>;
declare function runTypesGen(destination: string, opts?: {
  spinner?: {
    message: (msg: string) => void;
  };
  remotePlugins?: string[];
}): Promise<void>;
declare function scaffoldMinimalProject(destination: string, parentConfig: BosConfigInput, opts: {
  extendsAccount: string;
  extendsGateway: string;
  account?: string;
  domain?: string;
  plugins?: string[];
  overrides: OverrideSection[];
  repository?: string;
  title?: string;
  description?: string;
  starter?: StarterLevel;
  /** local parent source dir — resolves the catalog offline (tests, --source) */
  catalogSourceDir?: string;
  /** the platform release's catalog (ADR 0034) — preferred over the walk */
  catalog?: Record<string, string>;
  /** the framework version to pin (ADR 0034) */
  platform?: string;
}): Promise<number>;
declare function writeInitSnapshot(destination: string, _extendsAccount: string, _extendsGateway: string, sourceDir: string, patterns: string[], options: {
  overrides: OverrideSection[];
  plugins?: string[];
  ignore?: string[];
  starter?: StarterLevel;
}): Promise<void>;
declare function generateDatabaseMigrations(destination: string): Promise<void>;
declare function execCommand(command: string, args: string[], cwd?: string, options?: {
  stdio?: "pipe" | "inherit";
}): Promise<void>;
declare function extractSkillsBlock(content: string): string;
declare function buildChildAgentsMd(skillsBlock: string, opts: {
  overrides: OverrideSection[];
  plugins?: string[];
}): string;
declare function personalizeAgentsMd(destination: string, opts: {
  overrides: OverrideSection[];
  plugins?: string[];
}): Promise<void>;
declare function buildChildLlmsTxt(title: string): string;
declare function buildChildSkillMd(title: string, repository: string): string;
//#endregion
export { type CatalogChainSource, INIT_ROOT_PATTERNS, PNPM_PACKAGE_MANAGER, type SourceResult, buildChildAgentsMd, buildChildLlmsTxt, buildChildRootScripts, buildChildSkillMd, buildInitPatterns, buildPluginRouteExclusions, buildStarterRouteExclusions, childFrameworkDependencies, convertChildConfigToAppForm, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, extractSkillsBlock, fetchParentConfig, generateDatabaseMigrations, getParentOnlyScriptKeys, isApiTemplatePath, isComposeTemplatePath, parseGitHubUrl, personalizeAgentsMd, personalizeConfig, releaseRefCandidates, removeStrayLockfiles, resolveCatalogChainSource, resolveRepositoryViaExtendsChain, resolveSourceDir, runPnpmInstall, runPnpmInstallForUpgrade, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, writeChildWorkspaceYaml, writeDevOverlayTemplate, writeInitSnapshot };
//# sourceMappingURL=init.d.mts.map