@wirecat/zoom-cli 0.81.0 → 0.83.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 (239) hide show
  1. package/README.md +2 -2
  2. package/contracts/wirecat.json +54 -54
  3. package/dist/answers.d.ts +56 -0
  4. package/dist/answers.d.ts.map +1 -1
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/api.js +1 -1
  7. package/dist/api.js.map +1 -1
  8. package/dist/bin/main.js +2 -15
  9. package/dist/bin/main.js.map +1 -1
  10. package/dist/bin/zm.js +2 -2
  11. package/dist/bundle/agent-3HDWEZ5M.js +47 -0
  12. package/dist/bundle/{all-profiles-3ASMN35R.js → all-profiles-RY2OMSDL.js} +12 -12
  13. package/dist/bundle/answer-policy-IFVXPPGW.js +131 -0
  14. package/dist/bundle/{anthropic-XXI53VNI.js → anthropic-36VPSF7B.js} +6 -6
  15. package/dist/bundle/{app-server-B7WLNZNQ.js → app-server-ZVJVUGB7.js} +79 -76
  16. package/dist/bundle/{bun-2FLR4IV4.js → bun-F4M4KCNA.js} +2 -2
  17. package/dist/bundle/{bun-sqlite-3NNHTOGM.js → bun-sqlite-IOPYIUA7.js} +7 -7
  18. package/dist/bundle/{chunk-L54I45OX.js → chunk-26TW5RZ6.js} +33 -317
  19. package/dist/bundle/{chunk-JK24A3RP.js → chunk-2DK5BBFF.js} +3 -3
  20. package/dist/bundle/{chunk-4VOCXLMJ.js → chunk-2IBKKVVZ.js} +6 -6
  21. package/dist/bundle/{chunk-WKNYNK7W.js → chunk-2S54TM4N.js} +4 -4
  22. package/dist/bundle/{chunk-WHXYPLUE.js → chunk-3AQHKXVR.js} +4 -4
  23. package/dist/bundle/{chunk-YISJJNXT.js → chunk-3CW2C7ZA.js} +3 -3
  24. package/dist/bundle/{chunk-77TJ3AJH.js → chunk-3KUEZK5Z.js} +3 -3
  25. package/dist/bundle/{chunk-NQGGTO3B.js → chunk-3PXUQFHX.js} +8 -8
  26. package/dist/bundle/{chunk-N5ROXGY4.js → chunk-3QN5KDFZ.js} +167 -167
  27. package/dist/bundle/{chunk-AWJQ6FAX.js → chunk-434YFJAE.js} +2 -2
  28. package/dist/bundle/{chunk-4BU3LRTB.js → chunk-575JMTDR.js} +19 -18
  29. package/dist/bundle/{chunk-NM5XMKWO.js → chunk-5B2LV4MS.js} +2 -1
  30. package/dist/bundle/{chunk-3M436OO2.js → chunk-5WL5RHOO.js} +7 -102
  31. package/dist/bundle/{chunk-PS7HQ5LQ.js → chunk-6C7ESL5N.js} +3 -3
  32. package/dist/bundle/{chunk-SRUAUMBL.js → chunk-6E4KLYNP.js} +12 -12
  33. package/dist/bundle/chunk-7JDXR75Q.js +465 -0
  34. package/dist/bundle/{chunk-L2ERFXB7.js → chunk-AK3H2C65.js} +40 -31
  35. package/dist/bundle/{chunk-OEQNP56V.js → chunk-AQ5RIOUE.js} +1 -1
  36. package/dist/bundle/{chunk-35FVYRH5.js → chunk-AQLUAQXJ.js} +37 -180
  37. package/dist/bundle/{chunk-EPASOAEI.js → chunk-ASTLGFTR.js} +284 -184
  38. package/dist/bundle/{chunk-YNWBRDBX.js → chunk-ATHBB7OU.js} +2 -2
  39. package/dist/bundle/{chunk-ZFRYFDZN.js → chunk-B2NM65RD.js} +14 -6
  40. package/dist/bundle/{chunk-VQTYJ6XH.js → chunk-B4KHDXJE.js} +3 -3
  41. package/dist/bundle/{chunk-G3DWMG7Y.js → chunk-BAFC7WNI.js} +4 -4
  42. package/dist/bundle/{chunk-2GNGR265.js → chunk-BBGJQMRI.js} +1 -1
  43. package/dist/bundle/{chunk-C4BBCSGK.js → chunk-BTLZYRIW.js} +6 -6
  44. package/dist/bundle/{chunk-T2BHIC37.js → chunk-BZDS2X6Y.js} +65 -65
  45. package/dist/bundle/{chunk-3UX4VJWD.js → chunk-C7JPYWYQ.js} +3 -4
  46. package/dist/bundle/{chunk-R4CXFYQN.js → chunk-CDQUW25G.js} +180 -38
  47. package/dist/bundle/{chunk-YJKXCINQ.js → chunk-CJWGJBHW.js} +274 -60
  48. package/dist/bundle/{chunk-F2J2FQUB.js → chunk-D7RCUODT.js} +9 -9
  49. package/dist/bundle/{chunk-AV2ZJ4WX.js → chunk-DNCLQPOM.js} +1 -1
  50. package/dist/bundle/{chunk-LGESUPKO.js → chunk-DQJECJUE.js} +25 -90
  51. package/dist/bundle/{chunk-MA4UJNUI.js → chunk-E4JQ3MCW.js} +12 -12
  52. package/dist/bundle/{chunk-GW2A2FJH.js → chunk-E4ODYLEK.js} +8 -8
  53. package/dist/bundle/{chunk-Q26UFIH4.js → chunk-EE45N67Q.js} +16 -3
  54. package/dist/bundle/{chunk-5SEBLX6B.js → chunk-EEEU4MKK.js} +12 -12
  55. package/dist/bundle/{chunk-YRDQ54G5.js → chunk-ESN3W2MZ.js} +24 -11
  56. package/dist/bundle/{chunk-M7OYEMLI.js → chunk-ETIZGA4P.js} +7 -7
  57. package/dist/bundle/{chunk-IVZACJ6X.js → chunk-F44QK6CK.js} +4 -4
  58. package/dist/bundle/{chunk-JKEMW6E4.js → chunk-FH2UFNH6.js} +2 -2
  59. package/dist/bundle/{chunk-XYQVVW4R.js → chunk-FTH6WGYO.js} +1 -1
  60. package/dist/bundle/chunk-FWACRG4X.js +160 -0
  61. package/dist/bundle/chunk-G5SZL7G2.js +150 -0
  62. package/dist/bundle/{chunk-GDRFVBCB.js → chunk-G6CHEFAG.js} +2 -2
  63. package/dist/bundle/{chunk-2ELGSNX3.js → chunk-GHJD7PE6.js} +170 -170
  64. package/dist/bundle/{chunk-LECMHK2F.js → chunk-GZ7WBU5Y.js} +1 -1
  65. package/dist/bundle/{chunk-4ZXJ4AZW.js → chunk-H6A4NWYJ.js} +322 -45
  66. package/dist/bundle/{chunk-D26K6756.js → chunk-HKLRI2LB.js} +6 -6
  67. package/dist/bundle/{chunk-R6HP2XKD.js → chunk-HMD4FZYY.js} +5 -5
  68. package/dist/bundle/{chunk-2Z7UOXFC.js → chunk-HO4JGD4Q.js} +1 -1
  69. package/dist/bundle/chunk-HUAHLO6N.js +29 -0
  70. package/dist/bundle/{chunk-UHMJSSQO.js → chunk-IANKXHSE.js} +1 -1
  71. package/dist/bundle/{chunk-QFK52FG6.js → chunk-IQZXFWFI.js} +3 -3
  72. package/dist/bundle/{chunk-GPRJXJC7.js → chunk-ISQ23VKV.js} +22 -1
  73. package/dist/bundle/{chunk-ZLYICF6A.js → chunk-JEH33ZCD.js} +4 -4
  74. package/dist/bundle/{chunk-IDUKCXL7.js → chunk-JUNQYWQ2.js} +13 -9
  75. package/dist/bundle/{chunk-337ALCXQ.js → chunk-JUXMVQWJ.js} +312 -153
  76. package/dist/bundle/{chunk-5EWYDHBH.js → chunk-KHQDWYCG.js} +2 -2
  77. package/dist/bundle/{chunk-FMMYBVCH.js → chunk-KYRYD4CR.js} +1 -1
  78. package/dist/bundle/chunk-LBGT6W4R.js +377 -0
  79. package/dist/bundle/{chunk-UUVWAVKN.js → chunk-LN7HRYTH.js} +3 -3
  80. package/dist/bundle/{chunk-NS3JWBDR.js → chunk-MEB7HBTM.js} +6 -6
  81. package/dist/bundle/{chunk-K7CTCDYX.js → chunk-MEEFWYX3.js} +6 -6
  82. package/dist/bundle/{chunk-BQBC2WIG.js → chunk-MNOAMJ6H.js} +1 -1
  83. package/dist/bundle/{chunk-Y7XJA4EW.js → chunk-MYHPXJDG.js} +4 -4
  84. package/dist/bundle/{chunk-7JWVPJIP.js → chunk-NGI37RFW.js} +10 -10
  85. package/dist/bundle/{chunk-437DLSB3.js → chunk-NZMWD7Y3.js} +17227 -13055
  86. package/dist/bundle/chunk-O6IECJRM.js +54 -0
  87. package/dist/bundle/{chunk-LVCCZI5A.js → chunk-OBWL3BUV.js} +39 -39
  88. package/dist/bundle/{chunk-GCAJW4SR.js → chunk-OEEWVKJX.js} +1 -1
  89. package/dist/bundle/chunk-OGTN2KVG.js +147 -0
  90. package/dist/bundle/{chunk-B2WBWKYN.js → chunk-OQYZ3W4K.js} +12 -12
  91. package/dist/bundle/{chunk-IFM4G4MT.js → chunk-P3ZCTYGW.js} +4 -4
  92. package/dist/bundle/{chunk-VAW7QGJA.js → chunk-PVEBAHFU.js} +3 -3
  93. package/dist/bundle/{chunk-IYNICUCC.js → chunk-R2B6PUVI.js} +4 -4
  94. package/dist/bundle/{chunk-D7CDHBDX.js → chunk-R6IA5UQB.js} +1 -1
  95. package/dist/bundle/{chunk-T7QPZYRZ.js → chunk-RLOH7RDN.js} +7 -7
  96. package/dist/bundle/{chunk-V3ZTAAJ6.js → chunk-RQ4AXSCJ.js} +8 -8
  97. package/dist/bundle/{chunk-4BXLHSXY.js → chunk-RYGTCRFZ.js} +2 -2
  98. package/dist/bundle/{chunk-XWKUGAG6.js → chunk-S4PXWIE4.js} +85 -87
  99. package/dist/bundle/{chunk-ZMAPXIGC.js → chunk-SDZZYZLL.js} +2 -2
  100. package/dist/bundle/{chunk-ZNAX7GUV.js → chunk-SHQAYUK6.js} +8 -8
  101. package/dist/bundle/{chunk-YUDVRFXN.js → chunk-T3W4V4A6.js} +1 -1
  102. package/dist/bundle/{chunk-F5ZAN7OC.js → chunk-TCT5D2X2.js} +1 -1
  103. package/dist/bundle/{chunk-EEBSKMEA.js → chunk-TDWPOSPR.js} +12 -12
  104. package/dist/bundle/{chunk-WIX6BFRF.js → chunk-TER3N27H.js} +8 -8
  105. package/dist/bundle/{chunk-UMPUY77T.js → chunk-TMTNP7QN.js} +10 -10
  106. package/dist/bundle/{chunk-BZXHJKKI.js → chunk-TO5UEWXR.js} +2 -2
  107. package/dist/bundle/{chunk-HVXOA4FO.js → chunk-TXDR6YSF.js} +1 -1
  108. package/dist/bundle/{chunk-CFQQTDSA.js → chunk-TY7NDMFY.js} +1 -1
  109. package/dist/bundle/{chunk-YIIGF643.js → chunk-UAWSINMC.js} +10 -10
  110. package/dist/bundle/{chunk-RQFRXUI4.js → chunk-UBH7YF3C.js} +200 -112
  111. package/dist/bundle/{chunk-MBBR7QHI.js → chunk-UEAE3JUU.js} +2641 -1150
  112. package/dist/bundle/{chunk-2RFWRJFK.js → chunk-UHR363OD.js} +14 -10
  113. package/dist/bundle/{chunk-RRYHLP3A.js → chunk-UM52A76S.js} +6 -6
  114. package/dist/bundle/chunk-URP6BTHN.js +624 -0
  115. package/dist/bundle/{chunk-HHQROAJQ.js → chunk-UWQEAA6S.js} +1 -1
  116. package/dist/bundle/{chunk-DMJLJVD3.js → chunk-VR7QZGRU.js} +7 -7
  117. package/dist/bundle/{chunk-QNG27PGH.js → chunk-VRH5PBSL.js} +21 -17
  118. package/dist/bundle/chunk-VTLQTQKY.js +1756 -0
  119. package/dist/bundle/{chunk-NX3BLISW.js → chunk-VTYNLTDW.js} +6 -6
  120. package/dist/bundle/{chunk-HIFPHARA.js → chunk-WY7XG6TE.js} +4 -4
  121. package/dist/bundle/{chunk-IBYGNUO7.js → chunk-XEOZTA3H.js} +1 -1
  122. package/dist/bundle/{chunk-4FSH7K6N.js → chunk-XH23ML2V.js} +2 -2
  123. package/dist/bundle/{chunk-VXD65V67.js → chunk-XYF76A26.js} +2224 -2288
  124. package/dist/bundle/{chunk-J5EHZBO5.js → chunk-ZDYJAEVB.js} +19 -3
  125. package/dist/bundle/{chunk-FXZPAGHT.js → chunk-ZJ63HDBT.js} +2 -2
  126. package/dist/bundle/{chunk-N62P5FY4.js → chunk-ZT4ZPUIO.js} +12 -12
  127. package/dist/bundle/{cli-WTGAGSXV.js → cli-JK6PQSSN.js} +133 -116
  128. package/dist/bundle/command-contract-F3QNBKPX.js +46 -0
  129. package/dist/bundle/{command-server-entry-47CAYN3E.js → command-server-entry-DJLGN62J.js} +36 -35
  130. package/dist/bundle/config-TYYMV3HV.js +118 -0
  131. package/dist/bundle/{decode-2G7QS5IQ.js → decode-ZZICNNFF.js} +6 -6
  132. package/dist/bundle/{dispatch-ZAP3KBVJ.js → dispatch-FKMIPCPQ.js} +9 -9
  133. package/dist/bundle/{dist-WY6R3WH7.js → dist-NQPF25XI.js} +52 -49
  134. package/dist/bundle/{echarts-YRRVLEX3.js → echarts-QMAA7HH5.js} +2 -2
  135. package/dist/bundle/{embed-B5H3OW2O.js → embed-T64EUKUI.js} +7 -7
  136. package/dist/bundle/{embedder-3O73SP6Y.js → embedder-ZEKISZXI.js} +10 -10
  137. package/dist/bundle/{failure-EYGW7JMC.js → failure-XTWBYI2A.js} +3 -3
  138. package/dist/bundle/first-run-ZFNY4RRH.js +29 -0
  139. package/dist/bundle/first-screen-LPGCHRHZ.js +47 -0
  140. package/dist/bundle/{folders-4CGFWM6H.js → folders-ROKVKSCT.js} +5 -5
  141. package/dist/bundle/{instructions-AG7SRWTR.js → instructions-4H7UREH2.js} +1 -1
  142. package/dist/bundle/{main-DOGY6FJP.js → main-GCK3VYAA.js} +27 -37
  143. package/dist/bundle/{mcp-YGOAUNC3.js → mcp-5HFPWC3W.js} +2 -2
  144. package/dist/bundle/meeting-combined-7HDPOUPB.js +28 -0
  145. package/dist/bundle/meeting-model-MVUW7UPQ.js +26 -0
  146. package/dist/bundle/{meeting-semantic-FOEBWV3P.js → meeting-semantic-IF633WGX.js} +8 -8
  147. package/dist/bundle/{meetings-PVE4C2NF.js → meetings-RY2AAPHV.js} +7 -7
  148. package/dist/bundle/{node-GJQYN4FT.js → node-P3PUHKYH.js} +2 -2
  149. package/dist/bundle/{node-sqlite-MLRYKVCQ.js → node-sqlite-ASAZJNHE.js} +8 -8
  150. package/dist/bundle/{oauth-AC55C6SG.js → oauth-4U3OCK3W.js} +8 -8
  151. package/dist/bundle/oauth-AJARLPSY.js +46 -0
  152. package/dist/bundle/{open-3LGTYP6M.js → open-SEJRY2ZI.js} +6 -6
  153. package/dist/bundle/openai-FZDSC2AA.js +28 -0
  154. package/dist/bundle/{output-file-FXMTTLOI.js → output-file-RYIOIXMD.js} +6 -6
  155. package/dist/bundle/{process-MEKCZMX3.js → process-AFIXYXWL.js} +1 -1
  156. package/dist/bundle/{program-E5BSSIGY.js → program-OYLVYA4Z.js} +186 -247
  157. package/dist/bundle/{prompt-AIA6QSZK.js → prompt-BCRD64F4.js} +6 -6
  158. package/dist/bundle/public-SVJILCNI.js +206 -0
  159. package/dist/bundle/{recognize-M57VNTEV.js → recognize-25ITJWGX.js} +5 -5
  160. package/dist/bundle/{remote-3OTENZ7Z.js → remote-5FBAJX7O.js} +11 -11
  161. package/dist/bundle/{rerank-P5WHDFDU.js → rerank-2HGWWORY.js} +8 -8
  162. package/dist/bundle/run-log-7HRF4Y47.js +145 -0
  163. package/dist/bundle/{serve-BRLC2QVV.js → serve-RL35MSJD.js} +10 -10
  164. package/dist/bundle/{server-25NF7DMS.js → server-QUSBWACP.js} +71 -68
  165. package/dist/bundle/server-SCK2SRDK.js +96 -0
  166. package/dist/bundle/{services-MJE43OGD.js → services-BGRIQNDC.js} +66 -60
  167. package/dist/bundle/{speech-4AVCWTQH.js → speech-4W3ZMTFK.js} +25 -25
  168. package/dist/bundle/{sqlite-runtime-U4TQXWMC.js → sqlite-runtime-K3KLRZCV.js} +7 -7
  169. package/dist/bundle/{state-GNUGVMY7.js → state-GYL4C74G.js} +7 -7
  170. package/dist/bundle/{store-KBFZVQWF.js → store-27UQMNEO.js} +28 -26
  171. package/dist/bundle/{store-MHVBFUBB.js → store-NLYH5SQX.js} +64 -46
  172. package/dist/bundle/store-connection-CZILWRSR.js +112 -0
  173. package/dist/bundle/store-maintenance-command-Z3QLNSXJ.js +84 -0
  174. package/dist/bundle/{streaming-6F7AFEHD.js → streaming-73EKEGPF.js} +7 -7
  175. package/dist/bundle/surface-CV3C4RV2.js +82 -0
  176. package/dist/bundle/tokens-PY3S22LY.js +27 -0
  177. package/dist/bundle/zm.js +9 -9
  178. package/dist/bundle/{zoom-app-YTGOZ2FS.js → zoom-app-4F4YY4OI.js} +11 -9
  179. package/dist/commands.d.ts +1 -8
  180. package/dist/commands.d.ts.map +1 -1
  181. package/dist/commands.js +3 -33
  182. package/dist/commands.js.map +1 -1
  183. package/dist/index.d.ts +1 -2
  184. package/dist/index.d.ts.map +1 -1
  185. package/dist/index.js +1 -2
  186. package/dist/index.js.map +1 -1
  187. package/dist/program-bindings.d.ts.map +1 -1
  188. package/dist/program-bindings.js +2 -12
  189. package/dist/program-bindings.js.map +1 -1
  190. package/dist/program.d.ts +3 -5
  191. package/dist/program.d.ts.map +1 -1
  192. package/dist/run.d.ts.map +1 -1
  193. package/dist/run.js +6 -1
  194. package/dist/run.js.map +1 -1
  195. package/dist/setup-commands.d.ts +5 -14
  196. package/dist/setup-commands.d.ts.map +1 -1
  197. package/dist/setup-commands.js +7 -142
  198. package/dist/setup-commands.js.map +1 -1
  199. package/dist/tokens.d.ts +20 -44
  200. package/dist/tokens.d.ts.map +1 -1
  201. package/dist/tokens.js +95 -308
  202. package/dist/tokens.js.map +1 -1
  203. package/dist/version.d.ts +1 -1
  204. package/dist/version.js +1 -1
  205. package/dist/zoom-app.js +1 -1
  206. package/dist/zoom-app.js.map +1 -1
  207. package/dist/zoom-session.d.ts +6 -0
  208. package/dist/zoom-session.d.ts.map +1 -0
  209. package/dist/zoom-session.js +72 -0
  210. package/dist/zoom-session.js.map +1 -0
  211. package/package.json +3 -3
  212. package/skills/zoom-cli/references/setup.md +2 -2
  213. package/dist/bundle/agent-VYAJCJLE.js +0 -45
  214. package/dist/bundle/answer-policy-PTH4F2DW.js +0 -129
  215. package/dist/bundle/chunk-46EF6P2J.js +0 -72
  216. package/dist/bundle/chunk-4B335BCJ.js +0 -330
  217. package/dist/bundle/chunk-EWEQ7AXL.js +0 -719
  218. package/dist/bundle/chunk-FXCR4DGU.js +0 -37
  219. package/dist/bundle/chunk-KZ3B6HW5.js +0 -31
  220. package/dist/bundle/chunk-TI4WJOEX.js +0 -789
  221. package/dist/bundle/chunk-UPR2S5IE.js +0 -773
  222. package/dist/bundle/command-contract-3IKVWPDL.js +0 -45
  223. package/dist/bundle/config-ZOGOKGTU.js +0 -116
  224. package/dist/bundle/first-run-MPKMDEMA.js +0 -29
  225. package/dist/bundle/first-screen-AIAAC3KF.js +0 -45
  226. package/dist/bundle/meeting-combined-YKPKTKGA.js +0 -26
  227. package/dist/bundle/meeting-model-HTXSGHNM.js +0 -26
  228. package/dist/bundle/openai-E2MSLVIX.js +0 -28
  229. package/dist/bundle/run-log-EOQ4EQDS.js +0 -143
  230. package/dist/bundle/server-EW2RL2EL.js +0 -93
  231. package/dist/bundle/store-connection-SKRUAI4L.js +0 -109
  232. package/dist/bundle/store-maintenance-command-G6EXJSHJ.js +0 -81
  233. package/dist/bundle/surface-DWEWB5RG.js +0 -79
  234. package/dist/bundle/tokens-BB4MQBLH.js +0 -25
  235. package/dist/login.d.ts +0 -16
  236. package/dist/login.d.ts.map +0 -1
  237. package/dist/login.js +0 -98
  238. package/dist/login.js.map +0 -1
  239. /package/dist/bundle/{chunk-7O7XM37N.js → chunk-7ECP5ZQR.js} +0 -0
