/** * UserPromptSubmit UX renderer. Combines the peer-refresh dedup, the * council-pending hash-dedup, the cross-adapter first-session naming nudge, * the Cursor/Codex set-task staleness nudge, a host-configured prompt reminder, * and the Codex status-footer reminder. * agent-hook's turn.started post-emit handler calls this * and forwards the result as the adapter-shaped additionalContext payload. * * Four subsections combined into one additionalContext payload: * 1. Peer table: semantically-relevant peer fields hashed; only re-emits * when peers change (name + instance_id + session_id + kind + started_at * + sorted(files_touched) + platform, sorted by instance_id). * 2. Council pending: pending open-council IDs hashed; re-emits when the * ID set changes. * 3. Focus nudge. Until the session has displayed its current suggested * name, tells every adapter on every prompt to send the exact fenced block * before prose or another tool call. * Cursor/Codex additionally get the existing unset/stale-task reminder * because their Stop hooks do not enforce task declarations as reliably * as Claude Code's. * 4. Host prompt reminder: a project-owned, non-deduplicated line for * adapters whose prompt hook can inject context and which lack a native * reminder mechanism. Hook routing decides which adapters enable it. * 5. Codex status footer: a non-deduplicated reminder to put the live status * box after the substantive answer. Stop stays observe-only, so missing the * footer can never trigger a replacement response. * * Hash files live at: * .harnery/.last-peer-hash. * .harnery/.last-council-hash. * .harnery/.last-task-nudge-hash. * * First call always emits (hash files don't exist). */ export interface PromptContextOpts { coordRoot: string; instanceId: string; sessionId: string; agentName?: string; /** When true, remind a human-facing session to print the session name before * its first set-task. UserPromptSubmit enables this for every adapter. */ sessionNameNudge?: boolean; /** When true, run the unset/stale-task check after the first set-task. * Cursor/Codex use this; Claude Code has Stop-hook transcript enforcement. */ taskNudge?: boolean; /** When true, append the project-configured prompt reminder without hash * deduplication. The caller enables this only on supported adapter routes. */ hostPromptReminder?: boolean; /** When true, append the non-deduplicated Codex status-footer reminder. * The caller enables this only for human-facing Codex sessions. */ statusFooterNudge?: boolean; /** Adapter id whose Stop hook ENFORCES the end-of-turn ritual (task_set + * status check). When set, append a fresh per-prompt reminder of that * contract so the model satisfies it before ending the turn instead of * being bounced into a retry. Not hash-deduped, same rationale as the * status footer. */ turnRitualNudge?: string; } /** * Build the combined UserPromptSubmit additionalContext string. Returns "" when * nothing has changed since the last call (so the caller can skip the JSON emit). * * Side effects: updates `.harnery/.last-peer-hash.` and `.harnery/.last-council-hash.` * when their respective sections re-emit (or removes the council hash when no * councils are pending, matching the bash behavior). */ export declare function renderPromptContext(opts: PromptContextOpts): string; /** * Prompts receive the published assessment, and only when it changes in a way * that changes what an agent should do. The dedupe key is scope, state, and * recommended action, so a moving number or a different contributor does not * re-emit the same advice. */ export declare function resourceWarningIfChanged(coordRoot: string, instanceId: string): string; //# sourceMappingURL=prompt-context.d.ts.map