@wirecat/zoom-cli 0.82.0 → 0.84.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 (492) hide show
  1. package/README.md +12 -12
  2. package/contracts/wirecat.json +88 -55
  3. package/dist/account-removal.d.ts +1 -1
  4. package/dist/account-removal.d.ts.map +1 -1
  5. package/dist/account-removal.js +1 -1
  6. package/dist/account-removal.js.map +1 -1
  7. package/dist/agent-skill.js +1 -1
  8. package/dist/agent-skill.js.map +1 -1
  9. package/dist/answer-entities.d.ts +1 -1
  10. package/dist/answer-entities.d.ts.map +1 -1
  11. package/dist/answer-entities.js +1 -1
  12. package/dist/answer-entities.js.map +1 -1
  13. package/dist/answer-output.d.ts +2 -2
  14. package/dist/answer-output.d.ts.map +1 -1
  15. package/dist/answer-output.js +1 -1
  16. package/dist/answer-output.js.map +1 -1
  17. package/dist/answer-policy.d.ts.map +1 -1
  18. package/dist/answer-policy.js +1 -2
  19. package/dist/answer-policy.js.map +1 -1
  20. package/dist/answers.js +1 -1
  21. package/dist/answers.js.map +1 -1
  22. package/dist/api.d.ts +2 -2
  23. package/dist/api.d.ts.map +1 -1
  24. package/dist/api.js +2 -2
  25. package/dist/api.js.map +1 -1
  26. package/dist/archive-commands.d.ts +1 -1
  27. package/dist/archive-commands.d.ts.map +1 -1
  28. package/dist/archive-commands.js +1 -2
  29. package/dist/archive-commands.js.map +1 -1
  30. package/dist/archive-import.d.ts +1 -1
  31. package/dist/archive-import.d.ts.map +1 -1
  32. package/dist/archive-import.js +1 -1
  33. package/dist/archive-import.js.map +1 -1
  34. package/dist/archive-transcripts.d.ts +1 -1
  35. package/dist/archive-transcripts.d.ts.map +1 -1
  36. package/dist/archive-transcripts.js +1 -2
  37. package/dist/archive-transcripts.js.map +1 -1
  38. package/dist/bin/main.js +4 -17
  39. package/dist/bin/main.js.map +1 -1
  40. package/dist/bin/zm.js +11 -11
  41. package/dist/bundle/answer-policy-OQQWAUHH.js +33 -0
  42. package/dist/bundle/chunk-3YDF76DP.js +922 -0
  43. package/dist/bundle/chunk-AEWYRB6F.js +8 -0
  44. package/dist/bundle/chunk-AF2Z6VOG.js +137 -0
  45. package/dist/bundle/{chunk-MAJJ4PG3.js → chunk-DAYBU7WR.js} +79 -396
  46. package/dist/bundle/{chunk-XQQVMECZ.js → chunk-JD63PEI3.js} +3 -8
  47. package/dist/bundle/{chunk-UL2PXLKT.js → chunk-L5ZYKXAY.js} +392 -129
  48. package/dist/bundle/{chunk-2SWKQ7C4.js → chunk-W4TDCCT3.js} +8 -2
  49. package/dist/bundle/{chunk-AC6VJNMJ.js → chunk-W6YFWJDR.js} +2 -5
  50. package/dist/bundle/{chunk-434YFJAE.js → chunk-WSGD5Q6L.js} +3 -9
  51. package/dist/bundle/config-MP5YLHEY.js +29 -0
  52. package/dist/bundle/{folders-LXOL4N4S.js → folders-B2GKJOC2.js} +2 -7
  53. package/dist/bundle/{main-YAA7WQ23.js → main-YZPLPXB7.js} +21 -53
  54. package/dist/bundle/{output-file-2UB5JP3R.js → output-file-PKA7MJEP.js} +3 -11
  55. package/dist/bundle/{program-GVCGZP27.js → program-7JY6XJ6K.js} +714 -935
  56. package/dist/bundle/run-log-ML7ZCWXD.js +54 -0
  57. package/dist/bundle/store-connection-LQGKS3DN.js +21 -0
  58. package/dist/bundle/streaming-PRGWGNHY.js +12 -0
  59. package/dist/bundle/tokens-57RJVBK6.js +18 -0
  60. package/dist/bundle/zm.js +4 -161
  61. package/dist/bundle/{zoom-app-YWFB367P.js → zoom-app-EYJST6GF.js} +4 -10
  62. package/dist/chat-file.d.ts +1 -1
  63. package/dist/chat-file.d.ts.map +1 -1
  64. package/dist/commands.d.ts +1 -8
  65. package/dist/commands.d.ts.map +1 -1
  66. package/dist/commands.js +3 -33
  67. package/dist/commands.js.map +1 -1
  68. package/dist/config-issues.d.ts +1 -1
  69. package/dist/config-issues.d.ts.map +1 -1
  70. package/dist/config-issues.js +1 -1
  71. package/dist/config-issues.js.map +1 -1
  72. package/dist/config.d.ts +1 -2
  73. package/dist/config.d.ts.map +1 -1
  74. package/dist/config.js +1 -2
  75. package/dist/config.js.map +1 -1
  76. package/dist/contacts-commands.d.ts +1 -1
  77. package/dist/contacts-commands.d.ts.map +1 -1
  78. package/dist/contacts-commands.js +1 -1
  79. package/dist/contacts-commands.js.map +1 -1
  80. package/dist/contract-overrides.js +1 -1
  81. package/dist/contract-overrides.js.map +1 -1
  82. package/dist/errors.d.ts +1 -1
  83. package/dist/errors.d.ts.map +1 -1
  84. package/dist/execution.d.ts +1 -1
  85. package/dist/execution.d.ts.map +1 -1
  86. package/dist/execution.js +1 -1
  87. package/dist/execution.js.map +1 -1
  88. package/dist/files.d.ts +2 -2
  89. package/dist/files.d.ts.map +1 -1
  90. package/dist/files.js +1 -1
  91. package/dist/files.js.map +1 -1
  92. package/dist/first-screen.js +1 -1
  93. package/dist/first-screen.js.map +1 -1
  94. package/dist/identity.d.ts +1 -1
  95. package/dist/identity.d.ts.map +1 -1
  96. package/dist/identity.js +6 -0
  97. package/dist/identity.js.map +1 -1
  98. package/dist/index.d.ts +1 -2
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +1 -2
  101. package/dist/index.js.map +1 -1
  102. package/dist/ingestion-search-commands.d.ts +1 -1
  103. package/dist/ingestion-search-commands.d.ts.map +1 -1
  104. package/dist/ingestion-search-commands.js +1 -1
  105. package/dist/ingestion-search-commands.js.map +1 -1
  106. package/dist/local-transcription-commands.d.ts +1 -1
  107. package/dist/local-transcription-commands.d.ts.map +1 -1
  108. package/dist/local-transcription-commands.js +1 -2
  109. package/dist/local-transcription-commands.js.map +1 -1
  110. package/dist/local-transcription.d.ts +1 -2
  111. package/dist/local-transcription.d.ts.map +1 -1
  112. package/dist/local-transcription.js +3 -3
  113. package/dist/local-transcription.js.map +1 -1
  114. package/dist/meeting-commands.d.ts +1 -1
  115. package/dist/meeting-commands.d.ts.map +1 -1
  116. package/dist/meeting-commands.js +1 -2
  117. package/dist/meeting-commands.js.map +1 -1
  118. package/dist/meeting-communications-binding.d.ts +1 -2
  119. package/dist/meeting-communications-binding.d.ts.map +1 -1
  120. package/dist/meeting-communications-binding.js.map +1 -1
  121. package/dist/meeting-context-commands.d.ts +1 -1
  122. package/dist/meeting-context-commands.d.ts.map +1 -1
  123. package/dist/meeting-context-commands.js +1 -1
  124. package/dist/meeting-context-commands.js.map +1 -1
  125. package/dist/meeting-context.d.ts +2 -4
  126. package/dist/meeting-context.d.ts.map +1 -1
  127. package/dist/meeting-context.js +1 -1
  128. package/dist/meeting-context.js.map +1 -1
  129. package/dist/meeting-integration-commands.d.ts +1 -1
  130. package/dist/meeting-integration-commands.d.ts.map +1 -1
  131. package/dist/meeting-integration-commands.js +1 -2
  132. package/dist/meeting-integration-commands.js.map +1 -1
  133. package/dist/meeting-integration.d.ts +1 -1
  134. package/dist/meeting-integration.d.ts.map +1 -1
  135. package/dist/meeting-integration.js +1 -1
  136. package/dist/meeting-integration.js.map +1 -1
  137. package/dist/meeting-inventory.d.ts +1 -1
  138. package/dist/meeting-inventory.d.ts.map +1 -1
  139. package/dist/meeting-inventory.js +1 -1
  140. package/dist/meeting-inventory.js.map +1 -1
  141. package/dist/meeting-preparation.d.ts +1 -2
  142. package/dist/meeting-preparation.d.ts.map +1 -1
  143. package/dist/meeting-preparation.js +1 -1
  144. package/dist/meeting-preparation.js.map +1 -1
  145. package/dist/meeting-project-candidates.d.ts +1 -1
  146. package/dist/meeting-project-candidates.d.ts.map +1 -1
  147. package/dist/meeting-project-evidence-commands.d.ts +1 -1
  148. package/dist/meeting-project-evidence-commands.d.ts.map +1 -1
  149. package/dist/meeting-project-evidence-commands.js +1 -2
  150. package/dist/meeting-project-evidence-commands.js.map +1 -1
  151. package/dist/meeting-read-command-bindings.js +1 -1
  152. package/dist/meeting-read-command-bindings.js.map +1 -1
  153. package/dist/meeting-review-commands.d.ts +1 -3
  154. package/dist/meeting-review-commands.d.ts.map +1 -1
  155. package/dist/meeting-review-commands.js +1 -2
  156. package/dist/meeting-review-commands.js.map +1 -1
  157. package/dist/meeting-search-commands.d.ts +2 -3
  158. package/dist/meeting-search-commands.d.ts.map +1 -1
  159. package/dist/meeting-search-commands.js +2 -4
  160. package/dist/meeting-search-commands.js.map +1 -1
  161. package/dist/meeting-searches-commands.d.ts +1 -2
  162. package/dist/meeting-searches-commands.d.ts.map +1 -1
  163. package/dist/meeting-searches-commands.js +1 -2
  164. package/dist/meeting-searches-commands.js.map +1 -1
  165. package/dist/meeting-selection-options.d.ts +1 -1
  166. package/dist/meeting-selection-options.d.ts.map +1 -1
  167. package/dist/meeting-selection-options.js +1 -2
  168. package/dist/meeting-selection-options.js.map +1 -1
  169. package/dist/meeting-semantic-commands.d.ts +1 -2
  170. package/dist/meeting-semantic-commands.d.ts.map +1 -1
  171. package/dist/meeting-semantic-commands.js +1 -1
  172. package/dist/meeting-semantic-commands.js.map +1 -1
  173. package/dist/meeting-semantic.d.ts +2 -2
  174. package/dist/meeting-semantic.d.ts.map +1 -1
  175. package/dist/meeting-semantic.js +1 -1
  176. package/dist/meeting-semantic.js.map +1 -1
  177. package/dist/meeting-source.d.ts +1 -1
  178. package/dist/meeting-source.d.ts.map +1 -1
  179. package/dist/meeting-stats-commands.d.ts +1 -3
  180. package/dist/meeting-stats-commands.d.ts.map +1 -1
  181. package/dist/meeting-stats-commands.js +1 -2
  182. package/dist/meeting-stats-commands.js.map +1 -1
  183. package/dist/models-commands.d.ts +1 -1
  184. package/dist/models-commands.d.ts.map +1 -1
  185. package/dist/models-commands.js +1 -1
  186. package/dist/models-commands.js.map +1 -1
  187. package/dist/occurrence-schedule.d.ts +1 -1
  188. package/dist/occurrence-schedule.d.ts.map +1 -1
  189. package/dist/permissions.d.ts +1 -1
  190. package/dist/permissions.d.ts.map +1 -1
  191. package/dist/permissions.js +1 -2
  192. package/dist/permissions.js.map +1 -1
  193. package/dist/profile.js +1 -1
  194. package/dist/profile.js.map +1 -1
  195. package/dist/program-bindings.d.ts.map +1 -1
  196. package/dist/program-bindings.js +3 -13
  197. package/dist/program-bindings.js.map +1 -1
  198. package/dist/program.d.ts +4 -7
  199. package/dist/program.d.ts.map +1 -1
  200. package/dist/program.js +1 -1
  201. package/dist/program.js.map +1 -1
  202. package/dist/progress-commands.d.ts +1 -1
  203. package/dist/progress-commands.d.ts.map +1 -1
  204. package/dist/progress-commands.js +1 -2
  205. package/dist/progress-commands.js.map +1 -1
  206. package/dist/read-only.js +1 -1
  207. package/dist/read-only.js.map +1 -1
  208. package/dist/recording-archive.d.ts.map +1 -1
  209. package/dist/recording-archive.js +1 -2
  210. package/dist/recording-archive.js.map +1 -1
  211. package/dist/recording-manifest.js +1 -1
  212. package/dist/recording-manifest.js.map +1 -1
  213. package/dist/recording-partial-store.d.ts +2 -3
  214. package/dist/recording-partial-store.d.ts.map +1 -1
  215. package/dist/recording-partial-store.js +1 -1
  216. package/dist/recording-partial-store.js.map +1 -1
  217. package/dist/recording-promotion-store.d.ts +1 -2
  218. package/dist/recording-promotion-store.d.ts.map +1 -1
  219. package/dist/recording-promotion-store.js +1 -2
  220. package/dist/recording-promotion-store.js.map +1 -1
  221. package/dist/recording-schedule-commands.d.ts +1 -1
  222. package/dist/recording-schedule-commands.d.ts.map +1 -1
  223. package/dist/recording-schedule-commands.js +1 -1
  224. package/dist/recording-schedule-commands.js.map +1 -1
  225. package/dist/recording-schedule-store.js +1 -1
  226. package/dist/recording-schedule-store.js.map +1 -1
  227. package/dist/recording-schedule-systemd.js +1 -1
  228. package/dist/recording-schedule-systemd.js.map +1 -1
  229. package/dist/recording-schedule.d.ts +1 -1
  230. package/dist/recording-schedule.d.ts.map +1 -1
  231. package/dist/recording-schedule.js +1 -1
  232. package/dist/recording-schedule.js.map +1 -1
  233. package/dist/recording-sync-store.d.ts +1 -1
  234. package/dist/recording-sync-store.d.ts.map +1 -1
  235. package/dist/recording-sync-store.js +1 -2
  236. package/dist/recording-sync-store.js.map +1 -1
  237. package/dist/recording-sync.d.ts +1 -1
  238. package/dist/recording-sync.d.ts.map +1 -1
  239. package/dist/recording-sync.js +1 -1
  240. package/dist/recording-sync.js.map +1 -1
  241. package/dist/recording-writer-lease.d.ts +1 -1
  242. package/dist/recording-writer-lease.d.ts.map +1 -1
  243. package/dist/recording-writer-lease.js +1 -1
  244. package/dist/recording-writer-lease.js.map +1 -1
  245. package/dist/recordings.d.ts +1 -1
  246. package/dist/recordings.d.ts.map +1 -1
  247. package/dist/recordings.js.map +1 -1
  248. package/dist/remote-meetings.d.ts +19 -19
  249. package/dist/remote-meetings.d.ts.map +1 -1
  250. package/dist/remote-meetings.js +1 -1
  251. package/dist/remote-meetings.js.map +1 -1
  252. package/dist/request-events.d.ts +1 -1
  253. package/dist/request-events.d.ts.map +1 -1
  254. package/dist/request-events.js +1 -1
  255. package/dist/request-events.js.map +1 -1
  256. package/dist/run-log.d.ts +1 -1
  257. package/dist/run-log.d.ts.map +1 -1
  258. package/dist/run-log.js +1 -1
  259. package/dist/run-log.js.map +1 -1
  260. package/dist/run.d.ts +1 -1
  261. package/dist/run.d.ts.map +1 -1
  262. package/dist/run.js +6 -2
  263. package/dist/run.js.map +1 -1
  264. package/dist/series-inventory.d.ts +2 -2
  265. package/dist/series-inventory.js +1 -1
  266. package/dist/series-inventory.js.map +1 -1
  267. package/dist/setup-commands.d.ts +6 -15
  268. package/dist/setup-commands.d.ts.map +1 -1
  269. package/dist/setup-commands.js +7 -142
  270. package/dist/setup-commands.js.map +1 -1
  271. package/dist/store-commands.d.ts +1 -1
  272. package/dist/store-commands.d.ts.map +1 -1
  273. package/dist/store-commands.js +1 -2
  274. package/dist/store-commands.js.map +1 -1
  275. package/dist/store-connection.d.ts +1 -3
  276. package/dist/store-connection.d.ts.map +1 -1
  277. package/dist/store-connection.js +14 -14
  278. package/dist/store-connection.js.map +1 -1
  279. package/dist/sync-progress.d.ts +4 -4
  280. package/dist/sync-progress.d.ts.map +1 -1
  281. package/dist/sync-progress.js +1 -1
  282. package/dist/sync-progress.js.map +1 -1
  283. package/dist/tokens.d.ts +20 -44
  284. package/dist/tokens.d.ts.map +1 -1
  285. package/dist/tokens.js +95 -308
  286. package/dist/tokens.js.map +1 -1
  287. package/dist/unified-search.d.ts +1 -1
  288. package/dist/unified-search.d.ts.map +1 -1
  289. package/dist/upcoming-meetings.d.ts +2 -2
  290. package/dist/upcoming-meetings.js +1 -1
  291. package/dist/upcoming-meetings.js.map +1 -1
  292. package/dist/upgrade.d.ts.map +1 -1
  293. package/dist/upgrade.js +1 -2
  294. package/dist/upgrade.js.map +1 -1
  295. package/dist/version.d.ts +1 -1
  296. package/dist/version.js +1 -1
  297. package/dist/watch-commands.d.ts +1 -2
  298. package/dist/watch-commands.d.ts.map +1 -1
  299. package/dist/watch-commands.js +1 -2
  300. package/dist/watch-commands.js.map +1 -1
  301. package/dist/watch-service.d.ts +1 -1
  302. package/dist/watch-service.d.ts.map +1 -1
  303. package/dist/watch-service.js +1 -1
  304. package/dist/watch-service.js.map +1 -1
  305. package/dist/zoom-app.d.ts +2 -2
  306. package/dist/zoom-app.d.ts.map +1 -1
  307. package/dist/zoom-app.js +2 -2
  308. package/dist/zoom-app.js.map +1 -1
  309. package/dist/zoom-search-commands.d.ts +1 -1
  310. package/dist/zoom-search-commands.d.ts.map +1 -1
  311. package/dist/zoom-search-commands.js +1 -1
  312. package/dist/zoom-search-commands.js.map +1 -1
  313. package/dist/zoom-session.d.ts +6 -0
  314. package/dist/zoom-session.d.ts.map +1 -0
  315. package/dist/zoom-session.js +72 -0
  316. package/dist/zoom-session.js.map +1 -0
  317. package/package.json +3 -3
  318. package/scenarios/person-in-meetings.md +1 -1
  319. package/skills/zoom-cli/SKILL.md +1 -1
  320. package/skills/zoom-cli/references/people-and-projects.md +5 -5
  321. package/skills/zoom-cli/references/prepare.md +2 -2
  322. package/skills/zoom-cli/references/setup.md +2 -2
  323. package/dist/bundle/agent-F4TRJWWS.js +0 -46
  324. package/dist/bundle/all-profiles-RULEKTDQ.js +0 -321
  325. package/dist/bundle/answer-policy-6XC57AEZ.js +0 -131
  326. package/dist/bundle/anthropic-4NAQBZFL.js +0 -91
  327. package/dist/bundle/app-server-VLR42U5L.js +0 -266
  328. package/dist/bundle/bun-OPDGMZZQ.js +0 -169
  329. package/dist/bundle/bun-sqlite-HC6X4AOX.js +0 -76
  330. package/dist/bundle/chunk-274SLQNW.js +0 -54
  331. package/dist/bundle/chunk-2CI2OEZQ.js +0 -101
  332. package/dist/bundle/chunk-2DBF2IIC.js +0 -330
  333. package/dist/bundle/chunk-2GP573Q4.js +0 -67190
  334. package/dist/bundle/chunk-2JHVQMVC.js +0 -16
  335. package/dist/bundle/chunk-2XBDILVW.js +0 -53
  336. package/dist/bundle/chunk-3HC5F3P7.js +0 -24
  337. package/dist/bundle/chunk-3YM4B2GT.js +0 -63
  338. package/dist/bundle/chunk-4HLQ2JGK.js +0 -276
  339. package/dist/bundle/chunk-4N7PP76S.js +0 -6848
  340. package/dist/bundle/chunk-52Y4ETKU.js +0 -230
  341. package/dist/bundle/chunk-5HAUK3I4.js +0 -27160
  342. package/dist/bundle/chunk-5KYQ53EF.js +0 -357
  343. package/dist/bundle/chunk-5TU7Y5UW.js +0 -218
  344. package/dist/bundle/chunk-66ALX4ZI.js +0 -1068
  345. package/dist/bundle/chunk-676C2LE6.js +0 -229
  346. package/dist/bundle/chunk-6CWL5BKG.js +0 -3012
  347. package/dist/bundle/chunk-6QYZP4E2.js +0 -73
  348. package/dist/bundle/chunk-6VK332XS.js +0 -170
  349. package/dist/bundle/chunk-73MOMNLL.js +0 -94
  350. package/dist/bundle/chunk-7QPIUMUG.js +0 -198
  351. package/dist/bundle/chunk-7UVDPRFK.js +0 -259
  352. package/dist/bundle/chunk-A6EZK5RG.js +0 -142
  353. package/dist/bundle/chunk-ACI4YIEH.js +0 -331
  354. package/dist/bundle/chunk-AIKFOBDO.js +0 -1024
  355. package/dist/bundle/chunk-ASBDFXLS.js +0 -295
  356. package/dist/bundle/chunk-B32KZRQM.js +0 -2338
  357. package/dist/bundle/chunk-BBGJQMRI.js +0 -34
  358. package/dist/bundle/chunk-BDKVOU3I.js +0 -52
  359. package/dist/bundle/chunk-BP4FYANF.js +0 -335
  360. package/dist/bundle/chunk-D72URWJE.js +0 -532
  361. package/dist/bundle/chunk-DCYFT3FR.js +0 -161
  362. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  363. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  364. package/dist/bundle/chunk-DSZYABYL.js +0 -808
  365. package/dist/bundle/chunk-E745WZKY.js +0 -1199
  366. package/dist/bundle/chunk-EGTCQKHV.js +0 -340
  367. package/dist/bundle/chunk-EQG3PIH2.js +0 -108
  368. package/dist/bundle/chunk-ESN3W2MZ.js +0 -2624
  369. package/dist/bundle/chunk-FXBHOCJK.js +0 -24600
  370. package/dist/bundle/chunk-G46WJ7YO.js +0 -95
  371. package/dist/bundle/chunk-G6PETRMV.js +0 -64
  372. package/dist/bundle/chunk-GBHMT2IU.js +0 -755
  373. package/dist/bundle/chunk-GGMAIIVE.js +0 -38
  374. package/dist/bundle/chunk-GTKPMYK7.js +0 -72
  375. package/dist/bundle/chunk-GWGHH56B.js +0 -374
  376. package/dist/bundle/chunk-HC6VN5CO.js +0 -692
  377. package/dist/bundle/chunk-HP7A2ZOP.js +0 -185
  378. package/dist/bundle/chunk-HTQTIKWP.js +0 -928
  379. package/dist/bundle/chunk-HZENBDW2.js +0 -209
  380. package/dist/bundle/chunk-IANKXHSE.js +0 -46
  381. package/dist/bundle/chunk-ICPJT672.js +0 -228
  382. package/dist/bundle/chunk-JQ54DYAQ.js +0 -80
  383. package/dist/bundle/chunk-K5JGJIV2.js +0 -640
  384. package/dist/bundle/chunk-KJ6USQDZ.js +0 -616
  385. package/dist/bundle/chunk-KKFY23AK.js +0 -5150
  386. package/dist/bundle/chunk-KQPUVXKX.js +0 -84
  387. package/dist/bundle/chunk-KVJ3I7UL.js +0 -1007
  388. package/dist/bundle/chunk-KWU46LNK.js +0 -288
  389. package/dist/bundle/chunk-KXJ3JEDH.js +0 -2
  390. package/dist/bundle/chunk-L75SMSJR.js +0 -133
  391. package/dist/bundle/chunk-LAYYO4WD.js +0 -31
  392. package/dist/bundle/chunk-LEKKTJKK.js +0 -2336
  393. package/dist/bundle/chunk-M7H4MCAX.js +0 -388
  394. package/dist/bundle/chunk-MQLPZBMQ.js +0 -58
  395. package/dist/bundle/chunk-N3JLO63O.js +0 -13
  396. package/dist/bundle/chunk-N46F72AF.js +0 -410
  397. package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
  398. package/dist/bundle/chunk-NEMX3UNN.js +0 -76
  399. package/dist/bundle/chunk-OBXQLFT5.js +0 -82
  400. package/dist/bundle/chunk-OGNO35A2.js +0 -262
  401. package/dist/bundle/chunk-OIPYBF43.js +0 -100
  402. package/dist/bundle/chunk-OO4TRVPB.js +0 -185
  403. package/dist/bundle/chunk-OQFQ77AY.js +0 -9352
  404. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  405. package/dist/bundle/chunk-PMUPN6JW.js +0 -773
  406. package/dist/bundle/chunk-PSKTMMCO.js +0 -561
  407. package/dist/bundle/chunk-PWVJUIDQ.js +0 -106
  408. package/dist/bundle/chunk-Q7ICVP25.js +0 -18
  409. package/dist/bundle/chunk-QG6PILDO.js +0 -195
  410. package/dist/bundle/chunk-QPHBK63S.js +0 -25
  411. package/dist/bundle/chunk-QVSL5WJ7.js +0 -46524
  412. package/dist/bundle/chunk-QVYAV7F2.js +0 -58
  413. package/dist/bundle/chunk-R2B6PUVI.js +0 -206
  414. package/dist/bundle/chunk-RQOZBTNI.js +0 -86
  415. package/dist/bundle/chunk-T7IAWEBU.js +0 -362
  416. package/dist/bundle/chunk-TKNM22OH.js +0 -71
  417. package/dist/bundle/chunk-TKVBFJ5C.js +0 -37
  418. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  419. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  420. package/dist/bundle/chunk-UAWSINMC.js +0 -875
  421. package/dist/bundle/chunk-UKAAAOPC.js +0 -1251
  422. package/dist/bundle/chunk-UQCTXZEP.js +0 -214
  423. package/dist/bundle/chunk-UR5DBODY.js +0 -1345
  424. package/dist/bundle/chunk-V5EJSF2B.js +0 -12235
  425. package/dist/bundle/chunk-VB72LTSZ.js +0 -210
  426. package/dist/bundle/chunk-VB7FZOYX.js +0 -633
  427. package/dist/bundle/chunk-VS6WURLX.js +0 -217
  428. package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
  429. package/dist/bundle/chunk-W5QHB53X.js +0 -3752
  430. package/dist/bundle/chunk-WMANRJR5.js +0 -555
  431. package/dist/bundle/chunk-WOPVBRPV.js +0 -29
  432. package/dist/bundle/chunk-XQ2WL3HB.js +0 -140
  433. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  434. package/dist/bundle/chunk-Y6PVS55U.js +0 -800
  435. package/dist/bundle/chunk-YJXJJ2XP.js +0 -2333
  436. package/dist/bundle/chunk-YY7XKHDY.js +0 -79
  437. package/dist/bundle/chunk-ZED2CJW5.js +0 -353
  438. package/dist/bundle/chunk-ZOYOXWJB.js +0 -746
  439. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  440. package/dist/bundle/cli-U4O5XB7J.js +0 -1255
  441. package/dist/bundle/command-contract-FBTK6GQX.js +0 -45
  442. package/dist/bundle/command-server-entry-KKH6ZWJV.js +0 -175
  443. package/dist/bundle/config-FRJSIZNN.js +0 -118
  444. package/dist/bundle/decode-TPCNXEK4.js +0 -31
  445. package/dist/bundle/dispatch-FKMIPCPQ.js +0 -412
  446. package/dist/bundle/dist-7CLBCYZN.js +0 -321
  447. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  448. package/dist/bundle/dist-XUFQCJXW.js +0 -7577
  449. package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
  450. package/dist/bundle/embed-WCJSFVSK.js +0 -38
  451. package/dist/bundle/embedder-TBBUPXBX.js +0 -111
  452. package/dist/bundle/failure-XTWBYI2A.js +0 -25
  453. package/dist/bundle/first-run-ELEMFW42.js +0 -29
  454. package/dist/bundle/first-screen-DIOBWMKP.js +0 -46
  455. package/dist/bundle/instructions-AMH5RWVJ.js +0 -11
  456. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  457. package/dist/bundle/meeting-combined-UXCF4SJ3.js +0 -26
  458. package/dist/bundle/meeting-model-3BZJ3EQP.js +0 -26
  459. package/dist/bundle/meeting-semantic-3HU7I2SJ.js +0 -23
  460. package/dist/bundle/meetings-XWMB6FOH.js +0 -332
  461. package/dist/bundle/node-EGMCBAO7.js +0 -176
  462. package/dist/bundle/node-KM3CUABH.js +0 -2340
  463. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  464. package/dist/bundle/node-sqlite-IJBWENFX.js +0 -74
  465. package/dist/bundle/oauth-SZDDAP7A.js +0 -20
  466. package/dist/bundle/open-NS3TMKZX.js +0 -23
  467. package/dist/bundle/openai-4DN6WI3B.js +0 -28
  468. package/dist/bundle/process-SGHEN6MQ.js +0 -91
  469. package/dist/bundle/prompt-HJFMPFVC.js +0 -17
  470. package/dist/bundle/public-C2ZB2AGQ.js +0 -198
  471. package/dist/bundle/recognize-2SEI5PPM.js +0 -26
  472. package/dist/bundle/remote-2DMS74XE.js +0 -32
  473. package/dist/bundle/rerank-H6GCYVIA.js +0 -52
  474. package/dist/bundle/run-log-QU26SUZP.js +0 -145
  475. package/dist/bundle/serve-ODVRPFJO.js +0 -199
  476. package/dist/bundle/server-NBPF6IDZ.js +0 -95
  477. package/dist/bundle/server-PCLIO24L.js +0 -228
  478. package/dist/bundle/services-4QAPXBLO.js +0 -607
  479. package/dist/bundle/speech-MA6ZT3WE.js +0 -89
  480. package/dist/bundle/sqlite-runtime-PVMAUXRN.js +0 -20
  481. package/dist/bundle/state-QFMTYUME.js +0 -36
  482. package/dist/bundle/store-25OTAQC3.js +0 -187
  483. package/dist/bundle/store-F724QIKJ.js +0 -305
  484. package/dist/bundle/store-connection-OGPXANGB.js +0 -111
  485. package/dist/bundle/store-maintenance-command-2CM7LLNQ.js +0 -83
  486. package/dist/bundle/streaming-S22C4DG5.js +0 -18
  487. package/dist/bundle/surface-7PXHWCF6.js +0 -81
  488. package/dist/bundle/tokens-NLUHA2DW.js +0 -25
  489. package/dist/login.d.ts +0 -16
  490. package/dist/login.d.ts.map +0 -1
  491. package/dist/login.js +0 -98
  492. package/dist/login.js.map +0 -1
@@ -1,15 +1,27 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
+ emitReceipt
5
+ } from "./chunk-JD63PEI3.js";
6
+ import {
7
+ legacyLoginService,
8
+ sameConfigFolder,
9
+ zmPaths
10
+ } from "./chunk-W6YFWJDR.js";
11
+ import {
12
+ ZOOM_ANSWER_ENTITIES,
4
13
  addMeetingEmbeddingCommand,
5
14
  addMeetingSearchCommands,
15
+ bodyOf,
6
16
  bytes,
7
17
  commandDeadline,
8
18
  compactLocalTranscriptionReceipt,
9
19
  connectSelectedProfile,
20
+ declareZoomAnswers,
10
21
  duration,
11
22
  integrationReference,
12
23
  meetingSearchDefinition,
24
+ renderBody,
13
25
  runUnifiedSearch,
14
26
  runsLong,
15
27
  sharedExecution,
@@ -20,23 +32,18 @@ import {
20
32
  validatePersonContext,
21
33
  validateTaskKind,
22
34
  validateTaskProposal,
23
- validateUnifiedSearch
24
- } from "./chunk-UL2PXLKT.js";
25
- import {
26
- emitReceipt
27
- } from "./chunk-XQQVMECZ.js";
35
+ validateUnifiedSearch,
36
+ wholeList
37
+ } from "./chunk-L5ZYKXAY.js";
28
38
  import {
29
39
  DEFAULT_PERMISSIONS,
30
- ZOOM_ANSWER_ENTITIES,
31
40
  ZOOM_SETTINGS,
32
41
  addProfile,
33
42
  addStandardCommands,
34
43
  annotateMeetingCommands,
35
44
  askBeforeWrite,
36
- bodyOf,
37
45
  chooseProfile,
38
46
  contextSourcesSchema,
39
- declareZoomAnswers,
40
47
  discoveryLevels,
41
48
  filesZone,
42
49
  guardCommand,
@@ -48,57 +55,39 @@ import {
48
55
  profileAccountKey,
49
56
  publicIssue,
50
57
  readConfig,
51
- renderBody,
52
58
  setConfig,
53
59
  unsetConfig,
54
- wholeList,
55
60
  zoomRunsCommand
56
- } from "./chunk-MAJJ4PG3.js";
57
- import {
58
- MEMO_SCENARIOS,
59
- SEARCHES_QUERY,
60
- accountRemoveCommand,
61
- actorOf,
62
- addMeetingBatchCommand,
63
- addMeetingPreparationCommand,
64
- addMeetingProjectCandidatesCommand,
65
- addMeetingSeriesInventoryCommand,
66
- answerStdinOption,
67
- appDoctorCommand,
68
- appMcpCommand,
69
- createProgram,
70
- formatMeetingBatch,
71
- guideCommand,
72
- inSection,
73
- meetingAnswerBody,
74
- meetingEvidenceItem,
75
- meetingPersonContextItem,
76
- modelCatalogueCommand,
77
- passageForRun,
78
- run,
79
- sharedCommandTemplate,
80
- signInSteps,
81
- skillCommand as skillCommand2,
82
- upgradeCommand
83
- } from "./chunk-5HAUK3I4.js";
84
- import "./chunk-7QPIUMUG.js";
61
+ } from "./chunk-DAYBU7WR.js";
85
62
  import {
86
63
  CLIENT_ID_NEED,
87
64
  SET_ZOOM_APP,
65
+ array,
66
+ boolean,
88
67
  checkedClientId,
89
- login,
68
+ looseObject,
69
+ optional,
70
+ picklist,
71
+ safeParse,
72
+ string,
90
73
  zoomApp,
91
74
  zoomAppChecklist,
92
75
  zoomAppSetup,
93
76
  zoomClientId,
94
77
  zoomClientReport
95
- } from "./chunk-OGNO35A2.js";
96
- import {
97
- TokenManager
98
- } from "./chunk-2DBF2IIC.js";
99
- import "./chunk-K5JGJIV2.js";
78
+ } from "./chunk-3YDF76DP.js";
100
79
  import "./chunk-7O7XM37N.js";