@@ -23,28 +23,28 @@ import {
23
23
  tagMemberIds,
24
24
  thingOf,
25
25
  write
26
- } from "./chunk-437DLSB3.js";
26
+ } from "./chunk-NZMWD7Y3.js";
27
27
  import {
28
28
  fold
29
- } from "./chunk-2Z7UOXFC.js";
29
+ } from "./chunk-HO4JGD4Q.js";
30
30
  import {
31
31
  damagedFile
32
- } from "./chunk-ZFRYFDZN.js";
32
+ } from "./chunk-B2NM65RD.js";
33
33
  import {
34
34
  ADDED_PROVIDER,
35
35
  filesAccountSql,
36
36
  folderProviderOf,
37
37
  folderProviderSql,
38
38
  isDocumentAccountProvider
39
- } from "./chunk-TI4WJOEX.js";
39
+ } from "./chunk-7JDXR75Q.js";
40
40
  import {
41
41
  CliError
42
- } from "./chunk-UHMJSSQO.js";
42
+ } from "./chunk-IANKXHSE.js";
43
43
  import {
44
44
  __name
45
45
  } from "./chunk-ZVVMGPBJ.js";
46
46
 
47
- // 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/store/damage.js
47
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/damage.js
48
48
  var DERIVED = /* @__PURE__ */ new Set(["mentions", "involvements", "embeddings"]);
