/**
 * Section runtime engine resolver (M7).
 *
 * Canonical home of `resolveRuntime`, `resolveToolsConfig`, and their
 * supporting helpers/types. As of M7 PR 7 the previous duplicates in
 * `packages/section-player/src/components/shared/section-player-runtime.ts`
 * have been deleted; section-player now consumes these helpers via
 * `@pie-players/pie-assessment-toolkit/runtime/internal`.
 *
 * What is NOT absorbed in this module:
 * - `resolvePlayerRuntime` stays in section-player because it depends on
 *   `DEFAULT_PLAYER_DEFINITIONS` (which side-effect-imports the
 *   item-player package). The toolkit core stays free of that
 *   dependency by exposing a parametrized orchestrator —
 *   `resolveSectionEngineRuntimeState` — that takes a `resolvePlayerRuntime`
 *   callable. The section-player wrapper
 *   (`resolveSectionPlayerRuntimeState` in
 *   `packages/section-player/src/components/shared/section-player-host-runtime.ts`)
 *   hands its local implementation in.
 *
 * Runtime-owned configuration flows through `runtime.<key>`. Layout-only
 * inputs stay on the section-player host elements.
 */
import type { LoaderConfig } from "@pie-players/pie-players-shared/loader-config";
import type { LoadingCompleteDetail, StageChangeDetail } from "@pie-players/pie-players-shared/pie";
import type { FrameworkErrorModel } from "../../services/framework-error.js";
import type { ToolConfigStrictness } from "../../services/tool-config-validation.js";
export declare const DEFAULT_ASSESSMENT_ID = "section-demo-direct";
export declare const DEFAULT_PLAYER_TYPE = "iife";
export declare const DEFAULT_LAZY_INIT = true;
export declare const DEFAULT_ISOLATION = "inherit";
export declare const DEFAULT_ENV: Record<string, unknown>;
export type PlayerOverrides = {
    loaderConfig?: LoaderConfig;
    loaderOptions?: Record<string, unknown>;
    [key: string]: unknown;
};
export type FrameworkErrorHandler = (model: FrameworkErrorModel) => void;
export type StageChangeHandler = (detail: StageChangeDetail) => void;
export type LoadingCompleteHandler = (detail: LoadingCompleteDetail) => void;
/**
 * Section runtime config.
 *
 * Documented exceptions (no runtime mirror, by design): identity
 * (`section-id`, `attempt-id`, `section`); layout-only shell knobs
 * (`show-toolbar`, `toolbar-position`, etc.); and layout-shell host
 * data (`policies`, `hooks`, `toolRegistry`, `*HostButtons`). Those
 * surfaces are layout-shell concerns; the runtime engine does not see
 * them. See section-player's ARCHITECTURE.md for the full policy.
 */
export type RuntimeConfig = {
    assessmentId?: string;
    playerType?: string;
    player?: PlayerOverrides | null;
    lazyInit?: boolean;
    tools?: Record<string, unknown> | null;
    toolContextResolvers?: Record<string, unknown> | null;
    accessibility?: Record<string, unknown> | null;
    coordinator?: unknown;
    createSectionController?: unknown;
    isolation?: string;
    env?: Record<string, unknown>;
    toolConfigStrictness?: ToolConfigStrictness;
    onFrameworkError?: FrameworkErrorHandler;
    onStageChange?: StageChangeHandler;
    onLoadingComplete?: LoadingCompleteHandler;
};
export type RuntimeInputs = {
    assessmentId?: string;
    toolConfigStrictness?: ToolConfigStrictness;
    onFrameworkError?: FrameworkErrorHandler;
    onStageChange?: StageChangeHandler;
    onLoadingComplete?: LoadingCompleteHandler;
    runtime: RuntimeConfig | null;
};
/**
 * Resolve the canonical `onFrameworkError` handler from the two-tier
 * surface. Precedence (highest first): `runtime.onFrameworkError`,
 * then top-level `onFrameworkError`. Layout CEs and the kernel call
 * this so every entry point converges on the same handler.
 */
export declare function resolveOnFrameworkError(args: {
    runtime: RuntimeConfig | null;
    onFrameworkError?: FrameworkErrorHandler;
}): FrameworkErrorHandler | undefined;
export declare function resolveToolsConfig(args: {
    runtime: RuntimeConfig | null;
}): {
    placement: {
        [x: string]: unknown;
    };
};
export declare function resolveRuntime(args: {
    assessmentId: string;
    runtime: RuntimeConfig | null;
    effectiveToolsConfig: unknown;
    toolConfigStrictness?: ToolConfigStrictness;
    onFrameworkError?: FrameworkErrorHandler;
    onStageChange?: StageChangeHandler;
    onLoadingComplete?: LoadingCompleteHandler;
}): {
    assessmentId: string | undefined;
    playerType: string;
    player: {
        [key: string]: unknown;
        loaderConfig?: LoaderConfig;
        loaderOptions?: Record<string, unknown>;
    } | null;
    lazyInit: boolean;
    accessibility: Record<string, unknown> | null;
    coordinator: {} | null;
    createSectionController: unknown;
    isolation: string;
    env: Record<string, unknown>;
    toolConfigStrictness: "off" | "error" | "warn";
    onFrameworkError: FrameworkErrorHandler | undefined;
    onStageChange: StageChangeHandler | undefined;
    onLoadingComplete: LoadingCompleteHandler | undefined;
    tools: unknown;
    toolContextResolvers?: Record<string, unknown> | null;
};
/**
 * Effective runtime returned by `resolveRuntime`. The shape is exposed
 * as `unknown` at the public boundary because consumers spread it into
 * arbitrary host props; downstream call sites narrow with the specific
 * keys they need.
 */
export type EffectiveRuntime = ReturnType<typeof resolveRuntime>;
/**
 * Engine-side orchestrator that powers `resolveSectionPlayerRuntimeState`
 * from section-player and takes
 * `resolvePlayerRuntime` as an injected callable so the toolkit core
 * stays free of host-coupled defaults (`DEFAULT_PLAYER_DEFINITIONS`).
 */
export declare function resolveSectionEngineRuntimeState<P>(args: RuntimeInputs, deps: {
    resolvePlayerRuntime: (resolverArgs: {
        effectiveRuntime: Record<string, unknown>;
        playerType: string;
        env: Record<string, unknown> | null;
    }) => P;
}): {
    effectiveToolsConfig: unknown;
    effectiveRuntime: EffectiveRuntime;
    playerRuntime: P;
};