101
- import "./chunk-TKVBFJ5C.js";
80
+ import {
81
+ TokenManager,
82
+ ZOOM_CODEC,
83
+ legacyAccountsOf,
84
+ zoomProvider
85
+ } from "./chunk-AF2Z6VOG.js";
86
+ import {
87
+ CLIENT_ID_MISSING,
88
+ VERSION,
89
+ ZM
90
+ } from "./chunk-W4TDCCT3.js";
102
91
  import {
103
92
  ZoneAssumptions,
104
93
  cancellableStore,
@@ -109,257 +98,21 @@ import {
109
98
  withIssue,
110
99
  zoomInstant,
111
100
  zoomTime
112
- } from "./chunk-434YFJAE.js";
113
- import "./chunk-VB72LTSZ.js";
114
- import "./chunk-UQCTXZEP.js";
115
- import "./chunk-VS6WURLX.js";
116
- import {
117
- allAnswer
118
- } from "./chunk-UR5DBODY.js";
119
- import "./chunk-3HC5F3P7.js";
120
- import {
121
- skillCommand
122
- } from "./chunk-M7H4MCAX.js";
123
- import "./chunk-ASBDFXLS.js";
124
- import "./chunk-52Y4ETKU.js";
125
- import "./chunk-BDKVOU3I.js";
126
- import "./chunk-HZENBDW2.js";
127
- import "./chunk-VZ5PPYDG.js";
128
- import "./chunk-DCYFT3FR.js";
129
- import "./chunk-OQFQ77AY.js";
130
- import "./chunk-ICPJT672.js";
131
- import "./chunk-UKAAAOPC.js";
132
- import {
133
- pagingOf
134
- } from "./chunk-ZED2CJW5.js";
135
- import "./chunk-EGTCQKHV.js";
136
- import "./chunk-KQPUVXKX.js";
137
- import "./chunk-RQOZBTNI.js";
138
- import {
139
- NativeRecordingPartialStore,
140
- NativeRecordingPublication,
141
- commandPermissions,
142
- commandRuns,
143
- integer,
144
- providerRequest,
145
- runSettings,
146
- savedSearchItem,
147
- validateMeetingPreparationRequest
148
- } from "./chunk-QVSL5WJ7.js";
149
- import "./chunk-676C2LE6.js";
150
- import "./chunk-QPHBK63S.js";
151
- import {
152
- nativeWriterLeaseStore,
153
- openOrdinaryFile,
154
- syncDirectory,
155
- writeFileAtomic
156
- } from "./chunk-N46F72AF.js";
157
- import {
158
- addMeetingCommands,
159
- addMeetingPassageCommand,
160
- addMeetingProjectEvidenceCommand,
161
- dateWindow,
162
- listQuery,
163
- nativeTerms,
164
- queryTerms,
165
- termField,
166
- typedQuery,
167
- unfilteredQuery,
168
- withQuery
169
- } from "./chunk-GBHMT2IU.js";
170
- import "./chunk-GWGHH56B.js";
171
- import "./chunk-6VK332XS.js";
172
- import "./chunk-5KYQ53EF.js";
173
- import "./chunk-NB7EOAUZ.js";
174
- import "./chunk-WOPVBRPV.js";
175
- import "./chunk-5TU7Y5UW.js";
176
- import {
177
- latestVersion,
178
- runUpdate,
179
- updateNotice
180
- } from "./chunk-A6EZK5RG.js";
181
- import "./chunk-TY7NDMFY.js";
182
- import {
183
- sameConfigFolder,
184
- zmPaths
185
- } from "./chunk-AC6VJNMJ.js";
186
- import "./chunk-B32KZRQM.js";
187
- import "./chunk-XQ2WL3HB.js";
188
- import "./chunk-AIKFOBDO.js";
189
- import "./chunk-QG6PILDO.js";
190
- import "./chunk-HC6VN5CO.js";
191
- import "./chunk-HTQTIKWP.js";
192
- import "./chunk-NEMX3UNN.js";
193
- import "./chunk-KXJ3JEDH.js";
194
- import "./chunk-66ALX4ZI.js";
195
- import "./chunk-7UVDPRFK.js";
196
- import "./chunk-HP7A2ZOP.js";
197
- import "./chunk-KVJ3I7UL.js";
198
- import "./chunk-OO4TRVPB.js";
199
- import "./chunk-N3JLO63O.js";
200
- import "./chunk-Q7ICVP25.js";
201
- import "./chunk-L75SMSJR.js";
202
- import {
203
- Argument,
204
- CommanderError,
205
- DEFAULT_CONFIG,
206
- FETCH,
207
- LOCAL_READ,
208
- LOCAL_WRITE,
209
- NONE_NAMED,
210
- NO_EFFECTS,
211
- Option,
212
- REMOTE_READ,
213
- REMOTE_WRITE,
214
- annotate,
215
- checkpointPath,
216
- commandWords,
217
- customizeSharedCommand,
218
- environmentOf,
219
- grantsAuthority,
220
- isBody,
221
- itemAnswer,
222
- itemOf,
223
- listOf,
224
- logsInOrOut,
225
- overrideSharedContract,
226
- progressOf,
227
- readCheckpoint,
228
- refuseCommandName,
229
- runBudgetOf,
230
- saveCheckpoint,
231
- settingRows,
232
- snakeKeys,
233
- writesNewFileOnlyWith,
234
- writesOwnerFiles
235
- } from "./chunk-V5EJSF2B.js";
236
- import "./chunk-2CI2OEZQ.js";
237
- import "./chunk-TKNM22OH.js";
238
- import "./chunk-T7IAWEBU.js";
239
- import "./chunk-3YM4B2GT.js";
240
- import "./chunk-QVYAV7F2.js";
241
- import {
242
- COMMAND_PATH_KEY,
243
- assertOverridesTighten,
244
- permissionOverrides
245
- } from "./chunk-KJ6USQDZ.js";
246
- import "./chunk-G6PETRMV.js";
247
- import "./chunk-BP4FYANF.js";
248
- import "./chunk-6QYZP4E2.js";
249
- import {
250
- hostFetch,
251
- providerWaitMs,
252
- readJsonResponse,
253
- retryableStatus,
254
- retrying,
255
- statusToCode
256
- } from "./chunk-ACI4YIEH.js";
257
- import {
258
- speechModel
259
- } from "./chunk-4HLQ2JGK.js";
260
- import "./chunk-OIPYBF43.js";
261
- import "./chunk-OBXQLFT5.js";
262
- import "./chunk-2GP573Q4.js";
263
- import "./chunk-JQ54DYAQ.js";
264
- import "./chunk-PMUPN6JW.js";
265
- import "./chunk-YJXJJ2XP.js";
266
- import "./chunk-LEKKTJKK.js";
267
- import "./chunk-YY7XKHDY.js";
268
- import "./chunk-2JHVQMVC.js";
269
- import "./chunk-ZOYOXWJB.js";
270
- import {
271
- currentAttempt,
272
- withAttempt
273
- } from "./chunk-WMANRJR5.js";
274
- import "./chunk-GTKPMYK7.js";
275
- import {
276
- formatReference,
277
- isFolderProvider
278
- } from "./chunk-DSZYABYL.js";
279
- import "./chunk-73MOMNLL.js";
280
- import "./chunk-LAYYO4WD.js";
281
- import "./chunk-E745WZKY.js";
282
- import "./chunk-4N7PP76S.js";
283
- import {
284
- CLIENT_ID_MISSING,
285
- VERSION,
286
- ZM
287
- } from "./chunk-2SWKQ7C4.js";
288
- import {
289
- installerOf
290
- } from "./chunk-TXDR6YSF.js";
291
- import "./chunk-D72URWJE.js";
292
- import "./chunk-274SLQNW.js";
293
- import "./chunk-PWVJUIDQ.js";
294
- import "./chunk-G46WJ7YO.js";
295
- import "./chunk-GGMAIIVE.js";
296
- import {
297
- MEETING_COUNTS_GROUPINGS,
298
- RecordingSyncError,
299
- createMeetingManagement,
300
- createMeetingSeriesInventoryReader,
301
- createUpcomingMeetingReader,
302
- dispatchMeetingMutation,
303
- importFiles,
304
- installRecordingArchiveSchedule,
305
- meetingCountsItem,
306
- meetingLink,
307
- meetingLinkItem,
308
- meetingReviewItem,
309
- meetingSpeakerItem,
310
- meetingStatsItem,
311
- parseRecordingArchiveSchedule,
312
- parseRecordingSyncCheckpoint,
313
- parseTranscriptText,
314
- parseVtt,
315
- planRecordingArchiveSchedule,
316
- pull,
317
- recordingArchiveScheduleWindow,
318
- recordingWindows,
319
- strongRecordingValidator,
320
- syncRecordingArchive,
321
- transcriptLanguage,
322
- transferRecording,
323
- validateMeetingChange,
324
- validateMeetingContextChange,
325
- watchMeetingIngestion
326
- } from "./chunk-KKFY23AK.js";
327
- import {
328
- dateRange,
329
- defineQuery,
330
- queryFieldsOf,
331
- timezoneOf
332
- } from "./chunk-UAWSINMC.js";
333
- import "./chunk-DNCLQPOM.js";
334
- import {
335
- createDeadline,
336
- createOutputBuffer,
337
- createRenderer,
338
- fieldsOf,
339
- projectFields,
340
- realSleep
341
- } from "./chunk-6CWL5BKG.js";
342
- import {
343
- array,
344
- boolean,
345
- looseObject,
346
- optional,
347
- picklist,
348
- safeParse,
349
- string
350
- } from "./chunk-ESN3W2MZ.js";
351
- import "./chunk-Y5E2WNWB.js";
352
- import {
353
- CliError,
354
- isCliError
355
- } from "./chunk-IANKXHSE.js";
356
- import "./chunk-BBGJQMRI.js";
101
+ } from "./chunk-WSGD5Q6L.js";
357
102
  import {
358
103
  __name
359
- } from "./chunk-ZVVMGPBJ.js";
104
+ } from "./chunk-AEWYRB6F.js";
105
+
106
+ // dist/program.js
107
+ import { CliError as CliError49 } from "@wirecat/cli-base";
108
+ import { createProgram as sharedProgram } from "@wirecat/cli-core";
109
+
110
+ // dist/run.js
111
+ import { appCompleteCommand, appDoctorCommand, appMcpCommand, assertOverridesTighten, COMMAND_PATH_KEY, commandPermissions, DEFAULT_CONFIG, NONE_NAMED, permissionOverrides, runSettings, run as sharedRun } from "@wirecat/cli-core";
360
112
 
361
113
  // dist/first-screen.js
362
114
  import { fileURLToPath } from "node:url";
