import { type SkillMetadata } from '../skills/skill-registry.js'; import { type JsonLayoutOptions } from './json-layout.js'; /** Where the generator writes, relative to the package root. */ export declare const PLUGIN_MANIFEST_RELATIVE_PATH = ".claude-plugin/marketplace.json"; /** * The server key peaks registers itself under. It is OUR key, not a harness's — * the adapter profiles that name it (`IdeMcpInstallProfile.serverName`) and the * tool-name templates that match it (`IdeAdapter.mcp`) must agree with this one, * which is why it is declared once. */ export declare const MCP_SERVER_KEY = "peaks"; /** The subset of `package.json` this render reads. */ interface PackageManifest { readonly name: string; readonly version: string; readonly description?: string; readonly author?: string; readonly homepage?: string; readonly repository?: { readonly url?: string; } | string; readonly license?: string; readonly keywords?: readonly string[]; /** * The repository's own prettier config — the source of truth for the layout the * artifact is rendered in. Read from the SAME package.json the plugin-level * fields come from, so the render and the check that guards it cannot disagree * about the width. */ readonly prettier?: { readonly printWidth?: number; readonly tabWidth?: number; }; } /** One plugin entry's skill list item — the shape `peaks skill:visibility` reads. */ interface PluginSkillEntry { readonly name: string; readonly path: string; readonly description: string; readonly userInvocable?: boolean; } interface GeneratedPluginManifest { readonly metadata: { readonly pluginRoot: string; readonly version: string; }; readonly plugins: readonly { readonly name: string; readonly description: string; readonly version: string; readonly author: { readonly name: string; }; readonly homepage: string; readonly repository: string; readonly license: string; readonly keywords: readonly string[]; /** * Declared, and deliberately not brought live: the plugin channel is not * published by this slice (PRD non-goal), so this is the statement of what * the channel WOULD run, kept true by generation rather than by memory. * * The command is the CLI's own name and subcommand, with no path in it: a * manifest is built on one machine and read on another, so an absolute * interpreter path resolved here would be the build host's. The RUNTIME * registration is a different artefact with a different consumer and does * resolve the pair — see `mcp-install.ts::resolveMcpServerArgv`. */ readonly mcpServers: Record; readonly skills: readonly PluginSkillEntry[]; }[]; } /** `package.json`, parsed. A missing version is a refusal, not a default. */ export declare function loadPackageManifest(root?: string): PackageManifest; /** * The skill entries, in the registry's order. * * `visibility: internal` is the skill's own declaration that it is an internal * role rather than a front door, and it is the ONE source for `userInvocable` — * the field is emitted only when it is `false`, which is the contract * `skill:visibility` reads ("internal: userInvocable false; public: omitted"). */ export declare function skillEntriesOf(skills: readonly SkillMetadata[]): readonly PluginSkillEntry[]; /** * Render the manifest. `skills` is passed in rather than loaded here so the one * caller that must fail loudly on an unreadable SKILL.md can do so once. */ export declare function generatePluginManifest(manifest: PackageManifest, skills: readonly SkillMetadata[]): GeneratedPluginManifest; /** * The layout the repository's own prettier config asks for, read from the ROOT * package.json. Exported so the guard that checks the artifact resolves the layout * the same way the renderer does — two resolutions would be two decisions. */ export declare function repositoryJsonLayout(): JsonLayoutOptions; /** * The artifact's bytes, newline-terminated — the same serialization contract as the * whitelist, in the layout prettier produces for JSON. * * `JSON.stringify(manifest, null, 2)` used to do this, and it expanded EVERY array * regardless of width, so the committed artifact was not prettier-clean. The shape * is now computed by `json-layout.ts`, which implements prettier's JSON rules with * ZERO dependencies — `prettier` is a devDependency, and this module ships to * consumers inside `dist/**`, so it must not depend on it. * * The default layout is the repository's own, read from the root `package.json`; * a caller rendering for another root passes the layout it resolved there. */ export declare function serializePluginManifest(manifest: GeneratedPluginManifest, options?: JsonLayoutOptions): string; /** Absolute path of the committed artifact for a package root. */ export declare function pluginManifestPath(root?: string): string; /** * The whole render for a package root: read the two sources, refuse a skill tree * that did not fully parse, and serialize. * * The `failures` refusal is the load-bearing part. `loadSkillRegistry` reports an * unreadable `SKILL.md` in a `failures` array instead of throwing, so a render * that ignored it would DROP a skill from the manifest and still be * byte-stable — a green CI over a manifest that had silently lost entries. A * drift assertion cannot be stronger than its input, so the input is required to * be complete. */ export declare function renderPluginManifest(root?: string): Promise; export {};