openbot 0.2.8 → 0.2.10
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/dist/cli.js +1 -1
- package/dist/server.js +5 -23
- package/package.json +1 -2
package/dist/cli.js
CHANGED
|
@@ -26,7 +26,7 @@ checkNodeVersion();
|
|
|
26
26
|
program
|
|
27
27
|
.name("openbot")
|
|
28
28
|
.description("OpenBot CLI - Secure and easy configuration")
|
|
29
|
-
.version("0.2.
|
|
29
|
+
.version("0.2.10");
|
|
30
30
|
async function installPlugin(source, id, quiet = false) {
|
|
31
31
|
try {
|
|
32
32
|
const parsed = parsePluginInstallSource(source);
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import express from "express";
|
|
3
3
|
import cors from "cors";
|
|
4
|
-
import chokidar from "chokidar";
|
|
5
4
|
import { generateId } from "melony";
|
|
6
5
|
import { createOpenBot } from "./open-bot.js";
|
|
7
6
|
import { loadConfig, saveConfig, isConfigured, resolvePath, DEFAULT_BASE_DIR } from "./config.js";
|
|
@@ -69,33 +68,11 @@ export async function startServer(options = {}) {
|
|
|
69
68
|
const pluginsDir = path.join(openBotDir, "plugins");
|
|
70
69
|
await fs.mkdir(agentsDir, { recursive: true });
|
|
71
70
|
await fs.mkdir(pluginsDir, { recursive: true });
|
|
72
|
-
const watcher = chokidar.watch([
|
|
73
|
-
path.join(openBotDir, "config.json"),
|
|
74
|
-
path.join(openBotDir, "AGENT.md"),
|
|
75
|
-
agentsDir,
|
|
76
|
-
pluginsDir,
|
|
77
|
-
], {
|
|
78
|
-
ignoreInitial: true,
|
|
79
|
-
awaitWriteFinish: {
|
|
80
|
-
stabilityThreshold: 300,
|
|
81
|
-
pollInterval: 100,
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
watcher
|
|
85
|
-
.on("add", scheduleReload)
|
|
86
|
-
.on("change", scheduleReload)
|
|
87
|
-
.on("unlink", scheduleReload)
|
|
88
|
-
.on("addDir", scheduleReload)
|
|
89
|
-
.on("unlinkDir", scheduleReload)
|
|
90
|
-
.on("error", (error) => {
|
|
91
|
-
console.error("[hot-reload] Watcher error", error);
|
|
92
|
-
});
|
|
93
71
|
const cleanupWatcher = async () => {
|
|
94
72
|
if (reloadTimer) {
|
|
95
73
|
clearTimeout(reloadTimer);
|
|
96
74
|
reloadTimer = null;
|
|
97
75
|
}
|
|
98
|
-
await watcher.close();
|
|
99
76
|
};
|
|
100
77
|
const runAutomation = async (automation, scheduledAt) => {
|
|
101
78
|
const sessionId = `automation_${automation.id}`;
|
|
@@ -762,6 +739,7 @@ export async function startServer(options = {}) {
|
|
|
762
739
|
model: (typeof body.model === "string" && body.model.trim()) ? body.model.trim() : undefined,
|
|
763
740
|
});
|
|
764
741
|
}
|
|
742
|
+
scheduleReload();
|
|
765
743
|
res.json({ success: true });
|
|
766
744
|
}
|
|
767
745
|
catch (err) {
|
|
@@ -769,6 +747,10 @@ export async function startServer(options = {}) {
|
|
|
769
747
|
res.status(500).json({ error: "Failed to write AGENT.md" });
|
|
770
748
|
}
|
|
771
749
|
});
|
|
750
|
+
app.post("/api/actions/reload", async (_req, res) => {
|
|
751
|
+
scheduleReload();
|
|
752
|
+
res.json({ success: true, message: "Reload scheduled" });
|
|
753
|
+
});
|
|
772
754
|
app.post("/api/actions/open-folder", async (req, res) => {
|
|
773
755
|
const { folder } = req.body;
|
|
774
756
|
if (folder) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openbot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"@melony/ui-kit": "^0.1.30",
|
|
16
16
|
"@types/cors": "^2.8.19",
|
|
17
17
|
"ai": "^6.0.42",
|
|
18
|
-
"chokidar": "^5.0.0",
|
|
19
18
|
"commander": "^14.0.2",
|
|
20
19
|
"cors": "^2.8.6",
|
|
21
20
|
"dotenv": "^16.4.5",
|