@coderifts/agent-guard 3.0.0 → 4.0.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.
Files changed (84) hide show
  1. package/README.md +46 -1
  2. package/dist/cjs/artifact-resolver.d.ts +8 -0
  3. package/dist/cjs/artifact-resolver.d.ts.map +1 -1
  4. package/dist/cjs/artifact-resolver.js +12 -1
  5. package/dist/cjs/artifact-resolver.js.map +1 -1
  6. package/dist/cjs/deploy-bind.d.ts +123 -0
  7. package/dist/cjs/deploy-bind.d.ts.map +1 -0
  8. package/dist/cjs/deploy-bind.js +112 -0
  9. package/dist/cjs/deploy-bind.js.map +1 -0
  10. package/dist/cjs/enforcement-gate.d.ts +13 -4
  11. package/dist/cjs/enforcement-gate.d.ts.map +1 -1
  12. package/dist/cjs/enforcement-gate.js +32 -7
  13. package/dist/cjs/enforcement-gate.js.map +1 -1
  14. package/dist/cjs/execution-proof.d.ts +132 -0
  15. package/dist/cjs/execution-proof.d.ts.map +1 -0
  16. package/dist/cjs/execution-proof.js +157 -0
  17. package/dist/cjs/execution-proof.js.map +1 -0
  18. package/dist/cjs/freshness.d.ts +244 -0
  19. package/dist/cjs/freshness.d.ts.map +1 -0
  20. package/dist/cjs/freshness.js +395 -0
  21. package/dist/cjs/freshness.js.map +1 -0
  22. package/dist/cjs/guard.d.ts +7 -1
  23. package/dist/cjs/guard.d.ts.map +1 -1
  24. package/dist/cjs/guard.js +114 -38
  25. package/dist/cjs/guard.js.map +1 -1
  26. package/dist/cjs/index.d.ts +10 -4
  27. package/dist/cjs/index.d.ts.map +1 -1
  28. package/dist/cjs/index.js +28 -3
  29. package/dist/cjs/index.js.map +1 -1
  30. package/dist/cjs/read-decision.d.ts +47 -0
  31. package/dist/cjs/read-decision.d.ts.map +1 -0
  32. package/dist/cjs/read-decision.js +161 -0
  33. package/dist/cjs/read-decision.js.map +1 -0
  34. package/dist/cjs/tool-registry.d.ts.map +1 -1
  35. package/dist/cjs/tool-registry.js +12 -1
  36. package/dist/cjs/tool-registry.js.map +1 -1
  37. package/dist/cjs/types.d.ts +28 -1
  38. package/dist/cjs/types.d.ts.map +1 -1
  39. package/dist/cjs/with-coderifts.d.ts +70 -8
  40. package/dist/cjs/with-coderifts.d.ts.map +1 -1
  41. package/dist/cjs/with-coderifts.js +177 -14
  42. package/dist/cjs/with-coderifts.js.map +1 -1
  43. package/dist/esm/artifact-resolver.d.ts +8 -0
  44. package/dist/esm/artifact-resolver.d.ts.map +1 -1
  45. package/dist/esm/artifact-resolver.js +11 -1
  46. package/dist/esm/artifact-resolver.js.map +1 -1
  47. package/dist/esm/deploy-bind.d.ts +123 -0
  48. package/dist/esm/deploy-bind.d.ts.map +1 -0
  49. package/dist/esm/deploy-bind.js +108 -0
  50. package/dist/esm/deploy-bind.js.map +1 -0
  51. package/dist/esm/enforcement-gate.d.ts +13 -4
  52. package/dist/esm/enforcement-gate.d.ts.map +1 -1
  53. package/dist/esm/enforcement-gate.js +32 -7
  54. package/dist/esm/enforcement-gate.js.map +1 -1
  55. package/dist/esm/execution-proof.d.ts +132 -0
  56. package/dist/esm/execution-proof.d.ts.map +1 -0
  57. package/dist/esm/execution-proof.js +151 -0
  58. package/dist/esm/execution-proof.js.map +1 -0
  59. package/dist/esm/freshness.d.ts +244 -0
  60. package/dist/esm/freshness.d.ts.map +1 -0
  61. package/dist/esm/freshness.js +384 -0
  62. package/dist/esm/freshness.js.map +1 -0
  63. package/dist/esm/guard.d.ts +7 -1
  64. package/dist/esm/guard.d.ts.map +1 -1
  65. package/dist/esm/guard.js +113 -37
  66. package/dist/esm/guard.js.map +1 -1
  67. package/dist/esm/index.d.ts +10 -4
  68. package/dist/esm/index.d.ts.map +1 -1
  69. package/dist/esm/index.js +10 -2
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/read-decision.d.ts +47 -0
  72. package/dist/esm/read-decision.d.ts.map +1 -0
  73. package/dist/esm/read-decision.js +153 -0
  74. package/dist/esm/read-decision.js.map +1 -0
  75. package/dist/esm/tool-registry.d.ts.map +1 -1
  76. package/dist/esm/tool-registry.js +12 -1
  77. package/dist/esm/tool-registry.js.map +1 -1
  78. package/dist/esm/types.d.ts +28 -1
  79. package/dist/esm/types.d.ts.map +1 -1
  80. package/dist/esm/with-coderifts.d.ts +70 -8
  81. package/dist/esm/with-coderifts.d.ts.map +1 -1
  82. package/dist/esm/with-coderifts.js +177 -14
  83. package/dist/esm/with-coderifts.js.map +1 -1
  84. package/package.json +2 -10
