@openenthrium/oe-runtime-sdk 1.8.4 → 1.8.6
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 +1 -1
- package/package.json +1 -1
- package/src/routes/marketplace.js +16 -16
- package/src/routes/templates.js +1 -1
- package/src/utils/tools/registry.js +1 -0
package/README.md
CHANGED
|
@@ -134,6 +134,6 @@ See [OE Runtime Connector Catalog](https://www.openenthrium.com/runtime.html) fo
|
|
|
134
134
|
## Links
|
|
135
135
|
|
|
136
136
|
- [OE Runtime CLI](https://www.openenthrium.com/runtime.html)
|
|
137
|
-
- [
|
|
137
|
+
- [Skills library](https://github.com/enthrium/open-enthrium-ai-agent-runtime/releases/latest/download/oe-runtime-skills.zip)
|
|
138
138
|
- [GitHub](https://github.com/enthrium/open-enthrium-ai-agent-runtime)
|
|
139
139
|
- [Open Enthrium](https://www.openenthrium.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openenthrium/oe-runtime-sdk",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.6",
|
|
4
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
5
|
"main": "index.js",
|
|
6
6
|
"homepage": "https://www.openenthrium.com/runtime.html",
|
|
@@ -3,15 +3,15 @@ const { authenticate } = require("../middleware/auth");
|
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const SKILLS_DIR = path.resolve(__dirname, "../../cli/skills");
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
if (!fs.existsSync(
|
|
10
|
-
return fs.readdirSync(
|
|
11
|
-
.filter(f => fs.statSync(path.join(
|
|
8
|
+
function readSkills() {
|
|
9
|
+
if (!fs.existsSync(SKILLS_DIR)) return [];
|
|
10
|
+
return fs.readdirSync(SKILLS_DIR)
|
|
11
|
+
.filter(f => fs.statSync(path.join(SKILLS_DIR, f)).isDirectory())
|
|
12
12
|
.map(folder => {
|
|
13
|
-
const yamlPath = path.join(
|
|
14
|
-
const configPath = path.join(
|
|
13
|
+
const yamlPath = path.join(SKILLS_DIR, folder, "agent.yaml");
|
|
14
|
+
const configPath = path.join(SKILLS_DIR, folder, "oe-config.json");
|
|
15
15
|
const yaml = fs.existsSync(yamlPath) ? fs.readFileSync(yamlPath, "utf8") : null;
|
|
16
16
|
const config = fs.existsSync(configPath) ? fs.readFileSync(configPath, "utf8") : null;
|
|
17
17
|
return { folder, yaml, config };
|
|
@@ -19,27 +19,27 @@ function readSamples() {
|
|
|
19
19
|
.filter(s => s.yaml);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// GET /api/marketplace/
|
|
23
|
-
router.get("/
|
|
22
|
+
// GET /api/marketplace/skills
|
|
23
|
+
router.get("/skills", authenticate, (req, res) => {
|
|
24
24
|
try {
|
|
25
|
-
res.json({
|
|
25
|
+
res.json({ skills: readSkills() });
|
|
26
26
|
} catch (e) {
|
|
27
27
|
res.status(500).json({ error: e.message });
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
// GET /api/marketplace/
|
|
32
|
-
router.get("/
|
|
33
|
-
const file = path.join(
|
|
31
|
+
// GET /api/marketplace/skills/:folder/yaml
|
|
32
|
+
router.get("/skills/:folder/yaml", authenticate, (req, res) => {
|
|
33
|
+
const file = path.join(SKILLS_DIR, req.params.folder, "agent.yaml");
|
|
34
34
|
if (!fs.existsSync(file)) return res.status(404).json({ error: "Not found" });
|
|
35
35
|
res.setHeader("Content-Type", "text/yaml");
|
|
36
36
|
res.setHeader("Content-Disposition", `attachment; filename="${req.params.folder}.yaml"`);
|
|
37
37
|
res.send(fs.readFileSync(file, "utf8"));
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
// GET /api/marketplace/
|
|
41
|
-
router.get("/
|
|
42
|
-
const file = path.join(
|
|
40
|
+
// GET /api/marketplace/skills/:folder/config
|
|
41
|
+
router.get("/skills/:folder/config", authenticate, (req, res) => {
|
|
42
|
+
const file = path.join(SKILLS_DIR, req.params.folder, "oe-config.json");
|
|
43
43
|
if (!fs.existsSync(file)) return res.status(404).json({ error: "Not found" });
|
|
44
44
|
res.setHeader("Content-Type", "application/json");
|
|
45
45
|
res.setHeader("Content-Disposition", `attachment; filename="${req.params.folder}.oe-config.json"`);
|
package/src/routes/templates.js
CHANGED
|
@@ -6,7 +6,7 @@ const yaml = require("js-yaml");
|
|
|
6
6
|
|
|
7
7
|
router.use(authenticate, requireManagerOrAdmin);
|
|
8
8
|
|
|
9
|
-
const SAMPLES_DIR = path.resolve(__dirname, "../../cli/
|
|
9
|
+
const SAMPLES_DIR = path.resolve(__dirname, "../../cli/skills");
|
|
10
10
|
|
|
11
11
|
// ── List templates ─────────────────────────────────────────────────────────────
|
|
12
12
|
router.get("/", (req, res) => {
|