syntaur 0.1.10 → 0.1.13
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/dashboard/server.d.ts +2 -0
- package/dist/dashboard/server.js +3 -8
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +32 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@ interface DashboardServerOptions {
|
|
|
5
5
|
playbooksDir: string;
|
|
6
6
|
todosDir: string;
|
|
7
7
|
serveStaticUi: boolean;
|
|
8
|
+
/** Absolute path to the built dashboard UI (dashboard/dist). Required when serveStaticUi is true. */
|
|
9
|
+
dashboardDistPath?: string;
|
|
8
10
|
}
|
|
9
11
|
declare function createDashboardServer(options: DashboardServerOptions): {
|
|
10
12
|
start(): Promise<void>;
|
package/dist/dashboard/server.js
CHANGED
|
@@ -3135,10 +3135,9 @@ var init_parser2 = __esm({
|
|
|
3135
3135
|
init_api();
|
|
3136
3136
|
import express from "express";
|
|
3137
3137
|
import { createServer } from "http";
|
|
3138
|
-
import { resolve as resolve14
|
|
3138
|
+
import { resolve as resolve14 } from "path";
|
|
3139
3139
|
import { homedir as homedir2 } from "os";
|
|
3140
3140
|
import { writeFile as writeFile3, unlink as unlink3 } from "fs/promises";
|
|
3141
|
-
import { fileURLToPath } from "url";
|
|
3142
3141
|
import { WebSocketServer, WebSocket } from "ws";
|
|
3143
3142
|
|
|
3144
3143
|
// src/dashboard/watcher.ts
|
|
@@ -5730,11 +5729,8 @@ async function reconcile(serversDir, missionsDir, excludePids) {
|
|
|
5730
5729
|
}
|
|
5731
5730
|
|
|
5732
5731
|
// src/dashboard/server.ts
|
|
5733
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
5734
|
-
var __dirname = dirname3(__filename);
|
|
5735
|
-
var packageRoot = resolve14(__dirname, "..", "..");
|
|
5736
5732
|
function createDashboardServer(options) {
|
|
5737
|
-
const { port, missionsDir, serversDir, playbooksDir, todosDir, serveStaticUi } = options;
|
|
5733
|
+
const { port, missionsDir, serversDir, playbooksDir, todosDir, serveStaticUi, dashboardDistPath } = options;
|
|
5738
5734
|
const app = express();
|
|
5739
5735
|
const server = createServer(app);
|
|
5740
5736
|
const wss = new WebSocketServer({ noServer: true });
|
|
@@ -5955,8 +5951,7 @@ function createDashboardServer(options) {
|
|
|
5955
5951
|
app.use("/api/agent-sessions", createAgentSessionsRouter(missionsDir, broadcast));
|
|
5956
5952
|
app.use("/api/playbooks", createPlaybooksRouter(playbooksDir));
|
|
5957
5953
|
app.use("/api/todos", createTodosRouter(todosDir, broadcast));
|
|
5958
|
-
if (serveStaticUi) {
|
|
5959
|
-
const dashboardDistPath = resolve14(packageRoot, "dashboard", "dist");
|
|
5954
|
+
if (serveStaticUi && dashboardDistPath) {
|
|
5960
5955
|
app.use(express.static(dashboardDistPath));
|
|
5961
5956
|
app.get("{*path}", async (_req, res) => {
|
|
5962
5957
|
const indexPath = resolve14(dashboardDistPath, "index.html");
|