@luckylillia-dev/plugin-webqq 1.0.2 → 1.0.4

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 (334) hide show
  1. package/assets/face/0.png +0 -0
  2. package/assets/face/1.png +0 -0
  3. package/assets/face/10.png +0 -0
  4. package/assets/face/100.png +0 -0
  5. package/assets/face/101.png +0 -0
  6. package/assets/face/102.png +0 -0
  7. package/assets/face/103.png +0 -0
  8. package/assets/face/104.png +0 -0
  9. package/assets/face/105.png +0 -0
  10. package/assets/face/106.png +0 -0
  11. package/assets/face/107.png +0 -0
  12. package/assets/face/108.png +0 -0
  13. package/assets/face/109.png +0 -0
  14. package/assets/face/11.png +0 -0
  15. package/assets/face/110.png +0 -0
  16. package/assets/face/111.png +0 -0
  17. package/assets/face/112.png +0 -0
  18. package/assets/face/114.png +0 -0
  19. package/assets/face/116.png +0 -0
  20. package/assets/face/118.png +0 -0
  21. package/assets/face/119.png +0 -0
  22. package/assets/face/12.png +0 -0
  23. package/assets/face/120.png +0 -0
  24. package/assets/face/121.png +0 -0
  25. package/assets/face/123.png +0 -0
  26. package/assets/face/124.png +0 -0
  27. package/assets/face/125.png +0 -0
  28. package/assets/face/129.png +0 -0
  29. package/assets/face/13.png +0 -0
  30. package/assets/face/137.png +0 -0
  31. package/assets/face/14.png +0 -0
  32. package/assets/face/144.png +0 -0
  33. package/assets/face/146.png +0 -0
  34. package/assets/face/147.png +0 -0
  35. package/assets/face/15.png +0 -0
  36. package/assets/face/16.png +0 -0
  37. package/assets/face/169.png +0 -0
  38. package/assets/face/171.png +0 -0
  39. package/assets/face/172.png +0 -0
  40. package/assets/face/173.png +0 -0
  41. package/assets/face/174.png +0 -0
  42. package/assets/face/175.png +0 -0
  43. package/assets/face/176.png +0 -0
  44. package/assets/face/177.png +0 -0
  45. package/assets/face/178.png +0 -0
  46. package/assets/face/179.png +0 -0
  47. package/assets/face/18.png +0 -0
  48. package/assets/face/181.png +0 -0
  49. package/assets/face/182.png +0 -0
  50. package/assets/face/183.png +0 -0
  51. package/assets/face/185.png +0 -0
  52. package/assets/face/187.png +0 -0
  53. package/assets/face/19.png +0 -0
  54. package/assets/face/2.png +0 -0
  55. package/assets/face/20.png +0 -0
  56. package/assets/face/201.png +0 -0
  57. package/assets/face/21.png +0 -0
  58. package/assets/face/212.png +0 -0
  59. package/assets/face/22.png +0 -0
  60. package/assets/face/23.png +0 -0
  61. package/assets/face/24.png +0 -0
  62. package/assets/face/25.png +0 -0
  63. package/assets/face/26.png +0 -0
  64. package/assets/face/262.png +0 -0
  65. package/assets/face/263.png +0 -0
  66. package/assets/face/264.png +0 -0
  67. package/assets/face/265.png +0 -0
  68. package/assets/face/266.png +0 -0
  69. package/assets/face/267.png +0 -0
  70. package/assets/face/268.png +0 -0
  71. package/assets/face/269.png +0 -0
  72. package/assets/face/27.png +0 -0
  73. package/assets/face/270.png +0 -0
  74. package/assets/face/271.png +0 -0
  75. package/assets/face/272.png +0 -0
  76. package/assets/face/273.png +0 -0
  77. package/assets/face/277.png +0 -0
  78. package/assets/face/28.png +0 -0
  79. package/assets/face/281.png +0 -0
  80. package/assets/face/282.png +0 -0
  81. package/assets/face/283.png +0 -0
  82. package/assets/face/284.png +0 -0
  83. package/assets/face/285.png +0 -0
  84. package/assets/face/286.png +0 -0
  85. package/assets/face/287.png +0 -0
  86. package/assets/face/289.png +0 -0
  87. package/assets/face/29.png +0 -0
  88. package/assets/face/293.png +0 -0
  89. package/assets/face/294.png +0 -0
  90. package/assets/face/295.png +0 -0
  91. package/assets/face/297.png +0 -0
  92. package/assets/face/298.png +0 -0
  93. package/assets/face/299.png +0 -0
  94. package/assets/face/3.png +0 -0
  95. package/assets/face/30.png +0 -0
  96. package/assets/face/300.png +0 -0
  97. package/assets/face/302.png +0 -0
  98. package/assets/face/303.png +0 -0
  99. package/assets/face/305.png +0 -0
  100. package/assets/face/306.png +0 -0
  101. package/assets/face/307.png +0 -0
  102. package/assets/face/31.png +0 -0
  103. package/assets/face/311.png +0 -0
  104. package/assets/face/312.png +0 -0
  105. package/assets/face/314.png +0 -0
  106. package/assets/face/317.png +0 -0
  107. package/assets/face/318.png +0 -0
  108. package/assets/face/319.png +0 -0
  109. package/assets/face/32.png +0 -0
  110. package/assets/face/320.png +0 -0
  111. package/assets/face/323.png +0 -0
  112. package/assets/face/324.png +0 -0
  113. package/assets/face/325.png +0 -0
  114. package/assets/face/326.png +0 -0
  115. package/assets/face/33.png +0 -0
  116. package/assets/face/332.png +0 -0
  117. package/assets/face/333.png +0 -0
  118. package/assets/face/334.png +0 -0
  119. package/assets/face/336.png +0 -0
  120. package/assets/face/337.png +0 -0
  121. package/assets/face/338.png +0 -0
  122. package/assets/face/339.png +0 -0
  123. package/assets/face/34.png +0 -0
  124. package/assets/face/341.png +0 -0
  125. package/assets/face/342.png +0 -0
  126. package/assets/face/343.png +0 -0
  127. package/assets/face/344.png +0 -0
  128. package/assets/face/345.png +0 -0
  129. package/assets/face/346.png +0 -0
  130. package/assets/face/347.png +0 -0
  131. package/assets/face/349.png +0 -0
  132. package/assets/face/35.png +0 -0
  133. package/assets/face/350.png +0 -0
  134. package/assets/face/351.png +0 -0
  135. package/assets/face/352.png +0 -0
  136. package/assets/face/353.png +0 -0
  137. package/assets/face/354.png +0 -0
  138. package/assets/face/355.png +0 -0
  139. package/assets/face/356.png +0 -0
  140. package/assets/face/357.png +0 -0
  141. package/assets/face/358.png +0 -0
  142. package/assets/face/359.png +0 -0
  143. package/assets/face/36.png +0 -0
  144. package/assets/face/360.png +0 -0
  145. package/assets/face/361.png +0 -0
  146. package/assets/face/362.png +0 -0
  147. package/assets/face/363.png +0 -0
  148. package/assets/face/364.png +0 -0
  149. package/assets/face/365.png +0 -0
  150. package/assets/face/366.png +0 -0
  151. package/assets/face/367.png +0 -0
  152. package/assets/face/368.png +0 -0
  153. package/assets/face/369.png +0 -0
  154. package/assets/face/37.png +0 -0
  155. package/assets/face/370.png +0 -0
  156. package/assets/face/371.png +0 -0
  157. package/assets/face/372.png +0 -0
  158. package/assets/face/373.png +0 -0
  159. package/assets/face/374.png +0 -0
  160. package/assets/face/375.png +0 -0
  161. package/assets/face/376.png +0 -0
  162. package/assets/face/377.png +0 -0
  163. package/assets/face/378.png +0 -0
  164. package/assets/face/379.png +0 -0
  165. package/assets/face/38.png +0 -0
  166. package/assets/face/380.png +0 -0
  167. package/assets/face/381.png +0 -0
  168. package/assets/face/382.png +0 -0
  169. package/assets/face/383.png +0 -0
  170. package/assets/face/384.png +0 -0
  171. package/assets/face/385.png +0 -0
  172. package/assets/face/386.png +0 -0
  173. package/assets/face/387.png +0 -0
  174. package/assets/face/388.png +0 -0
  175. package/assets/face/389.png +0 -0
  176. package/assets/face/39.png +0 -0
  177. package/assets/face/390.png +0 -0
  178. package/assets/face/391.png +0 -0
  179. package/assets/face/392.png +0 -0
  180. package/assets/face/393.png +0 -0
  181. package/assets/face/394.png +0 -0
  182. package/assets/face/395.png +0 -0
  183. package/assets/face/396.png +0 -0
  184. package/assets/face/397.png +0 -0
  185. package/assets/face/398.png +0 -0
  186. package/assets/face/399.png +0 -0
  187. package/assets/face/4.png +0 -0
  188. package/assets/face/400.png +0 -0
  189. package/assets/face/401.png +0 -0
  190. package/assets/face/402.png +0 -0
  191. package/assets/face/403.png +0 -0
  192. package/assets/face/404.png +0 -0
  193. package/assets/face/405.png +0 -0
  194. package/assets/face/406.png +0 -0
  195. package/assets/face/407.png +0 -0
  196. package/assets/face/408.png +0 -0
  197. package/assets/face/409.png +0 -0
  198. package/assets/face/41.png +0 -0
  199. package/assets/face/410.png +0 -0
  200. package/assets/face/411.png +0 -0
  201. package/assets/face/412.png +0 -0
  202. package/assets/face/413.png +0 -0
  203. package/assets/face/415.png +0 -0
  204. package/assets/face/416.png +0 -0
  205. package/assets/face/417.png +0 -0
  206. package/assets/face/419.png +0 -0
  207. package/assets/face/42.png +0 -0
  208. package/assets/face/420.png +0 -0
  209. package/assets/face/421.png +0 -0
  210. package/assets/face/422.png +0 -0
  211. package/assets/face/423.png +0 -0
  212. package/assets/face/424.png +0 -0
  213. package/assets/face/425.png +0 -0
  214. package/assets/face/426.png +0 -0
  215. package/assets/face/427.png +0 -0
  216. package/assets/face/428.png +0 -0
  217. package/assets/face/429.png +0 -0
  218. package/assets/face/43.png +0 -0
  219. package/assets/face/430.png +0 -0
  220. package/assets/face/431.png +0 -0
  221. package/assets/face/432.png +0 -0
  222. package/assets/face/451.png +0 -0
  223. package/assets/face/453.png +0 -0
  224. package/assets/face/454.png +0 -0
  225. package/assets/face/458.png +0 -0
  226. package/assets/face/459.png +0 -0
  227. package/assets/face/46.png +0 -0
  228. package/assets/face/460.png +0 -0
  229. package/assets/face/461.png +0 -0
  230. package/assets/face/462.png +0 -0
  231. package/assets/face/49.png +0 -0
  232. package/assets/face/5.png +0 -0
  233. package/assets/face/53.png +0 -0
  234. package/assets/face/56.png +0 -0
  235. package/assets/face/59.png +0 -0
  236. package/assets/face/6.png +0 -0
  237. package/assets/face/60.png +0 -0
  238. package/assets/face/63.png +0 -0
  239. package/assets/face/64.png +0 -0
  240. package/assets/face/66.png +0 -0
  241. package/assets/face/67.png +0 -0
  242. package/assets/face/7.png +0 -0
  243. package/assets/face/74.png +0 -0
  244. package/assets/face/75.png +0 -0
  245. package/assets/face/76.png +0 -0
  246. package/assets/face/77.png +0 -0
  247. package/assets/face/78.png +0 -0
  248. package/assets/face/79.png +0 -0
  249. package/assets/face/8.png +0 -0
  250. package/assets/face/85.png +0 -0
  251. package/assets/face/86.png +0 -0
  252. package/assets/face/89.png +0 -0
  253. package/assets/face/9.png +0 -0
  254. package/assets/face/96.png +0 -0
  255. package/assets/face/97.png +0 -0
  256. package/assets/face/98.png +0 -0
  257. package/assets/face/99.png +0 -0
  258. package/assets/face/emoji-1f339.png +0 -0
  259. package/assets/face/emoji-1f349.png +0 -0
  260. package/assets/face/emoji-1f34e.png +0 -0
  261. package/assets/face/emoji-1f353.png +0 -0
  262. package/assets/face/emoji-1f35c.png +0 -0
  263. package/assets/face/emoji-1f35e.png +0 -0
  264. package/assets/face/emoji-1f367.png +0 -0
  265. package/assets/face/emoji-1f37a.png +0 -0
  266. package/assets/face/emoji-1f37b.png +0 -0
  267. package/assets/face/emoji-1f389.png +0 -0
  268. package/assets/face/emoji-1f3ea.png +0 -0
  269. package/assets/face/emoji-1f40e.png +0 -0
  270. package/assets/face/emoji-1f414.png +0 -0
  271. package/assets/face/emoji-1f41b.png +0 -0
  272. package/assets/face/emoji-1f42e.png +0 -0
  273. package/assets/face/emoji-1f433.png +0 -0
  274. package/assets/face/emoji-1f435.png +0 -0
  275. package/assets/face/emoji-1f436.png +0 -0
  276. package/assets/face/emoji-1f437.png +0 -0
  277. package/assets/face/emoji-1f438.png +0 -0
  278. package/assets/face/emoji-1f440.png +0 -0
  279. package/assets/face/emoji-1f446.png +0 -0
  280. package/assets/face/emoji-1f44a.png +0 -0
  281. package/assets/face/emoji-1f44c.png +0 -0
  282. package/assets/face/emoji-1f44d.png +0 -0
  283. package/assets/face/emoji-1f44e.png +0 -0
  284. package/assets/face/emoji-1f44f.png +0 -0
  285. package/assets/face/emoji-1f462.png +0 -0
  286. package/assets/face/emoji-1f466.png +0 -0
  287. package/assets/face/emoji-1f467.png +0 -0
  288. package/assets/face/emoji-1f47b.png +0 -0
  289. package/assets/face/emoji-1f489.png +0 -0
  290. package/assets/face/emoji-1f493.png +0 -0
  291. package/assets/face/emoji-1f49d.png +0 -0
  292. package/assets/face/emoji-1f4a3.png +0 -0
  293. package/assets/face/emoji-1f4a4.png +0 -0
  294. package/assets/face/emoji-1f4a6.png +0 -0
  295. package/assets/face/emoji-1f4a8.png +0 -0
  296. package/assets/face/emoji-1f4a9.png +0 -0
  297. package/assets/face/emoji-1f4aa.png +0 -0
  298. package/assets/face/emoji-1f4eb.png +0 -0
  299. package/assets/face/emoji-1f525.png +0 -0
  300. package/assets/face/emoji-1f52b.png +0 -0
  301. package/assets/face/emoji-1f601.png +0 -0
  302. package/assets/face/emoji-1f602.png +0 -0
  303. package/assets/face/emoji-1f604.png +0 -0
  304. package/assets/face/emoji-1f60a.png +0 -0
  305. package/assets/face/emoji-1f60c.png +0 -0
  306. package/assets/face/emoji-1f60d.png +0 -0
  307. package/assets/face/emoji-1f60f.png +0 -0
  308. package/assets/face/emoji-1f612.png +0 -0
  309. package/assets/face/emoji-1f613.png +0 -0
  310. package/assets/face/emoji-1f614.png +0 -0
  311. package/assets/face/emoji-1f618.png +0 -0
  312. package/assets/face/emoji-1f61a.png +0 -0
  313. package/assets/face/emoji-1f61c.png +0 -0
  314. package/assets/face/emoji-1f61d.png +0 -0
  315. package/assets/face/emoji-1f62d.png +0 -0
  316. package/assets/face/emoji-1f630.png +0 -0
  317. package/assets/face/emoji-1f631.png +0 -0
  318. package/assets/face/emoji-1f633.png +0 -0
  319. package/assets/face/emoji-1f64f.png +0 -0
  320. package/assets/face/emoji-1f6ac.png +0 -0
  321. package/assets/face/emoji-2600.png +0 -0
  322. package/assets/face/emoji-2615.png +0 -0
  323. package/assets/face/emoji-263a.png +0 -0
  324. package/assets/face/emoji-2728.png +0 -0
  325. package/assets/face/emoji-2754.png +0 -0
  326. package/lib/client/chunks/WebQQEntry-QUBLXEFH.js +91 -0
  327. package/lib/client/chunks/chunk-MBPE66O6.js +1 -0
  328. package/lib/client/module.js +1 -1
  329. package/lib/index.js +289 -102
  330. package/lib/index.js.map +4 -4
  331. package/lib/types/face.d.ts +3 -0
  332. package/package.json +1 -1
  333. package/lib/client/chunks/WebQQEntry-34LQMVRZ.js +0 -91
  334. package/lib/client/chunks/chunk-JP6IZEMY.js +0 -1