49
49
  var named = /* @__PURE__ */ __name((tables) => tables.length <= 5 ? tables.join(", ") : `${tables.slice(0, 5).join(", ")} and ${tables.length - 5} more`, "named");
50
50
  var isDerivedTable = /* @__PURE__ */ __name((table, searchIndexes) => DERIVED.has(table) || table.startsWith("vector_index_") || searchIndexes.some((index) => table === index || table.startsWith(`${index}_`)), "isDerivedTable");
@@ -147,11 +147,153 @@ var storeDamageReport = /* @__PURE__ */ __name(({ health, command, mark = null,
147
147
  };
148
148
  }, "storeDamageReport");
149
149
 
150
- // 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/store/document-transfer/index.js
151
- import { realpathSync, statSync } from "node:fs";
150
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/health.js
151
+ import { existsSync, statSync } from "node:fs";
152
+ var JSON_COLUMNS = {
153
+ accounts: ["settings"],
154
+ account_identities: ["mail_signals"],
155
+ bot_updates: ["payload"],
156
+ documents: ["front_matter"],
157
+ emails: ["headers"],
158
+ meeting_participants: ["sessions"],
159
+ messages: ["mentions", "reply_to"],
160
+ proposed_actions: ["payload", "result"],
161
+ searches: ["params"],
162
+ tag_consolidations: ["source_member_ids", "survivor_member_ids"],
163
+ task_events: ["changes"]
164
+ };
165
+ var jsonColumns = /* @__PURE__ */ __name((database) => database.prepare(`SELECT m.name AS "table", c.name AS "column", c."notnull" AS required FROM sqlite_master m, pragma_table_info(m.name) c
166
+ WHERE m.type = 'table' AND m.sql NOT LIKE 'CREATE VIRTUAL%' ORDER BY 1, 2`).all().map((row) => ({ table: String(row.table), column: String(row.column), required: Number(row.required) === 1 })).filter(({ table, column }) => column === "metadata" || JSON_COLUMNS[table]?.includes(column)), "jsonColumns");
167
+ var invalidJson = /* @__PURE__ */ __name((database) => jsonColumns(database).map((one) => ({
168
+ ...one,
169
+ rows: Number(database.prepare(`SELECT count(*) AS n FROM "${one.table}" WHERE "${one.column}" IS NOT NULL AND NOT json_valid("${one.column}")`).get()?.n)
170
+ })).filter(({ rows }) => rows > 0), "invalidJson");
171
+ var QUICK_CHECK_LIMIT = 1e4;
172
+ var QUICK_HEALTH_CHECKS = "the file header, its size against its page count, and the schema's own pages";
173
+ var FTS5 = /^\s*CREATE\s+VIRTUAL\s+TABLE\s+\S+\s+USING\s+fts5\s*\(/i;
174
+ var fts5Tables = /* @__PURE__ */ __name((database) => database.prepare("SELECT name, sql FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%' ORDER BY name").all().filter((row) => FTS5.test(String(row.sql))).map((row) => {
175
+ const sql = String(row.sql);
176
+ return { name: String(row.name), sql, external: /content\s*=\s*'[^']+'/i.test(sql) };
177
+ }), "fts5Tables");
178
+ var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
179
+ var bytesOf = /* @__PURE__ */ __name((path) => statSync(path, { throwIfNoEntry: false })?.size ?? 0, "bytesOf");
180
+ var damagedTables = /* @__PURE__ */ __name((database, lines) => {
181
+ const roots = new Map(database.prepare("SELECT rootpage, tbl_name FROM sqlite_master WHERE rootpage > 0").all().map((row) => [Number(row.rootpage), String(row.tbl_name)]));
182
+ const owners = new Map(database.prepare("SELECT name, tbl_name FROM sqlite_master WHERE type = 'index'").all().map((row) => [String(row.name), String(row.tbl_name)]));
183
+ const virtual = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'").all().map((row) => String(row.name));
184
+ const ownerOf = /* @__PURE__ */ __name((table) => table === null ? null : virtual.find((name) => table.startsWith(`${name}_`)) ?? table, "ownerOf");
185
+ const tables = /* @__PURE__ */ new Map();
186
+ for (const raw of lines) {
187
+ const line = raw.replace(/^\*\*\* in database \w+ \*\*\*\s*/, "");
188
+ const tree = /^Tree (\d+) /.exec(line);
189
+ const column = /value in (\w+)\.\w+/.exec(line) ?? /^table (\w+): /.exec(line);
190
+ const index = /index (\w+)/.exec(line)?.[1];
191
+ const table = ownerOf(tree ? roots.get(Number(tree[1])) ?? null : column ? column[1] ?? null : index ? owners.get(index) ?? null : null);
192
+ const known = tables.get(table);
193
+ if (known)
194
+ known.problems += 1;
195
+ else
196
+ tables.set(table, { table, problems: 1, sample: line.slice(0, 200) });
197
+ }
198
+ return [...tables.values()].sort((a, b) => b.problems - a.problems);
199
+ }, "damagedTables");
200
+ var searchIndexHealth = /* @__PURE__ */ __name((database) => fts5Tables(database).map(({ name }) => {
201
+ try {
202
+ database.exec("BEGIN");
203
+ try {
204
+ database.exec(`INSERT INTO "${name}" ("${name}", rank) VALUES ('integrity-check', 0)`);
205
+ } finally {
206
+ database.exec("ROLLBACK");
207
+ }
208
+ return { name, ok: true };
209
+ } catch (error) {
210
+ return { name, ok: false, error: messageOf(error) };
211
+ }
212
+ }), "searchIndexHealth");
213
+ var pragmaLines = /* @__PURE__ */ __name((database, sql) => database.prepare(sql).all().flatMap((row) => String(Object.values(row)[0]).split("\n")), "pragmaLines");
214
+ var checkLines = /* @__PURE__ */ __name((database) => {
215
+ try {
216
+ return pragmaLines(database, `PRAGMA quick_check(${QUICK_CHECK_LIMIT})`);
217
+ } catch {
218
+ const tables = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND rootpage > 0 ORDER BY name").all().map((row) => String(row.name));
219
+ return tables.flatMap((table) => {
220
+ try {
221
+ return pragmaLines(database, `PRAGMA quick_check("${table}")`).filter((line) => line !== "ok");
222
+ } catch (error) {
223
+ return [`table ${table}: ${messageOf(error)}`];
224
+ }
225
+ });
226
+ }
227
+ }, "checkLines");
228
+ var quickHealth = /* @__PURE__ */ __name((database, path) => {
229
+ const pragma = /* @__PURE__ */ __name((name) => Number(Object.values(database.prepare(`PRAGMA ${name}`).get() ?? {})[0] ?? 0), "pragma");
230
+ const file = {
231
+ bytes: bytesOf(path),
232
+ pages: pragma("page_count"),
233
+ pageSize: pragma("page_size"),
234
+ freePages: pragma("freelist_count")
235
+ };
236
+ const schema = database.prepare("PRAGMA quick_check('sqlite_schema')").all().map((row) => String(Object.values(row)[0]));
237
+ const walFrames = existsSync(`${path}-wal`) && bytesOf(`${path}-wal`) > 0;
238
+ const sized = walFrames || file.bytes === file.pages * file.pageSize;
239
+ const problems = [
240
+ ...schema.length === 1 && schema[0] === "ok" ? [] : schema,
241
+ ...sized ? [] : [`the file holds ${file.bytes} bytes, its header says ${file.pages * file.pageSize}`]
242
+ ];
243
+ return { file, problems };
244
+ }, "quickHealth");
245
+ var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) => {
246
+ const started = Date.now();
247
+ const checked = deep ? "deep" : "quick";
248
+ const done = /* @__PURE__ */ __name((health) => ({
249
+ path,
250
+ checked,
251
+ ...health,
252
+ ms: Date.now() - started
253
+ }), "done");
254
+ let database;
255
+ try {
256
+ database = (await openSqlite(path, { readOnly: !deep })).database;
257
+ } catch (error) {
258
+ return done({ ok: false, error: messageOf(error) });
259
+ }
260
+ try {
261
+ const { file, problems } = quickHealth(database, path);
262
+ if (!deep) {
263
+ return done({
264
+ ok: problems.length === 0,
265
+ file,
266
+ ...problems.length ? {
267
+ problems: problems.length,
268
+ damagedTables: [{ table: null, problems: problems.length, sample: problems[0] }]
269
+ } : {}
270
+ });
271
+ }
272
+ database.exec("PRAGMA busy_timeout = 30000");
273
+ const lines = checkLines(database);
274
+ const pagesOk = lines.length === 1 && lines[0] === "ok";
275
+ const indexes = searchIndexHealth(database);
276
+ const json = pagesOk ? invalidJson(database) : [];
277
+ return done({
278
+ ok: pagesOk && problems.length === 0 && indexes.every((index) => index.ok) && json.length === 0,
279
+ file,
280
+ problems: pagesOk ? 0 : lines.length,
281
+ damagedTables: pagesOk ? [] : damagedTables(database, lines),
282
+ searchIndexes: indexes,
283
+ invalidJson: json
284
+ });
285
+ } catch (error) {
286
+ return done({ ok: false, error: messageOf(error) });
287
+ } finally {
288
+ database.close();
289
+ }
290
+ }, "storeHealth");
291
+
292
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
293
+ import { realpathSync, statSync as statSync2 } from "node:fs";
152
294
  import { resolve } from "node:path";
