@query-farm/vgi-rpc 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/access-log.d.ts +50 -0
  2. package/dist/access-log.d.ts.map +1 -0
  3. package/dist/arrow/impl-arrowjs/index.d.ts +96 -0
  4. package/dist/arrow/impl-arrowjs/index.d.ts.map +1 -0
  5. package/dist/arrow/impl-flechette/index.d.ts +102 -0
  6. package/dist/arrow/impl-flechette/index.d.ts.map +1 -0
  7. package/dist/arrow/impl-flechette/message-meta.d.ts +11 -0
  8. package/dist/arrow/impl-flechette/message-meta.d.ts.map +1 -0
  9. package/dist/arrow/index.d.ts +4 -0
  10. package/dist/arrow/index.d.ts.map +1 -0
  11. package/dist/arrow/predicates.d.ts +44 -0
  12. package/dist/arrow/predicates.d.ts.map +1 -0
  13. package/dist/arrow/types.d.ts +62 -0
  14. package/dist/arrow/types.d.ts.map +1 -0
  15. package/dist/client/capabilities.d.ts +25 -0
  16. package/dist/client/capabilities.d.ts.map +1 -0
  17. package/dist/client/connect.d.ts.map +1 -1
  18. package/dist/client/introspect.d.ts +7 -0
  19. package/dist/client/introspect.d.ts.map +1 -1
  20. package/dist/client/ipc.d.ts +8 -2
  21. package/dist/client/ipc.d.ts.map +1 -1
  22. package/dist/client/pipe.d.ts.map +1 -1
  23. package/dist/client/stream.d.ts +11 -2
  24. package/dist/client/stream.d.ts.map +1 -1
  25. package/dist/client/uploadUrl.d.ts +25 -0
  26. package/dist/client/uploadUrl.d.ts.map +1 -0
  27. package/dist/constants.d.ts +15 -1
  28. package/dist/constants.d.ts.map +1 -1
  29. package/dist/crypto.d.ts +22 -0
  30. package/dist/crypto.d.ts.map +1 -0
  31. package/dist/dispatch/describe.d.ts +10 -6
  32. package/dist/dispatch/describe.d.ts.map +1 -1
  33. package/dist/dispatch/stream.d.ts +2 -2
  34. package/dist/dispatch/stream.d.ts.map +1 -1
  35. package/dist/dispatch/unary.d.ts +2 -2
  36. package/dist/dispatch/unary.d.ts.map +1 -1
  37. package/dist/errors.d.ts +46 -0
  38. package/dist/errors.d.ts.map +1 -1
  39. package/dist/external.d.ts +25 -5
  40. package/dist/external.d.ts.map +1 -1
  41. package/dist/http/bearer.d.ts.map +1 -1
  42. package/dist/http/common.d.ts +42 -7
  43. package/dist/http/common.d.ts.map +1 -1
  44. package/dist/http/dispatch.d.ts +20 -2
  45. package/dist/http/dispatch.d.ts.map +1 -1
  46. package/dist/http/handler.d.ts.map +1 -1
  47. package/dist/http/index.d.ts +1 -0
  48. package/dist/http/index.d.ts.map +1 -1
  49. package/dist/http/mtls.d.ts +2 -1
  50. package/dist/http/mtls.d.ts.map +1 -1
  51. package/dist/http/oauth-pkce.d.ts +141 -0
  52. package/dist/http/oauth-pkce.d.ts.map +1 -0
  53. package/dist/http/pages.d.ts +3 -0
  54. package/dist/http/pages.d.ts.map +1 -1
  55. package/dist/http/sticky.d.ts +124 -0
  56. package/dist/http/sticky.d.ts.map +1 -0
  57. package/dist/http/token.d.ts +38 -12
  58. package/dist/http/token.d.ts.map +1 -1
  59. package/dist/http/types.d.ts +68 -5
  60. package/dist/http/types.d.ts.map +1 -1
  61. package/dist/index.d.ts +6 -4
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +1275 -3507
  64. package/dist/index.js.map +19 -37
  65. package/dist/launcher/hash.d.ts +22 -0
  66. package/dist/launcher/hash.d.ts.map +1 -0
  67. package/dist/launcher/index.d.ts +23 -0
  68. package/dist/launcher/index.d.ts.map +1 -0
  69. package/dist/launcher/launch.d.ts +27 -0
  70. package/dist/launcher/launch.d.ts.map +1 -0
  71. package/dist/launcher/lock.d.ts +19 -0
  72. package/dist/launcher/lock.d.ts.map +1 -0
  73. package/dist/launcher/serve-unix.d.ts +54 -0
  74. package/dist/launcher/serve-unix.d.ts.map +1 -0
  75. package/dist/launcher/state.d.ts +59 -0
  76. package/dist/launcher/state.d.ts.map +1 -0
  77. package/dist/otel.d.ts.map +1 -1
  78. package/dist/protocol.d.ts +16 -2
  79. package/dist/protocol.d.ts.map +1 -1
  80. package/dist/schema.d.ts +45 -18
  81. package/dist/schema.d.ts.map +1 -1
  82. package/dist/server.d.ts +23 -2
  83. package/dist/server.d.ts.map +1 -1
  84. package/dist/types.d.ts +216 -12
  85. package/dist/types.d.ts.map +1 -1
  86. package/dist/util/gzip.d.ts +10 -0
  87. package/dist/util/gzip.d.ts.map +1 -0
  88. package/dist/util/schema.d.ts +3 -15
  89. package/dist/util/schema.d.ts.map +1 -1
  90. package/dist/util/web-crypto.d.ts +22 -0
  91. package/dist/util/web-crypto.d.ts.map +1 -0
  92. package/dist/util/zstd.d.ts +26 -3
  93. package/dist/util/zstd.d.ts.map +1 -1
  94. package/dist/wire/opaque.d.ts +11 -0
  95. package/dist/wire/opaque.d.ts.map +1 -0
  96. package/dist/wire/reader.d.ts +5 -5
  97. package/dist/wire/reader.d.ts.map +1 -1
  98. package/dist/wire/request.d.ts +11 -3
  99. package/dist/wire/request.d.ts.map +1 -1
  100. package/dist/wire/response.d.ts +6 -6
  101. package/dist/wire/response.d.ts.map +1 -1
  102. package/dist/wire/writer.d.ts +49 -39
  103. package/dist/wire/writer.d.ts.map +1 -1
  104. package/package.json +24 -10
  105. package/src/access-log.ts +195 -0
  106. package/src/arrow/impl-arrowjs/index.ts +433 -0
  107. package/src/arrow/impl-flechette/index.ts +414 -0
  108. package/src/arrow/impl-flechette/message-meta.ts +174 -0
  109. package/src/arrow/index.ts +89 -0
  110. package/src/arrow/predicates.ts +56 -0
  111. package/src/arrow/types.ts +73 -0
  112. package/src/client/capabilities.ts +84 -0
  113. package/src/client/connect.ts +103 -26
  114. package/src/client/introspect.ts +60 -38
  115. package/src/client/ipc.ts +37 -27
  116. package/src/client/pipe.ts +12 -9
  117. package/src/client/stream.ts +34 -19
  118. package/src/client/uploadUrl.ts +169 -0
  119. package/src/constants.ts +18 -1
  120. package/src/crypto.ts +95 -0
  121. package/src/dispatch/describe.ts +146 -107
  122. package/src/dispatch/stream.ts +53 -24
  123. package/src/dispatch/unary.ts +5 -4
  124. package/src/errors.ts +76 -0
  125. package/src/external.ts +43 -29
  126. package/src/http/bearer.ts +2 -5
  127. package/src/http/common.ts +90 -23
  128. package/src/http/dispatch.ts +373 -46
  129. package/src/http/handler.ts +794 -68
  130. package/src/http/index.ts +1 -0
  131. package/src/http/mtls.ts +18 -3
  132. package/src/http/oauth-pkce.ts +1035 -0
  133. package/src/http/pages.ts +30 -15
  134. package/src/http/sticky.ts +429 -0
  135. package/src/http/token.ts +165 -75
  136. package/src/http/types.ts +69 -5
  137. package/src/index.ts +40 -1
  138. package/src/launcher/hash.ts +104 -0
  139. package/src/launcher/index.ts +35 -0
  140. package/src/launcher/launch.ts +284 -0
  141. package/src/launcher/lock.ts +171 -0
  142. package/src/launcher/serve-unix.ts +385 -0
  143. package/src/launcher/state.ts +245 -0
  144. package/src/otel.ts +39 -33
  145. package/src/protocol.ts +27 -3
  146. package/src/schema.ts +107 -56
  147. package/src/server.ts +196 -20
  148. package/src/types.ts +322 -18
  149. package/src/util/gzip.ts +63 -0
  150. package/src/util/schema.ts +4 -22
  151. package/src/util/web-crypto.ts +98 -0
  152. package/src/util/zstd.ts +133 -14
  153. package/src/wire/opaque.ts +37 -0
  154. package/src/wire/reader.ts +5 -4
  155. package/src/wire/request.ts +67 -8
  156. package/src/wire/response.ts +51 -85
  157. package/src/wire/writer.ts +165 -69
  158. package/dist/util/conform.d.ts +0 -18
  159. package/dist/util/conform.d.ts.map +0 -1
  160. package/src/util/conform.ts +0 -94
