@kumologica/sdk 3.6.4-beta1 → 3.6.4-beta4

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.
@@ -25,7 +25,7 @@
25
25
  const path = require("path");
26
26
  const fs = require("fs");
27
27
  const { codegen } = require("@kumologica/builder");
28
- const { NodeJsTaskFlowBuilder} = require("../../src/builder/NodeJsTaskFlowBuilder");
28
+ const { TaskServer} = require("../../src/server/TaskServer");
29
29
  //const { DesignerServer } = require("../../src/server/DesignerServer");
30
30
  const { logError, logNotice, logInfo, logFatal } = require("../utils/logger");
31
31
 
@@ -87,7 +87,7 @@ exports.handler = async ({ project_directory, loglevel, port, taskName, args })
87
87
  };
88
88
 
89
89
  // Start a server
90
- let server = new NodeJsTaskFlowBuilder({
90
+ let server = new TaskServer({
91
91
  flowPath: projectFlowFullPath,
92
92
  cliParams,
93
93
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumologica/sdk",
3
- "version": "3.6.4-beta1",
3
+ "version": "3.6.4-beta4",
4
4
  "productName": "Kumologica Designer",
5
5
  "copyright": "Copyright 2020 Kumologica Pty Ltd, All Rights Reserved.",
6
6
  "author": "Kumologica Pty Ltd <contact@kumologica.com>",
@@ -83,9 +83,9 @@
83
83
  "@aws-sdk/credential-providers": "^3.556.0",
84
84
  "@aws-sdk/lib-dynamodb": "^3.549.0",
85
85
  "@electron/remote": "^2.0.8",
86
- "@kumologica/builder": "3.6.4-beta1",
87
- "@kumologica/devkit": "3.6.4-beta1",
88
- "@kumologica/runtime": "3.6.4-beta1",
86
+ "@kumologica/builder": "3.6.4-beta4",
87
+ "@kumologica/devkit": "3.6.4-beta4",
88
+ "@kumologica/runtime": "3.6.4-beta4",
89
89
  "ajv": "8.10.0",
90
90
  "archive-type": "^4.0.0",
91
91
  "basic-auth": "2.0.1",
@@ -18,7 +18,6 @@
18
18
  /*
19
19
  const {
20
20
  provider = "anthropic",
21
- apiKey = "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",
22
21
  model = "claude-sonnet-4-20250514",
23
22
  conversation = [],
24
23
  question,
@@ -47,7 +46,6 @@ const fetch = require('node-fetch'); // Node 18+ can use global fetch
47
46
  async function chatAi(options) {
48
47
  const {
49
48
  provider = "anthropic",
50
- apiKey = "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",
51
49
  model = "claude-sonnet-4-20250514",
52
50
  conversation = [],
53
51
  question,
@@ -0,0 +1,53 @@
1
+ // @ts-nocheck
2
+ const {
3
+ AbstractServerfulServer,
4
+ ConfigBuilder,
5
+ PLATFORMS,
6
+ } = require("@kumologica/runtime");
7
+
8
+
9
+ /**
10
+ * This class will encapsulate the adminApp and FlowApp into two servers.
11
+ * It will be the one running on the development box of the user (either local or remote),
12
+ * and it will serve all the functioanlity to the Kumologica Cloud Editor.
13
+ */
14
+
15
+ class TaskServer {
16
+ /**
17
+ * @param {string} flow - FlowFile's path. It supports relative and absolute paths.
18
+ * If flow does not exist, the process will be exited.
19
+ * @param {object} params - Kumologica Runtime CLI Params to override the config and environment variables
20
+ */
21
+ constructor(flowPath, params) {
22
+ if (!flowPath) {
23
+ console.log(
24
+ '[ERROR] Flow is not defined. Make sure you pass the flow file to the constructor of FlowBuilder'
25
+ );
26
+ os.exit(1);
27
+ }
28
+
29
+ const baseConfig = ConfigBuilder.getInstance().buildConfig(
30
+ flowPath,
31
+ PLATFORMS.NODE_JS,
32
+ { noadmin: true }
33
+ );
34
+
35
+ this.config = { ...baseConfig, ...params };
36
+
37
+ this.flowServer = new AbstractServerfulServer(this.config);
38
+ }
39
+
40
+ async listen() {
41
+ await this.flowServer.start();
42
+ this.flowServer.log.debug(`Runtime configuration:${JSON.stringify(this.config)}`);
43
+ }
44
+
45
+ async stop() {
46
+ await this.flowServer.stop();
47
+ this.flowServer.log.debug(`Server stopped`);
48
+ }
49
+ }
50
+
51
+ module.exports = {
52
+ TaskServer,
53
+ };