@aibranch/llm-meta-widget 0.7.5 → 0.7.6

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.
@@ -3765,17 +3765,23 @@ function boot(cfg) {
3765
3765
  var actionsSchemaEl = document.getElementById(ACTIONS_SCHEMA_ID);
3766
3766
  var localTools = actionsSchemaEl ? JSON.parse(actionsSchemaEl.textContent) : [];
3767
3767
  var remoteToolsEl = document.getElementById(REMOTE_TOOLS_SCHEMA_ID);
3768
- var remoteTools = remoteToolsEl ? JSON.parse(remoteToolsEl.textContent) : [];
3768
+ var baselineRemoteTools = remoteToolsEl ? JSON.parse(remoteToolsEl.textContent) : [];
3769
+ var remoteTools = baselineRemoteTools.slice();
3769
3770
  var hubMcpServers = [];
3770
3771
  var selectedToolIds = /* @__PURE__ */ new Set();
3772
+ baselineRemoteTools.forEach(function(t) {
3773
+ selectedToolIds.add(t.id);
3774
+ });
3771
3775
  function anyAllowedByAllowlist(name, allowlist) {
3772
3776
  return allowlist === null || allowlist.indexOf(name) >= 0;
3773
3777
  }
3774
3778
  function refreshRemoteToolsFromPicker() {
3775
3779
  var flat = [];
3780
+ var seen = {};
3776
3781
  hubMcpServers.forEach(function(s) {
3777
3782
  (s.tools || []).forEach(function(t) {
3778
3783
  if (!selectedToolIds.has(t.id)) return;
3784
+ seen[t.id] = true;
3779
3785
  flat.push({
3780
3786
  id: t.id,
3781
3787
  name: t.name,
@@ -3784,6 +3790,12 @@ function boot(cfg) {
3784
3790
  });
3785
3791
  });
3786
3792
  });
3793
+ baselineRemoteTools.forEach(function(t) {
3794
+ if (!seen[t.id] && selectedToolIds.has(t.id)) {
3795
+ flat.push(t);
3796
+ seen[t.id] = true;
3797
+ }
3798
+ });
3787
3799
  remoteTools = flat;
3788
3800
  if (toolsCountEl) {
3789
3801
  toolsCountEl.textContent = flat.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibranch/llm-meta-widget",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "//version": "Must stay in step with lib/llm_meta_widget/version.rb. Two independently versioned copies of the same client is the drift docs/custom-element-distribution.md warns about: bump both, release both.",
5
5
  "description": "Embeddable browser chat widget: a custom element that discovers tools at page, origin and hub scope and dispatches each tool call to the right one. Two lines of HTML on any host, Rails or not.",
6
6
  "keywords": [
@@ -49,6 +49,7 @@
49
49
  "devDependencies": {
50
50
  "esbuild": "^0.28.2",
51
51
  "eslint": "^9.0.0",
52
- "globals": "^15.0.0"
52
+ "globals": "^15.0.0",
53
+ "jsdom": "^29.1.1"
53
54
  }
54
55
  }