@query-farm/vgi 0.45.0 → 0.47.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 (102) hide show
  1. package/README.md +19 -6
  2. package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
  3. package/dist/arrow/impl-arrowjs/iterate.d.ts +2 -0
  4. package/dist/arrow/impl-flechette/canonical.d.ts +1 -1
  5. package/dist/arrow/impl-flechette/index.d.ts +1 -1
  6. package/dist/arrow/impl-flechette/iterate.d.ts +2 -0
  7. package/dist/arrow/impl-flechette/schema.d.ts +19 -5
  8. package/dist/arrow/index.d.ts +1 -1
  9. package/dist/catalog/column-expressions.d.ts +8 -0
  10. package/dist/catalog/column-metadata.d.ts +11 -0
  11. package/dist/catalog/composite.d.ts +2 -1
  12. package/dist/catalog/descriptors.d.ts +21 -29
  13. package/dist/catalog/interface.d.ts +15 -20
  14. package/dist/catalog/macro-overloads.d.ts +4 -0
  15. package/dist/catalog/read-only.d.ts +1 -1
  16. package/dist/catalog/unconstrained-columns.d.ts +2 -0
  17. package/dist/client/client.d.ts +38 -14
  18. package/dist/client-entry.js +806 -115
  19. package/dist/client-entry.js.map +18 -14
  20. package/dist/functions/continuation.d.ts +69 -0
  21. package/dist/functions/projection.d.ts +18 -0
  22. package/dist/functions/table-in-out.d.ts +51 -7
  23. package/dist/functions/table.d.ts +6 -1
  24. package/dist/functions/types.d.ts +21 -0
  25. package/dist/generated/vgi-client.d.ts +178 -36
  26. package/dist/generated/vgi-protocol-schemas.d.ts +51 -1
  27. package/dist/generated/vgi-protocol-types.d.ts +317 -3
  28. package/dist/generated/vgi-service.d.ts +266 -29
  29. package/dist/index.core.d.ts +3 -1
  30. package/dist/index.js +1747 -320
  31. package/dist/index.js.map +45 -37
  32. package/dist/protocol/dispatch.d.ts +9 -9
  33. package/dist/protocol/handlers/aggregate.d.ts +1 -1
  34. package/dist/protocol/handlers/catalog/index.d.ts +1 -1
  35. package/dist/protocol/handlers/catalog/metadata.d.ts +1 -0
  36. package/dist/protocol/handlers/function.d.ts +1 -1
  37. package/dist/protocol/handlers/table-buffering.d.ts +1 -1
  38. package/dist/protocol/handlers/unimplemented.d.ts +1 -1
  39. package/dist/protocol/serializers/bind.d.ts +5 -1
  40. package/dist/protocol/types.d.ts +5 -0
  41. package/dist/rpc-server.d.ts +6 -6
  42. package/dist/serve-entry.js +1607 -436
  43. package/dist/serve-entry.js.map +33 -27
  44. package/dist/util/arrow/index.d.ts +1 -1
  45. package/dist/util/parent-rows.d.ts +8 -0
  46. package/dist/worker-cf-entry.d.ts +1 -1
  47. package/dist/worker-cf-entry.js +1901 -526
  48. package/dist/worker-cf-entry.js.map +45 -37
  49. package/dist/worker.d.ts +1 -1
  50. package/package.json +8 -7
  51. package/src/arrow/impl-arrowjs/index.ts +1 -1
  52. package/src/arrow/impl-arrowjs/iterate.ts +9 -1
  53. package/src/arrow/impl-arrowjs/project.ts +1 -1
  54. package/src/arrow/impl-flechette/canonical.ts +7 -5
  55. package/src/arrow/impl-flechette/index.ts +1 -1
  56. package/src/arrow/impl-flechette/ipc.ts +12 -0
  57. package/src/arrow/impl-flechette/iterate.ts +5 -0
  58. package/src/arrow/impl-flechette/project.ts +6 -8
  59. package/src/arrow/index.ts +1 -1
  60. package/src/catalog/column-expressions.ts +224 -0
  61. package/src/catalog/column-metadata.ts +151 -0
  62. package/src/catalog/composite.ts +5 -1
  63. package/src/catalog/contents-codec.ts +6 -1
  64. package/src/catalog/descriptors.ts +21 -29
  65. package/src/catalog/interface.ts +70 -55
  66. package/src/catalog/macro-overloads.ts +44 -0
  67. package/src/catalog/read-only.ts +69 -71
  68. package/src/catalog/unconstrained-columns.ts +23 -0
  69. package/src/client/client.ts +180 -69
  70. package/src/codec/asd.ts +3 -1
  71. package/src/filter-pushdown/collector.ts +17 -1
  72. package/src/functions/continuation.ts +202 -0
  73. package/src/functions/projection.ts +207 -0
  74. package/src/functions/table-in-out.ts +131 -56
  75. package/src/functions/table.ts +10 -0
  76. package/src/functions/types.ts +21 -0
  77. package/src/generated/vgi-client.ts +200 -37
  78. package/src/generated/vgi-protocol-schemas.ts +456 -41
  79. package/src/generated/vgi-protocol-types.ts +879 -5
  80. package/src/generated/vgi-service.ts +514 -42
  81. package/src/http/client-bundle.ts +1 -1
  82. package/src/http/fetch.ts +1 -1
  83. package/src/index.core.ts +10 -0
  84. package/src/protocol/dispatch.ts +9 -9
  85. package/src/protocol/handlers/aggregate.ts +1 -1
  86. package/src/protocol/handlers/catalog/admin.ts +10 -5
  87. package/src/protocol/handlers/catalog/index.ts +2 -2
  88. package/src/protocol/handlers/catalog/macro.ts +6 -5
  89. package/src/protocol/handlers/catalog/metadata.ts +16 -0
  90. package/src/protocol/handlers/catalog/table.ts +72 -26
  91. package/src/protocol/handlers/catalog/view.ts +24 -3
  92. package/src/protocol/handlers/function.ts +79 -1
  93. package/src/protocol/handlers/table-buffering.ts +1 -1
  94. package/src/protocol/handlers/unimplemented.ts +6 -6
  95. package/src/protocol/serializers/bind.ts +17 -1
  96. package/src/protocol/state-serializer.ts +7 -1
  97. package/src/protocol/types.ts +6 -0
  98. package/src/rpc-server.ts +9 -9
  99. package/src/util/arrow/index.ts +1 -1
  100. package/src/util/parent-rows.ts +41 -0
  101. package/src/worker-cf-entry.ts +3 -0
  102. package/src/worker.ts +1 -1
