/** * `agent-native add [name|url]` — the **blueprint installer**. * * Borrowed from Flue's `flue add`: instead of being a dumb scaffolder that * writes files for you, this command emits a curated Markdown *integration * blueprint* to stdout. You pipe that blueprint into your own coding agent, * which applies the changes against the live repo: * * agent-native add provider stripe | claude * agent-native add channel discord | codex * * This fits the agent-applies-changes, filesystem-first house style: the * framework supplies the recipe (the canonical files to touch, the rules to * honor, the verification step), and the coding agent does the editing with * full repo context. * * A bare name resolves a curated blueprint from `blueprints//.md`. * A URL instead of a name emits a GENERIC "research-and-integrate" blueprint * for that kind with the URL embedded as the research starting point (mirrors * Flue: a URL is a research seed, not a known recipe). * * Blueprint `.md` files ship in the published package via the `blueprints` * entry in `package.json` `files`, so they live at * `node_modules/@agent-native/core/blueprints/**` at runtime. Resolution works * both from source (tsx: `src/cli` → `../../blueprints`) and from the compiled * package (`dist/cli` → `../../blueprints`), with an upward-walk fallback. */ /** A coarse classification of what `add` resolved for a given invocation. */ export type AddBlueprintSource = { kind: "curated"; blueprintKind: string; name: string; path: string; } | { kind: "generic-url"; blueprintKind: string; url: string; }; export interface ResolvedBlueprint { /** The Markdown to print to stdout (piped into a coding agent). */ markdown: string; source: AddBlueprintSource; } /** * Locate the directory that holds the blueprint `.md` recipes. * * Both `src/cli` (tsx/source) and `dist/cli` (published) sit two levels under * the package root, where `blueprints/` lives, so `../../blueprints` from this * module's directory is the primary path. We additionally walk upward looking * for a `blueprints` directory as a resilience fallback (e.g. unusual bundler * layouts). An explicit override is honored for tests. */ export declare function resolveBlueprintsRoot(overrideRoot?: string): string; /** True for an argument that should be treated as a research URL, not a name. */ export declare function looksLikeUrl(value: string): boolean; /** List the blueprint kinds (subdirectories) available, sorted. */ export declare function listKinds(root: string): string[]; /** List the blueprint names available under a kind, sorted (no `.md`). */ export declare function listBlueprintNames(root: string, kind: string): string[]; /** A flat catalog of every kind and its blueprint names. */ export declare function listCatalog(root: string): Array<{ kind: string; names: string[]; }>; /** Render the `--list` / no-args catalog text. */ export declare function formatCatalog(root: string): string; /** * Build the generic "research-and-integrate" blueprint emitted when the user * passes a URL instead of a known blueprint name. Mirrors Flue: a URL is a * research seed. We keep this self-contained — the coding agent reading it has * no other context. */ export declare function buildGenericUrlBlueprint(kind: string, url: string): string; /** * Resolve a blueprint for a `kind` + optional `name`/`url`. * * - A known name → the curated `blueprints//.md`. * - A URL → the generic research-and-integrate blueprint for the kind. * - Unknown name → throws `AddResolutionError` listing what's available. */ export declare function resolveBlueprint(opts: { kind: string; nameOrUrl?: string; root: string; }): ResolvedBlueprint; /** Thrown for an unknown kind/name; the CLI prints the message and exits 1. */ export declare class AddResolutionError extends Error { constructor(message: string); } interface ParsedAddArgs { list: boolean; help: boolean; /** Accepted as an explicit no-op alias for the default print behavior. */ print: boolean; positionals: string[]; } export declare function parseAddArgs(argv: string[]): ParsedAddArgs; /** * CLI entry point. Returns the process exit code so the dispatcher / tests can * assert on it. Writes the blueprint Markdown to stdout and diagnostics to * stderr so `... | claude` only receives the blueprint. */ export declare function runAdd(argv: string[], io?: { out?: (s: string) => void; err?: (s: string) => void; root?: string; }): number; export {}; //# sourceMappingURL=add.d.ts.map