@query-farm/vgi 0.29.0 → 0.30.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/README.md +26 -1
- package/dist/arguments/argument-spec.d.ts +4 -2
- package/dist/catalog/composite.d.ts +13 -13
- package/dist/catalog/descriptors.d.ts +7 -3
- package/dist/catalog/interface.d.ts +67 -40
- package/dist/catalog/read-only.d.ts +32 -15
- package/dist/client/client.d.ts +36 -29
- package/dist/client/types.d.ts +2 -0
- package/dist/client-entry.d.ts +1 -1
- package/dist/client-entry.js +442 -283
- package/dist/client-entry.js.map +12 -11
- package/dist/filter-pushdown/capabilities.d.ts +3 -0
- package/dist/filter-pushdown/deserialize.d.ts +14 -15
- package/dist/filter-pushdown/evaluate.d.ts +14 -44
- package/dist/filter-pushdown/index.d.ts +2 -2
- package/dist/filter-pushdown/types.d.ts +120 -68
- package/dist/functions/aggregate.d.ts +4 -0
- package/dist/functions/registry.d.ts +5 -5
- package/dist/functions/scalar.d.ts +6 -1
- package/dist/functions/table-buffering.d.ts +9 -0
- package/dist/functions/table-in-out.d.ts +13 -0
- package/dist/functions/table.d.ts +9 -2
- package/dist/functions/types.d.ts +22 -2
- package/dist/generated/vgi-client.d.ts +57 -31
- package/dist/generated/vgi-protocol-schemas.d.ts +15 -0
- package/dist/http/fetch.d.ts +7 -1
- package/dist/index.core.d.ts +2 -1
- package/dist/index.js +2320 -1363
- package/dist/index.js.map +44 -41
- package/dist/metadata/types.d.ts +15 -2
- package/dist/protocol/handlers/shared.d.ts +3 -1
- package/dist/protocol/serializers/splits.d.ts +1 -1
- package/dist/protocol/types.d.ts +9 -3
- package/dist/schema-path.d.ts +7 -0
- package/dist/serve-entry.d.ts +22 -1
- package/dist/serve-entry.js +414 -243
- package/dist/serve-entry.js.map +28 -27
- package/dist/split-token.d.ts +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/worker-cf-entry.js +2033 -1210
- package/dist/worker-cf-entry.js.map +41 -37
- package/dist/worker.d.ts +1 -1
- package/package.json +3 -3
- package/src/arguments/argument-spec.ts +12 -4
- package/src/catalog/composite.ts +26 -26
- package/src/catalog/descriptors.ts +12 -3
- package/src/catalog/interface.ts +98 -48
- package/src/catalog/read-only.ts +125 -71
- package/src/client/client.ts +92 -72
- package/src/client/types.ts +2 -0
- package/src/client-entry.ts +2 -1
- package/src/filter-pushdown/capabilities.ts +13 -0
- package/src/filter-pushdown/collector.ts +22 -35
- package/src/filter-pushdown/deserialize.ts +657 -221
- package/src/filter-pushdown/evaluate.ts +410 -499
- package/src/filter-pushdown/index.ts +16 -2
- package/src/filter-pushdown/types.ts +88 -71
- package/src/functions/aggregate.ts +9 -1
- package/src/functions/registry.ts +24 -22
- package/src/functions/scalar.ts +26 -0
- package/src/functions/table-buffering.ts +46 -7
- package/src/functions/table-in-out.ts +187 -30
- package/src/functions/table.ts +58 -20
- package/src/functions/types.ts +24 -1
- package/src/generated/vgi-client.ts +62 -33
- package/src/generated/vgi-protocol-schemas.ts +226 -58
- package/src/http/client-bundle.ts +1 -1
- package/src/http/fetch.ts +12 -0
- package/src/index.core.ts +2 -0
- package/src/metadata/resolve.ts +43 -1
- package/src/metadata/serialize.ts +43 -5
- package/src/metadata/types.ts +17 -1
- package/src/protocol/dispatch.ts +1 -1
- package/src/protocol/handlers/aggregate.ts +13 -7
- package/src/protocol/handlers/catalog/admin.ts +6 -6
- package/src/protocol/handlers/catalog/index_methods.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +4 -4
- package/src/protocol/handlers/catalog/shared.ts +2 -0
- package/src/protocol/handlers/catalog/table.ts +16 -16
- package/src/protocol/handlers/catalog/view.ts +5 -5
- package/src/protocol/handlers/function.ts +2 -2
- package/src/protocol/handlers/shared.ts +12 -3
- package/src/protocol/handlers/table-buffering.ts +4 -4
- package/src/protocol/serializers/bind.ts +15 -6
- package/src/protocol/serializers/splits.ts +4 -2
- package/src/protocol/types.ts +9 -3
- package/src/schema-path.ts +25 -0
- package/src/serve-entry.ts +65 -3
- package/src/split-token.ts +2 -2
- package/src/types.ts +9 -0
- package/src/worker.ts +49 -4
package/dist/metadata/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionStability, NullHandling, OrderPreservation, OrderDependence, DistinctDependence } from "../types.js";
|
|
1
|
+
import { FunctionStability, NullHandling, ArgumentMonotonicity, OrderPreservation, OrderDependence, DistinctDependence } from "../types.js";
|
|
2
2
|
export declare enum CatalogFunctionType {
|
|
3
3
|
SCALAR = "SCALAR",
|
|
4
4
|
TABLE = "TABLE",
|
|
@@ -23,6 +23,15 @@ export interface FunctionExample {
|
|
|
23
23
|
description: string;
|
|
24
24
|
expectedOutput: string | null;
|
|
25
25
|
}
|
|
26
|
+
export interface FilterFunctionCapability {
|
|
27
|
+
namespace: string;
|
|
28
|
+
name: string;
|
|
29
|
+
version: number;
|
|
30
|
+
}
|
|
31
|
+
export interface EvaluationContextCapability {
|
|
32
|
+
profile: string;
|
|
33
|
+
providerFingerprint: string | null;
|
|
34
|
+
}
|
|
26
35
|
export interface ResolvedMetadata {
|
|
27
36
|
name: string;
|
|
28
37
|
className: string;
|
|
@@ -34,12 +43,16 @@ export interface ResolvedMetadata {
|
|
|
34
43
|
parameters: ParameterInfo[];
|
|
35
44
|
stability: FunctionStability;
|
|
36
45
|
nullHandling: NullHandling;
|
|
46
|
+
argumentMonotonicity: ArgumentMonotonicity[] | null;
|
|
37
47
|
requiredSettings: string[];
|
|
38
48
|
requiredSecrets: string[];
|
|
39
49
|
projectionPushdown: boolean;
|
|
40
50
|
filterPushdown: boolean;
|
|
41
51
|
samplingPushdown: boolean;
|
|
42
|
-
|
|
52
|
+
filterSemanticProfiles: string[];
|
|
53
|
+
additionalFilterFunctions: FilterFunctionCapability[];
|
|
54
|
+
runtimeFilterAlgorithms: FilterFunctionCapability[];
|
|
55
|
+
filterEvaluationContexts: EvaluationContextCapability[];
|
|
43
56
|
preservesOrder: OrderPreservation;
|
|
44
57
|
maxWorkers: number | null;
|
|
45
58
|
orderDependent: OrderDependence;
|
|
@@ -9,6 +9,8 @@ export declare const RESULT_BINARY_NULLABLE_SCHEMA: VgiSchema;
|
|
|
9
9
|
* and return flat columns as a dict (row 0).
|
|
10
10
|
*/
|
|
11
11
|
export declare function unwrapRequest(requestBytes: any): Record<string, any>;
|
|
12
|
+
/** Convert Arrow list scalars at RPC boundaries into ordinary string arrays. */
|
|
13
|
+
export declare function normalizeRequestSchemaPaths(params: Record<string, any>): void;
|
|
12
14
|
/**
|
|
13
15
|
* Wrap a dict of values into a single "result" Binary column.
|
|
14
16
|
* Builds a 1-row batch from the values using the given schema,
|
|
@@ -22,7 +24,7 @@ export declare function overloadContext(req: {
|
|
|
22
24
|
arguments: any;
|
|
23
25
|
input_schema: any;
|
|
24
26
|
function_type: any;
|
|
25
|
-
|
|
27
|
+
schema_path?: string[] | null;
|
|
26
28
|
attach_opaque_data?: Uint8Array | null;
|
|
27
29
|
}, catalogInterface?: {
|
|
28
30
|
catalogNameForAttach(a: Uint8Array): string | null;
|
|
@@ -115,7 +115,7 @@ export declare function deserializePlanRequest(params: Record<string, any>): Tab
|
|
|
115
115
|
* bytes are.
|
|
116
116
|
*/
|
|
117
117
|
export declare function fingerprintInputs(bindCallBytes: Uint8Array): {
|
|
118
|
-
|
|
118
|
+
schemaPath: string[];
|
|
119
119
|
functionName: string;
|
|
120
120
|
args: Uint8Array;
|
|
121
121
|
settings: Uint8Array;
|
package/dist/protocol/types.d.ts
CHANGED
|
@@ -76,11 +76,17 @@ export interface BindRequest {
|
|
|
76
76
|
/**
|
|
77
77
|
* Catalog schema that declares the function being bound. A worker may
|
|
78
78
|
* register the same name in more than one schema, so the bare name does not
|
|
79
|
-
* identify an implementation — resolution is by `(
|
|
79
|
+
* identify an implementation — resolution is by `(schema_path,
|
|
80
80
|
* function_name)`. Null for callers with no catalog context (COPY handler
|
|
81
|
-
* binds). Mirrors vgi-python's `BindRequest.
|
|
81
|
+
* binds). Mirrors vgi-python's `BindRequest.schema_path`.
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
schema_path?: string[] | null;
|
|
84
|
+
/**
|
|
85
|
+
* Resolved name for every logical argument, in complete call order. Fixed
|
|
86
|
+
* parameters carry their declared names, unnamed varargs carry `null`, and
|
|
87
|
+
* named varargs retain the caller-provided name. `null` means unavailable.
|
|
88
|
+
*/
|
|
89
|
+
argument_names?: (string | null)[] | null;
|
|
84
90
|
}
|
|
85
91
|
export interface BindResponse {
|
|
86
92
|
output_schema: VgiSchema;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Raw identifier components of a catalog schema, from root to leaf. */
|
|
2
|
+
export type SchemaPath = string[];
|
|
3
|
+
/** Case-insensitive key used for catalog lookup and function dispatch. */
|
|
4
|
+
export declare function normalizeSchemaPath(path: Iterable<unknown> | string): string[];
|
|
5
|
+
export declare function schemaPathKey(path: Iterable<unknown> | string): string;
|
|
6
|
+
export declare function schemaPathsEqual(left: Iterable<unknown> | string, right: Iterable<unknown> | string): boolean;
|
|
7
|
+
export declare function schemaPathDisplay(path: Iterable<unknown> | string): string;
|
package/dist/serve-entry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CatalogInterface } from "./catalog/interface.js";
|
|
2
2
|
import type { FunctionRegistry } from "./functions/registry.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type AuthenticateFn, type PeerResolutionOptions } from "@query-farm/vgi-rpc";
|
|
4
4
|
/** Environment variables `serveVgiWorker` reads. Injectable for testing. */
|
|
5
5
|
export interface ServeEnv {
|
|
6
6
|
PORT?: string;
|
|
@@ -12,6 +12,20 @@ export declare const DEFAULT_PORT = 8787;
|
|
|
12
12
|
export declare const DEFAULT_TOKEN_TTL = 3600;
|
|
13
13
|
/** Bytes of HMAC key `createHttpHandler` expects; 64 hex characters. */
|
|
14
14
|
export declare const SIGNING_KEY_BYTES = 32;
|
|
15
|
+
/** HTTP trust boundary for a colocated `vgi-iroh-bridge`. */
|
|
16
|
+
export interface IrohHttpBridgeOptions {
|
|
17
|
+
/** Worker-local namespace for EndpointId principals. */
|
|
18
|
+
issuer: string;
|
|
19
|
+
/** Exact bridge IP addresses. No CIDRs or hostnames. */
|
|
20
|
+
trustedProxyAddresses?: readonly string[];
|
|
21
|
+
/** Authenticate the EndpointId (default) or expose evidence only. */
|
|
22
|
+
authenticate?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Host-specific physical peer and raw-header adapter. Required because a
|
|
25
|
+
* Fetch Request alone does not preserve duplicate header fields.
|
|
26
|
+
*/
|
|
27
|
+
peerResolutionContext?: (request: Request) => PeerResolutionOptions | Promise<PeerResolutionOptions>;
|
|
28
|
+
}
|
|
15
29
|
export interface ServeVgiWorkerOptions {
|
|
16
30
|
/** Short worker name shown on the landing page, e.g. "ishares". */
|
|
17
31
|
name: string;
|
|
@@ -27,6 +41,8 @@ export interface ServeVgiWorkerOptions {
|
|
|
27
41
|
repositoryUrl?: string;
|
|
28
42
|
/** Overrides `$PORT` (default 8787). Pass 0 to bind an ephemeral port. */
|
|
29
43
|
port?: number;
|
|
44
|
+
/** Bind address. Iroh bridge mode defaults to loopback; otherwise Bun's default. */
|
|
45
|
+
hostname?: string;
|
|
30
46
|
/** Overrides `$VGI_SIGNING_KEY`. 32 bytes. */
|
|
31
47
|
signingKey?: Uint8Array;
|
|
32
48
|
/** Overrides `$VGI_TOKEN_TTL` (default 3600 seconds). */
|
|
@@ -44,12 +60,17 @@ export interface ServeVgiWorkerOptions {
|
|
|
44
60
|
/** Authenticates each request, returning the caller's `AuthContext`.
|
|
45
61
|
* Omit for an anonymous worker (the default). */
|
|
46
62
|
authenticate?: AuthenticateFn;
|
|
63
|
+
/** Preserve authenticated Iroh identity forwarded by an adjacent HTTP bridge. */
|
|
64
|
+
irohBridge?: IrohHttpBridgeOptions;
|
|
47
65
|
}
|
|
48
66
|
/** The slice of `Bun.serve`'s return value this module uses. */
|
|
49
67
|
export interface VgiHttpServer {
|
|
50
68
|
readonly port: number;
|
|
51
69
|
readonly url: URL;
|
|
52
70
|
stop(closeActiveConnections?: boolean): void;
|
|
71
|
+
requestIP?(request: Request): {
|
|
72
|
+
address: string;
|
|
73
|
+
} | null;
|
|
53
74
|
}
|
|
54
75
|
/**
|
|
55
76
|
* Decode a 32-byte signing key from its hex representation.
|