@peopl-health/nexus 5.11.0-dev.1131 → 5.11.0-dev.1133

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.
@@ -33,7 +33,7 @@ async function readToolCatalog() {
33
33
  return null;
34
34
  }
35
35
 
36
- const catalog = records.map((row) => row.tool_id).filter(Boolean);
36
+ const catalog = records.map((row) => row.tool_id).filter((id) => typeof id === 'string' && id.trim() !== '');
37
37
  cache.set(TOOLS_CACHE_KEY, catalog);
38
38
  return catalog;
39
39
  }
@@ -45,6 +45,10 @@ async function unavailableToolNames() {
45
45
  return catalog.filter((id) => !registered.has(id));
46
46
  }
47
47
 
48
+ function escapeRegExp(value) {
49
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
50
+ }
51
+
48
52
  function mentionedToolNames(text) {
49
53
  const names = new Set();
50
54
  for (const [, span] of text.matchAll(BACKTICK_SPAN_RX)) {
@@ -60,7 +64,7 @@ async function warnOnRegistryDrift(name, body) {
60
64
  const registered = new Set(registeredNames);
61
65
  const text = String(body || '');
62
66
 
63
- const fromCatalog = (await unavailableToolNames()).filter((id) => new RegExp(`\\b${id}\\b`).test(text));
67
+ const fromCatalog = (await unavailableToolNames()).filter((id) => new RegExp(`\\b${escapeRegExp(id)}\\b`).test(text));
64
68
  const fromBody = [...mentionedToolNames(text)].filter((id) => !registered.has(id));
65
69
  const missing = [...new Set([...fromCatalog, ...fromBody])].sort();
66
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.11.0-dev.1131",
3
+ "version": "5.11.0-dev.1133",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",