/** The GitHub repo whose folders `add` clones. */ export declare const COOKBOOK_SOURCE_REPO = "getcargohq/gtm-skills"; /** An input the cookbook expects you to supply before it will do anything useful. */ export type CookbookInput = { input: string; kind?: string; how?: string; why?: string; }; /** A declared way to adapt the cookbook, so it is not forked to change it. */ export type CookbookAdaptation = { id: string; when?: string; how?: string; cost?: string; }; export type Cookbook = { name: string; /** The command the catalog says installs this, authored alongside it. */ install?: string; resources: string[]; asked: CookbookInput[]; canChange: CookbookAdaptation[]; job?: string; description?: string; version?: string; homepage?: string; group?: string; state?: string; }; export type AddressNamespace = "cookbook" | "connector"; export type ParsedAddress = { outcome: "parsed"; namespace: AddressNamespace; name: string; } | { outcome: "notParsed"; reason: "missingNamespace" | "reservedNamespace" | "unknownNamespace" | "invalidName"; message: string; }; /** * Fetch the catalog and return only its cookbooks. Throws with the URL in the * message, so a network failure names what could not be reached rather than * surfacing a bare `fetch failed`. */ /** * The cookbooks already installed in the project at `root`, by name. * * Read off the filesystem rather than the catalog, because this answers a * question about a repo someone may open weeks after installing anything, and * it must not need the network. * * The signal is that a cookbook is the only thing that writes *both* halves: * `infra//` for its resources and `//` for its procedure * (see `planFiles`). Nothing else has both — the base scaffold's `infra/` * subdirectories (`models`, `plays`, …) have no skill of that name, and neither * the scaffold's own skills nor the installed `cargo*` bundle has an `infra/` * directory. So the intersection is exactly the cookbooks. */ export declare function installedCookbooks(root: string): string[]; export declare function fetchCookbooks(): Promise; /** * Keep the entries that are cookbooks and parse them. Exported so the parsing * is testable against a fixture without a network round trip. */ export declare function parseCookbooks(entries: unknown[]): Cookbook[]; /** * Parse an `add` address. Every address is `/`: `cookbook/…` * installs a cookbook, and the resource namespaces are reserved for the * live-workspace generators, so `add connector/hubspot` says what it is waiting * on rather than reporting an unknown cookbook. */ export declare function parseAddress(raw: string): ParsedAddress; /** Cookbooks matching every term in `query`, across name, job, blurb and resources. */ export declare function searchCookbooks(cookbooks: Cookbook[], query: string): Cookbook[]; /** * Names worth suggesting after a miss. Empty when nothing is close, which the * caller reads as "list everything" — the catalog is small enough that showing * it all beats a wrong guess. */ export declare function closestNames(cookbooks: Cookbook[], name: string): string[]; //# sourceMappingURL=cookbook.d.ts.map