@wirecat/zoom-cli 0.75.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 (217) 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-WFLKFKJC.js → all-profiles-PMCFNDMA.js} +11 -11
  17. package/dist/bundle/answer-policy-XU7KEW2V.js +121 -0
  18. package/dist/bundle/{anthropic-H45W4P22.js → anthropic-TGJOKLUS.js} +6 -6
  19. package/dist/bundle/{app-server-I4FPLBIX.js → app-server-OAODUFM3.js} +73 -63
  20. package/dist/bundle/{bun-V5QLYBZU.js → bun-HJHVHJJV.js} +2 -2
  21. package/dist/bundle/{bun-sqlite-X2YZPHDS.js → bun-sqlite-PLBOY6FP.js} +7 -7
  22. package/dist/bundle/{chunk-P6MQ6FS4.js → chunk-2QDD6S2R.js} +8 -8
  23. package/dist/bundle/{chunk-ZMHZ6CQS.js → chunk-2QRGJSKO.js} +2 -2
  24. package/dist/bundle/{chunk-DQBLDZ7M.js → chunk-36SI35XZ.js} +5 -5
  25. package/dist/bundle/{chunk-HKPNQL52.js → chunk-375BH5OD.js} +4 -4
  26. package/dist/bundle/{chunk-T4FMXDDV.js → chunk-3TLQF3DN.js} +3 -3
  27. package/dist/bundle/{chunk-EA2OB75T.js → chunk-4QNW4NK6.js} +1 -1
  28. package/dist/bundle/{chunk-4XDWV6VJ.js → chunk-4Z4VOQRR.js} +17 -17
  29. package/dist/bundle/{chunk-VLK3X53X.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-3YKAFLXY.js → chunk-5KHCFIWI.js} +2 -2
  33. package/dist/bundle/{chunk-NQQVNLO6.js → chunk-635GRAO5.js} +12 -12
  34. package/dist/bundle/{chunk-RKI4BGWG.js → chunk-6JRBMNRN.js} +3 -3
  35. package/dist/bundle/{chunk-Y5J5CAG2.js → chunk-6YCFDDRO.js} +1 -1
  36. package/dist/bundle/{chunk-ZVVRRMLW.js → chunk-77JQIY2V.js} +3 -3
  37. package/dist/bundle/{chunk-IW245Q5B.js → chunk-7AFYZOHU.js} +36 -32
  38. package/dist/bundle/{chunk-V3UK6E5B.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-XUHQ7DVT.js → chunk-7S3N5CTA.js} +1 -1
  42. package/dist/bundle/chunk-7SNU7RFU.js +229 -0
  43. package/dist/bundle/{chunk-4YNUQGDP.js → chunk-A6LK2W5J.js} +1 -1
  44. package/dist/bundle/{chunk-MHXZ62CU.js → chunk-ADJIYY33.js} +1 -1
  45. package/dist/bundle/{chunk-WUWF4EXZ.js → chunk-B7XFDMFV.js} +22 -12
  46. package/dist/bundle/{chunk-2Q4CB4EI.js → chunk-BOJCRTQW.js} +2 -2
  47. package/dist/bundle/{chunk-GPVSGZ4R.js → chunk-CJL5GHTQ.js} +1010 -617
  48. package/dist/bundle/{chunk-BY2YPKZZ.js → chunk-CL6QAZGT.js} +39 -67
  49. package/dist/bundle/{chunk-GU4FVTJV.js → chunk-CUJJZJ4R.js} +44 -9
  50. package/dist/bundle/{chunk-FBYGBR4Q.js → chunk-CZ6OO66B.js} +4 -4
  51. package/dist/bundle/chunk-DCEQIKFD.js +259 -0
  52. package/dist/bundle/{chunk-QBKKTTA3.js → chunk-DDUNPLET.js} +279 -588
  53. package/dist/bundle/{chunk-CAQ5GW3A.js → chunk-DYIRJINE.js} +1 -1
  54. package/dist/bundle/{chunk-L5UILROP.js → chunk-E3UPMPUV.js} +8 -8
  55. package/dist/bundle/{chunk-F6RB5FHZ.js → chunk-ECRFXQHA.js} +1 -1
  56. package/dist/bundle/{chunk-AVCYD4WQ.js → chunk-F4ROWGLU.js} +68 -38
  57. package/dist/bundle/{chunk-6XNTELM5.js → chunk-FDQE2CLT.js} +1 -1
  58. package/dist/bundle/{chunk-PCJRHC5Y.js → chunk-FRC5QIPQ.js} +8 -8
  59. package/dist/bundle/{chunk-4RJL32PF.js → chunk-FS5HPXQN.js} +26 -9
  60. package/dist/bundle/{chunk-ZBYKCVSV.js → chunk-GHBDYYPO.js} +2 -2
  61. package/dist/bundle/{chunk-OUM4ZO53.js → chunk-H2EVYY5Z.js} +1 -1
  62. package/dist/bundle/{chunk-VPSQZ2YR.js → chunk-I3QMPQYD.js} +49 -49
  63. package/dist/bundle/{chunk-3U3W6YY5.js → chunk-ICZVSVTW.js} +71 -252
  64. package/dist/bundle/{chunk-QEO3XTIE.js → chunk-IJTBB23F.js} +32 -33
  65. package/dist/bundle/{chunk-FT7X74RT.js → chunk-IS6MUPN2.js} +4 -4
  66. package/dist/bundle/{chunk-NL6AZ6S2.js → chunk-IUOKIZZN.js} +2 -2
  67. package/dist/bundle/{chunk-3HTJBGNP.js → chunk-IZMRQ3MV.js} +21 -16
  68. package/dist/bundle/{chunk-X2FILY5F.js → chunk-JFVZVPRW.js} +3 -3
  69. package/dist/bundle/{chunk-MNVT7EJS.js → chunk-JMU3E2WA.js} +2 -2
  70. package/dist/bundle/{chunk-T25PR26L.js → chunk-JQUYHPQD.js} +7 -7
  71. package/dist/bundle/{chunk-JDTZCZ5K.js → chunk-KHBSQROH.js} +5 -5
  72. package/dist/bundle/{chunk-HCZYJMBP.js → chunk-KYKW2W6X.js} +1 -1
  73. package/dist/bundle/chunk-LMZUC4CS.js +101 -0
  74. package/dist/bundle/{chunk-PPM7UTCT.js → chunk-LUAS73NT.js} +18 -18
  75. package/dist/bundle/{chunk-P4ZQQLZF.js → chunk-LWMDLXEO.js} +2384 -3000
  76. package/dist/bundle/{chunk-W2AC2RAG.js → chunk-LYVHQ6DJ.js} +14 -14
  77. package/dist/bundle/{chunk-DUPFAY35.js → chunk-MCLZ74II.js} +7 -7
  78. package/dist/bundle/chunk-MIG4RLDB.js +555 -0
  79. package/dist/bundle/{chunk-3URYKAJP.js → chunk-MMAZUJBO.js} +1 -1
  80. package/dist/bundle/{chunk-B6Q53CVA.js → chunk-MTH3JJHF.js} +24 -22
  81. package/dist/bundle/{chunk-7ZVWV33Z.js → chunk-NJJEUG4C.js} +35 -13
  82. package/dist/bundle/{chunk-SEJBS7SI.js → chunk-NKKVVPL5.js} +1 -1
  83. package/dist/bundle/{chunk-TSHUBGN4.js → chunk-NOF6LABG.js} +6 -6
  84. package/dist/bundle/{chunk-F7K2V6OA.js → chunk-NPDPD2H3.js} +12 -12
  85. package/dist/bundle/{chunk-2PYZTRRC.js → chunk-NPIVV52M.js} +1 -1
  86. package/dist/bundle/{chunk-WQOGHND4.js → chunk-OOIU36FA.js} +1 -1
  87. package/dist/bundle/{chunk-XCJGDPMN.js → chunk-OXXJW3A5.js} +22320 -22886
  88. package/dist/bundle/chunk-PM3MB3E7.js +295 -0
  89. package/dist/bundle/{chunk-VUPWDCYV.js → chunk-PO4RZ4XZ.js} +1 -1
  90. package/dist/bundle/{chunk-K5E5MB4C.js → chunk-Q7ZW7XAX.js} +31 -87
  91. package/dist/bundle/{chunk-HNWDEDMU.js → chunk-QAGECFHL.js} +22 -22
  92. package/dist/bundle/{chunk-JTYWSXJG.js → chunk-QE4L2QQZ.js} +9 -9
  93. package/dist/bundle/{chunk-4J5GJJ2I.js → chunk-QKNO3JTG.js} +2 -2
  94. package/dist/bundle/{chunk-IMDTC4MD.js → chunk-QUGESVOE.js} +22 -35
  95. package/dist/bundle/{chunk-ELD5AC7Q.js → chunk-RQS3W4P6.js} +7 -6
  96. package/dist/bundle/{chunk-A3Q3PG54.js → chunk-SFPUSEOT.js} +2 -2
  97. package/dist/bundle/{chunk-SR5X7YKB.js → chunk-SP5OMHOO.js} +3 -3
  98. package/dist/bundle/chunk-STNZQBY4.js +335 -0
  99. package/dist/bundle/{chunk-EOZAJGB4.js → chunk-SVJQRG5N.js} +16 -16
  100. package/dist/bundle/{chunk-IDGWBKMH.js → chunk-SY5NGYKA.js} +12 -12
  101. package/dist/bundle/{chunk-NE4GYKQA.js → chunk-T4CI3YXW.js} +6 -6
  102. package/dist/bundle/{chunk-3YRPDNWK.js → chunk-T6RSYDFA.js} +1075 -443
  103. package/dist/bundle/{chunk-QXQUANWE.js → chunk-TY4FFK2P.js} +6 -6
  104. package/dist/bundle/chunk-UGRGYLEI.js +224 -0
  105. package/dist/bundle/{chunk-C5WQ57AB.js → chunk-VGERRRDC.js} +1 -1
  106. package/dist/bundle/{chunk-NQLL4KRN.js → chunk-VJ2TLU7R.js} +6 -6
  107. package/dist/bundle/{chunk-PX4IMYVB.js → chunk-W7UCN7MF.js} +3 -3
  108. package/dist/bundle/{chunk-RBYVQE3S.js → chunk-WD5OL5JB.js} +81 -5
  109. package/dist/bundle/{chunk-LRCSDAYK.js → chunk-XC3MWABM.js} +4 -4
  110. package/dist/bundle/{chunk-MAE5UGRQ.js → chunk-XCA5N63N.js} +6 -6
  111. package/dist/bundle/chunk-XVHDT4CO.js +31 -0
  112. package/dist/bundle/{chunk-532H3KT3.js → chunk-YFN5A7OP.js} +4 -4
  113. package/dist/bundle/{chunk-IJCUAKR5.js → chunk-YJIGGUPI.js} +4 -4
  114. package/dist/bundle/{chunk-FIVFP53N.js → chunk-YVI5SQPY.js} +1 -1
  115. package/dist/bundle/{chunk-IO3BQ6JU.js → chunk-ZRNNMBPC.js} +31 -577
  116. package/dist/bundle/{chunk-RABCFGT3.js → chunk-ZUMKZOHR.js} +3 -3
  117. package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-ZZ32DXTH.js} +1 -1
  118. package/dist/bundle/{cli-NPRYCWFH.js → cli-Y27PHKBV.js} +105 -84
  119. package/dist/bundle/command-contract-GB7YA3KW.js +45 -0
  120. package/dist/bundle/{command-server-entry-BV4SUPUI.js → command-server-entry-AXQSW2X6.js} +35 -31
  121. package/dist/bundle/config-2OOABHR7.js +108 -0
  122. package/dist/bundle/{decode-PRMKCHHC.js → decode-ZRNOOTUZ.js} +16 -8
  123. package/dist/bundle/{dispatch-EU67WGME.js → dispatch-2GHGPAYH.js} +9 -9
  124. package/dist/bundle/{dist-HGLDGKUW.js → dist-MUFVAMKB.js} +25 -22
  125. package/dist/bundle/{echarts-QIXLXS3G.js → echarts-F4PHDYET.js} +2 -2
  126. package/dist/bundle/{embed-OZN2BIJY.js → embed-KWHCKPCV.js} +7 -7
  127. package/dist/bundle/{embedder-RBDHO6Z6.js → embedder-U3R3RY54.js} +10 -10
  128. package/dist/bundle/{failure-CTJLEB2R.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-MSBTAPAG.js → folders-DVTRFQKW.js} +5 -5
  132. package/dist/bundle/{instructions-MD2RZT5Z.js → instructions-JU4YW6QY.js} +1 -1
  133. package/dist/bundle/{main-FPMCCRIQ.js → main-5UCRPACH.js} +24 -24
  134. package/dist/bundle/{mcp-TDKGDB4V.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-WYCVHAIP.js → meetings-T2UY35DV.js} +43 -7
  139. package/dist/bundle/{node-IEVT2FSJ.js → node-MAVRAF4M.js} +2 -2
  140. package/dist/bundle/{node-sqlite-O4C6IWSM.js → node-sqlite-TFBQ5NDI.js} +8 -8
  141. package/dist/bundle/{oauth-6VXOUXSE.js → oauth-7IG5HWSY.js} +8 -8
  142. package/dist/bundle/{open-AMUIWV3Y.js → open-3R3N7L3X.js} +6 -6
  143. package/dist/bundle/openai-DD5I3DWC.js +28 -0
  144. package/dist/bundle/{output-file-VDOCYH2G.js → output-file-KKHHAYWF.js} +6 -6
  145. package/dist/bundle/{process-6Q23D3TO.js → process-OIO254NR.js} +1 -1
  146. package/dist/bundle/{program-CF2NKA2A.js → program-IBYRU76H.js} +428 -250
  147. package/dist/bundle/{prompt-N3UZE4ZR.js → prompt-LNEOO7PN.js} +6 -6
  148. package/dist/bundle/{recognize-I5F3K3CZ.js → recognize-2WYLT3PC.js} +5 -5
  149. package/dist/bundle/{remote-CJF5KMMY.js → remote-7EAJEIV7.js} +11 -11
  150. package/dist/bundle/{rerank-6WLY6MKY.js → rerank-DZBZ744F.js} +8 -8
  151. package/dist/bundle/run-log-CCIVRSHP.js +135 -0
  152. package/dist/bundle/{serve-FOQJ3WMX.js → serve-T3KQV5SS.js} +15 -15
  153. package/dist/bundle/{server-OEEGRSQD.js → server-2QQAQZ2J.js} +59 -49
  154. package/dist/bundle/server-OJQMPF2R.js +84 -0
  155. package/dist/bundle/{services-Q6SFESMS.js → services-DETAKMC3.js} +80 -54
  156. package/dist/bundle/{speech-PBVEIG4N.js → speech-HD57JNTK.js} +34 -18
  157. package/dist/bundle/{sqlite-runtime-IWR65V6I.js → sqlite-runtime-OCETZSEZ.js} +7 -7
  158. package/dist/bundle/{state-G54C2N6U.js → state-ZKVQ4DBI.js} +7 -7
  159. package/dist/bundle/{store-D5OLXIFW.js → store-7IZ2WMHF.js} +24 -20
  160. package/dist/bundle/{store-7EWMPTTW.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-PQEXKTE5.js → streaming-CLBAO3MG.js} +7 -7
  164. package/dist/bundle/{tokens-J7TFHLEG.js → tokens-WH73ZWFI.js} +10 -10
  165. package/dist/bundle/zm.js +9 -9
  166. package/dist/bundle/{zoom-app-SULPMVN4.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-search-commands.d.ts.map +1 -1
  177. package/dist/meeting-search-commands.js +6 -5
  178. package/dist/meeting-search-commands.js.map +1 -1
  179. package/dist/meeting-source.d.ts.map +1 -1
  180. package/dist/meeting-source.js +15 -1
  181. package/dist/meeting-source.js.map +1 -1
  182. package/dist/permissions.d.ts +8 -4
  183. package/dist/permissions.d.ts.map +1 -1
  184. package/dist/permissions.js +25 -24
  185. package/dist/permissions.js.map +1 -1
  186. package/dist/program-bindings.d.ts.map +1 -1
  187. package/dist/program-bindings.js +10 -6
  188. package/dist/program-bindings.js.map +1 -1
  189. package/dist/program.d.ts +2 -1
  190. package/dist/program.d.ts.map +1 -1
  191. package/dist/program.js.map +1 -1
  192. package/dist/remote-meetings.d.ts +38 -8
  193. package/dist/remote-meetings.d.ts.map +1 -1
  194. package/dist/remote-meetings.js +52 -29
  195. package/dist/remote-meetings.js.map +1 -1
  196. package/dist/run.d.ts.map +1 -1
  197. package/dist/run.js +4 -2
  198. package/dist/run.js.map +1 -1
  199. package/dist/version.d.ts +1 -1
  200. package/dist/version.js +1 -1
  201. package/dist/zoom-app.d.ts.map +1 -1
  202. package/dist/zoom-app.js +1 -0
  203. package/dist/zoom-app.js.map +1 -1
  204. package/package.json +3 -3
  205. package/skills/zoom-cli/SKILL.md +2 -2
  206. package/dist/bundle/answer-policy-XCKC2LLN.js +0 -110
  207. package/dist/bundle/chunk-NU4FSSMN.js +0 -161
  208. package/dist/bundle/command-contract-OJYRKQHR.js +0 -41
  209. package/dist/bundle/config-UMEV24OE.js +0 -97
  210. package/dist/bundle/first-run-HNCD7U3B.js +0 -29
  211. package/dist/bundle/first-screen-374BBMO6.js +0 -39
  212. package/dist/bundle/openai-MEDN6FSK.js +0 -28
  213. package/dist/bundle/run-log-FKF4ZX4M.js +0 -124
  214. package/dist/bundle/server-BAGY5HEZ.js +0 -74
  215. package/dist/bundle/store-connection-34747SCC.js +0 -90
  216. package/dist/bundle/store-maintenance-command-QBO67F7Z.js +0 -65
  217. /package/dist/bundle/{chunk-XWBPP2HX.js → chunk-VKE77B3F.js} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
7
+ // 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/cli/command-server-argv.js
8
8
  var COMMAND_SERVER_ARGV = ["commands", "--serve"];
9
9
  var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
10
10
 
@@ -0,0 +1,229 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ withTimeLimit
5
+ } from "./chunk-6YCFDDRO.js";
6
+ import {
7
+ EmptyAnswer,
8
+ checkedOptions,
9
+ messagesFor,
10
+ range,
11
+ systemFor,
12
+ validateImages
13
+ } from "./chunk-YFN5A7OP.js";
14
+ import {
15
+ refuseOffComputer
16
+ } from "./chunk-QE4L2QQZ.js";
17
+ import {
18
+ envName
19
+ } from "./chunk-GHBDYYPO.js";
20
+ import {
21
+ PLAIN_HTTP_REFUSED,
22
+ endpoint,
23
+ endpointFetch,
24
+ modelAddressAllowed,
25
+ onThisComputer
26
+ } from "./chunk-SP5OMHOO.js";
27
+ import {
28
+ Credentials,
29
+ pathsAreOverridden,
30
+ resolvePaths
31
+ } from "./chunk-QAGECFHL.js";
32
+ import {
33
+ array,
34
+ integer,
35
+ number,
36
+ optional,
37
+ picklist,
38
+ pipe,
39
+ strictObject,
40
+ string,
41
+ union
42
+ } from "./chunk-FS5HPXQN.js";
43
+ import {
44
+ CliError
45
+ } from "./chunk-4QNW4NK6.js";
46
+ import {
47
+ __name
48
+ } from "./chunk-ZVVMGPBJ.js";
49
+
50
+ // 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/models/openai.js
51
+ var options = strictObject({
52
+ temperature: range(0, 2),
53
+ top_p: range(0, 1),
54
+ presence_penalty: range(-2, 2),
55
+ frequency_penalty: range(-2, 2),
56
+ seed: optional(pipe(number(), integer())),
57
+ stop: optional(union([string(), array(string())])),
58
+ response_format: optional(strictObject({ type: picklist(["text", "json_object"]) }))
59
+ });
60
+ var openai = {
61
+ images: true,
62
+ baseUrl: "https://api.openai.com/v1",
63
+ validate: /* @__PURE__ */ __name((given) => checkedOptions("openai", options, given), "validate"),
64
+ complete: /* @__PURE__ */ __name((target, request, checked, apiKey, fetcher) => withTimeLimit(12e4, async (deadline) => {
65
+ const response = await fetcher(`${target.baseUrl.replace(/\/+$/, "")}/chat/completions`, {
66
+ method: "POST",
67
+ headers: { "Content-Type": "application/json", ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {} },
68
+ body: JSON.stringify({
69
+ ...checked,
70
+ model: target.model,
71
+ messages: [
72
+ { role: "system", content: systemFor(request) },
73
+ ...messagesFor(request),
74
+ ...request.images === void 0 ? [] : [
75
+ {
76
+ role: "user",
77
+ content: [
78
+ { type: "text", text: request.prompt },
79
+ ...request.images.map((image) => ({
80
+ type: "image_url",
81
+ image_url: { url: `data:${image.mimeType};base64,${image.data}`, detail: "high" }
82
+ }))
83
+ ]
84
+ }
85
+ ]
86
+ ],
87
+ ...new URL(target.baseUrl).hostname === "api.openai.com" ? { max_completion_tokens: request.maxTokens } : { max_tokens: request.maxTokens }
88
+ }),
89
+ signal: deadline,
90
+ redirect: "error"
91
+ });
92
+ if (!response.ok)
93
+ throw new Error("provider rejected request");
94
+ const body = await response.json();
95
+ const choice = body.choices?.[0];
96
+ const content = choice?.message?.content;
97
+ const total = body.usage?.total_tokens;
98
+ const counted = Number.isInteger(total) && (total ?? 0) >= 1;
99
+ const local = onThisComputer(target.baseUrl);
100
+ const finish = choice?.finish_reason ?? null;
101
+ if (finish !== "stop" && !(local && finish === null))
102
+ throw new Error("incomplete response");
103
+ if (typeof content !== "string" || content.trim() === "")
104
+ throw new EmptyAnswer();
105
+ if (!counted && !local)
106
+ throw new Error("incomplete response");
107
+ const { prompt_tokens: input, completion_tokens: output } = body.usage ?? {};
108
+ return {
109
+ text: content,
110
+ // No count from a server on this computer costs nothing; a rough one keeps the gateway's check meaningful.
111
+ tokens: counted ? total : Math.max(1, Math.ceil(content.length / 4)),
112
+ ...Number.isInteger(input) && Number.isInteger(output) ? { usage: { input, output } } : {}
113
+ };
114
+ }), "complete")
115
+ };
116
+
117
+ // 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/models/index.js
118
+ var modelGateway = /* @__PURE__ */ __name((deps) => ({
119
+ complete: /* @__PURE__ */ __name(async (request) => {
120
+ if (deps.signal?.aborted)
121
+ throw new CliError("cancelled", "model request cancelled");
122
+ const target = deps.resolve(request.purpose);
123
+ if (!target || target.provider === "off")
124
+ throw new CliError("configuration_error", `models.${request.purpose}.provider is not configured; no model was called`);
125
+ if (!request.purpose || !Number.isSafeInteger(request.maxTokens) || request.maxTokens < 1 || typeof request.prompt !== "string")
126
+ throw new CliError("validation_error", "a model request needs a purpose, prompt and positive whole maxTokens");
127
+ validateImages(request.images);
128
+ let adapter = deps.adapters?.[target.provider];
129
+ if (!adapter && target.provider === "openai")
130
+ adapter = openai;
131
+ if (!adapter && target.provider === "anthropic")
132
+ adapter = (await import("./anthropic-TGJOKLUS.js")).anthropic;
133
+ if (!adapter)
134
+ throw new CliError("validation_error", `no model adapter for ${target.provider}`);
135
+ if (request.images !== void 0 && adapter.images !== true)
136
+ throw new CliError("validation_error", "the model adapter does not support image inputs");
137
+ const options2 = adapter.validate(request.options ?? {});
138
+ const baseUrl = target.baseUrl ?? adapter.baseUrl;
139
+ if (!target.model.trim() || !endpoint(baseUrl))
140
+ throw new CliError("validation_error", "a model target needs a model and an HTTP/S endpoint without credentials, query or fragment");
141
+ if (!modelAddressAllowed(baseUrl))
142
+ throw new CliError("validation_error", `${PLAIN_HTTP_REFUSED}; no data was sent`, {
143
+ reason: "model.address-refused"
144
+ });
145
+ refuseOffComputer(deps.env ?? process.env, baseUrl, `${request.purpose} data`);
146
+ if (!await deps.consent(request, { ...target, baseUrl }))
147
+ throw new CliError("permission_error", `model consent for ${request.purpose} is missing; no data was sent`);
148
+ const apiKey = await deps.key?.(target.provider, target);
149
+ if (deps.signal?.aborted)
150
+ throw new CliError("cancelled", "model request cancelled");
151
+ const fetcher = deps.fetch ?? endpointFetch(baseUrl, 12e4);
152
+ let limited = false;
153
+ let unreachable = false;
154
+ let refused = false;
155
+ let status;
156
+ const cancellable = /* @__PURE__ */ __name(async (input, init) => {
157
+ const signal = init?.signal ?? (input instanceof Request ? input.signal : void 0);
158
+ let response;
159
+ try {
160
+ response = await fetcher(input, {
161
+ ...init,
162
+ signal: deps.signal ? AbortSignal.any([deps.signal, ...signal ? [signal] : []]) : signal
163
+ });
164
+ } catch (error) {
165
+ unreachable = true;
166
+ throw error;
167
+ }
168
+ if (!response.ok)
169
+ status = response.status;
170
+ if (response.status === 429)
171
+ limited = true;
172
+ if (response.status === 401 || response.status === 403)
173
+ refused = true;
174
+ return response;
175
+ }, "cancellable");
176
+ try {
177
+ const answer = await adapter.complete({ ...target, baseUrl }, request, options2, apiKey, cancellable);
178
+ if (deps.signal?.aborted)
179
+ throw new Error("cancelled");
180
+ if (typeof answer.text !== "string" || !Number.isSafeInteger(answer.tokens) || answer.tokens < 1)
181
+ throw new Error("incomplete");
182
+ return { ...answer, provider: target.provider, model: target.model };
183
+ } catch (error) {
184
+ if (limited)
185
+ throw new CliError("rate_limited", `${request.purpose} provider rate limit reached; no result was stored`);
186
+ const reason = refused ? "model.key-rejected" : unreachable && !deps.signal?.aborted ? "model.unreachable" : error instanceof EmptyAnswer ? "model.empty-answer" : void 0;
187
+ throw new CliError("invalid_response", `${request.purpose} provider failed or returned an incomplete response; no result was stored`, reason === void 0 && status === void 0 ? void 0 : { ...reason === void 0 ? {} : { reason }, ...status === void 0 ? {} : { status } });
188
+ }
189
+ }, "complete")
190
+ }), "modelGateway");
191
+
192
+ // 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/embeddings/keys.js
193
+ var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
194
+ const host = new URL(baseUrl).host;
195
+ return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
196
+ }, "endpointKeyName");
197
+ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) => {
198
+ const where = { appName: app.appName, prefix: app.envPrefix, env };
199
+ const credentials = /* @__PURE__ */ __name((provider) => new Credentials({
200
+ configDir: resolvePaths(where).config,
201
+ service: app.appName,
202
+ ...["openai", "anthropic"].includes(provider) ? { envVar: envName(app, `${provider.toUpperCase()}_API_KEY`) } : {},
203
+ isolated: pathsAreOverridden(where),
204
+ env,
205
+ ...keyring ? { keyring } : {},
206
+ warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
207
+ `), "warn")
208
+ }), "credentials");
209
+ const account = /* @__PURE__ */ __name((provider) => `embeddings:${provider}`, "account");
210
+ return {
211
+ read: /* @__PURE__ */ __name((provider) => {
212
+ const stored = credentials(provider).read(account(provider));
213
+ if (stored)
214
+ return { key: stored.secret, source: stored.source };
215
+ const shared = ["openai", "anthropic"].includes(provider) ? env[`${provider.toUpperCase()}_API_KEY`]?.trim() : void 0;
216
+ return shared ? { key: shared, source: "env" } : void 0;
217
+ }, "read"),
218
+ /** A key kept under the provider's own name, as an owner may have stored it by hand for the whole tool. */
219
+ readPlain: /* @__PURE__ */ __name((provider) => credentials(provider).read(provider)?.secret, "readPlain"),
220
+ write: /* @__PURE__ */ __name((provider, key) => credentials(provider).write(account(provider), key, { signIn: true }), "write"),
221
+ remove: /* @__PURE__ */ __name((provider) => credentials(provider).remove(account(provider)), "remove")
222
+ };
223
+ }, "embeddingKeys");
224
+
225
+ export {
226
+ modelGateway,
227
+ endpointKeyName,
228
+ embeddingKeys
229
+ };
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/normalize.js
7
+ // 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/store/normalize.js
8
8
  var NORMALIZER_VERSION = 1;
9
9
  var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
10
10
  var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
7
+ // 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/cli/stdin-field.js
8
8
  var fields = /* @__PURE__ */ new WeakMap();
9
9
  var readsStdin = /* @__PURE__ */ __name((command, field) => {
10
10
  fields.set(command, field);
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  LEVELS
5
- } from "./chunk-P6MQ6FS4.js";
5
+ } from "./chunk-2QDD6S2R.js";
6
6
  import {
7
7
  WORD_BODY,
8
8
  e164Of
9
- } from "./chunk-K5E5MB4C.js";
9
+ } from "./chunk-Q7ZW7XAX.js";
10
10
  import {
11
11
  resolvePaths,
12
12
  writeSecurely
13
- } from "./chunk-HNWDEDMU.js";
13
+ } from "./chunk-QAGECFHL.js";
14
14
  import {
15
15
  array,
16
16
  getDotPath,
@@ -29,18 +29,18 @@ import {
29
29
  string,
30
30
  transform,
31
31
  unknown
32
- } from "./chunk-4RJL32PF.js";
32
+ } from "./chunk-FS5HPXQN.js";
33
33
  import {
34
34
  CliError
35
- } from "./chunk-EA2OB75T.js";
35
+ } from "./chunk-4QNW4NK6.js";
36
36
  import {
37
37
  visibleControls
38
- } from "./chunk-HCZYJMBP.js";
38
+ } from "./chunk-KYKW2W6X.js";
39
39
  import {
40
40
  __name
41
41
  } from "./chunk-ZVVMGPBJ.js";
42
42
 
43
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/vcard.js
43
+ // 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/domain/vcard.js
44
44
  import { createHash } from "node:crypto";
45
45
  var MAX_ID = 512;
46
46
  var AS_WORD = new RegExp(`^${WORD_BODY}$`);
@@ -271,7 +271,7 @@ var envelopeOfVcard = /* @__PURE__ */ __name((text, { provider, account, batchId
271
271
  };
272
272
  }, "envelopeOfVcard");
273
273
 
274
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/formatting.js
274
+ // 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/domain/formatting.js
275
275
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
276
276
  var validateFormattedText = /* @__PURE__ */ __name((formatted) => {
277
277
  const { text, spans } = formatted;
@@ -331,7 +331,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted) => {
331
331
  };
332
332
  }, "visibleFormattedText");
333
333
 
334
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/moderation/check.js
334
+ // 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/moderation/check.js
335
335
  var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
336
336
  var LINK = /https?:\/\/\S+/i;
337
337
  var STRENGTH = { report: 0, delete: 1, remove: 2 };
@@ -519,8 +519,8 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
519
519
  }, "nextPoint");
520
520
  var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
521
521
 
522
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/moderation/rules.js
523
- import { existsSync, readFileSync } from "node:fs";
522
+ // 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/moderation/rules.js
523
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
524
524
  import { join } from "node:path";
525
525
  var RULE_ACTIONS = ["report", "delete", "remove"];
526
526
  var OLD_LEVELS = { forbid: "deny", flag: "ask", confirm: "ask", allow: "allow" };
@@ -588,7 +588,16 @@ var KEYS = {
588
588
  "consent.remove": { help: LEVELS.join("|"), parse: String }
589
589
  };
590
590
  var RULE_KEYS = Object.keys(KEYS);
591
- var moderationPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.moderation.json`), "moderationPathFor");
591
+ var stateFolder = /* @__PURE__ */ __name((app, env, folder) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, folder), "stateFolder");
592
+ var profilesFolder = /* @__PURE__ */ __name((app, env) => stateFolder(app, env, "profiles"), "profilesFolder");
593
+ var moderationPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join(profilesFolder(app, env), `${profile}.moderation.json`), "moderationPathFor");
594
+ var namesIn = /* @__PURE__ */ __name((folder, suffix) => existsSync(folder) ? readdirSync(folder).filter((name) => name.endsWith(suffix)).map((name) => name.slice(0, -suffix.length)) : [], "namesIn");
595
+ var moderationProfiles = /* @__PURE__ */ __name((app, env = process.env) => [
596
+ .../* @__PURE__ */ new Set([
597
+ ...namesIn(stateFolder(app, env, "accounts"), ".json"),
598
+ ...namesIn(profilesFolder(app, env), ".moderation.json")
599
+ ])
600
+ ].sort(), "moderationProfiles");
592
601
  var ModerationRules = class {
593
602
  static {
594
603
  __name(this, "ModerationRules");
@@ -678,5 +687,6 @@ export {
678
687
  defaultRules,
679
688
  RULE_KEYS,
680
689
  moderationPathFor,
690
+ moderationProfiles,
681
691
  ModerationRules
682
692
  };
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-EA2OB75T.js";
5
+ } from "./chunk-4QNW4NK6.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
10
+ // 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/cli/input-policy.js
11
11
  var MAX_BUFFERED_INPUT = 16 * 1024 * 1024;
12
12
  var MAX_SECRET_INPUT = 64 * 1024;
13
13
  var policies = /* @__PURE__ */ new WeakMap();