153
295
 
154
- // 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/store/sqlite/document-transfer/people.js
296
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
155
297
  var planPeople = /* @__PURE__ */ __name((database, snapshot, mappings, bindings, conflicts) => {
156
298
  const creatable = /* @__PURE__ */ new Set();
157
299
  let people = 0, identities = 0;
@@ -214,11 +356,11 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
214
356
  }
215
357
  }, "copyPeople");
216
358
 
217
- // 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/store/document-transfer/digest.js
359
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
218
360
  import { createHash } from "node:crypto";
219
361
  var digest = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "digest");
220
362
 
221
- // 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/store/sqlite/document-transfer/collection.js
363
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
222
364
  var documentsKeyOf = /* @__PURE__ */ __name((collection) => {
223
365
  const colon = collection.indexOf(":");
224
366
  const provider = collection.slice(0, colon);
@@ -262,7 +404,7 @@ var currentCollection = /* @__PURE__ */ __name((row) => {
262
404
  };
263
405
  }, "currentCollection");
264
406
 
265
- // 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/store/sqlite/document-transfer/plan.js
407
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
266
408
  var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindings) => {
267
409
  const mappings = /* @__PURE__ */ new Map();
268
410
  const missing = /* @__PURE__ */ new Set(), conflicts = /* @__PURE__ */ new Set();
@@ -324,7 +466,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
324
466
  if (bot && bot.kind !== external.bot.kind)
325
467
  conflicts.add(`destination bot kind differs for ${external.reference}`);
326
468
  if (bot)
327
- found = { type: "bot", id: Number(bot.id) };
469
+ found = { type: "agent", id: Number(bot.id) };
328
470
  else
329
471
  continue;
330
472
  } else if (external.collection && external.external_id) {
@@ -344,8 +486,8 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
344
486
  else
345
487
  missing.add(external.reference);
346
488
  }
