@wrongstack/core 0.256.1 → 0.257.2

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.
@@ -1375,6 +1375,7 @@ Emit each evaluation immediately. Do not wait until you have read all reports.`;
1375
1375
  }
1376
1376
  for (const dispose of this.disposers) dispose();
1377
1377
  this.disposers.length = 0;
1378
+ this.snapshot.files.length = 0;
1378
1379
  }
1379
1380
  };
1380
1381
 
@@ -4119,17 +4120,17 @@ function normalize(text) {
4119
4120
  return ` ${text.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim()} `;
4120
4121
  }
4121
4122
  function scoreAgents(task, catalog = AGENT_CATALOG) {
4122
- const hay = normalize(task);
4123
+ const haySet = new Set(normalize(task).split(/\s+/).filter(Boolean));
4123
4124
  const out = [];
4124
4125
  for (const def of Object.values(catalog)) {
4125
4126
  if (!def?.config?.role) continue;
4126
4127
  let score = 0;
4127
4128
  const matched = [];
4128
4129
  for (const kw of def.capability.keywords) {
4129
- const needle = normalize(kw);
4130
- if (hay.includes(needle.trimEnd() + " ") || hay.includes(" " + needle.trimStart())) {
4131
- const words = kw.trim().split(/\s+/).length;
4132
- score += words;
4130
+ const needleWords = normalize(kw).split(/\s+/).filter(Boolean);
4131
+ const allPresent = needleWords.every((w) => haySet.has(w));
4132
+ if (allPresent) {
4133
+ score += needleWords.length;
4133
4134
  matched.push(kw);
4134
4135
  }
4135
4136
  }