Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

update entry file name for runtime server

Forhad Hosain0348c3a70f60
diff --git a/.vscode/launch.json b/.vscode/launch.json
index aea9017f..9b08d982 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -41,7 +41,7 @@
"name": "Launch Runtime Server",
"type": "node",
"request": "launch",
- "program": "${workspaceFolder}/packages/runtime/dist/runtime-server.dev.cjs",
+ "program": "${workspaceFolder}/packages/runtime/dist/index.cjs",
"preLaunchTask": "runtime: build:dev",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
@@ -52,7 +52,7 @@
"name": "Launch Runtime Server (No Build)",
"type": "node",
"request": "launch",
- "program": "${workspaceFolder}/packages/runtime/dist/runtime-server.dev.cjs",
+ "program": "${workspaceFolder}/packages/runtime/dist/index.cjs",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/packages/runtime/dist/**/*.js"],
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index ffaca8be..b66817bb 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -7,14 +7,6 @@
"script": "build:dev",
"path": "packages/runtime/",
"group": "build",
- "presentation": {
- "echo": true,
- "reveal": "always",
- "focus": false,
- "panel": "shared",
- "showReuseMessage": true,
- "clear": false
- },
"problemMatcher": []
}
]
diff --git a/packages/runtime/.vscode/launch.json b/packages/runtime/.vscode/launch.json
deleted file mode 100644
index 780df889..00000000
--- a/packages/runtime/.vscode/launch.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Launch Runtime Server",
- "type": "node",
- "request": "launch",
- "program": "${workspaceFolder}/dist/runtime-server.dev.cjs",
- "preLaunchTask": "npm: build:dev",
- "skipFiles": ["<node_internals>/**"],
- "sourceMaps": true,
- "outFiles": ["${workspaceFolder}/dist/**/*.js"]
- },
- {
- "name": "Launch Runtime Server (No Build)",
- "type": "node",
- "request": "launch",
- "program": "${workspaceFolder}/dist/runtime-server.dev.cjs",
- "skipFiles": ["<node_internals>/**"],
- "sourceMaps": true,
- "outFiles": ["${workspaceFolder}/dist/**/*.js"]
- }
- ]
-}
diff --git a/packages/runtime/.vscode/settings.json b/packages/runtime/.vscode/settings.json
deleted file mode 100644
index 2bd2d3ad..00000000
--- a/packages/runtime/.vscode/settings.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "cSpell.words": ["smythos"]
-}
diff --git a/packages/runtime/package.json b/packages/runtime/package.json
index 4ab3fab8..65b1e8de 100644
--- a/packages/runtime/package.json
+++ b/packages/runtime/package.json
@@ -5,9 +5,9 @@
"main": "rollup.config.js",
"type": "module",
"scripts": {
- "dev": "npm run build:dev && node ./dist/runtime-server.dev.cjs",
+ "dev": "npm run build:dev && node ./dist/index.cjs",
"build:dev": "cross-env NODE_OPTIONS='--max-old-space-size=4096' BUILD=dev FORMAT=cjs rollup -c ./rollup.config.js",
- "start": "node ./dist/runtime-server.dev.cjs",
+ "start": "node ./dist/index.cjs",
"test": "cross-env TEST_ENV=true vitest --reporter verbose",
"prepare:staging": "npm version patch --no-git-tag-version",
"prepare:production": "npm version minor -f",
@@ -64,5 +64,7 @@
"swagger-ui-express": "^5.0.0",
"uuid": "^9.0.1",
"winston": "^3.17.0"
- }
+ },
+ "keywords": [],
+ "license": "ISC"
}
diff --git a/packages/runtime/rollup.config.js b/packages/runtime/rollup.config.js
index 0e4d949c..232c686b 100644
--- a/packages/runtime/rollup.config.js
+++ b/packages/runtime/rollup.config.js
@@ -1,14 +1,14 @@
+import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
+import resolve from "@rollup/plugin-node-resolve";
import { createFilter } from "@rollup/pluginutils";
import path from "path";
+import copy from "rollup-plugin-copy";
import esbuild from "rollup-plugin-esbuild";
import sourcemaps from "rollup-plugin-sourcemaps";
import { terser } from "rollup-plugin-terser";
import typescriptPaths from "rollup-plugin-typescript-paths";
-import commonjs from "@rollup/plugin-commonjs";
-import resolve from "@rollup/plugin-node-resolve";
import pkg from "./package.json";
-import copy from "rollup-plugin-copy";
const isProduction = process.env.BUILD === "prod";
const format = process.env.FORMAT || "es";
@@ -22,7 +22,7 @@ const banner = `/**
const devCJSConfig = {
input: "./src/index.ts",
output: {
- file: "./dist/runtime-server.dev.cjs", // CommonJS output
+ file: "./dist/index.cjs", // CommonJS output
format: "cjs", // Specify the CommonJS format
sourcemap: true,
inlineDynamicImports: true, // Inline all dynamic imports into one file
@@ -73,7 +73,7 @@ const devESBundleConfig = {
//file: 'distributions/agent-builder/dist/agent-builder.dev.js',
dir: "dist",
inlineDynamicImports: true,
- entryFileNames: "runtime-server.dev-bundle.js",
+ entryFileNames: "index.bundle.js",
banner,
},
plugins: [
@@ -121,7 +121,7 @@ const devESConfig = {
sourcemap: true,
//Comment this line and uncomment the following lines if you need ES bundle
- file: "./dist/runtime-server.dev.js",
+ file: "./dist/index.js",
banner,
},
plugins: [
@@ -159,7 +159,7 @@ const devESConfig = {
const prodESConfig = {
input: "./src/index.ts",
output: {
- file: "./dist/runtime-server.prod.js",
+ file: "./dist/index.js",
format: "es",
sourcemap: true,
banner,
@@ -199,7 +199,7 @@ const prodESConfig = {
const prodCJSConfig = {
input: "./src/index.ts",
output: {
- file: "./dist/runtime-server.prod.cjs",
+ file: "./dist/index.cjs",
format: "cjs",
sourcemap: true,
inlineDynamicImports: true,
diff --git a/packages/runtime/src/core/connectors/SmythOSSManagedVault.class.ts b/packages/runtime/src/core/connectors/SmythOSSManagedVault.class.ts
deleted file mode 100644
index d56a862e..00000000
--- a/packages/runtime/src/core/connectors/SmythOSSManagedVault.class.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { getM2MToken } from "@/core/helpers/logto.helper";
-import { SmythConfigs } from "@core/types/general.types";
-import {
- ACL,
- AccessRequest,
- ConnectorService,
- IAccessCandidate,
- Logger,
- ManagedVaultConnector,
- OAuthConfig,
- SecureConnector,
- TAccessLevel,
- TAccessRole,
-} from "@smythos/sre";
-import axios, { AxiosInstance } from "axios";
-const console = Logger("SmythOSSManagedVault");
-export class SmythOSSManagedVault extends ManagedVaultConnector {
- public name: string = "SmythOSSManagedVault";
- private oAuthAppId: string;
- private oAuthAppSecret: string;
- private oAuthBaseUrl: string;
- private oAuthResource?: string;
- private oAuthScope?: string;
- private smythAPI: AxiosInstance;
- private vaultName: string;
-
- constructor(
- protected _settings: SmythConfigs & OAuthConfig & { vaultName: string }
- ) {
- super(_settings);
- //if (!SmythRuntime.Instance) throw new Error('SRE not initialized');
-
- this.oAuthAppId = _settings.oAuthAppID;
- this.oAuthAppSecret = _settings.oAuthAppSecret;
- this.oAuthBaseUrl = _settings.oAuthBaseUrl;
- this.oAuthResource = _settings.oAuthResource || "";
- this.oAuthScope = _settings.oAuthScope || "";
- this.smythAPI = axios.create({
- baseURL: `${_settings.smythAPIBaseUrl}`,
- });
- this.vaultName = _settings.vaultName || "vault";
- }
-
- @SecureConnector.AccessControl
- protected async get(acRequest: AccessRequest, keyId: string) {
- const accountConnector = ConnectorService.getAccountConnector();
- const teamId = await accountConnector.getCandidateTeam(acRequest.candidate);
- const vaultSetting = await accountConnector.getTeamSetting(
- acRequest,
- teamId,
- this.vaultName
- );
- const vaultData = JSON.parse(vaultSetting || "{}");
- return vaultData[keyId];
- }
-
- @SecureConnector.AccessControl
- protected async set(acRequest: AccessRequest, keyId: string, value: string) {
- const accountConnector = ConnectorService.getAccountConnector();
- const teamId = await accountConnector.getCandidateTeam(acRequest.candidate);
- const vaultSetting = await accountConnector.getTeamSetting(
- acRequest,
- teamId,
- this.vaultName
- );
- const vaultData = JSON.parse(vaultSetting || "{}");
- vaultData[keyId] = value;
- await this.smythAPI.put(
- `/v1/teams/${teamId}/settings`,
- {
- settingKey: this.vaultName,
- settingValue: JSON.stringify(vaultData),
- },
- { headers: await this.getSmythRequestHeaders() }
- );
- }
-
- @SecureConnector.AccessControl
- protected async delete(acRequest: AccessRequest, keyId: string) {
- const accountConnector = ConnectorService.getAccountConnector();
- const teamId = await accountConnector.getCandidateTeam(acRequest.candidate);
- const vaultSetting = await accountConnector.getTeamSetting(
- acRequest,
- teamId,
- this.vaultName
- );
- const vaultData = JSON.parse(vaultSetting || "{}");
- delete vaultData[keyId];
- await this.smythAPI.put(
- `/v1/teams/${teamId}/settings`,
- {
- settingKey: this.vaultName,
- settingValue: JSON.stringify(vaultData),
- },
- { headers: await this.getSmythRequestHeaders() }
- );
- }
-
- @SecureConnector.AccessControl
- protected async exists(acRequest: AccessRequest, keyId: string) {
- const accountConnector = ConnectorService.getAccountConnector();
- const teamId = await accountConnector.getCandidateTeam(acRequest.candidate);
- const vaultSetting = await accountConnector.getTeamSetting(
- acRequest,
- teamId,
- this.vaultName
- );
- const vaultData = JSON.parse(vaultSetting || "{}");
- return keyId in vaultData;
- }
-
- public async getResourceACL(resourceId: string, candidate: IAccessCandidate) {
- const accountConnector = ConnectorService.getAccountConnector();
- const teamId = await accountConnector.getCandidateTeam(candidate);
-
- const acl = new ACL();
-
- acl
- .addAccess(TAccessRole.Team, teamId, TAccessLevel.Owner)
- .addAccess(TAccessRole.Team, teamId, TAccessLevel.Read)
- .addAccess(TAccessRole.Team, teamId, TAccessLevel.Write);
-
- return acl;
- }
-
- private async getSmythRequestHeaders() {
- return {
- Authorization: `Bearer ${await getM2MToken({
- baseUrl: this.oAuthBaseUrl,
- oauthAppId: this.oAuthAppId,
- oauthAppSecret: this.oAuthAppSecret,
- resource: this.oAuthResource,
- scope: this.oAuthScope,
- })}`,
- };
- }
-}