@@ -0,0 +1,124 @@
1
+ /** Seal a sticky-session token. Returns the base64url-encoded value for the
2
+ * `VGI-Session` header. */
3
+ export declare function sealSessionToken(serverId: string, sessionId: Uint8Array, expiresAt: number, tokenKey: Uint8Array, aad: Uint8Array, now?: number): string;
4
+ export interface OpenedSessionToken {
5
+ serverId: string;
6
+ sessionId: Uint8Array;
7
+ expiresAt: number;
8
+ }
9
+ /** Open a sticky-session token. Raises {@link SessionLostError} on any failure
10
+ * — wrong AAD (cross-principal replay) is indistinguishable from garbage. */
11
+ export declare function openSessionToken(token: string, tokenKey: Uint8Array, aad: Uint8Array): OpenedSessionToken;
12
+ /** Minimal promise-based mutex. The HTTP handler awaits `acquire()` before
13
+ * dispatching on a resumed session and calls the returned release in a
14
+ * `finally` so concurrent calls on the same session run sequentially. */
15
+ declare class AsyncMutex {
16
+ private locked;
17
+ private waiters;
18
+ acquire(): Promise<() => void>;
19
+ private release;
20
+ }
21
+ /** A live session in the per-worker registry. */
22
+ export interface SessionEntry {
23
+ state: unknown;
24
+ expiresAt: number;
25
+ principalKey: string;
26
+ lock: AsyncMutex;
27
+ }
28
+ /**
29
+ * Derive the registry partition key for a request principal.
30
+ *
31
+ * Both the dispatch path and the `DELETE /__session__` teardown path MUST
32
+ * compute this identically — otherwise a session opened on one path can't
33
+ * be looked up on the other. The NUL separator (rather than a space)
34
+ * keeps `{domain:"a", principal:"b "}` from colliding with
35
+ * `{domain:"a ", principal:"b"}`. Anonymous requests collapse to a
36
+ * single sentinel.
37
+ *
38
+ * `domain` / `principal` are the authenticated identity fields, or
39
+ * null/undefined for anonymous.
40
+ */
41
+ export declare function sessionPrincipalKey(authenticated: boolean, domain: string | null | undefined, principal: string | null | undefined): string;
42
+ /** Hex-encode a session_id Uint8Array (24-char lowercase hex). */
43
+ export declare function sessionIdHex(sessionId: Uint8Array): string;
44
+ /** Per-worker in-process map of live sticky sessions. */
45
+ export declare class SessionRegistry {
46
+ readonly defaultTtl: number;
47
+ private entries;
48
+ private _draining;
49
+ constructor(defaultTtl: number);
50
+ get draining(): boolean;
51
+ setDraining(value: boolean): void;
52
+ /** Register a session. Throws {@link ServerDrainingError} when draining. */
53
+ open(state: unknown, ttl: number | undefined, principalKey: string): {
54
+ sessionId: Uint8Array;
55
+ expiresAt: number;
56
+ };
57
+ /** Look up a session. Returns null on miss, expiry, or principal mismatch.
58
+ * Expired entries are evicted in-line (and `state.close?.()` invoked). */
59
+ get(sessionId: Uint8Array, principalKey: string): SessionEntry | null;
60
+ /** Remove a session and invoke `state.close?.()`. Returns true on hit. */
61
+ close(sessionId: Uint8Array): boolean;
62
+ /** Evict every entry past its TTL. Returns the eviction count. */
63
+ drainExpired(now?: number): number;
64
+ /** Invoke `state.close?.()` on every live session and clear the registry. */
65
+ shutdown(): void;
66
+ get size(): number;
67
+ }
68
+ /** Start a periodic reaper that evicts expired sessions. Returns a stop fn.
69
+ * Uses `setInterval().unref()` where available so the reaper does not keep
70
+ * the process alive. */
71
+ export declare function startSessionReaper(registry: SessionRegistry, tickMs?: number): () => void;
72
+ /** Per-request handle that the HTTP handler installs on the OutputCollector.
73
+ * `CallContext.openSession` / `closeSession` / `session` read and mutate
74
+ * this object; the handler then emits the resulting headers on the
75
+ * response. */
76
+ export interface StickySink {
77
+ /** True iff the request carried `VGI-Session-Accept: true`. */
78
+ acceptOpens: boolean;
79
+ /** Live session state (resumed or just-opened). Null until `openSession`
80
+ * or a successful resume populates it. */
81
+ state: unknown | null;
82
+ /** Hex session_id for the access log. Populated on resume + open;
83
+ * preserved across `closeSession` so close records still carry the id. */
84
+ sessionId: string | null;
85
+ /** Set by `openSession` so `process_response` emits `VGI-Session: <token>`. */
86
+ mintToken: string | null;
87
+ /** Set by `closeSession` so `process_response` emits `VGI-Session-Close: true`. */
88
+ closed: boolean;
89
+ /** Sticky-session lifecycle action observed during dispatch — one of
90
+ * "none" / "resume" / "open" / "close". Surfaced on the access log. */
91
+ action: "none" | "resume" | "open" | "close";
92
+ /** Bound by the handler: registers `state` in the registry, mints the
93
+ * AEAD-sealed token, and stamps `mintToken` + `sessionId`. */
94
+ _open(state: unknown, ttl: number | undefined): void;
95
+ /** Bound by the handler: removes the registry entry + invokes
96
+ * `state.close?.()`. Idempotent. */
97
+ _close(): void;
98
+ }
99
+ /** Build a `StickySink` for a request without sticky support — `_open` /
100
+ * `_close` throw the same RuntimeError shape as Python's implementation so
101
+ * call sites get a clear message. */
102
+ export declare function unavailableStickySink(): StickySink;
103
+ /** Operator-facing handle returned by `createHttpHandler` (when sticky is
104
+ * enabled) so SIGTERM hooks / worker-exit hooks can drain in-flight
105
+ * sessions cleanly. Mirrors Python's `DrainHandle`. */
106
+ export interface DrainHandle {
107
+ /** Flip the registry's drain flag — subsequent `ctx.openSession` raises
108
+ * {@link ServerDrainingError}. Existing sessions continue. */
109
+ drain(): void;
110
+ /** Invoke `state.close?.()` on every live session and clear the registry. */
111
+ shutdown(): void;
112
+ /** Return whether `drain()` has been invoked. */
113
+ isDraining(): boolean;
114
+ /** Test-only / advanced: flip the drain flag back. Production deployments
115
+ * only ever drain in one direction; conformance tests use this to clean
116
+ * up the fixture between tests. */
117
+ setDraining(value: boolean): void;
118
+ }
119
+ /** Build a {@link DrainHandle} for *registry*. `stopReaper`, when supplied,
120
+ * is invoked by `shutdown()` so the periodic reaper interval is cleared and
121
+ * the handle fully releases its resources. */
122
+ export declare function makeDrainHandle(registry: SessionRegistry, stopReaper?: () => void): DrainHandle;
123
+ export {};
124
+ //# sourceMappingURL=sticky.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../src/http/sticky.ts"],"names":[],"mappings":"AAmEA;4BAC4B;AAC5B,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,UAAU,EACpB,GAAG,EAAE,UAAU,EACf,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CAsBR;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;8EAC8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,kBAAkB,CAiC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 wire format.
2
+ * Build the AEAD associated data that binds a state token to its issuing
3
+ * principal. Anonymous and authenticated tokens produce distinct AAD
4
+ * strings, so an anonymous token cannot be opened by a named identity
5
+ * (and vice versa).
6
+ */
7
+ export declare function computeAad(principal: string | null | undefined): Uint8Array;
8
+ export declare function bytesToBase64(bytes: Uint8Array): string;
9
+ export declare function base64ToBytes(b64: string): Uint8Array;
10
+ /**
11
+ * Seal a state token with XChaCha20-Poly1305 AEAD (v4 wire format).
12
+ *
13
+ * Layout (base64-encoded):
3
14
  *
4
- * Layout:
5
- * [1B version=2]
6
- * [8B created_at uint64 LE (seconds since epoch)]
7
- * [4B state_len uint32 LE] [state_len bytes]
8
- * [4B schema_len uint32 LE] [schema_len bytes]
9
- * [4B input_schema_len uint32 LE] [input_schema_len bytes]
10
- * [32B HMAC-SHA256(signing_key, all above bytes)]
15
+ * ```
16
+ * [1B version=4]
17
+ * [24B XChaCha20-Poly1305 nonce (random)]
18
+ * [.. ciphertext + 16B Poly1305 tag]
19
+ * plaintext:
20
+ * [8B created_at uint64 LE]
21
+ * [4B state_len uint32 LE] [state_len bytes]
22
+ * [4B schema_len uint32 LE] [schema_len bytes]
23
+ * [4B input_schema_len LE] [input_schema_len bytes]
24
+ * ```
25
+ *
26
+ * `created_at` lives inside the ciphertext so TTL enforcement runs after
27
+ * authenticity. The version byte is informational (a self-describing
28
+ * format marker); a tampered version byte still fails decryption because
29
+ * we use the matching algorithm for that version. `principal` is bound
30
+ * via AEAD associated data so a token minted for one identity fails
31
+ * decryption when presented by another.
11
32
  */
