@query-farm/vgi 0.43.0 → 0.45.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 (73) hide show
  1. package/README.md +5 -2
  2. package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
  3. package/dist/arrow/impl-arrowjs/ipc.d.ts +6 -0
  4. package/dist/arrow/impl-flechette/build.d.ts +2 -2
  5. package/dist/arrow/impl-flechette/canonical.d.ts +1 -1
  6. package/dist/arrow/impl-flechette/index.d.ts +1 -1
  7. package/dist/arrow/impl-flechette/ipc.d.ts +6 -0
  8. package/dist/arrow/index.d.ts +1 -1
  9. package/dist/attach-ticket.d.ts +18 -7
  10. package/dist/catalog/contents-codec.d.ts +7 -0
  11. package/dist/catalog/contents-digest.d.ts +2 -1
  12. package/dist/catalog/interface.d.ts +3 -0
  13. package/dist/catalog/publication-envelope.d.ts +1 -0
  14. package/dist/catalog/publication.d.ts +142 -0
  15. package/dist/catalog/s3-publication.d.ts +38 -0
  16. package/dist/client-entry.js +349 -114
  17. package/dist/client-entry.js.map +16 -14
  18. package/dist/codec/asd.d.ts +7 -1
  19. package/dist/codec/conform.d.ts +51 -0
  20. package/dist/errors.d.ts +5 -1
  21. package/dist/generated/vgi-client.d.ts +6 -14
  22. package/dist/generated/vgi-protocol-schemas.d.ts +2 -0
  23. package/dist/generated/vgi-protocol-types.d.ts +26 -3
  24. package/dist/generated/vgi-service.d.ts +3 -3
  25. package/dist/index.core.d.ts +1 -1
  26. package/dist/index.d.ts +4 -0
  27. package/dist/index.js +955 -118
  28. package/dist/index.js.map +33 -28
  29. package/dist/protocol/dispatch.d.ts +1 -1
  30. package/dist/protocol/handlers/catalog/contents.d.ts +4 -4
  31. package/dist/protocol/handlers/shared.d.ts +2 -1
  32. package/dist/protocol/serializers/shared.d.ts +2 -1
  33. package/dist/rpc-server.d.ts +2 -2
  34. package/dist/serve-entry.js +867 -165
  35. package/dist/serve-entry.js.map +26 -22
  36. package/dist/worker-cf-entry.js +825 -114
  37. package/dist/worker-cf-entry.js.map +31 -27
  38. package/package.json +3 -3
  39. package/src/arrow/impl-arrowjs/index.ts +1 -0
  40. package/src/arrow/impl-arrowjs/ipc.ts +23 -0
  41. package/src/arrow/impl-flechette/build.ts +4 -2
  42. package/src/arrow/impl-flechette/canonical.ts +7 -2
  43. package/src/arrow/impl-flechette/index.ts +1 -0
  44. package/src/arrow/impl-flechette/ipc.ts +19 -0
  45. package/src/arrow/index.ts +1 -1
  46. package/src/attach-ticket.ts +41 -13
  47. package/src/catalog/composite.ts +2 -1
  48. package/src/catalog/contents-codec.ts +77 -0
  49. package/src/catalog/contents-digest.ts +20 -17
  50. package/src/catalog/interface.ts +8 -4
  51. package/src/catalog/publication-envelope.ts +62 -0
  52. package/src/catalog/publication.ts +290 -0
  53. package/src/catalog/read-only.ts +8 -8
  54. package/src/catalog/s3-publication.ts +81 -0
  55. package/src/client/client.ts +15 -24
  56. package/src/codec/asd.ts +45 -3
  57. package/src/codec/conform.ts +194 -0
  58. package/src/errors.ts +27 -7
  59. package/src/functions/registry.ts +3 -2
  60. package/src/generated/vgi-client.ts +7 -16
  61. package/src/generated/vgi-protocol-schemas.ts +13 -6
  62. package/src/generated/vgi-protocol-types.ts +39 -5
  63. package/src/generated/vgi-service.ts +4 -3
  64. package/src/http/fetch.ts +1 -1
  65. package/src/index.core.ts +3 -1
  66. package/src/index.ts +5 -0
  67. package/src/protocol/dispatch.ts +1 -1
  68. package/src/protocol/handlers/catalog/admin.ts +7 -4
  69. package/src/protocol/handlers/catalog/contents.ts +50 -35
  70. package/src/protocol/handlers/shared.ts +8 -2
  71. package/src/protocol/serializers/bind.ts +3 -1
  72. package/src/protocol/serializers/shared.ts +5 -2
  73. package/src/rpc-server.ts +7 -7
@@ -50,7 +50,7 @@ export { VGI_PROTOCOL_NAME };
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.1.0). Asserted
53
+ * It changes only with vgi.v2's protocol version (currently 2.2.0). Asserted
54
54
  * by src/protocol/__tests__/vgi-v2-hash.test.ts; if that test fails, the
