@wirecat/cli-core 3.1.0-dev → 3.2.0-dev

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 (351) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/background/daily-archive-timer.d.ts +1 -1
  3. package/dist/bundle/{agent-RMLBQXJF-CuqJBQqf.js → agent-J75WGZEV-K_l-bQ-h.js} +5 -5
  4. package/dist/bundle/{all-profiles-3GEKS7PR-Bi_zb5_-.js → all-profiles-3GEKS7PR-BohqgNvP.js} +6 -6
  5. package/dist/bundle/{anthropic-EVM6I7MZ-BWI01JgC.js → anthropic-EVM6I7MZ-CqB3j7dB.js} +2 -2
  6. package/dist/bundle/{app-server-76XGUZHU-__6SrMhc.js → app-server-5BL62GAL-Osw_tMej.js} +20 -15
  7. package/dist/bundle/{bun-AWMVU72K-COHrAYHA.js → bun-AWMVU72K-Bk0oN5Sm.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-CYFVVXXR-r_kJOwku.js → bun-sqlite-CYFVVXXR-4iGlaI9X.js} +3 -3
  9. package/dist/bundle/{chunk-4ZM6SE7G-DNDxhi8l.js → chunk-4HGRFFTO-fNvELOjI.js} +330 -56
  10. package/dist/bundle/{chunk-6G6TIMKP-CoVYG_I3.js → chunk-6G6TIMKP-Byea1UGV.js} +4 -4
  11. package/dist/bundle/{chunk-M5CHOMME-BIcASmVb.js → chunk-6OLVBOBX-Ch2rblZk.js} +17 -11
  12. package/dist/bundle/{chunk-CCFBHR4O-DAuKd8rI.js → chunk-CCFBHR4O-Bhxq5eaI.js} +1 -1
  13. package/dist/bundle/{chunk-DDXCCEI4-CHLrblc1.js → chunk-DDXCCEI4-CBg_l4Ro.js} +2 -2
  14. package/dist/bundle/{chunk-DZPIGAKP-nrRAPNTz.js → chunk-DZPIGAKP-BZy6DShN.js} +1 -1
  15. package/dist/bundle/{chunk-ERNCGLKE-4JdU74o6.js → chunk-ERNCGLKE-D3HStkJC.js} +1 -1
  16. package/dist/bundle/{chunk-GBNNGOIB-DVUFOYzA.js → chunk-GBNNGOIB-DS3rusdH.js} +5 -5
  17. package/dist/bundle/{chunk-GJTANPFI-5L6Owk-H.js → chunk-GJTANPFI-DlUMnFUQ.js} +3 -3
  18. package/dist/bundle/{chunk-6ZUQA7OL-ofpF0AvH.js → chunk-GRGGW52W-Fkw6omOx.js} +5 -5
  19. package/dist/bundle/{chunk-KSUALCA7-DB6cYuSU.js → chunk-KSUALCA7-SMNQ85c6.js} +1 -1
  20. package/dist/bundle/{chunk-LBVI4Z2X-COUoJmWU.js → chunk-LBVI4Z2X-D9_8iC1S.js} +1 -1
  21. package/dist/bundle/{chunk-M23BPYSL-ChiHsEsy.js → chunk-M23BPYSL-ByTcRixP.js} +3 -3
  22. package/dist/bundle/{chunk-Z3ZVBBWR-whNBW-iH.js → chunk-M4KMNZN6-CBeUwDlF.js} +2 -2
  23. package/dist/bundle/{chunk-NG7F5L7N-BKCEXGxy.js → chunk-NG7F5L7N-Ch_ERSNz.js} +1 -1
  24. package/dist/bundle/{chunk-NX2VS2ER-DS6Urg3e.js → chunk-NX2VS2ER-CWN0zXqZ.js} +1 -1
  25. package/dist/bundle/{chunk-O2HOOK7X-Dboq6vxP.js → chunk-O2HOOK7X-Dyw_Dcql.js} +4 -4
  26. package/dist/bundle/{chunk-PSD6373C-wlicX185.js → chunk-PSD6373C-DgL0rhKe.js} +1 -1
  27. package/dist/bundle/{chunk-RTCT4N7Y-Dn-lP1zF.js → chunk-RTCT4N7Y-BEZ3cJ5d.js} +1 -1
  28. package/dist/bundle/{chunk-S34BE7ZC-p6NeYmqQ.js → chunk-S34BE7ZC-BO0yaVoX.js} +1 -1
  29. package/dist/bundle/{chunk-E6KETVFF-wOOXf4op.js → chunk-SRAGL5LI-CKhhwRrx.js} +5 -5
  30. package/dist/bundle/{chunk-T6V6LFHT-Dwv7XUuC.js → chunk-T6V6LFHT-BazTZ25Y.js} +1 -1
  31. package/dist/bundle/{chunk-ACWFPMZF-DkR70AOW.js → chunk-TFRAD7RO-BVAK9frq.js} +50 -4
  32. package/dist/bundle/{chunk-UH2H3OLE-R_6H5D7o.js → chunk-UH2H3OLE-QNxQo07O.js} +1 -1
  33. package/dist/bundle/{chunk-UQJGYQ56-CANeLx5l.js → chunk-UQJGYQ56-PoYTv6WX.js} +1 -1
  34. package/dist/bundle/{chunk-VKZDPPVI-d7RS_QOW.js → chunk-VKZDPPVI-BOmnhxVJ.js} +2 -2
  35. package/dist/bundle/{chunk-UNGNJ255-CtLEiDap.js → chunk-W3AAOYWE-Cyx1kZsd.js} +7 -7
  36. package/dist/bundle/{chunk-WXEJSLMO-DbSxVCq9.js → chunk-WXEJSLMO-DCjDRcYe.js} +8 -8
  37. package/dist/bundle/{chunk-XW3IHFDH-CjmXc8aI.js → chunk-XW3IHFDH-CA9Bby7o.js} +1 -1
  38. package/dist/bundle/{chunk-YHBBPJW6-jAof9asy.js → chunk-YHBBPJW6-DKIU2gC4.js} +2 -2
  39. package/dist/bundle/{chunk-YITG2CE5-Bg4SA8X1.js → chunk-YITG2CE5-o18mzaka.js} +1 -1
  40. package/dist/bundle/{chunk-ZMRSCVFX-Dwxb-Yg1.js → chunk-ZMRSCVFX-uhwzmZUP.js} +1 -1
  41. package/dist/bundle/chunks.json +83 -83
  42. package/dist/bundle/{command-contract-4X4JDKH7-BsU8tW9N.js → command-contract-DHFUF6RM-Bnc6nJSk.js} +2 -2
  43. package/dist/bundle/{command-server-entry-3JEJBUK5-CF-VyCRd.js → command-server-entry-UQSMAHYK-DzjTaTCZ.js} +2 -2
  44. package/dist/bundle/{decode-KVUA3TLF-Ds0C1R9U.js → decode-KVUA3TLF-BoJfgCpS.js} +2 -2
  45. package/dist/bundle/{dist-TPSNLFVO-D1tJd0aB.js → dist-TPSNLFVO-55jBf4N-.js} +2 -2
  46. package/dist/bundle/documents.js +5 -5
  47. package/dist/bundle/{echarts-6Q4CQ2DC-BvZMDYNl.js → echarts-6Q4CQ2DC-w9WhKUJu.js} +1 -1
  48. package/dist/bundle/{embed-JGGK2WKR-h5ppwooq.js → embed-JGGK2WKR-Cl3meWl4.js} +2 -2
  49. package/dist/bundle/{embedder-5SIVKVWO-D4yt4YCy.js → embedder-5SIVKVWO-DJEa9hBn.js} +2 -2
  50. package/dist/bundle/{first-run-FFHXPGFC-CyHZ4KM3.js → first-run-BT3X33BP-JikrW5_w.js} +2 -2
  51. package/dist/bundle/{first-screen-2NGQNWIN-BkvwnUdE.js → first-screen-KGQQK446-D2MchUuo.js} +2 -2
  52. package/dist/bundle/{hast-util-from-html-WLAUHN53-BfAYjYKc.js → hast-util-from-html-WLAUHN53-BOWgHBLv.js} +4 -4
  53. package/dist/bundle/{hast-util-to-html-PJC36XDP-C8DGIyzU.js → hast-util-to-html-PJC36XDP-QwbM5c4F.js} +5 -5
  54. package/dist/bundle/{hast-util-to-mdast-ZQ5OFYUM-9p6MJEBi.js → hast-util-to-mdast-ZQ5OFYUM-BidjUANu.js} +6 -6
  55. package/dist/bundle/{index-BOgkxLir.js → index-CTvUjqLX.js} +331 -345
  56. package/dist/bundle/index.js +66 -66
  57. package/dist/bundle/install-IPXFNLYZ-BGKW94IA.js +5 -0
  58. package/dist/bundle/{instructions-NHSD6EUE-BfefgySD.js → instructions-34FSWDC6-BR7mbjJH.js} +2 -2
  59. package/dist/bundle/mail.js +3 -3
  60. package/dist/bundle/{mcp-server-5FM4GA2C-CNWjKPAi.js → mcp-server-5FM4GA2C-B4Sqou0Z.js} +2 -2
  61. package/dist/bundle/mcp.js +12 -12
  62. package/dist/bundle/{mdast-util-from-markdown-Y7N3XA5A-ZkhTz5VO.js → mdast-util-from-markdown-Y7N3XA5A-CBCtetYX.js} +8 -8
  63. package/dist/bundle/{mdast-util-gfm-52PMOHWQ-gfhFQVZ5.js → mdast-util-gfm-52PMOHWQ-Bv-Hkixb.js} +12 -12
  64. package/dist/bundle/{mdast-util-to-hast-4MTEM3TB-Bomsq1EU.js → mdast-util-to-hast-4MTEM3TB-40gSN0gV.js} +6 -6
  65. package/dist/bundle/mdast-util-to-markdown-UGCOLDXA-DnYraMQX.js +12 -0
  66. package/dist/bundle/{meeting-combined-G3OVTNM6-CFHWFlT-.js → meeting-combined-G3OVTNM6-C4Jdctiy.js} +2 -2
  67. package/dist/bundle/{meeting-model-RINL42I5-Bab4crMQ.js → meeting-model-RINL42I5-BLAAT6mv.js} +2 -2
  68. package/dist/bundle/meeting-semantic-I7AZQTEI-DQ19wjn5.js +5 -0
  69. package/dist/bundle/{micromark-extension-gfm-FRHRNOIW-81l4O6kr.js → micromark-extension-gfm-FRHRNOIW-BvJCT_wq.js} +6 -6
  70. package/dist/bundle/{node-ZIYT5JOL-WfCpdwZ2.js → node-ZIYT5JOL-DoWqiI0I.js} +2 -2
  71. package/dist/bundle/{node-sqlite-VFGFD4MA-CrKdzJgw.js → node-sqlite-VFGFD4MA-QH9swjUN.js} +3 -3
  72. package/dist/bundle/notes-search-2Q3C65PA-D2HqYyaY.js +5 -0
  73. package/dist/bundle/oauth-TVUNW3GM-uN6u_RWy.js +7 -0
  74. package/dist/bundle/{open-36SZHLGF-kGan0BjP.js → open-36SZHLGF-CPBs6fdy.js} +1 -1
  75. package/dist/bundle/{openai-Z2WIZ6AC-D-aH-As-.js → openai-Z2WIZ6AC-CcEngcFj.js} +2 -2
  76. package/dist/bundle/preload.js +1 -1
  77. package/dist/bundle/{process-KJQOPRSP-C6W_P1_I.js → process-KJQOPRSP-BNqvUqBZ.js} +2 -2
  78. package/dist/bundle/{prompt-S2W33X57-BEDbCA8B.js → prompt-S2W33X57-BiF1939t.js} +2 -2
  79. package/dist/bundle/{recognize-NBWDLXLD-B2LTlDUy.js → recognize-NBWDLXLD-BCqQ8iG1.js} +2 -2
  80. package/dist/bundle/{remote-O54ANXYL-DOEubnhV.js → remote-O54ANXYL-BixLG9XM.js} +2 -2
  81. package/dist/bundle/{rerank-HTCSXPM6-CVIU4cUa.js → rerank-HTCSXPM6-FGYUs2VW.js} +2 -2
  82. package/dist/bundle/serve-7KRXCBBZ-EVSG16Mc.js +8 -0
  83. package/dist/bundle/server-BFD6QUV7-OmgCCeuX.js +11 -0
  84. package/dist/bundle/server-G7VWUBA2-C3Gq_HlM.js +12 -0
  85. package/dist/bundle/{sqlite-runtime-KC3NKKRB-DYslMC-g.js → sqlite-runtime-KC3NKKRB-y_O8PNsQ.js} +1 -1
  86. package/dist/bundle/{start-Dtq56YXe.js → start-CqQGB7xI.js} +5 -5
  87. package/dist/bundle/start.js +1 -1
  88. package/dist/bundle/state-3CFS2SAC-CYYQ103I.js +5 -0
  89. package/dist/bundle/store-BSVRVKTV-Uot4OGm0.js +5 -0
  90. package/dist/bundle/{store-6CM2A3HP-CtnMVUVK.js → store-LGAEGNFF-BzNIKnoK.js} +2 -2
  91. package/dist/bundle/{store-maintenance-command-WYO5PN4V-B0wefBHZ.js → store-maintenance-command-Z27R7URJ-CoJCYGVq.js} +2 -2
  92. package/dist/bundle/surface-ZEEHYD5Q-DRIV3XG3.js +8 -0
  93. package/dist/bundle/testing.js +8 -8
  94. package/dist/cli/app-doctor-command.d.ts +187 -1
  95. package/dist/cli/app-doctor-command.d.ts.map +1 -1
  96. package/dist/cli/app-doctor-command.js +3 -2
  97. package/dist/cli/app-doctor-command.js.map +1 -1
  98. package/dist/cli/app-mcp-command.d.ts +187 -2
  99. package/dist/cli/app-mcp-command.d.ts.map +1 -1
  100. package/dist/cli/app-mcp-command.js +3 -2
  101. package/dist/cli/app-mcp-command.js.map +1 -1
  102. package/dist/cli/built-commands.d.ts +10 -0
  103. package/dist/cli/built-commands.d.ts.map +1 -0
  104. package/dist/cli/built-commands.js +33 -0
  105. package/dist/cli/built-commands.js.map +1 -0
  106. package/dist/cli/commands-command.d.ts.map +1 -1
  107. package/dist/cli/commands-command.js +3 -2
  108. package/dist/cli/commands-command.js.map +1 -1
  109. package/dist/cli/complete-command.d.ts +187 -2
  110. package/dist/cli/complete-command.d.ts.map +1 -1
  111. package/dist/cli/complete-command.js +3 -2
  112. package/dist/cli/complete-command.js.map +1 -1
  113. package/dist/cli/config-command.d.ts +189 -3
  114. package/dist/cli/config-command.d.ts.map +1 -1
  115. package/dist/cli/config-command.js +3 -2
  116. package/dist/cli/config-command.js.map +1 -1
  117. package/dist/cli/context.d.ts +8 -0
  118. package/dist/cli/context.d.ts.map +1 -1
  119. package/dist/cli/context.js +39 -2
  120. package/dist/cli/context.js.map +1 -1
  121. package/dist/cli/documents/words.d.ts +1 -1
  122. package/dist/cli/dry-run-guard.d.ts.map +1 -1
  123. package/dist/cli/dry-run-guard.js +6 -28
  124. package/dist/cli/dry-run-guard.js.map +1 -1
  125. package/dist/cli/first-run.js +1 -1
  126. package/dist/cli/first-run.js.map +1 -1
  127. package/dist/cli/guide.d.ts.map +1 -1
  128. package/dist/cli/guide.js +3 -2
  129. package/dist/cli/guide.js.map +1 -1
  130. package/dist/cli/messenger/archive-commands.d.ts.map +1 -1
  131. package/dist/cli/messenger/archive-commands.js +3 -2
  132. package/dist/cli/messenger/archive-commands.js.map +1 -1
  133. package/dist/cli/messenger/complete-command.d.ts +187 -2
  134. package/dist/cli/messenger/complete-command.d.ts.map +1 -1
  135. package/dist/cli/messenger/complete-command.js +3 -2
  136. package/dist/cli/messenger/complete-command.js.map +1 -1
  137. package/dist/cli/messenger/doctor-command.d.ts.map +1 -1
  138. package/dist/cli/messenger/doctor-command.js +3 -2
  139. package/dist/cli/messenger/doctor-command.js.map +1 -1
  140. package/dist/cli/messenger/flood-command.d.ts.map +1 -1
  141. package/dist/cli/messenger/flood-command.js +3 -2
  142. package/dist/cli/messenger/flood-command.js.map +1 -1
  143. package/dist/cli/messenger/mcp-command.d.ts.map +1 -1
  144. package/dist/cli/messenger/mcp-command.js +3 -2
  145. package/dist/cli/messenger/mcp-command.js.map +1 -1
  146. package/dist/cli/messenger/metadata-command.d.ts.map +1 -1
  147. package/dist/cli/messenger/metadata-command.js +3 -2
  148. package/dist/cli/messenger/metadata-command.js.map +1 -1
  149. package/dist/cli/messenger/models-command.d.ts.map +1 -1
  150. package/dist/cli/messenger/models-command.js +3 -2
  151. package/dist/cli/messenger/models-command.js.map +1 -1
  152. package/dist/cli/messenger/server-command.d.ts +1 -1
  153. package/dist/cli/messenger/server-command.d.ts.map +1 -1
  154. package/dist/cli/messenger/server-command.js +3 -2
  155. package/dist/cli/messenger/server-command.js.map +1 -1
  156. package/dist/cli/messenger/session-commands.d.ts.map +1 -1
  157. package/dist/cli/messenger/session-commands.js +3 -2
  158. package/dist/cli/messenger/session-commands.js.map +1 -1
  159. package/dist/cli/messenger/store-maintenance-command.d.ts.map +1 -1
  160. package/dist/cli/messenger/store-maintenance-command.js +11 -5
  161. package/dist/cli/messenger/store-maintenance-command.js.map +1 -1
  162. package/dist/cli/model-catalogue-command.d.ts.map +1 -1
  163. package/dist/cli/model-catalogue-command.js +3 -2
  164. package/dist/cli/model-catalogue-command.js.map +1 -1
  165. package/dist/cli/oauth-session.d.ts.map +1 -1
  166. package/dist/cli/oauth-session.js +3 -2
  167. package/dist/cli/oauth-session.js.map +1 -1
  168. package/dist/cli/runs/command.d.ts.map +1 -1
  169. package/dist/cli/runs/command.js +3 -2
  170. package/dist/cli/runs/command.js.map +1 -1
  171. package/dist/cli/schedule/schedule-command.d.ts +1 -1
  172. package/dist/cli/schedule/schedule-command.d.ts.map +1 -1
  173. package/dist/cli/schedule/schedule-command.js +5 -3
  174. package/dist/cli/schedule/schedule-command.js.map +1 -1
  175. package/dist/cli/setup-command.d.ts.map +1 -1
  176. package/dist/cli/setup-command.js +3 -2
  177. package/dist/cli/setup-command.js.map +1 -1
  178. package/dist/cli/skill-command.d.ts.map +1 -1
  179. package/dist/cli/skill-command.js +3 -2
  180. package/dist/cli/skill-command.js.map +1 -1
  181. package/dist/cli/store-info.d.ts.map +1 -1
  182. package/dist/cli/store-info.js +5 -4
  183. package/dist/cli/store-info.js.map +1 -1
  184. package/dist/cli/token-session.d.ts.map +1 -1
  185. package/dist/cli/token-session.js +2 -1
  186. package/dist/cli/token-session.js.map +1 -1
  187. package/dist/cli/upgrade-command.d.ts.map +1 -1
  188. package/dist/cli/upgrade-command.js +4 -5
  189. package/dist/cli/upgrade-command.js.map +1 -1
  190. package/dist/cli/upkeep.d.ts +8 -0
  191. package/dist/cli/upkeep.d.ts.map +1 -0
  192. package/dist/cli/upkeep.js +11 -0
  193. package/dist/cli/upkeep.js.map +1 -0
  194. package/dist/entities/attachment.d.ts +0 -8
  195. package/dist/entities/attachment.d.ts.map +1 -1
  196. package/dist/entities/attachment.js +22 -20
  197. package/dist/entities/attachment.js.map +1 -1
  198. package/dist/entities/chat.d.ts +0 -4
  199. package/dist/entities/chat.d.ts.map +1 -1
  200. package/dist/entities/chat.js +6 -10
  201. package/dist/entities/chat.js.map +1 -1
  202. package/dist/entities/contact.d.ts +0 -7
  203. package/dist/entities/contact.d.ts.map +1 -1
  204. package/dist/entities/contact.js +9 -16
  205. package/dist/entities/contact.js.map +1 -1
  206. package/dist/entities/deal.d.ts +0 -36
  207. package/dist/entities/deal.d.ts.map +1 -1
  208. package/dist/entities/deal.js +22 -48
  209. package/dist/entities/deal.js.map +1 -1
  210. package/dist/entities/document.d.ts +0 -2
  211. package/dist/entities/document.d.ts.map +1 -1
  212. package/dist/entities/document.js +3 -5
  213. package/dist/entities/document.js.map +1 -1
  214. package/dist/entities/fields.d.ts +5 -1
  215. package/dist/entities/fields.d.ts.map +1 -1
  216. package/dist/entities/fields.js +6 -2
  217. package/dist/entities/fields.js.map +1 -1
  218. package/dist/entities/hit.d.ts +0 -18
  219. package/dist/entities/hit.d.ts.map +1 -1
  220. package/dist/entities/hit.js +19 -37
  221. package/dist/entities/hit.js.map +1 -1
  222. package/dist/entities/index.d.ts +0 -1
  223. package/dist/entities/index.d.ts.map +1 -1
  224. package/dist/entities/index.js +2 -3
  225. package/dist/entities/index.js.map +1 -1
  226. package/dist/entities/message.d.ts +2 -34
  227. package/dist/entities/message.d.ts.map +1 -1
  228. package/dist/entities/message.js +35 -67
  229. package/dist/entities/message.js.map +1 -1
  230. package/dist/entities/task.d.ts +0 -19
  231. package/dist/entities/task.d.ts.map +1 -1
  232. package/dist/entities/task.js +18 -35
  233. package/dist/entities/task.js.map +1 -1
  234. package/dist/mcp/agent.d.ts +3 -0
  235. package/dist/mcp/agent.d.ts.map +1 -1
  236. package/dist/mcp/agent.js +48 -1
  237. package/dist/mcp/agent.js.map +1 -1
  238. package/dist/mcp/app-server.d.ts.map +1 -1
  239. package/dist/mcp/app-server.js +8 -5
  240. package/dist/mcp/app-server.js.map +1 -1
  241. package/dist/mcp/bot/instructions.js +1 -1
  242. package/dist/mcp/bot/instructions.js.map +1 -1
  243. package/dist/mcp/index.d.ts +4 -0
  244. package/dist/mcp/index.d.ts.map +1 -1
  245. package/dist/mcp/index.js +4 -0
  246. package/dist/mcp/index.js.map +1 -1
  247. package/dist/mcp/instructions.js +4 -4
  248. package/dist/mcp/instructions.js.map +1 -1
  249. package/dist/mcp/lean.d.ts +9 -0
  250. package/dist/mcp/lean.d.ts.map +1 -0
  251. package/dist/mcp/lean.js +7 -0
  252. package/dist/mcp/lean.js.map +1 -0
  253. package/dist/mcp/server.d.ts.map +1 -1
  254. package/dist/mcp/server.js +6 -2
  255. package/dist/mcp/server.js.map +1 -1
  256. package/dist/mcp/surface.d.ts +51 -2
  257. package/dist/mcp/surface.d.ts.map +1 -1
  258. package/dist/mcp/surface.js +379 -52
  259. package/dist/mcp/surface.js.map +1 -1
  260. package/dist/mcp/tool.d.ts +9 -1
  261. package/dist/mcp/tool.d.ts.map +1 -1
  262. package/dist/mcp/tool.js +20 -6
  263. package/dist/mcp/tool.js.map +1 -1
  264. package/dist/output-detail.d.ts +8 -0
  265. package/dist/output-detail.d.ts.map +1 -1
  266. package/dist/output-detail.js +55 -0
  267. package/dist/output-detail.js.map +1 -1
  268. package/dist/services/package-upgrade.d.ts.map +1 -1
  269. package/dist/services/package-upgrade.js +3 -1
  270. package/dist/services/package-upgrade.js.map +1 -1
  271. package/dist/store/compatibility.d.ts +2 -0
  272. package/dist/store/compatibility.d.ts.map +1 -1
  273. package/dist/store/compatibility.js +12 -0
  274. package/dist/store/compatibility.js.map +1 -1
  275. package/dist/store/migrations.d.ts +3 -3
  276. package/dist/store/migrations.js +3 -3
  277. package/dist/store/sqlite/clients.d.ts +6 -0
  278. package/dist/store/sqlite/clients.d.ts.map +1 -1
  279. package/dist/store/sqlite/clients.js +6 -4
  280. package/dist/store/sqlite/clients.js.map +1 -1
  281. package/dist/store/sqlite/manifest.d.ts +4 -0
  282. package/dist/store/sqlite/manifest.d.ts.map +1 -1
  283. package/dist/store/sqlite/manifest.js.map +1 -1
  284. package/package.json +1 -1
  285. package/skills/link-conversations/SKILL.md +1 -1
  286. package/src/cli/app-doctor-command.ts +41 -42
  287. package/src/cli/app-mcp-command.ts +55 -52
  288. package/src/cli/built-commands.ts +32 -0
  289. package/src/cli/commands-command.ts +3 -2
  290. package/src/cli/complete-command.ts +53 -48
  291. package/src/cli/config-command.ts +180 -177
  292. package/src/cli/context.ts +44 -2
  293. package/src/cli/dry-run-guard.ts +11 -23
  294. package/src/cli/first-run.ts +1 -1
  295. package/src/cli/guide.ts +3 -2
  296. package/src/cli/messenger/archive-commands.ts +3 -2
  297. package/src/cli/messenger/complete-command.ts +30 -30
  298. package/src/cli/messenger/doctor-command.ts +3 -2
  299. package/src/cli/messenger/flood-command.ts +3 -2
  300. package/src/cli/messenger/mcp-command.ts +3 -2
  301. package/src/cli/messenger/metadata-command.ts +3 -2
  302. package/src/cli/messenger/models-command.ts +3 -2
  303. package/src/cli/messenger/server-command.ts +3 -2
  304. package/src/cli/messenger/session-commands.ts +3 -2
  305. package/src/cli/messenger/store-maintenance-command.ts +18 -12
  306. package/src/cli/model-catalogue-command.ts +3 -2
  307. package/src/cli/oauth-session.ts +3 -2
  308. package/src/cli/runs/command.ts +3 -2
  309. package/src/cli/schedule/schedule-command.ts +412 -410
  310. package/src/cli/setup-command.ts +3 -2
  311. package/src/cli/skill-command.ts +3 -2
  312. package/src/cli/store-info.ts +21 -16
  313. package/src/cli/token-session.ts +3 -2
  314. package/src/cli/upgrade-command.ts +59 -62
  315. package/src/cli/upkeep.ts +15 -0
  316. package/src/entities/attachment.ts +44 -30
  317. package/src/entities/chat.ts +9 -10
  318. package/src/entities/contact.ts +20 -21
  319. package/src/entities/deal.ts +66 -53
  320. package/src/entities/document.ts +3 -5
  321. package/src/entities/fields.ts +11 -2
  322. package/src/entities/hit.ts +52 -37
  323. package/src/entities/index.ts +2 -3
  324. package/src/entities/message.ts +101 -80
  325. package/src/entities/task.ts +37 -38
  326. package/src/mcp/agent.ts +51 -1
  327. package/src/mcp/app-server.ts +8 -5
  328. package/src/mcp/bot/instructions.ts +1 -1
  329. package/src/mcp/index.ts +4 -0
  330. package/src/mcp/instructions.ts +4 -4
  331. package/src/mcp/lean.ts +8 -0
  332. package/src/mcp/server.ts +6 -2
  333. package/src/mcp/surface.ts +436 -64
  334. package/src/mcp/tool.ts +27 -4
  335. package/src/output-detail.ts +61 -0
  336. package/src/services/package-upgrade.ts +3 -1
  337. package/src/store/compatibility.ts +12 -0
  338. package/src/store/migrations.ts +3 -3
  339. package/src/store/sqlite/clients.ts +17 -6
  340. package/src/store/sqlite/manifest.ts +4 -0
  341. package/dist/bundle/install-IPXFNLYZ-BSWiztYR.js +0 -5
  342. package/dist/bundle/mdast-util-to-markdown-UGCOLDXA-7D6EJn9r.js +0 -12
  343. package/dist/bundle/meeting-semantic-I7AZQTEI-BgZ3ZzQB.js +0 -5
  344. package/dist/bundle/notes-search-2Q3C65PA-CWKHboCy.js +0 -5
  345. package/dist/bundle/oauth-TVUNW3GM-BqlyhUfp.js +0 -7
  346. package/dist/bundle/serve-7KRXCBBZ-BO9BKhWL.js +0 -8
  347. package/dist/bundle/server-PIT6UZRZ-C6I-VrDd.js +0 -11
  348. package/dist/bundle/server-ZL4FMEHH-DP1oYgCn.js +0 -12
  349. package/dist/bundle/state-3CFS2SAC-xptBCfut.js +0 -5
  350. package/dist/bundle/store-ASWYHJ4Q-C7EFfvzB.js +0 -5
  351. package/dist/bundle/surface-DDH4HGT3-CBZnEqH_.js +0 -8