package/lib/index.js CHANGED
@@ -4818,12 +4818,12 @@ var FileTypeParser = class _FileTypeParser {
4818
4818
  const tokenizer = this.createTokenizerFromWebStream(stream2);
4819
4819
  return this.fromTokenizer(tokenizer);
4820
4820
  }
4821
- async fromFile(path10) {
4821
+ async fromFile(path11) {
4822
4822
  this.options.signal?.throwIfAborted();
4823
4823
  const { fromFile, NotRegularFileError } = await importAtRuntime("strtok3");
4824
4824
  let tokenizer;
4825
4825
  try {
4826
- tokenizer = await fromFile(path10, {
4826
+ tokenizer = await fromFile(path11, {
4827
4827
  ...this.getTokenizerOptions(),
4828
4828
  regularFileOnly: true
4829
4829
  });
@@ -6109,8 +6109,8 @@ var FileTypeParser = class _FileTypeParser {
6109
6109
  };
6110
6110
  var supportedExtensions = new Set(extensions);
6111
6111
  var supportedMimeTypes = new Set(mimeTypes);
6112
- async function fileTypeFromFile(path10, options) {
6113
- return new FileTypeParser(options).fromFile(path10);
6112
+ async function fileTypeFromFile(path11, options) {
6113
+ return new FileTypeParser(options).fromFile(path11);
6114
6114
  }
6115
6115
 
6116
6116
  // _integration/ntqq/lib/chunk-HXWAOY4H.js
@@ -8247,16 +8247,16 @@ var MatcherView = class {
8247
8247
  * @returns {string|undefined}
8248
8248
  */
8249
8249
  getCurrentTag() {
8250
- const path10 = this._matcher.path;
8251
- return path10.length > 0 ? path10[path10.length - 1].tag : void 0;
8250
+ const path11 = this._matcher.path;
8251
+ return path11.length > 0 ? path11[path11.length - 1].tag : void 0;
8252
8252
  }
8253
8253
  /**
8254
8254
  * Get current namespace.
8255
8255
  * @returns {string|undefined}
8256
8256
  */
8257
8257
  getCurrentNamespace() {
8258
- const path10 = this._matcher.path;
8259
- return path10.length > 0 ? path10[path10.length - 1].namespace : void 0;
8258
+ const path11 = this._matcher.path;
8259
+ return path11.length > 0 ? path11[path11.length - 1].namespace : void 0;
8260
8260
  }
8261
8261
  /**
8262
8262
  * Get current node's attribute value.
@@ -8264,9 +8264,9 @@ var MatcherView = class {
8264
8264
  * @returns {*}
8265
8265
  */
8266
8266
  getAttrValue(attrName) {
8267
- const path10 = this._matcher.path;
8268
- if (path10.length === 0) return void 0;
8269
- return path10[path10.length - 1].values?.[attrName];
8267
+ const path11 = this._matcher.path;
8268
+ if (path11.length === 0) return void 0;
8269
+ return path11[path11.length - 1].values?.[attrName];
8270
8270
  }
8271
8271
  /**
8272
8272
  * Check if current node has an attribute.
@@ -8274,9 +8274,9 @@ var MatcherView = class {
8274
8274
  * @returns {boolean}
8275
8275
  */
8276
8276
  hasAttr(attrName) {
8277
- const path10 = this._matcher.path;
8278
- if (path10.length === 0) return false;
8279
- const current = path10[path10.length - 1];
8277
+ const path11 = this._matcher.path;
8278
+ if (path11.length === 0) return false;
8279
+ const current = path11[path11.length - 1];
8280
8280
  return current.values !== void 0 && attrName in current.values;
8281
8281
  }
8282
8282
  /**
@@ -8302,18 +8302,18 @@ var MatcherView = class {
8302
8302
  * @returns {number}
8303
8303
  */
8304
8304
  getPosition() {
8305
- const path10 = this._matcher.path;
8306
- if (path10.length === 0) return -1;
8307
- return path10[path10.length - 1].position ?? 0;
8305
+ const path11 = this._matcher.path;
8306
+ if (path11.length === 0) return -1;
8307
+ return path11[path11.length - 1].position ?? 0;
8308
8308
  }
8309
8309
  /**
8310
8310
  * Get current node's repeat counter (occurrence count of this tag name).
8311
8311
  * @returns {number}
8312
8312
  */
8313
8313
  getCounter() {
8314
- const path10 = this._matcher.path;
8315
- if (path10.length === 0) return -1;
8316
- return path10[path10.length - 1].counter ?? 0;
8314
+ const path11 = this._matcher.path;
8315
+ if (path11.length === 0) return -1;
8316
+ return path11[path11.length - 1].counter ?? 0;
8317
8317
  }
8318
8318
  /**
8319
8319
  * Get current node's sibling index (alias for getPosition).
@@ -19214,26 +19214,26 @@ var throwNestingLimitExceeded = () => {
19214
19214
  };
19215
19215
 
19216
19216
  // node_modules/hono/dist/utils/url.js
19217
- var splitPath = (path10) => {
19218
- const paths = path10.split("/");
19217
+ var splitPath = (path11) => {
19218
+ const paths = path11.split("/");
19219
19219
  if (paths[0] === "") paths.shift();
19220
19220
  return paths;
19221
19221
  };
19222
19222
  var splitRoutingPath = (routePath2) => {
19223
- const { groups, path: path10 } = extractGroupsFromPath(routePath2);
19224
- const paths = splitPath(path10);
19223
+ const { groups, path: path11 } = extractGroupsFromPath(routePath2);
19224
+ const paths = splitPath(path11);
19225
19225
  return replaceGroupMarks(paths, groups);
19226
19226
  };
19227
- var extractGroupsFromPath = (path10) => {
19227
+ var extractGroupsFromPath = (path11) => {
19228
19228
  const groups = [];
19229
- path10 = path10.replace(/\{[^}]+\}/g, (match2, index) => {
19229
+ path11 = path11.replace(/\{[^}]+\}/g, (match2, index) => {
19230
19230
  const mark = `@${index}`;
19231
19231
  groups.push([mark, match2]);
19232
19232
  return mark;
19233
19233
  });
19234
19234
  return {
19235
19235
  groups,
19236
- path: path10
19236
+ path: path11
19237
19237
  };
19238
19238
  };
19239
19239
  var replaceGroupMarks = (paths, groups) => {
@@ -19296,12 +19296,12 @@ var getPath = (request) => {
19296
19296
  const queryIndex = url.indexOf("?", i);
19297
19297
  const hashIndex = url.indexOf("#", i);
19298
19298
  const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
19299
- const path10 = url.slice(start, end);
19300
- const decoded = tryDecode(path10, decodeURIWithPreservedPercent);
19301
- if (/%(?![0-9A-Fa-f]{2})/.test(path10)) {
19299
+ const path11 = url.slice(start, end);
19300
+ const decoded = tryDecode(path11, decodeURIWithPreservedPercent);
19301
+ if (/%(?![0-9A-Fa-f]{2})/.test(path11)) {
19302
19302
  const rewritten = new URL("http://localhost");
19303
19303
  rewritten.pathname = decoded.replace(/[\\\t\n\r]/g, encodeURIComponent);
19304
- if (tryDecode(rewritten.pathname, decodeURIWithPreservedPercent) !== decoded) return tryDecode(path10.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"), decodeURIWithPreservedPercent);
19304
+ if (tryDecode(rewritten.pathname, decodeURIWithPreservedPercent) !== decoded) return tryDecode(path11.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"), decodeURIWithPreservedPercent);
19305
19305
  }
19306
19306
  return decoded;
19307
19307
  } else if (charCode === 63 || charCode === 35) break;
@@ -19316,9 +19316,9 @@ var mergePath = (base, sub, ...rest) => {
19316
19316
  if (rest.length) sub = mergePath(sub, ...rest);
19317
19317
  return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
19318
19318
  };
19319
- var checkOptionalParameter = (path10) => {
19320
- if (path10.charCodeAt(path10.length - 1) !== 63 || !path10.includes(":")) return null;
19321
- const segments = path10.split("/");
19319
+ var checkOptionalParameter = (path11) => {
19320
+ if (path11.charCodeAt(path11.length - 1) !== 63 || !path11.includes(":")) return null;
19321
+ const segments = path11.split("/");
19322
19322
  const results = [];
19323
19323
  let basePath = "";
19324
19324
  segments.forEach((segment) => {
@@ -19429,9 +19429,9 @@ var HonoRequest = class {
19429
19429
  */
19430
19430
  path;
19431
19431
  bodyCache = {};
19432
- constructor(request, path10 = "/", matchResult = [[]]) {
19432
+ constructor(request, path11 = "/", matchResult = [[]]) {
19433
19433
  this.raw = request;
19434
- this.path = path10;
19434
+ this.path = path11;
19435
19435
  this.#matchResult = matchResult;
19436
19436
  }
19437
19437
  param(key) {
@@ -20126,14 +20126,14 @@ var UnsupportedPathError = class extends Error {
20126
20126
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
20127
20127
 
20128
20128
  // node_modules/hono/dist/utils/mount.js
20129
- var countTrailingSlashes = (path10) => {
20130
- let index = path10.length;
20131
- while (index > 0 && path10.charCodeAt(index - 1) === 47) index--;
20132
- return path10.length - index;
20129
+ var countTrailingSlashes = (path11) => {
20130
+ let index = path11.length;
20131
+ while (index > 0 && path11.charCodeAt(index - 1) === 47) index--;
20132
+ return path11.length - index;
20133
20133
  };
20134
20134
  var getPathPrefixLength = (c, pathPrefix, routePath2) => {
20135
20135
  if (!/[:*]/.test(pathPrefix)) return pathPrefix.length;
20136
- const path10 = c.req.path;
20136
+ const path11 = c.req.path;
20137
20137
  const matchResult = c.req[GET_MATCH_RESULT];
20138
20138
  const paramNames = /* @__PURE__ */ new Set();
20139
20139
  let length = 0;
@@ -20149,8 +20149,8 @@ var getPathPrefixLength = (c, pathPrefix, routePath2) => {
20149
20149
  const value = matchResult.length === 2 ? matchResult[1][matchResult[0][c.req.routeIndex][1][pattern[1]]] : matchResult[0][c.req.routeIndex][1][pattern[1]];
20150
20150
  length += value.length + 1;
20151
20151
  } else if (pattern || part.endsWith("*")) {
20152
- const end = path10.indexOf("/", length + 1);
20153
- length = end === -1 ? path10.length : end;
20152
+ const end = path11.indexOf("/", length + 1);
20153
+ length = end === -1 ? path11.length : end;
20154
20154
  } else length += part.length + 1;
20155
20155
  }
20156
20156
  return length;
@@ -20158,16 +20158,16 @@ var getPathPrefixLength = (c, pathPrefix, routePath2) => {
20158
20158
  var createMountedRequest = (c, pathPrefix, routePath2) => {
20159
20159
  if (/[^/]\*$/.test(routePath2)) throw new Error(`mount(): Wildcard must follow "/" in "${routePath2}".`);
20160
20160
  const prefixLength = getPathPrefixLength(c, pathPrefix, routePath2);
20161
- const path10 = c.req.path.slice(prefixLength) || "/";
20162
- if (prefixLength > c.req.path.length || path10[0] !== "/" || /\/(?:\.|%2e){1,2}(?:\/|$)/i.test(path10)) throw new HTTPException(400, { message: "Invalid mounted path" });
20161
+ const path11 = c.req.path.slice(prefixLength) || "/";
20162
+ if (prefixLength > c.req.path.length || path11[0] !== "/" || /\/(?:\.|%2e){1,2}(?:\/|$)/i.test(path11)) throw new HTTPException(400, { message: "Invalid mounted path" });
20163
20163
  const rawUrl = c.req.raw.url;
20164
20164
  if (/^[^/?#]*\/\/[^/?#\\]*[?#\\]/.test(rawUrl)) throw new HTTPException(400, { message: "Invalid mounted path" });
20165
20165
  const rawPathEnd = rawUrl.search(/[?#]/);
20166
20166
  const rawTrailingSlashes = countTrailingSlashes(rawPathEnd === -1 ? rawUrl : rawUrl.slice(0, rawPathEnd));
20167
20167
  if (rawTrailingSlashes > 1 && countTrailingSlashes(c.req.path) === rawTrailingSlashes - 1) throw new HTTPException(400, { message: "Invalid mounted path" });
20168
20168
  const url = new URL(rawUrl);
20169
- url.pathname = path10.replace(/[\\\t\n\r]/g, encodeURIComponent);
20170
- if (path10.includes("%")) {
20169
+ url.pathname = path11.replace(/[\\\t\n\r]/g, encodeURIComponent);
20170
+ if (path11.includes("%")) {
20171
20171
  }
20172
20172
  return new Request(url, c.req.raw);
20173
20173
  };
@@ -20212,8 +20212,8 @@ var Hono = class Hono2 {
20212
20212
  return this;
20213
20213
  };
20214
20214
  });
20215
- this.on = (method, path10, ...handlers2) => {
20216
- for (const p of [path10].flat()) {
20215
+ this.on = (method, path11, ...handlers2) => {
20216
+ for (const p of [path11].flat()) {
20217
20217
  this.#path = p;
20218
20218
  for (const m of [method].flat()) {
20219
20219
  const methodName = m.toUpperCase();
@@ -20267,8 +20267,8 @@ var Hono = class Hono2 {
20267
20267
  * app.route("/api", app2) // GET /api/user
20268
20268
  * ```
20269
20269
  */
20270
- route(path10, app) {
20271
- const subApp = this.basePath(path10);
20270
+ route(path11, app) {
20271
+ const subApp = this.basePath(path11);
20272
20272
  app.routes.map((r) => {
20273
20273
  let handler;
20274
20274
  if (app.errorHandler === errorHandler) handler = r.handler;
@@ -20293,9 +20293,9 @@ var Hono = class Hono2 {
20293
20293
  * const api = new Hono().basePath('/api')
20294
20294
  * ```
20295
20295
  */
20296
- basePath(path10) {
20296
+ basePath(path11) {
20297
20297
  const subApp = this.#clone();
20298
- subApp._basePath = mergePath(this._basePath, path10);
20298
+ subApp._basePath = mergePath(this._basePath, path11);
20299
20299
  return subApp;
20300
20300
  }
20301
20301
  /**
@@ -20373,7 +20373,7 @@ var Hono = class Hono2 {
20373
20373
  * })
20374
20374
  * ```
20375
20375
  */
20376
- mount(path10, applicationHandler, options) {
20376
+ mount(path11, applicationHandler, options) {
20377
20377
  let replaceRequest;
20378
20378
  let optionHandler;
20379
20379
  if (options) {
@@ -20404,18 +20404,18 @@ var Hono = class Hono2 {
20404
20404
  if (res) return res;
20405
20405
  await next();
20406
20406
  };
20407
- this.#addRoute("ALL", mergePath(path10, "*"), handler);
20407
+ this.#addRoute("ALL", mergePath(path11, "*"), handler);
20408
20408
  return this;
20409
20409
  }
20410
- #addRoute(method, path10, handler, baseRoutePath) {
20411
- path10 = mergePath(this._basePath, path10);
20410
+ #addRoute(method, path11, handler, baseRoutePath) {
20411
+ path11 = mergePath(this._basePath, path11);
20412
20412
  const r = {
20413
20413
  basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
20414
- path: path10,
20414
+ path: path11,
20415
20415
  method,
20416
20416
  handler
20417
20417
  };
20418
- this.router.add(method, path10, [handler, r]);
20418
+ this.router.add(method, path11, [handler, r]);
20419
20419
  this.routes.push(r);
20420
20420
  }
20421
20421
  #handleError(err, c) {
@@ -20424,10 +20424,10 @@ var Hono = class Hono2 {
20424
20424
  }
20425
20425
  #dispatch(request, executionCtx, env, method) {
20426
20426
  if (method === "HEAD") return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))();
20427
- const path10 = this.getPath(request, { env });
20428
- const matchResult = this.router.match(method, path10);
20427
+ const path11 = this.getPath(request, { env });
20428
+ const matchResult = this.router.match(method, path11);
20429
20429
  const c = new Context(request, {
20430
- path: path10,
20430
+ path: path11,
20431
20431
  matchResult,
20432
20432
  env,
20433
20433
  executionCtx,
@@ -20515,19 +20515,19 @@ var createNullObject = () => /* @__PURE__ */ Object.create(null);
20515
20515
 
20516
20516
  // node_modules/hono/dist/router/reg-exp-router/matcher.js
20517
20517
  var emptyParam = [];
20518
- function match(method, path10) {
20518
+ function match(method, path11) {
20519
20519
  const matchers = this.buildAllMatchers();
20520
- const match2 = ((method2, path11) => {
20520
+ const match2 = ((method2, path12) => {
20521
20521
  const matcher = matchers[method2] || matchers["ALL"];
20522
- const staticMatch = matcher[2][path11];
20522
+ const staticMatch = matcher[2][path12];
20523
20523
  if (staticMatch) return staticMatch;
20524
- const match3 = path11.match(matcher[0]);
20524
+ const match3 = path12.match(matcher[0]);
20525
20525
  if (!match3) return [[], emptyParam];
20526
20526
  const index = match3.indexOf("", 1);
20527
20527
  return [matcher[1][index], match3];
20528
20528
  });
20529
20529
  this.match = match2;
20530
- return match2(method, path10);
20530
+ return match2(method, path11);
20531
20531
  }
20532
20532
 
20533
20533
  // node_modules/hono/dist/router/reg-exp-router/node.js
@@ -20620,11 +20620,11 @@ var Trie = class {
20620
20620
  #root = new Node();
20621
20621
  #index = 0;
20622
20622
  paths = createNullObject();
20623
- insert(path10, isStatic) {
20623
+ insert(path11, isStatic) {
20624
20624
  const keys = [];
20625
20625
  if (isStatic) {
20626
- this.#root.insert(path10.split(""), -1, [], this.#context, keys);
20627
- this.paths[path10] = [
20626
+ this.#root.insert(path11.split(""), -1, [], this.#context, keys);
20627
+ this.paths[path11] = [
20628
20628
  -1,
20629
20629
  [],
20630
20630
  keys
@@ -20633,7 +20633,7 @@ var Trie = class {
20633
20633
  }
20634
20634
  const paramAssoc = [];
20635
20635
  const groups = [];
20636
- let markedPath = path10;
20636
+ let markedPath = path11;
20637
20637
  for (let i = 0; ; ) {
20638
20638
  let replaced = false;
20639
20639
  markedPath = markedPath.replace(/\{(?:\{[\d,]+\}|[^}])+\}/g, (m) => {
@@ -20654,7 +20654,7 @@ var Trie = class {
20654
20654
  }
20655
20655
  }
20656
20656
  this.#root.insert(tokens, this.#index, paramAssoc, this.#context, keys);
20657
- this.paths[path10] = [
20657
+ this.paths[path11] = [
20658
20658
  this.#index++,
20659
20659
  paramAssoc,
20660
20660
  keys
@@ -20707,14 +20707,14 @@ var RegExpRouter = class {
20707
20707
  this.#handlers = { ["ALL"]: [] };
20708
20708
  this.#tries = { ["ALL"]: new Trie() };
20709
20709
  }
20710
- #insertPath(method, path10) {
20710
+ #insertPath(method, path11) {
20711
20711
  try {
20712
- this.#tries[method].insert(path10, !/\*|\/:/.test(path10));
20712
+ this.#tries[method].insert(path11, !/\*|\/:/.test(path11));
20713
20713
  } catch (e) {
20714
- throw e === PATH_ERROR ? new UnsupportedPathError(path10) : e;
20714
+ throw e === PATH_ERROR ? new UnsupportedPathError(path11) : e;
20715
20715
  }
20716
20716
  }
20717
- add(method, path10, handler) {
20717
+ add(method, path11, handler) {
20718
20718
  const handlers2 = this.#handlers;
20719
20719
  if (!handlers2) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
20720
20720
  const tries = this.#tries;
@@ -20723,12 +20723,12 @@ var RegExpRouter = class {
20723
20723
  handlers2[method] = [...handlers2["ALL"]];
20724
20724
  for (const p in tries["ALL"].paths) this.#insertPath(method, p);
20725
20725
  }
20726
- if (path10 === "/*") path10 = "*";
20726
+ if (path11 === "/*") path11 = "*";
20727
20727
  const methods2 = method === "ALL" ? Object.keys(handlers2) : [method];
20728
- const paths = checkOptionalParameter(path10) || [path10];
20729
- for (const path11 of paths) for (const m of methods2) {
20730
- if (!tries[m].paths[path11]) this.#insertPath(m, path11);
20731
- handlers2[m].push([handler, path11]);
20728
+ const paths = checkOptionalParameter(path11) || [path11];
20729
+ for (const path12 of paths) for (const m of methods2) {
20730
+ if (!tries[m].paths[path12]) this.#insertPath(m, path12);
20731
+ handlers2[m].push([handler, path12]);
20732
20732
  }
20733
20733
  }
20734
20734
  match = match;
@@ -20753,14 +20753,14 @@ var RegExpRouter = class {
20753
20753
  }, createNullObject())];
20754
20754
  });
20755
20755
  const wildcards = Object.keys(own).filter((p) => endsWithWildcard(trie.paths[p][2]));
20756
- for (const path10 in trie.paths) {
20757
- const [index, , keys] = trie.paths[path10];
20758
- const indexes = [...own[path10]];
20759
- for (const p of wildcards) if (p !== path10 && covers(trie.paths[p][2], keys)) indexes.push(...own[p]);
20756
+ for (const path11 in trie.paths) {
20757
+ const [index, , keys] = trie.paths[path11];
20758
+ const indexes = [...own[path11]];
20759
+ for (const p of wildcards) if (p !== path11 && covers(trie.paths[p][2], keys)) indexes.push(...own[p]);
20760
20760
  const data = indexes.sort((a, b) => a - b).map((i) => entries[i]);
20761
20761
  if (index === -1) {
20762
20762
  const last = Math.max(-1, ...data.flatMap(([, map]) => Object.values(map)));
20763
- staticMap[path10] = [data, last === -1 ? emptyParam : path10.match(regexp).slice(0, last + 1)];
20763
+ staticMap[path11] = [data, last === -1 ? emptyParam : path11.match(regexp).slice(0, last + 1)];
20764
20764
  } else handlerData[index] = data;
20765
20765
  }
20766
20766
  return [
@@ -20779,15 +20779,15 @@ var SmartRouter = class {
20779
20779
  constructor(init) {
20780
20780
  this.#routers = init.routers;
20781
20781
  }
20782
- add(method, path10, handler) {
20782
+ add(method, path11, handler) {
20783
20783
  if (!this.#routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
20784
20784
  this.#routes.push([
20785
20785
  method,
20786
- path10,
20786
+ path11,
20787
20787
  handler
20788
20788
  ]);
20789
20789
  }
20790
- match(method, path10) {
20790
+ match(method, path11) {
20791
20791
  if (!this.#routes) throw new Error("Fatal error");
20792
20792
  const routers = this.#routers;
20793
20793
  const routes = this.#routes;
@@ -20798,7 +20798,7 @@ var SmartRouter = class {
20798
20798
  const router = routers[i];
20799
20799
  try {
20800
20800
  for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) router.add(...routes[i2]);
20801
- res = router.match(method, path10);
20801
+ res = router.match(method, path11);
20802
20802
  } catch (e) {
20803
20803
  if (e instanceof UnsupportedPathError) continue;
20804
20804
  throw e;
@@ -20827,9 +20827,9 @@ var Node3 = class Node4 {
20827
20827
  #patterns = [];
20828
20828
  #pattern;
20829
20829
  #params = emptyParams;
20830
- insert(method, path10, handler) {
20830
+ insert(method, path11, handler) {
20831
20831
  let curNode = this;
20832
- const parts = splitRoutingPath(path10);
20832
+ const parts = splitRoutingPath(path11);
20833
20833
  const possibleKeys = /* @__PURE__ */ new Set();
20834
20834
  let i = 0;
20835
20835
  for (const p of parts) {
@@ -20865,11 +20865,11 @@ var Node3 = class Node4 {
20865
20865
  }
20866
20866
  }
20867
20867
  }
20868
- search(method, path10) {
20868
+ search(method, path11) {
20869
20869
  const handlerSets = [];
20870
20870
  this.#params = emptyParams;
20871
20871
  let curNodes = [this];
20872
- const parts = splitPath(path10);
20872
+ const parts = splitPath(path11);
20873
20873
  const curNodesQueue = [];
20874
20874
  const len = parts.length;
20875
20875
  let partOffsets = null;
@@ -20905,13 +20905,13 @@ var Node3 = class Node4 {
20905
20905
  if (matcher !== true) {
20906
20906
  if (!partOffsets) {
20907
20907
  partOffsets = [];
20908
- let offset = path10[0] === "/" ? 1 : 0;
20908
+ let offset = path11[0] === "/" ? 1 : 0;
20909
20909
  for (let p = 0; p < len; p++) {
20910
20910
  partOffsets[p] = offset;
20911
20911
  offset += parts[p].length + 1;
20912
20912
  }
20913
20913
  }
20914
- const restPathString = path10.slice(partOffsets[i]);
20914
+ const restPathString = path11.slice(partOffsets[i]);
20915
20915
  const m = matcher.exec(restPathString);
20916
20916
  if (m) {
20917
20917
  if (!Object.hasOwn(params, name2)) params[name2] = m[0];
@@ -20952,11 +20952,11 @@ var Node3 = class Node4 {
20952
20952
  var TrieRouter = class {
20953
20953
  name = "TrieRouter";
20954
20954
  #node = new Node3();
20955
- add(method, path10, handler) {
20956
- for (const result of checkOptionalParameter(path10) || [path10]) this.#node.insert(method, result, handler);
20955
+ add(method, path11, handler) {
20956
+ for (const result of checkOptionalParameter(path11) || [path11]) this.#node.insert(method, result, handler);
20957
20957
  }
20958
- match(method, path10) {
20959
- return this.#node.search(method, path10);
20958
+ match(method, path11) {
20959
+ return this.#node.search(method, path11);
20960
20960
  }
20961
20961
  };
20962
20962
 
@@ -22465,7 +22465,83 @@ function createGroupFilesRoutes(ctx) {
22465
22465
  return router;
22466
22466
  }
22467
22467
 
22468
+ // src/face.ts
22469
+ import { readFile as readFile2 } from "node:fs/promises";
22470
+ import path9 from "node:path";
22471
+ var SAFE_FACE_FILE = /^[a-z0-9-]+\.png$/i;
22472
+ function createFaceRoutes(faceDir = path9.resolve(import.meta.dirname, "../assets/face")) {
22473
+ const router = new Hono3();
22474
+ router.on(["GET", "HEAD"], "/:file", async (c) => {
22475
+ const file = c.req.param("file");
22476
+ if (!SAFE_FACE_FILE.test(file)) return c.notFound();
22477
+ let data;
22478
+ try {
22479
+ data = await readFile2(path9.join(faceDir, file));
22480
+ } catch {
22481
+ return c.notFound();
22482
+ }
22483
+ return new Response(c.req.method === "HEAD" ? null : new Uint8Array(data), {
22484
+ headers: {
22485
+ "Content-Type": "image/png",
22486
+ "Cache-Control": "public, max-age=31536000, immutable",
22487
+ "X-Content-Type-Options": "nosniff"
22488
+ }
22489
+ });
22490
+ });
22491
+ return router;
22492
+ }
22493
+
22468
22494
  // src/events.ts
22495
+ function buildNudgeItems(input) {
22496
+ const action = input.displayAction || "\u6233\u4E86\u6233";
22497
+ const items = [
22498
+ { type: "qq", uid: input.senderUid, uin: String(input.senderUin), nm: input.senderName },
22499
+ { type: "nor", txt: ` ${action} ` }
22500
+ ];
22501
+ if (input.displayActionImgUrl) {
22502
+ items.push({ type: "img", src: input.displayActionImgUrl });
22503
+ }
22504
+ if (input.senderUin && input.receiverUin && input.senderUin === input.receiverUin) {
22505
+ items.push({ type: "nor", txt: "\u81EA\u5DF1" });
22506
+ } else {
22507
+ items.push({ type: "qq", uid: input.receiverUid, uin: String(input.receiverUin), nm: input.receiverName });
22508
+ }
22509
+ if (input.displaySuffix) {
22510
+ items.push({ type: "nor", txt: input.displaySuffix });
22511
+ }
22512
+ return items;
22513
+ }
22514
+ var nudgeSeq = 0;
22515
+ function createNudgeMessage(params) {
22516
+ const nowMs = Date.now();
22517
+ const msgId = `nudge_${nowMs}_${++nudgeSeq}`;
22518
+ return {
22519
+ msgId,
22520
+ msgSeq: "",
22521
+ msgTime: Math.floor(nowMs / 1e3),
22522
+ chatType: params.chatType,
22523
+ peerUin: params.peerUin,
22524
+ peerUid: params.peerUid,
22525
+ peerName: params.peerName,
22526
+ senderUin: params.senderUin,
22527
+ senderUid: params.senderUid,
22528
+ sendNickName: params.sendNickName,
22529
+ sendMemberName: "",
22530
+ elements: [
22531
+ {
22532
+ elementType: ElementType.GrayTip,
22533
+ elementId: `${msgId}_0`,
22534
+ grayTipElement: {
22535
+ subElementType: 17,
22536
+ jsonGrayTipElement: {
22537
+ busiId: "1061",
22538
+ jsonStr: JSON.stringify({ items: params.items })
22539
+ }
22540
+ }
22541
+ }
22542
+ ]
22543
+ };
22544
+ }
22469
22545
  function forwardEvents(ctx, sseClients) {
22470
22546
  const broadcastMessage = (event, data) => {
22471
22547
  const serializedData = serializeResult(data);
@@ -22485,6 +22561,47 @@ data: ${JSON.stringify(serializedData)}
22485
22561
  }
22486
22562
  }
22487
22563
  };
22564
+ const resolveGroupMemberName = async (groupCode, uin, uid) => {
22565
+ try {
22566
+ const card = await ctx.store.getGroupMemberCardName(groupCode, uin);
22567
+ if (card) return card;
22568
+ } catch {
22569
+ }
22570
+ if (uid) {
22571
+ try {
22572
+ const user = await ctx.ntUserApi.getUserByUid(uid);
22573
+ if (user?.nick) return user.nick;
22574
+ } catch {
22575
+ }
22576
+ }
22577
+ return String(uin);
22578
+ };
22579
+ const resolveGroupName = async (groupCode) => {
22580
+ try {
22581
+ const groups = await ctx.ntGroupApi.getGroups(false);
22582
+ const hit = groups.find((g) => Number(g.groupCode) === Number(groupCode));
22583
+ if (hit?.groupName) return hit.groupName;
22584
+ } catch {
22585
+ }
22586
+ return "";
22587
+ };
22588
+ const resolveFriendName = async (uin, uid) => {
22589
+ try {
22590
+ const result = await ctx.ntFriendApi.getFriends(false);
22591
+ const list = Array.isArray(result) ? result : result?.friends ?? [];
22592
+ const hit = list.find((f) => Number(f.uin) === Number(uin));
22593
+ if (hit) return hit.remark || hit.nick || String(uin);
22594
+ } catch {
22595
+ }
22596
+ if (uid) {
22597
+ try {
22598
+ const user = await ctx.ntUserApi.getUserByUid(uid);
22599
+ if (user?.nick) return user.nick;
22600
+ } catch {
22601
+ }
22602
+ }
22603
+ return String(uin);
22604
+ };
22488
22605
  ctx.on("nt/message-created", async (data) => {
22489
22606
  if (sseClients.size === 0) return;
22490
22607
  await fillPeerUin(data.message);
@@ -22533,6 +22650,75 @@ data: ${JSON.stringify(serializedData)}
22533
22650
  }
22534
22651
  });
22535
22652
  });
22653
+ ctx.on("nt/group-nudge", async (data) => {
22654
+ if (sseClients.size === 0) return;
22655
+ const [senderName, receiverName, groupName] = await Promise.all([
22656
+ resolveGroupMemberName(data.groupCode, data.senderUin, data.senderUid),
22657
+ data.receiverUin === data.senderUin ? Promise.resolve("") : resolveGroupMemberName(data.groupCode, data.receiverUin, data.receiverUid),
22658
+ resolveGroupName(data.groupCode)
22659
+ ]);
22660
+ const items = buildNudgeItems({
22661
+ senderUid: data.senderUid || "",
22662
+ senderUin: data.senderUin,
22663
+ senderName,
22664
+ receiverUid: data.receiverUid || "",
22665
+ receiverUin: data.receiverUin,
22666
+ receiverName,
22667
+ displayAction: data.displayAction,
22668
+ displaySuffix: data.displaySuffix,
22669
+ displayActionImgUrl: data.displayActionImgUrl
22670
+ });
22671
+ broadcastMessage("message", {
22672
+ type: "message-created",
22673
+ data: createNudgeMessage({
22674
+ chatType: ChatType.Group,
22675
+ peerUin: data.groupCode,
22676
+ peerUid: String(data.groupCode),
22677
+ peerName: groupName,
22678
+ senderUin: data.senderUin,
22679
+ senderUid: data.senderUid || "",
22680
+ sendNickName: senderName,
22681
+ items
22682
+ })
22683
+ });
22684
+ });
22685
+ ctx.on("nt/friend-nudge", async (data) => {
22686
+ if (sseClients.size === 0) return;
22687
+ const selfInfo = ctx.qqProtocol.selfInfo;
22688
+ const selfUin = Number(selfInfo.uin) || 0;
22689
+ const selfUid = selfInfo.uid || "";
22690
+ const friendName = await resolveFriendName(data.uin, data.uid);
22691
+ const senderUin = data.isSelfSend ? selfUin : data.uin;
22692
+ const senderUid = data.isSelfSend ? selfUid : data.uid || "";
22693
+ const senderName = data.isSelfSend ? selfInfo.nick || "\u4F60" : friendName;
22694
+ const receiverUin = data.isSelfReceive ? selfUin : data.uin;
22695
+ const receiverUid = data.isSelfReceive ? selfUid : data.uid || "";
22696
+ const receiverName = data.isSelfReceive ? selfInfo.nick || "\u4F60" : friendName;
22697
+ const items = buildNudgeItems({
22698
+ senderUid,
22699
+ senderUin,
22700
+ senderName,
22701
+ receiverUid,
22702
+ receiverUin,
22703
+ receiverName,
22704
+ displayAction: data.displayAction,
22705
+ displaySuffix: data.displaySuffix,
22706
+ displayActionImgUrl: data.displayActionImgUrl
22707
+ });
22708
+ broadcastMessage("message", {
22709
+ type: "message-created",
22710
+ data: createNudgeMessage({
22711
+ chatType: ChatType.C2C,
22712
+ peerUin: data.uin,
22713
+ peerUid: data.uid || "",
22714
+ peerName: friendName,
22715
+ senderUin,
22716
+ senderUid,
22717
+ sendNickName: friendName,
22718
+ items
22719
+ })
22720
+ });
22721
+ });
22536
22722
  }
22537
22723
 
22538
22724
  // node_modules/hono/dist/utils/stream.js
@@ -22686,7 +22872,7 @@ var streamSSE = (c, cb, onError) => {
22686
22872
 
22687
22873
  // src/index.ts
22688
22874
  import { mkdirSync } from "node:fs";
22689
- import path9 from "node:path";
22875
+ import path10 from "node:path";
22690
22876
 
22691
22877
  // src/settings.ts
22692
22878
  import Schema from "schemastery";
@@ -22736,7 +22922,7 @@ var WebQQ = {
22736
22922
  ctx.on("internal/update", () => {
22737
22923
  });
22738
22924
  installFFmpegBridge(ctx);
22739
- const uploadDir = path9.join(await ctx.storage.dir(), "uploads");
22925
+ const uploadDir = path10.join(await ctx.storage.dir(), "uploads");
22740
22926
  mkdirSync(uploadDir, { recursive: true });
22741
22927
  const sseClients = /* @__PURE__ */ new Set();
22742
22928
  const createPicElement = async (imagePath) => {
@@ -22748,6 +22934,7 @@ var WebQQ = {
22748
22934
  }
22749
22935
  };
22750
22936
  ctx.webuiServer.route("/api/webqq", new Hono3().route("/api/webqq", createWebQQRoutes(ctx, { uploadDir, sseClients, createPicElement })));
22937
+ ctx.webuiServer.route("/face", new Hono3().route("/face", createFaceRoutes()), { public: true });
22751
22938
  forwardEvents(ctx, sseClients);
22752
22939
  ctx.effect(() => () => {
22753
22940
  for (const client of sseClients) client.abort();