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 • 2.28 kB
TypeScript
/**
* time/readingAsk — the choices an OPEN reading offers (time design
* § 6.1, § 6.3): the one field a `time-reading` row whose choice is `open`
* needs.
*
* Pattern: a pure builder over the row — the candidates as labelled choices,
* a zone asked as `format: 'zone'`, a `model` reading offered to
* confirm. The judge of the answer stays `ask.ts` ·
* `checkTimeAnswer`.
* Role: L0 leaf (the time layer). Split from `ask.ts` because its
* labels render through `present.ts` (`presentRange`), and `ask.ts`
* is on the resume door's SYNCHRONOUS path (`tools/inputRequest.ts`)
* while the renderer loads only under `.time()` — the
* optional-family law of docs-next's site budget.
* Emits: N/A.
*
* @example
* ```ts
* const ask = timeAskOf(row, defaultTimeAskMessages);
* ask?.field.format; // 'time-range' — its `enum` the candidates left
* ```
*/
import { type TimeAskMessages, type TimeFormat } from './ask.js';
import type { TimeReadingRow } from './rows.js';
/** A time field built from a reading — the fields of `tools/inputRequest.ts` · `InputField` it sets. */
export interface TimeAskField {
readonly id: string;
readonly type: 'string';
readonly required: true;
readonly format: TimeFormat;
readonly enum?: readonly string[];
readonly labels?: readonly string[];
}
/** One question about one mention: the question and its field. */
export interface TimeAsk {
readonly question: string;
readonly field: TimeAskField;
}
/**
* The ask a `time-reading` row needs, or `undefined` when its reading is
* settled (`only`, `policy`) or is no person's words (a refused mention).
* Words the library holds NO reading of (`none`: unreadable, no candidate)
* are asked too — which time the person meant, free entry, nothing
* pre-filled (`ask.which`, `format: 'time-range'`): the person wrote a time,
* and a tool's default never stands in for it. `messages` is the whole
* catalog (the caller composes the app's overrides over
* `defaultTimeAskMessages`); `id` names the field.
*/
export declare function timeAskOf(row: TimeReadingRow, messages: TimeAskMessages, id?: string): TimeAsk | undefined;
//# sourceMappingURL=readingAsk.d.ts.map