agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
30 lines • 1.55 kB
TypeScript
/**
* artifacts/minting — the shared half of every adapter's `put`.
*
* Validate the input, prove the parents, measure the bytes, compute the
* digest when asked, mint the ref, stamp the meta. Three adapters call this
* one pipeline so a put refused by `inMemoryArtifacts` is refused in the same
* words by `sqliteArtifacts` — one law, three storage mechanics.
*
* What stays with the adapter: holding the bytes, applying the retention
* plan, answering the other four verbs.
*/
import { type ArtifactRetention } from './retention.js';
import { type ArtifactMeta, type ArtifactRef, type PutArtifactInput } from './types.js';
/** What an adapter lends the pipeline: "does this ref resolve, in THIS scope?" */
export type ParentResolver = (ref: ArtifactRef) => boolean | Promise<boolean>;
/**
* Validate a put and build the meta it mints.
*
* @param input the caller's put.
* @param resolveParent scope-bound existence check for parent validation.
* @param retention the adapter's policy — stamps `expiresAt` (stated, never sprung).
* @param now the adapter's clock, injected so tests own time.
* @throws InvalidArtifactError for input this library cannot store faithfully.
* @throws UnknownParentRefError for a parent that does not resolve in scope.
*/
export declare function prepareArtifact(input: PutArtifactInput, resolveParent: ParentResolver, retention: ArtifactRetention | undefined, now: number): Promise<{
meta: ArtifactMeta;
bytes: number;
}>;
//# sourceMappingURL=minting.d.ts.map