@@ -0,0 +1,395 @@
1
+ "use strict";
2
+ /**
3
+ * Freshness-safe prior content — PURE comparison core (TOCTOU close for the fresh-snapshot conjunct).
4
+ *
5
+ * Settled decisions (do not relitigate):
6
+ * 1. Freshness is CONTENT IDENTITY, not time. No TTL. Byte identity of `before` vs gate-time resolve.
7
+ * 2. The caller NAMES (artifact id); the gate RESOLVES prior content. A caller-supplied `before`
8
+ * is a claim, not a measurement — no fallback ladder that relabels a guess as measured.
9
+ * 3. Four outcomes, never collapsed: TARGET_MUTATED | STALE_CONTEXT | TAMPERED | UNKNOWN_FRESHNESS.
10
+ * 4. STALE_CONTEXT fails closed by default; policy may opt out deliberately.
11
+ * 5. Tree hash is OPTIONAL in the binding. Without it, STALE_CONTEXT is skipped, TARGET_MUTATED
12
+ * still runs, and the result SAYS the reduced level (never silently pretends full check ran).
13
+ *
14
+ * Merge-gate pattern generalized: recompute from current inputs; compare to what preflight bound;
15
+ * do not trust a claim about itself. Tree hash stays OUT of verdict_fingerprint and input_fingerprint
16
+ * (those preimages are frozen — their frozenness is what makes recompute meaningful).
17
+ *
18
+ * PURE: no I/O, no network, no Date.now(). Host supplies resolved content as inputs.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.contentByteIdentical = contentByteIdentical;
22
+ exports.computePathSetTreeHash = computePathSetTreeHash;
23
+ exports.assessFreshness = assessFreshness;
24
+ exports.assessWriteStylePrior = assessWriteStylePrior;
25
+ exports.freshnessAllowsEnforce = freshnessAllowsEnforce;
26
+ exports.isWriteStyleCall = isWriteStyleCall;
27
+ exports.artifactIdsForResolve = artifactIdsForResolve;
28
+ exports.collectFreshnessCallContext = collectFreshnessCallContext;
29
+ exports.buildFreshnessBasis = buildFreshnessBasis;
30
+ const node_crypto_1 = require("node:crypto");
31
+ // ── pure digests (tree hash OUT of frozen fingerprint preimages) ─────────────────────────────────
32
+ function sha256hex(s) {
33
+ return (0, node_crypto_1.createHash)('sha256').update(s, 'utf8').digest('hex');
34
+ }
35
+ /** Byte identity of two content strings (freshness definition: not time, not TTL). */
36
+ function contentByteIdentical(a, b) {
37
+ return a === b;
38
+ }
39
+ /**
40
+ * Optional path-set tree commitment. Additive only — never fold into input_fingerprint or
41
+ * verdict_fingerprint. Preimage: sorted path + sha256(content), then outer sha256.
42
+ * Missing content for a path is the caller's problem: pass only complete pairs.
43
+ */
44
+ function computePathSetTreeHash(entries) {
45
+ const parts = entries
46
+ .slice()
47
+ .map((e) => ({ path: String(e.path), content: String(e.content) }))
48
+ .sort((x, y) => (x.path < y.path ? -1 : x.path > y.path ? 1 : 0))
49
+ .map((e) => `${e.path}\x1f${sha256hex(e.content)}`);
50
+ return `sha256:${sha256hex(parts.join('\x1e'))}`;
51
+ }
52
+ // ── assess ───────────────────────────────────────────────────────────────────────────────────────
53
+ const MSG = {
54
+ FRESH_FULL: 'Prior content is fresh: gate-resolved before matches preflight (byte identity); tree commitment matches.',
55
+ FRESH_CONTRACT_ONLY: 'Prior content is fresh at contract level (byte identity of before). '
56
+ + 'Tree-hash check was not bound on this receipt — level is contract_only, not full.',
57
+ TARGET_MUTATED: 'TARGET_MUTATED: gate-resolved contract before differs from preflight (byte identity failed). '
58
+ + 'The contract itself changed under the bound artifact; re-preflight.',
59
+ STALE_CONTEXT: 'STALE_CONTEXT: repository path-set tree moved, but the contract before is byte-identical. '
60
+ + 'This is NOT tampering — neighbouring or formatting-only material changed while the analyzed '
61
+ + 'contract content did not. Default policy fails closed; set allowStaleContext to accept deliberately.',
62
+ TAMPERED: 'TAMPERED: contract before moved AND tree commitment moved. Both axes disagree with the preflight binding.',
63
+ UNKNOWN_BEFORE: 'UNKNOWN_FRESHNESS: artifact was named but current prior content is not measurable '
64
+ + '(gate could not resolve before at execution time). Not the same as a measured mismatch.',
65
+ UNKNOWN_TREE: 'UNKNOWN_FRESHNESS: tree hash was bound on the preflight, but current tree commitment is not measurable. '
66
+ + 'Not the same as STALE_CONTEXT (which requires a measured tree that differs).',
67
+ };
68
+ /**
69
+ * Assess freshness of prior content by recompute-and-compare (merge-gate pattern generalized).
70
+ *
71
+ * Pure. Does not read the filesystem; the host/adapter resolves artifact id → content and passes
72
+ * `resolvedBeforeNow` / optional tree hashes as inputs.
73
+ */
74
+ function assessFreshness(input) {
75
+ const hasTreeBinding = typeof input.preflightTreeHash === 'string' && input.preflightTreeHash.length > 0;
76
+ const level = hasTreeBinding ? 'full' : 'contract_only';
77
+ // Current prior must be measurable.
78
+ if (input.resolvedBeforeNow === null || input.resolvedBeforeNow === undefined) {
79
+ return {
80
+ outcome: 'UNKNOWN_FRESHNESS',
81
+ level,
82
+ failClosed: true,
83
+ contractMatch: null,
84
+ treeMatch: hasTreeBinding ? null : null,
85
+ message: MSG.UNKNOWN_BEFORE,
86
+ };
87
+ }
88
+ const contractMatch = contentByteIdentical(String(input.preflightBefore), String(input.resolvedBeforeNow));
89
+ // Tree axis: only when bound (Decision 5).
90
+ let treeMatch = null;
91
+ if (hasTreeBinding) {
92
+ if (input.resolvedTreeHashNow === null || input.resolvedTreeHashNow === undefined) {
93
+ return {
94
+ outcome: 'UNKNOWN_FRESHNESS',
95
+ level: 'full',
96
+ failClosed: true,
97
+ contractMatch,
98
+ treeMatch: null,
99
+ message: MSG.UNKNOWN_TREE,
100
+ };
101
+ }
102
+ treeMatch = contentByteIdentical(String(input.preflightTreeHash), String(input.resolvedTreeHashNow));
103
+ }
104
+ // Four outcomes from the two axes (tree may be skipped).
105
+ if (!contractMatch && treeMatch === false) {
106
+ return {
107
+ outcome: 'TAMPERED',
108
+ level,
109
+ failClosed: true,
110
+ contractMatch,
111
+ treeMatch,
112
+ message: MSG.TAMPERED,
113
+ };
114
+ }
115
+ if (!contractMatch) {
116
+ return {
117
+ outcome: 'TARGET_MUTATED',
118
+ level,
119
+ failClosed: true,
120
+ contractMatch,
121
+ treeMatch,
122
+ message: MSG.TARGET_MUTATED,
123
+ };
124
+ }
125
+ if (contractMatch && treeMatch === false) {
126
+ const allow = input.allowStaleContext === true;
127
+ return {
128
+ outcome: 'STALE_CONTEXT',
129
+ level,
130
+ // Default closed; policy opt-out only for this outcome (Decision 4).
131
+ failClosed: !allow,
132
+ contractMatch,
133
+ treeMatch,
134
+ message: MSG.STALE_CONTEXT,
135
+ };
136
+ }
137
+ // contractMatch && (treeMatch === true || treeMatch === null)
138
+ return {
139
+ outcome: 'FRESH',
140
+ level,
141
+ failClosed: false,
142
+ contractMatch,
143
+ treeMatch,
144
+ message: level === 'full' ? MSG.FRESH_FULL : MSG.FRESH_CONTRACT_ONLY,
145
+ };
146
+ }
147
+ /**
148
+ * Write-style prior requirements (Decision 2).
149
+ * Caller must supply artifactId. claimedBefore is never accepted as measurement.
150
+ */
151
+ function assessWriteStylePrior(input) {
152
+ const id = input.artifactId;
153
+ if (typeof id !== 'string' || id.trim().length === 0) {
154
+ // If they only offered a claimed before, still missing the identifier — and do not climb a ladder.
155
+ const claimed = typeof input.claimedBefore === 'string' && input.claimedBefore.length > 0;
156
+ return {
157
+ gateable: false,
158
+ reason: claimed ? 'CLAIMED_BEFORE_NOT_MEASUREMENT' : 'MISSING_ARTIFACT_ID',
159
+ claimedBeforeAcceptedAsMeasurement: false,
160
+ message: claimed
161
+ ? 'Write-style call supplied claimed before content without an artifact id. '
162
+ + 'A caller-supplied before is a claim, not a measurement. '
163
+ + 'Pass the artifact id from the preflight artifacts[] entry; the gate resolves prior content.'
164
+ : 'Write-style call is missing an artifact identifier. '
165
+ + 'Pass the id from a prior preflight artifacts[] entry (path + new content alone is not gateable). '
166
+ + 'The gate resolves prior content; do not invent a before.',
167
+ };
168
+ }
169
+ return {
170
+ gateable: true,
171
+ reason: 'ok',
172
+ claimedBeforeAcceptedAsMeasurement: false,
173
+ message: 'Artifact id present; gate may resolve prior content for freshness recompute.',
174
+ };
175
+ }
176
+ /**
177
+ * Convenience: whether enforced execution is allowed for this freshness result.
178
+ * Equivalent to !failClosed: FRESH always; STALE_CONTEXT only when the team opted out;
179
+ * TARGET_MUTATED / TAMPERED / UNKNOWN never.
180
+ */
181
+ function freshnessAllowsEnforce(result) {
182
+ return result.failClosed === false;
183
+ }
184
+ /**
185
+ * Detect write-style: contract-relevant path present, but no both-side artifacts on the descriptor.
186
+ * (edits[]/old_string+new_string binders already lift both sides — those are not write-style.)
187
+ */
188
+ function isWriteStyleCall(call) {
189
+ const arts = call.artifacts;
190
+ if (Array.isArray(arts) && arts.length > 0) {
191
+ const anyBoth = arts.some((a) => a
192
+ && typeof a.before === 'string'
193
+ && a.before.length > 0
194
+ && typeof a.after === 'string'
195
+ && a.after.length > 0);
196
+ if (anyBoth)
197
+ return false;
198
+ }
199
+ const args = call.arguments && typeof call.arguments === 'object'
200
+ ? call.arguments
201
+ : {};
202
+ const path = typeof args.path === 'string' && args.path.length > 0
203
+ ? args.path
204
+ : (Array.isArray(call.filesTouched) && typeof call.filesTouched[0] === 'string'
205
+ ? call.filesTouched[0]
206
+ : '');
207
+ if (!path)
208
+ return false;
209
+ // path + new content / contents without old_string both sides
210
+ const hasAfter = (typeof args.contents === 'string' && args.contents.length > 0)
211
+ || (typeof args.content === 'string' && args.content.length > 0)
212
+ || (typeof args.new_string === 'string' && args.new_string.length > 0);
213
+ const hasOld = typeof args.old_string === 'string' && args.old_string.length > 0;
214
+ if (hasAfter && !hasOld)
215
+ return true;
216
+ // path-only write-like with no artifacts
217
+ if (!Array.isArray(arts) || arts.length === 0) {
218
+ return hasAfter || typeof args.contents === 'string' || typeof args.content === 'string';
219
+ }
220
+ return false;
221
+ }
222
+ /** Artifact ids the runner should ask the host to resolve (from lifted artifacts or path-derived id). */
223
+ function artifactIdsForResolve(call) {
224
+ const ids = [];
225
+ if (Array.isArray(call.artifacts)) {
226
+ for (const a of call.artifacts) {
227
+ if (a && typeof a.id === 'string' && a.id.trim())
228
+ ids.push(a.id);
229
+ }
230
+ }
231
+ if (ids.length > 0)
232
+ return [...new Set(ids)];
233
+ const args = call.arguments && typeof call.arguments === 'object'
234
+ ? call.arguments
235
+ : {};
236
+ if (typeof args.artifact_id === 'string' && args.artifact_id.trim())
237
+ return [args.artifact_id.trim()];
238
+ if (typeof args.artifactId === 'string' && args.artifactId.trim())
239
+ return [args.artifactId.trim()];
240
+ // path alone is not an id — host must pass artifact id from preflight; still list path-key for resolve attempts
241
+ if (typeof args.path === 'string' && args.path.trim()) {
242
+ // Prefer explicit id fields only; path is path, not artifact id (Decision 2).
243
+ }
244
+ return ids;
245
+ }
246
+ /**
247
+ * RUNNER-side collection. Invokes the host resolver (async I/O). Never call from pure assessFreshness.
248
+ * - no resolver → NOT_CONFIGURED (did not try)
249
+ * - resolver throws → DEGRADED (opted in, failed)
250
+ * - resolver returns empty/non-string for all ids → DEGRADED
251
+ * - otherwise ACTIVE with priorResolved map
252
+ */
253
+ async function collectFreshnessCallContext(input) {
254
+ const resolver = input.resolvePriorContent;
255
+ if (typeof resolver !== 'function') {
256
+ return { wiring: 'NOT_CONFIGURED' };
257
+ }
258
+ const ids = artifactIdsForResolve(input.call);
259
+ const args = input.call.arguments && typeof input.call.arguments === 'object'
260
+ ? input.call.arguments
261
+ : {};
262
+ const path = typeof args.path === 'string' ? args.path : undefined;
263
+ // Resolver present but nothing to resolve on this call — still ACTIVE commitment for wiring state
264
+ // only if we attempted; for zero ids, we attempted zero calls → ACTIVE with empty map means
265
+ // "resolver is configured" but assessment may UNKNOWN. Distinguish: DEGRADED only on throw/empty return.
266
+ if (ids.length === 0) {
267
+ // Host opted in; no artifact id to resolve. Not NOT_CONFIGURED (we would have resolved if we could).
268
+ // Leave ACTIVE with empty priorResolved — assess path handles missing content.
269
+ return { wiring: 'ACTIVE', priorResolved: {} };
270
+ }
271
+ const priorResolved = {};
272
+ try {
273
+ for (const artifactId of ids) {
274
+ const raw = await resolver({
275
+ artifactId,
276
+ path,
277
+ toolName: input.call.toolName,
278
+ });
279
+ if (raw === null || raw === undefined) {
280
+ priorResolved[artifactId] = raw;
281
+ continue;
282
+ }
283
+ if (typeof raw !== 'string') {
284
+ return {
285
+ wiring: 'DEGRADED',
286
+ degrade: { reason: 'resolver_returned_non_string', detail: `artifactId=${artifactId}` },
287
+ priorResolved,
288
+ };
289
+ }
290
+ if (raw.length === 0) {
291
+ priorResolved[artifactId] = raw;
292
+ continue;
293
+ }
294
+ priorResolved[artifactId] = raw;
295
+ }
296
+ }
297
+ catch (err) {
298
+ return {
299
+ wiring: 'DEGRADED',
300
+ degrade: {
301
+ reason: 'resolver_threw',
302
+ detail: err instanceof Error ? err.message : String(err),
303
+ },
304
+ };
305
+ }
306
+ const values = ids.map((id) => priorResolved[id]);
307
+ const allEmpty = values.every((v) => v === null || v === undefined || v === '');
308
+ if (allEmpty) {
309
+ return {
310
+ wiring: 'DEGRADED',
311
+ degrade: { reason: 'resolver_returned_empty' },
312
+ priorResolved,
313
+ };
314
+ }
315
+ return { wiring: 'ACTIVE', priorResolved };
316
+ }
317
+ /**
318
+ * Build the per-call basis and optional enforce block reason from context + preflight artifacts.
319
+ * Pure once priorResolved is a value (no I/O).
320
+ */
321
+ function buildFreshnessBasis(input) {
322
+ const require_freshness = input.requireFreshness === true;
323
+ const write_style = input.writeStyle === true;
324
+ const { ctx } = input;
325
+ if (ctx.wiring === 'NOT_CONFIGURED') {
326
+ const basis = {
327
+ wiring: 'NOT_CONFIGURED',
328
+ write_style,
329
+ require_freshness,
330
+ };
331
+ // Policy requires freshness on write → permission denied (API still opt-in for non-required).
332
+ if (write_style && require_freshness) {
333
+ return { basis, blockCause: 'FRESHNESS_REQUIRED' };
334
+ }
335
+ return { basis };
336
+ }
337
+ if (ctx.wiring === 'DEGRADED') {
338
+ const basis = {
339
+ wiring: 'DEGRADED',
340
+ write_style,
341
+ require_freshness,
342
+ degrade: ctx.degrade ?? { reason: 'resolver_returned_empty' },
343
+ };
344
+ // Opted in, then failed: never silently unprotected. Fail closed on write when required,
345
+ // and also when requireFreshness is false? Decision 1: permission fail when policy requires.
346
+ // Decision 2: DEGRADED must not drop to unprotected — for enforce path always block on DEGRADED
347
+ // for write-style, and for requireFreshness always block.
348
+ if (write_style || require_freshness) {
349
+ return { basis, blockCause: 'FRESHNESS_REQUIRED' };
350
+ }
351
+ return { basis };
352
+ }
353
+ // ACTIVE
354
+ const preflightMap = input.preflightBeforeById ?? {};
355
+ const ids = Object.keys(preflightMap);
356
+ // If we have preflight before sides, assess the first (or all — fail if any fails).
357
+ let assessment;
358
+ if (ids.length > 0) {
359
+ for (const id of ids) {
360
+ const resolved = ctx.priorResolved ? ctx.priorResolved[id] : undefined;
361
+ const one = assessFreshness({
362
+ preflightBefore: preflightMap[id],
363
+ resolvedBeforeNow: resolved,
364
+ preflightTreeHash: input.preflightTreeHash,
365
+ resolvedTreeHashNow: input.resolvedTreeHashNow,
366
+ allowStaleContext: input.allowStaleContext,
367
+ });
368
+ assessment = one;
369
+ if (one.failClosed)
370
+ break;
371
+ }
372
+ }
373
+ else if (write_style) {
374
+ // ACTIVE but no preflight before to compare — measurement incomplete.
375
+ assessment = assessFreshness({
376
+ preflightBefore: '',
377
+ resolvedBeforeNow: null,
378
+ allowStaleContext: input.allowStaleContext,
379
+ });
380
+ }
381
+ const basis = {
382
+ wiring: 'ACTIVE',
383
+ write_style,
384
+ require_freshness,
385
+ assessment,
386
+ };
387
+ if (assessment && assessment.failClosed) {
388
+ return { basis, blockCause: 'FRESHNESS_FAILED' };
389
+ }
390
+ if (write_style && require_freshness && !assessment) {
391
+ return { basis, blockCause: 'FRESHNESS_REQUIRED' };
392
+ }
393
+ return { basis };
394
+ }
395
+ //# sourceMappingURL=freshness.js.map
@@ -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I,WAAW,IAAI,iBAAiB,IAAI,CAAC,UAAU,EAAE,CAAC;QACpD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC"}
@@ -8,5 +8,11 @@
8
8
  * ALLOW/MONITOR; LKG is dormant in v1 (binding fields absent => UNUSABLE => closed). onEvent never throws.
