@bevel-software/platform-mcp-core 0.25.2 → 0.27.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.
- package/dist/call-guards.d.ts +47 -0
- package/dist/call-guards.d.ts.map +1 -0
- package/dist/call-guards.js +215 -0
- package/dist/call-guards.js.map +1 -0
- package/dist/dispatch.d.ts +5 -1
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/dispatch.js +19 -2
- package/dist/dispatch.js.map +1 -1
- package/dist/get-has-no-body.d.ts +49 -0
- package/dist/get-has-no-body.d.ts.map +1 -0
- package/dist/get-has-no-body.js +104 -0
- package/dist/get-has-no-body.js.map +1 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-app.d.ts +118 -0
- package/dist/mcp-app.d.ts.map +1 -0
- package/dist/mcp-app.js +126 -0
- package/dist/mcp-app.js.map +1 -0
- package/dist/meta-tools.d.ts +1 -1
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +28 -6
- package/dist/meta-tools.js.map +1 -1
- package/dist/proxied-tool.d.ts +33 -3
- package/dist/proxied-tool.d.ts.map +1 -1
- package/dist/proxied-tool.js +234 -21
- package/dist/proxied-tool.js.map +1 -1
- package/dist/results.d.ts +20 -1
- package/dist/results.d.ts.map +1 -1
- package/dist/results.js +117 -3
- package/dist/results.js.map +1 -1
- package/dist/schema-validity.d.ts +50 -0
- package/dist/schema-validity.d.ts.map +1 -0
- package/dist/schema-validity.js +254 -0
- package/dist/schema-validity.js.map +1 -0
- package/dist/tool-interface.d.ts +137 -0
- package/dist/tool-interface.d.ts.map +1 -0
- package/dist/tool-interface.js +640 -0
- package/dist/tool-interface.js.map +1 -0
- package/dist/utcp-namespace.d.ts +14 -0
- package/dist/utcp-namespace.d.ts.map +1 -1
- package/dist/utcp-namespace.js +7 -2
- package/dist/utcp-namespace.js.map +1 -1
- package/package.json +2 -1
- package/src/call-guards.ts +237 -0
- package/src/dispatch.ts +18 -1
- package/src/get-has-no-body.ts +110 -0
- package/src/index.ts +45 -0
- package/src/mcp-app.ts +194 -0
- package/src/meta-tools.ts +31 -6
- package/src/proxied-tool.ts +237 -19
- package/src/results.ts +129 -3
- package/src/schema-validity.ts +264 -0
- package/src/tool-interface.ts +673 -0
- package/src/utcp-namespace.ts +7 -2
package/src/utcp-namespace.ts
CHANGED
|
@@ -31,8 +31,13 @@ const LOOPBACK_ORIGIN_TEMPLATE = '${API_URL}';
|
|
|
31
31
|
* (`http://evil.example/?x=${API_URL}`) but can NOT make it the authority without
|
|
32
32
|
* pointing the request back at our own loopback, so anchoring the trust decision
|
|
33
33
|
* to the origin is what a user `.tool`'s URL text cannot forge.
|
|
34
|
+
*
|
|
35
|
+
* Two decisions rest on it, for the same reason: WHICH manuals are seeded the
|
|
36
|
+
* loopback bearer (below), and WHICH tools the tool client leaves unchecked
|
|
37
|
+
* because this server hosts them as routes and their own handlers check them
|
|
38
|
+
* (`call-guards.ts`).
|
|
34
39
|
*/
|
|
35
|
-
function
|
|
40
|
+
export function isPlatformHostedUrl(url: string): boolean {
|
|
36
41
|
if (!url.startsWith(LOOPBACK_ORIGIN_TEMPLATE)) return false;
|
|
37
42
|
// The char right after the origin must delimit the authority; anything else
|
|
38
43
|
// (`${API_URL}.evil.com`, `${API_URL}evil`) is a different, untrusted host.
|
|
@@ -62,7 +67,7 @@ export function seedBevelHostedManualVars(
|
|
|
62
67
|
const name = typeof m.name === 'string' ? m.name : '';
|
|
63
68
|
if (!name) continue;
|
|
64
69
|
const url = (m as { url?: unknown }).url;
|
|
65
|
-
if (typeof url !== 'string' || !
|
|
70
|
+
if (typeof url !== 'string' || !isPlatformHostedUrl(url)) continue;
|
|
66
71
|
variables[utcpNamespacedKey(name, 'API_URL')] = loopbackBaseUrl;
|
|
67
72
|
variables[utcpNamespacedKey(name, 'CONNECTION_KEY')] = connectionKey;
|
|
68
73
|
}
|