openbot 0.2.9 → 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 -31
- 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,41 +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
|
-
ignored: [
|
|
80
|
-
"**/node_modules/**",
|
|
81
|
-
"**/dist/**",
|
|
82
|
-
"**/.git/**",
|
|
83
|
-
"**/package-lock.json",
|
|
84
|
-
"**/pnpm-lock.yaml",
|
|
85
|
-
"**/yarn.lock",
|
|
86
|
-
],
|
|
87
|
-
awaitWriteFinish: {
|
|
88
|
-
stabilityThreshold: 300,
|
|
89
|
-
pollInterval: 100,
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
watcher
|
|
93
|
-
.on("add", scheduleReload)
|
|
94
|
-
.on("change", scheduleReload)
|
|
95
|
-
.on("unlink", scheduleReload)
|
|
96
|
-
.on("addDir", scheduleReload)
|
|
97
|
-
.on("unlinkDir", scheduleReload)
|
|
98
|
-
.on("error", (error) => {
|
|
99
|
-
console.error("[hot-reload] Watcher error", error);
|
|
100
|
-
});
|
|
101
71
|
const cleanupWatcher = async () => {
|
|
102
72
|
if (reloadTimer) {
|
|
103
73
|
clearTimeout(reloadTimer);
|
|
104
74
|
reloadTimer = null;
|
|
105
75
|
}
|
|
106
|
-
await watcher.close();
|
|
107
76
|
};
|
|
108
77
|
const runAutomation = async (automation, scheduledAt) => {
|
|
109
78
|
const sessionId = `automation_${automation.id}`;
|
|
@@ -770,6 +739,7 @@ export async function startServer(options = {}) {
|
|
|
770
739
|
model: (typeof body.model === "string" && body.model.trim()) ? body.model.trim() : undefined,
|
|
771
740
|
});
|
|
772
741
|
}
|
|
742
|
+
scheduleReload();
|
|
773
743
|
res.json({ success: true });
|
|
774
744
|
}
|
|
775
745
|
catch (err) {
|
|
@@ -777,6 +747,10 @@ export async function startServer(options = {}) {
|
|
|
777
747
|
res.status(500).json({ error: "Failed to write AGENT.md" });
|
|
778
748
|
}
|
|
779
749
|
});
|
|
750
|
+
app.post("/api/actions/reload", async (_req, res) => {
|
|
751
|
+
scheduleReload();
|
|
752
|
+
res.json({ success: true, message: "Reload scheduled" });
|
|
753
|
+
});
|
|
780
754
|
app.post("/api/actions/open-folder", async (req, res) => {
|
|
781
755
|
const { folder } = req.body;
|
|
782
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",
|