@nicmeriano/spool-server 0.0.4 → 0.0.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/dist/bin.js +1 -10
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -420,8 +420,6 @@ interface ServerOptions {
|
|
|
420
420
|
port?: number;
|
|
421
421
|
/** Working directory for state file and agent (default: process.cwd()) */
|
|
422
422
|
cwd?: string;
|
|
423
|
-
/** Don't open the browser when the app URL is reported */
|
|
424
|
-
noOpen?: boolean;
|
|
425
423
|
}
|
|
426
424
|
declare function startServer(options?: ServerOptions): Promise<void>;
|
|
427
425
|
|
package/dist/index.js
CHANGED
|
@@ -70,8 +70,6 @@ import { createRequire } from "module";
|
|
|
70
70
|
// src/orchestrator/routes/events.ts
|
|
71
71
|
import { Hono } from "hono";
|
|
72
72
|
import { streamSSE } from "hono/streaming";
|
|
73
|
-
import { execFile } from "child_process";
|
|
74
|
-
import { platform } from "os";
|
|
75
73
|
var sseClients = /* @__PURE__ */ new Map();
|
|
76
74
|
var clientIdCounter = 0;
|
|
77
75
|
function broadcast(message) {
|
|
@@ -126,13 +124,6 @@ function createEventsRoutes(ctx) {
|
|
|
126
124
|
app.post("/app-url", async (c) => {
|
|
127
125
|
const body = await c.req.json();
|
|
128
126
|
console.error(`[spool] Received app URL: ${body.url}`);
|
|
129
|
-
if (!ctx.noOpen) {
|
|
130
|
-
const host = c.req.header("host") || "localhost:3142";
|
|
131
|
-
const shellUrl = `http://${host}`;
|
|
132
|
-
console.error(`[spool] Opening ${shellUrl}`);
|
|
133
|
-
const cmd = platform() === "darwin" ? "open" : platform() === "win32" ? "start" : "xdg-open";
|
|
134
|
-
execFile(cmd, [shellUrl]);
|
|
135
|
-
}
|
|
136
127
|
let state = ctx.getState();
|
|
137
128
|
state = { ...state, appUrl: body.url };
|
|
138
129
|
ctx.setState(state);
|
|
@@ -2063,7 +2054,7 @@ async function startServer(options = {}) {
|
|
|
2063
2054
|
}
|
|
2064
2055
|
}
|
|
2065
2056
|
}));
|
|
2066
|
-
app.route("/api", createEventsRoutes(
|
|
2057
|
+
app.route("/api", createEventsRoutes(routeCtx));
|
|
2067
2058
|
app.route("/api/annotations", createAnnotationsRoutes(routeCtx));
|
|
2068
2059
|
app.route("/api/changes", createChangesRoutes(routeCtx));
|
|
2069
2060
|
app.route("/api/tasks", createTasksRoutes(routeCtx));
|