347
- const organization2 = snapshot.collection.organization_id == null ? null : mappings.get(`organization:${String(snapshot.collection.organization_id)}`)?.id;
348
- if (target && target.organization_id !== organization2)
489
+ const organization = snapshot.collection.organization_id == null ? null : mappings.get(`organization:${String(snapshot.collection.organization_id)}`)?.id;
490
+ if (target && target.organization_id !== organization)
349
491
  conflicts.add("the destination collection has a different organization binding");
350
492
  for (const tagging of snapshot.taggings) {
351
493
  if (Number(tagging.tag_group_size ?? 1) > 1)
@@ -429,7 +571,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
429
571
  };
430
572
  }, "planTransfer");
431
573
 
432
- // 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/store/sqlite/document-transfer/snapshot.js
574
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
433
575
  var TRANSFER_TABLES = { document: "documents", note: "notes", memory: "memories", fact: "facts" };
434
576
  var MAX_ENTITIES = 1e3;
435
577
  var MAX_AUXILIARY = 1e4;
@@ -565,7 +707,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
565
707
  if (identity?.person_id != null)
566
708
  depend("person", identity.person_id);
567
709
  }
568
- if (thing.type === "bot") {
710
+ if (thing.type === "agent") {
569
711
  const bot = database.prepare("SELECT name,kind FROM bots WHERE id=?").get(thing.id);
570
712
  if (bot)
571
713
  item.bot = { name: String(bot.name), kind: String(bot.kind) };
@@ -591,7 +733,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
591
733
  };
592
734
  }), "transferSnapshot");
