@query-farm/vgi-rpc 0.6.4 → 0.7.1

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 (177) hide show
  1. package/dist/access-log.d.ts +55 -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/auth.d.ts +5 -0
  16. package/dist/auth.d.ts.map +1 -1
  17. package/dist/client/capabilities.d.ts +25 -0
  18. package/dist/client/capabilities.d.ts.map +1 -0
  19. package/dist/client/connect.d.ts +10 -0
  20. package/dist/client/connect.d.ts.map +1 -1
  21. package/dist/client/introspect.d.ts +21 -0
  22. package/dist/client/introspect.d.ts.map +1 -1
  23. package/dist/client/ipc.d.ts +8 -2
  24. package/dist/client/ipc.d.ts.map +1 -1
  25. package/dist/client/oauth.d.ts +9 -0
  26. package/dist/client/oauth.d.ts.map +1 -1
  27. package/dist/client/pipe.d.ts +24 -0
  28. package/dist/client/pipe.d.ts.map +1 -1
  29. package/dist/client/stream.d.ts +19 -2
  30. package/dist/client/stream.d.ts.map +1 -1
  31. package/dist/client/types.d.ts +23 -0
  32. package/dist/client/types.d.ts.map +1 -1
  33. package/dist/client/uploadUrl.d.ts +25 -0
  34. package/dist/client/uploadUrl.d.ts.map +1 -0
  35. package/dist/constants.d.ts +30 -2
  36. package/dist/constants.d.ts.map +1 -1
  37. package/dist/crypto.d.ts +22 -0
  38. package/dist/crypto.d.ts.map +1 -0
  39. package/dist/dispatch/describe.d.ts +10 -6
  40. package/dist/dispatch/describe.d.ts.map +1 -1
  41. package/dist/dispatch/stream.d.ts +2 -2
  42. package/dist/dispatch/stream.d.ts.map +1 -1
  43. package/dist/dispatch/unary.d.ts +2 -2
  44. package/dist/dispatch/unary.d.ts.map +1 -1
  45. package/dist/errors.d.ts +64 -1
  46. package/dist/errors.d.ts.map +1 -1
  47. package/dist/external.d.ts +27 -5
  48. package/dist/external.d.ts.map +1 -1
  49. package/dist/http/auth.d.ts +13 -0
  50. package/dist/http/auth.d.ts.map +1 -1
  51. package/dist/http/bearer.d.ts.map +1 -1
  52. package/dist/http/common.d.ts +43 -7
  53. package/dist/http/common.d.ts.map +1 -1
  54. package/dist/http/dispatch.d.ts +20 -2
  55. package/dist/http/dispatch.d.ts.map +1 -1
  56. package/dist/http/handler.d.ts.map +1 -1
  57. package/dist/http/index.d.ts +1 -0
  58. package/dist/http/index.d.ts.map +1 -1
  59. package/dist/http/jwt.d.ts +1 -0
  60. package/dist/http/jwt.d.ts.map +1 -1
  61. package/dist/http/mtls.d.ts +9 -1
  62. package/dist/http/mtls.d.ts.map +1 -1
  63. package/dist/http/oauth-pkce.d.ts +141 -0
  64. package/dist/http/oauth-pkce.d.ts.map +1 -0
  65. package/dist/http/pages.d.ts +3 -0
  66. package/dist/http/pages.d.ts.map +1 -1
  67. package/dist/http/sticky.d.ts +124 -0
  68. package/dist/http/sticky.d.ts.map +1 -0
  69. package/dist/http/token.d.ts +43 -12
  70. package/dist/http/token.d.ts.map +1 -1
  71. package/dist/http/types.d.ts +68 -5
  72. package/dist/http/types.d.ts.map +1 -1
  73. package/dist/index.d.ts +6 -4
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1275 -3511
  76. package/dist/index.js.map +20 -38
  77. package/dist/launcher/hash.d.ts +22 -0
  78. package/dist/launcher/hash.d.ts.map +1 -0
  79. package/dist/launcher/index.d.ts +23 -0
  80. package/dist/launcher/index.d.ts.map +1 -0
  81. package/dist/launcher/launch.d.ts +27 -0
  82. package/dist/launcher/launch.d.ts.map +1 -0
  83. package/dist/launcher/lock.d.ts +19 -0
  84. package/dist/launcher/lock.d.ts.map +1 -0
  85. package/dist/launcher/serve-unix.d.ts +55 -0
  86. package/dist/launcher/serve-unix.d.ts.map +1 -0
  87. package/dist/launcher/state.d.ts +71 -0
  88. package/dist/launcher/state.d.ts.map +1 -0
  89. package/dist/otel.d.ts.map +1 -1
  90. package/dist/protocol.d.ts +19 -2
  91. package/dist/protocol.d.ts.map +1 -1
  92. package/dist/schema.d.ts +45 -18
  93. package/dist/schema.d.ts.map +1 -1
  94. package/dist/server.d.ts +23 -2
  95. package/dist/server.d.ts.map +1 -1
  96. package/dist/types.d.ts +270 -12
  97. package/dist/types.d.ts.map +1 -1
  98. package/dist/util/gzip.d.ts +10 -0
  99. package/dist/util/gzip.d.ts.map +1 -0
  100. package/dist/util/schema.d.ts +3 -15
  101. package/dist/util/schema.d.ts.map +1 -1
  102. package/dist/util/web-crypto.d.ts +22 -0
  103. package/dist/util/web-crypto.d.ts.map +1 -0
  104. package/dist/util/zstd.d.ts +26 -3
  105. package/dist/util/zstd.d.ts.map +1 -1
  106. package/dist/wire/opaque.d.ts +11 -0
  107. package/dist/wire/opaque.d.ts.map +1 -0
  108. package/dist/wire/reader.d.ts +5 -5
  109. package/dist/wire/reader.d.ts.map +1 -1
  110. package/dist/wire/request.d.ts +11 -3
  111. package/dist/wire/request.d.ts.map +1 -1
  112. package/dist/wire/response.d.ts +6 -6
  113. package/dist/wire/response.d.ts.map +1 -1
  114. package/dist/wire/writer.d.ts +49 -39
  115. package/dist/wire/writer.d.ts.map +1 -1
  116. package/package.json +35 -21
  117. package/src/access-log.ts +200 -0
  118. package/src/arrow/impl-arrowjs/index.ts +433 -0
  119. package/src/arrow/impl-flechette/index.ts +414 -0
  120. package/src/arrow/impl-flechette/message-meta.ts +174 -0
  121. package/src/arrow/index.ts +89 -0
  122. package/src/arrow/predicates.ts +56 -0
  123. package/src/arrow/types.ts +73 -0
  124. package/src/auth.ts +5 -0
  125. package/src/client/capabilities.ts +84 -0
  126. package/src/client/connect.ts +113 -26
  127. package/src/client/introspect.ts +74 -38
  128. package/src/client/ipc.ts +37 -27
  129. package/src/client/oauth.ts +9 -0
  130. package/src/client/pipe.ts +36 -9
  131. package/src/client/stream.ts +43 -20
  132. package/src/client/types.ts +23 -0
  133. package/src/client/uploadUrl.ts +169 -0
  134. package/src/constants.ts +34 -2
  135. package/src/crypto.ts +95 -0
  136. package/src/dispatch/describe.ts +146 -107
  137. package/src/dispatch/stream.ts +53 -24
  138. package/src/dispatch/unary.ts +5 -4
  139. package/src/errors.ts +87 -0
  140. package/src/external.ts +49 -30
  141. package/src/http/auth.ts +13 -0
  142. package/src/http/bearer.ts +2 -5
  143. package/src/http/common.ts +91 -23
  144. package/src/http/dispatch.ts +373 -46
  145. package/src/http/handler.ts +790 -68
  146. package/src/http/index.ts +1 -0
  147. package/src/http/jwt.ts +1 -0
  148. package/src/http/mtls.ts +25 -3
  149. package/src/http/oauth-pkce.ts +1035 -0
  150. package/src/http/pages.ts +30 -15
  151. package/src/http/sticky.ts +429 -0
  152. package/src/http/token.ts +170 -75
  153. package/src/http/types.ts +69 -5
  154. package/src/index.ts +40 -1
  155. package/src/launcher/hash.ts +104 -0
  156. package/src/launcher/index.ts +35 -0
  157. package/src/launcher/launch.ts +284 -0
  158. package/src/launcher/lock.ts +171 -0
  159. package/src/launcher/serve-unix.ts +386 -0
  160. package/src/launcher/state.ts +257 -0
  161. package/src/otel.ts +39 -33
  162. package/src/protocol.ts +30 -3
  163. package/src/schema.ts +107 -56
  164. package/src/server.ts +196 -20
  165. package/src/types.ts +376 -18
  166. package/src/util/gzip.ts +63 -0
  167. package/src/util/schema.ts +4 -22
  168. package/src/util/web-crypto.ts +98 -0
  169. package/src/util/zstd.ts +133 -14
  170. package/src/wire/opaque.ts +37 -0
  171. package/src/wire/reader.ts +5 -4
  172. package/src/wire/request.ts +67 -8
  173. package/src/wire/response.ts +51 -85
  174. package/src/wire/writer.ts +165 -69
  175. package/dist/util/conform.d.ts +0 -18
  176. package/dist/util/conform.d.ts.map +0 -1
  177. package/src/util/conform.ts +0 -94
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Cross-language conformance access-log hook.
3
+ *
4
+ * Emits one JSON record per RPC dispatch to a {@link Sink} (typically a file
5
+ * descriptor opened in append mode). The record shape conforms to the
6
+ * vgi-rpc access-log specification (`docs/access-log-spec.md` and
7
+ * `vgi_rpc/access_log.schema.json` in the Python reference repo).
8
+ *
9
+ * Use {@link AccessLogHook} to align this implementation with `vgi-rpc-test
10
+ * --access-log` so worker behaviour is checked across language ports by the
11
+ * same tool that gates the conformance suite.
12
+ */
13
+ import type { CallStatistics, DispatchHook, DispatchInfo, HookToken } from "./types.js";
14
+ /** Where the hook writes formatted JSON lines. */
15
+ export interface AccessLogSink {
16
+ /** Write one access-log line. The trailing newline is included by the caller. */
17
+ write(line: string): void;
18
+ }
19
+ /** A sink backed by a file descriptor; uses synchronous writes for ordering. */
20
+ export declare class FdSink implements AccessLogSink {
21
+ private readonly fd;
22
+ private readonly _writeSync;
23
+ constructor(fd: number);
24
+ /** Write `line` to the file descriptor, looping until the buffer is fully flushed. */
25
+ write(line: string): void;
26
+ }
27
+ /**
28
+ * Options for {@link AccessLogHook}.
29
+ *
30
+ * `level` matches Python's logger-level gating in `_emit_access_log`:
31
+ * at "INFO" the heavy `request_data` field (a base64 of the full
32
+ * request batch — typically 8+ KiB per init RPC) is replaced with a
33
+ * `truncated: true` marker plus `original_request_bytes`, so the
34
+ * access-log schema's "unary requires request_data unless truncated"
35
+ * invariant still holds. Bump to "DEBUG" to capture full payloads for
36
+ * replay/audit.
37
+ */
38
+ export interface AccessLogOptions {
39
+ /** Server version string (optional). */
40
+ serverVersion?: string;
41
+ /** Verbosity for heavy fields. Default: "INFO". */
42
+ level?: "INFO" | "DEBUG";
43
+ }
44
+ export declare class AccessLogHook implements DispatchHook {
45
+ private readonly sink;
46
+ private readonly serverVersion;
47
+ private readonly level;
48
+ constructor(sink: AccessLogSink, options?: AccessLogOptions | string);
49
+ /** Capture a high-resolution start timestamp; returned token feeds {@link onDispatchEnd}. */
50
+ onDispatchStart(_info: DispatchInfo): HookToken;
51
+ /** Emit one access-log JSON record for the completed dispatch (best-effort;
52
+ * write errors are swallowed so logging never breaks a request). */
53
+ onDispatchEnd(token: HookToken, info: DispatchInfo, stats: CallStatistics, error?: Error): void;
54
+ }
55
+ //# sourceMappingURL=access-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-log.d.ts","sourceRoot":"","sources":["../src/access-log.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAExF,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAgBD,gFAAgF;AAChF,qBAAa,MAAO,YAAW,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,EAAE;IAD/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAClB,EAAE,EAAE,MAAM;IACvC,sFAAsF;IACtF,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAS1B;AA2BD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,qBAAa,aAAc,YAAW,YAAY;IAK9C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;gBAGtB,IAAI,EAAE,aAAa,EACpC,OAAO,GAAE,gBAAgB,GAAG,MAAW;IAazC,6FAA6F;IAC7F,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAK/C;yEACqE;IACrE,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;CA2EhG"}
@@ -0,0 +1,96 @@
1
+ import type { IncrementalEncoder, VgiBackendInfo, VgiBatch, VgiColumnData, VgiDataType, VgiField, VgiSchema } from "../types.js";
2
+ export declare const backend: VgiBackendInfo;
3
+ export declare const nullType: () => VgiDataType;
4
+ export declare const bool: () => VgiDataType;
5
+ export declare const int8: () => VgiDataType;
6
+ export declare const int16: () => VgiDataType;
7
+ export declare const int32: () => VgiDataType;
8
+ export declare const int64: () => VgiDataType;
9
+ export declare const uint8: () => VgiDataType;
10
+ export declare const uint16: () => VgiDataType;
11
+ export declare const uint32: () => VgiDataType;
12
+ export declare const uint64: () => VgiDataType;
13
+ export declare const float32: () => VgiDataType;
14
+ export declare const float64: () => VgiDataType;
15
+ export declare const utf8: () => VgiDataType;
16
+ export declare const binary: () => VgiDataType;
17
+ /** Microsecond Timestamp with optional timezone. */
18
+ export declare const timestampMicro: (timezone?: string | null) => VgiDataType;
19
+ /** Date32 with day resolution. */
20
+ export declare const dateDay: () => VgiDataType;
21
+ /** Time64 with microsecond resolution. */
22
+ export declare const timeMicro: () => VgiDataType;
23
+ /** Duration with microsecond resolution. */
24
+ export declare const durationMicro: () => VgiDataType;
25
+ /** Decimal128 by default; pass bitWidth=256 for Decimal256. */
26
+ export declare const decimal: (precision: number, scale: number, bitWidth?: 128 | 256) => VgiDataType;
27
+ /** FixedSizeBinary with the given byte width. */
28
+ export declare const fixedSizeBinary: (byteWidth: number) => VgiDataType;
29
+ /** LargeUtf8 — 64-bit-offset UTF-8 string. */
30
+ export declare const largeUtf8: () => VgiDataType;
31
+ /** LargeBinary — 64-bit-offset binary blob. */
32
+ export declare const largeBinary: () => VgiDataType;
33
+ /** List of `child` items. The child field carries name + nullability + type. */
34
+ export declare const list: (child: VgiField) => VgiDataType;
35
+ /** Struct of `fields`. */
36
+ export declare const struct: (fields: readonly VgiField[]) => VgiDataType;
37
+ /** Map (key → value) carried as a List<Struct<key,value>>. arrow-js's Map_
38
+ * constructor takes a child Field whose type is a Struct of [key, value]. */
39
+ export declare const map: (keyField: VgiField, valueField: VgiField, keysSorted?: boolean) => VgiDataType;
40
+ /** Dictionary-encoded type. `indices` must be an integer type.
41
+ *
42
+ * `id` is left undefined by default so arrow-js's internal `getId()`
43
+ * counter assigns a fresh unique id per Dictionary instance. Passing
44
+ * `-1` (or any concrete number) here would short-circuit that counter
45
+ * and produce id collisions when multiple Dictionary types are used. */
46
+ export declare const dictionary: (indices: VgiDataType, values: VgiDataType, id?: number, ordered?: boolean) => VgiDataType;
47
+ export declare function field(name: string, type: VgiDataType, nullable?: boolean, metadata?: Map<string, string>): VgiField;
48
+ export declare function schema(fields: readonly VgiField[], metadata?: Map<string, string>): VgiSchema;
49
+ export declare function serializeSchema(s: VgiSchema): Uint8Array;
50
+ export declare function deserializeSchema(bytes: Uint8Array): VgiSchema;
51
+ export declare function serializeBatch(batch: VgiBatch): Uint8Array;
52
+ /**
53
+ * Incremental IPC encoder over arrow-js's `RecordBatchStreamWriter`. Each
54
+ * call drains the writer's internal sink queue and returns the new bytes,
55
+ * so the caller can flush them synchronously between lockstep turns.
56
+ *
57
+ * `_writeRecordBatch` is called directly (rather than the public `write`)
58
+ * to bypass arrow-js's schema comparison, which would auto-close the
59
+ * writer and silently drop a batch whose schema differs only in
60
+ * nullability — our output schema is fixed at open time and all batches
61
+ * are structurally compatible.
62
+ */
63
+ export declare function createIncrementalEncoder(s: VgiSchema): IncrementalEncoder;
64
+ export declare function deserializeBatch(bytes: Uint8Array): VgiBatch;
65
+ export declare function columnFromArray(values: any[], type: VgiDataType): VgiColumnData;
66
+ /** Build a 1-row batch from {colName: value} dict (Int64 numbers auto-coerced). */
67
+ export declare function singleRowBatch(s: VgiSchema, values: Record<string, any>): VgiBatch;
68
+ /** Build an N-row batch from columnar arrays. */
69
+ export declare function batchFromColumns(s: VgiSchema, columns: Record<string, any[]>): VgiBatch;
70
+ /** Build a batch from pre-built column-data handles + schema. */
71
+ export declare function batchFromColumnData(s: VgiSchema, numRows: number, columnData: VgiColumnData[], metadata?: Map<string, string>): VgiBatch;
72
+ /** Empty-Data builder used when assembling batches with pre-built children. */
73
+ export declare function emptyColumnData(type: VgiDataType): VgiColumnData;
74
+ /**
75
+ * 0-row batch with optional batch-level metadata (used for log/error/empty
76
+ * tombstone batches by the wire layer).
77
+ */
78
+ export declare function emptyBatchWithMetadata(s: VgiSchema, metadata?: Map<string, string>): VgiBatch;
79
+ /** 1-row result batch: vectorFromArray each value, support raw Data
80
+ * passthrough (for Map/opaque types whose .get(0) is unreliable). */
81
+ export declare function singleRowBatchWithMetadata(s: VgiSchema, values: Record<string, any>, metadata?: Map<string, string>): VgiBatch;
82
+ /** Tag a value as a raw Data passthrough. arrow-js: returns true if the
83
+ * value is an arrow-js Data instance. flechette: always false (the
84
+ * flechette backend doesn't surface this opaque-type quirk). */
85
+ export declare function isOpaqueData(val: unknown): boolean;
86
+ /** Re-emit a batch with a different metadata map (same schema + data). */
87
+ export declare function withBatchMetadata(batch: VgiBatch, metadata: Map<string, string>): VgiBatch;
88
+ /**
89
+ * Serialize a sequence of batches into a single multi-batch IPC stream.
90
+ * arrow-js's `RecordBatchStreamWriter` writes schema + N batches + EOS
91
+ * incrementally — exactly what consumers expect for a producer/exchange
92
+ * response that emits more than one batch.
93
+ */
94
+ export declare function serializeBatches(schema: VgiSchema, batches: VgiBatch[]): Uint8Array;
95
+ export declare function conformBatchToSchema(batch: VgiBatch, schema: VgiSchema): VgiBatch;
96
+ //# sourceMappingURL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AE,MAAM,CAAC,GAAG,QAAQ,CAG1F;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,UAAU,CAQnF;AAmBD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,QAAQ,CA6CjF"}
@@ -0,0 +1,102 @@
1
+ import type { IncrementalEncoder, VgiBackendInfo, VgiBatch, VgiColumnData, VgiDataType, VgiField, VgiSchema } from "../types.js";
2
+ export declare const backend: VgiBackendInfo;
3
+ export declare const nullType: () => VgiDataType;
4
+ export declare const bool: () => VgiDataType;
5
+ export declare const int8: () => VgiDataType;
6
+ export declare const int16: () => VgiDataType;
7
+ export declare const int32: () => VgiDataType;
8
+ export declare const int64: () => VgiDataType;
9
+ export declare const uint8: () => VgiDataType;
10
+ export declare const uint16: () => VgiDataType;
11
+ export declare const uint32: () => VgiDataType;
12
+ export declare const uint64: () => VgiDataType;
13
+ export declare const float32: () => VgiDataType;
14
+ export declare const float64: () => VgiDataType;
15
+ export declare const utf8: () => VgiDataType;
16
+ export declare const binary: () => VgiDataType;
17
+ /** Microsecond Timestamp with optional timezone. */
18
+ export declare const timestampMicro: (timezone?: string | null) => VgiDataType;
19
+ /** Date32 with day resolution. */
20
+ export declare const dateDay: () => VgiDataType;
21
+ /** Time64 with microsecond resolution. */
22
+ export declare const timeMicro: () => VgiDataType;
23
+ /** Duration with microsecond resolution. */
24
+ export declare const durationMicro: () => VgiDataType;
25
+ /** Decimal128 by default; pass bitWidth=256 for Decimal256. */
26
+ export declare const decimal: (precision: number, scale: number, bitWidth?: 128 | 256) => VgiDataType;
27
+ /** FixedSizeBinary with the given byte width. */
28
+ export declare const fixedSizeBinary: (byteWidth: number) => VgiDataType;
29
+ /** LargeUtf8 — 64-bit-offset UTF-8 string. */
30
+ export declare const largeUtf8: () => VgiDataType;
31
+ /** LargeBinary — 64-bit-offset binary blob. */
32
+ export declare const largeBinary: () => VgiDataType;
33
+ /** List of `child` items. */
34
+ export declare const list: (child: VgiField) => VgiDataType;
35
+ /** Struct of `fields`. */
36
+ export declare const struct: (fields: readonly VgiField[]) => VgiDataType;
37
+ /** Map (key → value). flechette's `map(keyField, valueField, keysSorted)`
38
+ * builds the entries Struct internally — same shape as arrow-js's Map_
39
+ * but a less verbose API. */
40
+ export declare const map: (keyField: VgiField, valueField: VgiField, keysSorted?: boolean) => VgiDataType;
41
+ /** Dictionary-encoded type. `indices` must be an integer type. */
42
+ export declare const dictionary: (indices: VgiDataType, values: VgiDataType, id?: number, ordered?: boolean) => VgiDataType;
43
+ export declare function field(name: string, type: VgiDataType, nullable?: boolean, metadata?: Map<string, string>): VgiField;
44
+ export declare function schema(fields: readonly VgiField[], metadata?: Map<string, string>): VgiSchema;
45
+ export declare function serializeSchema(s: VgiSchema): Uint8Array;
46
+ export declare function deserializeSchema(bytes: Uint8Array): VgiSchema;
47
+ export declare function serializeBatch(batch: VgiBatch): Uint8Array;
48
+ export declare function deserializeBatch(bytes: Uint8Array): VgiBatch;
49
+ export declare function columnFromArray(values: any[], type: VgiDataType): VgiColumnData;
50
+ export declare function singleRowBatch(s: VgiSchema, values: Record<string, any>): VgiBatch;
51
+ export declare function batchFromColumns(s: VgiSchema, columns: Record<string, any[]>): VgiBatch;
52
+ export declare function batchFromColumnData(s: VgiSchema, _numRows: number, columnData: VgiColumnData[], _metadata?: Map<string, string>): VgiBatch;
53
+ export declare function emptyColumnData(type: VgiDataType): VgiColumnData;
54
+ /**
55
+ * 0-row batch carrying per-record-batch (NOT schema) custom metadata.
56
+ *
57
+ * The vgi-rpc wire protocol puts per-call metadata (`vgi_rpc.log_level`,
58
+ * `vgi_rpc.server_id`, `vgi_rpc.request_id`, etc.) on the RecordBatch
59
+ * message — not on the Schema message. We stash it on the Table via
60
+ * `_vgiRecordMetadata`; our patched `tablesToIPC` picks it up and emits
61
+ * it as the Message FlatBuffer's `custom_metadata` field.
62
+ */
63
+ export declare function emptyBatchWithMetadata(s: VgiSchema, metadata?: Map<string, string>): VgiBatch;
64
+ /** 1-row result batch with optional per-record-batch metadata. */
65
+ export declare function singleRowBatchWithMetadata(s: VgiSchema, values: Record<string, any>, metadata?: Map<string, string>): VgiBatch;
66
+ /** flechette has no Data passthrough concept (no opaque-type quirk). */
67
+ export declare function isOpaqueData(_val: unknown): boolean;
68
+ /** Re-emit a batch with a different per-record-batch metadata map (same
69
+ * schema + data). Shallow-clones the Table so the caller's reference is
70
+ * not mutated. */
71
+ export declare function withBatchMetadata(batch: VgiBatch, metadata: Map<string, string>): VgiBatch;
72
+ /**
73
+ * Serialize a sequence of batches into a single multi-batch IPC stream.
74
+ * Uses our flechette fork's `tablesToIPC` (added in
75
+ * github:Query-farm/flechette#fix/timestamp-bigint-encode) to do the
76
+ * concat-then-encode atomically — naive concatenation of multiple
77
+ * `tableToIPC` outputs produces multiple EOS markers, dropping batches
78
+ * past the first.
79
+ */
80
+ export declare function serializeBatches(_schema: VgiSchema, batches: VgiBatch[]): Uint8Array;
81
+ /**
82
+ * Rebuild a batch's columns to match a target schema's field types.
83
+ *
84
+ * flechette's IPC reader produces specific types upfront (no Int_/Float_
85
+ * generic-type quirk that arrow-js exhibits), but a cast-compatible client
86
+ * can still send e.g. int64 where the method declares float64. Mirror the
87
+ * arrow-js backend: materialize+rebuild numeric columns whose type differs
88
+ * from the expected field type. Non-numeric mismatches (and matching types)
89
+ * keep their existing column. Field-name / field-count mismatches surface as
90
+ * TypeErrors so the dispatch layer can convert them to RpcError.
91
+ */
92
+ export declare function conformBatchToSchema(batch: VgiBatch, schema: VgiSchema): VgiBatch;
93
+ /**
94
+ * Not supported on flechette: the lockstep stdio exchange protocol needs an
95
+ * incremental IPC writer (emit each batch's framing bytes before reading
96
+ * the next input), and flechette only exposes a one-shot table encoder.
97
+ * The flechette backend is selected for workerd / browser / worker, which
98
+ * are HTTP-only (no stdio), so this factory is never reached there. The
99
+ * stdio server requires the arrow-js backend.
100
+ */
101
+ export declare function createIncrementalEncoder(_s: VgiSchema): IncrementalEncoder;
102
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/arrow/impl-flechette/index.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,EACV,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,OAAO,EAAE,cAAgE,CAAC;AAWvF,eAAO,MAAM,QAAQ,QAAO,WAAqD,CAAC;AAClF,eAAO,MAAM,IAAI,QAAO,WAAiD,CAAC;AAC1E,eAAO,MAAM,IAAI,QAAO,WAAiD,CAAC;AAC1E,eAAO,MAAM,KAAK,QAAO,WAAkD,CAAC;AAC5E,eAAO,MAAM,KAAK,QAAO,WAAkD,CAAC;AAC5E,eAAO,MAAM,KAAK,QAAO,WAAkD,CAAC;AAC5E,eAAO,MAAM,KAAK,QAAO,WAAkD,CAAC;AAC5E,eAAO,MAAM,MAAM,QAAO,WAAmD,CAAC;AAC9E,eAAO,MAAM,MAAM,QAAO,WAAmD,CAAC;AAC9E,eAAO,MAAM,MAAM,QAAO,WAAmD,CAAC;AAC9E,eAAO,MAAM,OAAO,QAAO,WAAoD,CAAC;AAChF,eAAO,MAAM,OAAO,QAAO,WAAoD,CAAC;AAChF,eAAO,MAAM,IAAI,QAAO,WAAiD,CAAC;AAC1E,eAAO,MAAM,MAAM,QAAO,WAAmD,CAAC;AAE9E,oDAAoD;AACpD,eAAO,MAAM,cAAc,GAAI,WAAU,MAAM,GAAG,IAAW,KAAG,WACS,CAAC;AAE1E,kCAAkC;AAClC,eAAO,MAAM,OAAO,QAAO,WAAoD,CAAC;AAChF,0CAA0C;AAC1C,eAAO,MAAM,SAAS,QAAO,WAA4D,CAAC;AAC1F,4CAA4C;AAC5C,eAAO,MAAM,aAAa,QAAO,WAA2E,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,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,UAAU,CAMpF;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,QAAQ,CAkCjF;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,SAAS,GAAG,kBAAkB,CAM1E"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Walk an Arrow IPC stream and return the first RecordBatch message's
3
+ * (numRows, metadata) — the bits flechette drops on the floor.
4
+ *
5
+ * Returns null if the stream contains no RecordBatch.
6
+ */
7
+ export declare function readFirstRecordBatchMeta(stream: Uint8Array): {
8
+ numRows: number;
9
+ metadata: Map<string, string>;
10
+ } | null;
11
+ //# sourceMappingURL=message-meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-meta.d.ts","sourceRoot":"","sources":["../../../src/arrow/impl-flechette/message-meta.ts"],"names":[],"mappings":"AA0IA;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,GACjB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,CA2B3D"}
@@ -0,0 +1,4 @@
1
+ export { backend, batchFromColumnData, batchFromColumns, binary, bool, columnFromArray, conformBatchToSchema, createIncrementalEncoder, dateDay, decimal, deserializeBatch, deserializeSchema, dictionary, durationMicro, emptyBatchWithMetadata, emptyColumnData, field, fixedSizeBinary, float32, float64, int8, int16, int32, int64, isOpaqueData, largeBinary, largeUtf8, list, map, nullType, schema, serializeBatch, serializeBatches, serializeSchema, singleRowBatch, singleRowBatchWithMetadata, struct, timeMicro, timestampMicro, uint8, uint16, uint32, uint64, utf8, withBatchMetadata, } from "#vgi-rpc-arrow";
2
+ export { isBatch, isBinary, isBool, isDate, isDecimal, isDictionary, isDuration, isFixedSizeBinary, isFloat, isInt, isLargeBinary, isLargeUtf8, isList, isMap, isNull, isStruct, isTime, isTimestamp, isUtf8, TypeId, } from "./predicates.js";
3
+ export type { IncrementalEncoder, VgiBackendInfo, VgiBatch, VgiColumn, VgiColumnData, VgiDataType, VgiField, VgiSchema, VgiTypeId, } from "./types.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/arrow/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,EACN,IAAI,EAEJ,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,KAAK,EACL,eAAe,EACf,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,WAAW,EACX,SAAS,EACT,IAAI,EACJ,GAAG,EAEH,QAAQ,EACR,MAAM,EACN,cAAc,EACd,gBAAgB,EAEhB,eAAe,EACf,cAAc,EACd,0BAA0B,EAC1B,MAAM,EACN,SAAS,EACT,cAAc,EACd,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,IAAI,EACJ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAW,EACX,MAAM,EACN,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,MAAM,EACN,MAAM,GACP,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,GACV,MAAM,YAAY,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { VgiDataType } from "./types.js";
2
+ export declare const TypeId: {
3
+ readonly Null: 1;
4
+ readonly Int: 2;
5
+ readonly Float: 3;
6
+ readonly Binary: 4;
7
+ readonly Utf8: 5;
8
+ readonly Bool: 6;
9
+ readonly Decimal: 7;
10
+ readonly Date: 8;
11
+ readonly Time: 9;
12
+ readonly Timestamp: 10;
13
+ readonly Interval: 11;
14
+ readonly List: 12;
15
+ readonly Struct: 13;
16
+ readonly Union: 14;
17
+ readonly FixedSizeBinary: 15;
18
+ readonly FixedSizeList: 16;
19
+ readonly Map: 17;
20
+ readonly Duration: 18;
21
+ readonly LargeBinary: 19;
22
+ readonly LargeUtf8: 20;
23
+ readonly Dictionary: -1;
24
+ };
25
+ export declare const isNull: (t: VgiDataType) => boolean;
26
+ export declare const isInt: (t: VgiDataType) => boolean;
27
+ export declare const isFloat: (t: VgiDataType) => boolean;
28
+ export declare const isBinary: (t: VgiDataType) => boolean;
29
+ export declare const isUtf8: (t: VgiDataType) => boolean;
30
+ export declare const isLargeUtf8: (t: VgiDataType) => boolean;
31
+ export declare const isLargeBinary: (t: VgiDataType) => boolean;
32
+ export declare const isBool: (t: VgiDataType) => boolean;
33
+ export declare const isDecimal: (t: VgiDataType) => boolean;
34
+ export declare const isDate: (t: VgiDataType) => boolean;
35
+ export declare const isTime: (t: VgiDataType) => boolean;
36
+ export declare const isTimestamp: (t: VgiDataType) => boolean;
37
+ export declare const isDuration: (t: VgiDataType) => boolean;
38
+ export declare const isList: (t: VgiDataType) => boolean;
39
+ export declare const isStruct: (t: VgiDataType) => boolean;
40
+ export declare const isMap: (t: VgiDataType) => boolean;
41
+ export declare const isFixedSizeBinary: (t: VgiDataType) => boolean;
42
+ export declare const isDictionary: (t: VgiDataType) => boolean;
43
+ export declare function isBatch(x: unknown): x is import("./types.js").Vgi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AkC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,GAAI,GAAG,WAAW,KAAG,OAA8C,CAAC;AAClG,eAAO,MAAM,YAAY,GAAI,GAAG,WAAW,KAAG,OAAyC,CAAC;AAExF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,OAAO,YAAY,EAAE,QAAQ,CAOtE"}
@@ -0,0 +1,62 @@
1
+ export type VgiTypeId = number;
2
+ export interface VgiDataType {
3
+ readonly typeId: VgiTypeId;
4
+ }
5
+ export interface VgiField {
6
+ readonly name: string;
7
+ readonly type: VgiDataType;
8
+ readonly nullable: boolean;
9
+ readonly metadata: Map<string, string>;
10
+ }
11
+ export interface VgiSchema {
12
+ readonly fields: readonly VgiField[];
13
+ readonly metadata: Map<string, string>;
14
+ }
15
+ export interface VgiColumn {
16
+ readonly type: VgiDataType;
17
+ readonly length: number;
18
+ get(index: number): unknown;
19
+ [Symbol.iterator](): Iterator<unknown>;
20
+ }
21
+ export interface VgiBatch {
22
+ readonly schema: VgiSchema;
23
+ readonly numRows: number;
24
+ readonly metadata?: Map<string, string> | null;
25
+ getChild(name: string): VgiColumn | null;
26
+ getChildAt(index: number): VgiColumn | null;
27
+ }
28
+ export interface VgiBackendInfo {
29
+ readonly name: "arrow-js" | "flechette";
30
+ /**
31
+ * Whether this backend's `.get(0)` round-trip is unreliable for opaque
32
+ * column types (Map/Date/Time/Timestamp/Duration/Decimal/LargeUtf8/
33
+ * LargeBinary/FixedSizeBinary/Dictionary), requiring the request parser to
34
+ * pass the raw column data straight through instead of materializing a
35
+ * value. True for arrow-js; false for flechette (which extracts cleanly).
36
+ */
37
+ readonly opaquePassthrough: boolean;
38
+ }
39
+ export type VgiColumnData = unknown;
40
+ /**
41
+ * Incremental IPC stream encoder for the lockstep stdio transport.
42
+ *
43
+ * The stdio exchange protocol is lockstep — the client reads each response
44
+ * batch (and its framing bytes) before sending the next input — so we
45
+ * cannot buffer-then-emit at close. Each call returns the wire bytes to
46
+ * flush immediately. Only the stdio server uses this; HTTP serializes
47
+ * whole responses via {@link serializeBatches}.
48
+ *
49
+ * The arrow-js backend implements this over `RecordBatchStreamWriter`.
50
+ * The flechette backend has no incremental-writer surface and its
51
+ * factory throws — keeping arrow-js out of the flechette (workerd/
52
+ * browser) bundle, which is HTTP-only anyway.
53
+ */
54
+ export interface IncrementalEncoder {
55
+ /** Bytes for the schema preamble (continuation + schema message). */
56
+ start(): Uint8Array;
57
+ /** Bytes for one record batch message. */
58
+ writeBatch(batch: VgiBatch): Uint8Array;
59
+ /** Bytes for the end-of-stream marker. */
60
+ finish(): Uint8Array;
61
+ }
62
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/arrow/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACzC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,CAAC;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;AAEpC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,KAAK,IAAI,UAAU,CAAC;IACpB,0CAA0C;IAC1C,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,CAAC;IACxC,0CAA0C;IAC1C,MAAM,IAAI,UAAU,CAAC;CACtB"}
package/dist/auth.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  /** Authentication context available to RPC handlers. */
2
2
  export declare class AuthContext {
3
+ /** Authentication domain/realm that vouched for the principal; empty string
4
+ * when anonymous. */
3
5
  readonly domain: string;
6
+ /** True when the request carried valid credentials. */
4
7
  readonly authenticated: boolean;
8
+ /** Authenticated principal identifier, or `null` when anonymous. */
5
9
  readonly principal: string | null;
10
+ /** Arbitrary verified claims about the principal (e.g. decoded JWT claims). */
6
11
  readonly claims: Record<string, any>;
7
12
  constructor(domain: string, authenticated: boolean, principal: string | null, claims?: Record<string, any>);
8
13
  /** Create an unauthenticated (anonymous) context. */
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAKA,wDAAwD;AACxD,qBAAa,WAAW;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAEzB,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM;IAO9G,qDAAqD;IACrD,MAAM,CAAC,SAAS,IAAI,WAAW;IAI/B,8DAA8D;IAC9D,oBAAoB,IAAI,IAAI;CAK7B"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAKA,wDAAwD;AACxD,qBAAa,WAAW;IACtB;0BACsB;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAEzB,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM;IAO9G,qDAAqD;IACrD,MAAM,CAAC,SAAS,IAAI,WAAW;IAI/B,8DAA8D;IAC9D,oBAAoB,IAAI,IAAI;CAK7B"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * HTTP server capability discovery.
3
+ *
4
+ * Mirrors Python's `http_capabilities()`: probes `OPTIONS {prefix}/health`
5
+ * and reads three response headers:
6
+ * - `VGI-Max-Request-Bytes` — server-enforced inline request cap
7
+ * - `VGI-Upload-URL-Support` — "true" when the server vends upload URLs
8
+ * - `VGI-Max-Upload-Bytes` — cap on out-of-band upload size
9
+ *
10
+ * Honours `Cache-Control: max-age=N` for refresh scheduling.
11
+ */
12
+ export interface HttpServerCapabilities {
13
+ /** Server's advertised max inline request body size (bytes). */
14
+ maxRequestBytes: number | null;
15
+ /** Whether the server vends upload URLs via `__upload_url__/init`. */
16
+ uploadUrlSupport: boolean;
17
+ /** Cap on the size of an externalized upload (bytes). */
18
+ maxUploadBytes: number | null;
19
+ /** Monotonic-time-ish epoch (ms) at which this snapshot should be re-probed. */
20
+ cacheExpiresAt: number | null;
21
+ }
22
+ export declare function parseCapabilitiesFromHeaders(headers: Headers): HttpServerCapabilities;
23
+ export declare function discoverHttpCapabilities(baseUrl: string, prefix: string, authorization?: string): Promise<HttpServerCapabilities>;
24
+ export declare function isCapabilitySnapshotFresh(snapshot: HttpServerCapabilities | null): boolean;
25
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/client/capabilities.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sEAAsE;IACtE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gFAAgF;IAChF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAaD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,sBAAsB,CAyBrF;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,sBAAsB,CAAC,CASjC;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,GAAG,OAAO,CAI1F"}
@@ -1,10 +1,20 @@
1
1
  import { type ServiceDescription } from "./introspect.js";
2
2
  import type { HttpConnectOptions, StreamSession } from "./types.js";
3
+ /** A connected RPC client, returned by {@link httpConnect}, {@link pipeConnect}, and {@link subprocessConnect}. */
3
4
  export interface RpcClient {
5
+ /** Invoke a unary method. Returns the single result row, or `null` for void methods. Parameter defaults from `__describe__` are applied automatically. */
4
6
  call(method: string, params?: Record<string, any>): Promise<Record<string, any> | null>;
7
+ /** Open a streaming method, returning a {@link StreamSession} for exchange or producer iteration. */
5
8
  stream(method: string, params?: Record<string, any>): Promise<StreamSession>;
9
+ /** Fetch the server's method/protocol description (cached after the first call). */
6
10
  describe(): Promise<ServiceDescription>;
11
+ /** Release transport resources; for subprocess clients this also terminates the child process. */
7
12
  close(): void;
8
13
  }
14
+ /**
15
+ * Connect to a vgi-rpc server over HTTP. The returned client lazily introspects
16
+ * the server (caching `__describe__`) on the first call and transparently handles
17
+ * zstd compression, authorization, and 413 request externalization.
18
+ */
9
19
  export declare function httpConnect(baseUrl: string, options?: HttpConnectOptions): RpcClient;
10
20
  //# sourceMappingURL=connect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/client/connect.ts"],"names":[],"mappings":"AAQA,OAAO,EAAmC,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAS3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKpE,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACxF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,QAAQ,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxC,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAsSpF"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/client/connect.ts"],"names":[],"mappings":"AAaA,OAAO,EAAmC,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAS3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAMpE,mHAAmH;AACnH,MAAM,WAAW,SAAS;IACxB,0JAA0J;IAC1J,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACxF,qGAAqG;IACrG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,oFAAoF;IACpF,QAAQ,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxC,kGAAkG;IAClG,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CA6WpF"}
@@ -1,19 +1,37 @@
1
1
  import { type RecordBatch, type Schema } from "@query-farm/apache-arrow";
2
2
  import type { LogMessage } from "./types.js";
3
+ /** Describes a single RPC method as reported by the server's `__describe__` response. */
3
4
  export interface MethodInfo {
5
+ /** The method name as invoked by {@link RpcClient.call} / {@link RpcClient.stream}. */
4
6
  name: string;
7
+ /** Whether the method is a single request/response (`unary`) or a streaming method (`stream`). */
5
8
  type: "unary" | "stream";
9
+ /** Arrow schema of the call parameters. */
6
10
  paramsSchema: Schema;
11
+ /** Arrow schema of a unary result; for stream methods this holds the per-batch output schema. */
7
12
  resultSchema: Schema;
13
+ /** Arrow schema of the per-batch input rows for exchange streams, when available. */
8
14
  inputSchema?: Schema;
15
+ /** Arrow schema of the per-batch output rows for stream methods, when available. */
9
16
  outputSchema?: Schema;
17
+ /** Arrow schema of the stream's one-time header row, when the method declares one. */
10
18
  headerSchema?: Schema;
19
+ /** Human-readable documentation for the method, if the server provides it. */
11
20
  doc?: string;
21
+ /** Per-parameter human-readable type names, if the server provides them. */
12
22
  paramTypes?: Record<string, string>;
23
+ /** Default values applied to omitted parameters before a call is sent. */
13
24
  defaults?: Record<string, any>;
14
25
  }
26
+ /** The full set of methods and protocol metadata reported by a server's `__describe__`. */
15
27
  export interface ServiceDescription {
28
+ /** The server's declared protocol/service name. */
16
29
  protocolName: string;
30
+ /** Application protocol surface version surfaced by the server's
31
+ * __describe__ response. Empty string when the server did not declare
32
+ * a `protocolVersion`. */
33
+ protocolVersion: string;
34
+ /** Every method the server exposes (excluding the built-in `__describe__`). */
17
35
  methods: MethodInfo[];
18
36
  }
19
37
  /**
@@ -27,5 +45,8 @@ export declare function parseDescribeResponse(batches: RecordBatch[], onLog?: (m
27
45
  export declare function httpIntrospect(baseUrl: string, options?: {
28
46
  prefix?: string;
29
47
  authorization?: string;
48
+ compressionLevel?: number;
49
+ compressFn?: (data: Uint8Array, level: number) => Promise<Uint8Array>;
50
+ decompressFn?: (data: Uint8Array) => Promise<Uint8Array>;
30
51
  }): Promise<ServiceDescription>;
31
52
  //# sourceMappingURL=introspect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"introspect.d.ts","sourceRoot":"","sources":["../../src/client/introspect.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,WAAW,EAAqB,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKnH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AASD;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,WAAW,EAAE,EACtB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAwE7B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD,OAAO,CAAC,kBAAkB,CAAC,CAuB7B"}
1
+ {"version":3,"file":"introspect.d.ts","sourceRoot":"","sources":["../../src/client/introspect.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,0BA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AC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACtE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1D,GACA,OAAO,CAAC,kBAAkB,CAAC,CAsC7B"}
@@ -1,12 +1,18 @@
1
- import { DataType, RecordBatch, type Schema } from "@query-farm/apache-arrow";
1
+ import { DataType, type RecordBatch, type Schema } from "@query-farm/apache-arrow";
2
2
  import { IpcStreamReader } from "../wire/reader.js";
3
3
  import type { LogMessage } from "./types.js";
4
4
  /** Infer an Arrow DataType from a JS value. */
5
5
  export declare function inferArrowType(value: any): DataType;
6
6
  /**
7
7
  * Build a 1-row Arrow IPC request batch with method metadata.
8
+ *
9
+ * When `options.protocolVersion` is non-empty, the value is emitted as
10
+ * `vgi_rpc.protocol_version` so servers that declare a Protocol-level
11
+ * version validate the request at the dispatch boundary.
8
12
  */
9
- export declare function buildRequestIpc(schema: Schema, params: Record<string, any>, method: string): Uint8Array;
13
+ export declare function buildRequestIpc(schema: Schema, params: Record<string, any>, method: string, options?: {
14
+ protocolVersion?: string;
15
+ }): Uint8Array;
10
16
  /**
11
17
  * Read schema + all batches from an IPC stream body.
12
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../../src/client/ipc.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,QAAQ,EAIR,WAAW,EAEX,KAAK,MAAM,EAIZ,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,+CAA+C;AAC/C,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,QAAQ,CAOnD;AAyCD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,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,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAS/G;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAqCjG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAiB1E;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAQtF"}
@@ -1,13 +1,22 @@
1
1
  /** RFC 9728 OAuth Protected Resource Metadata (client-side response). */
2
2
  export interface OAuthResourceMetadataResponse {
3
+ /** The protected resource's canonical URL (`resource`). */
3
4
  resource: string;
5
+ /** Authorization-server issuer URLs; the first is used for OIDC discovery (`authorization_servers`). */
4
6
  authorizationServers: string[];
7
+ /** Scopes the resource advertises (`scopes_supported`). */
5
8
  scopesSupported?: string[];
9
+ /** Advertised bearer methods, e.g. `["header"]` (`bearer_methods_supported`). */
6
10
  bearerMethodsSupported?: string[];
11
+ /** JWS algorithms the resource accepts (`resource_signing_alg_values_supported`). */
7
12
  resourceSigningAlgValuesSupported?: string[];
13
+ /** Human-readable resource name (`resource_name`). */
8
14
  resourceName?: string;
15
+ /** Documentation URL for the resource (`resource_documentation`). */
9
16
  resourceDocumentation?: string;
17
+ /** Policy URL for the resource (`resource_policy_uri`). */
10
18
  resourcePolicyUri?: string;
19
+ /** Terms-of-service URL for the resource (`resource_tos_uri`). */
11
20
  resourceTosUri?: string;
12
21
  /** OAuth client_id advertised by the server. */
13
22
  clientId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/client/oauth.ts"],"names":[],"mappings":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