@wirecat/mail-cli 0.24.0 → 0.25.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/{all-profiles-VS7P6DJY.js → all-profiles-QEV2PSOR.js} +9 -9
  4. package/dist/bundle/{anthropic-C5JXKGBS.js → anthropic-5NKQXIHM.js} +16 -9
  5. package/dist/bundle/{app-server-HU3LVU42.js → app-server-G2CJNT4R.js} +56 -45
  6. package/dist/bundle/{bun-QLFX47WZ.js → bun-6HBYWQIX.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-W4PGAKVY.js → bun-sqlite-DXIQ7BVR.js} +8 -4
  8. package/dist/bundle/{chunk-U6MMQNNK.js → chunk-37F6QYTO.js} +5 -5
  9. package/dist/bundle/{chunk-5NLHDK7P.js → chunk-3XVR2ROR.js} +30 -30
  10. package/dist/bundle/{chunk-TI7ZIPA2.js → chunk-434YOD6A.js} +3 -3
  11. package/dist/bundle/{chunk-NCRSE647.js → chunk-5QYK3LWS.js} +57 -25
  12. package/dist/bundle/{chunk-WOX7FZJP.js → chunk-5ZYFV6FD.js} +82 -61
  13. package/dist/bundle/chunk-7GLJSJ7M.js +16 -0
  14. package/dist/bundle/{chunk-XBEO472U.js → chunk-A6BPOX5O.js} +11804 -10024
  15. package/dist/bundle/{chunk-VVL4MKYH.js → chunk-ADKMBXY4.js} +1 -1
  16. package/dist/bundle/{chunk-PRQ2U7HF.js → chunk-B7SWTH5O.js} +2 -2
  17. package/dist/bundle/{chunk-64ZG5ERD.js → chunk-BC7PFQL7.js} +2 -2
  18. package/dist/bundle/{chunk-Q6K2XUGU.js → chunk-CBYBZCQP.js} +1 -1
  19. package/dist/bundle/{chunk-ZO4MQWIK.js → chunk-CIWWNBVW.js} +7 -7
  20. package/dist/bundle/{chunk-Q4OKEN3B.js → chunk-DIA56CS7.js} +7 -6
  21. package/dist/bundle/{chunk-QI3PXUOJ.js → chunk-EXVY76VO.js} +36 -30
  22. package/dist/bundle/{chunk-RNZKQMFY.js → chunk-FZZD4AFY.js} +11 -11
  23. package/dist/bundle/{chunk-5X3GU5LI.js → chunk-G5LHHAW2.js} +5 -5
  24. package/dist/bundle/{chunk-YI544LHI.js → chunk-GJRYZXBN.js} +8 -8
  25. package/dist/bundle/{chunk-NSIN5IM4.js → chunk-GY4XCLCO.js} +9 -14
  26. package/dist/bundle/{chunk-IRUN4XOV.js → chunk-HEIDAHRC.js} +2 -2
  27. package/dist/bundle/{chunk-4QNHAM3J.js → chunk-HEYVMAAQ.js} +1 -1
  28. package/dist/bundle/{chunk-RLQZFZLK.js → chunk-HJSJBNCJ.js} +61 -6
  29. package/dist/bundle/{chunk-H5FJTHVA.js → chunk-HLXVUMZJ.js} +2 -2
  30. package/dist/bundle/{chunk-DW3F6DUW.js → chunk-IACWKZWS.js} +1 -1
  31. package/dist/bundle/{chunk-JOQGJUFT.js → chunk-IXO4SCKE.js} +1 -1
  32. package/dist/bundle/{chunk-X7J3TTDO.js → chunk-IZOYW4Z4.js} +24 -0
  33. package/dist/bundle/{chunk-6PWCQKMD.js → chunk-J4OYK4WL.js} +13 -13
  34. package/dist/bundle/{chunk-ZR2BDNGG.js → chunk-JG4MNYG2.js} +1 -1
  35. package/dist/bundle/{chunk-JMLIKXFO.js → chunk-K2OGF7KC.js} +1 -1
  36. package/dist/bundle/chunk-K6HR6HCO.js +32 -0
  37. package/dist/bundle/{chunk-FKWUUCX2.js → chunk-KFB2X6KE.js} +385 -178
  38. package/dist/bundle/{chunk-3FD3IATT.js → chunk-KK4HD3SI.js} +5 -5
  39. package/dist/bundle/{chunk-HBZAJINU.js → chunk-L4QVOEOB.js} +2 -2
  40. package/dist/bundle/chunk-LGZPKKBN.js +53 -0
  41. package/dist/bundle/{chunk-O373QEAJ.js → chunk-MBFPFWCO.js} +25 -25
  42. package/dist/bundle/{chunk-SWKQ6IAR.js → chunk-MWGH3M46.js} +2 -2
  43. package/dist/bundle/{chunk-C5BMCLCQ.js → chunk-ND5H5ADM.js} +3 -3
  44. package/dist/bundle/{chunk-EKGRNFYQ.js → chunk-NMZQTYKJ.js} +1 -1
  45. package/dist/bundle/{chunk-RUASZW3M.js → chunk-OLKCJBZY.js} +4 -4
  46. package/dist/bundle/{chunk-MTO6YVMN.js → chunk-OLLIWNFG.js} +3 -3
  47. package/dist/bundle/{chunk-X47BL4M5.js → chunk-P6GXNT7Z.js} +12 -12
  48. package/dist/bundle/{chunk-YBQ5AYLZ.js → chunk-PGC5TRH6.js} +3 -3
  49. package/dist/bundle/{chunk-RN7OI5KL.js → chunk-PHHH2NQP.js} +14 -8
  50. package/dist/bundle/{chunk-KGOVFEWZ.js → chunk-PP3YOAWG.js} +2 -2
  51. package/dist/bundle/{chunk-YA45XV6G.js → chunk-PQMJ5BXH.js} +4 -4
  52. package/dist/bundle/{chunk-NWKKPDZV.js → chunk-QB3DP2TN.js} +1 -1
  53. package/dist/bundle/{chunk-BFQQV22T.js → chunk-QQUY4MZY.js} +1 -1
  54. package/dist/bundle/{chunk-VNKWSCN7.js → chunk-S2QRAKQI.js} +16 -16
  55. package/dist/bundle/{chunk-6VV7J2TN.js → chunk-SMTBV62X.js} +31 -26
  56. package/dist/bundle/{chunk-A6J4MPTI.js → chunk-T27IMG6X.js} +1 -1
  57. package/dist/bundle/{chunk-FNLUKODV.js → chunk-TY644DKQ.js} +1 -1
  58. package/dist/bundle/{chunk-3KSK5BBB.js → chunk-U6IQ6YQ2.js} +1 -1
  59. package/dist/bundle/{chunk-PT6MF2VU.js → chunk-VFU7PVPQ.js} +336 -106
  60. package/dist/bundle/{chunk-QVMOEB3I.js → chunk-VL6H2BND.js} +13 -13
  61. package/dist/bundle/{chunk-OQW6GHUA.js → chunk-WOAYHCM2.js} +1 -1
  62. package/dist/bundle/{chunk-TLEBSMC7.js → chunk-WX6OYVCH.js} +3968 -3527
  63. package/dist/bundle/{chunk-C3NYJW6B.js → chunk-XMDEM6BZ.js} +631 -79
  64. package/dist/bundle/{chunk-AUTX2MLF.js → chunk-XQYKIZMG.js} +11 -9
  65. package/dist/bundle/{chunk-KV4VTKF3.js → chunk-YNS2YVUR.js} +68 -5
  66. package/dist/bundle/{chunk-JWMLMAHP.js → chunk-Z5T6OW3V.js} +13 -4
  67. package/dist/bundle/command-contract-XSW2Q33S.js +36 -0
  68. package/dist/bundle/{command-server-entry-5E3PPDE5.js → command-server-entry-XMSSY5ID.js} +23 -22
  69. package/dist/bundle/{decode-AVWV7SVZ.js → decode-RYGB4PGT.js} +4 -4
  70. package/dist/bundle/{dispatch-BXPHSNK5.js → dispatch-PLQOIZG5.js} +1 -1
  71. package/dist/bundle/{dist-PIOOKBWT.js → dist-GY2AQETI.js} +23 -16
  72. package/dist/bundle/{echarts-7K6YQV52.js → echarts-7CM2MCMW.js} +2 -2
  73. package/dist/bundle/{embed-4NT76GJK.js → embed-FTBDPOPT.js} +5 -5
  74. package/dist/bundle/{embedder-ITQFF7EN.js → embedder-B43WGNBD.js} +8 -8
  75. package/dist/bundle/{failure-3Q65JOPD.js → failure-XP5QYV2T.js} +1 -1
  76. package/dist/bundle/{first-run-PM74YU4X.js → first-run-XIIUARNM.js} +9 -8
  77. package/dist/bundle/first-screen-Z7HC6PQU.js +34 -0
  78. package/dist/bundle/{instructions-JDSITYHV.js → instructions-R7OHVAWH.js} +1 -1
  79. package/dist/bundle/mail.js +5 -5
  80. package/dist/bundle/{node-D6YIJOJI.js → node-3N2JGZ7V.js} +2 -2
  81. package/dist/bundle/{node-sqlite-PJOHHB4X.js → node-sqlite-WFJXW3CZ.js} +9 -5
  82. package/dist/bundle/{oauth-BOWJ3IBT.js → oauth-SVJLQTWV.js} +6 -6
  83. package/dist/bundle/{open-FIAKKZMW.js → open-ZDONVKSX.js} +4 -4
  84. package/dist/bundle/{openai-QL54VVLC.js → openai-XVEW6XOU.js} +17 -13
  85. package/dist/bundle/{process-AYHK7WRC.js → process-YAHHUFR5.js} +1 -1
  86. package/dist/bundle/{program-6FKWOTBK.js → program-HU2UVMJE.js} +5742 -5008
  87. package/dist/bundle/{prompt-XJZCBELC.js → prompt-JAJ2CUJI.js} +4 -4
  88. package/dist/bundle/{recognize-OQKWAHBY.js → recognize-UFBWUNFR.js} +3 -3
  89. package/dist/bundle/{remote-NLVUZ5WK.js → remote-2GFOVLCR.js} +8 -6
  90. package/dist/bundle/{rerank-NRPZDTJ7.js → rerank-BGPSMXTL.js} +6 -6
  91. package/dist/bundle/{serve-O4YUI7F6.js → serve-CB3XJTH3.js} +8 -8
  92. package/dist/bundle/server-34GEF22R.js +68 -0
  93. package/dist/bundle/{server-WAL3M4OO.js → server-M7FQY7TX.js} +38 -36
  94. package/dist/bundle/{sqlite-runtime-5YHGI4D4.js → sqlite-runtime-AEV6PGDR.js} +5 -5
  95. package/dist/bundle/{state-WYYOJ7KK.js → state-YLBEQLBI.js} +5 -5
  96. package/dist/bundle/{store-6BJO3F2J.js → store-CDUL3HKK.js} +17 -14
  97. package/dist/bundle/{store-X72GOJHD.js → store-EKWKY6GG.js} +22 -17
  98. package/dist/bundle/store-maintenance-command-XH2JUM5F.js +58 -0
  99. package/dist/version.d.ts +1 -1
  100. package/dist/version.js +1 -1
  101. package/package.json +2 -2
  102. package/dist/bundle/chunk-B72343TK.js +0 -35
  103. package/dist/bundle/command-contract-ERYYPAD2.js +0 -35
  104. package/dist/bundle/first-screen-WBVGVSMY.js +0 -33
  105. package/dist/bundle/server-6OT5ZEWL.js +0 -66
  106. package/dist/bundle/store-maintenance-command-ASS7RBYC.js +0 -54
