docs: document agent cache helpers

This commit is contained in:
Peter Steinberger
2026-06-04 09:00:00 -04:00
parent b53c6eae62
commit 0dea7eab37
2 changed files with 10 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
/**
* Optional JSONL diagnostics for agent cache/session/prompt tracing.
*/
import crypto from "node:crypto";
import path from "node:path";
import { resolveStateDir } from "../config/paths.js";
@@ -11,8 +14,8 @@ import type { AgentMessage, StreamFn } from "./runtime/index.js";
import { stableStringify } from "./stable-stringify.js";
import { buildAgentTraceBase } from "./trace-base.js";
// Optional cache-trace diagnostics for prompt/session/cache debugging. Payloads
// are redacted before JSONL output while stable digests preserve correlation.
// Payloads are redacted before JSONL output while stable digests preserve
// correlation across prompt/session/cache stages.
type CacheTraceStage =
| "cache:result"
| "cache:state"

View File

@@ -1,3 +1,6 @@
/**
* SQLite implementation of the agent runtime cache store.
*/
import {
MAX_DATE_TIMESTAMP_MS,
asDateTimestampMs,
@@ -24,13 +27,13 @@ import type {
AgentRuntimeCacheWriteOptions,
} from "./agent-cache-store.js";
// SQLite-backed agent runtime cache. Entries are scoped per agent/scope pair and
// can store JSON values, binary blobs, and optional expiration timestamps.
/** Options for an agent/scope-scoped SQLite runtime cache. */
export type SqliteAgentCacheStoreOptions = OpenClawAgentDatabaseOptions & {
scope: string;
now?: () => number;
};
/** Options for writing a single SQLite agent cache entry. */
export type WriteSqliteAgentCacheEntryOptions = SqliteAgentCacheStoreOptions &
AgentRuntimeCacheWriteOptions;