@selvajs/mcp 0.1.0-beta.8 → 0.2.0-beta.0

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,12 @@
1
+ import { type AppCsp } from './app.js';
2
+ import type { ResourceDefinition } from './server.js';
3
+ export declare const SOLVE_VIEW_URI = "ui://selva/solve.html";
4
+ /**
5
+ * Selva's 3D view: draws the geometry a tool hands it under `SOLVE_VIEW_KEY` in its result's
6
+ * `_meta`. Name it in a tool's `ui: { resourceUri: SOLVE_VIEW_URI }`. It needs no `csp`: its
7
+ * script and styles are inline, and `load` reaches geometry through the host, not `fetch`.
8
+ */
9
+ export declare function solveView(options?: {
10
+ csp?: AppCsp;
11
+ }): ResourceDefinition;
12
+ //# sourceMappingURL=views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAOtD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,kBAAkB,CAc5E"}
package/dist/views.js ADDED
@@ -0,0 +1,26 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { appResource } from './app.js';
3
+ export const SOLVE_VIEW_URI = 'ui://selva/solve.html';
4
+ // `../dist/` resolves from both `src/` (the workspace's source condition) and `dist/`.
5
+ const SOLVE_VIEW_FILE = new URL('../dist/views/solve.html', import.meta.url);
6
+ let html;
7
+ /**
8
+ * Selva's 3D view: draws the geometry a tool hands it under `SOLVE_VIEW_KEY` in its result's
9
+ * `_meta`. Name it in a tool's `ui: { resourceUri: SOLVE_VIEW_URI }`. It needs no `csp`: its
10
+ * script and styles are inline, and `load` reaches geometry through the host, not `fetch`.
11
+ */
12
+ export function solveView(options = {}) {
13
+ return appResource({
14
+ uri: SOLVE_VIEW_URI,
15
+ name: 'Solve in 3D',
16
+ description: 'The geometry of a solve, to orbit and zoom.',
17
+ // A failed read isn't cached: in dev the file appears once `vite build` runs.
18
+ html: () => (html ??= readFile(SOLVE_VIEW_FILE, 'utf8').catch((err) => {
19
+ html = undefined;
20
+ throw err;
21
+ })),
22
+ ...(options.csp && { csp: options.csp }),
23
+ prefersBorder: true
24
+ });
25
+ }
26
+ //# sourceMappingURL=views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAEtD,uFAAuF;AACvF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,0BAA0B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE7E,IAAI,IAAiC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,UAA4B,EAAE;IACvD,OAAO,WAAW,CAAC;QAClB,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,6CAA6C;QAC1D,8EAA8E;QAC9E,IAAI,EAAE,GAAG,EAAE,CACV,CAAC,IAAI,KAAK,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YAClE,IAAI,GAAG,SAAS,CAAC;YACjB,MAAM,GAAG,CAAC;QACX,CAAC,CAAC,CAAC;QACJ,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;QACxC,aAAa,EAAE,IAAI;KACnB,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/mcp",
3
- "version": "0.1.0-beta.8",
3
+ "version": "0.2.0-beta.0",
4
4
  "description": "MCP server machinery for Selva hosts: tools over a host's /api/v1, with key auth, error mapping and annotations from its OpenAPI document",
5
5
  "license": "MIT",
6
6
  "author": "VektorNode",
@@ -31,6 +31,11 @@
31
31
  "selva-source": "./src/index.ts",
32
32
  "types": "./dist/index.d.ts",
33
33
  "import": "./dist/index.js"
34
+ },
35
+ "./view": {
36
+ "selva-source": "./src/view/index.ts",
37
+ "types": "./dist/view/index.d.ts",
38
+ "import": "./dist/view/index.js"
34
39
  }
35
40
  },
36
41
  "files": [
@@ -44,16 +49,39 @@
44
49
  "zod": "^4.6.7"
45
50
  },
46
51
  "devDependencies": {
52
+ "@modelcontextprotocol/client": "^2.4.0",
53
+ "@modelcontextprotocol/ext-apps": "^2.0.4",
47
54
  "@types/node": "^24.0.0",
55
+ "@types/three": "^0.187.0",
56
+ "three": "^0.187.0",
48
57
  "typescript": "~6.0.3",
58
+ "vite": "^8.3.5",
59
+ "vite-plugin-singlefile": "^2.3.4",
49
60
  "vitest": "^5.0.5",
50
- "@selvajs/config": "0.0.4",
51
- "@selvajs/server": "2.0.0-beta.24"
61
+ "@selvajs/server": "3.0.0-beta.4",
62
+ "@selvajs/visualization": "1.8.0-beta.2",
63
+ "@selvajs/config": "0.0.4"
64
+ },
65
+ "peerDependencies": {
66
+ "@modelcontextprotocol/ext-apps": "^2.0.4",
67
+ "three": ">=0.179.0",
68
+ "@selvajs/visualization": "^1.8.0-beta.2"
69
+ },
70
+ "peerDependenciesMeta": {
71
+ "@modelcontextprotocol/ext-apps": {
72
+ "optional": true
73
+ },
74
+ "@selvajs/visualization": {
75
+ "optional": true
76
+ },
77
+ "three": {
78
+ "optional": true
79
+ }
52
80
  },
53
81
  "scripts": {
54
- "build": "tsc",
82
+ "build": "tsc && tsc -p src/view && vite build --config views/vite.config.ts",
55
83
  "dev": "tsc --watch",
56
- "type-check": "tsc --noEmit",
84
+ "type-check": "tsc --noEmit && tsc -p src/view --noEmit && tsc -p views",
57
85
  "test": "vitest run",
58
86
  "test:watch": "vitest",
59
87
  "lint": "eslint .",