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.
75 lines (72 loc) • 3.23 kB
text/typescript
/**
* # kestrel.markets/sdk — the ONE typed client over LOCAL + HTTP transports (kestrel-djm.5)
*
* `createSdk(transport)` is the ONE typed Kestrel client; `localTransport()` / `remoteTransport(opts)` are
* the two interchangeable transports. A caller writes the flow ONCE and runs it LOCAL (in-process djm.4
* controller + djm.8 catalog + engine grade) or REMOTE (the 109 HTTP client over the 5rb wire) with
* BYTE-IDENTICAL protocol results — same djm.2 objects, same diagnostics, same event cursors, same artifact
* refs, same 402/Offer boundary, same semantic digest. No face-local success/failure vocabulary crosses the
* surface; a 402/Offer is DATA and an unknown subject is a typed refusal (fail-closed).
*
* ## Subpaths
* - `kestrel.markets/sdk` — this barrel (HEAVY: pulls the LOCAL transport / engine). Both transports.
* - `kestrel.markets/sdk/remote` — the LIGHT HTTP-only entry (`createSdk` + `remoteTransport` + types): a
* remote-only consumer imports THIS and drags no local runtime / lake into
* its bundle (pinned by tests/package.boundary.test.ts).
*/
export { createSdk, SDK_VERSION } from "./facade.ts";
export { localTransport, SdkLocalError, toProtocolBlotter, gradeOf, artifactsOf, conformanceRootOf } from "./local.ts";
export { remoteTransport } from "./remote.ts";
// The agent JSONL protocol's SELF-DESCRIPTION (kestrel-yuw4): the one op-argument-schema catalogue the
// `describe` op emits + the shared argument validators. Pure data / pure functions (no runtime semantics).
export {
AGENT_OP_SCHEMAS,
agentOpNames,
agentDescribe,
ArgShapeError,
asSessionRef,
asAuthoredResponse,
asBoundResponse,
asEventCursor,
asRequiredString,
asBlotters,
SUBJECT_SHAPE,
AUTHORED_RESPONSE_SHAPE,
AUTHORED_RESPONSE_KINDS,
BOUND_RESPONSE_SHAPE,
TURN_BODY_KINDS,
EVENT_CURSOR_SHAPE,
VALIDATE_DOCUMENT_SHAPE,
BLOTTERS_SHAPE,
ARTIFACT_REF_SHAPE,
OPERATION_ID_SHAPE,
} from "./op-schema.ts";
export type { AgentOpArg, AgentOpSchema, AgentDescribe } from "./op-schema.ts";
export type {
ArtifactResult,
AuthoredResponse,
BoundResponse,
Delivery,
Gated,
GradeOutcome,
GradeRequest,
KestrelSdk,
KestrelSession,
OperationRef,
OperationResumption,
SdkFinalized,
SessionRef,
SessionResponse,
SessionTranscript,
Transport,
ValidateOutcome,
} from "./types.ts";
// The server's problem+json diagnostics preserved through a client throw (kestrel-3w9r) — part of the SDK's
// public error vocabulary, re-exported from the 109 client so a projection (the djm.6 CLI agent) surfaces
// them without reaching past the barrel. Type-only: erased at build.
export type { ProblemDetails } from "../client/index.ts";
export type { RemoteTransportOptions } from "./remote.ts";
// The djm.2 resume cursor is part of the SDK's PUBLIC vocabulary (KestrelSession.resume / OperationRef.after
// both speak it). Re-export it so a pure SDK projection — e.g. the djm.6 CLI agent mode — needs no reach past
// the barrel into the protocol module. Type-only: erased at build, no runtime / semantic change.
export type { EventCursor } from "../protocol/index.ts";