@myagentroam/node 0.9.113 → 0.9.114

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 (2) hide show
  1. package/dist/workspace.js +13 -3
  2. package/package.json +4 -4
package/dist/workspace.js CHANGED
@@ -385,7 +385,18 @@ class RankedCandidateHeap {
385
385
  }
386
386
  function fuzzyPathScore(path, query) {
387
387
  const source = path.toLocaleLowerCase();
388
- const needle = query.trim().toLocaleLowerCase();
388
+ const terms = query.trim().toLocaleLowerCase().split(/\s+/u);
389
+ const name = source.slice(source.lastIndexOf('/') + 1);
390
+ let total = 0;
391
+ for (const needle of terms) {
392
+ const score = fuzzyTermScore(source, name, needle);
393
+ if (score < 0)
394
+ return -1;
395
+ total += score;
396
+ }
397
+ return total - path.length / 1_000;
398
+ }
399
+ function fuzzyTermScore(source, name, needle) {
389
400
  let cursor = 0;
390
401
  let score = 0;
391
402
  let previous = -2;
@@ -399,12 +410,11 @@ function fuzzyPathScore(path, query) {
399
410
  previous = index;
400
411
  cursor = index + 1;
401
412
  }
402
- const name = path.slice(path.lastIndexOf('/') + 1).toLocaleLowerCase();
403
413
  if (name.includes(needle))
404
414
  score += 40;
405
415
  else if (source.includes(needle))
406
416
  score += 16;
407
- return score - path.length / 1_000;
417
+ return score;
408
418
  }
409
419
  /**
410
420
  * Lists directory names only for the Workspace picker. Browsing begins at the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.113",
3
+ "version": "0.9.114",
4
4
  "description": "MyAgentRoam Node runtime CLI.",
5
5
  "license": "Apache-2.0 AND GPL-2.0-or-later",
6
6
  "type": "module",
@@ -30,9 +30,9 @@
30
30
  "npm": "11.12.1",
31
31
  "ws": "^8.21.3",
32
32
  "zod": "4.4.3",
33
- "@myagentroam/agent": "0.9.113",
34
- "@myagentroam/code-navigation": "0.9.113",
35
- "@myagentroam/protocol": "0.9.113"
33
+ "@myagentroam/agent": "0.9.114",
34
+ "@myagentroam/code-navigation": "0.9.114",
35
+ "@myagentroam/protocol": "0.9.114"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/ws": "^8.18.1"