/** * Packaging — everything that has to happen before a plugin can be published, * and nothing that publishes it. * * The split is the point. Preparing a release is mechanical: run the gates at * their strictest, write a README, produce the marketplace index entry. All of * that is automated. *Publishing* — pushing an artifact into a marketplace that * other agents install from autonomously — stays a human act, because an agent * that can do it unattended is a supply-chain compromise primitive. See * docs/plugin-system-architecture.md §3.2–§3.3. * * Packaging works **in place**, in the plugin's production home. There is no * separate output location: by the time a plugin reaches here it is already in * its target platform's layout, and copying it somewhere else would just create * a fourth directory role to confuse with the other three (§8.3). * * The two platforms are not symmetric here, and the lane is built for the harder * one. A `claude` plugin is already live locally from `~/.claude/skills//`, * so publishing is optional and additive. For `github`, local installs are * deprecated — publishing is the *only* route into the ecosystem — so the * GitHub flow (a PR against a marketplace repo's index) is the primary case and * the Claude submission is the variant. */ import type { CapabilityDoc } from "../../capabilities/registry.js"; import { type PluginPlatform } from "./formats/platform-targets.js"; import { type GateResult } from "./gates.js"; import type { NormalizedPlugin } from "./manifest.js"; import { type TriggerJudge } from "./trigger-eval.js"; /** * Where packaging records what it produced, at the plugin root. * * A dotfile beside the existing `.authored.json` provenance marker rather than a * visible `marketplace-entry.json`: the plugin directory is the thing that gets * copied into a marketplace repo, and a build record is not part of the artifact. */ export declare const PUBLISH_RECORD_FILE = ".hoocode-publish.json"; /** A `marketplace.json` `plugins[]` entry, ready to paste into an index. */ export interface MarketplaceEntry { name: string; description?: string; version?: string; source: string | { source: "git"; url: string; } | { source: "github"; repo: string; }; } export interface PublishRecord { packagedAt: string; platform: PluginPlatform; entry: MarketplaceEntry; /** Whether the gates were green when this record was written. */ ok: boolean; } export interface PackageResult { ok: boolean; dir: string; platform: PluginPlatform; /** Files packaging created or refreshed, relative to the plugin root. */ written: string[]; entry: MarketplaceEntry; evaluation: GateResult; /** Human-facing next steps; deliberately instructions, not actions. */ instructions: string; } /** * Which ecosystem this plugin is being packaged for. * * Where it lives is the strongest evidence — the production homes are per * platform, so a plugin under `~/.agents/publish/github/` is a github artifact * whatever its manifests say. A plugin outside a production home (installed, or * authored by an older version) falls back to what it declares, then to the * session default. */ export declare function resolvePackagePlatform(plugin: NormalizedPlugin): PluginPlatform; /** True when the entry still needs a human to say where the plugin will be hosted. */ export declare function entryNeedsSource(entry: MarketplaceEntry): boolean; /** * Package a plugin for publication: gate it at full strictness, write a README, * produce its marketplace entry, and record what it produced. Touches no remote. */ export declare function packagePlugin(plugin: NormalizedPlugin, platformOverride?: PluginPlatform, options?: { judge?: TriggerJudge; distractors?: readonly CapabilityDoc[]; }): Promise; export interface StageResult { ok: boolean; message: string; /** Path the plugin was copied to, relative to the marketplace root. */ pluginPath?: string; /** The index that was written, relative to the marketplace root. */ indexPath?: string; /** True when the marketplace had no index for this platform and one was created. */ createdIndex?: boolean; } /** * Copy a packaged plugin into a **local** marketplace checkout and add its index * entry, leaving the result uncommitted. * * This is the far side of the automation line drawn in §3.3, and it is where the * line actually falls. Everything here is local, reversible, and shows up in * `git status` — the human reviews a diff and decides. What stays manual is the * step that leaves the machine: no commit, no push, no PR. Those are what make a * plugin installable by other people's agents, and that is the act install is * trusting a human to have performed. * * Only reachable from `/plugin publish`, never from a tool: a human typed the * command, which is the whole point. */ export declare function stageIntoMarketplace(plugin: NormalizedPlugin, platform: PluginPlatform, marketplaceDir: string): StageResult; /** Read back the record packaging left, for callers that want to show it. */ export declare function readPublishRecord(dir: string): PublishRecord | undefined; //# sourceMappingURL=packaging.d.ts.map