/** * Task-scoped context injection (change: add-task-scoped-context-injection). * * `openlore orient --inject` is wired by `openlore install` as a per-task * pre-turn hook (Claude Code `UserPromptSubmit`). It runs `orient` for the * user's submitted prompt and emits a bounded, OpenLore-attributed, explicitly * ignorable orientation block to stdout, so the agent's first turn begins * already oriented to the task — amortizing the per-task `orient` round-trip to * zero rather than optimizing it. * * The block is a presentation-and-gating wrapper over the existing lean `orient` * output (Spec 27); there is no second orientation code path. It is deterministic * (no LLM), framed as facts-not-coercion (Epistemic Lease, decision 8e95746d), * and capped by a token budget so it can never dominate the context it economizes. * * Fail-open is load-bearing: a hook must never break the user's turn. Any * failure — missing graph, parse error, empty match, weak match, or empty * prompt — degrades to a single pointer line and exits 0. */ import { type RelevanceGateEvaluation } from './orient-inject-render.js'; export { INJECTION_DEFAULTS, MIN_INJECTION_TOKEN_BUDGET, POINTER_LINE, classifyTurnIntent, isHarnessEvent, pointerLineFor, resolveInjectionConfig, evaluateRelevanceGate, passesRelevanceGate, renderInjectionBlock, } from './orient-inject-render.js'; export type { ResolvedInjectionConfig, LeanOrientResult, RelevanceGateEvaluation, TurnIntent, WithholdReason, PointerReason, } from './orient-inject-render.js'; /** * Extract the user's prompt from a hook stdin payload. Claude Code's * `UserPromptSubmit` hook passes a JSON object with a `prompt` field; other * harnesses may pass the raw prompt text. Returns '' when no usable prompt is * present (→ pointer line). */ export declare function extractPrompt(stdin: string): string; /** * `orient --proposal-only` (the Codex prompt hook): the proposal instruction for a recognized * OpenSpec propose prompt, or ''. Honors the same `contextInjection.mode: "off"` opt-out as * `buildInjection`. Never throws. */ export declare function buildProposalOnlyInjection(directory: string, prompt: string): Promise; /** * Top-level injection builder. Returns the string to emit on stdout: * - '' when injection is disabled (`mode: "off"`) — the caller emits nothing, * - the full block when both gates pass, * - a reason-bearing pointer line on every gate withhold (management intent, * weak match, no graph, or empty prompt), * - '' when the lookup fails. * * Every gate withhold emits a line that names its cause and the manual `orient` * call, so the agent can always tell "nothing relevant was found" from "no * lookup was performed" (change: scope-advisory-noise-to-touched-code). A failed * lookup is silent instead: the agent is told nothing about OpenLore's own * failure, and the operator sees it in the hook's health (change: hook-reliability). * * Never throws, so a hook that invokes it cannot break the user's turn. */ export declare function buildInjection(directory: string, prompt: string, onGateEvaluation?: (evaluation: RelevanceGateEvaluation) => void): Promise; //# sourceMappingURL=orient-inject.d.ts.map