@forthix/forthic 0.10.0 → 0.11.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/cjs/common/runtime_client.d.ts +30 -0
- package/dist/cjs/common/runtime_client.js +10 -0
- package/dist/cjs/common/runtime_client.js.map +1 -0
- package/dist/cjs/common/type_utils.d.ts +7 -1
- package/dist/cjs/common/type_utils.js +13 -2
- package/dist/cjs/common/type_utils.js.map +1 -1
- package/dist/cjs/forthic/interpreter.js +4 -3
- package/dist/cjs/forthic/interpreter.js.map +1 -1
- package/dist/cjs/forthic/modules/standard/classic/classic_module.d.ts +56 -0
- package/dist/cjs/forthic/modules/standard/classic/classic_module.js +616 -0
- package/dist/cjs/forthic/modules/standard/classic/classic_module.js.map +1 -0
- package/dist/cjs/grpc/config_loader.d.ts +3 -0
- package/dist/cjs/grpc/config_loader.js +5 -0
- package/dist/cjs/grpc/config_loader.js.map +1 -1
- package/dist/cjs/grpc/remote_module.d.ts +3 -3
- package/dist/cjs/grpc/remote_module.js +1 -1
- package/dist/cjs/grpc/remote_module.js.map +1 -1
- package/dist/cjs/grpc/remote_word.d.ts +3 -3
- package/dist/cjs/grpc/remote_word.js +1 -1
- package/dist/cjs/grpc/remote_word.js.map +1 -1
- package/dist/cjs/grpc/runtime_manager.d.ts +5 -4
- package/dist/cjs/grpc/runtime_manager.js +2 -2
- package/dist/cjs/grpc/runtime_manager.js.map +1 -1
- package/dist/cjs/grpc/serializer.d.ts +2 -2
- package/dist/cjs/grpc/serializer.js +11 -10
- package/dist/cjs/grpc/serializer.js.map +1 -1
- package/dist/cjs/jsonrpc/browser-stub.d.ts +8 -0
- package/dist/cjs/jsonrpc/browser-stub.js +18 -0
- package/dist/cjs/jsonrpc/browser-stub.js.map +1 -0
- package/dist/cjs/jsonrpc/client.d.ts +31 -0
- package/dist/cjs/jsonrpc/client.js +98 -0
- package/dist/cjs/jsonrpc/client.js.map +1 -0
- package/dist/cjs/jsonrpc/errors.d.ts +18 -0
- package/dist/cjs/jsonrpc/errors.js +23 -0
- package/dist/cjs/jsonrpc/errors.js.map +1 -0
- package/dist/cjs/jsonrpc/index.d.ts +16 -0
- package/dist/cjs/jsonrpc/index.js +26 -0
- package/dist/cjs/jsonrpc/index.js.map +1 -0
- package/dist/cjs/jsonrpc/serializer.d.ts +8 -0
- package/dist/cjs/jsonrpc/serializer.js +14 -0
- package/dist/cjs/jsonrpc/serializer.js.map +1 -0
- package/dist/cjs/jsonrpc/server.d.ts +15 -0
- package/dist/cjs/jsonrpc/server.js +386 -0
- package/dist/cjs/jsonrpc/server.js.map +1 -0
- package/dist/cjs/websocket/serializer.d.ts +4 -4
- package/dist/cjs/websocket/serializer.js +15 -14
- package/dist/cjs/websocket/serializer.js.map +1 -1
- package/dist/esm/common/runtime_client.d.ts +30 -0
- package/dist/esm/common/runtime_client.js +9 -0
- package/dist/esm/common/runtime_client.js.map +1 -0
- package/dist/esm/common/type_utils.d.ts +7 -1
- package/dist/esm/common/type_utils.js +12 -2
- package/dist/esm/common/type_utils.js.map +1 -1
- package/dist/esm/forthic/interpreter.js +4 -3
- package/dist/esm/forthic/interpreter.js.map +1 -1
- package/dist/esm/forthic/modules/standard/classic/classic_module.d.ts +56 -0
- package/dist/esm/forthic/modules/standard/classic/classic_module.js +500 -0
- package/dist/esm/forthic/modules/standard/classic/classic_module.js.map +1 -0
- package/dist/esm/grpc/config_loader.d.ts +3 -0
- package/dist/esm/grpc/config_loader.js +5 -0
- package/dist/esm/grpc/config_loader.js.map +1 -1
- package/dist/esm/grpc/remote_module.d.ts +3 -3
- package/dist/esm/grpc/remote_module.js +1 -1
- package/dist/esm/grpc/remote_module.js.map +1 -1
- package/dist/esm/grpc/remote_word.d.ts +3 -3
- package/dist/esm/grpc/remote_word.js +1 -1
- package/dist/esm/grpc/remote_word.js.map +1 -1
- package/dist/esm/grpc/runtime_manager.d.ts +5 -4
- package/dist/esm/grpc/runtime_manager.js +2 -2
- package/dist/esm/grpc/runtime_manager.js.map +1 -1
- package/dist/esm/grpc/serializer.d.ts +2 -2
- package/dist/esm/grpc/serializer.js +12 -11
- package/dist/esm/grpc/serializer.js.map +1 -1
- package/dist/esm/jsonrpc/browser-stub.d.ts +8 -0
- package/dist/esm/jsonrpc/browser-stub.js +12 -0
- package/dist/esm/jsonrpc/browser-stub.js.map +1 -0
- package/dist/esm/jsonrpc/client.d.ts +31 -0
- package/dist/esm/jsonrpc/client.js +94 -0
- package/dist/esm/jsonrpc/client.js.map +1 -0
- package/dist/esm/jsonrpc/errors.d.ts +18 -0
- package/dist/esm/jsonrpc/errors.js +18 -0
- package/dist/esm/jsonrpc/errors.js.map +1 -0
- package/dist/esm/jsonrpc/index.d.ts +16 -0
- package/dist/esm/jsonrpc/index.js +16 -0
- package/dist/esm/jsonrpc/index.js.map +1 -0
- package/dist/esm/jsonrpc/serializer.d.ts +8 -0
- package/dist/esm/jsonrpc/serializer.js +9 -0
- package/dist/esm/jsonrpc/serializer.js.map +1 -0
- package/dist/esm/jsonrpc/server.d.ts +15 -0
- package/dist/esm/jsonrpc/server.js +349 -0
- package/dist/esm/jsonrpc/server.js.map +1 -0
- package/dist/esm/websocket/serializer.d.ts +4 -4
- package/dist/esm/websocket/serializer.js +16 -15
- package/dist/esm/websocket/serializer.js.map +1 -1
- package/package.json +15 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_loader.js","sourceRoot":"","sources":["../../../src/grpc/config_loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,gDAAwB;
|
|
1
|
+
{"version":3,"file":"config_loader.js","sourceRoot":"","sources":["../../../src/grpc/config_loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,gDAAwB;AA+BxB;;GA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ACnC,IAAI,QAAQ,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,OAAO,QAAQ,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,oBAAoB;QACzB,MAAM,YAAY,GAAG;YACnB,yBAAyB;YACzB,wBAAwB;YACxB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,uBAAuB,CAAC;YACjD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,sBAAsB,CAAC;SACjD,CAAC;QAEF,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;YACtC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA9KD,oCA8KC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Module } from '../forthic/module.js';
|
|
5
5
|
import { Interpreter } from '../forthic/interpreter.js';
|
|
6
|
-
import {
|
|
6
|
+
import type { RuntimeClient, GetModuleInfoResponse } from '../common/runtime_client.js';
|
|
7
7
|
/**
|
|
8
8
|
* RemoteModule - Module containing proxy words that execute in a remote runtime
|
|
9
9
|
*
|
|
@@ -32,10 +32,10 @@ export declare class RemoteModule extends Module {
|
|
|
32
32
|
private moduleInfo;
|
|
33
33
|
/**
|
|
34
34
|
* @param moduleName - Name of the module in the remote runtime (e.g., "pandas")
|
|
35
|
-
* @param client -
|
|
35
|
+
* @param client - Transport client (gRPC or JSON-RPC) connected to the remote runtime
|
|
36
36
|
* @param runtimeName - Name of the runtime (e.g., "python") for debugging
|
|
37
37
|
*/
|
|
38
|
-
constructor(moduleName: string, client:
|
|
38
|
+
constructor(moduleName: string, client: RuntimeClient, runtimeName?: string);
|
|
39
39
|
/**
|
|
40
40
|
* Initialize the module by discovering words from the remote runtime
|
|
41
41
|
*
|
|
@@ -34,7 +34,7 @@ class RemoteModule extends module_js_1.Module {
|
|
|
34
34
|
moduleInfo = null;
|
|
35
35
|
/**
|
|
36
36
|
* @param moduleName - Name of the module in the remote runtime (e.g., "pandas")
|
|
37
|
-
* @param client -
|
|
37
|
+
* @param client - Transport client (gRPC or JSON-RPC) connected to the remote runtime
|
|
38
38
|
* @param runtimeName - Name of the runtime (e.g., "python") for debugging
|
|
39
39
|
*/
|
|
40
40
|
constructor(moduleName, client, runtimeName = 'remote') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote_module.js","sourceRoot":"","sources":["../../../src/grpc/remote_module.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oDAA8C;AAG9C,qDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,YAAa,SAAQ,kBAAM;IAC9B,MAAM,
|
|
1
|
+
{"version":3,"file":"remote_module.js","sourceRoot":"","sources":["../../../src/grpc/remote_module.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oDAA8C;AAG9C,qDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,YAAa,SAAQ,kBAAM;IAC9B,MAAM,CAAgB;IACtB,WAAW,CAAS;IACpB,WAAW,GAAY,KAAK,CAAC;IAC7B,UAAU,GAAiC,IAAI,CAAC;IAExD;;;;OAIG;IACH,YAAY,UAAkB,EAAE,MAAqB,EAAE,cAAsB,QAAQ;QACnF,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU;QACd,IAAI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ED;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF;AA9FD,oCA8FC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Word, RuntimeInfo } from '../forthic/module.js';
|
|
5
5
|
import { Interpreter } from '../forthic/interpreter.js';
|
|
6
|
-
import {
|
|
6
|
+
import type { RuntimeClient } from '../common/runtime_client.js';
|
|
7
7
|
/**
|
|
8
8
|
* RemoteWord - Proxy word that delegates execution to a remote runtime
|
|
9
9
|
*
|
|
@@ -23,13 +23,13 @@ export declare class RemoteWord extends Word {
|
|
|
23
23
|
description: string;
|
|
24
24
|
/**
|
|
25
25
|
* @param name - Word name (e.g., "DF_FROM_RECORDS")
|
|
26
|
-
* @param client -
|
|
26
|
+
* @param client - Transport client (gRPC or JSON-RPC) connected to remote runtime
|
|
27
27
|
* @param runtimeName - Name of remote runtime (e.g., "python")
|
|
28
28
|
* @param moduleName - Module name (e.g., "pandas")
|
|
29
29
|
* @param stackEffect - Stack notation (e.g., "( records:array -- df:DataFrame )")
|
|
30
30
|
* @param description - Human-readable description
|
|
31
31
|
*/
|
|
32
|
-
constructor(name: string, client:
|
|
32
|
+
constructor(name: string, client: RuntimeClient, runtimeName: string, moduleName: string, stackEffect?: string, description?: string);
|
|
33
33
|
/**
|
|
34
34
|
* Execute word in remote runtime
|
|
35
35
|
*
|
|
@@ -24,7 +24,7 @@ class RemoteWord extends module_js_1.Word {
|
|
|
24
24
|
description;
|
|
25
25
|
/**
|
|
26
26
|
* @param name - Word name (e.g., "DF_FROM_RECORDS")
|
|
27
|
-
* @param client -
|
|
27
|
+
* @param client - Transport client (gRPC or JSON-RPC) connected to remote runtime
|
|
28
28
|
* @param runtimeName - Name of remote runtime (e.g., "python")
|
|
29
29
|
* @param moduleName - Module name (e.g., "pandas")
|
|
30
30
|
* @param stackEffect - Stack notation (e.g., "( records:array -- df:DataFrame )")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote_word.js","sourceRoot":"","sources":["../../../src/grpc/remote_word.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oDAAyD;AAIzD;;;;;;;;;;GAUG;AACH,MAAa,UAAW,SAAQ,gBAAI;IAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"remote_word.js","sourceRoot":"","sources":["../../../src/grpc/remote_word.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oDAAyD;AAIzD;;;;;;;;;;GAUG;AACH,MAAa,UAAW,SAAQ,gBAAI;IAC1B,MAAM,CAAgB;IACtB,WAAW,CAAS;IACpB,UAAU,CAAS;IACpB,WAAW,CAAS;IACpB,WAAW,CAAS;IAE3B;;;;;;;OAOG;IACH,YACE,IAAY,EACZ,MAAqB,EACrB,WAAmB,EACnB,UAAkB,EAClB,cAAsB,QAAQ,EAC9B,cAAsB,EAAE;QAExB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,MAAmB;QAC/B,IAAI,CAAC;YACH,8BAA8B;YAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;YACjC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;YAErC,iCAAiC;YACjC,yEAAyE;YACzE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAEzE,4CAA4C;YAC5C,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACrC,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,CAAC;YAED,wBAAwB;YACxB,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;gBAC/B,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,+BAA+B,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,WAAW,aAAc,KAAe,CAAC,OAAO,EAAE,CAC1H,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,cAAc;QACZ,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,WAAW;YACzB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;SAChC,CAAC;IACJ,CAAC;CACF;AAzFD,gCAyFC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Used by DefinitionWord for batched remote execution.
|
|
6
6
|
*/
|
|
7
7
|
import { GrpcClient } from './client.js';
|
|
8
|
+
import type { RuntimeClient } from '../common/runtime_client.js';
|
|
8
9
|
/**
|
|
9
10
|
* RuntimeManager - Manages connections to remote Forthic runtimes
|
|
10
11
|
*/
|
|
@@ -31,14 +32,14 @@ export declare class RuntimeManager {
|
|
|
31
32
|
* @param runtimeName - Name of the runtime (e.g., "python", "ruby")
|
|
32
33
|
* @param client - GrpcClient instance connected to that runtime
|
|
33
34
|
*/
|
|
34
|
-
registerClient(runtimeName: string, client:
|
|
35
|
+
registerClient(runtimeName: string, client: RuntimeClient): void;
|
|
35
36
|
/**
|
|
36
|
-
* Get the
|
|
37
|
+
* Get the runtime client for a specific runtime
|
|
37
38
|
*
|
|
38
39
|
* @param runtimeName - Name of the runtime
|
|
39
|
-
* @returns
|
|
40
|
+
* @returns RuntimeClient instance or undefined if not registered
|
|
40
41
|
*/
|
|
41
|
-
getClient(runtimeName: string):
|
|
42
|
+
getClient(runtimeName: string): RuntimeClient | undefined;
|
|
42
43
|
/**
|
|
43
44
|
* Check if a runtime has a registered client
|
|
44
45
|
*
|
|
@@ -51,10 +51,10 @@ class RuntimeManager {
|
|
|
51
51
|
this.clients.set(runtimeName, client);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Get the
|
|
54
|
+
* Get the runtime client for a specific runtime
|
|
55
55
|
*
|
|
56
56
|
* @param runtimeName - Name of the runtime
|
|
57
|
-
* @returns
|
|
57
|
+
* @returns RuntimeClient instance or undefined if not registered
|
|
58
58
|
*/
|
|
59
59
|
getClient(runtimeName) {
|
|
60
60
|
return this.clients.get(runtimeName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime_manager.js","sourceRoot":"","sources":["../../../src/grpc/runtime_manager.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAyC;
|
|
1
|
+
{"version":3,"file":"runtime_manager.js","sourceRoot":"","sources":["../../../src/grpc/runtime_manager.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAyC;AAGzC;;GAEG;AACH,MAAa,cAAc;IACjB,MAAM,CAAC,QAAQ,GAA0B,IAAI,CAAC;IAC9C,OAAO,CAA6B;IAE5C;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC7B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,cAA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37,9 +37,9 @@ interface ZonedDateTimeValue {
|
|
|
37
37
|
* Serialize a JavaScript value to a StackValue protobuf message
|
|
38
38
|
* Uses shared type detection and maps to protobuf format
|
|
39
39
|
*/
|
|
40
|
-
export declare function serializeValue(value: any): StackValue;
|
|
40
|
+
export declare function serializeValue(value: any, path?: string): StackValue;
|
|
41
41
|
/**
|
|
42
42
|
* Deserialize a StackValue protobuf message to a JavaScript value
|
|
43
43
|
*/
|
|
44
|
-
export declare function deserializeValue(stackValue: StackValue): any;
|
|
44
|
+
export declare function deserializeValue(stackValue: StackValue, path?: string): any;
|
|
45
45
|
export {};
|
|
@@ -12,8 +12,8 @@ const type_utils_js_1 = require("../common/type_utils.js");
|
|
|
12
12
|
* Serialize a JavaScript value to a StackValue protobuf message
|
|
13
13
|
* Uses shared type detection and maps to protobuf format
|
|
14
14
|
*/
|
|
15
|
-
function serializeValue(value) {
|
|
16
|
-
const type = (0, type_utils_js_1.getForthicType)(value);
|
|
15
|
+
function serializeValue(value, path = '') {
|
|
16
|
+
const type = (0, type_utils_js_1.getForthicType)(value, path);
|
|
17
17
|
switch (type) {
|
|
18
18
|
case 'null':
|
|
19
19
|
return { null_value: {} };
|
|
@@ -28,15 +28,16 @@ function serializeValue(value) {
|
|
|
28
28
|
case 'array':
|
|
29
29
|
return {
|
|
30
30
|
array_value: {
|
|
31
|
-
items: value.map((item) => serializeValue(item)),
|
|
31
|
+
items: value.map((item, i) => serializeValue(item, `${path}[${i}]`)),
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
|
-
case 'record':
|
|
34
|
+
case 'record': {
|
|
35
35
|
const fields = {};
|
|
36
36
|
for (const [key, val] of Object.entries(value)) {
|
|
37
|
-
fields[key] = serializeValue(val);
|
|
37
|
+
fields[key] = serializeValue(val, `${path}${(0, type_utils_js_1.pathSegmentForKey)(key)}`);
|
|
38
38
|
}
|
|
39
39
|
return { record_value: { fields } };
|
|
40
|
+
}
|
|
40
41
|
case 'instant':
|
|
41
42
|
return {
|
|
42
43
|
instant_value: {
|
|
@@ -57,13 +58,13 @@ function serializeValue(value) {
|
|
|
57
58
|
},
|
|
58
59
|
};
|
|
59
60
|
default:
|
|
60
|
-
throw new Error(`Unsupported Forthic type: ${type}`);
|
|
61
|
+
throw new Error(`Unsupported Forthic type: ${type}${path ? ` at path: ${path}` : ''}`);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
/**
|
|
64
65
|
* Deserialize a StackValue protobuf message to a JavaScript value
|
|
65
66
|
*/
|
|
66
|
-
function deserializeValue(stackValue) {
|
|
67
|
+
function deserializeValue(stackValue, path = '') {
|
|
67
68
|
if ('int_value' in stackValue) {
|
|
68
69
|
return stackValue.int_value;
|
|
69
70
|
}
|
|
@@ -90,15 +91,15 @@ function deserializeValue(stackValue) {
|
|
|
90
91
|
return Temporal.ZonedDateTime.from(stackValue.zoned_datetime_value.iso8601);
|
|
91
92
|
}
|
|
92
93
|
if ('array_value' in stackValue && stackValue.array_value) {
|
|
93
|
-
return stackValue.array_value.items.map((item) => deserializeValue(item));
|
|
94
|
+
return stackValue.array_value.items.map((item, i) => deserializeValue(item, `${path}[${i}]`));
|
|
94
95
|
}
|
|
95
96
|
if ('record_value' in stackValue && stackValue.record_value) {
|
|
96
97
|
const result = {};
|
|
97
98
|
for (const [key, val] of Object.entries(stackValue.record_value.fields)) {
|
|
98
|
-
result[key] = deserializeValue(val);
|
|
99
|
+
result[key] = deserializeValue(val, `${path}${(0, type_utils_js_1.pathSegmentForKey)(key)}`);
|
|
99
100
|
}
|
|
100
101
|
return result;
|
|
101
102
|
}
|
|
102
|
-
throw new Error(
|
|
103
|
+
throw new Error(`Unknown stack value type${path ? ` at path: ${path}` : ''}`);
|
|
103
104
|
}
|
|
104
105
|
//# sourceMappingURL=serializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/grpc/serializer.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA2CH,
|
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* Browser stub for the JSON-RPC server. The JsonRpcClient itself is
|
|
3
|
+
* fetch-based and works in browsers, but the server depends on Node's
|
|
4
|
+
* `http` module and is unavailable in browser bundles.
|
|
5
|
+
*/
|
|
6
|
+
export declare function startJsonRpcServer(): never;
|
|
7
|
+
export { JsonRpcClient } from './client.js';
|
|
8
|
+
export { JsonRpcErrorCode } from './errors.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Browser stub for the JSON-RPC server. The JsonRpcClient itself is
|
|
4
|
+
* fetch-based and works in browsers, but the server depends on Node's
|
|
5
|
+
* `http` module and is unavailable in browser bundles.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.JsonRpcErrorCode = exports.JsonRpcClient = void 0;
|
|
9
|
+
exports.startJsonRpcServer = startJsonRpcServer;
|
|
10
|
+
const BROWSER_SERVER_ERROR = 'startJsonRpcServer is only available in Node.js environments.';
|
|
11
|
+
function startJsonRpcServer() {
|
|
12
|
+
throw new Error(BROWSER_SERVER_ERROR);
|
|
13
|
+
}
|
|
14
|
+
var client_js_1 = require("./client.js");
|
|
15
|
+
Object.defineProperty(exports, "JsonRpcClient", { enumerable: true, get: function () { return client_js_1.JsonRpcClient; } });
|
|
16
|
+
var errors_js_1 = require("./errors.js");
|
|
17
|
+
Object.defineProperty(exports, "JsonRpcErrorCode", { enumerable: true, get: function () { return errors_js_1.JsonRpcErrorCode; } });
|
|
18
|
+
//# sourceMappingURL=browser-stub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-stub.js","sourceRoot":"","sources":["../../../src/jsonrpc/browser-stub.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAKH,gDAEC;AALD,MAAM,oBAAoB,GACxB,+DAA+D,CAAC;AAElE,SAAgB,kBAAkB;IAChC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACxC,CAAC;AAED,yCAA4C;AAAnC,0GAAA,aAAa,OAAA;AACtB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RuntimeClient, ModuleSummary, GetModuleInfoResponse } from '../common/runtime_client.js';
|
|
2
|
+
export type { ModuleSummary, GetModuleInfoResponse, WordInfo } from '../common/runtime_client.js';
|
|
3
|
+
type FetchLike = (url: string, init?: any) => Promise<{
|
|
4
|
+
ok: boolean;
|
|
5
|
+
status: number;
|
|
6
|
+
statusText: string;
|
|
7
|
+
text(): Promise<string>;
|
|
8
|
+
}>;
|
|
9
|
+
export interface JsonRpcClientOptions {
|
|
10
|
+
/** Custom fetch implementation; defaults to global fetch. */
|
|
11
|
+
fetchImpl?: FetchLike;
|
|
12
|
+
/** Optional path; defaults to /rpc. */
|
|
13
|
+
path?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class JsonRpcClient implements RuntimeClient {
|
|
16
|
+
private endpoint;
|
|
17
|
+
private fetchImpl;
|
|
18
|
+
private nextId;
|
|
19
|
+
/**
|
|
20
|
+
* @param address - "host:port" or full URL. "host:port" is rewritten as
|
|
21
|
+
* `http://host:port<path>`. A full URL is used as-is and
|
|
22
|
+
* the `path` option is ignored.
|
|
23
|
+
*/
|
|
24
|
+
constructor(address?: string, options?: JsonRpcClientOptions);
|
|
25
|
+
executeWord(wordName: string, stack: any[]): Promise<any[]>;
|
|
26
|
+
executeSequence(wordNames: string[], stack: any[]): Promise<any[]>;
|
|
27
|
+
listModules(): Promise<ModuleSummary[]>;
|
|
28
|
+
getModuleInfo(moduleName: string): Promise<GetModuleInfoResponse>;
|
|
29
|
+
close(): void;
|
|
30
|
+
private call;
|
|
31
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonRpcClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* JSON-RPC 2.0 client for Forthic — speaks the same surface as GrpcClient
|
|
6
|
+
* (executeWord / executeSequence / listModules / getModuleInfo) so it can
|
|
7
|
+
* be used interchangeably via the RuntimeClient interface.
|
|
8
|
+
*
|
|
9
|
+
* Uses the global `fetch` (Node ≥18). For older Node, inject your own
|
|
10
|
+
* fetch via the constructor's `fetchImpl` option.
|
|
11
|
+
*/
|
|
12
|
+
const serializer_js_1 = require("../grpc/serializer.js");
|
|
13
|
+
const errors_js_1 = require("../grpc/errors.js");
|
|
14
|
+
const errors_js_2 = require("./errors.js");
|
|
15
|
+
class JsonRpcClient {
|
|
16
|
+
endpoint;
|
|
17
|
+
fetchImpl;
|
|
18
|
+
nextId = 1;
|
|
19
|
+
/**
|
|
20
|
+
* @param address - "host:port" or full URL. "host:port" is rewritten as
|
|
21
|
+
* `http://host:port<path>`. A full URL is used as-is and
|
|
22
|
+
* the `path` option is ignored.
|
|
23
|
+
*/
|
|
24
|
+
constructor(address = 'localhost:8765', options = {}) {
|
|
25
|
+
const path = options.path ?? '/rpc';
|
|
26
|
+
if (/^https?:\/\//i.test(address)) {
|
|
27
|
+
this.endpoint = address;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.endpoint = `http://${address}${path}`;
|
|
31
|
+
}
|
|
32
|
+
const fetchImpl = options.fetchImpl ?? globalThis.fetch;
|
|
33
|
+
if (typeof fetchImpl !== 'function') {
|
|
34
|
+
throw new Error('JsonRpcClient requires a fetch implementation. Use Node ≥18 or pass options.fetchImpl.');
|
|
35
|
+
}
|
|
36
|
+
this.fetchImpl = fetchImpl;
|
|
37
|
+
}
|
|
38
|
+
async executeWord(wordName, stack) {
|
|
39
|
+
const result = await this.call('executeWord', {
|
|
40
|
+
word_name: wordName,
|
|
41
|
+
stack: stack.map((v) => (0, serializer_js_1.serializeValue)(v)),
|
|
42
|
+
});
|
|
43
|
+
return (result.result_stack ?? []).map((v) => (0, serializer_js_1.deserializeValue)(v));
|
|
44
|
+
}
|
|
45
|
+
async executeSequence(wordNames, stack) {
|
|
46
|
+
const result = await this.call('executeSequence', {
|
|
47
|
+
word_names: wordNames,
|
|
48
|
+
stack: stack.map((v) => (0, serializer_js_1.serializeValue)(v)),
|
|
49
|
+
});
|
|
50
|
+
return (result.result_stack ?? []).map((v) => (0, serializer_js_1.deserializeValue)(v));
|
|
51
|
+
}
|
|
52
|
+
async listModules() {
|
|
53
|
+
const result = await this.call('listModules', {});
|
|
54
|
+
return result.modules ?? [];
|
|
55
|
+
}
|
|
56
|
+
async getModuleInfo(moduleName) {
|
|
57
|
+
return await this.call('getModuleInfo', { module_name: moduleName });
|
|
58
|
+
}
|
|
59
|
+
close() {
|
|
60
|
+
// Stateless over HTTP — nothing to close.
|
|
61
|
+
}
|
|
62
|
+
async call(method, params) {
|
|
63
|
+
const id = this.nextId++;
|
|
64
|
+
const body = JSON.stringify({ jsonrpc: '2.0', id, method, params });
|
|
65
|
+
let response;
|
|
66
|
+
try {
|
|
67
|
+
response = await this.fetchImpl(this.endpoint, {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
headers: { 'Content-Type': 'application/json' },
|
|
70
|
+
body,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
throw new Error(`JSON-RPC transport error: ${err?.message ?? String(err)}`);
|
|
75
|
+
}
|
|
76
|
+
const text = await response.text();
|
|
77
|
+
if (!response.ok && !text) {
|
|
78
|
+
throw new Error(`JSON-RPC HTTP ${response.status}: ${response.statusText}`);
|
|
79
|
+
}
|
|
80
|
+
let envelope;
|
|
81
|
+
try {
|
|
82
|
+
envelope = JSON.parse(text);
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
throw new Error(`JSON-RPC parse error (HTTP ${response.status}): ${err?.message ?? String(err)}`);
|
|
86
|
+
}
|
|
87
|
+
if (envelope.error) {
|
|
88
|
+
const { code, message, data } = envelope.error;
|
|
89
|
+
if (code === errors_js_2.JsonRpcErrorCode.RuntimeError && data && typeof data === 'object') {
|
|
90
|
+
throw new errors_js_1.RemoteRuntimeError((0, errors_js_1.parseErrorInfo)(data));
|
|
91
|
+
}
|
|
92
|
+
throw new Error(`JSON-RPC error ${code}: ${message}`);
|
|
93
|
+
}
|
|
94
|
+
return envelope.result;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.JsonRpcClient = JsonRpcClient;
|
|
98
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/jsonrpc/client.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,yDAAyE;AACzE,iDAAuE;AAMvE,2CAA+C;AAyB/C,MAAa,aAAa;IAChB,QAAQ,CAAS;IACjB,SAAS,CAAY;IACrB,MAAM,GAAW,CAAC,CAAC;IAE3B;;;;OAIG;IACH,YAAY,UAAkB,gBAAgB,EAAE,UAAgC,EAAE;QAChF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC;QACpC,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,GAAG,UAAU,OAAO,GAAG,IAAI,EAAE,CAAC;QAC7C,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAK,UAAkB,CAAC,KAAK,CAAC;QACjE,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,KAAY;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YAC5C,SAAS,EAAE,QAA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,8BAAkB,CAAC,IAAA,0BAAc,EAAC,IAAI,CAAC,CAAC,CAAC;YACrD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,QAAQ,CAAC,MAAM,CAAC;IACzB,CAAC;CACF;AA/FD,sCA+FC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-RPC error types — reuses gRPC's RemoteRuntimeError + parseErrorInfo
|
|
3
|
+
* for the structured `data` payload of code -32000 responses.
|
|
4
|
+
*/
|
|
5
|
+
export { RemoteRuntimeError, parseErrorInfo, type RemoteErrorInfo, } from '../grpc/errors.js';
|
|
6
|
+
/** JSON-RPC standard error codes plus our custom server-defined codes. */
|
|
7
|
+
export declare const JsonRpcErrorCode: {
|
|
8
|
+
readonly ParseError: -32700;
|
|
9
|
+
readonly InvalidRequest: -32600;
|
|
10
|
+
readonly MethodNotFound: -32601;
|
|
11
|
+
readonly InvalidParams: -32602;
|
|
12
|
+
readonly InternalError: -32603;
|
|
13
|
+
/** Forthic runtime error — `data` carries the full ErrorInfo. */
|
|
14
|
+
readonly RuntimeError: -32000;
|
|
15
|
+
/** Unknown module name passed to getModuleInfo. */
|
|
16
|
+
readonly ModuleNotFound: -32001;
|
|
17
|
+
};
|
|
18
|
+
export type JsonRpcErrorCodeValue = (typeof JsonRpcErrorCode)[keyof typeof JsonRpcErrorCode];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonRpcErrorCode = exports.parseErrorInfo = exports.RemoteRuntimeError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* JSON-RPC error types — reuses gRPC's RemoteRuntimeError + parseErrorInfo
|
|
6
|
+
* for the structured `data` payload of code -32000 responses.
|
|
7
|
+
*/
|
|
8
|
+
var errors_js_1 = require("../grpc/errors.js");
|
|
9
|
+
Object.defineProperty(exports, "RemoteRuntimeError", { enumerable: true, get: function () { return errors_js_1.RemoteRuntimeError; } });
|
|
10
|
+
Object.defineProperty(exports, "parseErrorInfo", { enumerable: true, get: function () { return errors_js_1.parseErrorInfo; } });
|
|
11
|
+
/** JSON-RPC standard error codes plus our custom server-defined codes. */
|
|
12
|
+
exports.JsonRpcErrorCode = {
|
|
13
|
+
ParseError: -32700,
|
|
14
|
+
InvalidRequest: -32600,
|
|
15
|
+
MethodNotFound: -32601,
|
|
16
|
+
InvalidParams: -32602,
|
|
17
|
+
InternalError: -32603,
|
|
18
|
+
/** Forthic runtime error — `data` carries the full ErrorInfo. */
|
|
19
|
+
RuntimeError: -32000,
|
|
20
|
+
/** Unknown module name passed to getModuleInfo. */
|
|
21
|
+
ModuleNotFound: -32001,
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/jsonrpc/errors.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+CAI2B;AAHzB,+GAAA,kBAAkB,OAAA;AAClB,2GAAA,cAAc,OAAA;AAIhB,0EAA0E;AAC7D,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,CAAC,KAAK;IAClB,cAAc,EAAE,CAAC,KAAK;IACtB,cAAc,EAAE,CAAC,KAAK;IACtB,aAAa,EAAE,CAAC,KAAK;IACrB,aAAa,EAAE,CAAC,KAAK;IACrB,iEAAiE;IACjE,YAAY,EAAE,CAAC,KAAK;IACpB,mDAAmD;IACnD,cAAc,EAAE,CAAC,KAAK;CACd,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-RPC module for Node.js multi-runtime execution.
|
|
3
|
+
* Server uses Node's built-in http; client uses global fetch (Node ≥18).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors @forthix/forthic/grpc surface so RuntimeManager / RemoteModule /
|
|
6
|
+
* RemoteWord work transparently against either transport.
|
|
7
|
+
*/
|
|
8
|
+
export { JsonRpcClient } from './client.js';
|
|
9
|
+
export { serve as startJsonRpcServer } from './server.js';
|
|
10
|
+
export { JsonRpcErrorCode } from './errors.js';
|
|
11
|
+
export { RemoteRuntimeError } from '../grpc/errors.js';
|
|
12
|
+
export { RemoteModule } from '../grpc/remote_module.js';
|
|
13
|
+
export { RuntimeManager } from '../grpc/runtime_manager.js';
|
|
14
|
+
export { ConfigLoader } from '../grpc/config_loader.js';
|
|
15
|
+
export type { ModuleSummary, WordInfo, GetModuleInfoResponse, RuntimeClient, } from '../common/runtime_client.js';
|
|
16
|
+
export type { RuntimeConfig, ForthicRuntimesConfig, ConnectionSettings, RuntimeTransport, } from '../grpc/config_loader.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* JSON-RPC module for Node.js multi-runtime execution.
|
|
4
|
+
* Server uses Node's built-in http; client uses global fetch (Node ≥18).
|
|
5
|
+
*
|
|
6
|
+
* Mirrors @forthix/forthic/grpc surface so RuntimeManager / RemoteModule /
|
|
7
|
+
* RemoteWord work transparently against either transport.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ConfigLoader = exports.RuntimeManager = exports.RemoteModule = exports.RemoteRuntimeError = exports.JsonRpcErrorCode = exports.startJsonRpcServer = exports.JsonRpcClient = void 0;
|
|
11
|
+
var client_js_1 = require("./client.js");
|
|
12
|
+
Object.defineProperty(exports, "JsonRpcClient", { enumerable: true, get: function () { return client_js_1.JsonRpcClient; } });
|
|
13
|
+
var server_js_1 = require("./server.js");
|
|
14
|
+
Object.defineProperty(exports, "startJsonRpcServer", { enumerable: true, get: function () { return server_js_1.serve; } });
|
|
15
|
+
var errors_js_1 = require("./errors.js");
|
|
16
|
+
Object.defineProperty(exports, "JsonRpcErrorCode", { enumerable: true, get: function () { return errors_js_1.JsonRpcErrorCode; } });
|
|
17
|
+
var errors_js_2 = require("../grpc/errors.js");
|
|
18
|
+
Object.defineProperty(exports, "RemoteRuntimeError", { enumerable: true, get: function () { return errors_js_2.RemoteRuntimeError; } });
|
|
19
|
+
// Reuse existing pieces: they already accept any RuntimeClient implementation.
|
|
20
|
+
var remote_module_js_1 = require("../grpc/remote_module.js");
|
|
21
|
+
Object.defineProperty(exports, "RemoteModule", { enumerable: true, get: function () { return remote_module_js_1.RemoteModule; } });
|
|
22
|
+
var runtime_manager_js_1 = require("../grpc/runtime_manager.js");
|
|
23
|
+
Object.defineProperty(exports, "RuntimeManager", { enumerable: true, get: function () { return runtime_manager_js_1.RuntimeManager; } });
|
|
24
|
+
var config_loader_js_1 = require("../grpc/config_loader.js");
|
|
25
|
+
Object.defineProperty(exports, "ConfigLoader", { enumerable: true, get: function () { return config_loader_js_1.ConfigLoader; } });
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jsonrpc/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,yCAA4C;AAAnC,0GAAA,aAAa,OAAA;AACtB,yCAA0D;AAAjD,+GAAA,KAAK,OAAsB;AACpC,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,+CAAuD;AAA9C,+GAAA,kBAAkB,OAAA;AAE3B,+EAA+E;AAC/E,6DAAwD;AAA/C,gHAAA,YAAY,OAAA;AACrB,iEAA4D;AAAnD,oHAAA,cAAc,OAAA;AACvB,6DAAwD;AAA/C,gHAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-RPC serializer — re-exports the gRPC serializer.
|
|
3
|
+
*
|
|
4
|
+
* The StackValue tagged-union shape (`{ int_value }`, `{ string_value }`,
|
|
5
|
+
* `{ array_value: { items: [...] } }`, etc.) is JSON-clean, so the same
|
|
6
|
+
* (serializeValue, deserializeValue) functions work for both transports.
|
|
7
|
+
*/
|
|
8
|
+
export { serializeValue, deserializeValue } from '../grpc/serializer.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeValue = exports.serializeValue = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* JSON-RPC serializer — re-exports the gRPC serializer.
|
|
6
|
+
*
|
|
7
|
+
* The StackValue tagged-union shape (`{ int_value }`, `{ string_value }`,
|
|
8
|
+
* `{ array_value: { items: [...] } }`, etc.) is JSON-clean, so the same
|
|
9
|
+
* (serializeValue, deserializeValue) functions work for both transports.
|
|
10
|
+
*/
|
|
11
|
+
var serializer_js_1 = require("../grpc/serializer.js");
|
|
12
|
+
Object.defineProperty(exports, "serializeValue", { enumerable: true, get: function () { return serializer_js_1.serializeValue; } });
|
|
13
|
+
Object.defineProperty(exports, "deserializeValue", { enumerable: true, get: function () { return serializer_js_1.deserializeValue; } });
|
|
14
|
+
//# sourceMappingURL=serializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/jsonrpc/serializer.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,uDAAyE;AAAhE,+GAAA,cAAc,OAAA;AAAE,iHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript JSON-RPC 2.0 Server for Forthic
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the four methods of the gRPC server:
|
|
5
|
+
* executeWord, executeSequence, listModules, getModuleInfo
|
|
6
|
+
*
|
|
7
|
+
* Transport: HTTP POST /rpc with JSON-RPC 2.0 envelopes.
|
|
8
|
+
* Uses Node's built-in `http` module — zero new dependencies.
|
|
9
|
+
*
|
|
10
|
+
* `executeSequence` is a single JSON-RPC call with an array of words; it is
|
|
11
|
+
* NOT a JSON-RPC batch. Batch envelopes are rejected with code -32600.
|
|
12
|
+
*/
|
|
13
|
+
import * as http from 'http';
|
|
14
|
+
export declare function serve(port?: number): Promise<http.Server>;
|
|
15
|
+
export declare function main(): Promise<void>;
|