import type { GoalRuntimeEngine } from "../runtime/engine.js"; import type { LoopHooks } from "../runtime/ports.js"; import type { TreePolicy } from "../core/tree.js"; import type { ExtensionAPI } from "./pi-types.js"; import { type GoalsRuntime } from "./tools.js"; export interface GoalsExtensionOptions { /** Store root override (default: shared/paths stateDir(process environment)). */ readonly stateDir?: string; /** Lock dir override (default: shared/paths runtimeDir(process environment)). */ readonly runtimeDir?: string; /** Path-resolution environment override (default: the live process one). */ readonly pathEnv?: NodeJS.ProcessEnv; /** Injected clock (tests). */ readonly clock?: () => number; /** Injected randomness (tests). */ readonly randomBytes?: (count: number) => Uint8Array; /** Continuation-loop hooks (R7); no-ops by default. */ readonly loopHooks?: LoopHooks; /** TODO tree policy overrides. */ readonly treePolicy?: Partial; /** Lock staleness threshold in ms. */ readonly lockStaleAfterMs?: number; /** Stream read byte cap. */ readonly maxStreamBytes?: number; } export interface GoalsExtensionHandle { /** Test/introspection accessor for the session runtime (null offline). */ getRuntime(): GoalsRuntime | null; /** Engine accessor kept for symmetry with the CLI phase (null offline). */ getEngine(): GoalRuntimeEngine | null; } export default function goalsExtension(pi: ExtensionAPI, options?: GoalsExtensionOptions): GoalsExtensionHandle;