godot-daedalus_backend 1.0.0 → 1.0.1
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
CHANGED
|
@@ -37,6 +37,8 @@ npm install godot-daedalus_backend
|
|
|
37
37
|
|
|
38
38
|
## Run The WebSocket Backend
|
|
39
39
|
|
|
40
|
+
After installing the package, start it through the published bin command:
|
|
41
|
+
|
|
40
42
|
```powershell
|
|
41
43
|
$env:PORT = "8080"
|
|
42
44
|
godot-daedalus-backend
|
|
@@ -44,6 +46,31 @@ godot-daedalus-backend
|
|
|
44
46
|
|
|
45
47
|
The Godot plugin connects to this backend over WebSocket. Provider configuration, including the DeepSeek API key, is normally saved from the plugin settings UI.
|
|
46
48
|
|
|
49
|
+
If the package is installed locally in another project, use npm exec or the local `.bin` command:
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
npm exec godot-daedalus-backend
|
|
53
|
+
.\node_modules\.bin\godot-daedalus-backend.cmd
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Do not use `npm run dev` from the consuming Godot project unless that project's own `package.json` defines a `dev` script. `npm run dev` is only a source-repository development command.
|
|
57
|
+
|
|
58
|
+
To add a convenient script in the consuming project:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"scripts": {
|
|
63
|
+
"daedalus": "godot-daedalus-backend"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then run:
|
|
69
|
+
|
|
70
|
+
```powershell
|
|
71
|
+
npm run daedalus
|
|
72
|
+
```
|
|
73
|
+
|
|
47
74
|
## Run The Godot MCP Server
|
|
48
75
|
|
|
49
76
|
The standalone Godot MCP server requires a Godot project path:
|
package/package.json
CHANGED
package/src/protocol/schema.ts
CHANGED
|
@@ -79,6 +79,12 @@ export const clientRequestSchema = z.discriminatedUnion("method", [
|
|
|
79
79
|
method: z.literal("ping"),
|
|
80
80
|
params: z.object({}).optional(),
|
|
81
81
|
}),
|
|
82
|
+
z.object({
|
|
83
|
+
type: z.literal("request"),
|
|
84
|
+
id: z.string(),
|
|
85
|
+
method: z.literal("backend.health"),
|
|
86
|
+
params: z.object({}).optional(),
|
|
87
|
+
}),
|
|
82
88
|
z.object({
|
|
83
89
|
type: z.literal("request"),
|
|
84
90
|
id: z.string(),
|
|
@@ -1991,6 +1991,20 @@ async function handleRequest(socket: WebSocket, request: ClientRequest, session:
|
|
|
1991
1991
|
});
|
|
1992
1992
|
break;
|
|
1993
1993
|
|
|
1994
|
+
case "backend.health":
|
|
1995
|
+
sendJson(socket, {
|
|
1996
|
+
type: "response",
|
|
1997
|
+
id: request.id,
|
|
1998
|
+
ok: true,
|
|
1999
|
+
result: {
|
|
2000
|
+
name: "godot-daedalus-backend",
|
|
2001
|
+
version: "1.0.1",
|
|
2002
|
+
pid: process.pid,
|
|
2003
|
+
mode: process.env.NODE_ENV === "development" || process.env.npm_lifecycle_event === "dev" ? "development" : "runtime"
|
|
2004
|
+
}
|
|
2005
|
+
});
|
|
2006
|
+
break;
|
|
2007
|
+
|
|
1994
2008
|
case "provider.configure":
|
|
1995
2009
|
session.deepseekApiKey = request.params.apiKey;
|
|
1996
2010
|
session.deepseekModel = request.params.model;
|
|
@@ -3899,6 +3913,10 @@ async function handleRequest(socket: WebSocket, request: ClientRequest, session:
|
|
|
3899
3913
|
export function createServer(port: number, mcpHost: McpHost): WebSocketServer {
|
|
3900
3914
|
const server: WebSocketServer = new WebSocketServer({ port });
|
|
3901
3915
|
|
|
3916
|
+
server.on("headers", (headers: string[]): void => {
|
|
3917
|
+
headers.push("X-Godot-Daedalus: websocket");
|
|
3918
|
+
});
|
|
3919
|
+
|
|
3902
3920
|
server.on("connection", (socket: WebSocket, request): void => {
|
|
3903
3921
|
const session: ClientSession = createClientSession(getDefaultWorkspace());
|
|
3904
3922
|
const remoteAddress: string = request.socket.remoteAddress ?? "unknown";
|