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.
43 lines • 6.37 kB
TypeScript
/**
* # session — the object that owns a run
*
* Charter: the one object that owns a run — `{ driver, clock, gate, bus, mode }` — with
* modes **sim | paper | live** as one code path differing only in the gate adapter, so
* grading is honest by construction. It also carries the **Wake router**, turning the
* trigger algebra into attention: subscriptions carry attention budget, priority, and a
* delivered View, never risk, and past budget wakes coalesce and downgrade (never
* silently drop — the squelch is visible in the kernel). A Pod definition is a **class**;
* a run of it is an **instance** = (definition version × mode × run id): sim and paper
* instances are unbounded, but **the live instance is a singleton per pod lineage,
* platform-enforced**. Promotion is a document revision of the live pod, never a flag
* flip. This is the single thing the HTTP/SSE, CLI, and MCP surfaces sit on.
*
* ## Shipped in this milestone — the sim driver (RUNTIME §7)
* {@link ./sim.ts} implements the `sim` code path end to end: read a recorded/synthetic bus,
* drive canonical state + the {@link ../engine PlanEngine} trigger sweep, route orders through
* the Gate into a {@link ../fill SimFillEngine}, reassess fills on BOOK events, cash-settle at
* intrinsic, and return a graded {@link EpisodeReport} with a determinism hash over the emitted
* event stream. {@link ./cli.ts} is the loud, fail-closed CLI over it. The Wake router, the
* paper/live gates, and the multi-mode surfaces land in later milestones.
*/
export { runSimSession, writeReport, SessionCore, requireMeta, resolveSpecs, busSha256Of, stampGradedMeta, assembleGradedBus, fillModelStampOf, instanceIdentityOf, fidelityOf, canonicalPlansTextOf, closingParitySpot, type RunSimOptions, type SessionCoreOptions, type FillModelName,
/** kestrel-wcnd: the machine-readable reason code an unknowable-τ de-arm carries. */
FAIR_TAU_UNKNOWN_CODE, type EpisodeReport,
/** @deprecated renamed to EpisodeReport (kestrel-markets-jcn0); alias kept for API compat. */
type SessionReport, type PlanTrace, type PlanLifecycleStep, type OrderReport, } from "./sim.ts";
export { expiryTauYears, etMinuteOfDay, etWallClockMs, } from "./clock.ts";
export type { FairTauProvider } from "./clock.ts";
export { runDaySession, computeWakes, parseWakeTimes, parseClockET, reanchorFrontier, authorCutoffTs, REGULAR_OPEN, AUTHOR_CUTOFF_LEAD_MIN, machineSummary, projectAuthorFrame, scanDateLeak, assertDateBlind, DATE_LEAK_PATTERNS, type RunDayOptions, type DaySessionResult, type DaySnapshot, type AuthorFrame, type DayHooks, type WakeRecord, type TimeOfDay, } from "./day.ts";
export { fixedPlanAgent, recordedAgent, wakeKeyOf, assertHandlerResponseTimeless, OPEN_ORDINAL, OPEN_WAKE_KEY, BACKTEST_CONFIG, type WakeKey, type WakeSource, type WakeHandler, type Agent, type AgentConfig, type AgentTurn, type Action, type ActingFrame, type CapturedTurn, type CapturedTurns, type CachePolicy, type CacheTtl, type LlmClient, type LlmCompletion, type LlmMessage, type LlmUsage, type RequestView, type AuthoringReply, type AuthoringOpenOptions, type AuthoringStep, } from "./agent.ts";
export { liveAgent, LIVE_AGENT_ADAPTER, LIVE_AGENT_ADAPTER_VERSION, DEFAULT_CACHE_POLICY, type LiveAgentOptions, type TurnCapture, type TurnOutcome, } from "./harness/live-agent.ts";
export { fileHandshakeAgent, FILE_HANDSHAKE_ADAPTER, FILE_HANDSHAKE_ADAPTER_VERSION, STAND_DOWN_SENTINEL, DEFAULT_TIMEOUT_MS, ordLabelOf, serializeFrameEnvelope, renderFrameText, timeoutTurn, parseHandshakeTurn, stampHarnessIdentity, type FileHandshakeOptions, type FrameEnvelope, type HandshakeCapture, type HandshakeOutcome, } from "./harness/file-handshake.ts";
export { BASELINE_SYSTEM_PROMPT, BASELINE_PROMPT_PROFILE, AUTHORING_SYSTEM_PROMPT, AUTHORING_PROMPT_PROFILE, AUTHORING_EXAMPLE_DOCUMENTS, AUTHORING_EXAMPLE_DOCUMENT_LIST, VIEWSHOP_SYSTEM_PROMPT, VIEWSHOP_PROMPT_PROFILE, MANAGE_SYSTEM_PROMPT, MANAGE_PROMPT_PROFILE, DEFAULT_PROMPT_PROFILE, systemPromptForProfile, CREDENTIAL_ENV_VARS, parseTurn, parseAuthoringReply, describeAction, scrubSecrets, renderBriefingPrompt, renderRepairPrompt, renderReprompt, renderWakePrompt, REPROMPT_WITHHELD, type TurnParse, type TurnReject, } from "./harness/prompt.ts";
export { runSimulateSession, projectWakeFrame, sizingHeadroomOf, vehicleHealthOf, vehicleBookFromSpot, DEFAULT_VIEW_REQUEST_CAP, DEFAULT_AUTHORING_TOKEN_BUDGET, type RunSimulateOptions, type OptionsOverlayConfig, type SimulateResult, type SeqWindow, type WakeCtx, type WakeFrameConfig, type VehicleBook, type EmergenceRecord, } from "./simulate.ts";
export { runPaperSession, openPaperSession, ibkrPaperVenue, assertBoundedLimits, PaperSessionRefused, PaperBus, DEFAULT_PUMP_MS, type RunPaperOptions, type PaperSession, type PaperSessionResult, type PaperSessionFailure, type PaperHooks, type PaperVenueSource, type PaperVenueSession, type PaperVenueRequest, type PaperBrokerRequest, } from "./paper.ts";
export { canonicalizeConfig, deriveConfigId, cellCanonicalConfig, cellConfigId, envelopeOf, envelopeForConfig, declaresEnvelope, fillSeedOf, sampledQualificationOf, type CanonicalConfig, } from "./config.ts";
export { openSession, resumeSession, type SessionController, type SessionSpec, type SessionFrame, type Delivery, type AuthoredResponse, type BoundResponse, type TurnDisposition, type TurnReceipt, type SessionResponse, type SessionTranscript, type SessionFinalized, } from "./controller.ts";
export { SimRunId, CellKey, cellOf, InstanceRunId, SequenceCellKey, type CellKeyStruct } from "./run-identity.ts";
export { runInstance, type SessionInput, type InstanceConfig, type InstanceResult, type DroppedWake, } from "./instance.ts";
export { emptyCarry, assertCarry, carryFrom, type SessionCarry, type CarriedPosition, type PendingWake, type JournalNote, type TimescaleBand, type CarryFromArgs, } from "./carry.ts";
export { buildGrid, leaderboard, buildInstanceBlotter, buyAndHoldBaseline, type Grid, type CellAggregate, type LeaderboardRow, type Dist, type FinancialAxis, type Benchmark, type UnderlierHold, type BuildGridOptions, type RiskAxis, type ProcessAxis, type FidelityAxis, type CostAxis, type CertificationBreakdown, type SessionLink, type InstanceFinancial, type InstanceGrade, type InstanceBlotter, type BuildInstanceBlotterOptions, } from "./grid.ts";
//# sourceMappingURL=index.d.ts.map