@wirecat/notion-cli 0.5.0 → 0.6.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 (216) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +5 -0
  3. package/contracts/wirecat.json +55 -2
  4. package/dist/bin/notion.js +2 -2
  5. package/dist/bundle/agent-ILG6AH7S.js +42 -0
  6. package/dist/bundle/{all-profiles-V37KCXH3.js → all-profiles-AELHUTFU.js} +64 -21
  7. package/dist/bundle/{anthropic-Q4S3BYXD.js → anthropic-3CCYAGO3.js} +6 -6
  8. package/dist/bundle/{app-server-43SR3ACI.js → app-server-DJ6P4NY4.js} +86 -65
  9. package/dist/bundle/{bun-M3J2QTR3.js → bun-2FLR4IV4.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-EJ3W2PSV.js → bun-sqlite-QB6CU6TH.js} +7 -7
  11. package/dist/bundle/chunk-2CMLY2X3.js +72 -0
  12. package/dist/bundle/{chunk-NHHJHXMQ.js → chunk-2XUV7HNE.js} +2 -2
  13. package/dist/bundle/{chunk-HZRQLAHO.js → chunk-2Z7UOXFC.js} +1 -1
  14. package/dist/bundle/{chunk-TOSCB4SO.js → chunk-3LMW7U7F.js} +16 -10
  15. package/dist/bundle/chunk-3MYN2RMG.js +398 -0
  16. package/dist/bundle/{chunk-E5WLE7BM.js → chunk-3UX4VJWD.js} +1 -1
  17. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  18. package/dist/bundle/{chunk-KHWOLBHQ.js → chunk-4RFR4J2O.js} +2 -2
  19. package/dist/bundle/{chunk-G2MJYXZG.js → chunk-4VXXOJ2F.js} +4 -4
  20. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  21. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  22. package/dist/bundle/{chunk-ECC2UX7X.js → chunk-5OJLUUOJ.js} +6 -6
  23. package/dist/bundle/{chunk-C32AKHTY.js → chunk-5XPHFV7H.js} +35 -12
  24. package/dist/bundle/{chunk-O5YB7FQD.js → chunk-6EJCI47L.js} +4 -4
  25. package/dist/bundle/chunk-6VPC5Z56.js +2145 -0
  26. package/dist/bundle/{chunk-NA6QLHBZ.js → chunk-6YOMPW7Y.js} +10 -8
  27. package/dist/bundle/{chunk-P5BHKKBI.js → chunk-7JVKQ6NM.js} +4 -4
  28. package/dist/bundle/chunk-7L2XOKDZ.js +353 -0
  29. package/dist/bundle/{chunk-NE43YXKL.js → chunk-A42T4YX7.js} +3 -3
  30. package/dist/bundle/chunk-AE4VW4NB.js +50 -0
  31. package/dist/bundle/{chunk-FPUGMDJV.js → chunk-AV2ZJ4WX.js} +1 -1
  32. package/dist/bundle/{chunk-QWYMXFKM.js → chunk-AZLDR36U.js} +3 -3
  33. package/dist/bundle/{chunk-N2XADGL4.js → chunk-BAXNAOOL.js} +4 -4
  34. package/dist/bundle/{chunk-JCKWQGCD.js → chunk-BEV5LO4D.js} +110 -862
  35. package/dist/bundle/{chunk-UZSBGECU.js → chunk-BQBC2WIG.js} +1 -65
  36. package/dist/bundle/{chunk-CWXOXIWS.js → chunk-CFQQTDSA.js} +1 -1
  37. package/dist/bundle/chunk-CHPWBQUK.js +39 -0
  38. package/dist/bundle/chunk-CL3YNUCC.js +388 -0
  39. package/dist/bundle/{chunk-ONZVPE24.js → chunk-DGMTSDKB.js} +6 -6
  40. package/dist/bundle/{chunk-BWLBSQSU.js → chunk-DHVVXQEL.js} +4 -4
  41. package/dist/bundle/chunk-DIU2QJJF.js +785 -0
  42. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  43. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  44. package/dist/bundle/{chunk-DBEQI5YM.js → chunk-EHW45LLT.js} +3 -3
  45. package/dist/bundle/{chunk-WPP76PSX.js → chunk-ERN53B3Z.js} +32 -24
  46. package/dist/bundle/{chunk-XUPN2EHR.js → chunk-ESZHGC4Q.js} +23 -7
  47. package/dist/bundle/{chunk-3RL2MIUF.js → chunk-EZMG5QXB.js} +8 -8
  48. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  49. package/dist/bundle/{chunk-TP7GDWVF.js → chunk-F5ZAN7OC.js} +1 -1
  50. package/dist/bundle/{chunk-DFCHHR5M.js → chunk-FMMYBVCH.js} +1 -1
  51. package/dist/bundle/{chunk-E2AFUJDR.js → chunk-FRB2L7OE.js} +3 -3
  52. package/dist/bundle/chunk-FV4WTZCU.js +561 -0
  53. package/dist/bundle/{chunk-TD2JZ25O.js → chunk-G4ZU73SD.js} +98 -80
  54. package/dist/bundle/{chunk-FKA7DOCK.js → chunk-GCAJW4SR.js} +1 -1
  55. package/dist/bundle/{chunk-WE4UFASG.js → chunk-GPRJXJC7.js} +15 -1
  56. package/dist/bundle/chunk-GUIQJUJV.js +340 -0
  57. package/dist/bundle/{chunk-GTY6N5KZ.js → chunk-HHEWTLAT.js} +2 -2
  58. package/dist/bundle/{chunk-DB2XKHI4.js → chunk-HM6AMYHR.js} +2 -2
  59. package/dist/bundle/{chunk-H3E2PZ5Y.js → chunk-HOVHE3A3.js} +7 -7
  60. package/dist/bundle/{chunk-O3DYRCIT.js → chunk-HVXOA4FO.js} +1 -1
  61. package/dist/bundle/{chunk-PPHBRESD.js → chunk-IJVTN5L3.js} +2 -2
  62. package/dist/bundle/{chunk-FBZI4Z3Z.js → chunk-IURYZSG3.js} +13 -26
  63. package/dist/bundle/chunk-JFSVAOA7.js +108 -0
  64. package/dist/bundle/{chunk-HHVFIXDO.js → chunk-JVESLS7B.js} +399 -399
  65. package/dist/bundle/chunk-K5IC4FZN.js +36 -0
  66. package/dist/bundle/chunk-KB35BVTG.js +30 -0
  67. package/dist/bundle/chunk-KGAUINBO.js +594 -0
  68. package/dist/bundle/{chunk-W5JZMXGW.js → chunk-KNCPBX5P.js} +75 -75
  69. package/dist/bundle/{chunk-ECEZOLOD.js → chunk-KZJQPJK5.js} +4 -4
  70. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  71. package/dist/bundle/{chunk-QYXWRKNA.js → chunk-LC6WE6JS.js} +9 -9
  72. package/dist/bundle/{chunk-X2M6NIQG.js → chunk-LECMHK2F.js} +1 -1
  73. package/dist/bundle/chunk-LQVDFD65.js +72 -0
  74. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  75. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  76. package/dist/bundle/{chunk-NTG657MI.js → chunk-NSR43UEW.js} +7 -64
  77. package/dist/bundle/{chunk-CDK5E45T.js → chunk-OEQNP56V.js} +2 -100
  78. package/dist/bundle/{chunk-MGUEZYFA.js → chunk-OLAGFJDM.js} +13 -2143
  79. package/dist/bundle/{chunk-PWRRDDMZ.js → chunk-P27NDZQR.js} +232 -552
  80. package/dist/bundle/{chunk-PAW6RRCW.js → chunk-PHKED7AG.js} +8 -210
  81. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  82. package/dist/bundle/{chunk-RIGE67FR.js → chunk-Q7EIL6VU.js} +43 -33
  83. package/dist/bundle/{chunk-AT5I34AN.js → chunk-QEJFBORC.js} +3 -3
  84. package/dist/bundle/{chunk-RJMQGG3P.js → chunk-QGGRFRMP.js} +65 -49
  85. package/dist/bundle/{chunk-BNEE35WD.js → chunk-RD7BKTWV.js} +4 -4
  86. package/dist/bundle/chunk-RXU5T5NM.js +714 -0
  87. package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
  88. package/dist/bundle/{chunk-2FJNMADN.js → chunk-SAPP2LEH.js} +10 -10
  89. package/dist/bundle/{chunk-QIG55MZH.js → chunk-SEAGUFBX.js} +12 -12
  90. package/dist/bundle/{chunk-GCZ6MAEN.js → chunk-STTO2MSY.js} +43 -64
  91. package/dist/bundle/{chunk-DSP36YHQ.js → chunk-T37TAXVL.js} +2 -2
  92. package/dist/bundle/{chunk-KHZ2RGXI.js → chunk-T6XIBULH.js} +139 -572
  93. package/dist/bundle/chunk-TFT4FVRU.js +67 -0
  94. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  95. package/dist/bundle/{chunk-KFVDL2QS.js → chunk-UC7JLE6J.js} +1 -89
  96. package/dist/bundle/{chunk-LBYGJKXW.js → chunk-UOC52GCB.js} +4 -4
  97. package/dist/bundle/chunk-UPL474OW.js +94 -0
  98. package/dist/bundle/chunk-VH7526NL.js +80 -0
  99. package/dist/bundle/chunk-VNWF4I7E.js +34 -0
  100. package/dist/bundle/chunk-W2VQDIU5.js +221 -0
  101. package/dist/bundle/{chunk-TDNURSU6.js → chunk-WAGADES3.js} +19 -19
  102. package/dist/bundle/{chunk-J3NKZ6MO.js → chunk-WAU5LSHP.js} +79 -438
  103. package/dist/bundle/{chunk-B3FSLAIU.js → chunk-WB2KSQIP.js} +4 -4
  104. package/dist/bundle/{chunk-DO7BLXO3.js → chunk-WGZH2M64.js} +3 -3
  105. package/dist/bundle/chunk-WVN2KTNS.js +52 -0
  106. package/dist/bundle/{chunk-W7HM2VGO.js → chunk-XYQVVW4R.js} +1 -1
  107. package/dist/bundle/{chunk-BBSFQ3PU.js → chunk-YDDI4QIT.js} +1473 -1292
  108. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  109. package/dist/bundle/{chunk-W53EJOFQ.js → chunk-YUDVRFXN.js} +1 -1
  110. package/dist/bundle/{chunk-MNRMKWCN.js → chunk-YXYZAWWW.js} +6 -6
  111. package/dist/bundle/{chunk-5P5TXU2K.js → chunk-YYQ5GKAI.js} +9509 -10782
  112. package/dist/bundle/chunk-ZDYEOE7L.js +2366 -0
  113. package/dist/bundle/command-contract-L2FASWD6.js +41 -0
  114. package/dist/bundle/{command-server-entry-LJ627ZUA.js → command-server-entry-VUR6WL77.js} +30 -27
  115. package/dist/bundle/{decode-PX2LZ5Y2.js → decode-I64PF2RM.js} +6 -6
  116. package/dist/bundle/{definitions-M3U4UYHN.js → definitions-MB65223J.js} +72 -18
  117. package/dist/bundle/{dispatch-KOISQ5QJ.js → dispatch-JQBAZWCL.js} +8 -8
  118. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  119. package/dist/bundle/{echarts-FVTUDXDU.js → echarts-YRRVLEX3.js} +2 -2
  120. package/dist/bundle/{embed-CCSDK43I.js → embed-BLXLKMK2.js} +7 -7
  121. package/dist/bundle/{embedder-VHI4DHB7.js → embedder-JYGF6R7I.js} +10 -10
  122. package/dist/bundle/{failure-FZ6VYKEQ.js → failure-I6AAF5R5.js} +3 -3
  123. package/dist/bundle/first-run-YLDOZGY6.js +29 -0
  124. package/dist/bundle/first-screen-GZH3LMLZ.js +41 -0
  125. package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
  126. package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
  127. package/dist/bundle/hast-util-to-mdast-3CSMIWK2.js +2272 -0
  128. package/dist/bundle/{instructions-HET7BCYK.js → instructions-AG7SRWTR.js} +1 -1
  129. package/dist/bundle/{mcp-RGNRW77S.js → mcp-YGOAUNC3.js} +2 -2
  130. package/dist/bundle/{mdast-util-from-markdown-R66F4HZA.js → mdast-util-from-markdown-XCR5KW5S.js} +138 -195
  131. package/dist/bundle/{mdast-util-gfm-LN2ELINH.js → mdast-util-gfm-JO7PHUIB.js} +28 -357
  132. package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
  133. package/dist/bundle/mdast-util-to-markdown-DOXGHRI7.js +1854 -0
  134. package/dist/bundle/meeting-combined-OFQSGKBG.js +25 -0
  135. package/dist/bundle/meeting-model-K6NSX3O5.js +27 -0
  136. package/dist/bundle/{meeting-semantic-UD26T37N.js → meeting-semantic-3DZPHM7L.js} +7 -7
  137. package/dist/bundle/{micromark-extension-gfm-5X7YT43T.js → micromark-extension-gfm-PQ7DWZM7.js} +12 -78
  138. package/dist/bundle/{node-CXZIFHZC.js → node-GJQYN4FT.js} +2 -2
  139. package/dist/bundle/{node-sqlite-ME7KMORI.js → node-sqlite-7VXIRQPH.js} +8 -8
  140. package/dist/bundle/notes-search-ACDOPTNH.js +64 -0
  141. package/dist/bundle/notion.js +14 -14
  142. package/dist/bundle/oauth-N67CH2TK.js +20 -0
  143. package/dist/bundle/{open-HA6D3SXR.js → open-JGXVHIKO.js} +6 -6
  144. package/dist/bundle/{openai-H5AJPZBX.js → openai-PFQJTF4H.js} +21 -18
  145. package/dist/bundle/{process-5RUXWGYS.js → process-MEKCZMX3.js} +1 -1
  146. package/dist/bundle/{program-F3NBTZ7J.js → program-DUJYLJH5.js} +6373 -6588
  147. package/dist/bundle/{prompt-6XSUOLHK.js → prompt-FW44QDHD.js} +6 -6
  148. package/dist/bundle/{recognize-2Y7AUVGG.js → recognize-62TDQ6A7.js} +5 -5
  149. package/dist/bundle/{remote-KCABPXQ3.js → remote-7ONFD7GG.js} +12 -11
  150. package/dist/bundle/{rerank-BTN7LUVA.js → rerank-YOHQQJS4.js} +8 -8
  151. package/dist/bundle/{schemas-VVLTLMXS.js → schemas-IIGJ7DOP.js} +39 -60
  152. package/dist/bundle/{serve-CYEMVRFC.js → serve-ZCXGT5RB.js} +11 -11
  153. package/dist/bundle/{server-WFIICGMI.js → server-RQ74M637.js} +78 -56
  154. package/dist/bundle/server-XMZF57WM.js +90 -0
  155. package/dist/bundle/{services-L4W6ZWDG.js → services-FWBRZ57M.js} +103 -88
  156. package/dist/bundle/{sqlite-runtime-IKMYLRQC.js → sqlite-runtime-ZZBNGV5L.js} +7 -7
  157. package/dist/bundle/{state-LMUP636P.js → state-GDDFO62Y.js} +7 -7
  158. package/dist/bundle/{store-W2JC2JP4.js → store-D2LRIWEI.js} +24 -20
  159. package/dist/bundle/{store-A2QZFBOX.js → store-KQCLR57N.js} +30 -18
  160. package/dist/bundle/store-maintenance-command-CK2MU5M6.js +77 -0
  161. package/dist/bundle/surface-K4TPIQW7.js +76 -0
  162. package/dist/commands/account.d.ts +3 -0
  163. package/dist/commands/account.d.ts.map +1 -0
  164. package/dist/commands/account.js +22 -0
  165. package/dist/commands/account.js.map +1 -0
  166. package/dist/commands/api.d.ts +7 -2
  167. package/dist/commands/api.d.ts.map +1 -1
  168. package/dist/commands/api.js +19 -119
  169. package/dist/commands/api.js.map +1 -1
  170. package/dist/commands/library.d.ts.map +1 -1
  171. package/dist/commands/library.js +8 -2
  172. package/dist/commands/library.js.map +1 -1
  173. package/dist/config.d.ts +11 -13
  174. package/dist/config.d.ts.map +1 -1
  175. package/dist/config.js +63 -54
  176. package/dist/config.js.map +1 -1
  177. package/dist/generated/definitions.d.ts.map +1 -1
  178. package/dist/generated/definitions.js +72 -18
  179. package/dist/generated/definitions.js.map +1 -1
  180. package/dist/generated/manifest.d.ts.map +1 -1
  181. package/dist/generated/manifest.js +49 -0
  182. package/dist/generated/manifest.js.map +1 -1
  183. package/dist/generated/schemas.d.ts.map +1 -1
  184. package/dist/generated/schemas.js +32 -32
  185. package/dist/generated/schemas.js.map +1 -1
  186. package/dist/generated/types.d.ts +125 -25
  187. package/dist/generated/types.d.ts.map +1 -1
  188. package/dist/library.d.ts +8 -0
  189. package/dist/library.d.ts.map +1 -1
  190. package/dist/library.js +24 -1
  191. package/dist/library.js.map +1 -1
  192. package/dist/program.d.ts.map +1 -1
  193. package/dist/program.js +2 -0
  194. package/dist/program.js.map +1 -1
  195. package/dist/sync/files.d.ts +12 -0
  196. package/dist/sync/files.d.ts.map +1 -1
  197. package/dist/sync/files.js.map +1 -1
  198. package/dist/sync/source.d.ts.map +1 -1
  199. package/dist/sync/source.js +53 -37
  200. package/dist/sync/source.js.map +1 -1
  201. package/dist/sync/users.d.ts +15 -2
  202. package/dist/sync/users.d.ts.map +1 -1
  203. package/dist/sync/users.js +36 -1
  204. package/dist/sync/users.js.map +1 -1
  205. package/dist/version.d.ts +1 -1
  206. package/dist/version.js +1 -1
  207. package/package.json +4 -4
  208. package/dist/bundle/chunk-6EOZTUHT.js +0 -726
  209. package/dist/bundle/command-contract-TVRFW2IX.js +0 -38
  210. package/dist/bundle/first-run-7JKE5AHN.js +0 -29
  211. package/dist/bundle/first-screen-ZROHOEYJ.js +0 -38
  212. package/dist/bundle/meeting-combined-SSTOJUIJ.js +0 -24
  213. package/dist/bundle/meeting-model-K7TPS4S5.js +0 -26
  214. package/dist/bundle/oauth-XBTROXHB.js +0 -20
  215. package/dist/bundle/server-UC2FNNXX.js +0 -72
  216. package/dist/bundle/store-maintenance-command-LRGQJPSZ.js +0 -63
