import { type WorkforcePersonaResolver, type WorkforcePersonaModule } from './workforce-persona-writer.js';
/**
 * Tiers accepted by Ricky-local persona specs. Mirrors the workload-router
 * 0.19 `PersonaTier` tuple. We hardcode it instead of importing because the
 * Ricky-local resolver must keep loading even when `@agentworkforce/workload-router`
 * is unavailable (the test path stubs the package out).
 */
export declare const RICKY_LOCAL_PERSONA_TIERS: readonly ["best", "best-value", "minimum"];
export type RickyLocalPersonaTier = (typeof RICKY_LOCAL_PERSONA_TIERS)[number];
export interface RickyLocalPersonaSpec {
    id: string;
    intent: string;
    tags: string[];
    description: string;
    skills: Array<{
        id: string;
        source: string;
        description: string;
    }>;
    inputs?: Record<string, {
        description?: string;
        default?: string;
        optional?: boolean;
    }>;
    tiers: Record<RickyLocalPersonaTier, RickyLocalPersonaRuntime>;
    defaultTier?: RickyLocalPersonaTier;
    env?: Record<string, string>;
    /**
     * Optional top-level permission policy. When the active tier does not
     * declare its own `permissions`, the resolver falls back to this value;
     * when both are unset, the resolver picks a harness-appropriate default
     * (`bypassPermissions` for claude, undefined for codex/opencode — see
     * {@link DEFAULT_RICKY_LOCAL_CLAUDE_PERMISSIONS}). Mirrors the shape
     * `@agentworkforce/harness-kit` reads off the selection in its
     * `useRunnableSelection` entrypoint.
     */
    permissions?: RickyLocalPersonaPermissions;
}
export interface RickyLocalPersonaRuntime {
    harness: 'claude' | 'codex' | 'opencode';
    model: string;
    systemPrompt: string;
    harnessSettings: {
        reasoning?: string;
        timeoutSeconds?: number;
    };
    claudeMd?: string;
    agentsMd?: string;
    /** Optional tier-level override of the persona's permission policy. */
    permissions?: RickyLocalPersonaPermissions;
}
/**
 * Shape consumed by harness-kit when it builds the spawn args:
 * - `mode` translates to `--permission-mode <mode>` for the claude harness.
 * - `allow` / `deny` translate to `--allowedTools` / `--disallowedTools`.
 * See `@agentworkforce/harness-kit`'s `harness.ts` for the canonical map.
 */
export interface RickyLocalPersonaPermissions {
    mode?: 'acceptEdits' | 'auto' | 'bypassPermissions' | 'default' | 'dontAsk' | 'plan';
    allow?: readonly string[];
    deny?: readonly string[];
}
/**
 * Default permission policy for Ricky-local personas that target the claude
 * harness. Ricky-local always invokes the writer subprocess **headlessly**
 * (no interactive caller able to grant tool-use approvals), so the default
 * has to be a mode the claude CLI treats as pre-authorized. Without this
 * the writer hangs on the first tool-permission prompt and ricky observes
 * a SIGTERM with empty stdout — exactly the failure mode that motivated
 * this constant.
 *
 * Personas can override this by declaring their own `permissions` block on
 * the spec or any tier; pass `{}` to opt out of bypass while still
 * surfacing tools, or `{ mode: 'default' }` to restore claude's default
 * (interactive) permission behavior for personas that genuinely need it.
 */
export declare const DEFAULT_RICKY_LOCAL_CLAUDE_PERMISSIONS: RickyLocalPersonaPermissions;
/**
 * Absolute path to the Ricky-local persona directory. Walks up from this
 * module's URL looking for a directory that contains the sentinel persona
 * file. Works under all the layouts Ricky ships in:
 * - source via tsx (`src/product/generation/...`)
 * - bundled CLI (`dist/ricky.js` adjacent to `personas/`)
 * - npm install (`node_modules/@agentworkforce/ricky/dist/ricky.js`)
 * Falls back to the legacy three-up resolution so tests that mock
 * `import.meta.url` still get a deterministic path.
 */
