@query-farm/vgi 0.30.0 → 0.31.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.
@@ -20,4 +20,30 @@ export interface ProtocolConfig {
20
20
  */
21
21
  signingKey?: Uint8Array;
22
22
  }
23
+ /**
24
+ * Wire name of the VGI protocol: the `vgi_rpc.protocol` routing key and the
25
+ * `{protocol}` HTTP path segment.
26
+ *
27
+ * The name carries the major version, so an incompatible major is a
28
+ * *different* protocol and therefore a 404 — an answer every proxy, WAF and
29
+ * load balancer understands without an Arrow parser, and one that lets
30
+ * `vgi.v2` and a future `vgi.v3` be served side by side while clients migrate.
31
+ * That matters for this consumer specifically: the DuckDB extension ships to
32
+ * users and cannot be flag-dayed.
33
+ *
34
+ * Declared rather than derived. Until the transports made the routing key
35
+ * required, each implementation's wire name defaulted to whatever its local
36
+ * type was called, which left the six ports disagreeing four ways — Python
37
+ * `VgiProtocol`, Java and C# `VgiService`, Go the framework default `Service`,
38
+ * this port `vgi` — so no client could address them all. The canonical name is
39
+ * decided in vgi-python and emitted by the DuckDB extension; this is that same
40
+ * string, not an independent choice.
41
+ *
42
+ * Since `@query-farm/vgi-rpc` 0.24.0 the name is also bound into the AEAD
43
+ * associated data of every state and call token (`TokenScope.protocol`), so a
44
+ * caller that opens a token minted by this protocol has to name it. Exported
45
+ * so the HTTP entry points build that scope from the same constant the
46
+ * protocol is registered under rather than a second copy of the literal.
47
+ */
48
+ export declare const VGI_PROTOCOL_NAME = "vgi.v2";
23
49
  export declare function buildVgiProtocol(config: ProtocolConfig): Protocol;
@@ -6342,8 +6342,9 @@ function registerCatalogMethods(protocol, catalog, _catalogName, signingKey) {
6342
6342
  }
6343
6343
 
6344
6344
  // src/protocol/dispatch.ts
6345
+ var VGI_PROTOCOL_NAME = "vgi.v2";
6345
6346
  function buildVgiProtocol(config) {
6346
- const protocol = new Protocol("vgi", { protocolVersion: "2.0.0" });
6347
+ const protocol = new Protocol(VGI_PROTOCOL_NAME, { protocolVersion: "2.0.0" });
6347
6348
  registerFunctionMethods(protocol, {
6348
6349
  registry: config.registry,
6349
6350
  recoverExchangeState: config.recoverExchangeState,
@@ -6498,7 +6499,10 @@ function createVgiFetch(opts) {
6498
6499
  ...opts.protocol,
6499
6500
  recoverExchangeState: async (opaqueData) => {
6500
6501
  const tokenString = new TextDecoder().decode(opaqueData);
6501
- const unpacked = await unpackStateToken(tokenString, opts.signingKey, tokenTtl, undefined);
6502
+ const unpacked = await unpackStateToken(tokenString, opts.signingKey, tokenTtl, {
6503
+ protocol: VGI_PROTOCOL_NAME,
6504
+ principal: undefined
6505
+ });
6502
6506
  return arrowStateSerializer.deserialize(unpacked.stateBytes);
6503
6507
  }
6504
6508
  });
@@ -6652,4 +6656,4 @@ export {
6652
6656
  serveVgiWorker
6653
6657
  };
6654
6658
 
6655
- //# debugId=DAEEFC0FEEC3B53164756E2164756E21
6659
+ //# debugId=D209EDA2709578AC64756E2164756E21