@@ -1,40 +1,24 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
- validateVector
5
- } from "./chunk-QWYMXFKM.js";
6
- import {
7
- meaningFloor
8
- } from "./chunk-ONZVPE24.js";
9
- import {
10
- MESSAGE_PARSING,
11
- RRF_K,
12
- plainQuery
13
- } from "./chunk-QYXWRKNA.js";
4
+ MESSAGE_PARSING
5
+ } from "./chunk-LC6WE6JS.js";
14
6
  import {
15
7
  normalize
16
- } from "./chunk-HZRQLAHO.js";
8
+ } from "./chunk-2Z7UOXFC.js";
17
9
  import {
18
- MEETING_FIELD_NAMES,
19
- formatMeetingReference,
20
10
  implicitTextTerms,
21
- liftMeetingFields,
22
11
  parseLucene,
23
- parseMeetingReference,
24
- refreshMeetingIndex,
25
12
  walkQuery
26
- } from "./chunk-HHVFIXDO.js";
13
+ } from "./chunk-JVESLS7B.js";
27
14
  import {
28
15
  CliError
29
- } from "./chunk-DB2XKHI4.js";
16
+ } from "./chunk-HM6AMYHR.js";
30
17
  import {
31
18
  __name
32
19
  } from "./chunk-ZVVMGPBJ.js";