@@ -28,6 +28,7 @@ import { bufferedInput } from "./input-policy.js"
28
28
  import { rememberAccount } from "./messenger/accounts.js"
29
29
  import { ProfileTokenStore } from "./profile-token.js"
30
30
  import { fromFile, NONE_NAMED } from "./settings.js"
31
+ import { upkeepCommand } from "./upkeep.js"
31
32
 
32
33
  type Answers = Record<string, unknown>
33
34
 
@@ -52,7 +53,7 @@ const settingJsonSchema = (schema: v.GenericSchema): Record<string, unknown> =>
52
53
  }
53
54
 
54
55
  /** The setup group a CLI gets by describing its flow: `show`, `apply`, `run` and the terminal walk-through. */
55
- export const setupCommand = (setup: Setup): Command => {
56
+ export const setupCommand = upkeepCommand((setup: Setup): Command => {
56
57
  const { app, configuration, check, ownerOnly = {} } = setup.definition
57
58
  const cli = app.command
58
59
  const { document } = setup
@@ -490,4 +491,4 @@ export const setupCommand = (setup: Setup): Command => {
490
491
  }
491
492
 
492
493
  return group
493
- }
494
+ })
@@ -5,6 +5,7 @@ import type { AppIdentity } from "../ports/app.js"
5
5
  import { environmentOf, outputFor } from "./context.js"
