/** * CLI Manifest Helpers * * Pure logic for the `pluginator manifest` subcommands (new/validate/add) so * it can be unit-tested without invoking commander or touching the user's * config files. cli.ts stays a thin shell around these (same pattern as * cli-limit-helpers / cli-log-helpers / cli-source-helpers). * * Manifests are the update channel for self-built/private/off-market plugins * (Phase 3 W1b): a JSON file on any static host, consumed by * WebManifestSource. The authoring format lives with the schema in * src/core/sources/web-manifest.ts. * * @since v2.12.5 */ import { type WebManifest } from './core/sources/web-manifest.js'; import type { Plugin } from './core/types/index.js'; /** * Inputs for `pluginator manifest new`. */ export interface StarterManifestOptions { /** Plugin name — MUST match the plugin.yml `name` for scan matching. */ name: string; /** Current plugin version. */ version: string; /** Direct .jar download URL. */ downloadUrl: string; description?: string; author?: string; /** sha256 of the .jar — feeds the download integrity gate when present. */ sha256?: string; } export type StarterManifestResult = { ok: true; manifest: WebManifest; } | { ok: false; issues: string[]; }; /** * Build a single-plugin starter manifest, schema-validated against EXACTLY * what WebManifestSource will accept at fetch time (never write a manifest * the consumer would reject). */ export declare function buildStarterManifest(options: StarterManifestOptions): StarterManifestResult; export type ManifestValidationResult = { valid: true; name: string; pluginCount: number; } | { valid: false; issues: string[]; }; /** * Validate raw manifest JSON text for `pluginator manifest validate`. * Accepts the file/HTTP body as a string so the caller owns all I/O. */ export declare function validateManifestContent(content: string): ManifestValidationResult; /** * Wire a configured plugin to a manifest URL for `pluginator manifest add`: * sets `type: 'web'` + `sourceUrl` so getSourceIdentifier emits the composite * `|` identifier on the next check. * * SSRF posture: the manifest URL is user-supplied, so the same * validateExternalUrl guard that runs at fetch time also runs here at * registration time — private/internal addresses are rejected with a * SecurityError BEFORE anything is persisted. * * Mutates the matching plugin in place (case-insensitive name match); the * caller persists via savePlugins, the same path the assign review queue * uses. Existing source identifiers (resourceId etc.) are left intact so * switching back to a store source loses nothing. * * @throws {SecurityError} when manifestUrl targets a blocked address. */ export declare function applyManifestUrlToPlugin(plugins: Plugin[], pluginName: string, manifestUrl: string): { found: boolean; plugin?: Plugin; }; /** * Hosting guidance printed after `pluginator manifest new` — any static HTTPS * host works; there is no Pluginator-side infrastructure requirement. */ export declare const MANIFEST_HOSTING_HINTS: string[]; //# sourceMappingURL=cli-manifest-helpers.d.ts.map