@query-farm/vgi 0.51.0 → 0.52.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 (72) hide show
  1. package/README.md +45 -3
  2. package/dist/arrow/impl-flechette/ipc.d.ts +9 -1
  3. package/dist/client-entry.js +833 -775
  4. package/dist/client-entry.js.map +10 -10
  5. package/dist/functions/storage-blobs.d.ts +173 -0
  6. package/dist/functions/storage-cf-do.d.ts +12 -0
  7. package/dist/functions/storage.d.ts +22 -0
  8. package/dist/functions/table.d.ts +6 -1
  9. package/dist/generated/vgi-client.d.ts +7 -1
  10. package/dist/generated/vgi-protocol-schemas.d.ts +10 -9
  11. package/dist/generated/vgi-protocol-types.d.ts +244 -2
  12. package/dist/generated/vgi-service.d.ts +1 -1
  13. package/dist/hosted.d.ts +117 -0
  14. package/dist/http/blob-vendor.d.ts +33 -0
  15. package/dist/http/fetch.d.ts +53 -2
  16. package/dist/http/hosted-auth.d.ts +45 -0
  17. package/dist/index.core.d.ts +9 -2
  18. package/dist/index.js +5238 -3619
  19. package/dist/index.js.map +44 -28
  20. package/dist/protocol/arguments-ref.d.ts +107 -0
  21. package/dist/protocol/dispatch.d.ts +3 -2
  22. package/dist/protocol/handlers/function.d.ts +21 -0
  23. package/dist/protocol/serialize.d.ts +1 -1
  24. package/dist/protocol/serializers/bind.d.ts +27 -1
  25. package/dist/protocol/serializers/cardinality.d.ts +1 -1
  26. package/dist/protocol/serializers/splits.d.ts +7 -0
  27. package/dist/protocol/state-serializer.d.ts +8 -7
  28. package/dist/protocol/stream-init.d.ts +17 -0
  29. package/dist/protocol/types.d.ts +24 -0
  30. package/dist/secrets/lookups.d.ts +31 -0
  31. package/dist/serve-entry.d.ts +25 -4
  32. package/dist/serve-entry.js +2940 -1219
  33. package/dist/serve-entry.js.map +44 -29
  34. package/dist/worker-cf-entry.d.ts +5 -0
  35. package/dist/worker-cf-entry.js +2928 -1223
  36. package/dist/worker-cf-entry.js.map +47 -31
  37. package/package.json +5 -4
  38. package/src/arrow/impl-flechette/ipc.ts +9 -1
  39. package/src/functions/storage-blobs.ts +654 -0
  40. package/src/functions/storage-cf-do.ts +24 -0
  41. package/src/functions/storage.ts +54 -5
  42. package/src/functions/table-buffering.ts +14 -4
  43. package/src/functions/table.ts +8 -4
  44. package/src/generated/vgi-client.ts +9 -2
  45. package/src/generated/vgi-protocol-schemas.ts +115 -107
  46. package/src/generated/vgi-protocol-types.ts +640 -3
  47. package/src/generated/vgi-service.ts +2 -2
  48. package/src/hosted.ts +254 -0
  49. package/src/http/blob-vendor.ts +80 -0
  50. package/src/http/fetch.ts +170 -8
  51. package/src/http/hosted-auth.ts +326 -0
  52. package/src/index.core.ts +64 -1
  53. package/src/protocol/arguments-ref.ts +260 -0
  54. package/src/protocol/dispatch.ts +3 -2
  55. package/src/protocol/handlers/function.ts +109 -60
  56. package/src/protocol/handlers/table-buffering.ts +5 -0
  57. package/src/protocol/serialize.ts +3 -0
  58. package/src/protocol/serializers/bind.ts +96 -69
  59. package/src/protocol/serializers/cardinality.ts +4 -7
  60. package/src/protocol/serializers/init.ts +5 -11
  61. package/src/protocol/serializers/splits.ts +31 -4
  62. package/src/protocol/state-serializer.ts +27 -39
  63. package/src/protocol/stream-init.ts +87 -0
  64. package/src/protocol/types.ts +25 -0
  65. package/src/secrets/lookups.ts +53 -0
  66. package/src/serve-entry.ts +105 -8
  67. package/src/worker-cf-entry.ts +33 -0
  68. package/src/worker.ts +25 -0
  69. package/dist/protocol/carried-init-request.d.ts +0 -28
  70. package/dist/util/zstd-sync.d.ts +0 -7
  71. package/src/protocol/carried-init-request.ts +0 -139
  72. package/src/util/zstd-sync.ts +0 -50
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@query-farm/vgi",
3
- "version": "0.51.0",
3
+ "version": "0.52.1",
4
4
  "description": "TypeScript framework for extending DuckDB with user-defined functions via the Vector Gateway Interface (VGI) over Arrow IPC.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Query Farm LLC (https://query.farm)",
@@ -89,16 +89,17 @@
89
89
  },
90
90
  "dependencies": {
91
91
  "@noble/ciphers": "^2.3.0",
92
- "@query-farm/flechette": "^2.7.1"
92
+ "@query-farm/flechette": "^2.7.2",
93
+ "jose": "^6.2.0"
93
94
  },
94
95
  "peerDependencies": {
95
96
  "@query-farm/apache-arrow": "^21.1.1",
96
- "@query-farm/vgi-rpc": "^0.29.7"
97
+ "@query-farm/vgi-rpc": "^0.30.1"
97
98
  },
98
99
  "devDependencies": {
99
100
  "@duckdb/node-api": "^1.5.5-r.4",
100
101
  "@query-farm/apache-arrow": "^21.1.1",
101
- "@query-farm/vgi-rpc": "^0.29.7",
102
+ "@query-farm/vgi-rpc": "^0.30.1",
102
103
  "@types/bun": "latest",
103
104
  "typescript": "^7.0.2"
104
105
  },
@@ -194,7 +194,15 @@ export function deserializeBatches(bytes: Uint8Array): VgiBatch[] {
194
194
  return [deserializeBatch(bytes)];
195
195
  }
196
196
 
197
- /** The input batches must share dictionaries; collection encoding builds them together. */
197
+ /**
198
+ * One multi-batch IPC stream. Each batch may carry its own dictionary values
199
+ * (batches built independently, e.g. an HTTP reply's metadata-only batch and
200
+ * its result batch): the flechette fork's `tablesToIPC` assigns dictionary ids
201
+ * by field position and writes a replacement dictionary before any batch whose
202
+ * dictionary differs. Needs @query-farm/flechette with that fix; earlier
203
+ * releases crashed on a leading zero-row batch and decoded later batches
204
+ * against the first batch's dictionary (see multi-batch-dictionaries.test.ts).
205
+ */
198
206
  export function serializeBatches(batches: VgiBatch[], schema: VgiSchema): Uint8Array {
199
207
  if (batches.length === 0) return serializeSchema(schema);
200
208
  return tablesToIPC(batches as any[], { format: "stream" }) as Uint8Array;