mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
docs: document agent cache helpers
This commit is contained in:
@@ -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"
|
||||
|
||||
7
src/agents/cache/agent-cache-store.sqlite.ts
vendored
7
src/agents/cache/agent-cache-store.sqlite.ts
vendored
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user