@@ -21,7 +21,7 @@ export interface ProtocolConfig {
21
21
  * The name carries the major version, so an incompatible major is a
22
22
  * *different* protocol and therefore a 404 — an answer every proxy, WAF and
23
23
  * load balancer understands without an Arrow parser, and one that lets
24
- * `vgi.v2` and a future `vgi.v3` be served side by side while clients migrate.
24
+ * `vgi.v2` and `vgi.v3` be served side by side while clients migrate.
25
25
  * That matters for this consumer specifically: the DuckDB extension ships to
26
26
  * users and cannot be flag-dayed.
27
27
  *
@@ -42,23 +42,23 @@ export interface ProtocolConfig {
42
42
  */
43
43
  export { VGI_PROTOCOL_NAME };
44
44
  /**
45
- * The `vgi.v2` protocol hash `vgi_rpc.Reflection.v1` must report for this
46
- * worker: the reference's (vgi-python 0.43.0, 72 methods). Every SDK hosts
47
- * every `vgi.v2` method with the reference's schemas, so the hash is one value
45
+ * The `vgi.v3` protocol hash `vgi_rpc.Reflection.v1` must report for this
46
+ * worker: the combined reference's 85 methods. Every SDK hosts
47
+ * every `vgi.v3` method with the reference's schemas, so the hash is one value
48
48
  * across the ports; a method this SDK does not implement is still registered
49
49
  * with the generated UNIMPLEMENTED default (src/generated/vgi-service.ts). The
50
50
  * hash covers method names, types and the params/result/header schemas only
51
51
  * (WIRE_PROTOCOL.md §14).
52
52
  *
53
- * It changes only with vgi.v2's protocol version (currently 2.2.0). Asserted
54
- * by src/protocol/__tests__/vgi-v2-hash.test.ts; if that test fails, the
53
+ * It changes only with vgi.v3's protocol version (currently 3.0.0). Asserted
54
+ * by src/protocol/__tests__/vgi-v3-hash.test.ts; if that test fails, the
55
55
  * surface drifted from the reference -- fix the schemas, do not bump this.
56
56
  */
57
- export declare const VGI_V2_PROTOCOL_HASH = "774cb80090d71ea76d09aa311b9cda4ca4c33c3bf72c43242eb6dc87b6f79ce5";
57
+ export declare const VGI_V3_PROTOCOL_HASH = "50e9404173bee3262e96b8939eb5c425463336abca2a17916812d68b6e0f6cad";
58
58
  /**
59
- * This worker's `vgi.v2` implementation: the generated UNIMPLEMENTED default
59
+ * This worker's `vgi.v3` implementation: the generated UNIMPLEMENTED default
60
60
  * for every method, overridden by the handler groups for what this SDK serves.
61
61
  */
62
62
  export declare function buildVgiService(config: ProtocolConfig): VgiService;
63
- /** The `vgi.v2` protocol, registered from the generated table with {@link buildVgiService}. */
63
+ /** The `vgi.v3` protocol, registered from the generated table with {@link buildVgiService}. */
64
64
  export declare function buildVgiProtocol(config: ProtocolConfig): Protocol;
@@ -1,4 +1,4 @@
1
1
  import type { VgiService } from "../../generated/vgi-service.js";
2
2
  import type { FunctionRegistry } from "../../functions/registry.js";
3
- /** The aggregate lifecycle's `vgi.v2` handlers. */
3
+ /** The aggregate lifecycle's `vgi.v3` handlers. */
4
4
  export declare function aggregateHandlers(registry: FunctionRegistry): Partial<VgiService>;
@@ -1,4 +1,4 @@
1
1
  import type { CatalogInterface } from "../../../catalog/interface.js";
2
2
  import type { VgiService } from "../../../generated/vgi-service.js";
3
- /** The catalog_* `vgi.v2` handlers, over *catalog* (or `NoCatalogError` without one). */
3
+ /** The catalog_* `vgi.v3` handlers, over *catalog* (or `NoCatalogError` without one). */
4
4
  export declare function catalogHandlers(catalog: CatalogInterface | undefined, signingKey?: Uint8Array): Partial<VgiService>;
@@ -0,0 +1 @@
1
+ export declare function catalogStringMap(raw: any): Record<string, string>;
@@ -23,5 +23,5 @@ export interface FunctionHandlerConfig {
23
23
  version?(attach: Uint8Array, txn?: Uint8Array): number | Promise<number>;
24
24
  };
25
25
  }
26
- /** The per-function lifecycle's `vgi.v2` handlers. */
26
+ /** The per-function lifecycle's `vgi.v3` handlers. */
27
27
  export declare function functionHandlers(config: FunctionHandlerConfig): Partial<VgiService>;
@@ -1,4 +1,4 @@
1
1
  import type { VgiService } from "../../generated/vgi-service.js";
2
2
  import type { FunctionRegistry } from "../../functions/registry.js";
3
- /** The table_buffering lifecycle's `vgi.v2` handlers. */
3
+ /** The table_buffering lifecycle's `vgi.v3` handlers. */
4
4
  export declare function tableBufferingHandlers(registry: FunctionRegistry, signingKey?: Uint8Array): Partial<VgiService>;
@@ -1,4 +1,4 @@
1
1
  import { type VgiMethodSpec } from "../../generated/vgi-service.js";
2
2
  export { unimplementedMessage } from "../../generated/vgi-service.js";
3
- /** The vgi.v2 methods (of the reference's 72) this SDK leaves at the generated default. */
3
+ /** The vgi.v3 methods (of the reference's 72) this SDK leaves at the generated default. */
4
4
  export declare const UNIMPLEMENTED_METHODS: readonly VgiMethodSpec[];
@@ -1,8 +1,12 @@
1
1
  import { type VgiSchema, type VgiBatch } from "../../arrow/index.js";
2
- import type { BindRequest, BindResponse } from "../types.js";
2
+ import type { BindRequest, BindResponse, BindRepeatability } from "../types.js";
3
3
  declare const BIND_REQUEST_SCHEMA: VgiSchema;
4
4
  export declare function serializeBindRequest(req: BindRequest): VgiBatch;
5
5
  export declare function deserializeBindRequest(params: Record<string, any>): BindRequest;
6
+ /** Validate required wire enum values, including rejecting NULL and absent values. */
7
+ export declare function parseBindRepeatability(value: unknown): BindRepeatability;
8
+ /** Only omitted provider declarations default; explicit NULL remains invalid. */
9
+ export declare function normalizeBindRepeatability(value: unknown): BindRepeatability;
6
10
  export declare function serializeBindResponse(resp: BindResponse): Record<string, any>;
7
11
  export declare function deserializeBindResponse(params: Record<string, any>): BindResponse;
8
12
  export { BIND_REQUEST_SCHEMA };
@@ -88,7 +88,12 @@ export interface BindRequest {
88
88
  */
89
89
  argument_names?: (string | null)[] | null;
90
90
  }
91
+ /** Equivalent scans of one bound state within a query; independent binds may differ. */
92
+ export type BindRepeatability = "UNKNOWN" | "STABLE_WITHIN_QUERY";
91
93
  export interface BindResponse {
94
+ /** Omitted provider values serialize as UNKNOWN. Wire values are required. */
95
+ repeatability?: BindRepeatability;
96
+ projection_expression_profiles?: string[];
92
97
  output_schema: VgiSchema;
93
98
  opaque_data: Uint8Array | null;
94
99
  lookup_secret_types?: string[];
@@ -8,7 +8,7 @@ export type ServerTransport = "pipe" | "unix" | "tcp" | "iroh" | "stream" | "htt
8
8
  /** Environment variable naming the principals allowed to call `introspect_token`. */
9
9
  export declare const INTROSPECT_PRINCIPALS_ENV = "VGI_INTROSPECT_PRINCIPALS";
10
10
  /**
11
- * What a worker hosts beyond `vgi.v2`, and whether it opts into identity.
11
+ * What a worker hosts beyond `vgi.v3`, and whether it opts into identity.
12
12
  *
13
13
  * Accepted by `new Worker({...})`, `serveVgiWorker`, `createVgiWorkerFetch`
14
14
  * and `createVgiFetch` (Cloudflare Workers) alike, so one worker definition
@@ -16,20 +16,20 @@ export declare const INTROSPECT_PRINCIPALS_ENV = "VGI_INTROSPECT_PRINCIPALS";
16
16
  */
17
17
  export interface HostingOptions {
18
18
  /**
19
- * Additional vgi-rpc protocols to host beside `vgi.v2`, on the **same**
19
+ * Additional vgi-rpc protocols to host beside `vgi.v3`, on the **same**
20
20
  * listener, whatever the transport.
21
21
  *
22
22
  * A vgi-rpc `Protocol` carries its handlers, so each entry is a whole
23
23
  * `(protocol, implementation)` pair. Called **once**, when the server is
24
24
  * built; it may consult configuration or the environment, but the answer is
25
25
  * fixed for the life of the process, so reflection output and protocol
26
- * hashes stay stable. Hosted after `vgi.v2`, in the order returned.
26
+ * hashes stay stable. Hosted after `vgi.v3`, in the order returned.
27
27
  *
28
28
  * The protocol is the unit of optionality: there is no way to host a subset
29
29
  * of a protocol's methods. A capability that is optional is its own
30
30
  * protocol, returned here or not.
31
31
  *
32
- * Each needs a distinct wire name, which may not be `vgi.v2` and may not
32
+ * Each needs a distinct wire name, which may not be `vgi.v3` and may not
33
33
  * use the reserved `vgi_rpc.` prefix: reflection is hosted automatically and
34
34
  * `vgi_rpc.Identity.v2` is enabled through {@link resolveToken} /
35
35
  * {@link mintGrant}. Violations are a startup error naming this hook.
@@ -110,14 +110,14 @@ export interface BuildRpcServerOptions {
110
110
  };
111
111
  }
112
112
  /**
113
- * Build the vgi-rpc server for a worker's `vgi.v2` protocol on `transport`.
113
+ * Build the vgi-rpc server for a worker's `vgi.v3` protocol on `transport`.
114
114
  *
115
115
  * Calls `hosting.hostedProtocols()` exactly once and hosts the result beside
116
116
  * `primary`; see the module comment for the full hosted set.
117
117
  *
118
118
  * @throws TypeError `hostedProtocols()` returned something other than an
119
119
  * iterable of vgi-rpc `Protocol`s.
120
- * @throws Error A hosted protocol's name is invalid, reserved, `vgi.v2`'s, or
120
+ * @throws Error A hosted protocol's name is invalid, reserved, `vgi.v3`'s, or
121
121
  * repeated; the transport is unknown; or the worker supplies `resolveToken`
122
122
  * on HTTP with no introspector allowlist.
123
123
  */