@@ -6,13 +6,13 @@ import {
6
6
  agentArguments,
7
7
  agentJson,
8
8
  commandAvailability
9
- } from "./chunk-RNZKQMFY.js";
9
+ } from "./chunk-FZZD4AFY.js";
10
10
  import {
11
11
  failureContext
12
- } from "./chunk-RLQZFZLK.js";
12
+ } from "./chunk-HJSJBNCJ.js";
13
13
  import {
14
14
  callerOf
15
- } from "./chunk-H5FJTHVA.js";
15
+ } from "./chunk-HLXVUMZJ.js";
16
16
  import {
17
17
  QUERY_ARGUMENT,
18
18
  lentConnection,
@@ -20,10 +20,10 @@ import {
20
20
  refuseLacking,
21
21
  servicesFor,
22
22
  storeModeDeps
23
- } from "./chunk-TLEBSMC7.js";
23
+ } from "./chunk-WX6OYVCH.js";
24
24
  import {
25
25
  MAX_BUFFERED_INPUT
26
- } from "./chunk-NWKKPDZV.js";
26
+ } from "./chunk-QB3DP2TN.js";
27
27
  import {
28
28
  DEFAULT_OUTPUT_BYTES,
29
29
  ENTITIES,
@@ -38,36 +38,36 @@ import {
38
38
  refuseStoreChange,
39
39
  sealed,
40
40
  startRecording
41
- } from "./chunk-FKWUUCX2.js";
41
+ } from "./chunk-KFB2X6KE.js";
42
42
  import {
43
43
  authorityAllowed,
44
44
  botApiAllowed,
45
45
  keyForCommand,
46
46
  levelFor,
47
47
  readKeysForCommand
48
- } from "./chunk-Q4OKEN3B.js";
48
+ } from "./chunk-DIA56CS7.js";
49
49
  import {
50
50
  currentCaller,
51
51
  keepsSuccess,
52
52
  runContextOf,
53
53
  withCaller
54
- } from "./chunk-AUTX2MLF.js";
54
+ } from "./chunk-XQYKIZMG.js";
55
55
  import {
56
56
  enclosingTraceId,
57
57
  inRun,
58
58
  newRunId,
59
59
  traceOf
60
- } from "./chunk-O373QEAJ.js";
60
+ } from "./chunk-MBFPFWCO.js";
61
61
  import {
62
62
  queryDescription
63
- } from "./chunk-WOX7FZJP.js";
63
+ } from "./chunk-5ZYFV6FD.js";
64
64
  import {
65
65
  storeDamaged
66
- } from "./chunk-3KSK5BBB.js";
66
+ } from "./chunk-U6IQ6YQ2.js";
67
67
  import {
68
68
  captureStreams,
69
69
  traceIdOf
70
- } from "./chunk-FNLUKODV.js";
70
+ } from "./chunk-TY644DKQ.js";
71
71
  import {
72
72
  COMPACT_FLAG,
73
73
  SNAKE_CASE,
@@ -106,7 +106,7 @@ import {
106
106
  unknown,
107
107
  word,
108
108
  writes
109
- } from "./chunk-X7J3TTDO.js";
109
+ } from "./chunk-IZOYW4Z4.js";
110
110
  import {
111
111
  CliError,
112
112
  errorCodes
@@ -115,7 +115,7 @@ import {
115
115
  __name
116
116
  } from "./chunk-ZVVMGPBJ.js";
117
117
 
118
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/mcp/agent.js
118
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/mcp/agent.js
119
119
  import { Readable } from "node:stream";
120
120
 
121
121
  // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
@@ -3206,7 +3206,7 @@ var VOCABULARY = defineVocabulary({
3206
3206
  ]
3207
3207
  });
