@openenthrium/oe-runtime-sdk 1.7.5
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 +139 -0
- package/index.js +58 -0
- package/package.json +64 -0
- package/src/data/connectionTypes.json +18587 -0
- package/src/engine/index.js +183 -0
- package/src/engine/llm.js +71 -0
- package/src/engine/promptBuilder.js +38 -0
- package/src/index.js +156 -0
- package/src/middleware/auth.js +63 -0
- package/src/providers/embedding/index.js +69 -0
- package/src/providers/llm/index.js +136 -0
- package/src/routes/admin.js +686 -0
- package/src/routes/agents.js +193 -0
- package/src/routes/apiKeys.js +55 -0
- package/src/routes/audio.js +111 -0
- package/src/routes/auth.js +83 -0
- package/src/routes/chat.js +381 -0
- package/src/routes/connectors.js +435 -0
- package/src/routes/dashboard.js +244 -0
- package/src/routes/documents.js +443 -0
- package/src/routes/embed.js +103 -0
- package/src/routes/marketplace.js +49 -0
- package/src/routes/models.js +81 -0
- package/src/routes/oauth.js +423 -0
- package/src/routes/projects.js +238 -0
- package/src/routes/settings.js +45 -0
- package/src/routes/setup.js +42 -0
- package/src/routes/sso.js +218 -0
- package/src/routes/superadmin.js +51 -0
- package/src/routes/templates.js +75 -0
- package/src/routes/threads.js +53 -0
- package/src/routes/workspaces.js +464 -0
- package/src/telemetry/bootstrap.js +39 -0
- package/src/telemetry/registration.js +16 -0
- package/src/utils/activityLog.js +16 -0
- package/src/utils/agentChain.js +141 -0
- package/src/utils/buildVisualization.js +102 -0
- package/src/utils/dlpScanner.js +57 -0
- package/src/utils/ingestionQueue.js +240 -0
- package/src/utils/prepareConnectors.js +66 -0
- package/src/utils/rag/_settings.js +6 -0
- package/src/utils/rag/chroma.js +82 -0
- package/src/utils/rag/lancedb.js +103 -0
- package/src/utils/rag/milvus.js +116 -0
- package/src/utils/rag/pgvector.js +104 -0
- package/src/utils/rag/pinecone.js +71 -0
- package/src/utils/rag/qdrant.js +106 -0
- package/src/utils/rag/weaviate.js +137 -0
- package/src/utils/rag/zilliz.js +115 -0
- package/src/utils/scheduler.js +168 -0
- package/src/utils/tier.js +106 -0
- package/src/utils/tools/adapters/_template.js +74 -0
- package/src/utils/tools/adapters/box.js +71 -0
- package/src/utils/tools/adapters/confluence.js +80 -0
- package/src/utils/tools/adapters/database.js +215 -0
- package/src/utils/tools/adapters/dropbox.js +74 -0
- package/src/utils/tools/adapters/elasticsearch.js +90 -0
- package/src/utils/tools/adapters/filesystem.js +197 -0
- package/src/utils/tools/adapters/freshdesk.js +87 -0
- package/src/utils/tools/adapters/gdrive.js +326 -0
- package/src/utils/tools/adapters/github.js +169 -0
- package/src/utils/tools/adapters/gmail.js +157 -0
- package/src/utils/tools/adapters/graphql.js +73 -0
- package/src/utils/tools/adapters/hubspot.js +101 -0
- package/src/utils/tools/adapters/image-gen.js +120 -0
- package/src/utils/tools/adapters/jira.js +86 -0
- package/src/utils/tools/adapters/kafka.js +126 -0
- package/src/utils/tools/adapters/ldap.js +118 -0
- package/src/utils/tools/adapters/mcp-client.js +138 -0
- package/src/utils/tools/adapters/mongodb.js +119 -0
- package/src/utils/tools/adapters/mqtt.js +106 -0
- package/src/utils/tools/adapters/music-gen.js +118 -0
- package/src/utils/tools/adapters/notion.js +93 -0
- package/src/utils/tools/adapters/ocr.js +107 -0
- package/src/utils/tools/adapters/onedrive.js +72 -0
- package/src/utils/tools/adapters/redis.js +104 -0
- package/src/utils/tools/adapters/rest-api.js +119 -0
- package/src/utils/tools/adapters/s3.js +142 -0
- package/src/utils/tools/adapters/search.js +80 -0
- package/src/utils/tools/adapters/sftp.js +121 -0
- package/src/utils/tools/adapters/shell.js +97 -0
- package/src/utils/tools/adapters/slack.js +83 -0
- package/src/utils/tools/adapters/speech.js +160 -0
- package/src/utils/tools/adapters/ssh.js +113 -0
- package/src/utils/tools/adapters/video-gen.js +152 -0
- package/src/utils/tools/adapters/web3.js +111 -0
- package/src/utils/tools/adapters/zendesk.js +82 -0
- package/src/utils/tools/adapters/zoho-mail.js +246 -0
- package/src/utils/tools/registry.js +229 -0
- package/src/utils/vectorStore.js +68 -0
- package/src/utils/workflowEngine.js +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# OE Runtime SDK
|
|
2
|
+
|
|
3
|
+
Embed AI agent execution directly in your Node.js application. Same engine as [OE Runtime CLI](https://www.openenthrium.com/runtime.html) — no subprocess, no HTTP overhead, just a function call.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @openenthrium/oe-runtime-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Install only the connector dependencies your agents actually use:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# PostgreSQL / MySQL / SQLite
|
|
15
|
+
npm install pg # PostgreSQL
|
|
16
|
+
npm install mysql2 # MySQL / MariaDB
|
|
17
|
+
npm install better-sqlite3 # SQLite
|
|
18
|
+
|
|
19
|
+
# MongoDB
|
|
20
|
+
npm install mongodb
|
|
21
|
+
|
|
22
|
+
# Redis
|
|
23
|
+
npm install ioredis
|
|
24
|
+
|
|
25
|
+
# Kafka / RabbitMQ
|
|
26
|
+
npm install kafkajs
|
|
27
|
+
|
|
28
|
+
# S3 / object storage
|
|
29
|
+
npm install @aws-sdk/client-s3
|
|
30
|
+
|
|
31
|
+
# SSH
|
|
32
|
+
npm install ssh2
|
|
33
|
+
|
|
34
|
+
# Gmail / Google Drive
|
|
35
|
+
npm install googleapis
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### From file paths
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
const { runAgent } = require("@openenthrium/oe-runtime-sdk");
|
|
44
|
+
|
|
45
|
+
const result = await runAgent(
|
|
46
|
+
"./agent.yaml", // path to your agent
|
|
47
|
+
"./oe-config.json", // path to your config
|
|
48
|
+
{ topic: "Q3 sales" } // optional params
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
console.log(result.output);
|
|
52
|
+
console.log(result.toolCalls); // list of connector tools called
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### From objects (no file I/O)
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
const { runAgentFromObject } = require("@openenthrium/oe-runtime-sdk");
|
|
59
|
+
|
|
60
|
+
const agent = {
|
|
61
|
+
name: "Database Analyst",
|
|
62
|
+
instructions: "You are a SQL analyst.",
|
|
63
|
+
steps: [{ name: "Query", content: "List all tables and their row counts." }],
|
|
64
|
+
connectors: [{ connection_name: "My Database", connection_type: "postgresql" }],
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const config = {
|
|
68
|
+
llm: { provider: "openai", model: "gpt-4o", apiKey: "sk-..." },
|
|
69
|
+
connectors: [{
|
|
70
|
+
connection_name: "My Database",
|
|
71
|
+
connection_type: "postgresql",
|
|
72
|
+
host: "localhost", port: 5432,
|
|
73
|
+
database: "mydb", user: "postgres", password: "secret"
|
|
74
|
+
}]
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const result = await runAgentFromObject(agent, config, {});
|
|
78
|
+
console.log(result.output);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### With hooks (streaming tool calls)
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
const { runAgent } = require("@openenthrium/oe-runtime-sdk");
|
|
85
|
+
|
|
86
|
+
const result = await runAgent("./agent.yaml", "./oe-config.json", {}, {
|
|
87
|
+
onToolCall: (name) => console.log(`→ ${name}`),
|
|
88
|
+
onToolResult: (name, result) => console.log(`↳ ${result}`),
|
|
89
|
+
onDone: (output) => console.log("Done:", output),
|
|
90
|
+
onError: (err) => console.error("Error:", err),
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Config file format
|
|
95
|
+
|
|
96
|
+
Same `oe-config.json` used by OE Runtime CLI — no changes needed:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"llm": {
|
|
101
|
+
"provider": "openai",
|
|
102
|
+
"model": "gpt-4o",
|
|
103
|
+
"apiKey": "YOUR_OPENAI_API_KEY"
|
|
104
|
+
},
|
|
105
|
+
"server": {
|
|
106
|
+
"enabled": false,
|
|
107
|
+
"port": 3333,
|
|
108
|
+
"apiKey": "your-secret-api-key"
|
|
109
|
+
},
|
|
110
|
+
"connectors": [
|
|
111
|
+
{
|
|
112
|
+
"connection_name": "My Database",
|
|
113
|
+
"connection_type": "postgresql",
|
|
114
|
+
"host": "localhost",
|
|
115
|
+
"port": 5432,
|
|
116
|
+
"database": "mydb",
|
|
117
|
+
"user": "postgres",
|
|
118
|
+
"password": "YOUR_DB_PASSWORD"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Supported LLM providers
|
|
125
|
+
|
|
126
|
+
OpenAI, Anthropic, Azure OpenAI, Groq, Mistral, Ollama, Google Gemini, AWS Bedrock, and any OpenAI-compatible endpoint.
|
|
127
|
+
|
|
128
|
+
## Supported connectors
|
|
129
|
+
|
|
130
|
+
30+ connector types — PostgreSQL, MySQL, MongoDB, Redis, Elasticsearch, S3, GitHub, Slack, Gmail, Jira, Confluence, Notion, HubSpot, Kafka, MQTT, LDAP, GraphQL, Web3/Blockchain, SSH, shell, SFTP, and more.
|
|
131
|
+
|
|
132
|
+
See [OE Runtime Connector Catalog](https://www.openenthrium.com/runtime.html) for the full list.
|
|
133
|
+
|
|
134
|
+
## Links
|
|
135
|
+
|
|
136
|
+
- [OE Runtime CLI](https://www.openenthrium.com/runtime.html)
|
|
137
|
+
- [Sample library](https://github.com/enthrium/open-enthrium-ai-agent-runtime/releases/latest/download/oe-runtime-samples.zip)
|
|
138
|
+
- [GitHub](https://github.com/enthrium/open-enthrium-ai-agent-runtime)
|
|
139
|
+
- [Open Enthrium](https://www.openenthrium.com)
|
package/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const yaml = require("js-yaml");
|
|
6
|
+
|
|
7
|
+
// Works in both monorepo context (../src/) and npm-installed context (./src/)
|
|
8
|
+
const srcDir = fs.existsSync(path.join(__dirname, "src", "engine"))
|
|
9
|
+
? path.join(__dirname, "src")
|
|
10
|
+
: path.join(__dirname, "..", "src");
|
|
11
|
+
|
|
12
|
+
const engine = require(path.join(srcDir, "engine"));
|
|
13
|
+
const { prepareConnectors } = require(path.join(srcDir, "utils", "prepareConnectors"));
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Run an agent from file paths.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} agentPath - Path to agent.yaml
|
|
19
|
+
* @param {string} configPath - Path to oe-config.json
|
|
20
|
+
* @param {object} params - Optional key/value params (replaces {{param}} in prompts)
|
|
21
|
+
* @param {object} hooks - Optional hooks: { onToolCall, onToolResult, onDone, onError }
|
|
22
|
+
* @returns {Promise<{ output: string, toolCalls: string[] }>}
|
|
23
|
+
*/
|
|
24
|
+
async function runAgent(agentPath, configPath, params = {}, hooks = {}) {
|
|
25
|
+
const agentYaml = yaml.load(fs.readFileSync(path.resolve(agentPath), "utf8"));
|
|
26
|
+
const config = JSON.parse(fs.readFileSync(path.resolve(configPath), "utf8"));
|
|
27
|
+
return _run(agentYaml, config, params, hooks);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Run an agent from already-parsed objects.
|
|
32
|
+
*
|
|
33
|
+
* @param {object} agentYaml - Parsed agent YAML object
|
|
34
|
+
* @param {object} config - Parsed oe-config.json object { llm, connectors, server }
|
|
35
|
+
* @param {object} params - Optional key/value params
|
|
36
|
+
* @param {object} hooks - Optional hooks: { onToolCall, onToolResult, onDone, onError }
|
|
37
|
+
* @returns {Promise<{ output: string, toolCalls: string[] }>}
|
|
38
|
+
*/
|
|
39
|
+
async function runAgentFromObject(agentYaml, config, params = {}, hooks = {}) {
|
|
40
|
+
return _run(agentYaml, config, params, hooks);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function _run(agentYaml, config, params, hooks) {
|
|
44
|
+
const connectors = prepareConnectors(agentYaml.connectors, config.connectors);
|
|
45
|
+
|
|
46
|
+
const agentSpec = {
|
|
47
|
+
systemPrompt: agentYaml.systemPrompt || agentYaml.system_prompt || agentYaml.instructions || "",
|
|
48
|
+
workflow: agentYaml.steps || agentYaml.workflow || [],
|
|
49
|
+
params: agentYaml.params || [],
|
|
50
|
+
paramValues: params || {},
|
|
51
|
+
maxRounds: agentYaml.maxRounds || 25,
|
|
52
|
+
input: null,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return engine.run(agentSpec, config.llm, connectors, hooks);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = { runAgent, runAgentFromObject };
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openenthrium/oe-runtime-sdk",
|
|
3
|
+
"version": "1.7.5",
|
|
4
|
+
"description": "OE Runtime SDK — embed AI agent execution directly in your Node.js application. Same engine as OE Runtime CLI, importable as a library.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"homepage": "https://www.openenthrium.com/runtime.html",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/enthrium/open-enthrium-ai-agent-runtime"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"ai-agent", "llm", "openai", "anthropic", "enterprise",
|
|
13
|
+
"oe-runtime", "agent-sdk", "postgresql", "mongodb", "kafka",
|
|
14
|
+
"open-enthrium", "automation"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@anthropic-ai/sdk": "^0.27.0",
|
|
19
|
+
"axios": "^1.7.7",
|
|
20
|
+
"js-yaml": "^4.1.0",
|
|
21
|
+
"openai": "^4.67.3"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@aws-sdk/client-s3": "optional",
|
|
25
|
+
"@elastic/elasticsearch": "optional",
|
|
26
|
+
"better-sqlite3": "optional",
|
|
27
|
+
"googleapis": "optional",
|
|
28
|
+
"imapflow": "optional",
|
|
29
|
+
"ioredis": "optional",
|
|
30
|
+
"kafkajs": "optional",
|
|
31
|
+
"ldapts": "optional",
|
|
32
|
+
"mongodb": "optional",
|
|
33
|
+
"mqtt": "optional",
|
|
34
|
+
"mssql": "optional",
|
|
35
|
+
"mysql2": "optional",
|
|
36
|
+
"nodemailer": "optional",
|
|
37
|
+
"oracledb": "optional",
|
|
38
|
+
"pg": "optional",
|
|
39
|
+
"snowflake-sdk": "optional",
|
|
40
|
+
"ssh2": "optional"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"@aws-sdk/client-s3": { "optional": true },
|
|
44
|
+
"@elastic/elasticsearch": { "optional": true },
|
|
45
|
+
"better-sqlite3": { "optional": true },
|
|
46
|
+
"googleapis": { "optional": true },
|
|
47
|
+
"imapflow": { "optional": true },
|
|
48
|
+
"ioredis": { "optional": true },
|
|
49
|
+
"kafkajs": { "optional": true },
|
|
50
|
+
"ldapts": { "optional": true },
|
|
51
|
+
"mongodb": { "optional": true },
|
|
52
|
+
"mqtt": { "optional": true },
|
|
53
|
+
"mssql": { "optional": true },
|
|
54
|
+
"mysql2": { "optional": true },
|
|
55
|
+
"nodemailer": { "optional": true },
|
|
56
|
+
"oracledb": { "optional": true },
|
|
57
|
+
"pg": { "optional": true },
|
|
58
|
+
"snowflake-sdk": { "optional": true },
|
|
59
|
+
"ssh2": { "optional": true }
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=18"
|
|
63
|
+
}
|
|
64
|
+
}
|