12
- export declare function packStateToken(stateBytes: Uint8Array, schemaBytes: Uint8Array, inputSchemaBytes: Uint8Array, signingKey: Uint8Array, createdAt?: number): string;
33
+ export declare function packStateToken(stateBytes: Uint8Array, schemaBytes: Uint8Array, inputSchemaBytes: Uint8Array, tokenKey: Uint8Array, principal: string | null | undefined, createdAt?: number): string;
13
34
  export interface UnpackedToken {
14
35
  stateBytes: Uint8Array;
15
36
  schemaBytes: Uint8Array;
@@ -17,8 +38,13 @@ export interface UnpackedToken {
17
38
  createdAt: number;
18
39
  }
19
40
  /**
20
- * Unpack and verify a state token.
21
- * Throws on tampered, expired, or malformed tokens.
41
+ * Open and verify a state token. Decryption (which checks the Poly1305
42
+ * tag) authenticates the payload; any tampering, wrong key, or AAD
43
+ * mismatch (e.g. cross-principal replay) surfaces as a uniform
44
+ * "signature verification failed" error so callers cannot distinguish
45
+ * failure modes via timing or message content.
46
+ *
47
+ * Throws on tampered, expired, malformed, or unknown-version tokens.
22
48
  */
23
- export declare function unpackStateToken(tokenBase64: string, signingKey: Uint8Array, tokenTtl: number): UnpackedToken;
49
+ export declare function unpackStateToken(tokenBase64: string, tokenKey: Uint8Array, tokenTtl: number, principal: string | null | undefined): UnpackedToken;
24
50
  //# sourceMappingURL=token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/http/token.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,UAAU,EACvB,gBAAgB,EAAE,UAAU,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAsCR;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,gBAAgB,EAAE,UAAU,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAiE7G"}
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/http/token.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAU3E;AAMD,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAMvD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAKrD;AAiCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,UAAU,EACvB,gBAAgB,EAAE,UAAU,EAC5B,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CA8BR;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,gBAAgB,EAAE,UAAU,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,aAAa,CAuEf"}
@@ -1,20 +1,45 @@
1
- import type { ExternalLocationConfig } from "../external.js";
2
- import type { DispatchHook } from "../types.js";
1
+ import type { ExternalLocationConfig, UploadUrlProvider } from "../external.js";
2
+ import type { DispatchHook, ServeStartHook } from "../types.js";
3
3
  import type { AuthenticateFn, OAuthResourceMetadata } from "./auth.js";
4
4
  /** Configuration options for createHttpHandler(). */
5
5
  export interface HttpHandlerOptions {
6
6
  /** URL path prefix for all endpoints. Default: "" (root). */
7
7
  prefix?: string;
8
- /** HMAC-SHA256 signing key for state tokens. Random 32 bytes if omitted. */
9
- signingKey?: Uint8Array;
8
+ /** XChaCha20-Poly1305 master key (32 bytes) used to seal stream state
9
+ * tokens. A random 32-byte key is generated if omitted (tokens won't
10
+ * survive a restart or load-balance across workers). */
11
+ tokenKey?: Uint8Array;
10
12
  /** State token time-to-live in seconds. Default: 3600 (1 hour). 0 disables TTL checks. */
11
13
  tokenTtl?: number;
12
14
  /** CORS allowed origins. If set, CORS headers are added to all responses. */
13
15
  corsOrigins?: string;
16
+ /** Access-Control-Max-Age value in seconds for preflight OPTIONS responses. Default: 7200 (2 hours). null omits the header. */
17
+ corsMaxAge?: number | null;
14
18
  /** Maximum request body size in bytes. Advertised via VGI-Max-Request-Bytes header. */
15
19
  maxRequestBytes?: number;
16
- /** Maximum bytes before a producer stream emits a continuation token. */
20
+ /** Cap on the post-decompression size of a `Content-Encoding: zstd`
21
+ * request body, in bytes. Defends against zstd decompression bombs:
22
+ * a tiny compressed frame can declare a huge decompressed size and
23
+ * blow up the server before {@link maxRequestBytes} ever sees the
24
+ * payload. When omitted, defaults to `maxRequestBytes * 16` if that
25
+ * is set, otherwise unbounded. */
26
+ maxDecompressedRequestBytes?: number;
27
+ /** Maximum bytes before a producer stream emits a continuation token.
28
+ *
29
+ * @deprecated Use {@link maxResponseBytes} instead. The cap now governs all
30
+ * HTTP method responses (unary, exchange, producer), not just producer streams.
31
+ */
17
32
  maxStreamResponseBytes?: number;
33
+ /** HTTP body cap. Hard for unary and stream-exchange (overshoot surfaces
34
+ * as 200 + X-VGI-RPC-Error EXCEPTION batch). Soft for producer streams
35
+ * (overshoot mints a continuation token). Externalised payloads do not
36
+ * count toward this — they leave only tiny pointer batches on the wire.
37
+ * Advertised via VGI-Max-Response-Bytes. Undefined = unbounded. */
38
+ maxResponseBytes?: number;
39
+ /** Cap on bytes uploaded to external storage during one HTTP response.
40
+ * Always hard — externalised uploads have no escape valve. Advertised via
41
+ * VGI-Max-Externalized-Response-Bytes. Undefined = unbounded. */
42
+ maxExternalizedResponseBytes?: number;
18
43
  /** Server ID included in response metadata. Random if omitted. */
19
44
  serverId?: string;
20
45
  /** Custom state serializer for stream state objects. Default: JSON with BigInt support. */
@@ -28,18 +53,56 @@ export interface HttpHandlerOptions {
28
53
  oauthResourceMetadata?: OAuthResourceMetadata;
29
54
  /** Optional dispatch hook for observability (tracing, metrics). */
30
55
  dispatchHook?: DispatchHook;
56
+ /** Optional lifecycle hook fired once on the first dispatched request.
57
+ * Mirrors Python's on_serve_start; lazy-firing keeps it fork-safe for
58
+ * pre-fork servers. */
59
+ onServeStart?: ServeStartHook;
31
60
  /** Enable HTML landing page at GET {prefix}/. Default: true. */
32
61
  enableLandingPage?: boolean;
33
62
  /** Enable HTML describe/API reference page at GET {prefix}/describe. Default: true. */
34
63
  enableDescribePage?: boolean;
35
64
  /** Enable HTML 404 page for unmatched GET routes. Default: true. */
36
65
  enableNotFoundPage?: boolean;
66
+ /** Enable JSON health endpoint at GET {prefix}/health. Default: true. */
67
+ enableHealthEndpoint?: boolean;
37
68
  /** Protocol name shown in HTML pages. Defaults to the Protocol's name. */
38
69
  protocolName?: string;
70
+ /** Operator-supplied protocol-contract version label, surfaced on every
71
+ * access-log record so dashboards and alerts can key off contract
72
+ * changes. Mirrors the Python `RpcServer(..., protocol_version=...)`
73
+ * argument. */
74
+ protocolVersion?: string;
39
75
  /** URL to service's source repository, shown in landing/describe pages. */
40
76
  repositoryUrl?: string;
41
77
  /** External storage config for externalizing large response batches. */
42
78
  externalLocation?: ExternalLocationConfig;
79
+ /** Provider for vending pre-signed upload URLs to clients via {prefix}/__upload_url__/init. */
80
+ uploadUrlProvider?: UploadUrlProvider;
81
+ /** Optional advertised maximum upload size, surfaced via VGI-Max-Upload-Bytes. */
82
+ maxUploadBytes?: number;
83
+ /** OAuth scope for PKCE authorization requests. Default: "openid email". */
84
+ oauthPkceScope?: string;
85
+ /** Allowed return-to origins for external frontend redirects. Default: Set(["https://cupola.query-farm.services"]). */
86
+ allowedReturnOrigins?: ReadonlySet<string>;
87
+ /** Enable opt-in sticky sessions on this HTTP handler. When enabled the
88
+ * server advertises `VGI-Sticky-Enabled: true` (capability discovery),
89
+ * honours `VGI-Session` / `VGI-Session-Accept` headers, and exposes a
90
+ * `DELETE {prefix}/__session__` teardown endpoint. Default: false. */
91
+ enableSticky?: boolean;
92
+ /** Default session TTL in seconds when `ctx.openSession` is called without
93
+ * an explicit `ttl` override. Default: 300. */
94
+ stickyDefaultTtl?: number;
95
+ /** Headers the server emits as `VGI-Echo-<name>: <value>` on the
96
+ * session-opening response. A conformant client captures them and replays
97
+ * them on every subsequent request in the session — used for
98
+ * client-driven routing (e.g. `fly-force-instance-id` on Fly.io). */
99
+ stickyEchoHeaders?: Record<string, string>;
100
+ /** Internal — invoked once at handler creation with a {@link DrainHandle}
101
+ * when sticky is enabled. Conformance fixtures use this to wire up the
102
+ * test-only `/__test_drain__` admin endpoint without the library
103
+ * exposing the registry directly. Production code should hold the
104
+ * handle returned by a future `createHttpHandlerWithDrainHandle` helper. */
105
+ _onStickyHandle?: (handle: import("./sticky.js").DrainHandle) => void;
43
106
  }
44
107
  /** Serializer for stream state objects stored in state tokens. */
45
108
  export interface StateSerializer {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/http/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvE,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,C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AAE,sBAAsB,CAAC;IAC1C,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uHAAuH;IACvH,oBAAoB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE3C;;;2EAGuE;IACvE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;oDACgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;0EAGsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C;;;;iFAI6E;IAC7E,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,aAAa,EAAE,WAAW,KAAK,IAAI,CAAC;CACvE;AAED,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,UAAU,CAAC;IAClC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC;CACrC;AAED,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,EAAE,eAWjC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
+ export { AccessLogHook, type AccessLogSink, FdSink } from "./access-log.js";
1
2
  export { AuthContext } from "./auth.js";
2
3
  export * from "./client/index.js";
3
- export { DESCRIBE_METHOD_NAME, DESCRIBE_VERSION, DESCRIBE_VERSION_KEY, LOG_EXTRA_KEY, LOG_LEVEL_KEY, LOG_MESSAGE_KEY, PROTOCOL_NAME_KEY, REQUEST_ID_KEY, REQUEST_VERSION, REQUEST_VERSION_KEY, RPC_METHOD_KEY, SERVER_ID_KEY, STATE_KEY, } from "./constants.js";
4
- export { RpcError, VersionError } from "./errors.js";
4
+ export { DESCRIBE_METHOD_NAME, DESCRIBE_VERSION, DESCRIBE_VERSION_KEY, ERROR_KIND_KEY, LOG_EXTRA_KEY, LOG_LEVEL_KEY, LOG_MESSAGE_KEY, PROTOCOL_NAME_KEY, REQUEST_ID_KEY, REQUEST_VERSION, REQUEST_VERSION_KEY, RPC_ERROR_HEADER, RPC_METHOD_KEY, SERVER_ID_KEY, STATE_KEY, } from "./constants.js";
5
+ export { ERROR_KIND_METHOD_NOT_IMPLEMENTED, ERROR_KIND_SERVER_DRAINING, ERROR_KIND_SESSION_LOST, MethodNotImplementedError, RpcError, ServerDrainingError, SessionLostError, VersionError, } from "./errors.js";
5
6
  export { type ExternalLocationConfig, type ExternalStorage, httpsOnlyValidator, isExternalLocationBatch, makeExternalLocationBatch, maybeExternalizeBatch, resolveExternalLocation, } from "./external.js";
6
7
  export { ARROW_CONTENT_TYPE, type AuthenticateFn, type BearerValidateFn, bearerAuthenticate, bearerAuthenticateStatic, type CertValidateFn, chainAuthenticate, createHttpHandler, type HttpHandlerOptions, type JwtAuthenticateOptions, jsonStateSerializer, jwtAuthenticate, mtlsAuthenticate, mtlsAuthenticateFingerprint, mtlsAuthenticateSubject, mtlsAuthenticateXfcc, type OAuthResourceMetadata, oauthResourceMetadataToJson, parseXfcc, type StateSerializer, type UnpackedToken, unpackStateToken, type XfccElement, type XfccValidateFn, } from "./http/index.js";
8
+ export { acquireLock, computeHash as launcherComputeHash, defaultStateDir, type FileLockHandle, type GcResult, gcStateDir, type LaunchConfig, launch, probeSocket, type ServeUnixHandle, type ServeUnixOptions, type SocketPaths, type StatusRow, serveUnix, socketPaths, statusRows, tryAcquireLock, } from "./launcher/index.js";
7
9
  export { Protocol } from "./protocol.js";
8
- export { bool, bytes, float, float32, inferParamTypes, int, int32, type SchemaLike, str, toSchema, } from "./schema.js";
10
+ export { bool, bytes, float, float32, inferParamTypes, int, int8, int16, int32, type SchemaLike, str, toSchema, uint8, uint16, uint32, uint64, } from "./schema.js";
9
11
  export { VgiRpcServer } from "./server.js";
10
- export { type CallContext, type CallStatistics, type DispatchHook, type DispatchInfo, type ExchangeFn, type ExchangeInit, type HeaderInit, type HookToken, type LogContext, type MethodDefinition, MethodType, OutputCollector, type ProducerFn, type ProducerInit, type UnaryHandler, } from "./types.js";
12
+ export { type CallContext, type CallStatistics, type DispatchHook, type DispatchInfo, type ExchangeFn, type ExchangeInit, type HeaderInit, type HookToken, type LogContext, type MethodDefinition, MethodType, OutputCollector, type ProducerFn, type ProducerInit, type ServeStartHook, TransportKind, type UnaryHandler, } from "./types.js";
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,cAAc,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,eAAe,EACf,GAAG,EACH,KAAK,EACL,KAAK,UAAU,EACf,GAAG,EACH,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,eAAe,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,sBAAsB,EAC3B,K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