import type { HookClient, HookHandler, LogicalHookEvent } from "./hook-core.js"; export declare const LEARNING_LIMITS: { readonly retentionMs: number; readonly maxRecords: 64; readonly maxSummaryCharacters: 2000; readonly maxIntentCharacters: 1000; }; export declare const OBSERVABILITY_LIMITS: { readonly retentionMs: number; readonly maxRecords: 128; readonly maxToolCharacters: 128; readonly maxDurationMs: number; }; declare const LEARNING_EVENTS: readonly ["after-tool", "tool-failure", "after-compact", "session-end", "stop"]; declare const OBSERVABILITY_EVENTS: readonly ["session-start", "session-end", "after-tool", "tool-failure", "after-compact", "stop"]; interface ScopedRecord { id: string; repositoryId: string; canonicalWorktree: string; harness: string; updatedAtEpochMs: number; } interface LearningRecordBase extends ScopedRecord { version: 1; } export interface LearningObservation extends LearningRecordBase { kind: "observation"; sessionId: string; event: (typeof LEARNING_EVENTS)[number]; summary: string; } export interface LearningCandidate extends LearningRecordBase { kind: "candidate"; sessionId: string; event: "after-compact" | "session-end" | "stop"; summary: string; sourceObservationId: string; sha256: string; discoverable: false; status: "pending-review"; } export interface LearningApproval extends LearningRecordBase { kind: "approval"; candidateId: string; sourceObservationId: string; candidateSha256: string; approvedBy: string; reason: string; } export type LearningStateRecord = LearningObservation | LearningCandidate | LearningApproval; export interface LearningStateStore { list(): readonly LearningStateRecord[]; save(record: LearningStateRecord): void; prune(beforeEpochMs: number): void; } export interface FileOptInStoreOptions { stateRoot: string; canonicalWorktree: string; repositoryId: string; harness: string; maxFileBytes?: number; } export declare function createFileLearningStore(options: FileOptInStoreOptions): LearningStateStore; export interface LearningHandlerOptions { enabled: boolean; repositoryId: string; canonicalWorktree: string; harness: string; store: LearningStateStore; now?: () => number; } export declare function createLearningHandler(options: LearningHandlerOptions): HookHandler; export interface ApproveLearningCandidateOptions { store: LearningStateStore; candidateId: string; humanIntent: { approvedBy: string; reason: string; approvedAtEpochMs: number; }; provenance: { sourceObservationId: string; candidateSha256: string; }; } /** Records approval evidence only. Materialization into discoverable skills is a later lifecycle step. */ export declare function approveLearningCandidate(options: ApproveLearningCandidateOptions): LearningApproval; export declare function serializeLearningState(records: readonly LearningStateRecord[]): string; export interface ObservabilityRecord extends ScopedRecord { version: 1; sessionId: string; client: HookClient; event: (typeof OBSERVABILITY_EVENTS)[number]; tool?: string; outcome?: "ok" | "failed"; durationMs?: number; eventCount: 1; } export interface ObservabilityStore { list(): readonly ObservabilityRecord[]; save(record: ObservabilityRecord): void; prune(beforeEpochMs: number): void; } export declare function createFileObservabilityStore(options: FileOptInStoreOptions): ObservabilityStore; export interface PersonalObservabilityHandlerOptions { enabled: boolean; repositoryId: string; canonicalWorktree: string; harness: string; store: ObservabilityStore; now?: () => number; } export declare function createPersonalObservabilityHandler(options: PersonalObservabilityHandlerOptions): HookHandler; export declare const OPT_IN_ECC_HOOK_IDS: readonly ["learning", "personal-observability"]; export type OptInEccHookId = (typeof OPT_IN_ECC_HOOK_IDS)[number]; export declare function optInEccHookEvents(): Readonly>; export {};