@wonderlandengine/mcp-plugin 1.0.3

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.
@@ -0,0 +1,29 @@
1
+ export class WorkQueue {
2
+ _queue = [];
3
+ /**
4
+ * Push a new work item into the queue
5
+ */
6
+ async push(func) {
7
+ return new Promise((res, rej) => {
8
+ this._queue.push({ func, res, rej });
9
+ });
10
+ }
11
+ /**
12
+ * Run the top most command in the queue
13
+ *
14
+ * @returns `true`, if a command was run, `false` if the queue was empty.
15
+ */
16
+ pop() {
17
+ if (this._queue.length == 0)
18
+ return false;
19
+ const { func, res, rej } = this._queue.pop();
20
+ func().then(res).catch(rej);
21
+ return true;
22
+ }
23
+ /**
24
+ * Whether the work queue is empty
25
+ */
26
+ get empty() {
27
+ return this._queue.length == 0;
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@wonderlandengine/mcp-plugin",
3
+ "version": "1.0.3",
4
+ "main": "./build/index.mjs",
5
+ "type": "module",
6
+ "module": "./build/index.mjs",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "watch": "tsc --watch",
10
+ "inspect": "npx -y @modelcontextprotocol/inspector",
11
+ "prepack": "npm run build"
12
+ },
13
+ "files": [
14
+ "build"
15
+ ],
16
+ "author": "Wonderland Engine (Create Worlds)",
17
+ "license": "MIT",
18
+ "description": "",
19
+ "wonderlandengine": {},
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.13.2",
22
+ "@wonderlandengine/editor-api": "1.5.0-rc.3",
23
+ "express": "^5.1.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^18",
27
+ "@types/express": "^5.0.1",
28
+ "typescript": "^5.3.3"
29
+ }
30
+ }