9
9
  */
10
10
  import type { GuardConfig, GuardOutcome, ToolCallDescriptor, ExecuteFactory } from './types.js';
11
- export declare function guardToolCall<T>(call: ToolCallDescriptor, executeFactory: ExecuteFactory<T>, config: GuardConfig): Promise<GuardOutcome<T>>;
11
+ import { type FreshnessCallContext } from './freshness.js';
12
+ /**
13
+ * @param callContext Runner-collected freshness values (optional). When omitted, wiring is
14
+ * NOT_CONFIGURED — the pure path never invokes resolvePriorContent. The tool-registry runner
15
+ * calls collectFreshnessCallContext and passes the result here.
16
+ */
17
+ export declare function guardToolCall<T>(call: ToolCallDescriptor, executeFactory: ExecuteFactory<T>, config: GuardConfig, callContext?: FreshnessCallContext): Promise<GuardOutcome<T>>;
12
18
  //# sourceMappingURL=guard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,WAAW,EAAE,YAAY,EACT,kBAAkB,EAAE,cAAc,EAEnD,MAAM,YAAY,CAAC;AAiLpB,wBAAsB,aAAa,CAAC,CAAC,EACnC,IAAI,EAAE,kBAAkB,EACxB,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,EACjC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CA4L1B"}
1
+ {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,WAAW,EAAE,YAAY,EACT,kBAAkB,EAAE,cAAc,EAEnD,MAAM,YAAY,CAAC;AAMpB,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AA8MxB;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,IAAI,EAAE,kBAAkB,EACxB,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,EACjC,MAAM,EAAE,WAAW,EACnB,WAAW,CAAC,EAAE,oBAAoB,GACjC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAmP1B"}