agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
50 lines • 3.89 kB
JavaScript
;
/**
* agentfootprint/cache — public surface for the cache layer.
*
* The strategy an agent runs is chosen by CAPABILITY: the provider adapter
* declares how its wire caches (`LLMProvider.promptCaching`) and
* `cacheStrategyFor(provider, model?)` returns the strategy that serves it —
* - `BreakpointCacheStrategy` — `mode: 'breakpoints'` (Anthropic's
* `cache_control`; `anthropic()`, `browserAnthropic()`);
* - `AutomaticCacheStrategy` — `mode: 'automatic'` (OpenAI and Azure
* OpenAI cache on their own);
* - `NoOpCacheStrategy` — nothing declared for the model (Mock, Ollama,
* Gemini, any adapter that has not said).
* Nothing registers at module load and nothing is keyed by provider name, so
* a decorator that renames its provider keeps caching by forwarding the
* declaration.
*
* Public types (re-exported for consumers):
* - PromptCaching (the provider's declaration), CachePolicy, CacheMarker,
* CacheStrategy, CacheMetrics, CachePolicyContext, CacheStrategyContext,
* CacheUsage
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.cacheRecorder = exports.AutomaticCacheStrategy = exports.BreakpointCacheStrategy = exports.NoOpCacheStrategy = exports.promptCachingFor = exports.cacheStrategyFor = exports.describeClaim = exports.valueOr = exports.isKnown = exports.notApplicable = exports.unknown = exports.known = void 0;
// The honesty primitive the meter is typed in (9.59.0). Re-exported
// reference-equal from `src/lib/claim/` — the SAME symbols
// `agentfootprint/maps` exports, so `known` from either door is one function.
var claim_js_1 = require("../lib/claim/claim.js");
Object.defineProperty(exports, "known", { enumerable: true, get: function () { return claim_js_1.known; } });
Object.defineProperty(exports, "unknown", { enumerable: true, get: function () { return claim_js_1.unknown; } });
Object.defineProperty(exports, "notApplicable", { enumerable: true, get: function () { return claim_js_1.notApplicable; } });
Object.defineProperty(exports, "isKnown", { enumerable: true, get: function () { return claim_js_1.isKnown; } });
Object.defineProperty(exports, "valueOr", { enumerable: true, get: function () { return claim_js_1.valueOr; } });
Object.defineProperty(exports, "describeClaim", { enumerable: true, get: function () { return claim_js_1.describeClaim; } });
// Strategy selection — by the provider's declared capability, never its name
var cacheStrategyFor_js_1 = require("./cacheStrategyFor.js");
Object.defineProperty(exports, "cacheStrategyFor", { enumerable: true, get: function () { return cacheStrategyFor_js_1.cacheStrategyFor; } });
Object.defineProperty(exports, "promptCachingFor", { enumerable: true, get: function () { return cacheStrategyFor_js_1.promptCachingFor; } });
// Built-in strategy classes (for consumers who want explicit overrides via
// `Agent.create({ cacheStrategy })`)
var NoOpCacheStrategy_js_1 = require("./strategies/NoOpCacheStrategy.js");
Object.defineProperty(exports, "NoOpCacheStrategy", { enumerable: true, get: function () { return NoOpCacheStrategy_js_1.NoOpCacheStrategy; } });
var BreakpointCacheStrategy_js_1 = require("./strategies/BreakpointCacheStrategy.js");
Object.defineProperty(exports, "BreakpointCacheStrategy", { enumerable: true, get: function () { return BreakpointCacheStrategy_js_1.BreakpointCacheStrategy; } });
var AutomaticCacheStrategy_js_1 = require("./strategies/AutomaticCacheStrategy.js");
Object.defineProperty(exports, "AutomaticCacheStrategy", { enumerable: true, get: function () { return AutomaticCacheStrategy_js_1.AutomaticCacheStrategy; } });
// Recorder
var cacheRecorder_js_1 = require("./cacheRecorder.js");
Object.defineProperty(exports, "cacheRecorder", { enumerable: true, get: function () { return cacheRecorder_js_1.cacheRecorder; } });
//# sourceMappingURL=index.js.map