agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
53 lines • 2.55 kB
TypeScript
/**
* search/facets — the `checked` items one call's search covered.
*
* Pattern: one pure composer per list; this one is `checked`.
* Role: semantics/ layer, pure.
* Emits: N/A.
*
* A facet enters `checked` from exactly these places, and nowhere else:
*
* • the declared subject (`from: 'tool'`, `facet: 'subject'`) — what the
* search looked for;
* • the declared source (`from: 'tool'`) — or, when a `source` argument is
* in effect, that argument: a sent value REPLACES the declared source and
* keeps the declared words only when it equals the declared default;
* • a declared fixed qualifier (`from: 'fixed'`);
* • a value the call sent (`from: 'call'`), or a declared default the call
* left out (`from: 'default'`, the value or `any`);
* • an argument the host filled from the run's identity (`from: 'host'`,
* its value by reference);
* • the result's own `period.queried`, when no period argument is in effect
* (`from: 'result'`).
*
* `cap`, `page`, `inert` and credential-filled arguments name no ground and
* compose no item; an unsent argument composes a gap instead (`gaps.ts`).
*/
import type { ComposedItem } from '../composedCoverage.js';
import type { DeclaredPeriod } from '../period.js';
import type { ArgumentReading } from './inEffect.js';
import type { ResolvedDeclaration } from './resultFacts.js';
import type { SearchArgument, ToolSearch } from './types.js';
import type { PeriodShapes } from '../../../time/periodForm.js';
/** What the facet composer reads. */
export interface FacetInput {
readonly search: ToolSearch;
/** Each classified argument with its reading, in declaration order. */
readonly readings: ReadonlyArray<readonly [SearchArgument, ArgumentReading]>;
readonly resolved?: readonly ResolvedDeclaration[];
readonly resultPeriod?: DeclaredPeriod;
readonly period?: PeriodShapes;
/** When the call was dispatched — what a relative window is resolved at. */
readonly dispatchedAt?: string;
}
/**
* A value as composed text — a string as written, a number or boolean as
* printed, anything else as its JSON. Never spread into the item.
*/
export declare function valueText(value: unknown): string;
/**
* The `checked` items, in a fixed order: the source, the subject, the fixed qualifiers,
* then each argument in declaration order, then a result-declared period.
*/
export declare function composeChecked(input: FacetInput): readonly ComposedItem[];
//# sourceMappingURL=facets.d.ts.map