/**
 * CapabilityPackSchema — TypeScript types for OpenLife Capability Packs.
 *
 * A Capability Pack is a bundle that ships together: one or more
 * workflows, the squads/agents/skills they depend on, plus checklists,
 * templates, and policies. Packs live under `.catalog/capabilities/<id>/`
 * and follow the established `.catalog/`-as-runtime-SoT contract.
 *
 * Story 1.1 — OpenLife v1.3 Agent OS Integration.
 *
 * Why packs instead of just composing the existing registries on the fly?
 *  - Authoring: CapabilityGenesisEngine produces a coherent draft bundle
 *    from a brief; callers want a single id to canonize, version, and
 *    promote — not 4 separate ids to keep in sync.
 *  - Sharing: a pack is the unit of import/export between projects.
 *  - Lifecycle: draft → tested → active → deprecated is a pack-level
 *    state machine (Story 1.4).
 *
 * The pack manifest is `capability.yaml`. References inside it
 * (agents[], skills[], squads[], workflows[]) point at ids resolved by
 * the existing Agent/Skill/Squad/Workflow registries. References are
 * validated by CapabilityPackParser (Story 1.1 below) — broken refs
 * surface as stable error codes.
 *
 * NEW IDs are tolerated when the pack is in status `draft` (the genesis
 * engine creates skills/squads in the same pass that writes the pack
 * manifest, so a forward-reference is OK). For `active` packs, every
 * reference MUST resolve.
 */
export type CapabilityStatus = 'draft' | 'tested' | 'active' | 'deprecated';
/** A reference to an existing or to-be-created asset. */
export interface CapabilityAssetRef {
    /** Asset id as it appears in the corresponding registry. */
    id: string;
    /** Optional human-readable label for the pack INDEX. */
    label?: string;
    /**
     * `embedded` — the asset is created/owned by this pack and lives under
     *   `.catalog/capabilities/<pack>/{agents,skills,squads,workflows}/`.
     * `referenced` — the asset already exists elsewhere in `.catalog/` and
     *   the pack just points at it. The genesis engine's reuse-first rule
     *   produces these.
     */
    source: 'embedded' | 'referenced';
    /** Optional version pin when referencing a versioned asset. */
    version?: string;
}
export interface CapabilityChecklist {
    id: string;
    /** Relative path inside the pack (e.g. `checklists/quality-gate.md`). */
    path: string;
    label?: string;
}
export interface CapabilityTemplate {
    id: string;
    path: string;
    label?: string;
}
export interface CapabilityPolicy {
    /** Stable id used by GovernanceLayer policy-tag matching. */
    id: string;
    /** Free-text rationale shown to operators when the policy fires. */
    rationale?: string;
    /** Optional capability tags this policy applies to (defaults to the entire pack). */
    appliesTo?: string[];
}
export interface CapabilityPackMetadata {
    /** When the pack was first authored. ISO 8601. */
    createdAt?: string;
    /** Last status transition. ISO 8601. */
    updatedAt?: string;
    /** SHA256 of the authored manifest at canonization time. */
    contentSha256?: string;
    /** Free-text author / squad name. */
    author?: string;
    /** Tags for catalog search (e.g. ['research', 'analysis']). */
    tags?: string[];
}
export interface CapabilityPack {
    id: string;
    name: string;
    description: string;
    version: string;
    status: CapabilityStatus;
    /** Objective string — what the pack accomplishes when invoked. */
    objective: string;
    /** Optional measurable success criteria. */
    success_criteria?: string[];
    /** Bundled or referenced agents. */
    agents?: CapabilityAssetRef[];
    /** Bundled or referenced skills. */
    skills?: CapabilityAssetRef[];
    /** Bundled or referenced squads. */
    squads?: CapabilityAssetRef[];
    /** Bundled or referenced workflows. */
    workflows?: CapabilityAssetRef[];
    /** Quality gates for promotion to `tested` / `active`. */
    checklists?: CapabilityChecklist[];
    /** Document templates bundled with the pack (report shells, etc.). */
    templates?: CapabilityTemplate[];
    /** Pack-specific governance policy tags. */
    policies?: CapabilityPolicy[];
    /** Authoring + lifecycle metadata. Optional. */
    metadata?: CapabilityPackMetadata;
}
/** The root YAML document is `capability: { … }`. */
export interface CapabilityPackDocument {
    capability: CapabilityPack;
}
export declare const CAPABILITY_ERRORS: {
    readonly INVALID_YAML: "capability_invalid_yaml";
    readonly INVALID_SCHEMA: "capability_invalid_schema";
    readonly MISSING_ROOT: "capability_missing_root";
    readonly MISSING_REQUIRED_FIELD: "capability_missing_required_field";
    readonly INVALID_TYPE: "capability_invalid_type";
    readonly INVALID_STATUS: "capability_invalid_status";
    readonly DUPLICATE_ASSET_REF: "capability_duplicate_asset_ref";
    readonly UNKNOWN_ASSET_REF: "capability_unknown_asset_ref";
    readonly ID_DIR_MISMATCH: "capability_id_dir_mismatch";
    readonly EMBEDDED_REF_MISSING_FILE: "capability_embedded_ref_missing_file";
};
export type CapabilityErrorCode = typeof CAPABILITY_ERRORS[keyof typeof CAPABILITY_ERRORS];
export interface CapabilityParseError {
    code: CapabilityErrorCode;
    message: string;
    context?: Record<string, string | number>;
}
export interface CapabilityParseResult {
    ok: boolean;
    pack?: CapabilityPack;
    errors: CapabilityParseError[];
}
export declare function isCapabilityStatus(s: unknown): s is CapabilityStatus;
export declare function isCapabilityAssetRef(x: unknown): x is CapabilityAssetRef;
