@query-farm/vgi-rpc 0.2.3 → 0.3.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.
- package/README.md +29 -11
- package/dist/client/introspect.d.ts +1 -1
- package/dist/client/introspect.d.ts.map +1 -1
- package/dist/client/ipc.d.ts +1 -1
- package/dist/client/ipc.d.ts.map +1 -1
- package/dist/client/pipe.d.ts +1 -1
- package/dist/client/pipe.d.ts.map +1 -1
- package/dist/client/stream.d.ts +1 -1
- package/dist/client/stream.d.ts.map +1 -1
- package/dist/dispatch/describe.d.ts +1 -1
- package/dist/dispatch/describe.d.ts.map +1 -1
- package/dist/dispatch/stream.d.ts.map +1 -1
- package/dist/http/common.d.ts +1 -1
- package/dist/http/common.d.ts.map +1 -1
- package/dist/http/dispatch.d.ts.map +1 -1
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -48
- package/dist/index.js.map +22 -22
- package/dist/schema.d.ts +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/util/schema.d.ts +1 -1
- package/dist/util/schema.d.ts.map +1 -1
- package/dist/wire/reader.d.ts +1 -1
- package/dist/wire/reader.d.ts.map +1 -1
- package/dist/wire/request.d.ts +1 -1
- package/dist/wire/request.d.ts.map +1 -1
- package/dist/wire/response.d.ts +1 -1
- package/dist/wire/response.d.ts.map +1 -1
- package/dist/wire/writer.d.ts +1 -1
- package/dist/wire/writer.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/client/connect.ts +1 -1
- package/src/client/introspect.ts +2 -2
- package/src/client/ipc.ts +1 -1
- package/src/client/pipe.ts +1 -1
- package/src/client/stream.ts +1 -1
- package/src/dispatch/describe.ts +1 -1
- package/src/dispatch/stream.ts +2 -3
- package/src/dispatch/unary.ts +1 -1
- package/src/http/common.ts +1 -1
- package/src/http/dispatch.ts +95 -35
- package/src/http/handler.ts +1 -1
- package/src/http/index.ts +2 -0
- package/src/index.ts +3 -0
- package/src/protocol.ts +1 -1
- package/src/schema.ts +1 -1
- package/src/server.ts +2 -2
- package/src/types.ts +1 -1
- package/src/util/schema.ts +1 -1
- package/src/wire/reader.ts +1 -1
- package/src/wire/request.ts +1 -1
- package/src/wire/response.ts +1 -1
- package/src/wire/writer.ts +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema, Field, DataType, Utf8, Binary, Int64, Int32, Float64, Float32, Bool } from "apache-arrow";
|
|
1
|
+
import { Schema, Field, DataType, Utf8, Binary, Int64, Int32, Float64, Float32, Bool } from "@query-farm/apache-arrow";
|
|
2
2
|
/** Apache Arrow Utf8 type. Use as schema shorthand: `{ name: str }` */
|
|
3
3
|
export declare const str: Utf8;
|
|
4
4
|
/** Apache Arrow Binary type. Use as schema shorthand: `{ data: bytes }` */
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EAEL,OAAO,EACP,OAAO,EACP,IAAI,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EAEL,OAAO,EACP,OAAO,EACP,IAAI,EACL,MAAM,0BAA0B,CAAC;AAMlC,uEAAuE;AACvE,eAAO,MAAM,GAAG,MAAa,CAAC;AAC9B,2EAA2E;AAC3E,eAAO,MAAM,KAAK,QAAe,CAAC;AAClC,yEAAyE;AACzE,eAAO,MAAM,GAAG,OAAc,CAAC;AAC/B,2EAA2E;AAC3E,eAAO,MAAM,KAAK,OAAc,CAAC;AACjC,6EAA6E;AAC7E,eAAO,MAAM,KAAK,SAAgB,CAAC;AACnC,+EAA+E;AAC/E,eAAO,MAAM,OAAO,SAAgB,CAAC;AACrC,wEAAwE;AACxE,eAAO,MAAM,IAAI,MAAa,CAAC;AAM/B;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAgBjD;AAiBD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAiBpC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAczC;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAczC;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAA+D;gBAGlF,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAiB3D,gEAAgE;IAC1D,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAwCZ,QAAQ;CAsEvB"}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,WAAW,EAAyB,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,WAAW,EAAyB,MAAM,0BAA0B,CAAC;AAG3F,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CACjF;AAED,wDAAwD;AACxD,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,GAAG,EAAE,UAAU,KACZ,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAExD,sFAAsF;AACtF,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACxB,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACpB,0FAA0F;AAC1F,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,IAAI,CAChC,KA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@@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/util/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/util/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEhF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAQ1D"}
|
package/dist/wire/reader.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/wire/reader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/wire/reader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAE5F,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,WAAW,CAAS;IAC5B,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO;WAIM,MAAM,CACjB,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,cAAc,GACxD,OAAO,CAAC,eAAe,CAAC;IAS3B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IA2BjD;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAY9C;;;;;;;OAOG;IACG,aAAa,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAiB5C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
|
package/dist/wire/request.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/wire/request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/wire/request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASnF,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,WAAW,GACjB,aAAa,CAqEf"}
|
package/dist/wire/response.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RecordBatch, Schema } from "apache-arrow";
|
|
1
|
+
import { RecordBatch, Schema } from "@query-farm/apache-arrow";
|
|
2
2
|
/**
|
|
3
3
|
* Coerce values for Int64 schema fields from Number to BigInt.
|
|
4
4
|
* Handles both single values and arrays. Returns a new record with coerced values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/wire/response.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,MAAM,EAOP,MAAM,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/wire/response.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,MAAM,EAOP,MAAM,0BAA0B,CAAC;AASlC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAc5F;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,WAAW,CA0Cb;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,WAAW,CAiBb;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,WAAW,CAeb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,WAAW,CAyBb"}
|
package/dist/wire/writer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RecordBatch, type Schema } from "apache-arrow";
|
|
1
|
+
import { type RecordBatch, type Schema } from "@query-farm/apache-arrow";
|
|
2
2
|
/**
|
|
3
3
|
* Writes sequential IPC streams to a file descriptor (e.g., stdout).
|
|
4
4
|
* Each call to writeStream() writes a complete IPC stream: schema + batches + EOS.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/wire/writer.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/wire/writer.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,0BAA0B,CAAC;AA6BlC;;;;;;GAMG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;gBAEhB,EAAE,GAAE,MAAkB;IAIlC;;;OAGG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI;IAYzD;;;;OAIG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;CAG9C;AAED;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAS;gBAEX,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQtC;;;;;;;;;OASG;IACH,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAM/B;;OAEG;IACH,KAAK,IAAI,IAAI;IAQb;;;OAGG;IACH,OAAO,CAAC,KAAK;CAOd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@query-farm/vgi-rpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://vgi-rpc-typescript.query.farm",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"apache-arrow": "
|
|
25
|
+
"@query-farm/apache-arrow": "*"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/bun": "latest"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "bun run build:types && bun run build:js",
|
|
32
32
|
"build:types": "bunx tsc -p tsconfig.build.json",
|
|
33
|
-
"build:js": "bun build ./src/index.ts --outdir dist --target node --format esm --sourcemap=external --external apache-arrow",
|
|
34
|
-
"postinstall": "cd node_modules/apache-arrow && node -e \"const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));p.main='
|
|
33
|
+
"build:js": "bun build ./src/index.ts --outdir dist --target node --format esm --sourcemap=external --external @query-farm/apache-arrow",
|
|
34
|
+
"postinstall": "cd node_modules/@query-farm/apache-arrow && node -e \"const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));p.main='src/Arrow.node.ts';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/client/connect.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { RecordBatch, Schema } from "apache-arrow";
|
|
4
|
+
import { RecordBatch, Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import { STATE_KEY, LOG_LEVEL_KEY, DESCRIBE_METHOD_NAME } from "../constants.js";
|
|
6
6
|
import { ARROW_CONTENT_TYPE } from "../http/common.js";
|
|
7
7
|
import {
|
package/src/client/introspect.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { RecordBatchReader, RecordBatch, type Schema } from "apache-arrow";
|
|
4
|
+
import { RecordBatchReader, RecordBatch, type Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import {
|
|
6
6
|
DESCRIBE_METHOD_NAME,
|
|
7
7
|
PROTOCOL_NAME_KEY,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "../constants.js";
|
|
10
10
|
import { ARROW_CONTENT_TYPE } from "../http/common.js";
|
|
11
11
|
import { buildRequestIpc, readResponseBatches, dispatchLogOrError } from "./ipc.js";
|
|
12
|
-
import { Schema as ArrowSchema } from "apache-arrow";
|
|
12
|
+
import { Schema as ArrowSchema } from "@query-farm/apache-arrow";
|
|
13
13
|
import type { LogMessage } from "./types.js";
|
|
14
14
|
|
|
15
15
|
export interface MethodInfo {
|
package/src/client/ipc.ts
CHANGED
package/src/client/pipe.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Struct,
|
|
10
10
|
makeData,
|
|
11
11
|
vectorFromArray,
|
|
12
|
-
} from "apache-arrow";
|
|
12
|
+
} from "@query-farm/apache-arrow";
|
|
13
13
|
import { DESCRIBE_METHOD_NAME } from "../constants.js";
|
|
14
14
|
import { serializeIpcStream } from "../http/common.js";
|
|
15
15
|
import { IpcStreamReader } from "../wire/reader.js";
|
package/src/client/stream.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
makeData,
|
|
9
9
|
Struct,
|
|
10
10
|
vectorFromArray,
|
|
11
|
-
} from "apache-arrow";
|
|
11
|
+
} from "@query-farm/apache-arrow";
|
|
12
12
|
import { STATE_KEY } from "../constants.js";
|
|
13
13
|
import { RpcError } from "../errors.js";
|
|
14
14
|
import { ARROW_CONTENT_TYPE, serializeIpcStream } from "../http/common.js";
|
package/src/dispatch/describe.ts
CHANGED
package/src/dispatch/stream.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Schema } from "apache-arrow";
|
|
4
|
+
import { Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import type { MethodDefinition } from "../types.js";
|
|
6
6
|
import { OutputCollector } from "../types.js";
|
|
7
7
|
import type { IpcStreamWriter } from "../wire/writer.js";
|
|
@@ -33,8 +33,7 @@ export async function dispatchStream(
|
|
|
33
33
|
serverId: string,
|
|
34
34
|
requestId: string | null,
|
|
35
35
|
): Promise<void> {
|
|
36
|
-
const isProducer =
|
|
37
|
-
!method.inputSchema || method.inputSchema.fields.length === 0;
|
|
36
|
+
const isProducer = !!method.producerFn;
|
|
38
37
|
|
|
39
38
|
let state: any;
|
|
40
39
|
try {
|
package/src/dispatch/unary.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Schema } from "apache-arrow";
|
|
4
|
+
import { Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import type { MethodDefinition } from "../types.js";
|
|
6
6
|
import { OutputCollector } from "../types.js";
|
|
7
7
|
import type { IpcStreamWriter } from "../wire/writer.js";
|
package/src/http/common.ts
CHANGED
package/src/http/dispatch.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Schema, RecordBatch } from "apache-arrow";
|
|
4
|
+
import { Schema, RecordBatch, RecordBatchReader } from "@query-farm/apache-arrow";
|
|
5
5
|
import type { MethodDefinition } from "../types.js";
|
|
6
6
|
import { OutputCollector } from "../types.js";
|
|
7
7
|
import { parseRequest } from "../wire/request.js";
|
|
@@ -22,6 +22,12 @@ import {
|
|
|
22
22
|
import { packStateToken, unpackStateToken } from "./token.js";
|
|
23
23
|
import type { StateSerializer } from "./types.js";
|
|
24
24
|
|
|
25
|
+
async function deserializeSchema(bytes: Uint8Array): Promise<Schema> {
|
|
26
|
+
const reader = await RecordBatchReader.from(bytes);
|
|
27
|
+
await reader.open();
|
|
28
|
+
return reader.schema!;
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
const EMPTY_SCHEMA = new Schema([]);
|
|
26
32
|
|
|
27
33
|
export interface DispatchContext {
|
|
@@ -79,8 +85,7 @@ export async function httpDispatchStreamInit(
|
|
|
79
85
|
body: Uint8Array,
|
|
80
86
|
ctx: DispatchContext,
|
|
81
87
|
): Promise<Response> {
|
|
82
|
-
const isProducer =
|
|
83
|
-
!method.inputSchema || method.inputSchema.fields.length === 0;
|
|
88
|
+
const isProducer = !!method.producerFn;
|
|
84
89
|
const outputSchema = method.outputSchema!;
|
|
85
90
|
const inputSchema = method.inputSchema ?? EMPTY_SCHEMA;
|
|
86
91
|
|
|
@@ -146,6 +151,9 @@ export async function httpDispatchStreamInit(
|
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
if (effectiveProducer) {
|
|
154
|
+
// Producer method — produce data inline in the init response.
|
|
155
|
+
// For exchange-registered methods acting as producers (__isProducer),
|
|
156
|
+
// produceStreamResponse falls back to exchangeFn with tick batches.
|
|
149
157
|
return produceStreamResponse(
|
|
150
158
|
method,
|
|
151
159
|
state,
|
|
@@ -189,8 +197,7 @@ export async function httpDispatchStreamExchange(
|
|
|
189
197
|
body: Uint8Array,
|
|
190
198
|
ctx: DispatchContext,
|
|
191
199
|
): Promise<Response> {
|
|
192
|
-
const isProducer =
|
|
193
|
-
!method.inputSchema || method.inputSchema.fields.length === 0;
|
|
200
|
+
const isProducer = !!method.producerFn;
|
|
194
201
|
|
|
195
202
|
const { batch: reqBatch } = await readRequestFromBody(body);
|
|
196
203
|
|
|
@@ -207,14 +214,34 @@ export async function httpDispatchStreamExchange(
|
|
|
207
214
|
throw new HttpRpcError(`Invalid state token: ${error.message}`, 400);
|
|
208
215
|
}
|
|
209
216
|
|
|
210
|
-
|
|
217
|
+
let state: any;
|
|
218
|
+
try {
|
|
219
|
+
state = ctx.stateSerializer.deserialize(unpacked.stateBytes);
|
|
220
|
+
} catch (error: any) {
|
|
221
|
+
console.error(`[httpDispatchStreamExchange] state deserialize error:`, error.message);
|
|
222
|
+
throw new HttpRpcError(`State deserialization failed: ${error.message}`, 500);
|
|
223
|
+
}
|
|
211
224
|
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
225
|
+
// Recover schemas from the token (the state itself may not contain
|
|
226
|
+
// Schema objects after JSON round-trip — always prefer the token).
|
|
227
|
+
let outputSchema: Schema;
|
|
228
|
+
if (unpacked.schemaBytes.length > 0) {
|
|
229
|
+
outputSchema = await deserializeSchema(unpacked.schemaBytes);
|
|
230
|
+
} else {
|
|
231
|
+
outputSchema = state?.__outputSchema ?? method.outputSchema!;
|
|
232
|
+
}
|
|
233
|
+
let inputSchema: Schema;
|
|
234
|
+
if (unpacked.inputSchemaBytes.length > 0) {
|
|
235
|
+
inputSchema = await deserializeSchema(unpacked.inputSchemaBytes);
|
|
236
|
+
} else {
|
|
237
|
+
inputSchema = method.inputSchema ?? EMPTY_SCHEMA;
|
|
238
|
+
}
|
|
215
239
|
const effectiveProducer = state?.__isProducer ?? isProducer;
|
|
240
|
+
if (process.env.VGI_DISPATCH_DEBUG) console.error(`[httpDispatchStreamExchange] method=${method.name} effectiveProducer=${effectiveProducer} stateKeys=${Object.keys(state || {})}`);
|
|
216
241
|
|
|
217
242
|
if (effectiveProducer) {
|
|
243
|
+
// Producer continuation — produce more data inline.
|
|
244
|
+
// For exchange-registered methods, falls back to exchangeFn with tick batches.
|
|
218
245
|
return produceStreamResponse(
|
|
219
246
|
method,
|
|
220
247
|
state,
|
|
@@ -225,39 +252,62 @@ export async function httpDispatchStreamExchange(
|
|
|
225
252
|
null,
|
|
226
253
|
);
|
|
227
254
|
} else {
|
|
228
|
-
|
|
255
|
+
// Exchange path — also handles exchange-registered methods acting as
|
|
256
|
+
// producers (__isProducer=true). Use producer mode on the OutputCollector
|
|
257
|
+
// when effectiveProducer so finish() is allowed.
|
|
258
|
+
const out = new OutputCollector(outputSchema, effectiveProducer, ctx.serverId, null);
|
|
229
259
|
|
|
230
260
|
try {
|
|
231
|
-
|
|
261
|
+
if (method.exchangeFn) {
|
|
262
|
+
await method.exchangeFn(state, reqBatch, out);
|
|
263
|
+
} else {
|
|
264
|
+
await method.producerFn!(state, out);
|
|
265
|
+
}
|
|
232
266
|
} catch (error: any) {
|
|
267
|
+
if (process.env.VGI_DISPATCH_DEBUG) console.error(`[httpDispatchStreamExchange] exchange handler error:`, error.message, error.stack?.split('\n').slice(0,5).join('\n'));
|
|
233
268
|
const errBatch = buildErrorBatch(outputSchema, error, ctx.serverId, null);
|
|
234
269
|
return arrowResponse(serializeIpcStream(outputSchema, [errBatch]), 500);
|
|
235
270
|
}
|
|
236
271
|
|
|
237
|
-
//
|
|
238
|
-
const stateBytes = ctx.stateSerializer.serialize(state);
|
|
239
|
-
const schemaBytes = serializeSchema(outputSchema);
|
|
240
|
-
const inputSchemaBytes = serializeSchema(inputSchema);
|
|
241
|
-
const token = packStateToken(
|
|
242
|
-
stateBytes,
|
|
243
|
-
schemaBytes,
|
|
244
|
-
inputSchemaBytes,
|
|
245
|
-
ctx.signingKey,
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
// Merge token into the data batch's metadata (matching Python behavior).
|
|
249
|
-
// The Python client expects the token on the data batch itself, not a
|
|
250
|
-
// separate zero-row batch.
|
|
272
|
+
// Collect emitted batches
|
|
251
273
|
const batches: RecordBatch[] = [];
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
274
|
+
|
|
275
|
+
if (out.finished) {
|
|
276
|
+
// Stream is done — return data WITHOUT state token.
|
|
277
|
+
// The absence of a token tells the client there's no more data.
|
|
278
|
+
for (const emitted of out.batches) {
|
|
279
|
+
batches.push(emitted.batch);
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
// More data may follow — repack state into token for next exchange.
|
|
283
|
+
const stateBytes = ctx.stateSerializer.serialize(state);
|
|
284
|
+
const schemaBytes = serializeSchema(outputSchema);
|
|
285
|
+
const inputSchemaBytes = serializeSchema(inputSchema);
|
|
286
|
+
const token = packStateToken(
|
|
287
|
+
stateBytes,
|
|
288
|
+
schemaBytes,
|
|
289
|
+
inputSchemaBytes,
|
|
290
|
+
ctx.signingKey,
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
for (const emitted of out.batches) {
|
|
294
|
+
const batch = emitted.batch;
|
|
295
|
+
if (batch.numRows > 0) {
|
|
296
|
+
const mergedMeta = new Map<string, string>(batch.metadata ?? []);
|
|
297
|
+
mergedMeta.set(STATE_KEY, token);
|
|
298
|
+
batches.push(new RecordBatch(batch.schema, batch.data, mergedMeta));
|
|
299
|
+
} else {
|
|
300
|
+
batches.push(batch);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Safety net: if no batch carries a state token (e.g. all rows were
|
|
305
|
+
// filtered out by pushdown filters), emit an empty batch with the
|
|
306
|
+
// token so the client knows to continue exchanging.
|
|
307
|
+
if (!batches.some(b => b.metadata?.get(STATE_KEY))) {
|
|
308
|
+
const tokenMeta = new Map<string, string>();
|
|
309
|
+
tokenMeta.set(STATE_KEY, token);
|
|
310
|
+
batches.push(buildEmptyBatch(outputSchema, tokenMeta));
|
|
261
311
|
}
|
|
262
312
|
}
|
|
263
313
|
|
|
@@ -283,8 +333,18 @@ async function produceStreamResponse(
|
|
|
283
333
|
const out = new OutputCollector(outputSchema, true, ctx.serverId, requestId);
|
|
284
334
|
|
|
285
335
|
try {
|
|
286
|
-
|
|
336
|
+
if (method.producerFn) {
|
|
337
|
+
await method.producerFn(state, out);
|
|
338
|
+
} else {
|
|
339
|
+
// Exchange-registered method acting as producer (e.g. VGI's "init"
|
|
340
|
+
// method which is registered as exchange but may produce based on
|
|
341
|
+
// the __isProducer state flag). Call exchangeFn with an empty tick
|
|
342
|
+
// batch, matching how the subprocess transport dispatches these.
|
|
343
|
+
const tickBatch = buildEmptyBatch(inputSchema);
|
|
344
|
+
await method.exchangeFn!(state, tickBatch, out);
|
|
345
|
+
}
|
|
287
346
|
} catch (error: any) {
|
|
347
|
+
if (process.env.VGI_DISPATCH_DEBUG) console.error(`[produceStreamResponse] error:`, error.message, error.stack?.split('\n').slice(0,3).join('\n'));
|
|
288
348
|
allBatches.push(buildErrorBatch(outputSchema, error, ctx.serverId, requestId));
|
|
289
349
|
break;
|
|
290
350
|
}
|
package/src/http/handler.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Schema } from "apache-arrow";
|
|
4
|
+
import { Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|
|
6
6
|
import type { Protocol } from "../protocol.js";
|
|
7
7
|
import { MethodType } from "../types.js";
|
package/src/http/index.ts
CHANGED
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
export { createHttpHandler } from "./handler.js";
|
|
5
5
|
export type { HttpHandlerOptions, StateSerializer } from "./types.js";
|
|
6
|
+
export { jsonStateSerializer } from "./types.js";
|
|
6
7
|
export { ARROW_CONTENT_TYPE } from "./common.js";
|
|
8
|
+
export { unpackStateToken, type UnpackedToken } from "./token.js";
|
package/src/index.ts
CHANGED
package/src/protocol.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Schema } from "apache-arrow";
|
|
4
|
+
import { Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import { type SchemaLike, toSchema, inferParamTypes } from "./schema.js";
|
|
6
6
|
import {
|
|
7
7
|
MethodType,
|
package/src/schema.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Float64,
|
|
14
14
|
Float32,
|
|
15
15
|
Bool,
|
|
16
|
-
} from "apache-arrow";
|
|
16
|
+
} from "@query-farm/apache-arrow";
|
|
17
17
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// Convenient DataType singletons — re-export so users avoid arrow imports
|
package/src/server.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Schema } from "apache-arrow";
|
|
4
|
+
import { Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
import { Protocol } from "./protocol.js";
|
|
6
6
|
import { IpcStreamReader } from "./wire/reader.js";
|
|
7
7
|
import { IpcStreamWriter } from "./wire/writer.js";
|
|
@@ -24,7 +24,7 @@ export class VgiRpcServer {
|
|
|
24
24
|
private protocol: Protocol;
|
|
25
25
|
private enableDescribe: boolean;
|
|
26
26
|
private serverId: string;
|
|
27
|
-
private describeBatch: import("apache-arrow").RecordBatch | null = null;
|
|
27
|
+
private describeBatch: import("@query-farm/apache-arrow").RecordBatch | null = null;
|
|
28
28
|
|
|
29
29
|
constructor(
|
|
30
30
|
protocol: Protocol,
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { type Schema, RecordBatch, recordBatchFromArrays } from "apache-arrow";
|
|
4
|
+
import { type Schema, RecordBatch, recordBatchFromArrays } from "@query-farm/apache-arrow";
|
|
5
5
|
import { buildLogBatch, coerceInt64 } from "./wire/response.js";
|
|
6
6
|
|
|
7
7
|
export enum MethodType {
|
package/src/util/schema.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { RecordBatchStreamWriter, type Schema } from "apache-arrow";
|
|
4
|
+
import { RecordBatchStreamWriter, type Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Serialize a Schema to the Arrow IPC Schema message format.
|
package/src/wire/reader.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { RecordBatchReader, type RecordBatch, type Schema } from "apache-arrow";
|
|
4
|
+
import { RecordBatchReader, type RecordBatch, type Schema } from "@query-farm/apache-arrow";
|
|
5
5
|
|
|
6
6
|
export interface StreamMessage {
|
|
7
7
|
schema: Schema;
|
package/src/wire/request.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// © Copyright 2025-2026, Query.Farm LLC - https://query.farm
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { DataType, type Schema, type RecordBatch } from "apache-arrow";
|
|
4
|
+
import { DataType, type Schema, type RecordBatch } from "@query-farm/apache-arrow";
|
|
5
5
|
import {
|
|
6
6
|
RPC_METHOD_KEY,
|
|
7
7
|
REQUEST_VERSION_KEY,
|
package/src/wire/response.ts
CHANGED