@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.
Files changed (56) hide show
  1. package/dist/call-guards.d.ts +47 -0
  2. package/dist/call-guards.d.ts.map +1 -0
  3. package/dist/call-guards.js +215 -0
  4. package/dist/call-guards.js.map +1 -0
  5. package/dist/dispatch.d.ts +5 -1
  6. package/dist/dispatch.d.ts.map +1 -1
  7. package/dist/dispatch.js +19 -2
  8. package/dist/dispatch.js.map +1 -1
  9. package/dist/get-has-no-body.d.ts +49 -0
  10. package/dist/get-has-no-body.d.ts.map +1 -0
  11. package/dist/get-has-no-body.js +104 -0
  12. package/dist/get-has-no-body.js.map +1 -0
  13. package/dist/index.d.ts +7 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +7 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp-app.d.ts +118 -0
  18. package/dist/mcp-app.d.ts.map +1 -0
  19. package/dist/mcp-app.js +126 -0
  20. package/dist/mcp-app.js.map +1 -0
  21. package/dist/meta-tools.d.ts +1 -1
  22. package/dist/meta-tools.d.ts.map +1 -1
  23. package/dist/meta-tools.js +28 -6
  24. package/dist/meta-tools.js.map +1 -1
  25. package/dist/proxied-tool.d.ts +33 -3
  26. package/dist/proxied-tool.d.ts.map +1 -1
  27. package/dist/proxied-tool.js +234 -21
  28. package/dist/proxied-tool.js.map +1 -1
  29. package/dist/results.d.ts +20 -1
  30. package/dist/results.d.ts.map +1 -1
  31. package/dist/results.js +117 -3
  32. package/dist/results.js.map +1 -1
  33. package/dist/schema-validity.d.ts +50 -0
  34. package/dist/schema-validity.d.ts.map +1 -0
  35. package/dist/schema-validity.js +254 -0
  36. package/dist/schema-validity.js.map +1 -0
  37. package/dist/tool-interface.d.ts +137 -0
  38. package/dist/tool-interface.d.ts.map +1 -0
  39. package/dist/tool-interface.js +640 -0
  40. package/dist/tool-interface.js.map +1 -0
  41. package/dist/utcp-namespace.d.ts +14 -0
  42. package/dist/utcp-namespace.d.ts.map +1 -1
  43. package/dist/utcp-namespace.js +7 -2
  44. package/dist/utcp-namespace.js.map +1 -1
  45. package/package.json +2 -1
  46. package/src/call-guards.ts +237 -0
  47. package/src/dispatch.ts +18 -1
  48. package/src/get-has-no-body.ts +110 -0
  49. package/src/index.ts +45 -0
  50. package/src/mcp-app.ts +194 -0
  51. package/src/meta-tools.ts +31 -6
  52. package/src/proxied-tool.ts +237 -19
  53. package/src/results.ts +129 -3
  54. package/src/schema-validity.ts +264 -0
  55. package/src/tool-interface.ts +673 -0
  56. package/src/utcp-namespace.ts +7 -2
@@ -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 isBevelHostedUrl(url: string): boolean {
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' || !isBevelHostedUrl(url)) continue;
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
  }