@wirecat/zoom-cli 0.76.0 → 0.77.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 (212) hide show
  1. package/README.md +12 -11
  2. package/contracts/wirecat.json +53 -105
  3. package/dist/answer-entities.d.ts +1 -141
  4. package/dist/answer-entities.d.ts.map +1 -1
  5. package/dist/answer-entities.js +0 -31
  6. package/dist/answer-entities.js.map +1 -1
  7. package/dist/api.d.ts +18 -1
  8. package/dist/api.d.ts.map +1 -1
  9. package/dist/api.js +179 -54
  10. package/dist/api.js.map +1 -1
  11. package/dist/archive-commands.d.ts +0 -3
  12. package/dist/archive-commands.d.ts.map +1 -1
  13. package/dist/archive-commands.js +1 -54
  14. package/dist/archive-commands.js.map +1 -1
  15. package/dist/bin/zm.js +2 -2
  16. package/dist/bundle/{all-profiles-AAMFP7IN.js → all-profiles-PMCFNDMA.js} +11 -11
  17. package/dist/bundle/answer-policy-XU7KEW2V.js +121 -0
  18. package/dist/bundle/{anthropic-6KIS53QB.js → anthropic-TGJOKLUS.js} +6 -6
  19. package/dist/bundle/{app-server-6QYNNYEU.js → app-server-OAODUFM3.js} +73 -63
  20. package/dist/bundle/{bun-QVVCH4MJ.js → bun-HJHVHJJV.js} +2 -2
  21. package/dist/bundle/{bun-sqlite-Y2ZFMNQ3.js → bun-sqlite-PLBOY6FP.js} +7 -7
  22. package/dist/bundle/{chunk-OWZETMRE.js → chunk-2QDD6S2R.js} +8 -8
  23. package/dist/bundle/{chunk-FGRFIXG2.js → chunk-2QRGJSKO.js} +2 -2
  24. package/dist/bundle/{chunk-D2TGXSHQ.js → chunk-36SI35XZ.js} +5 -5
  25. package/dist/bundle/{chunk-4JPOELCT.js → chunk-375BH5OD.js} +4 -4
  26. package/dist/bundle/{chunk-OFODCJ2A.js → chunk-3TLQF3DN.js} +3 -3
  27. package/dist/bundle/{chunk-K3K3WKDB.js → chunk-4QNW4NK6.js} +1 -1
  28. package/dist/bundle/{chunk-YEBWRWE3.js → chunk-4Z4VOQRR.js} +17 -17
  29. package/dist/bundle/{chunk-LGBLYFKI.js → chunk-5A5W322G.js} +6 -2
  30. package/dist/bundle/chunk-5C5UEKUJ.js +170 -0
  31. package/dist/bundle/chunk-5C6CRSEM.js +389 -0
  32. package/dist/bundle/{chunk-VG63EXRC.js → chunk-5KHCFIWI.js} +2 -2
  33. package/dist/bundle/{chunk-LEVOI6Z3.js → chunk-635GRAO5.js} +12 -12
  34. package/dist/bundle/{chunk-Y2BGABXP.js → chunk-6JRBMNRN.js} +3 -3
  35. package/dist/bundle/{chunk-XC4V6YCS.js → chunk-6YCFDDRO.js} +1 -1
  36. package/dist/bundle/{chunk-VRA4RVQU.js → chunk-77JQIY2V.js} +3 -3
  37. package/dist/bundle/{chunk-CPOFLYPU.js → chunk-7AFYZOHU.js} +29 -29
  38. package/dist/bundle/{chunk-IXPBSDKB.js → chunk-7CMYNW3W.js} +4 -4
  39. package/dist/bundle/chunk-7DTU7QZP.js +72 -0
  40. package/dist/bundle/chunk-7ILGYNWX.js +773 -0
  41. package/dist/bundle/{chunk-Y4WEAWU7.js → chunk-7S3N5CTA.js} +1 -1
  42. package/dist/bundle/chunk-7SNU7RFU.js +229 -0
  43. package/dist/bundle/{chunk-TK77DCE5.js → chunk-A6LK2W5J.js} +1 -1
  44. package/dist/bundle/{chunk-UAV74EY4.js → chunk-ADJIYY33.js} +1 -1
  45. package/dist/bundle/{chunk-JWMOHEDL.js → chunk-B7XFDMFV.js} +10 -10
  46. package/dist/bundle/{chunk-GYTAHH5Y.js → chunk-BOJCRTQW.js} +2 -2
  47. package/dist/bundle/{chunk-HUHH25AG.js → chunk-CJL5GHTQ.js} +913 -544
  48. package/dist/bundle/{chunk-T2QVWRJF.js → chunk-CL6QAZGT.js} +39 -67
  49. package/dist/bundle/{chunk-NQ356ERO.js → chunk-CUJJZJ4R.js} +44 -8
  50. package/dist/bundle/{chunk-OINDAHXC.js → chunk-CZ6OO66B.js} +4 -4
  51. package/dist/bundle/chunk-DCEQIKFD.js +259 -0
  52. package/dist/bundle/{chunk-55SWKR6Y.js → chunk-DDUNPLET.js} +256 -588
  53. package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-DYIRJINE.js} +1 -1
  54. package/dist/bundle/{chunk-WKT5RPSY.js → chunk-E3UPMPUV.js} +8 -8
  55. package/dist/bundle/{chunk-5T7TBK5Y.js → chunk-ECRFXQHA.js} +1 -1
  56. package/dist/bundle/{chunk-LOEK6IFQ.js → chunk-F4ROWGLU.js} +57 -35
  57. package/dist/bundle/{chunk-UYZDH5LK.js → chunk-FDQE2CLT.js} +1 -1
  58. package/dist/bundle/{chunk-M7WYBGQT.js → chunk-FRC5QIPQ.js} +8 -8
  59. package/dist/bundle/{chunk-3D5PETD2.js → chunk-FS5HPXQN.js} +9 -9
  60. package/dist/bundle/{chunk-QY6GE7CL.js → chunk-GHBDYYPO.js} +2 -2
  61. package/dist/bundle/{chunk-OOYIPK4F.js → chunk-H2EVYY5Z.js} +1 -1
  62. package/dist/bundle/{chunk-PFLJJQWW.js → chunk-I3QMPQYD.js} +49 -49
  63. package/dist/bundle/{chunk-XWQKRKMT.js → chunk-ICZVSVTW.js} +71 -252
  64. package/dist/bundle/{chunk-R47GYLNN.js → chunk-IJTBB23F.js} +29 -27
  65. package/dist/bundle/{chunk-WZJ7ZYR4.js → chunk-IS6MUPN2.js} +4 -4
  66. package/dist/bundle/{chunk-ORM73DZO.js → chunk-IUOKIZZN.js} +2 -2
  67. package/dist/bundle/{chunk-FMJ4QSSU.js → chunk-IZMRQ3MV.js} +10 -10
  68. package/dist/bundle/{chunk-HWYSJ4SL.js → chunk-JFVZVPRW.js} +3 -3
  69. package/dist/bundle/{chunk-7RORMNKP.js → chunk-JMU3E2WA.js} +2 -2
  70. package/dist/bundle/{chunk-6SXCGS3A.js → chunk-JQUYHPQD.js} +7 -7
  71. package/dist/bundle/{chunk-MDTEAKA5.js → chunk-KHBSQROH.js} +5 -5
  72. package/dist/bundle/{chunk-EPPE6ZTS.js → chunk-KYKW2W6X.js} +1 -1
  73. package/dist/bundle/chunk-LMZUC4CS.js +101 -0
  74. package/dist/bundle/{chunk-X73YEFQE.js → chunk-LUAS73NT.js} +18 -18
  75. package/dist/bundle/{chunk-25GMFXPF.js → chunk-LWMDLXEO.js} +2032 -2657
  76. package/dist/bundle/{chunk-GPIQY4YB.js → chunk-LYVHQ6DJ.js} +14 -14
  77. package/dist/bundle/{chunk-CXHUOPN5.js → chunk-MCLZ74II.js} +7 -7
  78. package/dist/bundle/chunk-MIG4RLDB.js +555 -0
  79. package/dist/bundle/{chunk-JADBHKBP.js → chunk-MMAZUJBO.js} +1 -1
  80. package/dist/bundle/{chunk-VABYJQYE.js → chunk-MTH3JJHF.js} +24 -22
  81. package/dist/bundle/{chunk-EZXW3ZCR.js → chunk-NJJEUG4C.js} +12 -12
  82. package/dist/bundle/{chunk-GZYICXO4.js → chunk-NKKVVPL5.js} +1 -1
  83. package/dist/bundle/{chunk-QLUU3BV2.js → chunk-NOF6LABG.js} +6 -6
  84. package/dist/bundle/{chunk-KEFDP6NL.js → chunk-NPDPD2H3.js} +12 -12
  85. package/dist/bundle/{chunk-5EII5RIL.js → chunk-NPIVV52M.js} +1 -1
  86. package/dist/bundle/{chunk-UG2QDGAH.js → chunk-OOIU36FA.js} +1 -1
  87. package/dist/bundle/{chunk-IUSY4ZJK.js → chunk-OXXJW3A5.js} +806 -1523
  88. package/dist/bundle/chunk-PM3MB3E7.js +295 -0
  89. package/dist/bundle/{chunk-EBIK5Q73.js → chunk-PO4RZ4XZ.js} +1 -1
  90. package/dist/bundle/{chunk-EZJSAYWZ.js → chunk-Q7ZW7XAX.js} +31 -87
  91. package/dist/bundle/{chunk-CS62FET6.js → chunk-QAGECFHL.js} +22 -22
  92. package/dist/bundle/{chunk-WNXC42IU.js → chunk-QE4L2QQZ.js} +9 -9
  93. package/dist/bundle/{chunk-YESHGC3M.js → chunk-QKNO3JTG.js} +2 -2
  94. package/dist/bundle/{chunk-TYAFL66K.js → chunk-QUGESVOE.js} +15 -31
  95. package/dist/bundle/{chunk-DQHS336B.js → chunk-RQS3W4P6.js} +7 -6
  96. package/dist/bundle/{chunk-XHVFX74L.js → chunk-SFPUSEOT.js} +2 -2
  97. package/dist/bundle/{chunk-YGKM2ZWF.js → chunk-SP5OMHOO.js} +3 -3
  98. package/dist/bundle/chunk-STNZQBY4.js +335 -0
  99. package/dist/bundle/{chunk-RJK5ADMH.js → chunk-SVJQRG5N.js} +16 -16
  100. package/dist/bundle/{chunk-B7ZREOBD.js → chunk-SY5NGYKA.js} +12 -12
  101. package/dist/bundle/{chunk-GB5LI5RM.js → chunk-T4CI3YXW.js} +6 -6
  102. package/dist/bundle/{chunk-ELW3LMJZ.js → chunk-T6RSYDFA.js} +342 -154
  103. package/dist/bundle/{chunk-ZETM63M6.js → chunk-TY4FFK2P.js} +6 -6
  104. package/dist/bundle/chunk-UGRGYLEI.js +224 -0
  105. package/dist/bundle/{chunk-4ERYXY4Y.js → chunk-VGERRRDC.js} +1 -1
  106. package/dist/bundle/{chunk-XRH2NKW4.js → chunk-VJ2TLU7R.js} +6 -6
  107. package/dist/bundle/{chunk-2HKUQ7DR.js → chunk-W7UCN7MF.js} +3 -3
  108. package/dist/bundle/{chunk-IVFNHIU4.js → chunk-WD5OL5JB.js} +81 -5
  109. package/dist/bundle/{chunk-CE5Y7PQU.js → chunk-XC3MWABM.js} +4 -4
  110. package/dist/bundle/{chunk-ZFYNJERV.js → chunk-XCA5N63N.js} +6 -6
  111. package/dist/bundle/chunk-XVHDT4CO.js +31 -0
  112. package/dist/bundle/{chunk-65VRWNDP.js → chunk-YFN5A7OP.js} +4 -4
  113. package/dist/bundle/{chunk-VCFSUGPE.js → chunk-YJIGGUPI.js} +4 -4
  114. package/dist/bundle/{chunk-RXUVXAMM.js → chunk-YVI5SQPY.js} +1 -1
  115. package/dist/bundle/{chunk-FBVJGJDM.js → chunk-ZRNNMBPC.js} +27 -574
  116. package/dist/bundle/{chunk-VJANMYEC.js → chunk-ZUMKZOHR.js} +3 -3
  117. package/dist/bundle/{chunk-35AH33VJ.js → chunk-ZZ32DXTH.js} +1 -1
  118. package/dist/bundle/{cli-FHMLYHUZ.js → cli-Y27PHKBV.js} +101 -84
  119. package/dist/bundle/command-contract-GB7YA3KW.js +45 -0
  120. package/dist/bundle/{command-server-entry-YEZM52R5.js → command-server-entry-AXQSW2X6.js} +35 -31
  121. package/dist/bundle/config-2OOABHR7.js +108 -0
  122. package/dist/bundle/{decode-SIYRMJOK.js → decode-ZRNOOTUZ.js} +16 -8
  123. package/dist/bundle/{dispatch-SMER3WDX.js → dispatch-2GHGPAYH.js} +9 -9
  124. package/dist/bundle/{dist-BSJETSFE.js → dist-MUFVAMKB.js} +25 -22
  125. package/dist/bundle/{echarts-UZJ6AREV.js → echarts-F4PHDYET.js} +2 -2
  126. package/dist/bundle/{embed-A7DSHVI7.js → embed-KWHCKPCV.js} +7 -7
  127. package/dist/bundle/{embedder-WQBR4UGS.js → embedder-U3R3RY54.js} +10 -10
  128. package/dist/bundle/{failure-73UQXQTW.js → failure-S2YXEN4A.js} +3 -3
  129. package/dist/bundle/first-run-F4YR2E2C.js +29 -0
  130. package/dist/bundle/first-screen-HPRHD3VK.js +43 -0
  131. package/dist/bundle/{folders-BH4SV6SI.js → folders-DVTRFQKW.js} +5 -5
  132. package/dist/bundle/{instructions-SDDUBGH4.js → instructions-JU4YW6QY.js} +1 -1
  133. package/dist/bundle/{main-KL4FN5F3.js → main-5UCRPACH.js} +24 -24
  134. package/dist/bundle/{mcp-GN4FTJX5.js → mcp-O6ACR2DX.js} +2 -2
  135. package/dist/bundle/meeting-combined-IWU5SPAH.js +26 -0
  136. package/dist/bundle/meeting-model-ILIUJECZ.js +26 -0
  137. package/dist/bundle/meeting-semantic-5DKRGZFS.js +23 -0
  138. package/dist/bundle/{meetings-URPXBHV7.js → meetings-T2UY35DV.js} +25 -7
  139. package/dist/bundle/{node-ELCNUOCE.js → node-MAVRAF4M.js} +2 -2
  140. package/dist/bundle/{node-sqlite-QLSNHZBM.js → node-sqlite-TFBQ5NDI.js} +8 -8
  141. package/dist/bundle/{oauth-LZ64S7Y3.js → oauth-7IG5HWSY.js} +8 -8
  142. package/dist/bundle/{open-WB4HUPQT.js → open-3R3N7L3X.js} +6 -6
  143. package/dist/bundle/openai-DD5I3DWC.js +28 -0
  144. package/dist/bundle/{output-file-AHPQA5LR.js → output-file-KKHHAYWF.js} +6 -6
  145. package/dist/bundle/{process-67DAKAAQ.js → process-OIO254NR.js} +1 -1
  146. package/dist/bundle/{program-CIMACIBE.js → program-IBYRU76H.js} +423 -251
  147. package/dist/bundle/{prompt-GG53UBDJ.js → prompt-LNEOO7PN.js} +6 -6
  148. package/dist/bundle/{recognize-CFJ3CAEH.js → recognize-2WYLT3PC.js} +5 -5
  149. package/dist/bundle/{remote-BLEM7C3Q.js → remote-7EAJEIV7.js} +11 -11
  150. package/dist/bundle/{rerank-ERN6PC66.js → rerank-DZBZ744F.js} +8 -8
  151. package/dist/bundle/run-log-CCIVRSHP.js +135 -0
  152. package/dist/bundle/{serve-FJPPTJXH.js → serve-T3KQV5SS.js} +15 -15
  153. package/dist/bundle/{server-FLUSDUGM.js → server-2QQAQZ2J.js} +59 -49
  154. package/dist/bundle/server-OJQMPF2R.js +84 -0
  155. package/dist/bundle/{services-LXC6DVUQ.js → services-DETAKMC3.js} +78 -54
  156. package/dist/bundle/{speech-WFEZTKXA.js → speech-HD57JNTK.js} +34 -18
  157. package/dist/bundle/{sqlite-runtime-KN33VSP7.js → sqlite-runtime-OCETZSEZ.js} +7 -7
  158. package/dist/bundle/{state-TXS4ZHIT.js → state-ZKVQ4DBI.js} +7 -7
  159. package/dist/bundle/{store-ZUREZYZB.js → store-7IZ2WMHF.js} +24 -20
  160. package/dist/bundle/{store-MUOXLVL4.js → store-GEAQ7V5R.js} +26 -22
  161. package/dist/bundle/store-connection-BALCZW7P.js +101 -0
  162. package/dist/bundle/store-maintenance-command-SBT4LDSI.js +76 -0
  163. package/dist/bundle/{streaming-ZSCHRC5S.js → streaming-CLBAO3MG.js} +7 -7
  164. package/dist/bundle/{tokens-YVDOY4EV.js → tokens-WH73ZWFI.js} +10 -10
  165. package/dist/bundle/zm.js +9 -9
  166. package/dist/bundle/{zoom-app-O6GIMB7Y.js → zoom-app-ZDTYMJET.js} +8 -8
  167. package/dist/commands.d.ts.map +1 -1
  168. package/dist/commands.js +3 -0
  169. package/dist/commands.js.map +1 -1
  170. package/dist/first-screen.d.ts.map +1 -1
  171. package/dist/first-screen.js +3 -5
  172. package/dist/first-screen.js.map +1 -1
  173. package/dist/meeting-integration-commands.d.ts.map +1 -1
  174. package/dist/meeting-integration-commands.js +46 -28
  175. package/dist/meeting-integration-commands.js.map +1 -1
  176. package/dist/meeting-source.d.ts.map +1 -1
  177. package/dist/meeting-source.js +15 -1
  178. package/dist/meeting-source.js.map +1 -1
  179. package/dist/permissions.d.ts +8 -4
  180. package/dist/permissions.d.ts.map +1 -1
  181. package/dist/permissions.js +25 -24
  182. package/dist/permissions.js.map +1 -1
  183. package/dist/program-bindings.d.ts.map +1 -1
  184. package/dist/program-bindings.js +8 -5
  185. package/dist/program-bindings.js.map +1 -1
  186. package/dist/program.d.ts +2 -1
  187. package/dist/program.d.ts.map +1 -1
  188. package/dist/program.js.map +1 -1
  189. package/dist/remote-meetings.d.ts +38 -8
  190. package/dist/remote-meetings.d.ts.map +1 -1
  191. package/dist/remote-meetings.js +52 -29
  192. package/dist/remote-meetings.js.map +1 -1
  193. package/dist/run.js +1 -1
  194. package/dist/version.d.ts +1 -1
  195. package/dist/version.js +1 -1
  196. package/dist/zoom-app.d.ts.map +1 -1
  197. package/dist/zoom-app.js +1 -0
  198. package/dist/zoom-app.js.map +1 -1
  199. package/package.json +3 -3
  200. package/skills/zoom-cli/SKILL.md +2 -2
  201. package/dist/bundle/answer-policy-ETAELI4A.js +0 -110
  202. package/dist/bundle/chunk-64N7MY3I.js +0 -161
  203. package/dist/bundle/command-contract-HUZ4I23S.js +0 -41
  204. package/dist/bundle/config-KVTWN7QZ.js +0 -97
  205. package/dist/bundle/first-run-SY6XSUZ3.js +0 -29
  206. package/dist/bundle/first-screen-ZDMODGWS.js +0 -39
  207. package/dist/bundle/openai-KN6JE4QU.js +0 -28
  208. package/dist/bundle/run-log-S67YPJF6.js +0 -124
  209. package/dist/bundle/server-UNJY3TSJ.js +0 -74
  210. package/dist/bundle/store-connection-NRNEBUPU.js +0 -90
  211. package/dist/bundle/store-maintenance-command-OBOPYFZ5.js +0 -65
  212. /package/dist/bundle/{chunk-BDCC2J2Z.js → chunk-VKE77B3F.js} +0 -0
