Skip to main content

@svatah/yam-sdk

The typed TypeScript client for the Yam local service, generated from its OpenAPI description (REQ-SDK-1)

Exports

ExportKindSignature
Actioninterfaceinterface ActionOne action (LLD §13.7).
ActionArgsinterfaceinterface ActionArgs extends ScreenParamsWhat an action was given: the screen's params, plus whatever the row supplied.
actionByIdfunctiondeclare function actionById(id: string): Action | undefined;One action by id, or undefined. The renderers and the SDK both use this.
ActionOutcomeinterfaceinterface ActionOutcomeWhat an action answered with. Renderers show message; agents read the rest.
ACTIONSvariableACTIONS: readonly Action[]Every action, in palette order: Actions first, then Go to (LLD §13.7).
connectfunctionexport function connect(connection?: Partial<ServiceConnection>): YamClientWhere the service is (LLD §13.8).
ENDPOINTSvariableENDPOINTS: readonly ServiceEndpoint[] = [
EVENT_KINDSvariableEVENT_KINDS = ["step.result", "run.summary", "run.started", "run.failed", "record.started", "record.step", "record.decision", "record.candidates", "record.decisEvery event kind the stream carries (LLD §13.5).
EventKindtypealiasexport type EventKind = (typeof EVENT_KINDS)[number];
ScreenServiceinterfaceinterface ScreenServiceA screen asks for what it renders and gets unknown; it parses with @svatah/yam-schema.
ServiceConnectioninterfaceexport interface ServiceConnection
ServiceEndpointinterfaceexport interface ServiceEndpointOne route the service publishes. actions and the drift check read this.
ServiceErrorclassexport class ServiceError extends ErrorA non-2xx answer, with the body the service sent.
ServiceEventinterfaceexport interface ServiceEventOne message off the stream.
StreamTransporttypealiasexport type StreamTransport = "sse" | "websocket";Which transport subscribe() should use. SSE by default: it survives proxies.
SubscribeOptionsinterfaceexport interface SubscribeOptions
YamClientclassexport class YamClient extends GeneratedClient implements ScreenServiceThe client.