agentfootprint 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/llm/BrowserAnthropicProvider.js +68 -0
- package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/cache/CacheDecisionSubflow.js +172 -0
- package/dist/cache/CacheDecisionSubflow.js.map +1 -0
- package/dist/cache/CacheGateDecider.js +122 -0
- package/dist/cache/CacheGateDecider.js.map +1 -0
- package/dist/cache/applyCachePolicy.js +55 -0
- package/dist/cache/applyCachePolicy.js.map +1 -0
- package/dist/cache/cacheRecorder.js +120 -0
- package/dist/cache/cacheRecorder.js.map +1 -0
- package/dist/cache/index.js +47 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/strategies/AnthropicCacheStrategy.js +102 -0
- package/dist/cache/strategies/AnthropicCacheStrategy.js.map +1 -0
- package/dist/cache/strategies/BedrockCacheStrategy.js +81 -0
- package/dist/cache/strategies/BedrockCacheStrategy.js.map +1 -0
- package/dist/cache/strategies/NoOpCacheStrategy.js +40 -0
- package/dist/cache/strategies/NoOpCacheStrategy.js.map +1 -0
- package/dist/cache/strategies/OpenAICacheStrategy.js +75 -0
- package/dist/cache/strategies/OpenAICacheStrategy.js.map +1 -0
- package/dist/cache/strategyRegistry.js +80 -0
- package/dist/cache/strategyRegistry.js.map +1 -0
- package/dist/cache/types.js +25 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/conventions.js +18 -0
- package/dist/conventions.js.map +1 -1
- package/dist/core/Agent.js +157 -4
- package/dist/core/Agent.js.map +1 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +68 -0
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/esm/cache/CacheDecisionSubflow.js +166 -0
- package/dist/esm/cache/CacheDecisionSubflow.js.map +1 -0
- package/dist/esm/cache/CacheGateDecider.js +116 -0
- package/dist/esm/cache/CacheGateDecider.js.map +1 -0
- package/dist/esm/cache/applyCachePolicy.js +50 -0
- package/dist/esm/cache/applyCachePolicy.js.map +1 -0
- package/dist/esm/cache/cacheRecorder.js +116 -0
- package/dist/esm/cache/cacheRecorder.js.map +1 -0
- package/dist/esm/cache/index.js +36 -0
- package/dist/esm/cache/index.js.map +1 -0
- package/dist/esm/cache/strategies/AnthropicCacheStrategy.js +98 -0
- package/dist/esm/cache/strategies/AnthropicCacheStrategy.js.map +1 -0
- package/dist/esm/cache/strategies/BedrockCacheStrategy.js +77 -0
- package/dist/esm/cache/strategies/BedrockCacheStrategy.js.map +1 -0
- package/dist/esm/cache/strategies/NoOpCacheStrategy.js +36 -0
- package/dist/esm/cache/strategies/NoOpCacheStrategy.js.map +1 -0
- package/dist/esm/cache/strategies/OpenAICacheStrategy.js +71 -0
- package/dist/esm/cache/strategies/OpenAICacheStrategy.js.map +1 -0
- package/dist/esm/cache/strategyRegistry.js +73 -0
- package/dist/esm/cache/strategyRegistry.js.map +1 -0
- package/dist/esm/cache/types.js +24 -0
- package/dist/esm/cache/types.js.map +1 -0
- package/dist/esm/conventions.js +18 -0
- package/dist/esm/conventions.js.map +1 -1
- package/dist/esm/core/Agent.js +157 -4
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineFact.js +3 -0
- package/dist/esm/lib/injection-engine/factories/defineFact.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineInstruction.js +3 -0
- package/dist/esm/lib/injection-engine/factories/defineInstruction.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineSkill.js +5 -0
- package/dist/esm/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineSteering.js +3 -0
- package/dist/esm/lib/injection-engine/factories/defineSteering.js.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineFact.js +3 -0
- package/dist/lib/injection-engine/factories/defineFact.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineInstruction.js +3 -0
- package/dist/lib/injection-engine/factories/defineInstruction.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineSkill.js +5 -0
- package/dist/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineSteering.js +3 -0
- package/dist/lib/injection-engine/factories/defineSteering.js.map +1 -1
- package/dist/types/adapters/types.d.ts +11 -0
- package/dist/types/adapters/types.d.ts.map +1 -1
- package/dist/types/cache/CacheDecisionSubflow.d.ts +89 -0
- package/dist/types/cache/CacheDecisionSubflow.d.ts.map +1 -0
- package/dist/types/cache/CacheGateDecider.d.ts +114 -0
- package/dist/types/cache/CacheGateDecider.d.ts.map +1 -0
- package/dist/types/cache/applyCachePolicy.d.ts +38 -0
- package/dist/types/cache/applyCachePolicy.d.ts.map +1 -0
- package/dist/types/cache/cacheRecorder.d.ts +86 -0
- package/dist/types/cache/cacheRecorder.d.ts.map +1 -0
- package/dist/types/cache/index.d.ts +34 -0
- package/dist/types/cache/index.d.ts.map +1 -0
- package/dist/types/cache/strategies/AnthropicCacheStrategy.d.ts +39 -0
- package/dist/types/cache/strategies/AnthropicCacheStrategy.d.ts.map +1 -0
- package/dist/types/cache/strategies/BedrockCacheStrategy.d.ts +34 -0
- package/dist/types/cache/strategies/BedrockCacheStrategy.d.ts.map +1 -0
- package/dist/types/cache/strategies/NoOpCacheStrategy.d.ts +30 -0
- package/dist/types/cache/strategies/NoOpCacheStrategy.d.ts.map +1 -0
- package/dist/types/cache/strategies/OpenAICacheStrategy.d.ts +37 -0
- package/dist/types/cache/strategies/OpenAICacheStrategy.d.ts.map +1 -0
- package/dist/types/cache/strategyRegistry.d.ts +46 -0
- package/dist/types/cache/strategyRegistry.d.ts.map +1 -0
- package/dist/types/cache/types.d.ts +244 -0
- package/dist/types/cache/types.d.ts.map +1 -0
- package/dist/types/conventions.d.ts +18 -0
- package/dist/types/conventions.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +86 -2
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineFact.d.ts +9 -0
- package/dist/types/lib/injection-engine/factories/defineFact.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineInstruction.d.ts +11 -0
- package/dist/types/lib/injection-engine/factories/defineInstruction.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts +15 -0
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineSteering.d.ts +12 -0
- package/dist/types/lib/injection-engine/factories/defineSteering.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache layer — public types.
|
|
3
|
+
*
|
|
4
|
+
* Three layers, each with one responsibility:
|
|
5
|
+
*
|
|
6
|
+
* 1. CONSUMER DSL — `CachePolicy` field on every injection factory.
|
|
7
|
+
* Declarative, like GraphQL schema input. Says WHAT should be
|
|
8
|
+
* cacheable. Examples: `cache: 'always'`, `cache: 'while-active'`.
|
|
9
|
+
*
|
|
10
|
+
* 2. AGNOSTIC MARKERS — `CacheMarker[]` produced by the
|
|
11
|
+
* `CacheDecision` subflow at runtime. Provider-independent
|
|
12
|
+
* identification of "cacheable prefix in field X up to index Y".
|
|
13
|
+
*
|
|
14
|
+
* 3. PROVIDER STRATEGY — one `CacheStrategy` implementation per
|
|
15
|
+
* provider (Anthropic / OpenAI / Bedrock / NoOp). Translates
|
|
16
|
+
* agnostic markers to provider-specific wire format AND extracts
|
|
17
|
+
* cache metrics from the provider's response.
|
|
18
|
+
*
|
|
19
|
+
* The interfaces are read-only / immutable by convention. Strategies
|
|
20
|
+
* MUST be stateless across runs; per-run state lives in the
|
|
21
|
+
* `CacheStrategyContext` passed into `prepareRequest`.
|
|
22
|
+
*/
|
|
23
|
+
import type { LLMRequest } from '../adapters/types.js';
|
|
24
|
+
/**
|
|
25
|
+
* `cache:` field shape on every injection factory.
|
|
26
|
+
*
|
|
27
|
+
* Defaults per factory (chosen so `cache:` is rarely written explicitly):
|
|
28
|
+
* - `defineSteering` → `'always'`
|
|
29
|
+
* - `defineFact` → `'always'`
|
|
30
|
+
* - `defineSkill` → `'while-active'`
|
|
31
|
+
* - `defineInstruction` → `'never'`
|
|
32
|
+
* - `defineMemory` → `'while-active'`
|
|
33
|
+
*
|
|
34
|
+
* Variants:
|
|
35
|
+
* - `'always'` — cache whenever this injection is in `activeInjections`.
|
|
36
|
+
* Sugar for `{ until: () => false }`. The most aggressive form.
|
|
37
|
+
* - `'never'` — never cache. Use for volatile content (rule predicates,
|
|
38
|
+
* on-tool-return injections, content with timestamps or per-request IDs).
|
|
39
|
+
* Sugar for `{ until: () => true }` — i.e., always-invalidated.
|
|
40
|
+
* - `'while-active'` — cache while this injection appears in
|
|
41
|
+
* `activeInjections[]` for the current iteration. The cache invalidates
|
|
42
|
+
* the moment the injection becomes inactive (predicate returns `false`,
|
|
43
|
+
* skill deactivates, fact gets removed). Skill default; intuitive
|
|
44
|
+
* meaning regardless of factory.
|
|
45
|
+
* - `{ until: ctx => ... }` — conditional invalidation; cached UNTIL
|
|
46
|
+
* the predicate returns `true`. The predicate runs every iteration;
|
|
47
|
+
* if it flips to `true`, the cache prefix is rebuilt.
|
|
48
|
+
*
|
|
49
|
+
* **Composition**: the four sentinel forms cover most cases. For
|
|
50
|
+
* complex composition (e.g., "cache always EXCEPT after iter 5"), use
|
|
51
|
+
* the `{ until: ... }` form directly:
|
|
52
|
+
*
|
|
53
|
+
* ```ts
|
|
54
|
+
* // Stable for the first 5 iters, then flush:
|
|
55
|
+
* cache: { until: ctx => ctx.iteration > 5 }
|
|
56
|
+
*
|
|
57
|
+
* // Cache while iter > 1 (skip caching on the very first call):
|
|
58
|
+
* cache: { until: ctx => ctx.iteration <= 1 }
|
|
59
|
+
*
|
|
60
|
+
* // Invalidate when cumulative spend exceeds budget:
|
|
61
|
+
* cache: { until: ctx => ctx.cumulativeInputTokens > 50_000 }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* The predicate is the DSL's escape hatch — Turing-complete by design.
|
|
65
|
+
* 80% of consumers stick with the three sentinel strings; power users
|
|
66
|
+
* compose freely via `{ until }`.
|
|
67
|
+
*/
|
|
68
|
+
export type CachePolicy = 'always' | 'never' | 'while-active' | {
|
|
69
|
+
readonly until: (ctx: CachePolicyContext) => boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Context passed to a `CachePolicy.until` predicate. Read-only
|
|
73
|
+
* snapshot; predicates must be pure.
|
|
74
|
+
*
|
|
75
|
+
* Mirrors `InjectionContext` but trimmed to the fields a cache
|
|
76
|
+
* predicate would meaningfully inspect.
|
|
77
|
+
*/
|
|
78
|
+
export interface CachePolicyContext {
|
|
79
|
+
/** Current ReAct iteration (1-based). */
|
|
80
|
+
readonly iteration: number;
|
|
81
|
+
/** Number of iterations remaining (= maxIterations - iteration). */
|
|
82
|
+
readonly iterationsRemaining: number;
|
|
83
|
+
/** The current user message that started this turn. */
|
|
84
|
+
readonly userMessage: string;
|
|
85
|
+
/** Last tool that returned, if any. */
|
|
86
|
+
readonly lastToolName?: string;
|
|
87
|
+
/** Cumulative input tokens so far this run. */
|
|
88
|
+
readonly cumulativeInputTokens: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Provider-independent identification of a cacheable prefix.
|
|
92
|
+
*
|
|
93
|
+
* The CacheDecision subflow walks `activeInjections` and emits one
|
|
94
|
+
* marker per slot whose entries from index 0..boundaryIndex form a
|
|
95
|
+
* stable, contiguous, cacheable prefix.
|
|
96
|
+
*
|
|
97
|
+
* `field` is the request field this marker targets. Each provider
|
|
98
|
+
* strategy translates it differently:
|
|
99
|
+
* - `'system'` → Anthropic puts `cache_control` on a system block
|
|
100
|
+
* - `'tools'` → Anthropic puts `cache_control` on a tools array entry
|
|
101
|
+
* - `'messages'` → Anthropic puts `cache_control` on the LAST content
|
|
102
|
+
* block of the LAST message (Anthropic-specific positional rule)
|
|
103
|
+
*/
|
|
104
|
+
export interface CacheMarker {
|
|
105
|
+
readonly field: 'system' | 'tools' | 'messages';
|
|
106
|
+
/**
|
|
107
|
+
* 0-based index of the LAST element in `field` to include in the
|
|
108
|
+
* cached prefix. Everything from index 0..boundaryIndex (inclusive)
|
|
109
|
+
* is cacheable.
|
|
110
|
+
*
|
|
111
|
+
* **Provider note for `field: 'messages'`**: Anthropic's `cache_control`
|
|
112
|
+
* on `messages` is positional — it only takes effect on the LAST
|
|
113
|
+
* content block of the LAST message in the cacheable prefix. The
|
|
114
|
+
* AnthropicCacheStrategy translates `boundaryIndex` to the right
|
|
115
|
+
* positional placement; consumers and CacheDecision subflow don't
|
|
116
|
+
* see this complexity.
|
|
117
|
+
*/
|
|
118
|
+
readonly boundaryIndex: number;
|
|
119
|
+
/**
|
|
120
|
+
* Suggested TTL for this marker. Strategies map to provider-specific
|
|
121
|
+
* values (Anthropic: `'short'` → 5min ephemeral, `'long'` → 1h beta).
|
|
122
|
+
*/
|
|
123
|
+
readonly ttl: 'short' | 'long';
|
|
124
|
+
/**
|
|
125
|
+
* Diagnostic string surfaced in cacheRecorder events. Helps consumers
|
|
126
|
+
* understand WHY this marker fired. Examples: `'always-on injections'`,
|
|
127
|
+
* `'skill body (port-error-triage)'`.
|
|
128
|
+
*/
|
|
129
|
+
readonly reason: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Per-provider cache implementation. One strategy per provider name;
|
|
133
|
+
* registered in a default map keyed by `LLMProvider.name`.
|
|
134
|
+
*
|
|
135
|
+
* Strategies MUST be stateless across runs. Any per-run state (handle
|
|
136
|
+
* cache, hit-rate tracking) lives inside the strategy instance.
|
|
137
|
+
*/
|
|
138
|
+
export interface CacheStrategy {
|
|
139
|
+
/** Provider name match. e.g. `'anthropic'`, `'openai'`, `'bedrock'`. */
|
|
140
|
+
readonly providerName: string;
|
|
141
|
+
/**
|
|
142
|
+
* Static description of what this strategy can do. Read by the
|
|
143
|
+
* CacheDecision subflow to know whether to bother emitting markers,
|
|
144
|
+
* and how many to emit before clamping to provider limits.
|
|
145
|
+
*/
|
|
146
|
+
readonly capabilities: CacheCapabilities;
|
|
147
|
+
/**
|
|
148
|
+
* Translate agnostic markers to provider-specific wire format.
|
|
149
|
+
*
|
|
150
|
+
* Async to support handle-based caching (Gemini does
|
|
151
|
+
* `createCachedContent` and references handles; not in v2.6 but
|
|
152
|
+
* the interface is async-ready for v2.7+).
|
|
153
|
+
*
|
|
154
|
+
* Returns the modified request AND the markers actually applied
|
|
155
|
+
* (after capability-clamping). `markersApplied` flows into the
|
|
156
|
+
* cacheRecorder for diagnostic surfacing.
|
|
157
|
+
*/
|
|
158
|
+
prepareRequest(req: LLMRequest, candidates: readonly CacheMarker[], ctx: CacheStrategyContext): Promise<{
|
|
159
|
+
readonly request: LLMRequest;
|
|
160
|
+
readonly markersApplied: readonly CacheMarker[];
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Extract cache hit/miss metrics from the provider's `usage` field.
|
|
164
|
+
* Each provider names its cache fields differently:
|
|
165
|
+
* - Anthropic: `cache_creation_input_tokens` + `cache_read_input_tokens`
|
|
166
|
+
* - OpenAI: `prompt_tokens_details.cached_tokens`
|
|
167
|
+
*
|
|
168
|
+
* Returns `undefined` for providers without cache reporting (Mock, NoOp).
|
|
169
|
+
*/
|
|
170
|
+
extractMetrics(usage: unknown): CacheMetrics | undefined;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Static description of a strategy's capabilities. The CacheDecision
|
|
174
|
+
* subflow reads this BEFORE calling `prepareRequest` so it can clamp
|
|
175
|
+
* candidates to a count the strategy can actually use.
|
|
176
|
+
*/
|
|
177
|
+
export interface CacheCapabilities {
|
|
178
|
+
/**
|
|
179
|
+
* `true` if this strategy actually does anything. `false` for NoOp,
|
|
180
|
+
* Mock, or providers we haven't built yet. CacheDecision subflow
|
|
181
|
+
* skips entirely when `enabled` is `false`.
|
|
182
|
+
*/
|
|
183
|
+
readonly enabled: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Maximum number of cache markers per request. Anthropic enforces 4
|
|
186
|
+
* cache breakpoints per request; OpenAI is automatic (∞); Gemini
|
|
187
|
+
* is per-handle (∞ effectively). Strategies clamp internally.
|
|
188
|
+
*/
|
|
189
|
+
readonly maxMarkers: number;
|
|
190
|
+
/**
|
|
191
|
+
* TTL values this strategy can map to. Anthropic supports both;
|
|
192
|
+
* OpenAI is fixed (~5min); some providers may only support one.
|
|
193
|
+
*/
|
|
194
|
+
readonly ttls: ReadonlyArray<'short' | 'long'>;
|
|
195
|
+
/**
|
|
196
|
+
* Which request fields this strategy can mark. Most providers support
|
|
197
|
+
* all three (system / tools / messages); some are field-restricted.
|
|
198
|
+
*/
|
|
199
|
+
readonly fields: ReadonlyArray<'system' | 'tools' | 'messages'>;
|
|
200
|
+
/**
|
|
201
|
+
* `true` if the provider auto-caches without explicit markers (OpenAI).
|
|
202
|
+
* In that case `prepareRequest` is a pass-through; only
|
|
203
|
+
* `extractMetrics` does meaningful work. Surfaced for documentation
|
|
204
|
+
* (so consumers know `cache: 'never'` may not actually disable caching
|
|
205
|
+
* on auto-caching providers).
|
|
206
|
+
*/
|
|
207
|
+
readonly automatic: boolean;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Per-run state passed into `prepareRequest`. Strategies use this to
|
|
211
|
+
* make per-iteration decisions (rate of cache invalidation, current
|
|
212
|
+
* iteration index, etc.) without leaking state into module scope.
|
|
213
|
+
*/
|
|
214
|
+
export interface CacheStrategyContext {
|
|
215
|
+
readonly iteration: number;
|
|
216
|
+
readonly iterationsRemaining: number;
|
|
217
|
+
/**
|
|
218
|
+
* Hit rate across previous iterations of this run (0..1). Strategies
|
|
219
|
+
* use this for self-disable behaviors (e.g., AnthropicCacheStrategy
|
|
220
|
+
* auto-skips markers when hit rate < 30% to avoid the cache-write
|
|
221
|
+
* penalty without recoup).
|
|
222
|
+
*/
|
|
223
|
+
readonly recentHitRate: number | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* `true` when `Agent.create({ caching: 'off' })` is set OR a
|
|
226
|
+
* higher-level kill switch fires. Strategy MUST honor this and
|
|
227
|
+
* return the request unchanged.
|
|
228
|
+
*/
|
|
229
|
+
readonly cachingDisabled: boolean;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Normalized cache metrics extracted from a provider's `usage`
|
|
233
|
+
* response. cacheRecorder consumes these for hit-rate tracking,
|
|
234
|
+
* cost estimation (via PricingTable), and diagnostic events.
|
|
235
|
+
*/
|
|
236
|
+
export interface CacheMetrics {
|
|
237
|
+
/** Tokens served from cache (10% / 50% / 25% off depending on provider). */
|
|
238
|
+
readonly cacheReadTokens: number;
|
|
239
|
+
/** Tokens written to cache this call (premium varies by provider). */
|
|
240
|
+
readonly cacheWriteTokens: number;
|
|
241
|
+
/** New input tokens not from cache — full price. */
|
|
242
|
+
readonly freshInputTokens: number;
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cache/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,OAAO,GACP,cAAc,GACd;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAA;CAAE,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC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,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAChE;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAID;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,sEAAsE;IACtE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,oDAAoD;IACpD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -29,6 +29,9 @@ export declare const SUBFLOW_IDS: {
|
|
|
29
29
|
readonly MERGE: "sf-merge";
|
|
30
30
|
/** Final-answer composition inside Agent. */
|
|
31
31
|
readonly FINAL: "sf-final";
|
|
32
|
+
/** Cache decision subflow (v2.6). Walks activeInjections, emits
|
|
33
|
+
* agnostic CacheMarker[]. Provider-independent. */
|
|
34
|
+
readonly CACHE_DECISION: "sf-cache-decision";
|
|
32
35
|
};
|
|
33
36
|
export type SubflowId = (typeof SUBFLOW_IDS)[keyof typeof SUBFLOW_IDS];
|
|
34
37
|
/** Stage IDs — plain function stages that builders mount. */
|
|
@@ -39,6 +42,21 @@ export declare const STAGE_IDS: {
|
|
|
39
42
|
readonly FORMAT_MERGE: "format-merge";
|
|
40
43
|
readonly MERGE_LLM: "merge-llm";
|
|
41
44
|
readonly EXTRACT_MERGE: "extract-merge";
|
|
45
|
+
/** Updates the rolling skill-history window before CacheGate
|
|
46
|
+
* evaluates skill-churn (v2.6). */
|
|
47
|
+
readonly UPDATE_SKILL_HISTORY: "update-skill-history";
|
|
48
|
+
/** CacheGate decider stage — routes to apply-markers / no-markers
|
|
49
|
+
* based on kill switch / hit rate / skill churn (v2.6). */
|
|
50
|
+
readonly CACHE_GATE: "cache-gate";
|
|
51
|
+
/** CacheGate branch (routing key) when markers SHOULD be applied
|
|
52
|
+
* this iteration. Pass-through stage; markers stay in scope. (v2.6) */
|
|
53
|
+
readonly APPLY_MARKERS: "apply-markers";
|
|
54
|
+
/** CacheGate branch (routing key) when markers should be SKIPPED
|
|
55
|
+
* this iteration. Stage clears scope.cacheMarkers. (v2.6) */
|
|
56
|
+
readonly SKIP_CACHING: "no-markers";
|
|
57
|
+
/** BuildLLMRequest stage — calls strategy.prepareRequest to apply
|
|
58
|
+
* markers to the wire request (v2.6). */
|
|
59
|
+
readonly BUILD_LLM_REQUEST: "build-llm-request";
|
|
42
60
|
};
|
|
43
61
|
export type StageId = (typeof STAGE_IDS)[keyof typeof STAGE_IDS];
|
|
44
62
|
/** True when a subflow id corresponds to one of the 3 context slots. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventions.d.ts","sourceRoot":"","sources":["../../src/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,gEAAgE;AAChE,eAAO,MAAM,WAAW;IACtB;0EACsE;;IAEtE,+DAA+D;;IAE/D,6BAA6B;;IAE7B,0BAA0B;;IAE1B,2CAA2C;;IAE3C,uDAAuD;;IAEvD,kCAAkC;;IAElC,6CAA6C;;
|
|
1
|
+
{"version":3,"file":"conventions.d.ts","sourceRoot":"","sources":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6C;AAC7C,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAS9F;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,YAAY,CAE/D"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* agentfootprint.context.* (via ContextRecorder)
|
|
15
15
|
*/
|
|
16
16
|
import { type CombinedNarrativeEntry, type FlowChart, type FlowchartCheckpoint, type RunOptions, type RuntimeSnapshot } from 'footprintjs';
|
|
17
|
+
import type { CachePolicy, CacheStrategy } from '../cache/types.js';
|
|
17
18
|
import { type RunnerPauseOutcome } from './pause.js';
|
|
18
19
|
import type { LLMProvider, PermissionChecker, PricingTable } from '../adapters/types.js';
|
|
19
20
|
import type { MemoryIdentity } from '../memory/identity/index.js';
|
|
@@ -56,6 +57,24 @@ export interface AgentOptions {
|
|
|
56
57
|
* normally.
|
|
57
58
|
*/
|
|
58
59
|
readonly permissionChecker?: PermissionChecker;
|
|
60
|
+
/**
|
|
61
|
+
* Global cache kill switch (v2.6+). `'off'` disables the cache
|
|
62
|
+
* layer entirely — the CacheGate decider routes to `'no-markers'`
|
|
63
|
+
* every iteration regardless of other rules. Default: caching
|
|
64
|
+
* enabled (auto-resolved per provider via the strategy registry).
|
|
65
|
+
*
|
|
66
|
+
* Use `'off'` for low-frequency agents (cron jobs running once per
|
|
67
|
+
* hour) where the cache TTL guarantees zero cache hits and the
|
|
68
|
+
* cache-write penalty isn't worth paying.
|
|
69
|
+
*/
|
|
70
|
+
readonly caching?: 'off';
|
|
71
|
+
/**
|
|
72
|
+
* Optional explicit CacheStrategy override (v2.6+). Defaults to
|
|
73
|
+
* `getDefaultCacheStrategy(provider.name)` — so Anthropic/OpenAI/
|
|
74
|
+
* Bedrock/Mock providers auto-resolve to their respective strategies
|
|
75
|
+
* once those land in Phase 7+.
|
|
76
|
+
*/
|
|
77
|
+
readonly cacheStrategy?: CacheStrategy;
|
|
59
78
|
}
|
|
60
79
|
export interface AgentInput {
|
|
61
80
|
readonly message: string;
|
|
@@ -79,6 +98,27 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
79
98
|
private readonly maxTokens?;
|
|
80
99
|
private readonly maxIterations;
|
|
81
100
|
private readonly systemPromptValue;
|
|
101
|
+
/**
|
|
102
|
+
* Cache policy for the base system prompt (set via
|
|
103
|
+
* `.system(text, { cache })`). Default `'always'` — base prompt is
|
|
104
|
+
* stable per-turn, ideal cache anchor. CacheDecision subflow reads
|
|
105
|
+
* this when computing the SystemPrompt slot's cache markers.
|
|
106
|
+
*/
|
|
107
|
+
private readonly systemPromptCachePolicy;
|
|
108
|
+
/**
|
|
109
|
+
* Global cache kill switch from `Agent.create({ caching: 'off' })`.
|
|
110
|
+
* Threaded into agent scope at seed-time as `scope.cachingDisabled`;
|
|
111
|
+
* read by the CacheGate decider every iteration (highest-priority rule).
|
|
112
|
+
*/
|
|
113
|
+
private readonly cachingDisabledValue;
|
|
114
|
+
/**
|
|
115
|
+
* Provider-specific CacheStrategy. Auto-resolved from
|
|
116
|
+
* `getDefaultCacheStrategy(provider.name)` at agent build time
|
|
117
|
+
* unless the consumer explicitly passes one via builder option.
|
|
118
|
+
* Phase 7+ implementations (Anthropic, OpenAI, Bedrock) register
|
|
119
|
+
* themselves in the strategyRegistry on import.
|
|
120
|
+
*/
|
|
121
|
+
private readonly cacheStrategy;
|
|
82
122
|
private readonly registry;
|
|
83
123
|
/**
|
|
84
124
|
* The Injection list — Skills, Steering, Instructions, Facts (and
|
|
@@ -143,9 +183,16 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
143
183
|
readonly appName: string;
|
|
144
184
|
readonly commentaryTemplates: Readonly<Record<string, string>>;
|
|
145
185
|
readonly thinkingTemplates: Readonly<Record<string, string>>;
|
|
146
|
-
}, injections?: readonly Injection[], memories?: readonly MemoryDefinition[], outputSchemaParser?: OutputSchemaParser<unknown>, toolProvider?: ToolProvider);
|
|
186
|
+
}, injections?: readonly Injection[], memories?: readonly MemoryDefinition[], outputSchemaParser?: OutputSchemaParser<unknown>, toolProvider?: ToolProvider, systemPromptCachePolicy?: CachePolicy, cachingDisabled?: boolean, cacheStrategy?: CacheStrategy);
|
|
147
187
|
static create(opts: AgentOptions): AgentBuilder;
|
|
148
188
|
toFlowChart(): FlowChart;
|
|
189
|
+
/**
|
|
190
|
+
* Cache policy for the base system prompt. Read by the CacheDecision
|
|
191
|
+
* subflow (v2.6 Phase 4) to know how to treat the SystemPrompt slot's
|
|
192
|
+
* cache markers. Exposed as a method (not direct field access) so
|
|
193
|
+
* the Agent's encapsulation boundary stays clean.
|
|
194
|
+
*/
|
|
195
|
+
getSystemPromptCachePolicy(): CachePolicy;
|
|
149
196
|
/**
|
|
150
197
|
* The footprintjs `RuntimeSnapshot` from the most recent `run()` /
|
|
151
198
|
* `resume()`. Feeds Lens's Trace tab (ExplainableShell `runtimeSnapshot`
|
|
@@ -207,6 +254,26 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
207
254
|
export declare class AgentBuilder {
|
|
208
255
|
private readonly opts;
|
|
209
256
|
private systemPromptValue;
|
|
257
|
+
/**
|
|
258
|
+
* Cache policy for the base system prompt. Set via the optional
|
|
259
|
+
* 2nd argument to `.system(text, { cache })`. Default `'always'` —
|
|
260
|
+
* the base prompt is stable per-turn and an ideal cache anchor.
|
|
261
|
+
*/
|
|
262
|
+
private systemPromptCachePolicy;
|
|
263
|
+
/**
|
|
264
|
+
* Global cache kill switch. Set via `Agent.create({ caching: 'off' })`
|
|
265
|
+
* (handled in `AgentOptions` propagation). Defaults to `false`
|
|
266
|
+
* (caching enabled). When `true`, the CacheGate decider routes to
|
|
267
|
+
* `'no-markers'` every iteration regardless of other rules.
|
|
268
|
+
*/
|
|
269
|
+
private cachingDisabledValue;
|
|
270
|
+
/**
|
|
271
|
+
* Optional explicit CacheStrategy override. Default: undefined,
|
|
272
|
+
* which means the agent auto-resolves from
|
|
273
|
+
* `getDefaultCacheStrategy(provider.name)` at construction. Power
|
|
274
|
+
* users override here for custom backends or test mocks.
|
|
275
|
+
*/
|
|
276
|
+
private cacheStrategyOverride?;
|
|
210
277
|
private readonly registry;
|
|
211
278
|
private readonly injectionList;
|
|
212
279
|
private readonly memoryList;
|
|
@@ -237,7 +304,24 @@ export declare class AgentBuilder {
|
|
|
237
304
|
private commentaryOverrides;
|
|
238
305
|
private thinkingOverrides;
|
|
239
306
|
constructor(opts: AgentOptions);
|
|
240
|
-
|
|
307
|
+
/**
|
|
308
|
+
* Set the base system prompt.
|
|
309
|
+
*
|
|
310
|
+
* @param prompt - The system prompt text. Stable per-turn.
|
|
311
|
+
* @param options - Optional config. `cache` controls how the
|
|
312
|
+
* CacheDecision subflow treats this prompt block:
|
|
313
|
+
* - `'always'` (default) — cache the base prompt as a stable
|
|
314
|
+
* prefix anchor. Highest cache-hit rate; recommended for
|
|
315
|
+
* production agents whose system prompt rarely changes.
|
|
316
|
+
* - `'never'` — skip caching. Use if the prompt contains volatile
|
|
317
|
+
* content (timestamps, per-request user IDs).
|
|
318
|
+
* - `'while-active'` — semantically equivalent to `'always'` for
|
|
319
|
+
* the base prompt (it's always active by definition).
|
|
320
|
+
* - `{ until }` — conditional invalidation (e.g., flush after iter 5).
|
|
321
|
+
*/
|
|
322
|
+
system(prompt: string, options?: {
|
|
323
|
+
readonly cache?: CachePolicy;
|
|
324
|
+
}): this;
|
|
241
325
|
tool<TArgs, TResult>(tool: Tool<TArgs, TResult>): this;
|
|
242
326
|
/**
|
|
243
327
|
* Register many tools at once. Convenience for tool sources that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../src/core/Agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,mBAAmB,EAExB,KA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
7
|
*/
|
|
8
|
+
import './cache/strategies/AnthropicCacheStrategy.js';
|
|
9
|
+
import './cache/strategies/OpenAICacheStrategy.js';
|
|
10
|
+
import './cache/strategies/BedrockCacheStrategy.js';
|
|
8
11
|
export type { CombinedRecorder, Recorder, FlowRecorder, EmitRecorder, WriteEvent, ReadEvent, CommitEvent, StageEvent, ErrorEvent, FlowStageEvent, FlowNextEvent, FlowDecisionEvent, FlowForkEvent, FlowSelectedEvent, FlowSubflowEvent, FlowSubflowRegisteredEvent, FlowLoopEvent, FlowBreakEvent, FlowErrorEvent, TraversalContext, EmitEvent, RedactionPolicy, RedactionReport, } from 'footprintjs';
|
|
9
12
|
export * from './events/types.js';
|
|
10
13
|
export * from './events/payloads.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AACnD,OAAO,4CAA4C,CAAC;AAOpD,YAAY,EAEV,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,YAAY,EAEZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EAEV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAEhB,SAAS,EAET,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,WAAW,EACX,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,sBAAsB,C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27
|
*/
|
|
28
28
|
import type { ContextRole } from '../../../events/types.js';
|
|
29
29
|
import type { Injection, InjectionContext } from '../types.js';
|
|
30
|
+
import type { CachePolicy } from '../../../cache/types.js';
|
|
30
31
|
export interface DefineFactOptions {
|
|
31
32
|
readonly id: string;
|
|
32
33
|
readonly description?: string;
|
|
@@ -47,6 +48,14 @@ export interface DefineFactOptions {
|
|
|
47
48
|
* predicate via `activeWhen`.
|
|
48
49
|
*/
|
|
49
50
|
readonly activeWhen?: (ctx: InjectionContext) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Cache policy for this fact injection. Defaults to `'always'` —
|
|
53
|
+
* facts are typically static data the LLM should always have in mind.
|
|
54
|
+
* Override with `'never'` for facts containing volatile content
|
|
55
|
+
* (e.g., a `Current time:` fact); use `{ until }` for time-bounded
|
|
56
|
+
* facts.
|
|
57
|
+
*/
|
|
58
|
+
readonly cache?: CachePolicy;
|
|
50
59
|
}
|
|
51
60
|
export declare function defineFact(opts: DefineFactOptions): Injection;
|
|
52
61
|
//# sourceMappingURL=defineFact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineFact.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineFact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAEjF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU,CAAC;IAC7C,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"defineFact.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineFact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAEjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU,CAAC;IAC7C,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACzD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CA6B7D"}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import type { ContextRole } from '../../../events/types.js';
|
|
31
31
|
import type { Injection, InjectionContext } from '../types.js';
|
|
32
|
+
import type { CachePolicy } from '../../../cache/types.js';
|
|
32
33
|
export interface DefineInstructionOptions {
|
|
33
34
|
readonly id: string;
|
|
34
35
|
readonly description?: string;
|
|
@@ -63,6 +64,16 @@ export interface DefineInstructionOptions {
|
|
|
63
64
|
* principle but rarely make pedagogical sense.
|
|
64
65
|
*/
|
|
65
66
|
readonly role?: ContextRole;
|
|
67
|
+
/**
|
|
68
|
+
* Cache policy for this instruction. Defaults to `'never'` —
|
|
69
|
+
* instructions are typically rule-based (volatile per-iter
|
|
70
|
+
* `activeWhen` predicates, on-tool-return reminders). Override to
|
|
71
|
+
* `'always'` only for instructions you know are stable per-turn
|
|
72
|
+
* (e.g., a static safety rule wrapped as `defineInstruction` for
|
|
73
|
+
* narrative tagging — though `defineSteering` is the cleaner choice
|
|
74
|
+
* for that case).
|
|
75
|
+
*/
|
|
76
|
+
readonly cache?: CachePolicy;
|
|
66
77
|
}
|
|
67
78
|
export declare function defineInstruction(opts: DefineInstructionOptions): Injection;
|
|
68
79
|
//# sourceMappingURL=defineInstruction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineInstruction.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineInstruction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAEjF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACzD,uFAAuF;IACvF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"defineInstruction.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineInstruction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAEjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACzD,uFAAuF;IACvF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,wBAAwB,GAAG,SAAS,CAwB3E"}
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { Injection } from '../types.js';
|
|
30
30
|
import type { Tool } from '../../../core/tools.js';
|
|
31
|
+
import type { CachePolicy } from '../../../cache/types.js';
|
|
31
32
|
/**
|
|
32
33
|
* Where the Skill's body lands when activated.
|
|
33
34
|
*
|
|
@@ -121,6 +122,20 @@ export interface DefineSkillOptions {
|
|
|
121
122
|
* on this contract without API change.
|
|
122
123
|
*/
|
|
123
124
|
readonly autoActivate?: AutoActivateMode;
|
|
125
|
+
/**
|
|
126
|
+
* Cache policy for this skill's body. Defaults to `'while-active'` —
|
|
127
|
+
* the body caches while the skill is in `activeInjections[]` (i.e.,
|
|
128
|
+
* while it's the most-recently-activated skill); invalidates the
|
|
129
|
+
* moment it deactivates.
|
|
130
|
+
*
|
|
131
|
+
* For skills with stable, frequently-accessed bodies, consider
|
|
132
|
+
* `'always'` to keep the body cached even when temporarily inactive.
|
|
133
|
+
* For skills with bodies that depend on per-iter state, use
|
|
134
|
+
* `'never'` or `{ until: ... }`.
|
|
135
|
+
*
|
|
136
|
+
* See `CachePolicy` in `agentfootprint/src/cache/types.ts`.
|
|
137
|
+
*/
|
|
138
|
+
readonly cache?: CachePolicy;
|
|
124
139
|
}
|
|
125
140
|
/**
|
|
126
141
|
* Per-skill tool gating mode. See `DefineSkillOptions.autoActivate`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSkill.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSkill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,MAAM,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EA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AC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IACvC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAahF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,SAAS,CAsC/D"}
|
|
@@ -18,11 +18,23 @@
|
|
|
18
18
|
* });
|
|
19
19
|
*/
|
|
20
20
|
import type { Injection } from '../types.js';
|
|
21
|
+
import type { CachePolicy } from '../../../cache/types.js';
|
|
21
22
|
export interface DefineSteeringOptions {
|
|
22
23
|
readonly id: string;
|
|
23
24
|
readonly description?: string;
|
|
24
25
|
/** Always-on text appended to the system-prompt slot. */
|
|
25
26
|
readonly prompt: string;
|
|
27
|
+
/**
|
|
28
|
+
* Cache policy for this steering injection. Defaults to `'always'`
|
|
29
|
+
* — steering is by definition always-on stable content, ideal for
|
|
30
|
+
* provider-side caching. Override with `'never'` if the prompt
|
|
31
|
+
* contains volatile content (timestamps, per-request IDs).
|
|
32
|
+
*
|
|
33
|
+
* See `CachePolicy` in `agentfootprint/src/cache/types.ts` for all
|
|
34
|
+
* variants. The CacheDecision subflow reads this from
|
|
35
|
+
* `injection.metadata.cache` each iteration.
|
|
36
|
+
*/
|
|
37
|
+
readonly cache?: CachePolicy;
|
|
26
38
|
}
|
|
27
39
|
export declare function defineSteering(opts: DefineSteeringOptions): Injection;
|
|
28
40
|
//# sourceMappingURL=defineSteering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSteering.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSteering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"defineSteering.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSteering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,SAAS,CAgBrE"}
|
package/package.json
CHANGED