6
6
  import { grantsAuthority } from "./effects.js"
7
7
  import { printItem } from "./envelope.js"
8
+ import { upkeepCommand } from "./upkeep.js"
8
9
 
9
10
  const skillSources = new WeakMap<Command, URL>()
10
11
  // zm and memo mount their own `skill` command in place of this one (`customizeSharedCommand`), from the same file.
@@ -20,7 +21,7 @@ export const skillSourceOf = (program: Command, appName: string): URL | undefine
20
21
  * `skill show` and `skill install`. `skill` is the CLI's own SKILL.md, shipped beside `dist/` in the
21
22
  * package and in a checkout alike, so the skill printed is always this version's.
22
23
  */
23
- export const skillCommand = (app: AppIdentity, skill: URL): Command => {
24
+ export const skillCommand = upkeepCommand((app: AppIdentity, skill: URL): Command => {
24
25
  const command = sharedSkillCommand(
25
26
  app,
26
27
  skill,
@@ -50,7 +51,7 @@ export const skillCommand = (app: AppIdentity, skill: URL): Command => {
50
51
  ],
51
52
  })
52
53
  return command
53
- }
54
+ })
54
55
 
55
56
  /**
56
57
  * Skills this package ships for the messenger CLIs, printed by `skill show <name>`: `skills/` beside `dist/` and `src/`.
@@ -20,6 +20,7 @@ import { environmentOf, outputFor } from "./context.js"
20
20
  import { LOCAL_READ } from "./effects.js"
21
21
  import { itemOf, renderAnswer, snakeKeys } from "./envelope.js"
22
22
  import { storeRecoverCommand } from "./store-recover.js"
23
+ import { upkeepCommand } from "./upkeep.js"
23
24
 
24
25
  /** @experimental */