33
20
 
34
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
35
- import { createHash } from "node:crypto";
36
-
37
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/search/question-plan.js
21
+ // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/question-plan.js
38
22
  var words = /* @__PURE__ */ __name((text) => normalize(text).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
39
23
  var joinedHyphens = /* @__PURE__ */ __name((text) => (normalize(text).match(new RegExp("(?<![:\\p{L}\\p{N}-])\\p{L}[\\p{L}\\p{N}]*(?:-\\p{L}[\\p{L}\\p{N}]*)+", "gu")) ?? []).map((word) => word.replaceAll("-", "")), "joinedHyphens");
40
24
  var scaffolding = new Set(words("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
@@ -171,200 +155,14 @@ var questionLookup = /* @__PURE__ */ __name((text) => {
171
155
  return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
172
156
  }, "questionLookup");
173
157
 
174
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
175
- var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
176
- const { project, tag, topic, ...input } = request;
177
- input.signal?.throwIfAborted();
178
- if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
179
- throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
180
- const selection = [];
181
- const knowledge = store.knowledge;
182
- if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
183
- throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
184
- for (const [kind, name] of [
185
- ["project", project],
186
- ["tag", tag],
187
- ["topic", topic]
188
- ]) {
189
- if (name === void 0)
190
- continue;
191
- if (!knowledge)
192
- continue;
193
- const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
194
- input.signal?.throwIfAborted();
195
- if (found.ambiguous || found.matches.length !== 1)
196
- throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
197
- candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
198
- });
199
- const entry = found.matches[0];
200
- const id = Number(entry?.id);
201
- if (!entry || entry.kind !== kind || !Number.isSafeInteger(id) || id < 1)
202
- throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
203
- if (kind === "project")
204
- input.projectId = id;
205
- else
206
- input.tagId = id;
207
- selection.push({ kind, id, name: entry.name, by: "explicit-link" });
208
- }
209
- return { input, selection };
210
- }, "resolveMeetingSelection");
211
- var searchMeetingHits = /* @__PURE__ */ __name(async (store, query, request, options = {}) => {
212
- const lifted = liftMeetingFields(plainQuery(query, MEETING_FIELD_NAMES), request);
213
- const { input, selection } = await resolveMeetingSelection(store, lifted.request);
214
- if (options.refreshIndex !== false)
215
- await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
216
- const result = await store.meetings.searchHits(lifted.query, input);
217
- input.signal?.throwIfAborted();
218
- return { ...result, selection };
219
- }, "searchMeetingHits");
220
-
221
- // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
222
- var DEPTH = 200;
223
- var cursorOf = /* @__PURE__ */ __name((value, key) => {
224
- if (value === void 0)
225
- return 0;
226
- let cursor;
227
- try {
228
- cursor = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
229
- } catch {
230
- throw new CliError("validation_error", "the cursor is not from a combined meeting search; search again");
231
- }
232
- if (cursor?.version !== 1 || cursor.key !== key || !Number.isSafeInteger(cursor.offset) || cursor.offset < 0)
233
- throw new CliError("validation_error", "the cursor belongs to another query, filter or model; search again");
234
- return cursor.offset;
235
- }, "cursorOf");
236
- var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, typed, request) => {
237
- const { maxChunks, maxRows, maxTextBytes, ...chosen } = request;
238
- const { query, request: words2 } = liftMeetingFields(typed, chosen);
239
- const { input, selection } = await resolveMeetingSelection(store, words2);
240
- const { after, limit = 20, maxReadBytes, ...filters } = input;
241
- const terms = questionTerms(query);
242
- const wordQuery = terms === null ? query : terms.join(" ");
243
- const key = createHash("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
244
- const offset = cursorOf(after, key);
245
- let byWords = [];
246
- let indexing = "ready";
247
- let refused;
248
- if (wordQuery.trim()) {
249
- await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
250
- try {
251
- const page = await store.meetings.searchHits(wordQuery, { ...filters, limit: DEPTH, maxReadBytes });
252
- byWords = page.items;
253
- indexing = page.coverage.indexing;
254
- } catch (error) {
255
- if (!(error instanceof CliError) || error.code !== "validation_error")
256
- throw error;
257
- refused = error.message;
258
- }
259
- }
260
- input.signal?.throwIfAborted();
261
- const vectors = await embedder.embed([query], "query");
262
- if (vectors.length !== 1)
263
- throw new CliError("invalid_response", "Meeting query model returned another vector count");
264
- const vector = vectors[0];
265
- const ranked = await store.meetingVectors.ranked(embedder.key, validateVector(vector, embedder.dims), {
266
- ...filters,
267
- limit: DEPTH,
268
- ...maxChunks === void 0 ? {} : { maxChunks },
269
- ...maxRows === void 0 ? {} : { maxRows },
270
- ...maxTextBytes === void 0 ? {} : { maxTextBytes }
271
- });
272
- const floor = meaningFloor(embedder.key);
273
- const byMeaning = ranked.items.filter(({ score }) => score > floor);
274
- const merged = /* @__PURE__ */ new Map();
275
- byMeaning.forEach((hit, rank) => {
276
- const reference = { type: "meeting", accountId: input.accountId, meetingId: hit.meetingId };
277
- const first = formatMeetingReference({
278
- ...reference,
279
- transcriptId: hit.transcriptId,
280
- cuePosition: hit.firstPosition
281
- });
282
- merged.set(`${hit.transcriptId}:${hit.firstPosition}`, {
283
- ref: first,
284
- meetingId: hit.meetingId,
285
- scope: "transcript",
286
- text: hit.text,
287
- startMs: null,
288
- source: { title: hit.title, startedAt: hit.startedAt, url: null },
289
- by: ["meaning"],
290
- score: hit.score,
291
- passage: {
292
- first,
293
- last: formatMeetingReference({ ...reference, transcriptId: hit.transcriptId, cuePosition: hit.lastPosition })
294
- },
295
- fused: 1 / (RRF_K + rank + 1)
296
- });
297
- });
298
- byWords.forEach((hit, rank) => {
299
- const share = 1 / (RRF_K + rank + 1);
300
- const cue = hit.scope === "transcript" ? parseMeetingReference(hit.ref) : void 0;
301
- const within = cue?.cuePosition === void 0 ? void 0 : byMeaning.find((passage) => passage.transcriptId === cue.transcriptId && passage.firstPosition <= cue.cuePosition && cue.cuePosition <= passage.lastPosition);
302
- const held = within && merged.get(`${within.transcriptId}:${within.firstPosition}`);
303
- const found = {
304
- ref: hit.ref,
305
- text: hit.text,
306
- startMs: hit.startMs,
307
- ...hit.match === void 0 ? {} : { match: hit.match },
308
- ...hit.corrections === void 0 ? {} : { corrections: hit.corrections }
309
- };
310
- if (held && !held.by.includes("words")) {
311
- Object.assign(held, found, { by: ["words", "meaning"], fused: held.fused + share });
312
- if (hit.source?.url)
313
- held.source.url = hit.source.url;
314
- } else if (held)
315
- held.fused += share;
316
- else
317
- merged.set(`w:${hit.ref}:${hit.scope}:${hit.id}`, {
318
- ...found,
319
- meetingId: hit.meetingId,
320
- scope: hit.scope,
321
- source: {
322
- title: hit.source?.title ?? null,
323
- startedAt: hit.source?.startedAt ?? null,
324
- url: hit.source?.url ?? null
325
- },
326
- by: ["words"],
327
- score: null,
328
- fused: share
329
- });
330
- });
331
- const ordered = [...merged.values()].sort((a, b) => b.fused - a.fused || Number(b.by.includes("words")) - Number(a.by.includes("words")) || (b.score ?? -2) - (a.score ?? -2));
332
- const items = ordered.slice(offset, offset + limit).map(({ fused: _, ...hit }) => hit);
333
- const hasMore = ordered.length > offset + limit;
334
- return {
335
- items,
336
- hasMore,
337
- nextCursor: hasMore ? Buffer.from(JSON.stringify({ version: 1, key, offset: offset + limit })).toString("base64url") : null,
338
- selection,
339
- words: {
340
- query: wordQuery,
341
- ...terms === null ? {} : { from: "question" },
342
- ...refused === void 0 ? {} : { refused }
343
- },
344
- model: { key: embedder.key, model: embedder.model, kind: embedder.kind, dims: embedder.dims },
345
- coverage: {
346
- archiveCompleteness: "unknown",
347
- indexCompleteness: "unknown",
348
- indexing,
349
- /** Every vector of the selection was compared; false when `maxChunks` stopped the scan. */
350
- meaningScanComplete: ranked.complete,
351
- scanned: ranked.scanned,
352
- /** Each side ranks this many at most; pages past them hold nothing more. */
353
- depth: DEPTH
354
- }
355
- };
356
- }, "searchMeetingsCombined");
357
-
358
158
  export {
359
159
  words,
360
160
  joinedHyphens,
361
161
  isFunctionWord,
162
+ questionTerms,
362
163
  planQuestion,
363
164
  questionText,
364
165
  lookupTerms,
365
166
  anyOfTerms,
366
- questionLookup,
367
- resolveMeetingSelection,
368
- searchMeetingHits,
369
- searchMeetingsCombined
167
+ questionLookup
370
168
  };