3208
3208
 
3209
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/mcp/agent.js
3209
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/mcp/agent.js
3210
3210
  var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
3211
3211
  var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
3212
3212
  var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
@@ -3316,6 +3316,9 @@ var fieldsOf = /* @__PURE__ */ __name((info, { omit = [], offline = false, stdin
3316
3316
  }, "fieldsOf");
3317
3317
  var schemaOf = /* @__PURE__ */ __name((fields) => object(Object.fromEntries(fields.map((field) => [field.name, field.required ? field.schema : optional(field.schema)]))), "schemaOf");
3318
3318
  var startsWith = /* @__PURE__ */ __name((path, prefix) => prefix.every((word2, at) => path[at] === word2), "startsWith");
3319
+ var keywordsOf = /* @__PURE__ */ __name((examples) => [
3320
+ ...new Set(examples.flatMap((example) => example.split(/\s+/u).filter((word2) => word2 !== "" && !word2.startsWith("-"))))
3321
+ ], "keywordsOf");
3319
3322
  var toolsFromCommands = /* @__PURE__ */ __name((commands, options = {}) => {
3320
3323
  const { root = [], exclude = [], levels, keyOf, authority, readOnly = false, permissions } = options;
3321
3324
  return flatten(commands).filter((info) => (
@@ -3327,6 +3330,7 @@ var toolsFromCommands = /* @__PURE__ */ __name((commands, options = {}) => {
3327
3330
  path: info.path,
3328
3331
  title: info.summary ?? info.description,
3329
3332
  description: info.description,
3333
+ ...info.examples?.length ? { keywords: keywordsOf(info.examples) } : {},
3330
3334
  writes: writes(info.effects) && options.fetchOnly?.(info.path) !== true,
3331
3335
  input: schemaOf(fieldsOf(info, options)),
3332
3336
  ...info.output ? { output: info.output } : {}
@@ -3429,7 +3433,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
3429
3433
  }
3430
3434
  }, "runCommandForAgent");
3431
3435
 
3432
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/mcp/tool.js
3436
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/mcp/tool.js
3433
3437
  var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
3434
3438
  var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
3435
3439
  var message = pipe(
@@ -3688,7 +3692,7 @@ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
3688
3692
  return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
3689
3693
  }, "failed");
3690
3694
 
3691
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3695
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3692
3696
  import { randomUUID } from "node:crypto";
3693
3697
  var MATCHES = 8;
3694
3698
  var ANSWER = answerSchema();
@@ -3710,15 +3714,43 @@ var listedAs = /* @__PURE__ */ __name((prefix, writes2) => {
3710
3714
  return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
3711
3715
  }, "listedAs");
3712
3716
  var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
3713
- var haystack = /* @__PURE__ */ __name((command, one) => [command, one.title, one.description, ...Object.keys(one.input.entries)].join(" ").toLowerCase(), "haystack");
3717
+ var STOP_WORDS = new Set("a an the to of in on at by for from with into out about and or but is are be been was were it its this that these those which who whom whose what when where how do does did can could should would will my our your their his her them they we you i one some any all each every another other".split(" "));
3718
+ var wordsOf = /* @__PURE__ */ __name((text3) => text3.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
3719
+ var stem = /* @__PURE__ */ __name((word2) => {
3720
+ const bare = word2.replace(/'s$/u, "");
3721
+ if (bare.length > 4 && bare.endsWith("ies"))
3722
+ return `${bare.slice(0, -3)}y`;
3723
+ for (const ending of ["ing", "ed", "es", "s"])
3724
+ if (bare.length - ending.length >= 3 && bare.endsWith(ending))
3725
+ return bare.slice(0, -ending.length);
3726
+ return bare;
3727
+ }, "stem");
3728
+ var sameWord = /* @__PURE__ */ __name((asked, known) => {
3729
+ if (asked === known)
3730
+ return true;
3731
+ const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
3732
+ return short.length >= 3 && long.startsWith(short);
3733
+ }, "sameWord");
3734
+ var fieldsOf2 = /* @__PURE__ */ __name((command, one) => [
3735
+ [4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
3736
+ [2, wordsOf(one.title)],
3737
+ [1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
3738
+ ].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
3714
3739
  var search = /* @__PURE__ */ __name((commands, query) => {
3715
- const words = query.toLowerCase().split(/\s+/).filter(Boolean);
3716
- return Object.entries(commands).filter(([command, one]) => words.every((word2) => haystack(command, one).includes(word2))).map((entry) => {
3717
- const parts = entry[0].split(/[\s-]/);
3718
- const exact = entry[0] === words.join(" ") ? 100 : 0;
3719
- const whole = words.filter((word2) => parts.includes(word2)).length * 10;
3720
- return { entry, rank: exact + whole + words.filter((word2) => entry[0].includes(word2)).length };
3721
- }).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
3740
+ const named = normal(query);
3741
+ const all = Object.entries(commands);
3742
+ if (!named)
3743
+ return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
3744
+ const words = [
3745
+ ...new Set(wordsOf(query).filter((word2) => word2.length > 1 && !STOP_WORDS.has(word2)).map(stem))
3746
+ ];
3747
+ return all.map((entry) => {
3748
+ const fields = fieldsOf2(entry[0], entry[1]);
3749
+ const weights = words.map((word2) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word2, one)) ? Math.max(best, weight) : best, 0));
3750
+ const matched = weights.filter((weight) => weight > 0).length;
3751
+ const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
3752
+ return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
3753
+ }).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
3722
3754
  }, "search");
3723
3755
  var nearest = /* @__PURE__ */ __name((commands, asked) => {
3724
3756
  const words = normal(asked).split(" ");