export declare function rickyLocalPersonaDir(): string;
interface LoadedPersonaCache {
    byIntent: Map<string, RickyLocalPersonaSpec>;
}
/**
 * Returns the Ricky-local persona for `intent`, or `null` when no Ricky-local
 * override exists. Reads `personas/*.json` lazily on first call and memoizes
 * across the process lifetime.
 */
export declare function loadRickyLocalPersona(intent: string): Promise<RickyLocalPersonaSpec | null>;
/** Test seam: forget any cached Ricky-local persona specs so subsequent loads re-read from disk. */
export declare function resetRickyLocalPersonaCacheForTests(): void;
/**
 * Loads every Ricky-local persona spec available to the resolver. Seeds the
 * cache from {@link BUNDLED_RICKY_LOCAL_PERSONAS} (always present because
 * esbuild inlines them at bundle time), then layers any `personas/*.json`
 * read from `dir` on top so a developer-edited file overrides the bundled
 * default for that intent.
 *
 * The bundled fallback exists because the install-time filesystem layout has
 * proven fragile: between v0.1.38 and v0.1.51 the `files` array in
 * `package.json` did not include `"personas"`, so the published tarball
 * shipped without the directory and every `npm install -g
 * @agentworkforce/ricky` of those versions was silently broken at the writer
 * step. The bundle is the source of truth at runtime; the filesystem is a
 * developer-time override mechanism.
 *
 * Files that fail to parse are skipped silently — the resolver treats a
 * malformed override as "fall back to the bundled spec or the package
 * resolver" rather than hard-failing the writer.
 */
export declare function loadAllRickyLocalPersonas(dir: string): Promise<LoadedPersonaCache>;
/**
 * Resolves the tier to use for a given Ricky-local persona. Honors
 * `options.tier` first, then the persona's own `defaultTier`, then
 * `'best-value'` (the system-wide default). Falls back to `'best-value'`
 * when the requested tier isn't declared on the spec.
 */
export declare function resolveRickyLocalPersonaTier(spec: RickyLocalPersonaSpec, options?: {
    tier?: string;
}): RickyLocalPersonaTier;
/**
 * Builds a workload-router-compatible `PersonaSelection` object from a
 * Ricky-local persona spec. The output is typed loosely because workload-router
 * does not export its `PersonaSelection` parser, and Ricky-local personas are
 * hand-validated at load time.
 */
export declare function buildPersonaSelectionFromRickyLocalSpec(spec: RickyLocalPersonaSpec, tier: RickyLocalPersonaTier): {
    personaId: string;
    tier: RickyLocalPersonaTier;
    runtime: RickyLocalPersonaRuntime;
    skills: RickyLocalPersonaSpec['skills'];
    rationale: string;
    inputs?: RickyLocalPersonaSpec['inputs'];
    env?: RickyLocalPersonaSpec['env'];
    permissions?: RickyLocalPersonaPermissions;
};
interface HarnessKitRunnableSelectionModule {
    useRunnableSelection?: WorkforcePersonaModule['useRunnableSelection'];
}
type RunnableSelectionLoader = () => Promise<HarnessKitRunnableSelectionModule>;
/**
 * Creates a `WorkforcePersonaResolver` that prefers Ricky-local Claude
 * persona overrides (`personas/*.json`) over the package resolver. For any
 * intent that has no Ricky-local override, the resolver falls back to the
 * supplied `fallback` (defaults to {@link packageWorkforcePersonaResolver}),
 * preserving the prior workforce-package behavior end-to-end.
 *
 * The Ricky-local path constructs a `PersonaSelection` by hand and hands
 * it to `@agentworkforce/harness-kit`'s `useRunnableSelection` to obtain a
 * runnable `WorkforcePersonaContext`. This avoids depending on the v3
 * persona-kit shape (which dropped tiers) and stays compatible with the
 * 0.19 router/harness-kit pair pinned by Ricky today.
 */
export declare function createRickyLocalPersonaResolver(options?: {
    fallback?: WorkforcePersonaResolver;
    loadRunnableSelectionModule?: RunnableSelectionLoader;
}): WorkforcePersonaResolver;
export {};
