HonoOptions
@rotorsoft/act-root / act-http/src/hono / HonoOptions
Type Alias: HonoOptions<TApp>
HonoOptions<
TApp> =object
Defined in: libs/act-http/src/hono/index.ts:116
Per-call options for hono. The host supplies the four seams the package can't make decisions on:
actor— auth resolver. Receives the Hono context, returns theActorthat flows ontoc.get("actor")for every generated route (via an internal authenticated).stream— stream-id resolver. Receives the action name, the validated body, and the Hono context; returns the target stream. Singleton aggregates return a constant; per-tenant aggregates pull from headers, path, or body.expectedVersion(optional) — optimistic-concurrency resolver. Hosts typically read it from anIf-Matchheader on the request, or from the client's last-known snapshot. Returningundefinedleaves the call to the version the action loads; a number pins it, and a pinned conflict is never retried.idempotency(optional) — when set, the route honorsIdempotency-Keyvia withIdempotency. The host supplies theIdempotencyStore;keyFromdefaults to reading theIdempotency-Keyheader. A duplicate of a key that already succeeded gets409 Conflict— the contract intentionally doesn't cache the original handler's result. A duplicate that arrives while the original is still running gets a retryable503+Retry-Afterinstead, because the original may yet fail and release the key, and a client told "already used" would never retry.basePath(optional, default"/api") — Hono basePath the routes mount under.
Type Parameters
TApp
TApp = ActSurface
Properties
actor
readonlyactor:ActorExtractor<Context>
Defined in: libs/act-http/src/hono/index.ts:117
basePath?
readonlyoptionalbasePath?:string
Defined in: libs/act-http/src/hono/index.ts:145
expectedVersion?
readonlyoptionalexpectedVersion?: (...args) =>number|undefined|Promise<number|undefined>
Defined in: libs/act-http/src/hono/index.ts:121
Parameters
args
...ResolverArgs<TApp, Context>
Returns
number | undefined | Promise<number | undefined>
idempotency?
readonlyoptionalidempotency?:object
Defined in: libs/act-http/src/hono/index.ts:124
keyFrom?
readonlyoptionalkeyFrom?: (c) =>string|undefined
Parameters
c
Context
Returns
string | undefined
store
readonlystore:IdempotencyStore
sse?
readonlyoptionalsse?:SseOptions
Defined in: libs/act-http/src/hono/index.ts:144
Optional SSE wiring. When set, the generator emits one
GET <basePath>/sse/<stateName>?stream=<streamId> per unique
state name in the registry. The endpoint runs the host
actor extractor, looks up the streamId from
?stream=..., opens a text/event-stream, yields the cached
state (if any), and forwards every patch published to the
shared SseOptions.channel. A heartbeat keeps proxies
from idling the connection out; the per-process connection cap
returns 503 Service Unavailable (with Retry-After: 1) when
full so operators never see silent stalls.
Off by default — most APIs don't expose live state to every client, and opening one is widening both the auth and cost surface.
stream
readonlystream: (...args) =>string|Promise<string>
Defined in: libs/act-http/src/hono/index.ts:118
Parameters
args
...ResolverArgs<TApp, Context>
Returns
string | Promise<string>