/**
 * Runtime bootstrap — function registry + active-pack source for hook binaries.
 *
 * Two entry points every hook binary imports:
 *
 *   - `buildRegistry()` — assembles a `FunctionRegistry` with all primitive
 *     families registered: event / state / verdict / llm. RAG is NOT
 *     registered here (see "RAG omission" below).
 *
 *   - `loadActivePacks(sessionId)` — Phase 1 test seam. Returns whatever was
 *     last `setActivePacks(...)`'d in-process, or — for subprocess-launched
 *     hooks — packs serialized via the `OPENSQUID_TEST_PACK` env var. Phase 2
 *     replaces this with a real YAML loader that reads `~/.opensquid/active.json`,
 *     resolves pack sources, parses pack YAML, and respects per-skill load
 *     modes. The `Promise<Pack[]>` signature is pinned now so the Phase 2
 *     swap is body-only — call sites do not refactor.
 *
 * RAG wiring (T-loop-engine-reintegration / T.3 — first-ever production
 * registration of recall/embed/store_lesson):
 *   `registerRagFunctions(registry, backend)` is now called per-bootstrap
 *   with a backend chosen by `resolveBackendConfig()` (env > config.json >
 *   default = loop-engine if engine binary discoverable, else libsql-qwen3).
 *   The cost concerns that justified Phase 1 omission are resolved: the
 *   default `loop-engine` path connects to a shared UDS daemon (T.4), so
 *   per-hook boot cost is one socket-connect + one ping, not a full libsql
 *   open. `buildRegistry()` becomes async to accommodate `backend.init()`
 *   (engine handshake / libsql CREATE TABLE depending on backend). All
 *   four hook bins already await it.
 *
 * Two env-var test seams (subprocess hook bridge):
 *
 *   `OPENSQUID_TEST_PACK` (Phase-1 legacy seam, kept for backward compat):
 *     A JSON-encoded `Pack` object the child self-seeds at module-load.
 *     Phase 2.7 keeps this so existing call sites and any in-flight tests
 *     that hand-build a pack still work. Malformed JSON is silently ignored
 *     (returns `[]`) — fail-safe, test-only. NEVER document in user docs.
 *
 *   `OPENSQUID_TEST_PACK_DIR` (Phase-2.7 seam, preferred):
 *     An absolute path to an on-disk YAML pack folder (`manifest.yaml` +
 *     `skills/*\/skill.yaml`). The child invokes the real `loadPack` from
 *     `src/packs/loader.ts` synchronously at module load via a promise +
 *     `await` chain handed to `loadActivePacks`. Errors are swallowed at
 *     the same fail-safe contract as the JSON seam — a missing folder or
 *     malformed YAML yields `[]`, surfacing as the empty-active-packs
 *     "allow everything" path. That keeps the seam a strict superset of
 *     Phase-1 behavior so tests can flip from inline → on-disk without
 *     changing assertions.
 *
 *   Both seams compose: if `OPENSQUID_TEST_PACK_DIR` is set, its loaded
 *   pack is appended to whatever `OPENSQUID_TEST_PACK` produced. In
 *   practice tests use exactly one of the two.
 *
 * Imports from: functions/, packs/loader.
 * Imported by: runtime/hooks/*.ts (per-hook binaries), runtime/index.ts (re-export).
 */
import { type WedgeLessonStore } from '../rag/wedge/store.js';
import { FunctionRegistry } from '../functions/registry.js';
import type { RagBackend } from '../rag/types.js';
import type { Pack } from './types.js';
export interface BuildRegistryOpts {
    /** Inject a pre-built backend (tests). Skips config resolution + init. */
    backend?: RagBackend;
    /**
     * Inject a pre-built wedge lesson store for the lesson primitives (tests).
     * Production builds construct a fresh `wedgeLessonStore` over libSQL + the
     * status-dir per-file source (retire-Rust RES-3c — the lesson surface no
     * longer touches the Rust engine).
     *
     * Pass an explicit stub (or `null`) in tests that exercise pure runtime
     * paths and don't want a real store. `null` disables lesson registration
     * entirely; `undefined` constructs a fresh store (production default).
     */
    lessonStore?: WedgeLessonStore | null;
}
export declare function buildRegistry(opts?: BuildRegistryOpts): Promise<FunctionRegistry>;
export declare function setActivePacks(packs: Pack[]): void;
/**
 * Returns the composed active-pack list for this hook subprocess.
 *
 * Order: in-process override (`setActivePacks`) wins outright; on top of
 * that the env-var JSON seam, the disk-YAML seam, and the real on-disk
 * loader compose by concatenation. Real-loader output is scope-sorted
 * before concat; test-seam packs preserve insertion order so tests can
 * assert specific positioning.
 */
export declare function loadActivePacks(_sessionId: string): Promise<Pack[]>;
//# sourceMappingURL=bootstrap.d.ts.map