@@ -1,18 +1,18 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ checkedClientId
5
+ } from "./chunk-RQS3W4P6.js";
3
6
  import {
4
7
  commandsCommand,
5
8
  formatSuggestions,
6
9
  meetingResultItem,
7
10
  runsCommand,
8
11
  suggest
9
- } from "./chunk-HUHH25AG.js";
10
- import {
11
- checkedClientId
12
- } from "./chunk-DQHS336B.js";
12
+ } from "./chunk-CJL5GHTQ.js";
13
13
  import {
14
14
  sharedStoreCommand
15
- } from "./chunk-XWQKRKMT.js";
15
+ } from "./chunk-ICZVSVTW.js";
16
16
  import {
17
17
  NO_EFFECTS,
18
18
  REMOTE_READ,
@@ -37,37 +37,37 @@ import {
37
37
  snakeKeys,
38
38
  usableProfileName,
39
39
  withSettingDefaults
40
- } from "./chunk-55SWKR6Y.js";
40
+ } from "./chunk-DDUNPLET.js";
41
41
  import {
42
42
  readOnlyLockOf,
43
43
  readOnlyRefusal
44
- } from "./chunk-QY6GE7CL.js";
44
+ } from "./chunk-GHBDYYPO.js";
45
45
  import {
46
46
  setupPermissionCeiling
47
- } from "./chunk-4JPOELCT.js";
47
+ } from "./chunk-375BH5OD.js";
48
48
  import {
49
49
  CEILING_KEY,
50
50
  DEFAULT_PERMISSIONS,
51
51
  LEVELS,
52
52
  keyForCommand,
53
53
  levelFor
54
- } from "./chunk-OWZETMRE.js";
54
+ } from "./chunk-2QDD6S2R.js";
55
55
  import {
56
56
  KEEP_RUNS_FOR_DAYS,
57
57
  KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
58
58
  RUNS_SIZE_LIMIT_MB
59
- } from "./chunk-FBVJGJDM.js";
59
+ } from "./chunk-MIG4RLDB.js";
60
60
  import {
61
61
  ZM
62
- } from "./chunk-5T7TBK5Y.js";
62
+ } from "./chunk-ECRFXQHA.js";
63
63
  import {
64
64
  MEETING_RESULT_ENTITIES
65
- } from "./chunk-ELW3LMJZ.js";
65
+ } from "./chunk-T6RSYDFA.js";
66
66
  import {
67
67
  createRenderer,
68
68
  projectFields,
69
69
  saveConfigFile
70
- } from "./chunk-CS62FET6.js";
70
+ } from "./chunk-QAGECFHL.js";
71
71
  import {
72
72
  array,
73
73
  boolean,
@@ -92,10 +92,10 @@ import {
92
92
  strictObject,
93
93
  string,
94
94
  union
95
- } from "./chunk-3D5PETD2.js";
95
+ } from "./chunk-FS5HPXQN.js";
96
96
  import {
97
97
  CliError
98
- } from "./chunk-K3K3WKDB.js";
98
+ } from "./chunk-4QNW4NK6.js";
99
99
  import {
100
100
  __name
101
101
  } from "./chunk-ZVVMGPBJ.js";