593
735
 
594
- // 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/store/sqlite/document-transfer/apply.js
736
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
595
737
  var providerHere = /* @__PURE__ */ __name(({ provider, name, settings }) => {
596
738
  if (provider !== "folder" || String(name ?? "").startsWith("google-drive:"))
597
739
  return provider ?? null;
@@ -645,11 +787,11 @@ var applyTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindi
645
787
  mappings.set(external.key, botNamed(database, external.bot.name, now(), external.bot.kind));
646
788
  let collectionId = plan.collectionId;
647
789
  if (collectionId === void 0) {
648
- const organization2 = snapshot.collection.organization_id == null ? void 0 : mapped(mappings, "organization", snapshot.collection.organization_id);
790
+ const organization = snapshot.collection.organization_id == null ? void 0 : mapped(mappings, "organization", snapshot.collection.organization_id);
649
791
  collectionId = insert(database, "accounts", "provider external_id name created_at settings updated_at scope organization_id", {
650
792
  ...snapshot.collection,
651
793
  provider: providerHere(snapshot.collection),
652
- organization_id: organization2?.id ?? null
794
+ organization_id: organization?.id ?? null
653
795
  });
654
796
  }
655
797
  mappings.set(`account:${String(snapshot.collection.id)}`, { type: "account", id: collectionId });
@@ -763,15 +905,15 @@ var remapEntity = /* @__PURE__ */ __name((database, entity, id, mappings) => {
763
905
  database.prepare(`UPDATE ${TRANSFER_TABLES[entity.kind]} SET ${columns.join(",")} WHERE id=?`).run(...values, id);
764
906
  }, "remapEntity");
765
907
 
766
- // 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/store/document-transfer/index.js
908
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
767
909
  var locations = /* @__PURE__ */ __name((options) => {
768
910
  for (const value of [options.source, options.destination, options.collection])
769
911
  if (typeof value !== "string" || !value.trim())
770
912
  throw new CliError("validation_error", "transfer source, destination and collection are required");
771
- if (!statSync(options.source, { throwIfNoEntry: false })?.isFile())
913
+ if (!statSync2(options.source, { throwIfNoEntry: false })?.isFile())
772
914
  throw new CliError("not_found", "the source store does not exist as a file");
773
915
  const source = realpathSync(options.source), destination = resolve(options.destination);
774
- const left = statSync(source), right = statSync(destination, { throwIfNoEntry: false });
916
+ const left = statSync2(source), right = statSync2(destination, { throwIfNoEntry: false });
775
917
  if (right && (!right.isFile() || left.dev === right.dev && left.ino === right.ino))
776
918
  throw new CliError("validation_error", "the source and destination must be different ordinary store files");
777
919
  const bindings = options.bindings ?? {};
@@ -795,7 +937,7 @@ var openSource = /* @__PURE__ */ __name(async (path) => {
795
937
  }
796
938
  }, "openSource");
797
939
  var openPreviewTarget = /* @__PURE__ */ __name(async (path) => {
798
- if (statSync(path, { throwIfNoEntry: false })) {
940
+ if (statSync2(path, { throwIfNoEntry: false })) {
799
941
  const opened = await openSource(path);
800
942
  try {
801
943
  assertReadCompatible(opened.database);
@@ -865,149 +1007,7 @@ var applyWith = /* @__PURE__ */ __name(async (location, options) => {
865
1007
  }
866
1008
  }, "applyWith");
867
1009
 
868
- // 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/store/health.js
869
- import { existsSync, statSync as statSync2 } from "node:fs";
870
- var JSON_COLUMNS = {
871
- accounts: ["settings"],
872
- account_identities: ["mail_signals"],
873
- bot_updates: ["payload"],
874
- documents: ["front_matter"],
875
- emails: ["headers"],
876
- meeting_participants: ["sessions"],
877
- messages: ["mentions", "reply_to"],
878
- proposed_actions: ["payload", "result"],
879
- searches: ["params"],
880
- tag_consolidations: ["source_member_ids", "survivor_member_ids"],
881
- task_events: ["changes"]
882
- };
883
- var jsonColumns = /* @__PURE__ */ __name((database) => database.prepare(`SELECT m.name AS "table", c.name AS "column", c."notnull" AS required FROM sqlite_master m, pragma_table_info(m.name) c
884
- WHERE m.type = 'table' AND m.sql NOT LIKE 'CREATE VIRTUAL%' ORDER BY 1, 2`).all().map((row) => ({ table: String(row.table), column: String(row.column), required: Number(row.required) === 1 })).filter(({ table, column }) => column === "metadata" || JSON_COLUMNS[table]?.includes(column)), "jsonColumns");
885
- var invalidJson = /* @__PURE__ */ __name((database) => jsonColumns(database).map((one) => ({
886
- ...one,
887
- rows: Number(database.prepare(`SELECT count(*) AS n FROM "${one.table}" WHERE "${one.column}" IS NOT NULL AND NOT json_valid("${one.column}")`).get()?.n)
888
- })).filter(({ rows }) => rows > 0), "invalidJson");
889
- var QUICK_CHECK_LIMIT = 1e4;
890
- var QUICK_HEALTH_CHECKS = "the file header, its size against its page count, and the schema's own pages";
891
- var FTS5 = /^\s*CREATE\s+VIRTUAL\s+TABLE\s+\S+\s+USING\s+fts5\s*\(/i;
892
- var fts5Tables = /* @__PURE__ */ __name((database) => database.prepare("SELECT name, sql FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%' ORDER BY name").all().filter((row) => FTS5.test(String(row.sql))).map((row) => {
893
- const sql = String(row.sql);
894
- return { name: String(row.name), sql, external: /content\s*=\s*'[^']+'/i.test(sql) };
895
- }), "fts5Tables");
896
- var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
897
- var bytesOf = /* @__PURE__ */ __name((path) => statSync2(path, { throwIfNoEntry: false })?.size ?? 0, "bytesOf");
898
- var damagedTables = /* @__PURE__ */ __name((database, lines) => {
899
- const roots = new Map(database.prepare("SELECT rootpage, tbl_name FROM sqlite_master WHERE rootpage > 0").all().map((row) => [Number(row.rootpage), String(row.tbl_name)]));
900
- const owners = new Map(database.prepare("SELECT name, tbl_name FROM sqlite_master WHERE type = 'index'").all().map((row) => [String(row.name), String(row.tbl_name)]));
901
- const virtual = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'").all().map((row) => String(row.name));
902
- const ownerOf = /* @__PURE__ */ __name((table) => table === null ? null : virtual.find((name) => table.startsWith(`${name}_`)) ?? table, "ownerOf");
903
- const tables = /* @__PURE__ */ new Map();
904
- for (const raw of lines) {
905
- const line = raw.replace(/^\*\*\* in database \w+ \*\*\*\s*/, "");
906
- const tree = /^Tree (\d+) /.exec(line);
907
- const column = /value in (\w+)\.\w+/.exec(line) ?? /^table (\w+): /.exec(line);
908
- const index = /index (\w+)/.exec(line)?.[1];
909
- const table = ownerOf(tree ? roots.get(Number(tree[1])) ?? null : column ? column[1] ?? null : index ? owners.get(index) ?? null : null);
910
- const known = tables.get(table);
911
- if (known)
912
- known.problems += 1;
913
- else
914
- tables.set(table, { table, problems: 1, sample: line.slice(0, 200) });
915
- }
916
- return [...tables.values()].sort((a, b) => b.problems - a.problems);
917
- }, "damagedTables");
918
- var searchIndexHealth = /* @__PURE__ */ __name((database) => fts5Tables(database).map(({ name }) => {
919
- try {
920
- database.exec("BEGIN");
921
- try {
922
- database.exec(`INSERT INTO "${name}" ("${name}", rank) VALUES ('integrity-check', 0)`);
923
- } finally {
924
- database.exec("ROLLBACK");
925
- }
926
- return { name, ok: true };
927
- } catch (error) {
928
- return { name, ok: false, error: messageOf(error) };
929
- }
930
- }), "searchIndexHealth");
931
- var pragmaLines = /* @__PURE__ */ __name((database, sql) => database.prepare(sql).all().flatMap((row) => String(Object.values(row)[0]).split("\n")), "pragmaLines");
932
- var checkLines = /* @__PURE__ */ __name((database) => {
933
- try {
934
- return pragmaLines(database, `PRAGMA quick_check(${QUICK_CHECK_LIMIT})`);
935
- } catch {
936
- const tables = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND rootpage > 0 ORDER BY name").all().map((row) => String(row.name));
937
- return tables.flatMap((table) => {
938
- try {
939
- return pragmaLines(database, `PRAGMA quick_check("${table}")`).filter((line) => line !== "ok");
940
- } catch (error) {
941
- return [`table ${table}: ${messageOf(error)}`];
942
- }
943
- });
944
- }
945
- }, "checkLines");
946
- var quickHealth = /* @__PURE__ */ __name((database, path) => {
947
- const pragma = /* @__PURE__ */ __name((name) => Number(Object.values(database.prepare(`PRAGMA ${name}`).get() ?? {})[0] ?? 0), "pragma");
948
- const file = {
949
- bytes: bytesOf(path),
950
- pages: pragma("page_count"),
951
- pageSize: pragma("page_size"),
952
- freePages: pragma("freelist_count")
953
- };
954
- const schema = database.prepare("PRAGMA quick_check('sqlite_schema')").all().map((row) => String(Object.values(row)[0]));
955
- const walFrames = existsSync(`${path}-wal`) && bytesOf(`${path}-wal`) > 0;
956
- const sized = walFrames || file.bytes === file.pages * file.pageSize;
957
- const problems = [
958
- ...schema.length === 1 && schema[0] === "ok" ? [] : schema,
959
- ...sized ? [] : [`the file holds ${file.bytes} bytes, its header says ${file.pages * file.pageSize}`]
960
- ];
961
- return { file, problems };
962
- }, "quickHealth");
963
- var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) => {
964
- const started = Date.now();
965
- const checked = deep ? "deep" : "quick";
966
- const done = /* @__PURE__ */ __name((health) => ({
967
- path,
968
- checked,
969
- ...health,
970
- ms: Date.now() - started
971
- }), "done");
972
- let database;
973
- try {
974
- database = (await openSqlite(path, { readOnly: !deep })).database;
975
- } catch (error) {
976
- return done({ ok: false, error: messageOf(error) });
977
- }
978
- try {
979
- const { file, problems } = quickHealth(database, path);
980
- if (!deep) {
981
- return done({
982
- ok: problems.length === 0,
983
- file,
984
- ...problems.length ? {
985
- problems: problems.length,
986
- damagedTables: [{ table: null, problems: problems.length, sample: problems[0] }]
987
- } : {}
988
- });
989
- }
990
- database.exec("PRAGMA busy_timeout = 30000");
991
- const lines = checkLines(database);
992
- const pagesOk = lines.length === 1 && lines[0] === "ok";
993
- const indexes = searchIndexHealth(database);
994
- const json = pagesOk ? invalidJson(database) : [];
995
- return done({
996
- ok: pagesOk && problems.length === 0 && indexes.every((index) => index.ok) && json.length === 0,
997
- file,
998
- problems: pagesOk ? 0 : lines.length,
999
- damagedTables: pagesOk ? [] : damagedTables(database, lines),
1000
- searchIndexes: indexes,
1001
- invalidJson: json
1002
- });
1003
- } catch (error) {
1004
- return done({ ok: false, error: messageOf(error) });
1005
- } finally {
1006
- database.close();
1007
- }
1008
- }, "storeHealth");
1009
-
1010
- // 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/store/project-transfer/preview.js
1010
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
1011
1011
  var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) => {
1012
1012
  if (!options || typeof options !== "object" || Array.isArray(options))
1013
1013
  throw new CliError("validation_error", "project preview options are required");
@@ -1022,18 +1022,18 @@ var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) =>
1022
1022
  throw new CliError("validation_error", "project preview project is a project:<safe integer id> reference");
1023
1023
  const budget = new SnapshotBudget(options.maxReadBytes ?? 4 * 1024 * 1024);
1024
1024
  const target = options.target;
1025
- const project2 = options.project;
1025
+ const project = options.project;
1026
1026
  return damagedFile([target], async () => {
1027
1027
  const context = await openStoreContext({ path: target, env: options.env, readOnly: true });
1028
1028
  try {
1029
- return previewAnnotationSnapshot(context.database, Number(project2.slice(8)), snapshot, options.bindings, budget);
1029
+ return previewAnnotationSnapshot(context.database, Number(project.slice(8)), snapshot, options.bindings, budget);
1030
1030
  } finally {
1031
1031
  context.database.close();
1032
1032
  }
1033
1033
  });
1034
1034
  }, "previewProjectAnnotationSnapshot");
1035
1035
 
1036
- // 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/store/project-transfer/snapshot.js
1036
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
1037
1037
  var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
1038
1038
  if (!options || typeof options !== "object" || Array.isArray(options))
1039
1039
  throw new CliError("validation_error", "snapshot options are required");
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // 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/cli/stdin-field.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
8
8
  var fields = /* @__PURE__ */ new WeakMap();
9
9
  var readsStdin = /* @__PURE__ */ __name((command, field) => {
10
10
  fields.set(command, field);