25
26
  export type StoreInfo = v.InferOutput<typeof storeInfoEntity>
@@ -81,21 +82,25 @@ export const storeInfo = async (env: NodeJS.ProcessEnv): Promise<StoreInfo> => {
81
82
  }
82
83
 
83
84
  /** @experimental */
84
- export const storeInfoCommand = (): Command =>
85
- annotate(new Command("info"), { output: { entity: "store_info" }, effects: LOCAL_READ })
86
- .summary("the shared store's format, size and contents, and whether this tool can read it")
87
- .description(
88
- "the store file: where it is, its size, its schema against the one this tool speaks, which tools used it and how many rows it holds, by provider, chat kind, account, year (UTC) and attachment kind, over every account; changes nothing",
89
- )
90
- .action(async function (this: Command) {
91
- const answer = await storeInfo(environmentOf(this).env ?? process.env)
92
- renderAnswer(this, outputFor(this), itemOf(answer))
93
- })
85
+ export const storeInfoCommand = upkeepCommand(
86
+ (): Command =>
87
+ annotate(new Command("info"), { output: { entity: "store_info" }, effects: LOCAL_READ })
88
+ .summary("the shared store's format, size and contents, and whether this tool can read it")
89
+ .description(
90
+ "the store file: where it is, its size, its schema against the one this tool speaks, which tools used it and how many rows it holds, by provider, chat kind, account, year (UTC) and attachment kind, over every account; changes nothing",
91
+ )
92
+ .action(async function (this: Command) {
93
+ const answer = await storeInfo(environmentOf(this).env ?? process.env)
94
+ renderAnswer(this, outputFor(this), itemOf(answer))
95
+ }),
96
+ )
94
97
 
