@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.
Files changed (91) hide show
  1. package/README.md +139 -0
  2. package/index.js +58 -0
  3. package/package.json +64 -0
  4. package/src/data/connectionTypes.json +18587 -0
  5. package/src/engine/index.js +183 -0
  6. package/src/engine/llm.js +71 -0
  7. package/src/engine/promptBuilder.js +38 -0
  8. package/src/index.js +156 -0
  9. package/src/middleware/auth.js +63 -0
  10. package/src/providers/embedding/index.js +69 -0
  11. package/src/providers/llm/index.js +136 -0
  12. package/src/routes/admin.js +686 -0
  13. package/src/routes/agents.js +193 -0
  14. package/src/routes/apiKeys.js +55 -0
  15. package/src/routes/audio.js +111 -0
  16. package/src/routes/auth.js +83 -0
  17. package/src/routes/chat.js +381 -0
  18. package/src/routes/connectors.js +435 -0
  19. package/src/routes/dashboard.js +244 -0
  20. package/src/routes/documents.js +443 -0
  21. package/src/routes/embed.js +103 -0
  22. package/src/routes/marketplace.js +49 -0
  23. package/src/routes/models.js +81 -0
  24. package/src/routes/oauth.js +423 -0
  25. package/src/routes/projects.js +238 -0
  26. package/src/routes/settings.js +45 -0
  27. package/src/routes/setup.js +42 -0
  28. package/src/routes/sso.js +218 -0
  29. package/src/routes/superadmin.js +51 -0
  30. package/src/routes/templates.js +75 -0
  31. package/src/routes/threads.js +53 -0
  32. package/src/routes/workspaces.js +464 -0
  33. package/src/telemetry/bootstrap.js +39 -0
  34. package/src/telemetry/registration.js +16 -0
  35. package/src/utils/activityLog.js +16 -0
  36. package/src/utils/agentChain.js +141 -0
  37. package/src/utils/buildVisualization.js +102 -0
  38. package/src/utils/dlpScanner.js +57 -0
  39. package/src/utils/ingestionQueue.js +240 -0
  40. package/src/utils/prepareConnectors.js +66 -0
  41. package/src/utils/rag/_settings.js +6 -0
  42. package/src/utils/rag/chroma.js +82 -0
  43. package/src/utils/rag/lancedb.js +103 -0
  44. package/src/utils/rag/milvus.js +116 -0
  45. package/src/utils/rag/pgvector.js +104 -0
  46. package/src/utils/rag/pinecone.js +71 -0
  47. package/src/utils/rag/qdrant.js +106 -0
  48. package/src/utils/rag/weaviate.js +137 -0
  49. package/src/utils/rag/zilliz.js +115 -0
  50. package/src/utils/scheduler.js +168 -0
  51. package/src/utils/tier.js +106 -0
  52. package/src/utils/tools/adapters/_template.js +74 -0
  53. package/src/utils/tools/adapters/box.js +71 -0
  54. package/src/utils/tools/adapters/confluence.js +80 -0
  55. package/src/utils/tools/adapters/database.js +215 -0
  56. package/src/utils/tools/adapters/dropbox.js +74 -0
  57. package/src/utils/tools/adapters/elasticsearch.js +90 -0
  58. package/src/utils/tools/adapters/filesystem.js +197 -0
  59. package/src/utils/tools/adapters/freshdesk.js +87 -0
  60. package/src/utils/tools/adapters/gdrive.js +326 -0
  61. package/src/utils/tools/adapters/github.js +169 -0
  62. package/src/utils/tools/adapters/gmail.js +157 -0
  63. package/src/utils/tools/adapters/graphql.js +73 -0
  64. package/src/utils/tools/adapters/hubspot.js +101 -0
  65. package/src/utils/tools/adapters/image-gen.js +120 -0
  66. package/src/utils/tools/adapters/jira.js +86 -0
  67. package/src/utils/tools/adapters/kafka.js +126 -0
  68. package/src/utils/tools/adapters/ldap.js +118 -0
  69. package/src/utils/tools/adapters/mcp-client.js +138 -0
  70. package/src/utils/tools/adapters/mongodb.js +119 -0
  71. package/src/utils/tools/adapters/mqtt.js +106 -0
  72. package/src/utils/tools/adapters/music-gen.js +118 -0
  73. package/src/utils/tools/adapters/notion.js +93 -0
  74. package/src/utils/tools/adapters/ocr.js +107 -0
  75. package/src/utils/tools/adapters/onedrive.js +72 -0
  76. package/src/utils/tools/adapters/redis.js +104 -0
  77. package/src/utils/tools/adapters/rest-api.js +119 -0
  78. package/src/utils/tools/adapters/s3.js +142 -0
  79. package/src/utils/tools/adapters/search.js +80 -0
  80. package/src/utils/tools/adapters/sftp.js +121 -0
  81. package/src/utils/tools/adapters/shell.js +97 -0
  82. package/src/utils/tools/adapters/slack.js +83 -0
  83. package/src/utils/tools/adapters/speech.js +160 -0
  84. package/src/utils/tools/adapters/ssh.js +113 -0
  85. package/src/utils/tools/adapters/video-gen.js +152 -0
  86. package/src/utils/tools/adapters/web3.js +111 -0
  87. package/src/utils/tools/adapters/zendesk.js +82 -0
  88. package/src/utils/tools/adapters/zoho-mail.js +246 -0
  89. package/src/utils/tools/registry.js +229 -0
  90. package/src/utils/vectorStore.js +68 -0
  91. 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
+ }