@frontmcp/uipack 1.7.2 → 1.8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"base-template.d.ts","sourceRoot":"","sources":["../../src/adapters/base-template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CAoCrF"}
1
+ {"version":3,"file":"base-template.d.ts","sourceRoot":"","sources":["../../src/adapters/base-template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CA6CrF"}
package/adapters/index.js CHANGED
@@ -2836,13 +2836,14 @@ function renderToolTemplate(options) {
2836
2836
  // libs/uipack/src/adapters/base-template.ts
2837
2837
  function createDefaultBaseTemplate(options) {
2838
2838
  const { toolName } = options;
2839
+ const safeToolName = escapeHtml(toolName);
2839
2840
  const bridgeScript = `<script>${generateBridgeIIFE({ minify: true })}</script>`;
2840
2841
  const content = `
2841
2842
  ${bridgeScript}
2842
2843
  <div id="root">
2843
2844
  <div style="font-family:system-ui,sans-serif;padding:1rem;color:#374151;">
2844
2845
  <p style="color:#6b7280;font-size:0.875rem;">Waiting for tool output...</p>
2845
- <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${toolName}</code></p>
2846
+ <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${safeToolName}</code></p>
2846
2847
  </div>
2847
2848
  </div>
2848
2849
  <script>
@@ -2852,9 +2853,13 @@ ${bridgeScript}
2852
2853
  bridge.onToolResult(function(data) {
2853
2854
  var root = document.getElementById('root');
2854
2855
  if (root && data) {
2855
- root.innerHTML = '<pre style="font-family:monospace;white-space:pre-wrap;padding:1rem;">' +
2856
- JSON.stringify(data, null, 2).replace(/</g, '&lt;').replace(/>/g, '&gt;') +
2857
- '</pre>';
2856
+ // textContent, not innerHTML: the previous version escaped only < and >, leaving
2857
+ // the rendered JSON wrong wherever the data contained an entity, and relying on a
2858
+ // hand-rolled replace for safety (GHSA-rhr9-vhpf-jqp7).
2859
+ var pre = document.createElement('pre');
2860
+ pre.setAttribute('style', 'font-family:monospace;white-space:pre-wrap;padding:1rem;');
2861
+ pre.textContent = JSON.stringify(data, null, 2);
2862
+ root.replaceChildren(pre);
2858
2863
  }
2859
2864
  });
2860
2865
  }
@@ -2804,13 +2804,14 @@ function renderToolTemplate(options) {
2804
2804
  // libs/uipack/src/adapters/base-template.ts
2805
2805
  function createDefaultBaseTemplate(options) {
2806
2806
  const { toolName } = options;
2807
+ const safeToolName = escapeHtml(toolName);
2807
2808
  const bridgeScript = `<script>${generateBridgeIIFE({ minify: true })}</script>`;
2808
2809
  const content = `
2809
2810
  ${bridgeScript}
2810
2811
  <div id="root">
2811
2812
  <div style="font-family:system-ui,sans-serif;padding:1rem;color:#374151;">
2812
2813
  <p style="color:#6b7280;font-size:0.875rem;">Waiting for tool output...</p>
2813
- <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${toolName}</code></p>
2814
+ <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${safeToolName}</code></p>
2814
2815
  </div>
2815
2816
  </div>
2816
2817
  <script>
@@ -2820,9 +2821,13 @@ ${bridgeScript}
2820
2821
  bridge.onToolResult(function(data) {
2821
2822
  var root = document.getElementById('root');
2822
2823
  if (root && data) {
2823
- root.innerHTML = '<pre style="font-family:monospace;white-space:pre-wrap;padding:1rem;">' +
2824
- JSON.stringify(data, null, 2).replace(/</g, '&lt;').replace(/>/g, '&gt;') +
2825
- '</pre>';
2824
+ // textContent, not innerHTML: the previous version escaped only < and >, leaving
2825
+ // the rendered JSON wrong wherever the data contained an entity, and relying on a
2826
+ // hand-rolled replace for safety (GHSA-rhr9-vhpf-jqp7).
2827
+ var pre = document.createElement('pre');
2828
+ pre.setAttribute('style', 'font-family:monospace;white-space:pre-wrap;padding:1rem;');
2829
+ pre.textContent = JSON.stringify(data, null, 2);
2830
+ root.replaceChildren(pre);
2826
2831
  }
2827
2832
  });
2828
2833
  }
package/esm/index.mjs CHANGED
@@ -4072,13 +4072,14 @@ function renderToolTemplate(options) {
4072
4072
  // libs/uipack/src/adapters/base-template.ts
4073
4073
  function createDefaultBaseTemplate(options) {
4074
4074
  const { toolName } = options;
4075
+ const safeToolName = escapeHtml(toolName);
4075
4076
  const bridgeScript = `<script>${generateBridgeIIFE({ minify: true })}</script>`;
4076
4077
  const content = `
4077
4078
  ${bridgeScript}
4078
4079
  <div id="root">
4079
4080
  <div style="font-family:system-ui,sans-serif;padding:1rem;color:#374151;">
4080
4081
  <p style="color:#6b7280;font-size:0.875rem;">Waiting for tool output...</p>
4081
- <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${toolName}</code></p>
4082
+ <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${safeToolName}</code></p>
4082
4083
  </div>
4083
4084
  </div>
4084
4085
  <script>
@@ -4088,9 +4089,13 @@ ${bridgeScript}
4088
4089
  bridge.onToolResult(function(data) {
4089
4090
  var root = document.getElementById('root');
4090
4091
  if (root && data) {
4091
- root.innerHTML = '<pre style="font-family:monospace;white-space:pre-wrap;padding:1rem;">' +
4092
- JSON.stringify(data, null, 2).replace(/</g, '&lt;').replace(/>/g, '&gt;') +
4093
- '</pre>';
4092
+ // textContent, not innerHTML: the previous version escaped only < and >, leaving
4093
+ // the rendered JSON wrong wherever the data contained an entity, and relying on a
4094
+ // hand-rolled replace for safety (GHSA-rhr9-vhpf-jqp7).
4095
+ var pre = document.createElement('pre');
4096
+ pre.setAttribute('style', 'font-family:monospace;white-space:pre-wrap;padding:1rem;');
4097
+ pre.textContent = JSON.stringify(data, null, 2);
4098
+ root.replaceChildren(pre);
4094
4099
  }
4095
4100
  });
4096
4101
  }
package/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/uipack",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "FrontMCP UIpack - HTML shell builder, pluggable import resolver, and NPM component loader for MCP UI (React-free core)",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",
@@ -61,6 +61,6 @@
61
61
  "typescript": "^5.9.3"
62
62
  },
63
63
  "peerDependencies": {
64
- "@frontmcp/lazy-zod": "1.7.2"
64
+ "@frontmcp/lazy-zod": "1.8.0"
65
65
  }
66
66
  }
package/index.js CHANGED
@@ -4189,13 +4189,14 @@ function renderToolTemplate(options) {
4189
4189
  // libs/uipack/src/adapters/base-template.ts
4190
4190
  function createDefaultBaseTemplate(options) {
4191
4191
  const { toolName } = options;
4192
+ const safeToolName = escapeHtml(toolName);
4192
4193
  const bridgeScript = `<script>${generateBridgeIIFE({ minify: true })}</script>`;
4193
4194
  const content = `
4194
4195
  ${bridgeScript}
4195
4196
  <div id="root">
4196
4197
  <div style="font-family:system-ui,sans-serif;padding:1rem;color:#374151;">
4197
4198
  <p style="color:#6b7280;font-size:0.875rem;">Waiting for tool output...</p>
4198
- <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${toolName}</code></p>
4199
+ <p style="color:#9ca3af;font-size:0.75rem;">Tool: <code>${safeToolName}</code></p>
4199
4200
  </div>
4200
4201
  </div>
4201
4202
  <script>
@@ -4205,9 +4206,13 @@ ${bridgeScript}
4205
4206
  bridge.onToolResult(function(data) {
4206
4207
  var root = document.getElementById('root');
4207
4208
  if (root && data) {
4208
- root.innerHTML = '<pre style="font-family:monospace;white-space:pre-wrap;padding:1rem;">' +
4209
- JSON.stringify(data, null, 2).replace(/</g, '&lt;').replace(/>/g, '&gt;') +
4210
- '</pre>';
4209
+ // textContent, not innerHTML: the previous version escaped only < and >, leaving
4210
+ // the rendered JSON wrong wherever the data contained an entity, and relying on a
4211
+ // hand-rolled replace for safety (GHSA-rhr9-vhpf-jqp7).
4212
+ var pre = document.createElement('pre');
4213
+ pre.setAttribute('style', 'font-family:monospace;white-space:pre-wrap;padding:1rem;');
4214
+ pre.textContent = JSON.stringify(data, null, 2);
4215
+ root.replaceChildren(pre);
4211
4216
  }
4212
4217
  });
4213
4218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/uipack",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "FrontMCP UIpack - HTML shell builder, pluggable import resolver, and NPM component loader for MCP UI (React-free core)",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",
@@ -61,6 +61,6 @@
61
61
  "typescript": "^5.9.3"
62
62
  },
63
63
  "peerDependencies": {
64
- "@frontmcp/lazy-zod": "1.7.2"
64
+ "@frontmcp/lazy-zod": "1.8.0"
65
65
  }
66
66
  }