@@ -305,27 +305,6 @@ var archiveReceipt = strictObject({
305
305
  availability: optional(literal("unknown")),
306
306
  checkpoint_revision: optional(nullable(count))
307
307
  });
308
- var remote = strictObject({
309
- id: text,
310
- uuid: nullableText,
311
- title: nullableText,
312
- type: nullable(number()),
313
- started_at: nullableText,
314
- duration_minutes: nullable(number()),
315
- timezone: nullableText,
316
- agenda: nullableText,
317
- join_url: nullableText
318
- });
319
- var remoteChange = strictObject({
320
- action: picklist(["create", "update", "cancel"]),
321
- applied: flag,
322
- request: strictObject({
323
- method: picklist(["POST", "PATCH", "DELETE"]),
324
- path: text,
325
- body: optional(record(text, union([text, number()])))
326
- }),
327
- meeting: optional(remote)
328
- });
329
308
  var schedule = strictObject({
330
309
  version: literal(1),
331
310
  id: text,
@@ -411,15 +390,6 @@ var ZOOM_ANSWER_ENTITIES = {
411
390
  "recordings schedule create": { name: "zoom_archive_schedule_change", schema: scheduleReceipt },
412
391
  "recordings schedule disable": { name: "zoom_archive_schedule_change", schema: scheduleReceipt },
413
392
  "recordings schedule run": { name: "zoom_archive_receipt", schema: archiveReceipt },
414
- "remote-meetings list": { name: "zoom_remote_meeting", schema: remote },
415
- "remote-meetings show": { name: "zoom_remote_meeting", schema: remote },
416
- "remote-meetings invitation": {
417
- name: "zoom_remote_invitation",
418
- schema: strictObject({ id: text, invitation: text })
419
- },
420
- "remote-meetings create": { name: "zoom_remote_change", schema: remoteChange },
421
- "remote-meetings update": { name: "zoom_remote_change", schema: remoteChange },
422
- "remote-meetings cancel": { name: "zoom_remote_change", schema: remoteChange },
423
393
  "zoom search": { name: "zoom_search_hit", schema: searchHit },
424
394
  "meetings embeddings": { name: "meeting_embedding", schema: MEETING_RESULT_ENTITIES.meeting_embedding, shared: true },
425
395
  "meetings sync": { name: "meeting_ingestion", schema: MEETING_RESULT_ENTITIES.meeting_ingestion, shared: true },
@@ -431,7 +401,6 @@ var ZOOM_ANSWER_ENTITIES = {
431
401
  },
432
402
  watch: { name: "meeting_ingestion", schema: MEETING_RESULT_ENTITIES.meeting_ingestion, shared: true },
433
403
  "meetings export": { name: "meeting_export", schema: MEETING_RESULT_ENTITIES.meeting_export, shared: true },
434
- "meetings update": { name: "meeting_association", schema: MEETING_RESULT_ENTITIES.meeting_association, shared: true },
435
404
  "meetings link": { name: "meeting_association", schema: MEETING_RESULT_ENTITIES.meeting_association, shared: true },
436
405
  "meetings transcribe": {
437
406
  name: "meeting_transcription",
@@ -650,17 +619,17 @@ var exampleFor = /* @__PURE__ */ __name((path) => {
650
619
  "meetings export": "1 --format markdown",
651
620
  "meetings people": '"Alice Example"',
652
621
  "meetings projects evidence": 'RES "identity_id:12"',
653
- "meetings import": "./downloaded-transcripts"
622
+ "meetings import": "./downloaded-transcripts",
623
+ "meetings update": '123456789 --title "Example review" --dry-run',
624
+ "meetings cancel": "123456789 --dry-run",
625
+ "meetings invitation": "123456789"
654
626
  };
655
627
  return `zm ${profile}${path}${argumentsByPath[path] ? ` ${argumentsByPath[path]}` : ""} --json`;
656
628
  }, "exampleFor");
657
629
  var addStandardCommands = addStandardCommandsDefinition;
658
630
 
659
631
  // dist/permissions.js
660
- var DEFAULT_PERMISSIONS2 = {
661
- ...DEFAULT_PERMISSIONS,
662
- "remote-meetings": "ask"
663
- };
632
+ var DEFAULT_PERMISSIONS2 = DEFAULT_PERMISSIONS;
664
633
  var discoveryLevels = /* @__PURE__ */ __name((own, env) => {
665
634
  const ceiling = setupPermissionCeiling(env);
666
635
  return {
@@ -699,10 +668,10 @@ var parsePermissions = /* @__PURE__ */ __name((value, known) => {
699
668
  try {
700
669
  parsed = JSON.parse(value);
701
670
  } catch {
702
- throw new CliError("validation_error", 'permissions must be a JSON object: {"remote-meetings": "allow"}');
671
+ throw new CliError("validation_error", 'permissions must be a JSON object: {"meetings.create": "allow"}');
703
672
  }
704
673
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
705
- throw new CliError("validation_error", 'permissions must be a JSON object: {"remote-meetings": "allow"}');
674
+ throw new CliError("validation_error", 'permissions must be a JSON object: {"meetings.create": "allow"}');
706
675
  for (const [key, level] of Object.entries(parsed)) {
707
676
  if (!known.has(key))
708
677
  throw new CliError("validation_error", `no command is called ${key}; a key is a command path, dotted`, {
@@ -731,22 +700,24 @@ var checkPermission = /* @__PURE__ */ __name((command, context) => {
731
700
  throw new CliError("permission_error", `refused to ${changes}: the WireCat setup answer keeps every tool read-only \u2014 \`tg setup\`, \`max setup\` or \`wa setup\` at a terminal changes it`, { key, level });
732
701
  if (level === "readonly" && changes)
733
702
  throw refuse(at, level, profile, `refused to ${changes}`);
734
- const options = command.opts();
735
- const confirms = metaOf(command).effects?.remote === "write" && command.options.some(({ long }) => long === "--yes");
736
- if (!confirms || options.dryRun || options.yes)
703
+ }, "checkPermission");
704
+ var askOwner = /* @__PURE__ */ __name(async (command, at, profile, confirm) => {
705
+ if (!confirm)
706
+ throw new CliError("confirmation_required", `${at} asks first for profile ${profile}: add --yes to apply, or --dry-run to preview`, { key: at });
707
+ if (!await confirm(`zm: ${pathOf3(command).join(" ")} changes Zoom for profile ${profile}. Apply?`))
708
+ throw new CliError("cancelled", "not applied");
709
+ }, "askOwner");
710
+ var askBeforeWrite = /* @__PURE__ */ __name(async (command, context) => {
711
+ const key = permissionKeyOf(command);
712
+ if (!key)
737
713
  return;
738
- if (level === "allow") {
739
- command.setOptionValue("yes", true);
714
+ const named = context.profile();
715
+ const own = named === void 0 ? {} : context.config().permissions[named] ?? {};
716
+ const { level, key: by } = levelFor(own, key, DEFAULT_PERMISSIONS2);
717
+ if (level !== "ask" || command.optsWithGlobals().yes)
740
718
  return;
741
- }
742
- if (!context.confirm)
743
- throw new CliError("confirmation_required", `${at} asks first for profile ${profile}: add --yes to apply, or --dry-run to preview`, { key: at });
744
- return context.confirm(`zm: ${pathOf3(command).join(" ")} changes Zoom for profile ${profile}. Apply?`).then((yes) => {
745
- if (!yes)
746
- throw new CliError("cancelled", "not applied");
747
- command.setOptionValue("yes", true);
748
- });
749
- }, "checkPermission");
719
+ await askOwner(command, by ?? key, named ?? "<profile>", context.confirm);
720
+ }, "askBeforeWrite");
750
721
  var guardCommand = /* @__PURE__ */ __name((command, env, context, confirm) => {
751
722
  refuseChangeWhenReadOnly(command, env);
752
723
  const ceiling = setupPermissionCeiling(env);
@@ -983,6 +954,7 @@ export {
983
954
  discoveryLevels,
984
955
  permissionKeyForPath,
985
956
  permissionKeys,
957
+ askBeforeWrite,
986
958
  guardCommand,
987
959
  ZOOM_SETTINGS,
988
960
  inspectConfig,
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  QUERY_REASONS
5
- } from "./chunk-FMJ4QSSU.js";
5
+ } from "./chunk-IZMRQ3MV.js";
6
6
  import {
7
7
  defineReasons
8
- } from "./chunk-3D5PETD2.js";
8
+ } from "./chunk-FS5HPXQN.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/errors/reasons.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/errors/reasons.js
14
14
  var validation = /* @__PURE__ */ __name((reason, message) => [reason, "validation_error", message], "validation");
15
15
  var QUERY = [
16
16
  ["query.aborted", "the search was stopped before it finished"],
@@ -32,6 +32,7 @@ var SIGN_IN = [
32
32
  ["oauth.timeout", "timeout", "the sign-in was not finished in time"],
33
33
  ["oauth.mismatch", "authentication_error", "the pasted sign-in result belongs to another sign-in"],
34
34
  ["session.missing", "authentication_error", "this profile is not signed in: no saved sign-in or API token"],
35
+ ["session.unreadable", "configuration_error", "the profile's stored secrets cannot be read; sign in again"],
35
36
  ["oauth.locked", "provider_unavailable", "another process holds this sign-in's lock"],
36
37
  ["oauth.no-response", "outcome_unknown", "the token request did not finish"],
37
38
  ["oauth.unavailable", "provider_unavailable", "the provider's token endpoint is unavailable"],
@@ -67,7 +68,8 @@ var PROVIDER_API = [
67
68
  ["item.not-found", "not_found", "the provider has no item by this id, or this account cannot see it"],
68
69
  ["file.not-found", "not_found", "the file named, or its folder, does not exist"],
69
70
  validation("file.not-a-file", "the path names a folder or another thing that is not a file"),
70
- ["file.denied", "permission_error", "the file cannot be opened: permission denied"]
71
+ ["file.denied", "permission_error", "the file cannot be opened: permission denied"],
72
+ validation("file.too-large", "the file is larger than the limit set for this read")
71
73
  ];
72
74
  var SFTP = [
73
75
  ["sftp.host-key-missing", "configuration_error", "no host key is pinned for the SFTP server"],
@@ -77,7 +79,21 @@ var SFTP = [
77
79
  ["sftp.library-missing", "configuration_error", "SFTP needs the ssh2 package in the CLI's dependencies"],
78
80
  ["sftp.timeout", "timeout", "the SFTP server did not answer in time"],
79
81
  validation("sftp.too-large", "the file is larger than the read's byte limit"),
80
- validation("sftp.closed", "the SFTP connection was closed before the operation")
82
+ validation("sftp.closed", "the SFTP connection was closed before the operation"),
83
+ validation("sftp.file-changed", "the file changed on the server while a stream read it; read it again"),
84
+ ["ssh.forward-refused", "permission_error", "the SSH server does not allow forwarding to that address"],
85
+ ["ssh.forward-failed", "network_error", "the SSH server could not reach the address behind it"]
86
+ ];
87
+ var SQL = [
88
+ validation("sql.bad-identifier", "a table or column name is not a plain identifier"),
89
+ ["sql.library-missing", "configuration_error", "this database needs the mysql2 or pg package in the CLI"],
90
+ ["db.refused", "authentication_error", "the database server refused the user or password"],
91
+ ["db.no-database", "not_found", "the database server has no such database"],
92
+ ["db.no-table", "not_found", "the database has no such table"],
93
+ ["db.no-select", "permission_error", "the database user may not read the table; grant it SELECT"],
94
+ ["db.read-only", "permission_error", "the database refused a write: the connection only reads"],
95
+ ["db.timeout", "timeout", "the database server did not answer in time"],
96
+ ["db.failed", "provider_error", "the database server failed the query"]
81
97
  ];
82
98
  var OTHERS = [
83
99
  validation("doctor.report-exists", "the report's file exists; a problem report never overwrites a file"),
@@ -109,6 +125,13 @@ var OTHERS = [
109
125
  ["ai.images-not-allowed", "permission_error", "the AI model may not read pictures; models ai set --allow-remote"],
110
126
  ["picture-reading.off", "permission_error", "picture reading is never; models picture-reading set request"],
111
127
  ["picture-reading.owner-only", "permission_error", "only the owner turns picture reading on, not an agent"],
128
+ [
129
+ "chat-sending.denied",
130
+ "permission_error",
131
+ "models chats is denied: chat text never goes to a model off this computer, even with --yes"
132
+ ],
133
+ ["chat-sending.ask", "confirmation_required", "models chats is ask: pass --yes, or the owner sets it to allowed"],
134
+ ["chat-sending.owner-only", "permission_error", "only the owner makes models chats less strict, not an agent"],
112
135
  validation("picture-reading.agent-missing", "choose the agent that reads: --agent claude or --agent codex"),
113
136
  validation("picture-reading.not-a-picture", "the file is not a PNG, JPEG or WebP picture"),
114
137
  ["picture-reading.unavailable-file", "not_found", "the picture could not be fetched, or is over the size limit"],
@@ -164,6 +187,7 @@ var OTHERS = [
164
187
  ["document.not-imported", "not_found", "the document is not imported in this source account"],
165
188
  ["document.not-found", "not_found", "no listed document has that reference"],
166
189
  ["meeting.not-found", "not_found", "no meeting row has that event or meeting reference"],
190
+ ["listing.too-large", "provider_error", "the listing is over its bound; the checkpoint was kept"],
167
191
  ["listing.source-not-found", "not_found", "a source: term names no account holding what is listed"],
168
192
  validation("query.empty-window", "the time window ends before it starts, so no row can fall in it"),
169
193
  ["extraction.invalid-proposals", "invalid_response", "the model's memory proposals could not be used"],
@@ -181,6 +205,15 @@ var OTHERS = [
181
205
  "the email could not be read again, so its skipped attachments have no text"
182
206
  ],
183
207
  ["mirror.partial", "provider_error", "some mirrored files were not synced"],
208
+ ["mirror.none", "not_found", "the profile has no mirrors; add one with mirrors add"],
209
+ ["mirror.not-found", "not_found", "no such mirror in this profile; see mirrors list"],
210
+ validation("mirror.not-folder", "the path to mirror is not a folder"),
211
+ ["catalog.unavailable", "configuration_error", "the store has no shared catalog for this account"],
212
+ ["catalog.not-found", "not_found", "the file or folder is not in the local catalog; run catalog import or sync"],
213
+ validation("catalog.depth-invalid", "tree depth must be between 0 and 50"),
214
+ ["catalog.cycle", "invalid_response", "local folder ancestry contains a cycle"],
215
+ validation("catalog.tree-limit", "the tree is over 10000 entries; name a smaller folder or lower --depth"),
216
+ validation("export.exists", "the output file already exists"),
184
217
  ["profile.wrong-account", "authentication_error", "the signed-in source account does not match this profile"],
185
218
  validation("push.too-many-files", "the folder holds more files than one push takes"),
186
219
  validation("push.unreadable", "the folder to push could not be read"),
@@ -191,7 +224,7 @@ var OTHERS = [
191
224
  "the settings file's damage has more than one reading; nothing was changed, so it is fixed by hand"
192
225
  ],
193
226
  ["state.invalid", "configuration_error", "the saved sync state is unreadable or invalid; it is kept, not reset"],
194
- ["sync.partial", "provider_error", "some calendars did not sync; the next sync retries them"],
227
+ ["sync.partial", "provider_error", "some sources did not sync; the next sync retries them"],
195
228
  validation("event.conflict", "the event changed at the provider since the last sync; sync and try again"),
196
229
  validation("event.notify-required", "the event has other attendees; say whether to notify them"),
197
230
  validation("remind.window", "--due-within is outside 1m to 1d"),
@@ -202,6 +235,7 @@ var OTHERS = [
202
235
  "the reminder program failed for some events; the next run retries them"
203
236
  ],
204
237
  ["sync.failed", "provider_error", "the sync failed; the answer comes from what the store already holds"],
238
+ validation("event.conference-exists", "the event has a meeting link already, which its attendees use"),
205
239
  validation("event.repeat-invalid", "the repeat rule is outside the RFC 5545 subset the calendars take"),
206
240
  validation("event.repeat-kind", "the series' rule holds a date or a time of the kind the event is leaving"),
207
241
  validation("event.repeat-split", "the series cannot be split at this occurrence, or was split there already"),
@@ -612,7 +646,7 @@ var INPUT_FIELD_REASONS = defineReasons([
612
646
  var REASONS = defineReasons([
613
647
  ...QUERY_REASONS,
614
648
  ...INPUT_FIELD_REASONS,
615
- ...[...QUERY, ...SIGN_IN, ...PROVIDER_API, ...SFTP, ...OTHERS].map(([reason, code, message]) => ({
649
+ ...[...QUERY, ...SIGN_IN, ...PROVIDER_API, ...SFTP, ...SQL, ...OTHERS].map(([reason, code, message]) => ({
616
650
  reason,
617
651
  code,
618
652
  message,
@@ -689,6 +723,8 @@ var DETAILS = [
689
723
  ];
690
724
  var SHARED = { reasons: REASONS, details: DETAILS };
691
725
  var merged = /* @__PURE__ */ new WeakMap();
726
+ var coreCodes = new Map(REASONS.map((entry) => [entry.reason, entry.code]));
727
+ var sameAsCore = /* @__PURE__ */ __name((entry) => coreCodes.get(entry.reason) === entry.code, "sameAsCore");
692
728
  var failureContext = /* @__PURE__ */ __name((errors) => {
693
729
  if (!errors)
694
730
  return SHARED;
@@ -699,7 +735,7 @@ var failureContext = /* @__PURE__ */ __name((errors) => {
699
735
  if (unnamed.length > 0)
700
736
  throw new Error(`error details must be snake_case: ${unnamed.join(", ")}`);
701
737
  const context = {
702
- reasons: defineReasons([...REASONS, ...errors.reasons ?? []]),
738
+ reasons: defineReasons([...REASONS, ...(errors.reasons ?? []).filter((entry) => !sameAsCore(entry))]),
703
739
  details: [.../* @__PURE__ */ new Set([...DETAILS, ...errors.details ?? []])]
704
740
  };
705
741
  merged.set(errors, context);
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  wirecatDirectory
5
- } from "./chunk-XHVFX74L.js";
5
+ } from "./chunk-SFPUSEOT.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-K3K3WKDB.js";
8
+ } from "./chunk-4QNW4NK6.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/speech/models.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/speech/models.js
14
14
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
15
15
  var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
16
16
  var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
@@ -137,7 +137,7 @@ var speechModel = /* @__PURE__ */ __name((id) => {
137
137
  return model;
138
138
  }, "speechModel");
139
139
 
140
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/speech/install.js
140
+ // node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/speech/install.js
141
141
  import { createHash, randomUUID } from "node:crypto";
142
142
  import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
143
143
  import { rename, rm } from "node:fs/promises";
@@ -0,0 +1,259 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ OPENAI_URL,
5
+ openRemote,
6
+ remoteKey,
7
+ remoteModel
8
+ } from "./chunk-QE4L2QQZ.js";
9
+ import {
10
+ isTextModelInstalled,
11
+ openEmbedder,
12
+ textModelsDirectory
13
+ } from "./chunk-T4CI3YXW.js";
14
+ import {
15
+ textModel,
16
+ vectorModelKey
17
+ } from "./chunk-STNZQBY4.js";
18
+ import {
19
+ endpointFetch
20
+ } from "./chunk-SP5OMHOO.js";
21
+ import {
22
+ CliError
23
+ } from "./chunk-4QNW4NK6.js";
24
+ import {
25
+ __name
26
+ } from "./chunk-ZVVMGPBJ.js";
27
+
28
+ // node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/services/meeting-model.js
29
+ var integer = /* @__PURE__ */ __name((value, name, max) => {
30
+ if (!Number.isSafeInteger(value) || value < 1 || value > max)
31
+ throw new CliError("validation_error", `Invalid ${name}`);
32
+ return value;
33
+ }, "integer");
34
+ var cancelled = /* @__PURE__ */ __name((signal) => {
35
+ if (signal?.aborted)
36
+ throw new CliError("cancelled", "Meeting embedding was cancelled");
37
+ }, "cancelled");
38
+ var validatedRemote = /* @__PURE__ */ __name((remote) => {
39
+ let url;
40
+ try {
41
+ url = new URL(remote.baseUrl);
42
+ } catch {
43
+ throw new CliError("validation_error", "Invalid embedding endpoint");
44
+ }
45
+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash)
46
+ throw new CliError("validation_error", "Embedding endpoint requires HTTP/S without credentials, query or fragment");
47
+ if (typeof remote.model !== "string" || !/^[\w./:-]{1,200}$/.test(remote.model))
48
+ throw new CliError("validation_error", "Invalid embedding model name");
49
+ const dims = integer(remote.dims, "embedding dimensions", 8192);
50
+ const baseUrl = remote.baseUrl.replace(/\/+$/, "");
51
+ const result = remoteModel({ model: remote.model, dims, ...baseUrl === OPENAI_URL ? {} : { baseUrl } });
52
+ return result;
53
+ }, "validatedRemote");
54
+ var meetingEmbeddingModel = /* @__PURE__ */ __name((choice, env) => {
55
+ if (typeof choice === "string") {
56
+ const model = textModel(choice, env);
57
+ return { key: vectorModelKey(model), dims: model.dims, kind: "local", model: model.id };
58
+ }
59
+ if (!choice || typeof choice !== "object" || !choice.remote)
60
+ throw new CliError("validation_error", "An explicit embedding model is required");
61
+ const remote = validatedRemote(choice.remote);
62
+ if (choice.concurrency !== void 0 && choice.concurrency !== 1)
63
+ throw new CliError("validation_error", "Meeting embedding supports one remote request worker");
64
+ return { key: remoteKey(remote), dims: remote.dims, kind: "remote", model: remote.model };
65
+ }, "meetingEmbeddingModel");
66
+ var createMeetingRemoteModel = /* @__PURE__ */ __name((input) => {
67
+ try {
68
+ return validatedRemote(remoteModel(input));
69
+ } catch (error) {
70
+ if (error instanceof CliError)
71
+ throw error;
72
+ throw new CliError("validation_error", "Invalid embedding endpoint");
73
+ }
74
+ }, "createMeetingRemoteModel");
75
+ var withAbort = /* @__PURE__ */ __name(async (pending, signal) => {
76
+ cancelled(signal);
77
+ if (!signal)
78
+ return pending;
79
+ let onAbort = /* @__PURE__ */ __name(() => {
80
+ }, "onAbort");
81
+ const interrupted = new Promise((_, reject) => {
82
+ onAbort = /* @__PURE__ */ __name(() => reject(new CliError("cancelled", "Meeting embedding was cancelled")), "onAbort");
83
+ signal.addEventListener("abort", onAbort, { once: true });
84
+ });
85
+ try {
86
+ return await Promise.race([pending, interrupted]);
87
+ } finally {
88
+ signal.removeEventListener("abort", onAbort);
89
+ }
90
+ }, "withAbort");
91
+ var boundedResponse = /* @__PURE__ */ __name(async (response, maxBytes, signal) => {
92
+ const length = response.headers.get("content-length");
93
+ if (length !== null && (!/^\d+$/.test(length) || Number(length) > maxBytes)) {
94
+ void response.body?.cancel().catch(() => {
95
+ });
96
+ throw new CliError("invalid_response", "Embedding response exceeds the byte budget");
97
+ }
98
+ if (!response.body)
99
+ throw new CliError("invalid_response", "Embedding response has no body");
100
+ const reader = response.body.getReader();
101
+ const chunks = [];
102
+ let bytes = 0;
103
+ try {
104
+ for (; ; ) {
105
+ cancelled(signal);
106
+ const part = await withAbort(reader.read(), signal);
107
+ cancelled(signal);
108
+ if (part.done)
109
+ break;
110
+ bytes += part.value.byteLength;
111
+ if (bytes > maxBytes)
112
+ throw new CliError("invalid_response", "Embedding response exceeds the byte budget");
113
+ chunks.push(part.value);
114
+ }
115
+ const body = Buffer.concat(chunks, bytes).toString("utf8");
116
+ try {
117
+ return JSON.parse(body);
118
+ } catch {
119
+ throw new CliError("invalid_response", "Embedding response is not JSON");
120
+ }
121
+ } finally {
122
+ void reader.cancel().catch(() => {
123
+ });
124
+ reader.releaseLock();
125
+ }
126
+ }, "boundedResponse");
127
+ var openMeetingEmbedder = /* @__PURE__ */ __name(async (choice, options = {}) => {
128
+ const descriptor = meetingEmbeddingModel(choice, options.env);
129
+ const { signal } = options;
130
+ cancelled(signal);
131
+ const maxInputBytes = integer(options.maxInputBytes ?? 1024 * 1024, "input byte budget", 16 * 1024 * 1024);
132
+ const maxResponseBytes = integer(options.maxResponseBytes ?? 8 * 1024 * 1024, "response byte budget", 64 * 1024 * 1024);
133
+ if (options.threads !== void 0)
134
+ integer(options.threads, "embedding threads", 128);
135
+ let engine;
136
+ let remoteFailure;
137
+ if (typeof choice === "string") {
138
+ const model = textModel(choice, options.env);
139
+ const directory = options.directory ?? textModelsDirectory(options.env);
140
+ if (!isTextModelInstalled(model, directory))
141
+ throw new CliError("configuration_error", "The explicit local embedding model is not installed");
142
+ engine = await openEmbedder(model, directory, {
143
+ ...options.threads === void 0 ? {} : { threads: options.threads }
144
+ });
145
+ } else {
146
+ const remote = validatedRemote(choice.remote);
147
+ const key = choice.apiKey ?? (remote.provider === "openai" ? (options.env ?? process.env).OPENAI_API_KEY : void 0);
148
+ if (remote.provider === "openai" && !key)
149
+ throw new CliError("authentication_error", "The explicit remote embedding model requires an API key");
150
+ const post = options.fetch ?? endpointFetch(remote.baseUrl, 12e4);
151
+ const guarded = /* @__PURE__ */ __name(async (url, init) => {
152
+ try {
153
+ cancelled(signal);
154
+ const responseTask = post(url, { ...init, redirect: "manual", ...signal ? { signal } : {} }).then((response2) => {
155
+ if (signal?.aborted) {
156
+ void response2.body?.cancel().catch(() => {
157
+ });
158
+ cancelled(signal);
159
+ }
160
+ return response2;
161
+ });
162
+ const response = await withAbort(responseTask, signal);
163
+ if (signal?.aborted) {
164
+ void response.body?.cancel().catch(() => {
165
+ });
166
+ cancelled(signal);
167
+ }
168
+ if (response.status >= 300 && response.status < 400) {
169
+ void response.body?.cancel().catch(() => {
170
+ });
171
+ throw new CliError("invalid_response", "Embedding redirects are refused");
172
+ }
173
+ if (!response.ok) {
174
+ void response.body?.cancel().catch(() => {
175
+ });
176
+ return new Response("{}", { status: response.status });
177
+ }
178
+ const body = await boundedResponse(response, maxResponseBytes, signal);
179
+ if (!body || typeof body !== "object" || !("data" in body) || !Array.isArray(body.data) || body.data.length > 256)
180
+ throw new CliError("invalid_response", "Embedding response lacks vector data");
181
+ for (const entry of body.data) {
182
+ if (!entry || typeof entry !== "object" || !Number.isSafeInteger(entry.index) || entry.index < 0 || !Array.isArray(entry.embedding) || entry.embedding.length !== remote.dims || entry.embedding.some((value) => typeof value !== "number" || !Number.isFinite(value) || !Number.isFinite(Math.fround(value))))
183
+ throw new CliError("invalid_response", "Embedding response contains invalid vectors");
184
+ }
185
+ const indices = body.data.map((entry) => entry.index).sort((a, b) => a - b);
186
+ if (indices.some((index, position) => index !== position))
187
+ throw new CliError("invalid_response", "Embedding response contains invalid vector indices");
188
+ return new Response(JSON.stringify({ data: body.data.map((entry) => ({ index: entry.index, embedding: entry.embedding })) }), { status: response.status });
189
+ } catch (error) {
190
+ remoteFailure = error;
191
+ throw error;
192
+ }
193
+ }, "guarded");
194
+ engine = openRemote(remote, key, { concurrency: 1, fetch: guarded, tries: 1, env: options.env ?? process.env });
195
+ }
196
+ if (signal?.aborted) {
197
+ await engine.close();
198
+ cancelled(signal);
199
+ }
200
+ let closed = false;
201
+ let running = false;
202
+ let active = null;
203
+ let closing = null;
204
+ return {
205
+ ...descriptor,
206
+ async embed(texts, kind) {
207
+ cancelled(signal);
208
+ if (closed)
209
+ throw new CliError("configuration_error", "Meeting embedder is closed");
210
+ if (!Array.isArray(texts) || texts.length > 1e3 || texts.some((text) => typeof text !== "string") || !["query", "passage"].includes(kind))
211
+ throw new CliError("validation_error", "Invalid meeting embedding inputs");
212
+ if (Buffer.byteLength(JSON.stringify(texts), "utf8") > maxInputBytes || texts.length * descriptor.dims * 4 > maxResponseBytes)
213
+ throw new CliError("validation_error", "Meeting embedding input or vector payload exceeds its byte budget");
214
+ if (running)
215
+ throw new CliError("validation_error", "A meeting embedding request is already running");
216
+ running = true;
217
+ let settled = /* @__PURE__ */ __name(() => {
218
+ }, "settled");
219
+ active = new Promise((resolve) => {
220
+ settled = resolve;
221
+ });
222
+ remoteFailure = void 0;
223
+ try {
224
+ const vectors = await engine.embed([...texts], kind);
225
+ cancelled(signal);
226
+ if (vectors.length !== texts.length || vectors.some((vector) => vector.length !== descriptor.dims || !vector.some((value) => value !== 0) || [...vector].some((value) => !Number.isFinite(value))))
227
+ throw new CliError("invalid_response", "Meeting embedder returned invalid vectors");
228
+ return vectors;
229
+ } catch (error) {
230
+ cancelled(signal);
231
+ if (remoteFailure instanceof CliError)
232
+ throw remoteFailure;
233
+ if (error instanceof CliError)
234
+ throw error;
235
+ throw new CliError("provider_error", "Meeting embedding failed");
236
+ } finally {
237
+ running = false;
238
+ settled();
239
+ active = null;
240
+ }
241
+ },
242
+ async close() {
243
+ if (!closing) {
244
+ closed = true;
245
+ closing = (async () => {
246
+ await active;
247
+ await engine.close();
248
+ })();
249
+ }
250
+ await closing;
251
+ }
252
+ };
253
+ }, "openMeetingEmbedder");
254
+
255
+ export {
256
+ meetingEmbeddingModel,
257
+ createMeetingRemoteModel,
258
+ openMeetingEmbedder
259
+ };