95
98
  /** `store info` for a tool with no `store` command of its own. */
96
- export const sharedStoreCommand = (app?: { command: string; version?: string }): Command => {
97
- const store = annotate(new Command("store"), { effects: LOCAL_READ })
98
- .description("the shared local store every WireCat tool reads")
99
- .addCommand(storeInfoCommand())
100
- return app ? store.addCommand(storeRecoverCommand(app)) : store
101
- }
99
+ export const sharedStoreCommand: (app?: { command: string; version?: string }) => Command = upkeepCommand(
100
+ (app?: { command: string; version?: string }): Command => {
101
+ const store = annotate(new Command("store"), { effects: LOCAL_READ })
102
+ .description("the shared local store every WireCat tool reads")
103
+ .addCommand(storeInfoCommand())
104
+ return app ? store.addCommand(storeRecoverCommand(app)) : store
105
+ },
106
+ )
@@ -21,6 +21,7 @@ import { serviceApiCall } from "./service-api-call.js"
21
21
  import { type ServiceApiManifest, siteValue } from "./service-api-manifest.js"
22
22
  import type { GlobalFlags, ResolveOptions, Settings } from "./settings.js"
23
23
  import { sharedCommand } from "./shared-contracts.js"
24
+ import { upkeepCommand } from "./upkeep.js"
24
25
 
