UNPKG

kestrel.markets

Version:

A typed, token-efficient language + runtime for agentic trading: agents author bounded plans, the runtime fires them at the tick. CLI + typed library + MCP server.

48 lines 3.22 kB
/** * # vocab — the single source for every closed lexical vocabulary * * Each runtime table below is DERIVED from a closed string-union in {@link ./ast.ts}, so the * vocabulary the parser recognizes and the printer emits can never silently drift from the * type that defines the language. Every table is a `Record<Union, …>`: removing a union * member leaves an excess key here (a compile error at the table), and adding a member leaves * a missing key here (also a compile error at the table). The human-facing ordered lists * (`ANCHOR_NAMES`, `TIME_UNITS_LIST`) come from `Object.keys` of those Records — insertion * order is stable for non-integer keys — so "expected one of …" error strings are * single-sourced too, never a hand-retyped third copy. * * `parse.ts` and `print.ts` consume this module; neither keeps a private copy (ADR-0004: the * two projections must agree, and the surest way is to read the same table). */ import type { AnchorName, ClockStop, CompareOp, ProvenanceTier, TimeHeldStop, TimeUnit } from "./ast.ts"; /** Ordered for the "a time unit (…)" / "expected one of …" parse messages. */ export declare const TIME_UNITS_LIST: readonly TimeUnit[]; export declare const TIME_UNITS: ReadonlySet<string>; export declare const ORDINAL_PREFIX: "d"; export declare const EXPIRY_PREFIX: "e"; /** Ordered for the "an anchor (fair, intrinsic, …)" parse message. */ export declare const ANCHOR_NAMES: readonly AnchorName[]; export declare const ANCHORS: ReadonlySet<string>; export declare const TIME_STOP_KEYWORDS: Readonly<Record<TimeHeldStop["kind"] | ClockStop["kind"], string>>; /** `held` — the lead keyword of a `TimeHeldStop` (`EXIT held 90m`). */ export declare const HELD_STOP_KEYWORD: string; /** `clockET` — the lead keyword of a `ClockStop` (`EXIT clockET 15:40`). The NEW vocab token. */ export declare const CLOCK_STOP_KEYWORD: string; export declare const FILL_EVENTS: ReadonlySet<string>; export declare const STANDINGS: ReadonlySet<string>; export declare const GRADE_WHATS: ReadonlySet<string>; export declare const CITATION_ALGOS: ReadonlySet<string>; /** Authority ordering for the provenance ceiling: a higher rank is more authority. The * Record over `ProvenanceTier` doubles as the closed-vocabulary table — membership is its * key set, so the rank map and the tier vocabulary can never diverge. */ export declare const PROV_RANK: Readonly<Record<ProvenanceTier, number>>; export declare const PROV_TIERS: ReadonlySet<string>; /** The canonical direction the printer emits (op → punctuation). `Record<CompareOp, …>` * keeps it exhaustive over the union. */ export declare const CMP_TO_PUNCT: Readonly<Record<CompareOp, string>>; /** The parser's inverse (punctuation → op), derived mechanically from `CMP_TO_PUNCT` so the * two directions are one table, not two hand-kept copies that could disagree. */ export declare const CMP_FROM_PUNCT: Readonly<Record<string, CompareOp>>; /** 1-based ordinals; index 0 (`zeroth`) is a slot filler so `ORDINALS[n]` lines up with the * cardinal `n` (the printer refuses n < 1, the parser matches from index 1). */ export declare const ORDINALS: readonly string[]; //# sourceMappingURL=vocab.d.ts.map