/** * Pure ship-planning helpers (CUT A1) — the genuinely side-effect-free parts of * the `czap ship` release workflow: tarball slug derivation, target selection, * lifecycle-script detection, build-env validation, package-manager version * parsing. No fs / spawn / process here — the CLI owns the orchestration, * destructive publish, and streaming; these are the planning primitives it uses. * * @module */ import type { ShipCapsule } from '@czap/core'; /** Minimal package.json view the planners need. */ export interface PackageJsonLite { readonly name?: string; readonly version?: string; readonly scripts?: Readonly>; readonly private?: boolean; } /** A discovered workspace package (the fs walk that produces these stays in the CLI). */ export interface WorkspacePackage { readonly absolutePath: string; readonly relativePath: string; readonly packageJsonBytes: Uint8Array; readonly packageJson: PackageJsonLite; } /** * Slug used by pnpm for tarball filenames (mirrors npm-packlist / libnpmpack). * `@scope/name` → `scope-name`; plain `name` → `name`. */ export declare function packageSlug(name: string): string; /** * Select the packages to ship. No filter → all non-private packages. A filter * matches either a relative path (`./packages/core`) or a package name. */ export declare function selectTargets(workspace: readonly WorkspacePackage[], filter: string | undefined): WorkspacePackage[]; /** Report which publish lifecycle scripts a package actually declares. */ export declare function observedLifecycleScripts(pkg: PackageJsonLite): readonly string[]; /** Parse `pnpm@10.32.1(+sha…)` from a `packageManager` field. */ export declare function readPackageManagerVersion(rootPackageJson: PackageJsonLite & { packageManager?: string; }): string; /** * Validate + assemble a ShipCapsule.BuildEnv. The OS/arch come from the caller * (the CLI reads process.*); only linux/darwin/win32 and x64/arm64 are modeled * in v0.1.0 — anything else is a hard failure, never a silent cast. */ export declare function deriveBuildEnv(input: { readonly os: string; readonly arch: string; readonly nodeVersion: string; readonly pmVersion: string; }): ShipCapsule.BuildEnv; //# sourceMappingURL=ship-planning.d.ts.map