25
26
  export interface TokenSessionOptions {
26
27
  app: AppIdentity
@@ -347,8 +348,8 @@ const tokenSessionCommandDefinition = (options: TokenSessionOptions): Command =>
347
348
  }
348
349
 
349
350
  /** cli-core's own command (WC-CMD-34): a CLI changes it only through its options. */
350
- export const tokenSessionCommand: (options: TokenSessionOptions) => Command = honoursDryRun(
351
- sharedCommand(tokenSessionCommandDefinition),
351
+ export const tokenSessionCommand: (options: TokenSessionOptions) => Command = upkeepCommand(
352
+ honoursDryRun(sharedCommand(tokenSessionCommandDefinition)),
352
353
  )
353
354
 
354
355
  const SITE = "site"
@@ -22,6 +22,7 @@ import { type BaseEnvironment, environmentOf } from "./context.js"
22
22
  import { grantsAuthority, LOCAL_WRITE } from "./effects.js"
23
23
  import { itemOf, renderAnswer, snakeKeys } from "./envelope.js"
24
24
  import { usableProfileName } from "./profile.js"
25
+ import { upkeepCommand } from "./upkeep.js"
25
26
 
26
27
  export interface UpgradeContext extends Omit<PackageUpgradePorts, "onInstall"> {
27
28
  renderer: Renderer
@@ -94,70 +95,66 @@ const mcpWarnings = (command: string, current: string, servers: readonly McpServ
94
95
  : []),
95
96
  ]
96
97
 
97
- export const upgradeCommand = (
98
- app: AppIdentity,
99
- packageName: string,
100
- contextFor: (command: Command) => UpgradeContext,
101
- ): Command =>
102
- grantsAuthority(
103
- annotate(new Command("upgrade"), {
104
- effects: LOCAL_WRITE,
105
- offline: false,
106
- examples: [`${app.command} upgrade --check`],
107
- }),
108
- { unless: "check" },
109
- )
110
- .description(`upgrade ${app.command} with the package manager that installed it; --check only looks`)
111
- .option("--check", "say whether a newer version exists, and install nothing")
112
- .action(async function (this: Command, { check }: { check?: boolean }) {
113
- if (this.optsWithGlobals<{ offline?: boolean }>().offline)
114
- throw new CliError(
115
- "validation_error",
116
- `\`${app.command} upgrade\` asks npm for the newest version; not with --offline`,
117
- )
118
- const context = contextFor(this)
119
- const { renderer } = context
120
- const environment = environmentOf<BaseEnvironment & { afterUpgrade?: Partial<AfterUpgradeSystem> }>(this)
121
- const env = environment.env ?? process.env
122
- // Built before the install: after it, the old process may no longer find its own lazily loaded files.
123
- const system = { ...thisSystem(packageName, app.command), ...environment.afterUpgrade }
124
- const afterUpdate = async (): Promise<ServerRestarts> => {
125
- const servers = (await context.afterUpdate?.()) ?? { restarted: [], left: [] }
126
- return {
127
- ...servers,
128
- mcpServers: await restartMcpServers(app, env, system),
129
- staleSessions: staleMcpSessions(system),
98
+ export const upgradeCommand = upkeepCommand(
99
+ (app: AppIdentity, packageName: string, contextFor: (command: Command) => UpgradeContext): Command =>
100
+ grantsAuthority(
101
+ annotate(new Command("upgrade"), {
102
+ effects: LOCAL_WRITE,
103
+ offline: false,
104
+ examples: [`${app.command} upgrade --check`],
105
+ }),
106
+ { unless: "check" },
107
+ )
108
+ .description(`upgrade ${app.command} with the package manager that installed it; --check only looks`)
109
+ .option("--check", "say whether a newer version exists, and install nothing")
110
+ .action(async function (this: Command, { check }: { check?: boolean }) {
111
+ if (this.optsWithGlobals<{ offline?: boolean }>().offline)
112
+ throw new CliError(
113
+ "validation_error",
114
+ `\`${app.command} upgrade\` asks npm for the newest version; not with --offline`,
115
+ )
116
+ const context = contextFor(this)
117
+ const { renderer } = context
118
+ const environment = environmentOf<BaseEnvironment & { afterUpgrade?: Partial<AfterUpgradeSystem> }>(this)
119
+ const env = environment.env ?? process.env
120
+ // Built before the install: after it, the old process may no longer find its own lazily loaded files.
121
+ const system = { ...thisSystem(packageName, app.command), ...environment.afterUpgrade }
122
+ const afterUpdate = async (): Promise<ServerRestarts> => {
123
+ const servers = (await context.afterUpdate?.()) ?? { restarted: [], left: [] }
124
+ return {
125
+ ...servers,
126
+ mcpServers: await restartMcpServers(app, env, system),
127
+ staleSessions: staleMcpSessions(system),
128
+ }
130
129
  }
131
- }
132
- const { result, reason, left, timedOut } = await upgradePackage(
133
- { current: app.version, command: app.command, packageName, check: check === true },
134
- { ...context, afterUpdate, onInstall: (argv) => renderer.note(`running: ${argv.join(" ")}`) },
135
- )
136
- if (reason === "held_back" && result.heldBack) renderer.warn(heldBackAdvice(result, result.heldBack))
137
- if (reason === "unavailable") renderer.warn("npm did not answer, so nothing was run")
138
- else if (reason === "up_to_date") renderer.note(`${app.command} ${app.version} is the newest`)
139
- else if (reason === "manual") {
140
- const advice =
141
- result.installer === "checkout"
142
- ? "this is a checkout: `git pull && pnpm install && pnpm build`"
143
- : result.installer === "npx"
144
- ? `npx runs whatever version it is asked for: \`npx ${packageName}@latest\``
145
- : `cannot tell how ${app.command} was installed, so nothing was run`
146
- renderer.warn(advice)
147
- }
148
- for (const profile of left) {
149
- renderer.warn(
150
- timedOut?.includes(profile)
151
- ? `the server for profile ${profile} did not restart in time and may still run ${app.command} ${app.version} — ` +
152
- `\`${app.command} ${profile} server status\``
153
- : `the server for profile ${profile} still runs ${app.command} ${app.version} — ` +
154
- `\`${app.command} ${profile} server restart\``,
130
+ const { result, reason, left, timedOut } = await upgradePackage(
131
+ { current: app.version, command: app.command, packageName, check: check === true },
132
+ { ...context, afterUpdate, onInstall: (argv) => renderer.note(`running: ${argv.join(" ")}`) },
155
133
  )
156
- }
157
- for (const line of mcpWarnings(app.command, app.version, result.mcpServers ?? [], result.staleSessions))
158
- renderer.warn(line)
159
- renderAnswer(this, context, itemOf(snakeKeys(result)), () => summary(app.command, result))
160
- })
134
+ if (reason === "held_back" && result.heldBack) renderer.warn(heldBackAdvice(result, result.heldBack))
135
+ if (reason === "unavailable") renderer.warn("npm did not answer, so nothing was run")
136
+ else if (reason === "up_to_date") renderer.note(`${app.command} ${app.version} is the newest`)
137
+ else if (reason === "manual") {
138
+ const advice =
139
+ result.installer === "checkout"
140
+ ? "this is a checkout: `git pull && pnpm install && pnpm build`"
141
+ : `npx runs whatever version it is asked for: \`npx ${packageName}@latest\``
142
+ renderer.warn(advice)
143
+ }
144
+ for (const profile of left) {
145
+ renderer.warn(
146
+ timedOut?.includes(profile)
147
+ ? `the server for profile ${profile} did not restart in time and may still run ${app.command} ${app.version} — ` +
148
+ `\`${app.command} ${profile} server status\``
149
+ : `the server for profile ${profile} still runs ${app.command} ${app.version} — ` +
150
+ `\`${app.command} ${profile} server restart\``,
151
+ )
152
+ }
153
+ for (const line of mcpWarnings(app.command, app.version, result.mcpServers ?? [], result.staleSessions))
154
+ renderer.warn(line)
155
+ renderAnswer(this, context, itemOf(snakeKeys(result)), () => summary(app.command, result))
156
+ }),
157
+ )
161
158
 
162
159
  const heldBackAdvice = (
163
160
  { installed, latest, installer }: PackageUpgradeResult,
@@ -0,0 +1,15 @@
1
+ import type { Command } from "commander"
2
+ import { onBuilt } from "./built-commands.js"
3
+
4
+ const marked = new WeakSet<Command>()
5
+
6
+ /**
7
+ * Marks what a factory builds as upkeep: cli-core's commands that run the CLI itself (config, sign-in, the store,
8
+ * MCP), not the service. Only those built by the factory: a CLI's own command added later under one stays its own.
9
+ */
10
+ export const upkeepCommand = <A extends unknown[], R>(factory: (...args: A) => R) =>
11
+ onBuilt(factory, (command) => {
12
+ marked.add(command)
13
+ })
14
+
15
+ export const isUpkeep = (command: Command | undefined): boolean => command !== undefined && marked.has(command)
@@ -1,13 +1,13 @@
1
1
  import * as v from "valibot"
2
- import { count, id, reference, text } from "./fields.js"
2
+ import { about, count, id, reference, text } from "./fields.js"
3
3
 
4
4
  export const attachment = v.strictObject({
5
- /** The message it came with, as a locator; absent inside that message. */
6
- message: v.optional(reference),
7
- /** Lower-cased: `photo`, `video`, `file`, `voice`… */
8
- kind: text,
9
- /** Its place among the message's attachments, from 1, as `attachments show --attachment` takes it. */
10
- position: v.optional(count),
5
+ message: about(v.optional(reference), "The message it came with, as a locator; absent inside that message."),
6
+ kind: about(text, "Lower-cased: `photo`, `video`, `file`, `voice`…"),
7
+ position: about(
8
+ v.optional(count),
9
+ "Its place among the message's attachments, from 1, as `attachments show --attachment` takes it.",
10
+ ),
11
11
  url: v.optional(text),
12
12
  name: v.optional(text),
13
13
  title: v.optional(text),
@@ -15,33 +15,45 @@ export const attachment = v.strictObject({
15
15
  size: v.optional(count),
16
16
  width: v.optional(count),
17
17
  height: v.optional(count),
18
- /** Seconds, for audio and video. */
19
- duration: v.optional(v.number()),
20
- /** The text read out of it; how it was read is `extraction`. */
21
- text: v.optional(text),
18
+ duration: about(v.optional(v.number()), "Seconds, for audio and video."),
19
+ text: about(v.optional(text), "The text read out of it; how it was read is `extraction`."),
22
20
  extraction: v.optional(v.strictObject({ origin: text, extractor: text, chars: count, error: v.optional(text) })),
23
21
  local_path: v.optional(text),
24
- /** A shared contact card (`kind: "contact"`); the phone is the whole number as the sender put it. */
25
- contact: v.optional(
26
- v.strictObject({
27
- name: text,
28
- first_name: v.optional(text),
29
- last_name: v.optional(text),
30
- phone: v.optional(text),
31
- user_id: v.optional(id),
32
- }),
22
+ contact: about(
23
+ v.optional(
24
+ v.strictObject({
25
+ name: text,
26
+ first_name: v.optional(text),
27
+ last_name: v.optional(text),
28
+ phone: v.optional(text),
29
+ user_id: v.optional(id),
30
+ }),
31
+ ),
32
+ 'A shared contact card (`kind: "contact"`); the phone is the whole number as the sender put it.',
33
33
  ),
34
- /** A bot's keyboard under the message, row by row; `messages press` presses one. */
35
- buttons: v.optional(
36
- v.array(
34
+ buttons: about(
35
+ v.optional(
37
36
  v.array(
38
- v.strictObject({
39
- kind: v.picklist(["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"]),
40
- text,
41
- url: v.optional(text),
42
- }),
37
+ v.array(
38
+ v.strictObject({
39
+ kind: v.picklist([
40
+ "callback",
41
+ "link",
42
+ "message",
43
+ "chat",
44
+ "contact",
45
+ "location",
46
+ "app",
47
+ "clipboard",
48
+ "other",
49
+ ]),
50
+ text,
51
+ url: v.optional(text),
52
+ }),
53
+ ),
43
54
  ),
44
55
  ),
56
+ "A bot's keyboard under the message, row by row; `messages press` presses one.",
45
57
  ),
46
58
  })
47
59
 
@@ -51,6 +63,8 @@ export const hitFile = v.strictObject({
51
63
  kind: text,
52
64
  name: v.optional(text),
53
65
  size: v.optional(count),
54
- /** The saved copy on this computer, once `messages download` fetched it; absent until then. */
55
- local_path: v.optional(text),
66
+ local_path: about(
67
+ v.optional(text),
68
+ "The saved copy on this computer, once `messages download` fetched it; absent until then.",
69
+ ),
56
70
  })
@@ -1,11 +1,11 @@
1
1
  import * as v from "valibot"
2
- import { count, id, providerMetadata, reference, text, time } from "./fields.js"
2
+ import { about, count, id, providerMetadata, reference, text, time } from "./fields.js"
3
3
  import { member } from "./member.js"
4
4
 
5
5
  const setting = v.optional(v.nullable(v.boolean()))
6
6
 
7
7
  export const chat = v.strictObject({
8
- ref: reference,
8
+ ref: about(reference, "The chat's locator, `chat:<provider>/<account>/<chat>`."),
9
9
  id,
10
10
  provider: v.optional(text),
11
11
  account: v.optional(text),
@@ -16,17 +16,14 @@ export const chat = v.strictObject({
16
16
  last_message_at: v.nullable(time),
17
17
  participants_count: v.nullable(count),
18
18
  muted: v.optional(v.boolean()),
19
- /** When the mute ends; absent with `muted` true is for good. */
20
- muted_until: v.optional(time),
19
+ muted_until: about(v.optional(time), "When the mute ends; absent with `muted` true is for good."),
21
20
  archived: v.optional(v.boolean()),
22
- /** The owner marked it unread, whatever `unread_count` says. */
23
- marked_unread: v.optional(v.boolean()),
21
+ marked_unread: about(v.optional(v.boolean()), "The owner marked it unread, whatever `unread_count` says."),
24
22
  membership_state: v.optional(v.picklist(["joined", "left", "public", "imported", "archived", "external"])),
25
23
  parent_chat_id: v.optional(id),
26
24
  scope: v.optional(v.picklist(["personal", "work"])),
27
25
  provider_metadata: providerMetadata,
28
- /** `chats show`, a group or channel: what it says about itself. */
29
- description: v.optional(v.nullable(text)),
26
+ description: about(v.optional(v.nullable(text)), "`chats show`, a group or channel: what it says about itself."),
30
27
  invite_link: v.optional(v.nullable(text)),
31
28
  settings: v.optional(
32
29
  v.strictObject({
@@ -41,6 +38,8 @@ export const chat = v.strictObject({
41
38
  disappearing_seconds: v.optional(v.nullable(count)),
42
39
  }),
43
40
  ),
44
- /** `chats show`: absent when no roster is known; an empty list is a known empty roster. */
45
- members: v.optional(v.array(member)),
41
+ members: about(
42
+ v.optional(v.array(member)),
43
+ "`chats show`: absent when no roster is known; an empty list is a known empty roster.",
44
+ ),
46
45
  })
@@ -1,7 +1,7 @@
1
1
  import * as v from "valibot"
2
2
  import { chat } from "./chat.js"
3
3
  import { profileFields } from "./contact-read.js"
4
- import { count, id, reference, text, time } from "./fields.js"
4
+ import { about, count, id, reference, text, time } from "./fields.js"
5
5
 
6
6
  /** Somebody in a messenger's contact list. */
7
7
  export const contact = v.strictObject({
@@ -11,29 +11,28 @@ export const contact = v.strictObject({
11
11
  username: v.nullable(text),
12
12
  alias: v.optional(v.nullable(text)),
13
13
  display_name: v.optional(v.nullable(text)),
14
- /** Whatever they wrote about themselves. */
15
- description: v.nullable(text),
16
- /** The newest message in a one-to-one chat with them. */
17
- last_messaged_at: v.nullable(time),
18
- /** For a source that knows it, such as a Zoom contact. */
19
- email: v.optional(v.nullable(text)),
14
+ description: about(v.nullable(text), "Whatever they wrote about themselves."),
15
+ last_messaged_at: about(v.nullable(time), "The newest message in a one-to-one chat with them."),
16
+ email: about(v.optional(v.nullable(text)), "For a source that knows it, such as a Zoom contact."),
20
17
  phones: v.optional(v.array(v.strictObject({ number: text, label: v.nullable(text) }))),
21
- /** `contacts show`: the chats shared with them, and what the store holds of their messages in each. */
22
- chats: v.optional(
23
- v.array(
24
- v.strictObject({
25
- ...v.pick(chat, ["ref", "id", "title", "kind", "last_message_at"]).entries,
26
- /** Their messages stored; a floor unless `complete`. */
27
- their_messages: v.optional(count),
28
- first_at: v.optional(v.nullable(time)),
29
- last_at: v.optional(v.nullable(time)),
30
- /** The store holds the whole chat, so the count is the real one. */
31
- complete: v.optional(v.boolean()),
32
- }),
18
+ chats: about(
19
+ v.optional(
20
+ v.array(
21
+ v.strictObject({
22
+ ...v.pick(chat, ["ref", "id", "title", "kind", "last_message_at"]).entries,
23
+ their_messages: about(v.optional(count), "Their messages stored; a floor unless `complete`."),
24
+ first_at: v.optional(v.nullable(time)),
25
+ last_at: v.optional(v.nullable(time)),
26
+ complete: about(v.optional(v.boolean()), "The store holds the whole chat, so the count is the real one."),
27
+ }),
28
+ ),
33
29
  ),
30
+ "`contacts show`: the chats shared with them, and what the store holds of their messages in each.",
34
31
  ),
35
32
  /** `contacts show`: what the messenger says about them, or with `--offline` what the store saw of them. */
36
33
  ...v.partial(v.strictObject(profileFields)).entries,
37
- /** `contacts show --with-notes`: the owner's private notes about them. */
38
- notes: v.optional(v.array(v.strictObject({ id, text, revision: count, created_at: time, updated_at: time }))),
34
+ notes: about(
35
+ v.optional(v.array(v.strictObject({ id, text, revision: count, created_at: time, updated_at: time }))),
36
+ "`contacts show --with-notes`: the owner's private notes about them.",
37
+ ),
39
38
  })