@stateflowx/runtime 0.2.2 → 0.2.4
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/http/bootstrap-http-runtime.js +5 -3
- package/dist/http/bootstrap-http-runtime.js.map +1 -1
- package/dist/http-runtime.module.d.ts +2 -0
- package/dist/http-runtime.module.js +23 -0
- package/dist/http-runtime.module.js.map +1 -0
- package/dist/main.js +4 -2
- package/dist/main.js.map +1 -1
- package/dist/websocket-runtime.module.d.ts +2 -0
- package/dist/websocket-runtime.module.js +19 -0
- package/dist/websocket-runtime.module.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { NestFactory } from '@nestjs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { HttpRuntimeModule } from '../http-runtime.module.js';
|
|
3
3
|
import { HttpTransport } from '../core/transport/http/http.transport.js';
|
|
4
4
|
import { JsonRpcProtocol } from '../core/protocol/json-rpc/json-rpc.protocol.js';
|
|
5
5
|
import { createRuntime } from '../core/runtime/create-runtime.js';
|
|
6
|
+
import { bootstrapRuntime } from '../core/runtime/bootstrap.js';
|
|
6
7
|
export async function bootstrapHttpRuntime(config = {}) {
|
|
7
|
-
const app = await NestFactory.create(
|
|
8
|
+
const app = await NestFactory.create(HttpRuntimeModule, {
|
|
8
9
|
cors: true,
|
|
9
10
|
});
|
|
10
11
|
const transport = app.get(HttpTransport);
|
|
11
12
|
const protocol = new JsonRpcProtocol();
|
|
12
|
-
createRuntime({
|
|
13
|
+
const runtime = createRuntime({
|
|
13
14
|
transport,
|
|
14
15
|
protocol,
|
|
15
16
|
...config,
|
|
16
17
|
});
|
|
18
|
+
bootstrapRuntime(config.apps ?? [], runtime);
|
|
17
19
|
const port = config.port ?? 3000;
|
|
18
20
|
await app.listen(port);
|
|
19
21
|
console.log(`StateFlowX runtime listening on http://localhost:${port}/rpc`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-http-runtime.js","sourceRoot":"","sources":["../../src/http/bootstrap-http-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bootstrap-http-runtime.js","sourceRoot":"","sources":["../../src/http/bootstrap-http-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACtC,SAAc,EAAE;IAEhB,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,MAAM,CAChC,iBAAiB,EACjB;QACI,IAAI,EAAE,IAAI;KACb,CACJ,CAAC;IAEF,MAAM,SAAS,GACX,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAE3B,MAAM,QAAQ,GACV,IAAI,eAAe,EAAE,CAAC;IAE1B,MAAM,OAAO,GACT,aAAa,CAAC;QACV,SAAS;QAET,QAAQ;QAER,GAAG,MAAM;KACZ,CAAC,CAAC;IAEP,gBAAgB,CACZ,MAAM,CAAC,IAAI,IAAI,EAAE,EACjB,OAAO,CACV,CAAC;IAEF,MAAM,IAAI,GACN,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;IAExB,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEvB,OAAO,CAAC,GAAG,CACP,oDAAoD,IAAI,MAAM,CACjE,CAAC;IAEF,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module } from '@nestjs/common';
|
|
8
|
+
import { HttpTransport } from './core/transport/http/http.transport.js';
|
|
9
|
+
import { HttpRpcController } from './core/transport/http/http.controller.js';
|
|
10
|
+
let HttpRuntimeModule = class HttpRuntimeModule {
|
|
11
|
+
};
|
|
12
|
+
HttpRuntimeModule = __decorate([
|
|
13
|
+
Module({
|
|
14
|
+
providers: [
|
|
15
|
+
HttpTransport,
|
|
16
|
+
],
|
|
17
|
+
controllers: [
|
|
18
|
+
HttpRpcController,
|
|
19
|
+
],
|
|
20
|
+
})
|
|
21
|
+
], HttpRuntimeModule);
|
|
22
|
+
export { HttpRuntimeModule };
|
|
23
|
+
//# sourceMappingURL=http-runtime.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-runtime.module.js","sourceRoot":"","sources":["../src/http-runtime.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAWtE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAI,CAAA;AAArB,iBAAiB;IAT7B,MAAM,CAAC;QACJ,SAAS,EAAE;YACP,aAAa;SAChB;QAED,WAAW,EAAE;YACT,iBAAiB;SACpB;KACJ,CAAC;GACW,iBAAiB,CAAI"}
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import 'dotenv/config';
|
|
2
2
|
import { NestFactory } from '@nestjs/core';
|
|
3
3
|
import { WsAdapter } from '@nestjs/platform-ws';
|
|
4
|
-
import {
|
|
4
|
+
import { WebSocketRuntimeModule } from './websocket-runtime.module.js';
|
|
5
5
|
import { createRuntime, bootstrapRuntime, RuntimeInitializeApp, GeminiProvider, } from './index.js';
|
|
6
6
|
import { JsonRpcProtocol } from './core/protocol/json-rpc/json-rpc.protocol.js';
|
|
7
7
|
import { HttpTransport } from './core/transport/http/http.transport.js';
|
|
8
8
|
async function bootstrap() {
|
|
9
|
-
const app = await NestFactory.create(
|
|
9
|
+
const app = await NestFactory.create(WebSocketRuntimeModule, {
|
|
10
|
+
cors: true,
|
|
11
|
+
});
|
|
10
12
|
app.useWebSocketAdapter(new WsAdapter(app));
|
|
11
13
|
app.enableCors({
|
|
12
14
|
origin: 'http://localhost:4200',
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAC1B,+BAA+B,CAAC;AAEvC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,sBAAsB,EAAE;QAC3D,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,GAAG,CAAC,mBAAmB,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAE5C,GAAG,CAAC,UAAU,CAAC;QACb,MAAM,EAAE,uBAAuB;KAChC,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEvB,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;IAEvC,MAAM,OAAO,GAAG,aAAa,CAAC;QAC5B,SAAS;QACT,QAAQ;QACR,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI,cAAc,EAAE;aAC/B;SACF;QACD,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IAEH,gBAAgB,CAAC,CAAC,IAAI,oBAAoB,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IAExD,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module } from '@nestjs/common';
|
|
8
|
+
import EventsGateway from './core/transport/ws/events.gateway.js';
|
|
9
|
+
let WebSocketRuntimeModule = class WebSocketRuntimeModule {
|
|
10
|
+
};
|
|
11
|
+
WebSocketRuntimeModule = __decorate([
|
|
12
|
+
Module({
|
|
13
|
+
providers: [
|
|
14
|
+
EventsGateway,
|
|
15
|
+
],
|
|
16
|
+
})
|
|
17
|
+
], WebSocketRuntimeModule);
|
|
18
|
+
export { WebSocketRuntimeModule };
|
|
19
|
+
//# sourceMappingURL=websocket-runtime.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-runtime.module.js","sourceRoot":"","sources":["../src/websocket-runtime.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAO3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAI,CAAA;AAA1B,sBAAsB;IALlC,MAAM,CAAC;QACJ,SAAS,EAAE;YACP,aAAa;SAChB;KACJ,CAAC;GACW,sBAAsB,CAAI"}
|
package/package.json
CHANGED