/** * reviewMemoryIo — the NODE-SIDE (deterministic JS) transport for the * code-review → comment_reply structured memory record. * * WHY THIS EXISTS * ─────────────── * `reviewRecord.js` is PURE (build/serialize/parse/summarize — no I/O). Until now * the only thing that STORED/RECALLED the per-PR/MR memory was the LLM, via the * kv-memory MCP skill (`kv_store`/`kv_recall`). "Path A" of the approved design * lifts that I/O into the JS node so storage is DETERMINISTIC, not LLM-authored. * This module is that transport: a thin, BEST-EFFORT client that serializes a * record and POSTs it, and recalls + parses one back — reusing the SAME backend * route, ops, auth and namespacing the kv-memory skill (kvMemory.js) already uses, * so the two channels share one scope and one backend entry. * * It lives in @zibby/skills (next to kvMemory.js, whose transport it mirrors), NOT * in the generic @zibby/core kernel — this is review-domain code, and both review * templates already depend on @zibby/skills. The auth + namespace helpers below * are inlined (self-contained), byte-identical to kvMemory.js — keeping them the * same is what makes the node-side scope agree with the kv-memory skill's scope * for the same key (so a node-side store and a later LLM kv_recall land on the * SAME backend SK). If kvMemory.js's behaviour changes, change these to match. * * TRANSPORT CONTRACT (identical to kvMemory.js): * POST `${getAccountApiUrl()}/credits/review-memory` * Authorization: Bearer ${PROJECT_API_TOKEN} * body: { op:'store', scope, content } | { op:'recall', scope } * recall returns { content, metadata, ... } (content = stored STRING or null). * scope is namespaced `${WORKFLOW_TYPE-or-'agent'}:${key}`. * * BEST-EFFORT, ALWAYS. Every function swallows all errors and NEVER throws — a * memory store/recall failure must never block or change a posted review/reply. * store → { ok:false } on any failure; recall → { kind:'empty' } on any failure. */ /** Effective backend scope for a plain per-PR/MR key. IDENTICAL to kvMemory scopeFor. */ export declare function scopeForReviewMemory(key: any): string; /** * Store a review record under a plain per-PR/MR key. Serializes via * serializeReviewRecord (deterministic, byte-capped 200KB) and POSTs * { op:'store', scope, content }. * * BEST-EFFORT: never throws. { ok:true } on success; { ok:false, reason:'no-token' } * with no backend credential (local dev / self-host); { ok:false, reason } otherwise. * The caller must treat a false result as a no-op — memory NEVER blocks a run. */ export declare function storeReviewRecord(key: any, record: any): Promise<{ ok: boolean; reason?: undefined; } | { ok: boolean; reason: any; }>; /** * Recall the review record stored under a plain per-PR/MR key. POSTs * { op:'recall', scope } and hands the returned `content` to the tolerant * parseReviewMemory (which never throws over any input). * * BEST-EFFORT: never throws. Returns parseReviewMemory's result * ({ kind:'empty' | 'record' | 'legacy', ... }); { kind:'empty' } on missing * token or ANY failure, so the caller degrades to "no prior memory". */ export declare function recallReviewRecord(key: any): Promise<{ kind: string; record?: undefined; future?: undefined; legacyNote?: undefined; } | { kind: string; record: any; future: boolean; legacyNote?: undefined; } | { kind: string; legacyNote: string; record?: undefined; future?: undefined; }>;