CallContext
Defined in: src/types.ts:112
Extended context with authentication info, available to handlers.
Extends
Section titled “Extends”Properties
Section titled “Properties”readonly auth: AuthContext;Defined in: src/types.ts:115
Authenticated principal for this call; AuthContext.anonymous when the request was not authenticated.
cookies
Section titled “cookies”readonly cookies: ReadonlyMap<string, string>;Defined in: src/types.ts:156
Incoming request cookies. Empty for non-HTTP transports.
externalizationEnabled?
Section titled “externalizationEnabled?”readonly optional externalizationEnabled?: boolean;Defined in: src/types.ts:152
True iff the server has an externalisation backend wired up.
inputMetadata?
Section titled “inputMetadata?”readonly optional inputMetadata?: ReadonlyMap<string, string>;Defined in: src/types.ts:126
Application custom metadata carried by this stream turn’s input: the
exchange input batch (the same keys as input.metadata) or the producer
tick, its own on every turn and every transport. Over HTTP the transport’s
bookkeeping – the cursor, the call token and the cancel marker – is
removed, a producer’s first turn carries the /init request’s metadata,
and an externalized input carries the fetched payload’s metadata plus
vgi_rpc.location.source / vgi_rpc.location.fetch_ms, never the
pointer’s.
readonly optional kind?: TransportKind;Defined in: src/types.ts:130
Coarse identifier of the bound transport, or undefined until the
server begins serving (the value is committed by the lifecycle hook
on the very first request).
peerEvidence?
Section titled “peerEvidence?”readonly optional peerEvidence?: PeerEvidenceSet;Defined in: src/types.ts:117
Immutable, off-wire transport peer identity evidence for this call.
preferredResponseBytes?
Section titled “preferredResponseBytes?”readonly optional preferredResponseBytes?: number;Defined in: src/types.ts:143
Application sizing target clamped to responseLimitBytes.
remainingExternalizedResponseBytes?
Section titled “remainingExternalizedResponseBytes?”readonly optional remainingExternalizedResponseBytes?: number;Defined in: src/types.ts:150
External-channel bytes left this iteration. Always a hard cap — externalised uploads have no escape valve like producer continuation tokens. Undefined when no cap is configured or externalisation is disabled.
remainingResponseBytes?
Section titled “remainingResponseBytes?”readonly optional remainingResponseBytes?: number;Defined in: src/types.ts:138
Wire body bytes the framework will accept this iteration before
triggering a continuation token (producer streams) or strict-fail
with an EXCEPTION batch (unary / stream-exchange). Snapshot at
collector construction; not live. undefined when no cap is
configured or the transport doesn’t expose one (stdio).
responseLimitBytes?
Section titled “responseLimitBytes?”readonly optional responseLimitBytes?: number;Defined in: src/types.ts:141
Effective hard response limit after application, hosting, and client limits are combined. Preferred over the legacy remaining* alias.
session
Section titled “session”readonly session: unknown;Defined in: src/types.ts:172
Live sticky-session state object, or null when no session is bound to
this request. HTTP-only — other transports always return null.
sessionId
Section titled “sessionId”readonly sessionId: string | null;Defined in: src/types.ts:179
Opaque 24-char-hex session ID, or null when no session is bound.
Survives closeSession so post-close access-log records still
carry the id.
Methods
Section titled “Methods”clientLog()
Section titled “clientLog()”clientLog( level, message, extra?): void;Defined in: src/types.ts:69
Emit a client-directed log message (sent as a zero-row log batch on the
wire). level is a severity label such as "info", "warning", or
"error"; extra carries optional structured string key/value pairs.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
level |
string |
message |
string |
extra? |
Record<string, string> |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”closeSession()
Section titled “closeSession()”closeSession(): void;Defined in: src/types.ts:190
Invalidate the sticky session bound to this request. Idempotent.
Returns
Section titled “Returns”void
deleteCookie()
Section titled “deleteCookie()”deleteCookie(name, opts?): void;Defined in: src/types.ts:166
Queue an unset-cookie directive on the HTTP response. Only valid inside a unary RPC method served over HTTP; throws otherwise.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
opts? |
{ domain?: string; path?: string; } |
opts.domain? |
string |
opts.path? |
string |
Returns
Section titled “Returns”void
openSession()
Section titled “openSession()”openSession(state, ttl?): void;Defined in: src/types.ts:187
Register a sticky session holding state for subsequent requests on
this transport. HTTP-only — throws on other transports, on calls
without the VGI-Session-Accept: true opt-in header, or when a
session is already bound to this request.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
state |
unknown |
ttl? |
number |
Returns
Section titled “Returns”void
setCookie()
Section titled “setCookie()”setCookie( name, value, attrs?): void;Defined in: src/types.ts:161
Queue a Set-Cookie header on the HTTP response. Only valid inside a unary RPC method served over HTTP; throws otherwise.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
value |
string |
attrs? |
CookieAttrs |
Returns
Section titled “Returns”void
