/**
 * standalone/types.ts — Public types for the zero-orchestration standards
 * discovery surface (C20).
 *
 * This module is a sibling of `standalone/index.ts`. Every type exported here
 * is part of the `@aperant/framework/standalone` public contract; mutating a
 * shape means bumping the package's minor version at minimum.
 *
 * No imports from orchestration modules (task/*, gate/*, route/*, wfrun/*,
 * team/*, roadmap/*). Only schema-layer types and zod are allowed.
 */
import type { z } from 'zod';
import type { FeatureRegistrySchema } from '../schemas/feature-registry';
/**
 * Principle — one extracted statement from AGENTS.md or a profile's
 * obligations block. The shape mirrors what `parseAgentsMd()` emits so the
 * standalone surface can splice profile obligations into the same list
 * without extra mapping by the consumer.
 */
export type Principle = {
    id: string;
    title: string;
    text: string;
    source: {
        section: string;
        line: number;
    };
    keywords: string[];
    severity: 'must' | 'should' | 'never' | 'principle' | 'obligation' | string;
};
/**
 * FeatureRegistryArea — one validated area file from `.aperant/features/`.
 * Inferred from the canonical zod schema so the public type stays in lockstep
 * with the registry's write-time validator.
 */
export type FeatureRegistryArea = z.infer<typeof FeatureRegistrySchema>;
/**
 * FeatureRegistryInvalid — recorded when an area file cannot be parsed or
 * fails schema validation. The `errors` shape mirrors the squashed form
 * we emit from zod's SafeParseError (path[] joined with "." + message).
 */
export type FeatureRegistryInvalid = {
    path: string;
    errors: {
        path: string;
        message: string;
    }[];
};
/**
 * ResolvedProfile — loosely typed passthrough of what `resolveProfile()`
 * emits. The profile schema stays internal; we expose it as an open record so
 * the public surface does not lock consumers into our zod version.
 */
export type ResolvedProfile = Record<string, unknown>;
/**
 * DesignTokens — passthrough JSON from `.aperant/design/tokens.json`. The
 * registry's write-side validator (C27) owns the schema; the standalone read
 * surface is intentionally a passthrough so consumers can bring their own.
 */
export type DesignTokens = Record<string, unknown>;
/**
 * StandardsBundleOk — the happy-path shape of `discoverStandards()`.
 *
 * Per-section `null`s are meaningful:
 *   - `profile` is `null` when no `opts.profile` was requested.
 *   - `feature_registry` is `null` when `.aperant/features/` is absent.
 *   - `design_tokens` is `null` when `.aperant/design/tokens.json` is absent
 *     or unreadable.
 *   - `design_taste` is `null` when `.aperant/design/taste.yaml` is absent.
 *
 * `constitution` is always an object (it is the primary product) — when no
 * AGENTS.md / CLAUDE.md is found, `source` is `null` and `principles` is
 * empty.
 */
export type StandardsBundleOk = {
    ok: true;
    project_dir: string;
    constitution: {
        source: string | null;
        count: number;
        principles: Principle[];
    };
    profile: {
        name: string | null;
        chain: string[];
        resolved: ResolvedProfile | null;
    } | null;
    feature_registry: {
        count: number;
        areas: FeatureRegistryArea[];
        invalid: FeatureRegistryInvalid[];
    } | null;
    design_tokens: DesignTokens | null;
    design_taste: {
        raw: string;
    } | null;
};
/**
 * StandardsBundleError — whole-bundle failure. Returned when `projectDir`
 * does not exist or when an explicit `--profile` pointer resolves to an
 * invalid profile (cycle / unknown parent / depth exceeded / schema fail).
 * Errors are never thrown — always returned.
 */
export type StandardsBundleError = {
    ok: false;
    error: string;
    project_dir: string;
};
/**
 * StandardsBundle — the discriminated return type of `discoverStandards()`.
 * Discriminate on `ok`.
 */
export type StandardsBundle = StandardsBundleOk | StandardsBundleError;
/**
 * DiscoverStandardsOptions — optional knobs for `discoverStandards()`.
 */
export type DiscoverStandardsOptions = {
    /**
     * Resolve this profile chain and merge its obligations into
     * `constitution.principles` (AGENTS.md-wins dedup). When absent, the
     * bundle's `profile` field is `null`.
     */
    profile?: string;
};
//# sourceMappingURL=types.d.ts.map