55
55
  * surface drifted from the reference -- fix the schemas, do not bump this.
56
56
  */
@@ -1,4 +1,5 @@
1
1
  import { type CatalogContentsResponse } from "../../../generated/vgi-protocol-types.js";
2
+ import { ExternalRef, type CallContext } from "@query-farm/vgi-rpc";
2
3
  import type { AttachOpaqueData, CatalogInterface } from "../../../catalog/interface.js";
3
4
  type Wire = {
4
5
  result: Uint8Array;
@@ -9,9 +10,8 @@ type Wire = {
9
10
  * Enforces the revalidation rules: `not_modified` needs an etag equal to
10
11
  * `ifNoneMatch` and no schemas; a catalog with no etag never yields
11
12
  * `not_modified` (and so ignores `ifNoneMatch`). Validates the schema paths
12
- * (unique, parent present) and orders them parent-first. Every item is
13
- * encoded with the SAME encoder its per-schema RPC uses, so items are
14
- * byte-identical to catalog_schemas / catalog_schema_contents_* items.
13
+ * (unique, parent present) and orders them parent-first. The six collection
14
+ * streams retain the fields used by the existing per-schema RPC metadata.
15
15
  */
16
16
  export declare function buildCatalogContents(cat: CatalogInterface, owner: CatalogInterface, attach: AttachOpaqueData, version: number, ifNoneMatch: string | null): Promise<CatalogContentsResponse>;
17
17
  /**
@@ -23,5 +23,5 @@ export declare function buildCatalogContents(cat: CatalogInterface, owner: Catal
23
23
  * serialized response bytes. A conditional call matching the cached etag is
24
24
  * answered `not_modified` without touching the snapshot.
25
25
  */
26
- export declare function serveCatalogContents(cat: CatalogInterface, attach: AttachOpaqueData, ifNoneMatch: string | null): Promise<Wire>;
26
+ export declare function serveCatalogContents(cat: CatalogInterface, attach: AttachOpaqueData, ifNoneMatch: string | null, callContext?: CallContext, sealedAttach?: Uint8Array): Promise<Wire | ExternalRef>;
27
27
  export {};
@@ -11,7 +11,8 @@ export declare function unwrapRequest(requestBytes: any): Record<string, any>;
11
11
  export declare function normalizeRequestSchemaPaths(params: Record<string, any>): void;
12
12
  /**
13
13
  * Wrap a dict of values into a single "result" Binary column.
14
- * Builds a 1-row batch from the values using the given schema,
14
+ * Builds a 1-row batch from the values using the given schema (conformed to
15
+ * the protocol's container rules, see `conformRecord`),
15
16
  * serializes it to IPC bytes, and returns { result: bytes }.
16
17
  */
17
18
  export declare function wrapResult(values: Record<string, any>, innerSchema: VgiSchema | import("../../arrow/index.js").VgiSchema): {
@@ -7,6 +7,7 @@ import { type VgiSchema, type VgiBatch } from "../../arrow/index.js";
7
7
  export declare function toUint8Array(val: any): Uint8Array;
8
8
  /**
9
9
  * Build a single-row RecordBatch from a {fieldName: value} dict matching the
10
- * given schema. Auto-coerces JS numbers to BigInt for Int64 fields.
10
+ * given schema. Auto-coerces JS numbers to BigInt for Int64 fields, and
11
+ * applies the protocol's container rules (`conformRecord`).
11
12
  */
12
13
  export declare function buildSingleRowBatch(schema: VgiSchema, values: Record<string, any>): VgiBatch;
@@ -31,13 +31,13 @@ export interface HostingOptions {
31
31
  *
32
32
  * Each needs a distinct wire name, which may not be `vgi.v2` and may not
33
33
  * use the reserved `vgi_rpc.` prefix: reflection is hosted automatically and
34
- * `vgi_rpc.Identity.v1` is enabled through {@link resolveToken} /
34
+ * `vgi_rpc.Identity.v2` is enabled through {@link resolveToken} /
35
35
  * {@link mintGrant}. Violations are a startup error naming this hook.
36
36
  */
37
37
  hostedProtocols?: () => Iterable<Protocol>;
38
38
  /**
39
39
  * Resolve an opaque bearer credential to the identity it authenticates as.
40
- * Supplying it hosts `vgi_rpc.Identity.v1`'s `introspect_token` -- on HTTP,
40
+ * Supplying it hosts `vgi_rpc.Identity.v2`'s `introspect_token` -- on HTTP,
41
41
  * the transport that authenticates callers. Absent, the method is absent
42
42
  * (not hosted-and-refusing), which keeps a dependency upgrade from growing a
43
43
  * credential-to-identity oracle on every existing worker.