115
+ import { guideCommand, inSection, MEMO_SCENARIOS } from "@wirecat/cli-core";
363
116
  var SECTIONS = [
364
117
  [["events"], "read"],
365
118
  [["recordings"], "read"],
@@ -410,6 +163,15 @@ var ZOOM_FIRST_SCREEN = {
410
163
  start: "zm personal session start"
411
164
  };
412
165
 
166
+ // dist/program-bindings.js
167
+ import { CliError as CliError47, createDeadline, createOutputBuffer, createRenderer as createRenderer2, fieldsOf, isCliError as isCliError11, projectFields } from "@wirecat/cli-base";
168
+ import { commandRuns, environmentOf as environmentOf3, isBody, itemAnswer, meetingAnswerBody, pagingOf, runBudgetOf, snakeKeys, writesNewFileOnlyWith } from "@wirecat/cli-core";
169
+
170
+ // dist/agent-skill.js
171
+ import { annotate, customizeSharedCommand } from "@wirecat/cli-base/commands";
172
+ import { skillCommand } from "@wirecat/cli-base/skill";
173
+ import { grantsAuthority, LOCAL_WRITE, NO_EFFECTS, skillCommand as sharedSkillCommand } from "@wirecat/cli-core";
174
+
413
175
  // dist/contract-overrides.js
414
176
  var SHELL_OVERRIDES = {
415
177
  skill: [
@@ -449,7 +211,7 @@ var SHELL_OVERRIDES = {
449
211
  {
450
212
  command: ["search"],
451
213
  field: "description",
452
- before: "find things by text: one resource when you know it (messages, notes), or search all across messages and notes; for mail, the separate memo CLI: memo search mail",
214
+ before: "find things by text: one resource when you know it (messages, notes), or search all across messages and notes; for mail, wcat: wcat search mail",
453
215
  after: "opt-in shared store search; meetings by default",
454
216
  reason: "Zoom searches explicit local meeting and archive sources, with opt-in unified store reads rather than a live messenger backend."
455
217
  },
@@ -622,7 +384,7 @@ var addZoomSkillCommandsDefinition = /* @__PURE__ */ __name((program, environmen
622
384
  program.addCommand(annotate(command, { effects: NO_EFFECTS }));
623
385
  }, "addZoomSkillCommandsDefinition");
624
386
  var addZoomSkillCommands = /* @__PURE__ */ __name((...args) => {
625
- customizeSharedCommand(skillCommand2(ZM, new URL("../skills/zoom-cli/SKILL.md", new URL("../agent-skill.js", import.meta.url).href)), "Zoom installs its own meeting instructions through its source renderer and treats the packaged primary skill as effect-free.", () => {
387
+ customizeSharedCommand(sharedSkillCommand(ZM, new URL("../skills/zoom-cli/SKILL.md", new URL("../agent-skill.js", import.meta.url).href)), "Zoom installs its own meeting instructions through its source renderer and treats the packaged primary skill as effect-free.", () => {
626
388
  addZoomSkillCommandsDefinition(...args);
627
389
  const command = args[0].commands.find((command2) => command2.name() === "skill");
628
390
  if (!command)
@@ -631,14 +393,25 @@ var addZoomSkillCommands = /* @__PURE__ */ __name((...args) => {
631
393
  }, SHELL_OVERRIDES.skill);
632
394
  }, "addZoomSkillCommands");
633
395
 
396
+ // dist/archive-commands.js
397
+ import { CliError as CliError7 } from "@wirecat/cli-base";
398
+ import { annotate as annotate2 } from "@wirecat/cli-base/commands";
399
+ import { timezoneOf } from "@wirecat/cli-base/query";
400
+ import { FETCH, itemOf, LOCAL_READ, LOCAL_WRITE as LOCAL_WRITE2, listQuery, NO_EFFECTS as NO_EFFECTS2, REMOTE_READ, recordingWindows as recordingWindows2, typedQuery, unfilteredQuery, withQuery } from "@wirecat/cli-core";
401
+
634
402
  // dist/recording-archive.js
635
403
  import { lstat, mkdir, realpath as realpath2, unlink } from "node:fs/promises";
636
404
  import { join as join2 } from "node:path";
405
+ import { CliError as CliError4, isCliError as isCliError3 } from "@wirecat/cli-base";
406
+ import { retryableStatus, statusToCode as statusToCode2 } from "@wirecat/cli-base/http";
407
+ import { transferRecording, withAttempt } from "@wirecat/cli-core";
637
408
 
638
409
  // dist/recording-manifest.js
639
410
  import { createHash } from "node:crypto";
640
411
  import { readdir, realpath } from "node:fs/promises";
641
412
  import { join } from "node:path";
413
+ import { CliError, isCliError } from "@wirecat/cli-base";
414
+ import { openOrdinaryFile, writeFileAtomic } from "@wirecat/cli-core";
642
415
  var digest = /* @__PURE__ */ __name((text2) => createHash("sha256").update(text2).digest("hex"), "digest");
643
416
  var manifestName = /* @__PURE__ */ __name((uuid) => `.zoom-archive-${digest(uuid)}.json`, "manifestName");
644
417
  var filename = /* @__PURE__ */ __name((uuid, asset) => `${digest(uuid)}-${digest(asset.id ?? "")}.${/^(mp4|m4a|mp3|wav|vtt|txt|json)$/i.test(asset.format ?? "") ? asset.format?.toLowerCase() : "bin"}`, "filename");
@@ -789,10 +562,11 @@ var verifyArchive = /* @__PURE__ */ __name(async (destination, options = {}) =>
789
562
  }, "verifyArchive");
790
563
 
791
564
  // dist/recording-partial-store.js
792
- var operation = /* @__PURE__ */ __name(async (run3, signal) => {
565
+ import { NativeRecordingPartialStore } from "@wirecat/cli-core";
566
+ var operation = /* @__PURE__ */ __name(async (run2, signal) => {
793
567
  checkCancelled(signal);
794
568
  try {
795
- return await run3();
569
+ return await run2();
796
570
  } catch (error) {
797
571
  checkCancelled(signal);
798
572
  throw error;
@@ -822,6 +596,7 @@ var RecordingPartialStore = class extends NativeRecordingPartialStore {
822
596
  };
823
597
 
824
598
  // dist/recording-promotion-store.js
599
+ import { NativeRecordingPublication, strongRecordingValidator } from "@wirecat/cli-core";
825
600
  var scope = /* @__PURE__ */ __name((locator) => [
826
601
  locator.provider,
827
602
  locator.account,
@@ -870,11 +645,13 @@ var recordingPromotion = /* @__PURE__ */ __name((locator, meeting2, file, comple
870
645
  }), "recordingPromotion");
871
646
 
872
647
  // dist/recording-writer-lease.js
648
+ import { CliError as CliError2 } from "@wirecat/cli-base";
649
+ import { nativeWriterLeaseStore } from "@wirecat/cli-core";
873
650
  var writers = nativeWriterLeaseStore({ markerDirectory: ".zoom-archive-locks", legacyMarker: ".zoom-archive.lock" });
874
- var operation2 = /* @__PURE__ */ __name(async (run3, signal) => {
651
+ var operation2 = /* @__PURE__ */ __name(async (run2, signal) => {
875
652
  checkCancelled(signal);
876
653
  try {
877
- return await run3();
654
+ return await run2();
878
655
  } catch (error) {
879
656
  checkCancelled(signal);
880
657
  throw error;
@@ -885,14 +662,16 @@ var recoverArchiveLocks = /* @__PURE__ */ __name((destination, options = {}) =>
885
662
  var acquireArchiveWriter = /* @__PURE__ */ __name((destination, signal) => operation2(async () => {
886
663
  const ownership = await writers.acquire(destination, { signal });
887
664
  if (ownership.status === "busy")
888
- throw new CliError("validation_error", "archive is locked; inspect or recover stale local locks");
665
+ throw new CliError2("validation_error", "archive is locked; inspect or recover stale local locks");
889
666
  if (ownership.status === "legacy")
890
- throw new CliError("validation_error", "archive has an unrecognized legacy lock");
667
+ throw new CliError2("validation_error", "archive has an unrecognized legacy lock");
891
668
  return ownership.lease;
892
669
  }, signal), "acquireArchiveWriter");
893
670
 
894
671
  // dist/remote-http.js
895
672
  import { setTimeout } from "node:timers/promises";
673
+ import { CliError as CliError3, isCliError as isCliError2 } from "@wirecat/cli-base";
674
+ import { providerWaitMs, readJsonResponse, retrying, statusToCode } from "@wirecat/cli-base/http";
896
675
  var ZOOM_RETRY = { retries: 2, baseDelayMs: 250, maxDelayMs: 1e3, maxRetryAfterMs: 3e4 };
897
676
  var operationSignal = /* @__PURE__ */ __name((signal) => signal ?? AbortSignal.timeout(36e5), "operationSignal");
898
677
  var downloadTarget = /* @__PURE__ */ __name((input, what, base) => {
@@ -900,10 +679,10 @@ var downloadTarget = /* @__PURE__ */ __name((input, what, base) => {
900
679
  try {
901
680
  target = new URL(input, base);
902
681
  } catch {
903
- throw new CliError("invalid_response", `Zoom returned an unexpected ${what} download host`);
682
+ throw new CliError3("invalid_response", `Zoom returned an unexpected ${what} download host`);
904
683
  }
905
684
  if (target.protocol !== "https:" || target.username || target.password || target.port && target.port !== "443" || !/(^|\.)zoom\.(us|com)$/.test(target.hostname))
906
- throw new CliError("invalid_response", `Zoom returned an unexpected ${what} download host`);
685
+ throw new CliError3("invalid_response", `Zoom returned an unexpected ${what} download host`);
907
686
  return target;
908
687
  }, "downloadTarget");
909
688
  var ZoomRemote = class {
@@ -942,7 +721,7 @@ var ZoomRemote = class {
942
721
  return await this.fetcher(input, wire);
943
722
  } catch {
944
723
  checkCancelled(signal);
945
- throw new CliError("network_error", "Zoom request could not be completed", { retryable: true });
724
+ throw new CliError3("network_error", "Zoom request could not be completed", { retryable: true });
946
725
  }
947
726
  }, "send");
948
727
  const init = { headers: { authorization: `Bearer ${accessToken}` }, redirect: "manual", signal };
@@ -978,7 +757,7 @@ var ZoomRemote = class {
978
757
  const location = response.headers.get("location");
979
758
  await response.body?.cancel();
980
759
  if (!location || redirects >= 5)
981
- throw new CliError("invalid_response", `Zoom returned invalid ${what} redirects`);
760
+ throw new CliError3("invalid_response", `Zoom returned invalid ${what} redirects`);
982
761
  target = downloadTarget(location, what, target);
983
762
  }
984
763
  }
@@ -991,12 +770,12 @@ var ZoomRemote = class {
991
770
  async perform(path, scope2, options, missingCode) {
992
771
  const method = options.method ?? "GET";
993
772
  if (options.maxResponseBytes !== void 0 && (method !== "GET" || !Number.isSafeInteger(options.maxResponseBytes) || options.maxResponseBytes < 1))
994
- throw new CliError("validation_error", "maxResponseBytes requires GET and a positive safe integer");
773
+ throw new CliError3("validation_error", "maxResponseBytes requires GET and a positive safe integer");
995
774
  const signal = operationSignal(options.signal);
996
775
  checkCancelled(signal);
997
776
  const tokens = await this.tokens.tokens();
998
777
  if (![scope2, `${scope2}:admin`, `${scope2}:master`].some((grant) => tokens.scopes.includes(grant)))
999
- throw new CliError("configuration_error", `Zoom scope ${scope2} is missing; add it to the app and run zm <profile> session start again`);
778
+ throw new CliError3("configuration_error", `Zoom scope ${scope2} is missing; add it to the app and run zm <profile> session start again`);
1000
779
  checkCancelled(signal);
1001
780
  let response;
1002
781
  if (method === "GET")
@@ -1011,11 +790,11 @@ var ZoomRemote = class {
1011
790
  signal
1012
791
  });
1013
792
  } catch {
1014
- throw new CliError("outcome_unknown", "Zoom mutation did not finish; verify remote state before retrying");
793
+ throw new CliError3("outcome_unknown", "Zoom mutation did not finish; verify remote state before retrying");
1015
794
  }
1016
795
  }
1017
796
  if (method !== "GET" && signal.aborted)
1018
- throw new CliError("outcome_unknown", "Zoom mutation was interrupted after dispatch; verify remote state before retrying");
797
+ throw new CliError3("outcome_unknown", "Zoom mutation was interrupted after dispatch; verify remote state before retrying");
1019
798
  if (response.status === 204)
1020
799
  return {};
1021
800
  let value;
@@ -1024,26 +803,26 @@ var ZoomRemote = class {
1024
803
  } catch (error) {
1025
804
  if (method === "GET") {
1026
805
  checkCancelled(signal);
1027
- if (response.ok && isCliError(error))
806
+ if (response.ok && isCliError2(error))
1028
807
  throw error;
1029
808
  }
1030
809
  if (response.ok)
1031
- throw new CliError(method === "GET" ? "invalid_response" : "outcome_unknown", method === "GET" ? "Zoom returned an invalid response" : "Zoom mutation returned an invalid response; verify remote state before retrying");
810
+ throw new CliError3(method === "GET" ? "invalid_response" : "outcome_unknown", method === "GET" ? "Zoom returned an invalid response" : "Zoom mutation returned an invalid response; verify remote state before retrying");
1032
811
  value = {};
1033
812
  }
1034
813
  if (method !== "GET" && signal.aborted)
1035
- throw new CliError("outcome_unknown", "Zoom mutation was interrupted after dispatch; verify remote state before retrying");
814
+ throw new CliError3("outcome_unknown", "Zoom mutation was interrupted after dispatch; verify remote state before retrying");
1036
815
  const body = typeof value === "object" && value !== null && !Array.isArray(value) ? object(value) : {};
1037
816
  if (body.code === 4711)
1038
- throw new CliError("authentication_error", `Zoom scope ${scope2} is missing; add it to the app and run zm <profile> session start again`);
817
+ throw new CliError3("authentication_error", `Zoom scope ${scope2} is missing; add it to the app and run zm <profile> session start again`);
1039
818
  if (response.status === 404 && missingCode !== void 0 && body.code === missingCode)
1040
819
  return null;
1041
820
  if (!response.ok || typeof body.code === "number" && body.code !== 0)
1042
- throw new CliError(body.code === 200 ? "permission_error" : statusToCode(response.status), `Zoom request failed (HTTP ${response.status}${typeof body.code === "number" ? `, code ${body.code}` : ""})`);
821
+ throw new CliError3(body.code === 200 ? "permission_error" : statusToCode(response.status), `Zoom request failed (HTTP ${response.status}${typeof body.code === "number" ? `, code ${body.code}` : ""})`);
1043
822
  try {
1044
823
  return object(value);
1045
824
  } catch {
1046
- throw new CliError(method === "GET" ? "invalid_response" : "outcome_unknown", method === "GET" ? "Zoom returned an invalid response" : "Zoom mutation returned an invalid response; verify remote state before retrying");
825
+ throw new CliError3(method === "GET" ? "invalid_response" : "outcome_unknown", method === "GET" ? "Zoom returned an invalid response" : "Zoom mutation returned an invalid response; verify remote state before retrying");
1047
826
  }
1048
827
  }
1049
828
  };
@@ -1052,23 +831,23 @@ var ZoomRemote = class {
1052
831
  var validateDownloadOptions = /* @__PURE__ */ __name((options) => {
1053
832
  const maxBytes2 = options.maxBytes === void 0 ? 20 * 1024 ** 3 : options.maxBytes;
1054
833
  if (typeof options.destination !== "string" || !options.destination.trim() || !Number.isSafeInteger(maxBytes2) || maxBytes2 <= 0)
1055
- throw new CliError("validation_error", "archive destination and positive download limit are required");
834
+ throw new CliError4("validation_error", "archive destination and positive download limit are required");
1056
835
  if (options.resume !== void 0 && typeof options.resume !== "boolean")
1057
- throw new CliError("validation_error", "recording resume must be a boolean");
836
+ throw new CliError4("validation_error", "recording resume must be a boolean");
1058
837
  if (typeof options.account !== "string" || !options.account.trim() || /[\0\r\n]/.test(options.account) || options.account.length > 1e3)
1059
- throw new CliError("validation_error", "recording account scope must be a nonempty identifier");
838
+ throw new CliError4("validation_error", "recording account scope must be a nonempty identifier");
1060
839
  if (options.fileIds !== void 0 && (!Array.isArray(options.fileIds) || options.fileIds.length === 0 || options.fileIds.some((id) => typeof id !== "string" || !id.trim())))
1061
- throw new CliError("validation_error", "recording selection must contain nonempty file ids");
840
+ throw new CliError4("validation_error", "recording selection must contain nonempty file ids");
1062
841
  return maxBytes2;
1063
842
  }, "validateDownloadOptions");
1064
843
  var missing2 = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missing");
1065
- var DownloadFailure = class extends CliError {
844
+ var DownloadFailure = class extends CliError4 {
1066
845
  static {
1067
846
  __name(this, "DownloadFailure");
1068
847
  }
1069
848
  response;
1070
849
  constructor(response) {
1071
- super(statusToCode(response.status), `Recording download failed (HTTP ${response.status})`);
850
+ super(statusToCode2(response.status), `Recording download failed (HTTP ${response.status})`);
1072
851
  this.response = response;
1073
852
  }
1074
853
  };
@@ -1084,7 +863,7 @@ var transferSource = /* @__PURE__ */ __name((remote, url, accessToken, format, s
1084
863
  },
1085
864
  unreachable: /* @__PURE__ */ __name(() => {
1086
865
  checkCancelled(signal);
1087
- return new CliError("network_error", "Recording download could not be completed");
866
+ return new CliError4("network_error", "Recording download could not be completed");
1088
867
  }, "unreachable")
1089
868
  });
1090
869
  if (![200, 206, 416].includes(response.status)) {
@@ -1093,7 +872,7 @@ var transferSource = /* @__PURE__ */ __name((remote, url, accessToken, format, s
1093
872
  }
1094
873
  if (response.status !== 416 && (!response.body || /\btext\/html\b/i.test(response.headers.get("content-type") ?? "") || format?.toUpperCase() !== "JSON" && /\bapplication\/json\b/i.test(response.headers.get("content-type") ?? "") || ![null, "identity"].includes(response.headers.get("content-encoding")))) {
1095
874
  await response.body?.cancel();
1096
- throw new CliError("invalid_response", "Zoom returned an unexpected recording body");
875
+ throw new CliError4("invalid_response", "Zoom returned an unexpected recording body");
1097
876
  }
1098
877
  const reader = response.body?.getReader();
1099
878
  const abortReader = /* @__PURE__ */ __name(() => {
@@ -1116,7 +895,7 @@ var transferSource = /* @__PURE__ */ __name((remote, url, accessToken, format, s
1116
895
  chunk = await reader.read();
1117
896
  } catch {
1118
897
  checkCancelled(signal);
1119
- throw new CliError("network_error", "Recording download could not be completed");
898
+ throw new CliError4("network_error", "Recording download could not be completed");
1120
899
  }
1121
900
  checkCancelled(signal);
1122
901
  if (chunk.done)
@@ -1138,7 +917,7 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1138
917
  checkCancelled(signal);
1139
918
  const maxBytes2 = validateDownloadOptions(options);
1140
919
  if (options.fileIds?.some((id) => !meeting2.assets.some((asset) => asset.id === id)))
1141
- throw new CliError("validation_error", "requested recording file was not found");
920
+ throw new CliError4("validation_error", "requested recording file was not found");
1142
921
  let lock;
1143
922
  try {
1144
923
  await mkdir(options.destination, { recursive: true });
@@ -1175,7 +954,7 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1175
954
  const unchanged = seen !== void 0 && stat2?.isFile() === true && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs && seen.sha256 === existing.sha256;
1176
955
  const local = unchanged ? { size: seen.size, sha256: seen.sha256 } : await fingerprint(join2(root, existing.path), signal);
1177
956
  if (existing.path !== path || existing.remoteSize !== asset.size || existing.startedAt !== asset.startedAt || existing.endedAt !== asset.endedAt || existing.size !== local.size || existing.sha256 !== local.sha256)
1178
- throw new CliError("validation_error", "existing recording has changed; choose a new archive destination");
957
+ throw new CliError4("validation_error", "existing recording has changed; choose a new archive destination");
1179
958
  if (!unchanged)
1180
959
  await remember(existing.path, existing.sha256);
1181
960
  report.skipped.push(existing);
@@ -1215,7 +994,7 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1215
994
  }
1216
995
  if (present) {
1217
996
  if (!persistent)
1218
- throw new CliError("validation_error", "recording path already exists without a verified manifest or scoped recovery record");
997
+ throw new CliError4("validation_error", "recording path already exists without a verified manifest or scoped recovery record");
1219
998
  const intent = await publication.recover(storage.path, () => storage.load(locator), async (value) => {
1220
999
  manifest.files.push(value.file);
1221
1000
  await writeManifest(root, manifest);
@@ -1233,14 +1012,14 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1233
1012
  const transferred = await withAttempt({ attempt: attempt + 1, ...waitMs === void 0 ? {} : { waitMs } }, () => transferRecording(transferSource(remote, urls.get(id) ?? "", tokens.accessToken, format, signal), storage, { locator, maxBytes: maxBytes2, expectedSize: asset.size, signal }));
1234
1013
  entry = { ...metadata, size: transferred.size, sha256: transferred.sha256 };
1235
1014
  if (asset.size !== null && entry.size !== asset.size)
1236
- throw new CliError("invalid_response", "recording download size does not match Zoom metadata");
1015
+ throw new CliError4("invalid_response", "recording download size does not match Zoom metadata");
1237
1016
  checkCancelled(signal);
1238
1017
  if (persistent && storage.completed)
1239
1018
  await publication.write(recordingPromotion(locator, promotionMeeting, entry, storage.completed));
1240
1019
  checkCancelled(signal);
1241
1020
  await publication.publish(temp, entry, async () => {
1242
1021
  if (!entry)
1243
- throw new CliError("invalid_response", "recording transfer did not produce a verified receipt");
1022
+ throw new CliError4("invalid_response", "recording transfer did not produce a verified receipt");
1244
1023
  manifest.files.push(entry);
1245
1024
  await writeManifest(root, manifest);
1246
1025
  });
@@ -1249,7 +1028,7 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1249
1028
  if (!persistent)
1250
1029
  await unlink(temp).catch(() => void 0);
1251
1030
  checkCancelled(signal);
1252
- const retryable = error instanceof DownloadFailure ? retryableStatus(error.response.status) : isCliError(error) && error.code === "network_error";
1031
+ const retryable = error instanceof DownloadFailure ? retryableStatus(error.response.status) : isCliError3(error) && error.code === "network_error";
1253
1032
  if (attempt >= 2 || !retryable)
1254
1033
  throw error;
1255
1034
  const paused = performance.now();
@@ -1259,7 +1038,7 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1259
1038
  }
1260
1039
  }
1261
1040
  if (!entry)
1262
- throw new CliError("invalid_response", "recording transfer did not produce a verified receipt");
1041
+ throw new CliError4("invalid_response", "recording transfer did not produce a verified receipt");
1263
1042
  await remember(entry.path, entry.sha256);
1264
1043
  report.downloaded.push(entry);
1265
1044
  }
@@ -1270,9 +1049,9 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1270
1049
  return report;
1271
1050
  } catch (error) {
1272
1051
  checkCancelled(signal);
1273
- if (isCliError(error))
1052
+ if (isCliError3(error))
1274
1053
  throw error;
1275
- throw new CliError("provider_error", "archive operation could not be completed");
1054
+ throw new CliError4("provider_error", "archive operation could not be completed");
1276
1055
  } finally {
1277
1056
  await lock?.release();
1278
1057
  }
@@ -1281,32 +1060,36 @@ var archiveRecording = /* @__PURE__ */ __name(async (remote, meeting2, urls, opt
1281
1060
  // dist/recording-sync.js
1282
1061
  import { createHash as createHash2 } from "node:crypto";
1283
1062
  import { join as join4, resolve as resolve2 } from "node:path";
1063
+ import { CliError as CliError6 } from "@wirecat/cli-base";
1064
+ import { RecordingSyncError, recordingWindows, syncRecordingArchive as syncArchive } from "@wirecat/cli-core";
1284
1065
 
1285
1066
  // dist/recording-sync-store.js
1286
1067
  import { randomUUID } from "node:crypto";
1287
1068
  import { lstat as lstat2, mkdir as mkdir2, open, rmdir, unlink as unlink2 } from "node:fs/promises";
1288
1069
  import { hostname } from "node:os";
1289
1070
  import { dirname, join as join3, resolve } from "node:path";
1071
+ import { CliError as CliError5 } from "@wirecat/cli-base";
1072
+ import { openOrdinaryFile as openOrdinaryFile2, parseRecordingSyncCheckpoint, writeFileAtomic as writeFileAtomic2 } from "@wirecat/cli-core";
1290
1073
  var maxBytes = 8 * 1024 ** 2;
1291
1074
  var ownerByteLimit = 32 * 1024;
1292
1075
  var code = /* @__PURE__ */ __name((error) => error?.code, "code");
1293
1076
  var conflict = /* @__PURE__ */ __name((message) => {
1294
- throw new CliError("configuration_error", message);
1077
+ throw new CliError5("configuration_error", message);
1295
1078
  }, "conflict");
1296
1079
  var boundedJson = /* @__PURE__ */ __name(async (path, limit) => {
1297
- const file = await openOrdinaryFile(path);
1080
+ const file = await openOrdinaryFile2(path);
1298
1081
  try {
1299
1082
  const size = (await file.stat()).size;
1300
1083
  if (size > limit)
1301
- throw new CliError("validation_error", "archive checkpoint exceeds its byte limit");
1084
+ throw new CliError5("validation_error", "archive checkpoint exceeds its byte limit");
1302
1085
  const content = Buffer.alloc(size + 1);
1303
1086
  const { bytesRead } = await file.read(content, 0, content.length, 0);
1304
1087
  if (bytesRead !== size || bytesRead > limit)
1305
- throw new CliError("validation_error", "archive checkpoint changed while reading");
1088
+ throw new CliError5("validation_error", "archive checkpoint changed while reading");
1306
1089
  try {
1307
1090
  return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(content.subarray(0, bytesRead)));
1308
1091
  } catch {
1309
- throw new CliError("validation_error", "archive checkpoint contains invalid JSON");
1092
+ throw new CliError5("validation_error", "archive checkpoint contains invalid JSON");
1310
1093
  }
1311
1094
  } finally {
1312
1095
  await file.close();
@@ -1330,11 +1113,11 @@ var alive = /* @__PURE__ */ __name((pid) => {
1330
1113
  }, "alive");
1331
1114
  function fileRecordingSyncCheckpointStore(path) {
1332
1115
  if (typeof path !== "string" || !path.trim())
1333
- throw new CliError("validation_error", "archive checkpoint path is required");
1116
+ throw new CliError5("validation_error", "archive checkpoint path is required");
1334
1117
  const checkpointPath2 = resolve(path);
1335
- const lockPath2 = `${checkpointPath2}.lock`;
1336
- const marker = join3(lockPath2, "owner.json");
1337
- const recoveryPath = `${lockPath2}.recovery`;
1118
+ const lockPath = `${checkpointPath2}.lock`;
1119
+ const marker = join3(lockPath, "owner.json");
1120
+ const recoveryPath = `${lockPath}.recovery`;
1338
1121
  const owners = /* @__PURE__ */ new Map();
1339
1122
  const readOwner = /* @__PURE__ */ __name(async () => {
1340
1123
  try {
@@ -1363,14 +1146,14 @@ function fileRecordingSyncCheckpointStore(path) {
1363
1146
  return {
1364
1147
  async acquire(jobId) {
1365
1148
  if (typeof jobId !== "string" || !jobId.trim() || jobId.length > 4096)
1366
- throw new CliError("validation_error", "archive checkpoint job id is required");
1149
+ throw new CliError5("validation_error", "archive checkpoint job id is required");
1367
1150
  await mkdir2(dirname(checkpointPath2), { recursive: true, mode: 448 });
1368
1151
  try {
1369
- await mkdir2(lockPath2, { mode: 448 });
1152
+ await mkdir2(lockPath, { mode: 448 });
1370
1153
  } catch (error) {
1371
1154
  if (code(error) !== "EEXIST")
1372
1155
  throw error;
1373
- const folder = await lstat2(lockPath2);
1156
+ const folder = await lstat2(lockPath);
1374
1157
  if (!folder.isDirectory() || folder.isSymbolicLink())
1375
1158
  return conflict("archive checkpoint lock must be an ordinary directory");
1376
1159
  try {
@@ -1388,8 +1171,8 @@ function fileRecordingSyncCheckpointStore(path) {
1388
1171
  if (verified.token !== prior.token)
1389
1172
  return conflict("archive checkpoint lock changed during stale recovery");
1390
1173
  await unlink2(marker);
1391
- await rmdir(lockPath2);
1392
- await mkdir2(lockPath2, { mode: 448 });
1174
+ await rmdir(lockPath);
1175
+ await mkdir2(lockPath, { mode: 448 });
1393
1176
  } finally {
1394
1177
  await rmdir(recoveryPath);
1395
1178
  }
@@ -1408,7 +1191,7 @@ function fileRecordingSyncCheckpointStore(path) {
1408
1191
  async release() {
1409
1192
  await own(jobId, owner.token);
1410
1193
  await unlink2(marker);
1411
- await rmdir(lockPath2);
1194
+ await rmdir(lockPath);
1412
1195
  owners.delete(owner.token);
1413
1196
  }
1414
1197
  };
@@ -1425,8 +1208,8 @@ function fileRecordingSyncCheckpointStore(path) {
1425
1208
  return conflict("archive checkpoint revision changed");
1426
1209
  const content = JSON.stringify(state);
1427
1210
  if (Buffer.byteLength(content) > maxBytes)
1428
- throw new CliError("validation_error", "archive checkpoint exceeds its byte limit");
1429
- await writeFileAtomic(checkpointPath2, content, {
1211
+ throw new CliError5("validation_error", "archive checkpoint exceeds its byte limit");
1212
+ await writeFileAtomic2(checkpointPath2, content, {
1430
1213
  beforePublish: /* @__PURE__ */ __name(() => own(jobId, token), "beforePublish")
1431
1214
  });
1432
1215
  }
@@ -1444,7 +1227,7 @@ var inspectRecordingSyncCheckpoint = /* @__PURE__ */ __name(async (path) => {
1444
1227
  }, "inspectRecordingSyncCheckpoint");
1445
1228
 
1446
1229
  // dist/recording-sync.js
1447
- async function* syncRecordingArchive2(recordings, input) {
1230
+ async function* syncRecordingArchive(recordings, input) {
1448
1231
  const options = { ...input };
1449
1232
  let signal;
1450
1233
  try {
@@ -1452,16 +1235,16 @@ async function* syncRecordingArchive2(recordings, input) {
1452
1235
  const maxBytes2 = validateDownloadOptions(options);
1453
1236
  const resume = options.resume === true;
1454
1237
  if (!resume && (options.checkpointPath !== void 0 || options.checkpointStore !== void 0))
1455
- throw new CliError("validation_error", "archive checkpoints require resume mode");
1238
+ throw new CliError6("validation_error", "archive checkpoints require resume mode");
1456
1239
  if (options.checkpointPath !== void 0 && (typeof options.checkpointPath !== "string" || !options.checkpointPath.trim()))
1457
- throw new CliError("validation_error", "archive checkpoint path is required");
1240
+ throw new CliError6("validation_error", "archive checkpoint path is required");
1458
1241
  const account = options.account;
1459
1242
  signal = operationSignal(options.signal);
1460
1243
  checkCancelled(signal);
1461
1244
  const catalog = recordings.catalog(account);
1462
1245
  const configKey = createHash2("sha256").update(JSON.stringify({ version: 1, destination: resolve2(options.destination), maxBytes: maxBytes2 })).digest("hex");
1463
1246
  const checkpointStore = resume ? options.checkpointStore ?? fileRecordingSyncCheckpointStore(options.checkpointPath ?? join4(options.destination, ".zoom-archive-sync.json")) : void 0;
1464
- const receipts = syncRecordingArchive(catalog, {
1247
+ const receipts = syncArchive(catalog, {
1465
1248
  scope: { provider: "zoom", account },
1466
1249
  from: options.from,
1467
1250
  to: options.to,
@@ -1497,31 +1280,31 @@ async function* syncRecordingArchive2(recordings, input) {
1497
1280
  throw error;
1498
1281
  }
1499
1282
  }
1500
- __name(syncRecordingArchive2, "syncRecordingArchive");
1283
+ __name(syncRecordingArchive, "syncRecordingArchive");
1501
1284
 
1502
1285
  // dist/archive-commands.js
1503
- var label = /* @__PURE__ */ __name((command, example, effects) => annotate(command, { origin: "handwritten", effects, examples: Array.isArray(example) ? example : [example] }), "label");
1286
+ var label = /* @__PURE__ */ __name((command, example, effects) => annotate2(command, { origin: "handwritten", effects, examples: Array.isArray(example) ? example : [example] }), "label");
1504
1287
  var positive = /* @__PURE__ */ __name((text2) => {
1505
1288
  const value = bytes(text2);
1506
1289
  if (value === 0)
1507
- throw new CliError("validation_error", "expected a positive number");
1290
+ throw new CliError7("validation_error", "expected a positive number");
1508
1291
  return value;
1509
1292
  }, "positive");
1510
1293
  var discoveryLimit = /* @__PURE__ */ __name((text2) => {
1511
1294
  const value = positive(text2);
1512
1295
  if (value > 1e4)
1513
- throw new CliError("validation_error", "archive discovery limit must be between 1 and 10000");
1296
+ throw new CliError7("validation_error", "archive discovery limit must be between 1 and 10000");
1514
1297
  return value;
1515
1298
  }, "discoveryLimit");
1516
1299
  var archiveScope = /* @__PURE__ */ __name((deps, options) => {
1517
1300
  const account = deps.account();
1518
1301
  if (!account)
1519
- throw new CliError("configuration_error", "recording archives belong to a profile: `zm <profile> recordings \u2026`");
1302
+ throw new CliError7("configuration_error", "recording archives belong to a profile: `zm <profile> recordings \u2026`");
1520
1303
  const resume = options.resume ?? true;
1521
1304
  if (options.checkpoint !== void 0 && !resume)
1522
- throw new CliError("validation_error", "archive checkpoints require resume mode; remove --no-resume");
1305
+ throw new CliError7("validation_error", "archive checkpoints require resume mode; remove --no-resume");
1523
1306
  if (options.checkpoint !== void 0 && !options.checkpoint.trim())
1524
- throw new CliError("validation_error", "archive checkpoint path must be nonempty");
1307
+ throw new CliError7("validation_error", "archive checkpoint path must be nonempty");
1525
1308
  return { account, resume };
1526
1309
  }, "archiveScope");
1527
1310
  var resumable = /* @__PURE__ */ __name((command) => command.option("--resume", "resume verified partial downloads and archive progress; requires a local profile").option("--no-resume", "disable persistent resume state for this invocation"), "resumable");
@@ -1529,12 +1312,12 @@ var localZone = /* @__PURE__ */ __name((given) => {
1529
1312
  try {
1530
1313
  return timezoneOf(given);
1531
1314
  } catch {
1532
- throw new CliError("validation_error", "--timezone must be an IANA timezone such as Europe/Madrid");
1315
+ throw new CliError7("validation_error", "--timezone must be an IANA timezone such as Europe/Madrid");
1533
1316
  }
1534
1317
  }, "localZone");
1535
1318
  var localDay = /* @__PURE__ */ __name((now, zone) => new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(now), "localDay");
1536
1319
  var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1537
- const recordings = annotate(program.command("recordings"), { effects: NO_EFFECTS }).description("cloud recording assets and verified local archives");
1320
+ const recordings = annotate2(program.command("recordings"), { effects: NO_EFFECTS2 }).description("cloud recording assets and verified local archives");
1538
1321
  const recordingsQuery = unfilteredQuery("zoom_recording", ZOOM_ANSWER_ENTITIES["recordings list"].schema);
1539
1322
  label(withQuery(recordings.command("list"), recordingsQuery).description("list cloud recording occurrences (last 30 days by default)").option("--since-time <time>", "first day, YYYY-MM-DD").option("--until-time <time>", "last day, YYYY-MM-DD (default today in --timezone)").option("--timezone <zone>", "IANA timezone of today (default the computer's)").action(async (words, options) => {
1540
1323
  listQuery(typedQuery(words), recordingsQuery, "recordings list");
@@ -1543,7 +1326,7 @@ var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1543
1326
  const to = options.untilTime ?? localDay(deps.now(), zone);
1544
1327
  const end2 = Date.parse(`${to}T00:00:00Z`);
1545
1328
  if (!/^\d{4}-\d{2}-\d{2}$/.test(to) || !Number.isFinite(end2) || new Date(end2).toISOString().slice(0, 10) !== to)
1546
- throw new CliError("validation_error", "--until-time must be a real YYYY-MM-DD date");
1329
+ throw new CliError7("validation_error", "--until-time must be a real YYYY-MM-DD date");
1547
1330
  const from = options.sinceTime ?? new Date(end2 - 30 * 864e5).toISOString().slice(0, 10);
1548
1331
  const list = wholeList("recordings list", await deps.recordings().list({ from, to, signal: deps.signal() }));
1549
1332
  deps.output(options.untilTime === void 0 ? { ...list, meta: { timezone: zone } } : list);
@@ -1555,7 +1338,7 @@ var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1555
1338
  label(resumable(runsLong(recordings.command("download")).description("download one recording or a date range into a verified, resumable archive").argument("[meeting]", "meeting id or occurrence UUID; omit when downloading a date range").requiredOption("--output-dir <dir>", "explicit archive directory").option("--since-time <time>", "first day of a date range, YYYY-MM-DD").option("--until-time <time>", "last day of a date range, YYYY-MM-DD; at most ten years after the first").option("--file-ids <ids>", "comma-separated recording file ids; only with a meeting").option("--max-bytes <bytes>", "per-file download byte limit (default 20 GiB)", positive)).option("--checkpoint <file>", "date-range checkpoint file; implies resume").option("--recheck-since-time <time>", "look again from this day for late recordings in a date range").option("--max-pages <pages>", "date-range catalog page limit from 1 through 10000 (default 1000)", discoveryLimit).option("--max-entries <n>", "date-range occurrence limit from 1 through 10000 (default 10000)", discoveryLimit).action(async (id, options) => {
1556
1339
  if (id !== void 0) {
1557
1340
  if (!id.trim() || id.includes("\0"))
1558
- throw new CliError("validation_error", "a meeting id or occurrence UUID is required");
1341
+ throw new CliError7("validation_error", "a meeting id or occurrence UUID is required");
1559
1342
  if ([
1560
1343
  options.sinceTime,
1561
1344
  options.untilTime,
@@ -1564,7 +1347,7 @@ var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1564
1347
  options.maxPages,
1565
1348
  options.maxEntries
1566
1349
  ].some((value) => value !== void 0))
1567
- throw new CliError("validation_error", "choose one meeting or date-range options, not both");
1350
+ throw new CliError7("validation_error", "choose one meeting or date-range options, not both");
1568
1351
  const request = {
1569
1352
  destination: options.outputDir,
1570
1353
  fileIds: options.fileIds?.split(",").map((one) => one.trim()),
@@ -1578,16 +1361,16 @@ var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1578
1361
  return;
1579
1362
  }
1580
1363
  if (options.sinceTime === void 0 || options.untilTime === void 0)
1581
- throw new CliError("validation_error", "provide a meeting id or both --since-time and --until-time");
1364
+ throw new CliError7("validation_error", "provide a meeting id or both --since-time and --until-time");
1582
1365
  if (options.fileIds !== void 0)
1583
- throw new CliError("validation_error", "--file-ids selects assets of one meeting; provide a meeting id");
1366
+ throw new CliError7("validation_error", "--file-ids selects assets of one meeting; provide a meeting id");
1584
1367
  const scope2 = archiveScope(deps, options);
1585
- recordingWindows(options.sinceTime, options.untilTime);
1368
+ recordingWindows2(options.sinceTime, options.untilTime);
1586
1369
  if (options.recheckSinceTime !== void 0)
1587
- recordingWindows(options.recheckSinceTime, options.recheckSinceTime);
1370
+ recordingWindows2(options.recheckSinceTime, options.recheckSinceTime);
1588
1371
  validateDownloadOptions({ destination: options.outputDir, maxBytes: options.maxBytes, ...scope2 });
1589
1372
  deps.api();
1590
- const receipts = syncRecordingArchive2(deps.recordings(), {
1373
+ const receipts = syncRecordingArchive(deps.recordings(), {
1591
1374
  from: options.sinceTime,
1592
1375
  to: options.untilTime,
1593
1376
  destination: options.outputDir,
@@ -1609,7 +1392,7 @@ var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1609
1392
  "zm personal recordings download example-occurrence --output-dir ./zoom-archive --dry-run --json",
1610
1393
  "zm personal recordings download --since-time 2026-01-01 --until-time 2026-10-10 --output-dir ./zoom-archive --dry-run --jsonl"
1611
1394
  ], FETCH);
1612
- const archive = annotate(recordings.command("archive"), { effects: NO_EFFECTS }).description("inspect archives without Zoom or a database");
1395
+ const archive = annotate2(recordings.command("archive"), { effects: NO_EFFECTS2 }).description("inspect archives without Zoom or a database");
1613
1396
  const transcriptOptions = /* @__PURE__ */ __name((command) => command.option("--uuid <uuid>", "select an occurrence UUID").option("--file-ids <ids>", "select comma-separated transcript asset ids").option("--max-bytes <bytes>", "largest transcript file to read, in bytes (default 8 MiB)", positive), "transcriptOptions");
1614
1397
  const selected = /* @__PURE__ */ __name((options) => ({
1615
1398
  uuid: options.uuid,
@@ -1626,38 +1409,40 @@ var addArchiveCommands = /* @__PURE__ */ __name((program, deps) => {
1626
1409
  label(archive.command("recover").description("preview removing stale locks; --yes removes them").argument("<directory>", "archive folder").option("--yes", "remove recognized locks left by a dead local process").option("--dry-run", "preview only, including when --yes is present").action(async (directory, options) => deps.output(itemOf(await deps.archive.recover(directory, {
1627
1410
  apply: options.yes === true && !options.dryRun,
1628
1411
  signal: deps.signal()
1629
- })))), "zm personal recordings archive recover ./zoom-archive --dry-run --json", LOCAL_WRITE);
1412
+ })))), "zm personal recordings archive recover ./zoom-archive --dry-run --json", LOCAL_WRITE2);
1630
1413
  }, "addArchiveCommands");
1631
1414
 
1632
1415
  // dist/archive-transcripts.js
1633
1416
  import { createHash as createHash3 } from "node:crypto";
1634
1417
  import { realpath as realpath3 } from "node:fs/promises";
1635
1418
  import { join as join5 } from "node:path";
1419
+ import { CliError as CliError8, isCliError as isCliError4 } from "@wirecat/cli-base";
1420
+ import { openOrdinaryFile as openOrdinaryFile3, parseVtt } from "@wirecat/cli-core";
1636
1421
  var validate = /* @__PURE__ */ __name((destination, options) => {
1637
1422
  const maxBytes2 = options.maxBytes === void 0 ? 8 * 1024 ** 2 : options.maxBytes;
1638
1423
  if (typeof destination !== "string" || !destination.trim() || !Number.isSafeInteger(maxBytes2) || maxBytes2 <= 0)
1639
- throw new CliError("validation_error", "archive destination and positive transcript byte limit are required");
1424
+ throw new CliError8("validation_error", "archive destination and positive transcript byte limit are required");
1640
1425
  if (options.uuid !== void 0 && (typeof options.uuid !== "string" || !options.uuid.trim()))
1641
- throw new CliError("validation_error", "archive occurrence UUID must be nonempty");
1426
+ throw new CliError8("validation_error", "archive occurrence UUID must be nonempty");
1642
1427
  if (options.fileIds !== void 0 && (!Array.isArray(options.fileIds) || options.fileIds.length === 0 || options.fileIds.some((id) => typeof id !== "string" || !id.trim())))
1643
- throw new CliError("validation_error", "archive transcript selection must contain nonempty file ids");
1428
+ throw new CliError8("validation_error", "archive transcript selection must contain nonempty file ids");
1644
1429
  return maxBytes2;
1645
1430
  }, "validate");
1646
1431
  var readTranscript = /* @__PURE__ */ __name(async (destination, asset, maxBytes2, signal) => {
1647
1432
  checkCancelled(signal);
1648
1433
  if (asset.size > maxBytes2)
1649
- throw new CliError("validation_error", "archive transcript exceeds the byte limit");
1434
+ throw new CliError8("validation_error", "archive transcript exceeds the byte limit");
1650
1435
  try {
1651
- const file = await openOrdinaryFile(join5(destination, asset.path));
1436
+ const file = await openOrdinaryFile3(join5(destination, asset.path));
1652
1437
  try {
1653
1438
  checkCancelled(signal);
1654
1439
  const stat2 = await file.stat();
1655
1440
  if (!stat2.isFile())
1656
- throw new CliError("validation_error", "archive transcript must be an ordinary file");
1441
+ throw new CliError8("validation_error", "archive transcript must be an ordinary file");
1657
1442
  if (stat2.size > maxBytes2)
1658
- throw new CliError("validation_error", "archive transcript exceeds the byte limit");
1443
+ throw new CliError8("validation_error", "archive transcript exceeds the byte limit");
1659
1444
  if (stat2.size !== asset.size)
1660
- throw new CliError("validation_error", "archive transcript failed size verification");
1445
+ throw new CliError8("validation_error", "archive transcript failed size verification");
1661
1446
  const hash = createHash3("sha256");
1662
1447
  const chunks = [];
1663
1448
  let size = 0;
@@ -1670,37 +1455,37 @@ var readTranscript = /* @__PURE__ */ __name(async (destination, asset, maxBytes2
1670
1455
  break;
1671
1456
  size += bytesRead;
1672
1457
  if (size > maxBytes2)
1673
- throw new CliError("validation_error", "archive transcript exceeds the byte limit");
1458
+ throw new CliError8("validation_error", "archive transcript exceeds the byte limit");
1674
1459
  const chunk = buffer.subarray(0, bytesRead);
1675
1460
  hash.update(chunk);
1676
1461
  chunks.push(chunk);
1677
1462
  }
1678
1463
  if (size !== asset.size || hash.digest("hex") !== asset.sha256)
1679
- throw new CliError("validation_error", "archive transcript failed checksum verification");
1464
+ throw new CliError8("validation_error", "archive transcript failed checksum verification");
1680
1465
  let text2;
1681
1466
  try {
1682
1467
  text2 = new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks, size));
1683
1468
  } catch {
1684
- throw new CliError("validation_error", "archive transcript is not valid UTF-8");
1469
+ throw new CliError8("validation_error", "archive transcript is not valid UTF-8");
1685
1470
  }
1686
1471
  try {
1687
1472
  return parseVtt(text2);
1688
1473
  } catch {
1689
- throw new CliError("validation_error", "archive transcript is not valid WebVTT");
1474
+ throw new CliError8("validation_error", "archive transcript is not valid WebVTT");
1690
1475
  }
1691
1476
  } finally {
1692
1477
  await file.close();
1693
1478
  }
1694
1479
  } catch (error) {
1695
1480
  checkCancelled(signal);
1696
- if (isCliError(error))
1481
+ if (isCliError4(error))
1697
1482
  throw error;
1698
1483
  const code2 = typeof error === "object" && error !== null && "code" in error ? error.code : null;
1699
1484
  if (code2 === "ENOENT")
1700
- throw new CliError("not_found", "archive transcript file was not found");
1485
+ throw new CliError8("not_found", "archive transcript file was not found");
1701
1486
  if (code2 === "ELOOP")
1702
- throw new CliError("validation_error", "archive transcript must not be a symlink");
1703
- throw new CliError("configuration_error", "archive transcript could not be read");
1487
+ throw new CliError8("validation_error", "archive transcript must not be a symlink");
1488
+ throw new CliError8("configuration_error", "archive transcript could not be read");
1704
1489
  }
1705
1490
  }, "readTranscript");
1706
1491
  async function* readArchiveTranscripts(destination, options = {}) {
@@ -1711,15 +1496,15 @@ async function* readArchiveTranscripts(destination, options = {}) {
1711
1496
  root = await realpath3(destination);
1712
1497
  } catch {
1713
1498
  checkCancelled(options.signal);
1714
- throw new CliError("configuration_error", "archive destination could not be read");
1499
+ throw new CliError8("configuration_error", "archive destination could not be read");
1715
1500
  }
1716
1501
  const manifests = await inspectArchive(root, { signal: options.signal });
1717
1502
  const selected = options.uuid === void 0 ? manifests : manifests.filter((item) => item.meeting.uuid === options.uuid);
1718
1503
  if (options.uuid !== void 0 && selected.length === 0)
1719
- throw new CliError("not_found", "archive occurrence UUID was not found");
1504
+ throw new CliError8("not_found", "archive occurrence UUID was not found");
1720
1505
  const transcripts = selected.flatMap((manifest) => manifest.files.filter((asset) => asset.format?.toLowerCase() === "vtt").map((asset) => ({ manifest, asset })));
1721
1506
  if (options.fileIds?.some((id) => !transcripts.some((item) => item.asset.id === id)))
1722
- throw new CliError("not_found", "selected archive VTT file id was not found");
1507
+ throw new CliError8("not_found", "selected archive VTT file id was not found");
1723
1508
  for (const { manifest, asset } of transcripts) {
1724
1509
  checkCancelled(options.signal);
1725
1510
  if (options.fileIds && !options.fileIds.includes(asset.id))
@@ -1733,7 +1518,7 @@ __name(readArchiveTranscripts, "readArchiveTranscripts");
1733
1518
  var searchArchiveTranscripts = /* @__PURE__ */ __name(async (destination, query, options = {}) => {
1734
1519
  const limit = options.limit === void 0 ? 100 : options.limit;
1735
1520
  if (typeof query !== "string" || !query.trim() || !Number.isSafeInteger(limit) || limit < 1 || limit > 1e3)
1736
- throw new CliError("validation_error", "archive search requires nonempty text and an integer limit from 1 through 1000");
1521
+ throw new CliError8("validation_error", "archive search requires nonempty text and an integer limit from 1 through 1000");
1737
1522
  const needle = query.normalize("NFC").toLowerCase();
1738
1523
  const matches = [];
1739
1524
  for await (const transcript of readArchiveTranscripts(destination, options))
@@ -1748,7 +1533,12 @@ var searchArchiveTranscripts = /* @__PURE__ */ __name(async (destination, query,
1748
1533
  return { items: matches, page: 1, limit, hasMore: false };
1749
1534
  }, "searchArchiveTranscripts");
1750
1535
 
1536
+ // dist/contacts.js
1537
+ import { CliError as CliError9 } from "@wirecat/cli-base";
1538
+ import { formatReference } from "@wirecat/cli-core";
1539
+
1751
1540
  // dist/zoom-api/schemas.js
1541
+ import { integer } from "@wirecat/cli-base/codegen/runtime";
1752
1542
  var GetUserContactsResponse = looseObject({
1753
1543
  contacts: optional(array(looseObject({
1754
1544
  email: optional(string()),
@@ -1795,14 +1585,14 @@ var CONTACT_TYPES = ["company", "external"];
1795
1585
  var parsed = /* @__PURE__ */ __name((schema, body) => {
1796
1586
  const result = safeParse(schema, body);
1797
1587
  if (!result.success)
1798
- throw new CliError("invalid_response", "Zoom returned an invalid contact");
1588
+ throw new CliError9("invalid_response", "Zoom returned an invalid contact");
1799
1589
  return result.output;
1800
1590
  }, "parsed");
1801
1591
  var nonEmpty = /* @__PURE__ */ __name((text2) => text2?.trim() ? text2.trim() : null, "nonEmpty");
1802
1592
  var contactOf = /* @__PURE__ */ __name((row) => {
1803
1593
  const id = nonEmpty(row.member_id);
1804
1594
  if (!id)
1805
- throw new CliError("invalid_response", "Zoom returned a contact without a member id");
1595
+ throw new CliError9("invalid_response", "Zoom returned a contact without a member id");
1806
1596
  const name = [nonEmpty(row.first_name), nonEmpty(row.last_name)].filter(Boolean).join(" ");
1807
1597
  return {
1808
1598
  ref: formatReference({ type: "contact", provider: "zoom", id }),
@@ -1837,7 +1627,7 @@ var ZoomContacts = class {
1837
1627
  if (!next)
1838
1628
  return [...found.values()];
1839
1629
  if (seen.has(next))
1840
- throw new CliError("invalid_response", "Zoom repeated a pagination token");
1630
+ throw new CliError9("invalid_response", "Zoom repeated a pagination token");
1841
1631
  seen.add(next);
1842
1632
  query.set("next_page_token", next);
1843
1633
  }
@@ -1845,7 +1635,7 @@ var ZoomContacts = class {
1845
1635
  /** `who` is a member id, a Zoom user id or an email address. */
1846
1636
  async show(who, options = {}) {
1847
1637
  if (!who.trim())
1848
- throw new CliError("validation_error", "a contact is a member id, user id or email");
1638
+ throw new CliError9("validation_error", "a contact is a member id, user id or email");
1849
1639
  const body = parsed(GetUserContactResponse, await this.remote.request(`/chat/users/me/contacts/${encodeURIComponent(who.trim())}`, "team_chat:read:contact", options));
1850
1640
  const phones = (body.phone_numbers ?? []).flatMap((phone) => {
1851
1641
  const number2 = nonEmpty([phone.code, phone.number].filter(Boolean).join(" "));
@@ -1859,6 +1649,9 @@ var ZoomContacts = class {
1859
1649
  };
1860
1650
 
1861
1651
  // dist/contacts-commands.js
1652
+ import { annotate as annotate3 } from "@wirecat/cli-base/commands";
1653
+ import { defineQuery } from "@wirecat/cli-base/query";
1654
+ import { itemOf as itemOf2, listOf, NO_EFFECTS as NO_EFFECTS3, queryTerms, REMOTE_READ as REMOTE_READ2, termField, typedQuery as typedQuery2, withQuery as withQuery2 } from "@wirecat/cli-core";
1862
1655
  var CONTACTS_QUERY = defineQuery({
1863
1656
  entity: "contact",
1864
1657
  backend: "native",
@@ -1870,14 +1663,14 @@ var CONTACTS_QUERY = defineQuery({
1870
1663
  });
1871
1664
  var has = /* @__PURE__ */ __name((value, part) => part === void 0 || (value ?? "").toLowerCase().includes(part.toLowerCase()), "has");
1872
1665
  var addContactsCommands = /* @__PURE__ */ __name((program, deps) => {
1873
- const contacts = annotate(program.command("contacts"), { effects: NO_EFFECTS }).description("your Zoom contacts, read live: company colleagues and external contacts");
1874
- withQuery(annotate(contacts.command("list"), {
1666
+ const contacts = annotate3(program.command("contacts"), { effects: NO_EFFECTS3 }).description("your Zoom contacts, read live: company colleagues and external contacts");
1667
+ withQuery2(annotate3(contacts.command("list"), {
1875
1668
  origin: "handwritten",
1876
- effects: REMOTE_READ,
1669
+ effects: REMOTE_READ2,
1877
1670
  output: { entity: "contact" },
1878
1671
  examples: ["zm personal contacts list --json", "zm personal contacts list type:external name:alice"]
1879
1672
  }), CONTACTS_QUERY).description("list your company and external Zoom contacts").action(async (words) => {
1880
- const terms = queryTerms(typedQuery(words), CONTACTS_QUERY, "contacts list");
1673
+ const terms = queryTerms(typedQuery2(words), CONTACTS_QUERY, "contacts list");
1881
1674
  const type = terms.get("type");
1882
1675
  deps.api();
1883
1676
  const service = deps.contacts();
@@ -1887,14 +1680,14 @@ var addContactsCommands = /* @__PURE__ */ __name((program, deps) => {
1887
1680
  const kept = items.filter((item) => has(item.name, terms.get("name")) && has(item.email, terms.get("email")));
1888
1681
  deps.output(listOf("contacts list", { items: kept, limit: Math.max(1, kept.length), has_more: false }));
1889
1682
  });
1890
- annotate(contacts.command("show"), {
1683
+ annotate3(contacts.command("show"), {
1891
1684
  origin: "handwritten",
1892
- effects: REMOTE_READ,
1685
+ effects: REMOTE_READ2,
1893
1686
  output: { entity: "contact" },
1894
1687
  examples: ["zm personal contacts show alice@example.com --json"]
1895
1688
  }).description("one contact with their phone numbers").argument("<contact>", "their member id from `contacts list`, Zoom user id or email").action(async (who) => {
1896
1689
  deps.api();
1897
- deps.output(itemOf(await deps.contacts().show(who, { signal: deps.signal() })));
1690
+ deps.output(itemOf2(await deps.contacts().show(who, { signal: deps.signal() })));
1898
1691
  });
1899
1692
  }, "addContactsCommands");
1900
1693
 
@@ -1902,8 +1695,16 @@ var addContactsCommands = /* @__PURE__ */ __name((program, deps) => {
1902
1695
  import { createHash as createHash4 } from "node:crypto";
1903
1696
  import { readdir as readdir2, readFile, stat } from "node:fs/promises";
1904
1697
  import { basename, join as join6 } from "node:path";
1698
+ import { CliError as CliError12 } from "@wirecat/cli-base";
1699
+ import { parseTranscriptText, parseVtt as parseVtt3 } from "@wirecat/cli-core";
1700
+
1701
+ // dist/api.js
1702
+ import { CliError as CliError11, isCliError as isCliError5 } from "@wirecat/cli-base";
1703
+ import { statusToCode as statusToCode3 } from "@wirecat/cli-base/http";
1704
+ import { parseVtt as parseVtt2 } from "@wirecat/cli-core";
1905
1705
 
1906
1706
  // dist/chat-file.js
1707
+ import { CliError as CliError10 } from "@wirecat/cli-base";
1907
1708
  var TABBED = /^(\d{1,2}):(\d{2}):(\d{2})\t(.*?):\t(.*)$/;
1908
1709
  var SPACED = /^(\d{1,2}):(\d{2}):(\d{2}) +(.*?): +(.*)$/;
1909
1710
  var LOCAL = /^From (.+?) to .+$/;
@@ -1919,7 +1720,7 @@ var parseZoomChat = /* @__PURE__ */ __name((content, recordingStart) => {
1919
1720
  } else if (raw.trim()) {
1920
1721
  const last = lines.at(-1);
1921
1722
  if (!last)
1922
- throw new CliError("invalid_response", "Zoom returned an invalid chat file");
1723
+ throw new CliError10("invalid_response", "Zoom returned an invalid chat file");
1923
1724
  last.text = `${last.text}
1924
1725
  ${raw}`;
1925
1726
  }
@@ -1928,7 +1729,7 @@ ${raw}`;
1928
1729
  }, "parseZoomChat");
1929
1730
 
1930
1731
  // dist/api.js
1931
- var TRANSCRIPT_MAX_BYTES = 10 * 1024 * 1024;
1732
+ var TRANSCRIPT_MAX_BYTES = 100 * 1024 * 1024;
1932
1733
  var json = /* @__PURE__ */ __name((value) => {
1933
1734
  if (value === null || typeof value === "boolean" || typeof value === "string")
1934
1735
  return value;
@@ -1944,13 +1745,13 @@ var extras = /* @__PURE__ */ __name((row, keys2) => Object.fromEntries(Object.en
1944
1745
  var encodeUuid = /* @__PURE__ */ __name((uuid) => uuid.startsWith("/") || uuid.includes("//") ? encodeURIComponent(encodeURIComponent(uuid)) : encodeURIComponent(uuid), "encodeUuid");
1945
1746
  var seriesIdOf = /* @__PURE__ */ __name((row) => {
1946
1747
  if (!(string2(row.id) !== null || typeof row.id === "number" && Number.isSafeInteger(row.id) && row.id > 0))
1947
- throw new CliError("invalid_response", "Zoom meeting is missing its series id");
1748
+ throw new CliError11("invalid_response", "Zoom meeting is missing its series id");
1948
1749
  return String(row.id);
1949
1750
  }, "seriesIdOf");
1950
1751
  var requiredString = /* @__PURE__ */ __name((value) => {
1951
1752
  const text2 = string2(value);
1952
1753
  if (text2 === null)
1953
- throw new CliError("invalid_response", "Zoom response is missing a required field");
1754
+ throw new CliError11("invalid_response", "Zoom response is missing a required field");
1954
1755
  return text2;
1955
1756
  }, "requiredString");
1956
1757
  var PAST_MEETING = "meeting:read:past_meeting";
@@ -1964,14 +1765,14 @@ var findCursorOf = /* @__PURE__ */ __name((cursor) => {
1964
1765
  try {
1965
1766
  value = JSON.parse(cursor);
1966
1767
  } catch {
1967
- throw new CliError("validation_error", "this Zoom page cursor is not one zm gave");
1768
+ throw new CliError11("validation_error", "this Zoom page cursor is not one zm gave");
1968
1769
  }
1969
1770
  if (!value || typeof value !== "object" || Array.isArray(value))
1970
- throw new CliError("validation_error", "this Zoom page cursor is not one zm gave");
1771
+ throw new CliError11("validation_error", "this Zoom page cursor is not one zm gave");
1971
1772
  const row = value;
1972
1773
  const whole = [row.floor, row.end, row.skip].every((value2) => Number.isSafeInteger(value2));
1973
1774
  if (!whole || row.token !== null && !string2(row.token))
1974
- throw new CliError("validation_error", "this Zoom page cursor is not one zm gave");
1775
+ throw new CliError11("validation_error", "this Zoom page cursor is not one zm gave");
1975
1776
  return {
1976
1777
  floor: row.floor,
1977
1778
  end: row.end,
@@ -2022,12 +1823,12 @@ var ZoomApiSource = class {
2022
1823
  const query = new URLSearchParams({ page_size: "100", ...next ? { next_page_token: next } : {} });
2023
1824
  const body = await this.request(`${path}${path.includes("?") ? "&" : "?"}${query}`, scope2);
2024
1825
  if (!body || !Array.isArray(body[key]))
2025
- throw new CliError("invalid_response", "Zoom returned an invalid list");
1826
+ throw new CliError11("invalid_response", "Zoom returned an invalid list");
2026
1827
  for (const row of body[key])
2027
1828
  rows.push(object(row));
2028
1829
  next = string2(body.next_page_token) ?? "";
2029
1830
  if (next && seen.has(next))
2030
- throw new CliError("invalid_response", "Zoom repeated a pagination token");
1831
+ throw new CliError11("invalid_response", "Zoom repeated a pagination token");
2031
1832
  seen.add(next);
2032
1833
  } while (next);
2033
1834
  return rows;
@@ -2040,12 +1841,12 @@ var ZoomApiSource = class {
2040
1841
  try {
2041
1842
  body = await this.request(`/past_meetings/${encodeURIComponent(seriesId)}/instances${range ? `?${range}` : ""}`, "meeting:read:list_past_instances");
2042
1843
  } catch (error) {
2043
- if (isCliError(error) && error.code === statusToCode(404))
1844
+ if (isCliError5(error) && error.code === statusToCode3(404))
2044
1845
  return [];
2045
1846
  throw error;
2046
1847
  }
2047
1848
  if (!body || !Array.isArray(body.meetings))
2048
- throw new CliError("invalid_response", "Zoom returned invalid occurrences");
1849
+ throw new CliError11("invalid_response", "Zoom returned invalid occurrences");
2049
1850
  return body.meetings.map(object);
2050
1851
  }
2051
1852
  /** A listed series' occurrences that ran, each by its instance uuid, the id `meetings()`, `find` and `get` share. */
@@ -2058,7 +1859,7 @@ var ZoomApiSource = class {
2058
1859
  const startedAt = this.time(instance.start_time, doubt);
2059
1860
  const id = requiredString(instance.uuid);
2060
1861
  if (startedAt === null)
2061
- throw new CliError("invalid_response", "Zoom occurrence is missing its start time");
1862
+ throw new CliError11("invalid_response", "Zoom occurrence is missing its start time");
2062
1863
  if (!keep(startedAt) || seen.has(id))
2063
1864
  continue;
2064
1865
  seen.add(id);
@@ -2105,7 +1906,7 @@ var ZoomApiSource = class {
2105
1906
  async meetings(since2) {
2106
1907
  const lower = Date.parse(since2);
2107
1908
  if (!Number.isFinite(lower))
2108
- throw new CliError("validation_error", "expected an ISO since timestamp");
1909
+ throw new CliError11("validation_error", "expected an ISO since timestamp");
2109
1910
  const series = await this.pages("/users/me/meetings?type=previous_meetings", "meetings", "meeting:read:list_meetings");
2110
1911
  const meetings = [];
2111
1912
  const seen = /* @__PURE__ */ new Set();
@@ -2131,7 +1932,7 @@ var ZoomApiSource = class {
2131
1932
  query.set("next_page_token", at.token);
2132
1933
  const body = await this.request(`/users/me/meetings?${query}`, "meeting:read:list_meetings");
2133
1934
  if (!body || !Array.isArray(body.meetings))
2134
- throw new CliError("invalid_response", "Zoom returned an invalid list");
1935
+ throw new CliError11("invalid_response", "Zoom returned an invalid list");
2135
1936
  const rows = body.meetings.map(object);
2136
1937
  const skip = at?.skip ?? 0;
2137
1938
  const taken = rows.slice(skip, skip + FIND_SERIES);
@@ -2144,7 +1945,7 @@ var ZoomApiSource = class {
2144
1945
  meetings.push({ meeting: meeting2 });
2145
1946
  const token = string2(body.next_page_token) || null;
2146
1947
  if (token !== null && token === at?.token)
2147
- throw new CliError("invalid_response", "Zoom repeated a pagination token");
1948
+ throw new CliError11("invalid_response", "Zoom repeated a pagination token");
2148
1949
  const next = skip + taken.length < rows.length ? { floor, end: end2, token: at?.token ?? null, skip: skip + taken.length } : token !== null ? { floor, end: end2, token, skip: 0 } : start > floor ? { floor, end: start - 1, token: null, skip: 0 } : null;
2149
1950
  return { meetings, next: next && JSON.stringify(next) };
2150
1951
  }
@@ -2155,10 +1956,10 @@ var ZoomApiSource = class {
2155
1956
  async get(id) {
2156
1957
  const given = id.trim();
2157
1958
  if (!given)
2158
- throw new CliError("validation_error", "name a Zoom meeting by its uuid or number");
1959
+ throw new CliError11("validation_error", "name a Zoom meeting by its uuid or number");
2159
1960
  const { scopes } = await this.tokens.tokens();
2160
1961
  if (!["", ":admin", ":master"].some((grant) => scopes.includes(`${PAST_MEETING}${grant}`)))
2161
- throw new CliError("permission_error", `Zoom scope ${PAST_MEETING} is missing; add it to the app and run zm <profile> session start again`);
1962
+ throw new CliError11("permission_error", `Zoom scope ${PAST_MEETING} is missing; add it to the app and run zm <profile> session start again`);
2162
1963
  const body = await this.request(`/past_meetings/${encodeUuid(given)}`, PAST_MEETING, 3001);
2163
1964
  if (!body)
2164
1965
  return null;
@@ -2175,7 +1976,7 @@ var ZoomApiSource = class {
2175
1976
  try {
2176
1977
  return await this.transcript(uuid);
2177
1978
  } catch (error) {
2178
- if (isCliError(error) && error.code === "provider_error")
1979
+ if (isCliError5(error) && error.code === "provider_error")
2179
1980
  return void 0;
2180
1981
  throw error;
2181
1982
  }
@@ -2244,14 +2045,14 @@ var ZoomApiSource = class {
2244
2045
  accessToken: tokens.accessToken,
2245
2046
  signal,
2246
2047
  what,
2247
- unreachable: /* @__PURE__ */ __name(() => new CliError("provider_error", `${label2} download could not be completed`), "unreachable")
2048
+ unreachable: /* @__PURE__ */ __name(() => new CliError11("provider_error", `${label2} download could not be completed`), "unreachable")
2248
2049
  });
2249
2050
  if (!response.ok)
2250
- throw new CliError(statusToCode(response.status), `${label2} download failed (HTTP ${response.status})`);
2051
+ throw new CliError11(statusToCode3(response.status), `${label2} download failed (HTTP ${response.status})`);
2251
2052
  const maxBytes2 = TRANSCRIPT_MAX_BYTES;
2252
2053
  const reader = response.body?.getReader();
2253
2054
  if (!reader)
2254
- throw new CliError("invalid_response", `Zoom returned an invalid ${what}`);
2055
+ throw new CliError11("invalid_response", `Zoom returned an invalid ${what}`);
2255
2056
  const chunks = [];
2256
2057
  let size = 0;
2257
2058
  try {
@@ -2262,14 +2063,14 @@ var ZoomApiSource = class {
2262
2063
  size += value.byteLength;
2263
2064
  if (size > maxBytes2) {
2264
2065
  await reader.cancel();
2265
- throw new CliError("invalid_response", `Zoom ${what} exceeds the download size limit`);
2066
+ throw new CliError11("invalid_response", `Zoom ${what} exceeds the download size limit`);
2266
2067
  }
2267
2068
  chunks.push(value);
2268
2069
  }
2269
2070
  } catch (error) {
2270
- if (isCliError(error))
2071
+ if (isCliError5(error))
2271
2072
  throw error;
2272
- throw new CliError("provider_error", `${label2} download could not be completed`);
2073
+ throw new CliError11("provider_error", `${label2} download could not be completed`);
2273
2074
  }
2274
2075
  const bytes2 = new Uint8Array(size);
2275
2076
  let offset = 0;
@@ -2285,14 +2086,14 @@ var ZoomApiSource = class {
2285
2086
  return null;
2286
2087
  if (body.can_download === false) {
2287
2088
  if (body.download_restriction_reason === "NOT_READY")
2288
- throw new CliError("provider_error", "Zoom has not finished this transcript yet; a later sync reads it");
2089
+ throw new CliError11("provider_error", "Zoom has not finished this transcript yet; a later sync reads it");
2289
2090
  return null;
2290
2091
  }
2291
2092
  const content = await this.downloadText(requiredString(body.download_url), "transcript");
2292
2093
  try {
2293
- return parseVtt(content);
2094
+ return parseVtt2(content);
2294
2095
  } catch {
2295
- throw new CliError("invalid_response", "Zoom returned an invalid transcript");
2096
+ throw new CliError11("invalid_response", "Zoom returned an invalid transcript");
2296
2097
  }
2297
2098
  }
2298
2099
  async summary(id) {
@@ -2343,7 +2144,7 @@ var ZoomApiSource = class {
2343
2144
  return null;
2344
2145
  const start = this.time(file.recording_start ?? body.start_time, { zoneless: false });
2345
2146
  if (start === null)
2346
- throw new CliError("invalid_response", "Zoom chat file is missing its start time");
2147
+ throw new CliError11("invalid_response", "Zoom chat file is missing its start time");
2347
2148
  return parseZoomChat(await this.downloadText(requiredString(file.download_url), "chat"), start);
2348
2149
  }
2349
2150
  async files() {
@@ -2356,7 +2157,7 @@ var localTimestamp = /* @__PURE__ */ __name((year, month, day, hour, minute, tim
2356
2157
  const target = Date.UTC(year, month - 1, day, hour, minute);
2357
2158
  const date = new Date(target);
2358
2159
  if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !== day || hour > 23 || minute > 59)
2359
- throw new CliError("validation_error", "transcript filename contains an invalid date or time");
2160
+ throw new CliError12("validation_error", "transcript filename contains an invalid date or time");
2360
2161
  let formatter;
2361
2162
  try {
2362
2163
  formatter = new Intl.DateTimeFormat("en-GB", {
@@ -2369,7 +2170,7 @@ var localTimestamp = /* @__PURE__ */ __name((year, month, day, hour, minute, tim
2369
2170
  hourCycle: "h23"
2370
2171
  });
2371
2172
  } catch {
2372
- throw new CliError("validation_error", "expected a valid IANA timezone");
2173
+ throw new CliError12("validation_error", "expected a valid IANA timezone");
2373
2174
  }
2374
2175
  const wallTime = /* @__PURE__ */ __name((instant) => {
2375
2176
  const parts = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, part.value]));
@@ -2383,7 +2184,7 @@ var localTimestamp = /* @__PURE__ */ __name((year, month, day, hour, minute, tim
2383
2184
  possibilities.add(candidate2);
2384
2185
  }
2385
2186
  if (possibilities.size !== 1)
2386
- throw new CliError("validation_error", "transcript filename time is ambiguous or nonexistent in the selected timezone");
2187
+ throw new CliError12("validation_error", "transcript filename time is ambiguous or nonexistent in the selected timezone");
2387
2188
  return [...possibilities][0] ?? target;
2388
2189
  }, "localTimestamp");
2389
2190
  var FILE_NAME = /^(\d{4})-(\d{2})-(\d{2})_(\d{2})(\d{2})_(.+)\.(vtt|txt)$/i;
@@ -2400,7 +2201,7 @@ var headerTime = /* @__PURE__ */ __name((date, timezone) => {
2400
2201
  var fileMeeting = /* @__PURE__ */ __name((name, timezone = "UTC") => {
2401
2202
  const match = FILE_NAME.exec(basename(name));
2402
2203
  if (!match)
2403
- throw new CliError("validation_error", "expected a transcript named YYYY-MM-DD_HHMM_topic.vtt or .txt");
2204
+ throw new CliError12("validation_error", "expected a transcript named YYYY-MM-DD_HHMM_topic.vtt or .txt");
2404
2205
  const [, year, month, day, hour, minute, topic = ""] = match;
2405
2206
  const startedAt = localTimestamp(Number(year), Number(month), Number(day), Number(hour), Number(minute), timezone);
2406
2207
  const slug = topic.normalize("NFC");
@@ -2495,7 +2296,7 @@ var indexDownloadedFiles = /* @__PURE__ */ __name((files, timezone) => {
2495
2296
  continue;
2496
2297
  }
2497
2298
  if (existing && existing.file.content !== file.content)
2498
- throw new CliError("validation_error", "conflicting transcript files have the same occurrence key");
2299
+ throw new CliError12("validation_error", "conflicting transcript files have the same occurrence key");
2499
2300
  if (!existing)
2500
2301
  result.set(meeting2.occurrence.id, { meeting: meeting2, file });
2501
2302
  }
@@ -2506,21 +2307,21 @@ var FOLDER_MAX_FILES = 1e4;
2506
2307
  var readDownloadedFiles = /* @__PURE__ */ __name(async (folder) => {
2507
2308
  const listing = await readdir2(folder, { withFileTypes: true }).catch((error) => {
2508
2309
  if (error.code === "ENOENT")
2509
- throw new CliError("not_found", `folder not found: ${folder}`);
2310
+ throw new CliError12("not_found", `folder not found: ${folder}`);
2510
2311
  if (error.code === "ENOTDIR")
2511
- throw new CliError("validation_error", `not a folder: ${folder}`);
2312
+ throw new CliError12("validation_error", `not a folder: ${folder}`);
2512
2313
  if (error.code === "EACCES" || error.code === "EPERM")
2513
- throw new CliError("permission_error", `cannot read folder: ${folder}`);
2314
+ throw new CliError12("permission_error", `cannot read folder: ${folder}`);
2514
2315
  throw error;
2515
2316
  });
2516
2317
  const entries = listing.filter((entry) => entry.isFile() && (/\.vtt$/i.test(entry.name) || isText(entry.name) && FILE_NAME.test(entry.name))).sort((a, b) => a.name.localeCompare(b.name));
2517
2318
  if (entries.length > FOLDER_MAX_FILES)
2518
- throw new CliError("validation_error", `the folder holds ${entries.length} transcript files and zm reads at most ${FOLDER_MAX_FILES} \u2014 move some into another folder`);
2319
+ throw new CliError12("validation_error", `the folder holds ${entries.length} transcript files and zm reads at most ${FOLDER_MAX_FILES} \u2014 move some into another folder`);
2519
2320
  const files = [];
2520
2321
  for (const entry of entries) {
2521
2322
  const path = join6(folder, entry.name);
2522
2323
  if ((await stat(path)).size > TRANSCRIPT_MAX_BYTES)
2523
- throw new CliError("validation_error", `${entry.name} is larger than ${TRANSCRIPT_MAX_BYTES / 1024 ** 2} MiB, the most zm reads from one transcript`);
2324
+ throw new CliError12("validation_error", `${entry.name} is larger than ${TRANSCRIPT_MAX_BYTES / 1024 ** 2} MiB, the most zm reads from one transcript`);
2524
2325
  files.push({ name: entry.name, content: await readFile(path, "utf8") });
2525
2326
  }
2526
2327
  return validateDownloadedFiles(files);
@@ -2548,14 +2349,14 @@ var FilesSource = class {
2548
2349
  async meetings(since2) {
2549
2350
  const lower = Date.parse(since2);
2550
2351
  if (!Number.isFinite(lower))
2551
- throw new CliError("validation_error", "expected an ISO since timestamp");
2352
+ throw new CliError12("validation_error", "expected an ISO since timestamp");
2552
2353
  return [...this.index().values()].map(({ meeting: meeting2 }) => meeting2).filter((m) => Date.parse(m.occurrence.startedAt) >= lower);
2553
2354
  }
2554
2355
  async transcript(id) {
2555
2356
  const file = this.index().get(id)?.file;
2556
2357
  if (!file)
2557
2358
  return null;
2558
- return isText(file.name) ? parseTranscriptText(file.content).lines : parseVtt(file.content);
2359
+ return isText(file.name) ? parseTranscriptText(file.content).lines : parseVtt3(file.content);
2559
2360
  }
2560
2361
  async participants() {
2561
2362
  return null;
@@ -2583,20 +2384,25 @@ zm config set files.timezone <IANA zone>. Times are stored in UTC, and the impor
2583
2384
  }, "fileNamesHelp");
2584
2385
 
2585
2386
  // dist/meeting-commands.js
2387
+ import { CliError as CliError13 } from "@wirecat/cli-base";
2388
+ import { annotate as annotate4 } from "@wirecat/cli-base/commands";
2389
+ import { addMeetingCommands, NO_EFFECTS as NO_EFFECTS4 } from "@wirecat/cli-core";
2586
2390
  var childOf = /* @__PURE__ */ __name((parent, name) => {
2587
2391
  const found = parent.commands.find((command) => command.name() === name);
2588
2392
  if (!found)
2589
- throw new CliError("configuration_error", `shared command is missing: ${name}`);
2393
+ throw new CliError13("configuration_error", `shared command is missing: ${name}`);
2590
2394
  return found;
2591
2395
  }, "childOf");
2592
2396
  var addZoomMeetingCommands = /* @__PURE__ */ __name((program, deps) => {
2593
2397
  addMeetingCommands(program, deps);
2594
- const meetings = annotate(childOf(program, "meetings"), { effects: NO_EFFECTS });
2595
- annotate(childOf(program, "events"), { effects: NO_EFFECTS });
2398
+ const meetings = annotate4(childOf(program, "meetings"), { effects: NO_EFFECTS4 });
2399
+ annotate4(childOf(program, "events"), { effects: NO_EFFECTS4 });
2596
2400
  runsLong(childOf(meetings, "sync"));
2597
2401
  }, "addZoomMeetingCommands");
2598
2402
 
2599
2403
  // dist/meeting-communications-binding.js
2404
+ import { CliError as CliError14 } from "@wirecat/cli-base";
2405
+ import { isFolderProvider } from "@wirecat/cli-core";
2600
2406
  var resolveContextSource = /* @__PURE__ */ __name(async (definition, metadata) => {
2601
2407
  try {
2602
2408
  let folderId;
@@ -2625,13 +2431,13 @@ var resolveContextSource = /* @__PURE__ */ __name(async (definition, metadata) =
2625
2431
  })
2626
2432
  });
2627
2433
  } catch {
2628
- throw new CliError("configuration_error", `configured context source ${definition.id} is unavailable; check its stored provider/account identity`);
2434
+ throw new CliError14("configuration_error", `configured context source ${definition.id} is unavailable; check its stored provider/account identity`);
2629
2435
  }
2630
2436
  }, "resolveContextSource");
2631
2437
  var captureContextSources = /* @__PURE__ */ __name((configured2, profile) => {
2632
2438
  const parsed3 = safeParse(contextSourcesSchema, configured2 ?? []);
2633
2439
  if (!parsed3.success)
2634
- throw new CliError("configuration_error", "context_sources is invalid");
2440
+ throw new CliError14("configuration_error", "context_sources is invalid");
2635
2441
  const definitions = parsed3.output.filter((s) => s.profile === profile).map((s) => Object.freeze({ ...s }));
2636
2442
  const pinned = /* @__PURE__ */ new Map();
2637
2443
  const capture = /* @__PURE__ */ __name((selected) => {
@@ -2639,10 +2445,10 @@ var captureContextSources = /* @__PURE__ */ __name((configured2, profile) => {
2639
2445
  let captured;
2640
2446
  const assert = /* @__PURE__ */ __name((requested) => {
2641
2447
  if (!ids.length)
2642
- throw new CliError("configuration_error", "configure context.sources for the selected profile before requesting communications");
2448
+ throw new CliError14("configuration_error", "configure context.sources for the selected profile before requesting communications");
2643
2449
  for (const id of requested)
2644
2450
  if (!ids.includes(id))
2645
- throw new CliError("validation_error", `communications.sources contains an unauthorized selection: ${id}`);
2451
+ throw new CliError14("validation_error", `communications.sources contains an unauthorized selection: ${id}`);
2646
2452
  }, "assert");
2647
2453
  return Object.freeze({
2648
2454
  ids,
@@ -2650,7 +2456,7 @@ var captureContextSources = /* @__PURE__ */ __name((configured2, profile) => {
2650
2456
  select(requested) {
2651
2457
  assert(requested);
2652
2458
  if (!requested.length)
2653
- throw new CliError("validation_error", "select at least one communications source");
2459
+ throw new CliError14("validation_error", "select at least one communications source");
2654
2460
  return capture(selected.filter((definition) => requested.includes(definition.id)));
2655
2461
  },
2656
2462
  resolve(metadata) {
@@ -2679,9 +2485,17 @@ var captureContextSources = /* @__PURE__ */ __name((configured2, profile) => {
2679
2485
  return capture(definitions);
2680
2486
  }, "captureContextSources");
2681
2487
 
2488
+ // dist/meeting-inventory.js
2489
+ import { addMeetingSeriesInventoryCommand } from "@wirecat/cli-core";
2490
+
2491
+ // dist/series-inventory.js
2492
+ import { CliError as CliError17 } from "@wirecat/cli-base";
2493
+ import { createMeetingSeriesInventoryReader } from "@wirecat/cli-core";
2494
+
2682
2495
  // dist/occurrence-schedule.js
2496
+ import { CliError as CliError15 } from "@wirecat/cli-base";
2683
2497
  function invalid(field) {
2684
- throw new CliError("invalid_response", `Zoom meeting ${field} is invalid`);
2498
+ throw new CliError15("invalid_response", `Zoom meeting ${field} is invalid`);
2685
2499
  }
2686
2500
  __name(invalid, "invalid");
2687
2501
  var zoomScheduledInstant = /* @__PURE__ */ __name((value) => {
@@ -2770,9 +2584,10 @@ var zoomOccurrenceSchedule = /* @__PURE__ */ __name((value, meetingId, limit) =>
2770
2584
  }, "zoomOccurrenceSchedule");
2771
2585
 
2772
2586
  // dist/remote-meeting-id.js
2587
+ import { CliError as CliError16 } from "@wirecat/cli-base";
2773
2588
  var zoomMeetingPath = /* @__PURE__ */ __name((id) => {
2774
2589
  if (typeof id !== "string" || !/^[1-9]\d*$/.test(id) || id.trim() !== id)
2775
- throw new CliError("validation_error", "remote meeting id must be a positive numeric id");
2590
+ throw new CliError16("validation_error", "remote meeting id must be a positive numeric id");
2776
2591
  return `/meetings/${id}`;
2777
2592
  }, "zoomMeetingPath");
2778
2593
 
@@ -2781,16 +2596,16 @@ var candidate = /* @__PURE__ */ __name((value) => {
2781
2596
  const row = object(value);
2782
2597
  const meetingId = typeof row.id === "number" && Number.isSafeInteger(row.id) ? String(row.id) : row.id;
2783
2598
  if (typeof meetingId !== "string")
2784
- throw new CliError("invalid_response", "Zoom inventory meeting id is invalid");
2599
+ throw new CliError17("invalid_response", "Zoom inventory meeting id is invalid");
2785
2600
  try {
2786
2601
  zoomMeetingPath(meetingId);
2787
2602
  } catch {
2788
- throw new CliError("invalid_response", "Zoom inventory meeting id is invalid");
2603
+ throw new CliError17("invalid_response", "Zoom inventory meeting id is invalid");
2789
2604
  }
2790
2605
  if (row.topic !== void 0 && row.topic !== null && (typeof row.topic !== "string" || row.topic.length > 8192))
2791
- throw new CliError("invalid_response", "Zoom inventory topic is invalid");
2606
+ throw new CliError17("invalid_response", "Zoom inventory topic is invalid");
2792
2607
  if (row.type !== void 0 && ![1, 2, 3, 8].includes(row.type))
2793
- throw new CliError("invalid_response", "Zoom inventory meeting type is invalid");
2608
+ throw new CliError17("invalid_response", "Zoom inventory meeting type is invalid");
2794
2609
  return {
2795
2610
  meetingId,
2796
2611
  title: typeof row.topic === "string" ? row.topic : null,
@@ -2800,7 +2615,7 @@ var candidate = /* @__PURE__ */ __name((value) => {
2800
2615
  }, "candidate");
2801
2616
  var createZoomSeriesInventoryReader = /* @__PURE__ */ __name((account, credentials, fetcher, options = {}) => {
2802
2617
  if (typeof credentials?.withSignal !== "function")
2803
- throw new CliError("configuration_error", "Zoom credential scope is unavailable");
2618
+ throw new CliError17("configuration_error", "Zoom credential scope is unavailable");
2804
2619
  const scopedCredentials = credentials.withSignal.bind(credentials);
2805
2620
  const remoteOptions = { ...options };
2806
2621
  return createMeetingSeriesInventoryReader({ provider: "zoom", account }, {
@@ -2815,9 +2630,9 @@ var createZoomSeriesInventoryReader = /* @__PURE__ */ __name((account, credentia
2815
2630
  maxResponseBytes: context.maxReadBytes
2816
2631
  });
2817
2632
  if (!Array.isArray(raw.meetings) || raw.meetings.length > context.limit)
2818
- throw new CliError("invalid_response", "Zoom inventory meetings exceed the page limit");
2633
+ throw new CliError17("invalid_response", "Zoom inventory meetings exceed the page limit");
2819
2634
  if (raw.next_page_token !== void 0 && typeof raw.next_page_token !== "string")
2820
- throw new CliError("invalid_response", "Zoom inventory continuation is invalid");
2635
+ throw new CliError17("invalid_response", "Zoom inventory continuation is invalid");
2821
2636
  return {
2822
2637
  scope: context.scope,
2823
2638
  after: context.after,
@@ -2865,6 +2680,7 @@ var addZoomInventoryCommand = /* @__PURE__ */ __name((program, deps) => {
2865
2680
  }, "addZoomInventoryCommand");
2866
2681
 
2867
2682
  // dist/meeting-source.js
2683
+ import { CliError as CliError18 } from "@wirecat/cli-base";
2868
2684
  var configuredMeetingSource = /* @__PURE__ */ __name(({ deps, getConfig, tokens, fetch, zones }) => {
2869
2685
  let activeSource;
2870
2686
  const getSource = /* @__PURE__ */ __name(() => {
@@ -2875,11 +2691,11 @@ var configuredMeetingSource = /* @__PURE__ */ __name(({ deps, getConfig, tokens,
2875
2691
  if (config.source === "api") {
2876
2692
  const manager = tokens();
2877
2693
  if (!manager.options.clientId)
2878
- throw new CliError("configuration_error", SET_ZOOM_APP);
2694
+ throw new CliError18("configuration_error", SET_ZOOM_APP);
2879
2695
  return new ZoomApiSource(manager, fetch(), {}, zones);
2880
2696
  }
2881
2697
  if (!config.filesFolder)
2882
- throw new CliError("configuration_error", "set files.folder before pulling from files");
2698
+ throw new CliError18("configuration_error", "set files.folder before pulling from files");
2883
2699
  return new FilesSource(await (deps.readFiles ?? readDownloadedFiles)(config.filesFolder), filesZone(config));
2884
2700
  })();
2885
2701
  return activeSource;
@@ -2934,20 +2750,26 @@ var configuredMeetingSource = /* @__PURE__ */ __name(({ deps, getConfig, tokens,
2934
2750
  }, "configuredMeetingSource");
2935
2751
 
2936
2752
  // dist/profile-word.js
2753
+ import { CliError as CliError19 } from "@wirecat/cli-base";
2937
2754
  var PROFILE_HELP = "The first word is the profile whenever it is not a command \u2014 `zm personal meetings list`.\n`ZM_PROFILE` says the same thing for a whole shell session.\nNo profile is assumed: without one, a command that uses an account stops and lists the profiles here.";
2938
2755
  var recordProfile = /* @__PURE__ */ __name((configPath, profile) => {
2939
2756
  const here = readConfig(configPath).profiles;
2940
2757
  if (here.includes(profile))
2941
2758
  return;
2942
2759
  if (here.length)
2943
- throw new CliError("validation_error", `there is no profile ${profile} here \u2014 profiles here: ${here.join(", ")}. A new one starts with \`zm ${profile} session start\`; a typo stores nothing`, { profiles: here });
2760
+ throw new CliError19("validation_error", `there is no profile ${profile} here \u2014 profiles here: ${here.join(", ")}. A new one starts with \`zm ${profile} session start\`; a typo stores nothing`, { profiles: here });
2944
2761
  addProfile(configPath, profile);
2945
2762
  }, "recordProfile");
2946
2763
 
2947
2764
  // dist/progress-commands.js
2948
2765
  import { join as join7 } from "node:path";
2766
+ import { CliError as CliError21 } from "@wirecat/cli-base";
2767
+ import { annotate as annotate5 } from "@wirecat/cli-base/commands";
2768
+ import { itemOf as itemOf3, LOCAL_READ as LOCAL_READ2, progressOf as progressOf2 } from "@wirecat/cli-core";
2949
2769
 
2950
2770
  // dist/sync-progress.js
2771
+ import { CliError as CliError20 } from "@wirecat/cli-base";
2772
+ import { checkpointPath, progressOf, readCheckpoint, saveCheckpoint } from "@wirecat/cli-core";
2951
2773
  var meetingProgress = /* @__PURE__ */ __name((profile, env, now = Date.now) => {
2952
2774
  const path = checkpointPath(zmPaths({ env }).state, profile, "meetings");
2953
2775
  return {
@@ -2959,7 +2781,7 @@ var meetingProgress = /* @__PURE__ */ __name((profile, env, now = Date.now) => {
2959
2781
  read: /* @__PURE__ */ __name(() => {
2960
2782
  const saved = readCheckpoint(path);
2961
2783
  if (saved && (!Number.isSafeInteger(saved.done) || saved.done < 0 || typeof saved.cursor?.complete !== "boolean" || !Number.isFinite(Date.parse(saved.updated_at))))
2962
- throw new CliError("configuration_error", "the saved meeting progress is invalid; run a sync to replace it");
2784
+ throw new CliError20("configuration_error", "the saved meeting progress is invalid; run a sync to replace it");
2963
2785
  return progressOf({
2964
2786
  job: "meetings",
2965
2787
  profile,
@@ -2977,24 +2799,24 @@ var addProgressCommands = /* @__PURE__ */ __name((program, deps) => {
2977
2799
  const meetings = program.commands.find((command) => command.name() === "meetings");
2978
2800
  const recordings = program.commands.find((command) => command.name() === "recordings");
2979
2801
  if (!meetings || !recordings)
2980
- throw new CliError("configuration_error", "the meeting command groups are missing");
2981
- annotate(meetings.command("status"), {
2982
- effects: LOCAL_READ,
2802
+ throw new CliError21("configuration_error", "the meeting command groups are missing");
2803
+ annotate5(meetings.command("status"), {
2804
+ effects: LOCAL_READ2,
2983
2805
  output: { entity: "sync_progress" },
2984
2806
  examples: ["zm personal meetings status --json"]
2985
- }).description("the last meeting ingestion pass: confirmed count, completion and checkpoint age").action(() => deps.output(itemOf(meetingProgress(deps.profile(), deps.env, deps.now).read())));
2986
- annotate(recordings.command("status"), {
2987
- effects: LOCAL_READ,
2807
+ }).description("the last meeting ingestion pass: confirmed count, completion and checkpoint age").action(() => deps.output(itemOf3(meetingProgress(deps.profile(), deps.env, deps.now).read())));
2808
+ annotate5(recordings.command("status"), {
2809
+ effects: LOCAL_READ2,
2988
2810
  output: { entity: "sync_progress" },
2989
2811
  examples: ["zm personal recordings status ./zoom-archive --json"]
2990
2812
  }).description("confirmed archived assets and pending discovery in one archive checkpoint").argument("<directory>", "archive folder").option("--checkpoint <file>", "an explicit archive checkpoint path").action(async (directory, options) => {
2991
2813
  const profile = deps.profile();
2992
2814
  const saved = await inspectRecordingSyncCheckpoint(options.checkpoint ?? join7(directory, ".zoom-archive-sync.json"));
2993
2815
  if (saved && (saved.scope.provider !== "zoom" || saved.scope.account !== profileAccountKey(profile)))
2994
- throw new CliError("permission_error", "the archive checkpoint belongs to another profile");
2816
+ throw new CliError21("permission_error", "the archive checkpoint belongs to another profile");
2995
2817
  const done = saved?.entries.reduce((sum, entry) => sum + entry.acknowledged.length, 0) ?? 0;
2996
2818
  const total = saved?.pendingWindows.length === 0 ? saved.entries.reduce((sum, entry) => sum + entry.assets.length, 0) : void 0;
2997
- deps.output(itemOf(progressOf({
2819
+ deps.output(itemOf3(progressOf2({
2998
2820
  job: "recordings",
2999
2821
  profile,
3000
2822
  done,
@@ -3007,22 +2829,25 @@ var addProgressCommands = /* @__PURE__ */ __name((program, deps) => {
3007
2829
  }, "addProgressCommands");
3008
2830
 
3009
2831
  // dist/recording-schedule-commands.js
2832
+ import { CliError as CliError22 } from "@wirecat/cli-base";
2833
+ import { annotate as annotate6 } from "@wirecat/cli-base/commands";
2834
+ import { FETCH as FETCH2, grantsAuthority as grantsAuthority2, itemOf as itemOf4, LOCAL_READ as LOCAL_READ3, LOCAL_WRITE as LOCAL_WRITE3, listQuery as listQuery2, NO_EFFECTS as NO_EFFECTS5, typedQuery as typedQuery3, unfilteredQuery as unfilteredQuery2, withQuery as withQuery3, writesOwnerFiles } from "@wirecat/cli-core";
3010
2835
  var addRecordingScheduleCommands = /* @__PURE__ */ __name((program, deps) => {
3011
2836
  const deliver = /* @__PURE__ */ __name(async (value) => {
3012
2837
  if (value.applied)
3013
- await deps.receipt(itemOf(value));
2838
+ await deps.receipt(itemOf4(value));
3014
2839
  else
3015
- deps.output(itemOf(value));
2840
+ deps.output(itemOf4(value));
3016
2841
  }, "deliver");
3017
2842
  const recordings = program.commands.find((command) => command.name() === "recordings");
3018
2843
  if (!recordings)
3019
- throw new CliError("configuration_error", "recording command group is unavailable");
3020
- const schedule = annotate(recordings.command("schedule"), { effects: NO_EFFECTS }).description("local archive jobs and Linux user systemd timers");
3021
- const label2 = /* @__PURE__ */ __name((command, example, effects) => annotate(command, { origin: "handwritten", effects, examples: [example] }), "label");
3022
- label2(grantsAuthority(schedule.command("create")).description("preview a daily archive job; --yes installs its timer").requiredOption("--name <name>", "local job name").requiredOption("--output-dir <dir>", "absolute archive directory").requiredOption("--since-time <time>", "first day to archive, YYYY-MM-DD").requiredOption("--at <hh:mm>", "daily time").requiredOption("--timezone <zone>", "IANA timezone for the timer").option("--lookback-days <days>", "revisit the latest zero through 31 UTC days (default seven)", bytes).option("--max-bytes <bytes>", "maximum bytes per recording file (default 20 GiB)", bytes).option("--yes", "install and enable the captured timer").option("--dry-run", "preview even when --yes is present").action(async (options) => {
2844
+ throw new CliError22("configuration_error", "recording command group is unavailable");
2845
+ const schedule = annotate6(recordings.command("schedule"), { effects: NO_EFFECTS5 }).description("local archive jobs and Linux user systemd timers");
2846
+ const label2 = /* @__PURE__ */ __name((command, example, effects) => annotate6(command, { origin: "handwritten", effects, examples: [example] }), "label");
2847
+ label2(grantsAuthority2(schedule.command("create")).description("preview a daily archive job; --yes installs its timer").requiredOption("--name <name>", "local job name").requiredOption("--output-dir <dir>", "absolute archive directory").requiredOption("--since-time <time>", "first day to archive, YYYY-MM-DD").requiredOption("--at <hh:mm>", "daily time").requiredOption("--timezone <zone>", "IANA timezone for the timer").option("--lookback-days <days>", "revisit the latest zero through 31 UTC days (default seven)", bytes).option("--max-bytes <bytes>", "maximum bytes per recording file (default 20 GiB)", bytes).option("--yes", "install and enable the captured timer").option("--dry-run", "preview even when --yes is present").action(async (options) => {
3023
2848
  const offline = deps.offline();
3024
2849
  if (options.yes && !options.dryRun && offline)
3025
- throw new CliError("configuration_error", "archive schedule installation requires online mode");
2850
+ throw new CliError22("configuration_error", "archive schedule installation requires online mode");
3026
2851
  const capture = deps.capture();
3027
2852
  const service = deps.service();
3028
2853
  await deliver(await service.create({
@@ -3034,64 +2859,67 @@ var addRecordingScheduleCommands = /* @__PURE__ */ __name((program, deps) => {
3034
2859
  lookbackDays: options.lookbackDays,
3035
2860
  maxBytes: options.maxBytes
3036
2861
  }, capture, { apply: options.yes, dryRun: options.dryRun, offline, signal: deps.signal() }));
3037
- }), "zm personal recordings schedule create --name daily --output-dir /home/AliceExample/archive --since-time 2026-01-01 --at 03:15 --timezone UTC --json", LOCAL_WRITE);
3038
- const jobsQuery = unfilteredQuery("zoom_archive_job", ZOOM_ANSWER_ENTITIES["recordings schedule list"].schema);
3039
- label2(withQuery(schedule.command("list"), jobsQuery).description("list saved local jobs; live timer state is not checked").action(async (words) => {
3040
- listQuery(typedQuery(words), jobsQuery, "recordings schedule list");
2862
+ }), "zm personal recordings schedule create --name daily --output-dir /home/AliceExample/archive --since-time 2026-01-01 --at 03:15 --timezone UTC --json", LOCAL_WRITE3);
2863
+ const jobsQuery = unfilteredQuery2("zoom_archive_job", ZOOM_ANSWER_ENTITIES["recordings schedule list"].schema);
2864
+ label2(withQuery3(schedule.command("list"), jobsQuery).description("list saved local jobs; live timer state is not checked").action(async (words) => {
2865
+ listQuery2(typedQuery3(words), jobsQuery, "recordings schedule list");
3041
2866
  deps.output(wholeList("recordings schedule list", await deps.service().list({ signal: deps.signal() })));
3042
- }), "zm personal recordings schedule list --offline --json", LOCAL_READ);
2867
+ }), "zm personal recordings schedule list --offline --json", LOCAL_READ3);
3043
2868
  label2(schedule.command("show").description("show one saved local job and its captured settings").argument("<job>", "saved job id").action(async (id) => {
3044
- deps.output(itemOf(await deps.service().show(id, { signal: deps.signal() })));
3045
- }), "zm personal recordings schedule show example-job --offline --json", LOCAL_READ);
2869
+ deps.output(itemOf4(await deps.service().show(id, { signal: deps.signal() })));
2870
+ }), "zm personal recordings schedule show example-job --offline --json", LOCAL_READ3);
3046
2871
  label2(writesOwnerFiles(runsLong(schedule.command("run"))).description("run the captured job once with durable archive progress").argument("<job>", "saved job id").action(async (id) => {
3047
2872
  if (program.opts().json || !program.opts().jsonl && !deps.outputIsTTY)
3048
- throw new CliError("validation_error", "headless archive schedule runs stream receipts; use --jsonl");
2873
+ throw new CliError22("validation_error", "headless archive schedule runs stream receipts; use --jsonl");
3049
2874
  if (deps.offline())
3050
- throw new CliError("configuration_error", "archive schedule run requires online mode");
2875
+ throw new CliError22("configuration_error", "archive schedule run requires online mode");
3051
2876
  for await (const receipt of deps.service().run(id, { offline: deps.offline(), signal: deps.signal() }))
3052
- await deps.receipt(itemOf(receipt));
3053
- }), "zm personal recordings schedule run example-job --dry-run --jsonl", FETCH);
3054
- label2(grantsAuthority(schedule.command("disable")).description("preview disabling a saved timer; --yes disables it without deleting files").argument("<job>", "saved job id").option("--yes", "disable and stop the timer").option("--dry-run", "preview even when --yes is present").action(async (id, options) => {
2877
+ await deps.receipt(itemOf4(receipt));
2878
+ }), "zm personal recordings schedule run example-job --dry-run --jsonl", FETCH2);
2879
+ label2(grantsAuthority2(schedule.command("disable")).description("preview disabling a saved timer; --yes disables it without deleting files").argument("<job>", "saved job id").option("--yes", "disable and stop the timer").option("--dry-run", "preview even when --yes is present").action(async (id, options) => {
3055
2880
  await deliver(await deps.service().disable(id, { apply: options.yes, dryRun: options.dryRun, signal: deps.signal() }));
3056
- }), "zm personal recordings schedule disable example-job --json", LOCAL_WRITE);
2881
+ }), "zm personal recordings schedule disable example-job --json", LOCAL_WRITE3);
3057
2882
  }, "addRecordingScheduleCommands");
3058
2883
 
3059
2884
  // dist/recording-schedule-setup.js
3060
2885
  import { homedir } from "node:os";
3061
2886
  import { dirname as dirname2, join as join10 } from "node:path";
2887
+ import { CliError as CliError27 } from "@wirecat/cli-base";
3062
2888
 
3063
2889
  // dist/recording-schedule.js
3064
2890
  import { isAbsolute } from "node:path";
2891
+ import { CliError as CliError23 } from "@wirecat/cli-base";
2892
+ import { installRecordingArchiveSchedule, parseRecordingArchiveSchedule, planRecordingArchiveSchedule, recordingArchiveScheduleWindow } from "@wirecat/cli-core";
3065
2893
  var text = /* @__PURE__ */ __name((value, limit) => typeof value === "string" && !!value.trim() && value.length <= limit && !/[\0\r\n]/.test(value), "text");
3066
2894
  var absolute = /* @__PURE__ */ __name((value) => text(value, 4096) && isAbsolute(value), "absolute");
3067
2895
  var validateRecordingScheduleId = /* @__PURE__ */ __name((id) => {
3068
2896
  if (typeof id !== "string" || !/^[a-f0-9]{64}$/.test(id))
3069
- throw new CliError("validation_error", "archive schedule id must be 64 lowercase hexadecimal characters");
2897
+ throw new CliError23("validation_error", "archive schedule id must be 64 lowercase hexadecimal characters");
3070
2898
  return id;
3071
2899
  }, "validateRecordingScheduleId");
3072
2900
  var snapshotRecordingScheduleCapture = /* @__PURE__ */ __name((value) => {
3073
2901
  if (!value || typeof value !== "object" || Array.isArray(value))
3074
- throw new CliError("validation_error", "archive schedule capture is invalid");
2902
+ throw new CliError23("validation_error", "archive schedule capture is invalid");
3075
2903
  const { profile, clientId, configDir, runtime, cliPath } = value;
3076
2904
  if (!text(profile, 64) || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(profile) || !text(clientId, 200) || /\s/.test(clientId) || !absolute(configDir) || !absolute(runtime) || !absolute(cliPath))
3077
- throw new CliError("validation_error", "archive schedule requires a profile, public client id and absolute config/runtime/CLI paths");
2905
+ throw new CliError23("validation_error", "archive schedule requires a profile, public client id and absolute config/runtime/CLI paths");
3078
2906
  return Object.freeze({ profile, clientId, configDir, runtime, cliPath });
3079
2907
  }, "snapshotRecordingScheduleCapture");
3080
2908
  var parseRecordingScheduleJob = /* @__PURE__ */ __name((value) => {
3081
2909
  if (!value || typeof value !== "object" || Array.isArray(value))
3082
- throw new CliError("validation_error", "archive schedule job is invalid");
2910
+ throw new CliError23("validation_error", "archive schedule job is invalid");
3083
2911
  const row = value;
3084
2912
  if (row.version !== 1 || Object.keys(row).some((key) => !["version", "schedule", "capture", "state"].includes(key)) || !["pending", "enabled", "disabled"].includes(row.state))
3085
- throw new CliError("validation_error", "archive schedule job is invalid");
2913
+ throw new CliError23("validation_error", "archive schedule job is invalid");
3086
2914
  const capture = snapshotRecordingScheduleCapture(row.capture);
3087
2915
  if (Object.keys(row.capture).some((key) => !["profile", "clientId", "configDir", "runtime", "cliPath"].includes(key)))
3088
- throw new CliError("validation_error", "archive schedule capture is invalid");
2916
+ throw new CliError23("validation_error", "archive schedule capture is invalid");
3089
2917
  const schedule = parseRecordingArchiveSchedule(row.schedule);
3090
2918
  if (schedule.scope.provider !== "zoom" || schedule.scope.account !== profileAccountKey(capture.profile) || !absolute(schedule.destination))
3091
- throw new CliError("validation_error", "archive schedule capture does not match its provider scope");
2919
+ throw new CliError23("validation_error", "archive schedule capture does not match its provider scope");
3092
2920
  const job = Object.freeze({ version: 1, schedule, capture, state: row.state });
3093
2921
  if (Buffer.byteLength(JSON.stringify(job)) > 32 * 1024)
3094
- throw new CliError("validation_error", "archive schedule metadata exceeds its byte limit");
2922
+ throw new CliError23("validation_error", "archive schedule metadata exceeds its byte limit");
3095
2923
  return job;
3096
2924
  }, "parseRecordingScheduleJob");
3097
2925
  var createRecordingScheduleService = /* @__PURE__ */ __name((deps) => {
@@ -3100,10 +2928,10 @@ var createRecordingScheduleService = /* @__PURE__ */ __name((deps) => {
3100
2928
  checkCancelled(options.signal);
3101
2929
  const found = await deps.store.load(id, options);
3102
2930
  if (!found)
3103
- throw new CliError("not_found", "archive schedule was not found");
2931
+ throw new CliError23("not_found", "archive schedule was not found");
3104
2932
  const job = parseRecordingScheduleJob(found);
3105
2933
  if (job.schedule.id !== id)
3106
- throw new CliError("validation_error", "archive schedule storage returned a different job");
2934
+ throw new CliError23("validation_error", "archive schedule storage returned a different job");
3107
2935
  return job;
3108
2936
  }, "show");
3109
2937
  return {
@@ -3118,11 +2946,11 @@ var createRecordingScheduleService = /* @__PURE__ */ __name((deps) => {
3118
2946
  if (options.apply !== true || options.dryRun === true)
3119
2947
  return { applied: false, backend, job, units, timerState: "not_checked" };
3120
2948
  if (options.offline)
3121
- throw new CliError("configuration_error", "archive schedule installation requires online mode");
2949
+ throw new CliError23("configuration_error", "archive schedule installation requires online mode");
3122
2950
  deps.backend.assertSupported();
3123
2951
  const existing = await deps.store.load(schedule.id, { signal: options.signal });
3124
2952
  if (existing && JSON.stringify(parseRecordingScheduleJob(existing).capture) !== JSON.stringify(capture))
3125
- throw new CliError("validation_error", "archive schedule id belongs to a different captured runtime or client; choose a new name");
2953
+ throw new CliError23("validation_error", "archive schedule id belongs to a different captured runtime or client; choose a new name");
3126
2954
  await deps.store.save(job, { signal: options.signal });
3127
2955
  await installRecordingArchiveSchedule({ backend, install: /* @__PURE__ */ __name(async (_, active) => deps.backend.install(job, active), "install") }, schedule, { apply: true, signal: options.signal });
3128
2956
  const enabled = parseRecordingScheduleJob({ ...job, state: "enabled" });
@@ -3137,13 +2965,13 @@ var createRecordingScheduleService = /* @__PURE__ */ __name((deps) => {
3137
2965
  async *run(id, options = {}) {
3138
2966
  options = { ...options };
3139
2967
  if (options.offline)
3140
- throw new CliError("configuration_error", "archive schedule run requires online mode");
2968
+ throw new CliError23("configuration_error", "archive schedule run requires online mode");
3141
2969
  const job = await show(id, { signal: options.signal });
3142
2970
  const window = recordingArchiveScheduleWindow(job.schedule, { now: deps.now?.() ?? Date.now() });
3143
2971
  if (!window)
3144
2972
  return;
3145
2973
  const recordings = deps.recordings(job);
3146
- yield* syncRecordingArchive2(recordings, {
2974
+ yield* syncRecordingArchive(recordings, {
3147
2975
  ...window,
3148
2976
  destination: job.schedule.destination,
3149
2977
  maxBytes: job.schedule.maxBytes,
@@ -3171,11 +2999,13 @@ var createRecordingScheduleService = /* @__PURE__ */ __name((deps) => {
3171
2999
  // dist/recording-schedule-store.js
3172
3000
  import { lstat as lstat3, mkdir as mkdir3, readdir as readdir3 } from "node:fs/promises";
3173
3001
  import { isAbsolute as isAbsolute2, join as join8, parse, relative, sep } from "node:path";
3002
+ import { CliError as CliError24, isCliError as isCliError6 } from "@wirecat/cli-base";
3003
+ import { openOrdinaryFile as openOrdinaryFile4, writeFileAtomic as writeFileAtomic3 } from "@wirecat/cli-core";
3174
3004
  var maximumBytes = 32 * 1024;
3175
3005
  var missing3 = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missing");
3176
3006
  var recordingScheduleDirectory = /* @__PURE__ */ __name(async (directory, create) => {
3177
3007
  if (!isAbsolute2(directory) || /[\0\r\n]/.test(directory))
3178
- throw new CliError("validation_error", "archive schedule directory must be absolute");
3008
+ throw new CliError24("validation_error", "archive schedule directory must be absolute");
3179
3009
  const root = parse(directory).root;
3180
3010
  let path = root;
3181
3011
  for (const segment of relative(root, directory).split(sep).filter(Boolean)) {
@@ -3183,7 +3013,7 @@ var recordingScheduleDirectory = /* @__PURE__ */ __name(async (directory, create
3183
3013
  try {
3184
3014
  const stat2 = await lstat3(path);
3185
3015
  if (stat2.isSymbolicLink() || !stat2.isDirectory())
3186
- throw new CliError("validation_error", "archive schedule directories must not contain symlinks or foreign files");
3016
+ throw new CliError24("validation_error", "archive schedule directories must not contain symlinks or foreign files");
3187
3017
  } catch (error) {
3188
3018
  if (!missing3(error))
3189
3019
  throw error;
@@ -3194,7 +3024,7 @@ var recordingScheduleDirectory = /* @__PURE__ */ __name(async (directory, create
3194
3024
  throw cause;
3195
3025
  const stat2 = await lstat3(path);
3196
3026
  if (stat2.isSymbolicLink() || !stat2.isDirectory())
3197
- throw new CliError("validation_error", "archive schedule directory changed while creating it");
3027
+ throw new CliError24("validation_error", "archive schedule directory changed while creating it");
3198
3028
  });
3199
3029
  }
3200
3030
  }
@@ -3204,7 +3034,7 @@ var read = /* @__PURE__ */ __name(async (path, signal) => {
3204
3034
  checkCancelled(signal);
3205
3035
  let handle;
3206
3036
  try {
3207
- handle = await openOrdinaryFile(path);
3037
+ handle = await openOrdinaryFile4(path);
3208
3038
  } catch (error) {
3209
3039
  if (missing3(error))
3210
3040
  return null;
@@ -3213,19 +3043,19 @@ var read = /* @__PURE__ */ __name(async (path, signal) => {
3213
3043
  try {
3214
3044
  const stat2 = await handle.stat({ bigint: true });
3215
3045
  if (stat2.size > BigInt(maximumBytes))
3216
- throw new CliError("validation_error", "archive schedule metadata exceeds its byte limit");
3046
+ throw new CliError24("validation_error", "archive schedule metadata exceeds its byte limit");
3217
3047
  const bytes2 = Buffer.alloc(maximumBytes + 1);
3218
3048
  const size = (await handle.read(bytes2, 0, bytes2.length, 0)).bytesRead;
3219
3049
  checkCancelled(signal);
3220
3050
  if (size > maximumBytes)
3221
- throw new CliError("validation_error", "archive schedule metadata exceeds its byte limit");
3051
+ throw new CliError24("validation_error", "archive schedule metadata exceeds its byte limit");
3222
3052
  const job = parseRecordingScheduleJob(JSON.parse(bytes2.subarray(0, size).toString("utf8")));
3223
3053
  return { job, stat: stat2 };
3224
3054
  } catch (error) {
3225
- if (isCliError(error))
3055
+ if (isCliError6(error))
3226
3056
  throw error;
3227
3057
  checkCancelled(signal);
3228
- throw new CliError("validation_error", "archive schedule metadata is invalid");
3058
+ throw new CliError24("validation_error", "archive schedule metadata is invalid");
3229
3059
  } finally {
3230
3060
  await handle.close();
3231
3061
  }
@@ -3241,7 +3071,7 @@ var fileRecordingScheduleStore = /* @__PURE__ */ __name((directory) => {
3241
3071
  for (const name of (await readdir3(directory)).filter((name2) => /^[a-f0-9]{64}\.json$/.test(name2)).sort()) {
3242
3072
  const saved = await read(join8(directory, name), options.signal);
3243
3073
  if (!saved || `${saved.job.schedule.id}.json` !== name)
3244
- throw new CliError("validation_error", "archive schedule filename does not match its identity");
3074
+ throw new CliError24("validation_error", "archive schedule filename does not match its identity");
3245
3075
  result.push(saved.job);
3246
3076
  }
3247
3077
  return result;
@@ -3253,7 +3083,7 @@ var fileRecordingScheduleStore = /* @__PURE__ */ __name((directory) => {
3253
3083
  return null;
3254
3084
  const saved = await read(target, options.signal);
3255
3085
  if (saved && saved.job.schedule.id !== id)
3256
- throw new CliError("validation_error", "archive schedule filename does not match its identity");
3086
+ throw new CliError24("validation_error", "archive schedule filename does not match its identity");
3257
3087
  return saved?.job ?? null;
3258
3088
  },
3259
3089
  async save(value, options) {
@@ -3261,14 +3091,14 @@ var fileRecordingScheduleStore = /* @__PURE__ */ __name((directory) => {
3261
3091
  const content = `${JSON.stringify(job)}
3262
3092
  `;
3263
3093
  if (Buffer.byteLength(content) > maximumBytes)
3264
- throw new CliError("validation_error", "archive schedule metadata exceeds its byte limit");
3094
+ throw new CliError24("validation_error", "archive schedule metadata exceeds its byte limit");
3265
3095
  checkCancelled(options.signal);
3266
3096
  await recordingScheduleDirectory(directory, true);
3267
3097
  const target = path(job.schedule.id);
3268
3098
  const existing = await read(target, options.signal);
3269
3099
  if (existing && (existing.job.schedule.id !== job.schedule.id || JSON.stringify(existing.job.capture) !== JSON.stringify(job.capture)))
3270
- throw new CliError("validation_error", "archive schedule file belongs to another captured job");
3271
- await writeFileAtomic(target, content, {
3100
+ throw new CliError24("validation_error", "archive schedule file belongs to another captured job");
3101
+ await writeFileAtomic3(target, content, {
3272
3102
  overwrite: existing !== null,
3273
3103
  beforePublish: /* @__PURE__ */ __name(async () => {
3274
3104
  checkCancelled(options.signal);
@@ -3276,7 +3106,7 @@ var fileRecordingScheduleStore = /* @__PURE__ */ __name((directory) => {
3276
3106
  return;
3277
3107
  const current = await lstat3(target, { bigint: true });
3278
3108
  if (!current.isFile() || current.isSymbolicLink() || current.ino !== existing.stat.ino || current.size !== existing.stat.size || current.mtimeNs !== existing.stat.mtimeNs || current.dev !== 0n && current.dev !== existing.stat.dev && process.platform !== "win32")
3279
- throw new CliError("validation_error", "archive schedule file changed before replacement");
3109
+ throw new CliError24("validation_error", "archive schedule file changed before replacement");
3280
3110
  }, "beforePublish")
3281
3111
  });
3282
3112
  }
@@ -3286,6 +3116,8 @@ var fileRecordingScheduleStore = /* @__PURE__ */ __name((directory) => {
3286
3116
  // dist/recording-schedule-systemd.js
3287
3117
  import { execFile } from "node:child_process";
3288
3118
  import { isAbsolute as isAbsolute3, join as join9 } from "node:path";
3119
+ import { CliError as CliError25, isCliError as isCliError7 } from "@wirecat/cli-base";
3120
+ import { openOrdinaryFile as openOrdinaryFile5, syncDirectory, writeFileAtomic as writeFileAtomic4 } from "@wirecat/cli-core";
3289
3121
  var execute = /* @__PURE__ */ __name((executable, args, options) => new Promise((resolve3, reject) => {
3290
3122
  execFile(executable, [...args], { shell: false, signal: options.signal, timeout: 3e4, maxBuffer: 65536, encoding: "utf8" }, (error) => {
3291
3123
  if (!error)
@@ -3293,8 +3125,8 @@ var execute = /* @__PURE__ */ __name((executable, args, options) => new Promise(
3293
3125
  if (typeof error.code === "number")
3294
3126
  return resolve3({ exitCode: error.code });
3295
3127
  if (error.code === "ENOENT")
3296
- return reject(new CliError("configuration_error", "systemctl is unavailable"));
3297
- reject(new CliError("outcome_unknown", "archive timer command was interrupted; inspect its saved pending job and systemctl status"));
3128
+ return reject(new CliError25("configuration_error", "systemctl is unavailable"));
3129
+ reject(new CliError25("outcome_unknown", "archive timer command was interrupted; inspect its saved pending job and systemctl status"));
3298
3130
  });
3299
3131
  }), "execute");
3300
3132
  var missing4 = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missing");
@@ -3351,7 +3183,7 @@ var maximumUnitBytes = 64 * 1024;
3351
3183
  var existingUnit = /* @__PURE__ */ __name(async (path) => {
3352
3184
  let handle;
3353
3185
  try {
3354
- handle = await openOrdinaryFile(path);
3186
+ handle = await openOrdinaryFile5(path);
3355
3187
  } catch (error) {
3356
3188
  if (missing4(error))
3357
3189
  return null;
@@ -3361,7 +3193,7 @@ var existingUnit = /* @__PURE__ */ __name(async (path) => {
3361
3193
  const bytes2 = Buffer.alloc(maximumUnitBytes + 1);
3362
3194
  const size = (await handle.read(bytes2, 0, bytes2.length, 0)).bytesRead;
3363
3195
  if (size > maximumUnitBytes)
3364
- throw new CliError("validation_error", "archive timer unit exceeds its byte limit");
3196
+ throw new CliError25("validation_error", "archive timer unit exceeds its byte limit");
3365
3197
  return bytes2.subarray(0, size).toString("utf8");
3366
3198
  } finally {
3367
3199
  await handle.close();
@@ -3369,17 +3201,17 @@ var existingUnit = /* @__PURE__ */ __name(async (path) => {
3369
3201
  }, "existingUnit");
3370
3202
  var writeUnit = /* @__PURE__ */ __name(async (directory, name, content, signal) => {
3371
3203
  if (Buffer.byteLength(content) > maximumUnitBytes)
3372
- throw new CliError("validation_error", "archive timer unit exceeds its byte limit");
3204
+ throw new CliError25("validation_error", "archive timer unit exceeds its byte limit");
3373
3205
  const path = join9(directory, name);
3374
3206
  const current = await existingUnit(path);
3375
3207
  if (current !== null) {
3376
3208
  if (current !== content)
3377
- throw new CliError("validation_error", "archive timer unit is foreign or was edited; it was preserved");
3209
+ throw new CliError25("validation_error", "archive timer unit is foreign or was edited; it was preserved");
3378
3210
  await syncDirectory(directory);
3379
3211
  return;
3380
3212
  }
3381
3213
  checkCancelled(signal);
3382
- await writeFileAtomic(path, content, { overwrite: false, beforePublish: /* @__PURE__ */ __name(() => checkCancelled(signal), "beforePublish") });
3214
+ await writeFileAtomic4(path, content, { overwrite: false, beforePublish: /* @__PURE__ */ __name(() => checkCancelled(signal), "beforePublish") });
3383
3215
  }, "writeUnit");
3384
3216
  var createSystemdRecordingArchiveScheduler = /* @__PURE__ */ __name((options) => {
3385
3217
  const directory = options.unitDirectory;
@@ -3387,10 +3219,10 @@ var createSystemdRecordingArchiveScheduler = /* @__PURE__ */ __name((options) =>
3387
3219
  const platform = options.platform ?? process.platform;
3388
3220
  const executor = options.execute ?? execute;
3389
3221
  if (!isAbsolute3(directory) || !isAbsolute3(executable) || /[\0\r\n]/.test(directory + executable))
3390
- throw new CliError("validation_error", "systemd archive paths must be absolute");
3222
+ throw new CliError25("validation_error", "systemd archive paths must be absolute");
3391
3223
  const assertSupported = /* @__PURE__ */ __name(() => {
3392
3224
  if (platform !== "linux")
3393
- throw new CliError("configuration_error", "automatic archive scheduling currently supports Linux user systemd only");
3225
+ throw new CliError25("configuration_error", "automatic archive scheduling currently supports Linux user systemd only");
3394
3226
  }, "assertSupported");
3395
3227
  const checked = /* @__PURE__ */ __name(async (args, expected, signal) => {
3396
3228
  checkCancelled(signal);
@@ -3398,12 +3230,12 @@ var createSystemdRecordingArchiveScheduler = /* @__PURE__ */ __name((options) =>
3398
3230
  try {
3399
3231
  result = await executor(executable, ["--user", ...args], { shell: false, signal });
3400
3232
  } catch (error) {
3401
- if (isCliError(error))
3233
+ if (isCliError7(error))
3402
3234
  throw error;
3403
- throw new CliError("outcome_unknown", "archive timer command did not acknowledge completion; inspect its saved job and systemctl status");
3235
+ throw new CliError25("outcome_unknown", "archive timer command did not acknowledge completion; inspect its saved job and systemctl status");
3404
3236
  }
3405
3237
  if (result.exitCode !== expected)
3406
- throw new CliError("outcome_unknown", "archive timer state was not verified; inspect its saved job and systemctl status");
3238
+ throw new CliError25("outcome_unknown", "archive timer state was not verified; inspect its saved job and systemctl status");
3407
3239
  }, "checked");
3408
3240
  return {
3409
3241
  backend: "systemd-user",
@@ -3415,11 +3247,11 @@ var createSystemdRecordingArchiveScheduler = /* @__PURE__ */ __name((options) =>
3415
3247
  const units = unitPlan(job);
3416
3248
  checkCancelled(active.signal);
3417
3249
  for (const path of [job.capture.runtime, job.capture.cliPath]) {
3418
- const handle = await openOrdinaryFile(path);
3250
+ const handle = await openOrdinaryFile5(path);
3419
3251
  try {
3420
3252
  const stat2 = await handle.stat();
3421
3253
  if (path === job.capture.runtime && (stat2.mode & 73) === 0)
3422
- throw new CliError("validation_error", "scheduled runtime must be executable");
3254
+ throw new CliError25("validation_error", "scheduled runtime must be executable");
3423
3255
  } finally {
3424
3256
  await handle.close();
3425
3257
  }
@@ -3437,9 +3269,9 @@ var createSystemdRecordingArchiveScheduler = /* @__PURE__ */ __name((options) =>
3437
3269
  const units = unitPlan(value);
3438
3270
  checkCancelled(active.signal);
3439
3271
  if (!await recordingScheduleDirectory(directory, false))
3440
- throw new CliError("not_found", "archive timer units were not found");
3272
+ throw new CliError25("not_found", "archive timer units were not found");
3441
3273
  if (await existingUnit(join9(directory, units.serviceName)) !== units.service || await existingUnit(join9(directory, units.timerName)) !== units.timer)
3442
- throw new CliError("validation_error", "archive timer units are foreign or were edited; they were preserved");
3274
+ throw new CliError25("validation_error", "archive timer units are foreign or were edited; they were preserved");
3443
3275
  await checked(["disable", "--now", units.timerName], 0, active.signal);
3444
3276
  await checked(["is-enabled", "--quiet", units.timerName], 1, active.signal);
3445
3277
  await checked(["is-active", "--quiet", units.timerName], 3, active.signal);
@@ -3448,10 +3280,11 @@ var createSystemdRecordingArchiveScheduler = /* @__PURE__ */ __name((options) =>
3448
3280
  }, "createSystemdRecordingArchiveScheduler");
3449
3281
 
3450
3282
  // dist/recordings.js
3283
+ import { CliError as CliError26 } from "@wirecat/cli-base";
3451
3284
  var required = /* @__PURE__ */ __name((value) => {
3452
3285
  const text2 = string2(value);
3453
3286
  if (text2 === null)
3454
- throw new CliError("invalid_response", "Zoom response is missing a required field");
3287
+ throw new CliError26("invalid_response", "Zoom response is missing a required field");
3455
3288
  return text2;
3456
3289
  }, "required");
3457
3290
  var timestamp = /* @__PURE__ */ __name((value, zones) => {
@@ -3466,7 +3299,7 @@ var meeting = /* @__PURE__ */ __name((value, zones) => {
3466
3299
  const row = object(value);
3467
3300
  const id = typeof row.id === "number" && Number.isSafeInteger(row.id) ? String(row.id) : required(row.id);
3468
3301
  if (!Array.isArray(row.recording_files))
3469
- throw new CliError("invalid_response", "Zoom returned invalid recording files");
3302
+ throw new CliError26("invalid_response", "Zoom returned invalid recording files");
3470
3303
  const all = [
3471
3304
  ...row.recording_files,
3472
3305
  ...Array.isArray(row.participant_audio_files) ? row.participant_audio_files : []
@@ -3476,7 +3309,7 @@ var meeting = /* @__PURE__ */ __name((value, zones) => {
3476
3309
  const asset = object(value2);
3477
3310
  const id2 = string2(asset.id);
3478
3311
  if (id2 !== null && seen.has(id2))
3479
- throw new CliError("invalid_response", "Zoom repeated a recording file id");
3312
+ throw new CliError26("invalid_response", "Zoom repeated a recording file id");
3480
3313
  if (id2 !== null)
3481
3314
  seen.add(id2);
3482
3315
  return {
@@ -3504,12 +3337,12 @@ var ZoomRecordings = class {
3504
3337
  }
3505
3338
  catalog(account) {
3506
3339
  if (typeof account !== "string" || !account.trim())
3507
- throw new CliError("validation_error", "recording account is required");
3340
+ throw new CliError26("validation_error", "recording account is required");
3508
3341
  return {
3509
3342
  provider: "zoom",
3510
3343
  list: /* @__PURE__ */ __name(async (options) => {
3511
3344
  if (options.account !== account)
3512
- throw new CliError("validation_error", "recording catalog account cannot be overridden");
3345
+ throw new CliError26("validation_error", "recording catalog account cannot be overridden");
3513
3346
  const page = await this.listPage(options);
3514
3347
  return {
3515
3348
  items: page.items.map(({ uuid, ...item }) => ({ ...item, externalId: uuid })),
@@ -3522,27 +3355,27 @@ var ZoomRecordings = class {
3522
3355
  const dates = [options.from, options.to].map((date) => {
3523
3356
  const instant = Date.parse(`${date}T00:00:00Z`);
3524
3357
  if (!/^\d{4}-\d{2}-\d{2}$/.test(date) || !Number.isFinite(instant) || new Date(instant).toISOString().slice(0, 10) !== date)
3525
- throw new CliError("validation_error", "recording dates must be valid YYYY-MM-DD dates");
3358
+ throw new CliError26("validation_error", "recording dates must be valid YYYY-MM-DD dates");
3526
3359
  return instant;
3527
3360
  });
3528
3361
  const difference = (dates[1] ?? 0) - (dates[0] ?? 0);
3529
3362
  if (difference < 0 || difference > 31 * 864e5)
3530
- throw new CliError("validation_error", "recording date range must be ordered and at most one month");
3363
+ throw new CliError26("validation_error", "recording date range must be ordered and at most one month");
3531
3364
  if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !options.cursor.trim() || options.cursor.length > 4096))
3532
- throw new CliError("validation_error", "invalid recording pagination cursor");
3365
+ throw new CliError26("validation_error", "invalid recording pagination cursor");
3533
3366
  const signal = operationSignal(options.signal);
3534
3367
  const query = new URLSearchParams({ from: options.from, to: options.to, page_size: "100" });
3535
3368
  if (options.cursor !== void 0)
3536
3369
  query.set("next_page_token", options.cursor);
3537
3370
  const body = await this.remote.request(`/users/me/recordings?${query}`, "cloud_recording:read:list_user_recordings", { signal });
3538
3371
  if (!Array.isArray(body.meetings) || body.meetings.length > 1e3)
3539
- throw new CliError("invalid_response", "Zoom returned an invalid recording list");
3372
+ throw new CliError26("invalid_response", "Zoom returned an invalid recording list");
3540
3373
  const items = body.meetings.map((row) => meeting(row, this.zones));
3541
3374
  if (body.next_page_token !== void 0 && body.next_page_token !== null && body.next_page_token !== "" && (typeof body.next_page_token !== "string" || !body.next_page_token.trim()))
3542
- throw new CliError("invalid_response", "Zoom returned an invalid recording pagination cursor");
3375
+ throw new CliError26("invalid_response", "Zoom returned an invalid recording pagination cursor");
3543
3376
  const nextCursor = string2(body.next_page_token);
3544
3377
  if (nextCursor !== null && nextCursor.length > 4096)
3545
- throw new CliError("invalid_response", "Zoom returned an oversized pagination cursor");
3378
+ throw new CliError26("invalid_response", "Zoom returned an oversized pagination cursor");
3546
3379
  return { items, nextCursor };
3547
3380
  }
3548
3381
  async list(options) {
@@ -3551,27 +3384,27 @@ var ZoomRecordings = class {
3551
3384
  let cursor;
3552
3385
  for (let pages = 0; ; pages++) {
3553
3386
  if (pages >= 1e3)
3554
- throw new CliError("invalid_response", "recording catalog page limit exceeded");
3387
+ throw new CliError26("invalid_response", "recording catalog page limit exceeded");
3555
3388
  const page = await this.listPage({ ...options, ...cursor === void 0 ? {} : { cursor } });
3556
3389
  for (const item of page.items) {
3557
3390
  const previous = meetings.get(item.uuid);
3558
3391
  if (previous && JSON.stringify(previous) !== JSON.stringify(item))
3559
- throw new CliError("invalid_response", "Zoom returned conflicting recording occurrences");
3392
+ throw new CliError26("invalid_response", "Zoom returned conflicting recording occurrences");
3560
3393
  if (!previous && meetings.size >= 1e4)
3561
- throw new CliError("invalid_response", "recording catalog occurrence limit exceeded");
3394
+ throw new CliError26("invalid_response", "recording catalog occurrence limit exceeded");
3562
3395
  meetings.set(item.uuid, item);
3563
3396
  }
3564
3397
  if (page.nextCursor === null)
3565
3398
  return [...meetings.values()];
3566
3399
  if (cursors.has(page.nextCursor))
3567
- throw new CliError("invalid_response", "Zoom repeated a pagination token");
3400
+ throw new CliError26("invalid_response", "Zoom repeated a pagination token");
3568
3401
  cursors.add(page.nextCursor);
3569
3402
  cursor = page.nextCursor;
3570
3403
  }
3571
3404
  }
3572
3405
  async details(id, signal) {
3573
3406
  if (!id.trim())
3574
- throw new CliError("validation_error", "recording meeting id is required");
3407
+ throw new CliError26("validation_error", "recording meeting id is required");
3575
3408
  const body = await this.remote.request(`/meetings/${encodeUuid(id)}/recordings`, "cloud_recording:read:list_recording_files", { ...signal ? { signal } : {} });
3576
3409
  const item = meeting(body, this.zones);
3577
3410
  const rows = [
@@ -3614,7 +3447,7 @@ var zoomRecordingSchedule = /* @__PURE__ */ __name(({ deps, getConfig, profile,
3614
3447
  }),
3615
3448
  recordings: /* @__PURE__ */ __name((job) => {
3616
3449
  if (!sameConfigFolder(dirname2(deps.configPath), job.capture.configDir, { env }) || profile() !== job.capture.profile || zoomClientId(readConfig(deps.configPath), deps.env ?? process.env) !== job.capture.clientId)
3617
- throw new CliError("configuration_error", "archive schedule requires its saved profile and Zoom client id; select those settings before running");
3450
+ throw new CliError27("configuration_error", "archive schedule requires its saved profile and Zoom client id; select those settings before running");
3618
3451
  return new ZoomRecordings(new TokenManager({
3619
3452
  ...deps.tokens.options,
3620
3453
  clientId: job.capture.clientId,
@@ -3632,9 +3465,9 @@ var zoomRecordingSchedule = /* @__PURE__ */ __name(({ deps, getConfig, profile,
3632
3465
  const clientId = zoomClientId(getConfig(), deps.env ?? process.env);
3633
3466
  const named = profile();
3634
3467
  if (!clientId)
3635
- throw new CliError("configuration_error", "archive schedules require a configured Zoom client id");
3468
+ throw new CliError27("configuration_error", "archive schedules require a configured Zoom client id");
3636
3469
  if (!deps.recordingScheduleTarget)
3637
- throw new CliError("configuration_error", "archive scheduler requires an explicit runtime and CLI path");
3470
+ throw new CliError27("configuration_error", "archive scheduler requires an explicit runtime and CLI path");
3638
3471
  return {
3639
3472
  profile: named,
3640
3473
  clientId,
@@ -3647,6 +3480,8 @@ var zoomRecordingSchedule = /* @__PURE__ */ __name(({ deps, getConfig, profile,
3647
3480
  }, "zoomRecordingSchedule");
3648
3481
 
3649
3482
  // dist/remote-meetings.js
3483
+ import { CliError as CliError28 } from "@wirecat/cli-base";
3484
+ import { createMeetingManagement, dispatchMeetingMutation, validateMeetingChange } from "@wirecat/cli-core";
3650
3485
  var normalized = /* @__PURE__ */ __name((value) => {
3651
3486
  const row = object(value);
3652
3487
  const id = typeof row.id === "number" && Number.isSafeInteger(row.id) ? String(row.id) : required(row.id);
@@ -3665,9 +3500,9 @@ var normalized = /* @__PURE__ */ __name((value) => {
3665
3500
  }, "normalized");
3666
3501
  var changeBody = /* @__PURE__ */ __name((change, create) => {
3667
3502
  if (!change || Object.keys(change).some((key) => !["topic", "startTime", "durationMinutes", "timezone", "agenda", "type"].includes(key)))
3668
- throw new CliError("validation_error", "unsupported meeting change field");
3503
+ throw new CliError28("validation_error", "unsupported meeting change field");
3669
3504
  if (change.type !== void 0 && change.type !== 1 && change.type !== 2)
3670
- throw new CliError("validation_error", "only instant or scheduled meeting types are supported");
3505
+ throw new CliError28("validation_error", "only instant or scheduled meeting types are supported");
3671
3506
  const neutral = {
3672
3507
  ...change.topic !== void 0 ? { title: change.topic } : {},
3673
3508
  ...change.type !== void 0 ? { kind: change.type === 1 ? "instant" : "scheduled" } : {},
@@ -3712,7 +3547,7 @@ var ZoomRemoteMeetings = class {
3712
3547
  try {
3713
3548
  return normalized(body);
3714
3549
  } catch {
3715
- throw new CliError("outcome_unknown", "Zoom mutation returned incomplete meeting details; verify remote state before retrying");
3550
+ throw new CliError28("outcome_unknown", "Zoom mutation returned incomplete meeting details; verify remote state before retrying");
3716
3551
  }
3717
3552
  }
3718
3553
  return void 0;
@@ -3731,7 +3566,7 @@ var ZoomRemoteMeetings = class {
3731
3566
  cancel(id, options = {}) {
3732
3567
  const path = zoomMeetingPath(id);
3733
3568
  if (options.occurrenceId !== void 0 && !string2(options.occurrenceId))
3734
- throw new CliError("validation_error", "occurrence id must be nonempty");
3569
+ throw new CliError28("validation_error", "occurrence id must be nonempty");
3735
3570
  const query = options.occurrenceId ? `?${new URLSearchParams({ occurrence_id: options.occurrenceId })}` : "";
3736
3571
  return this.mutate("cancel", { method: "DELETE", path: `${path}${query}` }, "meeting:delete:meeting", options);
3737
3572
  }
@@ -3761,7 +3596,7 @@ var createZoomMeetingManagement = /* @__PURE__ */ __name((remote, account) => cr
3761
3596
  create: /* @__PURE__ */ __name(async (change, { signal }) => {
3762
3597
  const receipt = await remote.create({ ...zoomChange(change), type: 2 }, { apply: true, signal });
3763
3598
  if (!receipt.meeting)
3764
- throw new CliError("outcome_unknown", "Zoom did not acknowledge the created meeting");
3599
+ throw new CliError28("outcome_unknown", "Zoom did not acknowledge the created meeting");
3765
3600
  return managedMeeting(receipt.meeting);
3766
3601
  }, "create"),
3767
3602
  update: /* @__PURE__ */ __name(async (id, change, { signal }) => {
@@ -3798,7 +3633,7 @@ var lazyRemote = /* @__PURE__ */ __name((make) => {
3798
3633
  };
3799
3634
  }, "lazyRemote");
3800
3635
  var unbound = /* @__PURE__ */ __name(() => {
3801
- throw new CliError("configuration_error", "no Zoom account is open for this command");
3636
+ throw new CliError28("configuration_error", "no Zoom account is open for this command");
3802
3637
  }, "unbound");
3803
3638
  var leaves = /* @__PURE__ */ __name((command) => command.commands.length ? command.commands.flatMap(leaves) : [command], "leaves");
3804
3639
  var storeLeaves = /* @__PURE__ */ __name((program, before, management) => {
@@ -3807,6 +3642,8 @@ var storeLeaves = /* @__PURE__ */ __name((program, before, management) => {
3807
3642
  }, "storeLeaves");
3808
3643
 
3809
3644
  // dist/request-events.js
3645
+ import { isCliError as isCliError8 } from "@wirecat/cli-base";
3646
+ import { currentAttempt, providerRequest } from "@wirecat/cli-core";
3810
3647
  var SEGMENT = /^(?:v\d+|[a-z][a-z_]{0,23})$/;
3811
3648
  var operationOf = /* @__PURE__ */ __name((method, url) => {
3812
3649
  let path;
@@ -3875,14 +3712,20 @@ var observedFetch = /* @__PURE__ */ __name((fetcher, sink) => async (input, init
3875
3712
  }
3876
3713
  return response;
3877
3714
  } catch (error) {
3878
- answered({ error, errorCode: isCliError(error) ? error.code : "network_error" });
3715
+ answered({ error, errorCode: isCliError8(error) ? error.code : "network_error" });
3879
3716
  throw error;
3880
3717
  }
3881
3718
  }, "observedFetch");
3882
3719
 
3720
+ // dist/setup-commands.js
3721
+ import { CliError as CliError29 } from "@wirecat/cli-base";
3722
+ import { annotate as annotate8 } from "@wirecat/cli-base/commands";
3723
+ import { environmentOf, grantsAuthority as grantsAuthority3, itemOf as itemOf5, LOCAL_READ as LOCAL_READ4, LOCAL_WRITE as LOCAL_WRITE4, NO_EFFECTS as NO_EFFECTS6, settingRows } from "@wirecat/cli-core";
3724
+
3883
3725
  // dist/account-removal.js
3884
3726
  import { readdirSync, readFileSync } from "node:fs";
3885
3727
  import { dirname as dirname3, join as join11 } from "node:path";
3728
+ import { accountRemoveCommand } from "@wirecat/cli-core";
3886
3729
  var activeSchedule = /* @__PURE__ */ __name((configPath, profile) => {
3887
3730
  const directory = join11(dirname3(configPath), "recording-schedules");
3888
3731
  let names;
@@ -3915,6 +3758,7 @@ var zoomRemoval = /* @__PURE__ */ __name(({ configPath, tokens }) => ({
3915
3758
  var zoomAccountRemoveCommand = /* @__PURE__ */ __name((deps) => accountRemoveCommand(ZM, zoomRemoval(deps)), "zoomAccountRemoveCommand");
3916
3759
 
3917
3760
  // dist/models-commands.js
3761
+ import { modelCatalogueCommand } from "@wirecat/cli-core";
3918
3762
  var addModelsCommands = /* @__PURE__ */ __name((program, deps) => {
3919
3763
  program.addCommand(modelCatalogueCommand({ command: "zm", appName: "zoom-cli", envPrefix: "ZM", description: "Zoom meetings", version: "" }, {
3920
3764
  kinds: ["audio"],
@@ -3927,74 +3771,10 @@ var addModelsCommands = /* @__PURE__ */ __name((program, deps) => {
3927
3771
 
3928
3772
  // dist/upgrade.js
3929
3773
  import { join as join12 } from "node:path";
3930
-
3931
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/update/index.js
3932
- import { realpathSync } from "node:fs";
3933
- import { fileURLToPath as fileURLToPath2 } from "node:url";
3934
- var npmRegistry = /* @__PURE__ */ __name(() => hostFetch({ hosts: ["registry.npmjs.org"] }), "npmRegistry");
3935
- var QUIET_WORDS = [
3936
- "--help",
3937
- "-h",
3938
- "--version",
3939
- "-V",
3940
- "--json",
3941
- "--jsonl",
3942
- "--dry-run",
3943
- "--timeout",
3944
- "commands"
3945
- ];
3946
- var appUpdate = /* @__PURE__ */ __name((app) => {
3947
- const quietWords = app.quietWords ?? QUIET_WORDS;
3948
- const installer2 = /* @__PURE__ */ __name(({ scriptPath } = {}) => installerOf(scriptPath ?? realpathSync(fileURLToPath2(app.entry))), "installer");
3949
- const enabled = /* @__PURE__ */ __name((env) => {
3950
- try {
3951
- return app.enabled(env);
3952
- } catch {
3953
- return false;
3954
- }
3955
- }, "enabled");
3956
- return {
3957
- installer: installer2,
3958
- latest: /* @__PURE__ */ __name((environment = {}) => latestVersion(app.packageName, environment.fetch ?? npmRegistry(), { timeoutMs: 3e3 }), "latest"),
3959
- /** The package manager's output goes to stderr, so stdout stays one result. */
3960
- runUpdate: /* @__PURE__ */ __name((argv, environment = {}) => environment.spawn ? environment.spawn(argv) : runUpdate(argv), "runUpdate"),
3961
- /**
3962
- * The daily "a newer version exists" line, or `undefined`. Started beside the command and awaited
3963
- * after it, so asking npm costs the command nothing; any failure is silence, never an error.
3964
- */
3965
- updateNotice: /* @__PURE__ */ __name((argv, { tty, environment = {}, env = process.env } = {}) => {
3966
- try {
3967
- const delimiter = argv.indexOf("--");
3968
- const options = argv.slice(0, delimiter < 0 ? void 0 : delimiter);
3969
- const quiet = options.some((word) => quietWords.some((quietWord) => word === quietWord || word.startsWith(`${quietWord}=`)));
3970
- if (quiet)
3971
- return Promise.resolve(void 0);
3972
- const pretty = !argv.includes("--json") && !argv.includes("--jsonl") && (tty ?? process.stdout.isTTY === true);
3973
- return updateNotice({
3974
- argv,
3975
- packageName: app.packageName,
3976
- command: app.command,
3977
- version: app.version,
3978
- statePath: app.statePath(env),
3979
- fetch: environment.fetch ?? npmRegistry(),
3980
- ...environment.now ? { now: environment.now } : {},
3981
- format: pretty ? "pretty" : "json",
3982
- stderrIsTTY: environment.stderrIsTTY ?? process.stderr.isTTY === true,
3983
- quiet: argv.includes("--quiet"),
3984
- enabled: enabled(env),
3985
- installer: installer2(environment),
3986
- env,
3987
- offVariables: app.offVariables
3988
- });
3989
- } catch {
3990
- return Promise.resolve(void 0);
3991
- }
3992
- }, "updateNotice")
3993
- };
3994
- }, "appUpdate");
3995
-
3996
- // dist/upgrade.js
3997
- var { installer, latest, runUpdate: runUpdate2 } = appUpdate({
3774
+ import { createRenderer } from "@wirecat/cli-base";
3775
+ import { annotate as annotate7 } from "@wirecat/cli-base/commands";
3776
+ import { appUpdate, FETCH as FETCH3, overrideSharedContract, upgradeCommand } from "@wirecat/cli-core";
3777
+ var { installer, latest, runUpdate } = appUpdate({
3998
3778
  packageName: "@wirecat/zoom-cli",
3999
3779
  command: "zm",
4000
3780
  version: VERSION,
@@ -4012,10 +3792,10 @@ var addUpgradeCommand = /* @__PURE__ */ __name((program, streams) => {
4012
3792
  streams,
4013
3793
  installer: /* @__PURE__ */ __name(() => installer(), "installer"),
4014
3794
  latest: /* @__PURE__ */ __name(() => latest(), "latest"),
4015
- install: /* @__PURE__ */ __name((argv) => runUpdate2(argv), "install")
3795
+ install: /* @__PURE__ */ __name((argv) => runUpdate(argv), "install")
4016
3796
  };
4017
3797
  }), "Zoom upgrade checks npm and may install files, so it explicitly declares both the network read and local write.", (command) => {
4018
- annotate(command, { effects: FETCH });
3798
+ annotate7(command, { effects: FETCH3 });
4019
3799
  }));
4020
3800
  upgrade.commands.find((command) => command.name() === "upgrade")?.copyInheritedSettings(program);
4021
3801
  }, "addUpgradeCommand");
@@ -4023,181 +3803,74 @@ var addUpgradeCommand = /* @__PURE__ */ __name((program, streams) => {
4023
3803
  // dist/setup-commands.js
4024
3804
  var refuseAgentPermissions = /* @__PURE__ */ __name((command, key) => {
4025
3805
  if (environmentOf(command).agent && (key === "permissions" || key.startsWith("permissions.")))
4026
- throw new CliError("permission_error", "change profile permissions in a terminal");
3806
+ throw new CliError29("permission_error", "change profile permissions in a terminal");
4027
3807
  }, "refuseAgentPermissions");
4028
3808
  var addConfigCommands = /* @__PURE__ */ __name((program, { configPath, output, warn, named }) => {
4029
- const cfg = annotate(program.command("config"), { effects: NO_EFFECTS }).description("local Zoom configuration");
4030
- annotate(cfg.command("show"), { effects: LOCAL_READ }).description("show local configuration").action(() => {
3809
+ const cfg = annotate8(program.command("config"), { effects: NO_EFFECTS6 }).description("local Zoom configuration");
3810
+ annotate8(cfg.command("show"), { effects: LOCAL_READ4 }).description("show local configuration").action(() => {
4031
3811
  const { config, issues, raw } = inspectConfig(configPath, permissionKeys(program));
4032
- output(itemOf({ ...config, settings: settingRows(raw ?? {}, ZOOM_SETTINGS) }));
3812
+ output(itemOf5({ ...config, settings: settingRows(raw ?? {}, ZOOM_SETTINGS) }));
4033
3813
  for (const issue of issues)
4034
3814
  warn(`${issue.what}, so it is left out${issue.fix ? ` \u2014 \`${issue.fix}\` removes it` : ""}`);
4035
3815
  });
4036
- grantsAuthority(annotate(cfg.command("set"), { effects: LOCAL_WRITE })).description("set a configuration value").argument("<key>", "setting name, such as zoom.client_id").argument("<value>", "new value").action(function(key, value) {
3816
+ grantsAuthority3(annotate8(cfg.command("set"), { effects: LOCAL_WRITE4 })).description("set a configuration value").argument("<key>", "setting name, such as zoom.client_id").argument("<value>", "new value").action(function(key, value) {
4037
3817
  refuseAgentPermissions(this, key);
4038
- output(itemOf(setConfig(configPath, key, value, named, permissionKeys(program))));
3818
+ output(itemOf5(setConfig(configPath, key, value, named, permissionKeys(program))));
4039
3819
  });
4040
- grantsAuthority(annotate(cfg.command("unset"), { effects: LOCAL_WRITE, examples: ["zm config unset files.folder"] })).description("remove a setting, or a part of the file doctor reports a problem in").argument("<key>", "setting name, such as files.folder, or the key a doctor fix names").action(function(key) {
3820
+ grantsAuthority3(annotate8(cfg.command("unset"), { effects: LOCAL_WRITE4, examples: ["zm config unset files.folder"] })).description("remove a setting, or a part of the file doctor reports a problem in").argument("<key>", "setting name, such as files.folder, or the key a doctor fix names").action(function(key) {
4041
3821
  refuseAgentPermissions(this, key);
4042
- output(itemOf(unsetConfig(configPath, key, named(), permissionKeys(program))));
3822
+ output(itemOf5(unsetConfig(configPath, key, named(), permissionKeys(program))));
4043
3823
  });
4044
- grantsAuthority(annotate(cfg.command("migrate"), { effects: LOCAL_WRITE, examples: ["zm config migrate"] })).description("write each setting the file lacks at its default, keeping yours").action(() => {
3824
+ grantsAuthority3(annotate8(cfg.command("migrate"), { effects: LOCAL_WRITE4, examples: ["zm config migrate"] })).description("write each setting the file lacks at its default, keeping yours").action(() => {
4045
3825
  const added = migrateConfig(configPath);
4046
- output(itemOf({ config_file: configPath, added }));
3826
+ output(itemOf5({ config_file: configPath, added }));
4047
3827
  warn(added.length > 0 ? `added ${added.join(", ")} to ${configPath}` : `${configPath} already has every setting`);
4048
3828
  });
4049
3829
  }, "addConfigCommands");
4050
3830
  var addAppCommand = /* @__PURE__ */ __name((program, { output, buffer, pretty }) => {
4051
- annotate(program.command("app"), { effects: NO_EFFECTS, examples: ["zm app", "zm app --json"] }).description("what to enter when you make the Zoom app zm signs in with").action(() => {
3831
+ annotate8(program.command("app"), { effects: NO_EFFECTS6, examples: ["zm app", "zm app --json"] }).description("what to enter when you make the Zoom app zm signs in with").action(() => {
4052
3832
  if (pretty())
4053
3833
  buffer(`${zoomAppChecklist()}
4054
3834
  `);
4055
3835
  else
4056
- output(itemOf(zoomAppSetup()));
3836
+ output(itemOf5(zoomAppSetup()));
4057
3837
  });
4058
3838
  }, "addAppCommand");
4059
- var PASTE_PROMPT = "If the browser does not come back by itself, the address it ended on (code=\u2026&state=\u2026)";
4060
- var savedLogin = /* @__PURE__ */ __name((manager, now) => {
4061
- const saved = manager.load();
4062
- return {
4063
- state: saved ? saved.expiresAt > now ? "saved" : "expired" : "missing",
4064
- ...saved ? { expiresAt: saved.expiresAt, scopes: saved.scopes } : {}
4065
- };
4066
- }, "savedLogin");
4067
- var addSessionCommands = /* @__PURE__ */ __name((program, context) => {
4068
- const { deps, getConfig, output, buffer, api, profile, tokens, fetch, signal } = context;
4069
- addStandardCommands(program, {
4070
- output,
4071
- raw: buffer,
4072
- sessionStatus: /* @__PURE__ */ __name(async (check) => {
4073
- const config = getConfig();
4074
- const selected = profile();
4075
- if (!zoomClientId(config, deps.env ?? process.env))
4076
- return { configured: false, state: "not_configured", profile: selected, verified: false };
4077
- if (check) {
4078
- if (program.opts().offline)
4079
- throw new CliError("configuration_error", "session verification requires network access; remove --offline");
4080
- api();
4081
- return {
4082
- configured: true,
4083
- state: "verified",
4084
- profile: selected,
4085
- verified: true,
4086
- zoomUser: await (deps.checkSession ? deps.checkSession({ signal: signal() }) : getZoomProfile(tokens(), fetch(), { signal: signal() }))
4087
- };
4088
- }
4089
- return {
4090
- configured: true,
4091
- profile: selected,
4092
- verified: false,
4093
- ...savedLogin(tokens(), deps.now?.() ?? Date.now())
4094
- };
4095
- }, "sessionStatus"),
4096
- sessionList: /* @__PURE__ */ __name(async () => {
4097
- const config = getConfig();
4098
- const configured2 = zoomClientId(config, deps.env ?? process.env) !== void 0;
4099
- return config.profiles.map((name) => {
4100
- let login2;
4101
- try {
4102
- login2 = savedLogin(deps.tokens.forProfile(name), deps.now?.() ?? Date.now());
4103
- } catch (error) {
4104
- if (isCliError(error) && error.code === "configuration_error")
4105
- return { profile: name, signed_in: null, state: "unknown" };
4106
- throw error;
4107
- }
4108
- return {
4109
- profile: name,
4110
- signed_in: login2.state !== "missing",
4111
- ...configured2 ? login2 : { state: "not_configured" }
4112
- };
4113
- });
4114
- }, "sessionList")
4115
- });
3839
+ var addSharedCommands = /* @__PURE__ */ __name((program, { deps, buffer, output }) => {
3840
+ addStandardCommands(program);
4116
3841
  addUpgradeCommand(program, { data: buffer, diagnostic: deps.diagnostic });
4117
3842
  addModelsCommands(program, { env: /* @__PURE__ */ __name(() => deps.env ?? process.env, "env"), output, diagnostic: deps.diagnostic });
4118
- const session = program.commands.find((command) => command.name() === "session");
4119
- if (!session)
4120
- throw new CliError("configuration_error", "session command group is unavailable");
4121
- const start = session.command("start").description("log in to Zoom through your browser").option("--browser <program>", "browser program").option("--client-id <id>", "the Public Client ID of your Zoom app; saved as zoom.client_id once you sign in").option("--credential-storage <storage>", "where the login is kept: keyring (the default, which falls back to a private file by itself when no keyring works), or file, not recommended", "keyring").addOption(answerStdinOption()).action(async (opts) => {
4122
- if (opts.credentialStorage !== "keyring" && opts.credentialStorage !== "file")
4123
- throw new CliError("validation_error", "--credential-storage takes keyring or file");
4124
- const storage = opts.credentialStorage;
4125
- const config = getConfig();
4126
- const selected = profile();
4127
- refuseCommandName(selected, commandWords(program), "zm");
4128
- if (opts.clientId !== void 0)
4129
- checkedClientId(opts.clientId);
4130
- const known = zoomApp({
4131
- env: deps.env ?? process.env,
4132
- configClientId: config.clientId,
4133
- clientId: opts.clientId
4134
- })?.client.clientId;
4135
- if (!known && opts.answerStdin !== true)
4136
- throw new CliError("configuration_error", SET_ZOOM_APP, { reason: CLIENT_ID_MISSING });
4137
- const globals = program.opts();
4138
- if (globals.offline)
4139
- throw new CliError("configuration_error", "login requires network access; remove --offline");
4140
- if (globals.input === false)
4141
- throw new CliError("configuration_error", "login requires browser approval; remove --no-input");
4142
- if (deps.env?.CI)
4143
- throw new CliError("configuration_error", `login requires browser approval; run zm ${selected} session start yourself`);
4144
- const steps = signInSteps({
4145
- diagnostic: /* @__PURE__ */ __name((line) => deps.diagnostic(`${line}
4146
- `), "diagnostic"),
4147
- json: globals.json === true || globals.jsonl === true,
4148
- answers: opts.answerStdin === true,
4149
- ...deps.stdin ? { input: deps.stdin } : {}
4150
- });
4151
- const clientId = known ?? checkedClientId(await steps.ask(CLIENT_ID_NEED, signal()));
4152
- const chosen = opts.clientId ?? (known ? void 0 : clientId);
4153
- const done = await login({
4154
- tokens: (chosen ? new TokenManager({ ...tokens().options, clientId }) : tokens()).storedIn(storage),
4155
- signal: signal(),
4156
- openBrowser: /* @__PURE__ */ __name((url) => deps.openBrowser(url, opts.browser), "openBrowser"),
4157
- readPaste: steps.answers ? (stop) => steps.ask({ field: "redirect", secret: true, prompt: PASTE_PROMPT }, stop).catch((error) => stop.aborted ? new Promise(() => {
4158
- }) : Promise.reject(error)) : deps.readPaste,
4159
- showUrl: /* @__PURE__ */ __name((url) => steps.answers ? steps.openUrl(url, "Approve access to Zoom in the browser") : (
4160
- // Without a terminal this line is all an agent can pass on, so --quiet keeps it.
4161
- deps.diagnostic(`Open this URL to approve Zoom login:
4162
- ${url}
4163
- `)
4164
- ), "showUrl")
4165
- });
4166
- if (chosen)
4167
- setConfig(deps.configPath, "zoom.client_id", chosen);
4168
- addProfile(deps.configPath, selected);
4169
- output(itemOf({ ...done, profile: selected }));
4170
- });
4171
- logsInOrOut(annotate(start, { effects: REMOTE_WRITE, lifetime: "interactive" }));
4172
- logsInOrOut(annotate(session.command("end").description("delete this profile's saved Zoom login; the stored meetings stay").action(() => {
4173
- const selected = profile();
4174
- output(itemOf({ profile: selected, ended: tokens().remove(), meetings: "retained" }));
4175
- }), { effects: LOCAL_WRITE, mcp: false, examples: ["zm personal session end"] }));
4176
- annotate(program.command("account"), { effects: NO_EFFECTS }).description("the profile's login and data on this computer").addCommand(zoomAccountRemoveCommand(deps));
4177
- }, "addSessionCommands");
3843
+ annotate8(program.command("account"), { effects: NO_EFFECTS6 }).description("the profile's login and data on this computer").addCommand(zoomAccountRemoveCommand(deps));
3844
+ }, "addSharedCommands");
3845
+
3846
+ // dist/store-commands.js
3847
+ import { CliError as CliError41 } from "@wirecat/cli-base";
3848
+ import { addMeetingBatchCommand, addMeetingPassageCommand, addMeetingProjectCandidatesCommand, environmentOf as environmentOf2, formatMeetingBatch, passageForRun } from "@wirecat/cli-core";
4178
3849
 
4179
3850
  // dist/archive-import.js
4180
3851
  import { createHash as createHash5 } from "node:crypto";
3852
+ import { CliError as CliError30, isCliError as isCliError9 } from "@wirecat/cli-base";
3853
+ import { transcriptLanguage } from "@wirecat/cli-core";
4181
3854
  var plans = /* @__PURE__ */ new WeakMap();
4182
3855
  var preflightArchiveImport = /* @__PURE__ */ __name(async (destination, options = {}) => {
4183
3856
  const maximum = options.maxTotalBytes === void 0 ? 64 * 1024 ** 2 : options.maxTotalBytes;
4184
3857
  if (!Number.isSafeInteger(maximum) || maximum <= 0)
4185
- throw new CliError("validation_error", "aggregate transcript byte limit must be a positive integer");
3858
+ throw new CliError30("validation_error", "aggregate transcript byte limit must be a positive integer");
4186
3859
  const prepared = /* @__PURE__ */ new Map();
4187
3860
  let verifiedAssets = 0;
4188
3861
  let totalBytes = 0;
4189
3862
  for await (const { meeting: meeting2, asset, cues } of readArchiveTranscripts(destination, options)) {
4190
3863
  checkCancelled(options.signal);
4191
3864
  if (cues.some((cue) => !Number.isSafeInteger(cue.startMs) || !Number.isSafeInteger(cue.endMs) || cue.startMs < 0 || cue.endMs < cue.startMs))
4192
- throw new CliError("validation_error", "archive transcript cue times must be safe nonnegative ordered integers");
3865
+ throw new CliError30("validation_error", "archive transcript cue times must be safe nonnegative ordered integers");
4193
3866
  totalBytes += asset.size;
4194
3867
  if (totalBytes > maximum)
4195
- throw new CliError("validation_error", "archive import exceeds the aggregate byte limit");
3868
+ throw new CliError30("validation_error", "archive import exceeds the aggregate byte limit");
4196
3869
  let startedAt = null;
4197
3870
  if (meeting2.startedAt !== null) {
4198
3871
  startedAt = Date.parse(meeting2.startedAt);
4199
3872
  if (!Number.isSafeInteger(startedAt) || Math.abs(startedAt) > 864e13 || new Date(startedAt).toISOString() !== meeting2.startedAt)
4200
- throw new CliError("validation_error", "archive occurrence start must be a real ISO timestamp");
3873
+ throw new CliError30("validation_error", "archive occurrence start must be a real ISO timestamp");
4201
3874
  }
4202
3875
  const group = prepared.get(meeting2.uuid) ?? {
4203
3876
  uuid: meeting2.uuid,
@@ -4247,7 +3920,7 @@ async function* applyArchiveImport(plan, store, options) {
4247
3920
  const { accountId, signal } = options;
4248
3921
  const now = options.now ?? Date.now();
4249
3922
  if (!prepared || !Number.isSafeInteger(accountId) || accountId < 1 || !Number.isSafeInteger(now))
4250
- throw new CliError("validation_error", "expected a verified archive plan, selected account and integer timestamp");
3923
+ throw new CliError30("validation_error", "expected a verified archive plan, selected account and integer timestamp");
4251
3924
  for (const group of prepared) {
4252
3925
  checkCancelled(signal);
4253
3926
  let receipt;
@@ -4262,9 +3935,9 @@ async function* applyArchiveImport(plan, store, options) {
4262
3935
  const exact = await store.appendTranscriptsWithReceipt(input);
4263
3936
  const details = exact?.meeting;
4264
3937
  if (!details?.meeting || details.meeting.accountId !== accountId || details.meeting.externalId !== group.uuid || !Number.isSafeInteger(details.meeting.id) || details.meeting.id < 1 || details.meeting.deletedAt !== null)
4265
- throw new CliError("outcome_unknown", "archive append returned inconsistent ownership; verify stored state before retrying");
3938
+ throw new CliError30("outcome_unknown", "archive append returned inconsistent ownership; verify stored state before retrying");
4266
3939
  if (typeof exact.created !== "boolean" || exact.insertedTranscripts + exact.replayedTranscripts !== group.transcripts.length || [exact.insertedTranscripts, exact.replayedTranscripts, exact.supersededTranscripts].some((count) => !Number.isSafeInteger(count) || count < 0))
4267
- throw new CliError("outcome_unknown", "archive append returned invalid counts; verify stored state before retrying");
3940
+ throw new CliError30("outcome_unknown", "archive append returned invalid counts; verify stored state before retrying");
4268
3941
  receipt = {
4269
3942
  uuid: group.uuid,
4270
3943
  assetIds: [...group.assetIds],
@@ -4276,12 +3949,12 @@ async function* applyArchiveImport(plan, store, options) {
4276
3949
  supersededTranscripts: exact.supersededTranscripts
4277
3950
  };
4278
3951
  } catch (error) {
4279
- if (isCliError(error) && (error.code === "timeout" || error.code === "cancelled")) {
3952
+ if (isCliError9(error) && (error.code === "timeout" || error.code === "cancelled")) {
4280
3953
  checkCancelled(signal);
4281
3954
  throw error;
4282
3955
  }
4283
3956
  if (error instanceof Error && "code" in error && error.code === "outcome_unknown")
4284
- throw new CliError("outcome_unknown", "archive append outcome is unknown; verify stored state before retrying");
3957
+ throw new CliError30("outcome_unknown", "archive append outcome is unknown; verify stored state before retrying");
4285
3958
  if (error instanceof Error && "code" in error && error.code === "not_found")
4286
3959
  receipt = {
4287
3960
  uuid: group.uuid,
@@ -4291,7 +3964,7 @@ async function* applyArchiveImport(plan, store, options) {
4291
3964
  };
4292
3965
  else {
4293
3966
  checkCancelled(signal);
4294
- throw new CliError("provider_error", "archive transcript append failed; earlier occurrences may be committed");
3967
+ throw new CliError30("provider_error", "archive transcript append failed; earlier occurrences may be committed");
4295
3968
  }
4296
3969
  }
4297
3970
  yield receipt;
@@ -4300,11 +3973,14 @@ async function* applyArchiveImport(plan, store, options) {
4300
3973
  __name(applyArchiveImport, "applyArchiveImport");
4301
3974
 
4302
3975
  // dist/ingestion-search-commands.js
3976
+ import { CliError as CliError31 } from "@wirecat/cli-base";
3977
+ import { annotate as annotate9, customizeSharedCommand as customizeSharedCommand2 } from "@wirecat/cli-base/commands";
3978
+ import { allAnswer, itemOf as itemOf6, LOCAL_READ as LOCAL_READ5, LOCAL_WRITE as LOCAL_WRITE5, NO_EFFECTS as NO_EFFECTS7, sharedCommandTemplate } from "@wirecat/cli-core";
4303
3979
  var addIngestionSearchCommandsDefinition = /* @__PURE__ */ __name((program, deps) => {
4304
3980
  const archive = program.commands.find((command) => command.name() === "recordings")?.commands.find((command) => command.name() === "archive");
4305
3981
  if (!archive)
4306
- throw new CliError("configuration_error", "archive command group is unavailable");
4307
- annotate(archive.command("import").description("check an archive's transcripts, then add them to the stored meetings").argument("<directory>", "archive folder").option("--uuid <uuid>", "select an occurrence UUID").option("--file-ids <ids>", "select comma-separated transcript asset ids").option("--max-bytes <bytes>", "largest transcript file, in bytes (default 8 MiB)", bytes).option("--max-total-bytes <bytes>", "most transcript bytes in all, checked before any write (default 64 MiB)", bytes).action(async (directory, options) => {
3982
+ throw new CliError31("configuration_error", "archive command group is unavailable");
3983
+ annotate9(archive.command("import").description("check an archive's transcripts, then add them to the stored meetings").argument("<directory>", "archive folder").option("--uuid <uuid>", "select an occurrence UUID").option("--file-ids <ids>", "select comma-separated transcript asset ids").option("--max-bytes <bytes>", "largest transcript file, in bytes (default 8 MiB)", bytes).option("--max-total-bytes <bytes>", "most transcript bytes in all, checked before any write (default 64 MiB)", bytes).action(async (directory, options) => {
4308
3984
  const plan = await deps.preflight(directory, {
4309
3985
  uuid: options.uuid,
4310
3986
  fileIds: options.fileIds?.split(",").map((id) => id.trim()),
@@ -4315,16 +3991,16 @@ var addIngestionSearchCommandsDefinition = /* @__PURE__ */ __name((program, deps
4315
3991
  const receipts = deps.apply(plan);
4316
3992
  if (program.opts().jsonl) {
4317
3993
  for await (const receipt of receipts)
4318
- await deps.receipt(itemOf(receipt));
3994
+ await deps.receipt(itemOf6(receipt));
4319
3995
  } else
4320
3996
  await deps.outputItems(receipts);
4321
3997
  }), {
4322
3998
  origin: "handwritten",
4323
- effects: LOCAL_WRITE,
3999
+ effects: LOCAL_WRITE5,
4324
4000
  examples: ["zm personal recordings archive import ./archive --jsonl"]
4325
4001
  });
4326
- const search = annotate(program.command("search"), { effects: NO_EFFECTS }).description("opt-in shared store search; meetings by default");
4327
- annotate(search.command("all").description("search meetings and, with --only, messages, mail and notes in the local store").argument("<query>", "words to find; a word also matches longer words it starts").option("--only <resources>", "comma-separated meetings,messages,mail,notes (default meetings)").option("--limit <n>", "how many results, 1 through 1000 (default 100)", bytes, 100).option("--page <n>", "which page, starting at 1", bytes).option("--exact", "request exact matching; unsupported meeting queries are reported as skipped").action(async (query, options) => {
4002
+ const search = annotate9(program.command("search"), { effects: NO_EFFECTS7 }).description("opt-in shared store search; meetings by default");
4003
+ annotate9(search.command("all").description("search meetings and, with --only, messages, mail and notes in the local store").argument("<query>", "words to find; a word also matches longer words it starts").option("--only <resources>", "comma-separated meetings,messages,mail,notes (default meetings)").option("--limit <n>", "how many results, 1 through 1000 (default 100)", bytes, 100).option("--page <n>", "which page, starting at 1", bytes).option("--exact", "request exact matching; unsupported meeting queries are reported as skipped").action(async (query, options) => {
4328
4004
  const page = options.page ?? 1;
4329
4005
  const request = validateUnifiedSearch({
4330
4006
  text: query,
@@ -4345,13 +4021,13 @@ var addIngestionSearchCommandsDefinition = /* @__PURE__ */ __name((program, deps
4345
4021
  deps.output(allAnswer("search all", found, { limit: options.limit, page, again }, options.exact === true));
4346
4022
  }), {
4347
4023
  origin: "handwritten",
4348
- effects: LOCAL_READ,
4024
+ effects: LOCAL_READ5,
4349
4025
  partial: true,
4350
4026
  output: { entity: "hit" },
4351
4027
  examples: ['zm personal search all "example plan" --json']
4352
4028
  });
4353
4029
  }, "addIngestionSearchCommandsDefinition");
4354
- var addIngestionSearchCommands = /* @__PURE__ */ __name((...args) => customizeSharedCommand(sharedCommandTemplate(ZM, "search"), "Zoom searches explicit local meeting and archive sources, with opt-in unified store reads rather than a live messenger backend.", () => {
4030
+ var addIngestionSearchCommands = /* @__PURE__ */ __name((...args) => customizeSharedCommand2(sharedCommandTemplate(ZM, "search"), "Zoom searches explicit local meeting and archive sources, with opt-in unified store reads rather than a live messenger backend.", () => {
4355
4031
  addIngestionSearchCommandsDefinition(...args);
4356
4032
  const command = args[0].commands.find((command2) => command2.name() === "search");
4357
4033
  if (!command)
@@ -4360,11 +4036,14 @@ var addIngestionSearchCommands = /* @__PURE__ */ __name((...args) => customizeSh
4360
4036
  }, SHELL_OVERRIDES.search), "addIngestionSearchCommands");
4361
4037
 
4362
4038
  // dist/local-transcription-commands.js
4039
+ import { CliError as CliError32 } from "@wirecat/cli-base";
4040
+ import { annotate as annotate10 } from "@wirecat/cli-base/commands";
4041
+ import { itemOf as itemOf7, LOCAL_WRITE as LOCAL_WRITE6, speechModel } from "@wirecat/cli-core";
4363
4042
  var addLocalTranscriptionCommands = /* @__PURE__ */ __name((program, deps) => {
4364
4043
  const meetings = program.commands.find((command) => command.name() === "meetings");
4365
4044
  if (!meetings)
4366
- throw new CliError("configuration_error", "meeting command group is unavailable");
4367
- annotate(runsLong(meetings.command("transcribe")).description("preview transcribing a recording on this machine; --yes adds the transcript").argument("<meeting>", "stored meeting id or meeting reference").argument("<file>", "a recording: WAV as it is, MP4, M4A or other audio and video through an installed ffmpeg").requiredOption("--model <model>", "installed speech model").option("--models-dir <dir>", "shared installed speech-model directory").option("--max-bytes <bytes>", "largest audio file to read, in bytes (default 1 GiB)", bytes).option("--max-duration <duration>", "longest audio to transcribe (default 4h)", (text2) => duration(text2, "--max-duration")).option("--max-segments <n>", "most recognized segments (default 10000)", bytes).option("--max-text-bytes <bytes>", "most transcript text, in bytes (default 4 MiB)", bytes).option("--yes", "recognize locally and append to the existing meeting").option("--dry-run", "preview even when --yes is present").action(async (reference, file, options) => {
4045
+ throw new CliError32("configuration_error", "meeting command group is unavailable");
4046
+ annotate10(runsLong(meetings.command("transcribe")).description("preview transcribing a recording on this machine; --yes adds the transcript").argument("<meeting>", "stored meeting id or meeting reference").argument("<file>", "a recording: WAV as it is, MP4, M4A or other audio and video through an installed ffmpeg").requiredOption("--model <model>", "installed speech model").option("--models-dir <dir>", "shared installed speech-model directory").option("--max-bytes <bytes>", "largest audio file to read, in bytes (default 1 GiB)", bytes).option("--max-duration <duration>", "longest audio to transcribe (default 4h)", (text2) => duration(text2, "--max-duration")).option("--max-segments <n>", "most recognized segments (default 10000)", bytes).option("--max-text-bytes <bytes>", "most transcript text, in bytes (default 4 MiB)", bytes).option("--yes", "recognize locally and append to the existing meeting").option("--dry-run", "preview even when --yes is present").action(async (reference, file, options) => {
4368
4047
  const request = validateLocalTranscriptionOptions({
4369
4048
  model: options.model,
4370
4049
  modelsDirectory: options.modelsDir,
@@ -4378,28 +4057,31 @@ var addLocalTranscriptionCommands = /* @__PURE__ */ __name((program, deps) => {
4378
4057
  });
4379
4058
  speechModel(request.model);
4380
4059
  if (typeof file !== "string" || !file.trim() || file.includes("\0"))
4381
- throw new CliError("validation_error", "local audio file is required");
4060
+ throw new CliError32("validation_error", "local audio file is required");
4382
4061
  const capabilities = await deps.capabilities();
4383
4062
  const receipt = await capabilities.transcribe(reference, file, request);
4384
4063
  if (receipt.applied)
4385
- await deps.receipt(itemOf(compactLocalTranscriptionReceipt(receipt)));
4064
+ await deps.receipt(itemOf7(compactLocalTranscriptionReceipt(receipt)));
4386
4065
  else
4387
- deps.output(itemOf(receipt));
4066
+ deps.output(itemOf7(receipt));
4388
4067
  }), {
4389
4068
  origin: "handwritten",
4390
- effects: LOCAL_WRITE,
4069
+ effects: LOCAL_WRITE6,
4391
4070
  examples: ["zm personal meetings transcribe meeting:3/12 ./AliceExample.m4a --model parakeet-v3 --json"]
4392
4071
  });
4393
4072
  }, "addLocalTranscriptionCommands");
4394
4073
 
4395
4074
  // dist/meeting-context-commands.js
4075
+ import { CliError as CliError33 } from "@wirecat/cli-base";
4076
+ import { annotate as annotate11 } from "@wirecat/cli-base/commands";
4077
+ import { itemOf as itemOf8, LOCAL_READ as LOCAL_READ6, meetingEvidenceItem, meetingPersonContextItem } from "@wirecat/cli-core";
4396
4078
  var addMeetingContextCommands = /* @__PURE__ */ __name((program, deps) => {
4397
4079
  const meetings = program.commands.find((command) => command.name() === "meetings");
4398
4080
  if (!meetings)
4399
- throw new CliError("configuration_error", "meeting command group is unavailable");
4400
- const label2 = /* @__PURE__ */ __name((command, example, entity) => annotate(command, {
4081
+ throw new CliError33("configuration_error", "meeting command group is unavailable");
4082
+ const label2 = /* @__PURE__ */ __name((command, example, entity) => annotate11(command, {
4401
4083
  origin: "handwritten",
4402
- effects: LOCAL_READ,
4084
+ effects: LOCAL_READ6,
4403
4085
  examples: [example],
4404
4086
  ...entity ? { output: { entity } } : {}
4405
4087
  }), "label");
@@ -4408,7 +4090,7 @@ var addMeetingContextCommands = /* @__PURE__ */ __name((program, deps) => {
4408
4090
  const options = { ...rest, after: cursor };
4409
4091
  validateEvidenceOptions(options);
4410
4092
  const context = await deps.context();
4411
- deps.output(itemOf(meetingEvidenceItem(await context.evidence(reference, {
4093
+ deps.output(itemOf8(meetingEvidenceItem(await context.evidence(reference, {
4412
4094
  cues: options.cues,
4413
4095
  bytes: options.bytes,
4414
4096
  after: options.after,
@@ -4421,13 +4103,13 @@ var addMeetingContextCommands = /* @__PURE__ */ __name((program, deps) => {
4421
4103
  label2(limits(meetings.command("context").description("what the stored meetings say about a person, through linked identities").argument("<person>", "stored person, such as person:7")).option("--meetings <n>", "how many meetings, 1 through 100", bytes).option("--scan-limit <n>", "most identity links to look at, 1 through 1000", bytes).option("--since-time <time>", "only identity links since this ISO 8601 time", (value) => {
4422
4104
  const stamp = Date.parse(value);
4423
4105
  if (!Number.isSafeInteger(stamp) || new Date(stamp).toISOString() !== value)
4424
- throw new CliError("validation_error", "--since-time must be a canonical ISO 8601 time");
4106
+ throw new CliError33("validation_error", "--since-time must be a canonical ISO 8601 time");
4425
4107
  return stamp;
4426
4108
  }).action(async (person, { sinceTime, ...rest }) => {
4427
4109
  const options = { ...rest, since: sinceTime };
4428
4110
  validatePersonContext(person, options);
4429
4111
  const context = await deps.context();
4430
- deps.output(itemOf(meetingPersonContextItem(await context.personContext(person, {
4112
+ deps.output(itemOf8(meetingPersonContextItem(await context.personContext(person, {
4431
4113
  meetings: options.meetings,
4432
4114
  cues: options.cues,
4433
4115
  bytes: options.bytes,
@@ -4441,20 +4123,23 @@ var addMeetingContextCommands = /* @__PURE__ */ __name((program, deps) => {
4441
4123
  const context = await deps.context();
4442
4124
  const proposal = await context.taskProposal(reference, kind, deps.signal());
4443
4125
  validateTaskProposal(proposal);
4444
- deps.output(itemOf(proposal));
4126
+ deps.output(itemOf8(proposal));
4445
4127
  }), "zm personal meetings task-proposal meeting:3/15/20/0 --type promise --json", "meeting_task_proposal");
4446
4128
  }, "addMeetingContextCommands");
4447
4129
 
4448
4130
  // dist/meeting-integration-commands.js
4131
+ import { CliError as CliError34 } from "@wirecat/cli-base";
4132
+ import { annotate as annotate12 } from "@wirecat/cli-base/commands";
4133
+ import { actorOf, itemOf as itemOf9, LOCAL_READ as LOCAL_READ7, LOCAL_WRITE as LOCAL_WRITE7, validateMeetingContextChange } from "@wirecat/cli-core";
4449
4134
  var linkChange = /* @__PURE__ */ __name((options) => {
4450
4135
  const toPerson = options.participantId !== void 0 || options.person !== void 0;
4451
4136
  if (options.eventId !== void 0 === toPerson)
4452
- throw new CliError("validation_error", "give --event-id, or --participant-id with --person", {
4137
+ throw new CliError34("validation_error", "give --event-id, or --participant-id with --person", {
4453
4138
  param: "--event-id"
4454
4139
  });
4455
4140
  if (options.eventId !== void 0) {
4456
4141
  if (options.source !== void 0 || options.expectedPerson !== void 0)
4457
- throw new CliError("validation_error", "--source and --expected-person go with --person, not --event-id");
4142
+ throw new CliError34("validation_error", "--source and --expected-person go with --person, not --event-id");
4458
4143
  return {
4459
4144
  action: "event.link",
4460
4145
  eventId: options.eventId === "none" ? null : options.eventId,
@@ -4462,9 +4147,9 @@ var linkChange = /* @__PURE__ */ __name((options) => {
4462
4147
  };
4463
4148
  }
4464
4149
  if (options.participantId === void 0 || options.person === void 0)
4465
- throw new CliError("validation_error", "--participant-id and --person go together", { param: "--person" });
4150
+ throw new CliError34("validation_error", "--participant-id and --person go together", { param: "--person" });
4466
4151
  if (options.expectedEventId !== void 0)
4467
- throw new CliError("validation_error", "--expected-event-id goes with --event-id");
4152
+ throw new CliError34("validation_error", "--expected-event-id goes with --event-id");
4468
4153
  return {
4469
4154
  action: "person.link",
4470
4155
  participantId: options.participantId,
@@ -4476,10 +4161,10 @@ var linkChange = /* @__PURE__ */ __name((options) => {
4476
4161
  var addMeetingIntegrationCommands = /* @__PURE__ */ __name((program, deps) => {
4477
4162
  const meetings = program.commands.find((command) => command.name() === "meetings");
4478
4163
  if (!meetings)
4479
- throw new CliError("configuration_error", "meeting command group is unavailable");
4480
- const label2 = /* @__PURE__ */ __name((command, examples, mutates = false) => annotate(command, {
4164
+ throw new CliError34("configuration_error", "meeting command group is unavailable");
4165
+ const label2 = /* @__PURE__ */ __name((command, examples, mutates = false) => annotate12(command, {
4481
4166
  origin: "handwritten",
4482
- effects: mutates ? LOCAL_WRITE : LOCAL_READ,
4167
+ effects: mutates ? LOCAL_WRITE7 : LOCAL_READ7,
4483
4168
  examples
4484
4169
  }), "label");
4485
4170
  const guards = /* @__PURE__ */ __name((command) => command.option("--yes", "apply this local change once").option("--dry-run", "preview even when --yes is present"), "guards");
@@ -4487,7 +4172,7 @@ var addMeetingIntegrationCommands = /* @__PURE__ */ __name((program, deps) => {
4487
4172
  const target = integrationReference(reference);
4488
4173
  const change = validateMeetingContextChange(input);
4489
4174
  if (change.action !== "event.link" && change.action !== "person.link")
4490
- throw new CliError("validation_error", "meeting linking supports only explicit event or person changes");
4175
+ throw new CliError34("validation_error", "meeting linking supports only explicit event or person changes");
4491
4176
  const result = await (await deps.integration()).change(target.reference, change, {
4492
4177
  apply: options.yes,
4493
4178
  dryRun: options.dryRun,
@@ -4496,9 +4181,9 @@ var addMeetingIntegrationCommands = /* @__PURE__ */ __name((program, deps) => {
4496
4181
  author: actorOf(command) === "owner" ? "owner" : "agent"
4497
4182
  });
4498
4183
  if (result.applied)
4499
- await deps.receipt(itemOf(result));
4184
+ await deps.receipt(itemOf9(result));
4500
4185
  else
4501
- deps.output(itemOf(result));
4186
+ deps.output(itemOf9(result));
4502
4187
  }, "apply");
4503
4188
  const nullableId = /* @__PURE__ */ __name((value) => value === "none" ? "none" : bytes(value), "nullableId");
4504
4189
  label2(guards(meetings.command("link").description("link a meeting to an event, or a participant to a person; --yes applies").argument("<reference>", "meeting reference, such as meeting:1/1").option("--event-id <id>", "stored event id, or none to unlink", nullableId).option("--expected-event-id <id>", "with --event-id: compare current event id, or none", nullableId).option("--participant-id <id>", "with --person: participant id from this meeting", bytes).option("--person <uid>", "with --participant-id: explicit stored person UID").option("--source <accounts>", "explicit additional account ids authorized for target-person lookup").option("--expected-person <uid>", "compare current person UID, or none")).action(async (reference, options, command) => apply(reference, linkChange(options), options, command)), [
@@ -4508,13 +4193,14 @@ var addMeetingIntegrationCommands = /* @__PURE__ */ __name((program, deps) => {
4508
4193
  }, "addMeetingIntegrationCommands");
4509
4194
 
4510
4195
  // dist/meeting-project-candidates.js
4196
+ import { CliError as CliError35 } from "@wirecat/cli-base";
4511
4197
  var createZoomProjectCandidateReader = /* @__PURE__ */ __name((connect) => async (reference, request = {}) => {
4512
4198
  request.signal?.throwIfAborted();
4513
4199
  const connection = await connect();
4514
4200
  try {
4515
4201
  request.signal?.throwIfAborted();
4516
4202
  if (!Number.isSafeInteger(connection.accountId) || connection.accountId < 1 || !connection.meetingProjectCandidates)
4517
- throw new CliError("configuration_error", "stored project suggestions are unavailable for this account");
4203
+ throw new CliError35("configuration_error", "stored project suggestions are unavailable for this account");
4518
4204
  const result = await connection.meetingProjectCandidates(reference, request);
4519
4205
  request.signal?.throwIfAborted();
4520
4206
  return result;
@@ -4523,10 +4209,19 @@ var createZoomProjectCandidateReader = /* @__PURE__ */ __name((connect) => async
4523
4209
  }
4524
4210
  }, "createZoomProjectCandidateReader");
4525
4211
 
4212
+ // dist/meeting-read-command-bindings.js
4213
+ import { addMeetingPreparationCommand } from "@wirecat/cli-core";
4214
+
4215
+ // dist/meeting-preparation.js
4216
+ import { CliError as CliError37 } from "@wirecat/cli-base";
4217
+ import { validateMeetingPreparationRequest } from "@wirecat/cli-core";
4218
+
4526
4219
  // dist/upcoming-meetings.js
4220
+ import { CliError as CliError36 } from "@wirecat/cli-base";
4221
+ import { createUpcomingMeetingReader } from "@wirecat/cli-core";
4527
4222
  var createZoomUpcomingMeetingReader = /* @__PURE__ */ __name((account, credentials, fetcher, options = {}) => {
4528
4223
  if (typeof credentials?.withSignal !== "function")
4529
- throw new CliError("configuration_error", "Zoom credential scope is unavailable");
4224
+ throw new CliError36("configuration_error", "Zoom credential scope is unavailable");
4530
4225
  const scopedCredentials = credentials.withSignal.bind(credentials);
4531
4226
  const remoteOptions = { ...options };
4532
4227
  return createUpcomingMeetingReader({ provider: "zoom", account }, {
@@ -4551,7 +4246,7 @@ var createZoomPreparationReader = /* @__PURE__ */ __name((deps) => async (series
4551
4246
  let context = request.communications ? deps.context?.() : void 0;
4552
4247
  if (request.communications) {
4553
4248
  if (!context)
4554
- throw new CliError("configuration_error", "configure context.sources for this profile before requesting communications");
4249
+ throw new CliError37("configuration_error", "configure context.sources for this profile before requesting communications");
4555
4250
  context = context.select(request.communications.sources.map((source) => source.id));
4556
4251
  }
4557
4252
  const credentials = deps.credentials();
@@ -4560,7 +4255,7 @@ var createZoomPreparationReader = /* @__PURE__ */ __name((deps) => async (series
4560
4255
  checkCancelled(request.signal);
4561
4256
  const binding = connection.meetingPreparation;
4562
4257
  if (binding?.scope.provider !== "zoom")
4563
- throw new CliError("configuration_error", "meeting preparation is unavailable for this account");
4258
+ throw new CliError37("configuration_error", "meeting preparation is unavailable for this account");
4564
4259
  const upcoming = createZoomUpcomingMeetingReader(binding.scope.account, credentials, deps.fetch, deps.remoteOptions);
4565
4260
  const read2 = await binding.create(upcoming);
4566
4261
  checkCancelled(request.signal);
@@ -4573,6 +4268,8 @@ var createZoomPreparationReader = /* @__PURE__ */ __name((deps) => async (series
4573
4268
  }, "createZoomPreparationReader");
4574
4269
 
4575
4270
  // dist/meeting-project-evidence-commands.js
4271
+ import { annotate as annotate13 } from "@wirecat/cli-base/commands";
4272
+ import { addMeetingProjectEvidenceCommand, NO_EFFECTS as NO_EFFECTS8, overrideSharedContract as overrideSharedContract2 } from "@wirecat/cli-core";
4576
4273
  var addProjectEvidenceCommand = /* @__PURE__ */ __name((program, deps) => {
4577
4274
  const command = addMeetingProjectEvidenceCommand(program, {
4578
4275
  signal: deps.signal,
@@ -4584,8 +4281,8 @@ var addProjectEvidenceCommand = /* @__PURE__ */ __name((program, deps) => {
4584
4281
  }, "read")
4585
4282
  });
4586
4283
  if (command.parent)
4587
- overrideSharedContract(command.parent, "Zoom declares its command groups effect-free because they only hold subcommands.", (one) => {
4588
- annotate(one, { effects: NO_EFFECTS });
4284
+ overrideSharedContract2(command.parent, "Zoom declares its command groups effect-free because they only hold subcommands.", (one) => {
4285
+ annotate13(one, { effects: NO_EFFECTS8 });
4589
4286
  });
4590
4287
  return command;
4591
4288
  }, "addProjectEvidenceCommand");
@@ -4602,8 +4299,15 @@ var addMeetingReadBindings = /* @__PURE__ */ __name((program, deps) => {
4602
4299
  });
4603
4300
  }, "addMeetingReadBindings");
4604
4301
 
4302
+ // dist/meeting-review-commands.js
4303
+ import { annotate as annotate14 } from "@wirecat/cli-base/commands";
4304
+ import { LOCAL_READ as LOCAL_READ8, listOf as listOf2, meetingLinkItem, meetingReviewItem, NO_EFFECTS as NO_EFFECTS9, withQuery as withQuery4 } from "@wirecat/cli-core";
4305
+
4605
4306
  // dist/meeting-selection-options.js
4606
- var MEETING_LINK_QUERY = defineQuery({
4307
+ import { CliError as CliError38 } from "@wirecat/cli-base";
4308
+ import { dateRange, defineQuery as defineQuery2, queryFieldsOf } from "@wirecat/cli-base/query";
4309
+ import { dateWindow, listQuery as listQuery3, meetingLink, nativeTerms, typedQuery as typedQuery4 } from "@wirecat/cli-core";
4310
+ var MEETING_LINK_QUERY = defineQuery2({
4607
4311
  entity: "meeting_link",
4608
4312
  backend: "native",
4609
4313
  fields: [
@@ -4669,14 +4373,14 @@ var startedWindow = /* @__PURE__ */ __name((node, zone) => {
4669
4373
  }, "startedWindow");
4670
4374
  var linkSelection = /* @__PURE__ */ __name((words, flags) => {
4671
4375
  const command = "mentions list";
4672
- const nodes = nativeTerms(listQuery(typedQuery(words), MEETING_LINK_QUERY, command), command);
4376
+ const nodes = nativeTerms(listQuery3(typedQuery4(words), MEETING_LINK_QUERY, command), command);
4673
4377
  const terms = /* @__PURE__ */ new Map();
4674
4378
  for (const [field, node] of nodes)
4675
4379
  if (field !== "started_at")
4676
4380
  terms.set(field, node.value);
4677
4381
  const event = terms.get("event_id");
4678
4382
  if (event !== void 0 && (!/^[1-9]\d*$/.test(event) || !Number.isSafeInteger(Number(event))))
4679
- throw new CliError("validation_error", "event_id must be a positive safe integer");
4383
+ throw new CliError38("validation_error", "event_id must be a positive safe integer");
4680
4384
  const started = nodes.get("started_at");
4681
4385
  return {
4682
4386
  ...flags,
@@ -4709,8 +4413,8 @@ var selectionOf = /* @__PURE__ */ __name((flags, signal, defaultSince) => {
4709
4413
  var NEAR_EMPTY_WORDS = 50;
4710
4414
  var REVIEW_SINCE = "7d";
4711
4415
  var addMeetingReviewCommands = /* @__PURE__ */ __name((program, deps) => {
4712
- annotate(selectionOptions(program.command("review")), {
4713
- effects: LOCAL_READ,
4416
+ annotate14(selectionOptions(program.command("review")), {
4417
+ effects: LOCAL_READ8,
4714
4418
  output: { entity: "meeting_review" },
4715
4419
  examples: ["zm personal review --json", "zm personal review --since-time 30d --project RES --json"]
4716
4420
  }).description("meetings since a point: summary, next steps and who talked how long").option("--limit <n>", "most meetings, newest first (default 50, at most 200)", bytes).action(async (flags) => {
@@ -4719,7 +4423,7 @@ var addMeetingReviewCommands = /* @__PURE__ */ __name((program, deps) => {
4719
4423
  const found = await (await deps.review())({ ...request, limit });
4720
4424
  const unsummarized = found.items.filter((one) => one.summary === null).length;
4721
4425
  const nearEmpty = found.items.filter((one) => one.transcript && one.transcript.words < NEAR_EMPTY_WORDS).length;
4722
- deps.output(listOf("review", {
4426
+ deps.output(listOf2("review", {
4723
4427
  items: found.items.map(meetingReviewItem),
4724
4428
  limit,
4725
4429
  has_more: found.hasMore,
@@ -4740,9 +4444,9 @@ var addMeetingReviewCommands = /* @__PURE__ */ __name((program, deps) => {
4740
4444
  ]
4741
4445
  }));
4742
4446
  });
4743
- const mentions = program.commands.find((command) => command.name() === "mentions") ?? annotate(program.command("mentions"), { effects: NO_EFFECTS }).description("what the stored meetings point to: links shared in their chat");
4744
- withQuery(annotate(selectionOptions(mentions.command("list"), true), {
4745
- effects: LOCAL_READ,
4447
+ const mentions = program.commands.find((command) => command.name() === "mentions") ?? annotate14(program.command("mentions"), { effects: NO_EFFECTS9 }).description("what the stored meetings point to: links shared in their chat");
4448
+ withQuery4(annotate14(selectionOptions(mentions.command("list"), true), {
4449
+ effects: LOCAL_READ8,
4746
4450
  output: { entity: "meeting_link" },
4747
4451
  examples: ["zm personal mentions list started_at>=30d --json", "zm personal mentions list project:RES --json"]
4748
4452
  }), MEETING_LINK_QUERY).description("links shared in meeting chat, most shared first, by whom and where").option("--limit <n>", "how many links (default 100)", bytes).option("--max-messages <n>", "most chat messages to read (default and at most 100000)", bytes).action(async (words, flags) => {
@@ -4754,7 +4458,7 @@ var addMeetingReviewCommands = /* @__PURE__ */ __name((program, deps) => {
4754
4458
  ...url === void 0 ? {} : { url },
4755
4459
  ...flags.maxMessages === void 0 ? {} : { maxMessages: flags.maxMessages }
4756
4460
  });
4757
- deps.output(listOf("mentions list", {
4461
+ deps.output(listOf2("mentions list", {
4758
4462
  items: found.items.slice(0, limit).map(meetingLinkItem),
4759
4463
  limit,
4760
4464
  has_more: found.items.length > limit,
@@ -4770,6 +4474,10 @@ var addMeetingReviewCommands = /* @__PURE__ */ __name((program, deps) => {
4770
4474
  }, "addMeetingReviewCommands");
4771
4475
 
4772
4476
  // dist/meeting-searches-commands.js
4477
+ import { CliError as CliError39 } from "@wirecat/cli-base";
4478
+ import { annotate as annotate15 } from "@wirecat/cli-base/commands";
4479
+ import { FETCH as FETCH4, itemOf as itemOf10, LOCAL_READ as LOCAL_READ9, LOCAL_WRITE as LOCAL_WRITE8, listOf as listOf3, listQuery as listQuery4, NO_EFFECTS as NO_EFFECTS10, SEARCHES_QUERY, savedSearchItem as searchItem, typedQuery as typedQuery5, withQuery as withQuery5 } from "@wirecat/cli-core";
4480
+ import { CommanderError, Option } from "commander";
4773
4481
  var UNSAVED = /* @__PURE__ */ new Set(["cursor", "meetingId", "identityId", "personId", "seriesId", "tag"]);
4774
4482
  var flagsOf = /* @__PURE__ */ __name((typed) => {
4775
4483
  const { command } = meetingSearchDefinition();
@@ -4794,17 +4502,17 @@ var parsed2 = /* @__PURE__ */ __name(async (query, typed) => {
4794
4502
  await program.parseAsync(["search", "meetings", query, ...flagsOf(typed)], { from: "user" });
4795
4503
  } catch (error) {
4796
4504
  if (error instanceof CommanderError)
4797
- throw new CliError("validation_error", error.message.replace(/^error: /, ""));
4505
+ throw new CliError39("validation_error", error.message.replace(/^error: /, ""));
4798
4506
  throw error;
4799
4507
  }
4800
4508
  if (!found)
4801
- throw new CliError("validation_error", "the saved search could not be read");
4509
+ throw new CliError39("validation_error", "the saved search could not be read");
4802
4510
  return found;
4803
4511
  }, "parsed");
4804
4512
  var addMeetingSearchesCommands = /* @__PURE__ */ __name((program, deps) => {
4805
- const searches = annotate(program.command("searches"), { effects: NO_EFFECTS }).description("saved meeting searches: a query and its options under a name");
4806
- const create = annotate(searches.command("create"), {
4807
- effects: LOCAL_WRITE,
4513
+ const searches = annotate15(program.command("searches"), { effects: NO_EFFECTS10 }).description("saved meeting searches: a query and its options under a name");
4514
+ const create = annotate15(searches.command("create"), {
4515
+ effects: LOCAL_WRITE8,
4808
4516
  output: { entity: "saved_search" },
4809
4517
  examples: ['zm personal searches create weekly-plan "example plan date>=7d" --project RES --json']
4810
4518
  }).description("save a search meetings query and its options without running it").argument("<name>", "up to 64 letters a\u2013z, digits and hyphens, not only digits").argument("<query>", "the query, as search meetings takes it").option("--replace", "overwrite a saved search of the same name");
@@ -4815,10 +4523,10 @@ var addMeetingSearchesCommands = /* @__PURE__ */ __name((program, deps) => {
4815
4523
  const { replace, ...typed } = flags;
4816
4524
  await parsed2(query, typed);
4817
4525
  const saved = await (await deps.searches()).create(name, { query, options: typed }, { replace: replace === true });
4818
- deps.output(itemOf(savedSearchItem(saved)));
4526
+ deps.output(itemOf10(searchItem(saved)));
4819
4527
  });
4820
- annotate(searches.command("run"), {
4821
- effects: FETCH,
4528
+ annotate15(searches.command("run"), {
4529
+ effects: FETCH4,
4822
4530
  output: { entity: "meeting_hit" },
4823
4531
  examples: ["zm personal searches run weekly-plan --json"]
4824
4532
  }).description("run a saved search; answers as search meetings does").argument("<name>", "a saved search's name").action(async (name) => {
@@ -4826,35 +4534,38 @@ var addMeetingSearchesCommands = /* @__PURE__ */ __name((program, deps) => {
4826
4534
  const { query, options } = await parsed2(saved.query, saved.options);
4827
4535
  deps.output(await deps.search(query, options));
4828
4536
  });
4829
- withQuery(annotate(searches.command("list"), {
4830
- effects: LOCAL_READ,
4537
+ withQuery5(annotate15(searches.command("list"), {
4538
+ effects: LOCAL_READ9,
4831
4539
  output: { entity: "saved_search" },
4832
4540
  examples: ["zm personal searches list --json"]
4833
4541
  }), SEARCHES_QUERY).description("the saved meeting searches, by name").action(async (words) => {
4834
- listQuery(typedQuery(words), SEARCHES_QUERY, "searches list");
4542
+ listQuery4(typedQuery5(words), SEARCHES_QUERY, "searches list");
4835
4543
  const found = await (await deps.searches()).list();
4836
- deps.output(listOf("searches list", { items: found.map(savedSearchItem), limit: Math.max(1, found.length), has_more: false }));
4544
+ deps.output(listOf3("searches list", { items: found.map(searchItem), limit: Math.max(1, found.length), has_more: false }));
4837
4545
  });
4838
- annotate(searches.command("show"), {
4839
- effects: LOCAL_READ,
4546
+ annotate15(searches.command("show"), {
4547
+ effects: LOCAL_READ9,
4840
4548
  output: { entity: "saved_search" },
4841
4549
  examples: ["zm personal searches show weekly-plan"]
4842
4550
  }).description("one saved search: its query, options and how often it ran").argument("<name>", "a saved search's name").action(async (name) => {
4843
- deps.output(itemOf(savedSearchItem(await (await deps.searches()).show(name))));
4551
+ deps.output(itemOf10(searchItem(await (await deps.searches()).show(name))));
4844
4552
  });
4845
- annotate(searches.command("delete"), {
4846
- effects: LOCAL_WRITE,
4553
+ annotate15(searches.command("delete"), {
4554
+ effects: LOCAL_WRITE8,
4847
4555
  output: { entity: "saved_search" },
4848
4556
  examples: ["zm personal searches delete weekly-plan --dry-run"]
4849
4557
  }).description("delete a saved search").argument("<name>", "a saved search's name").action(async (name) => {
4850
- deps.output(itemOf(savedSearchItem(await (await deps.searches()).delete(name))));
4558
+ deps.output(itemOf10(searchItem(await (await deps.searches()).delete(name))));
4851
4559
  });
4852
4560
  }, "addMeetingSearchesCommands");
4853
4561
 
4854
4562
  // dist/meeting-stats-commands.js
4563
+ import { CliError as CliError40 } from "@wirecat/cli-base";
4564
+ import { annotate as annotate16 } from "@wirecat/cli-base/commands";
4565
+ import { itemOf as itemOf11, LOCAL_READ as LOCAL_READ10, listOf as listOf4, MEETING_COUNTS_GROUPINGS, meetingCountsItem, meetingSpeakerItem, meetingStatsItem, NO_EFFECTS as NO_EFFECTS11 } from "@wirecat/cli-core";
4855
4566
  var groupingOf = /* @__PURE__ */ __name((value) => {
4856
4567
  if (!MEETING_COUNTS_GROUPINGS.includes(value))
4857
- throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
4568
+ throw new CliError40("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
4858
4569
  return value;
4859
4570
  }, "groupingOf");
4860
4571
  var filters = /* @__PURE__ */ __name((command) => selectionOptions(command).option("--max-rows <n>", "most transcript lines to read (default and at most 500000)", bytes), "filters");
@@ -4866,34 +4577,34 @@ var requestOf = /* @__PURE__ */ __name((flags, signal) => {
4866
4577
  };
4867
4578
  }, "requestOf");
4868
4579
  var addMeetingStatsCommands = /* @__PURE__ */ __name((program, deps) => {
4869
- const stats = program.commands.find((command) => command.name() === "stats") ?? annotate(program.command("stats"), { effects: NO_EFFECTS }).description("numbers about the stored meetings");
4870
- const meetings = annotate(stats.command("meetings"), { effects: NO_EFFECTS }).description("talk time by speaker and week; meetings and minutes by day, week or series");
4871
- annotate(filters(meetings.command("show")), {
4872
- effects: LOCAL_READ,
4580
+ const stats = program.commands.find((command) => command.name() === "stats") ?? annotate16(program.command("stats"), { effects: NO_EFFECTS11 }).description("numbers about the stored meetings");
4581
+ const meetings = annotate16(stats.command("meetings"), { effects: NO_EFFECTS11 }).description("talk time by speaker and week; meetings and minutes by day, week or series");
4582
+ annotate16(filters(meetings.command("show")), {
4583
+ effects: LOCAL_READ10,
4873
4584
  output: { entity: "meeting_stats" },
4874
4585
  examples: ["zm personal stats meetings show --since-time 30d --json"]
4875
4586
  }).description("meetings, lines, words and talk time by week, with the top speakers").action(async (flags) => {
4876
4587
  const { request, meta } = requestOf(flags, deps.signal());
4877
4588
  const found = await (await deps.read())(request);
4878
- deps.output(itemOf(meetingStatsItem(found), { meta }));
4589
+ deps.output(itemOf11(meetingStatsItem(found), { meta }));
4879
4590
  });
4880
- annotate(filters(meetings.command("top")), {
4881
- effects: LOCAL_READ,
4591
+ annotate16(filters(meetings.command("top")), {
4592
+ effects: LOCAL_READ10,
4882
4593
  output: { entity: "meeting_speaker" },
4883
4594
  examples: ["zm personal stats meetings top --project RES --limit 5 --json"]
4884
4595
  }).description("speakers by talk time: lines, words, meetings and their share of the talk").option("--limit <n>", "how many speakers (default 20)", bytes).action(async (flags) => {
4885
4596
  const { request, meta } = requestOf(flags, deps.signal());
4886
4597
  const found = await (await deps.read())(request);
4887
4598
  const limit = flags.limit ?? 20;
4888
- deps.output(listOf("stats meetings top", {
4599
+ deps.output(listOf4("stats meetings top", {
4889
4600
  items: found.speakers.slice(0, limit).map(meetingSpeakerItem),
4890
4601
  limit,
4891
4602
  has_more: found.speakers.length > limit,
4892
4603
  meta
4893
4604
  }));
4894
4605
  });
4895
- annotate(selectionOptions(meetings.command("history")), {
4896
- effects: LOCAL_READ,
4606
+ annotate16(selectionOptions(meetings.command("history")), {
4607
+ effects: LOCAL_READ10,
4897
4608
  output: { entity: "meeting_counts" },
4898
4609
  examples: ["zm personal stats meetings history --by week --since-time 90d --json"]
4899
4610
  }).summary("meetings, minutes and transcripts per day, week or series").description("meetings, minutes and meetings with a transcript, per day, week or series; reads meetings only").requiredOption("--by <group>", `one row per ${MEETING_COUNTS_GROUPINGS.join(", ")}`, groupingOf).option("--limit <n>", "the newest days or weeks, or the busiest series (default 100)", bytes).action(async (flags) => {
@@ -4904,7 +4615,7 @@ var addMeetingStatsCommands = /* @__PURE__ */ __name((program, deps) => {
4904
4615
  timeZone: zone,
4905
4616
  ...flags.limit === void 0 ? {} : { limit: flags.limit }
4906
4617
  });
4907
- deps.output(itemOf(meetingCountsItem(found), { meta }));
4618
+ deps.output(itemOf11(meetingCountsItem(found), { meta }));
4908
4619
  });
4909
4620
  }, "addMeetingStatsCommands");
4910
4621
 
@@ -4974,7 +4685,7 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
4974
4685
  signal,
4975
4686
  read: /* @__PURE__ */ __name(async (reference, options) => {
4976
4687
  if (fields() && options.format !== "json")
4977
- throw new CliError("validation_error", "passage field selection requires --json or --format json");
4688
+ throw new CliError41("validation_error", "passage field selection requires --json or --format json");
4978
4689
  return (await meetingContext()).passage(reference, options);
4979
4690
  }, "read"),
4980
4691
  output: /* @__PURE__ */ __name((result, format) => {
@@ -4991,20 +4702,20 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
4991
4702
  read: /* @__PURE__ */ __name(async () => {
4992
4703
  const read2 = (await connected()).meetingStats;
4993
4704
  if (!read2)
4994
- throw new CliError("configuration_error", "the selected store connector does not count meetings");
4705
+ throw new CliError41("configuration_error", "the selected store connector does not count meetings");
4995
4706
  return read2;
4996
4707
  }, "read"),
4997
4708
  counts: /* @__PURE__ */ __name(async () => {
4998
4709
  const read2 = (await connected()).meetingCounts;
4999
4710
  if (!read2)
5000
- throw new CliError("configuration_error", "the selected store connector does not count meetings");
4711
+ throw new CliError41("configuration_error", "the selected store connector does not count meetings");
5001
4712
  return read2;
5002
4713
  }, "counts")
5003
4714
  });
5004
4715
  const reader = /* @__PURE__ */ __name((name, what) => async () => {
5005
4716
  const read2 = (await connected())[name];
5006
4717
  if (!read2)
5007
- throw new CliError("configuration_error", `the selected store connector does not ${what}`);
4718
+ throw new CliError41("configuration_error", `the selected store connector does not ${what}`);
5008
4719
  return read2;
5009
4720
  }, "reader");
5010
4721
  addMeetingReviewCommands(program, {
@@ -5027,7 +4738,7 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
5027
4738
  searches: /* @__PURE__ */ __name(async () => {
5028
4739
  const searches = (await connected()).meetingSearches;
5029
4740
  if (!searches)
5030
- throw new CliError("configuration_error", "the selected store connector does not save searches");
4741
+ throw new CliError41("configuration_error", "the selected store connector does not save searches");
5031
4742
  return searches;
5032
4743
  }, "searches")
5033
4744
  });
@@ -5041,7 +4752,7 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
5041
4752
  const batchReader = /* @__PURE__ */ __name(async () => {
5042
4753
  const reader2 = (await connected()).meetingBatch;
5043
4754
  if (!reader2)
5044
- throw new CliError("configuration_error", "the selected store connector does not support meeting batches");
4755
+ throw new CliError41("configuration_error", "the selected store connector does not support meeting batches");
5045
4756
  return reader2;
5046
4757
  }, "batchReader");
5047
4758
  addMeetingBatchCommand(program, {
@@ -5049,10 +4760,10 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
5049
4760
  fields,
5050
4761
  meta,
5051
4762
  input: /* @__PURE__ */ __name(async (path, signal2) => {
5052
- if (path === "-" && environmentOf(program).agent)
5053
- throw new CliError("validation_error", "batch input cannot come from stdin over MCP; pass a file path");
4763
+ if (path === "-" && environmentOf2(program).agent)
4764
+ throw new CliError41("validation_error", "batch input cannot come from stdin over MCP; pass a file path");
5054
4765
  if (!deps.readBatchInput)
5055
- throw new CliError("configuration_error", "batch input reader is unavailable");
4766
+ throw new CliError41("configuration_error", "batch input reader is unavailable");
5056
4767
  return deps.readBatchInput(path, signal2);
5057
4768
  }, "input"),
5058
4769
  reader: {
@@ -5063,7 +4774,7 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
5063
4774
  output: /* @__PURE__ */ __name((body, report, format) => {
5064
4775
  const text2 = format === "json" ? rendered(body, program.opts().jsonl ? "jsonl" : "json", false) : formatMeetingBatch(report, format);
5065
4776
  if (Buffer.byteLength(text2, "utf8") > 4194304)
5066
- throw new CliError("invalid_response", "batch rendered output exceeds 4194304 bytes", {
4777
+ throw new CliError41("invalid_response", "batch rendered output exceeds 4194304 bytes", {
5067
4778
  reason: "output.too-large",
5068
4779
  max_bytes: 4194304
5069
4780
  });
@@ -5073,37 +4784,41 @@ var addStoreCommands = /* @__PURE__ */ __name((program, context) => {
5073
4784
  }, "addStoreCommands");
5074
4785
 
5075
4786
  // dist/watch-commands.js
4787
+ import { CliError as CliError42 } from "@wirecat/cli-base";
4788
+ import { annotate as annotate17 } from "@wirecat/cli-base/commands";
4789
+ import { FETCH as FETCH5, itemOf as itemOf12, watchMeetingIngestion } from "@wirecat/cli-core";
4790
+ import { Argument } from "commander";
5076
4791
  var days = /* @__PURE__ */ __name((value) => {
5077
4792
  if (!/^\d+$/.test(value) || Number(value) > 31)
5078
- throw new CliError("validation_error", "lookback days must be an integer from 0 through 31");
4793
+ throw new CliError42("validation_error", "lookback days must be an integer from 0 through 31");
5079
4794
  return Number(value);
5080
4795
  }, "days");
5081
4796
  var since = /* @__PURE__ */ __name((value) => {
5082
4797
  const day = value.slice(0, 10);
5083
4798
  const dayTime = Date.parse(`${day}T00:00:00Z`);
5084
4799
  if (!/^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(value) || !Number.isFinite(Date.parse(value)) || !Number.isFinite(dayTime) || new Date(dayTime).toISOString().slice(0, 10) !== day)
5085
- throw new CliError("validation_error", "--since-time must be a real ISO 8601 time with a time zone");
4800
+ throw new CliError42("validation_error", "--since-time must be a real ISO 8601 time with a time zone");
5086
4801
  return value;
5087
4802
  }, "since");
5088
4803
  var addWatchCommand = /* @__PURE__ */ __name((program, deps) => {
5089
4804
  const command = program.command("watch").description("keep fetching new meetings from Zoom, or rescanning a folder, until stopped").addArgument(new Argument("[target]", "api or files; otherwise the configured source").choices(["api", "files"])).argument("[folder]", "with files: folder of downloaded transcripts; otherwise files.folder").option("--since-time <time>", "on the first run, fetch meetings from this ISO 8601 time", since).option("--lookback-days <days>", "API cursor overlap for late transcripts (0 through 31)", days).option("--pause <duration>", "delay after each completed receipt (1s through 24h)", (text2) => duration(text2, "--pause"), 1e4).action(async (target, folder, options) => {
5090
4805
  if (!program.opts().jsonl && !deps.outputIsTTY)
5091
- throw new CliError("validation_error", "headless watch requires --jsonl");
4806
+ throw new CliError42("validation_error", "headless watch requires --jsonl");
5092
4807
  if (program.opts().json)
5093
- throw new CliError("validation_error", "watch streams receipts; use --jsonl");
4808
+ throw new CliError42("validation_error", "watch streams receipts; use --jsonl");
5094
4809
  if (options.pause < 1e3 || options.pause > 864e5)
5095
- throw new CliError("validation_error", "--pause must be from 1s through 24h");
4810
+ throw new CliError42("validation_error", "--pause must be from 1s through 24h");
5096
4811
  const plan = deps.prepare(target, folder, options);
5097
4812
  for await (const report of watchMeetingIngestion((signal) => deps.ingest(plan, signal), {
5098
4813
  signal: deps.signal(),
5099
4814
  intervalMs: plan.intervalMs,
5100
4815
  sleep: deps.sleep
5101
4816
  }))
5102
- await deps.receipt(itemOf(report));
4817
+ await deps.receipt(itemOf12(report));
5103
4818
  });
5104
- annotate(command, {
4819
+ annotate17(command, {
5105
4820
  origin: "handwritten",
5106
- effects: FETCH,
4821
+ effects: FETCH5,
5107
4822
  examples: [
5108
4823
  "zm personal watch files ./downloads --pause 10s --jsonl",
5109
4824
  "zm personal watch api --lookback-days 2 --dry-run --jsonl"
@@ -5113,6 +4828,8 @@ var addWatchCommand = /* @__PURE__ */ __name((program, deps) => {
5113
4828
  }, "addWatchCommand");
5114
4829
 
5115
4830
  // dist/watch-service.js
4831
+ import { CliError as CliError43, isCliError as isCliError10, realSleep } from "@wirecat/cli-base";
4832
+ import { importFiles, pull } from "@wirecat/cli-core";
5116
4833
  var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tokens, fetch, offline, openStore, guardedStore, zones }) => {
5117
4834
  let watchConfig;
5118
4835
  let watchSince;
@@ -5133,20 +4850,20 @@ var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tok
5133
4850
  };
5134
4851
  if (source === "files") {
5135
4852
  if (flags.sinceTime !== void 0 || flags.lookbackDays !== void 0)
5136
- throw new CliError("validation_error", "--since-time and --lookback-days apply only to API watching");
4853
+ throw new CliError43("validation_error", "--since-time and --lookback-days apply only to API watching");
5137
4854
  if (!plan.folder?.trim())
5138
- throw new CliError("configuration_error", "set files.folder or provide a folder for file watching");
4855
+ throw new CliError43("configuration_error", "set files.folder or provide a folder for file watching");
5139
4856
  } else {
5140
4857
  if (folder !== void 0)
5141
- throw new CliError("validation_error", "API watching does not accept a folder");
4858
+ throw new CliError43("validation_error", "API watching does not accept a folder");
5142
4859
  if (offline())
5143
- throw new CliError("configuration_error", "API watching requires network access; remove --offline");
4860
+ throw new CliError43("configuration_error", "API watching requires network access; remove --offline");
5144
4861
  if (!deps.source) {
5145
4862
  const clientId = zoomClientId(config, deps.env ?? process.env);
5146
4863
  if (!clientId)
5147
- throw new CliError("configuration_error", SET_ZOOM_APP);
4864
+ throw new CliError43("configuration_error", SET_ZOOM_APP);
5148
4865
  if (tokens().options.clientId !== clientId)
5149
- throw new CliError("configuration_error", "the OAuth client changed before watch started; retry with matching configuration");
4866
+ throw new CliError43("configuration_error", "the OAuth client changed before watch started; retry with matching configuration");
5150
4867
  }
5151
4868
  }
5152
4869
  if (!deps.store)
@@ -5159,7 +4876,7 @@ var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tok
5159
4876
  checkCancelled(operation3);
5160
4877
  const config = watchConfig;
5161
4878
  if (!config)
5162
- throw new CliError("configuration_error", "watch configuration is unavailable");
4879
+ throw new CliError43("configuration_error", "watch configuration is unavailable");
5163
4880
  let cycle;
5164
4881
  let failure;
5165
4882
  let result;
@@ -5169,7 +4886,7 @@ var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tok
5169
4886
  checkCancelled(operation3);
5170
4887
  const accountId = cycle?.accountId ?? deps.accountId;
5171
4888
  if (!Number.isSafeInteger(accountId) || !accountId || accountId < 1)
5172
- throw new CliError("configuration_error", "the selected meeting account is unavailable");
4889
+ throw new CliError43("configuration_error", "the selected meeting account is unavailable");
5173
4890
  const store = guardedStore(cycle?.store ?? deps.store ?? unavailableStore);
5174
4891
  if (plan.source === "files") {
5175
4892
  const files = validateDownloadedFiles(await (deps.readFiles ?? readDownloadedFiles)(plan.folder ?? ""), filesZone(config));
@@ -5193,7 +4910,7 @@ var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tok
5193
4910
  checkCancelled(operation3);
5194
4911
  return value;
5195
4912
  } catch (error) {
5196
- if (isCliError(error) && error.code === "outcome_unknown") {
4913
+ if (isCliError10(error) && error.code === "outcome_unknown") {
5197
4914
  sourceFailure = error;
5198
4915
  throw error;
5199
4916
  }
@@ -5233,7 +4950,7 @@ var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tok
5233
4950
  try {
5234
4951
  await cycle.close();
5235
4952
  } catch {
5236
- failure ??= new CliError("configuration_error", "could not close the shared meeting store");
4953
+ failure ??= new CliError43("configuration_error", "could not close the shared meeting store");
5237
4954
  }
5238
4955
  }
5239
4956
  }
@@ -5246,7 +4963,11 @@ var createWatchService = /* @__PURE__ */ __name(({ deps, getConfig, profile, tok
5246
4963
  };
5247
4964
  }, "createWatchService");
5248
4965
 
4966
+ // dist/zoom-search.js
4967
+ import { CliError as CliError45 } from "@wirecat/cli-base";
4968
+
5249
4969
  // dist/zoom-mcp.js
4970
+ import { CliError as CliError44 } from "@wirecat/cli-base";
5250
4971
  var ZOOM_MCP_URL = "https://mcp.zoom.us/mcp/zoom/streamable";
5251
4972
  var PROTOCOL = "2025-06-18";
5252
4973
  var record = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "record");
@@ -5268,7 +4989,7 @@ var ZoomMcp = class {
5268
4989
  const operation3 = operationSignal(signal);
5269
4990
  const { accessToken, scopes } = await this.tokens.tokens();
5270
4991
  if (!scopes.includes(scope2))
5271
- throw new CliError("configuration_error", `Zoom scope ${scope2} is missing; ${sessionStart(scope2)}`);
4992
+ throw new CliError44("configuration_error", `Zoom scope ${scope2} is missing; ${sessionStart(scope2)}`);
5272
4993
  if (!this.initialized) {
5273
4994
  await this.rpc("initialize", accessToken, operation3, {
5274
4995
  protocolVersion: PROTOCOL,
@@ -5288,7 +5009,7 @@ var ZoomMcp = class {
5288
5009
  try {
5289
5010
  return JSON.parse(text2 ?? "");
5290
5011
  } catch {
5291
- throw new CliError("invalid_response", `Zoom returned an invalid ${tool} answer`);
5012
+ throw new CliError44("invalid_response", `Zoom returned an invalid ${tool} answer`);
5292
5013
  }
5293
5014
  }
5294
5015
  async rpc(method, accessToken, signal, params) {
@@ -5311,23 +5032,23 @@ var ZoomMcp = class {
5311
5032
  });
5312
5033
  } catch {
5313
5034
  checkCancelled(signal);
5314
- throw new CliError("network_error", "Zoom search could not be reached");
5035
+ throw new CliError44("network_error", "Zoom search could not be reached");
5315
5036
  }
5316
5037
  this.session = response.headers.get("mcp-session-id") ?? this.session;
5317
5038
  const text2 = await response.text();
5318
5039
  const message = parseMessage(text2, response.headers.get("content-type"), id);
5319
5040
  if (response.status === 401)
5320
- throw new CliError("authentication_error", "Zoom refused the login; run zm <profile> session start again, or sign in from WireCat Desktop (Tools \u2192 Zoom \u2192 Manage)");
5041
+ throw new CliError44("authentication_error", "Zoom refused the login; run zm <profile> session start again, or sign in from WireCat Desktop (Tools \u2192 Zoom \u2192 Manage)");
5321
5042
  if (response.status === 403 && record(message?.error) && message.error.code === -32003)
5322
- throw new CliError("configuration_error", `Zoom wants scope ${String(message.error.message)}; ${sessionStart("it")}`);
5043
+ throw new CliError44("configuration_error", `Zoom wants scope ${String(message.error.message)}; ${sessionStart("it")}`);
5323
5044
  if (!response.ok)
5324
- throw new CliError("provider_error", `Zoom search failed (HTTP ${response.status})`);
5045
+ throw new CliError44("provider_error", `Zoom search failed (HTTP ${response.status})`);
5325
5046
  if (notification)
5326
5047
  return void 0;
5327
5048
  if (!message)
5328
- throw new CliError("invalid_response", "Zoom returned an invalid search answer");
5049
+ throw new CliError44("invalid_response", "Zoom returned an invalid search answer");
5329
5050
  if (record(message.error))
5330
- throw new CliError("provider_error", `Zoom search failed: ${String(message.error.message ?? "unknown error")}`);
5051
+ throw new CliError44("provider_error", `Zoom search failed: ${String(message.error.message ?? "unknown error")}`);
5331
5052
  return message.result;
5332
5053
  }
5333
5054
  };
@@ -5355,7 +5076,7 @@ var toolError = /* @__PURE__ */ __name((text2) => {
5355
5076
  }
5356
5077
  const reason = typeof body.error_message === "string" ? body.error_message : (text2 ?? "").slice(0, 200);
5357
5078
  const status = typeof body.status_code === "number" ? body.status_code : null;
5358
- return new CliError(status === 403 ? "permission_error" : status === 404 ? "not_found" : "invalid_response", `Zoom refused the request: ${reason || "no reason given"}`);
5079
+ return new CliError44(status === 403 ? "permission_error" : status === 404 ? "not_found" : "invalid_response", `Zoom refused the request: ${reason || "no reason given"}`);
5359
5080
  }, "toolError");
5360
5081
 
5361
5082
  // dist/zoom-search.js
@@ -5417,7 +5138,7 @@ var hitOf = /* @__PURE__ */ __name((row, source, container = null) => {
5417
5138
  }, "hitOf");
5418
5139
  var zoomSearchHits = /* @__PURE__ */ __name((rows) => rows.flatMap((row) => {
5419
5140
  if (!record2(row))
5420
- throw new CliError("invalid_response", "Zoom returned an invalid search result");
5141
+ throw new CliError45("invalid_response", "Zoom returned an invalid search result");
5421
5142
  const name = filled(row.datasource) ? row.datasource : "unknown";
5422
5143
  const source = SOURCE_OF.get(name) ?? name;
5423
5144
  if (name === "zoom_chat_message" && Array.isArray(row.messages)) {
@@ -5447,13 +5168,16 @@ var ZoomSearch = class {
5447
5168
  args.next_page_token = request.cursor;
5448
5169
  const body = await this.mcp.call("search", args, ZOOM_SEARCH_SCOPE, request.signal);
5449
5170
  if (!record2(body) || !Array.isArray(body.data))
5450
- throw new CliError("invalid_response", "Zoom returned an invalid search answer");
5171
+ throw new CliError45("invalid_response", "Zoom returned an invalid search answer");
5451
5172
  const cursor = filled(body.next_page_token) ? body.next_page_token : void 0;
5452
5173
  return { items: zoomSearchHits(body.data), has_more: body.has_more === true, ...cursor ? { cursor } : {} };
5453
5174
  }
5454
5175
  };
5455
5176
 
5456
5177
  // dist/zoom-search-commands.js
5178
+ import { CliError as CliError46 } from "@wirecat/cli-base";
5179
+ import { annotate as annotate18 } from "@wirecat/cli-base/commands";
5180
+ import { listOf as listOf5, NO_EFFECTS as NO_EFFECTS12, REMOTE_READ as REMOTE_READ3 } from "@wirecat/cli-core";
5457
5181
  var WORDS = Object.keys(ZOOM_SEARCH_SOURCES);
5458
5182
  var sourcesOf = /* @__PURE__ */ __name((text2) => {
5459
5183
  if (text2 === void 0)
@@ -5461,7 +5185,7 @@ var sourcesOf = /* @__PURE__ */ __name((text2) => {
5461
5185
  const words = text2.split(",").map((word) => word.trim().toLowerCase());
5462
5186
  const unknown = words.filter((word) => !WORDS.includes(word));
5463
5187
  if (!words.length || unknown.length)
5464
- throw new CliError("validation_error", `--only takes ${WORDS.join(", ")}; got ${unknown.join(", ") || "nothing"}`);
5188
+ throw new CliError46("validation_error", `--only takes ${WORDS.join(", ")}; got ${unknown.join(", ") || "nothing"}`);
5465
5189
  return [...new Set(words)];
5466
5190
  }, "sourcesOf");
5467
5191
  var limitOf = /* @__PURE__ */ __name((text2) => {
@@ -5469,14 +5193,14 @@ var limitOf = /* @__PURE__ */ __name((text2) => {
5469
5193
  return 10;
5470
5194
  const value = Number(text2);
5471
5195
  if (!/^\d+$/.test(text2) || value < 1 || value > 100)
5472
- throw new CliError("validation_error", "--limit must be between 1 and 100");
5196
+ throw new CliError46("validation_error", "--limit must be between 1 and 100");
5473
5197
  return value;
5474
5198
  }, "limitOf");
5475
5199
  var addZoomSearchCommands = /* @__PURE__ */ __name((program, deps) => {
5476
- const zoom = annotate(program.command("zoom"), { effects: NO_EFFECTS }).description("Zoom's own live search: chat, docs and meetings zm does not archive");
5477
- annotate(zoom.command("search"), {
5200
+ const zoom = annotate18(program.command("zoom"), { effects: NO_EFFECTS12 }).description("Zoom's own live search: chat, docs and meetings zm does not archive");
5201
+ annotate18(zoom.command("search"), {
5478
5202
  origin: "handwritten",
5479
- effects: REMOTE_READ,
5203
+ effects: REMOTE_READ3,
5480
5204
  examples: [
5481
5205
  'zm personal zoom search "budget" --only chat,docs --json',
5482
5206
  "zm personal zoom search --only meetings --limit 50"
@@ -5486,7 +5210,7 @@ var addZoomSearchCommands = /* @__PURE__ */ __name((program, deps) => {
5486
5210
  const limit = limitOf(options.limit);
5487
5211
  deps.api();
5488
5212
  const page = await deps.search().search({ query, sources, limit, cursor: options.cursor, signal: deps.signal() });
5489
- deps.output(listOf("zoom search", {
5213
+ deps.output(listOf5("zoom search", {
5490
5214
  items: page.items,
5491
5215
  limit: Math.max(1, page.items.length),
5492
5216
  has_more: page.has_more,
@@ -5505,8 +5229,8 @@ var addZoomSearchCommands = /* @__PURE__ */ __name((program, deps) => {
5505
5229
  var bindZoomProgram = /* @__PURE__ */ __name((program, given, lifecycle) => {
5506
5230
  const deps = {
5507
5231
  ...given,
5508
- data: /* @__PURE__ */ __name((text2) => environmentOf(program).streams?.data(text2.replace(/\n$/, "")), "data"),
5509
- diagnostic: /* @__PURE__ */ __name((text2) => environmentOf(program).streams?.diagnostic(text2.replace(/\n$/, "")), "diagnostic")
5232
+ data: /* @__PURE__ */ __name((text2) => environmentOf3(program).streams?.data(text2.replace(/\n$/, "")), "data"),
5233
+ diagnostic: /* @__PURE__ */ __name((text2) => environmentOf3(program).streams?.diagnostic(text2.replace(/\n$/, "")), "diagnostic")
5510
5234
  };
5511
5235
  program.description(`Zoom meeting transcripts and summaries
5512
5236
 
@@ -5549,11 +5273,11 @@ ${PROFILE_HELP}`);
5549
5273
  format: /* @__PURE__ */ __name(() => formatOf() === "pretty" ? "pretty" : "json", "format")
5550
5274
  });
5551
5275
  lifecycle.fail = (error) => runs.fail(error);
5552
- const signal = /* @__PURE__ */ __name(() => currentExecution()?.signal ?? environmentOf(program).signal ?? deps.signal, "signal");
5276
+ const signal = /* @__PURE__ */ __name(() => currentExecution()?.signal ?? environmentOf3(program).signal ?? deps.signal, "signal");
5553
5277
  const fetchWithSignal = /* @__PURE__ */ __name((fetcher) => (input, init) => {
5554
5278
  checkCancelled(signal());
5555
5279
  if (program.opts().offline)
5556
- throw new CliError("configuration_error", "the command requires network access; remove --offline");
5280
+ throw new CliError47("configuration_error", "the command requires network access; remove --offline");
5557
5281
  const operation3 = signal();
5558
5282
  return observedFetch(fetcher, runs.events)(input, {
5559
5283
  ...init,
@@ -5563,7 +5287,7 @@ ${PROFILE_HELP}`);
5563
5287
  const tokens = /* @__PURE__ */ __name(() => activeTokens ??= deps.tokens.forProfile(profile()).withSignal(signal(), fetchWithSignal(deps.tokens.options.fetch)), "tokens");
5564
5288
  const buffer = /* @__PURE__ */ __name((text2) => {
5565
5289
  if (!execution)
5566
- throw new CliError("configuration_error", "command execution is not initialized");
5290
+ throw new CliError47("configuration_error", "command execution is not initialized");
5567
5291
  execution.output.data(text2);
5568
5292
  }, "buffer");
5569
5293
  const guardedStore = /* @__PURE__ */ __name((store) => cancellableStore(store, signal), "guardedStore");
@@ -5571,7 +5295,7 @@ ${PROFILE_HELP}`);
5571
5295
  let selectedAccountId = deps.accountId;
5572
5296
  const requireAccount = /* @__PURE__ */ __name(() => {
5573
5297
  if (!Number.isSafeInteger(selectedAccountId) || !selectedAccountId || selectedAccountId < 1)
5574
- throw new CliError("configuration_error", "the selected meeting account is unavailable");
5298
+ throw new CliError47("configuration_error", "the selected meeting account is unavailable");
5575
5299
  return selectedAccountId;
5576
5300
  }, "requireAccount");
5577
5301
  const openStore = /* @__PURE__ */ __name(async (intent, context) => {
@@ -5588,7 +5312,7 @@ ${PROFILE_HELP}`);
5588
5312
  }
5589
5313
  let closing;
5590
5314
  const close = /* @__PURE__ */ __name(() => closing ??= connection.close(), "close");
5591
- environmentOf(program).trackCloseable?.({
5315
+ environmentOf3(program).trackCloseable?.({
5592
5316
  close: /* @__PURE__ */ __name(async () => {
5593
5317
  await commandSettled;
5594
5318
  await close();
@@ -5596,14 +5320,14 @@ ${PROFILE_HELP}`);
5596
5320
  });
5597
5321
  return { ...connection, close };
5598
5322
  } catch (error) {
5599
- if (isCliError(error))
5323
+ if (isCliError11(error))
5600
5324
  throw error;
5601
- throw new CliError("configuration_error", "could not open the shared meeting store");
5325
+ throw new CliError47("configuration_error", "could not open the shared meeting store");
5602
5326
  }
5603
5327
  }, "openStore");
5604
5328
  const connected = /* @__PURE__ */ __name((intent = "read") => connecting ??= openStore(intent), "connected");
5605
5329
  const zones = new ZoneAssumptions();
5606
- const ask = /* @__PURE__ */ __name(() => program.opts().input === false ? void 0 : environmentOf(program).agent ? async () => true : deps.confirm, "ask");
5330
+ const ask = /* @__PURE__ */ __name(() => program.opts().input === false ? void 0 : environmentOf3(program).agent ? async () => true : deps.confirm, "ask");
5607
5331
  const maxOutputBytes = /* @__PURE__ */ __name(() => {
5608
5332
  const value = program.opts().maxOutputBytes;
5609
5333
  return value === void 0 ? void 0 : Number(value);
@@ -5613,7 +5337,7 @@ ${PROFILE_HELP}`);
5613
5337
  if (progress && "item" in body && body.item && typeof body.item === "object" && "meetings" in body.item && "warnings" in body.item)
5614
5338
  progress.complete(body.item);
5615
5339
  if (!execution)
5616
- throw new CliError("configuration_error", "command execution is not initialized");
5340
+ throw new CliError47("configuration_error", "command execution is not initialized");
5617
5341
  const answer = renderBody(execution.action, body, {
5618
5342
  format,
5619
5343
  warnings: zones.take(),
@@ -5622,16 +5346,16 @@ ${PROFILE_HELP}`);
5622
5346
  quiet: Boolean(program.opts().quiet),
5623
5347
  diagnostic: deps.diagnostic
5624
5348
  });
5625
- const exit = environmentOf(program).exit;
5349
+ const exit = environmentOf3(program).exit;
5626
5350
  if (exit)
5627
5351
  exit.code = Math.max(exit.code ?? 0, answer.exitCode);
5628
5352
  return answer.text;
5629
5353
  }, "rendered");
5630
5354
  const api = /* @__PURE__ */ __name(() => {
5631
5355
  if (program.opts().offline)
5632
- throw new CliError("configuration_error", "the command requires network access; remove --offline");
5356
+ throw new CliError47("configuration_error", "the command requires network access; remove --offline");
5633
5357
  if (!zoomClientId(getConfig(), deps.env ?? process.env))
5634
- throw new CliError("configuration_error", SET_ZOOM_APP);
5358
+ throw new CliError47("configuration_error", SET_ZOOM_APP);
5635
5359
  }, "api");
5636
5360
  let activeAction = program;
5637
5361
  program.hook("preAction", (_root, action) => {
@@ -5659,8 +5383,8 @@ ${PROFILE_HELP}`);
5659
5383
  await asking;
5660
5384
  const opts = action.optsWithGlobals();
5661
5385
  if (opts.json && opts.jsonl)
5662
- throw new CliError("validation_error", "choose --json or --jsonl");
5663
- execution = sharedExecution(action, environmentOf(program), deps.now, runs.runId());
5386
+ throw new CliError47("validation_error", "choose --json or --jsonl");
5387
+ execution = sharedExecution(action, environmentOf3(program), deps.now, runs.runId());
5664
5388
  checkCancelled(signal());
5665
5389
  if (action.parent?.name() === "meetings" && ["sync", "import"].includes(action.name()) || action.name() === "watch") {
5666
5390
  const selected = named();
@@ -5674,7 +5398,7 @@ ${PROFILE_HELP}`);
5674
5398
  const config2 = getConfig();
5675
5399
  const ingestion = action.parent?.name() === "meetings" && ["sync", "import"].includes(action.name());
5676
5400
  if (opts.offline && ingestion && action.name() !== "import" && config2.source === "api" && !deps.source)
5677
- throw new CliError("configuration_error", "API sync requires network access; remove --offline");
5401
+ throw new CliError47("configuration_error", "API sync requires network access; remove --offline");
5678
5402
  if (!selectedStore) {
5679
5403
  const connection = await connected(ingestion ? "ingestion" : "read");
5680
5404
  selectedStore = connection.store;
@@ -5683,7 +5407,7 @@ ${PROFILE_HELP}`);
5683
5407
  requireAccount();
5684
5408
  };
5685
5409
  const output = /* @__PURE__ */ __name((body) => {
5686
- const agent = environmentOf(program).agent;
5410
+ const agent = environmentOf3(program).agent;
5687
5411
  if (!agent)
5688
5412
  return buffer(rendered(body));
5689
5413
  const packet = JSON.parse(rendered(body, "json"));
@@ -5701,7 +5425,7 @@ ${PROFILE_HELP}`);
5701
5425
  output(wholeList("list", items));
5702
5426
  }, "outputItems");
5703
5427
  addConfigCommands(program, { configPath: deps.configPath, output, warn: deps.diagnostic, named });
5704
- addAppCommand(program, { output, buffer, pretty: /* @__PURE__ */ __name(() => formatOf() === "pretty" && !environmentOf(program).agent, "pretty") });
5428
+ addAppCommand(program, { output, buffer, pretty: /* @__PURE__ */ __name(() => formatOf() === "pretty" && !environmentOf3(program).agent, "pretty") });
5705
5429
  const fetchApi = /* @__PURE__ */ __name(() => fetchWithSignal(deps.fetch), "fetchApi");
5706
5430
  const configured2 = configuredMeetingSource({ deps, getConfig, tokens, fetch: fetchApi, zones });
5707
5431
  const source = configured2.source;
@@ -5740,17 +5464,7 @@ ${PROFILE_HELP}`);
5740
5464
  const before = new Set(program.commands);
5741
5465
  addZoomMeetingCommands(program, meetingCommands);
5742
5466
  const storeCommands = storeLeaves(program, before, meetingCommands.management);
5743
- addSessionCommands(program, {
5744
- deps,
5745
- getConfig,
5746
- output,
5747
- buffer,
5748
- api,
5749
- profile,
5750
- tokens,
5751
- fetch: /* @__PURE__ */ __name(() => fetchWithSignal(deps.fetch), "fetch"),
5752
- signal
5753
- });
5467
+ addSharedCommands(program, { deps, buffer, output });
5754
5468
  const watch = createWatchService({
5755
5469
  deps,
5756
5470
  getConfig,
@@ -5768,7 +5482,7 @@ ${PROFILE_HELP}`);
5768
5482
  const grace = operation3.aborted ? createDeadline({ timeoutMs: 1e3 }) : void 0;
5769
5483
  try {
5770
5484
  await emitReceipt(text2, maxOutputBytes(), async (serialized) => {
5771
- if (environmentOf(program).agent)
5485
+ if (environmentOf3(program).agent)
5772
5486
  deps.data(serialized);
5773
5487
  else if (deps.streamData)
5774
5488
  await deps.streamData(serialized, grace?.signal ?? operation3);
@@ -5834,7 +5548,7 @@ ${PROFILE_HELP}`);
5834
5548
  outputIsTTY: deps.outputIsTTY
5835
5549
  });
5836
5550
  addZoomSkillCommands(program, () => {
5837
- const renderer = createRenderer({
5551
+ const renderer = createRenderer2({
5838
5552
  format: formatOf(),
5839
5553
  color: false,
5840
5554
  quiet: Boolean(program.opts().quiet),
@@ -5885,7 +5599,7 @@ ${PROFILE_HELP}`);
5885
5599
  fields: /* @__PURE__ */ __name(() => fields, "fields"),
5886
5600
  meta: /* @__PURE__ */ __name(() => {
5887
5601
  if (!execution)
5888
- throw new CliError("configuration_error", "command execution is not initialized");
5602
+ throw new CliError47("configuration_error", "command execution is not initialized");
5889
5603
  return execution.meta();
5890
5604
  }, "meta")
5891
5605
  });
@@ -5901,7 +5615,7 @@ ${PROFILE_HELP}`);
5901
5615
  try {
5902
5616
  await (await closing)?.close();
5903
5617
  } catch {
5904
- throw new CliError("configuration_error", "could not close the shared meeting store");
5618
+ throw new CliError47("configuration_error", "could not close the shared meeting store");
5905
5619
  }
5906
5620
  }
5907
5621
  checkCancelled(signal());
@@ -5911,6 +5625,67 @@ ${PROFILE_HELP}`);
5911
5625
  });
5912
5626
  }, "bindZoomProgram");
5913
5627
 
5628
+ // dist/zoom-session.js
5629
+ import { CliError as CliError48, isCliError as isCliError12 } from "@wirecat/cli-base";
5630
+ import { environmentOf as environmentOf4, oauthSessionCommand } from "@wirecat/cli-core";
5631
+ import { Option as Option2 } from "commander";
5632
+ var configuredClient = /* @__PURE__ */ __name((configPath, env) => {
5633
+ try {
5634
+ return zoomClientId(readConfig(configPath), env);
5635
+ } catch {
5636
+ return void 0;
5637
+ }
5638
+ }, "configuredClient");
5639
+ var zoomSessionCommand = /* @__PURE__ */ __name((deps, resolveSettings) => oauthSessionCommand({
5640
+ app: ZM,
5641
+ // Every session command but `list` acts for one profile, so none runs for a profile nobody named.
5642
+ resolveSettings: /* @__PURE__ */ __name((flags, options) => resolveSettings(flags, { ...options, needsProfile: options?.needsProfile ?? true }), "resolveSettings"),
5643
+ providerId: "zoom",
5644
+ service: "Zoom",
5645
+ codec: ZOOM_CODEC,
5646
+ legacyAccounts: /* @__PURE__ */ __name((env, profile) => legacyAccountsOf(legacyLoginService({ env }), configuredClient(deps.configPath, env), profile), "legacyAccounts"),
5647
+ startOptions: [
5648
+ new Option2("--client-id <id>", "the Public Client ID of your Zoom app; saved as zoom.client_id once you sign in")
5649
+ ],
5650
+ preset: /* @__PURE__ */ __name(async (command, steps) => {
5651
+ const env = environmentOf4(command).env ?? process.env;
5652
+ const given = command.opts().clientId;
5653
+ if (given !== void 0)
5654
+ checkedClientId(given);
5655
+ const configClientId = readConfig(deps.configPath).clientId;
5656
+ let client = zoomApp({ env, configClientId, clientId: given })?.client;
5657
+ if (!client && command.name() !== "end") {
5658
+ if (command.name() !== "start" || !steps?.answers)
5659
+ throw new CliError48("configuration_error", SET_ZOOM_APP, { reason: CLIENT_ID_MISSING });
5660
+ const answered = checkedClientId(await steps.ask(CLIENT_ID_NEED));
5661
+ client = zoomApp({ env, configClientId, clientId: answered })?.client;
5662
+ }
5663
+ const provider = zoomProvider(client?.clientId ?? "");
5664
+ return { provider: client ? { ...provider, client } : provider, scopes: [], rotating: true };
5665
+ }, "preset"),
5666
+ verify: /* @__PURE__ */ __name(async (command, accessToken, events) => {
5667
+ const token = { accessToken, refreshToken: "", expiresAt: 0, scopes: ["user:read:user"] };
5668
+ try {
5669
+ const signal = environmentOf4(command).signal;
5670
+ const user = await getZoomProfile({ tokens: /* @__PURE__ */ __name(async () => token, "tokens") }, observedFetch(deps.fetch, events), signal ? { signal } : {});
5671
+ return { id: user.id, account: { user_id: user.id, email: user.email, display_name: user.displayName } };
5672
+ } catch (error) {
5673
+ const scopeless = isCliError12(error) && ["authentication_error", "permission_error"].includes(error.code);
5674
+ if (command.name() === "start" && scopeless)
5675
+ return { id: "", account: {} };
5676
+ throw error;
5677
+ }
5678
+ }, "verify"),
5679
+ claim: /* @__PURE__ */ __name(() => {
5680
+ }, "claim"),
5681
+ afterSignIn: /* @__PURE__ */ __name((_command, { client, profile }) => {
5682
+ if (client.source === "flag")
5683
+ setConfig(deps.configPath, "zoom.client_id", client.clientId);
5684
+ addProfile(deps.configPath, profile);
5685
+ }, "afterSignIn"),
5686
+ profiles: /* @__PURE__ */ __name(() => readConfig(deps.configPath).profiles, "profiles")
5687
+ }), "zoomSessionCommand");
5688
+
5914
5689
  // dist/run.js
5915
5690
  var configured = /* @__PURE__ */ __name((path) => {
5916
5691
  try {
@@ -5971,6 +5746,8 @@ var zoomDefinition = /* @__PURE__ */ __name((deps, onFailure) => {
5971
5746
  app: ZM,
5972
5747
  commands: /* @__PURE__ */ __name(() => [
5973
5748
  zoomRunsCommand(),
5749
+ zoomSessionCommand(deps, shared.resolveSettings),
5750
+ appCompleteCommand(ZM, { configuredProfiles: /* @__PURE__ */ __name(() => configured(deps.configPath)?.profiles ?? [], "configuredProfiles") }),
5974
5751
  appDoctorCommand(ZM, shared, {
5975
5752
  packageName: "@wirecat/zoom-cli",
5976
5753
  oauthClient: /* @__PURE__ */ __name(() => zoomClientReport(configured(deps.configPath), deps.env ?? process.env), "oauthClient")
@@ -5997,7 +5774,7 @@ var zoomDefinition = /* @__PURE__ */ __name((deps, onFailure) => {
5997
5774
  }, "onFailure")
5998
5775
  };
5999
5776
  }, "zoomDefinition");
6000
- var runCommand = /* @__PURE__ */ __name(async (args, deps, onFailure) => run(args, zoomDefinition(deps, onFailure), {
5777
+ var runCommand = /* @__PURE__ */ __name(async (args, deps, onFailure) => sharedRun(args, zoomDefinition(deps, onFailure), {
6001
5778
  streams: {
6002
5779
  data: /* @__PURE__ */ __name((text2) => deps.data(`${text2}
6003
5780
  `), "data"),
@@ -6011,20 +5788,22 @@ var runCommand = /* @__PURE__ */ __name(async (args, deps, onFailure) => run(arg
6011
5788
  ...deps.stdin ? { stdin: deps.stdin } : {},
6012
5789
  ...deps.stdout ? { stdout: deps.stdout } : {},
6013
5790
  keyring: deps.tokens.options.keyring,
5791
+ openBrowser: /* @__PURE__ */ __name((url, command) => deps.openBrowser(url, void 0, command), "openBrowser"),
5792
+ ...deps.signInFetch ? { fetch: deps.signInFetch } : {},
6014
5793
  ...deps.confirm ? { answer: /* @__PURE__ */ __name(async (question) => await deps.confirm?.(question) ? "yes" : "no", "answer") } : {}
6015
5794
  }), "runCommand");
6016
5795
 
6017
5796
  // dist/program.js
6018
- var run2 = runCommand;
6019
- var createProgram2 = /* @__PURE__ */ __name((deps) => {
6020
- const program = createProgram(zoomDefinition(deps));
5797
+ var run = runCommand;
5798
+ var createProgram = /* @__PURE__ */ __name((deps) => {
5799
+ const program = sharedProgram(zoomDefinition(deps));
6021
5800
  program.parse = () => {
6022
- throw new CliError("validation_error", "use parseAsync so command guards and cleanup run before returning");
5801
+ throw new CliError49("validation_error", "use parseAsync so command guards and cleanup run before returning");
6023
5802
  };
6024
5803
  let parsing = false;
6025
5804
  program.parseAsync = async (argv = process.argv, options) => {
6026
5805
  if (parsing)
6027
- throw new CliError("validation_error", "concurrent command parsing is unavailable");
5806
+ throw new CliError49("validation_error", "concurrent command parsing is unavailable");
6028
5807
  parsing = true;
6029
5808
  let failure;
6030
5809
  try {
@@ -6042,6 +5821,6 @@ var createProgram2 = /* @__PURE__ */ __name((deps) => {
6042
5821
  return program;
6043
5822
  }, "createProgram");
6044
5823
  export {
6045
- createProgram2 as createProgram,
6046
- run2 as run
5824
+ createProgram,
5825
+ run
6047
5826
  };