@query-farm/vgi 0.39.0 → 0.41.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.
package/dist/crypto.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare const ATTACH_UUID_LEN = 16;
9
9
  * this single error so a probing caller cannot distinguish them.
10
10
  */
11
11
  export declare class OpaqueDataRejectedError extends Error {
12
+ /** Canonical code (vgi-opaque-data-sealing.md rule 4): never `UNKNOWN`. */
13
+ readonly errorCode = "INVALID_ARGUMENT";
14
+ /** The classified kind a client branches on; identical for every cause. */
15
+ readonly errorKind = "opaque_data_not_recognized";
12
16
  constructor(field?: string);
13
17
  }
14
18
  /**
@@ -27,7 +31,7 @@ export declare function attachAad(auth: AuthContext | undefined): Uint8Array;
27
31
  */
28
32
  export declare function transactionAad(auth: AuthContext | undefined, attachEnvelope: Uint8Array): Uint8Array;
29
33
  /** Seal `payload` into an AEAD envelope: version || nonce || ciphertext+tag. */
30
- export declare function sealBytes(payload: Uint8Array, key: Uint8Array, aad: Uint8Array, version: number): Promise<Uint8Array>;
34
+ export declare function sealBytes(payload: Uint8Array, key: Uint8Array, aad: Uint8Array, version: number, fixedNonce?: Uint8Array): Promise<Uint8Array>;
31
35
  /**
32
36
  * Open and verify an envelope produced by {@link sealBytes}. Every failure
33
37
  * mode — malformed, wrong version, tampered, wrong key, wrong AAD
@@ -9,6 +9,12 @@ export interface VgiFetchOptions extends HostingOptions {
9
9
  * (e.g. derived from a Wrangler secret). Required because Workers don't
10
10
  * preserve in-memory state across requests/instances. */
11
11
  signingKey: Uint8Array;
12
+ /** Whether {@link signingKey} came from explicit configuration (a secret,
13
+ * `VGI_SIGNING_KEY`) rather than being generated for this process. Only a
14
+ * configured key hosts `vgi.attach_tickets.v1` (with the ability to issue
15
+ * grants): tickets sealed under a generated key would die on restart.
16
+ * Defaults to `true`, since this factory requires the key to be passed. */
17
+ signingKeyConfigured?: boolean;
12
18
  /** State-token TTL in seconds (default 3600). */
13
19
  tokenTtl?: number;
14
20
  /** URL path prefix for VGI requests (default "/vgi"). Pass "" to mount at
@@ -27,7 +27,8 @@ export { buildVgiProtocol, type ProtocolConfig } from "./protocol/dispatch.js";
27
27
  export type { LandingInfo } from "./http/landing.js";
28
28
  export { createLandingRoutes } from "./http/landing.js";
29
29
  export { BindResultSchema, ScanFunctionResultSchema } from "./generated/vgi-protocol-schemas.js";
30
- export { type AttachOptionSpec, serializeAttachOptionSpec, serializeAttachOptionSpecs, deserializeAttachOptionSpec, deserializeAttachOptionSpecs } from "./catalog/attach-option.js";
30
+ export { type AttachOptionSpec, serializeAttachOptionSpec, serializeAttachOptionSpecs, deserializeAttachOptionSpec, deserializeAttachOptionSpecs, RESERVED_ATTACH_OPTION, ReservedAttachOptionError, } from "./catalog/attach-option.js";
31
+ export { ATTACH_TICKET_OPTION, ATTACH_TICKET_PREFIX, ATTACH_TICKETS_PROTOCOL_NAME, ATTACH_TICKETS_PROTOCOL_VERSION, ATTACH_TICKET_SCHEMA, SEAL_ATTACH_REQUEST_SCHEMA, AttachTicketExpiredError, AttachTicketInvalidError, AttachTicketRequestError, SealAttachDeniedError, type AttachTicketClaims, type RestoredAttach, attachTicketAad, mintAttachTicket, openAttachTicket, redeemAttachTicket, } from "./attach-ticket.js";
31
32
  export { type ColumnStatistics, serializeColumnStatistics } from "./util/statistics.js";
32
33
  export { toUint8Array } from "./util/bytes.js";
33
34
  export { iterRows, batchFromRows, batchFromColumns, emptyBatch, filterBatch, projectSchema, projectBatch, batchToScalarDict, batchToSecretDict, safeNumber, } from "./util/arrow/index.js";
@@ -43,7 +44,7 @@ export type { VgiClientOptions, TableFunctionOptions, ScalarFunctionOptions, Tab
43
44
  export { str, bytes, int, int32, float, float32, bool, toSchema, OutputCollector, AuthContext } from "@query-farm/vgi-rpc";
44
45
  export { subprocessConnect, httpConnect, tcpConnect } from "@query-farm/vgi-rpc";
45
46
  export type { RpcClient, StreamSession, LogMessage } from "@query-farm/vgi-rpc";
46
- export { buildRpcServer, INTROSPECT_PRINCIPALS_ENV, type BuildRpcServerOptions, type HostingOptions, type ServerTransport, } from "./rpc-server.js";
47
- export { AuthUnavailableError, GrantRefusedError, IdentityUnavailableError, StatusError, } from "@query-farm/vgi-rpc";
47
+ export { buildRpcServer, grantKeysFromArgv, INTROSPECT_PRINCIPALS_ENV, type BuildRpcServerOptions, type HostingOptions, type ServerTransport, } from "./rpc-server.js";
48
+ export { AuthUnavailableError, GrantKeys, GrantRefusedError, IdentityUnavailableError, StatusError, } from "@query-farm/vgi-rpc";
48
49
  export type { GrantMinter, IssuedGrant, TokenIdentity, TokenResolver } from "@query-farm/vgi-rpc";
49
50
  export { normalizeSchemaPath, schemaPathDisplay, schemaPathKey, schemaPathsEqual, type SchemaPath } from "./schema-path.js";