/**
 * `spawn_subagent` primitive — Mode A team orchestration entry point.
 *
 * Per `docs/opensquid-real-design.md` §"Team modes" Mode A + memory
 * `project_opensquid_team_modes` (Mode A = one agent + Agent-tool subagents
 * for profession-instantiation; Mode B = multi-tenant, future).
 *
 * Surface (per Task 6.2 key code shape):
 *
 *   spawn_subagent({ model, prompt, context }) → ok({ stdout, drifts[] })
 *
 *   - `model`        : model alias (USER-supplied label, NOT a vendor model
 *                      id; resolved against the active `models.yaml` by the
 *                      caller before reaching this primitive). The primitive
 *                      itself stays model-neutral — no vendor names in this
 *                      file.
 *   - `prompt`       : the subagent's initial prompt.
 *   - `context`      : optional `{ project?, profession? }`. Used by the
 *                      context-inheritance filter (Task 6.3) AND wired into
 *                      drift roll-up provenance (Task 6.4). Anything beyond
 *                      these two fields is intentionally rejected by the
 *                      Zod schema — leakage of parent session secrets MUST
 *                      NOT travel via arbitrary `context` bag.
 *
 * SDK call mode (per Task 6.2 acceptance criteria):
 *
 *   In-process Claude Agent SDK is the required mode (it's the only path
 *   that can observe the parent session — see memory
 *   `project_opensquid_model_neutral_subagent_primitive`).
 *
 *   The SDK (`@anthropic-ai/claude-agent-sdk`) is loaded LAZILY via
 *   `await import(...)` so a missing dep doesn't crash startup — the setup
 *   UI verifies presence later. If a pack actually invokes `spawn_subagent`
 *   without the SDK installed, the dynamic import throws and we surface
 *   `err({ kind: 'runtime' })` with the import error as cause.
 *
 *   The SDK package is declared as an OPTIONAL peer dep in package.json so
 *   `pnpm install` won't fail when it isn't present in the user's env.
 *
 * Test seam (`opts.sdk`):
 *
 *   Tests inject a stub SDK via `registerSubagentFunction(registry, { sdk })`
 *   to avoid requiring the real package + to assert the primitive's contract
 *   (input shape, return shape, error mapping). The default — no `opts.sdk`
 *   — falls back to the lazy dynamic import path used in production.
 *
 *   The seam is intentionally NOT a runtime override path that pack YAML can
 *   reach: the only way to plug a stub is via the registration helper, which
 *   pack-loading code does not call with `opts.sdk`. The seam exists for
 *   tests only.
 *
 * Model neutrality (per `feedback_stop_haiku_drift` + memory
 * `project_opensquid_model_neutral_subagent_primitive`): NO vendor model
 * name appears in this file. A grep for `claude` / `haiku` / `opus` /
 * `sonnet` / `gpt` should return zero hits. Treat any future addition as a
 * regression — the model alias is the only abstraction.
 *
 * Drift roll-up (Task 6.4):
 *
 *   When the subagent returns `drifts`, this primitive ALSO writes them to
 *   the parent's session-level drift catalog via `recordSubagentDrifts`
 *   (drift_catalog.ts). The subagent's own pack catalog is written by the
 *   SDK-side evaluator during its run; we do not double-write that path
 *   here. See `recordSubagentDrifts` for the provenance enrichment policy.
 *
 *   The subagent id is generated per-call (`subagent-<random>`) so two
 *   simultaneous spawns under the same profession pack remain distinguishable
 *   in the catalog. The `professionPack` comes from `context.profession`,
 *   falling back to a sentinel when the caller omits it.
 *
 *   The parent session id comes from `EvalCtx.sessionId` — the primitive
 *   runs inside the parent's evaluation context, so by construction the
 *   write target is the parent's catalog, never the subagent's own session.
 *
 * Imports from: zod, ../runtime/result.js, ../runtime/drift_catalog.js,
 *               ./registry.js.
 * Imported by: src/functions/index.ts, src/runtime/bootstrap.ts.
 */
import type { FunctionRegistry } from './registry.js';
export interface SubagentDrift {
    timestamp?: string;
    pack?: string;
    ruleId?: string;
    level?: string;
    message?: string;
}
export interface SubagentSdkRunResult {
    text: string;
    drifts?: SubagentDrift[];
}
export interface SubagentSdk {
    runAgent: (opts: {
        model: string;
        prompt: string;
        context: Record<string, unknown>;
    }) => Promise<SubagentSdkRunResult>;
}
export interface SpawnSubagentResult {
    stdout: string;
    drifts: SubagentDrift[];
}
export interface RegisterSubagentOptions {
    sdk?: SubagentSdk;
    subagentIdFactory?: () => string;
}
export declare function registerSubagentFunction(registry: FunctionRegistry, opts?: RegisterSubagentOptions): void;
//# sourceMappingURL=subagent.d.ts.map